commit 8bb7eca972ad531c9b149c0a51ab43a417385813 Author: Linus Torvalds Date: Sun Oct 31 13:53:10 2021 -0700 Linux 5.15 commit 75fcbd38608c3ce9f4dc784f2ac8916add64c9a8 Merge: ca5e83eddc8bc 27730c8cd60d1 Author: Linus Torvalds Date: Sun Oct 31 11:24:06 2021 -0700 Merge tag 'perf-tools-fixes-for-v5.15-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix compilation of callchain related code on powerpc with gcc11+ - Fix PERF_SAMPLE_WEIGHT_STRUCT support in 'perf script' - Check session->header.env.arch before using it, fixing a segmentation fault - Suppress 'rm dlfilter' build messages * tag 'perf-tools-fixes-for-v5.15-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf script: Fix PERF_SAMPLE_WEIGHT_STRUCT support perf callchain: Fix compilation on powerpc with gcc11+ perf script: Check session->header.env.arch before using it perf build: Suppress 'rm dlfilter' build message commit ca5e83eddc8bc85db5698ef702b610ee64243459 Merge: 180eca540ae06 f3d1436d4bf8c Author: Linus Torvalds Date: Sun Oct 31 11:19:02 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: - Fixes for s390 interrupt delivery - Fixes for Xen emulator bugs showing up as debug kernel WARNs - Fix another issue with SEV/ES string I/O VMGEXITs * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: Take srcu lock in post_kvm_run_save() KVM: SEV-ES: fix another issue with string I/O VMGEXITs KVM: x86/xen: Fix kvm_xen_has_interrupt() sleeping in kvm_vcpu_block() KVM: x86: switch pvclock_gtod_sync_lock to a raw spinlock KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu KVM: s390: clear kicked_mask before sleeping again commit 27730c8cd60d1574d8337276e7a9d7d2ca92e0d1 Author: Kan Liang Date: Wed Sep 29 08:38:13 2021 -0700 perf script: Fix PERF_SAMPLE_WEIGHT_STRUCT support -F weight in perf script is broken. # ./perf mem record # ./perf script -F weight Samples for 'dummy:HG' event do not have WEIGHT attribute set. Cannot print 'weight' field. The sample type, PERF_SAMPLE_WEIGHT_STRUCT, is an alternative of the PERF_SAMPLE_WEIGHT sample type. They share the same space, weight. The lower 32 bits are exactly the same for both sample type. The higher 32 bits may be different for different architecture. For a new kernel on x86, the PERF_SAMPLE_WEIGHT_STRUCT is used. For an old kernel or other ARCHs, the PERF_SAMPLE_WEIGHT is used. With -F weight, current perf script will only check the input string "weight" with the PERF_SAMPLE_WEIGHT sample type. Because the commit ea8d0ed6eae3 ("perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT") didn't update the PERF_SAMPLE_WEIGHT_STRUCT sample type for perf script. For a new kernel on x86, the check fails. Use PERF_SAMPLE_WEIGHT_TYPE, which supports both sample types, to replace PERF_SAMPLE_WEIGHT Fixes: ea8d0ed6eae37b01 ("perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT") Reported-by: Joe Mario Reviewed-by: Kajol Jain Signed-off-by: Kan Liang Tested-by: Jiri Olsa Tested-by: Joe Mario Acked-by: Jiri Olsa Acked-by: Joe Mario Cc: Andi Kleen Link: https://lore.kernel.org/r/1632929894-102778-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 89ac61ff05a5c79545aa93f7b1da7e4dbc60fc9a Author: Jiri Olsa Date: Tue Sep 28 21:52:53 2021 +0200 perf callchain: Fix compilation on powerpc with gcc11+ Got following build fail on powerpc: CC arch/powerpc/util/skip-callchain-idx.o In function ‘check_return_reg’, inlined from ‘check_return_addr’ at arch/powerpc/util/skip-callchain-idx.c:213:7, inlined from ‘arch_skip_callchain_idx’ at arch/powerpc/util/skip-callchain-idx.c:265:7: arch/powerpc/util/skip-callchain-idx.c:54:18: error: ‘dwarf_frame_register’ accessing 96 bytes \ in a region of size 64 [-Werror=stringop-overflow=] 54 | result = dwarf_frame_register(frame, ra_regno, ops_mem, &ops, &nops); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/util/skip-callchain-idx.c: In function ‘arch_skip_callchain_idx’: arch/powerpc/util/skip-callchain-idx.c:54:18: note: referencing argument 3 of type ‘Dwarf_Op *’ In file included from /usr/include/elfutils/libdwfl.h:32, from arch/powerpc/util/skip-callchain-idx.c:10: /usr/include/elfutils/libdw.h:1069:12: note: in a call to function ‘dwarf_frame_register’ 1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno, | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The dwarf_frame_register args changed with [1], Updating ops_mem accordingly. [1] https://sourceware.org/git/?p=elfutils.git;a=commit;h=5621fe5443da23112170235dd5cac161e5c75e65 Reviewed-by: Kajol Jain Signed-off-by: Jiri Olsa Acked-by: Mark Wieelard Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sukadev Bhattiprolu Link: https://lore.kernel.org/r/20210928195253.1267023-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 29c77550eef31b0d72a45b49eeab03b8963264e8 Author: Song Liu Date: Sun Oct 3 22:32:38 2021 -0700 perf script: Check session->header.env.arch before using it When perf.data is not written cleanly, we would like to process existing data as much as possible (please see f_header.data.size == 0 condition in perf_session__read_header). However, perf.data with partial data may crash perf. Specifically, we see crash in 'perf script' for NULL session->header.env.arch. Fix this by checking session->header.env.arch before using it to determine native_arch. Also split the if condition so it is easier to read. Committer notes: If it is a pipe, we already assume is a native arch, so no need to check session->header.env.arch. Signed-off-by: Song Liu Cc: Peter Zijlstra Cc: kernel-team@fb.com Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20211004053238.514936-1-songliubraving@fb.com Signed-off-by: Arnaldo Carvalho de Melo commit 095729484efc4aa4604c474792b059bd940addce Author: Adrian Hunter Date: Thu Sep 30 09:28:49 2021 +0300 perf build: Suppress 'rm dlfilter' build message The following build message: rm dlfilters/dlfilter-test-api-v0.o is unwanted. The object file is being treated as an intermediate file and being automatically removed. Mark the object file as .SECONDARY to prevent removal and hence the message. Requested-by: Arnaldo Carvalho de Melo Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20210930062849.110416-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 180eca540ae06246d594bdd8d8213426a259cc8c Merge: 3a4347d82efdf 09d9e4d041876 Author: Linus Torvalds Date: Sat Oct 30 15:56:38 2021 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three small fixes, all in drivers, and one sizeable update to the UFS driver to remove the HPB 2.0 feature that has been objected to by Jens and Christoph. Although the UFS patch is large and last minute, it's essentially the least intrusive way of resolving the objections in time for the 5.15 release" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: ufshpb: Remove HPB2.0 flows scsi: mpt3sas: Fix reference tag handling for WRITE_INSERT scsi: ufs: ufs-exynos: Correct timeout value setting registers scsi: ibmvfc: Fix up duplicate response detection commit 3a4347d82efdfcc5465b3ed37616426989182915 Merge: bf85ba018f922 675c496d0f92b Author: Linus Torvalds Date: Sat Oct 30 09:55:46 2021 -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 fix for the composite clk that broke when we changed this clk type to use the determine_rate instead of round_rate clk op by default. This caused lots of problems on Rockchip SoCs because they heavily use the composite clk code to model the clk tree" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: composite: Also consider .determine_rate for rate + mux composites commit bf85ba018f9229ce54765a62dba2dea60f7cdafb Merge: 119c85055d867 54c5639d8f507 Author: Linus Torvalds Date: Sat Oct 30 09:28:24 2021 -0700 Merge tag 'riscv-for-linus-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: "These are pretty late, but they do fix concrete issues. - ensure the trap vector's address is aligned. - avoid re-populating the KASAN shadow memory. - allow kasan to build without warnings, which have recently become errors" * tag 'riscv-for-linus-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fix asan-stack clang build riscv: Do not re-populate shadow memory with kasan_populate_early_shadow riscv: fix misalgned trap vector base address commit 09d9e4d041876684d33f21d02bcdaea6586734f1 Author: Avri Altman Date: Sat Oct 30 09:23:01 2021 +0300 scsi: ufs: ufshpb: Remove HPB2.0 flows The Host Performance Buffer feature allows UFS read commands to carry the physical media addresses along with the LBAs, thus allowing less internal L2P-table switches in the device. HPB1.0 allowed a single LBA, while HPB2.0 increases this capacity up to 255 blocks. Carrying more than a single record, the read operation is no longer purely of type "read" but a "hybrid" command: Writing the physical address to the device in one operation and reading back the required payload in another. The JEDEC HPB spec defines two commands for this operation: HPB-WRITE-BUFFER (0x2) to write the physical addresses to device, and HPB-READ to read the payload. With the current HPB design the UFS driver has no alternative but to divide the READ request into 2 separate commands: HPB-WRITE-BUFFER and HPB-READ. This causes a great deal of aggravation to the block layer guys who demanded that we completely revert the entire HPB driver regardless of the huge amount of corporate effort already invested in it. As a compromise, remove only the pieces that implement the 2.0 specification. This is done as a matter of urgency for the final 5.15 release. Link: https://lore.kernel.org/r/20211030062301.248-1-avri.altman@wdc.com Tested-by: Avri Altman Tested-by: Bean Huo Reviewed-by: Bart Van Assche Reviewed-by: Bean Huo Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 119c85055d867b9588263bca59794c872ef2a30e Merge: db2398a56aece d853adc7adf60 Author: Linus Torvalds Date: Fri Oct 29 17:35:56 2021 -0700 Merge tag 'powerpc-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "Three commits fixing some issues introduced with the recent IOMMU changes we merged. Thanks to Alexey Kardashevskiy" * tag 'powerpc-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/pseries/iommu: Create huge DMA window if no MMIO32 is present powerpc/pseries/iommu: Check if the default window in use before removing it powerpc/pseries/iommu: Use correct vfree for it_map commit db2398a56aecec058643d35828e8cca56a0ac0a3 Merge: a379fbbcb88bc c0eee6fbfa2b3 Author: Linus Torvalds Date: Fri Oct 29 17:04:38 2021 -0700 Merge tag 'gpio-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix the return value check when parsing the ngpios property in gpio-xgs-iproc - check the return value of bgpio_init() in gpio-mlxbf2 * tag 'gpio-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mlxbf2.c: Add check for bgpio_init failure gpio: xgs-iproc: fix parsing of ngpios property commit a379fbbcb88bcf43d886977c6fb91fb43f330b84 Merge: 17d50f89410c5 f4aaf1fa8b17e Author: Linus Torvalds Date: Fri Oct 29 11:10:29 2021 -0700 Merge tag 'block-5.15-2021-10-29' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request: - fix nvmet-tcp header digest verification (Amit Engel) - fix a memory leak in nvmet-tcp when releasing a queue (Maurizio Lombardi) - fix nvme-tcp H2CData PDU send accounting again (Sagi Grimberg) - fix digest pointer calculation in nvme-tcp and nvmet-tcp (Varun Prakash) - fix possible nvme-tcp req->offset corruption (Varun Prakash) - Queue drain ordering fix (Ming) - Partition check regression for zoned devices (Shin'ichiro) - Zone queue restart fix (Naohiro) * tag 'block-5.15-2021-10-29' of git://git.kernel.dk/linux-block: block: Fix partition check for host-aware zoned block devices nvmet-tcp: fix header digest verification nvmet-tcp: fix data digest pointer calculation nvme-tcp: fix data digest pointer calculation nvme-tcp: fix possible req->offset corruption block: schedule queue restart after BLK_STS_ZONE_RESOURCE block: drain queue after disk is removed from sysfs nvme-tcp: fix H2CData PDU send accounting (again) nvmet-tcp: fix a memory leak when releasing a queue commit 61a9f252c1c026f84129a7bfa476e880b75e80eb Author: Martin K. Petersen Date: Wed Oct 27 23:42:02 2021 -0400 scsi: mpt3sas: Fix reference tag handling for WRITE_INSERT Testing revealed a problem with how the reference tag was handled for a WRITE_INSERT operation. The SCSI_PROT_REF_CHECK flag is not set when the controller is asked to generate the protection information (i.e. not DIX). And as a result the initial reference tag would not be set in the WRITE_INSERT case. Separate handling of the REF_CHECK and REF_INCREMENT flags to align with both the DIX spec and the MPI implementation. Link: https://lore.kernel.org/r/20211028034202.24225-1-martin.petersen@oracle.com Fixes: b3e2c72af1d5 ("scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI") Signed-off-by: Martin K. Petersen commit 17d50f89410c5f71142657d9a012cbabcaadb134 Merge: fd919bbd334f2 90935eb303e0d Author: Linus Torvalds Date: Fri Oct 29 10:54:44 2021 -0700 Merge tag 'mmc-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - tmio: Re-enable card irqs after a reset - mtk-sd: Fixup probing of cqhci for crypto - cqhci: Fix support for suspend/resume - vub300: Fix control-message timeouts - dw_mmc-exynos: Fix support for tuning - winbond: Silences build errors on M68K - sdhci-esdhc-imx: Fix support for tuning - sdhci-pci: Read card detect from ACPI for Intel Merrifield - sdhci: Fix eMMC support for Thundercomm TurboX CM2290 * tag 'mmc-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: tmio: reenable card irqs after the reset callback mmc: mediatek: Move cqhci init behind ungate clock mmc: cqhci: clear HALT state after CQE enable mmc: vub300: fix control-message timeouts mmc: dw_mmc: exynos: fix the finding clock sample value mmc: winbond: don't build on M68K mmc: sdhci-esdhc-imx: clear the buffer_read_ready to reset standard tuning circuit mmc: sdhci-pci: Read card detect from ACPI for Intel Merrifield mmc: sdhci: Map more voltage level to SDHCI_POWER_330 commit fd919bbd334f22486ee2e9c16ceefe833bb9e32f Merge: 6f11521267319 ccaa66c8dd277 Author: Linus Torvalds Date: Fri Oct 29 10:46:59 2021 -0700 Merge tag 'for-5.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Last minute fixes for crash on 32bit architectures when compression is in use. It's a regression introduced in 5.15-rc and I'd really like not let this into the final release, fixes via stable trees would add unnecessary delay. The problem is on 32bit architectures with highmem enabled, the pages for compression may need to be kmapped, while the patches removed that as we don't use GFP_HIGHMEM allocations anymore. The pages that don't come from local allocation still may be from highmem. Despite being on 32bit there's enough such ARM machines in use so it's not a marginal issue. I did full reverts of the patches one by one instead of a huge one. There's one exception for the "lzo" revert as there was an intermediate patch touching the same code to make it compatible with subpage. I can't revert that one too, so the revert in lzo.c is manual. Qu Wenruo has worked on that with me and verified the changes" * tag 'for-5.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Revert "btrfs: compression: drop kmap/kunmap from lzo" Revert "btrfs: compression: drop kmap/kunmap from zlib" Revert "btrfs: compression: drop kmap/kunmap from zstd" Revert "btrfs: compression: drop kmap/kunmap from generic helpers" commit 6f11521267319659cceabe073112a0e35bcb7ff8 Merge: 75c7a6c1ca631 ddcf906fe5ed8 Author: Linus Torvalds Date: Fri Oct 29 10:41:07 2021 -0700 Merge tag 'trace-v5.15-rc6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing comment fixes from Steven Rostedt: - Some bots have informed me that some of the ftrace functions kernel-doc has formatting issues. - Also, fix my snake instinct. * tag 'trace-v5.15-rc6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix misspelling of "missing" ftrace: Fix kernel-doc formatting issues commit 75c7a6c1ca63131875fe869cbfd404c94d0e1944 Merge: 2c04d67ec1eb5 f8690a4b5a1b6 Author: Linus Torvalds Date: Fri Oct 29 10:17:08 2021 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "Fix a build-time warning in x86/sm4" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: x86/sm4 - Fix invalid section entry size commit 2c04d67ec1eb558c9d0f58d61e64554d8f39f120 Merge: f25a5481af12c 9c7516d669e68 Author: Linus Torvalds Date: Fri Oct 29 10:03:07 2021 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "11 patches. Subsystems affected by this patch series: mm (memcg, memory-failure, oom-kill, secretmem, vmalloc, hugetlb, damon, and tools), and ocfs2" * emailed patches from Andrew Morton : tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer mm/damon/core-test: fix wrong expectations for 'damon_split_regions_of()' mm: khugepaged: skip huge page collapse for special files mm, thp: bail out early in collapse_file for writeback page mm/vmalloc: fix numa spreading for large hash tables mm/secretmem: avoid letting secretmem_users drop to zero ocfs2: fix race between searching chunks and release journal_head from buffer_head mm/oom_kill.c: prevent a race between process_mrelease and exit_mmap mm: filemap: check if THP has hwpoisoned subpage for PMD page fault mm: hwpoison: remove the unnecessary THP check memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT commit 54c5639d8f507ebefa814f574cb6f763033a72a5 Author: Alexandre Ghiti Date: Fri Oct 29 06:59:27 2021 +0200 riscv: Fix asan-stack clang build Nathan reported that because KASAN_SHADOW_OFFSET was not defined in Kconfig, it prevents asan-stack from getting disabled with clang even when CONFIG_KASAN_STACK is disabled: fix this by defining the corresponding config. Reported-by: Nathan Chancellor Signed-off-by: Alexandre Ghiti Fixes: 8ad8b72721d0 ("riscv: Add KASAN support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit cf11d01135ea1ff7fddb612033e3cb5cde279ff2 Author: Alexandre Ghiti Date: Fri Oct 29 06:59:26 2021 +0200 riscv: Do not re-populate shadow memory with kasan_populate_early_shadow When calling this function, all the shadow memory is already populated with kasan_early_shadow_pte which has PAGE_KERNEL protection. kasan_populate_early_shadow write-protects the mapping of the range of addresses passed in argument in zero_pte_populate, which actually write-protects all the shadow memory mapping since kasan_early_shadow_pte is used for all the shadow memory at this point. And then when using memblock API to populate the shadow memory, the first write access to the kernel stack triggers a trap. This becomes visible with the next commit that contains a fix for asan-stack. We already manually populate all the shadow memory in kasan_early_init and we write-protect kasan_early_shadow_pte at the end of kasan_init which makes the calls to kasan_populate_early_shadow superfluous so we can remove them. Signed-off-by: Alexandre Ghiti Fixes: e178d670f251 ("riscv/kasan: add KASAN_VMALLOC support") Fixes: 8ad8b72721d0 ("riscv: Add KASAN support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit ddcf906fe5ed842034b2d995064c1de1dcc7e812 Author: Steven Rostedt (VMware) Date: Fri Oct 29 09:54:14 2021 -0400 tracing: Fix misspelling of "missing" My snake instinct was on and I wrote "misssing" instead of "missing". Signed-off-by: Steven Rostedt (VMware) commit 6130722f1114cac4f3ec858763ad8995d5a2e586 Author: Steven Rostedt (VMware) Date: Fri Oct 29 09:52:23 2021 -0400 ftrace: Fix kernel-doc formatting issues Some functions had kernel-doc that used a comma instead of a hash to separate the function name from the one line description. Also, the "ftrace_is_dead()" had an incomplete description. Signed-off-by: Steven Rostedt (VMware) commit ccaa66c8dd277ac02f96914168bb7177f7ea8117 Author: David Sterba Date: Wed Oct 27 10:44:21 2021 +0200 Revert "btrfs: compression: drop kmap/kunmap from lzo" This reverts commit 8c945d32e60427cbc0859cf7045bbe6196bb03d8. The kmaps in compression code are still needed and cause crashes on 32bit machines (ARM, x86). Reproducible eg. by running fstest btrfs/004 with enabled LZO or ZSTD compression. The revert does not apply cleanly due to changes in a6e66e6f8c1b ("btrfs: rework lzo_decompress_bio() to make it subpage compatible") that reworked the page iteration so the revert is done to be equivalent to the original code. Link: https://lore.kernel.org/all/CAJCQCtT+OuemovPO7GZk8Y8=qtOObr0XTDp8jh4OHD6y84AFxw@mail.gmail.com/ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214839 Tested-by: Qu Wenruo Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 55276e14df4324ade34583adef110e11d249fb7b Author: David Sterba Date: Wed Oct 27 10:42:43 2021 +0200 Revert "btrfs: compression: drop kmap/kunmap from zlib" This reverts commit 696ab562e6df9fbafd6052d8ce4aafcb2ed16069. The kmaps in compression code are still needed and cause crashes on 32bit machines (ARM, x86). Reproducible eg. by running fstest btrfs/004 with enabled LZO or ZSTD compression. Link: https://lore.kernel.org/all/CAJCQCtT+OuemovPO7GZk8Y8=qtOObr0XTDp8jh4OHD6y84AFxw@mail.gmail.com/ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214839 Signed-off-by: David Sterba commit 56ee254d23c59fd48fb6f192d79858f60cfe2bf6 Author: David Sterba Date: Wed Oct 27 10:42:27 2021 +0200 Revert "btrfs: compression: drop kmap/kunmap from zstd" This reverts commit bbaf9715f3f5b5ff0de71da91fcc34ee9c198ed8. The kmaps in compression code are still needed and cause crashes on 32bit machines (ARM, x86). Reproducible eg. by running fstest btrfs/004 with enabled LZO or ZSTD compression. Example stacktrace with ZSTD on a 32bit ARM machine: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c4159ed3 [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 210 Comm: kworker/u2:3 Not tainted 5.14.0-rc79+ #12 Hardware name: Allwinner sun4i/sun5i Families Workqueue: btrfs-delalloc btrfs_work_helper PC is at mmiocpy+0x48/0x330 LR is at ZSTD_compressStream_generic+0x15c/0x28c (mmiocpy) from [] (ZSTD_compressStream_generic+0x15c/0x28c) (ZSTD_compressStream_generic) from [] (ZSTD_compressStream+0x64/0xa0) (ZSTD_compressStream) from [] (zstd_compress_pages+0x170/0x488) (zstd_compress_pages) from [] (btrfs_compress_pages+0x124/0x12c) (btrfs_compress_pages) from [] (compress_file_range+0x3c0/0x834) (compress_file_range) from [] (async_cow_start+0x10/0x28) (async_cow_start) from [] (btrfs_work_helper+0x100/0x230) (btrfs_work_helper) from [] (process_one_work+0x1b4/0x418) (process_one_work) from [] (worker_thread+0x44/0x524) (worker_thread) from [] (kthread+0x180/0x1b0) (kthread) from [] Link: https://lore.kernel.org/all/CAJCQCtT+OuemovPO7GZk8Y8=qtOObr0XTDp8jh4OHD6y84AFxw@mail.gmail.com/ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214839 Signed-off-by: David Sterba commit 9c7516d669e68e94e17203469a873ff5d1d3a41a Author: David Yang Date: Thu Oct 28 14:36:36 2021 -0700 tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer The coccinelle check report: ./tools/testing/selftests/vm/split_huge_page_test.c:344:36-42: ERROR: application of sizeof to pointer Use "strlen" to fix it. Link: https://lkml.kernel.org/r/20211012030116.184027-1-davidcomponentone@gmail.com Signed-off-by: David Yang Reported-by: Zeal Robot Cc: Zi Yan Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2e014660b3e4b7bd0e75f845cdcf745c0f632889 Author: SeongJae Park Date: Thu Oct 28 14:36:33 2021 -0700 mm/damon/core-test: fix wrong expectations for 'damon_split_regions_of()' Kunit test cases for 'damon_split_regions_of()' expects the number of regions after calling the function will be same to their request ('nr_sub'). However, the requested number is just an upper-limit, because the function randomly decides the size of each sub-region. This fixes the wrong expectation. Link: https://lkml.kernel.org/r/20211028090628.14948-1-sj@kernel.org Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests") Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a4aeaa06d45e90f9b279f0b09de84bd00006e733 Author: Yang Shi Date: Thu Oct 28 14:36:30 2021 -0700 mm: khugepaged: skip huge page collapse for special files The read-only THP for filesystems will collapse THP for files opened readonly and mapped with VM_EXEC. The intended usecase is to avoid TLB misses for large text segments. But it doesn't restrict the file types so a THP could be collapsed for a non-regular file, for example, block device, if it is opened readonly and mapped with EXEC permission. This may cause bugs, like [1] and [2]. This is definitely not the intended usecase, so just collapse THP for regular files in order to close the attack surface. [shy828301@gmail.com: fix vm_file check [3]] Link: https://lore.kernel.org/lkml/CACkBjsYwLYLRmX8GpsDpMthagWOjWWrNxqY6ZLNQVr6yx+f5vA@mail.gmail.com/ [1] Link: https://lore.kernel.org/linux-mm/000000000000c6a82505ce284e4c@google.com/ [2] Link: https://lkml.kernel.org/r/CAHbLzkqTW9U3VvTu1Ki5v_cLRC9gHW+znBukg_ycergE0JWj-A@mail.gmail.com [3] Link: https://lkml.kernel.org/r/20211027195221.3825-1-shy828301@gmail.com Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Signed-off-by: Hugh Dickins Signed-off-by: Yang Shi Reported-by: Hao Sun Reported-by: syzbot+aae069be1de40fb11825@syzkaller.appspotmail.com Cc: Matthew Wilcox Cc: Kirill A. Shutemov Cc: Song Liu Cc: Andrea Righi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 74c42e1baacf206338b1dd6b6199ac964512b5bb Author: Rongwei Wang Date: Thu Oct 28 14:36:27 2021 -0700 mm, thp: bail out early in collapse_file for writeback page Currently collapse_file does not explicitly check PG_writeback, instead, page_has_private and try_to_release_page are used to filter writeback pages. This does not work for xfs with blocksize equal to or larger than pagesize, because in such case xfs has no page->private. This makes collapse_file bail out early for writeback page. Otherwise, xfs end_page_writeback will panic as follows. page:fffffe00201bcc80 refcount:0 mapcount:0 mapping:ffff0003f88c86a8 index:0x0 pfn:0x84ef32 aops:xfs_address_space_operations [xfs] ino:30000b7 dentry name:"libtest.so" flags: 0x57fffe0000008027(locked|referenced|uptodate|active|writeback) raw: 57fffe0000008027 ffff80001b48bc28 ffff80001b48bc28 ffff0003f88c86a8 raw: 0000000000000000 0000000000000000 00000000ffffffff ffff0000c3e9a000 page dumped because: VM_BUG_ON_PAGE(((unsigned int) page_ref_count(page) + 127u <= 127u)) page->mem_cgroup:ffff0000c3e9a000 ------------[ cut here ]------------ kernel BUG at include/linux/mm.h:1212! Internal error: Oops - BUG: 0 [#1] SMP Modules linked in: BUG: Bad page state in process khugepaged pfn:84ef32 xfs(E) page:fffffe00201bcc80 refcount:0 mapcount:0 mapping:0 index:0x0 pfn:0x84ef32 libcrc32c(E) rfkill(E) aes_ce_blk(E) crypto_simd(E) ... CPU: 25 PID: 0 Comm: swapper/25 Kdump: loaded Tainted: ... pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) Call trace: end_page_writeback+0x1c0/0x214 iomap_finish_page_writeback+0x13c/0x204 iomap_finish_ioend+0xe8/0x19c iomap_writepage_end_bio+0x38/0x50 bio_endio+0x168/0x1ec blk_update_request+0x278/0x3f0 blk_mq_end_request+0x34/0x15c virtblk_request_done+0x38/0x74 [virtio_blk] blk_done_softirq+0xc4/0x110 __do_softirq+0x128/0x38c __irq_exit_rcu+0x118/0x150 irq_exit+0x1c/0x30 __handle_domain_irq+0x8c/0xf0 gic_handle_irq+0x84/0x108 el1_irq+0xcc/0x180 arch_cpu_idle+0x18/0x40 default_idle_call+0x4c/0x1a0 cpuidle_idle_call+0x168/0x1e0 do_idle+0xb4/0x104 cpu_startup_entry+0x30/0x9c secondary_start_kernel+0x104/0x180 Code: d4210000 b0006161 910c8021 94013f4d (d4210000) ---[ end trace 4a88c6a074082f8c ]--- Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt Link: https://lkml.kernel.org/r/20211022023052.33114-1-rongwei.wang@linux.alibaba.com Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Signed-off-by: Rongwei Wang Signed-off-by: Xu Yu Suggested-by: Yang Shi Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Yang Shi Acked-by: Kirill A. Shutemov Cc: Song Liu Cc: William Kucharski Cc: Hugh Dickins Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ffb29b1c255ab48cb0062a3d11c101501e3e9b3f Author: Chen Wandun Date: Thu Oct 28 14:36:24 2021 -0700 mm/vmalloc: fix numa spreading for large hash tables Eric Dumazet reported a strange numa spreading info in [1], and found commit 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings") introduced this issue [2]. Dig into the difference before and after this patch, page allocation has some difference: before: alloc_large_system_hash __vmalloc __vmalloc_node(..., NUMA_NO_NODE, ...) __vmalloc_node_range __vmalloc_area_node alloc_page /* because NUMA_NO_NODE, so choose alloc_page branch */ alloc_pages_current alloc_page_interleave /* can be proved by print policy mode */ after: alloc_large_system_hash __vmalloc __vmalloc_node(..., NUMA_NO_NODE, ...) __vmalloc_node_range __vmalloc_area_node alloc_pages_node /* choose nid by nuam_mem_id() */ __alloc_pages_node(nid, ....) So after commit 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings"), it will allocate memory in current node instead of interleaving allocate memory. Link: https://lore.kernel.org/linux-mm/CANn89iL6AAyWhfxdHO+jaT075iOa3XcYn9k6JJc7JR2XYn6k_Q@mail.gmail.com/ [1] Link: https://lore.kernel.org/linux-mm/CANn89iLofTR=AK-QOZY87RdUZENCZUT4O6a0hvhu3_EwRMerOg@mail.gmail.com/ [2] Link: https://lkml.kernel.org/r/20211021080744.874701-2-chenwandun@huawei.com Fixes: 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings") Signed-off-by: Chen Wandun Reported-by: Eric Dumazet Cc: Shakeel Butt Cc: Nicholas Piggin Cc: Kefeng Wang Cc: Hanjun Guo Cc: Uladzislau Rezki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 855d44434fa24d5344c1cb0edb38723f891cd415 Author: Kees Cook Date: Thu Oct 28 14:36:21 2021 -0700 mm/secretmem: avoid letting secretmem_users drop to zero Quoting Dmitry: "refcount_inc() needs to be done before fd_install(). After fd_install() finishes, the fd can be used by userspace and we can have secret data in memory before the refcount_inc(). A straightforward misuse where a user will predict the returned fd in another thread before the syscall returns and will use it to store secret data is somewhat dubious because such a user just shoots themself in the foot. But a more interesting misuse would be to close the predicted fd and decrement the refcount before the corresponding refcount_inc, this way one can briefly drop the refcount to zero while there are other users of secretmem." Move fd_install() after refcount_inc(). Link: https://lkml.kernel.org/r/20211021154046.880251-1-keescook@chromium.org Link: https://lore.kernel.org/lkml/CACT4Y+b1sW6-Hkn8HQYw_SsT7X3tp-CJNh2ci0wG3ZnQz9jjig@mail.gmail.com Fixes: 9a436f8ff631 ("PM: hibernate: disable when there are active secretmem users") Signed-off-by: Kees Cook Reported-by: Dmitry Vyukov Reviewed-by: Dmitry Vyukov Reviewed-by: David Hildenbrand Reviewed-by: Jordy Zomer Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6f1b228529ae49b0f85ab89bcdb6c365df401558 Author: Gautham Ananthakrishna Date: Thu Oct 28 14:36:17 2021 -0700 ocfs2: fix race between searching chunks and release journal_head from buffer_head Encountered a race between ocfs2_test_bg_bit_allocatable() and jbd2_journal_put_journal_head() resulting in the below vmcore. PID: 106879 TASK: ffff880244ba9c00 CPU: 2 COMMAND: "loop3" Call trace: panic oops_end no_context __bad_area_nosemaphore bad_area_nosemaphore __do_page_fault do_page_fault page_fault [exception RIP: ocfs2_block_group_find_clear_bits+316] ocfs2_block_group_find_clear_bits [ocfs2] ocfs2_cluster_group_search [ocfs2] ocfs2_search_chain [ocfs2] ocfs2_claim_suballoc_bits [ocfs2] __ocfs2_claim_clusters [ocfs2] ocfs2_claim_clusters [ocfs2] ocfs2_local_alloc_slide_window [ocfs2] ocfs2_reserve_local_alloc_bits [ocfs2] ocfs2_reserve_clusters_with_limit [ocfs2] ocfs2_reserve_clusters [ocfs2] ocfs2_lock_refcount_allocators [ocfs2] ocfs2_make_clusters_writable [ocfs2] ocfs2_replace_cow [ocfs2] ocfs2_refcount_cow [ocfs2] ocfs2_file_write_iter [ocfs2] lo_rw_aio loop_queue_work kthread_worker_fn kthread ret_from_fork When ocfs2_test_bg_bit_allocatable() called bh2jh(bg_bh), the bg_bh->b_private NULL as jbd2_journal_put_journal_head() raced and released the jounal head from the buffer head. Needed to take bit lock for the bit 'BH_JournalHead' to fix this race. Link: https://lkml.kernel.org/r/1634820718-6043-1-git-send-email-gautham.ananthakrishna@oracle.com Signed-off-by: Gautham Ananthakrishna Reviewed-by: Joseph Qi Cc: Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 337546e83fc7e50917f44846beee936abb9c9f1f Author: Suren Baghdasaryan Date: Thu Oct 28 14:36:14 2021 -0700 mm/oom_kill.c: prevent a race between process_mrelease and exit_mmap Race between process_mrelease and exit_mmap, where free_pgtables is called while __oom_reap_task_mm is in progress, leads to kernel crash during pte_offset_map_lock call. oom-reaper avoids this race by setting MMF_OOM_VICTIM flag and causing exit_mmap to take and release mmap_write_lock, blocking it until oom-reaper releases mmap_read_lock. Reusing MMF_OOM_VICTIM for process_mrelease would be the simplest way to fix this race, however that would be considered a hack. Fix this race by elevating mm->mm_users and preventing exit_mmap from executing until process_mrelease is finished. Patch slightly refactors the code to adapt for a possible mmget_not_zero failure. This fix has considerable negative impact on process_mrelease performance and will likely need later optimization. Link: https://lkml.kernel.org/r/20211022014658.263508-1-surenb@google.com Fixes: 884a7e5964e0 ("mm: introduce process_mrelease system call") Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox (Oracle) Cc: Johannes Weiner Cc: Roman Gushchin Cc: Rik van Riel Cc: Minchan Kim Cc: Christian Brauner Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: David Hildenbrand Cc: Jann Horn Cc: Shakeel Butt Cc: Andy Lutomirski Cc: Christian Brauner Cc: Florian Weimer Cc: Jan Engelhardt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eac96c3efdb593df1a57bb5b95dbe037bfa9a522 Author: Yang Shi Date: Thu Oct 28 14:36:11 2021 -0700 mm: filemap: check if THP has hwpoisoned subpage for PMD page fault When handling shmem page fault the THP with corrupted subpage could be PMD mapped if certain conditions are satisfied. But kernel is supposed to send SIGBUS when trying to map hwpoisoned page. There are two paths which may do PMD map: fault around and regular fault. Before commit f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") the thing was even worse in fault around path. The THP could be PMD mapped as long as the VMA fits regardless what subpage is accessed and corrupted. After this commit as long as head page is not corrupted the THP could be PMD mapped. In the regular fault path the THP could be PMD mapped as long as the corrupted page is not accessed and the VMA fits. This loophole could be fixed by iterating every subpage to check if any of them is hwpoisoned or not, but it is somewhat costly in page fault path. So introduce a new page flag called HasHWPoisoned on the first tail page. It indicates the THP has hwpoisoned subpage(s). It is set if any subpage of THP is found hwpoisoned by memory failure and after the refcount is bumped successfully, then cleared when the THP is freed or split. The soft offline path doesn't need this since soft offline handler just marks a subpage hwpoisoned when the subpage is migrated successfully. But shmem THP didn't get split then migrated at all. Link: https://lkml.kernel.org/r/20211020210755.23964-3-shy828301@gmail.com Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Signed-off-by: Yang Shi Reviewed-by: Naoya Horiguchi Suggested-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Matthew Wilcox Cc: Oscar Salvador Cc: Peter Xu Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c7cb42e94473aafe553c0f2a3d8ca904599399ed Author: Yang Shi Date: Thu Oct 28 14:36:07 2021 -0700 mm: hwpoison: remove the unnecessary THP check When handling THP hwpoison checked if the THP is in allocation or free stage since hwpoison may mistreat it as hugetlb page. After commit 415c64c1453a ("mm/memory-failure: split thp earlier in memory error handling") the problem has been fixed, so this check is no longer needed. Remove it. The side effect of the removal is hwpoison may report unsplit THP instead of unknown error for shmem THP. It seems not like a big deal. The following patch "mm: filemap: check if THP has hwpoisoned subpage for PMD page fault" depends on this, which fixes shmem THP with hwpoisoned subpage(s) are mapped PMD wrongly. So this patch needs to be backported to -stable as well. Link: https://lkml.kernel.org/r/20211020210755.23964-2-shy828301@gmail.com Signed-off-by: Yang Shi Suggested-by: Naoya Horiguchi Acked-by: Naoya Horiguchi Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Matthew Wilcox Cc: Oscar Salvador Cc: Peter Xu Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8dcb3060d81dbfa8d954a2ec64ef7ca330f5bb4d Author: Shakeel Butt Date: Thu Oct 28 14:36:04 2021 -0700 memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT Commit 5c1f4e690eec ("mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()") switched to bulk page allocator for order 0 allocation backing vmalloc. However bulk page allocator does not support __GFP_ACCOUNT allocations and there are several users of kvmalloc(__GFP_ACCOUNT). For now make __GFP_ACCOUNT allocations bypass bulk page allocator. In future if there is workload that can be significantly improved with the bulk page allocator with __GFP_ACCCOUNT support, we can revisit the decision. Link: https://lkml.kernel.org/r/20211014151607.2171970-1-shakeelb@google.com Fixes: 5c1f4e690eec ("mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()") Signed-off-by: Shakeel Butt Reported-by: Vasily Averin Tested-by: Vasily Averin Acked-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Roman Gushchin Acked-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f25a5481af12c2360710583b84537eb9e652d57d Merge: f31531e55495c 3dd60fb9d95db Author: Linus Torvalds Date: Thu Oct 28 16:50:25 2021 -0700 Merge tag 'libnvdimm-fixes-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fix from Dan Williams: - Fix a regression introduced in v5.15-rc6 that caused nvdimm namespace shutdown to hang due to reworks in the block layer q_usage_count. * tag 'libnvdimm-fixes-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/pmem: stop using q_usage_count as external pgmap refcount commit 90935eb303e0d12f3d3d0383262e65290321f5f6 Author: Wolfram Sang Date: Thu Oct 28 21:51:49 2021 +0200 mmc: tmio: reenable card irqs after the reset callback The reset callback may clear the internal card detect interrupts, so make sure to reenable them if needed. Fixes: b4d86f37eacb ("mmc: renesas_sdhi: do hard reset if possible") Reported-by: Biju Das Signed-off-by: Wolfram Sang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211028195149.8003-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit f31531e55495ca3746fb895ffdf73586be8259fa Merge: 411a44c24a561 b112166a894db Author: Linus Torvalds Date: Thu Oct 28 12:17:01 2021 -0700 Merge tag 'drm-fixes-2021-10-29' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Quiet but not too quiet, I blame Halloween. The first set of amdgpu fixes missed last week, hence why this has a few more of them, it's mostly display fixes for new GPUs and some debugfs OOB stuff. The i915 patches have one to remove a tracepoint possible issue before it's a real problem, the others around cflush and display are cc'ed to stable as well. Otherwise it's just a few misc fixes. Summary: MAINTAINERS: - Fix the path pattern ttm: - Fix fence leak in ttm_transfered_destroy. core: - Add GPD Win3 rotation quirk i915: - Remove unconditional clflushes - Fix oops on boot due to sync state on disabled DP encoders - Revert backend specific data added to tracepoints - Remove useless and incorrect memory frequence calculation panel: - Add quirk for Aya Neo 2021 seltest: - Reset property count for each drm damage selftest so full run will work correctly. amdgpu: - Fix two potential out of bounds writes in debugfs - Fix revision handling for Yellow Carp - Display fixes for Yellow Carp - Display fixes for DCN 3.1" * tag 'drm-fixes-2021-10-29' of git://anongit.freedesktop.org/drm/drm: (21 commits) MAINTAINERS: dri-devel is for all of drivers/gpu drm/i915: Revert 'guc_id' from i915_request tracepoint drm/amd/display: Fix deadlock when falling back to v2 from v3 drm/amd/display: Fallback to clocks which meet requested voltage on DCN31 drm/amdgpu: Fix even more out of bound writes from debugfs drm: panel-orientation-quirks: Add quirk for GPD Win3 drm/i915/dp: Skip the HW readout of DPCD on disabled encoders drm/i915: Catch yet another unconditioal clflush drm/i915: Convert unconditional clflush to drm_clflush_virt_range() drm/i915/selftests: Properly reset mock object propers for each test drm: panel-orientation-quirks: Add quirk for Aya Neo 2021 drm/ttm: fix memleak in ttm_transfered_destroy drm/amdgpu: support B0&B1 external revision id for yellow carp drm/amd/display: Moved dccg init to after bios golden init drm/amd/display: Increase watermark latencies for DCN3.1 drm/amd/display: increase Z9 latency to workaround underflow in Z9 drm/amd/display: Require immediate flip support for DCN3.1 planes drm/amd/display: Fix prefetch bandwidth calculation for DCN3.1 drm/amd/display: Limit display scaling to up to true 4k for DCN 3.1 drm/amdgpu: fix out of bounds write ... commit b112166a894db446f47a8c31781b037f28ac1721 Author: Daniel Vetter Date: Thu Oct 28 19:08:57 2021 +0200 MAINTAINERS: dri-devel is for all of drivers/gpu Somehow we only have a list of subdirectories, which apparently made it harder for folks to find the gpu maintainers. Fix that. References: https://lore.kernel.org/dri-devel/YXrAAZlxxStNFG%2FK@phenom.ffwll.local/ Signed-off-by: Daniel Vetter Cc: David Airlie Cc: Daniel Vetter Cc: Steven Rostedt Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20211028170857.4029606-1-daniel.vetter@ffwll.ch commit 946ca97e2ea3682e434ae1d0958a4565fa10b6bc Merge: 79516af3497a5 9a4aa3a2f1606 Author: Dave Airlie Date: Fri Oct 29 04:46:14 2021 +1000 Merge tag 'drm-intel-fixes-2021-10-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15 final: - Remove unconditional clflushes - Fix oops on boot due to sync state on disabled DP encoders - Revert backend specific data added to tracepoints - Remove useless and incorrect memory frequence calculation Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/8735olh27y.fsf@intel.com commit 411a44c24a561e449b592ff631b7ae321f1eb559 Merge: 4fb7d85b2ebf0 35392da51b1ab Author: Linus Torvalds Date: Thu Oct 28 10:17:31 2021 -0700 Merge tag 'net-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from WiFi (mac80211), and BPF. Current release - regressions: - skb_expand_head: adjust skb->truesize to fix socket memory accounting - mptcp: fix corrupt receiver key in MPC + data + checksum Previous releases - regressions: - multicast: calculate csum of looped-back and forwarded packets - cgroup: fix memory leak caused by missing cgroup_bpf_offline - cfg80211: fix management registrations locking, prevent list corruption - cfg80211: correct false positive in bridge/4addr mode check - tcp_bpf: fix race in the tcp_bpf_send_verdict resulting in reusing previous verdict Previous releases - always broken: - sctp: enhancements for the verification tag, prevent attackers from killing SCTP sessions - tipc: fix size validations for the MSG_CRYPTO type - mac80211: mesh: fix HE operation element length check, prevent out of bound access - tls: fix sign of socket errors, prevent positive error codes being reported from read()/write() - cfg80211: scan: extend RCU protection in cfg80211_add_nontrans_list() - implement ->sock_is_readable() for UDP and AF_UNIX, fix poll() for sockets in a BPF sockmap - bpf: fix potential race in tail call compatibility check resulting in two operations which would make the map incompatible succeeding - bpf: prevent increasing bpf_jit_limit above max - bpf: fix error usage of map_fd and fdget() in generic batch update - phy: ethtool: lock the phy for consistency of results - prevent infinite while loop in skb_tx_hash() when Tx races with driver reconfiguring the queue <> traffic class mapping - usbnet: fixes for bad HW conjured by syzbot - xen: stop tx queues during live migration, prevent UAF - net-sysfs: initialize uid and gid before calling net_ns_get_ownership - mlxsw: prevent Rx stalls under memory pressure" * tag 'net-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits) Revert "net: hns3: fix pause config problem after autoneg disabled" mptcp: fix corrupt receiver key in MPC + data + checksum riscv, bpf: Fix potential NULL dereference octeontx2-af: Fix possible null pointer dereference. octeontx2-af: Display all enabled PF VF rsrc_alloc entries. octeontx2-af: Check whether ipolicers exists net: ethernet: microchip: lan743x: Fix skb allocation failure net/tls: Fix flipped sign in async_wait.err assignment net/tls: Fix flipped sign in tls_err_abort() calls net/smc: Correct spelling mistake to TCPF_SYN_RECV net/smc: Fix smc_link->llc_testlink_time overflow nfp: bpf: relax prog rejection for mtu check through max_pkt_offset vmxnet3: do not stop tx queues after netif_device_detach() r8169: Add device 10ec:8162 to driver r8169 ptp: Document the PTP_CLK_MAGIC ioctl number usbnet: fix error return code in usbnet_probe() net: hns3: adjust string spaces of some parameters of tx bd info in debugfs net: hns3: expand buffer len for some debugfs command net: hns3: add more string spaces for dumping packets number of queue info in debugfs net: hns3: fix data endian problem of some functions of debugfs ... commit 4fb7d85b2ebf0f06d6b47df2c9f2d45c6fec8b8c Merge: 8685de2ed8c1b d81d0e41ed5fe Author: Linus Torvalds Date: Thu Oct 28 10:04:39 2021 -0700 Merge tag 'spi-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A couple of final driver specific fixes for v5.15, one fixing potential ID collisions between two instances of the Altera driver and one making Microwire full duplex mode actually work on pl022" * tag 'spi-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spl022: fix Microwire full duplex mode spi: altera: Change to dynamic allocation of spi id commit 8685de2ed8c1b0e5cfb07d1986e6a38250a58e8a Merge: eecd231a80a5d 55e6d8037805b Author: Linus Torvalds Date: Thu Oct 28 10:00:58 2021 -0700 Merge tag 'regmap-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "This fixes a potential double free when handling an out of memory error inserting a node into an rbtree regcache" * tag 'regmap-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Fix possible double-free in regcache_rbtree_exit() commit eecd231a80a5d54afc5eb350fc890ab15350408d Merge: fc18cc89b9802 cd004d8299f1d Author: Linus Torvalds Date: Thu Oct 28 09:55:25 2021 -0700 Merge tag 'linux-watchdog-5.15-rc7' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog fixes from Wim Van Sebroeck: "I overlooked Guenters request to sent this upstream earlier, so it's a bit late in the release cycle. This contains: - Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout" - sbsa: only use 32-bit accessors - sbsa: drop unneeded MODULE_ALIAS - ixp4xx_wdt: Fix address space warning - Fix OMAP watchdog early handling" * tag 'linux-watchdog-5.15-rc7' of git://www.linux-watchdog.org/linux-watchdog: watchdog: Fix OMAP watchdog early handling watchdog: ixp4xx_wdt: Fix address space warning watchdog: sbsa: drop unneeded MODULE_ALIAS watchdog: sbsa: only use 32-bit accessors Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout" commit fc18cc89b9802dbe710cbfb52d0b11b3197ead18 Merge: 9c5456773d79b 7fa598f9706d4 Author: Linus Torvalds Date: Thu Oct 28 09:50:56 2021 -0700 Merge tag 'trace-v5.15-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "Do not WARN when attaching event probe to non-existent event If the user tries to attach an event probe (eprobe) to an event that does not exist, it will trigger a warning. There's an error check that only expects memory issues otherwise it is considered a bug. But changes in the code to move around the locking made it that it can error out if the user attempts to attach to an event that does not exist, returning an -ENODEV. As this path can be caused by user space putting in a bad value, do not trigger a WARN" * tag 'trace-v5.15-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Do not warn when connecting eprobe to non existing event commit 35392da51b1ab7ba0c63de0a553e2a93c2314266 Author: Guangbin Huang Date: Thu Oct 28 22:06:24 2021 +0800 Revert "net: hns3: fix pause config problem after autoneg disabled" This reverts commit 3bda2e5df476417b6d08967e2d84234a59d57b1c. According to discussion with Andrew as follow: https://lore.kernel.org/netdev/09eda9fe-196b-006b-6f01-f54e75715961@huawei.com/ HNS3 driver needs to separate pause autoneg from general autoneg, so revert this incorrect patch. Signed-off-by: Guangbin Huang Link: https://lore.kernel.org/r/20211028140624.53149-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit f7cc8890f30d3ddc785e2b2ddc647da5b4b3c3ec Author: Davide Caratti Date: Wed Oct 27 13:38:55 2021 -0700 mptcp: fix corrupt receiver key in MPC + data + checksum using packetdrill it's possible to observe that the receiver key contains random values when clients transmit MP_CAPABLE with data and checksum (as specified in RFC8684 §3.1). Fix the layout of mptcp_out_options, to avoid using the skb extension copy when writing the MP_CAPABLE sub-option. Fixes: d7b269083786 ("mptcp: shrink mptcp_out_options struct") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/233 Reported-by: Poorva Sonparote Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20211027203855.264600-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 27de809a3d83a6199664479ebb19712533d6fd9b Author: Björn Töpel Date: Thu Oct 28 14:51:15 2021 +0200 riscv, bpf: Fix potential NULL dereference The bpf_jit_binary_free() function requires a non-NULL argument. When the RISC-V BPF JIT fails to converge in NR_JIT_ITERATIONS steps, jit_data->header will be NULL, which triggers a NULL dereference. Avoid this by checking the argument, prior calling the function. Fixes: ca6cb5447cec ("riscv, bpf: Factor common RISC-V JIT code") Signed-off-by: Björn Töpel Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/20211028125115.514587-1-bjorn@kernel.org Signed-off-by: Jakub Kicinski commit f3d1436d4bf8ced1c9a62a045d193a65567e1fcc Author: David Woodhouse Date: Tue Oct 26 04:12:38 2021 +0100 KVM: x86: Take srcu lock in post_kvm_run_save() The Xen interrupt injection for event channels relies on accessing the guest's vcpu_info structure in __kvm_xen_has_interrupt(), through a gfn_to_hva_cache. This requires the srcu lock to be held, which is mostly the case except for this code path: [ 11.822877] WARNING: suspicious RCU usage [ 11.822965] ----------------------------- [ 11.823013] include/linux/kvm_host.h:664 suspicious rcu_dereference_check() usage! [ 11.823131] [ 11.823131] other info that might help us debug this: [ 11.823131] [ 11.823196] [ 11.823196] rcu_scheduler_active = 2, debug_locks = 1 [ 11.823253] 1 lock held by dom:0/90: [ 11.823292] #0: ffff998956ec8118 (&vcpu->mutex){+.+.}, at: kvm_vcpu_ioctl+0x85/0x680 [ 11.823379] [ 11.823379] stack backtrace: [ 11.823428] CPU: 2 PID: 90 Comm: dom:0 Kdump: loaded Not tainted 5.4.34+ #5 [ 11.823496] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 11.823612] Call Trace: [ 11.823645] dump_stack+0x7a/0xa5 [ 11.823681] lockdep_rcu_suspicious+0xc5/0x100 [ 11.823726] __kvm_xen_has_interrupt+0x179/0x190 [ 11.823773] kvm_cpu_has_extint+0x6d/0x90 [ 11.823813] kvm_cpu_accept_dm_intr+0xd/0x40 [ 11.823853] kvm_vcpu_ready_for_interrupt_injection+0x20/0x30 < post_kvm_run_save() inlined here > [ 11.823906] kvm_arch_vcpu_ioctl_run+0x135/0x6a0 [ 11.823947] kvm_vcpu_ioctl+0x263/0x680 Fixes: 40da8ccd724f ("KVM: x86/xen: Add event channel interrupt vector upcall") Signed-off-by: David Woodhouse Cc: stable@vger.kernel.org Message-Id: <606aaaf29fca3850a63aa4499826104e77a72346.camel@infradead.org> Signed-off-by: Paolo Bonzini commit f4aaf1fa8b17e74aa46bf0165c35a1575b239d4e Merge: e0c60d0102a5a 86aeda32b887c Author: Jens Axboe Date: Thu Oct 28 08:34:01 2021 -0600 Merge tag 'nvme-5.15-2021-10-28' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixe for Linux 5.15 - fix nvmet-tcp header digest verification (Amit Engel) - fix a memory leak in nvmet-tcp when releasing a queue (Maurizio Lombardi) - fix nvme-tcp H2CData PDU send accounting again (Sagi Grimberg) - fix digest pointer calculation in nvme-tcp and nvmet-tcp (Varun Prakash) - fix possible nvme-tcp req->offset corruption (Varun Prakash)" * tag 'nvme-5.15-2021-10-28' of git://git.infradead.org/nvme: nvmet-tcp: fix header digest verification nvmet-tcp: fix data digest pointer calculation nvme-tcp: fix data digest pointer calculation nvme-tcp: fix possible req->offset corruption nvme-tcp: fix H2CData PDU send accounting (again) nvmet-tcp: fix a memory leak when releasing a queue commit 20af8864a3029fde67fd00999f58bc1ada632374 Merge: e8684db191e41 c2d4c543f74c9 Author: David S. Miller Date: Thu Oct 28 14:47:37 2021 +0100 Merge branch 'octeontx2-debugfs-fixes' Rakesh Babu Saladi says: ==================== RVU Debugfs fix updates. The following patch series consists of the patch fixes done over rvu_debugfs.c and rvu_nix.c files. Patch 1: Check and return if ipolicers do not exists. Patch 2: Fix rsrc_alloc to print all enabled PF/VF entries with list of LFs allocated for each functional block. Patch 3: Fix possible null pointer dereference. ==================== Signed-off-by: David S. Miller commit c2d4c543f74c90f883e8ec62a31973ae8807d354 Author: Rakesh Babu Saladi Date: Wed Oct 27 23:02:34 2021 +0530 octeontx2-af: Fix possible null pointer dereference. This patch fixes possible null pointer dereference in files "rvu_debugfs.c" and "rvu_nix.c" Fixes: 8756828a8148 ("octeontx2-af: Add NPA aura and pool contexts to debugfs") Fixes: 9a946def264d ("octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries") Signed-off-by: Rakesh Babu Saladi Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit e77bcdd1f639809950c45234b08647ac6d3ffe7b Author: Rakesh Babu Date: Wed Oct 27 23:02:33 2021 +0530 octeontx2-af: Display all enabled PF VF rsrc_alloc entries. Currently, we are using a fixed buffer size of length 2048 to display rsrc_alloc output. As a result a maximum of 2048 characters of rsrc_alloc output is displayed, which may lead sometimes to display only partial output. This patch fixes this dependency on max limit of buffer size and displays all PF VF entries. Each column of the debugfs entry "rsrc_alloc" uses a fixed width of 12 characters to print the list of LFs of each block for a PF/VF. If the length of list of LFs of a block exceeds this fixed width then the list gets truncated and displays only a part of the list. This patch fixes this by using the maximum possible length of list of LFs among all blocks of all PFs and VFs entries as the width size. Fixes: f7884097141b ("octeontx2-af: Formatting debugfs entry rsrc_alloc.") Fixes: 23205e6d06d4 ("octeontx2-af: Dump current resource provisioning status") Signed-off-by: Rakesh Babu Signed-off-by: Nithin Dabilpuram Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit cc45b96e2de7ada26520f101dada0abafa4ba997 Author: Subbaraya Sundeep Date: Wed Oct 27 23:02:32 2021 +0530 octeontx2-af: Check whether ipolicers exists While displaying ingress policers information in debugfs check whether ingress policers exist in the hardware or not because some platforms(CN9XXX) do not have this feature. Fixes: e7d8971763f3 ("octeontx2-af: cn10k: Debugfs support for bandwidth") Signed-off-by: Subbaraya Sundeep Signed-off-by: Rakesh Babu Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit e8684db191e4164f3f5f3ad7dec04a6734c25f1c Author: Yuiko Oshino Date: Wed Oct 27 14:23:02 2021 -0400 net: ethernet: microchip: lan743x: Fix skb allocation failure The driver allocates skb during ndo_open with GFP_ATOMIC which has high chance of failure when there are multiple instances. GFP_KERNEL is enough while open and use GFP_ATOMIC only from interrupt context. Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Yuiko Oshino Signed-off-by: David S. Miller commit 1d9d6fd21ad4a28b16ed9ee5432ae738b9dc58aa Author: Daniel Jordan Date: Wed Oct 27 17:59:21 2021 -0400 net/tls: Fix flipped sign in async_wait.err assignment sk->sk_err contains a positive number, yet async_wait.err wants the opposite. Fix the missed sign flip, which Jakub caught by inspection. Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance") Suggested-by: Jakub Kicinski Signed-off-by: Daniel Jordan Signed-off-by: David S. Miller commit da353fac65fede6b8b4cfe207f0d9408e3121105 Author: Daniel Jordan Date: Wed Oct 27 17:59:20 2021 -0400 net/tls: Fix flipped sign in tls_err_abort() calls sk->sk_err appears to expect a positive value, a convention that ktls doesn't always follow and that leads to memory corruption in other code. For instance, [kworker] tls_encrypt_done(..., err=) tls_err_abort(.., err) sk->sk_err = err; [task] splice_from_pipe_feed ... tls_sw_do_sendpage if (sk->sk_err) { ret = -sk->sk_err; // ret is positive splice_from_pipe_feed (continued) ret = actor(...) // ret is still positive and interpreted as bytes // written, resulting in underflow of buf->len and // sd->len, leading to huge buf->offset and bogus // addresses computed in later calls to actor() Fix all tls_err_abort() callers to pass a negative error code consistently and centralize the error-prone sign flip there, throwing in a warning to catch future misuse and uninlining the function so it really does only warn once. Cc: stable@vger.kernel.org Fixes: c46234ebb4d1e ("tls: RX path for ktls") Reported-by: syzbot+b187b77c8474f9648fae@syzkaller.appspotmail.com Signed-off-by: Daniel Jordan Signed-off-by: David S. Miller commit a32f07d21102dd40496724e4416a7e97fc1755d8 Merge: 90a881fc352a9 f3a3a0fe0b644 Author: David S. Miller Date: Thu Oct 28 13:04:29 2021 +0100 Merge branch 'SMC-fixes' Tony Lu says: ==================== Fixes for SMC There are some fixes for SMC. v1->v2: - fix wrong email address. ==================== Signed-off-by: David S. Miller commit f3a3a0fe0b644582fa5d83dd94b398f99fc57914 Author: Wen Gu Date: Thu Oct 28 15:13:47 2021 +0800 net/smc: Correct spelling mistake to TCPF_SYN_RECV There should use TCPF_SYN_RECV instead of TCP_SYN_RECV. Signed-off-by: Wen Gu Reviewed-by: Tony Lu Signed-off-by: David S. Miller commit c4a146c7cf5e8ad76231523b174d161bf152c6e7 Author: Tony Lu Date: Thu Oct 28 15:13:45 2021 +0800 net/smc: Fix smc_link->llc_testlink_time overflow The value of llc_testlink_time is set to the value stored in net->ipv4.sysctl_tcp_keepalive_time when linkgroup init. The value of sysctl_tcp_keepalive_time is already jiffies, so we don't need to multiply by HZ, which would cause smc_link->llc_testlink_time overflow, and test_link send flood. Signed-off-by: Tony Lu Reviewed-by: Xuan Zhuo Reviewed-by: Wen Gu Signed-off-by: David S. Miller commit 90a881fc352a953f1c8beb61977a2db0818157d4 Author: Yu Xiao Date: Thu Oct 28 12:00:36 2021 +0200 nfp: bpf: relax prog rejection for mtu check through max_pkt_offset MTU change is refused whenever the value of new MTU is bigger than the max packet bytes that fits in NFP Cluster Target Memory (CTM). However, an eBPF program doesn't always need to access the whole packet data. The maximum direct packet access (DPA) offset has always been caculated by verifier and stored in the max_pkt_offset field of prog aux data. Signed-off-by: Yu Xiao Reviewed-by: Yinjun Zhang Reviewed-by: Niklas Soderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 9159f102402a64ac85e676b75cc1f9c62c5b4b73 Author: Dongli Zhang Date: Tue Oct 26 14:50:31 2021 -0700 vmxnet3: do not stop tx queues after netif_device_detach() The netif_device_detach() conditionally stops all tx queues if the queues are running. There is no need to call netif_tx_stop_all_queues() again. Signed-off-by: Dongli Zhang Signed-off-by: David S. Miller commit e8a1ff65927080278e6826f797b7c197fb2611a6 Author: Wenbin Mei Date: Thu Oct 28 10:20:49 2021 +0800 mmc: mediatek: Move cqhci init behind ungate clock We must enable clock before cqhci init, because crypto needs read information from CQHCI registers, otherwise, it will hang in MediaTek mmc host controller. Signed-off-by: Wenbin Mei Fixes: 88bd652b3c74 ("mmc: mediatek: command queue support") Cc: stable@vger.kernel.org Acked-by: Chaotian Jing Link: https://lore.kernel.org/r/20211028022049.22129-1-wenbin.mei@mediatek.com Signed-off-by: Ulf Hansson commit 9a4aa3a2f1606a03c220b21049baa4a2b6169626 Author: Joonas Lahtinen Date: Wed Oct 27 12:32:55 2021 +0300 drm/i915: Revert 'guc_id' from i915_request tracepoint Avoid adding backend specific data to the tracepoints outside of the LOW_LEVEL_TRACEPOINTS kernel config protection. These bits of information are bound to change depending on the selected submission method per platform and are not necessarily possible to maintain in the future. Fixes: dbf9da8d55ef ("drm/i915/guc: Add trace point for GuC submit") Signed-off-by: Joonas Lahtinen Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Chris Wilson Cc: Matt Roper Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211027093255.66489-1-joonas.lahtinen@linux.intel.com (cherry picked from commit 64512a66b67e6546e2db15192b3603cd6d58b75c) Signed-off-by: Joonas Lahtinen commit 79516af3497a5b89acb09f4a644f61d6c69e5f16 Merge: 19928833e8f8f 61b1d445f3bfe Author: Dave Airlie Date: Thu Oct 28 17:27:10 2021 +1000 Merge tag 'drm-misc-fixes-2021-10-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes One patch to fix the default screen orientation on the GPD Win3 Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211028072300.b4gqexq6zfhby24g@gilmour commit 19928833e8f8fa5ee687c451437ce674f19d6c09 Merge: 03424d380be72 ee71fb6c4d99c Author: Dave Airlie Date: Thu Oct 28 15:22:14 2021 +1000 Merge tag 'drm-misc-fixes-2021-10-26' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.15-rc8: - Fix fence leak in ttm_transfered_destroy. - Add quirk for Aya Neo 2021 - Reset property count for each drm damage selftest so full run will work correctly. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/4a133970-ff4b-aa62-d346-b269b1b9236e@linux.intel.com commit 03424d380be72dfe6f87eed02b4fef7979583af8 Merge: defbbcd99fa68 ad76744b041d8 Author: Dave Airlie Date: Thu Oct 28 15:21:50 2021 +1000 Merge tag 'amd-drm-fixes-5.15-2021-10-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-10-27: amdgpu: - Display fixes for DCN 3.1 - Fix potential out of bounds write in debugfs Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211028023130.4528-1-alexander.deucher@amd.com commit ad76744b041d8c87ef1c9adbb04fb7eaa20a179e Author: Nicholas Kazlauskas Date: Fri Oct 22 16:14:24 2021 -0400 drm/amd/display: Fix deadlock when falling back to v2 from v3 [Why] A deadlock in the kernel occurs when we fallback from the V3 to V2 add_topology_to_display or remove_topology_to_display because they both try to acquire the dtm_mutex but recursive locking isn't supported on mutex_lock(). [How] Make the mutex_lock/unlock more fine grained and move them up such that they're only required for the psp invocation itself. Fixes: bf62221e9d0e ("drm/amd/display: Add DCN3.1 HDCP support") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 54149d13f369e1ab02f36b91feee02069184c1d8 Author: Michael Strauss Date: Thu Oct 21 13:27:16 2021 -0400 drm/amd/display: Fallback to clocks which meet requested voltage on DCN31 [WHY] On certain configs, SMU clock table voltages don't match which cause parser to behave incorrectly by leaving dcfclk and socclk table entries unpopulated. [HOW] Currently the function that finds the corresponding clock for a given voltage only checks for exact voltage level matches. In the case that no match gets found, parser now falls back to searching for the max clock which meets the requested voltage (i.e. its corresponding voltage is below requested). Signed-off-by: Michael Strauss Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 3f4e54bd312d3dafb59daf2b97ffa08abebe60f5 Author: Patrik Jakobsson Date: Wed Oct 27 16:27:30 2021 +0200 drm/amdgpu: Fix even more out of bound writes from debugfs CVE-2021-42327 was fixed by: commit f23750b5b3d98653b31d4469592935ef6364ad67 Author: Thelford Williams Date: Wed Oct 13 16:04:13 2021 -0400 drm/amdgpu: fix out of bounds write but amdgpu_dm_debugfs.c contains more of the same issue so fix the remaining ones. v2: * Add missing fix in dp_max_bpc_write (Harry Wentland) Fixes: 918698d5c2b5 ("drm/amd/display: Return the number of bytes parsed than allocated") Signed-off-by: Patrik Jakobsson Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7fa598f9706d40bd16f2ab286bdf5808e1393d35 Author: Steven Rostedt (VMware) Date: Wed Oct 27 12:08:54 2021 -0400 tracing: Do not warn when connecting eprobe to non existing event When the syscall trace points are not configured in, the kselftests for ftrace will try to attach an event probe (eprobe) to one of the system call trace points. This triggered a WARNING, because the failure only expects to see memory issues. But this is not the only failure. The user may attempt to attach to a non existent event, and the kernel must not warn about it. Link: https://lkml.kernel.org/r/20211027120854.0680aa0f@gandalf.local.home Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events") Signed-off-by: Steven Rostedt (VMware) commit 72f898ca0ab85fde6facf78b14d9f67a4a7b32d1 Author: Janghyub Seo Date: Tue Oct 26 07:12:42 2021 +0000 r8169: Add device 10ec:8162 to driver r8169 This patch makes the driver r8169 pick up device Realtek Semiconductor Co. , Ltd. Device [10ec:8162]. Signed-off-by: Janghyub Seo Suggested-by: Rushab Shah Link: https://lore.kernel.org/r/1635231849296.1489250046.441294000@gmail.com Signed-off-by: Jakub Kicinski commit f82161516756be2827609ec4845e1e4316df0709 Author: Randy Dunlap Date: Sun Oct 24 09:38:31 2021 -0700 ptp: Document the PTP_CLK_MAGIC ioctl number Add PTP_CLK_MAGIC to the userspace-api/ioctl/ioctl-number.rst documentation file. Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.") Signed-off-by: Randy Dunlap Cc: Richard Cochran Cc: John Stultz Cc: Jonathan Corbet Link: https://lore.kernel.org/r/20211024163831.10200-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 9c5456773d79b64cc6cebb06f668e29249636ba9 Merge: 1fc596a56b334 890d33561337f Author: Linus Torvalds Date: Wed Oct 27 13:15:05 2021 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "A couple of fixes that seem important enough to pick at the last moment" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio-ring: fix DMA metadata flags vduse: Fix race condition between resetting and irq injecting vduse: Disallow injecting interrupt before DRIVER_OK is set commit 64a19591a2938b170aa736443d5d3bf4c51e1388 Author: Chen Lu <181250012@smail.nju.edu.cn> Date: Mon Oct 18 13:22:38 2021 +0800 riscv: fix misalgned trap vector base address The trap vector marked by label .Lsecondary_park must align on a 4-byte boundary, as the {m,s}tvec is defined to require 4-byte alignment. Signed-off-by: Chen Lu <181250012@smail.nju.edu.cn> Reviewed-by: Anup Patel Fixes: e011995e826f ("RISC-V: Move relocate and few other functions out of __init") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 890d33561337ffeba0d8ba42517e71288cfee2b6 Author: Vincent Whitchurch Date: Tue Oct 26 15:31:00 2021 +0200 virtio-ring: fix DMA metadata flags The flags are currently overwritten, leading to the wrong direction being passed to the DMA unmap functions. Fixes: 72b5e8958738aaa4 ("virtio-ring: store DMA metadata in desc_extra for split virtqueue") Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20211026133100.17541-1-vincent.whitchurch@axis.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 6f7c88691191e6c52ef2543d6f1da8d360b27a24 Author: Wang Hai Date: Tue Oct 26 20:40:15 2021 +0800 usbnet: fix error return code in usbnet_probe() Return error code if usb_maxpacket() returns 0 in usbnet_probe() Fixes: 397430b50a36 ("usbnet: sanity check for maxpacket") Reported-by: Hulk Robot Signed-off-by: Wang Hai Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20211026124015.3025136-1-wanghai38@huawei.com Signed-off-by: Jakub Kicinski commit 1fc596a56b334f4d593a2b49e5ff55af6aaa0816 Merge: 646b0de5fe323 4e84dc47bb48a Author: Linus Torvalds Date: Wed Oct 27 10:41:59 2021 -0700 Merge tag 'trace-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull nds32 tracing fix from Steven Rostedt: "Fix nds32le build when DYNAMIC_FTRACE is disabled A randconfig found that nds32le architecture fails to build due to a prototype mismatch between a ftrace function pointer and the function it was to be assigned to. That function pointer prototype missed being updated when all the ftrace callbacks were updated" * tag 'trace-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace/nds32: Update the proto for ftrace_trace_function to match ftrace_stub commit 646b0de5fe32306eaf5399647adf2177d4417021 Merge: ab2aa486f48c7 4a089e95b4d6b Author: Linus Torvalds Date: Wed Oct 27 10:19:43 2021 -0700 Merge tag 'nios2_fixes_for_v5.15_part3' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux Pull nios2 fix from Dinh Nguyen: "Fix a build error for allmodconfig" * tag 'nios2_fixes_for_v5.15_part3' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST commit ab2aa486f48c79b0c9df77e3827922d29c60df0c Merge: d25f27432f80a 64733956ebba7 Author: Linus Torvalds Date: Wed Oct 27 10:01:17 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Nothing very exciting here, it has been a quiet cycle overall. Usual collection of small bug fixes: - irdma issues with CQ entries, VLAN completions and a mutex deadlock - Incorrect DCT packets in mlx5 - Userspace triggered overflows in qib - Locking error in hfi - Typo in errno value in qib/hfi1 - Double free in qedr - Leak of random kernel memory to userspace with a netlink callback" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/sa_query: Use strscpy_pad instead of memcpy to copy a string RDMA/irdma: Do not hold qos mutex twice on QP resume RDMA/irdma: Set VLAN in UD work completion correctly RDMA/mlx5: Initialize the ODP xarray when creating an ODP MR rdma/qedr: Fix crash due to redundant release of device's qp memory RDMA/rdmavt: Fix error code in rvt_create_qp() IB/hfi1: Fix abba locking issue with sc_disable() IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields RDMA/mlx5: Set user priority for DCT RDMA/irdma: Process extended CQ entries correctly commit 4e84dc47bb48accbbeeba4e6bb3f31aa7895323c Author: Steven Rostedt (VMware) Date: Wed Oct 27 12:51:01 2021 -0400 ftrace/nds32: Update the proto for ftrace_trace_function to match ftrace_stub The ftrace callback prototype was changed to pass a special ftrace_regs instead of pt_regs as the last parameter, but the static ftrace for nds32 missed updating ftrace_trace_function and this caused a warning when compared to ftrace_stub: ../arch/nds32/kernel/ftrace.c: In function '_mcount': ../arch/nds32/kernel/ftrace.c:24:35: error: comparison of distinct pointer types lacks a cast [-Werror] 24 | if (ftrace_trace_function != ftrace_stub) | ^~ Link: https://lore.kernel.org/all/20211027055554.19372-1-rdunlap@infradead.org/ Link: https://lkml.kernel.org/r/20211027125101.33449969@gandalf.local.home Cc: Ingo Molnar Cc: Andrew Morton Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: stable@vger.kernel.org Fixes: d19ad0775dcd6 ("ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs") Reported-by: Randy Dunlap Signed-off-by: Steven Rostedt (VMware) commit afe8ca110cf4c99dee7b31473eacb56b72944df4 Merge: 424a4f52c5d4f 689a0a9f505f7 Author: Jakub Kicinski Date: Wed Oct 27 08:12:25 2021 -0700 Merge tag 'mac80211-for-net-2021-10-27' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Two fixes: * bridge vs. 4-addr mode check was wrong * management frame registrations locking was wrong, causing list corruption/crashes ==================== Link: https://lore.kernel.org/r/20211027143756.91711-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 9b0971ca7fc75daca80c0bb6c02e96059daea90a Author: Paolo Bonzini Date: Mon Oct 25 12:14:31 2021 -0400 KVM: SEV-ES: fix another issue with string I/O VMGEXITs If the guest requests string I/O from the hypervisor via VMGEXIT, SW_EXITINFO2 will contain the REP count. However, sev_es_string_io was incorrectly treating it as the size of the GHCB buffer in bytes. This fixes the "outsw" test in the experimental SEV tests of kvm-unit-tests. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reported-by: Marc Orr Tested-by: Marc Orr Reviewed-by: Marc Orr Signed-off-by: Paolo Bonzini commit 4a089e95b4d6bb625044d47aed0c442a8f7bd093 Author: Guenter Roeck Date: Wed Oct 20 12:11:16 2021 -0700 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST nios2:allmodconfig builds fail with make[1]: *** No rule to make target 'arch/nios2/boot/dts/""', needed by 'arch/nios2/boot/dts/built-in.a'. Stop. make: [Makefile:1868: arch/nios2/boot/dts] Error 2 (ignored) This is seen with compile tests since those enable NIOS2_DTB_SOURCE_BOOL, which in turn enables NIOS2_DTB_SOURCE. This causes the build error because the default value for NIOS2_DTB_SOURCE is an empty string. Disable NIOS2_DTB_SOURCE_BOOL for compile tests to avoid the error. Fixes: 2fc8483fdcde ("nios2: Build infrastructure") Signed-off-by: Guenter Roeck Reviewed-by: Randy Dunlap Signed-off-by: Dinh Nguyen commit 424a4f52c5d4fe232ba55a4553eae4db2025121a Merge: 440ffcdd9db47 630a6738da82e Author: David S. Miller Date: Wed Oct 27 14:47:34 2021 +0100 Merge branch 'hns3-fixes' 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 630a6738da82e2c29e1c38eafd6f8328e0a4963c Author: Guangbin Huang Date: Wed Oct 27 20:11:49 2021 +0800 net: hns3: adjust string spaces of some parameters of tx bd info in debugfs This patch adjusts the string spaces of some parameters of tx bd info in debugfs according to their maximum needs. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit c7a6e3978ea952efb107ecf511c095c3bbb2945f Author: Guangbin Huang Date: Wed Oct 27 20:11:48 2021 +0800 net: hns3: expand buffer len for some debugfs command The specified buffer length for three debugfs files fd_tcam, uc and tqp is not enough for their maximum needs, so this patch fixes them. Fixes: b5a0b70d77b9 ("net: hns3: refactor dump fd tcam of debugfs") Fixes: 1556ea9120ff ("net: hns3: refactor dump mac list of debugfs") Fixes: d96b0e59468d ("net: hns3: refactor dump reg of debugfs") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 6754614a787cbcbf87bae8a75619c24a33ea6791 Author: Jie Wang Date: Wed Oct 27 20:11:47 2021 +0800 net: hns3: add more string spaces for dumping packets number of queue info in debugfs As the width of packets number registers is 32 bits, they needs at most 10 characters for decimal data printing, but now the string spaces is not enough, so this patch fixes it. Fixes: e44c495d95e ("net: hns3: refactor queue info of debugfs") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2a21dab594a98c338c4bfbc31864cbca15888549 Author: Jie Wang Date: Wed Oct 27 20:11:46 2021 +0800 net: hns3: fix data endian problem of some functions of debugfs The member data in struct hclge_desc is type of __le32, it needs endian conversion before using it, and some functions of debugfs didn't do that, so this patch fixes it. Fixes: c0ebebb9ccc1 ("net: hns3: Add "dcb register" status information query function") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0251d196b0e1a19c870be882e5d4f496de8ab758 Author: Guangbin Huang Date: Wed Oct 27 20:11:45 2021 +0800 net: hns3: ignore reset event before initialization process is done Currently, if there is a reset event triggered by RAS during device in initialization process, driver may run reset process concurrently with initialization process. In this case, it may cause problem. For example, the RSS indirection table may has not been alloc memory in initialization process yet, but it is used in reset process, it will cause a call trace like this: [61228.744836] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 ... [61228.897677] Workqueue: hclgevf hclgevf_service_task [hclgevf] [61228.911390] pstate: 40400009 (nZcv daif +PAN -UAO -TCO BTYPE=--) [61228.918670] pc : hclgevf_set_rss_indir_table+0xb4/0x190 [hclgevf] [61228.927812] lr : hclgevf_set_rss_indir_table+0x90/0x190 [hclgevf] [61228.937248] sp : ffff8000162ebb50 [61228.941087] x29: ffff8000162ebb50 x28: ffffb77add72dbc0 x27: ffff0820c7dc8080 [61228.949516] x26: 0000000000000000 x25: ffff0820ad4fc880 x24: ffff0820c7dc8080 [61228.958220] x23: ffff0820c7dc8090 x22: 00000000ffffffff x21: 0000000000000040 [61228.966360] x20: ffffb77add72b9c0 x19: 0000000000000000 x18: 0000000000000030 [61228.974646] x17: 0000000000000000 x16: ffffb77ae713feb0 x15: ffff0820ad4fcce8 [61228.982808] x14: ffffffffffffffff x13: ffff8000962eb7f7 x12: 00003834ec70c960 [61228.991990] x11: 00e0fafa8c206982 x10: 9670facc78a8f9a8 x9 : ffffb77add717530 [61229.001123] x8 : ffff0820ad4fd6b8 x7 : 0000000000000000 x6 : 0000000000000011 [61229.010249] x5 : 00000000000cb1b0 x4 : 0000000000002adb x3 : 0000000000000049 [61229.018662] x2 : ffff8000162ebbb8 x1 : 0000000000000000 x0 : 0000000000000480 [61229.027002] Call trace: [61229.030177] hclgevf_set_rss_indir_table+0xb4/0x190 [hclgevf] [61229.039009] hclgevf_rss_init_hw+0x128/0x1b4 [hclgevf] [61229.046809] hclgevf_reset_rebuild+0x17c/0x69c [hclgevf] [61229.053862] hclgevf_reset_service_task+0x4cc/0xa80 [hclgevf] [61229.061306] hclgevf_service_task+0x6c/0x630 [hclgevf] [61229.068491] process_one_work+0x1dc/0x48c [61229.074121] worker_thread+0x15c/0x464 [61229.078562] kthread+0x168/0x16c [61229.082873] ret_from_fork+0x10/0x18 [61229.088221] Code: 7900e7f6 f904a683 d503201f 9101a3e2 (38616b43) [61229.095357] ---[ end trace 153661a538f6768c ]--- To fix this problem, don't schedule reset task before initialization process is done. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit f29da4088fb4eeba457219a931327d1d5f45196a Author: Yufeng Mo Date: Wed Oct 27 20:11:44 2021 +0800 net: hns3: change hclge/hclgevf workqueue to WQ_UNBOUND mode Currently, the workqueue of hclge/hclgevf is executed on the CPU that initiates scheduling requests by default. In stress scenarios, the CPU may be busy and workqueue scheduling is completed after a long period of time. To avoid this situation and implement proper scheduling, use the WQ_UNBOUND mode instead. In this way, the workqueue can be performed on a relatively idle CPU. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 3bda2e5df476417b6d08967e2d84234a59d57b1c Author: Guangbin Huang Date: Wed Oct 27 20:11:43 2021 +0800 net: hns3: fix pause config problem after autoneg disabled If a TP port is configured by follow steps: 1.ethtool -s ethx autoneg off speed 100 duplex full 2.ethtool -A ethx rx on tx on 3.ethtool -s ethx autoneg on(rx&tx negotiated pause results are off) 4.ethtool -s ethx autoneg off speed 100 duplex full In step 3, driver will set rx&tx pause parameters of hardware to off as pause parameters negotiated with link partner are off. After step 4, the "ethtool -a ethx" command shows both rx and tx pause parameters are on. However, pause parameters of hardware are still off and port has no flow control function actually. To fix this problem, if autoneg is disabled, driver uses its saved parameters to restore pause of hardware. If the speed is not changed in this case, there is no link state changed for phy, it will cause the pause parameter is not taken effect, so we need to force phy to go down and up. Fixes: aacbe27e82f0 ("net: hns3: modify how pause options is displayed") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e0c60d0102a5ad3475401e1a2faa3d3623eefce4 Author: Shin'ichiro Kawasaki Date: Tue Oct 26 15:01:15 2021 +0900 block: Fix partition check for host-aware zoned block devices Commit a33df75c6328 ("block: use an xarray for disk->part_tbl") modified the method to check partition existence in host-aware zoned block devices from disk_has_partitions() helper function call to empty check of xarray disk->part_tbl. However, disk->part_tbl always has single entry for disk->part0 and never becomes empty. This resulted in the host-aware zoned devices always judged to have partitions, and it made the sysfs queue/zoned attribute to be "none" instead of "host-aware" regardless of partition existence in the devices. This also caused DEBUG_LOCKS_WARN_ON(lock->magic != lock) for sdkp->rev_mutex in scsi layer when the kernel detects host-aware zoned device. Since block layer handled the host-aware zoned devices as non- zoned devices, scsi layer did not have chance to initialize the mutex for zone revalidation. Therefore, the warning was triggered. To fix the issues, call the helper function disk_has_partitions() in place of disk->part_tbl empty check. Since the function was removed with the commit a33df75c6328, reimplement it to walk through entries in the xarray disk->part_tbl. Fixes: a33df75c6328 ("block: use an xarray for disk->part_tbl") Signed-off-by: Shin'ichiro Kawasaki Cc: stable@vger.kernel.org # v5.14+ Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211026060115.753746-1-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe commit 3a60f6537c9adf0828bf1dd868c59f659395257e Author: David Sterba Date: Wed Oct 27 10:39:03 2021 +0200 Revert "btrfs: compression: drop kmap/kunmap from generic helpers" This reverts commit 4c2bf276b56d8d27ddbafcdf056ef3fc60ae50b0. The kmaps in compression code are still needed and cause crashes on 32bit machines (ARM, x86). Reproducible eg. by running fstest btrfs/004 with enabled LZO or ZSTD compression. Link: https://lore.kernel.org/all/CAJCQCtT+OuemovPO7GZk8Y8=qtOObr0XTDp8jh4OHD6y84AFxw@mail.gmail.com/ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214839 Signed-off-by: David Sterba commit 86aeda32b887cdaeb0f4b7bfc9971e36377181c7 Author: Amit Engel Date: Wed Oct 27 09:49:27 2021 +0300 nvmet-tcp: fix header digest verification Pass the correct length to nvmet_tcp_verify_hdgst, which is the pdu header length. This fixes a wrong behaviour where header digest verification passes although the digest is wrong. Signed-off-by: Amit Engel Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e790de54e94a7a15fb725b34724d41d41cbaa60c Author: Varun Prakash Date: Mon Oct 25 22:46:54 2021 +0530 nvmet-tcp: fix data digest pointer calculation exp_ddgst is of type __le32, &cmd->exp_ddgst + cmd->offset increases &cmd->exp_ddgst by 4 * cmd->offset, fix this by type casting &cmd->exp_ddgst to u8 *. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit d89b9f3bbb58e9e378881209756b0723694f22ff Author: Varun Prakash Date: Mon Oct 25 22:47:30 2021 +0530 nvme-tcp: fix data digest pointer calculation ddgst is of type __le32, &req->ddgst + req->offset increases &req->ddgst by 4 * req->offset, fix this by type casting &req->ddgst to u8 *. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit ce7723e9cdae4eb3030da082876580f4b2dc0861 Author: Varun Prakash Date: Tue Oct 26 19:01:55 2021 +0530 nvme-tcp: fix possible req->offset corruption With commit db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context") r2t and response PDU can get processed while send function is executing. Current data digest send code uses req->offset after kernel_sendmsg(), this creates a race condition where req->offset gets reset before it is used in send function. This can happen in two cases - 1. Target sends r2t PDU which resets req->offset. 2. Target send response PDU which completes the req and then req is used for a new command, nvme_tcp_setup_cmd_pdu() resets req->offset. Fix this by storing req->offset in a local variable and using this local variable after kernel_sendmsg(). Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context") Signed-off-by: Varun Prakash Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit defbbcd99fa68cb7feed453662048baa87e9a441 Merge: 3906fe9bb7f1a 53c2ff8bcb06a Author: Dave Airlie Date: Wed Oct 27 10:01:21 2021 +1000 Merge tag 'amd-drm-fixes-5.15-2021-10-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-10-21: amdgpu: - Fix a potential out of bounds write in debugfs - Fix revision handling for Yellow Carp - Display fixes for Yellow Carp Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211021203430.4578-1-alexander.deucher@amd.com commit d25f27432f80a800a3592db128254c8140bd71bf Merge: 3906fe9bb7f1a 05d5da3cb11c9 Author: Linus Torvalds Date: Tue Oct 26 15:24:33 2021 -0700 Merge tag 'arm-soc-fixes-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "One last set of small fixes for the soc tree: - Incorrect ethernet phy settings found on i.mx and allwinner platforms - a revert for a Qualcomm DT change that caused a boot regression - four patches for incorrect settings in i.MX DT files - new MAINTAINER file entries for dhcom boards - a Kconfig fix for a reset driver that became unselectable - three more code changes for bugs in reset drivers" * tag 'arm-soc-fixes-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: MAINTAINERS: Add maintainers for DHCOM i.MX6 and DHCOM/DHCOR STM32MP1 Revert "arm64: dts: qcom: sm8250: remove bus clock from the mdss node for sm8250 target" arm64: dts: imx8mm-kontron: Fix connection type for VSC8531 RGMII PHY arm64: dts: imx8mm-kontron: Fix CAN SPI clock frequency arm64: dts: imx8mm-kontron: Fix polarity of reg_rst_eth2 arm64: dts: imx8mm-kontron: Set lower limit of VDD_SNVS to 800 mV arm64: dts: imx8mm-kontron: Make sure SOC and DRAM supply voltages are correct reset: socfpga: add empty driver allowing consumers to probe reset: tegra-bpmp: Handle errors in BPMP response reset: pistachio: Re-enable driver selection reset: brcmstb-rescal: fix incorrect polarity of status bit ARM: dts: sun7i: A20-olinuxino-lime2: Fix ethernet phy-mode arm64: dts: allwinner: h5: NanoPI Neo 2: Fix ethernet node commit 9586e67b911c95ba158fcc247b230e9c2d718623 Author: Naohiro Aota Date: Wed Oct 27 01:51:27 2021 +0900 block: schedule queue restart after BLK_STS_ZONE_RESOURCE When dispatching a zone append write request to a SCSI zoned block device, if the target zone of the request is already locked, the device driver will return BLK_STS_ZONE_RESOURCE and the request will be pushed back to the hctx dipatch queue. The queue will be marked as RESTART in dd_finish_request() and restarted in __blk_mq_free_request(). However, this restart applies to the hctx of the completed request. If the requeued request is on a different hctx, dispatch will no be retried until another request is submitted or the next periodic queue run triggers, leading to up to 30 seconds latency for the requeued request. Fix this problem by scheduling a queue restart similarly to the BLK_STS_RESOURCE case or when we cannot get the budget. Also, consolidate the checks into the "need_resource" variable to simplify the condition. Signed-off-by: Naohiro Aota Reviewed-by: Christoph Hellwig Cc: Niklas Cassel Link: https://lore.kernel.org/r/20211026165127.4151055-1-naohiro.aota@wdc.com Signed-off-by: Jens Axboe commit 440ffcdd9db4758f1503a25fb49a8e15ca83d6bc Merge: 19fa0887c57d3 54713c85f5360 Author: Jakub Kicinski Date: Tue Oct 26 14:38:54 2021 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2021-10-26 We've added 12 non-merge commits during the last 7 day(s) which contain a total of 23 files changed, 118 insertions(+), 98 deletions(-). The main changes are: 1) Fix potential race window in BPF tail call compatibility check, from Toke Høiland-Jørgensen. 2) Fix memory leak in cgroup fs due to missing cgroup_bpf_offline(), from Quanyang Wang. 3) Fix file descriptor reference counting in generic_map_update_batch(), from Xu Kuohai. 4) Fix bpf_jit_limit knob to the max supported limit by the arch's JIT, from Lorenz Bauer. 5) Fix BPF sockmap ->poll callbacks for UDP and AF_UNIX sockets, from Cong Wang and Yucong Sun. 6) Fix BPF sockmap concurrency issue in TCP on non-blocking sendmsg calls, from Liu Jian. 7) Fix build failure of INODE_STORAGE and TASK_STORAGE maps on !CONFIG_NET, from Tejun Heo. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Fix potential race in tail call compatibility check bpf: Move BPF_MAP_TYPE for INODE_STORAGE and TASK_STORAGE outside of CONFIG_NET selftests/bpf: Use recv_timeout() instead of retries net: Implement ->sock_is_readable() for UDP and AF_UNIX skmsg: Extract and reuse sk_msg_is_readable() net: Rename ->stream_memory_read to ->sock_is_readable tcp_bpf: Fix one concurrency problem in the tcp_bpf_send_verdict function cgroup: Fix memory leak caused by missing cgroup_bpf_offline bpf: Fix error usage of map_fd and fdget() in generic_map_update_batch() bpf: Prevent increasing bpf_jit_limit above max bpf: Define bpf_jit_alloc_exec_limit for arm64 JIT bpf: Define bpf_jit_alloc_exec_limit for riscv JIT ==================== Link: https://lore.kernel.org/r/20211026201920.11296-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 54713c85f536048e685258f880bf298a74c3620d Author: Toke Høiland-Jørgensen Date: Tue Oct 26 13:00:19 2021 +0200 bpf: Fix potential race in tail call compatibility check Lorenzo noticed that the code testing for program type compatibility of tail call maps is potentially racy in that two threads could encounter a map with an unset type simultaneously and both return true even though they are inserting incompatible programs. The race window is quite small, but artificially enlarging it by adding a usleep_range() inside the check in bpf_prog_array_compatible() makes it trivial to trigger from userspace with a program that does, essentially: map_fd = bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, 4, 4, 2, 0); pid = fork(); if (pid) { key = 0; value = xdp_fd; } else { key = 1; value = tc_fd; } err = bpf_map_update_elem(map_fd, &key, &value, 0); While the race window is small, it has potentially serious ramifications in that triggering it would allow a BPF program to tail call to a program of a different type. So let's get rid of it by protecting the update with a spinlock. The commit in the Fixes tag is the last commit that touches the code in question. v2: - Use a spinlock instead of an atomic variable and cmpxchg() (Alexei) v3: - Put lock and the members it protects into an embedded 'owner' struct (Daniel) Fixes: 3324b584b6f6 ("ebpf: misc core cleanup") Reported-by: Lorenzo Bianconi Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211026110019.363464-1-toke@redhat.com commit 99d0a3831e3500d945162cdb2310e3a5fce90b60 Author: Tejun Heo Date: Thu Oct 21 08:46:10 2021 -1000 bpf: Move BPF_MAP_TYPE for INODE_STORAGE and TASK_STORAGE outside of CONFIG_NET bpf_types.h has BPF_MAP_TYPE_INODE_STORAGE and BPF_MAP_TYPE_TASK_STORAGE declared inside #ifdef CONFIG_NET although they are built regardless of CONFIG_NET. So, when CONFIG_BPF_SYSCALL && !CONFIG_NET, they are built without the declarations leading to spurious build failures and not registered to bpf_map_types making them unavailable. Fix it by moving the BPF_MAP_TYPE for the two map types outside of CONFIG_NET. Reported-by: kernel test robot Fixes: a10787e6d58c ("bpf: Enable task local storage for tracing programs") Signed-off-by: Tejun Heo Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/YXG1cuuSJDqHQfRY@slm.duckdns.org commit a94b5aae2a40b164f1d67c37f466f06cb1398ef0 Merge: cd9733f5d75c9 67b821502dbd6 Author: Alexei Starovoitov Date: Tue Oct 26 12:29:33 2021 -0700 Merge branch 'sock_map: fix ->poll() and update selftests' Cong Wang says: ==================== This patchset fixes ->poll() for sockets in sockmap and updates selftests accordingly with select(). Please check each patch for more details. Fixes: c50524ec4e3a ("Merge branch 'sockmap: add sockmap support for unix datagram socket'") Fixes: 89d69c5d0fbc ("Merge branch 'sockmap: introduce BPF_SK_SKB_VERDICT and support UDP'") Acked-by: John Fastabend --- v4: add a comment in udp_poll() v3: drop sk_psock_get_checked() reuse tcp_bpf_sock_is_readable() v2: rename and reuse ->stream_memory_read() fix a compile error in sk_psock_get_checked() Cong Wang (3): net: rename ->stream_memory_read to ->sock_is_readable skmsg: extract and reuse sk_msg_is_readable() net: implement ->sock_is_readable() for UDP and AF_UNIX ==================== Reviewed-by: Jakub Sitnicki Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit 67b821502dbd6c9b23715da79cb9b37fa7d969dc Author: Yucong Sun Date: Fri Oct 8 13:33:06 2021 -0700 selftests/bpf: Use recv_timeout() instead of retries We use non-blocking sockets in those tests, retrying for EAGAIN is ugly because there is no upper bound for the packet arrival time, at least in theory. After we fix poll() on sockmap sockets, now we can switch to select()+recv(). Signed-off-by: Yucong Sun Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211008203306.37525-5-xiyou.wangcong@gmail.com commit af493388950b6ea3a86f860cfaffab137e024fc8 Author: Cong Wang Date: Fri Oct 8 13:33:05 2021 -0700 net: Implement ->sock_is_readable() for UDP and AF_UNIX Yucong noticed we can't poll() sockets in sockmap even when they are the destination sockets of redirections. This is because we never poll any psock queues in ->poll(), except for TCP. With ->sock_is_readable() now we can overwrite >sock_is_readable(), invoke and implement it for both UDP and AF_UNIX sockets. Reported-by: Yucong Sun Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211008203306.37525-4-xiyou.wangcong@gmail.com commit fb4e0a5e73d4bb5ab69b7905abd2ec3b580e9b59 Author: Cong Wang Date: Fri Oct 8 13:33:04 2021 -0700 skmsg: Extract and reuse sk_msg_is_readable() tcp_bpf_sock_is_readable() is pretty much generic, we can extract it and reuse it for non-TCP sockets. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211008203306.37525-3-xiyou.wangcong@gmail.com commit 7b50ecfcc6cdfe87488576bc3ed443dc8d083b90 Author: Cong Wang Date: Fri Oct 8 13:33:03 2021 -0700 net: Rename ->stream_memory_read to ->sock_is_readable The proto ops ->stream_memory_read() is currently only used by TCP to check whether psock queue is empty or not. We need to rename it before reusing it for non-TCP protocols, and adjust the exsiting users accordingly. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211008203306.37525-2-xiyou.wangcong@gmail.com commit cd9733f5d75c94a32544d6ce5be47e14194cf137 Author: Liu Jian Date: Tue Oct 12 13:20:19 2021 +0800 tcp_bpf: Fix one concurrency problem in the tcp_bpf_send_verdict function With two Msgs, msgA and msgB and a user doing nonblocking sendmsg calls (or multiple cores) on a single socket 'sk' we could get the following flow. msgA, sk msgB, sk ----------- --------------- tcp_bpf_sendmsg() lock(sk) psock = sk->psock tcp_bpf_sendmsg() lock(sk) ... blocking tcp_bpf_send_verdict if (psock->eval == NONE) psock->eval = sk_psock_msg_verdict .. < handle SK_REDIRECT case > release_sock(sk) < lock dropped so grab here > ret = tcp_bpf_sendmsg_redir psock = sk->psock tcp_bpf_send_verdict lock_sock(sk) ... blocking on B if (psock->eval == NONE) <- boom. psock->eval will have msgA state The problem here is we dropped the lock on msgA and grabbed it with msgB. Now we have old state in psock and importantly psock->eval has not been cleared. So msgB will run whatever action was done on A and the verdict program may never see it. Fixes: 604326b41a6fb ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Liu Jian Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20211012052019.184398-1-liujian56@huawei.com commit 61b1d445f3bfe4c3ba4335ceeb7e8ba688fd31e2 Author: Mario Date: Tue Oct 26 13:27:37 2021 +0200 drm: panel-orientation-quirks: Add quirk for GPD Win3 Fixes screen orientation for GPD Win 3 handheld gaming console. Signed-off-by: Mario Risoldi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211026112737.9181-1-awxkrnl@gmail.com commit cd004d8299f1dc6cfa6a4eea8f94cb45eaedf070 Author: Walter Stoll Date: Thu Oct 14 12:22:29 2021 +0200 watchdog: Fix OMAP watchdog early handling TI's implementation does not service the watchdog even if the kernel command line parameter omap_wdt.early_enable is set to 1. This patch fixes the issue. Signed-off-by: Walter Stoll Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/88a8fe5229cd68fa0f1fd22f5d66666c1b7057a0.camel@duagon.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit abd1c6adc16d1b82109a29b570fc545b775049d5 Author: Guenter Roeck Date: Fri Sep 10 21:29:25 2021 -0700 watchdog: ixp4xx_wdt: Fix address space warning sparse reports the following address space warning. drivers/watchdog/ixp4xx_wdt.c:122:20: sparse: incorrect type in assignment (different address spaces) drivers/watchdog/ixp4xx_wdt.c:122:20: sparse: expected void [noderef] __iomem *base drivers/watchdog/ixp4xx_wdt.c:122:20: sparse: got void *platform_data Add a typecast to solve the problem. Fixes: 21a0a29d16c6 ("watchdog: ixp4xx: Rewrite driver to use core") Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210911042925.556889-1-linux@roeck-us.net Signed-off-by: Wim Van Sebroeck commit bcc3e704f1b73f7f8674364f0bda6593bbc9fd2b Author: Krzysztof Kozlowski Date: Fri Sep 17 11:20:23 2021 +0200 watchdog: sbsa: 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 Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210917092024.19323-1-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f31afb502c3151855df3ed40f5974c7884c10d14 Author: Jamie Iles Date: Fri Sep 3 12:21:01 2021 +0100 watchdog: sbsa: only use 32-bit accessors SBSA says of the generic watchdog: All registers are 32 bits in size and should be accessed using 32-bit reads and writes. If an access size other than 32 bits is used then the results are IMPLEMENTATION DEFINED. and for qemu, the implementation will only allow 32-bit accesses resulting in a synchronous external abort when configuring the watchdog. Use lo_hi_* accessors rather than a readq/writeq. Fixes: abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") Signed-off-by: Jamie Iles Reviewed-by: Guenter Roeck Reviewed-by: Shaokun Zhang Link: https://lore.kernel.org/r/20210903112101.493552-1-quic_jiles@quicinc.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6e7733ef0bb9372d5491168635f6ecba8ac3cb8a Author: Guenter Roeck Date: Thu Oct 7 17:33:02 2021 -0700 Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout" This reverts commit cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") and commit aec42642d91f ("watchdog: iTCO_wdt: Fix detection of SMI-off case") since those patches cause a regression on certain boards (https://bugzilla.kernel.org/show_bug.cgi?id=213809). While this revert may result in some boards to only reset after twice the configured timeout value, that is still better than a watchdog reset after half the configured value. Fixes: cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") Fixes: aec42642d91f ("watchdog: iTCO_wdt: Fix detection of SMI-off case") Cc: Jan Kiszka Cc: Mantas Mikulėnas Reported-by: Javier S. Pedro Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20211008003302.1461733-1-linux@roeck-us.net Signed-off-by: Wim Van Sebroeck commit 92b18252b91de567cd875f2e84722b10ab34ee28 Author: Wenbin Mei Date: Tue Oct 26 15:08:12 2021 +0800 mmc: cqhci: clear HALT state after CQE enable While mmc0 enter suspend state, we need halt CQE to send legacy cmd(flush cache) and disable cqe, for resume back, we enable CQE and not clear HALT state. In this case MediaTek mmc host controller will keep the value for HALT state after CQE disable/enable flow, so the next CQE transfer after resume will be timeout due to CQE is in HALT state, the log as below: <4>.(4)[318:kworker/4:1H]mmc0: cqhci: timeout for tag 2 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: ============ CQHCI REGISTER DUMP =========== <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Caps: 0x100020b6 | Version: 0x00000510 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Config: 0x00001103 | Control: 0x00000001 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Int stat: 0x00000000 | Int enab: 0x00000006 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Int sig: 0x00000006 | Int Coal: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: TDL base: 0xfd05f000 | TDL up32: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Doorbell: 0x8000203c | TCN: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Task clr: 0x00000000 | SSC1: 0x00001000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: SSC2: 0x00000001 | DCMD rsp: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: Resp idx: 0x00000000 | Resp arg: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: CRNQP: 0x00000000 | CRNQDUN: 0x00000000 <4>.(4)[318:kworker/4:1H]mmc0: cqhci: CRNQIS: 0x00000000 | CRNQIE: 0x00000000 This change check HALT state after CQE enable, if CQE is in HALT state, we will clear it. Signed-off-by: Wenbin Mei Cc: stable@vger.kernel.org Acked-by: Adrian Hunter Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Link: https://lore.kernel.org/r/20211026070812.9359-1-wenbin.mei@mediatek.com Signed-off-by: Ulf Hansson commit 8c8171929116cc23f74743d99251eedadf62341a Author: Johan Hovold Date: Mon Oct 25 13:56:08 2021 +0200 mmc: vub300: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211025115608.5287-1-johan@kernel.org Signed-off-by: Ulf Hansson commit 697542bceae51f7620af333b065dd09d213629fb Author: Jaehoon Chung Date: Fri Oct 22 17:21:06 2021 +0900 mmc: dw_mmc: exynos: fix the finding clock sample value Even though there are candiates value if can't find best value, it's returned -EIO. It's not proper behavior. If there is not best value, use a first candiate value to work eMMC. Signed-off-by: Jaehoon Chung Tested-by: Marek Szyprowski Tested-by: Christian Hewitt Cc: stable@vger.kernel.org Fixes: c537a1c5ff63 ("mmc: dw_mmc: exynos: add variable delay tuning sequence") Link: https://lore.kernel.org/r/20211022082106.1557-1-jh80.chung@samsung.com Signed-off-by: Ulf Hansson commit 05d5da3cb11c91c39e607066d3313a6ce621796a Author: Christoph Niedermaier Date: Mon Oct 25 09:37:06 2021 +0200 MAINTAINERS: Add maintainers for DHCOM i.MX6 and DHCOM/DHCOR STM32MP1 Add maintainers for DH electronics DHCOM i.MX6 and DHCOM/DHCOR STM32MP1 boards. Signed-off-by: Christoph Niedermaier Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@dh-electronics.com Cc: arnd@arndb.de Link: https://lore.kernel.org/r/20211025073706.2794-1-cniedermaier@dh-electronics.com' To: soc@kernel.org To: linux-kernel@vger.kernel.org Signed-off-by: Arnd Bergmann commit d308ae0d299a6bb15be4efb91849582d19c23213 Author: Ming Lei Date: Tue Oct 26 18:12:04 2021 +0800 block: drain queue after disk is removed from sysfs Before removing disk from sysfs, userspace still may change queue via sysfs, such as switching elevator or setting wbt latency, both may reinitialize wbt, then the warning in blk_free_queue_stats() will be triggered since rq_qos_exit() is moved to del_gendisk(). Fixes the issue by moving draining queue & tearing down after disk is removed from sysfs, at that time no one can come into queue's store()/show(). Reported-by: Yi Zhang Tested-by: Yi Zhang Fixes: 8e141f9eb803 ("block: drain file system I/O on del_gendisk") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211026101204.2897166-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit f44e8f91b89d42af0dd26f3b299a0c055d5737e0 Merge: 36b6dcbc1245a e091b836a3bae Author: Arnd Bergmann Date: Tue Oct 26 16:20:49 2021 +0200 Merge tag 'qcom-arm64-fixes-for-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 DTS one more fix for 5.15 This reverts a clock change in the Qualcomm RB5 devicetree which in some combinations of firmware and configuration causes the device to crash during boot. Data on an adjacent platform indicates that this is probably not be the root cause of the problem, but this resolves the regression seen on RB5 and will allow the SM8250 platform to boot v5.15. * tag 'qcom-arm64-fixes-for-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: Revert "arm64: dts: qcom: sm8250: remove bus clock from the mdss node for sm8250 target" Link: https://lore.kernel.org/r/20211025201213.1145348-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 19fa0887c57d35b57bfb895e6caf8e72d9601ec0 Author: Vadym Kochan Date: Tue Oct 26 15:19:07 2021 +0300 MAINTAINERS: please remove myself from the Prestera driver Signed-off-by: Vadym Kochan Signed-off-by: David S. Miller commit db6c3c064f5d55fa9969f33eafca3cdbefbb3541 Author: Johan Hovold Date: Tue Oct 26 12:36:17 2021 +0200 net: lan78xx: fix division by zero in send path Add the missing endpoint max-packet sanity check to probe() to avoid division by zero in lan78xx_tx_bh() in case a malicious device has broken descriptors (or when doing descriptor fuzz testing). Note that USB core will reject URBs submitted for endpoints with zero wMaxPacketSize but that drivers doing packet-size calculations still need to handle this (cf. commit 2548288b4fb0 ("USB: Fix: Don't skip endpoint descriptors with maxpacket=0")). Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Cc: stable@vger.kernel.org # 4.3 Cc: Woojung.Huh@microchip.com Signed-off-by: Johan Hovold Signed-off-by: David S. Miller commit 6f68cd634856f8ca93bafd623ba5357e0f648c68 Author: Pavel Skripkin Date: Sun Oct 24 16:13:56 2021 +0300 net: batman-adv: fix error handling Syzbot reported ODEBUG warning in batadv_nc_mesh_free(). The problem was in wrong error handling in batadv_mesh_init(). Before this patch batadv_mesh_init() was calling batadv_mesh_free() in case of any batadv_*_init() calls failure. This approach may work well, when there is some kind of indicator, which can tell which parts of batadv are initialized; but there isn't any. All written above lead to cleaning up uninitialized fields. Even if we hide ODEBUG warning by initializing bat_priv->nc.work, syzbot was able to hit GPF in batadv_nc_purge_paths(), because hash pointer in still NULL. [1] To fix these bugs we can unwind batadv_*_init() calls one by one. It is good approach for 2 reasons: 1) It fixes bugs on error handling path 2) It improves the performance, since we won't call unneeded batadv_*_free() functions. So, this patch makes all batadv_*_init() clean up all allocated memory before returning with an error to no call correspoing batadv_*_free() and open-codes batadv_mesh_free() with proper order to avoid touching uninitialized fields. Link: https://lore.kernel.org/netdev/000000000000c87fbd05cef6bcb0@google.com/ [1] Reported-and-tested-by: syzbot+28b0702ada0bf7381f58@syzkaller.appspotmail.com Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Signed-off-by: Pavel Skripkin Acked-by: Sven Eckelmann Signed-off-by: David S. Miller commit fa40d9734a57bcbfa79a280189799f76c88f7bb0 Author: Max VA Date: Mon Oct 25 17:31:53 2021 +0200 tipc: fix size validations for the MSG_CRYPTO type The function tipc_crypto_key_rcv is used to parse MSG_CRYPTO messages to receive keys from other nodes in the cluster in order to decrypt any further messages from them. This patch verifies that any supplied sizes in the message body are valid for the received message. Fixes: 1ef6f7c9390f ("tipc: add automatic session key exchange") Signed-off-by: Max VA Acked-by: Ying Xue Signed-off-by: Greg Kroah-Hartman Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 2195f2062e4cc93870da8e71c318ef98a1c51cef Author: Krzysztof Kozlowski Date: Mon Oct 25 16:49:36 2021 +0200 nfc: port100: fix using -ERRNO as command type mask During probing, the driver tries to get a list (mask) of supported command types in port100_get_command_type_mask() function. The value is u64 and 0 is treated as invalid mask (no commands supported). The function however returns also -ERRNO as u64 which will be interpret as valid command mask. Return 0 on every error case of port100_get_command_type_mask(), so the probing will stop. Cc: Fixes: 0347a6ab300a ("NFC: port100: Commands mechanism implementation") Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit eacd68b7ceaa82a5d15a286f727000cef898c0b0 Merge: 9122a70a63337 fd1b5beb177a8 Author: David S. Miller Date: Tue Oct 26 13:26:09 2021 +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 2021-10-25 This series contains updates to ice driver only. Dave adds event handler for LAG NETDEV_UNREGISTER to unlink device from link aggregate. Yongxin Liu adds a check for PTP support during release which would cause a call trace on non-PTP supported devices. ==================== Signed-off-by: David S. Miller commit 9122a70a6333705c0c35614ddc51c274ed1d3637 Author: Cyril Strejc Date: Sun Oct 24 22:14:25 2021 +0200 net: multicast: calculate csum of looped-back and forwarded packets During a testing of an user-space application which transmits UDP multicast datagrams and utilizes multicast routing to send the UDP datagrams out of defined network interfaces, I've found a multicast router does not fill-in UDP checksum into locally produced, looped-back and forwarded UDP datagrams, if an original output NIC the datagrams are sent to has UDP TX checksum offload enabled. The datagrams are sent malformed out of the NIC the datagrams have been forwarded to. It is because: 1. If TX checksum offload is enabled on the output NIC, UDP checksum is not calculated by kernel and is not filled into skb data. 2. dev_loopback_xmit(), which is called solely by ip_mc_finish_output(), sets skb->ip_summed = CHECKSUM_UNNECESSARY unconditionally. 3. Since 35fc92a9 ("[NET]: Allow forwarding of ip_summed except CHECKSUM_COMPLETE"), the ip_summed value is preserved during forwarding. 4. If ip_summed != CHECKSUM_PARTIAL, checksum is not calculated during a packet egress. The minimum fix in dev_loopback_xmit(): 1. Preserves skb->ip_summed CHECKSUM_PARTIAL. This is the case when the original output NIC has TX checksum offload enabled. The effects are: a) If the forwarding destination interface supports TX checksum offloading, the NIC driver is responsible to fill-in the checksum. b) If the forwarding destination interface does NOT support TX checksum offloading, checksums are filled-in by kernel before skb is submitted to the NIC driver. c) For local delivery, checksum validation is skipped as in the case of CHECKSUM_UNNECESSARY, thanks to skb_csum_unnecessary(). 2. Translates ip_summed CHECKSUM_NONE to CHECKSUM_UNNECESSARY. It means, for CHECKSUM_NONE, the behavior is unmodified and is there to skip a looped-back packet local delivery checksum validation. Signed-off-by: Cyril Strejc Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit d81d0e41ed5fe7229a2c9a29d13bad288c7cf2d2 Author: Thomas Perrot Date: Fri Oct 22 16:21:04 2021 +0200 spi: spl022: fix Microwire full duplex mode There are missing braces in the function that verify controller parameters, then an error is always returned when the parameter to select Microwire frames operation is used on devices allowing it. Signed-off-by: Thomas Perrot Link: https://lore.kernel.org/r/20211022142104.1386379-1-thomas.perrot@bootlin.com Signed-off-by: Mark Brown commit 25e1f67eda4a19c91dc05c84d6d413c53efb447b Author: Sagi Grimberg Date: Sun Oct 24 10:43:31 2021 +0300 nvme-tcp: fix H2CData PDU send accounting (again) We should not access request members after the last send, even to determine if indeed it was the last data payload send. The reason is that a completion could have arrived and trigger a new execution of the request which overridden these members. This was fixed by commit 825619b09ad3 ("nvme-tcp: fix possible use-after-completion"). Commit e371af033c56 broke that assumption again to address cases where multiple r2t pdus are sent per request. To fix it, we need to record the request data_sent and data_len and after the payload network send we reference these counters to determine weather we should advance the request iterator. Fixes: e371af033c56 ("nvme-tcp: fix incorrect h2cdata pdu offset accounting") Reported-by: Keith Busch Cc: stable@vger.kernel.org # 5.10+ Signed-off-by: Sagi Grimberg Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit 926245c7d22271307606c88b1fbb2539a8550e94 Author: Maurizio Lombardi Date: Fri Oct 15 10:26:34 2021 +0200 nvmet-tcp: fix a memory leak when releasing a queue page_frag_free() won't completely release the memory allocated for the commands, the cache page must be explicitly freed by calling __page_frag_cache_drain(). This bug can be easily reproduced by repeatedly executing the following command on the initiator: $echo 1 > /sys/devices/virtual/nvme-fabrics/ctl/nvme0/reset_controller Signed-off-by: Maurizio Lombardi Reviewed-by: Sagi Grimberg Reviewed-by: John Meneghini Signed-off-by: Christoph Hellwig commit 6e6f96630805874fa80b0067e1a57aafc06225f6 Author: Imre Deak Date: Mon Oct 18 12:41:49 2021 +0300 drm/i915/dp: Skip the HW readout of DPCD on disabled encoders Reading out the DP encoders' DPCD during booting or resume is only required for enabled encoders: such encoders may be modesetted during the initial commit and the link training this involves depends on an initialized DPCD. For DDI encoders reading out the DPCD is skipped, do the same on pre-DDI platforms. Atm, the first DPCD readout without a sink connected - which is a likely scneario if the encoder is disabled - leaves intel_dp->num_common_rates at 0, which resulted in intel_dp_sync_state()->intel_dp_max_common_rate() in a intel_dp->common_rates[-1] access. This by definition results in an undefined behaviour, though to my best knowledge in all HW/compiler configurations it actually results in accessing the array item type value preceding the array. In this case the preceding value happens to be intel_dp->num_common_rates, which is 0, so this issue - by luck - didn't cause a user visible problem. Nevertheless it's still an undefined behaviour and in CONFIG_UBSAN builds leads to a kernel BUG() (which revealed this problem for us), hence CC:stable. A related problem in case the encoder is enabled but the sink is not connected or the DPCD readout fails is fixed by the next patch. v2: Amend the commit message describing the root cause of the CONFIG_UBSAN BUG(). Fixes: a532cde31de3 ("drm/i915/tc: Fix TypeC port init/resume time sanitization") References: https://gitlab.freedesktop.org/drm/intel/-/issues/4297 Reported-and-tested-by: Mat Jonczyk Cc: Mat Jonczyk Cc: José Roberto de Souza Cc: Jani Nikula Cc: Ville Syrjälä Cc: Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-2-imre.deak@intel.com (cherry picked from commit 4ec5ffc341cecbea060739aea1d53398ac2ec3f8) Signed-off-by: Jani Nikula commit 9761ffb8f1090289b908590039e2c363cc35cf45 Author: Ville Syrjälä Date: Thu Oct 14 12:09:40 2021 +0300 drm/i915: Catch yet another unconditioal clflush Replace the unconditional clflush() with drm_clflush_virt_range() which does the wbinvd() fallback when clflush is not available. This time no justification is given for the clflush in the offending commit. Cc: stable@vger.kernel.org Cc: Maarten Lankhorst Cc: Thomas Hellström Fixes: 2c8ab3339e39 ("drm/i915: Pin timeline map after first timeline pin, v4.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014090941.12159-4-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie (cherry picked from commit 9ced12182d0d8401d821e9602e56e276459900fc) Signed-off-by: Jani Nikula commit fcf918ffd3b35e288097036c04af7446b2c6f2f1 Author: Ville Syrjälä Date: Thu Oct 14 12:09:39 2021 +0300 drm/i915: Convert unconditional clflush to drm_clflush_virt_range() This one is apparently a "clflush for good measure", so bit more justification (if you can call it that) than some of the others. Convert to drm_clflush_virt_range() again so that machines without clflush will survive the ordeal. Cc: stable@vger.kernel.org Cc: Maarten Lankhorst Cc: Thomas Hellström #v1 Fixes: 12ca695d2c1e ("drm/i915: Do not share hwsp across contexts any more, v8.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014090941.12159-3-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie (cherry picked from commit af7b6d234eefa30c461cc16912bafb32b9e6141c) Signed-off-by: Jani Nikula commit 759635760a804b0d8ad0cc677b650f1544cae22f Author: Ido Schimmel Date: Sun Oct 24 09:40:14 2021 +0300 mlxsw: pci: Recycle received packet upon allocation failure When the driver fails to allocate a new Rx buffer, it passes an empty Rx descriptor (contains zero address and size) to the device and marks it as invalid by setting the skb pointer in the descriptor's metadata to NULL. After processing enough Rx descriptors, the driver will try to process the invalid descriptor, but will return immediately seeing that the skb pointer is NULL. Since the driver no longer passes new Rx descriptors to the device, the Rx queue will eventually become full and the device will start to drop packets. Fix this by recycling the received packet if allocation of the new packet failed. This means that allocation is no longer performed at the end of the Rx routine, but at the start, before tearing down the DMA mapping of the received packet. Remove the comment about the descriptor being zeroed as it is no longer correct. This is OK because we either use the descriptor as-is (when recycling) or overwrite its address and size fields with that of the newly allocated Rx buffer. The issue was discovered when a process ("perf") consumed too much memory and put the system under memory pressure. It can be reproduced by injecting slab allocation failures [1]. After the fix, the Rx queue no longer comes to a halt. [1] # echo 10 > /sys/kernel/debug/failslab/times # echo 1000 > /sys/kernel/debug/failslab/interval # echo 100 > /sys/kernel/debug/failslab/probability FAULT_INJECTION: forcing a failure. name failslab, interval 1000, probability 100, space 0, times 8 [...] Call Trace: dump_stack_lvl+0x34/0x44 should_fail.cold+0x32/0x37 should_failslab+0x5/0x10 kmem_cache_alloc_node+0x23/0x190 __alloc_skb+0x1f9/0x280 __netdev_alloc_skb+0x3a/0x150 mlxsw_pci_rdq_skb_alloc+0x24/0x90 mlxsw_pci_cq_tasklet+0x3dc/0x1200 tasklet_action_common.constprop.0+0x9f/0x100 __do_softirq+0xb5/0x252 irq_exit_rcu+0x7a/0xa0 common_interrupt+0x83/0xa0 asm_common_interrupt+0x1e/0x40 RIP: 0010:cpuidle_enter_state+0xc8/0x340 [...] mlxsw_spectrum2 0000:06:00.0: Failed to alloc skb for RDQ Fixes: eda6500a987a ("mlxsw: Add PCI bus implementation") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Link: https://lore.kernel.org/r/20211024064014.1060919-1-idosch@idosch.org Signed-off-by: Jakub Kicinski commit 3dd60fb9d95db9c78fec86ba4df20852a7b974ba Author: Christoph Hellwig Date: Tue Oct 19 09:36:40 2021 +0200 nvdimm/pmem: stop using q_usage_count as external pgmap refcount Originally all DAX access when through block_device operations and thus needed a queue reference. But since commit cccbce671582 ("filesystem-dax: convert to dax_direct_access()") all this happens at the DAX device level which uses its own refcounting. Having the external refcount thus wasn't needed but has otherwise been harmless for long time. But now that "block: drain file system I/O on del_gendisk" waits for q_usage_count to reach 0 in del_gendisk this whole scheme can't work anymore (and pmem is the only driver abusing q_usage_count like that). So switch to the internal reference and remove the unbalanced blk_freeze_queue_start that is taken care of by del_gendisk. Fixes: 8e141f9eb803 ("block: drain file system I/O on del_gendisk") Reported-by: Yi Zhang Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211019073641.2323410-2-hch@lst.de Signed-off-by: Dan Williams commit fd1b5beb177a8372cea2a0d014835491e4886f77 Author: Yongxin Liu Date: Mon Oct 11 15:02:16 2021 +0800 ice: check whether PTP is initialized in ice_ptp_release() PTP is currently only supported on E810 devices, it is checked in ice_ptp_init(). However, there is no check in ice_ptp_release(). For other E800 series devices, ice_ptp_release() will be wrongly executed. Fix the following calltrace. 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. Workqueue: ice ice_service_task [ice] Call Trace: dump_stack_lvl+0x5b/0x82 dump_stack+0x10/0x12 register_lock_class+0x495/0x4a0 ? find_held_lock+0x3c/0xb0 __lock_acquire+0x71/0x1830 lock_acquire+0x1e6/0x330 ? ice_ptp_release+0x3c/0x1e0 [ice] ? _raw_spin_lock+0x19/0x70 ? ice_ptp_release+0x3c/0x1e0 [ice] _raw_spin_lock+0x38/0x70 ? ice_ptp_release+0x3c/0x1e0 [ice] ice_ptp_release+0x3c/0x1e0 [ice] ice_prepare_for_reset+0xcb/0xe0 [ice] ice_do_reset+0x38/0x110 [ice] ice_service_task+0x138/0xf10 [ice] ? __this_cpu_preempt_check+0x13/0x20 process_one_work+0x26a/0x650 worker_thread+0x3f/0x3b0 ? __kthread_parkme+0x51/0xb0 ? process_one_work+0x650/0x650 kthread+0x161/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 Fixes: 4dd0d5c33c3e ("ice: add lock around Tx timestamp tracker flush") Signed-off-by: Yongxin Liu Reviewed-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 6a8b357278f5f8b9817147277ab8f12879dce8a8 Author: Dave Ertman Date: Thu Oct 7 08:40:31 2021 -0700 ice: Respond to a NETDEV_UNREGISTER event for LAG When the PF is a member of a link aggregate, and the driver is removed, the process will hang unless we respond to the NETDEV_UNREGISTER event that is sent to the event_handler for LAG. Add a case statement for the ice_lag_event_handler to unlink the PF from the link aggregate. Also remove code that was incorrectly applying a dev_hold to peer_netdevs that were associated with the ice driver. Fixes: df006dd4b1dc ("ice: Add initial support framework for LAG") Signed-off-by: Dave Ertman Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit e091b836a3baee4c8b1423a969589196b88a9e06 Author: Amit Pundir Date: Thu Oct 14 16:54:10 2021 +0300 Revert "arm64: dts: qcom: sm8250: remove bus clock from the mdss node for sm8250 target" This reverts commit 001ce9785c0674d913531345e86222c965fc8bf4. This upstream commit broke AOSP (post Android 12 merge) build on RB5. The device either silently crashes into USB crash mode after android boot animation or we see a blank blue screen with following dpu errors in dmesg: [ T444] hw recovery is not complete for ctl:3 [ T444] [drm:dpu_encoder_phys_vid_prepare_for_kickoff:539] [dpu error]enc31 intf1 ctl 3 reset failure: -22 [ T444] [drm:dpu_encoder_phys_vid_wait_for_commit_done:513] [dpu error]vblank timeout [ T444] [drm:dpu_kms_wait_for_commit_done:454] [dpu error]wait for commit done returned -110 [ C7] [drm:dpu_encoder_frame_done_timeout:2127] [dpu error]enc31 frame done timeout [ T444] [drm:dpu_encoder_phys_vid_wait_for_commit_done:513] [dpu error]vblank timeout [ T444] [drm:dpu_kms_wait_for_commit_done:454] [dpu error]wait for commit done returned -110 Fixes: 001ce9785c06 ("arm64: dts: qcom: sm8250: remove bus clock from the mdss node for sm8250 target") Signed-off-by: Amit Pundir Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211014135410.4136412-1-dmitry.baryshkov@linaro.org commit 3906fe9bb7f1a2c8667ae54e967dc8690824f4ea Author: Linus Torvalds Date: Mon Oct 25 11:30:31 2021 -0700 Linux 5.15-rc7 commit cb685432398122053f3e1dc6a1d68924e5b77be4 Author: Matthew Wilcox (Oracle) Date: Mon Oct 25 19:16:34 2021 +0100 secretmem: Prevent secretmem_users from wrapping to zero Commit 110860541f44 ("mm/secretmem: use refcount_t instead of atomic_t") attempted to fix the problem of secretmem_users wrapping to zero and allowing suspend once again. But it was reverted in commit 87066fdd2e30 ("Revert 'mm/secretmem: use refcount_t instead of atomic_t'") because of the problems it caused - a refcount_t was not semantically the right type to use. Instead prevent secretmem_users from wrapping to zero by forbidding new users if the number of users has wrapped from positive to negative. This stops a long way short of reaching the necessary 4 billion users where it wraps to zero again, so there's no need to be clever with special anti-wrap types or checking the return value from atomic_inc(). Signed-off-by: Matthew Wilcox (Oracle) Cc: Jordy Zomer Cc: Kees Cook , Cc: James Bottomley Cc: Mike Rapoport Cc: Andrew Morton Signed-off-by: Linus Torvalds commit ac8a6eba2a117e0fdc04da62ab568d1b7ca4c8f6 Author: Linus Torvalds Date: Mon Oct 25 10:46:41 2021 -0700 spi: Fix tegra20 build with CONFIG_PM=n once again Commit efafec27c565 ("spi: Fix tegra20 build with CONFIG_PM=n") already fixed the build without PM support once. There was an alternative fix by Guenter in commit 2bab94090b01 ("spi: tegra20-slink: Declare runtime suspend and resume functions conditionally"), and Mark then merged the two correctly in ffb1e76f4f32 ("Merge tag 'v5.15-rc2' into spi-5.15"). But for some inexplicable reason, Mark then merged things _again_ in commit 59c4e190b10c ("Merge tag 'v5.15-rc3' into spi-5.15"), and screwed things up at that point, and the __maybe_unused attribute on tegra_slink_runtime_resume() went missing. Reinstate it, so that alpha (and other architectures without PM support) builds cleanly again. Btw, this is another prime example of how random back-merges are not good. Just don't do them. Subsystem developers should not merge my tree in any normal circumstances. Both of those merge commits pointed to above are bad: even the one that got the merge result right doesn't even mention _why_ it was done, and the one that got it wrong is obviously broken. Reported-by: Guenter Roeck Cc: Mark Brown Signed-off-by: Linus Torvalds commit c2b43854aad9e52b422e6c6342a1da2261f98fa5 Merge: 4862649f16e79 00568b8a6364e Author: Linus Torvalds Date: Mon Oct 25 10:28:52 2021 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - Fix clang-related relocation warning in futex code - Fix incorrect use of get_kernel_nofault() - Fix bad code generation in __get_user_check() when kasan is enabled - Ensure TLB function table is correctly aligned - Remove duplicated string function definitions in decompressor - Fix link-time orphan section warnings - Fix old-style function prototype for arch_init_kprobes() - Only warn about XIP address when not compile testing - Handle BE32 big endian for keystone2 remapping * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9148/1: handle CONFIG_CPU_ENDIAN_BE32 in arch/arm/kernel/head.S ARM: 9141/1: only warn about XIP address when not compile testing ARM: 9139/1: kprobes: fix arch_init_kprobes() prototype ARM: 9138/1: fix link warning with XIP + frame-pointer ARM: 9134/1: remove duplicate memcpy() definition ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned ARM: 9132/1: Fix __get_user_check failure with ARM KASAN images ARM: 9125/1: fix incorrect use of get_kernel_nofault() ARM: 9122/1: select HAVE_FUTEX_CMPXCHG commit 4862649f16e79299b4f82a8e13dd8f9e5abcaa25 Merge: a51aec4109300 a0023bb9dd9bc Author: Linus Torvalds Date: Mon Oct 25 09:57:28 2021 -0700 Merge tag 'libata-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull libata fix from Damien Le Moal: "A single fix in this pull request addressing an invalid error code return in the sata_mv driver (from Zheyu)" * tag 'libata-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: sata_mv: Fix the error handling of mv_chip_id() commit a51aec4109300d843bf144579109d5288856f72a Merge: 87066fdd2e30f 4e5a04be88fe3 Author: Linus Torvalds Date: Mon Oct 25 09:47:18 2021 -0700 Merge tag 'pinctrl-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Some late pin control fixes, the most generally annoying will probably be the AMD IRQ storm fix affecting the Microsoft surface. Summary: - Three fixes pertaining to Broadcom DT bindings. Some stuff didn't work out as inteded, we need to back out - A resume bug fix in the STM32 driver - Disable and mask the interrupts on probe in the AMD pinctrl driver, affecting Microsoft surface" * tag 'pinctrl-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: amd: disable and mask interrupts on probe pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume() Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode" dt-bindings: pinctrl: brcm,ns-pinmux: drop unneeded CRU from example Revert "dt-bindings: pinctrl: bcm4708-pinmux: rework binding to use syscon" commit f7a1e76d0f608961cc2fc681f867a834f2746bce Author: Xin Long Date: Mon Oct 25 02:31:48 2021 -0400 net-sysfs: initialize uid and gid before calling net_ns_get_ownership Currently in net_ns_get_ownership() it may not be able to set uid or gid if make_kuid or make_kgid returns an invalid value, and an uninit-value issue can be triggered by this. This patch is to fix it by initializing the uid and gid before calling net_ns_get_ownership(), as it does in kobject_get_ownership() Fixes: e6dee9f3893c ("net-sysfs: add netdev_change_owner()") Reported-by: Paolo Abeni Signed-off-by: Xin Long Acked-by: Christian Brauner Signed-off-by: David S. Miller commit 042b2046d0f05cf8124c26ff65dbb6148a4404fb Author: Dongli Zhang Date: Fri Oct 22 16:31:39 2021 -0700 xen/netfront: stop tx queues during live migration The tx queues are not stopped during the live migration. As a result, the ndo_start_xmit() may access netfront_info->queues which is freed by talk_to_netback()->xennet_destroy_queues(). This patch is to netif_device_detach() at the beginning of xen-netfront resuming, and netif_device_attach() at the end of resuming. CPU A CPU B talk_to_netback() -> if (info->queues) xennet_destroy_queues(info); to free netfront_info->queues xennet_start_xmit() to access netfront_info->queues -> err = xennet_create_queues(info, &num_queues); The idea is borrowed from virtio-net. Cc: Joe Jin Signed-off-by: Dongli Zhang Signed-off-by: David S. Miller commit 0c57eeecc559ca6bc18b8c4e2808bc78dbe769b0 Author: Michael Chan Date: Mon Oct 25 05:05:28 2021 -0400 net: Prevent infinite while loop in skb_tx_hash() Drivers call netdev_set_num_tc() and then netdev_set_tc_queue() to set the queue count and offset for each TC. So the queue count and offset for the TCs may be zero for a short period after dev->num_tc has been set. If a TX packet is being transmitted at this time in the code path netdev_pick_tx() -> skb_tx_hash(), skb_tx_hash() may see nonzero dev->num_tc but zero qcount for the TC. The while loop that keeps looping while hash >= qcount will not end. Fix it by checking the TC's qcount to be nonzero before using it. Fixes: eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx") Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 64733956ebba7cc629856f4a6ee35a52bc9c023f Author: Mark Zhang Date: Sun Oct 24 09:08:20 2021 +0300 RDMA/sa_query: Use strscpy_pad instead of memcpy to copy a string When copying the device name, the length of the data memcpy copied exceeds the length of the source buffer, which cause the KASAN issue below. Use strscpy_pad() instead. BUG: KASAN: slab-out-of-bounds in ib_nl_set_path_rec_attrs+0x136/0x320 [ib_core] Read of size 64 at addr ffff88811a10f5e0 by task rping/140263 CPU: 3 PID: 140263 Comm: rping Not tainted 5.15.0-rc1+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x7d print_address_description.constprop.0+0x1d/0xa0 kasan_report+0xcb/0x110 kasan_check_range+0x13d/0x180 memcpy+0x20/0x60 ib_nl_set_path_rec_attrs+0x136/0x320 [ib_core] ib_nl_make_request+0x1c6/0x380 [ib_core] send_mad+0x20a/0x220 [ib_core] ib_sa_path_rec_get+0x3e3/0x800 [ib_core] cma_query_ib_route+0x29b/0x390 [rdma_cm] rdma_resolve_route+0x308/0x3e0 [rdma_cm] ucma_resolve_route+0xe1/0x150 [rdma_ucm] ucma_write+0x17b/0x1f0 [rdma_ucm] vfs_write+0x142/0x4d0 ksys_write+0x133/0x160 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f26499aa90f Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 29 fd ff 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 5c fd ff ff 48 RSP: 002b:00007f26495f2dc0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000000007d0 RCX: 00007f26499aa90f RDX: 0000000000000010 RSI: 00007f26495f2e00 RDI: 0000000000000003 RBP: 00005632a8315440 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000293 R12: 00007f26495f2e00 R13: 00005632a83154e0 R14: 00005632a8315440 R15: 00005632a830a810 Allocated by task 131419: kasan_save_stack+0x1b/0x40 __kasan_kmalloc+0x7c/0x90 proc_self_get_link+0x8b/0x100 pick_link+0x4f1/0x5c0 step_into+0x2eb/0x3d0 walk_component+0xc8/0x2c0 link_path_walk+0x3b8/0x580 path_openat+0x101/0x230 do_filp_open+0x12e/0x240 do_sys_openat2+0x115/0x280 __x64_sys_openat+0xce/0x140 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 2ca546b92a02 ("IB/sa: Route SA pathrecord query through netlink") Link: https://lore.kernel.org/r/72ede0f6dab61f7f23df9ac7a70666e07ef314b0.1635055496.git.leonro@nvidia.com Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ace19b992436a257d9a793672e57abc28fe83e2e Author: Trevor Woerner Date: Sun Oct 24 13:50:02 2021 -0400 net: nxp: lpc_eth.c: avoid hang when bringing interface down A hard hang is observed whenever the ethernet interface is brought down. If the PHY is stopped before the LPC core block is reset, the SoC will hang. Comparing lpc_eth_close() and lpc_eth_open() I re-arranged the ordering of the functions calls in lpc_eth_close() to reset the hardware before stopping the PHY. Fixes: b7370112f519 ("lpc32xx: Added ethernet driver") Signed-off-by: Trevor Woerner Acked-by: Vladimir Zapolskiy Signed-off-by: David S. Miller commit 689a0a9f505f7bffdefe6f17fddb41c8ab6344f6 Author: Janusz Dziedzic Date: Sun Oct 24 22:15:46 2021 +0200 cfg80211: correct bridge/4addr mode check Without the patch we fail: $ sudo brctl addbr br0 $ sudo brctl addif br0 wlp1s0 $ sudo iw wlp1s0 set 4addr on command failed: Device or resource busy (-16) Last command failed but iface was already in 4addr mode. Fixes: ad4bb6f8883a ("cfg80211: disallow bridging managed/adhoc interfaces") Signed-off-by: Janusz Dziedzic Link: https://lore.kernel.org/r/20211024201546.614379-1-janusz.dziedzic@gmail.com [add fixes tag, fix indentation, edit commit log] Signed-off-by: Johannes Berg commit 09b1d5dc6ce1c9151777f6c4e128a59457704c97 Author: Johannes Berg Date: Mon Oct 25 13:31:12 2021 +0200 cfg80211: fix management registrations locking The management registrations locking was broken, the list was locked for each wdev, but cfg80211_mgmt_registrations_update() iterated it without holding all the correct spinlocks, causing list corruption. Rather than trying to fix it with fine-grained locking, just move the lock to the wiphy/rdev (still need the list on each wdev), we already need to hold the wdev lock to change it, so there's no contention on the lock in any case. This trivially fixes the bug since we hold one wdev's lock already, and now will hold the lock that protects all lists. Cc: stable@vger.kernel.org Reported-by: Jouni Malinen Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API") Link: https://lore.kernel.org/r/20211025133111.5cf733eab0f4.I7b0abb0494ab712f74e2efcd24bb31ac33f7eee9@changeid Signed-off-by: Johannes Berg commit 0985dba842eaa391858972cfe2724c3c174a2827 Author: David Woodhouse Date: Sat Oct 23 20:47:19 2021 +0100 KVM: x86/xen: Fix kvm_xen_has_interrupt() sleeping in kvm_vcpu_block() In kvm_vcpu_block, the current task is set to TASK_INTERRUPTIBLE before making a final check whether the vCPU should be woken from HLT by any incoming interrupt. This is a problem for the get_user() in __kvm_xen_has_interrupt(), which really shouldn't be sleeping when the task state has already been set. I think it's actually harmless as it would just manifest itself as a spurious wakeup, but it's causing a debug warning: [ 230.963649] do not call blocking ops when !TASK_RUNNING; state=1 set at [<00000000b6bcdbc9>] prepare_to_swait_exclusive+0x30/0x80 Fix the warning by turning it into an *explicit* spurious wakeup. When invoked with !task_is_running(current) (and we might as well add in_atomic() there while we're at it), just return 1 to indicate that an IRQ is pending, which will cause a wakeup and then something will call it again in a context that *can* sleep so it can fault the page back in. Cc: stable@vger.kernel.org Fixes: 40da8ccd724f ("KVM: x86/xen: Add event channel interrupt vector upcall") Signed-off-by: David Woodhouse Message-Id: <168bf8c689561da904e48e2ff5ae4713eaef9e2d.camel@infradead.org> Signed-off-by: Paolo Bonzini commit 4b2caef043dd89dd98da282cd6b90af2cbb60650 Merge: 8228c77d8b56e 0e9ff65f455df Author: Paolo Bonzini Date: Mon Oct 25 09:08:56 2021 -0400 Merge tag 'kvm-s390-master-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fixes for interrupt delivery Two bugs that might result in CPUs not woken up when interrupts are pending. commit b4ab21f90320969e5360719467153fc2bbc9435c Merge: 95a359c955334 af1a02aa23c37 Author: David S. Miller Date: Mon Oct 25 14:06:43 2021 +0100 Merge branch 'ksettings-locking-fixes' Andrew Lunn says: ==================== ksettings_{get|set} lock fixes Walter Stoll reported a race condition between "ethtool -s eth0 speed 100 duplex full autoneg off" and phylib reading the current status from the PHY. Both ksetting_get and ksetting_set fail the take the phydev mutex, and as a result, there is a small window of time where the phydev members are not self consistent. Patch 1 fixes phy_ethtool_ksettings_get by adding the needed lock. Patches 2 and 3 move code around and perform to refactoring, to allow patch 4 to fix phy_ethtool_ksettings_set by added the lock. Thanks go to Walter for the detailed origional report, suggested fix, and testing of the proposed patches. ==================== Signed-off-by: David S. Miller commit af1a02aa23c37045e6adfcf074cf7dbac167a403 Author: Andrew Lunn Date: Sun Oct 24 21:48:05 2021 +0200 phy: phy_ethtool_ksettings_set: Lock the PHY while changing settings There is a race condition where the PHY state machine can change members of the phydev structure at the same time userspace requests a change via ethtool. To prevent this, have phy_ethtool_ksettings_set take the PHY lock. Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support") Reported-by: Walter Stoll Suggested-by: Walter Stoll Tested-by: Walter Stoll Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 707293a56f95f8e7e0cfae008010c7933fb68973 Author: Andrew Lunn Date: Sun Oct 24 21:48:04 2021 +0200 phy: phy_start_aneg: Add an unlocked version Split phy_start_aneg into a wrapper which takes the PHY lock, and a helper doing the real work. This will be needed when phy_ethtook_ksettings_set takes the lock. Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 64cd92d5e8180c2ded3fdea76862de6f596ae2c9 Author: Andrew Lunn Date: Sun Oct 24 21:48:03 2021 +0200 phy: phy_ethtool_ksettings_set: Move after phy_start_aneg This allows it to make use of a helper which assume the PHY is already locked. Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit c10a485c3de5ccbf1fff65a382cebcb2730c6b06 Author: Andrew Lunn Date: Sun Oct 24 21:48:02 2021 +0200 phy: phy_ethtool_ksettings_get: Lock the phy for consistency The PHY structure should be locked while copying information out if it, otherwise there is no guarantee of self consistency. Without the lock the PHY state machine could be updating the structure. Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 8228c77d8b56e3f735baf71fefb1b548c23691a7 Author: David Woodhouse Date: Sat Oct 23 21:29:22 2021 +0100 KVM: x86: switch pvclock_gtod_sync_lock to a raw spinlock On the preemption path when updating a Xen guest's runstate times, this lock is taken inside the scheduler rq->lock, which is a raw spinlock. This was shown in a lockdep warning: [ 89.138354] ============================= [ 89.138356] [ BUG: Invalid wait context ] [ 89.138358] 5.15.0-rc5+ #834 Tainted: G S I E [ 89.138360] ----------------------------- [ 89.138361] xen_shinfo_test/2575 is trying to lock: [ 89.138363] ffffa34a0364efd8 (&kvm->arch.pvclock_gtod_sync_lock){....}-{3:3}, at: get_kvmclock_ns+0x1f/0x130 [kvm] [ 89.138442] other info that might help us debug this: [ 89.138444] context-{5:5} [ 89.138445] 4 locks held by xen_shinfo_test/2575: [ 89.138447] #0: ffff972bdc3b8108 (&vcpu->mutex){+.+.}-{4:4}, at: kvm_vcpu_ioctl+0x77/0x6f0 [kvm] [ 89.138483] #1: ffffa34a03662e90 (&kvm->srcu){....}-{0:0}, at: kvm_arch_vcpu_ioctl_run+0xdc/0x8b0 [kvm] [ 89.138526] #2: ffff97331fdbac98 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0xff/0xbd0 [ 89.138534] #3: ffffa34a03662e90 (&kvm->srcu){....}-{0:0}, at: kvm_arch_vcpu_put+0x26/0x170 [kvm] ... [ 89.138695] get_kvmclock_ns+0x1f/0x130 [kvm] [ 89.138734] kvm_xen_update_runstate+0x14/0x90 [kvm] [ 89.138783] kvm_xen_update_runstate_guest+0x15/0xd0 [kvm] [ 89.138830] kvm_arch_vcpu_put+0xe6/0x170 [kvm] [ 89.138870] kvm_sched_out+0x2f/0x40 [kvm] [ 89.138900] __schedule+0x5de/0xbd0 Cc: stable@vger.kernel.org Reported-by: syzbot+b282b65c2c68492df769@syzkaller.appspotmail.com Fixes: 30b5c851af79 ("KVM: x86/xen: Add support for vCPU runstate information") Signed-off-by: David Woodhouse Message-Id: <1b02a06421c17993df337493a68ba923f3bd5c0f.camel@infradead.org> Signed-off-by: Paolo Bonzini commit 00568b8a6364e15009b345b462e927e0b9fc2bb9 Author: LABBE Corentin Date: Thu Oct 21 10:26:57 2021 +0100 ARM: 9148/1: handle CONFIG_CPU_ENDIAN_BE32 in arch/arm/kernel/head.S My intel-ixp42x-welltech-epbx100 no longer boot since 4.14. This is due to commit 463dbba4d189 ("ARM: 9104/2: Fix Keystone 2 kernel mapping regression") which forgot to handle CONFIG_CPU_ENDIAN_BE32 as possible BE config. Suggested-by: Krzysztof Hałasa Fixes: 463dbba4d189 ("ARM: 9104/2: Fix Keystone 2 kernel mapping regression") Signed-off-by: Corentin Labbe Signed-off-by: Russell King (Oracle) commit c0eee6fbfa2b3377f1efed10dad539abeb7312aa Author: Asmaa Mnebhi Date: Fri Oct 22 09:44:38 2021 -0400 gpio: mlxbf2.c: Add check for bgpio_init failure Add a check if bgpio_init fails. Signed-off-by: Asmaa Mnebhi Signed-off-by: Bartosz Golaszewski commit 85fe6415c146d5d42ce300c12f1ecf4d4af47d40 Author: Jonas Gorski Date: Thu Oct 14 14:33:42 2021 +0200 gpio: xgs-iproc: fix parsing of ngpios property of_property_read_u32 returns 0 on success, not true, so we need to invert the check to actually take over the provided ngpio value. Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver") Signed-off-by: Jonas Gorski Reviewed-by: Chris Packham Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit d853adc7adf601d7d6823afe3ed396065a3e08d1 Author: Alexey Kardashevskiy Date: Thu Oct 21 00:23:15 2021 +1100 powerpc/pseries/iommu: Create huge DMA window if no MMIO32 is present The iommu_init_table() helper takes an address range to reserve in the IOMMU table being initialized to exclude MMIO addresses, this is useful if the window stretches far beyond 4GB (although wastes some TCEs). At the moment the code searches for such MMIO32 range and fails if none found which is considered a problem while it really is not: it is actually better as this says there is no MMIO32 to reserve and we can use usually wasted TCEs. Furthermore PHYP never actually allows creating windows starting at busaddress=0 so this MMIO32 range is never useful. This removes error exit and initializes the table with zero range if no MMIO32 is detected. Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211020132315.2287178-5-aik@ozlabs.ru commit 92fe01b7c655b9767724e7d62bdded0761d232ff Author: Alexey Kardashevskiy Date: Thu Oct 21 00:23:14 2021 +1100 powerpc/pseries/iommu: Check if the default window in use before removing it At the moment this check is performed after we remove the default window which is late and disallows to revert whatever changes enable_ddw() has made to DMA windows. This moves the check and error exit before removing the window. This raised the message severity from "debug" to "warning" as this should not happen in practice and cannot be triggered by the userspace. Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211020132315.2287178-4-aik@ozlabs.ru commit 41ee7232fa5f3c034f22baa52bc287e494e2129a Author: Alexey Kardashevskiy Date: Thu Oct 21 00:23:13 2021 +1100 powerpc/pseries/iommu: Use correct vfree for it_map The it_map array is vzalloc'ed so use vfree() for it when creating a huge DMA window failed for whatever reason. While at this, write zero to it_map. Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211020132315.2287178-3-aik@ozlabs.ru commit a0023bb9dd9bc439d44604eeec62426a990054cd Author: Zheyu Ma Date: Fri Oct 22 09:12:26 2021 +0000 ata: sata_mv: Fix the error handling of mv_chip_id() mv_init_host() propagates the value returned by mv_chip_id() which in turn gets propagated by mv_pci_init_one() and hits local_pci_probe(). During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Since this is a bug rather than a recoverable runtime error we should use dev_alert() instead of dev_err(). Signed-off-by: Zheyu Ma Signed-off-by: Damien Le Moal commit 87066fdd2e30fe9dd531125d95257c118a74617e Author: Linus Torvalds Date: Sun Oct 24 09:48:33 2021 -1000 Revert "mm/secretmem: use refcount_t instead of atomic_t" This reverts commit 110860541f443f950c1274f217a1a3e298670a33. Converting the "secretmem_users" counter to a refcount is incorrect, because a refcount is special in zero and can't just be incremented (but a count of users is not, and "no users" is actually perfectly valid and not a sign of a free'd resource). Reported-by: syzbot+75639e6a0331cd61d3e2@syzkaller.appspotmail.com Cc: Jordy Zomer Cc: Kees Cook , Cc: Jordy Zomer Cc: James Bottomley Cc: Mike Rapoport Cc: Andrew Morton Signed-off-by: Linus Torvalds commit b20078fd69a3da08d85c79b95101cf25c4afcc97 Merge: 6c62666d88792 25f54d08f12fe Author: Linus Torvalds Date: Sun Oct 24 09:36:06 2021 -1000 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull autofs fix from Al Viro: "Fix for a braino of mine (in getting rid of open-coded dentry_path_raw() in autofs a couple of cycles ago). Mea culpa... Obvious -stable fodder" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: autofs: fix wait name hash calculation in autofs_wait() commit 6c62666d8879238578b727f8e0a821e90c88f87e Merge: 16bc177666c03 63acd42c0d494 Author: Linus Torvalds Date: Sun Oct 24 07:04:21 2021 -1000 Merge tag 'sched_urgent_for_v5.15_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "Reset clang's Shadow Call Stack on hotplug to prevent it from overflowing" * tag 'sched_urgent_for_v5.15_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/scs: Reset the shadow stack when idle_task_exit commit 16bc177666c037b4aa3e1f68f4eac685006c622b Merge: c460e7896e690 0a30896fc5025 Author: Linus Torvalds Date: Sun Oct 24 07:00:15 2021 -1000 Merge tag 'x86_urgent_for_v5.15_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Borislav Petkov: "A single change adding Dave Hansen to our maintainers team" * tag 'x86_urgent_for_v5.15_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: MAINTAINERS: Add Dave Hansen to the x86 maintainer team commit c460e7896e6906d4e154f2e7fb7f40d46edbd006 Merge: 0f386a604ce50 0d994cd482ee4 Author: Linus Torvalds Date: Sun Oct 24 06:43:59 2021 -1000 Merge tag '5.15-rc6-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd fixes from Steve French: "Ten fixes for the ksmbd kernel server, for improved security and additional buffer overflow checks: - a security improvement to session establishment to reduce the possibility of dictionary attacks - fix to ensure that maximum i/o size negotiated in the protocol is not less than 64K and not more than 8MB to better match expected behavior - fix for crediting (flow control) important to properly verify that sufficient credits are available for the requested operation - seven additional buffer overflow, buffer validation checks" * tag '5.15-rc6-ksmbd-fixes' of git://git.samba.org/ksmbd: ksmbd: add buffer validation in session setup ksmbd: throttle session setup failures to avoid dictionary attacks ksmbd: validate OutputBufferLength of QUERY_DIR, QUERY_INFO, IOCTL requests ksmbd: validate credit charge after validating SMB2 PDU body size ksmbd: add buffer validation for smb direct ksmbd: limit read/write/trans buffer size not to exceed 8MB ksmbd: validate compound response buffer ksmbd: fix potencial 32bit overflow from data area check in smb2_write ksmbd: improve credits management ksmbd: add validation in smb2_ioctl commit 0f386a604ce5074724909a8927d6d97ef998b5a9 Merge: 9c0c4d24ac000 4e5483b8440d0 Author: Linus Torvalds Date: Sun Oct 24 06:23:48 2021 -1000 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Ten fixes, seven of which are in drivers. The core fixes are one to fix a potential crash on resume, one to sort out our reference count releases to avoid releasing in-use modules and one to adjust the cmd per lun calculation to avoid an overflow in hyper-v" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: ufs-pci: Force a full restore after suspend-to-disk scsi: qla2xxx: Fix unmap of already freed sgl scsi: qla2xxx: Fix a memory leak in an error path of qla2x00_process_els() scsi: qla2xxx: Return -ENOMEM if kzalloc() fails scsi: sd: Fix crashes in sd_resume_runtime() scsi: mpi3mr: Fix duplicate device entries when scanning through sysfs scsi: core: Put LLD module refcnt after SCSI device is released scsi: storvsc: Fix validation for unsolicited incoming packets scsi: iscsi: Fix set_param() handling scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma() commit 95a359c9553342d36d408d35331ff0bfce75272f Author: Yuiko Oshino Date: Fri Oct 22 11:53:43 2021 -0400 net: ethernet: microchip: lan743x: Fix dma allocation failure by using dma_set_mask_and_coherent The dma failure was reported in the raspberry pi github (issue #4117). https://github.com/raspberrypi/linux/issues/4117 The use of dma_set_mask_and_coherent fixes the issue. Tested on 32/64-bit raspberry pi CM4 and 64-bit ubuntu x86 PC with EVB-LAN7430. Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Yuiko Oshino Signed-off-by: David S. Miller commit d6423d2ec39cce2bfca418c81ef51792891576bc Author: Yuiko Oshino Date: Fri Oct 22 11:13:53 2021 -0400 net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails The driver needs to clean up and return when the initialization fails on resume. Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Yuiko Oshino Signed-off-by: David S. Miller commit 9c0c4d24ac000e52d55348961d3a3ba42065e0cf Merge: da4d34b669723 9fbfabfda25d8 Author: Linus Torvalds Date: Fri Oct 22 17:42:13 2021 -1000 Merge tag 'block-5.15-2021-10-22' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Fix for the cgroup code not ussing irq safe stats updates, and one fix for an error handling condition in add_partition()" * tag 'block-5.15-2021-10-22' of git://git.kernel.dk/linux-block: block: fix incorrect references to disk objects blk-cgroup: blk_cgroup_bio_start() should use irq-safe operations on blkg->iostat_cpu commit da4d34b669723508601a4c29daa22cdc669ee005 Merge: 5ab2ed0a8d75c b22fa62a35d7f Author: Linus Torvalds Date: Fri Oct 22 17:34:31 2021 -1000 Merge tag 'io_uring-5.15-2021-10-22' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Two fixes for the max workers limit API that was introduced this series: one fix for an issue with that code, and one fixing a linked timeout regression in this series" * tag 'io_uring-5.15-2021-10-22' of git://git.kernel.dk/linux-block: io_uring: apply worker limits to previous users io_uring: fix ltimeout unprep io_uring: apply max_workers limit to all future users io-wq: max_worker fixes commit 04f8ef5643bcd8bcde25dfdebef998aea480b2ba Author: Quanyang Wang Date: Mon Oct 18 15:56:23 2021 +0800 cgroup: Fix memory leak caused by missing cgroup_bpf_offline When enabling CONFIG_CGROUP_BPF, kmemleak can be observed by running the command as below: $mount -t cgroup -o none,name=foo cgroup cgroup/ $umount cgroup/ unreferenced object 0xc3585c40 (size 64): comm "mount", pid 425, jiffies 4294959825 (age 31.990s) hex dump (first 32 bytes): 01 00 00 80 84 8c 28 c0 00 00 00 00 00 00 00 00 ......(......... 00 00 00 00 00 00 00 00 6c 43 a0 c3 00 00 00 00 ........lC...... backtrace: [] cgroup_bpf_inherit+0x44/0x24c [<1f03679c>] cgroup_setup_root+0x174/0x37c [] cgroup1_get_tree+0x2c0/0x4a0 [] vfs_get_tree+0x24/0x108 [] path_mount+0x384/0x988 [] do_mount+0x64/0x9c [<208c9cfe>] sys_mount+0xfc/0x1f4 [<06dd06e0>] ret_fast_syscall+0x0/0x48 [] 0xbeb4daa8 This is because that since the commit 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path") root_cgrp->bpf.refcnt.data is allocated by the function percpu_ref_init in cgroup_bpf_inherit which is called by cgroup_setup_root when mounting, but not freed along with root_cgrp when umounting. Adding cgroup_bpf_offline which calls percpu_ref_kill to cgroup_kill_sb can free root_cgrp->bpf.refcnt.data in umount path. This patch also fixes the commit 4bfc0bb2c60e ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself"). A cgroup_bpf_offline is needed to do a cleanup that frees the resources which are allocated by cgroup_bpf_inherit in cgroup_setup_root. And inside cgroup_bpf_offline, cgroup_get() is at the beginning and cgroup_put is at the end of cgroup_bpf_release which is called by cgroup_bpf_offline. So cgroup_bpf_offline can keep the balance of cgroup's refcount. Fixes: 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path") Fixes: 4bfc0bb2c60e ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself") Signed-off-by: Quanyang Wang Signed-off-by: Alexei Starovoitov Acked-by: Roman Gushchin Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20211018075623.26884-1-quanyang.wang@windriver.com commit fda7a38714f40b635f5502ec4855602c6b33dad2 Author: Xu Kuohai Date: Tue Oct 19 03:29:34 2021 +0000 bpf: Fix error usage of map_fd and fdget() in generic_map_update_batch() 1. The ufd in generic_map_update_batch() should be read from batch.map_fd; 2. A call to fdget() should be followed by a symmetric call to fdput(). Fixes: aa2e93b8e58e ("bpf: Add generic support for update and delete batch ops") Signed-off-by: Xu Kuohai Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211019032934.1210517-1-xukuohai@huawei.com commit 22a127908e747c7ede8382d5f8d4cc6c9920004f Merge: 4225fea1cb283 fadb7ff1a6c2c Author: Alexei Starovoitov Date: Wed Oct 20 18:19:02 2021 -0700 Merge branch 'Fix up bpf_jit_limit some more' Lorenz Bauer says: ==================== Fix some inconsistencies of bpf_jit_limit on non-x86 platforms. I've dropped exposing bpf_jit_current since we couldn't agree on file modes, correct names, etc. ==================== Signed-off-by: Alexei Starovoitov commit fadb7ff1a6c2c565af56b4aacdd086b067eed440 Author: Lorenz Bauer Date: Thu Oct 14 15:25:53 2021 +0100 bpf: Prevent increasing bpf_jit_limit above max Restrict bpf_jit_limit to the maximum supported by the arch's JIT. Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211014142554.53120-4-lmb@cloudflare.com commit 5d63ae908242f028bd10860cba98450d11c079b8 Author: Lorenz Bauer Date: Thu Oct 14 15:25:52 2021 +0100 bpf: Define bpf_jit_alloc_exec_limit for arm64 JIT Expose the maximum amount of useable memory from the arm64 JIT. Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211014142554.53120-3-lmb@cloudflare.com commit 8f04db78e4e36a5d4858ce841a3e9cc3d69bde36 Author: Lorenz Bauer Date: Thu Oct 14 15:25:51 2021 +0100 bpf: Define bpf_jit_alloc_exec_limit for riscv JIT Expose the maximum amount of useable memory from the riscv JIT. Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Acked-by: Luke Nelson Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20211014142554.53120-2-lmb@cloudflare.com commit 1f83b835a3eaa5ae4bd825fb07182698bfc243ba Author: Florian Westphal Date: Thu Oct 21 16:02:47 2021 +0200 fcnal-test: kill hanging ping/nettest binaries on cleanup On my box I see a bunch of ping/nettest processes hanging around after fcntal-test.sh is done. Clean those up before netns deletion. Signed-off-by: Florian Westphal Acked-by: David Ahern Link: https://lore.kernel.org/r/20211021140247.29691-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 5ab2ed0a8d75ce55ade89e3ff6b75bef7d9fa53f Merge: 477b4e80c57f7 964d32e512670 Author: Linus Torvalds Date: Fri Oct 22 10:39:47 2021 -1000 Merge tag 'fuse-fixes-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: "Syzbot discovered a race in case of reusing the fuse sb (introduced in this cycle). Fix it by doing the s_fs_info initialization at the proper place" * tag 'fuse-fixes-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: clean up error exits in fuse_fill_super() fuse: always initialize sb->s_fs_info fuse: clean up fuse_mount destruction fuse: get rid of fuse_put_super() fuse: check s_root when destroying sb commit 477b4e80c57f787cf8f494ccb9be23a23642b2f2 Merge: 1d4590f5069bf 8017c99680fa6 Author: Linus Torvalds Date: Fri Oct 22 10:31:32 2021 -1000 Merge tag 'hyperv-fixes-signed-20211022' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyper-v fix from Wei Liu: - Fix vmbus ARM64 build (Arnd Bergmann) * tag 'hyperv-fixes-signed-20211022' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: hyperv/vmbus: include linux/bitops.h commit 32f8807a48ae55be0e76880cfe8607a18b5bb0df Merge: 7f678def99d29 9d02831e517aa Author: Jakub Kicinski Date: Fri Oct 22 12:36:47 2021 -0700 Merge branch 'sctp-enhancements-for-the-verification-tag' Xin Long says: ==================== sctp: enhancements for the verification tag This patchset is to address CVE-2021-3772: A flaw was found in the Linux SCTP stack. A blind attacker may be able to kill an existing SCTP association through invalid chunks if the attacker knows the IP-addresses and port numbers being used and the attacker can send packets with spoofed IP addresses. This is caused by the missing VTAG verification for the received chunks and the incorrect vtag for the ABORT used to reply to these invalid chunks. This patchset is to go over all processing functions for the received chunks and do: 1. Make sure sctp_vtag_verify() is called firstly to verify the vtag from the received chunk and discard this chunk if it fails. With some exceptions: a. sctp_sf_do_5_1B_init()/5_2_2_dupinit()/9_2_reshutack(), processing INIT chunk, as sctphdr vtag is always 0 in INIT chunk. b. sctp_sf_do_5_2_4_dupcook(), processing dupicate COOKIE_ECHO chunk, as the vtag verification will be done by sctp_tietags_compare() and then it takes right actions according to the return. c. sctp_sf_shut_8_4_5(), processing SHUTDOWN_ACK chunk for cookie_wait and cookie_echoed state, as RFC demand sending a SHUTDOWN_COMPLETE even if the vtag verification failed. d. sctp_sf_ootb(), called in many types of chunks for closed state or no asoc, as the same reason to c. 2. Always use the vtag from the received INIT chunk to make the response ABORT in sctp_ootb_pkt_new(). 3. Fix the order for some checks and add some missing checks for the received chunk. This patch series has been tested with SCTP TAHI testing to make sure no regression caused on protocol conformance. ==================== Link: https://lore.kernel.org/r/cover.1634730082.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 9d02831e517aa36ee6bdb453a0eb47bd49923fe3 Author: Xin Long Date: Wed Oct 20 07:42:47 2021 -0400 sctp: add vtag check in sctp_sf_ootb sctp_sf_ootb() is called when processing DATA chunk in closed state, and many other places are also using it. The vtag in the chunk's sctphdr should be verified, otherwise, as later in chunk length check, it may send abort with the existent asoc's vtag, which can be exploited by one to cook a malicious chunk to terminate a SCTP asoc. When fails to verify the vtag from the chunk, this patch sets asoc to NULL, so that the abort will be made with the vtag from the received chunk later. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit ef16b1734f0a176277b7bb9c71a6d977a6ef3998 Author: Xin Long Date: Wed Oct 20 07:42:46 2021 -0400 sctp: add vtag check in sctp_sf_do_8_5_1_E_sa sctp_sf_do_8_5_1_E_sa() is called when processing SHUTDOWN_ACK chunk in cookie_wait and cookie_echoed state. The vtag in the chunk's sctphdr should be verified, otherwise, as later in chunk length check, it may send abort with the existent asoc's vtag, which can be exploited by one to cook a malicious chunk to terminate a SCTP asoc. Note that when fails to verify the vtag from SHUTDOWN-ACK chunk, SHUTDOWN COMPLETE message will still be sent back to peer, but with the vtag from SHUTDOWN-ACK chunk, as said in 5) of rfc4960#section-8.4. While at it, also remove the unnecessary chunk length check from sctp_sf_shut_8_4_5(), as it's already done in both places where it calls sctp_sf_shut_8_4_5(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit aa0f697e45286a6b5f0ceca9418acf54b9099d99 Author: Xin Long Date: Wed Oct 20 07:42:45 2021 -0400 sctp: add vtag check in sctp_sf_violation sctp_sf_violation() is called when processing HEARTBEAT_ACK chunk in cookie_wait state, and some other places are also using it. The vtag in the chunk's sctphdr should be verified, otherwise, as later in chunk length check, it may send abort with the existent asoc's vtag, which can be exploited by one to cook a malicious chunk to terminate a SCTP asoc. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit a64b341b8695e1c744dd972b39868371b4f68f83 Author: Xin Long Date: Wed Oct 20 07:42:44 2021 -0400 sctp: fix the processing for COOKIE_ECHO chunk 1. In closed state: in sctp_sf_do_5_1D_ce(): When asoc is NULL, making packet for abort will use chunk's vtag in sctp_ootb_pkt_new(). But when asoc exists, vtag from the chunk should be verified before using peer.i.init_tag to make packet for abort in sctp_ootb_pkt_new(), and just discard it if vtag is not correct. 2. In the other states: in sctp_sf_do_5_2_4_dupcook(): asoc always exists, but duplicate cookie_echo's vtag will be handled by sctp_tietags_compare() and then take actions, so before that we only verify the vtag for the abort sent for invalid chunk length. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit 438b95a7c98f77d51cbf4db021f41b602d750a3f Author: Xin Long Date: Wed Oct 20 07:42:43 2021 -0400 sctp: fix the processing for INIT_ACK chunk Currently INIT_ACK chunk in non-cookie_echoed state is processed in sctp_sf_discard_chunk() to send an abort with the existent asoc's vtag if the chunk length is not valid. But the vtag in the chunk's sctphdr is not verified, which may be exploited by one to cook a malicious chunk to terminal a SCTP asoc. sctp_sf_discard_chunk() also is called in many other places to send an abort, and most of those have this problem. This patch is to fix it by sending abort with the existent asoc's vtag only if the vtag from the chunk's sctphdr is verified in sctp_sf_discard_chunk(). Note on sctp_sf_do_9_1_abort() and sctp_sf_shutdown_pending_abort(), the chunk length has been verified before sctp_sf_discard_chunk(), so replace it with sctp_sf_discard(). On sctp_sf_do_asconf_ack() and sctp_sf_do_asconf(), move the sctp_chunk_length_valid check ahead of sctp_sf_discard_chunk(), then replace it with sctp_sf_discard(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit eae5783908042a762c24e1bd11876edb91d314b1 Author: Xin Long Date: Wed Oct 20 07:42:42 2021 -0400 sctp: fix the processing for INIT chunk This patch fixes the problems below: 1. In non-shutdown_ack_sent states: in sctp_sf_do_5_1B_init() and sctp_sf_do_5_2_2_dupinit(): chunk length check should be done before any checks that may cause to send abort, as making packet for abort will access the init_tag from init_hdr in sctp_ootb_pkt_new(). 2. In shutdown_ack_sent state: in sctp_sf_do_9_2_reshutack(): The same checks as does in sctp_sf_do_5_2_2_dupinit() is needed for sctp_sf_do_9_2_reshutack(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit 4f7019c7eb33967eb87766e0e4602b5576873680 Author: Xin Long Date: Wed Oct 20 07:42:41 2021 -0400 sctp: use init_tag from inithdr for ABORT chunk Currently Linux SCTP uses the verification tag of the existing SCTP asoc when failing to process and sending the packet with the ABORT chunk. This will result in the peer accepting the ABORT chunk and removing the SCTP asoc. One could exploit this to terminate a SCTP asoc. This patch is to fix it by always using the initiate tag of the received INIT chunk for the ABORT chunk to be sent. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit 7f678def99d29c520418607509bb19c7fc96a6db Author: Vasily Averin Date: Fri Oct 22 13:28:37 2021 +0300 skb_expand_head() adjust skb->truesize incorrectly Christoph Paasch reports [1] about incorrect skb->truesize after skb_expand_head() call in ip6_xmit. This may happen because of two reasons: - skb_set_owner_w() for newly cloned skb is called too early, before pskb_expand_head() where truesize is adjusted for (!skb-sk) case. - pskb_expand_head() does not adjust truesize in (skb->sk) case. In this case sk->sk_wmem_alloc should be adjusted too. [1] https://lkml.org/lkml/2021/8/20/1082 Fixes: f1260ff15a71 ("skbuff: introduce skb_expand_head()") Fixes: 2d85a1b31dde ("ipv6: ip6_finish_output2: set sk into newly allocated nskb") Reported-by: Christoph Paasch Signed-off-by: Vasily Averin Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/644330dd-477e-0462-83bf-9f514c41edd1@virtuozzo.com Signed-off-by: Jakub Kicinski commit 8017c99680fa65e1e8d999df1583de476a187830 Author: Arnd Bergmann Date: Mon Oct 18 15:19:08 2021 +0200 hyperv/vmbus: include linux/bitops.h On arm64 randconfig builds, hyperv sometimes fails with this error: In file included from drivers/hv/hv_trace.c:3: In file included from drivers/hv/hyperv_vmbus.h:16: In file included from arch/arm64/include/asm/sync_bitops.h:5: arch/arm64/include/asm/bitops.h:11:2: error: only can be included directly In file included from include/asm-generic/bitops/hweight.h:5: include/asm-generic/bitops/arch_hweight.h:9:9: error: implicit declaration of function '__sw_hweight32' [-Werror,-Wimplicit-function-declaration] include/asm-generic/bitops/atomic.h:17:7: error: implicit declaration of function 'BIT_WORD' [-Werror,-Wimplicit-function-declaration] Include the correct header first. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211018131929.2260087-1-arnd@kernel.org Signed-off-by: Wei Liu commit 1d4590f5069bff7d41d7ed1a7e7674fb9d6d502a Merge: cd82c4a73b671 7a7489005a80a Author: Linus Torvalds Date: Fri Oct 22 09:08:08 2021 -1000 Merge tag 'acpi-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix two regressions, one related to ACPI power resources management and one that broke ACPI tools compilation. Specifics: - Stop turning off unused ACPI power resources in an unknown state to address a regression introduced during the 5.14 cycle (Rafael Wysocki). - Fix an ACPI tools build issue introduced recently when the minimal stdarg.h was added (Miguel Bernal Marin)" * tag 'acpi-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: Do not turn off power resources in unknown state ACPI: tools: fix compilation error commit cd82c4a73b6713984b69c57a2a687203d3e0e34a Merge: 64222515138e4 95e16b4792b04 Author: Linus Torvalds Date: Fri Oct 22 09:02:15 2021 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull more x86 kvm fixes from Paolo Bonzini: - Cache coherency fix for SEV live migration - Fix for instruction emulation with PKU - fixes for rare delaying of interrupt delivery - fix for SEV-ES buffer overflow * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SEV-ES: go over the sev_pio_data buffer in multiple passes if needed KVM: SEV-ES: keep INS functions together KVM: x86: remove unnecessary arguments from complete_emulator_pio_in KVM: x86: split the two parts of emulator_pio_in KVM: SEV-ES: clean up kvm_sev_es_ins/outs KVM: x86: leave vcpu->arch.pio.count alone in emulator_pio_in_out KVM: SEV-ES: rename guest_ins_data to sev_pio_data KVM: SEV: Flush cache on non-coherent systems before RECEIVE_UPDATE_DATA KVM: MMU: Reset mmu->pkru_mask to avoid stale data KVM: nVMX: promptly process interrupts delivered while in guest mode KVM: x86: check for interrupts before deciding whether to exit the fast path commit 7a7489005a80af97ba289dc0579fccd50af4fe8d Merge: bc28368596436 136f282028dae Author: Rafael J. Wysocki Date: Fri Oct 22 20:45:10 2021 +0200 Merge branch 'acpi-tools' Merge a fix for a recent ACPI tools bild regresson. * acpi-tools: ACPI: tools: fix compilation error commit 7fcb1c950e98e47918e86a5aa7b8fcc283ec6629 Merge: 64222515138e4 a2083eeb119fb Author: Jakub Kicinski Date: Fri Oct 22 11:12:45 2021 -0700 Merge tag 'mac80211-for-net-2021-10-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Two small fixes: * RCU misuse in scan processing in cfg80211 * missing size check for HE data in mac80211 mesh * tag 'mac80211-for-net-2021-10-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211: cfg80211: scan: fix RCU in cfg80211_add_nontrans_list() mac80211: mesh: fix HE operation element length check ==================== Link: https://lore.kernel.org/r/20211021154351.134297-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 95e16b4792b0429f1933872f743410f00e590c55 Author: Paolo Bonzini Date: Tue Oct 12 11:33:03 2021 -0400 KVM: SEV-ES: go over the sev_pio_data buffer in multiple passes if needed The PIO scratch buffer is larger than a single page, and therefore it is not possible to copy it in a single step to vcpu->arch/pio_data. Bound each call to emulator_pio_in/out to a single page; keep track of how many I/O operations are left in vcpu->arch.sev_pio_count, so that the operation can be restarted in the complete_userspace_io callback. For OUT, this means that the previous kvm_sev_es_outs implementation becomes an iterator of the loop, and we can consume the sev_pio_data buffer before leaving to userspace. For IN, instead, consuming the buffer and decreasing sev_pio_count is always done in the complete_userspace_io callback, because that is when the memcpy is done into sev_pio_data. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reported-by: Felix Wilhelm Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 4fa4b38dae6fc6a3695695add8c18fa8b6a05a1a Author: Paolo Bonzini Date: Tue Oct 12 11:25:45 2021 -0400 KVM: SEV-ES: keep INS functions together Make the diff a little nicer when we actually get to fixing the bug. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 6b5efc930bbc8c97e4a1fe2ccb9a6f286365a56d Author: Paolo Bonzini Date: Tue Oct 12 12:35:20 2021 -0400 KVM: x86: remove unnecessary arguments from complete_emulator_pio_in complete_emulator_pio_in can expect that vcpu->arch.pio has been filled in, and therefore does not need the size and count arguments. This makes things nicer when the function is called directly from a complete_userspace_io callback. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 3b27de27183911d461afedf50c6fa30c59740c07 Author: Paolo Bonzini Date: Wed Oct 13 12:32:02 2021 -0400 KVM: x86: split the two parts of emulator_pio_in emulator_pio_in handles both the case where the data is pending in vcpu->arch.pio.count, and the case where I/O has to be done via either an in-kernel device or a userspace exit. For SEV-ES we would like to split these, to identify clearly the moment at which the sev_pio_data is consumed. To this end, create two different functions: __emulator_pio_in fills in vcpu->arch.pio.count, while complete_emulator_pio_in clears it and releases vcpu->arch.pio.data. Because this patch has to be backported, things are left a bit messy. kernel_pio() operates on vcpu->arch.pio, which leads to emulator_pio_in() having with two calls to complete_emulator_pio_in(). It will be fixed in the next release. While at it, remove the unused void* val argument of emulator_pio_in_out. The function currently hardcodes vcpu->arch.pio_data as the source/destination buffer, which sucks but will be fixed after the more severe SEV-ES buffer overflow. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Signed-off-by: Paolo Bonzini commit ea724ea420aac58b41bc822d1aed6940b136b78d Author: Paolo Bonzini Date: Tue Oct 12 10:51:55 2021 -0400 KVM: SEV-ES: clean up kvm_sev_es_ins/outs A few very small cleanups to the functions, smushed together because the patch is already very small like this: - inline emulator_pio_in_emulated and emulator_pio_out_emulated, since we already have the vCPU - remove the data argument and pull setting vcpu->arch.sev_pio_data into the caller - remove unnecessary clearing of vcpu->arch.pio.count when emulation is done by the kernel (and therefore vcpu->arch.pio.count is already clear on exit from emulator_pio_in and emulator_pio_out). No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 0d33b1baeb6ca7165d5ed4fdd1a8f969985e35b9 Author: Paolo Bonzini Date: Wed Oct 13 12:29:42 2021 -0400 KVM: x86: leave vcpu->arch.pio.count alone in emulator_pio_in_out Currently emulator_pio_in clears vcpu->arch.pio.count twice if emulator_pio_in_out performs kernel PIO. Move the clear into emulator_pio_out where it is actually necessary. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit b5998402e3de429b5e5f9bdea08ddf77c5fd661e Author: Paolo Bonzini Date: Tue Oct 12 10:22:34 2021 -0400 KVM: SEV-ES: rename guest_ins_data to sev_pio_data We will be using this field for OUTS emulation as well, in case the data that is pushed via OUTS spans more than one page. In that case, there will be a need to save the data pointer across exits to userspace. So, change the name to something that refers to any kind of PIO. Also spell out what it is used for, namely SEV-ES. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit f8690a4b5a1b64f74ae5c4f7c4ea880d8a8e1a0d Author: Tianjia Zhang Date: Fri Oct 15 11:47:33 2021 +0800 crypto: x86/sm4 - Fix invalid section entry size This fixes the following warning: vmlinux.o: warning: objtool: elf_update: invalid section entry size The size of the rodata section is 164 bytes, directly using the entry_size of 164 bytes will cause errors in some versions of the gcc compiler, while using 16 bytes directly will cause errors in the clang compiler. This patch correct it by filling the size of rodata to a 16-byte boundary. Fixes: a7ee22ee1445 ("crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation") Fixes: 5b2efa2bb865 ("crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation") Reported-by: Peter Zijlstra Reported-by: Abaci Robot Signed-off-by: Tianjia Zhang Tested-by: Heyuan Shi Signed-off-by: Herbert Xu commit 0943aacf5ae10471b68a702c022b42c89e91ba9e Author: Xie Yongji Date: Wed Sep 29 16:30:50 2021 +0800 vduse: Fix race condition between resetting and irq injecting The interrupt might be triggered after a reset since there is no synchronization between resetting and irq injecting. And it might break something if the interrupt is delayed until a new round of device initialization. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210929083050.88-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 1394103fd72ce9c67d20f882a93d59403c8da057 Author: Xie Yongji Date: Thu Sep 23 15:57:22 2021 +0800 vduse: Disallow injecting interrupt before DRIVER_OK is set The interrupt callback should not be triggered before DRIVER_OK is set. Otherwise, it might break the virtio device driver. So let's add a check to avoid the unexpected behavior. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210923075722.98-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit ee71fb6c4d99c51f2d82a32c503c872b7e40e7f7 Author: Daniel Vetter Date: Thu Oct 21 22:20:48 2021 +0200 drm/i915/selftests: Properly reset mock object propers for each test I forgot to do this properly in commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a Author: Daniel Vetter Date: Fri Jul 23 10:34:55 2021 +0200 drm/plane: remove drm_helper_get_plane_damage_clips intel-gfx CI didn't spot this because we run each selftest in each own invocations, which means reloading i915.ko. But if you just run all the selftests in one go at boot-up, then it falls apart and eventually we cross over the hardcoded limited of how many properties can be attached to a single object. Fix this by resetting the property count. Nothing else to clean up since it's all static storage anyway. Reported-and-tested-by: Sebastian Andrzej Siewior Cc: Sebastian Andrzej Siewior Fixes: 6f11f37459d8 ("drm/plane: remove drm_helper_get_plane_damage_clips") Cc: José Roberto de Souza Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Cc: Hans de Goede Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211021202048.2638668-1-daniel.vetter@ffwll.ch commit 64222515138e43da1fcf288f0289ef1020427b87 Merge: 658aafc8139c2 595cb5e0b832a Author: Linus Torvalds Date: Thu Oct 21 19:06:08 2021 -1000 Merge tag 'drm-fixes-2021-10-22' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Nothing too crazy at the end of the cycle, the kmb modesetting fixes are probably a bit large but it's not a major driver, and its fixing monitor doesn't turn on type problems. Otherwise it's just a few minor patches, one ast regression revert, an msm power stability fix. ast: - fix regression with connector detect msm: - fix power stability issue msxfb: - fix crash on unload panel: - sync fix kmb: - modesetting fixes" * tag 'drm-fixes-2021-10-22' of git://anongit.freedesktop.org/drm/drm: Revert "drm/ast: Add detect function support" drm/kmb: Enable ADV bridge after modeset drm/kmb: Corrected typo in handle_lcd_irq drm/kmb: Disable change of plane parameters drm/kmb: Remove clearing DPHY regs drm/kmb: Limit supported mode to 1080p drm/kmb: Work around for higher system clock drm/panel: ilitek-ili9881c: Fix sync for Feixin K101-IM2BYL02 panel drm: mxsfb: Fix NULL pointer dereference crash on unload drm/msm/devfreq: Restrict idle clamping to a618 for now commit 658aafc8139c23a6a23f6f4d9a0c4c95476838d4 Author: Mike Rapoport Date: Thu Oct 21 10:09:29 2021 +0300 memblock: exclude MEMBLOCK_NOMAP regions from kmemleak Vladimir Zapolskiy reports: Commit a7259df76702 ("memblock: make memblock_find_in_range method private") invokes a kernel panic while running kmemleak on OF platforms with nomaped regions: Unable to handle kernel paging request at virtual address fff000021e00000 [...] scan_block+0x64/0x170 scan_gray_list+0xe8/0x17c kmemleak_scan+0x270/0x514 kmemleak_write+0x34c/0x4ac The memory allocated from memblock is registered with kmemleak, but if it is marked MEMBLOCK_NOMAP it won't have linear map entries so an attempt to scan such areas will fault. Ideally, memblock_mark_nomap() would inform kmemleak to ignore MEMBLOCK_NOMAP memory, but it can be called before kmemleak interfaces operating on physical addresses can use __va() conversion. Make sure that functions that mark allocated memory as MEMBLOCK_NOMAP take care of informing kmemleak to ignore such memory. Link: https://lore.kernel.org/all/8ade5174-b143-d621-8c8e-dc6a1898c6fb@linaro.org Link: https://lore.kernel.org/all/c30ff0a2-d196-c50d-22f0-bd50696b1205@quicinc.com Fixes: a7259df76702 ("memblock: make memblock_find_in_range method private") Reported-by: Vladimir Zapolskiy Signed-off-by: Mike Rapoport Reviewed-by: Catalin Marinas Tested-by: Vladimir Zapolskiy Tested-by: Qian Cai Signed-off-by: Linus Torvalds commit 6c9a54551977ddf2d6e22c21354b4fb88946f96e Author: Mike Rapoport Date: Thu Oct 21 10:09:28 2021 +0300 Revert "memblock: exclude NOMAP regions from kmemleak" Commit 6e44bd6d34d6 ("memblock: exclude NOMAP regions from kmemleak") breaks boot on EFI systems with kmemleak and VM_DEBUG enabled: efi: Processing EFI memory map: efi: 0x000090000000-0x000091ffffff [Conventional| | | | | | | | | | |WB|WT|WC|UC] efi: 0x000092000000-0x0000928fffff [Runtime Data|RUN| | | | | | | | | |WB|WT|WC|UC] ------------[ cut here ]------------ kernel BUG at mm/kmemleak.c:1140! Internal error: Oops - BUG: 0 [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.0-rc6-next-20211019+ #104 pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : kmemleak_free_part_phys+0x64/0x8c lr : kmemleak_free_part_phys+0x38/0x8c sp : ffff800011eafbc0 x29: ffff800011eafbc0 x28: 1fffff7fffb41c0d x27: fffffbfffda0e068 x26: 0000000092000000 x25: 1ffff000023d5f94 x24: ffff800011ed84d0 x23: ffff800011ed84c0 x22: ffff800011ed83d8 x21: 0000000000900000 x20: ffff800011782000 x19: 0000000092000000 x18: ffff800011ee0730 x17: 0000000000000000 x16: 0000000000000000 x15: 1ffff0000233252c x14: ffff800019a905a0 x13: 0000000000000001 x12: ffff7000023d5ed7 x11: 1ffff000023d5ed6 x10: ffff7000023d5ed6 x9 : dfff800000000000 x8 : ffff800011eaf6b7 x7 : 0000000000000001 x6 : ffff800011eaf6b0 x5 : 00008ffffdc2a12a x4 : ffff7000023d5ed7 x3 : 1ffff000023dbf99 x2 : 1ffff000022f0463 x1 : 0000000000000000 x0 : ffffffffffffffff Call trace: kmemleak_free_part_phys+0x64/0x8c memblock_mark_nomap+0x5c/0x78 reserve_regions+0x294/0x33c efi_init+0x2d0/0x490 setup_arch+0x80/0x138 start_kernel+0xa0/0x3ec __primary_switched+0xc0/0xc8 Code: 34000041 97d526e7 f9418e80 36000040 (d4210000) random: get_random_bytes called from print_oops_end_marker+0x34/0x80 with crng_init=0 ---[ end trace 0000000000000000 ]--- The crash happens because kmemleak_free_part_phys() tries to use __va() before memstart_addr is initialized and this triggers a VM_BUG_ON() in arch/arm64/include/asm/memory.h: Revert 6e44bd6d34d6 ("memblock: exclude NOMAP regions from kmemleak"), the issue it is fixing will be fixed differently. Reported-by: Qian Cai Signed-off-by: Mike Rapoport Acked-by: Catalin Marinas Signed-off-by: Linus Torvalds commit 9d235ac01f54e8f8c1d967b25ac29e4313a41c5c Merge: 6c2c712767ee1 5ebcbe342b1c1 Author: Linus Torvalds Date: Thu Oct 21 17:27:17 2021 -1000 Merge branch 'ucount-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ucounts fixes from Eric Biederman: "There has been one very hard to track down bug in the ucount code that we have been tracking since roughly v5.14 was released. Alex managed to find a reliable reproducer a few days ago and then I was able to instrument the code and figure out what the issue was. It turns out the sigqueue_alloc single atomic operation optimization did not play nicely with ucounts multiple level rlimits. It turned out that either sigqueue_alloc or sigqueue_free could be operating on multiple levels and trigger the conditions for the optimization on more than one level at the same time. To deal with that situation I have introduced inc_rlimit_get_ucounts and dec_rlimit_put_ucounts that just focuses on the optimization and the rlimit and ucount changes. While looking into the big bug I found I couple of other little issues so I am including those fixes here as well. When I have time I would very much like to dig into process ownership of the shared signal queue and see if we could pick a single owner for the entire queue so that all of the rlimits can count to that owner. That should entirely remove the need to call get_ucounts and put_ucounts in sigqueue_alloc and sigqueue_free. It is difficult because Linux unlike POSIX supports setuid that works on a single thread" * 'ucount-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ucounts: Move get_ucounts from cred_alloc_blank to key_change_session_keyring ucounts: Proper error handling in set_cred_ucounts ucounts: Pair inc_rlimit_ucounts with dec_rlimit_ucoutns in commit_creds ucounts: Fix signal ucount refcounting commit 6c2c712767ee1d74b2234c9caaf1920808333be6 Merge: 0a3221b65874b 397430b50a363 Author: Linus Torvalds Date: Thu Oct 21 15:36:50 2021 -1000 Merge tag 'net-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, and can. We'll have one more fix for a socket accounting regression, it's still getting polished. Otherwise things look fine. Current release - regressions: - revert "vrf: reset skb conntrack connection on VRF rcv", there are valid uses for previous behavior - can: m_can: fix iomap_read_fifo() and iomap_write_fifo() Current release - new code bugs: - mlx5: e-switch, return correct error code on group creation failure Previous releases - regressions: - sctp: fix transport encap_port update in sctp_vtag_verify - stmmac: fix E2E delay mechanism (in PTP timestamping) Previous releases - always broken: - netfilter: ip6t_rt: fix out-of-bounds read of ipv6_rt_hdr - netfilter: xt_IDLETIMER: fix out-of-bound read caused by lack of init - netfilter: ipvs: make global sysctl read-only in non-init netns - tcp: md5: fix selection between vrf and non-vrf keys - ipv6: count rx stats on the orig netdev when forwarding - bridge: mcast: use multicast_membership_interval for IGMPv3 - can: - j1939: fix UAF for rx_kref of j1939_priv abort sessions on receiving bad messages - isotp: fix TX buffer concurrent access in isotp_sendmsg() fix return error on FC timeout on TX path - ice: fix re-init of RDMA Tx queues and crash if RDMA was not inited - hns3: schedule the polling again when allocation fails, prevent stalls - drivers: add missing of_node_put() when aborting for_each_available_child_of_node() - ptp: fix possible memory leak and UAF in ptp_clock_register() - e1000e: fix packet loss in burst mode on Tiger Lake and later - mlx5e: ipsec: fix more checksum offload issues" * tag 'net-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (75 commits) usbnet: sanity check for maxpacket net: enetc: make sure all traffic classes can send large frames net: enetc: fix ethtool counter name for PM0_TERR ptp: free 'vclock_index' in ptp_clock_release() sfc: Don't use netif_info before net_device setup sfc: Export fibre-specific supported link modes net/mlx5e: IPsec: Fix work queue entry ethernet segment checksum flags net/mlx5e: IPsec: Fix a misuse of the software parser's fields net/mlx5e: Fix vlan data lost during suspend flow net/mlx5: E-switch, Return correct error code on group creation failure net/mlx5: Lag, change multipath and bonding to be mutually exclusive ice: Add missing E810 device ids igc: Update I226_K device ID e1000e: Fix packet loss on Tiger Lake and later e1000e: Separate TGP board type from SPT ptp: Fix possible memory leak in ptp_clock_register() net: stmmac: Fix E2E delay mechanism nfc: st95hf: Make spi remove() callback return zero net: hns3: disable sriov before unload hclge layer net: hns3: fix vf reset workqueue cannot exit ... commit 0a3221b65874b5089f1742de59ef89f032b9f2ea Merge: 2f111a6fd5b52 787252a10d942 Author: Linus Torvalds Date: Thu Oct 21 15:30:09 2021 -1000 Merge tag 'powerpc-5.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix a bug exposed by a previous fix, where running guests with certain SMT topologies could crash the host on Power8. - Fix atomic sleep warnings when re-onlining CPUs, when PREEMPT is enabled. Thanks to Nathan Lynch, Srikar Dronamraju, and Valentin Schneider. * tag 'powerpc-5.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/smp: do not decrement idle task preempt count in CPU offline powerpc/idle: Don't corrupt back chain when going idle commit 595cb5e0b832a3e100cbbdefef797b0c27bf725a Author: Kim Phillips Date: Thu Oct 21 10:30:06 2021 -0500 Revert "drm/ast: Add detect function support" This reverts commit aae74ff9caa8de9a45ae2e46068c417817392a26, since it prevents my AMD Milan system from booting, with: [ 27.189558] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 27.197506] #PF: supervisor write access in kernel mode [ 27.203333] #PF: error_code(0x0002) - not-present page [ 27.209064] PGD 0 P4D 0 [ 27.211885] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 27.216744] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.0-rc6+ #15 [ 27.223928] Hardware name: AMD Corporation ETHANOL_X/ETHANOL_X, BIOS RXM1006B 08/20/2021 [ 27.232955] RIP: 0010:run_timer_softirq+0x38b/0x4a0 [ 27.238397] Code: 4c 89 f7 e8 37 27 ac 00 49 c7 46 08 00 00 00 00 49 8b 04 24 48 85 c0 74 71 4d 8b 3c 24 4d 89 7e 08 66 90 49 8b 07 49 8b 57 08 <48> 89 02 48 85 c0 74 04 48 89 50 08 49 8b 77 18 41 f6 47 22 20 4c [ 27.259350] RSP: 0018:ffffc42d00003ee8 EFLAGS: 00010086 [ 27.265176] RAX: dead000000000122 RBX: 0000000000000000 RCX: 0000000000000101 [ 27.273134] RDX: 0000000000000000 RSI: 0000000000000087 RDI: 0000000000000001 [ 27.281084] RBP: ffffc42d00003f70 R08: 0000000000000000 R09: 00000000000003eb [ 27.289043] R10: ffffa0860cb300d0 R11: ffffa0c44de290b0 R12: ffffc42d00003ef8 [ 27.297002] R13: 00000000fffef200 R14: ffffa0c44de18dc0 R15: ffffa0867a882350 [ 27.304961] FS: 0000000000000000(0000) GS:ffffa0c44de00000(0000) knlGS:0000000000000000 [ 27.313988] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 27.320396] CR2: 0000000000000000 CR3: 000000014569c001 CR4: 0000000000770ef0 [ 27.328346] PKRU: 55555554 [ 27.331359] Call Trace: [ 27.334073] [ 27.336314] ? __queue_work+0x420/0x420 [ 27.340589] ? lapic_next_event+0x21/0x30 [ 27.345060] ? clockevents_program_event+0x8f/0xe0 [ 27.350402] __do_softirq+0xfb/0x2db [ 27.354388] irq_exit_rcu+0x98/0xd0 [ 27.358275] sysvec_apic_timer_interrupt+0xac/0xd0 [ 27.363620] [ 27.365955] asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 27.371685] RIP: 0010:cpuidle_enter_state+0xcc/0x390 [ 27.377292] Code: 3d 01 79 0a 50 e8 44 ed 77 ff 49 89 c6 0f 1f 44 00 00 31 ff e8 f5 f8 77 ff 80 7d d7 00 0f 85 e6 01 00 00 fb 66 0f 1f 44 00 00 <45> 85 ff 0f 88 17 01 00 00 49 63 c7 4c 2b 75 c8 48 8d 14 40 48 8d [ 27.398243] RSP: 0018:ffffffffb0e03dc8 EFLAGS: 00000246 [ 27.404069] RAX: ffffa0c44de00000 RBX: 0000000000000001 RCX: 000000000000001f [ 27.412028] RDX: 0000000000000000 RSI: ffffffffb0bafc1f RDI: ffffffffb0bbdb81 [ 27.419986] RBP: ffffffffb0e03e00 R08: 00000006549f8f3f R09: ffffffffb1065200 [ 27.427935] R10: ffffa0c44de27ae4 R11: ffffa0c44de27ac4 R12: ffffa0c5634cb000 [ 27.435894] R13: ffffffffb1065200 R14: 00000006549f8f3f R15: 0000000000000001 [ 27.443854] ? cpuidle_enter_state+0xbb/0x390 [ 27.448712] cpuidle_enter+0x2e/0x40 [ 27.452695] call_cpuidle+0x23/0x40 [ 27.456584] do_idle+0x1f0/0x270 [ 27.460181] cpu_startup_entry+0x20/0x30 [ 27.464553] rest_init+0xd4/0xe0 [ 27.468149] arch_call_rest_init+0xe/0x1b [ 27.472619] start_kernel+0x6bc/0x6e2 [ 27.476764] x86_64_start_reservations+0x24/0x26 [ 27.481912] x86_64_start_kernel+0x75/0x79 [ 27.486477] secondary_startup_64_no_verify+0xb0/0xbb [ 27.492111] Modules linked in: kvm_amd(+) kvm ipmi_si(+) ipmi_devintf rapl wmi_bmof ipmi_msghandler input_leds ccp k10temp mac_hid sch_fq_codel 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 ast i2c_algo_bit drm_vram_helper drm_ttm_helper ttm drm_kms_helper crct10dif_pclmul crc32_pclmul ghash_clmulni_intel syscopyarea aesni_intel sysfillrect crypto_simd sysimgblt fb_sys_fops cryptd hid_generic cec nvme ahci usbhid drm e1000e nvme_core hid libahci i2c_piix4 wmi [ 27.551789] CR2: 0000000000000000 [ 27.555482] ---[ end trace 897987dfe93dccc6 ]--- [ 27.560630] RIP: 0010:run_timer_softirq+0x38b/0x4a0 [ 27.566069] Code: 4c 89 f7 e8 37 27 ac 00 49 c7 46 08 00 00 00 00 49 8b 04 24 48 85 c0 74 71 4d 8b 3c 24 4d 89 7e 08 66 90 49 8b 07 49 8b 57 08 <48> 89 02 48 85 c0 74 04 48 89 50 08 49 8b 77 18 41 f6 47 22 20 4c [ 27.587021] RSP: 0018:ffffc42d00003ee8 EFLAGS: 00010086 [ 27.592848] RAX: dead000000000122 RBX: 0000000000000000 RCX: 0000000000000101 [ 27.600808] RDX: 0000000000000000 RSI: 0000000000000087 RDI: 0000000000000001 [ 27.608765] RBP: ffffc42d00003f70 R08: 0000000000000000 R09: 00000000000003eb [ 27.616716] R10: ffffa0860cb300d0 R11: ffffa0c44de290b0 R12: ffffc42d00003ef8 [ 27.624673] R13: 00000000fffef200 R14: ffffa0c44de18dc0 R15: ffffa0867a882350 [ 27.632624] FS: 0000000000000000(0000) GS:ffffa0c44de00000(0000) knlGS:0000000000000000 [ 27.641650] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 27.648159] CR2: 0000000000000000 CR3: 000000014569c001 CR4: 0000000000770ef0 [ 27.656119] PKRU: 55555554 [ 27.659133] Kernel panic - not syncing: Fatal exception in interrupt [ 29.030411] Shutting down cpus with NMI [ 29.034699] Kernel Offset: 0x2e600000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 29.046790] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Since unreliable, found by bisecting for KASAN's use-after-free in enqueue_timer+0x4f/0x1e0, where the timer callback is called. Reported-by: Kim Phillips Signed-off-by: Kim Phillips Fixes: aae74ff9caa8 ("drm/ast: Add detect function support") Link: https://lore.kernel.org/lkml/0f7871be-9ca6-5ae4-3a40-5db9a8fb2365@amd.com/ Cc: Ainux Cc: Thomas Zimmermann Cc: David Airlie Cc: David Airlie Cc: Daniel Vetter Cc: sterlingteng@gmail.com Cc: chenhuacai@kernel.org Cc: Chuck Lever III Cc: Borislav Petkov Cc: Borislav Petkov Cc: Jon Grimm Cc: dri-devel Cc: linux-kernel Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20211021153006.92983-1-kim.phillips@amd.com commit 7e1c5440f4f9b4db5cb2482c347fa3d74bf50440 Merge: 730b64d827c30 74056092ff415 Author: Dave Airlie Date: Fri Oct 22 05:34:54 2021 +1000 Merge tag 'drm-misc-fixes-2021-10-21-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.15-rc7: - Rebased, to remove vc4 patches. - Fix mxsfb crash on unload. - Use correct sync parameters for Feixin K101-IM2BYL02. - Assorted kmb modeset/atomic fixes. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/e66eaf89-b9b9-41f5-d0d2-dad7e59fabb5@linux.intel.com commit 730b64d827c309f43bc6a91134e3551f25599cbc Merge: 519d81956ee27 5ca6779d2f18b Author: Dave Airlie Date: Fri Oct 22 05:22:10 2021 +1000 Merge tag 'drm-msm-fixes-2021-10-18' of https://gitlab.freedesktop.org/drm/msm into drm-fixes One more fix for v5.15, to work around a power stability issue on a630 (and possibly others) Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGs1WPLthmd=ToDcEHm=u-7O38RAVJ2XwRoS8xPmC520vg@mail.gmail.com commit def0c3697287f6e85d5ac68b21302966c95474f9 Author: Bryant Mairs Date: Tue Oct 19 09:24:33 2021 -0500 drm: panel-orientation-quirks: Add quirk for Aya Neo 2021 Fixes screen orientation for the Aya Neo 2021 handheld gaming console. Signed-off-by: Bryant Mairs Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211019142433.4295-1-bryant@mai.rs commit b22fa62a35d7f2029d757a518d78041822b7c7c1 Author: Pavel Begunkov Date: Thu Oct 21 13:20:29 2021 +0100 io_uring: apply worker limits to previous users Another change to the API io-wq worker limitation API added in 5.15, apply the limit to all prior users that already registered a tctx. It may be confusing as it's now, in particular the change covers the following 2 cases: TASK1 | TASK2 _________________________________________________ ring = create() | | limit_iowq_workers() *not limited* | TASK1 | TASK2 _________________________________________________ ring = create() | | issue_requests() limit_iowq_workers() | | *not limited* A note on locking, it's safe to traverse ->tctx_list as we hold ->uring_lock, but do that after dropping sqd->lock to avoid possible problems. It's also safe to access tctx->io_wq there because tasks kill it only after removing themselves from tctx_list, see io_uring_cancel_generic() -> io_uring_clean_tctx() Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d6e09ecc3545e4dc56e43c906ee3d71b7ae21bed.1634818641.git.asml.silence@gmail.com Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit c8c340a9b4149fe5caa433f3b62463a1c8e07a46 Author: Masahiro Kozuka Date: Tue Sep 14 14:09:51 2021 -0700 KVM: SEV: Flush cache on non-coherent systems before RECEIVE_UPDATE_DATA Flush the destination page before invoking RECEIVE_UPDATE_DATA, as the PSP encrypts the data with the guest's key when writing to guest memory. If the target memory was not previously encrypted, the cache may contain dirty, unecrypted data that will persist on non-coherent systems. Fixes: 15fb7de1a7f5 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command") Cc: stable@vger.kernel.org Cc: Peter Gonda Cc: Marc Orr Cc: Tom Lendacky Cc: Brijesh Singh Signed-off-by: Masahiro Kozuka [sean: converted bug report to changelog] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini Message-Id: <20210914210951.2994260-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a3ca5281bb771d8103ea16f0a6a8a5df9a7fb4f3 Author: Chenyi Qiang Date: Thu Oct 21 15:10:22 2021 +0800 KVM: MMU: Reset mmu->pkru_mask to avoid stale data When updating mmu->pkru_mask, the value can only be added but it isn't reset in advance. This will make mmu->pkru_mask keep the stale data. Fix this issue. Fixes: 2d344105f57c ("KVM, pkeys: introduce pkru_mask to cache conditions") Signed-off-by: Chenyi Qiang Message-Id: <20211021071022.1140-1-chenyi.qiang@intel.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 397430b50a363d8b7bdda00522123f82df6adc5e Author: Oliver Neukum Date: Thu Oct 21 14:29:44 2021 +0200 usbnet: sanity check for maxpacket maxpacket of 0 makes no sense and oopses as we need to divide by it. Give up. V2: fixed typo in log and stylistic issues Signed-off-by: Oliver Neukum Reported-by: syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20211021122944.21816-1-oneukum@suse.com Signed-off-by: Jakub Kicinski commit e378f4967c8edd64c680f2e279cb646ee06b6f2d Author: Vladimir Oltean Date: Wed Oct 20 20:33:40 2021 +0300 net: enetc: make sure all traffic classes can send large frames The enetc driver does not implement .ndo_change_mtu, instead it configures the MAC register field PTC{Traffic Class}MSDUR[MAXSDU] statically to a large value during probe time. The driver used to configure only the max SDU for traffic class 0, and that was fine while the driver could only use traffic class 0. But with the introduction of mqprio, sending a large frame into any other TC than 0 is broken. This patch fixes that by replicating per traffic class the static configuration done in enetc_configure_port_mac(). Fixes: cbe9e835946f ("enetc: Enable TC offloading with mqprio") Reported-by: Richie Pearn Signed-off-by: Vladimir Oltean Reviewed-by: Link: https://lore.kernel.org/r/20211020173340.1089992-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit fb8dc5fc8cbdfd62ecd16493848aee2f42ed84d9 Author: Vladimir Oltean Date: Wed Oct 20 19:52:06 2021 +0300 net: enetc: fix ethtool counter name for PM0_TERR There are two counters named "MAC tx frames", one of them is actually incorrect. The correct name for that counter should be "MAC tx error frames", which is symmetric to the existing "MAC rx error frames". Fixes: 16eb4c85c964 ("enetc: Add ethtool statistics") Signed-off-by: Vladimir Oltean Reviewed-by: Link: https://lore.kernel.org/r/20211020165206.1069889-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 0db55f9a1bafbe3dac750ea669de9134922389b5 Author: Christian König Date: Wed Oct 20 19:19:46 2021 +0200 drm/ttm: fix memleak in ttm_transfered_destroy We need to cleanup the fences for ghost objects as well. Signed-off-by: Christian König Reported-by: Erhard F. Tested-by: Erhard F. Reviewed-by: Huang Rui Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214029 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214447 CC: Link: https://patchwork.freedesktop.org/patch/msgid/20211020173211.2247-1-christian.koenig@amd.com commit 0a30896fc5025e71c350449760b240fba5581b42 Author: Thomas Gleixner Date: Wed Oct 20 23:08:16 2021 +0200 MAINTAINERS: Add Dave Hansen to the x86 maintainer team Dave is already listed as x86/mm maintainer, has a profund knowledge of the x86 architecture in general and a good taste in terms of kernel programming in general. Add him as a full x86 maintainer with all rights and duties. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Acked-by: Borislav Petkov Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/87zgr3flq7.ffs@tglx commit b6b19a71c8bbde2abaa99ba29e6c76ddc84984f8 Author: Yang Yingliang Date: Thu Oct 21 17:13:53 2021 +0800 ptp: free 'vclock_index' in ptp_clock_release() 'vclock_index' is accessed from sysfs, it shouled be freed in release function, so move it from ptp_clock_unregister() to ptp_clock_release(). Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit bf6abf345dfa77786aca554bc58c64bd428ecb1d Author: Erik Ekman Date: Wed Oct 20 00:40:16 2021 +0200 sfc: Don't use netif_info before net_device setup Use pci_info instead to avoid unnamed/uninitialized noise: [197088.688729] sfc 0000:01:00.0: Solarflare NIC detected [197088.690333] sfc 0000:01:00.0: Part Number : SFN5122F [197088.729061] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no SR-IOV VFs probed [197088.729071] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no PTP support Inspired by fa44821a4ddd ("sfc: don't use netif_info et al before net_device is registered") from Heiner Kallweit. Signed-off-by: Erik Ekman Acked-by: Martin Habets Signed-off-by: David S. Miller commit c62041c5baa9ded3bc6fd38d3f724de70683b489 Author: Erik Ekman Date: Tue Oct 19 23:13:32 2021 +0200 sfc: Export fibre-specific supported link modes The 1/10GbaseT modes were set up for cards with SFP+ cages in 3497ed8c852a5 ("sfc: report supported link speeds on SFP connections"). 10GbaseT was likely used since no 10G fibre mode existed. The missing fibre modes for 1/10G were added to ethtool.h in 5711a9822144 ("net: ethtool: add support for 1000BaseX and missing 10G link modes") shortly thereafter. The user guide available at https://support-nic.xilinx.com/wp/drivers lists support for the following cable and transceiver types in section 2.9: - QSFP28 100G Direct Attach Cables - QSFP28 100G SR Optical Transceivers (with SR4 modules listed) - SFP28 25G Direct Attach Cables - SFP28 25G SR Optical Transceivers - QSFP+ 40G Direct Attach Cables - QSFP+ 40G Active Optical Cables - QSFP+ 40G SR4 Optical Transceivers - QSFP+ to SFP+ Breakout Direct Attach Cables - QSFP+ to SFP+ Breakout Active Optical Cables - SFP+ 10G Direct Attach Cables - SFP+ 10G SR Optical Transceivers - SFP+ 10G LR Optical Transceivers - SFP 1000BASE‐T Transceivers - 1G Optical Transceivers (From user guide issue 28. Issue 16 which also includes older cards like SFN5xxx/SFN6xxx has matching lists for 1/10/40G transceiver types.) Regarding SFP+ 10GBASE‐T transceivers the latest guide says: "Solarflare adapters do not support 10GBASE‐T transceiver modules." Tested using SFN5122F-R7 (with 2 SFP+ ports). Supported link modes do not change depending on module used (tested with 1000BASE-T, 1000BASE-BX10, 10GBASE-LR). Before: $ ethtool ext Settings for ext: Supported ports: [ FIBRE ] Supported link modes: 1000baseT/Full 10000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Link partner advertised link modes: Not reported Link partner advertised pause frame use: No Link partner advertised auto-negotiation: No Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Auto-negotiation: off Port: FIBRE PHYAD: 255 Transceiver: internal Current message level: 0x000020f7 (8439) drv probe link ifdown ifup rx_err tx_err hw Link detected: yes After: $ ethtool ext Settings for ext: Supported ports: [ FIBRE ] Supported link modes: 1000baseT/Full 1000baseX/Full 10000baseCR/Full 10000baseSR/Full 10000baseLR/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Link partner advertised link modes: Not reported Link partner advertised pause frame use: No Link partner advertised auto-negotiation: No Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Auto-negotiation: off Port: FIBRE PHYAD: 255 Transceiver: internal Supports Wake-on: g Wake-on: d Current message level: 0x000020f7 (8439) drv probe link ifdown ifup rx_err tx_err hw Link detected: yes Signed-off-by: Erik Ekman Acked-by: Martin Habets Signed-off-by: David S. Miller commit 1439caa1d989ef845765b755aa8fde77ab49ab6f Merge: e0bfcf9c77d9b d9aaaf223297f Author: David S. Miller Date: Thu Oct 21 12:32:41 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net The following patchset contains Netfilter fixes for net: 1) Crash due to missing initialization of timer data in xt_IDLETIMER, from Juhee Kang. 2) NF_CONNTRACK_SECMARK should be bool in Kconfig, from Vegard Nossum. 3) Skip netdev events on netns removal, from Florian Westphal. 4) Add testcase to show port shadowing via UDP, also from Florian. 5) Remove pr_debug() code in ip6t_rt, this fixes a crash due to unsafe access to non-linear skbuff, from Xin Long. 6) Make net/ipv4/vs/debug_level read-only from non-init netns, from Antoine Tenart. 7) Remove bogus invocation to bash in selftests/netfilter/nft_flowtable.sh also from Florian. ==================== Signed-off-by: David S. Miller commit e0bfcf9c77d9b2c11d2767f0c747f7721ae0cc51 Merge: a689702a6cfc2 1d00032394013 Author: David S. Miller Date: Thu Oct 21 12:11:26 2021 +0100 Merge tag 'mlx5-fixes-2021-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-fixes-2021-10-20 ==================== Signed-off-by: David S. Miller commit a689702a6cfc2a71b484a34df66c8cacd803874b Merge: 4225fea1cb283 7dcf78b870be6 Author: David S. Miller Date: Thu Oct 21 12:10:29 2021 +0100 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2021-10-20 This series contains updates to e1000e, igc, and ice drivers. Sasha fixes an issue with dropped packets on Tiger Lake platforms for e1000e and corrects a device ID for igc. Tony adds missing E810 device IDs for ice. ==================== Signed-off-by: David S. Miller commit 74056092ff415e7e20ce2544689b32ee811c4f0b Author: Anitha Chrisanthus Date: Mon Jun 7 14:17:11 2021 -0700 drm/kmb: Enable ADV bridge after modeset On KMB, ADV bridge must be programmed and powered on prior to MIPI DSI HW initialization. v2: changed to atomic_bridge_chain_enable (Sam) Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver") Co-developed-by: Edmund Dea Signed-off-by: Edmund Dea Signed-off-by: Anitha Chrisanthus Link: https://patchwork.freedesktop.org/patch/msgid/20211019230719.789958-1-anitha.chrisanthus@intel.com Acked-by: Sam Ravnborg Signed-off-by: Maarten Lankhorst commit 004d2719806fb8e355c1bccd538e82c04319d391 Author: Anitha Chrisanthus Date: Mon Jul 19 16:28:51 2021 -0700 drm/kmb: Corrected typo in handle_lcd_irq Check for Overflow bits for layer3 in the irq handler. Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display") Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013233632.471892-5-anitha.chrisanthus@intel.com Signed-off-by: Maarten Lankhorst commit 982f8ad666a1123028a077b6b009871a0dc9df26 Author: Edmund Dea Date: Wed Oct 6 16:03:48 2021 -0700 drm/kmb: Disable change of plane parameters Due to HW limitations, KMB cannot change height, width, or pixel format after initial plane configuration. v2: removed memset disp_cfg as it is already zero. Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display") Signed-off-by: Edmund Dea Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013233632.471892-4-anitha.chrisanthus@intel.com Signed-off-by: Maarten Lankhorst commit 13047a092c6d3f23b7d684b5b3fe46b2b50423b9 Author: Edmund Dea Date: Tue Apr 20 15:31:53 2021 -0700 drm/kmb: Remove clearing DPHY regs Don't clear the shared DPHY registers common to MIPI Rx and MIPI Tx during DSI initialization since this was causing MIPI Rx reset. Rest of the writes are bitwise, so will not affect Mipi Rx side. Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver") Signed-off-by: Edmund Dea Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013233632.471892-3-anitha.chrisanthus@intel.com Signed-off-by: Maarten Lankhorst commit a79f40cccd4644c32f6d5ae1ccf091a262e1dc57 Author: Anitha Chrisanthus Date: Fri Jan 8 14:34:13 2021 -0800 drm/kmb: Limit supported mode to 1080p KMB only supports single resolution(1080p), this commit checks for 1920x1080x60 or 1920x1080x59 in crtc_mode_valid. Also, modes with vfp < 4 are not supported in KMB display. This change prunes display modes with vfp < 4. v2: added vfp check Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display") Co-developed-by: Edmund Dea Signed-off-by: Edmund Dea Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link:https://patchwork.freedesktop.org/patch/msgid/20211013233632.471892-2-anitha.chrisanthus@intel.com Signed-off-by: Maarten Lankhorst commit 3e4c31e8f70251732529a10934355084c7fab0ac Author: Anitha Chrisanthus Date: Tue Dec 15 11:13:09 2020 -0800 drm/kmb: Work around for higher system clock Use a different value for system clock offset in the ppl/llp ratio calculations for clocks higher than 500 Mhz. Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver") Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013233632.471892-1-anitha.chrisanthus@intel.com Signed-off-by: Maarten Lankhorst commit 772970620a839141835eaf2bc507d957b10adcca Author: Dan Johansen Date: Wed Aug 18 23:48:18 2021 +0200 drm/panel: ilitek-ili9881c: Fix sync for Feixin K101-IM2BYL02 panel This adjusts sync values according to the datasheet Fixes: 1c243751c095 ("drm/panel: ilitek-ili9881c: add support for Feixin K101-IM2BYL02 panel") Co-developed-by: Marius Gripsgard Signed-off-by: Dan Johansen Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210818214818.298089-1-strit@manjaro.org Signed-off-by: Maarten Lankhorst commit 3cfc183052c3dbf8eae57b6c1685dab00ed3db4a Author: Marek Vasut Date: Sat Oct 16 23:04:46 2021 +0200 drm: mxsfb: Fix NULL pointer dereference crash on unload The mxsfb->crtc.funcs may already be NULL when unloading the driver, in which case calling mxsfb_irq_disable() via drm_irq_uninstall() from mxsfb_unload() leads to NULL pointer dereference. Since all we care about is masking the IRQ and mxsfb->base is still valid, just use that to clear and mask the IRQ. Fixes: ae1ed00932819 ("drm: mxsfb: Stop using DRM simple display pipeline helper") Signed-off-by: Marek Vasut Cc: Daniel Abrecht Cc: Emil Velikov Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Stefan Agner Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016210446.171616-1-marex@denx.de Signed-off-by: Maarten Lankhorst commit 964d32e512670c7b87870e30cfed2303da86d614 Author: Miklos Szeredi Date: Thu Oct 21 10:01:39 2021 +0200 fuse: clean up error exits in fuse_fill_super() Instead of "goto err", return error directly, since there's no error cleanup to do now. Signed-off-by: Miklos Szeredi commit 80019f1138324b6f35ae728b4f25eeb08899b452 Author: Miklos Szeredi Date: Thu Oct 21 10:01:39 2021 +0200 fuse: always initialize sb->s_fs_info Syzkaller reports a null pointer dereference in fuse_test_super() that is caused by sb->s_fs_info being NULL. This is due to the fact that fuse_fill_super() is initializing s_fs_info, which is too late, it's already on the fs_supers list. The initialization needs to be done in sget_fc() with the sb_lock held. Move allocation of fuse_mount and fuse_conn from fuse_fill_super() into fuse_get_tree(). After this ->kill_sb() will always be called with non-NULL ->s_fs_info, hence fuse_mount_destroy() can drop the test for non-NULL "fm". Reported-by: syzbot+74a15f02ccb51f398601@syzkaller.appspotmail.com Fixes: 5d5b74aa9c76 ("fuse: allow sharing existing sb") Signed-off-by: Miklos Szeredi commit c191cd07ee948c93081d8e4cba43d23b18b2f3da Author: Miklos Szeredi Date: Thu Oct 21 10:01:39 2021 +0200 fuse: clean up fuse_mount destruction 1. call fuse_mount_destroy() for open coded variants 2. before deactivate_locked_super() don't need fuse_mount destruction since that will now be done (if ->s_fs_info is not cleared) 3. rearrange fuse_mount setup in fuse_get_tree_submount() so that the regular pattern can be used Signed-off-by: Miklos Szeredi commit a27c061a49afd7ad2d935e6ac734e2a9f62861b8 Author: Miklos Szeredi Date: Thu Oct 21 10:01:38 2021 +0200 fuse: get rid of fuse_put_super() The ->put_super callback is called from generic_shutdown_super() in case of a fully initialized sb. This is called from kill_***_super(), which is called from ->kill_sb instances. Fuse uses ->put_super to destroy the fs specific fuse_mount and drop the reference to the fuse_conn, while it does the same on each error case during sb setup. This patch moves the destruction from fuse_put_super() to fuse_mount_destroy(), called at the end of all ->kill_sb instances. A follup patch will clean up the error paths. Signed-off-by: Miklos Szeredi commit d534d31d6a45d71de61db22090b4820afb68fddc Author: Miklos Szeredi Date: Thu Oct 21 10:01:38 2021 +0200 fuse: check s_root when destroying sb Checking "fm" works because currently sb->s_fs_info is cleared on error paths; however, sb->s_root is what generic_shutdown_super() checks to determine whether the sb was fully initialized or not. This change will allow cleanup of sb setup error paths. Signed-off-by: Miklos Szeredi commit 3a25dfa67fe40f3a2690af2c562e0947a78bd6a0 Author: Paolo Bonzini Date: Wed Oct 20 06:22:59 2021 -0400 KVM: nVMX: promptly process interrupts delivered while in guest mode Since commit c300ab9f08df ("KVM: x86: Replace late check_nested_events() hack with more precise fix") there is no longer the certainty that check_nested_events() tries to inject an external interrupt vmexit to L1 on every call to vcpu_enter_guest. Therefore, even in that case we need to set KVM_REQ_EVENT. This ensures that inject_pending_event() is called, and from there kvm_check_nested_events(). Fixes: c300ab9f08df ("KVM: x86: Replace late check_nested_events() hack with more precise fix") Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit de7cd3f6761f49bef044ec49493d88737a70f1a6 Author: Paolo Bonzini Date: Wed Oct 20 06:27:36 2021 -0400 KVM: x86: check for interrupts before deciding whether to exit the fast path The kvm_x86_sync_pir_to_irr callback can sometimes set KVM_REQ_EVENT. If that happens exactly at the time that an exit is handled as EXIT_FASTPATH_REENTER_GUEST, vcpu_enter_guest will go incorrectly through the loop that calls kvm_x86_run, instead of processing the request promptly. Fixes: 379a3c8ee444 ("KVM: VMX: Optimize posted-interrupt delivery for timer fastpath") Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 282da7cef078a87b6d5e8ceba8b17e428cf0e37c Author: Chanho Park Date: Mon Oct 18 15:28:41 2021 +0900 scsi: ufs: ufs-exynos: Correct timeout value setting registers PA_PWRMODEUSERDATA0 -> DL_FC0PROTTIMEOUTVAL PA_PWRMODEUSERDATA1 -> DL_TC0REPLAYTIMEOUTVAL PA_PWRMODEUSERDATA2 -> DL_AFC0REQTIMEOUTVAL Link: https://lore.kernel.org/r/20211018062841.18226-1-chanho61.park@samsung.com Fixes: a967ddb22d94 ("scsi: ufs: ufs-exynos: Apply vendor-specific values for three timeouts") Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Reviewed-by: Avri Altman Signed-off-by: Chanho Park Signed-off-by: Martin K. Petersen commit e20f80b9b163dc402dca115eed0affba6df5ebb5 Author: Brian King Date: Tue Oct 19 10:21:29 2021 -0500 scsi: ibmvfc: Fix up duplicate response detection Commit a264cf5e81c7 ("scsi: ibmvfc: Fix command state accounting and stale response detection") introduced a regression in detecting duplicate responses. This was observed in test where a command was sent to the VIOS and completed before ibmvfc_send_event() set the active flag to 1, which resulted in the atomic_dec_if_positive() call in ibmvfc_handle_crq() thinking this was a duplicate response, which resulted in scsi_done() not getting called, so we then hit a SCSI command timeout for this command once the timeout expires. This simply ensures the active flag gets set prior to making the hcall to send the command to the VIOS, in order to close this window. Link: https://lore.kernel.org/r/20211019152129.16558-1-brking@linux.vnet.ibm.com Fixes: a264cf5e81c7 ("scsi: ibmvfc: Fix command state accounting and stale response detection") Cc: stable@vger.kernel.org Acked-by: Tyrel Datwyler Signed-off-by: Brian King Signed-off-by: Martin K. Petersen commit 25f54d08f12feb593e62cc2193fedefaf7825301 Author: Ian Kent Date: Thu Sep 23 15:13:39 2021 +0800 autofs: fix wait name hash calculation in autofs_wait() There's a mistake in commit 2be7828c9fefc ("get rid of autofs_getpath()") that affects kernels from v5.13.0, basically missed because of me not fully testing the change for Al. The problem is that the hash calculation for the wait name qstr hasn't been updated to account for the change to use dentry_path_raw(). This prevents the correct matching an existing wait resulting in multiple notifications being sent to the daemon for the same mount which must not occur. The problem wasn't discovered earlier because it only occurs when multiple processes trigger a request for the same mount concurrently so it only shows up in more aggressive testing. Fixes: 2be7828c9fefc ("get rid of autofs_getpath()") Cc: stable@vger.kernel.org Signed-off-by: Ian Kent Signed-off-by: Al Viro commit 2f111a6fd5b5297b4e92f53798ca086f7c7d33a4 Merge: 515dcc2e02178 1bd85aa65d0e7 Author: Linus Torvalds Date: Wed Oct 20 10:23:05 2021 -1000 Merge tag 'ceph-for-5.15-rc7' of git://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "Two important filesystem fixes, marked for stable. The blocklisted superblocks issue was particularly annoying because for unexperienced users it essentially exacted a reboot to establish a new functional mount in that scenario" * tag 'ceph-for-5.15-rc7' of git://github.com/ceph/ceph-client: ceph: fix handling of "meta" errors ceph: skip existing superblocks that are blocklisted or shut down when mounting commit 515dcc2e02178ea8af2ea53b4ae5bdb6875b53ef Merge: 8e37395c3a5dc c2bbf9d1e9ac7 Author: Linus Torvalds Date: Wed Oct 20 10:16:51 2021 -1000 Merge tag 'dma-mapping-5.15-2' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - fix more dma-debug fallout (Gerald Schaefer, Hamza Mahfooz) - fix a kerneldoc warning (Logan Gunthorpe) * tag 'dma-mapping-5.15-2' of git://git.infradead.org/users/hch/dma-mapping: dma-debug: teach add_dma_entry() about DMA_ATTR_SKIP_CPU_SYNC dma-debug: fix sg checks in debug_dma_map_sg() dma-mapping: fix the kerneldoc for dma_map_sgtable() commit 53c2ff8bcb06acd07e24a62e7f5a0247bd7c6f67 Author: Aaron Liu Date: Tue Oct 19 11:13:25 2021 +0800 drm/amdgpu: support B0&B1 external revision id for yellow carp B0 internal rev_id is 0x01, B1 internal rev_id is 0x02. The external rev_id for B0 and B1 is 0x20. The original expression is not suitable for B1. v2: squash in fix for display code (Alex) Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 2ef8ea23942f4c2569930c34e7689a0cb1b232cc Author: Jake Wang Date: Fri Oct 1 17:14:21 2021 -0400 drm/amd/display: Moved dccg init to after bios golden init [Why] bios_golden_init will override dccg_init during init_hw. [How] Move dccg_init to after bios_golden_init. Reviewed-by: Aric Cyr Reviewed-by: Eric Yang Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Jake Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit dd8cb18906d97b2916fde42d32d915ae363c7e55 Author: Nikola Cornij Date: Fri Oct 1 13:26:05 2021 -0400 drm/amd/display: Increase watermark latencies for DCN3.1 [why] The original latencies were causing underflow in some modes [how] Replace with the up-to-date watermark values based on new measurments Reviewed-by: Ahmad Othman Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Nikola Cornij Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 4835ea6c173a8d8dfbfdbb21c4cd987d12681610 Author: Eric Yang Date: Thu Sep 30 13:46:45 2021 -0400 drm/amd/display: increase Z9 latency to workaround underflow in Z9 [Why] Z9 latency is higher than when we originally tuned the watermark parameters, causing underflow. Increasing the value until the latency issues is resolved. Reviewed-by: Nicholas Kazlauskas Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Eric Yang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 672437486ee9da3ed0e774937e6d0dd570921b39 Author: Nicholas Kazlauskas Date: Wed Sep 29 16:22:53 2021 -0400 drm/amd/display: Require immediate flip support for DCN3.1 planes [Why] Immediate flip can be enabled dynamically and has higher BW requirements when validating which voltage mode to use. If we validate when it's not set then potentially DCFCLK will be too low and we will underflow. [How] DM always requires support so always require it as part of DML input parameters. This can't be enabled unconditionally on older ASIC because it blocks some expected modes so only target DCN3.1 for now. Reviewed-by: Dmytro Laktyushkin Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c938aed88f8259dc913b717a32319101c66e87a9 Author: Nicholas Kazlauskas Date: Wed Sep 29 11:37:33 2021 -0400 drm/amd/display: Fix prefetch bandwidth calculation for DCN3.1 [Why] Prefetch BW calculated is lower than the DML reference because of a porting error that's excluding cursor and row bandwidth from the pixel data bandwidth. [How] Change the dml_max4 to dml_max3 and include cursor and row bandwidth in the same calculation as the rest of the pixel data during vactive. Reviewed-by: Dmytro Laktyushkin Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c21b105380cf86e829c68586ca1315cfc253ad8c Author: Nikola Cornij Date: Tue Sep 28 22:43:52 2021 -0400 drm/amd/display: Limit display scaling to up to true 4k for DCN 3.1 [why] The requirement is that image width up to 4096 shall be supported Reviewed-by: Aric Cyr Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Nikola Cornij Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5afa7898ab7a0ec9c28556a91df714bf3c2f725e Author: Thelford Williams Date: Wed Oct 13 16:04:13 2021 -0400 drm/amdgpu: fix out of bounds write Size can be any value and is user controlled resulting in overwriting the 40 byte array wr_buf with an arbitrary length of data from buf. Signed-off-by: Thelford Williams Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 1d000323940137332d4d62c6332b6daf5f07aba7 Author: Emeel Hakim Date: Mon Oct 18 15:31:19 2021 +0300 net/mlx5e: IPsec: Fix work queue entry ethernet segment checksum flags Current Work Queue Entry (WQE) checksum (csum) flags in the ethernet segment (eseg) in case of IPsec crypto offload datapath are not aligned with PRM/HW expectations. Currently the driver always sets the l3_inner_csum flag in case of IPsec because of the wrong usage of skb->encapsulation as indicator for inner IPsec header since skb->encapsulation is always ON for IPsec packets since IPsec itself is an encapsulation protocol. The above forced a failing attempts of calculating csum of non-existing segments (like in the IP|ESP|TCP packet case which does not have an l3_inner) which led to lots of packet drops hence the low throughput. Fix by using xo->inner_ipproto as indicator for inner IPsec header instead of skb->encapsulation in addition to setting the csum flags as following: * Tunnel Mode: * Pkt: MAC IP ESP IP L4 * CSUM: l3_cs | l3_inner_cs | l4_inner_cs * * Transport Mode: * Pkt: MAC IP ESP L4 * CSUM: l3_cs [ | l4_cs (checksum partial case)] * * Tunnel(VXLAN TCP/UDP) over Transport Mode * Pkt: MAC IP ESP UDP VXLAN IP L4 * CSUM: l3_cs | l3_inner_cs | l4_inner_cs Fixes: f1267798c980 ("net/mlx5: Fix checksum issue of VXLAN and IPsec crypto offload") Signed-off-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit d10457f85d4ae4d32c0df0cd65358a78c577fbe6 Author: Emeel Hakim Date: Mon Oct 18 15:30:09 2021 +0300 net/mlx5e: IPsec: Fix a misuse of the software parser's fields IPsec crypto offload current Software Parser (SWP) fields settings in the ethernet segment (eseg) are not aligned with PRM/HW expectations. Among others in case of IP|ESP|TCP packet, current driver sets the offsets for inner_l3 and inner_l4 although there is no inner l3/l4 headers relative to ESP header in such packets. SWP provides the offsets for HW ,so it can be used to find csum fields to offload the checksum, however these are not necessarily used by HW and are used as fallback in case HW fails to parse the packet, e.g when performing IPSec Transport Aware (IP | ESP | TCP) there is no need to add SW parse on inner packet. So in some cases packets csum was calculated correctly , whereas in other cases it failed. The later faced csum errors (caused by wrong packet length calculations) which led to lots of packet drops hence the low throughput. Fix by setting the SWP fields as expected in a IP|ESP|TCP packet. the following describe the expected SWP offsets: * Tunnel Mode: * SWP: OutL3 InL3 InL4 * Pkt: MAC IP ESP IP L4 * * Transport Mode: * SWP: OutL3 OutL4 * Pkt: MAC IP ESP L4 * * Tunnel(VXLAN TCP/UDP) over Transport Mode * SWP: OutL3 InL3 InL4 * Pkt: MAC IP ESP UDP VXLAN IP L4 Fixes: f1267798c980 ("net/mlx5: Fix checksum issue of VXLAN and IPsec crypto offload") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit 68e66e1a69cd94f934522348ab232af49863452a Author: Moshe Shemesh Date: Sat Oct 2 11:15:35 2021 +0300 net/mlx5e: Fix vlan data lost during suspend flow During suspend flow the driver calls mlx5e_destroy_vlan_table() which does not only delete the vlans steering flow rules, but also frees the data on currently active vlans, thus it is not restored during resume flow. This fix keeps the vlan data on suspend flow and frees it only on driver remove flow. Fixes: 6783f0a21a3c ("net/mlx5e: Dynamic alloc vlan table for netdev when needed") Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit a6f74333548f56afb413fc928ae1aefc4fe7608f Author: Dmytro Linkin Date: Wed Aug 25 17:51:26 2021 +0300 net/mlx5: E-switch, Return correct error code on group creation failure Dan Carpenter report: The patch f47e04eb96e0: "net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups" from May 31, 2021, leads to the following Smatch static checker warning: drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c:483 esw_qos_create_rate_group() warn: passing zero to 'ERR_PTR' If min rate normalization failed then error code may be overwritten to 0 if scheduling element destruction succeed. Ignore this value and always return initial one. Fixes: f47e04eb96e0 ("net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups") Reported-by: Dan Carpenter Signed-off-by: Dmytro Linkin Signed-off-by: Saeed Mahameed commit 14fe2471c62816ba82546fb68369d957c3a58b59 Author: Maor Dickman Date: Thu Oct 7 16:05:38 2021 +0300 net/mlx5: Lag, change multipath and bonding to be mutually exclusive Both multipath and bonding events are changing the HW LAG state independently. Handling one of the features events while the other is already enabled can cause unwanted behavior, for example handling bonding event while multipath enabled will disable the lag and cause multipath to stop working. Fix it by ignoring bonding event while in multipath and ignoring FIB events while in bonding mode. Fixes: 544fe7c2e654 ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 8e37395c3a5dceff62a5010ebbbc107f4145935c Merge: 6da52dead8f59 29664923725a3 Author: Linus Torvalds Date: Wed Oct 20 06:13:22 2021 -1000 Merge tag 'sound-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Again it became bigger than wished, unfortunately, as this contains quite a few ASoC fixes that came up a bit late. It also includes yet more HD- and USB-audio quirks: I decided to merge them now, as those are for stable, and we'll need them sooner or later. Although the volumes are a bit high, all changes are device-specific (and reasonably small) fixes, so it should be safe for the late rc" * tag 'sound-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Fix microphone sound on Jieli webcam. ALSA: hda/realtek: Fixes HP Spectre x360 15-eb1xxx speakers ALSA: usb-audio: Provide quirk for Sennheiser GSP670 Headset ALSA: hda/realtek: Add quirk for Clevo PC50HS ALSA: usb-audio: add Schiit Hel device to quirk table ASoC: wm8960: Fix clock configuration on slave mode ASoC: cs42l42: Ensure 0dB full scale volume is used for headsets ASoC: soc-core: fix null-ptr-deref in snd_soc_del_component_unlocked() ASoC: codec: wcd938x: Add irq config support ASoC: DAPM: Fix missing kctl change notifications ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log saturation ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional() ASoC: Intel: bytcht_es8316: Use temporary variable for struct device ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata() ASoC: wcd938x: Fix jack detection issue ASoC: nau8824: Fix headphone vs headset, button-press detection no longer working ASoC: cs4341: Add SPI device ID table ASoC: pcm179x: Add missing entries SPI to device ID table ASoC: fsl_xcvr: Fix channel swap issue with ARC ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers commit 6da52dead8f59fcf81e19ad3937d903a9b87e1de Merge: fc9b289344b84 6e3ee990c9049 Author: Linus Torvalds Date: Wed Oct 20 06:11:17 2021 -1000 Merge tag 'audit-pr-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "One small audit patch to add a pointer NULL check" * tag 'audit-pr-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: fix possible null-pointer dereference in audit_filter_rules commit 7dcf78b870be6418d72bb1c4d4924bf0f5ca5052 Author: Tony Nguyen Date: Tue Oct 19 13:04:16 2021 -0700 ice: Add missing E810 device ids As part of support for E810 XXV devices, some device ids were inadvertently left out. Add those missing ids. Fixes: 195fb97766da ("ice: add additional E810 device id") Signed-off-by: Tony Nguyen Acked-by: Jesse Brandeburg Acked-by: Paul Menzel commit 79cc8322b6d82747cb63ea464146c0bf5b5a6bc1 Author: Sasha Neftin Date: Thu Sep 9 20:49:04 2021 +0300 igc: Update I226_K device ID The device ID for I226_K was incorrectly assigned, update the device ID to the correct one. Fixes: bfa5e98c9de4 ("igc: Add new device ID") Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 639e298f432fb058a9496ea16863f53b1ce935fe Author: Sasha Neftin Date: Wed Sep 22 09:55:42 2021 +0300 e1000e: Fix packet loss on Tiger Lake and later Update the HW MAC initialization flow. Do not gate DMA clock from the modPHY block. Keeping this clock will prevent dropped packets sent in burst mode on the Kumeran interface. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213651 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213377 Fixes: fb776f5d57ee ("e1000e: Add support for Tiger Lake") Signed-off-by: Sasha Neftin Tested-by: Mark Pearson Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit fc9b289344b845576aedefe0691a4210987f3711 Merge: 1e59977463e98 ed65df63a39a3 Author: Linus Torvalds Date: Wed Oct 20 06:02:58 2021 -1000 Merge tag 'trace-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "Recursion fix for tracing. While cleaning up some of the tracing recursion protection logic, I discovered a scenario that the current design would miss, and would allow an infinite recursion. Removing an optimization trick that opened the hole fixes the issue and cleans up the code as well" * tag 'trace-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Have all levels of checks prevent recursion commit 1e59977463e9894e3d579d4e1e2a1dc81f456633 Merge: 0afe64bebb135 4cce60f15c04d Author: Linus Torvalds Date: Wed Oct 20 05:56:51 2021 -1000 Merge tag 'nios2_fixes_for_v5.15_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux Pull nios2 fix from Dinh Nguyen: - Renamed CTL_STATUS to CTL_FSTATUS to fix a redefined warning * tag 'nios2_fixes_for_v5.15_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: NIOS2: irqflags: rename a redefined register name commit 4ea672ab694c23886b52e97cee10dea056e43e62 Author: Pavel Begunkov Date: Wed Oct 20 09:53:02 2021 +0100 io_uring: fix ltimeout unprep io_unprep_linked_timeout() is broken, first it needs to return back REQ_F_ARM_LTIMEOUT, so the linked timeout is enqueued and disarmed. But now we refcounted it, and linked timeouts may get not executed at all, leaking a request. Just kill the unprep optimisation. Fixes: 906c6caaf586 ("io_uring: optimise io_prep_linked_timeout()") Reported-by: Beld Zhang Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/51b8e2bfc4bea8ee625cf2ba62b2a350cc9be031.1634719585.git.asml.silence@gmail.com Link: https://github.com/axboe/liburing/issues/460 Reported-by: Beld Zhang Signed-off-by: Jens Axboe commit e139a1ec92f8dbaaa7380d7e7ea17e148d473d06 Author: Pavel Begunkov Date: Tue Oct 19 23:43:46 2021 +0100 io_uring: apply max_workers limit to all future users Currently, IORING_REGISTER_IOWQ_MAX_WORKERS applies only to the task that issued it, it's unexpected for users. If one task creates a ring, limits workers and then passes it to another task the limit won't be applied to the other task. Another pitfall is that a task should either create a ring or submit at least one request for IORING_REGISTER_IOWQ_MAX_WORKERS to work at all, furher complicating the picture. Change the API, save the limits and apply to all future users. Note, it should be done first before giving away the ring or submitting new requests otherwise the result is not guaranteed. Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers") Link: https://github.com/axboe/liburing/issues/460 Reported-by: Beld Zhang Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/51d0bae97180e08ab722c0d5c93e7439cfb6f697.1634683237.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0afe64bebb13509ef9a4be9deb18286b4c052c93 Merge: d9abdee5fd5ab 9f1ee7b169afb Author: Linus Torvalds Date: Wed Oct 20 05:52:10 2021 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "Tools: - kvm_stat: do not show halt_wait_ns since it is not a cumulative statistic x86: - clean ups and fixes for bus lock vmexit and lazy allocation of rmaps - two fixes for SEV-ES (one more coming as soon as I get reviews) - fix for static_key underflow ARM: - Properly refcount pages used as a concatenated stage-2 PGD - Fix missing unlock when detecting the use of MTE+VM_SHARED" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SEV-ES: reduce ghcb_sa_len to 32 bits KVM: VMX: Remove redundant handling of bus lock vmexit KVM: kvm_stat: do not show halt_wait_ns KVM: x86: WARN if APIC HW/SW disable static keys are non-zero on unload Revert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET" KVM: SEV-ES: Set guest_state_protected after VMSA update KVM: X86: fix lazy allocation of rmaps KVM: SEV-ES: fix length of string I/O KVM: arm64: Release mmap_lock when using VM_SHARED with MTE KVM: arm64: Report corrupted refcount at EL2 KVM: arm64: Fix host stage-2 PGD refcount KVM: s390: Function documentation fixes commit 280db5d420090a24e4e41f9ddcbf37920a598572 Author: Sasha Neftin Date: Wed Sep 22 09:54:49 2021 +0300 e1000e: Separate TGP board type from SPT We have the same LAN controller on different PCHs. Separate TGP board type from SPT which will allow for specific fixes to be applied for TGP platforms. Suggested-by: Kai-Heng Feng Signed-off-by: Sasha Neftin Reviewed-by: Paul Menzel Tested-by: Mark Pearson Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 5ebcbe342b1c12fae44b4f83cbeae1520e09857e Author: Eric W. Biederman Date: Sat Oct 16 12:17:30 2021 -0500 ucounts: Move get_ucounts from cred_alloc_blank to key_change_session_keyring Setting cred->ucounts in cred_alloc_blank does not make sense. The uid and user_ns are deliberately not set in cred_alloc_blank but instead the setting is delayed until key_change_session_keyring. So move dealing with ucounts into key_change_session_keyring as well. Unfortunately that movement of get_ucounts adds a new failure mode to key_change_session_keyring. I do not see anything stopping the parent process from calling setuid and changing the relevant part of it's cred while keyctl_session_to_parent is running making it fundamentally necessary to call get_ucounts in key_change_session_keyring. Which means that the new failure mode cannot be avoided. A failure of key_change_session_keyring results in a single threaded parent keeping it's existing credentials. Which results in the parent process not being able to access the session keyring and whichever keys are in the new keyring. Further get_ucounts is only expected to fail if the number of bits in the refernece count for the structure is too few. Since the code has no other way to report the failure of get_ucounts and because such failures are not expected to be common add a WARN_ONCE to report this problem to userspace. Between the WARN_ONCE and the parent process not having access to the keys in the new session keyring I expect any failure of get_ucounts will be noticed and reported and we can find another way to handle this condition. (Possibly by just making ucounts->count an atomic_long_t). Cc: stable@vger.kernel.org Fixes: 905ae01c4ae2 ("Add a reference to ucounts for each cred") Link: https://lkml.kernel.org/r/7k0ias0uf.fsf_-_@disp2133 Tested-by: Yu Zhao Reviewed-by: Alexey Gladkov Signed-off-by: "Eric W. Biederman" commit 36b6dcbc1245a3b4dd6bc5cc6b0284c9f05cdddc Merge: e23c7487f5a74 3ad60b4b35709 Author: Arnd Bergmann Date: Wed Oct 20 16:42:19 2021 +0200 Merge tag 'reset-fixes-for-v5.15' of git://git.pengutronix.de/pza/linux into arm/fixes Reset controller fixes for v5.15 Fix the status bit polarity in the brcmstb-rescal driver, re-enable pistachio driver selection after MACH_PISTACHIO removal, add transfer error handling in the tegra-bpmp driver, and fix probing of the reset-socfpga driver after recent device link changes. * tag 'reset-fixes-for-v5.15' of git://git.pengutronix.de/pza/linux: reset: socfpga: add empty driver allowing consumers to probe reset: tegra-bpmp: Handle errors in BPMP response reset: pistachio: Re-enable driver selection reset: brcmstb-rescal: fix incorrect polarity of status bit Link: https://lore.kernel.org/r/b378f2aae54538db6a13c98561b4cbcacbef937c.camel@pengutronix.de Signed-off-by: Arnd Bergmann commit e23c7487f5a74f5cc9f7e1090f1d83c3e33ae315 Merge: 72cd4e3bde4e8 55dd7e059098c Author: Arnd Bergmann Date: Wed Oct 20 15:51:37 2021 +0200 Merge tag 'sunxi-fixes-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes Two patches to fix the GMAC PHY mode on some boards. * tag 'sunxi-fixes-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sun7i: A20-olinuxino-lime2: Fix ethernet phy-mode arm64: dts: allwinner: h5: NanoPI Neo 2: Fix ethernet node Link: https://lore.kernel.org/r/d4c41c71-f1ff-4464-a26f-1bfd4b52fd78.lettre@localhost Signed-off-by: Arnd Bergmann commit 72cd4e3bde4e8ad178f9a698996275e20d235b63 Merge: 519d81956ee27 0b28c41e3c951 Author: Arnd Bergmann Date: Wed Oct 20 15:49:36 2021 +0200 Merge tag 'imx-fixes-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.15, round 4: - A series from Frieder Schrempf to fix i.MX8MM Kontron N801x board on various aspects, voltage settings, GPIO polarity, SPI clock frequency and Ethernet PHY type. * tag 'imx-fixes-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8mm-kontron: Fix connection type for VSC8531 RGMII PHY arm64: dts: imx8mm-kontron: Fix CAN SPI clock frequency arm64: dts: imx8mm-kontron: Fix polarity of reg_rst_eth2 arm64: dts: imx8mm-kontron: Set lower limit of VDD_SNVS to 800 mV arm64: dts: imx8mm-kontron: Make sure SOC and DRAM supply voltages are correct Link: https://lore.kernel.org/r/20211018000958.GC25810@dragon Signed-off-by: Arnd Bergmann commit 4225fea1cb28370086e17e82c0f69bec2779dca0 Author: Yang Yingliang Date: Wed Oct 20 16:18:34 2021 +0800 ptp: Fix possible memory leak in ptp_clock_register() I got memory leak as follows when doing fault injection test: unreferenced object 0xffff88800906c618 (size 8): comm "i2c-idt82p33931", pid 4421, jiffies 4294948083 (age 13.188s) hex dump (first 8 bytes): 70 74 70 30 00 00 00 00 ptp0.... backtrace: [<00000000312ed458>] __kmalloc_track_caller+0x19f/0x3a0 [<0000000079f6e2ff>] kvasprintf+0xb5/0x150 [<0000000026aae54f>] kvasprintf_const+0x60/0x190 [<00000000f323a5f7>] kobject_set_name_vargs+0x56/0x150 [<000000004e35abdd>] dev_set_name+0xc0/0x100 [<00000000f20cfe25>] ptp_clock_register+0x9f4/0xd30 [ptp] [<000000008bb9f0de>] idt82p33_probe.cold+0x8b6/0x1561 [ptp_idt82p33] When posix_clock_register() returns an error, the name allocated in dev_set_name() will be leaked, the put_device() should be used to give up the device reference, then the name will be freed in kobject_cleanup() and other memory will be freed in ptp_clock_release(). Reported-by: Hulk Robot Fixes: a33121e5487b ("ptp: fix the race between the release of ptp_clock and cdev") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 3cb958027cb8b78d3ee639ce9af54c2ef1bf964f Author: Kurt Kanzenbach Date: Wed Oct 20 09:04:33 2021 +0200 net: stmmac: Fix E2E delay mechanism When utilizing End to End delay mechanism, the following error messages show up: |root@ehl1:~# ptp4l --tx_timestamp_timeout=50 -H -i eno2 -E -m |ptp4l[950.573]: selected /dev/ptp3 as PTP clock |ptp4l[950.586]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE |ptp4l[950.586]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE |ptp4l[952.879]: port 1: new foreign master 001395.fffe.4897b4-1 |ptp4l[956.879]: selected best master clock 001395.fffe.4897b4 |ptp4l[956.879]: port 1: assuming the grand master role |ptp4l[956.879]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER |ptp4l[962.017]: port 1: received DELAY_REQ without timestamp |ptp4l[962.273]: port 1: received DELAY_REQ without timestamp |ptp4l[963.090]: port 1: received DELAY_REQ without timestamp Commit f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a") already addresses this problem for the dwmac v5.10. However, same holds true for all dwmacs above version v4.10. Correct the check accordingly. Afterwards everything works as expected. Tested on Intel Atom(R) x6414RE Processor. Fixes: 14f347334bf2 ("net: stmmac: Correctly take timestamp for PTPv2") Fixes: f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a") Suggested-by: Ong Boon Leong Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 641e3fd1a038c68045bbf89d78502f4b4bbc7284 Author: Uwe Kleine-König Date: Tue Oct 19 22:49:16 2021 +0200 nfc: st95hf: Make spi remove() callback return zero If something goes wrong in the remove callback, returning an error code just results in an error message. The device still disappears. So don't skip disabling the regulator in st95hf_remove() if resetting the controller via spi fails. Also don't return an error code which just results in two error messages. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 0e9ff65f455dfd0a8aea5e7843678ab6fe097e21 Author: Halil Pasic Date: Tue Oct 19 19:54:00 2021 +0200 KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu Changing the deliverable mask in __airqs_kick_single_vcpu() is a bug. If one idle vcpu can't take the interrupts we want to deliver, we should look for another vcpu that can, instead of saying that we don't want to deliver these interrupts by clearing the bits from the deliverable_mask. Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()") Signed-off-by: Halil Pasic Reviewed-by: Christian Borntraeger Reviewed-by: Michael Mueller Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20211019175401.3757927-3-pasic@linux.ibm.com Signed-off-by: Christian Borntraeger commit 9b57e9d5010bbed7c0d9d445085840f7025e6f9a Author: Halil Pasic Date: Tue Oct 19 19:53:59 2021 +0200 KVM: s390: clear kicked_mask before sleeping again The idea behind kicked mask is that we should not re-kick a vcpu that is already in the "kick" process, i.e. that was kicked and is is about to be dispatched if certain conditions are met. The problem with the current implementation is, that it assumes the kicked vcpu is going to enter SIE shortly. But under certain circumstances, the vcpu we just kicked will be deemed non-runnable and will remain in wait state. This can happen, if the interrupt(s) this vcpu got kicked to deal with got already cleared (because the interrupts got delivered to another vcpu). In this case kvm_arch_vcpu_runnable() would return false, and the vcpu would remain in kvm_vcpu_block(), but this time with its kicked_mask bit set. So next time around we wouldn't kick the vcpu form __airqs_kick_single_vcpu(), but would assume that we just kicked it. Let us make sure the kicked_mask is cleared before we give up on re-dispatching the vcpu. Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()") Reported-by: Matthew Rosato Signed-off-by: Halil Pasic Reviewed-by: Christian Borntraeger Reviewed-by: Michael Mueller Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20211019175401.3757927-2-pasic@linux.ibm.com Signed-off-by: Christian Borntraeger commit 323e9a957df89cf7240b3ce4952f2d40e426bd52 Merge: 55161e67d44fd 0dd8a25f355b4 Author: David S. Miller Date: Wed Oct 20 11:38:11 2021 +0100 Merge branch 'hns3-fixes' 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 0dd8a25f355b4df2d41c08df1716340854c7d4c5 Author: Peng Li Date: Tue Oct 19 22:16:35 2021 +0800 net: hns3: disable sriov before unload hclge layer HNS3 driver includes hns3.ko, hnae3.ko and hclge.ko. hns3.ko includes network stack and pci_driver, hclge.ko includes HW device action, algo_ops and timer task, hnae3.ko includes some register function. When SRIOV is enable and hclge.ko is removed, HW device is unloaded but VF still exists, PF will not reply VF mbx messages, and cause errors. This patch fix it by disable SRIOV before remove hclge.ko. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 1385cc81baeb3bd8cbbbcdc1557f038ac1712529 Author: Yufeng Mo Date: Tue Oct 19 22:16:34 2021 +0800 net: hns3: fix vf reset workqueue cannot exit The task of VF reset is performed through the workqueue. It checks the value of hdev->reset_pending to determine whether to exit the loop. However, the value of hdev->reset_pending may also be assigned by the interrupt function hclgevf_misc_irq_handle(), which may cause the loop fail to exit and keep occupying the workqueue. This loop is not necessary, so remove it and the workqueue will be rescheduled if the reset needs to be retried or a new reset occurs. Fixes: 1cc9bc6e5867 ("net: hns3: split hclgevf_reset() into preparing and rebuilding part") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 68752b24f51a71d4f350a764d890b670f59062c5 Author: Yunsheng Lin Date: Tue Oct 19 22:16:33 2021 +0800 net: hns3: schedule the polling again when allocation fails Currently when there is a rx page allocation failure, it is possible that polling may be stopped if there is no more packet to be reveiced, which may cause queue stall problem under memory pressure. This patch makes sure polling is scheduled again when there is any rx page allocation failure, and polling will try to allocate receive buffers until it succeeds. Now the allocation retry is added, it is unnecessary to do the rx page allocation at the end of rx cleaning, so remove it. And reset the unused_count to zero after calling hns3_nic_alloc_rx_buffers() to avoid calling hns3_nic_alloc_rx_buffers() repeatedly under memory pressure. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 9f9f0f19994b42b3e5e8735d41b9c5136828a76c Author: Yunsheng Lin Date: Tue Oct 19 22:16:32 2021 +0800 net: hns3: fix for miscalculation of rx unused desc rx unused desc is the desc that need attatching new buffer before refilling to hw to receive new packet, the number of desc need attatching new buffer is calculated using next_to_use and next_to_clean. when next_to_use == next_to_clean, currently hns3 driver assumes that all the desc has the buffer attatched, but 'next_to_use == next_to_clean' also means all the desc need attatching new buffer if hw has comsumed all the desc and the driver has not attatched any buffer to the desc yet. This patch adds 'refill' in desc_cb to indicate whether a new buffer has been refilled to a desc. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit adfb7b4966c0c4c63a791f202b8b3837b07a9ece Author: Yunsheng Lin Date: Tue Oct 19 22:16:31 2021 +0800 net: hns3: fix the max tx size according to user manual Currently the max tx size supported by the hw is calculated by using the max BD num supported by the hw. According to the hw user manual, the max tx size is fixed value for both non-TSO and TSO skb. This patch updates the max tx size according to the manual. Fixes: 8ae10cfb5089("net: hns3: support tx-scatter-gather-fraglist feature") Signed-off-by: Yunsheng Lin Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 731797fdffa3d083db536e2fdd07ceb050bb40b1 Author: Guangbin Huang Date: Tue Oct 19 22:16:30 2021 +0800 net: hns3: add limit ets dwrr bandwidth cannot be 0 If ets dwrr bandwidth of tc is set to 0, the hardware will switch to SP mode. In this case, this tc may occupy all the tx bandwidth if it has huge traffic, so it violates the purpose of the user setting. To fix this problem, limit the ets dwrr bandwidth must greater than 0. Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit b63fcaab959807282e9822e659034edf95fc8bd1 Author: Guangbin Huang Date: Tue Oct 19 22:16:29 2021 +0800 net: hns3: reset DWRR of unused tc to zero Currently, DWRR of tc will be initialized to a fixed value when this tc is enabled, but it is not been reset to 0 when this tc is disabled. It cause a problem that the DWRR of unused tc is not 0 after using tc tool to add and delete multi-tc parameters. For examples, after enabling 4 TCs and restoring to 1 TC by follow tc commands: $ tc qdisc add dev eth0 root mqprio num_tc 4 map 0 1 2 3 0 1 2 3 queues \ 8@0 8@8 8@16 8@24 hw 1 mode channel $ tc qdisc del dev eth0 root Now there is just one TC is enabled for eth0, but the tc info querying by debugfs is shown as follow: $ cat /mnt/hns3/0000:7d:00.0/tm/tc_sch_info enabled tc number: 1 weight_offset: 14 TC MODE WEIGHT 0 dwrr 100 1 dwrr 100 2 dwrr 100 3 dwrr 100 4 dwrr 0 5 dwrr 0 6 dwrr 0 7 dwrr 0 This patch fixes it by resetting DWRR of tc to 0 when tc is disabled. 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 60484103d5c387df49bd60de4b16c88022747048 Author: Jiaran Zhang Date: Tue Oct 19 22:16:28 2021 +0800 net: hns3: Add configuration of TM QCN error event Add configuration of interrupt type and fifo interrupt enable of TM QCN error event if enabled, otherwise this event will not be reported when there is error. Fixes: d914971df022 ("net: hns3: remove redundant query in hclge_config_tm_hw_err_int()") Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 787252a10d9422f3058df9a4821f389e5326c440 Author: Nathan Lynch Date: Fri Oct 15 12:39:02 2021 -0500 powerpc/smp: do not decrement idle task preempt count in CPU offline With PREEMPT_COUNT=y, when a CPU is offlined and then onlined again, we get: BUG: scheduling while atomic: swapper/1/0/0x00000000 no locks held by swapper/1/0. CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.0-rc2+ #100 Call Trace: dump_stack_lvl+0xac/0x108 __schedule_bug+0xac/0xe0 __schedule+0xcf8/0x10d0 schedule_idle+0x3c/0x70 do_idle+0x2d8/0x4a0 cpu_startup_entry+0x38/0x40 start_secondary+0x2ec/0x3a0 start_secondary_prolog+0x10/0x14 This is because powerpc's arch_cpu_idle_dead() decrements the idle task's preempt count, for reasons explained in commit a7c2bb8279d2 ("powerpc: Re-enable preemption before cpu_die()"), specifically "start_secondary() expects a preempt_count() of 0." However, since commit 2c669ef6979c ("powerpc/preempt: Don't touch the idle task's preempt_count during hotplug") and commit f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled"), that justification no longer holds. The idle task isn't supposed to re-enable preemption, so remove the vestigial preempt_enable() from the CPU offline path. Tested with pseries and powernv in qemu, and pseries on PowerVM. Fixes: 2c669ef6979c ("powerpc/preempt: Don't touch the idle task's preempt_count during hotplug") Signed-off-by: Nathan Lynch Reviewed-by: Valentin Schneider Reviewed-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211015173902.2278118-1-nathanl@linux.ibm.com commit 496c5fe25c377ddb7815c4ce8ecfb676f051e9b6 Author: Michael Ellerman Date: Wed Oct 20 20:48:26 2021 +1100 powerpc/idle: Don't corrupt back chain when going idle In isa206_idle_insn_mayloss() we store various registers into the stack red zone, which is allowed. However inside the IDLE_STATE_ENTER_SEQ_NORET macro we save r2 again, to 0(r1), which corrupts the stack back chain. We used to do the same in isa206_idle_insn_mayloss() itself, but we fixed that in 73287caa9210 ("powerpc64/idle: Fix SP offsets when saving GPRs"), however we missed that the macro also corrupts the back chain. Corrupting the back chain is bad for debuggability but doesn't necessarily cause a bug. However we recently changed the stack handling in some KVM code, and it now relies on the stack back chain being valid when it returns. The corruption causes that code to return with r1 pointing somewhere in kernel data, at some point LR is restored from the stack and we branch to NULL or somewhere else invalid. Only affects Power8 hosts running KVM guests, with dynamic_mt_modes enabled (which it is by default). The fixes tag below points to the commit that changed the KVM stack handling, exposing this bug. The actual corruption of the back chain has always existed since 948cf67c4726 ("powerpc: Add NAP mode support on Power7 in HV mode"). Fixes: 9b4416c5095c ("KVM: PPC: Book3S HV: Fix stack handling in idle_kvm_start_guest()") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211020094826.3222052-1-mpe@ellerman.id.au commit 55161e67d44fdd23900be166a81e996abd6e3be9 Author: Eugene Crosser Date: Mon Oct 18 20:22:50 2021 +0200 vrf: Revert "Reset skb conntrack connection..." This reverts commit 09e856d54bda5f288ef8437a90ab2b9b3eab83d1. When an interface is enslaved in a VRF, prerouting conntrack hook is called twice: once in the context of the original input interface, and once in the context of the VRF interface. If no special precausions are taken, this leads to creation of two conntrack entries instead of one, and breaks SNAT. Commit above was intended to avoid creation of extra conntrack entries when input interface is enslaved in a VRF. It did so by resetting conntrack related data associated with the skb when it enters VRF context. However it breaks netfilter operation. Imagine a use case when conntrack zone must be assigned based on the original input interface, rather than VRF interface (that would make original interfaces indistinguishable). One could create netfilter rules similar to these: chain rawprerouting { type filter hook prerouting priority raw; iif realiface1 ct zone set 1 return iif realiface2 ct zone set 2 return } This works before the mentioned commit, but not after: zone assignment is "forgotten", and any subsequent NAT or filtering that is dependent on the conntrack zone does not work. Here is a reproducer script that demonstrates the difference in behaviour. ========== #!/bin/sh # This script demonstrates unexpected change of nftables behaviour # caused by commit 09e856d54bda5f28 ""vrf: Reset skb conntrack # connection on VRF rcv" # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=09e856d54bda5f288ef8437a90ab2b9b3eab83d1 # # Before the commit, it was possible to assign conntrack zone to a # packet (or mark it for `notracking`) in the prerouting chanin, raw # priority, based on the `iif` (interface from which the packet # arrived). # After the change, # if the interface is enslaved in a VRF, such # assignment is lost. Instead, assignment based on the `iif` matching # the VRF master interface is honored. Thus it is impossible to # distinguish packets based on the original interface. # # This script demonstrates this change of behaviour: conntrack zone 1 # or 2 is assigned depending on the match with the original interface # or the vrf master interface. It can be observed that conntrack entry # appears in different zone in the kernel versions before and after # the commit. IPIN=172.30.30.1 IPOUT=172.30.30.2 PFXL=30 ip li sh vein >/dev/null 2>&1 && ip li del vein ip li sh tvrf >/dev/null 2>&1 && ip li del tvrf nft list table testct >/dev/null 2>&1 && nft delete table testct ip li add vein type veth peer veout ip li add tvrf type vrf table 9876 ip li set veout master tvrf ip li set vein up ip li set veout up ip li set tvrf up /sbin/sysctl -w net.ipv4.conf.veout.accept_local=1 /sbin/sysctl -w net.ipv4.conf.veout.rp_filter=0 ip addr add $IPIN/$PFXL dev vein ip addr add $IPOUT/$PFXL dev veout nft -f - <<__END__ table testct { chain rawpre { type filter hook prerouting priority raw; iif { veout, tvrf } meta nftrace set 1 iif veout ct zone set 1 return iif tvrf ct zone set 2 return notrack } chain rawout { type filter hook output priority raw; notrack } } __END__ uname -rv conntrack -F ping -W 1 -c 1 -I vein $IPOUT conntrack -L Signed-off-by: Eugene Crosser Acked-by: David Ahern Signed-off-by: David S. Miller commit 0d994cd482ee4e8e851388a70869beee51be1c54 Author: Marios Makassikis Date: Tue Oct 19 17:39:38 2021 +0200 ksmbd: add buffer validation in session setup Make sure the security buffer's length/offset are valid with regards to the packet length. Acked-by: Namjae Jeon Signed-off-by: Marios Makassikis Signed-off-by: Steve French commit 621be84a9d1fbf0097fd058e249ec5cc4f35f3c5 Author: Namjae Jeon Date: Wed Oct 13 17:28:31 2021 +0900 ksmbd: throttle session setup failures to avoid dictionary attacks To avoid dictionary attacks (repeated session setups rapidly sent) to connect to server, ksmbd make a delay of a 5 seconds on session setup failure to make it harder to send enough random connection requests to break into a server if a user insert the wrong password 10 times in a row. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 34061d6b76a41b1e43c19e1e50d98e5d77f77d4e Author: Hyunchul Lee Date: Sat Oct 16 08:39:54 2021 +0900 ksmbd: validate OutputBufferLength of QUERY_DIR, QUERY_INFO, IOCTL requests Validate OutputBufferLength of QUERY_DIR, QUERY_INFO, IOCTL requests and check the free size of response buffer for these requests. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit f09f6dfef8ce7b70a240cf83811e2b1909c3e47b Author: Russ Weight Date: Mon Oct 18 17:24:01 2021 -0700 spi: altera: Change to dynamic allocation of spi id The spi-altera driver has two flavors: platform and dfl. I'm seeing a case where I have both device types in the same machine, and they are conflicting on the SPI ID: ... kernel: couldn't get idr ... kernel: WARNING: CPU: 28 PID: 912 at drivers/spi/spi.c:2920 spi_register_controller.cold+0x84/0xc0a Both the platform and dfl drivers use the parent's driver ID as the SPI ID. In the error case, the parent devices are dfl_dev.4 and subdev_spi_altera.4.auto. When the second spi-master is created, the failure occurs because the SPI ID of 4 has already been allocated. Change the ID allocation to dynamic (by initializing bus_num to -1) to avoid duplicate SPI IDs. Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20211019002401.24041-1-russell.h.weight@intel.com Signed-off-by: Mark Brown commit 2dace185caa580720c7cd67fec9efc5ee26108ac Author: Mustafa Ismail Date: Tue Oct 19 10:16:54 2021 -0500 RDMA/irdma: Do not hold qos mutex twice on QP resume When irdma_ws_add fails, irdma_ws_remove is used to cleanup the leaf node. This lead to holding the qos mutex twice in the QP resume path. Fix this by avoiding the call to irdma_ws_remove and unwinding the error in irdma_ws_add. This skips the call to irdma_tc_in_use function which is not needed in the error unwind cases. Fixes: 3ae331c75128 ("RDMA/irdma: Add QoS definitions") Link: https://lore.kernel.org/r/20211019151654.1943-2-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit cc07b73ef11d11d4359fb104d0199b22451dd3d8 Author: Mustafa Ismail Date: Tue Oct 19 10:16:53 2021 -0500 RDMA/irdma: Set VLAN in UD work completion correctly Currently VLAN is reported in UD work completion when VLAN id is zero, i.e. no VLAN case. Report VLAN in UD work completion only when VLAN id is non-zero. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20211019151654.1943-1-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 5508546631a0f555d7088203dec2614e41b5106e Author: Aharon Landau Date: Tue Oct 19 14:30:10 2021 +0300 RDMA/mlx5: Initialize the ODP xarray when creating an ODP MR Normally the zero fill would hide the missing initialization, but an errant set to desc_size in reg_create() causes a crash: BUG: unable to handle page fault for address: 0000000800000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 5 PID: 890 Comm: ib_write_bw Not tainted 5.15.0-rc4+ #47 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:mlx5_ib_dereg_mr+0x14/0x3b0 [mlx5_ib] Code: 48 63 cd 4c 89 f7 48 89 0c 24 e8 37 30 03 e1 48 8b 0c 24 eb a0 90 0f 1f 44 00 00 41 56 41 55 41 54 55 53 48 89 fb 48 83 ec 30 <48> 8b 2f 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 8b 87 c8 RSP: 0018:ffff88811afa3a60 EFLAGS: 00010286 RAX: 000000000000001c RBX: 0000000800000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000800000000 RBP: 0000000800000000 R08: 0000000000000000 R09: c0000000fffff7ff R10: ffff88811afa38f8 R11: ffff88811afa38f0 R12: ffffffffa02c7ac0 R13: 0000000000000000 R14: ffff88811afa3cd8 R15: ffff88810772fa00 FS: 00007f47b9080740(0000) GS:ffff88852cd40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000800000000 CR3: 000000010761e003 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mlx5_ib_free_odp_mr+0x95/0xc0 [mlx5_ib] mlx5_ib_dereg_mr+0x128/0x3b0 [mlx5_ib] ib_dereg_mr_user+0x45/0xb0 [ib_core] ? xas_load+0x8/0x80 destroy_hw_idr_uobject+0x1a/0x50 [ib_uverbs] uverbs_destroy_uobject+0x2f/0x150 [ib_uverbs] uobj_destroy+0x3c/0x70 [ib_uverbs] ib_uverbs_cmd_verbs+0x467/0xb00 [ib_uverbs] ? uverbs_finalize_object+0x60/0x60 [ib_uverbs] ? ttwu_queue_wakelist+0xa9/0xe0 ? pty_write+0x85/0x90 ? file_tty_write.isra.33+0x214/0x330 ? process_echoes+0x60/0x60 ib_uverbs_ioctl+0xa7/0x110 [ib_uverbs] __x64_sys_ioctl+0x10d/0x8e0 ? vfs_write+0x17f/0x260 do_syscall_64+0x3c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Add the missing xarray initialization and remove the desc_size set. Fixes: a639e66703ee ("RDMA/mlx5: Zero out ODP related items in the mlx5_ib_mr") Link: https://lore.kernel.org/r/a4846a11c9de834663e521770da895007f9f0d30.1634642730.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 60fab1076636493cfa2686e712446595fe43bc16 Author: Prabhakar Kushwaha Date: Tue Oct 19 11:22:12 2021 +0300 rdma/qedr: Fix crash due to redundant release of device's qp memory Device's QP memory should only be allocated and released by IB layer. This patch removes the redundant release of the device's qp memory and uses completion APIs to make sure that .destroy_qp() only return, when qp reference becomes 0. Fixes: 514aee660df4 ("RDMA: Globally allocate and release QP memory") Link: https://lore.kernel.org/r/20211019082212.7052-1-pkushwaha@marvell.com Acked-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: Alok Prasad Signed-off-by: Prabhakar Kushwaha Signed-off-by: Jason Gunthorpe commit bc369921d6708542eb93da33478762f1162a5805 Author: Pavel Begunkov Date: Tue Oct 19 20:31:26 2021 +0100 io-wq: max_worker fixes First, fix nr_workers checks against max_workers, with max_worker registration, it may pretty easily happen that nr_workers > max_workers. Also, synchronise writing to acct->max_worker with wqe->lock. It's not an actual problem, but as we don't care about io_wqe_create_worker(), it's better than WRITE_ONCE()/READ_ONCE(). Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers") Reported-by: Beld Zhang Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/11f90e6b49410b7d1a88f5d04fb8d95bb86b8cf3.1634671835.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ba69fd9101f20a6d05a96ab743341d4e7b1a2178 Author: Christophe JAILLET Date: Mon Oct 18 21:59:00 2021 +0200 net: dsa: Fix an error handling path in 'dsa_switch_parse_ports_of()' If we return before the end of the 'for_each_child_of_node()' iterator, the reference taken on 'port' must be released. Add the missing 'of_node_put()' calls. Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/15d5310d1d55ad51c1af80775865306d92432e03.1634587046.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit bc28368596436e6e81ffc48c815b8225d96121c0 Author: Rafael J. Wysocki Date: Fri Oct 15 19:12:21 2021 +0200 ACPI: PM: Do not turn off power resources in unknown state Commit 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources") caused power resources in unknown state with reference counters equal to zero to be turned off too, but that caused issues to appear in the field, so modify the code to only turn off power resources that are known to be "on". Link: https://lore.kernel.org/linux-acpi/6faf4b92-78d5-47a4-63df-cc2bab7769d0@molgen.mpg.de/ Fixes: 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources") Reported-by: Andreas K. Huettel Tested-by: Andreas K. Huettel Signed-off-by: Rafael J. Wysocki Cc: 5.14+ # 5.14+ commit 34dc2fd6e6908499b669c7b45320cddf38b332e1 Author: Eric W. Biederman Date: Sat Oct 16 12:47:51 2021 -0500 ucounts: Proper error handling in set_cred_ucounts Instead of leaking the ucounts in new if alloc_ucounts fails, store the result of alloc_ucounts into a temporary variable, which is later assigned to new->ucounts. Cc: stable@vger.kernel.org Fixes: 905ae01c4ae2 ("Add a reference to ucounts for each cred") Link: https://lkml.kernel.org/r/87pms2s0v8.fsf_-_@disp2133 Tested-by: Yu Zhao Reviewed-by: Alexey Gladkov Signed-off-by: "Eric W. Biederman" commit 629715adc62b0ad27ab04d0aa73a71927f886910 Author: Eric W. Biederman Date: Sat Oct 16 12:30:00 2021 -0500 ucounts: Pair inc_rlimit_ucounts with dec_rlimit_ucoutns in commit_creds The purpose of inc_rlimit_ucounts and dec_rlimit_ucounts in commit_creds is to change which rlimit counter is used to track a process when the credentials changes. Use the same test for both to guarantee the tracking is correct. Cc: stable@vger.kernel.org Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Link: https://lkml.kernel.org/r/87v91us0w4.fsf_-_@disp2133 Tested-by: Yu Zhao Reviewed-by: Alexey Gladkov Signed-off-by: "Eric W. Biederman" commit 63acd42c0d4942f74710b11c38602fb14dea7320 Author: Woody Lin Date: Tue Oct 12 16:35:21 2021 +0800 sched/scs: Reset the shadow stack when idle_task_exit Commit f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") removed the init_idle() call from idle_thread_get(). This was the sole call-path on hotplug that resets the Shadow Call Stack (scs) Stack Pointer (sp). Not resetting the scs-sp leads to scs overflow after enough hotplug cycles. Therefore add an explicit scs_task_reset() to the hotplug code to make sure the scs-sp does get reset on hotplug. Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") Signed-off-by: Woody Lin [peterz: Changelog] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20211012083521.973587-1-woodylin@google.com commit d9abdee5fd5abffd0e763e52fbfa3116de167822 Merge: 519d81956ee27 362d5dfc483c7 Author: Linus Torvalds Date: Tue Oct 19 05:41:36 2021 -1000 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "19 patches. Subsystems affected by this patch series: mm (userfaultfd, migration, memblock, mempolicy, slub, secretmem, and thp), ocfs2, binfmt, vfs, and misc" * emailed patches from Andrew Morton : mailmap: add Andrej Shadura mm/thp: decrease nr_thps in file's mapping on THP split mm/secretmem: fix NULL page->mapping dereference in page_is_secretmem() vfs: check fd has read access in kernel_read_file_from_fd() elfcore: correct reference to CONFIG_UML mm, slub: fix incorrect memcg slab count for bulk free mm, slub: fix potential use-after-free in slab_debugfs_fops mm, slub: fix potential memoryleak in kmem_cache_open() mm, slub: fix mismatch between reconstructed freelist depth and cnt mm, slub: fix two bugs in slab_debug_trace_open() mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind() memblock: check memory total_size ocfs2: mount fails with buffer overflow in strlen ocfs2: fix data corruption after conversion from inline format mm/migrate: fix CPUHP state to update node demotion order mm/migrate: add CPU hotplug to demotion #ifdef mm/migrate: optimize hotplug-time demotion order updates userfaultfd: fix a race between writeprotect and exit_mmap() mm/userfaultfd: selftests: fix memory corruption with thp enabled commit 04ee2752a5a9a715ad6dd56cc3eee3ec0bd846b4 Merge: c69b2f4687682 d674a8f123b40 Author: David S. Miller Date: Tue Oct 19 13:14:36 2021 +0100 Merge tag 'linux-can-fixes-for-5.15-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2021-10-19 this is a pull request of a single patch for net/master. The patch is by me and fixes the error handling in case of a FC timeout in the TX path of the ISOTOP CAN protocol. ==================== Signed-off-by: David S. Miller commit c69b2f46876825c726bd8a97c7fa852d8932bc32 Author: Zheyu Ma Date: Mon Oct 18 14:32:57 2021 +0000 cavium: Fix return values of the probe function During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller commit e211210098cb7490db2183d725f5c0f10463a704 Author: Zheyu Ma Date: Mon Oct 18 14:20:38 2021 +0000 mISDN: Fix return values of the probe function During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller commit 162079f2dccd02cb4b6654defd32ca387dd6d4d4 Author: Randy Dunlap Date: Sun Oct 17 10:59:49 2021 -0700 mmc: winbond: don't build on M68K The Winbond MMC driver fails to build on ARCH=m68k so prevent that build config. Silences these build errors: ../drivers/mmc/host/wbsd.c: In function 'wbsd_request_end': ../drivers/mmc/host/wbsd.c:212:28: error: implicit declaration of function 'claim_dma_lock' [-Werror=implicit-function-declaration] 212 | dmaflags = claim_dma_lock(); ../drivers/mmc/host/wbsd.c:215:17: error: implicit declaration of function 'release_dma_lock'; did you mean 'release_task'? [-Werror=implicit-function-declaration] 215 | release_dma_lock(dmaflags); Signed-off-by: Randy Dunlap Cc: Pierre Ossman Cc: Geert Uytterhoeven Cc: Arnd Bergmann Link: https://lore.kernel.org/r/20211017175949.23838-1-rdunlap@infradead.org Signed-off-by: Ulf Hansson commit 9af372dc70e9fdcbb70939dac75365e7b88580b4 Author: Haibo Chen Date: Fri Oct 15 10:00:36 2021 +0800 mmc: sdhci-esdhc-imx: clear the buffer_read_ready to reset standard tuning circuit To reset standard tuning circuit completely, after clear ESDHC_MIX_CTRL_EXE_TUNE, also need to clear bit buffer_read_ready, this operation will finally clear the USDHC IP internal logic flag execute_tuning_with_clr_buf, make sure the following normal data transfer will not be impacted by standard tuning logic used before. Find this issue when do quick SD card insert/remove stress test. During standard tuning prodedure, if remove SD card, USDHC standard tuning logic can't clear the internal flag execute_tuning_with_clr_buf. Next time when insert SD card, all data related commands can't get any data related interrupts, include data transfer complete interrupt, data timeout interrupt, data CRC interrupt, data end bit interrupt. Always trigger software timeout issue. Even reset the USDHC through bits in register SYS_CTRL (0x2C, bit28 reset tuning, bit26 reset data, bit 25 reset command, bit 24 reset all) can't recover this. From the user's point of view, USDHC stuck, SD can't be recognized any more. Fixes: d9370424c948 ("mmc: sdhci-esdhc-imx: reset tuning circuit when power on mmc card") Signed-off-by: Haibo Chen Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1634263236-6111-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 48ccc8edf5b90622cdc4f8878e0042ab5883e2ca Author: Arnd Bergmann Date: Mon Oct 18 15:30:37 2021 +0100 ARM: 9141/1: only warn about XIP address when not compile testing In randconfig builds, we sometimes come across this warning: arm-linux-gnueabi-ld: XIP start address may cause MPU programming issues While this is helpful for actual systems to figure out why it fails, the warning does not provide any benefit for build testing, so guard it in a check for CONFIG_COMPILE_TEST, which is usually set on randconfig builds. Fixes: 216218308cfb ("ARM: 8713/1: NOMMU: Support MPU in XIP configuration") Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 1f323127cab086e4fd618981b1e5edc396eaf0f4 Author: Arnd Bergmann Date: Mon Oct 18 15:30:09 2021 +0100 ARM: 9139/1: kprobes: fix arch_init_kprobes() prototype With extra warnings enabled, gcc complains about this function definition: arch/arm/probes/kprobes/core.c: In function 'arch_init_kprobes': arch/arm/probes/kprobes/core.c:465:12: warning: old-style function definition [-Wold-style-definition] 465 | int __init arch_init_kprobes() Link: https://lore.kernel.org/all/20201027093057.c685a14b386acacb3c449e3d@kernel.org/ Fixes: 24ba613c9d6c ("ARM kprobes: core code") Acked-by: Masami Hiramatsu Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 44cc6412e66b2b84544eaf2e14cf1764301e2a80 Author: Arnd Bergmann Date: Mon Oct 18 15:30:08 2021 +0100 ARM: 9138/1: fix link warning with XIP + frame-pointer When frame pointers are used instead of the ARM unwinder, and the kernel is built using clang with an external assembler and CONFIG_XIP_KERNEL, every file produces two warnings like: arm-linux-gnueabi-ld: warning: orphan section `.ARM.extab' from `net/mac802154/util.o' being placed in section `.ARM.extab' arm-linux-gnueabi-ld: warning: orphan section `.ARM.exidx' from `net/mac802154/util.o' being placed in section `.ARM.exidx' The same fix was already merged for the normal (non-XIP) linker script, with a longer description. Fixes: c39866f268f8 ("arm/build: Always handle .ARM.exidx and .ARM.extab sections") Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit eaf6cc7165c9c5aa3c2f9faa03a98598123d0afb Author: Arnd Bergmann Date: Mon Oct 18 15:30:04 2021 +0100 ARM: 9134/1: remove duplicate memcpy() definition Both the decompressor code and the kasan logic try to override the memcpy() and memmove() definitions, which leading to a clash in a KASAN-enabled kernel with XZ decompression: arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined] #define memmove memmove ^ arch/arm/include/asm/string.h:59:9: note: previous definition is here #define memmove(dst, src, len) __memmove(dst, src, len) ^ arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined] #define memcpy memcpy ^ arch/arm/include/asm/string.h:58:9: note: previous definition is here #define memcpy(dst, src, len) __memcpy(dst, src, len) ^ Here we want the set of functions from the decompressor, so undefine the other macros before the override. Link: https://lore.kernel.org/linux-arm-kernel/CACRpkdZYJogU_SN3H9oeVq=zJkRgRT1gDz3xp59gdqWXxw-B=w@mail.gmail.com/ Link: https://lore.kernel.org/lkml/202105091112.F5rmd4By-lkp@intel.com/ Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan") Fixes: a7f464f3db93 ("ARM: 7001/2: Wire up support for the XZ decompressor") Reported-by: kernel test robot Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit e6a0c958bdf9b2e1b57501fc9433a461f0a6aadd Author: Nick Desaulniers Date: Mon Oct 4 18:03:28 2021 +0100 ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned A kernel built with CONFIG_THUMB2_KERNEL=y and using clang as the assembler could generate non-naturally-aligned v7wbi_tlb_fns which results in a boot failure. The original commit adding the macro missed the .align directive on this data. Link: https://github.com/ClangBuiltLinux/linux/issues/1447 Link: https://lore.kernel.org/all/0699da7b-354f-aecc-a62f-e25693209af4@linaro.org/ Debugged-by: Ard Biesheuvel Debugged-by: Nathan Chancellor Debugged-by: Richard Henderson Fixes: 66a625a88174 ("ARM: mm: proc-macros: Add generic proc/cache/tlb struct definition macros") Suggested-by: Ard Biesheuvel Acked-by: Ard Biesheuvel Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor Signed-off-by: Russell King (Oracle) commit df909df0770779f1a5560c2bb641a2809655ef28 Author: Lexi Shao Date: Thu Sep 23 03:41:25 2021 +0100 ARM: 9132/1: Fix __get_user_check failure with ARM KASAN images ARM: kasan: Fix __get_user_check failure with kasan In macro __get_user_check defined in arch/arm/include/asm/uaccess.h, error code is store in register int __e(r0). When kasan is enabled, assigning value to kernel address might trigger kasan check, which unexpectedly overwrites r0 and causes undefined behavior on arm kasan images. One example is failure in do_futex and results in process soft lockup. Log: watchdog: BUG: soft lockup - CPU#0 stuck for 62946ms! [rs:main Q:Reg:1151] ... (__asan_store4) from (futex_wait_setup+0xf8/0x2b4) (futex_wait_setup) from (futex_wait+0x138/0x394) (futex_wait) from (do_futex+0x164/0xe40) (do_futex) from (sys_futex_time32+0x178/0x230) (sys_futex_time32) from (ret_fast_syscall+0x0/0x50) The soft lockup happens in function futex_wait_setup. The reason is function get_futex_value_locked always return EINVAL, thus pc jump back to retry label and causes looping. This line in function get_futex_value_locked ret = __get_user(*dest, from); is expanded to *dest = (typeof(*(p))) __r2; , in macro __get_user_check. Writing to pointer dest triggers kasan check and overwrites the return value of __get_user_x function. The assembly code of get_futex_value_locked in kernel/futex.c: ... c01f6dc8: eb0b020e bl c04b7608 <__get_user_4> // "x = (typeof(*(p))) __r2;" triggers kasan check and r0 is overwritten c01f6dCc: e1a00007 mov r0, r7 c01f6dd0: e1a05002 mov r5, r2 c01f6dd4: eb04f1e6 bl c0333574 <__asan_store4> c01f6dd8: e5875000 str r5, [r7] // save ret value of __get_user(*dest, from), which is dest address now c01f6ddc: e1a05000 mov r5, r0 ... // checking return value of __get_user failed c01f6e00: e3550000 cmp r5, #0 ... c01f6e0c: 01a00005 moveq r0, r5 // assign return value to EINVAL c01f6e10: 13e0000d mvnne r0, #13 Return value is the destination address of get_user thus certainly non-zero, so get_futex_value_locked always return EINVAL. Fix it by using a tmp vairable to store the error code before the assignment. This fix has no effects to non-kasan images thanks to compiler optimization. It only affects cases that overwrite r0 due to kasan check. This should fix bug discussed in Link: [1] https://lore.kernel.org/linux-arm-kernel/0ef7c2a5-5d8b-c5e0-63fa-31693fd4495c@gmail.com/ Fixes: 421015713b30 ("ARM: 9017/2: Enable KASan for ARM") Signed-off-by: Lexi Shao Signed-off-by: Russell King (Oracle) commit 00d43d13da6c3424101aebabefab9e97e6318bee Author: Ard Biesheuvel Date: Tue Sep 21 15:31:23 2021 +0100 ARM: 9125/1: fix incorrect use of get_kernel_nofault() Commit 344179fc7ef4 ("ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs()") replaced an occurrence of __get_user() with get_kernel_nofault(), but inverted the sense of the conditional in the process, resulting in no values to be printed at all. I.e., every exception stack now looks like this: Exception stack(0xc18d1fb0 to 0xc18d1ff8) 1fa0: ???????? ???????? ???????? ???????? 1fc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? 1fe0: ???????? ???????? ???????? ???????? ???????? ???????? which is rather unhelpful. Fixes: 344179fc7ef4 ("ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs()") Signed-off-by: Ard Biesheuvel Reviewed-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 9d417cbe36eee7afdd85c2e871685f8dab7c2dba Author: Nick Desaulniers Date: Wed Sep 8 19:25:59 2021 +0100 ARM: 9122/1: select HAVE_FUTEX_CMPXCHG tglx notes: This function [futex_detect_cmpxchg] is only needed when an architecture has to runtime discover whether the CPU supports it or not. ARM has unconditional support for this, so the obvious thing to do is the below. Fixes linkage failure from Clang randconfigs: kernel/futex.o:(.text.fixup+0x5c): relocation truncated to fit: R_ARM_JUMP24 against `.init.text' and boot failures for CONFIG_THUMB2_KERNEL. Link: https://github.com/ClangBuiltLinux/linux/issues/325 Comments from Nick Desaulniers: See-also: 03b8c7b623c8 ("futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test") Reported-by: Arnd Bergmann Reported-by: Nathan Chancellor Suggested-by: Thomas Gleixner Signed-off-by: Nick Desaulniers Reviewed-by: Thomas Gleixner Tested-by: Nathan Chancellor Reviewed-by: Linus Walleij Cc: stable@vger.kernel.org # v3.14+ Reviewed-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 59be177a909ac320e5f4b2a461ac09e20f35b2d8 Author: José Roberto de Souza Date: Tue Oct 12 18:00:46 2021 -0700 drm/i915: Remove memory frequency calculation This memory frequency calculated is only used to check if it is zero, what is not useful as it will never actually be zero. Also the calculation is wrong, we should be checking other bit to select the appropriate frequency multiplier while this code is stuck with a fixed multiplier. So here dropping it as whole. v2: - Also remove memory frequency calculation for gen9 LP platforms Cc: Yakui Zhao Cc: Matt Roper Fixes: 5d0c938ec9cc ("drm/i915/gen11+: Only load DRAM information from pcode") Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211013010046.91858-1-jose.souza@intel.com (cherry picked from commit 83f52364b15265aec47d07e02b0fbf4093ab8554) Signed-off-by: Jani Nikula commit 1bd85aa65d0e7b5e4d09240f492f37c569fdd431 Author: Jeff Layton Date: Thu Oct 7 14:19:49 2021 -0400 ceph: fix handling of "meta" errors Currently, we check the wb_err too early for directories, before all of the unsafe child requests have been waited on. In order to fix that we need to check the mapping->wb_err later nearer to the end of ceph_fsync. We also have an overly-complex method for tracking errors after blocklisting. The errors recorded in cleanup_session_requests go to a completely separate field in the inode, but we end up reporting them the same way we would for any other error (in fsync). There's no real benefit to tracking these errors in two different places, since the only reporting mechanism for them is in fsync, and we'd need to advance them both every time. Given that, we can just remove i_meta_err, and convert the places that used it to instead just use mapping->wb_err instead. That also fixes the original problem by ensuring that we do a check_and_advance of the wb_err at the end of the fsync op. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/52864 Reported-by: Patrick Donnelly Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 98d0a6fb7303a6f4a120b8b8ed05b86ff5db53e8 Author: Jeff Layton Date: Thu Sep 30 08:33:13 2021 -0400 ceph: skip existing superblocks that are blocklisted or shut down when mounting Currently when mounting, we may end up finding an existing superblock that corresponds to a blocklisted MDS client. This means that the new mount ends up being unusable. If we've found an existing superblock with a client that is already blocklisted, and the client is not configured to recover on its own, fail the match. Ditto if the superblock has been forcibly unmounted. While we're in here, also rename "other" to the more conventional "fsc". Cc: stable@vger.kernel.org URL: https://bugzilla.redhat.com/show_bug.cgi?id=1901499 Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit d674a8f123b4096d85955c7eaabec688f29724c9 Author: Marc Kleine-Budde Date: Fri May 7 11:18:39 2021 +0200 can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path When the a large chunk of data send and the receiver does not send a Flow Control frame back in time, the sendmsg() does not return a error code, but the number of bytes sent corresponding to the size of the packet. If a timeout occurs the isotp_tx_timer_handler() is fired, sets sk->sk_err and calls the sk->sk_error_report() function. It was wrongly expected that the error would be propagated to user space in every case. For isotp_sendmsg() blocking on wait_event_interruptible() this is not the case. This patch fixes the problem by checking if sk->sk_err is set and returning the error to user space. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://github.com/hartkopp/can-isotp/issues/42 Link: https://github.com/hartkopp/can-isotp/pull/43 Link: https://lore.kernel.org/all/20210507091839.1366379-1-mkl@pengutronix.de Cc: stable@vger.kernel.org Reported-by: Sottas Guillaume (LMB) Tested-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 362d5dfc483c7786bcfff27ff48e7b6f493f7c5a Author: Andrej Shadura Date: Mon Oct 18 15:16:22 2021 -0700 mailmap: add Andrej Shadura Add a mapping for my old work email for BelDisplayTech to the personal email, and make sure the Collabora email has the correct spelling of the first name. Link: https://lkml.kernel.org/r/20210917091016.30232-1-andrew.shadura@collabora.co.uk Signed-off-by: Andrej Shadura Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1ca7554d05ac038c98271f8968ed821266ecaa9c Author: Marek Szyprowski Date: Mon Oct 18 15:16:19 2021 -0700 mm/thp: decrease nr_thps in file's mapping on THP split Decrease nr_thps counter in file's mapping to ensure that the page cache won't be dropped excessively on file write access if page has been already split. I've tried a test scenario running a big binary, kernel remaps it with THPs, then force a THP split with /sys/kernel/debug/split_huge_pages. During any further open of that binary with O_RDWR or O_WRITEONLY kernel drops page cache for it, because of non-zero thps counter. Link: https://lkml.kernel.org/r/20211012120237.2600-1-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Fixes: 09d91cda0e82 ("mm,thp: avoid writes to file with THP in pagecache") Fixes: 06d3eff62d9d ("mm/thp: fix node page state in split_huge_page_to_list()") Acked-by: Matthew Wilcox (Oracle) Reviewed-by: Yang Shi Cc: Cc: Song Liu Cc: Rik van Riel Cc: "Kirill A . Shutemov" Cc: Johannes Weiner Cc: Hillf Danton Cc: Hugh Dickins Cc: William Kucharski Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79f9bc5843142b649575f887dccdf1c07ad75c20 Author: Sean Christopherson Date: Mon Oct 18 15:16:16 2021 -0700 mm/secretmem: fix NULL page->mapping dereference in page_is_secretmem() Check for a NULL page->mapping before dereferencing the mapping in page_is_secretmem(), as the page's mapping can be nullified while gup() is running, e.g. by reclaim or truncation. BUG: kernel NULL pointer dereference, address: 0000000000000068 #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: 6 PID: 4173897 Comm: CPU 3/KVM Tainted: G W RIP: 0010:internal_get_user_pages_fast+0x621/0x9d0 Code: <48> 81 7a 68 80 08 04 bc 0f 85 21 ff ff 8 89 c7 be RSP: 0018:ffffaa90087679b0 EFLAGS: 00010046 RAX: ffffe3f37905b900 RBX: 00007f2dd561e000 RCX: ffffe3f37905b934 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffe3f37905b900 ... CR2: 0000000000000068 CR3: 00000004c5898003 CR4: 00000000001726e0 Call Trace: get_user_pages_fast_only+0x13/0x20 hva_to_pfn+0xa9/0x3e0 try_async_pf+0xa1/0x270 direct_page_fault+0x113/0xad0 kvm_mmu_page_fault+0x69/0x680 vmx_handle_exit+0xe1/0x5d0 kvm_arch_vcpu_ioctl_run+0xd81/0x1c70 kvm_vcpu_ioctl+0x267/0x670 __x64_sys_ioctl+0x83/0xa0 do_syscall_64+0x56/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Link: https://lkml.kernel.org/r/20211007231502.3552715-1-seanjc@google.com Fixes: 1507f51255c9 ("mm: introduce memfd_secret system call to create "secret" memory areas") Signed-off-by: Sean Christopherson Reported-by: Darrick J. Wong Reported-by: Stephen Tested-by: Darrick J. Wong Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 032146cda85566abcd1c4884d9d23e4e30a07e9a Author: Matthew Wilcox (Oracle) Date: Mon Oct 18 15:16:12 2021 -0700 vfs: check fd has read access in kernel_read_file_from_fd() If we open a file without read access and then pass the fd to a syscall whose implementation calls kernel_read_file_from_fd(), we get a warning from __kernel_read(): if (WARN_ON_ONCE(!(file->f_mode & FMODE_READ))) This currently affects both finit_module() and kexec_file_load(), but it could affect other syscalls in the future. Link: https://lkml.kernel.org/r/20211007220110.600005-1-willy@infradead.org Fixes: b844f0ecbc56 ("vfs: define kernel_copy_file_from_fd()") Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Hao Sun Reviewed-by: Kees Cook Acked-by: Christian Brauner Cc: Al Viro Cc: Mimi Zohar Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b0e901280d9860a0a35055f220e8e457f300f40a Author: Lukas Bulwahn Date: Mon Oct 18 15:16:09 2021 -0700 elfcore: correct reference to CONFIG_UML Commit 6e7b64b9dd6d ("elfcore: fix building with clang") introduces special handling for two architectures, ia64 and User Mode Linux. However, the wrong name, i.e., CONFIG_UM, for the intended Kconfig symbol for User-Mode Linux was used. Although the directory for User Mode Linux is ./arch/um; the Kconfig symbol for this architecture is called CONFIG_UML. Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs: UM Referencing files: include/linux/elfcore.h Similar symbols: UML, NUMA Correct the name of the config to the intended one. [akpm@linux-foundation.org: fix um/x86_64, per Catalin] Link: https://lkml.kernel.org/r/20211006181119.2851441-1-catalin.marinas@arm.com Link: https://lkml.kernel.org/r/YV6pejGzLy5ppEpt@arm.com Link: https://lkml.kernel.org/r/20211006082209.417-1-lukas.bulwahn@gmail.com Fixes: 6e7b64b9dd6d ("elfcore: fix building with clang") Signed-off-by: Lukas Bulwahn Cc: Arnd Bergmann Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Catalin Marinas Cc: Barret Rhoden Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3ddd60268c24bcac9d744404cc277e9dc52fe6b6 Author: Miaohe Lin Date: Mon Oct 18 15:16:06 2021 -0700 mm, slub: fix incorrect memcg slab count for bulk free kmem_cache_free_bulk() will call memcg_slab_free_hook() for all objects when doing bulk free. So we shouldn't call memcg_slab_free_hook() again for bulk free to avoid incorrect memcg slab count. Link: https://lkml.kernel.org/r/20210916123920.48704-6-linmiaohe@huawei.com Fixes: d1b2cf6cb84a ("mm: memcg/slab: uncharge during kmem_cache_free_bulk()") Signed-off-by: Miaohe Lin Reviewed-by: Vlastimil Babka Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Bharata B Rao Cc: Christoph Lameter Cc: David Rientjes Cc: Faiyaz Mohammed Cc: Greg Kroah-Hartman Cc: Joonsoo Kim Cc: Kees Cook Cc: Pekka Enberg Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 67823a544414def2a36c212abadb55b23bcda00c Author: Miaohe Lin Date: Mon Oct 18 15:16:02 2021 -0700 mm, slub: fix potential use-after-free in slab_debugfs_fops When sysfs_slab_add failed, we shouldn't call debugfs_slab_add() for s because s will be freed soon. And slab_debugfs_fops will use s later leading to a use-after-free. Link: https://lkml.kernel.org/r/20210916123920.48704-5-linmiaohe@huawei.com Fixes: 64dd68497be7 ("mm: slub: move sysfs slab alloc/free interfaces to debugfs") Signed-off-by: Miaohe Lin Reviewed-by: Vlastimil Babka Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Bharata B Rao Cc: Christoph Lameter Cc: David Rientjes Cc: Faiyaz Mohammed Cc: Greg Kroah-Hartman Cc: Joonsoo Kim Cc: Kees Cook Cc: Pekka Enberg Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9037c57681d25e4dcc442d940d6dbe24dd31f461 Author: Miaohe Lin Date: Mon Oct 18 15:15:59 2021 -0700 mm, slub: fix potential memoryleak in kmem_cache_open() In error path, the random_seq of slub cache might be leaked. Fix this by using __kmem_cache_release() to release all the relevant resources. Link: https://lkml.kernel.org/r/20210916123920.48704-4-linmiaohe@huawei.com Fixes: 210e7a43fa90 ("mm: SLUB freelist randomization") Signed-off-by: Miaohe Lin Reviewed-by: Vlastimil Babka Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Bharata B Rao Cc: Christoph Lameter Cc: David Rientjes Cc: Faiyaz Mohammed Cc: Greg Kroah-Hartman Cc: Joonsoo Kim Cc: Kees Cook Cc: Pekka Enberg Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 899447f669da76cc3605665e1a95ee877bc464cc Author: Miaohe Lin Date: Mon Oct 18 15:15:55 2021 -0700 mm, slub: fix mismatch between reconstructed freelist depth and cnt If object's reuse is delayed, it will be excluded from the reconstructed freelist. But we forgot to adjust the cnt accordingly. So there will be a mismatch between reconstructed freelist depth and cnt. This will lead to free_debug_processing() complaining about freelist count or a incorrect slub inuse count. Link: https://lkml.kernel.org/r/20210916123920.48704-3-linmiaohe@huawei.com Fixes: c3895391df38 ("kasan, slub: fix handling of kasan_slab_free hook") Signed-off-by: Miaohe Lin Reviewed-by: Vlastimil Babka Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Bharata B Rao Cc: Christoph Lameter Cc: David Rientjes Cc: Faiyaz Mohammed Cc: Greg Kroah-Hartman Cc: Joonsoo Kim Cc: Kees Cook Cc: Pekka Enberg Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2127d22509aec3a83dffb2a3c736df7ba747a7ce Author: Miaohe Lin Date: Mon Oct 18 15:15:52 2021 -0700 mm, slub: fix two bugs in slab_debug_trace_open() Patch series "Fixups for slub". This series contains various bug fixes for slub. We fix memoryleak, use-afer-free, NULL pointer dereferencing and so on in slub. More details can be found in the respective changelogs. This patch (of 5): It's possible that __seq_open_private() will return NULL. So we should check it before using lest dereferencing NULL pointer. And in error paths, we forgot to release private buffer via seq_release_private(). Memory will leak in these paths. Link: https://lkml.kernel.org/r/20210916123920.48704-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210916123920.48704-2-linmiaohe@huawei.com Fixes: 64dd68497be7 ("mm: slub: move sysfs slab alloc/free interfaces to debugfs") Signed-off-by: Miaohe Lin Reviewed-by: Vlastimil Babka Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Greg Kroah-Hartman Cc: Faiyaz Mohammed Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Kees Cook Cc: Bharata B Rao Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c Author: Eric Dumazet Date: Mon Oct 18 15:15:49 2021 -0700 mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind() syzbot reported access to unitialized memory in mbind() [1] Issue came with commit bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes") This commit added a new bit in MPOL_MODE_FLAGS, but only checked valid combination (MPOL_F_NUMA_BALANCING can only be used with MPOL_BIND) in do_set_mempolicy() This patch moves the check in sanitize_mpol_flags() so that it is also used by mbind() [1] BUG: KMSAN: uninit-value in __mpol_equal+0x567/0x590 mm/mempolicy.c:2260 __mpol_equal+0x567/0x590 mm/mempolicy.c:2260 mpol_equal include/linux/mempolicy.h:105 [inline] vma_merge+0x4a1/0x1e60 mm/mmap.c:1190 mbind_range+0xcc8/0x1e80 mm/mempolicy.c:811 do_mbind+0xf42/0x15f0 mm/mempolicy.c:1333 kernel_mbind mm/mempolicy.c:1483 [inline] __do_sys_mbind mm/mempolicy.c:1490 [inline] __se_sys_mbind+0x437/0xb80 mm/mempolicy.c:1486 __x64_sys_mbind+0x19d/0x200 mm/mempolicy.c:1486 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_alloc_node mm/slub.c:3221 [inline] slab_alloc mm/slub.c:3230 [inline] kmem_cache_alloc+0x751/0xff0 mm/slub.c:3235 mpol_new mm/mempolicy.c:293 [inline] do_mbind+0x912/0x15f0 mm/mempolicy.c:1289 kernel_mbind mm/mempolicy.c:1483 [inline] __do_sys_mbind mm/mempolicy.c:1490 [inline] __se_sys_mbind+0x437/0xb80 mm/mempolicy.c:1486 __x64_sys_mbind+0x19d/0x200 mm/mempolicy.c:1486 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 ===================================================== Kernel panic - not syncing: panic_on_kmsan set ... CPU: 0 PID: 15049 Comm: syz-executor.0 Tainted: G B 5.15.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+0x1ff/0x28e lib/dump_stack.c:106 dump_stack+0x25/0x28 lib/dump_stack.c:113 panic+0x44f/0xdeb kernel/panic.c:232 kmsan_report+0x2ee/0x300 mm/kmsan/report.c:186 __msan_warning+0xd7/0x150 mm/kmsan/instrumentation.c:208 __mpol_equal+0x567/0x590 mm/mempolicy.c:2260 mpol_equal include/linux/mempolicy.h:105 [inline] vma_merge+0x4a1/0x1e60 mm/mmap.c:1190 mbind_range+0xcc8/0x1e80 mm/mempolicy.c:811 do_mbind+0xf42/0x15f0 mm/mempolicy.c:1333 kernel_mbind mm/mempolicy.c:1483 [inline] __do_sys_mbind mm/mempolicy.c:1490 [inline] __se_sys_mbind+0x437/0xb80 mm/mempolicy.c:1486 __x64_sys_mbind+0x19d/0x200 mm/mempolicy.c:1486 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 Link: https://lkml.kernel.org/r/20211001215630.810592-1-eric.dumazet@gmail.com Fixes: bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Mel Gorman Cc: "Huang, Ying" Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5173ed72bcfcddda21ff274ee31c6472fa150f29 Author: Peng Fan Date: Mon Oct 18 15:15:45 2021 -0700 memblock: check memory total_size mem=[X][G|M] is broken on ARM64 platform, there are cases that even type.cnt is 1, but total_size is not 0 because regions are merged into 1. So only check 'cnt' is not enough, total_size should be used, othersize bootargs 'mem=[X][G|B]' not work anymore. Link: https://lkml.kernel.org/r/20210930024437.32598-1-peng.fan@oss.nxp.com Fixes: e888fa7bb882 ("memblock: Check memory add/cap ordering") Signed-off-by: Peng Fan Reviewed-by: Mike Rapoport Cc: Geert Uytterhoeven Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b15fa9224e6e1239414525d8d556d824701849fc Author: Valentin Vidic Date: Mon Oct 18 15:15:42 2021 -0700 ocfs2: mount fails with buffer overflow in strlen Starting with kernel 5.11 built with CONFIG_FORTIFY_SOURCE mouting an ocfs2 filesystem with either o2cb or pcmk cluster stack fails with the trace below. Problem seems to be that strings for cluster stack and cluster name are not guaranteed to be null terminated in the disk representation, while strlcpy assumes that the source string is always null terminated. This causes a read outside of the source string triggering the buffer overflow detection. detected buffer overflow in strlen ------------[ cut here ]------------ kernel BUG at lib/string.c:1149! invalid opcode: 0000 [#1] SMP PTI CPU: 1 PID: 910 Comm: mount.ocfs2 Not tainted 5.14.0-1-amd64 #1 Debian 5.14.6-2 RIP: 0010:fortify_panic+0xf/0x11 ... Call Trace: ocfs2_initialize_super.isra.0.cold+0xc/0x18 [ocfs2] ocfs2_fill_super+0x359/0x19b0 [ocfs2] mount_bdev+0x185/0x1b0 legacy_get_tree+0x27/0x40 vfs_get_tree+0x25/0xb0 path_mount+0x454/0xa20 __x64_sys_mount+0x103/0x140 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Link: https://lkml.kernel.org/r/20210929180654.32460-1-vvidic@valentin-vidic.from.hr Signed-off-by: Valentin Vidic Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5314454ea3ff6fc746eaf71b9a7ceebed52888fa Author: Jan Kara Date: Mon Oct 18 15:15:39 2021 -0700 ocfs2: fix data corruption after conversion from inline format Commit 6dbf7bb55598 ("fs: Don't invalidate page buffers in block_write_full_page()") uncovered a latent bug in ocfs2 conversion from inline inode format to a normal inode format. The code in ocfs2_convert_inline_data_to_extents() attempts to zero out the whole cluster allocated for file data by grabbing, zeroing, and dirtying all pages covering this cluster. However these pages are beyond i_size, thus writeback code generally ignores these dirty pages and no blocks were ever actually zeroed on the disk. This oversight was fixed by commit 693c241a5f6a ("ocfs2: No need to zero pages past i_size.") for standard ocfs2 write path, inline conversion path was apparently forgotten; the commit log also has a reasoning why the zeroing actually is not needed. After commit 6dbf7bb55598, things became worse as writeback code stopped invalidating buffers on pages beyond i_size and thus these pages end up with clean PageDirty bit but with buffers attached to these pages being still dirty. So when a file is converted from inline format, then writeback triggers, and then the file is grown so that these pages become valid, the invalid dirtiness state is preserved, mark_buffer_dirty() does nothing on these pages (buffers are already dirty) but page is never written back because it is clean. So data written to these pages is lost once pages are reclaimed. Simple reproducer for the problem is: xfs_io -f -c "pwrite 0 2000" -c "pwrite 2000 2000" -c "fsync" \ -c "pwrite 4000 2000" ocfs2_file After unmounting and mounting the fs again, you can observe that end of 'ocfs2_file' has lost its contents. Fix the problem by not doing the pointless zeroing during conversion from inline format similarly as in the standard write path. [akpm@linux-foundation.org: fix whitespace, per Joseph] Link: https://lkml.kernel.org/r/20210930095405.21433-1-jack@suse.cz Fixes: 6dbf7bb55598 ("fs: Don't invalidate page buffers in block_write_full_page()") Signed-off-by: Jan Kara Reviewed-by: Joseph Qi Tested-by: Joseph Qi Acked-by: Gang He Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Cc: "Markov, Andrey" Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a6a0251c6fce496744121b4e08c899f45270dbcc Author: Huang Ying Date: Mon Oct 18 15:15:35 2021 -0700 mm/migrate: fix CPUHP state to update node demotion order The node demotion order needs to be updated during CPU hotplug. Because whether a NUMA node has CPU may influence the demotion order. The update function should be called during CPU online/offline after the node_states[N_CPU] has been updated. That is done in CPUHP_AP_ONLINE_DYN during CPU online and in CPUHP_MM_VMSTAT_DEAD during CPU offline. But in commit 884a6e5d1f93 ("mm/migrate: update node demotion order on hotplug events"), the function to update node demotion order is called in CPUHP_AP_ONLINE_DYN during CPU online/offline. This doesn't satisfy the order requirement. For example, there are 4 CPUs (P0, P1, P2, P3) in 2 sockets (P0, P1 in S0 and P2, P3 in S1), the demotion order is - S0 -> NUMA_NO_NODE - S1 -> NUMA_NO_NODE After P2 and P3 is offlined, because S1 has no CPU now, the demotion order should have been changed to - S0 -> S1 - S1 -> NO_NODE but it isn't changed, because the order updating callback for CPU hotplug doesn't see the new nodemask. After that, if P1 is offlined, the demotion order is changed to the expected order as above. So in this patch, we added CPUHP_AP_MM_DEMOTION_ONLINE and CPUHP_MM_DEMOTION_DEAD to be called after CPUHP_AP_ONLINE_DYN and CPUHP_MM_VMSTAT_DEAD during CPU online and offline, and register the update function on them. Link: https://lkml.kernel.org/r/20210929060351.7293-1-ying.huang@intel.com Fixes: 884a6e5d1f93 ("mm/migrate: update node demotion order on hotplug events") Signed-off-by: "Huang, Ying" Cc: Thomas Gleixner Cc: Dave Hansen Cc: Yang Shi Cc: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 76af6a054da4055305ddb28c5eb151b9ee4f74f9 Author: Dave Hansen Date: Mon Oct 18 15:15:32 2021 -0700 mm/migrate: add CPU hotplug to demotion #ifdef Once upon a time, the node demotion updates were driven solely by memory hotplug events. But now, there are handlers for both CPU and memory hotplug. However, the #ifdef around the code checks only memory hotplug. A system that has HOTPLUG_CPU=y but MEMORY_HOTPLUG=n would miss CPU hotplug events. Update the #ifdef around the common code. Add memory and CPU-specific #ifdefs for their handlers. These memory/CPU #ifdefs avoid unused function warnings when their Kconfig option is off. [arnd@arndb.de: rework hotplug_memory_notifier() stub] Link: https://lkml.kernel.org/r/20211013144029.2154629-1-arnd@kernel.org Link: https://lkml.kernel.org/r/20210924161255.E5FE8F7E@davehans-spike.ostc.intel.com Fixes: 884a6e5d1f93 ("mm/migrate: update node demotion order on hotplug events") Signed-off-by: Dave Hansen Signed-off-by: Arnd Bergmann Cc: "Huang, Ying" Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 295be91f7ef0027fca2f2e4788e99731aa931834 Author: Dave Hansen Date: Mon Oct 18 15:15:29 2021 -0700 mm/migrate: optimize hotplug-time demotion order updates Patch series "mm/migrate: 5.15 fixes for automatic demotion", v2. This contains two fixes for the "automatic demotion" code which was merged into 5.15: * Fix memory hotplug performance regression by watching suppressing any real action on irrelevant hotplug events. * Ensure CPU hotplug handler is registered when memory hotplug is disabled. This patch (of 2): == tl;dr == Automatic demotion opted for a simple, lazy approach to handling hotplug events. This noticeably slows down memory hotplug[1]. Optimize away updates to the demotion order when memory hotplug events should have no effect. This has no effect on CPU hotplug. There is no known problem on the CPU side and any work there will be in a separate series. == Background == Automatic demotion is a memory migration strategy to ensure that new allocations have room in faster memory tiers on tiered memory systems. The kernel maintains an array (node_demotion[]) to drive these migrations. The node_demotion[] path is calculated by starting at nodes with CPUs and then "walking" to nodes with memory. Only hotplug events which online or offline a node with memory (N_ONLINE) or CPUs (N_CPU) will actually affect the migration order. == Problem == However, the current code is lazy. It completely regenerates the migration order on *any* CPU or memory hotplug event. The logic was that these events are extremely rare and that the overhead from indiscriminate order regeneration is minimal. Part of the update logic involves a synchronize_rcu(), which is a pretty big hammer. Its overhead was large enough to be detected by some 0day tests that watch memory hotplug performance[1]. == Solution == Add a new helper (node_demotion_topo_changed()) which can differentiate between superfluous and impactful hotplug events. Skip the expensive update operation for superfluous events. == Aside: Locking == It took me a few moments to declare the locking to be safe enough for node_demotion_topo_changed() to work. It all hinges on the memory hotplug lock: During memory hotplug events, 'mem_hotplug_lock' is held for write. This ensures that two memory hotplug events can not be called simultaneously. CPU hotplug has a similar lock (cpuhp_state_mutex) which also provides mutual exclusion between CPU hotplug events. In addition, the demotion code acquire and hold the mem_hotplug_lock for read during its CPU hotplug handlers. This provides mutual exclusion between the demotion memory hotplug callbacks and the CPU hotplug callbacks. This effectively allows treating the migration target generation code to act as if it is single-threaded. 1. https://lore.kernel.org/all/20210905135932.GE15026@xsang-OptiPlex-9020/ Link: https://lkml.kernel.org/r/20210924161251.093CCD06@davehans-spike.ostc.intel.com Link: https://lkml.kernel.org/r/20210924161253.D7673E31@davehans-spike.ostc.intel.com Fixes: 884a6e5d1f93 ("mm/migrate: update node demotion order on hotplug events") Signed-off-by: Dave Hansen Reported-by: kernel test robot Reviewed-by: David Hildenbrand Cc: "Huang, Ying" Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: Greg Thelen Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cb185d5f1ebf900f4ae3bf84cee212e6dd035aca Author: Nadav Amit Date: Mon Oct 18 15:15:25 2021 -0700 userfaultfd: fix a race between writeprotect and exit_mmap() A race is possible when a process exits, its VMAs are removed by exit_mmap() and at the same time userfaultfd_writeprotect() is called. The race was detected by KASAN on a development kernel, but it appears to be possible on vanilla kernels as well. Use mmget_not_zero() to prevent the race as done in other userfaultfd operations. Link: https://lkml.kernel.org/r/20210921200247.25749-1-namit@vmware.com Fixes: 63b2d4174c4ad ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl") Signed-off-by: Nadav Amit Tested-by: Li Wang Reviewed-by: Peter Xu Cc: Andrea Arcangeli Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8913970c19915bbe773d97d42989cd85b7fdc098 Author: Peter Xu Date: Mon Oct 18 15:15:22 2021 -0700 mm/userfaultfd: selftests: fix memory corruption with thp enabled In RHEL's gating selftests we've encountered memory corruption in the uffd event test even with upstream kernel: # ./userfaultfd anon 128 4 nr_pages: 32768, nr_pages_per_cpu: 32768 bounces: 3, mode: rnd racing read, userfaults: 6240 missing (6240) 14729 wp (14729) bounces: 2, mode: racing read, userfaults: 1444 missing (1444) 28877 wp (28877) bounces: 1, mode: rnd read, userfaults: 6055 missing (6055) 14699 wp (14699) bounces: 0, mode: read, userfaults: 82 missing (82) 25196 wp (25196) testing uffd-wp with pagemap (pgsize=4096): done testing uffd-wp with pagemap (pgsize=2097152): done testing events (fork, remap, remove): ERROR: nr 32427 memory corruption 0 1 (errno=0, line=963) ERROR: faulting process failed (errno=0, line=1117) It can be easily reproduced when global thp enabled, which is the default for RHEL. It's also known as a side effect of commit 0db282ba2c12 ("selftest: use mmap instead of posix_memalign to allocate memory", 2021-07-23), which is imho right itself on using mmap() to make sure the addresses will be untagged even on arm. The problem is, for each test we allocate buffers using two allocate_area() calls. We assumed these two buffers won't affect each other, however they could, because mmap() could have found that the two buffers are near each other and having the same VMA flags, so they got merged into one VMA. It won't be a big problem if thp is not enabled, but when thp is agressively enabled it means when initializing the src buffer it could accidentally setup part of the dest buffer too when there's a shared THP that overlaps the two regions. Then some of the dest buffer won't be able to be trapped by userfaultfd missing mode, then it'll cause memory corruption as described. To fix it, do release_pages() after initializing the src buffer. Since the previous two release_pages() calls are after uffd_test_ctx_clear() which will unmap all the buffers anyway (which is stronger than release pages; as unmap() also tear town pgtables), drop them as they shouldn't really be anything useful. We can mark the Fixes tag upon 0db282ba2c12 as it's reported to only happen there, however the real "Fixes" IMHO should be 8ba6e8640844, as before that commit we'll always do explicit release_pages() before registration of uffd, and 8ba6e8640844 changed that logic by adding extra unmap/map and we didn't release the pages at the right place. Meanwhile I don't have a solid glue anyway on whether posix_memalign() could always avoid triggering this bug, hence it's safer to attach this fix to commit 8ba6e8640844. Link: https://lkml.kernel.org/r/20210923232512.210092-1-peterx@redhat.com Fixes: 8ba6e8640844 ("userfaultfd/selftests: reinitialize test context in each test") Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1994931 Signed-off-by: Peter Xu Reported-by: Li Wang Tested-by: Li Wang Reviewed-by: Axel Rasmussen Cc: Andrea Arcangeli Cc: Nadav Amit Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 29664923725a384dc7e0f74af7c66e5ab7bb2a26 Author: Marco Giunta Date: Mon Oct 18 18:25:52 2021 +0200 ALSA: usb-audio: Fix microphone sound on Jieli webcam. When a Jieli Technology USB Webcam is connected, the video part works well, but the mic sound is speeded up. On dmesg there are messages about different rates from the runtime rates, warnings about volume resolution and lastly, the log is filled, every 5 seconds, with retire_capture_urb error messages. The mic works only when ep packet size is set to wMaxPacketSize (normal sound and no more retire_capture_urb error messages). Skipping reading sample rate, fixes the messages about different rates and forcing a volume resolution, fixes warnings about volume range. I have arbitrarily choosed the value (16): I read in a comment that there should be no more than 255 levels, so 4096 (max volume) / 16 = 0-255. Signed-off-by: Marco Giunta Link: https://lore.kernel.org/r/20211018162552.12082-1-giun7a@gmail.com Signed-off-by: Takashi Iwai commit 4e5483b8440d01f6851a1388801088a6e0da0b56 Author: Adrian Hunter Date: Mon Oct 18 18:10:04 2021 +0300 scsi: ufs: ufs-pci: Force a full restore after suspend-to-disk Implement the ->restore() PM operation and set the link to off, which will force a full reset and restore. This ensures that Host Performance Booster is reset after suspend-to-disk. The Host Performance Booster feature caches logical-to-physical mapping information in the host memory. After suspend-to-disk, such information is not valid, so a full reset and restore is needed. A full reset and restore is done if the SPM level is 5 or 6, but not for other SPM levels, so this change fixes those cases. A full reset and restore also restores base address registers, so that code is removed. Link: https://lore.kernel.org/r/20211018151004.284200-2-adrian.hunter@intel.com Reviewed-by: Avri Altman Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit 4a8f71014b4d56c4fb287607e844c0a9f68f46d9 Author: Dmitry Bogdanov Date: Mon Oct 18 15:26:50 2021 +0300 scsi: qla2xxx: Fix unmap of already freed sgl The sgl is freed in the target stack in target_release_cmd_kref() before calling qlt_free_cmd() but there is an unmap of sgl in qlt_free_cmd() that causes a panic if sgl is not yet DMA unmapped: NIP dma_direct_unmap_sg+0xdc/0x180 LR dma_direct_unmap_sg+0xc8/0x180 Call Trace: ql_dbg_prefix+0x68/0xc0 [qla2xxx] (unreliable) dma_unmap_sg_attrs+0x54/0xf0 qlt_unmap_sg.part.19+0x54/0x1c0 [qla2xxx] qlt_free_cmd+0x124/0x1d0 [qla2xxx] tcm_qla2xxx_release_cmd+0x4c/0xa0 [tcm_qla2xxx] target_put_sess_cmd+0x198/0x370 [target_core_mod] transport_generic_free_cmd+0x6c/0x1b0 [target_core_mod] tcm_qla2xxx_complete_free+0x6c/0x90 [tcm_qla2xxx] The sgl may be left unmapped in error cases of response sending. For instance, qlt_rdy_to_xfer() maps sgl and exits when session is being deleted keeping the sgl mapped. This patch removes use-after-free of the sgl and ensures that the sgl is unmapped for any command that was not sent to firmware. Link: https://lore.kernel.org/r/20211018122650.11846-1-d.bogdanov@yadro.com Reviewed-by: Himanshu Madhani Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 7fb223d0ad801f633c78cbe42b1d1b55f5d163ad Author: Joy Gu Date: Tue Oct 12 12:18:33 2021 -0700 scsi: qla2xxx: Fix a memory leak in an error path of qla2x00_process_els() Commit 8c0eb596baa5 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()"), intended to change: bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN to: bsg_job->request->msgcode != FC_BSG_RPT_ELS but changed it to: bsg_job->request->msgcode == FC_BSG_RPT_ELS instead. Change the == to a != to avoid leaking the fcport structure or freeing unallocated memory. Link: https://lore.kernel.org/r/20211012191834.90306-2-jgu@purestorage.com Fixes: 8c0eb596baa5 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()") Reviewed-by: Bart Van Assche Signed-off-by: Joy Gu Signed-off-by: Martin K. Petersen commit 06634d5b6e923ed0d4772aba8def5a618f44c7fe Author: Zheyu Ma Date: Mon Oct 18 01:56:21 2021 +0000 scsi: qla2xxx: Return -ENOMEM if kzalloc() fails The driver probing function should return < 0 for failure, otherwise kernel will treat value > 0 as success. Link: https://lore.kernel.org/r/1634522181-31166-1-git-send-email-zheyuma97@gmail.com Reviewed-by: Himanshu Madhani Signed-off-by: Zheyu Ma Signed-off-by: Martin K. Petersen commit 6e3ee990c90494561921c756481d0e2125d8b895 Author: Gaosheng Cui Date: Sat Oct 16 15:23:50 2021 +0800 audit: fix possible null-pointer dereference in audit_filter_rules Fix possible null-pointer dereference in audit_filter_rules. audit_filter_rules() error: we previously assumed 'ctx' could be null Cc: stable@vger.kernel.org Fixes: bf361231c295 ("audit: add saddr_fam filter field") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Gaosheng Cui Signed-off-by: Paul Moore commit ed65df63a39a3f6ed04f7258de8b6789e5021c18 Author: Steven Rostedt (VMware) Date: Mon Oct 18 15:44:12 2021 -0400 tracing: Have all levels of checks prevent recursion While writing an email explaining the "bit = 0" logic for a discussion on making ftrace_test_recursion_trylock() disable preemption, I discovered a path that makes the "not do the logic if bit is zero" unsafe. The recursion logic is done in hot paths like the function tracer. Thus, any code executed causes noticeable overhead. Thus, tricks are done to try to limit the amount of code executed. This included the recursion testing logic. Having recursion testing is important, as there are many paths that can end up in an infinite recursion cycle when tracing every function in the kernel. Thus protection is needed to prevent that from happening. Because it is OK to recurse due to different running context levels (e.g. an interrupt preempts a trace, and then a trace occurs in the interrupt handler), a set of bits are used to know which context one is in (normal, softirq, irq and NMI). If a recursion occurs in the same level, it is prevented*. Then there are infrastructure levels of recursion as well. When more than one callback is attached to the same function to trace, it calls a loop function to iterate over all the callbacks. Both the callbacks and the loop function have recursion protection. The callbacks use the "ftrace_test_recursion_trylock()" which has a "function" set of context bits to test, and the loop function calls the internal trace_test_and_set_recursion() directly, with an "internal" set of bits. If an architecture does not implement all the features supported by ftrace then the callbacks are never called directly, and the loop function is called instead, which will implement the features of ftrace. Since both the loop function and the callbacks do recursion protection, it was seemed unnecessary to do it in both locations. Thus, a trick was made to have the internal set of recursion bits at a more significant bit location than the function bits. Then, if any of the higher bits were set, the logic of the function bits could be skipped, as any new recursion would first have to go through the loop function. This is true for architectures that do not support all the ftrace features, because all functions being traced must first go through the loop function before going to the callbacks. But this is not true for architectures that support all the ftrace features. That's because the loop function could be called due to two callbacks attached to the same function, but then a recursion function inside the callback could be called that does not share any other callback, and it will be called directly. i.e. traced_function_1: [ more than one callback tracing it ] call loop_func loop_func: trace_recursion set internal bit call callback callback: trace_recursion [ skipped because internal bit is set, return 0 ] call traced_function_2 traced_function_2: [ only traced by above callback ] call callback callback: trace_recursion [ skipped because internal bit is set, return 0 ] call traced_function_2 [ wash, rinse, repeat, BOOM! out of shampoo! ] Thus, the "bit == 0 skip" trick is not safe, unless the loop function is call for all functions. Since we want to encourage architectures to implement all ftrace features, having them slow down due to this extra logic may encourage the maintainers to update to the latest ftrace features. And because this logic is only safe for them, remove it completely. [*] There is on layer of recursion that is allowed, and that is to allow for the transition between interrupt context (normal -> softirq -> irq -> NMI), because a trace may occur before the context update is visible to the trace recursion logic. Link: https://lore.kernel.org/all/609b565a-ed6e-a1da-f025-166691b5d994@linux.alibaba.com/ Link: https://lkml.kernel.org/r/20211018154412.09fcad3c@gandalf.local.home Cc: Linus Torvalds Cc: Petr Mladek Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Josh Poimboeuf Cc: Jiri Kosina Cc: Miroslav Benes Cc: Joe Lawrence Cc: Colin Ian King Cc: Masami Hiramatsu Cc: "Peter Zijlstra (Intel)" Cc: Nicholas Piggin Cc: Jisheng Zhang Cc: =?utf-8?b?546L6LSH?= Cc: Guo Ren Cc: stable@vger.kernel.org Fixes: edc15cafcbfa3 ("tracing: Avoid unnecessary multiple recursion checks") Signed-off-by: Steven Rostedt (VMware) commit 8a64ef042eab8a6cec04a6c79d44d1af79b628ca Author: Nathan Chancellor Date: Mon Oct 18 12:31:01 2021 -0700 nfp: bpf: silence bitwise vs. logical OR warning A new warning in clang points out two places in this driver where boolean expressions are being used with a bitwise OR instead of a logical one: drivers/net/ethernet/netronome/nfp/nfp_asm.c:199:20: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || drivers/net/ethernet/netronome/nfp/nfp_asm.c:199:20: note: cast one or both operands to int to silence this warning drivers/net/ethernet/netronome/nfp/nfp_asm.c:280:20: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || drivers/net/ethernet/netronome/nfp/nfp_asm.c:280:20: note: cast one or both operands to int to silence this warning 2 errors generated. The motivation for the warning is that logical operations short circuit while bitwise operations do not. In this case, it does not seem like short circuiting is harmful so implement the suggested fix of changing to a logical operation to fix the warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1479 Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20211018193101.2340261-1-nathan@kernel.org Signed-off-by: Jakub Kicinski commit 5ca6779d2f18b195cb3b66a14a271911fc609094 Author: Rob Clark Date: Mon Oct 18 08:36:25 2021 -0700 drm/msm/devfreq: Restrict idle clamping to a618 for now Until we better understand the stability issues caused by frequent frequency changes, lets limit them to a618. Signed-off-by: Rob Clark Tested-by: John Stultz Tested-by: Caleb Connolly Link: https://lore.kernel.org/r/20211018153627.2787882-1-robdclark@gmail.com Signed-off-by: Rob Clark commit 15bc01effefe97757ef02ca09e9d1b927ab22725 Author: Eric W. Biederman Date: Sat Oct 16 15:59:49 2021 -0500 ucounts: Fix signal ucount refcounting In commit fda31c50292a ("signal: avoid double atomic counter increments for user accounting") Linus made a clever optimization to how rlimits and the struct user_struct. Unfortunately that optimization does not work in the obvious way when moved to nested rlimits. The problem is that the last decrement of the per user namespace per user sigpending counter might also be the last decrement of the sigpending counter in the parent user namespace as well. Which means that simply freeing the leaf ucount in __free_sigqueue is not enough. Maintain the optimization and handle the tricky cases by introducing inc_rlimit_get_ucounts and dec_rlimit_put_ucounts. By moving the entire optimization into functions that perform all of the work it becomes possible to ensure that every level is handled properly. The new function inc_rlimit_get_ucounts returns 0 on failure to increment the ucount. This is different than inc_rlimit_ucounts which increments the ucounts and returns LONG_MAX if the ucount counter has exceeded it's maximum or it wrapped (to indicate the counter needs to decremented). I wish we had a single user to account all pending signals to across all of the threads of a process so this complexity was not necessary Cc: stable@vger.kernel.org Fixes: d64696905554 ("Reimplement RLIMIT_SIGPENDING on top of ucounts") v1: https://lkml.kernel.org/r/87mtnavszx.fsf_-_@disp2133 Link: https://lkml.kernel.org/r/87fssytizw.fsf_-_@disp2133 Reviewed-by: Alexey Gladkov Tested-by: Rune Kleveland Tested-by: Yu Zhao Tested-by: Jordan Glover Signed-off-by: "Eric W. Biederman" commit 675c496d0f92b481ebe4abf4fb06eadad7789de6 Author: Martin Blumenstingl Date: Sat Oct 16 12:50:21 2021 +0200 clk: composite: Also consider .determine_rate for rate + mux composites Commit 69a00fb3d69706 ("clk: divider: Implement and wire up .determine_rate by default") switches clk_divider_ops to implement .determine_rate by default. This breaks composite clocks with multiple parents because clk-composite.c does not use the special handling for mux + divider combinations anymore (that was restricted to rate clocks which only implement .round_rate, but not .determine_rate). Alex reports: This breaks lot of clocks for Rockchip which intensively uses composites, i.e. those clocks will always stay at the initial parent, which in some cases is the XTAL clock and I strongly guess it is the same for other platforms, which use composite clocks having more than one parent (e.g. mediatek, ti ...) Example (RK3399) clk_sdio is set (initialized) with XTAL (24 MHz) as parent in u-boot. It will always stay at this parent, even if the mmc driver sets a rate of 200 MHz (fails, as the nature of things), which should switch it to any of its possible parent PLLs defined in mux_pll_src_cpll_gpll_npll_ppll_upll_24m_p (see clk-rk3399.c) - which never happens. Restore the original behavior by changing the priority of the conditions inside clk-composite.c. Now the special rate + mux case (with rate_ops having a .round_rate - which is still the case for the default clk_divider_ops) is preferred over rate_ops which have .determine_rate defined (and not further considering the mux). Fixes: 69a00fb3d69706 ("clk: divider: Implement and wire up .determine_rate by default") Reported-by: Alex Bee Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211016105022.303413-2-martin.blumenstingl@googlemail.com Tested-by: Alex Bee Tested-by: Chen-Yu Tsai Signed-off-by: Stephen Boyd commit 9f1ee7b169afbd10c3ad254220d1b37beb5798aa Author: Paolo Bonzini Date: Mon Oct 18 06:49:18 2021 -0400 KVM: SEV-ES: reduce ghcb_sa_len to 32 bits The size of the GHCB scratch area is limited to 16 KiB (GHCB_SCRATCH_AREA_LIMIT), so there is no need for it to be a u64. This fixes a build error on 32-bit systems: i686-linux-gnu-ld: arch/x86/kvm/svm/sev.o: in function `sev_es_string_io: sev.c:(.text+0x110f): undefined reference to `__udivdi3' Cc: stable@vger.kernel.org Fixes: 019057bd73d1 ("KVM: SEV-ES: fix length of string I/O") Reported-by: Naresh Kamboju Signed-off-by: Paolo Bonzini commit d61863c66f9b443192997613cd6aeca3f65cc313 Author: Hao Xiang Date: Fri Oct 15 19:59:21 2021 +0800 KVM: VMX: Remove redundant handling of bus lock vmexit Hardware may or may not set exit_reason.bus_lock_detected on BUS_LOCK VM-Exits. Dealing with KVM_RUN_X86_BUS_LOCK in handle_bus_lock_vmexit could be redundant when exit_reason.basic is EXIT_REASON_BUS_LOCK. We can remove redundant handling of bus lock vmexit. Unconditionally Set exit_reason.bus_lock_detected in handle_bus_lock_vmexit(), and deal with KVM_RUN_X86_BUS_LOCK only in vmx_handle_exit(). Signed-off-by: Hao Xiang Message-Id: <1634299161-30101-1-git-send-email-hao.xiang@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit 01c7d2672a84dbdfa8050d073c3ea466437578fd Author: Christian Borntraeger Date: Wed Oct 6 12:17:24 2021 +0000 KVM: kvm_stat: do not show halt_wait_ns Similar to commit 111d0bda8eeb ("tools/kvm_stat: Exempt time-based counters"), we should not show timer values in kvm_stat. Remove the new halt_wait_ns. Fixes: 87bcc5fa092f ("KVM: stats: Add halt_wait_ns stats for all architectures") Cc: Jing Zhang Cc: Stefan Raspl Signed-off-by: Christian Borntraeger Reviewed-by: Stefan Raspl Message-Id: <20211006121724.4154-1-borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini commit 9139a7a64581c80d157027ae20e86f2f24d4292c Author: Sean Christopherson Date: Tue Oct 12 17:35:54 2021 -0700 KVM: x86: WARN if APIC HW/SW disable static keys are non-zero on unload WARN if the static keys used to track if any vCPU has disabled its APIC are left elevated at module exit. Unlike the underflow case, nothing in the static key infrastructure will complain if a key is left elevated, and because an elevated key only affects performance, nothing in KVM will fail if either key is improperly incremented. Signed-off-by: Sean Christopherson Message-Id: <20211013003554.47705-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f7d8a19f9a056a05c5c509fa65af472a322abfee Author: Sean Christopherson Date: Tue Oct 12 17:35:53 2021 -0700 Revert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET" Revert a change to open code bits of kvm_lapic_set_base() when emulating APIC RESET to fix an apic_hw_disabled underflow bug due to arch.apic_base and apic_hw_disabled being unsyncrhonized when the APIC is created. If kvm_arch_vcpu_create() fails after creating the APIC, kvm_free_lapic() will see the initialized-to-zero vcpu->arch.apic_base and decrement apic_hw_disabled without KVM ever having incremented apic_hw_disabled. Using kvm_lapic_set_base() in kvm_lapic_reset() is also desirable for a potential future where KVM supports RESET outside of vCPU creation, in which case all the side effects of kvm_lapic_set_base() are needed, e.g. to handle the transition from x2APIC => xAPIC. Alternatively, KVM could temporarily increment apic_hw_disabled (and call kvm_lapic_set_base() at RESET), but that's a waste of cycles and would impact the performance of other vCPUs and VMs. The other subtle side effect is that updating the xAPIC ID needs to be done at RESET regardless of whether the APIC was previously enabled, i.e. kvm_lapic_reset() needs an explicit call to kvm_apic_set_xapic_id() regardless of whether or not kvm_lapic_set_base() also performs the update. That makes stuffing the enable bit at vCPU creation slightly more palatable, as doing so affects only the apic_hw_disabled key. Opportunistically tweak the comment to explicitly call out the connection between vcpu->arch.apic_base and apic_hw_disabled, and add a comment to call out the need to always do kvm_apic_set_xapic_id() at RESET. Underflow scenario: kvm_vm_ioctl() { kvm_vm_ioctl_create_vcpu() { kvm_arch_vcpu_create() { if (something_went_wrong) goto fail_free_lapic; /* vcpu->arch.apic_base is initialized when something_went_wrong is false. */ kvm_vcpu_reset() { kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) { vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; } } return 0; fail_free_lapic: kvm_free_lapic() { /* vcpu->arch.apic_base is not yet initialized when something_went_wrong is true. */ if (!(vcpu->arch.apic_base & MSR_IA32_APICBASE_ENABLE)) static_branch_slow_dec_deferred(&apic_hw_disabled); // <= underflow bug. } return r; } } } This (mostly) reverts commit 421221234ada41b4a9f0beeb08e30b07388bd4bd. Fixes: 421221234ada ("KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET") Reported-by: syzbot+9fc046ab2b0cf295a063@syzkaller.appspotmail.com Debugged-by: Tetsuo Handa Signed-off-by: Sean Christopherson Message-Id: <20211013003554.47705-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit fa13843d1565d4c5b3aeb9be3343b313416bef46 Author: Paolo Bonzini Date: Fri Oct 15 13:05:00 2021 -0400 KVM: X86: fix lazy allocation of rmaps If allocation of rmaps fails, but some of the pointers have already been written, those pointers can be cleaned up when the memslot is freed, or even reused later for another attempt at allocating the rmaps. Therefore there is no need to WARN, as done for example in memslot_rmap_alloc, but the allocation *must* be skipped lest KVM will overwrite the previous pointer and will indeed leak memory. Signed-off-by: Paolo Bonzini commit baa1e5ca172ce7bf9554070139482dd7ea919528 Author: Peter Gonda Date: Fri Oct 15 13:32:22 2021 -0400 KVM: SEV-ES: Set guest_state_protected after VMSA update The refactoring in commit bb18a6777465 ("KVM: SEV: Acquire vcpu mutex when updating VMSA") left behind the assignment to svm->vcpu.arch.guest_state_protected; add it back. Signed-off-by: Peter Gonda [Delta between v2 and v3 of Peter's patch, which had already been committed; the commit message is my own. - Paolo] Fixes: bb18a6777465 ("KVM: SEV: Acquire vcpu mutex when updating VMSA") Signed-off-by: Paolo Bonzini commit 9fbfabfda25d8774c5a08634fdd2da000a924890 Author: Zqiang Date: Mon Oct 18 18:34:22 2021 +0800 block: fix incorrect references to disk objects When adding partitions to the disk, the reference count of the disk object is increased. then alloc partition device and called device_add(), if the device_add() return error, the reference count of the disk object will be reduced twice, at put_device(pdev) and put_disk(disk). this leads to the end of the object's life cycle prematurely, and trigger following calltrace. __init_work+0x2d/0x50 kernel/workqueue.c:519 synchronize_rcu_expedited+0x3af/0x650 kernel/rcu/tree_exp.h:847 bdi_remove_from_list mm/backing-dev.c:938 [inline] bdi_unregister+0x17f/0x5c0 mm/backing-dev.c:946 release_bdi+0xa1/0xc0 mm/backing-dev.c:968 kref_put include/linux/kref.h:65 [inline] bdi_put+0x72/0xa0 mm/backing-dev.c:976 bdev_free_inode+0x11e/0x220 block/bdev.c:408 i_callback+0x3f/0x70 fs/inode.c:226 rcu_do_batch kernel/rcu/tree.c:2508 [inline] rcu_core+0x76d/0x16c0 kernel/rcu/tree.c:2743 __do_softirq+0x1d7/0x93b kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu kernel/softirq.c:636 [inline] irq_exit_rcu+0xf2/0x130 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x93/0xc0 making disk is NULL when calling put_disk(). Reported-by: Hao Sun Signed-off-by: Zqiang Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211018103422.2043-1-qiang.zhang1211@gmail.com Signed-off-by: Jens Axboe commit 4cce60f15c04d69eff6ffc539ab09137dbe15070 Author: Randy Dunlap Date: Mon Oct 4 00:56:06 2021 -0700 NIOS2: irqflags: rename a redefined register name Both arch/nios2/ and drivers/mmc/host/tmio_mmc.c define a macro with the name "CTL_STATUS". Change the one in arch/nios2/ to be "CTL_FSTATUS" (flags status) to eliminate the build warning. In file included from ../drivers/mmc/host/tmio_mmc.c:22: drivers/mmc/host/tmio_mmc.h:31: warning: "CTL_STATUS" redefined 31 | #define CTL_STATUS 0x1c arch/nios2/include/asm/registers.h:14: note: this is the location of the previous definition 14 | #define CTL_STATUS 0 Fixes: b31ebd8055ea ("nios2: Nios2 registers") Signed-off-by: Randy Dunlap Cc: Dinh Nguyen Signed-off-by: Dinh Nguyen commit d49fe5e8151711ed5276f049bc7f73e02dc141f8 Author: Tianjia Zhang Date: Mon Oct 18 14:42:01 2021 +0800 selftests/tls: add SM4 algorithm dependency for tls selftests Kernel TLS test has added SM4 GCM/CCM algorithm support, but SM4 algorithm is not compiled by default, this patch add SM4 config dependency. Reported-by: Hangbin Liu Reported-by: kernel test robot Signed-off-by: Tianjia Zhang Signed-off-by: David S. Miller commit 5a20dd46b8b8459382685969cf0f196ae9fb9766 Author: Jeremy Kerr Date: Mon Oct 18 11:29:35 2021 +0800 mctp: Be explicit about struct sockaddr_mctp padding We currently have some implicit padding in struct sockaddr_mctp. This patch makes this padding explicit, and ensures we have consistent layout on platforms with <32bit alignmnent. Fixes: 60fc63981693 ("mctp: Add sockaddr_mctp to uapi") Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit b416beb25d9317499c823aea1522eefd8d72ea36 Author: Jeremy Kerr Date: Mon Oct 18 11:29:34 2021 +0800 mctp: unify sockaddr_mctp types Use the more precise __kernel_sa_family_t for smctp_family, to match struct sockaddr. Also, use an unsigned int for the network member; negative networks don't make much sense. We're already using unsigned for mctp_dev and mctp_skb_cb, but need to change mctp_sock to suit. Fixes: 60fc63981693 ("mctp: Add sockaddr_mctp to uapi") Signed-off-by: Jeremy Kerr Acked-by: Eugene Syromiatnikov Signed-off-by: David S. Miller commit b2cddb44bddc1a9c5949a978bb454bba863264db Author: Zheyu Ma Date: Mon Oct 18 02:16:22 2021 +0000 cavium: Return negative value when pci_alloc_irq_vectors() fails During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller commit d1a7b9e4696584ce05c12567762c18a866837a85 Author: Wan Jiabing Date: Sun Oct 17 21:32:32 2021 -0400 net: mscc: ocelot: Add of_node_put() before goto Fix following coccicheck warning: ./drivers/net/ethernet/mscc/ocelot_vsc7514.c:946:1-33: WARNING: Function for_each_available_child_of_node should have of_node_put() before goto. Early exits from for_each_available_child_of_node should decrement the node reference counter. Signed-off-by: Wan Jiabing Signed-off-by: David S. Miller commit d9fd7e9fccfac466fb528a783f2fc76f2982604c Author: Wan Jiabing Date: Sun Oct 17 21:31:30 2021 -0400 net: sparx5: Add of_node_put() before goto Fix following coccicheck warning: ./drivers/net/ethernet/microchip/sparx5/s4parx5_main.c:723:1-33: WARNING: Function for_each_available_child_of_node should have of_node_put() before goto Early exits from for_each_available_child_of_node should decrement the node reference counter. Signed-off-by: Wan Jiabing Signed-off-by: David S. Miller commit 2dc4e9e88cfcc38454d52b01ed3422238c134003 Author: Paul Blakey Date: Sun Oct 17 14:58:51 2021 +0300 net/sched: act_ct: Fix byte count on fragmented packets First fragmented packets (frag offset = 0) byte len is zeroed when stolen by ip_defrag(). And since act_ct update the stats only afterwards (at end of execute), bytes aren't correctly accounted for such packets. To fix this, move stats update to start of action execute. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit 342afce10d6f61c443c95e244f812d4766f73f53 Author: DENG Qingfang Date: Sat Oct 16 14:24:14 2021 +0800 net: dsa: mt7530: correct ds->num_ports Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary dsa_port's and call mt7530_port_disable for non-existent ports. Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in port_enable/disable is no longer required. Cc: stable@vger.kernel.org Signed-off-by: DENG Qingfang Signed-off-by: David S. Miller commit 66d262804a2276721eac86cf18fcd61046149193 Author: Aleksander Jan Bajkowski Date: Sat Oct 16 00:10:20 2021 +0200 net: dsa: lantiq_gswip: fix register definition I compared the register definitions with the D-Link DWR-966 GPL sources and found that the PUAFD field definition was incorrect. This definition is unused and causes no issues. Fixes: 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Signed-off-by: Aleksander Jan Bajkowski Acked-by: Hauke Mehrtens Signed-off-by: David S. Miller commit bca69044affa6bb1be38e91bbd9de99ba11aee76 Merge: 0a9bb11a5e298 553715feaa9e0 Author: David S. Miller Date: Mon Oct 18 13:04:42 2021 +0100 Merge tag 'linux-can-fixes-for-5.15-20211017' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2021-10-17 this is a pull request of 11 patches for net/master. The first 4 patches are by Ziyang Xuan and Zhang Changzhong and fix 1 use after free and 3 standard conformance problems in the j1939 CAN stack. The next 2 patches are by Ziyang Xuan and fix 2 concurrency problems in the ISOTP CAN stack. Yoshihiro Shimoda's patch for the rcar_can fix suspend/resume on not running CAN interfaces. Aswath Govindraju's patch for the m_can driver fixes access for MMIO devices. Zheyu Ma contributes a patch for the peak_pci driver to fix a use after free. Stephane Grosjean's 2 patches fix CAN error state handling in the peak_usb driver. ==================== Signed-off-by: David S. Miller commit 0a9bb11a5e298e72b675255a4bb2893513000584 Author: Randy Dunlap Date: Thu Oct 14 19:18:04 2021 -0700 hamradio: baycom_epp: fix build for UML On i386, the baycom_epp driver wants to inspect X86 CPU features (TSC) and then act on that data, but that info is not available when running on UML, so prevent that test and do the default action. Prevents this build error on UML + i386: ../drivers/net/hamradio/baycom_epp.c: In function ‘epp_bh’: ../drivers/net/hamradio/baycom_epp.c:630:6: error: implicit declaration of function ‘boot_cpu_has’; did you mean ‘get_cpu_mask’? [-Werror=implicit-function-declaration] if (boot_cpu_has(X86_FEATURE_TSC)) \ ^ ../drivers/net/hamradio/baycom_epp.c:658:2: note: in expansion of macro ‘GETTICK’ GETTICK(time1); Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Randy Dunlap Cc: linux-um@lists.infradead.org Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Thomas Sailer Cc: linux-hams@vger.kernel.org Signed-off-by: David S. Miller commit c2bbf9d1e9ac7d4fdd503b190bc1ba8a6302bc49 Author: Hamza Mahfooz Date: Tue Oct 12 01:54:03 2021 -0400 dma-debug: teach add_dma_entry() about DMA_ATTR_SKIP_CPU_SYNC Mapping something twice should be possible as long as, DMA_ATTR_SKIP_CPU_SYNC is passed to the strictly speaking second relevant mapping operation (that attempts to map the same thing). So, don't issue a warning if the specified condition is met in add_dma_entry(). Signed-off-by: Hamza Mahfooz Signed-off-by: Christoph Hellwig commit 519d81956ee277b4419c723adfb154603c2565ba Author: Linus Torvalds Date: Sun Oct 17 20:00:13 2021 -1000 Linux 5.15-rc6 commit cd079b1f870729a9fe3294f800dff18b548f129d Merge: f2b3420b921d1 776c750108038 Author: Linus Torvalds Date: Sun Oct 17 19:39:22 2021 -1000 Merge tag 'libata-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull libata fixes from Damien Le Moal: "Two fixes for this cycle: - Fix a null pointer dereference in ahci-platform driver (from Hai) - Fix uninitialized variables in pata_legacy driver (from Dan)" * tag 'libata-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators() pata_legacy: fix a couple uninitialized variable bugs commit f2b3420b921d142b4c55f7445385bdab4060d754 Merge: cc0af0a95172d d29bd41428cff Author: Linus Torvalds Date: Sun Oct 17 19:25:20 2021 -1000 Merge tag 'block-5.15-2021-10-17' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Bigger than usual for this point in time, the majority is fixing some issues around BDI lifetimes with the move from the request_queue to the disk in this release. In detail: - Series on draining fs IO for del_gendisk() (Christoph) - NVMe pull request via Christoph: - fix the abort command id (Keith Busch) - nvme: fix per-namespace chardev deletion (Adam Manzanares) - brd locking scope fix (Tetsuo) - BFQ fix (Paolo)" * tag 'block-5.15-2021-10-17' of git://git.kernel.dk/linux-block: block, bfq: reset last_bfqq_created on group change block: warn when putting the final reference on a registered disk brd: reduce the brd_devices_mutex scope kyber: avoid q->disk dereferences in trace points block: keep q_usage_counter in atomic mode after del_gendisk block: drain file system I/O on del_gendisk block: split bio_queue_enter from blk_queue_enter block: factor out a blk_try_enter_queue helper block: call submit_bio_checks under q_usage_counter nvme: fix per-namespace chardev deletion block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs nvme-pci: Fix abort command id commit cc0af0a95172db52db2ab41b1e8a9c9ac0930b63 Merge: 3bb50f8530c9c 14cfbb7a7856f Author: Linus Torvalds Date: Sun Oct 17 19:20:13 2021 -1000 Merge tag 'io_uring-5.15-2021-10-17' of git://git.kernel.dk/linux-block Pull io_uring fix from Jens Axboe: "Just a single fix for a wrong condition for grabbing a lock, a regression in this merge window" * tag 'io_uring-5.15-2021-10-17' of git://git.kernel.dk/linux-block: io_uring: fix wrong condition to grab uring lock commit 3bb50f8530c9cb5ec69c0744b7fd32d0ca404254 Merge: be9eb2f00fa72 bcef9356fc2e1 Author: Linus Torvalds Date: Sun Oct 17 18:17:19 2021 -1000 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Fixes up some issues in rc5" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost-vdpa: Fix the wrong input in config_cb VDUSE: fix documentation underline warning Revert "virtio-blk: Add validation for block size in config space" vhost_vdpa: unset vq irq before freeing irq virtio: write back F_VERSION_1 before validate commit be9eb2f00fa7245116d49f76614054cce8e07af8 Merge: 6890acacdee09 cdeb5d7d890e1 Author: Linus Torvalds Date: Sun Oct 17 18:01:32 2021 -1000 Merge tag 'powerpc-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix a bug where guests on P9 with interrupts passed through could get stuck in synchronize_irq(). - Fix a bug in KVM on P8 where secondary threads entering a guest would write outside their allocated stack. - Fix a bug in KVM on P8 where secondary threads could confuse the host offline code and cause the guest or host to crash. Thanks to Cédric Le Goater. * tag 'powerpc-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Book3S HV: Make idle_kvm_start_guest() return 0 if it went to guest KVM: PPC: Book3S HV: Fix stack handling in idle_kvm_start_guest() powerpc/xive: Discard disabled interrupts in get_irqchip_state() commit 6890acacdee09d7cb7c988175c895ccb4f1bb340 Merge: f644750ccc02f 86e1e054e0d21 Author: Linus Torvalds Date: Sun Oct 17 17:41:39 2021 -1000 Merge tag 'objtool_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: - Update section headers before the respective relocations to not trigger a safety check in elftoolchain's implementation of libelf - Do not add garbage data to the .rela.orc_unwind_ip section * tag 'objtool_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Update section header before relocations objtool: Check for gelf_update_rel[a] failures commit f644750ccc02f5d513abf314a16bec5f70d13c40 Merge: 60ebc28b073bf d9b7748ffc452 Author: Linus Torvalds Date: Sun Oct 17 17:36:39 2021 -1000 Merge tag 'edac_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Borislav Petkov: - Log the "correct" uncorrectable error count in the armada_xp driver * tag 'edac_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/armada-xp: Fix output of uncorrectable error counter commit 60ebc28b073bf8a146d37b9d6b03a409714a0a47 Merge: 424e7d878cb7a 71920ea97d6d1 Author: Linus Torvalds Date: Sun Oct 17 17:34:18 2021 -1000 Merge tag 'perf_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Add Sapphire Rapids to the list of CPUs supporting the SMI count MSR * tag 'perf_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/msr: Add Sapphire Rapids CPU support commit 424e7d878cb7a51f446514826a0b9ddbc78ff1d0 Merge: 89f6602d4b952 38fa3206bf441 Author: Linus Torvalds Date: Sun Oct 17 17:30:49 2021 -1000 Merge tag 'efi-urgent-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI fixes from Borislav Petkov: "Forwarded from Ard Biesheuvel through the tip tree. Ard will send stuff directly in the near future. Low priority fixes but fixes nonetheless: - update stub diagnostic print that is no longer accurate - avoid statically allocated buffer for CPER error record decoding - avoid sleeping on the efi_runtime semaphore when calling the ResetSystem EFI runtime service" * tag 'efi-urgent-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: Change down_interruptible() in virt_efi_reset_system() to down_trylock() efi/cper: use stack buffer for error record decoding efi/libstub: Simplify "Exiting bootservices" message commit 89f6602d4b952470e068638a90bc16dd75b22ee7 Merge: cf52ad5ff16c3 b2381acd3fd9b Author: Linus Torvalds Date: Sun Oct 17 17:27:22 2021 -1000 Merge tag 'x86_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Do not enable AMD memory encryption in Kconfig by default due to shortcomings of some platforms, leading to boot failures. - Mask out invalid bits in the MXCSR for 32-bit kernels again because Thomas and I don't know how to mask out bits properly. Third time's the charm. * tag 'x86_urgent_for_v5.15_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Mask out the invalid MXCSR bits properly x86/Kconfig: Do not enable AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT automatically commit cf52ad5ff16c38a62a6536b5e7612b56794f5a5e Merge: e3572dff12798 81967efb5f396 Author: Linus Torvalds Date: Sun Oct 17 17:17:28 2021 -1000 Merge tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here are some small driver core fixes for 5.15-rc6, all of which have been in linux-next for a while with no reported issues. They include: - kernfs negative dentry bugfix - simple pm bus fixes to resolve reported issues" * tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: drivers: bus: Delete CONFIG_SIMPLE_PM_BUS drivers: bus: simple-pm-bus: Add support for probing simple bus only devices driver core: Reject pointless SYNC_STATE_ONLY device links kernfs: don't create a negative dentry if inactive node exists commit e3572dff127986cbf7ac01147720b4aa3e81878a Merge: a563ae0ff6dc1 f42752729e206 Author: Linus Torvalds Date: Sun Oct 17 17:14:00 2021 -1000 Merge tag 'char-misc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are some small char/misc driver fixes for 5.15-rc6 for reported issues that include: - habanalabs driver fixes - mei driver fixes and new ids - fpga new device ids - MAINTAINER file updates for fpga subsystem - spi module id table additions and fixes - fastrpc locking fixes - nvmem driver fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: eeprom: 93xx46: fix MODULE_DEVICE_TABLE nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells mei: hbm: drop hbm responses on early shutdown mei: me: add Ice Lake-N device id. eeprom: 93xx46: Add SPI device ID table eeprom: at25: Add SPI ID table misc: HI6421V600_IRQ should depend on HAS_IOMEM misc: fastrpc: Add missing lock before accessing find_vma() cb710: avoid NULL pointer subtraction misc: gehc: Add SPI ID table MAINTAINERS: Drop outdated FPGA Manager website MAINTAINERS: Add Hao and Yilun as maintainers habanalabs: fix resetting args in wait for CS IOCTL fpga: ice40-spi: Add SPI device ID table commit a563ae0ff6dc1b810f08e52dff3ad16affed3d24 Merge: b9e42b3cf237d 37f12202c5d28 Author: Linus Torvalds Date: Sun Oct 17 17:10:00 2021 -1000 Merge tag 'staging-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO driver fixes from Greg KH: "Here are a number of small IIO and staging driver fixes for 5.15-rc6. They include: - vc04_services bugfix for reported problem - r8188eu array underflow fix - iio driver fixes for a lot of tiny reported issues. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: r8188eu: prevent array underflow in rtw_hal_update_ra_mask() staging: vc04_services: shut up out-of-range warning iio: light: opt3001: Fixed timeout error when 0 lux iio: adis16480: fix devices that do not support sleep mode iio: mtk-auxadc: fix case IIO_CHAN_INFO_PROCESSED iio: adis16475: fix deadlock on frequency set iio: ssp_sensors: add more range checking in ssp_parse_dataframe() iio: ssp_sensors: fix error code in ssp_print_mcu_debug() iio: adc: ad7793: Fix IRQ flag iio: adc: ad7780: Fix IRQ flag iio: adc: ad7192: Add IRQ flag iio: adc: aspeed: set driver data when adc probe. iio: adc: rzg2l_adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume() iio: adc: max1027: Fix the number of max1X31 channels iio: adc: max1027: Fix wrong shift with 12-bit devices iio: adc128s052: Fix the error handling path of 'adc128_probe()' iio: adc: rzg2l_adc: Fix -EBUSY timeout error return iio: accel: fxls8962af: return IRQ_HANDLED when fifo is flushed iio: dac: ti-dac5571: fix an error code in probe() commit b9e42b3cf237d8a5d093d5d451d6ea75f95743d0 Merge: ebf613ae87baf cb2282213e84f Author: Linus Torvalds Date: Sun Oct 17 17:06:31 2021 -1000 Merge tag 'tty-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull serial driver fix from Greg KH: "Here is a single 8250 Kconfig fix for 5.15-rc6 that resolves a regression that showed up in 5.15-rc1. It has been in linux-next for a while with no reported issues" * tag 'tty-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250: allow disabling of Freescale 16550 compile test commit ebf613ae87baff7804966d3f251d09ec7c3ad17f Merge: 12dbbfadd8f4e cd932c2a1ecc8 Author: Linus Torvalds Date: Sun Oct 17 17:02:00 2021 -1000 Merge tag 'usb-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB fixes that resolve a number of tiny issues. They include: - new USB serial driver ids - xhci driver fixes for a bunch of issues - musb error path fixes. All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: musb: dsps: Fix the probe error path xhci: Enable trust tx length quirk for Fresco FL11 USB controller xhci: Fix command ring pointer corruption while aborting a command USB: xhci: dbc: fix tty registration race xhci: add quirk for host controllers that don't update endpoint DCS xhci: guard accesses to ep_state in xhci_endpoint_reset() USB: serial: qcserial: add EM9191 QDL support USB: serial: option: add Quectel EC200S-CN module support USB: serial: option: add prod. id for Quectel EG91 USB: serial: option: add Telit LE910Cx composition 0x1204 commit 12dbbfadd8f4e54607463414b06f9416a5c6d981 Merge: d999ade1cc86c a02dcde595f7c Author: Linus Torvalds Date: Sun Oct 17 16:57:06 2021 -1000 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a new product ID for the xpad joystick driver - fixes to resistive-adc-touch and snvs_pwrkey drivers - a change to touchscreen helpers to make clang happier * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: touchscreen - avoid bitwise vs logical OR warning Input: xpad - add support for another USB ID of Nacon GC-100 Input: resistive-adc-touch - fix division by zero error on z1 == 0 Input: snvs_pwrkey - add clk handling commit d9aaaf223297f6146d9d7f36caca927c92ab855a Author: Davidlohr Bueso Date: Sun Oct 10 11:24:39 2021 -0700 netfilter: ebtables: allocate chainstack on CPU local nodes Keep the per-CPU memory allocated for chainstacks local. Signed-off-by: Davidlohr Bueso Signed-off-by: Pablo Neira Ayuso commit 553715feaa9e0453bc59f6ba20e1c69346888bd5 Author: Stephane Grosjean Date: Wed Sep 29 16:21:11 2021 +0200 can: peak_usb: pcan_usb_fd_decode_status(): remove unnecessary test on the nullity of a pointer Since alloc_can_err_skb() puts NULL in cf in the case when skb cannot be allocated and can_change_state() handles the case when cf is NULL, the test on the nullity of skb is now unnecessary. Link: https://lore.kernel.org/all/20210929142111.55757-2-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 3d031abc7e7249573148871180c28ecedb5e27df Author: Stephane Grosjean Date: Wed Sep 29 16:21:10 2021 +0200 can: peak_usb: pcan_usb_fd_decode_status(): fix back to ERROR_ACTIVE state notification This corrects the lack of notification of a return to ERROR_ACTIVE state for USB - CANFD devices from PEAK-System. Fixes: 0a25e1f4f185 ("can: peak_usb: add support for PEAK new CANFD USB adapters") Link: https://lore.kernel.org/all/20210929142111.55757-1-s.grosjean@peak-system.com Cc: stable@vger.kernel.org Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 949fe9b35570361bc6ee2652f89a0561b26eec98 Author: Zheyu Ma Date: Thu Oct 14 06:28:33 2021 +0000 can: peak_pci: peak_pci_remove(): fix UAF When remove the module peek_pci, referencing 'chan' again after releasing 'dev' will cause UAF. Fix this by releasing 'dev' later. The following log reveals it: [ 35.961814 ] BUG: KASAN: use-after-free in peak_pci_remove+0x16f/0x270 [peak_pci] [ 35.963414 ] Read of size 8 at addr ffff888136998ee8 by task modprobe/5537 [ 35.965513 ] Call Trace: [ 35.965718 ] dump_stack_lvl+0xa8/0xd1 [ 35.966028 ] print_address_description+0x87/0x3b0 [ 35.966420 ] kasan_report+0x172/0x1c0 [ 35.966725 ] ? peak_pci_remove+0x16f/0x270 [peak_pci] [ 35.967137 ] ? trace_irq_enable_rcuidle+0x10/0x170 [ 35.967529 ] ? peak_pci_remove+0x16f/0x270 [peak_pci] [ 35.967945 ] __asan_report_load8_noabort+0x14/0x20 [ 35.968346 ] peak_pci_remove+0x16f/0x270 [peak_pci] [ 35.968752 ] pci_device_remove+0xa9/0x250 Fixes: e6d9c80b7ca1 ("can: peak_pci: add support of some new PEAK-System PCI cards") Link: https://lore.kernel.org/all/1634192913-15639-1-git-send-email-zheyuma97@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Zheyu Ma Signed-off-by: Marc Kleine-Budde commit 99d173fbe8944861a00ebd1c73817a1260d21e60 Author: Aswath Govindraju Date: Mon Sep 20 18:03:43 2021 +0530 can: m_can: fix iomap_read_fifo() and iomap_write_fifo() The read and writes from the fifo are from a buffer, with various fields and data at predefined offsets. So, they should not be done to the same address(or port) in case of val_count greater than 1. Therefore, fix this by using iowrite32()/ioread32() instead of ioread32_rep()/iowrite32_rep(). Also, the write into FIFO must be performed with an offset from the message ram base address. Therefore, fix the base address to mram_base. Fixes: e39381770ec9 ("can: m_can: Disable IRQs on FIFO bus errors") Link: https://lore.kernel.org/all/20210920123344.2320-1-a-govindraju@ti.com Signed-off-by: Aswath Govindraju Signed-off-by: Marc Kleine-Budde commit f7c05c3987dcfde9a4e8c2d533db013fabebca0d Author: Yoshihiro Shimoda Date: Fri Sep 24 16:55:56 2021 +0900 can: rcar_can: fix suspend/resume If the driver was not opened, rcar_can_suspend() should not call clk_disable() because the clock was not enabled. Fixes: fd1159318e55 ("can: add Renesas R-Car CAN driver") Link: https://lore.kernel.org/all/20210924075556.223685-1-yoshihiro.shimoda.uh@renesas.com Cc: stable@vger.kernel.org Signed-off-by: Yoshihiro Shimoda Tested-by: Ayumi Nakamichi Reviewed-by: Ulrich Hecht Tested-by: Biju Das Signed-off-by: Marc Kleine-Budde commit 5370b0f49078203acf3c064b634a09707167a864 Author: Tejun Heo Date: Thu Oct 14 13:20:22 2021 -1000 blk-cgroup: blk_cgroup_bio_start() should use irq-safe operations on blkg->iostat_cpu c3df5fb57fe8 ("cgroup: rstat: fix A-A deadlock on 32bit around u64_stats_sync") made u64_stats updates irq-safe to avoid A-A deadlocks. Unfortunately, the conversion missed one in blk_cgroup_bio_start(). Fix it. Fixes: 2d146aa3aa84 ("mm: memcontrol: switch to rstat") Cc: stable@vger.kernel.org # v5.13+ Reported-by: syzbot+9738c8815b375ce482a1@syzkaller.appspotmail.com Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/YWi7NrQdVlxD6J9W@slm.duckdns.org Signed-off-by: Jens Axboe commit d29bd41428cfff9b582c248db14a47e2be8457a8 Author: Paolo Valente Date: Fri Oct 15 16:43:36 2021 +0200 block, bfq: reset last_bfqq_created on group change Since commit 430a67f9d616 ("block, bfq: merge bursts of newly-created queues"), BFQ maintains a per-group pointer to the last bfq_queue created. If such a queue, say bfqq, happens to move to a different group, then bfqq is no more a valid last bfq_queue created for its previous group. That pointer must then be cleared. Not resetting such a pointer may also cause UAF, if bfqq happens to also be freed after being moved to a different group. This commit performs this missing reset. As such it fixes commit 430a67f9d616 ("block, bfq: merge bursts of newly-created queues"). Such a missing reset is most likely the cause of the crash reported in [1]. With some analysis, we found that this crash was due to the above UAF. And such UAF did go away with this commit applied [1]. Anyway, before this commit, that crash happened to be triggered in conjunction with commit 2d52c58b9c9b ("block, bfq: honor already-setup queue merges"). The latter was then reverted by commit ebc69e897e17 ("Revert "block, bfq: honor already-setup queue merges""). Yet commit 2d52c58b9c9b ("block, bfq: honor already-setup queue merges") contains no error related with the above UAF, and can then be restored. [1] https://bugzilla.kernel.org/show_bug.cgi?id=214503 Fixes: 430a67f9d616 ("block, bfq: merge bursts of newly-created queues") Tested-by: Grzegorz Kowal Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20211015144336.45894-2-paolo.valente@linaro.org Signed-off-by: Jens Axboe commit a20417611b98e12a724e5c828c472ea16990b71f Author: Christoph Hellwig Date: Thu Oct 14 15:02:31 2021 +0200 block: warn when putting the final reference on a registered disk Warn when the last reference on a live disk is put without calling del_gendisk first. There are some BDI related bug reports that look like a case of this, so make sure we have the proper instrumentation to catch it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211014130231.1468538-1-hch@lst.de Signed-off-by: Jens Axboe commit f7bf35862477d6d4f8a9746c645a4380de984700 Author: Tetsuo Handa Date: Tue Sep 7 19:18:00 2021 +0900 brd: reduce the brd_devices_mutex scope As with commit 8b52d8be86d72308 ("loop: reorder loop_exit"), unregister_blkdev() needs to be called first in order to avoid calling brd_alloc() from brd_probe() after brd_del_one() from brd_exit(). Then, we can avoid holding global mutex during add_disk()/del_gendisk() as with commit 1c500ad706383f1a ("loop: reduce the loop_ctl_mutex scope"). Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/e205f13d-18ff-a49c-0988-7de6ea5ff823@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 43a08c3bdac4cb42eff8fe5e2278bffe0c5c3daa Author: Ziyang Xuan Date: Sat Oct 9 15:40:30 2021 +0800 can: isotp: isotp_sendmsg(): fix TX buffer concurrent access in isotp_sendmsg() When isotp_sendmsg() concurrent, tx.state of all TX processes can be ISOTP_IDLE. The conditions so->tx.state != ISOTP_IDLE and wq_has_sleeper(&so->wait) can not protect TX buffer from being accessed by multiple TX processes. We can use cmpxchg() to try to modify tx.state to ISOTP_SENDING firstly. If the modification of the previous process succeed, the later process must wait tx.state to ISOTP_IDLE firstly. Thus, we can ensure TX buffer is accessed by only one process at the same time. And we should also restore the original tx.state at the subsequent error processes. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/c2517874fbdf4188585cf9ddf67a8fa74d5dbde5.1633764159.git.william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Ziyang Xuan Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 9acf636215a6ce9362fe618e7da4913b8bfe84c8 Author: Ziyang Xuan Date: Sat Oct 9 15:40:18 2021 +0800 can: isotp: isotp_sendmsg(): add result check for wait_event_interruptible() Using wait_event_interruptible() to wait for complete transmission, but do not check the result of wait_event_interruptible() which can be interrupted. It will result in TX buffer has multiple accessors and the later process interferes with the previous process. Following is one of the problems reported by syzbot. ============================================================= WARNING: CPU: 0 PID: 0 at net/can/isotp.c:840 isotp_tx_timer_handler+0x2e0/0x4c0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc7+ #68 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014 RIP: 0010:isotp_tx_timer_handler+0x2e0/0x4c0 Call Trace: ? isotp_setsockopt+0x390/0x390 __hrtimer_run_queues+0xb8/0x610 hrtimer_run_softirq+0x91/0xd0 ? rcu_read_lock_sched_held+0x4d/0x80 __do_softirq+0xe8/0x553 irq_exit_rcu+0xf8/0x100 sysvec_apic_timer_interrupt+0x9e/0xc0 asm_sysvec_apic_timer_interrupt+0x12/0x20 Add result check for wait_event_interruptible() in isotp_sendmsg() to avoid multiple accessers for tx buffer. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/10ca695732c9dd267c76a3c30f37aefe1ff7e32f.1633764159.git.william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Reported-by: syzbot+78bab6958a614b0c80b9@syzkaller.appspotmail.com Signed-off-by: Ziyang Xuan Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit a4fbe70c5cb746441d56b28cf88161d9e0e25378 Author: Zhang Changzhong Date: Thu Oct 14 17:26:40 2021 +0800 can: j1939: j1939_xtp_rx_rts_session_new(): abort TP less than 9 bytes The receiver should abort TP if 'total message size' in TP.CM_RTS and TP.CM_BAM is less than 9 or greater than 1785 [1], but currently the j1939 stack only checks the upper bound and the receiver will accept the following broadcast message: vcan1 18ECFF00 [8] 20 08 00 02 FF 00 23 01 vcan1 18EBFF00 [8] 01 00 00 00 00 00 00 00 vcan1 18EBFF00 [8] 02 00 FF FF FF FF FF FF This patch adds check for the lower bound and abort illegal TP. [1] SAE-J1939-82 A.3.4 Row 2 and A.3.6 Row 6. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/all/1634203601-3460-1-git-send-email-zhangchangzhong@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Zhang Changzhong Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit 379743985ab6cfe2cbd32067cf4ed497baca6d06 Author: Zhang Changzhong Date: Thu Sep 30 11:33:20 2021 +0800 can: j1939: j1939_xtp_rx_dat_one(): cancel session if receive TP.DT with error length According to SAE-J1939-21, the data length of TP.DT must be 8 bytes, so cancel session when receive unexpected TP.DT message. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/all/1632972800-45091-1-git-send-email-zhangchangzhong@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Zhang Changzhong Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit d9d52a3ebd284882f5562c88e55991add5d01586 Author: Ziyang Xuan Date: Sun Sep 26 18:47:57 2021 +0800 can: j1939: j1939_netdev_start(): fix UAF for rx_kref of j1939_priv It will trigger UAF for rx_kref of j1939_priv as following. cpu0 cpu1 j1939_sk_bind(socket0, ndev0, ...) j1939_netdev_start j1939_sk_bind(socket1, ndev0, ...) j1939_netdev_start j1939_priv_set j1939_priv_get_by_ndev_locked j1939_jsk_add ..... j1939_netdev_stop kref_put_lock(&priv->rx_kref, ...) kref_get(&priv->rx_kref, ...) REFCOUNT_WARN("addition on 0;...") ==================================================== refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 20874 at lib/refcount.c:25 refcount_warn_saturate+0x169/0x1e0 RIP: 0010:refcount_warn_saturate+0x169/0x1e0 Call Trace: j1939_netdev_start+0x68b/0x920 j1939_sk_bind+0x426/0xeb0 ? security_socket_bind+0x83/0xb0 The rx_kref's kref_get() and kref_put() should use j1939_netdev_lock to protect. Fixes: 9d71dd0c70099 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/all/20210926104757.2021540-1-william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Reported-by: syzbot+85d9878b19c94f9019ad@syzkaller.appspotmail.com Signed-off-by: Ziyang Xuan Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit b504a884f6b5a77dac7d580ffa08e482f70d1a30 Author: Ziyang Xuan Date: Mon Sep 6 17:42:19 2021 +0800 can: j1939: j1939_tp_rxtimer(): fix errant alert in j1939_tp_rxtimer When the session state is J1939_SESSION_DONE, j1939_tp_rxtimer() will give an alert "rx timeout, send abort", but do nothing actually. Move the alert into session active judgment condition, it is more reasonable. One of the scenarios is that j1939_tp_rxtimer() execute followed by j1939_xtp_rx_abort_one(). After j1939_xtp_rx_abort_one(), the session state is J1939_SESSION_DONE, then j1939_tp_rxtimer() give an alert. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/all/20210906094219.95924-1-william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Ziyang Xuan Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit 85374b6392293d103c2b3406ceb9a1253f81d328 Author: Miles Chen Date: Fri Oct 15 15:46:54 2021 +0800 scsi: sd: Fix crashes in sd_resume_runtime() After commit ed4246d37f3b ("scsi: sd: REQUEST SENSE for BLIST_IGN_MEDIA_CHANGE devices in runtime_resume()"), the following crash was observed. static int sd_resume_runtime(struct device *dev) { struct scsi_disk *sdkp = dev_get_drvdata(dev); struct scsi_device *sdp = sdkp->device; // sdkp == NULL and crash if (sdp->ignore_media_change) { ... } It is possible for sdkp to be NULL in sd_resume_runtime(). To fix this crash, follow sd_resume() to test if sdkp is NULL before dereferencing it. Crash: [ 4.695171][ T151] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [ 4.696591][ T151] Mem abort info: [ 4.697919][ T151] ESR = 0x96000005 [ 4.699692][ T151] EC = 0x25: DABT (current EL), IL = 32 bits [ 4.701990][ T151] SET = 0, FnV = 0 [ 4.702513][ T151] EA = 0, S1PTW = 0 [ 4.704431][ T151] FSC = 0x05: level 1 translation fault [ 4.705254][ T151] Data abort info: [ 4.705806][ T151] ISV = 0, ISS = 0x00000005 [ 4.706484][ T151] CM = 0, WnR = 0 [ 4.707048][ T151] [0000000000000008] user address but active_mm is swapper [ 4.710577][ T151] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 4.832361][ T151] Kernel Offset: 0x12acc80000 from 0xffffffc010000000 [ 4.833254][ T151] PHYS_OFFSET: 0x40000000 [ 4.833814][ T151] pstate: 80400005 (Nzcv daif +PAN -UAO) [ 4.834546][ T151] pc : sd_resume_runtime+0x20/0x14c [ 4.835227][ T151] lr : scsi_runtime_resume+0x84/0xe4 [ 4.835916][ T151] sp : ffffffc0110db8d0 [ 4.836450][ T151] x29: ffffffc0110db8d0 x28: 0000000000000001 [ 4.837258][ T151] x27: ffffff80c0bd1ac0 x26: ffffff80c0bd1ad0 [ 4.838063][ T151] x25: ffffff80cea7e448 x24: ffffffd2bf961000 [ 4.838867][ T151] x23: ffffffd2be69f838 x22: ffffffd2bd9dfb4c [ 4.839670][ T151] x21: 0000000000000000 x20: ffffff80cea7e000 [ 4.840474][ T151] x19: ffffff80cea7e260 x18: ffffffc0110dd078 [ 4.841277][ T151] x17: 00000000658783d9 x16: 0000000051469dac [ 4.842081][ T151] x15: 00000000b87f6327 x14: 0000000068fd680d [ 4.842885][ T151] x13: ffffff80c0bd2470 x12: ffffffd2bfa7f5f0 [ 4.843688][ T151] x11: 0000000000000078 x10: 0000000000000001 [ 4.844492][ T151] x9 : 00000000000000b1 x8 : ffffffd2be69f88c [ 4.845295][ T151] x7 : ffffffd2bd9e0e5c x6 : 0000000000000000 [ 4.846099][ T151] x5 : 0000000000000080 x4 : 0000000000000001 [ 4.846902][ T151] x3 : 68fd680dfe4ebe5e x2 : 0000000000000003 [ 4.847706][ T151] x1 : ffffffd2bf7f9380 x0 : ffffff80cea7e260 [ 4.856708][ T151] die+0x16c/0x59c [ 4.857191][ T151] __do_kernel_fault+0x1e8/0x210 [ 4.857833][ T151] do_page_fault+0xa4/0x654 [ 4.858418][ T151] do_translation_fault+0x6c/0x1b0 [ 4.859083][ T151] do_mem_abort+0x68/0x10c [ 4.859655][ T151] el1_abort+0x40/0x64 [ 4.860182][ T151] el1h_64_sync_handler+0x54/0x88 [ 4.860834][ T151] el1h_64_sync+0x7c/0x80 [ 4.861395][ T151] sd_resume_runtime+0x20/0x14c [ 4.862025][ T151] scsi_runtime_resume+0x84/0xe4 [ 4.862667][ T151] __rpm_callback+0x1f4/0x8cc [ 4.863275][ T151] rpm_resume+0x7e8/0xaa4 [ 4.863836][ T151] __pm_runtime_resume+0xa0/0x110 [ 4.864489][ T151] sd_probe+0x30/0x428 [ 4.865016][ T151] really_probe+0x14c/0x500 [ 4.865602][ T151] __driver_probe_device+0xb4/0x18c [ 4.866278][ T151] driver_probe_device+0x60/0x2c4 [ 4.866931][ T151] __device_attach_driver+0x228/0x2bc [ 4.867630][ T151] __device_attach_async_helper+0x154/0x21c [ 4.868398][ T151] async_run_entry_fn+0x5c/0x1c4 [ 4.869038][ T151] process_one_work+0x3ac/0x590 [ 4.869670][ T151] worker_thread+0x320/0x758 [ 4.870265][ T151] kthread+0x2e8/0x35c [ 4.870792][ T151] ret_from_fork+0x10/0x20 Link: https://lore.kernel.org/r/20211015074654.19615-1-miles.chen@mediatek.com Fixes: ed4246d37f3b ("scsi: sd: REQUEST SENSE for BLIST_IGN_MEDIA_CHANGE devices in runtime_resume()") Cc: Stanley Chu Reviewed-by: Martin Kepplinger Reviewed-by: Stanley Chu Signed-off-by: Miles Chen Signed-off-by: Martin K. Petersen commit 97e6ea6d78064e7f1e9e19c45dc690aabbb71297 Author: Sreekanth Reddy Date: Thu Oct 14 11:24:25 2021 +0530 scsi: mpi3mr: Fix duplicate device entries when scanning through sysfs When scanning devices through the 'scan' attribute in sysfs, the user will observe duplicate device entries in lsscsi command output. Set the shost's max_channel to zero to avoid this. Link: https://lore.kernel.org/r/20211014055425.30719-1-sreekanth.reddy@broadcom.com Fixes: 824a156633df ("scsi: mpi3mr: Base driver code") Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 4e5a04be88fe335ad5331f4f8c17f4ebd357e065 Author: Sachi King Date: Sat Oct 9 14:32:40 2021 +1100 pinctrl: amd: disable and mask interrupts on probe Some systems such as the Microsoft Surface Laptop 4 leave interrupts enabled and configured for use in sleep states on boot, which cause unexpected behaviour such as spurious wakes and failed resumes in s2idle states. As interrupts should not be enabled until they are claimed and explicitly enabled, disabling any interrupts mistakenly left enabled by firmware should be safe. Signed-off-by: Sachi King Link: https://lore.kernel.org/r/20211009033240.21543-1-nakato@nakato.io Signed-off-by: Linus Walleij commit d999ade1cc86cd2951d41c11ea769cb4452c8811 Merge: ccfb5ceb40072 3ff6d64e68abc Author: Linus Torvalds Date: Sat Oct 16 11:11:07 2021 -0700 Merge tag 'perf-tools-fixes-for-v5.15-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix 'perf test evsel' build error on !x86 architectures - Fix libperf's test_stat_cpu mixup of CPU numbers and CPU indexes - Output offsets for decompressed records, not just useless zeros * tag 'perf-tools-fixes-for-v5.15-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: libperf tests: Fix test_stat_cpu libperf test evsel: Fix build error on !x86 architectures perf report: Output non-zero offset for decompressed records commit ccfb5ceb400720969d6118c740c2fc37bcf990b8 Merge: 368a978cc52ad 6e44bd6d34d65 Author: Linus Torvalds Date: Sat Oct 16 10:57:13 2021 -0700 Merge tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock fix from Mike Rapoport: "Fix handling of NOMAP regions with kmemleak. NOMAP regions don't have linear map entries so an attempt to scan these areas in kmemleak would fault. Prevent such faults by excluding NOMAP regions from kmemleak" * tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: exclude NOMAP regions from kmemleak commit 368a978cc52ad14f90bd04a7d94ec0070da3e1c1 Merge: 6985c40ab6c5d be358af1191b1 Author: Linus Torvalds Date: Sat Oct 16 10:51:41 2021 -0700 Merge tag 'trace-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Tracing fixes for 5.15: - Fix defined but not use warning/error for osnoise function - Fix memory leak in event probe - Fix memblock leak in bootconfig - Fix the API of event probes to be like kprobes - Added test to check removal of event probe API - Fix recordmcount.pl for nds32 failed build * tag 'trace-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: nds32/ftrace: Fix Error: invalid operands (*UND* and *UND* sections) for `^' selftests/ftrace: Update test for more eprobe removal process tracing: Fix event probe removal from dynamic events tracing: Fix missing * in comment block bootconfig: init: Fix memblock leak in xbc_make_cmdline() tracing: Fix memory leak in eprobe_register() tracing: Fix missing osnoise tracer on max_latency commit 6985c40ab6c5d63a494ce9adce9a4768364f2507 Merge: dcd619847ca7b 92c02ff1a43ed Author: Linus Torvalds Date: Sat Oct 16 10:22:08 2021 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk driver fixes from Stephen Boyd: "Clk driver fixes for critical issues found in the past few weeks: - Select gdsc config so qcom sm6350 driver probes - Fix a register offset in qcom gcc-sm6115 so the correct clk is controlled - Fix inverted logic in Renesas RZ/G2L .is_enabled() - Mark some more clks critical in Renesas clk driver - Remove a duplicate clk in the agilex driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: qcom: add select QCOM_GDSC for SM6350 clk: qcom: gcc-sm6115: Fix offset for hlos1_vote_turing_mmu_tbu0_gdsc clk: socfpga: agilex: fix duplicate s2f_user0_clk clk: renesas: rzg2l: Fix clk status function clk: renesas: r9a07g044: Mark IA55_CLK and DMAC_ACLK critical commit dcd619847ca7b1f3123ba35976225ee77b83f959 Merge: 304040fb4909f d208b89401e07 Author: Linus Torvalds Date: Sat Oct 16 10:12:21 2021 -0700 Merge tag 'for-5.15/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 verity target to skip redundant processing on I/O errors. - Fix request-based DM so that it doesn't queue request to blk-mq when DM device is suspended. - Fix DM core mempool NULL pointer race when completing IO. - Make DM clone target's 'descs' array static. * tag 'for-5.15/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix mempool NULL pointer race when completing IO dm rq: don't queue request to blk-mq during DM suspend dm clone: make array 'descs' static dm verity: skip redundant verity_handle_err() on I/O errors commit 304040fb4909f7771caf6f8e8c61dbe51c93505a Merge: c13f946bf1ef0 8b7216439e2e2 Author: Linus Torvalds Date: Sat Oct 16 09:14:55 2021 -0700 Merge tag 's390-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Maintainers and reviewers changes: * Cornelia decided to free up her time and step down from vfio-ccw maintainer and s390 kvm reviewer duties * Add Alexander Gordeev as s390 arch code reviewer - Fix broken strrchr implementation * tag 's390-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: add Alexander Gordeev as reviewer s390: fix strrchr() implementation vfio-ccw: step down as maintainer KVM: s390: remove myself as reviewer commit c13f946bf1ef0eef49748b1824a0bdfb3487fe8c Merge: 5fd01b7263999 e21e52ad1e012 Author: Linus Torvalds Date: Sat Oct 16 09:12:18 2021 -0700 Merge tag 'csky-for-linus-5.15-rc6' of git://github.com/c-sky/csky-linux Pull csky fixes from Guo Ren: "Only 5 fixups: - Make HAVE_TCM depend on !COMPILE_TEST - bitops: Remove duplicate __clear_bit define - Select ARCH_WANT_FRAME_POINTERS only if compiler supports it - Fixup regs.sr broken in ptrace - don't let sigreturn play with priveleged bits of status register" * tag 'csky-for-linus-5.15-rc6' of git://github.com/c-sky/csky-linux: csky: Make HAVE_TCM depend on !COMPILE_TEST csky: bitops: Remove duplicate __clear_bit define csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it csky: Fixup regs.sr broken in ptrace csky: don't let sigreturn play with priveleged bits of status register commit 5fd01b7263999c09f0596f5efd726b681474283c Merge: f04298169d9c5 c3ca31ce0ea1e Author: Linus Torvalds Date: Sat Oct 16 09:09:27 2021 -0700 Merge tag 'arc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fix from Vineet Gupta: "Small fixlet for ARC" * tag 'arc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: fix potential build snafu commit f04298169d9c522d611a2ce8c54489990c38e72f Merge: 5a7ee55b1fcd2 011ace4a7fadc Author: Linus Torvalds Date: Sat Oct 16 09:05:58 2021 -0700 Merge tag 'arm-soc-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "A small number fixes this time, mostly touching actual code: - Add platform device for i.MX System Reset Controller (SRC) to fix a regression caused by fw_devlink change - A fixup for a boot regression caused by my own rework for the Qualcomm SCM driver - Multiple bugfixes for the Arm FFA and optee firmware drivers, addressing problems when they are built as a loadable module - Four dts bugfixes for the Broadcom SoC used in Raspberry pi, addressing VEC (video encoder), MDIO bus controller #address-cells/#size-cells, SDIO voltage and PCIe host bridge dtc warnings" * tag 'arm-soc-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: imx: register reset controller from a platform driver iommu/arm: fix ARM_SMMU_QCOM compilation ARM: dts: bcm2711-rpi-4-b: Fix usb's unit address ARM: dts: bcm2711-rpi-4-b: Fix pcie0's unit address formatting tee: optee: Fix missing devices unregister during optee_remove ARM: dts: bcm2711-rpi-4-b: fix sd_io_1v8_reg regulator states ARM: dts: bcm2711: fix MDIO #address- and #size-cells ARM: dts: bcm283x: Fix VEC address for BCM2711 firmware: arm_ffa: Fix __ffa_devices_unregister firmware: arm_ffa: Add missing remove callback to ffa_bus_type commit 5a7ee55b1fcd23ebdb740fde9f4d795fff1b7443 Merge: 711c3686676ee 2b94b6b79b7c2 Author: Linus Torvalds Date: Sat Oct 16 09:00:46 2021 -0700 Merge tag 'pci-v5.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: - Don't save msi_populate_sysfs() error code as dev->msi_irq_groups so we don't dereference the error code as a pointer (Wang Hai) * tag 'pci-v5.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/MSI: Handle msi_populate_sysfs() errors correctly commit 711c3686676eed0f88d494a187261e6a96c932b1 Merge: 8fe31e0995f04 1ea1dbf1f54c3 Author: Linus Torvalds Date: Sat Oct 16 08:45:46 2021 -0700 Merge tag 'acpi-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Add a missing device ID to a quirk list in the suspend-to-idle support code" * tag 'acpi-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: Include alternate AMDI0005 id in special behaviour commit fac3cb82a54a4b7c49c932f96ef196cf5774344c Author: Nikolay Aleksandrov Date: Fri Oct 15 12:05:46 2021 +0300 net: bridge: mcast: use multicast_membership_interval for IGMPv3 When I added IGMPv3 support I decided to follow the RFC for computing the GMI dynamically: " 8.4. Group Membership Interval The Group Membership Interval is the amount of time that must pass before a multicast router decides there are no more members of a group or a particular source on a network. This value MUST be ((the Robustness Variable) times (the Query Interval)) plus (one Query Response Interval)." But that actually is inconsistent with how the bridge used to compute it for IGMPv2, where it was user-configurable that has a correct default value but it is up to user-space to maintain it. This would make it consistent with the other timer values which are also maintained correct by the user instead of being dynamically computed. It also changes back to the previous user-expected GMI behaviour for IGMPv3 queries which were supported before IGMPv3 was added. Note that to properly compute it dynamically we would need to add support for "Robustness Variable" which is currently missing. Reported-by: Hangbin Liu Fixes: 0436862e417e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit b2381acd3fd9bacd2c63f53b2c610c89959b31cc Author: Borislav Petkov Date: Fri Oct 15 12:46:25 2021 +0200 x86/fpu: Mask out the invalid MXCSR bits properly This is a fix for the fix (yeah, /facepalm). The correct mask to use is not the negation of the MXCSR_MASK but the actual mask which contains the supported bits in the MXCSR register. Reported and debugged by Ville Syrjälä Fixes: d298b03506d3 ("x86/fpu: Restore the masking out of reserved MXCSR bits") Signed-off-by: Borislav Petkov Tested-by: Ville Syrjälä Tested-by: Ser Olmy Cc: Link: https://lore.kernel.org/r/YWgYIYXLriayyezv@intel.com commit 0b28c41e3c951ea3d4f012cfa9da5ebd6512cf6e Author: Frieder Schrempf Date: Fri Oct 15 14:48:40 2021 +0200 arm64: dts: imx8mm-kontron: Fix connection type for VSC8531 RGMII PHY Previously we falsely relied on the PHY driver to unconditionally enable the internal RX delay. Since the following fix for the PHY driver this is not the case anymore: commit 7b005a1742be ("net: phy: mscc: configure both RX and TX internal delays for RGMII") In order to enable the delay we need to set the connection type to "rgmii-rxid". Without the RX delay the ethernet is not functional at all. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit ca6f9d85d5944046a241b325700c1ca395651c28 Author: Frieder Schrempf Date: Fri Oct 15 14:48:39 2021 +0200 arm64: dts: imx8mm-kontron: Fix CAN SPI clock frequency The MCP2515 can be used with an SPI clock of up to 10 MHz. Set the limit accordingly to prevent any performance issues caused by the really low clock speed of 100 kHz. This removes the arbitrarily low limit on the SPI frequency, that was caused by a typo in the original dts. Without this change, receiving CAN messages on the board beyond a certain bitrate will cause overrun errors (see 'ip -det -stat link show can0'). With this fix, receiving messages on the bus works without any overrun errors for bitrates up to 1 MBit. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 6562d6e350284307e33ea10c7f46a6661ff22770 Author: Frieder Schrempf Date: Fri Oct 15 14:48:38 2021 +0200 arm64: dts: imx8mm-kontron: Fix polarity of reg_rst_eth2 The regulator reg_rst_eth2 should keep the reset signal of the USB ethernet adapter deasserted anytime. Fix the polarity and mark it as always-on. Anyway, using the regulator is only a workaround for the missing support of specifying a reset GPIO for USB devices in a generic way. As we don't have a solution for this at the moment, at least fix the current workaround. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 256a24eba7f897c817fb0103dac73467d3789202 Author: Frieder Schrempf Date: Fri Oct 15 14:48:37 2021 +0200 arm64: dts: imx8mm-kontron: Set lower limit of VDD_SNVS to 800 mV According to the datasheet the typical value for VDD_SNVS should be 800 mV, so let's make sure that this is within the range of the regulator. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 82a4f329b133ad0de66bee12c0be5c67bb8aa188 Author: Frieder Schrempf Date: Fri Oct 15 14:48:36 2021 +0200 arm64: dts: imx8mm-kontron: Make sure SOC and DRAM supply voltages are correct It looks like the voltages for the SOC and DRAM supply weren't properly validated before. The datasheet and uboot-imx code tells us that VDD_SOC should be 800 mV in suspend and 850 mV in run mode. VDD_DRAM should be 950 mV for DDR clock frequencies of up to 1.5 GHz. Let's fix these values to make sure the voltages are within the required range. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit a02dcde595f7cbd240ccd64de96034ad91cffc40 Author: Nathan Chancellor Date: Fri Oct 15 13:13:06 2021 -0700 Input: touchscreen - avoid bitwise vs logical OR warning A new warning in clang points out a few places in this driver where a bitwise OR is being used with boolean types: drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This use of a bitwise OR is intentional, as bitwise operations do not short circuit, which allows all the calls to touchscreen_get_prop_u32() to happen so that the last parameter is initialized while coalescing the results of the calls to make a decision after they are all evaluated. To make this clearer to the compiler, use the '|=' operator to assign the result of each touchscreen_get_prop_u32() call to data_present, which keeps the meaning of the code the same but makes it obvious that every one of these calls is expected to happen. Signed-off-by: Nathan Chancellor Reported-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20211014205757.3474635-1-nathan@kernel.org Signed-off-by: Dmitry Torokhov commit 3378a07daa6cdd11e042797454c706d1c69f9ca6 Author: Michael Cullen Date: Fri Oct 15 13:17:50 2021 -0700 Input: xpad - add support for another USB ID of Nacon GC-100 The Nacon GX100XF is already mapped, but it seems there is a Nacon GC-100 (identified as NC5136Wht PCGC-100WHITE though I believe other colours exist) with a different USB ID when in XInput mode. Signed-off-by: Michael Cullen Link: https://lore.kernel.org/r/20211015192051.5196-1-michael@michaelcullen.name Signed-off-by: Dmitry Torokhov commit fe0a7e3d012738b0034b3c97ddb0e8bc0a3ff0e6 Author: Oleksij Rempel Date: Fri Oct 15 21:12:06 2021 -0700 Input: resistive-adc-touch - fix division by zero error on z1 == 0 For proper pressure calculation we need at least x and z1 to be non zero. Even worse, in case z1 we may run in to division by zero error. Fixes: 60b7db914ddd ("Input: resistive-adc-touch - rework mapping of channels") Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20211007095727.29579-1-o.rempel@pengutronix.de Signed-off-by: Dmitry Torokhov commit d997cc1715df7b6c3df798881fb9941acf0079f8 Author: Uwe Kleine-König Date: Fri Oct 15 21:19:33 2021 -0700 Input: snvs_pwrkey - add clk handling On i.MX7S and i.MX8M* (but not i.MX6*) the pwrkey device has an associated clock. Accessing the registers requires that this clock is enabled. Binding the driver on at least i.MX7S and i.MX8MP while not having the clock enabled results in a complete hang of the machine. (This usually only happens if snvs_pwrkey is built as a module and the rtc-snvs driver isn't already bound because at bootup the required clk is on and only gets disabled when the clk framework disables unused clks late during boot.) This completes the fix in commit 135be16d3505 ("ARM: dts: imx7s: add snvs clock to pwrkey"). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211013062848.2667192-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit c41108049d143304faf06852c7181262b7b0d242 Author: Christoph Hellwig Date: Tue Oct 12 11:33:01 2021 +0200 kyber: avoid q->disk dereferences in trace points q->disk becomes invalid after the gendisk is removed. Work around this by caching the dev_t for the tracepoints. The real fix would be to properly tear down the I/O schedulers with the gendisk, but that is a much more invasive change. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211012093301.GA27795@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit aec89dc5d421200b353d99a2bfff9e0967f67037 Author: Christoph Hellwig Date: Wed Sep 29 09:12:41 2021 +0200 block: keep q_usage_counter in atomic mode after del_gendisk Don't switch back to percpu mode to avoid the double RCU grace period when tearing down SCSI devices. After removing the disk only passthrough commands can be send anyway. Suggested-by: Ming Lei Signed-off-by: Christoph Hellwig Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210929071241.934472-6-hch@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit 8e141f9eb803e209714a80aa6ec073893f94c526 Author: Christoph Hellwig Date: Wed Sep 29 09:12:40 2021 +0200 block: drain file system I/O on del_gendisk Instead of delaying draining of file system I/O related items like the blk-qos queues, the integrity read workqueue and timeouts only when the request_queue is removed, do that when del_gendisk is called. This is important for SCSI where the upper level drivers that control the gendisk are separate entities, and the disk can be freed much earlier than the request_queue, or can even be unbound without tearing down the queue. Fixes: edb0872f44ec ("block: move the bdi from the request_queue to the gendisk") Reported-by: Ming Lei Signed-off-by: Christoph Hellwig Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210929071241.934472-5-hch@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit a6741536f44ae65491cfde6870ae518aabe1ca36 Author: Christoph Hellwig Date: Wed Sep 29 09:12:39 2021 +0200 block: split bio_queue_enter from blk_queue_enter To prepare for fixing a gendisk shutdown race, open code the blk_queue_enter logic in bio_queue_enter. This also removes the pointless flags translation. Signed-off-by: Christoph Hellwig Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210929071241.934472-4-hch@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit 1f14a0989073459c2be6b5c7b3fb7f9f3d7fa2af Author: Christoph Hellwig Date: Wed Sep 29 09:12:38 2021 +0200 block: factor out a blk_try_enter_queue helper Factor out the code to try to get q_usage_counter without blocking into a separate helper. Both to improve code readability and to prepare for splitting bio_queue_enter from blk_queue_enter. Signed-off-by: Christoph Hellwig Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210929071241.934472-3-hch@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit cc9c884dd7f4f036965e23f5445f838db316eb46 Author: Christoph Hellwig Date: Wed Sep 29 09:12:37 2021 +0200 block: call submit_bio_checks under q_usage_counter Ensure all bios check the current values of the queue under freeze protection, i.e. to make sure the zero capacity set by del_gendisk is actually seen before dispatching to the driver. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210929071241.934472-2-hch@lst.de Tested-by: Yi Zhang Signed-off-by: Jens Axboe commit be358af1191b1b2fedebd8f3421cafdc8edacc7d Author: Steven Rostedt Date: Thu Oct 14 14:35:07 2021 -0400 nds32/ftrace: Fix Error: invalid operands (*UND* and *UND* sections) for `^' I received a build failure for a new patch I'm working on the nds32 architecture, and when I went to test it, I couldn't get to my build error, because it failed to build with a bunch of: Error: invalid operands (*UND* and *UND* sections) for `^' issues with various files. Those files were temporary asm files that looked like: kernel/.tmp_mc_fork.s I decided to look deeper, and found that the "mc" portion of that name stood for "mcount", and was created by the recordmcount.pl script. One that I wrote over a decade ago. Once I knew the source of the problem, I was able to investigate it further. The way the recordmcount.pl script works (BTW, there's a C version that simply modifies the ELF object) is by doing an "objdump" on the object file. Looks for all the calls to "mcount", and creates an offset of those locations from some global variable it can use (usually a global function name, found with <.*>:). Creates a asm file that is a table of references to these locations, using the found variable/function. Compiles it and links it back into the original object file. This asm file is called ".tmp_mc_.s". The problem here is that the objdump produced by the nds32 object file, contains things that look like: 0000159a <.L3^B1>: 159a: c6 00 beqz38 $r6, 159a <.L3^B1> 159a: R_NDS32_9_PCREL_RELA .text+0x159e 159c: 84 d2 movi55 $r6, #-14 159e: 80 06 mov55 $r0, $r6 15a0: ec 3c addi10.sp #0x3c Where ".L3^B1 is somehow selected as the "global" variable to index off of. Then the assembly file that holds the mcount locations looks like this: .section __mcount_loc,"a",@progbits .align 2 .long .L3^B1 + -5522 .long .L3^B1 + -5384 .long .L3^B1 + -5270 .long .L3^B1 + -5098 .long .L3^B1 + -4970 .long .L3^B1 + -4758 .long .L3^B1 + -4122 [...] And when it is compiled back to an object to link to the original object, the compile fails on the "^" symbol. Simple solution for now, is to have the perl script ignore using function symbols that have an "^" in the name. Link: https://lkml.kernel.org/r/20211014143507.4ad2c0f7@gandalf.local.home Cc: stable@vger.kernel.org Acked-by: Greentime Hu Fixes: fbf58a52ac088 ("nds32/ftrace: Add RECORD_MCOUNT support") Signed-off-by: Steven Rostedt (VMware) commit c3ca31ce0ea1e1ae34748ded54b6ccc319e7ed20 Author: Vineet Gupta Date: Fri Oct 15 10:43:35 2021 -0700 ARC: fix potential build snafu In the big pgtable header split, I inadvertently introduced a couple of duplicate symbols. Fixes: fe6cb7b043b69cd9 ("ARC: mm: disintegrate pgtable.h into levels and flags") Signed-off-by: Vineet Gupta commit ba95a6225b02c24d99f39fd930b6a388e5fd7b48 Author: Stefano Garzarella Date: Thu Oct 14 17:20:45 2021 +0200 vsock_diag_test: remove free_sock_stat() call in test_no_sockets In `test_no_sockets` we don't expect any sockets, indeed check_no_sockets() prints an error and exits if `sockets` list is not empty, so free_sock_stat() call is unnecessary since it would only be called when the `sockets` list is empty. This was discovered by a strange warning printed by gcc v11.2.1: In file included from ../../include/linux/list.h:7, from vsock_diag_test.c:18: vsock_diag_test.c: In function ‘test_no_sockets’: ../../include/linux/kernel.h:35:45: error: array subscript ‘struct vsock_stat[0]’ is partly outside array bound s of ‘struct list_head[1]’ [-Werror=array-bounds] 35 | const typeof(((type *)0)->member) * __mptr = (ptr); \ | ^~~~~~ ../../include/linux/list.h:352:9: note: in expansion of macro ‘container_of’ 352 | container_of(ptr, type, member) | ^~~~~~~~~~~~ ../../include/linux/list.h:393:9: note: in expansion of macro ‘list_entry’ 393 | list_entry((pos)->member.next, typeof(*(pos)), member) | ^~~~~~~~~~ ../../include/linux/list.h:522:21: note: in expansion of macro ‘list_next_entry’ 522 | n = list_next_entry(pos, member); \ | ^~~~~~~~~~~~~~~ vsock_diag_test.c:325:9: note: in expansion of macro ‘list_for_each_entry_safe’ 325 | list_for_each_entry_safe(st, next, sockets, list) { | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from vsock_diag_test.c:18: vsock_diag_test.c:333:19: note: while referencing ‘sockets’ 333 | LIST_HEAD(sockets); | ^~~~~~~ ../../include/linux/list.h:23:26: note: in definition of macro ‘LIST_HEAD’ 23 | struct list_head name = LIST_HEAD_INIT(name) It seems related to some compiler optimization and assumption about the empty `sockets` list, since this warning is printed only with -02 or -O3. Also removing `exit(1)` from check_no_sockets() makes the warning disappear since in that case free_sock_stat() can be reached also when the list is not empty. Reported-by: Marc-André Lureau Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20211014152045.173872-1-sgarzare@redhat.com Signed-off-by: Jakub Kicinski commit 2151135a1f613c16c134c3674382a1f202868486 Merge: 0857d6f8c759d b726ddf984a56 Author: Jakub Kicinski Date: Fri Oct 15 17:20:15 2021 -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 2021-10-14 Brett ensures RDMA nodes are removed during release and rebuild. He also corrects fw.mgmt.api to include the patch number for proper identification. Dave stops ida_free() being called when an IDA has not been allocated. Michal corrects the order of parameters being provided and the number of entries skipped for UDP tunnels. ==================== Link: https://lore.kernel.org/r/20211014181953.3538330-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit e21e52ad1e0126e2a5e2013084ac3f47cf1e887a Author: Guenter Roeck Date: Thu Sep 16 21:38:38 2021 -0700 csky: Make HAVE_TCM depend on !COMPILE_TEST Building csky:allmodconfig results in the following build errors. arch/csky/mm/tcm.c:9:2: error: #error "You should define ITCM_RAM_BASE" 9 | #error "You should define ITCM_RAM_BASE" | ^~~~~ arch/csky/mm/tcm.c:14:2: error: #error "You should define DTCM_RAM_BASE" 14 | #error "You should define DTCM_RAM_BASE" | ^~~~~ arch/csky/mm/tcm.c:18:2: error: #error "You should define correct DTCM_RAM_BASE" 18 | #error "You should define correct DTCM_RAM_BASE" This is seen with compile tests since those enable HAVE_TCM, but do not provide useful default values for ITCM_RAM_BASE or DTCM_RAM_BASE. Disable HAVE_TCM for commpile tests to avoid the error. Signed-off-by: Guenter Roeck Signed-off-by: Guo Ren commit fb5d69a5cd7865a733c2c1f26e2e3b75f59ce00d Author: Guenter Roeck Date: Thu Sep 16 21:38:37 2021 -0700 csky: bitops: Remove duplicate __clear_bit define Building csky:allmodconfig results in the following build error. In file included from ./include/linux/bitops.h:33, from ./include/linux/log2.h:12, from kernel/bounds.c:13: ./arch/csky/include/asm/bitops.h:77: error: "__clear_bit" redefined Since commit 9248e52fec95 ("locking/atomic: simplify non-atomic wrappers"), __clear_bit is defined in include/asm-generic/bitops/non-atomic.h, and the define in the csky include file is no longer necessary or useful. Remove it. Fixes: 9248e52fec95 ("locking/atomic: simplify non-atomic wrappers") Signed-off-by: Guenter Roeck Signed-off-by: Guo Ren commit aeba0b84dd07a9e6b362395f5ad47091249db13d Author: Guenter Roeck Date: Thu Sep 16 21:38:36 2021 -0700 csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it Compiling csky:allmodconfig with an upstream C compiler results in the following error. csky-linux-gcc: error: unrecognized command-line option '-mbacktrace'; did you mean '-fbacktrace'? Select ARCH_WANT_FRAME_POINTERS only if gcc supports it to avoid the error. Signed-off-by: Guenter Roeck Signed-off-by: Guo Ren commit af89ebaa64de726ca0a39bbb0bf0c81a1f43ad50 Author: Guo Ren Date: Fri Sep 24 15:33:38 2021 +0800 csky: Fixup regs.sr broken in ptrace gpr_get() return the entire pt_regs (include sr) to userspace, if we don't restore the C bit in gpr_set, it may break the ALU result in that context. So the C flag bit is part of gpr context, that's why riscv totally remove the C bit in the ISA. That makes sr reg clear from userspace to supervisor privilege. Signed-off-by: Guo Ren Cc: Al Viro Cc: stable@vger.kernel.org commit fbd63c08cdcca5fb1315aca3172b3c9c272cfb4f Author: Al Viro Date: Fri Sep 24 00:35:42 2021 +0000 csky: don't let sigreturn play with priveleged bits of status register csky restore_sigcontext() blindly overwrites regs->sr with the value it finds in sigcontext. Attacker can store whatever they want in there, which includes things like S-bit. Userland shouldn't be able to set that, or anything other than C flag (bit 0). Do the same thing other architectures with protected bits in flags register do - preserve everything that shouldn't be settable in user mode, picking the rest from the value saved is sigcontext. Signed-off-by: Al Viro Signed-off-by: Guo Ren Cc: stable@vger.kernel.org commit 0857d6f8c759d95f89d0436f86cdfd189ef99f20 Author: Stephen Suryaputra Date: Thu Oct 14 09:08:45 2021 -0400 ipv6: When forwarding count rx stats on the orig netdev Commit bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev") does not work when ip6_forward() executes on the skbs with vrf-enslaved netdev. Use IP6CB(skb)->iif to get to the right one. Add a selftest script to verify. Fixes: bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev") Signed-off-by: Stephen Suryaputra Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20211014130845.410602-1-ssuryaextr@gmail.com Signed-off-by: Jakub Kicinski commit 011ace4a7fadcbe8670b615e0db1e8d7b813ee6c Merge: 0f0f80d9d5db0 a1467faa10414 Author: Arnd Bergmann Date: Fri Oct 15 20:48:06 2021 +0200 Merge tag 'imx-fixes-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.15, round 3: - Add platform device for i.MX System Reset Controller (SRC) to fix a regression caused by fw_devlink change. * tag 'imx-fixes-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx: register reset controller from a platform driver Link: https://lore.kernel.org/r/20211015070017.GI22881@dragon Signed-off-by: Arnd Bergmann commit eadeb06e7645f7a7ddbcfac39480be3892a60ae3 Merge: d94befbb5ae37 6b9b546dc0079 Author: Takashi Iwai Date: Fri Oct 15 17:43:46 2021 +0200 Merge tag 'asoc-fix-v5.15-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.15 A colletion of smallish mostly driver specific fixes, the biggest thing here is fixing some of the core code to generate change notifications properly when writing to controls which will fix issues with UIs not showing the correct values. There's one build fix here with a slightly misleading changelog saying it's adding IRQ config support, it's adding a missing select of the regmap-irq code rather than adding a feature. commit 8fe31e0995f048d16b378b90926793a0aa4af1e5 Merge: 985f6ab93fc98 6fda593f3082e Author: Linus Torvalds Date: Fri Oct 15 10:27:20 2021 -0400 Merge tag 'gpio-fixes-for-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix module autoloading on gpio-74x164 after a revert of OF modaliases - fix problems with the bias setting in gpio-pca953x - fix a use-after-free bug in gpio-mockup by using software nodes * tag 'gpio-fixes-for-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mockup: Convert to use software nodes gpio: pca953x: Improve bias setting gpio: 74x164: Add SPI device ID table commit 985f6ab93fc986f339654b5cb2e6825839bf3bc5 Merge: ccb6a666d5556 16a8e2fbb2d49 Author: Linus Torvalds Date: Fri Oct 15 10:21:46 2021 -0400 Merge tag 'spi-fix-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few small fixes. Mostly driver specific but there's one in the core which fixes a deadlock when adding devices on spi-mux that's triggered because spi-mux is a SPI device which is itself a SPI controller and so can instantiate devices when registered. We were using a global lock to protect against reusing chip selects but they're a per controller thing so moving the lock per controller resolves that" * tag 'spi-fix-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi-mux: Fix false-positive lockdep splats spi: Fix deadlock when adding SPI controllers on SPI buses spi: bcm-qspi: clear MSPI spifie interrupt during probe spi: spi-nxp-fspi: don't depend on a specific node name erratum workaround spi: mediatek: skip delays if they are 0 spi: atmel: Fix PDC transfer setup bug spi: spidev: Add SPI ID table spi: Use 'flash' node name instead of 'spi-flash' in example commit ccb6a666d555652232e845352b9ff7217aca85cb Merge: 9e795d94deafd beb76cb4eebf9 Author: Linus Torvalds Date: Fri Oct 15 10:20:18 2021 -0400 Merge tag 'regulator-fix-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "Just a trivial fix to the MAINTAINERS file for an update missed during conversion of the DT bindings to YAML format" * tag 'regulator-fix-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: MAINTAINERS: rectify entry for SY8106A REGULATOR DRIVER commit 7a33488705008b5bb5f8d95d05326dcc64fc55f4 Author: Ralph Boehme Date: Fri Oct 15 12:52:58 2021 +0900 ksmbd: validate credit charge after validating SMB2 PDU body size smb2_validate_credit_charge() accesses fields in the SMB2 PDU body, but until smb2_calc_size() is called the PDU has not yet been verified to be large enough to access the PDU dynamic part length field. Acked-by: Namjae Jeon Signed-off-by: Ralph Boehme Signed-off-by: Steve French commit 2ea086e35c3d726a3bacd0a971c1f02a50e98206 Author: Hyunchul Lee Date: Fri Oct 15 06:02:50 2021 +0900 ksmbd: add buffer validation for smb direct Add buffer validation for smb direct. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit 4bc59477c3298b191c72b5d99feb54a1dc8c254d Author: Namjae Jeon Date: Fri Oct 15 17:14:02 2021 +0900 ksmbd: limit read/write/trans buffer size not to exceed 8MB ksmbd limit read/write/trans buffer size not to exceed maximum 8MB. And set the minimum value of max response buffer size to 64KB. Windows client doesn't send session setup request if ksmbd set max trans/read/write size lower than 64KB in smb2 negotiate. It means windows allow at least 64 KB or more about this value. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9e795d94deafd007bd6702679a02b82facc6e7ea Merge: 591a495d440ff f60f5741002b9 Author: Linus Torvalds Date: Fri Oct 15 10:13:00 2021 -0400 Merge tag 'mtd/fixes-for-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd fix from Miquel Raynal: "Raw NAND controller driver fix: - Qcom: Update code word value for raw reads (QPIC v2+)" * tag 'mtd/fixes-for-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: qcom: Update code word value for raw read commit 591a495d440ff8dd2b51a47eb6053c83f68a7f6b Merge: 86a44e9067c95 a14bc107edd0c Author: Linus Torvalds Date: Fri Oct 15 10:09:09 2021 -0400 Merge tag 'drm-fixes-2021-10-15-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "It has a few scattered msm and i915 fixes, a few core fixes and a mediatek feature revert. I've had to pick a bunch of patches into this, as the drm-misc-fixes tree had a bunch of vc4 patches I wasn't comfortable with sending to you at least as part of this, they were delayed due to your reverts. If it's really useful as fixes I'll do a separate pull. Summary: Core: - clamp fbdev size - edid cap blocks read to avoid out of bounds panel: - fix missing crc32 dependency msm: - Fix a new crash on dev file close if the dev file was opened when GPU is not loaded (such as missing fw in initrd) - Switch to single drm_sched_entity per priority level per drm_file to unbreak multi-context userspace - Serialize GMU access to fix GMU OOB errors - Various error path fixes - A couple integer overflow fixes - Fix mdp5 cursor plane WARNs i915: - Fix ACPI object leak - Fix context leak in user proto-context creation - Fix missing i915_sw_fence_fini call hyperv: - hide hw pointer nouveau: - fix engine selection bit r128: - fix UML build rcar-du: - unconncted LVDS regression fix mediatek: - revert CMDQ refinement patches" * tag 'drm-fixes-2021-10-15-1' of git://anongit.freedesktop.org/drm/drm: (34 commits) drm/panel: olimex-lcd-olinuxino: select CRC32 drm/r128: fix build for UML drm/nouveau/fifo: Reinstate the correct engine bit programming drm/hyperv: Fix double mouse pointers drm/fbdev: Clamp fbdev surface size if too large drm/edid: In connector_bad_edid() cap num_of_ext by num_blocks read drm/i915: Free the returned object of acpi_evaluate_dsm() drm/i915: Fix bug in user proto-context creation that leaked contexts drm: rcar-du: Don't create encoder for unconnected LVDS outputs drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling drm/msm/dsi: Fix an error code in msm_dsi_modeset_init() drm/msm/dsi: dsi_phy_14nm: Take ready-bit into account in poll_for_ready drm/msm/dsi/phy: fix clock names in 28nm_8960 phy drm/msm/dpu: Fix address of SM8150 PINGPONG5 IRQ register drm/msm: Do not run snapshot on non-DPU devices drm/msm/a3xx: fix error handling in a3xx_gpu_init() drm/msm/a4xx: fix error handling in a4xx_gpu_init() drm/msm: Fix null pointer dereference on pointer edp drm/msm/mdp5: fix cursor-related warnings drm/msm: Avoid potential overflow in timeout_to_jiffies() ... commit 86a44e9067c95083d5dbf5a140e3f4560e5af1ca Merge: ec681c53f8d2d 8607954cf2553 Author: Linus Torvalds Date: Fri Oct 15 09:58:11 2021 -0400 Merge tag 'ntfs3_for_5.15' of git://github.com/Paragon-Software-Group/linux-ntfs3 Pull ntfs3 fixes from Konstantin Komarov: "Use the new api for mounting as requested by Christoph. Also fixed: - some memory leaks and panic - xfstests (tested on x86_64) generic/016 generic/021 generic/022 generic/041 generic/274 generic/423 - some typos, wrong returned error codes, dead code, etc" * tag 'ntfs3_for_5.15' of git://github.com/Paragon-Software-Group/linux-ntfs3: (70 commits) fs/ntfs3: Check for NULL pointers in ni_try_remove_attr_list fs/ntfs3: Refactor ntfs_read_mft fs/ntfs3: Refactor ni_parse_reparse fs/ntfs3: Refactor ntfs_create_inode fs/ntfs3: Refactor ntfs_readlink_hlp fs/ntfs3: Rework ntfs_utf16_to_nls fs/ntfs3: Fix memory leak if fill_super failed fs/ntfs3: Keep prealloc for all types of files fs/ntfs3: Remove unnecessary functions fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files fs/ntfs3: Refactoring of ntfs_set_ea fs/ntfs3: Remove locked argument in ntfs_set_ea fs/ntfs3: Use available posix_acl_release instead of ntfs_posix_acl_release fs/ntfs3: Check for NULL if ATTR_EA_INFO is incorrect fs/ntfs3: Refactoring of ntfs_init_from_boot fs/ntfs3: Reject mount if boot's cluster size < media sector size fs/ntfs3: Refactoring lock in ntfs_init_acl fs/ntfs3: Change posix_acl_equiv_mode to posix_acl_update_mode fs/ntfs3: Pass flags to ntfs_set_ea in ntfs_set_acl_ex fs/ntfs3: Refactor ntfs_get_acl_ex for better readability ... commit cdeb5d7d890e14f3b70e8087e745c4a6a7d9f337 Author: Michael Ellerman Date: Fri Oct 15 23:02:08 2021 +1100 KVM: PPC: Book3S HV: Make idle_kvm_start_guest() return 0 if it went to guest We call idle_kvm_start_guest() from power7_offline() if the thread has been requested to enter KVM. We pass it the SRR1 value that was returned from power7_idle_insn() which tells us what sort of wakeup we're processing. Depending on the SRR1 value we pass in, the KVM code might enter the guest, or it might return to us to do some host action if the wakeup requires it. If idle_kvm_start_guest() is able to handle the wakeup, and enter the guest it is supposed to indicate that by returning a zero SRR1 value to us. That was the behaviour prior to commit 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C"), however in that commit the handling of SRR1 was reworked, and the zeroing behaviour was lost. Returning from idle_kvm_start_guest() without zeroing the SRR1 value can confuse the host offline code, causing the guest to crash and other weirdness. Fixes: 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211015133929.832061-2-mpe@ellerman.id.au commit 9b4416c5095c20e110c82ae602c254099b83b72f Author: Michael Ellerman Date: Fri Oct 15 23:01:48 2021 +1100 KVM: PPC: Book3S HV: Fix stack handling in idle_kvm_start_guest() In commit 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") kvm_start_guest() became idle_kvm_start_guest(). The old code allocated a stack frame on the emergency stack, but didn't use the frame to store anything, and also didn't store anything in its caller's frame. idle_kvm_start_guest() on the other hand is written more like a normal C function, it creates a frame on entry, and also stores CR/LR into its callers frame (per the ABI). The problem is that there is no caller frame on the emergency stack. The emergency stack for a given CPU is allocated with: paca_ptrs[i]->emergency_sp = alloc_stack(limit, i) + THREAD_SIZE; So emergency_sp actually points to the first address above the emergency stack allocation for a given CPU, we must not store above it without first decrementing it to create a frame. This is different to the regular kernel stack, paca->kstack, which is initialised to point at an initial frame that is ready to use. idle_kvm_start_guest() stores the backchain, CR and LR all of which write outside the allocation for the emergency stack. It then creates a stack frame and saves the non-volatile registers. Unfortunately the frame it creates is not large enough to fit the non-volatiles, and so the saving of the non-volatile registers also writes outside the emergency stack allocation. The end result is that we corrupt whatever is at 0-24 bytes, and 112-248 bytes above the emergency stack allocation. In practice this has gone unnoticed because the memory immediately above the emergency stack happens to be used for other stack allocations, either another CPUs mc_emergency_sp or an IRQ stack. See the order of calls to irqstack_early_init() and emergency_stack_init(). The low addresses of another stack are the top of that stack, and so are only used if that stack is under extreme pressue, which essentially never happens in practice - and if it did there's a high likelyhood we'd crash due to that stack overflowing. Still, we shouldn't be corrupting someone else's stack, and it is purely luck that we aren't corrupting something else. To fix it we save CR/LR into the caller's frame using the existing r1 on entry, we then create a SWITCH_FRAME_SIZE frame (which has space for pt_regs) on the emergency stack with the backchain pointing to the existing stack, and then finally we switch to the new frame on the emergency stack. Fixes: 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211015133929.832061-1-mpe@ellerman.id.au commit 4884ddba7f124da65cafa983b49b27daa460b91d Merge: 46393d61a328d 64e4017778bea Author: David S. Miller Date: Fri Oct 15 14:36:57 2021 +0100 Merge branch 'tcp-md5-vrf-fix' Leonard Crestez says: ==================== tcp: md5: Fix overlap between vrf and non-vrf keys With net.ipv4.tcp_l3mdev_accept=1 it is possible for a listen socket to accept connection from the same client address in different VRFs. It is also possible to set different MD5 keys for these clients which differ only in the tcpm_l3index field. This appears to work when distinguishing between different VRFs but not between non-VRF and VRF connections. In particular: * tcp_md5_do_lookup_exact will match a non-vrf key against a vrf key. This means that adding a key with l3index != 0 after a key with l3index == 0 will cause the earlier key to be deleted. Both keys can be present if the non-vrf key is added later. * _tcp_md5_do_lookup can match a non-vrf key before a vrf key. This casues failures if the passwords differ. This can be fixed by making tcp_md5_do_lookup_exact perform an actual exact comparison on l3index and by making __tcp_md5_do_lookup perfer vrf-bound keys above other considerations like prefixlen. The fact that keys with l3index==0 affect VRF connections is usually not desirable, VRFs are meant to be completely independent. This behavior needs to preserved for backwards compatibility. Also, applications can just bind listen sockets to VRF and never specify TCP_MD5SIG_FLAG_IFINDEX at all. So far the combination of TCP_MD5SIG_FLAG_IFINDEX with tcpm_ifindex == 0 was an error, accept this to mean "key only applies to default VRF". This is what applications using VRFs for traffic separation want. This also contains tests for the second part. It does not contain tests for overlapping keys, that would require more changes in nettest to add multiple keys. These scenarios are also covered by my tests for TCP-AO, especially around this area: https://github.com/cdleonard/tcp-authopt-test/blob/main/tcp_authopt_test/test_vrf_bind.py Changes since V2: * Rename --do-bind-key-ifindex to --force-bind-key-ifindex * Fix referencing TCP_MD5SIG_FLAG_IFINDEX as TCP_MD5SIG_IFINDEX Link to v2: https://lore.kernel.org/netdev/cover.1634107317.git.cdleonard@gmail.com/ Changes since V1: * Accept (TCP_MD5SIG_IFINDEX with tcpm_ifindex == 0) * Add flags for explicitly including or excluding TCP_MD5SIG_FLAG_IFINDEX to nettest * Add few more tests in fcnal-test.sh. Link to v1: https://lore.kernel.org/netdev/3d8387d499f053dba5cd9184c0f7b8445c4470c6.1633542093.git.cdleonard@gmail.com/ ==================== Signed-off-by: David S. Miller commit 64e4017778bea04a50ed564615339801e02d2d32 Author: Leonard Crestez Date: Fri Oct 15 10:26:07 2021 +0300 selftests: net/fcnal: Test --{force,no}-bind-key-ifindex Test that applications binding listening sockets to VRFs without specifying TCP_MD5SIG_FLAG_IFINDEX will work as expected. This would be broken if __tcp_md5_do_lookup always made a strict comparison on l3index. See this email: https://lore.kernel.org/netdev/209548b5-27d2-2059-f2e9-2148f5a0291b@gmail.com/ Applications using tcp_l3mdev_accept=1 and a single global socket (not bound to any interface) also should have a way to specify keys that are only for the default VRF, this is done by --force-bind-key-ifindex without otherwise binding to a device. Signed-off-by: Leonard Crestez Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 78a9cf6143e2d4fb4dd48dde529b24cd5b6bf0e0 Author: Leonard Crestez Date: Fri Oct 15 10:26:06 2021 +0300 selftests: nettest: Add --{force,no}-bind-key-ifindex These options allow explicit control over the TCP_MD5SIG_FLAG_IFINDEX flag instead of always setting it based on binding to an interface. Do this by converting to getopt_long because nettest has too many single-character flags already and getopt_long is widely used in selftests. Signed-off-by: Leonard Crestez Reviewed-by: David Ahern Signed-off-by: David S. Miller commit a76c2315bec7afeb9bafe776fe532106fa0a8b05 Author: Leonard Crestez Date: Fri Oct 15 10:26:05 2021 +0300 tcp: md5: Allow MD5SIG_FLAG_IFINDEX with ifindex=0 Multiple VRFs are generally meant to be "separate" but right now md5 keys for the default VRF also affect connections inside VRFs if the IP addresses happen to overlap. So far the combination of TCP_MD5SIG_FLAG_IFINDEX with tcpm_ifindex == 0 was an error, accept this to mean "key only applies to default VRF". This is what applications using VRFs for traffic separation want. Signed-off-by: Leonard Crestez Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 86f1e3a8489f6a0232c1f3bc2bdb379f5ccdecec Author: Leonard Crestez Date: Fri Oct 15 10:26:04 2021 +0300 tcp: md5: Fix overlap between vrf and non-vrf keys With net.ipv4.tcp_l3mdev_accept=1 it is possible for a listen socket to accept connection from the same client address in different VRFs. It is also possible to set different MD5 keys for these clients which differ only in the tcpm_l3index field. This appears to work when distinguishing between different VRFs but not between non-VRF and VRF connections. In particular: * tcp_md5_do_lookup_exact will match a non-vrf key against a vrf key. This means that adding a key with l3index != 0 after a key with l3index == 0 will cause the earlier key to be deleted. Both keys can be present if the non-vrf key is added later. * _tcp_md5_do_lookup can match a non-vrf key before a vrf key. This casues failures if the passwords differ. Fix this by making tcp_md5_do_lookup_exact perform an actual exact comparison on l3index and by making __tcp_md5_do_lookup perfer vrf-bound keys above other considerations like prefixlen. Fixes: dea53bb80e07 ("tcp: Add l3index to tcp_md5sig_key and md5 functions") Signed-off-by: Leonard Crestez Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 46393d61a328d7c4e3264252dae891921126c674 Author: Vegard Nossum Date: Fri Oct 15 15:07:54 2021 +0200 lan78xx: select CRC32 Fix the following build/link error by adding a dependency on the CRC32 routines: ld: drivers/net/usb/lan78xx.o: in function `lan78xx_set_multicast': lan78xx.c:(.text+0x48cf): undefined reference to `crc32_le' The actual use of crc32_le() comes indirectly through ether_crc(). Fixes: 55d7de9de6c30 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Vegard Nossum Signed-off-by: David S. Miller commit cd932c2a1ecc8f261ecb8d140fa431c16379931f Merge: c2115b2b16421 11c52d250b34a Author: Greg Kroah-Hartman Date: Fri Oct 15 15:04:02 2021 +0200 Merge tag 'usb-serial-5.15-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.15-rc6 Here are some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.15-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: qcserial: add EM9191 QDL support USB: serial: option: add Quectel EC200S-CN module support USB: serial: option: add prod. id for Quectel EG91 USB: serial: option: add Telit LE910Cx composition 0x1204 commit 075718fdaf0efe20223571236c1bf14ca35a7aa1 Author: Xin Long Date: Thu Oct 14 00:50:55 2021 -0400 sctp: fix transport encap_port update in sctp_vtag_verify transport encap_port update should be updated when sctp_vtag_verify() succeeds, namely, returns 1, not returns 0. Correct it in this patch. While at it, also fix the indentation. Fixes: a1dd2cf2f1ae ("sctp: allow changing transport encap_port by peer packets") Signed-off-by: Xin Long Signed-off-by: David S. Miller commit c2402d43d183b11445aed921e7bebcd47ef222f1 Author: Kele Huang Date: Thu Oct 14 11:19:52 2021 +0800 ptp: fix error print of ptp_kvm on X86_64 platform Commit a86ed2cfa13c5 ("ptp: Don't print an error if ptp_kvm is not supported") fixes the error message print on ARM platform by only concerning about the case that the error returned from kvm_arch_ptp_init() is not -EOPNOTSUPP. Although the ARM platform returns -EOPNOTSUPP if ptp_kvm is not supported while X86_64 platform returns -KVM_EOPNOTSUPP, both error codes share the same value 95. Actually kvm_arch_ptp_init() on X86_64 platform can return three kinds of errors (-KVM_ENOSYS, -KVM_EOPNOTSUPP and -KVM_EFAULT). The problem is that -KVM_EOPNOTSUPP is masked out and -KVM_EFAULT is ignored among them. This patch fixes this by returning them to ptp_kvm_init() respectively. Signed-off-by: Kele Huang Signed-off-by: David S. Miller commit 71920ea97d6d1d800ee8b51951dc3fda3f5dc698 Author: Kan Liang Date: Wed Oct 6 13:12:17 2021 -0700 perf/x86/msr: Add Sapphire Rapids CPU support SMI_COUNT MSR is supported on Sapphire Rapids CPU. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1633551137-192083-1-git-send-email-kan.liang@linux.intel.com commit f42752729e2068a92c7d8b576d0dbbc9c1464149 Author: Arnd Bergmann Date: Thu Oct 14 17:37:18 2021 +0200 eeprom: 93xx46: fix MODULE_DEVICE_TABLE The newly added SPI device ID table does not work because the entry is incorrectly copied from the OF device table. During build testing, this shows as a compile failure when building it as a loadable module: drivers/misc/eeprom/eeprom_93xx46.c:424:1: error: redefinition of '__mod_of__eeprom_93xx46_of_table_device_table' MODULE_DEVICE_TABLE(of, eeprom_93xx46_of_table); Change the entry to refer to the correct symbol. Fixes: 137879f7ff23 ("eeprom: 93xx46: Add SPI device ID table") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211014153730.3821376-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit e2b6d941ec3876d3c44b1dfed596a2cc78477da2 Merge: 019057bd73d17 6e6a8ef088e12 Author: Paolo Bonzini Date: Fri Oct 15 04:47:55 2021 -0400 Merge tag 'kvmarm-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.15, take #2 - Properly refcount pages used as a concatenated stage-2 PGD - Fix missing unlock when detecting the use of MTE+VM_SHARED commit 019057bd73d1751fdfec41e43148baf3303d98f9 Author: Paolo Bonzini Date: Tue Oct 12 11:07:59 2021 -0400 KVM: SEV-ES: fix length of string I/O The size of the data in the scratch buffer is not divided by the size of each port I/O operation, so vcpu->arch.pio.count ends up being larger than it should be by a factor of size. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Acked-by: Tom Lendacky Signed-off-by: Paolo Bonzini commit d94befbb5ae379f6dfd4fa6d460eacc09fa7b9c3 Author: Davide Baldo Date: Fri Oct 15 09:21:22 2021 +0200 ALSA: hda/realtek: Fixes HP Spectre x360 15-eb1xxx speakers In laptop 'HP Spectre x360 Convertible 15-eb1xxx/8811' both front and rear speakers are silent, this patch fixes that by overriding the pin layout and by initializing the amplifier which needs a GPIO pin to be set to 1 then 0, similar to the existing HP Spectre x360 14 model. In order to have volume control, both front and rear speakers were forced to use the DAC1. This patch also correctly map the mute LED but since there is no microphone on/off switch exposed by the alsa subsystem it never turns on by itself. There are still known audio issues in this laptop: headset microphone doesn't work, the button to mute/unmute microphone is not yet mapped, the LED of the mute/unmute speakers doesn't seems to be exposed via GPIO and never turns on. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213953 Signed-off-by: Davide Baldo Link: https://lore.kernel.org/r/20211015072121.5287-1-davide@baldo.me Signed-off-by: Takashi Iwai commit 3c414eb65c294719a91a746260085363413f91c1 Author: Brendan Grieve Date: Fri Oct 15 10:53:35 2021 +0800 ALSA: usb-audio: Provide quirk for Sennheiser GSP670 Headset As per discussion at: https://github.com/szszoke/sennheiser-gsp670-pulseaudio-profile/issues/13 The GSP670 has 2 playback and 1 recording device that by default are detected in an incompatible order for alsa. This may have been done to make it compatible for the console by the manufacturer and only affects the latest firmware which uses its own ID. This quirk will resolve this by reordering the channels. Signed-off-by: Brendan Grieve Cc: Link: https://lore.kernel.org/r/20211015025335.196592-1-brendan@grieve.com.au Signed-off-by: Takashi Iwai commit a14bc107edd0c108bda2245e50daa22f91c95d20 Author: Vegard Nossum Date: Tue Oct 12 13:52:42 2021 +0200 drm/panel: olimex-lcd-olinuxino: select CRC32 Fix the following build/link error by adding a dependency on the CRC32 routines: ld: drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.o: in function `lcd_olinuxino_probe': panel-olimex-lcd-olinuxino.c:(.text+0x303): undefined reference to `crc32_le' Fixes: 17fd7a9d324fd ("drm/panel: Add support for Olimex LCD-OLinuXino panel") Cc: Arnd Bergmann Signed-off-by: Vegard Nossum Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211012115242.10325-1-vegard.nossum@oracle.com Signed-off-by: Dave Airlie commit 1a361b41c1a1c399399cd2a83e449c452d9d8115 Author: Randy Dunlap Date: Mon Oct 11 01:00:06 2021 -0700 drm/r128: fix build for UML Fix a build error on CONFIG_UML, which does not support (provide) wbinvd(). UML can use the generic mb() instead. ../drivers/gpu/drm/r128/ati_pcigart.c: In function ‘drm_ati_pcigart_init’: ../drivers/gpu/drm/r128/ati_pcigart.c:218:2: error: implicit declaration of function ‘wbinvd’ [-Werror=implicit-function-declaration] wbinvd(); ^~~~~~ Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Randy Dunlap Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: linux-um@lists.infradead.org Cc: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211011080006.31081-1-rdunlap@infradead.org Signed-off-by: Dave Airlie commit d1d94b0129dccd226784633c60b7df90e8a051b5 Author: Marek Vasut Date: Thu Oct 7 23:41:17 2021 +0200 drm/nouveau/fifo: Reinstate the correct engine bit programming Commit 64f7c698bea9 ("drm/nouveau/fifo: add engine_id hook") replaced fifo/chang84.c g84_fifo_chan_engine() call with an indirect call of fifo/g84.c g84_fifo_engine_id(). The G84_FIFO_ENGN_* values returned from the later g84_fifo_engine_id() are incremented by 1 compared to the previous g84_fifo_chan_engine() return values. This is fine either way for most of the code, except this one line where an engine bit programmed into the hardware is derived from the return value. Decrement the return value accordingly, otherwise the wrong engine bit is programmed into the hardware and that leads to the following failure: nouveau 0000:01:00.0: gr: 00000030 [ILLEGAL_MTHD ILLEGAL_CLASS] ch 1 [003fbce000 DRM] subc 3 class 0000 mthd 085c data 00000420 On the following hardware: lspci -s 01:00.0 01:00.0 VGA compatible controller: NVIDIA Corporation GT216GLM [Quadro FX 880M] (rev a2) lspci -ns 01:00.0 01:00.0 0300: 10de:0a3c (rev a2) Fixes: 64f7c698bea9 ("drm/nouveau/fifo: add engine_id hook") Signed-off-by: Marek Vasut Cc: # 5.12+ Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Reviewed-by: Karol Herbst Reviewed-by: Ben Skeggs Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20211007214117.231472-1-marex@denx.de Signed-off-by: Dave Airlie commit b253c3026c29d4231099d3cf8d984d25787793af Author: Dexuan Cui Date: Thu Sep 16 12:36:44 2021 -0700 drm/hyperv: Fix double mouse pointers Hyper-V supports a hardware cursor feature. It is not used by Linux VM, but the Hyper-V host still draws a point as an extra mouse pointer, which is unwanted, especially when Xorg is running. The hyperv_fb driver uses synthvid_send_ptr() to hide the unwanted pointer. When the hyperv_drm driver was developed, the function synthvid_send_ptr() was not copied from the hyperv_fb driver. Fix the issue by adding the function into hyperv_drm. Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device") Signed-off-by: Dexuan Cui Reviewed-by: Haiyang Zhang Reviewed-by: Deepak Rawat Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210916193644.45650-1-decui@microsoft.com Signed-off-by: Dave Airlie commit b693e42921e0220c0d564c55c6cdc680b0f85390 Author: Thomas Zimmermann Date: Tue Oct 5 09:03:55 2021 +0200 drm/fbdev: Clamp fbdev surface size if too large Clamp the fbdev surface size of the available maximumi height to avoid failing to init console emulation. An example error is shown below. bad framebuffer height 2304, should be >= 768 && <= 768 [drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0 simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-22) This is especially a problem with drivers that have very small screen sizes and cannot over-allocate at all. v2: * reduce warning level (Ville) Signed-off-by: Thomas Zimmermann Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Reviewed-by: Ville Syrjälä Reviewed-by: Alex Deucher Reported-by: Amanoel Dawod Reported-by: Zoltán Kővágó Reported-by: Michael Stapelberg Cc: Daniel Vetter Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Cc: # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20211005070355.7680-1-tzimmermann@suse.de Signed-off-by: Dave Airlie commit 97794170b696856483f74b47bfb6049780d2d3a0 Author: Douglas Anderson Date: Tue Oct 5 19:29:08 2021 -0700 drm/edid: In connector_bad_edid() cap num_of_ext by num_blocks read In commit e11f5bd8228f ("drm: Add support for DP 1.4 Compliance edid corruption test") the function connector_bad_edid() started assuming that the memory for the EDID passed to it was big enough to hold `edid[0x7e] + 1` blocks of data (1 extra for the base block). It completely ignored the fact that the function was passed `num_blocks` which indicated how much memory had been allocated for the EDID. Let's fix this by adding a bounds check. This is important for handling the case where there's an error in the first block of the EDID. In that case we will call connector_bad_edid() without having re-allocated memory based on `edid[0x7e]`. Fixes: e11f5bd8228f ("drm: Add support for DP 1.4 Compliance edid corruption test") Reported-by: Ville Syrjälä Signed-off-by: Douglas Anderson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211005192905.v2.1.Ib059f9c23c2611cb5a9d760e7d0a700c1295928d@changeid Signed-off-by: Dave Airlie commit 6011106d129d8249baad3426fae13f147d9ffa65 Merge: 1483f0a427fe7 4157a441ff068 Author: Dave Airlie Date: Fri Oct 15 15:02:52 2021 +1000 Merge tag 'mediatek-drm-fixes-5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes Mediatek DRM Fixes for Linux 5.15 1. Revert series "CMDQ refinement of Mediatek DRM driver" Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20211013235044.5488-1-chunkuang.hu@kernel.org commit a1467faa10414ab3d91be7ef6d2b11272ec00e95 Author: Philipp Zabel Date: Tue Oct 5 12:06:18 2021 +0200 ARM: imx: register reset controller from a platform driver Starting with commit 6b2117ad65f1 ("of: property: fw_devlink: Add support for "resets" and "pwms""), the imx-drm driver fails to load due to forever dormant devlinks to the reset-controller node. This node was never associated with a struct device. Add a platform device to allow fw_devnode to activate the devlinks. Fixes: 6b2117ad65f1 ("of: property: fw_devlink: Add support for "resets" and "pwms"") Signed-off-by: Philipp Zabel Tested-by: Fabio Estevam Reviewed-by: Saravana Kannan Signed-off-by: Shawn Guo commit 1483f0a427fe7d3f505923d0293436067bbd8646 Merge: 0dee6f70fd40e 82a59c7f456db Author: Dave Airlie Date: Fri Oct 15 10:00:48 2021 +1000 Merge tag 'drm-intel-fixes-2021-10-14' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15-rc6: - Fix ACPI object leak - Fix context leak in user proto-context creation - Fix missing i915_sw_fence_fini call Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87zgrbvgls.fsf@intel.com commit ec681c53f8d2d0ee362ff67f5b98dd8263c15002 Merge: 26d6574109838 1fcd794518b76 Author: Linus Torvalds Date: Thu Oct 14 18:21:39 2021 -0400 Merge tag 'net-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Quite calm. The noisy DSA driver (embedded switches) changes, and adjustment to IPv6 IOAM behavior add to diffstat's bottom line but are not scary. Current release - regressions: - af_unix: rename UNIX-DGRAM to UNIX to maintain backwards compatibility - procfs: revert "add seq_puts() statement for dev_mcast", minor format change broke user space Current release - new code bugs: - dsa: fix bridge_num not getting cleared after ports leaving the bridge, resource leak - dsa: tag_dsa: send packets with TX fwd offload from VLAN-unaware bridges using VID 0, prevent packet drops if pvid is removed - dsa: mv88e6xxx: keep the pvid at 0 when VLAN-unaware, prevent HW getting confused about station to VLAN mapping Previous releases - regressions: - virtio-net: fix for skb_over_panic inside big mode - phy: do not shutdown PHYs in READY state - dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's, fix link LED staying lit after ifdown - mptcp: fix possible infinite wait on recvmsg(MSG_WAITALL) - mqprio: Correct stats in mqprio_dump_class_stats() - ice: fix deadlock for Tx timestamp tracking flush - stmmac: fix feature detection on old hardware Previous releases - always broken: - sctp: account stream padding length for reconf chunk - icmp: fix icmp_ext_echo_iio parsing in icmp_build_probe() - isdn: cpai: check ctr->cnr to avoid array index out of bound - isdn: mISDN: fix sleeping function called from invalid context - nfc: nci: fix potential UAF of rf_conn_info object - dsa: microchip: prevent ksz_mib_read_work from kicking back in after it's canceled in .remove and crashing - dsa: mv88e6xxx: isolate the ATU databases of standalone and bridged ports - dsa: sja1105, ocelot: break circular dependency between switch and tag drivers - dsa: felix: improve timestamping in presence of packe loss - mlxsw: thermal: fix out-of-bounds memory accesses Misc: - ipv6: ioam: move the check for undefined bits to improve interoperability" * tag 'net-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (60 commits) icmp: fix icmp_ext_echo_iio parsing in icmp_build_probe MAINTAINERS: Update the devicetree documentation path of imx fec driver sctp: account stream padding length for reconf chunk mlxsw: thermal: Fix out-of-bounds memory accesses ethernet: s2io: fix setting mac address during resume NFC: digital: fix possible memory leak in digital_in_send_sdd_req() NFC: digital: fix possible memory leak in digital_tg_listen_mdaa() nfc: fix error handling of nfc_proto_register() Revert "net: procfs: add seq_puts() statement for dev_mcast" net: encx24j600: check error in devm_regmap_init_encx24j600 net: korina: select CRC32 net: arc: select CRC32 net: dsa: felix: break at first CPU port during init and teardown net: dsa: tag_ocelot_8021q: fix inability to inject STP BPDUs into BLOCKING ports net: dsa: felix: purge skb from TX timestamping queue if it cannot be sent net: dsa: tag_ocelot_8021q: break circular dependency with ocelot switch lib net: dsa: tag_ocelot: break circular dependency with ocelot switch lib driver net: mscc: ocelot: cross-check the sequence id from the timestamp FIFO with the skb PTP header net: mscc: ocelot: deny TX timestamping of non-PTP packets net: mscc: ocelot: warn when a PTP IRQ is raised for an unknown skb ... commit 3e6ed7703dae6838c104d73d3e76e9b79f5c0528 Author: Florian Westphal Date: Tue Oct 12 18:37:09 2021 +0200 selftests: netfilter: remove stray bash debug line This should not be there. Fixes: 2de03b45236f ("selftests: netfilter: add flowtable test script") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 174c376278949c44aad89c514a6b5db6cee8db59 Author: Antoine Tenart Date: Tue Oct 12 16:54:37 2021 +0200 netfilter: ipvs: make global sysctl readonly in non-init netns Because the data pointer of net/ipv4/vs/debug_level is not updated per netns, it must be marked as read-only in non-init netns. Fixes: c6d2d445d8de ("IPVS: netns, final patch enabling network name space.") Signed-off-by: Antoine Tenart Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit a482c5e00a9b5a194085bcd372ac36141028becb Author: Xin Long Date: Tue Oct 12 08:18:13 2021 -0400 netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6 In rt_mt6(), when it's a nonlinear skb, the 1st skb_header_pointer() only copies sizeof(struct ipv6_rt_hdr) to _route that rh points to. The access by ((const struct rt0_hdr *)rh)->reserved will overflow the buffer. So this access should be moved below the 2nd call to skb_header_pointer(). Besides, after the 2nd skb_header_pointer(), its return value should also be checked, othersize, *rp may cause null-pointer-ref. v1->v2: - clean up some old debugging log. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Dan Carpenter Signed-off-by: Xin Long Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3ff6d64e68abc231955d216236615918797614ae Author: Shunsuke Nakamura Date: Mon Oct 11 17:37:04 2021 +0900 libperf tests: Fix test_stat_cpu The `cpu` argument of perf_evsel__read() must specify the cpu index. perf_cpu_map__for_each_cpu() is for iterating the cpu number (not index) and is thus not appropriate for use with perf_evsel__read(). So, if there is an offline CPU, the cpu number specified in the argument may point out of range because the cpu number and the cpu index are different. Fix test_stat_cpu(). Testing it: # make tests -C tools/lib/perf/ make: Entering directory '/home/nakamura/kernel_src/linux-5.15-rc4_fix/tools/lib/perf' running static: - running tests/test-cpumap.c...OK - running tests/test-threadmap.c...OK - running tests/test-evlist.c...OK - running tests/test-evsel.c...OK running dynamic: - running tests/test-cpumap.c...OK - running tests/test-threadmap.c...OK - running tests/test-evlist.c...OK - running tests/test-evsel.c...OK make: Leaving directory '/home/nakamura/kernel_src/linux-5.15-rc4_fix/tools/lib/perf' Signed-off-by: Shunsuke Nakamura Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20211011083704.4108720-1-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit f304c8d949f9adc2ef51304b63e49d5ea1c2d288 Author: Shunsuke Nakamura Date: Wed Oct 6 18:57:03 2021 +0900 libperf test evsel: Fix build error on !x86 architectures In test_stat_user_read, following build error occurs except i386 and x86_64 architectures: tests/test-evsel.c:129:31: error: variable 'pc' set but not used [-Werror=unused-but-set-variable] struct perf_event_mmap_page *pc; Fix build error. Signed-off-by: Shunsuke Nakamura Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20211006095703.477826-1-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit 8e820f962345e6ce6f4677044209f23dde39d76d Author: Alexey Bayduraev Date: Wed Sep 29 12:14:45 2021 +0300 perf report: Output non-zero offset for decompressed records Print offset of PERF_RECORD_COMPRESSED record instead of zero for decompressed records in raw trace dump (-D option of perf-report): 0x17cf08 [0x28]: event: 9 instead of: 0 [0x28]: event: 9 The fix is not critical, because currently file_pos for compressed events is used in perf_session__process_event only to show offsets in the raw dump. This patch was separated from patchset: https://lore.kernel.org/lkml/cover.1629186429.git.alexey.v.bayduraev@linux.intel.com/ and was already rewieved. Reviewed-by: Riccardo Mancini Signed-off-by: Alexey Bayduraev Tested-by: Riccardo Mancini Acked-by: Andi Kleen Acked-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Budankov Cc: Ingo Molnar Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20210929091445.18274-1-alexey.v.bayduraev@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b726ddf984a56a385c9df406a66c221f3a77c951 Author: Brett Creeley Date: Mon Sep 27 11:21:50 2021 -0700 ice: Print the api_patch as part of the fw.mgmt.api Currently when a user uses "devlink dev info", the fw.mgmt.api will be the major.minor numbers as shown below: devlink dev info pci/0000:3b:00.0 pci/0000:3b:00.0: driver ice serial_number 00-01-00-ff-ff-00-00-00 versions: fixed: board.id K91258-000 running: fw.mgmt 6.1.2 fw.mgmt.api 1.7 <--- No patch number included fw.mgmt.build 0xd75e7d06 fw.mgmt.srev 5 fw.undi 1.2992.0 fw.undi.srev 5 fw.psid.api 3.10 fw.bundle_id 0x800085cc fw.app.name ICE OS Default Package fw.app 1.3.27.0 fw.app.bundle_id 0xc0000001 fw.netlist 3.10.2000-3.1e.0 fw.netlist.build 0x2a76e110 stored: fw.mgmt.srev 5 fw.undi 1.2992.0 fw.undi.srev 5 fw.psid.api 3.10 fw.bundle_id 0x800085cc fw.netlist 3.10.2000-3.1e.0 fw.netlist.build 0x2a76e110 There are many features in the driver that depend on the major, minor, and patch version of the FW. Without the patch number in the output for fw.mgmt.api debugging issues related to the FW API version is difficult. Also, using major.minor.patch aligns with the existing firmware version which uses a 3 digit value. Fix this by making the fw.mgmt.api print the major.minor.patch versions. Shown below is the result: devlink dev info pci/0000:3b:00.0 pci/0000:3b:00.0: driver ice serial_number 00-01-00-ff-ff-00-00-00 versions: fixed: board.id K91258-000 running: fw.mgmt 6.1.2 fw.mgmt.api 1.7.9 <--- patch number included fw.mgmt.build 0xd75e7d06 fw.mgmt.srev 5 fw.undi 1.2992.0 fw.undi.srev 5 fw.psid.api 3.10 fw.bundle_id 0x800085cc fw.app.name ICE OS Default Package fw.app 1.3.27.0 fw.app.bundle_id 0xc0000001 fw.netlist 3.10.2000-3.1e.0 fw.netlist.build 0x2a76e110 stored: fw.mgmt.srev 5 fw.undi 1.2992.0 fw.undi.srev 5 fw.psid.api 3.10 fw.bundle_id 0x800085cc fw.netlist 3.10.2000-3.1e.0 fw.netlist.build 0x2a76e110 Fixes: ff2e5c700e08 ("ice: add basic handler for devlink .info_get") Signed-off-by: Brett Creeley Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit e4c2efa1393c6f1fbfabf91d1d83fcb4ae691ccb Author: Michal Swiatkowski Date: Tue Sep 14 19:25:05 2021 -0400 ice: fix getting UDP tunnel entry Correct parameters order in call to ice_tunnel_idx_to_entry function. Entry in sparse port table is correct when the idx is 0. For idx 1 one correct entry should be skipped, for idx 2 two of them should be skipped etc. Change if condition to be true when idx is 0, which means that previous valid entry of this tunnel type were skipped. Fixes: b20e6c17c468 ("ice: convert to new udp_tunnel infrastructure") Signed-off-by: Michal Swiatkowski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 73e30a62b19b9fbb4e6a3465c59da186630d5f2e Author: Dave Ertman Date: Mon Oct 4 05:15:25 2021 -0700 ice: Avoid crash from unnecessary IDA free In the remove path, there is an attempt to free the aux_idx IDA whether it was allocated or not. This can potentially cause a crash when unloading the driver on systems that do not initialize support for RDMA. But, this free cannot be gated by the status bit for RDMA, since it is allocated if the driver detects support for RDMA at probe time, but the driver can enter into a state where RDMA is not supported after the IDA has been allocated at probe time and this would lead to a memory leak. Initialize aux_idx to an invalid value and check for a valid value when unloading to determine if an IDA free is necessary. Fixes: d25a0fc41c1f9 ("ice: Initialize RDMA support") Reported-by: Jun Miao Signed-off-by: Dave Ertman Tested-by: Jesse Brandeburg Signed-off-by: Tony Nguyen commit ff7e93219442f5ac5b2cfd33e4fe4b7d5942f957 Author: Brett Creeley Date: Mon Jun 28 10:53:45 2021 -0700 ice: Fix failure to re-add LAN/RDMA Tx queues Currently if the VSI is rebuilt/removed and the RDMA PF driver is active the RDMA Tx queue scheduler node configuration will not be cleaned up. This will cause the rebuild/re-add of the VSI to fail due to the software structures not being correctly cleaned up for the VSI index. Fix this by always calling ice_rm_vsi_rdma_cfg() for all VSI. If there are no RDMA scheduler nodes created, then there is no harm in calling ice_rm_vsi_rdma_cfg(). This change applies to all VSI types, so if RDMA support is added for other VSI types they will also get this change. Fixes: 348048e724a0 ("ice: Implement iidc operations") Signed-off-by: Brett Creeley Tested-by: Jerzy Wiktor Jurkowski Signed-off-by: Tony Nguyen commit baa0ab2ba22395d85854e8d818beb1763b48f7dc Merge: 7904022decc26 be5eb93354262 Author: Jens Axboe Date: Thu Oct 14 09:07:14 2021 -0600 Merge tag 'nvme-5.15-2021-10-14' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.15: - fix the abort command id (Keith Busch) - nvme: fix per-namespace chardev deletion (Adam Manzanares)" * tag 'nvme-5.15-2021-10-14' of git://git.infradead.org/nvme: nvme: fix per-namespace chardev deletion nvme-pci: Fix abort command id commit 14cfbb7a7856f190035f8e53045bdbfa648fae41 Author: Hao Xu Date: Thu Oct 14 22:04:00 2021 +0800 io_uring: fix wrong condition to grab uring lock Grab uring lock when we are in io-worker rather than in the original or system-wq context since we already hold it in these two situation. Signed-off-by: Hao Xu Fixes: b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path") Link: https://lore.kernel.org/r/20211014140400.50235-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 1fcd794518b7644169595c66b1bfe726d1f498ab Author: Xin Long Date: Thu Oct 14 05:50:50 2021 -0400 icmp: fix icmp_ext_echo_iio parsing in icmp_build_probe In icmp_build_probe(), the icmp_ext_echo_iio parsing should be done step by step and skb_header_pointer() return value should always be checked, this patch fixes 3 places in there: - On case ICMP_EXT_ECHO_CTYPE_NAME, it should only copy ident.name from skb by skb_header_pointer(), its len is ident_len. Besides, the return value of skb_header_pointer() should always be checked. - On case ICMP_EXT_ECHO_CTYPE_INDEX, move ident_len check ahead of skb_header_pointer(), and also do the return value check for skb_header_pointer(). - On case ICMP_EXT_ECHO_CTYPE_ADDR, before accessing iio->ident.addr. ctype3_hdr.addrlen, skb_header_pointer() should be called first, then check its return value and ident_len. On subcases ICMP_AFI_IP and ICMP_AFI_IP6, also do check for ident. addr.ctype3_hdr.addrlen and skb_header_pointer()'s return value. On subcase ICMP_AFI_IP, the len for skb_header_pointer() should be "sizeof(iio->extobj_hdr) + sizeof(iio->ident.addr.ctype3_hdr) + sizeof(struct in_addr)" or "ident_len". v1->v2: - To make it more clear, call skb_header_pointer() once only for iio->indent's parsing as Jakub Suggested. v2->v3: - The extobj_hdr.length check against sizeof(_iio) should be done before calling skb_header_pointer(), as Eric noticed. Fixes: d329ea5bd884 ("icmp: add response to RFC 8335 PROBE messages") Reported-by: Dan Carpenter Signed-off-by: Xin Long Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/31628dd76657ea62f5cf78bb55da6b35240831f1.1634205050.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit ea142b09a6399fb2c35c07198e3f0e2423273540 Author: Cai Huoqing Date: Thu Oct 14 19:02:14 2021 +0800 MAINTAINERS: Update the devicetree documentation path of imx fec driver Change the devicetree documentation path to "Documentation/devicetree/bindings/net/fsl,fec.yaml" since 'fsl-fec.txt' has been converted to 'fsl,fec.yaml' already. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211014110214.3254-1-caihuoqing@baidu.com Signed-off-by: Jakub Kicinski commit a2d859e3fc97e79d907761550dbc03ff1b36479c Author: Eiichi Tsukata Date: Wed Oct 13 17:27:29 2021 -0300 sctp: account stream padding length for reconf chunk sctp_make_strreset_req() makes repeated calls to sctp_addto_chunk() which will automatically account for padding on each call. inreq and outreq are already 4 bytes aligned, but the payload is not and doing SCTP_PAD4(a + b) (which _sctp_make_chunk() did implicitly here) is different from SCTP_PAD4(a) + SCTP_PAD4(b) and not enough. It led to possible attempt to use more buffer than it was allocated and triggered a BUG_ON. Cc: Vlad Yasevich Cc: Neil Horman Cc: Greg KH Fixes: cc16f00f6529 ("sctp: add support for generating stream reconf ssn reset request chunk") Reported-by: Eiichi Tsukata Signed-off-by: Eiichi Tsukata Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: Marcelo Ricardo Leitner Reviewed-by: Xin Long Link: https://lore.kernel.org/r/b97c1f8b0c7ff79ac4ed206fc2c49d3612e0850c.1634156849.git.mleitner@redhat.com Signed-off-by: Jakub Kicinski commit 332fdf951df8b870e3da86b122ae304e2aabe88c Author: Ido Schimmel Date: Tue Oct 12 20:49:55 2021 +0300 mlxsw: thermal: Fix out-of-bounds memory accesses Currently, mlxsw allows cooling states to be set above the maximum cooling state supported by the driver: # cat /sys/class/thermal/thermal_zone2/cdev0/type mlxsw_fan # cat /sys/class/thermal/thermal_zone2/cdev0/max_state 10 # echo 18 > /sys/class/thermal/thermal_zone2/cdev0/cur_state # echo $? 0 This results in out-of-bounds memory accesses when thermal state transition statistics are enabled (CONFIG_THERMAL_STATISTICS=y), as the transition table is accessed with a too large index (state) [1]. According to the thermal maintainer, it is the responsibility of the driver to reject such operations [2]. Therefore, return an error when the state to be set exceeds the maximum cooling state supported by the driver. To avoid dead code, as suggested by the thermal maintainer [3], partially revert commit a421ce088ac8 ("mlxsw: core: Extend cooling device with cooling levels") that tried to interpret these invalid cooling states (above the maximum) in a special way. The cooling levels array is not removed in order to prevent the fans going below 20% PWM, which would cause them to get stuck at 0% PWM. [1] BUG: KASAN: slab-out-of-bounds in thermal_cooling_device_stats_update+0x271/0x290 Read of size 4 at addr ffff8881052f7bf8 by task kworker/0:0/5 CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.15.0-rc3-custom-45935-gce1adf704b14 #122 Hardware name: Mellanox Technologies Ltd. "MSN2410-CB2FO"/"SA000874", BIOS 4.6.5 03/08/2016 Workqueue: events_freezable_power_ thermal_zone_device_check Call Trace: dump_stack_lvl+0x8b/0xb3 print_address_description.constprop.0+0x1f/0x140 kasan_report.cold+0x7f/0x11b thermal_cooling_device_stats_update+0x271/0x290 __thermal_cdev_update+0x15e/0x4e0 thermal_cdev_update+0x9f/0xe0 step_wise_throttle+0x770/0xee0 thermal_zone_device_update+0x3f6/0xdf0 process_one_work+0xa42/0x1770 worker_thread+0x62f/0x13e0 kthread+0x3ee/0x4e0 ret_from_fork+0x1f/0x30 Allocated by task 1: kasan_save_stack+0x1b/0x40 __kasan_kmalloc+0x7c/0x90 thermal_cooling_device_setup_sysfs+0x153/0x2c0 __thermal_cooling_device_register.part.0+0x25b/0x9c0 thermal_cooling_device_register+0xb3/0x100 mlxsw_thermal_init+0x5c5/0x7e0 __mlxsw_core_bus_device_register+0xcb3/0x19c0 mlxsw_core_bus_device_register+0x56/0xb0 mlxsw_pci_probe+0x54f/0x710 local_pci_probe+0xc6/0x170 pci_device_probe+0x2b2/0x4d0 really_probe+0x293/0xd10 __driver_probe_device+0x2af/0x440 driver_probe_device+0x51/0x1e0 __driver_attach+0x21b/0x530 bus_for_each_dev+0x14c/0x1d0 bus_add_driver+0x3ac/0x650 driver_register+0x241/0x3d0 mlxsw_sp_module_init+0xa2/0x174 do_one_initcall+0xee/0x5f0 kernel_init_freeable+0x45a/0x4de kernel_init+0x1f/0x210 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff8881052f7800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 1016 bytes inside of 1024-byte region [ffff8881052f7800, ffff8881052f7c00) The buggy address belongs to the page: page:0000000052355272 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1052f0 head:0000000052355272 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 ffffea0005034800 0000000300000003 ffff888100041dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881052f7a80: 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc fc ffff8881052f7b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881052f7b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881052f7c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881052f7c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [2] https://lore.kernel.org/linux-pm/9aca37cb-1629-5c67-1895-1fdc45c0244e@linaro.org/ [3] https://lore.kernel.org/linux-pm/af9857f2-578e-de3a-e62b-6baff7e69fd4@linaro.org/ CC: Daniel Lezcano Fixes: a50c1e35650b ("mlxsw: core: Implement thermal zone") Fixes: a421ce088ac8 ("mlxsw: core: Extend cooling device with cooling levels") Signed-off-by: Ido Schimmel Tested-by: Vadim Pasternak Link: https://lore.kernel.org/r/20211012174955.472928-1-idosch@idosch.org Signed-off-by: Jakub Kicinski commit 40507e7aada8422c38aafa0c8a1a09e4623c712a Author: Arnd Bergmann Date: Wed Oct 13 16:35:49 2021 +0200 ethernet: s2io: fix setting mac address during resume After recent cleanups, gcc started warning about a suspicious memcpy() call during the s2io_io_resume() function: In function '__dev_addr_set', inlined from 'eth_hw_addr_set' at include/linux/etherdevice.h:318:2, inlined from 's2io_set_mac_addr' at drivers/net/ethernet/neterion/s2io.c:5205:2, inlined from 's2io_io_resume' at drivers/net/ethernet/neterion/s2io.c:8569:7: arch/x86/include/asm/string_32.h:182:25: error: '__builtin_memcpy' accessing 6 bytes at offsets 0 and 2 overlaps 4 bytes at offset 2 [-Werror=restrict] 182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/netdevice.h:4648:9: note: in expansion of macro 'memcpy' 4648 | memcpy(dev->dev_addr, addr, len); | ^~~~~~ What apparently happened is that an old cleanup changed the calling conventions for s2io_set_mac_addr() from taking an ethernet address as a character array to taking a struct sockaddr, but one of the callers was not changed at the same time. Change it to instead call the low-level do_s2io_prog_unicast() function that still takes the old argument type. Fixes: 2fd376884558 ("S2io: Added support set_mac_address driver entry point") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211013143613.2049096-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit 26d6574109838b8fa40a8261421693015bab0579 Author: Dinh Nguyen Date: Tue Oct 12 22:40:56 2021 -0500 MAINTAINERS: Update entry for the Stratix10 firmware Richard Gong is no longer at Intel, so update the MAINTAINER's entry for the Stratix10 firmware drivers. Signed-off-by: Dinh Nguyen Signed-off-by: Linus Torvalds commit 1626d9a35eb7aa68fe6f8097628753c8ef733e9b Merge: 348949d9a4440 48827e1d6af58 Author: Linus Torvalds Date: Thu Oct 14 09:53:36 2021 -0400 Merge tag 'sound-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This contains quite a few device-specific fixes for usual HD- and USB-audio in addition to a couple of ALSA core fixes (a UAF fix in sequencer and a fix for a misplaced PCM 32bit compat ioctl). Nothing really stands out" * tag 'sound-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Add quirk for VF0770 ALSA: hda: avoid write to STATESTS if controller is in reset ALSA: hda/realtek: Fix the mic type detection issue for ASUS G551JW ALSA: pcm: Workaround for a wrong offset in SYNC_PTR compat ioctl ALSA: hda/realtek: Fix for quirk to enable speaker output on the Lenovo 13s Gen2 ALSA: hda: intel: Allow repeatedly probing on codec configuration errors ALSA: hda/realtek: Add quirk for TongFang PHxTxX1 ALSA: hda/realtek - ALC236 headset MIC recording issue ALSA: usb-audio: Enable rate validation for Scarlett devices ALSA: hda/realtek: Add quirk for Clevo X170KM-G ALSA: hda/realtek: Complete partial device name to avoid ambiguity ALSA: hda - Enable headphone mic on Dell Latitude laptops with ALC3254 ALSA: seq: Fix a potential UAF by wrong private_free call order ALSA: hda/realtek: Enable 4-speaker output for Dell Precision 5560 laptop ALSA: usb-audio: Fix a missing error check in scarlett gen2 mixer commit aef454b40288158b850aab13e3d2a8c406779401 Author: Steven Clarkson Date: Thu Oct 14 06:35:54 2021 -0700 ALSA: hda/realtek: Add quirk for Clevo PC50HS Apply existing PCI quirk to the Clevo PC50HS and related models to fix audio output on the built in speakers. Signed-off-by: Steven Clarkson Cc: Link: https://lore.kernel.org/r/20211014133554.1326741-1-sc@lambdal.com Signed-off-by: Takashi Iwai commit 22390ce786c59328ccd13c329959dee1e8757487 Author: Greg Kroah-Hartman Date: Thu Oct 14 13:17:50 2021 +0200 ALSA: usb-audio: add Schiit Hel device to quirk table The Shciit Hel device responds to the ctl message for the mic capture switch with a timeout of -EPIPE: usb 7-2.2: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x1100, type = 1 usb 7-2.2: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x1100, type = 1 usb 7-2.2: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x1100, type = 1 usb 7-2.2: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x1100, type = 1 This seems safe to ignore as the device works properly with the control message quirk, so add it to the quirk table so all is good. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/YWgR3nOI1osvr5Yo@kroah.com Signed-off-by: Takashi Iwai commit 16a8e2fbb2d49111004efc1c7342e083eafabeb0 Author: Uwe Kleine-König Date: Wed Oct 13 15:37:10 2021 +0200 spi-mux: Fix false-positive lockdep splats io_mutex is taken by spi_setup() and spi-mux's .setup() callback calls spi_setup() which results in a nested lock of io_mutex. add_lock is taken by spi_add_device(). The device_add() call in there can result in calling spi-mux's .probe() callback which registers its own spi controller which in turn results in spi_add_device() being called again. To fix this initialize the controller's locks already in spi_alloc_controller() to give spi_mux_probe() a chance to set the lockdep subclass. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211013133710.2679703-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 6098475d4cb48d821bdf453c61118c56e26294f0 Author: Mark Brown Date: Fri Oct 8 14:31:57 2021 +0100 spi: Fix deadlock when adding SPI controllers on SPI buses Currently we have a global spi_add_lock which we take when adding new devices so that we can check that we're not trying to reuse a chip select that's already controlled. This means that if the SPI device is itself a SPI controller and triggers the instantiation of further SPI devices we trigger a deadlock as we try to register and instantiate those devices while in the process of doing so for the parent controller and hence already holding the global spi_add_lock. Since we only care about concurrency within a single SPI bus move the lock to be per controller, avoiding the deadlock. This can be easily triggered in the case of spi-mux. Reported-by: Uwe Kleine-König Signed-off-by: Mark Brown commit 6ab4e2eb5e956a61e4d53cea3ab8c866ba79a830 Author: Andy Shevchenko Date: Wed Oct 13 23:17:18 2021 +0300 mmc: sdhci-pci: Read card detect from ACPI for Intel Merrifield Intel Merrifield platform had been converted to use ACPI enumeration. However, the driver missed an update to retrieve card detect GPIO. Fix it here. Unfortunately we can't rely on CD GPIO state because there are two different PCB designs in the wild that are using the opposite card detection sense and there is no way to distinguish those platforms, that's why ignore CD GPIO completely and use it only as an event. Fixes: 4590d98f5a4f ("sfi: Remove framework for deprecated firmware") BugLink: https://github.com/edison-fw/meta-intel-edison/issues/135 Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211013201723.52212-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit d9b7748ffc45250b4d7bcf22404383229bc495f5 Author: Hans Potsch Date: Wed Oct 6 14:13:32 2021 +0200 EDAC/armada-xp: Fix output of uncorrectable error counter The number of correctable errors is displayed as uncorrectable errors because the "SBE" error count is passed to both calls of edac_mc_handle_error(). Pass the correct uncorrectable error count to the second edac_mc_handle_error() call when logging uncorrectable errors. [ bp: Massage commit message. ] Fixes: 7f6998a41257 ("ARM: 8888/1: EDAC: Add driver for the Marvell Armada XP SDRAM and L2 cache ECC") Signed-off-by: Hans Potsch Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20211006121332.58788-1-hans.potsch@nokia.com commit be5eb933542629ad6a7d4c92097b1b472b1612d0 Author: Adam Manzanares Date: Wed Oct 13 15:04:19 2021 +0000 nvme: fix per-namespace chardev deletion Decrease reference count of chardevice during char device deletion in order to fix a memory leak. Add a release callabck for the device associated chardev and move ida_simple_remove into the release function. Fixes: 2637baed7801 ("nvme: introduce generic per-namespace chardev") Reported-by: Yi Zhang Suggested-by: Sagi Grimberg Signed-off-by: Adam Manzanares Reviewed-by: Javier González Tested-by: Yi Zhang Signed-off-by: Christoph Hellwig commit dbad63001eac3abeeb2b66ddf71504e8ab128c5c Author: Namjae Jeon Date: Mon Oct 11 19:15:25 2021 +0900 ksmbd: validate compound response buffer Add the check to validate compound response buffer. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9a63b999ae5435d82a5c353c6b1467100f857742 Author: Namjae Jeon Date: Mon Oct 11 12:48:31 2021 +0900 ksmbd: fix potencial 32bit overflow from data area check in smb2_write DataOffset and Length validation can be potencial 32bit overflow. This patch fix it. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bf8acc9e10e21c28452dfa067a7d31e6067104b1 Author: Hyunchul Lee Date: Thu Oct 7 16:26:58 2021 +0900 ksmbd: improve credits management * Requests except READ, WRITE, IOCTL, INFO, QUERY DIRECOTRY, CANCEL must consume one credit. * If client's granted credits are insufficient, refuse to handle requests. * Windows server 2016 or later grant up to 8192 credits to clients at once. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit f7db8fd03a4bc5baf70ccf8978fe17cb54368b97 Author: Namjae Jeon Date: Fri Oct 8 07:31:03 2021 +0900 ksmbd: add validation in smb2_ioctl Add validation for request/response buffer size check in smb2_ioctl and fsctl_copychunk() take copychunk_ioctl_req pointer and the other arguments instead of smb2_ioctl_req structure and remove an unused smb2_ioctl_req argument of fsctl_validate_negotiate_info. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Steve French Cc: Sergey Senozhatsky Acked-by: Hyunchul Lee Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 776c75010803849c1cc4f11031a2b3960ab05202 Author: Wang Hai Date: Wed Oct 13 14:16:31 2021 +0800 ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators() I got a null-ptr-deref report: KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097] ... RIP: 0010:regulator_enable+0x84/0x260 ... Call Trace: ahci_platform_enable_regulators+0xae/0x320 ahci_platform_enable_resources+0x1a/0x120 ahci_probe+0x4f/0x1b9 platform_probe+0x10b/0x280 ... entry_SYSCALL_64_after_hwframe+0x44/0xae If devm_regulator_get() in ahci_platform_get_resources() fails, hpriv->phy_regulator will point to NULL, when enabling or disabling it, null-ptr-deref will occur. ahci_probe() ahci_platform_get_resources() devm_regulator_get(, "phy") // failed, let phy_regulator = NULL ahci_platform_enable_resources() ahci_platform_enable_regulators() regulator_enable(hpriv->phy_regulator) // null-ptr-deref commit 962399bb7fbf ("ata: libahci_platform: Fix regulator_get_optional() misuse") replaces devm_regulator_get_optional() with devm_regulator_get(), but PHY regulator omits to delete "hpriv->phy_regulator = NULL;" like AHCI. Delete it like AHCI regulator to fix this bug. Fixes: commit 962399bb7fbf ("ata: libahci_platform: Fix regulator_get_optional() misuse") Reported-by: Hulk Robot Signed-off-by: Wang Hai Reviewed-by: Hans de Goede Signed-off-by: Damien Le Moal commit cbcc5072c228cca6b060143159f3ca8d485778d7 Merge: 0911ab31896f0 291c932fc3692 Author: Jakub Kicinski Date: Wed Oct 13 17:44:32 2021 -0700 Merge branch 'fix-two-possible-memory-leak-problems-in-nfc-digital-module' Ziyang Xuan says: ==================== Fix two possible memory leak problems in NFC digital module. ==================== Link: https://lore.kernel.org/r/cover.1634111083.git.william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit 291c932fc3692e4d211a445ba8aa35663831bac7 Author: Ziyang Xuan Date: Wed Oct 13 15:50:32 2021 +0800 NFC: digital: fix possible memory leak in digital_in_send_sdd_req() 'skb' is allocated in digital_in_send_sdd_req(), but not free when digital_in_send_cmd() failed, which will cause memory leak. Fix it by freeing 'skb' if digital_in_send_cmd() return failed. Fixes: 2c66daecc409 ("NFC Digital: Add NFC-A technology support") Signed-off-by: Ziyang Xuan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 58e7dcc9ca29c14e44267a4d0ea61e3229124907 Author: Ziyang Xuan Date: Wed Oct 13 15:50:12 2021 +0800 NFC: digital: fix possible memory leak in digital_tg_listen_mdaa() 'params' is allocated in digital_tg_listen_mdaa(), but not free when digital_send_cmd() failed, which will cause memory leak. Fix it by freeing 'params' if digital_send_cmd() return failed. Fixes: 1c7a4c24fbfd ("NFC Digital: Add target NFC-DEP support") Signed-off-by: Ziyang Xuan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 0911ab31896f0e908540746414a77dd63912748d Author: Ziyang Xuan Date: Wed Oct 13 11:49:32 2021 +0800 nfc: fix error handling of nfc_proto_register() When nfc proto id is using, nfc_proto_register() return -EBUSY error code, but forgot to unregister proto. Fix it by adding proto_unregister() in the error handling case. Fixes: c7fe3b52c128 ("NFC: add NFC socket family") Signed-off-by: Ziyang Xuan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211013034932.2833737-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit 1f922d9e374f0ca7d1b241666c792f403c6120aa Author: Vladimir Oltean Date: Wed Oct 13 03:19:09 2021 +0300 Revert "net: procfs: add seq_puts() statement for dev_mcast" This reverts commit ec18e8455484370d633a718c6456ddbf6eceef21. It turns out that there are user space programs which got broken by that change. One example is the "ifstat" program shipped by Debian: https://packages.debian.org/source/bullseye/ifstat which, confusingly enough, seems to not have anything in common with the much more familiar (at least to me) ifstat program from iproute2: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/misc/ifstat.c root@debian:~# ifstat ifstat: /proc/net/dev: unsupported format. This change modified the header (first two lines of text) in /proc/net/dev so that it looks like this: root@debian:~# cat /proc/net/dev Interface| Receive | Transmit | bytes packets errs drop fifo frame compressed multicast| bytes packets errs drop fifo colls carrier compressed lo: 97400 1204 0 0 0 0 0 0 97400 1204 0 0 0 0 0 0 bond0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eno2: 5002206 6651 0 0 0 0 0 0 105518642 1465023 0 0 0 0 0 0 swp0: 134531 2448 0 0 0 0 0 0 99599598 1464381 0 0 0 0 0 0 swp1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 swp2: 4867675 4203 0 0 0 0 0 0 58134 631 0 0 0 0 0 0 sw0p0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw0p1: 124739 2448 0 1422 0 0 0 0 93741184 1464369 0 0 0 0 0 0 sw0p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p0: 4850863 4203 0 0 0 0 0 0 54722 619 0 0 0 0 0 0 sw2p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 br0: 10508 212 0 212 0 0 0 212 61369558 958857 0 0 0 0 0 0 whereas before it looked like this: root@debian:~# cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 13160 164 0 0 0 0 0 0 13160 164 0 0 0 0 0 0 bond0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eno2: 30824 268 0 0 0 0 0 0 3332 37 0 0 0 0 0 0 swp0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 swp1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 swp2: 30824 268 0 0 0 0 0 0 2428 27 0 0 0 0 0 0 sw0p0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw0p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw0p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p0: 29752 268 0 0 0 0 0 0 1564 17 0 0 0 0 0 0 sw2p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sw2p3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 The reason why the ifstat shipped by Debian (v1.1, with a Debian patch upgrading it to 1.1-8.1 at the time of writing) is broken is because its "proc" driver/backend parses the header very literally: main/drivers.c#L825 if (!data->checked && strncmp(buf, "Inter-|", 7)) goto badproc; and there's no way in which the header can be changed such that programs parsing like that would not get broken. Even if we fix this ancient and very "lightly" maintained program to parse the text output of /proc/net/dev in a more sensible way, this story seems bound to repeat again with other programs, and modifying them all could cause more trouble than it's worth. On the other hand, the reverted patch had no other reason than an aesthetic one, so reverting it is the simplest way out. I don't know what other distributions would be affected; the fact that Debian doesn't ship the iproute2 version of the program (a different code base altogether, which uses netlink and not /proc/net/dev) is surprising in itself. Fixes: ec18e8455484 ("net: procfs: add seq_puts() statement for dev_mcast") Link: https://lore.kernel.org/netdev/20211009163511.vayjvtn3rrteglsu@skbuf/ Cc: Yajun Deng Cc: Matthieu Baerts Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20211013001909.3164185-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 0282b0f0126489af5b3993e52d1a05e6c7ebc4e8 Author: Steven Rostedt (VMware) Date: Wed Oct 13 16:51:13 2021 -0400 selftests/ftrace: Update test for more eprobe removal process The removal of eprobes was broken and missed in testing. Add various ways to remove eprobes that are considered acceptable to the testing process to catch when/if they break again. Link: https://lkml.kernel.org/r/20211013205533.836644549@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7d5fda1c841f9f3930eed61b92d542137f93fc30 Author: Steven Rostedt (VMware) Date: Wed Oct 13 16:51:12 2021 -0400 tracing: Fix event probe removal from dynamic events When an event probe is to be removed via the API that created it via the dynamic events, an -ENOENT error is returned. This is because the removal of the event probe does not expect to see the event system and name that the event probe is attached to, even though that's part of the API to create it. As the removal of probes is to use the same API as they are created. In fact, the removal is not consistent with the kprobes and uprobes removal. Fix that by allowing various ways to remove the eprobe. The eprobe is created with: e:[GROUP/]NAME SYSTEM/EVENT [OPTIONS] Have it get removed by echoing in the following into dynamic_events: # Remove all eprobes with NAME echo '-:NAME' >> dynamic_events # Remove a specific eprobe echo '-:GROUP/NAME' >> dynamic_events echo '-:GROUP/NAME SYSTEM/EVENT' >> dynamic_events echo '-:NAME SYSTEM/EVENT' >> dynamic_events echo '-:GROUP/NAME SYSTEM/EVENT OPTIONS' >> dynamic_events echo '-:NAME SYSTEM/EVENT OPTIONS' >> dynamic_events Link: https://lkml.kernel.org/r/20211012081925.0e19cc4f@gandalf.local.home Link: https://lkml.kernel.org/r/20211013205533.630722129@goodmis.org Suggested-by: Masami Hiramatsu Acked-by: Masami Hiramatsu Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events") Signed-off-by: Steven Rostedt (VMware) commit c370bb474016ab9edfdabd7c08a88dd13a71ddbd Author: Fabien Dessenne Date: Fri Oct 8 14:25:17 2021 +0200 pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume() When resuming from low power, the driver attempts to restore the configuration of some pins. This is done by a call to: stm32_pinctrl_restore_gpio_regs(struct stm32_pinctrl *pctl, u32 pin) where 'pin' must be a valid pin value (i.e. matching some 'groups->pin'). Fix the current implementation which uses some wrong 'pin' value. Fixes: e2f3cf18c3e2 ("pinctrl: stm32: add suspend/resume management") Signed-off-by: Fabien Dessenne Link: https://lore.kernel.org/r/20211008122517.617633-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij commit 6dba4bdfd7a30e77b848a45404b224588bf989e5 Author: Rafał Miłecki Date: Fri Oct 8 22:59:38 2021 +0200 Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode" This reverts commit a49d784d5a8272d0f63c448fe8dc69e589db006e. The updated binding was wrong / invalid and has been reverted. There isn't any upstream kernel DTS using it and Broadcom isn't known to use it neither. There is close to zero chance this will cause regression for anyone. Actually in-kernel bcm5301x.dtsi still uses the old good binding and so it's broken since the driver update. This revert fixes it. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211008205938.29925-3-zajec5@gmail.com Signed-off-by: Linus Walleij commit 1d0a779892e8aae484e11bf5f28fb41d49e8b0f6 Author: Rafał Miłecki Date: Fri Oct 8 22:59:37 2021 +0200 dt-bindings: pinctrl: brcm,ns-pinmux: drop unneeded CRU from example There is no need to include CRU in example of this binding. It wasn't complete / correct anyway. The proper binding can be find in the mfd/brcm,cru.yaml . Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211008205938.29925-2-zajec5@gmail.com Signed-off-by: Linus Walleij commit 0398adaec3419bdfa93baae70a3b696b4abdd7ad Author: Rafał Miłecki Date: Fri Oct 8 22:59:36 2021 +0200 Revert "dt-bindings: pinctrl: bcm4708-pinmux: rework binding to use syscon" This reverts commit 2ae80900f239484069569380e1fc4340fd6e0089. My rework was unneeded & wrong. It replaced a clear & correct "reg" property usage with a custom "offset" one. Back then I didn't understand how to properly handle CRU block binding. I heard / read about syscon and tried to use it in a totally invalid way. That change also missed Rob's review (obviously). Northstar's pin controller is a simple consistent hardware block that can be cleanly mapped using a 0x24 long reg space. Since the rework commit there wasn't any follow up modifying in-kernel DTS files to use the new binding. Broadcom also isn't known to use that bugged binding. There is close to zero chance this revert may actually cause problems / regressions. This commit is a simple revert. Example binding may (should) be updated / cleaned up but that can be handled separately. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211008205938.29925-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit f03dca0c9e2297c84a018e306f8a9cd534ee4287 Author: Nanyong Sun Date: Tue Oct 12 20:59:01 2021 +0800 net: encx24j600: check error in devm_regmap_init_encx24j600 devm_regmap_init may return error which caused by like out of memory, this will results in null pointer dereference later when reading or writing register: general protection fault in encx24j600_spi_probe KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097] CPU: 0 PID: 286 Comm: spi-encx24j600- Not tainted 5.15.0-rc2-00142-g9978db750e31-dirty #11 9c53a778c1306b1b02359f3c2bbedc0222cba652 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:regcache_cache_bypass drivers/base/regmap/regcache.c:540 Code: 54 41 89 f4 55 53 48 89 fb 48 83 ec 08 e8 26 94 a8 fe 48 8d bb a0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 4a 03 00 00 4c 8d ab b0 00 00 00 48 8b ab a0 00 RSP: 0018:ffffc900010476b8 EFLAGS: 00010207 RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 0000000000000000 RDX: 0000000000000012 RSI: ffff888002de0000 RDI: 0000000000000094 RBP: ffff888013c9a000 R08: 0000000000000000 R09: fffffbfff3f9cc6a R10: ffffc900010476e8 R11: fffffbfff3f9cc69 R12: 0000000000000001 R13: 000000000000000a R14: ffff888013c9af54 R15: ffff888013c9ad08 FS: 00007ffa984ab580(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055a6384136c8 CR3: 000000003bbe6003 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: encx24j600_spi_probe drivers/net/ethernet/microchip/encx24j600.c:459 spi_probe drivers/spi/spi.c:397 really_probe drivers/base/dd.c:517 __driver_probe_device drivers/base/dd.c:751 driver_probe_device drivers/base/dd.c:782 __device_attach_driver drivers/base/dd.c:899 bus_for_each_drv drivers/base/bus.c:427 __device_attach drivers/base/dd.c:971 bus_probe_device drivers/base/bus.c:487 device_add drivers/base/core.c:3364 __spi_add_device drivers/spi/spi.c:599 spi_add_device drivers/spi/spi.c:641 spi_new_device drivers/spi/spi.c:717 new_device_store+0x18c/0x1f1 [spi_stub 4e02719357f1ff33f5a43d00630982840568e85e] dev_attr_store drivers/base/core.c:2074 sysfs_kf_write fs/sysfs/file.c:139 kernfs_fop_write_iter fs/kernfs/file.c:300 new_sync_write fs/read_write.c:508 (discriminator 4) vfs_write fs/read_write.c:594 ksys_write fs/read_write.c:648 do_syscall_64 arch/x86/entry/common.c:50 entry_SYSCALL_64_after_hwframe arch/x86/entry/entry_64.S:113 Add error check in devm_regmap_init_encx24j600 to avoid this situation. Fixes: 04fbfce7a222 ("net: Microchip encx24j600 driver") Reported-by: Hulk Robot Signed-off-by: Nanyong Sun Link: https://lore.kernel.org/r/20211012125901.3623144-1-sunnanyong@huawei.com Signed-off-by: Jakub Kicinski commit b70b15217383e0e1c2ee9793e84f6b7957a33db9 Merge: 427f974d9727c 84c8a87402cf0 Author: Jakub Kicinski Date: Wed Oct 13 13:39:54 2021 -0700 Merge tag 'mlx5-fixes-2021-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2021-10-12 * tag 'mlx5-fixes-2021-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Fix division by 0 in mlx5e_select_queue for representors net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp net/mlx5e: Switchdev representors are not vlan challenged net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path net/mlx5e: Allow only complete TXQs partition in MQPRIO channel mode net/mlx5: Fix cleanup of bridge delayed work ==================== Link: https://lore.kernel.org/r/20211012205323.20123-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 427f974d9727ca681085ddcd0530c97ab5811ae0 Author: Vegard Nossum Date: Tue Oct 12 17:25:09 2021 +0200 net: korina: select CRC32 Fix the following build/link error by adding a dependency on the CRC32 routines: ld: drivers/net/ethernet/korina.o: in function `korina_multicast_list': korina.c:(.text+0x1af): undefined reference to `crc32_le' Fixes: ef11291bcd5f9 ("Add support the Korina (IDT RC32434) Ethernet MAC") Cc: Arnd Bergmann Signed-off-by: Vegard Nossum Acked-by: Florian fainelli Link: https://lore.kernel.org/r/20211012152509.21771-1-vegard.nossum@oracle.com Signed-off-by: Jakub Kicinski commit 0f0f80d9d5db0b9a78a6ec74714f08b7b8bda0de Author: Arnd Bergmann Date: Sun Oct 10 19:27:03 2021 +0200 iommu/arm: fix ARM_SMMU_QCOM compilation My previous bugfix ended up making things worse for the QCOM IOMMU driver when it forgot to add the Kconfig symbol that is getting used to control the compilation of the SMMU implementation specific code for Qualcomm. Fixes: 424953cf3c66 ("qcom_scm: hide Kconfig symbol") Reported-by: Daniel Lezcano Reported-by: Dmitry Baryshkov Reported-by: John Stultz Link: https://lore.kernel.org/lkml/20211010023350.978638-1-dmitry.baryshkov@linaro.org/ Acked-by: Will Deacon Signed-off-by: Arnd Bergmann commit 3536ac5d771bf7c68e70b08f7a7ec85ff56c6b6d Merge: 047051295201d 7f565d0ead264 Author: Arnd Bergmann Date: Wed Oct 13 21:17:07 2021 +0200 Merge tag 'optee-fix2-for-v5.15' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes Fix missing devices unregister during optee_remove Unregisters OP-TEE client devices (UUIDs of some known Trusted Applications) from the TEE bus when the OP-TEE driver is unloaded. * tag 'optee-fix2-for-v5.15' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: Fix missing devices unregister during optee_remove Link: https://lore.kernel.org/r/20211013122854.GA1542549@jade Signed-off-by: Arnd Bergmann commit 047051295201def0bd95936b67cc683658d3ddc2 Merge: 209ee634bc0d2 bc22b6208f416 Author: Arnd Bergmann Date: Wed Oct 13 20:57:12 2021 +0200 Merge tag 'arm-soc/for-5.15/devicetree' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs Device Tree fixes for 5.15, please pull the following: - Stefan fixes the VEC (video encoder) bus address for 2711, fixes the MDIO bus controller #address-cells/#size-cells inversion and the SDIO regulator voltage ranges - Nicolas fixes DTC warnings for the PCIe host bridge and its child USB device * tag 'arm-soc/for-5.15/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: bcm2711-rpi-4-b: Fix usb's unit address ARM: dts: bcm2711-rpi-4-b: Fix pcie0's unit address formatting ARM: dts: bcm2711-rpi-4-b: fix sd_io_1v8_reg regulator states ARM: dts: bcm2711: fix MDIO #address- and #size-cells ARM: dts: bcm283x: Fix VEC address for BCM2711 Link: https://lore.kernel.org/r/20211012213841.1872021-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 92c02ff1a43edce37cf1b092bfad37d84d7e4ea6 Author: Luca Weiss Date: Thu Oct 7 23:24:28 2021 +0200 clk: qcom: add select QCOM_GDSC for SM6350 QCOM_GDSC is needed for the gcc driver to probe. Fixes: 131abae905df ("clk: qcom: Add SM6350 GCC driver") Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20211007212444.328034-2-luca@z3ntu.xyz Signed-off-by: Stephen Boyd commit e41bdd18644a5dde1f344b70eb262b5c426e6f16 Author: Shawn Guo Date: Sun Sep 19 10:23:08 2021 +0800 clk: qcom: gcc-sm6115: Fix offset for hlos1_vote_turing_mmu_tbu0_gdsc It looks that the offset 0x7d060 is a copy & paste from above hlos1_vote_turing_mmu_tbu1_gdsc. Correct it to 0x7d07c as per downstream kernel. Fixes: cbe63bfdc54f ("clk: qcom: Add Global Clock controller (GCC) driver for SM6115") Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20210919022308.24046-1-shawn.guo@linaro.org Signed-off-by: Stephen Boyd commit 663991f32857b3b63c94c97de9dbb0ec8600144f Author: Dan Carpenter Date: Wed Oct 13 11:06:45 2021 +0300 RDMA/rdmavt: Fix error code in rvt_create_qp() Return negative -ENOMEM instead of positive ENOMEM. Returning a postive value will cause an Oops because it becomes an ERR_PTR() in the create_qp() function. Fixes: 514aee660df4 ("RDMA: Globally allocate and release QP memory") Link: https://lore.kernel.org/r/20211013080645.GD6010@kili Signed-off-by: Dan Carpenter Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 13bac861952a78664907a0f927d3e874e9a59034 Author: Mike Marciniszyn Date: Wed Oct 13 10:18:52 2021 -0400 IB/hfi1: Fix abba locking issue with sc_disable() sc_disable() after having disabled the send context wakes up any waiters by calling hfi1_qp_wakeup() while holding the waitlock for the sc. This is contrary to the model for all other calls to hfi1_qp_wakeup() where the waitlock is dropped and a local is used to drive calls to hfi1_qp_wakeup(). Fix by moving the sc->piowait into a local list and driving the wakeup calls from the list. Fixes: 099a884ba4c0 ("IB/hfi1: Handle wakeup of orphaned QPs for pio") Link: https://lore.kernel.org/r/20211013141852.128104.2682.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Mike Marciniszyn Reported-by: TOTE Robot Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d39bf40e55e666b5905fdbd46a0dced030ce87be Author: Mike Marciniszyn Date: Tue Oct 12 13:55:19 2021 -0400 IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields Overflowing either addrlimit or bytes_togo can allow userspace to trigger a buffer overflow of kernel memory. Check for overflows in all the places doing math on user controlled buffers. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Link: https://lore.kernel.org/r/20211012175519.7298.77738.stgit@awfm-01.cornelisnetworks.com Reported-by: Ilja Van Sprundel Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit e599ee234ad4fdfe241d937bbabd96e0d8f9d868 Author: Vegard Nossum Date: Tue Oct 12 11:34:46 2021 +0200 net: arc: select CRC32 Fix the following build/link error by adding a dependency on the CRC32 routines: ld: drivers/net/ethernet/arc/emac_main.o: in function `arc_emac_set_rx_mode': emac_main.c:(.text+0xb11): undefined reference to `crc32_le' The crc32_le() call comes through the ether_crc_le() call in arc_emac_set_rx_mode(). [v2: moved the select to ARC_EMAC_CORE; the Makefile is a bit confusing, but the error comes from emac_main.o, which is part of the arc_emac module, which in turn is enabled by CONFIG_ARC_EMAC_CORE. Note that arc_emac is different from emac_arc...] Fixes: 775dd682e2b0ec ("arc_emac: implement promiscuous mode and multicast filtering") Cc: Arnd Bergmann Signed-off-by: Vegard Nossum Link: https://lore.kernel.org/r/20211012093446.1575-1-vegard.nossum@oracle.com Signed-off-by: Jakub Kicinski commit 6b9b546dc00797c74bef491668ce5431ff54e1e2 Author: Shengjiu Wang Date: Wed Oct 13 13:17:04 2021 +0800 ASoC: wm8960: Fix clock configuration on slave mode There is a noise issue for 8kHz sample rate on slave mode. Compared with master mode, the difference is the DACDIV setting, after correcting the DACDIV, the noise is gone. There is no noise issue for 48kHz sample rate, because the default value of DACDIV is correct for 48kHz. So wm8960_configure_clocking() should be functional for ADC and DAC function even if it is slave mode. In order to be compatible for old use case, just add condition for checking that sysclk is zero with slave mode. Fixes: 0e50b51aa22f ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock") Signed-off-by: Shengjiu Wang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1634102224-3922-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 348949d9a4440abdab3b1dc99a9bb660e8c7da7c Merge: f4d0cc426f77d 0d67e332e6df7 Author: Linus Torvalds Date: Wed Oct 13 07:42:07 2021 -0700 Merge tag 'modules-for-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux Pull modules fix from Jessica Yu: - Build fix for cfi_init() when CONFIG_MODULE_UNLOAD=n * tag 'modules-for-v5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: module: fix clang CFI with MODULE_UNLOAD=n commit 5d388fa01fa6eb310ac023a363a6cb216d9d8fe9 Author: Stephen Boyd Date: Wed Oct 13 13:45:11 2021 +0100 nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells If a cell has 'nbits' equal to a multiple of BITS_PER_BYTE the logic *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0); will become undefined behavior because nbits modulo BITS_PER_BYTE is 0, and we subtract one from that making a large number that is then shifted more than the number of bits that fit into an unsigned long. UBSAN reports this problem: UBSAN: shift-out-of-bounds in drivers/nvmem/core.c:1386:8 shift exponent 64 is too large for 64-bit type 'unsigned long' CPU: 6 PID: 7 Comm: kworker/u16:0 Not tainted 5.15.0-rc3+ #9 Hardware name: Google Lazor (rev3+) with KB Backlight (DT) Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace+0x0/0x170 show_stack+0x24/0x30 dump_stack_lvl+0x64/0x7c dump_stack+0x18/0x38 ubsan_epilogue+0x10/0x54 __ubsan_handle_shift_out_of_bounds+0x180/0x194 __nvmem_cell_read+0x1ec/0x21c nvmem_cell_read+0x58/0x94 nvmem_cell_read_variable_common+0x4c/0xb0 nvmem_cell_read_variable_le_u32+0x40/0x100 a6xx_gpu_init+0x170/0x2f4 adreno_bind+0x174/0x284 component_bind_all+0xf0/0x264 msm_drm_bind+0x1d8/0x7a0 try_to_bring_up_master+0x164/0x1ac __component_add+0xbc/0x13c component_add+0x20/0x2c dp_display_probe+0x340/0x384 platform_probe+0xc0/0x100 really_probe+0x110/0x304 __driver_probe_device+0xb8/0x120 driver_probe_device+0x4c/0xfc __device_attach_driver+0xb0/0x128 bus_for_each_drv+0x90/0xdc __device_attach+0xc8/0x174 device_initial_probe+0x20/0x2c bus_probe_device+0x40/0xa4 deferred_probe_work_func+0x7c/0xb8 process_one_work+0x128/0x21c process_scheduled_works+0x40/0x54 worker_thread+0x1ec/0x2a8 kthread+0x138/0x158 ret_from_fork+0x10/0x20 Fix it by making sure there are any bits to mask out. Fixes: 69aba7948cbe ("nvmem: Add a simple NVMEM framework for consumers") Cc: Douglas Anderson Cc: stable@vger.kernel.org Signed-off-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211013124511.18726-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit bcef9356fc2e1302daf373c83c826aa27954d128 Author: Cindy Lu Date: Wed Sep 29 17:09:33 2021 +0800 vhost-vdpa: Fix the wrong input in config_cb Fix the wrong input in for config_cb. In function vhost_vdpa_config_cb, the input cb.private was used as struct vhost_vdpa, so the input was wrong here, fix this issue Fixes: 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa") Signed-off-by: Cindy Lu Link: https://lore.kernel.org/r/20210929090933.20465-1-lulu@redhat.com Signed-off-by: Michael S. Tsirkin commit 09b6addf64860bf7b0e3dddf03229c8c20eda4b5 Author: Randy Dunlap Date: Wed Oct 6 13:29:04 2021 -0700 VDUSE: fix documentation underline warning Fix a VDUSE documentation build warning: Documentation/userspace-api/vduse.rst:21: WARNING: Title underline too short. Fixes: 7bc7f61897b6 ("Documentation: Add documentation for VDUSE") Signed-off-by: Randy Dunlap Cc: Xie Yongji Cc: Jason Wang Cc: Michael S. Tsirkin Cc: virtualization@lists.linux-foundation.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/20211006202904.30241-1-rdunlap@infradead.org Signed-off-by: Michael S. Tsirkin Reviewed-by: Xie Yongji Acked-by: Jason Wang commit 8b7216439e2e2128f6f1a19ad4b6be94d8b0e23d Author: Heiko Carstens Date: Wed Oct 13 11:45:38 2021 +0200 s390: add Alexander Gordeev as reviewer Alexander Gordeev will help reviewing s390 code. Acked-by: Alexander Gordeev Acked-by: Vasily Gorbik Acked-by: Christian Borntraeger Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ff63198850f33eab54b2da6905380fd4d4fc0739 Author: Michael S. Tsirkin Date: Mon Oct 4 11:31:00 2021 -0400 Revert "virtio-blk: Add validation for block size in config space" It turns out that access to config space before completing the feature negotiation is broken for big endian guests at least with QEMU hosts up to 6.1 inclusive. This affects any device that accesses config space in the validate callback: at the moment that is virtio-net with VIRTIO_NET_F_MTU but since 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") that also started affecting virtio-blk with VIRTIO_BLK_F_BLK_SIZE. Further, unlike VIRTIO_NET_F_MTU which is off by default on QEMU, VIRTIO_BLK_F_BLK_SIZE is on by default, which resulted in lots of people not being able to boot VMs on BE. The spec is very clear that what we are doing is legal so QEMU needs to be fixed, but given it's been broken for so many years and no one noticed, we need to give QEMU a bit more time before applying this. Further, this patch is incomplete (does not check blk size is a power of two) and it duplicates the logic from nbd. Revert for now, and we'll reapply a cleaner logic in the next release. Cc: stable@vger.kernel.org Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") Cc: Xie Yongji Signed-off-by: Michael S. Tsirkin commit 97f854be203883b61d24f230445bd533bbdf770c Author: Wu Zongyong Date: Wed Sep 15 14:39:32 2021 +0800 vhost_vdpa: unset vq irq before freeing irq Currently we unset vq irq after freeing irq and that will result in error messages: pi_update_irte: failed to update PI IRTE irq bypass consumer (token 000000005a07a12b) unregistration fails: -22 This patch solves this. Signed-off-by: Wu Zongyong Link: https://lore.kernel.org/r/02637d38dcf4e4b836c5b3a65055fe92bf812b3b.1631687872.git.wuzongyong@linux.alibaba.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 2f9a174f918e29608564c7a4e8329893ab604fb4 Author: Halil Pasic Date: Mon Oct 11 07:39:21 2021 +0200 virtio: write back F_VERSION_1 before validate The virtio specification virtio-v1.1-cs01 states: "Transitional devices MUST detect Legacy drivers by detecting that VIRTIO_F_VERSION_1 has not been acknowledged by the driver." This is exactly what QEMU as of 6.1 has done relying solely on VIRTIO_F_VERSION_1 for detecting that. However, the specification also says: "... the driver MAY read (but MUST NOT write) the device-specific configuration fields to check that it can support the device ..." before setting FEATURES_OK. In that case, any transitional device relying solely on VIRTIO_F_VERSION_1 for detecting legacy drivers will return data in legacy format. In particular, this implies that it is in big endian format for big endian guests. This naturally confuses the driver which expects little endian in the modern mode. It is probably a good idea to amend the spec to clarify that VIRTIO_F_VERSION_1 can only be relied on after the feature negotiation is complete. Before validate callback existed, config space was only read after FEATURES_OK. However, we already have two regressions, so let's address this here as well. The regressions affect the VIRTIO_NET_F_MTU feature of virtio-net and the VIRTIO_BLK_F_BLK_SIZE feature of virtio-blk for BE guests when virtio 1.0 is used on both sides. The latter renders virtio-blk unusable with DASD backing, because things simply don't work with the default. See Fixes tags for relevant commits. For QEMU, we can work around the issue by writing out the feature bits with VIRTIO_F_VERSION_1 bit set. We (ab)use the finalize_features config op for this. This isn't enough to address all vhost devices since these do not get the features until FEATURES_OK, however it looks like the affected devices actually never handled the endianness for legacy mode correctly, so at least that's not a regression. No devices except virtio net and virtio blk seem to be affected. Long term the right thing to do is to fix the hypervisors. Cc: #v4.11 Signed-off-by: Halil Pasic Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") Fixes: fe36cbe0671e ("virtio_net: clear MTU when out of range") Reported-by: markver@us.ibm.com Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/20211011053921.1198936-1-pasic@linux.ibm.com Signed-off-by: Michael S. Tsirkin commit c2115b2b16421d93d4993f3fe4c520e91d6fe801 Author: Miquel Raynal Date: Wed Oct 6 00:16:31 2021 +0200 usb: musb: dsps: Fix the probe error path Commit 7c75bde329d7 ("usb: musb: musb_dsps: request_irq() after initializing musb") has inverted the calls to dsps_setup_optional_vbus_irq() and dsps_create_musb_pdev() without updating correctly the error path. dsps_create_musb_pdev() allocates and registers a new platform device which must be unregistered and freed with platform_device_unregister(), and this is missing upon dsps_setup_optional_vbus_irq() error. While on the master branch it seems not to trigger any issue, I observed a kernel crash because of a NULL pointer dereference with a v5.10.70 stable kernel where the patch mentioned above was backported. With this kernel version, -EPROBE_DEFER is returned the first time dsps_setup_optional_vbus_irq() is called which triggers the probe to error out without unregistering the platform device. Unfortunately, on the Beagle Bone Black Wireless, the platform device still living in the system is being used by the USB Ethernet gadget driver, which during the boot phase triggers the crash. My limited knowledge of the musb world prevents me to revert this commit which was sent to silence a robot warning which, as far as I understand, does not make sense. The goal of this patch was to prevent an IRQ to fire before the platform device being registered. I think this cannot ever happen due to the fact that enabling the interrupts is done by the ->enable() callback of the platform musb device, and this platform device must be already registered in order for the core or any other user to use this callback. Hence, I decided to fix the error path, which might prevent future errors on mainline kernels while also fixing older ones. Fixes: 7c75bde329d7 ("usb: musb: musb_dsps: request_irq() after initializing musb") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20211005221631.1529448-1-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 82a59c7f456db9f2874e9f1e9cb4cc19e71e95c5 Author: Zenghui Yu Date: Mon Sep 6 11:35:41 2021 +0800 drm/i915: Free the returned object of acpi_evaluate_dsm() As per the comment on top of acpi_evaluate_dsm(): | * Evaluate device's _DSM method with specified GUID, revision id and | * function number. Caller needs to free the returned object. We should free the returned object of acpi_evaluate_dsm() to avoid memory leakage. Otherwise the kmemleak splat will be triggered at boot time (if we compile kernel with CONFIG_DEBUG_TEST_DRIVER_REMOVE=y). Fixes: 8e55f99c510f ("drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops") Cc: Kai-Heng Feng Signed-off-by: Zenghui Yu Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210906033541.862-1-yuzenghui@huawei.com (cherry picked from commit 149ac2e7ae1845191bd18b66a725392ac83a0c47) Signed-off-by: Jani Nikula commit af628cdd64e11f03181a5a19645768ed4687bda4 Author: Matthew Brost Date: Fri Oct 1 08:58:25 2021 -0700 drm/i915: Fix bug in user proto-context creation that leaked contexts Set number of engines before attempting to create contexts so the function free_engines can clean up properly. Also check return of alloc_engines for NULL. v2: (Tvrtko) - Send as stand alone patch (John Harrison) - Check for alloc_engines returning NULL v3: (Checkpatch / Tvrtko) - Remove braces around single line if statement Cc: Jason Ekstrand Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Reviewed-by: Tvrtko Ursulin Signed-off-by: Matthew Brost Cc: Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211001155825.6762-1-matthew.brost@intel.com (cherry picked from commit 84edf53776343d6b5bf5fa59a6f600a22ca23c40) Signed-off-by: Jani Nikula commit 6d7163f2c49fda5658e43105a96b555c89a4548d Author: Alexander Usyskin Date: Wed Oct 13 10:45:52 2021 +0300 mei: hbm: drop hbm responses 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 init or link reset. Fixes: da3eb47c90d4 ("mei: hbm: drop hbm responses on shutdown") Fixes: 36edb1407c3c ("mei: allow clients on bus to communicate in remove callback") Cc: # v5.12+ Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20211013074552.2278419-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 6f779e1d359b8d5801f677c1d49dcfa10bf95674 Author: Cédric Le Goater Date: Mon Oct 11 09:02:03 2021 +0200 powerpc/xive: Discard disabled interrupts in get_irqchip_state() When an interrupt is passed through, the KVM XIVE device calls the set_vcpu_affinity() handler which raises the P bit to mask the interrupt and to catch any in-flight interrupts while routing the interrupt to the guest. On the guest side, drivers (like some Intels) can request at probe time some MSIs and call synchronize_irq() to check that there are no in flight interrupts. This will call the XIVE get_irqchip_state() handler which will always return true as the interrupt P bit has been set on the host side and lock the CPU in an infinite loop. Fix that by discarding disabled interrupts in get_irqchip_state(). Fixes: da15c03b047d ("powerpc/xive: Implement get_irqchip_state method for XIVE to fix shutdown race") Cc: stable@vger.kernel.org #v5.4+ Signed-off-by: Cédric Le Goater Tested-by: seeteena Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211011070203.99726-1-clg@kaod.org commit 6e44bd6d34d659c44cd8e7fc925c8a97f49b3c33 Author: Mike Rapoport Date: Wed Oct 13 08:36:59 2021 +0300 memblock: exclude NOMAP regions from kmemleak Vladimir Zapolskiy reports: commit a7259df76702 ("memblock: make memblock_find_in_range method private") invokes a kernel panic while running kmemleak on OF platforms with nomaped regions: Unable to handle kernel paging request at virtual address fff000021e00000 [...] scan_block+0x64/0x170 scan_gray_list+0xe8/0x17c kmemleak_scan+0x270/0x514 kmemleak_write+0x34c/0x4ac Indeed, NOMAP regions don't have linear map entries so an attempt to scan these areas would fault. Prevent such faults by excluding NOMAP regions from kmemleak. Link: https://lore.kernel.org/all/8ade5174-b143-d621-8c8e-dc6a1898c6fb@linaro.org Fixes: a7259df76702 ("memblock: make memblock_find_in_range method private") Signed-off-by: Mike Rapoport Tested-by: Vladimir Zapolskiy commit f2b85040acec9a928b4eb1b57a989324e8e38d3f Author: Ming Lei Date: Fri Oct 8 13:01:18 2021 +0800 scsi: core: Put LLD module refcnt after SCSI device is released SCSI host release is triggered when SCSI device is freed. We have to make sure that the low-level device driver module won't be unloaded before SCSI host instance is released because shost->hostt is required in the release handler. Make sure to put LLD module refcnt after SCSI device is released. Fixes a kernel panic of 'BUG: unable to handle page fault for address' reported by Changhui and Yi. Link: https://lore.kernel.org/r/20211008050118.1440686-1-ming.lei@redhat.com Cc: Greg Kroah-Hartman Reported-by: Changhui Zhong Reported-by: Yi Zhang Tested-by: Yi Zhang Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit 6fd13d699d24beaa28310848fe65fd898fbb9043 Author: Andrea Parri (Microsoft) Date: Thu Oct 7 14:28:28 2021 +0200 scsi: storvsc: Fix validation for unsolicited incoming packets The validation on the length of incoming packets performed in storvsc_on_channel_callback() does not apply to unsolicited packets with ID of 0 sent by Hyper-V. Adjust the validation for such unsolicited packets. Link: https://lore.kernel.org/r/20211007122828.469289-1-parri.andrea@gmail.com Fixes: 91b1b640b834b2 ("scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()") Reported-by: Dexuan Cui Reviewed-by: Michael Kelley Reviewed-by: Haiyang Zhang Signed-off-by: Andrea Parri (Microsoft) Signed-off-by: Martin K. Petersen commit 2b94b6b79b7c24092a6169db9e83c4565be0db42 Author: Wang Hai Date: Tue Oct 12 15:15:56 2021 +0800 PCI/MSI: Handle msi_populate_sysfs() errors correctly Previously, when msi_populate_sysfs() failed, we saved the error return value as dev->msi_irq_groups, which leads to a page fault when free_msi_irqs() calls msi_destroy_sysfs(). To prevent this, leave dev->msi_irq_groups alone when msi_populate_sysfs() fails. Found by the Hulk Robot when injecting a memory allocation fault in msi_populate_sysfs(): BUG: unable to handle page fault for address: fffffffffffffff4 ... Call Trace: msi_destroy_sysfs+0x30/0xa0 free_msi_irqs+0x11d/0x1b0 Fixes: 2f170814bdd2 ("genirq/msi: Move MSI sysfs handling from PCI to MSI core") Link: https://lore.kernel.org/r/20211012071556.939137-1-wanghai38@huawei.com Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Bjorn Helgaas Acked-by: Barry Song commit 847c6bdba833115e07376584024b2cb43ef7914b Merge: 3af760e4d3b0a 8d5f7954b7c8d Author: Jakub Kicinski Date: Tue Oct 12 17:35:21 2021 -0700 Merge branch 'felix-dsa-driver-fixes' Vladimir Oltean says: ==================== Felix DSA driver fixes This is an assorted collection of fixes for issues seen on the NXP LS1028A switch. - PTP packet drops due to switch congestion result in catastrophic damage to the driver's state - loops are not blocked by STP if using the ocelot-8021q tagger - driver uses the wrong CPU port when two of them are defined in DT - module autoloading is broken* with both tagging protocol drivers (ocelot and ocelot-8021q) Changes in v2: - Stop printing that we aren't going to take TX timestamps if we don't have TX timestamping anyway, and we are just carrying PTP frames for a cascaded DSA switch. - Shorten the deferred xmit kthread name so that it fits the 16 character limit (TASK_COMM_LEN) ==================== Link: https://lore.kernel.org/r/20211012114044.2526146-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 8d5f7954b7c8de54902a8beda141064a7e2e6ee0 Author: Vladimir Oltean Date: Tue Oct 12 14:40:44 2021 +0300 net: dsa: felix: break at first CPU port during init and teardown The NXP LS1028A switch has two Ethernet ports towards the CPU, but only one of them is capable of acting as an NPI port at a time (inject and extract packets using DSA tags). However, using the alternative ocelot-8021q tagging protocol, it should be possible to use both CPU ports symmetrically, but for that we need to mark both ports in the device tree as DSA masters. In the process of doing that, it can be seen that traffic to/from the network stack gets broken, and this is because the Felix driver iterates through all DSA CPU ports and configures them as NPI ports. But since there can only be a single NPI port, we effectively end up in a situation where DSA thinks the default CPU port is the first one, but the hardware port configured to be an NPI is the last one. I would like to treat this as a bug, because if the updated device trees are going to start circulating, it would be really good for existing kernels to support them, too. Fixes: adb3dccf090b ("net: dsa: felix: convert to the new .change_tag_protocol DSA API") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 43ba33b4f143965a451cfdc1e826b61f6933c887 Author: Vladimir Oltean Date: Tue Oct 12 14:40:43 2021 +0300 net: dsa: tag_ocelot_8021q: fix inability to inject STP BPDUs into BLOCKING ports When setting up a bridge with stp_state 1, topology changes are not detected and loops are not blocked. This is because the standard way of transmitting a packet, based on VLAN IDs redirected by VCAP IS2 to the right egress port, does not override the port STP state (in the case of Ocelot switches, that's really the PGID_SRC masks). To force a packet to be injected into a port that's BLOCKING, we must send it as a control packet, which means in the case of this tagger to send it using the manual register injection method. We already do this for PTP frames, extend the logic to apply to any link-local MAC DA. Fixes: 7c83a7c539ab ("net: dsa: add a second tagger for Ocelot switches based on tag_8021q") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 1328a883258b4507909090ed0a9ad63771f9f780 Author: Vladimir Oltean Date: Tue Oct 12 14:40:42 2021 +0300 net: dsa: felix: purge skb from TX timestamping queue if it cannot be sent At present, when a PTP packet which requires TX timestamping gets dropped under congestion by the switch, things go downhill very fast. The driver keeps a clone of that skb in a queue of packets awaiting TX timestamp interrupts, but interrupts will never be raised for the dropped packets. Moreover, matching timestamped packets to timestamps is done by a 2-bit timestamp ID, and this can wrap around and we can match on the wrong skb. Since with the default NPI-based tagging protocol, we get no notification about packet drops, the best we can do is eventually recover from the drop of a PTP frame: its skb will be dead memory until another skb which was assigned the same timestamp ID happens to find it. However, with the ocelot-8021q tagger which injects packets using the manual register interface, it appears that we can check for more information, such as: - whether the input queue has reached the high watermark or not - whether the injection group's FIFO can accept additional data or not so we know that a PTP frame is likely to get dropped before actually sending it, and drop it ourselves (because DSA uses NETIF_F_LLTX, so it can't return NETDEV_TX_BUSY to ask the qdisc to requeue the packet). But when we do that, we can also remove the skb from the timestamping queue, because there surely won't be any timestamp that matches it. Fixes: 0a6f17c6ae21 ("net: dsa: tag_ocelot_8021q: add support for PTP timestamping") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 49f885b2d97093451410e7279aa29d81e094e108 Author: Vladimir Oltean Date: Tue Oct 12 14:40:41 2021 +0300 net: dsa: tag_ocelot_8021q: break circular dependency with ocelot switch lib Michael reported that when using the "ocelot-8021q" tagging protocol, the switch driver module must be manually loaded before the tagging protocol can be loaded/is available. This appears to be the same problem described here: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ where due to the fact that DSA tagging protocols make use of symbols exported by the switch drivers, circular dependencies appear and this breaks module autoloading. The ocelot_8021q driver needs the ocelot_can_inject() and ocelot_port_inject_frame() functions from the switch library. Previously the wrong approach was taken to solve that dependency: shims were provided for the case where the ocelot switch library was compiled out, but that turns out to be insufficient, because the dependency when the switch lib _is_ compiled is problematic too. We cannot declare ocelot_can_inject() and ocelot_port_inject_frame() as static inline functions, because these access I/O functions like __ocelot_write_ix() which is called by ocelot_write_rix(). Making those static inline basically means exposing the whole guts of the ocelot switch library, not ideal... We already have one tagging protocol driver which calls into the switch driver during xmit but not using any exported symbol: sja1105_defer_xmit. We can do the same thing here: create a kthread worker and one work item per skb, and let the switch driver itself do the register accesses to send the skb, and then consume it. Fixes: 0a6f17c6ae21 ("net: dsa: tag_ocelot_8021q: add support for PTP timestamping") Reported-by: Michael Walle Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit deab6b1cd9789bb9bd466d5e76aecb8b336259b4 Author: Vladimir Oltean Date: Tue Oct 12 14:40:40 2021 +0300 net: dsa: tag_ocelot: break circular dependency with ocelot switch lib driver As explained here: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ DSA tagging protocol drivers cannot depend on symbols exported by switch drivers, because this creates a circular dependency that breaks module autoloading. The tag_ocelot.c file depends on the ocelot_ptp_rew_op() function exported by the common ocelot switch lib. This function looks at OCELOT_SKB_CB(skb) and computes how to populate the REW_OP field of the DSA tag, for PTP timestamping (the command: one-step/two-step, and the TX timestamp identifier). None of that requires deep insight into the driver, it is quite stateless, as it only depends upon the skb->cb. So let's make it a static inline function and put it in include/linux/dsa/ocelot.h, a file that despite its name is used by the ocelot switch driver for populating the injection header too - since commit 40d3f295b5fe ("net: mscc: ocelot: use common tag parsing code with DSA"). With that function declared as static inline, its body is expanded inside each call site, so the dependency is broken and the DSA tagger can be built without the switch library, upon which the felix driver depends. Fixes: 39e5308b3250 ("net: mscc: ocelot: support PTP Sync one-step timestamping") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit ebb4c6a990f786d7e0e4618a0d3766cd660125d8 Author: Vladimir Oltean Date: Tue Oct 12 14:40:39 2021 +0300 net: mscc: ocelot: cross-check the sequence id from the timestamp FIFO with the skb PTP header The sad reality is that when a PTP frame with a TX timestamping request is transmitted, it isn't guaranteed that it will make it all the way to the wire (due to congestion inside the switch), and that a timestamp will be taken by the hardware and placed in the timestamp FIFO where an IRQ will be raised for it. The implication is that if enough PTP frames are silently dropped by the hardware such that the timestamp ID has rolled over, it is possible to match a timestamp to an old skb. Furthermore, nobody will match on the real skb corresponding to this timestamp, since we stupidly matched on a previous one that was stale in the queue, and stopped there. So PTP timestamping will be broken and there will be no way to recover. It looks like the hardware parses the sequenceID from the PTP header, and also provides that metadata for each timestamp. The driver currently ignores this, but it shouldn't. As an extra resiliency measure, do the following: - check whether the PTP sequenceID also matches between the skb and the timestamp, treat the skb as stale otherwise and free it - if we see a stale skb, don't stop there and try to match an skb one more time, chances are there's one more skb in the queue with the same timestamp ID, otherwise we wouldn't have ever found the stale one (it is by timestamp ID that we matched it). While this does not prevent PTP packet drops, it at least prevents the catastrophic consequences of incorrect timestamp matching. Since we already call ptp_classify_raw in the TX path, save the result in the skb->cb of the clone, and just use that result in the interrupt code path. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit fba01283d85a09e0e2ef552c6e764b903111d90a Author: Vladimir Oltean Date: Tue Oct 12 14:40:38 2021 +0300 net: mscc: ocelot: deny TX timestamping of non-PTP packets It appears that Ocelot switches cannot timestamp non-PTP frames, I tested this using the isochron program at: https://github.com/vladimiroltean/tsn-scripts with the result that the driver increments the ocelot_port->ts_id counter as expected, puts it in the REW_OP, but the hardware seems to not timestamp these packets at all, since no IRQ is emitted. Therefore check whether we are sending PTP frames, and refuse to populate REW_OP otherwise. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 9fde506e0c53b8309f69b18b4b8144c544b4b3b1 Author: Vladimir Oltean Date: Tue Oct 12 14:40:37 2021 +0300 net: mscc: ocelot: warn when a PTP IRQ is raised for an unknown skb When skb_match is NULL, it means we received a PTP IRQ for a timestamp ID that the kernel has no idea about, since there is no skb in the timestamping queue with that timestamp ID. This is a grave error and not something to just "continue" over. So print a big warning in case this happens. Also, move the check above ocelot_get_hwtimestamp(), there is no point in reading the full 64-bit current PTP time if we're not going to do anything with it anyway for this skb. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 52849bcf0029ccc553be304e4f804938a39112e2 Author: Vladimir Oltean Date: Tue Oct 12 14:40:36 2021 +0300 net: mscc: ocelot: avoid overflowing the PTP timestamp FIFO PTP packets with 2-step TX timestamp requests are matched to packets based on the egress port number and a 6-bit timestamp identifier. All PTP timestamps are held in a common FIFO that is 128 entry deep. This patch ensures that back-to-back timestamping requests cannot exceed the hardware FIFO capacity. If that happens, simply send the packets without requesting a TX timestamp to be taken (in the case of felix, since the DSA API has a void return code in ds->ops->port_txtstamp) or drop them (in the case of ocelot). I've moved the ts_id_lock from a per-port basis to a per-switch basis, because we need separate accounting for both numbers of PTP frames in flight. And since we need locking to inc/dec the per-switch counter, that also offers protection for the per-port counter and hence there is no reason to have a per-port counter anymore. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit c57fe0037a4e3863d9b740f8c14df9c51ac31aa1 Author: Vladimir Oltean Date: Tue Oct 12 14:40:35 2021 +0300 net: mscc: ocelot: make use of all 63 PTP timestamp identifiers At present, there is a problem when user space bombards a port with PTP event frames which have TX timestamping requests (or when a tc-taprio offload is installed on a port, which delays the TX timestamps by a significant amount of time). The driver will happily roll over the 2-bit timestamp ID and this will cause incorrect matches between an skb and the TX timestamp collected from the FIFO. The Ocelot switches have a 6-bit PTP timestamp identifier, and the value 63 is reserved, so that leaves identifiers 0-62 to be used. The timestamp identifiers are selected by the REW_OP packet field, and are actually shared between CPU-injected frames and frames which match a VCAP IS2 rule that modifies the REW_OP. The hardware supports partitioning between the two uses of the REW_OP field through the PTP_ID_LOW and PTP_ID_HIGH registers, and by default reserves the PTP IDs 0-3 for CPU-injected traffic and the rest for VCAP IS2. The driver does not use VCAP IS2 to set REW_OP for 2-step timestamping, and it also writes 0xffffffff to both PTP_ID_HIGH and PTP_ID_LOW in ocelot_init_timestamp() which makes all timestamp identifiers available to CPU injection. Therefore, we can make use of all 63 timestamp identifiers, which should allow more timestampable packets to be in flight on each port. This is only part of the solution, more issues will be addressed in future changes. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 3af760e4d3b0a32448decb8ea068a221cbd24fe3 Merge: 43a4b4dbd48c9 4ac0567e40b33 Author: Jakub Kicinski Date: Tue Oct 12 17:33:39 2021 -0700 Merge branch 'fix-circular-dependency-between-sja1105-and-tag_sja1105' Vladimir Oltean says: ==================== Fix circular dependency between sja1105 and tag_sja1105 As discussed here: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ DSA tagging protocols cannot use symbols exported by switch drivers. Eliminate the two instances of that from tag_sja1105, and that allows us to have a working setup with modules again. ==================== Re-applying to net, this was mistakenly applied to net-next, see first Link. Link: https://lore.kernel.org/r/20211012114044.2526146-1-vladimir.oltean@nxp.com/ Link: https://lore.kernel.org/r/20210922143726.2431036-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 4ac0567e40b334b54988e3c28a2425ff9c8bdd35 Author: Vladimir Oltean Date: Wed Sep 22 17:37:26 2021 +0300 net: dsa: sja1105: break dependency between dsa_port_is_sja1105 and switch driver It's nice to be able to test a tagging protocol with dsa_loop, but not at the cost of losing the ability of building the tagging protocol and switch driver as modules, because as things stand, there is a circular dependency between the two. Tagging protocol drivers cannot depend on switch drivers, that is a hard fact. The reasoning behind the blamed patch was that accessing dp->priv should first make sure that the structure behind that pointer is what we really think it is. Currently the "sja1105" and "sja1110" tagging protocols only operate with the sja1105 switch driver, just like any other tagging protocol and switch combination. The only way to mix and match them is by modifying the code, and this applies to dsa_loop as well (by default that uses DSA_TAG_PROTO_NONE). So while in principle there is an issue, in practice there isn't one. Until we extend dsa_loop to allow user space configuration, treat the problem as a non-issue and just say that DSA ports found by tag_sja1105 are always sja1105 ports, which is in fact true. But keep the dsa_port_is_sja1105 function so that it's easy to patch it during testing, and rely on dead code elimination. Fixes: 994d2cbb08ca ("net: dsa: tag_sja1105: be dsa_loop-safe") Link: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 28da0555c3b542d605e4ca26eea6a740cf2c9174 Author: Vladimir Oltean Date: Wed Sep 22 17:37:25 2021 +0300 net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver The problem is that DSA tagging protocols really must not depend on the switch driver, because this creates a circular dependency at insmod time, and the switch driver will effectively not load when the tagging protocol driver is missing. The code was structured in the way it was for a reason, though. The DSA driver-facing API for PTP timestamping relies on the assumption that two-step TX timestamps are provided by the hardware in an out-of-band manner, typically by raising an interrupt and making that timestamp available inside some sort of FIFO which is to be accessed over SPI/MDIO/etc. So the API puts .port_txtstamp into dsa_switch_ops, because it is expected that the switch driver needs to save some state (like put the skb into a queue until its TX timestamp arrives). On SJA1110, TX timestamps are provided by the switch as Ethernet packets, so this makes them be received and processed by the tagging protocol driver. This in itself is great, because the timestamps are full 64-bit and do not require reconstruction, and since Ethernet is the fastest I/O method available to/from the switch, PTP timestamps arrive very quickly, no matter how bottlenecked the SPI connection is, because SPI interaction is not needed at all. DSA's code structure and strict isolation between the tagging protocol driver and the switch driver break the natural code organization. When the tagging protocol driver receives a packet which is classified as a metadata packet containing timestamps, it passes those timestamps one by one to the switch driver, which then proceeds to compare them based on the recorded timestamp ID that was generated in .port_txtstamp. The communication between the tagging protocol and the switch driver is done through a method exported by the switch driver, sja1110_process_meta_tstamp. To satisfy build requirements, we force a dependency to build the tagging protocol driver as a module when the switch driver is a module. However, as explained in the first paragraph, that causes the circular dependency. To solve this, move the skb queue from struct sja1105_private :: struct sja1105_ptp_data to struct sja1105_private :: struct sja1105_tagger_data. The latter is a data structure for which hacks have already been put into place to be able to create persistent storage per switch that is accessible from the tagging protocol driver (see sja1105_setup_ports). With the skb queue directly accessible from the tagging protocol driver, we can now move sja1110_process_meta_tstamp into the tagging driver itself, and avoid exporting a symbol. Fixes: 566b18c8b752 ("net: dsa: sja1105: implement TX timestamping for SJA1110") Link: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 43a4b4dbd48c9006ef64df3a12acf33bdfe11c61 Author: Alvin Šipraga Date: Tue Oct 12 13:27:31 2021 +0200 net: dsa: fix spurious error message when unoffloaded port leaves bridge Flip the sign of a return value check, thereby suppressing the following spurious error: port 2 failed to notify DSA_NOTIFIER_BRIDGE_LEAVE: -EOPNOTSUPP ... which is emitted when removing an unoffloaded DSA switch port from a bridge. Fixes: d371b7c92d19 ("net: dsa: Unset vlan_filtering when ports leave the bridge") Signed-off-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211012112730.3429157-1-alvin@pqrs.dk Signed-off-by: Jakub Kicinski commit 60d950f443a52d950126ad664fbd4a1eb8353dc9 Author: Baowen Zheng Date: Tue Oct 12 14:48:50 2021 +0200 nfp: flow_offload: move flow_indr_dev_register from app init to app start In commit 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation"), it adds a process to trigger the callback to setup the bo callback when the driver regists a callback. In our current implement, we are not ready to run the callback when nfp call the function flow_indr_dev_register, then there will be error message as: kernel: Oops: 0000 [#1] SMP PTI kernel: CPU: 0 PID: 14119 Comm: kworker/0:0 Tainted: G kernel: Workqueue: events work_for_cpu_fn kernel: RIP: 0010:nfp_flower_indr_setup_tc_cb+0x258/0x410 kernel: RSP: 0018:ffffbc1e02c57bf8 EFLAGS: 00010286 kernel: RAX: 0000000000000000 RBX: ffff9c761fabc000 RCX: 0000000000000001 kernel: RDX: 0000000000000001 RSI: fffffffffffffff0 RDI: ffffffffc0be9ef1 kernel: RBP: ffffbc1e02c57c58 R08: ffffffffc08f33aa R09: ffff9c6db7478800 kernel: R10: 0000009c003f6e00 R11: ffffbc1e02800000 R12: ffffbc1e000d9000 kernel: R13: ffffbc1e000db428 R14: ffff9c6db7478800 R15: ffff9c761e884e80 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kernel: CR2: fffffffffffffff0 CR3: 00000009e260a004 CR4: 00000000007706f0 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kernel: PKRU: 55555554 kernel: Call Trace: kernel: ? flow_indr_dev_register+0xab/0x210 kernel: ? __cond_resched+0x15/0x30 kernel: ? kmem_cache_alloc_trace+0x44/0x4b0 kernel: ? nfp_flower_setup_tc+0x1d0/0x1d0 [nfp] kernel: flow_indr_dev_register+0x158/0x210 kernel: ? tcf_block_unbind+0xe0/0xe0 kernel: nfp_flower_init+0x40b/0x650 [nfp] kernel: nfp_net_pci_probe+0x25f/0x960 [nfp] kernel: ? nfp_rtsym_read_le+0x76/0x130 [nfp] kernel: nfp_pci_probe+0x6a9/0x820 [nfp] kernel: local_pci_probe+0x45/0x80 So we need to call flow_indr_dev_register in app start process instead of init stage. Fixes: 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation") Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: Louis Peens Link: https://lore.kernel.org/r/20211012124850.13025-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski commit 0dee6f70fd40e3375d45d3f93abdf6a57fc0e549 Author: Laurent Pinchart Date: Sun Aug 22 02:44:27 2021 +0300 drm: rcar-du: Don't create encoder for unconnected LVDS outputs On R-Car D3 and E3, the LVDS encoders provide the pixel clock to the DU, even when LVDS outputs are not used. For this reason, the rcar-lvds driver probes successfully on those platforms even if no further bridge or panel is connected to the LVDS output, in order to provide the rcar_lvds_clk_enable() and rcar_lvds_clk_disable() functions to the DU driver. If an LVDS output isn't connected, trying to create a DRM connector for the output will fail. Fix this by skipping connector creation in that case, and also skip creation of the DRM encoder as there's no point in an encoder without a connector. Fixes: e9e056949c92 ("drm: rcar-du: lvds: Convert to DRM panel bridge helper") Reported-by: Geert Uytterhoeven Signed-off-by: Laurent Pinchart Tested-by: Geert Uytterhoeven (cherry picked from commit 187502afe87a0fc96832056558978fa423920ee0) Signed-off-by: Dave Airlie commit 84c8a87402cf073ba7948dd62d4815a3f4a224c8 Author: Maxim Mikityanskiy Date: Mon Oct 11 18:39:35 2021 +0300 net/mlx5e: Fix division by 0 in mlx5e_select_queue for representors Commit 846d6da1fcdb ("net/mlx5e: Fix division by 0 in mlx5e_select_queue") makes mlx5e_build_nic_params assign a non-zero initial value to priv->num_tc_x_num_ch, so that mlx5e_select_queue doesn't fail with division by 0 if called before the first activation of channels. However, the initialization flow of representors doesn't call mlx5e_build_nic_params, so this bug can still happen with representors. This commit fixes the bug by adding the missing assignment to mlx5e_build_rep_params. Fixes: 846d6da1fcdb ("net/mlx5e: Fix division by 0 in mlx5e_select_queue") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 0bc73ad46a76ed6ece4dcacb28858e7b38561e1c Author: Aya Levin Date: Sun Sep 26 17:55:41 2021 +0300 net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp Due to current HW arch limitations, RX-FCS (scattering FCS frame field to software) and RX-port-timestamp (improved timestamp accuracy on the receive side) can't work together. RX-port-timestamp is not controlled by the user and it is enabled by default when supported by the HW/FW. This patch sets RX-port-timestamp opposite to RX-FCS configuration. Fixes: 102722fc6832 ("net/mlx5e: Add support for RXFCS feature flag") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit b2107cdc43d8601f2cadfba990ae844cc1f44e68 Author: Saeed Mahameed Date: Mon Oct 4 21:20:25 2021 -0700 net/mlx5e: Switchdev representors are not vlan challenged Before this patch, mlx5 representors advertised the NETIF_F_VLAN_CHALLENGED bit, this could lead to missing features when using reps with vxlan/bridge and maybe other virtual interfaces, when such interfaces inherit this bit and block vlan usage in their topology. Example: $ip link add dev bridge type bridge # add representor interface to the bridge $ip link set dev pf0hpf master $ip link add link bridge name vlan10 type vlan id 10 protocol 802.1q Error: 8021q: VLANs not supported on device. Reps are perfectly capable of handling vlan traffic, although they don't implement vlan_{add,kill}_vid ndos, hence, remove NETIF_F_VLAN_CHALLENGED advertisement. Fixes: cb67b832921c ("net/mlx5e: Introduce SRIOV VF representors") Reported-by: Roopa Prabhu Signed-off-by: Saeed Mahameed Reviewed-by: Roi Dayan commit 94b960b9deffc02fc0747afc01f72cc62ab099e3 Author: Valentine Fatiev Date: Sun Aug 15 17:43:19 2021 +0300 net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path Prior to this patch in case mlx5_core_destroy_cq() failed it returns without completing all destroy operations and that leads to memory leak. Instead, complete the destroy flow before return error. Also move mlx5_debug_cq_remove() to the beginning of mlx5_core_destroy_cq() to be symmetrical with mlx5_core_create_cq(). kmemleak complains on: unreferenced object 0xc000000038625100 (size 64): comm "ethtool", pid 28301, jiffies 4298062946 (age 785.380s) hex dump (first 32 bytes): 60 01 48 94 00 00 00 c0 b8 05 34 c3 00 00 00 c0 `.H.......4..... 02 00 00 00 00 00 00 00 00 db 7d c1 00 00 00 c0 ..........}..... backtrace: [<000000009e8643cb>] add_res_tree+0xd0/0x270 [mlx5_core] [<00000000e7cb8e6c>] mlx5_debug_cq_add+0x5c/0xc0 [mlx5_core] [<000000002a12918f>] mlx5_core_create_cq+0x1d0/0x2d0 [mlx5_core] [<00000000cef0a696>] mlx5e_create_cq+0x210/0x3f0 [mlx5_core] [<000000009c642c26>] mlx5e_open_cq+0xb4/0x130 [mlx5_core] [<0000000058dfa578>] mlx5e_ptp_open+0x7f4/0xe10 [mlx5_core] [<0000000081839561>] mlx5e_open_channels+0x9cc/0x13e0 [mlx5_core] [<0000000009cf05d4>] mlx5e_switch_priv_channels+0xa4/0x230 [mlx5_core] [<0000000042bbedd8>] mlx5e_safe_switch_params+0x14c/0x300 [mlx5_core] [<0000000004bc9db8>] set_pflag_tx_port_ts+0x9c/0x160 [mlx5_core] [<00000000a0553443>] mlx5e_set_priv_flags+0xd0/0x1b0 [mlx5_core] [<00000000a8f3d84b>] ethnl_set_privflags+0x234/0x2d0 [<00000000fd27f27c>] genl_family_rcv_msg_doit+0x108/0x1d0 [<00000000f495e2bb>] genl_family_rcv_msg+0xe4/0x1f0 [<00000000646c5c2c>] genl_rcv_msg+0x78/0x120 [<00000000d53e384e>] netlink_rcv_skb+0x74/0x1a0 Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Valentine Fatiev Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit ca20dfda05ae0531c8f5117b6ac989816f6cf658 Author: Tariq Toukan Date: Mon Oct 4 15:04:25 2021 +0300 net/mlx5e: Allow only complete TXQs partition in MQPRIO channel mode Do not allow configurations of MQPRIO channel mode that do not fully define and utilize the channels txqs. Fixes: ec60c4581bd9 ("net/mlx5e: Support MQPRIO channel mode") Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 2266bb1e122a4f7cdf3427defcfb48e5c6a8f205 Author: Shay Drory Date: Mon Sep 13 15:48:11 2021 +0300 net/mlx5: Fix cleanup of bridge delayed work Currently, bridge cleanup is calling to cancel_delayed_work(). When this function is finished, there is a chance that the delayed work is still running. Also, the delayed work is queueing itself. As a result, we might execute the delayed work after the bridge cleanup have finished and hit a null-ptr oops[1]. Fix it by using cancel_delayed_work_sync(), which is waiting until the work is done and will cancel the queue work. [1] [ 8202.143043 ] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 8202.144438 ] #PF: supervisor write access in kernel mode [ 8202.145476 ] #PF: error_code(0x0002) - not-present page [ 8202.146520 ] PGD 0 P4D 0 [ 8202.147126 ] Oops: 0002 [#1] SMP NOPTI [ 8202.147899 ] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.14.0-rc6_for_upstream_min_debug_2021_08_25_16_06 #1 [ 8202.149741 ] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 8202.151908 ] RIP: 0010:_raw_spin_lock+0xc/0x20 [ 8202.156234 ] RSP: 0018:ffff88846f885ea0 EFLAGS: 00010046 [ 8202.157289 ] RAX: 0000000000000000 RBX: ffff88846f880000 RCX: 0000000000000000 [ 8202.158731 ] RDX: 0000000000000001 RSI: ffff8881004000c8 RDI: 0000000000000000 [ 8202.160177 ] RBP: ffff8881fe684978 R08: ffff888100140000 R09: ffffffff824455b8 [ 8202.161569 ] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001 [ 8202.163004 ] R13: 0000000000000012 R14: 0000000000000200 R15: ffff88812992d000 [ 8202.164018 ] FS: 0000000000000000(0000) GS:ffff88846f880000(0000) knlGS:0000000000000000 [ 8202.164960 ] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8202.165634 ] CR2: 0000000000000000 CR3: 0000000108cac004 CR4: 0000000000370ea0 [ 8202.166450 ] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8202.167807 ] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 8202.168852 ] Call Trace: [ 8202.169421 ] [ 8202.169792 ] __queue_work+0xf2/0x3d0 [ 8202.170481 ] ? queue_work_node+0x40/0x40 [ 8202.171270 ] call_timer_fn+0x2b/0x100 [ 8202.171932 ] __run_timers.part.0+0x152/0x220 [ 8202.172717 ] ? __hrtimer_run_queues+0x171/0x290 [ 8202.173526 ] ? kvm_clock_get_cycles+0xd/0x10 [ 8202.174232 ] ? ktime_get+0x35/0x90 [ 8202.174943 ] run_timer_softirq+0x26/0x50 [ 8202.175745 ] __do_softirq+0xc7/0x271 [ 8202.176373 ] irq_exit_rcu+0x93/0xb0 [ 8202.176983 ] sysvec_apic_timer_interrupt+0x72/0x90 [ 8202.177755 ] [ 8202.178245 ] asm_sysvec_apic_timer_interrupt+0x12/0x20 Fixes: c636a0f0f3f0 ("net/mlx5: Bridge, dynamic entry ageing") Signed-off-by: Shay Drory Reviewed-by: Vlad Buslov Reviewed-by: Leon Romanovsky Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 48827e1d6af58f219e89c7ec08dccbca28c7694e Author: Jonas Hahnfeld Date: Tue Oct 12 22:09:07 2021 +0200 ALSA: usb-audio: Add quirk for VF0770 The device advertises 8 formats, but only a rate of 48kHz is honored by the hardware and 24 bits give chopped audio, so only report the one working combination. This fixes out-of-the-box audio experience with PipeWire which otherwise attempts to choose S24_3LE (while PulseAudio defaulted to S16_LE). Signed-off-by: Jonas Hahnfeld Cc: Link: https://lore.kernel.org/r/20211012200906.3492-1-hahnjo@hahnjo.de Signed-off-by: Takashi Iwai commit f4d0cc426f77df6890aa868f96c2de89686aae8a Merge: ed47291911d37 596143e3aec35 Author: Linus Torvalds Date: Tue Oct 12 11:16:38 2021 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Fix CMA gigantic page order for 16K/64K page sizes - Fix section mismatch error in drivers/acpi/arm64/gtdt.c * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: acpi/arm64: fix next_platform_timer() section mismatch error arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE commit ed47291911d375f7d0bf63b9afb7516988305d94 Merge: fa5878760579a 7df227847ab56 Author: Linus Torvalds Date: Tue Oct 12 11:11:39 2021 -0700 Merge tag 'platform-drivers-x86-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "A second (small) set of pdx86 bug-fixes and new hardware ids for 5.15" * tag 'platform-drivers-x86-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: int1092: Fix non sequential device mode handling platform/x86: intel_skl_int3472: Correct null check platform/x86: gigabyte-wmi: add support for B550 AORUS ELITE AX V2 platform/x86: amd-pmc: Add alternative acpi id for PMC controller platform/x86: intel_scu_ipc: Update timeout value in comment platform/x86: intel_scu_ipc: Increase virtual timeout to 10s platform/x86: intel_scu_ipc: Fix busy loop expiry time platform/x86: dell: Make DELL_WMI_PRIVACY depend on DELL_WMI platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes platform/mellanox: mlxreg-io: Fix argument base in kstrtou32() call commit d208b89401e073de986dc891037c5a668f5d5d95 Author: Jiazi Li Date: Wed Sep 29 19:59:28 2021 +0800 dm: fix mempool NULL pointer race when completing IO dm_io_dec_pending() calls end_io_acct() first and will then dec md in-flight pending count. But if a task is swapping DM table at same time this can result in a crash due to mempool->elements being NULL: task1 task2 do_resume ->do_suspend ->dm_wait_for_completion bio_endio ->clone_endio ->dm_io_dec_pending ->end_io_acct ->wakeup task1 ->dm_swap_table ->__bind ->__bind_mempools ->bioset_exit ->mempool_exit ->free_io [ 67.330330] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 ...... [ 67.330494] pstate: 80400085 (Nzcv daIf +PAN -UAO) [ 67.330510] pc : mempool_free+0x70/0xa0 [ 67.330515] lr : mempool_free+0x4c/0xa0 [ 67.330520] sp : ffffff8008013b20 [ 67.330524] x29: ffffff8008013b20 x28: 0000000000000004 [ 67.330530] x27: ffffffa8c2ff40a0 x26: 00000000ffff1cc8 [ 67.330535] x25: 0000000000000000 x24: ffffffdada34c800 [ 67.330541] x23: 0000000000000000 x22: ffffffdada34c800 [ 67.330547] x21: 00000000ffff1cc8 x20: ffffffd9a1304d80 [ 67.330552] x19: ffffffdada34c970 x18: 000000b312625d9c [ 67.330558] x17: 00000000002dcfbf x16: 00000000000006dd [ 67.330563] x15: 000000000093b41e x14: 0000000000000010 [ 67.330569] x13: 0000000000007f7a x12: 0000000034155555 [ 67.330574] x11: 0000000000000001 x10: 0000000000000001 [ 67.330579] x9 : 0000000000000000 x8 : 0000000000000000 [ 67.330585] x7 : 0000000000000000 x6 : ffffff80148b5c1a [ 67.330590] x5 : ffffff8008013ae0 x4 : 0000000000000001 [ 67.330596] x3 : ffffff80080139c8 x2 : ffffff801083bab8 [ 67.330601] x1 : 0000000000000000 x0 : ffffffdada34c970 [ 67.330609] Call trace: [ 67.330616] mempool_free+0x70/0xa0 [ 67.330627] bio_put+0xf8/0x110 [ 67.330638] dec_pending+0x13c/0x230 [ 67.330644] clone_endio+0x90/0x180 [ 67.330649] bio_endio+0x198/0x1b8 [ 67.330655] dec_pending+0x190/0x230 [ 67.330660] clone_endio+0x90/0x180 [ 67.330665] bio_endio+0x198/0x1b8 [ 67.330673] blk_update_request+0x214/0x428 [ 67.330683] scsi_end_request+0x2c/0x300 [ 67.330688] scsi_io_completion+0xa0/0x710 [ 67.330695] scsi_finish_command+0xd8/0x110 [ 67.330700] scsi_softirq_done+0x114/0x148 [ 67.330708] blk_done_softirq+0x74/0xd0 [ 67.330716] __do_softirq+0x18c/0x374 [ 67.330724] irq_exit+0xb4/0xb8 [ 67.330732] __handle_domain_irq+0x84/0xc0 [ 67.330737] gic_handle_irq+0x148/0x1b0 [ 67.330744] el1_irq+0xe8/0x190 [ 67.330753] lpm_cpuidle_enter+0x4f8/0x538 [ 67.330759] cpuidle_enter_state+0x1fc/0x398 [ 67.330764] cpuidle_enter+0x18/0x20 [ 67.330772] do_idle+0x1b4/0x290 [ 67.330778] cpu_startup_entry+0x20/0x28 [ 67.330786] secondary_start_kernel+0x160/0x170 Fix this by: 1) Establishing pointers to 'struct dm_io' members in dm_io_dec_pending() so that they may be passed into end_io_acct() _after_ free_io() is called. 2) Moving end_io_acct() after free_io(). Cc: stable@vger.kernel.org Signed-off-by: Jiazi Li Signed-off-by: Mike Snitzer commit b4459b11e84092658fa195a2587aff3b9637f0e7 Author: Ming Lei Date: Thu Sep 23 17:11:31 2021 +0800 dm rq: don't queue request to blk-mq during DM suspend DM uses blk-mq's quiesce/unquiesce to stop/start device mapper queue. But blk-mq's unquiesce may come from outside events, such as elevator switch, updating nr_requests or others, and request may come during suspend, so simply ask for blk-mq to requeue it. Fixes one kernel panic issue when running updating nr_requests and dm-mpath suspend/resume stress test. Cc: stable@vger.kernel.org Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit ec132ef2d1d94d43d9dce1400521526bbed89a8b Author: Colin Ian King Date: Wed Sep 15 12:14:40 2021 +0100 dm clone: make array 'descs' static Don't populate the read-only array descs on the stack but instead it static and add extra const. Also makes the object code smaller by 66 bytes: Before: text data bss dec hex filename 42382 11140 512 54034 d312 ./drivers/md/dm-clone-target.o After: text data bss dec hex filename 42220 11236 512 53968 d2d0 ./drivers/md/dm-clone-target.o (gcc version 11.2.0) Signed-off-by: Colin Ian King Signed-off-by: Mike Snitzer commit 2c0468e054c0adb660ac055fc396622ec7235df9 Author: Akilesh Kailash Date: Mon Sep 13 09:26:42 2021 +0000 dm verity: skip redundant verity_handle_err() on I/O errors Without FEC, dm-verity won't call verity_handle_err() when I/O fails, but with FEC enabled, it currently does even if an I/O error has occurred. If there is an I/O error and FEC correction fails, return the error instead of calling verity_handle_err() again. Suggested-by: Sami Tolvanen Signed-off-by: Akilesh Kailash Reviewed-by: Sami Tolvanen Signed-off-by: Mike Snitzer commit 187a580c9e7895978dcd1e627b9c9e7e3d13ca96 Author: Mike Christie Date: Sun Oct 10 11:19:04 2021 -0500 scsi: iscsi: Fix set_param() handling In commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread") we meant to add a check where before we call ->set_param() we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param() call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call. This patch removes that first call. Fixes: 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread") Link: https://lore.kernel.org/r/20211010161904.60471-1-michael.christie@oracle.com Reviewed-by: Lee Duncan Reviewed-by: Li Feng Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 596143e3aec35c93508d6b7a05ddc999ee209b61 Author: Jackie Liu Date: Mon Aug 23 17:25:26 2021 +0800 acpi/arm64: fix next_platform_timer() section mismatch error Fix modpost Section mismatch error in next_platform_timer(). [...] WARNING: modpost: vmlinux.o(.text.unlikely+0x26e60): Section mismatch in reference from the function next_platform_timer() to the variable .init.data:acpi_gtdt_desc The function next_platform_timer() references the variable __initdata acpi_gtdt_desc. This is often because next_platform_timer lacks a __initdata annotation or the annotation of acpi_gtdt_desc is wrong. WARNING: modpost: vmlinux.o(.text.unlikely+0x26e64): Section mismatch in reference from the function next_platform_timer() to the variable .init.data:acpi_gtdt_desc The function next_platform_timer() references the variable __initdata acpi_gtdt_desc. This is often because next_platform_timer lacks a __initdata annotation or the annotation of acpi_gtdt_desc is wrong. ERROR: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. make[1]: *** [scripts/Makefile.modpost:59: vmlinux.symvers] Error 1 make[1]: *** Deleting file 'vmlinux.symvers' make: *** [Makefile:1176: vmlinux] Error 2 [...] Fixes: a712c3ed9b8a ("acpi/arm64: Add memory-mapped timer support in GTDT driver") Signed-off-by: Jackie Liu Acked-by: Hanjun Guo Link: https://lore.kernel.org/r/20210823092526.2407526-1-liu.yun@linux.dev Signed-off-by: Catalin Marinas commit 7904022decc260a19dd65b56ac896387f5da6f8c Author: Dan Carpenter Date: Tue Oct 12 11:44:43 2021 +0300 block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs These variables are printed on the error path if match_int() fails so they have to be initialized. Fixes: 2958a995edc9 ("block/rnbd-clt: Support polling mode for IO latency optimization") Fixes: 1eb54f8f5dd8 ("block/rnbd: client: sysfs interface functions") Signed-off-by: Dan Carpenter Acked-by: Gioh Kim Link: https://lore.kernel.org/r/20211012084443.GA31472@kili Signed-off-by: Jens Axboe commit 50b6cb3516365cb69753b006be2b61c966b70588 Author: Dexuan Cui Date: Thu Oct 7 21:35:46 2021 -0700 scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma() After commit ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue"), a 416-CPU VM running on Hyper-V hangs during boot because the hv_storvsc driver sets scsi_driver.can_queue to an integer value that exceeds SHRT_MAX, and hence scsi_add_host_with_dma() sets shost->cmd_per_lun to a negative "short" value. Use min_t(int, ...) to work around the issue. Link: https://lore.kernel.org/r/20211008043546.6006-1-decui@microsoft.com Fixes: ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue") Cc: stable@vger.kernel.org Reviewed-by: Haiyang Zhang Reviewed-by: Ming Lei Reviewed-by: John Garry Signed-off-by: Dexuan Cui Signed-off-by: Martin K. Petersen commit bc22b6208f416ba702c17a93c9af6474f19e8212 Merge: 6880fa6c56601 3f32472854614 Author: Florian Fainelli Date: Fri Oct 8 15:28:46 2021 -0700 Merge tag 'tags/bcm2835-dt-fixes-2021-10-06' into devicetree/fixes A series of devicetree fixes for the Raspberry Pi 4: - Fix VEC reg address - Fix MDIO address/size cells - Fix regulator states - Fix PCIe address formatting Signed-off-by: Florian Fainelli commit 3f32472854614d6f53b09b4812372dba9fc5c7de Author: Nicolas Saenz Julienne Date: Tue Aug 31 14:58:43 2021 +0200 ARM: dts: bcm2711-rpi-4-b: Fix usb's unit address The unit address is supposed to represent ','. Which are both 0 for RPi4b's XHCI controller. On top of that although OpenFirmware states bus number goes in the high part of the last reg parameter, FDT doesn't seem to care for it[1], so remove it. [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210830103909.323356-1-nsaenzju@redhat.com/#24414633 Fixes: 258f92d2f840 ("ARM: dts: bcm2711: Add reset controller to xHCI node") Suggested-by: Rob Herring Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210831125843.1233488-2-nsaenzju@redhat.com Signed-off-by: Nicolas Saenz Julienne commit 13dbc954b3c9a9de0ad5b7279e8d3b708d31068b Author: Nicolas Saenz Julienne Date: Tue Aug 31 14:58:42 2021 +0200 ARM: dts: bcm2711-rpi-4-b: Fix pcie0's unit address formatting dtbs_check currently complains that: arch/arm/boot/dts/bcm2711-rpi-4-b.dts:220.10-231.4: Warning (pci_device_reg): /scb/pcie@7d500000/pci@1,0: PCI unit address format error, expected "0,0" Unsurprisingly pci@0,0 is the right address, as illustrated by its reg property: &pcie0 { pci@0,0 { /* * As defined in the IEEE Std 1275-1994 document, * reg is a five-cell address encoded as (phys.hi * phys.mid phys.lo size.hi size.lo). phys.hi * should contain the device's BDF as 0b00000000 * bbbbbbbb dddddfff 00000000. The other cells * should be zero. */ reg = <0 0 0 0 0>; }; }; The device is clearly 0. So fix it. Also add a missing 'device_type = "pci"'. Fixes: 258f92d2f840 ("ARM: dts: bcm2711: Add reset controller to xHCI node") Suggested-by: Rob Herring Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210831125843.1233488-1-nsaenzju@redhat.com Signed-off-by: Nicolas Saenz Julienne commit b37a15188eae9d4c49c5bb035e0c8d4058e4d9b3 Author: Kai Vehmanen Date: Tue Oct 12 17:29:35 2021 +0300 ALSA: hda: avoid write to STATESTS if controller is in reset The snd_hdac_bus_reset_link() contains logic to clear STATESTS register before performing controller reset. This code dates back to an old bugfix in commit e8a7f136f5ed ("[ALSA] hda-intel - Improve HD-audio codec probing robustness"). Originally the code was added to azx_reset(). The code was moved around in commit a41d122449be ("ALSA: hda - Embed bus into controller object") and ended up to snd_hdac_bus_reset_link() and called primarily via snd_hdac_bus_init_chip(). The logic to clear STATESTS is correct when snd_hdac_bus_init_chip() is called when controller is not in reset. In this case, STATESTS can be cleared. This can be useful e.g. when forcing a controller reset to retry codec probe. A normal non-power-on reset will not clear the bits. However, this old logic is problematic when controller is already in reset. The HDA specification states that controller must be taken out of reset before writing to registers other than GCTL.CRST (1.0a spec, 3.3.7). The write to STATESTS in snd_hdac_bus_reset_link() will be lost if the controller is already in reset per the HDA specification mentioned. This has been harmless on older hardware. On newer generation of Intel PCIe based HDA controllers, if configured to report issues, this write will emit an unsupported request error. If ACPI Platform Error Interface (APEI) is enabled in kernel, this will end up to kernel log. Fix the code in snd_hdac_bus_reset_link() to only clear the STATESTS if the function is called when controller is not in reset. Otherwise clearing the bits is not possible and should be skipped. Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211012142935.3731820-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit 8607954cf255329d1c6dfc073ff1508b7585573c Author: Konstantin Komarov Date: Mon Oct 11 19:43:29 2021 +0300 fs/ntfs3: Check for NULL pointers in ni_try_remove_attr_list Check for potential NULL pointers. Print error message if found. Thread, that leads to this commit: https://lore.kernel.org/ntfs3/227c13e3-5a22-0cba-41eb-fcaf41940711@paragon-software.com/ Reported-by: Mohammad Rasim Signed-off-by: Konstantin Komarov commit 1ea1dbf1f54c3345072c963b3acf8830e2468c1b Author: Sachi King Date: Sat Oct 2 14:18:40 2021 +1000 ACPI: PM: Include alternate AMDI0005 id in special behaviour The Surface Laptop 4 AMD has used the AMD0005 to identify this controller instead of using the appropriate ACPI ID AMDI0005. The AMD0005 needs the same special casing as AMDI0005. Link: https://github.com/linux-surface/acpidumps/tree/master/surface_laptop_4_amd Link: https://gist.github.com/nakato/2a1a7df1a45fe680d7a08c583e1bf863 Signed-off-by: Sachi King Reviewed-by: Mario Limonciello Cc: 5.14+ # 5.14+ Signed-off-by: Rafael J. Wysocki commit a3fd1a986e499a06ac5ef95c3a39aa4611e7444c Author: Hui Wang Date: Tue Oct 12 19:47:48 2021 +0800 ALSA: hda/realtek: Fix the mic type detection issue for ASUS G551JW We need to define the codec pin 0x1b to be the mic, but somehow the mic doesn't support hot plugging detection, and Windows also has this issue, so we set it to phantom headset-mic. Also the determine_headset_type() often returns the omtp type by a mistake when we plug a ctia headset, this makes the mic can't record sound at all. Because most of the headset are ctia type nowadays and some machines have the fixed ctia type audio jack, it is possible this machine has the fixed ctia jack too. Here we set this mic jack to fixed ctia type, this could avoid the mic type detection mistake and make the ctia headset work stable. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214537 Reported-and-tested-by: msd Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20211012114748.5238-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai commit 7f565d0ead264329749c0da488de9c8dfa2f18ce Author: Sumit Garg Date: Tue Oct 12 13:01:16 2021 +0530 tee: optee: Fix missing devices unregister during optee_remove When OP-TEE driver is built as a module, OP-TEE client devices registered on TEE bus during probe should be unregistered during optee_remove. So implement optee_unregister_devices() accordingly. Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support") Reported-by: Sudeep Holla Signed-off-by: Sumit Garg Signed-off-by: Jens Wiklander commit 4d4a223a86afe658cd878800f09458e8bb54415d Author: Jacob Keller Date: Mon Oct 11 13:48:06 2021 -0700 ice: fix locking for Tx timestamp tracking flush Commit 4dd0d5c33c3e ("ice: add lock around Tx timestamp tracker flush") added a lock around the Tx timestamp tracker flow which is used to cleanup any left over SKBs and prepare for device removal. This lock is problematic because it is being held around a call to ice_clear_phy_tstamp. The clear function takes a mutex to send a PHY write command to firmware. This could lead to a deadlock if the mutex actually sleeps, and causes the following warning on a kernel with preemption debugging enabled: [ 715.419426] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:573 [ 715.427900] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3100, name: rmmod [ 715.435652] INFO: lockdep is turned off. [ 715.439591] Preemption disabled at: [ 715.439594] [<0000000000000000>] 0x0 [ 715.446678] CPU: 52 PID: 3100 Comm: rmmod Tainted: G W OE 5.15.0-rc4+ #42 bdd7ec3018e725f159ca0d372ce8c2c0e784891c [ 715.458058] Hardware name: Intel Corporation S2600STQ/S2600STQ, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020 [ 715.468483] Call Trace: [ 715.470940] dump_stack_lvl+0x6a/0x9a [ 715.474613] ___might_sleep.cold+0x224/0x26a [ 715.478895] __mutex_lock+0xb3/0x1440 [ 715.482569] ? stack_depot_save+0x378/0x500 [ 715.486763] ? ice_sq_send_cmd+0x78/0x14c0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.494979] ? kfree+0xc1/0x520 [ 715.498128] ? mutex_lock_io_nested+0x12a0/0x12a0 [ 715.502837] ? kasan_set_free_info+0x20/0x30 [ 715.507110] ? __kasan_slab_free+0x10b/0x140 [ 715.511385] ? slab_free_freelist_hook+0xc7/0x220 [ 715.516092] ? kfree+0xc1/0x520 [ 715.519235] ? ice_deinit_lag+0x16c/0x220 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.527359] ? ice_remove+0x1cf/0x6a0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.535133] ? pci_device_remove+0xab/0x1d0 [ 715.539318] ? __device_release_driver+0x35b/0x690 [ 715.544110] ? driver_detach+0x214/0x2f0 [ 715.548035] ? bus_remove_driver+0x11d/0x2f0 [ 715.552309] ? pci_unregister_driver+0x26/0x250 [ 715.556840] ? ice_module_exit+0xc/0x2f [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.564799] ? __do_sys_delete_module.constprop.0+0x2d8/0x4e0 [ 715.570554] ? do_syscall_64+0x3b/0x90 [ 715.574303] ? entry_SYSCALL_64_after_hwframe+0x44/0xae [ 715.579529] ? start_flush_work+0x542/0x8f0 [ 715.583719] ? ice_sq_send_cmd+0x78/0x14c0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.591923] ice_sq_send_cmd+0x78/0x14c0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.599960] ? wait_for_completion_io+0x250/0x250 [ 715.604662] ? lock_acquire+0x196/0x200 [ 715.608504] ? do_raw_spin_trylock+0xa5/0x160 [ 715.612864] ice_sbq_rw_reg+0x1e6/0x2f0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.620813] ? ice_reset+0x130/0x130 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.628497] ? __debug_check_no_obj_freed+0x1e8/0x3c0 [ 715.633550] ? trace_hardirqs_on+0x1c/0x130 [ 715.637748] ice_write_phy_reg_e810+0x70/0xf0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.646220] ? do_raw_spin_trylock+0xa5/0x160 [ 715.650581] ? ice_ptp_release+0x910/0x910 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.658797] ? ice_ptp_release+0x255/0x910 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.667013] ice_clear_phy_tstamp+0x2c/0x110 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.675403] ice_ptp_release+0x408/0x910 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.683440] ice_remove+0x560/0x6a0 [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.691037] ? _raw_spin_unlock_irqrestore+0x46/0x73 [ 715.696005] pci_device_remove+0xab/0x1d0 [ 715.700018] __device_release_driver+0x35b/0x690 [ 715.704637] driver_detach+0x214/0x2f0 [ 715.708389] bus_remove_driver+0x11d/0x2f0 [ 715.712489] pci_unregister_driver+0x26/0x250 [ 715.716857] ice_module_exit+0xc/0x2f [ice 9a7e1ec00971c89ecd3fe0d4dc7da2b3786a421d] [ 715.724637] __do_sys_delete_module.constprop.0+0x2d8/0x4e0 [ 715.730210] ? free_module+0x6d0/0x6d0 [ 715.733963] ? task_work_run+0xe1/0x170 [ 715.737803] ? exit_to_user_mode_loop+0x17f/0x1d0 [ 715.742509] ? rcu_read_lock_sched_held+0x12/0x80 [ 715.747215] ? trace_hardirqs_on+0x1c/0x130 [ 715.751401] do_syscall_64+0x3b/0x90 [ 715.754981] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 715.760033] RIP: 0033:0x7f4dfe59000b [ 715.763612] Code: 73 01 c3 48 8b 0d 6d 1e 0c 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 3d 1e 0c 00 f7 d8 64 89 01 48 [ 715.782357] RSP: 002b:00007ffe8c891708 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 [ 715.789923] RAX: ffffffffffffffda RBX: 00005558a20468b0 RCX: 00007f4dfe59000b [ 715.797054] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005558a2046918 [ 715.804189] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 [ 715.811319] R10: 00007f4dfe603ac0 R11: 0000000000000206 R12: 00007ffe8c891940 [ 715.818455] R13: 00007ffe8c8920a3 R14: 00005558a20462a0 R15: 00005558a20468b0 Notice that this is the only case where we use the lock in this way. In the cleanup kthread and work kthread the lock is only taken around the bit accesses. This was done intentionally to avoid this kind of issue. The way the lock is used, we only protect ordering of bit sets vs bit clears. The Tx writers in the hot path don't need to be protected against the entire kthread loop. The Tx queues threads only need to ensure that they do not re-use an index that is currently in use. The cleanup loop does not need to block all new set bits, since it will re-queue itself if new timestamps are present. Fix the tracker flow so that it uses the same flow as the standard cleanup thread. In addition, ensure the in_use bitmap actually gets cleared properly. This fixes the warning and also avoids the potential deadlock that might have occurred otherwise. Fixes: 4dd0d5c33c3e ("ice: add lock around Tx timestamp tracker flush") Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 8e0ab8e26b72a80e991c66a8abc16e6c856abe3d Author: Roberto Sassu Date: Tue Oct 5 14:08:36 2021 +0200 s390: fix strrchr() implementation Fix two problems found in the strrchr() implementation for s390 architectures: evaluate empty strings (return the string address instead of NULL, if '\0' is passed as second argument); evaluate the first character of non-empty strings (the current implementation stops at the second). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Reported-by: Heiko Carstens (incorrect behavior with empty strings) Signed-off-by: Roberto Sassu Link: https://lore.kernel.org/r/20211005120836.60630-1-roberto.sassu@huawei.com Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4540938952d47eec558ae69e190e0fe3076ec8ad Author: Cornelia Huck Date: Wed Oct 6 18:01:20 2021 +0200 vfio-ccw: step down as maintainer I currently don't have time to act as vfio-ccw maintainer anymore, but I trust that I leave it in capable hands. Signed-off-by: Cornelia Huck Acked-by: Eric Farman Acked-by: Matthew Rosato Acked-by: Christian Borntraeger Link: https://lore.kernel.org/r/20211006160120.217636-3-cohuck@redhat.com Signed-off-by: Vasily Gorbik commit 1606520a24542d6566077f99f3678e18d05bdd28 Author: Cornelia Huck Date: Wed Oct 6 18:01:19 2021 +0200 KVM: s390: remove myself as reviewer I currently don't have time anymore to review KVM/s390 code. Signed-off-by: Cornelia Huck Acked-by: Janosch Frank Acked-by: Christian Borntraeger Link: https://lore.kernel.org/r/20211006160120.217636-2-cohuck@redhat.com Signed-off-by: Vasily Gorbik commit 7389074ced34091b12ca5ee65ceed9194224a7f6 Merge: ef1100ef20f29 7b1700e009cc1 Author: David S. Miller Date: Tue Oct 12 11:49:50 2021 +0100 Merge branch 'ioam-fixes' Justin Iurman says: ==================== Correct the IOAM behavior for undefined trace type bits (@Jakub @David: there will be a conflict for #2 when merging net->net-next, due to commit [1]. The conflict is only 5-10 lines for #2 (#1 should be fine) inside the file tools/testing/selftests/net/ioam6.sh, so quite short though possibly ugly. Sorry for that, I didn't expect to post this one... Had I known, I'd have made the opposite.) Modify both the input and output behaviors regarding the trace type when one of the undefined bits is set. The goal is to keep the interoperability when new fields (aka new bits inside the range 12-21) will be defined. The draft [2] says the following: --------------------------------------------------------------- "Bit 12-21 Undefined. These values are available for future assignment in the IOAM Trace-Type Registry (Section 8.2). Every future node data field corresponding to one of these bits MUST be 4-octets long. An IOAM encapsulating node MUST set the value of each undefined bit to 0. If an IOAM transit node receives a packet with one or more of these bits set to 1, it MUST either: 1. Add corresponding node data filled with the reserved value 0xFFFFFFFF, after the node data fields for the IOAM-Trace-Type bits defined above, such that the total node data added by this node in units of 4-octets is equal to NodeLen, or 2. Not add any node data fields to the packet, even for the IOAM-Trace-Type bits defined above." --------------------------------------------------------------- The output behavior has been modified to respect the fact that "an IOAM encap node MUST set the value of each undefined bit to 0" (i.e., undefined bits can't be set anymore). As for the input behavior, current implementation is based on the second choice (i.e., "not add any data fields to the packet [...]"). With this solution, any interoperability is lost (i.e., if a new bit is defined, then an "old" kernel implementation wouldn't fill IOAM data when such new bit is set inside the trace type). The input behavior is therefore relaxed and these undefined bits are now allowed to be set. It is only possible thanks to the sentence "every future node data field corresponding to one of these bits MUST be 4-octets long". Indeed, the default empty value (the one for 4-octet fields) is inserted whenever an undefined bit is set. [1] cfbe9b002109621bf9a282a4a24f9415ef14b57b [2] https://datatracker.ietf.org/doc/html/draft-ietf-ippm-ioam-data#section-5.4.1 ==================== Signed-off-by: David S. Miller commit 7b1700e009cc17702e8db3af1d983860c0eb7164 Author: Justin Iurman Date: Mon Oct 11 20:04:12 2021 +0200 selftests: net: modify IOAM tests for undef bits The output behavior for undefined bits is now directly tested inside the bash script. Trying to set an undefined bit should be refused. The input behavior for undefined bits has been removed due to the fact that we would need another sender allowed to set undefined bits. Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 2bbc977ca689e5e18e8cf98f68854f92bd053c97 Author: Justin Iurman Date: Mon Oct 11 20:04:11 2021 +0200 ipv6: ioam: move the check for undefined bits The check for undefined bits in the trace type is moved from the input side to the output side, while the input side is relaxed and now inserts default empty values when an undefined bit is set. Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 55e6d8037805b3400096d621091dfbf713f97e83 Author: Yang Yingliang Date: Tue Oct 12 10:37:35 2021 +0800 regmap: Fix possible double-free in regcache_rbtree_exit() In regcache_rbtree_insert_to_block(), when 'present' realloc failed, the 'blk' which is supposed to assign to 'rbnode->block' will be freed, so 'rbnode->block' points a freed memory, in the error handling path of regcache_rbtree_init(), 'rbnode->block' will be freed again in regcache_rbtree_exit(), KASAN will report double-free as follows: BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390 Call Trace: slab_free_freelist_hook+0x10d/0x240 kfree+0xce/0x390 regcache_rbtree_exit+0x15d/0x1a0 regcache_rbtree_init+0x224/0x2c0 regcache_init+0x88d/0x1310 __regmap_init+0x3151/0x4a80 __devm_regmap_init+0x7d/0x100 madera_spi_probe+0x10f/0x333 [madera_spi] spi_probe+0x183/0x210 really_probe+0x285/0xc30 To fix this, moving up the assignment of rbnode->block to immediately after the reallocation has succeeded so that the data structure stays valid even if the second reallocation fails. Reported-by: Hulk Robot Fixes: 3f4ff561bc88b ("regmap: rbtree: Make cache_present bitmap per node") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211012023735.1632786-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit aa18457c4af7a9dad1f2b150b11beae1d8ab57aa Author: Stefan Binding Date: Mon Oct 11 15:49:03 2021 +0100 ASoC: cs42l42: Ensure 0dB full scale volume is used for headsets Ensure the default 0dB playback path is always used. The code that set FULL_SCALE_VOL based on LOAD_DET_RCSTAT was spurious, and resulted in a -6dB attenuation being accidentally inserted into the playback path. Signed-off-by: Stefan Binding Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211011144903.28915-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit ef1100ef20f29aec4e62abeccdb5bdbebba1e378 Author: Arun Ramadoss Date: Mon Oct 11 21:18:08 2021 +0530 net: dsa: microchip: Added the condition for scheduling ksz_mib_read_work When the ksz module is installed and removed using rmmod, kernel crashes with null pointer dereferrence error. During rmmod, ksz_switch_remove function tries to cancel the mib_read_workqueue using cancel_delayed_work_sync routine and unregister switch from dsa. During dsa_unregister_switch it calls ksz_mac_link_down, which in turn reschedules the workqueue since mib_interval is non-zero. Due to which queue executed after mib_interval and it tries to access dp->slave. But the slave is unregistered in the ksz_switch_remove function. Hence kernel crashes. To avoid this crash, before canceling the workqueue, resetted the mib_interval to 0. v1 -> v2: -Removed the if condition in ksz_mib_read_work Fixes: 469b390e1ba3 ("net: dsa: microchip: use delayed_work instead of timer + work") Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit 9973a43012b6ad1720dbc4d5faf5302c28635b8c Author: Vegard Nossum Date: Mon Oct 11 17:22:49 2021 +0200 r8152: select CRC32 and CRYPTO/CRYPTO_HASH/CRYPTO_SHA256 Fix the following build/link errors by adding a dependency on CRYPTO, CRYPTO_HASH, CRYPTO_SHA256 and CRC32: ld: drivers/net/usb/r8152.o: in function `rtl8152_fw_verify_checksum': r8152.c:(.text+0x2b2a): undefined reference to `crypto_alloc_shash' ld: r8152.c:(.text+0x2bed): undefined reference to `crypto_shash_digest' ld: r8152.c:(.text+0x2c50): undefined reference to `crypto_destroy_tfm' ld: drivers/net/usb/r8152.o: in function `_rtl8152_set_rx_mode': r8152.c:(.text+0xdcb0): undefined reference to `crc32_le' Fixes: 9370f2d05a2a1 ("r8152: support request_firmware for RTL8153") Fixes: ac718b69301c7 ("net/usb: new driver for RTL8152") Signed-off-by: Vegard Nossum Signed-off-by: David S. Miller commit 4a3e0aeddf091f00974b02627c157843ce382a24 Author: Maarten Zanders Date: Mon Oct 11 16:27:20 2021 +0200 net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's mv88e6xxx_port_ppu_updates() interpretes data in the PORT_STS register incorrectly for internal ports (ie no PPU). In these cases, the PHY_DETECT bit indicates link status. This results in forcing the MAC state whenever the PHY link goes down which is not intended. As a side effect, LED's configured to show link status stay lit even though the physical link is down. Add a check in mac_link_down and mac_link_up to see if it concerns an external port and only then, look at PPU status. Fixes: 5d5b231da7ac (net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down) Reported-by: Maarten Zanders Reviewed-by: Maxime Chevallier Signed-off-by: Maarten Zanders Signed-off-by: David S. Miller commit 74a3bc42fe514098030a78c1ad5e6024463dd378 Author: Wan Jiabing Date: Mon Oct 11 10:27:41 2021 +0800 net: mscc: ocelot: Fix dumplicated argument in ocelot Fix the following coccicheck warning: drivers/net/ethernet/mscc/ocelot.c:474:duplicated argument to & or | drivers/net/ethernet/mscc/ocelot.c:476:duplicated argument to & or | drivers/net/ethernet/mscc/ocelot_net.c:1627:duplicated argument to & or | These DEV_CLOCK_CFG_MAC_TX_RST are duplicate here. Here should be DEV_CLOCK_CFG_MAC_RX_RST. Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink") Signed-off-by: Wan Jiabing Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0edf0824e0dc359ed76bf96af986e6570ca2c0b9 Author: Stephen Boyd Date: Fri Oct 8 14:59:45 2021 -0700 af_unix: Rename UNIX-DGRAM to UNIX to maintain backwards compatability Then name of this protocol changed in commit 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") because that commit added stream support to the af_unix protocol. Renaming the existing protocol makes a ChromeOS protocol test[1] fail now that the name has changed in /proc/net/protocols from "UNIX" to "UNIX-DGRAM". Let's put the name back to how it was while keeping the stream protocol as "UNIX-STREAM" so that the procfs interface doesn't change. This fixes the test and maintains backwards compatibility in proc. Cc: Jiang Wang Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jakub Sitnicki Cc: John Fastabend Cc: Dmitry Osipenko Link: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/tast-tests/src/chromiumos/tast/local/bundles/cros/network/supported_protocols.go;l=50;drc=e8b1c3f94cb40a054f4aa1ef1aff61e75dc38f18 [1] Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") Signed-off-by: Stephen Boyd Signed-off-by: David S. Miller commit 4217d07b9fb328751f877d3bd9550122014860a2 Author: Shawn Guo Date: Mon Oct 4 10:49:35 2021 +0800 mmc: sdhci: Map more voltage level to SDHCI_POWER_330 On Thundercomm TurboX CM2290, the eMMC OCR reports vdd = 23 (3.5 ~ 3.6 V), which is being treated as an invalid value by sdhci_set_power_noreg(). And thus eMMC is totally broken on the platform. [ 1.436599] ------------[ cut here ]------------ [ 1.436606] mmc0: Invalid vdd 0x17 [ 1.436640] WARNING: CPU: 2 PID: 69 at drivers/mmc/host/sdhci.c:2048 sdhci_set_power_noreg+0x168/0x2b4 [ 1.436655] Modules linked in: [ 1.436662] CPU: 2 PID: 69 Comm: kworker/u8:1 Tainted: G W 5.15.0-rc1+ #137 [ 1.436669] Hardware name: Thundercomm TurboX CM2290 (DT) [ 1.436674] Workqueue: events_unbound async_run_entry_fn [ 1.436685] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 1.436692] pc : sdhci_set_power_noreg+0x168/0x2b4 [ 1.436698] lr : sdhci_set_power_noreg+0x168/0x2b4 [ 1.436703] sp : ffff800010803a60 [ 1.436705] x29: ffff800010803a60 x28: ffff6a9102465f00 x27: ffff6a9101720a70 [ 1.436715] x26: ffff6a91014de1c0 x25: ffff6a91014de010 x24: ffff6a91016af280 [ 1.436724] x23: ffffaf7b1b276640 x22: 0000000000000000 x21: ffff6a9101720000 [ 1.436733] x20: ffff6a9101720370 x19: ffff6a9101720580 x18: 0000000000000020 [ 1.436743] x17: 0000000000000000 x16: 0000000000000004 x15: ffffffffffffffff [ 1.436751] x14: 0000000000000000 x13: 00000000fffffffd x12: ffffaf7b1b84b0bc [ 1.436760] x11: ffffaf7b1b720d10 x10: 000000000000000a x9 : ffff800010803a60 [ 1.436769] x8 : 000000000000000a x7 : 000000000000000f x6 : 00000000fffff159 [ 1.436778] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000ffffffff [ 1.436787] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff6a9101718d80 [ 1.436797] Call trace: [ 1.436800] sdhci_set_power_noreg+0x168/0x2b4 [ 1.436805] sdhci_set_ios+0xa0/0x7fc [ 1.436811] mmc_power_up.part.0+0xc4/0x164 [ 1.436818] mmc_start_host+0xa0/0xb0 [ 1.436824] mmc_add_host+0x60/0x90 [ 1.436830] __sdhci_add_host+0x174/0x330 [ 1.436836] sdhci_msm_probe+0x7c0/0x920 [ 1.436842] platform_probe+0x68/0xe0 [ 1.436850] really_probe.part.0+0x9c/0x31c [ 1.436857] __driver_probe_device+0x98/0x144 [ 1.436863] driver_probe_device+0xc8/0x15c [ 1.436869] __device_attach_driver+0xb4/0x120 [ 1.436875] bus_for_each_drv+0x78/0xd0 [ 1.436881] __device_attach_async_helper+0xac/0xd0 [ 1.436888] async_run_entry_fn+0x34/0x110 [ 1.436895] process_one_work+0x1d0/0x354 [ 1.436903] worker_thread+0x13c/0x470 [ 1.436910] kthread+0x150/0x160 [ 1.436915] ret_from_fork+0x10/0x20 [ 1.436923] ---[ end trace fcfac44cb045c3a8 ]--- Fix the issue by mapping MMC_VDD_35_36 (and MMC_VDD_34_35) to SDHCI_POWER_330 as well. Signed-off-by: Shawn Guo Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211004024935.15326-1-shawn.guo@linaro.org Signed-off-by: Ulf Hansson commit 013923477cb311293df9079332cf8b806ed0e6f2 Author: Dan Carpenter Date: Wed Oct 6 10:34:19 2021 +0300 pata_legacy: fix a couple uninitialized variable bugs The last byte of "pad" is used without being initialized. Fixes: 55dba3120fbc ("libata: update ->data_xfer hook for ATAPI") Signed-off-by: Dan Carpenter Signed-off-by: Damien Le Moal commit ff01a6220400a944e8c27ae599d9da8e1e3610d9 Merge: 64570fbc14f8d c8f01ffc83923 Author: Dave Airlie Date: Tue Oct 12 10:31:07 2021 +1000 Merge tag 'drm-msm-fixes-2021-10-11' of https://gitlab.freedesktop.org/drm/msm into drm-fixes * Fix a new crash on dev file close if the dev file was opened when GPU is not loaded (such as missing fw in initrd) * Switch to single drm_sched_entity per priority level per drm_file to unbreak multi-context userspace * Serialize GMU access to fix GMU OOB errors * Various error path fixes * A couple integer overflow fixes * Fix mdp5 cursor plane WARNs Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtD4u7yyiy+BQLmibUCbn=AdDRu7FrmdViHVx0QrcGf8g@mail.gmail.com commit c8f01ffc83923a91e8087aaa077de13354a7aa59 Author: Dan Carpenter Date: Fri Oct 1 15:34:09 2021 +0300 drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling This disables a lock which wasn't enabled and it does not disable the first lock in the array. Fixes: 6e0eb52eba9e ("drm/msm/dsi: Parse bus clocks from a list") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001123409.GG2283@kili Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 739b4e7756d3301dd673ca517afca46a5f635562 Author: Dan Carpenter Date: Fri Oct 1 15:33:08 2021 +0300 drm/msm/dsi: Fix an error code in msm_dsi_modeset_init() Return an error code if msm_dsi_manager_validate_current_config(). Don't return success. Fixes: 8b03ad30e314 ("drm/msm/dsi: Use one connector for dual DSI mode") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001123308.GF2283@kili Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 90b7c1c66132c20e8a550006011a3cbfb73dbfc1 Author: Marijn Suijten Date: Mon Sep 6 22:25:51 2021 +0200 drm/msm/dsi: dsi_phy_14nm: Take ready-bit into account in poll_for_ready The downstream driver models this PLL lock check as an if-elseif-else. The only way to reach the else case where pll_locked=true [1] is by succeeding both readl_poll_timeout_atomic calls (which return zero on success) in the if _and_ elseif condition. Hence both the "lock" and "ready" bit need to be tested in the SM_READY_STATUS register before considering the PLL locked and ready to go. Tested on the Sony Xperia XA2 Ultra (nile-discovery, sdm630). [1]: https://source.codeaurora.org/quic/la/kernel/msm-4.19/tree/drivers/clk/qcom/mdss/mdss-dsi-pll-14nm-util.c?h=LA.UM.9.2.1.r1-08000-sdm660.0#n302 Fixes: f079f6d999cb ("drm/msm/dsi: Add PHY/PLL for 8x96") Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210906202552.824598-1-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit ad69b73add8967bc92b62a1cf23a911705781488 Author: Dmitry Baryshkov Date: Tue Sep 21 19:22:45 2021 +0300 drm/msm/dsi/phy: fix clock names in 28nm_8960 phy The commit 9f91f22aafcd ("drm/msm/dsi: remove duplicate fields from dsi_pll_Nnm instances") mistakenly changed registered clock names. While the platform is in progress of migration to using clock properties in the dts rather than the global clock names, we should provide backwards compatibility. Thus restore registerd global clock names. Fixes: 9f91f22aafcd ("drm/msm/dsi: remove duplicate fields from dsi_pll_Nnm instances") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210921162245.1858118-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 3431c17b75c62f8a28db887441bced2007bd3ffc Author: Robert Foss Date: Thu Aug 19 15:36:36 2021 +0200 drm/msm/dpu: Fix address of SM8150 PINGPONG5 IRQ register Both PINGPONG4 and PINGPONG5 IRQ registers are using the same address, which is incorrect. PINGPONG4 should use the register offset 30, and PINGPONG5 should use the register offset 31 according to the downstream driver. Fixes: 667e9985ee24 ("drm/msm/dpu: replace IRQ lookup with the data in hw catalog") Signed-off-by: Robert Foss Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210819133636.2045766-1-robert.foss@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 6a7e0b0e9fb839caa7c7f25bcf91a95b1c2cbef1 Author: Fabio Estevam Date: Tue Sep 14 14:48:31 2021 -0300 drm/msm: Do not run snapshot on non-DPU devices Since commit 98659487b845 ("drm/msm: add support to take dpu snapshot") the following NULL pointer dereference is seen on i.MX53: [ 3.275493] msm msm: bound 30000000.gpu (ops a3xx_ops) [ 3.287174] [drm] Initialized msm 1.8.0 20130625 for msm on minor 0 [ 3.293915] 8<--- cut here --- [ 3.297012] Unable to handle kernel NULL pointer dereference at virtual address 00000028 [ 3.305244] pgd = (ptrval) [ 3.307989] [00000028] *pgd=00000000 [ 3.311624] Internal error: Oops: 805 [#1] SMP ARM [ 3.316430] Modules linked in: [ 3.319503] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0+g682d702b426b #1 [ 3.326652] Hardware name: Freescale i.MX53 (Device Tree Support) [ 3.332754] PC is at __mutex_init+0x14/0x54 [ 3.336969] LR is at msm_disp_snapshot_init+0x24/0xa0 i.MX53 does not use the DPU controller. Fix the problem by only calling msm_disp_snapshot_init() on platforms that use the DPU controller. Cc: stable@vger.kernel.org Fixes: 98659487b845 ("drm/msm: add support to take dpu snapshot") Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20210914174831.2044420-1-festevam@gmail.com Signed-off-by: Rob Clark commit 3eda901995371d390ef82d0b6462f4ea8efbcfdf Author: Dan Carpenter Date: Fri Oct 1 15:59:04 2021 +0300 drm/msm/a3xx: fix error handling in a3xx_gpu_init() These error paths returned 1 on failure, instead of a negative error code. This would lead to an Oops in the caller. A second problem is that the check for "if (ret != -ENODATA)" did not work because "ret" was set to 1. Fixes: 5785dd7a8ef0 ("drm/msm: Fix duplicate gpu node in icc summary") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211001125904.GK2283@kili Signed-off-by: Rob Clark commit 980d74e7d03ccf2eaa11d133416946bd880c7c08 Author: Dan Carpenter Date: Fri Oct 1 15:57:59 2021 +0300 drm/msm/a4xx: fix error handling in a4xx_gpu_init() This code returns 1 on error instead of a negative error. It leads to an Oops in the caller. A second problem is that the check for "if (ret != -ENODATA)" cannot be true because "ret" is set to 1. Fixes: 5785dd7a8ef0 ("drm/msm: Fix duplicate gpu node in icc summary") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211001125759.GJ2283@kili Signed-off-by: Rob Clark commit 2133c4fc8e1348dcb752f267a143fe2254613b34 Author: Colin Ian King Date: Wed Sep 29 13:18:57 2021 +0100 drm/msm: Fix null pointer dereference on pointer edp The initialization of pointer dev dereferences pointer edp before edp is null checked, so there is a potential null pointer deference issue. Fix this by only dereferencing edp after edp has been null checked. Addresses-Coverity: ("Dereference before null check") Fixes: ab5b0107ccf3 ("drm/msm: Initial add eDP support in msm drm driver (v5)") Signed-off-by: Colin Ian King Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210929121857.213922-1-colin.king@canonical.com Signed-off-by: Rob Clark commit c491a0c7bbf3a64732cb8414021429d15ec08eec Author: Dmitry Baryshkov Date: Sat Sep 25 22:28:24 2021 +0300 drm/msm/mdp5: fix cursor-related warnings Since f35a2a99100f ("drm/encoder: make encoder control functions optional") drm_mode_config_validate would print warnings if both cursor plane and cursor functions are provided. Restore separate set of drm_crtc_funcs to be used if separate cursor plane is provided. [ 6.556046] ------------[ cut here ]------------ [ 6.556071] [CRTC:93:crtc-0] must not have both a cursor plane and a cursor_set func [ 6.556091] WARNING: CPU: 1 PID: 76 at drivers/gpu/drm/drm_mode_config.c:648 drm_mode_config_validate+0x238/0x4d0 [ 6.567453] Modules linked in: [ 6.577604] CPU: 1 PID: 76 Comm: kworker/u8:2 Not tainted 5.15.0-rc1-dirty #43 [ 6.580557] Hardware name: Qualcomm Technologies, Inc. DB820c (DT) [ 6.587763] Workqueue: events_unbound deferred_probe_work_func [ 6.593926] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 6.599740] pc : drm_mode_config_validate+0x238/0x4d0 [ 6.606596] lr : drm_mode_config_validate+0x238/0x4d0 [ 6.611804] sp : ffff8000121b3980 [ 6.616838] x29: ffff8000121b3990 x28: 0000000000000000 x27: 0000000000000001 [ 6.620140] x26: ffff8000114cde50 x25: ffff8000114cdd40 x24: ffff0000987282d8 [ 6.627258] x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000001 [ 6.634376] x20: ffff000098728000 x19: ffff000080a39000 x18: ffffffffffffffff [ 6.641494] x17: 3136564e3631564e x16: 0000000000000324 x15: ffff800011c78709 [ 6.648613] x14: 0000000000000000 x13: ffff800011a22850 x12: 00000000000009ab [ 6.655730] x11: 0000000000000339 x10: ffff800011a22850 x9 : ffff800011a22850 [ 6.662848] x8 : 00000000ffffefff x7 : ffff800011a7a850 x6 : ffff800011a7a850 [ 6.669966] x5 : 000000000000bff4 x4 : 40000000fffff339 x3 : 0000000000000000 [ 6.677084] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00008093b800 [ 6.684205] Call trace: [ 6.691319] drm_mode_config_validate+0x238/0x4d0 [ 6.693577] drm_dev_register+0x17c/0x210 [ 6.698435] msm_drm_bind+0x4b4/0x694 [ 6.702429] try_to_bring_up_master+0x164/0x1d0 [ 6.706075] __component_add+0xa0/0x170 [ 6.710415] component_add+0x14/0x20 [ 6.714234] msm_hdmi_dev_probe+0x1c/0x2c [ 6.718053] platform_probe+0x68/0xe0 [ 6.721959] really_probe.part.0+0x9c/0x30c [ 6.725606] __driver_probe_device+0x98/0x144 [ 6.729600] driver_probe_device+0xc8/0x15c [ 6.734114] __device_attach_driver+0xb4/0x120 [ 6.738106] bus_for_each_drv+0x78/0xd0 [ 6.742619] __device_attach+0xdc/0x184 [ 6.746351] device_initial_probe+0x14/0x20 [ 6.750172] bus_probe_device+0x9c/0xa4 [ 6.754337] deferred_probe_work_func+0x88/0xc0 [ 6.758158] process_one_work+0x1d0/0x370 [ 6.762671] worker_thread+0x2c8/0x470 [ 6.766839] kthread+0x15c/0x170 [ 6.770483] ret_from_fork+0x10/0x20 [ 6.773870] ---[ end trace 5884eb76cd26d274 ]--- [ 6.777500] ------------[ cut here ]------------ [ 6.782043] [CRTC:93:crtc-0] must not have both a cursor plane and a cursor_move func [ 6.782063] WARNING: CPU: 1 PID: 76 at drivers/gpu/drm/drm_mode_config.c:654 drm_mode_config_validate+0x290/0x4d0 [ 6.794362] Modules linked in: [ 6.804600] CPU: 1 PID: 76 Comm: kworker/u8:2 Tainted: G W 5.15.0-rc1-dirty #43 [ 6.807555] Hardware name: Qualcomm Technologies, Inc. DB820c (DT) [ 6.816148] Workqueue: events_unbound deferred_probe_work_func [ 6.822311] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 6.828126] pc : drm_mode_config_validate+0x290/0x4d0 [ 6.834981] lr : drm_mode_config_validate+0x290/0x4d0 [ 6.840189] sp : ffff8000121b3980 [ 6.845223] x29: ffff8000121b3990 x28: 0000000000000000 x27: 0000000000000001 [ 6.848525] x26: ffff8000114cde50 x25: ffff8000114cdd40 x24: ffff0000987282d8 [ 6.855643] x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000001 [ 6.862763] x20: ffff000098728000 x19: ffff000080a39000 x18: ffffffffffffffff [ 6.869879] x17: 3136564e3631564e x16: 0000000000000324 x15: ffff800011c790c2 [ 6.876998] x14: 0000000000000000 x13: ffff800011a22850 x12: 0000000000000a2f [ 6.884116] x11: 0000000000000365 x10: ffff800011a22850 x9 : ffff800011a22850 [ 6.891234] x8 : 00000000ffffefff x7 : ffff800011a7a850 x6 : ffff800011a7a850 [ 6.898351] x5 : 000000000000bff4 x4 : 40000000fffff365 x3 : 0000000000000000 [ 6.905470] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00008093b800 [ 6.912590] Call trace: [ 6.919702] drm_mode_config_validate+0x290/0x4d0 [ 6.921960] drm_dev_register+0x17c/0x210 [ 6.926821] msm_drm_bind+0x4b4/0x694 [ 6.930813] try_to_bring_up_master+0x164/0x1d0 [ 6.934459] __component_add+0xa0/0x170 [ 6.938799] component_add+0x14/0x20 [ 6.942619] msm_hdmi_dev_probe+0x1c/0x2c [ 6.946438] platform_probe+0x68/0xe0 [ 6.950345] really_probe.part.0+0x9c/0x30c [ 6.953991] __driver_probe_device+0x98/0x144 [ 6.957984] driver_probe_device+0xc8/0x15c [ 6.962498] __device_attach_driver+0xb4/0x120 [ 6.966492] bus_for_each_drv+0x78/0xd0 [ 6.971004] __device_attach+0xdc/0x184 [ 6.974737] device_initial_probe+0x14/0x20 [ 6.978556] bus_probe_device+0x9c/0xa4 [ 6.982722] deferred_probe_work_func+0x88/0xc0 [ 6.986543] process_one_work+0x1d0/0x370 [ 6.991057] worker_thread+0x2c8/0x470 [ 6.995223] kthread+0x15c/0x170 [ 6.998869] ret_from_fork+0x10/0x20 [ 7.002255] ---[ end trace 5884eb76cd26d275 ]--- Fixes: aa649e875daf ("drm/msm/mdp5: mdp5_crtc: Restore cursor state only if LM cursors are enabled") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210925192824.3416259-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark commit 171316a68d9a8e0d9e28b7cf4c15afc4c6244a4e Author: Marek Vasut Date: Fri Sep 17 02:59:13 2021 +0200 drm/msm: Avoid potential overflow in timeout_to_jiffies() The return type of ktime_divns() is s64. The timeout_to_jiffies() currently assigns the result of this ktime_divns() to unsigned long, which on 32 bit systems may overflow. Furthermore, the result of this function is sometimes also passed to functions which expect signed long, dma_fence_wait_timeout() is one such example. Fix this by adjusting the type of remaining_jiffies to s64, so we do not suffer overflow there, and return a value limited to range of 0..INT_MAX, which is safe for all usecases of this timeout. The above overflow can be triggered if userspace passes in too large timeout value, larger than INT_MAX / HZ seconds. The kernel detects it and complains about "schedule_timeout: wrong timeout value %lx" and generates a warning backtrace. Note that this fixes commit 6cedb8b377bb ("drm/msm: avoid using 'timespec'"), because the previously used timespec_to_jiffies() function returned unsigned long instead of s64: static inline unsigned long timespec_to_jiffies(const struct timespec *value) Fixes: 6cedb8b377bb ("drm/msm: avoid using 'timespec'") Signed-off-by: Marek Vasut Cc: Arnd Bergmann Cc: Jordan Crouse Cc: Rob Clark Cc: stable@vger.kernel.org # 5.6+ Acked-by: Arnd Bergmann Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210917005913.157379-1-marex@denx.de Signed-off-by: Rob Clark commit efb8a170a367fa898d7848c4e74c1c20222e0d91 Author: Stephan Gerhold Date: Mon Sep 13 18:45:56 2021 +0200 drm/msm: Fix devfreq NULL pointer dereference on a3xx There is no devfreq on a3xx at the moment since gpu_busy is not implemented. This means that msm_devfreq_init() will return early and the entire devfreq setup is skipped. However, msm_devfreq_active() and msm_devfreq_idle() are still called unconditionally later, causing a NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 Internal error: Oops: 96000004 [#1] PREEMPT SMP CPU: 0 PID: 133 Comm: ring0 Not tainted 5.15.0-rc1 #4 Hardware name: Longcheer L8150 (DT) pc : mutex_lock_io+0x2bc/0x2f0 lr : msm_devfreq_active+0x3c/0xe0 [msm] Call trace: mutex_lock_io+0x2bc/0x2f0 msm_gpu_submit+0x164/0x180 [msm] msm_job_run+0x54/0xe0 [msm] drm_sched_main+0x2b0/0x4a0 [gpu_sched] kthread+0x154/0x160 ret_from_fork+0x10/0x20 Fix this by adding a check in msm_devfreq_active/idle() which ensures that devfreq was actually initialized earlier. Fixes: 9bc95570175a ("drm/msm: Devfreq tuning") Reported-by: Nikita Travkin Tested-by: Nikita Travkin Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210913164556.16284-1-stephan@gerhold.net Signed-off-by: Rob Clark commit 9463b64d1a34fc4d18f9de63f07b2400c86f8da8 Author: Kuogee Hsieh Date: Wed Sep 29 09:17:04 2021 -0700 drm/msm/dp: only signal audio when disconnected detected at dp_pm_resume Currently there is audio not working problem after system resume from suspend if hdmi monitor stay plugged in at DUT. However this problem does not happen at normal operation but at a particular test case. The root cause is DP driver signal audio with connected state at resume which trigger audio trying to setup audio data path through DP main link but failed due to display port is not setup and enabled by upper layer framework yet. This patch only have DP driver signal audio only when DP is in disconnected state so that audio option shows correct state after system resume. DP driver will not signal audio with connected state until display enabled executed by upper layer framework where display port is setup completed and main link is running. Changes in V2: -- add details commit text Fixes: afc9b8b6bab8 ("drm/msm/dp: signal audio plugged change at dp_pm_resume") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1632932224-25102-1-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit fa5878760579a9feaa1de3bb2396cd23beb439ca Merge: 459ea72c6cb98 361b57df62de2 Author: Linus Torvalds Date: Mon Oct 11 17:25:08 2021 -0700 Merge tag 'linux-kselftest-kunit-fixes-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kunit fixes from Shuah Khan: - Fixes to address the structleak plugin causing the stack frame size to grow immensely when used with KUnit. Fixes include adding a new makefile to disable structleak and using it from KUnit iio, device property, thunderbolt, and bitfield tests to disable it. - KUnit framework reference count leak in kfree_at_end - KUnit tool fix to resolve conflict between --json and --raw_output and generate correct test output in either case. - kernel-doc warnings due to mismatched arg names * tag 'linux-kselftest-kunit-fixes-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: fix kernel-doc warnings due to mismatched arg names bitfield: build kunit tests without structleak plugin thunderbolt: build kunit tests without structleak plugin device property: build kunit tests without structleak plugin iio/test-format: build kunit tests without structleak plugin gcc-plugins/structleak: add makefile var for disabling structleak kunit: fix reference count leak in kfree_at_end kunit: tool: better handling of quasi-bool args (--json, --raw_output) commit 459ea72c6cb98164ccacd6d06e3121554c13ba5e Merge: 0a5d6c641b671 c0002d11d7990 Author: Linus Torvalds Date: Mon Oct 11 17:16:41 2021 -0700 Merge branch 'for-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fixes from Tejun Heo: "All documentation / comment updates" * 'for-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroupv2, docs: fix misinformation in "device controller" section cgroup/cpuset: Change references of cpuset_mutex to cpuset_rwsem docs/cgroup: remove some duplicate words commit 4157a441ff068cc406513e7b8069efa19bba89d0 Author: Chun-Kuang Hu Date: Fri Oct 8 07:28:40 2021 +0800 Revert "drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb" This reverts commit c1ec54b7b5af25c779192253f5a9f05e95cb43d7. Commit c1ec54b7b5af ("drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb") would cause numerous mtk cmdq mailbox driver warning: WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198 cmdq_task_exec_done+0xb8/0xe0 So revert that patch. Reported-by: Enric Balletbo Serra Tested-by: Enric Balletbo Serra Signed-off-by: Chun-Kuang Hu commit 8a4a099f843890504d4942b93b3290a53a53ff3a Author: Chun-Kuang Hu Date: Fri Oct 8 07:27:11 2021 +0800 Revert "drm/mediatek: Remove struct cmdq_client" This reverts commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837. Commit c1ec54b7b5af ("drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb") would cause numerous mtk cmdq mailbox driver warning: WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198 cmdq_task_exec_done+0xb8/0xe0 So revert that patch and all the patches depend on that patch. Reported-by: Enric Balletbo Serra Tested-by: Enric Balletbo Serra Signed-off-by: Chun-Kuang Hu commit 0cf54fff9bcffa69bb96f2da8539858402aea404 Author: Chun-Kuang Hu Date: Fri Oct 8 07:25:32 2021 +0800 Revert "drm/mediatek: Detect CMDQ execution timeout" This reverts commit 8cdcb365342402fdeb664479b0a04e9debef8efb. Commit c1ec54b7b5af ("drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb") would cause numerous mtk cmdq mailbox driver warning: WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198 cmdq_task_exec_done+0xb8/0xe0 So revert that patch and all the patches depend on that patch. Reported-by: Enric Balletbo Serra Tested-by: Enric Balletbo Serra Signed-off-by: Chun-Kuang Hu commit be7d2d837363e2d36bc9d87b89207f1b8f5c997d Author: Chun-Kuang Hu Date: Fri Oct 8 07:23:02 2021 +0800 Revert "drm/mediatek: Add cmdq_handle in mtk_crtc" This reverts commit bc9241be73d9b2b3bcb7033598521fd669639848. Commit c1ec54b7b5af ("drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb") would cause numerous mtk cmdq mailbox driver warning: WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198 cmdq_task_exec_done+0xb8/0xe0 So revert that patch and all the patches depend on that patch. Reported-by: Enric Balletbo Serra Tested-by: Enric Balletbo Serra Signed-off-by: Chun-Kuang Hu commit bdefc6b23be33add5e075fb76b97271dad4f813c Author: Chun-Kuang Hu Date: Fri Oct 8 07:11:20 2021 +0800 Revert "drm/mediatek: Clear pending flag when cmdq packet is done" This reverts commit 9efb16c2fdd647d3888fd8dae84509f485cd554e. Commit c1ec54b7b5af ("drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb") would cause numerous mtk cmdq mailbox driver warning: WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198 cmdq_task_exec_done+0xb8/0xe0 So revert that patch and all the patches depend on that patch. Reported-by: Enric Balletbo Serra Tested-by: Enric Balletbo Serra Signed-off-by: Chun-Kuang Hu commit 0a5d6c641b671370f019cbe20fe51ee3ef00264c Merge: 1986c10acc9c9 57116ce17b04f Author: Linus Torvalds Date: Mon Oct 11 16:59:49 2021 -0700 Merge branch 'for-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue fixes from Tejun Heo: "One patch to add a missing __printf annotation and the other to enable deferred printing for debug dumps to avoid deadlocks when triggered from some contexts (e.g. console drivers)" * 'for-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: fix state-dump console deadlock workqueue: annotate alloc_workqueue() as printf commit 1986c10acc9c906e453fb19d86e6342e8e525824 Merge: 64570fbc14f8d 4afb912f439c4 Author: Linus Torvalds Date: Mon Oct 11 16:48:19 2021 -0700 Merge tag 'for-5.15-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few more error handling fixes, stemming from code inspection, error injection or fuzzing" * tag 'for-5.15-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix abort logic in btrfs_replace_file_extents btrfs: check for error when looking up inode during dir entry replay btrfs: unify lookup return value when dir entry is missing btrfs: deal with errors when adding inode reference during log replay btrfs: deal with errors when replaying dir entry during log replay btrfs: deal with errors when checking if a dir entry exists during log replay btrfs: update refs for any root except tree log roots btrfs: unlock newly allocated extent buffer after error commit 465f15a6d1a8f51f7e09fba12678b39031f63ca9 Author: Florian Westphal Date: Thu Sep 23 15:12:42 2021 +0200 selftests: nft_nat: add udp hole punch test case Add a test case that demonstrates port shadowing via UDP. ns2 sends packet to ns1, from source port used by a udp service on the router, ns0. Then, ns1 sends packet to ns0:service, but that ends up getting forwarded to ns2. Also add three test cases that demonstrate mitigations: 1. disable use of $port as source from 'unstrusted' origin 2. make the service untracked. This prevents masquerade entries from having any effects. 3. add forced PAT via 'random' mode to translate the "wrong" sport into an acceptable range. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2e5809a4ddb15969503e43b06662a9a725f613ea Author: Mike Kravetz Date: Tue Oct 5 13:25:29 2021 -0700 arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE For non-4K PAGE_SIZE configs, the largest gigantic huge page size is CONT_PMD_SHIFT order. On arm64 with 64K PAGE_SIZE, the gigantic page is 16G. Therefore, one should be able to specify 'hugetlb_cma=16G' on the kernel command line so that one gigantic page can be allocated from CMA. However, when adding such an option the following message is produced: hugetlb_cma: cma area should be at least 8796093022208 MiB This is because the calculation for non-4K gigantic page order is incorrect in the arm64 specific routine arm64_hugetlb_cma_reserve(). Fixes: abb7962adc80 ("arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs") Cc: # 5.9.x Signed-off-by: Mike Kravetz Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20211005202529.213812-1-mike.kravetz@oracle.com Signed-off-by: Catalin Marinas commit 711885906b5c2df90746a51f4cd674f1ab9fbb1d Author: Borislav Petkov Date: Wed Oct 6 19:34:55 2021 +0200 x86/Kconfig: Do not enable AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT automatically This Kconfig option was added initially so that memory encryption is enabled by default on machines which support it. However, devices which have DMA masks that are less than the bit position of the encryption bit, aka C-bit, require the use of an IOMMU or the use of SWIOTLB. If the IOMMU is disabled or in passthrough mode, the kernel would switch to SWIOTLB bounce-buffering for those transfers. In order to avoid that, 2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active") disables the default IOMMU passthrough mode so that devices for which the default 256K DMA is insufficient, can use the IOMMU instead. However 2, there are cases where the IOMMU is disabled in the BIOS, etc. (think the usual hardware folk "oops, I dropped the ball there" cases) or a driver doesn't properly use the DMA APIs or a device has a firmware or hardware bug, e.g.: ea68573d408f ("drm/amdgpu: Fail to load on RAVEN if SME is active") However 3, in the above GPU use case, there are APIs like Vulkan and some OpenGL/OpenCL extensions which are under the assumption that user-allocated memory can be passed in to the kernel driver and both the GPU and CPU can do coherent and concurrent access to the same memory. That cannot work with SWIOTLB bounce buffers, of course. So, in order for those devices to function, drop the "default y" for the SME by default active option so that users who want to have SME enabled, will need to either enable it in their config or use "mem_encrypt=on" on the kernel command line. [ tlendacky: Generalize commit message. ] Fixes: 7744ccdbc16f ("x86/mm: Add Secure Memory Encryption (SME) support") Reported-by: Paul Menzel Signed-off-by: Borislav Petkov Acked-by: Alex Deucher Acked-by: Tom Lendacky Cc: Link: https://lkml.kernel.org/r/8bbacd0e-4580-3194-19d2-a0ecad7df09c@molgen.mpg.de commit 57116ce17b04fde2fe30f0859df69d8dbe5809f6 Author: Johan Hovold Date: Wed Oct 6 13:58:52 2021 +0200 workqueue: fix state-dump console deadlock Console drivers often queue work while holding locks also taken in their console write paths, something which can lead to deadlocks on SMP when dumping workqueue state (e.g. sysrq-t or on suspend failures). For serial console drivers this could look like: CPU0 CPU1 ---- ---- show_workqueue_state(); lock(&pool->lock); lock(&port->lock); schedule_work(); lock(&pool->lock); printk(); lock(console_owner); lock(&port->lock); where workqueues are, for example, used to push data to the line discipline, process break signals and handle modem-status changes. Line disciplines and serdev drivers can also queue work on write-wakeup notifications, etc. Reworking every console driver to avoid queuing work while holding locks also taken in their write paths would complicate drivers and is neither desirable or feasible. Instead use the deferred-printk mechanism to avoid printing while holding pool locks when dumping workqueue state. Note that there are a few WARN_ON() assertions in the workqueue code which could potentially also trigger a deadlock. Hopefully the ongoing printk rework will provide a general solution for this eventually. This was originally reported after a lockdep splat when executing sysrq-t with the imx serial driver. Fixes: 3494fc30846d ("workqueue: dump workqueues on sysrq-t") Cc: stable@vger.kernel.org # 4.0 Reported-by: Fabio Estevam Tested-by: Fabio Estevam Signed-off-by: Johan Hovold Reviewed-by: John Ogness Signed-off-by: Tejun Heo commit 22b05f1ac0332cb47701649206997d8d9a1a7f24 Author: Konstantin Komarov Date: Tue Oct 5 19:33:26 2021 +0300 fs/ntfs3: Refactor ntfs_read_mft Don't save size of attribute reparse point as size of symlink. Signed-off-by: Konstantin Komarov commit cd4c76ff807c1afeed89f1b7e311760c0e296349 Author: Konstantin Komarov Date: Tue Oct 5 19:08:08 2021 +0300 fs/ntfs3: Refactor ni_parse_reparse Change argument from void* to struct REPARSE_DATA_BUFFER* We copy data to buffer, so we can read it later in ntfs_read_mft. Signed-off-by: Konstantin Komarov commit 14a981193e409d8ca3f89768cfbd7a9a516d9927 Author: Konstantin Komarov Date: Mon Oct 4 18:52:24 2021 +0300 fs/ntfs3: Refactor ntfs_create_inode Set size for symlink, so we don't need to calculate it on the fly. Signed-off-by: Konstantin Komarov commit 4dbe8e4413d70ac4f163592d69eef74d7824783a Author: Konstantin Komarov Date: Mon Oct 4 18:59:55 2021 +0300 fs/ntfs3: Refactor ntfs_readlink_hlp Rename some variables. Returned err by default is EINVAL. Signed-off-by: Konstantin Komarov commit 2c69078851b3d7495eb191158d0bcb9c91a6d148 Author: Konstantin Komarov Date: Mon Oct 4 18:22:45 2021 +0300 fs/ntfs3: Rework ntfs_utf16_to_nls Now ntfs_utf16_to_nls takes length as one of arguments. If length of symlink > 255, then we tried to convert length of symlink +- some random number. Now 255 symbols limit was removed. Signed-off-by: Konstantin Komarov commit e02083f0bcc250c0556ec9e6f7ddb74220c72572 Author: Matthew Auld Date: Mon Oct 11 17:13:38 2021 +0100 drm/i915: remember to call i915_sw_fence_fini Seems to fix some object-debug splat which appeared while debugging something unrelated. v2: s/guc_blocked/guc_state.blocked/ Signed-off-by: Matthew Auld Cc: Ville Syrjälä Cc: Matthew Brost Tested-by: Ville Syrjälä Reviewed-by: Matthew Brost Fixes: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Link: https://patchwork.freedesktop.org/patch/msgid/20210924144646.4096402-1-matthew.auld@intel.com (cherry picked from commit d576b31bdece7b5034047cbe21170e948198d32f) Signed-off-by: Jani Nikula commit 9b75450d6c580100611743fa7e690ea3cb47cd4a Author: Konstantin Komarov Date: Tue Sep 28 19:00:30 2021 +0300 fs/ntfs3: Fix memory leak if fill_super failed In ntfs_init_fs_context we allocate memory in fc->s_fs_info. In case of failed mount we must free it in ntfs_fill_super. We can't do it in ntfs_fs_free, because ntfs_fs_free called with fc->s_fs_info == NULL. fc->s_fs_info became NULL in sget_fc. Signed-off-by: Konstantin Komarov commit 228af5a4fa3a8293bd8b7ac5cf59548ee29627bf Author: Takashi Iwai Date: Sun Oct 10 09:55:46 2021 +0200 ALSA: pcm: Workaround for a wrong offset in SYNC_PTR compat ioctl Michael Forney reported an incorrect padding type that was defined in the commit 80fe7430c708 ("ALSA: add new 32-bit layout for snd_pcm_mmap_status/control") for PCM control mmap data. His analysis is correct, and this caused the misplacements of PCM control data on 32bit arch and 32bit compat mode. The bug is that the __pad2 definition in __snd_pcm_mmap_control64 struct was wrongly with __pad_before_uframe, which should have been __pad_after_uframe instead. This struct is used in SYNC_PTR ioctl and control mmap. Basically this bug leads to two problems: - The offset of avail_min field becomes wrong, it's placed right after appl_ptr without padding on little-endian - When appl_ptr and avail_min are read as 64bit values in kernel side, the values become either zero or corrupted (mixed up) One good news is that, because both user-space and kernel misunderstand the wrong offset, at least, 32bit application running on 32bit kernel works as is. Also, 64bit applications are unaffected because the padding size is zero. The remaining problem is the 32bit compat mode; as mentioned in the above, avail_min is placed right after appl_ptr on little-endian archs, 64bit kernel reads bogus values for appl_ptr updates, which may lead to streaming bugs like jumping, XRUN or whatever unexpected. (However, we haven't heard any serious bug reports due to this over years, so practically seen, it's fairly safe to assume that the impact by this bug is limited.) Ideally speaking, we should correct the wrong mmap status control definition. But this would cause again incompatibility with the existing binaries, and fixing it (e.g. by renumbering ioctls) would be really messy. So, as of this patch, we only correct the behavior of 32bit compat mode and keep the rest as is. Namely, the SYNC_PTR ioctl is now handled differently in compat mode to read/write the 32bit values at the right offsets. The control mmap of 32bit apps on 64bit kernels has been already disabled (which is likely rather an overlook, but this worked fine at this time :), so covering SYNC_PTR ioctl should suffice as a fallback. Fixes: 80fe7430c708 ("ALSA: add new 32-bit layout for snd_pcm_mmap_status/control") Reported-by: Michael Forney Reviewed-by: Arnd Bergmann Cc: Cc: Rich Felker Link: https://lore.kernel.org/r/29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org Link: https://lore.kernel.org/r/20211010075546.23220-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ce46ae0c3e31400dc89d1e4620a812647cab9c72 Author: Konstantin Komarov Date: Fri Oct 1 18:48:49 2021 +0300 fs/ntfs3: Keep prealloc for all types of files Before we haven't kept prealloc for sparse files because we thought that it will speed up create / write operations. It lead to situation, when user reserved some space for sparse file, filled volume, and wasn't able to write in reserved file. With this commit we keep prealloc. Now xfstest generic/274 pass. Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Signed-off-by: Konstantin Komarov commit 7df227847ab562c42d318bceccebb0c911c87b04 Author: Shravan S Date: Wed Oct 6 13:05:25 2021 +0530 platform/x86: int1092: Fix non sequential device mode handling SAR information from BIOS may come in non sequential pattern. To overcome the issue, a check is made to extract the right SAR information using the device mode which is currently being used. Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Shravan S Link: https://lore.kernel.org/r/20211006073525.1332925-1-s.shravan@intel.com Signed-off-by: Hans de Goede Reviewed-by: Hans de Goede commit c005828744f584bfcd2cf3ed64dfef15a5078960 Author: Daniel Scally Date: Fri Oct 8 23:46:08 2021 +0100 platform/x86: intel_skl_int3472: Correct null check The int3472-discrete driver can enter an error path after initialising int3472->clock.ena_gpio, but before it has registered the clock. This will cause a NULL pointer dereference, because clkdev_drop() is not null aware. Instead of guarding the call to skl_int3472_unregister_clock() by checking for .ena_gpio, check specifically for the presence of the clk_lookup, which will guarantee clkdev_create() has already been called. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214453 Fixes: 7540599a5ef1 ("platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_clock()") Signed-off-by: Daniel Scally Link: https://lore.kernel.org/r/20211008224608.415949-1-djrscally@gmail.com Signed-off-by: Hans de Goede commit 0f607d6b227470456a69a37d7c7badea51d52844 Author: Zephaniah E. Loss-Cutler-Hull Date: Mon Oct 4 21:48:55 2021 -0700 platform/x86: gigabyte-wmi: add support for B550 AORUS ELITE AX V2 This works just fine on my system. Signed-off-by: Zephaniah E. Loss-Cutler-Hull Cc: Link: https://lore.kernel.org/r/20211005044855.1429724-1-zephaniah@gmail.com Signed-off-by: Hans de Goede commit c0d84d2c7c23e9cf23a5abdda40eeaa79eabfe69 Author: Sachi King Date: Sat Oct 2 14:18:39 2021 +1000 platform/x86: amd-pmc: Add alternative acpi id for PMC controller The Surface Laptop 4 AMD has used the AMD0005 to identify this controller instead of using the appropriate ACPI ID AMDI0005. Include AMD0005 in the acpi id list. Link: https://github.com/linux-surface/acpidumps/tree/master/surface_laptop_4_amd Link: https://gist.github.com/nakato/2a1a7df1a45fe680d7a08c583e1bf863 Cc: # 5.14+ Signed-off-by: Sachi King Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211002041840.2058647-1-nakato@nakato.io Signed-off-by: Hans de Goede commit a0c5814b9933f25ecb6de169483c5b88cf632bca Author: Prashant Malani Date: Tue Sep 28 03:19:34 2021 -0700 platform/x86: intel_scu_ipc: Update timeout value in comment The comment decribing the IPC timeout hadn't been updated when the actual timeout was changed from 3 to 5 seconds in commit a7d53dbbc70a ("platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 seconds") . Since the value is anyway updated to 10s now, take this opportunity to update the value in the comment too. Signed-off-by: Prashant Malani Cc: Benson Leung Reviewed-by: Mika Westerberg Link: https://lore.kernel.org/r/20210928101932.2543937-4-pmalani@chromium.org Signed-off-by: Hans de Goede commit 5c02b581ce84eea240d25c8318a1f65133a04415 Author: Prashant Malani Date: Tue Sep 28 03:19:32 2021 -0700 platform/x86: intel_scu_ipc: Increase virtual timeout to 10s Commit a7d53dbbc70a ("platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 seconds") states that the recommended timeout range is 5-10 seconds. Adjust the timeout value to the higher of those i.e 10 seconds, to account for situations where the 5 seconds is insufficient for disconnect command success. Signed-off-by: Prashant Malani Cc: Benson Leung Reviewed-by: Mika Westerberg Link: https://lore.kernel.org/r/20210928101932.2543937-3-pmalani@chromium.org Signed-off-by: Hans de Goede commit 41512e4dc0b84525495e784295092592adb87f1b Author: Prashant Malani Date: Tue Sep 28 03:19:30 2021 -0700 platform/x86: intel_scu_ipc: Fix busy loop expiry time The macro IPC_TIMEOUT is already in jiffies (it is also used like that elsewhere in the file when calling wait_for_completion_timeout()). Don’t convert it using helper functions for the purposes of calculating the busy loop expiry time. Fixes: e7b7ab3847c9 (“platform/x86: intel_scu_ipc: Sleeping is fine when polling”) Signed-off-by: Prashant Malani Cc: Benson Leung Reviewed-by: Mika Westerberg Link: https://lore.kernel.org/r/20210928101932.2543937-2-pmalani@chromium.org Signed-off-by: Hans de Goede commit 92813dafcd8cae40b6256fd9392a44ecd5c9f505 Author: Hans de Goede Date: Mon Oct 11 15:23:38 2021 +0200 platform/x86: dell: Make DELL_WMI_PRIVACY depend on DELL_WMI DELL_WMI_PRIVACY is a feature toggle for the main dell-wmi driver, so it must depend on the Kconfig option which enables the main dell-wmi driver. Fixes: 8af9fa37b8a3 ("platform/x86: dell-privacy: Add support for Dell hardware privacy") Reported-by: Randy Dunlap Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211011132338.407571-1-hdegoede@redhat.com commit db9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8 Author: Vadim Pasternak Date: Mon Sep 27 17:22:14 2021 +0300 platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes Fix shift argument for function rol32(). It should be provided in bits, while was provided in bytes. Fixes: 86148190a7db ("platform/mellanox: mlxreg-io: Add support for complex attributes") Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com Signed-off-by: Hans de Goede commit 9b024201693e397441668cca0d2df7055fe572eb Author: Vadim Pasternak Date: Mon Sep 27 17:22:13 2021 +0300 platform/mellanox: mlxreg-io: Fix argument base in kstrtou32() call Change kstrtou32() argument 'base' to be zero instead of 'len'. It works by chance for setting one bit value, but it is not supposed to work in case value passed to mlxreg_io_attr_store() is greater than 1. It works for example, for: echo 1 > /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable But it will fail for: echo n > /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable, where n > 1. The flow for input buffer conversion is as below: _kstrtoull(const char *s, unsigned int base, unsigned long long *res) calls: rv = _parse_integer(s, base, &_res); For the second case, where n > 1: - _parse_integer() converts 's' to 'val'. For n=2, 'len' is set to 2 (string buffer is 0x32 0x0a), for n=3 'len' is set to 3 (string buffer 0x33 0x0a), etcetera. - 'base' is equal or greater then '2' (length of input buffer). As a result, _parse_integer() exits with result zero (rv): rv = 0; while (1) { ... if (val >= base)-> (2 >= 2) break; ... rv++; ... } And _kstrtoull() in their turn will fail: if (rv == 0) return -EINVAL; Fixes: 5ec4a8ace06c ("platform/mellanox: Introduce support for Mellanox register access driver") Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20210927142214.2613929-2-vadimp@nvidia.com Signed-off-by: Hans de Goede commit 75b3cb97eb1f05042745c0655a7145b0262d4c5c Author: Kamal Dasu Date: Fri Oct 8 16:36:02 2021 -0400 spi: bcm-qspi: clear MSPI spifie interrupt during probe Intermittent Kernel crash has been observed on probe in bcm_qspi_mspi_l2_isr() handler when the MSPI spifie interrupt bit has not been cleared before registering for interrupts. Fix the driver to move SoC specific custom interrupt handling code before we register IRQ in probe. Also clear MSPI interrupt status resgiter prior to registering IRQ handlers. Fixes: cc20a38612db ("spi: iproc-qspi: Add Broadcom iProc SoCs support") Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20211008203603.40915-3-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit c448b7aa3e66042fc0f849d9a0fb90d1af82e948 Author: Yang Yingliang Date: Sat Oct 9 14:58:40 2021 +0800 ASoC: soc-core: fix null-ptr-deref in snd_soc_del_component_unlocked() 'component' is allocated in snd_soc_register_component(), but component->list is not initalized, this may cause snd_soc_del_component_unlocked() deref null ptr in the error handing case. KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:__list_del_entry_valid+0x81/0xf0 Call Trace: snd_soc_del_component_unlocked+0x69/0x1b0 [snd_soc_core] snd_soc_add_component.cold+0x54/0x6c [snd_soc_core] snd_soc_register_component+0x70/0x90 [snd_soc_core] devm_snd_soc_register_component+0x5e/0xd0 [snd_soc_core] tas2552_probe+0x265/0x320 [snd_soc_tas2552] ? tas2552_component_probe+0x1e0/0x1e0 [snd_soc_tas2552] i2c_device_probe+0xa31/0xbe0 Fix by adding INIT_LIST_HEAD() to snd_soc_component_initialize(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211009065840.3196239-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 293d92cbbd2418ca2ba43fed07f1b92e884d1c77 Author: Gerald Schaefer Date: Wed Oct 6 22:19:43 2021 +0200 dma-debug: fix sg checks in debug_dma_map_sg() The following warning occurred sporadically on s390: DMA-API: nvme 0006:00:00.0: device driver maps memory from kernel text or rodata [addr=0000000048cc5e2f] [len=131072] WARNING: CPU: 4 PID: 825 at kernel/dma/debug.c:1083 check_for_illegal_area+0xa8/0x138 It is a false-positive warning, due to broken logic in debug_dma_map_sg(). check_for_illegal_area() checks for overlay of sg elements with kernel text or rodata. It is called with sg_dma_len(s) instead of s->length as parameter. After the call to ->map_sg(), sg_dma_len() will contain the length of possibly combined sg elements in the DMA address space, and not the individual sg element length, which would be s->length. The check will then use the physical start address of an sg element, and add the DMA length for the overlap check, which could result in the false warning, because the DMA length can be larger than the actual single sg element length. In addition, the call to check_for_illegal_area() happens in the iteration over mapped_ents, which will not include all individual sg elements if any of them were combined in ->map_sg(). Fix this by using s->length instead of sg_dma_len(s). Also put the call to check_for_illegal_area() in a separate loop, iterating over all the individual sg elements ("nents" instead of "mapped_ents"). While at it, as suggested by Robin Murphy, also move check_for_stack() inside the new loop, as it is similarly concerned with validating the individual sg elements. Link: https://lore.kernel.org/lkml/20210705185252.4074653-1-gerald.schaefer@linux.ibm.com Fixes: 884d05970bfb ("dma-debug: use sg_dma_len accessor") Signed-off-by: Gerald Schaefer Signed-off-by: Christoph Hellwig commit 011a9ce80763141e7fa613934e76bef8948e4a4f Author: Logan Gunthorpe Date: Tue Oct 5 10:48:12 2021 -0600 dma-mapping: fix the kerneldoc for dma_map_sgtable() htmldocs began producing the following warnings: kernel/dma/mapping.c:256: WARNING: Definition list ends without a blank line; unexpected unindent. kernel/dma/mapping.c:257: WARNING: Bullet list ends without a blank line; unexpected unindent. Reformatting the list without hyphens fixes the warnings and produces both a readable text and HTML output. Fixes: fffe3cc8c219 ("dma-mapping: allow map_sg() ops to return negative error code") Reported-by: Stephen Rothwell Signed-off-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig commit 023a062f238129e8a542b5163c4350ceb076283e Author: Cameron Berkenpas Date: Sun Oct 10 15:54:11 2021 -0700 ALSA: hda/realtek: Fix for quirk to enable speaker output on the Lenovo 13s Gen2 The previous patch's HDA verb initialization for the Lenovo 13s sequence was slightly off. This updated verb sequence has been tested and confirmed working. Fixes: ad7cc2d41b7a ("ALSA: hda/realtek: Quirks to enable speaker output for Lenovo Legion 7i 15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 laptops.") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208555 Cc: Signed-off-by: Cameron Berkenpas Link: https://lore.kernel.org/r/20211010225410.23423-1-cam@neo-zeon.de Signed-off-by: Takashi Iwai commit 209ee634bc0d2fa10ac8f799abf09207b5ce489a Merge: 64570fbc14f8d eb7b52e6db7c2 Author: Arnd Bergmann Date: Mon Oct 11 10:04:23 2021 +0200 Merge tag 'ffa-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm FF-A driver fixes for v5.15 Couple of fixes addressing issues when FFA driver is build as a module. One adds the device unregistration which was missing and causes issue when loading the module second time after unloading once. Another one adds the missing remove callback on the ffa bus which was missing due to which modules depending on FFA(e.g. OPTEE) will fail to remove the device and faults next time that module is loaded again. * tag 'ffa-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Fix __ffa_devices_unregister firmware: arm_ffa: Add missing remove callback to ffa_bus_type Link: https://lore.kernel.org/r/20211006153231.4061789-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit ea0f69d8211963c4b2cc1998b86779a500adb502 Author: Nikolay Martynov Date: Fri Oct 8 12:25:47 2021 +0300 xhci: Enable trust tx length quirk for Fresco FL11 USB controller Tested on SD5200T TB3 dock which has Fresco Logic FL1100 USB 3.0 Host Controller. Before this patch streaming video from USB cam made mouse and keyboard connected to the same USB bus unusable. Also video was jerky. With this patch streaming video doesn't have any effect on other periferals and video is smooth. Cc: stable@vger.kernel.org Signed-off-by: Nikolay Martynov Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211008092547.3996295-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit ff0e50d3564f33b7f4b35cadeabd951d66cfc570 Author: Pavankumar Kondeti Date: Fri Oct 8 12:25:46 2021 +0300 xhci: Fix command ring pointer corruption while aborting a command The command ring pointer is located at [6:63] bits of the command ring control register (CRCR). All the control bits like command stop, abort are located at [0:3] bits. While aborting a command, we read the CRCR and set the abort bit and write to the CRCR. The read will always give command ring pointer as all zeros. So we essentially write only the control bits. Since we split the 64 bit write into two 32 bit writes, there is a possibility of xHC command ring stopped before the upper dword (all zeros) is written. If that happens, xHC updates the upper dword of its internal command ring pointer with all zeros. Next time, when the command ring is restarted, we see xHC memory access failures. Fix this issue by only writing to the lower dword of CRCR where all control bits are located. Cc: stable@vger.kernel.org Signed-off-by: Pavankumar Kondeti Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211008092547.3996295-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 880de403777376e50bdf60def359fa50a722006f Author: Johan Hovold Date: Fri Oct 8 12:25:45 2021 +0300 USB: xhci: dbc: fix tty registration race Make sure to allocate resources before registering the tty device to avoid having a racing open() and write() fail to enable rx or dereference a NULL pointer when accessing the uninitialised fifo. Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Cc: stable@vger.kernel.org # 4.16 Cc: Lu Baolu Signed-off-by: Johan Hovold Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211008092547.3996295-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5255660b208aebfdb71d574f3952cf48392f4306 Author: Jonathan Bell Date: Fri Oct 8 12:25:44 2021 +0300 xhci: add quirk for host controllers that don't update endpoint DCS Seen on a VLI VL805 PCIe to USB controller. For non-stream endpoints at least, if the xHC halts on a particular TRB due to an error then the DCS field in the Out Endpoint Context maintained by the hardware is not updated with the current cycle state. Using the quirk XHCI_EP_CTX_BROKEN_DCS and instead fetch the DCS bit from the TRB that the xHC stopped on. [ bjorn: rebased to v5.14-rc2 ] Link: https://github.com/raspberrypi/linux/issues/3060 Cc: stable@vger.kernel.org Signed-off-by: Jonathan Bell Signed-off-by: Bjørn Mork Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211008092547.3996295-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a01ba2a3378be85538e0183ae5367c1bc1d5aaf3 Author: Jonathan Bell Date: Fri Oct 8 12:25:43 2021 +0300 xhci: guard accesses to ep_state in xhci_endpoint_reset() See https://github.com/raspberrypi/linux/issues/3981 Two read-modify-write cycles on ep->ep_state are not guarded by xhci->lock. Fix these. Fixes: f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Bell Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211008092547.3996295-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b26503b15631229583e925de774e95b11d8144e8 Author: Colin Ian King Date: Wed Oct 6 18:28:30 2021 +0100 tracing: Fix missing * in comment block There is a missing * in a comment block, add it in. Link: https://lkml.kernel.org/r/20211006172830.1025336-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Steven Rostedt (VMware) commit 1ae43851b18afe861120ebd7c426dc44f06bb2bd Author: Masami Hiramatsu Date: Thu Sep 16 15:23:12 2021 +0900 bootconfig: init: Fix memblock leak in xbc_make_cmdline() Free unused memblock in a error case to fix memblock leak in xbc_make_cmdline(). Link: https://lkml.kernel.org/r/163177339181.682366.8713781325929549256.stgit@devnote2 Fixes: 51887d03aca1 ("bootconfig: init: Allow admin to use bootconfig for kernel command line") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 6675880fc4b7c5137a2640b0725505c21b1ac525 Author: Vamshi K Sthambamkadi Date: Fri Oct 8 12:48:06 2021 +0530 tracing: Fix memory leak in eprobe_register() kmemleak report: unreferenced object 0xffff900a70ec7ec0 (size 32): comm "ftracetest", pid 2770, jiffies 4295042510 (age 311.464s) hex dump (first 32 bytes): c8 31 23 45 0a 90 ff ff 40 85 c7 6e 0a 90 ff ff .1#E....@..n.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000009d3751fd>] kmem_cache_alloc_trace+0x2a2/0x440 [<0000000088b8124b>] eprobe_register+0x1e3/0x350 [<000000002a9a0517>] __ftrace_event_enable_disable+0x7c/0x240 [<0000000019109321>] event_enable_write+0x93/0xe0 [<000000007d85b320>] vfs_write+0xb9/0x260 [<00000000b94c5e41>] ksys_write+0x67/0xe0 [<000000005a08c81d>] __x64_sys_write+0x1a/0x20 [<00000000240bf576>] do_syscall_64+0x3b/0xc0 [<0000000043d5d9f6>] entry_SYSCALL_64_after_hwframe+0x44/0xae unreferenced object 0xffff900a56bbf280 (size 128): comm "ftracetest", pid 2770, jiffies 4295042510 (age 311.464s) hex dump (first 32 bytes): ff ff ff ff ff ff ff ff 00 00 00 00 01 00 00 00 ................ 80 69 3b b2 ff ff ff ff 20 69 3b b2 ff ff ff ff .i;..... i;..... backtrace: [<000000009d3751fd>] kmem_cache_alloc_trace+0x2a2/0x440 [<00000000c4e90fad>] eprobe_register+0x1fc/0x350 [<000000002a9a0517>] __ftrace_event_enable_disable+0x7c/0x240 [<0000000019109321>] event_enable_write+0x93/0xe0 [<000000007d85b320>] vfs_write+0xb9/0x260 [<00000000b94c5e41>] ksys_write+0x67/0xe0 [<000000005a08c81d>] __x64_sys_write+0x1a/0x20 [<00000000240bf576>] do_syscall_64+0x3b/0xc0 [<0000000043d5d9f6>] entry_SYSCALL_64_after_hwframe+0x44/0xae In new_eprobe_trigger(), allocated edata and trigger variables are never freed. To fix, free memory in disable_eprobe(). Link: https://lkml.kernel.org/r/20211008071802.GA2098@cosmos Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events") Signed-off-by: Vamshi K Sthambamkadi Signed-off-by: Steven Rostedt (VMware) commit 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc Author: Linus Torvalds Date: Sun Oct 10 17:01:59 2021 -0700 Linux 5.15-rc5 commit efb52a7d9511df818391f1afa459507425833438 Merge: 75cd9b0152d9a eb8257a12192f Author: Linus Torvalds Date: Sun Oct 10 10:12:42 2021 -0700 Merge tag 'powerpc-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "A bit of a big batch, partly because I didn't send any last week, and also just because the BPF fixes happened to land this week. Summary: - Fix a regression hit by the IPR SCSI driver, introduced by the recent addition of MSI domains on pseries. - A big series including 8 BPF fixes, some with potential security impact and the rest various code generation issues. - Fix our program check assembler entry path, which was accidentally jumping into a gas macro and generating strange stack frames, which could confuse find_bug(). - A couple of fixes, and related changes, to fix corner cases in our machine check handling. - Fix our DMA IOMMU ops, which were not always returning the optimal DMA mask, leading to at least one device falling back to 32-bit DMA when it shouldn't. - A fix for KUAP handling on 32-bit Book3S. - Fix crashes seen when kdumping on some pseries systems. Thanks to Naveen N. Rao, Nicholas Piggin, Alexey Kardashevskiy, Cédric Le Goater, Christophe Leroy, Mahesh Salgaonkar, Abdul Haleem, Christoph Hellwig, Johan Almbladh, Stan Johnson" * tag 'powerpc-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: pseries/eeh: Fix the kdump kernel crash during eeh_pseries_init powerpc/32s: Fix kuap_kernel_restore() powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler powerpc/64s: Fix unrecoverable MCE calling async handler from NMI powerpc/64/interrupt: Reconcile soft-mask state in NMI and fix false BUG powerpc/64: warn if local irqs are enabled in NMI or hardirq context powerpc/traps: do not enable irqs in _exception powerpc/64s: fix program check interrupt emergency stack path powerpc/bpf ppc32: Fix BPF_SUB when imm == 0x80000000 powerpc/bpf ppc32: Do not emit zero extend instruction for 64-bit BPF_END powerpc/bpf ppc32: Fix JMP32_JSET_K powerpc/bpf ppc32: Fix ALU32 BPF_ARSH operation powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC powerpc/security: Add a helper to query stf_barrier type powerpc/bpf: Fix BPF_SUB when imm == 0x80000000 powerpc/bpf: Fix BPF_MOD when imm == 1 powerpc/bpf: Validate branch ranges powerpc/lib: Add helper to check if offset is within conditional branch range powerpc/iommu: Report the correct most efficient DMA mask for PCI devices commit 75cd9b0152d9a46017eddfc3b80b1a00c921196a Merge: c22ccc4a3ef19 fe255fe6ad976 Author: Linus Torvalds Date: Sun Oct 10 10:05:39 2021 -0700 Merge tag 'objtool_urgent_for_v5.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: - Remove an extra section.len member in favour of section.sh_size - Align .altinstructions section creation with the kernel's by creating them with entry size of 0 - Fix objtool to convert a reloc symbol to a section offset and not to not warn about not knowing how * tag 'objtool_urgent_for_v5.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Remove redundant 'len' field from struct section objtool: Make .altinstructions section entry size consistent objtool: Remove reloc symbol type checks in get_alt_entry() commit c22ccc4a3ef198752855f44e9279732260c889d5 Merge: 7fd2bf83d59a2 d298b03506d3e Author: Linus Torvalds Date: Sun Oct 10 10:00:51 2021 -0700 Merge tag 'x86_urgent_for_v5.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - A FPU fix to properly handle invalid MXCSR values: 32-bit masks them out due to historical reasons and 64-bit kernels reject them - A fix to clear X86_FEATURE_SMAP when support for is not config-enabled - Three fixes correcting misspelled Kconfig symbols used in code - Two resctrl object cleanup fixes - Yet another attempt at fixing the neverending saga of botched x86 timers, this time because some incredibly smart hardware decides to turn off the HPET timer in a low power state - who cares if the OS is relying on it... - Check the full return value range of an SEV VMGEXIT call to determine whether it returned an error * tag 'x86_urgent_for_v5.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Restore the masking out of reserved MXCSR bits x86/Kconfig: Correct reference to MWINCHIP3D x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI x86/entry: Clear X86_FEATURE_SMAP when CONFIG_X86_SMAP=n x86/entry: Correct reference to intended CONFIG_64_BIT x86/resctrl: Fix kfree() of the wrong type in domain_add_cpu() x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails x86/hpet: Use another crystalball to evaluate HPET usability x86/sev: Return an error on a returned non-zero SW_EXITINFO1[31:0] commit 7fd2bf83d59a2d32e0d596c5d3e623b9a0e7e2d5 Merge: 0950fcbf992f5 fa1049135c15b Author: Linus Torvalds Date: Sat Oct 9 15:03:48 2021 -0700 Merge branch 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Three driver bugfixes and one leak fix for the core" * 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mlxcpld: Modify register setting for 400KHz frequency i2c: mlxcpld: Fix criteria for frequency setting i2c: mediatek: Add OFFSET_EXT_CONF setting back i2c: acpi: fix resource leak in reconfiguration device addition commit 0950fcbf992f578575f5387decb06f6496aab594 Merge: 50eb0a06e6cae 258aad75c6214 Author: Linus Torvalds Date: Sat Oct 9 14:57:26 2021 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Five fixes, all in drivers. The big change is the UFS task management rework, with lpfc next and the rest being fairly minor and obvious fixes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: iscsi: Fix iscsi_task use after free scsi: lpfc: Fix memory overwrite during FC-GS I/O abort handling scsi: elx: efct: Delete stray unlock statement scsi: ufs: core: Fix task management completion scsi: acornscsi: Remove scsi_cmd_to_tag() reference commit 50eb0a06e6cae01d8a8d63770030d01ac2fb572a Merge: c75de8453c3e2 1dbdd99b511c9 Author: Linus Torvalds Date: Sat Oct 9 14:51:59 2021 -0700 Merge tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Two small fixes for this release: - Add missing QUEUE_FLAG_HCTX_ACTIVE in the debugfs handling (Johannes) - Fix double free / UAF issue in __alloc_disk_node (Tetsuo)" * tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block: block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output block: genhd: fix double kfree() in __alloc_disk_node() commit c75de8453c3e2f8a8fcee9171118b7da29d3fb9c Merge: 717478d89fe22 64e7875560270 Author: Linus Torvalds Date: Sat Oct 9 10:17:17 2021 -0700 Merge tag '5.15-rc4-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd fixes from Steve French: "Six fixes for the ksmbd kernel server, including two additional overflow checks, a fix for oops, and some cleanup (e.g. remove dead code for less secure dialects that has been removed)" * tag '5.15-rc4-ksmbd-fixes' of git://git.samba.org/ksmbd: ksmbd: fix oops from fuse driver ksmbd: fix version mismatch with out of tree ksmbd: use buf_data_size instead of recalculation in smb3_decrypt_req() ksmbd: remove the leftover of smb2.0 dialect support ksmbd: check strictly data area in ksmbd_smb2_check_message() ksmbd: add the check to vaildate if stream protocol length exceeds maximum value commit 717478d89fe22df61a4ecf73b1adb31b5f8d1bba Merge: f84fc4e36cd81 3ef6ca4f354c5 Author: Linus Torvalds Date: Sat Oct 9 09:07:58 2021 -0700 Merge tag 'riscv-for-linus-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A pair of fixes (along with the necessory cleanup) to our VDSO, to avoid a locking during OOM and to prevent the text from overflowing into the data page - A fix to checksyscalls to teach it about our rv32 UABI - A fix to add clone3() to the rv32 UABI, which was pointed out by checksyscalls - A fix to properly flush the icache on the local CPU in addition to the remote CPUs * tag 'riscv-for-linus-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: checksyscalls: Unconditionally ignore fstat{,at}64 riscv: Flush current cpu icache before other cpus RISC-V: Include clone3() on rv32 riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable riscv/vdso: Move vdso data page up front riscv/vdso: Refactor asm/vdso.h commit 732b74d647048668f0f8dc0c848f0746c69e2e2f Author: Xuan Zhuo Date: Sat Oct 9 05:17:53 2021 -0400 virtio-net: fix for skb_over_panic inside big mode commit 126285651b7f ("Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net") accidentally reverted the effect of commit 1a8024239da ("virtio-net: fix for skb_over_panic inside big mode") on drivers/net/virtio_net.c As a result, users of crosvm (which is using large packet mode) are experiencing crashes with 5.14-rc1 and above that do not occur with 5.13. Crash trace: [ 61.346677] skbuff: skb_over_panic: text:ffffffff881ae2c7 len:3762 put:3762 head:ffff8a5ec8c22000 data:ffff8a5ec8c22010 tail:0xec2 end:0xec0 dev: [ 61.369192] kernel BUG at net/core/skbuff.c:111! [ 61.372840] invalid opcode: 0000 [#1] SMP PTI [ 61.374892] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.14.0-rc1 linux-v5.14-rc1-for-mesa-ci.tar.bz2 #1 [ 61.376450] Hardware name: ChromiumOS crosvm, BIOS 0 .. [ 61.393635] Call Trace: [ 61.394127] [ 61.394488] skb_put.cold+0x10/0x10 [ 61.395095] page_to_skb+0xf7/0x410 [ 61.395689] receive_buf+0x81/0x1660 [ 61.396228] ? netif_receive_skb_list_internal+0x1ad/0x2b0 [ 61.397180] ? napi_gro_flush+0x97/0xe0 [ 61.397896] ? detach_buf_split+0x67/0x120 [ 61.398573] virtnet_poll+0x2cf/0x420 [ 61.399197] __napi_poll+0x25/0x150 [ 61.399764] net_rx_action+0x22f/0x280 [ 61.400394] __do_softirq+0xba/0x257 [ 61.401012] irq_exit_rcu+0x8e/0xb0 [ 61.401618] common_interrupt+0x7b/0xa0 [ 61.402270] See https://lore.kernel.org/r/5edaa2b7c2fe4abd0347b8454b2ac032b6694e2c.camel%40collabora.com for the report. Apply the original 1a8024239da ("virtio-net: fix for skb_over_panic inside big mode") again, the original logic still holds: In virtio-net's large packet mode, there is a hole in the space behind buf. hdr_padded_len - hdr_len We must take this into account when calculating tailroom. Cc: Greg KH Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom") Fixes: 126285651b7f ("Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Xuan Zhuo Reported-by: Corentin Noël Tested-by: Corentin Noël Signed-off-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit f49823939e41121fdffada4d583e3e38d28336f9 Author: Florian Fainelli Date: Fri Oct 8 14:42:52 2021 -0700 net: phy: Do not shutdown PHYs in READY state In case a PHY device was probed thus in the PHY_READY state, but not configured and with no network device attached yet, we should not be trying to shut it down because it has been brought back into reset by phy_device_reset() towards the end of phy_probe() and anyway we have not configured the PHY yet. Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit a5a14ea7b4e55604acb0dc9d88fdb4cb6945bc77 Author: chongjiapeng Date: Sat Oct 9 16:09:26 2021 +0800 qed: Fix missing error code in qed_slowpath_start() The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc'. Eliminate the follow smatch warning: drivers/net/ethernet/qlogic/qed/qed_main.c:1298 qed_slowpath_start() warn: missing error code 'rc'. Reported-by: Abaci Robot Fixes: d51e4af5c209 ("qed: aRFS infrastructure support") Signed-off-by: chongjiapeng Signed-off-by: David S. Miller commit 1951b3f19cfe822709c890a337906823c223c7c3 Author: Vladimir Oltean Date: Sat Oct 9 15:26:07 2021 +0300 net: dsa: hold rtnl_lock in dsa_switch_setup_tag_protocol It was a documented fact that ds->ops->change_tag_protocol() offered rtnetlink mutex protection to the switch driver, since there was an ASSERT_RTNL right before the call in dsa_switch_change_tag_proto() (initiated from sysfs). The blamed commit introduced another call path for ds->ops->change_tag_protocol() which does not hold the rtnl_mutex. This is: dsa_tree_setup -> dsa_tree_setup_switches -> dsa_switch_setup -> dsa_switch_setup_tag_protocol -> ds->ops->change_tag_protocol() -> dsa_port_setup -> dsa_slave_create -> register_netdevice(slave_dev) -> dsa_tree_setup_master -> dsa_master_setup -> dev->dsa_ptr = cpu_dp The reason why the rtnl_mutex is held in the sysfs call path is to ensure that, once the master and all the DSA interfaces are down (which is required so that no packets flow), they remain down during the tagging protocol change. The above calling order illustrates the fact that it should not be risky to change the initial tagging protocol to the one specified in the device tree at the given time: - packets cannot enter the dsa_switch_rcv() packet type handler since netdev_uses_dsa() for the master will not yet return true, since dev->dsa_ptr has not yet been populated - packets cannot enter the dsa_slave_xmit() function because no DSA interface has yet been registered So from the DSA core's perspective, holding the rtnl_mutex is indeed not necessary. Yet, drivers may need to do things which need rtnl_mutex protection. For example: felix_set_tag_protocol -> felix_setup_tag_8021q -> dsa_tag_8021q_register -> dsa_tag_8021q_setup -> dsa_tag_8021q_port_setup -> vlan_vid_add -> ASSERT_RTNL These drivers do not really have a choice to take the rtnl_mutex themselves, since in the sysfs case, the rtnl_mutex is already held. Fixes: deff710703d8 ("net: dsa: Allow default tag protocol to be overridden from DT") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6510e80a0b81b5d814e3aea6297ba42f5e76f73c Author: Zheyu Ma Date: Sat Oct 9 11:33:49 2021 +0000 isdn: mISDN: Fix sleeping function called from invalid context The driver can call card->isac.release() function from an atomic context. Fix this by calling this function after releasing the lock. The following log reveals it: [ 44.168226 ] BUG: sleeping function called from invalid context at kernel/workqueue.c:3018 [ 44.168941 ] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 5475, name: modprobe [ 44.169574 ] INFO: lockdep is turned off. [ 44.169899 ] irq event stamp: 0 [ 44.170160 ] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [ 44.170627 ] hardirqs last disabled at (0): [] copy_process+0x132d/0x3e00 [ 44.171240 ] softirqs last enabled at (0): [] copy_process+0x135a/0x3e00 [ 44.171852 ] softirqs last disabled at (0): [<0000000000000000>] 0x0 [ 44.172318 ] Preemption disabled at: [ 44.172320 ] [] nj_release+0x69/0x500 [netjet] [ 44.174441 ] Call Trace: [ 44.174630 ] dump_stack_lvl+0xa8/0xd1 [ 44.174912 ] dump_stack+0x15/0x17 [ 44.175166 ] ___might_sleep+0x3a2/0x510 [ 44.175459 ] ? nj_release+0x69/0x500 [netjet] [ 44.175791 ] __might_sleep+0x82/0xe0 [ 44.176063 ] ? start_flush_work+0x20/0x7b0 [ 44.176375 ] start_flush_work+0x33/0x7b0 [ 44.176672 ] ? trace_irq_enable_rcuidle+0x85/0x170 [ 44.177034 ] ? kasan_quarantine_put+0xaa/0x1f0 [ 44.177372 ] ? kasan_quarantine_put+0xaa/0x1f0 [ 44.177711 ] __flush_work+0x11a/0x1a0 [ 44.177991 ] ? flush_work+0x20/0x20 [ 44.178257 ] ? lock_release+0x13c/0x8f0 [ 44.178550 ] ? __kasan_check_write+0x14/0x20 [ 44.178872 ] ? do_raw_spin_lock+0x148/0x360 [ 44.179187 ] ? read_lock_is_recursive+0x20/0x20 [ 44.179530 ] ? __kasan_check_read+0x11/0x20 [ 44.179846 ] ? do_raw_spin_unlock+0x55/0x900 [ 44.180168 ] ? ____kasan_slab_free+0x116/0x140 [ 44.180505 ] ? _raw_spin_unlock_irqrestore+0x41/0x60 [ 44.180878 ] ? skb_queue_purge+0x1a3/0x1c0 [ 44.181189 ] ? kfree+0x13e/0x290 [ 44.181438 ] flush_work+0x17/0x20 [ 44.181695 ] mISDN_freedchannel+0xe8/0x100 [ 44.182006 ] isac_release+0x210/0x260 [mISDNipac] [ 44.182366 ] nj_release+0xf6/0x500 [netjet] [ 44.182685 ] nj_remove+0x48/0x70 [netjet] [ 44.182989 ] pci_device_remove+0xa9/0x250 Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller commit 5c976a56570f29aaf4a2f9a1bf99789c252183c9 Author: Shannon Nelson Date: Fri Oct 8 12:38:01 2021 -0700 ionic: don't remove netdev->dev_addr when syncing uc list Bridging, and possibly other upper stack gizmos, adds the lower device's netdev->dev_addr to its own uc list, and then requests it be deleted when the upper bridge device is removed. This delete request also happens with the bridging vlan_filtering is enabled and then disabled. Bonding has a similar behavior with the uc list, but since it also uses set_mac to manage netdev->dev_addr, it doesn't have the same the failure case. Because we store our netdev->dev_addr in our uc list, we need to ignore the delete request from dev_uc_sync so as to not lose the address and all hope of communicating. Note that ndo_set_mac_address is expressly changing netdev->dev_addr, so no limitation is set there. Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit be0499369d6376e70b5b80bbced94c0c32d508b1 Author: Haiyang Zhang Date: Fri Oct 8 06:11:31 2021 -0700 net: mana: Fix error handling in mana_create_rxq() Fix error handling in mana_create_rxq() when cq->gdma_id >= gc->max_num_cqs. Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Signed-off-by: Haiyang Zhang Link: https://lore.kernel.org/r/1633698691-31721-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Jakub Kicinski commit 1f3e2e97c003f80c4b087092b225c8787ff91e4d Author: Xiaolong Huang Date: Fri Oct 8 14:58:30 2021 +0800 isdn: cpai: check ctr->cnr to avoid array index out of bound The cmtp_add_connection() would add a cmtp session to a controller and run a kernel thread to process cmtp. __module_get(THIS_MODULE); session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", session->num); During this process, the kernel thread would call detach_capi_ctr() to detach a register controller. if the controller was not attached yet, detach_capi_ctr() would trigger an array-index-out-bounds bug. [ 46.866069][ T6479] UBSAN: array-index-out-of-bounds in drivers/isdn/capi/kcapi.c:483:21 [ 46.867196][ T6479] index -1 is out of range for type 'capi_ctr *[32]' [ 46.867982][ T6479] CPU: 1 PID: 6479 Comm: kcmtpd_ctr_0 Not tainted 5.15.0-rc2+ #8 [ 46.869002][ T6479] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 [ 46.870107][ T6479] Call Trace: [ 46.870473][ T6479] dump_stack_lvl+0x57/0x7d [ 46.870974][ T6479] ubsan_epilogue+0x5/0x40 [ 46.871458][ T6479] __ubsan_handle_out_of_bounds.cold+0x43/0x48 [ 46.872135][ T6479] detach_capi_ctr+0x64/0xc0 [ 46.872639][ T6479] cmtp_session+0x5c8/0x5d0 [ 46.873131][ T6479] ? __init_waitqueue_head+0x60/0x60 [ 46.873712][ T6479] ? cmtp_add_msgpart+0x120/0x120 [ 46.874256][ T6479] kthread+0x147/0x170 [ 46.874709][ T6479] ? set_kthread_struct+0x40/0x40 [ 46.875248][ T6479] ret_from_fork+0x1f/0x30 [ 46.875773][ T6479] Signed-off-by: Xiaolong Huang Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211008065830.305057-1-butterflyhuangxx@gmail.com Signed-off-by: Jakub Kicinski commit f84fc4e36cd816d2d5dff0541f32fed411b0355f Merge: 5d6ab0bb408ff a46044a92add6 Author: Linus Torvalds Date: Fri Oct 8 16:46:09 2021 -0700 Merge tag 's390-5.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Fix potential memory leak on a error path in eBPF - Fix handling of zpci device on reserve * tag 's390-5.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/pci: fix zpci_zdev_put() on reserve bpf, s390: Fix potential memory leak about jit_data commit 14132690860e4d06aa3e1c4d7d8e9866ba7756dd Author: Sebastian Andrzej Siewior Date: Thu Oct 7 19:49:57 2021 +0200 mqprio: Correct stats in mqprio_dump_class_stats(). Introduction of lockless subqueues broke the class statistics. Before the change stats were accumulated in `bstats' and `qstats' on the stack which was then copied to struct gnet_dump. After the change the `bstats' and `qstats' are initialized to 0 and never updated, yet still fed to gnet_dump. The code updates the global qdisc->cpu_bstats and qdisc->cpu_qstats instead, clobbering them. Most likely a copy-paste error from the code in mqprio_dump(). __gnet_stats_copy_basic() and __gnet_stats_copy_queue() accumulate the values for per-CPU case but for global stats they overwrite the value, so only stats from the last loop iteration / tc end up in sch->[bq]stats. Use the on-stack [bq]stats variables again and add the stats manually in the global case. Fixes: ce679e8df7ed2 ("net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio") Cc: John Fastabend Signed-off-by: Sebastian Andrzej Siewior https://lore.kernel.org/all/20211007175000.2334713-2-bigeasy@linutronix.de/ Signed-off-by: Jakub Kicinski commit bccf56c4cbf18db7170350f18fa7d0530cce0ddc Merge: 1b1499a817c90 5bded8259ee38 Author: Jakub Kicinski Date: Fri Oct 8 15:47:48 2021 -0700 Merge branch 'dsa-bridge-tx-forwarding-offload-fixes-part-1' Vladimir Oltean says: ==================== DSA bridge TX forwarding offload fixes - part 1 This is part 1 of a series of fixes to the bridge TX forwarding offload feature introduced for v5.15. Sadly, the other fixes are so intrusive that they cannot be reasonably be sent to the "net" tree, as they also include API changes. So they are left as part 2 for net-next. ==================== Link: https://lore.kernel.org/r/20211007164711.2897238-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 5bded8259ee3815a91791462dfb3312480779c3d Author: Vladimir Oltean Date: Thu Oct 7 19:47:11 2021 +0300 net: dsa: mv88e6xxx: isolate the ATU databases of standalone and bridged ports Similar to commit 6087175b7991 ("net: dsa: mt7530: use independent VLAN learning on VLAN-unaware bridges"), software forwarding between an unoffloaded LAG port (a bonding interface with an unsupported policy) and a mv88e6xxx user port directly under a bridge is broken. We adopt the same strategy, which is to make the standalone ports not find any ATU entry learned on a bridge port. Theory: the mv88e6xxx ATU is looked up by FID and MAC address. There are as many FIDs as VIDs (4096). The FID is derived from the VID when possible (the VTU maps a VID to a FID), with a fallback to the port based default FID value when not (802.1Q Mode is disabled on the port, or the classified VID isn't present in the VTU). The mv88e6xxx driver makes the following use of FIDs and VIDs: - the port's DefaultVID (to which untagged & pvid-tagged packets get classified) is 0 and is absent from the VTU, so this kind of packets is processed in FID 0, the default FID assigned by mv88e6xxx_setup_port. - every time a bridge VLAN is created, mv88e6xxx_port_vlan_join() -> mv88e6xxx_atu_new() associates a FID with that VID which increases linearly starting from 1. Like this: bridge vlan add dev lan0 vid 100 # FID 1 bridge vlan add dev lan1 vid 100 # still FID 1 bridge vlan add dev lan2 vid 1024 # FID 2 The FID allocation made by the driver is sub-optimal for the following reasons: (a) A standalone port has a DefaultPVID of 0 and a default FID of 0 too. A VLAN-unaware bridged port has a DefaultPVID of 0 and a default FID of 0 too. The difference is that the bridged ports may learn ATU entries, while the standalone port has the requirement that it must not, and must not find them either. Standalone ports must not use the same FID as ports belonging to a bridge. All standalone ports can use the same FID, since the ATU will never have an entry in that FID. (b) Multiple VLAN-unaware bridges will all use a DefaultPVID of 0 and a default FID of 0 on all their ports. The FDBs will not be isolated between these bridges. Every VLAN-unaware bridge must use the same FID on all its ports, different from the FID of other bridge ports. (c) Each bridge VLAN uses a unique FID which is useful for Independent VLAN Learning, but the same VLAN ID on multiple VLAN-aware bridges will result in the same FID being used by mv88e6xxx_atu_new(). The correct behavior is for VLAN 1 in br0 to have a different FID compared to VLAN 1 in br1. This patch cannot fix all the above. Traditionally the DSA framework did not care about this, and the reality is that DSA core involvement is needed for the aforementioned issues to be solved. The only thing we can solve here is an issue which does not require API changes, and that is issue (a), aka use a different FID for standalone ports vs ports under VLAN-unaware bridges. The first step is deciding what VID and FID to use for standalone ports, and what VID and FID for bridged ports. The 0/0 pair for standalone ports is what they used up till now, let's keep using that. For bridged ports, there are 2 cases: - VLAN-aware ports will never end up using the port default FID, because packets will always be classified to a VID in the VTU or dropped otherwise. The FID is the one associated with the VID in the VTU. - On VLAN-unaware ports, we _could_ leave their DefaultVID (pvid) at zero (just as in the case of standalone ports), and just change the port's default FID from 0 to a different number (say 1). However, Tobias points out that there is one more requirement to cater to: cross-chip bridging. The Marvell DSA header does not carry the FID in it, only the VID. So once a packet crosses a DSA link, if it has a VID of zero it will get classified to the default FID of that cascade port. Relying on a port default FID for upstream cascade ports results in contradictions: a default FID of 0 breaks ATU isolation of bridged ports on the downstream switch, a default FID of 1 breaks standalone ports on the downstream switch. So not only must standalone ports have different FIDs compared to bridged ports, they must also have different DefaultVID values. IEEE 802.1Q defines two reserved VID values: 0 and 4095. So we simply choose 4095 as the DefaultVID of ports belonging to VLAN-unaware bridges, and VID 4095 maps to FID 1. For the xmit operation to look up the same ATU database, we need to put VID 4095 in DSA tags sent to ports belonging to VLAN-unaware bridges too. All shared ports are configured to map this VID to the bridging FID, because they are members of that VLAN in the VTU. Shared ports don't need to have 802.1QMode enabled in any way, they always parse the VID from the DSA header, they don't need to look at the 802.1Q header. We install VID 4095 to the VTU in mv88e6xxx_setup_port(), with the mention that mv88e6xxx_vtu_setup() which was located right below that call was flushing the VTU so those entries wouldn't be preserved. So we need to relocate the VTU flushing prior to the port initialization during ->setup(). Also note that this is why it is safe to assume that VID 4095 will get associated with FID 1: the user ports haven't been created, so there is no avenue for the user to create a bridge VLAN which could otherwise race with the creation of another FID which would otherwise use up the non-reserved FID value of 1. [ Currently mv88e6xxx_port_vlan_join() doesn't have the option of specifying a preferred FID, it always calls mv88e6xxx_atu_new(). ] mv88e6xxx_port_db_load_purge() is the function to access the ATU for FDB/MDB entries, and it used to determine the FID to use for VLAN-unaware FDB entries (VID=0) using mv88e6xxx_port_get_fid(). But the driver only called mv88e6xxx_port_set_fid() once, during probe, so no surprises, the port FID was always 0, the call to get_fid() was redundant. As much as I would have wanted to not touch that code, the logic is broken when we add a new FID which is not the port-based default. Now the port-based default FID only corresponds to standalone ports, and FDB/MDB entries belong to the bridging service. So while in the future, when the DSA API will support FDB isolation, we will have to figure out the FID based on the bridge number, for now there's a single bridging FID, so hardcode that. Lastly, the tagger needs to check, when it is transmitting a VLAN untagged skb, whether it is sending it towards a bridged or a standalone port. When we see it is bridged we assume the bridge is VLAN-unaware. Not because it cannot be VLAN-aware but: - if we are transmitting from a VLAN-aware bridge we are likely doing so using TX forwarding offload. That code path guarantees that skbs have a vlan hwaccel tag in them, so we would not enter the "else" branch of the "if (skb->protocol == htons(ETH_P_8021Q))" condition. - if we are transmitting on behalf of a VLAN-aware bridge but with no TX forwarding offload (no PVT support, out of space in the PVT, whatever), we would indeed be transmitting with VLAN 4095 instead of the bridge device's pvid. However we would be injecting a "From CPU" frame, and the switch won't learn from that - it only learns from "Forward" frames. So it is inconsequential for address learning. And VLAN 4095 is absolutely enough for the frame to exit the switch, since we never remove that VLAN from any port. Fixes: 57e661aae6a8 ("net: dsa: mv88e6xxx: Link aggregation support") Reported-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 8b6836d824702cacf68190982181f8ca3aff9c3e Author: Vladimir Oltean Date: Thu Oct 7 19:47:10 2021 +0300 net: dsa: mv88e6xxx: keep the pvid at 0 when VLAN-unaware The VLAN support in mv88e6xxx has a loaded history. Commit 2ea7a679ca2a ("net: dsa: Don't add vlans when vlan filtering is disabled") noticed some issues with VLAN and decided the best way to deal with them was to make the DSA core ignore VLANs added by the bridge while VLAN awareness is turned off. Those issues were never explained, just presented as "at least one corner case". That approach had problems of its own, presented by commit 54a0ed0df496 ("net: dsa: provide an option for drivers to always receive bridge VLANs") for the DSA core, followed by commit 1fb74191988f ("net: dsa: mv88e6xxx: fix vlan setup") which applied ds->configure_vlan_while_not_filtering = true for mv88e6xxx in particular. We still don't know what corner case Andrew saw when he wrote commit 2ea7a679ca2a ("net: dsa: Don't add vlans when vlan filtering is disabled"), but Tobias now reports that when we use TX forwarding offload, pinging an external station from the bridge device is broken if the front-facing DSA user port has flooding turned off. The full description is in the link below, but for short, when a mv88e6xxx port is under a VLAN-unaware bridge, it inherits that bridge's pvid. So packets ingressing a user port will be classified to e.g. VID 1 (assuming that value for the bridge_default_pvid), whereas when tag_dsa.c xmits towards a user port, it always sends packets using a VID of 0 if that port is standalone or under a VLAN-unaware bridge - or at least it did so prior to commit d82f8ab0d874 ("net: dsa: tag_dsa: offload the bridge forwarding process"). In any case, when there is a conversation between the CPU and a station connected to a user port, the station's MAC address is learned in VID 1 but the CPU tries to transmit through VID 0. The packets reach the intended station, but via flooding and not by virtue of matching the existing ATU entry. DSA has established (and enforced in other drivers: sja1105, felix, mt7530) that a VLAN-unaware port should use a private pvid, and not inherit the one from the bridge. The bridge's pvid should only be inherited when that bridge is VLAN-aware, so all state transitions need to be handled. On the other hand, all bridge VLANs should sit in the VTU starting with the moment when the bridge offloads them via switchdev, they are just not used. This solves the problem that Tobias sees because packets ingressing on VLAN-unaware user ports now get classified to VID 0, which is also the VID used by tag_dsa.c on xmit. Fixes: d82f8ab0d874 ("net: dsa: tag_dsa: offload the bridge forwarding process") Link: https://patchwork.kernel.org/project/netdevbpf/patch/20211003222312.284175-2-vladimir.oltean@nxp.com/#24491503 Reported-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit c7709a02c18aabebc3b2988d24661763a0449443 Author: Vladimir Oltean Date: Thu Oct 7 19:47:09 2021 +0300 net: dsa: tag_dsa: send packets with TX fwd offload from VLAN-unaware bridges using VID 0 The present code is structured this way due to an incomplete thought process. In Documentation/networking/switchdev.rst we document that if a bridge is VLAN-unaware, then the presence or lack of a pvid on a bridge port (or on the bridge itself, for that matter) should not affect the ability to receive and transmit tagged or untagged packets. If the bridge on behalf of which we are sending this packet is VLAN-aware, then the TX forwarding offload API ensures that the skb will be VLAN-tagged (if the packet was sent by user space as untagged, it will get transmitted town to the driver as tagged with the bridge device's pvid). But if the bridge is VLAN-unaware, it may or may not be VLAN-tagged. In fact the logic to insert the bridge's PVID came from the idea that we should emulate what is being done in the VLAN-aware case. But we shouldn't. It appears that injecting packets using a VLAN ID of 0 serves the purpose of forwarding the packets to the egress port with no VLAN tag added or stripped by the hardware, and no filtering being performed. So we can simply remove the superfluous logic. One reason why this logic is broken is that when CONFIG_BRIDGE_VLAN_FILTERING=n, we call br_vlan_get_pvid_rcu() but that returns an error and we do error out, dropping all packets on xmit. Not really smart. This is also an issue when the user deletes the bridge pvid: $ bridge vlan del dev br0 vid 1 self As mentioned, in both cases, packets should still flow freely, and they do just that on any net device where the bridge is not offloaded, but on mv88e6xxx they don't. Fixes: d82f8ab0d874 ("net: dsa: tag_dsa: offload the bridge forwarding process") Reported-by: Andrew Lunn Link: https://patchwork.kernel.org/project/netdevbpf/patch/20211003155141.2241314-1-andrew@lunn.ch/ Link: https://patchwork.kernel.org/project/netdevbpf/patch/20210928233708.1246774-1-vladimir.oltean@nxp.com/ Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 1bec0f05062cf21e78093b1c4a2ae744e2873b8a Author: Vladimir Oltean Date: Thu Oct 7 19:47:08 2021 +0300 net: dsa: fix bridge_num not getting cleared after ports leaving the bridge The dp->bridge_num is zero-based, with -1 being the encoding for an invalid value. But dsa_bridge_num_put used to check for an invalid value by comparing bridge_num with 0, which is of course incorrect. The result is that the bridge_num will never get cleared by dsa_bridge_num_put, and further port joins to other bridges will get a bridge_num larger than the previous one, and once all the available bridges with TX forwarding offload supported by the hardware get exhausted, the TX forwarding offload feature is simply disabled. In the case of sja1105, 7 iterations of the loop below are enough to exhaust the TX forwarding offload bits, and further bridge joins operate without that feature. ip link add br0 type bridge vlan_filtering 1 while :; do ip link set sw0p2 master br0 && sleep 1 ip link set sw0p2 nomaster && sleep 1 done This issue is enough of an indication that having the dp->bridge_num invalid encoding be a negative number is prone to bugs, so this will be changed to a one-based value, with the dp->bridge_num of zero being the indication of no bridge. However, that is material for net-next. Fixes: f5e165e72b29 ("net: dsa: track unique bridge numbers across all DSA switch trees") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 5d6ab0bb408ffdaac585982faa9ec8c7d5cc349f Merge: 3946b46cab8b4 012e974501a27 Author: Linus Torvalds Date: Fri Oct 8 13:05:39 2021 -0700 Merge tag 'xtensa-20211008' of git://github.com/jcmvbkbc/linux-xtensa Pull xtensa fixes from Max Filippov: - fix build/boot issues caused by CONFIG_OF vs CONFIC_USE_OF usage - fix reset handler for xtfpga boards * tag 'xtensa-20211008' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: xtfpga: Try software restart before simulating CPU reset xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF xtensa: call irqchip_init only when CONFIG_USE_OF is selected xtensa: use CONFIG_USE_OF instead of CONFIG_OF commit 3946b46cab8b4714a9274af91772b9ad17a10e12 Merge: 0dcf60d001400 319933a80fd4f Author: Linus Torvalds Date: Fri Oct 8 12:55:23 2021 -0700 Merge tag 'for-linus-5.15b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - fix two minor issues in the Xen privcmd driver plus a cleanup patch for that driver - fix multiple issues related to running as PVH guest and some related earlyprintk fixes for other Xen guest types - fix an issue introduced in 5.15 the Xen balloon driver * tag 'for-linus-5.15b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/balloon: fix cancelled balloon action xen/x86: adjust data placement x86/PVH: adjust function/data placement xen/x86: hook up xen_banner() also for PVH xen/x86: generalize preferred console model from PV to PVH Dom0 xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU xen/x86: allow "earlyprintk=xen" to work for PV Dom0 xen/x86: make "earlyprintk=xen" work better for PVH Dom0 xen/x86: allow PVH Dom0 without XEN_PV=y xen/x86: prevent PVH type from getting clobbered xen/privcmd: drop "pages" parameter from xen_remap_pfn() xen/privcmd: fix error handling in mmap-resource processing xen/privcmd: replace kcalloc() by kvcalloc() when allocating empty pages commit 0dcf60d0014001a2dcae61169c8f72b775c2e48a Merge: cdc726fb35ede 2fbc349911e45 Author: Linus Torvalds Date: Fri Oct 8 11:57:54 2021 -0700 Merge tag 'asm-generic-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic fixes from Arnd Bergmann: "There is one build fix for Arm platforms that ended up impacting most architectures because of the way the drivers/firmware Kconfig file is wired up: The CONFIG_QCOM_SCM dependency have caused a number of randconfig regressions over time, and some still remain in v5.15-rc4. The fix we agreed on in the end is to make this symbol selected by any driver using it, and then building it even for non-Arm platforms with CONFIG_COMPILE_TEST. To make this work on all architectures, the drivers/firmware/Kconfig file needs to be included for all architectures to make the symbol itself visible. In a separate discussion, we found that a sound driver patch that is pending for v5.16 needs the same change to include this Kconfig file, so the easiest solution seems to have my Kconfig rework included in v5.15. Finally, the branch also includes a small unrelated build fix for NOMMU architectures" Link: https://lore.kernel.org/all/20210928153508.101208f8@canb.auug.org.au/ Link: https://lore.kernel.org/all/20210928075216.4193128-1-arnd@kernel.org/ Link: https://lore.kernel.org/all/20211007151010.333516-1-arnd@kernel.org/ * tag 'asm-generic-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic/io.h: give stub iounmap() on !MMU same prototype as elsewhere qcom_scm: hide Kconfig symbol firmware: include drivers/firmware/Kconfig unconditionally commit cdc726fb35ede5dad4ae362e35f3ee5507299030 Merge: 741668ef78320 3fb937f441c64 Author: Linus Torvalds Date: Fri Oct 8 11:49:30 2021 -0700 Merge tag 'acpi-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix a recent ACPI-related regression in the PCI subsystem that introduced a NULL pointer dereference possible to trigger from user space via sysfs on some systems" * tag 'acpi-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PCI: ACPI: Check parent pointer in acpi_pci_find_companion() commit 741668ef78320a2c1aacbfecea43ac884d989ec1 Merge: 9c7e7050f8769 58fc1daa4d2e9 Author: Linus Torvalds Date: Fri Oct 8 10:16:01 2021 -0700 Merge tag 'usb-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB fixes for 5.15-rc5 that resolve a number of reported issues: - gadget driver fixes - xhci build warning fixes - build configuration fix - cdc-acm tty handling fixes - cdc-wdm fix - typec fixes All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: cdc-acm: fix break reporting USB: cdc-acm: fix racy tty buffer accesses usb: gadget: f_uac2: fixed EP-IN wMaxPacketSize usb: cdc-wdm: Fix check for WWAN usb: chipidea: ci_hdrc_imx: Also search for 'phys' phandle usb: typec: tcpm: handle SRC_STARTUP state if cc changes usb: typec: tcpci: don't handle vSafe0V event if it's not enabled usb: typec: tipd: Remove dependency on "connector" child fwnode Partially revert "usb: Kconfig: using select for USB_COMMON dependency" usb: dwc3: gadget: Revert "set gadgets parent to the right controller" usb: xhci: tegra: mark PM functions as __maybe_unused commit 9c7e7050f876904e632cc57f7e842ae3874121df Merge: 0068dc8c96688 8a38a4d51c505 Author: Linus Torvalds Date: Fri Oct 8 10:08:58 2021 -0700 Merge tag 'mmc-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "A couple of MMC host fixes: - meson-gx: Fix read/write access for dram-access-quirk - sdhci-of-at91: Fix calibration sequence" * tag 'mmc-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk mmc: sdhci-of-at91: replace while loop with read_poll_timeout mmc: sdhci-of-at91: wait for calibration done before proceed commit 0068dc8c96688b72cc99470530b384429129950c Merge: 1da38549dd64c bf79045e0ef5f Author: Linus Torvalds Date: Fri Oct 8 09:58:50 2021 -0700 Merge tag 'drm-fixes-2021-10-08' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "I've returned from my tropical island retreat, even managed to bring one of my kids on a dive with some turtles. Thanks to Daniel for doing last week's work. Otherwise this is the weekly fixes pull, it's a bit bigger because the vc4 reverts in your tree caused some problems with fixes in the drm-misc tree so it got left out last week, so this week has the misc fixes rebased without the vc4 pieces. Otherwise it's i915, amdgpu with the usual fixes and a scattering over other drivers. I expect things should calm down a bit more next week. core: - Kconfig fix for fb_simple vs simpledrm. i915: - Fix RKL HDMI audio - Fix runtime pm imbalance on i915_gem_shrink() error path - Fix Type-C port access before hw/sw state sync - Fix VBT backlight struct version/size check - Fix VT-d async flip on SKL/BXT with plane stretch workaround amdgpu: - DCN 3.1 DP alt mode fixes - S0ix gfxoff fix - Fix DRM_AMD_DC_SI dependencies - PCIe DPC handling fix - DCN 3.1 scaling fix - Documentation fix amdkfd: - Fix potential memory leak - IOMMUv2 init fixes vc4 (there were some hdmi fixes but things got reverted, sort it out later): - compiler fix nouveau: - Cursor fix - Fix ttm buffer moves for ampere gpu's by adding minimal acceleration support. - memory leak fixes rockchip: - crtc/clk fixup panel: - ili9341 Fix DT bindings indent - y030xx067a - yellow tint init seq fix gbefb: - Fix gbefb when built with COMPILE_TEST" * tag 'drm-fixes-2021-10-08' of git://anongit.freedesktop.org/drm/drm: (33 commits) drm/amd/display: Fix detection of 4 lane for DPALT drm/amd/display: Limit display scaling to up to 4k for DCN 3.1 drm/amd/display: Skip override for preferred link settings during link training drm/nouveau/debugfs: fix file release memory leak drm/nouveau/kms/nv50-: fix file release memory leak drm/nouveau: avoid a use-after-free when BO init fails DRM: delete DRM IRQ legacy midlayer docs video: fbdev: gbefb: Only instantiate device when built for IP32 fbdev: simplefb: fix Kconfig dependencies drm/panel: abt-y030xx067a: yellow tint fix dt-bindings: panel: ili9341: correct indentation drm/nouveau/fifo/ga102: initialise chid on return from channel creation drm/rockchip: Update crtc fixup to account for fractional clk change drm/nouveau/ga102-: support ttm buffer moves via copy engine drm/nouveau/kms/tu102-: delay enabling cursor until after assign_windows drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup drm/vc4: hdmi: Remove unused struct drm/kmb: Enable alpha blended second plane drm/amdgpu: handle the case of pci_channel_io_frozen only in amdgpu_pci_resume drm/amdgpu: init iommu after amdkfd device init ... commit 1b1499a817c90fd1ce9453a2c98d2a01cca0e775 Author: Lin Ma Date: Thu Oct 7 19:44:30 2021 +0200 nfc: nci: fix the UAF of rf_conn_info object The nci_core_conn_close_rsp_packet() function will release the conn_info with given conn_id. However, it needs to set the rf_conn_info to NULL to prevent other routines like nci_rf_intf_activated_ntf_packet() to trigger the UAF. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lin Ma Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 95f7f3e7dc6bd2e735cb5de11734ea2222b1e05a Author: Karsten Graul Date: Thu Oct 7 16:14:40 2021 +0200 net/smc: improved fix wait on already cleared link Commit 8f3d65c16679 ("net/smc: fix wait on already cleared link") introduced link refcounting to avoid waits on already cleared links. This patch extents and improves the refcounting to cover all remaining possible cases for this kind of error situation. Fixes: 15e1b99aadfb ("net/smc: no WR buffer wait for terminating link group") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 097657c9a478df029e1d9b3602c3351e28927043 Merge: 612f71d7328c1 6636fec29cdf6 Author: David S. Miller Date: Fri Oct 8 16:22:55 2021 +0100 Merge branch 'stmmac-regression-fix' Merge branch 'stmmac-regression-fix' Herve Codina says: ==================== net: stmmac: fix regression on SPEAr3xx SOC The ethernet driver used on old SPEAr3xx soc was previously supported on old kernel. Some regressions were introduced during the different updates leading to a broken driver for this soc. This series fixes these regressions and brings back ethernet on SPEAr3xx. Tested on a SPEAr320 board. ==================== Signed-off-by: David S. Miller commit 6636fec29cdf6665bd219564609e8651f6ddc142 Author: Herve Codina Date: Fri Oct 8 12:34:40 2021 +0200 ARM: dts: spear3xx: Fix gmac node On SPEAr3xx, ethernet driver is not compatible with the SPEAr600 one. Indeed, SPEAr3xx uses an earlier version of this IP (v3.40) and needs some driver tuning compare to SPEAr600. The v3.40 IP support was added to stmmac driver and this patch fixes this issue and use the correct compatible string for SPEAr3xx Signed-off-by: Herve Codina Signed-off-by: David S. Miller commit 9cb1d19f47fafad7dcf7c8564e633440c946cfd7 Author: Herve Codina Date: Fri Oct 8 12:34:39 2021 +0200 net: stmmac: add support for dwmac 3.40a dwmac 3.40a is an old ip version that can be found on SPEAr3xx soc. Signed-off-by: Herve Codina Signed-off-by: David S. Miller commit 3781b6ad2ee1b1c3cf8b6523ac22a58f44c2c337 Author: Herve Codina Date: Fri Oct 8 12:34:38 2021 +0200 dt-bindings: net: snps,dwmac: add dwmac 3.40a IP version dwmac 3.40a is an old ip version that can be found on SPEAr3xx soc. Signed-off-by: Herve Codina Signed-off-by: David S. Miller commit 075da584bae2da6a37428d59a477b6bdad430ac3 Author: Herve Codina Date: Fri Oct 8 12:34:37 2021 +0200 net: stmmac: fix get_hw_feature() on old hardware Some old IPs do not provide the hardware feature register. On these IPs, this register is read 0x00000000. In old driver version, this feature was handled but a regression came with the commit f10a6a3541b4 ("stmmac: rework get_hw_feature function"). Indeed, this commit removes the return value in dma->get_hw_feature(). This return value was used to indicate the validity of retrieved information and used later on in stmmac_hw_init() to override priv->plat data if this hardware feature were valid. This patch restores the return code in ->get_hw_feature() in order to indicate the hardware feature validity and override priv->plat data only if this hardware feature is valid. Fixes: f10a6a3541b4 ("stmmac: rework get_hw_feature function") Signed-off-by: Herve Codina Signed-off-by: David S. Miller commit 612f71d7328c14369924384ad2170aae2a6abd92 Author: Paolo Abeni Date: Thu Oct 7 15:05:00 2021 -0700 mptcp: fix possible stall on recvmsg() recvmsg() can enter an infinite loop if the caller provides the MSG_WAITALL, the data present in the receive queue is not sufficient to fulfill the request, and no more data is received by the peer. When the above happens, mptcp_wait_data() will always return with no wait, as the MPTCP_DATA_READY flag checked by such function is set and never cleared in such code path. Leveraging the above syzbot was able to trigger an RCU stall: rcu: INFO: rcu_preempt self-detected stall on CPU rcu: 0-...!: (10499 ticks this GP) idle=0af/1/0x4000000000000000 softirq=10678/10678 fqs=1 (t=10500 jiffies g=13089 q=109) rcu: rcu_preempt kthread starved for 10497 jiffies! g13089 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=1 rcu: Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior. rcu: RCU grace-period kthread stack dump: task:rcu_preempt state:R running task stack:28696 pid: 14 ppid: 2 flags:0x00004000 Call Trace: context_switch kernel/sched/core.c:4955 [inline] __schedule+0x940/0x26f0 kernel/sched/core.c:6236 schedule+0xd3/0x270 kernel/sched/core.c:6315 schedule_timeout+0x14a/0x2a0 kernel/time/timer.c:1881 rcu_gp_fqs_loop+0x186/0x810 kernel/rcu/tree.c:1955 rcu_gp_kthread+0x1de/0x320 kernel/rcu/tree.c:2128 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 rcu: Stack dump where RCU GP kthread last ran: Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 CPU: 1 PID: 8510 Comm: syz-executor827 Not tainted 5.15.0-rc2-next-20210920-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:bytes_is_nonzero mm/kasan/generic.c:84 [inline] RIP: 0010:memory_is_nonzero mm/kasan/generic.c:102 [inline] RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:128 [inline] RIP: 0010:memory_is_poisoned mm/kasan/generic.c:159 [inline] RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline] RIP: 0010:kasan_check_range+0xc8/0x180 mm/kasan/generic.c:189 Code: 38 00 74 ed 48 8d 50 08 eb 09 48 83 c0 01 48 39 d0 74 7a 80 38 00 74 f2 48 89 c2 b8 01 00 00 00 48 85 d2 75 56 5b 5d 41 5c c3 <48> 85 d2 74 5e 48 01 ea eb 09 48 83 c0 01 48 39 d0 74 50 80 38 00 RSP: 0018:ffffc9000cd676c8 EFLAGS: 00000283 RAX: ffffed100e9a110e RBX: ffffed100e9a110f RCX: ffffffff88ea062a RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff888074d08870 RBP: ffffed100e9a110e R08: 0000000000000001 R09: ffff888074d08877 R10: ffffed100e9a110e R11: 0000000000000000 R12: ffff888074d08000 R13: ffff888074d08000 R14: ffff888074d08088 R15: ffff888074d08000 FS: 0000555556d8e300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 S: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000180 CR3: 0000000068909000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: instrument_atomic_read_write include/linux/instrumented.h:101 [inline] test_and_clear_bit include/asm-generic/bitops/instrumented-atomic.h:83 [inline] mptcp_release_cb+0x14a/0x210 net/mptcp/protocol.c:3016 release_sock+0xb4/0x1b0 net/core/sock.c:3204 mptcp_wait_data net/mptcp/protocol.c:1770 [inline] mptcp_recvmsg+0xfd1/0x27b0 net/mptcp/protocol.c:2080 inet6_recvmsg+0x11b/0x5e0 net/ipv6/af_inet6.c:659 sock_recvmsg_nosec net/socket.c:944 [inline] ____sys_recvmsg+0x527/0x600 net/socket.c:2626 ___sys_recvmsg+0x127/0x200 net/socket.c:2670 do_recvmmsg+0x24d/0x6d0 net/socket.c:2764 __sys_recvmmsg net/socket.c:2843 [inline] __do_sys_recvmmsg net/socket.c:2866 [inline] __se_sys_recvmmsg net/socket.c:2859 [inline] __x64_sys_recvmmsg+0x20b/0x260 net/socket.c:2859 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:0x7fc200d2dc39 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc5758e5a8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc200d2dc39 RDX: 0000000000000002 RSI: 00000000200017c0 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000f0b5ff R10: 0000000000000100 R11: 0000000000000246 R12: 0000000000000003 R13: 00007ffc5758e5d0 R14: 00007ffc5758e5c0 R15: 0000000000000003 Fix the issue by replacing the MPTCP_DATA_READY bit with direct inspection of the msk receive queue. Reported-and-tested-by: syzbot+3360da629681aa0d22fe@syzkaller.appspotmail.com Fixes: 7a6a6cbc3e59 ("mptcp: recvmsg() can drain data from multiple subflow") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 2fbc349911e45d4ea5187b608c8d58db66496260 Author: Adam Borowski Date: Sun Sep 12 23:26:06 2021 +0200 asm-generic/io.h: give stub iounmap() on !MMU same prototype as elsewhere It made -Werror sad. Signed-off-by: Adam Borowski Signed-off-by: Arnd Bergmann commit d298b03506d3e161f7492c440babb0bfae35e650 Author: Borislav Petkov Date: Wed Oct 6 18:33:52 2021 +0200 x86/fpu: Restore the masking out of reserved MXCSR bits Ser Olmy reported a boot failure: init[1] bad frame in sigreturn frame:(ptrval) ip:b7c9fbe6 sp:bf933310 orax:ffffffff \ in libc-2.33.so[b7bed000+156000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b CPU: 0 PID: 1 Comm: init Tainted: G W 5.14.9 #1 Hardware name: Hewlett-Packard HP PC/HP Board, BIOS JD.00.06 12/06/2001 Call Trace: dump_stack_lvl dump_stack panic do_exit.cold do_group_exit get_signal arch_do_signal_or_restart ? force_sig_info_to_task ? force_sig exit_to_user_mode_prepare syscall_exit_to_user_mode do_int80_syscall_32 entry_INT80_32 on an old 32-bit Intel CPU: vendor_id : GenuineIntel cpu family : 6 model : 6 model name : Celeron (Mendocino) stepping : 5 microcode : 0x3 Ser bisected the problem to the commit in Fixes. tglx suggested reverting the rejection of invalid MXCSR values which this commit introduced and replacing it with what the old code did - simply masking them out to zero. Further debugging confirmed his suggestion: fpu->state.fxsave.mxcsr: 0xb7be13b4, mxcsr_feature_mask: 0xffbf WARNING: CPU: 0 PID: 1 at arch/x86/kernel/fpu/signal.c:384 __fpu_restore_sig+0x51f/0x540 so restore the original behavior only for 32-bit kernels where you have ancient machines with buggy hardware. For 32-bit programs on 64-bit kernels, user space which supplies wrong MXCSR values is considered malicious so fail the sigframe restoration there. Fixes: 6f9866a166cd ("x86/fpu/signal: Let xrstor handle the features to init") Reported-by: Ser Olmy Signed-off-by: Borislav Petkov Tested-by: Ser Olmy Cc: Link: https://lkml.kernel.org/r/YVtA67jImg3KlBTw@zn.tnic commit bf79045e0ef5f0fb2a0619f9d0782665d07b2d66 Merge: b28a130f0bc6e 5a1fef027846e Author: Dave Airlie Date: Fri Oct 8 11:40:21 2021 +1000 Merge tag 'amd-drm-fixes-5.15-2021-10-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-10-06: amdgpu: - DCN 3.1 DP alt mode fixes - S0ix gfxoff fix - Fix DRM_AMD_DC_SI dependencies - PCIe DPC handling fix - DCN 3.1 scaling fix - Documentation fix amdkfd: - Fix potential memory leak - IOMMUv2 init fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211006203828.4818-1-alexander.deucher@amd.com commit b28a130f0bc6e79ba9b02fcc639bca2abd3b8361 Merge: 7d80cc702f046 f5a8703a9c418 Author: Dave Airlie Date: Fri Oct 8 11:34:31 2021 +1000 Merge tag 'drm-misc-fixes-2021-10-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Rebased drm-misc-fixes for v5.15-rc5: - Dropped vc4 patches. - Compiler fix for vc4. - Cursor fix for nouveau. - Fix ttm buffer moves for ampere gpu's by adding minimal acceleration support. - Small rockchip fixes. - Fix DT bindings indent for ili9341. - Fix y030xx067a init sequence to not get a yellow tint. - Kconfig fix for fb_simple vs simpledrm. - Assorted nouvaeu memory leaks. - Fix gbefb when built with COMPILE_TEST. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/3272bf72-2c37-31eb-404e-cf7edd485c7d@linux.intel.com commit 7d80cc702f046f34f346dcb0a45c439ef4044dcd Merge: 9e1ff307c779c b2d73debfdc16 Author: Dave Airlie Date: Fri Oct 8 10:53:12 2021 +1000 Merge tag 'drm-intel-fixes-2021-10-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15-rc5: - Fix RKL HDMI audio - Fix runtime pm imbalance on i915_gem_shrink() error path - Fix Type-C port access before hw/sw state sync - Fix VBT backlight struct version/size check - Fix VT-d async flip on SKL/BXT with plane stretch workaround Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87k0ipywo4.fsf@intel.com commit 3ef6ca4f354c53abf263cbeb51e7272523c294d8 Author: Palmer Dabbelt Date: Sat Oct 2 16:57:13 2021 -0700 checksyscalls: Unconditionally ignore fstat{,at}64 These can be replaced by statx(). Since rv32 has a 64-bit time_t we just never ended up with them in the first place. This is now an error due to -Werror. Suggested-by: Arnd Bergmann Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit 1da38549dd64c7f5dd22427f12dfa8db3d8a722b Merge: 3e899c7209dd8 c20106944eb67 Author: Linus Torvalds Date: Thu Oct 7 14:11:40 2021 -0700 Merge tag 'nfsd-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Bug fixes for NFSD error handling paths" * tag 'nfsd-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Keep existing listeners on portlist error SUNRPC: fix sign error causing rpcsec_gss drops nfsd: Fix a warning for nfsd_file_close_inode nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero nfsd: fix error handling of register_pernet_subsys() in init_nfsd() commit 3e899c7209dd8f7afca59518c5ace0f03385dbc3 Merge: 7041503d3a5c8 897c2e746cc79 Author: Linus Torvalds Date: Thu Oct 7 14:01:29 2021 -0700 Merge tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "This is a larger than normal update for Arm SoC specific code, most of it in device trees, but also drivers and the omap and at91/sama7 platforms: - There are four new entries to the MAINTAINERS file: Sven Peter and Alyssa Rosenzweig for Apple M1, Romain Perier for Mstar/sigmastar, and Vignesh Raghavendra for TI K3 - Build fixes to address randconfig warnings in sharpsl, dove, omap1, and qcom platforms as well as the scmi and op-tee subsystems - Regression fixes for missing CONFIG_FB and other options for several defconfigs - Several bug fixes for the newly added Microchip SAMA7 platform, mostly regarding power management - Missing SMP barriers to protect accesses to SCMI virtio device - Regression fixes for TI OMAP, including a boot-time hang on am335x. - Lots of bug fixes for NXP i.MX, mostly addressing incorrect settings in devicetree files, and one revert for broken suspend. - Fixes for ARM Juno/Vexpress devicetree files, addressing a couple of schema warnings. - Regression fixes for qualcomm SoC specific drivers and devicetree files, reverting an mdt_loader change and at least pastially reverting some of the 5.15 DTS changes, plus some minor bugfixes" * tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (64 commits) MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer firmware: arm_scmi: Add proper barriers to scmi virtio device firmware: arm_scmi: Simplify spinlocks in virtio transport ARM: dts: omap3430-sdp: Fix NAND device node bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 ARM: sharpsl_param: work around -Wstringop-overread warning ARM: defconfig: gemini: Restore framebuffer ARM: dove: mark 'putc' as inline ARM: omap1: move omap15xx local bus handling to usb.c MAINTAINERS: Add Vignesh to TI K3 platform maintainership arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence arm64: dts: ls1028a: fix eSDHC2 node arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2 ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs ARM: at91: pm: preload base address of controllers in tlb ARM: at91: pm: group constants and addresses loading ARM: dts: at91: sama7g5ek: add suspend voltage for ddr3l rail ... commit 4afb912f439c4bc4e6a4f3e7547f2e69e354108f Author: Josef Bacik Date: Tue Oct 5 16:35:27 2021 -0400 btrfs: fix abort logic in btrfs_replace_file_extents Error injection testing uncovered a case where we'd end up with a corrupt file system with a missing extent in the middle of a file. This occurs because the if statement to decide if we should abort is wrong. The only way we would abort in this case is if we got a ret != -EOPNOTSUPP and we called from the file clone code. However the prealloc code uses this path too. Instead we need to abort if there is an error, and the only error we _don't_ abort on is -EOPNOTSUPP and only if we came from the clone file code. CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Nikolay Borisov Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit cfd312695b71df04c3a2597859ff12c470d1e2e4 Author: Filipe Manana Date: Fri Oct 1 13:48:18 2021 +0100 btrfs: check for error when looking up inode during dir entry replay At replay_one_name(), we are treating any error from btrfs_lookup_inode() as if the inode does not exists. Fix this by checking for an error and returning it to the caller. CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8dcbc26194eb872cc3430550fb70bb461424d267 Author: Filipe Manana Date: Fri Oct 1 13:52:33 2021 +0100 btrfs: unify lookup return value when dir entry is missing btrfs_lookup_dir_index_item() and btrfs_lookup_dir_item() lookup for dir entries and both are used during log replay or when updating a log tree during an unlink. However when the dir item does not exists, btrfs_lookup_dir_item() returns NULL while btrfs_lookup_dir_index_item() returns PTR_ERR(-ENOENT), and if the dir item exists but there is no matching entry for a given name or index, both return NULL. This makes the call sites during log replay to be more verbose than necessary and it makes it easy to miss this slight difference. Since we don't need to distinguish between those two cases, make btrfs_lookup_dir_index_item() always return NULL when there is no matching directory entry - either because there isn't any dir entry or because there is one but it does not match the given name and index. Also rename the argument 'objectid' of btrfs_lookup_dir_index_item() to 'index' since it is supposed to match an index number, and the name 'objectid' is not very good because it can easily be confused with an inode number (like the inode number a dir entry points to). CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 52db77791fe24538c8aa2a183248399715f6b380 Author: Filipe Manana Date: Fri Oct 1 13:52:32 2021 +0100 btrfs: deal with errors when adding inode reference during log replay At __inode_add_ref(), we treating any error returned from btrfs_lookup_dir_item() or from btrfs_lookup_dir_index_item() as meaning that there is no existing directory entry in the fs/subvolume tree. This is not correct since we can get errors such as, for example, -EIO when reading extent buffers while searching the fs/subvolume's btree. So fix that and return the error to the caller when it is not -ENOENT. CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit e15ac6413745e3def00e663de00aea5a717311c1 Author: Filipe Manana Date: Fri Oct 1 13:52:31 2021 +0100 btrfs: deal with errors when replaying dir entry during log replay At replay_one_one(), we are treating any error returned from btrfs_lookup_dir_item() or from btrfs_lookup_dir_index_item() as meaning that there is no existing directory entry in the fs/subvolume tree. This is not correct since we can get errors such as, for example, -EIO when reading extent buffers while searching the fs/subvolume's btree. So fix that and return the error to the caller when it is not -ENOENT. CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 77a5b9e3d14cbce49ceed2766b2003c034c066dc Author: Filipe Manana Date: Fri Oct 1 13:52:30 2021 +0100 btrfs: deal with errors when checking if a dir entry exists during log replay Currently inode_in_dir() ignores errors returned from btrfs_lookup_dir_index_item() and from btrfs_lookup_dir_item(), treating any errors as if the directory entry does not exists in the fs/subvolume tree, which is obviously not correct, as we can get errors such as -EIO when reading extent buffers while searching the fs/subvolume's tree. Fix that by making inode_in_dir() return the errors and making its only caller, add_inode_ref(), deal with returned errors as well. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit d175209be04d7d263fa1a54cde7608c706c9d0d7 Author: Josef Bacik Date: Fri Oct 1 13:57:18 2021 -0400 btrfs: update refs for any root except tree log roots I hit a stuck relocation on btrfs/061 during my overnight testing. This turned out to be because we had left over extent entries in our extent root for a data reloc inode that no longer existed. This happened because in btrfs_drop_extents() we only update refs if we have SHAREABLE set or we are the tree_root. This regression was introduced by aeb935a45581 ("btrfs: don't set SHAREABLE flag for data reloc tree") where we stopped setting SHAREABLE for the data reloc tree. The problem here is we actually do want to update extent references for data extents in the data reloc tree, in fact we only don't want to update extent references if the file extents are in the log tree. Update this check to only skip updating references in the case of the log tree. This is relatively rare, because you have to be running scrub at the same time, which is what btrfs/061 does. The data reloc inode has its extents pre-allocated, and then we copy the extent into the pre-allocated chunks. We theoretically should never be calling btrfs_drop_extents() on a data reloc inode. The exception of course is with scrub, if our pre-allocated extent falls inside of the block group we are scrubbing, then the block group will be marked read only and we will be forced to cow that extent. This means we will call btrfs_drop_extents() on that range when we COW that file extent. This isn't really problematic if we do this, the data reloc inode requires that our extent lengths match exactly with the extent we are copying, thankfully we validate the extent is correct with get_new_location(), so if we happen to COW only part of the extent we won't link it in when we do the relocation, so we are safe from any other shenanigans that arise because of this interaction with scrub. Fixes: aeb935a45581 ("btrfs: don't set SHAREABLE flag for data reloc tree") CC: stable@vger.kernel.org # 5.8+ Reviewed-by: Qu Wenruo Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 19ea40dddf1833db868533958ca066f368862211 Author: Qu Wenruo Date: Tue Sep 14 14:57:59 2021 +0800 btrfs: unlock newly allocated extent buffer after error [BUG] There is a bug report that injected ENOMEM error could leave a tree block locked while we return to user-space: BTRFS info (device loop0): enabling ssd optimizations FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 7579 Comm: syz-executor Not tainted 5.15.0-rc1 #16 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8d/0xcf lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail+0x13c/0x160 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1328 slab_pre_alloc_hook.constprop.99+0x4e/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3120 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc+0x44/0x280 mm/slub.c:3219 btrfs_alloc_delayed_extent_op fs/btrfs/delayed-ref.h:299 [inline] btrfs_alloc_tree_block+0x38c/0x670 fs/btrfs/extent-tree.c:4833 __btrfs_cow_block+0x16f/0x7d0 fs/btrfs/ctree.c:415 btrfs_cow_block+0x12a/0x300 fs/btrfs/ctree.c:570 btrfs_search_slot+0x6b0/0xee0 fs/btrfs/ctree.c:1768 btrfs_insert_empty_items+0x80/0xf0 fs/btrfs/ctree.c:3905 btrfs_new_inode+0x311/0xa60 fs/btrfs/inode.c:6530 btrfs_create+0x12b/0x270 fs/btrfs/inode.c:6783 lookup_open+0x660/0x780 fs/namei.c:3282 open_last_lookups fs/namei.c:3352 [inline] path_openat+0x465/0xe20 fs/namei.c:3557 do_filp_open+0xe3/0x170 fs/namei.c:3588 do_sys_openat2+0x357/0x4a0 fs/open.c:1200 do_sys_open+0x87/0xd0 fs/open.c:1216 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x34/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x46ae99 Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f46711b9c48 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 000000000078c0a0 RCX: 000000000046ae99 RDX: 0000000000000000 RSI: 00000000000000a1 RDI: 0000000020005800 RBP: 00007f46711b9c80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000017 R13: 0000000000000000 R14: 000000000078c0a0 R15: 00007ffc129da6e0 ================================================ WARNING: lock held when returning to user space! 5.15.0-rc1 #16 Not tainted ------------------------------------------------ syz-executor/7579 is leaving the kernel with locks still held! 1 lock held by syz-executor/7579: #0: ffff888104b73da8 (btrfs-tree-01/1){+.+.}-{3:3}, at: __btrfs_tree_lock+0x2e/0x1a0 fs/btrfs/locking.c:112 [CAUSE] In btrfs_alloc_tree_block(), after btrfs_init_new_buffer(), the new extent buffer @buf is locked, but if later operations like adding delayed tree ref fail, we just free @buf without unlocking it, resulting above warning. [FIX] Unlock @buf in out_free_buf: label. Reported-by: Hao Sun Link: https://lore.kernel.org/linux-btrfs/CACkBjsZ9O6Zr0KK1yGn=1rQi6Crh1yeCRdTSBxx9R99L4xdn-Q@mail.gmail.com/ CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 897c2e746cc795870361fcf9cbf282524589fa5f Merge: 6aaa84343895a 56dd05023675a Author: Arnd Bergmann Date: Thu Oct 7 21:14:12 2021 +0200 Merge tag 'asahi-soc-fixes-5.15' of https://github.com/AsahiLinux/linux into arm/fixes Apple SoC fixes for 5.15; just two MAINTAINERS updates. - MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer - MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer * tag 'asahi-soc-fixes-5.15' of https://github.com/AsahiLinux/linux: MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer Link: https://lore.kernel.org/r/a50a9015-0e62-c451-4d0d-668233b35b85@marcan.st Signed-off-by: Arnd Bergmann commit 6aaa84343895a62add33c992b219f65be0d65c93 Merge: 3c7f58b35305b bf1acf809d569 Author: Arnd Bergmann Date: Thu Oct 7 21:14:03 2021 +0200 Merge tag 'scmi-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes SCMI fixes for v5.15 A few fixes addressing: - Kconfig dependency between VIRTIO and ARM_SCMI_PROTOCOL - Link-time error with __exit annotation for virtio_scmi_exit - Unnecessary nested irqsave/irqrestore spinlocks in virtio transport - Missing SMP barriers to protect accesses to SCMI virtio device * tag 'scmi-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Add proper barriers to scmi virtio device firmware: arm_scmi: Simplify spinlocks in virtio transport firmware: arm_scmi: Remove __exit annotation firmware: arm_scmi: Fix virtio transport Kconfig dependency Link: https://lore.kernel.org/r/20211007102822.27886-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 3c7f58b35305b51920cf98c328d6d1ab98670f79 Merge: 2250596374f5b 80d680fdccba2 Author: Arnd Bergmann Date: Thu Oct 7 21:13:57 2021 +0200 Merge tag 'omap-for-v5.15/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps for v5.15 Few regression fixes for omaps for the v5.15-rc cycle. There is a fix for boot time hangs that can happen on some am335x devices that started when the pruss devicetree nodes were added. The other fixes are less critical: - Fix compiler warning for sysc_init_soc() that got recently introduced - Fix external abort for am335x pruss as otherwise some am335x will hang - Use CLKDM_NOAUTO quirk also for dra7 dcan1 - Fix older NAND device node regression for omap3-sdp * tag 'omap-for-v5.15/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap3430-sdp: Fix NAND device node bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 soc: ti: omap-prm: Fix external abort for am335x pruss bus: ti-sysc: Add break in switch statement in sysc_init_soc() Link: https://lore.kernel.org/r/pull-1633609552-789682@atomide.com Signed-off-by: Arnd Bergmann commit 7041503d3a5c869e4b4934df57112ef90ce7e307 Merge: 14df9235aa99e 5c0522484eb54 Author: Linus Torvalds Date: Thu Oct 7 11:20:08 2021 -0700 Merge tag 'misc-fixes-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull netfslib, cachefiles and afs fixes from David Howells: - Fix another couple of oopses in cachefiles tracing stemming from the possibility of passing in a NULL object pointer - Fix netfs_clear_unread() to set READ on the iov_iter so that source it is passed to doesn't do the wrong thing (some drivers look at the flag on iov_iter rather than other available information to determine the direction) - Fix afs_launder_page() to write back at the correct file position on the server so as not to corrupt data * tag 'misc-fixes-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix afs_launder_page() to set correct start file position netfs: Fix READ/WRITE confusion when calling iov_iter_xarray() cachefiles: Fix oops with cachefiles_cull() due to NULL object commit 14df9235aa99e43ddeb78b8d2a78cf20c21a1114 Merge: 4a16df549d232 0b6c5371c03c2 Author: Linus Torvalds Date: Thu Oct 7 10:58:42 2021 -0700 Merge tag 'perf-tools-fixes-for-v5.15-2021-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix plugin static linking with libopencsd on ARM and ARM64 - Add missing -lstdc++ when linking with libopencsd - Add missing topdown metrics events to 'perf test attr' - Plug leak sys_event_tables list after processing JSON vendor events entries - Sync sound/asound.h copy with the kernel sources * tag 'perf-tools-fixes-for-v5.15-2021-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf tests attr: Add missing topdown metrics events tools include UAPI: Sync sound/asound.h copy with the kernel sources perf build: Fix plugin static linking with libopencsd on ARM and ARM64 perf build: Add missing -lstdc++ when linking with libopencsd perf jevents: Free the sys_event_tables list after processing entries commit 68a3765c659f809dcaac20030853a054646eb739 Author: Florian Westphal Date: Wed Oct 6 16:20:34 2021 +0200 netfilter: nf_tables: skip netdev events generated on netns removal syzbot reported following (harmless) WARN: WARNING: CPU: 1 PID: 2648 at net/netfilter/core.c:468 nft_netdev_unregister_hooks net/netfilter/nf_tables_api.c:230 [inline] nf_tables_unregister_hook include/net/netfilter/nf_tables.h:1090 [inline] __nft_release_basechain+0x138/0x640 net/netfilter/nf_tables_api.c:9524 nft_netdev_event net/netfilter/nft_chain_filter.c:351 [inline] nf_tables_netdev_event+0x521/0x8a0 net/netfilter/nft_chain_filter.c:382 reproducer: unshare -n bash -c 'ip link add br0 type bridge; nft add table netdev t ; \ nft add chain netdev t ingress \{ type filter hook ingress device "br0" \ priority 0\; policy drop\; \}' Problem is that when netns device exit hooks create the UNREGISTER event, the .pre_exit hook for nf_tables core has already removed the base hook. Notifier attempts to do this again. The need to do base hook unregister unconditionally was needed in the past, because notifier was last stage where reg->dev dereference was safe. Now that nf_tables does the hook removal in .pre_exit, this isn't needed anymore. Reported-and-tested-by: syzbot+154bd5be532a63aa778b@syzkaller.appspotmail.com Fixes: 767d1216bff825 ("netfilter: nftables: fix possible UAF over chains from packet path in netns") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 77076934afdcd46516caf18ed88b2f88025c9ddb Author: Vegard Nossum Date: Tue Oct 5 22:54:54 2021 +0200 netfilter: Kconfig: use 'default y' instead of 'm' for bool config option This option, NF_CONNTRACK_SECMARK, is a bool, so it can never be 'm'. Fixes: 33b8e77605620 ("[NETFILTER]: Add CONFIG_NETFILTER_ADVANCED option") Signed-off-by: Vegard Nossum Signed-off-by: Pablo Neira Ayuso commit 902c0b1887522a099aa4e1e6b4b476c2fe5dd13e Author: Juhee Kang Date: Mon Oct 4 21:14:38 2021 +0900 netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value Currently, when the rule related to IDLETIMER is added, idletimer_tg timer structure is initialized by kmalloc on executing idletimer_tg_create function. However, in this process timer->timer_type is not defined to a specific value. Thus, timer->timer_type has garbage value and it occurs kernel panic. So, this commit fixes the panic by initializing timer->timer_type using kzalloc instead of kmalloc. Test commands: # iptables -A OUTPUT -j IDLETIMER --timeout 1 --label test $ cat /sys/class/xt_idletimer/timers/test Killed Splat looks like: BUG: KASAN: user-memory-access in alarm_expires_remaining+0x49/0x70 Read of size 8 at addr 0000002e8c7bc4c8 by task cat/917 CPU: 12 PID: 917 Comm: cat Not tainted 5.14.0+ #3 79940a339f71eb14fc81aee1757a20d5bf13eb0e Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x6e/0x9c kasan_report.cold+0x112/0x117 ? alarm_expires_remaining+0x49/0x70 __asan_load8+0x86/0xb0 alarm_expires_remaining+0x49/0x70 idletimer_tg_show+0xe5/0x19b [xt_IDLETIMER 11219304af9316a21bee5ba9d58f76a6b9bccc6d] dev_attr_show+0x3c/0x60 sysfs_kf_seq_show+0x11d/0x1f0 ? device_remove_bin_file+0x20/0x20 kernfs_seq_show+0xa4/0xb0 seq_read_iter+0x29c/0x750 kernfs_fop_read_iter+0x25a/0x2c0 ? __fsnotify_parent+0x3d1/0x570 ? iov_iter_init+0x70/0x90 new_sync_read+0x2a7/0x3d0 ? __x64_sys_llseek+0x230/0x230 ? rw_verify_area+0x81/0x150 vfs_read+0x17b/0x240 ksys_read+0xd9/0x180 ? vfs_write+0x460/0x460 ? do_syscall_64+0x16/0xc0 ? lockdep_hardirqs_on+0x79/0x120 __x64_sys_read+0x43/0x50 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f0cdc819142 Code: c0 e9 c2 fe ff ff 50 48 8d 3d 3a ca 0a 00 e8 f5 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 RSP: 002b:00007fff28eee5b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f0cdc819142 RDX: 0000000000020000 RSI: 00007f0cdc032000 RDI: 0000000000000003 RBP: 00007f0cdc032000 R08: 00007f0cdc031010 R09: 0000000000000000 R10: 0000000000000022 R11: 0000000000000246 R12: 00005607e9ee31f0 R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 Fixes: 68983a354a65 ("netfilter: xtables: Add snapshot of hardidletimer target") Signed-off-by: Juhee Kang Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 136f282028dae7d9dd68469b197aa2b36b410992 Author: Miguel Bernal Marin Date: Wed Oct 6 00:13:18 2021 -0500 ACPI: tools: fix compilation error When ACPI tools are compiled, the following error is showed: $ cd tools/power/acpi $ make DESCEND tools/acpidbg MKDIR include CP include CC tools/acpidbg/acpidbg.o In file included from /home/linux/tools/power/acpi/include/acpi/platform/acenv.h:152, from /home/linux/tools/power/acpi/include/acpi/acpi.h:22, from acpidbg.c:9: /home/linux/tools/power/acpi/include/acpi/platform/acgcc.h:25:10: fatal error: linux/stdarg.h: No such file or directory 29 | #include | ^~~~~~~~~~~~~~~~ compilation terminated. Use the ACPICA logic: just identify when it is used inside the kernel or by an ACPI tool. Fixes: c0891ac15f04 ("isystem: ship and use stdarg.h") Signed-off-by: Miguel Bernal Marin [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 4a16df549d2326344bf4d669c5f70d3da447e207 Merge: 52bf8031c0646 8d6c414cd2fb7 Author: Linus Torvalds Date: Thu Oct 7 09:50:31 2021 -0700 Merge tag 'net-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from xfrm, bpf, netfilter, and wireless. Current release - regressions: - xfrm: fix XFRM_MSG_MAPPING ABI breakage caused by inserting a new value in the middle of an enum - unix: fix an issue in unix_shutdown causing the other end read/write failures - phy: mdio: fix memory leak Current release - new code bugs: - mlx5e: improve MQPRIO resiliency against bad configs Previous releases - regressions: - bpf: fix integer overflow leading to OOB access in map element pre-allocation - stmmac: dwmac-rk: fix ethernet on rk3399 based devices - netfilter: conntrack: fix boot failure with nf_conntrack.enable_hooks=1 - brcmfmac: revert using ISO3166 country code and 0 rev as fallback - i40e: fix freeing of uninitialized misc IRQ vector - iavf: fix double unlock of crit_lock Previous releases - always broken: - bpf, arm: fix register clobbering in div/mod implementation - netfilter: nf_tables: correct issues in netlink rule change event notifications - dsa: tag_dsa: fix mask for trunked packets - usb: r8152: don't resubmit rx immediately to avoid soft lockup on device unplug - i40e: fix endless loop under rtnl if FW fails to correctly respond to capability query - mlx5e: fix rx checksum offload coexistence with ipsec offload - mlx5: force round second at 1PPS out start time and allow it only in supported clock modes - phy: pcs: xpcs: fix incorrect CL37 AN sequence, EEE disable sequence Misc: - xfrm: slightly rejig the new policy uAPI to make it less cryptic" * tag 'net-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (66 commits) net: prefer socket bound to interface when not in VRF iavf: fix double unlock of crit_lock i40e: Fix freeing of uninitialized misc IRQ vector i40e: fix endless loop under rtnl dt-bindings: net: dsa: marvell: fix compatible in example ionic: move filter sync_needed bit set gve: report 64bit tx_bytes counter from gve_handle_report_stats() gve: fix gve_get_stats() rtnetlink: fix if_nlmsg_stats_size() under estimation gve: Properly handle errors in gve_assign_qpl gve: Avoid freeing NULL pointer gve: Correct available tx qpl check unix: Fix an issue in unix_shutdown causing the other end read/write failures net: stmmac: trigger PCS EEE to turn off on link down net: pcs: xpcs: fix incorrect steps on disable EEE netlink: annotate data races around nlk->bound net: pcs: xpcs: fix incorrect CL37 AN sequence net: sfp: Fix typo in state machine debug string net/sched: sch_taprio: properly cancel timer from taprio_destroy() net: bridge: fix under estimation in br_get_linkxstats_size() ... commit 52bf8031c06464268b1a7810946a54de5b088e81 Merge: 5af4055fa8133 f5c20e4a5f186 Author: Linus Torvalds Date: Thu Oct 7 09:44:48 2021 -0700 Merge tag 'hyperv-fixes-signed-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Replace uuid.h with types.h in a header (Andy Shevchenko) - Avoid sleeping in atomic context in PCI driver (Long Li) - Avoid sending IPI to self when it shouldn't (Vitaly Kuznetsov) * tag 'hyperv-fixes-signed-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: Avoid erroneously sending IPI to 'self' hyper-v: Replace uuid.h with types.h PCI: hv: Fix sleep while in non-sleep context when removing child devices from the bus commit 3fb937f441c64af1eec60bfd3732f64001fcc534 Author: Rafael J. Wysocki Date: Fri Oct 1 15:58:10 2021 +0200 PCI: ACPI: Check parent pointer in acpi_pci_find_companion() If acpi_pci_find_companion() is called for a device whose parent pointer is NULL, it will crash when attempting to get the ACPI companion of the parent due to a NULL pointer dereference in the ACPI_COMPANION() macro. This was not a problem before commit 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") that made pci_setup_device() call pci_set_acpi_fwnode() and so it allowed devices with NULL parent pointers to be passed to acpi_pci_find_companion() which is the case in pci_iov_add_virtfn(), for instance. Fix this issue by making acpi_pci_find_companion() check the device's parent pointer upfront and bail out if it is NULL. While pci_iov_add_virtfn() can be changed to set the device's parent pointer before calling pci_setup_device() for it, checking pointers against NULL before dereferencing them is prudent anyway and looking for ACPI companions of virtual functions isn't really useful. Fixes: 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") Link: https://lore.kernel.org/linux-acpi/8e4bbd5c59de31db71f718556654c0aa077df03d.camel@linux.ibm.com/ Reported-by: Niklas Schnelle Tested-by: Niklas Schnelle Signed-off-by: Rafael J. Wysocki Acked-by: Bjorn Helgaas commit 56dd05023675a35541e9baeba868bd0472eb97f9 Author: Sven Peter Date: Thu Oct 7 07:34:30 2021 +0200 MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer Hector suggested I should add myself to help him maintain the platform. Acked-by: Hector Martin Signed-off-by: Sven Peter commit e47e3fa17c43180f9e147ba35a30c731d7648f7a Author: Alyssa Rosenzweig Date: Mon Aug 23 11:17:38 2021 -0400 MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer Add myself as a reviewer for Asahi Linux (Apple M1) patches. I would like to be CC'ed on Asahi Linux patches for review and testing. I am also collecting Asahi Linux patches downstream, rebasing on linux-next periodically, and would like to be notified of what to cherry-pick from lists. Cc: Hector Martin Cc: Sven Peter Acked-by: Hector Martin Acked-by: Sven Peter Signed-off-by: Alyssa Rosenzweig commit 64e7875560270b8f669fca9fcd6a689fea56fbeb Author: Namjae Jeon Date: Sun Oct 3 13:19:00 2021 +0900 ksmbd: fix oops from fuse driver Marios reported kernel oops from fuse driver when ksmbd call mark_inode_dirty(). This patch directly update ->i_ctime after removing mark_inode_ditry() and notify_change will put inode to dirty list. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Hyunchul Lee Reported-by: Marios Makassikis Tested-by: Marios Makassikis Acked-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2db72604f3eaebd6175548bf64372e163724ebe3 Author: Namjae Jeon Date: Fri Oct 1 11:53:49 2021 +0900 ksmbd: fix version mismatch with out of tree Fix version mismatch with out of tree, This updated version will be matched with ksmbd-tools. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Steve French Cc: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c7705eec78c999485609274c7ac5c27def8b84f1 Author: Namjae Jeon Date: Mon Oct 4 20:44:52 2021 +0900 ksmbd: use buf_data_size instead of recalculation in smb3_decrypt_req() Tom suggested to use buf_data_size that is already calculated, to verify these offsets. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Suggested-by: Tom Talpey Acked-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 51a1387393d98c2ba52d53d089720fa9f1463178 Author: Namjae Jeon Date: Wed Sep 29 13:09:24 2021 +0900 ksmbd: remove the leftover of smb2.0 dialect support Although ksmbd doesn't send SMB2.0 support in supported dialect list of smb negotiate response, There is the leftover of smb2.0 dialect. This patch remove it not to support SMB2.0 in ksmbd. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c2e99d47973796c3fafd13079337dcadecd49d8a Author: Namjae Jeon Date: Sun Sep 26 21:55:02 2021 +0900 ksmbd: check strictly data area in ksmbd_smb2_check_message() When invalid data offset and data length in request, ksmbd_smb2_check_message check strictly and doesn't allow to process such requests. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Acked-by: Hyunchul Lee Reviewed-by: Ralph Boehme Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 85f74acf097a63a07f5a7c215db6883e5c35e3ff Author: Keith Busch Date: Wed Oct 6 23:50:31 2021 -0700 nvme-pci: Fix abort command id The request tag is no longer the only component of the command id. Fixes: e7006de6c2380 ("nvme: code command_id with a genctr for use-after-free validation") Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 424953cf3c6657f1e67e1a2c5d6e3bb518ea4e9a Author: Arnd Bergmann Date: Tue Sep 28 09:50:27 2021 +0200 qcom_scm: hide Kconfig symbol Now that SCM can be a loadable module, we have to add another dependency to avoid link failures when ipa or adreno-gpu are built-in: aarch64-linux-ld: drivers/net/ipa/ipa_main.o: in function `ipa_probe': ipa_main.c:(.text+0xfc4): undefined reference to `qcom_scm_is_available' ld.lld: error: undefined symbol: qcom_scm_is_available >>> referenced by adreno_gpu.c >>> gpu/drm/msm/adreno/adreno_gpu.o:(adreno_zap_shader_load) in archive drivers/built-in.a This can happen when CONFIG_ARCH_QCOM is disabled and we don't select QCOM_MDT_LOADER, but some other module selects QCOM_SCM. Ideally we'd use a similar dependency here to what we have for QCOM_RPROC_COMMON, but that causes dependency loops from other things selecting QCOM_SCM. This appears to be an endless problem, so try something different this time: - CONFIG_QCOM_SCM becomes a hidden symbol that nothing 'depends on' but that is simply selected by all of its users - All the stubs in include/linux/qcom_scm.h can go away - arm-smccc.h needs to provide a stub for __arm_smccc_smc() to allow compile-testing QCOM_SCM on all architectures. - To avoid a circular dependency chain involving RESET_CONTROLLER and PINCTRL_SUNXI, drop the 'select RESET_CONTROLLER' statement. According to my testing this still builds fine, and the QCOM platform selects this symbol already. Acked-by: Kalle Valo Acked-by: Alex Elder Signed-off-by: Arnd Bergmann commit 951cd3a0866d29cb9c01ebc1d9c17590e598226e Author: Arnd Bergmann Date: Tue Sep 28 09:50:26 2021 +0200 firmware: include drivers/firmware/Kconfig unconditionally Compile-testing drivers that require access to a firmware layer fails when that firmware symbol is unavailable. This happened twice this week: - My proposed to change to rework the QCOM_SCM firmware symbol broke on ppc64 and others. - The cs_dsp firmware patch added device specific firmware loader into drivers/firmware, which broke on the same set of architectures. We should probably do the same thing for other subsystems as well, but fix this one first as this is a dependency for other patches getting merged. Reviewed-by: Bjorn Andersson Reviewed-by: Charles Keepax Acked-by: Will Deacon Acked-by: Bjorn Andersson Cc: Mark Brown Cc: Liam Girdwood Cc: Charles Keepax Cc: Simon Trimmer Cc: Michael Ellerman Reviewed-by: Mark Brown Signed-off-by: Arnd Bergmann commit 214174d9f56c7f81f4860a26b6b8b961a6b92654 Author: Srinivasa Rao Mandadapu Date: Thu Oct 7 19:21:15 2021 +0530 ASoC: codec: wcd938x: Add irq config support This patch fixes compilation error in wcd98x codec driver. Fixes: 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig") Signed-off-by: Venkata Prasad Potturu Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/1633614675-27122-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown commit 5af82c81b2c49cfb1cad84d9eb6eab0e3d1c4842 Author: Takashi Iwai Date: Wed Oct 6 16:17:12 2021 +0200 ASoC: DAPM: Fix missing kctl change notifications The put callback of a kcontrol is supposed to return 1 when the value is changed, and this will be notified to user-space. However, some DAPM kcontrols always return 0 (except for errors), hence the user-space misses the update of a control value. This patch corrects the behavior by properly returning 1 when the value gets updated. Reported-and-tested-by: Hans de Goede Cc: Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20211006141712.2439-1-tiwai@suse.de Signed-off-by: Mark Brown commit c25d4546ca452b2e8c03bc735e4c65bc6dd751dd Author: Andy Shevchenko Date: Wed Oct 6 18:04:28 2021 +0300 ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log saturation dev_err_probe() avoids printing into log when the deferred probe is invoked. This is possible when clock provider is pending to appear. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211006150428.16434-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 10f4a96543b744c8cc7ef8b0799af21d911dd37d Author: Andy Shevchenko Date: Wed Oct 6 18:04:27 2021 +0300 ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional() First of all, replace indexed API by plain one since we have index 0. Second, switch to optional variant and drop duplicated code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211006150428.16434-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 6f32c521061b704c0198be3ba9834f5a64ea5605 Author: Andy Shevchenko Date: Wed Oct 6 18:04:26 2021 +0300 ASoC: Intel: bytcht_es8316: Use temporary variable for struct device Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211006150428.16434-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 2577b868a48ef3601116908738efbe570451e605 Author: Andy Shevchenko Date: Wed Oct 6 18:04:25 2021 +0300 ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata() Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko Acked-by: Pierre-Louis Bossart Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211006150428.16434-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit db0767b8a6e620b99459d2e688c1983c2e5add0d Author: Srinivasa Rao Mandadapu Date: Thu Oct 7 19:20:19 2021 +0530 ASoC: wcd938x: Fix jack detection issue This patch is to fix audio 3.5mm jack detection failure on wcd938x codec based target. Fixes: bcee7ed09b8e (ASoC: codecs: wcd938x: add Multi Button Headset Control support) Signed-off-by: Venkata Prasad Potturu Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/1633614619-27026-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown commit 8d6c414cd2fb74aa6812e9bfec6178f8246c4f3a Author: Mike Manning Date: Tue Oct 5 14:03:42 2021 +0100 net: prefer socket bound to interface when not in VRF The commit 6da5b0f027a8 ("net: ensure unbound datagram socket to be chosen when not in a VRF") modified compute_score() so that a device match is always made, not just in the case of an l3mdev skb, then increments the score also for unbound sockets. This ensures that sockets bound to an l3mdev are never selected when not in a VRF. But as unbound and bound sockets are now scored equally, this results in the last opened socket being selected if there are matches in the default VRF for an unbound socket and a socket bound to a dev that is not an l3mdev. However, handling prior to this commit was to always select the bound socket in this case. Reinstate this handling by incrementing the score only for bound sockets. The required isolation due to choosing between an unbound socket and a socket bound to an l3mdev remains in place due to the device match always being made. The same approach is taken for compute_score() for stream sockets. Fixes: 6da5b0f027a8 ("net: ensure unbound datagram socket to be chosen when not in a VRF") Fixes: e78190581aff ("net: ensure unbound stream socket to be chosen when not in a VRF") Signed-off-by: Mike Manning Reviewed-by: David Ahern Link: https://lore.kernel.org/r/cf0a8523-b362-1edf-ee78-eef63cbbb428@gmail.com Signed-off-by: Jakub Kicinski commit 7671b026bb389a5a01722dd3ecf80b44703e9e84 Merge: 578f3932273ff d0c6416bd7091 Author: Jakub Kicinski Date: Thu Oct 7 07:11:32 2021 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2021-10-07 We've added 7 non-merge commits during the last 8 day(s) which contain a total of 8 files changed, 38 insertions(+), 21 deletions(-). The main changes are: 1) Fix ARM BPF JIT to preserve caller-saved regs for DIV/MOD JIT-internal helper call, from Johan Almbladh. 2) Fix integer overflow in BPF stack map element size calculation when used with preallocation, from Tatsuhiko Yasumatsu. 3) Fix an AF_UNIX regression due to added BPF sockmap support related to shutdown handling, from Jiang Wang. 4) Fix a segfault in libbpf when generating light skeletons from objects without BTF, from Kumar Kartikeya Dwivedi. 5) Fix a libbpf memory leak in strset to free the actual struct strset itself, from Andrii Nakryiko. 6) Dual-license bpf_insn.h similarly as we did for libbpf and bpftool, with ACKs from all contributors, from Luca Boccassi. ==================== Link: https://lore.kernel.org/r/20211007135010.21143-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 424b650f35c77defbb3cbd6e5221d3697af42250 Author: Jackie Liu Date: Wed Sep 22 10:51:22 2021 +0800 tracing: Fix missing osnoise tracer on max_latency The compiler warns when the data are actually unused: kernel/trace/trace.c:1712:13: error: ‘trace_create_maxlat_file’ defined but not used [-Werror=unused-function] 1712 | static void trace_create_maxlat_file(struct trace_array *tr, | ^~~~~~~~~~~~~~~~~~~~~~~~ [Why] CONFIG_HWLAT_TRACER=n, CONFIG_TRACER_MAX_TRACE=n, CONFIG_OSNOISE_TRACER=y gcc report warns. [How] Now trace_create_maxlat_file will only take effect when CONFIG_HWLAT_TRACER=y or CONFIG_TRACER_MAX_TRACE=y. In fact, after adding osnoise trace, it also needs to take effect. Link: https://lore.kernel.org/all/c1d9e328-ad7c-920b-6c24-9e1598a6421c@infradead.org/ Link: https://lkml.kernel.org/r/20210922025122.3268022-1-liu.yun@linux.dev Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") Cc: Daniel Bristot de Oliveira Suggested-by: Steven Rostedt Reviewed-by: Daniel Bristot de Oliveira Tested-by: Randy Dunlap # build-tested Signed-off-by: Jackie Liu Signed-off-by: Steven Rostedt (VMware) commit 11c52d250b34a0862edc29db03fbec23b30db6da Author: Aleksander Morgado Date: Thu Oct 7 14:25:01 2021 +0200 USB: serial: qcserial: add EM9191 QDL support When the module boots into QDL download mode it exposes the 1199:90d2 ids, which can be mapped to the qcserial driver, and used to run firmware upgrades (e.g. with the qmi-firmware-update program). T: Bus=01 Lev=03 Prnt=08 Port=03 Cnt=01 Dev#= 10 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1199 ProdID=90d2 Rev=00.00 S: Manufacturer=Sierra Wireless, Incorporated S: Product=Sierra Wireless EM9191 S: SerialNumber=8W0382004102A109 C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=2mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=10 Driver=qcserial Signed-off-by: Aleksander Morgado Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit eb8257a12192f43ffd41bd90932c39dade958042 Author: Mahesh Salgaonkar Date: Mon Sep 20 22:03:26 2021 +0530 pseries/eeh: Fix the kdump kernel crash during eeh_pseries_init On pseries LPAR when an empty slot is assigned to partition OR in single LPAR mode, kdump kernel crashes during issuing PHB reset. In the kdump scenario, we traverse all PHBs and issue reset using the pe_config_addr of the first child device present under each PHB. However the code assumes that none of the PHB slots can be empty and uses list_first_entry() to get the first child device under the PHB. Since list_first_entry() expects the list to be non-empty, it returns an invalid pci_dn entry and ends up accessing NULL phb pointer under pci_dn->phb causing kdump kernel crash. This patch fixes the below kdump kernel crash by skipping empty slots: audit: initializing netlink subsys (disabled) thermal_sys: Registered thermal governor 'fair_share' thermal_sys: Registered thermal governor 'step_wise' cpuidle: using governor menu pstore: Registered nvram as persistent store backend Issue PHB reset ... audit: type=2000 audit(1631267818.000:1): state=initialized audit_enabled=0 res=1 BUG: Kernel NULL pointer dereference on read at 0x00000268 Faulting instruction address: 0xc000000008101fb0 Oops: Kernel access of bad area, sig: 7 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries Modules linked in: CPU: 7 PID: 1 Comm: swapper/7 Not tainted 5.14.0 #1 NIP: c000000008101fb0 LR: c000000009284ccc CTR: c000000008029d70 REGS: c00000001161b840 TRAP: 0300 Not tainted (5.14.0) MSR: 8000000002009033 CR: 28000224 XER: 20040002 CFAR: c000000008101f0c DAR: 0000000000000268 DSISR: 00080000 IRQMASK: 0 ... NIP pseries_eeh_get_pe_config_addr+0x100/0x1b0 LR __machine_initcall_pseries_eeh_pseries_init+0x2cc/0x350 Call Trace: 0xc00000001161bb80 (unreliable) __machine_initcall_pseries_eeh_pseries_init+0x2cc/0x350 do_one_initcall+0x60/0x2d0 kernel_init_freeable+0x350/0x3f8 kernel_init+0x3c/0x17c ret_from_kernel_thread+0x5c/0x64 Fixes: 5a090f7c363fd ("powerpc/pseries: PCIE PHB reset") Signed-off-by: Mahesh Salgaonkar [mpe: Tweak wording and trim oops] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/163215558252.413351.8600189949820258982.stgit@jupiter commit d93f9e23744b7bf11a98b2ddb091d129482ae179 Author: Christophe Leroy Date: Wed Sep 15 16:12:24 2021 +0200 powerpc/32s: Fix kuap_kernel_restore() At interrupt exit, kuap_kernel_restore() calls kuap_unlock() with the value contained in regs->kuap. However, when regs->kuap contains 0xffffffff it means that KUAP was not unlocked so calling kuap_unlock() is unrelevant and results in jeopardising the contents of kernel space segment registers. So check that regs->kuap doesn't contain KUAP_NONE before calling kuap_unlock(). In the meantime it also means that if KUAP has not been correcly locked back at interrupt exit, it must be locked before continuing. This is done by checking the content of current->thread.kuap which was returned by kuap_get_and_assert_locked() Fixes: 16132529cee5 ("powerpc/32s: Rework Kernel Userspace Access Protection") Reported-by: Stan Johnson Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0d0c4d0f050a637052287c09ba521bad960a2790.1631715131.git.christophe.leroy@csgroup.eu commit 5a4b0320783a19f877dd595813569b3c25f4ff81 Author: Cédric Le Goater Date: Thu Sep 30 12:25:35 2021 +0200 powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler The IPR drivers tests for MSI support at probe time with MSI vector 0 and when done, frees the IRQ with free_irq(). This test was introduced by 95fecd90397e ("ipr: add test for MSI interrupt support") as an improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support") because a boot failure was reported on a Bimini PowerPC system: https://lore.kernel.org/r/1242926159.3007.5.camel@localhost.localdomain It was finally decided to remove MSI support on Bimini systems in 6eb0ac03899a ("powerpc/maple: Add a quirk to disable MSI for IPR on Bimini"). Linux 5.15-rc1 added MSI domain support to the pseries machine and when free_irq is called() in the driver, msi_domain_deactivate() also is. This resets the MSI table entry of the associate vector by calling __pci_write_msi_msg() with an empty message and breaks any further activation of the same vector. In the case of the IPR driver, it breaks the initialization sequence of the IOA. Introduce an empty irq_write_msi_msg() handler in the MSI domain of the pseries machine to avoid clearing the MSI vector entry. Updating the entry is not strictly necessary since it is initialized by the underlying hypervisor, PowerVM or QEMU/KVM. Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains") Signed-off-by: Cédric Le Goater Reported-by: Abdul Haleem Tested-by: Mahesh Salgaonkar [mpe: Tweak comment wording and formatting slightly] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210930102535.1047230-1-clg@kaod.org commit 578f3932273ff577f532c54a45248b791089cbf0 Merge: 65f280bb65e60 93ec1320b0170 Author: David S. Miller Date: Thu Oct 7 12:44:41 2021 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2021-10-07 1) Fix a sysbot reported shift-out-of-bounds in xfrm_get_default. From Pavel Skripkin. 2) Fix XFRM_MSG_MAPPING ABI breakage. The new XFRM_MSG_MAPPING messages were accidentally not paced at the end. Fix by Eugene Syromiatnikov. 3) Fix the uapi for the default policy, use explicit field and macros and make it accessible to userland. From Nicolas Dichtel. 4) Fix a missing rcu lock in xfrm_notify_userpolicy(). From Nicolas Dichtel. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit 65f280bb65e60fd75ca6cca51c4311a4fc7af222 Merge: a50a0595230d3 54ee39439acd9 Author: David S. Miller Date: Thu Oct 7 12:38:15 2021 +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 2021-10-06 This series contains updates to i40e and iavf drivers. Jiri Benc expands an error check to prevent infinite loop for i40e. Sylwester prevents freeing of uninitialized IRQ vector to resolve a kernel oops for i40e. Stefan Assmann fixes a double mutex unlock for iavf. ==================== Signed-off-by: David S. Miller commit f08fb25bc66986b0952724530a640d9970fa52c1 Author: Nicholas Piggin Date: Tue Oct 5 00:56:42 2021 +1000 powerpc/64s: Fix unrecoverable MCE calling async handler from NMI The machine check handler is not considered NMI on 64s. The early handler is the true NMI handler, and then it schedules the machine_check_exception handler to run when interrupts are enabled. This works fine except the case of an unrecoverable MCE, where the true NMI is taken when MSR[RI] is clear, it can not recover, so it calls machine_check_exception directly so something might be done about it. Calling an async handler from NMI context can result in irq state and other things getting corrupted. This can also trigger the BUG at arch/powerpc/include/asm/interrupt.h:168 BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE)); Fix this by making an _async version of the handler which is called in the normal case, and a NMI version that is called for unrecoverable interrupts. Fixes: 2b43dd7653cc ("powerpc/64: enable MSR[EE] in irq replay pt_regs") Signed-off-by: Nicholas Piggin Tested-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211004145642.1331214-6-npiggin@gmail.com commit 768c47010392ece9766a56479b4e0cf04a536916 Author: Nicholas Piggin Date: Tue Oct 5 00:56:41 2021 +1000 powerpc/64/interrupt: Reconcile soft-mask state in NMI and fix false BUG If a NMI hits early in an interrupt handler before the irq soft-mask state is reconciled, that can cause a false-positive BUG with a CONFIG_PPC_IRQ_SOFT_MASK_DEBUG assertion. Remove that assertion and instead check the case that if regs->msr has EE clear, then regs->softe should be marked as disabled so the irq state looks correct to NMI handlers, the same as how it's fixed up in the case it was implicit soft-masked. This doesn't fix a known problem -- the change that was fixed by commit 4ec5feec1ad02 ("powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled") was the addition of a warning in the soft-nmi watchdog interrupt which can never actually fire when MSR[EE]=0. However it may be important if NMI handlers grow more code, and it's less surprising to anything using 'regs' - (I tripped over this when working in the area). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211004145642.1331214-5-npiggin@gmail.com commit ff058a8ada5df0d84e5537cfaf89d06d71501580 Author: Nicholas Piggin Date: Tue Oct 5 00:56:40 2021 +1000 powerpc/64: warn if local irqs are enabled in NMI or hardirq context This can help catch bugs such as the one fixed by the previous change to prevent _exception() from enabling irqs. ppc32 could have a similar warning but it has no good config option to debug this stuff (the test may be overkill to add for production kernels). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211004145642.1331214-4-npiggin@gmail.com commit d0afd44c05f8f4e4c91487c02d43c87a31552462 Author: Nicholas Piggin Date: Tue Oct 5 00:56:39 2021 +1000 powerpc/traps: do not enable irqs in _exception _exception can be called by machine check handlers when the MCE hits user code (e.g., pseries and powernv). This will enable local irqs because, which is a dicey thing to do in NMI or hard irq context. This seemed to worked out okay because a userspace MCE can basically be treated like a synchronous interrupt (after async / imprecise MCEs are filtered out). Since NMI and hard irq handlers have started growing nmi_enter / irq_enter, and more irq state sanity checks, this has started to cause problems (or at least trigger warnings). The Fixes tag to the commit which introduced this rather than try to work out exactly which commit was the first that could possibly cause a problem because that may be difficult to prove. Fixes: 9f2f79e3a3c1 ("powerpc: Disable interrupts in 64-bit kernel FP and vector faults") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211004145642.1331214-3-npiggin@gmail.com commit 3e607dc4df180b72a38e75030cb0f94d12808712 Author: Nicholas Piggin Date: Tue Oct 5 00:56:38 2021 +1000 powerpc/64s: fix program check interrupt emergency stack path Emergency stack path was jumping into a 3: label inside the __GEN_COMMON_BODY macro for the normal path after it had finished, rather than jumping over it. By a small miracle this is the correct place to build up a new interrupt frame with the existing stack pointer, so things basically worked okay with an added weird looking 700 trap frame on top (which had the wrong ->nip so it didn't decode bug messages either). Fix this by avoiding using numeric labels when jumping over non-trivial macros. Before: LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV Modules linked in: CPU: 0 PID: 88 Comm: sh Not tainted 5.15.0-rc2-00034-ge057cdade6e5 #2637 NIP: 7265677368657265 LR: c00000000006c0c8 CTR: c0000000000097f0 REGS: c0000000fffb3a50 TRAP: 0700 Not tainted MSR: 9000000000021031 CR: 00000700 XER: 20040000 CFAR: c0000000000098b0 IRQMASK: 0 GPR00: c00000000006c964 c0000000fffb3cf0 c000000001513800 0000000000000000 GPR04: 0000000048ab0778 0000000042000000 0000000000000000 0000000000001299 GPR08: 000001e447c718ec 0000000022424282 0000000000002710 c00000000006bee8 GPR12: 9000000000009033 c0000000016b0000 00000000000000b0 0000000000000001 GPR16: 0000000000000000 0000000000000002 0000000000000000 0000000000000ff8 GPR20: 0000000000001fff 0000000000000007 0000000000000080 00007fff89d90158 GPR24: 0000000002000000 0000000002000000 0000000000000255 0000000000000300 GPR28: c000000001270000 0000000042000000 0000000048ab0778 c000000080647e80 NIP [7265677368657265] 0x7265677368657265 LR [c00000000006c0c8] ___do_page_fault+0x3f8/0xb10 Call Trace: [c0000000fffb3cf0] [c00000000000bdac] soft_nmi_common+0x13c/0x1d0 (unreliable) --- interrupt: 700 at decrementer_common_virt+0xb8/0x230 NIP: c0000000000098b8 LR: c00000000006c0c8 CTR: c0000000000097f0 REGS: c0000000fffb3d60 TRAP: 0700 Not tainted MSR: 9000000000021031 CR: 22424282 XER: 20040000 CFAR: c0000000000098b0 IRQMASK: 0 GPR00: c00000000006c964 0000000000002400 c000000001513800 0000000000000000 GPR04: 0000000048ab0778 0000000042000000 0000000000000000 0000000000001299 GPR08: 000001e447c718ec 0000000022424282 0000000000002710 c00000000006bee8 GPR12: 9000000000009033 c0000000016b0000 00000000000000b0 0000000000000001 GPR16: 0000000000000000 0000000000000002 0000000000000000 0000000000000ff8 GPR20: 0000000000001fff 0000000000000007 0000000000000080 00007fff89d90158 GPR24: 0000000002000000 0000000002000000 0000000000000255 0000000000000300 GPR28: c000000001270000 0000000042000000 0000000048ab0778 c000000080647e80 NIP [c0000000000098b8] decrementer_common_virt+0xb8/0x230 LR [c00000000006c0c8] ___do_page_fault+0x3f8/0xb10 --- interrupt: 700 Instruction dump: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX ---[ end trace 6d28218e0cc3c949 ]--- After: ------------[ cut here ]------------ kernel BUG at arch/powerpc/kernel/exceptions-64s.S:491! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV Modules linked in: CPU: 0 PID: 88 Comm: login Not tainted 5.15.0-rc2-00034-ge057cdade6e5-dirty #2638 NIP: c0000000000098b8 LR: c00000000006bf04 CTR: c0000000000097f0 REGS: c0000000fffb3d60 TRAP: 0700 Not tainted MSR: 9000000000021031 CR: 24482227 XER: 00040000 CFAR: c0000000000098b0 IRQMASK: 0 GPR00: c00000000006bf04 0000000000002400 c000000001513800 c000000001271868 GPR04: 00000000100f0d29 0000000042000000 0000000000000007 0000000000000009 GPR08: 00000000100f0d29 0000000024482227 0000000000002710 c000000000181b3c GPR12: 9000000000009033 c0000000016b0000 00000000100f0d29 c000000005b22f00 GPR16: 00000000ffff0000 0000000000000001 0000000000000009 00000000100eed90 GPR20: 00000000100eed90 0000000010000000 000000001000a49c 00000000100f1430 GPR24: c000000001271868 0000000002000000 0000000000000215 0000000000000300 GPR28: c000000001271800 0000000042000000 00000000100f0d29 c000000080647860 NIP [c0000000000098b8] decrementer_common_virt+0xb8/0x230 LR [c00000000006bf04] ___do_page_fault+0x234/0xb10 Call Trace: Instruction dump: 4182000c 39400001 48000008 894d0932 714a0001 39400008 408225fc 718a4000 7c2a0b78 3821fcf0 41c20008 e82d0910 <0981fcf0> f92101a0 f9610170 f9810178 ---[ end trace a5dbd1f5ea4ccc51 ]--- Fixes: 0a882e28468f4 ("powerpc/64s/exception: remove bad stack branch") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211004145642.1331214-2-npiggin@gmail.com commit 548b762763b885b81850db676258df47c55dd5f9 Author: Naveen N. Rao Date: Wed Oct 6 01:55:29 2021 +0530 powerpc/bpf ppc32: Fix BPF_SUB when imm == 0x80000000 Special case handling of the smallest 32-bit negative number for BPF_SUB. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7135360a0cdf70adedbccf9863128b8daef18764.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 48164fccdff6d5cc11308126c050bd25a329df25 Author: Naveen N. Rao Date: Wed Oct 6 01:55:28 2021 +0530 powerpc/bpf ppc32: Do not emit zero extend instruction for 64-bit BPF_END Suppress emitting zero extend instruction for 64-bit BPF_END_FROM_[L|B]E operation. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b4e3c3546121315a8e2059b19a1bda84971816e4.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit e8278d44443207bb6609c7b064073f353e6f4978 Author: Naveen N. Rao Date: Wed Oct 6 01:55:27 2021 +0530 powerpc/bpf ppc32: Fix JMP32_JSET_K 'andi' only takes an unsigned 16-bit value. Correct the imm range used when emitting andi. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b94489f52831305ec15aca4dd04a3527236be7e8.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit c9b8da77f22d28348d1f89a6c4d3fec102e9b1c4 Author: Naveen N. Rao Date: Wed Oct 6 01:55:26 2021 +0530 powerpc/bpf ppc32: Fix ALU32 BPF_ARSH operation Correct the destination register used for ALU32 BPF_ARSH operation. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6d24c1f9e79b6f61f5135eaf2ea1e8bcd4dac87b.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit b7540d62509453263604a155bf2d5f0ed450cba2 Author: Naveen N. Rao Date: Wed Oct 6 01:55:25 2021 +0530 powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC Emit similar instruction sequences to commit a048a07d7f4535 ("powerpc/64s: Add support for a store forwarding barrier at kernel entry/exit") when encountering BPF_NOSPEC. Mitigations are enabled depending on what the firmware advertises. In particular, we do not gate these mitigations based on current settings, just like in x86. Due to this, we don't need to take any action if mitigations are enabled or disabled at runtime. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/956570cbc191cd41f8274bed48ee757a86dac62a.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 030905920f32e91a52794937f67434ac0b3ea41a Author: Naveen N. Rao Date: Wed Oct 6 01:55:24 2021 +0530 powerpc/security: Add a helper to query stf_barrier type Add a helper to return the stf_barrier type for the current processor. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 5855c4c1f415ca3ba1046e77c0b3d3dfc96c9025 Author: Naveen N. Rao Date: Wed Oct 6 01:55:23 2021 +0530 powerpc/bpf: Fix BPF_SUB when imm == 0x80000000 We aren't handling subtraction involving an immediate value of 0x80000000 properly. Fix the same. Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy [mpe: Fold in fix from Naveen to use imm <= 32768] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fc4b1276eb10761fd7ce0814c8dd089da2815251.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 2263eb7370060bdb0013bc14e1a7c9bf33617a55 Author: Yu-Tung Chang Date: Thu Sep 30 10:11:12 2021 +0800 USB: serial: option: add Quectel EC200S-CN module support Add usb product id of the Quectel EC200S-CN module. usb-devices output for 0x6002: T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=6002 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=0000 C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I: If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) Signed-off-by: Yu-Tung Chang Link: https://lore.kernel.org/r/20210930021112.330396-1-mtwget@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit c184accc4a42c7872dc8e8d0fc97a740dc61fe24 Author: Tomaz Solc Date: Wed Oct 6 14:57:50 2021 +0200 USB: serial: option: add prod. id for Quectel EG91 Adding support for Quectel EG91 LTE module. The interface layout is same as for EG95. usb-devices output: T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0191 Rev=03.18 S: Manufacturer=Android S: Product=Android C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan Interfaces: 0: Diag 1: GNSS 2: AT-command interface/modem 3: Modem 4: QMI Signed-off-by: Tomaz Solc Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 8bbc9d822421d9ac8ff9ed26a3713c9afc69d6c8 Author: Naveen N. Rao Date: Wed Oct 6 01:55:22 2021 +0530 powerpc/bpf: Fix BPF_MOD when imm == 1 Only ignore the operation if dividing by 1. Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") Signed-off-by: Naveen N. Rao Tested-by: Johan Almbladh Reviewed-by: Christophe Leroy Acked-by: Song Liu Acked-by: Johan Almbladh Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c674ca18c3046885602caebb326213731c675d06.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 3832ba4e283d7052b783dab8311df7e3590fed93 Author: Naveen N. Rao Date: Wed Oct 6 01:55:21 2021 +0530 powerpc/bpf: Validate branch ranges Add checks to ensure that we never emit branch instructions with truncated branch offsets. Suggested-by: Michael Ellerman Signed-off-by: Naveen N. Rao Tested-by: Johan Almbladh Reviewed-by: Christophe Leroy Acked-by: Song Liu Acked-by: Johan Almbladh Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/71d33a6b7603ec1013c9734dd8bdd4ff5e929142.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit 4549c3ea3160fa8b3f37dfe2f957657bb265eda9 Author: Naveen N. Rao Date: Wed Oct 6 01:55:20 2021 +0530 powerpc/lib: Add helper to check if offset is within conditional branch range Add a helper to check if a given offset is within the branch range for a powerpc conditional branch instruction, and update some sites to use the new helper. Signed-off-by: Naveen N. Rao Reviewed-by: Christophe Leroy Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/442b69a34ced32ca346a0d9a855f3f6cfdbbbd41.1633464148.git.naveen.n.rao@linux.vnet.ibm.com commit f5a8a07edafed8bede17a95ef8940fe3a57a77d5 Author: Daniele Palmas Date: Mon Oct 4 12:56:55 2021 +0200 USB: serial: option: add Telit LE910Cx composition 0x1204 Add the following Telit LE910Cx composition: 0x1204: tty, adb, mbim, tty, tty, tty, tty Signed-off-by: Daniele Palmas Link: https://lore.kernel.org/r/20211004105655.8515-1-dnlplm@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit c0f1886de7e173865f1a0fa7680a1c07954a987f Author: Takashi Iwai Date: Wed Oct 6 16:19:40 2021 +0200 ALSA: hda: intel: Allow repeatedly probing on codec configuration errors It seems that a few recent AMD systems show the codec configuration errors at the early boot, while loading the driver at a later stage works magically. Although the root cause of the error isn't clear, it's certainly not bad to allow retrying the codec probe in such a case if that helps. This patch adds the capability for retrying the probe upon codec probe errors on the certain AMD platforms. The probe_work is changed to a delayed work, and at the secondary call, it'll jump to the codec probing. Note that, not only adding the re-probing, this includes the behavior changes in the codec configuration function. Namely, snd_hda_codec_configure() won't unregister the codec at errors any longer. Instead, its caller, azx_codec_configure() unregisters the codecs with the probe failures *if* any codec has been successfully configured. If all codec probe failed, it doesn't unregister but let it re-probed -- which is the most case we're seeing and this patch tries to improve. Even if the driver doesn't re-probe or give up, it will go to the "free-all" error path, hence the leftover codecs shall be disabled / deleted in anyway. BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1190801 Link: https://lore.kernel.org/r/20211006141940.2897-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 86e1e054e0d2105cf32b0266cf1a64e6c26424f7 Author: Michael Forney Date: Sat May 8 17:01:03 2021 -0700 objtool: Update section header before relocations The libelf implementation from elftoolchain has a safety check in gelf_update_rel[a] to check that the data corresponds to a section that has type SHT_REL[A] [0]. If the relocation is updated before the section header is updated with the proper type, this check fails. To fix this, update the section header first, before the relocations. Previously, the section size was calculated in elf_rebuild_reloc_section by counting the number of entries in the reloc_list. However, we now need the size during elf_write so instead keep a running total and add to it for every new relocation. [0] https://sourceforge.net/p/elftoolchain/mailman/elftoolchain-developers/thread/CAGw6cBtkZro-8wZMD2ULkwJ39J+tHtTtAWXufMjnd3cQ7XG54g@mail.gmail.com/ Signed-off-by: Michael Forney Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20210509000103.11008-2-mforney@mforney.org commit b46179d6bb3182c020f2bf9bb4df6ba5463b0495 Author: Michael Forney Date: Sat May 8 17:01:02 2021 -0700 objtool: Check for gelf_update_rel[a] failures Otherwise, if these fail we end up with garbage data in the .rela.orc_unwind_ip section, leading to errors like ld: fs/squashfs/namei.o: bad reloc symbol index (0x7f16 >= 0x12) for offset 0x7f16d5c82cc8 in section `.orc_unwind_ip' Signed-off-by: Michael Forney Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20210509000103.11008-1-mforney@mforney.org commit 5af4055fa8133662831ae2fb6e188e8f6c172688 Merge: 60a9483534ed0 b2d70c0dbf273 Author: Linus Torvalds Date: Wed Oct 6 18:26:36 2021 -0700 Merge tag 'devicetree-fixes-for-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Add another allowed address for TI sn65dsi86 - Drop more redundant minItems/maxItems - Fix more graph 'unevaluatedProperties' warnings in media bindings * tag 'devicetree-fixes-for-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: drm/bridge: ti-sn65dsi86: Fix reg value dt-bindings: Drop more redundant 'maxItems/minItems' dt-bindings: media: Fix more graph 'unevaluatedProperties' related warnings commit 361b57df62de249dc0b2acbf48823662a5001bcd Author: Daniel Latypov Date: Tue Oct 5 13:46:32 2021 -0700 kunit: fix kernel-doc warnings due to mismatched arg names Commit 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers") added new functions but called last arg `flags`, unlike the existing code that used `gfp`. This only is an issue in test.h, test.c still used `gfp`. But the documentation was copy-pasted with the old names, leading to kernel-doc warnings. Do s/flags/gfp to make the names consistent and fix the warnings. Fixes: 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers") Reported-by: Randy Dunlap Signed-off-by: Daniel Latypov Reviewed-by: Randy Dunlap Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit a8cf90332ae3e2b53813a146a99261b6a5e16a73 Author: Arnd Bergmann Date: Wed Sep 29 14:27:13 2021 -0700 bitfield: build kunit tests without structleak plugin The structleak plugin causes the stack frame size to grow immensely: lib/bitfield_kunit.c: In function 'test_bitfields_constants': lib/bitfield_kunit.c:93:1: error: the frame size of 7440 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] Turn it off in this file. Signed-off-by: Arnd Bergmann Signed-off-by: Brendan Higgins Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 33d4951e021bb67ebd6bdb01f3d437c0f45b3c0c Author: Brendan Higgins Date: Wed Sep 29 14:27:12 2021 -0700 thunderbolt: build kunit tests without structleak plugin The structleak plugin causes the stack frame size to grow immensely when used with KUnit: drivers/thunderbolt/test.c:1529:1: error: the frame size of 1176 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Turn it off in this file. Linus already split up tests in this file, so this change *should* be redundant now. Signed-off-by: Brendan Higgins Suggested-by: Arnd Bergmann Acked-by: Mika Westerberg Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 6a1e2d93d55b000962b82b9a080006446150b022 Author: Brendan Higgins Date: Wed Sep 29 14:27:11 2021 -0700 device property: build kunit tests without structleak plugin The structleak plugin causes the stack frame size to grow immensely when used with KUnit: ../drivers/base/test/property-entry-test.c:492:1: warning: the frame size of 2832 bytes is larger than 2048 bytes [-Wframe-larger-than=] ../drivers/base/test/property-entry-test.c:322:1: warning: the frame size of 2080 bytes is larger than 2048 bytes [-Wframe-larger-than=] ../drivers/base/test/property-entry-test.c:250:1: warning: the frame size of 4976 bytes is larger than 2048 bytes [-Wframe-larger-than=] ../drivers/base/test/property-entry-test.c:115:1: warning: the frame size of 3280 bytes is larger than 2048 bytes [-Wframe-larger-than=] Turn it off in this file. Signed-off-by: Brendan Higgins Suggested-by: Arnd Bergmann Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 2326f3cdba1d105b68cc1295e78f17ae8faa5a76 Author: Brendan Higgins Date: Wed Sep 29 14:27:10 2021 -0700 iio/test-format: build kunit tests without structleak plugin The structleak plugin causes the stack frame size to grow immensely when used with KUnit: ../drivers/iio/test/iio-test-format.c: In function ‘iio_test_iio_format_value_fixedpoint’: ../drivers/iio/test/iio-test-format.c:98:1: warning: the frame size of 2336 bytes is larger than 2048 bytes [-Wframe-larger-than=] Turn it off in this file. Signed-off-by: Brendan Higgins Suggested-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Jonathan Cameron Signed-off-by: Shuah Khan commit 554afc3b9797511e3245864e32aebeb6abbab1e3 Author: Brendan Higgins Date: Wed Sep 29 14:27:09 2021 -0700 gcc-plugins/structleak: add makefile var for disabling structleak KUnit and structleak don't play nice, so add a makefile variable for enabling structleak when it complains. Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Brendan Higgins Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 5a1fef027846e7635b9d320b2cc0b416fd11a3be Author: Hansen Date: Fri Oct 1 22:36:15 2021 +0800 drm/amd/display: Fix detection of 4 lane for DPALT [Why] DPALT detection for B0 PHY has its own set of RDPCSPIPE registers [How] Use RDPCSPIPE registers to detect if DPALT lane is 4 lane Reviewed-by: Charlene Liu Acked-by: Solomon Chiu Signed-off-by: Hansen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit a7e397b7c45377e20542146be10231b8afa948d1 Author: Nikola Cornij Date: Fri Oct 1 22:36:14 2021 +0800 drm/amd/display: Limit display scaling to up to 4k for DCN 3.1 [why] The existing limit was mistakenly bigger than 4k for DCN 3.1 Reviewed-by: Zhan Liu Acked-by: Solomon Chiu Signed-off-by: Nikola Cornij Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 2387033ac0db3235f3fa9d9976aeeeb50349550e Author: George Shen Date: Fri Oct 1 22:36:09 2021 +0800 drm/amd/display: Skip override for preferred link settings during link training [Why] Overriding link setting inside override_training_settings result in fallback link settings being ignored. This can potentially cause link training to always fail and consequently result in an infinite loop of link training to occur in dp_verify_link_cap during detection. [How] Since preferred link settings are already considered inside decide_link_settings, skip the check in override_training_settings to avoid infinite link training loops. Reviewed-by: Wenjing Liu Acked-by: Solomon Chiu Signed-off-by: George Shen Signed-off-by: Alex Deucher commit 1ab52ac1e9bc9391f592c9fa8340a6e3e9c36286 Author: Patrisious Haddad Date: Wed Oct 6 12:31:53 2021 +0300 RDMA/mlx5: Set user priority for DCT Currently, the driver doesn't set the PCP-based priority for DCT, hence DCT response packets are transmitted without user priority. Fix it by setting user provided priority in the eth_prio field in the DCT context, which in turn sets the value in the transmitted packet. Fixes: 776a3906b692 ("IB/mlx5: Add support for DC target QP") Link: https://lore.kernel.org/r/5fd2d94a13f5742d8803c218927322257d53205c.1633512672.git.leonro@nvidia.com Signed-off-by: Patrisious Haddad Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e93c7d8e8c4cf80c6afe56e71c83c1cd31b4fce1 Author: Shiraz Saleem Date: Tue Oct 5 13:23:02 2021 -0500 RDMA/irdma: Process extended CQ entries correctly The valid bit for extended CQE's written by HW is retrieved from the incorrect quad-word. This leads to missed completions for any UD traffic particularly after a wrap-around. Get the valid bit for extended CQE's from the correct quad-word in the descriptor. Fixes: 551c46edc769 ("RDMA/irdma: Add user/kernel shared libraries") Link: https://lore.kernel.org/r/20211005182302.374-1-shiraz.saleem@intel.com Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit c20106944eb679fa3ab7e686fe5f6ba30fbc51e5 Author: Benjamin Coddington Date: Wed Oct 6 13:20:44 2021 -0400 NFSD: Keep existing listeners on portlist error If nfsd has existing listening sockets without any processes, then an error returned from svc_create_xprt() for an additional transport will remove those existing listeners. We're seeing this in practice when userspace attempts to create rpcrdma transports without having the rpcrdma modules present before creating nfsd kernel processes. Fix this by checking for existing sockets before calling nfsd_destroy(). Signed-off-by: Benjamin Coddington Signed-off-by: Chuck Lever commit 54ee39439acd9f8b161703c6ad4f4e1835585277 Author: Stefan Assmann Date: Tue Aug 24 12:06:39 2021 +0200 iavf: fix double unlock of crit_lock The crit_lock mutex could be unlocked twice as reported here https://lists.osuosl.org/pipermail/intel-wired-lan/Week-of-Mon-20210823/025525.html Remove the superfluous unlock. Technically the problem was already present before 5ac49f3c2702 as that commit only replaced the locking primitive, but no functional change. Reported-by: Dan Carpenter Fixes: 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") Fixes: bac8486116b0 ("iavf: Refactor the watchdog state machine") Signed-off-by: Stefan Assmann Signed-off-by: Tony Nguyen commit 2e5a20573a926302b233b0c2e1077f5debc7ab2e Author: Sylwester Dziedziuch Date: Fri Sep 24 11:40:41 2021 +0200 i40e: Fix freeing of uninitialized misc IRQ vector When VSI set up failed in i40e_probe() as part of PF switch set up driver was trying to free misc IRQ vectors in i40e_clear_interrupt_scheme and produced a kernel Oops: Trying to free already-free IRQ 266 WARNING: CPU: 0 PID: 5 at kernel/irq/manage.c:1731 __free_irq+0x9a/0x300 Workqueue: events work_for_cpu_fn RIP: 0010:__free_irq+0x9a/0x300 Call Trace: ? synchronize_irq+0x3a/0xa0 free_irq+0x2e/0x60 i40e_clear_interrupt_scheme+0x53/0x190 [i40e] i40e_probe.part.108+0x134b/0x1a40 [i40e] ? kmem_cache_alloc+0x158/0x1c0 ? acpi_ut_update_ref_count.part.1+0x8e/0x345 ? acpi_ut_update_object_reference+0x15e/0x1e2 ? strstr+0x21/0x70 ? irq_get_irq_data+0xa/0x20 ? mp_check_pin_attr+0x13/0xc0 ? irq_get_irq_data+0xa/0x20 ? mp_map_pin_to_irq+0xd3/0x2f0 ? acpi_register_gsi_ioapic+0x93/0x170 ? pci_conf1_read+0xa4/0x100 ? pci_bus_read_config_word+0x49/0x70 ? do_pci_enable_device+0xcc/0x100 local_pci_probe+0x41/0x90 work_for_cpu_fn+0x16/0x20 process_one_work+0x1a7/0x360 worker_thread+0x1cf/0x390 ? create_worker+0x1a0/0x1a0 kthread+0x112/0x130 ? kthread_flush_work_fn+0x10/0x10 ret_from_fork+0x1f/0x40 The problem is that at that point misc IRQ vectors were not allocated yet and we get a call trace that driver is trying to free already free IRQ vectors. Add a check in i40e_clear_interrupt_scheme for __I40E_MISC_IRQ_REQUESTED PF state before calling i40e_free_misc_vector. This state is set only if misc IRQ vectors were properly initialized. Fixes: c17401a1dd21 ("i40e: use separate state bit for miscellaneous IRQ setup") Reported-by: PJ Waskiewicz Signed-off-by: Sylwester Dziedziuch Signed-off-by: Mateusz Palczewski Tested-by: Dave Switzer Signed-off-by: Tony Nguyen commit 857b6c6f665cca9828396d9743faf37fd09e9ac3 Author: Jiri Benc Date: Tue Sep 14 10:54:42 2021 +0200 i40e: fix endless loop under rtnl The loop in i40e_get_capabilities can never end. The problem is that although i40e_aq_discover_capabilities returns with an error if there's a firmware problem, the returned error is not checked. There is a check for pf->hw.aq.asq_last_status but that value is set to I40E_AQ_RC_OK on most firmware problems. When i40e_aq_discover_capabilities encounters a firmware problem, it will encounter the same problem on its next invocation. As the result, the loop becomes endless. We hit this with I40E_ERR_ADMIN_QUEUE_TIMEOUT but looking at the code, it can happen with a range of other firmware errors. I don't know what the correct behavior should be: whether the firmware should be retried a few times, or whether pf->hw.aq.asq_last_status should be always set to the encountered firmware error (but then it would be pointless and can be just replaced by the i40e_aq_discover_capabilities return value). However, the current behavior with an endless loop under the rtnl mutex(!) is unacceptable and Intel has not submitted a fix, although we explained the bug to them 7 months ago. This may not be the best possible fix but it's better than hanging the whole system on a firmware bug. Fixes: 56a62fc86895 ("i40e: init code and hardware support") Tested-by: Stefan Assmann Signed-off-by: Jiri Benc Reviewed-by: Jesse Brandeburg Tested-by: Dave Switzer Signed-off-by: Tony Nguyen commit 225bac2dc5d192e55f2c50123ee539b1edf8a411 Author: Lukas Bulwahn Date: Tue Aug 3 13:35:25 2021 +0200 x86/Kconfig: Correct reference to MWINCHIP3D Commit in Fixes intended to exclude the Winchip series and referred to CONFIG_WINCHIP3D, but the config symbol is called CONFIG_MWINCHIP3D. Hence, scripts/checkkconfigsymbols.py warns: WINCHIP3D Referencing files: arch/x86/Kconfig Correct the reference to the intended config symbol. Fixes: 69b8d3fcabdc ("x86/Kconfig: Exclude i586-class CPUs lacking PAE support from the HIGHMEM64G Kconfig group") Suggested-by: Randy Dunlap Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20210803113531.30720-4-lukas.bulwahn@gmail.com commit 4758fd801f919b8b9acad78d2e49a195ec2be46b Author: Lukas Bulwahn Date: Tue Aug 3 13:35:24 2021 +0200 x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI The refactoring in the commit in Fixes introduced an ifdef CONFIG_OLPC_XO1_5_SCI, however the config symbol is actually called "CONFIG_OLPC_XO15_SCI". Fortunately, ./scripts/checkkconfigsymbols.py warns: OLPC_XO1_5_SCI Referencing files: arch/x86/platform/olpc/olpc.c Correct this ifdef condition to the intended config symbol. Fixes: ec9964b48033 ("Platform: OLPC: Move EC-specific functionality out from x86") Suggested-by: Randy Dunlap Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20210803113531.30720-3-lukas.bulwahn@gmail.com commit 3958b9c34c2729597e182cc606cc43942fd19f7c Author: Vegard Nossum Date: Mon Oct 4 00:34:23 2021 +0200 x86/entry: Clear X86_FEATURE_SMAP when CONFIG_X86_SMAP=n Commit 3c73b81a9164 ("x86/entry, selftests: Further improve user entry sanity checks") added a warning if AC is set when in the kernel. Commit 662a0221893a3d ("x86/entry: Fix AC assertion") changed the warning to only fire if the CPU supports SMAP. However, the warning can still trigger on a machine that supports SMAP but where it's disabled in the kernel config and when running the syscall_nt selftest, for example: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 49 at irqentry_enter_from_user_mode CPU: 0 PID: 49 Comm: init Tainted: G T 5.15.0-rc4+ #98 e6202628ee053b4f310759978284bd8bb0ce6905 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 RIP: 0010:irqentry_enter_from_user_mode ... Call Trace: ? irqentry_enter ? exc_general_protection ? asm_exc_general_protection ? asm_exc_general_protectio IS_ENABLED(CONFIG_X86_SMAP) could be added to the warning condition, but even this would not be enough in case SMAP is disabled at boot time with the "nosmap" parameter. To be consistent with "nosmap" behaviour, clear X86_FEATURE_SMAP when !CONFIG_X86_SMAP. Found using entry-fuzz + satrandconfig. [ bp: Massage commit message. ] Fixes: 3c73b81a9164 ("x86/entry, selftests: Further improve user entry sanity checks") Fixes: 662a0221893a ("x86/entry: Fix AC assertion") Signed-off-by: Vegard Nossum Signed-off-by: Borislav Petkov Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20211003223423.8666-1-vegard.nossum@oracle.com commit 2c861f2b859385e9eaa6e464a8a7435b5a6bf564 Author: Lukas Bulwahn Date: Tue Aug 3 13:35:23 2021 +0200 x86/entry: Correct reference to intended CONFIG_64_BIT Commit in Fixes adds a condition with IS_ENABLED(CONFIG_64_BIT), but the intended config item is called CONFIG_64BIT, as defined in arch/x86/Kconfig. Fortunately, scripts/checkkconfigsymbols.py warns: 64_BIT Referencing files: arch/x86/include/asm/entry-common.h Correct the reference to the intended config symbol. Fixes: 662a0221893a ("x86/entry: Fix AC assertion") Suggested-by: Randy Dunlap Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20210803113531.30720-2-lukas.bulwahn@gmail.com commit d4ebfca26dfab2803c31d68a30225be31b2f9ecf Author: James Morse Date: Fri Sep 17 16:59:24 2021 +0000 x86/resctrl: Fix kfree() of the wrong type in domain_add_cpu() Commit in Fixes separated the architecture specific and filesystem parts of the resctrl domain structures. This left the error paths in domain_add_cpu() kfree()ing the memory with the wrong type. This will cause a problem if someone adds a new member to struct rdt_hw_domain meaning d_resctrl is no longer the first member. Fixes: 792e0f6f789b ("x86/resctrl: Split struct rdt_domain") Signed-off-by: James Morse Signed-off-by: Borislav Petkov Acked-by: Reinette Chatre Link: https://lkml.kernel.org/r/20210917165924.28254-1-james.morse@arm.com commit 64e87d4bd3201bf8a4685083ee4daf5c0d001452 Author: James Morse Date: Fri Sep 17 16:59:58 2021 +0000 x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails domain_add_cpu() is called whenever a CPU is brought online. The earlier call to domain_setup_ctrlval() allocates the control value arrays. If domain_setup_mon_state() fails, the control value arrays are not freed. Add the missing kfree() calls. Fixes: 1bd2a63b4f0de ("x86/intel_rdt/mba_sc: Add initialization support") Fixes: edf6fa1c4a951 ("x86/intel_rdt/cqm: Add RMID (Resource monitoring ID) management") Signed-off-by: James Morse Signed-off-by: Borislav Petkov Acked-by: Reinette Chatre Cc: Link: https://lkml.kernel.org/r/20210917165958.28313-1-james.morse@arm.com commit f5c20e4a5f18677e22d8dd2846066251b006a62d Author: Vitaly Kuznetsov Date: Wed Oct 6 14:50:16 2021 +0200 x86/hyperv: Avoid erroneously sending IPI to 'self' __send_ipi_mask_ex() uses an optimization: when the target CPU mask is equal to 'cpu_present_mask' it uses 'HV_GENERIC_SET_ALL' format to avoid converting the specified cpumask to VP_SET. This case was overlooked when 'exclude_self' parameter was added. As the result, a spurious IPI to 'self' can be send. Reported-by: Thomas Gleixner Fixes: dfb5c1e12c28 ("x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211006125016.941616-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit 2250596374f5b0f774dd03103eb93893c5d05dbd Merge: 34186b48d29bb 3518441dda666 Author: Arnd Bergmann Date: Wed Oct 6 17:36:33 2021 +0200 Merge tag 'imx-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.15, round 2: - A couple of fixes from Haibo Chen to update SPI NOR TX bus width for i.MX6 and i.MX8 boards. This becomes necessary because spi-nor driver starts using the setting in DT. - Mark buck2 always-on for i.MX8MM Kontron-n801x-som board to avoid the core supply being turned off unexpectedly. - Fix eSDHC2 device tree settings for LS1028A SoC. - Disable GIC CPU interface before calling stby-poweroff sequence to fix power-off failure on i.MX6. - Fix M2_RST# GPIO pinmux on i.MX8M venice-gw7902 boards. * tag 'imx-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence arm64: dts: ls1028a: fix eSDHC2 node arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2 arm64: dts: imx8: change the spi-nor tx ARM: dts: imx: change the spi-nor tx Link: https://lore.kernel.org/r/20211006125734.GA10197@dragon Signed-off-by: Arnd Bergmann commit 8a38a4d51c5055d0201542e5ea3c0cb287f6e223 Author: Neil Armstrong Date: Tue Sep 28 09:36:52 2021 +0200 mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk The memory at the end of the controller only accepts 32bit read/write accesses, but the arm64 memcpy_to/fromio implementation only uses 64bit (which will be split into two 32bit access) and 8bit leading to incomplete copies to/from this memory when the buffer is not multiple of 8bytes. Add a local copy using writel/readl accesses to make sure we use the right memory access width. The switch to memcpy_to/fromio was done because of 285133040e6c ("arm64: Import latest memcpy()/memmove() implementation"), but using memcpy worked before since it mainly used 32bit memory acceses. Fixes: 103a5348c22c ("mmc: meson-gx: use memcpy_to/fromio for dram-access-quirk") Reported-by: Christian Hewitt Suggested-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Tested-by: Martin Blumenstingl Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210928073652.434690-1-narmstrong@baylibre.com Signed-off-by: Ulf Hansson commit 30d4b990ec644e8bd49ef0a2f074fabc0d189e53 Author: Claudiu Beznea Date: Fri Sep 24 11:28:51 2021 +0300 mmc: sdhci-of-at91: replace while loop with read_poll_timeout Replace while loop with read_poll_timeout(). Signed-off-by: Claudiu Beznea Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210924082851.2132068-3-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit af467fad78f03a42de8b72190f6a595366b870db Author: Claudiu Beznea Date: Fri Sep 24 11:28:50 2021 +0300 mmc: sdhci-of-at91: wait for calibration done before proceed Datasheet specifies that at the end of calibration the SDMMC_CALCR_EN bit will be cleared. No commands should be send before calibration is done. Fixes: dbdea70f71d67 ("mmc: sdhci-of-at91: fix CALCR register being rewritten") Fixes: 727d836a375ad ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset") Signed-off-by: Claudiu Beznea Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210924082851.2132068-2-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit a50a0595230d38be15183699f7bbc963bf3d127a Author: Marcel Ziswiler Date: Wed Oct 6 08:31:04 2021 +0200 dt-bindings: net: dsa: marvell: fix compatible in example While the MV88E6390 switch chip exists, one is supposed to use a compatible of "marvell,mv88e6190" for it. Fix this in the given example. Signed-off-by: Marcel Ziswiler Fixes: a3c53be55c95 ("net: dsa: mv88e6xxx: Support multiple MDIO busses") Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3707428ddabadde4086eb7c592e988f584344857 Author: Shannon Nelson Date: Tue Oct 5 16:11:05 2021 -0700 ionic: move filter sync_needed bit set Move the setting of the filter-sync-needed bit to the error case in the filter add routine to be sure we're checking the live filter status rather than a copy of the pre-sync status. Fixes: 969f84394604 ("ionic: sync the filters in the work task") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 17c37d748f2b122a95b6d0524d410302ff89a2b1 Author: Eric Dumazet Date: Tue Oct 5 18:01:38 2021 -0700 gve: report 64bit tx_bytes counter from gve_handle_report_stats() Each tx queue maintains a 64bit counter for bytes, there is no reason to truncate this to 32bit (or this has not been documented) Fixes: 24aeb56f2d38 ("gve: Add Gvnic stats AQ command and ethtool show/set-priv-flags.") Signed-off-by: Eric Dumazet Cc: Yangchun Fu Cc: Kuo Zhao Cc: David Awogbemila Signed-off-by: David S. Miller commit 2f57d4975fa027eabd35fdf23a49f8222ef3abf2 Author: Eric Dumazet Date: Tue Oct 5 17:30:30 2021 -0700 gve: fix gve_get_stats() gve_get_stats() can report wrong numbers if/when u64_stats_fetch_retry() returns true. What is needed here is to sample values in temporary variables, and only use them after each loop is ended. Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Signed-off-by: Eric Dumazet Cc: Catherine Sullivan Cc: Sagi Shahar Cc: Jon Olson Cc: Willem de Bruijn Cc: Luigi Rizzo Cc: Jeroen de Borst Cc: Tao Liu Signed-off-by: David S. Miller commit d34367991933d28bd7331f67a759be9a8c474014 Author: Eric Dumazet Date: Tue Oct 5 14:04:17 2021 -0700 rtnetlink: fix if_nlmsg_stats_size() under estimation rtnl_fill_statsinfo() is filling skb with one mandatory if_stats_msg structure. nlmsg_put(skb, pid, seq, type, sizeof(struct if_stats_msg), flags); But if_nlmsg_stats_size() never considered the needed storage. This bug did not show up because alloc_skb(X) allocates skb with extra tailroom, because of added alignments. This could very well be changed in the future to have deterministic behavior. Fixes: 10c9ead9f3c6 ("rtnetlink: add new RTM_GETSTATS message to dump link stats") Signed-off-by: Eric Dumazet Cc: Roopa Prabhu Acked-by: Roopa Prabhu Signed-off-by: David S. Miller commit d4b111fda69a01e0a7439d05993f5dad567c93aa Author: Catherine Sullivan Date: Tue Oct 5 19:42:21 2021 -0700 gve: Properly handle errors in gve_assign_qpl Ignored errors would result in crash. Fixes: ede3fcf5ec67f ("gve: Add support for raw addressing to the rx path") Signed-off-by: Catherine Sullivan Signed-off-by: Jeroen de Borst Signed-off-by: David S. Miller commit 922aa9bcac92b3ab6a423526a8e785b35a60b441 Author: Tao Liu Date: Tue Oct 5 19:42:20 2021 -0700 gve: Avoid freeing NULL pointer Prevent possible crashes when cleaning up after unsuccessful initializations. Fixes: 893ce44df5658 ("gve: Add basic driver framework for Compute Engine Virtual NIC") Signed-off-by: Tao Liu Signed-off-by: Catherine Sully Signed-off-by: David S. Miller commit d03477ee10f4bc35d3573cf1823814378ef2dca2 Author: Catherine Sullivan Date: Tue Oct 5 19:42:19 2021 -0700 gve: Correct available tx qpl check The qpl_map_size is rounded up to a multiple of sizeof(long), but the number of qpls doesn't have to be. Fixes: f5cedc84a30d2 ("gve: Add transmit and receive support") Signed-off-by: Catherine Sullivan Signed-off-by: Jeroen de Borst Signed-off-by: David S. Miller commit dd6dd6e3c791db7fdbc5433ec7e450717aa3a0ce Author: Werner Sembach Date: Wed Oct 6 15:04:15 2021 +0200 ALSA: hda/realtek: Add quirk for TongFang PHxTxX1 This applies a SND_PCI_QUIRK(...) to the TongFang PHxTxX1 barebone. This fixes the issue of the internal Microphone not working after booting another OS. When booting a certain another OS this barebone keeps some coeff settings even after a cold shutdown. These coeffs prevent the microphone detection from working in Linux, making the Laptop think that there is always an external microphone plugged-in and therefore preventing the use of the internal one. The relevant indexes and values where gathered by naively diff-ing and reading a working and a non-working coeff dump. Signed-off-by: Werner Sembach Cc: Link: https://lore.kernel.org/r/20211006130415.538243-1-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai commit d0c6416bd7091647f6041599f396bfa19ae30368 Author: Jiang Wang Date: Mon Oct 4 23:25:28 2021 +0000 unix: Fix an issue in unix_shutdown causing the other end read/write failures Commit 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") sets unix domain socket peer state to TCP_CLOSE in unix_shutdown. This could happen when the local end is shutdown but the other end is not. Then, the other end will get read or write failures which is not expected. Fix the issue by setting the local state to shutdown. Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") Reported-by: Casey Schaufler Suggested-by: Cong Wang Signed-off-by: Jiang Wang Signed-off-by: Daniel Borkmann Tested-by: Casey Schaufler Reviewed-by: Casey Schaufler Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211004232530.2377085-1-jiang.wang@bytedance.com commit 95a13ee858c9e426e63c97063677736f74af7163 Author: Andy Shevchenko Date: Fri Oct 1 16:55:44 2021 +0300 hyper-v: Replace uuid.h with types.h There is no user of anything in uuid.h in the hyperv.h. Replace it with more appropriate types.h. Fixes: f081bbb3fd03 ("hyper-v: Remove internal types from UAPI header") Reported-by: Greg Kroah-Hartman Signed-off-by: Andy Shevchenko Reviewed-by: Haiyang Zhang Link: https://lore.kernel.org/r/20211001135544.1823-1-andriy.shevchenko@linux.intel.com Signed-off-by: Wei Liu commit 6fda593f3082ef1aa783ac13e89f673fd69a2cb6 Author: Andy Shevchenko Date: Tue Oct 5 15:24:49 2021 +0300 gpio: mockup: Convert to use software nodes The gpio-mockup driver creates the properties that are shared between platform and GPIO devices. Because of that, the properties may not be removed at the proper point of time without provoking a use-after-free as shown in the following backtrace: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 103 at lib/refcount.c:28 refcount_warn_saturate+0xd1/0x120 ... Call Trace: kobject_put+0xdc/0xf0 software_node_notify_remove+0xa8/0xc0 device_del+0x15a/0x3e0 That's why the driver has to manage the lifetime of the software nodes by itself. The problem originates from the old device_add_properties() API, but has been only revealed after the commit bd1e336aa853 ("driver core: platform: Remove platform_device_add_properties()"). Hence, it's used as a landmark for backporting. Fixes: bd1e336aa853 ("driver core: platform: Remove platform_device_add_properties()") Reported-by: Kent Gibson Tested-by: Kent Gibson Signed-off-by: Andy Shevchenko [Bartosz: tweaked local variable placement] Signed-off-by: Bartosz Golaszewski commit 55a9968c7e139209a9e93d4ca4321731bea5fc95 Author: Andy Shevchenko Date: Fri Sep 24 01:46:40 2021 +0300 gpio: pca953x: Improve bias setting The commit 15add06841a3 ("gpio: pca953x: add ->set_config implementation") introduced support for bias setting. However this, due to being half-baked, brought potential issues: - the turning bias via disabling makes the pin floating for a while; - once enabled, bias can't be disabled. Fix all these by adding support for bias disabling and move the disabling part under the corresponding conditional. While at it, add support for default setting, since it's cheap to add. Fixes: 15add06841a3 ("gpio: pca953x: add ->set_config implementation") Cc: Thomas Petazzoni Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit be4491838359e78e42e88db4ac479e21c5eda1e0 Author: Mark Brown Date: Wed Sep 22 17:17:36 2021 +0100 gpio: 74x164: Add SPI device ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI device ID table. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 9997080df0350ac69988ff92c5a6a0bd0b6bf9bc Merge: 7707a4d01a648 d4aeaed80b0eb Author: David S. Miller Date: Wed Oct 6 11:18:27 2021 +0100 Merge branch 'stmmac-eee-fix' Wong Vee Khee says: ==================== net: stmmac: Turn off EEE on MAC link down This patch series ensure PCS EEE is turned off on the event of MAC link down. Tested on Intel AlderLake-S (STMMAC + MaxLinear GPY211 PHY). ==================== Signed-off-by: David S. Miller commit d4aeaed80b0ebb020fadf2073b23462928dbdc17 Author: Wong Vee Khee Date: Tue Oct 5 19:51:00 2021 +0800 net: stmmac: trigger PCS EEE to turn off on link down The current implementation enable PCS EEE feature in the event of link up, but PCS EEE feature is not disabled on link down. This patch makes sure PCE EEE feature is disabled on link down. Fixes: 656ed8b015f1 ("net: stmmac: fix EEE init issue when paired with EEE capable PHYs") Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller commit 590df78bc7d1d0425196a8e11ce6676d7023fb26 Author: Wong Vee Khee Date: Tue Oct 5 19:50:59 2021 +0800 net: pcs: xpcs: fix incorrect steps on disable EEE When Energy-Efficient Ethernet(EEE) is disable from the MAC side, we need to clear the DW_VR_MII_EEE_TRN_LPI bit of DW_VR_MII_EEE_MCTRL1 register. Fixes: 7617af3d1a5e ("net: pcs: Introducing support for DWC xpcs Energy Efficient Ethernet") Cc: Michael Sit Wei Hong Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller commit bf1acf809d5694a942e113dfca6ef076d3904bb4 Author: Cristian Marussi Date: Thu Sep 16 11:33:36 2021 +0100 firmware: arm_scmi: Add proper barriers to scmi virtio device Only one single SCMI Virtio device is currently supported by this driver and it is referenced using a static global variable which is initialized once for all during probing and nullified at virtio device removal. Add proper SMP barriers to protect accesses to such device reference to ensure that the initialzation state of such device is correctly observed by all PEs at any time. Return -EBUSY, instead of -EINVAL, and a descriptive error message if more than one SCMI Virtio device is ever found and probed. Link: https://lore.kernel.org/r/20210916103336.7243-3-cristian.marussi@arm.com Cc: "Michael S. Tsirkin" Cc: Sudeep Holla Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit a14a14595dcade4bf31e50909a6958ed2566c058 Author: Cristian Marussi Date: Thu Sep 16 11:33:35 2021 +0100 firmware: arm_scmi: Simplify spinlocks in virtio transport Remove unneeded nested irqsave/irqrestore spinlocks. Add also a few descriptive comments to explain better the system behaviour at shutdown time. Link: https://lore.kernel.org/r/20210916103336.7243-2-cristian.marussi@arm.com Cc: "Michael S. Tsirkin" Cc: Sudeep Holla Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit f5a8703a9c418c6fc54eb772712dfe7641e3991c Author: Yang Yingliang Date: Sat Sep 11 15:50:23 2021 +0800 drm/nouveau/debugfs: fix file release memory leak When using single_open() for opening, single_release() should be called, otherwise the 'op' allocated in single_open() will be leaked. Fixes: 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210911075023.3969054-2-yangyingliang@huawei.com Signed-off-by: Maarten Lankhorst commit 0b3d4945cc7e7ea1acd52cb06dfa83bfe265b6d5 Author: Yang Yingliang Date: Sat Sep 11 15:50:22 2021 +0800 drm/nouveau/kms/nv50-: fix file release memory leak When using single_open() for opening, single_release() should be called, otherwise the 'op' allocated in single_open() will be leaked. Fixes: 12885ecbfe62 ("drm/nouveau/kms/nvd9-: Add CRC support") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210911075023.3969054-1-yangyingliang@huawei.com Signed-off-by: Maarten Lankhorst commit bcf34aa5082ee2343574bc3f4d1c126030913e54 Author: Jeremy Cline Date: Wed Dec 2 19:02:20 2020 -0500 drm/nouveau: avoid a use-after-free when BO init fails nouveau_bo_init() is backed by ttm_bo_init() and ferries its return code back to the caller. On failures, ttm_bo_init() invokes the provided destructor which should de-initialize and free the memory. Thus, when nouveau_bo_init() returns an error the gem object has already been released and the memory freed by nouveau_bo_del_ttm(). Fixes: 019cbd4a4feb ("drm/nouveau: Initialize GEM object before TTM object") Cc: Thierry Reding Signed-off-by: Jeremy Cline Reviewed-by: Lyude Paul Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20201203000220.18238-1-jcline@redhat.com Signed-off-by: Maarten Lankhorst commit b67929808fe46d67cc9357b0112e4549076db4c5 Author: Randy Dunlap Date: Mon Oct 4 19:53:12 2021 -0700 DRM: delete DRM IRQ legacy midlayer docs Remove documentation associated with the removal of the DRM IRQ legacy midlayer. Eliminates these documentation warnings: ../drivers/gpu/drm/drm_irq.c:1: warning: 'irq helpers' not found ../drivers/gpu/drm/drm_irq.c:1: warning: no structured comments found Fixes: c1736b9008cb ("drm: IRQ midlayer is now legacy") Signed-off-by: Randy Dunlap Cc: Thomas Zimmermann Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211005025312.20913-1-rdunlap@infradead.org Signed-off-by: Maarten Lankhorst commit 11b8e2bb986d23157e82e267fb8cc6b281dfdee9 Author: Mark Brown Date: Tue Sep 21 22:21:02 2021 +0100 video: fbdev: gbefb: Only instantiate device when built for IP32 The gbefb driver not only registers a driver but also the device for that driver. This is all well and good when run on the IP32 machines that are supported by the driver but since the driver supports building with COMPILE_TEST we might also be building on other platforms which do not have this hardware and will crash instantiating the driver. Add an IS_ENABLED() check so we compile out the device registration if we don't have the Kconfig option for the machine enabled. Fixes: 552ccf6b259d290c0c ("video: fbdev: gbefb: add COMPILE_TEST support") Signed-off-by: Mark Brown Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210921212102.30803-1-broonie@kernel.org Signed-off-by: Maarten Lankhorst commit ec7cc3f74b4236860ce612656aa5be7936d1c594 Author: Arnd Bergmann Date: Tue Sep 28 16:52:10 2021 +0200 fbdev: simplefb: fix Kconfig dependencies Configurations with both CONFIG_FB_SIMPLE=y and CONFIG_DRM_SIMPLEDRM=m are allowed by Kconfig because the 'depends on !DRM_SIMPLEDRM' dependency does not disallow FB_SIMPLE as long as SIMPLEDRM is not built-in. This can however result in a build failure when cfb_fillrect() etc are then also in loadable modules: x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x1f8): undefined reference to `cfb_fillrect' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x200): undefined reference to `cfb_copyarea' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x208): undefined reference to `cfb_imageblit' To work around this, change FB_SIMPLE to be a 'tristate' symbol, which still allows both to be =m together, but not one of them to be =y if the other one is =m. If a distro kernel picks this configuration, it can be determined by local policy which of the two modules gets loaded. The 'of_chosen' export is needed as this is the first loadable module referencing it. Alternatively, the Kconfig dependency could be changed to 'depends on DRM_SIMPLEDRM=n', which would forbid the configuration with both drivers. Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Acked-by: Rob Herring # for drivers/of/ Link: https://lore.kernel.org/all/20210721151839.2484245-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann Cc: Thomas Zimmermann Cc: Daniel Vetter # fbdev support Cc: Maxime Ripard Cc: Liam Girdwood Cc: Mark Brown Cc: Daniel Vetter Cc: Borislav Petkov Cc: Javier Martinez Canillas Cc: Randy Dunlap Cc: Geert Uytterhoeven Cc: Peter Collingbourne Cc: Andy Shevchenko Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: # v5.14+ Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210928145243.1098064-1-arnd@kernel.org Signed-off-by: Maarten Lankhorst commit 413e8d06ad896dae9bbc6f97b0abea5eae5495f1 Author: Christophe Branchereau Date: Tue Sep 14 11:27:16 2021 +0200 drm/panel: abt-y030xx067a: yellow tint fix The previous parameters caused an unbalanced yellow tint. Fixes: 7467389bdafb ("drm/panel: Add ABT Y030XX067A 3.0" 320x480 panel") Signed-off-by: Christophe Branchereau Acked-by: Sam Ravnborg [Paul: Add Fixes: tag, and fix case and punctuation in commit message] Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20210914092716.2370039-1-cbranchereau@gmail.com Signed-off-by: Maarten Lankhorst commit 990a9ff072776908bf0654e23df69c30aa9ff945 Author: Krzysztof Kozlowski Date: Thu Aug 19 12:10:19 2021 +0200 dt-bindings: panel: ili9341: correct indentation Correct indentation warning: ilitek,ili9341.yaml:25:9: [warning] wrong indentation: expected 10 but found 8 (indentation) Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210819101020.26368-1-krzysztof.kozlowski@canonical.com (cherry picked from commit 333ba0d9d5d5a2cf1f6bbb754045e4f2cb3ed22d) Link: https://lore.kernel.org/dri-devel/CAL_JsqKcTfgnXNYzGDSFhKS2udhw2Dvk04ODwTxUdDRQjKdT0Q@mail.gmail.com/ Signed-off-by: Maxime Ripard Signed-off-by: Maarten Lankhorst commit 0689ea432a85ad1a108f47c3d90b6feae322c7f9 Author: Ben Skeggs Date: Tue Sep 21 19:07:35 2021 +1000 drm/nouveau/fifo/ga102: initialise chid on return from channel creation Turns out caller isn't zero-initialised after-all. Fixes: 49b2dfc08182 ("drm/nouveau/ga102-: support ttm buffer moves via copy engine") Reported-by: Karol Herbst Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210921090735.247236-1-skeggsb@gmail.com Signed-off-by: Maarten Lankhorst commit 64ec4912c51ad782067e56b106735eaf62ea035c Author: Chris Morgan Date: Thu Sep 16 15:29:07 2021 -0500 drm/rockchip: Update crtc fixup to account for fractional clk change After commit 928f9e268611 ("clk: fractional-divider: Hide clk_fractional_divider_ops from wide audience") was merged it appears that the DSI panel on my Odroid Go Advance stopped working. Upon closer examination of the problem, it looks like it was the fixup in the rockchip_drm_vop.c file was causing the issue. The changes made to the clk driver appear to change some assumptions made in the fixup. After debugging the working 5.14 kernel and the no-longer working 5.15 kernel, it looks like this was broken all along but still worked, whereas after the fractional clock change it stopped working despite the issue (it went from sort-of broken to very broken). In the 5.14 kernel the dclk_vopb_frac was being requested to be set to 17000999 on my board. The clock driver was taking the value of the parent clock and attempting to divide the requested value from it (17000000/17000999 = 0), then subtracting 1 from it (making it -1), and running it through fls_long to get 64. It would then subtract the value of fd->mwidth from it to get 48, and then bit shift 17000999 to the left by 48, coming up with a very large number of 7649082492112076800. This resulted in a numerator of 65535 and a denominator of 1 from the clk driver. The driver seemingly would try again and get a correct 1:1 value later, and then move on. Output from my 5.14 kernel (with some printfs for good measure): [ 2.830066] rockchip-drm display-subsystem: bound ff460000.vop (ops vop_component_ops) [ 2.839431] rockchip-drm display-subsystem: bound ff450000.dsi (ops dw_mipi_dsi_rockchip_ops) [ 2.855980] Clock is dclk_vopb_frac [ 2.856004] Scale 64, Rate 7649082492112076800, Oldrate 17000999, Parent Rate 17000000, Best Numerator 65535, Best Denominator 1, fd->mwidth 16 [ 2.903529] Clock is dclk_vopb_frac [ 2.903556] Scale 0, Rate 17000000, Oldrate 17000000, Parent Rate 17000000, Best Numerator 1, Best Denominator 1, fd->mwidth 16 [ 2.903579] Clock is dclk_vopb_frac [ 2.903583] Scale 0, Rate 17000000, Oldrate 17000000, Parent Rate 17000000, Best Numerator 1, Best Denominator 1, fd->mwidth 16 Contrast this with 5.15 after the clk change where the rate of 17000999 was getting passed and resulted in numerators/denomiators of 17001/ 17000. Output from my 5.15 kernel (with some printfs added for good measure): [ 2.817571] rockchip-drm display-subsystem: bound ff460000.vop (ops vop_component_ops) [ 2.826975] rockchip-drm display-subsystem: bound ff450000.dsi (ops dw_mipi_dsi_rockchip_ops) [ 2.843430] Rate 17000999, Parent Rate 17000000, Best Numerator 17018, Best Denominator 17017 [ 2.891073] Rate 17001000, Parent Rate 17000000, Best Numerator 17001, Best Denominator 17000 [ 2.891269] Rate 17001000, Parent Rate 17000000, Best Numerator 17001, Best Denominator 17000 [ 2.891281] Rate 17001000, Parent Rate 17000000, Best Numerator 17001, Best Denominator 17000 I have tested the change extensively on my Odroid Go Advance (Rockchip RK3326) and it appears to work well. However, this change will affect all Rockchip SoCs that use this driver so I believe further testing is warranted. Please note that without this change I can confirm at least all PX30s with DSI panels will stop working with the 5.15 kernel. Upon advice from Doug Anderson it was decided that we would first check if the clock rate can be set exactly as requested, and only if it could not would we then add 999 to it and attempt the process again. This way we can preserve the behavior for clocks that still need it while resolving the specific issue for the PX30 and DSI panels (since it is using a fractional clock). Changes since v2: - Moved fixes to correct location. Changes since v1: - Made the addition of 999 conditional based on whether the clock subsystem can set the actual clock rate as requested. - Updated the notes in the fixup routine to reflect this new behavior. - Added reference to original commit, as this has technically been broken since then however only now is it an issue due to the clock changes. Fixes: 4e7cf74fa3b2 ("clk: fractional-divider: Export approximation algorithm to the CCF users") Signed-off-by: Chris Morgan Reviewed-by: Douglas Anderson Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210916202907.18394-1-macroalpha82@gmail.com Signed-off-by: Maarten Lankhorst commit 49b2dfc081826874705b27f7970631319628ee7f Author: Ben Skeggs Date: Fri Sep 17 08:04:06 2021 +1000 drm/nouveau/ga102-: support ttm buffer moves via copy engine We don't currently have any kind of real acceleration on Ampere GPUs, but the TTM memcpy() fallback paths aren't really designed to handle copies between different devices, such as on Optimus systems, and result in a kernel OOPS. A few options were investigated to try and fix this, but didn't work out, and likely would have resulted in a very unpleasant experience for users anyway. This commit adds just enough support for setting up a single channel connected to a copy engine, which the kernel can use to accelerate the buffer copies between devices. Userspace has no access to this incomplete channel support, but it's suitable for TTM's needs. A more complete implementation of host(fifo) for Ampere GPUs is in the works, but the required changes are far too invasive that they would be unsuitable to backport to fix this issue on current kernels. v2: fix GPFIFO length in RAMFC (reported by Karol) Signed-off-by: Ben Skeggs Cc: Lyude Paul Cc: Karol Herbst Cc: # v5.12+ Reviewed-by: Karol Herbst Tested-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210916220406.666454-1-skeggsb@gmail.com Signed-off-by: Maarten Lankhorst commit f732e2e34aa08493fdd762f3daa4e5f16bbf1e45 Author: Ben Skeggs Date: Mon Sep 6 10:56:28 2021 +1000 drm/nouveau/kms/tu102-: delay enabling cursor until after assign_windows Prevent NVD core channel error code 67 occuring and hanging display, managed to reproduce on GA102 while testing suspend/resume scenarios. Required extension of earlier commit to fix interactions with EFI. Fixes: e78b1b545c6c ("drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences") Signed-off-by: Ben Skeggs Cc: Lyude Paul Cc: Karol Herbst Cc: # v5.12+ Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210906005628.11499-2-skeggsb@gmail.com Signed-off-by: Maarten Lankhorst commit c64c8e04a12ed3e2238761e26cda78e72550dc98 Author: Jernej Skrabec Date: Wed Sep 15 19:58:36 2021 +0200 drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup Recent rework, which made HDMI PHY driver a platform device, inadvertely reversed clock setup order. HW is very touchy about it. Proper way is to handle controllers resets and clocks first and HDMI PHYs second. Currently, without this fix, first mode set completely fails (nothing on HDMI monitor) on H3 era PHYs. On H6, it still somehow work. Move HDMI PHY reset & clocks handling to sun8i_hdmi_phy_init() which will assure that code is executed after controllers reset & clocks are handled. Additionally, add sun8i_hdmi_phy_deinit() which will deinit them at controllers driver unload. Tested on A64, H3, H6 and R40. Fixes: 9bf3797796f5 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device") Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210915175836.3158839-1-jernej.skrabec@gmail.com Signed-off-by: Maarten Lankhorst commit 5e2e412d47f21c1682e701f946d4114f9885c23f Author: Maxime Ripard Date: Thu Aug 19 16:07:53 2021 +0200 drm/vc4: hdmi: Remove unused struct Commitc7d30623540b ("drm/vc4: hdmi: Remove unused struct") removed the references to the vc4_hdmi_audio_widgets and vc4_hdmi_audio_routes structures, but not the structures themselves resulting in two warnings. Remove it. Fixes: c7d30623540b ("drm/vc4: hdmi: Remove unused struct") Reported-by: kernel test robot Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210819140753.930751-1-maxime@cerno.tech Signed-off-by: Maarten Lankhorst commit c026565fe9be813fe826f7e5533ed763283af5f0 Author: Edmund Dea Date: Fri Dec 4 14:34:29 2020 -0800 drm/kmb: Enable alpha blended second plane Enable one additional plane that is alpha blended on top of the primary plane. This also fixes the below warnings when building with -Warray-bounds: drivers/gpu/drm/kmb/kmb_plane.c:135:20: warning: array subscript 3 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] drivers/gpu/drm/kmb/kmb_plane.c:132:20: warning: array subscript 2 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] drivers/gpu/drm/kmb/kmb_plane.c:129:20: warning: array subscript 1 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] v2: corrected previous patch dependecies so it builds Signed-off-by: Edmund Dea Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.kernel.org/project/dri-devel/patch/20210728003126.1425028-13-anitha.chrisanthus@intel.com/ Signed-off-by: Maarten Lankhorst commit b55ec7528879a822a4d350248daa04bbb27f25fd Author: Stefan Wahren Date: Sat Aug 7 13:06:33 2021 +0200 ARM: dts: bcm2711-rpi-4-b: fix sd_io_1v8_reg regulator states DT schema check complains at sd_io_1v8_reg about the following: [1800000, 1, 3300000, 0] is too long Additional items are not allowed (3300000, 0 were unexpected) So fix the states definition. Fixes: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1628334401-6577-3-git-send-email-stefan.wahren@i2se.com Signed-off-by: Nicolas Saenz Julienne commit 2faff6737a8a684b077264f0aed131526c99eec4 Author: Stefan Wahren Date: Sat Aug 7 13:06:32 2021 +0200 ARM: dts: bcm2711: fix MDIO #address- and #size-cells The values of #address-cells and #size-cells are swapped. Fix this and avoid the following DT schema warnings for mdio@e14: #address-cells:0:0: 1 was expected #size-cells:0:0: 0 was expected Fixes: be8af7a9e3cc ("ARM: dts: bcm2711-rpi-4: Enable GENET support") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1628334401-6577-2-git-send-email-stefan.wahren@i2se.com Signed-off-by: Nicolas Saenz Julienne commit 9287e91e9019d4bc1018adb55ab791ae672e0b14 Author: Mateusz Kwiatkowski Date: Thu Jul 22 21:02:08 2021 +0200 ARM: dts: bcm283x: Fix VEC address for BCM2711 The VEC has a different address (0x7ec13000) on the BCM2711 (used in e.g. Raspberry Pi 4) compared to BCM283x (e.g. Pi 3 and earlier). This was erroneously not taken account for. Definition of the VEC in the devicetrees had to be moved from bcm283x.dtsi to bcm2711.dtsi and bcm2835-common.dtsi to allow for this differentiation. Fixes: 7894bdc6228f ("ARM: boot: dts: bcm2711: Add BCM2711 VEC compatible") Signed-off-by: Mateusz Kwiatkowski Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1626980528-3835-1-git-send-email-stefan.wahren@i2se.com Signed-off-by: Nicolas Saenz Julienne commit ff53c4f6a668ee952c8a2fb494914c97ddbdaf87 Merge: dfffaf0238e5a 57b44817a8d63 Author: Greg Kroah-Hartman Date: Wed Oct 6 09:34:35 2021 +0200 Merge tag 'fpga-maintainer-update' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-linus Moritz writes: FPGA Manager changes for 5.16 The first patch adds Hao and Yilun as additional maintainers for the FPGA Manager subsystem. The second patch removes a now stale reference to a product specific website that no longer reflects the FPGA Manager subsystem. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my for-next branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-maintainer-update' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: MAINTAINERS: Drop outdated FPGA Manager website MAINTAINERS: Add Hao and Yilun as maintainers commit 319933a80fd4f07122466a77f93e5019d71be74c Author: Juergen Gross Date: Tue Oct 5 15:34:33 2021 +0200 xen/balloon: fix cancelled balloon action In case a ballooning action is cancelled the new kernel thread handling the ballooning might end up in a busy loop. Fix that by handling the cancelled action gracefully. While at it introduce a short wait for the BP_WAIT case. Cc: stable@vger.kernel.org Fixes: 8480ed9c2bbd56 ("xen/balloon: use a kernel thread instead a workqueue") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Juergen Gross Tested-by: Jason Andryuk Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20211005133433.32008-1-jgross@suse.com Signed-off-by: Juergen Gross commit 363999901116ffa9a5462215fef25ea9c7f2823c Author: Namjae Jeon Date: Fri Sep 24 09:17:30 2021 +0900 ksmbd: add the check to vaildate if stream protocol length exceeds maximum value This patch add MAX_STREAM_PROT_LEN macro and check if stream protocol length exceeds maximum value. opencode pdu size check in ksmbd_pdu_size_has_room(). Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Acked-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 80d680fdccba214e8106dc1aa33de5207ad75394 Author: Roger Quadros Date: Thu Sep 2 12:58:28 2021 +0300 ARM: dts: omap3430-sdp: Fix NAND device node Nand is on CS1 so reg properties first field should be 1 not 0. Fixes: 44e4716499b8 ("ARM: dts: omap3: Fix NAND device nodes") Cc: stable@vger.kernel.org # v4.6+ Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit b13a270ace2e4c70653aa1d1d0394c553905802f Author: Tony Lindgren Date: Wed Sep 8 08:49:36 2021 +0300 bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 Commit 94f6345712b3 ("bus: ti-sysc: Implement quirk handling for CLKDM_NOAUTO") should have also added the quirk for dra7 dcan1 in addition to dcan2 for errata i893 handling. Let's also pass the quirk flag for legacy mode booting for if "ti,hwmods" dts property is used with related dcan hwmod data. This should be only needed if anybody needs to git bisect earlier stable trees though. Fixes: 94f6345712b3 ("bus: ti-sysc: Implement quirk handling for CLKDM_NOAUTO") Signed-off-by: Tony Lindgren commit e700ac213a0f793fb4f83098413303e3dd080892 Merge: e879f855e590b b232537074fca Author: Tony Lindgren Date: Wed Oct 6 07:55:44 2021 +0300 Merge branch 'pruss-fix' into fixes Merge in a fix for pruss reset issue caused by enabling pruss for am335x. commit 012e974501a270d8dfd4ee2039e1fdf7579c907e Author: Guenter Roeck Date: Sun Aug 1 10:36:59 2021 -0700 xtensa: xtfpga: Try software restart before simulating CPU reset Rebooting xtensa images loaded with the '-kernel' option in qemu does not work. When executing a reboot command, the qemu session either hangs or experiences an endless sequence of error messages. Kernel panic - not syncing: Unrecoverable error in exception handler Reset code jumps to the CPU restart address, but Linux can not recover from there because code and data in the kernel init sections have been discarded and overwritten at this point. XTFPGA platforms have a means to reset the CPU by writing 0xdead into a specific FPGA IO address. When used in QEMU the kernel image loaded with the '-kernel' option gets restored to its original state allowing the machine to boot successfully. Use that mechanism to attempt a platform reset. If it does not work, fall back to the existing mechanism. Signed-off-by: Guenter Roeck Signed-off-by: Max Filippov commit f3d7c2cdf6dc0d5402ec29c3673893b3542c5ad1 Author: Max Filippov Date: Tue Oct 5 11:36:01 2021 -0700 xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF Use platform data to initialize xtfpga device drivers when CONFIG_USE_OF is not selected. This fixes xtfpga networking when CONFIG_USE_OF is not selected but CONFIG_OF is. Signed-off-by: Max Filippov commit fe255fe6ad97685e5a4be0d871f43288dbc10ad6 Author: Joe Lawrence Date: Sun Aug 22 18:50:37 2021 -0400 objtool: Remove redundant 'len' field from struct section The section structure already contains sh_size, so just remove the extra 'len' member that requires extra mirroring and potential confusion. Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20210822225037.54620-3-joe.lawrence@redhat.com Cc: Andy Lavr Cc: Peter Zijlstra Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org commit dc02368164bd0ec603e3f5b3dd8252744a667b8a Author: Joe Lawrence Date: Sun Aug 22 18:50:36 2021 -0400 objtool: Make .altinstructions section entry size consistent Commit e31694e0a7a7 ("objtool: Don't make .altinstructions writable") aligned objtool-created and kernel-created .altinstructions section flags, but there remains a minor discrepency in their use of a section entry size: objtool sets one while the kernel build does not. While sh_entsize of sizeof(struct alt_instr) seems intuitive, this small deviation can cause failures with external tooling (kpatch-build). Fix this by creating new .altinstructions sections with sh_entsize of 0 and then later updating sec->sh_size as alternatives are added to the section. An added benefit is avoiding the data descriptor and buffer created by elf_create_section(), but previously unused by elf_add_alternative(). Fixes: 9bc0bb50727c ("objtool/x86: Rewrite retpoline thunk calls") Signed-off-by: Joe Lawrence Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20210822225037.54620-2-joe.lawrence@redhat.com Cc: Andy Lavr Cc: Peter Zijlstra Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org commit 4d8b35968bbf9e42b6b202eedb510e2c82ad8b38 Author: Josh Poimboeuf Date: Mon Oct 4 10:07:50 2021 -0700 objtool: Remove reloc symbol type checks in get_alt_entry() Converting a special section's relocation reference to a symbol is straightforward. No need for objtool to complain that it doesn't know how to handle it. Just handle it. This fixes the following warning: arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception Fixes: 24ff65257375 ("objtool: Teach get_alt_entry() about more relocation types") Reported-by: Linus Torvalds Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/feadbc3dfb3440d973580fad8d3db873cbfe1694.1633367242.git.jpoimboe@redhat.com Cc: Peter Zijlstra Cc: x86@kernel.org Cc: Miroslav Benes Cc: linux-kernel@vger.kernel.org commit dfffaf0238e5aad7b8c1c5362829f5dfed0902dd Merge: 75c10c5e7a715 2a2a79577ddae Author: Greg Kroah-Hartman Date: Tue Oct 5 20:29:44 2021 +0200 Merge tag 'fpga-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager fixes for 5.15 Mark's fix adds a MODULE_DEVICE_TABLE to ensure module autoloading works for the Lattice ice-40-spi FPGA Manager driver. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my fixes branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: ice40-spi: Add SPI device ID table commit 0b6c5371c03c2b17963e1abd7ed0e3f1f950cba9 Author: Kan Liang Date: Thu Sep 30 12:52:46 2021 -0700 perf tests attr: Add missing topdown metrics events The Topdown metrics events were added as 'perf stat' default events since commit 42641d6f4d15e6db ("perf stat: Add Topdown metrics events as default events"). However, the perf attr tests were not updated accordingly. The perf attr test fails on the platform which supports Topdown metrics. # perf test 17 17: Setup struct perf_event_attr :FAILED! Add Topdown metrics events into perf attr test cases. Make them optional since they are only available on newer platforms. Fixes: 42641d6f4d15e6db ("perf stat: Add Topdown metrics events as default events") Reported-by: kernel test robot Signed-off-by: Kan Liang Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/1633031566-176517-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 60a9483534ed0d99090a2ee1d4bb0b8179195f51 Merge: f6274b06e326d ef31499a87cf8 Author: Linus Torvalds Date: Tue Oct 5 10:52:53 2021 -0700 Merge tag 'warning-fixes-20211005' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull misc fs warning fixes from David Howells: "The first four patches fix kerneldoc warnings in fscache, afs, 9p and nfs - they're mostly just comment changes, though there's one place in 9p where a comment got detached from the function it was attached to (v9fs_fid_add) and has to switch places with a function that got inserted between (__add_fid). The patch on the end removes an unused symbol in fscache" * tag 'warning-fixes-20211005' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: fscache: Remove an unused static variable fscache: Fix some kerneldoc warnings shown up by W=1 9p: Fix a bunch of kerneldoc warnings shown up by W=1 afs: Fix kerneldoc warning shown up by W=1 nfs: Fix kerneldoc warning shown up by W=1 commit 9fce636e5c7dd84873f096ae4d094fb6bd797f9f Author: Arnaldo Carvalho de Melo Date: Wed Feb 12 11:04:23 2020 -0300 tools include UAPI: Sync sound/asound.h copy with the kernel sources Picking the changes from: 09d23174402da0f1 ("ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION") Which entails no changes in the tooling side as it doesn't introduce new SNDRV_PCM_IOCTL_ ioctls. To silence this perf tools build warning: Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h' diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Arnaldo Carvalho de Melo commit 35c46bf545b31c961f216dd228bf9cba5499e5f0 Author: Branislav Rankov Date: Wed Jul 21 11:32:58 2021 +0100 perf build: Fix plugin static linking with libopencsd on ARM and ARM64 Filter out -static flag when building plugins as they are always built as dynamic libraries and -static and -dynamic don't work well together on arm and arm64. Signed-off-by: Branislav Rankov Acked-by: Jiri Olsa Cc: Ingo Molnar Cc: Mark Brown Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: nd@arm.com Link: https://lore.kernel.org/r/e88952b3-2470-da96-dee9-e247a1759cd0@arm.com Signed-off-by: Tamas Zsoldos [ Split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 573cf5c9a152da1569b993600daa21ede30eeccb Author: Branislav Rankov Date: Wed Jul 21 11:32:58 2021 +0100 perf build: Add missing -lstdc++ when linking with libopencsd Add -lstdc++ to perf when linking libopencsd as it is a dependency. It does not hurt to add it when dynamic linking. Signed-off-by: Branislav Rankov Acked-by: Jiri Olsa Cc: Ingo Molnar Cc: Mark Brown Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: nd@arm.com Link: https://lore.kernel.org/r/e88952b3-2470-da96-dee9-e247a1759cd0@arm.com Signed-off-by: Tamas Zsoldos [ Split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit b94729919db2c6737501c36ea6526a36d5d63fa2 Author: Like Xu Date: Tue Sep 28 18:29:38 2021 +0800 perf jevents: Free the sys_event_tables list after processing entries The compiler reports that free_sys_event_tables() is dead code. But according to the semantics, the "LIST_HEAD(sys_event_tables)" should also be released, just like we do with 'arch_std_events' in main(). Fixes: e9d32c1bf0cd7a98 ("perf vendor events: Add support for arch standard events") Signed-off-by: Like Xu Reviewed-by: John Garry Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210928102938.69681-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo commit 248b061689a40f4fed05252ee2c89f87cf26d7d8 Author: Guchun Chen Date: Fri Oct 1 09:48:50 2021 +0800 drm/amdgpu: handle the case of pci_channel_io_frozen only in amdgpu_pci_resume In current code, when a PCI error state pci_channel_io_normal is detectd, it will report PCI_ERS_RESULT_CAN_RECOVER status to PCI driver, and PCI driver will continue the execution of PCI resume callback report_resume by pci_walk_bridge, and the callback will go into amdgpu_pci_resume finally, where write lock is releasd unconditionally without acquiring such lock first. In this case, a deadlock will happen when other threads start to acquire the read lock. To fix this, add a member in amdgpu_device strucutre to cache pci_channel_state, and only continue the execution in amdgpu_pci_resume when it's pci_channel_io_frozen. Fixes: c9a6b82f45e2 ("drm/amdgpu: Implement DPC recovery") Suggested-by: Andrey Grodzovsky Signed-off-by: Guchun Chen Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 714d9e4574d54596973ee3b0624ee4a16264d700 Author: Yifan Zhang Date: Tue Sep 28 15:42:35 2021 +0800 drm/amdgpu: init iommu after amdkfd device init This patch is to fix clinfo failure in Raven/Picasso: Number of platforms: 1 Platform Profile: FULL_PROFILE Platform Version: OpenCL 2.2 AMD-APP (3364.0) Platform Name: AMD Accelerated Parallel Processing Platform Vendor: Advanced Micro Devices, Inc. Platform Extensions: cl_khr_icd cl_amd_event_callback Platform Name: AMD Accelerated Parallel Processing Number of devices: 0 Signed-off-by: Yifan Zhang Reviewed-by: James Zhu Tested-by: James Zhu Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0dd10a961f2aa39d02e9aa2194946713cb36d403 Author: Yifan Zhang Date: Fri Sep 24 11:15:35 2021 +0800 drm/amdkfd: remove redundant iommu cleanup code kfd_resume doesn't involve iommu operation, remove redundant iommu cleanup code. Signed-off-by: Yifan Zhang Reviewed-by: James Zhu Tested-by: James Zhu Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 81967efb5f3966e8692f9173c7fa2964034ece5d Author: Saravana Kannan Date: Tue Sep 28 17:07:34 2021 -0700 drivers: bus: Delete CONFIG_SIMPLE_PM_BUS The simple-pm-bus driver is mandatory for CONFIG_OF based platforms to work with fw_devlink. So, always compile it in for CONFIG_OF and delete the config since it's no longer necessary. Tested-by: Ulf Hansson Tested-by: Geert Uytterhoeven Tested-by: Damien Le Moal Cc: Rob Herring Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210929000735.585237-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 98e96cf80045a383fcc47c58dd4e87b3ae587b3e Author: Saravana Kannan Date: Tue Sep 28 17:07:33 2021 -0700 drivers: bus: simple-pm-bus: Add support for probing simple bus only devices fw_devlink could end up creating device links for bus only devices. However, bus only devices don't get probed and can block probe() or sync_state() [1] call backs of other devices. To avoid this, probe these devices using the simple-pm-bus driver. However, there are instances of devices that are not simple buses (they get probed by their specific drivers) that also list the "simple-bus" (or other bus only compatible strings) in their compatible property to automatically populate their child devices. We still want these devices to get probed by their specific drivers. So, we make sure this driver only probes devices that are only buses. [1] - https://lore.kernel.org/lkml/CAPDyKFo9Bxremkb1dDrr4OcXSpE0keVze94Cm=zrkOVxHHxBmQ@mail.gmail.com/ Fixes: c442a0d18744 ("driver core: Set fw_devlink to "permissive" behavior by default") Cc: stable Cc: Rob Herring Tested-by: Saravana Kannan Tested-by: Ulf Hansson Tested-by: Geert Uytterhoeven Tested-by: Damien Le Moal Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210929000735.585237-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit f729a592adb6760013c3e48622a5bf256b992452 Author: Saravana Kannan Date: Wed Sep 29 12:05:49 2021 -0700 driver core: Reject pointless SYNC_STATE_ONLY device links SYNC_STATE_ONLY device links intentionally allow cycles because cyclic sync_state() dependencies are valid and necessary. However a SYNC_STATE_ONLY device link where the consumer and the supplier are the same device is pointless because the device link would be deleted as soon as the device probes (because it's also the consumer) and won't affect when the sync_state() callback is called. It's a waste of CPU cycles and memory to create this device link. So reject any attempts to create such a device link. Fixes: 05ef983e0d65 ("driver core: Add device link support for SYNC_STATE_ONLY flag") Cc: stable Reported-by: Ulf Hansson Reviewed-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210929190549.860541-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 4702b34d1de9582df9dfa0e583ea28fff7de29df Author: Alex Deucher Date: Fri Oct 1 15:40:00 2021 -0400 drm/amdgpu/display: fix dependencies for DRM_AMD_DC_SI Depends on DRM_AMDGPU_SI and DRM_AMD_DC Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1d617c029fd9c960f8ba7a8d1a10699d820bd6b9 Author: Lijo Lazar Date: Fri Oct 1 16:49:07 2021 +0800 drm/amdgpu: During s0ix don't wait to signal GFXOFF In the rare event when GFX IP suspend coincides with a s0ix entry, don't schedule a delayed work, instead signal PMFW immediately to allow GFXOFF entry. GFXOFF is a prerequisite for s0ix entry. PMFW needs to be signaled about GFXOFF status before amd-pmc module passes OS HINT to PMFW telling that everything is ready for a safe s0ix entry. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1712 Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d08ce8c6d29f8cc7493b781be282604b10fc6e1e Author: Alex Deucher Date: Wed Sep 29 13:42:08 2021 -0400 Documentation/gpu: remove spurious "+" in amdgpu.rst Not sure why that was there. Remove it. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b072ef1215aca33186e3a10109e872e528a9e516 Author: Lang Yu Date: Wed Sep 29 14:54:39 2021 +0800 drm/amdkfd: fix a potential ttm->sg memory leak Memory is allocated for ttm->sg by kmalloc in kfd_mem_dmamap_userptr, but isn't freed by kfree in kfd_mem_dmaunmap_userptr. Free it! Fixes: 264fb4d332f5 ("drm/amdgpu: Add multi-GPU DMA mapping helpers") Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7ab0965079bbc0e39fe0e1df4dcdf931c9d25372 Author: Jude Shih Date: Mon Oct 4 22:40:50 2021 +0800 drm/amd/display: USB4 bring up set correct address [Why] YELLOW_CARP_B0 address was not correct [How] Set YELLOW_CARP_B0 to 0x1A. Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Jude Shih Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 95dd8b2c1ed00c76aaf41b552041c90724749a53 Author: Konstantin Komarov Date: Tue Oct 5 17:22:29 2021 +0300 fs/ntfs3: Remove unnecessary functions We don't need ntfs_xattr_get_acl and ntfs_xattr_set_acl. There are ntfs_get_acl_ex and ntfs_set_acl_ex. Signed-off-by: Konstantin Komarov commit 75c10c5e7a715550afdd51ef8cfd1d975f48f9e1 Author: Andy Shevchenko Date: Fri Oct 1 20:36:44 2021 +0300 mei: me: add Ice Lake-N device id. Add Ice Lake-N device ID. The device can be found on MacBookPro16,2 [1]. [1]: https://linux-hardware.org/?probe=f1c5cf0c43 Signed-off-by: Andy Shevchenko Cc: stable Link: https://lore.kernel.org/r/20211001173644.16068-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2fe9a0e1173f4805669e7af34ea25af835274426 Author: Liu, Zhan Date: Thu Sep 2 15:08:29 2021 -0400 drm/amd/display: Fix DCN3 B0 DP Alt Mapping [Why] DCN3 B0 has a mux, which redirects PHYC and PHYD to PHYF and PHYG. [How] Fix DIG mapping. Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Zhan Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org (cherry picked from commit 4b7786d87fb3adf3e534c4f1e4f824d8700b786b) commit 45d65c0f09aaa6cdd21fe0743f317d4bbdfd1466 Author: Liu, Zhan Date: Thu Sep 9 13:26:37 2021 -0400 drm/amd/display: Fix B0 USB-C DP Alt mode [Why] Starting from B0, along with RDPCSTX, RDPCSPIPE registers are also used. [How] Make sure RDPCSPIPE registers are programmed correctly. Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Zhan Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org (cherry picked from commit bdd1a21b52557ea8f61d0a5dc2f77151b576eb70) commit 137879f7ff23c635d2c6b2e43f4b39e2d305c3e2 Author: Mark Brown Date: Wed Sep 22 19:40:48 2021 +0100 eeprom: 93xx46: Add SPI device ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI device ID table. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210922184048.34770-1-broonie@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9e2cd444909b3c93f5cc83463d12291e3e0f990b Author: Mark Brown Date: Thu Sep 23 18:24:53 2021 +0100 eeprom: at25: Add SPI ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210923172453.4921-1-broonie@kernel.org Signed-off-by: Greg Kroah-Hartman commit 97d8ebead87b7457ba5c4f4e7860b8fc8cf013fd Author: Randy Dunlap Date: Sun Oct 3 17:16:41 2021 -0700 misc: HI6421V600_IRQ should depend on HAS_IOMEM MFD_CORE depends on HAS_IOMEM so anything that selects MFD_CORE should also depend on HAS_IOMEM since 'select' does not check any dependencies of the symbol that is being selected. Prevents this kconfig warning: WARNING: unmet direct dependencies detected for MFD_CORE Depends on [n]: HAS_IOMEM [=n] Selected by [m]: - HI6421V600_IRQ [=m] && OF [=y] && SPMI [=m] Fixes: bb3b6552a5b0 ("staging: hikey9xx: split hi6421v600 irq into a separate driver") Cc: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20211004001641.23180-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 8241fffae7c8bab5cec5fc8bcaceccd03079e3aa Author: Konstantin Komarov Date: Tue Sep 28 20:04:10 2021 +0300 fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files FALLOC_FL_PUNCH_HOLE isn't allowed with normal files. Filesystem must remember info about hole, but for normal file we can only zero it and forget. Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Now xfstests generic/016 generic/021 generic/022 pass. Signed-off-by: Konstantin Komarov commit f9a470db2736b01538ad193c316eb3f26be37d58 Author: Srinivas Kandagatla Date: Wed Sep 22 16:43:26 2021 +0100 misc: fastrpc: Add missing lock before accessing find_vma() fastrpc driver is using find_vma() without any protection, as a result we see below warning due to recent patch 5b78ed24e8ec ("mm/pagemap: add mmap_assert_locked() annotations to find_vma*()") which added mmap_assert_locked() in find_vma() function. This bug went un-noticed in previous versions. Fix this issue by adding required protection while calling find_vma(). CPU: 0 PID: 209746 Comm: benchmark_model Not tainted 5.15.0-rc2-00445-ge14fe2bf817a-dirty #969 Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : find_vma+0x64/0xd0 lr : find_vma+0x60/0xd0 sp : ffff8000158ebc40 ... Call trace: find_vma+0x64/0xd0 fastrpc_internal_invoke+0x570/0xda8 fastrpc_device_ioctl+0x3e0/0x928 __arm64_sys_ioctl+0xac/0xf0 invoke_syscall+0x44/0x100 el0_svc_common.constprop.3+0x70/0xf8 do_el0_svc+0x24/0x88 el0_svc+0x3c/0x138 el0t_64_sync_handler+0x90/0xb8 el0t_64_sync+0x180/0x184 Fixes: 80f3afd72bd4 ("misc: fastrpc: consider address offset before sending to DSP") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210922154326.8927-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 42641042c10c757fe10cc09088cf3f436cec5007 Author: Arnd Bergmann Date: Mon Sep 27 14:13:57 2021 +0200 cb710: avoid NULL pointer subtraction clang-14 complains about an unusual way of converting a pointer to an integer: drivers/misc/cb710/sgbuf2.c:50:15: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] return ((ptr - NULL) & 3) != 0; Replace this with a normal cast to uintptr_t. Fixes: 5f5bac8272be ("mmc: Driver for CB710/720 memory card reader (MMC part)") Cc: stable Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210927121408.939246-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit a3e16937319aea285c64ab5bf8464470afac8dd3 Author: Mark Brown Date: Thu Sep 23 20:46:09 2021 +0100 misc: gehc: Add SPI ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI ID table entry for the device name part of the compatible - currently only the full compatible is listed which isn't very idiomatic and won't match the modalias that is generated. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Cc: stable Tested-by: Martyn Welch Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210923194609.52647-1-broonie@kernel.org Signed-off-by: Greg Kroah-Hartman commit 34186b48d29bb961b24ece417170e74289550a13 Author: Arnd Bergmann Date: Mon Sep 27 16:53:25 2021 +0200 ARM: sharpsl_param: work around -Wstringop-overread warning gcc warns that accessing a pointer based on a numeric constant may be an offset into a NULL pointer, and would therefore has zero accessible bytes: arch/arm/common/sharpsl_param.c: In function ‘sharpsl_save_param’: arch/arm/common/sharpsl_param.c:43:9: error: ‘memcpy’ reading 64 bytes from a region of size 0 [-Werror=stringop-overread] 43 | memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this particular case, the warning is bogus since this is the actual pointer, not an offset on a NULL pointer. Add a local variable to shut up the warning and hope it doesn't come back. Signed-off-by: Arnd Bergmann Acked-by: Daniel Mack Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Cc: Russell King Cc: Linus Walleij Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 Link: https://lore.kernel.org/r/20210927145332.2784005-1-arnd@kernel.org' Signed-off-by: Arnd Bergmann commit efa767b37229775fc09a4f5a2b27f72a79afa860 Merge: a6949059318a0 c54467482ffd4 Author: Arnd Bergmann Date: Tue Oct 5 15:41:15 2021 +0200 Merge tag 'imx-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.15: - Revert cc8870bf4c3a to fix the regression on i.MX6 that suspend support becomes broken. - Add `qca,clk-out-frequency` property to fix Ethernet support on imx6qdl-pico board. - Re-enable FB support in imx_v6_v7_defconfig. It gets lost due to f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB"). - Fix LP5562 LED support on imx6dl-yapp4 board. - Add missing pinctrl-names for panel on M53Menlo board. - Fix USB host power regulator polarity on M53Menlo board. * tag 'imx-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: enable fb ARM: dts: imx6qdl-pico: Fix Ethernet support ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo ARM: dts: imx: Add missing pinctrl-names for panel on M53Menlo Revert "ARM: imx6q: drop of_platform_default_populate() from init_machine" ARM: dts: imx6dl-yapp4: Fix lp5562 LED driver probe Link: https://lore.kernel.org/r/20210923063356.GK13480@dragon Signed-off-by: Arnd Bergmann commit a6949059318a064880050c76a9d8fb070156385f Author: Linus Walleij Date: Wed Sep 22 22:09:33 2021 +0200 ARM: defconfig: gemini: Restore framebuffer The framebuffer is gone on the D-Link DIR-685, restore it. Fixes: f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") Signed-off-by: Linus Walleij Cc: Kees Cook Link: https://lore.kernel.org/r/20210922200933.1825752-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit b9af50bcbcd2344640e4c2937bd2af1f856a4ced Author: Arnd Bergmann Date: Mon Sep 27 11:53:33 2021 +0200 ARM: dove: mark 'putc' as inline This can cause a randconfig warning without the 'inline' flag that every other platform uses: In file included from arch/arm/boot/compressed/misc.c:29: arch/arm/mach-dove/include/mach/uncompress.h:14:13: error: 'putc' defined but not used [-Werror=unused-function] 14 | static void putc(const char c) | ^~~~ Signed-off-by: Arnd Bergmann Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210927095343.1015422-1-arnd@kernel.org' Signed-off-by: Arnd Bergmann commit 94ad8aacbc2d4908b052c8bdb5ae13bc702f77ea Author: Arnd Bergmann Date: Mon Sep 27 16:40:50 2021 +0200 ARM: omap1: move omap15xx local bus handling to usb.c Commit 38225f2ef2f4 ("ARM/omap1: switch to use dma_direct_set_offset for lbus DMA offsets") removed a lot of mach/memory.h, but left the USB offset handling split into arch/arm/mach-omap1/usb.c and drivers/usb/host/ohci-omap.c. This can cause a randconfig build warning that now fails the build with -Werror: arch/arm/mach-omap1/usb.c:561:30: error: 'omap_1510_usb_ohci_nb' defined but not used [-Werror=unused-variable] 561 | static struct notifier_block omap_1510_usb_ohci_nb = { | ^~~~~~~~~~~~~~~~~~~~~ Move it all into the platform file to get rid of the final location that relies on mach/memory.h. Acked-by: Felipe Balbi Acked-by: Alan Stern Acked-by: Tony Lindgren Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20210927144118.2464881-1-arnd@kernel.org' Signed-off-by: Arnd Bergmann commit cff32466bf851bf29cd491d8a3cbeb4dc4a36ab6 Author: Konstantin Komarov Date: Fri Sep 24 17:53:56 2021 +0300 fs/ntfs3: Refactoring of ntfs_set_ea Make code more readable. Don't try to read zero bytes. Add warning when size of exteneded attribute exceeds limit. Signed-off-by: Konstantin Komarov commit d81e06be921f90d5f1bada59d4549ca6f1bedc61 Author: Konstantin Komarov Date: Fri Sep 24 17:50:22 2021 +0300 fs/ntfs3: Remove locked argument in ntfs_set_ea We always need to lock now, because locks became smaller (see d562e901f25d "fs/ntfs3: Move ni_lock_dir and ni_unlock into ntfs_create_inode"). Signed-off-by: Konstantin Komarov commit b1e0c55a409955aba2d5a151f3f3a8bda8e45193 Author: Konstantin Komarov Date: Fri Sep 24 17:47:04 2021 +0300 fs/ntfs3: Use available posix_acl_release instead of ntfs_posix_acl_release We don't need to maintain ntfs_posix_acl_release. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 6147eb53bb80a8d12f1c9de4e3474bc9524053ec Merge: 04e0ae8d2b96a 4382c73a12b4c Author: Arnd Bergmann Date: Tue Oct 5 15:38:03 2021 +0200 Merge tag 'qcom-drivers-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm driver fixes for v5.15 This restricts the QCOM_SCM driver to depend on ARCH_QCOM, to reduce it's presence after becoming a loadable module. It then fixes a regression in the mdt_loader, where firmware with the hash segment marked as PT_LOAD would no longer be accepted, preventing several MSM8974 and SDM660 devices from loading remoteproc firmware. Lastly it corrects the drvdata associated with the socinfo device during probe, to match that expected by the remove function. * tag 'qcom-drivers-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: firmware: qcom_scm: QCOM_SCM should depend on ARCH_QCOM soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment soc: qcom: socinfo: Fixed argument passed to platform_set_data() Link: https://lore.kernel.org/r/20210930025456.1035-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 04e0ae8d2b96a3d992e1024b215071c61e45512f Merge: 2ecfddb105b68 1878f4b7ec9ed Author: Arnd Bergmann Date: Tue Oct 5 15:37:02 2021 +0200 Merge tag 'qcom-arm64-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 DTS fixes for 5.15 This starts by reverting the SC7280 CPUfreq update, which was merged before concensus about the associated drivers changes was reached. It then moves the reserved-memory changes done to get IPA working on the Lenovo Yoga C630 into the Yoga specific DTS, as changing the memory map on the platform level did break a couple of the other boards. It fixes the HDMI audio on Trogdor and add missing Aggre2 NOC qos clocks on SDM6{30,36,60} which prevented some boards from booting. Lastly it enables the PON module on SM8250/QRB5165, as the lack thereof is blocking automated testing in LKFT. * tag 'qcom-arm64-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: dts: qcom: sdm630: Add missing a2noc qos clocks arm64: dts: qcom: qrb5165-rb5: enabled pwrkey and resin nodes arm64: dts: qcom: pm8150: specify reboot mode magics arm64: dts: qcom: pm8150: use qcom,pm8998-pon binding arm64: dts: qcom: sc7180-trogdor: Fix lpass dai link for HDMI arm64: dts: qcom: sdm850-yoga: Reshuffle IPA memory mappings Revert "arm64: dts: qcom: sc7280: Fixup the cpufreq node" Link: https://lore.kernel.org/r/20210930025509.1091-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 2ecfddb105b6815c4baee7055b137667ff0b26f6 Merge: c147392b652b6 319aeaf69c85d Author: Arnd Bergmann Date: Tue Oct 5 15:36:02 2021 +0200 Merge tag 'juno-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Juno/Vexpress fixes for v5.15 Bunch of DTS fixes to resolve addressing issues with some of the device nodes, dropping unused/undocumented properties in various nodes, and aligning node names with dtschema. * tag 'juno-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm: dts: vexpress: Fix motherboard bus 'interrupt-map' arm: dts: vexpress: Fix addressing issues with 'motherboard-bus' nodes arm: dts: vexpress-v2p-ca9: Fix the SMB unit-address arm: dts: vexpress: Drop unused properties from motherboard node arm64: dts: arm: drop unused interrupt-names in MHU ARM: dts: arm: align watchdog and mmc node names with dtschema arm64: dts: arm: align watchdog and mmc node names with dtschema arm64: dts: fvp: Remove panel timings Link: https://lore.kernel.org/r/20210927105249.3583380-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit c147392b652b6af7d96f1f844a4938a6bb4921b8 Merge: 325c81e3fd52c ecf5b34cd5182 Author: Arnd Bergmann Date: Tue Oct 5 15:33:31 2021 +0200 Merge tag 'qcom-dts-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm DTS fixes for v5.15 This corrects the use of depricated chipid and clock names, for which support was finally dropped from the driver. It also ensures that the DSI PLL is fed by the correct clock, now that it's being migrated to not rely on global clock names. * tag 'qcom-dts-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: apq8064: update Adreno clock names ARM: dts: qcom: apq8064: Use 27MHz PXO clock as DSI PLL reference ARM: dts: qcom: apq8064: use compatible which contains chipid Link: https://lore.kernel.org/r/20210930025526.1146-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 325c81e3fd52cb4dce1f5e7cc789bc82f2772ab2 Merge: dd6a2ed801db6 dbe68bc9e82b6 Author: Arnd Bergmann Date: Tue Oct 5 15:32:30 2021 +0200 Merge tag 'at91-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes #2 for 5.15: - More fixes for AT91 platform power management code related to the introduction of sama7g5: - management of DDR3L regulator rails for sama7g5ek - loading of TLB on different cores - PIO controller slew-rate settings for sama7g5ek: be aligned with datasheet requirements. * tag 'at91-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs ARM: at91: pm: preload base address of controllers in tlb ARM: at91: pm: group constants and addresses loading ARM: dts: at91: sama7g5ek: add suspend voltage for ddr3l rail Link: https://lore.kernel.org/r/20211004114344.19304-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit dd6a2ed801db6afde68330cb529cf78550b7a937 Author: Nishanth Menon Date: Wed Sep 15 07:13:08 2021 -0500 MAINTAINERS: Add Vignesh to TI K3 platform maintainership Add Vignesh to TI K3 platform maintainership. We will rotate roles for each kernel version to help spread the work load a little better. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20210915121308.26795-1-nm@ti.com' Signed-off-by: Arnd Bergmann commit f81fd21476187275b0d8181fbe8c18a6f47d9139 Merge: d0c624c03012e 88a3856c0a8c0 Author: Arnd Bergmann Date: Tue Oct 5 15:30:43 2021 +0200 Merge tag 'optee-fix-for-v5.15' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes Fix OP-TEE shm_pool lint warning * tag 'optee-fix-for-v5.15' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee/optee/shm_pool: fix application of sizeof to pointer Link: https://lore.kernel.org/r/20210915113813.GA509196@jade Signed-off-by: Arnd Bergmann commit cb2282213e84f04ab7e93fd4537815da5db2f010 Author: Johan Hovold Date: Fri Sep 24 16:12:32 2021 +0200 serial: 8250: allow disabling of Freescale 16550 compile test The SERIAL_8250_FSL option is used to enable a workaround for a break-detection erratum for Freescale 16550 UARTs in the 8250 driver and is currently also used to enable support for ACPI enumeration. It is enabled on PPC, ARM and ARM64 whenever 8250 console support is enabled (since the quirk is needed for sysrq handling). Commit b1442c55ce89 ("serial: 8250: extend compile-test coverage") enabled compile testing of the code in question but did not provide a means to disable the option when COMPILE_TEST is enabled. Add a conditional input prompt instead so that SERIAL_8250_FSL is no longer enabled by default when compile testing while continuing to always enable the quirk for platforms that may need it. Fixes: b1442c55ce89 ("serial: 8250: extend compile-test coverage") Reported-by: Geert Uytterhoeven Signed-off-by: Johan Hovold Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210924141232.4419-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 6e6a8ef088e1222cb1250942f51ad9c1ab219ab2 Author: Quentin Perret Date: Tue Oct 5 13:20:31 2021 +0100 KVM: arm64: Release mmap_lock when using VM_SHARED with MTE VM_SHARED mappings are currently forbidden in a memslot with MTE to prevent two VMs racing to sanitise the same page. However, this check is performed while holding current->mm's mmap_lock, but fails to release it. Fix this by releasing the lock when needed. Fixes: ea7fc1bb1cd1 ("KVM: arm64: Introduce MTE VM feature") Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211005122031.809857-1-qperret@google.com commit 7707a4d01a648e4c655101a469c956cb11273655 Author: Eric Dumazet Date: Mon Oct 4 14:24:15 2021 -0700 netlink: annotate data races around nlk->bound While existing code is correct, KCSAN is reporting a data-race in netlink_insert / netlink_sendmsg [1] It is correct to read nlk->bound without a lock, as netlink_autobind() will acquire all needed locks. [1] BUG: KCSAN: data-race in netlink_insert / netlink_sendmsg write to 0xffff8881031c8b30 of 1 bytes by task 18752 on cpu 0: netlink_insert+0x5cc/0x7f0 net/netlink/af_netlink.c:597 netlink_autobind+0xa9/0x150 net/netlink/af_netlink.c:842 netlink_sendmsg+0x479/0x7c0 net/netlink/af_netlink.c:1892 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] ____sys_sendmsg+0x360/0x4d0 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmsg+0x1ed/0x270 net/socket.c:2475 __do_sys_sendmsg net/socket.c:2484 [inline] __se_sys_sendmsg net/socket.c:2482 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2482 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff8881031c8b30 of 1 bytes by task 18751 on cpu 1: netlink_sendmsg+0x270/0x7c0 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] __sys_sendto+0x2a8/0x370 net/socket.c:2019 __do_sys_sendto net/socket.c:2031 [inline] __se_sys_sendto net/socket.c:2027 [inline] __x64_sys_sendto+0x74/0x90 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x00 -> 0x01 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 18751 Comm: syz-executor.0 Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: da314c9923fe ("netlink: Replace rhash_portid with bound") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit e3cf002d5a4452f8adc5543df341cf96fd702fcf Author: Wong Vee Khee Date: Tue Oct 5 11:45:21 2021 +0800 net: pcs: xpcs: fix incorrect CL37 AN sequence According to Synopsys DesignWare Cores Ethernet PCS databook, it is required to disable Clause 37 auto-negotiation by programming bit-12 (AN_ENABLE) to 0 if it is already enabled, before programming various fields of VR_MII_AN_CTRL registers. After all these programming are done, it is then required to enable Clause 37 auto-negotiation by programming bit-12 (AN_ENABLE) to 1. Fixes: b97b5331b8ab ("net: pcs: add C37 SGMII AN support for intel mGbE controller") Cc: Vladimir Oltean Signed-off-by: Wong Vee Khee Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 25a9da6641f1f66006e93ddbefee13a437efa8c0 Author: Sean Anderson Date: Mon Oct 4 17:50:02 2021 -0400 net: sfp: Fix typo in state machine debug string The string should be "tx_disable" to match the state enum. Fixes: 4005a7cb4f55 ("net: phy: sftp: print debug message with text, not numbers") Signed-off-by: Sean Anderson Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit beb76cb4eebf9ac4ff15312e33f97db621b46da7 Author: Lukas Bulwahn Date: Tue Oct 5 09:54:50 2021 +0200 MAINTAINERS: rectify entry for SY8106A REGULATOR DRIVER Commit b1c36aae51c9 ("regulator: Convert SY8106A binding to a schema") converts sy8106a-regulator.txt to silergy,sy8106a.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 SY8106A REGULATOR DRIVER. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211005075451.29691-11-lukas.bulwahn@gmail.com Signed-off-by: Mark Brown commit 7615c2a514788559c6684234b8fc27f3a843c2c6 Author: Quentin Perret Date: Tue Oct 5 10:01:42 2021 +0100 KVM: arm64: Report corrupted refcount at EL2 Some of the refcount manipulation helpers used at EL2 are instrumented to catch a corrupted state, but not all of them are treated equally. Let's make things more consistent by instrumenting hyp_page_ref_dec_and_test() as well. Acked-by: Will Deacon Suggested-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211005090155.734578-6-qperret@google.com commit 1d58a17ef54599506d44c45ac95be27273a4d2b1 Author: Quentin Perret Date: Tue Oct 5 10:01:41 2021 +0100 KVM: arm64: Fix host stage-2 PGD refcount The KVM page-table library refcounts the pages of concatenated stage-2 PGDs individually. However, when running KVM in protected mode, the host's stage-2 PGD is currently managed by EL2 as a single high-order compound page, which can cause the refcount of the tail pages to reach 0 when they shouldn't, hence corrupting the page-table. Fix this by introducing a new hyp_split_page() helper in the EL2 page allocator (matching the kernel's split_page() function), and make use of it from host_s2_zalloc_pages_exact(). Fixes: 1025c8c0c6ac ("KVM: arm64: Wrap the host with a stage 2") Acked-by: Will Deacon Suggested-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211005090155.734578-5-qperret@google.com commit 58fc1daa4d2e9789b9ffc880907c961ea7c062cc Author: Johan Hovold Date: Wed Sep 29 11:09:37 2021 +0200 USB: cdc-acm: fix break reporting A recent change that started reporting break events forgot to push the event to the line discipline, which meant that a detected break would not be reported until further characters had been receive (the port could even have been closed and reopened in between). Fixes: 08dff274edda ("cdc-acm: fix BREAK rx code path adding necessary calls") Cc: stable@vger.kernel.org Acked-by: Oliver Neukum Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210929090937.7410-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 65a205e6113506e69a503b61d97efec43fc10fd7 Author: Johan Hovold Date: Wed Sep 29 11:09:36 2021 +0200 USB: cdc-acm: fix racy tty buffer accesses A recent change that started reporting break events to the line discipline caused the tty-buffer insertions to no longer be serialised by inserting events also from the completion handler for the interrupt endpoint. Completion calls for distinct endpoints are not guaranteed to be serialised. For example, in case a host-controller driver uses bottom-half completion, the interrupt and bulk-in completion handlers can end up running in parallel on two CPUs (high-and low-prio tasklets, respectively) thereby breaking the tty layer's single producer assumption. Fix this by holding the read lock also when inserting characters from the bulk endpoint. Fixes: 08dff274edda ("cdc-acm: fix BREAK rx code path adding necessary calls") Cc: stable@vger.kernel.org Acked-by: Oliver Neukum Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210929090937.7410-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 0560c9c552c1815e7b480bc11fd785fefc82bb27 Author: Pavel Hofman Date: Fri Sep 24 10:00:27 2021 +0200 usb: gadget: f_uac2: fixed EP-IN wMaxPacketSize Async feedback patches broke enumeration on Windows 10 previously fixed by commit 789ea77310f0 ("usb: gadget: f_uac2: always increase endpoint max_packet_size by one audio slot"). While the existing calculation for EP OUT capture for async mode yields size+1 frame due to uac2_opts->fb_max > 0, playback side lost the +1 feature. Therefore the +1 frame addition must be re-introduced for playback. Win10 enumerates the device only when both EP IN and EP OUT max packet sizes are (at least) +1 frame. Fixes: e89bb4288378 ("usb: gadget: u_audio: add real feedback implementation") Cc: stable Tested-by: Henrik Enquist Tested-by: Jack Pham Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20210924080027.5362-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 04d2b75537085cb0c85d73a2e0e50317bffa883f Author: Rikard Falkeborn Date: Wed Sep 29 21:45:46 2021 +0200 usb: cdc-wdm: Fix check for WWAN CONFIG_WWAN_CORE was with CONFIG_WWAN in commit 89212e160b81 ("net: wwan: Fix WWAN config symbols"), but did not update all users of it. Change it back to use CONFIG_WWAN instead. Fixes: 89212e160b81 ("net: wwan: Fix WWAN config symbols") Cc: Signed-off-by: Rikard Falkeborn Acked-by: Oliver Neukum Link: https://lore.kernel.org/r/20210929194547.46954-2-rikard.falkeborn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8253a34bfae3278baca52fc1209b7c29270486ca Author: Fabio Estevam Date: Tue Sep 21 08:37:54 2021 -0300 usb: chipidea: ci_hdrc_imx: Also search for 'phys' phandle When passing 'phys' in the devicetree to describe the USB PHY phandle (which is the recommended way according to Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt) the following NULL pointer dereference is observed on i.MX7 and i.MX8MM: [ 1.489344] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000098 [ 1.498170] Mem abort info: [ 1.500966] ESR = 0x96000044 [ 1.504030] EC = 0x25: DABT (current EL), IL = 32 bits [ 1.509356] SET = 0, FnV = 0 [ 1.512416] EA = 0, S1PTW = 0 [ 1.515569] FSC = 0x04: level 0 translation fault [ 1.520458] Data abort info: [ 1.523349] ISV = 0, ISS = 0x00000044 [ 1.527196] CM = 0, WnR = 1 [ 1.530176] [0000000000000098] user address but active_mm is swapper [ 1.536544] Internal error: Oops: 96000044 [#1] PREEMPT SMP [ 1.542125] Modules linked in: [ 1.545190] CPU: 3 PID: 7 Comm: kworker/u8:0 Not tainted 5.14.0-dirty #3 [ 1.551901] Hardware name: Kontron i.MX8MM N801X S (DT) [ 1.557133] Workqueue: events_unbound deferred_probe_work_func [ 1.562984] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--) [ 1.568998] pc : imx7d_charger_detection+0x3f0/0x510 [ 1.573973] lr : imx7d_charger_detection+0x22c/0x510 This happens because the charger functions check for the phy presence inside the imx_usbmisc_data structure (data->usb_phy), but the chipidea core populates the usb_phy passed via 'phys' inside 'struct ci_hdrc' (ci->usb_phy) instead. This causes the NULL pointer dereference inside imx7d_charger_detection(). Fix it by also searching for 'phys' in case 'fsl,usbphy' is not found. Tested on a imx7s-warp board. Fixes: 746f316b753a ("usb: chipidea: introduce imx7d USB charger detection") Cc: stable@vger.kernel.org Reported-by: Heiko Thiery Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Acked-by: Peter Chen Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20210921113754.767631-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d91017a295e9790eec02c4e43f020cdb55f5d98 Author: Xu Yang Date: Tue Sep 28 19:16:39 2021 +0800 usb: typec: tcpm: handle SRC_STARTUP state if cc changes TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state which is not satisfied with the Type-C spec. Per Type-C spec: DRP port should move to Unattached.SNK instead of Unattached.SRC if sink removed. Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging") cc: Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20210928111639.3854174-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit 05300871c0e21c288bd5c30ac6f9b1da6ddeed22 Author: Xu Yang Date: Sun Sep 26 18:14:15 2021 +0800 usb: typec: tcpci: don't handle vSafe0V event if it's not enabled USB TCPCI Spec, 4.4.3 Mask Registers: "A masked register will still indicate in the ALERT register, but shall not set the Alert# pin low." Thus, the Extended Status will still indicate in ALERT register if vSafe0V is detected by TCPC even though being masked. In current code, howerer, this event will not be handled in detection time. Rather it will be handled when next ALERT event coming(CC evnet, PD event, etc). Tcpm might transition to a wrong state in this situation. Thus, the vSafe0V event should not be handled when it's masked. Fixes: 766c485b86ef ("usb: typec: tcpci: Add support to report vSafe0V") cc: Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20210926101415.3775058-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit b87d8d0d4c43c29ccdc57d15b2ebc1df886a34b4 Author: Heikki Krogerus Date: Thu Sep 30 15:47:58 2021 +0300 usb: typec: tipd: Remove dependency on "connector" child fwnode There is no "connector" child node available on every platform, so the driver can't fail to probe when it's missing. Fixes: 57560ee95cb7 ("usb: typec: tipd: Don't block probing of consumer of "connector" nodes") Cc: stable@vger.kernel.org # 5.14+ Reported-by: "Regupathy, Rajaram" Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20210930124758.23233-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a56d447f196fa9973c568f54c0d76d5391c3b0c0 Author: Eric Dumazet Date: Mon Oct 4 12:55:22 2021 -0700 net/sched: sch_taprio: properly cancel timer from taprio_destroy() There is a comment in qdisc_create() about us not calling ops->reset() in some cases. err_out4: /* * Any broken qdiscs that would require a ops->reset() here? * The qdisc was never in action so it shouldn't be necessary. */ As taprio sets a timer before actually receiving a packet, we need to cancel it from ops->destroy, just in case ops->reset has not been called. syzbot reported: ODEBUG: free active (active state 0) object type: hrtimer hint: advance_sched+0x0/0x9a0 arch/x86/include/asm/atomic64_64.h:22 WARNING: CPU: 0 PID: 8441 at lib/debugobjects.c:505 debug_print_object+0x16e/0x250 lib/debugobjects.c:505 Modules linked in: CPU: 0 PID: 8441 Comm: syz-executor813 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:debug_print_object+0x16e/0x250 lib/debugobjects.c:505 Code: ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 af 00 00 00 48 8b 14 dd e0 d3 e3 89 4c 89 ee 48 c7 c7 e0 c7 e3 89 e8 5b 86 11 05 <0f> 0b 83 05 85 03 92 09 01 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e c3 RSP: 0018:ffffc9000130f330 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000 RDX: ffff88802baeb880 RSI: ffffffff815d87b5 RDI: fffff52000261e58 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815d25ee R11: 0000000000000000 R12: ffffffff898dd020 R13: ffffffff89e3ce20 R14: ffffffff81653630 R15: dffffc0000000000 FS: 0000000000f0d300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffb64b3e000 CR3: 0000000036557000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __debug_check_no_obj_freed lib/debugobjects.c:987 [inline] debug_check_no_obj_freed+0x301/0x420 lib/debugobjects.c:1018 slab_free_hook mm/slub.c:1603 [inline] slab_free_freelist_hook+0x171/0x240 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 qdisc_create+0xbcf/0x1320 net/sched/sch_api.c:1299 tc_modify_qdisc+0x4c8/0x1a60 net/sched/sch_api.c:1663 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2403 ___sys_sendmsg+0xf3/0x170 net/socket.c:2457 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2486 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 Fixes: 44d4775ca518 ("net/sched: sch_taprio: reset child qdiscs before freeing them") Signed-off-by: Eric Dumazet Cc: Davide Caratti Reported-by: syzbot Acked-by: Vinicius Costa Gomes Acked-by: Davide Caratti Signed-off-by: David S. Miller commit 4d1aa9112c8e6995ef2c8a76972c9671332ccfea Author: Ben Hutchings Date: Tue Sep 21 16:34:42 2021 +0200 Partially revert "usb: Kconfig: using select for USB_COMMON dependency" This reverts commit cb9c1cfc86926d0e86d19c8e34f6c23458cd3478 for USB_LED_TRIG. This config symbol has bool type and enables extra code in usb_common itself, not a separate driver. Enabling it should not force usb_common to be built-in! Fixes: cb9c1cfc8692 ("usb: Kconfig: using select for USB_COMMON dependency") Cc: stable Signed-off-by: Ben Hutchings Signed-off-by: Salvatore Bonaccorso Link: https://lore.kernel.org/r/20210921143442.340087-1-carnil@debian.org Signed-off-by: Greg Kroah-Hartman commit 268bbde716e3a79a747a0f4ebbeb9f63d861737d Author: Andy Shevchenko Date: Mon Oct 4 17:18:39 2021 +0300 usb: dwc3: gadget: Revert "set gadgets parent to the right controller" The commit c6e23b89a95d ("usb: dwc3: gadget: set gadgets parent to the right controller") changed the device for the UDC and broke the user space scripts that instantiate the USB gadget(s) via ConfigFS. Revert it for now until the better solution will be proposed. Fixes: c6e23b89a95d ("usb: dwc3: gadget: set gadgets parent to the right controller") Tested-by: Ferry Toth Cc: Michael Grzeschik Cc: Felipe Balbi Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211004141839.49079-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 64506cb92833b313cbc7f19ad51b0850e0972984 Merge: baf33d7a75642 0854a0513321c Author: David S. Miller Date: Tue Oct 5 12:39:19 2021 +0100 Merge branch 'bridge-fixes' Eric Dumazet says: ==================== net: bridge: br_get_linkxstats_size() fixes This patch series attempts to fix the following syzbot report. WARNING: CPU: 1 PID: 21425 at net/core/rtnetlink.c:5388 rtnl_stats_get+0x80f/0x8c0 net/core/rtnetlink.c:5388 Modules linked in: CPU: 1 PID: 21425 Comm: syz-executor394 Not tainted 5.13.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:rtnl_stats_get+0x80f/0x8c0 net/core/rtnetlink.c:5388 Code: e9 9c fc ff ff 4c 89 e7 89 0c 24 e8 ab 8b a8 fa 8b 0c 24 e9 bc fc ff ff 4c 89 e7 e8 9b 8b a8 fa e9 df fe ff ff e8 61 85 63 fa <0f> 0b e9 f7 fc ff ff 41 be ea ff ff ff e9 f9 fc ff ff 41 be 97 ff RSP: 0018:ffffc9000cf77688 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 000000000000012c RCX: 0000000000000000 RDX: ffff8880211754c0 RSI: ffffffff8711571f RDI: 0000000000000003 RBP: ffff8880175aa780 R08: 00000000ffffffa6 R09: ffff88823bd5c04f R10: ffffffff87115413 R11: 0000000000000001 R12: ffff8880175aab74 R13: ffff8880175aab40 R14: 00000000ffffffa6 R15: 0000000000000006 FS: 0000000001ff9300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000005cfd58 CR3: 000000002cd43000 CR4: 00000000001506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5562 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4440d9 ==================== Signed-off-by: David S. Miller commit 0854a0513321cf70bea5fa483ebcaa983cc7c62e Author: Eric Dumazet Date: Mon Oct 4 18:05:08 2021 -0700 net: bridge: fix under estimation in br_get_linkxstats_size() Commit de1799667b00 ("net: bridge: add STP xstats") added an additional nla_reserve_64bit() in br_fill_linkxstats(), but forgot to update br_get_linkxstats_size() accordingly. This can trigger the following in rtnl_stats_get() WARN_ON(err == -EMSGSIZE); Fixes: de1799667b00 ("net: bridge: add STP xstats") Signed-off-by: Eric Dumazet Cc: Vivien Didelot Cc: Nikolay Aleksandrov Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit dbe0b88064494b7bb6a9b2aa7e085b14a3112d44 Author: Eric Dumazet Date: Mon Oct 4 18:05:07 2021 -0700 net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() bridge_fill_linkxstats() is using nla_reserve_64bit(). We must use nla_total_size_64bit() instead of nla_total_size() for corresponding data structure. Fixes: 1080ab95e3c7 ("net: bridge: add support for IGMP/MLD stats and export them via netlink") Signed-off-by: Eric Dumazet Cc: Nikolay Aleksandrov Cc: Vivien Didelot Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 3ea75b3f57e5b2837b980a2cbcf014773d00ae51 Author: Arnd Bergmann Date: Tue Oct 5 13:20:28 2021 +0200 usb: xhci: tegra: mark PM functions as __maybe_unused The added #ifdefs in the PM rework were almost correct, but still cause warnings in some randconfig builds: drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function] 2147 | static int tegra_xusb_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function] 2105 | static int tegra_xusb_suspend(struct device *dev) Replace the #ifdef checks with simpler __maybe_unused annotations to reliably shut up these warnings. Link: https://lore.kernel.org/all/20210421135613.3560777-2-arnd@kernel.org/ Fixes: 971ee247060d ("usb: xhci: tegra: Enable ELPG for runtime/system PM") Reviewed-by: JC Kuo Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211005112057.2700888-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit baf33d7a75642b4b38a87fdf1cd96b506df4849f Author: Hayes Wang Date: Mon Oct 4 14:28:58 2021 +0800 r8152: avoid to resubmit rx immediately For the situation that the disconnect event comes very late when the device is unplugged, the driver would resubmit the RX bulk transfer after getting the callback with -EPROTO immediately and continually. Finally, soft lockup occurs. This patch avoids to resubmit RX immediately. It uses a workqueue to schedule the RX NAPI. And the NAPI would resubmit the RX. It let the disconnect event have opportunity to stop the submission before soft lockup. Reported-by: Jason-ch Chen Tested-by: Jason-ch Chen Signed-off-by: Hayes Wang Signed-off-by: David S. Miller commit 3f6cffb8604b537e3d7ea040d7f4368689638eaf Author: Jakub Kicinski Date: Mon Oct 4 16:01:40 2021 -0700 etherdevice: use __dev_addr_set() Andrew points out that eth_hw_addr_set() replaces memcpy() calls so we can't use ether_addr_copy() which assumes both arguments are 2-bytes aligned. Reported-by: Andrew Lunn Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 38fa3206bf441911258e5001ac8b6738693f8d82 Author: Zhang Jianhua Date: Thu Sep 23 10:53:40 2021 +0800 efi: Change down_interruptible() in virt_efi_reset_system() to down_trylock() While reboot the system by sysrq, the following bug will be occur. BUG: sleeping function called from invalid context at kernel/locking/semaphore.c:90 in_atomic(): 0, irqs_disabled(): 128, non_block: 0, pid: 10052, name: rc.shutdown CPU: 3 PID: 10052 Comm: rc.shutdown Tainted: G W O 5.10.0 #1 Call trace: dump_backtrace+0x0/0x1c8 show_stack+0x18/0x28 dump_stack+0xd0/0x110 ___might_sleep+0x14c/0x160 __might_sleep+0x74/0x88 down_interruptible+0x40/0x118 virt_efi_reset_system+0x3c/0xd0 efi_reboot+0xd4/0x11c machine_restart+0x60/0x9c emergency_restart+0x1c/0x2c sysrq_handle_reboot+0x1c/0x2c __handle_sysrq+0xd0/0x194 write_sysrq_trigger+0xbc/0xe4 proc_reg_write+0xd4/0xf0 vfs_write+0xa8/0x148 ksys_write+0x6c/0xd8 __arm64_sys_write+0x18/0x28 el0_svc_common.constprop.3+0xe4/0x16c do_el0_svc+0x1c/0x2c el0_svc+0x20/0x30 el0_sync_handler+0x80/0x17c el0_sync+0x158/0x180 The reason for this problem is that irq has been disabled in machine_restart() and then it calls down_interruptible() in virt_efi_reset_system(), which would occur sleep in irq context, it is dangerous! Commit 99409b935c9a("locking/semaphore: Add might_sleep() to down_*() family") add might_sleep() in down_interruptible(), so the bug info is here. down_trylock() can solve this problem, cause there is no might_sleep. -------- Cc: Signed-off-by: Zhang Jianhua Signed-off-by: Ard Biesheuvel commit b3a72ca80351917cc23f9e24c35f3c3979d3c121 Author: Ard Biesheuvel Date: Wed Sep 1 08:33:19 2021 +0200 efi/cper: use stack buffer for error record decoding Joe reports that using a statically allocated buffer for converting CPER error records into human readable text is probably a bad idea. Even though we are not aware of any actual issues, a stack buffer is clearly a better choice here anyway, so let's move the buffer into the stack frames of the two functions that refer to it. Cc: Reported-by: Joe Perches Signed-off-by: Ard Biesheuvel commit 68c9cdf37a0456b7ba25a50b1ea8794f305da17f Author: Heinrich Schuchardt Date: Sun Aug 29 15:23:10 2021 +0200 efi/libstub: Simplify "Exiting bootservices" message The message "Exiting boot services and installing virtual address map...\n" is even shown if we have efi=novamap on the command line or the firmware does not provide EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP. To avoid confusion just print "Exiting boot services...\n" Signed-off-by: Heinrich Schuchardt Signed-off-by: Ard Biesheuvel commit 37f12202c5d28291ba5f83ce229771447ce9148f Author: Dan Carpenter Date: Thu Sep 30 15:26:04 2021 +0300 staging: r8188eu: prevent array underflow in rtw_hal_update_ra_mask() The problem is that "mac_id" is a u32 so this check for underflow does not work when "mac_id" is zero. In that situation, "mac_id - 1" is UINT_MAX instead of -1 so the condition is true. It leads to an array underflow on the next line. Fixes: 8cd574e6af54 ("staging: r8188eu: introduce new hal dir for RTL8188eu driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210930122604.GB10068@kili Signed-off-by: Greg Kroah-Hartman commit 7ff4034e910fe00a90d985f0d05bacf60c162f02 Author: Arnd Bergmann Date: Mon Sep 27 13:36:56 2021 +0200 staging: vc04_services: shut up out-of-range warning The comparison against SIZE_MAX produces a harmless warning on 64-bit architectures: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:185:16: error: result of comparison of constant 419244183493398898 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (num_pages > (SIZE_MAX - sizeof(struct pagelist) - ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shut up that warning by adding a cast to a longer type. Fixes: ca641bae6da9 ("staging: vc04_services: prevent integer overflow in create_pagelist()") Cc: stable Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210927113702.3866843-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3ad60b4b3570937f3278509fe6797a5093ce53f8 Author: Paweł Anikiel Date: Mon Sep 20 14:41:41 2021 +0200 reset: socfpga: add empty driver allowing consumers to probe The early reset driver doesn't ever probe, which causes consuming devices to be unable to probe. Add an empty driver to set this device as available, allowing consumers to probe. Signed-off-by: Paweł Anikiel Link: https://lore.kernel.org/r/20210920124141.1166544-4-pan@semihalf.com Signed-off-by: Philipp Zabel commit 5c0522484eb54b90f2e46a5db8d7a4ff3ff86e5d Author: David Howells Date: Thu Aug 12 23:08:54 2021 +0100 afs: Fix afs_launder_page() to set correct start file position Fix afs_launder_page() to set the starting position of the StoreData RPC at the offset into the page at which the modified data starts instead of at the beginning of the page (the iov_iter is correctly offset). The offset got lost during the conversion to passing an iov_iter into afs_store_data(). Changes: ver #2: - Use page_offset() rather than manually calculating it[1]. Fixes: bd80d8a80e12 ("afs: Use ITER_XARRAY for writing") Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/YST/0e92OdSH0zjg@casper.infradead.org/ [1] Link: https://lore.kernel.org/r/162880783179.3421678.7795105718190440134.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/162937512409.1449272.18441473411207824084.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/162981148752.1901565.3663780601682206026.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163005741670.2472992.2073548908229887941.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163221839087.3143591.14278359695763025231.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163292980654.4004896.7134735179887998551.stgit@warthog.procyon.org.uk/ # v2 commit 330de47d14af0c3995db81cc03cf5ca683d94d81 Author: David Howells Date: Mon Jul 26 10:37:57 2021 +0100 netfs: Fix READ/WRITE confusion when calling iov_iter_xarray() Fix netfs_clear_unread() to pass READ to iov_iter_xarray() instead of WRITE (the flag is about the operation accessing the buffer, not what sort of access it is doing to the buffer). Fixes: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers") Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-afs@lists.infradead.org cc: ceph-devel@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: v9fs-developer@lists.sourceforge.net cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/162729351325.813557.9242842205308443901.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/162886603464.3940407.3790841170414793899.stgit@warthog.procyon.org.uk Link: https://lore.kernel.org/r/163239074602.1243337.14154704004485867017.stgit@warthog.procyon.org.uk commit a0e25f0a0d39d66c048d5dbac1e7ebaa6ec885d7 Author: Dave Wysochanski Date: Sun Oct 3 12:14:00 2021 -0400 cachefiles: Fix oops with cachefiles_cull() due to NULL object When cachefiles_cull() calls cachefiles_bury_object(), it passes a NULL object. When this occurs, either trace_cachefiles_unlink() or trace_cachefiles_rename() may oops due to the NULL object. Check for NULL object in the tracepoint and if so, set debug_id to MAX_UINT as was done in 2908f5e101e3. The following oops was seen with xfstests generic/100. BUG: kernel NULL pointer dereference, address: 0000000000000010 ... RIP: 0010:trace_event_raw_event_cachefiles_unlink+0x4e/0xa0 [cachefiles] ... Call Trace: cachefiles_bury_object+0x242/0x430 [cachefiles] ? __vfs_removexattr_locked+0x10f/0x150 ? vfs_removexattr+0x51/0xd0 cachefiles_cull+0x84/0x120 [cachefiles] cachefiles_daemon_cull+0xd1/0x120 [cachefiles] cachefiles_daemon_write+0x158/0x190 [cachefiles] vfs_write+0xbc/0x260 ksys_write+0x4f/0xc0 do_syscall_64+0x3b/0x90 The following oops was seen with xfstests generic/290. BUG: kernel NULL pointer dereference, address: 0000000000000010 ... RIP: 0010:trace_event_raw_event_cachefiles_rename+0x54/0xa0 [cachefiles] ... Call Trace: cachefiles_bury_object+0x35c/0x430 [cachefiles] cachefiles_cull+0x84/0x120 [cachefiles] cachefiles_daemon_cull+0xd1/0x120 [cachefiles] cachefiles_daemon_write+0x158/0x190 [cachefiles] vfs_write+0xbc/0x260 ksys_write+0x4f/0xc0 do_syscall_64+0x3b/0x90 Fixes: 2908f5e101e3 ("fscache: Add a cookie debug ID and use that in traces") Signed-off-by: Dave Wysochanski Signed-off-by: David Howells Link: https://listman.redhat.com/archives/linux-cachefs/2021-October/msg00009.html commit eb7b52e6db7c21400b9b2d539f9343fb6e94bd94 Author: Sudeep Holla Date: Fri Sep 24 10:28:59 2021 +0100 firmware: arm_ffa: Fix __ffa_devices_unregister When arm_ffa firmware driver module is unloaded or removed we call __ffa_devices_unregister on all the devices on the ffa bus. It must unregister all the devices instead it is currently just releasing the devices without unregistering. That is pure wrong as when we try to load the module back again, it will result in the kernel crash something like below. -->8 CPU: 2 PID: 232 Comm: modprobe Not tainted 5.15.0-rc2+ #169 Hardware name: FVP Base RevC (DT) Call trace: dump_backtrace+0x0/0x1cc show_stack+0x18/0x64 dump_stack_lvl+0x64/0x7c dump_stack+0x18/0x38 sysfs_create_dir_ns+0xe4/0x140 kobject_add_internal+0x170/0x358 kobject_add+0x94/0x100 device_add+0x178/0x5f0 device_register+0x20/0x30 ffa_device_register+0x80/0xcc [ffa_module] ffa_setup_partitions+0x7c/0x108 [ffa_module] init_module+0x290/0x2dc [ffa_module] do_one_initcall+0xbc/0x230 do_init_module+0x58/0x304 load_module+0x15e0/0x1f68 __arm64_sys_finit_module+0xb8/0xf4 invoke_syscall+0x44/0x140 el0_svc_common+0xb4/0xf0 do_el0_svc+0x24/0x80 el0_svc+0x20/0x50 el0t_64_sync_handler+0x84/0xe4 el0t_64_sync+0x1a0/0x1a4 kobject_add_internal failed for arm-ffa-8001 with -EEXIST, don't try to register things with the same name in the same directory. ---- Fix the issue by calling device_unregister in __ffa_devices_unregister which will also take care of calling device_release(which is mapped to ffa_release_device) Link: https://lore.kernel.org/r/20210924092859.3057562-2-sudeep.holla@arm.com Fixes: e781858488b9 ("firmware: arm_ffa: Add initial FFA bus support for device enumeration") Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 244f5d597e1ea519c2085fbd9819458688775e42 Author: Sudeep Holla Date: Fri Sep 24 10:28:58 2021 +0100 firmware: arm_ffa: Add missing remove callback to ffa_bus_type Currently the arm_ffa firmware driver can be built as module and hence all the users of FFA driver. If any driver on the ffa bus is removed or unregistered, the remove callback on all the device bound to the driver being removed should be callback. For that to happen, we must register a remove callback on the ffa_bus which is currently missing. This results in the probe getting called again without the previous remove callback on a device which may result in kernel crash. Fix the issue by registering the remove callback on the FFA bus. Link: https://lore.kernel.org/r/20210924092859.3057562-1-sudeep.holla@arm.com Fixes: e781858488b9 ("firmware: arm_ffa: Add initial FFA bus support for device enumeration") Reported-by: Jens Wiklander Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 85a877801618adc1312e4d5a6c844482c3e4b913 Merge: 5816b3e6577ea 26d90b5590579 Author: Greg Kroah-Hartman Date: Tue Oct 5 11:20:52 2021 +0200 Merge tag 'iio-fixes-for-5.15a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 1st set of IIO fixes for the 5.15 cycle Usual mixed back of minor bug fixes. adi,ad7192, ad7780, ad7793 * Fix incorrect IRQ_FLAG types. As the IRQ line is shared with the data line we can be sure of the polarity and edge like nature. They were previously either left unspecified or as level interrupts which may cause problems on power up. adi,adis16475 * Fix a deadlock by calling unlocked function when lock already held. Also deal with making sure lock is released correctly. adi,adis16480 * Fix assumption that all devices support sleep mode. aspeed,adc * Add missing platform_set_drvdata() so we can get the indio_dev in remove as was being assumed. fsl,fxls8962af * Return IRQ_HANDLED on flush rather than a positive 'error' code. maxim,max1207 * Fix a wrong shift on 12-bit devices that will lead to incorrect scale. * Fix wrong number of channels on max1X31 devices due to allocating them twice. mediatek,mt6577 * Fix a failure to apply scaling to IIO_CHAN_INFO_PROCESSED renesas,rzg2l * Fix failure to return -EBUSY on timeout due to ignored error code. * Add a missing clk_disable_unprepare() on error in runtime_resume. samsung,ssp_spi * Fix an error code to always be returned on invalid length. * Add some range checking to ensure resilience against bad data leading to potential overflow. ti,adc128s052 * Fix an error handling path that leaves regulator on if probe fails. ti,dac5571 * Add missing return value in a switch default. ti,opt3001 * Fix case where sensor returns 0 lux and we were previously accidentally returning that this was a timeout. * tag 'iio-fixes-for-5.15a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: light: opt3001: Fixed timeout error when 0 lux iio: adis16480: fix devices that do not support sleep mode iio: mtk-auxadc: fix case IIO_CHAN_INFO_PROCESSED iio: adis16475: fix deadlock on frequency set iio: ssp_sensors: add more range checking in ssp_parse_dataframe() iio: ssp_sensors: fix error code in ssp_print_mcu_debug() iio: adc: ad7793: Fix IRQ flag iio: adc: ad7780: Fix IRQ flag iio: adc: ad7192: Add IRQ flag iio: adc: aspeed: set driver data when adc probe. iio: adc: rzg2l_adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume() iio: adc: max1027: Fix the number of max1X31 channels iio: adc: max1027: Fix wrong shift with 12-bit devices iio: adc128s052: Fix the error handling path of 'adc128_probe()' iio: adc: rzg2l_adc: Fix -EBUSY timeout error return iio: accel: fxls8962af: return IRQ_HANDLED when fifo is flushed iio: dac: ti-dac5571: fix an error code in probe() commit c045ceb5a145d2a9a4bf33cbc55185ddf99f60ab Author: Mikko Perttunen Date: Wed Sep 15 11:55:14 2021 +0300 reset: tegra-bpmp: Handle errors in BPMP response The return value from tegra_bpmp_transfer indicates the success or failure of the IPC transaction with BPMP. If the transaction succeeded, we also need to check the actual command's result code. Add code to do this. Signed-off-by: Mikko Perttunen Link: https://lore.kernel.org/r/20210915085517.1669675-2-mperttunen@nvidia.com Signed-off-by: Philipp Zabel commit b2d73debfdc16b742e64948dc4461876af3f8c10 Author: Ville Syrjälä Date: Thu Sep 30 22:09:42 2021 +0300 drm/i915: Extend the async flip VT-d w/a to skl/bxt Looks like skl/bxt/derivatives also need the plane stride stretch w/a when using async flips and VT-d is enabled, or else we get corruption on screen. To my surprise this was even documented in bspec, but only as a note on the CHICHKEN_PIPESL register description rather than on the w/a list. So very much the same thing as on HSW/BDW, except the bits moved yet again. Cc: stable@vger.kernel.org Cc: Karthik B S Fixes: 55ea1cb178ef ("drm/i915: Enable async flips in i915") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210930190943.17547-1-ville.syrjala@linux.intel.com Reviewed-by: Matt Roper (cherry picked from commit d08df3b0bdb25546e86dc9a6c4e3ec0c43832299) Signed-off-by: Jani Nikula commit fdddf8c3a477f77b3a623f220e78d45e89fc50d5 Author: Lukasz Majczak Date: Thu Sep 30 15:46:06 2021 +0200 drm/i915/bdb: Fix version check With patch "drm/i915/vbt: Fix backlight parsing for VBT 234+" the size of bdb_lfp_backlight_data structure has been increased, causing if-statement in the parse_lfp_backlight function that comapres this structure size to the one retrieved from BDB, always to fail for older revisions. This patch calculates expected size of the structure for a given BDB version and compares it with the value gathered from BDB. Tested on Chromebook Pixelbook (Nocturne) (reports bdb->version = 221) Fixes: d381baad29b4 ("drm/i915/vbt: Fix backlight parsing for VBT 234+") Tested-by: Lukasz Majczak Signed-off-by: Lukasz Majczak Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210930134606.227234-1-lma@semihalf.com (cherry picked from commit 4378daf5d04eed59724e6d0e74755e17dce2e105) Signed-off-by: Jani Nikula commit a532cde31de3cae6ed60e60d6f9379771f652809 Author: Imre Deak Date: Wed Sep 29 16:28:27 2021 +0300 drm/i915/tc: Fix TypeC port init/resume time sanitization Atm during driver loading and system resume TypeC ports are accessed before their HW/SW state is synced. Move the TypeC port sanitization to the encoder's sync_state hook to fix this. v2: Handle the encoder disabled case in gen11_dsi_sync_state() as well (Jose, Jani) Fixes: f9e76a6e68d3 ("drm/i915: Add an encoder hook to sanitize its state during init/resume") Cc: José Roberto de Souza Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210929132833.2253961-1-imre.deak@intel.com (cherry picked from commit 7194dc998dfffca096c30b3cd39625158608992d) Signed-off-by: Jani Nikula commit 0c94777386495d6e0a9735d48ffd2abb8d680d7f Author: Maarten Lankhorst Date: Wed Jul 28 14:41:31 2021 +0200 drm/i915: Fix runtime pm handling in i915_gem_shrink We forgot to call intel_runtime_pm_put on error, fix it! Signed-off-by: Maarten Lankhorst Fixes: cf41a8f1dc1e ("drm/i915: Finally remove obj->mm.lock.") Cc: Thomas Hellström Cc: Daniel Vetter Cc: # v5.13+ Reviewed-by: Thomas Hellström Reviewed-by: Niranjana Vishwanathapura Link: https://patchwork.freedesktop.org/patch/msgid/20210830121006.2978297-9-maarten.lankhorst@linux.intel.com (cherry picked from commit 239f3c2ee18376587026efecaea5250fa5926d20) Signed-off-by: Jani Nikula commit ffac30be2a06b2516b2ce2afa2dcb2cf8af65a52 Author: Kai-Heng Feng Date: Mon Sep 6 12:12:59 2021 +0800 drm/i915/audio: Use BIOS provided value for RKL HDA link Commit 989634fb49ad ("drm/i915/audio: set HDA link parameters in driver") makes HDMI audio on Lenovo P350 disappear. So in addition to TGL, extend the logic to RKL to use BIOS provided value to fix the regression. Fixes: 989634fb49ad ("drm/i915/audio: set HDA link parameters in driver") Reviewed-by: Kai Vehmanen Signed-off-by: Kai-Heng Feng Link: https://patchwork.freedesktop.org/patch/msgid/20210906041300.508458-1-kai.heng.feng@canonical.com (cherry picked from commit c6b40ee330fe09b332715bb7ec1467e4fcbe2e65) Signed-off-by: Jani Nikula commit 4af160707d7197d671a5b0ad9899383b6cb7c067 Author: Geert Uytterhoeven Date: Tue Sep 14 11:15:59 2021 +0200 reset: pistachio: Re-enable driver selection After the retirement of MACH_PISTACHIO, the Pistachio Reset Driver is no longer auto-enabled when building a kernel for Pistachio systems. Worse, the driver cannot be enabled by the user at all (unless compile-testing), as the config symbol is invisible. Fix this partially by making the symbol visible again when compiling for MIPS, and dropping the useless default. The user still has to enable the driver manually when building a kernel for Pistachio systems, though. Fixes: 104f942b2832ab13 ("MIPS: Retire MACH_PISTACHIO") Signed-off-by: Geert Uytterhoeven Reviewed-by: Rahul Bedarkar Reviewed-by: Jiaxun Yang Link: https://lore.kernel.org/r/2c399e52540536df9c4006e46ef93fbccdde88db.1631610825.git.geert+renesas@glider.be Signed-off-by: Philipp Zabel commit f33eb7f29c16ba78db3221ee02346fd832274cdd Author: Jim Quinlan Date: Tue Sep 14 15:11:21 2021 -0700 reset: brcmstb-rescal: fix incorrect polarity of status bit The readl_poll_timeout() should complete when the status bit is a 1, not 0. Fixes: 4cf176e52397 ("reset: Add Broadcom STB RESCAL reset controller") Signed-off-by: Jim Quinlan Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20210914221122.62315-1-f.fainelli@gmail.com Signed-off-by: Philipp Zabel commit 5aec98913095ed3b4424ed6c5fdeb6964e9734da Author: Kailang Yang Date: Tue Oct 5 14:35:14 2021 +0800 ALSA: hda/realtek - ALC236 headset MIC recording issue In power save mode, the recording voice from headset mic will 2s more delay. Add this patch will solve this issue. [ minor coding style fix by tiwai ] Signed-off-by: Kailang Yang Tested-by: Kai-Heng Feng Cc: Link: https://lore.kernel.org/r/ccb0cdd5bbd7486eabbd8d987d384cb0@realtek.com Signed-off-by: Takashi Iwai commit 9c11112c0ec7ec322cd495320c3ab9fa8bdc1bbc Author: Jan Beulich Date: Thu Sep 30 14:21:13 2021 +0200 xen/x86: adjust data placement Both xen_pvh and xen_start_flags get written just once early during init. Using the respective annotation then allows the open-coded placing in .data to go away. Additionally the former, like the latter, wants exporting, or else xen_pvh_domain() can't be used from modules. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/8155ed26-5a1d-c06f-42d8-596d26e75849@suse.com Signed-off-by: Juergen Gross commit 59f7e5374175ce5d776efeb12a1e61cd6b1f82fb Author: Jan Beulich Date: Thu Sep 30 14:20:42 2021 +0200 x86/PVH: adjust function/data placement Two of the variables can live in .init.data, allowing the open-coded placing in .data to go away. Another "variable" is used to communicate a size value only to very early assembly code, which hence can be both const and live in .init.*. Additionally two functions were lacking __init annotations. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/3b0bb22e-43f4-e459-c5cb-169f996b5669@suse.com Signed-off-by: Juergen Gross commit 079c4baa2aad05e8007faa24b2411c1457f60d74 Author: Jan Beulich Date: Thu Sep 30 14:19:48 2021 +0200 xen/x86: hook up xen_banner() also for PVH This was effectively lost while dropping PVHv1 code. Move the function and arrange for it to be called the same way as done in PV mode. Clearly this then needs re-introducing the XENFEAT_mmu_pt_update_preserve_ad check that was recently removed, as that's a PV-only feature. Since the string pointed at by pv_info.name describes the mode, drop "paravirtualized" from the log message while moving the code. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/de03054d-a20d-2114-bb86-eec28e17b3b8@suse.com Signed-off-by: Juergen Gross commit 4d1ab432acc9391a5ae13c629dbb5882c29fd1b0 Author: Jan Beulich Date: Thu Sep 30 14:19:16 2021 +0200 xen/x86: generalize preferred console model from PV to PVH Dom0 Without announcing hvc0 as preferred it won't get used as long as tty0 gets registered earlier. This is particularly problematic with there not being any screen output for PVH Dom0 when the screen is in graphics mode, as the necessary information doesn't get conveyed yet from the hypervisor. Follow PV's model, but be conservative and do this for Dom0 only for now. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/582328b6-c86c-37f3-d802-5539b7a86736@suse.com Signed-off-by: Juergen Gross commit 42bc9716bc1df21b55b303fe243f8575b3af24f9 Author: Jan Beulich Date: Thu Sep 30 14:18:45 2021 +0200 xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU xenboot_write_console() is dealing with these quite fine so I don't see why xenboot_console_setup() would return -ENOENT in this case. Adjust documentation accordingly. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/3d212583-700e-8b2d-727a-845ef33ac265@suse.com Signed-off-by: Juergen Gross commit 8e24d9bfc44d3bd884669ef8b344112fe41c9826 Author: Jan Beulich Date: Thu Sep 30 14:18:12 2021 +0200 xen/x86: allow "earlyprintk=xen" to work for PV Dom0 With preferred consoles "tty" and "hvc" announced as preferred, registering "xenboot" early won't result in use of the console: It also needs to be registered as preferred. Generalize this from being DomU- only so far. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/d4a34540-a476-df2c-bca6-732d0d58c5f0@suse.com Signed-off-by: Juergen Gross commit adf330a7cd64a8bb959dc48a9c282285c1d5b4d5 Author: Jan Beulich Date: Thu Sep 30 14:17:41 2021 +0200 xen/x86: make "earlyprintk=xen" work better for PVH Dom0 The xen_hvm_early_write() path better wouldn't be taken in this case; while port 0xE9 can be used, the hypercall path is quite a bit more efficient. Put that first, as it may also work for DomU-s (see also xen_raw_console_write()). While there also bail from the function when the first domU_write_console() failed - later ones aren't going to succeed. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/4fd89dcb-cfc5-c740-2e94-bb271e432d3e@suse.com Signed-off-by: Juergen Gross commit cae7d81a3730dfe08623f8c1083230c8d0987639 Author: Jan Beulich Date: Thu Sep 30 14:16:47 2021 +0200 xen/x86: allow PVH Dom0 without XEN_PV=y Decouple XEN_DOM0 from XEN_PV, converting some existing uses of XEN_DOM0 to a new XEN_PV_DOM0. (I'm not convinced all are really / should really be PV-specific, but for starters I've tried to be conservative.) For PVH Dom0 the hypervisor populates MADT with only x2APIC entries, so without x2APIC support enabled in the kernel things aren't going to work very well. (As opposed, DomU-s would only ever see LAPIC entries in MADT as of now.) Note that this then requires PVH Dom0 to be 64-bit, as X86_X2APIC depends on X86_64. In the course of this xen_running_on_version_or_later() needs to be available more broadly. Move it from a PV-specific to a generic file, considering that what it does isn't really PV-specific at all anyway. Note that xen/interface/version.h cannot be included on its own; in enlighten.c, which uses SCHEDOP_* anyway, include xen/interface/sched.h first to resolve the apparently sole missing type (xen_ulong_t). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/983bb72f-53df-b6af-14bd-5e088bd06a08@suse.com Signed-off-by: Juergen Gross commit 9172b5c4a778da1f855b2e3780b1afabb3cfd523 Author: Jan Beulich Date: Thu Sep 30 14:16:15 2021 +0200 xen/x86: prevent PVH type from getting clobbered Like xen_start_flags, xen_domain_type gets set before .bss gets cleared. Hence this variable also needs to be prevented from getting put in .bss, which is possible because XEN_NATIVE is an enumerator evaluating to zero. Any use prior to init_hvm_pv_info() setting the variable again would lead to wrong decisions; one such case is xenboot_console_setup() when called as a result of "earlyprintk=xen". Use __ro_after_init as more applicable than either __section(".data") or __read_mostly. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/d301677b-6f22-5ae6-bd36-458e1f323d0b@suse.com Signed-off-by: Juergen Gross commit 3518441dda666696707afe933586151c0fb29db0 Author: Tim Harvey Date: Mon Oct 4 15:23:41 2021 -0700 arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio Fix invalid M2_RST# gpio pinmux. Fixes: ef484dfcf6f7 ("arm64: dts: imx: Add i.mx8mm/imx8mn Gateworks gw7902 dts support") Cc: stable@vger.kernel.org Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 97315723c463679a9ecf803d6479fca24c3efda0 Author: Jan Beulich Date: Wed Sep 22 12:18:25 2021 +0200 xen/privcmd: drop "pages" parameter from xen_remap_pfn() The function doesn't use it and all of its callers say in a comment that their respective arguments are to be non-NULL only in auto-translated mode. Since xen_remap_domain_mfn_array() isn't supposed to be used by non-PV, drop the parameter there as well. It was bogusly passed as non- NULL (PRIV_VMA_LOCKED) by its only caller anyway. For xen_remap_domain_gfn_range(), otoh, it's not clear at all why this wouldn't want / might not need to gain auto-translated support down the road, so the parameter is retained there despite now remaining unused (and the only caller passing NULL); correct a respective comment as well. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/036ad8a2-46f9-ac3d-6219-bdc93ab9e10b@suse.com Signed-off-by: Juergen Gross commit e11423d6721dd63b23fb41ade5e8d0b448b17780 Author: Jan Beulich Date: Wed Sep 22 12:17:48 2021 +0200 xen/privcmd: fix error handling in mmap-resource processing xen_pfn_t is the same size as int only on 32-bit builds (and not even on Arm32). Hence pfns[] can't be used directly to read individual error values returned from xen_remap_domain_mfn_array(); every other error indicator would be skipped/ignored on 64-bit. Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE") Cc: stable@vger.kernel.org Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/aa6d6a67-6889-338a-a910-51e889f792d5@suse.com Signed-off-by: Juergen Gross commit 0432523f4807a83902857347bd73eb817ef0a742 Author: Jan Beulich Date: Wed Sep 22 12:16:35 2021 +0200 xen/privcmd: replace kcalloc() by kvcalloc() when allocating empty pages Osstest has been suffering test failures for a little while from order-4 allocation failures, resulting from alloc_empty_pages() calling kcalloc(). As there's no need for physically contiguous space here, switch to kvcalloc(). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/6d698901-98a4-05be-c421-bcd0713f5335@suse.com Signed-off-by: Juergen Gross commit 783f3db030563f7bcdfe2d26428af98ea1699a8e Author: Oleksij Rempel Date: Tue Sep 28 15:49:40 2021 +0200 ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence Any pending interrupt can prevent entering standby based power off state. To avoid it, disable the GIC CPU interface. Fixes: 8148d2136002 ("ARM: imx6: register pm_power_off handler if "fsl,pmic-stby-poweroff" is set") Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 5963e5262180129f1be7556bd96994b6e52f3178 Author: Takashi Iwai Date: Mon Oct 4 09:40:50 2021 +0200 ALSA: usb-audio: Enable rate validation for Scarlett devices The Scarlett device series from Focusrite Novation seem requiring the sample rate validations as we've done for MOTU devices; otherwise the driver probes invalid audioformat entries that contain the sample rates that actually don't work, and this may result in an incomplete setup as reported recently. This patch adds the needed quirk flag for enabling the sample rate validation for Focusrite Novation devices. Fixes: fe773b8711e3 ("ALSA: usb-audio: workaround for iface reset issue") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214493 Link: https://lore.kernel.org/r/20211004074050.28241-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 258aad75c62146453d03028a44f2f1590d58e1f6 Author: Mike Christie Date: Mon Oct 4 16:06:08 2021 -0500 scsi: iscsi: Fix iscsi_task use after free Commit d39df158518c ("scsi: iscsi: Have abort handler get ref to conn") added iscsi_get_conn()/iscsi_put_conn() calls during abort handling but then also changed the handling of the case where we detect an already completed task where we now end up doing a goto to the common put/cleanup code. This results in a iscsi_task use after free, because the common cleanup code will do a put on the iscsi_task. This reverts the goto and moves the iscsi_get_conn() to after we've checked if the iscsi_task is valid. Link: https://lore.kernel.org/r/20211004210608.9962-1-michael.christie@oracle.com Fixes: d39df158518c ("scsi: iscsi: Have abort handler get ref to conn") Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 69a3a7bc7239170557dfc2c4ad5786a0c3d8759a Author: James Smart Date: Mon Oct 4 16:12:10 2021 -0700 scsi: lpfc: Fix memory overwrite during FC-GS I/O abort handling When an FC-GS I/O is aborted by lpfc, the driver requires a node pointer for a dereference operation. In the abort I/O routine, the driver miscasts a context pointer to the wrong data type and overwrites a single byte outside of the allocated space. This miscast is done in the abort I/O function handler because the handler works on both FC-GS and FC-LS commands. However, the code neglected to get the correct job location for the node. Fix this by acquiring the necessary node pointer from the correct job structure depending on the I/O type. Link: https://lore.kernel.org/r/20211004231210.35524-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 a013c71c6315d6e9d6364d12251b98c75c9a2861 Author: Dan Carpenter Date: Mon Oct 4 13:38:51 2021 +0300 scsi: elx: efct: Delete stray unlock statement It's not holding the lock at this stage and the IRQ "flags" are not correct so it would restore something bogus. Delete the unlock statement. Link: https://lore.kernel.org/r/20211004103851.GE25015@kili Fixes: 3e6414003bf9 ("scsi: elx: efct: SCSI I/O handling routines") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit f5ef336fd2e4c36dedae4e7ca66cf5349d6fda62 Author: Adrian Hunter Date: Wed Sep 22 12:10:59 2021 +0300 scsi: ufs: core: Fix task management completion The UFS driver uses blk_mq_tagset_busy_iter() when identifying task management requests to complete, however blk_mq_tagset_busy_iter() doesn't work. blk_mq_tagset_busy_iter() only iterates requests dispatched by the block layer. That appears as if it might have started since commit 37f4a24c2469 ("blk-mq: centralise related handling into blk_mq_get_driver_tag") which removed 'data->hctx->tags->rqs[rq->tag] = rq' from blk_mq_rq_ctx_init() which gets called: blk_get_request blk_mq_alloc_request __blk_mq_alloc_request blk_mq_rq_ctx_init Since UFS task management requests are not dispatched by the block layer, hctx->tags->rqs[rq->tag] remains NULL, and since blk_mq_tagset_busy_iter() relies on finding requests using hctx->tags->rqs[rq->tag], UFS task management requests are never found by blk_mq_tagset_busy_iter(). By using blk_mq_tagset_busy_iter(), the UFS driver was relying on internal details of the block layer, which was fragile and subsequently got broken. Fix by removing the use of blk_mq_tagset_busy_iter() and having the driver keep track of task management requests. Link: https://lore.kernel.org/r/20210922091059.4040-1-adrian.hunter@intel.com Fixes: 1235fc569e0b ("scsi: ufs: core: Fix task management request completion timeout") Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs") Cc: stable@vger.kernel.org Tested-by: Bart Van Assche Reviewed-by: Bart Van Assche Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit c5336400ca8b5f83123d965ce1eb9ac4a604cc95 Author: John Garry Date: Thu Sep 30 19:51:57 2021 +0800 scsi: acornscsi: Remove scsi_cmd_to_tag() reference Commit 756fb6a895af ("scsi: acornscsi: Remove tagged queuing vestiges") mistakenly introduced a reference to function scsi_cmd_to_tag(). This function does not exist as it was removed from an earlier series version when I upstreamed the named commit - originally authored By Hannes - but this reference still remained. Fix by replacing the reference to scsi_cmd_to_tag() with scsi_cmd_to_rq(scsi_scmd)->tag, which scsi_cmd_to_tag() was a wrapper for. Link: https://lore.kernel.org/r/1633002717-79765-1-git-send-email-john.garry@huawei.com Fixes: 756fb6a895af ("scsi: acornscsi: Remove tagged queuing vestiges") Reported-by: Arnd Bergmann Tested-by: Arnd Bergmann Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit bb8958d5dc79acbd071397abb57b8756375fe1ce Author: Alexandre Ghiti Date: Sat Sep 18 18:02:21 2021 +0200 riscv: Flush current cpu icache before other cpus On SiFive Unmatched, I recently fell onto the following BUG when booting: [ 0.000000] ftrace: allocating 36610 entries in 144 pages [ 0.000000] Oops - illegal instruction [#1] [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.13.1+ #5 [ 0.000000] Hardware name: SiFive HiFive Unmatched A00 (DT) [ 0.000000] epc : riscv_cpuid_to_hartid_mask+0x6/0xae [ 0.000000] ra : __sbi_rfence_v02+0xc8/0x10a [ 0.000000] epc : ffffffff80007240 ra : ffffffff80009964 sp : ffffffff81803e10 [ 0.000000] gp : ffffffff81a1ea70 tp : ffffffff8180f500 t0 : ffffffe07fe30000 [ 0.000000] t1 : 0000000000000004 t2 : 0000000000000000 s0 : ffffffff81803e60 [ 0.000000] s1 : 0000000000000000 a0 : ffffffff81a22238 a1 : ffffffff81803e10 [ 0.000000] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.000000] a5 : 0000000000000000 a6 : ffffffff8000989c a7 : 0000000052464e43 [ 0.000000] s2 : ffffffff81a220c8 s3 : 0000000000000000 s4 : 0000000000000000 [ 0.000000] s5 : 0000000000000000 s6 : 0000000200000100 s7 : 0000000000000001 [ 0.000000] s8 : ffffffe07fe04040 s9 : ffffffff81a22c80 s10: 0000000000001000 [ 0.000000] s11: 0000000000000004 t3 : 0000000000000001 t4 : 0000000000000008 [ 0.000000] t5 : ffffffcf04000808 t6 : ffffffe3ffddf188 [ 0.000000] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000002 [ 0.000000] [] riscv_cpuid_to_hartid_mask+0x6/0xae [ 0.000000] [] sbi_remote_fence_i+0x1e/0x26 [ 0.000000] [] flush_icache_all+0x12/0x1a [ 0.000000] [] patch_text_nosync+0x26/0x32 [ 0.000000] [] ftrace_init_nop+0x52/0x8c [ 0.000000] [] ftrace_process_locs.isra.0+0x29c/0x360 [ 0.000000] [] ftrace_init+0x80/0x130 [ 0.000000] [] start_kernel+0x5c4/0x8f6 [ 0.000000] ---[ end trace f67eb9af4d8d492b ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- While ftrace is looping over a list of addresses to patch, it always failed when patching the same function: riscv_cpuid_to_hartid_mask. Looking at the backtrace, the illegal instruction is encountered in this same function. However, patch_text_nosync, after patching the instructions, calls flush_icache_range. But looking at what happens in this function: flush_icache_range -> flush_icache_all -> sbi_remote_fence_i -> __sbi_rfence_v02 -> riscv_cpuid_to_hartid_mask The icache and dcache of the current cpu are never synchronized between the patching of riscv_cpuid_to_hartid_mask and calling this same function. So fix this by flushing the current cpu's icache before asking for the other cpus to do the same. Signed-off-by: Alexandre Ghiti Fixes: fab957c11efe ("RISC-V: Atomic and Locking Code") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 9246320672be813b5d653bb8b1b4e4206503ece9 Merge: 5155cf7b6aaef 59a4e0d5511ba Author: Palmer Dabbelt Date: Mon Oct 4 16:02:04 2021 -0700 Merge remote-tracking branch 'palmer/riscv-clone3' into fixes This contains a single patch to properly implement clone3() on rv32, which was missing before. In theory this is a new feature, but it's fixing a warning in checksyscalls that's now causing my build to fail so I'm calling it a fix. commit 59a4e0d5511ba61353ea9a4efdb1b86c23ecf134 Author: Palmer Dabbelt Date: Sat Oct 2 17:21:20 2021 -0700 RISC-V: Include clone3() on rv32 As far as I can tell this should be enabled on rv32 as well, I'm not sure why it's rv64-only. checksyscalls is complaining about our lack of clone3() on rv32. Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64") Signed-off-by: Palmer Dabbelt Reviewed-by: Arnd Bergmann Acked-by: Christian Brauner Signed-off-by: Palmer Dabbelt commit f6274b06e326d8471cdfb52595f989a90f5e888f Merge: 84b3e42564acc 2f9602870886a Author: Linus Torvalds Date: Mon Oct 4 14:33:30 2021 -0700 Merge tag 'linux-kselftest-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "A fix to implicit declaration warns in drivers/dma-buf test" * tag 'linux-kselftest-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: drivers/dma-buf: Fix implicit declaration warns commit ef31499a87cf842bdf6719f44473d93e99d09fe2 Author: David Howells Date: Mon Sep 20 10:33:55 2021 +0100 fscache: Remove an unused static variable The fscache object CREATE_OBJECT work state isn't ever referred to, so remove it and avoid the unused variable warning caused by W=1. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-fsdevel@vger.kernel.org cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/163214005516.2945267.7000234432243167892.stgit@warthog.procyon.org.uk/ # rfc v1 Link: https://lore.kernel.org/r/163281899704.2790286.9177774252843775348.stgit@warthog.procyon.org.uk/ # rfc v2 commit d9e3f82279bfe8419f437a637ff37c075598bd91 Author: David Howells Date: Mon Oct 4 22:08:50 2021 +0100 fscache: Fix some kerneldoc warnings shown up by W=1 Fix some kerneldoc warnings in the fscache driver that are shown up by W=1. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: Mauro Carvalho Chehab cc: linux-fsdevel@vger.kernel.org cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/163214005516.2945267.7000234432243167892.stgit@warthog.procyon.org.uk/ # rfc v1 Link: https://lore.kernel.org/r/163281899704.2790286.9177774252843775348.stgit@warthog.procyon.org.uk/ # rfc v2 commit bc868036569e1d1bc21a5ba110430b03ac0fdb9e Author: David Howells Date: Mon Oct 4 22:07:22 2021 +0100 9p: Fix a bunch of kerneldoc warnings shown up by W=1 Fix a bunch of kerneldoc warnings shown up by W=1 in the 9p filesystem: (1) Add/remove/fix kerneldoc parameters descriptions. (2) Move __add_fid() from between v9fs_fid_add() and its comment. (3) 9p's caches_show() doesn't really make sense as an API function, so remove the kerneldoc annotation. It's also not prefixed with 'v9fs_'. Also remove the kerneldoc markers from the 9p fscache wrappers. Signed-off-by: David Howells Reviewed-by: Dominique Martinet Reviewed-by: Jeff Layton cc: Mauro Carvalho Chehab cc: v9fs-developer@lists.sourceforge.net cc: linux-fsdevel@vger.kernel.org cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/163214005516.2945267.7000234432243167892.stgit@warthog.procyon.org.uk/ # rfc v1 Link: https://lore.kernel.org/r/163281899704.2790286.9177774252843775348.stgit@warthog.procyon.org.uk/ # rfc v2 commit dcb442b133642c507c81da6990860549b19d4e78 Author: David Howells Date: Mon Oct 4 22:04:33 2021 +0100 afs: Fix kerneldoc warning shown up by W=1 Fix a kerneldoc warning in afs due to a partially documented internal function by removing the kerneldoc marker. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/163214005516.2945267.7000234432243167892.stgit@warthog.procyon.org.uk/ # rfc v1 Link: https://lore.kernel.org/r/163281899704.2790286.9177774252843775348.stgit@warthog.procyon.org.uk/ # rfc v2 commit c0b27c4869702bce47b5b4cd5ef6da833b36496d Author: David Howells Date: Mon Oct 4 22:02:01 2021 +0100 nfs: Fix kerneldoc warning shown up by W=1 Fix a kerneldoc warning in nfs due to documentation for a parameter that isn't present. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: Trond Myklebust cc: Anna Schumaker cc: Mauro Carvalho Chehab cc: linux-nfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/163214005516.2945267.7000234432243167892.stgit@warthog.procyon.org.uk/ # rfc v1 Link: https://lore.kernel.org/r/163281899704.2790286.9177774252843775348.stgit@warthog.procyon.org.uk/ # rfc v2 commit fa1049135c15b4930ce7ea757a81b1b78908f304 Author: Vadim Pasternak Date: Mon Aug 23 17:45:02 2021 +0300 i2c: mlxcpld: Modify register setting for 400KHz frequency Change setting for 400KHz frequency support by more accurate value. Fixes: 66b0c2846ba8 ("i2c: mlxcpld: Add support for I2C bus frequency setting") Signed-off-by: Vadim Pasternak Signed-off-by: Wolfram Sang commit 52f57396c75acd77ebcdf3d20aed24ed248e9f79 Author: Vadim Pasternak Date: Mon Aug 23 17:45:01 2021 +0300 i2c: mlxcpld: Fix criteria for frequency setting Value for getting frequency capability wrongly has been taken from register offset instead of register value. Fixes: 66b0c2846ba8 ("i2c: mlxcpld: Add support for I2C bus frequency setting") Signed-off-by: Vadim Pasternak Signed-off-by: Wolfram Sang commit b2d70c0dbf2731a37d1c7bcc86ab2387954d5f56 Author: Geert Uytterhoeven Date: Fri Sep 24 14:35:12 2021 +0200 dt-bindings: drm/bridge: ti-sn65dsi86: Fix reg value make dtbs_check: arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dt.yaml: bridge@2c: reg:0:0: 45 was expected According to the datasheet, the I2C address can be either 0x2c or 0x2d, depending on the ADDR control input. Fixes: e3896e6dddf0b821 ("dt-bindings: drm/bridge: Document sn65dsi86 bridge bindings") Signed-off-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/08f73c2aa0d4e580303357dfae107d084d962835.1632486753.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 84b3e42564accd94c2680e3ba42717c32c8b5fc4 Merge: b60be028fc1a0 206704a1fe0bc Author: Linus Torvalds Date: Mon Oct 4 09:53:40 2021 -0700 Merge tag 'media/v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fix from Mauro Carvalho Chehab: "There's just one patch here, fixing a -Werror issue at staging/atomisp" * tag 'media/v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: atomisp: restore missing 'return' statement commit b60be028fc1a07a88a391aa4ff3304d9dcb3d66e Merge: df5c18838ea82 1dc1eed46f9fa Author: Linus Torvalds Date: Mon Oct 4 09:46:36 2021 -0700 Merge tag 'ovl-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs fixes from Miklos Szeredi: "Fix two bugs, both of them corner cases not affecting most users" * tag 'ovl-fixes-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO ovl: fix missing negative dentry check in ovl_rename() commit df5c18838ea82bd528a09ce1e7fa158e8eba7293 Merge: 9e1ff307c779c 740da9d7ca4e2 Author: Linus Torvalds Date: Mon Oct 4 09:38:55 2021 -0700 Merge tag 'mips-fixes_5.15_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fix from Thomas Bogendoerfer: "Revert workaround for buggy cpu detection because regressions" * tag 'mips-fixes_5.15_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Revert "add support for buggy MT7621S core detection" commit 206704a1fe0bcaaa036d3e90358bb168fac8bea1 Author: Arnd Bergmann Date: Mon Aug 2 16:38:14 2021 +0200 media: atomisp: restore missing 'return' statement The input_system_configure_channel_sensor() function lost its final return code in a previous patch: drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor': drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type] Restore what was there originally. Link: https://lore.kernel.org/linux-media/20210802143820.1150099-1-arnd@kernel.org Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code") Signed-off-by: Arnd Bergmann Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1dbdd99b511c966be9147ad72991a2856ac76f22 Author: Johannes Thumshirn Date: Mon Oct 4 16:22:07 2021 +0900 block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output While debugging an issue we've found that $DEBUGFS/block/$disk/state doesn't decode QUEUE_FLAG_HCTX_ACTIVE but only displays its numerical value. Add QUEUE_FLAG(HCTX_ACTIVE) to the blk_queue_flag_name array so it'll get decoded properly. Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/4351076388918075bd80ef07756f9d2ce63be12c.1633332053.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit b44d52a50bc6f191f0ae03f65de8401f3ef039b3 Author: Andrew Lunn Date: Sun Oct 3 17:50:53 2021 +0200 dsa: tag_dsa: Fix mask for trunked packets A packet received on a trunk will have bit 2 set in Forward DSA tagged frame. Bit 1 can be either 0 or 1 and is otherwise undefined and bit 0 indicates the frame CFI. Masking with 7 thus results in frames as being identified as being from a trunk when in fact they are not. Fix the mask to just look at bit 2. Fixes: 5b60dadb71db ("net: dsa: tag_dsa: Support reception of packets from LAG devices") Signed-off-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8b94aa318aa746fbbc668d6b9b3ad812c835230c Author: Michael Walle Date: Wed Sep 15 22:22:59 2021 +0200 arm64: dts: ls1028a: fix eSDHC2 node On the LS1028A this instance of the eSDHC controller is intended for either an eMMC or eSDIO card. It doesn't provide a card detect pin and its IO voltage is fixed at 1.8V. Remove the bogus broken-cd property, instead add the non-removable property. Fix the voltage-ranges property and set it to 1.8V only. Fixes: 491d3a3fc113 ("arm64: dts: ls1028a: Add esdhc node in dts") Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit 9786cca4b477f2b2f9d573d474c929d87579b501 Author: Heiko Thiery Date: Wed Sep 15 14:03:26 2021 +0200 arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2 The buck2 output of the PMIC is the VDD core voltage of the cpu. Switching off this will poweroff the CPU. Add the 'regulator-always-on' property to avoid this. Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") Signed-off-by: Heiko Thiery Reviewed-by: Frieder Schrempf Signed-off-by: Shawn Guo commit dbe68bc9e82b6951ff88285ccffc191d872d9a01 Author: Claudiu Beznea Date: Wed Sep 15 10:48:36 2021 +0300 ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins With commit c709135e576b ("pinctrl: at91-pio4: add support for slew-rate") and commit cbde6c823bfa ("pinctrl: at91-pio4: Fix slew rate disablement") the slew-rate is enabled by default for each configured pin. The datasheet specifies at chapter "Output Driver AC Characteristics" that HSIO drivers (use in SDMMCx and QSPI0 peripherals), don't have a slewrate setting but are rather calibrated against an external 1% resistor mounted on the SDMMCx_CAL or QSPI0_CAL pins. Depending on the target signal frequency and the external load, it is possible to adjust their target output impedance. Thus set slew-rate = <0> for SDMMC (QSPI is not enabled at the moment in device tree). Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210915074836.6574-3-claudiu.beznea@microchip.com commit 968f6e9d51e2da6eade2afb65629ab87a8a0faf3 Author: Claudiu Beznea Date: Wed Sep 15 10:48:35 2021 +0300 ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs Datasheet chapter "EMAC Timings" specifies that while in 3.3V domain GMAC's MDIO pins should be configured with slew-rate enabled, while the data + signaling pins should be configured with slew-rate disabled when GMAC works in RGMII or RMII modes. The pin controller for SAMA7G5 sets the slew-rate as enabled for all pins. Adapt the device tree to comply with these. Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210915074836.6574-2-claudiu.beznea@microchip.com commit d8d667ee0236dec6d717f27eec690d1324e7f322 Author: Claudiu Beznea Date: Thu Sep 30 18:42:19 2021 +0300 ARM: at91: pm: preload base address of controllers in tlb In suspend/resume procedure for AT91 architecture different controllers (PMC, SHDWC, RAM, RAM PHY, SFRBU) are accessed to do the proper settings for power saving. Commit f0bbf17958e8 ("ARM: at91: pm: add self-refresh support for sama7g5") introduced the access to RAMC PHY controller for SAMA7G5. The access to this controller is done after RAMC ports are closed, thus any TLB walk necessary for RAMC PHY virtual address will fail. In the development branch this was not encountered. However, on current kernel the issue is reproducible. To solve the issue the previous mechanism of pre-loading the TLB with the RAMC PHY virtual address has been used. However, only the addition of this new pre-load breaks the functionality for ARMv5 based devices (SAM9X60). This behavior has been encountered previously while debugging this code and using the same mechanism for pre-loading address for different controllers (e.g. pin controller, the assumption being that other requested translations are replaced from TLB). To solve this new issue the TLB flush + the extension of pre-loading the rest of controllers to TLB (e.g. PMC, RAMC) has been added. The rest of the controllers should have been pre-loaded previously, anyway. Fixes: f0bbf17958e8 ("ARM: at91: pm: add self-refresh support for sama7g5") Depends-on: e42cbbe5c9a2 ("ARM: at91: pm: group constants and addresses loading") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210930154219.2214051-4-claudiu.beznea@microchip.com commit e42cbbe5c9a2a8423db4b1c32ec2a443d4de6323 Author: Claudiu Beznea Date: Thu Sep 30 18:42:18 2021 +0300 ARM: at91: pm: group constants and addresses loading Group constants and addresses loading. This commit prepares the field for the next one. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210930154219.2214051-3-claudiu.beznea@microchip.com commit ef162ac50d5512e51da53b4c971597aabac7ea1f Author: Claudiu Beznea Date: Thu Sep 30 18:42:17 2021 +0300 ARM: dts: at91: sama7g5ek: add suspend voltage for ddr3l rail SAMA7G5-EK board has DDR3L type of memory soldered. This needs 1.35V. The 1.35V for DDR3L rail at run-time is selected by the proper configuration on SELV2 pin (for 1.35V it needs to be in high-z state). When suspended the MCP16502 PMIC soldered on SAMA7G5-EK will use different sets of configuration registers to provide proper voltages on its rail. Run-time configuration registers could be configured differently than suspend configuration register for MCP16502 (VSEL2 affects only run-time configuration). In suspend states the DDR3L memory soldered on SAMA7G5-EK switches to self-refresh. Even on self-refresh it needs to be powered by a 1.35V rail. Thus, make sure the PMIC is configured properly when system is suspended. Fixes: 7540629e2fc7 (ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210930154219.2214051-2-claudiu.beznea@microchip.com commit 410d591a19543f1347bc2b4b4ec3399cb548ba47 Author: Ian Kent Date: Mon Oct 4 09:03:53 2021 +0800 kernfs: don't create a negative dentry if inactive node exists It's been reported that doing stress test for module insertion and removal can result in an ENOENT from libkmod for a valid module. In kernfs_iop_lookup() a negative dentry is created if there's no kernfs node associated with the dentry or the node is inactive. But inactive kernfs nodes are meant to be invisible to the VFS and creating a negative dentry for these can have unexpected side effects when the node transitions to an active state. The point of creating negative dentries is to avoid the expensive alloc/free cycle that occurs if there are frequent lookups for kernfs attributes that don't exist. So kernfs nodes that are not yet active should not result in a negative dentry being created so when they transition to an active state VFS lookups can create an associated dentry is a natural way. It's also been reported that https://github.com/osandov/blktests.git test block/001 hangs during the test. It was suggested that recent changes to blktests might have caused it but applying this patch resolved the problem without change to blktests. Fixes: c7e7c04274b1 ("kernfs: use VFS negative dentry caching") Tested-by: Yi Zhang ACKed-by: Al Viro Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/163330943316.19450.15056895533949392922.stgit@mickey.themaw.net Signed-off-by: Greg Kroah-Hartman commit 2353e593a13ba76c82921940471ce442fe498927 Merge: 7b0035eaa7dab 25b5476a294cd Author: Paolo Bonzini Date: Mon Oct 4 03:58:25 2021 -0400 Merge tag 'kvm-s390-master-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master KVM: s390: allow to compile without warning with W=1 commit a46044a92add6a400f4dada7b943b30221f7cc80 Author: Niklas Schnelle Date: Wed Sep 22 15:55:12 2021 +0200 s390/pci: fix zpci_zdev_put() on reserve Since commit 2a671f77ee49 ("s390/pci: fix use after free of zpci_dev") the reference count of a zpci_dev is incremented between pcibios_add_device() and pcibios_release_device() which was supposed to prevent the zpci_dev from being freed while the common PCI code has access to it. It was missed however that the handling of zPCI availability events assumed that once zpci_zdev_put() was called no later availability event would still see the device. With the previously mentioned commit however this assumption no longer holds and we must make sure that we only drop the initial long-lived reference the zPCI subsystem holds exactly once. Do so by introducing a zpci_device_reserved() function that handles when a device is reserved. Here we make sure the zpci_dev will not be considered for further events by removing it from the zpci_list. This also means that the device actually stays in the ZPCI_FN_STATE_RESERVED state between the time we know it has been reserved and the final reference going away. We thus need to consider it a real state instead of just a conceptual state after the removal. The final cleanup of PCI resources, removal from zbus, and destruction of the IOMMU stays in zpci_release_device() to make sure holders of the reference do see valid data until the release. Fixes: 2a671f77ee49 ("s390/pci: fix use after free of zpci_dev") Cc: stable@vger.kernel.org Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 686cb8b9f6b46787f035afe8fbd132a74e6b1bdd Author: Tiezhu Yang Date: Mon Sep 27 15:06:14 2021 +0800 bpf, s390: Fix potential memory leak about jit_data Make sure to free jit_data through kfree() in the error path. Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs") Signed-off-by: Tiezhu Yang Acked-by: Ilya Leoshkevich Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger Signed-off-by: Vasily Gorbik commit cc03069a397005da24f6783835c274d5aedf6043 Author: Werner Sembach Date: Fri Oct 1 15:31:11 2021 +0200 ALSA: hda/realtek: Add quirk for Clevo X170KM-G This applies a SND_PCI_QUIRK(...) to the Clevo X170KM-G barebone. This fixes the issue of the devices internal Speaker not working. Signed-off-by: Werner Sembach Cc: Link: https://lore.kernel.org/r/20211001133111.428249-3-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai commit 1f8d398e1cd8813f8ec16d55c086e8270a9c18ab Author: Werner Sembach Date: Fri Oct 1 15:31:10 2021 +0200 ALSA: hda/realtek: Complete partial device name to avoid ambiguity The string "Clevo X170" is not enough to unambiguously identify the correct device. Fixing it so another Clevo barebone name starting with "X170" can be added without causing confusion. Signed-off-by: Werner Sembach Cc: Link: https://lore.kernel.org/r/20211001133111.428249-2-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai commit ad2b502bc5e65632104ef89372abd6691de8851c Merge: 9e1ff307c779c 4ca57d5139a0b Author: Greg Kroah-Hartman Date: Mon Oct 4 09:22:55 2021 +0200 Merge tag 'misc-habanalabs-fixes-2021-09-29' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-linus Oded writes: This tag contains the following fix for 5.15-rc4: - Prevent memset of ioctl arguments in case driver returns -EINTR * tag 'misc-habanalabs-fixes-2021-09-29' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: habanalabs: fix resetting args in wait for CS IOCTL commit 04aa946d57b20c40e541fb4ba2bcb390a22f404c Author: Haibo Chen Date: Fri Aug 20 17:29:50 2021 +0800 arm64: dts: imx8: change the spi-nor tx Before commit 0e30f47232ab5 ("mtd: spi-nor: add support for DTR protocol"), for all PP command, it only support 1-1-1 mode, no matter the tx setting in dts. But after the upper commit, the logic change. It will choose the best mode(fastest mode) which flash device and spi-nor host controller both support. qspi and fspi host controller do not support read 1-4-4 mode. so need to set the tx to 1, let the common code finally select read 1-1-4 mode. Signed-off-by: Haibo Chen Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol") Signed-off-by: Shawn Guo commit b2a4f4a302b83976ad0d2930abe0f38e6119a144 Author: Haibo Chen Date: Fri Aug 20 17:29:49 2021 +0800 ARM: dts: imx: change the spi-nor tx Before commit 0e30f47232ab5 ("mtd: spi-nor: add support for DTR protocol"), for all PP command, it only support 1-1-1 mode, no matter the tx setting in dts. But after the upper commit, the logic change. It will choose the best mode(fastest mode) which flash device and spi-nor host controller both support. Though the spi-nor device on imx6sx-sdb/imx6ul(l/z)-14x14-evk board do not support PP-1-4-4/PP-1-1-4, but if tx is 4 in dts file, it will also impact the read mode selection. For the spi-nor device on the upper mentioned boards, they support read 1-4-4 mode and read 1-1-4 mode according to the device internal sfdp register. But qspi host controller do not support read 1-4-4 mode. so need to set the tx to 1, let the common code finally select read 1-1-4 mode, PP-1-1-1 mode. Signed-off-by: Haibo Chen Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol") Signed-off-by: Shawn Guo commit 9e1ff307c779ce1f0f810c7ecce3d95bbae40896 Author: Linus Torvalds Date: Sun Oct 3 14:08:47 2021 -0700 Linux 5.15-rc4 commit 9b2f72cc0aa4bb444541bb87581c35b7508b37d3 Author: Chen Jingwen Date: Tue Sep 28 20:56:57 2021 +0800 elf: don't use MAP_FIXED_NOREPLACE for elf interpreter mappings In commit b212921b13bd ("elf: don't use MAP_FIXED_NOREPLACE for elf executable mappings") we still leave MAP_FIXED_NOREPLACE in place for load_elf_interp. Unfortunately, this will cause kernel to fail to start with: 1 (init): Uhuuh, elf segment at 00003ffff7ffd000 requested but the memory is mapped already Failed to execute /init (error -17) The reason is that the elf interpreter (ld.so) has overlapping segments. readelf -l ld-2.31.so Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x000000000002c94c 0x000000000002c94c R E 0x10000 LOAD 0x000000000002dae0 0x000000000003dae0 0x000000000003dae0 0x00000000000021e8 0x0000000000002320 RW 0x10000 LOAD 0x000000000002fe00 0x000000000003fe00 0x000000000003fe00 0x00000000000011ac 0x0000000000001328 RW 0x10000 The reason for this problem is the same as described in commit ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments"). Not only executable binaries, elf interpreters (e.g. ld.so) can have overlapping elf segments, so we better drop MAP_FIXED_NOREPLACE and go back to MAP_FIXED in load_elf_interp. Fixes: 4ed28639519c ("fs, elf: drop MAP_FIXED usage from elf_map") Cc: # v4.19 Cc: Andrew Morton Cc: Michal Hocko Signed-off-by: Chen Jingwen Signed-off-by: Linus Torvalds commit ca3cef466feaaf296c8519e2cc5ccf6565e3e7e9 Merge: 7fab1c12bde92 f2c77973507fd Author: Linus Torvalds Date: Sun Oct 3 13:56:53 2021 -0700 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 number of ext4 bugs in fast_commit, inline data, and delayed allocation. Also fix error handling code paths in ext4_dx_readdir() and ext4_fill_super(). Finally, avoid a grabbing a journal head in the delayed allocation write in the common cases where we are overwriting a pre-existing block or appending to an inode" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: recheck buffer uptodate bit under buffer lock ext4: fix potential infinite loop in ext4_dx_readdir() ext4: flush s_error_work before journal destroy in ext4_fill_super ext4: fix loff_t overflow in ext4_max_bitmap_size() ext4: fix reserved space counter leakage ext4: limit the number of blocks in one ADD_RANGE TLV ext4: enforce buffer head state assertion in ext4_da_map_blocks ext4: remove extent cache entries when truncating inline data ext4: drop unnecessary journal handle in delalloc write ext4: factor out write end code of inline file ext4: correct the error path of ext4_write_inline_data_end() ext4: check and update i_disksize properly ext4: add error checking to ext4_ext_replay_set_iblocks() commit 7fab1c12bde926c5a8c7d5984c551d0854d7e0b3 Author: Linus Torvalds Date: Sun Oct 3 13:45:48 2021 -0700 objtool: print out the symbol type when complaining about it The objtool warning that the kvm instruction emulation code triggered wasn't very useful: arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception in that it helpfully tells you which symbol name it had trouble figuring out the relocation for, but it doesn't actually say what the unknown symbol type was that triggered it all. In this case it was because of missing type information (type 0, aka STT_NOTYPE), but on the whole it really should just have printed that out as part of the message. Because if this warning triggers, that's very much the first thing you want to know - why did reloc2sec_off() return failure for that symbol? So rather than just saying you can't handle some type of symbol without saying what the type _was_, just print out the type number too. Fixes: 24ff65257375 ("objtool: Teach get_alt_entry() about more relocation types") Link: https://lore.kernel.org/lkml/CAHk-=wiZwq-0LknKhXN4M+T8jbxn_2i9mcKpO+OaBSSq_Eh7tg@mail.gmail.com/ Signed-off-by: Linus Torvalds commit 291073a566b2094c7192872cc0f17ce73d83cb76 Author: Linus Torvalds Date: Sun Oct 3 13:34:19 2021 -0700 kvm: fix objtool relocation warning The recent change to make objtool aware of more symbol relocation types (commit 24ff65257375: "objtool: Teach get_alt_entry() about more relocation types") also added another check, and resulted in this objtool warning when building kvm on x86: arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception The reason seems to be that kvm_fastop_exception() is marked as a global symbol, which causes the relocation to ke kept around for objtool. And at the same time, the kvm_fastop_exception definition (which is done as an inline asm statement) doesn't actually set the type of the global, which then makes objtool unhappy. The minimal fix is to just not mark kvm_fastop_exception as being a global symbol. It's only used in that one compilation unit anyway, so it was always pointless. That's how all the other local exception table labels are done. I'm not entirely happy about the kinds of games that the kvm code plays with doing its own exception handling, and the fact that it confused objtool is most definitely a symptom of the code being a bit too subtle and ad-hoc. But at least this trivial one-liner makes objtool no longer upset about what is going on. Fixes: 24ff65257375 ("objtool: Teach get_alt_entry() about more relocation types") Link: https://lore.kernel.org/lkml/CAHk-=wiZwq-0LknKhXN4M+T8jbxn_2i9mcKpO+OaBSSq_Eh7tg@mail.gmail.com/ Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: Nathan Chancellor Signed-off-by: Linus Torvalds commit 6761a0ae9895fce67536510396bfa63158b0b8ec Merge: 84928ce3bb4e2 bb8a4fcb21365 Author: Linus Torvalds Date: Sun Oct 3 11:19:02 2021 -0700 Merge tag 'char-misc-5.15-rc4' 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 misc driver fixes for 5.15-rc4. They are in two "groups": - ipack driver fixes for issues found by Johan Hovold - interconnect driver fixes for reported problems All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: ipack: ipoctal: fix module reference leak ipack: ipoctal: fix missing allocation-failure check ipack: ipoctal: fix tty-registration error handling ipack: ipoctal: fix tty registration race ipack: ipoctal: fix stack information leak interconnect: qcom: sdm660: Add missing a2noc qos clocks dt-bindings: interconnect: sdm660: Add missing a2noc qos clocks interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask interconnect: qcom: sdm660: Fix id of slv_cnoc_mnoc_cfg commit 84928ce3bb4e20ec7ef0e990630a690855dd44cc Merge: 777feabaea776 df38d852c6814 Author: Linus Torvalds Date: Sun Oct 3 11:10:09 2021 -0700 Merge tag 'driver-core-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here are some driver core and kernfs fixes for reported issues for 5.15-rc4. These fixes include: - kernfs positive dentry bugfix - debugfs_create_file_size error path fix - cpumask sysfs file bugfix to preserve the user/kernel abi (has been reported multiple times.) - devlink fixes for mdiobus devices as reported by the subsystem maintainers. Also included in here are some devlink debugging changes to make it easier for people to report problems when asked. They have already helped with the mdiobus and other subsystems reporting issues. All of these have been linux-next for a while with no reported issues" * tag 'driver-core-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: also call kernfs_set_rev() for positive dentry driver core: Add debug logs when fwnode links are added/deleted driver core: Create __fwnode_link_del() helper function driver core: Set deferred probe reason when deferred by driver core net: mdiobus: Set FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for mdiobus parents driver core: fw_devlink: Add support for FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD driver core: fw_devlink: Improve handling of cyclic dependencies cpumask: Omit terminating null byte in cpumap_print_{list,bitmask}_to_buf debugfs: debugfs_create_file_size(): use IS_ERR to check for error commit 777feabaea776a6bff3d198edfe931b0b45c45d9 Merge: 3a399a2bc465e 83d40a61046f7 Author: Linus Torvalds Date: Sun Oct 3 10:49:00 2021 -0700 Merge tag 'sched_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Tell the compiler to always inline is_percpu_thread() - Make sure tunable_scaling buffer is null-terminated after an update in sysfs - Fix LTP named regression due to cgroup list ordering * tag 'sched_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Always inline is_percpu_thread() sched/fair: Null terminate buffer when updating tunable_scaling sched/fair: Add ancestors of unthrottled undecayed cfs_rq commit 3a399a2bc465e7fb0e788bfbffefc9399d628a25 Merge: 52c3c170623d9 f792565326825 Author: Linus Torvalds Date: Sun Oct 3 10:32:27 2021 -0700 Merge tag 'perf_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Make sure the destroy callback is reset when a event initialization fails - Update the event constraints for Icelake - Make sure the active time of an event is updated even for inactive events * tag 'perf_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: fix userpage->time_enabled of inactive events perf/x86/intel: Update event constraints for ICX perf/x86: Reset destroy callback on event init failure commit 52c3c170623d994c468c1ee9cc36c56bbd6d6e56 Merge: 7b66f4393ad42 24ff652573754 Author: Linus Torvalds Date: Sun Oct 3 10:23:54 2021 -0700 Merge tag 'objtool_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fix from Borislav Petkov: - Handle symbol relocations properly due to changes in the toolchains which remove section symbols now * tag 'objtool_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Teach get_alt_entry() about more relocation types commit 26d90b5590579def54382a2fc34cfbe8518a9851 Author: Jiri Valek - 2N Date: Mon Sep 20 14:53:48 2021 +0200 iio: light: opt3001: Fixed timeout error when 0 lux Reading from sensor returned timeout error under zero light conditions. Signed-off-by: Jiri Valek - 2N Fixes: ac663db3678a ("iio: light: opt3001: enable operation w/o IRQ") Link: https://lore.kernel.org/r/20210920125351.6569-1-valek@2n.cz Cc: Signed-off-by: Jonathan Cameron commit 7b66f4393ad421e425ba643fde0493fa64346a43 Merge: e25ca045c32a0 dd4d747ef05ad Author: Linus Torvalds Date: Sat Oct 2 17:51:01 2021 -0700 Merge tag 'hwmon-for-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fixed various potential NULL pointer accesses in w8379* drivers - Improved error handling, fault reporting, and fixed rounding in thmp421 driver - Fixed error handling in ltc2947 driver - Added missing attribute to pmbus/mp2975 driver - Fixed attribute values in pbus/ibm-cffps, occ, and mlxreg-fan drivers - Removed unused residual code from k10temp driver * tag 'hwmon-for-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (w83793) Fix NULL pointer dereference by removing unnecessary structure field hwmon: (w83792d) Fix NULL pointer dereference by removing unnecessary structure field hwmon: (w83791d) Fix NULL pointer dereference by removing unnecessary structure field hwmon: (pmbus/mp2975) Add missed POUT attribute for page 1 mp2975 controller hwmon: (pmbus/ibm-cffps) max_power_out swap changes hwmon: (occ) Fix P10 VRM temp sensors hwmon: (ltc2947) Properly handle errors when looking for the external clock hwmon: (tmp421) fix rounding for negative values hwmon: (tmp421) report /PVLD condition as fault hwmon: (tmp421) handle I2C errors hwmon: (mlxreg-fan) Return non-zero value when fan current state is enforced from sysfs hwmon: (k10temp) Remove residues of current and voltage commit e25ca045c32a0d787b143fef0acc5a43cc9ccc66 Merge: 9904468fb0b72 87ffb310d5e8a Author: Linus Torvalds Date: Sat Oct 2 17:43:54 2021 -0700 Merge tag '5.15-rc3-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: "Eleven fixes for the ksmbd kernel server, mostly security related: - an important fix for disabling weak NTLMv1 authentication - seven security (improved buffer overflow checks) fixes - fix for wrong infolevel struct used in some getattr/setattr paths - two small documentation fixes" * tag '5.15-rc3-ksmbd-fixes' of git://git.samba.org/ksmbd: ksmbd: missing check for NULL in convert_to_nt_pathname() ksmbd: fix transform header validation ksmbd: add buffer validation for SMB2_CREATE_CONTEXT ksmbd: add validation in smb2 negotiate ksmbd: add request buffer validation in smb2_set_info ksmbd: use correct basic info level in set_file_basic_info() ksmbd: remove NTLMv1 authentication ksmbd: fix documentation for 2 functions MAINTAINERS: rename cifs_common to smbfs_common in cifs and ksmbd entry ksmbd: fix invalid request buffer access in compound ksmbd: remove RFC1002 check in smb2 request commit 5155cf7b6aaefe64d7d7e1f8ca1871fce55444c4 Merge: 6880fa6c56601 8bb0ab3ae7a4d Author: Palmer Dabbelt Date: Sat Oct 2 14:51:40 2021 -0700 Merge remote-tracking branch 'palmer/riscv-vdso-cleanup' into fixes This contains a VDSO cleanup, along with a handful of VDSO fixes. * palmer/riscv-vdso-cleanup: riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable riscv/vdso: Move vdso data page up front riscv/vdso: Refactor asm/vdso.h commit 8bb0ab3ae7a4dbe6cf32deb830cf2bdbf5736867 Author: Tong Tiangen Date: Wed Sep 1 02:46:21 2021 +0000 riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable riscv architectures relying on mmap_sem for write in their arch_setup_additional_pages. If the waiting task gets killed by the oom killer it would block oom_reaper from asynchronous address space reclaim and reduce the chances of timely OOM resolving. Wait for the lock in the killable mode and return with EINTR if the task got killed while waiting. Signed-off-by: Tong Tiangen Reviewed-by: Kefeng Wang Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code") Signed-off-by: Palmer Dabbelt commit 78a743cd82a35ca0724179fc22834f06a2151fc2 Author: Tong Tiangen Date: Wed Sep 1 02:46:20 2021 +0000 riscv/vdso: Move vdso data page up front As commit 601255ae3c98 ("arm64: vdso: move data page before code pages"), the same issue exists on riscv, testcase is shown below, make sure that vdso.so is bigger than page size, struct timespec tp; clock_gettime(5, &tp); printf("tv_sec: %ld, tv_nsec: %ld\n", tp.tv_sec, tp.tv_nsec); without this patch, test result : tv_sec: 0, tv_nsec: 0 with this patch, test result : tv_sec: 1629271537, tv_nsec: 748000000 Move the vdso data page in front of the VDSO area to fix the issue. Fixes: ad5d1122b82fb ("riscv: use vDSO common flow to reduce the latency of the time-related functions") Signed-off-by: Tong Tiangen Reviewed-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit bb4a23c994aebcd96c567a0be8e964d516bd4a61 Author: Tong Tiangen Date: Wed Sep 1 02:46:19 2021 +0000 riscv/vdso: Refactor asm/vdso.h The asm/vdso.h will be included in vdso.lds.S in the next patch, the following cleanup is needed to avoid syntax error: 1.the declaration of sys_riscv_flush_icache() is moved into asm/syscall.h. 2.the definition of struct vdso_data is moved into kernel/vdso.c. 2.the definition of VDSO_SYMBOL is placed under "#ifndef __ASSEMBLY__". Also remove the redundant linux/types.h include. Signed-off-by: Tong Tiangen Reviewed-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit 9904468fb0b72a59a10753a86ce121fbdd2e9b3d Merge: ab2a7a35c4e7e 79a7482249a73 Author: Linus Torvalds Date: Sat Oct 2 12:56:03 2021 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Five fairly minor fixes and spelling updates, all in drivers. Even though the ufs fix is in tracing, it's a potentially exploitable use beyond end of array bug" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: csiostor: Add module softdep on cxgb4 scsi: qla2xxx: Fix excessive messages during device logout scsi: virtio_scsi: Fix spelling mistake "Unsupport" -> "Unsupported" scsi: ses: Fix unsigned comparison with less than zero scsi: ufs: Fix illegal offset in UPIU event trace commit ab2a7a35c4e7e848de9a7cf70f36b62584154140 Merge: 65893b49d868b 41e76c6a3c83c Author: Linus Torvalds Date: Sat Oct 2 11:00:36 2021 -0700 Merge tag 'block-5.15-2021-10-01' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "A few block fixes for this release: - Revert a BFQ commit that causes breakage for people. Unfortunately it was auto-selected for stable as well, so now 5.14.7 suffers from it too. Hopefully stable will pick up this revert quickly too, so we can remove the issue on that end as well. - Add a quirk for Apple NVMe controllers, which due to their non-compliance broke due to the introduction of command sequences (Keith) - Use shifts in nbd, fixing a __divdi3 issue (Nick)" * tag 'block-5.15-2021-10-01' of git://git.kernel.dk/linux-block: nbd: use shifts rather than multiplies Revert "block, bfq: honor already-setup queue merges" nvme: add command id quirk for apple controllers commit 65893b49d868bd2de5fbac41744d1eaecc739629 Merge: f05c643743a43 3f008385d46d3 Author: Linus Torvalds Date: Sat Oct 2 10:26:19 2021 -0700 Merge tag 'io_uring-5.15-2021-10-01' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Two fixes in here: - The signal issue that was discussed start of this week (me). - Kill dead fasync support in io_uring. Looks like it was broken since io_uring was initially merged, and given that nobody has ever complained about it, let's just kill it (Pavel)" * tag 'io_uring-5.15-2021-10-01' of git://git.kernel.dk/linux-block: io_uring: kill fasync io-wq: exclusively gate signal based exit on get_signal() return commit f05c643743a43b42e7603a520ad052e5218f4e53 Merge: 6e9bfdcf0a3b1 d55174cccac2e Author: Linus Torvalds Date: Sat Oct 2 10:08:35 2021 -0700 Merge tag 'libnvdimm-fixes-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fixes from Dan Williams: "A fix for a regression added this cycle in the pmem driver, and for a long standing bug for failed NUMA node lookups on ARM64. This has appeared in -next for several days with no reported issues. Summary: - Fix a regression that caused the sysfs ABI for pmem block devices to not be registered. This fails the nvdimm unit tests and dax xfstests. - Fix numa node lookups for dax-kmem memory (device-dax memory assigned to the page allocator) on ARM64" * tag 'libnvdimm-fixes-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/pmem: fix creating the dax group ACPI: NFIT: Use fallback node id when numa info in NFIT table is incorrect commit 6e9bfdcf0a3b1c8126878c21adcfc343f89d4a6a Author: Dave Wysochanski Date: Fri Oct 1 15:37:31 2021 +0100 cachefiles: Fix oops in trace_cachefiles_mark_buried due to NULL object In cachefiles_mark_object_buried, the dentry in question may not have an owner, and thus our cachefiles_object pointer may be NULL when calling the tracepoint, in which case we will also not have a valid debug_id to print in the tracepoint. Check for NULL object in the tracepoint and if so, just set debug_id to MAX_UINT as was done in 2908f5e101e3 ("fscache: Add a cookie debug ID and use that in traces"). This fixes the following oops: FS-Cache: Cache "mycache" added (type cachefiles) CacheFiles: File cache on vdc registered ... Workqueue: fscache_object fscache_object_work_func [fscache] RIP: 0010:trace_event_raw_event_cachefiles_mark_buried+0x4e/0xa0 [cachefiles] .... Call Trace: cachefiles_mark_object_buried+0xa5/0xb0 [cachefiles] cachefiles_bury_object+0x270/0x430 [cachefiles] cachefiles_walk_to_object+0x195/0x9c0 [cachefiles] cachefiles_lookup_object+0x5a/0xc0 [cachefiles] fscache_look_up_object+0xd7/0x160 [fscache] fscache_object_work_func+0xb2/0x340 [fscache] process_one_work+0x1f1/0x390 worker_thread+0x53/0x3e0 kthread+0x127/0x150 Fixes: 2908f5e101e3 ("fscache: Add a cookie debug ID and use that in traces") Signed-off-by: Dave Wysochanski Signed-off-by: David Howells cc: linux-cachefs@redhat.com Signed-off-by: Linus Torvalds commit cdc1e6e225e3256d56dc6648411630e71d7c776b Author: Hugh Dickins Date: Sat Oct 2 03:17:29 2021 -0700 drm/i915: fix blank screen booting crashes 5.15-rc1 crashes with blank screen when booting up on two ThinkPads using i915. Bisections converge convincingly, but arrive at different and suprising "culprits", none of them the actual culprit. netconsole (with init_netconsole() hacked to call i915_init() when logging has started, instead of by module_init()) tells the story: kernel BUG at drivers/gpu/drm/i915/i915_sw_fence.c:245! with RSI: ffffffff814d408b pointing to sw_fence_dummy_notify(). I've been building with CONFIG_CC_OPTIMIZE_FOR_SIZE=y, and that function needs to be 4-byte aligned. Fixes: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Hugh Dickins Tested-by: Steven Rostedt (VMware) Signed-off-by: Linus Torvalds commit 57b44817a8d63e75394bc21849f585ded53de8bb Author: Moritz Fischer Date: Tue Sep 28 07:57:53 2021 -0700 MAINTAINERS: Drop outdated FPGA Manager website The rocketboards website no longer really reflects a good landing place for people interested in FPGA Manager. Cc: Xu Yilun Cc: Wu Hao Acked-by: Xu Yilun Signed-off-by: Moritz Fischer commit 7cd8b1542a7ba0720c5a0a85ed414a122015228b Author: Andy Shevchenko Date: Fri Oct 1 19:20:33 2021 +0300 ptp_pch: Load module automatically if ID matches The driver can't be loaded automatically because it misses module alias to be provided. Add corresponding MODULE_DEVICE_TABLE() call to the driver. Fixes: 863d08ece9bf ("supports eg20t ptp clock") Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 06cc978d3ff226072780f74897800b33e78abb57 Author: Tetsuo Handa Date: Sat Oct 2 18:23:02 2021 +0900 block: genhd: fix double kfree() in __alloc_disk_node() syzbot is reporting use-after-free read at bdev_free_inode() [1], for kfree() from __alloc_disk_node() is called before bdev_free_inode() (which is called after RCU grace period) reads bdev->bd_disk and calls kfree(bdev->bd_disk). Fix use-after-free read followed by double kfree() problem by making sure that bdev->bd_disk is NULL when calling iput(). Link: https://syzkaller.appspot.com/bug?extid=8281086e8a6fbfbd952a [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/e6dd13c5-8db0-4392-6e78-a42ee5d2a1c4@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit eed183abc0d3b8adb64fd1363b7cea7986cd58d6 Author: Pali Rohár Date: Sat Oct 2 11:04:09 2021 +0200 powerpc/fsl/dts: Fix phy-connection-type for fm1mac3 Property phy-connection-type contains invalid value "sgmii-2500" per scheme defined in file ethernet-controller.yaml. Correct phy-connection-type value should be "2500base-x". Signed-off-by: Pali Rohár Fixes: 84e0f1c13806 ("powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)") Acked-by: Scott Wood Signed-off-by: David S. Miller commit dade7f9d819d89ba2da5f72a07cb4b91a1e1f74a Merge: 5cfe5109a1d7f 6fb721cf78180 Author: David S. Miller Date: Sat Oct 2 13:55:02 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net (v2) The following patchset contains Netfilter fixes for net: 1) Move back the defrag users fields to the global netns_nf area. Kernel fails to boot if conntrack is builtin and kernel is booted with: nf_conntrack.enable_hooks=1. From Florian Westphal. 2) Rule event notification is missing relevant context such as the position handle and the NLM_F_APPEND flag. 3) Rule replacement is expanded to add + delete using the existing rule handle, reverse order of this operation so it makes sense from rule notification standpoint. 4) Propagate to userspace the NLM_F_CREATE and NLM_F_EXCL flags from the rule notification path. Patches #2, #3 and #4 are used by 'nft monitor' and 'iptables-monitor' userspace utilities which are not correctly representing the following operations through netlink notifications: - rule insertions - rule addition/insertion from position handle - create table/chain/set/map/flowtable/... ==================== Signed-off-by: David S. Miller commit dd4d747ef05addab887dc8ff0d6ab9860bbcd783 Author: Nadezda Lutovinova Date: Tue Sep 21 18:51:53 2021 +0300 hwmon: (w83793) Fix NULL pointer dereference by removing unnecessary structure field If driver read tmp value sufficient for (tmp & 0x08) && (!(tmp & 0x80)) && ((tmp & 0x7) == ((tmp >> 4) & 0x7)) from device then Null pointer dereference occurs. (It is possible if tmp = 0b0xyz1xyz, where same literals mean same numbers) Also lm75[] does not serve a purpose anymore after switching to devm_i2c_new_dummy_device() in w83791d_detect_subclients(). The patch fixes possible NULL pointer dereference by removing lm75[]. Found by Linux Driver Verification project (linuxtesting.org). Cc: stable@vger.kernel.org Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210921155153.28098-3-lutovinova@ispras.ru [groeck: Dropped unnecessary continuation lines, fixed multi-line alignments] Signed-off-by: Guenter Roeck commit 0f36b88173f028e372668ae040ab1a496834d278 Author: Nadezda Lutovinova Date: Tue Sep 21 18:51:52 2021 +0300 hwmon: (w83792d) Fix NULL pointer dereference by removing unnecessary structure field If driver read val value sufficient for (val & 0x08) && (!(val & 0x80)) && ((val & 0x7) == ((val >> 4) & 0x7)) from device then Null pointer dereference occurs. (It is possible if tmp = 0b0xyz1xyz, where same literals mean same numbers) Also lm75[] does not serve a purpose anymore after switching to devm_i2c_new_dummy_device() in w83791d_detect_subclients(). The patch fixes possible NULL pointer dereference by removing lm75[]. Found by Linux Driver Verification project (linuxtesting.org). Cc: stable@vger.kernel.org Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210921155153.28098-2-lutovinova@ispras.ru [groeck: Dropped unnecessary continuation lines, fixed multipline alignment] Signed-off-by: Guenter Roeck commit 943c15ac1b84d378da26bba41c83c67e16499ac4 Author: Nadezda Lutovinova Date: Tue Sep 21 18:51:51 2021 +0300 hwmon: (w83791d) Fix NULL pointer dereference by removing unnecessary structure field If driver read val value sufficient for (val & 0x08) && (!(val & 0x80)) && ((val & 0x7) == ((val >> 4) & 0x7)) from device then Null pointer dereference occurs. (It is possible if tmp = 0b0xyz1xyz, where same literals mean same numbers) Also lm75[] does not serve a purpose anymore after switching to devm_i2c_new_dummy_device() in w83791d_detect_subclients(). The patch fixes possible NULL pointer dereference by removing lm75[]. Found by Linux Driver Verification project (linuxtesting.org). Cc: stable@vger.kernel.org Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210921155153.28098-1-lutovinova@ispras.ru [groeck: Dropped unnecessary continuation lines, fixed multi-line alignment] Signed-off-by: Guenter Roeck commit 2292e2f685cd5c65e3f47bbcf9f469513acc3195 Author: Vadim Pasternak Date: Mon Sep 27 10:07:40 2021 +0300 hwmon: (pmbus/mp2975) Add missed POUT attribute for page 1 mp2975 controller Add missed attribute for reading POUT from page 1. It is supported by device, but has been missed in initial commit. Fixes: 2c6fcbb21149 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller") Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20210927070740.2149290-1-vadimp@nvidia.com Signed-off-by: Guenter Roeck commit f067d5585cda2de1e47dde914a8a4f151659e0ad Author: Brandon Wyman Date: Tue Sep 28 20:50:51 2021 +0000 hwmon: (pmbus/ibm-cffps) max_power_out swap changes The bytes for max_power_out from the ibm-cffps devices differ in byte order for some power supplies. The Witherspoon power supply returns the bytes in MSB/LSB order. The Rainier power supply returns the bytes in LSB/MSB order. The Witherspoon power supply uses version cffps1. The Rainier power supply should use version cffps2. If version is cffps1, swap the bytes before output to max_power_out. Tested: Witherspoon before: 3148. Witherspoon after: 3148. Rainier before: 53255. Rainier after: 2000. Signed-off-by: Brandon Wyman Reviewed-by: Eddie James Link: https://lore.kernel.org/r/20210928205051.1222815-1-bjwyman@gmail.com [groeck: Replaced yoda programming] Signed-off-by: Guenter Roeck commit ffa2600044979aff4bd6238edb9af815a47d7c32 Author: Eddie James Date: Wed Sep 29 10:36:04 2021 -0500 hwmon: (occ) Fix P10 VRM temp sensors The P10 (temp sensor version 0x10) doesn't do the same VRM status reporting that was used on P9. It just reports the temperature, so drop the check for VRM fru type in the sysfs show function, and don't set the name to "alarm". Fixes: db4919ec86 ("hwmon: (occ) Add new temperature sensor type") Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20210929153604.14968-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck commit 6fb721cf781808ee2ca5e737fb0592cc68de3381 Author: Pablo Neira Ayuso Date: Sun Sep 26 09:59:35 2021 +0200 netfilter: nf_tables: honor NLM_F_CREATE and NLM_F_EXCL in event notification Include the NLM_F_CREATE and NLM_F_EXCL flags in netlink event notifications, otherwise userspace cannot distiguish between create and add commands. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso commit 740da9d7ca4e25f5d87db9f80d75432681b61305 Author: Ilya Lipnitskiy Date: Thu Sep 30 09:57:41 2021 -0700 MIPS: Revert "add support for buggy MT7621S core detection" This reverts commit 6decd1aad15f56b169217789630a0098b496de0e. CPULAUNCH register is not set properly by some bootloaders, causing a regression until a bootloader change is made, which is hard if not impossible on some embedded devices. Revert the change until a more robust core detection mechanism that works on MT7621S routers such as Netgear R6220 as well as platforms like Digi EX15 can be made. Link: https://lore.kernel.org/lkml/4d9e3b39-7caa-d372-5d7b-42dcec36fec7@kernel.org Fixes: 6decd1aad15f ("MIPS: add support for buggy MT7621S core detection") Signed-off-by: Ilya Lipnitskiy Acked-by: Sergio Paracuellos Acked-by: Greg Ungerer Signed-off-by: Thomas Bogendoerfer commit 3bce7703c7ba648bd9e174dc1413f422b7998833 Author: Kewei Xu Date: Fri Sep 17 18:14:14 2021 +0800 i2c: mediatek: Add OFFSET_EXT_CONF setting back In the commit be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support"), we miss setting OFFSET_EXT_CONF register if i2c->dev_comp->timing_adjust is false, now add it back. Fixes: be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support") Signed-off-by: Kewei Xu Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang commit 6558b646ce1c2a872fe1c2c7cb116f05a2c1950f Author: Jamie Iles Date: Wed Sep 22 17:57:18 2021 +0100 i2c: acpi: fix resource leak in reconfiguration device addition acpi_i2c_find_adapter_by_handle() calls bus_find_device() which takes a reference on the adapter which is never released which will result in a reference count leak and render the adapter unremovable. Make sure to put the adapter after creating the client in the same manner that we do for OF. Fixes: 525e6fabeae2 ("i2c / ACPI: add support for ACPI reconfigure notifications") Signed-off-by: Jamie Iles Acked-by: Mika Westerberg [wsa: fixed title] Signed-off-by: Wolfram Sang commit 67a12ae52599c9f2f24ef14adb43fc3b164792b5 Author: Michael Walle Date: Fri Oct 1 23:27:26 2021 +0200 spi: spi-nxp-fspi: don't depend on a specific node name erratum workaround In commit 7e71b85473f8 ("arm64: dts: ls1028a: fix node name for the sysclk") the sysclk node name was renamed and broke the erratum workaround because it tries to fetch a device tree node by its name, which is very fragile in general. We don't even need the sysclk node because the only possible sysclk frequency input is 100MHz. In fact, the erratum says it applies if SYS_PLL_RAT is 3, not that the platform clock is 300 MHz. Make the workaround more reliable and just drop the unneeded sysclk lookup. For reference, the error during the bootup is the following: [ 4.898400] nxp-fspi 20c0000.spi: Errata cannot be executed. Read via IP bus may not work Fixes: 82ce7d0e74b6 ("spi: spi-nxp-fspi: Implement errata workaround for LS1028A") Cc: Vladimir Oltean Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20211001212726.159437-1-michael@walle.cc Signed-off-by: Mark Brown commit 67006e30e27e80fd9403a91ae3c0c85391c6c2cc Author: Rob Herring Date: Tue Sep 28 17:29:20 2021 -0500 dt-bindings: Drop more redundant 'maxItems/minItems' Another round of removing redundant minItems/maxItems from new schema in the recent merge window. 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. Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Evgeniy Polyakov Cc: Marek Vasut Cc: Joakim Zhang Cc: dri-devel@lists.freedesktop.org Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210928222920.2204761-1-robh@kernel.org commit 55442e6af03434c500541782f01730a89162eb27 Author: Rob Herring Date: Thu Aug 19 19:14:57 2021 -0500 dt-bindings: media: Fix more graph 'unevaluatedProperties' related warnings The graph schema doesn't allow custom properties on endpoint nodes for '#/properties/port' and '#/$defs/port-base' should be used instead. This doesn't matter until 'unevaluatedProperties' support is implemented. Cc: Dave Stevenson Cc: Jacopo Mondi Cc: Mauro Carvalho Chehab Cc: "Paul J. Murphy" Cc: Daniele Alessandrelli Cc: linux-media@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Daniele Alessandrelli Link: https://lore.kernel.org/r/20210820001457.1705142-1-robh@kernel.org commit 5cfe5109a1d7fd9686d5c695827216788bf0b1ec Author: Leon Romanovsky Date: Thu Sep 30 08:12:43 2021 +0300 MAINTAINERS: Remove Bin Luo as his email bounces The emails sent to luobin9@huawei.com bounce with error: "Recipient address rejected: Failed recipient validation check." So let's remove his entry and change the status of hinic driver till someone in Huawei will step-in to maintain it again. Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/045a32ccf394de66b7899c8b732f44dc5f4a1154.1632978665.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit aec3f415f7244b7747a7952596971adb0df2f568 Author: Punit Agrawal Date: Wed Sep 29 22:50:49 2021 +0900 net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices Commit 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") while getting rid of a runtime PM warning ended up breaking ethernet on rk3399 based devices. By dropping an extra reference to the device, the commit ends up enabling suspend / resume of the ethernet device - which appears to be broken. While the issue with runtime pm is being investigated, partially revert commit 2d26f6e39afb to restore the network on rk3399. Fixes: 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") Suggested-by: Heiko Stuebner Signed-off-by: Punit Agrawal Cc: Michael Riesch Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210929135049.3426058-1-punitagrawal@gmail.com Signed-off-by: Jakub Kicinski commit 019d9329e7481cfaccbd8ed17b1e04ca76970f13 Author: Vladimir Oltean Date: Thu Sep 30 15:53:30 2021 +0300 net: mscc: ocelot: fix VCAP filters remaining active after being deleted When ocelot_flower.c calls ocelot_vcap_filter_add(), the filter has a given filter->id.cookie. This filter is added to the block->rules list. However, when ocelot_flower.c calls ocelot_vcap_block_find_filter_by_id() which passes the cookie as argument, the filter is never found by filter->id.cookie when searching through the block->rules list. This is unsurprising, since the filter->id.cookie is an unsigned long, but the cookie argument provided to ocelot_vcap_block_find_filter_by_id() is a signed int, and the comparison fails. Fixes: 50c6cc5b9283 ("net: mscc: ocelot: store a namespaced VCAP filter ID") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210930125330.2078625-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 560ee196fe9e5037e5015e2cdb14b3aecb1cd7dc Author: Eric Dumazet Date: Thu Sep 30 14:22:39 2021 -0700 net_sched: fix NULL deref in fifo_set_limit() syzbot reported another NULL deref in fifo_set_limit() [1] I could repro the issue with : unshare -n tc qd add dev lo root handle 1:0 tbf limit 200000 burst 70000 rate 100Mbit tc qd replace dev lo parent 1:0 pfifo_fast tc qd change dev lo root handle 1:0 tbf limit 300000 burst 70000 rate 100Mbit pfifo_fast does not have a change() operation. Make fifo_set_limit() more robust about this. [1] BUG: kernel NULL pointer dereference, address: 0000000000000000 PGD 1cf99067 P4D 1cf99067 PUD 7ca49067 PMD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 1 PID: 14443 Comm: syz-executor959 Not tainted 5.15.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:0x0 Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. RSP: 0018:ffffc9000e2f7310 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffffffff8d6ecc00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff888024c27910 RDI: ffff888071e34000 RBP: ffff888071e34000 R08: 0000000000000001 R09: ffffffff8fcfb947 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024c27910 R13: ffff888071e34018 R14: 0000000000000000 R15: ffff88801ef74800 FS: 00007f321d897700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000000722c3000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: fifo_set_limit net/sched/sch_fifo.c:242 [inline] fifo_set_limit+0x198/0x210 net/sched/sch_fifo.c:227 tbf_change+0x6ec/0x16d0 net/sched/sch_tbf.c:418 qdisc_change net/sched/sch_api.c:1332 [inline] tc_modify_qdisc+0xd9a/0x1a60 net/sched/sch_api.c:1634 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 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 Fixes: fb0305ce1b03 ("net-sched: consolidate default fifo qdisc setup") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20210930212239.3430364-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 95c58291ee709424557996891926a05a32c5b13a Author: Arnd Bergmann Date: Mon Sep 27 13:36:23 2021 +0200 drm/msm/submit: fix overflow check on 64-bit architectures The overflow check does causes a warning from clang-14 when 'sz' is a type that is smaller than size_t: drivers/gpu/drm/msm/msm_gem_submit.c:217:10: error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (sz == SIZE_MAX) { Change the type accordingly. Fixes: 20224d715a88 ("drm/msm/submit: Move copy_from_user ahead of locking bos") Signed-off-by: Arnd Bergmann Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210927113632.3849987-1-arnd@kernel.org Signed-off-by: Rob Clark commit 53d5fc89d66a778577295020dc57bb3ccec84354 Merge: f5b667ded0756 172da89ed0eaf Author: Linus Torvalds Date: Fri Oct 1 14:45:23 2021 -0700 Merge tag 's390-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fix from Vasily Gorbik: "One fix for 5.15-rc4: Avoid CIO excessive path-verification requests, which might cause unwanted delays" * tag 's390-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/cio: avoid excessive path-verification requests commit b0e875bac0fab3e7a7431c2eee36a8ccc0c712ac Author: Andrii Nakryiko Date: Fri Oct 1 11:59:10 2021 -0700 libbpf: Fix memory leak in strset Free struct strset itself, not just its internal parts. Fixes: 90d76d3ececc ("libbpf: Extract internal set-of-strings datastructure APIs") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20211001185910.86492-1-andrii@kernel.org commit 68002469e571ae3db095e4ade1cfef64903f8fa1 Author: Rob Clark Date: Fri Oct 1 09:42:05 2021 -0700 drm/msm: One sched entity per process per priority Some userspace apps make assumptions that rendering against multiple contexts within the same process (from the same thread, with appropriate MakeCurrent() calls) provides sufficient synchronization without any external synchronization (ie. glFenceSync()/glWaitSync()). Since a submitqueue maps to a gl/vk context, having multiple sched entities of the same priority only works with implicit sync enabled. To fix this, limit things to a single sched entity per priority level per process. An alternative would be sharing submitqueues between contexts in userspace, but tracking of per-context faults (ie. GL_EXT_robustness) is already done at the submitqueue level, so this is not an option. Signed-off-by: Rob Clark commit 4cd82aa39bda20a9237b8f42676796d0a5ee9bfc Author: Rob Clark Date: Fri Oct 1 08:58:15 2021 -0700 drm/msm: A bit more docs + cleanup msm_file_private is more gpu related, and in the next commit it will need access to other GPU specific #defines. While we're at it, add some comments. Signed-off-by: Rob Clark commit 14eb0cb4e9a7323c8735cf6c681ed8423ce6ae06 Author: Rob Clark Date: Thu Sep 30 10:43:20 2021 -0700 drm/msm/a6xx: Track current ctx by seqno In theory a context can be destroyed and a new one allocated at the same address, making the pointer comparision to detect when we don't need to update the current pagetables invalid. Instead assign a sequence number to each context on creation, and use this for the check. Fixes: 84c31ee16f90 ("drm/msm/a6xx: Add support for per-instance pagetables") Signed-off-by: Rob Clark commit f6f59072e821901d96c791864a07d57d8ec8d312 Author: Rob Clark Date: Mon Sep 27 11:00:04 2021 -0700 drm/msm/a6xx: Serialize GMU communication I've seen some crashes in our crash reporting that *look* like multiple threads stomping on each other while communicating with GMU. So wrap all those paths in a lock. Signed-off-by: Rob Clark commit 654e9c18dfab02c8e5f9c5877c7a2f3264fa520a Author: Rob Clark Date: Sun Sep 26 11:56:58 2021 -0700 drm/msm: Fix crash on dev file close If the device file was opened prior to fw being available (such as from initrd before rootfs is mounted, when the initrd does not contain GPU fw), that would cause a later crash when the dev file is closed due to unitialized submitqueues list: CPU: 4 PID: 263 Comm: plymouthd Tainted: G W 5.15.0-rc2-next-20210924 #2 Hardware name: LENOVO 81JL/LNVNB161216, BIOS 9UCN33WW(V2.06) 06/ 4/2019 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : msm_submitqueue_close+0x30/0x190 [msm] lr : msm_postclose+0x54/0xf0 [msm] sp : ffff80001074bb80 x29: ffff80001074bb80 x28: ffff03ad80c4db80 x27: ffff03ad80dc5ab0 x26: 0000000000000000 x25: ffff03ad80dc5af8 x24: ffff03ad81e90800 x23: 0000000000000000 x22: ffff03ad81e90800 x21: ffff03ad8b35e788 x20: ffff03ad81e90878 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: ffffda15f14f7940 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000040 x11: 0000000000000000 x10: 0000000000000000 x9 : ffffda15cd18ff88 x8 : ffff03ad80c4db80 x7 : 0000000000000228 x6 : 0000000000000000 x5 : 1793a4e807e636bd x4 : ffff03ad80c4db80 x3 : ffff03ad81e90878 x2 : 0000000000000000 x1 : ffff03ad80c4db80 x0 : 0000000000000000 Call trace: msm_submitqueue_close+0x30/0x190 [msm] msm_postclose+0x54/0xf0 [msm] drm_file_free.part.0+0x1cc/0x2e0 [drm] drm_close_helper.isra.0+0x74/0x84 [drm] drm_release+0x78/0x120 [drm] __fput+0x78/0x23c ____fput+0x1c/0x30 task_work_run+0xcc/0x22c do_exit+0x304/0x9f4 do_group_exit+0x44/0xb0 __wake_up_parent+0x0/0x3c invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0x4c/0xf4 do_el0_svc+0x30/0x9c el0_svc+0x20/0x60 el0t_64_sync_handler+0xe8/0xf0 el0t_64_sync+0x1a0/0x1a4 Code: aa0003f5 a90153f3 f8408eb3 aa1303e0 (f85e8674) ---[ end trace 39b2fa37509a2be2 ]--- Fixing recursive fault but reboot is needed! Fixes: 86c2a0f000c1 drm/msm: ("Small submitqueue creation cleanup") Reported-by: Steev Klimaszewski Signed-off-by: Rob Clark commit f62314b1ced25c58b86e044fc951cd6a1ea234cf Author: Xiyu Yang Date: Thu Sep 9 15:24:36 2021 +0800 kunit: fix reference count leak in kfree_at_end The reference counting issue happens in the normal path of kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the function forgets to handle the returned resource object, whose refcount increased inside, causing a refcount leak. Fix this issue by calling kunit_alloc_resource() instead of kunit_alloc_and_get_resource(). Fixed the following when applying: Shuah Khan CHECK: Alignment should match open parenthesis + kunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL, (void *)to_free); Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit d8c23ead708b40a16413163f5f93e07fbd4f077d Author: Daniel Latypov Date: Wed Sep 22 09:39:21 2021 -0700 kunit: tool: better handling of quasi-bool args (--json, --raw_output) Problem: What does this do? $ kunit.py run --json Well, it runs all the tests and prints test results out as JSON. And next is $ kunit.py run my-test-suite --json This runs just `my-test-suite` and prints results out as JSON. But what about? $ kunit.py run --json my-test-suite This runs all the tests and stores the json results in a "my-test-suite" file. Why: --json, and now --raw_output are actually string flags. They just have a default value. --json in particular takes the name of an output file. It was intended that you'd do $ kunit.py run --json=my_output_file my-test-suite if you ever wanted to specify the value. Workaround: It doesn't seem like there's a way to make https://docs.python.org/3/library/argparse.html only accept arg values after a '='. I believe that `--json` should "just work" regardless of where it is. So this patch automatically rewrites a bare `--json` to `--json=stdout`. That makes the examples above work the same way. Add a regression test that can catch this for --raw_output. Fixes: 6a499c9c42d0 ("kunit: tool: make --raw_output support only showing kunit output") Signed-off-by: Daniel Latypov Tested-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 5fb14d20f8241461d351bef73e49871e4b2330ab Author: Eric Dumazet Date: Fri Oct 1 09:46:22 2021 -0700 net: add kerneldoc comment for sk_peer_lock Fixes following warning: include/net/sock.h:533: warning: Function parameter or member 'sk_peer_lock' not described in 'sock' Fixes: 35306eb23814 ("af_unix: fix races in sk_peer_pid and sk_peer_cred accesses") Signed-off-by: Eric Dumazet Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20211001164622.58520-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 3672bb820f3292b6f035469f863c020317a3dd28 Author: Dafna Hirschfeld Date: Fri Oct 1 17:21:53 2021 +0200 spi: mediatek: skip delays if they are 0 In the function 'mtk_spi_set_hw_cs_timing' the 'setup', 'hold' and 'inactive' delays are configured. In case those values are 0 it causes errors on mt8173: cros-ec-i2c-tunnel 1100a000.spi:ec@0:i2c-tunnel0: Error transferring EC i2c message -71 cros-ec-spi spi0.0: EC failed to respond in time. This patch fixes that issues by setting only the values that are not 0. Fixes: 04e6bb0d6bb1 ("spi: modify set_cs_timing parameter") Signed-off-by: Dafna Hirschfeld Link: https://lore.kernel.org/r/20211001152153.4604-1-dafna.hirschfeld@collabora.com Signed-off-by: Mark Brown commit 75e33c55ae8fb4a177fe07c284665e1d61b02560 Author: Ville Baillie Date: Tue Sep 21 07:21:32 2021 +0000 spi: atmel: Fix PDC transfer setup bug atmel_spi_dma_map_xfer to never be called in PDC mode. This causes the driver to silently fail. This patch changes the conditional to match the behaviour of the previous commit before the refactor. Fixes: 5fa5e6dec762 ("spi: atmel: Switch to transfer_one transfer method") Signed-off-by: Ville Baillie Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210921072132.21831-1-villeb@bytesnap.co.uk Signed-off-by: Mark Brown commit f5b667ded07569dd6e33885cffd35fd519cfc942 Author: Rafael J. Wysocki Date: Fri Oct 1 19:14:28 2021 +0200 thermal: Update information in MAINTAINERS Because Rui is now going to focus on work that is not related to the maintenance of the thermal subsystem in the kernel, Rafael will start to help Daniel with handling the development process as a new member of the thermal maintainers team. Rui will continue to review patches in that area. The thermal development process flow will change so that the material from the thermal git tree will be merged into the thermal branch of the linux-pm.git tree before going into the mainline. Update the information in MAINTAINERS accordingly. Signed-off-by: Rafael J. Wysocki Acked-by: Zhang Rui Acked-by: Daniel Lezcano Signed-off-by: Linus Torvalds commit b2626f1e3245ddd810b69df86514774d6cb655ee Merge: 24f67d82c43c9 7b0035eaa7dab Author: Linus Torvalds Date: Fri Oct 1 11:08:07 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull more kvm fixes from Paolo Bonzini: "Small x86 fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: selftests: Ensure all migrations are performed when test is affined KVM: x86: Swap order of CPUID entry "index" vs. "significant flag" checks ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm x86/kvmclock: Move this_cpu_pvti into kvmclock.h selftests: KVM: Don't clobber XMM register when read KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue commit 24f67d82c43c9c594821ee1bc4367a23d89d9f8b Merge: 89e503592385f 78ea81417944f Author: Linus Torvalds Date: Fri Oct 1 10:27:44 2021 -0700 Merge tag 'drm-fixes-2021-10-01' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Daniel Vetter: "Dave is out on a long w/e, should be back next week. Nothing nefarious, just a bunch of driver fixes: amdgpu, i915, tegra, and one exynos driver fix" * tag 'drm-fixes-2021-10-01' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix drm/amdgpu: check tiling flags when creating FB on GFX8- drm/amd/display: Pass PCI deviceid into DC drm/amd/display: initialize backlight_ramping_override to false drm/amdgpu: correct initial cp_hqd_quantum for gfx9 drm/amd/display: Fix Display Flicker on embedded panels drm/amdgpu: fix gart.bo pin_count leak drm/i915: Remove warning from the rps worker drm/i915/request: fix early tracepoints drm/i915/guc, docs: Fix pdfdocs build error by removing nested grid gpu: host1x: Plug potential memory leak gpu/host1x: fence: Make spinlock static drm/tegra: uapi: Fix wrong mapping end address in case of disabled IOMMU drm/tegra: dc: Remove unused variables drm/exynos: Make use of the helper function devm_platform_ioremap_resource() drm/i915/gvt: fix the usage of ww lock in gvt scheduler. commit 3f008385d46d3cea4a097d2615cd485f2184ba26 Author: Pavel Begunkov Date: Fri Oct 1 10:39:33 2021 +0100 io_uring: kill fasync We have never supported fasync properly, it would only fire when there is something polling io_uring making it useless. The original support came in through the initial io_uring merge for 5.1. Since it's broken and nobody has reported it, get rid of the fasync bits. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2f7ca3d344d406d34fa6713824198915c41cea86.1633080236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 89e503592385fbed872c7ea1fb89931ece3409a5 Merge: 4de593fb965fc f0b636804c7c4 Author: Linus Torvalds Date: Fri Oct 1 10:14:29 2021 -0700 Merge tag 'iommu-fixes-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Two fixes for the new Apple DART driver to fix a kernel panic and a stale data usage issue - Intel VT-d fix for how PCI device ids are printed * tag 'iommu-fixes-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/dart: Clear sid2group entry when a group is freed iommu/vt-d: Drop "0x" prefix from PCI bus & device addresses iommu/dart: Remove iommu_flush_ops commit 78ea81417944fe03f48648eddeb8e8a8e513c4ad Merge: 3ff43f9df8b0e 17ac76e050c51 Author: Daniel Vetter Date: Fri Oct 1 18:14:38 2021 +0200 Merge tag 'exynos-drm-fixes-for-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes One cleanup - Use devm_platform_ioremap_resource() helper function instead of old one. Signed-off-by: Daniel Vetter From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20210928074158.2942-1-inki.dae@samsung.com commit 2ba5acfb34957e8a7fe47cd78c77ca88e9cc2b03 Author: J. Bruce Fields Date: Fri Oct 1 09:59:21 2021 -0400 SUNRPC: fix sign error causing rpcsec_gss drops If sd_max is unsigned, then sd_max - GSS_SEQ_WIN is a very large number whenever sd_max is less than GSS_SEQ_WIN, and the comparison: seq_num <= sd->sd_max - GSS_SEQ_WIN in gss_check_seq_num is pretty much always true, even when that's clearly not what was intended. This was causing pynfs to hang when using krb5, because pynfs uses zero as the initial gss sequence number. That's perfectly legal, but this logic error causes knfsd to drop the rpc in that case. Out-of-order sequence IDs in the first GSS_SEQ_WIN (128) calls will also cause this. Fixes: 10b9d99a3dbb ("SUNRPC: Augment server-side rpcgss tracepoints") Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 19598141f40dff728dd50799e510805261f48850 Author: Trond Myklebust Date: Thu Sep 30 15:44:42 2021 -0400 nfsd: Fix a warning for nfsd_file_close_inode Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever commit 3ff43f9df8b0ea779d2413c5244b72cfea12824d Merge: abb7700d4631f 26db706a6d77b Author: Daniel Vetter Date: Fri Oct 1 16:59:21 2021 +0200 Merge tag 'amd-drm-fixes-5.15-2021-09-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-09-29: amdgpu: - gart pin count fix - eDP flicker fix - GFX9 MQD fix - Display fixes - Tiling flags fix for pre-GFX9 - SDMA resume fix for S0ix Signed-off-by: Daniel Vetter From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210930023013.5207-1-alexander.deucher@amd.com commit abb7700d4631f4e050df1d578ca88d984012a3a0 Merge: 05812b971c6d6 4b8bcaf8a6d6a Author: Daniel Vetter Date: Fri Oct 1 16:47:18 2021 +0200 Merge tag 'drm-intel-fixes-2021-09-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15-rc4: - Fix GVT scheduler ww lock usage - Fix pdfdocs documentation build - Fix request early tracepoints - Fix an invalid warning from rps worker Signed-off-by: Daniel Vetter From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87lf3ev44z.fsf@intel.com commit 78764f450bd9649e03b7a3012ab52075c0b60a5e Merge: 5abab4982d5b3 3bf1742f3c695 Author: David S. Miller Date: Fri Oct 1 14:16:52 2021 +0100 Merge tag 'mlx5-fixes-2021-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-fixes-2021-09-30 commit 5abab4982d5b3bfe33d318b621951a13bbe6ae77 Merge: ca6e11c337daf 603a1621caa09 Author: David S. Miller Date: Fri Oct 1 14:16:29 2021 +0100 Merge tag 'wireless-drivers-2021-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers wireless-drivers fixes for v5.15 Second set of fixes for v5.15, nothing major this time. Most important here are reverting a brcmfmac regression and a fix for an old rare ath5k build error. iwlwifi * fixes to NULL dereference, off by one and missing unlock * add support for Killer AX1650 on Dell XPS 15 (9510) laptop ath5k * build fix with LEDS=m brcmfmac * revert a regression causing BCM4359/9 devices stop working as access point mwifiex * fix clang warning about null pointer arithmetic commit 83d40a61046f73103b4e5d8f1310261487ff63b0 Author: Peter Zijlstra Date: Mon Sep 20 15:31:11 2021 +0200 sched: Always inline is_percpu_thread() vmlinux.o: warning: objtool: check_preemption_disabled()+0x81: call to is_percpu_thread() leaves .noinstr.text section Reported-by: Stephen Rothwell Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210928084218.063371959@infradead.org commit 703066188f63d66cc6b9d678e5b5ef1213c5938e Author: Mel Gorman Date: Mon Sep 27 12:46:35 2021 +0100 sched/fair: Null terminate buffer when updating tunable_scaling This patch null-terminates the temporary buffer in sched_scaling_write() so kstrtouint() does not return failure and checks the value is valid. Before: $ cat /sys/kernel/debug/sched/tunable_scaling 1 $ echo 0 > /sys/kernel/debug/sched/tunable_scaling -bash: echo: write error: Invalid argument $ cat /sys/kernel/debug/sched/tunable_scaling 1 After: $ cat /sys/kernel/debug/sched/tunable_scaling 1 $ echo 0 > /sys/kernel/debug/sched/tunable_scaling $ cat /sys/kernel/debug/sched/tunable_scaling 0 $ echo 3 > /sys/kernel/debug/sched/tunable_scaling -bash: echo: write error: Invalid argument Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs") Signed-off-by: Mel Gorman Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Link: https://lore.kernel.org/r/20210927114635.GH3959@techsingularity.net commit 2630cde26711dab0d0b56a8be1616475be646d13 Author: Michal Koutný Date: Fri Sep 17 17:30:37 2021 +0200 sched/fair: Add ancestors of unthrottled undecayed cfs_rq Since commit a7b359fc6a37 ("sched/fair: Correctly insert cfs_rq's to list on unthrottle") we add cfs_rqs with no runnable tasks but not fully decayed into the load (leaf) list. We may ignore adding some ancestors and therefore breaking tmp_alone_branch invariant. This broke LTP test cfs_bandwidth01 and it was partially fixed in commit fdaba61ef8a2 ("sched/fair: Ensure that the CFS parent is added after unthrottling"). I noticed the named test still fails even with the fix (but with low probability, 1 in ~1000 executions of the test). The reason is when bailing out of unthrottle_cfs_rq early, we may miss adding ancestors of the unthrottled cfs_rq, thus, not joining tmp_alone_branch properly. Fix this by adding ancestors if we notice the unthrottled cfs_rq was added to the load list. Fixes: a7b359fc6a37 ("sched/fair: Correctly insert cfs_rq's to list on unthrottle") Signed-off-by: Michal Koutný Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Reviewed-by: Odin Ugedal Link: https://lore.kernel.org/r/20210917153037.11176-1-mkoutny@suse.com commit f792565326825ed806626da50c6f9a928f1079c1 Author: Song Liu Date: Wed Sep 29 12:43:13 2021 -0700 perf/core: fix userpage->time_enabled of inactive events Users of rdpmc rely on the mmapped user page to calculate accurate time_enabled. Currently, userpage->time_enabled is only updated when the event is added to the pmu. As a result, inactive event (due to counter multiplexing) does not have accurate userpage->time_enabled. This can be reproduced with something like: /* open 20 task perf_event "cycles", to create multiplexing */ fd = perf_event_open(); /* open task perf_event "cycles" */ userpage = mmap(fd); /* use mmap and rdmpc */ while (true) { time_enabled_mmap = xxx; /* use logic in perf_event_mmap_page */ time_enabled_read = read(fd).time_enabled; if (time_enabled_mmap > time_enabled_read) BUG(); } Fix this by updating userpage for inactive events in merge_sched_in. Suggested-by: Peter Zijlstra (Intel) Reported-and-tested-by: Lucian Grijincu Signed-off-by: Song Liu Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210929194313.2398474-1-songliubraving@fb.com commit ecc2123e09f9e71ddc6c53d71e283b8ada685fe2 Author: Kan Liang Date: Tue Sep 28 08:19:03 2021 -0700 perf/x86/intel: Update event constraints for ICX According to the latest event list, the event encoding 0xEF is only available on the first 4 counters. Add it into the event constraints table. Fixes: 6017608936c1 ("perf/x86/intel: Add Icelake support") Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1632842343-25862-1-git-send-email-kan.liang@linux.intel.com commit 02d029a41dc986e2d5a77ecca45803857b346829 Author: Anand K Mistry Date: Wed Sep 29 17:04:21 2021 +1000 perf/x86: Reset destroy callback on event init failure perf_init_event tries multiple init callbacks and does not reset the event state between tries. When x86_pmu_event_init runs, it unconditionally sets the destroy callback to hw_perf_event_destroy. On the next init attempt after x86_pmu_event_init, in perf_try_init_event, if the pmu's capabilities includes PERF_PMU_CAP_NO_EXCLUDE, the destroy callback will be run. However, if the next init didn't set the destroy callback, hw_perf_event_destroy will be run (since the callback wasn't reset). Looking at other pmu init functions, the common pattern is to only set the destroy callback on a successful init. Resetting the callback on failure tries to replicate that pattern. This was discovered after commit f11dd0d80555 ("perf/x86/amd/ibs: Extend PERF_PMU_CAP_NO_EXCLUDE to IBS Op") when the second (and only second) run of the perf tool after a reboot results in 0 samples being generated. The extra run of hw_perf_event_destroy results in active_events having an extra decrement on each perf run. The second run has active_events == 0 and every subsequent run has active_events < 0. When active_events == 0, the NMI handler will early-out and not record any samples. Signed-off-by: Anand K Mistry Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210929170405.1.I078b98ee7727f9ae9d6df8262bad7e325e40faf0@changeid commit 24ff652573754fe4c03213ebd26b17e86842feb3 Author: Peter Zijlstra Date: Thu Sep 30 12:43:10 2021 +0200 objtool: Teach get_alt_entry() about more relocation types Occasionally objtool encounters symbol (as opposed to section) relocations in .altinstructions. Typically they are the alternatives written by elf_add_alternative() as encountered on a noinstr validation run on vmlinux after having already ran objtool on the individual .o files. Basically this is the counterpart of commit 44f6a7c0755d ("objtool: Fix seg fault with Clang non-section symbols"), because when these new assemblers (binutils now also does this) strip the section symbols, elf_add_reloc_to_insn() is forced to emit symbol based relocations. As such, teach get_alt_entry() about different relocation types. Fixes: 9bc0bb50727c ("objtool/x86: Rewrite retpoline thunk calls") Reported-by: Stephen Rothwell Reported-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/YVWUvknIEVNkPvnP@hirez.programming.kicks-ass.net commit 6e3cd95234dc1eda488f4f487c281bac8fef4d9b Author: Thomas Gleixner Date: Thu Sep 30 19:21:39 2021 +0200 x86/hpet: Use another crystalball to evaluate HPET usability On recent Intel systems the HPET stops working when the system reaches PC10 idle state. The approach of adding PCI ids to the early quirks to disable HPET on these systems is a whack a mole game which makes no sense. Check for PC10 instead and force disable HPET if supported. The check is overbroad as it does not take ACPI, intel_idle enablement and command line parameters into account. That's fine as long as there is at least PMTIMER available to calibrate the TSC frequency. The decision can be overruled by adding "hpet=force" on the kernel command line. Remove the related early PCI quirks for affected Ice Cake and Coffin Lake systems as they are not longer required. That should also cover all other systems, i.e. Tiger Rag and newer generations, which are most likely affected by this as well. Fixes: Yet another hardware trainwreck Reported-by: Jakub Kicinski Signed-off-by: Thomas Gleixner Tested-by: Jakub Kicinski Reviewed-by: Rafael J. Wysocki Cc: stable@vger.kernel.org Cc: Kai-Heng Feng Cc: Bjorn Helgaas commit 06f2ac3d4219bbbfd93d79e01966a42053084f11 Author: Tom Lendacky Date: Thu Sep 30 23:42:01 2021 -0500 x86/sev: Return an error on a returned non-zero SW_EXITINFO1[31:0] After returning from a VMGEXIT NAE event, SW_EXITINFO1[31:0] is checked for a value of 1, which indicates an error and that SW_EXITINFO2 contains exception information. However, future versions of the GHCB specification may define new values for SW_EXITINFO1[31:0], so really any non-zero value should be treated as an error. Fixes: 597cfe48212a ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler") Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Cc: # 5.10+ Link: https://lkml.kernel.org/r/efc772af831e9e7f517f0439b13b41f56bad8784.1633063321.git.thomas.lendacky@amd.com commit a2083eeb119fb9307258baea9b7c243ca9a2e0b6 Author: Johannes Berg Date: Thu Sep 30 13:11:21 2021 +0200 cfg80211: scan: fix RCU in cfg80211_add_nontrans_list() The SSID pointer is pointing to RCU protected data, so we need to have it under rcu_read_lock() for the entire use. Fix this. Cc: stable@vger.kernel.org Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Link: https://lore.kernel.org/r/20210930131120.6ddfc603aa1d.I2137344c4e2426525b1a8e4ce5fca82f8ecbfe7e@changeid Signed-off-by: Johannes Berg commit 636707e593120c9fa35f6a908c0d052f6154910d Author: Johannes Berg Date: Thu Sep 30 13:11:20 2021 +0200 mac80211: mesh: fix HE operation element length check The length check here was bad, if the length doesn't at least include the length of the fixed part, we cannot call ieee80211_he_oper_size() to determine the total. Fix this, and convert to cfg80211_find_ext_elem() while at it. Cc: stable@vger.kernel.org Fixes: 70debba3ab7d ("mac80211: save HE oper info in BSS config for mesh") Link: https://lore.kernel.org/r/20210930131120.b0f940976c56.I954e1be55e9f87cc303165bff5c906afe1e54648@changeid Signed-off-by: Johannes Berg commit 2b987fe84429361c7f189568c476d1bd00d2ff7e Author: Chris Chiu Date: Fri Oct 1 14:28:56 2021 +0800 ALSA: hda - Enable headphone mic on Dell Latitude laptops with ALC3254 The headphone mic is not working on Dell Latitude laptops with ALC3254. The codec vendor id is 0x10ec0295 and share the same pincfg as defined in ALC295_STANDARD_PINS. So the ALC269_FIXUP_DELL1_MIC_NO_PRESENCE will be applied per alc269_pin_fixup_tbl[] but actually the headphone mic is using NID 0x1b instead of 0x1a. The ALC269_FIXUP_DELL4_MIC_NO_PRESENCE need to be applied instead. Use ALC269_FIXUP_DELL4_MIC_NO_PRESENCE for particular models before a generic fixup comes out. Signed-off-by: Chris Chiu Cc: Link: https://lore.kernel.org/r/20211001062856.1037901-1-chris.chiu@canonical.com Signed-off-by: Takashi Iwai commit f2c77973507fd116c3657df1dc048864a2b16a1c Author: Zhang Yi Date: Fri Sep 10 16:03:16 2021 +0800 ext4: recheck buffer uptodate bit under buffer lock Commit 8e33fadf945a ("ext4: remove an unnecessary if statement in __ext4_get_inode_loc()") forget to recheck buffer's uptodate bit again under buffer lock, which may overwrite the buffer if someone else have already brought it uptodate and changed it. Fixes: 8e33fadf945a ("ext4: remove an unnecessary if statement in __ext4_get_inode_loc()") Cc: stable@kernel.org Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210910080316.70421-1-yi.zhang@huawei.com commit 42cb447410d024e9d54139ae9c21ea132a8c384c Author: yangerkun Date: Tue Sep 14 19:14:15 2021 +0800 ext4: fix potential infinite loop in ext4_dx_readdir() When ext4_htree_fill_tree() fails, ext4_dx_readdir() can run into an infinite loop since if info->last_pos != ctx->pos this will reset the directory scan and reread the failing entry. For example: 1. a dx_dir which has 3 block, block 0 as dx_root block, block 1/2 as leaf block which own the ext4_dir_entry_2 2. block 1 read ok and call_filldir which will fill the dirent and update the ctx->pos 3. block 2 read fail, but we has already fill some dirent, so we will return back to userspace will a positive return val(see ksys_getdents64) 4. the second ext4_dx_readdir will reset the world since info->last_pos != ctx->pos, and will also init the curr_hash which pos to block 1 5. So we will read block1 too, and once block2 still read fail, we can only fill one dirent because the hash of the entry in block1(besides the last one) won't greater than curr_hash 6. this time, we forget update last_pos too since the read for block2 will fail, and since we has got the one entry, ksys_getdents64 can return success 7. Latter we will trapped in a loop with step 4~6 Cc: stable@kernel.org Signed-off-by: yangerkun Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210914111415.3921954-1-yangerkun@huawei.com commit bb9464e08309f6befe80866f5be51778ca355ee9 Author: yangerkun Date: Fri Sep 24 17:39:17 2021 +0800 ext4: flush s_error_work before journal destroy in ext4_fill_super The error path in ext4_fill_super forget to flush s_error_work before journal destroy, and it may trigger the follow bug since flush_stashed_error_work can run concurrently with journal destroy without any protection for sbi->s_journal. [32031.740193] EXT4-fs (loop66): get root inode failed [32031.740484] EXT4-fs (loop66): mount failed [32031.759805] ------------[ cut here ]------------ [32031.759807] kernel BUG at fs/jbd2/transaction.c:373! [32031.760075] invalid opcode: 0000 [#1] SMP PTI [32031.760336] CPU: 5 PID: 1029268 Comm: kworker/5:1 Kdump: loaded 4.18.0 [32031.765112] Call Trace: [32031.765375] ? __switch_to_asm+0x35/0x70 [32031.765635] ? __switch_to_asm+0x41/0x70 [32031.765893] ? __switch_to_asm+0x35/0x70 [32031.766148] ? __switch_to_asm+0x41/0x70 [32031.766405] ? _cond_resched+0x15/0x40 [32031.766665] jbd2__journal_start+0xf1/0x1f0 [jbd2] [32031.766934] jbd2_journal_start+0x19/0x20 [jbd2] [32031.767218] flush_stashed_error_work+0x30/0x90 [ext4] [32031.767487] process_one_work+0x195/0x390 [32031.767747] worker_thread+0x30/0x390 [32031.768007] ? process_one_work+0x390/0x390 [32031.768265] kthread+0x10d/0x130 [32031.768521] ? kthread_flush_work_fn+0x10/0x10 [32031.768778] ret_from_fork+0x35/0x40 static int start_this_handle(...) BUG_ON(journal->j_flags & JBD2_UNMOUNT); <---- Trigger this Besides, after we enable fast commit, ext4_fc_replay can add work to s_error_work but return success, so the latter journal destroy in ext4_load_journal can trigger this problem too. Fix this problem with two steps: 1. Call ext4_commit_super directly in ext4_handle_error for the case that called from ext4_fc_replay 2. Since it's hard to pair the init and flush for s_error_work, we'd better add a extras flush_work before journal destroy in ext4_fill_super Besides, this patch will call ext4_commit_super in ext4_handle_error for any nojournal case too. But it seems safe since the reason we call schedule_work was that we should save error info to sb through journal if available. Conversely, for the nojournal case, it seems useless delay commit superblock to s_error_work. Fixes: c92dc856848f ("ext4: defer saving error info from atomic context") Fixes: 2d01ddc86606 ("ext4: save error info to sb through journal if available") Cc: stable@kernel.org Signed-off-by: yangerkun Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210924093917.1953239-1-yangerkun@huawei.com commit 75ca6ad408f459f00b09a64f04c774559848c097 Author: Ritesh Harjani Date: Sat Jun 5 10:39:32 2021 +0530 ext4: fix loff_t overflow in ext4_max_bitmap_size() We should use unsigned long long rather than loff_t to avoid overflow in ext4_max_bitmap_size() for comparison before returning. w/o this patch sbi->s_bitmap_maxbytes was becoming a negative value due to overflow of upper_limit (with has_huge_files as true) Below is a quick test to trigger it on a 64KB pagesize system. sudo mkfs.ext4 -b 65536 -O ^has_extents,^64bit /dev/loop2 sudo mount /dev/loop2 /mnt sudo echo "hello" > /mnt/hello -> This will error out with "echo: write error: File too large" Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Link: https://lore.kernel.org/r/594f409e2c543e90fd836b78188dfa5c575065ba.1622867594.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 6fed83957f21eff11c8496e9f24253b03d2bc1dc Author: Jeffle Xu Date: Mon Aug 23 14:13:58 2021 +0800 ext4: fix reserved space counter leakage When ext4_insert_delayed block receives and recovers from an error from ext4_es_insert_delayed_block(), e.g., ENOMEM, it does not release the space it has reserved for that block insertion as it should. One effect of this bug is that s_dirtyclusters_counter is not decremented and remains incorrectly elevated until the file system has been unmounted. This can result in premature ENOSPC returns and apparent loss of free space. Another effect of this bug is that /sys/fs/ext4//delayed_allocation_blocks can remain non-zero even after syncfs has been executed on the filesystem. Besides, add check for s_dirtyclusters_counter when inode is going to be evicted and freed. s_dirtyclusters_counter can still keep non-zero until inode is written back in .evict_inode(), and thus the check is delayed to .destroy_inode(). Fixes: 51865fda28e5 ("ext4: let ext4 maintain extent status tree") Cc: stable@kernel.org Suggested-by: Gao Xiang Signed-off-by: Jeffle Xu Reviewed-by: Eric Whitney Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210823061358.84473-1-jefflexu@linux.alibaba.com commit a2c2f0826e2b75560b31daf1cd9a755ab93cf4c6 Author: Hou Tao Date: Fri Aug 20 12:45:05 2021 +0800 ext4: limit the number of blocks in one ADD_RANGE TLV Now EXT4_FC_TAG_ADD_RANGE uses ext4_extent to track the newly-added blocks, but the limit on the max value of ee_len field is ignored, and it can lead to BUG_ON as shown below when running command "fallocate -l 128M file" on a fast_commit-enabled fs: kernel BUG at fs/ext4/ext4_extents.h:199! invalid opcode: 0000 [#1] SMP PTI CPU: 3 PID: 624 Comm: fallocate Not tainted 5.14.0-rc6+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:ext4_fc_write_inode_data+0x1f3/0x200 Call Trace: ? ext4_fc_write_inode+0xf2/0x150 ext4_fc_commit+0x93b/0xa00 ? ext4_fallocate+0x1ad/0x10d0 ext4_sync_file+0x157/0x340 ? ext4_sync_file+0x157/0x340 vfs_fsync_range+0x49/0x80 do_fsync+0x3d/0x70 __x64_sys_fsync+0x14/0x20 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Simply fixing it by limiting the number of blocks in one EXT4_FC_TAG_ADD_RANGE TLV. Fixes: aa75f4d3daae ("ext4: main fast-commit commit path") Cc: stable@kernel.org Signed-off-by: Hou Tao Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210820044505.474318-1-houtao1@huawei.com commit 8001f21fcd03253ba0eeac6f91f79239ac03ee60 Author: Moritz Fischer Date: Mon Sep 27 21:27:24 2021 -0700 MAINTAINERS: Add Hao and Yilun as maintainers Hao and Yilun have agreed to help out with maintenance. Both have been active in the Linux FPGA community for a long time and we need backups for vacation and load-balancing. Cc: Xu Yilun Cc: Wu Hao Cc: Greg Kroah-Hartman Acked-by: Xu Yilun Acked-by: Wu Hao Signed-off-by: Moritz Fischer commit 87ffb310d5e8a441721a9d04dfa7c90cd9da3916 Author: Dan Carpenter Date: Thu Sep 30 15:24:56 2021 +0300 ksmbd: missing check for NULL in convert_to_nt_pathname() The kmalloc() does not have a NULL check. This code can be re-written slightly cleaner to just use the kstrdup(). Fixes: 265fd1991c1d ("ksmbd: use LOOKUP_BENEATH to prevent the out of share access") Signed-off-by: Dan Carpenter Acked-by: Namjae Jeon Acked-by: Hyunchul Lee Signed-off-by: Steve French commit ca6e11c337daf7925ff8a2aac8e84490a8691905 Author: Pavel Skripkin Date: Thu Sep 30 20:50:28 2021 +0300 phy: mdio: fix memory leak Syzbot reported memory leak in MDIO bus interface, the problem was in wrong state logic. MDIOBUS_ALLOCATED indicates 2 states: 1. Bus is only allocated 2. Bus allocated and __mdiobus_register() fails, but device_register() was called In case of device_register() has been called we should call put_device() to correctly free the memory allocated for this device, but mdiobus_free() calls just kfree(dev) in case of MDIOBUS_ALLOCATED state To avoid this behaviour we need to set bus->state to MDIOBUS_UNREGISTERED _before_ calling device_register(), because put_device() should be called even in case of device_register() failure. Link: https://lore.kernel.org/netdev/YVMRWNDZDUOvQjHL@shell.armlinux.org.uk/ Fixes: 46abc02175b3 ("phylib: give mdio buses a device tree presence") Reported-and-tested-by: syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com Reviewed-by: Dan Carpenter Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/eceae1429fbf8fa5c73dd2a0d39d525aa905074d.1633024062.git.paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit 10eff1f5788b6ffac212c254e2f3666219576889 Author: Pavel Skripkin Date: Thu Sep 30 20:49:42 2021 +0300 Revert "net: mdiobus: Fix memory leak in __mdiobus_register" This reverts commit ab609f25d19858513919369ff3d9a63c02cd9e2e. This patch is correct in the sense that we _should_ call device_put() in case of device_register() failure, but the problem in this code is more vast. We need to set bus->state to UNMDIOBUS_REGISTERED before calling device_register() to correctly release the device in mdiobus_free(). This patch prevents us from doing it, since in case of device_register() failure put_device() will be called 2 times and it will cause UAF or something else. Also, Reported-by: tag in revered commit was wrong, since syzbot reported different leak in same function. Link: https://lore.kernel.org/netdev/20210928092657.GI2048@kadam/ Acked-by: Yanfei Xu Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/f12fb1faa4eccf0f355788225335eb4309ff2599.1633024062.git.paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit 4de593fb965fc2bd11a0b767e0c65ff43540a6e4 Merge: 115f6134a050b 35306eb238144 Author: Linus Torvalds Date: Thu Sep 30 14:28:05 2021 -0700 Merge tag 'net-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Networking fixes, including fixes from mac80211, netfilter and bpf. Current release - regressions: - bpf, cgroup: assign cgroup in cgroup_sk_alloc when called from interrupt - mdio: revert mechanical patches which broke handling of optional resources - dev_addr_list: prevent address duplication Previous releases - regressions: - sctp: break out if skb_header_pointer returns NULL in sctp_rcv_ootb (NULL deref) - Revert "mac80211: do not use low data rates for data frames with no ack flag", fixing broadcast transmissions - mac80211: fix use-after-free in CCMP/GCMP RX - netfilter: include zone id in tuple hash again, minimize collisions - netfilter: nf_tables: unlink table before deleting it (race -> UAF) - netfilter: log: work around missing softdep backend module - mptcp: don't return sockets in foreign netns - sched: flower: protect fl_walk() with rcu (race -> UAF) - ixgbe: fix NULL pointer dereference in ixgbe_xdp_setup - smsc95xx: fix stalled rx after link change - enetc: fix the incorrect clearing of IF_MODE bits - ipv4: fix rtnexthop len when RTA_FLOW is present - dsa: mv88e6xxx: 6161: use correct MAX MTU config method for this SKU - e100: fix length calculation & buffer overrun in ethtool::get_regs Previous releases - always broken: - mac80211: fix using stale frag_tail skb pointer in A-MSDU tx - mac80211: drop frames from invalid MAC address in ad-hoc mode - af_unix: fix races in sk_peer_pid and sk_peer_cred accesses (race -> UAF) - bpf, x86: Fix bpf mapping of atomic fetch implementation - bpf: handle return value of BPF_PROG_TYPE_STRUCT_OPS prog - netfilter: ip6_tables: zero-initialize fragment offset - mhi: fix error path in mhi_net_newlink - af_unix: return errno instead of NULL in unix_create1() when over the fs.file-max limit Misc: - bpf: exempt CAP_BPF from checks against bpf_jit_limit - netfilter: conntrack: make max chain length random, prevent guessing buckets by attackers - netfilter: nf_nat_masquerade: make async masq_inet6_event handling generic, defer conntrack walk to work queue (prevent hogging RTNL lock)" * tag 'net-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (77 commits) af_unix: fix races in sk_peer_pid and sk_peer_cred accesses net: stmmac: fix EEE init issue when paired with EEE capable PHYs net: dev_addr_list: handle first address in __hw_addr_add_ex net: sched: flower: protect fl_walk() with rcu net: introduce and use lock_sock_fast_nested() net: phy: bcm7xxx: Fixed indirect MMD operations net: hns3: disable firmware compatible features when uninstall PF net: hns3: fix always enable rx vlan filter problem after selftest net: hns3: PF enable promisc for VF when mac table is overflow net: hns3: fix show wrong state when add existing uc mac address net: hns3: fix mixed flag HCLGE_FLAG_MQPRIO_ENABLE and HCLGE_FLAG_DCB_ENABLE net: hns3: don't rollback when destroy mqprio fail net: hns3: remove tc enable checking net: hns3: do not allow call hns3_nic_net_open repeatedly ixgbe: Fix NULL pointer dereference in ixgbe_xdp_setup net: bridge: mcast: Associate the seqcount with its protecting lock. net: mdio-ipq4019: Fix the error for an optional regs resource net: hns3: fix hclge_dbg_dump_tm_pg() stack usage net: mdio: mscc-miim: Fix the mdio controller af_unix: Return errno instead of NULL in unix_create1(). ... commit 4729445b47efebf089da4ccbcd1b116ffa2ad4af Author: Kumar Kartikeya Dwivedi Date: Thu Sep 30 11:46:34 2021 +0530 libbpf: Fix segfault in light skeleton for objects without BTF When fed an empty BPF object, bpftool gen skeleton -L crashes at btf__set_fd() since it assumes presence of obj->btf, however for the sequence below clang adds no .BTF section (hence no BTF). Reproducer: $ touch a.bpf.c $ clang -O2 -g -target bpf -c a.bpf.c $ bpftool gen skeleton -L a.bpf.o /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ /* THIS FILE IS AUTOGENERATED! */ struct a_bpf { struct bpf_loader_ctx ctx; Segmentation fault (core dumped) The same occurs for files compiled without BTF info, i.e. without clang's -g flag. Fixes: 67234743736a (libbpf: Generate loader program out of BPF ELF file.) Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210930061634.1840768-1-memxor@gmail.com commit 3bf1742f3c69501dec300b55917b9352428cb4dd Author: Aya Levin Date: Mon Sep 13 16:49:47 2021 +0300 net/mlx5e: Mutually exclude setting of TX-port-TS and MQPRIO in channel mode TX-port-TS hijacks the PTP traffic to a specific HW TX-queue. This conflicts with MQPRIO in channel mode, which specifies explicitly which TC accepts the packet. This patch mutually excludes the above configuration. Fixes: ec60c4581bd9 ("net/mlx5e: Support MQPRIO channel mode") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit dd1979cf3c710398a9eeba4853b908fe16426814 Author: Lama Kayal Date: Sun Aug 29 11:26:03 2021 +0300 net/mlx5e: Fix the presented RQ index in PTP stats PTP-RQ counters title format contains PTP-RQ identifier, which is mistakenly not passed to sprinft(). This leads to unexpected garbage values instead. This patch fixes it. Before applying the patch: ethtool -S eth3 | grep ptp_rq ptp_rq15_packets: 0 ptp_rq8_bytes: 0 ptp_rq6_csum_complete: 0 ptp_rq14_csum_complete_tail: 0 ptp_rq3_csum_complete_tail_slow : 0 ptp_rq9_csum_unnecessary: 0 ptp_rq1_csum_unnecessary_inner: 0 ptp_rq7_csum_none: 0 ptp_rq10_xdp_drop: 0 ptp_rq9_xdp_redirect: 0 ptp_rq13_lro_packets: 0 ptp_rq12_lro_bytes: 0 ptp_rq10_ecn_mark: 0 ptp_rq9_removed_vlan_packets: 0 ptp_rq5_wqe_err: 0 ptp_rq8_mpwqe_filler_cqes: 0 ptp_rq2_mpwqe_filler_strides: 0 ptp_rq5_oversize_pkts_sw_drop: 0 ptp_rq6_buff_alloc_err: 0 ptp_rq15_cqe_compress_blks: 0 ptp_rq2_cqe_compress_pkts: 0 ptp_rq2_cache_reuse: 0 ptp_rq12_cache_full: 0 ptp_rq11_cache_empty: 256 ptp_rq12_cache_busy: 0 ptp_rq11_cache_waive: 0 ptp_rq12_congst_umr: 0 ptp_rq11_arfs_err: 0 ptp_rq9_recover: 0 After applying the patch: ethtool -S eth3 | grep ptp_rq ptp_rq0_packets: 0 ptp_rq0_bytes: 0 ptp_rq0_csum_complete: 0 ptp_rq0_csum_complete_tail: 0 ptp_rq0_csum_complete_tail_slow : 0 ptp_rq0_csum_unnecessary: 0 ptp_rq0_csum_unnecessary_inner: 0 ptp_rq0_csum_none: 0 ptp_rq0_xdp_drop: 0 ptp_rq0_xdp_redirect: 0 ptp_rq0_lro_packets: 0 ptp_rq0_lro_bytes: 0 ptp_rq0_ecn_mark: 0 ptp_rq0_removed_vlan_packets: 0 ptp_rq0_wqe_err: 0 ptp_rq0_mpwqe_filler_cqes: 0 ptp_rq0_mpwqe_filler_strides: 0 ptp_rq0_oversize_pkts_sw_drop: 0 ptp_rq0_buff_alloc_err: 0 ptp_rq0_cqe_compress_blks: 0 ptp_rq0_cqe_compress_pkts: 0 ptp_rq0_cache_reuse: 0 ptp_rq0_cache_full: 0 ptp_rq0_cache_empty: 256 ptp_rq0_cache_busy: 0 ptp_rq0_cache_waive: 0 ptp_rq0_congst_umr: 0 ptp_rq0_arfs_err: 0 ptp_rq0_recover: 0 Fixes: a28359e922c6 ("net/mlx5e: Add PTP-RX statistics") Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit f88c4876347400a577598e06f1b230a7b19ee0e9 Author: Shay Drory Date: Tue Sep 14 10:13:02 2021 +0300 net/mlx5: Fix setting number of EQs of SFs When setting number of completion EQs of the SF, consider number of online CPUs. Without this consideration, when number of online cpus are less than 8, unnecessary 8 completion EQs are allocated. Fixes: c36326d38d93 ("net/mlx5: Round-Robin EQs over IRQs") Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit ac8b7d50ae4c3f5325c599f3d6e939ecef6a585a Author: Shay Drory Date: Thu Aug 19 16:01:28 2021 +0300 net/mlx5: Fix length of irq_index in chars The maximum irq_index can be 2047, This means irq_name should have 4 characters reserve for the irq_index. Hence, increase it to 4. Fixes: 3af26495a247 ("net/mlx5: Enlarge interrupt field in CREATE_EQ") Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 99b9a678b2e474756770900595cb09c94498bfca Author: Aya Levin Date: Thu Sep 23 15:30:01 2021 +0300 net/mlx5: Avoid generating event after PPS out in Real time mode When in Real-time mode, HW clock is synced with the PTP daemon. Hence driver should not re-calibrate the next pulse (via MTPPSE repetitive events mechanism). This patch arms repetitive events only in free-running mode. Fixes: 432119de33d9 ("net/mlx5: Add cyc2time HW translation mode support") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 64728294703e77827cc31a1b164ca867400067f5 Author: Aya Levin Date: Thu Sep 23 16:56:09 2021 +0300 net/mlx5: Force round second at 1PPS out start time Allow configuration of 1PPS start time only with time-stamp representing a round second. Prior to this patch driver allowed setting of a non-round-second which is not supported by the device. Avoid unexpected behavior by restricting start-time configuration to a round-second. Fixes: 4272f9b88db9 ("net/mlx5e: Change 1PPS out scheme") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit a586775f83bd729ad60b56352dbe067f4bb0beee Author: Moshe Shemesh Date: Thu Sep 23 17:57:47 2021 +0300 net/mlx5: E-Switch, Fix double allocation of acl flow counter Flow counter is allocated in eswitch legacy acl setting functions without checking if already allocated by previous setting. Add a check to avoid such double allocation. Fixes: 07bab9502641 ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes") Fixes: ea651a86d468 ("net/mlx5: E-Switch, Refactor eswitch egress acl codes") Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 7dbc849b2ab3b8ea8f767361c46f914bb2b7779d Author: Tariq Toukan Date: Wed Sep 29 15:51:26 2021 +0300 net/mlx5e: Improve MQPRIO resiliency * Add netdev->tc_to_txq rollback in case of failure in mlx5e_update_netdev_queues(). * Fix broken transition between the two modes: MQPRIO DCB mode with tc==8, and MQPRIO channel mode. * Disable MQPRIO channel mode if re-attaching with a different number of channels. * Improve code sharing. Fixes: ec60c4581bd9 ("net/mlx5e: Support MQPRIO channel mode") Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 9d758d4a3a039b9d7086d4759ed255b748713eee Author: Tariq Toukan Date: Thu Sep 2 10:33:32 2021 +0300 net/mlx5e: Keep the value for maximum number of channels in-sync The value for maximum number of channels is first calculated based on the netdev's profile and current function resources (specifically, number of MSIX vectors, which depends among other things on the number of online cores in the system). This value is then used to calculate the netdev's number of rxqs/txqs. Once created (by alloc_etherdev_mqs), the number of netdev's rxqs/txqs is constant and we must not exceed it. To achieve this, keep the maximum number of channels in sync upon any netdevice re-attach. Use mlx5e_get_max_num_channels() for calculating the number of netdev's rxqs/txqs. After netdev is created, use mlx5e_calc_max_nch() (which coinsiders core device resources, profile, and netdev) to init or update priv->max_nch. Before this patch, the value of priv->max_nch might get out of sync, mistakenly allowing accesses to out-of-bounds objects, which would crash the system. Track the number of channels stats structures used in a separate field, as they are persistent to suspend/resume operations. All the collected stats of every channel index that ever existed should be preserved. They are reset only when struct mlx5e_priv is, in mlx5e_priv_cleanup(), which is part of the profile changing flow. There is no point anymore in blocking a profile change due to max_nch mismatch in mlx5e_netdev_change_profile(). Remove the limitation. Fixes: a1f240f18017 ("net/mlx5e: Adjust to max number of channles when re-attaching") Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit f9a10440f0b1f33faa792af26f4e9823a9b8b6a4 Author: Raed Salem Date: Thu Aug 26 17:07:17 2021 +0300 net/mlx5e: IPSEC RX, enable checksum complete Currently in Rx data path IPsec crypto offloaded packets uses csum_none flag, so checksum is handled by the stack, this naturally have some performance/cpu utilization impact on such flows. As Nvidia NIC starting from ConnectX6DX provides checksum complete value out of the box also for such flows there is no sense in taking csum_none path, furthermore the stack (xfrm) have the method to handle checksum complete corrections for such flows i.e. IPsec trailer removal and consequently checksum value adjustment. Because of the above and in addition the ConnectX6DX is the first HW which supports IPsec crypto offload then it is safe to report csum complete for IPsec offloaded traffic. Fixes: b2ac7541e377 ("net/mlx5e: IPsec: Add Connect-X IPsec Rx data path offload") Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed commit f2e717d655040d632c9015f19aa4275f8b16e7f2 Author: Trond Myklebust Date: Thu Sep 30 15:44:41 2021 -0400 nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero RFC3530 notes that the 'dircount' field may be zero, in which case the recommendation is to ignore it, and only enforce the 'maxcount' field. In RFC5661, this recommendation to ignore a zero valued field becomes a requirement. Fixes: aee377644146 ("nfsd4: fix rd_dircount enforcement") Cc: Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever commit 115f6134a050bb098414f38555a5ab780ebbfef0 Merge: 78c56e53821a7 040d985e27dc3 Author: Linus Torvalds Date: Thu Sep 30 12:11:35 2021 -0700 Merge tag 'gpio-fixes-for-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "A single fix for the gpio-pca953x driver and two commits updating the MAINTAINERS entries for Mun Yew Tham (GPIO specific) and myself (treewide after a change in professional situation). Summary: - don't ignore I2C errors in gpio-pca953x - update MAINTAINERS entries for Mun Yew Tham and myself" * tag 'gpio-fixes-for-v5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: MAINTAINERS: Update Mun Yew Tham as Altera Pio Driver maintainer MAINTAINERS: update my email address gpio: pca953x: do not ignore i2c errors commit 78c56e53821a7ec3462ce448c1fe6a8d44358831 Merge: 02d5e016800d0 e671f0ecfece1 Author: Linus Torvalds Date: Thu Sep 30 12:00:46 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Not much too exciting here, although two syzkaller bugs that seem to have 9 lives may have finally been squashed. Several core bugs and a batch of driver bug fixes: - Fix compilation problems in qib and hfi1 - Do not corrupt the joined multicast group state when using SEND_ONLY - Several CMA bugs, a reference leak for listening and two syzkaller crashers - Various bug fixes for irdma - Fix a Sleeping while atomic bug in usnic - Properly sanitize kernel pointers in dmesg - Two bugs in the 64b CQE support for hns" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/hns: Add the check of the CQE size of the user space RDMA/hns: Fix the size setting error when copying CQE in clean_cq() RDMA/hfi1: Fix kernel pointer leak RDMA/usnic: Lock VF with mutex instead of spinlock RDMA/hns: Work around broken constant propagation in gcc 8 RDMA/cma: Ensure rdma_addr_cancel() happens before issuing more requests RDMA/cma: Do not change route.addr.src_addr.ss_family RDMA/irdma: Report correct WC error when there are MW bind errors RDMA/irdma: Report correct WC error when transport retry counter is exceeded RDMA/irdma: Validate number of CQ entries on create CQ RDMA/irdma: Skip CQP ring during a reset MAINTAINERS: Update Broadcom RDMA maintainers RDMA/cma: Fix listener leak in rdma_cma_listen_on_all() failure IB/cma: Do not send IGMP leaves for sendonly Multicast groups IB/qib: Fix clang confusion of NULL pointer comparison commit 35afb70dcfe4eb445060dd955e5b67d962869ce5 Author: Konstantin Komarov Date: Wed Sep 29 19:29:52 2021 +0300 fs/ntfs3: Check for NULL if ATTR_EA_INFO is incorrect This can be reason for reported panic https://lore.kernel.org/ntfs3/f9de5807-2311-7374-afb0-bc5dffb522c0@gmail.com/ Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Reported-by: Mohammad Rasim Signed-off-by: Konstantin Komarov commit dbf59e2a33d2cb5ae0534523fd3d6d8bda808be8 Author: Konstantin Komarov Date: Tue Sep 28 19:19:49 2021 +0300 fs/ntfs3: Refactoring of ntfs_init_from_boot Remove ntfs_sb_info members sector_size and sector_bits. Print details why mount failed. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 09f7c338da7818fd33af401d855b895550e7c170 Author: Konstantin Komarov Date: Tue Sep 28 19:19:17 2021 +0300 fs/ntfs3: Reject mount if boot's cluster size < media sector size If we continue to work in this case, then we can corrupt fs. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block"). Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 1d625050c7c2dd877e108e382b8aaf1ae3cfe1f4 Author: Patrick Ho Date: Sat Aug 21 02:56:26 2021 -0400 nfsd: fix error handling of register_pernet_subsys() in init_nfsd() init_nfsd() should not unregister pernet subsys if the register fails but should instead unwind from the last successful operation which is register_filesystem(). Unregistering a failed register_pernet_subsys() call can result in a kernel GPF as revealed by programmatically injecting an error in register_pernet_subsys(). Verified the fix handled failure gracefully with no lingering nfsd entry in /proc/filesystems. This change was introduced by the commit bd5ae9288d64 ("nfsd: register pernet ops last, unregister first"), the original error handling logic was correct. Fixes: bd5ae9288d64 ("nfsd: register pernet ops last, unregister first") Cc: stable@vger.kernel.org Signed-off-by: Patrick Ho Acked-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 4227f811cdeb4d85db91ea6b9adf9ac049cec12e Author: Namjae Jeon Date: Wed Sep 29 19:52:51 2021 +0900 ksmbd: fix transform header validation Validate that the transform and smb request headers are present before checking OriginalMessageSize and SessionId fields. Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Sergey Senozhatsky Reviewed-by: Tom Talpey Acked-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8f77150c15f87796570125a43509f9a81a3d9e49 Author: Hyunchul Lee Date: Fri Sep 24 22:22:22 2021 +0900 ksmbd: add buffer validation for SMB2_CREATE_CONTEXT Add buffer validation for SMB2_CREATE_CONTEXT. Cc: Ronnie Sahlberg Reviewed-by: Ralph Boehme Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 442ff9ebeb0129e90483356f3d79c732e632a7a6 Author: Namjae Jeon Date: Wed Sep 29 15:44:32 2021 +0900 ksmbd: add validation in smb2 negotiate This patch add validation to check request buffer check in smb2 negotiate and fix null pointer deferencing oops in smb3_preauth_hash_rsp() that found from manual test. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Hyunchul Lee Cc: Sergey Senozhatsky Reviewed-by: Ralph Boehme Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9496e268e3af78a92778bf635488a8ec2dca8996 Author: Namjae Jeon Date: Wed Sep 29 15:41:48 2021 +0900 ksmbd: add request buffer validation in smb2_set_info Add buffer validation in smb2_set_info, and remove unused variable in set_file_basic_info. and smb2_set_info infolevel functions take structure pointer argument. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Sergey Senozhatsky Acked-by: Hyunchul Lee Reviewed-by: Ralph Boehme Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 88d300522cbb2827b679359e98cbadfb46e8226c Author: Namjae Jeon Date: Wed Sep 29 15:37:18 2021 +0900 ksmbd: use correct basic info level in set_file_basic_info() Use correct basic info level in set/get_file_basic_info(). Reviewed-by: Ralph Boehme Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 30e29a9a2bc6a4888335a6ede968b75cd329657a Author: Tatsuhiko Yasumatsu Date: Thu Sep 30 22:55:45 2021 +0900 bpf: Fix integer overflow in prealloc_elems_and_freelist() In prealloc_elems_and_freelist(), the multiplication to calculate the size passed to bpf_map_area_alloc() could lead to an integer overflow. As a result, out-of-bounds write could occur in pcpu_freelist_populate() as reported by KASAN: [...] [ 16.968613] BUG: KASAN: slab-out-of-bounds in pcpu_freelist_populate+0xd9/0x100 [ 16.969408] Write of size 8 at addr ffff888104fc6ea0 by task crash/78 [ 16.970038] [ 16.970195] CPU: 0 PID: 78 Comm: crash Not tainted 5.15.0-rc2+ #1 [ 16.970878] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 16.972026] Call Trace: [ 16.972306] dump_stack_lvl+0x34/0x44 [ 16.972687] print_address_description.constprop.0+0x21/0x140 [ 16.973297] ? pcpu_freelist_populate+0xd9/0x100 [ 16.973777] ? pcpu_freelist_populate+0xd9/0x100 [ 16.974257] kasan_report.cold+0x7f/0x11b [ 16.974681] ? pcpu_freelist_populate+0xd9/0x100 [ 16.975190] pcpu_freelist_populate+0xd9/0x100 [ 16.975669] stack_map_alloc+0x209/0x2a0 [ 16.976106] __sys_bpf+0xd83/0x2ce0 [...] The possibility of this overflow was originally discussed in [0], but was overlooked. Fix the integer overflow by changing elem_size to u64 from u32. [0] https://lore.kernel.org/bpf/728b238e-a481-eb50-98e9-b0f430ab01e7@gmail.com/ Fixes: 557c0c6e7df8 ("bpf: convert stackmap to pre-allocation") Signed-off-by: Tatsuhiko Yasumatsu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210930135545.173698-1-th.yasumatsu@gmail.com commit 35306eb23814444bd4021f8a1c3047d3cb0c8b2b Author: Eric Dumazet Date: Wed Sep 29 15:57:50 2021 -0700 af_unix: fix races in sk_peer_pid and sk_peer_cred accesses Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred. In order to fix this issue, this patch adds a new spinlock that needs to be used whenever these fields are read or written. Jann also pointed out that l2cap_sock_get_peer_pid_cb() is currently reading sk->sk_peer_pid which makes no sense, as this field is only possibly set by AF_UNIX sockets. We will have to clean this in a separate patch. This could be done by reverting b48596d1dc25 "Bluetooth: L2CAP: Add get_peer_pid callback" or implementing what was truly expected. Fixes: 109f6e39fa07 ("af_unix: Allow SO_PEERCRED to work across namespaces.") Signed-off-by: Eric Dumazet Reported-by: Jann Horn Cc: Eric W. Biederman Cc: Luiz Augusto von Dentz Cc: Marcel Holtmann Signed-off-by: David S. Miller commit 656ed8b015f19bf3f6e6b3ddd9a4bb4aa5ca73e1 Author: Wong Vee Khee Date: Thu Sep 30 14:44:36 2021 +0800 net: stmmac: fix EEE init issue when paired with EEE capable PHYs When STMMAC is paired with Energy-Efficient Ethernet(EEE) capable PHY, and the PHY is advertising EEE by default, we need to enable EEE on the xPCS side too, instead of having user to manually trigger the enabling config via ethtool. Fixed this by adding xpcs_config_eee() call in stmmac_eee_init(). Fixes: 7617af3d1a5e ("net: pcs: Introducing support for DWC xpcs Energy Efficient Ethernet") Cc: Michael Sit Wei Hong Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller commit a5b8fd657881003ea11c193d147c8f4ba143725d Author: Jakub Kicinski Date: Wed Sep 29 08:32:24 2021 -0700 net: dev_addr_list: handle first address in __hw_addr_add_ex struct dev_addr_list is used for device addresses, unicast addresses and multicast addresses. The first of those needs special handling of the main address - netdev->dev_addr points directly the data of the entry and drivers write to it freely, so we can't maintain it in the rbtree (for now, at least, to be fixed in net-next). Current work around sprinkles special handling of the first address on the list throughout the code but it missed the case where address is being added. First address will not be visible during subsequent adds. Syzbot found a warning where unicast addresses are modified without holding the rtnl lock, tl;dr is that team generates the same modification multiple times, not necessarily when right locks are held. In the repro we have: macvlan -> team -> veth macvlan adds a unicast address to the team. Team then pushes that address down to its memebers (veths). Next something unrelated makes team sync member addrs again, and because of the bug the addr entries get duplicated in the veths. macvlan gets removed, removes its addr from team which removes only one of the duplicated addresses from veths. This removal is done under rtnl. Next syzbot uses iptables to add a multicast addr to team (which does not hold rtnl lock). Team syncs veth addrs, but because veths' unicast list still has the duplicate it will also get sync, even though this update is intended for mc addresses. Again, uc address updates need rtnl lock, boom. Reported-by: syzbot+7a2ab2cdc14d134de553@syzkaller.appspotmail.com Fixes: 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs with IPv6 addresses, performance of changing link state, attaching a VRF, changing an IPv6 address, etc. go down dramtically.") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 42871e95a3afea8956d8cc567ea725b33a837775 Author: Hans de Goede Date: Wed Sep 29 22:15:12 2021 +0200 ASoC: nau8824: Fix headphone vs headset, button-press detection no longer working Commit 1d25684e2251 ("ASoC: nau8824: Fix open coded prefix handling") replaced the nau8824_dapm_enable_pin() helper with direct calls to snd_soc_dapm_enable_pin(), but the helper was using snd_soc_dapm_force_enable_pin() and not forcing the MICBIAS + SAR supplies on breaks headphone vs headset and button-press detection. Replace the snd_soc_dapm_enable_pin() calls with snd_soc_dapm_force_enable_pin() to fix this. Cc: stable@vger.kernel.org Fixes: 1d25684e2251 ("ASoC: nau8824: Fix open coded prefix handling") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210929201512.460360-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit d5ef190693a7d76c5c192d108e8dec48307b46ee Author: Vlad Buslov Date: Wed Sep 29 18:08:49 2021 +0300 net: sched: flower: protect fl_walk() with rcu Patch that refactored fl_walk() to use idr_for_each_entry_continue_ul() also removed rcu protection of individual filters which causes following use-after-free when filter is deleted concurrently. Fix fl_walk() to obtain rcu read lock while iterating and taking the filter reference and temporary release the lock while calling arg->fn() callback that can sleep. KASAN trace: [ 352.773640] ================================================================== [ 352.775041] BUG: KASAN: use-after-free in fl_walk+0x159/0x240 [cls_flower] [ 352.776304] Read of size 4 at addr ffff8881c8251480 by task tc/2987 [ 352.777862] CPU: 3 PID: 2987 Comm: tc Not tainted 5.15.0-rc2+ #2 [ 352.778980] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 352.781022] Call Trace: [ 352.781573] dump_stack_lvl+0x46/0x5a [ 352.782332] print_address_description.constprop.0+0x1f/0x140 [ 352.783400] ? fl_walk+0x159/0x240 [cls_flower] [ 352.784292] ? fl_walk+0x159/0x240 [cls_flower] [ 352.785138] kasan_report.cold+0x83/0xdf [ 352.785851] ? fl_walk+0x159/0x240 [cls_flower] [ 352.786587] kasan_check_range+0x145/0x1a0 [ 352.787337] fl_walk+0x159/0x240 [cls_flower] [ 352.788163] ? fl_put+0x10/0x10 [cls_flower] [ 352.789007] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.790102] tcf_chain_dump+0x231/0x450 [ 352.790878] ? tcf_chain_tp_delete_empty+0x170/0x170 [ 352.791833] ? __might_sleep+0x2e/0xc0 [ 352.792594] ? tfilter_notify+0x170/0x170 [ 352.793400] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.794477] tc_dump_tfilter+0x385/0x4b0 [ 352.795262] ? tc_new_tfilter+0x1180/0x1180 [ 352.796103] ? __mod_node_page_state+0x1f/0xc0 [ 352.796974] ? __build_skb_around+0x10e/0x130 [ 352.797826] netlink_dump+0x2c0/0x560 [ 352.798563] ? netlink_getsockopt+0x430/0x430 [ 352.799433] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.800542] __netlink_dump_start+0x356/0x440 [ 352.801397] rtnetlink_rcv_msg+0x3ff/0x550 [ 352.802190] ? tc_new_tfilter+0x1180/0x1180 [ 352.802872] ? rtnl_calcit.isra.0+0x1f0/0x1f0 [ 352.803668] ? tc_new_tfilter+0x1180/0x1180 [ 352.804344] ? _copy_from_iter_nocache+0x800/0x800 [ 352.805202] ? kasan_set_track+0x1c/0x30 [ 352.805900] netlink_rcv_skb+0xc6/0x1f0 [ 352.806587] ? rht_deferred_worker+0x6b0/0x6b0 [ 352.807455] ? rtnl_calcit.isra.0+0x1f0/0x1f0 [ 352.808324] ? netlink_ack+0x4d0/0x4d0 [ 352.809086] ? netlink_deliver_tap+0x62/0x3d0 [ 352.809951] netlink_unicast+0x353/0x480 [ 352.810744] ? netlink_attachskb+0x430/0x430 [ 352.811586] ? __alloc_skb+0xd7/0x200 [ 352.812349] netlink_sendmsg+0x396/0x680 [ 352.813132] ? netlink_unicast+0x480/0x480 [ 352.813952] ? __import_iovec+0x192/0x210 [ 352.814759] ? netlink_unicast+0x480/0x480 [ 352.815580] sock_sendmsg+0x6c/0x80 [ 352.816299] ____sys_sendmsg+0x3a5/0x3c0 [ 352.817096] ? kernel_sendmsg+0x30/0x30 [ 352.817873] ? __ia32_sys_recvmmsg+0x150/0x150 [ 352.818753] ___sys_sendmsg+0xd8/0x140 [ 352.819518] ? sendmsg_copy_msghdr+0x110/0x110 [ 352.820402] ? ___sys_recvmsg+0xf4/0x1a0 [ 352.821110] ? __copy_msghdr_from_user+0x260/0x260 [ 352.821934] ? _raw_spin_lock+0x81/0xd0 [ 352.822680] ? __handle_mm_fault+0xef3/0x1b20 [ 352.823549] ? rb_insert_color+0x2a/0x270 [ 352.824373] ? copy_page_range+0x16b0/0x16b0 [ 352.825209] ? perf_event_update_userpage+0x2d0/0x2d0 [ 352.826190] ? __fget_light+0xd9/0xf0 [ 352.826941] __sys_sendmsg+0xb3/0x130 [ 352.827613] ? __sys_sendmsg_sock+0x20/0x20 [ 352.828377] ? do_user_addr_fault+0x2c5/0x8a0 [ 352.829184] ? fpregs_assert_state_consistent+0x52/0x60 [ 352.830001] ? exit_to_user_mode_prepare+0x32/0x160 [ 352.830845] do_syscall_64+0x35/0x80 [ 352.831445] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 352.832331] RIP: 0033:0x7f7bee973c17 [ 352.833078] Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 352.836202] RSP: 002b:00007ffcbb368e28 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 352.837524] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7bee973c17 [ 352.838715] RDX: 0000000000000000 RSI: 00007ffcbb368e50 RDI: 0000000000000003 [ 352.839838] RBP: 00007ffcbb36d090 R08: 00000000cea96d79 R09: 00007f7beea34a40 [ 352.841021] R10: 00000000004059bb R11: 0000000000000246 R12: 000000000046563f [ 352.842208] R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffcbb36d088 [ 352.843784] Allocated by task 2960: [ 352.844451] kasan_save_stack+0x1b/0x40 [ 352.845173] __kasan_kmalloc+0x7c/0x90 [ 352.845873] fl_change+0x282/0x22db [cls_flower] [ 352.846696] tc_new_tfilter+0x6cf/0x1180 [ 352.847493] rtnetlink_rcv_msg+0x471/0x550 [ 352.848323] netlink_rcv_skb+0xc6/0x1f0 [ 352.849097] netlink_unicast+0x353/0x480 [ 352.849886] netlink_sendmsg+0x396/0x680 [ 352.850678] sock_sendmsg+0x6c/0x80 [ 352.851398] ____sys_sendmsg+0x3a5/0x3c0 [ 352.852202] ___sys_sendmsg+0xd8/0x140 [ 352.852967] __sys_sendmsg+0xb3/0x130 [ 352.853718] do_syscall_64+0x35/0x80 [ 352.854457] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 352.855830] Freed by task 7: [ 352.856421] kasan_save_stack+0x1b/0x40 [ 352.857139] kasan_set_track+0x1c/0x30 [ 352.857854] kasan_set_free_info+0x20/0x30 [ 352.858609] __kasan_slab_free+0xed/0x130 [ 352.859348] kfree+0xa7/0x3c0 [ 352.859951] process_one_work+0x44d/0x780 [ 352.860685] worker_thread+0x2e2/0x7e0 [ 352.861390] kthread+0x1f4/0x220 [ 352.862022] ret_from_fork+0x1f/0x30 [ 352.862955] Last potentially related work creation: [ 352.863758] kasan_save_stack+0x1b/0x40 [ 352.864378] kasan_record_aux_stack+0xab/0xc0 [ 352.865028] insert_work+0x30/0x160 [ 352.865617] __queue_work+0x351/0x670 [ 352.866261] rcu_work_rcufn+0x30/0x40 [ 352.866917] rcu_core+0x3b2/0xdb0 [ 352.867561] __do_softirq+0xf6/0x386 [ 352.868708] Second to last potentially related work creation: [ 352.869779] kasan_save_stack+0x1b/0x40 [ 352.870560] kasan_record_aux_stack+0xab/0xc0 [ 352.871426] call_rcu+0x5f/0x5c0 [ 352.872108] queue_rcu_work+0x44/0x50 [ 352.872855] __fl_put+0x17c/0x240 [cls_flower] [ 352.873733] fl_delete+0xc7/0x100 [cls_flower] [ 352.874607] tc_del_tfilter+0x510/0xb30 [ 352.886085] rtnetlink_rcv_msg+0x471/0x550 [ 352.886875] netlink_rcv_skb+0xc6/0x1f0 [ 352.887636] netlink_unicast+0x353/0x480 [ 352.888285] netlink_sendmsg+0x396/0x680 [ 352.888942] sock_sendmsg+0x6c/0x80 [ 352.889583] ____sys_sendmsg+0x3a5/0x3c0 [ 352.890311] ___sys_sendmsg+0xd8/0x140 [ 352.891019] __sys_sendmsg+0xb3/0x130 [ 352.891716] do_syscall_64+0x35/0x80 [ 352.892395] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 352.893666] The buggy address belongs to the object at ffff8881c8251000 which belongs to the cache kmalloc-2k of size 2048 [ 352.895696] The buggy address is located 1152 bytes inside of 2048-byte region [ffff8881c8251000, ffff8881c8251800) [ 352.897640] The buggy address belongs to the page: [ 352.898492] page:00000000213bac35 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c8250 [ 352.900110] head:00000000213bac35 order:3 compound_mapcount:0 compound_pincount:0 [ 352.901541] flags: 0x2ffff800010200(slab|head|node=0|zone=2|lastcpupid=0x1ffff) [ 352.902908] raw: 002ffff800010200 0000000000000000 dead000000000122 ffff888100042f00 [ 352.904391] raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 [ 352.905861] page dumped because: kasan: bad access detected [ 352.907323] Memory state around the buggy address: [ 352.908218] ffff8881c8251380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.909471] ffff8881c8251400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.910735] >ffff8881c8251480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.912012] ^ [ 352.912642] ffff8881c8251500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.913919] ffff8881c8251580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.915185] ================================================================== Fixes: d39d714969cd ("idr: introduce idr_for_each_entry_continue_ul()") Signed-off-by: Vlad Buslov Acked-by: Cong Wang Signed-off-by: David S. Miller commit 1f8763c59c4ec6254d629fe77c0a52220bd907aa Author: Takashi Iwai Date: Thu Sep 30 13:41:14 2021 +0200 ALSA: seq: Fix a potential UAF by wrong private_free call order John Keeping reported and posted a patch for a potential UAF in rawmidi sequencer destruction: the snd_rawmidi_dev_seq_free() may be called after the associated rawmidi object got already freed. After a deeper look, it turned out that the bug is rather the incorrect private_free call order for a snd_seq_device. The snd_seq_device private_free gets called at the release callback of the sequencer device object, while this was rather expected to be executed at the snd_device call chains that runs at the beginning of the whole card-free procedure. It's been broken since the rewrite of sequencer-device binding (although it hasn't surfaced because the sequencer device release happens usually right along with the card device release). This patch corrects the private_free call to be done in the right place, at snd_seq_device_dev_free(). Fixes: 7c37ae5c625a ("ALSA: seq: Rewrite sequencer device binding with standard bus") Reported-and-tested-by: John Keeping Cc: Link: https://lore.kernel.org/r/20210930114114.8645-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 49054556289e8787501630b7c7a9d407da02e296 Author: Paolo Abeni Date: Wed Sep 29 11:59:17 2021 +0200 net: introduce and use lock_sock_fast_nested() Syzkaller reported a false positive deadlock involving the nl socket lock and the subflow socket lock: MPTCP: kernel_bind error, err=-98 ============================================ WARNING: possible recursive locking detected 5.15.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz-executor998/6520 is trying to acquire lock: ffff8880795718a0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x267/0x7b0 net/mptcp/protocol.c:2738 but task is already holding lock: ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1612 [inline] ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x23/0x7b0 net/mptcp/protocol.c:2720 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(k-sk_lock-AF_INET); lock(k-sk_lock-AF_INET); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by syz-executor998/6520: #0: ffffffff8d176c50 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802 #1: ffffffff8d176d08 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8d176d08 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x3e0/0x580 net/netlink/genetlink.c:790 #2: ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1612 [inline] #2: ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x23/0x7b0 net/mptcp/protocol.c:2720 stack backtrace: CPU: 1 PID: 6520 Comm: syz-executor998 Not tainted 5.15.0-rc1-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 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline] check_deadlock kernel/locking/lockdep.c:2987 [inline] validate_chain kernel/locking/lockdep.c:3776 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 lock_sock_fast+0x36/0x100 net/core/sock.c:3229 mptcp_close+0x267/0x7b0 net/mptcp/protocol.c:2738 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 __sock_release net/socket.c:649 [inline] sock_release+0x87/0x1b0 net/socket.c:677 mptcp_pm_nl_create_listen_socket+0x238/0x2c0 net/mptcp/pm_netlink.c:900 mptcp_nl_cmd_add_addr+0x359/0x930 net/mptcp/pm_netlink.c:1170 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 sock_no_sendpage+0x101/0x150 net/core/sock.c:2980 kernel_sendpage.part.0+0x1a0/0x340 net/socket.c:3504 kernel_sendpage net/socket.c:3501 [inline] sock_sendpage+0xe5/0x140 net/socket.c:1003 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x43e/0x8a0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xae9/0x1240 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1314 [inline] __se_sys_sendfile64 fs/read_write.c:1300 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1300 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:0x7f215cb69969 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc96bb3868 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f215cbad072 RCX: 00007f215cb69969 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 0000000000000000 R08: 00007ffc96bb3a08 R09: 00007ffc96bb3a08 R10: 0000000100000002 R11: 0000000000000246 R12: 00007ffc96bb387c R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 the problem originates from uncorrect lock annotation in the mptcp code and is only visible since commit 2dcb96bacce3 ("net: core: Correct the sock::sk_lock.owned lockdep annotations"), but is present since the port-based endpoint support initial implementation. This patch addresses the issue introducing a nested variant of lock_sock_fast() and using it in the relevant code path. Fixes: 1729cf186d8a ("mptcp: create the listening socket for new port") Fixes: 2dcb96bacce3 ("net: core: Correct the sock::sk_lock.owned lockdep annotations") Suggested-by: Thomas Gleixner Reported-and-tested-by: syzbot+1dd53f7a89b299d59eaf@syzkaller.appspotmail.com Signed-off-by: Paolo Abeni Reviewed-by: Thomas Gleixner Signed-off-by: David S. Miller commit eb676622846b34a751e2ff9b5910a5322a4e0000 Author: John Liu Date: Thu Sep 30 13:53:16 2021 +0200 ALSA: hda/realtek: Enable 4-speaker output for Dell Precision 5560 laptop The Dell Precision 5560 laptop appears to use the 4-speakers-on-ALC289 audio just like its sibling product XPS 9510, so it requires the same quirk to enable woofer output. Tested on my Dell Precision 5560. Signed-off-by: John Liu Cc: Link: https://lore.kernel.org/r/20210930115316.659-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8ec59ac3ad29891c0afef627640df36f2daa0349 Author: Takashi Iwai Date: Wed Sep 29 09:35:40 2021 +0200 ALSA: usb-audio: Fix a missing error check in scarlett gen2 mixer The check of the returned error code is missing in scarlett2_update_monitor_other(). Let's fix it. Fixes: d5bda7e03982 ("ALSA: usb-audio: scarlett2: Add support for the talkback feature") Reported-by: kernel test robot Cc: Link: https://lore.kernel.org/r/202109131831.9IodEzRx-lkp@intel.com Link: https://lore.kernel.org/r/20210929073540.9611-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b232537074fcaf0c2837abbb217429c097bb7598 Author: Tony Lindgren Date: Thu Sep 30 11:30:03 2021 +0300 soc: ti: omap-prm: Fix external abort for am335x pruss Starting with v5.15-rc1, we may now see some am335x beaglebone black device produce the following error on pruss probe: Unhandled fault: external abort on non-linefetch (0x1008) at 0xe0326000 This has started with the enabling of pruss for am335x in the dts files. Turns out the is caused by the PRM reset handling not waiting for the reset bit to clear. To fix the issue, let's always wait for the reset bit to clear, even if there is a separate reset status register. We attempted to fix a similar issue for dra7 iva with a udelay() in commit effe89e40037 ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva"). There is no longer a need for the udelay() for dra7 iva reset either with the check added for reset bit clearing. Cc: Drew Fustini Cc: Grygorii Strashko Cc: "H. Nikolaus Schaller" Cc: Robert Nelson Cc: Yongqin Liu Fixes: effe89e40037 ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva") Reported-by: Matti Vaittinen Tested-by: Matti Vaittinen Signed-off-by: Tony Lindgren commit 7b0035eaa7dab9fd33d6658ad6a755024bdce26c Author: Sean Christopherson Date: Wed Sep 29 16:41:12 2021 -0700 KVM: selftests: Ensure all migrations are performed when test is affined Rework the CPU selection in the migration worker to ensure the specified number of migrations are performed when the test iteslf is affined to a subset of CPUs. The existing logic skips iterations if the target CPU is not in the original set of possible CPUs, which causes the test to fail if too many iterations are skipped. ==== Test Assertion Failure ==== rseq_test.c:228: i > (NR_TASK_MIGRATIONS / 2) pid=10127 tid=10127 errno=4 - Interrupted system call 1 0x00000000004018e5: main at rseq_test.c:227 2 0x00007fcc8fc66bf6: ?? ??:0 3 0x0000000000401959: _start at ??:? Only performed 4 KVM_RUNs, task stalled too much? Calculate the min/max possible CPUs as a cheap "best effort" to avoid high runtimes when the test is affined to a small percentage of CPUs. Alternatively, a list or xarray of the possible CPUs could be used, but even in a horrendously inefficient setup, such optimizations are not needed because the runtime is completely dominated by the cost of migrating the task, and the absolute runtime is well under a minute in even truly absurd setups, e.g. running on a subset of vCPUs in a VM that is heavily overcommited (16 vCPUs per pCPU). Fixes: 61e52f1630f5 ("KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs") Reported-by: Dongli Zhang Signed-off-by: Sean Christopherson Message-Id: <20210929234112.1862848-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e8a747d0884e554a8c1872da6c8f680a4f893c6d Author: Sean Christopherson Date: Wed Sep 29 15:24:25 2021 -0700 KVM: x86: Swap order of CPUID entry "index" vs. "significant flag" checks Check whether a CPUID entry's index is significant before checking for a matching index to hack-a-fix an undefined behavior bug due to consuming uninitialized data. RESET/INIT emulation uses kvm_cpuid() to retrieve CPUID.0x1, which does _not_ have a significant index, and fails to initialize the dummy variable that doubles as EBX/ECX/EDX output _and_ ECX, a.k.a. index, input. Practically speaking, it's _extremely_ unlikely any compiler will yield code that causes problems, as the compiler would need to inline the kvm_cpuid() call to detect the uninitialized data, and intentionally hose the kernel, e.g. insert ud2, instead of simply ignoring the result of the index comparison. Although the sketchy "dummy" pattern was introduced in SVM by commit 66f7b72e1171 ("KVM: x86: Make register state after reset conform to specification"), it wasn't actually broken until commit 7ff6c0350315 ("KVM: x86: Remove stateful CPUID handling") arbitrarily swapped the order of operations such that "index" was checked before the significant flag. Avoid consuming uninitialized data by reverting to checking the flag before the index purely so that the fix can be easily backported; the offending RESET/INIT code has been refactored, moved, and consolidated from vendor code to common x86 since the bug was introduced. A future patch will directly address the bad RESET/INIT behavior. The undefined behavior was detected by syzbot + KernelMemorySanitizer. BUG: KMSAN: uninit-value in cpuid_entry2_find arch/x86/kvm/cpuid.c:68 BUG: KMSAN: uninit-value in kvm_find_cpuid_entry arch/x86/kvm/cpuid.c:1103 BUG: KMSAN: uninit-value in kvm_cpuid+0x456/0x28f0 arch/x86/kvm/cpuid.c:1183 cpuid_entry2_find arch/x86/kvm/cpuid.c:68 [inline] kvm_find_cpuid_entry arch/x86/kvm/cpuid.c:1103 [inline] kvm_cpuid+0x456/0x28f0 arch/x86/kvm/cpuid.c:1183 kvm_vcpu_reset+0x13fb/0x1c20 arch/x86/kvm/x86.c:10885 kvm_apic_accept_events+0x58f/0x8c0 arch/x86/kvm/lapic.c:2923 vcpu_enter_guest+0xfd2/0x6d80 arch/x86/kvm/x86.c:9534 vcpu_run+0x7f5/0x18d0 arch/x86/kvm/x86.c:9788 kvm_arch_vcpu_ioctl_run+0x245b/0x2d10 arch/x86/kvm/x86.c:10020 Local variable ----dummy@kvm_vcpu_reset created at: kvm_vcpu_reset+0x1fb/0x1c20 arch/x86/kvm/x86.c:10812 kvm_apic_accept_events+0x58f/0x8c0 arch/x86/kvm/lapic.c:2923 Reported-by: syzbot+f3985126b746b3d59c9d@syzkaller.appspotmail.com Reported-by: Alexander Potapenko Fixes: 2a24be79b6b7 ("KVM: VMX: Set EDX at INIT with CPUID.0x1, Family-Model-Stepping") Fixes: 7ff6c0350315 ("KVM: x86: Remove stateful CPUID handling") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Message-Id: <20210929222426.1855730-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 773e89ab0056aaa2baa1ffd9f044551654410104 Author: Zelin Deng Date: Wed Sep 29 13:13:49 2021 +0800 ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm hv_clock is preallocated to have only HVC_BOOT_ARRAY_SIZE (64) elements; if the PTP_SYS_OFFSET_PRECISE ioctl is executed on vCPUs whose index is 64 of higher, retrieving the struct pvclock_vcpu_time_info pointer with "src = &hv_clock[cpu].pvti" will result in an out-of-bounds access and a wild pointer. Change it to "this_cpu_pvti()" which is guaranteed to be valid. Fixes: 95a3d4454bb1 ("Switch kvmclock data to a PER_CPU variable") Signed-off-by: Zelin Deng Cc: Message-Id: <1632892429-101194-3-git-send-email-zelin.deng@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit ad9af930680bb396c87582edc172b3a7cf2a3fbf Author: Zelin Deng Date: Wed Sep 29 13:13:48 2021 +0800 x86/kvmclock: Move this_cpu_pvti into kvmclock.h There're other modules might use hv_clock_per_cpu variable like ptp_kvm, so move it into kvmclock.h and export the symbol to make it visiable to other modules. Signed-off-by: Zelin Deng Cc: Message-Id: <1632892429-101194-2-git-send-email-zelin.deng@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit 23c216b335d1fbd716076e8263b54a714ea3cf0e Author: Alexey Kardashevskiy Date: Thu Sep 30 13:44:54 2021 +1000 powerpc/iommu: Report the correct most efficient DMA mask for PCI devices According to dma-api.rst, the dma_get_required_mask() helper should return "the mask that the platform requires to operate efficiently". Which in the case of PPC64 means the bypass mask and not a mask from an IOMMU table which is shorter and slower to use due to map/unmap operations (especially expensive on "pseries"). However the existing implementation ignores the possibility of bypassing and returns the IOMMU table mask on the pseries platform which makes some drivers (mpt3sas is one example) choose 32bit DMA even though bypass is supported. The powernv platform sort of handles it by having a bigger default window with a mask >=40 but it only works as drivers choose 63/64bit if the required mask is >32 which is rather pointless. This reintroduces the bypass capability check to let drivers make a better choice of the DMA mask. Fixes: f1565c24b596 ("powerpc: use the generic dma_ops_bypass mode") Signed-off-by: Alexey Kardashevskiy Reviewed-by: Christoph Hellwig Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210930034454.95794-1-aik@ozlabs.ru commit 41e76c6a3c83c85e849f10754b8632ea763d9be4 Author: Nick Desaulniers Date: Mon Sep 20 16:25:33 2021 -0700 nbd: use shifts rather than multiplies commit fad7cd3310db ("nbd: add the check to prevent overflow in __nbd_ioctl()") raised an issue from the fallback helpers added in commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") ERROR: modpost: "__divdi3" [drivers/block/nbd.ko] undefined! As Stephen Rothwell notes: The added check_mul_overflow() call is being passed 64 bit values. COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW is not set for this build (see include/linux/overflow.h). Specifically, the helpers for checking whether the results of a multiplication overflowed (__unsigned_mul_overflow, __signed_add_overflow) use the division operator when !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is problematic for 64b operands on 32b hosts. This was fixed upstream by commit 76ae847497bc ("Documentation: raise minimum supported version of GCC to 5.1") which is not suitable to be backported to stable. Further, __builtin_mul_overflow() would emit a libcall to a compiler-rt-only symbol when compiling with clang < 14 for 32b targets. ld.lld: error: undefined symbol: __mulodi4 In order to keep stable buildable with GCC 4.9 and clang < 14, modify struct nbd_config to instead track the number of bits of the block size; reconstructing the block size using runtime checked shifts that are not problematic for those compilers and in a ways that can be backported to stable. In nbd_set_size, we do validate that the value of blksize must be a power of two (POT) and is in the range of [512, PAGE_SIZE] (both inclusive). This does modify the debugfs interface. Cc: stable@vger.kernel.org Cc: Arnd Bergmann Cc: Rasmus Villemoes Link: https://github.com/ClangBuiltLinux/linux/issues/1438 Link: https://lore.kernel.org/all/20210909182525.372ee687@canb.auug.org.au/ Link: https://lore.kernel.org/stable/CAHk-=whiQBofgis_rkniz8GBP9wZtSZdcDEffgSLO62BUGV3gg@mail.gmail.com/ Reported-by: Naresh Kamboju Reported-by: Nathan Chancellor Reported-by: Stephen Rothwell Suggested-by: Kees Cook Suggested-by: Linus Torvalds Suggested-by: Pavel Machek Signed-off-by: Nick Desaulniers Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20210920232533.4092046-1-ndesaulniers@google.com Signed-off-by: Jens Axboe commit ce812992f239f45e13c820a52455fec6eacbce1e Author: Namjae Jeon Date: Mon Sep 27 21:47:48 2021 +0900 ksmbd: remove NTLMv1 authentication Remove insecure NTLMv1 authentication. Cc: Ronnie Sahlberg Cc: Ralph Böhme Reviewed-by: Tom Talpey Acked-by: Steve French Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 040d985e27dc39353d50d0f75a6be3330f4fece2 Author: Mun Yew Tham Date: Wed Sep 29 08:49:11 2021 +0800 MAINTAINERS: Update Mun Yew Tham as Altera Pio Driver maintainer Update Altera Pio Driver maintainer's email from to Signed-off-by: Mun Yew Tham Acked-by: Joyce Ooi Signed-off-by: Bartosz Golaszewski commit d1d598104336075e7475d932d200b33108399225 Author: Bartosz Golaszewski Date: Mon Sep 20 09:18:37 2021 +0200 MAINTAINERS: update my email address My professional situation changes soon. Update my email address. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Acked-by: Andy Shevchenko commit 540cffbab8b8e6c52a4121666ca18d6e94586ed2 Author: Andrey Gusakov Date: Thu Sep 23 20:22:16 2021 +0300 gpio: pca953x: do not ignore i2c errors Per gpio_chip interface, error shall be proparated to the caller. Attempt to silent diagnostics by returning zero (as written in the comment) is plain wrong, because the zero return can be interpreted by the caller as the gpio value. Cc: stable@vger.kernel.org Signed-off-by: Andrey Gusakov Signed-off-by: Nikita Yushchenko Signed-off-by: Bartosz Golaszewski commit 02d5e016800d082058b3d3b7c3ede136cdc6ddcb Merge: 6e439bbd436e3 f2ff7147c6834 Author: Linus Torvalds Date: Wed Sep 29 07:48:00 2021 -0700 Merge tag 'sound-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This became a slightly large collection of changes, partly because I've been off in the last weeks. Most of changes are small and scattered while a bit big change is found in HD-audio Realtek codec driver; it's a very device-specific fix that has been long wanted, so I decided to pick up although it's in the middle RC. Some highlights: - A new guard ioctl for ALSA rawmidi API to avoid the misuse of the new timestamp framing mode; it's for a regression fix - HD-audio: a revert of the 5.15 change that might work badly, new quirks for Lenovo Legion & co, a follow-up fix for CS8409 - ASoC: lots of SOF-related fixes, fsl component fixes, corrections of mediatek drivers - USB-audio: fix for the PM resume - FireWire: oxfw and motu fixes" * tag 'sound-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (25 commits) ALSA: pcsp: Make hrtimer forwarding more robust ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION ALSA: firewire-motu: fix truncated bytes in message tracepoints ASoC: SOF: trace: Omit error print when waking up trace sleepers ASoC: mediatek: mt8195: remove wrong fixup assignment on HDMITX ASoC: SOF: loader: Re-phrase the missing firmware error to avoid duplication ASoC: SOF: loader: release_firmware() on load failure to avoid batching ALSA: hda/cs8409: Setup Dolphin Headset Mic as Phantom Jack ALSA: pcxhr: "fix" PCXHR_REG_TO_PORT definition ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types ASoC: SOF: imx: imx8: Bar index is only valid for IRAM and SRAM types ASoC: SOF: Fix DSP oops stack dump output contents ALSA: hda/realtek: Quirks to enable speaker output for Lenovo Legion 7i 15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 laptops. ALSA: usb-audio: Unify mixer resume and reset_resume procedure Revert "ALSA: hda: Drop workaround for a hang at shutdown again" ALSA: oxfw: fix transmission method for Loud models based on OXFW971 ASoC: mediatek: common: handle NULL case in suspend/resume function ASoC: fsl_xcvr: register platform component before registering cpu dai ASoC: fsl_spdif: register platform component before registering cpu dai ASoC: fsl_micfil: register platform component before registering cpu dai ... commit 6e439bbd436e39f15abc9587cdd23d56257780cb Merge: a4e6f95a891ac 0e14ef38669ce Author: Linus Torvalds Date: Wed Sep 29 07:37:46 2021 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "This contains fixes for a resource leak in ccp as well as stack corruption in x86/sm4" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: x86/sm4 - Fix frame pointer stack corruption crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd() commit 79e3445b38e0cab94264a3894c0c3d57c930b97e Author: Johan Almbladh Date: Tue Sep 28 11:13:10 2021 +0200 bpf, arm: Fix register clobbering in div/mod implementation On ARM CPUs that lack div/mod instructions, ALU32 BPF_DIV and BPF_MOD are implemented using a call to a helper function. Before, the emitted code for those function calls failed to preserve caller-saved ARM registers. Since some of those registers happen to be mapped to BPF registers, it resulted in eBPF register values being overwritten. This patch emits code to push and pop the remaining caller-saved ARM registers r2-r3 into the stack during the div/mod function call. ARM registers r0-r1 are used as arguments and return value, and those were already saved and restored correctly. Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler") Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann commit d75fe9cb1dd062684c9fb8a4581738170365dc06 Author: Luca Boccassi Date: Thu Sep 23 01:05:40 2021 +0100 samples/bpf: Relicense bpf_insn.h as GPL-2.0-only OR BSD-2-Clause libbpf and bpftool have been dual-licensed to facilitate inclusion in software that is not compatible with GPL2-only (ie: Apache2), but the samples are still GPL2-only. Given these files are samples, they get naturally copied around. For example, it is the case for samples/bpf/bpf_insn.h which was copied into the systemd tree: https://github.com/systemd/systemd/blob/main/src/shared/linux/bpf_insn.h Some more context on systemd's needs specifically: Most of systemd is (L)GPL2-or-later, which means there is no perceived incompatibility with Apache2 software and can thus be linked with OpenSSL 3.0. But given this GPL2-only header is included this is currently not possible. Dual-licensing this header solves this problem for us as we are scoping a move to OpenSSL 3.0, see: https://lists.freedesktop.org/archives/systemd-devel/2021-September/046882.html Dual-license this header as GPL-2.0-only OR BSD-2-Clause to follow the same licensing used by libbpf and bpftool: 1bc38b8ff6cc ("libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause") 907b22365115 ("tools: bpftool: dual license all files") Signed-off-by: Luca Boccassi Signed-off-by: Daniel Borkmann Acked-by: Simon Horman Acked-by: Daniel Mack Acked-by: Josef Bacik Acked-by: Joe Stringer Acked-by: Chenbo Feng Acked-by: Björn Töpel Acked-by: Magnus Karlsson Acked-by: Brendan Jackman Acked-by: Daniel Borkmann Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210923000540.47344-1-luca.boccassi@gmail.com commit d88fd1b546ff19c8040cfaea76bf16aed1c5a0bb Author: Florian Fainelli Date: Tue Sep 28 13:32:33 2021 -0700 net: phy: bcm7xxx: Fixed indirect MMD operations When EEE support was added to the 28nm EPHY it was assumed that it would be able to support the standard clause 45 over clause 22 register access method. It turns out that the PHY does not support that, which is the very reason for using the indirect shadow mode 2 bank 3 access method. Implement {read,write}_mmd to allow the standard PHY library routines pertaining to EEE querying and configuration to work correctly on these PHYs. This forces us to implement a __phy_set_clr_bits() function that does not grab the MDIO bus lock since the PHY driver's {read,write}_mmd functions are always called with that lock held. Fixes: 83ee102a6998 ("net: phy: bcm7xxx: add support for 28nm EPHY") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 251ffc07730305c0dd9b0786240577319cc560e0 Merge: 513e605d7a9ce 0178839ccca36 Author: David S. Miller Date: Wed Sep 29 11:03:54 2021 +0100 Merge branch 'hns3-fixes' 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 0178839ccca36dee238a57e7f4c3c252f5dbbba6 Author: Guangbin Huang Date: Wed Sep 29 17:35:56 2021 +0800 net: hns3: disable firmware compatible features when uninstall PF Currently, the firmware compatible features are enabled in PF driver initialization process, but they are not disabled in PF driver deinitialization process and firmware keeps these features in enabled status. In this case, if load an old PF driver (for example, in VM) which not support the firmware compatible features, firmware will still send mailbox message to PF when link status changed and PF will print "un-supported mailbox message, code = 201". To fix this problem, disable these firmware compatible features in PF driver deinitialization process. Fixes: ed8fb4b262ae ("net: hns3: add link change event report") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 27bf4af69fcb9845fb2f0076db5d562ec072e70f Author: Guangbin Huang Date: Wed Sep 29 17:35:55 2021 +0800 net: hns3: fix always enable rx vlan filter problem after selftest Currently, the rx vlan filter will always be disabled before selftest and be enabled after selftest as the rx vlan filter feature is fixed on in old device earlier than V3. However, this feature is not fixed in some new devices and it can be disabled by user. In this case, it is wrong if rx vlan filter is enabled after selftest. So fix it. Fixes: bcc26e8dc432 ("net: hns3: remove unused code in hns3_self_test()") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 276e60421668d019dc655973b1832ea354c0f36c Author: Guangbin Huang Date: Wed Sep 29 17:35:54 2021 +0800 net: hns3: PF enable promisc for VF when mac table is overflow If unicast mac address table is full, and user add a new mac address, the unicast promisc needs to be enabled for the new unicast mac address can be used. So does the multicast promisc. Now this feature has been implemented for PF, and VF should be implemented too. When the mac table of VF is overflow, PF will enable promisc for this VF. Fixes: 1e6e76101fd9 ("net: hns3: configure promisc mode for VF asynchronously") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 108b3c7810e14892c4a1819b1d268a2c785c087c Author: Jian Shen Date: Wed Sep 29 17:35:53 2021 +0800 net: hns3: fix show wrong state when add existing uc mac address Currently, if function adds an existing unicast mac address, eventhough driver will not add this address into hardware, but it will return 0 in function hclge_add_uc_addr_common(). It will cause the state of this unicast mac address is ACTIVE in driver, but it should be in TO-ADD state. To fix this problem, function hclge_add_uc_addr_common() returns -EEXIST if mac address is existing, and delete two error log to avoid printing them all the time after this modification. Fixes: 72110b567479 ("net: hns3: return 0 and print warning when hit duplicate MAC") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0472e95ffeac8e61259eec17ab61608c6b35599d Author: Jian Shen Date: Wed Sep 29 17:35:52 2021 +0800 net: hns3: fix mixed flag HCLGE_FLAG_MQPRIO_ENABLE and HCLGE_FLAG_DCB_ENABLE HCLGE_FLAG_MQPRIO_ENABLE is supposed to set when enable multiple TCs with tc mqprio, and HCLGE_FLAG_DCB_ENABLE is supposed to set when enable multiple TCs with ets. But the driver mixed the flags when updating the tm configuration. Furtherly, PFC should be available when HCLGE_FLAG_MQPRIO_ENABLE too, so remove the unnecessary limitation. Fixes: 5a5c90917467 ("net: hns3: add support for tc mqprio offload") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d82650be60ee92e7486f755f5387023278aa933f Author: Jian Shen Date: Wed Sep 29 17:35:51 2021 +0800 net: hns3: don't rollback when destroy mqprio fail For destroy mqprio is irreversible in stack, so it's unnecessary to rollback the tc configuration when destroy mqprio failed. Otherwise, it may cause the configuration being inconsistent between driver and netstack. As the failure is usually caused by reset, and the driver will restore the configuration after reset, so it can keep the configuration being consistent between driver and hardware. Fixes: 5a5c90917467 ("net: hns3: add support for tc mqprio offload") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a8e76fefe3de9b8e609cf192af75e7878d21fa3a Author: Jian Shen Date: Wed Sep 29 17:35:50 2021 +0800 net: hns3: remove tc enable checking Currently, in function hns3_nic_set_real_num_queue(), the driver doesn't report the queue count and offset for disabled tc. If user enables multiple TCs, but only maps user priorities to partial of them, it may cause the queue range of the unmapped TC being displayed abnormally. Fix it by removing the tc enable checking, ensure the queue count is not zero. With this change, the tc_en is useless now, so remove it. Fixes: a75a8efa00c5 ("net: hns3: Fix tc setup when netdev is first up") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5b09e88e1bf7fe86540fab4b5f3eece8abead39e Author: Jian Shen Date: Wed Sep 29 17:35:49 2021 +0800 net: hns3: do not allow call hns3_nic_net_open repeatedly hns3_nic_net_open() is not allowed to called repeatly, but there is no checking for this. When doing device reset and setup tc concurrently, there is a small oppotunity to call hns3_nic_net_open repeatedly, and cause kernel bug by calling napi_enable twice. The calltrace information is like below: [ 3078.222780] ------------[ cut here ]------------ [ 3078.230255] kernel BUG at net/core/dev.c:6991! [ 3078.236224] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 3078.243431] Modules linked in: hns3 hclgevf hclge hnae3 vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O) [ 3078.258880] CPU: 0 PID: 295 Comm: kworker/u8:5 Tainted: G O 5.14.0-rc4+ #1 [ 3078.269102] Hardware name: , BIOS KpxxxFPGA 1P B600 V181 08/12/2021 [ 3078.276801] Workqueue: hclge hclge_service_task [hclge] [ 3078.288774] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 3078.296168] pc : napi_enable+0x80/0x84 tc qdisc sho[w 3d0e7v8 .e3t0h218 79] lr : hns3_nic_net_open+0x138/0x510 [hns3] [ 3078.314771] sp : ffff8000108abb20 [ 3078.319099] x29: ffff8000108abb20 x28: 0000000000000000 x27: ffff0820a8490300 [ 3078.329121] x26: 0000000000000001 x25: ffff08209cfc6200 x24: 0000000000000000 [ 3078.339044] x23: ffff0820a8490300 x22: ffff08209cd76000 x21: ffff0820abfe3880 [ 3078.349018] x20: 0000000000000000 x19: ffff08209cd76900 x18: 0000000000000000 [ 3078.358620] x17: 0000000000000000 x16: ffffc816e1727a50 x15: 0000ffff8f4ff930 [ 3078.368895] x14: 0000000000000000 x13: 0000000000000000 x12: 0000259e9dbeb6b4 [ 3078.377987] x11: 0096a8f7e764eb40 x10: 634615ad28d3eab5 x9 : ffffc816ad8885b8 [ 3078.387091] x8 : ffff08209cfc6fb8 x7 : ffff0820ac0da058 x6 : ffff0820a8490344 [ 3078.396356] x5 : 0000000000000140 x4 : 0000000000000003 x3 : ffff08209cd76938 [ 3078.405365] x2 : 0000000000000000 x1 : 0000000000000010 x0 : ffff0820abfe38a0 [ 3078.414657] Call trace: [ 3078.418517] napi_enable+0x80/0x84 [ 3078.424626] hns3_reset_notify_up_enet+0x78/0xd0 [hns3] [ 3078.433469] hns3_reset_notify+0x64/0x80 [hns3] [ 3078.441430] hclge_notify_client+0x68/0xb0 [hclge] [ 3078.450511] hclge_reset_rebuild+0x524/0x884 [hclge] [ 3078.458879] hclge_reset_service_task+0x3c4/0x680 [hclge] [ 3078.467470] hclge_service_task+0xb0/0xb54 [hclge] [ 3078.475675] process_one_work+0x1dc/0x48c [ 3078.481888] worker_thread+0x15c/0x464 [ 3078.487104] kthread+0x160/0x170 [ 3078.492479] ret_from_fork+0x10/0x18 [ 3078.498785] Code: c8027c81 35ffffa2 d50323bf d65f03c0 (d4210000) [ 3078.506889] ---[ end trace 8ebe0340a1b0fb44 ]--- Once hns3_nic_net_open() is excute success, the flag HNS3_NIC_STATE_DOWN will be cleared. So add checking for this flag, directly return when HNS3_NIC_STATE_DOWN is no set. Fixes: e888402789b9 ("net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 513e605d7a9ce136886cb42ebb2c40e9a6eb6333 Author: Feng Zhou Date: Tue Sep 28 15:23:59 2021 -0700 ixgbe: Fix NULL pointer dereference in ixgbe_xdp_setup The ixgbe driver currently generates a NULL pointer dereference with some machine (online cpus < 63). This is due to the fact that the maximum value of num_xdp_queues is nr_cpu_ids. Code is in "ixgbe_set_rss_queues"". Here's how the problem repeats itself: Some machine (online cpus < 63), And user set num_queues to 63 through ethtool. Code is in the "ixgbe_set_channels", adapter->ring_feature[RING_F_FDIR].limit = count; It becomes 63. When user use xdp, "ixgbe_set_rss_queues" will set queues num. adapter->num_rx_queues = rss_i; adapter->num_tx_queues = rss_i; adapter->num_xdp_queues = ixgbe_xdp_queues(adapter); And rss_i's value is from f = &adapter->ring_feature[RING_F_FDIR]; rss_i = f->indices = f->limit; So "num_rx_queues" > "num_xdp_queues", when run to "ixgbe_xdp_setup", for (i = 0; i < adapter->num_rx_queues; i++) if (adapter->xdp_ring[i]->xsk_umem) It leads to panic. Call trace: [exception RIP: ixgbe_xdp+368] RIP: ffffffffc02a76a0 RSP: ffff9fe16202f8d0 RFLAGS: 00010297 RAX: 0000000000000000 RBX: 0000000000000020 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 000000000000001c RDI: ffffffffa94ead90 RBP: ffff92f8f24c0c18 R8: 0000000000000000 R9: 0000000000000000 R10: ffff9fe16202f830 R11: 0000000000000000 R12: ffff92f8f24c0000 R13: ffff9fe16202fc01 R14: 000000000000000a R15: ffffffffc02a7530 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 7 [ffff9fe16202f8f0] dev_xdp_install at ffffffffa89fbbcc 8 [ffff9fe16202f920] dev_change_xdp_fd at ffffffffa8a08808 9 [ffff9fe16202f960] do_setlink at ffffffffa8a20235 10 [ffff9fe16202fa88] rtnl_setlink at ffffffffa8a20384 11 [ffff9fe16202fc78] rtnetlink_rcv_msg at ffffffffa8a1a8dd 12 [ffff9fe16202fcf0] netlink_rcv_skb at ffffffffa8a717eb 13 [ffff9fe16202fd40] netlink_unicast at ffffffffa8a70f88 14 [ffff9fe16202fd80] netlink_sendmsg at ffffffffa8a71319 15 [ffff9fe16202fdf0] sock_sendmsg at ffffffffa89df290 16 [ffff9fe16202fe08] __sys_sendto at ffffffffa89e19c8 17 [ffff9fe16202ff30] __x64_sys_sendto at ffffffffa89e1a64 18 [ffff9fe16202ff38] do_syscall_64 at ffffffffa84042b9 19 [ffff9fe16202ff50] entry_SYSCALL_64_after_hwframe at ffffffffa8c0008c So I fix ixgbe_max_channels so that it will not allow a setting of queues to be higher than the num_online_cpus(). And when run to ixgbe_xdp_setup, take the smaller value of num_rx_queues and num_xdp_queues. Fixes: 4a9b32f30f80 ("ixgbe: fix potential RX buffer starvation for AF_XDP") Signed-off-by: Feng Zhou Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 4ca57d5139a0be3cf76c1667a4c0afb16d4a3b02 Author: Rajaravi Krishna Katta Date: Tue Sep 14 18:28:48 2021 +0300 habanalabs: fix resetting args in wait for CS IOCTL In wait for CS IOCTL code, the driver resets the incoming args structure before returning to the user, regardless of the return value of the IOCTL. In case the IOCTL returns EINTR, resetting the args will result in error in case the userspace will repeat the ioctl call immediately (which is the behavior in the hl-thunk userspace library). The solution is to reset the args only if the driver returns success (0) as a return value for the IOCTL. Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 79a7482249a7353bc86aff8127954d5febf02472 Author: Rahul Lakkireddy Date: Mon Sep 27 21:44:08 2021 +0530 scsi: csiostor: Add module softdep on cxgb4 Both cxgb4 and csiostor drivers run on their own independent Physical Function. But when cxgb4 and csiostor are both being loaded in parallel via modprobe, there is a race when firmware upgrade is attempted by both the drivers. When the cxgb4 driver initiates the firmware upgrade, it halts the firmware and the chip until upgrade is complete. When the csiostor driver is coming up in parallel, the firmware mailbox communication fails with timeouts and the csiostor driver probe fails. Add a module soft dependency on cxgb4 driver to ensure loading csiostor triggers cxgb4 to load first when available to avoid the firmware upgrade race. Link: https://lore.kernel.org/r/1632759248-15382-1-git-send-email-rahul.lakkireddy@chelsio.com Fixes: a3667aaed569 ("[SCSI] csiostor: Chelsio FCoE offload driver") Signed-off-by: Rahul Lakkireddy Signed-off-by: Martin K. Petersen commit 8e2d81c6b5be0d7629fb50b6f678fc07a4c58fae Author: Arun Easi Date: Fri Sep 24 20:51:54 2021 -0700 scsi: qla2xxx: Fix excessive messages during device logout Disable default logging of some I/O path messages. If desired, the messages can be turned back on by setting ql2xextended_error_logging. Link: https://lore.kernel.org/r/20210925035154.29815-1-njavali@marvell.com Reviewed-by: Ewan D. Milne Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit cced4c0ec7c06f5230a2958907a409c849762293 Author: Colin Ian King Date: Sat Sep 25 00:03:30 2021 +0100 scsi: virtio_scsi: Fix spelling mistake "Unsupport" -> "Unsupported" There are a couple of spelling mistakes in pr_info and pr_err messages. Fix them. Link: https://lore.kernel.org/r/20210924230330.143785-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit dd689ed5aa905daf4ba4c99319a52aad6ea0a796 Author: Jiapeng Chong Date: Fri Sep 24 17:51:53 2021 +0800 scsi: ses: Fix unsigned comparison with less than zero Fix the following coccicheck warning: ./drivers/scsi/ses.c:137:10-16: WARNING: Unsigned expression compared with zero: result > 0. Link: https://lore.kernel.org/r/1632477113-90378-1-git-send-email-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Martin K. Petersen commit e8c2da7e329ce004fee748b921e4c765dc2fa338 Author: Jonathan Hsu Date: Fri Sep 24 16:58:48 2021 +0800 scsi: ufs: Fix illegal offset in UPIU event trace Fix incorrect index for UTMRD reference in ufshcd_add_tm_upiu_trace(). Link: https://lore.kernel.org/r/20210924085848.25500-1-jonathan.hsu@mediatek.com Fixes: 4b42d557a8ad ("scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs") Cc: stable@vger.kernel.org Reviewed-by: Stanley Chu Reviewed-by: Bart Van Assche Signed-off-by: Jonathan Hsu Signed-off-by: Martin K. Petersen commit 1018bf24550fd0feec14648309a0aeb62401f4dc Author: Enzo Matsumiya Date: Tue Sep 28 19:56:34 2021 -0300 ksmbd: fix documentation for 2 functions ksmbd_kthread_fn() and create_socket() returns 0 or error code, and not task_struct/ERR_PTR. Signed-off-by: Enzo Matsumiya Acked-by: Namjae Jeon Signed-off-by: Steve French commit f936bb42aeb94a069bec7c9e04100d199c372956 Author: Thomas Gleixner Date: Tue Sep 28 16:10:49 2021 +0200 net: bridge: mcast: Associate the seqcount with its protecting lock. The sequence count bridge_mcast_querier::seq is protected by net_bridge::multicast_lock but seqcount_init() does not associate the seqcount with the lock. This leads to a warning on PREEMPT_RT because preemption is still enabled. Let seqcount_init() associate the seqcount with lock that protects the write section. Remove lockdep_assert_held_once() because lockdep already checks whether the associated lock is held. Fixes: 67b746f94ff39 ("net: bridge: mcast: make sure querier port/address updates are consistent") Reported-by: Mike Galbraith Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Tested-by: Mike Galbraith Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20210928141049.593833-1-bigeasy@linutronix.de Signed-off-by: Jakub Kicinski commit 9e28cfead2f8f5aba7df03c74c9ec645b5ffc5fd Author: Cai Huoqing Date: Tue Sep 28 21:48:49 2021 +0800 net: mdio-ipq4019: Fix the error for an optional regs resource The second resource is optional which is only provided on the chipset IPQ5018. But the blamed commit ignores that and if the resource is not there it just fails. the resource is used like this, if (priv->eth_ldo_rdy) { val = readl(priv->eth_ldo_rdy); val |= BIT(0); writel(val, priv->eth_ldo_rdy); fsleep(IPQ_PHY_SET_DELAY_US); } This patch reverts that to still allow the second resource to be optional because other SoC have the some MDIO controller and doesn't need to second resource. Fixes: fa14d03e014a ("net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()") Signed-off-by: Cai Huoqing Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210928134849.2092-1-caihuoqing@baidu.com Signed-off-by: Jakub Kicinski commit 571fa247ab411f3233eeaaf837c6e646a513b9f8 Author: Kumar Kartikeya Dwivedi Date: Tue Sep 28 11:16:08 2021 +0530 samples: bpf: Fix vmlinux.h generation for XDP samples Generate vmlinux.h only from the in-tree vmlinux, and remove enum declarations that would cause a build failure in case of version mismatches. There are now two options when building the samples: 1. Compile the kernel to use in-tree vmlinux for vmlinux.h 2. Override VMLINUX_BTF for samples using something like this: make VMLINUX_BTF=/sys/kernel/btf/vmlinux -C samples/bpf This change was tested with relative builds, e.g. cases like: * make O=build -C samples/bpf * make KBUILD_OUTPUT=build -C samples/bpf * make -C samples/bpf * cd samples/bpf && make When a suitable VMLINUX_BTF is not found, the following message is printed: /home/kkd/src/linux/samples/bpf/Makefile:333: *** Cannot find a vmlinux for VMLINUX_BTF at any of " ./vmlinux", build the kernel or set VMLINUX_BTF variable. Stop. Fixes: 384b6b3bbf0d (samples: bpf: Add vmlinux.h generation support) Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210928054608.1799021-1-memxor@gmail.com commit a4e6f95a891ac08bd09d62e3e6dae239b150f4c1 Merge: 62da74a735702 28406a2199915 Author: Linus Torvalds Date: Tue Sep 28 16:10:42 2021 -0700 Merge tag 'pinctrl-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Some few pin control fixes for the v5.15 kernel cycle. The most critical is the AMD fixes. - Fix wakeup interrupts in the AMD driver affecting AMD laptops. - Fix parent irqspec translation in the Qualcomm SPMI GPIO driver. - Fix deferred probe handling in the Rockchip driver, this is a stopgap solution while we look for something more elegant. - Add PM suspend callbacks to the Qualcomm SC7280 driver. - Some minor doc fix (should have come in earlier, sorry)" * tag 'pinctrl-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: qcom: sc7280: Add PM suspend callbacks gpio/rockchip: fetch deferred output settings on probe pinctrl/rockchip: add a queue for deferred pin output settings on probe pinctrl: qcom: spmi-gpio: correct parent irqspec translation pinctrl: amd: Handle wake-up interrupt pinctrl: amd: Add irq field data pinctrl: core: Remove duplicated word from devm_pinctrl_unregister() commit 62da74a735702e62ca910d41b4bb760bbd968e3a Merge: e7bd807e8c9e3 42de956ca7e5f Author: Linus Torvalds Date: Tue Sep 28 16:06:31 2021 -0700 Merge tag 'vfio-v5.15-rc4' of git://github.com/awilliam/linux-vfio Pull VFIO fixes from Alex Williamson: - Fix vfio-ap leak on uninit (Jason Gunthorpe) - Add missing prototype arg name (Colin Ian King) * tag 'vfio-v5.15-rc4' of git://github.com/awilliam/linux-vfio: vfio/ap_ops: Add missed vfio_uninit_group_dev() vfio/pci: add missing identifier name in argument of function prototype commit 4b65021a63a21791790960001b79dc5fd4af9ced Merge: 09540fa337196 fa2a30f8e0aa9 Author: Stephen Boyd Date: Tue Sep 28 15:16:48 2021 -0700 Merge tag 'renesas-clk-for-v5.15-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-fixes Pull Renesas clk driver fixes from Geert Uytterhoeven: - Fix inverted logic in RZ/G2L .is_enabled() function * tag 'renesas-clk-for-v5.15-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rzg2l: Fix clk status function clk: renesas: r9a07g044: Mark IA55_CLK and DMAC_ACLK critical commit e7bd807e8c9e37b0eef24e13df1f0619c39dc559 Merge: dca50f08a03eb 9fde034864025 Author: Linus Torvalds Date: Tue Sep 28 13:24:43 2021 -0700 Merge tag 'm68k-for-v5.15-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull more m68k updates from Geert Uytterhoeven: - signal handling fixes - removal of set_fs() [ The set_fs removal isn't strictly a fix, but it's been pending for a while and is very welcome. The signal handling fixes resolved an issue that was incorrectly attributed to the set_fs changes - Linus ] * tag 'm68k-for-v5.15-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Remove set_fs() m68k: Provide __{get,put}_kernel_nofault m68k: Factor the 8-byte lowlevel {get,put}_user code into helpers m68k: Use BUILD_BUG for passing invalid sizes to get_user/put_user m68k: Remove the 030 case in virt_to_phys_slow m68k: Document that access_ok is broken for !CONFIG_CPU_HAS_ADDRESS_SPACES m68k: Leave stack mangling to asm wrapper of sigreturn() m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal m68k: Handle arrivals of multiple signals correctly commit dca50f08a03eba5bc7a6afecca3f8ab0029b7a6e Merge: 6fd3ec5c7af58 9523b33cc31cf Author: Linus Torvalds Date: Tue Sep 28 13:16:52 2021 -0700 Merge tag 'nios2_fixes_for_v5.15_part1' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux Pull nios2 fixes from Dinh Nguyen: - Fix build warning for unmet dependency for EARLY_PRINTK - Remove unused dram_start() function * tag 'nios2_fixes_for_v5.15_part1' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: NIOS2: setup.c: drop unused variable 'dram_start' NIOS2: fix kconfig unmet dependency warning for SERIAL_CORE_CONSOLE commit 26db706a6d77b9e184feb11725e97e53b7a89519 Author: Prike Liang Date: Wed Aug 25 13:36:38 2021 +0800 drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix In the s2idle stress test sdma resume fail occasionally,in the failed case GPU is in the gfxoff state.This issue may introduce by firmware miss handle doorbell S/R and now temporary fix the issue by forcing exit gfxoff for sdma resume. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 98122e63a7ecc08c4172a17d97a06ef5536eb268 Author: Simon Ser Date: Mon Sep 27 15:08:44 2021 +0000 drm/amdgpu: check tiling flags when creating FB on GFX8- On GFX9+, format modifiers are always enabled and ensure the frame-buffers can be scanned out at ADDFB2 time. On GFX8-, format modifiers are not supported and no other check is performed. This means ADDFB2 IOCTLs will succeed even if the tiling isn't supported for scan-out, and will result in garbage displayed on screen [1]. Fix this by adding a check for tiling flags for GFX8 and older. The check is taken from radeonsi in Mesa (see how is_displayable is populated in gfx6_compute_surface). Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel) [1]: https://github.com/swaywm/wlroots/issues/3185 Signed-off-by: Simon Ser Acked-by: Michel Dänzer Cc: Alex Deucher Cc: Harry Wentland Cc: Nicholas Kazlauskas Cc: Bas Nieuwenhuizen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d942856865c733ff60450de9691af796ad71d7bc Author: Charlene Liu Date: Mon Sep 20 14:30:02 2021 -0400 drm/amd/display: Pass PCI deviceid into DC [why] pci deviceid not passed to dal dc, without proper break, dcn2.x falls into dcn3.x code path [how] pass in pci deviceid, and break once dal_version initialized. Reviewed-by: Zhan Liu Acked-by: Anson Jacob Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 467a51b69d0828887fb1b6719159a6b16da688f8 Author: Josip Pavic Date: Fri Sep 17 11:01:47 2021 -0400 drm/amd/display: initialize backlight_ramping_override to false [Why] Stack variable params.backlight_ramping_override is uninitialized, so it contains junk data [How] Initialize the variable to false Reviewed-by: Roman Li Acked-by: Anson Jacob Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9f52c25f59b504a29dda42d83ac1e24d2af535d4 Author: Hawking Zhang Date: Sun Sep 26 22:19:35 2021 +0800 drm/amdgpu: correct initial cp_hqd_quantum for gfx9 didn't read the value of mmCP_HQD_QUANTUM from correct register offset Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 083fa05bbaf65a01866b5440031c822e32ad7510 Author: Praful Swarnakar Date: Wed Sep 22 23:01:29 2021 +0530 drm/amd/display: Fix Display Flicker on embedded panels [Why] ASSR is dependent on Signed PSP Verstage to enable Content Protection for eDP panels. Unsigned PSP verstage is used during development phase causing ASSR to FAIL. As a result, link training is performed with DP_PANEL_MODE_DEFAULT instead of DP_PANEL_MODE_EDP for eDP panels that causes display flicker on some panels. [How] - Do not change panel mode, if ASSR is disabled - Just report and continue to perform eDP link training with right settings further. Signed-off-by: Praful Swarnakar Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 66805763a97f8f7bdf742fc0851d85c02ed9411f Author: Leslie Shi Date: Thu Sep 23 16:05:31 2021 +0800 drm/amdgpu: fix gart.bo pin_count leak gmc_v{9,10}_0_gart_disable() isn't called matched with correspoding gart_enbale function in SRIOV case. This will lead to gart.bo pin_count leak on driver unload. Cc: Hawking Zhang Signed-off-by: Leslie Shi Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit df38d852c6814cbbd010d81e84efb9dc057d5ba6 Author: Hou Tao Date: Tue Sep 28 22:07:50 2021 +0800 kernfs: also call kernfs_set_rev() for positive dentry A KMSAN warning is reported by Alexander Potapenko: BUG: KMSAN: uninit-value in kernfs_dop_revalidate+0x61f/0x840 fs/kernfs/dir.c:1053 kernfs_dop_revalidate+0x61f/0x840 fs/kernfs/dir.c:1053 d_revalidate fs/namei.c:854 lookup_dcache fs/namei.c:1522 __lookup_hash+0x3a6/0x590 fs/namei.c:1543 filename_create+0x312/0x7c0 fs/namei.c:3657 do_mkdirat+0x103/0x930 fs/namei.c:3900 __do_sys_mkdir fs/namei.c:3931 __se_sys_mkdir fs/namei.c:3929 __x64_sys_mkdir+0xda/0x120 fs/namei.c:3929 do_syscall_x64 arch/x86/entry/common.c:51 It seems a positive dentry in kernfs becomes a negative dentry directly through d_delete() in vfs_rmdir(). dentry->d_time is uninitialized when accessing it in kernfs_dop_revalidate(), because it is only initialized when created as negative dentry in kernfs_iop_lookup(). The problem can be reproduced by the following command: cd /sys/fs/cgroup/pids && mkdir hi && stat hi && rmdir hi && stat hi A simple fixes seems to be initializing d->d_time for positive dentry in kernfs_iop_lookup() as well. The downside is the negative dentry will be revalidated again after it becomes negative in d_delete(), because the revison of its parent must have been increased due to its removal. Alternative solution is implement .d_iput for kernfs, and assign d_time for the newly-generated negative dentry in it. But we may need to take kernfs_rwsem to protect again the concurrent kernfs_link_sibling() on the parent directory, it is a little over-killing. Now the simple fix is chosen. Link: https://marc.info/?l=linux-fsdevel&m=163249838610499 Fixes: c7e7c04274b1 ("kernfs: use VFS negative dentry caching") Reported-by: Alexander Potapenko Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20210928140750.1274441-1-houtao1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 25b5476a294cd5f7c7730f334f6b400d30bb783d Author: Janosch Frank Date: Fri Sep 10 08:04:20 2021 +0000 KVM: s390: Function documentation fixes The latest compile changes pointed us to a few instances where we use the kernel documentation style but don't explain all variables or don't adhere to it 100%. It's easy to fix so let's do that. Signed-off-by: Janosch Frank Signed-off-by: Christian Borntraeger commit e02c16b9cd24925ea627f007df9ca9ee00eaaa62 Author: Oliver Upton Date: Mon Sep 27 22:36:21 2021 +0000 selftests: KVM: Don't clobber XMM register when read There is no need to clobber a register that is only being read from. Oops. Drop the XMM register from the clobbers list. Signed-off-by: Oliver Upton Message-Id: <20210927223621.50178-1-oupton@google.com> Signed-off-by: Paolo Bonzini commit 6fd3ec5c7af58d5d6b598fba22ac387645af33f4 Merge: d33bec7b3dfa3 80f6e3080bfcf Author: Linus Torvalds Date: Tue Sep 28 07:53:53 2021 -0700 Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fsverity fix from Eric Biggers: "Fix an integer overflow when computing the Merkle tree layout of extremely large files, exposed by btrfs adding support for fs-verity" * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fs-verity: fix signed integer overflow with i_size near S64_MAX commit 603a1621caa097be23c7784e36cb8edf23cd31db Author: Arnd Bergmann Date: Mon Sep 27 14:16:35 2021 +0200 mwifiex: avoid null-pointer-subtraction warning clang complains about some NULL pointer arithmetic in this driver: drivers/net/wireless/marvell/mwifiex/sta_tx.c:65:59: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] pad = ((void *)skb->data - (sizeof(*local_tx_pd) + hroom)- ^ drivers/net/wireless/marvell/mwifiex/uap_txrx.c:478:53: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] pad = ((void *)skb->data - (sizeof(*txpd) + hroom) - NULL) & Rework that expression to do the same thing using a uintptr_t. Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210927121656.940304-1-arnd@kernel.org commit d33bec7b3dfa36691ed53ccaaf187d90b53be852 Merge: 0c72b292de0b2 be9c6bad9b464 Author: Linus Torvalds Date: Tue Sep 28 07:27:29 2021 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio/vdpa fixes from Michael Tsirkin: "Fixes up some issues in rc1" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vdpa: potential uninitialized return in vhost_vdpa_va_map() vdpa/mlx5: Avoid executing set_vq_ready() if device is reset vdpa/mlx5: Clear ready indication for control VQ vduse: Cleanup the old kernel states after reset failure vduse: missing error code in vduse_init() virtio: don't fail on !of_device_is_compatible commit 0c72b292de0b2865f21e5ffc9bed2b36b8c8e693 Merge: 0513e464f9007 b81bede4d138c Author: Linus Torvalds Date: Tue Sep 28 07:24:47 2021 -0700 Merge tag 'mmc-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - renesas_sdhi: Fix regression with hard reset on old SDHIs - dw_mmc: Only inject fault before done/error * tag 'mmc-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: renesas_sdhi: fix regression with hard reset on old SDHIs mmc: dw_mmc: Only inject fault before done/error commit 4ccb9f03fee7b20484187ba7e25a7b9b79fe63d5 Merge: c894b51e2a23c ced185824c89b Author: David S. Miller Date: Tue Sep 28 13:52:46 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2021-09-28 The following pull-request contains BPF updates for your *net* tree. We've added 10 non-merge commits during the last 14 day(s) which contain a total of 11 files changed, 139 insertions(+), 53 deletions(-). The main changes are: 1) Fix MIPS JIT jump code emission for too large offsets, from Piotr Krysiuk. 2) Fix x86 JIT atomic/fetch emission when dst reg maps to rax, from Johan Almbladh. 3) Fix cgroup_sk_alloc corner case when called from interrupt, from Daniel Borkmann. 4) Fix segfault in libbpf's linker for objects without BTF, from Kumar Kartikeya Dwivedi. 5) Fix bpf_jit_charge_modmem for applications with CAP_BPF, from Lorenz Bauer. 6) Fix return value handling for struct_ops BPF programs, from Hou Tao. 7) Various fixes to BPF selftests, from Jiri Benc. ==================== Signed-off-by: David S. Miller , commit ebc69e897e17373fbe1daaff1debaa77583a5284 Author: Jens Axboe Date: Tue Sep 28 06:33:15 2021 -0600 Revert "block, bfq: honor already-setup queue merges" This reverts commit 2d52c58b9c9bdae0ca3df6a1eab5745ab3f7d80b. We have had several folks complain that this causes hangs for them, which is especially problematic as the commit has also hit stable already. As no resolution seems to be forthcoming right now, revert the patch. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214503 Fixes: 2d52c58b9c9b ("block, bfq: honor already-setup queue merges") Signed-off-by: Jens Axboe commit c894b51e2a23c8c00acb3cea5045c5b70691e790 Author: Arnd Bergmann Date: Tue Sep 28 10:58:34 2021 +0200 net: hns3: fix hclge_dbg_dump_tm_pg() stack usage This function copies strings around between multiple buffers including a large on-stack array that causes a build warning on 32-bit systems: drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c: In function 'hclge_dbg_dump_tm_pg': drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:782:1: error: the frame size of 1424 bytes is larger than 1400 bytes [-Werror=frame-larger-than=] The function can probably be cleaned up a lot, to go back to printing directly into the output buffer, but dynamically allocating the structure is a simpler workaround for now. Fixes: 04d96139ddb3 ("net: hns3: refine function hclge_dbg_dump_tm_pri()") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit c6995117b60ef3f7afca8fb41f906e9f459d869a Author: Horatiu Vultur Date: Tue Sep 28 09:17:20 2021 +0200 net: mdio: mscc-miim: Fix the mdio controller According to the documentation the second resource is optional. But the blamed commit ignores that and if the resource is not there it just fails. This patch reverts that to still allow the second resource to be optional because other SoC have the some MDIO controller and doesn't need to second resource. Fixes: 672a1c394950 ("net: mdio: mscc-miim: Make use of the helper function devm_platform_ioremap_resource()") Signed-off-by: Horatiu Vultur Reviewed-by: Cai Huoqing Signed-off-by: David S. Miller commit f4bd73b5a950866f6c6fc98a7b684d307c5d586a Author: Kuniyuki Iwashima Date: Tue Sep 28 09:42:27 2021 +0900 af_unix: Return errno instead of NULL in unix_create1(). unix_create1() returns NULL on error, and the callers assume that it never fails for reasons other than out of memory. So, the callers always return -ENOMEM when unix_create1() fails. However, it also returns NULL when the number of af_unix sockets exceeds twice the limit controlled by sysctl: fs.file-max. In this case, the callers should return -ENFILE like alloc_empty_file(). This patch changes unix_create1() to return the correct error value instead of NULL on error. Out of curiosity, the assumption has been wrong since 1999 due to this change introduced in 2.2.4 [0]. diff -u --recursive --new-file v2.2.3/linux/net/unix/af_unix.c linux/net/unix/af_unix.c --- v2.2.3/linux/net/unix/af_unix.c Tue Jan 19 11:32:53 1999 +++ linux/net/unix/af_unix.c Sun Mar 21 07:22:00 1999 @@ -388,6 +413,9 @@ { struct sock *sk; + if (atomic_read(&unix_nr_socks) >= 2*max_files) + return NULL; + MOD_INC_USE_COUNT; sk = sk_alloc(PF_UNIX, GFP_KERNEL, 1); if (!sk) { [0]: https://cdn.kernel.org/pub/linux/kernel/v2.2/patch-2.2.4.gz Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit a9f5970767d11eadc805d5283f202612c7ba1f59 Author: Eric Dumazet Date: Mon Sep 27 17:29:24 2021 -0700 net: udp: annotate data race around udp_sk(sk)->corkflag up->corkflag field can be read or written without any lock. Annotate accesses to avoid possible syzbot/KCSAN reports. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 103bde372f084206c6972be543ecc247ebbff9f3 Author: Randy Dunlap Date: Mon Sep 27 14:48:23 2021 -0700 net: sun: SUNVNET_COMMON should depend on INET When CONFIG_INET is not set, there are failing references to IPv4 functions, so make this driver depend on INET. Fixes these build errors: sparc64-linux-ld: drivers/net/ethernet/sun/sunvnet_common.o: in function `sunvnet_start_xmit_common': sunvnet_common.c:(.text+0x1a68): undefined reference to `__icmp_send' sparc64-linux-ld: drivers/net/ethernet/sun/sunvnet_common.o: in function `sunvnet_poll_common': sunvnet_common.c:(.text+0x358c): undefined reference to `ip_send_check' Signed-off-by: Randy Dunlap Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Aaron Young Cc: Rashmi Narasimhan Signed-off-by: David S. Miller commit c23bb54f28d61a48008428e8cd320c947993919b Author: Shannon Nelson Date: Mon Sep 27 14:07:18 2021 -0700 ionic: fix gathering of debug stats Don't print stats for which we haven't reserved space as it can cause nasty memory bashing and related bad behaviors. Fixes: aa620993b1e5 ("ionic: pull per-q stats work out of queue loops") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 3fb2a54b414f493a0c83a085cad78d72bfb49d60 Merge: 05e97b3d33cb2 51032e6f17ce9 Author: David S. Miller Date: Tue Sep 28 13:18:33 2021 +0100 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/t nguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2021-09-27 This series contains updates to e100 driver only. Jake corrects under allocation of register buffer due to incorrect calculations and fixes buffer overrun of register dump. ==================== Signed-off-by: David S. Miller commit 05e97b3d33cb25b9d9580b33ea0dd69aa922c529 Author: Arnd Bergmann Date: Mon Sep 27 16:15:24 2021 +0200 dmascc: add CONFIG_VIRT_TO_BUS dependency Many architectures don't define virt_to_bus() any more, as drivers should be using the dma-mapping interfaces where possible: In file included from drivers/net/hamradio/dmascc.c:27: drivers/net/hamradio/dmascc.c: In function 'tx_on': drivers/net/hamradio/dmascc.c:976:30: error: implicit declaration of function 'virt_to_bus'; did you mean 'virt_to_fix'? [-Werror=implicit-function-declaration] 976 | virt_to_bus(priv->tx_buf[priv->tx_tail]) + n); | ^~~~~~~~~~~ arch/arm/include/asm/dma.h:109:52: note: in definition of macro 'set_dma_addr' 109 | __set_dma_addr(chan, (void *)__bus_to_virt(addr)) | ^~~~ Add the Kconfig dependency to prevent this from being built on architectures without virt_to_bus(). Fixes: bc1abb9e55ce ("dmascc: use proper 'virt_to_bus()' rather than casting to 'int'") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 51bb08dd04a05035a64504faa47651d36b0f3125 Author: Arnd Bergmann Date: Mon Sep 27 16:13:02 2021 +0200 net: ks8851: fix link error An object file cannot be built for both loadable module and built-in use at the same time: arm-linux-gnueabi-ld: drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common': ks8851_common.c:(.text+0xf80): undefined reference to `__this_module' Change the ks8851_common code to be a standalone module instead, and use Makefile logic to ensure this is built-in if at least one of its two users is. Fixes: 797047f875b5 ("net: ks8851: Implement Parallel bus operations") Link: https://lore.kernel.org/netdev/20210125121937.3900988-1-arnd@kernel.org/ Reviewed-by: Andrew Lunn Acked-by: Marek Vasut Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 2c964c558641a3bddaee5719c9e6d8805f777812 Author: Pablo Neira Ayuso Date: Sat Sep 25 00:27:38 2021 +0200 netfilter: nf_tables: reverse order in rule replacement expansion Deactivate old rule first, then append the new rule, so rule replacement notification via netlink first reports the deletion of the old rule with handle X in first place, then it adds the new rule (reusing the handle X of the replaced old rule). Note that the abort path releases the transaction that has been created by nft_delrule() on error. Fixes: ca08987885a1 ("netfilter: nf_tables: deactivate expressions in rule replecement routine") Signed-off-by: Pablo Neira Ayuso commit e189ae161dd784aa5d454b0832f818cacc0e131b Author: Pablo Neira Ayuso Date: Tue Sep 21 00:37:03 2021 +0200 netfilter: nf_tables: add position handle in event notification Add position handle to allow to identify the rule location from netlink events. Otherwise, userspace cannot incrementally update a userspace cache through monitoring events. Skip handle dump if the rule has been either inserted (at the beginning of the ruleset) or appended (at the end of the ruleset), the NLM_F_APPEND netlink flag is sufficient in these two cases. Handle NLM_F_REPLACE as NLM_F_APPEND since the rule replacement expansion appends it after the specified rule handle. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso commit 339031bafe6b281cf2dcb8364217288b9fdab555 Author: Florian Westphal Date: Thu Sep 23 16:44:34 2021 +0200 netfilter: conntrack: fix boot failure with nf_conntrack.enable_hooks=1 This is a revert of 7b1957b049 ("netfilter: nf_defrag_ipv4: use net_generic infra") and a partial revert of 8b0adbe3e3 ("netfilter: nf_defrag_ipv6: use net_generic infra"). If conntrack is builtin and kernel is booted with: nf_conntrack.enable_hooks=1 .... kernel will fail to boot due to a NULL deref in nf_defrag_ipv4_enable(): Its called before the ipv4 defrag initcall is made, so net_generic() returns NULL. To resolve this, move the user refcount back to struct net so calls to those functions are possible even before their initcalls have run. Fixes: 7b1957b04956 ("netfilter: nf_defrag_ipv4: use net_generic infra") Fixes: 8b0adbe3e38d ("netfilter: nf_defrag_ipv6: use net_generic infra"). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 0d67e332e6df72f43eaa21228daa3a79e23093f3 Author: Arnd Bergmann Date: Mon Sep 27 14:15:10 2021 +0200 module: fix clang CFI with MODULE_UNLOAD=n When CONFIG_MODULE_UNLOAD is disabled, the module->exit member is not defined, causing a build failure: kernel/module.c:4493:8: error: no member named 'exit' in 'struct module' mod->exit = *exit; add an #ifdef block around this. Fixes: cf68fffb66d6 ("add support for Clang CFI") Acked-by: Kees Cook Reviewed-by: Sami Tolvanen Reviewed-by: Miroslav Benes Signed-off-by: Arnd Bergmann Signed-off-by: Jessica Yu commit ced185824c89b60e65b5a2606954c098320cdfb8 Author: Johan Almbladh Date: Mon Sep 27 13:11:57 2021 +0000 bpf, x86: Fix bpf mapping of atomic fetch implementation Fix the case where the dst register maps to %rax as otherwise this produces an incorrect mapping with the implementation in 981f94c3e921 ("bpf: Add bitwise atomic instructions") as %rax is clobbered given it's part of the cmpxchg as operand. The issue is similar to b29dd96b905f ("bpf, x86: Fix BPF_FETCH atomic and/or/ xor with r0 as src") just that the case of dst register was missed. Before, dst=r0 (%rax) src=r2 (%rsi): [...] c5: mov %rax,%r10 c8: mov 0x0(%rax),%rax <---+ (broken) cc: mov %rax,%r11 | cf: and %rsi,%r11 | d2: lock cmpxchg %r11,0x0(%rax) <---+ d8: jne 0x00000000000000c8 | da: mov %rax,%rsi | dd: mov %r10,%rax | [...] | | After, dst=r0 (%rax) src=r2 (%rsi): | | [...] | da: mov %rax,%r10 | dd: mov 0x0(%r10),%rax <---+ (fixed) e1: mov %rax,%r11 | e4: and %rsi,%r11 | e7: lock cmpxchg %r11,0x0(%r10) <---+ ed: jne 0x00000000000000dd ef: mov %rax,%rsi f2: mov %r10,%rax [...] The remaining combinations were fine as-is though: After, dst=r9 (%r15) src=r0 (%rax): [...] dc: mov %rax,%r10 df: mov 0x0(%r15),%rax e3: mov %rax,%r11 e6: and %r10,%r11 e9: lock cmpxchg %r11,0x0(%r15) ef: jne 0x00000000000000df _ f1: mov %rax,%r10 | (unneeded, but f4: mov %r10,%rax _| not a problem) [...] After, dst=r9 (%r15) src=r4 (%rcx): [...] de: mov %rax,%r10 e1: mov 0x0(%r15),%rax e5: mov %rax,%r11 e8: and %rcx,%r11 eb: lock cmpxchg %r11,0x0(%r15) f1: jne 0x00000000000000e1 f3: mov %rax,%rcx f6: mov %r10,%rax [...] The case of dst == src register is rejected by the verifier and therefore not supported, but x86 JIT also handles this case just fine. After, dst=r0 (%rax) src=r0 (%rax): [...] eb: mov %rax,%r10 ee: mov 0x0(%r10),%rax f2: mov %rax,%r11 f5: and %r10,%r11 f8: lock cmpxchg %r11,0x0(%r10) fe: jne 0x00000000000000ee 100: mov %rax,%r10 103: mov %r10,%rax [...] Fixes: 981f94c3e921 ("bpf: Add bitwise atomic instructions") Reported-by: Johan Almbladh Signed-off-by: Johan Almbladh Co-developed-by: Daniel Borkmann Signed-off-by: Daniel Borkmann Reviewed-by: Brendan Jackman Acked-by: Alexei Starovoitov commit f0b636804c7c4c564efbca5981e3c56b5c6fe0c5 Author: Sven Peter Date: Fri Sep 24 15:45:02 2021 +0200 iommu/dart: Clear sid2group entry when a group is freed sid2groups keeps track of which stream id combinations belong to a iommu_group to assign those correctly to devices. When a iommu_group is freed a stale pointer will however remain in sid2groups. This prevents devices with the same stream id combination to ever be attached again (see below). Fix that by creating a shadow copy of the stream id configuration when a group is allocated for the first time and clear the sid2group entry when that group is freed. # echo 1 >/sys/bus/pci/devices/0000\:03\:00.0/remove pci 0000:03:00.0: Removing from iommu group 1 # echo 1 >/sys/bus/pci/rescan [...] pci 0000:03:00.0: BAR 0: assigned [mem 0x6a0000000-0x6a000ffff 64bit pref] pci 0000:03:00.0: BAR 2: assigned [mem 0x6a0010000-0x6a001ffff 64bit pref] pci 0000:03:00.0: BAR 6: assigned [mem 0x6c0100000-0x6c01007ff pref] tg3 0000:03:00.0: Failed to add to iommu group 1: -2 [...] Fixes: 46d1fb072e76b161 ("iommu/dart: Add DART iommu driver") Reported-by: Marc Zyngier Signed-off-by: Sven Peter Tested-by: Marc Zyngier Link: https://lore.kernel.org/r/20210924134502.15589-1-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit 0b482d0c75bf321b2fd87d215c3d6df095a601d1 Author: Bjorn Helgaas Date: Wed Sep 22 13:47:26 2021 +0800 iommu/vt-d: Drop "0x" prefix from PCI bus & device addresses 719a19335692 ("iommu/vt-d: Tweak the description of a DMA fault") changed the DMA fault reason from hex to decimal. It also added "0x" prefixes to the PCI bus/device, e.g., - DMAR: [INTR-REMAP] Request device [00:00.5] + DMAR: [INTR-REMAP] Request device [0x00:0x00.5] These no longer match dev_printk() and other similar messages in dmar_match_pci_path() and dmar_acpi_insert_dev_scope(). Drop the "0x" prefixes from the bus and device addresses. Fixes: 719a19335692 ("iommu/vt-d: Tweak the description of a DMA fault") Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210903193711.483999-1-helgaas@kernel.org Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210922054726.499110-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 6f87d4e637327b1da3294a7cdad60d49faa32742 Author: Sven Peter Date: Tue Sep 21 17:39:34 2021 +0200 iommu/dart: Remove iommu_flush_ops apple_dart_tlb_flush_{all,walk} expect to get a struct apple_dart_domain but instead get a struct iommu_domain right now. This breaks those two functions and can lead to kernel panics like the one below. DART can only invalidate the entire TLB and apple_dart_iotlb_sync will already flush everything. There's no need to do that again inside those two functions. Let's just drop them. pci 0000:03:00.0: Removing from iommu group 1 Unable to handle kernel paging request at virtual address 0000000100000023 [...] Call trace: _raw_spin_lock_irqsave+0x54/0xbc apple_dart_hw_stream_command.constprop.0+0x2c/0x130 apple_dart_tlb_flush_all+0x48/0x90 free_io_pgtable_ops+0x40/0x70 apple_dart_domain_free+0x2c/0x44 iommu_group_release+0x68/0xac kobject_cleanup+0x4c/0x1fc kobject_cleanup+0x14c/0x1fc kobject_put+0x64/0x84 iommu_group_remove_device+0x110/0x180 iommu_release_device+0x50/0xa0 [...] Fixes: 46d1fb072e76b161 ("iommu/dart: Add DART iommu driver") Reported-by: Marc Zyngier Signed-off-by: Sven Peter Acked-by: Marc Zyngier Tested-by: Marc Zyngier Link: https://lore.kernel.org/r/20210921153934.35647-1-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit f2ff7147c6834f244b8ce636b12e71a3bd044629 Author: Thomas Gleixner Date: Thu Sep 23 18:04:25 2021 +0200 ALSA: pcsp: Make hrtimer forwarding more robust The hrtimer callback pcsp_do_timer() prepares rearming of the timer with hrtimer_forward(). hrtimer_forward() is intended to provide a mechanism to forward the expiry time of the hrtimer by a multiple of the period argument so that the expiry time greater than the time provided in the 'now' argument. pcsp_do_timer() invokes hrtimer_forward() with the current timer expiry time as 'now' argument. That's providing a periodic timer expiry, but is not really robust when the timer callback is delayed so that the resulting new expiry time is already in the past which causes the callback to be invoked immediately again. If the timer is delayed then the back to back invocation is not really making it better than skipping the missed periods. Sound is distorted in any case. Use hrtimer_forward_now() which ensures that the next expiry is in the future. This prevents hogging the CPU in the timer expiry code and allows later on to remove hrtimer_forward() from the public interfaces. Signed-off-by: Thomas Gleixner Cc: alsa-devel@alsa-project.org Cc: Takashi Iwai Cc: Jaroslav Kysela Link: https://lore.kernel.org/r/20210923153339.623208460@linutronix.de Signed-off-by: Takashi Iwai commit ebd6823af378c7d91f80cbe83ce07b5f166744e4 Author: Saravana Kannan Date: Wed Sep 15 10:28:07 2021 -0700 driver core: Add debug logs when fwnode links are added/deleted This will help with debugging fw_devlink issues. Reviewed-by: Geert Uytterhoeven Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915172808.620546-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 76f130810b477243ce1312bf5754dc41ce7f91a8 Author: Saravana Kannan Date: Wed Sep 15 10:28:06 2021 -0700 driver core: Create __fwnode_link_del() helper function The same code is repeated in multiple locations. Create a helper function for it. Reviewed-by: Geert Uytterhoeven Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915172808.620546-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 68223eeec70898cd5e42451a9168cd9b2808e248 Author: Saravana Kannan Date: Wed Sep 15 10:28:05 2021 -0700 driver core: Set deferred probe reason when deferred by driver core When the driver core defers the probe of a device, set the deferred probe reason so that it's easier to debug. The deferred probe reason is available in debugfs under devices_deferred. Reviewed-by: Geert Uytterhoeven Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915172808.620546-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 79e2c306667542b8ee2d9a9d947eadc7039f0a3c Author: Jiri Benc Date: Thu Sep 23 10:40:22 2021 +0200 selftests, bpf: test_lwt_ip_encap: Really disable rp_filter It's not enough to set net.ipv4.conf.all.rp_filter=0, that does not override a greater rp_filter value on the individual interfaces. We also need to set net.ipv4.conf.default.rp_filter=0 before creating the interfaces. That way, they'll also get their own rp_filter value of zero. Fixes: 0fde56e4385b0 ("selftests: bpf: add test_lwt_ip_encap selftest") Signed-off-by: Jiri Benc Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/b1cdd9d469f09ea6e01e9c89a6071c79b7380f89.1632386362.git.jbenc@redhat.com commit d888eaac4fb1df30320bb1305a8f78efe86524c6 Author: Jiri Benc Date: Mon Sep 27 18:01:36 2021 +0200 selftests, bpf: Fix makefile dependencies on libbpf When building bpf selftest with make -j, I'm randomly getting build failures such as this one: In file included from progs/bpf_flow.c:19: [...]/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:11:10: fatal error: 'bpf_helper_defs.h' file not found #include "bpf_helper_defs.h" ^~~~~~~~~~~~~~~~~~~ The file that fails the build varies between runs but it's always in the progs/ subdir. The reason is a missing make dependency on libbpf for the .o files in progs/. There was a dependency before commit 3ac2e20fba07e but that commit removed it to prevent unneeded rebuilds. However, that only works if libbpf has been built already; the 'wildcard' prerequisite does not trigger when there's no bpf_helper_defs.h generated yet. Keep the libbpf as an order-only prerequisite to satisfy both goals. It is always built before the progs/ objects but it does not trigger unnecessary rebuilds by itself. Fixes: 3ac2e20fba07e ("selftests/bpf: BPF object files should depend only on libbpf headers") Signed-off-by: Jiri Benc Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/ee84ab66436fba05a197f952af23c98d90eb6243.1632758415.git.jbenc@redhat.com commit 435b08ec0094ac1e128afe6cfd0d9311a8c617a7 Author: Daniel Borkmann Date: Mon Sep 27 14:39:21 2021 +0200 bpf, test, cgroup: Use sk_{alloc,free} for test cases BPF test infra has some hacks in place which kzalloc() a socket and perform minimum init via sock_net_set() and sock_init_data(). As a result, the sk's skcd->cgroup is NULL since it didn't go through proper initialization as it would have been the case from sk_alloc(). Rather than re-adding a NULL test in sock_cgroup_ptr() just for this, use sk_{alloc,free}() pair for the test socket. The latter also allows to get rid of the bpf_sk_storage_free() special case. Fixes: 8520e224f547 ("bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode") Fixes: b7a1848e8398 ("bpf: add BPF_PROG_TEST_RUN support for flow dissector") Fixes: 2cb494a36c98 ("bpf: add tests for direct packet access from CGROUP_SKB") Reported-by: syzbot+664b58e9a40fbb2cec71@syzkaller.appspotmail.com Reported-by: syzbot+33f36d0754d4c5c0e102@syzkaller.appspotmail.com Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Tested-by: syzbot+664b58e9a40fbb2cec71@syzkaller.appspotmail.com Tested-by: syzbot+33f36d0754d4c5c0e102@syzkaller.appspotmail.com Link: https://lore.kernel.org/bpf/20210927123921.21535-2-daniel@iogearbox.net commit 78cc316e9583067884eb8bd154301dc1e9ee945c Author: Daniel Borkmann Date: Mon Sep 27 14:39:20 2021 +0200 bpf, cgroup: Assign cgroup in cgroup_sk_alloc when called from interrupt If cgroup_sk_alloc() is called from interrupt context, then just assign the root cgroup to skcd->cgroup. Prior to commit 8520e224f547 ("bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode") we would just return, and later on in sock_cgroup_ptr(), we were NULL-testing the cgroup in fast-path, and iff indeed NULL returning the root cgroup (v ?: &cgrp_dfl_root.cgrp). Rather than re-adding the NULL-test to the fast-path we can just assign it once from cgroup_sk_alloc() given v1/v2 handling has been simplified. The migration from NULL test with returning &cgrp_dfl_root.cgrp to assigning &cgrp_dfl_root.cgrp directly does /not/ change behavior for callers of sock_cgroup_ptr(). syzkaller was able to trigger a splat in the legacy netrom code base, where the RX handler in nr_rx_frame() calls nr_make_new() which calls sk_alloc() and therefore cgroup_sk_alloc() with in_interrupt() condition. Thus the NULL skcd->cgroup, where it trips over on cgroup_sk_free() side given it expects a non-NULL object. There are a few other candidates aside from netrom which have similar pattern where in their accept-like implementation, they just call to sk_alloc() and thus cgroup_sk_alloc() instead of sk_clone_lock() with the corresponding cgroup_sk_clone() which then inherits the cgroup from the parent socket. None of them are related to core protocols where BPF cgroup programs are running from. However, in future, they should follow to implement a similar inheritance mechanism. Additionally, with a !CONFIG_CGROUP_NET_PRIO and !CONFIG_CGROUP_NET_CLASSID configuration, the same issue was exposed also prior to 8520e224f547 due to commit e876ecc67db8 ("cgroup: memcg: net: do not associate sock with unrelated cgroup") which added the early in_interrupt() return back then. Fixes: 8520e224f547 ("bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode") Fixes: e876ecc67db8 ("cgroup: memcg: net: do not associate sock with unrelated cgroup") Reported-by: syzbot+df709157a4ecaf192b03@syzkaller.appspotmail.com Reported-by: syzbot+533f389d4026d86a2a95@syzkaller.appspotmail.com Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Tested-by: syzbot+df709157a4ecaf192b03@syzkaller.appspotmail.com Tested-by: syzbot+533f389d4026d86a2a95@syzkaller.appspotmail.com Acked-by: Tejun Heo Link: https://lore.kernel.org/bpf/20210927123921.21535-1-daniel@iogearbox.net commit bcfd367c2839f2126c048fe59700ec1b538e2b06 Author: Kumar Kartikeya Dwivedi Date: Fri Sep 24 08:07:25 2021 +0530 libbpf: Fix segfault in static linker for objects without BTF When a BPF object is compiled without BTF info (without -g), trying to link such objects using bpftool causes a SIGSEGV due to btf__get_nr_types accessing obj->btf which is NULL. Fix this by checking for the NULL pointer, and return error. Reproducer: $ cat a.bpf.c extern int foo(void); int bar(void) { return foo(); } $ cat b.bpf.c int foo(void) { return 0; } $ clang -O2 -target bpf -c a.bpf.c $ clang -O2 -target bpf -c b.bpf.c $ bpftool gen obj out a.bpf.o b.bpf.o Segmentation fault (core dumped) After fix: $ bpftool gen obj out a.bpf.o b.bpf.o libbpf: failed to find BTF info for object 'a.bpf.o' Error: failed to link 'a.bpf.o': Unknown error -22 (-22) Fixes: a46349227cd8 (libbpf: Add linker extern resolution support for functions and global variables) Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210924023725.70228-1-memxor@gmail.com commit b3aa173d58b437cde5aae5fdce7071212628731b Author: Dave Marchevsky Date: Fri Sep 24 12:35:57 2021 -0700 MAINTAINERS: Add btf headers to BPF BPF folks maintain these and they're not picked up by the current MAINTAINERS entries. Files caught by the added globs: include/linux/btf.h include/linux/btf_ids.h include/uapi/linux/btf.h Signed-off-by: Dave Marchevsky Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210924193557.3081469-1-davemarchevsky@fb.com commit 8a98ae12fbefdb583a7696de719a1d57e5e940a2 Author: Lorenz Bauer Date: Wed Sep 22 12:11:52 2021 +0100 bpf: Exempt CAP_BPF from checks against bpf_jit_limit When introducing CAP_BPF, bpf_jit_charge_modmem() was not changed to treat programs with CAP_BPF as privileged for the purpose of JIT memory allocation. This means that a program without CAP_BPF can block a program with CAP_BPF from loading a program. Fix this by checking bpf_capable() in bpf_jit_charge_modmem(). Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Signed-off-by: Lorenz Bauer Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210922111153.19843-1-lmb@cloudflare.com commit 1dc1eed46f9fa4cb8a07baa24fb44c96d6dd35c9 Author: Miklos Szeredi Date: Mon Sep 27 11:23:57 2021 +0200 ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO Normally the check at open time suffices, but e.g loop device does set IOCB_DIRECT after doing its own checks (which are not sufficent for overlayfs). Make sure we don't call the underlying filesystem read/write method with the IOCB_DIRECT if it's not supported. Reported-by: Huang Jianan Fixes: 16914e6fc7e1 ("ovl: add ovl_read_iter()") Cc: # v4.19 Tested-by: Huang Jianan Signed-off-by: Miklos Szeredi commit 05812b971c6d605c00987750f422918589aa4486 Merge: 5816b3e6577ea c3dbfb9c49eef Author: Dave Airlie Date: Tue Sep 28 17:05:58 2021 +1000 Merge tag 'drm/tegra/for-5.15-rc3' of ssh://git.freedesktop.org/git/tegra/linux into drm-fixes drm/tegra: Fixes for v5.15-rc3 This contains a fix for an UAPI error that happens when no IOMMU is enabled, as well as a few build warning fixes and plugs a potential memory leak. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20210924143537.1341882-1-thierry.reding@gmail.com commit 151a7c12c4fc8340b51e849e4d1fcb7d794777a5 Author: Soeren Moch Date: Sun Sep 26 22:19:05 2021 +0200 Revert "brcmfmac: use ISO3166 country code and 0 rev as fallback" This reverts commit b0b524f079a23e440dd22b04e369368dde847533. Commit b0b524f079a2 ("brcmfmac: use ISO3166 country code and 0 rev as fallback") changes country setup to directly use ISO3166 country codes if no more specific code is configured. This was done under the assumption that brcmfmac firmwares can handle such simple direct mapping from country codes to firmware ccode values. Unfortunately this is not true for all chipset/firmware combinations. E.g. BCM4359/9 devices stop working as access point with this change, so revert the offending commit to avoid the regression. Signed-off-by: Soeren Moch Cc: stable@vger.kernel.org # 5.14.x Acked-by: Shawn Guo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210926201905.211605-1-smoch@web.de commit fe5c735d0d47b495be6753d6aea4f8f78c909a0a Author: Vladimir Zapolskiy Date: Fri Sep 24 15:21:54 2021 +0300 iwlwifi: pcie: add configuration of a Wi-Fi adapter on Dell XPS 15 There is a Killer AX1650 2x2 Wi-Fi 6 and Bluetooth 5.1 wireless adapter found on Dell XPS 15 (9510) laptop, its configuration was present on Linux v5.7, however accidentally it has been removed from the list of supported devices, let's add it back. The problem is manifested on driver initialization: Intel(R) Wireless WiFi driver for Linux iwlwifi 0000:00:14.3: enabling device (0000 -> 0002) iwlwifi: No config found for PCI dev 43f0/1651, rev=0x354, rfid=0x10a100 iwlwifi: probe of 0000:00:14.3 failed with error -22 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=213939 Fixes: 3f910a25839b ("iwlwifi: pcie: convert all AX101 devices to the device tables") Cc: Julien Wajsberg Signed-off-by: Vladimir Zapolskiy Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210924122154.2376577-1-vladimir.zapolskiy@linaro.org commit b8cf5584ec5b8c67359328b8b03b46657620f304 Author: Namjae Jeon Date: Tue Sep 28 15:04:04 2021 +0900 MAINTAINERS: rename cifs_common to smbfs_common in cifs and ksmbd entry commit 23e91d8b7c5a("cifs: rename cifs_common to smbfs_common") cause the following warning from get_maintainer.pl. ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: fs/cifs_common/ This patch rename cifs_common to smbfs_common in cifs and ksmbd entry. Reported-by: Lukas Bulwahn Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0513e464f9007b70b96740271a948ca5ab6e7dd7 Merge: 9cccec2bf32fa 4da8b121884d8 Author: Linus Torvalds Date: Mon Sep 27 14:06:42 2021 -0700 Merge tag 'perf-tools-fixes-for-v5.15-2021-09-27' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools fixes from Arnaldo Carvalho de Melo: - Fix 'perf test' DWARF unwind for optimized builds. - Fix 'perf test' 'Object code reading' when dealing with samples in @plt symbols. - Fix off-by-one directory paths in the ARM support code. - Fix error message to eliminate confusion in 'perf config' when first creating a config file. - 'perf iostat' fix for system wide operation. - Fix printing of metrics when 'perf iostat' is used with one or more iio_root_ports and unconnected cpus (using -C). - Fix several typos in the documentation files. - Fix spelling mistake "icach" -> "icache" in the power8 JSON vendor files. * tag 'perf-tools-fixes-for-v5.15-2021-09-27' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf iostat: Fix Segmentation fault from NULL 'struct perf_counts_values *' perf iostat: Use system-wide mode if the target cpu_list is unspecified perf config: Refine error message to eliminate confusion perf doc: Fix typos all over the place perf arm: Fix off-by-one directory paths. perf vendor events powerpc: Fix spelling mistake "icach" -> "icache" perf tests: Fix flaky test 'Object code reading' perf test: Fix DWARF unwind for optimized builds. commit 2a2a79577ddae7d5314b2f57ca86b44d794403d5 Author: Mark Brown Date: Mon Sep 27 14:44:03 2021 +0100 fpga: ice40-spi: Add SPI device ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI ID table. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Signed-off-by: Moritz Fischer commit 9cccec2bf32fa2a8039cfcd228b9f3a4f0a4f5aa Merge: e6609f2c07de0 50b078184604f Author: Linus Torvalds Date: Mon Sep 27 13:58:23 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "A bit late... I got sidetracked by back-from-vacation routines and conferences. But most of these patches are already a few weeks old and things look more calm on the mailing list than what this pull request would suggest. x86: - missing TLB flush - nested virtualization fixes for SMM (secure boot on nested hypervisor) and other nested SVM fixes - syscall fuzzing fixes - live migration fix for AMD SEV - mirror VMs now work for SEV-ES too - fixes for reset - possible out-of-bounds access in IOAPIC emulation - fix enlightened VMCS on Windows 2022 ARM: - Add missing FORCE target when building the EL2 object - Fix a PMU probe regression on some platforms Generic: - KCSAN fixes selftests: - random fixes, mostly for clang compilation" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (43 commits) selftests: KVM: Explicitly use movq to read xmm registers selftests: KVM: Call ucall_init when setting up in rseq_test KVM: Remove tlbs_dirty KVM: X86: Synchronize the shadow pagetable before link it KVM: X86: Fix missed remote tlb flush in rmap_write_protect() KVM: x86: nSVM: don't copy virt_ext from vmcb12 KVM: x86: nSVM: test eax for 4K alignment for GP errata workaround KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0 KVM: x86: nSVM: restore int_vector in svm_clear_vintr kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[] KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit KVM: x86: nVMX: don't fail nested VM entry on invalid guest state if !from_vmentry KVM: x86: VMX: synthesize invalid VM exit when emulating invalid guest state KVM: x86: nSVM: refactor svm_leave_smm and smm_enter_smm KVM: x86: SVM: call KVM_REQ_GET_NESTED_STATE_PAGES on exit from SMM mode KVM: x86: reset pdptrs_from_userspace when exiting smm KVM: x86: nSVM: restore the L1 host state prior to resuming nested guest on SMM exit KVM: nVMX: Filter out all unsupported controls when eVMCS was activated KVM: KVM: Use cpumask_available() to check for NULL cpumask when kicking vCPUs KVM: Clean up benign vcpu->cpu data races when kicking vCPUs ... commit e6609f2c07de03b948fd6c37c5eb4ade3a6d785c Merge: c388a18957efd f0c15b360fb65 Author: Linus Torvalds Date: Mon Sep 27 13:05:12 2021 -0700 Merge tag 'media/v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: "A couple of driver fixes: - hantro: Fix check for single irq - cedrus: Fix SUNXI tile size calculation - s5p-jpeg: rename JPEG marker constants to prevent build warnings - ir_toy: prevent device from hanging during transmit" * tag 'media/v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: ir_toy: prevent device from hanging during transmit media: s5p-jpeg: rename JPEG marker constants to prevent build warnings media: cedrus: Fix SUNXI tile size calculation media: hantro: Fix check for single irq commit c388a18957efdf31db8e97ec4d2d4b7dc1ca9a44 Author: Jackie Liu Date: Mon Sep 13 15:32:20 2021 +0800 watchdog/sb_watchdog: fix compilation problem due to COMPILE_TEST Compiling sb_watchdog needs to clearly define SIBYTE_HDR_FEATURES. In arch/mips/sibyte/Platform like: cflags-$(CONFIG_SIBYTE_BCM112X) += \ -I$(srctree)/arch/mips/include/asm/mach-sibyte \ -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL Otherwise, SIBYTE_HDR_FEATURES is SIBYTE_HDR_FMASK_ALL. SIBYTE_HDR_FMASK_ALL is mean: #define SIBYTE_HDR_FMASK_ALL SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL \ | SIBYTE_HDR_FMASK_1480_ALL) So, If not limited to CPU_SB1, we will get such an error: arch/mips/include/asm/sibyte/bcm1480_scd.h:261: error: "M_SPC_CFG_CLEAR" redefined [-Werror] arch/mips/include/asm/sibyte/bcm1480_scd.h:262: error: "M_SPC_CFG_ENABLE" redefined [-Werror] Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible") Signed-off-by: Jackie Liu Reviewed-by: Guenter Roeck Signed-off-by: Linus Torvalds commit d55174cccac2e4c2a58ff68b6b573fc0836f73bd Author: Christoph Hellwig Date: Wed Sep 22 19:34:29 2021 +0200 nvdimm/pmem: fix creating the dax group The recent block layer refactoring broke the way how the pmem driver abused device_add_disk. Fix this by properly passing the attribute groups to device_add_disk. Fixes: 52b85909f85d ("block: fold register_disk into device_add_disk") Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Reviewed-by: Dan Williams Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210922173431.2454024-2-hch@lst.de Signed-off-by: Dan Williams commit f060db99374e80e853ac4916b49f0a903f65e9dc Author: Jia He Date: Wed Sep 22 23:29:19 2021 +0800 ACPI: NFIT: Use fallback node id when numa info in NFIT table is incorrect When ACPI NFIT table is failing to populate correct numa information on arm64, dax_kmem will get NUMA_NO_NODE from the NFIT driver. Without this patch, pmem can't be probed as RAM devices on arm64 guest: $ndctl create-namespace -fe namespace0.0 --mode=devdax --map=dev -s 1g -a 128M kmem dax0.0: rejecting DAX region [mem 0x240400000-0x2bfffffff] with invalid node: -1 kmem: probe of dax0.0 failed with error -22 Suggested-by: Dan Williams Signed-off-by: Jia He Cc: Fixes: c221c0b0308f ("device-dax: "Hotplug" persistent memory for use like normal RAM") Link: https://lore.kernel.org/r/20210922152919.6940-1-justin.he@arm.com Signed-off-by: Dan Williams commit 9b3b353ef330e20bc2d99bf3165cc044cff26a09 Author: Linus Torvalds Date: Mon Sep 27 11:26:21 2021 -0700 vboxfs: fix broken legacy mount signature checking Commit 9d682ea6bcc7 ("vboxsf: Fix the check for the old binary mount-arguments struct") was meant to fix a build error due to sign mismatch in 'char' and the use of character constants, but it just moved the error elsewhere, in that on some architectures characters and signed and on others they are unsigned, and that's just how the C standard works. The proper fix is a simple "don't do that then". The code was just being silly and odd, and it should never have cared about signed vs unsigned characters in the first place, since what it is testing is not four "characters", but four bytes. And the way to compare four bytes is by using "memcmp()". Which compilers will know to just turn into a single 32-bit compare with a constant, as long as you don't have crazy debug options enabled. Link: https://lore.kernel.org/lkml/20210927094123.576521-1-arnd@kernel.org/ Cc: Arnd Bergmann Cc: Hans de Goede Signed-off-by: Linus Torvalds commit e671f0ecfece14940a9bb81981098910ea278cf7 Author: Wenpeng Liang Date: Mon Sep 27 20:55:57 2021 +0800 RDMA/hns: Add the check of the CQE size of the user space If the CQE size of the user space is not the size supported by the hardware, the creation of CQ should be stopped. Fixes: 09a5f210f67e ("RDMA/hns: Add support for CQE in size of 64 Bytes") Link: https://lore.kernel.org/r/20210927125557.15031-3-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit cc26aee100588a3f293921342a307b6309ace193 Author: Wenpeng Liang Date: Mon Sep 27 20:55:56 2021 +0800 RDMA/hns: Fix the size setting error when copying CQE in clean_cq() The size of CQE is different for different versions of hardware, so the driver needs to specify the size of CQE explicitly. Fixes: 09a5f210f67e ("RDMA/hns: Add support for CQE in size of 64 Bytes") Link: https://lore.kernel.org/r/20210927125557.15031-2-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 59c4e190b10cd2d6edccb5c238a3d2bda071a018 Merge: 6840615f85f60 5816b3e6577ea Author: Mark Brown Date: Mon Sep 27 18:38:10 2021 +0100 Merge tag 'v5.15-rc3' into spi-5.15 Linux 5.15-rc3 commit 7d5cfafe8b4006a75b55c2f1fdfdb363f9a5cc98 Author: Guo Zhi Date: Wed Sep 22 21:48:57 2021 +0800 RDMA/hfi1: Fix kernel pointer leak Pointers should be printed with %p or %px rather than cast to 'unsigned long long' and printed with %llx. Change %llx to %p to print the secured pointer. Fixes: 042a00f93aad ("IB/{ipoib,hfi1}: Add a timeout handler for rdma_netdev") Link: https://lore.kernel.org/r/20210922134857.619602-1-qtxuning1999@sjtu.edu.cn Signed-off-by: Guo Zhi Acked-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 78f8876c2d9f6fdeb9ff62ed1911505156cd7b3d Author: Jens Axboe Date: Mon Sep 27 10:04:10 2021 -0600 io-wq: exclusively gate signal based exit on get_signal() return io-wq threads block all signals, except SIGKILL and SIGSTOP. We should not need any extra checking of signal_pending or fatal_signal_pending, rely exclusively on whether or not get_signal() tells us to exit. The original debugging of this issue led to the false positive that we were exiting on non-fatal signals, but that is not the case. The issue was around races with nr_workers accounting. Fixes: 87c169665578 ("io-wq: ensure we exit if thread group is exiting") Fixes: 15e20db2e0ce ("io-wq: only exit on fatal signals") Reported-by: Eric W. Biederman Reported-by: Linus Torvalds Acked-by: "Eric W. Biederman" Signed-off-by: Jens Axboe commit 42d43c92fc577dca59ed74aec7868abec8d6ca6e Merge: 5816b3e6577ea 88a04049c08cd Author: Linus Torvalds Date: Mon Sep 27 09:51:31 2021 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - NULL pointer dereference fixes in amd_sfh driver (Basavaraj Natikar, Evgeny Novikov) - data processing fix for hid-u2fzero (Andrej Shadura) - fix for out-of-bounds write in hid-betop (F.A.Sulaiman) - new device IDs / device-specific quirks * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: amd_sfh: Fix potential NULL pointer dereference HID: u2fzero: ignore incomplete packets without data HID: amd_sfh: Fix potential NULL pointer dereference HID: wacom: Add new Intuos BT (CTL-4100WL/CTL-6100WL) device IDs HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS HID: betop: fix slab-out-of-bounds Write in betop_probe commit 6489f8d0e1d93a3603d8dad8125797559e4cf2a2 Author: Max Filippov Date: Mon Sep 27 09:46:33 2021 -0700 xtensa: call irqchip_init only when CONFIG_USE_OF is selected During boot time kernel configured with OF=y but USE_OF=n displays the following warnings and hangs shortly after starting userspace: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/irq/irqdomain.c:695 irq_create_mapping_affinity+0x29/0xc0 irq_create_mapping_affinity(, 6) called with NULL domain CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.0-rc3-00001-gd67ed2510d28 #30 Call Trace: __warn+0x69/0xc4 warn_slowpath_fmt+0x6c/0x94 irq_create_mapping_affinity+0x29/0xc0 local_timer_setup+0x40/0x88 time_init+0xb1/0xe8 start_kernel+0x31d/0x3f4 _startup+0x13b/0x13b ---[ end trace 1e6630e1c5eda35b ]--- ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at arch/xtensa/kernel/time.c:141 local_timer_setup+0x58/0x88 error: can't map timer irq CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.15.0-rc3-00001-gd67ed2510d28 #30 Call Trace: __warn+0x69/0xc4 warn_slowpath_fmt+0x6c/0x94 local_timer_setup+0x58/0x88 time_init+0xb1/0xe8 start_kernel+0x31d/0x3f4 _startup+0x13b/0x13b ---[ end trace 1e6630e1c5eda35c ]--- Failed to request irq 0 (timer) Fix that by calling irqchip_init only when CONFIG_USE_OF is selected and calling legacy interrupt controller init otherwise. Fixes: da844a81779e ("xtensa: add device trees support") Signed-off-by: Max Filippov commit a2941f6aa71a72be2c82c0a168523a492d093530 Author: Keith Busch Date: Mon Sep 27 08:43:06 2021 -0700 nvme: add command id quirk for apple controllers Some apple controllers use the command id as an index to implementation specific data structures and will fail if the value is out of bounds. The nvme driver's recently introduced command sequence number breaks this controller. Provide a quirk so these spec incompliant controllers can function as before. The driver will not have the ability to detect bad completions when this quirk is used, but we weren't previously checking this anyway. The quirk bit was selected so that it can readily apply to stable. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214509 Cc: Sven Peter Reported-by: Orlando Chamberlain Reported-by: Aditya Garg Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Tested-by: Sven Peter Link: https://lore.kernel.org/r/20210927154306.387437-1-kbusch@kernel.org Signed-off-by: Jens Axboe commit 51032e6f17ce990d06123ad7307f258c50d25aa7 Author: Jacob Keller Date: Wed Sep 8 10:52:37 2021 -0700 e100: fix buffer overrun in e100_get_regs The e100_get_regs function is used to implement a simple register dump for the e100 device. The data is broken into a couple of MAC control registers, and then a series of PHY registers, followed by a memory dump buffer. The total length of the register dump is defined as (1 + E100_PHY_REGS) * sizeof(u32) + sizeof(nic->mem->dump_buf). The logic for filling in the PHY registers uses a convoluted inverted count for loop which counts from E100_PHY_REGS (0x1C) down to 0, and assigns the slots 1 + E100_PHY_REGS - i. The first loop iteration will fill in [1] and the final loop iteration will fill in [1 + 0x1C]. This is actually one more than the supposed number of PHY registers. The memory dump buffer is then filled into the space at [2 + E100_PHY_REGS] which will cause that memcpy to assign 4 bytes past the total size. The end result is that we overrun the total buffer size allocated by the kernel, which could lead to a panic or other issues due to memory corruption. It is difficult to determine the actual total number of registers here. The only 8255x datasheet I could find indicates there are 28 total MDI registers. However, we're reading 29 here, and reading them in reverse! In addition, the ethtool e100 register dump interface appears to read the first PHY register to determine if the device is in MDI or MDIx mode. This doesn't appear to be documented anywhere within the 8255x datasheet. I can only assume it must be in register 28 (the extra register we're reading here). Lets not change any of the intended meaning of what we copy here. Just extend the space by 4 bytes to account for the extra register and continue copying the data out in the same order. Change the E100_PHY_REGS value to be the correct total (29) so that the total register dump size is calculated properly. Fix the offset for where we copy the dump buffer so that it doesn't overrun the total size. Re-write the for loop to use counting up instead of the convoluted down-counting. Correct the mdio_read offset to use the 0-based register offsets, but maintain the bizarre reverse ordering so that we have the ABI expected by applications like ethtool. This requires and additional subtraction of 1. It seems a bit odd but it makes the flow of assignment into the register buffer easier to follow. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Felicitas Hetzelt Signed-off-by: Jacob Keller Tested-by: Jacob Keller Signed-off-by: Tony Nguyen commit 4329c8dc110b25d5f04ed20c6821bb60deff279f Author: Jacob Keller Date: Wed Sep 8 10:52:36 2021 -0700 e100: fix length calculation in e100_get_regs_len commit abf9b902059f ("e100: cleanup unneeded math") tried to simplify e100_get_regs_len and remove a double 'divide and then multiply' calculation that the e100_reg_regs_len function did. This change broke the size calculation entirely as it failed to account for the fact that the numbered registers are actually 4 bytes wide and not 1 byte. This resulted in a significant under allocation of the register buffer used by e100_get_regs. Fix this by properly multiplying the register count by u32 first before adding the size of the dump buffer. Fixes: abf9b902059f ("e100: cleanup unneeded math") Reported-by: Felicitas Hetzelt Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit 2f9602870886af74d97bac23ee6db5f5466d0a49 Author: Shuah Khan Date: Fri Sep 17 17:58:13 2021 -0600 selftests: drivers/dma-buf: Fix implicit declaration warns udmabuf has the following implicit declaration warns: udmabuf.c:30:10: warning: implicit declaration of function 'open'; udmabuf.c:42:8: warning: implicit declaration of function 'fcntl' These are caused due to not including fcntl.h and including just linux/fcntl.h. Fix it to include fcntl.h which will bring in the linux/fcntl.h. In addition, define __EXPORTED_HEADERS__ to bring in F_ADD_SEALS and F_SEAL_SHRINK defines and fix the following error that show up when just fcntl.h is included. udmabuf.c:45:21: error: 'F_ADD_SEALS' undeclared 45 | ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); | ^~~~~~~~~~~ udmabuf.c:45:34: error: 'F_SEAL_SHRINK' undeclared 45 | ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); | ^~~~~~~~~~~~~ Signed-off-by: Shuah Khan commit bb8a4fcb2136508224c596a7e665bdba1d7c3c27 Author: Johan Hovold Date: Fri Sep 17 13:46:21 2021 +0200 ipack: ipoctal: fix module reference leak A reference to the carrier module was taken on every open but was only released once when the final reference to the tty struct was dropped. Fix this by taking the module reference and initialising the tty driver data when installing the tty. Fixes: 82a82340bab6 ("ipoctal: get carrier driver to avoid rmmod") Cc: stable@vger.kernel.org # 3.18 Cc: Federico Vaga Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917114622.5412-6-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 445c8132727728dc297492a7d9fc074af3e94ba3 Author: Johan Hovold Date: Fri Sep 17 13:46:20 2021 +0200 ipack: ipoctal: fix missing allocation-failure check Add the missing error handling when allocating the transmit buffer to avoid dereferencing a NULL pointer in write() should the allocation ever fail. Fixes: ba4dc61fe8c5 ("Staging: ipack: add support for IP-OCTAL mezzanine board") Cc: stable@vger.kernel.org # 3.5 Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917114622.5412-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit cd20d59291d1790dc74248476e928f57fc455189 Author: Johan Hovold Date: Fri Sep 17 13:46:19 2021 +0200 ipack: ipoctal: fix tty-registration error handling Registration of the ipoctal tty devices is unlikely to fail, but if it ever does, make sure not to deregister a never registered tty device (and dereference a NULL pointer) when the driver is later unbound. Fixes: 2afb41d9d30d ("Staging: ipack/devices/ipoctal: Check tty_register_device return value.") Cc: stable@vger.kernel.org # 3.7 Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917114622.5412-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 65c001df517a7bf9be8621b53d43c89f426ce8d6 Author: Johan Hovold Date: Fri Sep 17 13:46:18 2021 +0200 ipack: ipoctal: fix tty registration race Make sure to set the tty class-device driver data before registering the tty to avoid having a racing open() dereference a NULL pointer. Fixes: 9c1d784afc6f ("Staging: ipack/devices/ipoctal: Get rid of ipoctal_list.") Cc: stable@vger.kernel.org # 3.7 Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917114622.5412-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit a89936cce87d60766a75732a9e7e25c51164f47c Author: Johan Hovold Date: Fri Sep 17 13:46:17 2021 +0200 ipack: ipoctal: fix stack information leak The tty driver name is used also after registering the driver and must specifically not be allocated on the stack to avoid leaking information to user space (or triggering an oops). Drivers should not try to encode topology information in the tty device name but this one snuck in through staging without anyone noticing and another driver has since copied this malpractice. Fixing the ABI is a separate issue, but this at least plugs the security hole. Fixes: ba4dc61fe8c5 ("Staging: ipack: add support for IP-OCTAL mezzanine board") Cc: stable@vger.kernel.org # 3.5 Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917114622.5412-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 5c49d1850ddd3240d20dc40b01f593e35a184f38 Author: Zhenzhong Duan Date: Sun Sep 26 09:55:45 2021 +0800 KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue When updating the host's mask for its MSR_IA32_TSX_CTRL user return entry, clear the mask in the found uret MSR instead of vmx->guest_uret_msrs[i]. Modifying guest_uret_msrs directly is completely broken as 'i' does not point at the MSR_IA32_TSX_CTRL entry. In fact, it's guaranteed to be an out-of-bounds accesses as is always set to kvm_nr_uret_msrs in a prior loop. By sheer dumb luck, the fallout is limited to "only" failing to preserve the host's TSX_CTRL_CPUID_CLEAR. The out-of-bounds access is benign as it's guaranteed to clear a bit in a guest MSR value, which are always zero at vCPU creation on both x86-64 and i386. Cc: stable@vger.kernel.org Fixes: 8ea8b8d6f869 ("KVM: VMX: Use common x86's uret MSR list as the one true list") Signed-off-by: Zhenzhong Duan Reviewed-by: Sean Christopherson Message-Id: <20210926015545.281083-1-zhenzhong.duan@intel.com> Signed-off-by: Paolo Bonzini commit 913581b8ae0646ebe2f23c57dab3c3ce69e980c3 Merge: 5816b3e6577ea 13404ac8882f5 Author: Greg Kroah-Hartman Date: Mon Sep 27 17:22:16 2021 +0200 Merge tag 'icc-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-linus Georgi writes: interconnect fixes for v5.15 This contains a few fixes for the sdm660 driver: - sdm660: Fix id of slv_cnoc_mnoc_cfg - sdm660: Correct NOC_QOS_PRIORITY shift and mask - sdm660: Add missing a2noc qos clocks Signed-off-by: Georgi Djakov * tag 'icc-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: sdm660: Add missing a2noc qos clocks dt-bindings: interconnect: sdm660: Add missing a2noc qos clocks interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask interconnect: qcom: sdm660: Fix id of slv_cnoc_mnoc_cfg commit 9523b33cc31cf8ce703f8facee9fd16cba36d5ad Author: Randy Dunlap Date: Fri Sep 24 14:05:25 2021 -0700 NIOS2: setup.c: drop unused variable 'dram_start' This is a nuisance when CONFIG_WERROR is set, so drop the variable declaration since the code that used it was removed. ../arch/nios2/kernel/setup.c: In function 'setup_arch': ../arch/nios2/kernel/setup.c:152:13: warning: unused variable 'dram_start' [-Wunused-variable] 152 | int dram_start; Fixes: 7f7bc20bc41a ("nios2: Don't use _end for calculating min_low_pfn") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Mike Rapoport Cc: Andreas Oetken Signed-off-by: Dinh Nguyen commit d67ed2510d28a1eb33171010d35cf52178cfcbdd Author: Randy Dunlap Date: Fri Sep 24 20:29:51 2021 -0700 xtensa: use CONFIG_USE_OF instead of CONFIG_OF CONFIG_OF can be set by a randconfig or by a user -- without setting the early flattree option (OF_EARLY_FLATTREE). This causes build errors. However, if randconfig or a user sets USE_OF in the Xtensa config, the right kconfig symbols are set to fix the build. Fixes these build errors: ../arch/xtensa/kernel/setup.c:67:19: error: ‘__dtb_start’ undeclared here (not in a function); did you mean ‘dtb_start’? 67 | void *dtb_start = __dtb_start; | ^~~~~~~~~~~ ../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area': ../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration] 201 | if (!of_flat_dt_is_compatible(node, "simple-bus")) ../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration] 204 | ranges = of_get_flat_dt_prop(node, "ranges", &len); ../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion] 204 | ranges = of_get_flat_dt_prop(node, "ranges", &len); | ^ ../arch/xtensa/kernel/setup.c: In function 'early_init_devtree': ../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration] 228 | early_init_dt_scan(params); ../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration] 229 | of_scan_flat_dt(xtensa_dt_io_area, NULL); xtensa-elf-ld: arch/xtensa/mm/mmu.o:(.text+0x0): undefined reference to `xtensa_kio_paddr' Fixes: da844a81779e ("xtensa: add device trees support") Fixes: 6cb971114f63 ("xtensa: remap io area defined in device tree") Signed-off-by: Randy Dunlap Signed-off-by: Max Filippov commit 3b1b6e82fb5e08e2cb355d7b2ee8644ec289de66 Author: Xu Liang Date: Mon Sep 27 15:03:02 2021 +0800 net: phy: enhance GPY115 loopback disable function GPY115 need reset PHY when it comes out from loopback mode if the firmware version number (lower 8 bits) is equal to or below 0x76. Fixes: 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver") Signed-off-by: Xu Liang Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 4da8b121884d84476f3d50d46a471471af1aa9df Author: Like Xu Date: Mon Sep 27 16:11:15 2021 +0800 perf iostat: Fix Segmentation fault from NULL 'struct perf_counts_values *' If the 'perf iostat' user specifies two or more iio_root_ports and also specifies the cpu(s) by -C which is not *connected to all* the above iio ports, the iostat_print_metric() will run into trouble: For example: $ perf iostat list S0-uncore_iio_0<0000:16> S1-uncore_iio_0<0000:97> # <--- CPU 1 is located in the socket S0 $ perf iostat 0000:16,0000:97 -C 1 -- ls port Inbound Read(MB) Inbound Write(MB) Outbound Read(MB) Outbound Write(MB) ../perf-iostat: line 12: 104418 Segmentation fault (core dumped) perf stat --iostat$DELIMITER$* The core-dump stack says, in the above corner case, the returned (struct perf_counts_values *) count will be NULL, and the caller iostat_print_metric() apparently doesn't not handle this case. 433 struct perf_counts_values *count = perf_counts(evsel->counts, die, 0); 434 435 if (count->run && count->ena) { (gdb) p count $1 = (struct perf_counts_values *) 0x0 The deeper reason is that there are actually no statistics from the user specified pair "iostat 0000:X, -C (disconnected) Y ", but let's fix it with minimum cost by adding a NULL check in the user space. Fixes: f9ed693e8bc0e7de ("perf stat: Enable iostat mode for x86 platforms") Signed-off-by: Like Xu Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210927081115.39568-2-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo commit ca48aa4ab8bfe0c235cf86cd0d3c11db0808132e Merge: 3ebaaad4bf47e 33092aca857bf Author: David S. Miller Date: Mon Sep 27 13:39:39 2021 +0100 Merge tag 'mac80211-for-net-2021-09-27' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes berg says: ==================== Some fixes: * potential use-after-free in CCMP/GCMP RX processing * potential use-after-free in TX A-MSDU processing * revert to low data rates for no-ack as the commit broke other things * limit VHT MCS/NSS in radiotap injection * drop frames with invalid addresses in IBSS mode * check rhashtable_init() return value in mesh * fix potentially unaligned access in mesh * fix late beacon hrtimer handling in hwsim (syzbot) * fix documentation for PTK0 rekeying ==================== Signed-off-by: David S. Miller commit e4fe5d7349e0b1c0d3da5b6b3e1efce591e85bd2 Author: Like Xu Date: Mon Sep 27 16:11:14 2021 +0800 perf iostat: Use system-wide mode if the target cpu_list is unspecified An iostate use case like "perf iostat 0000:16,0000:97 -- ls" should be implemented to work in system-wide mode to ensure that the output from print_header() is consistent with the user documentation perf-iostat.txt, rather than incorrectly assuming that the kernel does not support it: Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) \ for event (uncore_iio_0/event=0x83,umask=0x04,ch_mask=0xF,fc_mask=0x07/). /bin/dmesg | grep -i perf may provide additional information. This error is easily fixed by assigning system-wide mode by default for IOSTAT_RUN only when the target cpu_list is unspecified. Fixes: f07952b179697771 ("perf stat: Basic support for iostat in perf") Signed-off-by: Like Xu Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210927081115.39568-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo commit a827c007c75be4f6038f3d879045fb1ab6385d6b Author: Like Xu Date: Fri Sep 24 19:58:17 2021 +0800 perf config: Refine error message to eliminate confusion If there is no configuration file at first, the user can write any pair of "key.subkey=value" to the newly created configuration file, while value validation against a valid configurable key is *deferred* until the next execution or the implied execution of "perf config ... ". For example: $ rm ~/.perfconfig $ perf config call-graph.dump-size=65529 $ cat ~/.perfconfig # this file is auto-generated. [call-graph] dump-size = 65529 $ perf config call-graph.dump-size=2048 callchain: Incorrect stack dump size (max 65528): 65529 Error: wrong config key-value pair call-graph.dump-size=65529 The user might expect that the second value 2048 is valid and can be updated to the configuration file, but the error message is very confusing because the first value 65529 is not reported as an error during the last configuration. It is recommended not to change the current behavior of delayed validation (as more effort is needed), but to refine the original error message to *clearly indicate* that the cause of the error is the configuration file. Signed-off-by: Like Xu Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210924115817.58689-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo commit 4da6552c5d07bfc88576ed9ad7fc81fce4c3ba41 Author: Like Xu Date: Fri Sep 24 16:19:42 2021 +0800 perf doc: Fix typos all over the place Considering that perf and its subcommands have so many parameters, the documentation is always the first stop for perf beginners. Fixing some spelling errors will relax the eyes of some readers a little bit. s/specicfication/specification/ s/caheline/cacheline/ s/tranasaction/transaction/ s/complan/complain/ s/sched_wakep/sched_wakeup/ s/possble/possible/ s/methology/methodology/ Signed-off-by: Like Xu Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Jonathan Corbet Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210924081942.38368-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo commit c6613bd4a57798ef0aefbcdb28d8c90d4c9cecd8 Author: Ian Rogers Date: Thu Sep 23 08:42:54 2021 -0700 perf arm: Fix off-by-one directory paths. Relative path include works in the regular build due to -I paths but may fail in other situations. v2. Rebase. Comments on v1 were that we should handle include paths differently and it is agreed that can be a sensible refactor but beyond the scope of this change. https://lore.kernel.org/lkml/20210504191227.793712-1-irogers@google.com/ Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sergey Senozhatsky Cc: Stephane Eranian Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210923154254.737657-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 774f2c0890f8aab5d436276ec52a03532256afc7 Author: Colin Ian King Date: Thu Sep 16 09:13:14 2021 +0100 perf vendor events powerpc: Fix spelling mistake "icach" -> "icache" There is a spelling mistake in the description text, fix it. Signed-off-by: Colin King Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Link: http://lore.kernel.org/lkml/20210916081314.41751-1-colin.king@canonical.com Signed-off-by: Arnaldo Carvalho de Melo commit 0f892fd1bd29a25a62c236c5d4f942ee3295ef49 Author: James Clark Date: Mon Sep 6 16:22:38 2021 +0100 perf tests: Fix flaky test 'Object code reading' This test occasionally fails on aarch64 when a sample is taken in free@plt and it fails with "Bytes read differ from those read by objdump". This is because that symbol is near a section boundary in the elf file. Despite the -z option to always output zeros, objdump uses bfd_map_over_sections() to iterate through the elf file so it doesn't see outside of the sections where these zeros are and can't print them. For example this boundary proceeds free@plt in libc with a gap of 48 bytes between .plt and .text: objdump -d -z --start-address=0x23cc8 --stop-address=0x23d08 libc-2.30.so libc-2.30.so: file format elf64-littleaarch64 Disassembly of section .plt: 0000000000023cc8 <*ABS*+0x7fd00@plt+0x8>: 23cc8: 91018210 add x16, x16, #0x60 23ccc: d61f0220 br x17 Disassembly of section .text: 0000000000023d00 : 23d00: a9bf7bfd stp x29, x30, [sp, #-16]! 23d04: 910003fd mov x29, sp Taking a sample in free@plt is very rare because it is so small, but the test can be forced to fail almost every time on any platform by linking the test with a shared library that has a single empty function and calling it in a loop. The fix is to zero the buffers so that when there is a jump in the addresses output by objdump, zeros are already filled in between. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20210906152238.3415467-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 5c34aea341b16e29fde6e6c8d4b18866cd99754d Author: Ian Rogers Date: Wed Sep 22 10:38:12 2021 -0700 perf test: Fix DWARF unwind for optimized builds. To ensure the stack frames are on the stack tail calls optimizations need to be inhibited. If your compiler supports an attribute use it, otherwise use an asm volatile barrier. The barrier fix was suggested here: https://lore.kernel.org/lkml/20201028081123.GT2628@hirez.programming.kicks-ass.net/ Tested with an optimized clang build and by forcing the asm barrier route with an optimized clang build. A GCC bug tracking a proper disable_tail_calls is: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97831 Fixes: 9ae1e990f1ab ("perf tools: Remove broken __no_tail_call attribute") v2. is a rebase. The original fix patch generated quite a lot of discussion over the right place for the fix: https://lore.kernel.org/lkml/20201114000803.909530-1-irogers@google.com/ The patch reflects my preference of it being near the use, so that future code cleanups don't break this somewhat special usage. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ard Biesheuvel Cc: Mark Rutland Cc: Miguel Ojeda Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20210922173812.456348-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3ebaaad4bf47e17e6c4bec81f0143657b0eb93f9 Merge: ab609f25d1985 b9c587fed61cf Author: David S. Miller Date: Mon Sep 27 13:31:10 2021 +0100 Merge branch 'mv88e6xxx-mtu-fixes' Andrew Lunn says: ==================== mv88e6xxx: MTU fixes These three patches fix MTU issues reported by 曹煜. There are two different ways of configuring the MTU in the hardware. The 6161 family is using the wrong method. Some of the marvell switch enforce the MTU when the port is used for CPU/DSA, some don't. Because of the extra header, the MTU needs increasing with this overhead. ==================== Signed-off-by: David S. Miller commit b9c587fed61cf88bd45822c3159644445f6d5aa6 Author: Andrew Lunn Date: Sun Sep 26 19:41:26 2021 +0200 dsa: mv88e6xxx: Include tagger overhead when setting MTU for DSA and CPU ports Same members of the Marvell Ethernet switches impose MTU restrictions on ports used for connecting to the CPU or another switch for DSA. If the MTU is set too low, tagged frames will be discarded. Ensure the worst case tagger overhead is included in setting the MTU for DSA and CPU ports. Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU") Reported by: 曹煜 Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit b92ce2f54c0f0ff781e914ec189c25f7bf1b1ec2 Author: Andrew Lunn Date: Sun Sep 26 19:41:25 2021 +0200 dsa: mv88e6xxx: Fix MTU definition The MTU passed to the DSA driver is the payload size, typically 1500. However, the switch uses the frame size when applying restrictions. Adjust the MTU with the size of the Ethernet header and the frame checksum. The VLAN header also needs to be included when the frame size it per port, but not when it is global. Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU") Reported by: 曹煜 Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit fe23036192c95b66e60d019d2ec1814d0d561ffd Author: Andrew Lunn Date: Sun Sep 26 19:41:24 2021 +0200 dsa: mv88e6xxx: 6161: Use chip wide MAX MTU The datasheets suggests the 6161 uses a per port setting for jumbo frames. Testing has however shown this is not correct, it uses the old style chip wide MTU control. Change the ops in the 6161 structure to reflect this. Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU") Reported by: 曹煜 Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit ab609f25d19858513919369ff3d9a63c02cd9e2e Author: Yanfei Xu Date: Sun Sep 26 12:53:13 2021 +0800 net: mdiobus: Fix memory leak in __mdiobus_register Once device_register() failed, we should call put_device() to decrement reference count for cleanup. Or it will cause memory leak. BUG: memory leak unreferenced object 0xffff888114032e00 (size 256): comm "kworker/1:3", pid 2960, jiffies 4294943572 (age 15.920s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 08 2e 03 14 81 88 ff ff ................ 08 2e 03 14 81 88 ff ff 90 76 65 82 ff ff ff ff .........ve..... backtrace: [] kmalloc include/linux/slab.h:591 [inline] [] kzalloc include/linux/slab.h:721 [inline] [] device_private_init drivers/base/core.c:3203 [inline] [] device_add+0x89b/0xdf0 drivers/base/core.c:3253 [] __mdiobus_register+0xc3/0x450 drivers/net/phy/mdio_bus.c:537 [] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87 [] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline] [] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786 [] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745 [] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396 [] call_driver_probe drivers/base/dd.c:517 [inline] [] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596 [] really_probe drivers/base/dd.c:558 [inline] [] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751 [] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781 [] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898 [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427 [] __device_attach+0x122/0x260 drivers/base/dd.c:969 [] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487 [] device_add+0x5fb/0xdf0 drivers/base/core.c:3359 [] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2170 [] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238 BUG: memory leak unreferenced object 0xffff888116f06900 (size 32): comm "kworker/0:2", pid 2670, jiffies 4294944448 (age 7.160s) hex dump (first 32 bytes): 75 73 62 2d 30 30 31 3a 30 30 33 00 00 00 00 00 usb-001:003..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kstrdup+0x36/0x70 mm/util.c:60 [] kstrdup_const+0x53/0x80 mm/util.c:83 [] kvasprintf_const+0xc2/0x110 lib/kasprintf.c:48 [] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289 [] dev_set_name+0x63/0x90 drivers/base/core.c:3147 [] __mdiobus_register+0xbb/0x450 drivers/net/phy/mdio_bus.c:535 [] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87 [] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline] [] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786 [] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745 [] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396 [] call_driver_probe drivers/base/dd.c:517 [inline] [] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596 [] really_probe drivers/base/dd.c:558 [inline] [] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751 [] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781 [] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898 [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427 [] __device_attach+0x122/0x260 drivers/base/dd.c:969 Reported-by: syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com Signed-off-by: Yanfei Xu Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2974b8a691a94ad5bf29b584dd4fb03829aa43d1 Author: Desnes A. Nunes do Rosario Date: Sat Sep 25 12:14:18 2021 -0300 Revert "ibmvnic: check failover_pending in login response" This reverts commit d437f5aa23aa2b7bd07cd44b839d7546cc17166f. Code has been duplicated through commit <273c29e944bd> "ibmvnic: check failover_pending in login response" Signed-off-by: Desnes A. Nunes do Rosario Signed-off-by: David S. Miller commit 6840615f85f6046039ebc4989870ddb12892b7fc Author: Mark Brown Date: Thu Sep 23 18:00:23 2021 +0100 spi: spidev: Add SPI ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210923170023.1683-1-broonie@kernel.org Signed-off-by: Mark Brown commit 0cc3687eadd0971d5d38ff90d14819d88f854960 Author: Mark Brown Date: Fri Sep 24 20:48:44 2021 +0100 ASoC: cs4341: Add SPI device ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding SPI IDs for parts that only have a compatible listed. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Cc: patches@opensource.cirrus.com Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/20210924194844.45974-1-broonie@kernel.org Signed-off-by: Mark Brown commit ceef3240f9b7e592dd8d10d619c312c7336117fa Author: Mark Brown Date: Fri Sep 24 20:49:56 2021 +0100 ASoC: pcm179x: Add missing entries SPI to device ID table Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding SPI IDs for parts that only have a compatible listed. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210924194956.46079-1-broonie@kernel.org Signed-off-by: Mark Brown commit 172da89ed0eaf9d9348f5decb86ad04c624b39d1 Author: Vineeth Vijayan Date: Fri Sep 10 13:45:24 2021 +0200 s390/cio: avoid excessive path-verification requests Currently when removing a device from cio_ignore list, we trigger a path-verification for all the subchannels available in the system. This could lead to path-verification requests on subchannels with an online device, which could cause unwanted delay. Instead of all the subchannels, trigger the path-verifications to those without an online device. Reported-by: Julian Wiedmann Fixes: 2297791c92d0 ("s390/cio: dont unregister subchannel from child-drivers") Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 763716a55cb1f480ffe1a9702e6b5d9ea1a80a24 Author: Matthew Hagan Date: Sat Sep 25 11:36:27 2021 +0000 net: bgmac-platform: handle mac-address deferral This patch is a replication of Christian Lamparter's "net: bgmac-bcma: handle deferred probe error due to mac-address" patch for the bgmac-platform driver [1]. As is the case with the bgmac-bcma driver, this change is to cover the scenario where the MAC address cannot yet be discovered due to reliance on an nvmem provider which is yet to be instantiated, resulting in a random address being assigned that has to be manually overridden. [1] https://lore.kernel.org/netdev/20210919115725.29064-1-chunkeey@gmail.com Signed-off-by: Matthew Hagan Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 44b6aa2ef69f5b0edf595810236f4ff61503b7e9 Author: Colin Ian King Date: Fri Sep 24 23:31:46 2021 +0100 net: hns: Fix spelling mistake "maped" -> "mapped" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 33092aca857bf35a8e9cac0e8340c685a4796e90 Author: Alexander Wetzel Date: Fri Sep 24 22:05:14 2021 +0200 mac80211: Fix Ptk0 rekey documentation @IEEE80211_KEY_FLAG_GENERATE_IV setting is irrelevant for RX. Move the requirement to the correct section in the PTK0 rekey documentation. Signed-off-by: Alexander Wetzel Link: https://lore.kernel.org/r/20210924200514.7936-1-alexander@wetzel-home.de Signed-off-by: Johannes Berg commit 111461d573741c17eafad029ac93474fa9adcce0 Author: MichelleJin Date: Mon Sep 27 03:34:57 2021 +0000 mac80211: check return value of rhashtable_init When rhashtable_init() fails, it returns -EINVAL. However, since error return value of rhashtable_init is not checked, it can cause use of uninitialized pointers. So, fix unhandled errors of rhashtable_init. Signed-off-by: MichelleJin Link: https://lore.kernel.org/r/20210927033457.1020967-4-shjy180909@gmail.com Signed-off-by: Johannes Berg commit 94513069eb549737bcfc3d988d6ed4da948a2de8 Author: Johannes Berg Date: Mon Sep 27 11:58:39 2021 +0200 mac80211: fix use-after-free in CCMP/GCMP RX When PN checking is done in mac80211, for fragmentation we need to copy the PN to the RX struct so we can later use it to do a comparison, since commit bf30ca922a0c ("mac80211: check defrag PN against current frame"). Unfortunately, in that commit I used the 'hdr' variable without it being necessarily valid, so use-after-free could occur if it was necessary to reallocate (parts of) the frame. Fix this by reloading the variable after the code that results in the reallocations, if any. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=214401. Cc: stable@vger.kernel.org Fixes: bf30ca922a0c ("mac80211: check defrag PN against current frame") Link: https://lore.kernel.org/r/20210927115838.12b9ac6bb233.I1d066acd5408a662c3b6e828122cd314fcb28cdb@changeid Signed-off-by: Johannes Berg commit 4b8bcaf8a6d6ab5db51e30865def5cb694eb2966 Author: Tejas Upadhyay Date: Tue Sep 14 14:34:12 2021 +0530 drm/i915: Remove warning from the rps worker In commit 4e5c8a99e1cb ("drm/i915: Drop i915_request.lock requirement for intel_rps_boost()"), we decoupled the rps worker from the pm so that we could avoid the synchronization penalty which makes the assertion liable to run too early. Which makes warning invalid hence removed. Fixes: 4e5c8a99e1cb ("drm/i915: Drop i915_request.lock requirement for intel_rps_boost()") Reviewed-by: Chris Wilson Signed-off-by: Tejas Upadhyay Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210914090412.1393498-1-tejaskumarx.surendrakumar.upadhyay@intel.com (cherry picked from commit a837a0686308d95ad9c48d32b4dfe86a17dc98c2) Signed-off-by: Jani Nikula commit c83ff0186401169eb27ce5057d820b7a863455c3 Author: Matthew Auld Date: Tue Sep 21 14:42:02 2021 +0100 drm/i915/request: fix early tracepoints Currently we blow up in trace_dma_fence_init, when calling into get_driver_name or get_timeline_name, since both the engine and context might be NULL(or contain some garbage address) in the case of newly allocated slab objects via the request ctor. Note that we also use SLAB_TYPESAFE_BY_RCU here, which allows requests to be immediately freed, but delay freeing the underlying page by an RCU grace period. With this scheme requests can be re-allocated, at the same time as they are also being read by some lockless RCU lookup mechanism. In the ctor case, which is only called for new slab objects(i.e allocate new page and call the ctor for each object) it's safe to reset the context/engine prior to calling into dma_fence_init, since we can be certain that no one is doing an RCU lookup which might depend on peeking at the engine/context, like in active_engine(), since the object can't yet be externally visible. In the recycled case(which might also be externally visible) the request refcount always transitions from 0->1 after we set the context/engine etc, which should ensure it's valid to dereference the engine for example, when doing an RCU list-walk, so long as we can also increment the refcount first. If the refcount is already zero, then the request is considered complete/released. If it's non-zero, then the request might be in the process of being re-allocated, or potentially still in flight, however after successfully incrementing the refcount, it's possible to carefully inspect the request state, to determine if the request is still what we were looking for. Note that all externally visible requests returned to the cache must have zero refcount. One possible fix then is to move dma_fence_init out from the request ctor. Originally this was how it was done, but it was moved in: commit 855e39e65cfc33a73724f1cc644ffc5754864a20 Author: Chris Wilson Date: Mon Feb 3 09:41:48 2020 +0000 drm/i915: Initialise basic fence before acquiring seqno where it looks like intel_timeline_get_seqno() relied on some of the rq->fence state, but that is no longer the case since: commit 12ca695d2c1ed26b2dcbb528b42813bd0f216cfc Author: Maarten Lankhorst Date: Tue Mar 23 16:49:50 2021 +0100 drm/i915: Do not share hwsp across contexts any more, v8. intel_timeline_get_seqno() could also be cleaned up slightly by dropping the request argument. Moving dma_fence_init back out of the ctor, should ensure we have enough of the request initialised in case of trace_dma_fence_init. Functionally this should be the same, and is effectively what we were already open coding before, except now we also assign the fence->lock and fence->ops, but since these are invariant for recycled requests(which might be externally visible), and will therefore already hold the same value, it shouldn't matter. An alternative fix, since we don't yet have a fully initialised request when in the ctor, is just setting the context/engine as NULL, but this does require adding some extra handling in get_driver_name etc. v2(Daniel): - Try to make the commit message less confusing Fixes: 855e39e65cfc ("drm/i915: Initialise basic fence before acquiring seqno") Signed-off-by: Matthew Auld Cc: Michael Mason Cc: Daniel Vetter Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210921134202.3803151-1-matthew.auld@intel.com (cherry picked from commit be988eaee1cb208c4445db46bc3ceaf75f586f0b) Signed-off-by: Jani Nikula commit da0468a744501065d9ce3891f8ba35be2969ae4d Author: Akira Yokosawa Date: Mon Sep 20 16:05:00 2021 +0900 drm/i915/guc, docs: Fix pdfdocs build error by removing nested grid Nested grids in grid-table cells are not specified as proper ReST constructs. Commit 572f2a5cd974 ("drm/i915/guc: Update firmware to v62.0.0") added a couple of kerneldoc tables of the form: +---+-------+------------------------------------------------------+ | 1 | 31:0 | +------------------------------------------------+ | +---+-------+ | | | |...| | | Embedded `HXG Message`_ | | +---+-------+ | | | | n | 31:0 | +------------------------------------------------+ | +---+-------+------------------------------------------------------+ For "make htmldocs", they happen to work as one might expect, but they are incompatible with "make latexdocs" and "make pdfdocs", and cause the generated gpu.tex file to become incomplete and unbuildable by xelatex. Restore the compatibility by removing those nested grids in the tables. Size comparison of generated gpu.tex: Sphinx 2.4.4 Sphinx 4.2.0 v5.14: 3238686 3841631 v5.15-rc1: 376270 432729 with this fix: 3377846 3998095 Fixes: 572f2a5cd974 ("drm/i915/guc: Update firmware to v62.0.0") Cc: John Harrison Cc: Michal Wajdeczko Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Matt Roper Cc: Jonathan Corbet Signed-off-by: Akira Yokosawa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/4a227569-074f-c501-58bb-d0d8f60a8ae9@gmail.com (cherry picked from commit 017792a041183c4f5ec595f386e76a40ed728cfc) Signed-off-by: Jani Nikula commit 5cb8742774d2f376732ab0becaa46d033319db6b Merge: 5816b3e6577ea d168cd797982d Author: Jani Nikula Date: Mon Sep 27 11:59:08 2021 +0300 Merge tag 'gvt-fixes-2021-09-18' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2021-09-18 - ww locking fix from Zhi Signed-off-by: Jani Nikula From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20210918071105.GY14689@zhen-hp.sh.intel.com commit 88a04049c08cd62e698bc1b1af2d09574b9e0aee Author: Basavaraj Natikar Date: Thu Sep 23 17:59:27 2021 +0530 HID: amd_sfh: Fix potential NULL pointer dereference The cl_data field of a privdata must be allocated and updated before using in amd_sfh_hid_client_init() function. Hence handling NULL pointer cl_data accordingly. Fixes: d46ef750ed58 ("HID: amd_sfh: Fix potential NULL pointer dereference") Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit d72a9c158893d537d769a669a5837bc80b0f851c Author: Namjae Jeon Date: Fri Sep 24 09:24:08 2021 +0900 ksmbd: fix invalid request buffer access in compound Ronnie reported invalid request buffer access in chained command when inserting garbage value to NextCommand of compound request. This patch add validation check to avoid this issue. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Tested-by: Steve French Reviewed-by: Steve French Acked-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 18d46769d54aba03c2c3fa666fe810f264b5d7b8 Author: Ronnie Sahlberg Date: Tue Sep 21 14:45:27 2021 +0900 ksmbd: remove RFC1002 check in smb2 request In smb_common.c you have this function : ksmbd_smb_request() which is called from connection.c once you have read the initial 4 bytes for the next length+smb2 blob. It checks the first byte of this 4 byte preamble for valid values, i.e. a NETBIOSoverTCP SESSION_MESSAGE or a SESSION_KEEP_ALIVE. We don't need to check this for ksmbd since it only implements SMB2 over TCP port 445. The netbios stuff was only used in very old servers when SMB ran over TCP port 139. Now that we run over TCP port 445, this is actually not a NB header anymore and you can just treat it as a 4 byte length field that must be less than 16Mbyte. and remove the references to the RFC1002 constants that no longer applies. Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Steve French Cc: Sergey Senozhatsky Acked-by: Hyunchul Lee Signed-off-by: Ronnie Sahlberg Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5816b3e6577eaa676ceb00a848f0fd65fe2adc29 Author: Linus Torvalds Date: Sun Sep 26 14:08:19 2021 -0700 Linux 5.15-rc3 commit 5e5d7597637c64588f5cf4db798664a560fbec67 Merge: 996148ee05d08 265fd1991c1db Author: Linus Torvalds Date: Sun Sep 26 12:46:45 2021 -0700 Merge tag '5.15-rc2-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd fixes from Steve French: "Five fixes for the ksmbd kernel server, including three security fixes: - remove follow symlinks support - use LOOKUP_BENEATH to prevent out of share access - SMB3 compounding security fix - fix for returning the default streams correctly, fixing a bug when writing ppt or doc files from some clients - logging more clearly that ksmbd is experimental (at module load time)" * tag '5.15-rc2-ksmbd-fixes' of git://git.samba.org/ksmbd: ksmbd: use LOOKUP_BENEATH to prevent the out of share access ksmbd: remove follow symlinks support ksmbd: check protocol id in ksmbd_verify_smb_message() ksmbd: add default data stream name in FILE_STREAM_INFORMATION ksmbd: log that server is experimental at module load commit 996148ee05d08ef5163cad99c33a7b5e844ac494 Merge: 299d6e47e8f86 54607282fae61 Author: Linus Torvalds Date: Sun Sep 26 12:18:10 2021 -0700 Merge tag 'edac_urgent_for_v5.15_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fixes from Borislav Petkov: "Fix two EDAC drivers using the wrong value type for the DIMM mode" * tag 'edac_urgent_for_v5.15_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/dmc520: Assign the proper type to dimm->edac_mode EDAC/synopsys: Fix wrong value type assignment for edac_mode commit 299d6e47e8f8665904b9c8c321edb3876c92f68b Merge: 5bb7b2107f8c8 cf96921876dce Author: Linus Torvalds Date: Sun Sep 26 12:11:58 2021 -0700 Merge tag 'thermal-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal fixes from Daniel Lezcano: - Fix thermal shutdown after a suspend/resume due to a wrong TCC value restored on Intel platform (Antoine Tenart) - Fix potential buffer overflow when building the list of policies. The buffer size is not updated after writing to it (Dan Carpenter) - Fix wrong check against IS_ERR instead of NULL (Ansuel Smith) * tag 'thermal-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/tsens: Fix wrong check for tzd in irq handlers thermal/core: Potential buffer overflow in thermal_build_list_of_policies() thermal/drivers/int340x: Do not set a wrong tcc offset on resume commit 5bb7b2107f8c8e97750a36a723f3f74f819f6ff1 Merge: 3a398acc56dd7 5ba1071f7554c Author: Linus Torvalds Date: Sun Sep 26 10:09:20 2021 -0700 Merge tag 'x86-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "A set of fixes for X86: - Prevent sending the wrong signal when protection keys are enabled and the kernel handles a fault in the vsyscall emulation. - Invoke early_reserve_memory() before invoking e820_memory_setup() which is required to make the Xen dom0 e820 hooks work correctly. - Use the correct data type for the SETZ operand in the EMQCMDS instruction wrapper. - Prevent undefined behaviour to the potential unaligned accesss in the instruction decoder library" * tag 'x86-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses x86/asm: Fix SETZ size enqcmds() build failure x86/setup: Call early_reserve_memory() earlier x86/fault: Fix wrong signal when vsyscall fails with pkey commit 3a398acc56dd7592eba081ce1ea356151ab90e2d Merge: dc0f97c2613d0 8cd9da85d2bd8 Author: Linus Torvalds Date: Sun Sep 26 10:00:16 2021 -0700 Merge tag 'timers-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Thomas Gleixner: "A single fix for the recently introduced regression in posix CPU timers which failed to stop the timer when requested. That caused unexpected signals to be sent to the process/thread causing malfunction" * tag 'timers-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: posix-cpu-timers: Prevent spuriously armed 0-value itimer commit dc0f97c2613d09734719ef89d99d06417d92337d Merge: a3b397b4fffb7 f9bfed3ad5b16 Author: Linus Torvalds Date: Sun Sep 26 09:55:22 2021 -0700 Merge tag 'irq-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Thomas Gleixner: "A set of fixes for interrupt chip drivers: - Work around a bad GIC integration on a Renesas platform which can't handle byte-sized MMIO access - Plug a potential memory leak in the GICv4 driver - Fix a regression in the Armada 370-XP IPI code which was caused by issuing EOI instack of ACK. - A couple of small fixes here and there" * tag 'irq-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic: Work around broken Renesas integration irqchip/renesas-rza1: Use semicolons instead of commas irqchip/gic-v3-its: Fix potential VPE leak on error irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build irqchip/mbigen: Repair non-kernel-doc notation irqdomain: Change the type of 'size' in __irq_domain_add() to be consistent irqchip/armada-370-xp: Fix ack/eoi breakage Documentation: Fix irq-domain.rst build warning commit ea1945c2f72d7bd253e2ebaa97cdd8d9ffcde076 Author: Nuno Sá Date: Fri Sep 3 16:14:23 2021 +0200 iio: adis16480: fix devices that do not support sleep mode Not all devices supported by this driver support being put to sleep mode. For those devices, when calling 'adis16480_stop_device()' on the unbind path, we where actually writing in the SYNC_SCALE register. Fixes: 80cbc848c4fa0 ("iio: imu: adis16480: Add support for ADIS16490") Fixes: 82e7a1b250170 ("iio: imu: adis16480: Add support for ADIS1649x family of devices") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20210903141423.517028-6-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit 319aeaf69c85dc39768b3754c1786225e38e2871 Author: Rob Herring Date: Fri Sep 24 16:42:21 2021 -0500 arm: dts: vexpress: Fix motherboard bus 'interrupt-map' Commit 078fb7aa6a83 ("arm: dts: vexpress: Fix addressing issues with 'motherboard-bus' nodes") broke booting on a couple of 32-bit VExpress boards. The problem is #address-cells size changed, but interrupt-map was not updated. This results in the timer interrupt (and all the other motherboard interrupts) not getting mapped. As the 'interrupt-map' properties are all just duplicates across boards, just move them into vexpress-v2m.dtsi and vexpress-v2m-rs1.dtsi. Strictly speaking, 'interrupt-map' is dependent on the parent interrupt controller, but it's not likely we'll ever have a different parent than GICv2 on these old platforms. If there was one, 'interrupt-map' can still be overridden. Link: https://lore.kernel.org/r/20210924214221.1877686-1-robh@kernel.org Fixes: 078fb7aa6a83 ("arm: dts: vexpress: Fix addressing issues with 'motherboard-bus' nodes") Cc: Guillaume Tucker Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: linux-arm-kernel@lists.infradead.org Reported-by: Reported-by: "kernelci.org bot" Signed-off-by: Rob Herring Signed-off-by: Sudeep Holla commit c2980c64c7fd4585d684574c92d1624d44961edd Author: Hui Liu Date: Sun Sep 26 15:30:28 2021 +0800 iio: mtk-auxadc: fix case IIO_CHAN_INFO_PROCESSED The previous driver does't apply the necessary scaling to take the voltage range into account. We change readback value from raw data to input voltage to fix case IIO_CHAN_INFO_PROCESSED. Fixes: ace4cdfe67be ("iio: adc: mt2701: Add Mediatek auxadc driver for mt2701.") Signed-off-by: Hui Liu Link: https://lore.kernel.org/r/20210926073028.11045-2-hui.liu@mediatek.com Cc: Signed-off-by: Jonathan Cameron commit b193e15ac69d56f35e1d8e2b5d16cbd47764d053 Author: 王贇 Date: Fri Sep 24 10:35:58 2021 +0800 net: prevent user from passing illegal stab size We observed below report when playing with netlink sock: UBSAN: shift-out-of-bounds in net/sched/sch_api.c:580:10 shift exponent 249 is too large for 32-bit type CPU: 0 PID: 685 Comm: a.out Not tainted Call Trace: dump_stack_lvl+0x8d/0xcf ubsan_epilogue+0xa/0x4e __ubsan_handle_shift_out_of_bounds+0x161/0x182 __qdisc_calculate_pkt_len+0xf0/0x190 __dev_queue_xmit+0x2ed/0x15b0 it seems like kernel won't check the stab log value passing from user, and will use the insane value later to calculate pkt_len. This patch just add a check on the size/cell_log to avoid insane calculation. Reported-by: Abaci Signed-off-by: Michael Wang Signed-off-by: David S. Miller commit a3b397b4fffb799d25658defafd962f0fb3e9fe0 Merge: bb19237bf6eb7 bcbda81020c3e Author: Linus Torvalds Date: Sat Sep 25 16:20:34 2021 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "16 patches. Subsystems affected by this patch series: xtensa, sh, ocfs2, scripts, lib, and mm (memory-failure, kasan, damon, shmem, tools, pagecache, debug, and pagemap)" * emailed patches from Andrew Morton : mm: fix uninitialized use in overcommit_policy_handler mm/memory_failure: fix the missing pte_unmap() call kasan: always respect CONFIG_KASAN_STACK sh: pgtable-3level: fix cast to pointer from integer of different size mm/debug: sync up latest migrate_reason to migrate_reason_names mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN mm: fs: invalidate bh_lrus for only cold path lib/zlib_inflate/inffast: check config in C to avoid unused function warning tools/vm/page-types: remove dependency on opt_file for idle page tracking scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error ocfs2: drop acl cache for directories too mm/shmem.c: fix judgment error in shmem_is_huge() xtensa: increase size of gcc stack frame check mm/damon: don't use strnlen() with known-bogus source length kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() commit bb19237bf6eb760802bf28d9274e1af1ef1b84e2 Merge: f6f360aef0e70 fbdac19e64289 Author: Linus Torvalds Date: Sat Sep 25 16:05:56 2021 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Thirty-three fixes, I'm afraid. Essentially the build up from the last couple of weeks while I've been dealling with Linux Plumbers conference infrastructure issues. It's mostly the usual assortment of spelling fixes and minor corrections. The only core relevant changes are to the sd driver to reduce the spin up message spew and fix a small memory leak on the freeing path" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (33 commits) scsi: ses: Retry failed Send/Receive Diagnostic commands scsi: target: Fix spelling mistake "CONFLIFT" -> "CONFLICT" scsi: lpfc: Fix gcc -Wstringop-overread warning, again scsi: lpfc: Use correct scnprintf() limit scsi: lpfc: Fix sprintf() overflow in lpfc_display_fpin_wwpn() scsi: core: Remove 'current_tag' scsi: acornscsi: Remove tagged queuing vestiges scsi: fas216: Kill scmd->tag scsi: qla2xxx: Restore initiator in dual mode scsi: ufs: core: Unbreak the reset handler scsi: sd_zbc: Support disks with more than 2**32 logical blocks scsi: ufs: core: Revert "scsi: ufs: Synchronize SCSI and UFS error handling" scsi: bsg: Fix device unregistration scsi: sd: Make sd_spinup_disk() less noisy scsi: ufs: ufs-pci: Fix Intel LKF link stability scsi: mpt3sas: Clean up some inconsistent indenting scsi: megaraid: Clean up some inconsistent indenting scsi: sr: Fix spelling mistake "does'nt" -> "doesn't" scsi: Remove SCSI CDROM MAINTAINERS entry scsi: megaraid: Fix Coccinelle warning ... commit f6f360aef0e70a45cbf43db1dd9df5a5e96d9836 Merge: 2d70de4ee5931 7df778be2f61e Author: Linus Torvalds Date: Sat Sep 25 15:51:08 2021 -0700 Merge tag 'io_uring-5.15-2021-09-25' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "This one looks a bit bigger than it is, but that's mainly because 2/3 of it is enabling IORING_OP_CLOSE to close direct file descriptors. We've had a few folks using them and finding it confusing that the way to close them is through using -1 for file update, this just brings API symmetry for direct descriptors. Hence I think we should just do this now and have a better API for 5.15 release. There's some room for de-duplicating the close code, but we're leaving that for the next merge window. Outside of that, just small fixes: - Poll race fixes (Hao) - io-wq core dump exit fix (me) - Reschedule around potentially intensive tctx and buffer iterators on teardown (me) - Fix for always ending up punting files update to io-wq (me) - Put the provided buffer meta data under memcg accounting (me) - Tweak for io_write(), removing dead code that was added with the iterator changes in this release (Pavel)" * tag 'io_uring-5.15-2021-09-25' of git://git.kernel.dk/linux-block: io_uring: make OP_CLOSE consistent with direct open io_uring: kill extra checks in io_write() io_uring: don't punt files update to io-wq unconditionally io_uring: put provided buffer meta data under memcg accounting io_uring: allow conditional reschedule for intensive iterators io_uring: fix potential req refcount underflow io_uring: fix missing set of EPOLLONESHOT for CQ ring overflow io_uring: fix race between poll completion and cancel_hash insertion io-wq: ensure we exit if thread group is exiting commit 2d70de4ee5931455811cd0ce692230785ae1c3ce Merge: 5739844347518 f278eb3d8178f Author: Linus Torvalds Date: Sat Sep 25 15:44:05 2021 -0700 Merge tag 'block-5.15-2021-09-25' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - keep ctrl->namespaces ordered (Christoph Hellwig) - fix incorrect h2cdata pdu offset accounting in nvme-tcp (Sagi Grimberg) - handled updated hw_queues in nvme-fc more carefully (Daniel Wagner, James Smart) - md lock order fix (Christoph) - fallocate locking fix (Ming) - blktrace UAF fix (Zhihao) - rq-qos bio tracking fix (Ming) * tag 'block-5.15-2021-09-25' of git://git.kernel.dk/linux-block: block: hold ->invalidate_lock in blkdev_fallocate blktrace: Fix uaf in blk_trace access after removing by sysfs block: don't call rq_qos_ops->done_bio if the bio isn't tracked md: fix a lock order reversal in md_alloc nvme: keep ctrl->namespaces ordered nvme-tcp: fix incorrect h2cdata pdu offset accounting nvme-fc: remove freeze/unfreeze around update_nr_hw_queues nvme-fc: avoid race between time out and tear down nvme-fc: update hardware queues before using them commit 5739844347518a0f4c327ae79e73fb101d864726 Merge: 90316e6ea0f0d 0594c58161b6e Author: Linus Torvalds Date: Sat Sep 25 15:37:31 2021 -0700 Merge tag 'for-linus-5.15b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Some minor cleanups and fixes of some theoretical bugs, as well as a fix of a bug introduced in 5.15-rc1" * tag 'for-linus-5.15b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/x86: fix PV trap handling on secondary processors xen/balloon: fix balloon kthread freezing swiotlb-xen: this is PV-only on x86 xen/pci-swiotlb: reduce visibility of symbols PCI: only build xen-pcifront in PV-enabled environments swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests Xen/gntdev: don't ignore kernel unmapping error xen/x86: drop redundant zeroing from cpu_initialize_context() commit 90316e6ea0f0d63dab4cc84f71a8e199ee4b9b6c Merge: a5e0aceabef61 f5013d412a436 Author: Linus Torvalds Date: Sat Sep 25 15:30:29 2021 -0700 Merge tag 'linux-kselftest-fixes-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: - fix to Kselftest common framework header install to run before other targets for it work correctly in parallel build case. - fixes to kvm test to not ignore fscanf() returns which could result in inconsistent test behavior and failures. * tag 'linux-kselftest-fixes-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: kvm: fix get_run_delay() ignoring fscanf() return warn selftests: kvm: move get_run_delay() into lib/test_util selftests:kvm: fix get_trans_hugepagesz() ignoring fscanf() return warn selftests:kvm: fix get_warnings_count() ignoring fscanf() return warn selftests: be sure to make khdr before other targets commit a5e0aceabef618e2bb3d96c096002d8326d46a83 Merge: b8f4296560e33 c40dd3ca2a45d Author: Linus Torvalds Date: Sat Sep 25 11:31:48 2021 -0700 Merge tag 'erofs-for-5.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "Two bugfixes to fix the 4KiB blockmap chunk format availability and a dangling pointer usage. There is also a trivial cleanup to clarify compacted_2b if compacted_4b_initial > totalidx. Summary: - fix the dangling pointer use in erofs_lookup tracepoint - fix unsupported chunk format check - zero out compacted_2b if compacted_4b_initial > totalidx" * tag 'erofs-for-5.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: clear compacted_2b if compacted_4b_initial > totalidx erofs: fix misbehavior of unsupported chunk format check erofs: fix up erofs_lookup tracepoint commit b8f4296560e33e4e3cbed17a674d1b6dd23191af Merge: 85736168463db 9ed38fd4a1541 Author: Linus Torvalds Date: Sat Sep 25 11:08:12 2021 -0700 Merge tag '5.15-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Six small cifs/smb3 fixes, two for stable: - important fix for deferred close (found by a git functional test) related to attribute caching on close. - four (two cosmetic, two more serious) small fixes for problems pointed out by smatch via Dan Carpenter - fix for comment formatting problems pointed out by W=1" * tag '5.15-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix incorrect check for null pointer in header_assemble smb3: correct server pointer dereferencing check to be more consistent smb3: correct smb3 ACL security descriptor cifs: Clear modified attribute bit from inode flags cifs: Deal with some warnings from W=1 cifs: fix a sign extension bug commit 85736168463db124e1c4f382c7c2fca64c3acb80 Merge: 9cbef30886192 bb509a6ffed2c Author: Linus Torvalds Date: Sat Sep 25 10:29:14 2021 -0700 Merge tag 'char-misc-5.15-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 and misc driver fixes for 5.15-rc3. Nothing huge in here, just fixes for a number of small issues that have been reported. These include: - habanalabs race conditions and other bugs fixed - binder driver fixes - fpga driver fixes - coresight build warning fix - nvmem driver fix - comedi memory leak fix - bcm-vk tty race fix - other tiny driver fixes All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) comedi: Fix memory leak in compat_insnlist() nvmem: NVMEM_NINTENDO_OTP should depend on WII misc: bcm-vk: fix tty registration race fpga: dfl: Avoid reads to AFU CSRs during enumeration fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() fpga: machxo2-spi: Return an error on failure habanalabs: expose a single cs seq in staged submissions habanalabs: fix wait offset handling habanalabs: rate limit multi CS completion errors habanalabs/gaudi: fix LBW RR configuration habanalabs: Fix spelling mistake "FEADBACK" -> "FEEDBACK" habanalabs: fail collective wait when not supported habanalabs/gaudi: use direct MSI in single mode habanalabs: fix kernel OOPs related to staged cs habanalabs: fix potential race in interrupt wait ioctl mcb: fix error handling in mcb_alloc_bus() misc: genwqe: Fixes DMA mask setting coresight: syscfg: Fix compiler warning nvmem: core: Add stubs for nvmem_cell_read_variable_le_u32/64 if !CONFIG_NVMEM binder: make sure fd closes complete ... commit 9cbef3088619286de66f587e0c770f83f524925b Merge: f9d4be2507cfe aa3233ea7bdb6 Author: Linus Torvalds Date: Sat Sep 25 10:19:49 2021 -0700 Merge tag 'staging-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are two small staging driver fixes for 5.15-rc3: - greybus tty use-after-free bugfix - r8188eu ioctl overlap build warning fix Note, the r8188eu ioctl has been entirely removed for 5.16-rc1, but it's good to get this fixed now for people using this in 5.15. Both of these have been in linux-next for a while with no reported issues" * tag 'staging-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: r8188eu: fix -Wrestrict warnings staging: greybus: uart: fix tty use after free commit f9d4be2507cfec4d4878fac7d3b85ae9a77da2ce Merge: 2c4e969c38434 7049d853cfb92 Author: Linus Torvalds Date: Sat Sep 25 10:15:55 2021 -0700 Merge tag 'tty-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are four small tty/serial driver fixes for 5.15-rc3. They include: - remove an export now that no one is using it anymore - mvebu-uart tx_empty callback fix - 8250_omap bugfix - synclink_gt build fix All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: unexport tty_ldisc_release tty: synclink_gt: rename a conflicting function name serial: mvebu-uart: fix driver's tx_empty callback serial: 8250: 8250_omap: Fix RX_LVL register offset commit 2c4e969c38434546322097e41d8bfe7376347460 Merge: 7d42e98182586 0292dbd7bd779 Author: Linus Torvalds Date: Sat Sep 25 10:10:38 2021 -0700 Merge tag 'usb-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are some USB driver fixes and new device ids for 5.15-rc3. They include: - usb-storage quirk additions - usb-serial new device ids - usb-serial driver fixes - USB roothub registration bugfix to resolve a long-reported issue - usb gadget driver fixes for a large number of small things - dwc2 driver fixes All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits) USB: serial: option: add device id for Foxconn T99W265 USB: serial: cp210x: add ID for GW Instek GDM-834x Digital Multimeter USB: serial: cp210x: add part-number debug printk USB: serial: cp210x: fix dropped characters with CP2102 MAINTAINERS: usb, update Peter Korsgaard's entries usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() usb-storage: Add quirk for ScanLogic SL11R-IDE older than 2.6c Re-enable UAS for LaCie Rugged USB3-FW with fk quirk USB: serial: option: remove duplicate USB device ID USB: serial: mos7840: remove duplicated 0xac24 device ID arm64: dts: qcom: ipq8074: remove USB tx-fifo-resize property usb: gadget: f_uac2: Populate SS descriptors' wBytesPerInterval usb: gadget: f_uac2: Add missing companion descriptor for feedback EP usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA usb: core: hcd: Modularize HCD stop configuration in usb_stop_hcd() xhci: Set HCD flag to defer primary roothub registration usb: core: hcd: Add support for deferring roothub registration usb: dwc2: gadget: Fix ISOC flow for BDMA and Slave usb: dwc3: core: balance phy init and exit Revert "USB: bcma: Add a check for devm_gpiod_get" ... commit 9da1b86865ab4376408c58cd9fec332c8bdb5c73 Author: Nuno Sá Date: Mon Sep 20 11:00:47 2021 +0200 iio: adis16475: fix deadlock on frequency set With commit 39c024b51b560 ("iio: adis16475: improve sync scale mode handling"), two deadlocks were introduced: 1) The call to 'adis_write_reg_16()' was not changed to it's unlocked version. 2) The lock was not being released on the success path of the function. This change fixes both these issues. Fixes: 39c024b51b560 ("iio: adis16475: improve sync scale mode handling") Signed-off-by: Nuno Sá Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210920090047.74903-1-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit 265fd1991c1db85fbabaad4946ca0e63e2ae688d Author: Hyunchul Lee Date: Sat Sep 25 00:06:16 2021 +0900 ksmbd: use LOOKUP_BENEATH to prevent the out of share access instead of removing '..' in a given path, call kern_path with LOOKUP_BENEATH flag to prevent the out of share access. ran various test on this: smb2-cat-async smb://127.0.0.1/homes/../out_of_share smb2-cat-async smb://127.0.0.1/homes/foo/../../out_of_share smbclient //127.0.0.1/homes -c "mkdir ../foo2" smbclient //127.0.0.1/homes -c "rename bar ../bar" Cc: Ronnie Sahlberg Cc: Ralph Boehme Tested-by: Steve French Tested-by: Namjae Jeon Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit 7fe7f3182a0dd8f9bad463598ed103b3d8cfa739 Merge: 4526fe74c3c50 e9edc188fc764 Author: Jakub Kicinski Date: Fri Sep 24 17:27:19 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net 1) ipset limits the max allocatable memory via kvmalloc() to MAX_INT, from Jozsef Kadlecsik. 2) Check ip_vs_conn_tab_bits value to be in the range specified in Kconfig, from Andrea Claudi. 3) Initialize fragment offset in ip6tables, from Jeremy Sowden. 4) Make conntrack hash chain length random, from Florian Westphal. 5) Add zone ID to conntrack and NAT hashtuple again, also from Florian. 6) Add selftests for bidirectional zone support and colliding tuples, from Florian Westphal. 7) Unlink table before synchronize_rcu when cleaning tables with owner, from Florian. 8) ipset limits the max allocatable memory via kvmalloc() to MAX_INT. 9) Release conntrack entries via workqueue in masquerade, from Florian. 10) Fix bogus net_init in iptables raw table definition, also from Florian. 11) Work around missing softdep in log extensions, from Florian Westphal. 12) Serialize hash resizes and cleanups with mutex, from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf: netfilter: conntrack: serialize hash resizes and cleanups netfilter: log: work around missing softdep backend module netfilter: iptable_raw: drop bogus net_init annotation netfilter: nf_nat_masquerade: defer conntrack walk to work queue netfilter: nf_nat_masquerade: make async masq_inet6_event handling generic netfilter: nf_tables: Fix oversized kvmalloc() calls netfilter: nf_tables: unlink table before deleting it selftests: netfilter: add zone stress test with colliding tuples selftests: netfilter: add selftest for directional zone support netfilter: nat: include zone id in nat table hash again netfilter: conntrack: include zone id in tuple hash again netfilter: conntrack: make max chain length random netfilter: ip6_tables: zero-initialize fragment offset ipvs: check that ip_vs_conn_tab_bits is between 8 and 20 netfilter: ipset: Fix oversized kvmalloc() calls ==================== Link: https://lore.kernel.org/r/20210924221113.348767-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit bcbda81020c3ee77e2c098cadf3e84f99ca3de17 Author: Chen Jun Date: Fri Sep 24 15:44:06 2021 -0700 mm: fix uninitialized use in overcommit_policy_handler We get an unexpected value of /proc/sys/vm/overcommit_memory after running the following program: int main() { int fd = open("/proc/sys/vm/overcommit_memory", O_RDWR); write(fd, "1", 1); write(fd, "2", 1); close(fd); } write(fd, "2", 1) will pass *ppos = 1 to proc_dointvec_minmax. proc_dointvec_minmax will return 0 without setting new_policy. t.data = &new_policy; ret = proc_dointvec_minmax(&t, write, buffer, lenp, ppos) -->do_proc_dointvec -->__do_proc_dointvec if (write) { if (proc_first_pos_non_zero_ignore(ppos, table)) goto out; sysctl_overcommit_memory = new_policy; so sysctl_overcommit_memory will be set to an uninitialized value. Check whether new_policy has been changed by proc_dointvec_minmax. Link: https://lkml.kernel.org/r/20210923020524.13289-1-chenjun102@huawei.com Fixes: 56f3547bfa4d ("mm: adjust vm_committed_as_batch according to vm overcommit policy") Signed-off-by: Chen Jun Acked-by: Michal Hocko Reviewed-by: Feng Tang Reviewed-by: Kefeng Wang Cc: Rui Xiang Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5c91c0e77b8f2681e2b269c8abb4c5acef434d5b Author: Qi Zheng Date: Fri Sep 24 15:44:03 2021 -0700 mm/memory_failure: fix the missing pte_unmap() call The paired pte_unmap() call is missing before the dev_pagemap_mapping_shift() returns. So fix it. David says: "I guess this code never runs on 32bit / highmem, that's why we didn't notice so far". [akpm@linux-foundation.org: cleanup] Link: https://lkml.kernel.org/r/20210923122642.4999-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: David Hildenbrand Cc: Naoya Horiguchi Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 19532869feb9b0a97d17ddc14609d1e53a5b60db Author: Nathan Chancellor Date: Fri Sep 24 15:44:00 2021 -0700 kasan: always respect CONFIG_KASAN_STACK Currently, the asan-stack parameter is only passed along if CFLAGS_KASAN_SHADOW is not empty, which requires KASAN_SHADOW_OFFSET to be defined in Kconfig so that the value can be checked. In RISC-V's case, KASAN_SHADOW_OFFSET is not defined in Kconfig, which means that asan-stack does not get disabled with clang even when CONFIG_KASAN_STACK is disabled, resulting in large stack warnings with allmodconfig: drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c:117:12: error: stack frame size (14400) exceeds limit (2048) in function 'lb035q02_connect' [-Werror,-Wframe-larger-than] static int lb035q02_connect(struct omap_dss_device *dssdev) ^ 1 error generated. Ensure that the value of CONFIG_KASAN_STACK is always passed along to the compiler so that these warnings do not happen when CONFIG_KASAN_STACK is disabled. Link: https://github.com/ClangBuiltLinux/linux/issues/1453 References: 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier") Link: https://lkml.kernel.org/r/20210922205525.570068-1-nathan@kernel.org Signed-off-by: Nathan Chancellor Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Nick Desaulniers Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e8e9f1e6327005be9656aa135aeb9dfdaf6b3032 Author: Geert Uytterhoeven Date: Fri Sep 24 15:43:57 2021 -0700 sh: pgtable-3level: fix cast to pointer from integer of different size If X2TLB=y (CPU_SHX2=y or CPU_SHX3=y, e.g. migor_defconfig), pgd_t.pgd is "unsigned long long", causing: In file included from arch/sh/include/asm/pgtable.h:13, from include/linux/pgtable.h:6, from include/linux/mm.h:33, from arch/sh/kernel/asm-offsets.c:14: arch/sh/include/asm/pgtable-3level.h: In function `pud_pgtable': arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 37 | return (pmd_t *)pud_val(pud); | ^ Fix this by adding an intermediate cast to "unsigned long", which is basically what the old code did before. Link: https://lkml.kernel.org/r/2c2eef3c9a2f57e5609100a4864715ccf253d30f.1631713483.git.geert+renesas@glider.be Fixes: 9cf6fa2458443118 ("mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *") Signed-off-by: Geert Uytterhoeven Tested-by: Daniel Palmer Acked-by: Rob Landley Cc: Yoshinori Sato Cc: Rich Felker Cc: "Aneesh Kumar K . V" Cc: Jacopo Mondi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 57ed7b4303a1c4d1885019fef03e6a5af2e8468a Author: Weizhao Ouyang Date: Fri Sep 24 15:43:53 2021 -0700 mm/debug: sync up latest migrate_reason to migrate_reason_names Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. Link: https://lkml.kernel.org/r/20210921064553.293905-3-o451686892@gmail.com Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") Signed-off-by: Weizhao Ouyang Reviewed-by: "Huang, Ying" Reviewed-by: John Hubbard Cc: Anshuman Khandual Cc: Michal Hocko Cc: Pavel Tatashin Cc: Yang Shi Cc: Zi Yan Cc: Dave Hansen Cc: Minchan Kim Cc: Mina Almasry Cc: "Matthew Wilcox (Oracle)" Cc: Oscar Salvador Cc: Wei Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a4ce73910427e960b2c7f4d83229153c327d0ee7 Author: Weizhao Ouyang Date: Fri Sep 24 15:43:50 2021 -0700 mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN to migrate_reason_names. Link: https://lkml.kernel.org/r/20210921064553.293905-2-o451686892@gmail.com Fixes: 310253514bbf ("mm/migrate: rename migration reason MR_CMA to MR_CONTIG_RANGE") Fixes: d1e153fea2a8 ("mm/gup: migrate pinned pages out of movable zone") Signed-off-by: Weizhao Ouyang Reviewed-by: "Huang, Ying" Reviewed-by: John Hubbard Cc: Anshuman Khandual Cc: Michal Hocko Cc: Pavel Tatashin Cc: Yang Shi Cc: Zi Yan Cc: Dave Hansen Cc: Minchan Kim Cc: Mina Almasry Cc: "Matthew Wilcox (Oracle)" Cc: Oscar Salvador Cc: Wei Xu Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 243418e3925d5b5b0657ae54c322d43035e97eed Author: Minchan Kim Date: Fri Sep 24 15:43:47 2021 -0700 mm: fs: invalidate bh_lrus for only cold path The kernel test robot reported the regression of fio.write_iops[1] with commit 8cc621d2f45d ("mm: fs: invalidate BH LRU during page migration"). Since lru_add_drain is called frequently, invalidate bh_lrus there could increase bh_lrus cache miss ratio, which needs more IO in the end. This patch moves the bh_lrus invalidation from the hot path( e.g., zap_page_range, pagevec_release) to cold path(i.e., lru_add_drain_all, lru_cache_disable). Zhengjun Xing confirmed "I test the patch, the regression reduced to -2.9%" [1] https://lore.kernel.org/lkml/20210520083144.GD14190@xsang-OptiPlex-9020/ [2] 8cc621d2f45d, mm: fs: invalidate BH LRU during page migration Link: https://lkml.kernel.org/r/20210907212347.1977686-1-minchan@kernel.org Signed-off-by: Minchan Kim Reported-by: kernel test robot Reviewed-by: Chris Goldsworthy Tested-by: "Xing, Zhengjun" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b7cd9fa5ccc392d9f2269edc4cb82508632c28da Author: Paul Menzel Date: Fri Sep 24 15:43:44 2021 -0700 lib/zlib_inflate/inffast: check config in C to avoid unused function warning Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function] get_unaligned16(const unsigned short *p) ^ 1 warning generated. Fix it by moving the check from the preprocessor to C, so the compiler sees the use. Link: https://lkml.kernel.org/r/20210920084332.5752-1-pmenzel@molgen.mpg.de Signed-off-by: Paul Menzel Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Cc: Nick Desaulniers Cc: Christophe Leroy Cc: Zhen Lei Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ebaeab2fe87987cef28eb5ab174c42cd28594387 Author: Changbin Du Date: Fri Sep 24 15:43:41 2021 -0700 tools/vm/page-types: remove dependency on opt_file for idle page tracking Idle page tracking can also be used for process address space, not only file mappings. Without this change, using with '-i' option for process address space encounters below errors reported. $ sudo ./page-types -p $(pidof bash) -i mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor ... Link: https://lkml.kernel.org/r/20210917032826.10669-1-changbin.du@gmail.com Signed-off-by: Changbin Du Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d09c38726c78effaf910a1e3f31e247b5b031d56 Author: Miles Chen Date: Fri Sep 24 15:43:38 2021 -0700 scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error Fix the following build failure reported in [1] by adding a conditional definition of EM_RISCV in order to allow cross-compilation on machines which do not have EM_RISCV definition in their host. scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV' EM_RISCV was added to in glibc 2.24 so builds on systems with glibc headers < 2.24 should show this error. [mkubecek@suse.cz: changelog addition] Link: https://lore.kernel.org/lkml/e8965b25-f15b-c7b4-748c-d207dda9c8e8@i2se.com/ [1] Link: https://lkml.kernel.org/r/20210913030625.4525-1-miles.chen@mediatek.com Fixes: 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT") Signed-off-by: Miles Chen Reported-by: Stefan Wahren Tested-by: Stefan Wahren Reviewed-by: Jisheng Zhang Cc: Michal Kubecek Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Markus Mayer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9c0f0a03e386f4e1df33db676401547e1b7800c6 Author: Wengang Wang Date: Fri Sep 24 15:43:35 2021 -0700 ocfs2: drop acl cache for directories too ocfs2_data_convert_worker() is currently dropping any cached acl info for FILE before down-converting meta lock. It should also drop for DIRECTORY. Otherwise the second acl lookup returns the cached one (from VFS layer) which could be already stale. The problem we are seeing is that the acl changes on one node doesn't get refreshed on other nodes in the following case: Node 1 Node 2 -------------- ---------------- getfacl dir1 getfacl dir1 <-- this is OK setfacl -m u:user1:rwX dir1 getfacl dir1 <-- see the change for user1 getfacl dir1 <-- can't see change for user1 Link: https://lkml.kernel.org/r/20210903012631.6099-1-wen.gang.wang@oracle.com Signed-off-by: Wengang Wang Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit de6ee659684b1a2b149e0780d3c5e8032f3647d6 Author: Liu Yuntao Date: Fri Sep 24 15:43:32 2021 -0700 mm/shmem.c: fix judgment error in shmem_is_huge() In the case of SHMEM_HUGE_WITHIN_SIZE, the page index is not rounded up correctly. When the page index points to the first page in a huge page, round_up() cannot bring it to the end of the huge page, but to the end of the previous one. An example: HPAGE_PMD_NR on my machine is 512(2 MB huge page size). After allcoating a 3000 KB buffer, I access it at location 2050 KB. In shmem_is_huge(), the corresponding index happens to be 512. After rounded up by HPAGE_PMD_NR, it will still be 512 which is smaller than i_size, and shmem_is_huge() will return true. As a result, my buffer takes an additional huge page, and that shouldn't happen when shmem_enabled is set to within_size. Link: https://lkml.kernel.org/r/20210909032007.18353-1-liuyuntao10@huawei.com Fixes: f3f0e1d2150b2b ("khugepaged: add support of collapse for tmpfs/shmem pages") Signed-off-by: Liu Yuntao Acked-by: Kirill A. Shutemov Acked-by: Hugh Dickins Cc: wuxu.wu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 867050247e295cf20fce046a92a7e6491fcfe066 Author: Guenter Roeck Date: Fri Sep 24 15:43:29 2021 -0700 xtensa: increase size of gcc stack frame check xtensa frame size is larger than the frame size for almost all other architectures. This results in more than 50 "the frame size of is larger than 1024 bytes" errors when trying to build xtensa:allmodconfig. Increase frame size for xtensa to 1536 bytes to avoid compile errors due to frame size limits. Link: https://lkml.kernel.org/r/20210912025235.3514761-1-linux@roeck-us.net Signed-off-by: Guenter Roeck Reviewed-by: Max Filippov Cc: Chris Zankel Cc: David Laight Cc: Masahiro Yamada Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 892ab4bbd063cfe7f6bbb183e6be69d9907a61de Author: Adam Borowski Date: Fri Sep 24 15:43:26 2021 -0700 mm/damon: don't use strnlen() with known-bogus source length gcc knows the true length too, and rightfully complains. Link: https://lkml.kernel.org/r/20210912204447.10427-1-kilobyte@angband.pl Signed-off-by: Adam Borowski Cc: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fa360beac4b62d54879a88b182afef4b369c9700 Author: Marco Elver Date: Fri Sep 24 15:43:23 2021 -0700 kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS In the main KASAN config option CC_HAS_WORKING_NOSANITIZE_ADDRESS is checked for instrumentation-based modes. However, if HAVE_ARCH_KASAN_HW_TAGS is true all modes may still be selected. To fix, also make the software modes depend on CC_HAS_WORKING_NOSANITIZE_ADDRESS. Link: https://lkml.kernel.org/r/20210910084240.1215803-1-elver@google.com Fixes: 6a63a63ff1ac ("kasan: introduce CONFIG_KASAN_HW_TAGS") Signed-off-by: Marco Elver Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Aleksandr Nogikh Cc: Taras Madan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit acfa299a4a63a58e5e81a87cb16798f20d35f7d7 Author: Naoya Horiguchi Date: Fri Sep 24 15:43:20 2021 -0700 mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() Commit fcc00621d88b ("mm/hwpoison: retry with shake_page() for unhandlable pages") changed the return value of __get_hwpoison_page() to retry for transiently unhandlable cases. However, __get_hwpoison_page() currently fails to properly judge buddy pages as handlable, so hard/soft offline for buddy pages always fail as "unhandlable page". This is totally regrettable. So let's add is_free_buddy_page() in HWPoisonHandlable(), so that __get_hwpoison_page() returns different return values between buddy pages and unhandlable pages as intended. Link: https://lkml.kernel.org/r/20210909004131.163221-1-naoya.horiguchi@linux.dev Fixes: fcc00621d88b ("mm/hwpoison: retry with shake_page() for unhandlable pages") Signed-off-by: Naoya Horiguchi Acked-by: David Hildenbrand Reviewed-by: Yang Shi Cc: Tony Luck Cc: Oscar Salvador Cc: Mike Kravetz Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09540fa337196be20e9f0241652364f09275d374 Author: Dinh Nguyen Date: Thu Sep 16 17:51:26 2021 -0500 clk: socfpga: agilex: fix duplicate s2f_user0_clk Remove the duplicate s2f_user0_clk and the unused s2f_usr0_mux define. Fixes: f817c132db67 ("clk: socfpga: agilex: fix up s2f_user0_clk representation") Cc: stable@vger.kernel.org Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20210916225126.1427700-1-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 7df778be2f61e1a23002d1f2f5d6aaf702771eb8 Author: Pavel Begunkov Date: Fri Sep 24 20:04:29 2021 +0100 io_uring: make OP_CLOSE consistent with direct open From recently open/accept are now able to manipulate fixed file table, but it's inconsistent that close can't. Close the gap, keep API same as with open/accept, i.e. via sqe->file_slot. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit a295aef603e109a47af355477326bd41151765b6 Author: Zheng Liang Date: Fri Sep 24 09:16:27 2021 +0800 ovl: fix missing negative dentry check in ovl_rename() The following reproducer mkdir lower upper work merge touch lower/old touch lower/new mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merge rm merge/new mv merge/old merge/new & unlink upper/new may result in this race: PROCESS A: rename("merge/old", "merge/new"); overwrite=true,ovl_lower_positive(old)=true, ovl_dentry_is_whiteout(new)=true -> flags |= RENAME_EXCHANGE PROCESS B: unlink("upper/new"); PROCESS A: lookup newdentry in new_upperdir call vfs_rename() with negative newdentry and RENAME_EXCHANGE Fix by adding the missing check for negative newdentry. Signed-off-by: Zheng Liang Fixes: e9be9d5e76e3 ("overlay filesystem") Cc: # v3.18 Signed-off-by: Miklos Szeredi commit 7d42e98182586f57f376406d033f05fe135edb75 Merge: 47d7e65d64cc7 b22a4705e2e60 Author: Linus Torvalds Date: Fri Sep 24 11:22:55 2021 -0700 Merge tag 'gpio-fixes-for-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix a regression in GPIO ACPI on HP ElitePad 1000 G2 where the gpio_set_debounce_timeout() now returns a fatal error if the specific debounce period is not supported by the driver instead of just emitting a warning - fix return values of irq_mask/unmask() callbacks in gpio-uniphier - fix hwirq calculation in gpio-aspeed-sgpio - fix two issues in gpio-rockchip: only make the extended debounce support available for v2 and remove a redundant BIT() usage * tag 'gpio-fixes-for-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio/rockchip: fix get_direction value handling gpio/rockchip: extended debounce support is only available on v2 gpio: gpio-aspeed-sgpio: Fix wrong hwirq in irq handler. gpio: uniphier: Fix void functions to remove return value gpiolib: acpi: Make set-debounce-timeout failures non fatal commit 47d7e65d64cc72756b1aa0ccfa3dcbd38c638507 Merge: ea1f9163ac83f 5aeb05b27f812 Author: Linus Torvalds Date: Fri Sep 24 11:20:29 2021 -0700 Merge tag 'devprop-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework fix from Rafael Wysocki: "Fix software node refcount imbalance on device removal (Laurentiu Tudor)" * tag 'devprop-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: software node: balance refcount for managed software nodes commit ea1f9163ac83fa537f58e00a81028844702279e4 Merge: 1b7eaf5701402 12064c1768439 Author: Linus Torvalds Date: Fri Sep 24 11:17:32 2021 -0700 Merge tag 'acpi-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Revert a recent commit related to memory management that turned out to be problematic (Jia He)" * tag 'acpi-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "ACPI: Add memory semantics to acpi_os_map_memory()" commit 1b7eaf570140281a1aa898a875aa587d48d96958 Merge: 4c4f0c2bf3415 22b70e6f2da0a Author: Linus Torvalds Date: Fri Sep 24 11:12:17 2021 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - It turns out that the optimised string routines merged in 5.14 are not safe with in-kernel MTE (KASAN_HW_TAGS) because of reading beyond the end of a string (strcmp, strncmp). Such reading may go across a 16 byte tag granule and cause a tag check fault. When KASAN_HW_TAGS is enabled, use the generic strcmp/strncmp C implementation. - An errata workaround for ThunderX relied on the CPU capabilities being enabled in a specific order. This disappeared with the automatic generation of the cpucaps.h file (sorted alphabetically). Fix it by checking the current CPU only rather than the system-wide capability. - Add system_supports_mte() checks on the kernel entry/exit path and thread switching to avoid unnecessary barriers and function calls on systems where MTE is not supported. - kselftests: skip arm64 tests if the required features are missing. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Restore forced disabling of KPTI on ThunderX kselftest/arm64: signal: Skip tests if required features are missing arm64: Mitigate MTE issues with str{n}cmp() arm64: add MTE supported check to thread switching and syscall entry/exit commit 4c4f0c2bf3415a5fe7512d17d841bc1f8020b2cb Merge: e655c81ade7b8 708c87168b612 Author: Linus Torvalds Date: Fri Sep 24 10:28:18 2021 -0700 Merge tag 'ceph-for-5.15-rc3' of git://github.com/ceph/ceph-client Pull ceph fix from Ilya Dryomov: "A fix for a potential array out of bounds access from Dan" * tag 'ceph-for-5.15-rc3' of git://github.com/ceph/ceph-client: ceph: fix off by one bugs in unsafe_request_wait() commit e655c81ade7b877cb5ee31c85e88928ec3f77db6 Merge: a801695f68f40 372d1f3e1bfed Author: Linus Torvalds Date: Fri Sep 24 10:22:35 2021 -0700 Merge tag 'fixes_for_v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull misc filesystem fixes from Jan Kara: "A for ext2 sleep in atomic context in case of some fs problems and a cleanup of an invalidate_lock initialization" * tag 'fixes_for_v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: fix sleeping in atomic bugs on error mm: Fully initialize invalidate_lock, amend lock class later commit a801695f68f40e75e47ed292bc9aaab815814b53 Merge: e61b2ad3e1914 40c8ee67cfc49 Author: Linus Torvalds Date: Fri Sep 24 10:18:07 2021 -0700 Merge branch 'work.init' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs fixes from Al Viro: "Followups to nodev root stuff from this merge window" * 'work.init' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: init: don't panic if mount_nodev_root failed init/do_mounts.c: Harden split_fs_names() against buffer overflow commit e61b2ad3e1914b70c657a8fd7524078ae37a7da4 Merge: f9e36107ec704 ef88d7a8a5c94 Author: Linus Torvalds Date: Fri Sep 24 10:14:19 2021 -0700 Merge tag 'drm-fixes-2021-09-24' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Quiet week this week, just some i915 and amd fixes, just getting ready for my all nighter maintainer summit! Summary: i915: - Fix ADL-P memory bandwidth parameters - Fix memory corruption due to a double free - Fix memory leak in DMC firmware handling amdgpu: - Update MAINTAINERS entry for powerplay - Fix empty macros - SI DPM fix amdkfd: - SVM fixes - DMA mapping fix" * tag 'drm-fixes-2021-09-24' of git://anongit.freedesktop.org/drm/drm: drm/amdkfd: fix svm_migrate_fini warning drm/amdkfd: handle svm migrate init error drm/amd/pm: Update intermediate power state for SI drm/amdkfd: fix dma mapping leaking warning drm/amdkfd: SVM map to gpus check vma boundary MAINTAINERS: fix up entry for AMD Powerplay drm/amd/display: fix empty debug macros drm/i915: Free all DMC payloads drm/i915: Move __i915_gem_free_object to ttm_bo_destroy drm/i915: Update memory bandwidth parameters commit f278eb3d8178f9c31f8dfad7e91440e603dd7f1a Author: Ming Lei Date: Thu Sep 23 10:37:51 2021 +0800 block: hold ->invalidate_lock in blkdev_fallocate When running ->fallocate(), blkdev_fallocate() should hold mapping->invalidate_lock to prevent page cache from being accessed, otherwise stale data may be read in page cache. Without this patch, blktests block/009 fails sometimes. With this patch, block/009 can pass always. Also as Jan pointed out, no pages can be created in the discarded area while you are holding the invalidate_lock, so remove the 2nd truncate_bdev_range(). Cc: Jan Kara Signed-off-by: Ming Lei Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210923023751.1441091-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 5afedf670caf30a2b5a52da96eb7eac7dee6a9c9 Author: Zhihao Cheng Date: Thu Sep 23 21:49:21 2021 +0800 blktrace: Fix uaf in blk_trace access after removing by sysfs There is an use-after-free problem triggered by following process: P1(sda) P2(sdb) echo 0 > /sys/block/sdb/trace/enable blk_trace_remove_queue synchronize_rcu blk_trace_free relay_close rcu_read_lock __blk_add_trace trace_note_tsk (Iterate running_trace_list) relay_close_buf relay_destroy_buf kfree(buf) trace_note(sdb's bt) relay_reserve buf->offset <- nullptr deference (use-after-free) !!! rcu_read_unlock [ 502.714379] BUG: kernel NULL pointer dereference, address: 0000000000000010 [ 502.715260] #PF: supervisor read access in kernel mode [ 502.715903] #PF: error_code(0x0000) - not-present page [ 502.716546] PGD 103984067 P4D 103984067 PUD 17592b067 PMD 0 [ 502.717252] Oops: 0000 [#1] SMP [ 502.720308] RIP: 0010:trace_note.isra.0+0x86/0x360 [ 502.732872] Call Trace: [ 502.733193] __blk_add_trace.cold+0x137/0x1a3 [ 502.733734] blk_add_trace_rq+0x7b/0xd0 [ 502.734207] blk_add_trace_rq_issue+0x54/0xa0 [ 502.734755] blk_mq_start_request+0xde/0x1b0 [ 502.735287] scsi_queue_rq+0x528/0x1140 ... [ 502.742704] sg_new_write.isra.0+0x16e/0x3e0 [ 502.747501] sg_ioctl+0x466/0x1100 Reproduce method: ioctl(/dev/sda, BLKTRACESETUP, blk_user_trace_setup[buf_size=127]) ioctl(/dev/sda, BLKTRACESTART) ioctl(/dev/sdb, BLKTRACESETUP, blk_user_trace_setup[buf_size=127]) ioctl(/dev/sdb, BLKTRACESTART) echo 0 > /sys/block/sdb/trace/enable & // Add delay(mdelay/msleep) before kernel enters blk_trace_free() ioctl$SG_IO(/dev/sda, SG_IO, ...) // Enters trace_note_tsk() after blk_trace_free() returned // Use mdelay in rcu region rather than msleep(which may schedule out) Remove blk_trace from running_list before calling blk_trace_free() by sysfs if blk_trace is at Blktrace_running state. Fixes: c71a896154119f ("blktrace: add ftrace plugin") Signed-off-by: Zhihao Cheng Link: https://lore.kernel.org/r/20210923134921.109194-1-chengzhihao1@huawei.com Signed-off-by: Jens Axboe commit a647a524a46736786c95cdb553a070322ca096e3 Author: Ming Lei Date: Fri Sep 24 19:07:04 2021 +0800 block: don't call rq_qos_ops->done_bio if the bio isn't tracked rq_qos framework is only applied on request based driver, so: 1) rq_qos_done_bio() needn't to be called for bio based driver 2) rq_qos_done_bio() needn't to be called for bio which isn't tracked, such as bios ended from error handling code. Especially in bio_endio(): 1) request queue is referred via bio->bi_bdev->bd_disk->queue, which may be gone since request queue refcount may not be held in above two cases 2) q->rq_qos may be freed in blk_cleanup_queue() when calling into __rq_qos_done_bio() Fix the potential kernel panic by not calling rq_qos_ops->done_bio if the bio isn't tracked. This way is safe because both ioc_rqos_done_bio() and blkcg_iolatency_done_bio() are nop if the bio isn't tracked. Reported-by: Yu Kuai Cc: tj@kernel.org Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20210924110704.1541818-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 9f3a2cb228c28606895d15f13b30d1f7402dc745 Author: Pavel Begunkov Date: Fri Sep 24 17:14:48 2021 +0100 io_uring: kill extra checks in io_write() We don't retry short writes and so we would never get to async setup in io_write() in that case. Thus ret2 > 0 is always false and iov_iter_advance() is never used. Apparently, the same is found by Coverity, which complains on the code. Fixes: cd65869512ab ("io_uring: use iov_iter state save/restore helpers") Reported-by: Dave Jones Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5b33e61034748ef1022766efc0fb8854cfcf749c.1632500058.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cdb31c29d397a8076d81fd1458d091c647ef94ba Author: Jens Axboe Date: Fri Sep 24 08:43:54 2021 -0600 io_uring: don't punt files update to io-wq unconditionally There's no reason to punt it unconditionally, we just need to ensure that the submit lock grabbing is conditional. Fixes: 05f3fb3c5397 ("io_uring: avoid ring quiesce for fixed file set unregister and update") Signed-off-by: Jens Axboe commit 9990da93d2bf9892c2c14c958bef050d4e461a1a Author: Jens Axboe Date: Fri Sep 24 07:39:08 2021 -0600 io_uring: put provided buffer meta data under memcg accounting For each provided buffer, we allocate a struct io_buffer to hold the data associated with it. As a large number of buffers can be provided, account that data with memcg. Fixes: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Jens Axboe commit 8bab4c09f24ec8d4a7a78ab343620f89d3a24804 Author: Jens Axboe Date: Fri Sep 24 07:12:27 2021 -0600 io_uring: allow conditional reschedule for intensive iterators If we have a lot of threads and rings, the tctx list can get quite big. This is especially true if we keep creating new threads and rings. Likewise for the provided buffers list. Be nice and insert a conditional reschedule point while iterating the nodes for deletion. Link: https://lore.kernel.org/io-uring/00000000000064b6b405ccb41113@google.com/ Reported-by: syzbot+111d2a03f51f5ae73775@syzkaller.appspotmail.com Signed-off-by: Jens Axboe commit 5b7aa38d86f348847a48f71e9ac7715406de900e Author: Hao Xu Date: Wed Sep 22 18:12:38 2021 +0800 io_uring: fix potential req refcount underflow For multishot mode, there may be cases like: iowq original context io_poll_add _arm_poll() mask = vfs_poll() is not 0 if mask (2) io_poll_complete() compl_unlock (interruption happens tw queued to original context) io_poll_task_func() compl_lock (3) done = io_poll_complete() is true compl_unlock put req ref (1) if (poll->flags & EPOLLONESHOT) put req ref EPOLLONESHOT flag in (1) may be from (2) or (3), so there are multiple combinations that can cause ref underfow. Let's address it by: - check the return value in (2) as done - change (1) to if (done) in this way, we only do ref put in (1) if 'oneshot flag' is from (2) - do poll.done check in io_poll_task_func(), so that we won't put ref for the second time. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210922101238.7177-4-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit a62682f92eedb41c1cd8290fa875a4b85624fb9a Author: Hao Xu Date: Wed Sep 22 18:12:37 2021 +0800 io_uring: fix missing set of EPOLLONESHOT for CQ ring overflow We should set EPOLLONESHOT if cqring_fill_event() returns false since io_poll_add() decides to put req or not by it. Fixes: 5082620fb2ca ("io_uring: terminate multishot poll for CQ ring overflow") Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210922101238.7177-3-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit bd99c71bd14072ce2920f6d0c2fe43df072c653c Author: Hao Xu Date: Wed Sep 22 18:12:36 2021 +0800 io_uring: fix race between poll completion and cancel_hash insertion If poll arming and poll completion runs in parallel, there maybe races. For instance, run io_poll_add in iowq and io_poll_task_func in original context, then: iowq original context io_poll_add vfs_poll (interruption happens tw queued to original context) io_poll_task_func generate cqe del from cancel_hash[] if !poll.done insert to cancel_hash[] The entry left in cancel_hash[], similar case for fast poll. Fix it by set poll.done = true when del from cancel_hash[]. Fixes: 5082620fb2ca ("io_uring: terminate multishot poll for CQ ring overflow") Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210922101238.7177-2-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 87c1696655787895689618c8b63c5efe66b8f2ab Author: Jens Axboe Date: Tue Sep 21 08:24:57 2021 -0600 io-wq: ensure we exit if thread group is exiting Dave reports that a coredumping workload gets stuck in 5.15-rc2, and identified the culprit in the Fixes line below. The problem is that relying solely on fatal_signal_pending() to gate whether to exit or not fails miserably if a process gets eg SIGILL sent. Don't exclusively rely on fatal signals, also check if the thread group is exiting. Fixes: 15e20db2e0ce ("io-wq: only exit on fatal signals") Reported-by: Dave Chinner Signed-off-by: Jens Axboe commit 42de956ca7e5f6c47048dde640f797e783b23198 Author: Jason Gunthorpe Date: Tue Sep 21 09:11:59 2021 -0300 vfio/ap_ops: Add missed vfio_uninit_group_dev() Without this call an xarray entry is leaked when the vfio_ap device is unprobed. It was missed when the below patch was rebased across the dev_set patch. Keep the remove function in the same order as the error unwind in probe. Fixes: eb0feefd4c02 ("vfio/ap_ops: Convert to use vfio_register_group_dev()") Reviewed-by: Christoph Hellwig Tested-by: Tony Krowiak Signed-off-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Link: https://lore.kernel.org/r/0-v3-f9b50340cdbb+e4-ap_uninit_jgg@nvidia.com Signed-off-by: Alex Williamson commit 1878f4b7ec9ed013da8a7efb63fed1fbae0215ae Author: Shawn Guo Date: Tue Aug 24 12:34:35 2021 +0800 arm64: dts: qcom: sdm630: Add missing a2noc qos clocks It adds the missing a2noc clocks required for QoS registers programming per downstream kernel[1]. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/sdm660-bus.dtsi?h=LA.UM.8.2.r1-04800-sdm660.0#n43 Fixes: 045547a02252 ("arm64: dts: qcom: sdm630: Add interconnect provider nodes") Signed-off-by: Shawn Guo Acked-by: Georgi Djakov Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210824043435.23190-4-shawn.guo@linaro.org commit 30b83220aa009b8654f17a8ad6cf8b08959110f2 Author: Dmitry Baryshkov Date: Thu Sep 16 18:13:41 2021 +0300 arm64: dts: qcom: qrb5165-rb5: enabled pwrkey and resin nodes Enable powerkey and resin nodes to let the board handle POWER and Volume- keys properly. Signed-off-by: Dmitry Baryshkov Tested-by: Amit Pundir Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210916151341.1797512-3-dmitry.baryshkov@linaro.org commit c5c24373ad0cb412002fe543683eab34189ec5ba Author: Dmitry Baryshkov Date: Thu Sep 16 18:13:40 2021 +0300 arm64: dts: qcom: pm8150: specify reboot mode magics Specify recovery and bootloader magic values to be programmed by the qcom-pon driver. This allows the bootloader to handle reboot-to-bootloader functionality. Signed-off-by: Dmitry Baryshkov Tested-by: Amit Pundir Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210916151341.1797512-2-dmitry.baryshkov@linaro.org commit a153d317168aa3d61a204fadc85bac3995381d33 Author: Dmitry Baryshkov Date: Thu Sep 16 18:13:39 2021 +0300 arm64: dts: qcom: pm8150: use qcom,pm8998-pon binding Change pm8150 to use the qcom,pm8998-pon compatible string for the pon in order to pass reboot mode properly. Fixes: 5101f22a5c37 ("arm64: dts: qcom: pm8150: Add base dts file") Signed-off-by: Dmitry Baryshkov Tested-by: Amit Pundir Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210916151341.1797512-1-dmitry.baryshkov@linaro.org commit 66019837a5563e1f80a4228b7d110d8c52bfdd8b Author: Konstantin Komarov Date: Wed Sep 22 18:50:58 2021 +0300 fs/ntfs3: Refactoring lock in ntfs_init_acl This is possible because of moving lock into ntfs_create_inode. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit ba77237ef880320105e681b93d596b2fb13860f9 Author: Konstantin Komarov Date: Wed Sep 22 18:46:14 2021 +0300 fs/ntfs3: Change posix_acl_equiv_mode to posix_acl_update_mode Right now ntfs3 uses posix_acl_equiv_mode instead of posix_acl_update_mode like all other fs. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 398c35f4d78410725e154c2fc0a51ecac05a3f1f Author: Konstantin Komarov Date: Wed Sep 22 18:33:38 2021 +0300 fs/ntfs3: Pass flags to ntfs_set_ea in ntfs_set_acl_ex In case of removing of xattr there must be XATTR_REPLACE flag and zero length. We already check XATTR_REPLACE in ntfs_set_ea, so now we pass XATTR_REPLACE to ntfs_set_ea. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0bd5fdb811b0449fcef948a100099cc3197f1b73 Author: Konstantin Komarov Date: Wed Sep 22 18:28:36 2021 +0300 fs/ntfs3: Refactor ntfs_get_acl_ex for better readability We can safely move set_cached_acl because it works with NULL acl too. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit d562e901f25d275b55b0496fe01935beeff0ed37 Author: Konstantin Komarov Date: Thu Sep 23 18:04:26 2021 +0300 fs/ntfs3: Move ni_lock_dir and ni_unlock into ntfs_create_inode Now ntfs3 locks mutex for smaller time. Theoretically in successful cases those locks aren't needed at all. But proving the same for error cases is difficult. So instead of removing them we just move them. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 6c1ee4d304983d2f68bf7639d5912f781398d5ac Author: Konstantin Komarov Date: Thu Sep 23 18:05:36 2021 +0300 fs/ntfs3: Fix logical error in ntfs_create_inode We need to always call indx_delete_entry after indx_insert_entry if error occurred. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit a86cd017a40a66b1a3db005bfee4e76a1ae9a432 Author: Leon Romanovsky Date: Mon Sep 13 11:04:42 2021 +0300 RDMA/usnic: Lock VF with mutex instead of spinlock Usnic VF doesn't need lock in atomic context to create QPs, so it is safe to use mutex instead of spinlock. Such change fixes the following smatch error. Smatch static checker warning: lib/kobject.c:289 kobject_set_name_vargs() warn: sleeping in atomic context Fixes: 514aee660df4 ("RDMA: Globally allocate and release QP memory") Link: https://lore.kernel.org/r/2a0e295786c127e518ebee8bb7cafcb819a625f6.1631520231.git.leonro@nvidia.com Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Reviewed-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit adfc8f9d2f9fefd880abc82cfbf62cbfe6539c97 Author: Randy Dunlap Date: Thu Sep 23 17:29:39 2021 -0700 NIOS2: fix kconfig unmet dependency warning for SERIAL_CORE_CONSOLE SERIAL_CORE_CONSOLE depends on TTY so EARLY_PRINTK should also depend on TTY so that it does not select SERIAL_CORE_CONSOLE inadvertently. WARNING: unmet direct dependencies detected for SERIAL_CORE_CONSOLE Depends on [n]: TTY [=n] && HAS_IOMEM [=y] Selected by [y]: - EARLY_PRINTK [=y] Fixes: e8bf5bc776ed ("nios2: add early printk support") Signed-off-by: Randy Dunlap Cc: Dinh Nguyen Signed-off-by: Dinh Nguyen commit 4526fe74c3c5095cc55931a3a6fb4932f9e06002 Author: Daniele Palmas Date: Fri Sep 24 11:26:52 2021 +0200 drivers: net: mhi: fix error path in mhi_net_newlink Fix double free_netdev when mhi_prepare_for_transfer fails. Fixes: 3ffec6a14f24 ("net: Add mhi-net driver") Signed-off-by: Daniele Palmas Reviewed-by: Manivannan Sadhasivam Reviewed-by: Loic Poulain Signed-off-by: David S. Miller commit 5ab8a447bcfee1ded709e7ff5dc7608ca9f66ae2 Author: Aaro Koskinen Date: Fri Sep 24 01:00:16 2021 +0300 smsc95xx: fix stalled rx after link change After commit 05b35e7eb9a1 ("smsc95xx: add phylib support"), link changes are no longer propagated to usbnet. As a result, rx URB allocation won't happen until there is a packet sent out first (this might never happen, e.g. running just ssh server with a static IP). Fix by triggering usbnet EVENT_LINK_CHANGE. Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support") Signed-off-by: Aaro Koskinen Signed-off-by: David S. Miller commit 5cad87569164fbdd5279504d7bc089aea51bf0f4 Merge: cd586d213e583 298ba0e3d4af5 Author: Jens Axboe Date: Fri Sep 24 07:15:21 2021 -0600 Merge tag 'nvme-5.15-2021-09-24' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.15: - keep ctrl->namespaces ordered (me) - fix incorrect h2cdata pdu offset accounting in nvme-tcp (Sagi Grimberg) - handled updated hw_queues in nvme-fc more carefully (Daniel Wagner, James Smart)" * tag 'nvme-5.15-2021-09-24' of git://git.infradead.org/nvme: nvme: keep ctrl->namespaces ordered nvme-tcp: fix incorrect h2cdata pdu offset accounting nvme-fc: remove freeze/unfreeze around update_nr_hw_queues nvme-fc: avoid race between time out and tear down nvme-fc: update hardware queues before using them commit fa2a30f8e0aa9304919750b116a9e9e322465299 Author: Biju Das Date: Wed Sep 22 12:24:05 2021 +0100 clk: renesas: rzg2l: Fix clk status function As per RZ/G2L HW(Rev.0.50) manual, clock monitor register value 0 means clock is not supplied and 1 means clock is supplied. This patch fixes the issue by removing the inverted logic. Fixing the above, triggered following 2 issues 1) GIC interrupts don't work if we disable IA55_CLK and DMAC_ACLK. Fixed this issue by adding these clocks as critical clocks. 2) DMA is not working, since the DMA driver is not turning on DMAC_PCLK. So will provide a fix in the DMA driver to turn on DMA_PCLK. Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20210922112405.26413-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 664bb2e45b89cd8213e3c9772713323f75e21892 Author: Biju Das Date: Wed Sep 22 12:24:04 2021 +0100 clk: renesas: r9a07g044: Mark IA55_CLK and DMAC_ACLK critical Add IA55_CLK and DMAC_ACLK as critical clocks. Previously it worked ok, because of a bug in clock status function and the following patch in this series fixes the original bug. Fixes: c3e67ad6f5a2 ("dt-bindings: clock: r9a07g044-cpg: Update clock/reset definitions") Fixes: eb829e549ba6 ("clk: renesas: r9a07g044: Add DMAC clocks/resets") Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20210922112405.26413-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 597aa16c782496bf74c5dc3b45ff472ade6cee64 Author: Xiao Liang Date: Thu Sep 23 23:03:19 2021 +0800 net: ipv4: Fix rtnexthop len when RTA_FLOW is present Multipath RTA_FLOW is embedded in nexthop. Dump it in fib_add_nexthop() to get the length of rtnexthop correct. Fixes: b0f60193632e ("ipv4: Refactor nexthop attributes in fib_dump_info") Signed-off-by: Xiao Liang Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 325fd36ae76a6d089983b2d2eccb41237d35b221 Author: Vladimir Oltean Date: Thu Sep 23 16:23:33 2021 +0300 net: enetc: fix the incorrect clearing of IF_MODE bits The enetc phylink .mac_config handler intends to clear the IFMODE field (bits 1:0) of the PM0_IF_MODE register, but incorrectly clears all the other fields instead. For normal operation, the bug was inconsequential, due to the fact that we write the PM0_IF_MODE register in two stages, first in phylink .mac_config (which incorrectly cleared out a bunch of stuff), then we update the speed and duplex to the correct values in phylink .mac_link_up. Judging by the code (not tested), it looks like maybe loopback mode was broken, since this is one of the settings in PM0_IF_MODE which is incorrectly cleared. Fixes: c76a97218dcb ("net: enetc: force the RGMII speed and duplex instead of operating in inband mode") Reported-by: Pavel Machek (CIP) Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f9bfed3ad5b1662426479be2c7b26a608560b7d4 Merge: e4e737bb5c170 b78f26926b17c Author: Thomas Gleixner Date: Fri Sep 24 14:11:04 2021 +0200 Merge tag 'irqchip-fixes-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Work around a bad GIC integration on a Renesas platform, where the interconnect cannot deal with byte-sized MMIO accesses - Cleanup another Renesas driver abusing the comma operator - Fix a potential GICv4 memory leak on an error path - Make the type of 'size' consistent with the rest of the code in __irq_domain_add() - Fix a regression in the Armada 370-XP IPI path - Fix the build for the obviously unloved goldfish-pic - Some documentation fixes Link: https://lore.kernel.org/r/20210924090933.2766857-1-maz@kernel.org commit 6f7d70467121f790b36af2d84bc02b5c236bf5e6 Author: Uwe Kleine-König Date: Thu Sep 23 22:11:13 2021 +0200 hwmon: (ltc2947) Properly handle errors when looking for the external clock The return value of devm_clk_get should in general be propagated to upper layer. In this case the clk is optional, use the appropriate wrapper instead of interpreting all errors as "The optional clk is not available". Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210923201113.398932-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 724e8af85854c4d3401313b6dd7d79cf792d8990 Author: Paul Fertser Date: Fri Sep 24 12:30:11 2021 +0300 hwmon: (tmp421) fix rounding for negative values Old code produces -24999 for 0b1110011100000000 input in standard format due to always rounding up rather than "away from zero". Use the common macro for division, unify and simplify the conversion code along the way. Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips") Signed-off-by: Paul Fertser Link: https://lore.kernel.org/r/20210924093011.26083-3-fercerpav@gmail.com Signed-off-by: Guenter Roeck commit 540effa7f283d25bcc13c0940d808002fee340b8 Author: Paul Fertser Date: Fri Sep 24 12:30:10 2021 +0300 hwmon: (tmp421) report /PVLD condition as fault For both local and remote sensors all the supported ICs can report an "undervoltage lockout" condition which means the conversion wasn't properly performed due to insufficient power supply voltage and so the measurement results can't be trusted. Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips") Signed-off-by: Paul Fertser Link: https://lore.kernel.org/r/20210924093011.26083-2-fercerpav@gmail.com Signed-off-by: Guenter Roeck commit 2938b2978a70d4cc10777ee71c9e512ffe4e0f4b Author: Paul Fertser Date: Fri Sep 24 12:30:09 2021 +0300 hwmon: (tmp421) handle I2C errors Function i2c_smbus_read_byte_data() can return a negative error number instead of the data read if I2C transaction failed for whatever reason. Lack of error checking can lead to serious issues on production hardware, e.g. errors treated as temperatures produce spurious critical temperature-crossed-threshold errors in BMC logs for OCP server hardware. The patch was tested with Mellanox OCP Mezzanine card emulating TMP421 protocol for temperature sensing which sometimes leads to I2C protocol error during early boot up stage. Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips") Cc: stable@vger.kernel.org Signed-off-by: Paul Fertser Link: https://lore.kernel.org/r/20210924093011.26083-1-fercerpav@gmail.com [groeck: dropped unnecessary line breaks] Signed-off-by: Guenter Roeck commit 14351f08ed5c8b888cdd95651152db7e096ee27f Author: Jason Gunthorpe Date: Thu Sep 16 12:05:28 2021 -0300 RDMA/hns: Work around broken constant propagation in gcc 8 gcc 8.3 and 5.4 throw this: In function 'modify_qp_init_to_rtr', ././include/linux/compiler_types.h:322:38: error: call to '__compiletime_assert_1859' declared with attribute error: FIELD_PREP: value too large for the field _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) [..] drivers/infiniband/hw/hns/hns_roce_common.h:91:52: note: in expansion of macro 'FIELD_PREP' *((__le32 *)ptr + (field_h) / 32) |= cpu_to_le32(FIELD_PREP( \ ^~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_common.h:95:39: note: in expansion of macro '_hr_reg_write' #define hr_reg_write(ptr, field, val) _hr_reg_write(ptr, field, val) ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4412:2: note: in expansion of macro 'hr_reg_write' hr_reg_write(context, QPC_LP_PKTN_INI, lp_pktn_ini); Because gcc has miscalculated the constantness of lp_pktn_ini: mtu = ib_mtu_enum_to_int(ib_mtu); if (WARN_ON(mtu < 0)) [..] lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu); Since mtu is limited to {256,512,1024,2048,4096} lp_pktn_ini is between 4 and 8 which is compatible with the 4 bit field in the FIELD_PREP. Work around this broken compiler by adding a 'can never be true' constraint on lp_pktn_ini's value which clears out the problem. Fixes: f0cb411aad23 ("RDMA/hns: Use new interface to modify QP context") Link: https://lore.kernel.org/r/0-v1-c773ecb137bc+11f-hns_gcc8_jgg@nvidia.com Reported-by: Geert Uytterhoeven Signed-off-by: Jason Gunthorpe commit 9fde0348640252c79d462c4d29a09a14e8741f5c Author: Christoph Hellwig Date: Thu Sep 16 09:04:05 2021 +0200 m68k: Remove set_fs() Add a m68k-only set_fc helper to set the SFC and DFC registers for the few places that need to override it for special MM operations, but disconnect that from the deprecated kernel-wide set_fs() API. Note that the SFC/DFC registers are context switched, so there is no need to disable preemption. Partially based on an earlier patch from Linus Torvalds . Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-7-hch@lst.de Signed-off-by: Geert Uytterhoeven commit 8ade83390930d61c64fe3ab49081990c9d43d0d2 Author: Christoph Hellwig Date: Thu Sep 16 09:04:04 2021 +0200 m68k: Provide __{get,put}_kernel_nofault Allow non-faulting access to kernel addresses without overriding the address space. Implemented by passing the instruction name to the low-level assembly macros as an argument, and force the use of the normal move instructions for kernel access. Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-6-hch@lst.de Signed-off-by: Geert Uytterhoeven commit 01eec1af5ec49b331948ace8f2287580e1594383 Author: Christoph Hellwig Date: Thu Sep 16 09:04:03 2021 +0200 m68k: Factor the 8-byte lowlevel {get,put}_user code into helpers Add new helpers for doing the grunt work of the 8-byte {get,put}_user routines to allow for better reuse. Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-5-hch@lst.de Signed-off-by: Geert Uytterhoeven commit 25d2cae4a5578695f667e868ada38b0b73eb1080 Author: Christoph Hellwig Date: Thu Sep 16 09:04:02 2021 +0200 m68k: Use BUILD_BUG for passing invalid sizes to get_user/put_user Simplify the handling a bit by using the common helper instead of referencing undefined symbols. Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-4-hch@lst.de Signed-off-by: Geert Uytterhoeven commit c4f607c3124e4d2f33604f933b29496ce4111753 Author: Christoph Hellwig Date: Thu Sep 16 09:04:01 2021 +0200 m68k: Remove the 030 case in virt_to_phys_slow The 030 case in virt_to_phys_slow can't ever be reached, so remove it. Suggested-by: Michael Schmitz Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-3-hch@lst.de Signed-off-by: Geert Uytterhoeven commit 1dc4027bc8b524ed03c4db391cd7910eb4ee19d2 Author: Christoph Hellwig Date: Thu Sep 16 09:04:00 2021 +0200 m68k: Document that access_ok is broken for !CONFIG_CPU_HAS_ADDRESS_SPACES Document that access_ok is completely broken for coldfire and friends at the moment. Signed-off-by: Christoph Hellwig Reviewed-by: Michael Schmitz Tested-by: Michael Schmitz Link: https://lore.kernel.org/r/20210916070405.52750-2-hch@lst.de Signed-off-by: Geert Uytterhoeven commit 0d20abde987bed05a8963c8aa4276019d54ff9e7 Author: Al Viro Date: Sun Jul 25 17:20:13 2021 +0000 m68k: Leave stack mangling to asm wrapper of sigreturn() sigreturn has to deal with an unpleasant problem - exception stack frames have different sizes, depending upon the exception (and processor model, as well) and variable-sized part of exception frame may contain information needed for instruction restart. So when signal handler terminates and calls sigreturn to resume the execution at the place where we'd been when we caught the signal, it has to rearrange the frame at the bottom of kernel stack. Worse, it might need to open a gap in the kernel stack, shifting pt_regs towards lower addresses. Doing that from C is insane - we'd need to shift stack frames (return addresses, local variables, etc.) of C call chain, right under the nose of compiler and hope it won't fall apart horribly. What had been actually done is only slightly less insane - an inline asm in mangle_kernel_stack() moved the stuff around, then reset stack pointer and jumped to label in asm glue. However, we can avoid all that mess if the asm wrapper we have to use anyway would reserve some space on the stack between switch_stack and the C stack frame of do_{rt_,}sigreturn(). Then C part can simply memmove() pt_regs + switch_stack, memcpy() the variable part of exception frame into the opened gap - all of that without inline asm, buggering C call chain, magical jumps to asm labels, etc. Asm wrapper would need to know where the moved switch_stack has ended up - it might have been shifted into the gap we'd reserved before do_rt_sigreturn() call. That's where it needs to set the stack pointer to. So let the C part return just that and be done with that. While we are at it, the call of berr_040cleanup() we need to do when returning via 68040 bus error exception frame can be moved into C part as well. Signed-off-by: Al Viro Tested-by: Michael Schmitz Reviewed-by: Michael Schmitz Tested-by: Finn Thain Link: https://lore.kernel.org/r/YP2dTQPm1wGPWFgD@zeniv-ca.linux.org.uk Signed-off-by: Geert Uytterhoeven commit 50e43a57334400668952f8e551c9d87d3ed2dfef Author: Al Viro Date: Sun Jul 25 17:19:45 2021 +0000 m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal We get there when sigreturn has performed obscene acts on kernel stack; in particular, the location of pt_regs has shifted. We are about to call syscall_trace(), which might stop for tracer. If that happens, we'd better have task_pt_regs() returning correct result... Fucked-up-by: Al Viro Fixes: bd6f56a75bb2 ("m68k: Missing syscall_trace() on sigreturn") Signed-off-by: Al Viro Tested-by: Michael Schmitz Reviewed-by: Michael Schmitz Tested-by: Finn Thain Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@zeniv-ca.linux.org.uk Signed-off-by: Geert Uytterhoeven commit 4bb0bd81ce5e97092dfda6a106d414b703ec0ee8 Author: Al Viro Date: Sun Jul 25 17:19:00 2021 +0000 m68k: Handle arrivals of multiple signals correctly When we have several pending signals, have entered with the kernel with large exception frame *and* have already built at least one sigframe, regs->stkadj is going to be non-zero and regs->format/sr/pc are going to be junk - the real values are in shifted exception stack frame we'd built when putting together the first sigframe. If that happens, subsequent sigframes are going to be garbage. Not hard to fix - just need to find the "adjusted" frame first and look for format/vector/sr/pc in it. Signed-off-by: Al Viro Tested-by: Michael Schmitz Reviewed-by: Michael Schmitz Tested-by: Finn Thain Link: https://lore.kernel.org/r/YP2dBIAPTaVvHiZ6@zeniv-ca.linux.org.uk Signed-off-by: Geert Uytterhoeven commit fb8c3a3c52400512fc8b3b61150057b888c30b0d Author: Arnd Bergmann Date: Mon Sep 20 14:23:44 2021 +0200 ath5k: fix building with LEDS=m Randconfig builds still show a failure for the ath5k driver, similar to the one that was fixed for ath9k earlier: WARNING: unmet direct dependencies detected for MAC80211_LEDS Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y]) Selected by [m]: - ATH5K [=m] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_ATH [=y] && (PCI [=y] || ATH25) && MAC80211 [=y] net/mac80211/led.c: In function 'ieee80211_alloc_led_names': net/mac80211/led.c:34:22: error: 'struct led_trigger' has no member named 'name' 34 | local->rx_led.name = kasprintf(GFP_KERNEL, "%srx", | ^ Copying the same logic from my ath9k patch makes this one work as well, stubbing out the calls to the LED subsystem. Fixes: b64acb28da83 ("ath9k: fix build error with LEDS_CLASS=m") Fixes: 72cdab808714 ("ath9k: Do not select MAC80211_LEDS by default") Fixes: 3a078876caee ("ath5k: convert LED code to use mac80211 triggers") Link: https://lore.kernel.org/all/20210722105501.1000781-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210920122359.353810-1-arnd@kernel.org commit 5ba1071f7554c4027bdbd712a146111de57918de Author: Numfor Mbiziwo-Tiapo Date: Thu Sep 23 09:18:43 2021 -0700 x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses Don't perform unaligned loads in __get_next() and __peek_nbyte_next() as these are forms of undefined behavior: "A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the pointed-to type, the behavior is undefined." (from http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf) These problems were identified using the undefined behavior sanitizer (ubsan) with the tools version of the code and perf test. [ bp: Massage commit message. ] Signed-off-by: Numfor Mbiziwo-Tiapo Signed-off-by: Ian Rogers Signed-off-by: Borislav Petkov Acked-by: Masami Hiramatsu Link: https://lkml.kernel.org/r/20210923161843.751834-1-irogers@google.com commit 50b078184604fea95adbb144ff653912fb0e48c6 Merge: 386ca9d7fd189 e840f42a49925 Author: Paolo Bonzini Date: Fri Sep 24 06:04:42 2021 -0400 Merge tag 'kvmarm-fixes-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm64 fixes for 5.15, take #1 - Add missing FORCE target when building the EL2 object - Fix a PMU probe regression on some platforms commit 420070197b11a0525591116326178794c1f7b9d0 Merge: f7e745f8e9449 3f4a08909e2c7 Author: David S. Miller Date: Fri Sep 24 10:51:36 2021 +0100 Merge branch 'mptcp-fixes' Mat Martineau says: ==================== mptcp: Bug fixes This patch set includes two separate fixes for the net tree: Patch 1 makes sure that MPTCP token searches are always limited to the appropriate net namespace. Patch 2 allows userspace to always change the backup settings for configured endpoints even if those endpoints are not currently in use. ==================== Signed-off-by: David S. Miller commit 3f4a08909e2c740f8045efc74c4cf82eeaae3e36 Author: Davide Caratti Date: Thu Sep 23 17:04:12 2021 -0700 mptcp: allow changing the 'backup' bit when no sockets are open current Linux refuses to change the 'backup' bit of MPTCP endpoints, i.e. using MPTCP_PM_CMD_SET_FLAGS, unless it finds (at least) one subflow that matches the endpoint address. There is no reason for that, so we can just ignore the return value of mptcp_nl_addr_backup(). In this way, endpoints can reconfigure their 'backup' flag even if no MPTCP sockets are open (or more generally, in case the MP_PRIO message is not sent out). Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ea1300b9df7c8e8b65695a08b8f6aaf4b25fec9c Author: Florian Westphal Date: Thu Sep 23 17:04:11 2021 -0700 mptcp: don't return sockets in foreign netns mptcp_token_get_sock() may return a mptcp socket that is in a different net namespace than the socket that received the token value. The mptcp syncookie code path had an explicit check for this, this moves the test into mptcp_token_get_sock() function. Eventually token.c should be converted to pernet storage, but such change is not suitable for net tree. Fixes: 2c5ebd001d4f0 ("mptcp: refactor token container") Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f7e745f8e94492a8ac0b0a26e25f2b19d342918f Author: Xin Long Date: Thu Sep 23 00:05:04 2021 -0400 sctp: break out if skb_header_pointer returns NULL in sctp_rcv_ootb We should always check if skb_header_pointer's return is NULL before using it, otherwise it may cause null-ptr-deref, as syzbot reported: KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:sctp_rcv_ootb net/sctp/input.c:705 [inline] RIP: 0010:sctp_rcv+0x1d84/0x3220 net/sctp/input.c:196 Call Trace: sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109 ip6_protocol_deliver_rcu+0x2e9/0x1ca0 net/ipv6/ip6_input.c:422 ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472 dst_input include/net/dst.h:460 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x28c/0x3c0 net/ipv6/ip6_input.c:297 Fixes: 3acb50c18d8d ("sctp: delay as much as possible skb_linearize") Reported-by: syzbot+581aff2ae6b860625116@syzkaller.appspotmail.com Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 41608b64b10b80fe00dd253cd8326ec8ad85930f Author: Long Li Date: Mon Aug 30 16:13:27 2021 -0700 PCI: hv: Fix sleep while in non-sleep context when removing child devices from the bus In hv_pci_bus_exit, the code is holding a spinlock while calling pci_destroy_slot(), which takes a mutex. This is not safe for spinlock. Fix this by moving the children to be deleted to a list on the stack, and removing them after spinlock is released. Fixes: 94d22763207a ("PCI: hv: Fix a race condition when removing the device") Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Dexuan Cui Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: "Krzysztof Wilczyński" Cc: Bjorn Helgaas Cc: Michael Kelley Reported-by: Dan Carpenter Link: https://lore.kernel.org/linux-hyperv/20210823152130.GA21501@kili/ Signed-off-by: Long Li Reviewed-by: Wei Liu Link: https://lore.kernel.org/r/1630365207-20616-1-git-send-email-longli@linuxonhyperv.com Signed-off-by: Wei Liu commit 0292dbd7bd779b878942c3977507459f8a3e4e78 Merge: f7d848e0fdfa5 9e3eed534f823 Author: Greg Kroah-Hartman Date: Fri Sep 24 10:22:53 2021 +0200 Merge tag 'usb-serial-5.15-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.15-rc3 Here's a fix for a regression affecting some CP2102 devices and a host of new device ids. Included are also a couple of cleanups of duplicate device ids, which are also tagged for stable to keep the tables in sync, and a trivial patch to help debugging cp210x issues. All have been in linux-next with no reported issues. Note however that the last last two device-id commits were rebased to fix up a lore link in a commit message (as the patch itself never made it to the list). * tag 'usb-serial-5.15-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add device id for Foxconn T99W265 USB: serial: cp210x: add ID for GW Instek GDM-834x Digital Multimeter USB: serial: cp210x: add part-number debug printk USB: serial: cp210x: fix dropped characters with CP2102 USB: serial: option: remove duplicate USB device ID USB: serial: mos7840: remove duplicated 0xac24 device ID USB: serial: option: add Telit LN920 compositions commit 0e14ef38669ce4faa80589247fe8ed8a3780f414 Author: Josh Poimboeuf Date: Tue Sep 21 22:40:26 2021 -0700 crypto: x86/sm4 - Fix frame pointer stack corruption sm4_aesni_avx_crypt8() sets up the frame pointer (which includes pushing RBP) before doing a conditional sibling call to sm4_aesni_avx_crypt4(), which sets up an additional frame pointer. Things will not go well when sm4_aesni_avx_crypt4() pops only the innermost single frame pointer and then tries to return to the outermost frame pointer. Sibling calls need to occur with an empty stack frame. Do the conditional sibling call *before* setting up the stack pointer. This fixes the following warning: arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame Fixes: a7ee22ee1445 ("crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation") Reported-by: kernel test robot Reported-by: Arnd Bergmann Acked-by: Peter Zijlstra (Intel) Reviewed-by: Tianjia Zhang Signed-off-by: Josh Poimboeuf Signed-off-by: Herbert Xu commit 505d9dcb0f7ddf9d075e729523a33d38642ae680 Author: Dan Carpenter Date: Thu Aug 26 16:04:27 2021 +0300 crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd() There are three bugs in this code: 1) If we ccp_init_data() fails for &src then we need to free aad. Use goto e_aad instead of goto e_ctx. 2) The label to free the &final_wa was named incorrectly as "e_tag" but it should have been "e_final_wa". One error path leaked &final_wa. 3) The &tag was leaked on one error path. In that case, I added a free before the goto because the resource was local to that block. Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs") Reported-by: "minihanshen(沈明航)" Signed-off-by: Dan Carpenter Reviewed-by: John Allen Tested-by: John Allen Signed-off-by: Herbert Xu commit 9e3eed534f8235a4a596a9dae5b8a6425d81ea1a Author: Slark Xiao Date: Fri Sep 17 19:01:06 2021 +0800 USB: serial: option: add device id for Foxconn T99W265 Adding support for Foxconn device T99W265 for enumeration with PID 0xe0db. usb-devices output for 0xe0db T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 19 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=0489 ProdID=e0db Rev=05.04 S: Manufacturer=Microsoft S: Product=Generic Mobile Broadband Adapter S: SerialNumber=6c50f452 C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA 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= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option if0/1: MBIM, if2:Diag, if3:GNSS, if4: Modem Signed-off-by: Slark Xiao Link: https://lore.kernel.org/r/20210917110106.9852-1-slark_xiao@163.com [ johan: use USB_DEVICE_INTERFACE_CLASS(), amend comment ] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 3bd18ba7d859eb1fbef3beb1e80c24f6f7d7596c Author: Uwe Brandt Date: Tue Sep 21 19:54:46 2021 +0200 USB: serial: cp210x: add ID for GW Instek GDM-834x Digital Multimeter Add the USB serial device ID for the GW Instek GDM-834x Digital Multimeter. Signed-off-by: Uwe Brandt Link: https://lore.kernel.org/r/YUxFl3YUCPGJZd8Y@hovoldconsulting.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 55dd7e059098ce4bd0a55c251cb78e74604abb57 Author: Bastien Roucariès Date: Thu Sep 16 08:17:21 2021 +0000 ARM: dts: sun7i: A20-olinuxino-lime2: Fix ethernet phy-mode Commit bbc4d71d6354 ("net: phy: realtek: fix rtl8211e rx/tx delay config") sets the RX/TX delay according to the phy-mode property in the device tree. For the A20-olinuxino-lime2 board this is "rgmii", which is the wrong setting. Following the example of a900cac3750b ("ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode") the phy-mode is changed to "rgmii-id" which gets the Ethernet working again on this board. Signed-off-by: Bastien Roucariès Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20210916081721.237137-1-rouca@debian.org commit 386ca9d7fd189b641bc5a82871e38dea9f67af85 Author: Oliver Upton Date: Fri Sep 24 00:51:47 2021 +0000 selftests: KVM: Explicitly use movq to read xmm registers Compiling the KVM selftests with clang emits the following warning: >> include/x86_64/processor.h:297:25: error: variable 'xmm0' is uninitialized when used here [-Werror,-Wuninitialized] >> return (unsigned long)xmm0; where xmm0 is accessed via an uninitialized register variable. Indeed, this is a misuse of register variables, which really should only be used for specifying register constraints on variables passed to inline assembly. Rather than attempting to read xmm registers via register variables, just explicitly perform the movq from the desired xmm register. Fixes: 783e9e51266e ("kvm: selftests: add API testing infrastructure") Signed-off-by: Oliver Upton Message-Id: <20210924005147.1122357-1-oupton@google.com> Reviewed-by: Ricardo Koller Signed-off-by: Paolo Bonzini commit fbf094ce524113c694acabf3d385883f88372829 Author: Oliver Upton Date: Thu Sep 23 22:00:33 2021 +0000 selftests: KVM: Call ucall_init when setting up in rseq_test While x86 does not require any additional setup to use the ucall infrastructure, arm64 needs to set up the MMIO address used to signal a ucall to userspace. rseq_test does not initialize the MMIO address, resulting in the test spinning indefinitely. Fix the issue by calling ucall_init() during setup. Fixes: 61e52f1630f5 ("KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs") Signed-off-by: Oliver Upton Message-Id: <20210923220033.4172362-1-oupton@google.com> Signed-off-by: Paolo Bonzini commit 9ed38fd4a15417cac83967360cf20b853bfab9b6 Author: Steve French Date: Thu Sep 23 19:18:37 2021 -0500 cifs: fix incorrect check for null pointer in header_assemble Although very unlikely that the tlink pointer would be null in this case, get_next_mid function can in theory return null (but not an error) so need to check for null (not for IS_ERR, which can not be returned here). Address warning: fs/smbfs_client/connect.c:2392 cifs_match_super() warn: 'tlink' isn't an ERR_PTR Pointed out by Dan Carpenter via smatch code analysis tool CC: stable@vger.kernel.org Reported-by: Dan Carpenter Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 1db1aa98871defd9316d13f59708f2277c4f9232 Author: Steve French Date: Thu Sep 23 18:52:40 2021 -0500 smb3: correct server pointer dereferencing check to be more consistent Address warning: fs/smbfs_client/misc.c:273 header_assemble() warn: variable dereferenced before check 'treeCon->ses->server' Pointed out by Dan Carpenter via smatch code analysis tool Although the check is likely unneeded, adding it makes the code more consistent and easier to read, as the same check is done elsewhere in the function. Reported-by: Dan Carpenter Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit ef88d7a8a5c94d063311a5581d9a8f0c0e3a99cb Merge: 22a94600e28b5 b875fb313a10b Author: Dave Airlie Date: Fri Sep 24 09:39:16 2021 +1000 Merge tag 'drm-intel-fixes-2021-09-23' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15-rc3: - Fix ADL-P memory bandwidth parameters - Fix memory corruption due to a double free - Fix memory leak in DMC firmware handling Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87o88jbk3o.fsf@intel.com commit 22a94600e28b5d52cda03abd8cf34d281f6db1db Merge: e4e737bb5c170 197ae17722e98 Author: Dave Airlie Date: Fri Sep 24 08:39:02 2021 +1000 Merge tag 'amd-drm-fixes-5.15-2021-09-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-09-23: amdgpu: - Update MAINTAINERS entry for powerplay - Fix empty macros - SI DPM fix amdkfd: - SVM fixes - DMA mapping fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210923211330.20725-1-alexander.deucher@amd.com commit f9e36107ec70445fbdc2562ba5b60c0a7ed57c20 Merge: 831c9bd3dafc8 0619b7901473c Author: Linus Torvalds Date: Thu Sep 23 14:39:41 2021 -0700 Merge tag 'for-5.15-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - regression fix for leak of transaction handle after verity rollback failure - properly reset device last error between mounts - improve one error handling case when checksumming bios - fixup confusing displayed size of space info free space * tag 'for-5.15-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: prevent __btrfs_dump_space_info() to underflow its free space btrfs: fix mount failure due to past and transient device flush error btrfs: fix transaction handle leak after verity rollback failure btrfs: replace BUG_ON() in btrfs_csum_one_bio() with proper error handling commit b06d893ef2492245d0319b4136edb4c346b687a3 Author: Steve French Date: Thu Sep 23 16:00:31 2021 -0500 smb3: correct smb3 ACL security descriptor Address warning: fs/smbfs_client/smb2pdu.c:2425 create_sd_buf() warn: struct type mismatch 'smb3_acl vs cifs_acl' Pointed out by Dan Carpenter via smatch code analysis tool Reported-by: Dan Carpenter Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 831c9bd3dafc811bd5f740777fd1ef92b08bb0e4 Merge: f10f0481a5b58 a3727a8bac0a9 Author: Linus Torvalds Date: Thu Sep 23 14:17:06 2021 -0700 Merge tag 'selinux-pr-20210923' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux/Smack fixes from Paul Moore: "Another single-patch pull request for SELinux, as well as Smack. This fixes some credential misuse and is explained reasonably well in the patch description" * tag 'selinux-pr-20210923' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux,smack: fix subjective/objective credential use mixups commit 4f22262280ccb5c0a18a42029313938aabfaff12 Author: Steve French Date: Thu Sep 23 12:42:35 2021 -0500 cifs: Clear modified attribute bit from inode flags Clear CIFS_INO_MODIFIED_ATTR bit from inode flags after updating mtime and ctime Signed-off-by: Rohith Surabattula Reviewed-by: Paulo Alcantara (SUSE) Acked-by: Ronnie Sahlberg Cc: stable@vger.kernel.org # 5.13+ Signed-off-by: Steve French commit 28406a21999152ff7faa30b194f734565bdd8e0d Author: Rajendra Nayak Date: Thu Sep 23 15:01:27 2021 +0530 pinctrl: qcom: sc7280: Add PM suspend callbacks Use PM suspend callbacks from msm core, without this the hog_sleep pins don't change state in suspend. Signed-off-by: Rajendra Nayak Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1632389487-11283-1-git-send-email-rnayak@codeaurora.org Signed-off-by: Linus Walleij commit 197ae17722e989942b36e33e044787877f158574 Author: Philip Yang Date: Mon Sep 20 17:25:52 2021 -0400 drm/amdkfd: fix svm_migrate_fini warning Device manager releases device-specific resources when a driver disconnects from a device, devm_memunmap_pages and devm_release_mem_region calls in svm_migrate_fini are redundant. It causes below warning trace after patch "drm/amdgpu: Split amdgpu_device_fini into early and late", so remove function svm_migrate_fini. BUG: https://gitlab.freedesktop.org/drm/amd/-/issues/1718 WARNING: CPU: 1 PID: 3646 at drivers/base/devres.c:795 devm_release_action+0x51/0x60 Call Trace: ? memunmap_pages+0x360/0x360 svm_migrate_fini+0x2d/0x60 [amdgpu] kgd2kfd_device_exit+0x23/0xa0 [amdgpu] amdgpu_amdkfd_device_fini_sw+0x1d/0x30 [amdgpu] amdgpu_device_fini_sw+0x45/0x290 [amdgpu] amdgpu_driver_release_kms+0x12/0x30 [amdgpu] drm_dev_release+0x20/0x40 [drm] release_nodes+0x196/0x1e0 device_release_driver_internal+0x104/0x1d0 driver_detach+0x47/0x90 bus_remove_driver+0x7a/0xd0 pci_unregister_driver+0x3d/0x90 amdgpu_exit+0x11/0x20 [amdgpu] Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7d6687200a939176847090bbde5cb79a82792a2f Author: Philip Yang Date: Fri Sep 17 14:32:14 2021 -0400 drm/amdkfd: handle svm migrate init error If svm migration init failed to create pgmap for device memory, set pgmap type to 0 to disable device SVM support capability. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ab39d3cef526ba09c4c6923b4cd7e6ec1c5d4faa Author: Lijo Lazar Date: Thu Sep 23 11:58:43 2021 +0800 drm/amd/pm: Update intermediate power state for SI Update the current state as boot state during dpm initialization. During the subsequent initialization, set_power_state gets called to transition to the final power state. set_power_state refers to values from the current state and without current state populated, it could result in NULL pointer dereference. For ex: on platforms where PCI speed change is supported through ACPI ATCS method, the link speed of current state needs to be queried before deciding on changing to final power state's link speed. The logic to query ATCS-support was broken on certain platforms. The issue became visible when broken ATCS-support logic got fixed with commit f9b7f3703ff9 ("drm/amdgpu/acpi: make ATPX/ATCS structures global (v2)"). Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1698 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8bd8d1dff9eb90255c030d2e52a4f65a7fef33a9 Author: Colin Ian King Date: Thu Sep 2 22:26:31 2021 +0100 vfio/pci: add missing identifier name in argument of function prototype The function prototype is missing an identifier name. Add one. Signed-off-by: Colin Ian King Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20210902212631.54260-1-colin.king@canonical.com Signed-off-by: Alex Williamson commit 305d568b72f17f674155a2a8275f865f207b3808 Author: Jason Gunthorpe Date: Thu Sep 16 15:34:46 2021 -0300 RDMA/cma: Ensure rdma_addr_cancel() happens before issuing more requests The FSM can run in a circle allowing rdma_resolve_ip() to be called twice on the same id_priv. While this cannot happen without going through the work, it violates the invariant that the same address resolution background request cannot be active twice. CPU 1 CPU 2 rdma_resolve_addr(): RDMA_CM_IDLE -> RDMA_CM_ADDR_QUERY rdma_resolve_ip(addr_handler) #1 process_one_req(): for #1 addr_handler(): RDMA_CM_ADDR_QUERY -> RDMA_CM_ADDR_BOUND mutex_unlock(&id_priv->handler_mutex); [.. handler still running ..] rdma_resolve_addr(): RDMA_CM_ADDR_BOUND -> RDMA_CM_ADDR_QUERY rdma_resolve_ip(addr_handler) !! two requests are now on the req_list rdma_destroy_id(): destroy_id_handler_unlock(): _destroy_id(): cma_cancel_operation(): rdma_addr_cancel() // process_one_req() self removes it spin_lock_bh(&lock); cancel_delayed_work(&req->work); if (!list_empty(&req->list)) == true ! rdma_addr_cancel() returns after process_on_req #1 is done kfree(id_priv) process_one_req(): for #2 addr_handler(): mutex_lock(&id_priv->handler_mutex); !! Use after free on id_priv rdma_addr_cancel() expects there to be one req on the list and only cancels the first one. The self-removal behavior of the work only happens after the handler has returned. This yields a situations where the req_list can have two reqs for the same "handle" but rdma_addr_cancel() only cancels the first one. The second req remains active beyond rdma_destroy_id() and will use-after-free id_priv once it inevitably triggers. Fix this by remembering if the id_priv has called rdma_resolve_ip() and always cancel before calling it again. This ensures the req_list never gets more than one item in it and doesn't cost anything in the normal flow that never uses this strange error path. Link: https://lore.kernel.org/r/0-v1-3bc675b8006d+22-syz_cancel_uaf_jgg@nvidia.com Cc: stable@vger.kernel.org Fixes: e51060f08a61 ("IB: IP address based RDMA connection manager") Reported-by: syzbot+dc3dfba010d7671e05f5@syzkaller.appspotmail.com Signed-off-by: Jason Gunthorpe commit f63251184a81039ebc805306505838c2a073e51a Author: Philip Yang Date: Tue Sep 14 16:33:40 2021 -0400 drm/amdkfd: fix dma mapping leaking warning For xnack off, restore work dma unmap previous system memory page, and dma map the updated system memory page to update GPU mapping, this is not dma mapping leaking, remove the WARN_ONCE for dma mapping leaking. prange->dma_addr store the VRAM page pfn after the range migrated to VRAM, should not dma unmap VRAM page when updating GPU mapping or remove prange. Add helper svm_is_valid_dma_mapping_addr to check VRAM page and error cases. Mask out SVM_RANGE_VRAM_DOMAIN flag in dma_addr before calling amdgpu vm update to avoid BUG_ON(*addr & 0xFFFF00000000003FULL), and set it again immediately after. This flag is used to know the type of page later to dma unmapping system memory page. Fixes: 1d5dbfe6c06a ("drm/amdkfd: classify and map mixed svm range pages in GPU") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7beb26dcedaa977ece5be7c712a66b7b6c66fc2b Author: Philip Yang Date: Mon Sep 13 10:03:36 2021 -0400 drm/amdkfd: SVM map to gpus check vma boundary SVM range may includes multiple VMAs with different vm_flags, if prange page index is the last page of the VMA offset + npages, update GPU mapping to create GPU page table with same VMA access permission. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6de0653f7719bd0aa61f683fba16ae0e2c4ead64 Author: Alex Deucher Date: Fri Sep 17 12:05:30 2021 -0400 MAINTAINERS: fix up entry for AMD Powerplay Fix the path to cover both the older powerplay infrastructure and the newer SwSMU infrastructure. Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit c48977f020d5846215e2ff7e8172e7b46b3d64b4 Author: Arnd Bergmann Date: Mon Sep 20 14:16:00 2021 +0200 drm/amd/display: fix empty debug macros Using an empty macro expansion as a conditional expression produces a W=1 warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries': drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:156: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 775 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER"); | ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:783:155: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 783 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK"); | ^ Expand it to "do { } while (0)" instead to make the expression more robust and avoid the warning. Fixes: 56aca2309301 ("drm/amd/display: Add AUX I2C tracing.") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit 03ab9cb982b622239cc2542ce7617b98a9ea159e Author: David Howells Date: Mon Sep 20 13:14:15 2021 +0100 cifs: Deal with some warnings from W=1 Deal with some warnings generated from make W=1: (1) Add/remove/fix kerneldoc parameters descriptions. (2) Turn cifs' rqst_page_get_length()'s banner comment into a kerneldoc comment. It should probably be prefixed with "cifs_" though. Signed-off-by: David Howells Signed-off-by: Steve French commit 12064c1768439fa0882547010afae6b52aafa7af Author: Jia He Date: Thu Sep 23 11:35:57 2021 +0800 Revert "ACPI: Add memory semantics to acpi_os_map_memory()" This reverts commit 437b38c51162f8b87beb28a833c4d5dc85fa864e. The memory semantics added in commit 437b38c51162 causes SystemMemory Operation region, whose address range is not described in the EFI memory map to be mapped as NormalNC memory on arm64 platforms (through acpi_os_map_memory() in acpi_ex_system_memory_space_handler()). This triggers the following abort on an ARM64 Ampere eMAG machine, because presumably the physical address range area backing the Opregion does not support NormalNC memory attributes driven on the bus. Internal error: synchronous external abort: 96000410 [#1] SMP Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0+ #462 Hardware name: MiTAC RAPTOR EV-883832-X3-0001/RAPTOR, BIOS 0.14 02/22/2019 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [...snip...] Call trace: acpi_ex_system_memory_space_handler+0x26c/0x2c8 acpi_ev_address_space_dispatch+0x228/0x2c4 acpi_ex_access_region+0x114/0x268 acpi_ex_field_datum_io+0x128/0x1b8 acpi_ex_extract_from_field+0x14c/0x2ac acpi_ex_read_data_from_field+0x190/0x1b8 acpi_ex_resolve_node_to_value+0x1ec/0x288 acpi_ex_resolve_to_value+0x250/0x274 acpi_ds_evaluate_name_path+0xac/0x124 acpi_ds_exec_end_op+0x90/0x410 acpi_ps_parse_loop+0x4ac/0x5d8 acpi_ps_parse_aml+0xe0/0x2c8 acpi_ps_execute_method+0x19c/0x1ac acpi_ns_evaluate+0x1f8/0x26c acpi_ns_init_one_device+0x104/0x140 acpi_ns_walk_namespace+0x158/0x1d0 acpi_ns_initialize_devices+0x194/0x218 acpi_initialize_objects+0x48/0x50 acpi_init+0xe0/0x498 If the Opregion address range is not present in the EFI memory map there is no way for us to determine the memory attributes to use to map it - defaulting to NormalNC does not work (and it is not correct on a memory region that may have read side-effects) and therefore commit 437b38c51162 should be reverted, which means reverting back to the original behavior whereby address ranges that are mapped using acpi_os_map_memory() default to the safe devicenGnRnE attributes on ARM64 if the mapped address range is not defined in the EFI memory map. Fixes: 437b38c51162 ("ACPI: Add memory semantics to acpi_os_map_memory()") Signed-off-by: Jia He Acked-by: Lorenzo Pieralisi Acked-by: Catalin Marinas Signed-off-by: Rafael J. Wysocki commit f10f0481a5b58f8986f626d43f8534472f7776c2 Merge: 9bc62afe03afd 2da4a23599c26 Author: Linus Torvalds Date: Thu Sep 23 11:24:12 2021 -0700 Merge tag 'for-linus-rseq' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull rseq fixes from Paolo Bonzini: "A fix for a bug with restartable sequences and KVM. KVM's handling of TIF_NOTIFY_RESUME, e.g. for task migration, clears the flag without informing rseq and leads to stale data in userspace's rseq struct" * tag 'for-linus-rseq' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: selftests: Remove __NR_userfaultfd syscall fallback KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs tools: Move x86 syscall number fallbacks to .../uapi/ entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume() KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest commit 9bc62afe03afdf33904f5e784e1ad68c50ff00bb Merge: 1f828223b7991 4d88c339c423e Author: Linus Torvalds Date: Thu Sep 23 10:30:31 2021 -0700 Merge tag 'net-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Current release - regressions: - dsa: bcm_sf2: fix array overrun in bcm_sf2_num_active_ports() Previous releases - regressions: - introduce a shutdown method to mdio device drivers, and make DSA switch drivers compatible with masters disappearing on shutdown; preventing infinite reference wait - fix issues in mdiobus users related to ->shutdown vs ->remove - virtio-net: fix pages leaking when building skb in big mode - xen-netback: correct success/error reporting for the SKB-with-fraglist - dsa: tear down devlink port regions when tearing down the devlink port on error - nexthop: fix division by zero while replacing a resilient group - hns3: check queue, vf, vlan ids range before using Previous releases - always broken: - napi: fix race against netpoll causing NAPI getting stuck - mlx4_en: ensure link operstate is updated even if link comes up before netdev registration - bnxt_en: fix TX timeout when TX ring size is set to the smallest - enetc: fix illegal access when reading affinity_hint; prevent oops on sysfs access - mtk_eth_soc: avoid creating duplicate offload entries Misc: - core: correct the sock::sk_lock.owned lockdep annotations" * tag 'net-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits) atlantic: Fix issue in the pm resume flow. net/mlx4_en: Don't allow aRFS for encapsulated packets net: mscc: ocelot: fix forwarding from BLOCKING ports remaining enabled net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries nfc: st-nci: Add SPI ID matching DT compatible MAINTAINERS: remove Guvenc Gulce as net/smc maintainer nexthop: Fix memory leaks in nexthop notification chain listeners mptcp: ensure tx skbs always have the MPTCP ext qed: rdma - don't wait for resources under hw error recovery flow s390/qeth: fix deadlock during failing recovery s390/qeth: Fix deadlock in remove_discipline s390/qeth: fix NULL deref in qeth_clear_working_pool_list() net: dsa: realtek: register the MDIO bus under devres net: dsa: don't allocate the slave_mii_bus using devres Doc: networking: Fox a typo in ice.rst net: dsa: fix dsa_tree_setup error path net/smc: fix 'workqueue leaked lock' in smc_conn_abort_work net/smc: add missing error check in smc_clc_prfx_set() net: hns3: fix a return value error in hclge_get_reset_status() net: hns3: check vlan id before using it ... commit 04f41c68f18886aea5afc68be945e7195ea1d598 Author: Saravana Kannan Date: Wed Sep 15 10:09:39 2021 -0700 net: mdiobus: Set FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for mdiobus parents There are many instances of PHYs that depend on a switch to supply a resource (Eg: interrupts). Switches also expects the PHYs to be probed by their specific drivers as soon as they are added. If that doesn't happen, then the switch would force the use of generic PHY drivers for the PHY even if the PHY might have specific driver available. fw_devlink=on by design can cause delayed probes of PHY. To avoid, this we need to set the FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for the switch's fwnode before the PHYs are added. The most generic way to do this is to set this flag for the parent of MDIO busses which is typically the switch. For more context: https://lore.kernel.org/lkml/YTll0i6Rz3WAAYzs@lunn.ch/#t Fixes: ea718c699055 ("Revert "Revert "driver core: Set fw_devlink=on by default""") Suggested-by: Andrew Lunn Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915170940.617415-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 5501765a02a6c324f78581e6bb8209d054fe13ae Author: Saravana Kannan Date: Wed Sep 15 10:09:38 2021 -0700 driver core: fw_devlink: Add support for FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD If a parent device is also a supplier to a child device, fw_devlink=on by design delays the probe() of the child device until the probe() of the parent finishes successfully. However, some drivers of such parent devices (where parent is also a supplier) expect the child device to finish probing successfully as soon as they are added using device_add() and before the probe() of the parent device has completed successfully. One example of such a case is discussed in the link mentioned below. Add a flag to make fw_devlink=on not enforce these supplier-consumer relationships, so these drivers can continue working. Link: https://lore.kernel.org/netdev/CAGETcx_uj0V4DChME-gy5HGKTYnxLBX=TH2rag29f_p=UcG+Tg@mail.gmail.com/ Fixes: ea718c699055 ("Revert "Revert "driver core: Set fw_devlink=on by default""") Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915170940.617415-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 1f828223b7991a228bc2aef837b78737946d44b2 Author: Shakeel Butt Date: Wed Sep 22 15:49:06 2021 -0700 memcg: flush lruvec stats in the refault Prior to the commit 7e1c0d6f5820 ("memcg: switch lruvec stats to rstat") and the commit aa48e47e3906 ("memcg: infrastructure to flush memcg stats"), each lruvec memcg stats can be off by (nr_cgroups * nr_cpus * 32) at worst and for unbounded amount of time. The commit aa48e47e3906 moved the lruvec stats to rstat infrastructure and the commit 7e1c0d6f5820 bounded the error for all the lruvec stats to (nr_cpus * 32) at worst for at most 2 seconds. More specifically it decoupled the number of stats and the number of cgroups from the error rate. However this reduction in error comes with the cost of triggering the slowpath of stats update more frequently. Previously in the slowpath the kernel adds the stats up the memcg tree. After aa48e47e3906, the kernel triggers the asyn lruvec stats flush through queue_work(). This causes regression reports from 0day kernel bot [1] as well as from phoronix test suite [2]. We tried two options to fix the regression: 1) Increase the threshold to trigger the slowpath in lruvec stats update codepath from 32 to 512. 2) Remove the slowpath from lruvec stats update codepath and instead flush the stats in the page refault codepath. The assumption is that the kernel timely flush the stats, so, the update tree would be small in the refault codepath to not cause the preformance impact. Following are the results of will-it-scale/page_fault[1|2|3] benchmark on four settings i.e. (1) 5.15-rc1 as baseline (2) 5.15-rc1 with aa48e47e3906 and 7e1c0d6f5820 reverted (3) 5.15-rc1 with option-1 (4) 5.15-rc1 with option-2. test (1) (2) (3) (4) pg_f1 368563 406277 (10.23%) 399693 (8.44%) 416398 (12.97%) pg_f2 338399 372133 (9.96%) 369180 (9.09%) 381024 (12.59%) pg_f3 500853 575399 (14.88%) 570388 (13.88%) 576083 (15.02%) From the above result, it seems like the option-2 not only solves the regression but also improves the performance for at least these benchmarks. Feng Tang (intel) ran the aim7 benchmark with these two options and confirms that option-1 reduces the regression but option-2 removes the regression. Michael Larabel (phoronix) ran multiple benchmarks with these options and reported the results at [3] and it shows for most benchmarks option-2 removes the regression introduced by the commit aa48e47e3906 ("memcg: infrastructure to flush memcg stats"). Based on the experiment results, this patch proposed the option-2 as the solution to resolve the regression. Link: https://lore.kernel.org/all/20210726022421.GB21872@xsang-OptiPlex-9020 [1] Link: https://www.phoronix.com/scan.php?page=article&item=linux515-compile-regress [2] Link: https://openbenchmarking.org/result/2109226-DEBU-LINUX5104 [3] Fixes: aa48e47e3906 ("memcg: infrastructure to flush memcg stats") Signed-off-by: Shakeel Butt Tested-by: Michael Larabel Cc: Johannes Weiner Cc: Roman Gushchin Cc: Feng Tang Cc: Michal Hocko Cc: Hillf Danton , Cc: Michal Koutný Cc: Andrew Morton , Signed-off-by: Linus Torvalds commit a3727a8bac0a9e77c70820655fd8715523ba3db7 Author: Paul Moore Date: Thu Sep 23 09:50:11 2021 -0400 selinux,smack: fix subjective/objective credential use mixups Jann Horn reported a problem with commit eb1231f73c4d ("selinux: clarify task subjective and objective credentials") where some LSM hooks were attempting to access the subjective credentials of a task other than the current task. Generally speaking, it is not safe to access another task's subjective credentials and doing so can cause a number of problems. Further, while looking into the problem, I realized that Smack was suffering from a similar problem brought about by a similar commit 1fb057dcde11 ("smack: differentiate between subjective and objective task credentials"). This patch addresses this problem by restoring the use of the task's objective credentials in those cases where the task is other than the current executing task. Not only does this resolve the problem reported by Jann, it is arguably the correct thing to do in these cases. Cc: stable@vger.kernel.org Fixes: eb1231f73c4d ("selinux: clarify task subjective and objective credentials") Fixes: 1fb057dcde11 ("smack: differentiate between subjective and objective task credentials") Reported-by: Jann Horn Acked-by: Eric W. Biederman Acked-by: Casey Schaufler Signed-off-by: Paul Moore commit 82cb875313188ccbd3ac174b471c86dcb97b8626 Author: Kari Argillander Date: Tue Sep 21 20:19:01 2021 +0300 fs/ntfs3: Remove deprecated mount options nls Some discussion has been spoken that this deprecated mount options should be removed before 5.15 lands. This driver is not never seen day light so it was decided that nls mount option has to be removed. We have always possibility to add this if needed. One possible need is example if current ntfs driver will be taken out of kernel and ntfs3 needs to support mount options what it has. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 808bc0a82bcd2cbe32a139613325b1a3e03f35f1 Author: Christophe JAILLET Date: Sat Sep 18 21:56:28 2021 +0200 fs/ntfs3: Remove a useless shadowing variable There is already a 'u8 mask' defined at the top of the function. There is no need to define a new one here. Remove the useless and shadowing new 'mask' variable. Signed-off-by: Christophe JAILLET Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit d2846bf33c1423ff872c7a7c2afde292ad502c04 Author: Christophe JAILLET Date: Sat Sep 18 21:56:19 2021 +0200 fs/ntfs3: Remove a useless test in 'indx_find()' 'fnd' has been dereferenced several time before, so testing it here is pointless. Moreover, all callers of 'indx_find()' already have some error handling code that makes sure that no NULL 'fnd' is passed. So, remove the useless test. Signed-off-by: Christophe JAILLET Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit c40dd3ca2a45d5bd6e8b3f4ace5cb81493096263 Author: Yue Hu Date: Tue Sep 14 11:59:15 2021 +0800 erofs: clear compacted_2b if compacted_4b_initial > totalidx Currently, the whole indexes will only be compacted 4B if compacted_4b_initial > totalidx. So, the calculated compacted_2b is worthless for that case. It may waste CPU resources. No need to update compacted_4b_initial as mkfs since it's used to fulfill the alignment of the 1st compacted_2b pack and would handle the case above. We also need to clarify compacted_4b_end here. It's used for the last lclusters which aren't fitted in the previous compacted_2b packs. Some messages are from Xiang. Link: https://lore.kernel.org/r/20210914035915.1190-1-zbestahu@gmail.com Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu [ Gao Xiang: it's enough to use "compacted_4b_initial < totalidx". ] Signed-off-by: Gao Xiang commit d705117ddd724a9d4877e338e4587010ab6a1c62 Author: Gao Xiang Date: Wed Sep 22 17:51:41 2021 +0800 erofs: fix misbehavior of unsupported chunk format check Unsupported chunk format should be checked with "if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL)" Found when checking with 4k-byte blockmap (although currently mkfs uses inode chunk indexes format by default.) Link: https://lore.kernel.org/r/20210922095141.233938-1-hsiangkao@linux.alibaba.com Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 93368aab0efc87288cac65e99c9ed2e0ffc9e7d0 Author: Gao Xiang Date: Tue Sep 21 22:35:30 2021 +0800 erofs: fix up erofs_lookup tracepoint Fix up a misuse that the filename pointer isn't always valid in the ring buffer, and we should copy the content instead. Link: https://lore.kernel.org/r/20210921143531.81356-1-hsiangkao@linux.alibaba.com Fixes: 13f06f48f7bf ("staging: erofs: support tracepoint") Cc: stable@vger.kernel.org # 4.19+ Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 6bc6db000295332bae2c1e8815d7450b72923d23 Author: Lai Jiangshan Date: Sat Sep 18 08:56:29 2021 +0800 KVM: Remove tlbs_dirty There is no user of tlbs_dirty. Signed-off-by: Lai Jiangshan Signed-off-by: Paolo Bonzini Message-Id: <20210918005636.3675-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 65855ed8b03437e79e42f2a89a993206981ac6cb Author: Lai Jiangshan Date: Sat Sep 18 08:56:28 2021 +0800 KVM: X86: Synchronize the shadow pagetable before link it If gpte is changed from non-present to present, the guest doesn't need to flush tlb per SDM. So the host must synchronze sp before link it. Otherwise the guest might use a wrong mapping. For example: the guest first changes a level-1 pagetable, and then links its parent to a new place where the original gpte is non-present. Finally the guest can access the remapped area without flushing the tlb. The guest's behavior should be allowed per SDM, but the host kvm mmu makes it wrong. Fixes: 4731d4c7a077 ("KVM: MMU: out of sync shadow core") Signed-off-by: Lai Jiangshan Signed-off-by: Paolo Bonzini Message-Id: <20210918005636.3675-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 22b70e6f2da0a4c8b1421b00cfc3016bc9d4d9d4 Author: dann frazier Date: Thu Sep 23 08:50:02 2021 -0600 arm64: Restore forced disabling of KPTI on ThunderX A noted side-effect of commit 0c6c2d3615ef ("arm64: Generate cpucaps.h") is that cpucaps are now sorted, changing the enumeration order. This assumed no dependencies between cpucaps, which turned out not to be true in one case. UNMAP_KERNEL_AT_EL0 currently needs to be processed after WORKAROUND_CAVIUM_27456. ThunderX systems are incompatible with KPTI, so unmap_kernel_at_el0() bails if WORKAROUND_CAVIUM_27456 is set. But because of the sorting, WORKAROUND_CAVIUM_27456 will not yet have been considered when unmap_kernel_at_el0() checks for it, so the kernel tries to run w/ KPTI - and quickly falls over. Because all ThunderX implementations have homogeneous CPUs, we can remove this dependency by just checking the current CPU for the erratum. Fixes: 0c6c2d3615ef ("arm64: Generate cpucaps.h") Cc: # 5.13.x Signed-off-by: dann frazier Suggested-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose Reviewed-by: Mark Brown Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20210923145002.3394558-1-dann.frazier@canonical.com Signed-off-by: Catalin Marinas commit f81602958c115fc7c87b985f71574042a20ff858 Author: Lai Jiangshan Date: Sat Sep 18 08:56:27 2021 +0800 KVM: X86: Fix missed remote tlb flush in rmap_write_protect() When kvm->tlbs_dirty > 0, some rmaps might have been deleted without flushing tlb remotely after kvm_sync_page(). If @gfn was writable before and it's rmaps was deleted in kvm_sync_page(), and if the tlb entry is still in a remote running VCPU, the @gfn is not safely protected. To fix the problem, kvm_sync_page() does the remote flush when needed to avoid the problem. Fixes: a4ee1ca4a36e ("KVM: MMU: delay flush all tlbs on sync_page path") Signed-off-by: Lai Jiangshan Signed-off-by: Paolo Bonzini Message-Id: <20210918005636.3675-2-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit faf6b755629627f19feafa75b32e81cd7738f12d Author: Maxim Levitsky Date: Tue Sep 14 18:48:16 2021 +0300 KVM: x86: nSVM: don't copy virt_ext from vmcb12 These field correspond to features that we don't expose yet to L2 While currently there are no CVE worthy features in this field, if AMD adds more features to this field, that could allow guest escapes similar to CVE-2021-3653 and CVE-2021-3656. Signed-off-by: Maxim Levitsky Message-Id: <20210914154825.104886-6-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit d1cba6c9223751f580dcd97501f513a8a9bf88bc Author: Maxim Levitsky Date: Tue Sep 14 18:48:14 2021 +0300 KVM: x86: nSVM: test eax for 4K alignment for GP errata workaround GP SVM errata workaround made the #GP handler always emulate the SVM instructions. However these instructions #GP in case the operand is not 4K aligned, but the workaround code didn't check this and we ended up emulating these instructions anyway. This is only an emulation accuracy check bug as there is no harm for KVM to read/write unaligned vmcb images. Fixes: 82a11e9c6fa2 ("KVM: SVM: Add emulation support for #GP triggered by SVM instructions") Signed-off-by: Maxim Levitsky Message-Id: <20210914154825.104886-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 1ad32105d78e4b5da60688eca014bcd45271318f Author: Maxim Levitsky Date: Tue Sep 14 18:48:13 2021 +0300 KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0 Test that if: * L1 disables virtual interrupt masking, and INTR intercept. * L1 setups a virtual interrupt to be injected to L2 and enters L2 with interrupts disabled, thus the virtual interrupt is pending. * Now an external interrupt arrives in L1 and since L1 doesn't intercept it, it should be delivered to L2 when it enables interrupts. to do this L0 (abuses) V_IRQ to setup an interrupt window, and returns to L2. * L2 enables interrupts. This should trigger the interrupt window, injection of the external interrupt and delivery of the virtual interrupt that can now be done. * Test that now L2 gets those interrupts. This is the test that demonstrates the issue that was fixed in the previous patch. Signed-off-by: Maxim Levitsky Message-Id: <20210914154825.104886-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit aee77e1169c1900fe4248dc186962e745b479d9e Author: Maxim Levitsky Date: Tue Sep 14 18:48:12 2021 +0300 KVM: x86: nSVM: restore int_vector in svm_clear_vintr In svm_clear_vintr we try to restore the virtual interrupt injection that might be pending, but we fail to restore the interrupt vector. Signed-off-by: Maxim Levitsky Message-Id: <20210914154825.104886-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 4d88c339c423eefe2fd48215016cb0c75fcb4c4d Author: Sudarsana Reddy Kalluru Date: Thu Sep 23 03:16:05 2021 -0700 atlantic: Fix issue in the pm resume flow. After fixing hibernation resume flow, another usecase was found which should be explicitly handled - resume when device is in "down" state. Invoke aq_nic_init jointly with aq_nic_start only if ndev was already up during suspend/hibernate. We still need to perform nic_deinit() if caller requests for it, to handle the freeze/resume scenarios. Fixes: 57f780f1c433 ("atlantic: Fix driver resume flow.") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit fdbccea419dc782079ce5881d2705cc9e3881480 Author: Aya Levin Date: Thu Sep 23 09:51:45 2021 +0300 net/mlx4_en: Don't allow aRFS for encapsulated packets Driver doesn't support aRFS for encapsulated packets, return early error in such a case. Fixes: 1eb8c695bda9 ("net/mlx4_en: Add accelerated RFS support") Signed-off-by: Aya Levin Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller commit acc64f52afac15e9e44d9b5253271346841786e0 Author: Vladimir Oltean Date: Wed Sep 22 19:03:38 2021 -0700 net: mscc: ocelot: fix forwarding from BLOCKING ports remaining enabled The blamed commit made the fatally incorrect assumption that ports which aren't in the FORWARDING STP state should not have packets forwarded towards them, and that is all that needs to be done. However, that logic alone permits BLOCKING ports to forward to FORWARDING ports, which of course allows packet storms to occur when there is an L2 loop. The ocelot_get_bridge_fwd_mask should not only ask "what can the bridge do for you", but "what can you do for the bridge". This way, only FORWARDING ports forward to the other FORWARDING ports from the same bridging domain, and we are still compatible with the idea of multiple bridges. Fixes: df291e54ccca ("net: ocelot: support multiple bridges") Suggested-by: Colin Foster Reported-by: Colin Foster Signed-off-by: Vladimir Oltean Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit e68daf61ed13832aef8892200a874139700ca754 Author: Felix Fietkau Date: Wed Sep 22 16:55:48 2021 -0700 net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries Sometimes multiple CLS_REPLACE calls are issued for the same connection. rhashtable_insert_fast does not check for these duplicates, so multiple hardware flow entries can be created. Fix this by checking for an existing entry early Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") Signed-off-by: Felix Fietkau Signed-off-by: Ilya Lipnitskiy Signed-off-by: David S. Miller commit 31339440b2d0a4987030aac026adbaba44e22490 Author: Mark Brown Date: Wed Sep 22 19:30:37 2021 +0100 nfc: st-nci: Add SPI ID matching DT compatible Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding the part name used in the compatible to the list of SPI IDs. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown Signed-off-by: David S. Miller commit 5b099870c8e0eb026a1560894d94f827832491cf Author: Guvenc Gulce Date: Wed Sep 22 19:21:29 2021 +0200 MAINTAINERS: remove Guvenc Gulce as net/smc maintainer Remove myself as net/smc maintainer, as I am leaving IBM soon and can not maintain net/smc anymore. Cc: Julian Wiedmann Acked-by: Karsten Graul Signed-off-by: Guvenc Gulce Signed-off-by: David S. Miller commit 3106a0847525befe3e22fc723909d1b21eb0d520 Author: Ido Schimmel Date: Wed Sep 22 13:25:40 2021 +0300 nexthop: Fix memory leaks in nexthop notification chain listeners syzkaller discovered memory leaks [1] that can be reduced to the following commands: # ip nexthop add id 1 blackhole # devlink dev reload pci/0000:06:00.0 As part of the reload flow, mlxsw will unregister its netdevs and then unregister from the nexthop notification chain. Before unregistering from the notification chain, mlxsw will receive delete notifications for nexthop objects using netdevs registered by mlxsw or their uppers. mlxsw will not receive notifications for nexthops using netdevs that are not dismantled as part of the reload flow. For example, the blackhole nexthop above that internally uses the loopback netdev as its nexthop device. One way to fix this problem is to have listeners flush their nexthop tables after unregistering from the notification chain. This is error-prone as evident by this patch and also not symmetric with the registration path where a listener receives a dump of all the existing nexthops. Therefore, fix this problem by replaying delete notifications for the listener being unregistered. This is symmetric to the registration path and also consistent with the netdev notification chain. The above means that unregister_nexthop_notifier(), like register_nexthop_notifier(), will have to take RTNL in order to iterate over the existing nexthops and that any callers of the function cannot hold RTNL. This is true for mlxsw and netdevsim, but not for the VXLAN driver. To avoid a deadlock, change the latter to unregister its nexthop listener without holding RTNL, making it symmetric to the registration path. [1] unreferenced object 0xffff88806173d600 (size 512): comm "syz-executor.0", pid 1290, jiffies 4295583142 (age 143.507s) hex dump (first 32 bytes): 41 9d 1e 60 80 88 ff ff 08 d6 73 61 80 88 ff ff A..`......sa.... 08 d6 73 61 80 88 ff ff 01 00 00 00 00 00 00 00 ..sa............ backtrace: [] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline] [] slab_post_alloc_hook+0x96/0x490 mm/slab.h:522 [] slab_alloc_node mm/slub.c:3206 [inline] [] slab_alloc mm/slub.c:3214 [inline] [] kmem_cache_alloc_trace+0x163/0x370 mm/slub.c:3231 [] kmalloc include/linux/slab.h:591 [inline] [] kzalloc include/linux/slab.h:721 [inline] [] mlxsw_sp_nexthop_obj_group_create drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:4918 [inline] [] mlxsw_sp_nexthop_obj_new drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5054 [inline] [] mlxsw_sp_nexthop_obj_event+0x59a/0x2910 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5239 [] notifier_call_chain+0xbd/0x210 kernel/notifier.c:83 [] blocking_notifier_call_chain kernel/notifier.c:318 [inline] [] blocking_notifier_call_chain+0x72/0xa0 kernel/notifier.c:306 [] call_nexthop_notifiers+0x156/0x310 net/ipv4/nexthop.c:244 [] insert_nexthop net/ipv4/nexthop.c:2336 [inline] [] nexthop_add net/ipv4/nexthop.c:2644 [inline] [] rtm_new_nexthop+0x14e8/0x4d10 net/ipv4/nexthop.c:2913 [] rtnetlink_rcv_msg+0x448/0xbf0 net/core/rtnetlink.c:5572 [] netlink_rcv_skb+0x173/0x480 net/netlink/af_netlink.c:2504 [] rtnetlink_rcv+0x22/0x30 net/core/rtnetlink.c:5590 [] netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] [] netlink_unicast+0x5ae/0x7f0 net/netlink/af_netlink.c:1340 [] netlink_sendmsg+0x8e1/0xe30 net/netlink/af_netlink.c:1929 [] sock_sendmsg_nosec net/socket.c:704 [inline] [] sock_sendmsg net/socket.c:724 [inline] [] ____sys_sendmsg+0x874/0x9f0 net/socket.c:2409 [] ___sys_sendmsg+0x104/0x170 net/socket.c:2463 [] __sys_sendmsg+0x111/0x1f0 net/socket.c:2492 [] __do_sys_sendmsg net/socket.c:2501 [inline] [] __se_sys_sendmsg net/socket.c:2499 [inline] [] __x64_sys_sendmsg+0x7d/0xc0 net/socket.c:2499 Fixes: 2a014b200bbd ("mlxsw: spectrum_router: Add support for nexthop objects") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 313bbd1990b6ddfdaa7da098d0c56b098a833572 Author: Johannes Berg Date: Wed Sep 15 11:29:37 2021 +0200 mac80211-hwsim: fix late beacon hrtimer handling Thomas explained in https://lore.kernel.org/r/87mtoeb4hb.ffs@tglx that our handling of the hrtimer here is wrong: If the timer fires late (e.g. due to vCPU scheduling, as reported by Dmitry/syzbot) then it tries to actually rearm the timer at the next deadline, which might be in the past already: 1 2 3 N N+1 | | | ... | | ^ intended to fire here (1) ^ next deadline here (2) ^ actually fired here The next time it fires, it's later, but will still try to schedule for the next deadline (now 3), etc. until it catches up with N, but that might take a long time, causing stalls etc. Now, all of this is simulation, so we just have to fix it, but note that the behaviour is wrong even per spec, since there's no value then in sending all those beacons unaligned - they should be aligned to the TBTT (1, 2, 3, ... in the picture), and if we're a bit (or a lot) late, then just resume at that point. Therefore, change the code to use hrtimer_forward_now() which will ensure that the next firing of the timer would be at N+1 (in the picture), i.e. the next interval point after the current time. Suggested-by: Thomas Gleixner Reported-by: Dmitry Vyukov Reported-by: syzbot+0e964fad69a9c462bc1e@syzkaller.appspotmail.com Fixes: 01e59e467ecf ("mac80211_hwsim: hrtimer beacon") Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210915112936.544f383472eb.I3f9712009027aa09244b65399bf18bf482a8c4f1@changeid Signed-off-by: Johannes Berg commit b9731062ce8afd35cf723bf3a8ad55d208f915a5 Author: Johannes Berg Date: Mon Sep 20 15:40:05 2021 +0200 mac80211: mesh: fix potentially unaligned access The pointer here points directly into the frame, so the access is potentially unaligned. Use get_unaligned_le16 to avoid that. Fixes: 3f52b7e328c5 ("mac80211: mesh power save basics") Link: https://lore.kernel.org/r/20210920154009.3110ff75be0c.Ib6a2ff9e9cc9bc6fca50fce631ec1ce725cc926b@changeid Signed-off-by: Johannes Berg commit 13cb6d826e0ac0d144b0d48191ff1a111d32f0c6 Author: Lorenzo Bianconi Date: Mon Sep 20 14:45:22 2021 +0200 mac80211: limit injected vht mcs/nss in ieee80211_parse_tx_radiotap Limit max values for vht mcs and nss in ieee80211_parse_tx_radiotap routine in order to fix the following warning reported by syzbot: WARNING: CPU: 0 PID: 10717 at include/net/mac80211.h:989 ieee80211_rate_set_vht include/net/mac80211.h:989 [inline] WARNING: CPU: 0 PID: 10717 at include/net/mac80211.h:989 ieee80211_parse_tx_radiotap+0x101e/0x12d0 net/mac80211/tx.c:2244 Modules linked in: CPU: 0 PID: 10717 Comm: syz-executor.5 Not tainted 5.14.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:ieee80211_rate_set_vht include/net/mac80211.h:989 [inline] RIP: 0010:ieee80211_parse_tx_radiotap+0x101e/0x12d0 net/mac80211/tx.c:2244 RSP: 0018:ffffc9000186f3e8 EFLAGS: 00010216 RAX: 0000000000000618 RBX: ffff88804ef76500 RCX: ffffc900143a5000 RDX: 0000000000040000 RSI: ffffffff888f478e RDI: 0000000000000003 RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000100 R10: ffffffff888f46f9 R11: 0000000000000000 R12: 00000000fffffff8 R13: ffff88804ef7653c R14: 0000000000000001 R15: 0000000000000004 FS: 00007fbf5718f700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2de23000 CR3: 000000006a671000 CR4: 00000000001506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: ieee80211_monitor_select_queue+0xa6/0x250 net/mac80211/iface.c:740 netdev_core_pick_tx+0x169/0x2e0 net/core/dev.c:4089 __dev_queue_xmit+0x6f9/0x3710 net/core/dev.c:4165 __bpf_tx_skb net/core/filter.c:2114 [inline] __bpf_redirect_no_mac net/core/filter.c:2139 [inline] __bpf_redirect+0x5ba/0xd20 net/core/filter.c:2162 ____bpf_clone_redirect net/core/filter.c:2429 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2401 bpf_prog_eeb6f53a69e5c6a2+0x59/0x234 bpf_dispatcher_nop_func include/linux/bpf.h:717 [inline] __bpf_prog_run include/linux/filter.h:624 [inline] bpf_prog_run include/linux/filter.h:631 [inline] bpf_test_run+0x381/0xa30 net/bpf/test_run.c:119 bpf_prog_test_run_skb+0xb84/0x1ee0 net/bpf/test_run.c:663 bpf_prog_test_run kernel/bpf/syscall.c:3307 [inline] __sys_bpf+0x2137/0x5df0 kernel/bpf/syscall.c:4605 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline] __se_sys_bpf kernel/bpf/syscall.c:4689 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4689 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:0x4665f9 Reported-by: syzbot+0196ac871673f0c20f68@syzkaller.appspotmail.com Fixes: 646e76bb5daf4 ("mac80211: parse VHT info in injected frames") Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c26c3f02dcb38ab63b2f2534cb463d95ee81bb13.1632141760.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit a6555f844549cd190eb060daef595f94d3de1582 Author: YueHaibing Date: Fri Aug 27 22:42:30 2021 +0800 mac80211: Drop frames from invalid MAC address in ad-hoc mode WARNING: CPU: 1 PID: 9 at net/mac80211/sta_info.c:554 sta_info_insert_rcu+0x121/0x12a0 Modules linked in: CPU: 1 PID: 9 Comm: kworker/u8:1 Not tainted 5.14.0-rc7+ #253 Workqueue: phy3 ieee80211_iface_work RIP: 0010:sta_info_insert_rcu+0x121/0x12a0 ... Call Trace: ieee80211_ibss_finish_sta+0xbc/0x170 ieee80211_ibss_work+0x13f/0x7d0 ieee80211_iface_work+0x37a/0x500 process_one_work+0x357/0x850 worker_thread+0x41/0x4d0 If an Ad-Hoc node receives packets with invalid source MAC address, it hits a WARN_ON in sta_info_insert_check(), this can spam the log. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20210827144230.39944-1-yuehaibing@huawei.com Signed-off-by: Johannes Berg commit fe94bac626d9c1c5bc98ab32707be8a9d7f8adba Author: Chih-Kang Chang Date: Mon Aug 30 15:32:40 2021 +0800 mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug In ieee80211_amsdu_aggregate() set a pointer frag_tail point to the end of skb_shinfo(head)->frag_list, and use it to bind other skb in the end of this function. But when execute ieee80211_amsdu_aggregate() ->ieee80211_amsdu_realloc_pad()->pskb_expand_head(), the address of skb_shinfo(head)->frag_list will be changed. However, the ieee80211_amsdu_aggregate() not update frag_tail after call pskb_expand_head(). That will cause the second skb can't bind to the head skb appropriately.So we update the address of frag_tail to fix it. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Chih-Kang Chang Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20210830073240.12736-1-pkshih@realtek.com [reword comment] Signed-off-by: Johannes Berg commit 98d46b021f6ee246c7a73f9d490d4cddb4511a3b Author: Felix Fietkau Date: Mon Sep 6 10:35:59 2021 +0200 Revert "mac80211: do not use low data rates for data frames with no ack flag" This reverts commit d333322361e7 ("mac80211: do not use low data rates for data frames with no ack flag"). Returning false early in rate_control_send_low breaks sending broadcast packets, since rate control will not select a rate for it. Before re-introducing a fixed version of this patch, we should probably also make some changes to rate control to be more conservative in selecting rates for no-ack packets and also prevent using probing rates on them, since we won't get any feedback. Fixes: d333322361e7 ("mac80211: do not use low data rates for data frames with no ack flag") Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20210906083559.9109-1-nbd@nbd.name Signed-off-by: Johannes Berg commit 8cd9da85d2bd87ce889043e7b1735723dd10eb89 Author: Frederic Weisbecker Date: Mon Sep 13 16:53:32 2021 +0200 posix-cpu-timers: Prevent spuriously armed 0-value itimer Resetting/stopping an itimer eventually leads to it being reprogrammed with an actual "0" value. As a result the itimer expires on the next tick, triggering an unexpected signal. To fix this, make sure that struct signal_struct::it[CPUCLOCK_PROF/VIRT]::expires is set to 0 when setitimer() passes a 0 it_value, indicating that the timer must stop. Fixes: 406dd42bd1ba ("posix-cpu-timers: Force next expiration recalc after itimer reset") Reported-by: Victor Stinner Reported-by: Chris Hixon Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210913145332.232023-1-frederic@kernel.org commit 90ca6e7db83a06e9173bee5bb34ded3b37f4948d Author: Johan Hovold Date: Wed Sep 22 13:31:00 2021 +0200 USB: serial: cp210x: add part-number debug printk Add a part-number debug printk to facilitate debugging. Signed-off-by: Johan Hovold commit c32dfec6c1c36bbbcd5d33e949d99aeb215877ec Author: Johan Hovold Date: Wed Sep 22 13:30:59 2021 +0200 USB: serial: cp210x: fix dropped characters with CP2102 Some CP2102 do not support event-insertion mode but return no error when attempting to enable it. This means that any event escape characters in the input stream will not be escaped by the device and consequently regular data may be interpreted as escape sequences and be removed from the stream by the driver. The reporter's device has batch number DCL00X etched into it and as discovered by the SHA2017 Badge team, counterfeit devices with that marking can be detected by sending malformed vendor requests. [1][2] Tests confirm that the possibly counterfeit CP2102 returns a single byte in response to a malformed two-byte part-number request, while an original CP2102 returns two bytes. Assume that every CP2102 that behaves this way also does not support event-insertion mode (e.g. cannot report parity errors). [1] https://mobile.twitter.com/sha2017badge/status/1167902087289532418 [2] https://hackaday.com/2017/08/14/hands-on-with-the-shacamp-2017-badge/#comment-3903376 Reported-by: Malte Di Donato Tested-by: Malte Di Donato Fixes: a7207e9835a4 ("USB: serial: cp210x: add support for line-status events") Cc: stable@vger.kernel.org # 5.9 Link: https://lore.kernel.org/r/20210922113100.20888-1-johan@kernel.org Signed-off-by: Johan Hovold commit 93ec1320b0170d7a207eda2d119c669b673401ed Author: Nicolas Dichtel Date: Wed Sep 22 10:50:06 2021 +0200 xfrm: fix rcu lock in xfrm_notify_userpolicy() As stated in the comment above xfrm_nlmsg_multicast(), rcu read lock must be held before calling this function. Reported-by: syzbot+3d9866419b4aa8f985d6@syzkaller.appspotmail.com Fixes: 703b94b93c19 ("xfrm: notify default policy on update") Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit 09d23174402da0f10e98da2c61bb5ac8e7d79fdd Author: Jaroslav Kysela Date: Mon Sep 20 19:18:50 2021 +0200 ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION The new framing mode causes the user space regression, because the alsa-lib code does not initialize the reserved space in the params structure when the device is opened. This change adds SNDRV_RAWMIDI_IOCTL_USER_PVERSION like we do for the PCM interface for the protocol acknowledgment. Cc: David Henningsson Cc: Fixes: 08fdced60ca0 ("ALSA: rawmidi: Add framing mode") BugLink: https://github.com/alsa-project/alsa-lib/issues/178 Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20210920171850.154186-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 4ea477988c423a57241ea4840b12832de6fabdfd Author: Namjae Jeon Date: Tue Sep 21 14:19:33 2021 +0900 ksmbd: remove follow symlinks support Use LOOKUP_NO_SYMLINKS flags for default lookup to prohibit the middle of symlink component lookup and remove follow symlinks parameter support. We re-implement it as reparse point later. Test result: smbclient -Ulinkinjeon%1234 //172.30.1.42/share -c "get hacked/passwd passwd" NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \hacked\passwd Cc: Ralph Böhme Cc: Steve French Acked-by: Ronnie Sahlberg Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 18a015bccf9e8927008d0a255c9f14b8ec15a648 Author: Namjae Jeon Date: Wed Sep 22 21:00:57 2021 +0900 ksmbd: check protocol id in ksmbd_verify_smb_message() When second smb2 pdu has invalid protocol id, ksmbd doesn't detect it and allow to process smb2 request. This patch add the check it in ksmbd_verify_smb_message() and don't use protocol id of smb2 request as protocol id of response. Reviewed-by: Ronnie Sahlberg Reviewed-by: Ralph Böhme Reported-by: Ronnie Sahlberg Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 58e2cf5d794616b84f591d4d1276c8953278ce24 Author: Geert Uytterhoeven Date: Wed Sep 1 09:09:28 2021 +0200 init: Revert accidental changes to print irqs_disabled() Commit f8ade8dddb16 ("xsurf100: drop include of lib8390.c") accidentally changed init/main.c. Revert that part. Fixes: f8ade8dddb16 ("xsurf100: drop include of lib8390.c") Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds commit 4057525736b159bd456732d11270af2cc49ec21f Author: Konrad Rzeszutek Wilk Date: Fri Sep 17 12:16:52 2021 -0400 MAINTAINERS: Update Xen-[PCI,SWIOTLB,Block] maintainership Konrad's new job role is putting a serious cramp on him being a responsive maintainer and as such he is handing off the reins to Juergen, Roger, and Stefano. Thank you! Acked-by: Juergen Gross Acked-by: Roger Pau Monné Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Linus Torvalds commit 2e36a964ada4f7bda24f3caa971a33500e23af36 Author: Konrad Rzeszutek Wilk Date: Fri Sep 17 12:16:51 2021 -0400 MAINTAINERS: Update SWIOTLB maintainership Konrad's new job role is putting a serious cramp on him being a responsive maintainer and as such he is handing off the reins to Christoph Hellwig. Thank you! Acked-by: Christoph Hellwig Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Linus Torvalds commit c4aa1eeb093b09fbae9329a080172c58ace8da8c Author: Dinh Nguyen Date: Wed Sep 22 14:30:01 2021 -0500 MAINTAINERS: update entry for NIOS2 Ley Foon has left Intel and will no longer be able to maintain NIOS2. Update the MAINTAINER's entry to Dinh Nguyen. Acked-by: Ley Foon Tan Signed-off-by: Dinh Nguyen Signed-off-by: Linus Torvalds commit 9bedf10b5797a4660c2acc6c3573376f7e5d1c97 Merge: cf1d2c3e7e2f3 96c8395e2166e Author: Linus Torvalds Date: Wed Sep 22 11:58:24 2021 -0700 Merge tag 'spi-fix-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi modalias fix from Mark Brown: "Fix modalias issues As reported by Russell King the change to use OF style modaliases for DT enumerated broke at least the spi-nor driver, the patch here reverts that change to fix the regression. Sadly this will mean that anything that started loading since the change to OF modaliases will run into issues, there doesn't seem to be any approach which doesn't cause some problems and thi seems like the least bad approach - gory details are in the commit log for the change. I'm currently working through the SPI drivers to add ID tables and missing IDs to tables which should address things from the other end, this seems more straightforward and robust than any other options" * tag 'spi-fix-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: Revert modalias changes commit cd586d213e583c74594c9c357a18c4c290df3b92 Merge: 858560b27645e 7df835a32a8be Author: Jens Axboe Date: Wed Sep 22 12:43:18 2021 -0600 Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.15 Pull MD fix from Song. * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix a lock order reversal in md_alloc commit 80f6e3080bfcf865062a926817b3ca6c4a137a57 Author: Eric Biggers Date: Thu Sep 16 13:34:24 2021 -0700 fs-verity: fix signed integer overflow with i_size near S64_MAX If the file size is almost S64_MAX, the calculated number of Merkle tree levels exceeds FS_VERITY_MAX_LEVELS, causing FS_IOC_ENABLE_VERITY to fail. This is unintentional, since as the comment above the definition of FS_VERITY_MAX_LEVELS states, it is enough for over U64_MAX bytes of data using SHA-256 and 4K blocks. (Specifically, 4096*128**8 >= 2**64.) The bug is actually that when the number of blocks in the first level is calculated from i_size, there is a signed integer overflow due to i_size being signed. Fix this by treating i_size as unsigned. This was found by the new test "generic: test fs-verity EFBIG scenarios" (https://lkml.kernel.org/r/b1d116cd4d0ea74b9cd86f349c672021e005a75c.1631558495.git.boris@bur.io). This didn't affect ext4 or f2fs since those have a smaller maximum file size, but it did affect btrfs which allows files up to S64_MAX bytes. Reported-by: Boris Burkov Fixes: 3fda4c617e84 ("fs-verity: implement FS_IOC_ENABLE_VERITY ioctl") Fixes: fd2d1acfcadf ("fs-verity: add the hook for file ->open()") Cc: # v5.4+ Reviewed-by: Boris Burkov Link: https://lore.kernel.org/r/20210916203424.113376-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit d81ff5fe14a950f53e2833cfa196e7bb3fd5d4e3 Author: Kees Cook Date: Fri Sep 10 15:33:32 2021 -0700 x86/asm: Fix SETZ size enqcmds() build failure When building under GCC 4.9 and 5.5: arch/x86/include/asm/special_insns.h: Assembler messages: arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz' Change the type to "bool" for condition code arguments, as documented. Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction") Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210910223332.3224851-1-keescook@chromium.org commit bc0bdc5afaa740d782fbf936aaeebd65e5c2921d Author: Jason Gunthorpe Date: Wed Sep 15 17:21:43 2021 -0300 RDMA/cma: Do not change route.addr.src_addr.ss_family If the state is not idle then rdma_bind_addr() will immediately fail and no change to global state should happen. For instance if the state is already RDMA_CM_LISTEN then this will corrupt the src_addr and would cause the test in cma_cancel_operation(): if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev) To view a mangled src_addr, eg with a IPv6 loopback address but an IPv4 family, failing the test. This would manifest as this trace from syzkaller: BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26 Read of size 8 at addr ffff8881546491e0 by task syz-executor.1/32204 CPU: 1 PID: 32204 Comm: syz-executor.1 Not tainted 5.12.0-rc8-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 __list_add_valid+0x93/0xa0 lib/list_debug.c:26 __list_add include/linux/list.h:67 [inline] list_add_tail include/linux/list.h:100 [inline] cma_listen_on_all drivers/infiniband/core/cma.c:2557 [inline] rdma_listen+0x787/0xe00 drivers/infiniband/core/cma.c:3751 ucma_listen+0x16a/0x210 drivers/infiniband/core/ucma.c:1102 ucma_write+0x259/0x350 drivers/infiniband/core/ucma.c:1732 vfs_write+0x28e/0xa30 fs/read_write.c:603 ksys_write+0x1ee/0x250 fs/read_write.c:658 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Which is indicating that an rdma_id_private was destroyed without doing cma_cancel_listens(). Instead of trying to re-use the src_addr memory to indirectly create an any address build one explicitly on the stack and bind to that as any other normal flow would do. Link: https://lore.kernel.org/r/0-v1-9fbb33f5e201+2a-cma_listen_jgg@nvidia.com Cc: stable@vger.kernel.org Fixes: 732d41c545bb ("RDMA/cma: Make the locking for automatic state transition more clear") Reported-by: syzbot+6bb0528b13611047209c@syzkaller.appspotmail.com Tested-by: Hao Sun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cf1d2c3e7e2f3754fe3d6dc747f7a092b168d9cf Merge: bee42512c4a0e 02579b2ff8b0b Author: Linus Torvalds Date: Wed Sep 22 09:21:02 2021 -0700 Merge tag 'nfsd-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Critical bug fixes: - Fix crash in NLM TEST procedure - NFSv4.1+ backchannel not restored after PATH_DOWN" * tag 'nfsd-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN NLM: Fix svcxdr_encode_owner() commit bee42512c4a0e6253d6b196445f9091438b264b5 Merge: 8f1b7ba55c61d 6f6aab1caf6c7 Author: Linus Torvalds Date: Wed Sep 22 09:16:18 2021 -0700 Merge tag 'platform-drivers-x86-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "The first round of bug-fixes for platform-drivers-x86 for 5.15, highlights: - amd-pmc fix for some suspend/resume issues - intel-hid fix to avoid false-positive SW_TABLET_MODE=1 reporting - some build error/warning fixes - various DMI quirk additions" * tag 'platform-drivers-x86-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: gigabyte-wmi: add support for B550I Aorus Pro AX platform/x86/intel: hid: Add DMI switches allow list platform/x86: dell: fix DELL_WMI_PRIVACY dependencies & build error platform/x86: amd-pmc: Increase the response register timeout platform/x86: touchscreen_dmi: Update info for the Chuwi Hi10 Plus (CWI527) tablet platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet lg-laptop: Correctly handle dmi_get_system_info() returning NULL platform/x86/intel: punit_ipc: Drop wrong use of ACPI_PTR() commit 8f1b7ba55c61d2c9f3a47a4759db43abfb59fc16 Author: Jiri Slaby Date: Wed Sep 22 08:35:58 2021 +0200 MAINTAINERS: ARM/VT8500, remove defunct e-mail linux@prisktech.co.nz is defunct: 4.1.2 : Recipient address rejected: Domain not found Remove it from MAINTAINERS and mark the ARM/VT8500 entry orphan. Signed-off-by: Jiri Slaby Signed-off-by: Linus Torvalds commit 7df835a32a8bedf7ce88efcfa7c9b245b52ff139 Author: Christoph Hellwig Date: Wed Sep 1 13:38:29 2021 +0200 md: fix a lock order reversal in md_alloc Commit b0140891a8cea3 ("md: Fix race when creating a new md device.") not only moved assigning mddev->gendisk before calling add_disk, which fixes the races described in the commit log, but also added a mddev->open_mutex critical section over add_disk and creation of the md kobj. Adding a kobject after add_disk is racy vs deleting the gendisk right after adding it, but md already prevents against that by holding a mddev->active reference. On the other hand taking this lock added a lock order reversal with what is not disk->open_mutex (used to be bdev->bd_mutex when the commit was added) for partition devices, which need that lock for the internal open for the partition scan, and a recent commit also takes it for non-partitioned devices, leading to further lockdep splatter. Fixes: b0140891a8ce ("md: Fix race when creating a new md device.") Fixes: d62633873590 ("block: support delayed holder registration") Reported-by: syzbot+fadc0aaf497e6a493b9f@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig Tested-by: syzbot+fadc0aaf497e6a493b9f@syzkaller.appspotmail.com Reviewed-by: NeilBrown Signed-off-by: Song Liu commit e1fc1553cd78292ab3521c94c9dd6e3e70e606a1 Author: Fares Mehanna Date: Wed Sep 15 13:39:50 2021 +0000 kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[] Intel PMU MSRs is in msrs_to_save_all[], so add AMD PMU MSRs to have a consistent behavior between Intel and AMD when using KVM_GET_MSRS, KVM_SET_MSRS or KVM_GET_MSR_INDEX_LIST. We have to add legacy and new MSRs to handle guests running without X86_FEATURE_PERFCTR_CORE. Signed-off-by: Fares Mehanna Message-Id: <20210915133951.22389-1-faresx@amazon.de> Signed-off-by: Paolo Bonzini commit dbab610a5be69c2c5e4fdd7135d14b6bab2667a5 Author: Maxim Levitsky Date: Mon Sep 13 17:09:54 2021 +0300 KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit If L1 had invalid state on VM entry (can happen on SMM transactions when we enter from real mode, straight to nested guest), then after we load 'host' state from VMCS12, the state has to become valid again, but since we load the segment registers with __vmx_set_segment we weren't always updating emulation_required. Update emulation_required explicitly at end of load_vmcs12_host_state. Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit c8607e4a086fae05efe5bffb47c5199c65e7216e Author: Maxim Levitsky Date: Mon Sep 13 17:09:53 2021 +0300 KVM: x86: nVMX: don't fail nested VM entry on invalid guest state if !from_vmentry It is possible that when non root mode is entered via special entry (!from_vmentry), that is from SMM or from loading the nested state, the L2 state could be invalid in regard to non unrestricted guest mode, but later it can become valid. (for example when RSM emulation restores segment registers from SMRAM) Thus delay the check to VM entry, where we will check this and fail. Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit c42dec148b3e1a88835e275b675e5155f99abd43 Author: Maxim Levitsky Date: Mon Sep 13 17:09:52 2021 +0300 KVM: x86: VMX: synthesize invalid VM exit when emulating invalid guest state Since no actual VM entry happened, the VM exit information is stale. To avoid this, synthesize an invalid VM guest state VM exit. Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 136a55c054ca03b44b74efe03f136d495dd84ec8 Author: Maxim Levitsky Date: Wed Sep 22 10:28:43 2021 -0400 KVM: x86: nSVM: refactor svm_leave_smm and smm_enter_smm Use return statements instead of nested if, and fix error path to free all the maps that were allocated. Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit e85d3e7b495bb6c0b847a693f5f6d4bd429fae55 Author: Maxim Levitsky Date: Mon Sep 13 17:09:51 2021 +0300 KVM: x86: SVM: call KVM_REQ_GET_NESTED_STATE_PAGES on exit from SMM mode Currently the KVM_REQ_GET_NESTED_STATE_PAGES on SVM only reloads PDPTRs, and MSR bitmap, with former not really needed for SMM as SMM exit code reloads them again from SMRAM'S CR3, and later happens to work since MSR bitmap isn't modified while in SMM. Still it is better to be consistient with VMX. Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 37687c403a641f251cb2ef2e7830b88aa0647ba9 Author: Maxim Levitsky Date: Mon Sep 13 17:09:50 2021 +0300 KVM: x86: reset pdptrs_from_userspace when exiting smm When exiting SMM, pdpts are loaded again from the guest memory. This fixes a theoretical bug, when exit from SMM triggers entry to the nested guest which re-uses some of the migration code which uses this flag as a workaround for a legacy userspace. Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit e2e6e449d68ddf4ccb0bf72cc50fbc6c69fe7f63 Author: Maxim Levitsky Date: Mon Sep 13 17:09:49 2021 +0300 KVM: x86: nSVM: restore the L1 host state prior to resuming nested guest on SMM exit Otherwise guest entry code might see incorrect L1 state (e.g paging state). Fixes: 37be407b2ce8 ("KVM: nSVM: Fix L1 state corruption upon return from SMM") Signed-off-by: Maxim Levitsky Message-Id: <20210913140954.165665-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 8d68bad6d869fae8f4d50ab6423538dec7da72d1 Author: Vitaly Kuznetsov Date: Tue Sep 7 18:35:30 2021 +0200 KVM: nVMX: Filter out all unsupported controls when eVMCS was activated Windows Server 2022 with Hyper-V role enabled failed to boot on KVM when enlightened VMCS is advertised. Debugging revealed there are two exposed secondary controls it is not happy with: SECONDARY_EXEC_ENABLE_VMFUNC and SECONDARY_EXEC_SHADOW_VMCS. These controls are known to be unsupported, as there are no corresponding fields in eVMCSv1 (see the comment above EVMCS1_UNSUPPORTED_2NDEXEC definition). Previously, commit 31de3d2500e4 ("x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs()") introduced the required filtering mechanism for VMX MSRs but for some reason put only known to be problematic (and not full EVMCS1_UNSUPPORTED_* lists) controls there. Note, Windows Server 2022 seems to have gained some sanity check for VMX MSRs: it doesn't even try to launch a guest when there's something it doesn't like, nested_evmcs_check_controls() mechanism can't catch the problem. Let's be bold this time and instead of playing whack-a-mole just filter out all unsupported controls from VMX MSRs. Fixes: 31de3d2500e4 ("x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs()") Signed-off-by: Vitaly Kuznetsov Message-Id: <20210907163530.110066-1-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 0bbc2ca8515f9cdf11df84ccb63dc7c44bc3d8f4 Author: Sean Christopherson Date: Fri Aug 27 11:25:10 2021 +0200 KVM: KVM: Use cpumask_available() to check for NULL cpumask when kicking vCPUs Check for a NULL cpumask_var_t when kicking multiple vCPUs via cpumask_available(), which performs a !NULL check if and only if cpumasks are configured to be allocated off-stack. This is a meaningless optimization, e.g. avoids a TEST+Jcc and TEST+CMOV on x86, but more importantly helps document that the NULL check is necessary even though all callers pass in a local variable. No functional change intended. Cc: Lai Jiangshan Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20210827092516.1027264-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 85b640450ddcfa09cf72771b69a9c3daf0ddc772 Author: Sean Christopherson Date: Fri Aug 27 11:25:09 2021 +0200 KVM: Clean up benign vcpu->cpu data races when kicking vCPUs Fix a benign data race reported by syzbot+KCSAN[*] by ensuring vcpu->cpu is read exactly once, and by ensuring the vCPU is booted from guest mode if kvm_arch_vcpu_should_kick() returns true. Fix a similar race in kvm_make_vcpus_request_mask() by ensuring the vCPU is interrupted if kvm_request_needs_ipi() returns true. Reading vcpu->cpu before vcpu->mode (via kvm_arch_vcpu_should_kick() or kvm_request_needs_ipi()) means the target vCPU could get migrated (change vcpu->cpu) and enter !OUTSIDE_GUEST_MODE between reading vcpu->cpud and reading vcpu->mode. If that happens, the kick/IPI will be sent to the old pCPU, not the new pCPU that is now running the vCPU or reading SPTEs. Although failing to kick the vCPU is not exactly ideal, practically speaking it cannot cause a functional issue unless there is also a bug in the caller, and any such bug would exist regardless of kvm_vcpu_kick()'s behavior. The purpose of sending an IPI is purely to get a vCPU into the host (or out of reading SPTEs) so that the vCPU can recognize a change in state, e.g. a KVM_REQ_* request. If vCPU's handling of the state change is required for correctness, KVM must ensure either the vCPU sees the change before entering the guest, or that the sender sees the vCPU as running in guest mode. All architectures handle this by (a) sending the request before calling kvm_vcpu_kick() and (b) checking for requests _after_ setting vcpu->mode. x86's READING_SHADOW_PAGE_TABLES has similar requirements; KVM needs to ensure it kicks and waits for vCPUs that started reading SPTEs _before_ MMU changes were finalized, but any vCPU that starts reading after MMU changes were finalized will see the new state and can continue on uninterrupted. For uses of kvm_vcpu_kick() that are not paired with a KVM_REQ_*, e.g. x86's kvm_arch_sync_dirty_log(), the order of the kick must not be relied upon for functional correctness, e.g. in the dirty log case, userspace cannot assume it has a 100% complete log if vCPUs are still running. All that said, eliminate the benign race since the cost of doing so is an "extra" atomic cmpxchg() in the case where the target vCPU is loaded by the current pCPU or is not loaded at all. I.e. the kick will be skipped due to kvm_vcpu_exiting_guest_mode() seeing a compatible vcpu->mode as opposed to the kick being skipped because of the cpu checks. Keep the "cpu != me" checks even though they appear useless/impossible at first glance. x86 processes guest IPI writes in a fast path that runs in IN_GUEST_MODE, i.e. can call kvm_vcpu_kick() from IN_GUEST_MODE. And calling kvm_vm_bugged()->kvm_make_vcpus_request_mask() from IN_GUEST or READING_SHADOW_PAGE_TABLES is perfectly reasonable. Note, a race with the cpu_online() check in kvm_vcpu_kick() likely persists, e.g. the vCPU could exit guest mode and get offlined between the cpu_online() check and the sending of smp_send_reschedule(). But, the online check appears to exist only to avoid a WARN in x86's native_smp_send_reschedule() that fires if the target CPU is not online. The reschedule WARN exists because CPU offlining takes the CPU out of the scheduling pool, i.e. the WARN is intended to detect the case where the kernel attempts to schedule a task on an offline CPU. The actual sending of the IPI is a non-issue as at worst it will simpy be dropped on the floor. In other words, KVM's usurping of the reschedule IPI could theoretically trigger a WARN if the stars align, but there will be no loss of functionality. [*] https://syzkaller.appspot.com/bug?extid=cd4154e502f43f10808a Cc: Venkatesh Srinivas Cc: Vitaly Kuznetsov Fixes: 97222cc83163 ("KVM: Emulate local APIC in kernel") Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20210827092516.1027264-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 2f9b68f57c6278c322793a06063181deded0ad69 Author: Vitaly Kuznetsov Date: Fri Aug 27 11:25:14 2021 +0200 KVM: x86: Fix stack-out-of-bounds memory access from ioapic_write_indirect() KASAN reports the following issue: BUG: KASAN: stack-out-of-bounds in kvm_make_vcpus_request_mask+0x174/0x440 [kvm] Read of size 8 at addr ffffc9001364f638 by task qemu-kvm/4798 CPU: 0 PID: 4798 Comm: qemu-kvm Tainted: G X --------- --- Hardware name: AMD Corporation DAYTONA_X/DAYTONA_X, BIOS RYM0081C 07/13/2020 Call Trace: dump_stack+0xa5/0xe6 print_address_description.constprop.0+0x18/0x130 ? kvm_make_vcpus_request_mask+0x174/0x440 [kvm] __kasan_report.cold+0x7f/0x114 ? kvm_make_vcpus_request_mask+0x174/0x440 [kvm] kasan_report+0x38/0x50 kasan_check_range+0xf5/0x1d0 kvm_make_vcpus_request_mask+0x174/0x440 [kvm] kvm_make_scan_ioapic_request_mask+0x84/0xc0 [kvm] ? kvm_arch_exit+0x110/0x110 [kvm] ? sched_clock+0x5/0x10 ioapic_write_indirect+0x59f/0x9e0 [kvm] ? static_obj+0xc0/0xc0 ? __lock_acquired+0x1d2/0x8c0 ? kvm_ioapic_eoi_inject_work+0x120/0x120 [kvm] The problem appears to be that 'vcpu_bitmap' is allocated as a single long on stack and it should really be KVM_MAX_VCPUS long. We also seem to clear the lower 16 bits of it with bitmap_zero() for no particular reason (my guess would be that 'bitmap' and 'vcpu_bitmap' variables in kvm_bitmap_or_dest_vcpus() caused the confusion: while the later is indeed 16-bit long, the later should accommodate all possible vCPUs). Fixes: 7ee30bc132c6 ("KVM: x86: deliver KVM IOAPIC scan request to target vCPUs") Fixes: 9a2ae9f6b6bb ("KVM: x86: Zero the IOAPIC scan request dest vCPUs bitmap") Reported-by: Dr. David Alan Gilbert Signed-off-by: Vitaly Kuznetsov Reviewed-by: Maxim Levitsky Reviewed-by: Sean Christopherson Message-Id: <20210827092516.1027264-7-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 7c236b816ef16c2969a88ced658dab667e9dd4ee Author: David Matlack Date: Fri Sep 17 17:36:57 2021 +0000 KVM: selftests: Create a separate dirty bitmap per slot The calculation to get the per-slot dirty bitmap was incorrect leading to a buffer overrun. Fix it by splitting out the dirty bitmap into a separate bitmap per slot. Fixes: 609e6202ea5f ("KVM: selftests: Support multiple slots in dirty_log_perf_test") Signed-off-by: David Matlack Reviewed-by: Andrew Jones Message-Id: <20210917173657.44011-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 9f2fc5554a4093e80084389f760d0b06ec2ff782 Author: David Matlack Date: Fri Sep 17 17:36:56 2021 +0000 KVM: selftests: Refactor help message for -s backing_src All selftests that support the backing_src option were printing their own description of the flag and then calling backing_src_help() to dump the list of available backing sources. Consolidate the flag printing in backing_src_help() to align indentation, reduce duplicated strings, and improve consistency across tests. Note: Passing "-s" to backing_src_help is unnecessary since every test uses the same flag. However I decided to keep it for code readability at the call sites. While here this opportunistically fixes the incorrectly interleaved printing -x help message and list of backing source types in dirty_log_perf_test. Fixes: 609e6202ea5f ("KVM: selftests: Support multiple slots in dirty_log_perf_test") Reviewed-by: Ben Gardon Reviewed-by: Andrew Jones Signed-off-by: David Matlack Message-Id: <20210917173657.44011-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit a1e638da1ba4078caa0374507cf0d9ec140a255f Author: David Matlack Date: Fri Sep 17 17:36:55 2021 +0000 KVM: selftests: Change backing_src flag to -s in demand_paging_test Every other KVM selftest uses -s for the backing_src, so switch demand_paging_test to match. Reviewed-by: Ben Gardon Reviewed-by: Andrew Jones Signed-off-by: David Matlack Message-Id: <20210917173657.44011-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 5b92b6ca92b65bef811048c481e4446f4828500a Author: Peter Gonda Date: Tue Sep 21 08:03:45 2021 -0700 KVM: SEV: Allow some commands for mirror VM A mirrored SEV-ES VM will need to call KVM_SEV_LAUNCH_UPDATE_VMSA to setup its vCPUs and have them measured, and their VMSAs encrypted. Without this change, it is impossible to have mirror VMs as part of SEV-ES VMs. Also allow the guest status check and debugging commands since they do not change any guest state. Signed-off-by: Peter Gonda Cc: Marc Orr Cc: Nathan Tempelman Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Steve Rutherford Cc: Brijesh Singh Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 54526d1fd593 ("KVM: x86: Support KVM VMs sharing SEV context", 2021-04-21) Message-Id: <20210921150345.2221634-3-pgonda@google.com> Signed-off-by: Paolo Bonzini commit f43c887cb7cb5b66c4167d40a4209027f5fdb5ce Author: Peter Gonda Date: Tue Sep 21 08:03:44 2021 -0700 KVM: SEV: Update svm_vm_copy_asid_from for SEV-ES For mirroring SEV-ES the mirror VM will need more then just the ASID. The FD and the handle are required to all the mirror to call psp commands. The mirror VM will need to call KVM_SEV_LAUNCH_UPDATE_VMSA to setup its vCPUs' VMSAs for SEV-ES. Signed-off-by: Peter Gonda Cc: Marc Orr Cc: Nathan Tempelman Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Steve Rutherford Cc: Brijesh Singh Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 54526d1fd593 ("KVM: x86: Support KVM VMs sharing SEV context", 2021-04-21) Message-Id: <20210921150345.2221634-2-pgonda@google.com> Signed-off-by: Paolo Bonzini commit 24a996ade34d00deef5dee2c33aacd8fda91ec31 Author: Chenyi Qiang Date: Tue Sep 14 17:50:41 2021 +0800 KVM: nVMX: Fix nested bus lock VM exit Nested bus lock VM exits are not supported yet. If L2 triggers bus lock VM exit, it will be directed to L1 VMM, which would cause unexpected behavior. Therefore, handle L2's bus lock VM exits in L0 directly. Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit") Signed-off-by: Chenyi Qiang Reviewed-by: Sean Christopherson Reviewed-by: Xiaoyao Li Message-Id: <20210914095041.29764-1-chenyi.qiang@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 94c245a245ff6552a320257f97d5171d03f7ee3a Author: Sean Christopherson Date: Fri Sep 10 11:32:20 2021 -0700 KVM: x86: Identify vCPU0 by its vcpu_idx instead of its vCPUs array entry Use vcpu_idx to identify vCPU0 when updating HyperV's TSC page, which is shared by all vCPUs and "owned" by vCPU0 (because vCPU0 is the only vCPU that's guaranteed to exist). Using kvm_get_vcpu() to find vCPU works, but it's a rather odd and suboptimal method to check the index of a given vCPU. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Reviewed-by: Vitaly Kuznetsov Message-Id: <20210910183220.2397812-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4eeef2424153e79910d65248b5e1abf137d050e9 Author: Sean Christopherson Date: Fri Sep 10 11:32:19 2021 -0700 KVM: x86: Query vcpu->vcpu_idx directly and drop its accessor Read vcpu->vcpu_idx directly instead of bouncing through the one-line wrapper, kvm_vcpu_get_idx(), and drop the wrapper. The wrapper is a remnant of the original implementation and serves no purpose; remove it before it gains more users. Back when kvm_vcpu_get_idx() was added by commit 497d72d80a78 ("KVM: Add kvm_vcpu_get_idx to get vcpu index in kvm->vcpus"), the implementation was more than just a simple wrapper as vcpu->vcpu_idx did not exist and retrieving the index meant walking over the vCPU array to find the given vCPU. When vcpu_idx was introduced by commit 8750e72a79dd ("KVM: remember position in kvm->vcpus array"), the helper was left behind, likely to avoid extra thrash (but even then there were only two users, the original arm usage having been removed at some point in the past). No functional change intended. Suggested-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Reviewed-by: Vitaly Kuznetsov Message-Id: <20210910183220.2397812-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e9337c843c4b4eaa4afb752a7272ef3d04c46381 Author: Hou Wenlong Date: Wed Aug 18 11:36:31 2021 +0800 kvm: fix wrong exception emulation in check_rdtsc According to Intel's SDM Vol2 and AMD's APM Vol3, when CR4.TSD is set, use rdtsc/rdtscp instruction above privilege level 0 should trigger a #GP. Fixes: d7eb82030699e ("KVM: SVM: Add intercept checks for remaining group7 instructions") Signed-off-by: Hou Wenlong Message-Id: <1297c0dd3f1bb47a6d089f850b629c7aa0247040.1629257115.git.houwenlong93@linux.alibaba.com> Reviewed-by: Sean Christopherson Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 50c038018d6be20361e8a2890262746a4ac5b11f Author: Sean Christopherson Date: Tue Sep 14 14:09:50 2021 -0700 KVM: SEV: Pin guest memory for write for RECEIVE_UPDATE_DATA Require the target guest page to be writable when pinning memory for RECEIVE_UPDATE_DATA. Per the SEV API, the PSP writes to guest memory: The result is then encrypted with GCTX.VEK and written to the memory pointed to by GUEST_PADDR field. Fixes: 15fb7de1a7f5 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command") Cc: stable@vger.kernel.org Cc: Peter Gonda Cc: Marc Orr Cc: Tom Lendacky Cc: Brijesh Singh Signed-off-by: Sean Christopherson Message-Id: <20210914210951.2994260-2-seanjc@google.com> Reviewed-by: Brijesh Singh Reviewed-by: Peter Gonda Signed-off-by: Paolo Bonzini commit f1815e0aa770f2127c5df31eb5c2f0e37b60fa77 Author: Mingwei Zhang Date: Sun Sep 12 18:18:15 2021 +0000 KVM: SVM: fix missing sev_decommission in sev_receive_start DECOMMISSION the current SEV context if binding an ASID fails after RECEIVE_START. Per AMD's SEV API, RECEIVE_START generates a new guest context and thus needs to be paired with DECOMMISSION: The RECEIVE_START command is the only command other than the LAUNCH_START command that generates a new guest context and guest handle. The missing DECOMMISSION can result in subsequent SEV launch failures, as the firmware leaks memory and might not able to allocate more SEV guest contexts in the future. Note, LAUNCH_START suffered the same bug, but was previously fixed by commit 934002cd660b ("KVM: SVM: Call SEV Guest Decommission if ASID binding fails"). Cc: Alper Gun Cc: Borislav Petkov Cc: Brijesh Singh Cc: David Rienjes Cc: Marc Orr Cc: John Allen Cc: Peter Gonda Cc: Sean Christopherson Cc: Tom Lendacky Cc: Vipin Sharma Cc: stable@vger.kernel.org Reviewed-by: Marc Orr Acked-by: Brijesh Singh Fixes: af43cbbf954b ("KVM: SVM: Add support for KVM_SEV_RECEIVE_START command") Signed-off-by: Mingwei Zhang Reviewed-by: Sean Christopherson Message-Id: <20210912181815.3899316-1-mizhang@google.com> Signed-off-by: Paolo Bonzini commit bb18a677746543e7f5eeb478129c92cedb0f9658 Author: Peter Gonda Date: Wed Sep 15 10:17:55 2021 -0700 KVM: SEV: Acquire vcpu mutex when updating VMSA The update-VMSA ioctl touches data stored in struct kvm_vcpu, and therefore should not be performed concurrently with any VCPU ioctl that might cause KVM or the processor to use the same data. Adds vcpu mutex guard to the VMSA updating code. Refactors out __sev_launch_update_vmsa() function to deal with per vCPU parts of sev_launch_update_vmsa(). Fixes: ad73109ae7ec ("KVM: SVM: Provide support to launch and run an SEV-ES guest") Signed-off-by: Peter Gonda Cc: Marc Orr Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Brijesh Singh Cc: kvm@vger.kernel.org Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: <20210915171755.3773766-1-pgonda@google.com> Signed-off-by: Paolo Bonzini commit ae232ea460888dc5a8b37e840c553b02521fbf18 Author: Sergey Senozhatsky Date: Thu Sep 2 12:11:00 2021 +0900 KVM: do not shrink halt_poll_ns below grow_start grow_halt_poll_ns() ignores values between 0 and halt_poll_ns_grow_start (10000 by default). However, when we shrink halt_poll_ns we may fall way below halt_poll_ns_grow_start and endup with halt_poll_ns values that don't make a lot of sense: like 1 or 9, or 19. VCPU1 trace (halt_poll_ns_shrink equals 2): VCPU1 grow 10000 VCPU1 shrink 5000 VCPU1 shrink 2500 VCPU1 shrink 1250 VCPU1 shrink 625 VCPU1 shrink 312 VCPU1 shrink 156 VCPU1 shrink 78 VCPU1 shrink 39 VCPU1 shrink 19 VCPU1 shrink 9 VCPU1 shrink 4 Mirror what grow_halt_poll_ns() does and set halt_poll_ns to 0 as soon as new shrink-ed halt_poll_ns value falls below halt_poll_ns_grow_start. Signed-off-by: Sergey Senozhatsky Signed-off-by: Paolo Bonzini Message-Id: <20210902031100.252080-1-senozhatsky@chromium.org> Signed-off-by: Paolo Bonzini commit ed7023a11bd820fca50e61911a670ddf3e01f73f Author: Yu Zhang Date: Thu Sep 9 01:17:31 2021 +0800 KVM: nVMX: fix comments of handle_vmon() "VMXON pointer" is saved in vmx->nested.vmxon_ptr since commit 3573e22cfeca ("KVM: nVMX: additional checks on vmxon region"). Also, handle_vmptrld() & handle_vmclear() now have logic to check the VMCS pointer against the VMXON pointer. So just remove the obsolete comments of handle_vmon(). Signed-off-by: Yu Zhang Message-Id: <20210908171731.18885-1-yu.c.zhang@linux.intel.com> Signed-off-by: Paolo Bonzini commit eb7511bf9182292ef1df1082d23039e856d1ddfb Author: Haimin Zhang Date: Fri Sep 3 10:37:06 2021 +0800 KVM: x86: Handle SRCU initialization failure during page track init Check the return of init_srcu_struct(), which can fail due to OOM, when initializing the page track mechanism. Lack of checking leads to a NULL pointer deref found by a modified syzkaller. Reported-by: TCS Robot Signed-off-by: Haimin Zhang Message-Id: <1630636626-12262-1-git-send-email-tcs_kernel@tencent.com> [Move the call towards the beginning of kvm_arch_init_vm. - Paolo] Signed-off-by: Paolo Bonzini commit cd36ae8761775e78154ba6bd7a3bd2ab538c589f Author: Sean Christopherson Date: Tue Sep 7 17:24:01 2021 -0700 KVM: VMX: Remove defunct "nr_active_uret_msrs" field Remove vcpu_vmx.nr_active_uret_msrs and its associated comment, which are both defunct now that KVM keeps the list constant and instead explicitly tracks which entries need to be loaded into hardware. No functional change intended. Fixes: ee9d22e08d13 ("KVM: VMX: Use flag to indicate "active" uret MSRs instead of sorting list") Signed-off-by: Sean Christopherson Message-Id: <20210908002401.1947049-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 01f91acb55be7aac3950b89c458bcea9ef6e4f49 Author: Oliver Upton Date: Tue Sep 21 17:11:21 2021 +0000 selftests: KVM: Align SMCCC call with the spec in steal_time The SMC64 calling convention passes a function identifier in w0 and its parameters in x1-x17. Given this, there are two deviations in the SMC64 call performed by the steal_time test: the function identifier is assigned to a 64 bit register and the parameter is only 32 bits wide. Align the call with the SMCCC by using a 32 bit register to handle the function identifier and increasing the parameter width to 64 bits. Suggested-by: Andrew Jones Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Message-Id: <20210921171121.2148982-3-oupton@google.com> Signed-off-by: Paolo Bonzini commit 90b54129e8df909ccca527b2d69bcb1f0216aa8f Author: Oliver Upton Date: Tue Sep 21 17:11:20 2021 +0000 selftests: KVM: Fix check for !POLLIN in demand_paging_test The logical not operator applies only to the left hand side of a bitwise operator. As such, the check for POLLIN not being set in revents wrong. Fix it by adding parentheses around the bitwise expression. Fixes: 4f72180eb4da ("KVM: selftests: Add demand paging content to the demand paging test") Reviewed-by: Andrew Jones Signed-off-by: Oliver Upton Message-Id: <20210921171121.2148982-2-oupton@google.com> Signed-off-by: Paolo Bonzini commit 03a6e84069d1870f5b3d360e64cb330b66f76dee Author: Sean Christopherson Date: Mon Sep 20 17:02:55 2021 -0700 KVM: x86: Clear KVM's cached guest CR3 at RESET/INIT Explicitly zero the guest's CR3 and mark it available+dirty at RESET/INIT. Per Intel's SDM and AMD's APM, CR3 is zeroed at both RESET and INIT. For RESET, this is a nop as vcpu is zero-allocated. For INIT, the bug has likely escaped notice because no firmware/kernel puts its page tables root at PA=0, let alone relies on INIT to get the desired CR3 for such page tables. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210921000303.400537-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 7117003fe4e3c8977744f2ad33bb95fd3e10023f Author: Sean Christopherson Date: Mon Sep 20 17:02:54 2021 -0700 KVM: x86: Mark all registers as avail/dirty at vCPU creation Mark all registers as available and dirty at vCPU creation, as the vCPU has obviously not been loaded into hardware, let alone been given the chance to be modified in hardware. On SVM, reading from "uninitialized" hardware is a non-issue as VMCBs are zero allocated (thus not truly uninitialized) and hardware does not allow for arbitrary field encoding schemes. On VMX, backing memory for VMCSes is also zero allocated, but true initialization of the VMCS _technically_ requires VMWRITEs, as the VMX architectural specification technically allows CPU implementations to encode fields with arbitrary schemes. E.g. a CPU could theoretically store the inverted value of every field, which would result in VMREAD to a zero-allocated field returns all ones. In practice, only the AR_BYTES fields are known to be manipulated by hardware during VMREAD/VMREAD; no known hardware or VMM (for nested VMX) does fancy encoding of cacheable field values (CR0, CR3, CR4, etc...). In other words, this is technically a bug fix, but practically speakings it's a glorified nop. Failure to mark registers as available has been a lurking bug for quite some time. The original register caching supported only GPRs (+RIP, which is kinda sorta a GPR), with the masks initialized at ->vcpu_reset(). That worked because the two cacheable registers, RIP and RSP, are generally speaking not read as side effects in other flows. Arguably, commit aff48baa34c0 ("KVM: Fetch guest cr3 from hardware on demand") was the first instance of failure to mark regs available. While _just_ marking CR3 available during vCPU creation wouldn't have fixed the VMREAD from an uninitialized VMCS bug because ept_update_paging_mode_cr0() unconditionally read vmcs.GUEST_CR3, marking CR3 _and_ intentionally not reading GUEST_CR3 when it's available would have avoided VMREAD to a technically-uninitialized VMCS. Fixes: aff48baa34c0 ("KVM: Fetch guest cr3 from hardware on demand") Fixes: 6de4f3ada40b ("KVM: Cache pdptrs") Fixes: 6de12732c42c ("KVM: VMX: Optimize vmx_get_rflags()") Fixes: 2fb92db1ec08 ("KVM: VMX: Cache vmcs segment fields") Fixes: bd31fe495d0d ("KVM: VMX: Add proper cache tracking for CR0") Fixes: f98c1e77127d ("KVM: VMX: Add proper cache tracking for CR4") Fixes: 5addc235199f ("KVM: VMX: Cache vmcs.EXIT_QUALIFICATION using arch avail_reg flags") Fixes: 8791585837f6 ("KVM: VMX: Cache vmcs.EXIT_INTR_INFO using arch avail_reg flags") Signed-off-by: Sean Christopherson Message-Id: <20210921000303.400537-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 2da4a23599c263bd4a7658c2fe561cb3a73ea6ae Author: Sean Christopherson Date: Wed Sep 1 13:30:30 2021 -0700 KVM: selftests: Remove __NR_userfaultfd syscall fallback Revert the __NR_userfaultfd syscall fallback added for KVM selftests now that x86's unistd_{32,63}.h overrides are under uapi/ and thus not in KVM selftests' search path, i.e. now that KVM gets x86 syscall numbers from the installed kernel headers. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson Message-Id: <20210901203030.1292304-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 61e52f1630f54713f5dffa1ab4bb49772235aa5a Author: Sean Christopherson Date: Wed Sep 1 13:30:29 2021 -0700 KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs Add a test to verify an rseq's CPU ID is updated correctly if the task is migrated while the kernel is handling KVM_RUN. This is a regression test for a bug introduced by commit 72c3c0fe54a3 ("x86/kvm: Use generic xfer to guest work function"), where TIF_NOTIFY_RESUME would be cleared by KVM without updating rseq, leading to a stale CPU ID and other badness. Signed-off-by: Sean Christopherson Acked-by: Mathieu Desnoyers Message-Id: <20210901203030.1292304-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit de5f4213dafa8f8b0b52cdaf06bb35ad4cab1681 Author: Sean Christopherson Date: Wed Sep 1 13:30:28 2021 -0700 tools: Move x86 syscall number fallbacks to .../uapi/ Move unistd_{32,64}.h from x86/include/asm to x86/include/uapi/asm so that tools/selftests that install kernel headers, e.g. KVM selftests, can include non-uapi tools headers, e.g. to get 'struct list_head', without effectively overriding the installed non-tool uapi headers. Swapping KVM's search order, e.g. to search the kernel headers before tool headers, is not a viable option as doing results in linux/type.h and other core headers getting pulled from the kernel headers, which do not have the kernel-internal typedefs that are used through tools, including many files outside of selftests/kvm's control. Prior to commit cec07f53c398 ("perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/"), the handcoded numbers were actual fallbacks, i.e. overriding unistd_{32,64}.h from the kernel headers was unintentional. Signed-off-by: Sean Christopherson Message-Id: <20210901203030.1292304-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a68de80f61f6af397bc06fb391ff2e571c9c4d80 Author: Sean Christopherson Date: Wed Sep 1 13:30:27 2021 -0700 entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume() Invoke rseq_handle_notify_resume() from tracehook_notify_resume() now that the two function are always called back-to-back by architectures that have rseq. The rseq helper is stubbed out for architectures that don't support rseq, i.e. this is a nop across the board. Note, tracehook_notify_resume() is horribly named and arguably does not belong in tracehook.h as literally every line of code in it has nothing to do with tracing. But, that's been true since commit a42c6ded827d ("move key_repace_session_keyring() into tracehook_notify_resume()") first usurped tracehook_notify_resume() back in 2012. Punt cleaning that mess up to future patches. No functional change intended. Acked-by: Mathieu Desnoyers Signed-off-by: Sean Christopherson Message-Id: <20210901203030.1292304-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 8646e53633f314e4d746a988240d3b951a92f94a Author: Sean Christopherson Date: Wed Sep 1 13:30:26 2021 -0700 KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest Invoke rseq's NOTIFY_RESUME handler when processing the flag prior to transferring to a KVM guest, which is roughly equivalent to an exit to userspace and processes many of the same pending actions. While the task cannot be in an rseq critical section as the KVM path is reachable only by via ioctl(KVM_RUN), the side effects that apply to rseq outside of a critical section still apply, e.g. the current CPU needs to be updated if the task is migrated. Clearing TIF_NOTIFY_RESUME without informing rseq can lead to segfaults and other badness in userspace VMMs that use rseq in combination with KVM, e.g. due to the CPU ID being stale after task migration. Fixes: 72c3c0fe54a3 ("x86/kvm: Use generic xfer to guest work function") Reported-by: Peter Foley Bisected-by: Doug Evans Acked-by: Mathieu Desnoyers Cc: Shakeel Butt Cc: Thomas Gleixner Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210901203030.1292304-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit b78f26926b17cc289e4f16b63363abe0aa2e8efc Author: Marc Zyngier Date: Fri Sep 10 18:29:25 2021 +0100 irqchip/gic: Work around broken Renesas integration Geert reported that the GIC driver locks up on a Renesas system since 005c34ae4b44f085 ("irqchip/gic: Atomically update affinity") fixed the driver to use writeb_relaxed() instead of writel_relaxed(). As it turns out, the interconnect used on this system mandates 32bit wide accesses for all MMIO transactions, even if the GIC architecture specifically mandates for some registers to be byte accessible. Gahhh... Work around the issue by crudly detecting the offending system, and falling back to an inefficient RMW+lock implementation. Reported-by: Geert Uytterhoeven Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/CAMuHMdV+Ev47K5NO8XHsanSq5YRMCHn2gWAQyV-q2LpJVy9HiQ@mail.gmail.com commit 977d293e23b48a1129830d7968605f61c4af71a0 Author: Paolo Abeni Date: Wed Sep 22 13:12:17 2021 +0200 mptcp: ensure tx skbs always have the MPTCP ext Due to signed/unsigned comparison, the expression: info->size_goal - skb->len > 0 evaluates to true when the size goal is smaller than the skb size. That results in lack of tx cache refill, so that the skb allocated by the core TCP code lacks the required MPTCP skb extensions. Due to the above, syzbot is able to trigger the following WARN_ON(): WARNING: CPU: 1 PID: 810 at net/mptcp/protocol.c:1366 mptcp_sendmsg_frag+0x1362/0x1bc0 net/mptcp/protocol.c:1366 Modules linked in: CPU: 1 PID: 810 Comm: syz-executor.4 Not tainted 5.14.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:mptcp_sendmsg_frag+0x1362/0x1bc0 net/mptcp/protocol.c:1366 Code: ff 4c 8b 74 24 50 48 8b 5c 24 58 e9 0f fb ff ff e8 13 44 8b f8 4c 89 e7 45 31 ed e8 98 57 2e fe e9 81 f4 ff ff e8 fe 43 8b f8 <0f> 0b 41 bd ea ff ff ff e9 6f f4 ff ff 4c 89 e7 e8 b9 8e d2 f8 e9 RSP: 0018:ffffc9000531f6a0 EFLAGS: 00010216 RAX: 000000000000697f RBX: 0000000000000000 RCX: ffffc90012107000 RDX: 0000000000040000 RSI: ffffffff88eac9e2 RDI: 0000000000000003 RBP: ffff888078b15780 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff88eac017 R11: 0000000000000000 R12: ffff88801de0a280 R13: 0000000000006b58 R14: ffff888066278280 R15: ffff88803c2fe9c0 FS: 00007fd9f866e700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007faebcb2f718 CR3: 00000000267cb000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __mptcp_push_pending+0x1fb/0x6b0 net/mptcp/protocol.c:1547 mptcp_release_cb+0xfe/0x210 net/mptcp/protocol.c:3003 release_sock+0xb4/0x1b0 net/core/sock.c:3206 sk_stream_wait_memory+0x604/0xed0 net/core/stream.c:145 mptcp_sendmsg+0xc39/0x1bc0 net/mptcp/protocol.c:1749 inet6_sendmsg+0x99/0xe0 net/ipv6/af_inet6.c:643 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 sock_write_iter+0x2a0/0x3e0 net/socket.c:1057 call_write_iter include/linux/fs.h:2163 [inline] new_sync_write+0x40b/0x640 fs/read_write.c:507 vfs_write+0x7cf/0xae0 fs/read_write.c:594 ksys_write+0x1ee/0x250 fs/read_write.c:647 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:0x4665f9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd9f866e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665f9 RDX: 00000000000e7b78 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 0000000000a9fb1f R14: 00007fd9f866e300 R15: 0000000000022000 Fix the issue rewriting the relevant expression to avoid sign-related problems - note: size_goal is always >= 0. Additionally, ensure that the skb in the tx cache always carries the relevant extension. Reported-and-tested-by: syzbot+263a248eec3e875baa7b@syzkaller.appspotmail.com Fixes: 1094c6fe7280 ("mptcp: fix possible divide by zero") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 1ea7812326004afd2803cc968a4776ae5120a597 Author: Shai Malin Date: Wed Sep 22 13:53:26 2021 +0300 qed: rdma - don't wait for resources under hw error recovery flow If the HW device is during recovery, the HW resources will never return, hence we shouldn't wait for the CID (HW context ID) bitmaps to clear. This fix speeds up the error recovery flow. Fixes: 64515dc899df ("qed: Add infrastructure for error detection and recovery") Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit 3ce8c70ecedb4e1f1d36301afb0281be40390f13 Author: Geert Uytterhoeven Date: Wed Sep 15 11:47:30 2021 +0200 irqchip/renesas-rza1: Use semicolons instead of commas This code works, but it is cleaner to use semicolons at the end of statements instead of commas. Extracted from a big anonymous patch by Julia Lawall . Signed-off-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/b1710bb6ea5faa7a7fe74404adb0beb951e0bf8c.1631699160.git.geert+renesas@glider.be commit 280bef512933b2dda01d681d8cbe499b98fc5bdd Author: Kaige Fu Date: Wed Sep 15 10:20:55 2021 +0800 irqchip/gic-v3-its: Fix potential VPE leak on error In its_vpe_irq_domain_alloc, when its_vpe_init() returns an error, there is an off-by-one in the number of VPEs to be freed. Fix it by simply passing the number of VPEs allocated, which is the index of the loop iterating over the VPEs. Fixes: 7d75bbb4bc1a ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown") Signed-off-by: Kaige Fu [maz: fixed commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/d9e36dee512e63670287ed9eff884a5d8d6d27f2.1631672311.git.kaige.fu@linux.alibaba.com commit 969ac78db78c723a24e9410666b457cc1b0cb3c3 Author: Randy Dunlap Date: Sun Sep 5 09:25:19 2021 -0700 irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build irq-goldfish-pic uses GENERIC_IRQ_CHIP interfaces so select that symbol to fix build errors. Fixes these build errors: mips-linux-ld: drivers/irqchip/irq-goldfish-pic.o: in function `goldfish_pic_of_init': irq-goldfish-pic.c:(.init.text+0xc0): undefined reference to `irq_alloc_generic_chip' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0xf4): undefined reference to `irq_gc_unmask_enable_reg' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0xf8): undefined reference to `irq_gc_unmask_enable_reg' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0x100): undefined reference to `irq_gc_mask_disable_reg' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0x104): undefined reference to `irq_gc_mask_disable_reg' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0x11c): undefined reference to `irq_setup_generic_chip' mips-linux-ld: irq-goldfish-pic.c:(.init.text+0x168): undefined reference to `irq_remove_generic_chip' Fixes: 4235ff50cf98 ("irqchip/irq-goldfish-pic: Add Goldfish PIC driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Miodrag Dinic Cc: Geert Uytterhoeven Cc: Bartosz Golaszewski Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Goran Ferenc Cc: Aleksandar Markovic Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210905162519.21507-1-rdunlap@infradead.org commit b99948836162b0cfb03007d9b2c2da9babc057b5 Author: Randy Dunlap Date: Sat Sep 4 20:36:44 2021 -0700 irqchip/mbigen: Repair non-kernel-doc notation Fix kernel-doc warnings in irq-mbigen.c: irq-mbigen.c:29: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * In mbigen vector register irq-mbigen.c:43: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * offset of clear register in mbigen node irq-mbigen.c:50: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * offset of interrupt type register Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Jun Ma Cc: Yun Wu Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Aditya Srivastava Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210905033644.15988-1-rdunlap@infradead.org commit 20c36ce2164f1774b487d443ece99b754bc6ad43 Author: Bixuan Cui Date: Thu Sep 16 10:52:03 2021 +0800 irqdomain: Change the type of 'size' in __irq_domain_add() to be consistent The 'size' is used in struct_size(domain, revmap, size) and its input parameter type is 'size_t'(unsigned int). Changing the size to 'unsigned int' to make the type consistent. Signed-off-by: Bixuan Cui Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210916025203.44841-1-cuibixuan@huawei.com commit 2a7313dc81e88adc7bb09d0f056985fa8afc2b89 Author: Marc Zyngier Date: Wed Sep 22 14:19:41 2021 +0100 irqchip/armada-370-xp: Fix ack/eoi breakage When converting the driver to using handle_percpu_devid_irq, we forgot to repaint the irq_eoi() callback into irq_ack(), as handle_percpu_devid_fasteoi_ipi() was actually using EOI really early in the handling. Yes this was a stupid idea. Fix this by using the HW ack method as irq_ack(). Fixes: e52e73b7e9f7 ("irqchip/armada-370-xp: Make IPIs use handle_percpu_devid_irq()") Reported-by: Steffen Trumtrar Tested-by: Steffen Trumtrar Signed-off-by: Marc Zyngier Cc: Valentin Schneider Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87tuiexq5f.fsf@pengutronix.de commit 372d1f3e1bfede719864d0d1fbf3146b1e638c88 Author: Dan Carpenter Date: Tue Sep 21 23:32:33 2021 +0300 ext2: fix sleeping in atomic bugs on error The ext2_error() function syncs the filesystem so it sleeps. The caller is holding a spinlock so it's not allowed to sleep. ext2_statfs() <- disables preempt -> ext2_count_free_blocks() -> ext2_get_group_desc() Fix this by using WARN() to print an error message and a stack trace instead of using ext2_error(). Link: https://lore.kernel.org/r/20210921203233.GA16529@kili Signed-off-by: Dan Carpenter Signed-off-by: Jan Kara commit b22a4705e2e60f342b1b851c9ebdb3ea02f21f8f Author: Heiko Stuebner Date: Tue Sep 14 00:49:24 2021 +0200 gpio/rockchip: fix get_direction value handling The function uses the newly introduced rockchip_gpio_readl_bit() which directly returns the actual value of the requeste bit. So using the existing bit-wise check for the bit inside the value will always return 0. Fix this by dropping the bit manipulation on the result. Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller") Signed-off-by: Heiko Stuebner Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0f562b7de99085935d76b00c41ab5caa26ff5c74 Author: Heiko Stuebner Date: Tue Sep 14 00:49:23 2021 +0200 gpio/rockchip: extended debounce support is only available on v2 The gpio driver runs into issues on v1 gpio blocks, as the db_clk and the whole extended debounce support is only ever defined on v2. So checking for the IS_ERR on the db_clk is not enough, as it will be NULL on v1. Fix this by adding the needed condition for v2 first before checking the existence of the db_clk. This caused my rk3288-veyron-pinky to enter a reboot loop when it tried to enable the power-key as adc-key device. Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller") Signed-off-by: Heiko Stuebner Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit f6c35df22708438c94605b8896d2b4e4d5f342a3 Author: Steven Lee Date: Tue Sep 7 17:55:25 2021 +0800 gpio: gpio-aspeed-sgpio: Fix wrong hwirq in irq handler. The current hwirq is calculated based on the old GPIO pin order(input GPIO range is from 0 to ngpios - 1). It should be calculated based on the current GPIO input pin order(input GPIOs are 0, 2, 4, ..., (ngpios - 1) * 2). Signed-off-by: Steven Lee Signed-off-by: Bartosz Golaszewski commit 2dd824cca3407bc9a2bd11b00f6e117b66fcfcf1 Author: Kunihiko Hayashi Date: Thu Sep 16 20:19:35 2021 +0900 gpio: uniphier: Fix void functions to remove return value The return type of irq_chip.irq_mask() and irq_chip.irq_unmask() should be void. Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver") Signed-off-by: Kunihiko Hayashi Signed-off-by: Bartosz Golaszewski commit cef0d022f55364d69017daeb9443bd31510ad6a2 Author: Hans de Goede Date: Mon Aug 16 12:41:19 2021 +0200 gpiolib: acpi: Make set-debounce-timeout failures non fatal Commit 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings") made the gpiolib-acpi code call gpio_set_debounce_timeout() when requesting GPIOs. This in itself is fine, but it also made gpio_set_debounce_timeout() errors fatal, causing the requesting of the GPIO to fail. This is causing regressions. E.g. on a HP ElitePad 1000 G2 various _AEI specified GPIO ACPI event sources specify a debouncy timeout of 20 ms, but the pinctrl-baytrail.c only supports certain fixed values, the closest ones being 12 or 24 ms and pinctrl-baytrail.c responds with -EINVAL when specified a value which is not one of the fixed values. This is causing the acpi_request_own_gpiod() call to fail for 3 ACPI event sources on the HP ElitePad 1000 G2, which in turn is causing e.g. the battery charging vs discharging status to never get updated, even though a charger has been plugged-in or unplugged. Make gpio_set_debounce_timeout() errors non fatal, warning about the failure instead, to fix this regression. Note we should probably also fix various pinctrl drivers to just pick the first bigger discrete value rather then returning -EINVAL but this will need to be done on a per driver basis, where as this fix at least gets us back to where things were before and thus restores functionality on devices where this was lost due to gpio_set_debounce_timeout() errors. Fixes: 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings") Depends-on: 2e2b496cebef ("gpiolib: acpi: Extract acpi_request_own_gpiod() helper") Reviewed-by: Mika Westerberg Signed-off-by: Hans de Goede Acked-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit c54467482ffd407a4404c990697f432bfcb6cdc4 Author: Marcel Ziswiler Date: Mon Sep 20 16:49:31 2021 +0200 ARM: imx_v6_v7_defconfig: enable fb 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. Fixes: f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") Reviewed-by: Fabio Estevam Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 450e7fe9b1b3c90eeed74a2fe0eeb13a7b57f3da Author: Fabio Estevam Date: Tue Sep 14 14:17:15 2021 -0300 ARM: dts: imx6qdl-pico: Fix Ethernet support Currently, it is no longer possible to retrieve a DHCP address on the imx6qdl-pico board. This issue has been exposed by commit f5d9aa79dfdf ("ARM: imx6q: remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs"). Fix it by describing the qca,clk-out-frequency property as suggested by the commit above. Fixes: 98670a0bb0ef14bbb3 ("ARM: dts: imx6qdl: Add imx6qdl-pico support") Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Signed-off-by: Shawn Guo commit 5c187e2eb3f92daa38cb3d4ab45e1107ea34108e Author: Marek Vasut Date: Sun Sep 5 02:01:37 2021 +0200 ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all. Fixes: 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo") Signed-off-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: NXP Linux Team Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 22d65765f211cc83186fd8b87521159f354c0da9 Author: Andrej Shadura Date: Thu Sep 16 17:33:11 2021 +0100 HID: u2fzero: ignore incomplete packets without data Since the actual_length calculation is performed unsigned, packets shorter than 7 bytes (e.g. packets without data or otherwise truncated) or non-received packets ("zero" bytes) can cause buffer overflow. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214437 Fixes: 42337b9d4d958("HID: add driver for U2F Zero built-in LED and RNG") Signed-off-by: Andrej Shadura Signed-off-by: Jiri Kosina commit f7d848e0fdfa557f181955a769cbb163d54fd292 Author: Jiri Slaby Date: Wed Sep 22 08:30:08 2021 +0200 MAINTAINERS: usb, update Peter Korsgaard's entries Peter's e-mail in MAINTAINERS is defunct: This is the qmail-send program at a.mx.sunsite.dk. : Sorry, no mailbox here by that name. (#5.1.1) Peter says: ** Ahh yes, it should be changed to peter@korsgaard.com. However he also says: ** I haven't had access to c67x00 hw for quite some years though, so maybe ** it should be marked Orphan instead? So change as he wishes. Cc: Peter Korsgaard Cc: Linus Torvalds Cc: linux-usb@vger.kernel.org Acked-by: Peter Korsgaard Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210922063008.25758-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit c8c1efe14a4aadcfe93a158b1272e48298d2de15 Author: Marek Vasut Date: Sun Sep 5 02:00:48 2021 +0200 ARM: dts: imx: Add missing pinctrl-names for panel on M53Menlo The panel already contains pinctrl-0 phandle, but it is missing the default pinctrl-names property, so the pin configuration is ignored. Fill in the missing pinctrl-names property, so the pin configuration is applied. Fixes: d81765d693db6 ("ARM: dts: imx53: Update LCD panel node on M53Menlo") Signed-off-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: NXP Linux Team Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit fbdac19e642899455b4e64c63aafe2325df7aafa Author: Wen Xiong Date: Thu Sep 16 22:24:21 2021 -0500 scsi: ses: Retry failed Send/Receive Diagnostic commands Setting SCSI logging level with error=3, we saw some errors from enclosues: [108017.360833] ses 0:0:9:0: tag#641 Done: NEEDS_RETRY Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s [108017.360838] ses 0:0:9:0: tag#641 CDB: Receive Diagnostic 1c 01 01 00 20 00 [108017.427778] ses 0:0:9:0: Power-on or device reset occurred [108017.427784] ses 0:0:9:0: tag#641 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s [108017.427788] ses 0:0:9:0: tag#641 CDB: Receive Diagnostic 1c 01 01 00 20 00 [108017.427791] ses 0:0:9:0: tag#641 Sense Key : Unit Attention [current] [108017.427793] ses 0:0:9:0: tag#641 Add. Sense: Bus device reset function occurred [108017.427801] ses 0:0:9:0: Failed to get diagnostic page 0x1 [108017.427804] ses 0:0:9:0: Failed to bind enclosure -19 [108017.427895] ses 0:0:10:0: Attached Enclosure device [108017.427942] ses 0:0:10:0: Attached scsi generic sg18 type 13 Retry if the Send/Receive Diagnostic commands complete with a transient error status (NOT_READY or UNIT_ATTENTION with ASC 0x29). Link: https://lore.kernel.org/r/1631849061-10210-2-git-send-email-wenxiong@linux.ibm.com Reviewed-by: Brian King Reviewed-by: James Bottomley Signed-off-by: Wen Xiong Signed-off-by: Martin K. Petersen commit 9a8ef2c73c727a3c64b70c01697c578c7b10fed2 Author: Colin Ian King Date: Mon Sep 20 19:32:06 2021 +0100 scsi: target: Fix spelling mistake "CONFLIFT" -> "CONFLICT" There is a spelling mistake in a dev_err message. Fix it. Link: https://lore.kernel.org/r/20210920183206.17477-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit a38923f2d088d1a5cbaa86818abe039b2f87093d Author: Arnd Bergmann Date: Mon Sep 20 11:56:22 2021 +0200 scsi: lpfc: Fix gcc -Wstringop-overread warning, again I fixed a stringop-overread warning earlier this year, now a second copy of the original code was added and the warning came back: drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_cmf_info_show': drivers/scsi/lpfc/lpfc_attr.c:289:25: error: 'strnlen' specified bound 4095 exceeds source size 24 [-Werror=stringop-overread] 289 | strnlen(LPFC_INFO_MORE_STR, PAGE_SIZE - 1), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix it the same way as the other copy. Link: https://lore.kernel.org/r/20210920095628.1191676-1-arnd@kernel.org Fixes: ada48ba70f6b ("scsi: lpfc: Fix gcc -Wstringop-overread warning") Fixes: 74a7baa2a3ee ("scsi: lpfc: Add cmf_info sysfs entry") Reviewed-by: James Smart Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen commit 6dacc371b77f473770ec646e220303a84fe96c11 Author: Dan Carpenter Date: Thu Sep 16 16:23:31 2021 +0300 scsi: lpfc: Use correct scnprintf() limit The limit should be "PAGE_SIZE - len" instead of "PAGE_SIZE". We're not going to hit the limit so this fix will not affect runtime. Link: https://lore.kernel.org/r/20210916132331.GE25094@kili Fixes: 5b9e70b22cc5 ("scsi: lpfc: raise sg count for nvme to use available sg resources") Reviewed-by: James Smart Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit cdbc16c552f27ac211a44f9959d813b4f3188223 Author: Dan Carpenter Date: Thu Sep 16 16:22:51 2021 +0300 scsi: lpfc: Fix sprintf() overflow in lpfc_display_fpin_wwpn() This scnprintf() uses the wrong limit. It should be "LPFC_FPIN_WWPN_LINE_SZ - len" instead of LPFC_FPIN_WWPN_LINE_SZ. Link: https://lore.kernel.org/r/20210916132251.GD25094@kili Fixes: 428569e66fa7 ("scsi: lpfc: Expand FPIN and RDF receive logging") Reviewed-by: James Smart Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit a4869faf9642518145a8aa4b52e0d5ab0e7ee896 Author: Hannes Reinecke Date: Wed Sep 15 17:07:15 2021 +0800 scsi: core: Remove 'current_tag' The 'current_tag' field in struct scsi_device is unused now; remove it. Link: https://lore.kernel.org/r/1631696835-136198-4-git-send-email-john.garry@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Hannes Reinecke Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 756fb6a895afbf1f0615d93ebdd14863a00b1198 Author: Hannes Reinecke Date: Wed Sep 15 17:07:14 2021 +0800 scsi: acornscsi: Remove tagged queuing vestiges The acornscsi driver has a config option to enable tagged queuing, but this option gets disabled in the driver itself with the comment 'needs to be debugged'. As this is a _really_ old driver I doubt anyone will be wanting to invest time here, so remove the tagged queue vestiges and make our lives easier. [jpg: Use scsi_cmd_to_rq()] Link: https://lore.kernel.org/r/1631696835-136198-3-git-send-email-john.garry@huawei.com Signed-off-by: Hannes Reinecke Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit bc41fcbffd5759c9610f7de211420eae6b379503 Author: Hannes Reinecke Date: Wed Sep 15 17:07:13 2021 +0800 scsi: fas216: Kill scmd->tag The driver is attempting to allocate a tag internally which is a no-go with blk-mq. Switch the driver to use the request tag and kill usage of scmd->tag and scmd->device->current_tag. [jpg: Change to use scsi_cmd_to_rq()] Link: https://lore.kernel.org/r/1631696835-136198-2-git-send-email-john.garry@huawei.com Signed-off-by: Hannes Reinecke Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 5f8579038842d77e6ce05e1df6bf9dd493b0e3ef Author: Dmitry Bogdanov Date: Wed Sep 15 18:32:39 2021 +0300 scsi: qla2xxx: Restore initiator in dual mode In dual mode in case of disabling the target, the whole port goes offline and initiator is turned off too. Fix restoring initiator mode after disabling target in dual mode. Link: https://lore.kernel.org/r/20210915153239.8035-1-d.bogdanov@yadro.com Fixes: 0645cb8350cd ("scsi: qla2xxx: Add mode control for each physical port") Reviewed-by: Himanshu Madhani Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit d04a968c33684b15d1206e23fc1119ce0f0587fb Author: Bart Van Assche Date: Thu Sep 16 10:54:04 2021 -0700 scsi: ufs: core: Unbreak the reset handler A command tag is passed as the second argument of the __ufshcd_transfer_req_compl() call in ufshcd_eh_device_reset_handler() instead of a bitmask. Fix this by passing a bitmask as argument instead of a command tag. Link: https://lore.kernel.org/r/20210916175408.2260084-1-bvanassche@acm.org Fixes: a45f937110fa ("scsi: ufs: Optimize host lock on transfer requests send/compl paths") Cc: Can Guo Reviewed-by: Avri Altman Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1d479e6c9cb2b40abfb455863a4e9335db882e33 Author: Bart Van Assche Date: Fri Sep 17 14:23:14 2021 -0700 scsi: sd_zbc: Support disks with more than 2**32 logical blocks This patch addresses the following Coverity report about the zno * sdkp->zone_blocks expression: CID 1475514 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression zno * sdkp->zone_blocks with type unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type sector_t (64 bits, unsigned). Link: https://lore.kernel.org/r/20210917212314.2362324-1-bvanassche@acm.org Fixes: 5795eb443060 ("scsi: sd_zbc: emulate ZONE_APPEND commands") Cc: Johannes Thumshirn Cc: Damien Le Moal Cc: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4497b40ca8217fce9f33c9886f5a1b0408661e03 Author: Fabio Estevam Date: Mon Sep 20 20:43:11 2021 -0300 Revert "ARM: imx6q: drop of_platform_default_populate() from init_machine" This reverts commit cc8870bf4c3ab0af385538460500a9d342ed945f. Since commit cc8870bf4c3a ("ARM: imx6q: drop of_platform_default_populate() from init_machine") the following errors are seen on boot: [ 0.123372] imx6q_suspend_init: failed to find ocram device! [ 0.123537] imx6_pm_common_init: No DDR LPM support with suspend -19! , which break suspend/resume on imx6q/dl. Revert the offeding commit to avoid the regression. Thanks to Tim Harvey for bisecting this problem. Cc: stable@vger.kernel.org Fixes: cc8870bf4c3a ("ARM: imx6q: drop of_platform_default_populate() from init_machine") Signed-off-by: Fabio Estevam Acked-by: Russell King (Oracle) Signed-off-by: Shawn Guo commit 88b099006d83b0bf452379cad4ce494329084726 Author: Adrian Hunter Date: Fri Sep 17 17:43:49 2021 +0300 scsi: ufs: core: Revert "scsi: ufs: Synchronize SCSI and UFS error handling" This reverts commit a113eaaf86373362b053279049907ff82b5df6c8. There are a couple of issues with the commit: 1. It causes deadlocks. 2. It causes the shost->eh_cmd_q list of failed requests not to be processed, ever. So revert it. 1. Deadlocks The SCSI error handler runs with requests blocked beginning when scsi_schedule_eh() sets SHOST_RECOVERY state, continuing through scsi_error_handler() callback ->eh_strategy_handler() until scsi_restart_operations() is called. By setting eh_strategy_handler to ufshcd_err_handler, the patch changed the UFS error handler to run with requests blocked, including PM requests, for the entire run of the error handler. That conflicts with UFS error handler existing synchronization with UFS device PM operations. The UFS error handler synchronizes with runtime PM by doing pm_runtime_get_sync() prior to blocking requests itself. It synchronizes with system PM by use of hba->host_sem, again before blocking requests itself. However, if requests are already blocked, then PM operations will block. So: the UFS error handler blocks waiting on PM + PM blocks waiting on SCSI PM requests to process or fail + PM requests are blocked waiting on error handling to finish = deadlock This happens both for runtime PM and system PM. Prior to the patch, these deadlocks could not happen even if SCSI error handling was running, because the presence of requests in shost->eh_cmd_q would mean the queues could not be suspended, which would mean that, should the UFS error handler run at the same time, it would not need to wait for PM or vice versa. Please note these scenarios are not just theoretical, they were found during testing on a Samsung Galaxy Book S. 2. ->eh_strategy_handler() must process shost->eh_cmd_q list of failed requests, as all other eh_strategy_handler's do except UFS error handler. Refer for example: scsi_unjam_host(), ata_scsi_error() and sas_scsi_recover_host(). Link: https://lore.kernel.org/r/20210917144349.14058-1-adrian.hunter@intel.com Fixes: a113eaaf8637 ("scsi: ufs: Synchronize SCSI and UFS error handling") Reviewed-by: Bart Van Assche Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit 9b663b34c94a78f39fa2c7a8271b1f828b546e16 Author: Michal Vokáč Date: Wed Aug 18 09:02:08 2021 +0200 ARM: dts: imx6dl-yapp4: Fix lp5562 LED driver probe Since the LED multicolor framework support was added in commit 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx") LEDs on this platform stopped working. Author of the framework attempted to accommodate this DT to the framework in commit b86d3d21cd4c ("ARM: dts: imx6dl-yapp4: Add reg property to the lp5562 channel node") but that is not sufficient. A color property is now required even if the multicolor framework is not used, otherwise the driver probe fails: lp5562: probe of 1-0030 failed with error -22 Add the color property to fix this. Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx") Cc: Cc: linux-leds@vger.kernel.org Signed-off-by: Michal Vokáč Acked-by: Pavel Machek Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit b52d3161c23f8944a4050874d3556c8ed148927f Merge: b3f98404bd629 d2b59bd4b06d8 Author: Jakub Kicinski Date: Tue Sep 21 20:02:27 2021 -0700 Merge branch 's390-qeth-fixes-2021-09-21' Julian Wiedmann says: ==================== s390/qeth: fixes 2021-09-21 This brings two fixes for deadlocks when a device is removed while it has certain types of async work pending. And one additional fix for a missing NULL check in an error case. ==================== Link: https://lore.kernel.org/r/20210921145217.1584654-1-jwi@linux.ibm.com Signed-off-by: Jakub Kicinski commit d2b59bd4b06d84a4eadb520b0f71c62fe8ec0a62 Author: Alexandra Winter Date: Tue Sep 21 16:52:17 2021 +0200 s390/qeth: fix deadlock during failing recovery Commit 0b9902c1fcc5 ("s390/qeth: fix deadlock during recovery") removed taking discipline_mutex inside qeth_do_reset(), fixing potential deadlocks. An error path was missed though, that still takes discipline_mutex and thus has the original deadlock potential. Intermittent deadlocks were seen when a qeth channel path is configured offline, causing a race between qeth_do_reset and ccwgroup_remove. Call qeth_set_offline() directly in the qeth_do_reset() error case and then a new variant of ccwgroup_set_offline(), without taking discipline_mutex. Fixes: b41b554c1ee7 ("s390/qeth: fix locking for discipline setup / removal") Signed-off-by: Alexandra Winter Reviewed-by: Julian Wiedmann Signed-off-by: Julian Wiedmann Signed-off-by: Jakub Kicinski commit ee909d0b1dac8632eeb78cbf17661d6c7674bbd0 Author: Alexandra Winter Date: Tue Sep 21 16:52:16 2021 +0200 s390/qeth: Fix deadlock in remove_discipline Problem: qeth_close_dev_handler is a worker that tries to acquire card->discipline_mutex via drv->set_offline() in ccwgroup_set_offline(). Since commit b41b554c1ee7 ("s390/qeth: fix locking for discipline setup / removal") qeth_remove_discipline() is called under card->discipline_mutex and cancels the work and waits for it to finish. STOPLAN reception with reason code IPA_RC_VEPA_TO_VEB_TRANSITION is the only situation that schedules close_dev_work. In that situation scheduling qeth recovery will also result in an offline interface, when resetting the isolation mode fails, if the external switch is still set to VEB. And since commit 0b9902c1fcc5 ("s390/qeth: fix deadlock during recovery") qeth recovery does not aquire card->discipline_mutex anymore. So we accept the longer pathlength of qeth_schedule_recovery in this error situation and re-use the existing function. As a side-benefit this changes the hwtrap to behave like during recovery instead of like during a user-triggered set_offline. Fixes: b41b554c1ee7 ("s390/qeth: fix locking for discipline setup / removal") Signed-off-by: Alexandra Winter Acked-by: Julian Wiedmann Signed-off-by: Julian Wiedmann Signed-off-by: Jakub Kicinski commit 248f064af222a1f97ee02c84a98013dfbccad386 Author: Julian Wiedmann Date: Tue Sep 21 16:52:15 2021 +0200 s390/qeth: fix NULL deref in qeth_clear_working_pool_list() When qeth_set_online() calls qeth_clear_working_pool_list() to roll back after an error exit from qeth_hardsetup_card(), we are at risk of accessing card->qdio.in_q before it was allocated by qeth_alloc_qdio_queues() via qeth_mpc_initialize(). qeth_clear_working_pool_list() then dereferences NULL, and by writing to queue->bufs[i].pool_entry scribbles all over the CPU's lowcore. Resulting in a crash when those lowcore areas are used next (eg. on the next machine-check interrupt). Such a scenario would typically happen when the device is first set online and its queues aren't allocated yet. An early IO error or certain misconfigs (eg. mismatched transport mode, bad portno) then cause us to error out from qeth_hardsetup_card() with card->qdio.in_q still being NULL. Fix it by checking the pointer for NULL before accessing it. Note that we also have (rare) paths inside qeth_mpc_initialize() where a configuration change can cause us to free the existing queues, expecting that subsequent code will allocate them again. If we then error out before that re-allocation happens, the same bug occurs. Fixes: eff73e16ee11 ("s390/qeth: tolerate pre-filled RX buffer") Reported-by: Stefan Raspl Root-caused-by: Heiko Carstens Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit e946d3c887a9dc33aa82a349c6284f4a084163f4 Author: Dan Carpenter Date: Tue Sep 21 23:33:35 2021 +0300 cifs: fix a sign extension bug The problem is the mismatched types between "ctx->total_len" which is an unsigned int, "rc" which is an int, and "ctx->rc" which is a ssize_t. The code does: ctx->rc = (rc == 0) ? ctx->total_len : rc; We want "ctx->rc" to store the negative "rc" error code. But what happens is that "rc" is type promoted to a high unsigned int and 'ctx->rc" will store the high positive value instead of a negative value. The fix is to change "rc" from an int to a ssize_t. Fixes: c610c4b619e5 ("CIFS: Add asynchronous write support through kernel AIO") Signed-off-by: Dan Carpenter Signed-off-by: Steve French commit 96c8395e2166efa86082f3b71567ffd84936439b Author: Mark Brown Date: Tue Sep 21 15:44:06 2021 +0100 spi: Revert modalias changes During the v5.13 cycle we updated the SPI subsystem to generate OF style modaliases for SPI devices, replacing the old Linux style modalises we used to generate based on spi_device_id which are the DT style name with the vendor removed. Unfortunately this means that we start only reporting OF style modalises and not the old ones and there is nothing that ensures that drivers list every possible OF compatible string in their OF ID table. The result is that there are systems which have been relying on loading modules based on the old style that are now broken, as found by Russell King with spi-nor on Macchiatobin. spi-nor is a particularly problematic case for this, it only lists a single generic DT compatible jedec,spi-nor in the driver but supports a huge raft of device specific compatibles, with a large set of part numbers many of which are offered by multiple vendors. Russell's searches of upstream device trees has turned up examples with vendor names written in non-standard ways too. To make matters worse up until 8ff16cf77ce3 ("Documentation: devicetree: m25p80: add "nor-jedec" binding") the generic compatible was not part of the binding so there are device trees out there written to that binding version which don't list it all. The sheer number of parts supported together with our previous approach of ignoring the vendor ID makes robustly fixing this by adding compatibles to the spi-nor driver seem problematic, the current DT binding document does not list all the parts supported by the driver at the minute (further patches will fix this). I've also investigated supporting both formats of modalias simultaneously but that doesn't seem possible, especially without breaking our userspace ABI which is obviously not viable. Instead revert the relevant changes for now: e09f2ab8eecc ("spi: update modalias_show after of_device_uevent_modalias support") 3ce6c9e2617e ("spi: add of_device_uevent_modalias support") This will unfortunately mean that any system which had started having modules autoload based on the OF compatibles for drivers that list things there but not in the spi_device_ids will now not have those modules load which is itself a regression. Since it affects a narrower time window and the particularly problematic spi-nor driver may be critical to system boot on smaller systems this seems the best of a series of bad options. I will start an audit of SPI drivers to identify and fix cases where things won't autoload using spi_device_id, this is not great but seems to be the best way forward that anyone has been able to identify. Thanks to Russell for both his report and the additional diagnostic and analysis work he has done here, the detailed research above was his work. Fixes: e09f2ab8eecc ("spi: update modalias_show after of_device_uevent_modalias support") Fixes: 3ce6c9e2617e ("spi: add of_device_uevent_modalias support") Reported-by: Russell King (Oracle) Suggested-by: Russell King (Oracle) Signed-off-by: Mark Brown Tested-by: Russell King (Oracle) Cc: Andreas Schwab Cc: Marco Felsch commit 9f6323311c7064414bfd1edb28e0837baf6b3c7f Author: Namjae Jeon Date: Sat Sep 18 21:02:39 2021 +0900 ksmbd: add default data stream name in FILE_STREAM_INFORMATION Windows client expect to get default stream name(::DATA) in FILE_STREAM_INFORMATION response even if there is no stream data in file. This patch fix update failure when writing ppt or doc files. Signed-off-by: Namjae Jeon Reviewed-By: Tom Talpey Signed-off-by: Steve French commit e44fd5081c50b0ffdb75ce6c83452e60173d791b Author: Steve French Date: Mon Sep 20 19:01:42 2021 -0500 ksmbd: log that server is experimental at module load While we are working through detailed security reviews of ksmbd server code we should remind users that it is an experimental module by adding a warning when the module loads. Currently the module shows as experimental in Kconfig and is disabled by default, but we don't want to confuse users. Although ksmbd passes a wide variety of the important functional tests (since initial focus had been largely on functional testing such as smbtorture, xfstests etc.), and ksmbd has added key security features (e.g. GCM256 encryption, Kerberos support), there are ongoing detailed reviews of the code base for path processing and network buffer decoding, and this patch reminds users that the module should be considered "experimental." Reviewed-by: Namjae Jeon Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 0e3dbf765fe22060acbcb8eb8c4d256e655a1247 Author: Cristian Marussi Date: Mon Sep 20 13:12:28 2021 +0100 kselftest/arm64: signal: Skip tests if required features are missing During initialization of a signal testcase, features declared as required are properly checked against the running system but no action is then taken to effectively skip such a testcase. Fix core signals test logic to abort initialization and report such a testcase as skipped to the KSelfTest framework. Fixes: f96bf4340316 ("kselftest: arm64: mangle_pstate_invalid_compat_toggle and common utils") Signed-off-by: Cristian Marussi Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20210920121228.35368-1-cristian.marussi@arm.com Signed-off-by: Catalin Marinas commit cb1bcf5ed536747013fe2b3f9bd56ce3242c295a Author: Takashi Sakamoto Date: Mon Sep 20 20:07:34 2021 +0900 ALSA: firewire-motu: fix truncated bytes in message tracepoints In MOTU protocol v2/v3, first two data chunks across 2nd and 3rd data channels includes message bytes from device. The total size of message is 48 bits per data block. The 'data_block_message' tracepoints event produced by ALSA firewire-motu driver exposes the sequence of messages to userspace in 64 bit storage, however lower 32 bits are actually available since current implementation truncates 16 bits in upper of the message as a result of bit shift operation within 32 bit storage. This commit fixes the bug by perform the bit shift in 64 bit storage. Fixes: c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol") Cc: Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210920110734.27161-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 77ff9e7be0d420bd0555ef51612e8ce241f3e78f Merge: 94d508fa3186d cfacfefd382af Author: Takashi Iwai Date: Tue Sep 21 18:42:14 2021 +0200 Merge tag 'asoc-fix-v5.15-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.15 A crop of mostly device specific fixes that have been applied since the merge window, nothing particularly standout here. commit 92477dd1faa650e50bd3bb35a6c0b8d09198cc35 Merge: d5f6545934c47 db7bee653859e Author: Linus Torvalds Date: Tue Sep 21 09:36:11 2021 -0700 Merge tag 's390-5.15-ebpf-jit-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 eBPF fixes from Vasily Gorbik: "Johan Almbladh has implemented a number of new testcases for eBPF [1], which uncovered three miscompilation issues in the s390 eBPF JIT" Link: https://lore.kernel.org/bpf/20210902185229.1840281-1-johan.almbladh@anyfinetworks.com/ [1] * tag 's390-5.15-ebpf-jit-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/bpf: Fix optimizing out zero-extensions s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant s390/bpf: Fix branch shortening during codegen pass commit 2de9d8e0d2fe3a1eb632def2245529067cb35db5 Author: Saravana Kannan Date: Wed Sep 15 10:09:37 2021 -0700 driver core: fw_devlink: Improve handling of cyclic dependencies When we have a dependency of the form: Device-A -> Device-C Device-B Device-C -> Device-B Where, * Indentation denotes "child of" parent in previous line. * X -> Y denotes X is consumer of Y based on firmware (Eg: DT). We have cyclic dependency: device-A -> device-C -> device-B -> device-A fw_devlink current treats device-C -> device-B dependency as an invalid dependency and doesn't enforce it but leaves the rest of the dependencies as is. While the current behavior is necessary, it is not sufficient if the false dependency in this example is actually device-A -> device-C. When this is the case, device-C will correctly probe defer waiting for device-B to be added, but device-A will be incorrectly probe deferred by fw_devlink waiting on device-C to probe successfully. Due to this, none of the devices in the cycle will end up probing. To fix this, we need to go relax all the dependencies in the cycle like we already do in the other instances where fw_devlink detects cycles. A real world example of this was reported[1] and analyzed[2]. [1] - https://lore.kernel.org/lkml/0a2c4106-7f48-2bb5-048e-8c001a7c3fda@samsung.com/ [2] - https://lore.kernel.org/lkml/CAGETcx8peaew90SWiux=TyvuGgvTQOmO4BFALz7aj0Za5QdNFQ@mail.gmail.com/ Fixes: f9aa460672c9 ("driver core: Refactor fw_devlink feature") Cc: stable Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915170940.617415-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit bb509a6ffed2c8b0950f637ab5779aa818ed1596 Author: Ian Abbott Date: Thu Sep 16 15:50:23 2021 +0100 comedi: Fix memory leak in compat_insnlist() `compat_insnlist()` handles the 32-bit version of the `COMEDI_INSNLIST` ioctl (whenwhen `CONFIG_COMPAT` is enabled). It allocates memory to temporarily hold an array of `struct comedi_insn` converted from the 32-bit version in user space. This memory is only being freed if there is a fault while filling the array, otherwise it is leaked. Add a call to `kfree()` to fix the leak. Fixes: b8d47d881305 ("comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSNLIST compat") Cc: Al Viro Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Cc: # 5.13+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210916145023.157479-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 708c87168b6121abc74b2a57d0c498baaf70cbea Author: Dan Carpenter Date: Mon Sep 6 12:43:01 2021 +0300 ceph: fix off by one bugs in unsafe_request_wait() The "> max" tests should be ">= max" to prevent an out of bounds access on the next lines. Fixes: e1a4541ec0b9 ("ceph: flush the mdlog before waiting on unsafe reqs") Signed-off-by: Dan Carpenter Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 7af526c740bdbd5b4dcebba04ace5b3b0c07801f Author: Geert Uytterhoeven Date: Tue Sep 14 11:29:49 2021 +0200 nvmem: NVMEM_NINTENDO_OTP should depend on WII The Nintendo Wii and Wii U OTP is only present on Nintendo Wii and Wii U consoles. Hence add a dependency on WII, to prevent asking the user about this driver when configuring a kernel without Nintendo Wii and Wii U console support. Fixes: 3683b761fe3a10ad ("nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP") Reviewed-by: Emmanuel Gil Peyrot Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/01318920709dddc4d85fe895e2083ca0eee234d8.1631611652.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 6354467245ff8dd04b54e39790f2ee4d21d5419e Author: Konstantin Komarov Date: Thu Sep 9 13:15:20 2021 +0300 fs/ntfs3: Add sync flag to ntfs_sb_write_run and al_update This allows to wait only when it's requested. It speeds up creation of hardlinks. Signed-off-by: Konstantin Komarov commit 56eaeb10e2619081cc383febf6740a4c3e806777 Author: Konstantin Komarov Date: Thu Sep 9 13:12:41 2021 +0300 fs/ntfs3: Change max hardlinks limit to 4000 xfstest generic/041 works with 3003 hardlinks. Because of this we raise hardlinks limit to 4000. There are no drawbacks or regressions. Theoretically we can raise all the way up to ffff, but there is no practical use for this. Signed-off-by: Konstantin Komarov commit d5f6545934c47e97c0b48a645418e877b452a992 Author: Linus Torvalds Date: Mon Sep 20 10:26:21 2021 -0700 qnx4: work around gcc false positive warning bug In commit b7213ffa0e58 ("qnx4: avoid stringop-overread errors") I tried to teach gcc about how the directory entry structure can be two different things depending on a status flag. It made the code clearer, and it seemed to make gcc happy. However, Arnd points to a gcc bug, where despite using two different members of a union, gcc then gets confused, and uses the size of one of the members to decide if a string overrun happens. And not necessarily the rigth one. End result: with some configurations, gcc-11 will still complain about the source buffer size being overread: fs/qnx4/dir.c: In function 'qnx4_readdir': fs/qnx4/dir.c:76:32: error: 'strnlen' specified bound [16, 48] exceeds source size 1 [-Werror=stringop-overread] 76 | size = strnlen(name, size); | ^~~~~~~~~~~~~~~~~~~ fs/qnx4/dir.c:26:22: note: source object declared here 26 | char de_name; | ^~~~~~~ because gcc will get confused about which union member entry is actually getting accessed, even when the source code is very clear about it. Gcc internally will have combined two "redundant" pointers (pointing to different union elements that are at the same offset), and takes the size checking from one or the other - not necessarily the right one. This is clearly a gcc bug, but we can work around it fairly easily. The biggest thing here is the big honking comment about why we do what we do. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c6 Reported-and-tested-by: Arnd Bergmann Signed-off-by: Linus Torvalds commit ee9d4810aab95208541d2807f9d114f1d5edcee0 Author: Konstantin Komarov Date: Wed Sep 8 18:39:53 2021 +0300 fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Do not try to insert attribute if there is no room in record. Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit c86a2d9058c5a4a05d20ef89e699b7a6b2c89da6 Author: Tobias Klauser Date: Fri Sep 17 00:27:05 2021 +0200 cpumask: Omit terminating null byte in cpumap_print_{list,bitmask}_to_buf The changes in the patch series [1] introduced a terminating null byte when reading from cpulist or cpumap sysfs files, for example: $ xxd /sys/devices/system/node/node0/cpulist 00000000: 302d 310a 00 0-1.. Before this change, the output looked as follows: $ xxd /sys/devices/system/node/node0/cpulist 00000000: 302d 310a 0-1. Fix this regression by excluding the terminating null byte from the returned length in cpumap_print_list_to_buf and cpumap_print_bitmask_to_buf. [1] https://lore.kernel.org/all/20210806110251.560-1-song.bao.hua@hisilicon.com/ Fixes: 1fae562983ca ("cpumask: introduce cpumap_print_list/bitmask_to_buf to support large bitmask and list") Acked-by: Barry Song Acked-by: Yury Norov Signed-off-by: Tobias Klauser Link: https://lore.kernel.org/r/20210916222705.13554-1-tklauser@distanz.ch Signed-off-by: Greg Kroah-Hartman commit 517c7bf99bad3d6b9360558414aae634b7472d80 Author: Dan Carpenter Date: Thu Sep 16 16:57:37 2021 +0300 usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() This is writing to the first 1 - 3 bytes of "val" and then writing all four bytes to musb_writel(). The last byte is always going to be garbage. Zero out the last bytes instead. Fixes: 550a7375fe72 ("USB: Add MUSB and TUSB support") Signed-off-by: Dan Carpenter Cc: stable Link: https://lore.kernel.org/r/20210916135737.GI25094@kili Signed-off-by: Greg Kroah-Hartman commit b55d37ef6b7db3eda9b4495a8d9b0a944ee8c67d Author: Ondrej Zary Date: Mon Sep 13 23:01:06 2021 +0200 usb-storage: Add quirk for ScanLogic SL11R-IDE older than 2.6c ScanLogic SL11R-IDE with firmware older than 2.6c (the latest one) has broken tag handling, preventing the device from working at all: usb 1-1: new full-speed USB device number 2 using uhci_hcd usb 1-1: New USB device found, idVendor=04ce, idProduct=0002, bcdDevice= 2.60 usb 1-1: New USB device strings: Mfr=1, Product=1, SerialNumber=0 usb 1-1: Product: USB Device usb 1-1: Manufacturer: USB Device usb-storage 1-1:1.0: USB Mass Storage device detected scsi host2: usb-storage 1-1:1.0 usbcore: registered new interface driver usb-storage usb 1-1: reset full-speed USB device number 2 using uhci_hcd usb 1-1: reset full-speed USB device number 2 using uhci_hcd usb 1-1: reset full-speed USB device number 2 using uhci_hcd usb 1-1: reset full-speed USB device number 2 using uhci_hcd Add US_FL_BULK_IGNORE_TAG to fix it. Also update my e-mail address. 2.6c is the only firmware that claims Linux compatibility. The firmware can be upgraded using ezotgdbg utility: https://github.com/asciilifeform/ezotgdbg Acked-by: Alan Stern Signed-off-by: Ondrej Zary Cc: stable Link: https://lore.kernel.org/r/20210913210106.12717-1-linux@zary.sk Signed-off-by: Greg Kroah-Hartman commit ce1c42b4dacfe7d71c852d8bf3371067ccba865c Author: Julian Sikorski Date: Mon Sep 13 20:14:55 2021 +0200 Re-enable UAS for LaCie Rugged USB3-FW with fk quirk Further testing has revealed that LaCie Rugged USB3-FW does work with uas as long as US_FL_NO_REPORT_OPCODES and US_FL_NO_SAME are enabled. Link: https://lore.kernel.org/linux-usb/2167ea48-e273-a336-a4e0-10a4e883e75e@redhat.com/ Cc: stable Suggested-by: Hans de Goede Reviewed-by: Hans de Goede Acked-by: Oliver Neukum Signed-off-by: Julian Sikorski Link: https://lore.kernel.org/r/20210913181454.7365-1-belegdol+github@gmail.com Signed-off-by: Greg Kroah-Hartman commit d7a48e27b38a94bf73c973c236461234610256d5 Author: Apurva Nandan Date: Mon Sep 20 19:57:13 2021 +0530 spi: Use 'flash' node name instead of 'spi-flash' in example Change the nodename in the example with spi-nand from 'spi-flash@1' to 'flash@1' to make the schema uniform with both spi-nand and spi-nor flashes. jedec,spi-nor.yaml uses 'flash@' nodename for spi-nor flashes, so make the spi-nand examples in dt-bindings use it too for uniformity. Signed-off-by: Apurva Nandan Reviewed-by: Serge Semin Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210920142713.129295-3-a-nandan@ti.com Signed-off-by: Mark Brown commit ffb1e76f4f32d2b8ea4189df0484980370476395 Merge: 2bab94090b01b e4e737bb5c170 Author: Mark Brown Date: Mon Sep 20 15:56:58 2021 +0100 Merge tag 'v5.15-rc2' into spi-5.15 Linux 5.15-rc2 commit d9d1232b48344c6c72dbdf89fae1e7638e5df757 Author: Johan Hovold Date: Fri Sep 17 13:57:36 2021 +0200 misc: bcm-vk: fix tty registration race Make sure to set the tty class-device driver data before registering the tty to avoid having a racing open() dereference a NULL pointer. Fixes: 91ca10d6fa07 ("misc: bcm-vk: add ttyVK support") Cc: stable@vger.kernel.org # 5.12 Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210917115736.5816-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 59a68d4138086c015ab8241c3267eec5550fbd44 Author: Robin Murphy Date: Fri Sep 17 15:59:30 2021 +0100 arm64: Mitigate MTE issues with str{n}cmp() As with strlen(), the patches importing the updated str{n}cmp() implementations were originally developed and tested before the advent of CONFIG_KASAN_HW_TAGS, and have subsequently revealed not to be MTE-safe. Since in-kernel MTE is still a rather niche case, let it temporarily fall back to the generic C versions for correctness until we can figure out the best fix. Fixes: 758602c04409 ("arm64: Import latest version of Cortex Strings' strcmp") Fixes: 020b199bc70d ("arm64: Import latest version of Cortex Strings' strncmp") Cc: # 5.14.x Reported-by: Branislav Rankov Signed-off-by: Robin Murphy Acked-by: Mark Rutland Link: https://lore.kernel.org/r/34dc4d12eec0adae49b0ac927df642ed10089d40.1631890770.git.robin.murphy@arm.com Signed-off-by: Catalin Marinas commit 6f6aab1caf6c7fef46852aaab03f4e8250779e52 Author: Tobias Jakobi Date: Tue Sep 21 12:07:02 2021 +0200 platform/x86: gigabyte-wmi: add support for B550I Aorus Pro AX Tested with a AMD Ryzen 7 5800X. Signed-off-by: Tobias Jakobi Acked-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20210921100702.3838-1-tjakobi@math.uni-bielefeld.de Signed-off-by: Hans de Goede commit b201cb0ebe87b209e252d85668e517ac1929e250 Author: José Expósito Date: Mon Sep 20 18:03:12 2021 +0200 platform/x86/intel: hid: Add DMI switches allow list Some devices, even non convertible ones, can send incorrect SW_TABLET_MODE reports. Add an allow list and accept such reports only from devices in it. Bug reported for Dell XPS 17 9710 on: https://gitlab.freedesktop.org/libinput/libinput/-/issues/662 Reported-by: Tobias Gurtzick Suggested-by: Hans de Goede Tested-by: Tobias Gurtzick Signed-off-by: José Expósito Link: https://lore.kernel.org/r/20210920160312.9787-1-jose.exposito89@gmail.com [hdegoede@redhat.com: Check dmi_switches_auto_add_allow_list only once] Signed-off-by: Hans de Goede commit 5b72dafaca73b33416c82457ae615e6f2022e901 Author: Randy Dunlap Date: Fri Sep 17 21:48:29 2021 -0700 platform/x86: dell: fix DELL_WMI_PRIVACY dependencies & build error When DELL_WMI=y, DELL_WMI_PRIVACY=y, and LEDS_TRIGGER_AUDIO=m, there is a linker error since the LEDS trigger code is built as a loadable module. This happens because DELL_WMI_PRIVACY is a bool that depends on a tristate (LEDS_TRIGGER_AUDIO=m), which can be dangerous. ld: drivers/platform/x86/dell/dell-wmi-privacy.o: in function `dell_privacy_wmi_probe': dell-wmi-privacy.c:(.text+0x3df): undefined reference to `ledtrig_audio_get' Fixes: 8af9fa37b8a3 ("platform/x86: dell-privacy: Add support for Dell hardware privacy") Signed-off-by: Randy Dunlap Cc: Perry Yuan Cc: Dell.Client.Kernel@dell.com Cc: platform-driver-x86@vger.kernel.org Cc: Hans de Goede Cc: Mark Gross Link: https://lore.kernel.org/r/20210918044829.19222-1-rdunlap@infradead.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit cf96921876dcee4d6ac07b9de470368a075ba9ad Author: Ansuel Smith Date: Tue Sep 7 23:25:42 2021 +0200 thermal/drivers/tsens: Fix wrong check for tzd in irq handlers Some devices can have some thermal sensors disabled from the factory. The current two irq handler functions check all the sensor by default and the check if the sensor was actually registered is wrong. The tzd is actually never set if the registration fails hence the IS_ERR check is wrong. Signed-off-by: Ansuel Smith Reviewed-by: Matthias Kaehlcke Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210907212543.20220-1-ansuelsmth@gmail.com commit 1bb30b20b49773369c299d4d6c65227201328663 Author: Dan Carpenter Date: Thu Sep 16 16:13:42 2021 +0300 thermal/core: Potential buffer overflow in thermal_build_list_of_policies() After printing the list of thermal governors, then this function prints a newline character. The problem is that "size" has not been updated after printing the last governor. This means that it can write one character (the NUL terminator) beyond the end of the buffer. Get rid of the "size" variable and just use "PAGE_SIZE - count" directly. Fixes: 1b4f48494eb2 ("thermal: core: group functions related to governor handling") Signed-off-by: Dan Carpenter Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210916131342.GB25094@kili commit b3f98404bd629a243c0a15a3ade32b1cf9fbe0da Merge: 3e95cfa24e24f 74b6d7d13307b Author: David S. Miller Date: Tue Sep 21 13:52:16 2021 +0100 Merge branch 'dsa-devres' Vladimir Oltean says: ==================== Fix mdiobus users with devres Commit ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") by Bartosz Golaszewski has introduced two classes of potential bugs by making the devres callback of devm_mdiobus_alloc stop calling mdiobus_unregister. The exact buggy circumstances are presented in the individual commit messages. I have searched the tree for other occurrences, but at the moment: - for issue (a) I have no concrete proof that other buses except SPI and I2C suffer from it, and the only SPI or I2C device drivers that call of_mdiobus_alloc are the DSA drivers that leave a NULL ds->slave_mii_bus and a non-NULL ds->ops->phy_read, aka ksz9477, ksz8795, lan9303_i2c, vsc73xx-spi. - for issue (b), all drivers which call of_mdiobus_alloc either use of_mdiobus_register too, or call mdiobus_unregister sometime within the ->remove path. Although at this point I've seen enough strangeness caused by this "device_del during ->shutdown" that I'm just going to copy the SPI and I2C subsystem maintainers to this patch series, to get their feedback whether they've had reports about things like this before. I don't think other buses behave in this way, it forces SPI and I2C devices to have to protect themselves from a really strange set of issues. ==================== Signed-off-by: David S. Miller commit 74b6d7d13307b016f4b5bba8198297824c0ee6df Author: Vladimir Oltean Date: Tue Sep 21 00:42:09 2021 +0300 net: dsa: realtek: register the MDIO bus under devres The Linux device model permits both the ->shutdown and ->remove driver methods to get called during a shutdown procedure. Example: a DSA switch which sits on an SPI bus, and the SPI bus driver calls this on its ->shutdown method: spi_unregister_controller -> device_for_each_child(&ctlr->dev, NULL, __unregister); -> spi_unregister_device(to_spi_device(dev)); -> device_del(&spi->dev); So this is a simple pattern which can theoretically appear on any bus, although the only other buses on which I've been able to find it are I2C: i2c_del_adapter -> device_for_each_child(&adap->dev, NULL, __unregister_client); -> i2c_unregister_device(client); -> device_unregister(&client->dev); The implication of this pattern is that devices on these buses can be unregistered after having been shut down. The drivers for these devices might choose to return early either from ->remove or ->shutdown if the other callback has already run once, and they might choose that the ->shutdown method should only perform a subset of the teardown done by ->remove (to avoid unnecessary delays when rebooting). So in other words, the device driver may choose on ->remove to not do anything (therefore to not unregister an MDIO bus it has registered on ->probe), because this ->remove is actually triggered by the device_shutdown path, and its ->shutdown method has already run and done the minimally required cleanup. This used to be fine until the blamed commit, but now, the following BUG_ON triggers: void mdiobus_free(struct mii_bus *bus) { /* For compatibility with error handling in drivers. */ if (bus->state == MDIOBUS_ALLOCATED) { kfree(bus); return; } BUG_ON(bus->state != MDIOBUS_UNREGISTERED); bus->state = MDIOBUS_RELEASED; put_device(&bus->dev); } In other words, there is an attempt to free an MDIO bus which was not unregistered. The attempt to free it comes from the devres release callbacks of the SPI device, which are executed after the device is unregistered. I'm not saying that the fact that MDIO buses allocated using devres would automatically get unregistered wasn't strange. I'm just saying that the commit didn't care about auditing existing call paths in the kernel, and now, the following code sequences are potentially buggy: (a) devm_mdiobus_alloc followed by plain mdiobus_register, for a device located on a bus that unregisters its children on shutdown. After the blamed patch, either both the alloc and the register should use devres, or none should. (b) devm_mdiobus_alloc followed by plain mdiobus_register, and then no mdiobus_unregister at all in the remove path. After the blamed patch, nobody unregisters the MDIO bus anymore, so this is even more buggy than the previous case which needs a specific bus configuration to be seen, this one is an unconditional bug. In this case, the Realtek drivers fall under category (b). To solve it, we can register the MDIO bus under devres too, which restores the previous behavior. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Reported-by: Lino Sanfilippo Reported-by: Alvin Šipraga Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5135e96a3dd2f4555ae6981c3155a62bcf3227f6 Author: Vladimir Oltean Date: Tue Sep 21 00:42:08 2021 +0300 net: dsa: don't allocate the slave_mii_bus using devres The Linux device model permits both the ->shutdown and ->remove driver methods to get called during a shutdown procedure. Example: a DSA switch which sits on an SPI bus, and the SPI bus driver calls this on its ->shutdown method: spi_unregister_controller -> device_for_each_child(&ctlr->dev, NULL, __unregister); -> spi_unregister_device(to_spi_device(dev)); -> device_del(&spi->dev); So this is a simple pattern which can theoretically appear on any bus, although the only other buses on which I've been able to find it are I2C: i2c_del_adapter -> device_for_each_child(&adap->dev, NULL, __unregister_client); -> i2c_unregister_device(client); -> device_unregister(&client->dev); The implication of this pattern is that devices on these buses can be unregistered after having been shut down. The drivers for these devices might choose to return early either from ->remove or ->shutdown if the other callback has already run once, and they might choose that the ->shutdown method should only perform a subset of the teardown done by ->remove (to avoid unnecessary delays when rebooting). So in other words, the device driver may choose on ->remove to not do anything (therefore to not unregister an MDIO bus it has registered on ->probe), because this ->remove is actually triggered by the device_shutdown path, and its ->shutdown method has already run and done the minimally required cleanup. This used to be fine until the blamed commit, but now, the following BUG_ON triggers: void mdiobus_free(struct mii_bus *bus) { /* For compatibility with error handling in drivers. */ if (bus->state == MDIOBUS_ALLOCATED) { kfree(bus); return; } BUG_ON(bus->state != MDIOBUS_UNREGISTERED); bus->state = MDIOBUS_RELEASED; put_device(&bus->dev); } In other words, there is an attempt to free an MDIO bus which was not unregistered. The attempt to free it comes from the devres release callbacks of the SPI device, which are executed after the device is unregistered. I'm not saying that the fact that MDIO buses allocated using devres would automatically get unregistered wasn't strange. I'm just saying that the commit didn't care about auditing existing call paths in the kernel, and now, the following code sequences are potentially buggy: (a) devm_mdiobus_alloc followed by plain mdiobus_register, for a device located on a bus that unregisters its children on shutdown. After the blamed patch, either both the alloc and the register should use devres, or none should. (b) devm_mdiobus_alloc followed by plain mdiobus_register, and then no mdiobus_unregister at all in the remove path. After the blamed patch, nobody unregisters the MDIO bus anymore, so this is even more buggy than the previous case which needs a specific bus configuration to be seen, this one is an unconditional bug. In this case, DSA falls into category (a), it tries to be helpful and registers an MDIO bus on behalf of the switch, which might be on such a bus. I've no idea why it does it under devres. It does this on probe: if (!ds->slave_mii_bus && ds->ops->phy_read) alloc and register mdio bus and this on remove: if (ds->slave_mii_bus && ds->ops->phy_read) unregister mdio bus I _could_ imagine using devres because the condition used on remove is different than the condition used on probe. So strictly speaking, DSA cannot determine whether the ds->slave_mii_bus it sees on remove is the ds->slave_mii_bus that _it_ has allocated on probe. Using devres would have solved that problem. But nonetheless, the existing code already proceeds to unregister the MDIO bus, even though it might be unregistering an MDIO bus it has never registered. So I can only guess that no driver that implements ds->ops->phy_read also allocates and registers ds->slave_mii_bus itself. So in that case, if unregistering is fine, freeing must be fine too. Stop using devres and free the MDIO bus manually. This will make devres stop attempting to free a still registered MDIO bus on ->shutdown. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Reported-by: Lino Sanfilippo Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Lino Sanfilippo Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 74b7ee0e7b61838a0a161a84d105aeff0d042646 Author: Shengjiu Wang Date: Fri Sep 10 17:18:30 2021 +0800 ASoC: fsl_xcvr: Fix channel swap issue with ARC With pause and resume test for ARC, there is occasionally channel swap issue. The reason is that currently driver set the DPATH out of reset first, then start the DMA, the first data got from FIFO may not be the Left channel. Moving DPATH out of reset operation after the dma enablement to fix this issue. Fixes: 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1631265510-27384-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 3f4b57ad07d9237acf1b8cff3f8bf530cacef87a Author: Peter Rosin Date: Mon Sep 20 16:49:39 2021 +0200 ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers Commit 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats") breaks the TSE-850 device, which is using a pcm5142 in I2S and CBM_CFS mode (maybe not relevant). Without this fix, the result is: pcm512x 0-004c: Failed to set data format: -16 And after that, no sound. This fix is not 100% correct. The datasheet of at least the pcm5142 states that four bits (0xcc) in the I2S_1 register are "RSV" ("Reserved. Do not access.") and no hint is given as to what the initial values are supposed to be. So, specifying defaults for these bits is wrong. But perhaps better than a broken driver? Fixes: 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats") Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Kirill Marinushkin Cc: Peter Ujfalusi Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Rosin Signed-off-by: Peter Ujfalusi Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/2d221984-7a2e-7006-0f8a-ffb5f64ee885@axentia.se Signed-off-by: Mark Brown commit 8c8a3b5bd960cd88f7655b5251dc28741e11f139 Author: Peter Collingbourne Date: Wed Sep 15 12:03:35 2021 -0700 arm64: add MTE supported check to thread switching and syscall entry/exit This lets us avoid doing unnecessary work on hardware that does not support MTE, and will allow us to freely use MTE instructions in the code called by mte_thread_switch(). Since this would mean that we do a redundant check in mte_check_tfsr_el1(), remove it and add two checks now required in its callers. This also avoids an unnecessary DSB+ISB sequence on the syscall exit path for hardware not supporting MTE. Fixes: 65812c6921cc ("arm64: mte: Enable async tag check fault") Cc: # 5.13.x Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/I02fd000d1ef2c86c7d2952a7f099b254ec227a5d Link: https://lore.kernel.org/r/20210915190336.398390-1-pcc@google.com [catalin.marinas@arm.com: adjust the commit log slightly] Signed-off-by: Catalin Marinas commit b875fb313a10bf816b5d49d8d7642d1cc9905f2f Author: Chris Wilson Date: Mon Aug 9 12:48:05 2021 -0700 drm/i915: Free all DMC payloads Free all the DMC payloads, not just DMC_MAIN. unreferenced object 0xffff88ff32d4d800 (size 1024): comm "kworker/1:5", pid 701, jiffies 4294904239 (age 109.736s) hex dump (first 32 bytes): 40 40 00 0c 03 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: [<00000000ba9d0d95>] dmc_load_work_fn+0x34d/0x510 [i915] [<000000001049fcab>] process_one_work+0x261/0x550 [<00000000eeb995ac>] worker_thread+0x49/0x3c0 [<0000000021031dc3>] kthread+0x10b/0x140 [<000000004a0f69ee>] ret_from_fork+0x1f/0x30 unreferenced object 0xffff88ff0bde4000 (size 1024): comm "kworker/0:3", pid 708, jiffies 4294904469 (age 108.816s) hex dump (first 32 bytes): 40 40 00 0c 01 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: [<00000000ba9d0d95>] dmc_load_work_fn+0x34d/0x510 [i915] [<000000001049fcab>] process_one_work+0x261/0x550 [<00000000eeb995ac>] worker_thread+0x49/0x3c0 [<0000000021031dc3>] kthread+0x10b/0x140 [<000000004a0f69ee>] ret_from_fork+0x1f/0x30 Fixes: 3d5928a168a9 ("drm/i915/xelpd: Pipe A DMC plugging") Cc: Anusha Srivatsa Cc: José Roberto de Souza Signed-off-by: Chris Wilson Signed-off-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210809194805.3793060-1-lucas.demarchi@intel.com (cherry picked from commit 064b877dff4252ced91a1c8b1f129073f2991f6e) Signed-off-by: Jani Nikula commit f9b23c157a78c77545099312394d484ce4f35b8b Author: Maarten Lankhorst Date: Mon Aug 30 14:09:48 2021 +0200 drm/i915: Move __i915_gem_free_object to ttm_bo_destroy When we implement delayed destroy, we may have a second call to the delete_mem_notify() handler, while free_object() only should be called once. Move it to bo->destroy(), to ensure it's only called once. This fixes some weird memory corruption issues with delayed destroy when async eviction is used. Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210830121006.2978297-2-maarten.lankhorst@linux.intel.com Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Cc: Thomas Hellström Reviewed-by: Thomas Hellström (cherry picked from commit 48b0961269546716c3232748bf37e64e49fb866c) Signed-off-by: Jani Nikula commit 2566fffd6011df17dfba0b216fe9a154d3eb3f75 Author: Radhakrishna Sripada Date: Tue Sep 14 15:07:44 2021 -0700 drm/i915: Update memory bandwidth parameters Earlier while calculating derated bw we would use 90% of the calculated bw. Starting ADL-P we use a non standard derating. Updating the formulae to reflect the same. Bspec: 64631 v2: Use the new derating value only for ADL-P(MattR) Fixes: 4d32fe2f14a7 ("drm/i915/adl_p: Update memory bandwidth parameters") Cc: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210914220744.16042-1-radhakrishna.sripada@intel.com (cherry picked from commit f6d66fc8cf5f673ea76407be84dc17dbb3eda108) Signed-off-by: Jani Nikula commit 3e95cfa24e24fbd7fb7675ab972a5aa507c7a89c Author: Masanari Iida Date: Tue Sep 21 15:41:23 2021 +0900 Doc: networking: Fox a typo in ice.rst This patch fixes a spelling typo in ice.rst Signed-off-by: Masanari Iida Signed-off-by: David S. Miller commit e5845aa0eadda3d8a950eb8845c1396827131f30 Author: Vladimir Oltean Date: Tue Sep 21 01:49:18 2021 +0300 net: dsa: fix dsa_tree_setup error path Since the blamed commit, dsa_tree_teardown_switches() was split into two smaller functions, dsa_tree_teardown_switches and dsa_tree_teardown_ports. However, the error path of dsa_tree_setup stopped calling dsa_tree_teardown_ports. Fixes: a57d8c217aad ("net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 431db53c73c901aaf6239378c24e4823443b214c Merge: 36747c96ed496 a18cee4791b11 Author: David S. Miller Date: Tue Sep 21 10:54:17 2021 +0100 Merge branch 'smc-fixes' Karsten Graul says: ==================== net/smc: fixes 2021-09-20 Please apply the following patches for smc to netdev's net tree. The first patch adds a missing error check, and the second patch fixes a possible leak of a lock in a worker. ==================== Signed-off-by: David S. Miller commit a18cee4791b1123d0a6579a7c89f4b87e48abe03 Author: Karsten Graul Date: Mon Sep 20 21:18:15 2021 +0200 net/smc: fix 'workqueue leaked lock' in smc_conn_abort_work The abort_work is scheduled when a connection was detected to be out-of-sync after a link failure. The work calls smc_conn_kill(), which calls smc_close_active_abort() and that might end up calling smc_close_cancel_work(). smc_close_cancel_work() cancels any pending close_work and tx_work but needs to release the sock_lock before and acquires the sock_lock again afterwards. So when the sock_lock was NOT acquired before then it may be held after the abort_work completes. Thats why the sock_lock is acquired before the call to smc_conn_kill() in __smc_lgr_terminate(), but this is missing in smc_conn_abort_work(). Fix that by acquiring the sock_lock first and release it after the call to smc_conn_kill(). Fixes: b286a0651e44 ("net/smc: handle incoming CDC validation message") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 6c90731980655280ea07ce4b21eb97457bf86286 Author: Karsten Graul Date: Mon Sep 20 21:18:14 2021 +0200 net/smc: add missing error check in smc_clc_prfx_set() Coverity stumbled over a missing error check in smc_clc_prfx_set(): *** CID 1475954: Error handling issues (CHECKED_RETURN) /net/smc/smc_clc.c: 233 in smc_clc_prfx_set() >>> CID 1475954: Error handling issues (CHECKED_RETURN) >>> Calling "kernel_getsockname" without checking return value (as is done elsewhere 8 out of 10 times). 233 kernel_getsockname(clcsock, (struct sockaddr *)&addrs); Add the return code check in smc_clc_prfx_set(). Fixes: c246d942eabc ("net/smc: restructure netinfo for CLC proposal msgs") Reported-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 8aa83e6395ce047a506f0b16edca45f36c1ae7f8 Author: Juergen Gross Date: Mon Sep 20 14:04:21 2021 +0200 x86/setup: Call early_reserve_memory() earlier Commit in Fixes introduced early_reserve_memory() to do all needed initial memblock_reserve() calls in one function. Unfortunately, the call of early_reserve_memory() is done too late for Xen dom0, as in some cases a Xen hook called by e820__memory_setup() will need those memory reservations to have happened already. Move the call of early_reserve_memory() before the call of e820__memory_setup() in order to avoid such problems. Fixes: a799c2bd29d1 ("x86/setup: Consolidate early memory reservations") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Tested-by: Marek Marczykowski-Górecki Tested-by: Nathan Chancellor Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20210920120421.29276-1-jgross@suse.com commit 0594c58161b6e0f3da8efa9c6e3d4ba52b652717 Author: Jan Beulich Date: Mon Sep 20 18:15:11 2021 +0200 xen/x86: fix PV trap handling on secondary processors The initial observation was that in PV mode under Xen 32-bit user space didn't work anymore. Attempts of system calls ended in #GP(0x402). All of the sudden the vector 0x80 handler was not in place anymore. As it turns out up to 5.13 redundant initialization did occur: Once from cpu_initialize_context() (through its VCPUOP_initialise hypercall) and a 2nd time while each CPU was brought fully up. This 2nd initialization is now gone, uncovering that the 1st one was flawed: Unlike for the set_trap_table hypercall, a full virtual IDT needs to be specified here; the "vector" fields of the individual entries are of no interest. With many (kernel) IDT entries still(?) (i.e. at that point at least) empty, the syscall vector 0x80 ended up in slot 0x20 of the virtual IDT, thus becoming the domain's handler for vector 0x20. Make xen_convert_trap_info() fit for either purpose, leveraging the fact that on the xen_copy_trap_info() path the table starts out zero-filled. This includes moving out the writing of the sentinel, which would also have lead to a buffer overrun in the xen_copy_trap_info() case if all (kernel) IDT entries were populated. Convert the writing of the sentinel to clearing of the entire table entry rather than just the address field. (I didn't bother trying to identify the commit which uncovered the issue in 5.14; the commit named below is the one which actually introduced the bad code.) Fixes: f87e4cac4f4e ("xen: SMP guest support") Cc: stable@vger.kernel.org Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/7a266932-092e-b68f-f2bb-1473b61adc6e@suse.com Signed-off-by: Juergen Gross commit 96f5bd03e1be606987644b71899ea56a8d05f825 Author: Juergen Gross Date: Mon Sep 20 12:03:45 2021 +0200 xen/balloon: fix balloon kthread freezing Commit 8480ed9c2bbd56 ("xen/balloon: use a kernel thread instead a workqueue") switched the Xen balloon driver to use a kernel thread. Unfortunately the patch omitted to call try_to_freeze() or to use wait_event_freezable_timeout(), causing a system suspend to fail. Fixes: 8480ed9c2bbd56 ("xen/balloon: use a kernel thread instead a workqueue") Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210920100345.21939-1-jgross@suse.com Signed-off-by: Juergen Gross commit 298ba0e3d4af539cc37f982d4c011a0f07fca48c Author: Christoph Hellwig Date: Tue Sep 14 08:38:20 2021 +0200 nvme: keep ctrl->namespaces ordered Various places in the nvme code that rely on ctrl->namespace to be ordered. Ensure that the namespae is inserted into the list at the right position from the start instead of sorting it after the fact. Fixes: 540c801c65eb ("NVMe: Implement namespace list scanning") Reported-by: Anton Eidelman Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal commit e371af033c560b9dd1e861f8f0b503142bf0a06c Author: Sagi Grimberg Date: Tue Sep 14 18:38:55 2021 +0300 nvme-tcp: fix incorrect h2cdata pdu offset accounting When the controller sends us multiple r2t PDUs in a single request we need to account for it correctly as our send/recv context run concurrently (i.e. we get a new r2t with r2t_offset before we updated our iterator and req->data_sent marker). This can cause wrong offsets to be sent to the controller. To fix that, we will first know that this may happen only in the send sequence of the last page, hence we will take the r2t_offset to the h2c PDU data_offset, and in nvme_tcp_try_send_data loop, we make sure to increment the request markers also when we completed a PDU but we are expecting more r2t PDUs as we still did not send the entire data of the request. Fixes: 825619b09ad3 ("nvme-tcp: fix possible use-after-completion") Reported-by: Nowak, Lukasz Tested-by: Nowak, Lukasz Signed-off-by: Sagi Grimberg Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit bdaa1365667103e7a754e87c08b846a979ce322b Author: James Smart Date: Tue Sep 14 11:20:08 2021 +0200 nvme-fc: remove freeze/unfreeze around update_nr_hw_queues Remove the freeze/unfreeze around changes to the number of hardware queues. Study and retest has indicated there are no ios that can be active at this point so there is nothing to freeze. nvme-fc is draining the queues in the shutdown and error recovery path in __nvme_fc_abort_outstanding_ios. This patch primarily reverts 88e837ed0f1f "nvme-fc: wait for queues to freeze before calling update_hr_hw_queues". It's not an exact revert as it leaves the adjusting of hw queues only if the count changes. Signed-off-by: James Smart [dwagner: added explanation why no IO is pending] Signed-off-by: Daniel Wagner Reviewed-by: Ming Lei Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit e5445dae29d25d7b03e0a10d3d4277a1d0c8119b Author: James Smart Date: Tue Sep 14 11:20:07 2021 +0200 nvme-fc: avoid race between time out and tear down To avoid race between time out and tear down, in tear down process, first we quiesce the queue, and then delete the timer and cancel the time out work for the queue. This patch merges the admin and io sync ops into the queue teardown logic as shown in the RDMA patch 3017013dcc "nvme-rdma: avoid race between time out and tear down". There is no teardown_lock in nvme-fc. Signed-off-by: James Smart Tested-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 555f66d0f8a38537456acc77043d0e4469fcbe8e Author: Daniel Wagner Date: Tue Sep 14 11:20:06 2021 +0200 nvme-fc: update hardware queues before using them In case the number of hardware queues changes, we need to update the tagset and the mapping of ctx to hctx first. If we try to create and connect the I/O queues first, this operation will fail (target will reject the connect call due to the wrong number of queues) and hence we bail out of the recreate function. Then we will to try the very same operation again, thus we don't make any progress. Signed-off-by: Daniel Wagner Reviewed-by: Ming Lei Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit af505cad9567f7a500d34bf183696d570d7f6810 Author: Nirmoy Das Date: Thu Sep 2 12:29:17 2021 +0200 debugfs: debugfs_create_file_size(): use IS_ERR to check for error debugfs_create_file() returns encoded error so use IS_ERR for checking return value. Reviewed-by: Christian König Signed-off-by: Nirmoy Das Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") Cc: stable References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Link: https://lore.kernel.org/r/20210902102917.2233-1-nirmoy.das@amd.com Signed-off-by: Greg Kroah-Hartman commit 91dab18f0df171984688d0da258c4c9d95836416 Author: Krzysztof Kozlowski Date: Fri Sep 17 12:28:34 2021 +0200 MAINTAINERS: Move Daniel Drake to credits Daniel Drake's @gentoo.org email bounces (is listed as retired Gentoo developer) and there was no activity from him regarding zd1211rw driver. Also his second address @laptop.org bounces. Cc: Daniel Drake Signed-off-by: Krzysztof Kozlowski Acked-by: Greg Kroah-Hartman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210917102834.25649-1-krzysztof.kozlowski@canonical.com commit e9edc188fc76499b0b9bd60364084037f6d03773 Author: Eric Dumazet Date: Fri Sep 17 15:15:56 2021 -0700 netfilter: conntrack: serialize hash resizes and cleanups Syzbot was able to trigger the following warning [1] No repro found by syzbot yet but I was able to trigger similar issue by having 2 scripts running in parallel, changing conntrack hash sizes, and: for j in `seq 1 1000` ; do unshare -n /bin/true >/dev/null ; done It would take more than 5 minutes for net_namespace structures to be cleaned up. This is because nf_ct_iterate_cleanup() has to restart everytime a resize happened. By adding a mutex, we can serialize hash resizes and cleanups and also make get_next_corpse() faster by skipping over empty buckets. Even without resizes in the picture, this patch considerably speeds up network namespace dismantles. [1] INFO: task syz-executor.0:8312 can't die for more than 144 seconds. task:syz-executor.0 state:R running task stack:25672 pid: 8312 ppid: 6573 flags:0x00004006 Call Trace: context_switch kernel/sched/core.c:4955 [inline] __schedule+0x940/0x26f0 kernel/sched/core.c:6236 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6408 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:35 __local_bh_enable_ip+0x109/0x120 kernel/softirq.c:390 local_bh_enable include/linux/bottom_half.h:32 [inline] get_next_corpse net/netfilter/nf_conntrack_core.c:2252 [inline] nf_ct_iterate_cleanup+0x15a/0x450 net/netfilter/nf_conntrack_core.c:2275 nf_conntrack_cleanup_net_list+0x14c/0x4f0 net/netfilter/nf_conntrack_core.c:2469 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 setup_net+0x639/0xa30 net/core/net_namespace.c:349 copy_net_ns+0x319/0x760 net/core/net_namespace.c:470 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3128 __do_sys_unshare kernel/fork.c:3202 [inline] __se_sys_unshare kernel/fork.c:3200 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3200 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:0x7f63da68e739 RSP: 002b:00007f63d7c05188 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007f63da792f80 RCX: 00007f63da68e739 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 00007f63da6e8cc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f63da792f80 R13: 00007fff50b75d3f R14: 00007f63d7c05300 R15: 0000000000022000 Showing all locks held in the system: 1 lock held by khungtaskd/27: #0: ffffffff8b980020 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6446 2 locks held by kworker/u4:2/153: #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline] #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:634 [inline] #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:661 [inline] #0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2268 #1: ffffc9000140fdb0 ((kfence_timer).work){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2272 1 lock held by systemd-udevd/2970: 1 lock held by in:imklog/6258: #0: ffff88807f970ff0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:990 3 locks held by kworker/1:6/8158: 1 lock held by syz-executor.0/8312: 2 locks held by kworker/u4:13/9320: 1 lock held by syz-executor.5/10178: 1 lock held by syz-executor.4/10217: Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: Pablo Neira Ayuso commit b53deef054e58fe4f37c66211b8ece9f8fc1aa13 Author: Florian Westphal Date: Fri Sep 17 18:50:17 2021 +0200 netfilter: log: work around missing softdep backend module iptables/nftables has two types of log modules: 1. backend, e.g. nf_log_syslog, which implement the functionality 2. frontend, e.g. xt_LOG or nft_log, which call the functionality provided by backend based on nf_tables or xtables rule set. Problem is that the request_module() call to load the backed in nf_logger_find_get() might happen with nftables transaction mutex held in case the call path is via nf_tables/nft_compat. This can cause deadlocks (see 'Fixes' tags for details). The chosen solution as to let modprobe deal with this by adding 'pre: ' soft dep tag to xt_LOG (to load the syslog backend) and xt_NFLOG (to load nflog backend). Eric reports that this breaks on systems with older modprobe that doesn't support softdeps. Another, similar issue occurs when someone either insmods xt_(NF)LOG directly or unloads the backend module (possible if no log frontend is in use): because the frontend module is already loaded, modprobe is not invoked again so the softdep isn't evaluated. Add a workaround: If nf_logger_find_get() returns -ENOENT and call is not via nft_compat, load the backend explicitly and try again. Else, let nft_compat ask for deferred request_module via nf_tables infra. Softdeps are kept in-place, so with newer modprobe the dependencies are resolved from userspace. Fixes: cefa31a9d461 ("netfilter: nft_log: perform module load from nf_tables") Fixes: a38b5b56d6f4 ("netfilter: nf_log: add module softdeps") Reported-and-tested-by: Eric Dumazet Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit cc8072153aafd65bff1b3679a112cb6ba71ab375 Author: Florian Westphal Date: Fri Sep 17 11:56:25 2021 +0200 netfilter: iptable_raw: drop bogus net_init annotation This is a leftover from the times when this function was wired up via pernet_operations. Now its called when userspace asks for the table. With CONFIG_NET_NS=n, iptable_raw_table_init memory has been discarded already and we get a kernel crash. Other tables are fine, __net_init annotation was removed already. Fixes: fdacd57c79b7 ("netfilter: x_tables: never register tables by default") Reported-by: youling 257 Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7970a19b71044bf4dc2c1becc200275bdf1884d4 Author: Florian Westphal Date: Wed Sep 15 16:46:39 2021 +0200 netfilter: nf_nat_masquerade: defer conntrack walk to work queue The ipv4 and device notifiers are called with RTNL mutex held. The table walk can take some time, better not block other RTNL users. 'ip a' has been reported to block for up to 20 seconds when conntrack table has many entries and device down events are frequent (e.g., PPP). Reported-and-tested-by: Martin Zaharinov Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 30db406923b9285a9bac06a6af5e74bd6d0f1d06 Author: Florian Westphal Date: Wed Sep 15 16:46:38 2021 +0200 netfilter: nf_nat_masquerade: make async masq_inet6_event handling generic masq_inet6_event is called asynchronously from system work queue, because the inet6 notifier is atomic and nf_iterate_cleanup can sleep. The ipv4 and device notifiers call nf_iterate_cleanup directly. This is legal, but these notifiers are called with RTNL mutex held. A large conntrack table with many devices coming and going will have severe impact on the system usability, with 'ip a' blocking for several seconds. This change places the defer code into a helper and makes it more generic so ipv4 and ifdown notifiers can be converted to defer the cleanup walk as well in a follow patch. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 45928afe94a094bcda9af858b96673d59bc4a0e9 Author: Pablo Neira Ayuso Date: Mon Sep 13 20:38:52 2021 +0200 netfilter: nf_tables: Fix oversized kvmalloc() calls The commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") limits the max allocatable memory via kvmalloc() to MAX_INT. Reported-by: syzbot+cd43695a64bcd21b8596@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit a499b03bf36b0c2e3b958a381d828678ab0ffc5e Author: Florian Westphal Date: Mon Sep 13 14:42:33 2021 +0200 netfilter: nf_tables: unlink table before deleting it syzbot reports following UAF: BUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955 nla_strcmp+0xf2/0x130 lib/nlattr.c:836 nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570 nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline] nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064 nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 Problem is that all get operations are lockless, so the commit_mutex held by nft_rcv_nl_event() isn't enough to stop a parallel GET request from doing read-accesses to the table object even after synchronize_rcu(). To avoid this, unlink the table first and store the table objects in on-stack scratch space. Fixes: 6001a930ce03 ("netfilter: nftables: introduce table ownership") Reported-and-tested-by: syzbot+f31660cf279b0557160c@syzkaller.appspotmail.com Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit cb89f63ba662d2b56583f4dd3dd2b7f03b6d6587 Author: Florian Westphal Date: Wed Sep 8 14:28:39 2021 +0200 selftests: netfilter: add zone stress test with colliding tuples Add 20k entries to the connection tracking table, once from the data plane, once via ctnetlink. In both cases, each entry lives in a different conntrack zone and addresses/ports are identical. Expectation is that insertions work and occurs in constant time: PASS: added 10000 entries in 1215 ms (now 10000 total, loop 1) PASS: added 10000 entries in 1214 ms (now 20000 total, loop 2) PASS: inserted 20000 entries from packet path in 2434 ms total PASS: added 10000 entries in 57631 ms (now 10000 total) PASS: added 10000 entries in 58572 ms (now 20000 total) PASS: inserted 20000 entries via ctnetlink in 116205 ms Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 0f1148abb226f3639845738cdf3d2534ceb1d059 Author: Florian Westphal Date: Wed Sep 8 14:28:38 2021 +0200 selftests: netfilter: add selftest for directional zone support Add a script to exercise NAT port clash resolution with directional zones. Add net namespaces that use the same IP address and connect them to a gateway. Gateway uses policy routing based on iif/mark and conntrack zones to isolate the client namespaces. In server direction, same zone with NAT to single address is used. Then, connect to a server from each client netns, using identical connection id, i.e. saddr:sport -> daddr:dport. Expectation is for all connections to succeeed: NAT gatway is supposed to do port reallocation for each of the (clashing) connections. This is based on the description/use case provided in the commit message of deedb59039f111 ("netfilter: nf_conntrack: add direction support for zones"). Cc: Daniel Borkmann Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d2966dc77ba7b2678f7aee97bf9a65702ec8e2b6 Author: Florian Westphal Date: Wed Sep 8 14:28:37 2021 +0200 netfilter: nat: include zone id in nat table hash again Similar to the conntrack change, also use the zone id for the nat source lists if the zone id is valid in both directions. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b16ac3c4c886f323b06ae942f02ebd2a70bf8840 Author: Florian Westphal Date: Wed Sep 8 14:28:36 2021 +0200 netfilter: conntrack: include zone id in tuple hash again commit deedb59039f111 ("netfilter: nf_conntrack: add direction support for zones") removed the zone id from the hash value. This has implications on hash chain lengths with overlapping tuples, which can hit 64k entries on released kernels, before upper droplimit was added in d7e7747ac5c ("netfilter: refuse insertion if chain has grown too large"). With that change reverted, test script coming with this series shows linear insertion time growth: 10000 entries in 3737 ms (now 10000 total, loop 1) 10000 entries in 16994 ms (now 20000 total, loop 2) 10000 entries in 47787 ms (now 30000 total, loop 3) 10000 entries in 72731 ms (now 40000 total, loop 4) 10000 entries in 95761 ms (now 50000 total, loop 5) 10000 entries in 96809 ms (now 60000 total, loop 6) inserted 60000 entries from packet path in 333825 ms With d7e7747ac5c in place, the test fails. There are three supported zone use cases: 1. Connection is in the default zone (zone 0). This means to special config (the default). 2. Connection is in a different zone (1 to 2**16). This means rules are in place to put packets in the desired zone, e.g. derived from vlan id or interface. 3. Original direction is in zone X and Reply is in zone 0. 3) allows to use of the existing NAT port collision avoidance to provide connectivity to internet/wan even when the various zones have overlapping source networks separated via policy routing. In case the original zone is 0 all three cases are identical. There is no way to place original direction in zone x and reply in zone y (with y != 0). Zones need to be assigned manually via the iptables/nftables ruleset, before conntrack lookup occurs (raw table in iptables) using the "CT" target conntrack template support (-j CT --{zone,zone-orig,zone-reply} X). Normally zone assignment happens based on incoming interface, but could also be derived from packet mark, vlan id and so on. This means that when case 3 is used, the ruleset will typically not even assign a connection tracking template to the "reply" packets, so lookup happens in zone 0. However, it is possible that reply packets also match a ct zone assignment rule which sets up a template for zone X (X > 0) in original direction only. Therefore, after making the zone id part of the hash, we need to do a second lookup using the reply zone id if we did not find an entry on the first lookup. In practice, most deployments will either not use zones at all or the origin and reply zones are the same, no second lookup is required in either case. After this change, packet path insertion test passes with constant insertion times: 10000 entries in 1064 ms (now 10000 total, loop 1) 10000 entries in 1074 ms (now 20000 total, loop 2) 10000 entries in 1066 ms (now 30000 total, loop 3) 10000 entries in 1079 ms (now 40000 total, loop 4) 10000 entries in 1081 ms (now 50000 total, loop 5) 10000 entries in 1082 ms (now 60000 total, loop 6) inserted 60000 entries from packet path in 6452 ms Cc: Daniel Borkmann Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c9c3b6811f7429b8c292de5774cea67f3a033eb2 Author: Florian Westphal Date: Wed Sep 8 14:28:35 2021 +0200 netfilter: conntrack: make max chain length random Similar to commit 67d6d681e15b ("ipv4: make exception cache less predictible"): Use a random drop length to make it harder to detect when entries were hashed to same bucket list. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d9fb678414c048e185eaddadd18d75f5e8832ff3 Merge: 707a63e9a9dd5 9d37e1cab2a9d Author: Linus Torvalds Date: Mon Sep 20 15:49:02 2021 -0700 Merge tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: "Fixes for AFS problems that can cause data corruption due to interaction with another client modifying data cached locally: - When d_revalidating a dentry, don't look at the inode to which it points. Only check the directory to which the dentry belongs. This was confusing things and causing the silly-rename cleanup code to remove the file now at the dentry of a file that got deleted. - Fix mmap data coherency. When a callback break is received that relates to a file that we have cached, the data content may have been changed (there are other reasons, such as the user's rights having been changed). However, we're checking it lazily, only on entry to the kernel, which doesn't happen if we have a writeable shared mapped page on that file. We make the kernel keep track of mmapped files and clear all PTEs mapping to that file as soon as the callback comes in by calling unmap_mapping_pages() (we don't necessarily want to zap the pagecache). This causes the kernel to be reentered when userspace tries to access the mmapped address range again - and at that point we can query the server and, if we need to, zap the page cache. Ideally, I would check each file at the point of notification, but that involves poking the server[*] - which is holding an exclusive lock on the vnode it is changing, waiting for all the clients it notified to reply. This could then deadlock against the server. Further, invalidating the pagecache might call ->launder_page(), which would try to write to the file, which would definitely deadlock. (AFS doesn't lease file access). [*] Checking to see if the file content has changed is a matter of comparing the current data version number, but we have to ask the server for that. We also need to get a new callback promise and we need to poke the server for that too. - Add some more points at which the inode is validated, since we're doing it lazily, notably in ->read_iter() and ->page_mkwrite(), but also when performing some directory operations. Ideally, checking in ->read_iter() would be done in some derivation of filemap_read(). If we're going to call the server to read the file, then we get the file status fetch as part of that. - The above is now causing us to make a lot more calls to afs_validate() to check the inode - and afs_validate() takes the RCU read lock each time to make a quick check (ie. afs_check_validity()). This is entirely for the purpose of checking cb_s_break to see if the server we're using reinitialised its list of callbacks - however this isn't a very common event, so most of the time we're taking this needlessly. Add a new cell-wide counter to count the number of reinitialisations done by any server and check that - and only if that changes, take the RCU read lock and check the server list (the server list may change, but the cell a file is part of won't). - Don't update vnode->cb_s_break and ->cb_v_break inside the validity checking loop. The cb_lock is done with read_seqretry, so we might go round the loop a second time after resetting those values - and that could cause someone else checking validity to miss something (I think). Also included are patches for fixes for some bugs encountered whilst debugging this: - Fix a leak of afs_read objects and fix a leak of keys hidden by that. - Fix a leak of pages that couldn't be added to extend a writeback. - Fix the maintenance of i_blocks when i_size is changed by a local write or a local dir edit" Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217 [1] Link: https://lore.kernel.org/r/163111665183.283156.17200205573146438918.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/ # i_blocks patch * tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix updating of i_blocks on file/dir extension afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server afs: Try to avoid taking RCU read lock when checking vnode validity afs: Fix mmap coherency vs 3rd-party changes afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation afs: Add missing vnode validation checks afs: Fix page leak afs: Fix missing put on afs_read objects and missing get on the key therein commit 707a63e9a9dd55432d47bf40457d4a3413888dcc Merge: fdf5078458793 6d56262c3d224 Author: Linus Torvalds Date: Mon Sep 20 15:35:17 2021 -0700 Merge tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: "Three ksmbd fixes, including an important security fix for path processing, and a buffer overflow check, and a trivial fix for incorrect header inclusion" * tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd: ksmbd: add validation for FILE_FULL_EA_INFORMATION of smb2_get_info ksmbd: prevent out of share access ksmbd: transport_rdma: Don't include rwlock.h directly commit fdf5078458793fca9e9c0fb5e58a1a970ca0fdef Merge: 4c17ca27923c1 35866f3f779ae Author: Linus Torvalds Date: Mon Sep 20 15:30:29 2021 -0700 Merge tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: - two deferred close fixes (for bugs found with xfstests 478 and 461) - a deferred close improvement in rename - two trivial fixes for incorrect Linux comment formatting of multiple cifs files (pointed out by automated kernel test robot and checkpatch) * tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6: cifs: Not to defer close on file when lock is set cifs: Fix soft lockup during fsstress cifs: Deferred close performance improvements cifs: fix incorrect kernel doc comments cifs: remove pathname for file from SPDX header commit d4ffd5df9d18031b6a53f934388726775b4452d3 Author: Jiashuo Liang Date: Fri Jul 30 11:01:52 2021 +0800 x86/fault: Fix wrong signal when vsyscall fails with pkey The function __bad_area_nosemaphore() calls kernelmode_fixup_or_oops() with the parameter @signal being actually @pkey, which will send a signal numbered with the argument in @pkey. This bug can be triggered when the kernel fails to access user-given memory pages that are protected by a pkey, so it can go down the do_user_addr_fault() path and pass the !user_mode() check in __bad_area_nosemaphore(). Most cases will simply run the kernel fixup code to make an -EFAULT. But when another condition current->thread.sig_on_uaccess_err is met, which is only used to emulate vsyscall, the kernel will generate the wrong signal. Add a new parameter @pkey to kernelmode_fixup_or_oops() to fix this. [ bp: Massage commit message, fix build error as reported by the 0day bot: https://lkml.kernel.org/r/202109202245.APvuT8BX-lkp@intel.com ] Fixes: 5042d40a264c ("x86/fault: Bypass no_context() for implicit kernel faults from usermode") Reported-by: kernel test robot Signed-off-by: Jiashuo Liang Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/20210730030152.249106-1-liangjs@pku.edu.cn commit 4c17ca27923c16fd73bbb9ad033c7d749c3bcfcc Merge: 2ff59bad6f248 2bab94090b01b Author: Linus Torvalds Date: Mon Sep 20 12:14:33 2021 -0700 Merge tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark BrownL "This contains a couple of fixes, one fix for handling of zero length transfers on Rockchip devices and a warning fix which will conflict with a version you did but cleans up some extra unneeded forward declarations as well which seems a bit neater" * tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: tegra20-slink: Declare runtime suspend and resume functions conditionally spi: rockchip: handle zero length transfers without timing out commit 2ff59bad6f24813e4c9e8f2022684010ec0e58d2 Merge: e8f71f89236ef dc9660590d106 Author: Linus Torvalds Date: Mon Sep 20 11:47:41 2021 -0700 Merge tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A couple of small device specific fixes that have been sent since the merge window, neither of which stands out particularly" * tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: max14577: Revert "regulator: max14577: Add proper module aliases strings" regulator: qcom-rpmh-regulator: fix pm8009-1 ldo7 resource name commit e8f71f89236ef82d449991bfbc237e3cb6ea584f Author: Guenter Roeck Date: Wed Sep 8 12:08:17 2021 -0700 drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV nvkm test builds fail with the following error. drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info': drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5' The code builds on most architectures, but fails on parisc where ENOSYS is defined as 251. Replace the error code with -ENODEV (-19). The actual error code does not really matter and is not passed to userspace - it just has to be negative. Fixes: 7238eca4cf18 ("drm/nouveau: expose pstate selection per-power source in sysfs") Signed-off-by: Guenter Roeck Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Linus Torvalds commit d8b1e10a2b8efaf71d151aa756052fbf2f3b6d57 Author: Linus Torvalds Date: Mon Sep 20 10:56:32 2021 -0700 sparc64: fix pci_iounmap() when CONFIG_PCI is not set Guenter reported [1] that the pci_iounmap() changes remain problematic, with sparc64 allnoconfig and tinyconfig still not building due to the header file changes and confusion with the arch-specific pci_iounmap() implementation. I'm pretty convinced that sparc should just use GENERIC_IOMAP instead of doing its own thing, since it turns out that the sparc64 version of pci_iounmap() is somewhat buggy (see [2]). But in the meantime, this just fixes the build by avoiding the trivial re-definition of the empty case. Link: https://lore.kernel.org/lkml/20210920134424.GA346531@roeck-us.net/ [1] Link: https://lore.kernel.org/lkml/CAHk-=wgheheFx9myQyy5osh79BAazvmvYURAtub2gQtMvLrhqQ@mail.gmail.com/ [2] Reported-by: Guenter Roeck Cc: David Miller Signed-off-by: Linus Torvalds commit 9f7fa37a6bd90f2749c67f8524334c387d972eb9 Author: Sindhu Devale Date: Thu Sep 16 14:12:22 2021 -0500 RDMA/irdma: Report correct WC error when there are MW bind errors Report the correct WC error when MW bind error related asynchronous events are generated by HW. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20210916191222.824-5-shiraz.saleem@intel.com Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit d3bdcd59633907ee306057b6bb70f06dce47dddc Author: Sindhu Devale Date: Thu Sep 16 14:12:21 2021 -0500 RDMA/irdma: Report correct WC error when transport retry counter is exceeded When the retry counter exceeds, as the remote QP didn't send any Ack or Nack an asynchronous event (AE) for too many retries is generated. Add code to handle the AE and set the correct IB WC error code IB_WC_RETRY_EXC_ERR. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20210916191222.824-4-shiraz.saleem@intel.com Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit f4475f249445b3c1fb99919b0514a075b6d6b3d4 Author: Sindhu Devale Date: Thu Sep 16 14:12:20 2021 -0500 RDMA/irdma: Validate number of CQ entries on create CQ Add lower bound check for CQ entries at creation time. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20210916191222.824-3-shiraz.saleem@intel.com Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 5b1e985f7626307c451f98883f5e2665ee208e1c Author: Sindhu Devale Date: Thu Sep 16 14:12:19 2021 -0500 RDMA/irdma: Skip CQP ring during a reset Due to duplicate reset flags, CQP commands are processed during reset. This leads CQP failures such as below: irdma0: [Delete Local MAC Entry Cmd Error][op_code=49] status=-27 waiting=1 completion_err=0 maj=0x0 min=0x0 Remove the redundant flag and set the correct reset flag so CPQ is paused during reset Fixes: 8498a30e1b94 ("RDMA/irdma: Register auxiliary driver and implement private channel OPs") Link: https://lore.kernel.org/r/20210916191222.824-2-shiraz.saleem@intel.com Reported-by: LiLiang Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit ebcc36ea1960d79406d417cb6b107946da8b5210 Author: Selvin Xavier Date: Wed Sep 15 05:32:43 2021 -0700 MAINTAINERS: Update Broadcom RDMA maintainers Updating the bnxt_re maintainers as Naresh decided to leave Broadcom. Link: https://lore.kernel.org/r/1631709163-2287-13-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 880301bb313295a65523e79bc5666f5cf49eb3ed Author: Colin Ian King Date: Fri Sep 10 11:02:02 2021 +0100 fs/ntfs3: Fix a memory leak on object opts Currently a failed allocation on sbi->upcase will cause an exit via the label free_sbi causing a memory leak on object opts. Fix this by re-ordering the exit paths free_opts and free_sbi so that kfree's occur in the reverse allocation order. Addresses-Coverity: ("Resource leak") Fixes: 27fac77707a1 ("fs/ntfs3: Init spi more in init_fs_context than fill_super") Signed-off-by: Colin Ian King Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit a0fc05a37cae9e61aa29f7e283662ce70f7df342 Author: Kari Argillander Date: Fri Sep 10 00:57:53 2021 +0300 Doc/fs/ntfs3: Fix rst format and make it cleaner Current ntfs3 rst documentation is broken. I turn table to list table as this is current Linux documentation quide line. Simple table also did not quite work in our situation as we need to span rows together. It still look quite good as text so we did not loss anything. This will also make diffing quite bit more pleasure. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 28861e3bbd9e7ac4cd9c811aad71b4d116e27930 Author: Kari Argillander Date: Thu Sep 9 21:09:42 2021 +0300 fs/ntfs3: Initiliaze sb blocksize only in one place + refactor Right now sb blocksize first get initiliazed in fill_super but in can be changed in helper function. It makes more sense to that this happened only in one place. Because we move this to helper function it makes more sense that s_maxbytes will also be there. I rather have every sb releted thing in fill_super, but because there is already sb releted stuff in this helper. This will have to do for now. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0e59a87ee619915c2eb189eb232a972c276681fb Author: Kari Argillander Date: Thu Sep 9 21:09:41 2021 +0300 fs/ntfs3: Initialize pointer before use place in fill_super Initializing should be as close as possible when we use it so that we do not need to scroll up to see what is happening. Also bdev_get_queue() can never return NULL so we do not need to check for !rq. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0056b273757b3057a5aff73f96a7fa134641caf4 Author: Kari Argillander Date: Thu Sep 9 21:09:40 2021 +0300 fs/ntfs3: Remove tmp pointer upcase in fill_super We can survive without this tmp point upcase. So remove it we don't have so many tmp pointer in this function. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 4ea41b3eb5fd51b47742c6fa2ac1851a51ab0c69 Author: Kari Argillander Date: Thu Sep 9 21:09:39 2021 +0300 fs/ntfs3: Remove tmp pointer bd_inode in fill_super Drop tmp pointer bd_inode because this is only used ones in fill_super. Also we have so many initializing happening at the beginning that it is already way too much to follow. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0cde7e81cd448a5df01a3960f6608b15dc3f12a3 Author: Kari Argillander Date: Thu Sep 9 21:09:38 2021 +0300 fs/ntfs3: Remove tmp var is_ro in ntfs_fill_super We only use this in two places so we do not really need it. Also wrapper sb_rdonly() is pretty self explanatory. This will make little bit easier to read this super long variable list in the beginning of ntfs_fill_super(). Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit b4f110d65e21bf937fc5d3d894ec1cd540c85a71 Author: Kari Argillander Date: Thu Sep 9 21:09:37 2021 +0300 fs/ntfs3: Use sb instead of sbi->sb in fill_super Use sb instead of sbi->sb in fill_super. We have sb so why not use it. Also makes code more readable. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 10b4f12c7028399007aaebc25810b18d8f7731a7 Author: Kari Argillander Date: Thu Sep 9 21:09:36 2021 +0300 fs/ntfs3: Remove unnecessary variable loading in fill_super Remove some unnecessary variable loading. These look like copy paste work and they are not used to anything. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit bce1828f6d82ad0ffa3b7259d6f1769ffbcec30c Author: Kari Argillander Date: Thu Sep 9 21:09:35 2021 +0300 fs/ntfs3: Return straight without goto in fill_super In many places it is not needed to use goto out. We can just return right away. This will make code little bit more cleaner as we won't need to check error path. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 5d7d6b16bc1dbe0f84997e639c49b5ed98a562f7 Author: Kari Argillander Date: Thu Sep 9 21:09:34 2021 +0300 fs/ntfs3: Remove impossible fault condition in fill_super Remove root drop when we fault out. This can never happened because when we allocate root we eather fault when no root or success. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 7ea04817866a5ac369f1a33d1b86d06a695aaedb Author: Kari Argillander Date: Thu Sep 9 21:09:33 2021 +0300 fs/ntfs3: Change EINVAL to ENOMEM when d_make_root fails Change EINVAL to ENOMEM when d_make_root fails because that is right errno. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0412016e48076f5f9dbdcc6613436e3c6db89523 Author: Kari Argillander Date: Thu Sep 9 21:09:32 2021 +0300 fs/ntfs3: Fix wrong error message $Logfile -> $UpCase Fix wrong error message $Logfile -> $UpCase. Probably copy paste. Fixes: 203c2b3a406a ("fs/ntfs3: Add initialization of super block") Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 794d5b8a497ff053f56856472e2fae038fa761aa Author: Jan Beulich Date: Fri Sep 17 12:50:38 2021 +0200 swiotlb-xen: this is PV-only on x86 The code is unreachable for HVM or PVH, and it also makes little sense in auto-translated environments. On Arm, with xen_{create,destroy}_contiguous_region() both being stubs, I have a hard time seeing what good the Xen specific variant does - the generic one ought to be fine for all purposes there. Still Arm code explicitly references symbols here, so the code will continue to be included there. Instead of making PCI_XEN's "select" conditional, simply drop it - SWIOTLB_XEN will be available unconditionally in the PV case anyway, and is - as explained above - dead code in non-PV environments. This in turn allows dropping the stubs for xen_{create,destroy}_contiguous_region(), the former of which was broken anyway - it failed to set the DMA handle output. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/5947b8ae-fdc7-225c-4838-84712265fc1e@suse.com Signed-off-by: Juergen Gross commit 8e1034a526652f265ed993fab7f659eb8ae4b6f0 Author: Jan Beulich Date: Fri Sep 17 12:49:04 2021 +0200 xen/pci-swiotlb: reduce visibility of symbols xen_swiotlb and pci_xen_swiotlb_init() are only used within the file defining them, so make them static and remove the stubs. Otoh pci_xen_swiotlb_detect() has a use (as function pointer) from the main pci-swiotlb.c file - convert its stub to a #define to NULL. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/aef5fc33-9c02-4df0-906a-5c813142e13c@suse.com Signed-off-by: Juergen Gross commit e243ae953b5926eba1a8fbea64cbf68094f86a44 Author: Jan Beulich Date: Fri Sep 17 12:48:03 2021 +0200 PCI: only build xen-pcifront in PV-enabled environments The driver's module init function, pcifront_init(), invokes xen_pv_domain() first thing. That construct produces constant "false" when !CONFIG_XEN_PV. Hence there's no point building the driver in non-PV configurations. Drop the (now implicit and generally wrong) X86 dependency: At present, XEN_PV can only be set when X86 is also enabled. In general an architecture supporting Xen PV (and PCI) would want to have this driver built. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/3a7f6c9b-215d-b593-8056-b5fe605dafd7@suse.com Signed-off-by: Juergen Gross commit 9074c79b62b6e0d91d7f716c6e4e9968eaf9e043 Author: Jan Beulich Date: Fri Sep 17 12:45:49 2021 +0200 swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests While the hypervisor hasn't been enforcing this, we would still better avoid issuing requests with GFNs not aligned to the requested order. Instead of altering the value also in the call to panic(), drop it there for being static and hence easy to determine without being part of the panic message. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/7b3998e3-1233-4e5a-89ec-d740e77eb166@suse.com Signed-off-by: Juergen Gross commit f28347cc66395e96712f5c2db0a302ee75bafce6 Author: Jan Beulich Date: Fri Sep 17 08:13:08 2021 +0200 Xen/gntdev: don't ignore kernel unmapping error While working on XSA-361 and its follow-ups, I failed to spot another place where the kernel mapping part of an operation was not treated the same as the user space part. Detect and propagate errors and add a 2nd pr_debug(). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/c2513395-74dc-aea3-9192-fd265aa44e35@suse.com Signed-off-by: Juergen Gross commit 4403f8062abecf24794e0fd3a3e424cc63ba6662 Author: Jan Beulich Date: Thu Sep 16 17:05:29 2021 +0200 xen/x86: drop redundant zeroing from cpu_initialize_context() Just after having obtained the pointer from kzalloc() there's no reason at all to set part of the area to all zero yet another time. Similarly there's no point explicitly clearing "ldt_ents". Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/14881835-a48e-29fa-0870-e177b10fcf65@suse.com Signed-off-by: Juergen Gross commit 36747c96ed496f62dabd1dce9b0f0d5b58495b66 Merge: 42a99a0be3075 5126b9d3d4acd Author: David S. Miller Date: Mon Sep 20 13:28:50 2021 +0100 Merge branch 'hns3-fixes' 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 5126b9d3d4acdebc12b9d436282f88d8a1b5146c Author: Yufeng Mo Date: Wed Sep 15 21:52:11 2021 +0800 net: hns3: fix a return value error in hclge_get_reset_status() hclge_get_reset_status() should return the tqp reset status. However, if the CMDQ fails, the caller will take it as tqp reset success status by mistake. Therefore, uses a parameters to get the tqp reset status instead. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit ef39d632608e66f428c1246836fd060cf4818d67 Author: liaoguojia Date: Wed Sep 15 21:52:10 2021 +0800 net: hns3: check vlan id before using it The input parameters may not be reliable, so check the vlan id before using it, otherwise may set wrong vlan id into hardware. Fixes: dc8131d846d4 ("net: hns3: Fix for packet loss due wrong filter config in VLAN tbls") Signed-off-by: liaoguojia Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 63b1279d9905100a14da9e043de7b28e99dba3f8 Author: Yufeng Mo Date: Wed Sep 15 21:52:09 2021 +0800 net: hns3: check queue id range before using The input parameters may not be reliable. Before using the queue id, we should check this parameter. Otherwise, memory overwriting may occur. Fixes: d34100184685 ("net: hns3: refactor the mailbox message between PF and VF") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 311c0aaa9b4bb8dc65f22634e15963316b17c921 Author: Jiaran Zhang Date: Wed Sep 15 21:52:08 2021 +0800 net: hns3: fix misuse vf id and vport id in some logs vport_id include PF and VFs, vport_id = 0 means PF, other values mean VFs. So the actual vf id is equal to vport_id minus 1. Some VF print logs are actually vport, and logs of vf id actually use vport id, so this patch fixes them. Fixes: ac887be5b0fe ("net: hns3: change print level of RAS error log from warning to error") Fixes: adcf738b804b ("net: hns3: cleanup some print format warning") Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 91bc0d5272d3a4dc3d4fd2a74387c7e7361bbe96 Author: Jian Shen Date: Wed Sep 15 21:52:07 2021 +0800 net: hns3: fix inconsistent vf id print The vf id from ethtool is added 1 before configured to driver. So it's necessary to minus 1 when printing it, in order to keep consistent with user's configuration. Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e184cec5e29d8eb3c3435b12a9074b75e2d69e4a Author: Jian Shen Date: Wed Sep 15 21:52:06 2021 +0800 net: hns3: fix change RSS 'hfunc' ineffective issue When user change rss 'hfunc' without set rss 'hkey' by ethtool -X command, the driver will ignore the 'hfunc' for the hkey is NULL. It's unreasonable. So fix it. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Fixes: 374ad291762a ("net: hns3: Add RSS general configuration support for VF") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e840f42a49925707fca90e6c7a4095118fdb8c4d Author: Marc Zyngier Date: Sun Sep 19 14:09:49 2021 +0100 KVM: arm64: Fix PMU probe ordering Russell reported that since 5.13, KVM's probing of the PMU has started to fail on his HW. As it turns out, there is an implicit ordering dependency between the architectural PMU probing code and and KVM's own probing. If, due to probe ordering reasons, KVM probes before the PMU driver, it will fail to detect the PMU and prevent it from being advertised to guests as well as the VMM. Obviously, this is one probing too many, and we should be able to deal with any ordering. Add a callback from the PMU code into KVM to advertise the registration of a host CPU PMU, allowing for any probing order. Fixes: 5421db1be3b1 ("KVM: arm64: Divorce the perf code from oprofile helpers") Reported-by: "Russell King (Oracle)" Tested-by: Russell King (Oracle) Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/YUYRKVflRtUytzy5@shell.armlinux.org.uk Cc: stable@vger.kernel.org commit a49b50a3c1c3226d26e1dd11e8b763f27e477623 Author: Zenghui Yu Date: Tue Sep 7 13:21:37 2021 +0800 KVM: arm64: nvhe: Fix missing FORCE for hyp-reloc.S build rule Add FORCE so that if_changed can detect the command line change. We'll otherwise see a compilation warning since commit e1f86d7b4b2a ("kbuild: warn if FORCE is missing for if_changed(_dep,_rule) and filechk"). arch/arm64/kvm/hyp/nvhe/Makefile:58: FORCE prerequisite is missing Cc: David Brazdil Cc: Masahiro Yamada Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210907052137.1059-1-yuzenghui@huawei.com commit 1cd73200dad2d53d839b3323596dbf8a2b949d86 Author: Arnd Bergmann Date: Mon Sep 20 12:02:52 2021 +0200 firmware: arm_scmi: Remove __exit annotation virtio_scmi_exit() is only called from __exit function, so the annotation is correct, but when the driver is built-in, the section gets discarded and the reference from a callback pointer causes a link-time error: `virtio_scmi_exit' referenced in section `.rodata' of drivers/firmware/arm_scmi/virtio.o: defined in discarded section `.exit.text' of drivers/firmware/arm_scmi/virtio.o I could not figure out a better workaround, so let's just remove that annotation even if it wastes a couple of bytes in .text. Link: https://lore.kernel.org/r/20210920100301.1466486-2-arnd@kernel.org Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport") Signed-off-by: Arnd Bergmann Signed-off-by: Sudeep Holla commit c90521a0e94f00a2e40889b7d7d99f1494fa9381 Author: Cristian Marussi Date: Mon Aug 16 15:16:09 2021 +0100 firmware: arm_scmi: Fix virtio transport Kconfig dependency ARM_SCMI_TRANSPORT_VIRTIO is a 'bool' Kconfig used to include support for the SCMI virtio transport inside the core SCMI stack; a bare transport dependency attached here to this option, though, cannot be properly propagated to the parent ARM_SCMI_PROTOCOL option and, as a result, it is currently possible to configure a Kernel where SCMI core is builtin and includes support for virtio while VirtIO core is =m. This allowed combination breaks linking: ARM_SCMI_PROTOCOL=y ARM_SCMI_TRANSPORT_VIRTIO=y VIRTIO=m Bind the dependency in ARM_SCMI_TRANSPORT_VIRTIO to the chosen kind of compilation of ARM_SCMI_PROTOCOL. Link: https://lore.kernel.org/r/20210816141609.41751-1-cristian.marussi@arm.com Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport") Reported-by: kernel test robot Suggested-by: Arnd Bergmann Acked-by: Arnd Bergmann Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit aa3233ea7bdb6c4004f5032a3a07417ea51dc409 Author: Arnd Bergmann Date: Mon Sep 20 11:55:09 2021 +0200 staging: r8188eu: fix -Wrestrict warnings Adding back the nonstandard ioctl commands caused -Wrestrict warnings when building with 'make W=1': drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 'rtw_mp_read_rf': drivers/staging/r8188eu/os_dep/ioctl_linux.c:5515:27: error: 'sprintf' argument 3 overlaps destination object 'extra' [-Werror=restrict] 5515 | sprintf(extra, "%s %d", extra, strtou); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/r8188eu/os_dep/ioctl_linux.c:5470:54: note: destination object referenced by 'restrict'-qualified argument 1 was declared here 5470 | struct iw_point *wrqu, char *extra) | ~~~~~~^~~~~ Change these to the same construct used elsewhere in that driver, with an offset to the string to make the warning go away. The ioctl commands were previously removed, and it's unlikely that anything is actually using them, so ideally I would prefer to have them removed again. The lack of range checking of the 'extra' output buffer is also slightly worrying, but I did not check whether this could cause harm. Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210920095525.1150678-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 42a99a0be307562c1bfef32bad8f89aa3c428edd Author: Arnd Bergmann Date: Mon Sep 20 11:57:49 2021 +0200 ptp: ocp: add COMMON_CLK dependency Without CONFIG_COMMON_CLK, this fails to link: arm-linux-gnueabi-ld: drivers/ptp/ptp_ocp.o: in function `ptp_ocp_register_i2c': ptp_ocp.c:(.text+0xcc0): undefined reference to `__clk_hw_register_fixed_rate' arm-linux-gnueabi-ld: ptp_ocp.c:(.text+0xcf4): undefined reference to `devm_clk_hw_register_clkdev' arm-linux-gnueabi-ld: drivers/ptp/ptp_ocp.o: in function `ptp_ocp_detach': ptp_ocp.c:(.text+0x1c24): undefined reference to `clk_hw_unregister_fixed_rate' Fixes: a7e1abad13f3 ("ptp: Add clock driver for the OpenCompute TimeCard.") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 1ca200a8c6f079950a04ea3c3380fe8cf78e95a2 Author: Krzysztof Kozlowski Date: Fri Sep 17 11:18:48 2021 +0200 USB: serial: option: remove duplicate USB device ID The device ZTE 0x0094 is already on the list. Signed-off-by: Krzysztof Kozlowski Fixes: b9e44fe5ecda ("USB: option: cleanup zte 3g-dongle's pid in option.c") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 211f323768a25b30c106fd38f15a0f62c7c2b5f4 Author: Krzysztof Kozlowski Date: Fri Sep 17 11:18:47 2021 +0200 USB: serial: mos7840: remove duplicated 0xac24 device ID 0xac24 device ID is already defined and used via BANDB_DEVICE_ID_USO9ML2_4. Remove the duplicate from the list. Fixes: 27f1281d5f72 ("USB: serial: Extra device/vendor ID for mos7840 driver") Signed-off-by: Krzysztof Kozlowski Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 5bed8b0704c9ecccc8f4a2c377d7c8e21090a82e Author: Michael Chan Date: Mon Sep 20 02:51:52 2021 -0400 bnxt_en: Fix TX timeout when TX ring size is set to the smallest The smallest TX ring size we support must fit a TX SKB with MAX_SKB_FRAGS + 1. Because the first TX BD for a packet is always a long TX BD, we need an extra TX BD to fit this packet. Define BNXT_MIN_TX_DESC_CNT with this value to make this more clear. The current code uses a minimum that is off by 1. Fix it using this constant. The tx_wake_thresh to determine when to wake up the TX queue is half the ring size but we must have at least BNXT_MIN_TX_DESC_CNT for the next packet which may have maximum fragments. So the comparison of the available TX BDs with tx_wake_thresh should be >= instead of > in the current code. Otherwise, at the smallest ring size, we will never wake up the TX queue and will cause TX timeout. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 563f23b002534176f49524b5ca0e1d94d8906c40 Author: Ido Schimmel Date: Fri Sep 17 16:02:18 2021 +0300 nexthop: Fix division by zero while replacing a resilient group The resilient nexthop group torture tests in fib_nexthop.sh exposed a possible division by zero while replacing a resilient group [1]. The division by zero occurs when the data path sees a resilient nexthop group with zero buckets. The tests replace a resilient nexthop group in a loop while traffic is forwarded through it. The tests do not specify the number of buckets while performing the replacement, resulting in the kernel allocating a stub resilient table (i.e, 'struct nh_res_table') with zero buckets. This table should never be visible to the data path, but the old nexthop group (i.e., 'oldg') might still be used by the data path when the stub table is assigned to it. Fix this by only assigning the stub table to the old nexthop group after making sure the group is no longer used by the data path. Tested with fib_nexthops.sh: Tests passed: 222 Tests failed: 0 [1] divide error: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 1850 Comm: ping Not tainted 5.14.0-custom-10271-ga86eb53057fe #1107 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014 RIP: 0010:nexthop_select_path+0x2d2/0x1a80 [...] Call Trace: fib_select_multipath+0x79b/0x1530 fib_select_path+0x8fb/0x1c10 ip_route_output_key_hash_rcu+0x1198/0x2da0 ip_route_output_key_hash+0x190/0x340 ip_route_output_flow+0x21/0x120 raw_sendmsg+0x91d/0x2e10 inet_sendmsg+0x9e/0xe0 __sys_sendto+0x23d/0x360 __x64_sys_sendto+0xe1/0x1b0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Cc: stable@vger.kernel.org Fixes: 283a72a5599e ("nexthop: Add implementation of resilient next-hop groups") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3765996e4f0b8a755cab215a08df744490c76052 Author: Xuan Zhuo Date: Sat Sep 18 16:52:32 2021 +0800 napi: fix race inside napi_enable The process will cause napi.state to contain NAPI_STATE_SCHED and not in the poll_list, which will cause napi_disable() to get stuck. The prefix "NAPI_STATE_" is removed in the figure below, and NAPI_STATE_HASHED is ignored in napi.state. CPU0 | CPU1 | napi.state =============================================================================== napi_disable() | | SCHED | NPSVC napi_enable() | | { | | smp_mb__before_atomic(); | | clear_bit(SCHED, &n->state); | | NPSVC | napi_schedule_prep() | SCHED | NPSVC | napi_poll() | | napi_complete_done() | | { | | if (n->state & (NPSVC | | (1) | _BUSY_POLL))) | | return false; | | ................ | | } | SCHED | NPSVC | | clear_bit(NPSVC, &n->state); | | SCHED } | | | | napi_schedule_prep() | | SCHED | MISSED (2) (1) Here return direct. Because of NAPI_STATE_NPSVC exists. (2) NAPI_STATE_SCHED exists. So not add napi.poll_list to sd->poll_list Since NAPI_STATE_SCHED already exists and napi is not in the sd->poll_list queue, NAPI_STATE_SCHED cannot be cleared and will always exist. 1. This will cause this queue to no longer receive packets. 2. If you encounter napi_disable under the protection of rtnl_lock, it will cause the entire rtnl_lock to be locked, affecting the overall system. This patch uses cmpxchg to implement napi_enable(), which ensures that there will be no race due to the separation of clear two bits. Fixes: 2d8bff12699abc ("netpoll: Close race condition between poll_one_napi and napi_disable") Signed-off-by: Xuan Zhuo Reviewed-by: Dust Li Signed-off-by: David S. Miller commit 50c7ad36e65498802a4015d987d92445ecfb5d00 Merge: 3e1d5b0f58a5e e9a9970bf520c Author: Greg Kroah-Hartman Date: Mon Sep 20 09:04:54 2021 +0200 Merge tag 'fpga-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-linus FPGA Manager fixes for 5.15 Tom and Jiapeng's fixes address smatch warnings around missing return values in error cases. Russ' change addresses an issue where registers are being accessed too early resulting in invalid data being read. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my fixes branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: dfl: Avoid reads to AFU CSRs during enumeration fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() fpga: machxo2-spi: Return an error on failure commit 3e1d5b0f58a5ecda37f4b4fe37c6436315ae9ac5 Merge: 25a1433216489 c8fee41957f03 Author: Greg Kroah-Hartman Date: Mon Sep 20 09:02:36 2021 +0200 Merge tag 'misc-habanalabs-fixes-2021-09-19' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-linus Oded writes: This tag contains the following fixes for 5.15-rc3: - Fix potential race when user waiting for interrupt ioctl - Prevent possible kernel oops in staged CS ioctl - Use direct MSI mechanism in Gaudi as a WA for a H/W issue regarding FLR - Don't support collective wait ioctl operation when it is not supported. e.g. when the NIC ports are disabled - Fix configuration of one of the security mechanism. - Change error print to be rate-limited as it can be initiated by the user and spam the kernel log - Fix return value of CS ioctl when doing staged CS - Fix CS ioctl code when user doesn't supply an offset for the memory area that we use as fence. - Spelling mistake fix * tag 'misc-habanalabs-fixes-2021-09-19' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: habanalabs: expose a single cs seq in staged submissions habanalabs: fix wait offset handling habanalabs: rate limit multi CS completion errors habanalabs/gaudi: fix LBW RR configuration habanalabs: Fix spelling mistake "FEADBACK" -> "FEEDBACK" habanalabs: fail collective wait when not supported habanalabs/gaudi: use direct MSI in single mode habanalabs: fix kernel OOPs related to staged cs habanalabs: fix potential race in interrupt wait ioctl commit 0a91cacee897eb83cf9539bd739f98899e31af85 Author: Stephen Boyd Date: Wed Aug 11 15:41:41 2021 -0700 arm64: dts: qcom: sc7180-trogdor: Fix lpass dai link for HDMI This should be the dai for display port. Without this set properly we fail to get audio routed through external displays on trogdor. It looks like we picked up v4[1] of this patch when there was a v7[2]. The v7 patch still had the wrong sound-dai but at least we can fix all this up and audio works. Cc: Srinivasa Rao Mandadapu Cc: Srinivas Kandagatla Cc: Douglas Anderson Fixes: b22d313e1772 ("arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for HDMI") Link: https://lore.kernel.org/r/20210721080549.28822-3-srivasam@qti.qualcomm.com [1] Link: https://lore.kernel.org/r/20210726120910.20335-3-srivasam@codeaurora.org [2] Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210811224141.1110495-1-swboyd@chromium.org commit ecf5b34cd5182180ff47ca14ecaca0a90db7fd1d Author: David Heidelberg Date: Sun Aug 29 15:39:17 2021 +0200 ARM: dts: qcom: apq8064: update Adreno clock names The legacy clock names (including the _clk suffix) was dropped from the driver, so update the dts accordingly). Tested on Nexus 7 2013, no functional changes. Signed-off-by: David Heidelberg [bjorn: Updated commit message] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210829133918.57780-2-david@ixit.cz commit 40c8ee67cfc49d00a13ccbf542e307b6b5421ad3 Author: Leon Romanovsky Date: Tue Sep 14 12:12:10 2021 +0300 init: don't panic if mount_nodev_root failed Attempt to mount 9p file system as root gives the following kernel panic: 9pnet_virtio: no channels available for device root Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc1+ #127 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x59 panic+0x1e2/0x44b ? __warn_printk+0xf3/0xf3 ? free_unref_page+0x2d4/0x4a0 ? trace_hardirqs_on+0x32/0x120 ? free_unref_page+0x2d4/0x4a0 mount_root+0x189/0x1e0 prepare_namespace+0x136/0x165 kernel_init_freeable+0x3b8/0x3cb ? rest_init+0x2e0/0x2e0 kernel_init+0x19/0x130 ret_from_fork+0x1f/0x30 Kernel Offset: disabled ---[ end Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 ]--- QEMU command line: "qemu-system-x86_64 -append root=/dev/root rw rootfstype=9p rootflags=trans=virtio ..." This error is because root_device_name is truncated in prepare_namespace() from being "/dev/root" to be "root" prior to call to mount_nodev_root(). As a solution, don't treat errors in mount_nodev_root() as errors that require panics and allow failback to the mount flow that existed before patch citied in Fixes tag. Fixes: f9259be6a9e7 ("init: allow mounting arbitrary non-blockdevice filesystems as root") Signed-off-by: Leon Romanovsky Reviewed-by: Christoph Hellwig Signed-off-by: Al Viro commit b51593c4cd739dff7fc40bbed368572d98b19ae8 Author: Vivek Goyal Date: Fri Sep 17 09:13:23 2021 -0400 init/do_mounts.c: Harden split_fs_names() against buffer overflow split_fs_names() currently takes comma separate list of filesystems and converts it into individual filesystem strings. Pleaces these strings in the input buffer passed by caller and returns number of strings. If caller manages to pass input string bigger than buffer, then we can write beyond the buffer. Or if string just fits buffer, we will still write beyond the buffer as we append a '\0' byte at the end. Pass size of input buffer to split_fs_names() and put enough checks in place so such buffer overrun possibilities do not occur. This patch does few things. - Add a parameter "size" to split_fs_names(). This specifies size of input buffer. - Use strlcpy() (instead of strcpy()) so that we can't go beyond buffer size. If input string "names" is larger than passed in buffer, input string will be truncated to fit in buffer. - Stop appending extra '\0' character at the end and avoid one possibility of going beyond the input buffer size. - Do not use extra loop to count number of strings. - Previously if one passed "rootfstype=foo,,bar", split_fs_names() will return only 1 string "foo" (and "bar" will be truncated due to extra ,). After this patch, now split_fs_names() will return 3 strings ("foo", zero-sized-string, and "bar"). Callers of split_fs_names() have been modified to check for zero sized string and skip to next one. Reported-by: xu xin Signed-off-by: Vivek Goyal Reviewed-by: Jan Kara Signed-off-by: Al Viro commit 4382c73a12b4cab537176011a36a3c019cb2a04e Author: Geert Uytterhoeven Date: Tue Aug 24 14:27:41 2021 +0200 firmware: qcom_scm: QCOM_SCM should depend on ARCH_QCOM The Qualcomm Secure Channel Manager (SCM) is only present on Qualcomm SoCs. All drivers using it select QCOM_SCM, and depend on ARCH_QCOM. Until recently, QCOM_SCM was an invisible symbol, but this was changed by adding loadable module support, exposing it to all ARM and ARM64 users. Hence add a dependency on ARCH_QCOM, to prevent asking the user about this driver when configuring a kernel without Qualcomm SoC support. While at it, drop the dependency on ARM || ARM64, as that is implied by HAVE_ARM_SMCCC. Fixes: b42000e4b8741bf6 ("firmware: qcom_scm: Allow qcom_scm driver to be loadable as a permenent module") Fixes: 2954a6f12f250890 ("firmware: qcom-scm: Fix QCOM_SCM configuration") Signed-off-by: Geert Uytterhoeven Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/5cda77085c07dc2e8d2195507b287457cb2f09e9.1629807831.git.geert+renesas@glider.be commit 833d51d7c66d6708abbc02398892b96b950167b9 Author: Shawn Guo Date: Sat Aug 28 15:02:02 2021 +0800 soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment PT_LOAD type denotes that the segment should be loaded into the final firmware memory region. Hash segment is not one such, because it's only needed for PAS init and shouldn't be in the final firmware memory region. That's why mdt_phdr_valid() explicitly reject non PT_LOAD segment and hash segment. This actually makes the hash segment type check in qcom_mdt_read_metadata() unnecessary and redundant. For a hash segment, it won't be loaded into firmware memory region anyway, due to the QCOM_MDT_TYPE_HASH check in mdt_phdr_valid(), even if it has a PT_LOAD type for some reason (misusing or abusing?). Some firmware files on Sony phones are such examples, e.g WCNSS firmware of Sony Xperia M4 Aqua phone. The type of hash segment is just PT_LOAD. Drop the unnecessary hash segment type check in qcom_mdt_read_metadata() to fix firmware loading failure on these phones, while hash segment is still kept away from the final firmware memory region. Fixes: 498b98e93900 ("soc: qcom: mdt_loader: Support loading non-split images") Signed-off-by: Shawn Guo Reviewed-by: Marijn Suijten Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210828070202.7033-1-shawn.guo@linaro.org commit e4e737bb5c170df6135a127739a9e6148ee3da82 Author: Linus Torvalds Date: Sun Sep 19 17:28:22 2021 -0700 Linux 5.15-rc2 commit 4420a0dec79428eabe631269ba0408f79658e0d3 Author: Amit Pundir Date: Fri Sep 17 01:35:54 2021 +0530 arm64: dts: qcom: sdm850-yoga: Reshuffle IPA memory mappings Upstream commit 2e01e0c21459 ("arm64: dts: qcom: sdm850-yoga: Enable IPA") shuffled reserved memory regions in sdm845.dtsi to make firmware loading succeed and enable the ipa device on sdm845-yoga but it broke the other common users of those memory regions like Xiaomi Pocophone F1. So this patch effectively revert those upstream commit changes and move all the relevant changes to sdm850-lenovo-yoga-c630.dts instead. Fixes: 2e01e0c21459 ("arm64: dts: qcom: sdm850-yoga: Enable IPA") Signed-off-by: Amit Pundir Tested-by: Steev Klimaszewski Tested-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210916200554.2434439-1-amit.pundir@linaro.org commit 316e8d79a0959c302b0c462ab64b069599f10eef Author: Linus Torvalds Date: Sun Sep 19 17:13:35 2021 -0700 pci_iounmap'2: Electric Boogaloo: try to make sense of it all Nathan Chancellor reports that the recent change to pci_iounmap in commit 9caea0007601 ("parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled") causes build errors on arm64. It took me about two hours to convince myself that I think I know what the logic of that mess of #ifdef's in the header file really aim to do, and rewrite it to be easier to follow. Famous last words. Anyway, the code has now been lifted from that grotty header file into lib/pci_iomap.c, and has fairly extensive comments about what the logic is. It also avoids indirecting through another confusing (and badly named) helper function that has other preprocessor config conditionals. Let's see what odd architecture did something else strange in this area to break things. But my arm64 cross build is clean. Fixes: 9caea0007601 ("parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled") Reported-by: Nathan Chancellor Cc: Helge Deller Cc: Arnd Bergmann Cc: Guenter Roeck Cc: Ulrich Teichert Cc: James Bottomley Signed-off-by: Linus Torvalds commit 20621d2f27a0163b81dc2b74fd4c0b3e6aa5fa12 Merge: fec3036200b7d 81065b35e2486 Author: Linus Torvalds Date: Sun Sep 19 13:29:36 2021 -0700 Merge tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Prevent a infinite loop in the MCE recovery on return to user space, which was caused by a second MCE queueing work for the same page and thereby creating a circular work list. - Make kern_addr_valid() handle existing PMD entries, which are marked not present in the higher level page table, correctly instead of blindly dereferencing them. - Pass a valid address to sanitize_phys(). This was caused by the mixture of inclusive and exclusive ranges. memtype_reserve() expect 'end' being exclusive, but sanitize_phys() wants it inclusive. This worked so far, but with end being the end of the physical address space the fail is exposed. - Increase the maximum supported GPIO numbers for 64bit. Newer SoCs exceed the previous maximum. * tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Avoid infinite loop for copy from user recovery x86/mm: Fix kern_addr_valid() to cope with existing but not present entries x86/platform: Increase maximum GPIO number for X86_64 x86/pat: Pass valid address to sanitize_phys() commit fec3036200b7d9df32c94eb2616447eb2f6e09ac Merge: f5e29a26c42b2 b89a05b21f461 Author: Linus Torvalds Date: Sun Sep 19 13:22:40 2021 -0700 Merge tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf event fix from Thomas Gleixner: "A single fix for the perf core where a value read with READ_ONCE() was checked and then reread which makes all the checks invalid. Reuse the already read value instead" * tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: events: Reuse value read using READ_ONCE instead of re-reading it commit f5e29a26c42b2c1b149118319a03bf937f168298 Merge: 62453a460a000 81121524f1c79 Author: Linus Torvalds Date: Sun Sep 19 13:11:19 2021 -0700 Merge tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fixes from Thomas Gleixner: "A set of updates for the RT specific reader/writer locking base code: - Make the fast path reader ordering guarantees correct. - Code reshuffling to make the fix simpler" [ This plays ugly games with atomic_add_return_release() because we don't have a plain atomic_add_release(), and should really be cleaned up, I think - Linus ] * tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/rwbase: Take care of ordering guarantee for fastpath reader locking/rwbase: Extract __rwbase_write_trylock() locking/rwbase: Properly match set_and_save_state() to restore_state() commit 62453a460a000156b100bf20ab78cf77232284d0 Merge: 2f629969b01da c006a06508db4 Author: Linus Torvalds Date: Sun Sep 19 13:00:23 2021 -0700 Merge tag 'powerpc-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix crashes when scv (System Call Vectored) is used to make a syscall when a transaction is active, on Power9 or later. - Fix bad interactions between rfscv (Return-from scv) and Power9 fake-suspend mode. - Fix crashes when handling machine checks in LPARs using the Hash MMU. - Partly revert a recent change to our XICS interrupt controller code, which broke the recently added Microwatt support. Thanks to Cédric Le Goater, Eirik Fuller, Ganesh Goudar, Gustavo Romero, Joel Stanley, Nicholas Piggin. * tag 'powerpc-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/xics: Set the IRQ chip data for the ICS native backend powerpc/mce: Fix access error in mce handler KVM: PPC: Book3S HV: Tolerate treclaim. in fake-suspend mode changing registers powerpc/64s: system call rfscv workaround for TM bugs selftests/powerpc: Add scv versions of the basic TM syscall tests powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state commit 2f629969b01dab4ef6254fdfcfda3d82b1ad5420 Merge: d94f395772aee 0664684e1ebd7 Author: Linus Torvalds Date: Sun Sep 19 12:55:12 2021 -0700 Merge tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix bugs in checkkconfigsymbols.py - Fix missing sys import in gen_compile_commands.py - Fix missing FORCE warning for ARCH=sh builds - Fix -Wignored-optimization-argument warnings for Clang builds - Turn -Wignored-optimization-argument into an error in order to stop building instead of sprinkling warnings * tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS x86/build: Do not add -falign flags unconditionally for clang kbuild: Fix comment typo in scripts/Makefile.modpost sh: Add missing FORCE prerequisites in Makefile gen_compile_commands: fix missing 'sys' package checkkconfigsymbols.py: Remove skipping of help lines in parse_kconfig_file checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit commit d94f395772aeee64325d8b2f279560f08ac06fac Merge: bc1abb9e55ced 219d720e6df71 Author: Linus Torvalds Date: Sun Sep 19 12:49:17 2021 -0700 Merge tag 'perf-tools-fixes-for-v5.15-2021-09-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix ip display in 'perf script' when output type != attr->type. - Ignore deprecation warning when using libbpf'sg btf__get_from_id(), fixing the build with libbpf v0.6+. - Make use of FD() robust in libperf, fixing a segfault with 'perf stat --iostat list'. - Initialize addr_location:srcline pointer to NULL when resolving callchain addresses. - Fix fused instruction logic for assembly functions in 'perf annotate'. * tag 'perf-tools-fixes-for-v5.15-2021-09-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf bpf: Ignore deprecation warning when using libbpf's btf__get_from_id() libperf evsel: Make use of FD robust. perf machine: Initialize srcline string member in add_location struct perf script: Fix ip display when type != attr->type perf annotate: Fix fused instr logic for assembly functions commit bc1abb9e55cedaeac4602426f8fc83fb3a5b1c35 Author: Linus Torvalds Date: Sun Sep 19 10:49:42 2021 -0700 dmascc: use proper 'virt_to_bus()' rather than casting to 'int' The old dmascc driver depends on the legacy ISA_DMA_API, and blindly just casts the kernel virtual address to 'int' for set_dma_addr(). That works only incidentally, and because the high bits of the address will be ignored anyway. And on 64-bit architectures it causes warnings. Admittedly, 64-bit architectures with ISA are basically dead - I think the only example of this is alpha, and nobody would ever use the dmascc driver there. But hey, the fix is easy enough, the end result is cleaner, and it's yet another configuration that now builds without warnings. If somebody actually uses this driver on an alpha and this fixes it for you, please email me. Because that is just incredibly bizarre. Signed-off-by: Linus Torvalds commit 4fef6115903afed5a7f21b387ad132b4c8838bc7 Author: Linus Torvalds Date: Sun Sep 19 10:37:00 2021 -0700 alpha: enable GENERIC_PCI_IOMAP unconditionally With the previous commit (9caea0007601: "parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled") we can now enable GENERIC_PCI_IOMAP unconditionally on alpha, and if PCI is not enabled we will just get the nice empty helper functions that allow mixed-bus drivers to build. Example driver: the old 3com/3c59x.c driver works with either the PCI or the EISA version of the 3x59x card, but wouldn't build in an EISA-only configuration because of missing pci_iomap() and pci_iounmap() dummy wrappers. Most of the other PCI infrastructure just becomes empty wrappers even without GENERIC_PCI_IOMAP, and it's not obvious that the pci_iomap functionality shouldn't do the same, but this works. Cc: Ulrich Teichert Signed-off-by: Linus Torvalds commit 9caea0007601d3bc6debec04f8b4cd6f4c2394be Author: Helge Deller Date: Sun Sep 19 10:36:09 2021 -0700 parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled Linus noticed odd declaration rules for pci_iounmap() in iomap.h and pci_iomap.h, where it dependend on either NO_GENERIC_PCI_IOPORT_MAP or GENERIC_IOMAP when CONFIG_PCI was disabled. Testing on parisc seems to indicate that we need pci_iounmap() only when CONFIG_PCI is enabled, so the declaration of pci_iounmap() can be moved cleanly into pci_iomap.h in sync with the declarations of pci_iomap(). Link: https://lore.kernel.org/all/CAHk-=wjRrh98pZoQ+AzfWmsTZacWxTJKXZ9eKU2X_0+jM=O8nw@mail.gmail.com/ Signed-off-by: Helge Deller Suggested-by: Linus Torvalds Fixes: 97a29d59fc22 ("[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional") Cc: Arnd Bergmann Cc: Guenter Roeck Cc: Ulrich Teichert Cc: James Bottomley Signed-off-by: Linus Torvalds commit 31ad37bd6faf871c070650f72ac9488ceeeceeb0 Author: Linus Torvalds Date: Sun Sep 19 10:11:53 2021 -0700 Revert "drm/vc4: hdmi: Remove drm_encoder->crtc usage" This reverts commit 27da370e0fb343a0baf308f503bb3e5dcdfe3362. Sudip Mukherjee reports that this broke pulseaudio with a NULL pointer dereference in vc4_hdmi_audio_prepare(), bisected it to this commit, and confirmed that a revert fixed the problem. Revert the problematic commit until fixed. Link: https://lore.kernel.org/all/CADVatmPB9-oKd=ypvj25UYysVo6EZhQ6bCM7EvztQBMyiZfAyw@mail.gmail.com/ Link: https://lore.kernel.org/all/CADVatmN5EpRshGEPS_JozbFQRXg5w_8LFB3OMP1Ai-ghxd3w4g@mail.gmail.com/ Reported-and-tested-by: Sudip Mukherjee Cc: Maxime Ripard Cc: Emma Anholt Cc: Dave Airlie Signed-off-by: Linus Torvalds commit b1044a9b8100a0cc5c9d2e1e2f9ca4bb8e32b23a Author: Linus Torvalds Date: Sun Sep 19 10:06:46 2021 -0700 Revert drm/vc4 hdmi runtime PM changes This reverts commits 9984d6664ce9 ("drm/vc4: hdmi: Make sure the controller is powered in detect") 411efa18e4b0 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm") as Michael Stapelberg reports that the new runtime PM changes cause his Raspberry Pi 3 to hang on boot, probably due to interactions with other changes in the DRM tree (because a bisect points to the merge in commit e058a84bfddc: "Merge tag 'drm-next-2021-07-01' of git://.../drm"). Revert these two commits until it's been resolved. Link: https://lore.kernel.org/all/871r5mp7h2.fsf@midna.i-did-not-set--mail-host-address--so-tickle-me/ Reported-and-tested-by: Michael Stapelberg Cc: Maxime Ripard Cc: Dave Stevenson Cc: Dave Airlie Signed-off-by: Linus Torvalds commit b6a46b4f6e4b35868e33930acaa7c50bf6cab821 Author: Dan Carpenter Date: Tue Aug 31 11:18:49 2021 +0300 iwlwifi: mvm: d3: missing unlock in iwl_mvm_wowlan_program_keys() This code was refactored and the mutex_unlock(&mvm->mutex); was accidentally deleted. Fixes: af3aab9ce298 ("iwlwifi: mvm: d3: make key reprogramming iteration optional") Signed-off-by: Dan Carpenter Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210831081849.GB9846@kili commit 27a221f433b7ac6604845b09696e60e803972d3c Author: Dan Carpenter Date: Tue Aug 31 11:18:02 2021 +0300 iwlwifi: mvm: d3: Fix off by ones in iwl_mvm_wowlan_get_rsc_v5_data() These should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() to prevent an out of bounds write on the next line. Fixes: 79e561f0f05a ("iwlwifi: mvm: d3: implement RSC command version 5") Signed-off-by: Dan Carpenter Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210831081802.GA9846@kili commit e30cd812dffadc58241ae378e48728e6a161becd Author: Shuah Khan Date: Fri Sep 17 15:53:56 2021 -0600 selftests: net: af_unix: Fix makefile to use TEST_GEN_PROGS Makefile uses TEST_PROGS instead of TEST_GEN_PROGS to define executables. TEST_PROGS is for shell scripts that need to be installed and run by the common lib.mk framework. The common framework doesn't touch TEST_PROGS when it does build and clean. As a result "make kselftest-clean" and "make clean" fail to remove executables. Run and install work because the common framework runs and installs TEST_PROGS. Build works because the Makefile defines "all" rule which is unnecessary if TEST_GEN_PROGS is used. Use TEST_GEN_PROGS so the common framework can handle build/run/ install/clean properly. Signed-off-by: Shuah Khan Signed-off-by: David S. Miller commit 72a3c58d18fd780eecd80178bb2132ce741a0a74 Author: Lama Kayal Date: Sun Sep 19 14:55:45 2021 +0300 net/mlx4_en: Resolve bad operstate value Any link state change that's done prior to net device registration isn't reflected on the state, thus the operational state is left obsolete, with 'UNKNOWN' status. To resolve the issue, query link state from FW upon open operations to ensure operational state is updated. Fixes: c27a02cd94d6 ("mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC") Signed-off-by: Lama Kayal Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller commit 48514a22333099b93c33ea1c7c97dad3f7a611ce Author: Shuah Khan Date: Fri Sep 17 13:26:14 2021 -0600 selftests: net: af_unix: Fix incorrect args in test result msg Fix the args to fprintf(). Splitting the message ends up passing incorrect arg for "sigurg %d" and an extra arg overall. The test result message ends up incorrect. test_unix_oob.c: In function ‘main’: test_unix_oob.c:274:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘char *’ [-Wformat=] 274 | fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ", | ~^ | | | int | %s 275 | "atmark %d\n", signal_recvd, len, oob, atmark); | ~~~~~~~~~~~~~ | | | char * test_unix_oob.c:274:19: warning: too many arguments for format [-Wformat-extra-args] 274 | fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ", Signed-off-by: Shuah Khan Signed-off-by: David S. Miller commit 029497e66bdc762e001880e4c85a91f35a54b1e2 Author: Christian Lamparter Date: Sun Sep 19 13:57:25 2021 +0200 net: bgmac-bcma: handle deferred probe error due to mac-address Due to the inclusion of nvmem handling into the mac-address getter function of_get_mac_address() by commit d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") it is now possible to get a -EPROBE_DEFER return code. Which did cause bgmac to assign a random ethernet address. This exact issue happened on my Meraki MR32. The nvmem provider is an EEPROM (at24c64) which gets instantiated once the module driver is loaded... This happens once the filesystem becomes available. With this patch, bgmac_probe() will propagate the -EPROBE_DEFER error. Then the driver subsystem will reschedule the probe at a later time. Cc: Petr Štetiar Cc: Michael Walle Fixes: d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") Signed-off-by: Christian Lamparter Signed-off-by: David S. Miller commit fd292c189a979838622d5e03e15fa688c81dd50b Author: Vladimir Oltean Date: Fri Sep 17 17:29:16 2021 +0300 net: dsa: tear down devlink port regions when tearing down the devlink port on error Commit 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal") decided it was fine to ignore errors on certain ports that fail to probe, and go on with the ports that do probe fine. Commit fb6ec87f7229 ("net: dsa: Fix type was not set for devlink port") noticed that devlink_port_type_eth_set(dlp, dp->slave); does not get called, and devlink notices after a timeout of 3600 seconds and prints a WARN_ON. So it went ahead to unregister the devlink port. And because there exists an UNUSED port flavour, we actually re-register the devlink port as UNUSED. Commit 08156ba430b4 ("net: dsa: Add devlink port regions support to DSA") added devlink port regions, which are set up by the driver and not by DSA. When we trigger the devlink port deregistration and reregistration as unused, devlink now prints another WARN_ON, from here: devlink_port_unregister: WARN_ON(!list_empty(&devlink_port->region_list)); So the port still has regions, which makes sense, because they were set up by the driver, and the driver doesn't know we're unregistering the devlink port. Somebody needs to tear them down, and optionally (actually it would be nice, to be consistent) set them up again for the new devlink port. But DSA's layering stays in our way quite badly here. The options I've considered are: 1. Introduce a function in devlink to just change a port's type and flavour. No dice, devlink keeps a lot of state, it really wants the port to not be registered when you set its parameters, so changing anything can only be done by destroying what we currently have and recreating it. 2. Make DSA cache the parameters passed to dsa_devlink_port_region_create, and the region returned, keep those in a list, then when the devlink port unregister needs to take place, the existing devlink regions are destroyed by DSA, and we replay the creation of new regions using the cached parameters. Problem: mv88e6xxx keeps the region pointers in chip->ports[port].region, and these will remain stale after DSA frees them. There are many things DSA can do, but updating mv88e6xxx's private pointers is not one of them. 3. Just let the driver do it (i.e. introduce a very specific method called ds->ops->port_reinit_as_unused, which unregisters its devlink port devlink regions, then the old devlink port, then registers the new one, then the devlink port regions for it). While it does work, as opposed to the others, it's pretty horrible from an API perspective and we can do better. 4. Introduce a new pair of methods, ->port_setup and ->port_teardown, which in the case of mv88e6xxx must register and unregister the devlink port regions. Call these 2 methods when the port must be reinitialized as unused. Naturally, I went for the 4th approach. Fixes: 08156ba430b4 ("net: dsa: Add devlink port regions support to DSA") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit fdb475838539cb516caeeeaed06b4b5bc62c9179 Author: Krzysztof Kozlowski Date: Fri Sep 17 11:20:58 2021 +0200 net: freescale: 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 Signed-off-by: David S. Miller commit d614489f6bc8de28efb347ded5360896b87c9496 Merge: 2dcb96bacce36 ba68e99419847 Author: David S. Miller Date: Sun Sep 19 12:59:52 2021 +0100 Merge branch 'ocelot-phylink-fixes' Colin Foster says: ==================== ocelot phylink fixes When the ocelot driver was migrated to phylink, e6e12df625f2 ("net: mscc: ocelot: convert to phylink") there were two additional writes to registers that became stale. One write was to DEV_CLOCK_CFG and one was to ANA_PFC_PCF_CFG. Both of these writes referenced the variable "speed" which originally was set to OCELOT_SPEED_{10,100,1000,2500}. These macros expand to values of 3, 2, 1, or 0, respectively. After the update, the variable speed is set to SPEED_{10,100,1000,2500} which expand to 10, 100, 1000, and 2500. So invalid values were getting written to the two registers, which would lead to either a lack of functionality or undefined funcationality. Fixing these values was the intent of v1 of this patch set - submitted as "[PATCH v1 net] net: ethernet: mscc: ocelot: bug fix when writing MAC speed" During that review it was determined that both writes were actually unnecessary. DEV_CLOCK_CFG is a duplicate write, so can be removed entirely. This was accidentally submitted as as a new, lone patch titled "[PATCH v1 net] net: mscc: ocelot: remove buggy duplicate write to DEV_CLOCK_CFG". This is part of what is considered v2 of this patch set. Additionally, the write to ANA_PFC_PFC_CFG is also unnecessary. Priority flow contol is disabled, so configuring it is useless and should be removed. This was also submitted as a new, lone patch titled "[PATCH v1 net] net: mscc: ocelot: remove buggy and useless write to ANA_PFC_PFC_CFG". This is the rest of what is considered v2 of this patch set. v3 Identical to v2, but fixes the patch numbering to v3 and submitting the two changes as a patch set. v2 Note: I misunderstood and submitted two new "v1" patches instead of a single "v2" patch set. - Remove the buggy writes altogher ==================== Signed-off-by: David S. Miller commit ba68e9941984792f7e8a7be90b8245eb0d2b4d7b Author: Colin Foster Date: Fri Sep 17 08:39:05 2021 -0700 net: mscc: ocelot: remove buggy duplicate write to DEV_CLOCK_CFG When updating ocelot to use phylink, a second write to DEV_CLOCK_CFG was mistakenly left in. It used the variable "speed" which, previously, would would have been assigned a value of OCELOT_SPEED_1000. In phylink the variable is be SPEED_1000, which is invalid for the DEV_CLOCK_LINK_SPEED macro. Removing it as unnecessary and buggy. Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink") Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 163957c43d96c2409d9d9d2e94823f7300f6e52c Author: Colin Foster Date: Fri Sep 17 08:39:04 2021 -0700 net: mscc: ocelot: remove buggy and useless write to ANA_PFC_PFC_CFG A useless write to ANA_PFC_PFC_CFG was left in while refactoring ocelot to phylink. Since priority flow control is disabled, writing the speed has no effect. Further, it was using ethtool.h SPEED_ instead of OCELOT_SPEED_ macros, which are incorrectly offset for GENMASK. Lastly, for priority flow control to properly function, some scenarios would rely on the rate adaptation from the PCS while the MAC speed would be fixed. So it isn't used, and even if it was, neither "speed" nor "mac_speed" are necessarily the correct values to be used. Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink") Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2dcb96bacce36021c2f3eaae0cef607b5bb71ede Author: Thomas Gleixner Date: Sat Sep 18 14:42:35 2021 +0200 net: core: Correct the sock::sk_lock.owned lockdep annotations lock_sock_fast() and lock_sock_nested() contain lockdep annotations for the sock::sk_lock.owned 'mutex'. sock::sk_lock.owned is not a regular mutex. It is just lockdep wise equivalent. In fact it's an open coded trivial mutex implementation with some interesting features. sock::sk_lock.slock is a regular spinlock protecting the 'mutex' representation sock::sk_lock.owned which is a plain boolean. If 'owned' is true, then some other task holds the 'mutex', otherwise it is uncontended. As this locking construct is obviously endangered by lock ordering issues as any other locking primitive it got lockdep annotated via a dedicated dependency map sock::sk_lock.dep_map which has to be updated at the lock and unlock sites. lock_sock_nested() is a straight forward 'mutex' lock operation: might_sleep(); spin_lock_bh(sock::sk_lock.slock) while (!try_lock(sock::sk_lock.owned)) { spin_unlock_bh(sock::sk_lock.slock); wait_for_release(); spin_lock_bh(sock::sk_lock.slock); } The lockdep annotation for sock::sk_lock.owned is for unknown reasons _after_ the lock has been acquired, i.e. after the code block above and after releasing sock::sk_lock.slock, but inside the bottom halves disabled region: spin_unlock(sock::sk_lock.slock); mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_); local_bh_enable(); The placement after the unlock is obvious because otherwise the mutex_acquire() would nest into the spin lock held region. But that's from the lockdep perspective still the wrong place: 1) The mutex_acquire() is issued _after_ the successful acquisition which is pointless because in a dead lock scenario this point is never reached which means that if the deadlock is the first instance of exposing the wrong lock order lockdep does not have a chance to detect it. 2) It only works because lockdep is rather lax on the context from which the mutex_acquire() is issued. Acquiring a mutex inside a bottom halves and therefore non-preemptible region is obviously invalid, except for a trylock which is clearly not the case here. This 'works' stops working on RT enabled kernels where the bottom halves serialization is done via a local lock, which exposes this misplacement because the 'mutex' and the local lock nest the wrong way around and lockdep complains rightfully about a lock inversion. The placement is wrong since the initial commit a5b5bb9a053a ("[PATCH] lockdep: annotate sk_locks") which introduced this. Fix it by moving the mutex_acquire() in front of the actual lock acquisition, which is what the regular mutex_lock() operation does as well. lock_sock_fast() is not that straight forward. It looks at the first glance like a convoluted trylock operation: spin_lock_bh(sock::sk_lock.slock) if (!sock::sk_lock.owned) return false; while (!try_lock(sock::sk_lock.owned)) { spin_unlock_bh(sock::sk_lock.slock); wait_for_release(); spin_lock_bh(sock::sk_lock.slock); } spin_unlock(sock::sk_lock.slock); mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_); local_bh_enable(); return true; But that's not the case: lock_sock_fast() is an interesting optimization for short critical sections which can run with bottom halves disabled and sock::sk_lock.slock held. This allows to shortcut the 'mutex' operation in the non contended case by preventing other lockers to acquire sock::sk_lock.owned because they are blocked on sock::sk_lock.slock, which in turn avoids the overhead of doing the heavy processing in release_sock() including waking up wait queue waiters. In the contended case, i.e. when sock::sk_lock.owned == true the behavior is the same as lock_sock_nested(). Semantically this shortcut means, that the task acquired the 'mutex' even if it does not touch the sock::sk_lock.owned field in the non-contended case. Not telling lockdep about this shortcut acquisition is hiding potential lock ordering violations in the fast path. As a consequence the same reasoning as for the above lock_sock_nested() case vs. the placement of the lockdep annotation applies. The current placement of the lockdep annotation was just copied from the original lock_sock(), now renamed to lock_sock_nested(), implementation. Fix this by moving the mutex_acquire() in front of the actual lock acquisition and adding the corresponding mutex_release() into unlock_sock_fast(). Also document the fast path return case with a comment. Reported-by: Sebastian Siewior Signed-off-by: Thomas Gleixner Cc: netdev@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Eric Dumazet Signed-off-by: David S. Miller commit 48e6d083b3aa006052db687fb26eeceef1d325b6 Author: Alejandro Concepcion-Rodriguez Date: Fri Sep 17 18:49:59 2021 +0000 docs: net: dsa: sja1105: fix reference to sja1105.txt The file sja1105.txt was converted to nxp,sja1105.yaml. Signed-off-by: Alejandro Concepcion-Rodriguez Signed-off-by: David S. Miller commit 87758511075ec961486fe78d7548dd709b524433 Author: Randy Dunlap Date: Fri Sep 17 14:05:47 2021 -0700 igc: fix build errors for PTP When IGC=y and PTP_1588_CLOCK=m, the ptp_*() interface family is not available to the igc driver. Make this driver depend on PTP_1588_CLOCK_OPTIONAL so that it will build without errors. Various igc commits have used ptp_*() functions without checking that PTP_1588_CLOCK is enabled. Fix all of these here. Fixes these build errors: ld: drivers/net/ethernet/intel/igc/igc_main.o: in function `igc_msix_other': igc_main.c:(.text+0x6494): undefined reference to `ptp_clock_event' ld: igc_main.c:(.text+0x64ef): undefined reference to `ptp_clock_event' ld: igc_main.c:(.text+0x6559): undefined reference to `ptp_clock_event' ld: drivers/net/ethernet/intel/igc/igc_ethtool.o: in function `igc_ethtool_get_ts_info': igc_ethtool.c:(.text+0xc7a): undefined reference to `ptp_clock_index' ld: drivers/net/ethernet/intel/igc/igc_ptp.o: in function `igc_ptp_feature_enable_i225': igc_ptp.c:(.text+0x330): undefined reference to `ptp_find_pin' ld: igc_ptp.c:(.text+0x36f): undefined reference to `ptp_find_pin' ld: drivers/net/ethernet/intel/igc/igc_ptp.o: in function `igc_ptp_init': igc_ptp.c:(.text+0x11cd): undefined reference to `ptp_clock_register' ld: drivers/net/ethernet/intel/igc/igc_ptp.o: in function `igc_ptp_stop': igc_ptp.c:(.text+0x12dd): undefined reference to `ptp_clock_unregister' ld: drivers/platform/x86/dell/dell-wmi-privacy.o: in function `dell_privacy_wmi_probe': Fixes: 64433e5bf40ab ("igc: Enable internal i225 PPS") Fixes: 60dbede0c4f3d ("igc: Add support for ethtool GET_TS_INFO command") Fixes: 87938851b6efb ("igc: enable auxiliary PHC functions for the i225") Fixes: 5f2958052c582 ("igc: Add basic skeleton for PTP") Signed-off-by: Randy Dunlap Cc: Ederson de Souza Cc: Tony Nguyen Cc: Vinicius Costa Gomes Cc: Jeff Kirsher Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Jesse Brandeburg Cc: intel-wired-lan@lists.osuosl.org Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 9f7afa05c9522b086327929ae622facab0f0f72b Author: Claudiu Manoil Date: Fri Sep 17 13:22:06 2021 +0300 enetc: Fix uninitialized struct dim_sample field usage The only struct dim_sample member that does not get initialized by dim_update_sample() is comp_ctr. (There is special API to initialize comp_ctr: dim_update_sample_with_comps(), and it is currently used only for RDMA.) comp_ctr is used to compute curr_stats->cmps and curr_stats->cpe_ratio (see dim_calc_stats()) which in turn are consumed by the rdma_dim_*() API. Therefore, functionally, the net_dim*() API consumers are not affected. Nevertheless, fix the computation of statistics based on an uninitialized variable, even if the mentioned statistics are not used at the moment. Fixes: ae0e6a5d1627 ("enetc: Add adaptive interrupt coalescing") Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller commit 7237a494decfa17d0b9d0076e6cee3235719de90 Author: Claudiu Manoil Date: Fri Sep 17 13:22:05 2021 +0300 enetc: Fix illegal access when reading affinity_hint irq_set_affinity_hit() stores a reference to the cpumask_t parameter in the irq descriptor, and that reference can be accessed later from irq_affinity_hint_proc_show(). Since the cpu_mask parameter passed to irq_set_affinity_hit() has only temporary storage (it's on the stack memory), later accesses to it are illegal. Thus reads from the corresponding procfs affinity_hint file can result in paging request oops. The issue is fixed by the get_cpu_mask() helper, which provides a permanent storage for the cpumask_t parameter. Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller commit afd92d82c9d715fb97565408755acad81573591a Author: Jason Wang Date: Fri Sep 17 16:34:06 2021 +0800 virtio-net: fix pages leaking when building skb in big mode We try to use build_skb() if we had sufficient tailroom. But we forget to release the unused pages chained via private in big mode which will leak pages. Fixing this by release the pages after building the skb in big mode. Cc: Xuan Zhuo Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom") Signed-off-by: Jason Wang Reviewed-by: Xuan Zhuo Signed-off-by: David S. Miller commit 3ede7f84c7c21f93c5eac611d60eba3f2c765e0f Author: Jan Beulich Date: Fri Sep 17 08:27:10 2021 +0200 xen-netback: correct success/error reporting for the SKB-with-fraglist case When re-entering the main loop of xenvif_tx_check_gop() a 2nd time, the special considerations for the head of the SKB no longer apply. Don't mistakenly report ERROR to the frontend for the first entry in the list, even if - from all I can tell - this shouldn't matter much as the overall transmit will need to be considered failed anyway. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Signed-off-by: David S. Miller commit 564df7ab10ad900c1494dc99d9d3710258d07ba2 Merge: 02319bf15acf5 a68e9da48568a Author: David S. Miller Date: Sun Sep 19 12:08:37 2021 +0100 Merge branch 'dsa-shutdown' Vladimir Oltean says: ==================== Make DSA switch drivers compatible with masters which unregister on shutdown Changes in v2: - fix build for b53_mmap - use unregister_netdevice_many It was reported by Lino here: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ that when the DSA master attempts to unregister its net_device on shutdown, DSA should prevent that operation from succeeding because it holds a reference to it. This hangs the shutdown process. This issue was essentially introduced in commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"). The present series patches all DSA drivers to handle that case, depending on whether those drivers were introduced before or after the offending commit, a different Fixes: tag is specified for them. The approach taken by this series solves the issue in essentially the same way as Lino's patches, except for three key differences: - this series takes a more minimal approach in what is done on shutdown, we do not attempt a full tree teardown as that is not strictly necessary. I might revisit this if there are compelling reasons to do otherwise - this series fixes the issues for all DSA drivers, not just KSZ9897 - this series works even if the ->remove driver method gets called for the same device too, not just ->shutdown. This is really possible to happen for SPI device drivers, and potentially possible for other bus device drivers too. ==================== Signed-off-by: David S. Miller commit a68e9da48568a0adf5dc817ef81971c0d1aa0672 Author: Vladimir Oltean Date: Fri Sep 17 16:34:36 2021 +0300 net: dsa: xrs700x: be compatible with masters which unregister on shutdown Since commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"), DSA gained a requirement which it did not fulfill, which is to unlink itself from the DSA master at shutdown time. Since the Arrow SpeedChips XRS700x driver was introduced after the bad commit, it has never worked with DSA masters which decide to unregister their net_device on shutdown, effectively hanging the reboot process. To fix that, we need to call dsa_switch_shutdown. These devices can be connected by I2C or by MDIO, and if I search for I2C or MDIO bus drivers that implement their ->shutdown by redirecting it to ->remove I don't see any, however this does not mean it would not be possible. To be compatible with that pattern, it is necessary to implement an "if this then not that" scheme, to avoid ->remove and ->shutdown from being called both for the same struct device. Fixes: ee00b24f32eb ("net: dsa: add Arrow SpeedChips XRS700x driver") Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ Reported-by: Lino Sanfilippo Signed-off-by: Vladimir Oltean Reviewed-by: George McCollister Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit fe4053078cd0f02a3fa140c43660f327702a9f10 Author: Vladimir Oltean Date: Fri Sep 17 16:34:35 2021 +0300 net: dsa: microchip: ksz8863: be compatible with masters which unregister on shutdown Since commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"), DSA gained a requirement which it did not fulfill, which is to unlink itself from the DSA master at shutdown time. Since the Microchip sub-driver for KSZ8863 was introduced after the bad commit, it has never worked with DSA masters which decide to unregister their net_device on shutdown, effectively hanging the reboot process. To fix that, we need to call dsa_switch_shutdown. Since this driver expects the MDIO bus to be backed by mdio_bitbang, I don't think there is currently any MDIO bus driver which implements its ->shutdown by redirecting it to ->remove, but in any case, to be compatible with that pattern, it is necessary to implement an "if this then not that" scheme, to avoid ->remove and ->shutdown from being called both for the same struct device. Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support") Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ Reported-by: Lino Sanfilippo Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 46baae56e1001a771a5d132aa883cb5605013ae2 Author: Vladimir Oltean Date: Fri Sep 17 16:34:34 2021 +0300 net: dsa: hellcreek: be compatible with masters which unregister on shutdown Since commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"), DSA gained a requirement which it did not fulfill, which is to unlink itself from the DSA master at shutdown time. Since the hellcreek driver was introduced after the bad commit, it has never worked with DSA masters which decide to unregister their net_device on shutdown, effectively hanging the reboot process. Hellcreek is a platform device driver, so we probably cannot have the oddities of ->shutdown and ->remove getting both called for the exact same struct device. But to be in line with the pattern from the other device drivers which are on slow buses, implement the same "if this then not that" pattern of either running the ->shutdown or the ->remove hook. The driver's current ->remove implementation makes that very easy because it already zeroes out its device_drvdata on ->remove. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ Reported-by: Lino Sanfilippo Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 0650bf52b31ff35dc6430fc2e37969c36baba724 Author: Vladimir Oltean Date: Fri Sep 17 16:34:33 2021 +0300 net: dsa: be compatible with masters which unregister on shutdown Lino reports that on his system with bcmgenet as DSA master and KSZ9897 as a switch, rebooting or shutting down never works properly. What does the bcmgenet driver have special to trigger this, that other DSA masters do not? It has an implementation of ->shutdown which simply calls its ->remove implementation. Otherwise said, it unregisters its network interface on shutdown. This message can be seen in a loop, and it hangs the reboot process there: unregister_netdevice: waiting for eth0 to become free. Usage count = 3 So why 3? A usage count of 1 is normal for a registered network interface, and any virtual interface which links itself as an upper of that will increment it via dev_hold. In the case of DSA, this is the call path: dsa_slave_create -> netdev_upper_dev_link -> __netdev_upper_dev_link -> __netdev_adjacent_dev_insert -> dev_hold So a DSA switch with 3 interfaces will result in a usage count elevated by two, and netdev_wait_allrefs will wait until they have gone away. Other stacked interfaces, like VLAN, watch NETDEV_UNREGISTER events and delete themselves, but DSA cannot just vanish and go poof, at most it can unbind itself from the switch devices, but that must happen strictly earlier compared to when the DSA master unregisters its net_device, so reacting on the NETDEV_UNREGISTER event is way too late. It seems that it is a pretty established pattern to have a driver's ->shutdown hook redirect to its ->remove hook, so the same code is executed regardless of whether the driver is unbound from the device, or the system is just shutting down. As Florian puts it, it is quite a big hammer for bcmgenet to unregister its net_device during shutdown, but having a common code path with the driver unbind helps ensure it is well tested. So DSA, for better or for worse, has to live with that and engage in an arms race of implementing the ->shutdown hook too, from all individual drivers, and do something sane when paired with masters that unregister their net_device there. The only sane thing to do, of course, is to unlink from the master. However, complications arise really quickly. The pattern of redirecting ->shutdown to ->remove is not unique to bcmgenet or even to net_device drivers. In fact, SPI controllers do it too (see dspi_shutdown -> dspi_remove), and presumably, I2C controllers and MDIO controllers do it too (this is something I have not researched too deeply, but even if this is not the case today, it is certainly plausible to happen in the future, and must be taken into consideration). Since DSA switches might be SPI devices, I2C devices, MDIO devices, the insane implication is that for the exact same DSA switch device, we might have both ->shutdown and ->remove getting called. So we need to do something with that insane environment. The pattern I've come up with is "if this, then not that", so if either ->shutdown or ->remove gets called, we set the device's drvdata to NULL, and in the other hook, we check whether the drvdata is NULL and just do nothing. This is probably not necessary for platform devices, just for devices on buses, but I would really insist for consistency among drivers, because when code is copy-pasted, it is not always copy-pasted from the best sources. So depending on whether the DSA switch's ->remove or ->shutdown will get called first, we cannot really guarantee even for the same driver if rebooting will result in the same code path on all platforms. But nonetheless, we need to do something minimally reasonable on ->shutdown too to fix the bug. Of course, the ->remove will do more (a full teardown of the tree, with all data structures freed, and this is why the bug was not caught for so long). The new ->shutdown method is kept separate from dsa_unregister_switch not because we couldn't have unregistered the switch, but simply in the interest of doing something quick and to the point. The big question is: does the DSA switch's ->shutdown get called earlier than the DSA master's ->shutdown? If not, there is still a risk that we might still trigger the WARN_ON in unregister_netdevice that says we are attempting to unregister a net_device which has uppers. That's no good. Although the reference to the master net_device won't physically go away even if DSA's ->shutdown comes afterwards, remember we have a dev_hold on it. The answer to that question lies in this comment above device_link_add: * A side effect of the link creation is re-ordering of dpm_list and the * devices_kset list by moving the consumer device and all devices depending * on it to the ends of these lists (that does not happen to devices that have * not been registered when this function is called). so the fact that DSA uses device_link_add towards its master is not exactly for nothing. device_shutdown() walks devices_kset from the back, so this is our guarantee that DSA's shutdown happens before the master's shutdown. Fixes: 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings") Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ Reported-by: Lino Sanfilippo Signed-off-by: Vladimir Oltean Tested-by: Andrew Lunn Signed-off-by: David S. Miller commit cf9579976f724ad517cc15b7caadea728c7e245c Author: Vladimir Oltean Date: Fri Sep 17 16:34:32 2021 +0300 net: mdio: introduce a shutdown method to mdio device drivers MDIO-attached devices might have interrupts and other things that might need quiesced when we kexec into a new kernel. Things are even more creepy when those interrupt lines are shared, and in that case it is absolutely mandatory to disable all interrupt sources. Moreover, MDIO devices might be DSA switches, and DSA needs its own shutdown method to unlink from the DSA master, which is a new requirement that appeared after commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"). So introduce a ->shutdown method in the MDIO device driver structure. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f0c15b360fb65ee39849afe987c16eb3d0175d0d Author: Sean Young Date: Tue Sep 14 16:57:46 2021 +0200 media: ir_toy: prevent device from hanging during transmit If the IR Toy is receiving IR while a transmit is done, it may end up hanging. We can prevent this from happening by re-entering sample mode just before issuing the transmit command. Link: https://github.com/bengtmartensson/HarcHardware/discussions/25 Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 0664684e1ebd7875e120d0cecd525bac4805f8ed Author: Nathan Chancellor Date: Thu Sep 16 11:40:17 2021 -0700 kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS Similar to commit 589834b3a009 ("kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS"). Clang ignores certain GCC flags that it has not implemented, only emitting a warning: $ echo | clang -fsyntax-only -falign-jumps -x c - clang-14: warning: optimization flag '-falign-jumps' is not supported [-Wignored-optimization-argument] When one of these flags gets added to KBUILD_CFLAGS unconditionally, all subsequent cc-{disable-warning,option} calls fail because -Werror was added to these invocations to turn the above warning and the equivalent -W flag warning into errors. To catch the presence of these flags earlier, turn -Wignored-optimization-argument into an error so that the flags can either be implemented or ignored via cc-option and there are no more weird errors. Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 7fa6a2746616c8de4c40b748c2bb0656e00624ff Author: Nathan Chancellor Date: Thu Sep 16 11:40:16 2021 -0700 x86/build: Do not add -falign flags unconditionally for clang clang does not support -falign-jumps and only recently gained support for -falign-loops. When one of the configuration options that adds these flags is enabled, clang warns and all cc-{disable-warning,option} that follow fail because -Werror gets added to test for the presence of this warning: clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument] To resolve this, add a couple of cc-option calls when building with clang; gcc has supported these options since 3.2 so there is no point in testing for their support. -falign-functions was implemented in clang-7, -falign-loops was implemented in clang-14, and -falign-jumps has not been implemented yet. Link: https://lore.kernel.org/r/YSQE2f5teuvKLkON@Ryzen-9-3900X.localdomain/ Link: https://lore.kernel.org/r/20210824022640.2170859-2-nathan@kernel.org/ Reported-by: kernel test robot Reviewed-by: Nick Desaulniers Acked-by: Borislav Petkov Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 7c80144626db460bc3969027810a540741865fb1 Author: Ramji Jiyani Date: Thu Sep 16 09:21:22 2021 +0000 kbuild: Fix comment typo in scripts/Makefile.modpost Change comment "create one .mod.c file pr. module" to "create one .mod.c file per module" Signed-off-by: Ramji Jiyani Signed-off-by: Masahiro Yamada commit 4e70b646bae578bb51c89204b5b81ef499436482 Author: Geert Uytterhoeven Date: Thu Sep 16 10:43:53 2021 +0200 sh: Add missing FORCE prerequisites in Makefile make: arch/sh/boot/Makefile:87: FORCE prerequisite is missing Add the missing FORCE prerequisites for all build targets identified by "make help". Fixes: e1f86d7b4b2a5213 ("kbuild: warn if FORCE is missing for if_changed(_dep,_rule) and filechk") Signed-off-by: Geert Uytterhoeven Signed-off-by: Masahiro Yamada commit ec783c7cb2495c5a3b8ca10db8056d43c528f940 Author: Kortan Date: Wed Sep 8 11:28:48 2021 +0800 gen_compile_commands: fix missing 'sys' package We need to import the 'sys' package since the script has called sys.exit() method. Fixes: 6ad7cbc01527 ("Makefile: Add clang-tidy and static analyzer support to makefile") Signed-off-by: Kortan Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit aa0f5ea12e477b2940a57fcda4908627e0beed0f Author: Ariel Marcovitch Date: Wed Sep 1 19:49:52 2021 +0300 checkkconfigsymbols.py: Remove skipping of help lines in parse_kconfig_file When parsing Kconfig files to find symbol definitions and references, lines after a 'help' line are skipped until a new config definition starts. However, Kconfig statements can actually be after a help section, as long as these have shallower indentation. These are skipped by the parser. This means that symbols referenced in this kind of statements are ignored by this function and thus are not considered undefined references in case the symbol is not defined. Remove the 'skip' logic entirely, as it is not needed if we just use the STMT regex to find the end of help lines. However, this means that keywords that appear as part of the help message (i.e. with the same indentation as the help lines) it will be considered as a reference/definition. This can happen now as well, but only with REGEX_KCONFIG_DEF lines. Also, the keyword must have a SYMBOL after it, which probably means that someone referenced a config in the help so it seems like a bonus :) The real solution is to keep track of the indentation when a the first help line in encountered and then handle DEF and STMT lines only if the indentation is shallower. Signed-off-by: Ariel Marcovitch Signed-off-by: Masahiro Yamada commit d62d5aed3354ae57d57fae1e59948913f360d4eb Author: Ariel Marcovitch Date: Wed Sep 1 17:52:12 2021 +0300 checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit As opposed to the --diff option, --commit can get ref names instead of commit hashes. When using the --commit option, the script resets the working directory to the commit before the given ref, by adding '~' to the end of the ref. However, the 'HEAD' ref is relative, and so when the working directory is reset to 'HEAD~', 'HEAD' points to what was 'HEAD~'. Then when the script resets to 'HEAD' it actually stays in the same commit. In this case, the script won't report any cases because there is no diff between the cases of the two refs. Prevent the user from using HEAD refs. A better solution might be to resolve the refs before doing the reset, but for now just disallow such refs. Signed-off-by: Ariel Marcovitch Signed-off-by: Masahiro Yamada commit d4d016caa4b85b9aa98d7ec8c84e928621a614bc Author: Linus Torvalds Date: Sat Sep 18 14:45:48 2021 -0700 alpha: move __udiv_qrnnd library function to arch/alpha/lib/ We already had the implementation for __udiv_qrnnd (unsigned divide for multi-precision arithmetic) as part of the alpha math emulation code. But you can disable the math emulation code - even if you shouldn't - and then the MPI code that actually wants this functionality (and is needed by various crypto functions) will fail to build. So move the extended-precision divide code to be a regular library function, just like all the regular division code is. That way ie is available regardless of math-emulation. Signed-off-by: Linus Torvalds commit ab41f75ee6a06fa9b947a59c8f9de92370463e40 Author: Linus Torvalds Date: Sat Sep 18 14:12:39 2021 -0700 alpha: mark 'Jensen' platform as no longer broken Ok, it almost certainly is still broken on actual hardware, but the immediate reason for it having been marked BROKEN was a build error that is fixed by just making sure the low-level IO header file is included sufficiently early that the __EXTERN_INLINE hackery takes effect. This was marked broken back in 2017 by commit 1883c9f49d02 ("alpha: mark jensen as broken"), but Ulrich Teichert made me look at it as part of my cross-build work to make sure -Werror actually does the right thing. There are lots of alpha configurations that do not build cleanly, but now it's no longer because Jensen wouldn't be buildable. That said, because the Jensen platform doesn't force PCI to be enabled (Jensen only had EISA), it ends up being somewhat interesting as a source of odd configs. Reported-by: Ulrich Teichert Signed-off-by: Linus Torvalds commit 219d720e6df71c2607d7120d6b9281614863e5b1 Author: Andrii Nakryiko Date: Tue Sep 14 10:00:04 2021 -0700 perf bpf: Ignore deprecation warning when using libbpf's btf__get_from_id() Perf code re-implements libbpf's btf__load_from_kernel_by_id() API as a weak function, presumably to dynamically link against old version of libbpf shared library. Unfortunately this causes compilation warning when perf is compiled against libbpf v0.6+. For now, just ignore deprecation warning, but there might be a better solution, depending on perf's needs. Signed-off-by: Andrii Nakryiko Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: kernel-team@fb.com LPU-Reference: 20210914170004.4185659-1-andrii@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit aba5daeb645181ee5a046bc00c231fd045882aaa Author: Ian Rogers Date: Fri Sep 17 22:44:40 2021 -0700 libperf evsel: Make use of FD robust. FD uses xyarray__entry that may return NULL if an index is out of bounds. If NULL is returned then a segv happens as FD unconditionally dereferences the pointer. This was happening in a case of with perf iostat as shown below. The fix is to make FD an "int*" rather than an int and handle the NULL case as either invalid input or a closed fd. $ sudo gdb --args perf stat --iostat list ... Breakpoint 1, perf_evsel__alloc_fd (evsel=0x5555560951a0, ncpus=1, nthreads=1) at evsel.c:50 50 { (gdb) bt #0 perf_evsel__alloc_fd (evsel=0x5555560951a0, ncpus=1, nthreads=1) at evsel.c:50 #1 0x000055555585c188 in evsel__open_cpu (evsel=0x5555560951a0, cpus=0x555556093410, threads=0x555556086fb0, start_cpu=0, end_cpu=1) at util/evsel.c:1792 #2 0x000055555585cfb2 in evsel__open (evsel=0x5555560951a0, cpus=0x0, threads=0x555556086fb0) at util/evsel.c:2045 #3 0x000055555585d0db in evsel__open_per_thread (evsel=0x5555560951a0, threads=0x555556086fb0) at util/evsel.c:2065 #4 0x00005555558ece64 in create_perf_stat_counter (evsel=0x5555560951a0, config=0x555555c34700 , target=0x555555c2f1c0 , cpu=0) at util/stat.c:590 #5 0x000055555578e927 in __run_perf_stat (argc=1, argv=0x7fffffffe4a0, run_idx=0) at builtin-stat.c:833 #6 0x000055555578f3c6 in run_perf_stat (argc=1, argv=0x7fffffffe4a0, run_idx=0) at builtin-stat.c:1048 #7 0x0000555555792ee5 in cmd_stat (argc=1, argv=0x7fffffffe4a0) at builtin-stat.c:2534 #8 0x0000555555835ed3 in run_builtin (p=0x555555c3f540 , argc=3, argv=0x7fffffffe4a0) at perf.c:313 #9 0x0000555555836154 in handle_internal_command (argc=3, argv=0x7fffffffe4a0) at perf.c:365 #10 0x000055555583629f in run_argv (argcp=0x7fffffffe2ec, argv=0x7fffffffe2e0) at perf.c:409 #11 0x0000555555836692 in main (argc=3, argv=0x7fffffffe4a0) at perf.c:539 ... (gdb) c Continuing. Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (uncore_iio_0/event=0x83,umask=0x04,ch_mask=0xF,fc_mask=0x07/). /bin/dmesg | grep -i perf may provide additional information. Program received signal SIGSEGV, Segmentation fault. 0x00005555559b03ea in perf_evsel__close_fd_cpu (evsel=0x5555560951a0, cpu=1) at evsel.c:166 166 if (FD(evsel, cpu, thread) >= 0) v3. fixes a bug in perf_evsel__run_ioctl where the sense of a branch was backward. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210918054440.2350466-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 57f0ff059e3daa4e70a811cb1d31a49968262d20 Author: Michael Petlan Date: Mon Jul 19 16:53:32 2021 +0200 perf machine: Initialize srcline string member in add_location struct It's later supposed to be either a correct address or NULL. Without the initialization, it may contain an undefined value which results in the following segmentation fault: # perf top --sort comm -g --ignore-callees=do_idle terminates with: #0 0x00007ffff56b7685 in __strlen_avx2 () from /lib64/libc.so.6 #1 0x00007ffff55e3802 in strdup () from /lib64/libc.so.6 #2 0x00005555558cb139 in hist_entry__init (callchain_size=, sample_self=true, template=0x7fffde7fb110, he=0x7fffd801c250) at util/hist.c:489 #3 hist_entry__new (template=template@entry=0x7fffde7fb110, sample_self=sample_self@entry=true) at util/hist.c:564 #4 0x00005555558cb4ba in hists__findnew_entry (hists=hists@entry=0x5555561d9e38, entry=entry@entry=0x7fffde7fb110, al=al@entry=0x7fffde7fb420, sample_self=sample_self@entry=true) at util/hist.c:657 #5 0x00005555558cba1b in __hists__add_entry (hists=hists@entry=0x5555561d9e38, al=0x7fffde7fb420, sym_parent=, bi=bi@entry=0x0, mi=mi@entry=0x0, sample=sample@entry=0x7fffde7fb4b0, sample_self=true, ops=0x0, block_info=0x0) at util/hist.c:288 #6 0x00005555558cbb70 in hists__add_entry (sample_self=true, sample=0x7fffde7fb4b0, mi=0x0, bi=0x0, sym_parent=, al=, hists=0x5555561d9e38) at util/hist.c:1056 #7 iter_add_single_cumulative_entry (iter=0x7fffde7fb460, al=) at util/hist.c:1056 #8 0x00005555558cc8a4 in hist_entry_iter__add (iter=iter@entry=0x7fffde7fb460, al=al@entry=0x7fffde7fb420, max_stack_depth=, arg=arg@entry=0x7fffffff7db0) at util/hist.c:1231 #9 0x00005555557cdc9a in perf_event__process_sample (machine=, sample=0x7fffde7fb4b0, evsel=, event=, tool=0x7fffffff7db0) at builtin-top.c:842 #10 deliver_event (qe=, qevent=) at builtin-top.c:1202 #11 0x00005555558a9318 in do_flush (show_progress=false, oe=0x7fffffff80e0) at util/ordered-events.c:244 #12 __ordered_events__flush (oe=oe@entry=0x7fffffff80e0, how=how@entry=OE_FLUSH__TOP, timestamp=timestamp@entry=0) at util/ordered-events.c:323 #13 0x00005555558a9789 in __ordered_events__flush (timestamp=, how=, oe=) at util/ordered-events.c:339 #14 ordered_events__flush (how=OE_FLUSH__TOP, oe=0x7fffffff80e0) at util/ordered-events.c:341 #15 ordered_events__flush (oe=oe@entry=0x7fffffff80e0, how=how@entry=OE_FLUSH__TOP) at util/ordered-events.c:339 #16 0x00005555557cd631 in process_thread (arg=0x7fffffff7db0) at builtin-top.c:1114 #17 0x00007ffff7bb817a in start_thread () from /lib64/libpthread.so.0 #18 0x00007ffff5656dc3 in clone () from /lib64/libc.so.6 If you look at the frame #2, the code is: 488 if (he->srcline) { 489 he->srcline = strdup(he->srcline); 490 if (he->srcline == NULL) 491 goto err_rawdata; 492 } If he->srcline is not NULL (it is not NULL if it is uninitialized rubbish), it gets strdupped and strdupping a rubbish random string causes the problem. Also, if you look at the commit 1fb7d06a509e, it adds the srcline property into the struct, but not initializing it everywhere needed. Committer notes: Now I see, when using --ignore-callees=do_idle we end up here at line 2189 in add_callchain_ip(): 2181 if (al.sym != NULL) { 2182 if (perf_hpp_list.parent && !*parent && 2183 symbol__match_regex(al.sym, &parent_regex)) 2184 *parent = al.sym; 2185 else if (have_ignore_callees && root_al && 2186 symbol__match_regex(al.sym, &ignore_callees_regex)) { 2187 /* Treat this symbol as the root, 2188 forgetting its callees. */ 2189 *root_al = al; 2190 callchain_cursor_reset(cursor); 2191 } 2192 } And the al that doesn't have the ->srcline field initialized will be copied to the root_al, so then, back to: 1211 int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, 1212 int max_stack_depth, void *arg) 1213 { 1214 int err, err2; 1215 struct map *alm = NULL; 1216 1217 if (al) 1218 alm = map__get(al->map); 1219 1220 err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent, 1221 iter->evsel, al, max_stack_depth); 1222 if (err) { 1223 map__put(alm); 1224 return err; 1225 } 1226 1227 err = iter->ops->prepare_entry(iter, al); 1228 if (err) 1229 goto out; 1230 1231 err = iter->ops->add_single_entry(iter, al); 1232 if (err) 1233 goto out; 1234 That al at line 1221 is what hist_entry_iter__add() (called from sample__resolve_callchain()) saw as 'root_al', and then: iter->ops->add_single_entry(iter, al); will go on with al->srcline with a bogus value, I'll add the above sequence to the cset and apply, thanks! Signed-off-by: Michael Petlan CC: Milian Wolff Cc: Jiri Olsa Fixes: 1fb7d06a509e ("perf report Use srcline from callchain for hist entries") Link: https //lore.kernel.org/r/20210719145332.29747-1-mpetlan@redhat.com Reported-by: Juri Lelli Signed-off-by: Arnaldo Carvalho de Melo commit ff6f41fbcee9830f88413cbb08dc45e543243b55 Author: Adrian Hunter Date: Sat Sep 11 16:30:53 2021 +0300 perf script: Fix ip display when type != attr->type set_print_ip_opts() was not being called when type != attr->type because there is not a one-to-one relationship between output types and attr->type. That resulted in ip not printing. The attr_type() function is removed, and the match of attr->type to output type is corrected. Example on ADL using taskset to select an atom cpu: # perf record -e cpu_atom/cpu-cycles/ taskset 0x1000 uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.003 MB perf.data (7 samples) ] Before: # perf script | head taskset 428 [-01] 10394.179041: 1 cpu_atom/cpu-cycles/: taskset 428 [-01] 10394.179043: 1 cpu_atom/cpu-cycles/: taskset 428 [-01] 10394.179044: 11 cpu_atom/cpu-cycles/: taskset 428 [-01] 10394.179045: 407 cpu_atom/cpu-cycles/: taskset 428 [-01] 10394.179046: 16789 cpu_atom/cpu-cycles/: taskset 428 [-01] 10394.179052: 676300 cpu_atom/cpu-cycles/: uname 428 [-01] 10394.179278: 4079859 cpu_atom/cpu-cycles/: After: # perf script | head taskset 428 10394.179041: 1 cpu_atom/cpu-cycles/: ffffffff95a0bb97 __intel_pmu_enable_all.constprop.48+0x47 ([kernel.kallsyms]) taskset 428 10394.179043: 1 cpu_atom/cpu-cycles/: ffffffff95a0bb97 __intel_pmu_enable_all.constprop.48+0x47 ([kernel.kallsyms]) taskset 428 10394.179044: 11 cpu_atom/cpu-cycles/: ffffffff95a0bb97 __intel_pmu_enable_all.constprop.48+0x47 ([kernel.kallsyms]) taskset 428 10394.179045: 407 cpu_atom/cpu-cycles/: ffffffff95a0bb97 __intel_pmu_enable_all.constprop.48+0x47 ([kernel.kallsyms]) taskset 428 10394.179046: 16789 cpu_atom/cpu-cycles/: ffffffff95a0bb97 __intel_pmu_enable_all.constprop.48+0x47 ([kernel.kallsyms]) taskset 428 10394.179052: 676300 cpu_atom/cpu-cycles/: 7f829ef73800 cfree+0x0 (/lib/libc-2.32.so) uname 428 10394.179278: 4079859 cpu_atom/cpu-cycles/: ffffffff95bae912 vma_interval_tree_remove+0x1f2 ([kernel.kallsyms]) Signed-off-by: Adrian Hunter Reviewed-by: Kan Liang Cc: Jin Yao Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20210911133053.15682-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7efbcc8c075c5e9ef69b2379b75b58a699f23eb3 Author: Ravi Bangoria Date: Sat Sep 11 10:08:53 2021 +0530 perf annotate: Fix fused instr logic for assembly functions Some x86 microarchitectures fuse a subset of cmp/test/ALU instructions with branch instructions, and thus perf annotate highlight such valid pairs as fused. When annotated with source, perf uses struct disasm_line to contain either source or instruction line from objdump output. Usually, a C statement generates multiple instructions which include such cmp/test/ALU + branch instruction pairs. But in case of assembly function, each individual assembly source line generate one instruction. The 'perf annotate' instruction fusion logic assumes the previous disasm_line as the previous instruction line, which is wrong because, for assembly function, previous disasm_line contains source line. And thus perf fails to highlight valid fused instruction pairs for assembly functions. Fix it by searching backward until we find an instruction line and consider that disasm_line as fused with current branch instruction. Before: │ cmpq %rcx, RIP+8(%rsp) 0.00 │ cmp %rcx,0x88(%rsp) │ je .Lerror_bad_iret <--- Source line 0.14 │ ┌──je b4 <--- Instruction line │ │movl %ecx, %eax After: │ cmpq %rcx, RIP+8(%rsp) 0.00 │ ┌──cmp %rcx,0x88(%rsp) │ │je .Lerror_bad_iret 0.14 │ ├──je b4 │ │movl %ecx, %eax Reviewed-by: Jin Yao Signed-off-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Link: https //lore.kernel.org/r/20210911043854.8373-1-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 93ff9f13be91c5f36bb3e5d23237702155deae74 Merge: d1a88690cea38 f5711f9df9242 Author: Linus Torvalds Date: Sat Sep 18 12:46:14 2021 -0700 Merge tag 's390-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Fix potential out-of-range access during secure boot facility detection. - Fully validate the VMA before calling follow_pte() in pci code. - Remove arch specific WARN_DYNAMIC_STACK config option. - Fix zcrypto kernel doc comments. - Update defconfigs. * tag 's390-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: remove WARN_DYNAMIC_STACK s390/ap: fix kernel doc comments s390: update defconfigs s390/sclp: fix Secure-IPL facility detection s390/pci_mmio: fully validate the VMA before calling follow_pte() commit d1a88690cea3872f83a1004b1a08a39879715fa1 Merge: cd395d529faf4 55c21d57eafb7 Author: Linus Torvalds Date: Sat Sep 18 12:40:55 2021 -0700 Merge tag 'devicetree-fixes-for-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Revert fw_devlink tracking 'phy-handle' links. This broke at least a few platforms. A better solution is being worked on. - Add Samsung UFS binding which fell thru the cracks - Doc reference fixes from Mauro - Fix for restricted DMA error handling * tag 'devicetree-fixes-for-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: arm: Fix Toradex compatible typo of: restricted dma: Fix condition for rmem init dt-bindings: arm: mediatek: mmsys: update mediatek,mmsys.yaml reference dt-bindings: net: dsa: sja1105: update nxp,sja1105.yaml reference dt-bindings: ufs: Add bindings for Samsung ufs host Revert "of: property: fw_devlink: Add support for "phy-handle" property" commit cd395d529faf46bd7fd799852a659ca1bd650a27 Author: Linus Torvalds Date: Sat Sep 18 11:15:01 2021 -0700 tgafb: clarify dependencies The TGA boards were based on the DECchip 21030 PCI graphics accelerator used mainly for alpha, and existed in a TURBOchannel (TC) version for the DECstation (MIPS) workstations. However, the config option for the TGA code is a bit confused, and says depends on FB && (ALPHA || TC) because people didn't really want to enable the option for random PCI environments, so the "ALPHA" stands in for that case (while the TC case is then the MIPS DECstation case). So that config dependency is kind of a mixture of architecture and bus choices. But it's incorrect, in that there were non-PCI-based alpha hardware, and then the driver just causes warnings: drivers/video/fbdev/tgafb.c:1532:13: error: ‘tgafb_unregister’ defined but not used [-Werror=unused-function] 1532 | static void tgafb_unregister(struct device *dev) | ^~~~~~~~~~~~~~~~ drivers/video/fbdev/tgafb.c:1387:12: error: ‘tgafb_register’ defined but not used [-Werror=unused-function] 1387 | static int tgafb_register(struct device *dev) | ^~~~~~~~~~~~~~ so let's make the config option dependencies a bit more explict: depends on FB depends on PCI || TC depends on ALPHA || TC where that first "FB" is the software configuration dependency, the second "PCI || TC" is the hardware bus dependency, while that final "ALPHA || TC" dependency is the "don't bother asking except for these situations. We could make that third case have "COMPILE_TEST" as an option, and mark the register/unregister functions as __maybe_unused, but I'm not sure it's really worth it. Signed-off-by: Linus Torvalds commit 8167c9a375ccceed19048ad9d68cb2d02ed276e0 Author: Dan Carpenter Date: Thu Sep 9 12:13:36 2021 +0300 iio: ssp_sensors: add more range checking in ssp_parse_dataframe() The "idx" is validated at the start of the loop but it gets incremented during the iteration so it needs to be checked again. Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210909091336.GA26312@kili Cc: Signed-off-by: Jonathan Cameron commit 4170d3dd1467e9d78cb9af374b19357dc324b328 Author: Dan Carpenter Date: Tue Sep 14 13:53:33 2021 +0300 iio: ssp_sensors: fix error code in ssp_print_mcu_debug() The ssp_print_mcu_debug() function should return negative error codes on error. Returning "length" is meaningless. This change does not affect runtime because the callers only care about zero/non-zero. Reported-by: Jonathan Cameron Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210914105333.GA11657@kili Cc: Signed-off-by: Jonathan Cameron commit cc9d3aaa5331577a8658e25473a27ba5949023d8 Author: Linus Torvalds Date: Sat Sep 18 10:57:10 2021 -0700 alpha: make 'Jensen' IO functions build again The Jensen IO functions are overly copmplicated because some of the IO addresses refer to special 'local IO' ports, and they get accessed differently. That then makes gcc not actually inline them, and since they were marked "extern inline" when included through the regular path, and then only marked "inline" when included from sys_jensen.c, you never necessarily got a body for the IO functions at all. The intent of the sys_jensen.c code is to actually get the non-inlined copy generated, so remove the 'inline' from the magic macro that is supposed to sort this all out. Also, do not mix 'extern inline' functions (that may or may not be inlined and will not generate a function body if they are not) with 'static inline' (that _will_ generate a function body when not inlined). Because gcc will complain about this situation: error: ‘jensen_bus_outb’ is static but used in inline function ‘jensen_outb’ which is not static because gcc basically doesn't know whether to generate a body for that static inline function or not for that call site. So make all of these use that __EXTERN_INLINE marker. Gcc will generally not inline these things on use, and then generate the function body out-of-line in sys_jensen.c. This makes the core IO functions build for the alpha Jensen config. Not that the rest then builds, because it turns out Jensen also doesn't enable PCI, which then makes other drievrs very unhappy, but that's a separate issue. Signed-off-by: Linus Torvalds commit efafec27c5658ed987e720130772f8933c685e87 Author: Linus Torvalds Date: Sat Sep 18 10:05:06 2021 -0700 spi: Fix tegra20 build with CONFIG_PM=n Without CONFIG_PM enabled, the SET_RUNTIME_PM_OPS() macro ends up being empty, and the only use of tegra_slink_runtime_{resume,suspend} goes away, resulting in drivers/spi/spi-tegra20-slink.c:1200:12: error: ‘tegra_slink_runtime_resume’ defined but not used [-Werror=unused-function] 1200 | static int tegra_slink_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/spi/spi-tegra20-slink.c:1188:12: error: ‘tegra_slink_runtime_suspend’ defined but not used [-Werror=unused-function] 1188 | static int tegra_slink_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ mark the functions __maybe_unused to make the build happy. This hits the alpha allmodconfig build (and others). Reported-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 6d56262c3d224699b29b9bb6b4ace8bab7d692c2 Author: Namjae Jeon Date: Sat Sep 18 18:45:12 2021 +0900 ksmbd: add validation for FILE_FULL_EA_INFORMATION of smb2_get_info Add validation to check whether req->InputBufferLength is smaller than smb2_ea_info_req structure size. Cc: Ronnie Sahlberg Cc: Ralph Böhme Cc: Steve French Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 59dd178e1d7cb6cac03b32aba7ed9bbce6761b6f Author: Heiko Stuebner Date: Tue Sep 14 00:49:26 2021 +0200 gpio/rockchip: fetch deferred output settings on probe Fetch the output settings the pinctrl driver may have created for pinctrl hogs and set the relevant pins as requested. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210913224926.1260726-5-heiko@sntech.de Signed-off-by: Linus Walleij commit e7165b1dff06b6e4373ab7758b21f3d9ed8a64ca Author: Heiko Stuebner Date: Tue Sep 14 00:49:25 2021 +0200 pinctrl/rockchip: add a queue for deferred pin output settings on probe The separation of pinctrl and gpio drivers created a tiny window where a pinconfig setting might produce a null-pointer dereference. The affected device were rk3288-veyron devices in this case. Pinctrl-hogs are claimed when the pinctrl driver is registered, at which point their pinconfig settings will be applied. At this time the now separate gpio devices will not have been created yet and the matching driver won't have probed yet, making the gpio->foo() call run into a null-ptr. As probing is not really guaranteed to have been completed at a specific time, introduce a queue that can hold the output settings until the gpio driver has probed and will (in a separate patch) fetch the elements of the list. We expect the gpio driver to empty the list, but will nevertheless empty it ourself on remove if that didn't happen. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210913224926.1260726-4-heiko@sntech.de Signed-off-by: Linus Walleij commit f58eae6c5fa882d6d0a6b7587a099602a59d57b5 Author: Hyunchul Lee Date: Fri Sep 17 22:14:08 2021 +0900 ksmbd: prevent out of share access Because of .., files outside the share directory could be accessed. To prevent this, normalize the given path and remove all . and .. components. In addition to the usual large set of regression tests (smbtorture and xfstests), ran various tests on this to specifically check path name validation including libsmb2 tests to verify path normalization: ./examples/smb2-ls-async smb://172.30.1.15/homes2/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/..bar/ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar.. ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar../../../../ Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 35866f3f779aef5e7ba84e4d1023fe2e2a0e219e Author: Rohith Surabattula Date: Fri Sep 17 16:50:40 2021 -0500 cifs: Not to defer close on file when lock is set Close file immediately when lock is set. Cc: stable@vger.kernel.org # 5.13+ Signed-off-by: Rohith Surabattula Signed-off-by: Steve French commit 71826b068884050d5fdd37fda857ba1539c513d3 Author: Rohith Surabattula Date: Fri Sep 17 17:29:42 2021 +0000 cifs: Fix soft lockup during fsstress Below traces are observed during fsstress and system got hung. [ 130.698396] watchdog: BUG: soft lockup - CPU#6 stuck for 26s! Cc: stable@vger.kernel.org # 5.13+ Signed-off-by: Rohith Surabattula Signed-off-by: Steve French commit e3fc065682ebbbd15b0ce0036800f4acbf765d46 Author: Rohith Surabattula Date: Fri Sep 17 18:14:26 2021 +0000 cifs: Deferred close performance improvements During unlink/rename instead of closing all the deferred handles under tcon, close only handles under the requested dentry. Signed-off-by: Rohith Surabattula Signed-off-by: Steve French commit 55c21d57eafb7b379bb7b3e93baf9ca2695895b0 Author: David Heidelberg Date: Sun Sep 12 18:51:20 2021 +0200 dt-bindings: arm: Fix Toradex compatible typo Fix board compatible typo reported by dtbs_check. Fixes: f4d1577e9bc6 ("dt-bindings: arm: Convert Tegra board/soc bindings to json-schema") Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210912165120.188490-1-david@ixit.cz Signed-off-by: Rob Herring commit 31c8025fac3d8bbff7ce4602338d88efc2d7972c Author: David Brazdil Date: Fri Sep 17 14:14:23 2021 +0100 of: restricted dma: Fix condition for rmem init of_dma_set_restricted_buffer fails to handle negative return values from of_property_count_elems_of_size, e.g. when the property does not exist. This results in an attempt to assign a non-existent reserved memory region to the device and a warning being printed. Fix the condition to take negative values into account. Fixes: f3cfd136aef0 ("of: restricted dma: Don't fail device probe on rmem init failure") Cc: Will Deacon Signed-off-by: David Brazdil Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210917131423.2760155-1-dbrazdil@google.com Signed-off-by: Rob Herring commit 4357f03d6611753936e4d52fc251b54a6afb1b54 Merge: b9b11b133b4a0 cdef119660889 Author: Linus Torvalds Date: Fri Sep 17 12:05:04 2021 -0700 Merge tag 'pm-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix two cpufreq issues, one in the intel_pstate driver and one in the core. Specifics: - Prevent intel_pstate from avoiding to use HWP, even if instructed to do so via the kernel command line, when HWP has been enabled already by the platform firmware (Doug Smythies). - Prevent use-after-free from occurring in the schedutil cpufreq governor on exit by fixing a core helper function that attempts to access memory associated with a kobject after calling kobject_put() on it (James Morse)" * tag 'pm-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory cpufreq: intel_pstate: Override parameters if HWP forced by BIOS commit b9b11b133b4a0b4f8dc36ec04d81d630f763eaa6 Merge: 7639afad8b8d6 59583f7476640 Author: Linus Torvalds Date: Fri Sep 17 11:54:48 2021 -0700 Merge tag 'dma-mapping-5.15-1' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - page align size in sparc32 arch_dma_alloc (Andreas Larsson) - tone down a new dma-debug message (Hamza Mahfooz) - fix the kerneldoc for dma_map_sg_attrs (me) * tag 'dma-mapping-5.15-1' of git://git.infradead.org/users/hch/dma-mapping: sparc32: page align size in arch_dma_alloc dma-debug: prevent an error message from causing runtime problems dma-mapping: fix the kerneldoc for dma_map_sg_attrs commit 7639afad8b8d6671a645fb3d6e6fd1432dcdf6ac Merge: ddf21bd8ab984 e042a4533fc34 Author: Linus Torvalds Date: Fri Sep 17 11:42:31 2021 -0700 Merge tag 'pci-v5.15-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fixes from Bjorn Helgaas: - Defer VPD sizing until we actually need the contents; fixes a boot-time slowdown reported by Dave Jones (Bjorn Helgaas) - Stop clobbering OF fwnodes when we look for an ACPI fwnode; fixes a virtio-iommu boot regression (Jean-Philippe Brucker) - Add AMD GPU multi-function power dependencies; fixes runtime power management, including GPU resume and temp and fan sensor issues (Evan Quan) - Update VMD maintainer to Nirmal Patel (Jon Derrick) * tag 'pci-v5.15-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: MAINTAINERS: Add Nirmal Patel as VMD maintainer PCI: Add AMD GPU multi-function power dependencies PCI/ACPI: Don't reset a fwnode set by OF PCI/VPD: Defer VPD sizing until first access commit 0619b7901473c380abc05d45cf9c70bee0707db3 Author: Qu Wenruo Date: Thu Sep 16 20:43:29 2021 +0800 btrfs: prevent __btrfs_dump_space_info() to underflow its free space It's not uncommon where __btrfs_dump_space_info() gets called under over-commit situations. In that case free space would underflow as total allocated space is not enough to handle all the over-committed space. Such underflow values can sometimes cause confusion for users enabled enospc_debug mount option, and takes some seconds for developers to convert the underflow value to signed result. Just output the free space as s64 to avoid such problem. Reported-by: Eli V Link: https://lore.kernel.org/linux-btrfs/CAJtFHUSy4zgyhf-4d9T+KdJp9w=UgzC2A0V=VtmaeEpcGgm1-Q@mail.gmail.com/ CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6b225baababf1e3d41a4250e802cbd193e1343fb Author: Filipe Manana Date: Wed Sep 8 19:05:44 2021 +0100 btrfs: fix mount failure due to past and transient device flush error When we get an error flushing one device, during a super block commit, we record the error in the device structure, in the field 'last_flush_error'. This is used to later check if we should error out the super block commit, depending on whether the number of flush errors is greater than or equals to the maximum tolerated device failures for a raid profile. However if we get a transient device flush error, unmount the filesystem and later try to mount it, we can fail the mount because we treat that past error as critical and consider the device is missing. Even if it's very likely that the error will happen again, as it's probably due to a hardware related problem, there may be cases where the error might not happen again. One example is during testing, and a test case like the new generic/648 from fstests always triggers this. The test cases generic/019 and generic/475 also trigger this scenario, but very sporadically. When this happens we get an error like this: $ mount /dev/sdc /mnt mount: /mnt wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error. $ dmesg (...) [12918.886926] BTRFS warning (device sdc): chunk 13631488 missing 1 devices, max tolerance is 0 for writable mount [12918.888293] BTRFS warning (device sdc): writable mount is not allowed due to too many missing devices [12918.890853] BTRFS error (device sdc): open_ctree failed The failure happens because when btrfs_check_rw_degradable() is called at mount time, or at remount from RO to RW time, is sees a non zero value in a device's ->last_flush_error attribute, and therefore considers that the device is 'missing'. Fix this by setting a device's ->last_flush_error to zero when we close a device, making sure the error is not seen on the next mount attempt. We only need to track flush errors during the current mount, so that we never commit a super block if such errors happened. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit acbee9aff8aea4b9b66ab3d5cee6b8dbc153dc38 Author: Filipe Manana Date: Wed Sep 8 16:29:26 2021 +0100 btrfs: fix transaction handle leak after verity rollback failure During a verity rollback, if we fail to update the inode or delete the orphan, we abort the transaction and return without releasing our transaction handle. Fix that by releasing the handle. Fixes: 146054090b0859 ("btrfs: initial fsverity support") Fixes: 705242538ff348 ("btrfs: verity metadata orphan items") Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit bbc9a6eb5eec03dcafee266b19f56295e3b2aa8f Author: Qu Wenruo Date: Tue Aug 17 07:55:40 2021 +0800 btrfs: replace BUG_ON() in btrfs_csum_one_bio() with proper error handling There is a BUG_ON() in btrfs_csum_one_bio() to catch code logic error. It has indeed caught several bugs during subpage development. But the BUG_ON() itself will bring down the whole system which is an overkill. Replace it with a WARN() and exit gracefully, so that it won't crash the whole system while we can still catch the code logic error. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ddf21bd8ab984ccaa924f090fc7f515bb6d51414 Merge: 0bc7eb03cbd3e b66ceaf324b39 Author: Linus Torvalds Date: Fri Sep 17 09:23:44 2021 -0700 Merge tag 'iov_iter.3-5.15-2021-09-17' of git://git.kernel.dk/linux-block Pull io_uring iov_iter retry fixes from Jens Axboe: "This adds a helper to save/restore iov_iter state, and modifies io_uring to use it. After that is done, we can now kill the iter->truncated addition that we added for this release. The io_uring change is being overly cautious with the save/restore/advance, but better safe than sorry and we can always improve that and reduce the overhead if it proves to be of concern. The only case to be worried about in this regard is huge IO, where iteration can take a while to iterate segments. I spent some time writing test cases, and expanded the coverage quite a bit from the last posting of this. liburing carries this regression test case now: https://git.kernel.dk/cgit/liburing/tree/test/file-verify.c which exercises all of this. It now also supports provided buffers, and explicitly tests for end-of-file/device truncation as well. On top of that, Pavel sanitized the IOPOLL retry path to follow the exact same pattern as normal IO" * tag 'iov_iter.3-5.15-2021-09-17' of git://git.kernel.dk/linux-block: io_uring: move iopoll reissue into regular IO path Revert "iov_iter: track truncated size" io_uring: use iov_iter state save/restore helpers iov_iter: add helper to save iov_iter state commit 0bc7eb03cbd3e5d057cbe2ee15ddedf168f25a8d Merge: 36d6753bc205b 5d329e1286b0a Author: Linus Torvalds Date: Fri Sep 17 09:19:59 2021 -0700 Merge tag 'io_uring-5.15-2021-09-17' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Mostly fixes for regressions in this cycle, but also a few fixes that predate this release. The odd one out is a tweak to the direct files added in this release, where attempting to reuse a slot is allowed instead of needing an explicit removal of that slot first. It's a considerable improvement in usability to that API, hence I'm sending it for -rc2. - io-wq race fix and cleanup (Hao) - loop_rw_iter() type fix - SQPOLL max worker race fix - Allow poll arm for O_NONBLOCK files, fixing a case where it's impossible to properly use io_uring if you cannot modify the file flags - Allow direct open to simply reuse a slot, instead of needing it explicitly removed first (Pavel) - Fix a case where we missed signal mask restoring in cqring_wait, if we hit -EFAULT (Xiaoguang)" * tag 'io_uring-5.15-2021-09-17' of git://git.kernel.dk/linux-block: io_uring: allow retry for O_NONBLOCK if async is supported io_uring: auto-removal for direct open/accept io_uring: fix missing sigmask restore in io_cqring_wait() io_uring: pin SQPOLL data before unlocking ring lock io-wq: provide IO_WQ_* constants for IORING_REGISTER_IOWQ_MAX_WORKERS arg items io-wq: fix potential race of acct->nr_workers io-wq: code clean of io_wqe_create_worker() io_uring: ensure symmetry in handling iter types in loop_rw_iter() commit 36d6753bc205b6e8588cb49631642455165333ab Merge: 7f2cd14129f02 858560b27645e Author: Linus Torvalds Date: Fri Sep 17 09:16:59 2021 -0700 Merge tag 'block-5.15-2021-09-17' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - fix ANA state updates when a namespace is not present (Anton Eidelman) - nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show (Dan Carpenter) - avoid race in shutdown namespace removal (Daniel Wagner) - fix io_work priority inversion in nvme-tcp (Keith Busch) - destroy cm id before destroy qp to avoid use after free (Ruozhu Li) - blk-integrity profile registration fixes (Christoph, Lihong) - blk-cgroup UAF fix (Li) - blk-mq tag iterator fix (Ming) - blkcg memory leak fix (Yanfei) * tag 'block-5.15-2021-09-17' of git://git.kernel.dk/linux-block: blk-cgroup: fix UAF by grabbing blkcg lock before destroying blkg pd blkcg: fix memory leak in blk_iolatency_init nvme: remove the call to nvme_update_disk_info in nvme_ns_remove block: flush the integrity workqueue in blk_integrity_unregister block: check if a profile is actually registered in blk_integrity_unregister nvme-tcp: fix io_work priority inversion nvme-rdma: destroy cm id before destroy qp to avoid use after free nvme-multipath: fix ANA state updates when a namespace is not present nvme: avoid race in shutdown namespace removal nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show() blk-mq: avoid to iterate over stale request commit 7f2cd14129f0272a3ae983625a1adf2545bdad52 Merge: c6460daea23dc 9fcb2e93f41c0 Author: Linus Torvalds Date: Fri Sep 17 08:59:27 2021 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes and cleanups from Catalin Marinas: - Fix the memset() size when re-initialising the SVE state. - Mark __stack_chk_guard as __ro_after_init. - Remove duplicate include. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Mark __stack_chk_guard as __ro_after_init arm64/kernel: remove duplicate include in process.c arm64/sve: Use correct size when reinitialising SVE state commit c6460daea23dcd160f2dc497c64b4c882ea1de69 Merge: bdb575f872175 d859ed25b2428 Author: Linus Torvalds Date: Fri Sep 17 08:31:49 2021 -0700 Merge tag 'for-linus-5.15b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - The first hunk of a Xen swiotlb fixup series fixing multiple minor issues and doing some small cleanups - Some further Xen related fixes avoiding WARN() splats when running as Xen guests or dom0 - A Kconfig fix allowing the pvcalls frontend to be built as a module * tag 'for-linus-5.15b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: swiotlb-xen: drop DEFAULT_NSLABS swiotlb-xen: arrange to have buffer info logged swiotlb-xen: drop leftover __ref swiotlb-xen: limit init retries swiotlb-xen: suppress certain init retries swiotlb-xen: maintain slab count properly swiotlb-xen: fix late init retry swiotlb-xen: avoid double free xen/pvcalls: backend can be a module xen: fix usage of pmd_populate in mremap for pv guests xen: reset legacy rtc flag for PV domU PM: base: power: don't try to use non-existing RTC for storing data xen/balloon: use a kernel thread instead a workqueue commit 02579b2ff8b0becfb51d85a975908ac4ab15fba8 Author: Dai Ngo Date: Thu Sep 16 14:22:12 2021 -0400 nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN When the back channel enters SEQ4_STATUS_CB_PATH_DOWN state, the client recovers by sending BIND_CONN_TO_SESSION but the server fails to recover the back channel and leaves it as NFSD4_CB_DOWN. Fix by enhancing nfsd4_bind_conn_to_session to probe the back channel by calling nfsd4_probe_callback. Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 89c485c7a3ecbc2ebd568f9c9c2edf3a8cf7485b Author: Chuck Lever Date: Thu Sep 16 17:24:54 2021 -0400 NLM: Fix svcxdr_encode_owner() Dai Ngo reports that, since the XDR overhaul, the NLM server crashes when the TEST procedure wants to return NLM_DENIED. There is a bug in svcxdr_encode_owner() that none of our standard test cases found. Replace the open-coded function with a call to an appropriate pre-fabricated XDR helper. Reported-by: Dai Ngo Fixes: a6a63ca5652e ("lockd: Common NLM XDR helpers") Signed-off-by: Chuck Lever commit a9b3043de47b7f8cbe38c36aee572526665b6315 Author: Mike Galbraith Date: Sun Sep 12 11:56:26 2021 +0900 ksmbd: transport_rdma: Don't include rwlock.h directly rwlock.h specifically asks to not be included directly. In fact, the proper spinlock.h include isn't needed either, it comes with the huge pile that kthread.h ends up pulling in, so just drop it entirely. Signed-off-by: Mike Galbraith Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 02319bf15acf54004216e40ac9c171437f24be24 Author: Florian Fainelli Date: Thu Sep 16 14:33:35 2021 -0700 net: dsa: bcm_sf2: Fix array overrun in bcm_sf2_num_active_ports() After d12e1c464988 ("net: dsa: b53: Set correct number of ports in the DSA struct") we stopped setting dsa_switch::num_ports to DSA_MAX_PORTS, which created an off by one error between the statically allocated bcm_sf2_priv::port_sts array (of size DSA_MAX_PORTS). When dsa_is_cpu_port() is used, we end-up accessing an out of bounds member and causing a NPD. Fix this by iterating with the appropriate port count using ds->num_ports. Fixes: d12e1c464988 ("net: dsa: b53: Set correct number of ports in the DSA struct") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 3c9cfb5269f76d447dbadb67835368f3111a91d7 Author: Vladimir Oltean Date: Fri Sep 17 14:17:35 2021 +0300 net: update NXP copyright text NXP Legal insists that the following are not fine: - Saying "NXP Semiconductors" instead of "NXP", since the company's registered name is "NXP" - Putting a "(c)" sign in the copyright string - Putting a comma in the copyright string The only accepted copyright string format is "Copyright NXP". This patch changes the copyright headers in the networking files that were sent by me, or derived from code sent by me. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit dc9660590d106bb58d145233fffca4efadad3655 Author: Krzysztof Kozlowski Date: Thu Sep 16 16:41:02 2021 +0200 regulator: max14577: Revert "regulator: max14577: Add proper module aliases strings" This reverts commit 0da6736ecd10b45e535b100acd58df2db4c099d8. The MODULE_DEVICE_TABLE already creates proper alias. Having another MODULE_ALIAS causes the alias to be duplicated: $ modinfo max14577-regulator.ko alias: platform:max77836-regulator alias: platform:max14577-regulator description: Maxim 14577/77836 regulator driver alias: platform:max77836-regulator alias: platform:max14577-regulator Cc: Marek Szyprowski Fixes: 0da6736ecd10 ("regulator: max14577: Add proper module aliases strings") Signed-off-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20210916144102.120980-1-krzysztof.kozlowski@canonical.com Signed-off-by: Mark Brown commit cfacfefd382af3b42905108b54f02820dca225c4 Author: Peter Ujfalusi Date: Fri Sep 17 11:51:08 2021 +0300 ASoC: SOF: trace: Omit error print when waking up trace sleepers Do not print error message from snd_sof_trace_notify_for_error() when possible sleeping trace work is woken up to flush the remaining debug information. This action by itself is not an error, it is just an action we take when an error occurs to make sure that all information have been fed to the userspace (if we have trace in use). Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210917085108.25532-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 3abe2eec87059260bf31033a8863c67c5d45b9d0 Author: Trevor Wu Date: Fri Sep 17 16:28:05 2021 +0800 ASoC: mediatek: mt8195: remove wrong fixup assignment on HDMITX S24_LE params fixup is only required for DPTX. Remove fixup ops assignment for HDMITX. Fixes: 40d605df0a7b ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682") Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210917082805.30898-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 23ca067b3295d935835b71f743235f9e5ab31cc5 Author: Sebastian Andrzej Siewior Date: Wed Sep 1 10:44:03 2021 +0200 mm: Fully initialize invalidate_lock, amend lock class later The function __init_rwsem() is not part of the official API, it just a helper function used by init_rwsem(). Changing the lock's class and name should be done by using lockdep_set_class_and_name() after the has been fully initialized. The overhead of the additional class struct and setting it twice is negligible and it works across all locks. Fully initialize the lock with init_rwsem() and then set the custom class and name for the lock. Fixes: 730633f0b7f95 ("mm: Protect operations adding pages to page cache with invalidate_lock") Link: https://lore.kernel.org/r/20210901084403.g4fezi23cixemlhh@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jan Kara commit e8f69b16ee776da88589b5271e3f46020efc8f6c Author: Johan Hovold Date: Fri Sep 17 12:12:04 2021 +0200 net: hso: fix muxed tty registration If resource allocation and registration fail for a muxed tty device (e.g. if there are no more minor numbers) the driver should not try to deregister the never-registered (or already-deregistered) tty. Fix up the error handling to avoid dereferencing a NULL pointer when attempting to remove the character device. Fixes: 72dc1c096c70 ("HSO: add option hso driver") Cc: stable@vger.kernel.org # 2.6.27 Signed-off-by: Johan Hovold Signed-off-by: David S. Miller commit 078fb7aa6a8305bce09cdfbe77b4c987934442ba Author: Rob Herring Date: Thu Aug 19 13:42:39 2021 -0500 arm: dts: vexpress: Fix addressing issues with 'motherboard-bus' nodes The 'motherboard-bus' node in Arm Ltd boards fails schema checks as 'simple-bus' child nodes must have a unit-address. The 'ranges' handling is also wrong (or at least strange) as the mapping of SMC chip selects should be in the 'arm,vexpress,v2m-p1' node rather than a generic 'simple-bus' node. Either there's 1 too many levels of 'simple-bus' nodes or 'ranges' should be moved down a level. The latter change is more simple, so let's do that. As the 'ranges' value doesn't vary for a given motherboard instance, we can move 'ranges' into the motherboard dtsi files. Link: https://lore.kernel.org/r/20210819184239.1192395-6-robh@kernel.org Cc: Andre Przywara Cc: Sudeep Holla Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Signed-off-by: Sudeep Holla commit 047a749d231e4faccaf5f473cf73dc5732425f81 Merge: 844f7eaaed926 88d0adb5f13b1 Author: Steffen Klassert Date: Fri Sep 17 08:58:24 2021 +0200 Merge branch 'xfrm: fix uapi for the default policy' Nicolas Dichtel says: ==================== This feature has just been merged after the last release, thus it's still time to fix the uapi. As stated in the thread, the uapi is based on some magic values (from the userland POV). Here is a proposal to simplify this uapi and make it clear how to use it. The other problem was the notification: changing the default policy may radically change the packets flows. v2 -> v3: rebase on top of ipsec tree v1 -> v2: fix warnings reported by the kernel test robot ==================== Signed-off-by: Steffen Klassert commit c8087adc8865c76500dbc072a46b61d35f6c908b Author: Mauro Carvalho Chehab Date: Thu Sep 16 11:55:02 2021 +0200 dt-bindings: arm: mediatek: mmsys: update mediatek,mmsys.yaml reference Changeset cba3c40d1f97 ("dt-bindings: arm: mediatek: mmsys: convert to YAML format") renamed: Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt to: Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml. Update its cross-reference accordingly. Fixes: cba3c40d1f97 ("dt-bindings: arm: mediatek: mmsys: convert to YAML format") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/a87eb079a73e8ab41cdf6e40e80b1d1f868da6bd.1631785820.git.mchehab+huawei@kernel.org commit a11de92523f75a8140cf8eea3ce9b628f7a3cc77 Author: Mauro Carvalho Chehab Date: Thu Sep 16 11:55:01 2021 +0200 dt-bindings: net: dsa: sja1105: update nxp,sja1105.yaml reference Changeset 62568bdbe6f6 ("dt-bindings: net: dsa: sja1105: convert to YAML schema") renamed: Documentation/devicetree/bindings/net/dsa/sja1105.txt to: Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml. Update its cross-reference accordingly. Fixes: 62568bdbe6f6 ("dt-bindings: net: dsa: sja1105: convert to YAML schema") Reviewed-by: Vladimir Oltean Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/994ce6c6358746ff600459822b9f6e336db933c9.1631785820.git.mchehab+huawei@kernel.org commit d36a97736b2cc9b13db0dfdf6f32b115ec193614 Author: David Collins Date: Thu Sep 16 18:51:37 2021 +0530 pinctrl: qcom: spmi-gpio: correct parent irqspec translation pmic_gpio_child_to_parent_hwirq() and gpiochip_populate_parent_fwspec_fourcell() translate a pinctrl- spmi-gpio irqspec to an SPMI controller irqspec. When they do this, they use a fixed SPMI slave ID of 0 and a fixed GPIO peripheral offset of 0xC0 (corresponding to SPMI address 0xC000). This translation results in an incorrect irqspec for secondary PMICs that don't have a slave ID of 0 as well as for PMIC chips which have GPIO peripherals located at a base address other than 0xC000. Correct this issue by passing the slave ID of the pinctrl-spmi- gpio device's parent in the SPMI controller irqspec and by calculating the peripheral ID base from the device tree 'reg' property of the pinctrl-spmi-gpio device. Signed-off-by: David Collins Signed-off-by: satya priya Fixes: ca69e2d165eb ("qcom: spmi-gpio: add support for hierarchical IRQ chip") Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1631798498-10864-2-git-send-email-skakit@codeaurora.org Signed-off-by: Linus Walleij commit acd47b9f28e55b505aedb842131b40904e151d7c Author: Basavaraj Natikar Date: Tue Aug 31 17:36:13 2021 +0530 pinctrl: amd: Handle wake-up interrupt Enable/disable power management wakeup mode, which is disabled by default. enable_irq_wake enables wakes the system from sleep. Hence added enable/disable irq_wake to handle wake-up interrupt. Signed-off-by: Basavaraj Natikar Tested-by: Mario Limonciello Acked-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20210831120613.1514899-3-Basavaraj.Natikar@amd.com Signed-off-by: Linus Walleij commit 7e6f8d6f4a42ef9b693ff1b49267c546931d4619 Author: Basavaraj Natikar Date: Tue Aug 31 17:36:12 2021 +0530 pinctrl: amd: Add irq field data pinctrl_amd use gpiochip_get_data() to get their local state containers back from the gpiochip passed as amd_gpio chip data. Hence added irq field data to get directly using amd_gpio chip data. Signed-off-by: Basavaraj Natikar Tested-by: Mario Limonciello Acked-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20210831120613.1514899-2-Basavaraj.Natikar@amd.com Signed-off-by: Linus Walleij commit e9a9970bf520c99e530d8f1fa5b5c22671fad4ef Author: Russ Weight Date: Thu Sep 16 14:07:33 2021 -0700 fpga: dfl: Avoid reads to AFU CSRs during enumeration CSR address space for Accelerator Functional Units (AFU) is not available during the early Device Feature List (DFL) enumeration. Early access to this space results in invalid data and port errors. This change adds a condition to prevent an early read from the AFU CSR space. Fixes: 1604986c3e6b ("fpga: dfl: expose feature revision from struct dfl_device") Cc: stable@vger.kernel.org Signed-off-by: Russ Weight Signed-off-by: Moritz Fischer commit 129803e642ac3d828b3c73ff10f570c42d962ef8 Author: Michal Simek Date: Wed Aug 25 09:41:22 2021 +0200 pinctrl: core: Remove duplicated word from devm_pinctrl_unregister() Remove duplicated "which" from devm_pinctrl_unregister() kernel doc description. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/8b75e5dfd9363f35ebdd7812e119757379678f97.1629877281.git.michal.simek@xilinx.com Signed-off-by: Linus Walleij commit e6fab7af6ba1bc77c78713a83876f60ca7a4a064 Author: Vadim Pasternak Date: Thu Sep 16 21:31:51 2021 +0300 hwmon: (mlxreg-fan) Return non-zero value when fan current state is enforced from sysfs Fan speed minimum can be enforced from sysfs. For example, setting current fan speed to 20 is used to enforce fan speed to be at 100% speed, 19 - to be not below 90% speed, etcetera. This feature provides ability to limit fan speed according to some system wise considerations, like absence of some replaceable units or high system ambient temperature. Request for changing fan minimum speed is configuration request and can be set only through 'sysfs' write procedure. In this situation value of argument 'state' is above nominal fan speed maximum. Return non-zero code in this case to avoid thermal_cooling_device_stats_update() call, because in this case statistics update violates thermal statistics table range. The issues is observed in case kernel is configured with option CONFIG_THERMAL_STATISTICS. Here is the trace from KASAN: [ 159.506659] BUG: KASAN: slab-out-of-bounds in thermal_cooling_device_stats_update+0x7d/0xb0 [ 159.516016] Read of size 4 at addr ffff888116163840 by task hw-management.s/7444 [ 159.545625] Call Trace: [ 159.548366] dump_stack+0x92/0xc1 [ 159.552084] ? thermal_cooling_device_stats_update+0x7d/0xb0 [ 159.635869] thermal_zone_device_update+0x345/0x780 [ 159.688711] thermal_zone_device_set_mode+0x7d/0xc0 [ 159.694174] mlxsw_thermal_modules_init+0x48f/0x590 [mlxsw_core] [ 159.700972] ? mlxsw_thermal_set_cur_state+0x5a0/0x5a0 [mlxsw_core] [ 159.731827] mlxsw_thermal_init+0x763/0x880 [mlxsw_core] [ 160.070233] RIP: 0033:0x7fd995909970 [ 160.074239] Code: 73 01 c3 48 8b 0d 28 d5 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 99 2d 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff .. [ 160.095242] RSP: 002b:00007fff54f5d938 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 160.103722] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007fd995909970 [ 160.111710] RDX: 0000000000000013 RSI: 0000000001906008 RDI: 0000000000000001 [ 160.119699] RBP: 0000000001906008 R08: 00007fd995bc9760 R09: 00007fd996210700 [ 160.127687] R10: 0000000000000073 R11: 0000000000000246 R12: 0000000000000013 [ 160.135673] R13: 0000000000000001 R14: 00007fd995bc8600 R15: 0000000000000013 [ 160.143671] [ 160.145338] Allocated by task 2924: [ 160.149242] kasan_save_stack+0x19/0x40 [ 160.153541] __kasan_kmalloc+0x7f/0xa0 [ 160.157743] __kmalloc+0x1a2/0x2b0 [ 160.161552] thermal_cooling_device_setup_sysfs+0xf9/0x1a0 [ 160.167687] __thermal_cooling_device_register+0x1b5/0x500 [ 160.173833] devm_thermal_of_cooling_device_register+0x60/0xa0 [ 160.180356] mlxreg_fan_probe+0x474/0x5e0 [mlxreg_fan] [ 160.248140] [ 160.249807] The buggy address belongs to the object at ffff888116163400 [ 160.249807] which belongs to the cache kmalloc-1k of size 1024 [ 160.263814] The buggy address is located 64 bytes to the right of [ 160.263814] 1024-byte region [ffff888116163400, ffff888116163800) [ 160.277536] The buggy address belongs to the page: [ 160.282898] page:0000000012275840 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888116167000 pfn:0x116160 [ 160.294872] head:0000000012275840 order:3 compound_mapcount:0 compound_pincount:0 [ 160.303251] flags: 0x200000000010200(slab|head|node=0|zone=2) [ 160.309694] raw: 0200000000010200 ffffea00046f7208 ffffea0004928208 ffff88810004dbc0 [ 160.318367] raw: ffff888116167000 00000000000a0006 00000001ffffffff 0000000000000000 [ 160.327033] page dumped because: kasan: bad access detected [ 160.333270] [ 160.334937] Memory state around the buggy address: [ 160.356469] >ffff888116163800: fc .. Fixes: 65afb4c8e7e4 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver") Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20210916183151.869427-1-vadimp@nvidia.com Signed-off-by: Guenter Roeck commit bdb575f872175ed0ecf2638369da1cb7a6e86a14 Merge: fc0c0548c1a2e 109f7ea9aedce Author: Linus Torvalds Date: Thu Sep 16 13:28:52 2021 -0700 Merge tag 'drm-fixes-2021-09-17' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Slightly busier than usual rc2, but mostly scattered amdgpu fixes, some i915 and etnaviv resolves an MMU/runtime PM blowup. amdgpu: - UBSAN fix - Powerplay table update fix - Fix use after free in BO moves - Debugfs init fixes - vblank workqueue fixes for headless devices - FPU fixes - sysfs_emit fixes - SMU updates for cyan skillfish - Backlight fixes when DMCU is not initialized - DP MST fixes - HDCP compliance fix - Link training fix - Runtime pm fix - Panel orientation fixes - Display GPUVM fix for yellow carp - Add missing license amdkfd: - Drop PCI atomics requirement if proper firmware is available - Suspend/resume fixes for IOMMUv2 cases radeon: - AGP fix i915: - Propagate DP link training error returns - Use max link params for eDP 1.3 and earlier - Build warning fixes - Gem selftest fixes - Ensure wakeref is held before hardware access etnaviv: - MMU context vs runtime PM fix" * tag 'drm-fixes-2021-09-17' of git://anongit.freedesktop.org/drm/drm: (44 commits) drm/amdgpu/display: add a proper license to dc_link_dp.c drm/amd/display: Fix white screen page fault for gpuvm amd/display: enable panel orientation quirks drm/amdgpu: Demote TMZ unsupported log message from warning to info drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count drm/amd/pm: fix runpm hang when amdgpu loaded prior to sound driver drm/radeon: pass drm dev radeon_agp_head_init directly drm/amdgpu: move iommu_resume before ip init/resume drm/amdgpu: add amdgpu_amdkfd_resume_iommu drm/amdkfd: separate kfd_iommu_resume from kfd_resume drm/amd/display: Link training retry fix for abort case drm/amd/display: Fix unstable HPCP compliance on Chrome Barcelo drm/amd/display: dsc mst 2 4K displays go dark with 2 lane HBR3 drm/amd/display: Get backlight from PWM if DMCU is not initialized drm/amdkfd: make needs_pcie_atomics FW-version dependent drm/amdgpu: add manual sclk/vddc setting support for cyan skilfish(v3) drm/amdgpu: add some pptable funcs for cyan skilfish(v3) drm/amdgpu: update SMU driver interface for cyan skilfish(v3) drm/amdgpu: update SMU PPSMC for cyan skilfish drm/amdgpu: fix sysfs_emit/sysfs_emit_at warnings(v2) ... commit fc0c0548c1a2e676d3a928aaed70f2d4d254e395 Merge: 3c0d2a46c0141 ee8a9600b5391 Author: Linus Torvalds Date: Thu Sep 16 13:05:42 2021 -0700 Merge tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf. Current release - regressions: - vhost_net: fix OoB on sendmsg() failure - mlx5: bridge, fix uninitialized variable usage - bnxt_en: fix error recovery regression Current release - new code bugs: - bpf, mm: fix lockdep warning triggered by stack_map_get_build_id_offset() Previous releases - regressions: - r6040: restore MDIO clock frequency after MAC reset - tcp: fix tp->undo_retrans accounting in tcp_sacktag_one() - dsa: flush switchdev workqueue before tearing down CPU/DSA ports Previous releases - always broken: - ptp: dp83640: don't define PAGE0, avoid compiler warning - igc: fix tunnel segmentation offloads - phylink: update SFP selected interface on advertising changes - stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume - mlx5e: fix mutual exclusion between CQE compression and HW TS Misc: - bpf, cgroups: fix cgroup v2 fallback on v1/v2 mixed mode - sfc: fallback for lack of xdp tx queues - hns3: add option to turn off page pool feature" * tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits) mlxbf_gige: clear valid_polarity upon open igc: fix tunnel offloading net/{mlx5|nfp|bnxt}: Remove unnecessary RTNL lock assert net: wan: wanxl: define CROSS_COMPILE_M68K selftests: nci: replace unsigned int with int net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports Revert "net: phy: Uniform PHY driver access" net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup ptp: dp83640: don't define PAGE0 bnx2x: Fix enabling network interfaces without VFs Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"" tcp: fix tp->undo_retrans accounting in tcp_sacktag_one() net-caif: avoid user-triggerable WARN_ON(1) bpf, selftests: Add test case for mixed cgroup v1/v2 bpf, selftests: Add cgroup v1 net_cls classid helpers bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode bpf: Add oversize check before call kvcalloc() net: hns3: fix the timing issue of VF clearing interrupt sources net: hns3: fix the exception when query imp info net: hns3: disable mac in flr process ... commit 109f7ea9aedce437b4b7737ab60bfea65d9dbdd3 Merge: 11654b3763cc0 92554cbe0a364 Author: Dave Airlie Date: Fri Sep 17 05:58:55 2021 +1000 Merge tag 'amd-drm-fixes-5.15-2021-09-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.15-2021-09-16: amdgpu: - UBSAN fix - Powerplay table update fix - Fix use after free in BO moves - Debugfs init fixes - vblank workqueue fixes for headless devices - FPU fixes - sysfs_emit fixes - SMU updates for cyan skillfish - Backlight fixes when DMCU is not initialized - DP MST fixes - HDCP compliance fix - Link training fix - Runtime pm fix - Panel orientation fixes - Display GPUVM fix for yellow carp - Add missing license amdkfd: - Drop PCI atomics requirement if proper firmware is available - Suspend/resume fixes for IOMMUv2 cases radeon: - AGP fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210916140611.59816-1-alexander.deucher@amd.com commit 11654b3763cc0625283753f41c3404ec666a9854 Merge: da4ce47e146ac 7889367d7795b Author: Dave Airlie Date: Fri Sep 17 05:53:52 2021 +1000 Merge tag 'drm-intel-fixes-2021-09-16' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-fixes drm/i915 fixes for v5.15-rc2: - Propagate DP link training error returns - Use max link params for eDP 1.3 and earlier - Build warning fixes - Gem selftest fixes - Ensure wakeref is held before hardware access Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/8735q4wsu7.fsf@intel.com commit 3c0d2a46c0141913dc6fd126c57d0615677d946e Author: Guenter Roeck Date: Wed Sep 8 20:57:43 2021 -0700 net: 6pack: Fix tx timeout and slot time tx timeout and slot time are currently specified in units of HZ. On Alpha, HZ is defined as 1024. When building alpha:allmodconfig, this results in the following error message. drivers/net/hamradio/6pack.c: In function 'sixpack_open': drivers/net/hamradio/6pack.c:71:41: error: unsigned conversion from 'int' to 'unsigned char' changes value from '256' to '0' In the 6PACK protocol, tx timeout is specified in units of 10 ms and transmitted over the wire: https://www.linux-ax25.org/wiki/6PACK Defining a value dependent on HZ doesn't really make sense, and presumably comes from the (very historical) situation where HZ was originally 100. Note that the SIXP_SLOTTIME use explicitly is about 10ms granularity: mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); and the SIXP_TXDELAY walue is sent as a byte over the wire. Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit da4ce47e146ace5af54198230aa3ed9431f0bbd4 Merge: 6880fa6c56601 f2faea8b64125 Author: Dave Airlie Date: Fri Sep 17 05:30:56 2021 +1000 Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes Fixes a very annoying issue where the driver view of the MMU state gets out of sync with the actual hardware state across a runtime PM cycle, so we end up restarting the GPU with the wrong (potentially already freed) MMU context. Hilarity ensues. Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/729a561b6cfed090457bcc856a9e14ed6209fe21.camel@pengutronix.de commit 040b8907ccf1c78d020aca29800036565d761d73 Author: Arnd Bergmann Date: Tue Apr 28 23:31:24 2020 +0200 drm/rockchip: cdn-dp-core: Make cdn_dp_core_resume __maybe_unused With the new static annotation, the compiler warns when the functions are actually unused: drivers/gpu/drm/rockchip/cdn-dp-core.c:1123:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function] 1123 | static int cdn_dp_resume(struct device *dev) | ^~~~~~~~~~~~~ Mark them __maybe_unused to suppress that warning as well. [ Not so 'new' static annotations any more, and I removed the part of the patch that added __maybe_unused to cdn_dp_suspend(), because it's used by the shutdown/remove code. So only the resume function ends up possibly unused if CONFIG_PM isn't set - Linus ] Fixes: 7c49abb4c2f8 ("drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static") Signed-off-by: Arnd Bergmann Reviewed-by: Enric Balletbo i Serra Signed-off-by: Linus Torvalds commit f5013d412a43662b63f3d5f3a804d63213acd471 Author: Shuah Khan Date: Wed Sep 15 15:28:09 2021 -0600 selftests: kvm: fix get_run_delay() ignoring fscanf() return warn Fix get_run_delay() to check fscanf() return value to get rid of the following warning. When fscanf() fails return MIN_RUN_DELAY_NS from get_run_delay(). Move MIN_RUN_DELAY_NS from steal_time.c to test_util.h so get_run_delay() and steal_time.c can use it. lib/test_util.c: In function ‘get_run_delay’: lib/test_util.c:316:2: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 316 | fscanf(fp, "%ld %ld ", &val[0], &val[1]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shuah Khan Acked-by: Paolo Bonzini Signed-off-by: Shuah Khan commit 20175d5eac5bb94a7a3719ef275337fc9abf26ac Author: Shuah Khan Date: Wed Sep 15 15:28:08 2021 -0600 selftests: kvm: move get_run_delay() into lib/test_util get_run_delay() is defined static in xen_shinfo_test and steal_time test. Move it to lib and remove code duplication. Signed-off-by: Shuah Khan Acked-by: Paolo Bonzini Signed-off-by: Shuah Khan commit 3a4f0cc693cd3d80e66a255f0bff0e2c0461eef1 Author: Shuah Khan Date: Wed Sep 15 15:28:07 2021 -0600 selftests:kvm: fix get_trans_hugepagesz() ignoring fscanf() return warn Fix get_trans_hugepagesz() to check fscanf() return value to get rid of the following warning: lib/test_util.c: In function ‘get_trans_hugepagesz’: lib/test_util.c:138:2: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 138 | fscanf(f, "%ld", &size); | ^~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shuah Khan Acked-by: Paolo Bonzini Signed-off-by: Shuah Khan commit 39a71f712d8a13728febd8f3cb3f6db7e1fa7221 Author: Shuah Khan Date: Wed Sep 15 15:28:06 2021 -0600 selftests:kvm: fix get_warnings_count() ignoring fscanf() return warn Fix get_warnings_count() to check fscanf() return value to get rid of the following warning: x86_64/mmio_warning_test.c: In function ‘get_warnings_count’: x86_64/mmio_warning_test.c:85:2: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 85 | fscanf(f, "%d", &warnings); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shuah Khan Acked-by: Paolo Bonzini Signed-off-by: Shuah Khan commit b60cee5bae733f49ba33840804c159a8e474cfda Author: Guenter Roeck Date: Thu Sep 9 11:47:14 2021 -0700 cpufreq: vexpress: Drop unused variable arm:allmodconfig fails to build with the following error. drivers/cpufreq/vexpress-spc-cpufreq.c:454:13: error: unused variable 'cur_cluster' Remove the unused variable. Fixes: bb8c26d9387f ("cpufreq: vexpress: Set CPUFREQ_IS_COOLING_DEV flag") Cc: Viresh Kumar Signed-off-by: Guenter Roeck Reviewed-by: Kees Cook Signed-off-by: Linus Torvalds commit 35a3f4ef0ab543daa1725b0c963eb8c05e3376f8 Author: Guenter Roeck Date: Wed Sep 8 22:00:33 2021 -0700 alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile Some drivers pass a pointer to volatile data to virt_to_bus() and virt_to_phys(), and that works fine. One exception is alpha. This results in a number of compile errors such as drivers/net/wan/lmc/lmc_main.c: In function 'lmc_softreset': drivers/net/wan/lmc/lmc_main.c:1782:50: error: passing argument 1 of 'virt_to_bus' discards 'volatile' qualifier from pointer target type drivers/atm/ambassador.c: In function 'do_loader_command': drivers/atm/ambassador.c:1747:58: error: passing argument 1 of 'virt_to_bus' discards 'volatile' qualifier from pointer target type Declare the parameter of virt_to_phys and virt_to_bus as pointer to volatile to fix the problem. Signed-off-by: Guenter Roeck Acked-by: Arnd Bergmann Signed-off-by: Linus Torvalds commit db71f8fb44956714249a526647c143bac5bb96a1 Author: Linus Torvalds Date: Thu Sep 16 11:14:47 2021 -0700 3com 3c515: make it compile on 64-bit architectures This driver isn't enabled most places because of the ISA config dependency, but alpha still has it. And I think the 'Jensen' actually did have an ISA slot. However, it doesn't build cleanly, because the "Vortex bus master" code just casts the skb->data pointer to 'int': outl((int) (skb->data), ioaddr + Wn7_MasterAddr); which is all kinds of broken. Even on a good old traditional PC/AT it would be broken because the high bits will be random kernel address bits, but presumably the hardware ignores those bits. I mean, it's ISA. We're talking 16MB dma limits. The "good old days". Make the build happy with this kind of craziness by using the proper isa_virt_to_bus() handling that the full bus master code uses anyway (the Vortex bus mastering is a limited special case). Who knows, this might even work. Reported-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 5fe983d3f1a5b103fc00a24f9e0408302e60c39c Merge: 077a6ccf2588c 90cc7bed1ed19 Author: Linus Torvalds Date: Thu Sep 16 10:32:00 2021 -0700 Merge tag 'for-5.15/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fix from Helge Deller: "Fix a build warning when using the PAGE0 pointer" * tag 'for-5.15/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Use absolute_pointer() to define PAGE0 commit 077a6ccf2588c7c893b443fad62d0f8ed342cafc Merge: ff1ffd71d5f06 a7b68ed15d1fd Author: Linus Torvalds Date: Thu Sep 16 10:26:48 2021 -0700 Merge tag 'm68k-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k fixes from Geert Uytterhoeven: - Warning fixes to mitigate CONFIG_WERROR=y * tag 'm68k-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: mvme: Remove overdue #warnings in RTC handling m68k: Double cast io functions to unsigned long commit 24d5f16e407b75bc59d5419b957a9cab423b2681 Author: Ilan Peer Date: Tue Sep 7 14:32:14 2021 +0300 iwlwifi: mvm: Fix possible NULL dereference In __iwl_mvm_remove_time_event() check that 'te_data->vif' is NULL before dereferencing it. Fixes: 7b3954a1d69a ("iwlwifi: mvm: Explicitly stop session protection before unbinding") Reported-by: Dan Carpenter Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20210907143156.e80e52167d93.Ie2247f43f8acb2cee6dff5b07a3947c79a772835@changeid commit 9fcb2e93f41c07a400885325e7dbdfceba6efaec Author: Dan Li Date: Tue Sep 14 17:44:02 2021 +0800 arm64: Mark __stack_chk_guard as __ro_after_init __stack_chk_guard is setup once while init stage and never changed after that. Although the modification of this variable at runtime will usually cause the kernel to crash (so does the attacker), it should be marked as __ro_after_init, and it should not affect performance if it is placed in the ro_after_init section. Signed-off-by: Dan Li Acked-by: Mark Rutland Link: https://lore.kernel.org/r/1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com Signed-off-by: Catalin Marinas commit 861dc4f52e6992c933998fb4dd03fefe1fa5ce27 Author: Lv Ruyi Date: Wed Sep 1 18:11:26 2021 -0700 arm64/kernel: remove duplicate include in process.c Remove all but the first include of linux/sched.h from process.c Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20210902011126.29828-1-lv.ruyi@zte.com.cn Signed-off-by: Catalin Marinas commit e35ac9d0b56e9efefaeeb84b635ea26c2839ea86 Author: Mark Brown Date: Thu Sep 9 17:53:56 2021 +0100 arm64/sve: Use correct size when reinitialising SVE state When we need a buffer for SVE register state we call sve_alloc() to make sure that one is there. In order to avoid repeated allocations and frees we keep the buffer around unless we change vector length and just memset() it to ensure a clean register state. The function that deals with this takes the task to operate on as an argument, however in the case where we do a memset() we initialise using the SVE state size for the current task rather than the task passed as an argument. This is only an issue in the case where we are setting the register state for a task via ptrace and the task being configured has a different vector length to the task tracing it. In the case where the buffer is larger in the traced process we will leak old state from the traced process to itself, in the case where the buffer is smaller in the traced process we will overflow the buffer and corrupt memory. Fixes: bc0ee4760364 ("arm64/sve: Core task context handling") Cc: # 4.15.x Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210909165356.10675-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit c3dbfb9c49eef7d07904e5fd5e158dd6688bbab3 Author: Thierry Reding Date: Thu Sep 2 22:33:09 2021 +0200 gpu: host1x: Plug potential memory leak The memory allocated for a DMA fence could be leaked if the code failed to allocate the waiter object. Make sure to release the fence allocation on failure. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Thierry Reding commit a81cf839a064af27349b857fe347e97dd98c12a0 Author: Dmitry Osipenko Date: Tue Aug 17 05:01:53 2021 +0300 gpu/host1x: fence: Make spinlock static The DEFINE_SPINLOCK macro creates a global spinlock symbol that is visible to the whole kernel. This is unintended in the code, fix it. Fixes: 687db2207b1b ("gpu: host1x: Add DMA fence implementation") Signed-off-by: Dmitry Osipenko Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 8a44924e1400d75db5c6fdaf199038580df4f79f Author: Dmitry Osipenko Date: Tue Aug 17 05:01:52 2021 +0300 drm/tegra: uapi: Fix wrong mapping end address in case of disabled IOMMU All jobs are failing on Tegra20 because it doesn't use IOMMU and mapping function uses size of mapping that is zero instead of BO size, fix it. Fixes: d7c591bc1a3f ("drm/tegra: Implement new UAPI") Signed-off-by: Dmitry Osipenko Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 71eabafac1eb67d590d4500eaf38177537ea6d4a Author: Dmitry Osipenko Date: Tue Aug 17 05:01:51 2021 +0300 drm/tegra: dc: Remove unused variables Remove unused variables from tegra_crtc_update_memory_bandwidth(). Fixes: 04d5d5df9df7 ("drm/tegra: dc: Support memory bandwidth management") Reported-by: kernel test robot Signed-off-by: Dmitry Osipenko Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding commit e22e509c1cd90b48ae31099905418de74515e56f Author: Alim Akhtar Date: Wed Sep 15 20:18:44 2021 +0900 dt-bindings: ufs: Add bindings for Samsung ufs host This patch adds DT bindings for Samsung ufs hci Signed-off-by: Alim Akhtar Signed-off-by: Chanho Park Link: https://lore.kernel.org/r/20210915111844.42752-1-chanho61.park@samsung.com Signed-off-by: Rob Herring commit 6e3331ee34461be37f50912295a2e924a673dbc6 Author: Kari Argillander Date: Tue Sep 7 17:28:42 2021 +0300 fs/ntfs3: Use min/max macros instated of ternary operators We can make code little bit more readable by using min/max macros. These were found with Coccinelle. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit b5322eb1ae94572f5a52e804857e641b846059f4 Author: Kari Argillander Date: Tue Sep 7 17:28:41 2021 +0300 fs/ntfs3: Use clamp/max macros instead of comparisons We can make code little more readable by using kernel macros clamp/max. This were found with kernel included Coccinelle minmax script. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit f162f7b8dbc29742896f8a7e678bb31192716ae0 Author: Kari Argillander Date: Tue Sep 7 17:28:40 2021 +0300 fs/ntfs3: Remove always false condition check We do not need this check as this is same thing as NTFS_MIN_MFT_ZONE > zlen. We already check NTFS_MIN_MFT_ZONE <= zlen and exit because is too big request. Remove it so code is cleaner. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit edb853ff3dc01c22577ea5d0383d067b68a6d663 Author: Kari Argillander Date: Tue Sep 7 17:28:39 2021 +0300 fs/ntfs3: Fix ntfs_look_for_free_space() does only report -ENOSPC If ntfs_refresh_zone() returns error it will be changed to -ENOSPC. It is not right. Also caller of this functions also check other errors. Fixes: 78ab59fee07f ("fs/ntfs3: Rework file operations") Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit cffb5152eea82de890dd418a90612aede96068d6 Author: Kari Argillander Date: Tue Sep 7 11:34:41 2021 +0300 fs/ntfs3: Remove tabs before spaces from comment Remove tabs before spaces from comment as recommended by kernel coding style. Checkpatch also warn about these. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 2829e39e0e8add377508b3c6ef4cf48e6db324fb Author: Kari Argillander Date: Tue Sep 7 11:34:40 2021 +0300 fs/ntfs3: Remove braces from single statment block Remove braces from single statment block as they are not needed. Also Linux kernel coding style guide recommend this and checkpatch warn about this. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 4ca7fe57f21a25afc4a651db5145bfe090c6248f Author: Kari Argillander Date: Tue Sep 7 11:34:39 2021 +0300 fs/ntfs3: Place Comparisons constant right side of the test For better code readability place constant always right side of the test. This will also address checkpatch warning. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 7d95995ab4de07ee642c925aa6dbf6d07069a751 Author: Kari Argillander Date: Tue Sep 7 11:34:38 2021 +0300 fs/ntfs3: Remove '+' before constant in ni_insert_resident() No need for plus sign here. So remove it. Checkpatch will also be happy. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 92554cbe0a36494f6dd760bc25ce5e5cdc60fc47 Author: Alex Deucher Date: Tue Sep 14 10:50:47 2021 -0400 drm/amdgpu/display: add a proper license to dc_link_dp.c Was missing. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit a70939851f9ced298dc7d523374b8c4d05239caf Author: Nicholas Kazlauskas Date: Mon Sep 13 14:56:44 2021 -0400 drm/amd/display: Fix white screen page fault for gpuvm [Why] The "base_addr_is_mc_addr" field was added for dcn3.1 support but pa_config was never updated to set it to false. Uninitialized memory causes it to be set to true which results in address mistranslation and white screen. [How] Use memset to ensure all fields are initialized to 0 by default. Fixes: 64b1d0e8d500 ("drm/amd/display: Add DCN3.1 HWSEQ") Signed-off-by: Nicholas Kazlauskas Acked-by: Alex Deucher Acked-by: Aaron Liu Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit cd51a57eb59fd56f3fe7ce9cadef444451bcf804 Author: Simon Ser Date: Fri Sep 10 15:37:41 2021 +0000 amd/display: enable panel orientation quirks This patch allows panel orientation quirks from DRM core to be used. They attach a DRM connector property "panel orientation" which indicates in which direction the panel has been mounted. Some machines have the internal screen mounted with a rotation. Since the panel orientation quirks need the native mode from the EDID, check for it in amdgpu_dm_connector_ddc_get_modes. Signed-off-by: Simon Ser Cc: Alex Deucher Cc: Harry Wentland Cc: Nicholas Kazlauskas Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b287e4946873d706f94d95bdb2bf099dc8902181 Author: Paul Menzel Date: Mon Sep 13 10:34:11 2021 +0200 drm/amdgpu: Demote TMZ unsupported log message from warning to info As the user cannot do anything about the unsupported Trusted Memory Zone (TMZ) feature, do not warn about it, but make it informational, so demote the log level from warning to info. Signed-off-by: Paul Menzel Signed-off-by: Alex Deucher commit 114518ff3b30a3f0611f384fb58e0a968fdf7f5e Author: Michel Dänzer Date: Thu Sep 9 18:56:28 2021 +0200 drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count This was unusual; normally, inline functions are declared static as well, and defined in a header file if used by multiple compilation units. The latter would be more involved in this case, so just drop the inline declaration for now. Fixes compile failure building for ppc64le on RHEL 8: In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32, from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33: ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_recovery_init’: ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining failed in call to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not available 90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here 1985 | max_eeprom_records_len = amdgpu_ras_eeprom_max_record_count(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)" Reviewed-by: Lyude Paul Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 8b514e898ee7f861eb8863c647d258f71053af40 Author: Evan Quan Date: Thu Sep 9 11:01:00 2021 +0800 drm/amd/pm: fix runpm hang when amdgpu loaded prior to sound driver Current RUNPM mechanism relies on PMFW to master the timing for BACO in/exit. And that needs cooperation from sound driver for dstate change notification for function 1(audio). Otherwise(on sound driver missing), BACO cannot be kicked in correctly and hang will be observed on RUNPM exit. By switching back to legacy message way on sound driver missing, we are able to fix the runpm hang observed for the scenario below: amdgpu driver loaded -> runpm suspend kicked -> sound driver loaded Signed-off-by: Evan Quan Reported-and-tested-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 93def70cf8b23de5049d101b7dd5367864694bd3 Author: Nirmoy Das Date: Mon Sep 13 10:08:23 2021 +0200 drm/radeon: pass drm dev radeon_agp_head_init directly Pass drm dev directly as rdev->ddev gets initialized later on at radeon_device_init(). Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214375 Signed-off-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f02abeb0779700c308e661a412451b38962b8a0b Author: James Zhu Date: Tue Sep 7 11:32:22 2021 -0400 drm/amdgpu: move iommu_resume before ip init/resume Separate iommu_resume from kfd_resume, and move it before other amdgpu ip init/resume. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277 Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8066008482e533e91934bee49765bf8b4a7c40db Author: James Zhu Date: Tue Sep 7 11:27:31 2021 -0400 drm/amdgpu: add amdgpu_amdkfd_resume_iommu Add amdgpu_amdkfd_resume_iommu for amdgpu. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277 Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit fefc01f042f44ede373ee66773b8238dd8fdcb55 Author: James Zhu Date: Tue Sep 7 11:13:02 2021 -0400 drm/amdkfd: separate kfd_iommu_resume from kfd_resume Separate kfd_iommu_resume from kfd_resume for fine-tuning of amdgpu device init/resume/reset/recovery sequence. v2: squash in fix for !CONFIG_HSA_AMD Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277 Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 71ae30997a8f1791835167d3ceb8d1fab32407db Author: Meenakshikumar Somasundaram Date: Mon Aug 30 14:01:10 2021 -0400 drm/amd/display: Link training retry fix for abort case [Why] If link training is aborted, it shall be retried if sink is present. [How] Check hpd status to find out whether sink is present or not. If sink is present, then link training shall be tried again with same settings. Otherwise, link training shall be aborted. Reviewed-by: Jimmy Kizito Acked-by: Mikita Lipski Signed-off-by: Meenakshikumar Somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4e00a434a08e0654a4dd9347485d9ec85deee1ef Author: Qingqing Zhuo Date: Fri Aug 27 06:58:38 2021 -0400 drm/amd/display: Fix unstable HPCP compliance on Chrome Barcelo [Why] Intermittently, there presents two occurrences of 0 stream commits in a single HPD event. Current HDCP sequence does not consider such scenerio, and will thus disable HDCP. [How] Add condition check to include stream remove and re-enable case for HDCP enable. Reviewed-by: Bhawanpreet Lakha Acked-by: Mikita Lipski Signed-off-by: Qingqing Zhuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 90517c9838602846daa0feec7b37382fed61b001 Author: Hersen Wu Date: Wed Aug 25 16:27:47 2021 -0400 drm/amd/display: dsc mst 2 4K displays go dark with 2 lane HBR3 [Why] call stack of amdgpu dsc mst pbn, slot num calculation is as below: -compute_bpp_x16_from_target_bandwidth -decide_dsc_target_bpp_x16 -setup_dsc_config -dc_dsc_compute_bandwidth_range -compute_mst_dsc_configs_for_link -compute_mst_dsc_configs_for_state from pbn -> dsc target bpp_x16 bpp_x16 is calulated by compute_bpp_x16_from_target_bandwidth. Beside pixel clock and bpp, num_slices_h and bpp_increment_div will also affect bpp_x16. from dsc target bpp_x16 -> pbn within dm_update_mst_vcpi_slots_for_dsc, pbn = drm_dp_calc_pbn_mode(clock, bpp_x16, true); drm_dp_calc_pbn_mode(int clock, int bpp, bool dsc) { return DIV_ROUND_UP_ULL(mul_u32_u32(clock * (bpp / 16), 64 * 1006), 8 * 54 * 1000 * 1000); } bpp / 16 trunc digits after decimal point. This will cause calculation delta. drm_dp_calc_pbn_mode does not have other informations, like num_slices_h, bpp_increment_div. therefore, it does not do revese calcuation properly from bpp_x16 to pbn. pbn from drm_dp_calc_pbn_mode is less than pbn from compute_mst_dsc_configs_for_state. This cause not enough mst slot allocated to display. display could not visually light up. [How] pass pbn from compute_mst_dsc_configs_for_state to dm_update_mst_vcpi_slots_for_dsc Cc: stable@vger.kernel.org Reviewed-by: Scott Foster Acked-by: Mikita Lipski Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9987fbb368038d41bfdcda2a3f7f4945d7daa9a5 Author: Harry Wentland Date: Mon Aug 16 15:57:12 2021 -0400 drm/amd/display: Get backlight from PWM if DMCU is not initialized On Carrizo/Stoney systems we set backlight through panel_cntl, i.e. directly via the PWM registers, if DMCU is not initialized. We always read it back through ABM registers which leads to a mismatch and forces atomic_commit to program the backlight each time. Instead make sure we use the same logic for backlight readback, i.e. read it from panel_cntl if DMCU is not initialized. We also need to remove some extraneous and incorrect calculations at the end of dce_get_16_bit_backlight_from_pwm. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1666 Cc: stable@vger.kernel.org Reviewed-by: Josip Pavic Acked-by: Mikita Lipski Signed-off-by: Harry Wentland Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fb932dfeb87411a8a01c995576198bfc302df339 Author: Felix Kuehling Date: Tue Aug 31 17:42:15 2021 -0400 drm/amdkfd: make needs_pcie_atomics FW-version dependent On some GPUs the PCIe atomic requirement for KFD depends on the MEC firmware version. Add a firmware version check for this. The minimum firmware version that works without atomics can be updated in the device_info structure for each GPU type. Move PCIe atomic detection from kgd2kfd_probe into kgd2kfd_device_init because the MEC firmware is not loaded yet at the probe stage. Signed-off-by: Felix Kuehling Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit abd0a16ac72c98c46e7a1a91d591121b9c95cf97 Author: Lang Yu Date: Fri Aug 27 15:20:51 2021 +0800 drm/amdgpu: add manual sclk/vddc setting support for cyan skilfish(v3) Add manual sclk/vddc setting supoort via pp_od_clk_voltage sysfs to maintain consistency with other asics. As cyan skillfish doesn't support DPM, there is only a single frequency and voltage to adjust. v2: maintain consistency and add command guide. v3: adjust user settings storage and coding style. Command guide: echo vc point sclk vddc > pp_od_clk_voltage "vc" - sclk voltage curve "point" - must be 0 "sclk" - target value of sclk(MHz), should be in safe range "vddc" - target value of vddc(mV), a 6.25(mV) stepping is recommended and should be in safe range (the real vddc is an approximation of target value) echo c > pp_od_clk_voltage "c" - commit the changes of sclk and vddc, only after the commit command, the target values set by "vc" command will take effect echo r > pp_od_clk_voltage "r" - reset sclk and vddc to default value, a subsequent commit command is needed to take effect Example: 1) Check default sclk and vddc $ cat pp_od_clk_voltage OD_SCLK: 0: 1800Mhz * OD_VDDC: 0: 862mV * OD_RANGE: SCLK: 1000Mhz 2000Mhz VDDC: 700mV 1129mV 2) Set sclk to 1500MHz and vddc to 700mV $ echo vc 0 1500 700 > pp_od_clk_voltage $ echo c > pp_od_clk_voltage $ cat pp_od_clk_voltage OD_SCLK: 0: 1500Mhz * OD_VDDC: 0: 693mV * OD_RANGE: SCLK: 1000Mhz 2000Mhz VDDC: 700mV 1129mV 3) Reset sclk and vddc to default $ echo r > pp_od_clk_voltage $ echo c > pp_od_clk_voltage $ cat pp_od_clk_voltage OD_SCLK: 0: 1800Mhz * OD_VDDC: 0: 874mV * OD_RANGE: SCLK: 1000Mhz 2000Mhz VDDC: 700mV 1129mV NOTE: We don't specify an explicit safe range, you can set any values between min and max at your own risk. Enjoy! Signed-off-by: Lang Yu Reviewed-by: Lijo Lazar Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 3061fe937ea9990524e73af6d04baca60ad5b137 Author: Lang Yu Date: Fri Aug 27 15:03:50 2021 +0800 drm/amdgpu: add some pptable funcs for cyan skilfish(v3) Add print_clk_levels and read_sensor pptable funcs for cyan skilfish. v2: keep consitency and add get_gpu_metrics callback. v3: use sysfs_emit_at() in sysfs show function. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit c007e17c8476cb3c1032864f60936f2b7586010b Author: Lang Yu Date: Fri Aug 27 14:16:31 2021 +0800 drm/amdgpu: update SMU driver interface for cyan skilfish(v3) Add SmuMetrics_t definition for cyan skilfish. v2: update SmuMetrics_t definition. v3: cleanup and rearrange the order of fields. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 8492d3a07d3c7a0c69df0dec2ae835f5557b8835 Author: Lang Yu Date: Tue Aug 24 17:02:57 2021 +0800 drm/amdgpu: update SMU PPSMC for cyan skilfish Add some PPSMC MSGs for cyan skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 8f48ba303dfb15dc354e95a3ade59dea4614123a Author: Lang Yu Date: Wed Sep 8 13:34:26 2021 +0800 drm/amdgpu: fix sysfs_emit/sysfs_emit_at warnings(v2) sysfs_emit and sysfs_emit_at requrie a page boundary aligned buf address. Make them happy! v2: use an inline function. Warning Log: [ 492.545174] invalid sysfs_emit_at: buf:00000000f19bdfde at:0 [ 492.546416] WARNING: CPU: 7 PID: 1304 at fs/sysfs/file.c:765 sysfs_emit_at+0x4a/0xa0 [ 492.654805] Call Trace: [ 492.655353] ? smu_cmn_get_metrics_table+0x40/0x50 [amdgpu] [ 492.656780] vangogh_print_clk_levels+0x369/0x410 [amdgpu] [ 492.658245] vangogh_common_print_clk_levels+0x77/0x80 [amdgpu] [ 492.659733] ? preempt_schedule_common+0x18/0x30 [ 492.660713] smu_print_ppclk_levels+0x65/0x90 [amdgpu] [ 492.662107] amdgpu_get_pp_od_clk_voltage+0x13d/0x190 [amdgpu] [ 492.663620] dev_attr_show+0x1d/0x40 Signed-off-by: Lang Yu Acked-by: Huang Rui Signed-off-by: Alex Deucher commit 2a54d110bd4393fe412ef2c9c2d05fcd92785d1a Author: Anson Jacob Date: Thu Sep 9 12:48:29 2021 -0400 drm/amd/display: dc_assert_fp_enabled assert only if FPU is not enabled Assert only when FPU is not enabled. Fixes: 0ea7ee821701 ("drm/amd/display: Add DC_FP helper to check FPU state") Signed-off-by: Anson Jacob Cc: Christian König Cc: Hersen Wu Cc: Harry Wentland Cc: Rodrigo Siqueira Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b3a7b268c147119a9776185b4f37e1555ead9d68 Author: Nicholas Kazlauskas Date: Tue Sep 7 09:53:03 2021 -0400 drm/amd/display: Add NULL checks for vblank workqueue [Why] If we're running a headless config with 0 links then the vblank workqueue will be NULL - causing a NULL pointer exception during any commit. [How] Guard access to the workqueue if it's NULL and don't queue or flush work if it is. Reported-by: Mike Lothian BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1700 Fixes: 58aa1c50e5a231 ("drm/amd/display: Use vblank control events for PSR enable/disable") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit ee8a9600b5391f434905c46bec7f77d34505083e Author: David Thompson Date: Wed Sep 15 14:08:48 2021 -0400 mlxbf_gige: clear valid_polarity upon open The network interface managed by the mlxbf_gige driver can get into a problem state where traffic does not flow. In this state, the interface will be up and enabled, but will stop processing received packets. This problem state will happen if three specific conditions occur: 1) driver has received more than (N * RxRingSize) packets but less than (N+1 * RxRingSize) packets, where N is an odd number Note: the command "ethtool -g " will display the current receive ring size, which currently defaults to 128 2) the driver's interface was disabled via "ifconfig oob_net0 down" during the window described in #1. 3) the driver's interface is re-enabled via "ifconfig oob_net0 up" This patch ensures that the driver's "valid_polarity" field is cleared during the open() method so that it always matches the receive polarity used by hardware. Without this fix, the driver needs to be unloaded and reloaded to correct this problem state. Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver") Reviewed-by: Asmaa Mnebhi Signed-off-by: David Thompson Signed-off-by: David S. Miller commit 40ee363c844fcb6ae0f1f5cfea68aed7e268c2f4 Author: Paolo Abeni Date: Wed Sep 15 10:19:07 2021 -0700 igc: fix tunnel offloading Checking tunnel offloading, it turns out that offloading doesn't work as expected. The following script allows to reproduce the issue. Call it as `testscript DEVICE LOCALIP REMOTEIP NETMASK' === SNIP === if [ $# -ne 4 ] then echo "Usage $0 DEVICE LOCALIP REMOTEIP NETMASK" exit 1 fi DEVICE="$1" LOCAL_ADDRESS="$2" REMOTE_ADDRESS="$3" NWMASK="$4" echo "Driver: $(ethtool -i ${DEVICE} | awk '/^driver:/{print $2}') " ethtool -k "${DEVICE}" | grep tx-udp echo echo "Set up NIC and tunnel..." ip addr add "${LOCAL_ADDRESS}/${NWMASK}" dev "${DEVICE}" ip link set "${DEVICE}" up sleep 2 ip link add vxlan1 type vxlan id 42 \ remote "${REMOTE_ADDRESS}" \ local "${LOCAL_ADDRESS}" \ dstport 0 \ dev "${DEVICE}" ip addr add fc00::1/64 dev vxlan1 ip link set vxlan1 up sleep 2 rm -f vxlan.pcap echo "Running tcpdump and iperf3..." ( nohup tcpdump -i any -w vxlan.pcap >/dev/null 2>&1 ) & sleep 2 iperf3 -c fc00::2 >/dev/null pkill tcpdump echo echo -n "Max. Paket Size: " tcpdump -r vxlan.pcap -nnle 2>/dev/null \ | grep "${LOCAL_ADDRESS}.*> ${REMOTE_ADDRESS}.*OTV" \ | awk '{print $8}' | awk -F ':' '{print $1}' \ | sort -n | tail -1 echo ip link del vxlan1 ip addr del ${LOCAL_ADDRESS}/${NWMASK} dev "${DEVICE}" === SNAP === The expected outcome is Max. Paket Size: 64904 This is what you see on igb, the code igc has been taken from. However, on igc the output is Max. Paket Size: 1516 so the GSO aggregate packets are segmented by the kernel before calling igc_xmit_frame. Inside the subsequent call to igc_tso, the check for skb_is_gso(skb) fails and the function returns prematurely. It turns out that this occurs because the feature flags aren't set entirely correctly in igc_probe. In contrast to the original code from igb_probe, igc_probe neglects to set the flags required to allow tunnel offloading. Setting the same flags as igb fixes the issue on igc. Fixes: 34428dff3679 ("igc: Add GSO partial support") Signed-off-by: Paolo Abeni Tested-by: Corinna Vinschen Acked-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 7c3a0a018e672a9723a79b128227272562300055 Author: Eli Cohen Date: Wed Sep 15 07:47:27 2021 +0300 net/{mlx5|nfp|bnxt}: Remove unnecessary RTNL lock assert Remove the assert from the callback priv lookup function since it does not require RTNL lock and is already protected by flow_indr_block_lock. This will avoid warnings from being emitted to dmesg if the driver registers its callback after an ingress qdisc was created for a netdevice. The warnings started after the following patch was merged: commit 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation") Signed-off-by: Eli Cohen Signed-off-by: David S. Miller commit 84fb7dfc7463afcba61281f36535576a7f7b0626 Author: Adam Borowski Date: Sun Sep 12 23:23:21 2021 +0200 net: wan: wanxl: define CROSS_COMPILE_M68K It was used but never set. The hardcoded value from before the dawn of time was non-standard; the usual name for cross-tools is $TRIPLET-$TOOL Signed-off-by: Adam Borowski Signed-off-by: David S. Miller commit 25766ee44ff8db4cdf8471b587dffb28b7b9d17f Author: Peter Ujfalusi Date: Thu Sep 16 11:53:42 2021 +0300 ASoC: SOF: loader: Re-phrase the missing firmware error to avoid duplication In case the firmware is missing we will have the following in the kernel log: 1 | Direct firmware load for intel/sof/sof-tgl-h.ri failed with error -2 2 | error: request firmware intel/sof/sof-tgl-h.ri failed err: -2 3 | you may need to download the firmware from https://github.com/thesofproject/sof-bin/ 4 | error: failed to load DSP firmware -2 5 | error: sof_probe_work failed err: -2 The first line is the standard, request_firmware() warning. The second and third line is printed in snd_sof_load_firmware_raw() Note that the first and second line is mostly identical. With this patch the log will be changed to: 1 | Direct firmware load for intel/sof/sof-tgl-h.ri failed with error -2 2 | error: sof firmware file is missing, you might need to 3 | download it from https://github.com/thesofproject/sof-bin/ 4 | error: failed to load DSP firmware -2 5 | error: sof_probe_work failed err: -2 Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210916085342.29993-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 8a8e1813ffc35111fc0b6db49968ceb0e1615ced Author: Marc Herbert Date: Thu Sep 16 11:50:08 2021 +0300 ASoC: SOF: loader: release_firmware() on load failure to avoid batching Invoke release_firmware() when the firmware fails to boot in sof_probe_continue(). The request_firmware() framework must be informed of failures in sof_probe_continue() otherwise its internal "batching" feature (different from caching) cached the firmware image forever. Attempts to correct the file in /lib/firmware/ were then silently and confusingly ignored until the next reboot. Unloading the drivers did not help because from their disconnected perspective the firmware had failed so there was nothing to release. Also leverage the new snd_sof_fw_unload() function to simplify the snd_sof_device_remove() function. Signed-off-by: Marc Herbert Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210916085008.28929-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 98dc68f8b0c2248bdc3688c90d2499247b9432e4 Author: Xiang wangx Date: Thu Sep 16 20:24:42 2021 +0800 selftests: nci: replace unsigned int with int Should not use comparison of unsigned expressions < 0. Signed-off-by: Xiang wangx Signed-off-by: David S. Miller commit 5aeb05b27f81269a2bf2e15eab9fc0f9a400d3a8 Author: Laurentiu Tudor Date: Wed Sep 15 11:09:39 2021 +0300 software node: balance refcount for managed software nodes software_node_notify(), on KOBJ_REMOVE drops the refcount twice on managed software nodes, thus leading to underflow errors. Balance the refcount by bumping it in the device_create_managed_software_node() function. The error [1] was encountered after adding a .shutdown() op to our fsl-mc-bus driver. [1] pc : refcount_warn_saturate+0xf8/0x150 lr : refcount_warn_saturate+0xf8/0x150 sp : ffff80001009b920 x29: ffff80001009b920 x28: ffff1a2420318000 x27: 0000000000000000 x26: ffffccac15e7a038 x25: 0000000000000008 x24: ffffccac168e0030 x23: ffff1a2428a82000 x22: 0000000000080000 x21: ffff1a24287b5000 x20: 0000000000000001 x19: ffff1a24261f4400 x18: ffffffffffffffff x17: 6f72645f726f7272 x16: 0000000000000000 x15: ffff80009009b607 x14: 0000000000000000 x13: ffffccac16602670 x12: 0000000000000a17 x11: 000000000000035d x10: ffffccac16602670 x9 : ffffccac16602670 x8 : 00000000ffffefff x7 : ffffccac1665a670 x6 : ffffccac1665a670 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000ffffffff x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff1a2420318000 Call trace: refcount_warn_saturate+0xf8/0x150 kobject_put+0x10c/0x120 software_node_notify+0xd8/0x140 device_platform_notify+0x4c/0xb4 device_del+0x188/0x424 fsl_mc_device_remove+0x2c/0x4c rebofind sp.c__fsl_mc_device_remove+0x14/0x2c device_for_each_child+0x5c/0xac dprc_remove+0x9c/0xc0 fsl_mc_driver_remove+0x28/0x64 __device_release_driver+0x188/0x22c device_release_driver+0x30/0x50 bus_remove_device+0x128/0x134 device_del+0x16c/0x424 fsl_mc_bus_remove+0x8c/0x114 fsl_mc_bus_shutdown+0x14/0x20 platform_shutdown+0x28/0x40 device_shutdown+0x15c/0x330 __do_sys_reboot+0x218/0x2a0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common+0x40/0xdc do_el0_svc+0x2c/0x94 el0_svc+0x2c/0x54 el0t_64_sync_handler+0xa8/0x12c el0t_64_sync+0x198/0x19c ---[ end trace 32eb1c71c7d86821 ]--- Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()") Reported-by: Jon Nettleton Suggested-by: Heikki Krogerus Reviewed-by: Heikki Krogerus Signed-off-by: Laurentiu Tudor Cc: 5.12+ # 5.12+ [ rjw: Fix up the software_node_notify() invocation ] Signed-off-by: Rafael J. Wysocki commit 94d508fa3186d0cbc63765aa94d5cf3bd847694c Author: Stefan Binding Date: Thu Sep 16 10:56:46 2021 +0100 ALSA: hda/cs8409: Setup Dolphin Headset Mic as Phantom Jack Dell's requirement to have headset mic as phantom jack on this specific dolphin hardware platform. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210916095646.7631-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit be830389bd49d3f1f8737bd45513361628641c08 Author: Alexey Dobriyan Date: Tue Sep 14 14:08:47 2021 +0300 ALSA: pcxhr: "fix" PCXHR_REG_TO_PORT definition The following preprocessor directive is non-compliant: #undef PCXHR_REG_TO_PORT(x) gcc warns about extra tokens but nobody sees them as they are under if branch which is never parsed. Make it an #error, it is not clear to me what the author meant. Signed-off-by: Alexey Dobriyan Link: https://lore.kernel.org/r/YUCCv47sm4zf9OVO@localhost.localdomain Signed-off-by: Takashi Iwai commit 54607282fae6148641a08d81a6e0953b541249c7 Author: Borislav Petkov Date: Thu Sep 16 10:44:06 2021 +0200 EDAC/dmc520: Assign the proper type to dimm->edac_mode dimm->edac_mode contains values of type enum edac_type - not the corresponding capability flags. Fix that. Fixes: 1088750d7839 ("EDAC: Add EDAC driver for DMC520") Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20210916085258.7544-1-bp@alien8.de commit db7bee653859ef7179be933e7d1384644f795f26 Author: Ilya Leoshkevich Date: Mon Sep 6 15:04:14 2021 +0200 s390/bpf: Fix optimizing out zero-extensions Currently the JIT completely removes things like `reg32 += 0`, however, the BPF_ALU semantics requires the target register to be zero-extended in such cases. Fix by optimizing out only the arithmetic operation, but not the subsequent zero-extension. Reported-by: Johan Almbladh Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend") Reviewed-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik commit 6e61dc9da0b7a0d91d57c2e20b5ea4fd2d4e7e53 Author: Ilya Leoshkevich Date: Tue Sep 7 13:41:16 2021 +0200 s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant The JIT uses agfi for subtracting constants, but -(-0x80000000) cannot be represented as a 32-bit signed binary integer. Fix by using algfi in this particular case. Reported-by: Johan Almbladh Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend") Reviewed-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik commit 1511df6f5e9ef32826f20db2ee81f8527154dc14 Author: Ilya Leoshkevich Date: Tue Sep 7 11:58:59 2021 +0200 s390/bpf: Fix branch shortening during codegen pass EMIT6_PCREL() macro assumes that the previous pass generated 6 bytes of code, which is not the case if branch shortening took place. Fix by using jit->prg, like all the other EMIT6_PCREL_*() macros. Reported-by: Johan Almbladh Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches") Signed-off-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik commit f2faea8b64125852fa9acc6771c07fc0311a039b Author: Lucas Stach Date: Fri Aug 20 22:18:30 2021 +0200 drm/etnaviv: add missing MMU context put when reaping MMU mapping When we forcefully evict a mapping from the the address space and thus the MMU context, the MMU context is leaked, as the mapping no longer points to it, so it doesn't get freed when the GEM object is destroyed. Add the mssing context put to fix the leak. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit d6408538f091fb22d47f792d4efa58143d56c3fb Author: Lucas Stach Date: Fri Aug 20 22:18:29 2021 +0200 drm/etnaviv: reference MMU context when setting up hardware state Move the refcount manipulation of the MMU context to the point where the hardware state is programmed. At that point it is also known if a previous MMU state is still there, or the state needs to be reprogrammed with a potentially different context. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit f978a5302f5566480c58ffae64a16d34456801bd Author: Lucas Stach Date: Fri Aug 20 22:18:28 2021 +0200 drm/etnaviv: fix MMU context leak on GPU reset After a reset the GPU is no longer using the MMU context and may be restarted with a different context. While the mmu_state proeprly was cleared, the context wasn't unreferenced, leading to a memory leak. Cc: stable@vger.kernel.org # 5.4 Reported-by: Michael Walle Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit 725cbc7884c37f3b4f1777bc1aea6432cded8ca5 Author: Lucas Stach Date: Fri Aug 20 22:18:27 2021 +0200 drm/etnaviv: exec and MMU state is lost when resetting the GPU When the GPU is reset both the current exec state, as well as all MMU state is lost. Move the driver side state tracking into the reset function to keep hardware and software state from diverging. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit 8f3eea9d01d7b0f95b0fe04187c0059019ada85b Author: Lucas Stach Date: Fri Aug 20 22:18:26 2021 +0200 drm/etnaviv: keep MMU context across runtime suspend/resume The MMU state may be kept across a runtime suspend/resume cycle, as we avoid a full hardware reset to keep the latency of the runtime PM small. Don't pretend that the MMU state is lost in driver state. The MMU context is pushed out when new HW jobs with a different context are coming in. The only exception to this is when the GPU is unbound, in which case we need to make sure to also free the last active context. Cc: stable@vger.kernel.org # 5.4 Reported-by: Michael Walle Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit 23e0f5a57d0ecec86e1fc82194acd94aede21a46 Author: Lucas Stach Date: Fri Aug 20 22:18:25 2021 +0200 drm/etnaviv: stop abusing mmu_context as FE running marker While the DMA frontend can only be active when the MMU context is set, the reverse isn't necessarily true, as the frontend can be stopped while the MMU state is kept. Stop treating mmu_context being set as a indication that the frontend is running and instead add a explicit property. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit cda7532916f7bc860b36a1806cb8352e6f63dacb Author: Lucas Stach Date: Fri Aug 20 22:18:24 2021 +0200 drm/etnaviv: put submit prev MMU context when it exists The prev context is the MMU context at the time of the job queueing in hardware. As a job might be queued multiple times due to recovery after a GPU hang, we need to make sure to put the stale prev MMU context from a prior queuing, to avoid the reference and thus the MMU context leaking. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit 78edefc05e41352099ffb8f06f8d9b2d091e29cd Author: Lucas Stach Date: Fri Aug 20 22:18:23 2021 +0200 drm/etnaviv: return context from etnaviv_iommu_context_get Being able to have the refcount manipulation in an assignment makes it much easier to parse the code. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner commit 5297cfa6bdf93e3889f78f9b482e2a595a376083 Author: Sai Krishna Potthuri Date: Wed Aug 18 12:53:14 2021 +0530 EDAC/synopsys: Fix wrong value type assignment for edac_mode dimm->edac_mode contains values of type enum edac_type - not the corresponding capability flags. Fix that. Issue caught by Coverity check "enumerated type mixed with another type." [ bp: Rewrite commit message, add tags. ] Fixes: ae9b56e3996d ("EDAC, synps: Add EDAC support for zynq ddr ecc controller") Signed-off-by: Sai Krishna Potthuri Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/20210818072315.15149-1-shubhrajyoti.datta@xilinx.com commit d46ef750ed58cbeeba2d9a55c99231c30a172764 Author: Evgeny Novikov Date: Tue Jun 1 19:38:01 2021 +0300 HID: amd_sfh: Fix potential NULL pointer dereference devm_add_action_or_reset() can suddenly invoke amd_mp2_pci_remove() at registration that will cause NULL pointer dereference since corresponding data is not initialized yet. The patch moves initialization of data before devm_add_action_or_reset(). Found by Linux Driver Verification project (linuxtesting.org). [jkosina@suse.cz: rebase] Signed-off-by: Evgeny Novikov Acked-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 90cc7bed1ed19f869ae7221a6b41887fe762a6a3 Author: Helge Deller Date: Thu Sep 16 08:35:42 2021 +0200 parisc: Use absolute_pointer() to define PAGE0 Use absolute_pointer() wrapper for PAGE0 to avoid this compiler warning: arch/parisc/kernel/setup.c: In function 'start_parisc': error: '__builtin_memcmp_eq' specified bound 8 exceeds source size 0 Signed-off-by: Helge Deller Co-Developed-by: Guenter Roeck Suggested-by: Linus Torvalds commit 17ac76e050c51497e75871a43aa3328ba54cdafd Author: Cai Huoqing Date: Tue Aug 31 15:49:58 2021 +0800 drm/exynos: 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 Signed-off-by: Inki Dae commit ff1ffd71d5f0612cf194f5705c671d6b64bf5f91 Merge: 453fa43cdb8e0 dfb5c1e12c28e Author: Linus Torvalds Date: Wed Sep 15 17:18:56 2021 -0700 Merge tag 'hyperv-fixes-signed-20210915' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix kernel crash caused by uio driver (Vitaly Kuznetsov) - Remove on-stack cpumask from HV APIC code (Wei Liu) * tag 'hyperv-fixes-signed-20210915' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself asm-generic/hyperv: provide cpumask_to_vpset_noself Drivers: hv: vmbus: Fix kernel crash upon unbinding a device from uio_hv_generic driver commit 453fa43cdb8e0f4231ab84755fd2fc562823541b Merge: b7213ffa0e585 13be2efc390ac Author: Linus Torvalds Date: Wed Sep 15 17:06:01 2021 -0700 Merge tag 'rtc-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC fix from Alexandre Belloni: "Fix a locking issue in the cmos rtc driver" * tag 'rtc-5.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: cmos: Disable irq around direct invocation of cmos_interrupt() commit a57d8c217aadac75530b8e7ffb3a3e1b7bfd0330 Author: Vladimir Oltean Date: Tue Sep 14 16:47:26 2021 +0300 net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports Sometimes when unbinding the mv88e6xxx driver on Turris MOX, these error messages appear: mv88e6085 d0032004.mdio-mii:12: port 1 failed to delete be:79:b4:9e:9e:96 vid 1 from fdb: -2 mv88e6085 d0032004.mdio-mii:12: port 1 failed to delete be:79:b4:9e:9e:96 vid 0 from fdb: -2 mv88e6085 d0032004.mdio-mii:12: port 1 failed to delete d8:58:d7:00:ca:6d vid 100 from fdb: -2 mv88e6085 d0032004.mdio-mii:12: port 1 failed to delete d8:58:d7:00:ca:6d vid 1 from fdb: -2 mv88e6085 d0032004.mdio-mii:12: port 1 failed to delete d8:58:d7:00:ca:6d vid 0 from fdb: -2 (and similarly for other ports) What happens is that DSA has a policy "even if there are bugs, let's at least not leak memory" and dsa_port_teardown() clears the dp->fdbs and dp->mdbs lists, which are supposed to be empty. But deleting that cleanup code, the warnings go away. => the FDB and MDB lists (used for refcounting on shared ports, aka CPU and DSA ports) will eventually be empty, but are not empty by the time we tear down those ports. Aka we are deleting them too soon. The addresses that DSA complains about are host-trapped addresses: the local addresses of the ports, and the MAC address of the bridge device. The problem is that offloading those entries happens from a deferred work item scheduled by the SWITCHDEV_FDB_DEL_TO_DEVICE handler, and this races with the teardown of the CPU and DSA ports where the refcounting is kept. In fact, not only it races, but fundamentally speaking, if we iterate through the port list linearly, we might end up tearing down the shared ports even before we delete a DSA user port which has a bridge upper. So as it turns out, we need to first tear down the user ports (and the unused ones, for no better place of doing that), then the shared ports (the CPU and DSA ports). In between, we need to ensure that all work items scheduled by our switchdev handlers (which only run for user ports, hence the reason why we tear them down first) have finished. Fixes: 161ca59d39e9 ("net: dsa: reference count the MDB entries at the cross-chip notifier level") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20210914134726.2305133-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 301de697d869be6564aebeb5ab811c84c0a7abed Author: Vladimir Oltean Date: Tue Sep 14 17:05:15 2021 +0300 Revert "net: phy: Uniform PHY driver access" This reverts commit 3ac8eed62596387214869319379c1fcba264d8c6, which did more than it said on the box, and not only it replaced to_phy_driver with phydev->drv, but it also removed the "!drv" check, without actually explaining why that is fine. That patch in fact breaks suspend/resume on any system which has PHY devices with no drivers bound. The stack trace is: Unable to handle kernel NULL pointer dereference at virtual address 00000000000000e8 pc : mdio_bus_phy_suspend+0xd8/0xec lr : dpm_run_callback+0x38/0x90 Call trace: mdio_bus_phy_suspend+0xd8/0xec dpm_run_callback+0x38/0x90 __device_suspend+0x108/0x3cc dpm_suspend+0x140/0x210 dpm_suspend_start+0x7c/0xa0 suspend_devices_and_enter+0x13c/0x540 pm_suspend+0x2a4/0x330 Examples why that assumption is not fine: - There is an MDIO bus with a PHY device that doesn't have a specific PHY driver loaded, because mdiobus_register() automatically creates a PHY device for it but there is no specific PHY driver in the system. Normally under those circumstances, the generic PHY driver will be bound lazily to it (at phy_attach_direct time). But some Ethernet drivers attach to their PHY at .ndo_open time. Until then it, the to-be-driven-by-genphy PHY device will not have a driver. The blamed patch amounts to saying "you need to open all net devices before the system can suspend, to avoid the NULL pointer dereference". - There is any raw MDIO device which has 'plausible' values in the PHY ID registers 2 and 3, which is located on an MDIO bus whose driver does not set bus->phy_mask = ~0 (which prevents auto-scanning of PHY devices). An example could be a MAC's internal MDIO bus with PCS devices on it, for serial links such as SGMII. PHY devices will get created for those PCSes too, due to that MDIO bus auto-scanning, and although those PHY devices are not used, they do not bother anybody either. PCS devices are usually managed in Linux as raw MDIO devices. Nonetheless, they do not have a PHY driver, nor does anybody attempt to connect to them (because they are not a PHY), and therefore this patch breaks that. The goal itself of the patch is questionable, so I am going for a straight revert. to_phy_driver does not seem to have a need to be replaced by phydev->drv, in fact that might even trigger code paths which were not given too deep of a thought. For instance: phy_probe populates phydev->drv at the beginning, but does not clean it up on any error (including EPROBE_DEFER). So if the phydev driver requests probe deferral, phydev->drv will remain populated despite there being no driver bound. If a system suspend starts in between the initial probe deferral request and the subsequent probe retry, we will be calling the phydev->drv->suspend method, but _before_ any phydev->drv->probe call has succeeded. That is to say, if the phydev->drv is allocating any driver-private data structure in ->probe, it pretty much expects that data structure to be available in ->suspend. But it may not. That is a pretty insane environment to present to PHY drivers. In the code structure before the blamed patch, mdio_bus_phy_may_suspend would just say "no, don't suspend" to any PHY device which does not have a driver pointer _in_the_device_structure_ (not the phydev->drv). That would essentially ensure that ->suspend will never get called for a device that has not yet successfully completed probe. This is the code structure the patch is returning to, via the revert. Fixes: 3ac8eed62596 ("net: phy: Uniform PHY driver access") Signed-off-by: Vladimir Oltean Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20210914140515.2311548-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 6a52e73368038f47f6618623d75061dc263b26ae Author: Vladimir Oltean Date: Tue Sep 14 16:43:31 2021 +0300 net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup DSA supports connecting to a phy-handle, and has a fallback to a non-OF based method of connecting to an internal PHY on the switch's own MDIO bus, if no phy-handle and no fixed-link nodes were present. The -ENODEV error code from the first attempt (phylink_of_phy_connect) is what triggers the second attempt (phylink_connect_phy). However, when the first attempt returns a different error code than -ENODEV, this results in an unbalance of calls to phylink_create and phylink_destroy by the time we exit the function. The phylink instance has leaked. There are many other error codes that can be returned by phylink_of_phy_connect. For example, phylink_validate returns -EINVAL. So this is a practical issue too. Fixes: aab9c4067d23 ("net: dsa: Plug in PHYLINK support") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20210914134331.2303380-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit e042a4533fc346a655de7f1b8ac1fa01a2ed96e5 Author: Jon Derrick Date: Thu Sep 9 15:02:21 2021 -0500 MAINTAINERS: Add Nirmal Patel as VMD maintainer Change my email to my unaffiliated address and move me to reviewer status. Link: https://lore.kernel.org/r/20210909200221.29981-1-jonathan.derrick@intel.com Signed-off-by: Jon Derrick Signed-off-by: Jon Derrick Signed-off-by: Bjorn Helgaas Cc: Nirmal Patel commit 60b78ed088ebe1a872ee1320b6c5ad6ee2c4bd9a Author: Evan Quan Date: Fri Sep 3 14:33:11 2021 +0800 PCI: Add AMD GPU multi-function power dependencies Some AMD GPUs have built-in USB xHCI and USB Type-C UCSI controllers with power dependencies between the GPU and the other functions as in 6d2e369f0d4c ("PCI: Add NVIDIA GPU multi-function power dependencies"). Add device link support for the AMD integrated USB xHCI and USB Type-C UCSI controllers. Without this, runtime power management, including GPU resume and temp and fan sensors don't work correctly. Reported-at: https://gitlab.freedesktop.org/drm/amd/-/issues/1704 Link: https://lore.kernel.org/r/20210903063311.3606226-1-evan.quan@amd.com Signed-off-by: Evan Quan Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 6bd65974dedd1e8638e6665e92ccbf26e8a67cbf Author: Jean-Philippe Brucker Date: Mon Sep 13 18:23:59 2021 +0100 PCI/ACPI: Don't reset a fwnode set by OF Commit 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") added a call to pci_set_acpi_fwnode() in pci_setup_device(), which unconditionally clears any fwnode previously set by pci_set_of_node(). pci_set_acpi_fwnode() looks for ACPI_COMPANION(), which only returns the existing fwnode if it was set by ACPI_COMPANION_SET(). If it was set by OF instead, ACPI_COMPANION() returns NULL and pci_set_acpi_fwnode() accidentally clears the fwnode. To fix this, look for any fwnode instead of just ACPI companions. Fixes a virtio-iommu boot regression in v5.15-rc1. Fixes: 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") Link: https://lore.kernel.org/r/20210913172358.1775381-1-jean-philippe@linaro.org Signed-off-by: Jean-Philippe Brucker Signed-off-by: Bjorn Helgaas Acked-by: Rob Herring Acked-by: Rafael J. Wysocki commit 00e1a5d21b4ff514593554167b28a8caeda1497f Author: Bjorn Helgaas Date: Mon Sep 13 16:13:26 2021 -0500 PCI/VPD: Defer VPD sizing until first access 7bac54497c3e ("PCI/VPD: Determine VPD size in pci_vpd_init()") reads VPD at enumeration-time to find the size. But this is quite slow, and we don't need the size until we actually need data from VPD. Dave reported a boot slowdown of more than two minutes [1]. Defer the VPD sizing until a driver or the user (via sysfs) requests information from VPD. If devices are quirked because VPD is known not to work, don't bother even looking for the VPD capability. The VPD will not be accessible at all. [1] https://lore.kernel.org/r/20210913141818.GA27911@codemonkey.org.uk/ Link: https://lore.kernel.org/r/20210914215543.GA1437800@bjorn-Precision-5520 Fixes: 7bac54497c3e ("PCI/VPD: Determine VPD size in pci_vpd_init()") Signed-off-by: Bjorn Helgaas commit a1e4470823d99e75b596748086e120dea169ed3c Author: Jiapeng Chong Date: Fri Aug 13 14:40:42 2021 +0800 fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'. Eliminate the follow smatch warning: drivers/fpga/machxo2-spi.c:341 machxo2_write_complete() warn: missing error code 'ret'. [mdf@kernel.org: Reworded commit message] Fixes: 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2 support") Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Moritz Fischer commit 34331739e19fd6a293d488add28832ad49c9fc54 Author: Tom Rix Date: Tue Aug 10 09:40:36 2021 -0700 fpga: machxo2-spi: Return an error on failure Earlier successes leave 'ret' in a non error state, so these errors are not reported. Set ret to -EINVAL before going to the error handler. This addresses two issues reported by smatch: drivers/fpga/machxo2-spi.c:229 machxo2_write_init() warn: missing error code 'ret' drivers/fpga/machxo2-spi.c:316 machxo2_write_complete() warn: missing error code 'ret' [mdf@kernel.org: Reworded commit message] Fixes: 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2 support") Reported-by: Dan Carpenter Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit b7213ffa0e585feb1aee3e7173e965e66ee0abaa Author: Linus Torvalds Date: Wed Sep 15 13:56:37 2021 -0700 qnx4: avoid stringop-overread errors The qnx4 directory entries are 64-byte blocks that have different contents depending on the a status byte that is in the last byte of the block. In particular, a directory entry can be either a "link info" entry with a 48-byte name and pointers to the real inode information, or an "inode entry" with a smaller 16-byte name and the full inode information. But the code was written to always just treat the directory name as if it was part of that "inode entry", and just extend the name to the longer case if the status byte said it was a link entry. That work just fine and gives the right results, but now that gcc is tracking data structure accesses much more, the code can trigger a compiler error about using up to 48 bytes (the long name) in a structure that only has that shorter name in it: fs/qnx4/dir.c: In function ‘qnx4_readdir’: fs/qnx4/dir.c:51:32: error: ‘strnlen’ specified bound 48 exceeds source size 16 [-Werror=stringop-overread] 51 | size = strnlen(de->di_fname, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from fs/qnx4/qnx4.h:3, from fs/qnx4/dir.c:16: include/uapi/linux/qnx4_fs.h:45:25: note: source object declared here 45 | char di_fname[QNX4_SHORT_NAME_MAX]; | ^~~~~~~~ which is because the source code doesn't really make this whole "one of two different types" explicit. Fix this by introducing a very explicit union of the two types, and basically explaining to the compiler what is really going on. Signed-off-by: Linus Torvalds commit fc7c028dcdbfe981bca75d2a7b95f363eb691ef3 Author: Linus Torvalds Date: Mon Sep 6 16:06:04 2021 -0700 sparc: avoid stringop-overread errors The sparc mdesc code does pointer games with 'struct mdesc_hdr', but didn't describe to the compiler how that header is then followed by the data that the header describes. As a result, gcc is now unhappy since it does stricter pointer range tracking, and doesn't understand about how these things work. This results in various errors like: arch/sparc/kernel/mdesc.c: In function ‘mdesc_node_by_name’: arch/sparc/kernel/mdesc.c:647:22: error: ‘strcmp’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread] 647 | if (!strcmp(names + ep[ret].name_offset, name)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ which are easily avoided by just describing 'struct mdesc_hdr' better, and making the node_block() helper function look into that unsized data[] that follows the header. This makes the sparc64 build happy again at least for my cross-compiler version (gcc version 11.2.1). Link: https://lore.kernel.org/lkml/CAHk-=wi4NW3NC0xWykkw=6LnjQD6D_rtRtxY9g8gQAJXtQMi8A@mail.gmail.com/ Cc: Guenter Roeck Cc: David S. Miller Signed-off-by: Linus Torvalds commit 37cb28ec7d3a36a5bace7063a3dba633ab110f8b Author: Piotr Krysiuk Date: Wed Sep 15 17:04:37 2021 +0100 bpf, mips: Validate conditional branch offsets The conditional branch instructions on MIPS use 18-bit signed offsets allowing for a branch range of 128 KBytes (backward and forward). However, this limit is not observed by the cBPF JIT compiler, and so the JIT compiler emits out-of-range branches when translating certain cBPF programs. A specific example of such a cBPF program is included in the "BPF_MAXINSNS: exec all MSH" test from lib/test_bpf.c that executes anomalous machine code containing incorrect branch offsets under JIT. Furthermore, this issue can be abused to craft undesirable machine code, where the control flow is hijacked to execute arbitrary Kernel code. The following steps can be used to reproduce the issue: # echo 1 > /proc/sys/net/core/bpf_jit_enable # modprobe test_bpf test_name="BPF_MAXINSNS: exec all MSH" This should produce multiple warnings from build_bimm() similar to: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 209 at arch/mips/mm/uasm-mips.c:210 build_insn+0x558/0x590 Micro-assembler field overflow Modules linked in: test_bpf(+) CPU: 0 PID: 209 Comm: modprobe Not tainted 5.14.3 #1 Stack : 00000000 807bb824 82b33c9c 801843c0 00000000 00000004 00000000 63c9b5ee 82b33af4 80999898 80910000 80900000 82fd6030 00000001 82b33a98 82087180 00000000 00000000 80873b28 00000000 000000fc 82b3394c 00000000 2e34312e 6d6d6f43 809a180f 809a1836 6f6d203a 80900000 00000001 82b33bac 80900000 00027f80 00000000 00000000 807bb824 00000000 804ed790 001cc317 00000001 [...] Call Trace: [<80108f44>] show_stack+0x38/0x118 [<807a7aac>] dump_stack_lvl+0x5c/0x7c [<807a4b3c>] __warn+0xcc/0x140 [<807a4c3c>] warn_slowpath_fmt+0x8c/0xb8 [<8011e198>] build_insn+0x558/0x590 [<8011e358>] uasm_i_bne+0x20/0x2c [<80127b48>] build_body+0xa58/0x2a94 [<80129c98>] bpf_jit_compile+0x114/0x1e4 [<80613fc4>] bpf_prepare_filter+0x2ec/0x4e4 [<8061423c>] bpf_prog_create+0x80/0xc4 [] test_bpf_init+0x300/0xba8 [test_bpf] [<8010051c>] do_one_initcall+0x50/0x1d4 [<801c5e54>] do_init_module+0x60/0x220 [<801c8b20>] sys_finit_module+0xc4/0xfc [<801144d0>] syscall_common+0x34/0x58 [...] ---[ end trace a287d9742503c645 ]--- Then the anomalous machine code executes: => 0xc0a18000: addiu sp,sp,-16 0xc0a18004: sw s3,0(sp) 0xc0a18008: sw s4,4(sp) 0xc0a1800c: sw s5,8(sp) 0xc0a18010: sw ra,12(sp) 0xc0a18014: move s5,a0 0xc0a18018: move s4,zero 0xc0a1801c: move s3,zero # __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0) 0xc0a18020: lui t6,0x8012 0xc0a18024: ori t4,t6,0x9e14 0xc0a18028: li a1,0 0xc0a1802c: jalr t4 0xc0a18030: move a0,s5 0xc0a18034: bnez v0,0xc0a1ffb8 # incorrect branch offset 0xc0a18038: move v0,zero 0xc0a1803c: andi s4,s3,0xf 0xc0a18040: b 0xc0a18048 0xc0a18044: sll s4,s4,0x2 [...] # __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0) 0xc0a1ffa0: lui t6,0x8012 0xc0a1ffa4: ori t4,t6,0x9e14 0xc0a1ffa8: li a1,0 0xc0a1ffac: jalr t4 0xc0a1ffb0: move a0,s5 0xc0a1ffb4: bnez v0,0xc0a1ffb8 # incorrect branch offset 0xc0a1ffb8: move v0,zero 0xc0a1ffbc: andi s4,s3,0xf 0xc0a1ffc0: b 0xc0a1ffc8 0xc0a1ffc4: sll s4,s4,0x2 # __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0) 0xc0a1ffc8: lui t6,0x8012 0xc0a1ffcc: ori t4,t6,0x9e14 0xc0a1ffd0: li a1,0 0xc0a1ffd4: jalr t4 0xc0a1ffd8: move a0,s5 0xc0a1ffdc: bnez v0,0xc0a3ffb8 # correct branch offset 0xc0a1ffe0: move v0,zero 0xc0a1ffe4: andi s4,s3,0xf 0xc0a1ffe8: b 0xc0a1fff0 0xc0a1ffec: sll s4,s4,0x2 [...] # epilogue 0xc0a3ffb8: lw s3,0(sp) 0xc0a3ffbc: lw s4,4(sp) 0xc0a3ffc0: lw s5,8(sp) 0xc0a3ffc4: lw ra,12(sp) 0xc0a3ffc8: addiu sp,sp,16 0xc0a3ffcc: jr ra 0xc0a3ffd0: nop To mitigate this issue, we assert the branch ranges for each emit call that could generate an out-of-range branch. Fixes: 36366e367ee9 ("MIPS: BPF: Restore MIPS32 cBPF JIT") Fixes: c6610de353da ("MIPS: net: Add BPF JIT") Signed-off-by: Piotr Krysiuk Signed-off-by: Daniel Borkmann Tested-by: Johan Almbladh Acked-by: Johan Almbladh Cc: Paul Burton Cc: Thomas Bogendoerfer Link: https://lore.kernel.org/bpf/20210915160437.4080-1-piotras@gmail.com commit d6efd3f18763ac84098fa318742cd2a3bfdf4d72 Merge: 80be5998ad633 ebdc20d7bc74e Author: Linus Torvalds Date: Wed Sep 15 12:11:48 2021 -0700 Merge branch 'absolute-pointer' (patches from Guenter) Merge absolute_pointer macro series from Guenter Roeck: "Kernel test builds currently fail for several architectures with error messages such as the following. drivers/net/ethernet/i825xx/82596.c: In function 'i82596_probe': arch/m68k/include/asm/string.h:72:25: error: '__builtin_memcpy' reading 6 bytes from a region of size 0 [-Werror=stringop-overread] Such warnings may be reported by gcc 11.x for string and memory operations on fixed addresses if gcc's builtin functions are used for those operations. This series introduces absolute_pointer() to fix the problem. absolute_pointer() disassociates a pointer from its originating symbol type and context, and thus prevents gcc from making assumptions about pointers passed to memory operations" * emailed patches from Guenter Roeck : alpha: Use absolute_pointer to define COMMAND_LINE alpha: Move setup.h out of uapi net: i825xx: Use absolute_pointer for memcpy from fixed memory location compiler.h: Introduce absolute_pointer macro commit ebdc20d7bc74e8b6a242ff1f30e9017ffca9092c Author: Guenter Roeck Date: Tue Sep 14 20:52:27 2021 -0700 alpha: Use absolute_pointer to define COMMAND_LINE alpha:allmodconfig fails to build with the following error when using gcc 11.x. arch/alpha/kernel/setup.c: In function 'setup_arch': arch/alpha/kernel/setup.c:493:13: error: 'strcmp' reading 1 or more bytes from a region of size 0 Avoid the problem by declaring COMMAND_LINE as absolute_pointer(). Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 3cb8b1537f8a89a681d2548ded5526280846f6db Author: Guenter Roeck Date: Tue Sep 14 20:52:26 2021 -0700 alpha: Move setup.h out of uapi Most of the contents of setup.h have no value for userspace applications. The file was probably moved to uapi accidentally. Keep the file in uapi to define the alpha-specific COMMAND_LINE_SIZE. Move all other defines to arch/alpha/include/asm/setup.h. Suggested-by: Linus Torvalds Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit dff2d13114f0beec448da9b3716204eb34b0cf41 Author: Guenter Roeck Date: Tue Sep 14 20:52:25 2021 -0700 net: i825xx: Use absolute_pointer for memcpy from fixed memory location gcc 11.x reports the following compiler warning/error. drivers/net/ethernet/i825xx/82596.c: In function 'i82596_probe': arch/m68k/include/asm/string.h:72:25: error: '__builtin_memcpy' reading 6 bytes from a region of size 0 [-Werror=stringop-overread] Use absolute_pointer() to work around the problem. Cc: Geert Uytterhoeven Signed-off-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds commit f6b5f1a56987de837f8e25cd560847106b8632a8 Author: Guenter Roeck Date: Tue Sep 14 20:52:24 2021 -0700 compiler.h: Introduce absolute_pointer macro absolute_pointer() disassociates a pointer from its originating symbol type and context. Use it to prevent compiler warnings/errors such as drivers/net/ethernet/i825xx/82596.c: In function 'i82596_probe': arch/m68k/include/asm/string.h:72:25: error: '__builtin_memcpy' reading 6 bytes from a region of size 0 [-Werror=stringop-overread] Such warnings may be reported by gcc 11.x for string and memory operations on fixed addresses. Suggested-by: Linus Torvalds Signed-off-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds commit 858560b27645e7e97aca37ee8f232cccd658fbd2 Author: Li Jinlin Date: Tue Sep 14 12:26:05 2021 +0800 blk-cgroup: fix UAF by grabbing blkcg lock before destroying blkg pd KASAN reports a use-after-free report when doing fuzz test: [693354.104835] ================================================================== [693354.105094] BUG: KASAN: use-after-free in bfq_io_set_weight_legacy+0xd3/0x160 [693354.105336] Read of size 4 at addr ffff888be0a35664 by task sh/1453338 [693354.105607] CPU: 41 PID: 1453338 Comm: sh Kdump: loaded Not tainted 4.18.0-147 [693354.105610] Hardware name: Huawei 2288H V5/BC11SPSCB0, BIOS 0.81 07/02/2018 [693354.105612] Call Trace: [693354.105621] dump_stack+0xf1/0x19b [693354.105626] ? show_regs_print_info+0x5/0x5 [693354.105634] ? printk+0x9c/0xc3 [693354.105638] ? cpumask_weight+0x1f/0x1f [693354.105648] print_address_description+0x70/0x360 [693354.105654] kasan_report+0x1b2/0x330 [693354.105659] ? bfq_io_set_weight_legacy+0xd3/0x160 [693354.105665] ? bfq_io_set_weight_legacy+0xd3/0x160 [693354.105670] bfq_io_set_weight_legacy+0xd3/0x160 [693354.105675] ? bfq_cpd_init+0x20/0x20 [693354.105683] cgroup_file_write+0x3aa/0x510 [693354.105693] ? ___slab_alloc+0x507/0x540 [693354.105698] ? cgroup_file_poll+0x60/0x60 [693354.105702] ? 0xffffffff89600000 [693354.105708] ? usercopy_abort+0x90/0x90 [693354.105716] ? mutex_lock+0xef/0x180 [693354.105726] kernfs_fop_write+0x1ab/0x280 [693354.105732] ? cgroup_file_poll+0x60/0x60 [693354.105738] vfs_write+0xe7/0x230 [693354.105744] ksys_write+0xb0/0x140 [693354.105749] ? __ia32_sys_read+0x50/0x50 [693354.105760] do_syscall_64+0x112/0x370 [693354.105766] ? syscall_return_slowpath+0x260/0x260 [693354.105772] ? do_page_fault+0x9b/0x270 [693354.105779] ? prepare_exit_to_usermode+0xf9/0x1a0 [693354.105784] ? enter_from_user_mode+0x30/0x30 [693354.105793] entry_SYSCALL_64_after_hwframe+0x65/0xca [693354.105875] Allocated by task 1453337: [693354.106001] kasan_kmalloc+0xa0/0xd0 [693354.106006] kmem_cache_alloc_node_trace+0x108/0x220 [693354.106010] bfq_pd_alloc+0x96/0x120 [693354.106015] blkcg_activate_policy+0x1b7/0x2b0 [693354.106020] bfq_create_group_hierarchy+0x1e/0x80 [693354.106026] bfq_init_queue+0x678/0x8c0 [693354.106031] blk_mq_init_sched+0x1f8/0x460 [693354.106037] elevator_switch_mq+0xe1/0x240 [693354.106041] elevator_switch+0x25/0x40 [693354.106045] elv_iosched_store+0x1a1/0x230 [693354.106049] queue_attr_store+0x78/0xb0 [693354.106053] kernfs_fop_write+0x1ab/0x280 [693354.106056] vfs_write+0xe7/0x230 [693354.106060] ksys_write+0xb0/0x140 [693354.106064] do_syscall_64+0x112/0x370 [693354.106069] entry_SYSCALL_64_after_hwframe+0x65/0xca [693354.106114] Freed by task 1453336: [693354.106225] __kasan_slab_free+0x130/0x180 [693354.106229] kfree+0x90/0x1b0 [693354.106233] blkcg_deactivate_policy+0x12c/0x220 [693354.106238] bfq_exit_queue+0xf5/0x110 [693354.106241] blk_mq_exit_sched+0x104/0x130 [693354.106245] __elevator_exit+0x45/0x60 [693354.106249] elevator_switch_mq+0xd6/0x240 [693354.106253] elevator_switch+0x25/0x40 [693354.106257] elv_iosched_store+0x1a1/0x230 [693354.106261] queue_attr_store+0x78/0xb0 [693354.106264] kernfs_fop_write+0x1ab/0x280 [693354.106268] vfs_write+0xe7/0x230 [693354.106271] ksys_write+0xb0/0x140 [693354.106275] do_syscall_64+0x112/0x370 [693354.106280] entry_SYSCALL_64_after_hwframe+0x65/0xca [693354.106329] The buggy address belongs to the object at ffff888be0a35580 which belongs to the cache kmalloc-1k of size 1024 [693354.106736] The buggy address is located 228 bytes inside of 1024-byte region [ffff888be0a35580, ffff888be0a35980) [693354.107114] The buggy address belongs to the page: [693354.107273] page:ffffea002f828c00 count:1 mapcount:0 mapping:ffff888107c17080 index:0x0 compound_mapcount: 0 [693354.107606] flags: 0x17ffffc0008100(slab|head) [693354.107760] raw: 0017ffffc0008100 ffffea002fcbc808 ffffea0030bd3a08 ffff888107c17080 [693354.108020] raw: 0000000000000000 00000000001c001c 00000001ffffffff 0000000000000000 [693354.108278] page dumped because: kasan: bad access detected [693354.108511] Memory state around the buggy address: [693354.108671] ffff888be0a35500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [693354.116396] ffff888be0a35580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [693354.124473] >ffff888be0a35600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [693354.132421] ^ [693354.140284] ffff888be0a35680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [693354.147912] ffff888be0a35700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [693354.155281] ================================================================== blkgs are protected by both queue and blkcg locks and holding either should stabilize them. However, the path of destroying blkg policy data is only protected by queue lock in blkcg_activate_policy()/blkcg_deactivate_policy(). Other tasks can get the blkg policy data before the blkg policy data is destroyed, and use it after destroyed, which will result in a use-after-free. CPU0 CPU1 blkcg_deactivate_policy spin_lock_irq(&q->queue_lock) bfq_io_set_weight_legacy spin_lock_irq(&blkcg->lock) blkg_to_bfqg(blkg) pd_to_bfqg(blkg->pd[pol->plid]) ^^^^^^blkg->pd[pol->plid] != NULL bfqg != NULL pol->pd_free_fn(blkg->pd[pol->plid]) pd_to_bfqg(blkg->pd[pol->plid]) bfqg_put(bfqg) kfree(bfqg) blkg->pd[pol->plid] = NULL spin_unlock_irq(q->queue_lock); bfq_group_set_weight(bfqg, val, 0) bfqg->entity.new_weight ^^^^^^trigger uaf here spin_unlock_irq(&blkcg->lock); Fix by grabbing the matching blkcg lock before trying to destroy blkg policy data. Suggested-by: Tejun Heo Signed-off-by: Li Jinlin Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20210914042605.3260596-1-lijinlin3@huawei.com Signed-off-by: Jens Axboe commit 6f5ddde41069fcd1f0993ec76c9dbbf9d021fd4d Author: Yanfei Xu Date: Wed Sep 15 15:24:26 2021 +0800 blkcg: fix memory leak in blk_iolatency_init BUG: memory leak unreferenced object 0xffff888129acdb80 (size 96): comm "syz-executor.1", pid 12661, jiffies 4294962682 (age 15.220s) hex dump (first 32 bytes): 20 47 c9 85 ff ff ff ff 20 d4 8e 29 81 88 ff ff G...... ..).... 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:591 [inline] [] kzalloc include/linux/slab.h:721 [inline] [] blk_iolatency_init+0x28/0x190 block/blk-iolatency.c:724 [] blkcg_init_queue+0xb4/0x1c0 block/blk-cgroup.c:1185 [] blk_alloc_queue+0x22a/0x2e0 block/blk-core.c:566 [] blk_mq_init_queue_data block/blk-mq.c:3100 [inline] [] __blk_mq_alloc_disk+0x25/0xd0 block/blk-mq.c:3124 [] loop_add+0x1c3/0x360 drivers/block/loop.c:2344 [] loop_control_get_free drivers/block/loop.c:2501 [inline] [] loop_control_ioctl+0x17e/0x2e0 drivers/block/loop.c:2516 [] 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+0xfc/0x140 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 Once blk_throtl_init() queue init failed, blkcg_iolatency_exit() will not be invoked for cleanup. That leads a memory leak. Swap the blk_throtl_init() and blk_iolatency_init() calls can solve this. Reported-by: syzbot+01321b15cc98e6bf96d6@syzkaller.appspotmail.com Fixes: 19688d7f9592 (block/blk-cgroup: Swap the blk_throtl_init() and blk_iolatency_init() calls) Signed-off-by: Yanfei Xu Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20210915072426.4022924-1-yanfei.xu@windriver.com Signed-off-by: Jens Axboe commit 80be5998ad6339e3e804a772723390cb50b96428 Author: Masami Hiramatsu Date: Wed Sep 15 09:53:38 2021 +0900 tools/bootconfig: Define memblock_free_ptr() to fix build error The lib/bootconfig.c file is shared with the 'bootconfig' tooling, and as a result, the changes incommit 77e02cf57b6c ("memblock: introduce saner 'memblock_free_ptr()' interface") need to also be reflected in the tooling header file. So define the new memblock_free_ptr() wrapper, and remove unused __pa() and memblock_free(). Fixes: 77e02cf57b6c ("memblock: introduce saner 'memblock_free_ptr()' interface") Signed-off-by: Masami Hiramatsu Signed-off-by: Linus Torvalds commit 8914a7a247e065438a0ec86a58c1c359223d2c9e Author: Li Zhijian Date: Wed Sep 15 21:45:54 2021 +0800 selftests: be sure to make khdr before other targets LKP/0Day reported some building errors about kvm, and errors message are not always same: - lib/x86_64/processor.c:1083:31: error: ‘KVM_CAP_NESTED_STATE’ undeclared (first use in this function); did you mean ‘KVM_CAP_PIT_STATE2’? - lib/test_util.c:189:30: error: ‘MAP_HUGE_16KB’ undeclared (first use in this function); did you mean ‘MAP_HUGE_16GB’? Although kvm relies on the khdr, they still be built in parallel when -j is specified. In this case, it will cause compiling errors. Here we mark target khdr as NOTPARALLEL to make it be always built first. CC: Philip Li Reported-by: kernel test robot Signed-off-by: Li Zhijian Signed-off-by: Shuah Khan commit 81121524f1c798c9481bd7900450b72ee7ac2eef Author: Boqun Feng Date: Thu Sep 9 12:59:19 2021 +0200 locking/rwbase: Take care of ordering guarantee for fastpath reader Readers of rwbase can lock and unlock without taking any inner lock, if that happens, we need the ordering provided by atomic operations to satisfy the ordering semantics of lock/unlock. Without that, considering the follow case: { X = 0 initially } CPU 0 CPU 1 ===== ===== rt_write_lock(); X = 1 rt_write_unlock(): atomic_add(READER_BIAS - WRITER_BIAS, ->readers); // ->readers is READER_BIAS. rt_read_lock(): if ((r = atomic_read(->readers)) < 0) // True atomic_try_cmpxchg(->readers, r, r + 1); // succeed. r1 = X; // r1 may be 0, because nothing prevent the reordering // of "X=1" and atomic_add() on CPU 1. Therefore audit every usage of atomic operations that may happen in a fast path, and add necessary barriers. Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20210909110203.953991276@infradead.org commit 616be87eac9fa2ab2dca1069712f7236e50f3bf6 Author: Peter Zijlstra Date: Thu Sep 9 12:59:18 2021 +0200 locking/rwbase: Extract __rwbase_write_trylock() The code in rwbase_write_lock() is a little non-obvious vs the read+set 'trylock', extract the sequence into a helper function to clarify the code. This also provides a single site to fix fast-path ordering. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/YUCq3L+u44NDieEJ@hirez.programming.kicks-ass.net commit 7687201e37fabf2b7cf2b828f7ca46bf30e2948f Author: Peter Zijlstra Date: Thu Sep 9 12:59:17 2021 +0200 locking/rwbase: Properly match set_and_save_state() to restore_state() Noticed while looking at the readers race. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20210909110203.828203010@infradead.org commit b89a05b21f46150ac10a962aa50109250b56b03b Author: Baptiste Lepers Date: Mon Sep 6 11:53:10 2021 +1000 events: Reuse value read using READ_ONCE instead of re-reading it In perf_event_addr_filters_apply, the task associated with the event (event->ctx->task) is read using READ_ONCE at the beginning of the function, checked, and then re-read from event->ctx->task, voiding all guarantees of the checks. Reuse the value that was read by READ_ONCE to ensure the consistency of the task struct throughout the function. Fixes: 375637bc52495 ("perf/core: Introduce address range filtering") Signed-off-by: Baptiste Lepers Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210906015310.12802-1-baptiste.lepers@gmail.com commit d9be4a88c3627c270bbe032b623dc43f3b764565 Author: Peter Ujfalusi Date: Wed Sep 15 15:21:09 2021 +0300 ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types i.MX8 only uses SOF_FW_BLK_TYPE_IRAM (1) and SOF_FW_BLK_TYPE_SRAM (3) bars, everything else is left as 0 in sdev->bar[] array. If a broken or purposefully crafted firmware image is loaded with other types of FW_BLK_TYPE then a kernel crash can be triggered. Make sure that only IRAM/SRAM type is converted to bar index. Fixes: afb93d716533d ("ASoC: SOF: imx: Add i.MX8M HW support") Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210915122116.18317-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 10d93a98190aec2c3ff98d9472ab1bf0543aa02c Author: Peter Ujfalusi Date: Wed Sep 15 15:21:08 2021 +0300 ASoC: SOF: imx: imx8: Bar index is only valid for IRAM and SRAM types i.MX8 only uses SOF_FW_BLK_TYPE_IRAM (1) and SOF_FW_BLK_TYPE_SRAM (3) bars, everything else is left as 0 in sdev->bar[] array. If a broken or purposefully crafted firmware image is loaded with other types of FW_BLK_TYPE then a kernel crash can be triggered. Make sure that only IRAM/SRAM type is converted to bar index. Fixes: 202acc565a1f0 ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210915122116.18317-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b66ceaf324b394428bb47054140ddf03d8172e64 Author: Pavel Begunkov Date: Wed Sep 15 11:00:05 2021 +0100 io_uring: move iopoll reissue into regular IO path 230d50d448acb ("io_uring: move reissue into regular IO path") made non-IOPOLL I/O to not retry from ki_complete handler. Follow it steps and do the same for IOPOLL. Same problems, same implementation, same -EAGAIN assumptions. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f80dfee2d5fa7678f0052a8ab3cfca9496a112ca.1631699928.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7dedd3e18077f996a10c47250ac85d080e5f474e Author: Jens Axboe Date: Fri Sep 10 11:19:58 2021 -0600 Revert "iov_iter: track truncated size" This reverts commit 2112ff5ce0c1128fe7b4d19cfe7f2b8ce5b595fa. We no longer need to track the truncation count, the one user that did need it has been converted to using iov_iter_restore() instead. Signed-off-by: Jens Axboe commit cd65869512ab5668a5d16f789bc4da1319c435c4 Author: Jens Axboe Date: Fri Sep 10 11:19:14 2021 -0600 io_uring: use iov_iter state save/restore helpers Get rid of the need to do re-expand and revert on an iterator when we encounter a short IO, or failure that warrants a retry. Use the new state save/restore helpers instead. We keep the iov_iter_state persistent across retries, if we need to restart the read or write operation. If there's a pending retry, the operation will always exit with the state correctly saved. Signed-off-by: Jens Axboe commit 0c8fbaa553077630e8eae45bd9676cfc01836aeb Author: Joshua-Dickens Date: Tue Sep 14 13:28:25 2021 -0400 HID: wacom: Add new Intuos BT (CTL-4100WL/CTL-6100WL) device IDs Add the new PIDs to wacom_wac.c to support the new models in the Intuos series. [jkosina@suse.cz: fix changelog] Signed-off-by: Joshua Dickens Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 310e2d43c3ad429c1fba4b175806cf1f55ed73a6 Author: Jeremy Sowden Date: Sun Sep 12 22:24:33 2021 +0100 netfilter: ip6_tables: zero-initialize fragment offset ip6tables only sets the `IP6T_F_PROTO` flag on a rule if a protocol is specified (`-p tcp`, for example). However, if the flag is not set, `ip6_packet_match` doesn't call `ipv6_find_hdr` for the skb, in which case the fragment offset is left uninitialized and a garbage value is passed to each matcher. Signed-off-by: Jeremy Sowden Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 67fd71ba16a37c663d139f5ba5296f344d80d072 Author: Mizuho Mori Date: Thu Jul 29 20:03:25 2021 +0900 HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS Apple Magic Keyboard(JIS)'s Logical Maximum and Usage Maximum are wrong. Below is a report descriptor. 0x05, 0x01, /* Usage Page (Desktop), */ 0x09, 0x06, /* Usage (Keyboard), */ 0xA1, 0x01, /* Collection (Application), */ 0x85, 0x01, /* Report ID (1), */ 0x05, 0x07, /* Usage Page (Keyboard), */ 0x15, 0x00, /* Logical Minimum (0), */ 0x25, 0x01, /* Logical Maximum (1), */ 0x19, 0xE0, /* Usage Minimum (KB Leftcontrol), */ 0x29, 0xE7, /* Usage Maximum (KB Right GUI), */ 0x75, 0x01, /* Report Size (1), */ 0x95, 0x08, /* Report Count (8), */ 0x81, 0x02, /* Input (Variable), */ 0x95, 0x05, /* Report Count (5), */ 0x75, 0x01, /* Report Size (1), */ 0x05, 0x08, /* Usage Page (LED), */ 0x19, 0x01, /* Usage Minimum (01h), */ 0x29, 0x05, /* Usage Maximum (05h), */ 0x91, 0x02, /* Output (Variable), */ 0x95, 0x01, /* Report Count (1), */ 0x75, 0x03, /* Report Size (3), */ 0x91, 0x03, /* Output (Constant, Variable), */ 0x95, 0x08, /* Report Count (8), */ 0x75, 0x01, /* Report Size (1), */ 0x15, 0x00, /* Logical Minimum (0), */ 0x25, 0x01, /* Logical Maximum (1), */ here is a report descriptor which is parsed one in kernel. see sys/kernel/debug/hid//rdesc 05 01 09 06 a1 01 85 01 05 07 15 00 25 01 19 e0 29 e7 75 01 95 08 81 02 95 05 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 08 75 01 15 00 25 01 06 00 ff 09 03 81 03 95 06 75 08 15 00 25 [65] 05 07 19 00 29 [65] 81 00 95 01 75 01 15 00 25 01 05 0c 09 b8 81 02 95 01 75 01 06 01 ff 09 03 81 02 95 01 75 06 81 03 06 02 ff 09 55 85 55 15 00 26 ff 00 75 08 95 40 b1 a2 c0 06 00 ff 09 14 a1 01 85 90 05 84 75 01 95 03 15 00 25 01 09 61 05 85 09 44 09 46 81 02 95 05 81 01 75 08 95 01 15 00 26 ff 00 09 65 81 02 c0 00 Position 64(Logical Maximum) and 70(Usage Maximum) are 101. Both should be 0xE7 to support JIS specific keys(ろ, Eisu, Kana, |) support. position 117 is also 101 but not related(it is Usage 65h). There are no difference of product id between JIS and ANSI. They are same 0x0267. Signed-off-by: Mizuho Mori Signed-off-by: Jiri Kosina commit ca465e1f1f9b38fe916a36f7d80c5d25f2337c81 Author: Tao Liu Date: Mon Sep 13 17:33:44 2021 +0800 RDMA/cma: Fix listener leak in rdma_cma_listen_on_all() failure If cma_listen_on_all() fails it leaves the per-device ID still on the listen_list but the state is not set to RDMA_CM_ADDR_BOUND. When the cmid is eventually destroyed cma_cancel_listens() is not called due to the wrong state, however the per-device IDs are still holding the refcount preventing the ID from being destroyed, thus deadlocking: task:rping state:D stack: 0 pid:19605 ppid: 47036 flags:0x00000084 Call Trace: __schedule+0x29a/0x780 ? free_unref_page_commit+0x9b/0x110 schedule+0x3c/0xa0 schedule_timeout+0x215/0x2b0 ? __flush_work+0x19e/0x1e0 wait_for_completion+0x8d/0xf0 _destroy_id+0x144/0x210 [rdma_cm] ucma_close_id+0x2b/0x40 [rdma_ucm] __destroy_id+0x93/0x2c0 [rdma_ucm] ? __xa_erase+0x4a/0xa0 ucma_destroy_id+0x9a/0x120 [rdma_ucm] ucma_write+0xb8/0x130 [rdma_ucm] vfs_write+0xb4/0x250 ksys_write+0xb5/0xd0 ? syscall_trace_enter.isra.19+0x123/0x190 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Ensure that cma_listen_on_all() atomically unwinds its action under the lock during error. Fixes: c80a0c52d85c ("RDMA/cma: Add missing error handling of listen_id") Link: https://lore.kernel.org/r/20210913093344.17230-1-thomas.liu@ucloud.cn Signed-off-by: Tao Liu Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1e4ce418b1cb1a810256b5fb3fd33d22d1325993 Author: F.A.Sulaiman Date: Tue Aug 24 20:37:30 2021 +0530 HID: betop: fix slab-out-of-bounds Write in betop_probe Syzbot reported slab-out-of-bounds Write bug in hid-betopff driver. The problem is the driver assumes the device must have an input report but some malicious devices violate this assumption. So this patch checks hid_device's input is non empty before it's been used. Reported-by: syzbot+07efed3bc5a1407bd742@syzkaller.appspotmail.com Signed-off-by: F.A. SULAIMAN Reviewed-by: Pavel Skripkin Signed-off-by: Jiri Kosina commit 65ed1e692f2b996292a5bd973200442816dd0ec1 Merge: 9da4c7276ec5d 70f437fb4395a Author: Jens Axboe Date: Wed Sep 15 07:53:32 2021 -0600 Merge tag 'nvme-5.15-2021-09-15' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.15 - fix ANA state updates when a namespace is not present (Anton Eidelman) - nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show (Dan Carpenter) - avoid race in shutdown namespace removal (Daniel Wagner) - fix io_work priority inversion in nvme-tcp (Keith Busch) - destroy cm id before destroy qp to avoid use after free (Ruozhu Li)" * tag 'nvme-5.15-2021-09-15' of git://git.infradead.org/nvme: nvme-tcp: fix io_work priority inversion nvme-rdma: destroy cm id before destroy qp to avoid use after free nvme-multipath: fix ANA state updates when a namespace is not present nvme: avoid race in shutdown namespace removal nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show() commit 3782326577d4b02f3d9940e1c96c3e9b31cf5309 Author: Saravana Kannan Date: Wed Sep 15 01:19:32 2021 -0700 Revert "of: property: fw_devlink: Add support for "phy-handle" property" This reverts commit cf4b94c8530d14017fbddae26aad064ddc42edd4. Some PHYs pointed to by "phy-handle" will never bind to a driver until a consumer attaches to it. And when the consumer attaches to it, they get forcefully bound to a generic PHY driver. In such cases, parsing the phy-handle property and creating a device link will prevent the consumer from ever probing. We don't want that. So revert support for "phy-handle" property until we come up with a better mechanism for binding PHYs to generic drivers before a consumer tries to attach to it. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210915081933.485112-1-saravanak@google.com Signed-off-by: Rob Herring commit f5711f9df9242446feccf2bdb6fdc06a72ca1010 Author: Heiko Carstens Date: Mon Sep 13 14:41:35 2021 +0200 s390: remove WARN_DYNAMIC_STACK s390 is the only architecture which allows to set the -mwarn-dynamicstack compile option. This however will also always generate a warning with system call stack randomization, which uses alloca to generate some random sized stack frame. On the other hand Linus just enabled "-Werror" by default with commit 3fe617ccafd6 ("Enable '-Werror' by default for all kernel builds"), which means compiles will always fail by default. So instead of playing once again whack-a-mole for something which is s390 specific, simply remove this option. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 948e50551b9a07c3ab6b9d208bb8f16fa1b2ad41 Author: Heiko Carstens Date: Tue Sep 7 07:27:11 2021 +0200 s390/ap: fix kernel doc comments Get rid of warnings like: drivers/s390/crypto/ap_bus.c:216: warning: bad line: drivers/s390/crypto/ap_bus.c:444: warning: Function parameter or member 'floating' not described in 'ap_interrupt_handler' Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4b26ceac103be7ad71cd4cccf01f97b6017008a6 Author: Heiko Carstens Date: Wed Sep 1 14:48:07 2021 +0200 s390: update defconfigs Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit d76b14f3971a0638b6cd0da289f8b48acee287d0 Author: Alexander Egorenkov Date: Thu Sep 9 12:20:56 2021 +0200 s390/sclp: fix Secure-IPL facility detection Prevent out-of-range access if the returned SCLP SCCB response is smaller in size than the address of the Secure-IPL flag. Fixes: c9896acc7851 ("s390/ipl: Provide has_secure sysfs attribute") Cc: stable@vger.kernel.org # 5.2+ Signed-off-by: Alexander Egorenkov Reviewed-by: Christian Borntraeger Signed-off-by: Vasily Gorbik commit a8b92b8c1eac8d655a97b1e90f4d83c25d9b9a18 Author: David Hildenbrand Date: Thu Sep 9 16:59:42 2021 +0200 s390/pci_mmio: fully validate the VMA before calling follow_pte() We should not walk/touch page tables outside of VMA boundaries when holding only the mmap sem in read mode. Evil user space can modify the VMA layout just before this function runs and e.g., trigger races with page table removal code since commit dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap"). find_vma() does not check if the address is >= the VMA start address; use vma_lookup() instead. Reviewed-by: Niklas Schnelle Reviewed-by: Liam R. Howlett Fixes: dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap") Signed-off-by: David Hildenbrand Signed-off-by: Vasily Gorbik commit ac4dfccb96571ca03af7cac64b7a0b2952c97f3a Author: Yong Zhi Date: Wed Sep 15 09:32:30 2021 +0300 ASoC: SOF: Fix DSP oops stack dump output contents Fix @buf arg given to hex_dump_to_buffer() and stack address used in dump error output. Fixes: e657c18a01c8 ('ASoC: SOF: Add xtensa support') Signed-off-by: Yong Zhi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210915063230.29711-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c006a06508db4841d256d82f42da392d6391f3d9 Author: Cédric Le Goater Date: Mon Sep 13 15:40:56 2021 +0200 powerpc/xics: Set the IRQ chip data for the ICS native backend The ICS native driver relies on the IRQ chip data to find the struct 'ics_native' describing the ICS controller but it was removed by commit 248af248a8f4 ("powerpc/xics: Rename the map handler in a check handler"). Revert this change to fix the Microwatt SoC platform. Fixes: 248af248a8f4 ("powerpc/xics: Rename the map handler in a check handler") Signed-off-by: Cédric Le Goater Tested-by: Gustavo Romero Reviewed-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210913134056.3761960-1-clg@kaod.org commit 88d0adb5f13b1c52fbb7d755f6f79db18c2f0c2c Author: Nicolas Dichtel Date: Tue Sep 14 16:46:34 2021 +0200 xfrm: notify default policy on update This configuration knob is very sensible, it should be notified when changing. Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit f8d858e607b2a36808ac6d4218f5f5203d7a7d63 Author: Nicolas Dichtel Date: Tue Sep 14 16:46:33 2021 +0200 xfrm: make user policy API complete >From a userland POV, this API was based on some magic values: - dirmask and action were bitfields but meaning of bits (XFRM_POL_DEFAULT_*) are not exported; - action is confusing, if a bit is set, does it mean drop or accept? Let's try to simplify this uapi by using explicit field and macros. Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit d859ed25b24289c87a97889653596f8088367e16 Author: Jan Beulich Date: Tue Sep 7 14:07:47 2021 +0200 swiotlb-xen: drop DEFAULT_NSLABS It was introduced by 4035b43da6da ("xen-swiotlb: remove xen_set_nslabs") and then not removed by 2d29960af0be ("swiotlb: dynamically allocate io_tlb_default_mem"). Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/15259326-209a-1d11-338c-5018dc38abe8@suse.com Signed-off-by: Juergen Gross commit 7fd880a38cfefb2d54a912e4ae809110adec1c94 Author: Jan Beulich Date: Tue Sep 7 14:07:21 2021 +0200 swiotlb-xen: arrange to have buffer info logged I consider it unhelpful that address and size of the buffer aren't put in the log file; it makes diagnosing issues needlessly harder. The majority of callers of swiotlb_init() also passes 1 for the "verbose" parameter. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/2e3c8e68-36b2-4ae9-b829-bf7f75d39d47@suse.com Signed-off-by: Juergen Gross commit 68573c1b5c4d0ebd90c24c6055abb53c474a8fc2 Author: Jan Beulich Date: Tue Sep 7 14:06:55 2021 +0200 swiotlb-xen: drop leftover __ref Commit a98f565462f0 ("xen-swiotlb: split xen_swiotlb_init") should not only have added __init to the split off function, but also should have dropped __ref from the one left. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/7cd163e1-fe13-270b-384c-2708e8273d34@suse.com Signed-off-by: Juergen Gross commit cabb7f89b24ed40c4640dac3bca044452ab0b386 Author: Jan Beulich Date: Tue Sep 7 14:06:37 2021 +0200 swiotlb-xen: limit init retries Due to the use of max(1024, ...) there's no point retrying (and issuing bogus log messages) when the number of slabs is already no larger than this minimum value. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/984fa426-2b7b-4b77-5ce8-766619575b7f@suse.com Signed-off-by: Juergen Gross commit 79ca5f778aafbd69727d577b58d913c9ce8400be Author: Jan Beulich Date: Tue Sep 7 14:05:54 2021 +0200 swiotlb-xen: suppress certain init retries Only on the 2nd of the paths leading to xen_swiotlb_init()'s "error" label it is useful to retry the allocation; the first one did already iterate through all possible order values. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/56477481-87da-4962-9661-5e1b277efde0@suse.com Signed-off-by: Juergen Gross commit d9a688add3d412c840e31060847a6a297b552316 Author: Jan Beulich Date: Tue Sep 7 14:05:12 2021 +0200 swiotlb-xen: maintain slab count properly Generic swiotlb code makes sure to keep the slab count a multiple of the number of slabs per segment. Yet even without checking whether any such assumption is made elsewhere, it is easy to see that xen_swiotlb_fixup() might alter unrelated memory when calling xen_create_contiguous_region() for the last segment, when that's not a full one - the function acts on full order-N regions, not individual pages. Align the slab count suitably when halving it for a retry. Add a build time check and a runtime one. Replace the no longer useful local variable "slabs" by an "order" one calculated just once, outside of the loop. Re-use "order" for calculating "dma_bits", and change the type of the latter as well as the one of "i" while touching this anyway. Signed-off-by: Jan Beulich Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/dc054cb0-bec4-4db0-fc06-c9fc957b6e66@suse.com Signed-off-by: Juergen Gross commit 4c092c59015f7adf0f07685f869edb96d997a756 Author: Jan Beulich Date: Tue Sep 7 14:04:47 2021 +0200 swiotlb-xen: fix late init retry The commit referenced below removed the assignment of "bytes" from xen_swiotlb_init() without - like done for xen_swiotlb_init_early() - adding an assignment on the retry path, thus leading to excessively sized allocations upon retries. Fixes: 2d29960af0be ("swiotlb: dynamically allocate io_tlb_default_mem") Signed-off-by: Jan Beulich Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/778299d6-9cfd-1c13-026e-25ee5d14ecb3@suse.com Signed-off-by: Juergen Gross commit ce6a80d1b2f923b1839655a1cda786293feaa085 Author: Jan Beulich Date: Tue Sep 7 14:04:25 2021 +0200 swiotlb-xen: avoid double free Of the two paths leading to the "error" label in xen_swiotlb_init() one didn't allocate anything, while the other did already free what was allocated. Fixes: b82776005369 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used") Signed-off-by: Jan Beulich Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/ce9c2adb-8a52-6293-982a-0d6ece943ac6@suse.com Signed-off-by: Juergen Gross commit 45da234467f381239d87536c86597149f189d375 Author: Jan Beulich Date: Tue Sep 7 14:17:13 2021 +0200 xen/pvcalls: backend can be a module It's not clear to me why only the frontend has been tristate. Switch the backend to be, too. Signed-off-by: Jan Beulich Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/54a6070c-92bb-36a3-2fc0-de9ccca438c5@suse.com Signed-off-by: Juergen Gross commit 36c9b5929b7094ea19a78827c0ede20d2e0e6c9c Author: Juergen Gross Date: Wed Sep 8 09:36:40 2021 +0200 xen: fix usage of pmd_populate in mremap for pv guests Commit 0881ace292b662 ("mm/mremap: use pmd/pud_poplulate to update page table entries") introduced a regression when running as Xen PV guest. Today pmd_populate() for Xen PV assumes that the PFN inserted is referencing a not yet used page table. In case of move_normal_pmd() this is not true, resulting in WARN splats like: [34321.304270] ------------[ cut here ]------------ [34321.304277] WARNING: CPU: 0 PID: 23628 at arch/x86/xen/multicalls.c:102 xen_mc_flush+0x176/0x1a0 [34321.304288] Modules linked in: [34321.304291] CPU: 0 PID: 23628 Comm: apt-get Not tainted 5.14.1-20210906-doflr-mac80211debug+ #1 [34321.304294] Hardware name: MSI MS-7640/890FXA-GD70 (MS-7640) , BIOS V1.8B1 09/13/2010 [34321.304296] RIP: e030:xen_mc_flush+0x176/0x1a0 [34321.304300] Code: 89 45 18 48 c1 e9 3f 48 89 ce e9 20 ff ff ff e8 60 03 00 00 66 90 5b 5d 41 5c 41 5d c3 48 c7 45 18 ea ff ff ff be 01 00 00 00 <0f> 0b 8b 55 00 48 c7 c7 10 97 aa 82 31 db 49 c7 c5 38 97 aa 82 65 [34321.304303] RSP: e02b:ffffc90000a97c90 EFLAGS: 00010002 [34321.304305] RAX: ffff88807d416398 RBX: ffff88807d416350 RCX: ffff88807d416398 [34321.304306] RDX: 0000000000000001 RSI: 0000000000000001 RDI: deadbeefdeadf00d [34321.304308] RBP: ffff88807d416300 R08: aaaaaaaaaaaaaaaa R09: ffff888006160cc0 [34321.304309] R10: deadbeefdeadf00d R11: ffffea000026a600 R12: 0000000000000000 [34321.304310] R13: ffff888012f6b000 R14: 0000000012f6b000 R15: 0000000000000001 [34321.304320] FS: 00007f5071177800(0000) GS:ffff88807d400000(0000) knlGS:0000000000000000 [34321.304322] CS: 10000e030 DS: 0000 ES: 0000 CR0: 0000000080050033 [34321.304323] CR2: 00007f506f542000 CR3: 00000000160cc000 CR4: 0000000000000660 [34321.304326] Call Trace: [34321.304331] xen_alloc_pte+0x294/0x320 [34321.304334] move_pgt_entry+0x165/0x4b0 [34321.304339] move_page_tables+0x6fa/0x8d0 [34321.304342] move_vma.isra.44+0x138/0x500 [34321.304345] __x64_sys_mremap+0x296/0x410 [34321.304348] do_syscall_64+0x3a/0x80 [34321.304352] entry_SYSCALL_64_after_hwframe+0x44/0xae [34321.304355] RIP: 0033:0x7f507196301a [34321.304358] Code: 73 01 c3 48 8b 0d 76 0e 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 19 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 46 0e 0c 00 f7 d8 64 89 01 48 [34321.304360] RSP: 002b:00007ffda1eecd38 EFLAGS: 00000246 ORIG_RAX: 0000000000000019 [34321.304362] RAX: ffffffffffffffda RBX: 000056205f950f30 RCX: 00007f507196301a [34321.304363] RDX: 0000000001a00000 RSI: 0000000001900000 RDI: 00007f506dc56000 [34321.304364] RBP: 0000000001a00000 R08: 0000000000000010 R09: 0000000000000004 [34321.304365] R10: 0000000000000001 R11: 0000000000000246 R12: 00007f506dc56060 [34321.304367] R13: 00007f506dc56000 R14: 00007f506dc56060 R15: 000056205f950f30 [34321.304368] ---[ end trace a19885b78fe8f33e ]--- [34321.304370] 1 of 2 multicall(s) failed: cpu 0 [34321.304371] call 2: op=12297829382473034410 arg=[aaaaaaaaaaaaaaaa] result=-22 Fix that by modifying xen_alloc_ptpage() to only pin the page table in case it wasn't pinned already. Fixes: 0881ace292b662 ("mm/mremap: use pmd/pud_poplulate to update page table entries") Cc: Reported-by: Sander Eikelenboom Tested-by: Sander Eikelenboom Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20210908073640.11299-1-jgross@suse.com Signed-off-by: Juergen Gross commit f68aa100d815b5b4467fd1c3abbe3b99d65fd028 Author: Juergen Gross Date: Fri Sep 3 10:49:37 2021 +0200 xen: reset legacy rtc flag for PV domU A Xen PV guest doesn't have a legacy RTC device, so reset the legacy RTC flag. Otherwise the following WARN splat will occur at boot: [ 1.333404] WARNING: CPU: 1 PID: 1 at /home/gross/linux/head/drivers/rtc/rtc-mc146818-lib.c:25 mc146818_get_time+0x1be/0x210 [ 1.333404] Modules linked in: [ 1.333404] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.14.0-rc7-default+ #282 [ 1.333404] RIP: e030:mc146818_get_time+0x1be/0x210 [ 1.333404] Code: c0 64 01 c5 83 fd 45 89 6b 14 7f 06 83 c5 64 89 6b 14 41 83 ec 01 b8 02 00 00 00 44 89 63 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3 <0f> 0b 48 c7 c7 30 0e ef 82 4c 89 e6 e8 71 2a 24 00 48 c7 c0 ff ff [ 1.333404] RSP: e02b:ffffc90040093df8 EFLAGS: 00010002 [ 1.333404] RAX: 00000000000000ff RBX: ffffc90040093e34 RCX: 0000000000000000 [ 1.333404] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000000000000000d [ 1.333404] RBP: ffffffff82ef0e30 R08: ffff888005013e60 R09: 0000000000000000 [ 1.333404] R10: ffffffff82373e9b R11: 0000000000033080 R12: 0000000000000200 [ 1.333404] R13: 0000000000000000 R14: 0000000000000002 R15: ffffffff82cdc6d4 [ 1.333404] FS: 0000000000000000(0000) GS:ffff88807d440000(0000) knlGS:0000000000000000 [ 1.333404] CS: 10000e030 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.333404] CR2: 0000000000000000 CR3: 000000000260a000 CR4: 0000000000050660 [ 1.333404] Call Trace: [ 1.333404] ? wakeup_sources_sysfs_init+0x30/0x30 [ 1.333404] ? rdinit_setup+0x2b/0x2b [ 1.333404] early_resume_init+0x23/0xa4 [ 1.333404] ? cn_proc_init+0x36/0x36 [ 1.333404] do_one_initcall+0x3e/0x200 [ 1.333404] kernel_init_freeable+0x232/0x28e [ 1.333404] ? rest_init+0xd0/0xd0 [ 1.333404] kernel_init+0x16/0x120 [ 1.333404] ret_from_fork+0x1f/0x30 Cc: Fixes: 8d152e7a5c7537 ("x86/rtc: Replace paravirt rtc check with platform legacy quirk") Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210903084937.19392-3-jgross@suse.com Signed-off-by: Juergen Gross commit 7366c23ff492ad260776a3ee1aaabba9fc773a8b Author: Randy Dunlap Date: Mon Sep 13 15:06:05 2021 -0700 ptp: dp83640: don't define PAGE0 Building dp83640.c on arch/parisc/ produces a build warning for PAGE0 being redefined. Since the macro is not used in the dp83640 driver, just make it a comment for documentation purposes. In file included from ../drivers/net/phy/dp83640.c:23: ../drivers/net/phy/dp83640_reg.h:8: warning: "PAGE0" redefined 8 | #define PAGE0 0x0000 from ../drivers/net/phy/dp83640.c:11: ../arch/parisc/include/asm/page.h:187: note: this is the location of the previous definition 187 | #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.") Signed-off-by: Randy Dunlap Reported-by: Geert Uytterhoeven Cc: Richard Cochran Cc: John Stultz Cc: Heiner Kallweit Cc: Russell King Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210913220605.19682-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 52ce14c134a003fee03d8fc57442c05a55b53715 Author: Adrian Bunk Date: Sun Sep 12 22:05:23 2021 +0300 bnx2x: Fix enabling network interfaces without VFs This function is called to enable SR-IOV when available, not enabling interfaces without VFs was a regression. Fixes: 65161c35554f ("bnx2x: Fix missing error code in bnx2x_iov_init_one()") Signed-off-by: Adrian Bunk Reported-by: YunQiang Su Tested-by: YunQiang Su Cc: stable@vger.kernel.org Acked-by: Shai Malin Link: https://lore.kernel.org/r/20210912190523.27991-1-bunk@kernel.org Signed-off-by: Jakub Kicinski commit 9da4c7276ec5d167972d8f6670d64b59838b4ed2 Author: Christoph Hellwig Date: Tue Sep 14 09:06:57 2021 +0200 nvme: remove the call to nvme_update_disk_info in nvme_ns_remove There is no need to explicitly unregister the integrity profile when deleting the gendisk. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20210914070657.87677-4-hch@lst.de Signed-off-by: Jens Axboe commit 3df49967f6f1d2121b0c27c381ca1c8386b1dab9 Author: Lihong Kou Date: Tue Sep 14 09:06:56 2021 +0200 block: flush the integrity workqueue in blk_integrity_unregister When the integrity profile is unregistered there can still be integrity reads queued up which could see a NULL verify_fn as shown by the race window below: CPU0 CPU1 process_one_work nvme_validate_ns bio_integrity_verify_fn nvme_update_ns_info nvme_update_disk_info blk_integrity_unregister ---set queue->integrity as 0 bio_integrity_process --access bi->profile->verify_fn(bi is a pointer of queue->integity) Before calling blk_integrity_unregister in nvme_update_disk_info, we must make sure that there is no work item in the kintegrityd_wq. Just call blk_flush_integrity to flush the work queue so the bug can be resolved. Signed-off-by: Lihong Kou [hch: split up and shortened the changelog] Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20210914070657.87677-3-hch@lst.de Signed-off-by: Jens Axboe commit 783a40a1b3ac7f3714d2776fa8ac8cce3535e4f6 Author: Christoph Hellwig Date: Tue Sep 14 09:06:55 2021 +0200 block: check if a profile is actually registered in blk_integrity_unregister While clearing the profile itself is harmless, we really should not clear the stable writes flag if it wasn't set due to a registered integrity profile. Reported-by: Lihong Kou Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20210914070657.87677-2-hch@lst.de Signed-off-by: Jens Axboe commit be9c6bad9b46451ba5bb8d366c51e2475f374981 Author: Dan Carpenter Date: Tue Sep 7 10:32:53 2021 +0300 vdpa: potential uninitialized return in vhost_vdpa_va_map() The concern here is that "ret" can be uninitialized if we hit the "goto next" condition on every iteration through the loop. Fixes: 41ba1b5f9d4b ("vdpa: Support transferring virtual addressing during DMA mapping") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210907073253.GB18254@kili Signed-off-by: Michael S. Tsirkin Reviewed-by: Xie Yongji Acked-by: Jason Wang Reviewed-by: Stefano Garzarella commit 759be8993b1b40e05b8908583336b8e230e67b08 Author: Eli Cohen Date: Thu Sep 9 09:37:38 2021 +0300 vdpa/mlx5: Avoid executing set_vq_ready() if device is reset Avoid executing set_vq_ready() if the device has been reset. In such case, the features are cleared and cannot be used in conditional statements. Such reference happens is the function ctrl_vq_idx(). Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210909063738.46970-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit ef12e4bf4276a07fd350179fa63d0d337ea0a867 Author: Eli Cohen Date: Thu Sep 9 09:36:52 2021 +0300 vdpa/mlx5: Clear ready indication for control VQ When clearing VQs ready indication for the data VQs, do the same for the control VQ. Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210909063652.46880-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 7bb5fb207334758ce6ee84345d6f08e4fb284fe6 Author: Xie Yongji Date: Mon Sep 6 22:21:58 2021 +0800 vduse: Cleanup the old kernel states after reset failure We should cleanup the old kernel states e.g. interrupt callback no matter whether the userspace handle the reset correctly or not since virtio-vdpa can't handle the reset failure now. Otherwise, the old state might be used after reset which might break something, e.g. the old interrupt callback might be triggered by userspace after reset, which can break the virtio device driver. Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210906142158.181-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 6243e3c78ace66d337a1e43b60a1aa8f5b61bd72 Author: Dan Carpenter Date: Tue Sep 7 10:32:24 2021 +0300 vduse: missing error code in vduse_init() This should return -ENOMEM if alloc_workqueue() fails. Currently it returns success. Fixes: b66219796563 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210907073223.GA18254@kili Signed-off-by: Michael S. Tsirkin Reviewed-by: Xie Yongji Acked-by: Jason Wang commit 0d818706130e2f4e828c3fc028917677fac76a09 Author: Michael S. Tsirkin Date: Mon Sep 13 06:38:36 2021 -0400 virtio: don't fail on !of_device_is_compatible A recent change checking of_device_is_compatible on probe broke some powerpc/pseries setups. Apparently there virtio devices do not have a "compatible" property - they are matched by PCI vendor/device ids. Let's just skip of_node setup but proceed with initialization like we did previously. Fixes: 694a1116b405 ("virtio: Bind virtio device to device-tree node") Reported-by: Alexey Kardashevskiy Cc: Arnd Bergmann Cc: Viresh Kumar Tested-by: Guenter Roeck Acked-by: Jason Wang Reviewed-by: Viresh Kumar Signed-off-by: Michael S. Tsirkin commit 3ca706c189db861b2ca2019a0901b94050ca49d8 Author: Huang Rui Date: Tue Sep 7 18:03:02 2021 +0800 drm/ttm: fix type mismatch error on sparc64 On sparc64, __fls() returns an "int", but the drm TTM code expected it to be "unsigned long" as on x86. As a result, on sparc (and arc, and m68k) you get build errors because 'min()' checks that the types match. As suggested by Linus, it can use min_t instead of min to force the type to be "unsigned int". Suggested-by: Linus Torvalds Signed-off-by: Huang Rui Reviewed-by: Christian König Cc: Alex Deucher Cc: David Airlie Cc: Daniel Vetter Cc: Guenter Roeck Signed-off-by: Linus Torvalds commit 77e02cf57b6cff9919949defb7fd9b8ac16399a2 Author: Linus Torvalds Date: Tue Sep 14 13:23:22 2021 -0700 memblock: introduce saner 'memblock_free_ptr()' interface The boot-time allocation interface for memblock is a mess, with 'memblock_alloc()' returning a virtual pointer, but then you are supposed to free it with 'memblock_free()' that takes a _physical_ address. Not only is that all kinds of strange and illogical, but it actually causes bugs, when people then use it like a normal allocation function, and it fails spectacularly on a NULL pointer: https://lore.kernel.org/all/20210912140820.GD25450@xsang-OptiPlex-9020/ or just random memory corruption if the debug checks don't catch it: https://lore.kernel.org/all/61ab2d0c-3313-aaab-514c-e15b7aa054a0@suse.cz/ I really don't want to apply patches that treat the symptoms, when the fundamental cause is this horribly confusing interface. I started out looking at just automating a sane replacement sequence, but because of this mix or virtual and physical addresses, and because people have used the "__pa()" macro that can take either a regular kernel pointer, or just the raw "unsigned long" address, it's all quite messy. So this just introduces a new saner interface for freeing a virtual address that was allocated using 'memblock_alloc()', and that was kept as a regular kernel pointer. And then it converts a couple of users that are obvious and easy to test, including the 'xbc_nodes' case in lib/bootconfig.c that caused problems. Reported-by: kernel test robot Fixes: 40caa127f3c7 ("init: bootconfig: Remove all bootconfig data when the init memory is removed") Cc: Steven Rostedt Cc: Mike Rapoport Cc: Andrew Morton Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Vlastimil Babka Signed-off-by: Linus Torvalds commit b04ce53eac2fc326290817a6f64a440b5bffd2e3 Author: Nirmoy Das Date: Thu Sep 2 13:27:56 2021 +0200 drm/amdgpu: use IS_ERR for debugfs APIs debugfs APIs returns encoded error so use IS_ERR for checking return value. v2: return PTR_ERR(ent) References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das Reviewed-by: Christian König Reviewed-By: Shashank Sharma Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7bbee36d71502ab9a341505da89a017c7ae2e6b2 Author: Simon Ser Date: Tue Sep 7 14:19:34 2021 +0000 amd/display: downgrade validation failure log level In amdgpu_dm_atomic_check, dc_validate_global_state is called. On failure this logs a warning to the kernel journal. However warnings shouldn't be used for atomic test-only commit failures: user-space might be perfoming a lot of atomic test-only commits to find the best hardware configuration. Downgrade the log to a regular DRM atomic message. While at it, use the new device-aware logging infrastructure. This fixes error messages in the kernel when running gamescope [1]. [1]: https://github.com/Plagman/gamescope/issues/245 Reviewed-by: Nicholas Kazlauskas Signed-off-by: Simon Ser Cc: Alex Deucher Cc: Harry Wentland Cc: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit c92db8d64f9e0313e7ecdc9500db93a5040c9370 Author: Christian König Date: Tue Sep 7 09:37:52 2021 +0200 drm/amdgpu: fix use after free during BO move The memory backing old_mem is already freed at that point, move the check a bit more up. Signed-off-by: Christian König Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1699 Acked-by: Nirmoy Das Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5598d7c21a0bcab900f281dca4efbb1f80add0fe Author: Kenneth Feng Date: Mon Sep 6 07:55:01 2021 +0800 drm/amd/pm: fix the issue of uploading powerplay table fix the issue of uploading powerplay table due to the dependancy of rlc. Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 67a44e659888569a133a8f858c8230e9d7aad1d5 Author: Ernst Sjöstrand Date: Thu Sep 2 09:50:27 2021 +0200 drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10 Seems like newer cards can have even more instances now. Found by UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:318:29 index 8 is out of range for type 'uint32_t *[8]' Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1697 Cc: stable@vger.kernel.org Signed-off-by: Ernst Sjöstrand Signed-off-by: Alex Deucher commit 2cc74e1ee31d00393b6698ec80b322fd26523da4 Author: Christoph Lameter Date: Wed Sep 8 13:43:28 2021 +0200 IB/cma: Do not send IGMP leaves for sendonly Multicast groups ROCE uses IGMP for Multicast instead of the native Infiniband system where joins are required in order to post messages on the Multicast group. On Ethernet one can send Multicast messages to arbitrary addresses without the need to subscribe to a group. So ROCE correctly does not send IGMP joins during rdma_join_multicast(). F.e. in cma_iboe_join_multicast() we see: if (addr->sa_family == AF_INET) { if (gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP) { ib.rec.hop_limit = IPV6_DEFAULT_HOPLIMIT; if (!send_only) { err = cma_igmp_send(ndev, &ib.rec.mgid, true); } } } else { So the IGMP join is suppressed as it is unnecessary. However no such check is done in destroy_mc(). And therefore leaving a sendonly multicast group will send an IGMP leave. This means that the following scenario can lead to a multicast receiver unexpectedly being unsubscribed from a MC group: 1. Sender thread does a sendonly join on MC group X. No IGMP join is sent. 2. Receiver thread does a regular join on the same MC Group x. IGMP join is sent and the receiver begins to get messages. 3. Sender thread terminates and destroys MC group X. IGMP leave is sent and the receiver no longer receives data. This patch adds the same logic for sendonly joins to destroy_mc() that is also used in cma_iboe_join_multicast(). Fixes: ab15c95a17b3 ("IB/core: Support for CMA multicast join flags") Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2109081340540.668072@gentwo.de Signed-off-by: Christoph Lameter Signed-off-by: Jason Gunthorpe commit 356ed64991c6847a0c4f2e8fa3b1133f7a14f1fc Author: Hou Tao Date: Tue Sep 14 10:33:51 2021 +0800 bpf: Handle return value of BPF_PROG_TYPE_STRUCT_OPS prog Currently if a function ptr in struct_ops has a return value, its caller will get a random return value from it, because the return value of related BPF_PROG_TYPE_STRUCT_OPS prog is just dropped. So adding a new flag BPF_TRAMP_F_RET_FENTRY_RET to tell bpf trampoline to save and return the return value of struct_ops prog if ret_size of the function ptr is greater than 0. Also restricting the flag to be used alone. Fixes: 85d33df357b6 ("bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS") Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210914023351.3664499-1-houtao1@huawei.com commit 8b4bd256674720709a9d858a219fcac6f2f253b5 Author: Antoine Tenart Date: Thu Sep 9 10:56:12 2021 +0200 thermal/drivers/int340x: Do not set a wrong tcc offset on resume After upgrading to Linux 5.13.3 I noticed my laptop would shutdown due to overheat (when it should not). It turned out this was due to commit fe6a6de6692e ("thermal/drivers/int340x/processor_thermal: Fix tcc setting"). What happens is this drivers uses a global variable to keep track of the tcc offset (tcc_offset_save) and uses it on resume. The issue is this variable is initialized to 0, but is only set in tcc_offset_degree_celsius_store, i.e. when the tcc offset is explicitly set by userspace. If that does not happen, the resume path will set the offset to 0 (in my case the h/w default being 3, the offset would become too low after a suspend/resume cycle). The issue did not arise before commit fe6a6de6692e, as the function setting the offset would return if the offset was 0. This is no longer the case (rightfully). Fix this by not applying the offset if it wasn't saved before, reverting back to the old logic. A better approach will come later, but this will be easier to apply to stable kernels. The logic to restore the offset after a resume was there long before commit fe6a6de6692e, but as a value of 0 was considered invalid I'm referencing the commit that made the issue possible in the Fixes tag instead. Fixes: fe6a6de6692e ("thermal/drivers/int340x/processor_thermal: Fix tcc setting") Cc: stable@vger.kernel.org Cc: Srinivas Pandruvada Signed-off-by: Antoine Tenart Signed-off-by: Daniel Lezcano Reviewed-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20210909085613.5577-2-atenart@kernel.org commit f60f5741002b9fde748cff65fd09bd6222c5db0c Author: Md Sadre Alam Date: Tue Sep 7 12:35:57 2021 +0530 mtd: rawnand: qcom: Update code word value for raw read From QPIC V2 onwards there is a separate register to read last code word "QPIC_NAND_READ_LOCATION_LAST_CW_n". qcom_nandc_read_cw_raw() is used to read only one code word at a time. If we will configure number of code words to 1 in in QPIC_NAND_DEV0_CFG0 register then QPIC controller thinks its reading the last code word, since from QPIC V2 onwards we are having separate register to read the last code word, we have to configure "QPIC_NAND_READ_LOCATION_LAST_CW_n" register to fetch data from controller buffer to system memory. Fixes: 503ee5aad430 ("mtd: rawnand: qcom: update last code word register") Cc: stable@kernel.org Signed-off-by: Md Sadre Alam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1630998357-1359-1-git-send-email-mdalam@codeaurora.org commit 6a4746ba06191e23d30230738e94334b26590a8a Author: Vasily Averin Date: Sat Sep 11 10:40:08 2021 +0300 ipc: remove memcg accounting for sops objects in do_semtimedop() Linus proposes to revert an accounting for sops objects in do_semtimedop() because it's really just a temporary buffer for a single semtimedop() system call. This object can consume up to 2 pages, syscall is sleeping one, size and duration can be controlled by user, and this allocation can be repeated by many thread at the same time. However Shakeel Butt pointed that there are much more popular objects with the same life time and similar memory consumption, the accounting of which was decided to be rejected for performance reasons. Considering at least 2 pages for task_struct and 2 pages for the kernel stack, a back of the envelope calculation gives a footprint amplification of <1.5 so this temporal buffer can be safely ignored. The factor would IMO be interesting if it was >> 2 (from the PoV of excessive (ab)use, fine-grained accounting seems to be currently unfeasible due to performance impact). Link: https://lore.kernel.org/lkml/90e254df-0dfe-f080-011e-b7c53ee7fd20@virtuozzo.com/ Fixes: 18319498fdd4 ("memcg: enable accounting of ipc resources") Signed-off-by: Vasily Averin Acked-by: Michal Hocko Reviewed-by: Michal Koutný Acked-by: Shakeel Butt Signed-off-by: Linus Torvalds commit 5d329e1286b0a040264e239b80257c937f6e685f Author: Jens Axboe Date: Tue Sep 14 11:08:37 2021 -0600 io_uring: allow retry for O_NONBLOCK if async is supported A common complaint is that using O_NONBLOCK files with io_uring can be a bit of a pain. Be a bit nicer and allow normal retry IFF the file does support async behavior. This makes it possible to use io_uring more reliably with O_NONBLOCK files, for use cases where it either isn't possible or feasible to modify the file flags. Cc: stable@vger.kernel.org Reported-and-tested-by: Dan Melnic Signed-off-by: Jens Axboe commit cdef1196608892b9a46caa5f2b64095a7f0be60c Author: James Morse Date: Tue Sep 14 16:56:23 2021 +0000 cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory Since commit e5c6b312ce3c ("cpufreq: schedutil: Use kobject release() method to free sugov_tunables") kobject_put() has kfree()d the attr_set before gov_attr_set_put() returns. kobject_put() isn't the last user of attr_set in gov_attr_set_put(), the subsequent mutex_destroy() triggers a use-after-free: | BUG: KASAN: use-after-free in mutex_is_locked+0x20/0x60 | Read of size 8 at addr ffff000800ca4250 by task cpuhp/2/20 | | CPU: 2 PID: 20 Comm: cpuhp/2 Not tainted 5.15.0-rc1 #12369 | Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development | Platform, BIOS EDK II Jul 30 2018 | Call trace: | dump_backtrace+0x0/0x380 | show_stack+0x1c/0x30 | dump_stack_lvl+0x8c/0xb8 | print_address_description.constprop.0+0x74/0x2b8 | kasan_report+0x1f4/0x210 | kasan_check_range+0xfc/0x1a4 | __kasan_check_read+0x38/0x60 | mutex_is_locked+0x20/0x60 | mutex_destroy+0x80/0x100 | gov_attr_set_put+0xfc/0x150 | sugov_exit+0x78/0x190 | cpufreq_offline.isra.0+0x2c0/0x660 | cpuhp_cpufreq_offline+0x14/0x24 | cpuhp_invoke_callback+0x430/0x6d0 | cpuhp_thread_fun+0x1b0/0x624 | smpboot_thread_fn+0x5e0/0xa6c | kthread+0x3a0/0x450 | ret_from_fork+0x10/0x20 Swap the order of the calls. Fixes: e5c6b312ce3c ("cpufreq: schedutil: Use kobject release() method to free sugov_tunables") Cc: 4.7+ # 4.7+ Signed-off-by: James Morse Signed-off-by: Rafael J. Wysocki commit 7889367d7795b3b1766e33ac1ae8a5fbc292108b Author: Nathan Chancellor Date: Tue Aug 24 15:54:27 2021 -0700 drm/i915: Enable -Wsometimes-uninitialized This warning helps catch uninitialized variables. It should have been enabled at the same time as commit b2423184ac33 ("drm/i915: Enable -Wuninitialized") but I did not realize they were disabled separately. Enable it now that i915 is clean so that it stays that way. Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210824225427.2065517-4-nathan@kernel.org (cherry picked from commit 43192617f7816bb74584c1df06f57363afd15337) Signed-off-by: Jani Nikula commit 347c4db2afc7f9cf536144d167579ccf1e9bf028 Author: Nathan Chancellor Date: Tue Aug 24 15:54:26 2021 -0700 drm/i915/selftests: Always initialize err in igt_dmabuf_import_same_driver_lmem() Clang warns: drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:127:13: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (PTR_ERR(import) != -EOPNOTSUPP) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:138:9: note: uninitialized use occurs here return err; ^~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:127:9: note: remove the 'if' if its condition is always true } else if (PTR_ERR(import) != -EOPNOTSUPP) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:95:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 The test is expected to pass if i915_gem_prime_import() returns -EOPNOTSUPP so initialize err to zero in this case. Fixes: cdb35d1ed6d2 ("drm/i915/gem: Migrate to system at dma-buf attach time (v7)") Reported-by: Dan Carpenter Reviewed-by: Thomas Hellström Signed-off-by: Nathan Chancellor Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210824225427.2065517-3-nathan@kernel.org (cherry picked from commit 46f20a353b80d02492655d99714f0566018a17e8) Signed-off-by: Jani Nikula commit 4ad3ea1c69354328edcccb83c8a4d7d2f55e3c6a Author: Nathan Chancellor Date: Tue Aug 24 15:54:25 2021 -0700 drm/i915/selftests: Do not use import_obj uninitialized Clang warns a couple of times: drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:63:6: warning: variable 'import_obj' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (import != &obj->base) { ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:80:22: note: uninitialized use occurs here i915_gem_object_put(import_obj); ^~~~~~~~~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:63:2: note: remove the 'if' if its condition is always false if (import != &obj->base) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:38:46: note: initialize the variable 'import_obj' to silence this warning struct drm_i915_gem_object *obj, *import_obj; ^ = NULL Shuffle the import_obj initialization above these if statements so that it is not used uninitialized. Fixes: d7b2cb380b3a ("drm/i915/gem: Correct the locking and pin pattern for dma-buf (v8)") Reported-by: Dan Carpenter Reviewed-by: Thomas Hellström Signed-off-by: Nathan Chancellor Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210824225427.2065517-2-nathan@kernel.org (cherry picked from commit 4796054b381a586f4177a24e3d8b5a6a0a32ce62) Signed-off-by: Jani Nikula commit d0c624c03012e62ac36bf819dab120380a9ef415 Merge: 3f1c260ffddb7 4348cc10da637 Author: Arnd Bergmann Date: Tue Sep 14 18:35:12 2021 +0200 Merge tag 'at91-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes #1 for 5.15: - Fixes for newly introduced SAMA7G5 and its Power Management code. Associated core peripherals need to be instantiated in DT for benefiting from best PM support like Backup mode with DDR in Self-Refresh. - Add chip ID for SAMA7G5 for easing the kernel log identification. - Avoid Camera Sensor probe error on sama5d27 som1 ek board. * tag 'at91-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama5d2_som1_ek: disable ISC node by default ARM: at91: pm: switch backup area to vbat in backup mode ARM: dts: at91: sama7g5: add chipid ARM: dts: at91: sama7g5: add shdwc node ARM: dts: at91: sama7g5: add securam node ARM: dts: at91: sama7g5: add ram controllers ARM: at91: pm: do not panic if ram controllers are not enabled Link: https://lore.kernel.org/r/20210914162314.54347-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 9c7b0ba887513b6681e7883d306df0a0fd580afa Author: Pavel Begunkov Date: Tue Sep 14 16:12:52 2021 +0100 io_uring: auto-removal for direct open/accept It might be inconvenient that direct open/accept deviates from the update semantics and fails if the slot is taken instead of removing a file sitting there. Implement this auto-removal. Note that removal might need to allocate and so may fail. However, if an empty slot is specified, it's guaraneed to not fail on the fd installation side for valid userspace programs. It's needed for users who can't tolerate such failures, e.g. accept where the other end never retries. Suggested-by: Franz-B. Tuneke Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c896f14ea46b0eaa6c09d93149e665c2c37979b4.1631632300.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 1619b69edce14c4a4665fa8ff4c587dcc77202a9 Author: Michael Ellerman Date: Tue Sep 14 22:17:23 2021 +1000 powerpc/boot: Fix build failure since GCC 4.9 removal Stephen reported that the build was broken since commit 6d2ef226f2f1 ("compiler_attributes.h: drop __has_attribute() support for gcc4"), with errors such as: include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 296 | #if __has_attribute(__warning__) | ^~~~~~~~~~~~~~~ make[2]: *** [arch/powerpc/boot/Makefile:225: arch/powerpc/boot/crt0.o] Error 1 But we expect __has_attribute() to always be defined now that we've stopped using GCC 4. Linus debugged it to the point of reading the GCC sources, and noticing that the problem is that __has_attribute() is not defined when preprocessing assembly files, which is what we're doing here. Our assembly files don't include, or need, compiler_attributes.h, but they are getting it unconditionally from the -include in BOOT_CFLAGS, which is then added in its entirety to BOOT_AFLAGS. That -include was added in commit 77433830ed16 ("powerpc: boot: include compiler_attributes.h") so that we'd have "fallthrough" and other attributes defined for the C files in arch/powerpc/boot. But it's not needed for assembly files. The minimal fix is to move the addition to BOOT_CFLAGS of -include compiler_attributes.h until after we've copied BOOT_CFLAGS into BOOT_AFLAGS. That avoids including compiler_attributes.h for asm files, but makes no other change to BOOT_CFLAGS or BOOT_AFLAGS. Reported-by: Stephen Rothwell Debugged-by: Linus Torvalds Signed-off-by: Michael Ellerman Tested-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 3f1c260ffddb7ea51d54c37343c6d500a10317eb Author: Romain Perier Date: Fri Sep 10 21:03:22 2021 +0200 MAINTAINERS: Add myself as MStar/Sigmastar Armv7 SoC maintainers As proposed by Daniel, I am going to help him to maintain the platform, so add myself as co-maintainer. Signed-off-by: Romain Perier Acked-by: Daniel Palmer Link: https://lore.kernel.org/r/20210910190322.27058-5-romain.perier@gmail.com' Signed-off-by: Arnd Bergmann commit 4348cc10da6377a86940beb20ad357933b8f91bb Author: Eugen Hristev Date: Thu Sep 2 15:13:58 2021 +0300 ARM: dts: at91: sama5d2_som1_ek: disable ISC node by default Without a sensor node, the ISC will simply fail to probe, as the corresponding port node is missing. It is then logical to disable the node in the devicetree. If we add a port with a connection to a sensor endpoint, ISC can be enabled. Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210902121358.503589-1-eugen.hristev@microchip.com commit ac809e7879b15643105795a5f9becb5ef44abd93 Author: Claudiu Beznea Date: Mon Aug 30 13:09:27 2021 +0300 ARM: at91: pm: switch backup area to vbat in backup mode Backup area is now switched to VDDIN33 at boot (with the help of bootloader). When switching to backup mode we need to switch backup area to VBAT as all the other power sources are cut off. The resuming from backup mode is done with the help of bootloader, so there is no need to do something particular in Linux to restore backup area power source. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210830100927.22711-1-claudiu.beznea@microchip.com commit 6f34662284511a04643b25ad3032adc6fe4689ab Author: Claudiu Beznea Date: Wed Sep 8 12:43:29 2021 +0300 ARM: dts: at91: sama7g5: add chipid Add chipid node for sama7g5. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210908094329.182477-1-claudiu.beznea@microchip.com commit 16b161bcf5d491c7856effc16c8901984df4466a Author: Claudiu Beznea Date: Mon Aug 23 16:19:15 2021 +0300 ARM: dts: at91: sama7g5: add shdwc node Add shutdown controller node and enable it. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210823131915.23857-5-claudiu.beznea@microchip.com commit 2305d7ab661029f00ff49141b9ca90f736c1f9af Author: Claudiu Beznea Date: Mon Aug 23 16:19:14 2021 +0300 ARM: dts: at91: sama7g5: add securam node Add securam node. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210823131915.23857-4-claudiu.beznea@microchip.com commit 63a84d560e818f8a382a4a61bf1e59df43cdc06d Author: Claudiu Beznea Date: Mon Aug 23 16:19:13 2021 +0300 ARM: dts: at91: sama7g5: add ram controllers Add RAM and RAMC PHY controllers. These are necessary for platform specific power management code. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210823131915.23857-3-claudiu.beznea@microchip.com commit 1605de1b3ca66e3eddbca4b3c353c13c26476fe2 Author: Claudiu Beznea Date: Mon Aug 23 16:19:12 2021 +0300 ARM: at91: pm: do not panic if ram controllers are not enabled In case PM is enabled but there is no RAM controller information in DT the code will panic. Avoid such scenarios by not initializing platform specific PM code in case RAM controller is not provided via DT. Reported-by: Eugen Hristev Fixes: 827de1f123ba0 ("ARM: at91: remove at91_dt_initialize and machine init_early()") Fixes: 892e1f4a3ae58 ("ARM: at91: pm: add sama7g5 ddr phy controller") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210823131915.23857-2-claudiu.beznea@microchip.com commit 44df58d441a94de40d52fca67dc60790daee4266 Author: Xiaoguang Wang Date: Tue Sep 14 22:38:52 2021 +0800 io_uring: fix missing sigmask restore in io_cqring_wait() Move get_timespec() section in io_cqring_wait() before the sigmask saving, otherwise we'll fail to restore sigmask once get_timespec() returns error. Fixes: c73ebb685fb6 ("io_uring: add timeout support for io_uring_enter()") Signed-off-by: Xiaoguang Wang Link: https://lore.kernel.org/r/20210914143852.9663-1-xiaoguang.wang@linux.alibaba.com Signed-off-by: Jens Axboe commit 8fb0f47a9d7acf620d0fd97831b69da9bc5e22ed Author: Jens Axboe Date: Fri Sep 10 11:18:36 2021 -0600 iov_iter: add helper to save iov_iter state In an ideal world, when someone is passed an iov_iter and returns X bytes, then X bytes would have been consumed/advanced from the iov_iter. But we have use cases that always consume the entire iterator, a few examples of that are iomap and bdev O_DIRECT. This means we cannot rely on the state of the iov_iter once we've called ->read_iter() or ->write_iter(). This would be easier if we didn't always have to deal with truncate of the iov_iter, as rewinding would be trivial without that. We recently added a commit to track the truncate state, but that grew the iov_iter by 8 bytes and wasn't the best solution. Implement a helper to save enough of the iov_iter state to sanely restore it after we've called the read/write iterator helpers. This currently only works for IOVEC/BVEC/KVEC as that's all we need, support for other iterator types are left as an exercise for the reader. Link: https://lore.kernel.org/linux-fsdevel/CAHk-=wiacKV4Gh-MYjteU0LwNBSGpWrK-Ov25HdqB1ewinrFPg@mail.gmail.com/ Signed-off-by: Jens Axboe commit 8c1768967e2733d55abf449d8abd6f1915ba3539 Author: Joel Stanley Date: Tue Jun 15 10:44:34 2021 +0930 ARM: config: mutli v7: Reenable FB dependency DRM_FBDEV_EMULATION previously selected FB and was default y as long as DRM was enabled. In commit f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") the select was replaced with a depends on FB, disabling the drivers that depended on it. Renable FB so we get back FB_EFI, FB_WM8505, FB_SH_MOBILE_LCDC, FB_SIMPLE and VIDEO_VIVID. It must be set to y and not a module as the test driver VIDEO_VIVID requires it to be built in. Link: https://lore.kernel.org/r/CAK8P3a18EdBKQdGDOZc9cPKsf=hY8==v2cO0DBE_tyd82Uq-Ng@mail.gmail.com Signed-off-by: Joel Stanley Reviewed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit cf8dd57bd0d62133e4ed9e1ad83af994fac34da5 Author: Joel Stanley Date: Tue Jun 15 10:44:33 2021 +0930 ARM: config: multi v7: Enable dependancies Some drivers have not been built as they gained dependencies in kconfig but those dependencies were not added to the defconfig. The MSM pinctrl drivers fell out of the defconfig as of commit be117ca32261 ("pinctrl: qcom: Kconfig: Rework PINCTRL_MSM to be a depenency rather then a selected config"). Add PINCTRL_MSM so these stay enabled. EDAC depends on RAS, so enable it to ensure the EDAC drivers stay enabled. Signed-off-by: Joel Stanley Reviewed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit d198b27762644c71362e43a7533f89c92b115bcf Author: Eric Dumazet Date: Mon Sep 13 22:18:51 2021 -0700 Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"" This reverts commit d7807a9adf4856171f8441f13078c33941df48ab. As mentioned in https://lkml.org/lkml/2021/9/13/1819 5 years old commit 919483096bfe ("ipv4: fix memory leaks in ip_cmsg_send() callers") was a correct fix. ip_cmsg_send() can loop over multiple cmsghdr() If IP_RETOPTS has been successful, but following cmsghdr generates an error, we do not free ipc.ok If IP_RETOPTS is not successful, we have freed the allocated temporary space, not the one currently in ipc.opt. Sure, code could be refactored, but let's not bring back old bugs. Fixes: d7807a9adf48 ("Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"") Signed-off-by: Eric Dumazet Cc: Yajun Deng Signed-off-by: David S. Miller commit 4f884f3962767877d7aabbc1ec124d2c307a4257 Author: zhenggy Date: Tue Sep 14 09:51:15 2021 +0800 tcp: fix tp->undo_retrans accounting in tcp_sacktag_one() Commit 10d3be569243 ("tcp-tso: do not split TSO packets at retransmit time") may directly retrans a multiple segments TSO/GSO packet without split, Since this commit, we can no longer assume that a retransmitted packet is a single segment. This patch fixes the tp->undo_retrans accounting in tcp_sacktag_one() that use the actual segments(pcount) of the retransmitted packet. Before that commit (10d3be569243), the assumption underlying the tp->undo_retrans-- seems correct. Fixes: 10d3be569243 ("tcp-tso: do not split TSO packets at retransmit time") Signed-off-by: zhenggy Reviewed-by: Eric Dumazet Acked-by: Yuchung Cheng Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 59583f747664046aaae5588d56d5954fab66cce8 Author: Andreas Larsson Date: Wed Sep 8 09:48:22 2021 +0200 sparc32: page align size in arch_dma_alloc Commit 53b7670e5735 ("sparc: factor the dma coherent mapping into helper") lost the page align for the calls to dma_make_coherent and srmmu_unmapiorange. The latter cannot handle a non page aligned len argument. Signed-off-by: Andreas Larsson Reviewed-by: Sam Ravnborg Signed-off-by: Christoph Hellwig commit 2865ba82476a6b2603db40cfc1c8c0831409fb41 Merge: 550ac9c1aaaaf 43d2b88c29f2d Author: David S. Miller Date: Tue Sep 14 13:09:54 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2021-09-14 The following pull-request contains BPF updates for your *net* tree. We've added 7 non-merge commits during the last 13 day(s) which contain a total of 18 files changed, 334 insertions(+), 193 deletions(-). The main changes are: 1) Fix mmap_lock lockdep splat in BPF stack map's build_id lookup, from Yonghong Song. 2) Fix BPF cgroup v2 program bypass upon net_cls/prio activation, from Daniel Borkmann. 3) Fix kvcalloc() BTF line info splat on oversized allocation attempts, from Bixuan Cui. 4) Fix BPF selftest build of task_pt_regs test for arm64/s390, from Jean-Philippe Brucker. 5) Fix BPF's disasm.{c,h} to dual-license so that it is aligned with bpftool given the former is a build dependency for the latter, from Daniel Borkmann with ACKs from contributors. ==================== Signed-off-by: David S. Miller commit c8fee41957f036cbc8e840bd91e2087731df7f7e Author: Ofir Bitton Date: Sun Sep 12 15:49:00 2021 +0300 habanalabs: expose a single cs seq in staged submissions Staged submission consists of multiple command submissions. In order to be explicit, driver should return a single cs sequence for every cs in the submission, or else user may try to wait on an internal CS rather than waiting for the whole submission. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 42254c2a4991b98ca3f86040a1a7b7b32a0c8c4a Author: farah kassabri Date: Sun Sep 12 14:30:35 2021 +0300 habanalabs: fix wait offset handling Add handling for case where the user doesn't set wait offset, and keeps it as 0. In such a case the driver will decrement one from this zero value which will cause the code to wait for wrong number of signals. The solution is to treat this case as in legacy wait cs, and wait for the next signal. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3d3200ae167ba048a29e0c815987a3fdc90fc8d2 Author: Ofir Bitton Date: Thu Sep 9 09:56:37 2021 +0300 habanalabs: rate limit multi CS completion errors As user can send wrong arguments to multi CS API, we rate limit the amount of errors dumped to dmesg, in addition we change the severity to warning. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0a5ff77bf0a94468d541735f919a633f167787e9 Author: Oded Gabbay Date: Sun Sep 12 10:25:49 2021 +0300 habanalabs/gaudi: fix LBW RR configuration Couple of fixes to the LBW RR configuration: 1. Add missing configuration of the SM RR registers in the DMA_IF. 2. Remove HBW range that doesn't belong. 3. Add entire gap + DBG area, from end of TPC7 to end of entire DBG space. Signed-off-by: Oded Gabbay commit fcffb759f7d53b8e6c6e91804eec994205099dd3 Author: Colin Ian King Date: Fri Sep 3 09:02:03 2021 +0100 habanalabs: Fix spelling mistake "FEADBACK" -> "FEEDBACK" There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d09ff62c820b5950ab9958e77620a8498efe9386 Author: Ofir Bitton Date: Thu Sep 2 09:47:53 2021 +0300 habanalabs: fail collective wait when not supported As collective wait operation is required only when NIC ports are available, we disable the option to submit a CS in case all the ports are disabled, which is the current situation in the upstream driver. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3e08f157c2587fc7ada93abed41aae19bcbf8a6b Author: Omer Shpigelman Date: Wed Dec 30 08:05:18 2020 +0200 habanalabs/gaudi: use direct MSI in single mode Due to FLR scenario when running inside a VM, we must not use indirect MSI because it might cause some issues on VM destroy. In a VM we use single MSI mode in contrary to multi MSI mode which is used in bare-metal. Hence direct MSI should be used in single MSI mode only. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit beb71ee36e4de93c2b21d916fb94558333d99974 Author: farah kassabri Date: Wed Sep 1 15:48:04 2021 +0300 habanalabs: fix kernel OOPs related to staged cs In case of single staged cs with both first/last indications set, we reach a scenario where in cs_release function flow we don't cancel the TDR work before freeing the cs memory, this lead to kernel OOPs since when the timer expires the work pointer will be freed already. In addition treat wait encaps cs "not found" handle as "OK" for the user in order to keep the user interface for both legacy and encpas signal/wait features the same. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d53c66594dc7606b191bb2976901a691d291a316 Author: Ofir Bitton Date: Mon Aug 30 15:02:09 2021 +0300 habanalabs: fix potential race in interrupt wait ioctl We have a potential race where a user interrupt can be received in between user thread value comparison and before request was added to wait list. This means that if no consecutive interrupt will be received, user thread will timeout and fail. The solution is to add the request to wait list before we perform the comparison. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 550ac9c1aaaaf51fd42e20d461f0b1cdbd55b3d2 Author: Eric Dumazet Date: Mon Sep 13 11:08:36 2021 -0700 net-caif: avoid user-triggerable WARN_ON(1) syszbot triggers this warning, which looks something we can easily prevent. If we initialize priv->list_field in chnl_net_init(), then always use list_del_init(), we can remove robust_list_del() completely. WARNING: CPU: 0 PID: 3233 at net/caif/chnl_net.c:67 robust_list_del net/caif/chnl_net.c:67 [inline] WARNING: CPU: 0 PID: 3233 at net/caif/chnl_net.c:67 chnl_net_uninit+0xc9/0x2e0 net/caif/chnl_net.c:375 Modules linked in: CPU: 0 PID: 3233 Comm: syz-executor.3 Not tainted 5.14.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:robust_list_del net/caif/chnl_net.c:67 [inline] RIP: 0010:chnl_net_uninit+0xc9/0x2e0 net/caif/chnl_net.c:375 Code: 89 eb e8 3a a3 ba f8 48 89 d8 48 c1 e8 03 42 80 3c 28 00 0f 85 bf 01 00 00 48 81 fb 00 14 4e 8d 48 8b 2b 75 d0 e8 17 a3 ba f8 <0f> 0b 5b 5d 41 5c 41 5d e9 0a a3 ba f8 4c 89 e3 e8 02 a3 ba f8 4c RSP: 0018:ffffc90009067248 EFLAGS: 00010202 RAX: 0000000000008780 RBX: ffffffff8d4e1400 RCX: ffffc9000fd34000 RDX: 0000000000040000 RSI: ffffffff88bb6e49 RDI: 0000000000000003 RBP: ffff88802cd9ee08 R08: 0000000000000000 R09: ffffffff8d0e6647 R10: ffffffff88bb6dc2 R11: 0000000000000000 R12: ffff88803791ae08 R13: dffffc0000000000 R14: 00000000e600ffce R15: ffff888073ed3480 FS: 00007fed10fa0700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2c322000 CR3: 00000000164a6000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: register_netdevice+0xadf/0x1500 net/core/dev.c:10347 ipcaif_newlink+0x4c/0x260 net/caif/chnl_net.c:468 __rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 __sys_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 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 Fixes: cc36a070b590 ("net-caif: add CAIF netdevice") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1a913270e57a8e7f1e3789802f1f64e6d0654626 Author: Alexandru Tachici Date: Mon Sep 6 09:56:30 2021 +0300 iio: adc: ad7793: Fix IRQ flag In Sigma-Delta devices the SDO line is also used as an interrupt. Leaving IRQ on level instead of falling might trigger a sample read when the IRQ is enabled, as the SDO line is already low. Not sure if SDO line will always immediately go high in ad_sd_buffer_postenable before the IRQ is enabled. Also the datasheet seem to explicitly say the falling edge of the SDO should be used as an interrupt: >From the AD7793 datasheet: " The DOUT/RDY falling edge can be used as an interrupt to a processor" Fixes: da4d3d6bb9f6 ("iio: adc: ad-sigma-delta: Allow custom IRQ flags") Signed-off-by: Alexandru Tachici Cc: Link: https://lore.kernel.org/r/20210906065630.16325-4-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit e081102f3077aa716974ccebec97003c890d5641 Author: Alexandru Tachici Date: Mon Sep 6 09:56:29 2021 +0300 iio: adc: ad7780: Fix IRQ flag Correct IRQ flag here is falling. In Sigma-Delta devices the SDO line is also used as an interrupt. Leaving IRQ on level instead of falling might trigger a sample read when the IRQ is enabled, as the SDO line is already low. Not sure if SDO line will always immediately go high in ad_sd_buffer_postenable before the IRQ is enabled. Also the datasheet seem to explicitly say the falling edge of the SDO should be used as an interrupt: >From the AD7780 datasheet: " The DOUT/Figure 22 RDY falling edge can be used as an interrupt to a processor" Fixes: da4d3d6bb9f6 ("iio: adc: ad-sigma-delta: Allow custom IRQ flags") Signed-off-by: Alexandru Tachici Cc: Link: https://lore.kernel.org/r/20210906065630.16325-3-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit 89a86da5cb8e0ee153111fb68a719d31582c206b Author: Alexandru Tachici Date: Mon Sep 6 09:56:28 2021 +0300 iio: adc: ad7192: Add IRQ flag IRQ type in ad_sigma_delta_info struct was missing. In Sigma-Delta devices the SDO line is also used as an interrupt. Leaving IRQ on level instead of falling might trigger a sample read when the IRQ is enabled, as the SDO line is already low. Not sure if SDO line will always immediately go high in ad_sd_buffer_postenable before the IRQ is enabled. Also the datasheet seem to explicitly say the falling edge of the SDO should be used as an interrupt: >From the AD7192 datasheet: "The DOUT/RDY falling edge can be used as an interrupt to a processor," Fixes: da4d3d6bb9f6 ("iio: adc: ad-sigma-delta: Allow custom IRQ flags") Signed-off-by: Alexandru Tachici Cc: Link: https://lore.kernel.org/r/20210906065630.16325-2-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit eb795cd97365a3d3d9da3926d234a7bc32a3bb15 Author: Billy Tsai Date: Tue Aug 31 15:14:44 2021 +0800 iio: adc: aspeed: set driver data when adc probe. Fix the issue when adc remove will get the null driver data. Fixed: commit 573803234e72 ("iio: Aspeed ADC") Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20210831071458.2334-2-billy_tsai@aspeedtech.com Cc: Signed-off-by: Jonathan Cameron commit fa002b364981b49d04e818abbc06fd47a5ec7b51 Author: Yang Yingliang Date: Thu Aug 19 21:24:16 2021 +0800 iio: adc: rzg2l_adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume() Add clk_disable_unprepare() on error path in rzg2l_adc_pm_runtime_resume(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210819132416.175644-1-yangyingliang@huawei.com Signed-off-by: Jonathan Cameron commit f0cb5fed37ab37f6a6c5463c5fd39b58a45670c8 Author: Miquel Raynal Date: Wed Aug 18 13:11:25 2021 +0200 iio: adc: max1027: Fix the number of max1X31 channels The macro MAX1X29_CHANNELS() already calls MAX1X27_CHANNELS(). Calling MAX1X27_CHANNELS() before MAX1X29_CHANNELS() in the definition of MAX1X31_CHANNELS() declares the first 8 channels twice. So drop this extra call from the MAX1X31 channels list definition. Fixes: 7af5257d8427 ("iio: adc: max1027: Prepare the introduction of different resolutions") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210818111139.330636-3-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 732ae19ee8f58ecaf30cbc1bbbda5cbee6a45043 Author: Miquel Raynal Date: Wed Aug 18 13:11:24 2021 +0200 iio: adc: max1027: Fix wrong shift with 12-bit devices 10-bit devices must shift the value twice. This is not needed anymore on 12-bit devices. Fixes: ae47d009b508 ("iio: adc: max1027: Introduce 12-bit devices support") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210818111139.330636-2-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit bbcf40816b547b3c37af49168950491d20d81ce1 Author: Christophe JAILLET Date: Sat Aug 21 12:37:24 2021 +0200 iio: adc128s052: Fix the error handling path of 'adc128_probe()' A successful 'regulator_enable()' call should be balanced by a corresponding 'regulator_disable()' call in the error handling path of the probe, as already done in the remove function. Update the error handling path accordingly. Fixes: 913b86468674 ("iio: adc: Add TI ADC128S052") Signed-off-by: Christophe JAILLET Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/85189f1cfcf6f5f7b42d8730966f2a074b07b5f5.1629542160.git.christophe.jaillet@wanadoo.fr Cc: Signed-off-by: Jonathan Cameron commit 9909a395e9807aa79145c9289d0c13d0133359a2 Author: Colin Ian King Date: Tue Aug 17 18:21:11 2021 +0100 iio: adc: rzg2l_adc: Fix -EBUSY timeout error return Currently when a timeout occurs in rzg2l_adc_hw_init the error -EBUSY is assigned to ret but the error code is used as the function is hard-coded to return 0. The variable ret is 0 before entering the while-loop hence the fix is just to return ret at the end of the function to return the success 0 or -EBUSY return code. Addresses-Coverity: ("Unused value") Fixes: d484c21bacfa ("iio: adc: Add driver for Renesas RZ/G2L A/D converter") Signed-off-by: Colin Ian King Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210817172111.495897-1-colin.king@canonical.com Signed-off-by: Jonathan Cameron commit 9033c7a357481fb5bcc1737bafa4aec572dca5c6 Author: Sean Nyekjaer Date: Tue Aug 17 14:43:36 2021 +0200 iio: accel: fxls8962af: return IRQ_HANDLED when fifo is flushed fxls8962af_fifo_flush() will return the samples flushed. So return IRQ_NONE only if an error is returned. Fixes: 79e3a5bdd9ef ("iio: accel: fxls8962af: add hw buffered sampling") Signed-off-by: Sean Nyekjaer Link: https://lore.kernel.org/r/20210817124336.1672169-1-sean@geanix.com Cc: Signed-off-by: Jonathan Cameron commit f7a28df7db84eb3410e9eca37832efa5aed93338 Author: Dan Carpenter Date: Mon Aug 16 21:39:54 2021 +0300 iio: dac: ti-dac5571: fix an error code in probe() If we have an unexpected number of channels then return -EINVAL instead of returning success. Fixes: df38a4a72a3b ("iio: dac: add TI DAC5571 family support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210816183954.GB2068@kili Signed-off-by: Jonathan Cameron commit 2e9edc07df2ec6f835222151fa4e536e9e54856a Author: Rob Herring Date: Thu Aug 19 13:42:38 2021 -0500 arm: dts: vexpress-v2p-ca9: Fix the SMB unit-address Based on 'ranges', the 'bus@4000000' node unit-address is off by 1 '0'. Link: https://lore.kernel.org/r/20210819184239.1192395-5-robh@kernel.org Cc: Andre Przywara Cc: Sudeep Holla Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Signed-off-by: Sudeep Holla commit 55c71dc69ecb328e6212ac5154099c4230d0b83f Author: Rob Herring Date: Thu Aug 19 13:42:37 2021 -0500 arm: dts: vexpress: Drop unused properties from motherboard node Drop the '#interrupt-cells' property in the motherboard node which has no effect as the node is neither an interrupt-controller or interrupt-map (that's in the parent node). Drop 'model' as it is not used by software nor documented. Drop 'arm,v2m-memory-map' as it is not used by software. The purpose was to describe which memory map, but that's all described by the DT already. Link: https://lore.kernel.org/r/20210819184239.1192395-4-robh@kernel.org Cc: Andre Przywara Cc: Sudeep Holla Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Signed-off-by: Sudeep Holla commit 217cb530a30a157153878c89cfee0764a66378ec Author: Krzysztof Kozlowski Date: Fri Aug 20 10:17:33 2021 +0200 arm64: dts: arm: drop unused interrupt-names in MHU The arm,mhu bindings and driver do not define interrupt-names, so drop the property to fix warnings: arch/arm64/boot/dts/arm/juno-r2.dt.yaml: mhu@2b1f0000: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+' Link: https://lore.kernel.org/r/20210820081733.83976-3-krzysztof.kozlowski@canonical.com Acked-by: Liviu Dudau Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sudeep Holla commit 5f741ef384d3cfb9967029d335a3f7c45f4ffc55 Author: Krzysztof Kozlowski Date: Fri Aug 20 10:17:32 2021 +0200 ARM: dts: arm: align watchdog and mmc node names with dtschema Align the watchdog and mmc device node names with the schema to fix warnings like: mmci@50000: $nodename:0: 'mmci@50000' does not match '^mmc(@.*)?$' wdt@f0000: $nodename:0: 'wdt@f0000' does not match '^watchdog(@.*|-[0-9a-f])?$' Link: https://lore.kernel.org/r/20210820081733.83976-2-krzysztof.kozlowski@canonical.com Acked-by: Liviu Dudau Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sudeep Holla commit b43446b4f5ffb70cd7459728ec805a9d3438b8e2 Author: Krzysztof Kozlowski Date: Fri Aug 20 10:17:31 2021 +0200 arm64: dts: arm: align watchdog and mmc node names with dtschema Align the watchdog and mmc device node names with the schema to fix warnings like: mmci@50000: $nodename:0: 'mmci@50000' does not match '^mmc(@.*)?$' wdt@f0000: $nodename:0: 'wdt@f0000' does not match '^watchdog(@.*|-[0-9a-f])?$' Link: https://lore.kernel.org/r/20210820081733.83976-1-krzysztof.kozlowski@canonical.com Acked-by: Liviu Dudau Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sudeep Holla commit 3c3c8e88c8712bfe06cd10d7ca77a94a33610cd6 Author: Mario Limonciello Date: Mon Sep 13 21:01:14 2021 -0500 platform/x86: amd-pmc: Increase the response register timeout There have been reports of approximately a 0.9%-1.7% failure rate in SMU communication timeouts with s0i3 entry on some OEM designs. Currently the design in amd-pmc is to try every 100us for up to 20ms. However the GPU driver which also communicates with the SMU using a mailbox register which the driver polls every 1us for up to 2000ms. In the GPU driver this was increased by commit 055162645a40 ("drm/amd/pm: increase time out value when sending msg to SMU") Increase the maximum timeout used by amd-pmc to 2000ms to match this behavior. This has been shown to improve the stability for machines that randomly have failures. Cc: stable@kernel.org Reported-by: Julian Sikorski BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1629 Signed-off-by: Mario Limonciello Acked-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20210914020115.655-1-mario.limonciello@amd.com Signed-off-by: Hans de Goede commit 25a1433216489de4abc889910f744e952cb6dbae Author: Dan Carpenter Date: Mon Sep 6 21:35:48 2021 +0900 mcb: fix error handling in mcb_alloc_bus() There are two bugs: 1) If ida_simple_get() fails then this code calls put_device(carrier) but we haven't yet called get_device(carrier) and probably that leads to a use after free. 2) After device_initialize() then we need to use put_device() to release the bus. This will free the internal resources tied to the device and call mcb_free_bus() which will free the rest. Fixes: 5d9e2ab9fea4 ("mcb: Implement bus->dev.release callback") Fixes: 18d288198099 ("mcb: Correctly initialize the bus's device") Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/32e160cf6864ce77f9d62948338e24db9fd8ead9.1630931319.git.johannes.thumshirn@wdc.com Signed-off-by: Greg Kroah-Hartman commit 7049d853cfb928f50b6041cb4a5c6d6c1d8dd201 Author: Jiri Slaby Date: Tue Sep 14 11:11:19 2021 +0200 tty: unexport tty_ldisc_release Initially, tty_ldisc_release() was exported for speakup (spk_tty) while in staging. Later, the call to this function was removed as it was bogus anyway. Remove the export now. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210914091134.17426-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit da546d6b748e570aa6e44acaa515cfc43baeaa0d Author: Robert Marko Date: Fri Sep 3 00:03:25 2021 +0200 arm64: dts: qcom: ipq8074: remove USB tx-fifo-resize property tx-fifo-resize is now added by default by the dwc3-qcom driver to the SNPS DWC3 child node. So, lets drop the tx-fifo-resize property from dwc3-qcom nodes as having it there will cause the dwc3-qcom driver to error and abort probe with: [ 1.362938] dwc3-qcom 8af8800.usb: unable to add property [ 1.368405] dwc3-qcom 8af8800.usb: failed to register DWC3 Core, err=-17 Fixes: cefdd52fa045 ("usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default") Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20210902220325.1783567-1-robimarko@gmail.com Signed-off-by: Greg Kroah-Hartman commit ad7cc2d41b7a8d0c5c5ecff37c3de7a4e137b3a6 Author: Cameron Berkenpas Date: Mon Sep 13 14:26:29 2021 -0700 ALSA: hda/realtek: Quirks to enable speaker output for Lenovo Legion 7i 15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 laptops. This patch initializes and enables speaker output on the Lenovo Legion 7i 15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 series of laptops using the HDA verb sequence specific to each model. Speaker automute is suppressed for the Lenovo Legion 7i 15IMHG05 to avoid breaking speaker output on resume and when devices are unplugged from its headphone jack. Thanks to: Andreas Holzer, Vincent Morel, sycxyc, Max Christian Pohle and all others that helped. [ minor coding style fixes by tiwai ] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208555 Signed-off-by: Cameron Berkenpas Cc: Link: https://lore.kernel.org/r/20210913212627.339362-1-cam@neo-zeon.de Signed-off-by: Takashi Iwai commit 06e49073dfba24df4b1073a068631b13a0039c34 Author: Randy Dunlap Date: Wed Sep 1 17:38:06 2021 -0700 tty: synclink_gt: rename a conflicting function name 'set_signals()' in synclink_gt.c conflicts with an exported symbol in arch/um/, so change set_signals() to set_gtsignals(). Keep the function names similar by also changing get_signals() to get_gtsignals(). ../drivers/tty/synclink_gt.c:442:13: error: conflicting types for ‘set_signals’ static void set_signals(struct slgt_info *info); ^~~~~~~~~~~ In file included from ../include/linux/irqflags.h:16:0, from ../include/linux/spinlock.h:58, from ../include/linux/mm_types.h:9, from ../include/linux/buildid.h:5, from ../include/linux/module.h:14, from ../drivers/tty/synclink_gt.c:46: ../arch/um/include/asm/irqflags.h:6:5: note: previous declaration of ‘set_signals’ was here int set_signals(int enable); ^~~~~~~~~~~ Fixes: 705b6c7b34f2 ("[PATCH] new driver synclink_gt") Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Paul Fulghum Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20210902003806.17054-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 8d753db5c227d1f403c4bc9cae4ae02c862413cd Author: Christophe JAILLET Date: Wed Sep 8 21:55:56 2021 +0200 misc: genwqe: Fixes DMA mask setting Commit 505b08777d78 ("misc: genwqe: Use dma_set_mask_and_coherent to simplify code") changed the logic in the code. Instead of a ||, a && should have been used to keep the code the same. Fixes: 505b08777d78 ("misc: genwqe: Use dma_set_mask_and_coherent to simplify code") Cc: stable Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/be49835baa8ba6daba5813b399edf6300f7fdbda.1631130862.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit f0e8a206a2a53a919e1709c654cb65d519f7befb Author: Jack Pham Date: Thu Sep 9 10:48:11 2021 -0700 usb: gadget: f_uac2: Populate SS descriptors' wBytesPerInterval For Isochronous endpoints, the SS companion descriptor's wBytesPerInterval field is required to reserve bus time in order to transmit the required payload during the service interval. If left at 0, the UAC2 function is unable to transact data on its playback or capture endpoints in SuperSpeed mode. Since f_uac2 currently does not support any bursting this value can be exactly equal to the calculated wMaxPacketSize. Tested with Windows 10 as a host. Fixes: f8cb3d556be3 ("usb: f_uac2: adds support for SS and SSP") Cc: stable Signed-off-by: Jack Pham Link: https://lore.kernel.org/r/20210909174811.12534-3-jackp@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit 595091a1426a3b2625dad322f69fe569dc9d8943 Author: Jack Pham Date: Thu Sep 9 10:48:10 2021 -0700 usb: gadget: f_uac2: Add missing companion descriptor for feedback EP The f_uac2 function fails to enumerate when connected in SuperSpeed due to the feedback endpoint missing the companion descriptor. Add a new ss_epin_fback_desc_comp descriptor and append it behind the ss_epin_fback_desc both in the static definition of the ss_audio_desc structure as well as its dynamic construction in setup_headers(). Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support") Cc: stable Signed-off-by: Jack Pham Link: https://lore.kernel.org/r/20210909174811.12534-2-jackp@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit dbe2518b2d8eabffa74dbf7d9fdd7dacddab7fc0 Author: Minas Harutyunyan Date: Sat Sep 11 22:58:30 2021 +0400 usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA When last descriptor in a descriptor list completed with XferComplete interrupt, core switching to handle next descriptor and assert BNA interrupt. Both these interrupts are set while dwc2_hsotg_epint() handler called. Each interrupt should be handled separately: first XferComplete interrupt then BNA interrupt, otherwise last completed transfer will not be giveback to function driver as completed request. Fixes: 729cac693eec ("usb: dwc2: Change ISOC DDMA flow") Cc: stable Signed-off-by: Minas Harutyunyan Link: https://lore.kernel.org/r/a36981accc26cd674c5d8f8da6164344b94ec1fe.1631386531.git.Minas.Harutyunyan@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 5cf86349e98b14f505f83aae45a6df2bacc15a7a Author: Kishon Vijay Abraham I Date: Thu Sep 9 12:12:00 2021 +0530 usb: core: hcd: Modularize HCD stop configuration in usb_stop_hcd() No functional change. Since configuration to stop HCD is invoked from multiple places, group all of them in usb_stop_hcd(). Tested-by: Chris Chiu Acked-by: Alan Stern Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20210909064200.16216-4-kishon@ti.com Signed-off-by: Greg Kroah-Hartman commit b7a0a792f864583207c593b50fd1b752ed89f4c1 Author: Kishon Vijay Abraham I Date: Thu Sep 9 12:11:59 2021 +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(). 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). 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/20210909064200.16216-3-kishon@ti.com Signed-off-by: Greg Kroah-Hartman commit 58877b0824da15698bd85a0a9dbfa8c354e6ecb7 Author: Kishon Vijay Abraham I Date: Thu Sep 9 12:11:58 2021 +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. 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/20210909064200.16216-2-kishon@ti.com Signed-off-by: Greg Kroah-Hartman commit 91bb163e1e4f88092f50dfaa5a816b658753e4b2 Author: Minas Harutyunyan Date: Thu Sep 9 14:45:15 2021 +0400 usb: dwc2: gadget: Fix ISOC flow for BDMA and Slave According USB spec each ISOC transaction should be performed in a designated for that transaction interval. On bus errors or delays in operating system scheduling of client software can result in no packet being transferred for a (micro)frame. An error indication should be returned as status to the client software in such a case. Current implementation in case of missed/dropped interval send same data in next possible interval instead of reporting missed isoc. This fix complete requests with -ENODATA if interval elapsed. HSOTG core in BDMA and Slave modes haven't HW support for (micro)frames tracking, this is why SW should care about tracking of (micro)frames. Because of that method and consider operating system scheduling delays, added few additional checking's of elapsed target (micro)frame: 1. Immediately before enabling EP to start transfer. 2. With any transfer completion interrupt. 3. With incomplete isoc in/out interrupt. 4. With EP disabled interrupt because of incomplete transfer. 5. With OUT token received while EP disabled interrupt (for OUT transfers). 6. With NAK replied to IN token interrupt (for IN transfers). As part of ISOC flow, additionally fixed 'current' and 'target' frame calculation functions. In HS mode SOF limits provided by DSTS register is 0x3fff, but in non HS mode this limit is 0x7ff. Tested by internal tool which also using for dwc3 testing. Signed-off-by: Minas Harutyunyan Cc: stable Link: https://lore.kernel.org/r/95d1423adf4b0f68187c9894820c4b7e964a3f7f.1631175721.git.Minas.Harutyunyan@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 8cfac9a6744fcb143cb3e94ce002f09fd17fadbb Author: Li Jun Date: Wed Sep 8 10:28:19 2021 +0800 usb: dwc3: core: balance phy init and exit After we start to do core soft reset while usb role switch, the phy init is invoked at every switch to device mode, but its counter part de-init is missing, this causes the actual phy init can not be done when we really want to re-init phy like system resume, because the counter maintained by phy core is not 0. considering phy init is actually redundant for role switch, so move out the phy init from core soft reset to dwc3 core init where is the only place required. Fixes: f88359e1588b ("usb: dwc3: core: Do core softreset when switch mode") Cc: Tested-by: faqiang.zhu Tested-by: John Stultz #HiKey960 Acked-by: Felipe Balbi Signed-off-by: Li Jun Link: https://lore.kernel.org/r/1631068099-13559-1-git-send-email-jun.li@nxp.com Signed-off-by: Greg Kroah-Hartman commit d91adc5322ab53df4b6d1989242bfb6c63163eb2 Author: Rafał Miłecki Date: Tue Aug 31 08:54:19 2021 +0200 Revert "USB: bcma: Add a check for devm_gpiod_get" This reverts commit f3de5d857bb2362b00e2a8d4bc886cd49dcb66db. That commit broke USB on all routers that have USB always powered on and don't require toggling any GPIO. It's a majority of devices actually. The original code worked and seemed safe: vcc GPIO is optional and bcma_hci_platform_power_gpio() takes care of checking the pointer before using it. This revert fixes: [ 10.801127] bcma_hcd: probe of bcma0:11 failed with error -2 Fixes: f3de5d857bb2 ("USB: bcma: Add a check for devm_gpiod_get") Cc: stable Cc: Chuhong Yuan Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20210831065419.18371-1-zajec5@gmail.com Signed-off-by: Greg Kroah-Hartman commit aad06846a2304e48e7a223fad8971eed16179606 Author: Guenter Roeck Date: Tue Sep 7 05:30:02 2021 -0700 usb: ehci: Simplify platform driver registration Use platform_register_drivers() and platform_unregister_drivers() to register and unregister ehci platform drivers. This simplifies the code and prevents the following build errors seen with sparc:allmodconfig. drivers/usb/host/ehci-hcd.c:1301: error: "PLATFORM_DRIVER" redefined drivers/usb/host/ehci-sh.c:173:31: error: 'ehci_hcd_sh_driver' defined but not used Acked-by: Alan Stern Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210907123002.3951446-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman commit 91fac0741d4817945c6ee0a17591421e7f5ecb86 Author: Johan Hovold Date: Tue Sep 7 10:23:18 2021 +0200 USB: cdc-acm: fix minor-number release If the driver runs out of minor numbers it would release minor 0 and allow another device to claim the minor while still in use. Fortunately, registering the tty class device of the second device would fail (with a stack dump) due to the sysfs name collision so no memory is leaked. Fixes: cae2bc768d17 ("usb: cdc-acm: Decrement tty port's refcount if probe() fail") Cc: stable@vger.kernel.org # 4.19 Cc: Jaejoong Kim Acked-by: Oliver Neukum Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210907082318.7757-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 856e6e8e0f9300befa87dde09edb578555c99a82 Author: Yang Yingliang Date: Tue Aug 31 16:42:36 2021 +0800 usb: dwc2: 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/20210831084236.1359677-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit b69ec50b3e55c4b2a85c8bc46763eaf330605847 Author: Pawel Laszczak Date: Tue Sep 7 08:26:19 2021 +0200 usb: cdns3: fix race condition before setting doorbell For DEV_VER_V3 version there exist race condition between clearing ep_sts.EP_STS_TRBERR and setting ep_cmd.EP_CMD_DRDY bit. Setting EP_CMD_DRDY will be ignored by controller when EP_STS_TRBERR is set. So, between these two instructions we have a small time gap in which the EP_STSS_TRBERR can be set. In such case the transfer will not start after setting doorbell. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") cc: # 5.12.x Tested-by: Aswath Govindraju Reviewed-by: Aswath Govindraju Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20210907062619.34622-1-pawell@gli-login.cadence.com Signed-off-by: Greg Kroah-Hartman commit 17956b53ebff6a490baf580a836cbd3eae94892b Author: Dan Carpenter Date: Mon Sep 6 12:42:21 2021 +0300 usb: gadget: r8a66597: fix a loop in set_feature() This loop is supposed to loop until if reads something other than CS_IDST or until it times out after 30,000 attempts. But because of the || vs && bug, it will never time out and instead it will loop a minimum of 30,000 times. This bug is quite old but the code is only used in USB_DEVICE_TEST_MODE so it probably doesn't affect regular usage. Fixes: 96fe53ef5498 ("usb: gadget: r8a66597-udc: add support for TEST_MODE") Cc: stable Reviewed-by: Yoshihiro Shimoda Acked-by: Felipe Balbi Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210906094221.GA10957@kili Signed-off-by: Greg Kroah-Hartman commit f5dfd98a80ff8d50cf4ae2820857d7f5a46cbab9 Author: Pavel Hofman Date: Mon Sep 6 15:08:22 2021 +0200 usb: gadget: u_audio: EP-OUT bInterval in fback frequency The patch increases the bitshift in feedback frequency calculation with EP-OUT bInterval value. Tests have revealed that Win10 and OSX UAC2 drivers require the feedback frequency to be based on the actual packet interval instead of on the USB2 microframe. Otherwise they ignore the feedback value. Linux snd-usb-audio driver detects the applied bitshift automatically. Tested-by: Henrik Enquist Signed-off-by: Pavel Hofman Cc: stable Link: https://lore.kernel.org/r/20210906130822.12256-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 70f437fb4395ad4d1d16fab9a1ad9fbc9fc0579b Author: Keith Busch Date: Thu Sep 9 08:54:52 2021 -0700 nvme-tcp: fix io_work priority inversion Dispatching requests inline with the .queue_rq() call may block while holding the send_mutex. If the tcp io_work also happens to schedule, it may see the req_list is non-empty, leaving "pending" true and remaining in TASK_RUNNING. Since io_work is of higher scheduling priority, the .queue_rq task may not get a chance to run, blocking forward progress and leading to io timeouts. Instead of checking for pending requests within io_work, let the queueing restart io_work outside the send_mutex lock if there is more work to be done. Fixes: a0fdd1418007f ("nvme-tcp: rerun io_work if req_list is not empty") Reported-by: Samuel Jones Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 9817d763dbe15327b9b3ff4404fa6f27f927e744 Author: Ruozhu Li Date: Mon Sep 6 11:51:34 2021 +0800 nvme-rdma: destroy cm id before destroy qp to avoid use after free We should always destroy cm_id before destroy qp to avoid to get cma event after qp was destroyed, which may lead to use after free. In RDMA connection establishment error flow, don't destroy qp in cm event handler.Just report cm_error to upper level, qp will be destroy in nvme_rdma_alloc_queue() after destroy cm id. Signed-off-by: Ruozhu Li Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 79f528afa93918519574773ea49a444c104bc1bd Author: Anton Eidelman Date: Sun Sep 12 12:54:57 2021 -0600 nvme-multipath: fix ANA state updates when a namespace is not present nvme_update_ana_state() has a deficiency that results in a failure to properly update the ana state for a namespace in the following case: NSIDs in ctrl->namespaces: 1, 3, 4 NSIDs in desc->nsids: 1, 2, 3, 4 Loop iteration 0: ns index = 0, n = 0, ns->head->ns_id = 1, nsid = 1, MATCH. Loop iteration 1: ns index = 1, n = 1, ns->head->ns_id = 3, nsid = 2, NO MATCH. Loop iteration 2: ns index = 2, n = 2, ns->head->ns_id = 4, nsid = 4, MATCH. Where the update to the ANA state of NSID 3 is missed. To fix this increment n and retry the update with the same ns when ns->head->ns_id is higher than nsid, Signed-off-by: Anton Eidelman Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg commit f81c08f897adafd2ed43f86f00207ff929f0b2eb Author: Faizel K B Date: Thu Sep 2 17:14:44 2021 +0530 usb: testusb: Fix for showing the connection speed testusb' application which uses 'usbtest' driver reports 'unknown speed' from the function 'find_testdev'. The variable 'entry->speed' was not updated from the application. The IOCTL mentioned in the FIXME comment can only report whether the connection is low speed or not. Speed is read using the IOCTL USBDEVFS_GET_SPEED which reports the proper speed grade. The call is implemented in the function 'handle_testdev' where the file descriptor was availble locally. Sample output is given below where 'high speed' is printed as the connected speed. sudo ./testusb -a high speed /dev/bus/usb/001/011 0 /dev/bus/usb/001/011 test 0, 0.000015 secs /dev/bus/usb/001/011 test 1, 0.194208 secs /dev/bus/usb/001/011 test 2, 0.077289 secs /dev/bus/usb/001/011 test 3, 0.170604 secs /dev/bus/usb/001/011 test 4, 0.108335 secs /dev/bus/usb/001/011 test 5, 2.788076 secs /dev/bus/usb/001/011 test 6, 2.594610 secs /dev/bus/usb/001/011 test 7, 2.905459 secs /dev/bus/usb/001/011 test 8, 2.795193 secs /dev/bus/usb/001/011 test 9, 8.372651 secs /dev/bus/usb/001/011 test 10, 6.919731 secs /dev/bus/usb/001/011 test 11, 16.372687 secs /dev/bus/usb/001/011 test 12, 16.375233 secs /dev/bus/usb/001/011 test 13, 2.977457 secs /dev/bus/usb/001/011 test 14 --> 22 (Invalid argument) /dev/bus/usb/001/011 test 17, 0.148826 secs /dev/bus/usb/001/011 test 18, 0.068718 secs /dev/bus/usb/001/011 test 19, 0.125992 secs /dev/bus/usb/001/011 test 20, 0.127477 secs /dev/bus/usb/001/011 test 21 --> 22 (Invalid argument) /dev/bus/usb/001/011 test 24, 4.133763 secs /dev/bus/usb/001/011 test 27, 2.140066 secs /dev/bus/usb/001/011 test 28, 2.120713 secs /dev/bus/usb/001/011 test 29, 0.507762 secs Signed-off-by: Faizel K B Link: https://lore.kernel.org/r/20210902114444.15106-1-faizel.kb@dicortech.com Signed-off-by: Greg Kroah-Hartman commit 844f7eaaed9267ae17d33778efe65548cc940205 Author: Eugene Syromiatnikov Date: Sun Sep 12 14:22:34 2021 +0200 include/uapi/linux/xfrm.h: Fix XFRM_MSG_MAPPING ABI breakage Commit 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING enum item, thus also evading the build-time check in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper security permission checks in nlmsg_xfrm_perms. Fix it by placing XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before __XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly. Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/ Signed-off-by: Eugene Syromiatnikov Acked-by: Antony Antony Acked-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit 81065b35e2486c024c7aa86caed452e1f01a59d4 Author: Tony Luck Date: Mon Sep 13 14:52:39 2021 -0700 x86/mce: Avoid infinite loop for copy from user recovery There are two cases for machine check recovery: 1) The machine check was triggered by ring3 (application) code. This is the simpler case. The machine check handler simply queues work to be executed on return to user. That code unmaps the page from all users and arranges to send a SIGBUS to the task that triggered the poison. 2) The machine check was triggered in kernel code that is covered by an exception table entry. In this case the machine check handler still queues a work entry to unmap the page, etc. but this will not be called right away because the #MC handler returns to the fix up code address in the exception table entry. Problems occur if the kernel triggers another machine check before the return to user processes the first queued work item. Specifically, the work is queued using the ->mce_kill_me callback structure in the task struct for the current thread. Attempting to queue a second work item using this same callback results in a loop in the linked list of work functions to call. So when the kernel does return to user, it enters an infinite loop processing the same entry for ever. There are some legitimate scenarios where the kernel may take a second machine check before returning to the user. 1) Some code (e.g. futex) first tries a get_user() with page faults disabled. If this fails, the code retries with page faults enabled expecting that this will resolve the page fault. 2) Copy from user code retries a copy in byte-at-time mode to check whether any additional bytes can be copied. On the other side of the fence are some bad drivers that do not check the return value from individual get_user() calls and may access multiple user addresses without noticing that some/all calls have failed. Fix by adding a counter (current->mce_count) to keep track of repeated machine checks before task_work() is called. First machine check saves the address information and calls task_work_add(). Subsequent machine checks before that task_work call back is executed check that the address is in the same page as the first machine check (since the callback will offline exactly one page). Expected worst case is four machine checks before moving on (e.g. one user access with page faults disabled, then a repeat to the same address with page faults enabled ... repeat in copy tail bytes). Just in case there is some code that loops forever enforce a limit of 10. [ bp: Massage commit message, drop noinstr, fix typo, extend panic messages. ] Fixes: 5567d11c21a1 ("x86/mce: Send #MC singal from task work") Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/YT/IJ9ziLqmtqEPu@agluck-desk2.amr.corp.intel.com commit 13be2efc390acd2a46a69a359f6efc00ca434599 Author: Chris Wilson Date: Fri Mar 5 12:21:40 2021 +0000 rtc: cmos: Disable irq around direct invocation of cmos_interrupt() As previously noted in commit 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()"): <4>[ 254.192378] WARNING: inconsistent lock state <4>[ 254.192384] 5.12.0-rc1-CI-CI_DRM_9834+ #1 Not tainted <4>[ 254.192396] -------------------------------- <4>[ 254.192400] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. <4>[ 254.192409] rtcwake/5309 [HC0[0]:SC0[0]:HE1:SE1] takes: <4>[ 254.192429] ffffffff8263c5f8 (rtc_lock){?...}-{2:2}, at: cmos_interrupt+0x18/0x100 <4>[ 254.192481] {IN-HARDIRQ-W} state was registered at: <4>[ 254.192488] lock_acquire+0xd1/0x3d0 <4>[ 254.192504] _raw_spin_lock+0x2a/0x40 <4>[ 254.192519] cmos_interrupt+0x18/0x100 <4>[ 254.192536] rtc_handler+0x1f/0xc0 <4>[ 254.192553] acpi_ev_fixed_event_detect+0x109/0x13c <4>[ 254.192574] acpi_ev_sci_xrupt_handler+0xb/0x28 <4>[ 254.192596] acpi_irq+0x13/0x30 <4>[ 254.192620] __handle_irq_event_percpu+0x43/0x2c0 <4>[ 254.192641] handle_irq_event_percpu+0x2b/0x70 <4>[ 254.192661] handle_irq_event+0x2f/0x50 <4>[ 254.192680] handle_fasteoi_irq+0x9e/0x150 <4>[ 254.192693] __common_interrupt+0x76/0x140 <4>[ 254.192715] common_interrupt+0x96/0xc0 <4>[ 254.192732] asm_common_interrupt+0x1e/0x40 <4>[ 254.192750] _raw_spin_unlock_irqrestore+0x38/0x60 <4>[ 254.192767] resume_irqs+0xba/0xf0 <4>[ 254.192786] dpm_resume_noirq+0x245/0x3d0 <4>[ 254.192811] suspend_devices_and_enter+0x230/0xaa0 <4>[ 254.192835] pm_suspend.cold.8+0x301/0x34a <4>[ 254.192859] state_store+0x7b/0xe0 <4>[ 254.192879] kernfs_fop_write_iter+0x11d/0x1c0 <4>[ 254.192899] new_sync_write+0x11d/0x1b0 <4>[ 254.192916] vfs_write+0x265/0x390 <4>[ 254.192933] ksys_write+0x5a/0xd0 <4>[ 254.192949] do_syscall_64+0x33/0x80 <4>[ 254.192965] entry_SYSCALL_64_after_hwframe+0x44/0xae <4>[ 254.192986] irq event stamp: 43775 <4>[ 254.192994] hardirqs last enabled at (43775): [] asm_sysvec_apic_timer_interrupt+0x12/0x20 <4>[ 254.193023] hardirqs last disabled at (43774): [] sysvec_apic_timer_interrupt+0xa/0xb0 <4>[ 254.193049] softirqs last enabled at (42548): [] __do_softirq+0x342/0x48e <4>[ 254.193074] softirqs last disabled at (42543): [] irq_exit_rcu+0xad/0xd0 <4>[ 254.193101] other info that might help us debug this: <4>[ 254.193107] Possible unsafe locking scenario: <4>[ 254.193112] CPU0 <4>[ 254.193117] ---- <4>[ 254.193121] lock(rtc_lock); <4>[ 254.193137] <4>[ 254.193142] lock(rtc_lock); <4>[ 254.193156] *** DEADLOCK *** <4>[ 254.193161] 6 locks held by rtcwake/5309: <4>[ 254.193174] #0: ffff888104861430 (sb_writers#5){.+.+}-{0:0}, at: ksys_write+0x5a/0xd0 <4>[ 254.193232] #1: ffff88810f823288 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0xe7/0x1c0 <4>[ 254.193282] #2: ffff888100cef3c0 (kn->active#285 <7>[ 254.192706] i915 0000:00:02.0: [drm:intel_modeset_setup_hw_state [i915]] [CRTC:51:pipe A] hw state readout: disabled <4>[ 254.193307] ){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xf0/0x1c0 <4>[ 254.193333] #3: ffffffff82649fa8 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend.cold.8+0xce/0x34a <4>[ 254.193387] #4: ffffffff827a2108 (acpi_scan_lock){+.+.}-{3:3}, at: acpi_suspend_begin+0x47/0x70 <4>[ 254.193433] #5: ffff8881019ea178 (&dev->mutex){....}-{3:3}, at: device_resume+0x68/0x1e0 <4>[ 254.193485] stack backtrace: <4>[ 254.193492] CPU: 1 PID: 5309 Comm: rtcwake Not tainted 5.12.0-rc1-CI-CI_DRM_9834+ #1 <4>[ 254.193514] Hardware name: Google Soraka/Soraka, BIOS MrChromebox-4.10 08/25/2019 <4>[ 254.193524] Call Trace: <4>[ 254.193536] dump_stack+0x7f/0xad <4>[ 254.193567] mark_lock.part.47+0x8ca/0xce0 <4>[ 254.193604] __lock_acquire+0x39b/0x2590 <4>[ 254.193626] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 <4>[ 254.193660] lock_acquire+0xd1/0x3d0 <4>[ 254.193677] ? cmos_interrupt+0x18/0x100 <4>[ 254.193716] _raw_spin_lock+0x2a/0x40 <4>[ 254.193735] ? cmos_interrupt+0x18/0x100 <4>[ 254.193758] cmos_interrupt+0x18/0x100 <4>[ 254.193785] cmos_resume+0x2ac/0x2d0 <4>[ 254.193813] ? acpi_pm_set_device_wakeup+0x1f/0x110 <4>[ 254.193842] ? pnp_bus_suspend+0x10/0x10 <4>[ 254.193864] pnp_bus_resume+0x5e/0x90 <4>[ 254.193885] dpm_run_callback+0x5f/0x240 <4>[ 254.193914] device_resume+0xb2/0x1e0 <4>[ 254.193942] ? pm_dev_err+0x25/0x25 <4>[ 254.193974] dpm_resume+0xea/0x3f0 <4>[ 254.194005] dpm_resume_end+0x8/0x10 <4>[ 254.194030] suspend_devices_and_enter+0x29b/0xaa0 <4>[ 254.194066] pm_suspend.cold.8+0x301/0x34a <4>[ 254.194094] state_store+0x7b/0xe0 <4>[ 254.194124] kernfs_fop_write_iter+0x11d/0x1c0 <4>[ 254.194151] new_sync_write+0x11d/0x1b0 <4>[ 254.194183] vfs_write+0x265/0x390 <4>[ 254.194207] ksys_write+0x5a/0xd0 <4>[ 254.194232] do_syscall_64+0x33/0x80 <4>[ 254.194251] entry_SYSCALL_64_after_hwframe+0x44/0xae <4>[ 254.194274] RIP: 0033:0x7f07d79691e7 <4>[ 254.194293] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 <4>[ 254.194312] RSP: 002b:00007ffd9cc2c768 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 <4>[ 254.194337] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f07d79691e7 <4>[ 254.194352] RDX: 0000000000000004 RSI: 0000556ebfc63590 RDI: 000000000000000b <4>[ 254.194366] RBP: 0000556ebfc63590 R08: 0000000000000000 R09: 0000000000000004 <4>[ 254.194379] R10: 0000556ebf0ec2a6 R11: 0000000000000246 R12: 0000000000000004 which breaks S3-resume on fi-kbl-soraka presumably as that's slow enough to trigger the alarm during the suspend. Fixes: 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ") References: 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()"): Signed-off-by: Chris Wilson Cc: Xiaofei Tan Cc: Alexandre Belloni Cc: Alessandro Zummo Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210305122140.28774-1-chris@chris-wilson.co.uk commit 74e1eb3b4a1ef2e564b4bdeb6e92afe844e900de Author: Pali Rohár Date: Sat Sep 11 15:20:17 2021 +0200 serial: mvebu-uart: fix driver's tx_empty callback Driver's tx_empty callback should signal when the transmit shift register is empty. So when the last character has been sent. STAT_TX_FIFO_EMP bit signals only that HW transmit FIFO is empty, which happens when the last byte is loaded into transmit shift register. STAT_TX_EMP bit signals when the both HW transmit FIFO and transmit shift register are empty. So replace STAT_TX_FIFO_EMP check by STAT_TX_EMP in mvebu_uart_tx_empty() callback function. Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") Cc: stable Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20210911132017.25505-1-pali@kernel.org Signed-off-by: Greg Kroah-Hartman commit 79e9e30a9292a62d25ab75488d3886108db1eaad Author: Nishanth Menon Date: Fri Sep 3 00:05:50 2021 -0500 serial: 8250: 8250_omap: Fix RX_LVL register offset Commit b67e830d38fa ("serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs") introduced fixup including a register read to RX_LVL, however, we should be using word offset than byte offset since our registers are on 4 byte boundary (port.regshift = 2) for 8250_omap. Fixes: b67e830d38fa ("serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs") Cc: stable Cc: Jan Kiszka Cc: Vignesh Raghavendra Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20210903050550.29050-1-nm@ti.com Signed-off-by: Greg Kroah-Hartman commit 00598d5c69318a1fcb4147878e16754ba9103be6 Author: Vinay Belgaumkar Date: Tue Sep 7 16:27:04 2021 -0700 drm/i915: Get PM ref before accessing HW register Seeing these errors when GT is likely in suspend state- "RPM wakelock ref not held during HW access" Ensure GT is awake before trying to access HW registers. Avoid reading the register if that is not the case. Signed-off-by: Vinay Belgaumkar Fixes: 41e5c17ebfc2 ("drm/i915/guc/slpc: Sysfs hooks for SLPC") Reviewed-by: Tvrtko Ursulin Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210907232704.12982-1-vinay.belgaumkar@intel.com (cherry picked from commit f25e3908b9cd4a3fe819e9bdcdde58f20bacb34c) Signed-off-by: Jani Nikula commit 031536665f64aaeb7e7439d96689a4011407abb8 Author: Daniel Vetter Date: Thu Sep 2 16:20:48 2021 +0200 drm/i915: Release ctx->syncobj on final put, not on ctx close gem context refcounting is another exercise in least locking design it seems, where most things get destroyed upon context closure (which can race with anything really). Only the actual memory allocation and the locks survive while holding a reference. This tripped up Jason when reimplementing the single timeline feature in commit 00dae4d3d35d4f526929633b76e00b0ab4d3970d Author: Jason Ekstrand Date: Thu Jul 8 10:48:12 2021 -0500 drm/i915: Implement SINGLE_TIMELINE with a syncobj (v4) We could fix the bug by holding ctx->mutex in execbuf and clear the pointer (again while holding the mutex) context_close, but it's cleaner to just make the context object actually invariant over its _entire_ lifetime. This way any other ioctl that's potentially racing, but holding a full reference, can still rely on ctx->syncobj being an immutable pointer. Which without this change, is not the case. Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Fixes: 00dae4d3d35d ("drm/i915: Implement SINGLE_TIMELINE with a syncobj (v4)") Cc: Jason Ekstrand Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: Matthew Brost Cc: Matthew Auld Cc: Maarten Lankhorst Cc: "Thomas Hellström" Cc: Lionel Landwerlin Cc: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20210902142057.929669-2-daniel.vetter@ffwll.ch (cherry picked from commit c238980efd3b35af70fc926066cf7440f50a97a9) Signed-off-by: Jani Nikula commit 04a3ab6acd54b104838b3f6bd715447631c6e87d Author: Thomas Hellström Date: Tue Aug 31 14:29:31 2021 +0200 drm/i915/gem: Fix the mman selftest Using the I915_MMAP_TYPE_FIXED mmap type requires the TTM backend, so for that mmap type, use __i915_gem_object_create_user() instead of i915_gem_object_create_internal(), as we really want to tests objects mmap-able by user-space. This also means that the out-of-space error happens at object creation and returns -ENXIO rather than -ENOSPC, so fix the code up to expect that on out-of-offset-space errors. Finally only use I915_MMAP_TYPE_FIXED for LMEM and SMEM for now if testing on LMEM-capable devices. For stolen LMEM, we still take the same path as for integrated, as that haven't been moved over to TTM yet, and user-space should not be able to create out of stolen LMEM anyway. v2: - Check the presence of the obj->ops->mmap_offset callback rather than hardcoding the supported mmap regions in can_mmap() (Maarten Lankhorst) Fixes: 7961c5b60f23 ("drm/i915: Add TTM offset argument to mmap.") Cc: Maarten Lankhorst Signed-off-by: Thomas Hellström Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210831122931.157536-1-thomas.hellstrom@linux.intel.com (cherry picked from commit 450cede7f3804ca7f8b3da210ebefa61c0958f22) Signed-off-by: Jani Nikula commit 415406380c29694e12b164f05e467659381feca5 Author: Daniele Ceraolo Spurio Date: Mon Aug 23 09:31:37 2021 -0700 drm/i915/guc: drop guc_communication_enabled The function is only used from within GEM_BUG_ON(), which is causing warnings with Wunneeded-internal-declaration in some builds. Since the function is a simple wrapper around a CT function, we can just call the CT function directly instead. Fixes: 1fb12c587152 ("drm/i915/guc: skip disabling CTBs before sanitizing the GuC") Reported-by: kernel test robot Signed-off-by: Daniele Ceraolo Spurio Cc: Matthew Brost Cc: John Harrison Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210823163137.19770-1-daniele.ceraolospurio@intel.com (cherry picked from commit 5db1856781e45c9610f7652a19cc656b984235e7) Signed-off-by: Jani Nikula commit c8dead5751b81dfa6b10449b740ed1062ff670c5 Author: Kai-Heng Feng Date: Fri Aug 20 15:52:59 2021 +0800 drm/i915/dp: Use max params for panels < eDP 1.4 Users reported that after commit 2bbd6dba84d4 ("drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure"), the screen starts to have wobbly effect. Commit a5c936add6a2 ("drm/i915/dp: Use slow and wide link training for everything") doesn't help either, that means the affected eDP 1.2 panels only work with max params. So use max params for panels < eDP 1.4 as Windows does to solve the issue. v3: - Do the eDP rev check in intel_edp_init_dpcd() v2: - Check eDP 1.4 instead of DPCD 1.1 to apply max params Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3714 Fixes: 2bbd6dba84d4 ("drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure") Fixes: a5c936add6a2 ("drm/i915/dp: Use slow and wide link training for everything") Suggested-by: Ville Syrjälä Signed-off-by: Kai-Heng Feng Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210820075301.693099-1-kai.heng.feng@canonical.com (cherry picked from commit d7f213c131adf0bec8b731553eb82990cdac265d) Signed-off-by: Jani Nikula commit 9af4bf2171c1a9e3f2ebb21140c0e34e60b2a22a Author: Lee Shawn C Date: Tue Jul 6 23:25:41 2021 +0800 drm/i915/dp: return proper DPRX link training result After DPRX link training, intel_dp_link_train_phy() did not return the training result properly. If link training failed, i915 driver would not run into link train fallback function. And no hotplug uevent would be received by user space application. Fixes: b30edfd8d0b4 ("drm/i915: Switch to LTTPR non-transparent mode link training") Cc: Ville Syrjala Cc: Imre Deak Cc: Jani Nikula Cc: Cooper Chiou Cc: William Tseng Signed-off-by: Lee Shawn C Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20210706152541.25021-1-shawn.c.lee@intel.com (cherry picked from commit dab1b47e57e053b2a02c22ead8e7449f79961335) Signed-off-by: Jani Nikula commit 0560204b360a332c321124dbc5cdfd3364533a74 Author: Juergen Gross Date: Fri Sep 3 10:49:36 2021 +0200 PM: base: power: don't try to use non-existing RTC for storing data If there is no legacy RTC device, don't try to use it for storing trace data across suspend/resume. Cc: Signed-off-by: Juergen Gross Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20210903084937.19392-2-jgross@suse.com Signed-off-by: Juergen Gross commit 8480ed9c2bbd56fc86524998e5f2e3e22f5038f6 Author: Juergen Gross Date: Fri Aug 27 14:32:06 2021 +0200 xen/balloon: use a kernel thread instead a workqueue Today the Xen ballooning is done via delayed work in a workqueue. This might result in workqueue hangups being reported in case of large amounts of memory are being ballooned in one go (here 16GB): BUG: workqueue lockup - pool cpus=6 node=0 flags=0x0 nice=0 stuck for 64s! Showing busy workqueues and worker pools: workqueue events: flags=0x0 pwq 12: cpus=6 node=0 flags=0x0 nice=0 active=2/256 refcnt=3 in-flight: 229:balloon_process pending: cache_reap workqueue events_freezable_power_: flags=0x84 pwq 12: cpus=6 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 pending: disk_events_workfn workqueue mm_percpu_wq: flags=0x8 pwq 12: cpus=6 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 pending: vmstat_update pool 12: cpus=6 node=0 flags=0x0 nice=0 hung=64s workers=3 idle: 2222 43 This can easily be avoided by using a dedicated kernel thread for doing the ballooning work. Reported-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210827123206.15429-1-jgross@suse.com Signed-off-by: Juergen Gross commit 92dc0b1f46e12cfabd28d709bb34f7a39431b44f Author: Johan Hovold Date: Mon Sep 6 14:45:38 2021 +0200 staging: greybus: uart: fix tty use after free User space can hold a tty open indefinitely and tty drivers must not release the underlying structures until the last user is gone. Switch to using the tty-port reference counter to manage the life time of the greybus tty state to avoid use after free after a disconnect. Fixes: a18e15175708 ("greybus: more uart work") Cc: stable@vger.kernel.org # 4.9 Reviewed-by: Alex Elder Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210906124538.22358-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 212b5d2d3ed9d7db2702e4805f36a346c3985e1d Author: Jian Cai Date: Mon Sep 13 10:46:13 2021 -0600 coresight: syscfg: Fix compiler warning This fixes warnings with -Wimplicit-function-declaration, e.g. drivers/hwtracing/coresight/coresight-syscfg.c:455:15: error: implicit declaration of function 'kzalloc' [-Werror, -Wimplicit-function-declaration] csdev_item = kzalloc(sizeof(struct cscfg_registered_csdev), GFP_KERNEL); Link: https://lore.kernel.org/r/20210830172820.2840433-1-jiancai@google.com Fixes: 85e2414c518a ("coresight: syscfg: Initial coresight system configuration") Reviewed-by: Guenter Roeck Signed-off-by: Jian Cai Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210913164613.1675791-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7a8aa39d44564703620d937bb54cdea2d003657f Author: Douglas Anderson Date: Mon Sep 13 17:05:51 2021 +0100 nvmem: core: Add stubs for nvmem_cell_read_variable_le_u32/64 if !CONFIG_NVMEM When I added nvmem_cell_read_variable_le_u32() and nvmem_cell_read_variable_le_u64() I forgot to add the "static inline" stub functions for when CONFIG_NVMEM wasn't defined. Add them now. This was causing problems with randconfig builds that compiled `drivers/soc/qcom/cpr.c`. Fixes: 6feba6a62c57 ("PM: AVS: qcom-cpr: Use nvmem_cell_read_variable_le_u32()") Fixes: a28e824fb827 ("nvmem: core: Add functions to make number reading easy") Reported-by: kernel test robot Reviewed-by: Bjorn Andersson Signed-off-by: Douglas Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210913160551.12907-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5fdb55c1ac9585eb23bb2541d5819224429e103d Author: Todd Kjos Date: Mon Aug 30 12:51:46 2021 -0700 binder: make sure fd closes complete During BC_FREE_BUFFER processing, the BINDER_TYPE_FDA object cleanup may close 1 or more fds. The close operations are completed using the task work mechanism -- which means the thread needs to return to userspace or the file object may never be dereferenced -- which can lead to hung processes. Force the binder thread back to userspace if an fd is closed during BC_FREE_BUFFER handling. Fixes: 80cd795630d6 ("binder: fix use-after-free due to ksys_close() during fdget()") Cc: stable Reviewed-by: Martijn Coenen Acked-by: Christian Brauner Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20210830195146.587206-1-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit b564171ade70570b7f335fa8ed17adb28409e3ac Author: Li Li Date: Fri Sep 10 09:42:10 2021 -0700 binder: fix freeze race Currently cgroup freezer is used to freeze the application threads, and BINDER_FREEZE is used to freeze the corresponding binder interface. There's already a mechanism in ioctl(BINDER_FREEZE) to wait for any existing transactions to drain out before actually freezing the binder interface. But freezing an app requires 2 steps, freezing the binder interface with ioctl(BINDER_FREEZE) and then freezing the application main threads with cgroupfs. This is not an atomic operation. The following race issue might happen. 1) Binder interface is frozen by ioctl(BINDER_FREEZE); 2) Main thread A initiates a new sync binder transaction to process B; 3) Main thread A is frozen by "echo 1 > cgroup.freeze"; 4) The response from process B reaches the frozen thread, which will unexpectedly fail. This patch provides a mechanism to check if there's any new pending transaction happening between ioctl(BINDER_FREEZE) and freezing the main thread. If there's any, the main thread freezing operation can be rolled back to finish the pending transaction. Furthermore, the response might reach the binder driver before the rollback actually happens. That will still cause failed transaction. As the other process doesn't wait for another response of the response, the response transaction failure can be fixed by treating the response transaction like an oneway/async one, allowing it to reach the frozen thread. And it will be consumed when the thread gets unfrozen later. NOTE: This patch reuses the existing definition of struct binder_frozen_status_info but expands the bit assignments of __u32 member sync_recv. To ensure backward compatibility, bit 0 of sync_recv still indicates there's an outstanding sync binder transaction. This patch adds new information to bit 1 of sync_recv, indicating the binder transaction happens exactly when there's a race. If an existing userspace app runs on a new kernel, a sync binder call will set bit 0 of sync_recv so ioctl(BINDER_GET_FROZEN_INFO) still return the expected value (true). The app just doesn't check bit 1 intentionally so it doesn't have the ability to tell if there's a race. This behavior is aligned with what happens on an old kernel which doesn't set bit 1 at all. A new userspace app can 1) check bit 0 to know if there's a sync binder transaction happened when being frozen - same as before; and 2) check bit 1 to know if that sync binder transaction happened exactly when there's a race - a new information for rollback decision. the same time, confirmed the pending transactions succeeded. Fixes: 432ff1e91694 ("binder: BINDER_FREEZE ioctl") Acked-by: Todd Kjos Cc: stable Signed-off-by: Li Li Test: stress test with apps being frozen and initiating binder calls at Link: https://lore.kernel.org/r/20210910164210.2282716-2-dualli@chromium.org Signed-off-by: Greg Kroah-Hartman commit 88a3856c0a8c03188db7913f4d49379432fe1f93 Author: jing yangyang Date: Thu Aug 19 20:21:27 2021 -0700 tee/optee/shm_pool: fix application of sizeof to pointer sizeof when applied to a pointer typed expression gives the size of the pointer. ./drivers/tee/optee/shm_pool.c:38:28-34: ERROR application of sizeof to pointer This issue was detected with the help of Coccinelle. Reviewed-by: Daniel Thompson Reported-by: Zeal Robot Signed-off-by: jing yangyang Signed-off-by: Jens Wiklander commit 1a0db7744e453844aa2db3f2959aea4a378025ea Author: Zenghui Yu Date: Sat Sep 11 18:53:06 2021 +0800 scsi: bsg: Fix device unregistration device_initialize() is used to take a refcount on the device. However, put_device() is not called during device teardown. This leads to a leak of private data of the driver core, dev_name(), etc. This is reported by kmemleak at boot time if we compile kernel with DEBUG_TEST_DRIVER_REMOVE. Fix memory leaks during unregistration and implement a release function. Link: https://lore.kernel.org/r/20210911105306.1511-1-yuzenghui@huawei.com Fixes: ead09dd3aed5 ("scsi: bsg: Simplify device registration") Reviewed-by: Johan Hovold Signed-off-by: Zenghui Yu Signed-off-by: Martin K. Petersen commit 4521428c48118b0f5f7a637ce7dedd76c29bcdaa Author: Heiner Kallweit Date: Sat Sep 11 14:11:59 2021 +0200 scsi: sd: Make sd_spinup_disk() less noisy sd_spinup_disk() is a little bit noisy after commit 848ade90ba9c ("scsi: sd: Do not exit sd_spinup_disk() quietly"): scsi 0:0:0:0: Direct-Access Multiple Card Reader 1.00 PQ: 0 ANSI: 0 sd 0:0:0:0: Attached scsi generic sg0 type 0 sd 0:0:0:0: [sda] Media removed, stopped polling sd 0:0:0:0: [sda] Media removed, stopped polling sd 0:0:0:0: [sda] Attached SCSI removable disk sd 0:0:0:0: [sda] Media removed, stopped polling There's not really a benefit in printing the same message multiple times. Therefore print it only if media_present was previously set. Link: https://lore.kernel.org/r/a2d0a249-6035-9697-626a-e14ec50ef6ee@gmail.com Reviewed-by: Bart Van Assche Signed-off-by: Heiner Kallweit Signed-off-by: Martin K. Petersen commit 1cbc9ad3eecd492be33b727b4606ae75bc880676 Author: Adrian Hunter Date: Tue Aug 31 17:53:17 2021 +0300 scsi: ufs: ufs-pci: Fix Intel LKF link stability Intel LKF can experience link errors. Make fixes to increase link stability, especially when switching to high speed modes. Link: https://lore.kernel.org/r/20210831145317.26306-1-adrian.hunter@intel.com Fixes: b2c57925df1f ("scsi: ufs: ufs-pci: Add support for Intel LKF") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit 04c260bdaeede8c703bddc21099e4da96f2909e2 Author: Colin Ian King Date: Thu Sep 2 23:42:15 2021 +0100 scsi: mpt3sas: Clean up some inconsistent indenting There are a couple of statements where the indentation is not correct, clean these up. Remove a redundant break statement. Link: https://lore.kernel.org/r/20210902224215.57286-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 655a68b2203e44912afe462dff9d83d68ac88333 Author: Colin Ian King Date: Thu Sep 2 23:36:43 2021 +0100 scsi: megaraid: Clean up some inconsistent indenting There are a few statements where the indentation is not correct, clean these up. Link: https://lore.kernel.org/r/20210902223643.56979-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit e699a4e1d37314eb842ba9de19a7ccee7f75da10 Author: Colin Ian King Date: Thu Aug 26 12:57:14 2021 +0100 scsi: sr: Fix spelling mistake "does'nt" -> "doesn't" There is a spelling mistake in a literal string. Fix it. Link: https://lore.kernel.org/r/20210826115714.11844-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit fc13fc07490982c89f5d9d8d671ec29a39cddc85 Author: Jens Axboe Date: Fri Sep 3 08:11:39 2021 -0600 scsi: Remove SCSI CDROM MAINTAINERS entry There's little point in keeping this one separately maintained these days, so just remove the entry and it'll fall under the SCSI subsystem where it belongs. Link: https://lore.kernel.org/r/c5e12bd1-10de-634c-d6b3-dac79ed01af5@kernel.dk Signed-off-by: Jens Axboe Signed-off-by: Martin K. Petersen commit 17dfd54d391ea9f8d136fb137962987cb2c6444c Author: jing yangyang Date: Thu Aug 19 20:08:05 2021 -0700 scsi: megaraid: Fix Coccinelle warning WARNING !A || A && B is equivalent to !A || B This issue was detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20210820030805.12383-1-jing.yangyang@zte.com.cn Reported-by: Zeal Robot Acked-by: Sumit Saxena Signed-off-by: jing yangyang Signed-off-by: Martin K. Petersen commit 1f97c29beee774e407839768439b7f51831c3ea1 Author: Helge Deller Date: Tue Sep 7 23:00:44 2021 +0200 scsi: ncr53c8xx: Remove unused retrieve_from_waiting_list() function Drop retrieve_from_waiting_list() to avoid this warning: drivers/scsi/ncr53c8xx.c:8000:26: warning: ‘retrieve_from_waiting_list’ defined but not used [-Wunused-function] Link: https://lore.kernel.org/r/YTfS/LH5vCN6afDW@ls3530 Fixes: 1c22e327545c ("scsi: ncr53c8xx: Remove unused code") Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Helge Deller Signed-off-by: Martin K. Petersen commit 450907424d9ebcc28fab42a065c3cddce49ee97d Author: James Smart Date: Tue Sep 7 09:52:25 2021 -0700 scsi: elx: efct: Do not hold lock while calling fc_vport_terminate() Smatch checker reported the following error: drivers/base/power/sysfs.c:833 dpm_sysfs_remove() warn: sleeping in atomic context With a calling sequence of: efct_lio_npiv_drop_nport() <- disables preempt -> fc_vport_terminate() -> device_del() -> dpm_sysfs_remove() Issue is efct_lio_npiv_drop_nport() is making the fc_vport_terminate() call while holding a lock w/ ipl raised. It is unnecessary to hold the lock over this call, shift where the lock is taken. Link: https://lore.kernel.org/r/20210907165225.10821-1-jsmart2021@gmail.com Reported-by: Dan Carpenter Co-developed-by: Ram Vegesna Signed-off-by: Ram Vegesna Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ef7ae7f746e95c6fa4ec2bcfacb949c36263da78 Author: Maurizio Lombardi Date: Mon Sep 6 17:18:09 2021 +0200 scsi: target: Fix the pgr/alua_support_store functions Commit 356ba2a8bc8d ("scsi: target: tcmu: Make pgr_support and alua_support attributes writable") introduced support for changeable alua_support and pgr_support target attributes. These can only be changed if the backstore is user-backed, otherwise the kernel returns -EINVAL. This triggers a warning in the targetcli/rtslib code when performing a target restore that includes non-userbacked backstores: # targetctl restore Storage Object block/storage1: Cannot set attribute alua_support: [Errno 22] Invalid argument, skipped Storage Object block/storage1: Cannot set attribute pgr_support: [Errno 22] Invalid argument, skipped Fix this warning by returning an error code only if we are really going to flip the PGR/ALUA bit in the transport_flags field, otherwise we will do nothing and return success. Return ENOSYS instead of EINVAL if the pgr/alua attributes can not be changed, this way it will be possible for userspace to understand if the operation failed because an invalid value has been passed to strtobool() or because the attributes are fixed. Fixes: 356ba2a8bc8d ("scsi: target: tcmu: Make pgr_support and alua_support attributes writable") Link: https://lore.kernel.org/r/20210906151809.52811-1-mlombard@redhat.com Reviewed-by: Bodo Stroesser Signed-off-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen commit 7215e909814fed7cda33c954943a4050d8348204 Author: Naohiro Aota Date: Mon Sep 6 23:06:42 2021 +0900 scsi: sd_zbc: Ensure buffer size is aligned to SECTOR_SIZE Reporting zones on a SCSI device sometimes fail with the following error: [76248.516390] ata16.00: invalid transfer count 131328 [76248.523618] sd 15:0:0:0: [sda] REPORT ZONES start lba 536870912 failed The error (from drivers/ata/libata-scsi.c:ata_scsi_zbc_in_xlat()) indicates that buffer size is not aligned to SECTOR_SIZE. This happens when the __vmalloc() failed. Consider we are reporting 4096 zones, then we will have "bufsize = roundup((4096 + 1) * 64, SECTOR_SIZE)" = (513 * 512) = 262656. Then, __vmalloc() failure halves the bufsize to 131328, which is no longer aligned to SECTOR_SIZE. Use rounddown() to ensure the size is always aligned to SECTOR_SIZE and fix the comment as well. Link: https://lore.kernel.org/r/20210906140642.2267569-1-naohiro.aota@wdc.com Fixes: 23a50861adda ("scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer()") Cc: stable@vger.kernel.org # 5.5+ Reviewed-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Himanshu Madhani Signed-off-by: Naohiro Aota Signed-off-by: Martin K. Petersen commit 265dfe8ebbabae7959060bd1c3f75c2473b697ed Author: Ming Lei Date: Mon Sep 6 17:01:12 2021 +0800 scsi: sd: Free scsi_disk device via put_device() After a device is initialized via device_initialize() it should be freed via put_device(). sd_probe() currently gets this wrong, fix it up. Link: https://lore.kernel.org/r/20210906090112.531442-1-ming.lei@redhat.com Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit e4953a93104c1fb1ef7989541f9867cc276467f9 Author: Sreekanth Reddy Date: Wed Sep 1 20:55:42 2021 +0530 scsi: mpt3sas: Call cpu_relax() before calling udelay() Call cpu_relax() while waiting for the current blk-mq polling instance to complete. Link: https://lore.kernel.org/r/20210901152542.27866-1-sreekanth.reddy@broadcom.com Reviewed-by: Bart Van Assche Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 4e28550829258f7dab97383acaa477bd724c0ff4 Author: Baokun Li Date: Wed Sep 1 16:53:36 2021 +0800 scsi: iscsi: Adjust iface sysfs attr detection ISCSI_NET_PARAM_IFACE_ENABLE belongs to enum iscsi_net_param instead of iscsi_iface_param so move it to ISCSI_NET_PARAM. Otherwise, when we call into the driver, we might not match and return that we don't want attr visible in sysfs. Found in code review. Link: https://lore.kernel.org/r/20210901085336.2264295-1-libaokun1@huawei.com Fixes: e746f3451ec7 ("scsi: iscsi: Fix iface sysfs attr detection") Reviewed-by: Lee Duncan Signed-off-by: Baokun Li Signed-off-by: Martin K. Petersen commit 65ef27f7798b57138351d28fd2f61f2afa164400 Author: ChanWoo Lee Date: Wed Sep 1 11:56:17 2021 +0900 scsi: ufs: ufshpb: Remove unused parameters The following parameters are not used in the function. Remove them. *func(): ufshpb_set_hpb_read_to_upiu -> struct ufshpb_lu *hpb -> u32 lpn Link: https://lore.kernel.org/r/20210901025617.31174-1-cw9316.lee@samsung.com Reviewed-by: Daejun Park Reviewed-by: Bart Van Assche Signed-off-by: ChanWoo Lee Signed-off-by: Martin K. Petersen commit 5d1e15108b8d058d537f19cdef4170d2ae4eed08 Author: Chi Minghao Date: Tue Aug 31 04:40:58 2021 -0700 scsi: lpfc: Remove unneeded variable Fix the following coccicheck REVIEW: ./drivers/scsi/lpfc/lpfc_scsi.c:1498:9-12 REVIEW Unneeded variable Link: https://lore.kernel.org/r/20210831114058.17817-1-lv.ruyi@zte.com.cn Reported-by: Zeal Robot Reviewed-by: James Smart Signed-off-by: Chi Minghao Signed-off-by: Martin K. Petersen commit 37e384095f20cca728500fe5344cd308aa6fd7ff Author: James Smart Date: Tue Sep 7 22:09:27 2021 -0700 scsi: lpfc: Fix compilation errors on kernels with no CONFIG_DEBUG_FS The Kernel test robot flagged the following warning: ".../lpfc_init.c:7788:35: error: 'struct lpfc_sli4_hba' has no member named 'c_stat'" Reviewing this issue highlighted that one of the recent patches caused the driver to no longer compile cleanly if CONFIG_DEBUG_FS is not set. Correct the different areas that are failing to compile. Link: https://lore.kernel.org/r/20210908050927.37275-1-jsmart2021@gmail.com Fixes: 02243836ad6f ("scsi: lpfc: Add support for the CM framework") Reviewed-by: Nathan Chancellor Build-tested-by: Nathan Chancellor Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 59936430e6a6acb0ef943e9306506b2e9c2e45a8 Author: James Smart Date: Mon Aug 30 16:12:43 2021 -0700 scsi: lpfc: Fix CPU to/from endian warnings introduced by ELS processing The kernel test robot reported the following sparse warning: ".../lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16" For the error being flagged, using be32_to_cpu() on a be16 data type, it was simple enough. But a review of other elements and warnings were also evaluated. This patch corrected several items in the original patch: - Using be32_to_cpu() on a be16 data type - cpu_to_le32() used on a std uint32_t (CPU) data type. Note: This is a byte array, but stored in LE layout by hardware at 32-bit boundaries. So it possibly needed conversion. - Using cpu_to_le32() on a std uint16_t and assigned to a char typeA - Using le32_to_cpu() on a le16 type - Missing cpu_to_le16() on an assignment Link: https://lore.kernel.org/r/20210830231243.6227-1-jsmart2021@gmail.com Fixes: 9064aeb2df8e ("scsi: lpfc: Add EDC ELS support") 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 96fafe7c6523886308605d30ec92c7936abe7c2c Author: James Smart Date: Mon Aug 30 16:10:50 2021 -0700 scsi: elx: efct: Fix void-pointer-to-enum-cast warning for efc_nport_topology The kernel test robot flagged an warning for ".../efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *'" For the topology events, the "arg" field is generically defined as a void * and is used to pass different arguments. Most of the arguments are pointers to data structures. But for the EFC_EVT_NPORT_TOPOLOGY_NOTIFY event, the argument is an enum value, and the code is typecasting the void * to an enum generating the warning. Fix by converting the EFC_EVT_NPORT_TOPOLOGY_NOTIFY event to pass a pointer to the enum, thus it's a straight-forward pointer dereference in the event handler. Link: https://lore.kernel.org/r/20210830231050.5951-1-jsmart2021@gmail.com Fixes: 202bfdffae27 ("scsi: elx: libefc: FC node ELS and state handling") Reported-by: kernel test robot Co-developed-by: Ram Vegesna Signed-off-by: Ram Vegesna Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6a2ea0d34af1ca807d5ba6a8350a037ff3cd35cc Author: Nathan Chancellor Date: Tue Aug 17 16:55:31 2021 -0700 scsi: st: Add missing break in switch statement in st_ioctl() Clang + -Wimplicit-fallthrough warns: drivers/scsi/st.c:3831:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ drivers/scsi/st.c:3831:2: note: insert 'break;' to avoid fall-through default: ^ break; 1 warning generated. Clang's -Wimplicit-fallthrough is a little bit more pedantic than GCC's, requiring every case block to end in break, return, or fallthrough, rather than allowing implicit fallthroughs to cases that just contain break or return. Add a break so that there is no more warning, as has been done all over the tree already. Link: https://lore.kernel.org/r/20210817235531.172995-1-nathan@kernel.org Fixes: 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()") Reviewed-by: Gustavo A. R. Silva Signed-off-by: Nathan Chancellor Signed-off-by: Martin K. Petersen commit 41d3a6bd1d37149b18331fc4bb789c5456a7aeb0 Author: Jens Axboe Date: Mon Sep 13 13:08:51 2021 -0600 io_uring: pin SQPOLL data before unlocking ring lock We need to re-check sqd->thread after we've dropped the lock. Pin the sqd before doing the lockdep lock dance, and check if the thread is alive after that. It's either NULL or alive, as the SQPOLL thread cannot exit without holding the same sqd->lock. Reported-and-tested-by: syzbot+337de45f13a4fd54d708@syzkaller.appspotmail.com Fixes: fa84693b3c89 ("io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL") Signed-off-by: Jens Axboe commit 43d2b88c29f2d120b4dc22f27b3483eb14bd9815 Author: Daniel Borkmann Date: Tue Sep 14 01:07:59 2021 +0200 bpf, selftests: Add test case for mixed cgroup v1/v2 Minimal selftest which implements a small BPF policy program to the connect(2) hook which rejects TCP connection requests to port 60123 with EPERM. This is being attached to a non-root cgroup v2 path. The test asserts that this works under cgroup v2-only and under a mixed cgroup v1/v2 environment where net_classid is set in the former case. Before fix: # ./test_progs -t cgroup_v1v2 test_cgroup_v1v2:PASS:server_fd 0 nsec test_cgroup_v1v2:PASS:client_fd 0 nsec test_cgroup_v1v2:PASS:cgroup_fd 0 nsec test_cgroup_v1v2:PASS:server_fd 0 nsec run_test:PASS:skel_open 0 nsec run_test:PASS:prog_attach 0 nsec test_cgroup_v1v2:PASS:cgroup-v2-only 0 nsec run_test:PASS:skel_open 0 nsec run_test:PASS:prog_attach 0 nsec run_test:PASS:join_classid 0 nsec (network_helpers.c:219: errno: None) Unexpected success to connect to server test_cgroup_v1v2:FAIL:cgroup-v1v2 unexpected error: -1 (errno 0) #27 cgroup_v1v2:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED After fix: # ./test_progs -t cgroup_v1v2 #27 cgroup_v1v2:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210913230759.2313-3-daniel@iogearbox.net commit d8079d8026f82e4435445297d1b77bba1c4c7960 Author: Daniel Borkmann Date: Tue Sep 14 01:07:58 2021 +0200 bpf, selftests: Add cgroup v1 net_cls classid helpers Minimal set of helpers for net_cls classid cgroupv1 management in order to set an id, join from a process, initiate setup and teardown. cgroupv2 helpers are left as-is, but reused where possible. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210913230759.2313-2-daniel@iogearbox.net commit 8520e224f547cd070c7c8f97b1fc6d58cff7ccaa Author: Daniel Borkmann Date: Tue Sep 14 01:07:57 2021 +0200 bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode Fix cgroup v1 interference when non-root cgroup v2 BPF programs are used. Back in the days, commit bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") embedded per-socket cgroup information into sock->sk_cgrp_data and in order to save 8 bytes in struct sock made both mutually exclusive, that is, when cgroup v1 socket tagging (e.g. net_cls/net_prio) is used, then cgroup v2 falls back to the root cgroup in sock_cgroup_ptr() (&cgrp_dfl_root.cgrp). The assumption made was "there is no reason to mix the two and this is in line with how legacy and v2 compatibility is handled" as stated in bd1060a1d671. However, with Kubernetes more widely supporting cgroups v2 as well nowadays, this assumption no longer holds, and the possibility of the v1/v2 mixed mode with the v2 root fallback being hit becomes a real security issue. Many of the cgroup v2 BPF programs are also used for policy enforcement, just to pick _one_ example, that is, to programmatically deny socket related system calls like connect(2) or bind(2). A v2 root fallback would implicitly cause a policy bypass for the affected Pods. In production environments, we have recently seen this case due to various circumstances: i) a different 3rd party agent and/or ii) a container runtime such as [0] in the user's environment configuring legacy cgroup v1 net_cls tags, which triggered implicitly mentioned root fallback. Another case is Kubernetes projects like kind [1] which create Kubernetes nodes in a container and also add cgroup namespaces to the mix, meaning programs which are attached to the cgroup v2 root of the cgroup namespace get attached to a non-root cgroup v2 path from init namespace point of view. And the latter's root is out of reach for agents on a kind Kubernetes node to configure. Meaning, any entity on the node setting cgroup v1 net_cls tag will trigger the bypass despite cgroup v2 BPF programs attached to the namespace root. Generally, this mutual exclusiveness does not hold anymore in today's user environments and makes cgroup v2 usage from BPF side fragile and unreliable. This fix adds proper struct cgroup pointer for the cgroup v2 case to struct sock_cgroup_data in order to address these issues; this implicitly also fixes the tradeoffs being made back then with regards to races and refcount leaks as stated in bd1060a1d671, and removes the fallback, so that cgroup v2 BPF programs always operate as expected. [0] https://github.com/nestybox/sysbox/ [1] https://kind.sigs.k8s.io/ Fixes: bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Stanislav Fomichev Acked-by: Tejun Heo Link: https://lore.kernel.org/bpf/20210913230759.2313-1-daniel@iogearbox.net commit 4c51de1e8f928a5b05248714d832d7d991ac319a Author: Steve French Date: Mon Sep 13 18:29:46 2021 -0500 cifs: fix incorrect kernel doc comments Correct kernel-doc comments pointed out by the automated kernel test robot. Reported-by: kernel test robot Signed-off-by: Steve French commit 0e6491b559704da720f6da09dd0a52c4df44c514 Author: Bixuan Cui Date: Sat Sep 11 08:55:57 2021 +0800 bpf: Add oversize check before call kvcalloc() Commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") add the oversize check. When the allocation is larger than what kmalloc() supports, the following warning triggered: WARNING: CPU: 0 PID: 8408 at mm/util.c:597 kvmalloc_node+0x108/0x110 mm/util.c:597 Modules linked in: CPU: 0 PID: 8408 Comm: syz-executor221 Not tainted 5.14.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:kvmalloc_node+0x108/0x110 mm/util.c:597 Call Trace: kvmalloc include/linux/mm.h:806 [inline] kvmalloc_array include/linux/mm.h:824 [inline] kvcalloc include/linux/mm.h:829 [inline] check_btf_line kernel/bpf/verifier.c:9925 [inline] check_btf_info kernel/bpf/verifier.c:10049 [inline] bpf_check+0xd634/0x150d0 kernel/bpf/verifier.c:13759 bpf_prog_load kernel/bpf/syscall.c:2301 [inline] __sys_bpf+0x11181/0x126e0 kernel/bpf/syscall.c:4587 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline] __se_sys_bpf kernel/bpf/syscall.c:4689 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4689 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+0x44/0xae Reported-by: syzbot+f3e749d4c662818ae439@syzkaller.appspotmail.com Signed-off-by: Bixuan Cui Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210911005557.45518-1-cuibixuan@huawei.com commit 69e73dbfda14fbfe748d3812da1244cce2928dcb Author: Andrea Claudi Date: Fri Sep 10 18:08:39 2021 +0200 ipvs: check that ip_vs_conn_tab_bits is between 8 and 20 ip_vs_conn_tab_bits may be provided by the user through the conn_tab_bits module parameter. If this value is greater than 31, or less than 0, the shift operator used to derive tab_size causes undefined behaviour. Fix this checking ip_vs_conn_tab_bits value to be in the range specified in ipvs Kconfig. If not, simply use default value. Fixes: 6f7edb4881bf ("IPVS: Allow boot time change of hash size") Reported-by: Yi Chen Signed-off-by: Andrea Claudi Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit d0ee23f9d78be5531c4b055ea424ed0b489dfe9b Author: Nathan Chancellor Date: Mon Sep 13 15:09:00 2021 -0700 tools: compiler-gcc.h: Guard error attribute use with __has_attribute When building objtool with HOSTCC=clang, there are several errors along the lines of orc_dump.c:201:28: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes] This occurs after commit 4e59869aa655 ("compiler-gcc.h: drop checks for older GCC versions"), which removed the GCC_VERSION gating. The removed version check just so happened to prevent __compiletime_error() from being defined with clang because it pretends to be GCC 4.2.1 for compatibility but the error attribute was not added to clang until 14.0.0. Commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") and commit a3f8a30f3f00 ("Compiler Attributes: use feature checks instead of version checks") refactored the handling of attributes in the main kernel to avoid situations like this but that refactoring has never been done for the tools directory. Refactoring is a rather large undertaking and this has never been an issue before so instead, just guard the definition of __compiletime_error() with __has_attribute() so that there are no more errors. Fixes: 4e59869aa655 ("compiler-gcc.h: drop checks for older GCC versions") Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 7bbc3d385bd813077acaf0e6fdb2a86a901f5382 Author: Jozsef Kadlecsik Date: Mon Sep 6 18:26:34 2021 +0200 netfilter: ipset: Fix oversized kvmalloc() calls The commit commit 7661809d493b426e979f39ab512e3adf41fbcc69 Author: Linus Torvalds Date: Wed Jul 14 09:45:49 2021 -0700 mm: don't allow oversized kvmalloc() calls limits the max allocatable memory via kvmalloc() to MAX_INT. Apply the same limit in ipset. Reported-by: syzbot+3493b1873fb3ea827986@syzkaller.appspotmail.com Reported-by: syzbot+2b8443c35458a617c904@syzkaller.appspotmail.com Reported-by: syzbot+ee5cb15f4a0e85e0d54e@syzkaller.appspotmail.com Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit 099dd788e31b4f426ef49c2785069804925a84e1 Author: Steve French Date: Mon Sep 13 14:51:10 2021 -0500 cifs: remove pathname for file from SPDX header checkpatch complains about source files with filenames (e.g. in these cases just below the SPDX header in comments at the top of various files in fs/cifs). It also is helpful to change this now so will be less confusing when the parent directory is renamed e.g. from fs/cifs to fs/smb_client (or fs/smbfs) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 3110b942d36b961858664486d72f815d78c956c3 Author: Jason Gunthorpe Date: Mon Sep 13 16:25:56 2021 -0300 IB/qib: Fix clang confusion of NULL pointer comparison clang becomes confused due to the comparison to NULL in a integer constant expression context: >> drivers/infiniband/hw/qib/qib_sysfs.c:413:1: error: static_assert expression is not an integral constant expression QIB_DIAGC_ATTR(rc_resends); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/qib/qib_sysfs.c:406:16: note: expanded from macro 'QIB_DIAGC_ATTR' static_assert(&((struct qib_ibport *)0)->rvp.n_##N != (u64 *)NULL); \ Nathan found __same_type that solves this problem nicely, so use it instead. Reported-by: kernel test robot Suggested-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Jason Gunthorpe commit c0002d11d79900f8aa5c8375336434940d6afedf Author: ArthurChiao Date: Wed Sep 8 16:08:15 2021 +0800 cgroupv2, docs: fix misinformation in "device controller" section Hotmail was rejected by the mailing list, switched to gmail to resend. 1. Clarify cgroup BPF program type and attach type; 2. Fix file path broken. Signed-off-by: ArthurChiao Signed-off-by: Tejun Heo commit b94f9ac79a7395c2d6171cc753cc27942df0be73 Author: Waiman Long Date: Thu Sep 9 22:42:56 2021 -0400 cgroup/cpuset: Change references of cpuset_mutex to cpuset_rwsem Since commit 1243dc518c9d ("cgroup/cpuset: Convert cpuset_mutex to percpu_rwsem"), cpuset_mutex has been replaced by cpuset_rwsem which is a percpu rwsem. However, the comments in kernel/cgroup/cpuset.c still reference cpuset_mutex which are now incorrect. Change all the references of cpuset_mutex to cpuset_rwsem. Fixes: 1243dc518c9d ("cgroup/cpuset: Convert cpuset_mutex to percpu_rwsem") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 22b1255792c033781dbe42b63e28501d38032b7e Author: Chunguang Xu Date: Mon Sep 13 13:09:14 2021 +0800 docs/cgroup: remove some duplicate words When I tried to add some new entries to cgroup-v2.rst, I found that the description of memory.events had some repetitive words, so I tried to delete them. Signed-off-by: Chunguang Xu Signed-off-by: Tejun Heo commit 80f0a1f99983296be587325004acf72dd11eccd8 Author: Rolf Eike Beer Date: Mon Sep 13 12:02:56 2021 +0200 workqueue: annotate alloc_workqueue() as printf This also enables checking of allows alloc_ordered_workqueue(). Signed-off-by: Rolf Eike Beer Signed-off-by: Tejun Heo commit 316346243be6df12799c0b64b788e06bad97c30b Merge: a69ae291e1cc2 df26327ea097e Author: Linus Torvalds Date: Mon Sep 13 10:43:04 2021 -0700 Merge branch 'gcc-min-version-5.1' (make gcc-5.1 the minimum version) Merge patch series from Nick Desaulniers to update the minimum gcc version to 5.1. This is some of the left-overs from the merge window that I didn't want to deal with yesterday, so it comes in after -rc1 but was sent before. Gcc-4.9 support has been an annoyance for some time, and with -Werror I had the choice of applying a fairly big patch from Kees Cook to remove a fair number of initializer warnings (still leaving some), or this patch series from Nick that just removes the source of the problem. The initializer cleanups might still be worth it regardless, but honestly, I preferred just tackling the problem with gcc-4.9 head-on. We've been more aggressiuve about no longer having to care about compilers that were released a long time ago, and I think it's been a good thing. I added a couple of patches on top to sort out a few left-overs now that we no longer support gcc-4.x. As noted by Arnd, as a result of this minimum compiler version upgrade we can probably change our use of '--std=gnu89' to '--std=gnu11', and finally start using local loop declarations etc. But this series does _not_ yet do that. Link: https://lore.kernel.org/all/20210909182525.372ee687@canb.auug.org.au/ Link: https://lore.kernel.org/lkml/CAK7LNASs6dvU6D3jL2GG3jW58fXfaj6VNOe55NJnTB8UPuk2pA@mail.gmail.com/ Link: https://github.com/ClangBuiltLinux/linux/issues/1438 * emailed patches from Nick Desaulniers : Drop some straggling mentions of gcc-4.9 as being stale compiler_attributes.h: drop __has_attribute() support for gcc4 vmlinux.lds.h: remove old check for GCC 4.9 compiler-gcc.h: drop checks for older GCC versions Makefile: drop GCC < 5 -fno-var-tracking-assignments workaround arm64: remove GCC version check for ARCH_SUPPORTS_INT128 powerpc: remove GCC version check for UPD_CONSTR riscv: remove Kconfig check for GCC version for ARCH_RV64I Kconfig.debug: drop GCC 5+ version check for DWARF5 mm/ksm: remove old GCC 4.9+ check compiler.h: drop fallback overflow checkers Documentation: raise minimum supported version of GCC to 5.1 commit a48c730a4e0bf480bcde12d795a9cd6f9ef14d1e Author: Douglas Anderson Date: Tue Sep 7 12:12:25 2021 -0700 Revert "arm64: dts: qcom: sc7280: Fixup the cpufreq node" This reverts commit 11e03d692101e484df9322f892a8b6e111a82bfd. As per discussion [1] the patch shouldn't have landed. Let's revert. [1] https://lore.kernel.org/r/fde7bac239f796b039b9be58b391fb77@codeaurora.org/ Fixes: 11e03d692101 ("arm64: dts: qcom: sc7280: Fixup the cpufreq node") Reported-by: Matthias Kaehlcke Cc: Sibi Sankar Cc: Matthias Kaehlcke Cc: Stephen Boyd Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210907121220.1.I08460f490473b70de0d768db45f030a4d5c17828@changeid commit df26327ea097eb78e7967c45df6b23010c43c28d Author: Linus Torvalds Date: Mon Sep 13 10:29:44 2021 -0700 Drop some straggling mentions of gcc-4.9 as being stale Fix up the admin-guide README file to the new gcc-5.1 requirement, and remove a stale comment about gcc support for the __assume_aligned__ attribute. Signed-off-by: Linus Torvalds commit d9a7e9df731670acdc69e81748941ad338f47fab Author: Doug Smythies Date: Sun Sep 12 11:50:29 2021 -0700 cpufreq: intel_pstate: Override parameters if HWP forced by BIOS If HWP has been already been enabled by BIOS, it may be necessary to override some kernel command line parameters. Once it has been enabled it requires a reset to be disabled. Suggested-by: Rafael J. Wysocki Signed-off-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit 6d2ef226f2f18d530e48ead0cb5704505628b797 Author: Linus Torvalds Date: Mon Sep 13 10:20:01 2021 -0700 compiler_attributes.h: drop __has_attribute() support for gcc4 Now that GCC 5.1 is the minimally supported default, the manual workaround for older gcc versions not having __has_attribute() are no longer relevant and can be removed. Signed-off-by: Linus Torvalds commit 6f20fa2dfa549401860479328371f0d5cee9b114 Author: Nick Desaulniers Date: Fri Sep 10 16:40:47 2021 -0700 vmlinux.lds.h: remove old check for GCC 4.9 Now that GCC 5.1 is the minimally supported version of GCC, we can effectively revert commit 85c2ce9104eb ("sched, vmlinux.lds: Increase STRUCT_ALIGNMENT to 64 bytes for GCC-4.9") Cc: Peter Zijlstra Signed-off-by: Nick Desaulniers Acked-by: Kees Cook Signed-off-by: Linus Torvalds commit 4e59869aa6550657cb148ad49835605660ec9b88 Author: Nick Desaulniers Date: Fri Sep 10 16:40:46 2021 -0700 compiler-gcc.h: drop checks for older GCC versions Now that GCC 5.1 is the minimally supported default, drop the values we don't use. Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 156102fe0bb669f40f2fd27856b21f9fa8157090 Author: Nick Desaulniers Date: Fri Sep 10 16:40:45 2021 -0700 Makefile: drop GCC < 5 -fno-var-tracking-assignments workaround Now that GCC 5.1 is the minimally supported version, we can drop this workaround for older versions of GCC. Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 42a7ba1695fcd534216aa3712a6cf42da3340527 Author: Nick Desaulniers Date: Fri Sep 10 16:40:44 2021 -0700 arm64: remove GCC version check for ARCH_SUPPORTS_INT128 Now that GCC 5.1 is the minimally supported compiler version, this Kconfig check is no longer necessary. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 6563139d90ad6178a990d051c7980f0998b5d2e8 Author: Nick Desaulniers Date: Fri Sep 10 16:40:43 2021 -0700 powerpc: remove GCC version check for UPD_CONSTR Now that GCC 5.1 is the minimum supported version, we can drop this workaround for older versions of GCC. This adversely affected clang, too. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Segher Boessenkool Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nick Desaulniers Signed-off-by: Linus Torvalds commit d20758951f8f28c0ee1b2a8a6bb8189858083895 Author: Nick Desaulniers Date: Fri Sep 10 16:40:42 2021 -0700 riscv: remove Kconfig check for GCC version for ARCH_RV64I The minimum supported version of GCC is now 5.1. The check wasn't correct as written anyways since GCC_VERSION is 0 when CC=clang. Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit c0a5c81ca9bedaf38356a6290bf895313fd7361c Author: Nick Desaulniers Date: Fri Sep 10 16:40:41 2021 -0700 Kconfig.debug: drop GCC 5+ version check for DWARF5 Now that the minimum supported version of GCC is 5.1, we no longer need this Kconfig version check for CONFIG_DEBUG_INFO_DWARF5. Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit adac17e3f61f54927b961d97bd303dd5795a307b Author: Nick Desaulniers Date: Fri Sep 10 16:40:40 2021 -0700 mm/ksm: remove old GCC 4.9+ check The minimum supported version of GCC has been raised to GCC 5.1. Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 4eb6bd55cfb22ffc20652732340c4962f3ac9a91 Author: Nick Desaulniers Date: Fri Sep 10 16:40:39 2021 -0700 compiler.h: drop fallback overflow checkers Once upgrading the minimum supported version of GCC to 5.1, we can drop the fallback code for !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is effectively a revert of commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") Link: https://github.com/ClangBuiltLinux/linux/issues/1438#issuecomment-916745801 Suggested-by: Rasmus Villemoes Signed-off-by: Nick Desaulniers Acked-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 76ae847497bc5207c479de5e2ac487270008b19b Author: Nick Desaulniers Date: Fri Sep 10 16:40:38 2021 -0700 Documentation: raise minimum supported version of GCC to 5.1 commit fad7cd3310db ("nbd: add the check to prevent overflow in __nbd_ioctl()") raised an issue from the fallback helpers added in commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") Specifically, the helpers for checking whether the results of a multiplication overflowed (__unsigned_mul_overflow, __signed_add_overflow) use the division operator when !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is problematic for 64b operands on 32b hosts. Also, because the macro is type agnostic, it is very difficult to write a similarly type generic macro that dispatches to one of: * div64_s64 * div64_u64 * div_s64 * div_u64 Raising the minimum supported versions allows us to remove all of the fallback helpers for !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW, instead dispatching the compiler builtins. arm64 has already raised the minimum supported GCC version to 5.1, do this for all targets now. See the link below for the previous discussion. Link: https://lore.kernel.org/all/20210909182525.372ee687@canb.auug.org.au/ Link: https://lore.kernel.org/lkml/CAK7LNASs6dvU6D3jL2GG3jW58fXfaj6VNOe55NJnTB8UPuk2pA@mail.gmail.com/ Link: https://github.com/ClangBuiltLinux/linux/issues/1438 Reported-by: Stephen Rothwell Reported-by: Nathan Chancellor Suggested-by: Rasmus Villemoes Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit a69ae291e1cc2d08ae77c2029579c59c9bde5061 Author: Will Deacon Date: Mon Sep 13 17:35:47 2021 +0100 x86/uaccess: Fix 32-bit __get_user_asm_u64() when CC_HAS_ASM_GOTO_OUTPUT=y Commit 865c50e1d279 ("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT") added an optimised version of __get_user_asm() for x86 using 'asm goto'. Like the non-optimised code, the 32-bit implementation of 64-bit get_user() expands to a pair of 32-bit accesses. Unlike the non-optimised code, the _original_ pointer is incremented to copy the high word instead of loading through a new pointer explicitly constructed to point at a 32-bit type. Consequently, if the pointer points at a 64-bit type then we end up loading the wrong data for the upper 32-bits. This was observed as a mount() failure in Android targeting i686 after b0cfcdd9b967 ("d_path: make 'prepend()' fill up the buffer exactly on overflow") because the call to copy_from_kernel_nofault() from prepend_copy() ends up in __get_kernel_nofault() and casts the source pointer to a 'u64 __user *'. An attempt to mount at "/debug_ramdisk" therefore ends up failing trying to mount "/debumdismdisk". Use the existing '__gu_ptr' source pointer to unsigned int for 32-bit __get_user_asm_u64() instead of the original pointer. Cc: Bill Wendling Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Peter Zijlstra Reported-by: Greg Kroah-Hartman Fixes: 865c50e1d279 ("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT") Signed-off-by: Will Deacon Reviewed-by: Nick Desaulniers Tested-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit 8e69212253d320d4768071086b1111e6ab91d9bd Author: Kari Argillander Date: Thu Sep 2 18:40:50 2021 +0300 fs/ntfs3: Always use binary search with entry search We do not have any reason to keep old linear search in. Before this was used for error path or if table was so big that it cannot be allocated. Current binary search implementation won't need error path. Remove old references to linear entry search. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit ef9297007e9904588682699e618c56401f61d1c2 Author: Kari Argillander Date: Thu Sep 2 18:40:49 2021 +0300 fs/ntfs3: Make binary search to search smaller chunks in beginning We could try to optimize algorithm to first fill just small table and after that use bigger table all the way up to ARRAY_SIZE(offs). This way we can use bigger search array, but not lose benefits with entry count smaller < ARRAY_SIZE(offs). Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 162333efa8dc4984d2ca0a2eb85528e13366f271 Author: Kari Argillander Date: Thu Sep 2 18:40:48 2021 +0300 fs/ntfs3: Limit binary search table size Current binary search allocates memory for table and fill whole table before we start actual binary search. This is quite inefficient because table fill will always be O(n). Also if table is huge we need to reallocate memory which is costly. This implementation use just stack memory and always when table is full we will check if last element is <= and if not start table fill again. The idea was that it would be same cost as table reallocation. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 9c2aadd0fdf88a7ebeebd1e97a9c66b07ad3e14a Author: Kari Argillander Date: Thu Sep 2 19:15:28 2021 +0300 fs/ntfs3: Remove unneeded header files from c files We have lot of unnecessary headers in these files. Remove them so that we help compiler a little bit. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 977d0558e310113767feed91fdcc618691dd2835 Author: Kari Argillander Date: Thu Sep 2 19:15:27 2021 +0300 fs/ntfs3: Change right headers to lznt.c There is lot of headers which we do not need in this file. Delete them and add what we really need. Here is list which identify why we need this header. // min() // kzalloc() // offsetof() // memcpy(), memset() // u8, size_t, etc. "debug.h" // PtrOffset() Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit f97676611937f4550a60970acadeccbd5e6f124c Author: Kari Argillander Date: Thu Sep 2 19:15:26 2021 +0300 fs/ntfs3: Change right headers to upcase.c There is no headers. They will be included through ntfs_fs.c, but that is not right thing to do. Let's include headers what this file need straight away. types.h is needed for __le16, u8 etc. kernel.h is needed for le16_to_cpu() Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit c632f639d1d9bb3e379741a30c6882342d859daf Author: Kari Argillander Date: Thu Sep 2 19:15:25 2021 +0300 fs/ntfs3: Change right headers to bitfunc.c We only need linux/types.h for types like u8 etc. So we can remove rest and help compiler a little bit. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit b6ba81034b1b74cf426abcece4becda2611504a4 Author: Kari Argillander Date: Thu Sep 2 19:15:24 2021 +0300 fs/ntfs3: Add missing header and guards to lib/ headers size_t needs header. Add missing header guards so that compiler will only include these ones. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit f239b3a95dd4f7daba26ea17f339a5b19a7d40a1 Author: Kari Argillander Date: Thu Sep 2 19:15:23 2021 +0300 fs/ntfs3: Add missing headers and forward declarations to ntfs_fs.h We do not have headers at all in this file. We should have them so that not every .c file needs to include all of the stuff which this file need for building. This way we can remove some headers from other files and get better picture what is needed. This can save some compilation time. And this can help if we sometimes want to separate this one big header. Also use forward declarations for structs and enums when it not included straight with include and it is used in function declarations input. This will prevent possible compiler warning: xxx declared inside parameter list will not be visible outside of this definition or declaration Here is list which I made when parsing this. There is not necessarily all example from this header file, but this just proofs we need it. SECTOR_SHIFT sb_bread(), put_bh put_page() struct inode (Just struct ntfs_inode need it) kunmap(), kmap() cpu_to_leXX() ALIGN kvfree() struct mutex, mutex_(un/try)lock() PageError() read_mapping_page() struct rb_root struct rw_semaphore krfree(), kzalloc() memset() struct timespec64 uXX, __leXX kuid_t, kgid_t do_div() PAGE_SIZE "debug.h" ntfs_err() (Just one entry. Maybe we can drop this) "ntfs.h" Do you even ask? Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 4dfe83320e1e9665b986840b426742ea764e08d7 Author: Kari Argillander Date: Thu Sep 2 19:15:22 2021 +0300 fs/ntfs3: Add missing header files to ntfs.h We do not have header files at all in this file. Add following headers and there is also explanation which for it was added. Note that explanation might not be complete, but it just proofs it is needed. // SECTOR_SHIFT // static_assert() // cpu_to_le64, cpu_to_le32, ALIGN // offsetof() // memcmp() //__le32, __le16 "debug.h" // PtrOffset(), Add2Ptr() Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit cde81f13ef63d47c3f0742fbe6f17a5123cf6ca4 Author: Kari Argillander Date: Thu Sep 2 19:15:21 2021 +0300 fs/ntfs3. Add forward declarations for structs to debug.h Add forward declarations for structs so that we can include this file without warnings even without linux/fs.h Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 0327c6d01a97a3242cf10717819994aa6e095a1d Author: Colin Ian King Date: Fri Sep 3 14:24:58 2021 +0100 fs/ntfs3: Remove redundant initialization of variable err The variable err is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit dd47c104533dedb90434a3f142e94a671ac623a6 Author: Eugene Syromiatnikov Date: Mon Sep 13 17:44:15 2021 +0200 io-wq: provide IO_WQ_* constants for IORING_REGISTER_IOWQ_MAX_WORKERS arg items The items passed in the array pointed by the arg parameter of IORING_REGISTER_IOWQ_MAX_WORKERS io_uring_register operation carry certain semantics: they refer to different io-wq worker categories; provide IO_WQ_* constants in the UAPI, so these categories can be referenced in the user space code. Suggested-by: Jens Axboe Complements: 2e480058ddc21ec5 ("io-wq: provide a way to limit max number of workers") Signed-off-by: Eugene Syromiatnikov Link: https://lore.kernel.org/r/20210913154415.GA12890@asgard.redhat.com Signed-off-by: Jens Axboe commit 510e1a724ab1bf38150be2c1acabb303f98d0047 Author: Hamza Mahfooz Date: Fri Sep 10 19:53:37 2021 -0400 dma-debug: prevent an error message from causing runtime problems For some drivers, that use the DMA API. This error message can be reached several millions of times per second, causing spam to the kernel's printk buffer and bringing the CPU usage up to 100% (so, it should be rate limited). However, since there is at least one driver that is in the mainline and suffers from the error condition, it is more useful to err_printk() here instead of just rate limiting the error message (in hopes that it will make it easier for other drivers that suffer from this issue to be spotted). Link: https://lkml.kernel.org/r/fd67fbac-64bf-f0ea-01e1-5938ccfab9d0@arm.com Reported-by: Jeremy Linton Signed-off-by: Hamza Mahfooz Signed-off-by: Christoph Hellwig commit f1db21c315f4b4f8c3fbea56aac500673132d317 Author: Marijn Suijten Date: Sun Aug 29 22:30:25 2021 +0200 ARM: dts: qcom: apq8064: Use 27MHz PXO clock as DSI PLL reference The 28NM DSI PLL driver for msm8960 calculates with a 27MHz reference clock and should hence use PXO, not CXO which runs at 19.2MHz. Note that none of the DSI PHY/PLL drivers currently use this "ref" clock; they all rely on (sometimes inexistant) global clock names and usually function normally without a parent clock. This discrepancy will be corrected in a future patch, for which this change needs to be in place first. Fixes: 6969d1d9c615 ("ARM: dts: qcom-apq8064: Set 'cxo_board' as ref clock of the DSI PHY") Reviewed-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20210829203027.276143-2-marijn.suijten@somainline.org Signed-off-by: Bjorn Andersson commit f5c03f131dae3f06d08464e6157dd461200f78d9 Author: David Heidelberg Date: Wed Aug 18 08:53:17 2021 +0200 ARM: dts: qcom: apq8064: use compatible which contains chipid Also resolves these kernel warnings for APQ8064: adreno 4300000.adreno-3xx: Using legacy qcom,chipid binding! adreno 4300000.adreno-3xx: Use compatible qcom,adreno-320.2 instead. Tested on Nexus 7 2013, no functional changes. Cc: Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210818065317.19822-1-david@ixit.cz Signed-off-by: Bjorn Andersson commit 9c5a4ec69bbf5951f84ada9e0db9c6c50de61808 Author: Antonio Martorana Date: Mon Aug 16 17:24:39 2021 -0700 soc: qcom: socinfo: Fixed argument passed to platform_set_data() Set qcom_socinfo pointer as data being stored instead of pointer to soc_device structure. Aligns with future calls to platform_get_data() which expects qcom_socinfo pointer. Fixes: efb448d0a3fc ("soc: qcom: Add socinfo driver") Signed-off-by: Antonio Martorana Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1629159879-95777-1-git-send-email-amartora@codeaurora.org Signed-off-by: Bjorn Andersson commit 9edceaf43050f5ba1dd7d0011bcf68a736a17743 Author: Daniel Wagner Date: Thu Sep 2 11:20:02 2021 +0200 nvme: avoid race in shutdown namespace removal When we remove the siblings entry, we update ns->head->list, hence we can't separate the removal and test for being empty. They have to be in the same critical section to avoid a race. To avoid breaking the refcounting imbalance again, add a list empty check to nvme_find_ns_head. Fixes: 5396fdac56d8 ("nvme: fix refcounting imbalance when all paths are down") Signed-off-by: Daniel Wagner Reviewed-by: Hannes Reinecke Tested-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 0bd46e22c5ec3dbfb81b60de475151e3f6b411c2 Author: Dan Carpenter Date: Thu Sep 9 12:14:40 2021 +0300 nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show() This was intended to limit the number of characters printed from "subsys->serial" to NVMET_SN_MAX_SIZE. But accidentally the width specifier was used instead of the precision specifier so it only affects the alignment and not the number of characters printed. Fixes: f04064814c2a ("nvmet: fixup buffer overrun in nvmet_subsys_attr_serial()") Signed-off-by: Dan Carpenter Signed-off-by: Christoph Hellwig commit d168cd797982db9db617113644c87b8f5f3cf27e Author: Zhi A Wang Date: Thu Aug 26 14:38:34 2021 +0000 drm/i915/gvt: fix the usage of ww lock in gvt scheduler. As the APIs related to ww lock in i915 was changed recently, the usage of ww lock in GVT-g scheduler needs to be changed accrodingly. We noticed a deadlock when GVT-g scheduler submits the workload to i915. After some investigation, it seems the way of how to use ww lock APIs has been changed. Releasing a ww now requires a explicit i915_gem_ww_ctx_fini(). Fixes: 67f1120381df ("drm/i915/gvt: Introduce per object locking in GVT scheduler.") Cc: Zhenyu Wang Signed-off-by: Zhi A Wang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20210826143834.25410-1-zhi.a.wang@intel.com Acked-by: Zhenyu Wang commit 8c0922ce4b9b0d542dcea871e54eb619661378d9 Merge: 111b64e35ea03 427900d27d86b Author: David S. Miller Date: Mon Sep 13 14:25:37 2021 +0100 Merge branch 'hns3-fixes' 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 427900d27d86b820c559037a984bd403f910860f Author: Jiaran Zhang Date: Mon Sep 13 21:08:25 2021 +0800 net: hns3: fix the timing issue of VF clearing interrupt sources Currently, the VF does not clear the interrupt source immediately after receiving the interrupt. As a result, if the second interrupt task is triggered when processing the first interrupt task, clearing the interrupt source before exiting will clear the interrupt sources of the two tasks at the same time. As a result, no interrupt is triggered for the second task. The VF detects the missed message only when the next interrupt is generated. Clearing it immediately after executing check_evt_cause ensures that: 1. Even if two interrupt tasks are triggered at the same time, they can be processed. 2. If the second task is triggered during the processing of the first task and the interrupt source is not cleared, the interrupt is reported after vector0 is enabled. Fixes: b90fcc5bd904 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset") Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 472430a7b066f19afa1b55867d621b2d6d323e0d Author: Jiaran Zhang Date: Mon Sep 13 21:08:24 2021 +0800 net: hns3: fix the exception when query imp info When the command for querying imp info is issued to the firmware, if the firmware does not support the command, the returned value of bd num is 0. Add protection mechanism before alloc memory to prevent apply for 0-length memory. Fixes: 0b198b0d80ea ("net: hns3: refactor dump m7 info of debugfs") Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit b81d8948746520f989e86d66292ff72b5056114a Author: Yufeng Mo Date: Mon Sep 13 21:08:23 2021 +0800 net: hns3: disable mac in flr process The firmware will not disable mac in flr process. Therefore, the driver needs to proactively disable mac during flr, which is the same as the function reset. Fixes: 35d93a30040c ("net: hns3: adjust the process of PF reset") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 1dc839ec09d3ab2a4156dc98328b8bc3586f2b70 Author: Yufeng Mo Date: Mon Sep 13 21:08:22 2021 +0800 net: hns3: change affinity_mask to numa node range Currently, affinity_mask is set to a single cpu. As a result, irqbalance becomes invalid in SUBSET or EXACT mode. To solve this problem, change affinity_mask to numa node range. In this way, irqbalance can be performed on the cpu of the numa node. Fixes: 0812545487ec ("net: hns3: add interrupt affinity support for misc interrupt") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d18e81183b1cb9c309266cbbce9acd3e0c528d04 Author: Yufeng Mo Date: Mon Sep 13 21:08:21 2021 +0800 net: hns3: pad the short tunnel frame before sending to hardware The hardware cannot handle short tunnel frames below 65 bytes, and will cause vlan tag missing problem. So pads packet size to 65 bytes for tunnel frames to fix this bug. Fixes: 3db084d28dc0("net: hns3: Fix for vxlan tx checksum bug") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit f7ec554b73c5239a96afb9a9c3eb18cb11f539b7 Author: Yunsheng Lin Date: Mon Sep 13 21:08:20 2021 +0800 net: hns3: add option to turn off page pool feature When page pool is added to the hns3 driver, it is always enabled unconditionally, which means spilt page handling in the hns3 driver is dead code. As there is a requirement to test the performance between spilt page handling in driver and page pool, so add a module param to support disabling the page pool. When the page pool is proved to perform better in most case, the spilt page handling in driver can be removed. Fixes: 93188e9642c3 ("net: hns3: support skb's frag page recycling based on page pool") Signed-off-by: Yunsheng Lin Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7b9cf9036609428e845dc300aec13822ba2c4ab3 Author: Takashi Iwai Date: Fri Sep 10 12:51:55 2021 +0200 ALSA: usb-audio: Unify mixer resume and reset_resume procedure USB-audio driver assumes that the normal resume would preserve the device configuration while reset_resume wouldn't, and tries to restore the mixer elements only at reset_resume callback. However, this seems too naive, and some devices do behave differently, resetting the volume at the normal resume; this resulted in the inconsistent volume that surprised users. This patch changes the mixer resume code to handle both the normal and reset resume in the same way, always restoring the original mixer element values. This allows us to unify the both callbacks as well as dropping the no longer used reset_resume field, which ends up with a good code reduction. A slight behavior change by this patch is that now we assign restore_mixer_value() as the default resume callback, and the function is no longer called at reset-resume when the resume callback is overridden by the quirk function. That is, if needed, the quirk resume function would have to handle similarly as restore_mixer_value() by itself. Reported-by: En-Shuo Hsu Cc: Yu-Hsuan Hsu Link: https://lore.kernel.org/r/CADDZ45UPsbpAAqP6=ZkTT8BE-yLii4Y7xSDnjK550G2DhQsMew@mail.gmail.com Link: https://lore.kernel.org/r/20210910105155.12862-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6f44578430d7888ade1e3bd919c1c2c0724409e5 Author: Takashi Iwai Date: Mon Sep 13 14:43:30 2021 +0200 Revert "ALSA: hda: Drop workaround for a hang at shutdown again" This reverts commit 8fc8e903156f42c66245838441d03607e9067381. It was expected that the fixes in HD-audio codec side would make the workaround redundant, but unfortunately it doesn't seem sufficing. Resurrect the workaround for now. Fixes: 8fc8e903156f ("ALSA: hda: Drop workaround for a hang at shutdown again") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210913124330.24530-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 13404ac8882f5225af07545215f4975a564c3740 Author: Shawn Guo Date: Mon Sep 13 15:49:55 2021 +0300 interconnect: qcom: sdm660: Add missing a2noc qos clocks It adds the missing a2noc clocks required for QoS registers programming per downstream kernel[1]. Otherwise, qcom_icc_noc_set_qos_priority() call on mas_ufs or mas_usb_hs node will simply result in a hardware hang on SDM660 SoC. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/sdm660-bus.dtsi?h=LA.UM.8.2.r1-04800-sdm660.0#n43 Signed-off-by: Shawn Guo Tested-by: Bjorn Andersson Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210824043435.23190-3-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit cf49e366020396ad83845c1c3bdbaa3c1406f5ce Author: Shawn Guo Date: Mon Sep 13 15:49:55 2021 +0300 dt-bindings: interconnect: sdm660: Add missing a2noc qos clocks It adds the missing a2noc clocks required for QoS registers programming per downstream kernel[1]. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/sdm660-bus.dtsi?h=LA.UM.8.2.r1-04800-sdm660.0#n43 Signed-off-by: Shawn Guo Reviewed-by: Rob Herring Acked-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210824043435.23190-2-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 5833c9b8766298e73c11766f9585d4ea4fa785ff Author: Shawn Guo Date: Mon Sep 13 15:49:55 2021 +0300 interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask The NOC_QOS_PRIORITY shift and mask do not match what vendor kernel defines [1]. Correct them per vendor kernel. As the result of NOC_QOS_PRIORITY_P0_SHIFT being 0, the definition can be dropped and regmap_update_bits() call on P0 can be simplified a bit. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/drivers/soc/qcom/msm_bus/msm_bus_noc_adhoc.c?h=LA.UM.8.2.r1-04800-sdm660.0#n37 Fixes: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver") Signed-off-by: Shawn Guo Reviewed-by: Dmitry Baryshkov Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210902054915.28689-1-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit a06c2e5c048e5e07fac9daf3073bd0b6582913c7 Author: Shawn Guo Date: Mon Sep 13 15:49:55 2021 +0300 interconnect: qcom: sdm660: Fix id of slv_cnoc_mnoc_cfg The id of slv_cnoc_mnoc_cfg node is mistakenly coded as id of slv_blsp_1. It causes the following warning on slv_blsp_1 node adding. Correct the id of slv_cnoc_mnoc_cfg node. [ 1.948180] ------------[ cut here ]------------ [ 1.954122] WARNING: CPU: 2 PID: 7 at drivers/interconnect/core.c:962 icc_node_add+0xe4/0xf8 [ 1.958994] Modules linked in: [ 1.967399] CPU: 2 PID: 7 Comm: kworker/u16:0 Not tainted 5.14.0-rc6-next-20210818 #21 [ 1.970275] Hardware name: Xiaomi Redmi Note 7 (DT) [ 1.978169] Workqueue: events_unbound deferred_probe_work_func [ 1.982945] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 1.988849] pc : icc_node_add+0xe4/0xf8 [ 1.995699] lr : qnoc_probe+0x350/0x438 [ 1.999519] sp : ffff80001008bb10 [ 2.003337] x29: ffff80001008bb10 x28: 000000000000001a x27: ffffb83ddc61ee28 [ 2.006818] x26: ffff2fe341d44080 x25: ffff2fe340f3aa80 x24: ffffb83ddc98f0e8 [ 2.013938] x23: 0000000000000024 x22: ffff2fe3408b7400 x21: 0000000000000000 [ 2.021054] x20: ffff2fe3408b7410 x19: ffff2fe341d44080 x18: 0000000000000010 [ 2.028173] x17: ffff2fe3bdd0aac0 x16: 0000000000000281 x15: ffff2fe3400f5528 [ 2.035290] x14: 000000000000013f x13: ffff2fe3400f5528 x12: 00000000ffffffea [ 2.042410] x11: ffffb83ddc9109d0 x10: ffffb83ddc8f8990 x9 : ffffb83ddc8f89e8 [ 2.049527] x8 : 0000000000017fe8 x7 : c0000000ffffefff x6 : 0000000000000001 [ 2.056645] x5 : 0000000000057fa8 x4 : 0000000000000000 x3 : ffffb83ddc9903b0 [ 2.063764] x2 : 1a1f6fde34d45500 x1 : ffff2fe340f3a880 x0 : ffff2fe340f3a880 [ 2.070882] Call trace: [ 2.077989] icc_node_add+0xe4/0xf8 [ 2.080247] qnoc_probe+0x350/0x438 [ 2.083718] platform_probe+0x68/0xd8 [ 2.087191] really_probe+0xb8/0x300 [ 2.091011] __driver_probe_device+0x78/0xe0 [ 2.094659] driver_probe_device+0x80/0x110 [ 2.098911] __device_attach_driver+0x90/0xe0 [ 2.102818] bus_for_each_drv+0x78/0xc8 [ 2.107331] __device_attach+0xf0/0x150 [ 2.110977] device_initial_probe+0x14/0x20 [ 2.114796] bus_probe_device+0x9c/0xa8 [ 2.118963] deferred_probe_work_func+0x88/0xc0 [ 2.122784] process_one_work+0x1a4/0x338 [ 2.127296] worker_thread+0x1f8/0x420 [ 2.131464] kthread+0x150/0x160 [ 2.135107] ret_from_fork+0x10/0x20 [ 2.138495] ---[ end trace 5eea8768cb620e87 ]--- Signed-off-by: Shawn Guo Reviewed-by: Bjorn Andersson Fixes: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver") Link: https://lore.kernel.org/r/20210823014003.31391-1-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 3a1e92d0896e928ac2a5b58962d05a39afef2e23 Author: Ganesh Goudar Date: Thu Sep 9 12:13:30 2021 +0530 powerpc/mce: Fix access error in mce handler We queue an irq work for deferred processing of mce event in realmode mce handler, where translation is disabled. Queuing of the work may result in accessing memory outside RMO region, such access needs the translation to be enabled for an LPAR running with hash mmu else the kernel crashes. After enabling translation in mce_handle_error() we used to leave it enabled to avoid crashing here, but now with the commit 74c3354bc1d89 ("powerpc/pseries/mce: restore msr before returning from handler") we are restoring the MSR to disable translation. Hence to fix this enable the translation before queuing the work. Without this change following trace is seen on injecting SLB multihit in an LPAR running with hash mmu. Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries CPU: 5 PID: 1883 Comm: insmod Tainted: G OE 5.14.0-mce+ #137 NIP: c000000000735d60 LR: c000000000318640 CTR: 0000000000000000 REGS: c00000001ebff9a0 TRAP: 0300 Tainted: G OE (5.14.0-mce+) MSR: 8000000000001003 CR: 28008228 XER: 00000001 CFAR: c00000000031863c DAR: c00000027fa8fe08 DSISR: 40000000 IRQMASK: 0 ... NIP llist_add_batch+0x0/0x40 LR __irq_work_queue_local+0x70/0xc0 Call Trace: 0xc00000001ebffc0c (unreliable) irq_work_queue+0x40/0x70 machine_check_queue_event+0xbc/0xd0 machine_check_early_common+0x16c/0x1f4 Fixes: 74c3354bc1d89 ("powerpc/pseries/mce: restore msr before returning from handler") Signed-off-by: Ganesh Goudar [mpe: Fix comment formatting, trim oops in change log for readability] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210909064330.312432-1-ganeshgr@linux.ibm.com commit 267cdfa21385d78c794768233678756e32b39ead Author: Nicholas Piggin Date: Wed Sep 8 20:17:18 2021 +1000 KVM: PPC: Book3S HV: Tolerate treclaim. in fake-suspend mode changing registers POWER9 DD2.2 and 2.3 hardware implements a "fake-suspend" mode where certain TM instructions executed in HV=0 mode cause softpatch interrupts so the hypervisor can emulate them and prevent problematic processor conditions. In this fake-suspend mode, the treclaim. instruction does not modify registers. Unfortunately the rfscv instruction executed by the guest do not generate softpatch interrupts, which can cause the hypervisor to lose track of the fake-suspend mode, and it can execute this treclaim. while not in fake-suspend mode. This modifies GPRs and crashes the hypervisor. It's not trivial to disable scv in the guest with HFSCR now, because they assume a POWER9 has scv available. So this fix saves and restores checkpointed registers across the treclaim. Fixes: 7854f7545bff ("KVM: PPC: Book3S: Rework TM save/restore code and make it C-callable") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210908101718.118522-2-npiggin@gmail.com commit ae7aaecc3f2f78b76ab3a8d6178610f55aadfa56 Author: Nicholas Piggin Date: Wed Sep 8 20:17:17 2021 +1000 powerpc/64s: system call rfscv workaround for TM bugs The rfscv instruction does not work correctly with the fake-suspend mode in POWER9, which can end up with the hypervisor restoring an incorrect checkpoint. Work around this by setting the _TIF_RESTOREALL flag if a system call returns to a transaction active state, causing rfid to be used instead of rfscv to return, which will do the right thing. The contents of the registers are irrelevant because they will be overwritten in this case anyway. Fixes: 7fa95f9adaee7 ("powerpc/64s: system call support for scv/rfscv instructions") Reported-by: Eirik Fuller Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210908101718.118522-1-npiggin@gmail.com commit 5379ef2a60431232b9bb01c6d3580b875123d723 Author: Nicholas Piggin Date: Fri Sep 3 22:57:07 2021 +1000 selftests/powerpc: Add scv versions of the basic TM syscall tests The basic TM vs syscall test code hard codes an sc instruction for the system call, which fails to cover scv even when the userspace libc has support for it. Duplicate the tests with hard coded scv variants so both are tested when possible. Signed-off-by: Nicholas Piggin [mpe: Fix build on old toolchains by using .long for scv] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210903125707.1601269-2-npiggin@gmail.com commit b871895b148256f1721bc565d803860242755a0b Author: Nicholas Piggin Date: Fri Sep 3 22:57:06 2021 +1000 powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state If a system call is made with a transaction active, the kernel immediately aborts it and returns. scv system calls disable irqs even earlier in their interrupt handler, and tabort_syscall does not fix this up. This can result in irq soft-mask state being messed up on the next kernel entry, and crashing at BUG_ON(arch_irq_disabled_regs(regs)) in the kernel exit handlers, or possibly worse. This can't easily be fixed in asm because at this point an async irq may have hit, which is soft-masked and marked pending. The pending interrupt has to be replayed before returning to userspace. The fix is to move the tabort_syscall code to C in the main syscall handler, and just skip the system call but otherwise return as usual, which will take care of the pending irqs. This also does a bunch of other things including possible signal delivery to the process, but the doomed transaction should still be aborted when it is eventually returned to. The sc system call path is changed to use the new C function as well to reduce code and path differences. This slows down how quickly system calls are aborted when called while a transaction is active, which could potentially impact TM performance. But making any system call is already bad for performance, and TM is on the way out, so go with simpler over faster. Fixes: 7fa95f9adaee7 ("powerpc/64s: system call support for scv/rfscv instructions") Reported-by: Eirik Fuller Signed-off-by: Nicholas Piggin [mpe: Use #ifdef rather than IS_ENABLED() to fix build error on 32-bit] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210903125707.1601269-1-npiggin@gmail.com commit 111b64e35ea03d58c882832744f571a88bb2e2e2 Author: Aleksander Jan Bajkowski Date: Sun Sep 12 13:58:07 2021 +0200 net: dsa: lantiq_gswip: Add 200ms assert delay The delay is especially needed by the xRX300 and xRX330 SoCs. Without this patch, some phys are sometimes not properly detected. The patch was tested on BT Home Hub 5A and D-Link DWR-966. Fixes: a09d042b0862 ("net: dsa: lantiq: allow to use all GPHYs on xRX300 and xRX330") Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Martin Blumenstingl Acked-by: Hauke Mehrtens Signed-off-by: David S. Miller commit e87b5052271e39d62337ade531992b7e5d8c2cfa Author: zhang kai Date: Thu Sep 9 16:39:18 2021 +0800 ipv6: delay fib6_sernum increase in fib6_add only increase fib6_sernum in net namespace after add fib6_info successfully. Signed-off-by: zhang kai Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 928faf5e3e8d3ec0388c9363b15355673c567966 Author: Robin Murphy Date: Wed Jul 14 18:22:38 2021 +0100 arm64: dts: fvp: Remove panel timings The simple-panel driver already has hard-coded timings for "arm,rtsm-display", and as such screams at us for trying to override a fixed mode from DT. Since the exact values probably don't matter all that much anyway, just remove the DT node to keep boot quiet. Link: https://lore.kernel.org/r/2701c187cf8e0762df38f68cc069ec2c29a3b5a9.1626283322.git.robin.murphy@arm.com Reviewed-by: Linus Walleij Signed-off-by: Robin Murphy Signed-off-by: Sudeep Holla commit f4bb62e64c88c93060c051195d3bbba804e56945 Author: Hoang Le Date: Mon Sep 13 16:28:52 2021 +0700 tipc: increase timeout in tipc_sk_enqueue() In tipc_sk_enqueue() we use hardcoded 2 jiffies to extract socket buffer from generic queue to particular socket. The 2 jiffies is too short in case there are other high priority tasks get CPU cycles for multiple jiffies update. As result, no buffer could be enqueued to particular socket. To solve this, we switch to use constant timeout 20msecs. Then, the function will be expired between 2 jiffies (CONFIG_100HZ) and 20 jiffies (CONFIG_1000HZ). Fixes: c637c1035534 ("tipc: resolve race problem at unicast message reception") Acked-by: Jon Maloy Signed-off-by: Hoang Le Signed-off-by: David S. Miller commit e50e711351bdc656a8e6ca1022b4293cae8dcd59 Author: Aya Levin Date: Mon Sep 13 10:53:49 2021 +0300 udp_tunnel: Fix udp_tunnel_nic work-queue type Turn udp_tunnel_nic work-queue to an ordered work-queue. This queue holds the UDP-tunnel configuration commands of the different netdevs. When the netdevs are functions of the same NIC the order of execution may be crucial. Problem example: NIC with 2 PFs, both PFs declare offload quota of up to 3 UDP-ports. $ifconfig eth2 1.1.1.1/16 up $ip link add eth2_19503 type vxlan id 5049 remote 1.1.1.2 dev eth2 dstport 19053 $ip link set dev eth2_19503 up $ip link add eth2_19504 type vxlan id 5049 remote 1.1.1.3 dev eth2 dstport 19054 $ip link set dev eth2_19504 up $ip link add eth2_19505 type vxlan id 5049 remote 1.1.1.4 dev eth2 dstport 19055 $ip link set dev eth2_19505 up $ip link add eth2_19506 type vxlan id 5049 remote 1.1.1.5 dev eth2 dstport 19056 $ip link set dev eth2_19506 up NIC RX port offload infrastructure offloads the first 3 UDP-ports (on all devices which sets NETIF_F_RX_UDP_TUNNEL_PORT feature) and not UDP-port 19056. So both PFs gets this offload configuration. $ip link set dev eth2_19504 down This triggers udp-tunnel-core to remove the UDP-port 19504 from offload-ports-list and offload UDP-port 19056 instead. In this scenario it is important that the UDP-port of 19504 will be removed from both PFs before trying to add UDP-port 19056. The NIC can stop offloading a UDP-port only when all references are removed. Otherwise the NIC may report exceeding of the offload quota. Fixes: cc4e3835eff4 ("udp_tunnel: add central NIC RX port offload infrastructure") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit d7807a9adf4856171f8441f13078c33941df48ab Author: Yajun Deng Date: Mon Sep 13 12:04:42 2021 +0800 Revert "ipv4: fix memory leaks in ip_cmsg_send() callers" This reverts commit 919483096bfe75dda338e98d56da91a263746a0a. There is only when ip_options_get() return zero need to free. It already called kfree() when return error. Fixes: 919483096bfe ("ipv4: fix memory leaks in ip_cmsg_send() callers") Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 2049eb0d20de1e6533526ad209f5d1b006ed97c7 Merge: f11ee2ad25b22 985941e1dd5e9 Author: David S. Miller Date: Mon Sep 13 12:31:13 2021 +0100 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes. The first patch fixes an error recovery regression just introduced about a week ago. The other two patches fix issues related to freeing rings in the bnxt_close() path under error conditions. ==================== Signed-off-by: David S. Miller commit 985941e1dd5e996311c29688ca0d3aa1ff8eb0b6 Author: Michael Chan Date: Sun Sep 12 12:34:49 2021 -0400 bnxt_en: Clean up completion ring page arrays completely We recently changed the completion ring page arrays to be dynamically allocated to better support the expanded range of ring depths. The cleanup path for this was not quite complete. It might cause the shutdown path to crash if we need to abort before the completion ring arrays have been allocated and initialized. Fix it by initializing the ring_mem->pg_arr to NULL after freeing the completion ring page array. Add a check in bnxt_free_ring() to skip referencing the rmem->pg_arr if it is NULL. Fixes: 03c7448790b8 ("bnxt_en: Don't use static arrays for completion ring pages") Reviewed-by: Andy Gospodarek Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 1affc01fdc6035189a5ab2a24948c9419ee0ecf2 Author: Edwin Peer Date: Sun Sep 12 12:34:48 2021 -0400 bnxt_en: make bnxt_free_skbs() safe to call after bnxt_free_mem() The call to bnxt_free_mem(..., false) in the bnxt_half_open_nic() error path will deallocate ring descriptor memory via bnxt_free_?x_rings(), but because irq_re_init is false, the ring info itself is not freed. To simplify error paths, deallocation functions have generally been written to be safe when called on unallocated memory. It should always be safe to call dev_close(), which calls bnxt_free_skbs() a second time, even in this semi- allocated ring state. Calling bnxt_free_skbs() a second time with the rings already freed will cause NULL pointer dereference. Fix it by checking the rings are valid before proceeding in bnxt_free_tx_skbs() and bnxt_free_one_rx_ring_skbs(). Fixes: 975bc99a4a39 ("bnxt_en: Refactor bnxt_free_rx_skbs().") Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit eca4cf12acda306f851f6d2a05b1c9ef62cf0e81 Author: Michael Chan Date: Sun Sep 12 12:34:47 2021 -0400 bnxt_en: Fix error recovery regression The recent patch has introduced a regression by not reading the reset count in the ERROR_RECOVERY async event handler. We may have just gone through a reset and the reset count has just incremented. If we don't update the reset count in the ERROR_RECOVERY event handler, the health check timer will see that the reset count has changed and will initiate an unintended reset. Restore the unconditional update of the reset count in bnxt_async_event_process() if error recovery watchdog is enabled. Also, update the reset count at the end of the reset sequence to make it even more robust. Fixes: 1b2b91831983 ("bnxt_en: Fix possible unintended driver initiated error recovery") Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a7b68ed15d1fd72c1e451d5eb6edebee2a624b90 Author: Geert Uytterhoeven Date: Tue Sep 7 14:45:11 2021 +0200 m68k: mvme: Remove overdue #warnings in RTC handling The warnings were introduced when converting the MVME147 and MVME16x RTC handling from gettod to hwclk. Replace the #warning by a comment, and return an error to inform the upper layer that writing to the RTC is not yet supported. Signed-off-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210907124511.2723414-1-geert@linux-m68k.org commit b1a89856fbf63fffde6a4771d8f1ac21df549e50 Author: Guenter Roeck Date: Mon Sep 6 23:07:29 2021 -0700 m68k: Double cast io functions to unsigned long m68k builds fail widely with errors such as arch/m68k/include/asm/raw_io.h:20:19: error: cast to pointer from integer of different size arch/m68k/include/asm/raw_io.h:30:32: error: cast to pointer from integer of different size [-Werror=int-to-p On m68k, io functions are defined as macros. The problem is seen if the macro parameter variable size differs from the size of a pointer. Cast the parameter of all io macros to unsigned long before casting it to a pointer to fix the problem. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210907060729.2391992-1-linux@roeck-us.net Signed-off-by: Geert Uytterhoeven commit 196159d278ae3b49e7bbb7c76822e6008fd89b97 Author: Hans de Goede Date: Sun Sep 5 15:02:10 2021 +0200 platform/x86: touchscreen_dmi: Update info for the Chuwi Hi10 Plus (CWI527) tablet Add info for getting the firmware directly from the UEFI for the Chuwi Hi10 Plus (CWI527), so that the user does not need to manually install the firmware in /lib/firmware/silead. This change will make the touchscreen on these devices work OOTB, without requiring any manual setup. Also tweak the min and width/height values a bit for more accurate position reporting. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210905130210.32810-2-hdegoede@redhat.com commit 3bf1669b0e033c885ebcb1ddc2334088dd125f2d Author: Hans de Goede Date: Sun Sep 5 15:02:09 2021 +0200 platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet Add touchscreen info for the Chuwi HiBook (CWI514) tablet. This includes info for getting the firmware directly from the UEFI, so that the user does not need to manually install the firmware in /lib/firmware/silead. This change will make the touchscreen on these devices work OOTB, without requiring any manual setup. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210905130210.32810-1-hdegoede@redhat.com commit 4c4a3d7cffb42da21ea8891fc7e6808ae05dbcb5 Author: Matan Ziv-Av Date: Sun Aug 29 15:07:08 2021 +0300 lg-laptop: Correctly handle dmi_get_system_info() returning NULL The laptop model is identified by parsing the product name. If no product name is available, do not try to parse it. Default model is 2017. Signed-off-by: Matan Ziv-Av Link: https://lore.kernel.org/r/93ff3bb-503b-f73-bf18-87bae1699ed@svgalib.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 349bff48ae0f5f8aa2075d0bdc2091a30bd634f6 Author: Andy Shevchenko Date: Fri Aug 27 17:53:10 2021 +0300 platform/x86/intel: punit_ipc: Drop wrong use of ACPI_PTR() ACPI_PTR() is more harmful than helpful. For example, in this case if CONFIG_ACPI=n, the ID table left unused which is not what we want. Instead of adding ifdeffery here and there, drop ACPI_PTR() and unused acpi.h. Fixes: fdca4f16f57d ("platform:x86: add Intel P-Unit mailbox IPC driver") Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210827145310.76239-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 7bb057134d609b9c038a00b6876cf0d37d0118ce Author: Carlo Lobrano Date: Fri Sep 3 14:39:13 2021 +0200 USB: serial: option: add Telit LN920 compositions This patch adds the following Telit LN920 compositions: 0x1060: tty, adb, rmnet, tty, tty, tty, tty 0x1061: tty, adb, mbim, tty, tty, tty, tty 0x1062: rndis, tty, adb, tty, tty, tty, tty 0x1063: tty, adb, ecm, tty, tty, tty, tty Signed-off-by: Carlo Lobrano Link: https://lore.kernel.org/r/20210903123913.1086513-1-c.lobrano@gmail.com Reviewed-by: Daniele Palmas Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 9d37e1cab2a9d2cee2737973fa455e6f89eee46a Author: David Howells Date: Wed Sep 8 21:55:19 2021 +0100 afs: Fix updating of i_blocks on file/dir extension When an afs file or directory is modified locally such that the total file size is extended, i_blocks needs to be recalculated too. Fix this by making afs_write_end() and afs_edit_dir_add() call afs_set_i_size() rather than setting inode->i_size directly as that also recalculates inode->i_blocks. This can be tested by creating and writing into directories and files and then examining them with du. Without this change, directories show a 4 blocks (they start out at 2048 bytes) and files show 0 blocks; with this change, they should show a number of blocks proportional to the file size rounded up to 1024. Fixes: 31143d5d515e ("AFS: implement basic file write support") Fixes: 63a4681ff39c ("afs: Locally edit directory data for mkdir/create/unlink/...") Reported-by: Markus Suvanto Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/ commit b537a3c21775075395af475dcc6ef212fcf29db8 Author: David Howells Date: Fri Sep 10 00:01:52 2021 +0100 afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server AFS-3 has two data fetch RPC variants, FS.FetchData and FS.FetchData64, and Linux's afs client switches between them when talking to a non-YFS server if the read size, the file position or the sum of the two have the upper 32 bits set of the 64-bit value. This is a problem, however, since the file position and length fields of FS.FetchData are *signed* 32-bit values. Fix this by capturing the capability bits obtained from the fileserver when it's sent an FS.GetCapabilities RPC, rather than just discarding them, and then picking out the VICED_CAPABILITY_64BITFILES flag. This can then be used to decide whether to use FS.FetchData or FS.FetchData64 - and also FS.StoreData or FS.StoreData64 - rather than using upper_32_bits() to switch on the parameter values. This capabilities flag could also be used to limit the maximum size of the file, but all servers must be checked for that. Note that the issue does not exist with FS.StoreData - that uses *unsigned* 32-bit values. It's also not a problem with Auristor servers as its YFS.FetchData64 op uses unsigned 64-bit values. This can be tested by cloning a git repo through an OpenAFS client to an OpenAFS server and then doing "git status" on it from a Linux afs client[1]. Provided the clone has a pack file that's in the 2G-4G range, the git status will show errors like: error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index This can be observed in the server's FileLog with something like the following appearing: Sun Aug 29 19:31:39 2021 SRXAFS_FetchData, Fid = 2303380852.491776.3263114, Host 192.168.11.201:7001, Id 1001 Sun Aug 29 19:31:39 2021 CheckRights: len=0, for host=192.168.11.201:7001 Sun Aug 29 19:31:39 2021 FetchData_RXStyle: Pos 18446744071815340032, Len 3154 Sun Aug 29 19:31:39 2021 FetchData_RXStyle: file size 2400758866 ... Sun Aug 29 19:31:40 2021 SRXAFS_FetchData returns 5 Note the file position of 18446744071815340032. This is the requested file position sign-extended. Fixes: b9b1f8d5930a ("AFS: write support fixes") Reported-by: Markus Suvanto Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org cc: openafs-devel@openafs.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217#c9 [1] Link: https://lore.kernel.org/r/951332.1631308745@warthog.procyon.org.uk/ commit 4fe6a946823a9bc8619fd16b7ea7d15914a30f22 Author: David Howells Date: Thu Sep 2 21:51:01 2021 +0100 afs: Try to avoid taking RCU read lock when checking vnode validity Try to avoid taking the RCU read lock when checking the validity of a vnode's callback state. The only thing it's needed for is to pin the parent volume's server list whilst we search it to find the record of the server we're currently using to see if it has been reinitialised (ie. it sent us a CB.InitCallBackState* RPC). Do this by the following means: (1) Keep an additional per-cell counter (fs_s_break) that's incremented each time any of the fileservers in the cell reinitialises. Since the new counter can be accessed without RCU from the vnode, we can check that first - and only if it differs, get the RCU read lock and check the volume's server list. (2) Replace afs_get_s_break_rcu() with afs_check_server_good() which now indicates whether the callback promise is still expected to be present on the server. This does the checks as described in (1). (3) Restructure afs_check_validity() to take account of the change in (2). We can also get rid of the valid variable and just use the need_clear variable with the addition of the afs_cb_break_no_promise reason. (4) afs_check_validity() probably shouldn't be altering vnode->cb_v_break and vnode->cb_s_break when it doesn't have cb_lock exclusively locked. Move the change to vnode->cb_v_break to __afs_break_callback(). Delegate the change to vnode->cb_s_break to afs_select_fileserver() and set vnode->cb_fs_s_break there also. (5) afs_validate() no longer needs to get the RCU read lock around its call to afs_check_validity() - and can skip the call entirely if we don't have a promise. Signed-off-by: David Howells Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163111669583.283156.1397603105683094563.stgit@warthog.procyon.org.uk/ commit 6e0e99d58a6530cf65f10e4bb16630c5be6c254d Author: David Howells Date: Thu Sep 2 16:43:10 2021 +0100 afs: Fix mmap coherency vs 3rd-party changes Fix the coherency management of mmap'd data such that 3rd-party changes become visible as soon as possible after the callback notification is delivered by the fileserver. This is done by the following means: (1) When we break a callback on a vnode specified by the CB.CallBack call from the server, we queue a work item (vnode->cb_work) to go and clobber all the PTEs mapping to that inode. This causes the CPU to trip through the ->map_pages() and ->page_mkwrite() handlers if userspace attempts to access the page(s) again. (Ideally, this would be done in the service handler for CB.CallBack, but the server is waiting for our reply before considering, and we have a list of vnodes, all of which need breaking - and the process of getting the mmap_lock and stripping the PTEs on all CPUs could be quite slow.) (2) Call afs_validate() from the ->map_pages() handler to check to see if the file has changed and to get a new callback promise from the server. Also handle the fileserver telling us that it's dropping all callbacks, possibly after it's been restarted by sending us a CB.InitCallBackState* call by the following means: (3) Maintain a per-cell list of afs files that are currently mmap'd (cell->fs_open_mmaps). (4) Add a work item to each server that is invoked if there are any open mmaps when CB.InitCallBackState happens. This work item goes through the aforementioned list and invokes the vnode->cb_work work item for each one that is currently using this server. This causes the PTEs to be cleared, causing ->map_pages() or ->page_mkwrite() to be called again, thereby calling afs_validate() again. I've chosen to simply strip the PTEs at the point of notification reception rather than invalidate all the pages as well because (a) it's faster, (b) we may get a notification for other reasons than the data being altered (in which case we don't want to clobber the pagecache) and (c) we need to ask the server to find out - and I don't want to wait for the reply before holding up userspace. This was tested using the attached test program: #include #include #include #include #include #include int main(int argc, char *argv[]) { size_t size = getpagesize(); unsigned char *p; bool mod = (argc == 3); int fd; if (argc != 2 && argc != 3) { fprintf(stderr, "Format: %s [mod]\n", argv[0]); exit(2); } fd = open(argv[1], mod ? O_RDWR : O_RDONLY); if (fd < 0) { perror(argv[1]); exit(1); } p = mmap(NULL, size, mod ? PROT_READ|PROT_WRITE : PROT_READ, MAP_SHARED, fd, 0); if (p == MAP_FAILED) { perror("mmap"); exit(1); } for (;;) { if (mod) { p[0]++; msync(p, size, MS_ASYNC); fsync(fd); } printf("%02x", p[0]); fflush(stdout); sleep(1); } } It runs in two modes: in one mode, it mmaps a file, then sits in a loop reading the first byte, printing it and sleeping for a second; in the second mode it mmaps a file, then sits in a loop incrementing the first byte and flushing, then printing and sleeping. Two instances of this program can be run on different machines, one doing the reading and one doing the writing. The reader should see the changes made by the writer, but without this patch, they aren't because validity checking is being done lazily - only on entry to the filesystem. Testing the InitCallBackState change is more complicated. The server has to be taken offline, the saved callback state file removed and then the server restarted whilst the reading-mode program continues to run. The client machine then has to poke the server to trigger the InitCallBackState call. Signed-off-by: David Howells Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163111668833.283156.382633263709075739.stgit@warthog.procyon.org.uk/ commit 63d49d843ef5fffeea069e0ffdfbd2bf40ba01c6 Author: David Howells Date: Wed Sep 1 18:11:33 2021 +0100 afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation The AFS filesystem is currently triggering the silly-rename cleanup from afs_d_revalidate() when it sees that a dentry has been changed by a third party[1]. It should not be doing this as the cleanup includes deleting the silly-rename target file on iput. Fix this by removing the places in the d_revalidate handling that validate anything other than the directory and the dirent. It probably should not be looking to validate the target inode of the dentry also. This includes removing the point in afs_d_revalidate() where the inode that a dentry used to point to was marked as being deleted (AFS_VNODE_DELETED). We don't know it got deleted. It could have been renamed or it could have hard links remaining. This was reproduced by cloning a git repo onto an afs volume on one machine, switching to another machine and doing "git status", then switching back to the first and doing "git status". The second status would show weird output due to ".git/index" getting deleted by the above mentioned mechanism. A simpler way to do it is to do: machine 1: touch a machine 2: touch b; mv -f b a machine 1: stat a on an afs volume. The bug shows up as the stat failing with ENOENT and the file server log showing that machine 1 deleted "a". Fixes: 79ddbfa500b3 ("afs: Implement sillyrename for unlink and rename") Reported-by: Markus Suvanto Signed-off-by: David Howells Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217#c4 [1] Link: https://lore.kernel.org/r/163111668100.283156.3851669884664475428.stgit@warthog.procyon.org.uk/ commit 3978d816523991dd86cf9aae88c295230a5ea3b2 Author: David Howells Date: Wed Sep 1 19:22:50 2021 +0100 afs: Add missing vnode validation checks afs_d_revalidate() should only be validating the directory entry it is given and the directory to which that belongs; it shouldn't be validating the inode/vnode to which that dentry points. Besides, validation need to be done even if we don't call afs_d_revalidate() - which might be the case if we're starting from a file descriptor. In order for afs_d_revalidate() to be fixed, validation points must be added in some other places. Certain directory operations, such as afs_unlink(), already check this, but not all and not all file operations either. Note that the validation of a vnode not only checks to see if the attributes we have are correct, but also gets a promise from the server to notify us if that file gets changed by a third party. Add the following checks: - Check the vnode we're going to make a hard link to. - Check the vnode we're going to move/rename. - Check the vnode we're going to read from. - Check the vnode we're going to write to. - Check the vnode we're going to sync. - Check the vnode we're going to make a mapped page writable for. Some of these aren't strictly necessary as we're going to perform a server operation that might get the attributes anyway from which we can determine if something changed - though it might not get us a callback promise. Signed-off-by: David Howells Tested-by: Markus Suvanto cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163111667354.283156.12720698333342917516.stgit@warthog.procyon.org.uk/ commit 0764e365dacd0b8f75c1736f9236be280649bd18 Author: Clément Bœsch Date: Sun Sep 5 02:20:27 2021 +0200 arm64: dts: allwinner: h5: NanoPI Neo 2: Fix ethernet node RX and TX delay are provided by ethernet PHY. Reflect that in ethernet node. Fixes: 44a94c7ef989 ("arm64: dts: allwinner: H5: Restore EMAC changes") Signed-off-by: Clément Bœsch Reviewed-by: Jernej Skrabec Reviewed-by: Andrew Lunn Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20210905002027.171984-1-u@pkh.me commit 64794d6db49730d22f440aef0cf4da98a56a4ea3 Author: Takashi Sakamoto Date: Mon Sep 13 11:10:42 2021 +0900 ALSA: oxfw: fix transmission method for Loud models based on OXFW971 Loud Technologies Mackie Onyx 1640i (former model) is identified as the model which uses OXFW971. The analysis of packet dump shows that it transfers events in blocking method of IEC 61883-6, however the default behaviour of ALSA oxfw driver is for non-blocking method. This commit adds code to detect it assuming that all of loud models based on OXFW971 have such quirk. It brings no functional change except for alignment rule of PCM buffer. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210913021042.10085-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 67f3b2f822b7e71cfc9b42dbd9f3144fa2933e0b Author: Ming Lei Date: Mon Sep 6 14:50:03 2021 +0800 blk-mq: avoid to iterate over stale request blk-mq can't run allocating driver tag and updating ->rqs[tag] atomically, meantime blk-mq doesn't clear ->rqs[tag] after the driver tag is released. So there is chance to iterating over one stale request just after the tag is allocated and before updating ->rqs[tag]. scsi_host_busy_iter() calls scsi_host_check_in_flight() to count scsi in-flight requests after scsi host is blocked, so no new scsi command can be marked as SCMD_STATE_INFLIGHT. However, driver tag allocation still can be run by blk-mq core. One request is marked as SCMD_STATE_INFLIGHT, but this request may have been kept in another slot of ->rqs[], meantime the slot can be allocated out but ->rqs[] isn't updated yet. Then this in-flight request is counted twice as SCMD_STATE_INFLIGHT. This way causes trouble in handling scsi error. Fixes the issue by not iterating over stale request. Cc: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Reported-by: luojiaxing Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20210906065003.439019-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 767a65e9f31789d80e41edd03a802314905e8fbf Author: Hao Xu Date: Sun Sep 12 03:40:52 2021 +0800 io-wq: fix potential race of acct->nr_workers Given max_worker is 1, and we currently have 1 running and it is exiting. There may be race like: io_wqe_enqueue worker1 no work there and timeout unlock(wqe->lock) ->insert work -->io_worker_exit lock(wqe->lock) ->if(!nr_workers) //it's still 1 unlock(wqe->lock) goto run_cancel lock(wqe->lock) nr_workers-- ->dec_running ->worker creation fails unlock(wqe->lock) We enqueued one work but there is no workers, causes hung. Signed-off-by: Hao Xu Signed-off-by: Jens Axboe commit 7a842fb589e3cdbe205bc16dc37c30cf13383159 Author: Hao Xu Date: Sun Sep 12 03:40:50 2021 +0800 io-wq: code clean of io_wqe_create_worker() Remove do_create to save a local variable. Signed-off-by: Hao Xu Signed-off-by: Jens Axboe commit 16c8d2df7ec0eed31b7d3b61cb13206a7fb930cc Author: Jens Axboe Date: Sun Sep 12 06:45:07 2021 -0600 io_uring: ensure symmetry in handling iter types in loop_rw_iter() When setting up the next segment, we check what type the iter is and handle it accordingly. However, when incrementing and processed amount we do not, and both iter advance and addr/len are adjusted, regardless of type. Split the increment side just like we do on the setup side. Fixes: 4017eb91a9e7 ("io_uring: make loop_rw_iter() use original user supplied pointers") Cc: stable@vger.kernel.org Reported-by: Valentina Palmiotti Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 23c69b90365c8280b627aa969393d828ff47ac14 Author: suma hegde Date: Thu Sep 2 23:11:54 2021 +0530 hwmon: (k10temp) Remove residues of current and voltage Commit id "b00647c46c9d7f6ee1ff6aaf335906101755e614", adds reporting current and voltage to k10temp.c The commit id "0a4e668b5d52eed8026f5d717196b02b55fb2dc6", removed reporting current and voltage from k10temp.c The curr and in(voltage) entries are not removed from "k10temp_info" structure. Removing those residue entries. while at it, update k10temp driver documentation Signed-off-by: suma hegde Cc: Guenter Roeck Link: https://lore.kernel.org/r/20210902174155.7365-2-nchatrad@amd.com Signed-off-by: Guenter Roeck commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f Author: Linus Torvalds Date: Sun Sep 12 16:28:37 2021 -0700 Linux 5.15-rc1 commit b5b65f1398274fd726eca87dbebd39f3e603348a Merge: c3e46874dfb9a 17a99e521f677 Author: Linus Torvalds Date: Sun Sep 12 16:18:15 2021 -0700 Merge tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Add missing fields and remove some duplicate fields when printing a perf_event_attr. - Fix hybrid config terms list corruption. - Update kernel header copies, some resulted in new kernel features being automagically added to 'perf trace' syscall/tracepoint argument id->string translators. - Add a file generated during the documentation build to .gitignore. - Add an option to build without libbfd, as some distros, like Debian consider its ABI unstable. - Add support to print a textual representation of IBS raw sample data in 'perf report'. - Fix bpf 'perf test' sample mismatch reporting - Fix passing arguments to stackcollapse report in a 'perf script' python script. - Allow build-id with trailing zeros. - Look for ImageBase in PE file to compute .text offset. * tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (25 commits) tools headers UAPI: Update tools's copy of drm.h headers tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers UAPI: Sync linux/fs.h with the kernel sources tools headers UAPI: Sync linux/in.h copy with the kernel sources perf tools: Add an option to build without libbfd perf tools: Allow build-id with trailing zeros perf tools: Fix hybrid config terms list corruption perf tools: Factor out copy_config_terms() and free_config_terms() perf tools: Fix perf_event_attr__fprintf() missing/dupl. fields perf tools: Ignore Documentation dependency file perf bpf: Provide a weak btf__load_from_kernel_by_id() for older libbpf versions tools include UAPI: Update linux/mount.h copy perf beauty: Cover more flags in the move_mount syscall argument beautifier tools headers UAPI: Sync linux/prctl.h with the kernel sources tools include UAPI: Sync sound/asound.h copy with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources perf report: Add support to print a textual representation of IBS raw sample data perf report: Add tools/arch/x86/include/asm/amd-ibs.h perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings ... commit c3e46874dfb9a2ef08085bb147dc371e72738673 Merge: d41adc4e22c62 b83a908498d68 Author: Linus Torvalds Date: Sun Sep 12 16:09:26 2021 -0700 Merge tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux Pull compiler attributes updates from Miguel Ojeda: - Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 (Marco Elver) - Add Nick as Reviewer for compiler_attributes.h (Nick Desaulniers) - Move __compiletime_{error|warning} (Nick Desaulniers) * tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux: compiler_attributes.h: move __compiletime_{error|warning} MAINTAINERS: add Nick as Reviewer for compiler_attributes.h Compiler Attributes: fix __has_attribute(__no_sanitize_coverage__) for GCC 4 commit d41adc4e22c62640fa7de93f713a3c5b3638ab2e Merge: f306b90c69ce3 24ebc044c72ee Author: Linus Torvalds Date: Sun Sep 12 16:00:49 2021 -0700 Merge tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux Pull auxdisplay updates from Miguel Ojeda: "An assortment of improvements for auxdisplay: - Replace symbolic permissions with octal permissions (Jinchao Wang) - ks0108: Switch to use module_parport_driver() (Andy Shevchenko) - charlcd: Drop unneeded initializers and switch to C99 style (Andy Shevchenko) - hd44780: Fix oops on module unloading (Lars Poeschel) - Add I2C gpio expander example (Ralf Schlatterbeck)" * tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux: auxdisplay: Replace symbolic permissions with octal permissions auxdisplay: ks0108: Switch to use module_parport_driver() auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style auxdisplay: hd44780: Fix oops on module unloading auxdisplay: Add I2C gpio expander example commit f306b90c69ce3994bb8046b54374a90a27f66be6 Merge: d8e988b62f948 c9871c800f65f Author: Linus Torvalds Date: Sun Sep 12 12:42:51 2021 -0700 Merge tag 'smp-urgent-2021-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull CPU hotplug updates from Thomas Gleixner: "Updates for the SMP and CPU hotplug: - Remove DEFINE_SMP_CALL_CACHE_FUNCTION() which is a left over of the original hotplug code and now causing trouble with the ARM64 cache topology setup due to the pointless SMP function call. It's not longer required as the hotplug callbacks are guaranteed to be invoked on the upcoming CPU. - Remove the deprecated and now unused CPU hotplug functions - Rewrite the CPU hotplug API documentation" * tag 'smp-urgent-2021-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation: core-api/cpuhotplug: Rewrite the API section cpu/hotplug: Remove deprecated CPU-hotplug functions. thermal: Replace deprecated CPU-hotplug functions. drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() commit d8e988b62f948d47dd86ec655c89d54053df1754 Merge: 1791596be2723 3a3a11e6e5a2b Author: Linus Torvalds Date: Sun Sep 12 11:56:00 2021 -0700 Merge tag 'char-misc-5.15-rc1-lkdtm' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull misc driver fix from Greg KH: "Here is a single patch for 5.15-rc1, for the lkdtm misc driver. It resolves a build issue that many people were hitting with your current tree, and Kees and others felt would be good to get merged before -rc1 comes out, to prevent them from having to constantly hit it as many development trees restart on -rc1, not older -rc releases. It has NOT been in linux-next, but has passed 0-day testing and looks 'obviously correct' when reviewing it locally :)" * tag 'char-misc-5.15-rc1-lkdtm' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: lkdtm: Use init_uts_ns.name instead of macros commit 1791596be2723f01de2f69d16a422fdba182c706 Merge: 56c244382fdb7 bf064c7bec3bf Author: Linus Torvalds Date: Sun Sep 12 11:44:58 2021 -0700 Merge tag 'for-linus-5.15-1' of git://github.com/cminyard/linux-ipmi Pull IPMI updates from Corey Minyard: "A couple of very minor fixes for style and rate limiting. Nothing big, but probably needs to go in" * tag 'for-linus-5.15-1' of git://github.com/cminyard/linux-ipmi: char: ipmi: use DEVICE_ATTR helper macro ipmi: rate limit ipmi smi_event failure message commit 56c244382fdb793986097df8e29f9f9320bc2c60 Merge: 165d05d88c276 868ad33bfa3bf Author: Linus Torvalds Date: Sun Sep 12 11:37:41 2021 -0700 Merge tag 'sched_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Make sure the idle timer expires in hardirq context, on PREEMPT_RT - Make sure the run-queue balance callback is invoked only on the outgoing CPU * tag 'sched_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Prevent balance_push() on remote runqueues sched/idle: Make the idle timer expire in hard interrupt context commit 165d05d88c27697fe444a6eae4f3882834ef8826 Merge: 7bf3142625c19 e5480572706da Author: Linus Torvalds Date: Sun Sep 12 11:27:05 2021 -0700 Merge tag 'locking_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fixes from Borislav Petkov: - Fix the futex PI requeue machinery to not return to userspace in inconsistent state - Avoid a potential null pointer dereference in the ww_mutex deadlock check - Other smaller cleanups and optimizations * tag 'locking_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/rtmutex: Fix ww_mutex deadlock check futex: Remove unused variable 'vpid' in futex_proxy_trylock_atomic() futex: Avoid redundant task lookup futex: Clarify comment for requeue_pi_wake_futex() futex: Prevent inconsistent state and exit race futex: Return error code instead of assigning it without effect locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT commit 7bf3142625c193db2dfbd7df2176b7cd910d9e4f Merge: fdfc346302a7b 39ff83f2f6cc5 Author: Linus Torvalds Date: Sun Sep 12 11:10:31 2021 -0700 Merge tag 'timers_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Borislav Petkov: - Handle negative second values properly when converting a timespec64 to nanoseconds. * tag 'timers_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: time: Handle negative seconds correctly in timespec64_to_ns() commit fdfc346302a7b63e3d5b9168be74bb12b1975999 Merge: 8d4a0b5d0813c ea47ab111669b Author: Linus Torvalds Date: Sun Sep 12 10:43:51 2021 -0700 Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull namei updates from Al Viro: "Clearing fallout from mkdirat in io_uring series. The fix in the kern_path_locked() patch plus associated cleanups" * 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: putname(): IS_ERR_OR_NULL() is wrong here namei: Standardize callers of filename_create() namei: Standardize callers of filename_lookup() rename __filename_parentat() to filename_parentat() namei: Fix use after free in kern_path_locked commit 8d4a0b5d0813c990637fa9f3c9bea5dab1fedb8f Merge: 78e709522d2c0 9351590f51cdd Author: Linus Torvalds Date: Sun Sep 12 10:10:21 2021 -0700 Merge tag '5.15-rc-cifs-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull smbfs updates from Steve French: "cifs/smb3 updates: - DFS reconnect fix - begin creating common headers for server and client - rename the cifs_common directory to smbfs_common to be more consistent ie change use of the name cifs to smb (smb3 or smbfs is more accurate, as the very old cifs dialect has long been superseded by smb3 dialects). In the future we can rename the fs/cifs directory to fs/smbfs. This does not include the set of multichannel fixes nor the two deferred close fixes (they are still being reviewed and tested)" * tag '5.15-rc-cifs-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: properly invalidate cached root handle when closing it cifs: move SMB FSCTL definitions to common code cifs: rename cifs_common to smbfs_common cifs: update FSCTL definitions commit f11ee2ad25b22c2ee587045dd6999434375532f7 Author: Len Baker Date: Sat Sep 11 12:28:18 2021 +0200 net: mana: 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 + count * size" 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 Reviewed-by: Haiyang Zhang Signed-off-by: David S. Miller commit 1b704b27beb11ce147d64b21c914e57afbfb5656 Author: Andrea Claudi Date: Sat Sep 11 16:14:18 2021 +0200 selftest: net: fix typo in altname test If altname deletion of the short alternative name fails, the error message printed is: "Failed to add short alternative name". This is obviously a typo, as we are testing altname deletion. Fix this using a proper error message. Fixes: f95e6c9c4617 ("selftest: net: add alternative names test") Signed-off-by: Andrea Claudi Signed-off-by: David S. Miller commit ce062a0adbfe933b1932235fdfd874c4c91d1bb0 Author: Ansuel Smith Date: Sat Sep 11 17:50:09 2021 +0200 net: dsa: qca8k: fix kernel panic with legacy mdio mapping When the mdio legacy mapping is used the mii_bus priv registered by DSA refer to the dsa switch struct instead of the qca8k_priv struct and causes a kernel panic. Create dedicated function when the internal dedicated mdio driver is used to properly handle the 2 different implementation. Fixes: 759bafb8a322 ("net: dsa: qca8k: add support for internal phy and internal mdio") Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 78e709522d2c012cb0daad2e668506637bffb7c2 Merge: b79bd0d5102b4 7bc7f61897b66 Author: Linus Torvalds Date: Sat Sep 11 14:48:42 2021 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: - vduse driver ("vDPA Device in Userspace") supporting emulated virtio block devices - virtio-vsock support for end of record with SEQPACKET - vdpa: mac and mq support for ifcvf and mlx5 - vdpa: management netlink for ifcvf - virtio-i2c, gpio dt bindings - misc fixes and cleanups * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (39 commits) Documentation: Add documentation for VDUSE vduse: Introduce VDUSE - vDPA Device in Userspace vduse: Implement an MMU-based software IOTLB vdpa: Support transferring virtual addressing during DMA mapping vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap() vdpa: Add an opaque pointer for vdpa_config_ops.dma_map() vhost-iotlb: Add an opaque pointer for vhost IOTLB vhost-vdpa: Handle the failure of vdpa_reset() vdpa: Add reset callback in vdpa_config_ops vdpa: Fix some coding style issues file: Export receive_fd() to modules eventfd: Export eventfd_wake_count to modules iova: Export alloc_iova_fast() and free_iova_fast() virtio-blk: remove unneeded "likely" statements virtio-balloon: Use virtio_find_vqs() helper vdpa: Make use of PFN_PHYS/PFN_UP/PFN_DOWN helper macro vsock_test: update message bounds test for MSG_EOR af_vsock: rename variables in receive loop virtio/vsock: support MSG_EOR bit processing vhost/vsock: support MSG_EOR bit processing ... commit b79bd0d5102b4a3ea908018fda6b84a4c8fd6235 Merge: 4e1c754472ffb 6f55ab36bef50 Author: Linus Torvalds Date: Sat Sep 11 14:29:42 2021 -0700 Merge tag 'riscv-for-linus-5.15-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - A pair of defconfig additions, for NVMe and the EFI filesystem localization options. - A larger address space for stack randomization. - A cleanup to our install rules. - A DTS update for the Microchip Icicle board, to fix the serial console. - Support for build-time table sorting, which allows us to have __ex_table read-only. * tag 'riscv-for-linus-5.15-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Move EXCEPTION_TABLE to RO_DATA segment riscv: Enable BUILDTIME_TABLE_SORT riscv: dts: microchip: mpfs-icicle: Fix serial console riscv: move the (z)install rules to arch/riscv/Makefile riscv: Improve stack randomisation on RV64 riscv: defconfig: enable NLS_CODEPAGE_437, NLS_ISO8859_1 riscv: defconfig: enable BLK_DEV_NVME commit 4e1c754472ffbf251835fc01f4cc638ffa8dd576 Merge: c605c39677b98 e71ec0bc06038 Author: Linus Torvalds Date: Sat Sep 11 14:22:28 2021 -0700 Merge branch 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux Pull coccinelle updates from Julia Lawall: "These changes update some existing semantic patches with respect to some recent changes in the kernel. Specifically, the change to kvmalloc.cocci searches for kfree_sensitive rather than kzfree, and the change to use_after_iter.cocci adds list_entry_is_head as a valid use of a list iterator index variable after the end of the loop" * 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux: scripts: coccinelle: allow list_entry_is_head() to use pos coccinelle: api: rename kzfree to kfree_sensitive commit 17a99e521f67743a5d3405cba0aacd8a10f9ff7d Author: Arnaldo Carvalho de Melo Date: Mon May 3 11:48:26 2021 -0300 tools headers UAPI: Update tools's copy of drm.h headers Picking the changes from: 17ce9c61c71cbc0d ("drm: document DRM_IOCTL_MODE_RMFB") Doesn't result in any tooling changes: $ tools/perf/trace/beauty/drm_ioctl.sh > before $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h $ tools/perf/trace/beauty/drm_ioctl.sh > after $ diff -u before after Silencing these perf build warnings: Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h' diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h Cc: Simon Ser Signed-off-by: Arnaldo Carvalho de Melo commit 4dc24d7cf4983ae779f4a4428e527441225315e9 Author: Arnaldo Carvalho de Melo Date: Sat Sep 11 16:18:28 2021 -0300 tools headers UAPI: Sync drm/i915_drm.h with the kernel sources To pick the changes in: b65a9489730a2494 ("drm/i915/userptr: Probe existence of backing struct pages upon creation") ee242ca704d38699 ("drm/i915/guc: Implement GuC priority management") 81340cf3bddded4f ("drm/i915/uapi: reject set_domain for discrete") 7961c5b60f23dff5 ("drm/i915: Add TTM offset argument to mmap.") aef7b67a79564f6c ("drm/i915/uapi: convert drm_i915_gem_userptr to kernel doc") e7737b67ab46ee0e ("drm/i915/uapi: reject caching ioctls for discrete") 3aa8c57fe25a9247 ("drm/i915/uapi: convert drm_i915_gem_set_domain to kernel doc") 289f5a72009b8f67 ("drm/i915/uapi: convert drm_i915_gem_caching to kernel doc") 4a766ae40ec83301 ("drm/i915: Drop the CONTEXT_CLONE API (v2)") 6ff6d61dd2a943bd ("drm/i915: Drop I915_CONTEXT_PARAM_NO_ZEROMAP") fe4751c3d513ff4f ("drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE") 577729533cdc4e37 ("drm/i915: Document the Virtual Engine uAPI") c649432e86ca677d ("drm/i915: Fix busy ioctl commentary") That doesn't result in any changes to tooling as no new ioctl were added (at least not perceived by tools/perf/trace/beauty/drm_ioctl.sh). Addressing 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: Chris Wilson Cc: Daniel Vetter Cc: Jason Ekstrand Cc: John Harrison Cc: Maarten Lankhorst Cc: Matthew Auld Cc: Matthew Brost Cc: Tvrtko Ursulin Signed-off-by: Arnaldo Carvalho de Melo commit 2bae3e64ec465cd545c5cbec74335eb44f97c177 Author: Arnaldo Carvalho de Melo Date: Fri May 21 16:00:31 2021 -0300 tools headers UAPI: Sync linux/fs.h with the kernel sources To pick the change in: 7957d93bf32bc211 ("block: add ioctl to read the disk sequence number") It adds a new ioctl, but we are still not using that to generate tables for 'perf trace', so no changes in tooling. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/fs.h' differs from latest version at 'include/uapi/linux/fs.h' diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h Cc: Jens Axboe Cc: Matteo Croce Signed-off-by: Arnaldo Carvalho de Melo commit ee286c60c268aed03bac4686ebb47f1534b4b2e2 Author: Arnaldo Carvalho de Melo Date: Sat Jun 19 10:15:22 2021 -0300 tools headers UAPI: Sync linux/in.h copy with the kernel sources To pick the changes in: db243b796439c0ca ("net/ipv4/ipv6: Replace one-element arraya with flexible-array members") 2d3e5caf96b9449a ("net/ipv4: Replace one-element array with flexible-array member") That don't result in any change in tooling, the structs changed remains with the same layout. This addresses this build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h Cc: David S. Miller Cc: Gustavo A. R. Silva Signed-off-by: Arnaldo Carvalho de Melo commit 0d1c50ac488ebdaeeaea8ed5069f8d435fd485ed Author: Ian Rogers Date: Fri Sep 10 15:57:56 2021 -0700 perf tools: Add an option to build without libbfd Some distributions, like debian, don't link perf with libbfd. Add a build flag to make this configuration buildable and testable. This was inspired by: https://lore.kernel.org/linux-perf-users/20210910102307.2055484-1-tonyg@leastfixedpoint.com/T/#u Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: tony garnock-jones Link: http://lore.kernel.org/lkml/20210910225756.729087-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4a86d41404005a3c7e7b6065e8169ac6202887a9 Author: Namhyung Kim Date: Fri Sep 10 15:46:30 2021 -0700 perf tools: Allow build-id with trailing zeros Currently perf saves a build-id with size but old versions assumes the size of 20. In case the build-id is less than 20 (like for MD5), it'd fill the rest with 0s. I saw a problem when old version of perf record saved a binary in the build-id cache and new version of perf reads the data. The symbols should be read from the build-id cache (as the path no longer has the same binary) but it failed due to mismatch in the build-id. symsrc__init: build id mismatch for /home/namhyung/.debug/.build-id/53/e4c2f42a4c61a2d632d92a72afa08f00000000/elf. The build-id event in the data has 20 byte build-ids, but it saw a different size (16) when it reads the build-id of the elf file in the build-id cache. $ readelf -n ~/.debug/.build-id/53/e4c2f42a4c61a2d632d92a72afa08f00000000/elf Displaying notes found in: .note.gnu.build-id Owner Data size Description GNU 0x00000010 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: 53e4c2f42a4c61a2d632d92a72afa08f Let's fix this by allowing trailing zeros if the size is different. Fixes: 39be8d0115b321ed ("perf tools: Pass build_id object to dso__build_id_equal()") Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210910224630.1084877-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 99fc5941b835d662eb2e91d8b61249e9a51df9f0 Author: Adrian Hunter Date: Thu Sep 9 15:55:08 2021 +0300 perf tools: Fix hybrid config terms list corruption A config terms list was spliced twice, resulting in a never-ending loop when the list was traversed. Fix by using list_splice_init() and copying and freeing the lists as necessary. This patch also depends on patch "perf tools: Factor out copy_config_terms() and free_config_terms()" Example on ADL: Before: # perf record -e '{intel_pt//,cycles/aux-sample-size=4096/pp}' uname & # jobs [1]+ Running perf record -e "{intel_pt//,cycles/aux-sample-size=4096/pp}" uname # perf top -E 10 PerfTop: 4071 irqs/sec kernel: 6.9% exact: 100.0% lost: 0/0 drop: 0/0 [4000Hz cycles], (all, 24 CPUs) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 97.60% perf [.] __evsel__get_config_term 0.25% [kernel] [k] kallsyms_expand_symbol.constprop.13 0.24% perf [.] kallsyms__parse 0.15% [kernel] [k] _raw_spin_lock 0.14% [kernel] [k] number 0.13% [kernel] [k] advance_transaction 0.08% [kernel] [k] format_decode 0.08% perf [.] map__process_kallsym_symbol 0.08% perf [.] rb_insert_color 0.08% [kernel] [k] vsnprintf exiting. # kill %1 After: # perf record -e '{intel_pt//,cycles/aux-sample-size=4096/pp}' uname & Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.060 MB perf.data ] # perf script | head perf-exec 604 [001] 1827.312293: psb: psb offs: 0 ffffffffb8415e87 pt_config_start+0x37 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb856a3bd event_sched_in.isra.133+0xfd ([kernel.kallsyms]) => ffffffffb856a9a0 perf_pmu_nop_void+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb856b10e merge_sched_in+0x26e ([kernel.kallsyms]) => ffffffffb856a2c0 event_sched_in.isra.133+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb856a45d event_sched_in.isra.133+0x19d ([kernel.kallsyms]) => ffffffffb8568b80 perf_event_set_state.part.61+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb8568b86 perf_event_set_state.part.61+0x6 ([kernel.kallsyms]) => ffffffffb85662a0 perf_event_update_time+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb856a35c event_sched_in.isra.133+0x9c ([kernel.kallsyms]) => ffffffffb8567610 perf_log_itrace_start+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb856a377 event_sched_in.isra.133+0xb7 ([kernel.kallsyms]) => ffffffffb8403b40 x86_pmu_add+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb8403b86 x86_pmu_add+0x46 ([kernel.kallsyms]) => ffffffffb8403940 collect_events+0x0 ([kernel.kallsyms]) perf-exec 604 1827.312293: 1 branches: ffffffffb8403a7b collect_events+0x13b ([kernel.kallsyms]) => ffffffffb8402cd0 collect_event+0x0 ([kernel.kallsyms]) Fixes: 30def61f64bac5 ("perf parse-events Create two hybrid cache events") Fixes: 94da591b1c7913 ("perf parse-events Create two hybrid raw events") Fixes: 9cbfa2f64c04d9 ("perf parse-events Create two hybrid hardware events") Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Jin Yao Cc: Kan Liang Link: https //lore.kernel.org/r/20210909125508.28693-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a7d212fc6c89d1619b9441f4c801cbff8ca34197 Author: Adrian Hunter Date: Thu Sep 9 15:55:07 2021 +0300 perf tools: Factor out copy_config_terms() and free_config_terms() Factor out copy_config_terms() and free_config_terms() so that they can be reused. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Jin Yao Cc: Kan Liang Link: https //lore.kernel.org/r/20210909125508.28693-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit eb34363ae1c0f62cf3183c4697533d6c482d1598 Author: Adrian Hunter Date: Sat Sep 11 15:05:50 2021 +0300 perf tools: Fix perf_event_attr__fprintf() missing/dupl. fields Some fields are missing and text_poke is duplicated. Fix that up. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20210911120550.12203-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit da4572d62d389f6665b86466b993ccc157b40715 Author: Ian Rogers Date: Fri Sep 10 16:22:49 2021 -0700 perf tools: Ignore Documentation dependency file When building directly on the checked out repository the build process produces a file that should be ignored, so add it to .gitignore. Fixes: a81df63a5df3e195 ("perf doc: Fix doc.dep") Reported-by: Linus Torvalds Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210910232249.739661-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c605c39677b9842b0566013e0cf30bc13e90bdbc Merge: c0f7e49fc480a 32c2d33e0b7c4 Author: Linus Torvalds Date: Sat Sep 11 10:28:14 2021 -0700 Merge tag 'io_uring-5.15-2021-09-11' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Fix an off-by-one in a BUILD_BUG_ON() check. Not a real issue right now as we have plenty of flags left, but could become one. (Hao) - Fix lockdep issue introduced in this merge window (me) - Fix a few issues with the worker creation (me, Pavel, Qiang) - Fix regression with wq_has_sleeper() for IOPOLL (Pavel) - Timeout link error propagation fix (Pavel) * tag 'io_uring-5.15-2021-09-11' of git://git.kernel.dk/linux-block: io_uring: fix off-by-one in BUILD_BUG_ON check of __REQ_F_LAST_BIT io_uring: fail links of cancelled timeouts io-wq: fix memory leak in create_io_worker() io-wq: fix silly logic error in io_task_work_match() io_uring: drop ctx->uring_lock before acquiring sqd->lock io_uring: fix missing mb() before waitqueue_active io-wq: fix cancellation on create-worker failure commit c0f7e49fc480a97770e448e0c0493e7ba46a9852 Merge: 8177a5c96229f 221e8360834c5 Author: Linus Torvalds Date: Sat Sep 11 10:19:51 2021 -0700 Merge tag 'block-5.15-2021-09-11' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request from Christoph: - fix nvmet command set reporting for passthrough controllers (Adam Manzanares) - update a MAINTAINERS email address (Chaitanya Kulkarni) - set QUEUE_FLAG_NOWAIT for nvme-multipth (me) - handle errors from add_disk() (Luis Chamberlain) - update the keep alive interval when kato is modified (Tatsuya Sasaki) - fix a buffer overrun in nvmet_subsys_attr_serial (Hannes Reinecke) - do not reset transport on data digest errors in nvme-tcp (Daniel Wagner) - only call synchronize_srcu when clearing current path (Daniel Wagner) - revalidate paths during rescan (Hannes Reinecke) - Split out the fs/block_dev into block/fops.c and block/bdev.c, which has been long overdue. Do this now before -rc1, to avoid annoying conflicts due to this (Christoph) - blk-throtl use-after-free fix (Li) - Improve plug depth for multi-device plugs, greatly increasing md resync performance (Song) - blkdev_show() locking fix (Tetsuo) - n64cart error check fix (Yang) * tag 'block-5.15-2021-09-11' of git://git.kernel.dk/linux-block: n64cart: fix return value check in n64cart_probe() blk-mq: allow 4x BLK_MAX_REQUEST_COUNT at blk_plug for multiple_queues block: move fs/block_dev.c to block/bdev.c block: split out operations on block special files blk-throttle: fix UAF by deleteing timer in blk_throtl_exit() block: genhd: don't call blkdev_show() with major_names_lock held nvme: update MAINTAINERS email address nvme: add error handling support for add_disk() nvme: only call synchronize_srcu when clearing current path nvme: update keep alive interval when kato is modified nvme-tcp: Do not reset transport on data digest errors nvmet: fixup buffer overrun in nvmet_subsys_attr_serial() nvmet: return bool from nvmet_passthru_ctrl and nvmet_is_passthru_req nvmet: looks at the passthrough controller when initializing CAP nvme: move nvme_multi_css into nvme.h nvme-multipath: revalidate paths during rescan nvme-multipath: set QUEUE_FLAG_NOWAIT commit 8177a5c96229ff24da1e362789e359b68b4f34f5 Merge: ce4c8f8820413 5ac749a57e0eb Author: Linus Torvalds Date: Sat Sep 11 10:18:20 2021 -0700 Merge tag 'libata-5.15-2021-09-11' of git://git.kernel.dk/linux-block Pull libata maintainer update from Jens Axboe: "Damien agreed to take over maintainership of libata, and he would be a great candidate for it. Update the MAINTAINERS entry to reflect the change in maintainer and git tree" * tag 'libata-5.15-2021-09-11' of git://git.kernel.dk/linux-block: libata: pass over maintainership to Damien Le Moal commit ce4c8f882041341cbb3f1b4632b20440692cbccc Merge: a1406e424253b 5dfe50b055880 Author: Linus Torvalds Date: Sat Sep 11 10:16:30 2021 -0700 Merge tag 'trace-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Minor fixes to the processing of the bootconfig tree" * tag 'trace-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: bootconfig: Rename xbc_node_find_child() to xbc_node_find_subkey() tracing/boot: Fix to check the histogram control param is a leaf node tracing/boot: Fix trace_boot_hist_add_array() to check array is value commit a1406e424253ba2121614377aaab274d403b08e0 Merge: 2aae0a937ad16 094b147c76628 Author: Linus Torvalds Date: Sat Sep 11 10:12:46 2021 -0700 Merge tag 'devicetree-fixes-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Disable fw_devlinks on x86 DT platforms to fix OLPC - More replacing oneOf+const with enum on a few new schemas - Drop unnecessary type references on Xilinx SPI binding schema * tag 'devicetree-fixes-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: spi: dt-bindings: xilinx: Drop type reference on *-bits properties dt-bindings: More use 'enum' instead of 'oneOf' plus 'const' entries of: property: Disable fw_devlink DT support for X86 commit 2aae0a937ad169752b5710d4f210c1ae7a49d3cf Merge: 107ccc45bb25c 2cfa946be8438 Author: Linus Torvalds Date: Sat Sep 11 10:05:56 2021 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fix from Stephen Boyd: "One patch to fix an unused variable warning in a Qualcomm clk driver" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: qcom: gcc-sm6350: Remove unused variable commit 107ccc45bb25c7fdc7a744496caa4d8a52af4812 Merge: 52926229be069 0c45d3e24ef3d Author: Linus Torvalds Date: Sat Sep 11 09:54:53 2021 -0700 Merge tag 'rtc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The broken down time conversion is similar to what is done in the time subsystem since v5.14. The rest is fairly straightforward. Subsystem: - Switch to Neri and Schneider time conversion algorithm Drivers: - rx8025: add rx8035 support - s5m: modernize driver and set range" * tag 'rtc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: rx8010: select REGMAP_I2C dt-bindings: rtc: add Epson RX-8025 and RX-8035 rtc: rx8025: implement RX-8035 support rtc: cmos: remove stale REVISIT comments rtc: tps65910: Correct driver module alias rtc: move RTC_LIB_KUNIT_TEST to proper location rtc: lib_test: add MODULE_LICENSE rtc: Improve performance of rtc_time64_to_tm(). Add tests. rtc: s5m: set range rtc: s5m: enable wakeup only when available rtc: s5m: signal the core when alarm are not available rtc: s5m: switch to devm_rtc_allocate_device commit 52926229be069258440c39de063fcd4a5fd75d62 Merge: 6701e7e7d8ee4 54b3bd99f094b Author: Linus Torvalds Date: Sat Sep 11 09:47:33 2021 -0700 Merge tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire updates from Stefan Richter: - Migrate the bus snooper driver 'nosy' from PCI to DMA API - Small janitorial cleanup in the IPv4/v6-over-1394 driver [ The 'nosy' change already come in as a different commit through Greg KH in the misc tree back in the previous merge window, so only the cleanup ends up being new to 5.15 - Linus ] * tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: nosy: switch from 'pci_' to 'dma_' API firewire: net: remove unused variable 'guid' commit 6701e7e7d8ee4f80d0c450aeab101e4a2a2678fa Merge: dd4703876ea83 3f2b16734914f Author: Linus Torvalds Date: Sat Sep 11 09:26:00 2021 -0700 Merge tag 'pwm/for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "The changes this time around are mostly janitorial in nature. A lot of this is simplifications of drivers using device-managed functions and improving compilation coverage. The Mediatek display PWM driver now supports the atomic API. Cleanups and minor fixes make up the remainder of this set" * tag 'pwm/for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (54 commits) pwm: mtk-disp: Implement atomic API .get_state() pwm: mtk-disp: Fix overflow in period and duty calculation pwm: mtk-disp: Implement atomic API .apply() pwm: mtk-disp: Adjust the clocks to avoid them mismatch dt-bindings: pwm: rockchip: Add description for rk3568 pwm: Make pwmchip_remove() return void pwm: sun4i: Don't check the return code of pwmchip_remove() pwm: sifive: Don't check the return code of pwmchip_remove() pwm: samsung: Don't check the return code of pwmchip_remove() pwm: renesas-tpu: Don't check the return code of pwmchip_remove() pwm: rcar: Don't check the return code of pwmchip_remove() pwm: pca9685: Don't check the return code of pwmchip_remove() pwm: omap-dmtimer: Don't check the return code of pwmchip_remove() pwm: mtk-disp: Don't check the return code of pwmchip_remove() pwm: imx-tpm: Don't check the return code of pwmchip_remove() pwm: img: Don't check the return code of pwmchip_remove() pwm: cros-ec: Don't check the return code of pwmchip_remove() pwm: brcmstb: Don't check the return code of pwmchip_remove() pwm: atmel-tcb: Don't check the return code of pwmchip_remove() pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() ... commit dd4703876ea83b5fb5f4f0a1ec58f786143f5064 Merge: 765092e4cdaa8 70ee251ded6ba Author: Linus Torvalds Date: Sat Sep 11 09:20:57 2021 -0700 Merge tag 'thermal-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal updates from Daniel Lezcano: - Add the tegra3 thermal sensor and fix the compilation testing on tegra by adding a dependency on ARCH_TEGRA along with COMPILE_TEST (Dmitry Osipenko) - Fix the error code for the exynos when devm_get_clk() fails (Dan Carpenter) - Add the TCC cooling support for AlderLake platform (Sumeet Pawnikar) - Add support for hardware trip points for the rcar gen3 thermal driver and store TSC id as unsigned int (Niklas Söderlund) - Replace the deprecated CPU-hotplug functions get_online_cpus() and put_online_cpus (Sebastian Andrzej Siewior) - Add the thermal tools directory in the MAINTAINERS file (Daniel Lezcano) - Fix the Makefile and the cross compilation flags for the userspace 'tmon' tool (Rolf Eike Beer) - Allow to use the IMOK independently from the GDDV on Int340x (Sumeet Pawnikar) - Fix the stub thermal_cooling_device_register() function prototype which does not match the real function (Arnd Bergmann) - Make the thermal trip point optional in the DT bindings (Maxime Ripard) - Fix a typo in a comment in the core code (Geert Uytterhoeven) - Reduce the verbosity of the trace in the SoC thermal tegra driver (Dmitry Osipenko) - Add the support for the LMh (Limit Management hardware) driver on the QCom platforms (Thara Gopinath) - Allow processing of HWP interrupt by adding a weak function in the Intel driver (Srinivas Pandruvada) - Prevent an abort of the sensor probe is a channel is not used (Matthias Kaehlcke) * tag 'thermal-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/qcom/spmi-adc-tm5: Don't abort probing if a sensor is not used thermal/drivers/intel: Allow processing of HWP interrupt dt-bindings: thermal: Add dt binding for QCOM LMh thermal/drivers/qcom: Add support for LMh driver firmware: qcom_scm: Introduce SCM calls to access LMh thermal/drivers/tegra-soctherm: Silence message about clamped temperature thermal: Spelling s/scallbacks/callbacks/ dt-bindings: thermal: Make trips node optional thermal/core: Fix thermal_cooling_device_register() prototype thermal/drivers/int340x: Use IMOK independently tools/thermal/tmon: Add cross compiling support thermal/tools/tmon: Improve the Makefile MAINTAINERS: Add missing userspace thermal tools to the thermal section thermal/drivers/intel_powerclamp: Replace deprecated CPU-hotplug functions. thermal/drivers/rcar_gen3_thermal: Store TSC id as unsigned int thermal/drivers/rcar_gen3_thermal: Add support for hardware trip points drivers/thermal/intel: Add TCC cooling support for AlderLake platform thermal/drivers/exynos: Fix an error code in exynos_tmu_probe() thermal/drivers/tegra: Correct compile-testing of drivers thermal/drivers/tegra: Add driver for Tegra30 thermal sensor commit 765092e4cdaa8439b969952ec4e6de3b84241f90 Merge: 926de8c4326c1 0c5483a5778fa Author: Linus Torvalds Date: Sat Sep 11 09:08:28 2021 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - several device tree bindings for input devices have been converted to yaml - dropped no longer used ixp4xx-beeper and CSR Prima2 PWRC drivers - analog joystick has been converted to use ktime API and no longer warn about low resolution timers - a few driver fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (24 commits) Input: analog - always use ktime functions Input: mms114 - support MMS134S Input: elan_i2c - reduce the resume time for controller in Whitebox Input: edt-ft5x06 - added case for EDT EP0110M09 Input: adc-keys - drop bogus __refdata annotation Input: Fix spelling mistake in Kconfig "useable" -> "usable" Input: Fix spelling mistake in Kconfig "Modul" -> "Module" Input: remove dead CSR Prima2 PWRC driver Input: adp5589-keys - use the right header Input: adp5588-keys - use the right header dt-bindings: input: tsc2005: Convert to YAML schema Input: ep93xx_keypad - prepare clock before using it dt-bindings: input: sun4i-lradc: Add wakeup-source dt-bindings: input: Convert Regulator Haptic binding to a schema dt-bindings: input: Convert Pixcir Touchscreen binding to a schema dt-bindings: input: Convert ChipOne ICN8318 binding to a schema Input: pm8941-pwrkey - fix comma vs semicolon issue dt-bindings: power: reset: qcom-pon: Convert qcom PON binding to yaml dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml dt-bindings: power: reset: Change 'additionalProperties' to true ... commit dfb5c1e12c28e35e4d4e5bc8022b0e9d585b89a7 Author: Wei Liu Date: Fri Sep 10 18:57:14 2021 +0000 x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself It is not a good practice to allocate a cpumask on stack, given it may consume up to 1 kilobytes of stack space if the kernel is configured to have 8192 cpus. The internal helper functions __send_ipi_mask{,_ex} need to loop over the provided mask anyway, so it is not too difficult to skip `self' there. We can thus do away with the on-stack cpumask in hv_send_ipi_mask_allbutself. Adjust call sites of __send_ipi_mask as needed. Reported-by: Linus Torvalds Suggested-by: Michael Kelley Suggested-by: Linus Torvalds Fixes: 68bb7bfb7985d ("X86/Hyper-V: Enable IPI enlightenments") Signed-off-by: Wei Liu Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20210910185714.299411-3-wei.liu@kernel.org commit 7ad9bb9d0f357dcab5eb9a0f28d1c8983c48434c Author: Wei Liu Date: Fri Sep 10 18:57:13 2021 +0000 asm-generic/hyperv: provide cpumask_to_vpset_noself This is a new variant which removes `self' cpu from the vpset. It will be used in Hyper-V enlightened IPI code. Signed-off-by: Wei Liu Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20210910185714.299411-2-wei.liu@kernel.org commit 08dad2f4d541fcfe5e7bfda72cc6314bbfd2802f Author: Jesper Nilsson Date: Fri Sep 10 21:55:34 2021 +0200 net: stmmac: allow CSR clock of 300MHz The Synopsys Ethernet IP uses the CSR clock as a base clock for MDC. The divisor used is set in the MAC_MDIO_Address register field CR (Clock Rate) The divisor is there to change the CSR clock into a clock that falls below the IEEE 802.3 specified max frequency of 2.5MHz. If the CSR clock is 300MHz, the code falls back to using the reset value in the MAC_MDIO_Address register, as described in the comment above this code. However, 300MHz is actually an allowed value and the proper divider can be estimated quite easily (it's just 1Hz difference!) A CSR frequency of 300MHz with the maximum clock rate value of 0x5 (STMMAC_CSR_250_300M, a divisor of 124) gives somewhere around ~2.42MHz which is below the IEEE 802.3 specified maximum. For the ARTPEC-8 SoC, the CSR clock is this problematic 300MHz, and unfortunately, the reset-value of the MAC_MDIO_Address CR field is 0x0. This leads to a clock rate of zero and a divisor of 42, and gives an MDC frequency of ~7.14MHz. Allow CSR clock of 300MHz by making the comparison inclusive. Signed-off-by: Jesper Nilsson Signed-off-by: David S. Miller commit 6f55ab36bef505b449723300a5a445ddc76a94d7 Author: Jisheng Zhang Date: Thu Aug 26 22:11:18 2021 +0800 riscv: Move EXCEPTION_TABLE to RO_DATA segment _ex_table section is read-only, so move it to RO_DATA. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 54fed35fd3939398be292e4090b0b1c5ff2238b4 Author: Jisheng Zhang Date: Thu Aug 26 22:10:29 2021 +0800 riscv: Enable BUILDTIME_TABLE_SORT Enable BUILDTIME_TABLE_SORT to sort the exception table at build time rather than during boot. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit cbba17870881cd17bca24673ccb72859431da5bd Author: Geert Uytterhoeven Date: Thu Aug 26 15:19:39 2021 +0200 riscv: dts: microchip: mpfs-icicle: Fix serial console Currently, nothing is output on the serial console, unless "console=ttyS0,115200n8" or "earlycon" are appended to the kernel command line. Enable automatic console selection using chosen/stdout-path by adding a proper alias, and configure the expected serial rate. While at it, add aliases for the other three serial ports, which are provided on the same micro-USB connector as the first one. Fixes: 0fa6107eca4186ad ("RISC-V: Initial DTS for Microchip ICICLE board") Signed-off-by: Geert Uytterhoeven Reviewed-by: Bin Meng Reviewed-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 399c1ec8467c563ae9db4c19a40a9d5e728b1e72 Author: Masahiro Yamada Date: Thu Jul 29 23:21:47 2021 +0900 riscv: move the (z)install rules to arch/riscv/Makefile Currently, the (z)install targets in arch/riscv/Makefile descend into arch/riscv/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/riscv/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Signed-off-by: Palmer Dabbelt commit d5935537c8256fc63c77d5f4914dfd6e3ef43241 Author: Kefeng Wang Date: Thu Aug 12 19:47:02 2021 +0800 riscv: Improve stack randomisation on RV64 This enlarges the bits availiable for stack randomisation on RV64 from the default of 8MiB to 1GiB, to match arm64 and x86. Also, update the documentation to reflect our support for stack randomisation. Signed-off-by: Kefeng Wang [Palmer: commit text] Signed-off-by: Palmer Dabbelt commit efe1e08bca9a1fab2b0ad886be4fb5335dcbf29c Author: Heinrich Schuchardt Date: Thu Aug 12 10:10:27 2021 +0200 riscv: defconfig: enable NLS_CODEPAGE_437, NLS_ISO8859_1 The EFI system partition uses the FAT file system. Many distributions add an entry in /etc/fstab for the ESP. We must ensure that mounting does not fail. The default code page for FAT is 437 (cf. CONFIG_FAT_DEFAULT_CODEPAGE). The default IO character set is "iso8859-1" (cf. CONFIG_NLS_ISO8859_1). So let's enable NLS_CODEPAGE_437 and NLS_ISO8859_1 in defconfig. Signed-off-by: Heinrich Schuchardt Signed-off-by: Palmer Dabbelt commit 3a87ff891290e1b9ef3f03396c22fd3b2f6eb955 Author: Heinrich Schuchardt Date: Thu Aug 12 10:10:26 2021 +0200 riscv: defconfig: enable BLK_DEV_NVME NVMe is a non-volatile storage media attached via PCIe. As NVMe has much higher throughput than other block devices like SATA it is a must have for RISC-V. Enable CONFIG_BLK_DEV_NVME. The HiFive Unmatched is a board providing M.2 slots for NVMe drives. Enable CONFIG_PCIE_FU740. Signed-off-by: Heinrich Schuchardt Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit c9871c800f65fffed40f3df3e1eb38984f95cfcf Author: Thomas Gleixner Date: Thu Sep 9 14:34:59 2021 +0200 Documentation: core-api/cpuhotplug: Rewrite the API section Dave stumbled over the incomplete and confusing documentation of the CPU hotplug API. Rewrite it, add the missing function documentations and correct the existing ones. Reported-by: Dave Chinner Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210909123212.489059409@linutronix.de commit 8c854303ce0e38e5bbedd725ff39da7e235865d8 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:21 2021 +0200 cpu/hotplug: Remove deprecated CPU-hotplug functions. No users in tree use the deprecated CPU-hotplug functions anymore. Remove them. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-39-bigeasy@linutronix.de commit c122358ea1e510d3def876abb7872f1b2b7365c9 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:02 2021 +0200 thermal: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-20-bigeasy@linutronix.de commit c2f4954c2d3fc4f77b46c67585e17a58df4ba8e4 Merge: 4b92d4add5f6d 926de8c4326c1 Author: Thomas Gleixner Date: Sat Sep 11 00:38:47 2021 +0200 Merge branch 'linus' into smp/urgent Ensure that all usage sites of get/put_online_cpus() except for the struggler in drivers/thermal are gone. So the last user and the deprecated inlines can be removed. commit 218e7b775d368f38d85d73e52900b082f004e5f1 Author: Arnaldo Carvalho de Melo Date: Fri Sep 10 17:26:53 2021 -0300 perf bpf: Provide a weak btf__load_from_kernel_by_id() for older libbpf versions The btf__get_from_id() function was deprecated in favour of btf__load_from_kernel_by_id(), but it is still avaiable, so use it to provide a weak function btf__load_from_kernel_by_id() for older libbpf when building perf with LIBBPF_DYNAMIC=1, i.e. using the system's libbpf package. Signed-off-by: Arnaldo Carvalho de Melo commit 37ce9e4fc596cf10a4d32ced741679bd1b4fa7a5 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:34:38 2021 -0300 tools include UAPI: Update linux/mount.h copy To pick the changes from: 9ffb14ef61bab83f ("move_mount: allow to add a mount into an existing group") That ends up adding support for the new MOVE_MOUNT_SET_GROUP move_mount flag. $ tools/perf/trace/beauty/move_mount_flags.sh > before $ cp include/uapi/linux/mount.h tools/include/uapi/linux/mount.h $ tools/perf/trace/beauty/move_mount_flags.sh > after $ diff -u before after --- before 2021-09-10 12:28:43.865279808 -0300 +++ after 2021-09-10 12:28:50.183429184 -0300 @@ -5,4 +5,5 @@ [ilog2(0x00000010) + 1] = "T_SYMLINKS", [ilog2(0x00000020) + 1] = "T_AUTOMOUNTS", [ilog2(0x00000040) + 1] = "T_EMPTY_PATH", + [ilog2(0x00000100) + 1] = "SET_GROUP", }; $ So now one can use it in --filter expressions for tracepoints. This silences this perf build warnings: Warning: Kernel ABI header at 'tools/include/uapi/linux/mount.h' differs from latest version at 'include/uapi/linux/mount.h' diff -u tools/include/uapi/linux/mount.h include/uapi/linux/mount.h Cc: Christian Brauner Cc: Pavel Tikhomirov Signed-off-by: Arnaldo Carvalho de Melo commit 155ed9f1b5ff62dd78f102559298a017a7e189c5 Author: Arnaldo Carvalho de Melo Date: Fri Sep 10 12:24:19 2021 -0300 perf beauty: Cover more flags in the move_mount syscall argument beautifier Previously the regext expected MOVE_MOUNT_[FT]_*, but in the next patch a flag that doesn't match that expression will be added, MOVE_MOUNT_SET_GROUP To make this more future proof, take advantage of the fact that the only one we don't need to cover is MOVE_MOUNT__MASK and use MOVE_MOUNT_[^_]+_*_. Signed-off-by: Arnaldo Carvalho de Melo commit 2c3ef25c4a60cc18cf3f05a74c78220748f25684 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: 433c38f40f6a81cf ("arm64: mte: change ASYNC and SYNC TCF settings into bitfields") e893bb1bb4d2eb63 ("x86, prctl: Hook L1D flushing in via prctl") 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: Balbir Singh Cc: Catalin Marinas Cc: Peter Collingbourne Cc: Thomas Gleixner Signed-off-by: Arnaldo Carvalho de Melo commit f9f018e4d9a45a5464861418467b21d3d2ad569c Author: Arnaldo Carvalho de Melo Date: Wed Feb 12 11:04:23 2020 -0300 tools include UAPI: Sync sound/asound.h copy with the kernel sources Picking the changes from: 81be10934949da8b ("ALSA: pcm: Add SNDRV_PCM_INFO_EXPLICIT_SYNC flag") Which entails no changes in the tooling side as it doesn't introduce new ioctls. To silence this perf tools build warning: Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h' diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h Cc: Takashi Iwai Signed-off-by: Arnaldo Carvalho de Melo commit dfa00459c6264abd282452c4878e3a9117db23bb 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: f95937ccf5bd5e0a ("KVM: stats: Support linear and logarithmic histogram statistics") f0376edb1ddcab19 ("KVM: arm64: Add ioctl to fetch/store tags in a guest") ea7fc1bb1cd1b92b ("KVM: arm64: Introduce MTE VM feature") 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/, so that will pick the new KVM_STATS_TYPE_LINEAR_HIST and KVM_STATS_TYPE_LOG_HIST defines. 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: Jing Zhang Cc: Marc Zyngier Cc: Paolo Bonzini Cc: Steven Price Signed-off-by: Arnaldo Carvalho de Melo commit 03d6f3fe54278f8e5ec670e576b8da8b8727ec26 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: 61e5f69ef08379cd ("KVM: x86: implement KVM_GUESTDBG_BLOCKIRQ") 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: Maxim Levitsky Cc: Paolo Bonzini Signed-off-by: Arnaldo Carvalho de Melo commit 291dcb98d7ee5cd719f4c5991d977794b1829c16 Author: Kim Phillips Date: Tue Aug 17 17:15:09 2021 -0500 perf report: Add support to print a textual representation of IBS raw sample data Perf records IBS (Instruction Based Sampling) extra sample data when 'perf record --raw-samples' is used with an IBS-compatible event, on a machine that supports IBS. IBS support is indicated in CPUID_Fn80000001_ECX bit #10. Up until now, users have been able to see the extra sample data solely in raw hex format using 'perf report --dump-raw-trace'. From there, users could decode the data either manually, or by using an external script. Enable the built-in 'perf report --dump-raw-trace' to do the decoding of the extra sample data bits, so manual or external script decoding isn't necessary. Example usage: $ sudo perf record -c 10000001 -a --raw-samples -e ibs_fetch/rand_en=1/,ibs_op/cnt_ctl=1/ -C 0,1 taskset -c 0,1 7za b -mmt2 | perf report --dump-raw-trace Stdout contains IBS Fetch samples, e.g.: ibs_fetch_ctl: 02170007ffffffff MaxCnt 1048560 Cnt 1048560 Lat 7 En 1 Val 1 Comp 1 IcMiss 0 PhyAddrValid 1 L1TlbPgSz 4KB L1TlbMiss 0 L2TlbMiss 0 RandEn 1 L2Miss 0 IbsFetchLinAd: 000056016b2ead40 IbsFetchPhysAd: 000000115cedfd40 c_ibs_ext_ctl: 0000000000000000 IbsItlbRefillLat 0 ..and IBS Op samples, e.g.: ibs_op_ctl: 0000009e009e8968 MaxCnt 10000000 En 1 Val 1 CntCtl 1=uOps CurCnt 158 IbsOpRip: 000056016b2ea73d ibs_op_data: 00000000000b0002 CompToRetCtr 2 TagToRetCtr 11 BrnRet 0 RipInvalid 0 BrnFuse 0 Microcode 0 ibs_op_data2: 0000000000000002 CacheHitSt 0=M-state RmtNode 0 DataSrc 2=Local node cache ibs_op_data3: 0000000000c60002 LdOp 0 StOp 1 DcL1TlbMiss 0 DcL2TlbMiss 0 DcL1TlbHit2M 0 DcL1TlbHit1G 0 DcL2TlbHit2M 0 DcMiss 0 DcMisAcc 0 DcWcMemAcc 0 DcUcMemAcc 0 DcLockedOp 0 DcMissNoMabAlloc 0 DcLinAddrValid 1 DcPhyAddrValid 1 DcL2TlbHit1G 0 L2Miss 0 SwPf 0 OpMemWidth 4 bytes OpDcMissOpenMemReqs 0 DcMissLat 0 TlbRefillLat 0 IbsDCLinAd: 00007f133c319ce0 IbsDCPhysAd: 0000000270485ce0 Committer notes: Fixed up this: util/amd-sample-raw.c: In function ‘evlist__amd_sample_raw’: util/amd-sample-raw.c:125:42: error: ‘ bytes’ directive output may be truncated writing 6 bytes into a region of size between 4 and 7 [-Werror=format-truncation=] 125 | " OpMemWidth %2d bytes", 1 << (reg.op_mem_width - 1)); | ^~~~~~ In file included from /usr/include/stdio.h:866, from util/amd-sample-raw.c:7: /usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 21 and 24 bytes into a destination of size 21 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors As that %2d won't limit the number of chars to 2, just state that 2 is the minimal width: $ cat printf.c #include #include int main(int argc, char *argv[]) { char bf[64]; int len = snprintf(bf, sizeof(bf), "%2d", atoi(argv[1])); printf("strlen(%s): %u\n", bf, len); return 0; } $ ./printf 1 strlen( 1): 2 $ ./printf 12 strlen(12): 2 $ ./printf 123 strlen(123): 3 $ ./printf 1234 strlen(1234): 4 $ ./printf 12345 strlen(12345): 5 $ ./printf 123456 strlen(123456): 6 $ And since we probably don't want that output to be truncated, just assume the worst case, as the compiler did, and add a few more chars to that buffer. Also use sizeof(var) instead of sizeof(dup-of-wanted-format-string) to avoid bugs when changing one but not the other. I also had to change this: -#include +#include "../../arch/x86/include/asm/amd-ibs.h" To make it build on other architectures, just like intel-pt does. Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Boris Ostrovsky Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joao Martins Cc: Konrad Rzeszutek Wilk Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210817221509.88391-4-kim.phillips@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 581b2027af0018944ba301d68e7af45c6d1128b5 Author: David Howells Date: Wed Sep 1 09:15:21 2021 +0100 afs: Fix page leak There's a loop in afs_extend_writeback() that adds extra pages to a write we want to make to improve the efficiency of the writeback by making it larger. This loop stops, however, if we hit a page we can't write back from immediately, but it doesn't get rid of the page ref we speculatively acquired. This was caused by the removal of the cleanup loop when the code switched from using find_get_pages_contig() to xarray scanning as the latter only gets a single page at a time, not a batch. Fix this by putting the page on a ref on an early break from the loop. Unfortunately, we can't just add that page to the pagevec we're employing as we'll go through that and add those pages to the RPC call. This was found by the generic/074 test. It leaks ~4GiB of RAM each time it is run - which can be observed with "top". Fixes: e87b03f5830e ("afs: Prepare for use of THPs") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-and-tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163111666635.283156.177701903478910460.stgit@warthog.procyon.org.uk/ commit 345e1ae0c6ba54f6a4d32154e80cadc2ee2ef1af Author: David Howells Date: Fri Aug 27 23:22:02 2021 +0100 afs: Fix missing put on afs_read objects and missing get on the key therein The afs_read objects created by afs_req_issue_op() get leaked because afs_alloc_read() returns a ref and then afs_fetch_data() gets its own ref which is released when the operation completes, but the initial ref is never released. Fix this by discarding the initial ref at the end of afs_req_issue_op(). This leak also covered another bug whereby a ref isn't got on the key attached to the read record by afs_req_issue_op(). This isn't a problem as long as the afs_read req never goes away... Fix this by calling key_get() in afs_req_issue_op(). This was found by the generic/074 test. It leaks a bunch of kmalloc-192 objects each time it is run, which can be observed by watching /proc/slabinfo. Fixes: f7605fa869cf ("afs: Fix leak of afs_read objects") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-and-tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163010394740.3035676.8516846193899793357.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/163111665914.283156.3038561975681836591.stgit@warthog.procyon.org.uk/ commit dde994dd54fbf84f8fd14230de3477d552e42470 Author: Kim Phillips Date: Tue Aug 17 17:15:08 2021 -0500 perf report: Add tools/arch/x86/include/asm/amd-ibs.h This is a tools/-side patch for the patch that adds the original copy of the IBS header file, in arch/x86/include/asm/. We also add an entry to check-headers.sh, so future changes continue to be copied. Committer notes: Had to add this -#include +#include "msr-index.h" And change the check-headers.sh entry to ignore this line when diffing with the original kernel header. This is needed so that we can use 'perf report' on a perf.data with IBS data on a !x86 system, i.e. building on ARM fails without this as there is no asm/msr-index.h there. This was done on the next patch in this series and is done for things like Intel PT and ARM CoreSight. Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Boris Ostrovsky Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joao Martins Cc: Konrad Rzeszutek Wilk Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210817221509.88391-3-kim.phillips@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 926de8c4326c14fcf35f1de142019043597a4fac Merge: d6498af58f5c7 8fbc1c5b91133 Author: Linus Torvalds Date: Fri Sep 10 13:29:04 2021 -0700 Merge tag 'acpi-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These prevent a confusing PRMT-related message from being printed, drop an unnecessary header file include and update the list of ACPICA maintainers. Specifics: - Prevent a message about missing PRMT from being printed on systems that do not support PRM, which are the majority now (Aubrey Li). - Drop unnecessary header include from scan.c (Kari Argillander). - Update the list of ACPICA maintainers after recent departure of one of them (Rafael Wysocki)" * tag 'acpi-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPICA: Update the list of maintainers ACPI: PRM: Find PRMT table before parsing it ACPI: scan: Remove unneeded header linux/nls.h commit 2f1aaf3ea666b737ad717b3d88667225aca23149 Author: Yonghong Song Date: Thu Sep 9 08:49:59 2021 -0700 bpf, mm: Fix lockdep warning triggered by stack_map_get_build_id_offset() Currently the bpf selftest "get_stack_raw_tp" triggered the warning: [ 1411.304463] WARNING: CPU: 3 PID: 140 at include/linux/mmap_lock.h:164 find_vma+0x47/0xa0 [ 1411.304469] Modules linked in: bpf_testmod(O) [last unloaded: bpf_testmod] [ 1411.304476] CPU: 3 PID: 140 Comm: systemd-journal Tainted: G W O 5.14.0+ #53 [ 1411.304479] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 1411.304481] RIP: 0010:find_vma+0x47/0xa0 [ 1411.304484] Code: de 48 89 ef e8 ba f5 fe ff 48 85 c0 74 2e 48 83 c4 08 5b 5d c3 48 8d bf 28 01 00 00 be ff ff ff ff e8 2d 9f d8 00 85 c0 75 d4 <0f> 0b 48 89 de 48 8 [ 1411.304487] RSP: 0018:ffffabd440403db8 EFLAGS: 00010246 [ 1411.304490] RAX: 0000000000000000 RBX: 00007f00ad80a0e0 RCX: 0000000000000000 [ 1411.304492] RDX: 0000000000000001 RSI: ffffffff9776b144 RDI: ffffffff977e1b0e [ 1411.304494] RBP: ffff9cf5c2f50000 R08: ffff9cf5c3eb25d8 R09: 00000000fffffffe [ 1411.304496] R10: 0000000000000001 R11: 00000000ef974e19 R12: ffff9cf5c39ae0e0 [ 1411.304498] R13: 0000000000000000 R14: 0000000000000000 R15: ffff9cf5c39ae0e0 [ 1411.304501] FS: 00007f00ae754780(0000) GS:ffff9cf5fba00000(0000) knlGS:0000000000000000 [ 1411.304504] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1411.304506] CR2: 000000003e34343c CR3: 0000000103a98005 CR4: 0000000000370ee0 [ 1411.304508] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1411.304510] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1411.304512] Call Trace: [ 1411.304517] stack_map_get_build_id_offset+0x17c/0x260 [ 1411.304528] __bpf_get_stack+0x18f/0x230 [ 1411.304541] bpf_get_stack_raw_tp+0x5a/0x70 [ 1411.305752] RAX: 0000000000000000 RBX: 5541f689495641d7 RCX: 0000000000000000 [ 1411.305756] RDX: 0000000000000001 RSI: ffffffff9776b144 RDI: ffffffff977e1b0e [ 1411.305758] RBP: ffff9cf5c02b2f40 R08: ffff9cf5ca7606c0 R09: ffffcbd43ee02c04 [ 1411.306978] bpf_prog_32007c34f7726d29_bpf_prog1+0xaf/0xd9c [ 1411.307861] R10: 0000000000000001 R11: 0000000000000044 R12: ffff9cf5c2ef60e0 [ 1411.307865] R13: 0000000000000005 R14: 0000000000000000 R15: ffff9cf5c2ef6108 [ 1411.309074] bpf_trace_run2+0x8f/0x1a0 [ 1411.309891] FS: 00007ff485141700(0000) GS:ffff9cf5fae00000(0000) knlGS:0000000000000000 [ 1411.309896] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1411.311221] syscall_trace_enter.isra.20+0x161/0x1f0 [ 1411.311600] CR2: 00007ff48514d90e CR3: 0000000107114001 CR4: 0000000000370ef0 [ 1411.312291] do_syscall_64+0x15/0x80 [ 1411.312941] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1411.313803] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 1411.314223] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1411.315082] RIP: 0033:0x7f00ad80a0e0 [ 1411.315626] Call Trace: [ 1411.315632] stack_map_get_build_id_offset+0x17c/0x260 To reproduce, first build `test_progs` binary: make -C tools/testing/selftests/bpf -j60 and then run the binary at tools/testing/selftests/bpf directory: ./test_progs -t get_stack_raw_tp The warning is due to commit 5b78ed24e8ec ("mm/pagemap: add mmap_assert_locked() annotations to find_vma*()") which added mmap_assert_locked() in find_vma() function. The mmap_assert_locked() function asserts that mm->mmap_lock needs to be held. But this is not the case for bpf_get_stack() or bpf_get_stackid() helper (kernel/bpf/stackmap.c), which uses mmap_read_trylock_non_owner() instead. Since mm->mmap_lock is not held in bpf_get_stack[id]() use case, the above warning is emitted during test run. This patch fixed the issue by (1). using mmap_read_trylock() instead of mmap_read_trylock_non_owner() to satisfy lockdep checking in find_vma(), and (2). droping lockdep for mmap_lock right before the irq_work_queue(). The function mmap_read_trylock_non_owner() is also removed since after this patch nobody calls it any more. Fixes: 5b78ed24e8ec ("mm/pagemap: add mmap_assert_locked() annotations to find_vma*()") Suggested-by: Jason Gunthorpe Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Reviewed-by: Liam R. Howlett Cc: Luigi Rizzo Cc: Jason Gunthorpe Cc: linux-mm@kvack.org Link: https://lore.kernel.org/bpf/20210909155000.1610299-1-yhs@fb.com commit d6498af58f5c7fb7b252f4791620fe4dd7213ca3 Merge: e99f23c5bf592 be2d24336f887 Author: Linus Torvalds Date: Fri Sep 10 13:20:47 2021 -0700 Merge tag 'pm-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These improve hybrid processors support in intel_pstate, fix an issue in the core devices PM code, clean up the handling of dedicated wake IRQs, update the Energy Model documentation and update MAINTAINERS. Specifics: - Make the HWP performance levels calibration on hybrid processors in intel_pstate more straightforward (Rafael Wysocki). - Prevent the PM core from leaving devices in suspend after a failing system-wide suspend transition in some cases when driver PM flags are used (Prasad Sodagudi). - Drop unused function argument from the dedicated wake IRQs handling code (Sergey Shtylyov). - Fix up Energy Model kerneldoc comments and include them in the Energy Model documentation (Lukasz Luba). - Use my kernel.org address in MAINTAINERS insead of the personal one (Rafael Wysocki)" * tag 'pm-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: MAINTAINERS: Change Rafael's e-mail address PM: sleep: core: Avoid setting power.must_resume to false Documentation: power: include kernel-doc in Energy Model doc PM: EM: fix kernel-doc comments cpufreq: intel_pstate: hybrid: Rework HWP calibration ACPI: CPPC: Introduce cppc_get_nominal_perf() PM: sleep: wakeirq: drop useless parameter from dev_pm_attach_wake_irq() commit 094b147c766289baa0f370d124609c3ac2b5a420 Author: Rob Herring Date: Fri Sep 10 11:59:45 2021 -0500 spi: dt-bindings: xilinx: Drop type reference on *-bits properties Properties with standard unit suffixes such as '-bits' don't need a type. Cc: Mark Brown Cc: Michal Simek Cc: linux-spi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210910165945.2852999-1-robh@kernel.org commit 975671241808ffacbe418a1f29965bd9985cc251 Author: Rob Herring Date: Fri Sep 10 11:51:53 2021 -0500 dt-bindings: More use 'enum' instead of 'oneOf' plus 'const' entries 'enum' is equivalent to 'oneOf' with a list of 'const' entries, but 'enum' is more concise and yields better error messages. Fix a couple more cases which have appeared. Cc: Rob Clark Cc: Sean Paul Cc: Mark Brown Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Jonathan Marek Cc: Aswath Govindraju Cc: Marc Zyngier Cc: Linus Walleij Cc: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org Cc: linux-spi@vger.kernel.org Cc: linux-watchdog@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Guenter Roeck Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210910165153.2843871-1-robh@kernel.org commit e99f23c5bf59219d0cd9b6e0d7d4c1b641a98704 Merge: 23ef827c1bacc 85f58eb188982 Author: Linus Torvalds Date: Fri Sep 10 11:58:20 2021 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Limit the linear region to 51-bit when KVM is running in nVHE mode. Otherwise, depending on the placement of the ID map, kernel-VA to hyp-VA translations may produce addresses that either conflict with other HYP mappings or generate addresses outside of the 52-bit addressable range. - Instruct kmemleak not to scan the memory reserved for kdump as this range is removed from the kernel linear map and therefore not accessible. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kdump: Skip kmemleak scan reserved memory for kdump arm64: mm: limit linear region to 51 bits for KVM in nVHE mode commit 23ef827c1bacc6c2b8314ff5bf571d4db57059b0 Merge: 589e5cab17084 671028728083e Author: Linus Torvalds Date: Fri Sep 10 11:52:01 2021 -0700 Merge tag 'for-5.15/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fixes from Helge Deller: - Build warning fixes in Makefile and Dino PCI driver - Fix when sched_clock is marked unstable - Drop strnlen_user() in favour of generic version - Prevent kernel to write outside userspace signal stack - Remove CONFIG_SET_FS including KERNEL_DS and USER_DS from parisc and switch to __get/put_kernel_nofault() * tag 'for-5.15/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Implement __get/put_kernel_nofault() parisc: Mark sched_clock unstable only if clocks are not syncronized parisc: Move pci_dev_is_behind_card_dino to where it is used parisc: Reduce sigreturn trampoline to 3 instructions parisc: Check user signal stack trampoline is inside TASK_SIZE parisc: Drop useless debug info and comments from signal.c parisc: Drop strnlen_user() in favour of generic version parisc: Add missing FORCE prerequisite in Makefile commit 589e5cab170843b2f7f8260168ab2d77163d4384 Merge: 5ffc06ebeaab6 8cc633190b524 Author: Linus Torvalds Date: Fri Sep 10 11:42:03 2021 -0700 Merge tag 'iommu-fixes-v5.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Intel VT-d: - PASID leakage in intel_svm_unbind_mm() - Deadlock in intel_svm_drain_prq() - AMD IOMMU: Fixes for an unhandled page-fault bug when AVIC is used for a KVM guest. - Make CONFIG_IOMMU_DEFAULT_DMA_LAZY architecture instead of IOMMU driver dependent * tag 'iommu-fixes-v5.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: Clarify default domain Kconfig iommu/vt-d: Fix a deadlock in intel_svm_drain_prq() iommu/vt-d: Fix PASID leak in intel_svm_unbind_mm() iommu/amd: Remove iommu_init_ga() iommu/amd: Relocate GAMSup check to early_enable_iommus commit 5ffc06ebeaab65d8e08df6953caf8155df2c45f8 Merge: a668acb8f01fc 4cd67adc44a3c Author: Linus Torvalds Date: Fri Sep 10 11:31:47 2021 -0700 Merge tag 'char-misc-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull habanalabs updates from Greg KH: "Here is another round of misc driver patches for 5.15-rc1. In here is only updates for the Habanalabs driver. This request is late because the previously-objected-to dma-buf patches are all removed and some fixes that you and others found are now included in here as well. All of these have been in linux-next for well over a week with no reports of problems, and they are all self-contained to only this one driver. Full details are in the shortlog" * tag 'char-misc-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (61 commits) habanalabs/gaudi: hwmon default card name habanalabs: add support for f/w reset habanalabs/gaudi: block ICACHE_BASE_ADDERESS_HIGH in TPC habanalabs: cannot sleep while holding spinlock habanalabs: never copy_from_user inside spinlock habanalabs: remove unnecessary device status check habanalabs: disable IRQ in user interrupts spinlock habanalabs: add "in device creation" status habanalabs/gaudi: invalidate PMMU mem cache on init habanalabs/gaudi: size should be printed in decimal habanalabs/gaudi: define DC POWER for secured PMC habanalabs/gaudi: unmask out of bounds SLM access interrupt habanalabs: add userptr_lookup node in debugfs habanalabs/gaudi: fetch TPC/MME ECC errors from F/W habanalabs: modify multi-CS to wait on stream masters habanalabs/gaudi: add monitored SOBs to state dump habanalabs/gaudi: restore user registers when context opens habanalabs/gaudi: increase boot fit timeout habanalabs: update to latest firmware headers habanalabs/gaudi: minimize number of register reads ... commit 8fbc1c5b91133f7ae5254061d2cb3326992635c4 Merge: 22d692baba0a8 66e0aeaa8bae6 3265cc3ec52e7 Author: Rafael J. Wysocki Date: Fri Sep 10 20:27:07 2021 +0200 Merge branches 'acpi-scan' and 'acpi-prm' * acpi-scan: ACPI: scan: Remove unneeded header linux/nls.h * acpi-prm: ACPI: PRM: Find PRMT table before parsing it commit be2d24336f8876d60d8a4634f1a1e4753c4be124 Merge: 3d53afea525f5 46573fd6369f0 4a9344cd0aa44 d62aab8ff711d Author: Rafael J. Wysocki Date: Fri Sep 10 20:26:08 2021 +0200 Merge branches 'pm-cpufreq', 'pm-sleep' and 'pm-em' * pm-cpufreq: cpufreq: intel_pstate: hybrid: Rework HWP calibration ACPI: CPPC: Introduce cppc_get_nominal_perf() * pm-sleep: PM: sleep: core: Avoid setting power.must_resume to false PM: sleep: wakeirq: drop useless parameter from dev_pm_attach_wake_irq() * pm-em: Documentation: power: include kernel-doc in Energy Model doc PM: EM: fix kernel-doc comments commit a668acb8f01fc0d1e3877cddecbe319ef2ef651c Merge: 4396a73115fc8 70982eef4d7ee Author: Linus Torvalds Date: Fri Sep 10 11:22:23 2021 -0700 Merge tag 'drm-next-2021-09-10' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Just an initial bunch of fixes for the merge window, amdgpu is most of them with a few ttm fixes and an fbdev avoid multiply overflow fix. core: - Make some dma-buf config options depend on DMA_SHARED_BUFFER - Handle multiplication overflow of fbdev xres/yres in the core ttm: - Fix ttm_bo_move_memcpy() when ttm_resource is subclassed - Fix ttm deadlock if target BO isn't idle - ttm build fix - ttm docs fix dma-buf: - config option fixes fbdev: - limit resolutions to avoid int overflow i915: - stddef change. amdgpu: - Misc cleanups, typo fixes - EEPROM fix - Add some new PCI IDs - Scatter/Gather display support for Yellow Carp - PCIe DPM fix for RKL platforms - RAS fix amdkfd: - SVM fix vc4: - static function fix mgag200: - fix uninit var panfrost: - lock_region fixes" * tag 'drm-next-2021-09-10' of git://anongit.freedesktop.org/drm/drm: (36 commits) drm/ttm: Fix a deadlock if the target BO is not idle during swap fbmem: don't allow too huge resolutions dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER dma-buf: DMABUF_DEBUG should depend on DMA_SHARED_BUFFER drm/i915: use linux/stddef.h due to "isystem: trim/fixup stdarg.h and other headers" dma-buf: DMABUF_MOVE_NOTIFY should depend on DMA_SHARED_BUFFER drm/amdkfd: drop process ref count when xnack disable drm/amdgpu: enable more pm sysfs under SRIOV 1-VF mode drm/amdgpu: fix fdinfo race with process exit drm/amdgpu: Fix a deadlock if previous GEM object allocation fails drm/amdgpu: stop scheduler when calling hw_fini (v2) drm/amdgpu: Clear RAS interrupt status on aldebaran drm/amd/display: Initialize lt_settings on instantiation drm/amd/display: cleanup idents after a revert drm/amd/display: Fix memory leak reported by coverity drm/ttm: Fix ttm_bo_move_memcpy() for subclassed struct ttm_resource drm/amdgpu/swsmu: fix spelling mistake "minimun" -> "minimum" drm/amdgpu: Disable PCIE_DPM on Intel RKL Platform drm/amdgpu: show both cmd id and name when psp cmd failed drm/amd/display: setup system context for APUs ... commit 4396a73115fc8739083536162e2228c0c0c3ed1a Author: Amir Goldstein Date: Thu Sep 9 14:56:34 2021 +0300 fsnotify: fix sb_connectors leak Fix a leak in s_fsnotify_connectors counter in case of a race between concurrent add of new fsnotify mark to an object. The task that lost the race fails to drop the counter before freeing the unused connector. Following umount() hangs in fsnotify_sb_delete()/wait_var_event(), because s_fsnotify_connectors never drops to zero. Fixes: ec44610fe2b8 ("fsnotify: count all objects with attached connectors") Reported-by: Murphy Zhou Link: https://lore.kernel.org/linux-fsdevel/20210907063338.ycaw6wvhzrfsfdlp@xzhoux.usersys.redhat.com/ Signed-off-by: Amir Goldstein Signed-off-by: Linus Torvalds commit 4a48b66b3f52aa1a8aaa8a8863891eed35769731 Author: Saravana Kannan Date: Thu Sep 9 18:14:45 2021 -0700 of: property: Disable fw_devlink DT support for X86 Andre reported fw_devlink=on breaking OLPC XO-1.5 [1]. OLPC XO-1.5 is an X86 system that uses a mix of ACPI and OF to populate devices. The root cause seems to be ISA devices not setting their fwnode field. But trying to figure out how to fix that doesn't seem worth the trouble because the OLPC devicetree is very sparse/limited and fw_devlink only adds the links causing this issue. Considering that there aren't many users of OF in an X86 system, simply fw_devlink DT support for X86. [1] - https://lore.kernel.org/lkml/3c1f2473-92ad-bfc4-258e-a5a08ad73dd0@web.de/ Fixes: ea718c699055 ("Revert "Revert "driver core: Set fw_devlink=on by default""") Signed-off-by: Saravana Kannan Cc: Andre Muller Acked-by: Greg Kroah-Hartman Tested-by: Andre Müller Link: https://lore.kernel.org/r/20210910011446.3208894-1-saravanak@google.com Signed-off-by: Rob Herring commit 3a3a11e6e5a2bc0595c7e36ae33c861c9e8c75b1 Author: Kees Cook Date: Wed Sep 1 16:34:06 2021 -0700 lkdtm: Use init_uts_ns.name instead of macros Using generated/compile.h triggered a full LKDTM rebuild with every build. Avoid this by using the exported strings instead. Fixes: b8661450bc7f ("lkdtm: Add kernel version to failure hints") Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210901233406.2571643-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 7bd5d979dfdb6c047499a5ac91339bf42f7bdee3 Merge: 1dd038522615b c590fa80b3928 Author: Mark Brown Date: Fri Sep 10 15:46:13 2021 +0100 Merge series "ASoC: fsl: register platform component before registering cpu dai" from Shengjiu Wang : There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. This patch set is to fix this issue for SAI, ESAI, MICFIL, SPDIF, XCVR drivers. Shengjiu Wang (5): ASoC: fsl_sai: register platform component before registering cpu dai ASoC: fsl_esai: register platform component before registering cpu dai ASoC: fsl_micfil: register platform component before registering cpu dai ASoC: fsl_spdif: register platform component before registering cpu dai ASoC: fsl_xcvr: register platform component before registering cpu dai sound/soc/fsl/fsl_esai.c | 16 ++++++++++------ sound/soc/fsl/fsl_micfil.c | 15 ++++++++++----- sound/soc/fsl/fsl_sai.c | 14 +++++++++----- sound/soc/fsl/fsl_spdif.c | 14 +++++++++----- sound/soc/fsl/fsl_xcvr.c | 15 ++++++++++----- 5 files changed, 48 insertions(+), 26 deletions(-) -- 2.17.1 commit 9fe8895a27a840095281864803b128ddc26dcd30 Author: Kim Phillips Date: Tue Aug 17 17:15:07 2021 -0500 perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings To be used by IBS raw data display: It needs the recorder's cpuid in order to determine which errata workarounds to apply to the data, and the pmu_mappings are needed in order to figure out which PMU sample type is IBS Fetch vs. IBS Op. When not available from perf.data, we assume local operation, and retrieve cpuid and pmu mappings directly from the running system. Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Boris Ostrovsky Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joao Martins Cc: Konrad Rzeszutek Wilk Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210817221509.88391-2-kim.phillips@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit d2930ede5218be28413a00130a6895d14393c325 Author: Remi Bernon Date: Thu Sep 9 21:26:36 2021 +0200 perf symbol: Look for ImageBase in PE file to compute .text offset Instead of using the file offset in the debug file. This fixes a regression from 00a3423492bc90be ("perf symbols: Make dso__load_bfd_symbols() load PE files from debug cache only"), causing incorrect symbol resolution when debug file have been stripped from non-debug sections (in which case its .text section is empty and doesn't have any file position). The debug files could also be created with a different file alignment, and have different file positions from the mmap-ed binary, or have the section reordered. This instead looks for the file image base, using the corresponding bfd *ABS* symbols. As PE symbols only have 4 bytes, it also needs to keep .text section vma high bits. Signed-off-by: Remi Bernon Fixes: 00a3423492bc90be ("perf symbols: Make dso__load_bfd_symbols() load PE files from debug cache only") Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Nicholas Fraser Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210909192637.4139125-1-rbernon@codeweavers.com Signed-off-by: Arnaldo Carvalho de Melo commit 51ae7fa62dcb0ab96ea5f83aec254a1fb6d4d371 Author: Michael Petlan Date: Mon Apr 27 16:23:27 2020 +0200 perf scripts python: Fix passing arguments to stackcollapse report The '--' prevented arguments from being passed to the script, such as: $ perf script report stackcollapse -i my_perf.data Signed-off-by: Michael Petlan Cc: Jiri Olsa Cc: Paolo Bonzini LPU-Reference: 20200427142327.21172-1-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e11300cdfd5f1bc13a05dfc6dccf69aca5dd1dc Author: Michael Petlan Date: Thu Aug 5 18:06:11 2021 +0200 perf test: Fix bpf test sample mismatch reporting When the expected sample count in the condition changed, the message needs to be changed too, otherwise we'll get: 0x1001f2091d8: mmap mask[0]: BPF filter result incorrect, expected 56, got 56 samples Fixes: 4b04e0decd2518e5 ("perf test: Fix basic bpf filtering test") Signed-off-by: Michael Petlan Cc: Jiri Olsa Cc: Sumanth Korikkar Link: https //lore.kernel.org/r/20210805160611.5542-1-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 64f4535166aa11d5bad53a058af036f2e216ad17 Author: Arnaldo Carvalho de Melo Date: Wed Sep 8 16:09:08 2021 -0300 tools headers UAPI: Sync files changed by new process_mrelease syscall and the removal of some compat entry points To pick the changes in these csets: 59ab844eed9c6b01 ("compat: remove some compat entry points") dce49103962840dd ("mm: wire up syscall process_mrelease") b48c7236b13cb5ef ("exit/bdflush: Remove the deprecated bdflush system call") That add support for this new syscall in tools such as 'perf trace'. For instance, this is now possible: # perf trace -v -e process_mrelease event qualifier tracepoint filter: (common_pid != 19351 && common_pid != 9112) && (id == 448) ^C# That is the filter expression attached to the raw_syscalls:sys_{enter,exit} tracepoints. $ grep process_mrelease tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 448 common process_mrelease sys_process_mrelease $ This addresses these perf build warnings: Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h' diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl' diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl' diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl Warning: Kernel ABI header at 'tools/perf/arch/s390/entry/syscalls/syscall.tbl' differs from latest version at 'arch/s390/kernel/syscalls/syscall.tbl' diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl' diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl Cc: Arnd Bergmann Cc: Eric W. Biederman Cc: Linus Torvalds Cc: Suren Baghdasaryan Signed-off-by: Arnaldo Carvalho de Melo commit 1dd038522615b70f5f8945c5631e9e2fa5bd58b1 Author: Trevor Wu Date: Fri Sep 10 17:26:13 2021 +0800 ASoC: mediatek: common: handle NULL case in suspend/resume function When memory allocation for afe->reg_back_up fails, reg_back_up can't be used. Keep the suspend/resume flow but skip register backup when afe->reg_back_up is NULL, in case illegal memory access happens. Fixes: 283b612429a2 ("ASoC: mediatek: implement mediatek common structure") Signed-off-by: Trevor Wu Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/20210910092613.30188-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit c590fa80b39287a91abeb487829f3190e7ae775f Author: Shengjiu Wang Date: Fri Sep 3 18:30:06 2021 +0800 ASoC: fsl_xcvr: register platform component before registering cpu dai There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-6-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit ee8ccc2eb5840e34fce088bdb174fd5329153ef0 Author: Shengjiu Wang Date: Fri Sep 3 18:30:05 2021 +0800 ASoC: fsl_spdif: register platform component before registering cpu dai There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: a2388a498ad2 ("ASoC: fsl: Add S/PDIF CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-5-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 0adf292069dcca8bab76a603251fcaabf77468ca Author: Shengjiu Wang Date: Fri Sep 3 18:30:04 2021 +0800 ASoC: fsl_micfil: register platform component before registering cpu dai There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: 47a70e6fc9a8 ("ASoC: Add MICFIL SoC Digital Audio Interface driver.") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit f12ce92e98b21c1fc669cd74e12c54a0fe3bc2eb Author: Shengjiu Wang Date: Fri Sep 3 18:30:03 2021 +0800 ASoC: fsl_esai: register platform component before registering cpu dai There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: 43d24e76b698 ("ASoC: fsl_esai: Add ESAI CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 9c3ad33b5a412d8bc0a377e7cd9baa53ed52f22d Author: Shengjiu Wang Date: Fri Sep 3 18:30:02 2021 +0800 ASoC: fsl_sai: register platform component before registering cpu dai There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: 435508214942 ("ASoC: Add SAI SoC Digital Audio Interface driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit bb91de44693b1c10fe2f9e668506b01e88efed0e Author: Arnaldo Carvalho de Melo Date: Mon Sep 6 11:57:46 2021 -0300 perf beauty: Update copy of linux/socket.h with the kernel sources To pick the changes in: Fixes: d32f89da7fa8ccc8 ("net: add accept helper not installing fd") Fixes: bc49d8169aa72295 ("mctp: Add MCTP base") This automagically adds support for the AF_MCTP protocol domain: $ tools/perf/trace/beauty/socket.sh > before $ cp include/linux/socket.h tools/perf/trace/beauty/include/linux/socket.h $ tools/perf/trace/beauty/socket.sh > after $ diff -u before after --- before 2021-09-06 11:57:14.972747200 -0300 +++ after 2021-09-06 11:57:30.541920222 -0300 @@ -44,4 +44,5 @@ [42] = "QIPCRTR", [43] = "SMC", [44] = "XDP", + [45] = "MCTP", }; $ This will allow 'perf trace' to translate 45 into "MCTP" as is done with the other domains: # perf trace -e socket* 0.000 chronyd/1029 socket(family: INET, type: DGRAM|CLOEXEC|NONBLOCK, protocol: IP) = 4 ^C# This addresses 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: David S. Miller Cc: Jens Axboe Cc: Jeremy Kerr Cc: Pavel Begunkov Signed-off-by: Arnaldo Carvalho de Melo commit 666eb96d85dcbc93aacc186a037db2e05b92b9f5 Author: Colin Ian King Date: Fri Sep 10 12:15:11 2021 +0100 qlcnic: Remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 3d53afea525f5812da782624014e7910ba731b34 Author: Rafael J. Wysocki Date: Fri Sep 10 14:45:57 2021 +0200 MAINTAINERS: Change Rafael's e-mail address I have been slow to respond to messages going to rjw@rjwysocki.net recently, so change it to rafael@kernel.org (which works better for me) in MAINTAINERS. Signed-off-by: Rafael J. Wysocki commit 22d692baba0a899bc448d2f90ad006a5b04d99a8 Author: Rafael J. Wysocki Date: Fri Sep 10 14:42:51 2021 +0200 ACPICA: Update the list of maintainers Erik Kaneda will not be maintaining ACPICA any more, so drop his address (which doesn't work any more anyway) from the maintainer list. Signed-off-by: Rafael J. Wysocki commit 32c2d33e0b7c4ea53284d5d9435dd022b582c8cf Author: Hao Xu Date: Tue Sep 7 11:22:43 2021 +0800 io_uring: fix off-by-one in BUILD_BUG_ON check of __REQ_F_LAST_BIT Build check of __REQ_F_LAST_BIT should be larger than, not equal or larger than. It's perfectly valid to have __REQ_F_LAST_BIT be 32, as that means that the last valid bit is 31 which does fit in the type. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210907032243.114190-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 85f58eb1889826b9745737718723a80b639e0fbd Author: Chen Wandun Date: Fri Sep 10 14:48:44 2021 +0800 arm64: kdump: Skip kmemleak scan reserved memory for kdump Trying to boot with kdump + kmemleak, command will result in a crash: "echo scan > /sys/kernel/debug/kmemleak" crashkernel reserved: 0x0000000007c00000 - 0x0000000027c00000 (512 MB) Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-rc5-next-20210809+ root=/dev/mapper/ao-root ro rd.lvm.lv=ao/root rd.lvm.lv=ao/swap crashkernel=512M Unable to handle kernel paging request at virtual address ffff000007c00000 Mem abort info: ESR = 0x96000007 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x07: level 3 translation fault Data abort info: ISV = 0, ISS = 0x00000007 CM = 0, WnR = 0 swapper pgtable: 64k pages, 48-bit VAs, pgdp=00002024f0d80000 [ffff000007c00000] pgd=1800205ffffd0003, p4d=1800205ffffd0003, pud=1800205ffffd0003, pmd=1800205ffffc0003, pte=0068000007c00f06 Internal error: Oops: 96000007 [#1] SMP pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : scan_block+0x98/0x230 lr : scan_block+0x94/0x230 sp : ffff80008d6cfb70 x29: ffff80008d6cfb70 x28: 0000000000000000 x27: 0000000000000000 x26: 00000000000000c0 x25: 0000000000000001 x24: 0000000000000000 x23: ffffa88a6b18b398 x22: ffff000007c00ff9 x21: ffffa88a6ac7fc40 x20: ffffa88a6af6a830 x19: ffff000007c00000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: ffffffffffffffff x14: ffffffff00000000 x13: ffffffffffffffff x12: 0000000000000020 x11: 0000000000000000 x10: 0000000001080000 x9 : ffffa88a6951c77c x8 : ffffa88a6a893988 x7 : ffff203ff6cfb3c0 x6 : ffffa88a6a52b3c0 x5 : ffff203ff6cfb3c0 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000001 x1 : ffff20226cb56a40 x0 : 0000000000000000 Call trace: scan_block+0x98/0x230 scan_gray_list+0x120/0x270 kmemleak_scan+0x3a0/0x648 kmemleak_write+0x3ac/0x4c8 full_proxy_write+0x6c/0xa0 vfs_write+0xc8/0x2b8 ksys_write+0x70/0xf8 __arm64_sys_write+0x24/0x30 invoke_syscall+0x4c/0x110 el0_svc_common+0x9c/0x190 do_el0_svc+0x30/0x98 el0_svc+0x28/0xd8 el0t_64_sync_handler+0x90/0xb8 el0t_64_sync+0x180/0x184 The reserved memory for kdump will be looked up by kmemleak, this area will be set invalid when kdump service is bring up. That will result in crash when kmemleak scan this area. Fixes: a7259df76702 ("memblock: make memblock_find_in_range method private") Signed-off-by: Chen Wandun Reviewed-by: Kefeng Wang Reviewed-by: Mike Rapoport Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210910064844.3827813-1-chenwandun@huawei.com Signed-off-by: Catalin Marinas commit 20e100f52730cd0db609e559799c1712b5f27582 Author: Shai Malin Date: Fri Sep 10 11:33:56 2021 +0300 qed: Handle management FW error Handle MFW (management FW) error response in order to avoid a crash during recovery flows. Changes from v1: - Add "Fixes tag". Fixes: tag 5e7ba042fd05 ("qed: Fix reading stale configuration information") Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit dc41c4a98a76640e7085815f937eadd1f336ba85 Author: Baruch Siach Date: Thu Sep 9 20:49:47 2021 +0300 net/packet: clarify source of pr_*() messages Add pr_fmt macro to spell out the source of messages in prefix. Before this patch: packet size is too long (1543 > 1518) With this patch: af_packet: packet size is too long (1543 > 1518) Signed-off-by: Baruch Siach Signed-off-by: David S. Miller commit e3f0cc1a945fcefec0c7c9d9dfd028a51daa1846 Author: Florian Fainelli Date: Thu Sep 9 10:33:28 2021 -0700 r6040: Restore MDIO clock frequency after MAC reset A number of users have reported that they were not able to get the PHY to successfully link up, especially after commit c36757eb9dee ("net: phy: consider AN_RESTART status when reading link status") where we stopped reading just BMSR, but we also read BMCR to determine the link status. Andrius at NetBSD did a wonderful job at debugging the problem and found out that the MDIO bus clock frequency would be incorrectly set back to its default value which would prevent the MDIO bus controller from reading PHY registers properly. Back when we only read BMSR, if we read all 1s, we could falsely indicate a link status, though in general there is a cable plugged in, so this went unnoticed. After a second read of BMCR was added, a wrong read will lead to the inability to determine a link UP condition which is when it started to be visibly broken, even if it was long before that. The fix consists in restoring the value of the MD_CSR register that was set prior to the MAC reset. Link: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=53494 Fixes: 90f750a81a29 ("r6040: consolidate MAC reset to its own function") Reported-by: Andrius V Reported-by: Darek Strugacz Tested-by: Darek Strugacz Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit bfe84435090a6c85271b02a42b1d83fef9ff7cc7 Author: Dave Ertman Date: Thu Sep 9 08:12:23 2021 -0700 ice: Correctly deal with PFs that do not support RDMA There are two cases where the current PF does not support RDMA functionality. The first is if the NVM loaded on the device is set to not support RDMA (common_caps.rdma is false). The second is if the kernel bonding driver has included the current PF in an active link aggregate. When the driver has determined that this PF does not support RDMA, then auxiliary devices should not be created on the auxiliary bus. Without a device on the auxiliary bus, even if the irdma driver is present, there will be no RDMA activity attempted on this PF. Currently, in the reset flow, an attempt to create auxiliary devices is performed without regard to the ability of the PF. There needs to be a check in ice_aux_plug_dev (as the central point that creates auxiliary devices) to see if the PF is in a state to support the functionality. When disabling and re-enabling RDMA due to the inclusion/removal of the PF in a link aggregate, we also need to set/clear the bit which controls auxiliary device creation so that a reset recovery in a link aggregate situation doesn't try to create auxiliary devices when it shouldn't. Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") Reported-by: Yongxin Liu Signed-off-by: Dave Ertman Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 70982eef4d7eebb47a3b1ef25ec1bc742f3a21cf Author: xinhui pan Date: Tue Sep 7 12:08:32 2021 +0800 drm/ttm: Fix a deadlock if the target BO is not idle during swap The ret value might be -EBUSY, caller will think lru lock is still locked but actually NOT. So return -ENOSPC instead. Otherwise we hit list corruption. ttm_bo_cleanup_refs might fail too if BO is not idle. If we return 0, caller(ttm_tt_populate -> ttm_global_swapout ->ttm_device_swapout) will be stuck as we actually did not free any BO memory. This usually happens when the fence is not signaled for a long time. Signed-off-by: xinhui pan Reviewed-by: Christian König Fixes: ebd59851c796 ("drm/ttm: move swapout logic around v3") Link: https://patchwork.freedesktop.org/patch/msgid/20210907040832.1107747-1-xinhui.pan@amd.com Signed-off-by: Christian König Signed-off-by: Dave Airlie commit b011522c8a6ff2b5f11a9ba0ba537352919d6abb Merge: de04744d658bb 8c28051cdcbe9 Author: Dave Airlie Date: Fri Sep 10 14:18:33 2021 +1000 Merge tag 'drm-misc-next-fixes-2021-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next-fixes for v5.15: - Make some dma-buf config options depend on DMA_SHARED_BUFFER. - Handle multiplication overflow of fbdev xres/yres in the core. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/37c5fe2e-5be8-45c3-286b-d8d536a5cef2@linux.intel.com commit bf9f243f23e6623f310ba03fbb14e10ec3a61290 Merge: 8dde20867c443 4cf0ccd033d9c Author: Linus Torvalds Date: Thu Sep 9 16:17:14 2021 -0700 Merge tag '5.15-rc-ksmbd-part2' of git://git.samba.org/ksmbd Pull ksmbd fixes from Steve French: - various fixes pointed out by coverity, and a minor cleanup patch - id mapping and ownership fixes - an smbdirect fix * tag '5.15-rc-ksmbd-part2' of git://git.samba.org/ksmbd: ksmbd: fix control flow issues in sid_to_id() ksmbd: fix read of uninitialized variable ret in set_file_basic_info ksmbd: add missing assignments to ret on ndr_read_int64 read calls ksmbd: add validation for ndr read/write functions ksmbd: remove unused ksmbd_file_table_flush function ksmbd: smbd: fix dma mapping error in smb_direct_post_send_data ksmbd: Reduce error log 'speed is unknown' to debug ksmbd: defer notify_change() call ksmbd: remove setattr preparations in set_file_basic_info() ksmbd: ensure error is surfaced in set_file_basic_info() ndr: fix translation in ndr_encode_posix_acl() ksmbd: fix translation in sid_to_id() ksmbd: fix subauth 0 handling in sid_to_id() ksmbd: fix translation in acl entries ksmbd: fix translation in ksmbd_acls_fattr() ksmbd: fix translation in create_posix_rsp_buf() ksmbd: fix translation in smb2_populate_readdir_entry() ksmbd: fix lookup on idmapped mounts commit 5dfe50b05588010f347cb2f436434bf22b7a84ed Author: Masami Hiramatsu Date: Thu Sep 9 22:36:38 2021 +0900 bootconfig: Rename xbc_node_find_child() to xbc_node_find_subkey() Rename xbc_node_find_child() to xbc_node_find_subkey() for clarifying that function returns a key node (no value node). Since there are xbc_node_for_each_child() (loop on all child nodes) and xbc_node_for_each_subkey() (loop on only subkey nodes), this name distinction is necessary to avoid confusing users. Link: https://lkml.kernel.org/r/163119459826.161018.11200274779483115300.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 5f8895b27da2656e5e2be029acfb68c016f03326 Author: Masami Hiramatsu Date: Thu Sep 9 22:36:30 2021 +0900 tracing/boot: Fix to check the histogram control param is a leaf node Since xbc_node_find_child() doesn't ensure the returned node is a leaf node (key-value pair or do not have subkeys), use xbc_node_find_value to ensure the histogram control parameter is a leaf node in trace_boot_compose_hist_cmd(). Link: https://lkml.kernel.org/r/163119459059.161018.18341288218424528962.stgit@devnote2 Fixes: e66ed86ca6c5 ("tracing/boot: Add per-event histogram action options") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit a3928f877e7b153dbc243d6329b3777ac75b6004 Author: Masami Hiramatsu Date: Thu Sep 9 22:36:23 2021 +0900 tracing/boot: Fix trace_boot_hist_add_array() to check array is value trace_boot_hist_add_array() uses the combination of xbc_node_find_child() and xbc_node_get_child() to get the child node of the key node. But since it missed to check the child node is data node or not, user can pass the subkey node for the array node (anode). To avoid this issue, check the array node is a data node. Actually, there is xbc_node_find_value(node, key, vnode), which ensures the @vnode is a value node, so use it in trace_boot_hist_add_array() to fix this issue. Link: https://lkml.kernel.org/r/163119458308.161018.1516455973625940212.stgit@devnote2 Fixes: e66ed86ca6c5 ("tracing/boot: Add per-event histogram action options") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 8dde20867c443aedf6d64d8a494e8703d7ba53cb Merge: ae79394a62853 f79645df80656 Author: Linus Torvalds Date: Thu Sep 9 16:09:56 2021 -0700 Merge tag 'for-5.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix max_inline mount option limit on 64k page system - lockdep fixes: - update bdev time in a safer way - move bdev put outside of sb write section when removing device - fix possible deadlock when mounting seed/sprout filesystem - zoned mode: fix split extent accounting - minor include fixup * tag 'for-5.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: zoned: fix double counting of split ordered extent btrfs: fix lockdep warning while mounting sprout fs btrfs: delay blkdev_put until after the device remove btrfs: update the bdev time directly when closing btrfs: use correct header for div_u64 in misc.h btrfs: fix upper limit for max_inline for page size 64K commit ae79394a628530372e3b0aae4cb9e6495186558c Merge: d6c338a741295 25fca8c9e0d79 Author: Linus Torvalds Date: Thu Sep 9 16:05:10 2021 -0700 Merge tag 'sound-fix-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes that have been gathered before rc1, including a few regression fixes for the problem in the previous pull request" * tag 'sound-fix-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: gus: Fix repeated probe for ISA interwave card ALSA: gus: Fix repeated probes of snd_gus_create() ALSA: vx222: fix null-ptr-deref ASoC: rockchip: i2s: Fix concurrency between tx/rx ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP ALSA: usb-audio: Add registration quirk for JBL Quantum 800 ASoC: rt5682: fix headset background noise when S3 state ASoC: dt-bindings: mt8195: remove dependent headers in the example ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device" ASoC: audio-graph: respawn Platform Support ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency commit 9351590f51cdda49d0265932a37f099950998504 Author: Enzo Matsumiya Date: Thu Sep 9 18:46:45 2021 -0300 cifs: properly invalidate cached root handle when closing it Cached root file was not being completely invalidated sometimes. Reproducing: - With a DFS share with 2 targets, one disabled and one enabled - start some I/O on the mount # while true; do ls /mnt/dfs; done - at the same time, disable the enabled target and enable the disabled one - wait for DFS cache to expire - on reconnect, the previous cached root handle should be invalid, but open_cached_dir_by_dentry() will still try to use it, but throws a use-after-free warning (kref_get()) Make smb2_close_cached_fid() invalidate all fields every time, but only send an SMB2_close() when the entry is still valid. Signed-off-by: Enzo Matsumiya Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 671028728083e856e9919221b109e3b2cd2ccc49 Author: Helge Deller Date: Thu Sep 9 12:47:00 2021 +0200 parisc: Implement __get/put_kernel_nofault() Remove CONFIG_SET_FS from parisc, so we need to add __get_kernel_nofault() and __put_kernel_nofault(), define HAVE_GET_KERNEL_NOFAULT and remove set_fs(), get_fs(), load_sr2(), thread_info->addr_limit, KERNEL_DS and USER_DS. The nice side-effect of this patch is that we now can directly access userspace via sr3 without the need to use a temporary sr2 which is either copied from sr3 or set to zero (for kernel space). Signed-off-by: Helge Deller Suggested-by: Arnd Bergmann commit d6c338a741295c04ed84679153448b2fffd2c9cf Merge: 35776f10513c0 adf9ae0d159d3 Author: Linus Torvalds Date: Thu Sep 9 13:45:26 2021 -0700 Merge tag 'for-linus-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - Support for VMAP_STACK - Support for splice_write in hostfs - Fixes for virt-pci - Fixes for virtio_uml - Various fixes * tag 'for-linus-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: fix stub location calculation um: virt-pci: fix uapi documentation um: enable VMAP_STACK um: virt-pci: don't do DMA from stack hostfs: support splice_write um: virtio_uml: fix memory leak on init failures um: virtio_uml: include linux/virtio-uml.h lib/logic_iomem: fix sparse warnings um: make PCI emulation driver init/exit static commit 35776f10513c0d523c5dd2f1b415f642497779e2 Merge: 43175623dd0df 6c974e79d3760 Author: Linus Torvalds Date: Thu Sep 9 13:25:49 2021 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM development updates from Russell King: - Rename "mod_init" and "mod_exit" so that initcall debug output is actually useful (Randy Dunlap) - Update maintainers entries for linux-arm-kernel to indicate it is moderated for non-subscribers (Randy Dunlap) - Move install rules to arch/arm/Makefile (Masahiro Yamada) - Drop unnecessary ARCH_NR_GPIOS definition (Linus Walleij) - Don't warn about atags_to_fdt() stack size (David Heidelberg) - Speed up unaligned copy_{from,to}_kernel_nofault (Arnd Bergmann) - Get rid of set_fs() usage (Arnd Bergmann) - Remove checks for GCC prior to v4.6 (Geert Uytterhoeven) * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9118/1: div64: Remove always-true __div64_const32_is_OK() duplicate ARM: 9117/1: asm-generic: div64: Remove always-true __div64_const32_is_OK() ARM: 9116/1: unified: Remove check for gcc < 4 ARM: 9110/1: oabi-compat: fix oabi epoll sparse warning ARM: 9113/1: uaccess: remove set_fs() implementation ARM: 9112/1: uaccess: add __{get,put}_kernel_nofault ARM: 9111/1: oabi-compat: rework fcntl64() emulation ARM: 9114/1: oabi-compat: rework sys_semtimedop emulation ARM: 9108/1: oabi-compat: rework epoll_wait/epoll_pwait emulation ARM: 9107/1: syscall: always store thread_info->abi_syscall ARM: 9109/1: oabi-compat: add epoll_pwait handler ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs() ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault ARM: 9105/1: atags_to_fdt: don't warn about stack size ARM: 9103/1: Drop ARCH_NR_GPIOS definition ARM: 9102/1: move theinstall rules to arch/arm/Makefile ARM: 9100/1: MAINTAINERS: mark all linux-arm-kernel@infradead list as moderated ARM: 9099/1: crypto: rename 'mod_init' & 'mod_exit' functions to be module-specific commit 221e8360834c59f0c9952630fa5904a94ebd2bb8 Author: Yang Yingliang Date: Thu Sep 9 17:06:08 2021 +0800 n64cart: fix return value check in n64cart_probe() In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d9b2a2bbbb4d ("block: Add n64 cart driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20210909090608.2989716-1-yangyingliang@huawei.com Signed-off-by: Jens Axboe commit 43175623dd0dffccacbf014e368ee77f77c73898 Merge: f154c806676ad cfd799837dbc4 Author: Linus Torvalds Date: Thu Sep 9 13:11:15 2021 -0700 Merge tag 'trace-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull more tracing updates from Steven Rostedt: - Add migrate-disable counter to tracing header - Fix error handling in event probes - Fix missed unlock in osnoise in error path - Fix merge issue with tools/bootconfig - Clean up bootconfig data when init memory is removed - Fix bootconfig to loop only on subkeys - Have kernel command lines override bootconfig options - Increase field counts for synthetic events - Have histograms dynamic allocate event elements to save space - Fixes in testing and documentation * tag 'trace-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/boot: Fix to loop on only subkeys selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events tracing: Dynamically allocate the per-elt hist_elt_data array tracing: synth events: increase max fields count tools/bootconfig: Show whole test command for each test case bootconfig: Fix missing return check of xbc_node_compose_key function tools/bootconfig: Fix tracing_on option checking in ftrace2bconf.sh docs: bootconfig: Add how to use bootconfig for kernel parameters init/bootconfig: Reorder init parameter from bootconfig and cmdline init: bootconfig: Remove all bootconfig data when the init memory is removed tracing/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthreads() tracing: Fix some alloc_event_probe() error handling bugs tracing: Add migrate-disabled counter to tracing output. commit f154c806676ad7153c6e161f30c53a44855329d6 Merge: 7b871c7713d1e bb9c14ad267d2 Author: Linus Torvalds Date: Thu Sep 9 12:55:12 2021 -0700 Merge tag 's390-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Heiko Carstens: "Except for the xpram device driver removal it is all about fixes and cleanups. - Fix topology update on cpu hotplug, so notifiers see expected masks. This bug was uncovered with SCHED_CORE support. - Fix stack unwinding so that the correct number of entries are omitted like expected by common code. This fixes KCSAN selftests. - Add kmemleak annotation to stack_alloc to avoid false positive kmemleak warnings. - Avoid layering violation in common I/O code and don't unregister subchannel from child-drivers. - Remove xpram device driver for which no real use case exists since the kernel is 64 bit only. Also all hypervisors got required support removed in the meantime, which means the xpram device driver is dead code. - Fix -ENODEV handling of clp_get_state in our PCI code. - Enable KFENCE in debug defconfig. - Cleanup hugetlbfs s390 specific Kconfig dependency. - Quite a lot of trivial fixes to get rid of "W=1" warnings, and and other simple cleanups" * tag 's390-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: hugetlbfs: s390 is always 64bit s390/ftrace: remove incorrect __va usage s390/zcrypt: remove incorrect kernel doc indicators scsi: zfcp: fix kernel doc comments s390/sclp: add __nonstring annotation s390/hmcdrv_ftp: fix kernel doc comment s390: remove xpram device driver s390/pci: read clp_list_pci_req only once s390/pci: fix clp_get_state() handling of -ENODEV s390/cio: fix kernel doc comment s390/ctrlchar: fix kernel doc comment s390/con3270: use proper type for tasklet function s390/cpum_cf: move array from header to C file s390/mm: fix kernel doc comments s390/topology: fix topology information when calling cpu hotplug notifiers s390/unwind: use current_frame_address() to unwind current task s390/configs: enable CONFIG_KFENCE in debug_defconfig s390/entry: make oklabel within CHKSTG macro local s390: add kmemleak annotation in stack_alloc() s390/cio: dont unregister subchannel from child-drivers commit 7b871c7713d1eafc3a614883bbdf68ab1dffa883 Merge: e2e694b9e6f3e d75b9fa053e4c Author: Linus Torvalds Date: Thu Sep 9 12:45:26 2021 -0700 Merge branch 'work.gfs2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull gfs2 setattr updates from Al Viro: "Make it possible for filesystems to use a generic 'may_setattr()' and switch gfs2 to using it" * 'work.gfs2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: gfs2: Switch to may_setattr in gfs2_setattr fs: Move notify_change permission checks into may_setattr commit e2e694b9e6f3ec7deeb233b6b0fe20b6a47b304b Merge: 7b7699c09f66f 6e7c1770a2122 Author: Linus Torvalds Date: Thu Sep 9 12:38:18 2021 -0700 Merge branch 'work.init' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull root filesystem type handling updates from Al Viro: "Teach init/do_mounts.c to handle non-block filesystems, hopefully preventing even more special-cased kludges (such as root=/dev/nfs, etc)" * 'work.init' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: simplify get_filesystem_list / get_all_fs_names init: allow mounting arbitrary non-blockdevice filesystems as root init: split get_fs_names commit 7b7699c09f66f180b9a8a5010df352acb8683bfa Merge: 70868a180501d 89c2b3b749182 Author: Linus Torvalds Date: Thu Sep 9 12:13:46 2021 -0700 Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull iov_iter fixes from Al Viro: "Fixes for io-uring handling of iov_iter reexpands" * 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: io_uring: reexpand under-reexpanded iters iov_iter: track truncated size commit 70868a180501d17fea58153c649d56bc18435315 Merge: 2e5fd489a4e5f 2b922a9d064f8 Author: Linus Torvalds Date: Thu Sep 9 11:48:27 2021 -0700 Merge tag 'cxl-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL (Compute Express Link) updates from Dan Williams: - Fix detection of CXL host bridges to filter out disabled ACPI0016 devices in the ACPI DSDT. - Fix kernel lockdown integration to disable raw commands when raw PCI access is disabled. - Fix a broken debug message. - Add support for "Get Partition Info". I.e. enumerate the split between volatile and persistent capacity on bi-modal CXL memory expanders. - Re-factor the core by subject area. This is a work in progress. - Prepare libnvdimm to understand CXL labels in addition to EFI labels. This is a work in progress. * tag 'cxl-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (25 commits) cxl/registers: Fix Documentation warning cxl/pmem: Fix Documentation warning cxl/uapi: Fix defined but not used warnings cxl/pci: Fix debug message in cxl_probe_regs() cxl/pci: Fix lockdown level cxl/acpi: Do not add DSDT disabled ACPI0016 host bridge ports libnvdimm/labels: Add claim class helpers libnvdimm/labels: Add type-guid helpers libnvdimm/labels: Add blk special cases for nlabel and position helpers libnvdimm/labels: Add blk isetcookie set / validation helpers libnvdimm/labels: Add a checksum calculation helper libnvdimm/labels: Introduce label setter helpers libnvdimm/labels: Add isetcookie validation helper libnvdimm/labels: Introduce getters for namespace label fields cxl/mem: Adjust ram/pmem range to represent DPA ranges cxl/mem: Account for partitionable space in ram/pmem ranges cxl/pci: Store memory capacity values cxl/pci: Simplify register setup cxl/pci: Ignore unknown register block types cxl/core: Move memdev management to core ... commit 2e5fd489a4e5fcc97b035c03ace724c1d481a4c1 Merge: 4b105f4a256ae 3fc3725357414 Author: Linus Torvalds Date: Thu Sep 9 11:39:57 2021 -0700 Merge tag 'libnvdimm-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: - Fix a race condition in the teardown path of raw mode pmem namespaces. - Cleanup the code that filesystems use to detect filesystem-dax capabilities of their underlying block device. * tag 'libnvdimm-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: remove bdev_dax_supported xfs: factor out a xfs_buftarg_is_dax helper dax: stub out dax_supported for !CONFIG_FS_DAX dax: remove __generic_fsdax_supported dax: move the dax_read_lock() locking into dax_supported dax: mark dax_get_by_host static dm: use fs_dax_get_by_bdev instead of dax_get_by_host dax: stop using bdevname fsdax: improve the FS_DAX Kconfig description and help text libnvdimm/pmem: Fix crash triggered when I/O in-flight during unbind commit 4b105f4a256ae629522a7ed1611aba28fd282bd5 Merge: 0aa2516017123 2169b908894df Author: Linus Torvalds Date: Thu Sep 9 11:14:14 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "I don't usually send a second PR in the merge window, but the fix to mlx5 is significant enough that it should start going through the process ASAP. Along with it comes some of the usual -rc stuff that would normally wait for a -rc2 or so. Summary: Important error case regression fixes in mlx5: - Wrong size used when computing the error path smaller allocation request leads to corruption - Confusing but ultimately harmless alignment mis-calculation Static checker warning fixes: - NULL pointer subtraction in qib - kcalloc in bnxt_re - Missing static on global variable in hfi1" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: IB/hfi1: make hist static RDMA/bnxt_re: Prefer kcalloc over open coded arithmetic IB/qib: Fix null pointer subtraction compiler warning RDMA/mlx5: Fix xlt_chunk_align calculation RDMA/mlx5: Fix number of allocated XLT entries commit 0aa2516017123a7c35a2c0c35c4dc7727579b8a3 Merge: a3fa7a101dcff 11a427be2c474 Author: Linus Torvalds Date: Thu Sep 9 11:07:47 2021 -0700 Merge tag 'dmaengine-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "New drivers/devices - Support for Renesas RZ/G2L dma controller - New driver for AMD PTDMA controller Updates: - Big pile of idxd updates - Updates for Altera driver, stm32-dma, dw etc" * tag 'dmaengine-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (83 commits) dmaengine: sh: fix some NULL dereferences dmaengine: sh: Fix unused initialization of pointer lmdesc MAINTAINERS: Fix AMD PTDMA DRIVER entry dmaengine: ptdma: remove PT_OFFSET to avoid redefnition dmaengine: ptdma: Add debugfs entries for PTDMA dmaengine: ptdma: register PTDMA controller as a DMA resource dmaengine: ptdma: Initial driver for the AMD PTDMA dmaengine: fsl-dpaa2-qdma: Fix spelling mistake "faile" -> "failed" dmaengine: idxd: remove interrupt disable for dev_lock dmaengine: idxd: remove interrupt disable for cmd_lock dmaengine: idxd: fix setting up priv mode for dwq dmaengine: xilinx_dma: Set DMA mask for coherent APIs dmaengine: ti: k3-psil-j721e: Add entry for CSI2RX dmaengine: sh: Add DMAC driver for RZ/G2L SoC dmaengine: Extend the dma_slave_width for 128 bytes dt-bindings: dma: Document RZ/G2L bindings dmaengine: ioat: depends on !UML dmaengine: idxd: set descriptor allocation size to threshold for swq dmaengine: idxd: make submit failure path consistent on desc freeing dmaengine: idxd: remove interrupt flag for completion list spinlock ... commit 88053ec8cb1b91df566353cd3116470193797e00 Author: Ard Biesheuvel Date: Thu Aug 26 18:56:13 2021 +0200 arm64: mm: limit linear region to 51 bits for KVM in nVHE mode KVM in nVHE mode divides up its VA space into two equal halves, and picks the half that does not conflict with the HYP ID map to map its linear region. This worked fine when the kernel's linear map itself was guaranteed to cover precisely as many bits of VA space, but this was changed by commit f4693c2716b35d08 ("arm64: mm: extend linear region for 52-bit VA configurations"). The result is that, depending on the placement of the ID map, kernel-VA to hyp-VA translations may produce addresses that either conflict with other HYP mappings (including the ID map itself) or generate addresses outside of the 52-bit addressable range, neither of which is likely to lead to anything useful. Given that 52-bit capable cores are guaranteed to implement VHE, this only affects configurations such as pKVM where we opt into non-VHE mode even if the hardware is VHE capable. So just for these configurations, let's limit the kernel linear map to 51 bits and work around the problem. Fixes: f4693c2716b3 ("arm64: mm: extend linear region for 52-bit VA configurations") Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20210826165613.60774-1-ardb@kernel.org Signed-off-by: Catalin Marinas commit 15b2ae776044ac52cddda8a3e6c9fecd15226b8c Author: Kari Argillander Date: Tue Sep 7 18:35:57 2021 +0300 fs/ntfs3: Show uid/gid always in show_options() Show options should show option according documentation when some value is not default or when ever coder wants. Uid/gid are problematic because it is hard to know which are defaults. In file system there is many different implementation for this problem. Some file systems show uid/gid when they are different than root, some when user has set them and some show them always. There is also problem that what if root uid/gid change. This code just choose to show them always. This way we do not need to think this any more. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 28a941ffc1404b66d67228cbe8392bbadb94af0d Author: Kari Argillander Date: Tue Sep 7 18:35:56 2021 +0300 fs/ntfs3: Rename mount option no_acs_rules > (no)acsrules Rename mount option no_acs_rules to (no)acsrules. This allow us to use possibility to mount with options noaclrules or aclrules. Acked-by: Christian Brauner Reviewed-by: Christoph Hellwig Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit e274cde8c7550cac46eb7aba3a77aff44ae0b301 Author: Kari Argillander Date: Tue Sep 7 18:35:55 2021 +0300 fs/ntfs3: Add iocharset= mount option as alias for nls= Other fs drivers are using iocharset= mount option for specifying charset. So add it also for ntfs3 and mark old nls= mount option as deprecated. Reviewed-by: Pali Rohár Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 9d1939f4575f3fda70dd94542dbd4d775e104132 Author: Kari Argillander Date: Tue Sep 7 18:35:54 2021 +0300 fs/ntfs3: Make mount option nohidden more universal If we call Opt_nohidden with just keyword hidden, then we can use hidden/nohidden when mounting. We already use this method for almoust all other parameters so it is just logical that this will use same method. Acked-by: Christian Brauner Reviewed-by: Christoph Hellwig Reviewed-by: Pali Rohár Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 27fac77707a1d99deef33fd5f3f5f2ed96bfbf6a Author: Kari Argillander Date: Tue Sep 7 18:35:53 2021 +0300 fs/ntfs3: Init spi more in init_fs_context than fill_super init_fs_context() is meant to initialize s_fs_info (spi). Move spi initializing code there which we can initialize before fill_super(). Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 610f8f5a7baf998e70a61c63e53869b676d9b04c Author: Kari Argillander Date: Tue Sep 7 18:35:52 2021 +0300 fs/ntfs3: Use new api for mounting We have now new mount api as described in Documentation/filesystems. We should use it as it gives us some benefits which are desribed here lore.kernel.org/linux-fsdevel/159646178122.1784947.11705396571718464082.stgit@warthog.procyon.org.uk/ Nls loading is changed a to load with string. This did make code also little cleaner. Also try to use fsparam_flag_no as much as possible. This is just nice little touch and is not mandatory but it should not make any harm. It is just convenient that we can use example acl/noacl mount options. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 564c97bdfa39c7d1f331841fb24da6e714693037 Author: Kari Argillander Date: Tue Sep 7 18:35:51 2021 +0300 fs/ntfs3: Convert mount options to pointer in sbi Use pointer to mount options. We want to do this because we will use new mount api which will benefit that we have spi and mount options in different allocations. When we remount we do not have to make whole new spi it is enough that we will allocate just mount options. Please note that we can do example remount lot cleaner but things will change in next patch so this should be just functional. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit c2c389fd6c6b0393549578997744b03822dd2b24 Author: Kari Argillander Date: Tue Sep 7 18:35:50 2021 +0300 fs/ntfs3: Remove unnecesarry remount flag handling Remove unnecesarry remount flag handling. This does not do anything for this driver. We have already set SB_NODIRATIME when we fill super. Also noatime should be set from mount option. Now for some reson we try to set it when remounting. Lazytime part looks like it is copied from f2fs and there is own mount parameter for it. That is why they use it. We do not set lazytime anywhere in our code. So basically this just blocks lazytime when remounting. Acked-by: Christian Brauner Reviewed-by: Christoph Hellwig Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit b8a30b4171b9a3c22ef0605ed74a21544d00c680 Author: Kari Argillander Date: Tue Sep 7 18:35:49 2021 +0300 fs/ntfs3: Remove unnecesarry mount option noatime Remove unnecesarry mount option noatime because this will be handled by VFS. Our option parser will never get opt like this. Acked-by: Christian Brauner Reviewed-by: Christoph Hellwig Reviewed-by: Pali Rohár Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 2ae2eb9dde18979b40629dd413b9adbd6c894cdf Author: Pavel Begunkov Date: Thu Sep 9 13:56:27 2021 +0100 io_uring: fail links of cancelled timeouts When we cancel a timeout we should mark it with REQ_F_FAIL, so linked requests are cancelled as well, but not queued for further execution. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fff625b44eeced3a5cae79f60e6acf3fbdf8f990.1631192135.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 26be23af1866eead5a29f8501f9d774ac277d0bd Author: Arnaud Pouliquen Date: Thu Sep 9 16:54:49 2021 +0200 MAINTAINERS: fix update references to stm32 audio bindings The 00d38fd8d2524 ("MAINTAINERS: update references to stm32 audio bindings") commit update the bindings reference, by removing bindings/sound/st,stm32-adfsdm.txt, to set the new reference to bindings/iio/adc/st,stm32-*.yaml. This leads to "get_maintainer finds" the match for the Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml, but also to the IIO bindings Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml And The commit fixes only a part of the problem: Documentation/devicetree/bindings/sound/st,stm32-*.txt file have been also moved to yaml. Update references to include all stm32 audio bindings file and exclude the st,stm32-adc.yaml bindings file. cc: Mauro Carvalho Chehab Fixes: 0d38fd8d2524 ("MAINTAINERS: update references to stm32 audio bindings") Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20210909145449.24388-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mark Brown commit 948ca5f30e1df0c11eb5b0f410b9ceb97fa77ad9 Author: Eric Whitney Date: Thu Aug 19 10:49:27 2021 -0400 ext4: enforce buffer head state assertion in ext4_da_map_blocks Remove the code that re-initializes a buffer head with an invalid block number and BH_New and BH_Delay bits when a matching delayed and unwritten block has been found in the extent status cache. Replace it with assertions that verify the buffer head already has this state correctly set. The current code masked an inline data truncation bug that left stale entries in the extent status cache. With this change, generic/130 can be used to reproduce and detect that bug. Signed-off-by: Eric Whitney Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210819144927.25163-3-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit 0add491df4e5e2c8cc6eeeaa6dbcca50f932090c Author: Eric Whitney Date: Thu Aug 19 10:49:26 2021 -0400 ext4: remove extent cache entries when truncating inline data Conditionally remove all cached extents belonging to an inode when truncating its inline data. It's only necessary to attempt to remove cached extents when a conversion from inline to extent storage has been initiated (!EXT4_STATE_MAY_INLINE_DATA). This avoids unnecessary es lock overhead in the more common inline case. Signed-off-by: Eric Whitney Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210819144927.25163-2-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit 11ef08c9eb52a808b8903004cba0733df6902a43 Merge: 1fd95c05d8f74 cc883236b7929 Author: Theodore Ts'o Date: Sat Sep 4 23:46:32 2021 -0400 Merge branch 'delalloc-buffer-write' into dev Fix a bug in how we update i_disksize, and the error path in inline_data_end. Finally, drop an unnecessary creation of a journal handle which was only needed for inline data, which can give us a large performance gain in delayed allocation writes. Signed-off-by: Theodore Ts'o commit 70ee251ded6ba24c15537f4abb8a318e233d0d1a Author: Matthias Kaehlcke Date: Mon Aug 23 13:47:30 2021 -0700 thermal/drivers/qcom/spmi-adc-tm5: Don't abort probing if a sensor is not used adc_tm5_register_tzd() registers the thermal zone sensors for all channels of the thermal monitor. If the registration of one channel fails the function skips the processing of the remaining channels and returns an error, which results in _probe() being aborted. One of the reasons the registration could fail is that none of the thermal zones is using the channel/sensor, which hardly is a critical error (if it is an error at all). If this case is detected emit a warning and continue with processing the remaining channels. Fixes: ca66dca5eda6 ("thermal: qcom: add support for adc-tm5 PMIC thermal monitor") Signed-off-by: Matthias Kaehlcke Reported-by: Stephen Boyd Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210823134726.1.I1dd23ddf77e5b3568625d80d6827653af071ce19@changeid commit 5950fc44a57ace59f21dccfd792250019348a182 Author: Srinivas Pandruvada Date: Thu Aug 19 19:40:05 2021 -0700 thermal/drivers/intel: Allow processing of HWP interrupt Add a weak function to process HWP (Hardware P-states) notifications and move updating HWP_STATUS MSR to this function. This allows HWP interrupts to be processed by the intel_pstate driver in HWP mode by overriding the implementation. Signed-off-by: Srinivas Pandruvada Acked-by: Zhang Rui Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210820024006.2347720-1-srinivas.pandruvada@linux.intel.com commit 2bab94090b01bc593d8bc25f68df41f198721173 Author: Guenter Roeck Date: Mon Sep 6 21:53:58 2021 -0700 spi: tegra20-slink: Declare runtime suspend and resume functions conditionally The following build error is seen with CONFIG_PM=n. drivers/spi/spi-tegra20-slink.c:1188:12: error: 'tegra_slink_runtime_suspend' defined but not used drivers/spi/spi-tegra20-slink.c:1200:12: error: 'tegra_slink_runtime_resume' defined but not used Declare the functions only if PM is enabled. While at it, remove the unnecessary forward declarations. Signed-off-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20210907045358.2138282-1-linux@roeck-us.net Signed-off-by: Mark Brown commit 5a80dea93191d55840f42252ed3e4565a125a514 Author: Trevor Wu Date: Thu Sep 9 14:55:33 2021 +0800 ASoC: mediatek: add required config dependency Because SND_SOC_MT8195 depends on COMPILE_TEST, it's possible to build MT8195 driver in many different config combinations. Add all dependent config for SND_SOC_MT8195 in case some errors happen when COMPILE_TEST is enabled. Signed-off-by: Trevor Wu Reported-by: Randy Dunlap Link: https://lore.kernel.org/r/20210909065533.2114-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 58eafe1ff52ee1ce255759fc15729519af180cbb Author: Pierre-Louis Bossart Date: Tue Sep 7 13:44:36 2021 -0500 ASoC: Intel: sof_sdw: tag SoundWire BEs as non-atomic The SoundWire BEs make use of 'stream' functions for .prepare and .trigger. These functions will in turn force a Bank Switch, which implies a wait operation. Mark SoundWire BEs as nonatomic for consistency, but keep all other types of BEs as is. The initialization of .nonatomic is done outside of the create_sdw_dailink helper to avoid adding more parameters to deal with a single exception to the rule that BEs are atomic. Suggested-by: Takashi Iwai Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20210907184436.33152-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 66e70be722886e4f134350212baa13f217e39e42 Author: Qiang.zhang Date: Thu Sep 9 19:58:22 2021 +0800 io-wq: fix memory leak in create_io_worker() BUG: memory leak unreferenced object 0xffff888126fcd6c0 (size 192): comm "syz-executor.1", pid 11934, jiffies 4294983026 (age 15.690s) backtrace: [] kmalloc_node include/linux/slab.h:609 [inline] [] kzalloc_node include/linux/slab.h:732 [inline] [] create_io_worker+0x41/0x1e0 fs/io-wq.c:739 [] io_wqe_create_worker fs/io-wq.c:267 [inline] [] io_wqe_enqueue+0x1fe/0x330 fs/io-wq.c:866 [] io_queue_async_work+0xc4/0x200 fs/io_uring.c:1473 [] __io_queue_sqe+0x34c/0x510 fs/io_uring.c:6933 [] io_req_task_submit+0x4b/0xa0 fs/io_uring.c:2233 [] io_async_task_func+0x108/0x1c0 fs/io_uring.c:5462 [] tctx_task_work+0x1b3/0x3a0 fs/io_uring.c:2158 [] task_work_run+0x73/0xb0 kernel/task_work.c:164 [] tracehook_notify_signal include/linux/tracehook.h:212 [inline] [] handle_signal_work kernel/entry/common.c:146 [inline] [] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] [] exit_to_user_mode_prepare+0x151/0x180 kernel/entry/common.c:209 [] __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] [] syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:302 [] do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 [] entry_SYSCALL_64_after_hwframe+0x44/0xae when create_io_thread() return error, and not retry, the worker object need to be freed. Reported-by: syzbot+65454c239241d3d647da@syzkaller.appspotmail.com Signed-off-by: Qiang.zhang Link: https://lore.kernel.org/r/20210909115822.181188-1-qiang.zhang@windriver.com Signed-off-by: Jens Axboe commit 8cc633190b524c678b740c87fa1fc37447151a6b Author: Robin Murphy Date: Wed Sep 8 13:55:37 2021 +0100 iommu: Clarify default domain Kconfig Although strictly it is the AMD and Intel drivers which have an existing expectation of lazy behaviour by default, it ends up being rather unintuitive to describe this literally in Kconfig. Express it instead as an architecture dependency, to clarify that it is a valid config-time decision. The end result is the same since virtio-iommu doesn't support lazy mode and thus falls back to strict at runtime regardless. The per-architecture disparity is a matter of historical expectations: the AMD and Intel drivers have been lazy by default since 2008, and changing that gets noticed by people asking where their I/O throughput has gone. Conversely, Arm-based systems with their wider assortment of IOMMU drivers mostly only support strict mode anyway; only the Arm SMMU drivers have later grown support for passthrough and lazy mode, for users who wanted to explicitly trade off isolation for performance. These days, reducing the default level of isolation in a way which may go unnoticed by users who expect otherwise hardly seems worth risking for the sake of one line of Kconfig, so here's where we are. Reported-by: Linus Torvalds Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/69a0c6f17b000b54b8333ee42b3124c1d5a869e2.1631105737.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 6ef0505158f7ca1b32763a3b038b5d11296b642b Author: Fenghua Yu Date: Sat Aug 28 15:06:22 2021 +0800 iommu/vt-d: Fix a deadlock in intel_svm_drain_prq() pasid_mutex and dev->iommu->param->lock are held while unbinding mm is flushing IO page fault workqueue and waiting for all page fault works to finish. But an in-flight page fault work also need to hold the two locks while unbinding mm are holding them and waiting for the work to finish. This may cause an ABBA deadlock issue as shown below: idxd 0000:00:0a.0: unbind PASID 2 ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc7+ #549 Not tainted [ 186.615245] ---------- dsa_test/898 is trying to acquire lock: ffff888100d854e8 (¶m->lock){+.+.}-{3:3}, at: iopf_queue_flush_dev+0x29/0x60 but task is already holding lock: ffffffff82b2f7c8 (pasid_mutex){+.+.}-{3:3}, at: intel_svm_unbind+0x34/0x1e0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (pasid_mutex){+.+.}-{3:3}: __mutex_lock+0x75/0x730 mutex_lock_nested+0x1b/0x20 intel_svm_page_response+0x8e/0x260 iommu_page_response+0x122/0x200 iopf_handle_group+0x1c2/0x240 process_one_work+0x2a5/0x5a0 worker_thread+0x55/0x400 kthread+0x13b/0x160 ret_from_fork+0x22/0x30 -> #1 (¶m->fault_param->lock){+.+.}-{3:3}: __mutex_lock+0x75/0x730 mutex_lock_nested+0x1b/0x20 iommu_report_device_fault+0xc2/0x170 prq_event_thread+0x28a/0x580 irq_thread_fn+0x28/0x60 irq_thread+0xcf/0x180 kthread+0x13b/0x160 ret_from_fork+0x22/0x30 -> #0 (¶m->lock){+.+.}-{3:3}: __lock_acquire+0x1134/0x1d60 lock_acquire+0xc6/0x2e0 __mutex_lock+0x75/0x730 mutex_lock_nested+0x1b/0x20 iopf_queue_flush_dev+0x29/0x60 intel_svm_drain_prq+0x127/0x210 intel_svm_unbind+0xc5/0x1e0 iommu_sva_unbind_device+0x62/0x80 idxd_cdev_release+0x15a/0x200 [idxd] __fput+0x9c/0x250 ____fput+0xe/0x10 task_work_run+0x64/0xa0 exit_to_user_mode_prepare+0x227/0x230 syscall_exit_to_user_mode+0x2c/0x60 do_syscall_64+0x48/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: ¶m->lock --> ¶m->fault_param->lock --> pasid_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(pasid_mutex); lock(¶m->fault_param->lock); lock(pasid_mutex); lock(¶m->lock); *** DEADLOCK *** 2 locks held by dsa_test/898: #0: ffff888100cc1cc0 (&group->mutex){+.+.}-{3:3}, at: iommu_sva_unbind_device+0x53/0x80 #1: ffffffff82b2f7c8 (pasid_mutex){+.+.}-{3:3}, at: intel_svm_unbind+0x34/0x1e0 stack backtrace: CPU: 2 PID: 898 Comm: dsa_test Not tainted 5.14.0-rc7+ #549 Hardware name: Intel Corporation Kabylake Client platform/KBL S DDR4 UD IMM CRB, BIOS KBLSE2R1.R00.X050.P01.1608011715 08/01/2016 Call Trace: dump_stack_lvl+0x5b/0x74 dump_stack+0x10/0x12 print_circular_bug.cold+0x13d/0x142 check_noncircular+0xf1/0x110 __lock_acquire+0x1134/0x1d60 lock_acquire+0xc6/0x2e0 ? iopf_queue_flush_dev+0x29/0x60 ? pci_mmcfg_read+0xde/0x240 __mutex_lock+0x75/0x730 ? iopf_queue_flush_dev+0x29/0x60 ? pci_mmcfg_read+0xfd/0x240 ? iopf_queue_flush_dev+0x29/0x60 mutex_lock_nested+0x1b/0x20 iopf_queue_flush_dev+0x29/0x60 intel_svm_drain_prq+0x127/0x210 ? intel_pasid_tear_down_entry+0x22e/0x240 intel_svm_unbind+0xc5/0x1e0 iommu_sva_unbind_device+0x62/0x80 idxd_cdev_release+0x15a/0x200 pasid_mutex protects pasid and svm data mapping data. It's unnecessary to hold pasid_mutex while flushing the workqueue. To fix the deadlock issue, unlock pasid_pasid during flushing the workqueue to allow the works to be handled. Fixes: d5b9e4bfe0d8 ("iommu/vt-d: Report prq to io-pgfault framework") Reported-and-tested-by: Dave Jiang Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20210826215918.4073446-1-fenghua.yu@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210828070622.2437559-3-baolu.lu@linux.intel.com [joro: Removed timing information from kernel log messages] Signed-off-by: Joerg Roedel commit a21518cb23a3c7d49bafcb59862fd389fd829d4b Author: Fenghua Yu Date: Sat Aug 28 15:06:21 2021 +0800 iommu/vt-d: Fix PASID leak in intel_svm_unbind_mm() The mm->pasid will be used in intel_svm_free_pasid() after load_pasid() during unbinding mm. Clearing it in load_pasid() will cause PASID cannot be freed in intel_svm_free_pasid(). Additionally mm->pasid was updated already before load_pasid() during pasid allocation. No need to update it again in load_pasid() during binding mm. Don't update mm->pasid to avoid the issues in both binding mm and unbinding mm. Fixes: 4048377414162 ("iommu/vt-d: Use iommu_sva_alloc(free)_pasid() helpers") Reported-and-tested-by: Dave Jiang Co-developed-by: Jacob Pan Signed-off-by: Jacob Pan Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20210826215918.4073446-1-fenghua.yu@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210828070622.2437559-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit eb03f2d2f6a4da25d286613717d10add9ce9f175 Author: Suravee Suthikulpanit Date: Fri Aug 20 15:29:57 2021 -0500 iommu/amd: Remove iommu_init_ga() Since the function has been simplified and only call iommu_init_ga_log(), remove the function and replace with iommu_init_ga_log() instead. Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20210820202957.187572-4-suravee.suthikulpanit@amd.com Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel commit c3811a50addd23b9bb5a36278609ee1638debcf6 Author: Wei Huang Date: Fri Aug 20 15:29:55 2021 -0500 iommu/amd: Relocate GAMSup check to early_enable_iommus Currently, iommu_init_ga() checks and disables IOMMU VAPIC support (i.e. AMD AVIC support in IOMMU) when GAMSup feature bit is not set. However it forgets to clear IRQ_POSTING_CAP from the previously set amd_iommu_irq_ops.capability. This triggers an invalid page fault bug during guest VM warm reboot if AVIC is enabled since the irq_remapping_cap(IRQ_POSTING_CAP) is incorrectly set, and crash the system with the following kernel trace. BUG: unable to handle page fault for address: 0000000000400dd8 RIP: 0010:amd_iommu_deactivate_guest_mode+0x19/0xbc Call Trace: svm_set_pi_irte_mode+0x8a/0xc0 [kvm_amd] ? kvm_make_all_cpus_request_except+0x50/0x70 [kvm] kvm_request_apicv_update+0x10c/0x150 [kvm] svm_toggle_avic_for_irq_window+0x52/0x90 [kvm_amd] svm_enable_irq_window+0x26/0xa0 [kvm_amd] vcpu_enter_guest+0xbbe/0x1560 [kvm] ? avic_vcpu_load+0xd5/0x120 [kvm_amd] ? kvm_arch_vcpu_load+0x76/0x240 [kvm] ? svm_get_segment_base+0xa/0x10 [kvm_amd] kvm_arch_vcpu_ioctl_run+0x103/0x590 [kvm] kvm_vcpu_ioctl+0x22a/0x5d0 [kvm] __x64_sys_ioctl+0x84/0xc0 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes by moving the initializing of AMD IOMMU interrupt remapping mode (amd_iommu_guest_ir) earlier before setting up the amd_iommu_irq_ops.capability with appropriate IRQ_POSTING_CAP flag. [joro: Squashed the two patches and limited check_features_on_all_iommus() to CONFIG_IRQ_REMAP to fix a compile warning.] Signed-off-by: Wei Huang Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20210820202957.187572-2-suravee.suthikulpanit@amd.com Link: https://lore.kernel.org/r/20210820202957.187572-3-suravee.suthikulpanit@amd.com Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel commit d97180ad68bdb7ee10f327205a649bc2f558741d Author: Helge Deller Date: Wed Sep 8 23:27:00 2021 +0200 parisc: Mark sched_clock unstable only if clocks are not syncronized We check at runtime if the cr16 clocks are stable across CPUs. Only mark the sched_clock unstable by calling clear_sched_clock_stable() if we know that we run on a system which isn't syncronized across CPUs. Signed-off-by: Helge Deller commit 907872baa9f1538eed02ec737b8e89eba6c6e4b9 Author: Guenter Roeck Date: Wed Sep 8 08:30:41 2021 -0700 parisc: Move pci_dev_is_behind_card_dino to where it is used parisc build test images fail to compile with the following error. drivers/parisc/dino.c:160:12: error: 'pci_dev_is_behind_card_dino' defined but not used Move the function just ahead of its only caller to avoid the error. Fixes: 5fa1659105fa ("parisc: Disable HP HSC-PCI Cards to prevent kernel crash") Cc: Helge Deller Signed-off-by: Guenter Roeck Signed-off-by: Helge Deller commit e4f2006f1287e7ea17660490569cff323772dac4 Author: Helge Deller Date: Tue Sep 7 05:03:29 2021 +0200 parisc: Reduce sigreturn trampoline to 3 instructions We can move the INSN_LDI_R20 instruction into the branch delay slot. Signed-off-by: Helge Deller commit 3e4a1aff2a97cb4fd7f0268e4b69e8c9d3641277 Author: Helge Deller Date: Sun Sep 5 11:53:32 2021 +0200 parisc: Check user signal stack trampoline is inside TASK_SIZE Add some additional checks to ensure the signal stack is inside userspace bounds. Signed-off-by: Helge Deller commit ea4b3fca18adc81e6a965b2ad0668f38d5d3485b Author: Helge Deller Date: Mon Sep 6 22:45:16 2021 +0200 parisc: Drop useless debug info and comments from signal.c Signed-off-by: Helge Deller commit 1260dea6d2eb75706c978da828a36f0def590d3a Author: Helge Deller Date: Sat Sep 4 23:49:26 2021 +0200 parisc: Drop strnlen_user() in favour of generic version As suggested by Arnd Bergmann, drop the parisc version of strnlen_user() and switch to the generic version. Suggested-by: Arnd Bergmann Acked-by: Arnd Bergmann Signed-off-by: Helge Deller commit 3da6379a6d865ef4faa369eebe2019dac75cda4b Author: Helge Deller Date: Sun Sep 5 11:50:56 2021 +0200 parisc: Add missing FORCE prerequisite in Makefile Signed-off-by: Helge Deller commit e011912651bdf72840d88e8a8de3716bbcc4be99 Author: Guenter Roeck Date: Wed Sep 8 21:49:53 2021 -0700 net: ni65: Avoid typecast of pointer to u32 Building alpha:allmodconfig results in the following error. drivers/net/ethernet/amd/ni65.c: In function 'ni65_stop_start': drivers/net/ethernet/amd/ni65.c:751:37: error: cast from pointer to integer of different size buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer); 'buffer[]' is declared as unsigned long, so replace the typecast to u32 with a typecast to unsigned long to fix the problem. Cc: Arnd Bergmann Signed-off-by: Guenter Roeck Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit e3a843f98c8fad4d02849fdb14919885024bf51f Merge: 2a48d96fd58a6 6215b608a8c4d Author: David S. Miller Date: Thu Sep 9 11:17:37 2021 +0100 Merge branch 'sfx-xdp-fallback-tx-queues' Íñigo Huguet says: ==================== sfc: fallback for lack of xdp tx queues If there are not enough hardware resources to allocate one tx queue per CPU for XDP, XDP_TX and XDP_REDIRECT actions were unavailable, and using them resulted each time with the packet being drop and this message in the logs: XDP TX failed (-22) These patches implement 2 fallback solutions for 2 different situations that might happen: 1. There are not enough free resources for all the tx queues, but there are some free resources available 2. There are not enough free resources at all for tx queues. Both solutions are based in sharing tx queues, using __netif_tx_lock for synchronization. In the second case, as there are not XDP TX queues to share, network stack queues are used instead, but since we're taking __netif_tx_lock, concurrent access to the queues is correctly protected. The solution for this second case might affect performance both of XDP traffic and normal traffice due to lock contention if both are used intensively. That's why I call it a "last resort" fallback: it's not a desirable situation, but at least we have XDP TX working. Some tests has shown good results and indicate that the non-fallback case is not being damaged by this changes. They are also promising for the fallback cases. This is the test: 1. From another machine, send high amount of packets with pktgen, script samples/pktgen/pktgen_sample04_many_flows.sh 2. In the tested machine, run samples/bpf/xdp_rxq_info with arguments "-a XDP_TX --swapmac" and see the results 3. In the tested machine, run also pktgen_sample04 to create high TX normal traffic, and see how xdp_rxq_info results vary Note that this test doesn't check the worst situations for the fallback solutions because XDP_TX will only be executed from the same CPUs that are processed by sfc, and not from every CPU in the system, so the performance drop due to the highest locking contention doesn't happen. I'd like to test that, as well, but I don't have access right now to a proper environment. Test results: Without doing TX: Before changes: ~2,900,000 pps After changes, 1 queues/core: ~2,900,000 pps After changes, 2 queues/core: ~2,900,000 pps After changes, 8 queues/core: ~2,900,000 pps After changes, borrowing from network stack: ~2,900,000 pps With multiflow TX at the same time: Before changes: ~1,700,000 - 2,900,000 pps After changes, 1 queues/core: ~1,700,000 - 2,900,000 pps After changes, 2 queues/core: ~1,700,000 pps After changes, 8 queues/core: ~1,700,000 pps After changes, borrowing from network stack: 1,150,000 pps Sporadic "XDP TX failed (-5)" warnings are shown when running xdp program and pktgen simultaneously. This was expected because XDP doesn't have any buffering system if the NIC is under very high pressure. Thousands of these warnings are shown in the case of borrowing net stack queues. As I said before, this was also expected. ==================== Signed-off-by: David S. Miller commit 6215b608a8c4d4a478721e14a6faa0dc56e4a693 Author: Íñigo Huguet Date: Thu Sep 9 11:28:46 2021 +0200 sfc: last resort fallback for lack of xdp tx queues Previous patch addressed the situation of having some free resources for xdp tx but not enough for one tx queue per CPU. This patch address the worst case of not having resources at all for xdp tx. Instead of using queues dedicated to xdp, normal queues used by network stack are shared for both cases, using __netif_tx_lock for synchronization. Also queue stop/restart must be considered in the xdp path to avoid freezing the queue. This is not the ideal situation we might want to be, and a performance penalty is expected both for normal and xdp traffic, but at least XDP will work in all possible situations (with a warning in the logs), improving a bit the pain of not knowing in what situations we can use it and in what situations we cannot. Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 415446185b939dcdcd6a483e705c805ab961e54c Author: Íñigo Huguet Date: Thu Sep 9 11:28:45 2021 +0200 sfc: fallback for lack of xdp tx queues If there are not enough resources to allocate one TX queue per core for XDP TX it was completely disabled. This patch implements a fallback solution for sharing the available queues using __netif_tx_lock for synchronization. In the normal case that there is one TX queue per CPU, no locking is done, as it was before. With this fallback solution, XDP TX will work in much more cases that were failing, specially in machines with many CPUs. It's hard for XDP users to know what features are supported across different NICs and configurations, so they will benefit on having wider support. Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 2a48d96fd58a666ae231c3dd6fe4a458798ac645 Author: Joakim Zhang Date: Thu Sep 9 17:23:22 2021 +0800 net: stmmac: platform: fix build warning when with !CONFIG_PM_SLEEP Use __maybe_unused for noirq_suspend()/noirq_resume() hooks to avoid build warning with !CONFIG_PM_SLEEP: >> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:796:12: error: 'stmmac_pltfr_noirq_resume' defined but not used [-Werror=unused-function] 796 | static int stmmac_pltfr_noirq_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:775:12: error: 'stmmac_pltfr_noirq_suspend' defined but not used [-Werror=unused-function] 775 | static int stmmac_pltfr_noirq_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Fixes: 276aae377206 ("net: stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume") Reported-by: kernel test robot Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 3c10ffddc61f8a1a59e29a110ba70b47e679206a Author: Pavel Skripkin Date: Thu Sep 2 22:04:00 2021 +0300 net: xfrm: fix shift-out-of-bounds in xfrm_get_default Syzbot hit shift-out-of-bounds in xfrm_get_default. The problem was in missing validation check for user data. up->dirmask comes from user-space, so we need to check if this value is less than XFRM_USERPOLICY_DIRMASK_MAX to avoid shift-out-of-bounds bugs. Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") Reported-and-tested-by: syzbot+b2be9dd8ca6f6c73ee2d@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Steffen Klassert commit 9b6ff7eb666415e1558f1ba8a742f5db6a9954de Author: Xiyu Yang Date: Thu Sep 9 12:32:00 2021 +0800 net/l2tp: Fix reference count leak in l2tp_udp_recv_core The reference count leak issue may take place in an error handling path. If both conditions of tunnel->version == L2TP_HDR_VER_3 and the return value of l2tp_v3_ensure_opt_in_linear is nonzero, the function would directly jump to label invalid, without decrementing the reference count of the l2tp_session object session increased earlier by l2tp_tunnel_get_session(). This may result in refcount leaks. Fix this issue by decrease the reference count before jumping to the label invalid. Fixes: 4522a70db7aa ("l2tp: fix reading optional fields of L2TPv3") Signed-off-by: Xiyu Yang Signed-off-by: Xin Xiong Signed-off-by: Xin Tan Signed-off-by: David S. Miller commit 04f08eb44b5011493d77b602fdec29ff0f5c6cd5 Author: Eric Dumazet Date: Wed Sep 8 17:00:29 2021 -0700 net/af_unix: fix a data-race in unix_dgram_poll syzbot reported another data-race in af_unix [1] Lets change __skb_insert() to use WRITE_ONCE() when changing skb head qlen. Also, change unix_dgram_poll() to use lockless version of unix_recvq_full() It is verry possible we can switch all/most unix_recvq_full() to the lockless version, this will be done in a future kernel version. [1] HEAD commit: 8596e589b787732c8346f0482919e83cc9362db1 BUG: KCSAN: data-race in skb_queue_tail / unix_dgram_poll write to 0xffff88814eeb24e0 of 4 bytes by task 25815 on cpu 0: __skb_insert include/linux/skbuff.h:1938 [inline] __skb_queue_before include/linux/skbuff.h:2043 [inline] __skb_queue_tail include/linux/skbuff.h:2076 [inline] skb_queue_tail+0x80/0xa0 net/core/skbuff.c:3264 unix_dgram_sendmsg+0xff2/0x1600 net/unix/af_unix.c:1850 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] ____sys_sendmsg+0x360/0x4d0 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmmsg+0x315/0x4b0 net/socket.c:2532 __do_sys_sendmmsg net/socket.c:2561 [inline] __se_sys_sendmmsg net/socket.c:2558 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2558 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff88814eeb24e0 of 4 bytes by task 25834 on cpu 1: skb_queue_len include/linux/skbuff.h:1869 [inline] unix_recvq_full net/unix/af_unix.c:194 [inline] unix_dgram_poll+0x2bc/0x3e0 net/unix/af_unix.c:2777 sock_poll+0x23e/0x260 net/socket.c:1288 vfs_poll include/linux/poll.h:90 [inline] ep_item_poll fs/eventpoll.c:846 [inline] ep_send_events fs/eventpoll.c:1683 [inline] ep_poll fs/eventpoll.c:1798 [inline] do_epoll_wait+0x6ad/0xf00 fs/eventpoll.c:2226 __do_sys_epoll_wait fs/eventpoll.c:2238 [inline] __se_sys_epoll_wait fs/eventpoll.c:2233 [inline] __x64_sys_epoll_wait+0xf6/0x120 fs/eventpoll.c:2233 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x0000001b -> 0x00000001 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 25834 Comm: syz-executor.1 Tainted: G W 5.14.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 86b18aaa2b5b ("skbuff: fix a data race in skb_queue_len()") Cc: Qian Cai Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d82d5303c4c539db86588ffb5dc5b26c3f1513e8 Author: Tong Zhang Date: Wed Sep 8 12:02:32 2021 -0700 net: macb: fix use after free on rmmod plat_dev->dev->platform_data is released by platform_device_unregister(), use of pclk and hclk is a use-after-free. Since device unregister won't need a clk device we adjust the function call sequence to fix this issue. [ 31.261225] BUG: KASAN: use-after-free in macb_remove+0x77/0xc6 [macb_pci] [ 31.275563] Freed by task 306: [ 30.276782] platform_device_release+0x25/0x80 Suggested-by: Nicolas Ferre Signed-off-by: Tong Zhang Acked-by: Nicolas Ferre Signed-off-by: David S. Miller commit 273c29e944bda9a20a30c26cfc34c9a3f363280b Author: Sukadev Bhattiprolu Date: Wed Sep 8 09:58:20 2021 -0700 ibmvnic: check failover_pending in login response If a failover occurs before a login response is received, the login response buffer maybe undefined. Check that there was no failover before accessing the login response buffer. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 3c4cea8fa7f71f00c5279547043a84bc2a4d8b8c Author: Paolo Abeni Date: Wed Sep 8 13:42:09 2021 +0200 vhost_net: fix OoB on sendmsg() failure. If the sendmsg() call in vhost_tx_batch() fails, both the 'batched_xdp' and 'done_idx' indexes are left unchanged. If such failure happens when batched_xdp == VHOST_NET_BATCH, the next call to vhost_net_build_xdp() will access and write memory outside the xdp buffers area. Since sendmsg() can only error with EBADFD, this change addresses the issue explicitly freeing the XDP buffers batch on error. Fixes: 0a0be13b8fe2 ("vhost_net: batch submitting XDP buffers to underlayer sockets") Suggested-by: Jason Wang Signed-off-by: Paolo Abeni Acked-by: Jason Wang Signed-off-by: David S. Miller commit 868ad33bfa3bf39960982682ad3a0f8ebda1656e Author: Thomas Gleixner Date: Sat Aug 28 15:55:52 2021 +0200 sched: Prevent balance_push() on remote runqueues sched_setscheduler() and rt_mutex_setprio() invoke the run-queue balance callback after changing priorities or the scheduling class of a task. The run-queue for which the callback is invoked can be local or remote. That's not a problem for the regular rq::push_work which is serialized with a busy flag in the run-queue struct, but for the balance_push() work which is only valid to be invoked on the outgoing CPU that's wrong. It not only triggers the debug warning, but also leaves the per CPU variable push_work unprotected, which can result in double enqueues on the stop machine list. Remove the warning and validate that the function is invoked on the outgoing CPU. Fixes: ae7927023243 ("sched: Optimize finish_lock_switch()") Reported-by: Sebastian Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/87zgt1hdw7.ffs@tglx commit 9848417926353daa59d2b05eb26e185063dbac6e Author: Sebastian Andrzej Siewior Date: Mon Sep 6 13:30:34 2021 +0200 sched/idle: Make the idle timer expire in hard interrupt context The intel powerclamp driver will setup a per-CPU worker with RT priority. The worker will then invoke play_idle() in which it remains in the idle poll loop until it is stopped by the timer it started earlier. That timer needs to expire in hard interrupt context on PREEMPT_RT. Otherwise the timer will expire in ksoftirqd as a SOFT timer but that task won't be scheduled on the CPU because its priority is lower than the priority of the worker which is in the idle loop. Always expire the idle timer in hard interrupt context. Reported-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210906113034.jgfxrjdvxnjqgtmc@linutronix.de commit e5480572706da1b2c2dc2c6484eab64f92b9263b Author: Peter Zijlstra Date: Wed Sep 1 11:44:11 2021 +0200 locking/rtmutex: Fix ww_mutex deadlock check Dan reported that rt_mutex_adjust_prio_chain() can be called with .orig_waiter == NULL however commit a055fcc132d4 ("locking/rtmutex: Return success on deadlock for ww_mutex waiters") unconditionally dereferences it. Since both call-sites that have .orig_waiter == NULL don't care for the return value, simply disable the deadlock squash by adding the NULL check. Notably, both callers use the deadlock condition as a termination condition for the iteration; once detected, it is sure that (de)boosting is done. Arguably step [3] would be a more natural termination point, but it's dubious whether adding a third deadlock detection state would improve the code. Fixes: a055fcc132d4 ("locking/rtmutex: Return success on deadlock for ww_mutex waiters") Reported-by: Dan Carpenter Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/YS9La56fHMiCCo75@hirez.programming.kicks-ass.net commit 0c45d3e24ef3d3d87c5e0077b8f38d1372af7176 Author: Yu-Tung Chang Date: Mon Aug 30 13:25:32 2021 +0800 rtc: rx8010: select REGMAP_I2C The rtc-rx8010 uses the I2C regmap but doesn't select it in Kconfig so depending on the configuration the build may fail. Fix it. Signed-off-by: Yu-Tung Chang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210830052532.40356-1-mtwget@gmail.com commit 0c5483a5778fa9910538453b5a9f1a6ed49e95ad Author: Guenter Roeck Date: Tue Sep 7 18:37:08 2021 -0700 Input: analog - always use ktime functions m68k, mips, s390, and sparc allmodconfig images fail to build with the following error. drivers/input/joystick/analog.c:160:2: error: #warning Precise timer not defined for this architecture. Remove architecture specific time handling code and always use ktime functions to determine time deltas. Also remove the now useless use_ktime kernel parameter. Signed-off-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20210907123734.21520-1-linux@roeck-us.net Signed-off-by: Dmitry Torokhov commit 8d014f5fe98142b79dfa3bcd0d9483a5165f3570 Author: Steve French Date: Thu Sep 9 00:09:20 2021 -0500 cifs: move SMB FSCTL definitions to common code The FSCTL definitions are in smbfsctl.h which should be shared by client and server. Move the updated version of smbfsctl.h into smbfs_common and have the client code use it (subsequent patch will change the server to use this common version of the header). Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 23e91d8b7c5ae2bbd3a4582ec12c6a0cfcb19e85 Author: Steve French Date: Wed Sep 8 23:59:26 2021 -0500 cifs: rename cifs_common to smbfs_common As we move to common code between client and server, we have been asked to make the names less confusing, and refer less to "cifs" and more to words which include "smb" instead to e.g. "smbfs" for the client (we already have "ksmbd" for the kernel server, and "smbd" for the user space Samba daemon). So to be more consistent in the naming of common code between client and server and reduce the risk of merge conflicts as more common code is added - rename "cifs_common" to "smbfs_common" (in future releases we also will rename the fs/cifs directory to fs/smbfs) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit fc111fb9a6da6baddf23930811210650824b8a88 Author: Steve French Date: Wed Sep 8 23:06:24 2021 -0500 cifs: update FSCTL definitions Add some missing defines used by ksmbd to the client version of smbfsctl.h, and add a missing newer define mentioned in the protocol definitions (MS-FSCC). This will also make it easier to move to common code. Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit de04744d658bb36d62d94bf8fe040c51c2954d4e Merge: 06b224d5162bc efcefc7127290 Author: Dave Airlie Date: Thu Sep 9 13:34:15 2021 +1000 Merge tag 'drm-misc-next-fixes-2021-09-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next-fixes for v5.15: - Fix ttm_bo_move_memcpy() when ttm_resource is subclassed. - Small fixes to panfrost, mgag200, vc4. - Small ttm compilation fixes. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/41ff5e54-0837-2226-a182-97ffd11ef01e@linux.intel.com commit 06b224d5162bc4e353ade4815dc8ed831f10b9b8 Merge: 1645cca9da91a d6043581e1d9d Author: Dave Airlie Date: Thu Sep 9 13:33:48 2021 +1000 Merge tag 'amd-drm-next-5.15-2021-09-01' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.15-2021-09-01: amdgpu: - Misc cleanups, typo fixes - EEPROM fix - Add some new PCI IDs - Scatter/Gather display support for Yellow Carp - PCIe DPM fix for RKL platforms - RAS fix amdkfd: - SVM fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210901214015.4488-1-alexander.deucher@amd.com commit 3b33e3f4a6c0296812a7ee757bdae83290e64aed Author: Jens Axboe Date: Wed Sep 8 19:57:26 2021 -0600 io-wq: fix silly logic error in io_task_work_match() We check for the func with an OR condition, which means it always ends up being false and we never match the task_work we want to cancel. In the unexpected case that we do exit with that pending, we can trigger a hang waiting for a worker to exit, but it was never created. syzbot reports that as such: INFO: task syz-executor687:8514 blocked for more than 143 seconds. Not tainted 5.14.0-syzkaller #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor687 state:D stack:27296 pid: 8514 ppid: 8479 flags:0x00024004 Call Trace: context_switch kernel/sched/core.c:4940 [inline] __schedule+0x940/0x26f0 kernel/sched/core.c:6287 schedule+0xd3/0x270 kernel/sched/core.c:6366 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1857 do_wait_for_common kernel/sched/completion.c:85 [inline] __wait_for_common kernel/sched/completion.c:106 [inline] wait_for_common kernel/sched/completion.c:117 [inline] wait_for_completion+0x176/0x280 kernel/sched/completion.c:138 io_wq_exit_workers fs/io-wq.c:1162 [inline] io_wq_put_and_exit+0x40c/0xc70 fs/io-wq.c:1197 io_uring_clean_tctx fs/io_uring.c:9607 [inline] io_uring_cancel_generic+0x5fe/0x740 fs/io_uring.c:9687 io_uring_files_cancel include/linux/io_uring.h:16 [inline] do_exit+0x265/0x2a30 kernel/exit.c:780 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x47f/0x2160 kernel/signal.c:2868 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x445cd9 RSP: 002b:00007fc657f4b308 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 00000000004cb448 RCX: 0000000000445cd9 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00000000004cb44c RBP: 00000000004cb440 R08: 000000000000000e R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049b154 R13: 0000000000000003 R14: 00007fc657f4b400 R15: 0000000000022000 While in there, also decrement accr->nr_workers. This isn't strictly needed as we're exiting, but let's make sure the accounting matches up. Fixes: 3146cba99aa2 ("io-wq: make worker creation resilient against signals") Reported-by: syzbot+f62d3e0a4ea4f38f5326@syzkaller.appspotmail.com Signed-off-by: Jens Axboe commit a3fa7a101dcff93791d1b1bdb3affcad1410c8c1 Merge: 730bf31b8fc8e a7a08b275a8bb ddb13122aa7e9 Author: Linus Torvalds Date: Wed Sep 8 18:52:05 2021 -0700 Merge branches 'akpm' and 'akpm-hotfixes' (patches from Andrew) Merge yet more updates and hotfixes from Andrew Morton: "Post-linux-next material, based upon latest upstream to catch the now-merged dependencies: - 10 patches. Subsystems affected by this patch series: mm (vmstat and migration) and compat. And bunch of hotfixes, mostly cc:stable: - 8 patches. Subsystems affected by this patch series: mm (hmm, hugetlb, vmscan, pagealloc, pagemap, kmemleak, mempolicy, and memblock)" * emailed patches from Andrew Morton : arch: remove compat_alloc_user_space compat: remove some compat entry points mm: simplify compat numa syscalls mm: simplify compat_sys_move_pages kexec: avoid compat_alloc_user_space kexec: move locking into do_kexec_load mm: migrate: change to use bool type for 'page_was_mapped' mm: migrate: fix the incorrect function name in comments mm: migrate: introduce a local variable to get the number of pages mm/vmstat: protect per cpu variables with preempt disable on RT * emailed hotfixes from Andrew Morton : nds32/setup: remove unused memblock_region variable in setup_memory() mm/mempolicy: fix a race between offset_il_node and mpol_rebind_task mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp mmap_lock: change trace and locking order mm/page_alloc.c: avoid accessing uninitialized pcp page migratetype mm,vmscan: fix divide by zero in get_scan_count mm/hugetlb: initialize hugetlb_usage in mm_init mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled commit ddb13122aa7e988e15283701afb086e0950c405f Author: Mike Rapoport Date: Wed Sep 8 18:10:23 2021 -0700 nds32/setup: remove unused memblock_region variable in setup_memory() kernel test robot reports unused variable warning: arch/nds32/kernel/setup.c:247:26: warning: Unused variable: region [unusedVariable] struct memblock_region *region; ^ Remove the unused variable. Link: https://lkml.kernel.org/r/20210712125218.28951-1-rppt@kernel.org Signed-off-by: Mike Rapoport Reported-by: kernel test robot Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck Cc: Greentime Hu Cc: Nick Hu Cc: Vincent Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 276aeee1c5fc00df700f0782060beae126600472 Author: yanghui Date: Wed Sep 8 18:10:20 2021 -0700 mm/mempolicy: fix a race between offset_il_node and mpol_rebind_task Servers happened below panic: Kernel version:5.4.56 BUG: unable to handle page fault for address: 0000000000002c48 RIP: 0010:__next_zones_zonelist+0x1d/0x40 Call Trace: __alloc_pages_nodemask+0x277/0x310 alloc_page_interleave+0x13/0x70 handle_mm_fault+0xf99/0x1390 __do_page_fault+0x288/0x500 do_page_fault+0x30/0x110 page_fault+0x3e/0x50 The reason for the panic is that MAX_NUMNODES is passed in the third parameter in __alloc_pages_nodemask(preferred_nid). So access to zonelist->zoneref->zone_idx in __next_zones_zonelist will cause a panic. In offset_il_node(), first_node() returns nid from pol->v.nodes, after this other threads may chang pol->v.nodes before next_node(). This race condition will let next_node return MAX_NUMNODES. So put pol->nodes in a local variable. The race condition is between offset_il_node and cpuset_change_task_nodemask: CPU0: CPU1: alloc_pages_vma() interleave_nid(pol,) offset_il_node(pol,) first_node(pol->v.nodes) cpuset_change_task_nodemask //nodes==0xc mpol_rebind_task mpol_rebind_policy mpol_rebind_nodemask(pol,nodes) //nodes==0x3 next_node(nid, pol->v.nodes)//return MAX_NUMNODES Link: https://lkml.kernel.org/r/20210906034658.48721-1-yanghui.def@bytedance.com Signed-off-by: yanghui Reviewed-by: Muchun Song Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79d3705040c3b41075f894fdeeebdcbb46550c63 Author: Naohiro Aota Date: Wed Sep 8 18:10:17 2021 -0700 mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp In a memory pressure situation, I'm seeing the lockdep WARNING below. Actually, this is similar to a known false positive which is already addressed by commit 6dcde60efd94 ("xfs: more lockdep whackamole with kmem_alloc*"). This warning still persists because it's not from kmalloc() itself but from an allocation for kmemleak object. While kmalloc() itself suppress the warning with __GFP_NOLOCKDEP, gfp_kmemleak_mask() is dropping the flag for the kmemleak's allocation. Allow __GFP_NOLOCKDEP to be passed to kmemleak's allocation, so that the warning for it is also suppressed. ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc7-BTRFS-ZNS+ #37 Not tainted ------------------------------------------------------ kswapd0/288 is trying to acquire lock: ffff88825ab45df0 (&xfs_nondir_ilock_class){++++}-{3:3}, at: xfs_ilock+0x8a/0x250 but task is already holding lock: ffffffff848cc1e0 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: fs_reclaim_acquire+0x112/0x160 kmem_cache_alloc+0x48/0x400 create_object.isra.0+0x42/0xb10 kmemleak_alloc+0x48/0x80 __kmalloc+0x228/0x440 kmem_alloc+0xd3/0x2b0 kmem_alloc_large+0x5a/0x1c0 xfs_attr_copy_value+0x112/0x190 xfs_attr_shortform_getvalue+0x1fc/0x300 xfs_attr_get_ilocked+0x125/0x170 xfs_attr_get+0x329/0x450 xfs_get_acl+0x18d/0x430 get_acl.part.0+0xb6/0x1e0 posix_acl_xattr_get+0x13a/0x230 vfs_getxattr+0x21d/0x270 getxattr+0x126/0x310 __x64_sys_fgetxattr+0x1a6/0x2a0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&xfs_nondir_ilock_class){++++}-{3:3}: __lock_acquire+0x2c0f/0x5a00 lock_acquire+0x1a1/0x4b0 down_read_nested+0x50/0x90 xfs_ilock+0x8a/0x250 xfs_can_free_eofblocks+0x34f/0x570 xfs_inactive+0x411/0x520 xfs_fs_destroy_inode+0x2c8/0x710 destroy_inode+0xc5/0x1a0 evict+0x444/0x620 dispose_list+0xfe/0x1c0 prune_icache_sb+0xdc/0x160 super_cache_scan+0x31e/0x510 do_shrink_slab+0x337/0x8e0 shrink_slab+0x362/0x5c0 shrink_node+0x7a7/0x1a40 balance_pgdat+0x64e/0xfe0 kswapd+0x590/0xa80 kthread+0x38c/0x460 ret_from_fork+0x22/0x30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&xfs_nondir_ilock_class); lock(fs_reclaim); lock(&xfs_nondir_ilock_class); *** DEADLOCK *** 3 locks held by kswapd0/288: #0: ffffffff848cc1e0 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30 #1: ffffffff848a08d8 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x269/0x5c0 #2: ffff8881a7a820e8 (&type->s_umount_key#60){++++}-{3:3}, at: super_cache_scan+0x5a/0x510 Link: https://lkml.kernel.org/r/20210907055659.3182992-1-naohiro.aota@wdc.com Signed-off-by: Naohiro Aota Acked-by: Catalin Marinas Cc: "Darrick J . Wong" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 10994316089c9682f2fbe0be0b1e82bcaf5f4e8c Author: Liam Howlett Date: Wed Sep 8 18:10:14 2021 -0700 mmap_lock: change trace and locking order Print to the trace log before releasing the lock to avoid racing with other trace log printers of the same lock type. Link: https://lkml.kernel.org/r/20210903022041.1843024-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Steven Rostedt (VMware) Reviewed-by: Matthew Wilcox (Oracle) Cc: Michel Lespinasse Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 053cfda102306a3394012f9fe2594811c34925e4 Author: Miaohe Lin Date: Wed Sep 8 18:10:11 2021 -0700 mm/page_alloc.c: avoid accessing uninitialized pcp page migratetype If it's not prepared to free unref page, the pcp page migratetype is unset. Thus we will get rubbish from get_pcppage_migratetype() and might list_del(&page->lru) again after it's already deleted from the list leading to grumble about data corruption. Link: https://lkml.kernel.org/r/20210902115447.57050-1-linmiaohe@huawei.com Fixes: df1acc856923 ("mm/page_alloc: avoid conflating IRQs disabled with zone->lock") Signed-off-by: Miaohe Lin Acked-by: Mel Gorman Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 32d4f4b782bb8f0ceb78c6b5dc46eb577ae25bf7 Author: Rik van Riel Date: Wed Sep 8 18:10:08 2021 -0700 mm,vmscan: fix divide by zero in get_scan_count Commit f56ce412a59d ("mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim") introduced a divide by zero corner case when oomd is being used in combination with cgroup memory.low protection. When oomd decides to kill a cgroup, it will force the cgroup memory to be reclaimed after killing the tasks, by writing to the memory.max file for that cgroup, forcing the remaining page cache and reclaimable slab to be reclaimed down to zero. Previously, on cgroups with some memory.low protection that would result in the memory being reclaimed down to the memory.low limit, or likely not at all, having the page cache reclaimed asynchronously later. With f56ce412a59d the oomd write to memory.max tries to reclaim all the way down to zero, which may race with another reclaimer, to the point of ending up with the divide by zero below. This patch implements the obvious fix. Link: https://lkml.kernel.org/r/20210826220149.058089c6@imladris.surriel.com Fixes: f56ce412a59d ("mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim") Signed-off-by: Rik van Riel Acked-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: Chris Down Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 13db8c50477d83ad3e3b9b0ae247e5cd833a7ae4 Author: Liu Zixian Date: Wed Sep 8 18:10:05 2021 -0700 mm/hugetlb: initialize hugetlb_usage in mm_init After fork, the child process will get incorrect (2x) hugetlb_usage. If a process uses 5 2MB hugetlb pages in an anonymous mapping, HugetlbPages: 10240 kB and then forks, the child will show, HugetlbPages: 20480 kB The reason for double the amount is because hugetlb_usage will be copied from the parent and then increased when we copy page tables from parent to child. Child will have 2x actual usage. Fix this by adding hugetlb_count_init in mm_init. Link: https://lkml.kernel.org/r/20210826071742.877-1-liuzixian4@huawei.com Fixes: 5d317b2b6536 ("mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status") Signed-off-by: Liu Zixian Reviewed-by: Naoya Horiguchi Reviewed-by: Mike Kravetz Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4b42fb213678d2b6a9eeea92a9be200f23e49583 Author: Li Zhijian Date: Wed Sep 8 18:10:02 2021 -0700 mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled Previously, we noticed the one rpma example was failed[1] since commit 36f30e486dce ("IB/core: Improve ODP to use hmm_range_fault()"), where it will use ODP feature to do RDMA WRITE between fsdax files. After digging into the code, we found hmm_vma_handle_pte() will still return EFAULT even though all the its requesting flags has been fulfilled. That's because a DAX page will be marked as (_PAGE_SPECIAL | PAGE_DEVMAP) by pte_mkdevmap(). Link: https://github.com/pmem/rpma/issues/1142 [1] Link: https://lkml.kernel.org/r/20210830094232.203029-1-lizhijian@cn.fujitsu.com Fixes: 405506274922 ("mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling") Signed-off-by: Li Zhijian Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 009ad9f0c6eed0caa7943bc46aa1ae2cb8c382fb Author: Jens Axboe Date: Wed Sep 8 19:07:26 2021 -0600 io_uring: drop ctx->uring_lock before acquiring sqd->lock The SQPOLL thread dictates the lock order, and we hold the ctx->uring_lock for all the registration opcodes. We also hold a ref to the ctx, and we do drop the lock for other reasons to quiesce, so it's fine to drop the ctx lock temporarily to grab the sqd->lock. This fixes the following lockdep splat: ====================================================== WARNING: possible circular locking dependency detected 5.14.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/25433 is trying to acquire lock: ffff888023426870 (&sqd->lock){+.+.}-{3:3}, at: io_register_iowq_max_workers fs/io_uring.c:10551 [inline] ffff888023426870 (&sqd->lock){+.+.}-{3:3}, at: __io_uring_register fs/io_uring.c:10757 [inline] ffff888023426870 (&sqd->lock){+.+.}-{3:3}, at: __do_sys_io_uring_register+0x10aa/0x2e70 fs/io_uring.c:10792 but task is already holding lock: ffff8880885b40a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_register+0x2e1/0x2e70 fs/io_uring.c:10791 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ctx->uring_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:596 [inline] __mutex_lock+0x131/0x12f0 kernel/locking/mutex.c:729 __io_sq_thread fs/io_uring.c:7291 [inline] io_sq_thread+0x65a/0x1370 fs/io_uring.c:7368 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #0 (&sqd->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __mutex_lock_common kernel/locking/mutex.c:596 [inline] __mutex_lock+0x131/0x12f0 kernel/locking/mutex.c:729 io_register_iowq_max_workers fs/io_uring.c:10551 [inline] __io_uring_register fs/io_uring.c:10757 [inline] __do_sys_io_uring_register+0x10aa/0x2e70 fs/io_uring.c:10792 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ctx->uring_lock); lock(&sqd->lock); lock(&ctx->uring_lock); lock(&sqd->lock); *** DEADLOCK *** Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers") Reported-by: syzbot+97fa56483f69d677969f@syzkaller.appspotmail.com Signed-off-by: Jens Axboe commit 730bf31b8fc8e94f3d2d58aaee5f07e5f1f8146f Merge: 30f349097897c 4665584888ad2 Author: Linus Torvalds Date: Wed Sep 8 16:43:46 2021 -0700 Merge tag 'tag-chrome-platform-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: "cros_ec_typec: - make the cros_ec_typec driver to use the pre-existing cros_ec_check_features() function sensorhub: - add trace events for sample misc: - cros_ec_proto - re-send commands in the event of a timeout (for the FPMCU) - fix warnings in cros_ec_trace related to format output" * tag 'tag-chrome-platform-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_trace: Fix format warnings platform/chrome: cros_ec_typec: Use existing feature check platform/chrome: cros_ec_proto: Send command again when timeout occurs platform/chrome: sensorhub: Add trace events for sample commit 30f349097897c115345beabeecc5e710b479ff1e Merge: 9c566611ac5cc f76c87e8c3376 Author: Linus Torvalds Date: Wed Sep 8 16:38:25 2021 -0700 Merge tag 'pm-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These are mostly ARM cpufreq driver updates, including one new MediaTek driver that has just passed all of the reviews, with the addition of a revert of a recent intel_pstate commit, some core cpufreq changes and a DT-related update of the operating performance points (OPP) support code. Specifics: - Add new cpufreq driver for the MediaTek MT6779 platform called mediatek-hw along with corresponding DT bindings (Hector.Yuan). - Add DCVS interrupt support to the qcom-cpufreq-hw driver (Thara Gopinath). - Make the qcom-cpufreq-hw driver set the dvfs_possible_from_any_cpu policy flag (Taniya Das). - Blocklist more Qualcomm platforms in cpufreq-dt-platdev (Bjorn Andersson). - Make the vexpress cpufreq driver set the CPUFREQ_IS_COOLING_DEV flag (Viresh Kumar). - Add new cpufreq driver callback to allow drivers to register with the Energy Model in a consistent way and make several drivers use it (Viresh Kumar). - Change the remaining users of the .ready() cpufreq driver callback to move the code from it elsewhere and drop it from the cpufreq core (Viresh Kumar). - Revert recent intel_pstate change adding HWP guaranteed performance change notification support to it that led to problems, because the notification in question is triggered prematurely on some systems (Rafael Wysocki). - Convert the OPP DT bindings to DT schema and clean them up while at it (Rob Herring)" * tag 'pm-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits) Revert "cpufreq: intel_pstate: Process HWP Guaranteed change notification" cpufreq: mediatek-hw: Add support for CPUFREQ HW cpufreq: Add of_perf_domain_get_sharing_cpumask dt-bindings: cpufreq: add bindings for MediaTek cpufreq HW cpufreq: Remove ready() callback cpufreq: sh: Remove sh_cpufreq_cpu_ready() cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() cpufreq: qcom-hw: Set dvfs_possible_from_any_cpu cpufreq driver flag cpufreq: blocklist more Qualcomm platforms in cpufreq-dt-platdev cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support cpufreq: scmi: Use .register_em() to register with energy model cpufreq: vexpress: Use .register_em() to register with energy model cpufreq: scpi: Use .register_em() to register with energy model dt-bindings: opp: Convert to DT schema dt-bindings: Clean-up OPP binding node names in examples ARM: dts: omap: Drop references to opp.txt cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy model cpufreq: omap: Use .register_em() to register with energy model cpufreq: mediatek: Use .register_em() to register with energy model cpufreq: imx6q: Use .register_em() to register with energy model ... commit 9c566611ac5cc7b45af943632f7a9b1b6a642991 Merge: 0f4b9289bad35 e543b10cd9d75 Author: Linus Torvalds Date: Wed Sep 8 16:33:21 2021 -0700 Merge tag 'acpi-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These add ACPI support to the PCI VMD driver, improve suspend-to-idle support for AMD platforms and update documentation. Specifics: - Add ACPI support to the PCI VMD driver (Rafael Wysocki) - Rearrange suspend-to-idle support code to reflect the platform firmware expectations on some AMD platforms (Mario Limonciello) - Make SSDT overlays documentation follow the code documented by it more closely (Andy Shevchenko)" * tag 'acpi-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: s2idle: Run both AMD and Microsoft methods if both are supported Documentation: ACPI: Align the SSDT overlays file with the code PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus commit 0f4b9289bad354b606190a4cd54d5222b4e41d98 Merge: 6dcaf9fb623fb 7c5c18bdb6560 Author: Linus Torvalds Date: Wed Sep 8 16:28:14 2021 -0700 Merge tag 'docs-5.15-2' of git://git.lwn.net/linux Pull more documentation updates from Jonathan Corbet: "Another collection of documentation patches, mostly fixes but also includes another set of traditional Chinese translations" * tag 'docs-5.15-2' of git://git.lwn.net/linux: docs: pdfdocs: Fix typo in CJK-language specific font settings docs: kernel-hacking: Remove inappropriate text docs/zh_TW: add translations for zh_TW/filesystems docs/zh_TW: add translations for zh_TW/cpu-freq docs/zh_TW: add translations for zh_TW/arm64 docs/zh_CN: Modify the translator tag and fix the wrong word Documentation/features/vm: correct huge-vmap APIs Documentation: block: blk-mq: Fix small typo in multi-queue docs Documentation: in_irq() cleanup Documentation: arm: marvell: Add 88F6825 model into list Documentation/process/maintainer-pgp-guide: Replace broken link to PGP path finder Documentation: locking: fix references Documentation: Update details of The Linux Kernel Module Programming Guide docs: x86: Remove obsolete information about x86_64 vmalloc() faulting Documentation/process/applying-patches: Activate linux-next man hyperlink commit b83a908498d68fafca931e1276e145b339cac5fb Author: Nick Desaulniers Date: Mon Aug 2 13:23:20 2021 -0700 compiler_attributes.h: move __compiletime_{error|warning} Clang 14 will add support for __attribute__((__error__(""))) and __attribute__((__warning__(""))). To make use of these in __compiletime_error and __compiletime_warning (as used by BUILD_BUG and friends) for newer clang and detect/fallback for older versions of clang, move these to compiler_attributes.h and guard them with __has_attribute preprocessor guards. Link: https://reviews.llvm.org/D106030 Link: https://bugs.llvm.org/show_bug.cgi?id=16428 Link: https://github.com/ClangBuiltLinux/linux/issues/1173 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Reviewed-by: Kees Cook [Reworded, landed in Clang 14] Signed-off-by: Miguel Ojeda commit 6dcaf9fb623fb87b08e3896cdf6116744bf00668 Merge: 1511e5d64a512 ced75a2f5da71 Author: Linus Torvalds Date: Wed Sep 8 16:06:48 2021 -0700 Merge tag 'modules-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux Pull module updates from Jessica Yu: "The only main change I have for this round of updates is the modules MAINTAINERS update. As I find myself with less time to devote to upstream these days, Luis has kindly agreed to help maintain the module loader, to eventually transition to being the primary maintainer. Since Luis is already very involved upstream with experience maintaining various areas of the kernel including the kmod usermode helper, I think he is a great fit for this area of the kernel. Summary: - Add Luis Chamberlain as modules maintainer - Fix for .ctors sections in module linker script" * tag 'modules-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: MAINTAINERS: Add Luis Chamberlain as modules maintainer module: combine constructors in module linker script commit 1511e5d64a51292a84d38e4146304393ebe4d080 Merge: 14e2bc4e8c40a 315511166469a Author: Linus Torvalds Date: Wed Sep 8 16:02:13 2021 -0700 Merge tag 'microblaze-v5.15' of git://git.monstr.eu/linux-2.6-microblaze Pull microblaze update from Michal Simek: - Kbuild clean up * tag 'microblaze-v5.15' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: move core-y in arch/microblaze/Makefile to arch/microblaze/Kbuild commit 3fc3725357414636d91be1558ce8b14f228b4bda Merge: 32b2397c1e56f bdd3c50d83bf7 Author: Dan Williams Date: Wed Sep 8 15:58:13 2021 -0700 Merge branch 'for-5.15/fsdax-cleanups' into for-5.15/libnvdimm Include Christoph's rework of the dax_supported() helpers in the v5.15 libnvdimm update. This supports the ongoing dax-reflink enabling effort. commit 14e2bc4e8c40a876c1ab5597320d523c12a97f39 Merge: 8a05abd0c9384 0c217d5066c84 Author: Linus Torvalds Date: Wed Sep 8 15:55:42 2021 -0700 Merge tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Restore performance on memory-starved servers * tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: improve error response to over-size gss credential SUNRPC: don't pause on incomplete allocation commit 8a05abd0c93841a7bbcf777ec1677a1ad9155793 Merge: 34c59da47329a 05a444d3f90a3 Author: Linus Torvalds Date: Wed Sep 8 15:50:32 2021 -0700 Merge tag 'ceph-for-5.15-rc1' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: - a set of patches to address fsync stalls caused by depending on periodic rather than triggered MDS journal flushes in some cases (Xiubo Li) - a fix for mtime effectively not getting updated in case of competing writers (Jeff Layton) - a couple of fixes for inode reference leaks and various WARNs after "umount -f" (Xiubo Li) - a new ceph.auth_mds extended attribute (Jeff Layton) - a smattering of fixups and cleanups from Jeff, Xiubo and Colin. * tag 'ceph-for-5.15-rc1' of git://github.com/ceph/ceph-client: ceph: fix dereference of null pointer cf ceph: drop the mdsc_get_session/put_session dout messages ceph: lockdep annotations for try_nonblocking_invalidate ceph: don't WARN if we're forcibly removing the session caps ceph: don't WARN if we're force umounting ceph: remove the capsnaps when removing caps ceph: request Fw caps before updating the mtime in ceph_write_iter ceph: reconnect to the export targets on new mdsmaps ceph: print more information when we can't find snaprealm ceph: add ceph_change_snap_realm() helper ceph: remove redundant initializations from mdsc and session ceph: cancel delayed work instead of flushing on mdsc teardown ceph: add a new vxattr to return auth mds for an inode ceph: remove some defunct forward declarations ceph: flush the mdlog before waiting on unsafe reqs ceph: flush mdlog before umounting ceph: make iterate_sessions a global symbol ceph: make ceph_create_session_msg a global symbol ceph: fix comment about short copies in ceph_write_end ceph: fix memory leak on decode error in ceph_handle_caps commit 34c59da47329ac50b9700035e0c3a829e6c3c183 Merge: 2d338201d5311 9c4d94dc9a644 Author: Linus Torvalds Date: Wed Sep 8 15:40:39 2021 -0700 Merge tag '9p-for-5.15-rc1' of git://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: "A couple of harmless fixes, increase max tcp msize (64KB -> 1MB), and increase default msize (8KB -> 128KB) The default increase has been discussed with Christian for the qemu side of things but makes sense for all supported transports" * tag '9p-for-5.15-rc1' of git://github.com/martinetd/linux: net/9p: increase default msize to 128k net/9p: use macro to define default msize net/9p: increase tcp max msize to 1MB 9p/xen: Fix end of loop tests for list_for_each_entry 9p/trans_virtio: Remove sysfs file on probe failure commit a7a08b275a8bbade798c4bdaad07ade68fe7003c Author: Arnd Bergmann Date: Wed Sep 8 15:18:29 2021 -0700 arch: remove compat_alloc_user_space All users of compat_alloc_user_space() and copy_in_user() have been removed from the kernel, only a few functions in sparc remain that can be changed to calling arch_copy_in_user() instead. Link: https://lkml.kernel.org/r/20210727144859.4150043-7-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Eric Biederman Cc: Feng Tang Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 59ab844eed9c6b01d32dcb27b57accc23771b324 Author: Arnd Bergmann Date: Wed Sep 8 15:18:25 2021 -0700 compat: remove some compat entry points These are all handled correctly when calling the native system call entry point, so remove the special cases. Link: https://lkml.kernel.org/r/20210727144859.4150043-6-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Eric Biederman Cc: Feng Tang Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e130242dc351f1cfa2bbeb6766a1486ce936ef88 Author: Arnd Bergmann Date: Wed Sep 8 15:18:21 2021 -0700 mm: simplify compat numa syscalls The compat implementations for mbind, get_mempolicy, set_mempolicy and migrate_pages are just there to handle the subtly different layout of bitmaps on 32-bit hosts. The compat implementation however lacks some of the checks that are present in the native one, in particular for checking that the extra bits are all zero when user space has a larger mask size than the kernel. Worse, those extra bits do not get cleared when copying in or out of the kernel, which can lead to incorrect data as well. Unify the implementation to handle the compat bitmap layout directly in the get_nodes() and copy_nodes_to_user() helpers. Splitting out the get_bitmap() helper from get_nodes() also helps readability of the native case. On x86, two additional problems are addressed by this: compat tasks can pass a bitmap at the end of a mapping, causing a fault when reading across the page boundary for a 64-bit word. x32 tasks might also run into problems with get_mempolicy corrupting data when an odd number of 32-bit words gets passed. On parisc the migrate_pages() system call apparently had the wrong calling convention, as big-endian architectures expect the words inside of a bitmap to be swapped. This is not a problem though since parisc has no NUMA support. [arnd@arndb.de: fix mempolicy crash] Link: https://lkml.kernel.org/r/20210730143417.3700653-1-arnd@kernel.org Link: https://lore.kernel.org/lkml/YQPLG20V3dmOfq3a@osiris/ Link: https://lkml.kernel.org/r/20210727144859.4150043-5-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Eric Biederman Cc: Feng Tang Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b1b561ba73c8ab9c98e5dfd14dc7ee47efb6530 Author: Arnd Bergmann Date: Wed Sep 8 15:18:17 2021 -0700 mm: simplify compat_sys_move_pages The compat move_pages() implementation uses compat_alloc_user_space() for converting the pointer array. Moving the compat handling into the function itself is a bit simpler and lets us avoid the compat_alloc_user_space() call. Link: https://lkml.kernel.org/r/20210727144859.4150043-4-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Eric Biederman Cc: Feng Tang Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5d700a0fd71ded7096b97f01d276efc1a6579613 Author: Arnd Bergmann Date: Wed Sep 8 15:18:13 2021 -0700 kexec: avoid compat_alloc_user_space kimage_alloc_init() expects a __user pointer, so compat_sys_kexec_load() uses compat_alloc_user_space() to convert the layout and put it back onto the user space caller stack. Moving the user space access into the syscall handler directly actually makes the code simpler, as the conversion for compat mode can now be done on kernel memory. Link: https://lkml.kernel.org/r/20210727144859.4150043-3-arnd@kernel.org Link: https://lore.kernel.org/lkml/YPbtsU4GX6PL7%2F42@infradead.org/ Link: https://lore.kernel.org/lkml/m1y2cbzmnw.fsf@fess.ebiederm.org/ Signed-off-by: Arnd Bergmann Co-developed-by: Eric Biederman Co-developed-by: Christoph Hellwig Acked-by: "Eric W. Biederman" Cc: Al Viro Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Feng Tang Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4b692e861619353ce069e547a67c8d0e32d9ef3d Author: Arnd Bergmann Date: Wed Sep 8 15:18:10 2021 -0700 kexec: move locking into do_kexec_load Patch series "compat: remove compat_alloc_user_space", v5. Going through compat_alloc_user_space() to convert indirect system call arguments tends to add complexity compared to handling the native and compat logic in the same code. This patch (of 6): The locking is the same between the native and compat version of sys_kexec_load(), so it can be done in the common implementation to reduce duplication. Link: https://lkml.kernel.org/r/20210727144859.4150043-1-arnd@kernel.org Link: https://lkml.kernel.org/r/20210727144859.4150043-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Co-developed-by: Eric Biederman Co-developed-by: Christoph Hellwig Acked-by: "Eric W. Biederman" Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Al Viro Cc: Feng Tang Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 213ecb3157514486a9ae6848a298b91a79cc2e2a Author: Baolin Wang Date: Wed Sep 8 15:18:06 2021 -0700 mm: migrate: change to use bool type for 'page_was_mapped' Change to use bool type for 'page_was_mapped' variable making it more readable. Link: https://lkml.kernel.org/r/ce1279df18d2c163998c403e0b5ec6d3f6f90f7a.1629447552.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 68a9843f14b6b0d1ce023721814403253d8e9153 Author: Baolin Wang Date: Wed Sep 8 15:18:03 2021 -0700 mm: migrate: fix the incorrect function name in comments since commit a98a2f0c8ce1 ("mm/rmap: split migration into its own function"), the migration ptes establishment has been split into a separate try_to_migrate() function, thus update the related comments. Link: https://lkml.kernel.org/r/5b824bad6183259c916ae6cf42f81d14c6118b06.1629447552.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Yang Shi Reviewed-by: Alistair Popple Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2b9b624f5aef6af608edf541fed973948e27004c Author: Baolin Wang Date: Wed Sep 8 15:18:01 2021 -0700 mm: migrate: introduce a local variable to get the number of pages Use thp_nr_pages() instead of compound_nr() to get the number of pages for THP page, meanwhile introducing a local variable 'nr_pages' to avoid getting the number of pages repeatedly. Link: https://lkml.kernel.org/r/a8e331ac04392ee230c79186330fb05e86a2aa77.1629447552.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c68ed7945701a38f2121ed74e23ff19c2052b4c2 Author: Ingo Molnar Date: Wed Sep 8 15:17:57 2021 -0700 mm/vmstat: protect per cpu variables with preempt disable on RT Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it may not when stats are updated under a local_lock. "preempt_disable" ensures that the same resources is not updated in parallel due to preemption. This patch differs from the preempt-rt version where __count_vm_event and __count_vm_events are also protected. The counters are explicitly "allowed to be to be racy" so there is no need to protect them from preemption. Only the accurate page stats that are updated by a read-modify-write need protection. This patch also differs in that a preempt_[en|dis]able_rt helper is not used. As vmstat is the only user of the helper, it was suggested that it be open-coded in vmstat.c instead of risking the helper being used in unnecessary contexts. Link: https://lkml.kernel.org/r/20210805160019.1137-2-mgorman@techsingularity.net Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cf0ccd033d9cedef870eb8598a55851e680a173 Author: Namjae Jeon Date: Tue Sep 7 08:16:26 2021 +0900 ksmbd: fix control flow issues in sid_to_id() Addresses-Coverity reported Control flow issues in sid_to_id() /fs/ksmbd/smbacl.c: 277 in sid_to_id() 271 272 if (sidtype == SIDOWNER) { 273 kuid_t uid; 274 uid_t id; 275 276 id = le32_to_cpu(psid->sub_auth[psid->num_subauth - 1]); >>> CID 1506810: Control flow issues (NO_EFFECT) >>> This greater-than-or-equal-to-zero comparison of an unsigned value >>> is always true. "id >= 0U". 277 if (id >= 0) { 278 /* 279 * Translate raw sid into kuid in the server's user 280 * namespace. 281 */ 282 uid = make_kuid(&init_user_ns, id); Addresses-Coverity: ("Control flow issues") Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4ffd5264e8ecb20e1826b9474c19738fdecd67e6 Author: Namjae Jeon Date: Tue Sep 7 08:15:21 2021 +0900 ksmbd: fix read of uninitialized variable ret in set_file_basic_info Addresses-Coverity reported Uninitialized variables warninig : /fs/ksmbd/smb2pdu.c: 5525 in set_file_basic_info() 5519 if (!rc) { 5520 inode->i_ctime = ctime; 5521 mark_inode_dirty(inode); 5522 } 5523 inode_unlock(inode); 5524 } >>> CID 1506805: Uninitialized variables (UNINIT) >>> Using uninitialized value "rc". 5525 return rc; 5526 } 5527 5528 static int set_file_allocation_info(struct ksmbd_work *work, 5529 struct ksmbd_file *fp, char *buf) 5530 { Addresses-Coverity: ("Uninitialized variable") Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 36bbeb336584c3551bac72592bcaeeebb430fef1 Author: Colin Ian King Date: Mon Sep 6 14:44:38 2021 +0100 ksmbd: add missing assignments to ret on ndr_read_int64 read calls Currently there are two ndr_read_int64 calls where ret is being checked for failure but ret is not being assigned a return value from the call. Static analyis is reporting the checks on ret as dead code. Fix this. Addresses-Coverity: ("Logical dead code") Reviewed-by: Sergey Senozhatsky Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c57a91fb1ccfa203ba3e31e5a389cb04de5b0561 Author: Pavel Begunkov Date: Wed Sep 8 20:49:17 2021 +0100 io_uring: fix missing mb() before waitqueue_active In case of !SQPOLL, io_cqring_ev_posted_iopoll() doesn't provide a memory barrier required by waitqueue_active(&ctx->poll_wait). There is a wq_has_sleeper(), which does smb_mb() inside, but it's called only for SQPOLL. Fixes: 5fd4617840596 ("io_uring: be smarter about waking multiple CQ ring waiters") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2982e53bcea2274006ed435ee2a77197107d8a29.1631130542.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2d338201d5311bcd79d42f66df4cecbcbc5f4f2c Merge: cc09ee80c3b18 b285437d1d929 Author: Linus Torvalds Date: Wed Sep 8 12:55:35 2021 -0700 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: "147 patches, based on 7d2a07b769330c34b4deabeed939325c77a7ec2f. Subsystems affected by this patch series: mm (memory-hotplug, rmap, ioremap, highmem, cleanups, secretmem, kfence, damon, and vmscan), alpha, percpu, procfs, misc, core-kernel, MAINTAINERS, lib, checkpatch, epoll, init, nilfs2, coredump, fork, pids, criu, kconfig, selftests, ipc, and scripts" * emailed patches from Andrew Morton : (94 commits) scripts: check_extable: fix typo in user error message mm/workingset: correct kernel-doc notations ipc: replace costly bailout check in sysvipc_find_ipc() selftests/memfd: remove unused variable Kconfig.debug: drop selecting non-existing HARDLOCKUP_DETECTOR_ARCH configs: remove the obsolete CONFIG_INPUT_POLLDEV prctl: allow to setup brk for et_dyn executables pid: cleanup the stale comment mentioning pidmap_init(). kernel/fork.c: unexport get_{mm,task}_exe_file coredump: fix memleak in dump_vma_snapshot() fs/coredump.c: log if a core dump is aborted due to changed file permissions nilfs2: use refcount_dec_and_lock() to fix potential UAF nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group nilfs2: fix NULL pointer in nilfs_##name##_attr_release nilfs2: fix memory leak in nilfs_sysfs_create_device_group trap: cleanup trap_init() init: move usermodehelper_enable() to populate_rootfs() ... commit cfd799837dbc48499abb05d1891b3d9992354d3a Author: Masami Hiramatsu Date: Thu Sep 9 04:38:03 2021 +0900 tracing/boot: Fix to loop on only subkeys Since the commit e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") allows to co-exist a value node and key nodes under a node, xbc_node_for_each_child() is not only returning key node but also a value node. In the boot-time tracing using xbc_node_for_each_child() to iterate the events, groups and instances, but those must be key nodes. Thus it must use xbc_node_for_each_subkey(). Link: https://lkml.kernel.org/r/163112988361.74896.2267026262061819145.stgit@devnote2 Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit cc09ee80c3b18ae1a897a30a17fe710b2b2f620a Merge: 49832c819ab85 bd0e7491a931f Author: Linus Torvalds Date: Wed Sep 8 12:36:00 2021 -0700 Merge tag 'mm-slub-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux Pull SLUB updates from Vlastimil Babka: "SLUB: reduce irq disabled scope and make it RT compatible This series was initially inspired by Mel's pcplist local_lock rewrite, and also interest to better understand SLUB's locking and the new primitives and RT variants and implications. It makes SLUB compatible with PREEMPT_RT and generally more preemption-friendly, apparently without significant regressions, as the fast paths are not affected. The main changes to SLUB by this series: - irq disabling is now only done for minimum amount of time needed to protect the strict kmem_cache_cpu fields, and as part of spin lock, local lock and bit lock operations to make them irq-safe - SLUB is fully PREEMPT_RT compatible The series should now be sufficiently tested in both RT and !RT configs, mainly thanks to Mike. The RFC/v1 version also got basic performance screening by Mel that didn't show major regressions. Mike's testing with hackbench of v2 on !RT reported negligible differences [6]: virgin(ish) tip 5.13.0.g60ab3ed-tip 7,320.67 msec task-clock # 7.792 CPUs utilized ( +- 0.31% ) 221,215 context-switches # 0.030 M/sec ( +- 3.97% ) 16,234 cpu-migrations # 0.002 M/sec ( +- 4.07% ) 13,233 page-faults # 0.002 M/sec ( +- 0.91% ) 27,592,205,252 cycles # 3.769 GHz ( +- 0.32% ) 8,309,495,040 instructions # 0.30 insn per cycle ( +- 0.37% ) 1,555,210,607 branches # 212.441 M/sec ( +- 0.42% ) 5,484,209 branch-misses # 0.35% of all branches ( +- 2.13% ) 0.93949 +- 0.00423 seconds time elapsed ( +- 0.45% ) 0.94608 +- 0.00384 seconds time elapsed ( +- 0.41% ) (repeat) 0.94422 +- 0.00410 seconds time elapsed ( +- 0.43% ) 5.13.0.g60ab3ed-tip +slub-local-lock-v2r3 7,343.57 msec task-clock # 7.776 CPUs utilized ( +- 0.44% ) 223,044 context-switches # 0.030 M/sec ( +- 3.02% ) 16,057 cpu-migrations # 0.002 M/sec ( +- 4.03% ) 13,164 page-faults # 0.002 M/sec ( +- 0.97% ) 27,684,906,017 cycles # 3.770 GHz ( +- 0.45% ) 8,323,273,871 instructions # 0.30 insn per cycle ( +- 0.28% ) 1,556,106,680 branches # 211.901 M/sec ( +- 0.31% ) 5,463,468 branch-misses # 0.35% of all branches ( +- 1.33% ) 0.94440 +- 0.00352 seconds time elapsed ( +- 0.37% ) 0.94830 +- 0.00228 seconds time elapsed ( +- 0.24% ) (repeat) 0.93813 +- 0.00440 seconds time elapsed ( +- 0.47% ) (repeat) RT configs showed some throughput regressions, but that's expected tradeoff for the preemption improvements through the RT mutex. It didn't prevent the v2 to be incorporated to the 5.13 RT tree [7], leading to testing exposure and bugfixes. Before the series, SLUB is lockless in both allocation and free fast paths, but elsewhere, it's disabling irqs for considerable periods of time - especially in allocation slowpath and the bulk allocation, where IRQs are re-enabled only when a new page from the page allocator is needed, and the context allows blocking. The irq disabled sections can then include deactivate_slab() which walks a full freelist and frees the slab back to page allocator or unfreeze_partials() going through a list of percpu partial slabs. The RT tree currently has some patches mitigating these, but we can do much better in mainline too. Patches 1-6 are straightforward improvements or cleanups that could exist outside of this series too, but are prerequsities. Patches 7-9 are also preparatory code changes without functional changes, but not so useful without the rest of the series. Patch 10 simplifies the fast paths on systems with preemption, based on (hopefully correct) observation that the current loops to verify tid are unnecessary. Patches 11-20 focus on reducing irq disabled scope in the allocation slowpath: - patch 11 moves disabling of irqs into ___slab_alloc() from its callers, which are the allocation slowpath, and bulk allocation. Instead these callers only disable preemption to stabilize the cpu. - The following patches then gradually reduce the scope of disabled irqs in ___slab_alloc() and the functions called from there. As of patch 14, the re-enabling of irqs based on gfp flags before calling the page allocator is removed from allocate_slab(). As of patch 17, it's possible to reach the page allocator (in case of existing slabs depleted) without disabling and re-enabling irqs a single time. Pathces 21-26 reduce the scope of disabled irqs in functions related to unfreezing percpu partial slab. Patch 27 is preparatory. Patch 28 is adopted from the RT tree and converts the flushing of percpu slabs on all cpus from using IPI to workqueue, so that the processing isn't happening with irqs disabled in the IPI handler. The flushing is not performance critical so it should be acceptable. Patch 29 also comes from RT tree and makes object_map_lock RT compatible. Patch 30 make slab_lock irq-safe on RT where we cannot rely on having irq disabled from the list_lock spin lock usage. Patch 31 changes kmem_cache_cpu->partial handling in put_cpu_partial() from cmpxchg loop to a short irq disabled section, which is used by all other code modifying the field. This addresses a theoretical race scenario pointed out by Jann, and makes the critical section safe wrt with RT local_lock semantics after the conversion in patch 35. Patch 32 changes preempt disable to migrate disable, so that the nested list_lock spinlock is safe to take on RT. Because migrate_disable() is a function call even on !RT, a small set of private wrappers is introduced to keep using the cheaper preempt_disable() on !PREEMPT_RT configurations. As of this patch, SLUB should be already compatible with RT's lock semantics. Finally, patch 33 changes irq disabled sections that protect kmem_cache_cpu fields in the slow paths, with a local lock. However on PREEMPT_RT it means the lockless fast paths can now preempt slow paths which don't expect that, so the local lock has to be taken also in the fast paths and they are no longer lockless. RT folks seem to not mind this tradeoff. The patch also updates the locking documentation in the file's comment" Mike Galbraith and Mel Gorman verified that their earlier testing observations still hold for the final series: Link: https://lore.kernel.org/lkml/89ba4f783114520c167cc915ba949ad2c04d6790.camel@gmx.de/ Link: https://lore.kernel.org/lkml/20210907082010.GB3959@techsingularity.net/ * tag 'mm-slub-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux: (33 commits) mm, slub: convert kmem_cpu_slab protection to local_lock mm, slub: use migrate_disable() on PREEMPT_RT mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg mm, slub: make slab_lock() disable irqs with PREEMPT_RT mm: slub: make object_map_lock a raw_spinlock_t mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context mm, slab: split out the cpu offline variant of flush_slab() mm, slub: don't disable irqs in slub_cpu_dead() mm, slub: only disable irq with spin_lock in __unfreeze_partials() mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing mm, slub: detach whole partial list at once in unfreeze_partials() mm, slub: discard slabs in unfreeze_partials() without irqs disabled mm, slub: move irq control into unfreeze_partials() mm, slub: call deactivate_slab() without disabling irqs mm, slub: make locking in deactivate_slab() irq-safe mm, slub: move reset of c->page and freelist out of deactivate_slab() mm, slub: stop disabling irqs around get_partial() mm, slub: check new pages with restored irqs mm, slub: validate slab from partial list or page allocator before making it cpu slab mm, slub: restore irqs around calling new_slab() ... commit 04178ea130a64a50826f17c7cc92774ada7ea9d0 Author: Steven Rostedt (VMware) Date: Tue Sep 7 23:04:29 2021 -0400 selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events The original test for adding and removing eprobes used synthetic events and retrieved the filename from the open system call at the end of the system call. This would allow it to always be loaded into the page tables when accessed. Masami suggested that the test was too complex for just testing add and remove, so it was changed to test just adding and removing an event probe on top of the start of the open system call event. Now it is possible that the filename will not be loaded into memory at the time the eprobe is triggered, and will result in "(fault)" being displayed in the event. This causes the test to fail. Account for "(fault)" also being one of the values of the filename field of the event probe. Link: https://lkml.kernel.org/r/20210907230429.5783d519@rorschach.local.home Fixes: 079db70794ec5 ("selftests/ftrace: Add test case to test adding and removing of event probe") Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit c910db943d35d4ac4b77570ece76e0799af24233 Author: Tom Zanussi Date: Thu Sep 2 15:57:12 2021 -0500 tracing: Dynamically allocate the per-elt hist_elt_data array Setting the hist_elt_data.field_var_str[] array unconditionally to a size of SYNTH_FIELD_MAX elements wastes space unnecessarily. The actual number of elements needed can be calculated at run-time instead. In most cases, this will save a lot of space since it's a per-elt array which isn't normally close to being full. It also allows us to increase SYNTH_FIELD_MAX without worrying about even more wastage when we do that. Link: https://lkml.kernel.org/r/d52ae0ad5e1b59af7c4f54faf3fc098461fd82b3.camel@kernel.org Signed-off-by: Tom Zanussi Tested-by: Artem Bityutskiy Signed-off-by: Steven Rostedt (VMware) commit 0be083cee42ec78ba6f9148f5b12a00aa2fb8bd3 Author: Artem Bityutskiy Date: Wed Sep 1 16:55:13 2021 +0300 tracing: synth events: increase max fields count Sometimes it is useful to construct larger synthetic trace events. Increase 'SYNTH_FIELDS_MAX' (maximum number of fields in a synthetic event) from 32 to 64. Link: https://lkml.kernel.org/r/20210901135513.3087062-1-dedekind1@gmail.com Signed-off-by: Artem Bityutskiy Acked-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 47914d4e591cbbf7ce5103d86257a5d0d8532110 Author: Masami Hiramatsu Date: Sun Sep 5 00:54:46 2021 +0900 tools/bootconfig: Show whole test command for each test case Show whole test command instead of only the 3rd argument. This will clear to show what will be actually tested by each test case. Link: https://lkml.kernel.org/r/163077088607.222577.14786016266462495017.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 903bd067faa837fddb6e5c8b740c3374dc582f04 Author: Julio Faracco Date: Sun Sep 5 00:54:38 2021 +0900 bootconfig: Fix missing return check of xbc_node_compose_key function The function `xbc_show_list should` handle the keys during the composition. Even the errors returned by the compose function. Instead of removing the `ret` variable, it should save the value and show the exact error. This missing variable is causing a compilation issue also. Link: https://lkml.kernel.org/r/163077087861.222577.12884543474750968146.stgit@devnote2 Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Julio Faracco Acked-by: Masami Hiramatsu Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt (VMware) commit 32ba9f0fb027cc43074e3ea26fcf831adeee8e03 Author: Masami Hiramatsu Date: Sun Sep 5 00:54:31 2021 +0900 tools/bootconfig: Fix tracing_on option checking in ftrace2bconf.sh Since tracing_on indicates only "1" (default) or "0", ftrace2bconf.sh only need to check the value is "0". Link: https://lkml.kernel.org/r/163077087144.222577.6888011847727968737.stgit@devnote2 Fixes: 55ed4560774d ("tools/bootconfig: Add tracing_on support to helper scripts") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 26c9c72fd0b960906b6a31a614fb30d2434b166b Author: Masami Hiramatsu Date: Sun Sep 5 00:54:24 2021 +0900 docs: bootconfig: Add how to use bootconfig for kernel parameters Add a section to describe how to use the bootconfig for specifying kernel and init parameters. This is an important section because it is the reason why this document is under the admin-guide. Link: https://lkml.kernel.org/r/163077086399.222577.5881779375643977991.stgit@devnote2 Signed-off-by: Masami Hiramatsu Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Steven Rostedt (VMware) commit b66fbbe8d48228e1e81b583ae39abb86d7d09053 Author: Masami Hiramatsu Date: Sun Sep 5 00:54:16 2021 +0900 init/bootconfig: Reorder init parameter from bootconfig and cmdline Reorder the init parameters from bootconfig and kernel cmdline so that the kernel cmdline always be the last part of the parameters as below. " -- "[bootconfig init params][cmdline init params] This change will help us to prevent that bootconfig init params overwrite the init params which user gives in the command line. Link: https://lkml.kernel.org/r/163077085675.222577.5665176468023636160.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 40caa127f3c7279c75cb0c9684559fa314ee3a66 Author: Masami Hiramatsu Date: Sun Sep 5 00:54:09 2021 +0900 init: bootconfig: Remove all bootconfig data when the init memory is removed Since the bootconfig is used only in the init functions, it doesn't need to keep the data after boot. Free it when the init memory is removed. Link: https://lkml.kernel.org/r/163077084958.222577.5924961258513004428.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 4b6b08f2e45edda4c067ac40833e3c1f84383c0b Author: Qiang.Zhang Date: Tue Aug 31 10:29:19 2021 +0800 tracing/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthreads() When start_kthread() return error, the cpus_read_unlock() need to be called. Link: https://lkml.kernel.org/r/20210831022919.27630-1-qiang.zhang@windriver.com Cc: Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations") Acked-by: Daniel Bristot de Oliveira Signed-off-by: Qiang.Zhang Signed-off-by: Steven Rostedt (VMware) commit 3265cc3ec52e75fc8daf189954cebda27ad26b2e Author: Aubrey Li Date: Wed Sep 8 18:55:45 2021 +0800 ACPI: PRM: Find PRMT table before parsing it Find and verify PRMT before parsing it, which eliminates a warning on machines without PRMT: [ 7.197173] ACPI: PRMT not present Fixes: cefc7ca46235 ("ACPI: PRM: implement OperationRegion handler for the PlatformRtMechanism subtype") Signed-off-by: Aubrey Li Tested-by: Paul Menzel Cc: 5.14+ # 5.14+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 34b1999da935a33be6239226bfa6cd4f704c5c88 Author: Mike Rapoport Date: Thu Aug 19 16:27:17 2021 +0300 x86/mm: Fix kern_addr_valid() to cope with existing but not present entries Jiri Olsa reported a fault when running: # cat /proc/kallsyms | grep ksys_read ffffffff8136d580 T ksys_read # objdump -d --start-address=0xffffffff8136d580 --stop-address=0xffffffff8136d590 /proc/kcore /proc/kcore: file format elf64-x86-64 Segmentation fault general protection fault, probably for non-canonical address 0xf887ffcbff000: 0000 [#1] SMP PTI CPU: 12 PID: 1079 Comm: objdump Not tainted 5.14.0-rc5qemu+ #508 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-4.fc34 04/01/2014 RIP: 0010:kern_addr_valid Call Trace: read_kcore ? rcu_read_lock_sched_held ? rcu_read_lock_sched_held ? rcu_read_lock_sched_held ? trace_hardirqs_on ? rcu_read_lock_sched_held ? lock_acquire ? lock_acquire ? rcu_read_lock_sched_held ? lock_acquire ? rcu_read_lock_sched_held ? rcu_read_lock_sched_held ? rcu_read_lock_sched_held ? lock_release ? _raw_spin_unlock ? __handle_mm_fault ? rcu_read_lock_sched_held ? lock_acquire ? rcu_read_lock_sched_held ? lock_release proc_reg_read ? vfs_read vfs_read ksys_read do_syscall_64 entry_SYSCALL_64_after_hwframe The fault happens because kern_addr_valid() dereferences existent but not present PMD in the high kernel mappings. Such PMDs are created when free_kernel_image_pages() frees regions larger than 2Mb. In this case, a part of the freed memory is mapped with PMDs and the set_memory_np_noalias() -> ... -> __change_page_attr() sequence will mark the PMD as not present rather than wipe it completely. Have kern_addr_valid() check whether higher level page table entries are present before trying to dereference them to fix this issue and to avoid similar issues in the future. Stable backporting note: ------------------------ Note that the stable marking is for all active stable branches because there could be cases where pagetable entries exist but are not valid - see 9a14aefc1d28 ("x86: cpa, fix lookup_address"), for example. So make sure to be on the safe side here and use pXY_present() accessors rather than pXY_none() which could #GP when accessing pages in the direct map. Also see: c40a56a7818c ("x86/mm/init: Remove freed kernel image areas from alias mapping") for more info. Reported-by: Jiri Olsa Signed-off-by: Mike Rapoport Signed-off-by: Borislav Petkov Reviewed-by: David Hildenbrand Acked-by: Dave Hansen Tested-by: Jiri Olsa Cc: # 4.4+ Link: https://lkml.kernel.org/r/20210819132717.19358-1-rppt@kernel.org commit b285437d1d929785a5bef3603da78d2cd5341893 Author: Randy Dunlap Date: Tue Sep 7 20:00:59 2021 -0700 scripts: check_extable: fix typo in user error message Fix typo ("and" should be "an") in an error message. Link: https://lkml.kernel.org/r/20210727002943.29774-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Quentin Casasnovas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 560a870570287aeb0e77825ae0fa1aba47031cf9 Author: Randy Dunlap Date: Tue Sep 7 20:00:56 2021 -0700 mm/workingset: correct kernel-doc notations Use the documented kernel-doc format to prevent kernel-doc warnings. mm/workingset.c:256: warning: No description found for return value of 'workingset_eviction' mm/workingset.c:285: warning: Function parameter or member 'folio' not described in 'workingset_refault' mm/workingset.c:285: warning: Excess function parameter 'page' description in 'workingset_refault' Link: https://lkml.kernel.org/r/20210808203153.10678-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20401d1058f3f841f35a594ac2fc1293710e55b9 Author: Rafael Aquini Date: Tue Sep 7 20:00:53 2021 -0700 ipc: replace costly bailout check in sysvipc_find_ipc() sysvipc_find_ipc() was left with a costly way to check if the offset position fed to it is bigger than the total number of IPC IDs in use. So much so that the time it takes to iterate over /proc/sysvipc/* files grows exponentially for a custom benchmark that creates "N" SYSV shm segments and then times the read of /proc/sysvipc/shm (milliseconds): 12 msecs to read 1024 segs from /proc/sysvipc/shm 18 msecs to read 2048 segs from /proc/sysvipc/shm 65 msecs to read 4096 segs from /proc/sysvipc/shm 325 msecs to read 8192 segs from /proc/sysvipc/shm 1303 msecs to read 16384 segs from /proc/sysvipc/shm 5182 msecs to read 32768 segs from /proc/sysvipc/shm The root problem lies with the loop that computes the total amount of ids in use to check if the "pos" feeded to sysvipc_find_ipc() grew bigger than "ids->in_use". That is a quite inneficient way to get to the maximum index in the id lookup table, specially when that value is already provided by struct ipc_ids.max_idx. This patch follows up on the optimization introduced via commit 15df03c879836 ("sysvipc: make get_maxid O(1) again") and gets rid of the aforementioned costly loop replacing it by a simpler checkpoint based on ipc_get_maxidx() returned value, which allows for a smooth linear increase in time complexity for the same custom benchmark: 2 msecs to read 1024 segs from /proc/sysvipc/shm 2 msecs to read 2048 segs from /proc/sysvipc/shm 4 msecs to read 4096 segs from /proc/sysvipc/shm 9 msecs to read 8192 segs from /proc/sysvipc/shm 19 msecs to read 16384 segs from /proc/sysvipc/shm 39 msecs to read 32768 segs from /proc/sysvipc/shm Link: https://lkml.kernel.org/r/20210809203554.1562989-1-aquini@redhat.com Signed-off-by: Rafael Aquini Acked-by: Davidlohr Bueso Acked-by: Manfred Spraul Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d42990f486b56ce4381edd42a47119c073b131d5 Author: Greg Thelen Date: Tue Sep 7 20:00:50 2021 -0700 selftests/memfd: remove unused variable Commit 544029862cbb ("selftests/memfd: add tests for F_SEAL_FUTURE_WRITE seal") added an unused variable to mfd_assert_reopen_fd(). Delete the unused variable. Link: https://lkml.kernel.org/r/20210702045509.1517643-1-gthelen@google.com Fixes: 544029862cbb ("selftests/memfd: add tests for F_SEAL_FUTURE_WRITE seal") Signed-off-by: Greg Thelen Cc: Shuah Khan Cc: Michael Ellerman Cc: "Joel Fernandes (Google)" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6fe26259b4884b657cbc233fb9cdade9d704976e Author: Lukas Bulwahn Date: Tue Sep 7 20:00:47 2021 -0700 Kconfig.debug: drop selecting non-existing HARDLOCKUP_DETECTOR_ARCH Commit 05a4a9527931 ("kernel/watchdog: split up config options") adds a new config HARDLOCKUP_DETECTOR, which selects the non-existing config HARDLOCKUP_DETECTOR_ARCH. Hence, ./scripts/checkkconfigsymbols.py warns: HARDLOCKUP_DETECTOR_ARCH Referencing files: lib/Kconfig.debug Simply drop selecting the non-existing HARDLOCKUP_DETECTOR_ARCH. Link: https://lkml.kernel.org/r/20210806115618.22088-1-lukas.bulwahn@gmail.com Fixes: 05a4a9527931 ("kernel/watchdog: split up config options") Signed-off-by: Lukas Bulwahn Cc: Nicholas Piggin Cc: Masahiro Yamada Cc: Babu Moger Cc: Don Zickus Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cb398fe1bf127c1e9eff40969454b289f219c43 Author: Zenghui Yu Date: Tue Sep 7 20:00:44 2021 -0700 configs: remove the obsolete CONFIG_INPUT_POLLDEV This CONFIG option was removed in commit 278b13ce3a89 ("Input: remove input_polled_dev implementation") so there's no point to keep it in defconfigs any longer. Get rid of the leftover for all arches. Link: https://lkml.kernel.org/r/20210726074741.1062-1-yuzenghui@huawei.com Signed-off-by: Zenghui Yu Cc: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1fbbd073137a9d63279f6bf363151a938347640 Author: Cyrill Gorcunov Date: Tue Sep 7 20:00:41 2021 -0700 prctl: allow to setup brk for et_dyn executables Keno Fischer reported that when a binray loaded via ld-linux-x the prctl(PR_SET_MM_MAP) doesn't allow to setup brk value because it lays before mm:end_data. For example a test program shows | # ~/t | | start_code 401000 | end_code 401a15 | start_stack 7ffce4577dd0 | start_data 403e10 | end_data 40408c | start_brk b5b000 | sbrk(0) b5b000 and when executed via ld-linux | # /lib64/ld-linux-x86-64.so.2 ~/t | | start_code 7fc25b0a4000 | end_code 7fc25b0c4524 | start_stack 7fffcc6b2400 | start_data 7fc25b0ce4c0 | end_data 7fc25b0cff98 | start_brk 55555710c000 | sbrk(0) 55555710c000 This of course prevent criu from restoring such programs. Looking into how kernel operates with brk/start_brk inside brk() syscall I don't see any problem if we allow to setup brk/start_brk without checking for end_data. Even if someone pass some weird address here on a purpose then the worst possible result will be an unexpected unmapping of existing vma (own vma, since prctl works with the callers memory) but test for RLIMIT_DATA is still valid and a user won't be able to gain more memory in case of expanding VMAs via new values shipped with prctl call. Link: https://lkml.kernel.org/r/20210121221207.GB2174@grain Fixes: bbdc6076d2e5 ("binfmt_elf: move brk out of mmap when doing direct loader exec") Signed-off-by: Cyrill Gorcunov Reported-by: Keno Fischer Acked-by: Andrey Vagin Tested-by: Andrey Vagin Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Kirill Tkhai Cc: Eric W. Biederman Cc: Pavel Tikhomirov Cc: Alexander Mikhalitsyn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b91a75b3312c03798f555e10569fd85211a490c Author: Takahiro Itazuri Date: Tue Sep 7 20:00:38 2021 -0700 pid: cleanup the stale comment mentioning pidmap_init(). pidmap_init() has already been replaced with pid_idr_init() in the commit 95846ecf9dac ("pid: replace pid bitmap implementation with IDR API"). Cleanup the stale comment which still mentions it. Link: https://lkml.kernel.org/r/20210714120713.19825-1-itazur@amazon.com Signed-off-by: Takahiro Itazuri Cc: Kuniyuki Iwashima Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 05da8113c9ba63a8913e6c73dc06ed01cae55f68 Author: Christoph Hellwig Date: Tue Sep 7 20:00:35 2021 -0700 kernel/fork.c: unexport get_{mm,task}_exe_file Only used by core code and the tomoyo which can't be a module either. Link: https://lkml.kernel.org/r/20210820095430.445242-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6fcac87e1f9e5b27805a2a404f4849194bb51de8 Author: QiuXi Date: Tue Sep 7 20:00:32 2021 -0700 coredump: fix memleak in dump_vma_snapshot() dump_vma_snapshot() allocs memory for *vma_meta, when dump_vma_snapshot() returns -EFAULT, the memory will be leaked, so we free it correctly. Link: https://lkml.kernel.org/r/20210810020441.62806-1-qiuxi1@huawei.com Fixes: a07279c9a8cd7 ("binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot") Signed-off-by: QiuXi Cc: Al Viro Cc: Jann Horn Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dbd9d6f8fa9c3e676e491ac65c7fa10a1af8321f Author: David Oberhollenzer Date: Tue Sep 7 20:00:29 2021 -0700 fs/coredump.c: log if a core dump is aborted due to changed file permissions For obvious security reasons, a core dump is aborted if the filesystem cannot preserve ownership or permissions of the dump file. This affects filesystems like e.g. vfat, but also something like a 9pfs share in a Qemu test setup, running as a regular user, depending on the security model used. In those cases, the result is an empty core file and a confused user. To hopefully save other people a lot of time figuring out the cause, this patch adds a simple log message for those specific cases. [akpm@linux-foundation.org: s/|%s/%s/ in printk text] Link: https://lkml.kernel.org/r/20210701233151.102720-1-david.oberhollenzer@sigma-star.at Signed-off-by: David Oberhollenzer Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 98e2e409e76ef7781d8511f997359e9c504a95c1 Author: Zhen Lei Date: Tue Sep 7 20:00:26 2021 -0700 nilfs2: use refcount_dec_and_lock() to fix potential UAF When the refcount is decreased to 0, the resource reclamation branch is entered. Before CPU0 reaches the race point (1), CPU1 may obtain the spinlock and traverse the rbtree to find 'root', see nilfs_lookup_root(). Although CPU1 will call refcount_inc() to increase the refcount, it is obviously too late. CPU0 will release 'root' directly, CPU1 then accesses 'root' and triggers UAF. Use refcount_dec_and_lock() to ensure that both the operations of decrease refcount to 0 and link deletion are lock protected eliminates this risk. CPU0 CPU1 nilfs_put_root(): <-------- (1) spin_lock(&nilfs->ns_cptree_lock); rb_erase(&root->rb_node, &nilfs->ns_cptree); spin_unlock(&nilfs->ns_cptree_lock); kfree(root); <-------- use-after-free refcount_t: underflow; use-after-free. WARNING: CPU: 2 PID: 9476 at lib/refcount.c:28 \ refcount_warn_saturate+0x1cf/0x210 lib/refcount.c:28 Modules linked in: CPU: 2 PID: 9476 Comm: syz-executor.0 Not tainted 5.10.45-rc1+ #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), ... RIP: 0010:refcount_warn_saturate+0x1cf/0x210 lib/refcount.c:28 ... ... Call Trace: __refcount_sub_and_test include/linux/refcount.h:283 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] nilfs_put_root+0xc1/0xd0 fs/nilfs2/the_nilfs.c:795 nilfs_segctor_destroy fs/nilfs2/segment.c:2749 [inline] nilfs_detach_log_writer+0x3fa/0x570 fs/nilfs2/segment.c:2812 nilfs_put_super+0x2f/0xf0 fs/nilfs2/super.c:467 generic_shutdown_super+0xcd/0x1f0 fs/super.c:464 kill_block_super+0x4a/0x90 fs/super.c:1446 deactivate_locked_super+0x6a/0xb0 fs/super.c:335 deactivate_super+0x85/0x90 fs/super.c:366 cleanup_mnt+0x277/0x2e0 fs/namespace.c:1118 __cleanup_mnt+0x15/0x20 fs/namespace.c:1125 task_work_run+0x8e/0x110 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0x13c/0x170 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x16/0x30 kernel/entry/common.c:266 do_syscall_64+0x45/0x80 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 There is no reproduction program, and the above is only theoretical analysis. Link: https://lkml.kernel.org/r/1629859428-5906-1-git-send-email-konishi.ryusuke@gmail.com Fixes: ba65ae4729bf ("nilfs2: add checkpoint tree to nilfs object") Link: https://lkml.kernel.org/r/20210723012317.4146-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 17243e1c3072b8417a5ebfc53065d0a87af7ca77 Author: Nanyong Sun Date: Tue Sep 7 20:00:23 2021 -0700 nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group kobject_put() should be used to cleanup the memory associated with the kobject instead of kobject_del(). See the section "Kobject removal" of "Documentation/core-api/kobject.rst". Link: https://lkml.kernel.org/r/20210629022556.3985106-7-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-7-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b2fe39c248f3fa4bbb2a20759b4fdd83504190f7 Author: Nanyong Sun Date: Tue Sep 7 20:00:21 2021 -0700 nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group If kobject_init_and_add returns with error, kobject_put() is needed here to avoid memory leak, because kobject_init_and_add may return error without freeing the memory associated with the kobject it allocated. Link: https://lkml.kernel.org/r/20210629022556.3985106-6-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-6-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3e181259ddd61fd378390977a1e4e2316853afa Author: Nanyong Sun Date: Tue Sep 7 20:00:18 2021 -0700 nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group The kobject_put() should be used to cleanup the memory associated with the kobject instead of kobject_del. See the section "Kobject removal" of "Documentation/core-api/kobject.rst". Link: https://lkml.kernel.org/r/20210629022556.3985106-5-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-5-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 24f8cb1ed057c840728167dab33b32e44147c86f Author: Nanyong Sun Date: Tue Sep 7 20:00:15 2021 -0700 nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group If kobject_init_and_add return with error, kobject_put() is needed here to avoid memory leak, because kobject_init_and_add may return error without freeing the memory associated with the kobject it allocated. Link: https://lkml.kernel.org/r/20210629022556.3985106-4-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-4-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dbc6e7d44a514f231a64d9d5676e001b660b6448 Author: Nanyong Sun Date: Tue Sep 7 20:00:12 2021 -0700 nilfs2: fix NULL pointer in nilfs_##name##_attr_release In nilfs_##name##_attr_release, kobj->parent should not be referenced because it is a NULL pointer. The release() method of kobject is always called in kobject_put(kobj), in the implementation of kobject_put(), the kobj->parent will be assigned as NULL before call the release() method. So just use kobj to get the subgroups, which is more efficient and can fix a NULL pointer reference problem. Link: https://lkml.kernel.org/r/20210629022556.3985106-3-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-3-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5f5dec07aca7067216ed4c1342e464e7307a9197 Author: Nanyong Sun Date: Tue Sep 7 20:00:09 2021 -0700 nilfs2: fix memory leak in nilfs_sysfs_create_device_group Patch series "nilfs2: fix incorrect usage of kobject". This patchset from Nanyong Sun fixes memory leak issues and a NULL pointer dereference issue caused by incorrect usage of kboject in nilfs2 sysfs implementation. This patch (of 6): Reported by syzkaller: BUG: memory leak unreferenced object 0xffff888100ca8988 (size 8): comm "syz-executor.1", pid 1930, jiffies 4294745569 (age 18.052s) hex dump (first 8 bytes): 6c 6f 6f 70 31 00 ff ff loop1... backtrace: kstrdup+0x36/0x70 mm/util.c:60 kstrdup_const+0x35/0x60 mm/util.c:83 kvasprintf_const+0xf1/0x180 lib/kasprintf.c:48 kobject_set_name_vargs+0x56/0x150 lib/kobject.c:289 kobject_add_varg lib/kobject.c:384 [inline] kobject_init_and_add+0xc9/0x150 lib/kobject.c:473 nilfs_sysfs_create_device_group+0x150/0x7d0 fs/nilfs2/sysfs.c:986 init_nilfs+0xa21/0xea0 fs/nilfs2/the_nilfs.c:637 nilfs_fill_super fs/nilfs2/super.c:1046 [inline] nilfs_mount+0x7b4/0xe80 fs/nilfs2/super.c:1316 legacy_get_tree+0x105/0x210 fs/fs_context.c:592 vfs_get_tree+0x8e/0x2d0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0xf9b/0x1990 fs/namespace.c:3235 do_mount+0xea/0x100 fs/namespace.c:3248 __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x14b/0x1f0 fs/namespace.c:3433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae If kobject_init_and_add return with error, then the cleanup of kobject is needed because memory may be allocated in kobject_init_and_add without freeing. And the place of cleanup_dev_kobject should use kobject_put to free the memory associated with the kobject. As the section "Kobject removal" of "Documentation/core-api/kobject.rst" says, kobject_del() just makes the kobject "invisible", but it is not cleaned up. And no more cleanup will do after cleanup_dev_kobject, so kobject_put is needed here. Link: https://lkml.kernel.org/r/1625651306-10829-1-git-send-email-konishi.ryusuke@gmail.com Link: https://lkml.kernel.org/r/1625651306-10829-2-git-send-email-konishi.ryusuke@gmail.com Reported-by: Hulk Robot Link: https://lkml.kernel.org/r/20210629022556.3985106-2-sunnanyong@huawei.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8b097881b54cbc23dd78262ed88c9924d00ea457 Author: Kefeng Wang Date: Tue Sep 7 20:16:06 2021 -0700 trap: cleanup trap_init() There are some empty trap_init() definitions in different ARCHs, Introduce a new weak trap_init() function to clean them up. Link: https://lkml.kernel.org/r/20210812123602.76356-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Russell King (Oracle) [arm32] Acked-by: Vineet Gupta [arc] Acked-by: Michael Ellerman [powerpc] Cc: Yoshinori Sato Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: James E.J. Bottomley Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b234ed6d629420827e2839c8c8935be85a0867fd Author: Rasmus Villemoes Date: Tue Sep 7 20:00:03 2021 -0700 init: move usermodehelper_enable() to populate_rootfs() Currently, usermodehelper is enabled right before PID1 starts going through the initcalls. However, any call of a usermodehelper from a pure_, core_, postcore_, arch_, subsys_ or fs_ initcall is futile, as there is no filesystem contents yet. Up until commit e7cb072eb988 ("init/initramfs.c: do unpacking asynchronously"), such calls, whether via some request_module(), a legacy uevent "/sbin/hotplug" notification or something else, would just fail silently with (presumably) -ENOENT from kernel_execve(). However, that commit introduced the wait_for_initramfs() synchronization hook which must be called from the usermodehelper exec path right before the kernel_execve, in order that request_module() et al done from *after* rootfs_initcall() time (i.e. device_ and late_ initcalls) would continue to find a populated initramfs as they used to. Any call of wait_for_initramfs() done before the unpacking has been scheduled (i.e. before rootfs_initcall time) must just return immediately [and let the caller find an empty file system] in order not to deadlock the machine. I mistakenly thought, and my limited testing confirmed, that there were no such calls, so I added a pr_warn_once() in wait_for_initramfs(). It turns out that one can indeed hit request_module() as well as kobject_uevent_env() during those early init calls, leading to a user-visible warning in the kernel log emitted consistently for certain configurations. We could just remove the pr_warn_once(), but I think it's better to postpone enabling the usermodehelper framework until there is at least some chance of finding the executable. That is also a little more efficient in that a lot of work done in umh.c will be elided. However, it does change the error seen by those early callers from -ENOENT to -EBUSY, so there is a risk of a regression if any caller care about the exact error value. Link: https://lkml.kernel.org/r/20210728134638.329060-1-linux@rasmusvillemoes.dk Fixes: e7cb072eb988 ("init/initramfs.c: do unpacking asynchronously") Signed-off-by: Rasmus Villemoes Reported-by: Alexander Egorenkov Reported-by: Bruno Goncalves Reported-by: Heiner Kallweit Cc: Luis Chamberlain Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1e1c15839df084f4011825fee922aa976c9159dc Author: Nicholas Piggin Date: Tue Sep 7 20:00:00 2021 -0700 fs/epoll: use a per-cpu counter for user's watches count This counter tracks the number of watches a user has, to compare against the 'max_user_watches' limit. This causes a scalability bottleneck on SPECjbb2015 on large systems as there is only one user. Changing to a per-cpu counter increases throughput of the benchmark by about 30% on a 16-socket, > 1000 thread system. [rdunlap@infradead.org: fix build errors in kernel/user.c when CONFIG_EPOLL=n] [npiggin@gmail.com: move ifdefs into wrapper functions, slightly improve panic message] Link: https://lkml.kernel.org/r/1628051945.fens3r99ox.astroid@bobo.none [akpm@linux-foundation.org: tweak user_epoll_alloc(), per Guenter] Link: https://lkml.kernel.org/r/20210804191421.GA1900577@roeck-us.net Link: https://lkml.kernel.org/r/20210802032013.2751916-1-npiggin@gmail.com Signed-off-by: Nicholas Piggin Reported-by: Anton Blanchard Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4ce9f970457899defdf68e26e0502c7245002eb3 Author: Joe Perches Date: Tue Sep 7 19:59:57 2021 -0700 checkpatch: improve GIT_COMMIT_ID test The preferred git commit id reference has the form commit ("Title line") where SHA-1 is the commit hex hash with a minimum lenth of 12 and ("Title line") is the complete title line of the commit with a (" prefix and ") suffix. The current tests fail when the "Title line" has one or more embedded double quotes. Improve the test that finds the commit SHA-1 hex hash then ("Title line") by using $balanced_parens for a maximum of 3 consecutive lines. [akpm@linux-foundation.org: add missing &&] Link: https://lkml.kernel.org/r/976c6cdd680db4b55ae31b5fc2d1779da5c0dc66.camel@perches.com Signed-off-by: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Cc: Denis Efremov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 046fc741e35e9dee7c7f7c4173ba3d79f938286f Author: Mimi Zohar Date: Tue Sep 7 19:59:54 2021 -0700 checkpatch: make email address check case insensitive Instead of checkpatch requiring the patch author to exactly match the signed-off-by tag, commit 48ca2d8ac8a1 ("checkpatch: add new warnings to author signoff checks.") safely relaxed this requirement. Although the local-part of an email address (local-part@domain), may be case sensitive, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged. Mailbox domains follow normal DNS rules and are hence not case sensitive. (Refer to https://datatracker.ietf.org/doc/html/rfc5321#section-2.4.) Further relax the patch author and signed-off-by tag comparison by making the email address check case insensitive. Link: https://lkml.kernel.org/r/20210816112725.173206-1-zohar@linux.ibm.com Signed-off-by: Mimi Zohar Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d2af5aa6c036d3fd2c1ff3379ffe3e6805929952 Author: Joe Perches Date: Tue Sep 7 19:59:51 2021 -0700 checkpatch: support wide strings Allow prefixing typical strings with L for wide strings and u for unicode strings. Link: https://lkml.kernel.org/r/20210801170733.1.I3f9784fd3c1007d08ec2e70b151d137687575495@changeid Signed-off-by: Joe Perches Signed-off-by: Simon Glass Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7fc5b571325f1bcbe1ce384409b2d05546431b04 Author: Andy Shevchenko Date: Tue Sep 7 19:59:35 2021 -0700 tools: rename bitmap_alloc() to bitmap_zalloc() Rename bitmap_alloc() to bitmap_zalloc() in tools to follow the bitmap API in the kernel. No functional changes intended. Link: https://lkml.kernel.org/r/20210814211713.180533-14-yury.norov@gmail.com Signed-off-by: Andy Shevchenko Signed-off-by: Yury Norov Suggested-by: Yury Norov Acked-by: Yury Norov Tested-by: Wolfram Sang Acked-by: Jiri Olsa Cc: Alexander Lobakin Cc: Alexey Klimov Cc: Dennis Zhou Cc: Ulf Hansson Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 44e5599775541eb5e25d6dfb01d9abbd5ad79823 Author: Randy Dunlap Date: Tue Sep 7 19:58:54 2021 -0700 lib/iov_iter.c: fix kernel-doc warnings Fix all kernel-doc warnings in lib/iov_iter.c: lib/iov_iter.c:695: warning: Function parameter or member 'i' not described in '_copy_mc_to_iter' lib/iov_iter.c:695: warning: Excess function parameter 'iter' description in '_copy_mc_to_iter' lib/iov_iter.c:695: warning: No description found for return value of '_copy_mc_to_iter' lib/iov_iter.c:758: warning: Function parameter or member 'i' not described in '_copy_from_iter_flushcache' lib/iov_iter.c:758: warning: Excess function parameter 'iter' description in '_copy_from_iter_flushcache' lib/iov_iter.c:758: warning: No description found for return value of '_copy_from_iter_flushcache' Link: https://lkml.kernel.org/r/20210809051053.6531-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 83a29beb23bcc770a3838fc33970efbaaad26bf7 Author: Randy Dunlap Date: Tue Sep 7 19:58:51 2021 -0700 lib/dump_stack: correct kernel-doc notation Fix kernel-doc warnings in dump_stack.c: lib/dump_stack.c:97: warning: Function parameter or member 'log_lvl' not described in 'dump_stack_lvl' lib/dump_stack.c:97: warning: expecting prototype for dump_stack(). Prototype was for dump_stack_lvl() instead Link: https://lkml.kernel.org/r/20210809051643.17567-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36f33b562936295a0fb365ea0b1b2afcd8974242 Author: Daniel Latypov Date: Tue Sep 7 19:58:48 2021 -0700 lib/test: convert test_sort.c to use KUnit This follows up commit ebd09577be6c ("lib/test: convert lib/test_list_sort.c to use KUnit"). Converting this test to KUnit makes the test a bit shorter, standardizes how it reports pass/fail, and adds an easier way to run the test [1]. Like ebd09577be6c, this leaves the file and Kconfig option name the same, but slightly changes their dependencies (needs CONFIG_KUNIT). [1] Can be run via $ ./tools/testing/kunit/kunit.py run --kunitconfig /dev/stdin < Cc: Pravin Shedge Cc: Brendan Higgins Cc: David Gow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8ba739ede49dec361ddcb70afe24986b4b8cfe17 Author: Geert Uytterhoeven Date: Tue Sep 7 19:58:36 2021 -0700 math: RATIONAL_KUNIT_TEST should depend on RATIONAL instead of selecting it RATIONAL_KUNIT_TEST selects RATIONAL, thus enabling an optional feature the user may not want to have enabled. Fix this by making the test depend on RATIONAL instead. Link: https://lkml.kernel.org/r/20210706100945.3803694-3-geert@linux-m68k.org Fixes: b6c75c4afceb8bc0 ("lib/math/rational: add Kunit test cases") Signed-off-by: Geert Uytterhoeven Cc: Andy Shevchenko Cc: Brendan Higgins Cc: Colin Ian King Cc: Trent Piepho Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bcda5fd34417c89f653cc0912cc0608b36ea032c Author: Geert Uytterhoeven Date: Tue Sep 7 19:58:33 2021 -0700 math: make RATIONAL tristate Patch series "math: RATIONAL and RATIONAL_KUNIT_TEST improvements". This series makes the RATIONAL symbol tristate, so it is not forced builtin if all users are modular, and makes the RATIONAL_KUNIT_TEST depend on RATIONAL, to avoid enabling RATIONAL if there are no real users. This patch (of 2): All but one symbols that select RATIONAL are tristate, but RATIONAL itself is bool. Change it to tristate, so the rational fractions support code can be modular if no builtin code relies on it. Link: https://lkml.kernel.org/r/20210706100945.3803694-1-geert@linux-m68k.org Link: https://lkml.kernel.org/r/20210706100945.3803694-2-geert@linux-m68k.org Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Cc: Trent Piepho Cc: Colin Ian King Cc: Brendan Higgins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1c3493bb290bc654d13063a88660c070ad4eabcd Author: Nathan Chancellor Date: Tue Sep 7 19:58:30 2021 -0700 Documentation/llvm: update IRC location This should have been done with commit 91ed3ed0f798 ("MAINTAINERS: update ClangBuiltLinux IRC chat") but I did not realize it was in two separate spots. Link: https://lkml.kernel.org/r/20210825211823.6406-3-nathan@kernel.org Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Cc: Kees Cook Cc: Masahiro Yamada Cc: Sami Tolvanen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 28f8fc19b24924a9770bd2e93123005547c3f3f5 Author: Nathan Chancellor Date: Tue Sep 7 19:58:27 2021 -0700 Documentation/llvm: update mailing list We are now at llvm@lists.linux.dev. Link: https://lkml.kernel.org/r/20210825211823.6406-2-nathan@kernel.org Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Cc: Kees Cook Cc: Masahiro Yamada Cc: Sami Tolvanen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 726248b62fbed796c14ab866f0aa7a6ff3c0f201 Author: Nathan Chancellor Date: Tue Sep 7 19:58:24 2021 -0700 MAINTAINERS: update ClangBuiltLinux mailing list We are now at llvm@lists.linux.dev. Link: https://lkml.kernel.org/r/20210825211823.6406-1-nathan@kernel.org Signed-off-by: Nathan Chancellor Acked-by: Nick Desaulniers Cc: Masahiro Yamada Cc: Kees Cook Cc: Sami Tolvanen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2d186afd04d669fe9c48b994c41a7405a3c9f16d Author: Pavel Skripkin Date: Tue Sep 7 19:58:21 2021 -0700 profiling: fix shift-out-of-bounds bugs Syzbot reported shift-out-of-bounds bug in profile_init(). The problem was in incorrect prof_shift. Since prof_shift value comes from userspace we need to clamp this value into [0, BITS_PER_LONG -1] boundaries. Second possible shiht-out-of-bounds was found by Tetsuo: sample_step local variable in read_profile() had "unsigned int" type, but prof_shift allows to make a BITS_PER_LONG shift. So, to prevent possible shiht-out-of-bounds sample_step type was changed to "unsigned long". Also, "unsigned short int" will be sufficient for storing [0, BITS_PER_LONG] value, that's why there is no need for "unsigned long" prof_shift. Link: https://lkml.kernel.org/r/20210813140022.5011-1-paskripkin@gmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-and-tested-by: syzbot+e68c89a9510c159d9684@syzkaller.appspotmail.com Suggested-by: Tetsuo Handa Signed-off-by: Pavel Skripkin Cc: Thomas Gleixner Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c91dda97eea704ac257ddb138d1154adab8db62 Author: Yang Yang Date: Tue Sep 7 19:58:18 2021 -0700 kernel/acct.c: use dedicated helper to access rlimit values Use rlimit() helper instead of manually writing whole chain from task to rlimit value. See patch "posix-cpu-timers: Use dedicated helper to access rlimit values". Link: https://lkml.kernel.org/r/20210728030822.524789-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reported-by: Zeal Robot Cc: Randy Dunlap Cc: sh_def@163.com Cc: Yang Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 18821693b97bd5601d796a41ecc7da9cc2766769 Author: Daniel Lezcano Date: Tue Sep 7 19:58:15 2021 -0700 phy/drivers/stm32: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Link: https://lkml.kernel.org/r/20210816114732.1834145-11-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Andy Shevchenko Cc: Chanwoo Choi Cc: Christian Eggers Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9ef347c3df98ac69d04ff2d959cb5a3c7d4367d0 Author: Daniel Lezcano Date: Tue Sep 7 19:58:11 2021 -0700 mtd/drivers/nand: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Link: https://lkml.kernel.org/r/20210816114732.1834145-10-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Acked-by: Miquel Raynal Reviewed-by: Andy Shevchenko Cc: Chanwoo Choi Cc: Christian Eggers Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09704a941c42296c34955651d7bcc860635f8a59 Author: Daniel Lezcano Date: Tue Sep 7 19:58:08 2021 -0700 i2c/drivers/ov02q10: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Link: https://lkml.kernel.org/r/20210816114732.1834145-9-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Andy Shevchenko Cc: Chanwoo Choi Cc: Christian Eggers Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 87000e7fe0a201572fd8756e3497c0b5ee4f4231 Author: Daniel Lezcano Date: Tue Sep 7 19:58:05 2021 -0700 iio/drivers/hid-sensor: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Link: https://lkml.kernel.org/r/20210816114732.1834145-8-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Andy Shevchenko Acked-by: Jonathan Cameron Cc: Chanwoo Choi Cc: Christian Eggers Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d59eacaac953242853c2e53db0ee7cc25613ae03 Author: Daniel Lezcano Date: Tue Sep 7 19:58:01 2021 -0700 hwmon/drivers/mr75203: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. The new macro is an unsigned long. The code dealing with it is considering as an unsigned long also. Link: https://lkml.kernel.org/r/20210816114732.1834145-7-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Christian Eggers Reviewed-by: Andy Shevchenko Acked-by: Guenter Roeck Cc: Chanwoo Choi Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 55c653e0be71acb70f0dd2235b8c7aabebe3ed98 Author: Daniel Lezcano Date: Tue Sep 7 19:57:58 2021 -0700 iio/drivers/as73211: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Link: https://lkml.kernel.org/r/20210816114732.1834145-6-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Christian Eggers Reviewed-by: Andy Shevchenko Acked-by: Jonathan Cameron Cc: Chanwoo Choi Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 04c8984ae3fa4373948483e367561c79fda7f571 Author: Daniel Lezcano Date: Tue Sep 7 19:57:54 2021 -0700 devfreq: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. The new macro has an unsigned long type. All the code is dealing with unsigned long and the code using the macro is doing a coercitive cast to unsigned long. Link: https://lkml.kernel.org/r/20210816114732.1834145-5-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Christian Eggers Reviewed-by: Andy Shevchenko Acked-by: Chanwoo Choi Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 73b718c617caae17f6e2964fba823e2c18a9b67c Author: Daniel Lezcano Date: Tue Sep 7 19:57:51 2021 -0700 thermal/drivers/devfreq_cooling: use HZ macros HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. The new macro uses a unsigned long type which is already the type in the current code via the 'freq' variable. Link: https://lkml.kernel.org/r/20210816114732.1834145-4-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Andy Shevchenko Reviewed-by: Christian Eggers Cc: Chanwoo Choi Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e2c77032fcbe515194107994d12cd72ddb77b022 Author: Daniel Lezcano Date: Tue Sep 7 19:57:48 2021 -0700 units: add the HZ macros The macros for the unit conversion for frequency are duplicated in different places. Provide these macros in the 'units' header, so they can be reused. Link: https://lkml.kernel.org/r/20210816114732.1834145-3-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Christian Eggers Reviewed-by: Andy Shevchenko Cc: Chanwoo Choi Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9221919a2d2df5741ab074dfec5bdfc6f1e043b Author: Daniel Lezcano Date: Tue Sep 7 19:57:44 2021 -0700 units: change from 'L' to 'UL' Patch series "Add Hz macros", v3. There are multiple definitions of the HZ_PER_MHZ or HZ_PER_KHZ in the different drivers. Instead of duplicating this definition again and again, add one in the units.h header to be reused in all the place the redefiniton occurs. At the same time, change the type of the Watts, as they can not be negative. This patch (of 10): The users of the macros are safe to be assigned with an unsigned instead of signed as the variables using them are themselves unsigned. Link: https://lkml.kernel.org/r/20210816114732.1834145-1-daniel.lezcano@linaro.org Link: https://lkml.kernel.org/r/20210816114732.1834145-2-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Cc: Andy Shevchenko Cc: Jonathan Cameron Cc: Christian Eggers Cc: Lukasz Luba Cc: MyungJoo Ham Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Peter Meerwald Cc: Zhang Rui Cc: Guenter Roeck Cc: Miquel Raynal Cc: Maxime Coquelin Cc: "Rafael J. Wysocki" Cc: Daniel Lezcano Cc: Chanwoo Choi Cc: Jonathan Cameron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a8a47cf5ce4bbc70a54fa4eca71d35f43dc8218a Author: Andy Shevchenko Date: Tue Sep 7 19:57:41 2021 -0700 include/linux/once.h: fix trivia typo Not -> Note Fix trivia typo Not -> Note in the comment to DO_ONCE(). Link: https://lkml.kernel.org/r/20210722184349.76290-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c226bc3cd99bd3535f6a7264c7c7fb0bce16db12 Author: Colin Ian King Date: Tue Sep 7 19:57:38 2021 -0700 arch: Kconfig: fix spelling mistake "seperate" -> "separate" Threre is a spelling mistake in the Kconfig text. Fix it. Link: https://lkml.kernel.org/r/20210704095207.37342-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c2f273ebd89a79ed87ef1025753343e327b99ac9 Author: Ohhoon Kwon Date: Tue Sep 7 19:57:35 2021 -0700 connector: send event on write to /proc/[pid]/comm While comm change event via prctl has been reported to proc connector by 'commit f786ecba4158 ("connector: add comm change event report to proc connector")', connector listeners were missing comm changes by explicit writes on /proc/[pid]/comm. Let explicit writes on /proc/[pid]/comm report to proc connector. Link: https://lkml.kernel.org/r/20210701133458epcms1p68e9eb9bd0eee8903ba26679a37d9d960@epcms1p6 Signed-off-by: Ohhoon Kwon Cc: Ingo Molnar Cc: David S. Miller Cc: Christian Brauner Cc: Eric W. Biederman Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8d23b2080b4ffe530edc324f233c2a5bb192b152 Author: Christoph Hellwig Date: Tue Sep 7 19:57:33 2021 -0700 proc: stop using seq_get_buf in proc_task_name Use seq_escape_str and seq_printf instead of poking holes into the seq_file abstraction. Link: https://lkml.kernel.org/r/20210810151945.1795567-1-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Christian Brauner Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3843c50a782c397422765cf0839a95e75e523229 Author: Greg Kroah-Hartman Date: Tue Sep 7 19:57:27 2021 -0700 percpu: remove export of pcpu_base_addr This is not needed by any modules, so remove the export. Link: https://lkml.kernel.org/r/20210722185814.504541-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Christoph Hellwig Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a9d991c424b4cda5db574b6355f0c627ae59109 Author: Randy Dunlap Date: Tue Sep 7 19:57:24 2021 -0700 alpha: pci-sysfs: fix all kernel-doc warnings Fix all kernel-doc warnings in arch/alpha/kernel/pci-sysfs.c: arch/alpha/kernel/pci-sysfs.c:67: warning: No description found for return value of 'pci_mmap_resource' arch/alpha/kernel/pci-sysfs.c:115: warning: Function parameter or member 'pdev' not described in 'pci_remove_resource_files' arch/alpha/kernel/pci-sysfs.c:115: warning: Excess function parameter 'dev' description in 'pci_remove_resource_files' arch/alpha/kernel/pci-sysfs.c:230: warning: Function parameter or member 'pdev' not described in 'pci_create_resource_files' arch/alpha/kernel/pci-sysfs.c:230: warning: Excess function parameter 'dev' description in 'pci_create_resource_files' arch/alpha/kernel/pci-sysfs.c:232: warning: No description found for return value of 'pci_create_resource_files' arch/alpha/kernel/pci-sysfs.c:305: warning: Function parameter or member 'bus' not described in 'pci_adjust_legacy_attr' arch/alpha/kernel/pci-sysfs.c:305: warning: Excess function parameter 'b' description in 'pci_adjust_legacy_attr' Link: https://lkml.kernel.org/r/20210808185249.31442-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5ecae8f6aafe6ae7c8fb10c3c175f85baf779814 Author: Randy Dunlap Date: Tue Sep 7 19:57:21 2021 -0700 alpha: agp: make empty macros use do-while-0 style Copy these macros from ia64/include/asm/agp.h to avoid the "empty-body" in 'if' statment warning. drivers/char/agp/generic.c: In function 'agp_generic_destroy_page': ../drivers/char/agp/generic.c:1265:42: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] 1265 | unmap_page_from_agp(page); Link: https://lkml.kernel.org/r/20210809030822.20658-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: David Airlie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 75e39b1a3668c008c32c7ffbebe93386e67c7352 Author: SeongJae Park Date: Tue Sep 7 19:57:17 2021 -0700 MAINTAINERS: update for DAMON This commit updates MAINTAINERS file for DAMON related files. Link: https://lkml.kernel.org/r/20210716081449.22187-14-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Markus Boehme Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Fernand Sieber Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b348eb7abd0987b849420113ced27ad7a1bc6cf3 Author: SeongJae Park Date: Tue Sep 7 19:57:13 2021 -0700 mm/damon: add user space selftests This commit adds a simple user space tests for DAMON. The tests are using kselftest framework. Link: https://lkml.kernel.org/r/20210716081449.22187-13-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Markus Boehme Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Fernand Sieber Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 17ccae8bb5c928946f6f3af14626ec458f74e6ad Author: SeongJae Park Date: Tue Sep 7 19:57:09 2021 -0700 mm/damon: add kunit tests This commit adds kunit based unit tests for the core and the virtual address spaces monitoring primitives of DAMON. Link: https://lkml.kernel.org/r/20210716081449.22187-12-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Fernand Sieber Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c4ba6014aec39e74ad3c10229dcfd187c42ee4f3 Author: SeongJae Park Date: Tue Sep 7 19:57:05 2021 -0700 Documentation: add documents for DAMON This commit adds documents for DAMON under `Documentation/admin-guide/mm/damon/` and `Documentation/vm/damon/`. Link: https://lkml.kernel.org/r/20210716081449.22187-11-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Fernand Sieber Reviewed-by: Markus Boehme Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 75c1c2b53c78bf3b3188ebb7b3508dadbf98bba1 Author: SeongJae Park Date: Tue Sep 7 19:57:01 2021 -0700 mm/damon/dbgfs: support multiple contexts In some use cases, users would want to run multiple monitoring context. For example, if a user wants a high precision monitoring and dedicating multiple CPUs for the job is ok, because DAMON creates one monitoring thread per one context, the user can split the monitoring target regions into multiple small regions and create one context for each region. Or, someone might want to simultaneously monitor different address spaces, e.g., both virtual address space and physical address space. The DAMON's API allows such usage, but 'damon-dbgfs' does not. Therefore, only kernel space DAMON users can do multiple contexts monitoring. This commit allows the user space DAMON users to use multiple contexts monitoring by introducing two new 'damon-dbgfs' debugfs files, 'mk_context' and 'rm_context'. Users can create a new monitoring context by writing the desired name of the new context to 'mk_context'. Then, a new directory with the name and having the files for setting of the context ('attrs', 'target_ids' and 'record') will be created under the debugfs directory. Writing the name of the context to remove to 'rm_context' will remove the related context and directory. Link: https://lkml.kernel.org/r/20210716081449.22187-10-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Fernand Sieber Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 429538e85410c3ae12719ec42b89ab873ed6d47b Author: SeongJae Park Date: Tue Sep 7 19:56:57 2021 -0700 mm/damon/dbgfs: export kdamond pid to the user space For CPU usage accounting, knowing pid of the monitoring thread could be helpful. For example, users could use cpuaccount cgroups with the pid. This commit therefore exports the pid of currently running monitoring thread to the user space via 'kdamond_pid' file in the debugfs directory. Link: https://lkml.kernel.org/r/20210716081449.22187-9-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Fernand Sieber Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4bc05954d0076655cfaf6f0135585bdc20cd6b11 Author: SeongJae Park Date: Tue Sep 7 19:56:53 2021 -0700 mm/damon: implement a debugfs-based user space interface DAMON is designed to be used by kernel space code such as the memory management subsystems, and therefore it provides only kernel space API. That said, letting the user space control DAMON could provide some benefits to them. For example, it will allow user space to analyze their specific workloads and make their own special optimizations. For such cases, this commit implements a simple DAMON application kernel module, namely 'damon-dbgfs', which merely wraps the DAMON api and exports those to the user space via the debugfs. 'damon-dbgfs' exports three files, ``attrs``, ``target_ids``, and ``monitor_on`` under its debugfs directory, ``/damon/``. Attributes ---------- Users can read and write the ``sampling interval``, ``aggregation interval``, ``regions update interval``, and min/max number of monitoring target regions by reading from and writing to the ``attrs`` file. For example, below commands set those values to 5 ms, 100 ms, 1,000 ms, 10, 1000 and check it again:: # cd /damon # echo 5000 100000 1000000 10 1000 > attrs # cat attrs 5000 100000 1000000 10 1000 Target IDs ---------- Some types of address spaces supports multiple monitoring target. For example, the virtual memory address spaces monitoring can have multiple processes as the monitoring targets. Users can set the targets by writing relevant id values of the targets to, and get the ids of the current targets by reading from the ``target_ids`` file. In case of the virtual address spaces monitoring, the values should be pids of the monitoring target processes. For example, below commands set processes having pids 42 and 4242 as the monitoring targets and check it again:: # cd /damon # echo 42 4242 > target_ids # cat target_ids 42 4242 Note that setting the target ids doesn't start the monitoring. Turning On/Off -------------- Setting the files as described above doesn't incur effect unless you explicitly start the monitoring. You can start, stop, and check the current status of the monitoring by writing to and reading from the ``monitor_on`` file. Writing ``on`` to the file starts the monitoring of the targets with the attributes. Writing ``off`` to the file stops those. DAMON also stops if every targets are invalidated (in case of the virtual memory monitoring, target processes are invalidated when terminated). Below example commands turn on, off, and check the status of DAMON:: # cd /damon # echo on > monitor_on # echo off > monitor_on # cat monitor_on off Please note that you cannot write to the above-mentioned debugfs files while the monitoring is turned on. If you write to the files while DAMON is running, an error code such as ``-EBUSY`` will be returned. [akpm@linux-foundation.org: remove unneeded "alloc failed" printks] [akpm@linux-foundation.org: replace macro with static inline] Link: https://lkml.kernel.org/r/20210716081449.22187-8-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Fernand Sieber Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2fcb93629ad8911c846cdc44521c746e53cc4e6d Author: SeongJae Park Date: Tue Sep 7 19:56:48 2021 -0700 mm/damon: add a tracepoint This commit adds a tracepoint for DAMON. It traces the monitoring results of each region for each aggregation interval. Using this, DAMON can easily integrated with tracepoints supporting tools such as perf. Link: https://lkml.kernel.org/r/20210716081449.22187-7-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shuah Khan Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3f49584b262cf8f42b25f4c1ad9f5bfd3bdc1bca Author: SeongJae Park Date: Tue Sep 7 19:56:44 2021 -0700 mm/damon: implement primitives for the virtual memory address spaces This commit introduces a reference implementation of the address space specific low level primitives for the virtual address space, so that users of DAMON can easily monitor the data accesses on virtual address spaces of specific processes by simply configuring the implementation to be used by DAMON. The low level primitives for the fundamental access monitoring are defined in two parts: 1. Identification of the monitoring target address range for the address space. 2. Access check of specific address range in the target space. The reference implementation for the virtual address space does the works as below. PTE Accessed-bit Based Access Check ----------------------------------- The implementation uses PTE Accessed-bit for basic access checks. That is, it clears the bit for the next sampling target page and checks whether it is set again after one sampling period. This could disturb the reclaim logic. DAMON uses ``PG_idle`` and ``PG_young`` page flags to solve the conflict, as Idle page tracking does. VMA-based Target Address Range Construction ------------------------------------------- Only small parts in the super-huge virtual address space of the processes are mapped to physical memory and accessed. Thus, tracking the unmapped address regions is just wasteful. However, because DAMON can deal with some level of noise using the adaptive regions adjustment mechanism, tracking every mapping is not strictly required but could even incur a high overhead in some cases. That said, too huge unmapped areas inside the monitoring target should be removed to not take the time for the adaptive mechanism. For the reason, this implementation converts the complex mappings to three distinct regions that cover every mapped area of the address space. Also, the two gaps between the three regions are the two biggest unmapped areas in the given address space. The two biggest unmapped areas would be the gap between the heap and the uppermost mmap()-ed region, and the gap between the lowermost mmap()-ed region and the stack in most of the cases. Because these gaps are exceptionally huge in usual address spaces, excluding these will be sufficient to make a reasonable trade-off. Below shows this in detail:: (small mmap()-ed regions and munmap()-ed regions) [akpm@linux-foundation.org: mm/damon/vaddr.c needs highmem.h for kunmap_atomic()] [sjpark@amazon.de: remove unnecessary PAGE_EXTENSION setup] Link: https://lkml.kernel.org/r/20210806095153.6444-2-sj38.park@gmail.com [sjpark@amazon.de: safely walk page table] Link: https://lkml.kernel.org/r/20210831161800.29419-1-sj38.park@gmail.com Link: https://lkml.kernel.org/r/20210716081449.22187-6-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1c676e0d9b1a59b98885b24a0e16a81fe4cc8301 Author: SeongJae Park Date: Tue Sep 7 19:56:40 2021 -0700 mm/idle_page_tracking: make PG_idle reusable PG_idle and PG_young allow the two PTE Accessed bit users, Idle Page Tracking and the reclaim logic concurrently work while not interfering with each other. That is, when they need to clear the Accessed bit, they set PG_young to represent the previous state of the bit, respectively. And when they need to read the bit, if the bit is cleared, they further read the PG_young to know whether the other has cleared the bit meanwhile or not. For yet another user of the PTE Accessed bit, we could add another page flag, or extend the mechanism to use the flags. For the DAMON usecase, however, we don't need to do that just yet. IDLE_PAGE_TRACKING and DAMON are mutually exclusive, so there's only ever going to be one user of the current set of flags. In this commit, we split out the CONFIG options to allow for the use of PG_young and PG_idle outside of idle page tracking. In the next commit, DAMON's reference implementation of the virtual memory address space monitoring primitives will use it. [sjpark@amazon.de: set PAGE_EXTENSION for non-64BIT] Link: https://lkml.kernel.org/r/20210806095153.6444-1-sj38.park@gmail.com [akpm@linux-foundation.org: tweak Kconfig text] [sjpark@amazon.de: hide PAGE_IDLE_FLAG from users] Link: https://lkml.kernel.org/r/20210813081238.34705-1-sj38.park@gmail.com Link: https://lkml.kernel.org/r/20210716081449.22187-5-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Shakeel Butt Reviewed-by: Fernand Sieber Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Leonard Foerster Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b9a6ac4e4ede4172d165c133398b93e3233b0ba7 Author: SeongJae Park Date: Tue Sep 7 19:56:36 2021 -0700 mm/damon: adaptively adjust regions Even somehow the initial monitoring target regions are well constructed to fulfill the assumption (pages in same region have similar access frequencies), the data access pattern can be dynamically changed. This will result in low monitoring quality. To keep the assumption as much as possible, DAMON adaptively merges and splits each region based on their access frequency. For each ``aggregation interval``, it compares the access frequencies of adjacent regions and merges those if the frequency difference is small. Then, after it reports and clears the aggregated access frequency of each region, it splits each region into two or three regions if the total number of regions will not exceed the user-specified maximum number of regions after the split. In this way, DAMON provides its best-effort quality and minimal overhead while keeping the upper-bound overhead that users set. Link: https://lkml.kernel.org/r/20210716081449.22187-4-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f23b8eee1871a6db5c37f90831147de5426c40b7 Author: SeongJae Park Date: Tue Sep 7 19:56:32 2021 -0700 mm/damon/core: implement region-based sampling To avoid the unbounded increase of the overhead, DAMON groups adjacent pages that are assumed to have the same access frequencies into a region. As long as the assumption (pages in a region have the same access frequencies) is kept, only one page in the region is required to be checked. Thus, for each ``sampling interval``, 1. the 'prepare_access_checks' primitive picks one page in each region, 2. waits for one ``sampling interval``, 3. checks whether the page is accessed meanwhile, and 4. increases the access count of the region if so. Therefore, the monitoring overhead is controllable by adjusting the number of regions. DAMON allows both the underlying primitives and user callbacks to adjust regions for the trade-off. In other words, this commit makes DAMON to use not only time-based sampling but also space-based sampling. This scheme, however, cannot preserve the quality of the output if the assumption is not guaranteed. Next commit will address this problem. Link: https://lkml.kernel.org/r/20210716081449.22187-3-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Brendan Higgins Cc: David Hildenbrand Cc: David Rientjes Cc: David Woodhouse Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Ingo Molnar Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Marco Elver Cc: Markus Boehme Cc: Maximilian Heyne Cc: Mel Gorman Cc: Minchan Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shuah Khan Cc: Steven Rostedt (VMware) Cc: Vladimir Davydov Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2224d8485492e499ca2e5d25407f8502cc06f149 Author: SeongJae Park Date: Tue Sep 7 19:56:28 2021 -0700 mm: introduce Data Access MONitor (DAMON) Patch series "Introduce Data Access MONitor (DAMON)", v34. Introduction ============ DAMON is a data access monitoring framework for the Linux kernel. The core mechanisms of DAMON called 'region based sampling' and 'adaptive regions adjustment' (refer to 'mechanisms.rst' in the 11th patch of this patchset for the detail) make it - accurate (The monitored information is useful for DRAM level memory management. It might not appropriate for Cache-level accuracy, though.), - light-weight (The monitoring overhead is low enough to be applied online while making no impact on the performance of the target workloads.), and - scalable (the upper-bound of the instrumentation overhead is controllable regardless of the size of target workloads.). Using this framework, therefore, several memory management mechanisms such as reclamation and THP can be optimized to aware real data access patterns. Experimental access pattern aware memory management optimization works that incurring high instrumentation overhead will be able to have another try. Though DAMON is for kernel subsystems, it can be easily exposed to the user space by writing a DAMON-wrapper kernel subsystem. Then, user space users who have some special workloads will be able to write personalized tools or applications for deeper understanding and specialized optimizations of their systems. DAMON is also merged in two public Amazon Linux kernel trees that based on v5.4.y[1] and v5.10.y[2]. [1] https://github.com/amazonlinux/linux/tree/amazon-5.4.y/master/mm/damon [2] https://github.com/amazonlinux/linux/tree/amazon-5.10.y/master/mm/damon The userspace tool[1] is available, released under GPLv2, and actively being maintained. I am also planning to implement another basic user interface in perf[2]. Also, the basic test suite for DAMON is available under GPLv2[3]. [1] https://github.com/awslabs/damo [2] https://lore.kernel.org/linux-mm/20210107120729.22328-1-sjpark@amazon.com/ [3] https://github.com/awslabs/damon-tests Long-term Plan -------------- DAMON is a part of a project called Data Access-aware Operating System (DAOS). As the name implies, I want to improve the performance and efficiency of systems using fine-grained data access patterns. The optimizations are for both kernel and user spaces. I will therefore modify or create kernel subsystems, export some of those to user space and implement user space library / tools. Below shows the layers and components for the project. --------------------------------------------------------------------------- Primitives: PTE Accessed bit, PG_idle, rmap, (Intel CMT), ... Framework: DAMON Features: DAMOS, virtual addr, physical addr, ... Applications: DAMON-debugfs, (DARC), ... ^^^^^^^^^^^^^^^^^^^^^^^ KERNEL SPACE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Raw Interface: debugfs, (sysfs), (damonfs), tracepoints, (sys_damon), ... vvvvvvvvvvvvvvvvvvvvvvv USER SPACE vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Library: (libdamon), ... Tools: DAMO, (perf), ... --------------------------------------------------------------------------- The components in parentheses or marked as '...' are not implemented yet but in the future plan. IOW, those are the TODO tasks of DAOS project. For more detail, please refer to the plans: https://lore.kernel.org/linux-mm/20201202082731.24828-1-sjpark@amazon.com/ Evaluations =========== We evaluated DAMON's overhead, monitoring quality and usefulness using 24 realistic workloads on my QEMU/KVM based virtual machine running a kernel that v24 DAMON patchset is applied. DAMON is lightweight. It increases system memory usage by 0.39% and slows target workloads down by 1.16%. DAMON is accurate and useful for memory management optimizations. An experimental DAMON-based operation scheme for THP, namely 'ethp', removes 76.15% of THP memory overheads while preserving 51.25% of THP speedup. Another experimental DAMON-based 'proactive reclamation' implementation, 'prcl', reduces 93.38% of residential sets and 23.63% of system memory footprint while incurring only 1.22% runtime overhead in the best case (parsec3/freqmine). NOTE that the experimental THP optimization and proactive reclamation are not for production but only for proof of concepts. Please refer to the official document[1] or "Documentation/admin-guide/mm: Add a document for DAMON" patch in this patchset for detailed evaluation setup and results. [1] https://damonitor.github.io/doc/html/latest-damon/admin-guide/mm/damon/eval.html Real-world User Story ===================== In summary, DAMON has used on production systems and proved its usefulness. DAMON as a profiler ------------------- We analyzed characteristics of a large scale production systems of our customers using DAMON. The systems utilize 70GB DRAM and 36 CPUs. From this, we were able to find interesting things below. There were obviously different access pattern under idle workload and active workload. Under the idle workload, it accessed large memory regions with low frequency, while the active workload accessed small memory regions with high freuqnecy. DAMON found a 7GB memory region that showing obviously high access frequency under the active workload. We believe this is the performance-effective working set and need to be protected. There was a 4KB memory region that showing highest access frequency under not only active but also idle workloads. We think this must be a hottest code section like thing that should never be paged out. For this analysis, DAMON used only 0.3-1% of single CPU time. Because we used recording-based analysis, it consumed about 3-12 MB of disk space per 20 minutes. This is only small amount of disk space, but we can further reduce the disk usage by using non-recording-based DAMON features. I'd like to argue that only DAMON can do such detailed analysis (finding 4KB highest region in 70GB memory) with the light overhead. DAMON as a system optimization tool ----------------------------------- We also found below potential performance problems on the systems and made DAMON-based solutions. The system doesn't want to make the workload suffer from the page reclamation and thus it utilizes enough DRAM but no swap device. However, we found the system is actively reclaiming file-backed pages, because the system has intensive file IO. The file IO turned out to be not performance critical for the workload, but the customer wanted to ensure performance critical file-backed pages like code section to not mistakenly be evicted. Using direct IO should or `mlock()` would be a straightforward solution, but modifying the user space code is not easy for the customer. Alternatively, we could use DAMON-based operation scheme[1]. By using it, we can ask DAMON to track access frequency of each region and make 'process_madvise(MADV_WILLNEED)[2]' call for regions having specific size and access frequency for a time interval. We also found the system is having high number of TLB misses. We tried 'always' THP enabled policy and it greatly reduced TLB misses, but the page reclamation also been more frequent due to the THP internal fragmentation caused memory bloat. We could try another DAMON-based operation scheme that applies 'MADV_HUGEPAGE' to memory regions having >=2MB size and high access frequency, while applying 'MADV_NOHUGEPAGE' to regions having <2MB size and low access frequency. We do not own the systems so we only reported the analysis results and possible optimization solutions to the customers. The customers satisfied about the analysis results and promised to try the optimization guides. [1] https://lore.kernel.org/linux-mm/20201006123931.5847-1-sjpark@amazon.com/ [2] https://lore.kernel.org/linux-api/20200622192900.22757-4-minchan@kernel.org/ Comparison with Idle Page Tracking ================================== Idle Page Tracking allows users to set and read idleness of pages using a bitmap file which represents each page with each bit of the file. One recommended usage of it is working set size detection. Users can do that by 1. find PFN of each page for workloads in interest, 2. set all the pages as idle by doing writes to the bitmap file, 3. wait until the workload accesses its working set, and 4. read the idleness of the pages again and count pages became not idle. NOTE: While Idle Page Tracking is for user space users, DAMON is primarily designed for kernel subsystems though it can easily exposed to the user space. Hence, this section only assumes such user space use of DAMON. For what use cases Idle Page Tracking would be better? ------------------------------------------------------ 1. Flexible usecases other than hotness monitoring. Because Idle Page Tracking allows users to control the primitive (Page idleness) by themselves, Idle Page Tracking users can do anything they want. Meanwhile, DAMON is primarily designed to monitor the hotness of each memory region. For this, DAMON asks users to provide sampling interval and aggregation interval. For the reason, there could be some use case that using Idle Page Tracking is simpler. 2. Physical memory monitoring. Idle Page Tracking receives PFN range as input, so natively supports physical memory monitoring. DAMON is designed to be extensible for multiple address spaces and use cases by implementing and using primitives for the given use case. Therefore, by theory, DAMON has no limitation in the type of target address space as long as primitives for the given address space exists. However, the default primitives introduced by this patchset supports only virtual address spaces. Therefore, for physical memory monitoring, you should implement your own primitives and use it, or simply use Idle Page Tracking. Nonetheless, RFC patchsets[1] for the physical memory address space primitives is already available. It also supports user memory same to Idle Page Tracking. [1] https://lore.kernel.org/linux-mm/20200831104730.28970-1-sjpark@amazon.com/ For what use cases DAMON is better? ----------------------------------- 1. Hotness Monitoring. Idle Page Tracking let users know only if a page frame is accessed or not. For hotness check, the user should write more code and use more memory. DAMON do that by itself. 2. Low Monitoring Overhead DAMON receives user's monitoring request with one step and then provide the results. So, roughly speaking, DAMON require only O(1) user/kernel context switches. In case of Idle Page Tracking, however, because the interface receives contiguous page frames, the number of user/kernel context switches increases as the monitoring target becomes complex and huge. As a result, the context switch overhead could be not negligible. Moreover, DAMON is born to handle with the monitoring overhead. Because the core mechanism is pure logical, Idle Page Tracking users might be able to implement the mechanism on their own, but it would be time consuming and the user/kernel context switching will still more frequent than that of DAMON. Also, the kernel subsystems cannot use the logic in this case. 3. Page granularity working set size detection. Until v22 of this patchset, this was categorized as the thing Idle Page Tracking could do better, because DAMON basically maintains additional metadata for each of the monitoring target regions. So, in the page granularity working set size detection use case, DAMON would incur (number of monitoring target pages * size of metadata) memory overhead. Size of the single metadata item is about 54 bytes, so assuming 4KB pages, about 1.3% of monitoring target pages will be additionally used. All essential metadata for Idle Page Tracking are embedded in 'struct page' and page table entries. Therefore, in this use case, only one counter variable for working set size accounting is required if Idle Page Tracking is used. There are more details to consider, but roughly speaking, this is true in most cases. However, the situation changed from v23. Now DAMON supports arbitrary types of monitoring targets, which don't use the metadata. Using that, DAMON can do the working set size detection with no additional space overhead but less user-kernel context switch. A first draft for the implementation of monitoring primitives for this usage is available in a DAMON development tree[1]. An RFC patchset for it based on this patchset will also be available soon. Since v24, the arbitrary type support is dropped from this patchset because this patchset doesn't introduce real use of the type. You can still get it from the DAMON development tree[2], though. [1] https://github.com/sjp38/linux/tree/damon/pgidle_hack [2] https://github.com/sjp38/linux/tree/damon/master 4. More future usecases While Idle Page Tracking has tight coupling with base primitives (PG_Idle and page table Accessed bits), DAMON is designed to be extensible for many use cases and address spaces. If you need some special address type or want to use special h/w access check primitives, you can write your own primitives for that and configure DAMON to use those. Therefore, if your use case could be changed a lot in future, using DAMON could be better. Can I use both Idle Page Tracking and DAMON? -------------------------------------------- Yes, though using them concurrently for overlapping memory regions could result in interference to each other. Nevertheless, such use case would be rare or makes no sense at all. Even in the case, the noise would bot be really significant. So, you can choose whatever you want depending on the characteristics of your use cases. More Information ================ We prepared a showcase web site[1] that you can get more information. There are - the official documentations[2], - the heatmap format dynamic access pattern of various realistic workloads for heap area[3], mmap()-ed area[4], and stack[5] area, - the dynamic working set size distribution[6] and chronological working set size changes[7], and - the latest performance test results[8]. [1] https://damonitor.github.io/_index [2] https://damonitor.github.io/doc/html/latest-damon [3] https://damonitor.github.io/test/result/visual/latest/rec.heatmap.0.png.html [4] https://damonitor.github.io/test/result/visual/latest/rec.heatmap.1.png.html [5] https://damonitor.github.io/test/result/visual/latest/rec.heatmap.2.png.html [6] https://damonitor.github.io/test/result/visual/latest/rec.wss_sz.png.html [7] https://damonitor.github.io/test/result/visual/latest/rec.wss_time.png.html [8] https://damonitor.github.io/test/result/perf/latest/html/index.html Baseline and Complete Git Trees =============================== The patches are based on the latest -mm tree, specifically v5.14-rc1-mmots-2021-07-15-18-47 of https://github.com/hnaz/linux-mm. You can also clone the complete git tree: $ git clone git://github.com/sjp38/linux -b damon/patches/v34 The web is also available: https://github.com/sjp38/linux/releases/tag/damon/patches/v34 Development Trees ----------------- There are a couple of trees for entire DAMON patchset series and features for future release. - For latest release: https://github.com/sjp38/linux/tree/damon/master - For next release: https://github.com/sjp38/linux/tree/damon/next Long-term Support Trees ----------------------- For people who want to test DAMON but using LTS kernels, there are another couple of trees based on two latest LTS kernels respectively and containing the 'damon/master' backports. - For v5.4.y: https://github.com/sjp38/linux/tree/damon/for-v5.4.y - For v5.10.y: https://github.com/sjp38/linux/tree/damon/for-v5.10.y Amazon Linux Kernel Trees ------------------------- DAMON is also merged in two public Amazon Linux kernel trees that based on v5.4.y[1] and v5.10.y[2]. [1] https://github.com/amazonlinux/linux/tree/amazon-5.4.y/master/mm/damon [2] https://github.com/amazonlinux/linux/tree/amazon-5.10.y/master/mm/damon Git Tree for Diff of Patches ============================ For easy review of diff between different versions of each patch, I prepared a git tree containing all versions of the DAMON patchset series: https://github.com/sjp38/damon-patches You can clone it and use 'diff' for easy review of changes between different versions of the patchset. For example: $ git clone https://github.com/sjp38/damon-patches && cd damon-patches $ diff -u damon/v33 damon/v34 Sequence Of Patches =================== First three patches implement the core logics of DAMON. The 1st patch introduces basic sampling based hotness monitoring for arbitrary types of targets. Following two patches implement the core mechanisms for control of overhead and accuracy, namely regions based sampling (patch 2) and adaptive regions adjustment (patch 3). Now the essential parts of DAMON is complete, but it cannot work unless someone provides monitoring primitives for a specific use case. The following two patches make it just work for virtual address spaces monitoring. The 4th patch makes 'PG_idle' can be used by DAMON and the 5th patch implements the virtual memory address space specific monitoring primitives using page table Accessed bits and the 'PG_idle' page flag. Now DAMON just works for virtual address space monitoring via the kernel space api. To let the user space users can use DAMON, following four patches add interfaces for them. The 6th patch adds a tracepoint for monitoring results. The 7th patch implements a DAMON application kernel module, namely damon-dbgfs, that simply wraps DAMON and exposes DAMON interface to the user space via the debugfs interface. The 8th patch further exports pid of monitoring thread (kdamond) to user space for easier cpu usage accounting, and the 9th patch makes the debugfs interface to support multiple contexts. Three patches for maintainability follows. The 10th patch adds documentations for both the user space and the kernel space. The 11th patch provides unit tests (based on the kunit) while the 12th patch adds user space tests (based on the kselftest). Finally, the last patch (13th) updates the MAINTAINERS file. This patch (of 13): DAMON is a data access monitoring framework for the Linux kernel. The core mechanisms of DAMON make it - accurate (the monitoring output is useful enough for DRAM level performance-centric memory management; It might be inappropriate for CPU cache levels, though), - light-weight (the monitoring overhead is normally low enough to be applied online), and - scalable (the upper-bound of the overhead is in constant range regardless of the size of target workloads). Using this framework, hence, we can easily write efficient kernel space data access monitoring applications. For example, the kernel's memory management mechanisms can make advanced decisions using this. Experimental data access aware optimization works that incurring high access monitoring overhead could again be implemented on top of this. Due to its simple and flexible interface, providing user space interface would be also easy. Then, user space users who have some special workloads can write personalized applications for better understanding and optimizations of their workloads and systems. === Nevertheless, this commit is defining and implementing only basic access check part without the overhead-accuracy handling core logic. The basic access check is as below. The output of DAMON says what memory regions are how frequently accessed for a given duration. The resolution of the access frequency is controlled by setting ``sampling interval`` and ``aggregation interval``. In detail, DAMON checks access to each page per ``sampling interval`` and aggregates the results. In other words, counts the number of the accesses to each region. After each ``aggregation interval`` passes, DAMON calls callback functions that previously registered by users so that users can read the aggregated results and then clears the results. This can be described in below simple pseudo-code:: init() while monitoring_on: for page in monitoring_target: if accessed(page): nr_accesses[page] += 1 if time() % aggregation_interval == 0: for callback in user_registered_callbacks: callback(monitoring_target, nr_accesses) for page in monitoring_target: nr_accesses[page] = 0 if time() % update_interval == 0: update() sleep(sampling interval) The target regions constructed at the beginning of the monitoring and updated after each ``regions_update_interval``, because the target regions could be dynamically changed (e.g., mmap() or memory hotplug). The monitoring overhead of this mechanism will arbitrarily increase as the size of the target workload grows. The basic monitoring primitives for actual access check and dynamic target regions construction aren't in the core part of DAMON. Instead, it allows users to implement their own primitives that are optimized for their use case and configure DAMON to use those. In other words, users cannot use current version of DAMON without some additional works. Following commits will implement the core mechanisms for the overhead-accuracy control and default primitives implementations. Link: https://lkml.kernel.org/r/20210716081449.22187-1-sj38.park@gmail.com Link: https://lkml.kernel.org/r/20210716081449.22187-2-sj38.park@gmail.com Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt Cc: Jonathan Cameron Cc: Alexander Shishkin Cc: Amit Shah Cc: Benjamin Herrenschmidt Cc: Jonathan Corbet Cc: David Hildenbrand Cc: David Woodhouse Cc: Marco Elver Cc: Fan Du Cc: Greg Kroah-Hartman Cc: Greg Thelen Cc: Joe Perches Cc: Mel Gorman Cc: Maximilian Heyne Cc: Minchan Kim Cc: Ingo Molnar Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rik van Riel Cc: David Rientjes Cc: Steven Rostedt (VMware) Cc: Shuah Khan Cc: Vlastimil Babka Cc: Vladimir Davydov Cc: Brendan Higgins Cc: Markus Boehme Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c40c6e593bf978e232bae1fab81f4111f2e2c956 Author: Marco Elver Date: Tue Sep 7 19:56:24 2021 -0700 kfence: test: fail fast if disabled at boot Fail kfence_test fast if KFENCE was disabled at boot, instead of each test case trying several seconds to allocate from KFENCE and failing. KUnit will fail all test cases if kunit_suite::init returns an error. Even if KFENCE was disabled, we still want the test to fail, so that CI systems that parse KUnit output will alert on KFENCE being disabled (accidentally or otherwise). Link: https://lkml.kernel.org/r/20210825105533.1247922-1-elver@google.com Signed-off-by: Marco Elver Reported-by: Kefeng Wang Tested-by: Kefeng Wang Acked-by: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4bbf04aa9aa88ae41205e387d35743a9bf5e933d Author: Marco Elver Date: Tue Sep 7 19:56:21 2021 -0700 kfence: show cpu and timestamp in alloc/free info Record cpu and timestamp on allocations and frees, and show them in reports. Upon an error, this can help correlate earlier messages in the kernel log via allocation and free timestamps. Link: https://lkml.kernel.org/r/20210714175312.2947941-1-elver@google.com Suggested-by: Joern Engel Signed-off-by: Marco Elver Acked-by: Alexander Potapenko Acked-by: Joern Engel Cc: Yuanyuan Zhong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 110860541f443f950c1274f217a1a3e298670a33 Author: Jordy Zomer Date: Tue Sep 7 19:56:18 2021 -0700 mm/secretmem: use refcount_t instead of atomic_t When a secret memory region is active, memfd_secret disables hibernation. One of the goals is to keep the secret data from being written to persistent-storage. It accomplishes this by maintaining a reference count to `secretmem_users`. Once this reference is held your system can not be hibernated due to the check in `hibernation_available()`. However, because `secretmem_users` is of type `atomic_t`, reference counter overflows are possible. As you can see there's an `atomic_inc` for each `memfd` that is opened in the `memfd_secret` syscall. If a local attacker succeeds to open 2^32 memfd's, the counter will wrap around to 0. This implies that you may hibernate again, even though there are still regions of this secret memory, thereby bypassing the security check. In an attempt to fix this I have used `refcount_t` instead of `atomic_t` which prevents reference counter overflows. Link: https://lkml.kernel.org/r/20210820043339.2151352-1-jordy@pwning.systems Signed-off-by: Jordy Zomer Cc: Kees Cook , Cc: Jordy Zomer Cc: James Bottomley Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 41c961b9013ee9b6d0491f6926df546e37964b1f Author: Muchun Song Date: Tue Sep 7 19:56:15 2021 -0700 mm: introduce PAGEFLAGS_MASK to replace ((1UL << NR_PAGEFLAGS) - 1) Instead of hard-coding ((1UL << NR_PAGEFLAGS) - 1) everywhere, introducing PAGEFLAGS_MASK to make the code clear to get the page flags. Link: https://lkml.kernel.org/r/20210819150712.59948-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Roman Gushchin Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt Cc: Michal Hocko Cc: Vladimir Davydov Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ea0eafead4b66543b8218ebfbe14173315feb7d1 Author: Changbin Du Date: Tue Sep 7 19:56:12 2021 -0700 mm: in_irq() cleanup Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Link: https://lkml.kernel.org/r/20210813145245.86070-1-changbin.du@gmail.com Signed-off-by: Changbin Du Acked-by: Catalin Marinas [kmemleak] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 513861202d1259e35934e206b79cd54f523d79b5 Author: Sebastian Andrzej Siewior Date: Tue Sep 7 19:56:09 2021 -0700 highmem: don't disable preemption on RT in kmap_atomic() kmap_atomic() disables preemption and pagefaults for historical reasons. The conversion to kmap_local(), which only disables migration, cannot be done wholesale because quite some call sites need to be updated to accommodate with the changed semantics. On PREEMPT_RT enabled kernels the kmap_atomic() semantics are problematic due to the implicit disabling of preemption which makes it impossible to acquire 'sleeping' spinlocks within the kmap atomic sections. PREEMPT_RT replaces the preempt_disable() with a migrate_disable() for more than a decade. It could be argued that this is a justification to do this unconditionally, but PREEMPT_RT covers only a limited number of architectures and it disables some functionality which limits the coverage further. Limit the replacement to PREEMPT_RT for now. Link: https://lkml.kernel.org/r/20210810091116.pocdmaatdcogvdso@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka Cc: Thomas Gleixner Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 395519b4b6e82741f29aaf6defa66cbdf3466584 Author: Weizhao Ouyang Date: Tue Sep 7 19:56:06 2021 -0700 mm/early_ioremap.c: remove redundant early_ioremap_shutdown() early_ioremap_reset() reserved a weak function so that architectures can provide a specific cleanup. Now no architectures use it, remove this redundant function. Link: https://lkml.kernel.org/r/20210901082917.399953-1-o451686892@gmail.com Signed-off-by: Weizhao Ouyang Reviewed-by: David Hildenbrand Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8491502f787c4a902bd4f223b578ef47d3490264 Author: Christoph Hellwig Date: Tue Sep 7 19:56:04 2021 -0700 mm: don't allow executable ioremap mappings There is no need to execute from iomem (and most platforms it is impossible anyway), so add the pgprot_nx() call similar to vmap. Link: https://lkml.kernel.org/r/20210824091259.1324527-3-hch@lst.de Signed-off-by: Christoph Hellwig Cc: Nicholas Piggin Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82a70ce0426dd7c4099516175019dccbd18cebf9 Author: Christoph Hellwig Date: Tue Sep 7 19:56:01 2021 -0700 mm: move ioremap_page_range to vmalloc.c Patch series "small ioremap cleanups". The first patch moves a little code around the vmalloc/ioremap boundary following a bigger move by Nick earlier. The second enforces non-executable mapping on ioremap just like we do for vmap. No driver currently uses executable mappings anyway, as they should. This patch (of 2): This keeps it together with the implementation, and to remove the vmap_range wrapper. Link: https://lkml.kernel.org/r/20210824091259.1324527-1-hch@lst.de Link: https://lkml.kernel.org/r/20210824091259.1324527-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Nicholas Piggin Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8350229ffceb372621e277d4d36f1ffca6212135 Author: Christoph Hellwig Date: Tue Sep 7 19:55:58 2021 -0700 riscv: only select GENERIC_IOREMAP if MMU support is enabled nommu ioremap is an inline stub in asm-generic/io.h. Link: https://lkml.kernel.org/r/20210825072036.GA29161@lst.de Signed-off-by: Christoph Hellwig Cc: Nicholas Piggin Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fe3df441ef885a75a3eff5e151ead1a92266d222 Author: Muchun Song Date: Tue Sep 7 19:55:55 2021 -0700 mm: remove redundant compound_head() calling There is a READ_ONCE() in the macro of compound_head(), which will prevent compiler from optimizing the code when there are more than once calling of it in a function. Remove the redundant calling of compound_head() from page_to_index() and page_add_file_rmap() for better code generation. Link: https://lkml.kernel.org/r/20210811101431.83940-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: David Howells Cc: Matthew Wilcox (Oracle) Cc: William Kucharski Cc: Kirill A. Shutemov Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5ef5f810199f421cb6455aa018fb8f21151b4a16 Author: Miaohe Lin Date: Tue Sep 7 19:55:52 2021 -0700 mm/memory_hotplug: use helper zone_is_zone_device() to simplify the code Patch series "Cleanup and fixups for memory hotplug". This series contains cleanup to use helper function to simplify the code. Also we fix some potential bugs. More details can be found in the respective changelogs. This patch (of 3): Use helper zone_is_zone_device() to simplify the code and remove some explicit CONFIG_ZONE_DEVICE codes. Link: https://lkml.kernel.org/r/20210821094246.10149-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210821094246.10149-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Reviewed-by: Naoya Horiguchi Cc: Michal Hocko Cc: Minchan Kim Cc: Chris Goldsworthy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3fcebf90209a7f52d384ad7701425aa91be309ab Author: David Hildenbrand Date: Tue Sep 7 19:55:48 2021 -0700 mm/memory_hotplug: improved dynamic memory group aware "auto-movable" online policy Currently, the "auto-movable" online policy does not allow for hotplugged KERNEL (ZONE_NORMAL) memory to increase the amount of MOVABLE memory we can have, primarily, because there is no coordiantion across memory devices and we don't want to create zone-imbalances accidentially when unplugging memory. However, within a single memory device it's different. Let's allow for KERNEL memory within a dynamic memory group to allow for more MOVABLE within the same memory group. The only thing we have to take care of is that the managing driver avoids zone imbalances by unplugging MOVABLE memory first, otherwise there can be corner cases where unplug of memory could result in (accidential) zone imbalances. virtio-mem is the only user of dynamic memory groups and recently added support for prioritizing unplug of ZONE_MOVABLE over ZONE_NORMAL, so we don't need a new toggle to enable it for dynamic memory groups. We limit this handling to dynamic memory groups, because: * We want to keep the runtime overhead for collecting stats when onlining a single memory block small. We tend to have only a handful of dynamic memory groups, but we can have quite some static memory groups (e.g., 256 DIMMs). * It doesn't make too much sense for static memory groups, as we try onlining all applicable memory blocks either completely to ZONE_MOVABLE or not. In ordinary operation, we won't have a mixture of zones within a static memory group. When adding memory to a dynamic memory group, we'll first online memory to ZONE_MOVABLE as long as early KERNEL memory allows for it. Then, we'll online the next unit(s) to ZONE_NORMAL, until we can online the next unit(s) to ZONE_MOVABLE. For a simple virtio-mem device with a MOVABLE:KERNEL ratio of 3:1, it will result in a layout like: [M][M][M][M][M][M][M][M][N][M][M][M][N][M][M][M]... ^ movable memory due to early kernel memory ^ allows for more movable memory ... ^-----^ ... here ^ allows for more movable memory ... ^-----^ ... here While the created layout is sub-optimal when it comes to contiguous zones, it gives us the maximum flexibility when dynamically growing/shrinking a device; we can grow small VMs really big in small steps, and still shrink reliably to e.g., 1/4 of the maximum VM size in this example, removing full memory blocks along with meta data more reliably. Mark dynamic memory groups in the xarray such that we can efficiently iterate over them when collecting stats. In usual setups, we have one virtio-mem device per NUMA node, and usually only a small number of NUMA nodes. Note: for now, there seems to be no compelling reason to make this behavior configurable. Link: https://lkml.kernel.org/r/20210806124715.17090-10-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 445fcf7c721450dd1d4ec6c217b3c6a932602a44 Author: David Hildenbrand Date: Tue Sep 7 19:55:45 2021 -0700 mm/memory_hotplug: memory group aware "auto-movable" online policy Use memory groups to improve our "auto-movable" onlining policy: 1. For static memory groups (e.g., a DIMM), online a memory block MOVABLE only if all other memory blocks in the group are either MOVABLE or could be onlined MOVABLE. A DIMM will either be MOVABLE or not, not a mixture. 2. For dynamic memory groups (e.g., a virtio-mem device), online a memory block MOVABLE only if all other memory blocks inside the current unit are either MOVABLE or could be onlined MOVABLE. For a virtio-mem device with a device block size with 512 MiB, all 128 MiB memory blocks wihin a 512 MiB unit will either be MOVABLE or not, not a mixture. We have to pass the memory group to zone_for_pfn_range() to take the memory group into account. Note: for now, there seems to be no compelling reason to make this behavior configurable. Link: https://lkml.kernel.org/r/20210806124715.17090-9-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ffaa6ce835eaf0fe3eb05ff931de3c1134b07f35 Author: David Hildenbrand Date: Tue Sep 7 19:55:41 2021 -0700 virtio-mem: use a single dynamic memory group for a single virtio-mem device Let's use a single dynamic memory group. Link: https://lkml.kernel.org/r/20210806124715.17090-8-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eedf634aac3b85b70e7b139c32fc68f565ecf815 Author: David Hildenbrand Date: Tue Sep 7 19:55:37 2021 -0700 dax/kmem: use a single static memory group for a single probed unit Although dax/kmem users often disable auto-onlining and instead online memory manually (usually to ZONE_MOVABLE), there is still value in having auto-onlining be aware of the relationship of memory blocks. Let's treat one probed unit as a single static memory device, similar to a single ACPI memory device. Link: https://lkml.kernel.org/r/20210806124715.17090-7-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2a1578397a16fc18677c0c434db792182ba551ed Author: David Hildenbrand Date: Tue Sep 7 19:55:34 2021 -0700 ACPI: memhotplug: use a single static memory group for a single memory device Let's group all memory we add for a single memory device - we want a single node for that (which also seems to be the sane thing to do). We won't care for now about memory that was already added to the system (e.g., via e820) -- usually *all* memory of a memory device was already added and we'll fail acpi_memory_enable_device(). Link: https://lkml.kernel.org/r/20210806124715.17090-6-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Rafael J. Wysocki Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 836809ec75cc07c6d07c43036e3844affbe0d46f Author: David Hildenbrand Date: Tue Sep 7 19:55:30 2021 -0700 mm/memory_hotplug: track present pages in memory groups Let's track all present pages in each memory group. Especially, track memory present in ZONE_MOVABLE and memory present in one of the kernel zones (which really only is ZONE_NORMAL right now as memory groups only apply to hotplugged memory) separately within a memory group, to prepare for making smart auto-online decision for individual memory blocks within a memory group based on group statistics. Link: https://lkml.kernel.org/r/20210806124715.17090-5-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 028fc57a1c361116e3bcebfeba4ca87878baaf4f Author: David Hildenbrand Date: Tue Sep 7 19:55:26 2021 -0700 drivers/base/memory: introduce "memory groups" to logically group memory blocks In our "auto-movable" memory onlining policy, we want to make decisions across memory blocks of a single memory device. Examples of memory devices include ACPI memory devices (in the simplest case a single DIMM) and virtio-mem. For now, we don't have a connection between a single memory block device and the real memory device. Each memory device consists of 1..X memory block devices. Let's logically group memory blocks belonging to the same memory device in "memory groups". Memory groups can span multiple physical ranges and a memory group itself does not contain any information regarding physical ranges, only properties (e.g., "max_pages") necessary for improved memory onlining. Introduce two memory group types: 1) Static memory group: E.g., a single ACPI memory device, consisting of 1..X memory resources. A memory group consists of 1..Y memory blocks. The whole group is added/removed in one go. If any part cannot get offlined, the whole group cannot be removed. 2) Dynamic memory group: E.g., a single virtio-mem device. Memory is dynamically added/removed in a fixed granularity, called a "unit", consisting of 1..X memory blocks. A unit is added/removed in one go. If any part of a unit cannot get offlined, the whole unit cannot be removed. In case of 1) we usually want either all memory managed by ZONE_MOVABLE or none. In case of 2) we usually want to have as many units as possible managed by ZONE_MOVABLE. We want a single unit to be of the same type. For now, memory groups are an internal concept that is not exposed to user space; we might want to change that in the future, though. add_memory() users can specify a mgid instead of a nid when passing the MHP_NID_IS_MGID flag. Link: https://lkml.kernel.org/r/20210806124715.17090-4-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e83a437faa625efb2e70924fd3c32ba95610c502 Author: David Hildenbrand Date: Tue Sep 7 19:55:23 2021 -0700 mm/memory_hotplug: introduce "auto-movable" online policy When onlining without specifying a zone (using "online" instead of "online_kernel" or "online_movable"), we currently select a zone such that existing zones are kept contiguous. This online policy made sense in the past, where contiguous zones where required. We'd like to implement smarter policies, however: * User space has little insight. As one example, it has no idea which memory blocks logically belong together (e.g., to a DIMM or to a virtio-mem device). * Drivers that add memory in separate memory blocks, especially virtio-mem, want memory to get onlined right from the kernel when adding. So we really want to have onlining to differing zones managed in the kernel, configured by user space. We see more and more cases where we might eventually hotplug a lot of memory in the future (e.g., eventually grow a 2 GiB VM to 64 GiB), however: * Resizing happens dynamically, in smaller steps in both directions (e.g., 2 GiB -> 8 GiB -> 4 GiB -> 16 GiB ...) * We still want as much flexibility as possible, especially, hotunplugging as much memory as possible later. We can really only use "online_movable" if we know that the amount of memory we are going to hotplug upfront, and we know that it won't result in a zone imbalance. So in our example, a 2 GiB VM that could grow to 64 GiB could currently not use "online_movable", and instead, "online_kernel" would have to be used, resulting in worse (no) memory hotunplug reliability. Let's add a new "auto-movable" online policy that considers the current zone ratios (global, per-node) to determine, whether we a memory block can be onlined to ZONE_MOVABLE: MOVABLE : KERNEL However, internally we'll only consider the following ratio for now: MOVABLE : KERNEL_EARLY For now, we don't allow for hotplugged KERNEL memory to allow for more MOVABLE memory, because there is no coordination across memory devices. In follow-up patches, we will allow for more KERNEL memory within a memory device to allow for more MOVABLE memory within the same memory device -- which only makes sense for special memory device types. We base our calculation on "present pages", see the code comments for details. Hotplugged memory will get online to ZONE_MOVABLE if the configured ratio allows for it. Depending on the setup, this can result in fragmented zones, which can make compaction slower and dynamic allocation of gigantic pages when not using CMA less reliable (... which is already pretty unreliable). The old policy will be the default and called "contig-zones". In follow-up patches, our new policy will use additional information, such as memory groups, to make even smarter decisions across memory blocks. Configuration: * memory_hotplug.online_policy is used to switch between both polices and defaults to "contig-zones". * memory_hotplug.auto_movable_ratio defines the maximum ratio is in percent and defaults to "301" -- allowing e.g., most 8 GiB machines to grow to 32 GiB and have all hotplugged memory in ZONE_MOVABLE. The additional percent accounts for a handful of lost present pages (e.g., firmware allocations). User space is expected to adjust this ratio when enabling the new "auto-movable" policy, though. * memory_hotplug.auto_movable_numa_aware considers numa node stats in addition to global stats, and defaults to "true". Note: just like the old policy, the new policy won't take things like unmovable huge pages or memory ballooning that doesn't support balloon compaction into account. User space has to configure onlining accordingly. Link: https://lkml.kernel.org/r/20210806124715.17090-3-david@redhat.com Signed-off-by: David Hildenbrand Cc: Anshuman Khandual Cc: Dan Williams Cc: Dave Hansen Cc: Greg Kroah-Hartman Cc: Hui Zhu Cc: Jason Wang Cc: Len Brown Cc: Marek Kedzierski Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4b0970024408afb17886e0c76e9761c4264db2a8 Author: David Hildenbrand Date: Tue Sep 7 19:55:19 2021 -0700 mm: track present early pages per zone Patch series "mm/memory_hotplug: "auto-movable" online policy and memory groups", v3. I. Goal The goal of this series is improving in-kernel auto-online support. It tackles the fundamental problems that: 1) We can create zone imbalances when onlining all memory blindly to ZONE_MOVABLE, in the worst case crashing the system. We have to know upfront how much memory we are going to hotplug such that we can safely enable auto-onlining of all hotplugged memory to ZONE_MOVABLE via "online_movable". This is far from practical and only applicable in limited setups -- like inside VMs under the RHV/oVirt hypervisor which will never hotplug more than 3 times the boot memory (and the limitation is only in place due to the Linux limitation). 2) We see more setups that implement dynamic VM resizing, hot(un)plugging memory to resize VM memory. In these setups, we might hotplug a lot of memory, but it might happen in various small steps in both directions (e.g., 2 GiB -> 8 GiB -> 4 GiB -> 16 GiB ...). virtio-mem is the primary driver of this upstream right now, performing such dynamic resizing NUMA-aware via multiple virtio-mem devices. Onlining all hotplugged memory to ZONE_NORMAL means we basically have no hotunplug guarantees. Onlining all to ZONE_MOVABLE means we can easily run into zone imbalances when growing a VM. We want a mixture, and we want as much memory as reasonable/configured in ZONE_MOVABLE. Details regarding zone imbalances can be found at [1]. 3) Memory devices consist of 1..X memory block devices, however, the kernel doesn't really track the relationship. Consequently, also user space has no idea. We want to make per-device decisions. As one example, for memory hotunplug it doesn't make sense to use a mixture of zones within a single DIMM: we want all MOVABLE if possible, otherwise all !MOVABLE, because any !MOVABLE part will easily block the whole DIMM from getting hotunplugged. As another example, virtio-mem operates on individual units that span 1..X memory blocks. Similar to a DIMM, we want a unit to either be all MOVABLE or !MOVABLE. A "unit" can be thought of like a DIMM, however, all units of a virtio-mem device logically belong together and are managed (added/removed) by a single driver. We want as much memory of a virtio-mem device to be MOVABLE as possible. 4) We want memory onlining to be done right from the kernel while adding memory, not triggered by user space via udev rules; for example, this is reqired for fast memory hotplug for drivers that add individual memory blocks, like virito-mem. We want a way to configure a policy in the kernel and avoid implementing advanced policies in user space. The auto-onlining support we have in the kernel is not sufficient. All we have is a) online everything MOVABLE (online_movable) b) online everything !MOVABLE (online_kernel) c) keep zones contiguous (online). This series allows configuring c) to mean instead "online movable if possible according to the coniguration, driven by a maximum MOVABLE:KERNEL ratio" -- a new onlining policy. II. Approach This series does 3 things: 1) Introduces the "auto-movable" online policy that initially operates on individual memory blocks only. It uses a maximum MOVABLE:KERNEL ratio to make a decision whether a memory block will be onlined to ZONE_MOVABLE or not. However, in the basic form, hotplugged KERNEL memory does not allow for more MOVABLE memory (details in the patches). CMA memory is treated like MOVABLE memory. 2) Introduces static (e.g., DIMM) and dynamic (e.g., virtio-mem) memory groups and uses group information to make decisions in the "auto-movable" online policy across memory blocks of a single memory device (modeled as memory group). More details can be found in patch #3 or in the DIMM example below. 3) Maximizes ZONE_MOVABLE memory within dynamic memory groups, by allowing ZONE_NORMAL memory within a dynamic memory group to allow for more ZONE_MOVABLE memory within the same memory group. The target use case is dynamic VM resizing using virtio-mem. See the virtio-mem example below. I remember that the basic idea of using a ratio to implement a policy in the kernel was once mentioned by Vitaly Kuznetsov, but I might be wrong (I lost the pointer to that discussion). For me, the main use case is using it along with virtio-mem (and DIMMs / ppc64 dlpar where necessary) for dynamic resizing of VMs, increasing the amount of memory we can hotunplug reliably again if we might eventually hotplug a lot of memory to a VM. III. Target Usage The target usage will be: 1) Linux boots with "mhp_default_online_type=offline" 2) User space (e.g., systemd unit) configures memory onlining (according to a config file and system properties), for example: * Setting memory_hotplug.online_policy=auto-movable * Setting memory_hotplug.auto_movable_ratio=301 * Setting memory_hotplug.auto_movable_numa_aware=true 3) User space enabled auto onlining via "echo online > /sys/devices/system/memory/auto_online_blocks" 4) User space triggers manual onlining of all already-offline memory blocks (go over offline memory blocks and set them to "online") IV. Example For DIMMs, hotplugging 4 GiB DIMMs to a 4 GiB VM with a configured ratio of 301% results in the following layout: Memory block 0-15: DMA32 (early) Memory block 32-47: Normal (early) Memory block 48-79: Movable (DIMM 0) Memory block 80-111: Movable (DIMM 1) Memory block 112-143: Movable (DIMM 2) Memory block 144-275: Normal (DIMM 3) Memory block 176-207: Normal (DIMM 4) ... all Normal (-> hotplugged Normal memory does not allow for more Movable memory) For virtio-mem, using a simple, single virtio-mem device with a 4 GiB VM will result in the following layout: Memory block 0-15: DMA32 (early) Memory block 32-47: Normal (early) Memory block 48-143: Movable (virtio-mem, first 12 GiB) Memory block 144: Normal (virtio-mem, next 128 MiB) Memory block 145-147: Movable (virtio-mem, next 384 MiB) Memory block 148: Normal (virtio-mem, next 128 MiB) Memory block 149-151: Movable (virtio-mem, next 384 MiB) ... Normal/Movable mixture as above (-> hotplugged Normal memory allows for more Movable memory within the same device) Which gives us maximum flexibility when dynamically growing/shrinking a VM in smaller steps. V. Doc Update I'll update the memory-hotplug.rst documentation, once the overhaul [1] is usptream. Until then, details can be found in patch #2. VI. Future Work 1) Use memory groups for ppc64 dlpar 2) Being able to specify a portion of (early) kernel memory that will be excluded from the ratio. Like "128 MiB globally/per node" are excluded. This might be helpful when starting VMs with extremely small memory footprint (e.g., 128 MiB) and hotplugging memory later -- not wanting the first hotplugged units getting onlined to ZONE_MOVABLE. One alternative would be a trigger to not consider ZONE_DMA memory in the ratio. We'll have to see if this is really rrequired. 3) Indicate to user space that MOVABLE might be a bad idea -- especially relevant when memory ballooning without support for balloon compaction is active. This patch (of 9): For implementing a new memory onlining policy, which determines when to online memory blocks to ZONE_MOVABLE semi-automatically, we need the number of present early (boot) pages -- present pages excluding hotplugged pages. Let's track these pages per zone. Pass a page instead of the zone to adjust_present_page_count(), similar as adjust_managed_page_count() and derive the zone from the page. It's worth noting that a memory block to be offlined/onlined is either completely "early" or "not early". add_memory() and friends can only add complete memory blocks and we only online/offline complete (individual) memory blocks. Link: https://lkml.kernel.org/r/20210806124715.17090-1-david@redhat.com Link: https://lkml.kernel.org/r/20210806124715.17090-2-david@redhat.com Signed-off-by: David Hildenbrand Cc: Vitaly Kuznetsov Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Marek Kedzierski Cc: Hui Zhu Cc: Pankaj Gupta Cc: Wei Yang Cc: Oscar Salvador Cc: Michal Hocko Cc: Dan Williams Cc: Anshuman Khandual Cc: Dave Hansen Cc: Vlastimil Babka Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Tatashin Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 35ba0cd5290b2f1f92e1f0eb6de7ce7979f79728 Author: David Hildenbrand Date: Tue Sep 7 19:55:14 2021 -0700 ACPI: memhotplug: memory resources cannot be enabled yet We allocate + initialize everything from scratch. In case enabling the device fails, we free all memory resourcs. Link: https://lkml.kernel.org/r/20210712124052.26491-5-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Rafael J. Wysocki Reviewed-by: Oscar Salvador Reviewed-by: Pankaj Gupta Cc: Andy Lutomirski Cc: "Aneesh Kumar K.V" Cc: Anshuman Khandual Cc: Anton Blanchard Cc: Ard Biesheuvel Cc: Baoquan He Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dan Williams Cc: Dave Hansen Cc: Dave Jiang Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jason Wang Cc: Jia He Cc: Joe Perches Cc: Kefeng Wang Cc: Laurent Dufour Cc: Len Brown Cc: Michael Ellerman Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Michel Lespinasse Cc: Mike Rapoport Cc: Nathan Lynch Cc: Nicholas Piggin Cc: Pankaj Gupta Cc: Paul Mackerras Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Pierre Morel Cc: "Rafael J. Wysocki" Cc: Rich Felker Cc: Scott Cheloha Cc: Sergei Trofimovich Cc: Thiago Jung Bauermann Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vishal Verma Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Cc: Will Deacon Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1c158e4956612e7bada4c03dfb99210af4d6cde Author: David Hildenbrand Date: Tue Sep 7 19:55:09 2021 -0700 mm/memory_hotplug: remove nid parameter from remove_memory() and friends There is only a single user remaining. We can simply lookup the nid only used for node offlining purposes when walking our memory blocks. We don't expect to remove multi-nid ranges; and if we'd ever do, we most probably don't care about removing multi-nid ranges that actually result in empty nodes. If ever required, we can detect the "multi-nid" scenario and simply try offlining all online nodes. Link: https://lkml.kernel.org/r/20210712124052.26491-4-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Michael Ellerman (powerpc) Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Nathan Lynch Cc: Laurent Dufour Cc: "Aneesh Kumar K.V" Cc: Scott Cheloha Cc: Anton Blanchard Cc: Andy Lutomirski Cc: Anshuman Khandual Cc: Ard Biesheuvel Cc: Baoquan He Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dave Hansen Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jia He Cc: Joe Perches Cc: Kefeng Wang Cc: Michal Hocko Cc: Michel Lespinasse Cc: Mike Rapoport Cc: Nicholas Piggin Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Pankaj Gupta Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Pierre Morel Cc: "Rafael J. Wysocki" Cc: Rich Felker Cc: Sergei Trofimovich Cc: Thiago Jung Bauermann Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Cc: Will Deacon Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 65a2aa5f482ed0c1b5afb9e6b0b9e0b16bb8b616 Author: David Hildenbrand Date: Tue Sep 7 19:55:04 2021 -0700 mm/memory_hotplug: remove nid parameter from arch_remove_memory() The parameter is unused, let's remove it. Link: https://lkml.kernel.org/r/20210712124052.26491-3-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Catalin Marinas Acked-by: Michael Ellerman [powerpc] Acked-by: Heiko Carstens [s390] Reviewed-by: Pankaj Gupta Reviewed-by: Oscar Salvador Cc: Catalin Marinas Cc: Will Deacon Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Yoshinori Sato Cc: Rich Felker Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Anshuman Khandual Cc: Ard Biesheuvel Cc: Mike Rapoport Cc: Nicholas Piggin Cc: Pavel Tatashin Cc: Baoquan He Cc: Laurent Dufour Cc: Sergei Trofimovich Cc: Kefeng Wang Cc: Michel Lespinasse Cc: Christophe Leroy Cc: "Aneesh Kumar K.V" Cc: Thiago Jung Bauermann Cc: Joe Perches Cc: Pierre Morel Cc: Jia He Cc: Anton Blanchard Cc: Dan Williams Cc: Dave Jiang Cc: Jason Wang Cc: Len Brown Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Nathan Lynch Cc: Pankaj Gupta Cc: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" Cc: Scott Cheloha Cc: Vishal Verma Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 Author: David Hildenbrand Date: Tue Sep 7 19:54:59 2021 -0700 mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() Patch series "mm/memory_hotplug: preparatory patches for new online policy and memory" These are all cleanups and one fix previously sent as part of [1]: [PATCH v1 00/12] mm/memory_hotplug: "auto-movable" online policy and memory groups. These patches make sense even without the other series, therefore I pulled them out to make the other series easier to digest. [1] https://lkml.kernel.org/r/20210607195430.48228-1-david@redhat.com This patch (of 4): Checkpatch complained on a follow-up patch that we are using "unsigned" here, which defaults to "unsigned int" and checkpatch is correct. As we will search for a fitting zone using the wrong pfn, we might end up onlining memory to one of the special kernel zones, such as ZONE_DMA, which can end badly as the onlined memory does not satisfy properties of these zones. Use "unsigned long" instead, just as we do in other places when handling PFNs. This can bite us once we have physical addresses in the range of multiple TB. Link: https://lkml.kernel.org/r/20210712124052.26491-2-david@redhat.com Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") Signed-off-by: David Hildenbrand Reviewed-by: Pankaj Gupta Reviewed-by: Muchun Song Reviewed-by: Oscar Salvador Cc: David Hildenbrand Cc: Vitaly Kuznetsov Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Pankaj Gupta Cc: Wei Yang Cc: Michal Hocko Cc: Dan Williams Cc: Anshuman Khandual Cc: Dave Hansen Cc: Vlastimil Babka Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Tatashin Cc: Heiko Carstens Cc: Michael Ellerman Cc: Catalin Marinas Cc: virtualization@lists.linux-foundation.org Cc: Andy Lutomirski Cc: "Aneesh Kumar K.V" Cc: Anton Blanchard Cc: Ard Biesheuvel Cc: Baoquan He Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dave Jiang Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jia He Cc: Joe Perches Cc: Kefeng Wang Cc: Laurent Dufour Cc: Michel Lespinasse Cc: Nathan Lynch Cc: Nicholas Piggin Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Pierre Morel Cc: "Rafael J. Wysocki" Cc: Rich Felker Cc: Scott Cheloha Cc: Sergei Trofimovich Cc: Thiago Jung Bauermann Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vishal Verma Cc: Will Deacon Cc: Yoshinori Sato Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 673d40c82eb2200da32ae9cc9cac8c584b66b5a9 Author: Mike Rapoport Date: Tue Sep 7 19:54:55 2021 -0700 mm: memory_hotplug: cleanup after removal of pfn_valid_within() When test_pages_in_a_zone() used pfn_valid_within() is has some logic surrounding pfn_valid_within() checks. Since pfn_valid_within() is gone, this logic can be removed. Link: https://lkml.kernel.org/r/20210713080035.7464-3-rppt@kernel.org Signed-off-by: Mike Rapoport Acked-by: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 859a85ddf90e714092dea71a0e54c7b9896621be Author: Mike Rapoport Date: Tue Sep 7 19:54:52 2021 -0700 mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE Patch series "mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE". After recent updates to freeing unused parts of the memory map, no architecture can have holes in the memory map within a pageblock. This makes pfn_valid_within() check and CONFIG_HOLES_IN_ZONE configuration option redundant. The first patch removes them both in a mechanical way and the second patch simplifies memory_hotplug::test_pages_in_a_zone() that had pfn_valid_within() surrounded by more logic than simple if. This patch (of 2): After recent changes in freeing of the unused parts of the memory map and rework of pfn_valid() in arm and arm64 there are no architectures that can have holes in the memory map within a pageblock and so nothing can enable CONFIG_HOLES_IN_ZONE which guards non trivial implementation of pfn_valid_within(). With that, pfn_valid_within() is always hardwired to 1 and can be completely removed. Remove calls to pfn_valid_within() and CONFIG_HOLES_IN_ZONE. Link: https://lkml.kernel.org/r/20210713080035.7464-1-rppt@kernel.org Link: https://lkml.kernel.org/r/20210713080035.7464-2-rppt@kernel.org Signed-off-by: Mike Rapoport Acked-by: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac3332c44767b17b761b703523ac4ae9b2bcd227 Author: David Hildenbrand Date: Tue Sep 7 19:54:49 2021 -0700 memory-hotplug.rst: complete admin-guide overhaul The memory hot(un)plug documentation is outdated and incomplete. Most of the content dates back to 2007, so it's time for a major overhaul. Let's rewrite, reorganize and update most parts of the documentation. In addition to memory hot(un)plug, also add some details regarding ZONE_MOVABLE, with memory hotunplug being one of its main consumers. Drop the file history, that information can more reliably be had from the git log. The style of the document is also properly fixed that e.g., "restview" renders it cleanly now. In the future, we might add some more details about virt users like virtio-mem, the XEN balloon, the Hyper-V balloon and ppc64 dlpar. Link: https://lkml.kernel.org/r/20210707073205.3835-3-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Michal Hocko Reviewed-by: Mike Rapoport Reviewed-by: Oscar Salvador Cc: Mike Kravetz Cc: Dave Hansen Cc: Matthew Wilcox Cc: Anshuman Khandual Cc: Muchun Song Cc: Pavel Tatashin Cc: Jonathan Corbet Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit df82bf5a9fad7004bc0c35a075ed7402b2eb7374 Author: David Hildenbrand Date: Tue Sep 7 19:54:46 2021 -0700 memory-hotplug.rst: remove locking details from admin-guide Patch series "memory-hotplug.rst: complete admin-guide overhaul", v3. This patch (of 2): We have the same content at Documentation/core-api/memory-hotplug.rst and it doesn't fit into the admin-guide. The documentation was accidentially duplicated when merging. Link: https://lkml.kernel.org/r/20210707073205.3835-1-david@redhat.com Link: https://lkml.kernel.org/r/20210707073205.3835-2-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Mike Rapoport Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Cc: Mike Kravetz Cc: Dave Hansen Cc: Matthew Wilcox Cc: Anshuman Khandual Cc: Muchun Song Cc: Pavel Tatashin Cc: Jonathan Corbet Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb9c14ad267d25dd77ceccbcfd69804bdb7240f5 Author: David Hildenbrand Date: Wed Sep 8 17:45:06 2021 +0200 hugetlbfs: s390 is always 64bit No need to check for 64BIT. While at it, let's just select ARCH_SUPPORTS_HUGETLBFS from arch/s390/Kconfig. Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20210908154506.20764-1-david@redhat.com Signed-off-by: Heiko Carstens commit 8c28051cdcbe9dfcec6bd0a4709d67a09df6edae Author: Tetsuo Handa Date: Wed Sep 8 19:27:49 2021 +0900 fbmem: don't allow too huge resolutions syzbot is reporting page fault at vga16fb_fillrect() [1], for vga16fb_check_var() is failing to detect multiplication overflow. if (vxres * vyres > maxmem) { vyres = maxmem / vxres; if (vyres < yres) return -ENOMEM; } Since no module would accept too huge resolutions where multiplication overflow happens, let's reject in the common path. Link: https://syzkaller.appspot.com/bug?extid=04168c8063cfdde1db5e [1] Reported-by: syzbot Debugged-by: Randy Dunlap Signed-off-by: Tetsuo Handa Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/185175d6-227a-7b55-433d-b070929b262c@i-love.sakura.ne.jp commit 49832c819ab85b33b7a2a1429c8d067e82be2977 Author: Randy Dunlap Date: Tue Sep 7 15:42:02 2021 -0700 Makefile: use -Wno-main in the full kernel tree When using gcc (SUSE Linux) 7.5.0 (on openSUSE 15.3), I see a build warning: kernel/trace/trace_osnoise.c: In function 'start_kthread': kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain] void *main = osnoise_main; ^~~~ Quieten that warning by using "-Wno-main". It's OK to use "main" as a declaration name in the kernel. Build-tested on most ARCHes. [ v2: only do it for gcc, since clang doesn't have that particular warning ] Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/lkml/20210813224131.25803-1-rdunlap@infradead.org/ Suggested-by: Steven Rostedt Suggested-by: Linus Torvalds Cc: Daniel Bristot de Oliveira Cc: Masahiro Yamada Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Signed-off-by: Linus Torvalds commit 25fca8c9e0d79ca4c5bb0199dcc52ab0ea4cbd7d Merge: c5433f026b27c fcb958ee8e832 Author: Takashi Iwai Date: Wed Sep 8 17:52:23 2021 +0200 Merge tag 'asoc-fix-v5.15-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.15 A collection of fixes that came in during the merge window, nothing too remarkable but a reasonably large number of fixes. commit 39ff83f2f6cc5cc1458dfcea9697f96338210beb Author: Lukas Hannen Date: Wed Aug 25 10:12:43 2021 +0000 time: Handle negative seconds correctly in timespec64_to_ns() timespec64_ns() prevents multiplication overflows by comparing the seconds value of the timespec to KTIME_SEC_MAX. If the value is greater or equal it returns KTIME_MAX. But that check casts the signed seconds value to unsigned which makes the comparision true for all negative values and therefore return wrongly KTIME_MAX. Negative second values are perfectly valid and required in some places, e.g. ptp_clock_adjtime(). Remove the cast and add a check for the negative boundary which is required to prevent undefined behaviour due to multiplication underflow. Fixes: cb47755725da ("time: Prevent undefined behaviour in timespec64_to_ns()")' Signed-off-by: Lukas Hannen Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/AM6PR01MB541637BD6F336B8FFB72AF80EEC69@AM6PR01MB5416.eurprd01.prod.exchangelabs.com commit e543b10cd9d75309c820d2175200d09b2a62f249 Merge: 59dc33252ee77 fa209644a7124 17b121ad0c433 Author: Rafael J. Wysocki Date: Wed Sep 8 16:44:15 2021 +0200 Merge branches 'acpi-pm' and 'acpi-docs' * acpi-pm: ACPI: PM: s2idle: Run both AMD and Microsoft methods if both are supported * acpi-docs: Documentation: ACPI: Align the SSDT overlays file with the code commit f76c87e8c33766cc6a7bf7461dfac9cebb05b5df Merge: eabf9e616ec6e 2a3441f59464c Author: Rafael J. Wysocki Date: Wed Sep 8 16:42:13 2021 +0200 Merge branch 'pm-opp' * pm-opp: dt-bindings: opp: Convert to DT schema dt-bindings: Clean-up OPP binding node names in examples ARM: dts: omap: Drop references to opp.txt commit eabf9e616ec6e7864458371390ef7771dfb3ad0a Merge: 5cbba60596b1f 27de8d5970207 Author: Rafael J. Wysocki Date: Wed Sep 8 16:42:02 2021 +0200 Merge branch 'pm-cpufreq' * pm-cpufreq: Revert "cpufreq: intel_pstate: Process HWP Guaranteed change notification" cpufreq: mediatek-hw: Add support for CPUFREQ HW cpufreq: Add of_perf_domain_get_sharing_cpumask dt-bindings: cpufreq: add bindings for MediaTek cpufreq HW cpufreq: Remove ready() callback cpufreq: sh: Remove sh_cpufreq_cpu_ready() cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() cpufreq: qcom-hw: Set dvfs_possible_from_any_cpu cpufreq driver flag cpufreq: blocklist more Qualcomm platforms in cpufreq-dt-platdev cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support cpufreq: scmi: Use .register_em() to register with energy model cpufreq: vexpress: Use .register_em() to register with energy model cpufreq: scpi: Use .register_em() to register with energy model cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy model cpufreq: omap: Use .register_em() to register with energy model cpufreq: mediatek: Use .register_em() to register with energy model cpufreq: imx6q: Use .register_em() to register with energy model cpufreq: dt: Use .register_em() to register with energy model cpufreq: Add callback to register with energy model cpufreq: vexpress: Set CPUFREQ_IS_COOLING_DEV flag commit 713b9825a4c47897f66ad69409581e7734a8728e Author: Pavel Begunkov Date: Wed Sep 8 10:09:29 2021 +0100 io-wq: fix cancellation on create-worker failure WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test fs/io_uring.c:1151 [inline] WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test fs/io_uring.c:1146 [inline] WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 io_req_complete_post+0xf5b/0x1190 fs/io_uring.c:1794 Modules linked in: Call Trace: tctx_task_work+0x1e5/0x570 fs/io_uring.c:2158 task_work_run+0xe0/0x1a0 kernel/task_work.c:164 tracehook_notify_signal include/linux/tracehook.h:212 [inline] handle_signal_work kernel/entry/common.c:146 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x232/0x2a0 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae When io_wqe_enqueue() -> io_wqe_create_worker() fails, we can't just call io_run_cancel() to clean up the request, it's already enqueued via io_wqe_insert_work() and will be executed either by some other worker during cancellation (e.g. in io_wq_put_and_exit()). Reported-by: Hao Sun Fixes: 3146cba99aa28 ("io-wq: make worker creation resilient against signals") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/93b9de0fcf657affab0acfd675d4abcd273ee863.1631092071.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 9652cb805c44b74ba935c84bfd59745cb1962de8 Author: Heiko Carstens Date: Tue Sep 7 20:37:59 2021 +0200 s390/ftrace: remove incorrect __va usage The address of ftrace_graph_caller is already virtual. Using __va() to translate the address is wrong. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 2c57ad602493a6674d5c8e35b427ab27012437b2 Author: Heiko Carstens Date: Tue Sep 7 07:28:20 2021 +0200 s390/zcrypt: remove incorrect kernel doc indicators Many comments above functions start with a kernel doc indicator, but the comments are not using kernel doc style. Get rid of the warnings by simply removing the indicator. E.g.: drivers/s390/crypto/zcrypt_msgtype6.c:111: warning: This comment starts with '/**', but isn't a kernel-doc comment. Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit f6beebb15eeede0c39bb2d25aefa61f9ddcf2395 Author: Heiko Carstens Date: Mon Sep 6 22:28:16 2021 +0200 scsi: zfcp: fix kernel doc comments A couple of function names don't match what the kernel doc comments indicate. Acked-by: Benjamin Block Signed-off-by: Heiko Carstens commit ff8a58b0ae735f32fe87d0d07e98751ff9dcaed0 Author: Heiko Carstens Date: Mon Sep 6 22:20:05 2021 +0200 s390/sclp: add __nonstring annotation Add __nonstring annotation, since the missing string termination for id member of sclp_trace_entry is intended. This way we get rid of this warning: drivers/s390/char/sclp.c:84:9: warning: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation] 84 | strncpy(e.id, id, sizeof(e.id)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Reviewed-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 2169b908894df2ce83e7eb4a399d3224b2635126 Author: chongjiapeng Date: Mon Sep 6 17:48:43 2021 +0800 IB/hfi1: make hist static This symbol is not used outside of trace.c, so marks it static. Fix the following sparse warning: drivers/infiniband/hw/hfi1/trace.c:491:23: warning: symbol 'hist' was not declared. Should it be static? Link: https://lore.kernel.org/r/1630921723-21545-1-git-send-email-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: chongjiapeng Signed-off-by: Jason Gunthorpe commit f1b195ce81ad31618e9f28894a343fd62debb9ab Author: Len Baker Date: Sun Sep 5 10:18:12 2021 +0200 RDMA/bnxt_re: 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. In this case this is not actually dynamic sizes: both sides of the multiplication are constant values. However it is best to refactor this anyway, just to keep the open-coded math idiom out of code. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. Also, remove the unnecessary initialization of the sqp_tbl variable since it is set a few lines later. [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Link: https://lore.kernel.org/r/20210905081812.17113-1-len.baker@gmx.com Signed-off-by: Len Baker Reviewed-by: Leon Romanovsky Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 84f969e1c48ed3825986e91a0786e363d57f69d1 Author: Jason Gunthorpe Date: Fri Sep 3 10:07:28 2021 -0300 IB/qib: Fix null pointer subtraction compiler warning >> drivers/infiniband/hw/qib/qib_sysfs.c:411:1: warning: performing pointer subtraction with a null pointer has undefined behavior +[-Wnull-pointer-subtraction] QIB_DIAGC_ATTR(rc_resends); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/qib/qib_sysfs.c:408:51: note: expanded from macro 'QIB_DIAGC_ATTR' .counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \ Use offsetof and accomplish the type check using static_assert. Fixes: 4a7aaf88c89f ("RDMA/qib: Use attributes for the port sysfs") Link: https://lore.kernel.org/r/0-v1-43ae3c759177+65-qib_type_jgg@nvidia.com Reported-by: kernel test robot Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit f4c6f31011eafe027abddf6cee1288a1b5a05b73 Author: Niklas Schnelle Date: Wed Sep 8 10:18:49 2021 +0200 RDMA/mlx5: Fix xlt_chunk_align calculation The XLT chunk alignment depends on ent_size not sizeof(ent_size) aka sizeof(size_t). The incoming ent_size is either 8 or 16, so the miscalculation when 16 is required is only an over-alignment and functional harmless. Fixes: 8010d74b9965 ("RDMA/mlx5: Split the WR setup out of mlx5_ib_update_xlt()") Link: https://lore.kernel.org/r/20210908081849.7948-2-schnelle@linux.ibm.com Signed-off-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe commit 9660dcbe0d9186976917c94bce4e69dbd8d7a974 Author: Niklas Schnelle Date: Wed Sep 8 10:18:48 2021 +0200 RDMA/mlx5: Fix number of allocated XLT entries In commit 8010d74b9965b ("RDMA/mlx5: Split the WR setup out of mlx5_ib_update_xlt()") the allocation logic was split out of mlx5_ib_update_xlt() and the logic was changed to enable better OOM handling. Sadly this change introduced a miscalculation of the number of entries that were actually allocated when under memory pressure where it can actually become 0 which on s390 lets dma_map_single() fail. It can also lead to corruption of the free pages list when the wrong number of entries is used in the calculation of sg->length which is used as argument for free_pages(). Fix this by using the allocation size instead of misusing get_order(size). Cc: stable@vger.kernel.org Fixes: 8010d74b9965 ("RDMA/mlx5: Split the WR setup out of mlx5_ib_update_xlt()") Link: https://lore.kernel.org/r/20210908081849.7948-1-schnelle@linux.ibm.com Signed-off-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe commit 276aae377206d60b9b7b7df4586cd9f2a813f5d0 Author: Joakim Zhang Date: Wed Sep 8 15:43:35 2021 +0800 net: stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume commit 5f58591323bf ("net: stmmac: delete the eee_ctrl_timer after napi disabled"), this patch tries to fix system hang caused by eee_ctrl_timer, unfortunately, it only can resolve it for system reboot stress test. System hang also can be reproduced easily during system suspend/resume stess test when mount NFS on i.MX8MP EVK board. In stmmac driver, eee feature is combined to phylink framework. When do system suspend, phylink_stop() would queue delayed work, it invokes stmmac_mac_link_down(), where to deactivate eee_ctrl_timer synchronizly. In above commit, try to fix issue by deactivating eee_ctrl_timer obviously, but it is not enough. Looking into eee_ctrl_timer expire callback stmmac_eee_ctrl_timer(), it could enable hareware eee mode again. What is unexpected is that LPI interrupt (MAC_Interrupt_Enable.LPIEN bit) is always asserted. This interrupt has chance to be issued when LPI state entry/exit from the MAC, and at that time, clock could have been already disabled. The result is that system hang when driver try to touch register from interrupt handler. The reason why above commit can fix system hang issue in stmmac_release() is that, deactivate eee_ctrl_timer not just after napi disabled, further after irq freed. In conclusion, hardware would generate LPI interrupt when clock has been disabled during suspend or resume, since hardware is in eee mode and LPI interrupt enabled. Interrupts from MAC, MTL and DMA level are enabled and never been disabled when system suspend, so postpone clocks management from suspend stage to noirq suspend stage should be more safe. Fixes: 5f58591323bf ("net: stmmac: delete the eee_ctrl_timer after napi disabled") Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit b5c102238cea985d8126b173d06b9e1de88037ee Author: Alex Elder Date: Tue Sep 7 12:05:54 2021 -0500 net: ipa: initialize all filter table slots There is an off-by-one problem in ipa_table_init_add(), when initializing filter tables. In that function, the number of filter table entries is determined based on the number of set bits in the filter map. However that count does *not* include the extra "slot" in the filter table that holds the filter map itself. Meanwhile, ipa_table_addr() *does* include the filter map in the memory it returns, but because the count it's provided doesn't include it, it includes one too few table entries. Fix this by including the extra slot for the filter map in the count computed in ipa_table_init_add(). Note: ipa_filter_reset_table() does not have this problem; it resets filter table entries one by one, but does not overwrite the filter bitmap. Fixes: 2b9feef2b6c2 ("soc: qcom: ipa: filter and routing tables") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit ea269a6f720782ed94171fb962b14ce07c372138 Author: Nathan Rossi Date: Thu Sep 2 05:14:49 2021 +0000 net: phylink: Update SFP selected interface on advertising changes Currently changes to the advertising state via ethtool do not cause any reselection of the configured interface mode after the SFP is already inserted and initially configured. While it is not typical to change the advertised link modes for an interface using an SFP in certain use cases it is desirable. In the case of a SFP port that is capable of handling both SFP and SFP+ modules it will automatically select between 1G and 10G modes depending on the supported mode of the SFP. However if the SFP module is capable of working in multiple modes (e.g. a SFP+ DAC that can operate at 1G or 10G), one end of the cable may be attached to a SFP 1000base-x port thus the SFP+ end must be manually configured to the 1000base-x mode in order for the link to be established. This change causes the ethtool setting of advertised mode changes to reselect the interface mode so that the link can be established. Additionally when a module is inserted the advertising mode is reset to match the supported modes of the module. Signed-off-by: Nathan Rossi Signed-off-by: David S. Miller commit d7e203ffd3ba5965e88952e7364a42ab32064408 Author: Arnd Bergmann Date: Tue Sep 7 15:46:10 2021 +0200 ne2000: fix unused function warning Geert noticed a warning on MIPS TX49xx, Atari and presuambly other platforms when the driver is built-in but NETDEV_LEGACY_INIT is disabled: drivers/net/ethernet/8390/ne.c:909:20: warning: ‘ne_add_devices’ defined but not used [-Wunused-function] Merge the two module init functions into a single one with an IS_ENABLED() check to replace the incorrect #ifdef. Fixes: 4228c3942821 ("make legacy ISA probe optional") Reported-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit c324f023dbb2bcceccb7ecad5a268e58b80e638d Merge: d437f5aa23aa2 8db6a54f3cae6 Author: David S. Miller Date: Wed Sep 8 11:40:03 2021 +0100 Merge tag 'mlx5-fixes-2021-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2021-09-07 This series introduces some fixes to mlx5 driver. Please pull and let me know if there is any problem. Included here, a patch which solves a build warning reported on linux-kernel mailing list [1]: Fix commit ("net/mlx5: Bridge, fix uninitialized variable usage") I hope this series can make it to rc1. [1] https://www.spinics.net/lists/netdev/msg765481.html ==================== Signed-off-by: David S. Miller commit d437f5aa23aa2b7bd07cd44b839d7546cc17166f Author: Sukadev Bhattiprolu Date: Tue Sep 7 22:07:03 2021 -0700 ibmvnic: check failover_pending in login response If a failover occurs before a login response is received, the login response buffer maybe undefined. Check that there was no failover before accessing the login response buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 581edcd0c8a076eba2ec9e20db50921ee80f5cbc Author: Jeremy Kerr Date: Wed Sep 8 12:13:10 2021 +0800 mctp: perform route destruction under RCU read lock The kernel test robot reports: [ 843.509974][ T345] ============================= [ 843.524220][ T345] WARNING: suspicious RCU usage [ 843.538791][ T345] 5.14.0-rc2-00606-g889b7da23abf #1 Not tainted [ 843.553617][ T345] ----------------------------- [ 843.567412][ T345] net/mctp/route.c:310 RCU-list traversed in non-reader section!! - we're missing the rcu read lock acquire around the destruction path. This change adds the acquire/release - the path is already atomic, and we're using the _rcu list iterators. Reported-by: kernel test robot Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit d9ea761fdd197351890418acd462c51f241014a7 Author: Lin, Zhenpeng Date: Wed Sep 8 03:40:59 2021 +0000 dccp: don't duplicate ccid when cloning dccp sock Commit 2677d2067731 ("dccp: don't free ccid2_hc_tx_sock ...") fixed a UAF but reintroduced CVE-2017-6074. When the sock is cloned, two dccps_hc_tx_ccid will reference to the same ccid. So one can free the ccid object twice from two socks after cloning. This issue was found by "Hadar Manor" as well and assigned with CVE-2020-16119, which was fixed in Ubuntu's kernel. So here I port the patch from Ubuntu to fix it. The patch prevents cloned socks from referencing the same ccid. Fixes: 2677d2067731410 ("dccp: don't free ccid2_hc_tx_sock ...") Signed-off-by: Zhenpeng Lin Signed-off-by: David S. Miller commit 0f31ab217dc52a3044044d416be0248b1778c4da Author: Samuel Holland Date: Tue Sep 7 22:02:40 2021 -0500 dt-bindings: net: sun8i-emac: Add compatible for D1 The D1 SoC contains EMAC hardware which is compatible with the A64 EMAC. Add the new compatible string, with the A64 as a fallback. Signed-off-by: Samuel Holland Acked-by: Maxime Ripard Signed-off-by: David S. Miller commit ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d Merge: b339ec9c229aa 742a4c49a82a8 Author: Linus Torvalds Date: Tue Sep 7 19:13:42 2021 -0700 Merge tag 'pci-v5.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: "Enumeration: - Convert controller drivers to generic_handle_domain_irq() (Marc Zyngier) - Simplify VPD (Vital Product Data) access and search (Heiner Kallweit) - Update bnx2, bnx2x, bnxt, cxgb4, cxlflash, sfc, tg3 drivers to use simplified VPD interfaces (Heiner Kallweit) - Run Max Payload Size quirks before configuring MPS; work around ASMedia ASM1062 SATA MPS issue (Marek Behún) Resource management: - Refactor pci_ioremap_bar() and pci_ioremap_wc_bar() (Krzysztof Wilczyński) - Optimize pci_resource_len() to reduce kernel size (Zhen Lei) PCI device hotplug: - Fix a double unmap in ibmphp (Vishal Aslot) PCIe port driver: - Enable Bandwidth Notification only if port supports it (Stuart Hayes) Sysfs/proc/syscalls: - Add schedule point in proc_bus_pci_read() (Krzysztof Wilczyński) - Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure (Krzysztof Wilczyński) - Return "int" from pciconfig_read() syscall (Krzysztof Wilczyński) Virtualization: - Extend "pci=noats" to also turn on Translation Blocking to protect against some DMA attacks (Alex Williamson) - Add sysfs mechanism to control the type of reset used between device assignments to VMs (Amey Narkhede) - Add support for ACPI _RST reset method (Shanker Donthineni) - Add ACS quirks for Cavium multi-function devices (George Cherian) - Add ACS quirks for NXP LX2xx0 and LX2xx2 platforms (Wasim Khan) - Allow HiSilicon AMBA devices that appear as fake PCI devices to use PASID and SVA (Zhangfei Gao) Endpoint framework: - Add support for SR-IOV Endpoint devices (Kishon Vijay Abraham I) - Zero-initialize endpoint test tool parameters so we don't use random parameters (Shunyong Yang) APM X-Gene PCIe controller driver: - Remove redundant dev_err() call in xgene_msi_probe() (ErKun Yang) Broadcom iProc PCIe controller driver: - Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' because it's optional on BCMA devices (Rob Herring) - Fix BCMA probe resource handling (Rob Herring) Cadence PCIe driver: - Work around J7200 Link training electrical issue by increasing delays in LTSSM (Nadeem Athani) Intel IXP4xx PCI controller driver: - Depend on ARCH_IXP4XX to avoid useless config questions (Geert Uytterhoeven) Intel Keembay PCIe controller driver: - Add Intel Keem Bay PCIe controller (Srikanth Thokala) Marvell Aardvark PCIe controller driver: - Work around config space completion handling issues (Evan Wang) - Increase timeout for config access completions (Pali Rohár) - Emulate CRS Software Visibility bit (Pali Rohár) - Configure resources from DT 'ranges' property to fix I/O space access (Pali Rohár) - Serialize INTx mask/unmask (Pali Rohár) MediaTek PCIe controller driver: - Add MT7629 support in DT (Chuanjia Liu) - Fix an MSI issue (Chuanjia Liu) - Get syscon regmap ("mediatek,generic-pciecfg"), IRQ number ("pci_irq"), PCI domain ("linux,pci-domain") from DT properties if present (Chuanjia Liu) Microsoft Hyper-V host bridge driver: - Add ARM64 support (Boqun Feng) - Support "Create Interrupt v3" message (Sunil Muthuswamy) NVIDIA Tegra PCIe controller driver: - Use seq_puts(), move err_msg from stack to static, fix OF node leak (Christophe JAILLET) NVIDIA Tegra194 PCIe driver: - Disable suspend when in Endpoint mode (Om Prakash Singh) - Fix MSI-X address programming error (Om Prakash Singh) - Disable interrupts during suspend to avoid spurious AER link down (Om Prakash Singh) Renesas R-Car PCIe controller driver: - Work around hardware issue that prevents Link L1->L0 transition (Marek Vasut) - Fix runtime PM refcount leak (Dinghao Liu) Rockchip DesignWare PCIe controller driver: - Add Rockchip RK356X host controller driver (Simon Xue) TI J721E PCIe driver: - Add support for J7200 and AM64 (Kishon Vijay Abraham I) Toshiba Visconti PCIe controller driver: - Add Toshiba Visconti PCIe host controller driver (Nobuhiro Iwamatsu) Xilinx NWL PCIe controller driver: - Enable PCIe reference clock via CCF (Hyun Kwon) Miscellaneous: - Convert sta2x11 from 'pci_' to 'dma_' API (Christophe JAILLET) - Fix pci_dev_str_match_path() alloc while atomic bug (used for kernel parameters that specify devices) (Dan Carpenter) - Remove pointless Precision Time Management warning when PTM is present but not enabled (Jakub Kicinski) - Remove surplus "break" statements (Krzysztof Wilczyński)" * tag 'pci-v5.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (132 commits) PCI: ibmphp: Fix double unmap of io_mem x86/PCI: sta2x11: switch from 'pci_' to 'dma_' API PCI/VPD: Use unaligned access helpers PCI/VPD: Clean up public VPD defines and inline functions cxgb4: Use pci_vpd_find_id_string() to find VPD ID string PCI/VPD: Add pci_vpd_find_id_string() PCI/VPD: Include post-processing in pci_vpd_find_tag() PCI/VPD: Stop exporting pci_vpd_find_info_keyword() PCI/VPD: Stop exporting pci_vpd_find_tag() PCI: Set dma-can-stall for HiSilicon chips PCI: rockchip-dwc: Add Rockchip RK356X host controller driver PCI: dwc: Remove surplus break statement after return PCI: artpec6: Remove local code block from switch statement PCI: artpec6: Remove surplus break statement after return MAINTAINERS: Add entries for Toshiba Visconti PCIe controller PCI: visconti: Add Toshiba Visconti PCIe host controller driver PCI/portdrv: Enable Bandwidth Notification only if port supports it PCI: Allow PASID on fake PCIe devices without TLP prefixes PCI: mediatek: Use PCI domain to handle ports detection PCI: mediatek: Add new method to get irq number ... commit b339ec9c229aaf399296a120d7be0e34fbc355ca Author: Marco Elver Date: Tue Sep 7 23:12:08 2021 +0200 kbuild: Only default to -Werror if COMPILE_TEST The cross-product of the kernel's supported toolchains, architectures, and configuration options is large. So large, that it's generally accepted to be infeasible to enumerate and build+test them all (many compile-testers rely on randomly generated configs). Without the possibility to enumerate all possible combinations of toolchains, architectures, and configuration options, it is inevitable that compiler warnings in this space exist. With -Werror, this means that an innumerable set of kernels are now broken, yet had been perfectly usable before (confused compilers, code with warnings unused, or luck). Distributors will necessarily pick a point in the toolchain X arch X config space, and if unlucky, will have a broken build. Granted, those will likely disable CONFIG_WERROR and move on. The kernel's default configuration is unlikely to be suitable for all users, but it's inappropriate to force many users to set CONFIG_WERROR=n. This also holds for CI systems which are focused on runtime testing, where the odd warning in some subsystem will disrupt testing of the rest of the kernel. Many of those runtime-focused CI systems run tests or fuzz the kernel using runtime debugging tools. Runtime testing of different subsystems can proceed in parallel, and potentially uncover serious bugs; halting runtime testing of the entire kernel because of the odd warning (now error) in a subsystem or driver is simply inappropriate. Therefore, runtime-focused CI systems will likely choose CONFIG_WERROR=n as well. The appropriate usecase for -Werror is therefore compile-test focused builds (often done by developers or CI systems). Reflect this in the Kconfig option by making the default value of WERROR match COMPILE_TEST. Signed-off-by: Marco Elver Acked-by: Guenter Roeck Acked-by: Randy Dunlap Reviwed-by: Mark Brown Reviewed-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 5615e088b43d564aec08ccfaecb21ba484a1b4d6 Author: Dan Carpenter Date: Tue Aug 24 14:51:50 2021 +0300 tracing: Fix some alloc_event_probe() error handling bugs There are two bugs in this code. First, if the kzalloc() fails it leads to a NULL dereference of "ep" on the next line. Second, if the alloc_event_probe() function returns an error then it leads to an error pointer dereference in the caller. Link: https://lkml.kernel.org/r/20210824115150.GI31143@kili Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") Signed-off-by: Dan Carpenter Signed-off-by: Steven Rostedt (VMware) commit 7f2a6a69f7ced6db8220298e0497cf60482a9d4b Author: Song Liu Date: Tue Sep 7 16:03:38 2021 -0700 blk-mq: allow 4x BLK_MAX_REQUEST_COUNT at blk_plug for multiple_queues Limiting number of request to BLK_MAX_REQUEST_COUNT at blk_plug hurts performance for large md arrays. [1] shows resync speed of md array drops for md array with more than 16 HDDs. Fix this by allowing more request at plug queue. The multiple_queue flag is used to only apply higher limit to multiple queue cases. [1] https://lore.kernel.org/linux-raid/CAFDAVznS71BXW8Jxv6k9dXc2iR3ysX3iZRBww_rzA8WifBFxGg@mail.gmail.com/ Tested-by: Marcin Wanat Signed-off-by: Song Liu Signed-off-by: Jens Axboe commit 8db6a54f3cae6a803b2cbf5390662bca641f7da8 Author: Aya Levin Date: Sun Aug 29 13:41:08 2021 +0300 net/mlx5e: Fix condition when retrieving PTP-rqn When activating the PTP-RQ, redirect the RQT from drop-RQ to PTP-RQ. Use mlx5e_channels_get_ptp_rqn to retrieve the rqn. This helper returns a boolean (not status), hence caller should consider return value 0 as a fail. Change the caller interpretation of the return value. Fixes: 43ec0f41fa73 ("net/mlx5e: Hide all implementation details of mlx5e_rx_res") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit c91c1da72b47fc4c5e353cdd9099ba94ae07d2fa Author: Aya Levin Date: Thu Jul 15 10:53:28 2021 +0300 net/mlx5e: Fix mutual exclusion between CQE compression and HW TS Some profiles of the driver don't support a dedicated PTP-RQ, hence can't support HW TS and CQE compression simultaneously. When HW TS is enabled the COE compression is disabled, and should be restored when the HW TS is turned off. Add rx_filter as an input to modifying CQE compression to enforce this restriction. Fixes: 256f79d13c1d ("net/mlx5e: Fix HW TS with CQE compression according to profile") Signed-off-by: Aya Levin Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit ee27e330a953595903979ffdb84926843595a9fe Author: Maor Gottlieb Date: Wed Sep 1 11:48:13 2021 +0300 net/mlx5: Fix potential sleeping in atomic context Fixes the below flow of sleeping in atomic context by releasing the RCU lock before calling to free_match_list. build_match_list() <- disables preempt -> free_match_list() -> tree_put_node() -> down_write_ref_node() <- take write lock Fixes: 693c6883bbc4 ("net/mlx5: Add hash table for flow groups in flow table") Reported-by: Dan Carpenter Signed-off-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d Author: Saeed Mahameed Date: Wed Aug 18 13:09:26 2021 -0700 net/mlx5: FWTrace, cancel work on alloc pd error flow Handle error flow on mlx5_core_alloc_pd() failure, read_fw_strings_work must be canceled. Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling") Reported-by: Pavel Machek (CIP) Suggested-by: Pavel Machek (CIP) Signed-off-by: Saeed Mahameed Reviewed-by: Aya Levin commit da8252d5805d4a80120a0c2151277e5fb9e8aa9e Author: Mark Bloch Date: Wed Aug 11 16:40:16 2021 +0300 net/mlx5: Lag, don't update lag if lag isn't supported In NICs that don't support LAG, the LAG control structure won't be allocated. If it wasn't allocated it means LAG doesn't exists and can be skipped. Fixes: cac1eb2cf2e3 ("net/mlx5: Lag, properly lock eswitch if needed") Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 897ae4b40e80be7dcbf2b3079d85fa6339a6b751 Author: Parav Pandit Date: Tue Aug 17 15:59:17 2021 +0300 net/mlx5: Fix rdma aux device on devlink reload RDMA auxdev parameter registration was skipped for eswitch manager PCI PF. Due to this when devlink parameter is read, it reads as false in below code flow. $ devlink dev reload pci/0000:06:00.0 devlink_reload() mlx5_load_one() mlx5_attach_device() is_ib_enabled() devlink_param_driverinit_value_get() Due to this, is_ib_enabled() returns false for the RDMA auxiliary device. This results into a skipping RDMA auxiliary device creation on reload. There is no need to check for eswitch manager capability to support RDMA auxiliary device. Hence, fix it by skipping eswitch manager capability. Fixes: 87158cedf00e ("net/mlx5: Support enable_rdma devlink dev param") Signed-off-by: Parav Pandit Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 8343268ec3cf4e097aa8b2071f0cd6779e2c4953 Author: Vlad Buslov Date: Wed Aug 18 14:19:13 2021 +0300 net/mlx5: Bridge, fix uninitialized variable usage In some conditions variable 'err' is not assigned with value in mlx5_esw_bridge_port_obj_attr_set() and mlx5_esw_bridge_port_changeupper() functions after recent changes to support LAG. Initialize the variable with zero value in both cases. Reported-by: Colin King Reported-by: Tim Gardner Reported-by: Naresh Kamboju CC: linux-kernel@vger.kernel.org Fixes: ff9b7521468b ("net/mlx5: Bridge, support LAG") Signed-off-by: Vlad Buslov commit 626bf91a292e2035af5b9d9cce35c5c138dfe06d Merge: 4c00e1e2e58ee 0f77f2defaf68 Author: Linus Torvalds Date: Tue Sep 7 14:02:58 2021 -0700 Merge tag 'net-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes and stragglers from Jakub Kicinski: "Networking stragglers and fixes, including changes from netfilter, wireless and can. Current release - regressions: - qrtr: revert check in qrtr_endpoint_post(), fixes audio and wifi - ip_gre: validate csum_start only on pull - bnxt_en: fix 64-bit doorbell operation on 32-bit kernels - ionic: fix double use of queue-lock, fix a sleeping in atomic - can: c_can: fix null-ptr-deref on ioctl() - cs89x0: disable compile testing on powerpc Current release - new code bugs: - bridge: mcast: fix vlan port router deadlock, consistently disable BH Previous releases - regressions: - dsa: tag_rtl4_a: fix egress tags, only port 0 was working - mptcp: fix possible divide by zero - netfilter: nft_ct: protect nft_ct_pcpu_template_refcnt with mutex - netfilter: socket: icmp6: fix use-after-scope - stmmac: fix MAC not working when system resume back with WoL active Previous releases - always broken: - ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address - seg6: set fc_nlinfo in nh_create_ipv4, nh_create_ipv6 - mptcp: only send extra TCP acks in eligible socket states - dsa: lantiq_gswip: fix maximum frame length - stmmac: fix overall budget calculation for rxtx_napi - bnxt_en: fix firmware version reporting via devlink - renesas: sh_eth: add missing barrier to fix freeing wrong tx descriptor Stragglers: - netfilter: conntrack: switch to siphash - netfilter: refuse insertion if chain has grown too large - ncsi: add get MAC address command to get Intel i210 MAC address" * tag 'net-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (76 commits) ieee802154: Remove redundant initialization of variable ret net: stmmac: fix MAC not working when system resume back with WoL active net: phylink: add suspend/resume support net: renesas: sh_eth: Fix freeing wrong tx descriptor bonding: 3ad: pass parameter bond_params by reference cxgb3: fix oops on module removal can: c_can: fix null-ptr-deref on ioctl() can: rcar_canfd: add __maybe_unused annotation to silence warning net: wwan: iosm: Unify IO accessors used in the driver net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors net: qcom/emac: Replace strlcpy with strscpy ip6_gre: Revert "ip6_gre: add validation for csum_start" net: hns3: make hclgevf_cmd_caps_bit_map0 and hclge_cmd_caps_bit_map0 static selftests/bpf: Test XDP bonding nest and unwind bonding: Fix negative jump label count on nested bonding MAINTAINERS: add VM SOCKETS (AF_VSOCK) entry stmmac: dwmac-loongson:Fix missing return value iwlwifi: fix printk format warnings in uefi.c net: create netdev->dev_addr assignment helpers bnxt_en: Fix possible unintended driver initiated error recovery ... commit 4c00e1e2e58eefb288ba9ef585b6f19e1f33bf1e Merge: 192ad3c27a489 41e73feb10249 Author: Linus Torvalds Date: Tue Sep 7 13:52:46 2021 -0700 Merge tag 'linux-watchdog-5.15-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add Mediatek MT7986 & MT8195 wdt support - add Maxim MAX63xx - drop bd70528 support - rewrite ixp4xx to watchdog framework - constify static struct watchdog_ops for sl28cpld_wdt, mpc8xxx_wdt and tqmx86 - introduce watchdog_dev_suspend/resume - several fixes and improvements * tag 'linux-watchdog-5.15-rc1' of git://www.linux-watchdog.org/linux-watchdog: dt-bindings: watchdog: Add compatible for Mediatek MT7986 watchdog: ixp4xx: Rewrite driver to use core watchdog: Start watchdog in watchdog_set_last_hw_keepalive only if appropriate watchdog: max63xx_wdt: Add device tree probing dt-bindings: watchdog: Add Maxim MAX63xx bindings watchdog: mediatek: mt8195: add wdt support dt-bindings: reset: mt8195: add toprgu reset-controller header file watchdog: tqmx86: Constify static struct watchdog_ops watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops watchdog: sl28cpld_wdt: Constify static struct watchdog_ops watchdog: iTCO_wdt: Fix detection of SMI-off case watchdog: bcm2835_wdt: consider system-power-controller property watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend watchdog: introduce watchdog_dev_suspend/resume watchdog: Fix NULL pointer dereference when releasing cdev watchdog: only run driver set_pretimeout op if device supports it watchdog: bd70528 drop bd70528 support commit 192ad3c27a4895ee4b2fa31c5b54a932f5bb08c1 Merge: a2b28235335fe 109bbba5066b4 Author: Linus Torvalds Date: Tue Sep 7 13:40:51 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM updates from Paolo Bonzini: "ARM: - Page ownership tracking between host EL1 and EL2 - Rely on userspace page tables to create large stage-2 mappings - Fix incompatibility between pKVM and kmemleak - Fix the PMU reset state, and improve the performance of the virtual PMU - Move over to the generic KVM entry code - Address PSCI reset issues w.r.t. save/restore - Preliminary rework for the upcoming pKVM fixed feature - A bunch of MM cleanups - a vGIC fix for timer spurious interrupts - Various cleanups s390: - enable interpretation of specification exceptions - fix a vcpu_idx vs vcpu_id mixup x86: - fast (lockless) page fault support for the new MMU - new MMU now the default - increased maximum allowed VCPU count - allow inhibit IRQs on KVM_RUN while debugging guests - let Hyper-V-enabled guests run with virtualized LAPIC as long as they do not enable the Hyper-V "AutoEOI" feature - fixes and optimizations for the toggling of AMD AVIC (virtualized LAPIC) - tuning for the case when two-dimensional paging (EPT/NPT) is disabled - bugfixes and cleanups, especially with respect to vCPU reset and choosing a paging mode based on CR0/CR4/EFER - support for 5-level page table on AMD processors Generic: - MMU notifier invalidation callbacks do not take mmu_lock unless necessary - improved caching of LRU kvm_memory_slot - support for histogram statistics - add statistics for halt polling and remote TLB flush requests" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (210 commits) KVM: Drop unused kvm_dirty_gfn_invalid() KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted KVM: MMU: mark role_regs and role accessors as maybe unused KVM: MIPS: Remove a "set but not used" variable x86/kvm: Don't enable IRQ when IRQ enabled in kvm_wait KVM: stats: Add VM stat for remote tlb flush requests KVM: Remove unnecessary export of kvm_{inc,dec}_notifier_count() KVM: x86/mmu: Move lpage_disallowed_link further "down" in kvm_mmu_page KVM: x86/mmu: Relocate kvm_mmu_page.tdp_mmu_page for better cache locality Revert "KVM: x86: mmu: Add guest physical address check in translate_gpa()" KVM: x86/mmu: Remove unused field mmio_cached in struct kvm_mmu_page kvm: x86: Increase KVM_SOFT_MAX_VCPUS to 710 kvm: x86: Increase MAX_VCPUS to 1024 kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUS KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation KVM: x86/mmu: Don't freak out if pml5_root is NULL on 4-level host KVM: s390: index kvm->arch.idle_mask by vcpu_idx KVM: s390: Enable specification exception interpretation KVM: arm64: Trim guest debug exception handling KVM: SVM: Add 5-level page table support for SVM ... commit ea47ab111669b187808b3080602788dec26cb9bc Author: Al Viro Date: Tue Sep 7 16:14:05 2021 -0400 putname(): IS_ERR_OR_NULL() is wrong here Mixing NULL and ERR_PTR() just in case is a Bad Idea(tm). For struct filename the former is wrong - failures are reported as ERR_PTR(...), not as NULL. Signed-off-by: Al Viro commit b4a4f213a39d5e55baf38c96042acaeaf927ec74 Author: Stephen Brennan Date: Wed Sep 1 10:51:43 2021 -0700 namei: Standardize callers of filename_create() filename_create() has two variants, one which drops the caller's reference to filename (filename_create) and one which does not (__filename_create). This can be confusing as it's unusual to drop a caller's reference. Remove filename_create, rename __filename_create to filename_create, and convert all callers. Link: https://lore.kernel.org/linux-fsdevel/f6238254-35bd-7e97-5b27-21050c745874@oracle.com/ Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: Stephen Brennan Signed-off-by: Al Viro commit a2b28235335fee2586b4bd16448fb59ed6c80eef Merge: 1735715e0fd7a f97a2103f1a75 Author: Linus Torvalds Date: Tue Sep 7 13:08:08 2021 -0700 Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull dmi fix from Jean Delvare. Unbreak some existing udev/hwdb modalias matches due to misplaced product_sku field. * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: firmware: dmi: Move product_sku info to the end of the modalias commit 794ebcea865bff47231de89269e9d542121ab7be Author: Stephen Brennan Date: Wed Sep 1 10:51:42 2021 -0700 namei: Standardize callers of filename_lookup() filename_lookup() has two variants, one which drops the caller's reference to filename (filename_lookup), and one which does not (__filename_lookup). This can be confusing as it's unusual to drop a caller's reference. Remove filename_lookup, rename __filename_lookup to filename_lookup, and convert all callers. The cost is a few slightly longer functions, but the clarity is greater. [AV: consuming a reference is not at all unusual, actually; look at e.g. do_mkdirat(), for example. It's more that we want non-consuming variant for close relative of that function...] Link: https://lore.kernel.org/linux-fsdevel/YS+dstZ3xfcLxhoB@zeniv-ca.linux.org.uk/ Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: Stephen Brennan Signed-off-by: Al Viro commit 1735715e0fd7a16972402ac98197e6cf30988a45 Merge: 21f577b0f48fd 38de3afffb725 Author: Linus Torvalds Date: Tue Sep 7 13:05:02 2021 -0700 Merge tag 'ntb-5.15' of git://github.com/jonmason/ntb Pull NTB updates from Jon Mason: "Bug fixes and clean-ups for Linux v5.15" * tag 'ntb-5.15' of git://github.com/jonmason/ntb: NTB: switch from 'pci_' to 'dma_' API ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data NTB: perf: Fix an error code in perf_setup_inbuf() NTB: Fix an error code in ntb_msit_probe() ntb: intel: remove invalid email address in header comment commit c5f563f9e9e66c0ad0b23abe25165c124579b70e Author: Al Viro Date: Tue Sep 7 15:57:42 2021 -0400 rename __filename_parentat() to filename_parentat() ... in separate commit, to avoid noise in previous one Signed-off-by: Al Viro commit 21f577b0f48fd3a8871ca4116dad0e9c41ec42b2 Merge: 2d7b4cdbb523c a0a77028c85ad Author: Linus Torvalds Date: Tue Sep 7 12:56:40 2021 -0700 Merge tag 'rproc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc Pull remoteproc updates from Bjorn Andersson: - move the crash recovery worker to the freezable work queue to avoid interaction with other drivers during suspend & resume - fix a couple of typos in comments - add support for handling the audio DSP on SDM660 - fix a race between the Qualcomm wireless subsystem driver and the associated driver for the RF chip * tag 'rproc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: remoteproc: q6v5_pas: Add sdm660 ADSP PIL compatible dt-bindings: remoteproc: qcom: adsp: Add SDM660 ADSP remoteproc: use freezable workqueue for crash notifications remoteproc: fix kernel doc for struct rproc_ops remoteproc: fix an typo in fw_elf_get_class code comments remoteproc: qcom: wcnss: Fix race with iris probe commit 0766ec82e5fb26fc5dc6d592bc61865608bdc651 Author: Stephen Brennan Date: Wed Sep 1 10:51:41 2021 -0700 namei: Fix use after free in kern_path_locked In 0ee50b47532a ("namei: change filename_parentat() calling conventions"), filename_parentat() was made to always call putname() on the filename before returning, and kern_path_locked() was migrated to this calling convention. However, kern_path_locked() uses the "last" parameter to lookup and potentially create a new dentry. The last parameter contains the last component of the path and points within the filename, which was recently freed at the end of filename_parentat(). Thus, when kern_path_locked() calls __lookup_hash(), it is using the filename after it has already been freed. In other words, these calling conventions had been wrong for the only remaining caller of filename_parentat(). Everything else is using __filename_parentat(), which does not drop the reference; so should kern_path_locked(). Switch kern_path_locked() to use of __filename_parentat() and move getting/dropping struct filename into wrapper. Remove filename_parentat(), now that we have no remaining callers. Fixes: 0ee50b47532a ("namei: change filename_parentat() calling conventions") Link: https://lore.kernel.org/linux-fsdevel/YS9D4AlEsaCxLFV0@infradead.org/ Link: https://lore.kernel.org/linux-fsdevel/YS+csMTV2tTXKg3s@zeniv-ca.linux.org.uk/ Cc: Christoph Hellwig Cc: Al Viro Reported-by: syzbot+fb0d60a179096e8c2731@syzkaller.appspotmail.com Signed-off-by: Stephen Brennan Co-authored-by: Dmitry Kadashev Signed-off-by: Al Viro commit 2d7b4cdbb523cd11a978519f8e11895c27f05258 Merge: 86406a9e73334 79fad92f2e596 Author: Linus Torvalds Date: Tue Sep 7 12:50:01 2021 -0700 Merge tag 'backlight-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Fix-ups: - Improve bootloader/kernel device handover Bug Fixes: - Stabilise backlight in ktd253 driver" * tag 'backlight-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: pwm_bl: Improve bootloader/kernel device handover backlight: ktd253: Stabilize backlight commit 86406a9e733347f877a2bd5269ce7429d3748c6a Merge: 5e6a5845dd651 cdff1eda69326 Author: Linus Torvalds Date: Tue Sep 7 12:38:59 2021 -0700 Merge tag 'mfd-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Add support for registering devices via MFD cells to Simple MFD (I2C) New Drivers: - Add support for Renesas Synchronization Management Unit (SMU) New Device Support: - Add support for N5010 to Intel M10 BMC - Add support for Cannon Lake to Intel LPSS ACPI - Add support for Samsung SSG{1,2} to ST-Ericsson's U8500 family - Add support for TQMx110EB and TQMxE40x to TQ-Systems PLD TQMx86 New Functionality: - Add support for GPIO to Intel LPC ICH - Add support for Reset to Texas Instruments TPS65086 Fix-ups: - Trivial, sorting, whitespace, renaming, etc; mt6360-core, db8500-prcmu-regs, tqmx86 - Device Tree fiddling; syscon, axp20x, qcom,pm8008, ti,tps65086, brcm,cru - Use proper APIs for IRQ map resolution; ab8500-core, stmpe, tc3589x, wm8994-irq - Pass 'supplied-from' property through axp288_fuel_gauge via swnode - Remove unused file entry; MAINTAINERS - Make interrupt line optional; tps65086 - Rename db8500-cpuidle driver symbol; db8500-prcmu - Remove support for unused hardware; tqmx86 - Provide a standard LPC clock frequency for unknown boards; tqmx86 - Remove unused code; ti_am335x_tscadc - Use of_iomap() instead of ioremap(); syscon Bug Fixes: - Clear GPIO IRQ resource flags when no IRQ is set; tqmx86 - Fix incorrect/misleading frequencies; db8500-prcmu - Mitigate namespace clash with other GPIOBASE users" * tag 'mfd-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (31 commits) mfd: lpc_sch: Rename GPIOBASE to prevent build error mfd: syscon: Use of_iomap() instead of ioremap() dt-bindings: mfd: Add Broadcom CRU mfd: ti_am335x_tscadc: Delete superfluous error message mfd: tqmx86: Assume 24MHz LPC clock for unknown boards mfd: tqmx86: Add support for TQ-Systems DMI IDs mfd: tqmx86: Add support for TQMx110EB and TQMxE40x mfd: tqmx86: Fix typo in "platform" mfd: tqmx86: Remove incorrect TQMx90UC board ID mfd: tqmx86: Clear GPIO IRQ resource when no IRQ is set mfd: simple-mfd-i2c: Add support for registering devices via MFD cells mfd/cpuidle: ux500: Rename driver symbol mfd: tps65086: Add cell entry for reset driver mfd: tps65086: Make interrupt line optional dt-bindings: mfd: Convert tps65086.txt to YAML MAINTAINERS: Adjust ARM/NOMADIK/Ux500 ARCHITECTURES to file renaming mfd: db8500-prcmu: Handle missing FW variant mfd: db8500-prcmu: Rename register header mfd: axp20x: Add supplied-from property to axp288_fuel_gauge cell mfd: Don't use irq_create_mapping() to resolve a mapping ... commit 5e6a5845dd651b00754a62edec2f0a439182024d Merge: 75b96f0ec5faf 889a1b3f35db6 Author: Linus Torvalds Date: Tue Sep 7 12:27:27 2021 -0700 Merge tag 'gpio-updates-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We mostly have various improvements and refactoring all over the place but also some interesting new features - like the virtio GPIO driver that allows guest VMs to use host's GPIOs. We also have a new/old GPIO driver for rockchip - this one has been split out of the pinctrl driver. Summary: - new driver: gpio-virtio allowing a guest VM running linux to access GPIO lines provided by the host - split the GPIO driver out of the rockchip pin control driver - add support for a new model to gpio-aspeed-sgpio, refactor the driver and use generic device property interfaces, improve property sanitization - add ACPI support to gpio-tegra186 - improve the code setting the line names to support multiple GPIO banks per device - constify a bunch of OF functions in the core GPIO code and make the declaration for one of the core OF functions we use consistent within its header - use software nodes in intel_quark_i2c_gpio - add support for the gpio-line-names property in gpio-mt7621 - use the standard GPIO function for setting the GPIO names in gpio-brcmstb - fix a bunch of leaks and other bugs in gpio-mpc8xxx - use generic pm callbacks in gpio-ml-ioh - improve resource management and PM handling in gpio-mlxbf2 - modernize and improve the gpio-dwapb driver - coding style improvements in gpio-rcar - documentation fixes and improvements - update the MAINTAINERS entry for gpio-zynq - minor tweaks in several drivers" * tag 'gpio-updates-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (35 commits) gpio: mpc8xxx: Use 'devm_gpiochip_add_data()' to simplify the code and avoid a leak gpio: mpc8xxx: Fix a potential double iounmap call in 'mpc8xxx_probe()' gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()' gpio: viperboard: remove platform_set_drvdata() call in probe gpio: virtio: Add missing mailings lists in MAINTAINERS entry gpio: virtio: Fix sparse warnings gpio: remove the obsolete MX35 3DS BOARD MC9S08DZ60 GPIO functions gpio: max730x: Use the right include gpio: Add virtio-gpio driver gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() helper macro gpio: mlxbf2: Use devm_platform_ioremap_resource() gpio: mlxbf2: Drop wrong use of ACPI_PTR() gpio: mlxbf2: Convert to device PM ops gpio: dwapb: Get rid of legacy platform data mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes gpio: dwapb: Read GPIO base from gpio-base property gpio: dwapb: Unify ACPI enumeration checks in get_irq() and configure_irqs() gpiolib: Deduplicate forward declaration in the consumer.h header MAINTAINERS: update gpio-zynq.yaml reference gpio: tegra186: Add ACPI support ... commit 4a9344cd0aa4499beb3772bbecb40bb78888c0e1 Author: Prasad Sodagudi Date: Tue Sep 7 04:24:23 2021 -0700 PM: sleep: core: Avoid setting power.must_resume to false There are variables(power.may_skip_resume and dev->power.must_resume) and DPM_FLAG_MAY_SKIP_RESUME flags to control the resume of devices after a system wide suspend transition. Setting the DPM_FLAG_MAY_SKIP_RESUME flag means that the driver allows its "noirq" and "early" resume callbacks to be skipped if the device can be left in suspend after a system-wide transition into the working state. PM core determines that the driver's "noirq" and "early" resume callbacks should be skipped or not with dev_pm_skip_resume() function by checking power.may_skip_resume variable. power.must_resume variable is getting set to false in __device_suspend() function without checking device's DPM_FLAG_MAY_SKIP_RESUME settings. In problematic scenario, where all the devices in the suspend_late stage are successful and some device can fail to suspend in suspend_noirq phase. So some devices successfully suspended in suspend_late stage are not getting chance to execute __device_suspend_noirq() to set dev->power.must_resume variable to true and not getting resumed in early_resume phase. Add a check for device's DPM_FLAG_MAY_SKIP_RESUME flag before setting power.must_resume variable in __device_suspend function. Fixes: 6e176bf8d461 ("PM: sleep: core: Do not skip callbacks in the resume phase") Signed-off-by: Prasad Sodagudi Signed-off-by: Rafael J. Wysocki commit 75b96f0ec5faf730128c32187e3e28441c27a094 Merge: 996fe06160998 a9667ac88e2b2 Author: Linus Torvalds Date: Tue Sep 7 12:18:29 2021 -0700 Merge tag 'fuse-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse updates from Miklos Szeredi: - Allow mounting an active fuse device. Previously the fuse device would always be mounted during initialization, and sharing a fuse superblock was only possible through mount or namespace cloning - Fix data flushing in syncfs (virtiofs only) - Fix data flushing in copy_file_range() - Fix a possible deadlock in atomic O_TRUNC - Misc fixes and cleanups * tag 'fuse-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: remove unused arg in fuse_write_file_get() fuse: wait for writepages in syncfs fuse: flush extending writes fuse: truncate pagecache on atomic_o_trunc fuse: allow sharing existing sb fuse: move fget() to fuse_get_tree() fuse: move option checking into fuse_fill_super() fuse: name fs_context consistently fuse: fix use after free in fuse_read_interrupt() commit d62aab8ff711dc3a4c07684ea33042347f79b630 Author: Lukasz Luba Date: Mon Sep 6 09:44:53 2021 +0100 Documentation: power: include kernel-doc in Energy Model doc Improve the existing documentation of the Energy Model and add kernel-doc comments. This extends an API description and helps better understanding the usage. Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit ca67408ad57a5a67ad6801d792c40c010451bdef Author: Lukasz Luba Date: Mon Sep 6 09:44:52 2021 +0100 PM: EM: fix kernel-doc comments Fix the kernel-doc comments for the improved Energy Model documentation. Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit 46573fd6369f098f15e11768850b6430f374905f Author: Rafael J. Wysocki Date: Sat Sep 4 15:53:39 2021 +0200 cpufreq: intel_pstate: hybrid: Rework HWP calibration The current HWP calibration for hybrid processors in intel_pstate is fragile, because it depends too much on the information provided by the platform firmware via CPPC which may not be reliable enough. It also need not be so complicated. In order to improve that mechanism and make it more resistant to platform firmware issues, make it only use the CPPC nominal_perf values to compute the HWP-to-frequency scaling factors for all CPUs and possibly use the HWP_CAP highest_perf values to recompute them if the ones derived from the CPPC nominal_perf values alone appear to be too high. Namely, fetch CPC.nominal_perf for all CPUs present in the system, find the minimum one and use it as a reference for computing all of the CPUs' scaling factors (using the observation that for the CPUs having the minimum CPC.nominal_perf the HWP range of available performance levels should be the same as the range of available "legacy" P-states and so the HWP-to-frequency scaling factor for them should be the same as the corresponding scaling factor used for representing the P-state values in kHz). Signed-off-by: Rafael J. Wysocki Tested-by: Zhang Rui commit 0654cf05d17bc4d296a53a8bc7d107bc8a795f2e Author: Rafael J. Wysocki Date: Sat Sep 4 15:51:45 2021 +0200 ACPI: CPPC: Introduce cppc_get_nominal_perf() On some systems the nominal_perf value retrieved via CPPC is just a constant and fetching it doesn't require accessing any registers, so if it is the only CPPC capability that's needed, it is wasteful to run cppc_get_perf_caps() in order to get just that value alone, especially when this is done for CPUs other than the one running the code. For this reason, introduce cppc_get_nominal_perf() allowing nominal_perf to be obtained individually, by generalizing the existing cppc_get_desired_perf() (and renaming it) so it can be used to retrieve any specific CPPC capability value. While at it, clean up the cppc_get_desired_perf() kerneldoc comment a bit. Signed-off-by: Rafael J. Wysocki commit 66e0aeaa8bae6d464f7bcd2767c10c8c84658362 Author: Kari Argillander Date: Sat Sep 4 00:06:33 2021 +0300 ACPI: scan: Remove unneeded header linux/nls.h Code that use linux/nls.h was moved to device_sysfs.c by commit c2efefb33abf ("ACPI / scan: Move sysfs-related device code to a separate file") Remove this include so that complier has easier times and it would be easier to grep where nls code is used. Signed-off-by: Kari Argillander Signed-off-by: Rafael J. Wysocki commit d216bfb4d7984a510e984d2c94ae6d2251d76aee Author: Sergey Shtylyov Date: Thu Sep 2 23:57:29 2021 +0300 PM: sleep: wakeirq: drop useless parameter from dev_pm_attach_wake_irq() This function has the 'irq' parameter which isn't ever used, so drop it. Signed-off-by: Sergey Shtylyov [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 996fe06160998a38ff07189feb3ec8ab8f68fd4e Merge: 0bcfe68b87674 f8416aa291854 Author: Linus Torvalds Date: Tue Sep 7 12:08:04 2021 -0700 Merge tag 'kgdb-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb updates from Daniel Thompson: "Changes for kgdb/kdb this cycle are dominated by a change from Sumit that removes as small (256K) private heap from kdb. This is change I've hoped for ever since I discovered how few users of this heap remained in the kernel, so many thanks to Sumit for hunting these down. The other change is an incremental step towards SPDX headers" * tag 'kgdb-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kernel: debug: Convert to SPDX identifier kdb: Rename members of struct kdbtab_t kdb: Simplify kdb_defcmd macro logic kdb: Get rid of redundant kdb_register_flags() kdb: Rename struct defcmd_set to struct kdb_macro kdb: Get rid of custom debug heap allocator commit 2b922a9d064f8e86b53b04f5819917b7a04142ed Author: Dan Williams Date: Fri Sep 3 19:21:06 2021 -0700 cxl/registers: Fix Documentation warning Commit 0f06157e0135 ("cxl/core: Move register mapping infrastructure") neglected to add a DOC header for the new drivers/core/regs.c file. Reported-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163072206675.2250120.3527179192933919995.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit a01da6ca7d0ad66b6fa2dc4af0fc97ca8ba28b45 Author: Dan Williams Date: Fri Sep 3 19:21:01 2021 -0700 cxl/pmem: Fix Documentation warning Commit 06737cd0d216 ("cxl/core: Move pmem functionality") neglected to add a DOC header for the new drivers/cxl/core/pmem.c file. Reported-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163072206163.2250120.11486436976516079516.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 9d1b3afd73047d4dd30e3636412c9f9b5def2b14 Author: Ben Widawsky Date: Fri Sep 3 19:20:56 2021 -0700 cxl/uapi: Fix defined but not used warnings Fix unused-const-variable warnings emitted by gcc when cxlmem.h is used by pretty much all files except pci.c Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163072205652.2250120.16833548560832424468.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit da582aa5ad5787c46e3f475ab3f4602ec84c1617 Author: Li Qiang (Johnny Li) Date: Fri Sep 3 19:20:50 2021 -0700 cxl/pci: Fix debug message in cxl_probe_regs() Indicator string for mbox and memdev register set to status incorrectly in error message. Cc: Fixes: 30af97296f48 ("cxl/pci: Map registers based on capabilities") Signed-off-by: Li Qiang (Johnny Li) Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163072205089.2250120.8103605864156687395.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 9e56614c44b994b78fc9fcb2070bcbe3f5df0d7b Author: Dan Williams Date: Fri Sep 3 19:20:45 2021 -0700 cxl/pci: Fix lockdown level A proposed rework of security_locked_down() users identified that the cxl_pci driver was passing the wrong lockdown_reason. Update cxl_mem_raw_command_allowed() to fail raw command access when raw pci access is also disabled. Fixes: 13237183c735 ("cxl/mem: Add a "RAW" send command") Cc: Ben Widawsky Cc: Jonathan Cameron Cc: Cc: Ondrej Mosnacek Cc: Paul Moore Link: https://lore.kernel.org/r/163072204525.2250120.16615792476976546735.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit a7bfaad54b8b9cf06041528988d6b75b4b921546 Author: Alison Schofield Date: Fri Sep 3 19:20:39 2021 -0700 cxl/acpi: Do not add DSDT disabled ACPI0016 host bridge ports During CXL ACPI probe, host bridge ports are discovered by scanning the ACPI0017 root port for ACPI0016 host bridge devices. The scan matches on the hardware id of "ACPI0016". An issue occurs when an ACPI0016 device is defined in the DSDT yet disabled on the platform. Attempts by the cxl_acpi driver to add host bridge ports using a disabled device fails, and the entire cxl_acpi probe fails. The DSDT table includes an _STA method that sets the status and the ACPI subsystem has checks available to examine it. One such check is in the acpi_pci_find_root() path. Move the call to acpi_pci_find_root() to the matching function to prevent this issue when adding either upstream or downstream ports. Suggested-by: Dan Williams Signed-off-by: Alison Schofield Fixes: 7d4b5ca2e2cb ("cxl/acpi: Add downstream port data to cxl_port instances") Cc: Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163072203957.2250120.2178685721061002124.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 0bcfe68b876748762557797a940d0a82de700629 Author: Linus Torvalds Date: Tue Sep 7 11:26:23 2021 -0700 Revert "memcg: enable accounting for pollfd and select bits arrays" This reverts commit b655843444152c0a14b749308e4cb35d91cbcf0b. Just like with the memcg lock accounting, the kernel test robot reports a sizeable performance regression for this commit, and while it clearly does the rigth thing in theory, we'll need to look at just how to avoid or minimize the performance overhead of the memcg accounting. People already have suggestions on how to do that, but it's "future work". So revert it for now. [ Note: the first link below is for this same commit but a different commit ID, because it's the kernel test robot ended up noticing it in Andrew Morton's patch queue ] Link: https://lore.kernel.org/lkml/20210905132732.GC15026@xsang-OptiPlex-9020/ Link: https://lore.kernel.org/lkml/20210907150757.GE17617@xsang-OptiPlex-9020/ Acked-by: Jens Axboe Acked-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Tejun Heo Signed-off-by: Linus Torvalds commit 3754707bcc3e190e5dadc978d172b61e809cb3bd Author: Linus Torvalds Date: Tue Sep 7 11:21:48 2021 -0700 Revert "memcg: enable accounting for file lock caches" This reverts commit 0f12156dff2862ac54235fc72703f18770769042. The kernel test robot reports a sizeable performance regression for this commit, and while it clearly does the rigth thing in theory, we'll need to look at just how to avoid or minimize the performance overhead of the memcg accounting. People already have suggestions on how to do that, but it's "future work". So revert it for now. Link: https://lore.kernel.org/lkml/20210907150757.GE17617@xsang-OptiPlex-9020/ Acked-by: Jens Axboe Acked-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Tejun Heo Signed-off-by: Linus Torvalds commit cd1adf1b63a112d762832e9c64b0a886fbb840d6 Author: Linus Torvalds Date: Tue Sep 7 11:03:45 2021 -0700 Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly" This reverts commit 9857a17f206ff374aea78bccfb687f145368be2e. That commit was completely broken, and I should have caught on to it earlier. But happily, the kernel test robot noticed the breakage fairly quickly. The breakage is because "try_get_page()" is about avoiding the page reference count overflow case, but is otherwise the exact same as a plain "get_page()". In contrast, "try_get_compound_head()" is an entirely different beast, and uses __page_cache_add_speculative() because it's not just about the page reference count, but also about possibly racing with the underlying page going away. So all the commentary about how "try_get_page() has fallen a little behind in terms of maintenance, try_get_compound_head() handles speculative page references more thoroughly" was just completely wrong: yes, try_get_compound_head() handles speculative page references, but the point is that try_get_page() does not, and must not. So there's no lack of maintainance - there are fundamentally different semantics. A speculative page reference would be entirely wrong in "get_page()", and it's entirely wrong in "try_get_page()". It's not about speculation, it's purely about "uhhuh, you can't get this page because you've tried to increment the reference count too much already". The reason the kernel test robot noticed this bug was that it hit the VM_BUG_ON() in __page_cache_add_speculative(), which is all about verifying that the context of any speculative page access is correct. But since that isn't what try_get_page() is all about, the VM_BUG_ON() tests things that are not correct to test for try_get_page(). Reported-by: kernel test robot Cc: John Hubbard Cc: Christoph Hellwig Cc: Andrew Morton Signed-off-by: Linus Torvalds commit 3a029e1f3d6e2ee809e85abecce619a48016bd4b Author: Jean-Philippe Brucker Date: Mon Sep 6 17:36:38 2021 +0100 selftests/bpf: Fix build of task_pt_regs test for arm64 struct pt_regs is not exported to userspace on all archs. arm64 and s390 export "user_pt_regs" instead, which causes build failure at the moment: progs/test_task_pt_regs.c:8:16: error: variable has incomplete type 'struct pt_regs' struct pt_regs current_regs = {}; Instead of using pt_regs from ptrace.h, use the larger kernel struct from vmlinux.h directly. Since the test runner task_pt_regs.c does not have access to the kernel struct definition, copy it into a char array. Fixes: 576d47bb1a92 ("bpf: selftests: Add bpf_task_pt_regs() selftest") Suggested-by: Andrii Nakryiko Signed-off-by: Jean-Philippe Brucker Signed-off-by: Daniel Borkmann Tested-by: Ilya Leoshkevich Acked-by: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/20210906163635.302307-1-jean-philippe@linaro.org commit 0dca4462ed0681649fdcd5700a6ddfbaa65fa178 Author: Christoph Hellwig Date: Tue Sep 7 16:13:03 2021 +0200 block: move fs/block_dev.c to block/bdev.c Move it together with the rest of the block layer. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210907141303.1371844-3-hch@lst.de Signed-off-by: Jens Axboe commit cd82cca7ebfe9c6c74a8e5b28382ba88177ba5f1 Author: Christoph Hellwig Date: Tue Sep 7 16:13:02 2021 +0200 block: split out operations on block special files Add a new block/fops.c for all the file and address_space operations that provide the block special file support. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210907141303.1371844-2-hch@lst.de [axboe: correct trailing whitespace while at it] Signed-off-by: Jens Axboe commit 49d82b1445f13b2754aacc38d73d0cf1b515456c Merge: 884f0e84f1e31 aff959c284085 Author: Jens Axboe Date: Tue Sep 7 08:37:19 2021 -0600 Merge tag 'nvme-5.15-2021-09-07' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.15 - fix nvmet command set reporting for passthrough controllers (Adam Manzanares) - updated - update a MAINTAINERS email address (Chaitanya Kulkarni) - set QUEUE_FLAG_NOWAIT for nvme-multipth (me) - handle errors from add_disk() (Luis Chamberlain) - update the keep alive interval when kato is modified (Tatsuya Sasaki) - fix a buffer overrun in nvmet_subsys_attr_serial (Hannes Reinecke) - do not reset transport on data digest errors in nvme-tcp (Daniel Wagner) - only call synchronize_srcu when clearing current path (Daniel Wagner) - revalidate paths during rescan (Hannes Reinecke)" * tag 'nvme-5.15-2021-09-07' of git://git.infradead.org/nvme: nvme: update MAINTAINERS email address nvme: add error handling support for add_disk() nvme: only call synchronize_srcu when clearing current path nvme: update keep alive interval when kato is modified nvme-tcp: Do not reset transport on data digest errors nvmet: fixup buffer overrun in nvmet_subsys_attr_serial() nvmet: return bool from nvmet_passthru_ctrl and nvmet_is_passthru_req nvmet: looks at the passthrough controller when initializing CAP nvme: move nvme_multi_css into nvme.h nvme-multipath: revalidate paths during rescan nvme-multipath: set QUEUE_FLAG_NOWAIT commit 884f0e84f1e3195b801319c8ec3d5774e9bf2710 Author: Li Jinlin Date: Tue Sep 7 20:12:42 2021 +0800 blk-throttle: fix UAF by deleteing timer in blk_throtl_exit() The pending timer has been set up in blk_throtl_init(). However, the timer is not deleted in blk_throtl_exit(). This means that the timer handler may still be running after freeing the timer, which would result in a use-after-free. Fix by calling del_timer_sync() to delete the timer in blk_throtl_exit(). Signed-off-by: Li Jinlin Link: https://lore.kernel.org/r/20210907121242.2885564-1-lijinlin3@huawei.com Signed-off-by: Jens Axboe commit dfbb3409b27fa42b96f5727a80d3ceb6a8663991 Author: Tetsuo Handa Date: Tue Sep 7 20:52:13 2021 +0900 block: genhd: don't call blkdev_show() with major_names_lock held If CONFIG_BLK_DEV_LOOP && CONFIG_MTD (at least; there might be other combinations), lockdep complains circular locking dependency at __loop_clr_fd(), for major_names_lock serves as a locking dependency aggregating hub across multiple block modules. ====================================================== WARNING: possible circular locking dependency detected 5.14.0+ #757 Tainted: G E ------------------------------------------------------ systemd-udevd/7568 is trying to acquire lock: ffff88800f334d48 ((wq_completion)loop0){+.+.}-{0:0}, at: flush_workqueue+0x70/0x560 but task is already holding lock: ffff888014a7d4a0 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x4d/0x400 [loop] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (&lo->lo_mutex){+.+.}-{3:3}: lock_acquire+0xbe/0x1f0 __mutex_lock_common+0xb6/0xe10 mutex_lock_killable_nested+0x17/0x20 lo_open+0x23/0x50 [loop] blkdev_get_by_dev+0x199/0x540 blkdev_open+0x58/0x90 do_dentry_open+0x144/0x3a0 path_openat+0xa57/0xda0 do_filp_open+0x9f/0x140 do_sys_openat2+0x71/0x150 __x64_sys_openat+0x78/0xa0 do_syscall_64+0x3d/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #5 (&disk->open_mutex){+.+.}-{3:3}: lock_acquire+0xbe/0x1f0 __mutex_lock_common+0xb6/0xe10 mutex_lock_nested+0x17/0x20 bd_register_pending_holders+0x20/0x100 device_add_disk+0x1ae/0x390 loop_add+0x29c/0x2d0 [loop] blk_request_module+0x5a/0xb0 blkdev_get_no_open+0x27/0xa0 blkdev_get_by_dev+0x5f/0x540 blkdev_open+0x58/0x90 do_dentry_open+0x144/0x3a0 path_openat+0xa57/0xda0 do_filp_open+0x9f/0x140 do_sys_openat2+0x71/0x150 __x64_sys_openat+0x78/0xa0 do_syscall_64+0x3d/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #4 (major_names_lock){+.+.}-{3:3}: lock_acquire+0xbe/0x1f0 __mutex_lock_common+0xb6/0xe10 mutex_lock_nested+0x17/0x20 blkdev_show+0x19/0x80 devinfo_show+0x52/0x60 seq_read_iter+0x2d5/0x3e0 proc_reg_read_iter+0x41/0x80 vfs_read+0x2ac/0x330 ksys_read+0x6b/0xd0 do_syscall_64+0x3d/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #3 (&p->lock){+.+.}-{3:3}: lock_acquire+0xbe/0x1f0 __mutex_lock_common+0xb6/0xe10 mutex_lock_nested+0x17/0x20 seq_read_iter+0x37/0x3e0 generic_file_splice_read+0xf3/0x170 splice_direct_to_actor+0x14e/0x350 do_splice_direct+0x84/0xd0 do_sendfile+0x263/0x430 __se_sys_sendfile64+0x96/0xc0 do_syscall_64+0x3d/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #2 (sb_writers#3){.+.+}-{0:0}: lock_acquire+0xbe/0x1f0 lo_write_bvec+0x96/0x280 [loop] loop_process_work+0xa68/0xc10 [loop] process_one_work+0x293/0x480 worker_thread+0x23d/0x4b0 kthread+0x163/0x180 ret_from_fork+0x1f/0x30 -> #1 ((work_completion)(&lo->rootcg_work)){+.+.}-{0:0}: lock_acquire+0xbe/0x1f0 process_one_work+0x280/0x480 worker_thread+0x23d/0x4b0 kthread+0x163/0x180 ret_from_fork+0x1f/0x30 -> #0 ((wq_completion)loop0){+.+.}-{0:0}: validate_chain+0x1f0d/0x33e0 __lock_acquire+0x92d/0x1030 lock_acquire+0xbe/0x1f0 flush_workqueue+0x8c/0x560 drain_workqueue+0x80/0x140 destroy_workqueue+0x47/0x4f0 __loop_clr_fd+0xb4/0x400 [loop] blkdev_put+0x14a/0x1d0 blkdev_close+0x1c/0x20 __fput+0xfd/0x220 task_work_run+0x69/0xc0 exit_to_user_mode_prepare+0x1ce/0x1f0 syscall_exit_to_user_mode+0x26/0x60 do_syscall_64+0x4c/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: (wq_completion)loop0 --> &disk->open_mutex --> &lo->lo_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&lo->lo_mutex); lock(&disk->open_mutex); lock(&lo->lo_mutex); lock((wq_completion)loop0); *** DEADLOCK *** 2 locks held by systemd-udevd/7568: #0: ffff888012554128 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0x4c/0x1d0 #1: ffff888014a7d4a0 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x4d/0x400 [loop] stack backtrace: CPU: 0 PID: 7568 Comm: systemd-udevd Tainted: G E 5.14.0+ #757 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 02/27/2020 Call Trace: dump_stack_lvl+0x79/0xbf print_circular_bug+0x5d6/0x5e0 ? stack_trace_save+0x42/0x60 ? save_trace+0x3d/0x2d0 check_noncircular+0x10b/0x120 validate_chain+0x1f0d/0x33e0 ? __lock_acquire+0x953/0x1030 ? __lock_acquire+0x953/0x1030 __lock_acquire+0x92d/0x1030 ? flush_workqueue+0x70/0x560 lock_acquire+0xbe/0x1f0 ? flush_workqueue+0x70/0x560 flush_workqueue+0x8c/0x560 ? flush_workqueue+0x70/0x560 ? sched_clock_cpu+0xe/0x1a0 ? drain_workqueue+0x41/0x140 drain_workqueue+0x80/0x140 destroy_workqueue+0x47/0x4f0 ? blk_mq_freeze_queue_wait+0xac/0xd0 __loop_clr_fd+0xb4/0x400 [loop] ? __mutex_unlock_slowpath+0x35/0x230 blkdev_put+0x14a/0x1d0 blkdev_close+0x1c/0x20 __fput+0xfd/0x220 task_work_run+0x69/0xc0 exit_to_user_mode_prepare+0x1ce/0x1f0 syscall_exit_to_user_mode+0x26/0x60 do_syscall_64+0x4c/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f0fd4c661f7 Code: 00 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 13 fc ff ff RSP: 002b:00007ffd1c9e9fd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 00007f0fd46be6c8 RCX: 00007f0fd4c661f7 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 0000000000000006 R08: 000055fff1eaf400 R09: 0000000000000000 R10: 00007f0fd46be6c8 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000002f08 R15: 00007ffd1c9ea050 Commit 1c500ad706383f1a ("loop: reduce the loop_ctl_mutex scope") is for breaking "loop_ctl_mutex => &lo->lo_mutex" dependency chain. But enabling a different block module results in forming circular locking dependency due to shared major_names_lock mutex. The simplest fix is to call probe function without holding major_names_lock [1], but Christoph Hellwig does not like such idea. Therefore, instead of holding major_names_lock in blkdev_show(), introduce a different lock for blkdev_show() in order to break "sb_writers#$N => &p->lock => major_names_lock" dependency chain. Link: https://lkml.kernel.org/r/b2af8a5b-3c1b-204e-7f56-bea0b15848d6@i-love.sakura.ne.jp [1] Signed-off-by: Tetsuo Handa Link: https://lore.kernel.org/r/18a02da2-0bf3-550e-b071-2b4ab13c49f0@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 27de8d597020755b6bdeca7036463ca6d0b4c295 Merge: dd7c46d6e58e8 4855e26bcf4d2 Author: Rafael J. Wysocki Date: Tue Sep 7 15:42:10 2021 +0200 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull more ARM cpufreq changes for v5.15-rc1 from Viresh Kumar: "This adds a new cpufreq driver for Mediatek, which had been going through reviews since last one year." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: mediatek-hw: Add support for CPUFREQ HW cpufreq: Add of_perf_domain_get_sharing_cpumask dt-bindings: cpufreq: add bindings for MediaTek cpufreq HW commit dd7c46d6e58e8737b0ac3ba21e8584c2632dba65 Author: Rafael J. Wysocki Date: Tue Sep 7 15:32:48 2021 +0200 Revert "cpufreq: intel_pstate: Process HWP Guaranteed change notification" Revert commit d0e936adbd22 ("cpufreq: intel_pstate: Process HWP Guaranteed change notification"), because it causes a NULL pointer dereference to occur on Lenovo X1 gen9 laptops due to an HWP guaranteed performance change interrupt arriving prematurely. This feature will be revisited in the next cycle. Reported-by: Jens Axboe Signed-off-by: Rafael J. Wysocki commit 0f77f2defaf682eb7e7ef623168e49c74ae529e3 Author: Colin Ian King Date: Tue Sep 7 11:28:14 2021 +0100 ieee802154: Remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit d1bf73387b5adbc12c6a59c1fbaa69e05ee265ed Merge: 0341d5e3d1ee2 90702dcd19c09 Author: David S. Miller Date: Tue Sep 7 14:04:59 2021 +0100 Merge branch 'stmmac-wol-fix' Joakim Zhang says: ==================== net: stmmac: fix WoL issue This patch set fixes stmmac not working after system resume back with WoL active. Thanks a lot for Russell King keeps looking into this issue. ==================== Signed-off-by: David S. Miller commit 90702dcd19c093621b422ba16fcfd870afe2552f Author: Joakim Zhang Date: Tue Sep 7 18:56:47 2021 +0800 net: stmmac: fix MAC not working when system resume back with WoL active We can reproduce this issue with below steps: 1) enable WoL on the host 2) host system suspended 3) remote client send out wakeup packets We can see that host system resume back, but can't work, such as ping failed. After a bit digging, this issue is introduced by the commit 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()"), which use the finalised link parameters in mac_link_up() rather than the parameters in mac_config(). There are two scenarios for MAC suspend/resume in STMMAC driver: 1) MAC suspend with WoL inactive, stmmac_suspend() call phylink_mac_change() to notify phylink machine that a change in MAC state, then .mac_link_down callback would be invoked. Further, it will call phylink_stop() to stop the phylink instance. When MAC resume back, firstly phylink_start() is called to start the phylink instance, then call phylink_mac_change() which will finally trigger phylink machine to invoke .mac_config and .mac_link_up callback. All is fine since configuration in these two callbacks will be initialized, that means MAC can restore the state. 2) MAC suspend with WoL active, phylink_mac_change() will put link down, but there is no phylink_stop() to stop the phylink instance, so it will link up again, that means .mac_config and .mac_link_up would be invoked before system suspended. After system resume back, it will do DMA initialization and SW reset which let MAC lost the hardware setting (i.e MAC_Configuration register(offset 0x0) is reset). Since link is up before system suspended, so .mac_link_up would not be invoked after system resume back, lead to there is no chance to initialize the configuration in .mac_link_up callback, as a result, MAC can't work any longer. After discussed with Russell King [1], we confirm that phylink framework have not take WoL into consideration yet. This patch calls phylink_suspend()/phylink_resume() functions which is newly introduced by Russell King to fix this issue. [1] https://lore.kernel.org/netdev/20210901090228.11308-1-qiangqing.zhang@nxp.com/ Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()") Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit f97493657c6372eeefe70faadd214bf31488c44e Author: Russell King (Oracle) Date: Tue Sep 7 18:56:46 2021 +0800 net: phylink: add suspend/resume support Joakim Zhang reports that Wake-on-Lan with the stmmac ethernet driver broke when moving the incorrect handling of mac link state out of mac_config(). This reason this breaks is because the stmmac's WoL is handled by the MAC rather than the PHY, and phylink doesn't cater for that scenario. This patch adds the necessary phylink code to handle suspend/resume events according to whether the MAC still needs a valid link or not. This is the barest minimum for this support. Reported-by: Joakim Zhang Tested-by: Joakim Zhang Signed-off-by: Russell King (Oracle) Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 0341d5e3d1ee2a36dd5a49b5bef2ce4ad1cfa6b4 Author: Yoshihiro Shimoda Date: Tue Sep 7 20:29:40 2021 +0900 net: renesas: sh_eth: Fix freeing wrong tx descriptor The cur_tx counter must be incremented after TACT bit of txdesc->status was set. However, a CPU is possible to reorder instructions and/or memory accesses between cur_tx and txdesc->status. And then, if TX interrupt happened at such a timing, the sh_eth_tx_free() may free the descriptor wrongly. So, add wmb() before cur_tx++. Otherwise NETDEV WATCHDOG timeout is possible to happen. Fixes: 86a74ff21a7a ("net: sh_eth: add support for Renesas SuperH Ethernet") Signed-off-by: Yoshihiro Shimoda Signed-off-by: David S. Miller commit f79645df806565a03abb2847a1d20e6930b25e7e Author: Naohiro Aota Date: Tue Sep 7 00:04:28 2021 +0900 btrfs: zoned: fix double counting of split ordered extent btrfs_add_ordered_extent_*() add num_bytes to fs_info->ordered_bytes. Then, splitting an ordered extent will call btrfs_add_ordered_extent_*() again for split extents, leading to double counting of the region of a split extent. These leaked bytes are finally reported at unmount time as follow: BTRFS info (device dm-1): at unmount dio bytes count 364544 Fix the double counting by subtracting split extent's size from fs_info->ordered_bytes. Fixes: d22002fd37bd ("btrfs: zoned: split ordered extent when bio is sent") CC: stable@vger.kernel.org # 5.12+ Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit c124706900c20dee70f921bb3a90492431561a0a Author: Anand Jain Date: Tue Aug 31 09:21:28 2021 +0800 btrfs: fix lockdep warning while mounting sprout fs Following test case reproduces lockdep warning. Test case: $ mkfs.btrfs -f $ btrfstune -S 1 $ mount $ btrfs device add -f $ umount $ mount $ umount The warning claims a possible ABBA deadlock between the threads initiated by [#1] btrfs device add and [#0] the mount. [ 540.743122] WARNING: possible circular locking dependency detected [ 540.743129] 5.11.0-rc7+ #5 Not tainted [ 540.743135] ------------------------------------------------------ [ 540.743142] mount/2515 is trying to acquire lock: [ 540.743149] ffffa0c5544c2ce0 (&fs_devs->device_list_mutex){+.+.}-{4:4}, at: clone_fs_devices+0x6d/0x210 [btrfs] [ 540.743458] but task is already holding lock: [ 540.743461] ffffa0c54a7932b8 (btrfs-chunk-00){++++}-{4:4}, at: __btrfs_tree_read_lock+0x32/0x200 [btrfs] [ 540.743541] which lock already depends on the new lock. [ 540.743543] the existing dependency chain (in reverse order) is: [ 540.743546] -> #1 (btrfs-chunk-00){++++}-{4:4}: [ 540.743566] down_read_nested+0x48/0x2b0 [ 540.743585] __btrfs_tree_read_lock+0x32/0x200 [btrfs] [ 540.743650] btrfs_read_lock_root_node+0x70/0x200 [btrfs] [ 540.743733] btrfs_search_slot+0x6c6/0xe00 [btrfs] [ 540.743785] btrfs_update_device+0x83/0x260 [btrfs] [ 540.743849] btrfs_finish_chunk_alloc+0x13f/0x660 [btrfs] <--- device_list_mutex [ 540.743911] btrfs_create_pending_block_groups+0x18d/0x3f0 [btrfs] [ 540.743982] btrfs_commit_transaction+0x86/0x1260 [btrfs] [ 540.744037] btrfs_init_new_device+0x1600/0x1dd0 [btrfs] [ 540.744101] btrfs_ioctl+0x1c77/0x24c0 [btrfs] [ 540.744166] __x64_sys_ioctl+0xe4/0x140 [ 540.744170] do_syscall_64+0x4b/0x80 [ 540.744174] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 540.744180] -> #0 (&fs_devs->device_list_mutex){+.+.}-{4:4}: [ 540.744184] __lock_acquire+0x155f/0x2360 [ 540.744188] lock_acquire+0x10b/0x5c0 [ 540.744190] __mutex_lock+0xb1/0xf80 [ 540.744193] mutex_lock_nested+0x27/0x30 [ 540.744196] clone_fs_devices+0x6d/0x210 [btrfs] [ 540.744270] btrfs_read_chunk_tree+0x3c7/0xbb0 [btrfs] [ 540.744336] open_ctree+0xf6e/0x2074 [btrfs] [ 540.744406] btrfs_mount_root.cold.72+0x16/0x127 [btrfs] [ 540.744472] legacy_get_tree+0x38/0x90 [ 540.744475] vfs_get_tree+0x30/0x140 [ 540.744478] fc_mount+0x16/0x60 [ 540.744482] vfs_kern_mount+0x91/0x100 [ 540.744484] btrfs_mount+0x1e6/0x670 [btrfs] [ 540.744536] legacy_get_tree+0x38/0x90 [ 540.744537] vfs_get_tree+0x30/0x140 [ 540.744539] path_mount+0x8d8/0x1070 [ 540.744541] do_mount+0x8d/0xc0 [ 540.744543] __x64_sys_mount+0x125/0x160 [ 540.744545] do_syscall_64+0x4b/0x80 [ 540.744547] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 540.744551] other info that might help us debug this: [ 540.744552] Possible unsafe locking scenario: [ 540.744553] CPU0 CPU1 [ 540.744554] ---- ---- [ 540.744555] lock(btrfs-chunk-00); [ 540.744557] lock(&fs_devs->device_list_mutex); [ 540.744560] lock(btrfs-chunk-00); [ 540.744562] lock(&fs_devs->device_list_mutex); [ 540.744564] *** DEADLOCK *** [ 540.744565] 3 locks held by mount/2515: [ 540.744567] #0: ffffa0c56bf7a0e0 (&type->s_umount_key#42/1){+.+.}-{4:4}, at: alloc_super.isra.16+0xdf/0x450 [ 540.744574] #1: ffffffffc05a9628 (uuid_mutex){+.+.}-{4:4}, at: btrfs_read_chunk_tree+0x63/0xbb0 [btrfs] [ 540.744640] #2: ffffa0c54a7932b8 (btrfs-chunk-00){++++}-{4:4}, at: __btrfs_tree_read_lock+0x32/0x200 [btrfs] [ 540.744708] stack backtrace: [ 540.744712] CPU: 2 PID: 2515 Comm: mount Not tainted 5.11.0-rc7+ #5 But the device_list_mutex in clone_fs_devices() is redundant, as explained below. Two threads [1] and [2] (below) could lead to clone_fs_device(). [1] open_ctree <== mount sprout fs btrfs_read_chunk_tree() mutex_lock(&uuid_mutex) <== global lock read_one_dev() open_seed_devices() clone_fs_devices() <== seed fs_devices mutex_lock(&orig->device_list_mutex) <== seed fs_devices [2] btrfs_init_new_device() <== sprouting mutex_lock(&uuid_mutex); <== global lock btrfs_prepare_sprout() lockdep_assert_held(&uuid_mutex) clone_fs_devices(seed_fs_device) <== seed fs_devices Both of these threads hold uuid_mutex which is sufficient to protect getting the seed device(s) freed while we are trying to clone it for sprouting [2] or mounting a sprout [1] (as above). A mounted seed device can not free/write/replace because it is read-only. An unmounted seed device can be freed by btrfs_free_stale_devices(), but it needs uuid_mutex. So this patch removes the unnecessary device_list_mutex in clone_fs_devices(). And adds a lockdep_assert_held(&uuid_mutex) in clone_fs_devices(). Reported-by: Su Yue Tested-by: Su Yue Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 3fa421dedbc82f985f030c5a6480ea2d784334c3 Author: Josef Bacik Date: Tue Jul 27 17:01:17 2021 -0400 btrfs: delay blkdev_put until after the device remove When removing the device we call blkdev_put() on the device once we've removed it, and because we have an EXCL open we need to take the ->open_mutex on the block device to clean it up. Unfortunately during device remove we are holding the sb writers lock, which results in the following lockdep splat: ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc2+ #407 Not tainted ------------------------------------------------------ losetup/11595 is trying to acquire lock: ffff973ac35dd138 ((wq_completion)loop0){+.+.}-{0:0}, at: flush_workqueue+0x67/0x5e0 but task is already holding lock: ffff973ac9812c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x41/0x660 [loop] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&lo->lo_mutex){+.+.}-{3:3}: __mutex_lock+0x7d/0x750 lo_open+0x28/0x60 [loop] blkdev_get_whole+0x25/0xf0 blkdev_get_by_dev.part.0+0x168/0x3c0 blkdev_open+0xd2/0xe0 do_dentry_open+0x161/0x390 path_openat+0x3cc/0xa20 do_filp_open+0x96/0x120 do_sys_openat2+0x7b/0x130 __x64_sys_openat+0x46/0x70 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #3 (&disk->open_mutex){+.+.}-{3:3}: __mutex_lock+0x7d/0x750 blkdev_put+0x3a/0x220 btrfs_rm_device.cold+0x62/0xe5 btrfs_ioctl+0x2a31/0x2e70 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #2 (sb_writers#12){.+.+}-{0:0}: lo_write_bvec+0xc2/0x240 [loop] loop_process_work+0x238/0xd00 [loop] process_one_work+0x26b/0x560 worker_thread+0x55/0x3c0 kthread+0x140/0x160 ret_from_fork+0x1f/0x30 -> #1 ((work_completion)(&lo->rootcg_work)){+.+.}-{0:0}: process_one_work+0x245/0x560 worker_thread+0x55/0x3c0 kthread+0x140/0x160 ret_from_fork+0x1f/0x30 -> #0 ((wq_completion)loop0){+.+.}-{0:0}: __lock_acquire+0x10ea/0x1d90 lock_acquire+0xb5/0x2b0 flush_workqueue+0x91/0x5e0 drain_workqueue+0xa0/0x110 destroy_workqueue+0x36/0x250 __loop_clr_fd+0x9a/0x660 [loop] block_ioctl+0x3f/0x50 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: (wq_completion)loop0 --> &disk->open_mutex --> &lo->lo_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&lo->lo_mutex); lock(&disk->open_mutex); lock(&lo->lo_mutex); lock((wq_completion)loop0); *** DEADLOCK *** 1 lock held by losetup/11595: #0: ffff973ac9812c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x41/0x660 [loop] stack backtrace: CPU: 0 PID: 11595 Comm: losetup Not tainted 5.14.0-rc2+ #407 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x72 check_noncircular+0xcf/0xf0 ? stack_trace_save+0x3b/0x50 __lock_acquire+0x10ea/0x1d90 lock_acquire+0xb5/0x2b0 ? flush_workqueue+0x67/0x5e0 ? lockdep_init_map_type+0x47/0x220 flush_workqueue+0x91/0x5e0 ? flush_workqueue+0x67/0x5e0 ? verify_cpu+0xf0/0x100 drain_workqueue+0xa0/0x110 destroy_workqueue+0x36/0x250 __loop_clr_fd+0x9a/0x660 [loop] ? blkdev_ioctl+0x8d/0x2a0 block_ioctl+0x3f/0x50 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc21255d4cb So instead save the bdev and do the put once we've dropped the sb writers lock in order to avoid the lockdep recursion. Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8f96a5bfa1503e0a5f3c78d51e993a1794d4aff1 Author: Josef Bacik Date: Tue Jul 27 17:01:16 2021 -0400 btrfs: update the bdev time directly when closing We update the ctime/mtime of a block device when we remove it so that blkid knows the device changed. However we do this by re-opening the block device and calling filp_update_time. This is more correct because it'll call the inode->i_op->update_time if it exists, but the block dev inodes do not do this. Instead call generic_update_time() on the bd_inode in order to avoid the blkdev_open path and get rid of the following lockdep splat: ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc2+ #406 Not tainted ------------------------------------------------------ losetup/11596 is trying to acquire lock: ffff939640d2f538 ((wq_completion)loop0){+.+.}-{0:0}, at: flush_workqueue+0x67/0x5e0 but task is already holding lock: ffff939655510c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x41/0x660 [loop] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&lo->lo_mutex){+.+.}-{3:3}: __mutex_lock+0x7d/0x750 lo_open+0x28/0x60 [loop] blkdev_get_whole+0x25/0xf0 blkdev_get_by_dev.part.0+0x168/0x3c0 blkdev_open+0xd2/0xe0 do_dentry_open+0x161/0x390 path_openat+0x3cc/0xa20 do_filp_open+0x96/0x120 do_sys_openat2+0x7b/0x130 __x64_sys_openat+0x46/0x70 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #3 (&disk->open_mutex){+.+.}-{3:3}: __mutex_lock+0x7d/0x750 blkdev_get_by_dev.part.0+0x56/0x3c0 blkdev_open+0xd2/0xe0 do_dentry_open+0x161/0x390 path_openat+0x3cc/0xa20 do_filp_open+0x96/0x120 file_open_name+0xc7/0x170 filp_open+0x2c/0x50 btrfs_scratch_superblocks.part.0+0x10f/0x170 btrfs_rm_device.cold+0xe8/0xed btrfs_ioctl+0x2a31/0x2e70 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #2 (sb_writers#12){.+.+}-{0:0}: lo_write_bvec+0xc2/0x240 [loop] loop_process_work+0x238/0xd00 [loop] process_one_work+0x26b/0x560 worker_thread+0x55/0x3c0 kthread+0x140/0x160 ret_from_fork+0x1f/0x30 -> #1 ((work_completion)(&lo->rootcg_work)){+.+.}-{0:0}: process_one_work+0x245/0x560 worker_thread+0x55/0x3c0 kthread+0x140/0x160 ret_from_fork+0x1f/0x30 -> #0 ((wq_completion)loop0){+.+.}-{0:0}: __lock_acquire+0x10ea/0x1d90 lock_acquire+0xb5/0x2b0 flush_workqueue+0x91/0x5e0 drain_workqueue+0xa0/0x110 destroy_workqueue+0x36/0x250 __loop_clr_fd+0x9a/0x660 [loop] block_ioctl+0x3f/0x50 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: (wq_completion)loop0 --> &disk->open_mutex --> &lo->lo_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&lo->lo_mutex); lock(&disk->open_mutex); lock(&lo->lo_mutex); lock((wq_completion)loop0); *** DEADLOCK *** 1 lock held by losetup/11596: #0: ffff939655510c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x41/0x660 [loop] stack backtrace: CPU: 1 PID: 11596 Comm: losetup Not tainted 5.14.0-rc2+ #406 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x72 check_noncircular+0xcf/0xf0 ? stack_trace_save+0x3b/0x50 __lock_acquire+0x10ea/0x1d90 lock_acquire+0xb5/0x2b0 ? flush_workqueue+0x67/0x5e0 ? lockdep_init_map_type+0x47/0x220 flush_workqueue+0x91/0x5e0 ? flush_workqueue+0x67/0x5e0 ? verify_cpu+0xf0/0x100 drain_workqueue+0xa0/0x110 destroy_workqueue+0x36/0x250 __loop_clr_fd+0x9a/0x660 [loop] ? blkdev_ioctl+0x8d/0x2a0 block_ioctl+0x3f/0x50 __x64_sys_ioctl+0x80/0xb0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit cde7417ce487988322d0bdaa02b4165082fbe388 Author: Kari Argillander Date: Tue Aug 31 00:51:52 2021 +0300 btrfs: use correct header for div_u64 in misc.h asm/do_div.h is for div_u64, but it is found in math64.h. This change will make compiler job easier and prevent compiler errors in situation where compiler will not find math64.h from another paths. Signed-off-by: Kari Argillander Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6f93e834fa7c5faa0372e46828b4b2a966ac61d7 Author: Anand Jain Date: Tue Aug 10 23:23:44 2021 +0800 btrfs: fix upper limit for max_inline for page size 64K The mount option max_inline ranges from 0 to the sectorsize (which is now equal to page size). But we parse the mount options too early and before the actual sectorsize is read from the superblock. So the upper limit of max_inline is unaware of the actual sectorsize and is limited by the temporary sectorsize 4096, even on a system where the default sectorsize is 64K. Fix this by reading the superblock sectorsize before the mount option parse. Reported-by: Alexander Tsvetkov CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7d665612dd5ae0fe982a34447f84cb5121c3455a Author: Heiko Carstens Date: Mon Sep 6 22:23:36 2021 +0200 s390/hmcdrv_ftp: fix kernel doc comment Signed-off-by: Heiko Carstens commit 68c32eb2707aed0a3be1a60b0f206943a25e8f34 Author: Heiko Carstens Date: Mon Sep 6 13:59:26 2021 +0200 s390: remove xpram device driver Support for expanded storage was only available until z13 and z/VM 6.3 respectively. However there haven't been any use cases a long time before for this device driver. Therefore remove it. Acked-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit 85ad27215ca57d02bb7c43d76f65a865dc863b59 Author: Pierre Morel Date: Mon Sep 6 08:49:44 2021 +0200 s390/pci: read clp_list_pci_req only once We do not have to reset the fh_list in the loop. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit ebd9cc6593691e6bc8526e368cedbdfc8034f403 Author: Niklas Schnelle Date: Fri Sep 3 18:27:01 2021 +0200 s390/pci: fix clp_get_state() handling of -ENODEV With commit cc049eecfb7a ("s390/pci: simplify CLP List PCI handling") clp_get_state() was changed to make use of the new clp_find_pci() helper function to query a specific function. This however returns -ENODEV when the device is not found at all and this error was passed to the caller. It was missed however that the callers actually expect a success return from clp_get_state() if the device is gone. Fix this by handling the -ENODEV return of clp_find_pci() explicitly in clp_get_state() returning success and setting the state parameter to ZPCI_FN_STATE_RESERVED matching the design concept that a PCI function that disappeared must have been resverved elsewhere. For all other error returns continue to just pass them on to the caller. Reviewed-by: Matthew Rosato Fixes: cc049eecfb7a ("s390/pci: simplify CLP List PCI handling") Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 19379d456f7b6d46e478cc1587a20d23f9d092ef Author: Heiko Carstens Date: Fri Sep 3 18:13:10 2021 +0200 s390/cio: fix kernel doc comment Signed-off-by: Heiko Carstens commit 7a928af413c367bfed513e0a44220b4a5d21ef9a Author: Heiko Carstens Date: Fri Sep 3 18:03:59 2021 +0200 s390/ctrlchar: fix kernel doc comment Signed-off-by: Heiko Carstens commit 44bead2545f11d543c3cc38b1342713c7f825dc2 Author: Heiko Carstens Date: Thu Sep 2 20:38:53 2021 +0200 s390/con3270: use proper type for tasklet function Get rid of this warning: drivers/s390/char/con3270.c:629:22: warning: cast between incompatible function types from ‘void (*)(struct raw3270_request *)’ to ‘void (*)(long unsigned int)’ [-Wcast-function-type] 629 | (void (*)(unsigned long)) con3270_read_tasklet, | ^ Signed-off-by: Heiko Carstens commit 5dddfaac4c258f5eda7b3dba7f9d851262fcbbab Author: Heiko Carstens Date: Thu Sep 2 19:51:59 2021 +0200 s390/cpum_cf: move array from header to C file Move array from header to C file to avoid that it gets defined in every C file where the header is included: In file included from arch/s390/kernel/perf_cpum_cf_common.c:19: ./arch/s390/include/asm/cpu_mcf.h:27:18: warning: ‘cpumf_ctr_ctl’ defined but not used [-Wunused-const-variable=] 27 | static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = { | ^~~~~~~~~~~~~ Signed-off-by: Heiko Carstens commit 2e8275285a60868231eaf63abd9552cc27e512a2 Author: Heiko Carstens Date: Thu Sep 2 19:47:37 2021 +0200 s390/mm: fix kernel doc comments Signed-off-by: Heiko Carstens commit a052096bdd6809eeab809202726634d1ac975aa1 Author: Sven Schnelle Date: Fri Aug 27 20:21:05 2021 +0200 s390/topology: fix topology information when calling cpu hotplug notifiers The cpu hotplug notifiers are called without updating the core/thread masks when a new CPU is added. This causes problems with code setting up data structures in a cpu hotplug notifier, and relying on that later in normal code. This caused a crash in the new core scheduling code (SCHED_CORE), where rq->core was set up in a notifier depending on cpu masks. To fix this, add a cpu_setup_mask which is used in update_cpu_masks() instead of the cpu_online_mask to determine whether the cpu masks should be set for a certain cpu. Also move update_cpu_masks() to update the masks before calling notify_cpu_starting() so that the notifiers are seeing the updated masks. Signed-off-by: Sven Schnelle Cc: [hca@linux.ibm.com: get rid of cpu_online_mask handling] Signed-off-by: Heiko Carstens commit 88b604263f3d6eedae0b1c2c3bbd602d1e2e8775 Author: Vasily Gorbik Date: Wed Sep 1 16:05:59 2021 +0200 s390/unwind: use current_frame_address() to unwind current task current_stack_pointer() simply returns current value of %r15. If current_stack_pointer() caller allocates stack (which is the case in unwind code) %r15 points to a stack frame allocated for callees, meaning current_stack_pointer() caller (e.g. stack_trace_save) will end up in the stacktrace. This is not expected by stack_trace_save*() callers and causes problems. current_frame_address() on the other hand returns function stack frame address, which matches %r15 upon function invocation. Using it in get_stack_pointer() makes it more aligned with x86 implementation (according to BACKTRACE_SELF_TEST output) and meets stack_trace_save*() caller's expectations, notably KCSAN. Also make sure unwind_start is always inlined. Reported-by: Nathan Chancellor Suggested-by: Marco Elver Signed-off-by: Vasily Gorbik Tested-by: Marco Elver Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/patch.git-04dd26be3043.your-ad-here.call-01630504868-ext-6188@work.hours Signed-off-by: Heiko Carstens commit c5433f026b27cc100985189fac04969dfbf56dba Author: Takashi Iwai Date: Tue Sep 7 11:39:30 2021 +0200 ALSA: gus: Fix repeated probe for ISA interwave card The legacy ISA probe tries to probe the card repeatedly, and this would conflict with the refactoring using devres. Put the card creation out of the loop and only probe GUS object repeatedly. Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20210907093930.29009-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9d2e19e349627e79bcd474bc64e71a312029b3be Author: Takashi Iwai Date: Tue Sep 7 11:39:29 2021 +0200 ALSA: gus: Fix repeated probes of snd_gus_create() GUS card object may be repeatedly probed for the legacy ISA devices, and the behavior doesn't fit with the devres resource management. Revert partially back to the classical way for the snd_gus_card object, so that the repeated calls of snd_gus_create() are allowed. Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs") Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210907093930.29009-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit bbef56d861f103058e387ad5354b4083b9892a7c Author: Colin Ian King Date: Tue Sep 7 09:45:34 2021 +0100 bonding: 3ad: pass parameter bond_params by reference The parameter bond_params is a relatively large 192 byte sized struct so pass it by reference rather than by value to reduce copying. Addresses-Coverity: ("Big parameter passed by value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 1c990729e19891bd586f9f28a290db2867bdcb0a Merge: 8f110f35f9629 644d0a5bcc336 Author: David S. Miller Date: Tue Sep 7 10:06:50 2021 +0100 Merge tag 'linux-can-fixes-for-5.15-20210907' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can linux-can-fixes-for-5.15-20210907 Signed-off-by: David S. Miller commit 8f110f35f9629397ad40cf4c2a66c2c350fbd8ea Merge: be27a47a760e3 e4457a45b41c1 Author: David S. Miller Date: Tue Sep 7 10:04:47 2021 +0100 Merge tag 'wireless-drivers-2021-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for v5.15 First set of fixes for v5.15 and only iwlwifi patches this time. Most important being support for new hardware and new firmware API. I had already earlier applied a fix which also Linus applied to this tree as commit 1476ff21abb4 ("iwl: fix debug printf format strings"), but this doesn't seem to cause any conflicts so I left it there. iwlwifi * add support for firmware API 66 * add support for Samsung Galaxy Book Flex2 Alpha * fix a leak happening every time module is loaded * fix a printk compiler warning ==================== Signed-off-by: David S. Miller commit be27a47a760e3ad8ce979a680558776f672efffd Author: Heiner Kallweit Date: Mon Sep 6 22:51:33 2021 +0200 cxgb3: fix oops on module removal When removing the driver module w/o bringing an interface up before the error below occurs. Reason seems to be that cancel_work_sync() is called in t3_sge_stop() for a queue that hasn't been initialized yet. [10085.941785] ------------[ cut here ]------------ [10085.941799] WARNING: CPU: 1 PID: 5850 at kernel/workqueue.c:3074 __flush_work+0x3ff/0x480 [10085.941819] Modules linked in: vfat snd_hda_codec_hdmi fat snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio led_class ee1004 iTCO_ wdt intel_tcc_cooling x86_pkg_temp_thermal coretemp aesni_intel crypto_simd cryptd snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core r 8169 snd_pcm realtek mdio_devres snd_timer snd i2c_i801 i2c_smbus libphy i915 i2c_algo_bit cxgb3(-) intel_gtt ttm mdio drm_kms_helper mei_me s yscopyarea sysfillrect sysimgblt mei fb_sys_fops acpi_pad sch_fq_codel crypto_user drm efivarfs ext4 mbcache jbd2 crc32c_intel [10085.941944] CPU: 1 PID: 5850 Comm: rmmod Not tainted 5.14.0-rc7-next-20210826+ #6 [10085.941974] Hardware name: System manufacturer System Product Name/PRIME H310I-PLUS, BIOS 2603 10/21/2019 [10085.941992] RIP: 0010:__flush_work+0x3ff/0x480 [10085.942003] Code: c0 74 6b 65 ff 0d d1 bd 78 75 e8 bc 2f 06 00 48 c7 c6 68 b1 88 8a 48 c7 c7 e0 5f b4 8b 45 31 ff e8 e6 66 04 00 e9 4b fe ff ff <0f> 0b 45 31 ff e9 41 fe ff ff e8 72 c1 79 00 85 c0 74 87 80 3d 22 [10085.942036] RSP: 0018:ffffa1744383fc08 EFLAGS: 00010246 [10085.942048] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000923 [10085.942062] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff91c901710a88 [10085.942076] RBP: ffffa1744383fce8 R08: 0000000000000001 R09: 0000000000000001 [10085.942090] R10: 00000000000000c2 R11: 0000000000000000 R12: ffff91c901710a88 [10085.942104] R13: 0000000000000000 R14: ffff91c909a96100 R15: 0000000000000001 [10085.942118] FS: 00007fe417837740(0000) GS:ffff91c969d00000(0000) knlGS:0000000000000000 [10085.942134] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [10085.942146] CR2: 000055a8d567ecd8 CR3: 0000000121690003 CR4: 00000000003706e0 [10085.942160] Call Trace: [10085.942166] ? __lock_acquire+0x3af/0x22e0 [10085.942177] ? cancel_work_sync+0xb/0x10 [10085.942187] __cancel_work_timer+0x128/0x1b0 [10085.942197] ? __pm_runtime_resume+0x5b/0x90 [10085.942208] cancel_work_sync+0xb/0x10 [10085.942217] t3_sge_stop+0x2f/0x50 [cxgb3] [10085.942234] remove_one+0x26/0x190 [cxgb3] [10085.942248] pci_device_remove+0x39/0xa0 [10085.942258] __device_release_driver+0x15e/0x240 [10085.942269] driver_detach+0xd9/0x120 [10085.942278] bus_remove_driver+0x53/0xd0 [10085.942288] driver_unregister+0x2c/0x50 [10085.942298] pci_unregister_driver+0x31/0x90 [10085.942307] cxgb3_cleanup_module+0x10/0x18c [cxgb3] [10085.942324] __do_sys_delete_module+0x191/0x250 [10085.942336] ? syscall_enter_from_user_mode+0x21/0x60 [10085.942347] ? trace_hardirqs_on+0x2a/0xe0 [10085.942357] __x64_sys_delete_module+0x13/0x20 [10085.942368] do_syscall_64+0x40/0x90 [10085.942377] entry_SYSCALL_64_after_hwframe+0x44/0xae [10085.942389] RIP: 0033:0x7fe41796323b Fixes: 5e0b8928927f ("net:cxgb3: replace tasklets with works") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit cdff1eda69326fb46de10c5454212b3efcf4bb41 Author: Randy Dunlap Date: Mon Sep 6 17:19:49 2021 -0700 mfd: lpc_sch: Rename GPIOBASE to prevent build error One MIPS platform (mach-rc32434) defines GPIOBASE. This macro conflicts with one of the same name in lpc_sch.c. Rename the latter one to prevent the build error. ../drivers/mfd/lpc_sch.c:25: error: "GPIOBASE" redefined [-Werror] 25 | #define GPIOBASE 0x44 ../arch/mips/include/asm/mach-rc32434/rb.h:32: note: this is the location of the previous definition 32 | #define GPIOBASE 0x050000 Cc: Denis Turischev Fixes: e82c60ae7d3a ("mfd: Introduce lpc_sch for Intel SCH LPC bridge") Signed-off-by: Randy Dunlap Signed-off-by: Lee Jones commit 452d07413954ef38951cfd41507b310c3afccd93 Author: Hector Martin Date: Mon Aug 23 23:31:22 2021 +0900 mfd: syscon: Use of_iomap() instead of ioremap() This automatically selects between ioremap() and ioremap_np() on platforms that require it, such as Apple SoCs. Signed-off-by: Hector Martin Acked-by: Arnd Bergmann Signed-off-by: Lee Jones commit 87fd9ef47597b2fcee3264eb5f288410b9f376d5 Author: Geert Uytterhoeven Date: Thu Sep 2 14:49:13 2021 +0200 dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER DMA-BUF sysfs statistics are an option of DMA-BUF. It does not make much sense to bother the user with a question about DMA-BUF sysfs statistics if DMA-BUF itself is not enabled. Worse, enabling the statistics enables the feature. Fixes: bdb8d06dfefd666d ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs") Signed-off-by: Geert Uytterhoeven Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20210902124913.2698760-4-geert@linux-m68k.org commit cca62758ebdd71fcfb6d589d6487a7f26398d50d Author: Geert Uytterhoeven Date: Thu Sep 2 14:49:12 2021 +0200 dma-buf: DMABUF_DEBUG should depend on DMA_SHARED_BUFFER DMA-BUF debug checks are an option of DMA-BUF. Enabling DMABUF_DEBUG without DMA_SHARED_BUFFER does not have any impact, as drivers/dma-buf/ is not entered during the build when DMA_SHARED_BUFFER is disabled. Fixes: 84335675f2223cbd ("dma-buf: Add debug option") Signed-off-by: Geert Uytterhoeven Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20210902124913.2698760-3-geert@linux-m68k.org commit 644d0a5bcc3361170d84fb8d0b13943c354119db Author: Tong Zhang Date: Mon Sep 6 16:37:02 2021 -0700 can: c_can: fix null-ptr-deref on ioctl() The pdev maybe not a platform device, e.g. c_can_pci device, in this case, calling to_platform_device() would not make sense. Also, per the comment in drivers/net/can/c_can/c_can_ethtool.c, @bus_info should match dev_name() string, so I am replacing this with dev_name() to fix this issue. [ 1.458583] BUG: unable to handle page fault for address: 0000000100000000 [ 1.460921] RIP: 0010:strnlen+0x1a/0x30 [ 1.466336] ? c_can_get_drvinfo+0x65/0xb0 [c_can] [ 1.466597] ethtool_get_drvinfo+0xae/0x360 [ 1.466826] dev_ethtool+0x10f8/0x2970 [ 1.467880] sock_ioctl+0xef/0x300 Fixes: 2722ac986e93 ("can: c_can: add ethtool support") Link: https://lore.kernel.org/r/20210906233704.1162666-1-ztong0001@gmail.com Cc: stable@vger.kernel.org # 5.14+ Signed-off-by: Tong Zhang Signed-off-by: Marc Kleine-Budde commit 54d7a47a008b89fce5a669528274194ca092634d Author: Marc Kleine-Budde Date: Sat Sep 4 14:35:26 2021 +0200 can: rcar_canfd: add __maybe_unused annotation to silence warning Since commit | dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver") the rcar_canfd driver can be compile tested on all architectures. On non OF enabled archs, or archs where OF is optional (and disabled in the .config) the compilation throws the following warning: | drivers/net/can/rcar/rcar_canfd.c:2020:34: warning: unused variable 'rcar_canfd_of_table' [-Wunused-const-variable] | static const struct of_device_id rcar_canfd_of_table[] = { | ^ This patch fixes the warning by marking the variable rcar_canfd_of_table as __maybe_unused. Fixes: ac4224087312 ("can: rcar: Kconfig: Add helper dependency on COMPILE_TEST") Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver") Link: https://lore.kernel.org/all/20210907064537.1054268-1-mkl@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org Cc: Cai Huoqing Reported-by: kernel test robot Signed-off-by: Marc Kleine-Budde commit ab108678195ff70edf50025379a5de94b0bb26be Author: Linus Walleij Date: Mon Sep 6 23:31:42 2021 -0700 Input: mms114 - support MMS134S The MMS134S like the MMS136 has an event size of 6 bytes. After this patch, the touchscreen on the Samsung SGH-I407 works fine with PostmarketOS. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210706235951.189289-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 3ad02c27d89d72b3b49ac51899144b7d0942f05f Author: Randy Dunlap Date: Tue Sep 7 06:40:22 2021 +0200 media: s5p-jpeg: rename JPEG marker constants to prevent build warnings The use of a macro named 'RST' conflicts with one of the same name in arch/mips/include/asm/mach-rc32434/rb.h. This causes build warnings on some MIPS builds. Change the names of the JPEG marker constants to be in their own namespace to fix these build warnings and to prevent other similar problems in the future. Fixes these build warnings: In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c:14: ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined 43 | #define RST 0xd0 | ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition 13 | #define RST (1 << 15) In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c:13: ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined 43 | #define RST 0xd0 ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition 13 | #define RST (1 << 15) In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c:12: ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined 43 | #define RST 0xd0 ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition 13 | #define RST (1 << 15) In file included from ../drivers/media/platform/s5p-jpeg/jpeg-core.c:31: ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined 43 | #define RST 0xd0 ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition 13 | #define RST (1 << 15) Also update the kernel-doc so that the word "marker" is not repeated. Link: https://lore.kernel.org/linux-media/20210907044022.30602-1-rdunlap@infradead.org Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Andrzej Pietrasiewicz Cc: Jacek Anaszewski Cc: Sylwester Nawrocki Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Mauro Carvalho Chehab commit d198b8273e3006818ea287a93eb4d8fd2543e512 Author: jingle.wu Date: Mon Sep 6 21:52:05 2021 -0700 Input: elan_i2c - reduce the resume time for controller in Whitebox Similar to controllers found Voxel, Delbin, Magpie and Bobba, the one found in Whitebox does not need to be reset after issuing power-on command, and skipping reset saves resume time. Signed-off-by: Jingle Wu Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210907012924.11391-1-jingle.wu@emc.com.tw Signed-off-by: Dmitry Torokhov commit 8491f59e3b130ea8b5116e363d400c42f91544fc Author: Tong Zhang Date: Mon Sep 6 18:47:45 2021 -0700 ALSA: vx222: fix null-ptr-deref a recent refactor created a null pointer vx in snd_vx222_probe(). The vx pointer should have been populated in snd_vx222_create() as suggested in earlier version, otherwise vx->core.ibl.size will throw an error. [ 1.298398] BUG: kernel NULL pointer dereference, address: 00000000000001d8 [ 1.316799] RIP: 0010:snd_vx222_probe+0x155/0x290 [snd_vx222] Fixes: 3bde3359aa16 ("ALSA: vx222: Allocate resources with device-managed APIs") Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20210907014746.1445278-1-ztong0001@gmail.com Signed-off-by: Takashi Iwai commit 5ac749a57e0ebb334b1b2c3d28d4d5b1ef85f8ed Author: Jens Axboe Date: Mon Sep 6 18:43:55 2021 -0600 libata: pass over maintainership to Damien Le Moal Damien has agreed to take over maintainership of libata, update the MAINTAINERS file to reflect that. Acked-by: Damien Le Moal Signed-off-by: Jens Axboe commit 7c5c18bdb656057cb76fabfa1a74b793ac49da35 Author: Akira Yokosawa Date: Sun Aug 29 11:06:16 2021 +0900 docs: pdfdocs: Fix typo in CJK-language specific font settings There were typos in the fallback definitions of dummy LaTeX macros for systems without CJK fonts. They cause build errors in "make pdfdocs" on such systems. Fix them. Fixes: e291ff6f5a03 ("docs: pdfdocs: Add CJK-language-specific font settings") Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/ad7615a5-f8fa-2bc3-de6b-7ed49d458964@gmail.com Signed-off-by: Jonathan Corbet commit 4b93c544e90e2b28326182d31ee008eb80e02074 Author: Linus Torvalds Date: Mon Sep 6 12:27:03 2021 -0700 thunderbolt: test: split up test cases in tb_test_credit_alloc_all The tb_test_credit_alloc_all() function had a huge number of KUNIT_ASSERT() statements, all of which (though the magic of many many layers of inscrutable macros) ended up allocating and initializing various test assertion structures on the stack. Don't do that. The kernel stack isn't infinite, and we have compiler warnings (now errors) for the case where a stack frame grows too large. Like it did here, by not an inconsiderable margin: drivers/thunderbolt/test.c: In function ‘tb_test_credit_alloc_all’: drivers/thunderbolt/test.c:2367:1: error: the frame size of 4500 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 2367 | } | ^ Solve this similarly to the lib/test_scanf case: split out the tests into several smaller functions, each just testing one particular tunnel credit allocation. This makes the i386 allyesconfig build work for me again. Signed-off-by: Linus Torvalds commit ba7b1f861086d760ef1032915fe7c809a191434e Author: Linus Torvalds Date: Mon Sep 6 11:04:03 2021 -0700 lib/test_scanf: split up number parsing test routines It turns out that gcc has real trouble merging all the temporary on-stack buffer allocation. So despite the fact that their lifetimes do not overlap, gcc will allocate stack for all of them when they have different types. Which they do in the number scanning test routines. This is unfortunate in general, but with lots of test-cases in one function, it becomes a real problem. gcc will allocate a huge stack frame for no actual good reason. We have tried to counteract this tendency of gcc not merging stack slots (see "-fconserve-stack"), but that has limited effect (and should be on by default these days, iirc). So with all the debug options enabled on an i386 allmodconfig build, we end up with overly big stack frames, and the resulting stack frame size warnings (now errors): lib/test_scanf.c: In function ‘numbers_list_field_width_val_width’: lib/test_scanf.c:530:1: error: the frame size of 2088 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 530 | } | ^ lib/test_scanf.c: In function ‘numbers_list_field_width_typemax’: lib/test_scanf.c:488:1: error: the frame size of 2568 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 488 | } | ^ lib/test_scanf.c: In function ‘numbers_list’: lib/test_scanf.c:437:1: error: the frame size of 2088 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 437 | } | ^ In this particular case, the reasonably straightforward solution is to just split out the test routines into multiple more targeted versions. That way we don't have one huge stack, but several smaller ones, and they aren't active all at the same time. Signed-off-by: Linus Torvalds commit 1476ff21abb435cd4c453e61df5b125fac8cc50b Author: Linus Torvalds Date: Mon Sep 6 10:24:58 2021 -0700 iwl: fix debug printf format strings The variable 'package_size' is an unsigned long, and should be printed out using '%lu', not '%zd' (that would be for a size_t). Yes, on many architectures (including x86-64), 'size_t' is in fact the same type as 'long', but that's a fairly random architecture definition, and on some platforms 'size_t' is in fact 'int' rather than 'long'. That is the case on traditional 32-bit x86. Yes, both types are the exact same 32-bit size, and it would all print out perfectly correctly, but '%zd' ends up still being wrong. And we can't make 'package_size' be a 'size_t', because we get the actual value using efivar_entry_get() that takes a pointer to an 'unsigned long'. So '%lu' it is. This fixes two of the i386 allmodconfig build warnings (that is now an error due to -Werror). Signed-off-by: Linus Torvalds commit 1dbe7e386f505bdae30f7436c41769149c7dcf32 Merge: 03085b3d5a45a 1c500ad706383 Author: Linus Torvalds Date: Mon Sep 6 10:06:26 2021 -0700 Merge tag 'block-5.15-2021-09-05' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Was going to send this one in later this week, but given that -Werror is now enabled (or at least available), the mq-deadline fix really should go in for the folks hitting that. - Ensure dd_queued() is only there if needed (Geert) - Fix a kerneldoc warning for bio_alloc_kiocb() - BFQ fix for queue merging - loop locking fix (Tetsuo)" * tag 'block-5.15-2021-09-05' of git://git.kernel.dk/linux-block: loop: reduce the loop_ctl_mutex scope bio: fix kerneldoc documentation for bio_alloc_kiocb() block, bfq: honor already-setup queue merges block/mq-deadline: Move dd_queued() to fix defined but not used warning commit 03085b3d5a45a60061423ac4857f339c7cb260ff Merge: eebb4159a2bf6 55d1308bdff73 Author: Linus Torvalds Date: Mon Sep 6 10:00:25 2021 -0700 Merge tag 'misc-5.15-2021-09-05' of git://git.kernel.dk/linux-block Pull CDROM maintainer update from Jens Axboe: "It's been about 22 years since I originally started maintaining the CDROM code, and I just haven't been able to even get reviews done in a timely fashion the last handful of years. Time to pass it on, and Phillip has volunteered take over these duties. I'll be helping as needed for the foreseeable future" * tag 'misc-5.15-2021-09-05' of git://git.kernel.dk/linux-block: cdrom: update uniform CD-ROM maintainership in MAINTAINERS file commit eebb4159a2bf660b545ecb6ee318179971d610a2 Merge: 60f8fbaa95445 7a8526a5cd51c Author: Linus Torvalds Date: Mon Sep 6 09:51:42 2021 -0700 Merge tag 'libata-5.15-2021-09-05' of git://git.kernel.dk/linux-block Pull libata fixes from Jens Axboe: "Fixes for queued trim on certain Samsung SSDs, in conjunction with certain ATI controllers" * tag 'libata-5.15-2021-09-05' of git://git.kernel.dk/linux-block: libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD. libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs commit 60f8fbaa954452104a1914e21c5cc109f7bf276a Merge: 20fbb11fe4ea9 2fc2a7a62eb58 Author: Linus Torvalds Date: Mon Sep 6 09:26:07 2021 -0700 Merge tag 'for-5.15/io_uring-2021-09-04' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "As sometimes happens, two reports came in around the merge window open that led to some fixes. Hence this one is a bit bigger than usual followup fixes, but most of it will be going towards stable, outside of the fixes that are addressing regressions from this merge window. In detail: - postgres is a heavy user of signals between tasks, and if we're unlucky this can interfere with io-wq worker creation. Make sure we're resilient against unrelated signal handling. This set of changes also includes hardening against allocation failures, which could previously had led to stalls. - Some use cases that end up having a mix of bounded and unbounded work would have starvation issues related to that. Split the pending work lists to handle that better. - Completion trace int -> unsigned -> long fix - Fix issue with REGISTER_IOWQ_MAX_WORKERS and SQPOLL - Fix regression with hash wait lock in this merge window - Fix retry issued on block devices (Ming) - Fix regression with links in this merge window (Pavel) - Fix race with multi-shot poll and completions (Xiaoguang) - Ensure regular file IO doesn't inadvertently skip completion batching (Pavel) - Ensure submissions are flushed after running task_work (Pavel)" * tag 'for-5.15/io_uring-2021-09-04' of git://git.kernel.dk/linux-block: io_uring: io_uring_complete() trace should take an integer io_uring: fix possible poll event lost in multi shot mode io_uring: prolong tctx_task_work() with flushing io_uring: don't disable kiocb_done() CQE batching io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL io-wq: make worker creation resilient against signals io-wq: get rid of FIXED worker flag io-wq: only exit on fatal signals io-wq: split bounded and unbounded work into separate lists io-wq: fix queue stalling race io_uring: don't submit half-prepared drain request io_uring: fix queueing half-created requests io-wq: ensure that hash wait lock is IRQ disabling io_uring: retry in case of short read on block device io_uring: IORING_OP_WRITE needs hash_reg_file set io-wq: fix race between adding work and activating a free worker commit 20fbb11fe4ea99e02d77824613f1438bea456683 Author: Stephen Rothwell Date: Mon Sep 6 15:47:02 2021 +1000 don't make the syscall checking produce errors from warnings Signed-off-by: Stephen Rothwell Signed-off-by: Linus Torvalds commit b81bede4d138ce62f7342e27bf55ac93c8071818 Author: Wolfram Sang Date: Thu Aug 26 10:21:07 2021 +0200 mmc: renesas_sdhi: fix regression with hard reset on old SDHIs Old SDHI instances have a default value for the reset register which keeps it in reset state by default. So, when applying a hard reset we need to manually leave the soft reset state as well. Later SDHI instances have a different default value, the one we write manually now. Fixes: b4d86f37eacb ("mmc: renesas_sdhi: do hard reset if possible") Signed-off-by: Wolfram Sang Tested-by: Geert Uytterhoeven Reported-by: Geert Uytterhoeven Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210826082107.47299-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 26391e49d5b0f0c33eb4b28a312d2ecc094d7489 Author: Vincent Whitchurch Date: Wed Aug 25 13:42:13 2021 +0200 mmc: dw_mmc: Only inject fault before done/error The fault injection function can set EVENT_DATA_ERROR but skip the setting of ->data_status to an error status if it hits just after a data over interrupt. This confuses the tasklet which can later end up triggering the WARN_ON(host->cmd || ..) in dw_mci_request_end() since dw_mci_data_complete() would return success. Prevent the fault injection function from doing this since this is not a real case, and ensure that the fault injection doesn't race with a real error either. Signed-off-by: Vincent Whitchurch Reviewed-by: Jaehoon Chung Fixes: 2b8ac062f337 ("mmc: dw_mmc: Add data CRC error injection") Link: https://lore.kernel.org/r/20210825114213.7429-1-vincent.whitchurch@axis.com Signed-off-by: Ulf Hansson commit b539c44df067ac116ec1b58b956efda51b6a7fc1 Author: Andy Shevchenko Date: Mon Sep 6 15:44:49 2021 +0300 net: wwan: iosm: Unify IO accessors used in the driver Currently we have readl()/writel()/ioread*()/iowrite*() APIs in use. Let's unify to use only ioread*()/iowrite*() variants. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 1d99411fe70194f39d74a8db2ad082daa12e6aad Author: Andy Shevchenko Date: Mon Sep 6 15:44:48 2021 +0300 net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors The io.*_lo_hi() variants are not strictly needed on the x86 hardware and especially the PCI bus. Replace them with regular accessors, but leave headers in place in case of 32-bit build. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 0a83299935f047f4a051e2a1d32391d34f4e4fcc Author: Jason Wang Date: Mon Sep 6 21:56:53 2021 +0800 net: qcom/emac: Replace strlcpy with strscpy 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: David S. Miller commit fe63339ef36bfb1cc12962015a9b254170eea057 Author: Willem de Bruijn Date: Mon Sep 6 10:27:38 2021 -0400 ip6_gre: Revert "ip6_gre: add validation for csum_start" This reverts commit 9cf448c200ba9935baa94e7a0964598ce947db9d. This commit was added for equivalence with a similar fix to ip_gre. That fix proved to have a bug. Upon closer inspection, ip6_gre is not susceptible to the original bug. So revert the unnecessary extra check. In short, ipgre_xmit calls skb_pull to remove ipv4 headers previously inserted by dev_hard_header. ip6gre_tunnel_xmit does not. Link: https://lore.kernel.org/netdev/CA+FuTSe+vJgTVLc9SojGuN-f9YQ+xWLPKE_S4f=f+w+_P2hgUg@mail.gmail.com/#t Fixes: 9cf448c200ba ("ip6_gre: add validation for csum_start") Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit f8416aa29185468e0d914ba4b2a330fd53ee263f Author: Cai Huoqing Date: Mon Sep 6 19:23:02 2021 +0800 kernel: debug: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210906112302.937-1-caihuoqing@baidu.com Signed-off-by: Daniel Thompson commit a61cb6017df0a9be072a35259e6e9ae7aa0ef6b3 Author: Christoph Hellwig Date: Mon Sep 6 14:40:00 2021 +0200 dma-mapping: fix the kerneldoc for dma_map_sg_attrs Add the missing description for the nents parameter, and fix a trivial misalignment. Fixes: fffe3cc8c219 ("dma-mapping: allow map_sg() ops to return negative error codes") Reported-by: Stephen Rothwell Signed-off-by: Christoph Hellwig commit 109bbba5066b42431399b40e947243f049d8dc8d Author: Peter Xu Date: Wed Sep 1 19:09:04 2021 -0400 KVM: Drop unused kvm_dirty_gfn_invalid() Drop the unused function as reported by test bot. Reported-by: kernel test robot Signed-off-by: Peter Xu Message-Id: <20210901230904.15164-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 0c0383918a3ec4250e318cdbdd32e1caef12c14c Author: chongjiapeng Date: Mon Sep 6 17:51:59 2021 +0800 net: hns3: make hclgevf_cmd_caps_bit_map0 and hclge_cmd_caps_bit_map0 static This symbols is not used outside of hclge_cmd.c and hclgevf_cmd.c, so marks it static. Fix the following sparse warning: drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c:345:35: warning: symbol 'hclgevf_cmd_caps_bit_map0' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c:365:33: warning: symbol 'hclge_cmd_caps_bit_map0' was not declared. Should it be static? Reported-by: Abaci Robot Signed-off-by: chongjiapeng Signed-off-by: David S. Miller commit b109398a2206bf4bd3f6cb4fe678735387574d79 Merge: e0b6417be0885 4a9c93dc47de3 Author: David S. Miller Date: Mon Sep 6 13:12:09 2021 +0100 Merge branch 'bonding-fix' Jussi Maki says: ==================== bonding: Fix negative jump count reported by syzbot This patch set fixes a negative jump count warning encountered by syzbot [1] and extends the tests to cover nested bonding devices. [1]: https://lore.kernel.org/lkml/0000000000000a9f3605cb1d2455@google.com/ ==================== Signed-off-by: David S. Miller commit 4a9c93dc47de335880ce7347e6aa006d8f33265a Author: Jussi Maki Date: Mon Sep 6 10:56:38 2021 +0200 selftests/bpf: Test XDP bonding nest and unwind Modify the test to check that enslaving a bond slave with a XDP program is now allowed. Extend attach test to exercise the program unwinding in bond_xdp_set and add a new test for loading XDP program on doubly nested bond device to verify that static key incr/decr is correct. Signed-off-by: Jussi Maki Signed-off-by: David S. Miller commit 6d5f1ef838683efba01bacb7854f6516fbcbae17 Author: Jussi Maki Date: Mon Sep 6 10:56:37 2021 +0200 bonding: Fix negative jump label count on nested bonding With nested bonding devices the nested bond device's ndo_bpf was called without a program causing it to decrement the static key without a prior increment leading to negative count. Fix the issue by 1) only calling slave's ndo_bpf when there's a program to be loaded and 2) only decrement the count when a program is unloaded. Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver") Reported-by: syzbot+30622fb04ddd72a4d167@syzkaller.appspotmail.com Signed-off-by: Jussi Maki Signed-off-by: David S. Miller commit e0b6417be08850646d4e44ef1123772ec786baea Author: Stefano Garzarella Date: Mon Sep 6 11:11:59 2021 +0200 MAINTAINERS: add VM SOCKETS (AF_VSOCK) entry Add a new entry for VM Sockets (AF_VSOCK) that covers vsock core, tests, and headers. Move some general vsock stuff from virtio-vsock entry into this new more general vsock entry. I've been reviewing and contributing for the last few years, so I'm available to help maintain this code. Cc: Dexuan Cui Cc: Jorgen Hansen Cc: Stefan Hajnoczi Suggested-by: Michael S. Tsirkin Signed-off-by: Stefano Garzarella Signed-off-by: David S. Miller commit 5289de5929d1758a95477a4d160195397ccffa7b Author: zhaoxiao Date: Mon Sep 6 15:21:07 2021 +0800 stmmac: dwmac-loongson:Fix missing return value Add the return value when phy_mode < 0. Signed-off-by: zhaoxiao Signed-off-by: David S. Miller commit a9667ac88e2b20f6426e09945e9dbf555fb86ff0 Author: Miklos Szeredi Date: Wed Sep 1 12:39:02 2021 +0200 fuse: remove unused arg in fuse_write_file_get() The struct fuse_conn argument is not used and can be removed. Signed-off-by: Miklos Szeredi commit 660585b56e63ca034ad506ea53c807c5cdca3196 Author: Miklos Szeredi Date: Wed Sep 1 12:39:02 2021 +0200 fuse: wait for writepages in syncfs In case of fuse the MM subsystem doesn't guarantee that page writeback completes by the time ->sync_fs() is called. This is because fuse completes page writeback immediately to prevent DoS of memory reclaim by the userspace file server. This means that fuse itself must ensure that writes are synced before sending the SYNCFS request to the server. Introduce sync buckets, that hold a counter for the number of outstanding write requests. On syncfs replace the current bucket with a new one and wait until the old bucket's counter goes down to zero. It is possible to have multiple syncfs calls in parallel, in which case there could be more than one waited-on buckets. Descendant buckets must not complete until the parent completes. Add a count to the child (new) bucket until the (parent) old bucket completes. Use RCU protection to dereference the current bucket and to wake up an emptied bucket. Use fc->lock to protect against parallel assignments to the current bucket. This leaves just the counter to be a possible scalability issue. The fc->num_waiting counter has a similar issue, so both should be addressed at the same time. Reported-by: Amir Goldstein Fixes: 2d82ab251ef0 ("virtiofs: propagate sync() to file server") Cc: # v5.14 Signed-off-by: Miklos Szeredi commit 7bc7f61897b66bef78bb5952e3d1e9f3aaf9ccca Author: Xie Yongji Date: Tue Aug 31 18:36:34 2021 +0800 Documentation: Add documentation for VDUSE VDUSE (vDPA Device in Userspace) is a framework to support implementing software-emulated vDPA devices in userspace. This document is intended to clarify the VDUSE design and usage. Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-14-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit c8a6153b6c59d95c0e091f053f6f180952ade91e Author: Xie Yongji Date: Tue Aug 31 18:36:33 2021 +0800 vduse: Introduce VDUSE - vDPA Device in Userspace This VDUSE driver enables implementing software-emulated vDPA devices in userspace. The vDPA device is created by ioctl(VDUSE_CREATE_DEV) on /dev/vduse/control. Then a char device interface (/dev/vduse/$NAME) is exported to userspace for device emulation. In order to make the device emulation more secure, the device's control path is handled in kernel. A message mechnism is introduced to forward some dataplane related control messages to userspace. And in the data path, the DMA buffer will be mapped into userspace address space through different ways depending on the vDPA bus to which the vDPA device is attached. In virtio-vdpa case, the MMU-based software IOTLB is used to achieve that. And in vhost-vdpa case, the DMA buffer is reside in a userspace memory region which can be shared to the VDUSE userspace processs via transferring the shmfd. For more details on VDUSE design and usage, please see the follow-on Documentation commit. NB(mst): when merging this with b542e383d8c0 ("eventfd: Make signal recursion protection a task bit") replace eventfd_signal_count with eventfd_signal_allowed, and drop the previous ("eventfd: Export eventfd_wake_count to modules"). Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-13-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 8c773d53fb7b64267b0f55c1d3517cb8c5e29b3c Author: Xie Yongji Date: Tue Aug 31 18:36:32 2021 +0800 vduse: Implement an MMU-based software IOTLB This implements an MMU-based software IOTLB to support mapping kernel dma buffer into userspace dynamically. The basic idea behind it is treating MMU (VA->PA) as IOMMU (IOVA->PA). The software IOTLB will set up MMU mapping instead of IOMMU mapping for the DMA transfer so that the userspace process is able to use its virtual address to access the dma buffer in kernel. To avoid security issue, a bounce-buffering mechanism is introduced to prevent userspace accessing the original buffer directly which may contain other kernel data. During the mapping, unmapping, the software IOTLB will copy the data from the original buffer to the bounce buffer and back, depending on the direction of the transfer. And the bounce-buffer addresses will be mapped into the user address space instead of the original one. Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-12-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit d8945ec411209272bcd4ae9e75ea1b078257e492 Author: Xie Yongji Date: Tue Aug 31 18:36:31 2021 +0800 vdpa: Support transferring virtual addressing during DMA mapping This patch introduces an attribute for vDPA device to indicate whether virtual address can be used. If vDPA device driver set it, vhost-vdpa bus driver will not pin user page and transfer userspace virtual address instead of physical address during DMA mapping. And corresponding vma->vm_file and offset will be also passed as an opaque pointer. Suggested-by: Jason Wang Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-11-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 22af48cf91aae5f2fd32fe811d9be1c52d7a801b Author: Xie Yongji Date: Tue Aug 31 18:36:30 2021 +0800 vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap() The upcoming patch is going to support VA mapping/unmapping. So let's factor out the logic of PA mapping/unmapping firstly to make the code more readable. Suggested-by: Jason Wang Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-10-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit c10fb9454adc80c062151c6a436047e1fa59e99f Author: Xie Yongji Date: Tue Aug 31 18:36:29 2021 +0800 vdpa: Add an opaque pointer for vdpa_config_ops.dma_map() Add an opaque pointer for DMA mapping. Suggested-by: Jason Wang Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-9-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 59dfe4f1e810b5820443c84f9863b04b033143e8 Author: Xie Yongji Date: Tue Aug 31 18:36:28 2021 +0800 vhost-iotlb: Add an opaque pointer for vhost IOTLB Add an opaque pointer for vhost IOTLB. And introduce vhost_iotlb_add_range_ctx() to accept it. Suggested-by: Jason Wang Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-8-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 7f05630dc65d62df5d55ad3e1038ffbe5e2ce9c3 Author: Xie Yongji Date: Tue Aug 31 18:36:27 2021 +0800 vhost-vdpa: Handle the failure of vdpa_reset() The vdpa_reset() may fail now. This adds check to its return value and fail the vhost_vdpa_open(). Signed-off-by: Xie Yongji Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210831103634.33-7-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 0686082dbf7a204ca0fab326a820779e31666639 Author: Xie Yongji Date: Tue Aug 31 18:36:26 2021 +0800 vdpa: Add reset callback in vdpa_config_ops This adds a new callback to support device specific reset behavior. The vdpa bus driver will call the reset function instead of setting status to zero during resetting. Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210831103634.33-6-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 86e17a51c1a5a299009f8b1645e3e9da0d59faae Author: Xie Yongji Date: Tue Aug 31 18:36:25 2021 +0800 vdpa: Fix some coding style issues Fix some code indent issues and following checkpatch warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' 371: FILE: include/linux/vdpa.h:371: +static inline void vdpa_get_config(struct vdpa_device *vdev, unsigned offset, Signed-off-by: Xie Yongji Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210831103634.33-5-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 9c930054f2f5326d59ee4bf8d7d1cf6c82f5643b Author: Xie Yongji Date: Tue Aug 31 18:36:24 2021 +0800 file: Export receive_fd() to modules Export receive_fd() so that some modules can use it to pass file descriptor between processes without missing any security stuffs. Signed-off-by: Xie Yongji Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210831103634.33-4-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 7a6b92d33ab166c6ea6e5764033ca99dcb6ec361 Author: Xie Yongji Date: Tue Aug 31 18:36:23 2021 +0800 eventfd: Export eventfd_wake_count to modules Export eventfd_wake_count so that some modules can use the eventfd_signal_count() to check whether the eventfd_signal() call should be deferred to a safe context. NB(mst): this patch is not needed in Linus tree since there eventfd_signal_count() has been superseded by an already exported eventfd_signal_allowed(). Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210831103634.33-3-xieyongji@bytedance.com Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin commit a93a962669cdbe56bb0bcd88156f0f1598f31c88 Author: Xie Yongji Date: Tue Aug 31 18:36:22 2021 +0800 iova: Export alloc_iova_fast() and free_iova_fast() Export alloc_iova_fast() and free_iova_fast() so that some modules can make use of the per-CPU cache to get rid of rbtree spinlock in alloc_iova() and free_iova() during IOVA allocation. Signed-off-by: Xie Yongji Acked-by: Jason Wang Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210831103634.33-2-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit 6105d1fe6f4c24ce8c13e2e6568b16b76e04983d Author: Max Gurtovoy Date: Sun Sep 5 11:57:17 2021 +0300 virtio-blk: remove unneeded "likely" statements Usually we use "likely/unlikely" to optimize the fast path. Remove redundant "likely/unlikely" statements in the control path to simplify the code and make it easier to read. Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Gurtovoy Link: https://lore.kernel.org/r/20210905085717.7427-1-mgurtovoy@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Stefan Hajnoczi commit 81a83d7f4cfcb255c040df09ce83249fabf8733a Author: Xianting Tian Date: Fri Jul 23 13:42:59 2021 +0800 virtio-balloon: Use virtio_find_vqs() helper Use the helper virtio_find_vqs(). Signed-off-by: Xianting Tian Reviewed-by: David Hildenbrand Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210723054259.2779-1-xianting.tian@linux.alibaba.com Signed-off-by: Michael S. Tsirkin commit d9130a2dfdd4b21736c91b818f87dbc0ccd1e757 Author: Zelin Deng Date: Wed Apr 28 10:22:01 2021 +0800 KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted When MSR_IA32_TSC_ADJUST is written by guest due to TSC ADJUST feature especially there's a big tsc warp (like a new vCPU is hot-added into VM which has been up for a long time), tsc_offset is added by a large value then go back to guest. This causes system time jump as tsc_timestamp is not adjusted in the meantime and pvclock monotonic character. To fix this, just notify kvm to update vCPU's guest time before back to guest. Cc: stable@vger.kernel.org Signed-off-by: Zelin Deng Signed-off-by: Paolo Bonzini Message-Id: <1619576521-81399-2-git-send-email-zelin.deng@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit 4ac214574d2d83b7ef20c603d75f1937c912bfd6 Author: Paolo Bonzini Date: Mon Sep 6 05:52:23 2021 -0400 KVM: MMU: mark role_regs and role accessors as maybe unused It is reasonable for these functions to be used only in some configurations, for example only if the host is 64-bits (and therefore supports 64-bit guests). It is also reasonable to keep the role_regs and role accessors in sync even though some of the accessors may be used only for one of the two sets (as is the case currently for CR4.LA57).. Because clang reports warnings for unused inlines declared in a .c file, mark both sets of accessors as __maybe_unused. Reported-by: kernel test robot Signed-off-by: Paolo Bonzini commit a3cf527e70bd1553500746ef2f38db41e2af1d9e Author: Huacai Chen Date: Tue Apr 6 10:49:11 2021 +0800 KVM: MIPS: Remove a "set but not used" variable This fix a build warning: arch/mips/kvm/vz.c: In function '_kvm_vz_restore_htimer': >> arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used [-Wunused-but-set-variable] 392 | ktime_t freeze_time; | ^~~~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Huacai Chen Message-Id: <20210406024911.2008046-1-chenhuacai@loongson.cn> Signed-off-by: Paolo Bonzini commit e99314a340d27efafab3b7ea226beb239162cd46 Merge: 0d0a19395baa3 419025b3b4190 Author: Paolo Bonzini Date: Mon Sep 6 06:34:11 2021 -0400 Merge tag 'kvmarm-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for 5.15 - Page ownership tracking between host EL1 and EL2 - Rely on userspace page tables to create large stage-2 mappings - Fix incompatibility between pKVM and kmemleak - Fix the PMU reset state, and improve the performance of the virtual PMU - Move over to the generic KVM entry code - Address PSCI reset issues w.r.t. save/restore - Preliminary rework for the upcoming pKVM fixed feature - A bunch of MM cleanups - a vGIC fix for timer spurious interrupts - Various cleanups commit 0d0a19395baa36ab186df8081ab7f7b57c3fade1 Merge: a40b2fd064bb7 a3e03bc1368c1 Author: Paolo Bonzini Date: Mon Sep 6 06:33:40 2021 -0400 Merge tag 'kvm-s390-next-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fix and feature for 5.15 - enable interpretion of specification exceptions - fix a vcpu_idx vs vcpu_id mixup commit a40b2fd064bb7c0425c7cbdca2120cf0609a90a2 Author: Lai Jiangshan Date: Sat Aug 14 11:51:29 2021 +0800 x86/kvm: Don't enable IRQ when IRQ enabled in kvm_wait Commit f4e61f0c9add3 ("x86/kvm: Fix broken irq restoration in kvm_wait") replaced "local_irq_restore() when IRQ enabled" with "local_irq_enable() when IRQ enabled" to suppress a warnning. Although there is no similar debugging warnning for doing local_irq_enable() when IRQ enabled as doing local_irq_restore() in the same IRQ situation. But doing local_irq_enable() when IRQ enabled is no less broken as doing local_irq_restore() and we'd better avoid it. Cc: Mark Rutland Cc: Peter Zijlstra (Intel) Signed-off-by: Lai Jiangshan Message-Id: <20210814035129.154242-1-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 3cc4e148b96263313e3dce926eae569c942bb74e Author: Jing Zhang Date: Tue Aug 17 00:26:39 2021 +0000 KVM: stats: Add VM stat for remote tlb flush requests Add a new stat that counts the number of times a remote TLB flush is requested, regardless of whether it kicks vCPUs out of guest mode. This allows us to look at how often flushes are initiated. Unlike remote_tlb_flush, this one applies to ARM's instruction-set-based TLB flush implementation, so apply it there too. Original-by: David Matlack Signed-off-by: Jing Zhang Message-Id: <20210817002639.3856694-1-jingzhangos@google.com> Signed-off-by: Paolo Bonzini commit fdde13c13f9012b22e1b3a1df8a108d147842f6f Author: Sean Christopherson Date: Thu Sep 2 10:59:51 2021 -0700 KVM: Remove unnecessary export of kvm_{inc,dec}_notifier_count() Don't export KVM's MMU notifier count helpers, under no circumstance should any downstream module, including x86's vendor code, have a legitimate reason to piggyback KVM's MMU notifier logic. E.g in the x86 case, only KVM's MMU should be elevating the notifier count, and that code is always built into the core kvm.ko module. Fixes: edb298c663fc ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range") Cc: Maxim Levitsky Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20210902175951.1387989-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1148bfc47be3f885a10945ecbc1e3789a0313603 Author: Sean Christopherson Date: Wed Sep 1 15:10:23 2021 -0700 KVM: x86/mmu: Move lpage_disallowed_link further "down" in kvm_mmu_page Move "lpage_disallowed_link" out of the first 64 bytes, i.e. out of the first cache line, of kvm_mmu_page so that "spt" and to a lesser extent "gfns" land in the first cache line. "lpage_disallowed_link" is accessed relatively infrequently compared to "spt", which is accessed any time KVM is walking and/or manipulating the shadow page tables. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210901221023.1303578-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ca41c34cab1f50f13ab5ac95739483871637a684 Author: Sean Christopherson Date: Wed Sep 1 15:10:22 2021 -0700 KVM: x86/mmu: Relocate kvm_mmu_page.tdp_mmu_page for better cache locality Move "tdp_mmu_page" into the 1-byte void left by the recently removed "mmio_cached" so that it resides in the first 64 bytes of kvm_mmu_page, i.e. in the same cache line as the most commonly accessed fields. Don't bother wrapping tdp_mmu_page in CONFIG_X86_64, including the field in 32-bit builds doesn't affect the size of kvm_mmu_page, and a future patch can always wrap the field in the unlikely event KVM gains a 1-byte flag that is 32-bit specific. Note, the size of kvm_mmu_page is also unchanged on CONFIG_X86_64=y due to it previously sharing an 8-byte chunk with write_flooding_count. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210901221023.1303578-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e7177339d7b5f9594b316842122b5fda9513d5e2 Author: Sean Christopherson Date: Tue Aug 31 09:42:22 2021 -0700 Revert "KVM: x86: mmu: Add guest physical address check in translate_gpa()" Revert a misguided illegal GPA check when "translating" a non-nested GPA. The check is woefully incomplete as it does not fill in @exception as expected by all callers, which leads to KVM attempting to inject a bogus exception, potentially exposing kernel stack information in the process. WARNING: CPU: 0 PID: 8469 at arch/x86/kvm/x86.c:525 exception_type+0x98/0xb0 arch/x86/kvm/x86.c:525 CPU: 1 PID: 8469 Comm: syz-executor531 Not tainted 5.14.0-rc7-syzkaller #0 RIP: 0010:exception_type+0x98/0xb0 arch/x86/kvm/x86.c:525 Call Trace: x86_emulate_instruction+0xef6/0x1460 arch/x86/kvm/x86.c:7853 kvm_mmu_page_fault+0x2f0/0x1810 arch/x86/kvm/mmu/mmu.c:5199 handle_ept_misconfig+0xdf/0x3e0 arch/x86/kvm/vmx/vmx.c:5336 __vmx_handle_exit arch/x86/kvm/vmx/vmx.c:6021 [inline] vmx_handle_exit+0x336/0x1800 arch/x86/kvm/vmx/vmx.c:6038 vcpu_enter_guest+0x2a1c/0x4430 arch/x86/kvm/x86.c:9712 vcpu_run arch/x86/kvm/x86.c:9779 [inline] kvm_arch_vcpu_ioctl_run+0x47d/0x1b20 arch/x86/kvm/x86.c:10010 kvm_vcpu_ioctl+0x49e/0xe50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3652 The bug has escaped notice because practically speaking the GPA check is useless. The GPA check in question only comes into play when KVM is walking guest page tables (or "translating" CR3), and KVM already handles illegal GPA checks by setting reserved bits in rsvd_bits_mask for each PxE, or in the case of CR3 for loading PTDPTRs, manually checks for an illegal CR3. This particular failure doesn't hit the existing reserved bits checks because syzbot sets guest.MAXPHYADDR=1, and IA32 architecture simply doesn't allow for such an absurd MAXPHYADDR, e.g. 32-bit paging doesn't define any reserved PA bits checks, which KVM emulates by only incorporating the reserved PA bits into the "high" bits, i.e. bits 63:32. Simply remove the bogus check. There is zero meaningful value and no architectural justification for supporting guest.MAXPHYADDR < 32, and properly filling the exception would introduce non-trivial complexity. This reverts commit ec7771ab471ba6a945350353617e2e3385d0e013. Fixes: ec7771ab471b ("KVM: x86: mmu: Add guest physical address check in translate_gpa()") Cc: stable@vger.kernel.org Reported-by: syzbot+200c08e88ae818f849ce@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20210831164224.1119728-2-seanjc@google.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 678a305b85d95f288c12e3d69a32d3351b34f2bb Author: Jia He Date: Mon Aug 30 22:53:36 2021 +0800 KVM: x86/mmu: Remove unused field mmio_cached in struct kvm_mmu_page After reverting and restoring the fast tlb invalidation patch series, the mmio_cached is not removed. Hence a unused field is left in kvm_mmu_page. Cc: Sean Christopherson Signed-off-by: Jia He Message-Id: <20210830145336.27183-1-justin.he@arm.com> Signed-off-by: Paolo Bonzini commit 1dbaf04cb91b2b680d10f9a8f9f823d94c7087bf Author: Eduardo Habkost Date: Fri Sep 3 17:16:00 2021 -0400 kvm: x86: Increase KVM_SOFT_MAX_VCPUS to 710 Support for 710 VCPUs was tested by Red Hat since RHEL-8.4, so increase KVM_SOFT_MAX_VCPUS to 710. Signed-off-by: Eduardo Habkost Message-Id: <20210903211600.2002377-4-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini commit 074c82c8f7cf8a46c3b81965f122599e3a133450 Author: Eduardo Habkost Date: Fri Sep 3 17:15:59 2021 -0400 kvm: x86: Increase MAX_VCPUS to 1024 Increase KVM_MAX_VCPUS to 1024, so we can test larger VMs. I'm not changing KVM_SOFT_MAX_VCPUS yet because I'm afraid it might involve complicated questions around the meaning of "supported" and "recommended" in the upstream tree. KVM_SOFT_MAX_VCPUS will be changed in a separate patch. For reference, visible effects of this change are: - KVM_CAP_MAX_VCPUS will now return 1024 (of course) - Default value for CPUID[HYPERV_CPUID_IMPLEMENT_LIMITS (00x40000005)].EAX will now be 1024 - KVM_MAX_VCPU_ID will change from 1151 to 4096 - Size of struct kvm will increase from 19328 to 22272 bytes (in x86_64) - Size of struct kvm_ioapic will increase from 1780 to 5084 bytes (in x86_64) - Bitmap stack variables that will grow: - At kvm_hv_flush_tlb() kvm_hv_send_ipi(), vp_bitmap[] and vcpu_bitmap[] will now be 128 bytes long - vcpu_bitmap at bioapic_write_indirect() will be 128 bytes long once patch "KVM: x86: Fix stack-out-of-bounds memory access from ioapic_write_indirect()" is applied Signed-off-by: Eduardo Habkost Message-Id: <20210903211600.2002377-3-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini commit 4ddacd525a2f16cebec8ba409fbce6b6fb45e987 Author: Eduardo Habkost Date: Fri Sep 3 17:15:58 2021 -0400 kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUS Instead of requiring KVM_MAX_VCPU_ID to be manually increased every time we increase KVM_MAX_VCPUS, set it to 4*KVM_MAX_VCPUS. This should be enough for CPU topologies where Cores-per-Package and Packages-per-Socket are not powers of 2. In practice, this increases KVM_MAX_VCPU_ID from 1023 to 1152. The only side effect of this change is making some fields in struct kvm_ioapic larger, increasing the struct size from 1628 to 1780 bytes (in x86_64). Signed-off-by: Eduardo Habkost Message-Id: <20210903211600.2002377-2-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini commit e4457a45b41c1c2ec7fb392dc60f4e2386b48a90 Author: Randy Dunlap Date: Fri Aug 20 19:09:01 2021 -0700 iwlwifi: fix printk format warnings in uefi.c The kernel test robot reports printk format warnings in uefi.c, so correct them. ../drivers/net/wireless/intel/iwlwifi/fw/uefi.c: In function 'iwl_uefi_get_pnvm': ../drivers/net/wireless/intel/iwlwifi/fw/uefi.c:52:30: warning: format '%zd' expects argument of type 'signed size_t', but argument 7 has type 'long unsigned int' [-Wformat=] 52 | "PNVM UEFI variable not found %d (len %zd)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | err, package_size); | ~~~~~~~~~~~~ | | | long unsigned int ../drivers/net/wireless/intel/iwlwifi/fw/uefi.c:59:29: warning: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'long unsigned int' [-Wformat=] 59 | IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %zd\n", package_size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ | | | long unsigned int Fixes: 84c3c9952afb ("iwlwifi: move UEFI code to a separate file") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Kalle Valo Cc: Luca Coelho Cc: linux-wireless@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210821020901.25901-1-rdunlap@infradead.org commit 81b4b56d4f8130bbb99cf4e2b48082e5b4cfccb9 Author: Maxim Levitsky Date: Thu Aug 26 12:57:49 2021 +0300 KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation If we are emulating an invalid guest state, we don't have a correct exit reason, and thus we shouldn't do anything in this function. Signed-off-by: Maxim Levitsky Message-Id: <20210826095750.1650467-2-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Fixes: 95b5a48c4f2b ("KVM: VMX: Handle NMIs, #MCs and async #PFs in common irqs-disabled fn", 2019-06-18) Signed-off-by: Paolo Bonzini commit a717a780fc4e1dddd3fbf9ad08f180eec2a78194 Author: Sean Christopherson Date: Mon Aug 23 17:58:24 2021 -0700 KVM: x86/mmu: Don't freak out if pml5_root is NULL on 4-level host Include pml5_root in the set of special roots if and only if the host, and thus NPT, is using 5-level paging. mmu_alloc_special_roots() expects special roots to be allocated as a bundle, i.e. they're either all valid or all NULL. But for pml5_root, that expectation only holds true if the host uses 5-level paging, which causes KVM to WARN about pml5_root being NULL when the other special roots are valid. The silver lining of 4-level vs. 5-level NPT being tied to the host kernel's paging level is that KVM's shadow root level is constant; unlike VMX's EPT, KVM can't choose 4-level NPT based on guest.MAXPHYADDR. That means KVM can still expect pml5_root to be bundled with the other special roots, it just needs to be conditioned on the shadow root level. Fixes: cb0f722aff6e ("KVM: x86/mmu: Support shadowing NPT when 5-level paging is enabled in host") Reported-by: Maxim Levitsky Reviewed-by: Maxim Levitsky Signed-off-by: Sean Christopherson Message-Id: <20210824005824.205536-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4855e26bcf4d28956f3e33231b961610a0d4a72d Author: Hector.Yuan Date: Fri Sep 3 16:39:24 2021 +0800 cpufreq: mediatek-hw: Add support for CPUFREQ HW Introduce cpufreq HW driver which can support CPU frequency adjust in MT6779 platform. Signed-off-by: Hector.Yuan [ Viresh: Massaged the patch and cleaned some stuff. ] Signed-off-by: Viresh Kumar commit 8486a32dd484a7d7ec25295c7439094608f54915 Author: Hector.Yuan Date: Fri Sep 3 16:39:23 2021 +0800 cpufreq: Add of_perf_domain_get_sharing_cpumask Add of_perf_domain_get_sharing_cpumask function to group cpu to specific performance domain. Signed-off-by: Hector.Yuan [ Viresh: create separate routine parse_perf_domain() and always set the cpumask. ] Signed-off-by: Viresh Kumar commit a8bbe0c9440561cb407cefc0b1def808c2c38431 Author: Hector.Yuan Date: Fri Sep 3 16:39:22 2021 +0800 dt-bindings: cpufreq: add bindings for MediaTek cpufreq HW Add devicetree bindings for MediaTek HW driver. Signed-off-by: Hector.Yuan Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar commit c2f24933a18ac9098a758cb3edfff6503ed5c55d Author: Rafał Miłecki Date: Tue Jul 13 11:47:45 2021 +0200 dt-bindings: mfd: Add Broadcom CRU CRU is a block used in e.g. Northstar devices. It can be seen in the bcm5301x.dtsi and this binding documents its proper usage. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit aff959c2840858d55d9ee155d555b3aa7e068b32 Author: Chaitanya Kulkarni Date: Sun Sep 5 19:26:01 2021 -0700 nvme: update MAINTAINERS email address Update the MAINTAINERS file email address. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit ab3994f6efba95e0832dc9e68c088b2d7ae764b8 Author: Luis Chamberlain Date: Mon Aug 30 14:25:33 2021 -0700 nvme: add error handling support for add_disk() We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Signed-off-by: Luis Chamberlain Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 041bd1a1fc737cd73b0b8a9f74909191a8acc9fe Author: Daniel Wagner Date: Wed Sep 1 11:25:24 2021 +0200 nvme: only call synchronize_srcu when clearing current path The function nmve_mpath_clear_current_path returns true if the current path has changed. In this case we have to wait for all concurrent submissions to finish. But if we didn't change the current path, there is no point in waiting for another RCU period to finish. Signed-off-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit b58da2d270dbcc67db73f15028774d27c85e16d7 Author: Tatsuya Sasaki Date: Wed Sep 1 08:23:42 2021 +0000 nvme: update keep alive interval when kato is modified Currently the connection between host and NVMe-oF target gets disconnected by keep-alive timeout when a user connects to a target with a relatively large kato value and then sets the smaller kato with a set features command (e.g. connects with 60 seconds kato value and then sets 10 seconds kato value). The cause is that keep alive command interval on the host, which is defined as unsigned int kato in nvme_ctrl structure, does not follow the kato value changes. This patch updates the keep alive interval in the following steps when the kato is modified by a set features command: stops the keep alive work queue, then sets the kato as new timer value and re-start the queue. Signed-off-by: Tatsuya Sasaki Signed-off-by: Christoph Hellwig commit 1ba2e507f55c5b0cbde8c0fbfe0d9e39612a3e52 Author: Daniel Wagner Date: Mon Aug 30 15:36:26 2021 +0200 nvme-tcp: Do not reset transport on data digest errors The spec says 7.4.6.1 Digest Error handling When a host detects a data digest error in a C2HData PDU, that host shall continue processing C2HData PDUs associated with the command and when the command processing has completed, if a successful status was returned by the controller, the host shall fail the command with a non-fatal transport error. Currently the transport is reseted when a data digest error is detected. Instead, when a digest error is detected, mark the final status as NVME_SC_DATA_XFER_ERROR and let the upper layer handle the error. In order to keep track of the final result maintain a status field in nvme_tcp_request object and use it to overwrite the completion queue status (which might be successful even though a digest error has been detected) when completing the request. Signed-off-by: Daniel Wagner Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit f04064814c2a15c22ed9c803f9b634ef34f91092 Author: Hannes Reinecke Date: Mon Sep 6 09:04:03 2021 +0200 nvmet: fixup buffer overrun in nvmet_subsys_attr_serial() The serial number is copied into the buffer via memcpy_and_pad() with the length NVMET_SN_MAX_SIZE. So when printing out we also need to take just that length as anything beyond that will be uninitialized. Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit ab7a2737ac5acd7d485ca45d8772497717fbc781 Author: Christoph Hellwig Date: Fri Aug 27 08:11:12 2021 +0200 nvmet: return bool from nvmet_passthru_ctrl and nvmet_is_passthru_req The target core code never needs the host-side nvme_ctrl structure. Open code two uses of nvmet_is_passthru_req in passthru.c, and then switch the helpers used by the core to return bool. Also rename the fuctions to better match their usage: nvmet_passthru_ctrl -> nvmet_is_passthru_subsys nvmet_req_passthru_ctrl -> nvmet_is_passthru_req Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg commit 77d651a65569a5e60f314b768500e94fcb936311 Author: Adam Manzanares Date: Thu Aug 26 21:15:45 2021 +0000 nvmet: looks at the passthrough controller when initializing CAP For a passthru controller make cap initialization dependent on the cap of the passthru controller, given that multiple Command Set support needs to be supported by the underlying controller. For that move the initialization of CAP later so that it can use the fully initialized nvmet_ctrl structure. Fixes: ab5d0b38c047 (nvmet: add Command Set Identifier support) Signed-off-by: Adam Manzanares Reviewed-by: Keith Busch [hch: refactored the code a bit to keep it more contained in passthru.c] Signed-off-by: Christoph Hellwig commit 43dc987828eabf915858b1ac37a8e67fa8004349 Author: Adam Manzanares Date: Thu Aug 26 21:15:45 2021 +0000 nvme: move nvme_multi_css into nvme.h Preparatory patch in order to reuse nvme_multi_css in the nvme target code. Signed-off-by: Adam Manzanares Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit e7d65803e2bb5bc739548b67a5fc72c626cf7e3b Author: Hannes Reinecke Date: Tue Aug 24 16:57:42 2021 +0200 nvme-multipath: revalidate paths during rescan When triggering a rescan due to a namespace resize we will be receiving AENs on every controller, triggering a rescan of all attached namespaces. If multipath is active only the current path and the ns_head disk will be updated, the other paths will still refer to the old size until AENs for the remaining controllers are received. If I/O comes in before that it might be routed to one of the old paths, triggering an I/O failure with 'access beyond end of device'. With this patch the old paths are skipped from multipath path selection until the controller serving these paths has been rescanned. Signed-off-by: Hannes Reinecke [dwagner: - introduce NVME_NS_READY flag instead of NVME_NS_INVALIDATE - use 'revalidate' instead of 'invalidate' which follows the zoned device code path. - clear NVME_NS_READY before clearing current_path] Signed-off-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit d32d3d0b47f7e34560ae3c55ddfcf68694813501 Author: Christoph Hellwig Date: Mon Jun 14 13:17:34 2021 +0200 nvme-multipath: set QUEUE_FLAG_NOWAIT The nvme multipathing code just dispatches bios to one of the blk-mq based paths and never blocks on its own, so set QUEUE_FLAG_NOWAIT to support REQ_NOWAIT bios. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg commit 132c88614f2b3548cd3c8979a434609019db4151 Author: Nicolas Dufresne Date: Thu Aug 19 16:00:09 2021 +0200 media: cedrus: Fix SUNXI tile size calculation Tiled formats requires full rows being allocated (even for Chroma planes). When the number of Luma tiles is odd, we need to round up to twice the tile width in order to roundup the number of Chroma tiles. This was notice with a crash running BA1_FT_C compliance test using sunxi tiles using GStreamer. Cedrus driver would allocate 9 rows for Luma, but only 4.5 rows for Chroma, causing userspace to crash. Signed-off-by: Nicolas Dufresne Fixes: 50e761516f2b8 ("media: platform: Add Cedrus VPU decoder driver") Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 31692ab9a9ef0119959f66838de74eeb37490c8d Author: Jernej Skrabec Date: Thu Aug 5 21:04:16 2021 +0200 media: hantro: Fix check for single irq Some cores use only one interrupt and in such case interrupt name in DT is not needed. Driver supposedly accounted that, but due to the wrong field check it never worked. Fix that. Fixes: 18d6c8b7b4c9 ("media: hantro: add fallback handling for single irq/clk") Signed-off-by: Jernej Skrabec Reviewed-by: Ezequiel Garcia Reviewed-by: Emil Velikov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1645cca9da91a85167394a34fcfe1cb5dd336d7f Author: Stephen Rothwell Date: Fri Aug 20 12:33:48 2021 +1000 drm/i915: use linux/stddef.h due to "isystem: trim/fixup stdarg.h and other headers" After merging the drm tree, today's linux-next build (x86_64 allmodconfig) failed like this: In file included from drivers/gpu/drm/i915/i915_debugfs.c:39: drivers/gpu/drm/i915/gt/intel_gt_requests.h:9:10: fatal error: stddef.h: No such file or directory 9 | #include | ^~~~~~~~~~ Caused by commit 564f963eabd1 ("isystem: delete global -isystem compile option") from the kbuild tree interacting with commit b97060a99b01 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC") Fixes: b97060a99b01 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC") Signed-off-by: Stephen Rothwell Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210820123348.6535a87e@canb.auug.org.au commit 729ce5a5bd6fda5eb2322a39db2287f1f26f92f3 Author: Cai Huoqing Date: Mon Aug 2 09:37:17 2021 +0800 vdpa: Make use of PFN_PHYS/PFN_UP/PFN_DOWN helper macro it's a nice refactor to make use of PFN_PHYS/PFN_UP/PFN_DOWN helper macro Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210802013717.851-1-caihuoqing@baidu.com Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin commit 0e115c45ee0b86172d910588dd41632f1a2c0199 Author: Arseny Krasnov Date: Fri Sep 3 15:33:18 2021 +0300 vsock_test: update message bounds test for MSG_EOR Set 'MSG_EOR' in one of message sent, check that 'MSG_EOR' is visible in corresponding message at receiver. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210903123321.3273866-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin commit 8fc92b7c15f04fb50ce414cbeba7b326e07fcf86 Author: Arseny Krasnov Date: Fri Sep 3 15:33:03 2021 +0300 af_vsock: rename variables in receive loop Record is supported via MSG_EOR flag, while current logic operates with message, so rename variables from 'record' to 'message'. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210903123306.3273757-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin commit 146ea9b679c9f3e235f20456be477ccd109ac9bd Author: Oliver Graute Date: Sun Sep 5 19:09:25 2021 -0700 Input: edt-ft5x06 - added case for EDT EP0110M09 Add Support for EP011M09 Firmware Signed-off-by: Oliver Graute Reviewed-by: Marco Felsch Link: https://lore.kernel.org/r/20210813062110.13950-1-oliver.graute@kococonnector.com Signed-off-by: Dmitry Torokhov commit 8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17 Merge: 818b26588994d 3e204d6b76b29 Author: Dmitry Torokhov Date: Sun Sep 5 18:58:05 2021 -0700 Merge branch 'next' into for-linus Prepare input updates for 5.15 merge window. commit 38de3afffb7257176978dfa9b3ab67d0c29af95c Author: Christophe JAILLET Date: Sun Aug 22 16:04:12 2021 +0200 NTB: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Acked-by: Serge Semin Signed-off-by: Jon Mason commit e631548027cae026486300fe93542949df73a87d Author: Colin Ian King Date: Wed Jun 9 12:21:28 2021 +0100 ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data The variables msg_data and spad_data are being initialized with values that are never read, they are being updated later on. The initializations are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Serge Semin Signed-off-by: Jon Mason commit 8d5ac871b556c73b042438dc1c811c554dadca52 Author: Arseny Krasnov Date: Fri Sep 3 15:32:48 2021 +0300 virtio/vsock: support MSG_EOR bit processing If packet has 'EOR' bit - set MSG_EOR in 'recvmsg()' flags. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210903123251.3273639-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin commit 1af7e55511fe194a07f3fa4e77b5b9d10bdd9208 Author: Arseny Krasnov Date: Fri Sep 3 15:32:35 2021 +0300 vhost/vsock: support MSG_EOR bit processing 'MSG_EOR' handling has similar logic as 'MSG_EOM' - if bit present in packet's header, reset it to 0. Then restore it back if packet processing wasn't completed. Instead of bool variable for each flag, bit mask variable was added: it has logical OR of 'MSG_EOR' and 'MSG_EOM' if needed, to restore flags, this variable is ORed with flags field of packet. Signed-off-by: Arseny Krasnov Link: https://lore.kernel.org/r/20210903123238.3273526-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 41116599a0731f4cd451e9d191d879ab45e31945 Author: Arseny Krasnov Date: Fri Sep 3 15:32:23 2021 +0300 virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOR' bit. This bit is used to handle POSIX MSG_EOR flag passed from userspace in 'send*()' system calls. It marks end of each record and is visible to receiver using 'recvmsg()' system call. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210903123225.3273425-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin commit 9af8f1061646e8e22b66413bedf7b3e2ab3d69e5 Author: Arseny Krasnov Date: Fri Sep 3 15:31:06 2021 +0300 virtio/vsock: rename 'EOR' to 'EOM' bit. This current implemented bit is used to mark end of messages ('EOM' - end of message), not records('EOR' - end of record). Also rename 'record' to 'message' in implementation as it is different things. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210903123109.3273053-1-arseny.krasnov@kaspersky.com Signed-off-by: Michael S. Tsirkin commit 694a1116b405d887c893525a6766b390989c8606 Author: Viresh Kumar Date: Tue Jul 27 10:53:52 2021 +0530 virtio: Bind virtio device to device-tree node Bind the virtio devices with their of_node. This will help users of the virtio devices to mention their dependencies on the device in the DT itself. Like GPIO pin users can use the phandle of the device node, or the node may contain more subnodes to add i2c or spi eeproms and other users. Reviewed-by: Arnd Bergmann Signed-off-by: Viresh Kumar Link: https://lore.kernel.org/r/94c12705602929968477aaf27e02439eb7a7f253.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin commit d5a8680dfab0547a4ecd708b1fe9de48598a6757 Author: Viresh Kumar Date: Tue Jul 27 10:53:51 2021 +0530 uapi: virtio_ids: Sync ids with specification This synchronizes the virtio ids with the latest list from virtio specification. Signed-off-by: Viresh Kumar Link: https://lore.kernel.org/r/61b27e3bc61fb0c9f067001e95cfafc5d37d414a.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin commit f3a66dcdf2390f8434622a4e20a1af7413502623 Author: Viresh Kumar Date: Tue Jul 27 10:53:50 2021 +0530 dt-bindings: gpio: Add bindings for gpio-virtio This patch adds binding for virtio GPIO controller, it is based on virtio-device bindings. Reviewed-by: Arnd Bergmann Signed-off-by: Viresh Kumar Link: https://lore.kernel.org/r/acf7402ef4aabc0ad6295c32846f2bef1cd9b56a.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin Reviewed-by: Rob Herring commit 7f815fce08d563006e43d1b7d2f9a0a4f3b832f3 Author: Viresh Kumar Date: Tue Jul 27 10:53:49 2021 +0530 dt-bindings: i2c: Add bindings for i2c-virtio This patch adds binding for virtio I2C device, it is based on virtio-device bindings. Acked-by: Wolfram Sang Reviewed-by: Arnd Bergmann Signed-off-by: Viresh Kumar Link: https://lore.kernel.org/r/33c317b95097ce491845c697db1e8285e3ec1d41.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin Reviewed-by: Rob Herring commit ad93f7b3715449704225feb33d5fbe6507472245 Author: Viresh Kumar Date: Tue Jul 27 10:53:48 2021 +0530 dt-bindings: virtio: Add binding for virtio devices Allow virtio device sub-nodes to be added to the virtio mmio or pci nodes. The compatible property for virtio device must be of the format "virtio,device", where ID is virtio device ID in hexadecimal format. Signed-off-by: Viresh Kumar Link: https://lore.kernel.org/r/d8319fd18df7086b12cdcc23193c313893aa071a.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin Reviewed-by: Arnd Bergmann Reviewed-by: Rob Herring commit 0d8c9e7d4b403f10f5c277efefd787244198a00c Author: Xie Yongji Date: Mon Aug 9 18:09:23 2021 +0800 vdpa_sim: Use iova_shift() for the size passed to alloc_iova() The size passed to alloc_iova() should be the size of page frames. Now we use byte granularity for the iova domain, so it's safe to pass the size in bytes to alloc_iova(). But it would be better to use iova_shift() for the size to avoid future bugs if we change granularity. Signed-off-by: Xie Yongji Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20210809100923.38-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 23b228cb89fdad2140b6b73254ecaf5fb05de5fe Author: Cai Huoqing Date: Sat Aug 21 20:33:20 2021 +0800 vhost scsi: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210821123320.734-1-caihuoqing@baidu.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi commit 52893733f2c5886fc74be6c386d12b59a3f581df Author: Eli Cohen Date: Mon Aug 23 08:21:23 2021 +0300 vdpa/mlx5: Add multiqueue support Multiqueue support requires additional virtio_net_q objects to be added or removed per the configured number of queue pairs. In addition the RQ tables needs to be modified to match the number of configured receive queues so the packets are dispatched to the right virtqueue according to the hash result. Note: qemu v6.0.0 is broken when the device requests more than two data queues; no net device will be created for the vdpa device. To avoid this, one should specify mq=off to qemu. In this case it will end up with a single queue. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-7-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 5262912ef3cfc5e518892c3d67fb36412cb813e2 Author: Eli Cohen Date: Mon Aug 23 08:21:22 2021 +0300 vdpa/mlx5: Add support for control VQ and MAC setting Add support to handle control virtqueue configurations per virtio specification. The control virtqueue is implemented in software and no hardware offloading is involved. Control VQ configuration need task context, therefore all configurations are handled in a workqueue created for the purpose. Modifications are made to the memory registration code to allow for saving a copy of itolb to be used by the control VQ to access the vring. The max number of data virtqueus supported by the driver has been updated to 2 since multiqueue is not supported at this stage and we need to ensure consistency of VQ indices mapping to either data or control VQ. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-6-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit e4fc66508c884b87422a98259cdfe135edae130f Author: Eli Cohen Date: Mon Aug 23 08:21:21 2021 +0300 vdpa/mlx5: Ensure valid indices are provided Following patches add control virtuqeue and multiqueue support. We want to verify that the index value to callbacks referencing a virtqueue is valid. The logic defining valid indices is as follows: CVQ clear: 0 and 1. CVQ set, MQ clear: 0, 1 and 2 CVQ set, MQ set: 0..nvq where nvq is whatever provided to _vdpa_register_device() Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-5-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit db296d252dfb977885391e47d3fb6ac5a1f9601c Author: Eli Cohen Date: Mon Aug 23 08:21:20 2021 +0300 vdpa/mlx5: Decouple virtqueue callback from struct mlx5_vdpa_virtqueue Instead, define an array of struct vdpa_callback on struct mlx5_vdpa_net and use it to store callbacks for any virtqueue provided. This is required due to the fact that callback configurations arrive before feature negotiation. With control VQ and multiqueue introduced next we want to save the information until after feature negotiation where we know the CVQ index. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-4-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit ae0428debf7cddf0863a95e415a1957d53384e7e Author: Eli Cohen Date: Mon Aug 23 08:21:19 2021 +0300 vdpa/mlx5: function prototype modifications in preparation to control VQ Use struct mlx5_vdpa_dev as an argument to setup_driver() and a few others in preparation to control virtqueue support in a subsequent patch. The control virtqueue is part of struct mlx5_vdpa_dev so this is required. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-3-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 4e57a9f622ccacacceadcead7bb65fb807383ab3 Author: Eli Cohen Date: Mon Aug 23 08:21:18 2021 +0300 vdpa/mlx5: Remove redundant header file inclusion linux/if_vlan.h is not required. Remove it. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20210823052123.14909-2-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 90d1936681bc469824c6dfeda701efc884d3b448 Author: Zhu Lingshan Date: Wed Aug 18 17:57:14 2021 +0800 vDPA/ifcvf: enable multiqueue and control vq This commit enbales multi-queue and control vq features for ifcvf Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20210818095714.3220-3-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 2ddae773c93bbcb0678ae819551f1750a505edec Author: Zhu Lingshan Date: Wed Aug 18 17:57:13 2021 +0800 vDPA/ifcvf: detect and use the onboard number of queues directly To enable this multi-queue feature for ifcvf, this commit intends to detect and use the onboard number of queues directly than IFCVF_MAX_QUEUE_PAIRS = 1 (removed) Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20210818095714.3220-2-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 6b5df347c6482f57b0d8f0569b86fb8fcd90d168 Author: Zhu Lingshan Date: Thu Aug 12 11:24:54 2021 +0800 vDPA/ifcvf: implement management netlink framework for ifcvf This commit implements the management netlink framework for ifcvf, including register and add / remove a device It works with iproute2: [root@localhost lszhu]# vdpa mgmtdev show -jp { "mgmtdev": { "pci/0000:01:00.5": { "supported_classes": [ "net" ] }, "pci/0000:01:00.6": { "supported_classes": [ "net" ] } } } [root@localhost lszhu]# vdpa dev add mgmtdev pci/0000:01:00.5 name vdpa0 [root@localhost lszhu]# vdpa dev add mgmtdev pci/0000:01:00.6 name vdpa1 Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210812032454.24486-3-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit 30326f9577342aac257ed9c036608de666b06389 Author: Zhu Lingshan Date: Thu Aug 12 11:24:53 2021 +0800 vDPA/ifcvf: introduce get_dev_type() which returns virtio dev id This commit introduces a new function get_dev_type() which returns the virtio device id of a device, to avoid duplicated code. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Link: https://lore.kernel.org/r/20210812032454.24486-2-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit 48eab831ae8b9f7002a533fa4235eed63ea1f1a3 Author: Jakub Kicinski Date: Thu Sep 2 11:10:37 2021 -0700 net: create netdev->dev_addr assignment helpers Recent work on converting address list to a tree made it obvious we need an abstraction around writing netdev->dev_addr. Without such abstraction updating the main device address is invisible to the core. Introduce a number of helpers which for now just wrap memcpy() but in the future can make necessary changes to the address tree. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 8c9bc823efd93394061c9b18270405cf21168d51 Merge: 63f8428b4077d 1b2b91831983a Author: David S. Miller Date: Sun Sep 5 20:43:04 2021 +0100 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes This series includes 3 fixes related to devlink firmware and chip versions. The other 2 patches fix a UDP tunneling issue and an error recovery issue. ==================== Signed-off-by: David S. Miller commit 1b2b91831983aeac3adcbb469aa8b0dc71453f89 Author: Michael Chan Date: Sun Sep 5 14:10:59 2021 -0400 bnxt_en: Fix possible unintended driver initiated error recovery If error recovery is already enabled, bnxt_timer() will periodically check the heartbeat register and the reset counter. If we get an error recovery async. notification from the firmware (e.g. change in primary/secondary role), we will immediately read and update the heartbeat register and the reset counter. If the timer for the next health check expires soon after this, we may read the heartbeat register again in quick succession and find that it hasn't changed. This will trigger error recovery unintentionally. The likelihood is small because we also reset fw_health->tmr_counter which will reset the interval for the next health check. But the update is not protected and bnxt_timer() can miss the update and perform the health check without waiting for the full interval. Fix it by only reading the heartbeat register and reset counter in bnxt_async_event_process() if error recovery is trasitioning to the enabled state. Also add proper memory barriers so that when enabling for the first time, bnxt_timer() will see the tmr_counter interval and perform the health check after the full interval has elapsed. Fixes: 7e914027f757 ("bnxt_en: Enable health monitoring.") Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 7ae9dc356f247ad9f9634b3da61a45eb72968b2e Author: Michael Chan Date: Sun Sep 5 14:10:58 2021 -0400 bnxt_en: Fix UDP tunnel logic The current logic assumes that when the driver sends the message to the firmware to add the VXLAN or Geneve port, the firmware will never fail the operation. The UDP ports are always stored and are used to check the tunnel packets in .ndo_features_check(). These tunnnel packets will fail to offload on the transmit side if firmware fails the call to add the UDP ports. To fix the problem, bp->vxlan_port and bp->nge_port will only be set to the offloaded ports when the HWRM_TUNNEL_DST_PORT_ALLOC firmware call succeeds. When deleting a UDP port, we check that the port was previously added successfuly first by checking the FW ID. Fixes: 1698d600b361 ("bnxt_en: Implement .ndo_features_check().") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6fdab8a3ade2adc123bbf5c4fdec3394560b1fb1 Author: Michael Chan Date: Sun Sep 5 14:10:57 2021 -0400 bnxt_en: Fix asic.rev in devlink dev info command The current asic.rev is incomplete and does not include the metal revision. Add the metal revision and decode the complete asic revision into the more common and readable form (A0, B0, etc). Fixes: 7154917a12b2 ("bnxt_en: Refactor bnxt_dl_info_get().") Reviewed-by: Edwin Peer Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit beb55fcf950f5454715df05234bb2b2914bc97ac Author: Edwin Peer Date: Sun Sep 5 14:10:56 2021 -0400 bnxt_en: fix read of stored FW_PSID version on P5 devices P5 devices store NVM arrays using a different internal representation. This implementation detail permeates into the HWRM API, requiring the caller to explicitly index the array elements in HWRM_NVM_GET_VARIABLE on these devices. Conversely, older devices do not support the indexed mode of operation and require reading the raw NVM content. Fixes: db28b6c77f40 ("bnxt_en: Fix devlink info's stored fw.psid version format.") Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 1656db67233e4259281d2ac35b25f712edbbc20b Author: Edwin Peer Date: Sun Sep 5 14:10:55 2021 -0400 bnxt_en: fix stored FW_PSID version masks The FW_PSID version components are 8 bits wide, not 4. Fixes: db28b6c77f40 ("bnxt_en: Fix devlink info's stored fw.psid version format.") Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 27151f177827d478508e756c7657273261aaf8a9 Merge: 58ca24158758f c7a3828d98db2 Author: Linus Torvalds Date: Sun Sep 5 11:56:18 2021 -0700 Merge tag 'perf-tools-for-v5.15-2021-09-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tool updates from Arnaldo Carvalho de Melo: "New features: - Improvements for the flamegraph python script, including: - Display perf.data header - Display PIDs of user stacks - Added option to change color scheme - Default to blue/green color scheme to improve accessibility - Correctly identify kernel stacks when debuginfo is available - Improvements for 'perf bench futex': - Add --mlockall parameter - Add --broadcast and --pi to the 'requeue' sub benchmark - Add support for PMU aliases. - Introduce an ARM Coresight ETE decoder. - Add a 'perf bench' entry for evlist open/close operations, to help quantify improvements with multithreading 'perf record'. - Allow reporting the [un]throttle PERF_RECORD_ meta event in 'perf script's python scripting. - Add a 'perf test' entry for PMU aliases. - Add a 'perf test' entry for 'perf record/perf report/perf script' pipe mode. Fixes: - perf script dlfilter (API for filtering via dynamically loaded shared object introduced in v5.14) fixes and a 'perf test' entry for it. - Fix get_current_dir_name() compilation on Android. - Fix issues with asciidoc and double dashes uses. - Fix memory leaks in the BTF handling code. - Fix leftover problems in the Documentation from the infrastructure originally lifted from the git codebase. - Fix *probe_vfs_getname.sh 'perf test' failures. - Handle fd gaps in 'perf test's test__dso_data_reopen(). - Make sure to show disasembly warnings for 'perf annotate --stdio'. - Fix output from pipe to file and vice-versa in 'perf record/report/script'. - Correct 'perf data -h' output. - Fix wrong comm in system-wide mode with 'perf record --delay'. - Do not allow --for-each-cgroup without cpu in 'perf stat' - Make 'perf test --skip' work on shell tests. - Fix libperf's verbose printing. Misc improvements: - Preparatory patches for multithreading various 'perf record' phases (synthesizing, opening, recording, etc). - Add sparse context/locking annotations in compiler-types.h, also to help with the multithreading effort. - Optimize the generation of the arch specific erno tables used in 'perf trace'. - Optimize libperf's perf_cpu_map__max(). - Improve ARM's CoreSight warnings. - Report collisions in AUX records. - Improve warnings for the LLVM 'perf test' entry. - Improve the PMU events 'perf test' codebase. - perf test: Do not compare overheads in the zstd comp test - Better support annotation on ARM. - Update 'perf trace's cmd string table to decode sys_bpf() first arg. Vendor events: - Add JSON events and metrics for Intel's Ice Lake, Tiger Lake and Elhart Lake. - Update JSON eventsand metrics for Intel's Cascade Lake and Sky Lake servers. Hardware tracing: - Improvements for the ARM hardware tracing auxtrace support" * tag 'perf-tools-for-v5.15-2021-09-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (130 commits) perf tests: Add test for PMU aliases perf pmu: Add PMU alias support perf session: Report collisions in AUX records perf script python: Allow reporting the [un]throttle PERF_RECORD_ meta event perf build: Report failure for testing feature libopencsd perf cs-etm: Show a warning for an unknown magic number perf cs-etm: Print the decoder name perf cs-etm: Create ETE decoder perf cs-etm: Update OpenCSD decoder for ETE perf cs-etm: Fix typo perf cs-etm: Save TRCDEVARCH register perf cs-etm: Refactor out ETMv4 header saving perf cs-etm: Initialise architecture based on TRCIDR1 perf cs-etm: Refactor initialisation of decoder params. tools build: Fix feature detect clean for out of source builds perf evlist: Add evlist__for_each_entry_from() macro perf evsel: Handle precise_ip fallback in evsel__open_cpu() perf evsel: Move bpf_counter__install_pe() to success path in evsel__open_cpu() perf evsel: Move test_attr__open() to success path in evsel__open_cpu() perf evsel: Move ignore_missing_thread() to fallback code ... commit 58ca24158758f1784400d32743373d7d6227d018 Merge: e07af26266432 4420f5b1be7b1 Author: Linus Torvalds Date: Sun Sep 5 11:50:41 2021 -0700 Merge tag 'trace-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: - simplify the Kconfig use of FTRACE and TRACE_IRQFLAGS_SUPPORT - bootconfig can now start histograms - bootconfig supports group/all enabling - histograms now can put values in linear size buckets - execnames can be passed to synthetic events - introduce "event probes" that attach to other events and can retrieve data from pointers of fields, or record fields as different types (a pointer to a string as a string instead of just a hex number) - various fixes and clean ups * tag 'trace-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (35 commits) tracing/doc: Fix table format in histogram code selftests/ftrace: Add selftest for testing duplicate eprobes and kprobes selftests/ftrace: Add selftest for testing eprobe events on synthetic events selftests/ftrace: Add test case to test adding and removing of event probe selftests/ftrace: Fix requirement check of README file selftests/ftrace: Add clear_dynamic_events() to test cases tracing: Add a probe that attaches to trace events tracing/probes: Reject events which have the same name of existing one tracing/probes: Have process_fetch_insn() take a void * instead of pt_regs tracing/probe: Change traceprobe_set_print_fmt() to take a type tracing/probes: Use struct_size() instead of defining custom macros tracing/probes: Allow for dot delimiter as well as slash for system names tracing/probe: Have traceprobe_parse_probe_arg() take a const arg tracing: Have dynamic events have a ref counter tracing: Add DYNAMIC flag for dynamic events tracing: Replace deprecated CPU-hotplug functions. MAINTAINERS: Add an entry for os noise/latency tracepoint: Fix kerneldoc comments bootconfig/tracing/ktest: Update ktest example for boot-time tracing tools/bootconfig: Use per-group/all enable option in ftrace2bconf script ... commit e07af2626643293fa16df655979e7963250abc63 Merge: 063df71a574b8 56809a28d45fc Author: Linus Torvalds Date: Sun Sep 5 11:43:03 2021 -0700 Merge tag 'arc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC updates from Vineet Gupta: "Finally a big pile of changes for ARC (atomics/mm). These are from our internal arc64 tree, preparing mainline for eventual arc64 support. I'm spreading them out to avoid tsunami of patches in one release. - MM rework: - Implement up to 4 paging levels - Enable STRICT_MM_TYPECHECK - switch pgtable_t back to 'struct page *' - Atomics rework / implement relaxed accessors - Retire legacy MMUv1,v2; ARC750 cores - A few other build errors, typos" * tag 'arc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: (33 commits) ARC: mm: vmalloc sync from kernel to user table to update PMD ... ARC: mm: support 4 levels of page tables ARC: mm: support 3 levels of page tables ARC: mm: switch to asm-generic/pgalloc.h ARC: mm: switch pgtable_t back to struct page * ARC: mm: hack to allow 2 level build with 4 level code ARC: mm: disintegrate pgtable.h into levels and flags ARC: mm: disintegrate mmu.h (arcv2 bits out) ARC: mm: move MMU specific bits out of entry code ... ARC: mm: move MMU specific bits out of ASID allocator ARC: mm: non-functional code movement/cleanup ARC: mm: pmd_populate* to use the canonical set_pmd (and drop pmd_set) ARC: ioremap: use more commonly used PAGE_KERNEL based uncached flag ARC: mm: Enable STRICT_MM_TYPECHECKS ARC: mm: Fixes to allow STRICT_MM_TYPECHECKS ARC: mm: move mmu/cache externs out to setup.h ARC: mm: remove tlb paranoid code ARC: mm: use SCRATCH_DATA0 register for caching pgdir in ARCv2 only ARC: retire MMUv1 and MMUv2 support ARC: retire ARC750 support ... commit 063df71a574b88e94391a3a719cf66d1b46df884 Merge: 3fe617ccafd6f c24a19674258d Author: Linus Torvalds Date: Sun Sep 5 11:31:23 2021 -0700 Merge tag 'riscv-for-linus-5.15-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - support PC-relative instructions (auipc and branches) in kprobes - support for forced IRQ threading - support for the hlt/nohlt kernel command line options, via the generic idle loop - show the edge/level triggered behavior of interrupts in /proc/interrupts - a handful of cleanups to our address mapping mechanisms - support for allocating gigantic hugepages via CMA - support for the undefined behavior sanitizer (UBSAN) - a handful of cleanups to the VDSO that allow the kernel to build with LLD. - support for hugepage migration * tag 'riscv-for-linus-5.15-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (21 commits) riscv: add support for hugepage migration RISC-V: Fix VDSO build for !MMU riscv: use strscpy to replace strlcpy riscv: explicitly use symbol offsets for VDSO riscv: Enable Undefined Behavior Sanitizer UBSAN riscv: Keep the riscv Kconfig selects sorted riscv: Support allocating gigantic hugepages using CMA riscv: fix the global name pfn_base confliction error riscv: Move early fdt mapping creation in its own function riscv: Simplify BUILTIN_DTB device tree mapping handling riscv: Use __maybe_unused instead of #ifdefs around variable declarations riscv: Get rid of map_size parameter to create_kernel_page_table riscv: Introduce va_kernel_pa_offset for 32-bit kernel riscv: Optimize kernel virtual address conversion macro dt-bindings: riscv: add starfive jh7100 bindings riscv: Enable GENERIC_IRQ_SHOW_LEVEL riscv: Enable idle generic idle loop riscv: Allow forced irq threading riscv: Implement thread_struct whitelist for hardened usercopy riscv: kprobes: implement the branch instructions ... commit 3fe617ccafd6f5bb33c2391d6f4eeb41c1fd0151 Author: Linus Torvalds Date: Sun Sep 5 11:24:05 2021 -0700 Enable '-Werror' by default for all kernel builds ... but make it a config option so that broken environments can disable it when required. We really should always have a clean build, and will disable specific over-eager warnings as required, if we can't fix them. But while I fairly religiously enforce that in my own tree, it doesn't get enforced by various build robots that don't necessarily report warnings. So this just makes '-Werror' a default compiler flag, but allows people to disable it for their configuration if they have some particular issues. Occasionally, new compiler versions end up enabling new warnings, and it can take a while before we have them fixed (or the warnings disabled if that is what it takes), so the config option allows for that situation. Hopefully this will mean that I get fewer pull requests that have new warnings that were not noticed by various automation we have in place. Knock wood. Signed-off-by: Linus Torvalds commit fd47ff55c9c31101fcc06d20cb381da3d4089bd5 Merge: 6b6dc4f40c526 1b4f3dfb4792f Author: Linus Torvalds Date: Sun Sep 5 11:19:15 2021 -0700 Merge tag 'usb-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull more USB updates from Greg KH: "Here are some straggler USB-serial changes for 5.15-rc1. These were not included in the first pull request as they came in "late" from Johan and I had missed them in my pull request earlier this week. Nothing big in here, just some USB to serial driver updates and fixes. All of these were in linux-next before I pulled them into my tree, and have been in linux-next all this week from my tree with no reported problems" * tag 'usb-5.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: pl2303: fix GL type detection USB: serial: replace symbolic permissions by octal permissions USB: serial: cp210x: determine fw version for CP2105 and CP2108 USB: serial: cp210x: clean up type detection USB: serial: cp210x: clean up set-chars request USB: serial: cp210x: clean up control-request timeout USB: serial: cp210x: fix flow-control error handling USB: serial: cp210x: fix control-characters error handling USB: serial: io_edgeport: drop unused descriptor helper commit 63f8428b4077de3664eb0b252393c839b0b293ec Author: Rafał Miłecki Date: Sun Sep 5 19:23:28 2021 +0200 net: dsa: b53: Fix IMP port setup on BCM5301x Broadcom's b53 switches have one IMP (Inband Management Port) that needs to be programmed using its own designed register. IMP port may be different than CPU port - especially on devices with multiple CPU ports. For that reason it's required to explicitly note IMP port index and check for it when choosing a register to use. This commit fixes BCM5301x support. Those switches use CPU port 5 while their IMP port is 8. Before this patch b53 was trying to program port 5 with B53_PORT_OVERRIDE_CTRL instead of B53_GMII_PORT_OVERRIDE_CTRL(5). It may be possible to also replace "cpu_port" usages with dsa_is_cpu_port() but that is out of the scope of thix BCM5301x fix. Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Signed-off-by: Rafał Miłecki Signed-off-by: David S. Miller commit 8a0ed250f911da31a2aef52101bc707846a800ff Author: Willem de Bruijn Date: Sun Sep 5 11:21:09 2021 -0400 ip_gre: validate csum_start only on pull The GRE tunnel device can pull existing outer headers in ipge_xmit. This is a rare path, apparently unique to this device. The below commit ensured that pulling does not move skb->data beyond csum_start. But it has a false positive if ip_summed is not CHECKSUM_PARTIAL and thus csum_start is irrelevant. Refine to exclude this. At the same time simplify and strengthen the test. Simplify, by moving the check next to the offending pull, making it more self documenting and removing an unnecessary branch from other code paths. Strengthen, by also ensuring that the transport header is correct and therefore the inner headers will be after skb_reset_inner_headers. The transport header is set to csum_start in skb_partial_csum_set. Link: https://lore.kernel.org/netdev/YS+h%2FtqCJJiQei+W@shredder/ Fixes: 1d011c4803c7 ("ip_gre: add validation for csum_start") Reported-by: Ido Schimmel Suggested-by: Alexander Duyck Signed-off-by: Willem de Bruijn Reviewed-by: Alexander Duyck Signed-off-by: David S. Miller commit 6b6dc4f40c5264556223ba94693f20d83796ab1f Merge: 0319b848b1551 c1fe77e42440d Author: Linus Torvalds Date: Sun Sep 5 10:50:12 2021 -0700 Merge tag 'mtd/for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD updates from Miquel Raynal: "MTD changes: - blkdevs: - Simplify the refcounting in blktrans_{open, release} - Simplify blktrans_getgeo - Remove blktrans_ref_mutex - Simplify blktrans_dev_get - Use lockdep_assert_held - Don't hold del_mtd_blktrans_dev in blktrans_{open, release} - ftl: - Don't cast away the type when calling add_mtd_blktrans_dev - Don't cast away the type when calling add_mtd_blktrans_dev - Use container_of() rather than cast - Fix use-after-free - Add discard support - Allow use of MTD_RAM for testing purposes - concat: - Check _read, _write callbacks existence before assignment - Judge callback existence based on the master - maps: - Maps: remove dead MTD map driver for PMC-Sierra MSP boards - mtdblock: - Warn if added for a NAND device - Add comment about UBI block devices - Update old JFFS2 mention in Kconfig - partitions: - Redboot: convert to YAML NAND core changes: - Repair Miquel Raynal's email address in MAINTAINERS - Fix a couple of spelling mistakes in Kconfig - bbt: Skip bad blocks when searching for the BBT in NAND - Remove never changed ret variable Raw NAND changes: - cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' - intel: Fix error handling in probe - omap: Fix kernel doc warning on 'calcuate' typo - gpmc: Fix the ECC bytes vs. OOB bytes equation SPI-NAND core changes: - Properly fill the OOB area. - Fix comment SPI-NAND drivers changes: - macronix: Add Quad support for serial NAND flash" * tag 'mtd/for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (30 commits) mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' mtd_blkdevs: simplify the refcounting in blktrans_{open, release} mtd_blkdevs: simplify blktrans_getgeo mtd_blkdevs: remove blktrans_ref_mutex mtd_blkdevs: simplify blktrans_dev_get mtd/rfd_ftl: don't cast away the type when calling add_mtd_blktrans_dev mtd/ftl: don't cast away the type when calling add_mtd_blktrans_dev mtd_blkdevs: use lockdep_assert_held mtd_blkdevs: don't hold del_mtd_blktrans_dev in blktrans_{open, release} mtd: rawnand: intel: Fix error handling in probe mtd: mtdconcat: Check _read, _write callbacks existence before assignment mtd: mtdconcat: Judge callback existence based on the master mtd: maps: remove dead MTD map driver for PMC-Sierra MSP boards mtd: rfd_ftl: use container_of() rather than cast mtd: rfd_ftl: fix use-after-free mtd: rfd_ftl: add discard support mtd: rfd_ftl: allow use of MTD_RAM for testing purposes mtdblock: Warn if added for a NAND device mtd: spinand: macronix: Add Quad support for serial NAND flash mtdblock: Add comment about UBI block devices ... commit 0319b848b155185815724e1b46103c550627a845 Author: Geert Uytterhoeven Date: Sun Sep 5 11:30:34 2021 +0200 binfmt: a.out: Fix bogus semicolon fs/binfmt_aout.c: In function ‘load_aout_library’: fs/binfmt_aout.c:311:27: error: expected ‘)’ before ‘;’ token 311 | MAP_FIXED | MAP_PRIVATE; | ^ fs/binfmt_aout.c:309:10: error: too few arguments to function ‘vm_mmap’ 309 | error = vm_mmap(file, start_addr, ex.a_text + ex.a_data, | ^~~~~~~ In file included from fs/binfmt_aout.c:12: include/linux/mm.h:2626:35: note: declared here 2626 | extern unsigned long __must_check vm_mmap(struct file *, unsigned long, | ^~~~~~~ Fix this by reverting the accidental replacement of a comma by a semicolon. Fixes: 42be8b42535183f8 ("binfmt: don't use MAP_DENYWRITE when loading shared libraries via uselib()") Reported-by: noreply@ellerman.id.au Reported-by: Guenter Roeck Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds commit 0a4fd8df07ddc3d12fad3b2e81ea5832bde2f806 Author: David Decotigny Date: Fri Sep 3 23:31:29 2021 -0700 bonding: complain about missing route only once for A/B ARP probes On configs where there is no confirgured direct route to the target of the ARP probes, these probes are still sent and may be replied to properly, so no need to repeatedly complain about the missing route. Signed-off-by: David Decotigny Signed-off-by: David S. Miller commit e5dd729460ca8d2da02028dbf264b65be8cd4b5f Author: Antonio Quartulli Date: Fri Sep 3 18:58:42 2021 +0200 ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address GRE interfaces are not Ether-like and therefore it is not possible to generate the v6LL address the same way as (for example) GRETAP devices. With default settings, a GRE interface will attempt generating its v6LL address using the EUI64 approach, but this will fail when the local endpoint of the GRE tunnel is set to "any". In this case the GRE interface will end up with no v6LL address, thus violating RFC4291. SIT interfaces already implement a different logic to ensure that a v6LL address is always computed. Change the GRE v6LL generation logic to follow the same approach as SIT. This way GRE interfaces will always have a v6LL address as well. Behaviour of GRETAP interfaces has not been changed as they behave like classic Ether-like interfaces. To avoid code duplication sit_add_v4_addrs() has been renamed to add_v4_addrs() and adapted to handle also the IP6GRE/GRE cases. Signed-off-by: Antonio Quartulli Signed-off-by: David S. Miller commit 81d0885d68ec427e62044cf46a400c9958ea0092 Author: Song Yoong Siang Date: Fri Sep 3 10:00:26 2021 +0800 net: stmmac: Fix overall budget calculation for rxtx_napi tx_done is not used for napi_complete_done(). Thus, NAPI busy polling mechanism by gro_flush_timeout and napi_defer_hard_irqs will not able be triggered after a packet is transmitted when there is no receive packet. Fix this by taking the maximum value between tx_done and rx_done as overall budget completed by the rxtx NAPI poll to ensure XDP Tx ZC operation is continuously polling for next Tx frame. This gives benefit of lower packet submission processing latency and jitter under XDP Tx ZC mode. Performance of tx-only using xdp-sock on Intel ADL-S platform is the same with and without this patch. root@intel-corei7-64:~# ./xdpsock -i enp0s30f4 -t -z -q 1 -n 10 sock0@enp0s30f4:1 txonly xdp-drv pps pkts 10.00 rx 0 0 tx 511630 8659520 sock0@enp0s30f4:1 txonly xdp-drv pps pkts 10.00 rx 0 0 tx 511625 13775808 sock0@enp0s30f4:1 txonly xdp-drv pps pkts 10.00 rx 0 0 tx 511619 18892032 Fixes: 132c32ee5bc0 ("net: stmmac: Add TX via XDP zero-copy socket") Cc: # 5.13.x Co-developed-by: Ong Boon Leong Signed-off-by: Ong Boon Leong Signed-off-by: Song Yoong Siang Signed-off-by: David S. Miller commit 45010c080e6e7434fcae73212b0087a03590049f Author: Christophe JAILLET Date: Thu Sep 2 22:38:11 2021 +0200 iwlwifi: pnvm: Fix a memory leak in 'iwl_pnvm_get_from_fs()' A firmware is requested but never released in this function. This leads to a memory leak in the normal execution path. Add the missing 'release_firmware()' call. Also introduce a temp variable (new_len) in order to keep the value of 'pnvm->size' after the firmware has been released. Fixes: cdda18fbbefa ("iwlwifi: pnvm: move file loading code to a separate function") Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1b5d80f54c1dbf85710fd285243932943b498fe7.1630614969.git.christophe.jaillet@wanadoo.fr commit cc883236b79297f6266ca6f4e7f24f3fd3c736c1 Author: Zhang Yi Date: Fri Jul 16 20:20:24 2021 +0800 ext4: drop unnecessary journal handle in delalloc write After we factor out the inline data write procedure from ext4_da_write_end(), we don't need to start journal handle for the cases of both buffer overwrite and append-write. If we need to update i_disksize, mark_inode_dirty() do start handle and update inode buffer. So we could just remove all the journal handle codes in the delalloc write procedure. After this patch, we could get a lot of performance improvement. Below is the Unixbench comparison data test on my machine with 'Intel Xeon Gold 5120' CPU and nvme SSD backend. Test cmd: ./Run -c 56 -i 3 fstime fsbuffer fsdisk Before this patch: System Benchmarks Partial Index BASELINE RESULT INDEX File Copy 1024 bufsize 2000 maxblocks 3960.0 422965.0 1068.1 File Copy 256 bufsize 500 maxblocks 1655.0 105077.0 634.9 File Copy 4096 bufsize 8000 maxblocks 5800.0 1429092.0 2464.0 ====== System Benchmarks Index Score (Partial Only) 1186.6 After this patch: System Benchmarks Partial Index BASELINE RESULT INDEX File Copy 1024 bufsize 2000 maxblocks 3960.0 732716.0 1850.3 File Copy 256 bufsize 500 maxblocks 1655.0 184940.0 1117.5 File Copy 4096 bufsize 8000 maxblocks 5800.0 2427152.0 4184.7 ====== System Benchmarks Index Score (Partial Only) 2053.0 Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210716122024.1105856-5-yi.zhang@huawei.com commit 6984aef59814fb5c47b0e30c56e101186b5ebf8c Author: Zhang Yi Date: Fri Jul 16 20:20:23 2021 +0800 ext4: factor out write end code of inline file Now that the inline_data file write end procedure are falled into the common write end functions, it is not clear. Factor them out and do some cleanup. This patch also drop ext4_da_write_inline_data_end() and switch to use ext4_write_inline_data_end() instead because we also need to do the same error processing if we failed to write data into inline entry. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210716122024.1105856-4-yi.zhang@huawei.com commit 55ce2f649b9e88111270333a8127e23f4f8f42d7 Author: Zhang Yi Date: Fri Jul 16 20:20:22 2021 +0800 ext4: correct the error path of ext4_write_inline_data_end() Current error path of ext4_write_inline_data_end() is not correct. Firstly, it should pass out the error value if ext4_get_inode_loc() return fail, or else it could trigger infinite loop if we inject error here. And then it's better to add inode to orphan list if it return fail in ext4_journal_stop(), otherwise we could not restore inline xattr entry after power failure. Finally, we need to reset the 'ret' value if ext4_write_inline_data_end() return success in ext4_write_end() and ext4_journalled_write_end(), otherwise we could not get the error return value of ext4_journal_stop(). Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210716122024.1105856-3-yi.zhang@huawei.com commit 4df031ff5876d94b48dd9ee486ba5522382a06b2 Author: Zhang Yi Date: Fri Jul 16 20:20:21 2021 +0800 ext4: check and update i_disksize properly After commit 3da40c7b0898 ("ext4: only call ext4_truncate when size <= isize"), i_disksize could always be updated to i_size in ext4_setattr(), and we could sure that i_disksize <= i_size since holding inode lock and if i_disksize < i_size there are delalloc writes pending in the range upto i_size. If the end of the current write is <= i_size, there's no need to touch i_disksize since writeback will push i_disksize upto i_size eventually. So we can switch to check i_size instead of i_disksize in ext4_da_write_end() when write to the end of the file. we also could remove ext4_mark_inode_dirty() together because we defer inode dirtying to generic_write_end() or ext4_da_write_inline_data_end(). Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210716122024.1105856-2-yi.zhang@huawei.com commit 9c4d94dc9a64426d2fa0255097a3a84f6ff2eebe Author: Christian Schoenebeck Date: Sat Sep 4 17:12:51 2021 +0200 net/9p: increase default msize to 128k Let's raise the default msize value to 128k. The 'msize' option defines the maximum message size allowed for any message being transmitted (in both directions) between 9p server and 9p client during a 9p session. Currently the default 'msize' is just 8k, which is way too conservative. Such a small 'msize' value has quite a negative performance impact, because individual 9p messages have to be split up far too often into numerous smaller messages to fit into this message size limitation. A default value of just 8k also has a much higher probablity of hitting short-read issues like: https://gitlab.com/qemu-project/qemu/-/issues/409 Unfortunately user feedback showed that many 9p users are not aware that this option even exists, nor the negative impact it might have if it is too low. Link: http://lkml.kernel.org/r/61ea0f0faaaaf26dd3c762eabe4420306ced21b9.1630770829.git.linux_oss@crudebyte.com Link: https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg01003.html Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 9210fc0a3b61c396ba9b32467b88c89d41bc9fe7 Author: Christian Schoenebeck Date: Sat Sep 4 17:07:12 2021 +0200 net/9p: use macro to define default msize Use a macro to define the default value for the 'msize' option at one place instead of using two separate integer literals. Link: http://lkml.kernel.org/r/28bb651ae0349a7d57e8ddc92c1bd5e62924a912.1630770829.git.linux_oss@crudebyte.com Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 22bb3b79290ec5970b74fa6e9eb313802d075c82 Author: Dominique Martinet Date: Sun Sep 5 08:29:22 2021 +0900 net/9p: increase tcp max msize to 1MB Historically TCP has been limited to 64K buffers, but increasing msize provides huge performance benefits especially as latency increase so allow for bigger buffers. Ideally further improvements could change the allocation from the current contiguous chunk in slab (kmem_cache) to some scatter-gather compatible API... Note this only increases the max possible setting, not the default value. Link: http://lkml.kernel.org/r/YTQB5jCbvhmCWzNd@codewreck.org Signed-off-by: Dominique Martinet commit 0097ae5f7af5684f961a5f803ff7ad3e6f933668 Author: Yang Li Date: Mon Jun 7 16:40:36 2021 +0800 NTB: perf: Fix an error code in perf_setup_inbuf() When the function IS_ALIGNED() returns false, the value of ret is 0. So, we set ret to -EINVAL to indicate this error. Clean up smatch warning: drivers/ntb/test/ntb_perf.c:602 perf_setup_inbuf() warn: missing error code 'ret'. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Serge Semin Signed-off-by: Jon Mason commit 319f83ac98d7afaabab84ce5281a819a358b9895 Author: Yang Li Date: Mon Jun 7 13:56:20 2021 +0800 NTB: Fix an error code in ntb_msit_probe() When the value of nm->isr_ctx is false, the value of ret is 0. So, we set ret to -ENOMEM to indicate this error. Clean up smatch warning: drivers/ntb/test/ntb_msi_test.c:373 ntb_msit_probe() warn: missing error code 'ret'. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Logan Gunthorpe Signed-off-by: Jon Mason commit f3b6b10fccc44ce0343878a1ed7cd8ef8fd687d8 Author: Dave Jiang Date: Mon Feb 1 09:12:39 2021 -0700 ntb: intel: remove invalid email address in header comment Remove Jon's old email address. Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit 49624efa65ac9889f4e7c7b2452b2e6ce42ba37d Merge: f7464060f7ab9 592ca09be8333 Author: Linus Torvalds Date: Sat Sep 4 11:35:47 2021 -0700 Merge tag 'denywrite-for-5.15' of git://github.com/davidhildenbrand/linux Pull MAP_DENYWRITE removal from David Hildenbrand: "Remove all in-tree usage of MAP_DENYWRITE from the kernel and remove VM_DENYWRITE. There are some (minor) user-visible changes: - We no longer deny write access to shared libaries loaded via legacy uselib(); this behavior matches modern user space e.g. dlopen(). - We no longer deny write access to the elf interpreter after exec completed, treating it just like shared libraries (which it often is). - We always deny write access to the file linked via /proc/pid/exe: sys_prctl(PR_SET_MM_MAP/EXE_FILE) will fail if write access to the file cannot be denied, and write access to the file will remain denied until the link is effectivel gone (exec, termination, sys_prctl(PR_SET_MM_MAP/EXE_FILE)) -- just as if exec'ing the file. Cross-compiled for a bunch of architectures (alpha, microblaze, i386, s390x, ...) and verified via ltp that especially the relevant tests (i.e., creat07 and execve04) continue working as expected" * tag 'denywrite-for-5.15' of git://github.com/davidhildenbrand/linux: fs: update documentation of get_write_access() and friends mm: ignore MAP_DENYWRITE in ksys_mmap_pgoff() mm: remove VM_DENYWRITE binfmt: remove in-tree usage of MAP_DENYWRITE kernel/fork: always deny write access to current MM exe_file kernel/fork: factor out replacing the current MM exe_file binfmt: don't use MAP_DENYWRITE when loading shared libraries via uselib() commit f7464060f7ab9a2424428008f0ee9f1e267e410f Merge: 6abaa83c7352b 2e3a51b59ea26 Author: Linus Torvalds Date: Sat Sep 4 11:15:50 2021 -0700 Merge git://github.com/Paragon-Software-Group/linux-ntfs3 Merge NTFSv3 filesystem from Konstantin Komarov: "This patch adds NTFS Read-Write driver to fs/ntfs3. Having decades of expertise in commercial file systems development and huge test coverage, we at Paragon Software GmbH want to make our contribution to the Open Source Community by providing implementation of NTFS Read-Write driver for the Linux Kernel. This is fully functional NTFS Read-Write driver. Current version works with NTFS (including v3.1) and normal/compressed/sparse files and supports journal replaying. We plan to support this version after the codebase once merged, and add new features and fix bugs. For example, full journaling support over JBD will be added in later updates" Link: https://lore.kernel.org/lkml/20210729134943.778917-1-almaz.alexandrovich@paragon-software.com/ Link: https://lore.kernel.org/lkml/aa4aa155-b9b2-9099-b7a2-349d8d9d8fbd@paragon-software.com/ * git://github.com/Paragon-Software-Group/linux-ntfs3: (35 commits) fs/ntfs3: Change how module init/info messages are displayed fs/ntfs3: Remove GPL boilerplates from decompress lib files fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter fs/ntfs3: Fix integer overflow in ni_fiemap with fiemap_prep() fs/ntfs3: Restyle comments to better align with kernel-doc fs/ntfs3: Rework file operations fs/ntfs3: Remove fat ioctl's from ntfs3 driver for now fs/ntfs3: Restyle comments to better align with kernel-doc fs/ntfs3: Fix error handling in indx_insert_into_root() fs/ntfs3: Potential NULL dereference in hdr_find_split() fs/ntfs3: Fix error code in indx_add_allocate() fs/ntfs3: fix an error code in ntfs_get_acl_ex() fs/ntfs3: add checks for allocation failure fs/ntfs3: Use kcalloc/kmalloc_array over kzalloc/kmalloc fs/ntfs3: Do not use driver own alloc wrappers fs/ntfs3: Use kernel ALIGN macros over driver specific fs/ntfs3: Restyle comment block in ni_parse_reparse() fs/ntfs3: Remove unused including fs/ntfs3: Fix fall-through warnings for Clang fs/ntfs3: Fix one none utf8 char in source file ... commit 6abaa83c7352b31450d7e8c173f674324c16b02b Merge: 0961f0c00e696 9605f75cf36e0 Author: Linus Torvalds Date: Sat Sep 4 10:48:47 2021 -0700 Merge tag 'f2fs-for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this cycle, we've addressed some performance issues such as lock contention, misbehaving compress_cache, allowing extent_cache for compressed files, and new sysfs to adjust ra_size for fadvise. In order to diagnose the performance issues quickly, we also added an iostat which shows the IO latencies periodically. On the stability side, we've found two memory leakage cases in the error path in compression flow. And, we've also fixed various corner cases in fiemap, quota, checkpoint=disable, zstd, and so on. Enhancements: - avoid long checkpoint latency by releasing nat_tree_lock - collect and show iostats periodically - support extent_cache for compressed files - add a sysfs entry to manage ra_size given fadvise(POSIX_FADV_SEQUENTIAL) - report f2fs GC status via sysfs - add discard_unit=%s in mount option to handle zoned device Bug fixes: - fix two memory leakages when an error happens in the compressed IO flow - fix commpress_cache to get the right LBA - fix fiemap to deal with compressed case correctly - fix wrong EIO returns due to SBI_NEED_FSCK - fix missing writes when enabling checkpoint back - fix quota deadlock - fix zstd level mount option In addition to the above major updates, we've cleaned up several code paths such as dio, unnecessary operations, debugfs/f2fs/status, sanity check, and typos" * tag 'f2fs-for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (46 commits) f2fs: should put a page beyond EOF when preparing a write f2fs: deallocate compressed pages when error happens f2fs: enable realtime discard iff device supports discard f2fs: guarantee to write dirty data when enabling checkpoint back f2fs: fix to unmap pages from userspace process in punch_hole() f2fs: fix unexpected ENOENT comes from f2fs_map_blocks() f2fs: fix to account missing .skipped_gc_rwsem f2fs: adjust unlock order for cleanup f2fs: Don't create discard thread when device doesn't support realtime discard f2fs: rebuild nat_bits during umount f2fs: introduce periodic iostat io latency traces f2fs: separate out iostat feature f2fs: compress: do sanity check on cluster f2fs: fix description about main_blkaddr node f2fs: convert S_IRUGO to 0444 f2fs: fix to keep compatibility of fault injection interface f2fs: support fault injection for f2fs_kmem_cache_alloc() f2fs: compress: allow write compress released file after truncate to zero f2fs: correct comment in segment.h f2fs: improve sbi status info in debugfs/f2fs/status ... commit 55d1308bdff7341b778e5cf36220616a0dd6ab8f Author: Phillip Potter Date: Sat Sep 4 18:40:30 2021 +0100 cdrom: update uniform CD-ROM maintainership in MAINTAINERS file Update maintainership for the uniform CD-ROM driver from Jens Axboe to Phillip Potter in MAINTAINERS file, to reflect the attempt to pass on maintainership of this driver to a different individual. Also remove URL to site which is no longer active. Suggested-by: Jens Axboe Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210904174030.1103-1-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit 0961f0c00e69672a8e4a2e591355567dbda44389 Merge: f1583cb1be35c 8cfb9015280d4 Author: Linus Torvalds Date: Sat Sep 4 10:25:26 2021 -0700 Merge tag 'nfs-for-5.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "New Features: - Better client responsiveness when server isn't replying - Use refcount_t in sunrpc rpc_client refcount tracking - Add srcaddr and dst_port to the sunrpc sysfs info files - Add basic support for connection sharing between servers with multiple NICs` Bugfixes and Cleanups: - Sunrpc tracepoint cleanups - Disconnect after ib_post_send() errors to avoid deadlocks - Fix for tearing down rpcrdma_reps - Fix a potential pNFS layoutget livelock loop - pNFS layout barrier fixes - Fix a potential memory corruption in rpc_wake_up_queued_task_set_status() - Fix reconnection locking - Fix return value of get_srcport() - Remove rpcrdma_post_sends() - Remove pNFS dead code - Remove copy size restriction for inter-server copies - Overhaul the NFS callback service - Clean up sunrpc TCP socket shutdowns - Always provide aligned buffers to RPC read layers" * tag 'nfs-for-5.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (39 commits) NFS: Always provide aligned buffers to the RPC read layers NFSv4.1 add network transport when session trunking is detected SUNRPC enforce creation of no more than max_connect xprts NFSv4 introduce max_connect mount options SUNRPC add xps_nunique_destaddr_xprts to xprt_switch_info in sysfs SUNRPC keep track of number of transports to unique addresses NFSv3: Delete duplicate judgement in nfs3_async_handle_jukebox SUNRPC: Tweak TCP socket shutdown in the RPC client SUNRPC: Simplify socket shutdown when not reusing TCP ports NFSv4.2: remove restriction of copy size for inter-server copy. NFS: Clean up the synopsis of callback process_op() NFS: Extract the xdr_init_encode/decode() calls from decode_compound NFS: Remove unused callback void decoder NFS: Add a private local dispatcher for NFSv4 callback operations SUNRPC: Eliminate the RQ_AUTHERR flag SUNRPC: Set rq_auth_stat in the pg_authenticate() callout SUNRPC: Add svc_rqst::rq_auth_stat SUNRPC: Add dst_port to the sysfs xprt info file SUNRPC: Add srcaddr as a file in sysfs sunrpc: Fix return value of get_srcport() ... commit ecbd690b52dc11e3ef96139d4cfce53b1191b8a7 Author: Christophe JAILLET Date: Sat Sep 4 09:34:51 2021 +0200 octeontx2-af: Fix some memory leaks in the error handling path of 'cgx_lmac_init()' Memory allocated before 'lmac' is stored in 'cgx->lmac_idmap[]' must be freed explicitly. Otherwise, in case of error, it will leak. Rename the 'err_irq' label to better describe what is done at this place in the error handling path. Fixes: 6f14078e3ee5 ("octeontx2-af: DMAC filter support in MAC block") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit d863ca67bb6e40b7653e25f3787994281b8c2e58 Author: Christophe JAILLET Date: Sat Sep 4 09:34:41 2021 +0200 octeontx2-af: Add a 'rvu_free_bitmap()' function In order to match 'rvu_alloc_bitmap()', add a 'rvu_free_bitmap()' function Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 7db8263a12155c7ae4ad97e850f1e499c73765fc Author: Yang Li Date: Fri Sep 3 14:42:33 2021 +0800 ethtool: Fix an error code in cxgb2.c When adapter->registered_device_map is NULL, the value of err is uncertain, we set err to -EINVAL to avoid ambiguity. Clean up smatch warning: drivers/net/ethernet/chelsio/cxgb/cxgb2.c:1114 init_one() warn: missing error code 'err' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: David S. Miller commit 9ddbc2a00d7f63fa9748f4278643193dac985f2d Author: Dinghao Liu Date: Fri Sep 3 15:35:43 2021 +0800 qlcnic: Remove redundant unlock in qlcnic_pinit_from_rom Previous commit 68233c583ab4 removes the qlcnic_rom_lock() in qlcnic_pinit_from_rom(), but remains its corresponding unlock function, which is odd. I'm not very sure whether the lock is missing, or the unlock is redundant. This bug is suggested by a static analysis tool, please advise. Fixes: 68233c583ab4 ("qlcnic: updated reset sequence") Signed-off-by: Dinghao Liu Signed-off-by: David S. Miller commit c7c5e6ff533fe1f9afef7d2fa46678987a1335a7 Author: Eric Dumazet Date: Fri Sep 3 15:03:43 2021 -0700 fq_codel: reject silly quantum parameters syzbot found that forcing a big quantum attribute would crash hosts fast, essentially using this: tc qd replace dev eth0 root fq_codel quantum 4294967295 This is because fq_codel_dequeue() would have to loop ~2^31 times in : if (flow->deficit <= 0) { flow->deficit += q->quantum; list_move_tail(&flow->flowchain, &q->old_flows); goto begin; } SFQ max quantum is 2^19 (half a megabyte) Lets adopt a max quantum of one megabyte for FQ_CODEL. Fixes: 4b549a2ef4be ("fq_codel: Fair Queue Codel AQM") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit bd0e7491a931f5a2960555b10b9551464ff8cc8e Author: Vlastimil Babka Date: Sat May 22 01:59:38 2021 +0200 mm, slub: convert kmem_cpu_slab protection to local_lock Embed local_lock into struct kmem_cpu_slab and use the irq-safe versions of local_lock instead of plain local_irq_save/restore. On !PREEMPT_RT that's equivalent, with better lockdep visibility. On PREEMPT_RT that means better preemption. However, the cost on PREEMPT_RT is the loss of lockless fast paths which only work with cpu freelist. Those are designed to detect and recover from being preempted by other conflicting operations (both fast or slow path), but the slow path operations assume they cannot be preempted by a fast path operation, which is guaranteed naturally with disabled irqs. With local locks on PREEMPT_RT, the fast paths now also need to take the local lock to avoid races. In the allocation fastpath slab_alloc_node() we can just defer to the slowpath __slab_alloc() which also works with cpu freelist, but under the local lock. In the free fastpath do_slab_free() we have to add a new local lock protected version of freeing to the cpu freelist, as the existing slowpath only works with the page freelist. Also update the comment about locking scheme in SLUB to reflect changes done by this series. [ Mike Galbraith : use local_lock() without irq in PREEMPT_RT scope; debugging of RT crashes resulting in put_cpu_partial() locking changes ] Signed-off-by: Vlastimil Babka commit 25c00c506e8176d03f9ad821cc349230dfb5dc1a Author: Vlastimil Babka Date: Fri May 21 14:03:23 2021 +0200 mm, slub: use migrate_disable() on PREEMPT_RT We currently use preempt_disable() (directly or via get_cpu_ptr()) to stabilize the pointer to kmem_cache_cpu. On PREEMPT_RT this would be incompatible with the list_lock spinlock. We can use migrate_disable() instead, but that increases overhead on !PREEMPT_RT as it's an unconditional function call. In order to get the best available mechanism on both PREEMPT_RT and !PREEMPT_RT, introduce private slub_get_cpu_ptr() and slub_put_cpu_ptr() wrappers and use them. Signed-off-by: Vlastimil Babka commit e0a043aa4145a14d6a8864847811491699a81310 Author: Vlastimil Babka Date: Wed Jul 28 12:26:27 2021 +0200 mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg Jann Horn reported [1] the following theoretically possible race: task A: put_cpu_partial() calls preempt_disable() task A: oldpage = this_cpu_read(s->cpu_slab->partial) interrupt: kfree() reaches unfreeze_partials() and discards the page task B (on another CPU): reallocates page as page cache task A: reads page->pages and page->pobjects, which are actually halves of the pointer page->lru.prev task B (on another CPU): frees page interrupt: allocates page as SLUB page and places it on the percpu partial list task A: this_cpu_cmpxchg() succeeds which would cause page->pages and page->pobjects to end up containing halves of pointers that would then influence when put_cpu_partial() happens and show up in root-only sysfs files. Maybe that's acceptable, I don't know. But there should probably at least be a comment for now to point out that we're reading union fields of a page that might be in a completely different state. Additionally, the this_cpu_cmpxchg() approach in put_cpu_partial() is only safe against s->cpu_slab->partial manipulation in ___slab_alloc() if the latter disables irqs, otherwise a __slab_free() in an irq handler could call put_cpu_partial() in the middle of ___slab_alloc() manipulating ->partial and corrupt it. This becomes an issue on RT after a local_lock is introduced in later patch. The fix means taking the local_lock also in put_cpu_partial() on RT. After debugging this issue, Mike Galbraith suggested [2] that to avoid different locking schemes on RT and !RT, we can just protect put_cpu_partial() with disabled irqs (to be converted to local_lock_irqsave() later) everywhere. This should be acceptable as it's not a fast path, and moving the actual partial unfreezing outside of the irq disabled section makes it short, and with the retry loop gone the code can be also simplified. In addition, the race reported by Jann should no longer be possible. [1] https://lore.kernel.org/lkml/CAG48ez1mvUuXwg0YPH5ANzhQLpbphqk-ZS+jbRz+H66fvm4FcA@mail.gmail.com/ [2] https://lore.kernel.org/linux-rt-users/e3470ab357b48bccfbd1f5133b982178a7d2befb.camel@gmx.de/ Reported-by: Jann Horn Suggested-by: Mike Galbraith Signed-off-by: Vlastimil Babka commit a2b4ae8bfd9c10e3c1c1966bd3c8d8b7c9026aaf Author: Vlastimil Babka Date: Fri Jun 4 12:55:55 2021 +0200 mm, slub: make slab_lock() disable irqs with PREEMPT_RT We need to disable irqs around slab_lock() (a bit spinlock) to make it irq-safe. Most calls to slab_lock() are nested under spin_lock_irqsave() which doesn't disable irqs on PREEMPT_RT, so add explicit disabling with PREEMPT_RT. The exception is cmpxchg_double_slab() which already disables irqs, so use a __slab_[un]lock() variant without irq disable there. slab_[un]lock() thus needs a flags pointer parameter, which is unused on !RT. free_debug_processing() now has two flags variables, which looks odd, but only one is actually used - the one used in spin_lock_irqsave() on !RT and the one used in slab_lock() on RT. As a result, __cmpxchg_double_slab() and cmpxchg_double_slab() become effectively identical on RT, as both will disable irqs, which is necessary on RT as most callers of this function also rely on irqsaving lock operations. Thus, assert that irqs are already disabled in __cmpxchg_double_slab() only on !RT and also change the VM_BUG_ON assertion to the more standard lockdep_assert one. Signed-off-by: Vlastimil Babka commit 94ef0304e2b8dc942f46c74a13841d6b61f61d2f Author: Sebastian Andrzej Siewior Date: Thu Jul 16 18:47:50 2020 +0200 mm: slub: make object_map_lock a raw_spinlock_t The variable object_map is protected by object_map_lock. The lock is always acquired in debug code and within already atomic context Make object_map_lock a raw_spinlock_t. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Vlastimil Babka commit 3e204d6b76b29274cc8e57f8bd8d9873f04a7f48 Author: Geert Uytterhoeven Date: Fri Sep 3 23:28:17 2021 -0700 Input: adc-keys - drop bogus __refdata annotation As the ADC ladder input driver does not have any code or data located in initmem, there is no need to annotate the adc_keys_driver structure with __refdata. Drop the annotation, to avoid suppressing future section warnings. Signed-off-by: Geert Uytterhoeven Acked-by: Alexandre Belloni Link: https://lore.kernel.org/r/7091e8213602be64826fd689a7337246d218f3b1.1626255421.git.geert+renesas@glider.be Signed-off-by: Dmitry Torokhov commit 7ec7c72fbf9db4c6479fbdae7162d047a9012788 Author: Colin Ian King Date: Fri Sep 3 23:22:22 2021 -0700 Input: Fix spelling mistake in Kconfig "useable" -> "usable" There is a spelling mistake in the Kconfig text. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210705100230.7583-1-colin.king@canonical.com Signed-off-by: Dmitry Torokhov commit ca595ac271688cc168da722e6f70fcf6ae4266f6 Author: Colin Ian King Date: Fri Sep 3 23:21:37 2021 -0700 Input: Fix spelling mistake in Kconfig "Modul" -> "Module" There is a spelling mistake in the Kconfig text. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210704095702.37567-1-colin.king@canonical.com Signed-off-by: Dmitry Torokhov commit 303fff2b8c77a85c62dbde3b27c24b084144c04c Author: Namjae Jeon Date: Fri Sep 3 07:09:44 2021 +0900 ksmbd: add validation for ndr read/write functions If ndr->length is smaller than expected size, ksmbd can access invalid access in ndr->data. This patch add validation to check ndr->offset is over ndr->length. and added exception handling to check return value of ndr read/write function. Cc: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 687c59e702f48e0eca91455d3ef3197b7b8a8314 Author: Namjae Jeon Date: Tue Aug 31 22:47:02 2021 +0900 ksmbd: remove unused ksmbd_file_table_flush function ksmbd_file_table_flush is a leftover from SMB1. This function is no longer needed as SMB1 has been removed from ksmbd. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 72d6cbb533d4309734606027fe083c4edb0aa7aa Author: Hyunchul Lee Date: Mon Aug 30 13:27:43 2021 +0900 ksmbd: smbd: fix dma mapping error in smb_direct_post_send_data Becase smb direct header is mapped and msg->num_sge already is incremented, the decrement should be removed from the condition. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d475866eeed89cc44ed54e0cd296537a68667b1b Author: Per Forlin Date: Mon Aug 30 13:23:04 2021 +0900 ksmbd: Reduce error log 'speed is unknown' to debug This log happens on servers with a network bridge since the bridge does not have a specified link speed. This is not a real error so change the error log to debug instead. Signed-off-by: Per Forlin Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 28a5d3de9d65058f7edf8e5aaaf6b0a8d8f4a29f Author: Christian Brauner Date: Thu Aug 26 17:05:17 2021 +0900 ksmbd: defer notify_change() call When ownership is changed we might in certain scenarios loose the ability to alter the inode after we changed ownership. This can e.g. happen when we are on an idmapped mount where uid 0 is mapped to uid 1000 and uid 1000 is mapped to uid 0. A caller with fs*id 1000 will be able to create files as *id 1000 on disk. They will also be able to change ownership of files owned by *id 0 to *id 1000 but they won't be able to change ownership in the other direction. This means acl operations following notify_change() would fail. Move the notify_change() call after the acls have been updated. This guarantees that we don't end up with spurious "hash value diff" warnings later on because we managed to change ownership but didn't manage to alter acls. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit db7fb6fe3d7a8eb05f2b74c6252771c9362f3b74 Author: Christian Brauner Date: Thu Aug 26 10:07:05 2021 +0900 ksmbd: remove setattr preparations in set_file_basic_info() Permission checking and copying over ownership information is the task of the underlying filesystem not ksmbd. The order is also wrong here. This modifies the inode before notify_change(). If notify_change() fails this will have changed ownership nonetheless. All of this is unnecessary though since the underlying filesystem's ->setattr handler will do all this (if required) by itself. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit eb5784f0c6efbe0db720ad7e34e097cea51c1afc Author: Christian Brauner Date: Mon Aug 23 17:13:55 2021 +0200 ksmbd: ensure error is surfaced in set_file_basic_info() It seems the error was accidently ignored until now. Make sure it is surfaced. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9467a0ce486c87a8f06ad492afa8b95686bff61f Author: Christian Brauner Date: Mon Aug 23 17:13:54 2021 +0200 ndr: fix translation in ndr_encode_posix_acl() The sid_to_id() helper encodes raw ownership information suitable for s*id handling. This is conceptually equivalent to reporting ownership information via stat to userspace. In this case the consumer is ksmbd instead of a regular user. So when encoding raw ownership information suitable for s*id handling later we need to map the id up according to the user namespace of ksmbd itself taking any idmapped mounts into account. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 55cd04d75e635ac915bf54586ec64057249508ec Author: Christian Brauner Date: Tue Aug 24 20:10:20 2021 +0900 ksmbd: fix translation in sid_to_id() The sid_to_id() functions is relevant when changing ownership of filesystem objects based on acl information. In this case we need to first translate the relevant s*ids into k*ids in ksmbd's user namespace and account for any idmapped mounts. Requesting a change in ownership requires the inverse translation to be applied when we would report ownership to userspace. So k*id_from_mnt() must be used here. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f0bb29d5c65b492ab82cce7b1e1dd00cbca28601 Author: Christian Brauner Date: Tue Aug 24 20:07:18 2021 +0900 ksmbd: fix subauth 0 handling in sid_to_id() It's not obvious why subauth 0 would be excluded from translation. This would lead to wrong results whenever a non-identity idmapping is used. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0e844efebdf9c03aed9ae1894f22762a8aee1a3b Author: Christian Brauner Date: Mon Aug 23 17:13:51 2021 +0200 ksmbd: fix translation in acl entries The ksmbd server performs translation of posix acls to smb acls. Currently the translation is wrong since the idmapping of the mount is used to map the ids into raw userspace ids but what is relevant is the user namespace of ksmbd itself. The user namespace of ksmbd itself which is the initial user namespace. The operation is similar to asking "What *ids would a userspace process see given that k*id in the relevant user namespace?". Before the final translation we need to apply the idmapping of the mount in case any is used. Add two simple helpers for ksmbd. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 43205ca7192aa5de46775fbf7a043222e76abac5 Author: Christian Brauner Date: Mon Aug 23 17:13:50 2021 +0200 ksmbd: fix translation in ksmbd_acls_fattr() When creating new filesystem objects ksmbd translates between k*ids and s*ids. For this it often uses struct smb_fattr and stashes the k*ids in cf_uid and cf_gid. Let cf_uid and cf_gid always contain the final information taking any potential idmapped mounts into account. When finally translation cf_*id into s*ids translate them into the user namespace of ksmbd since that is the relevant user namespace here. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3cdc20e72c3dacf22382fd15d3154e48d0efdec9 Author: Christian Brauner Date: Mon Aug 23 17:13:49 2021 +0200 ksmbd: fix translation in create_posix_rsp_buf() When transferring ownership information to the client the k*ids are translated into raw *ids before they are sent over the wire. The function currently erroneously translates the k*ids according to the mount's idmapping. Instead, reporting the owning *ids to userspace the underlying k*ids need to be mapped up in the caller's user namespace. This is how stat() works. The caller in this instance is ksmbd itself and ksmbd always runs in the initial user namespace. Translate according to that taking any potential idmapped mounts into account. Switch to from_k*id_munged() which ensures that the overflow*id is returned instead of the (*id_t)-1 when the k*id can't be translated. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 475d6f98804c09a48b5c815f7bd466fb4c1e743e Author: Christian Brauner Date: Mon Aug 23 17:13:48 2021 +0200 ksmbd: fix translation in smb2_populate_readdir_entry() When transferring ownership information to the client the k*ids are translated into raw *ids before they are sent over the wire. The function currently erroneously translates the k*ids according to the mount's idmapping. Instead, reporting the owning *ids to userspace the underlying k*ids need to be mapped up in the caller's user namespace. This is how stat() works. The caller in this instance is ksmbd itself and ksmbd always runs in the initial user namespace. Translate according to that. The idmapping of the mount is already taken into account by the lower filesystem and so kstat->*id will contain the mapped k*ids. Switch to from_k*id_munged() which ensures that the overflow*id is returned instead of the (*id_t)-1 when the k*id can't be translated. Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit da1e7ada5b62859b3a9d236a44035ae9d8f3f7e1 Author: Christian Brauner Date: Mon Aug 23 17:13:47 2021 +0200 ksmbd: fix lookup on idmapped mounts It's great that the new in-kernel ksmbd server will support idmapped mounts out of the box! However, lookup is currently broken. Lookup helpers such as lookup_one_len() call inode_permission() internally to ensure that the caller is privileged over the inode of the base dentry they are trying to lookup under. So the permission checking here is currently wrong. Linux v5.15 will gain a new lookup helper lookup_one() that does take idmappings into account. I've added it as part of my patch series to make btrfs support idmapped mounts. The new helper is in linux-next as part of David's (Sterba) btrfs for-next branch as commit c972214c133b ("namei: add mapping aware lookup helper"). I've said it before during one of my first reviews: I would very much recommend adding fstests to [1]. It already seems to have very rudimentary cifs support. There is a completely generic idmapped mount testsuite that supports idmapped mounts. [1]: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/ Cc: Colin Ian King Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: David Sterba Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1c500ad706383f1a6609e63d0b5d1723fd84dab9 Author: Tetsuo Handa Date: Thu Sep 2 09:07:35 2021 +0900 loop: reduce the loop_ctl_mutex scope syzbot is reporting circular locking problem at __loop_clr_fd() [1], for commit a160c6159d4a0cf8 ("block: add an optional probe callback to major_names") is calling the module's probe function with major_names_lock held. Fortunately, since commit 990e78116d38059c ("block: loop: fix deadlock between open and remove") stopped holding loop_ctl_mutex in lo_open(), current role of loop_ctl_mutex is to serialize access to loop_index_idr and loop_add()/loop_remove(); in other words, management of id for IDR. To avoid holding loop_ctl_mutex during whole add/remove operation, use a bool flag to indicate whether the loop device is ready for use. loop_unregister_transfer() which is called from cleanup_cryptoloop() currently has possibility of use-after-free problem due to lack of serialization between kfree() from loop_remove() from loop_control_remove() and mutex_lock() from unregister_transfer_cb(). But since lo->lo_encryption should be already NULL when this function is called due to module unload, and commit 222013f9ac30b9ce ("cryptoloop: add a deprecation warning") indicates that we will remove this function shortly, this patch updates this function to emit warning instead of checking lo->lo_encryption. Holding loop_ctl_mutex in loop_exit() is pointless, for all users must close /dev/loop-control and /dev/loop$num (in order to drop module's refcount to 0) before loop_exit() starts, and nobody can open /dev/loop-control or /dev/loop$num afterwards. Link: https://syzkaller.appspot.com/bug?id=7bb10e8b62f83e4d445cdf4c13d69e407e629558 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/adb1e792-fc0e-ee81-7ea0-0906fc36419d@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 54357f0c9149c871e5e4b83ad385a6f2ad3a749f Author: Thomas Gleixner Date: Tue Aug 10 15:26:25 2021 +0200 tracing: Add migrate-disabled counter to tracing output. migrate_disable() forbids task migration to another CPU. It is available since v5.11 and has already users such as highmem or BPF. It is useful to observe this task state in tracing which already has other states like the preemption counter. Instead of adding the migrate disable counter as a new entry to struct trace_entry, which would extend the whole struct by four bytes, it is squashed into the preempt-disable counter. The lower four bits represent the preemption counter, the upper four bits represent the migrate disable counter. Both counter shouldn't exceed 15 but if they do, there is a safety net which caps the value at 15. Add the migrate-disable counter to the trace entry so it shows up in the trace. Due to the users mentioned above, it is already possible to observe it: | bash-1108 [000] ...21 73.950578: rss_stat: mm_id=2213312838 curr=0 type=MM_ANONPAGES size=8192B | bash-1108 [000] d..31 73.951222: irq_disable: caller=flush_tlb_mm_range+0x115/0x130 parent=ptep_clear_flush+0x42/0x50 | bash-1108 [000] d..31 73.951222: tlb_flush: pages:1 reason:local mm shootdown (3) The last value is the migrate-disable counter. Things that popped up: - trace_print_lat_context() does not print the migrate counter. Not sure if it should. It is used in "verbose" mode and uses 8 digits and I'm not sure ther is something processing the value. - trace_define_common_fields() now defines a different variable. This probably breaks things. No ide what to do in order to preserve the old behaviour. Since this is used as a filter it should be split somehow to be able to match both nibbles here. Link: https://lkml.kernel.org/r/20210810132625.ylssabmsrkygokuv@linutronix.de Signed-off-by: Thomas Gleixner [bigeasy: patch description.] Signed-off-by: Sebastian Andrzej Siewior [ SDR: Removed change to common_preempt_count field name ] Signed-off-by: Steven Rostedt (VMware) commit 89c2b3b74918200e46699338d7bcc19b1ea12110 Author: Pavel Begunkov Date: Mon Aug 23 11:18:45 2021 +0100 io_uring: reexpand under-reexpanded iters [ 74.211232] BUG: KASAN: stack-out-of-bounds in iov_iter_revert+0x809/0x900 [ 74.212778] Read of size 8 at addr ffff888025dc78b8 by task syz-executor.0/828 [ 74.214756] CPU: 0 PID: 828 Comm: syz-executor.0 Not tainted 5.14.0-rc3-next-20210730 #1 [ 74.216525] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 74.219033] Call Trace: [ 74.219683] dump_stack_lvl+0x8b/0xb3 [ 74.220706] print_address_description.constprop.0+0x1f/0x140 [ 74.224226] kasan_report.cold+0x7f/0x11b [ 74.226085] iov_iter_revert+0x809/0x900 [ 74.227960] io_write+0x57d/0xe40 [ 74.232647] io_issue_sqe+0x4da/0x6a80 [ 74.242578] __io_queue_sqe+0x1ac/0xe60 [ 74.245358] io_submit_sqes+0x3f6e/0x76a0 [ 74.248207] __do_sys_io_uring_enter+0x90c/0x1a20 [ 74.257167] do_syscall_64+0x3b/0x90 [ 74.257984] entry_SYSCALL_64_after_hwframe+0x44/0xae old_size = iov_iter_count(); ... iov_iter_revert(old_size - iov_iter_count()); If iov_iter_revert() is done base on the initial size as above, and the iter is truncated and not reexpanded in the middle, it miscalculates borders causing problems. This trace is due to no one reexpanding after generic_write_checks(). Now iters store how many bytes has been truncated, so reexpand them to the initial state right before reverting. Cc: stable@vger.kernel.org Reported-by: Palash Oswal Reported-by: Sudip Mukherjee Reported-and-tested-by: syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Signed-off-by: Al Viro commit 2112ff5ce0c1128fe7b4d19cfe7f2b8ce5b595fa Author: Pavel Begunkov Date: Mon Aug 23 11:18:44 2021 +0100 iov_iter: track truncated size Remember how many bytes were truncated and reverted back. Because not reexpanded iterators don't always work well with reverting, we may need to know that to reexpand ourselves when needed. Signed-off-by: Pavel Begunkov Signed-off-by: Al Viro commit 10905b4a68cc58863e04d5ea5864323cb9341f9b Merge: 52a67fbf0cffc 730affed24bff Author: Jakub Kicinski Date: Fri Sep 3 16:20:36 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Protect nft_ct template with global mutex, from Pavel Skripkin. 2) Two recent commits switched inet rt and nexthop exception hashes from jhash to siphash. If those two spots are problematic then conntrack is affected as well, so switch voer to siphash too. While at it, add a hard upper limit on chain lengths and reject insertion if this is hit. Patches from Florian Westphal. 3) Fix use-after-scope in nf_socket_ipv6 reported by KASAN, from Benjamin Hesmans. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf: netfilter: socket: icmp6: fix use-after-scope netfilter: refuse insertion if chain has grown too large netfilter: conntrack: switch to siphash netfilter: conntrack: sanitize table size default settings netfilter: nft_ct: protect nft_ct_pcpu_template_refcnt with mutex ==================== Link: https://lore.kernel.org/r/20210903163020.13741-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 52a67fbf0cffcc1a0d1272cf0522cb193a0d0bd6 Author: Dan Carpenter Date: Fri Sep 3 16:18:56 2021 +0300 ionic: fix a sleeping in atomic bug This code is holding spin_lock_bh(&lif->rx_filters.lock); so the allocation needs to be atomic. Fixes: 969f84394604 ("ionic: sync the filters in the work task") Signed-off-by: Dan Carpenter Signed-off-by: Shannon Nelson Link: https://lore.kernel.org/r/20210903131856.GA25934@kili Signed-off-by: Jakub Kicinski commit 5a836bf6b09f99ead1b69457ff39ab3011ece57b Author: Sebastian Andrzej Siewior Date: Fri Feb 26 17:11:55 2021 +0100 mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context flush_all() flushes a specific SLAB cache on each CPU (where the cache is present). The deactivate_slab()/__free_slab() invocation happens within IPI handler and is problematic for PREEMPT_RT. The flush operation is not a frequent operation or a hot path. The per-CPU flush operation can be moved to within a workqueue. Because a workqueue handler, unlike IPI handler, does not disable irqs, flush_slab() now has to disable them for working with the kmem_cache_cpu fields. deactivate_slab() is safe to call with irqs enabled. [vbabka@suse.cz: adapt to new SLUB changes] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Vlastimil Babka commit 08beb547a1f7b66fbeaf40f2d3675a3ea0060c0b Author: Vlastimil Babka Date: Thu Jun 3 19:17:42 2021 +0200 mm, slab: split out the cpu offline variant of flush_slab() flush_slab() is called either as part IPI handler on given live cpu, or as a cleanup on behalf of another cpu that went offline. The first case needs to protect updating the kmem_cache_cpu fields with disabled irqs. Currently the whole call happens with irqs disabled by the IPI handler, but the following patch will change from IPI to workqueue, and flush_slab() will have to disable irqs (to be replaced with a local lock later) in the critical part. To prepare for this change, replace the call to flush_slab() for the dead cpu handling with an opencoded variant that will not disable irqs nor take a local lock. Suggested-by: Mike Galbraith Signed-off-by: Vlastimil Babka commit 0e7ac738f785e695acfa1203a87f6a505305542a Author: Vlastimil Babka Date: Fri May 21 01:48:56 2021 +0200 mm, slub: don't disable irqs in slub_cpu_dead() slub_cpu_dead() cleans up for an offlined cpu from another cpu and calls only functions that are now irq safe, so we don't need to disable irqs anymore. Signed-off-by: Vlastimil Babka commit 7cf9f3ba2f02216b2303e648c0c5439f00191008 Author: Vlastimil Babka Date: Fri May 21 01:16:54 2021 +0200 mm, slub: only disable irq with spin_lock in __unfreeze_partials() __unfreeze_partials() no longer needs to have irqs disabled, except for making the spin_lock operations irq-safe, so convert the spin_locks operations and remove the separate irq handling. Signed-off-by: Vlastimil Babka commit fc1455f4e023b278ca73cb729bc50037dc48c45c Author: Vlastimil Babka Date: Thu May 20 16:39:51 2021 +0200 mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing Unfreezing partial list can be split to two phases - detaching the list from struct kmem_cache_cpu, and processing the list. The whole operation does not need to be protected by disabled irqs. Restructure the code to separate the detaching (with disabled irqs) and unfreezing (with irq disabling to be reduced in the next patch). Also, unfreeze_partials() can be called from another cpu on behalf of a cpu that is being offlined, where disabling irqs on the local cpu has no sense, so restructure the code as follows: - __unfreeze_partials() is the bulk of unfreeze_partials() that processes the detached percpu partial list - unfreeze_partials() detaches list from current cpu with irqs disabled and calls __unfreeze_partials() - unfreeze_partials_cpu() is to be called for the offlined cpu so it needs no irq disabling, and is called from __flush_cpu_slab() - flush_cpu_slab() is for the local cpu thus it needs to call unfreeze_partials(). So it can't simply call __flush_cpu_slab(smp_processor_id()) anymore and we have to open-code the proper calls. Signed-off-by: Vlastimil Babka commit c2f973ba42ed1fe7b2ca71e93767afeacc88caa0 Author: Vlastimil Babka Date: Thu May 20 14:18:12 2021 +0200 mm, slub: detach whole partial list at once in unfreeze_partials() Instead of iterating through the live percpu partial list, detach it from the kmem_cache_cpu at once. This is simpler and will allow further optimization. Signed-off-by: Vlastimil Babka commit 8de06a6f48f2062444a8872eb7f5abbfe65b5ecd Author: Vlastimil Babka Date: Thu May 20 14:01:57 2021 +0200 mm, slub: discard slabs in unfreeze_partials() without irqs disabled No need for disabled irqs when discarding slabs, so restore them before discarding. Signed-off-by: Vlastimil Babka commit f3ab8b6b9228176920e1c73fa24d2db62268aa48 Author: Vlastimil Babka Date: Thu May 20 14:00:03 2021 +0200 mm, slub: move irq control into unfreeze_partials() unfreeze_partials() can be optimized so that it doesn't need irqs disabled for the whole time. As the first step, move irq control into the function and remove it from the put_cpu_partial() caller. Signed-off-by: Vlastimil Babka commit cfdf836e1f93df56ddd9a1d48b2deadf02f441fe Author: Vlastimil Babka Date: Wed May 12 14:04:43 2021 +0200 mm, slub: call deactivate_slab() without disabling irqs The function is now safe to be called with irqs enabled, so move the calls outside of irq disabled sections. When called from ___slab_alloc() -> flush_slab() we have irqs disabled, so to reenable them before deactivate_slab() we need to open-code flush_slab() in ___slab_alloc() and reenable irqs after modifying the kmem_cache_cpu fields. But that means a IRQ handler meanwhile might have assigned a new page to kmem_cache_cpu.page so we have to retry the whole check. The remaining callers of flush_slab() are the IPI handler which has disabled irqs anyway, and slub_cpu_dead() which will be dealt with in the following patch. Signed-off-by: Vlastimil Babka commit 3406e91bce47383f03fe839f02f7f4bef78c832c Author: Vlastimil Babka Date: Wed May 12 13:59:58 2021 +0200 mm, slub: make locking in deactivate_slab() irq-safe dectivate_slab() now no longer touches the kmem_cache_cpu structure, so it will be possible to call it with irqs enabled. Just convert the spin_lock calls to their irq saving/restoring variants to make it irq-safe. Note we now have to use cmpxchg_double_slab() for irq-safe slab_lock(), because in some situations we don't take the list_lock, which would disable irqs. Signed-off-by: Vlastimil Babka commit a019d20162586ae5b14bf26c94f1943b1d24a832 Author: Vlastimil Babka Date: Wed May 12 13:53:34 2021 +0200 mm, slub: move reset of c->page and freelist out of deactivate_slab() deactivate_slab() removes the cpu slab by merging the cpu freelist with slab's freelist and putting the slab on the proper node's list. It also sets the respective kmem_cache_cpu pointers to NULL. By extracting the kmem_cache_cpu operations from the function, we can make it not dependent on disabled irqs. Also if we return a single free pointer from ___slab_alloc, we no longer have to assign kmem_cache_cpu.page before deactivation or care if somebody preempted us and assigned a different page to our kmem_cache_cpu in the process. Signed-off-by: Vlastimil Babka commit 4b1f449dedd2ff1eede4ced08a503e13c8d668ce Author: Vlastimil Babka Date: Tue May 11 17:45:26 2021 +0200 mm, slub: stop disabling irqs around get_partial() The function get_partial() does not need to have irqs disabled as a whole. It's sufficient to convert spin_lock operations to their irq saving/restoring versions. As a result, it's now possible to reach the page allocator from the slab allocator without disabling and re-enabling interrupts on the way. Signed-off-by: Vlastimil Babka commit 9f101ee89465e0b2c11b477f5b55e03039b2c308 Author: Vlastimil Babka Date: Tue May 11 16:56:09 2021 +0200 mm, slub: check new pages with restored irqs Building on top of the previous patch, re-enable irqs before checking new pages. alloc_debug_processing() is now called with enabled irqs so we need to remove VM_BUG_ON(!irqs_disabled()); in check_slab() - there doesn't seem to be a need for it anyway. Signed-off-by: Vlastimil Babka commit 3f2b77e35a4fc3c83132a1a1a2fc7a2c803a2514 Author: Vlastimil Babka Date: Tue May 11 16:37:51 2021 +0200 mm, slub: validate slab from partial list or page allocator before making it cpu slab When we obtain a new slab page from node partial list or page allocator, we assign it to kmem_cache_cpu, perform some checks, and if they fail, we undo the assignment. In order to allow doing the checks without irq disabled, restructure the code so that the checks are done first, and kmem_cache_cpu.page assignment only after they pass. Signed-off-by: Vlastimil Babka commit 6c1dbb674c5cf76d23381160577d34bead60b76b Author: Vlastimil Babka Date: Mon May 10 16:30:01 2021 +0200 mm, slub: restore irqs around calling new_slab() allocate_slab() currently re-enables irqs before calling to the page allocator. It depends on gfpflags_allow_blocking() to determine if it's safe to do so. Now we can instead simply restore irq before calling it through new_slab(). The other caller early_kmem_cache_node_alloc() is unaffected by this. Signed-off-by: Vlastimil Babka commit fa417ab7506f9234100e249938d13e94a8c404e8 Author: Vlastimil Babka Date: Mon May 10 13:56:17 2021 +0200 mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc() Continue reducing the irq disabled scope. Check for per-cpu partial slabs with first with irqs enabled and then recheck with irqs disabled before grabbing the slab page. Mostly preparatory for the following patches. Signed-off-by: Vlastimil Babka commit 0b303fb402862dcb7948eeeed2439bd8c99948b5 Author: Vlastimil Babka Date: Sat May 8 02:28:02 2021 +0200 mm, slub: do initial checks in ___slab_alloc() with irqs enabled As another step of shortening irq disabled sections in ___slab_alloc(), delay disabling irqs until we pass the initial checks if there is a cached percpu slab and it's suitable for our allocation. Now we have to recheck c->page after actually disabling irqs as an allocation in irq handler might have replaced it. Because we call pfmemalloc_match() as one of the checks, we might hit VM_BUG_ON_PAGE(!PageSlab(page)) in PageSlabPfmemalloc in case we get interrupted and the page is freed. Thus introduce a pfmemalloc_match_unsafe() variant that lacks the PageSlab check. Signed-off-by: Vlastimil Babka Acked-by: Mel Gorman commit e500059ba55268e1c5212632e4f21e45f54dc6d9 Author: Vlastimil Babka Date: Fri May 7 19:32:31 2021 +0200 mm, slub: move disabling/enabling irqs to ___slab_alloc() Currently __slab_alloc() disables irqs around the whole ___slab_alloc(). This includes cases where this is not needed, such as when the allocation ends up in the page allocator and has to awkwardly enable irqs back based on gfp flags. Also the whole kmem_cache_alloc_bulk() is executed with irqs disabled even when it hits the __slab_alloc() slow path, and long periods with disabled interrupts are undesirable. As a first step towards reducing irq disabled periods, move irq handling into ___slab_alloc(). Callers will instead prevent the s->cpu_slab percpu pointer from becoming invalid via get_cpu_ptr(), thus preempt_disable(). This does not protect against modification by an irq handler, which is still done by disabled irq for most of ___slab_alloc(). As a small immediate benefit, slab_out_of_memory() from ___slab_alloc() is now called with irqs enabled. kmem_cache_alloc_bulk() disables irqs for its fastpath and then re-enables them before calling ___slab_alloc(), which then disables them at its discretion. The whole kmem_cache_alloc_bulk() operation also disables preemption. When ___slab_alloc() calls new_slab() to allocate a new page, re-enable preemption, because new_slab() will re-enable interrupts in contexts that allow blocking (this will be improved by later patches). The patch itself will thus increase overhead a bit due to disabled preemption (on configs where it matters) and increased disabling/enabling irqs in kmem_cache_alloc_bulk(), but that will be gradually improved in the following patches. Note in __slab_alloc() we need to change the #ifdef CONFIG_PREEMPT guard to CONFIG_PREEMPT_COUNT to make sure preempt disable/enable is properly paired in all configurations. On configs without involuntary preemption and debugging the re-read of kmem_cache_cpu pointer is still compiled out as it was before. [ Mike Galbraith : Fix kmem_cache_alloc_bulk() error path ] Signed-off-by: Vlastimil Babka commit 9b4bc85a69f57fea93c1f359b393d2c24857d2f5 Author: Vlastimil Babka Date: Tue May 18 02:01:39 2021 +0200 mm, slub: simplify kmem_cache_cpu and tid setup In slab_alloc_node() and do_slab_free() fastpaths we need to guarantee that our kmem_cache_cpu pointer is from the same cpu as the tid value. Currently that's done by reading the tid first using this_cpu_read(), then the kmem_cache_cpu pointer and verifying we read the same tid using the pointer and plain READ_ONCE(). This can be simplified to just fetching kmem_cache_cpu pointer and then reading tid using the pointer. That guarantees they are from the same cpu. We don't need to read the tid using this_cpu_read() because the value will be validated by this_cpu_cmpxchg_double(), making sure we are on the correct cpu and the freelist didn't change by anyone preempting us since reading the tid. Signed-off-by: Vlastimil Babka Acked-by: Mel Gorman commit 1572df7cbcb48936c880f2d2de524f8e47ab65d4 Author: Vlastimil Babka Date: Tue May 11 18:25:09 2021 +0200 mm, slub: restructure new page checks in ___slab_alloc() When we allocate slab object from a newly acquired page (from node's partial list or page allocator), we usually also retain the page as a new percpu slab. There are two exceptions - when pfmemalloc status of the page doesn't match our gfp flags, or when the cache has debugging enabled. The current code for these decisions is not easy to follow, so restructure it and add comments. The new structure will also help with the following changes. No functional change. Signed-off-by: Vlastimil Babka Acked-by: Mel Gorman commit 75c8ff281d7a6faa650bb9b32052f3ee1b5f8e83 Author: Vlastimil Babka Date: Tue May 11 14:05:22 2021 +0200 mm, slub: return slab page from get_partial() and set c->page afterwards The function get_partial() finds a suitable page on a partial list, acquires and returns its freelist and assigns the page pointer to kmem_cache_cpu. In later patch we will need more control over the kmem_cache_cpu.page assignment, so instead of passing a kmem_cache_cpu pointer, pass a pointer to a pointer to a page that get_partial() can fill and the caller can assign the kmem_cache_cpu.page pointer. No functional change as all of this still happens with disabled IRQs. Signed-off-by: Vlastimil Babka commit 53a0de06e50acb372c75d87fcc72ddfdf4a060ee Author: Vlastimil Babka Date: Tue May 11 13:01:34 2021 +0200 mm, slub: dissolve new_slab_objects() into ___slab_alloc() The later patches will need more fine grained control over individual actions in ___slab_alloc(), the only caller of new_slab_objects(), so dissolve it there. This is a preparatory step with no functional change. The only minor change is moving WARN_ON_ONCE() for using a constructor together with __GFP_ZERO to new_slab(), which makes it somewhat less frequent, but still able to catch a development change introducing a systematic misuse. Signed-off-by: Vlastimil Babka Acked-by: Christoph Lameter Acked-by: Mel Gorman commit 2a904905ae041504aefaf8fc7144d31b940443e0 Author: Vlastimil Babka Date: Tue May 11 12:45:48 2021 +0200 mm, slub: extract get_partial() from new_slab_objects() The later patches will need more fine grained control over individual actions in ___slab_alloc(), the only caller of new_slab_objects(), so this is a first preparatory step with no functional change. This adds a goto label that appears unnecessary at this point, but will be useful for later changes. Signed-off-by: Vlastimil Babka Acked-by: Christoph Lameter commit 2fc2a7a62eb58650e71b4550cf6fa6cc0a75b2d2 Author: Jens Axboe Date: Fri Sep 3 16:55:26 2021 -0600 io_uring: io_uring_complete() trace should take an integer It currently takes a long, and while that's normally OK, the io_uring limit is an int. Internally in io_uring it's an int, but sometimes it's passed as a long. That can yield confusing results where a completions seems to generate a huge result: ou-sqp-1297-1298 [001] ...1 788.056371: io_uring_complete: ring 000000000e98e046, user_data 0x0, result 4294967171, cflags 0 which is due to -ECANCELED being stored in an unsigned, and then passed in as a long. Using the right int type, the trace looks correct: iou-sqp-338-339 [002] ...1 15.633098: io_uring_complete: ring 00000000e0ac60cf, user_data 0x0, result -125, cflags 0 Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit f1583cb1be35c23df60b1c39e3e7e6704d749d0b Merge: b250e6d141ce4 67d6d80d90fb2 Author: Linus Torvalds Date: Fri Sep 3 15:55:41 2021 -0700 Merge tag 'linux-kselftest-next-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest updates from Shuah Khan: "Fixes to build and test failures: - openat2 test failure for O_LARGEFILE flag on ARM64 - x86 test build failures related to glibc 2.34 adding support for variable sized MINSIGSTKSZ and SIGSTKSZ - removing obsolete configs in sync and cpufreq config files - minor spelling and duplicate header include cleanups" * tag 'linux-kselftest-next-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/cpufreq: Rename DEBUG_PI_LIST to DEBUG_PLIST selftests/sync: Remove the deprecated config SYNC selftests: safesetid: Fix spelling mistake "cant" -> "can't" selftests/x86: Fix error: variably modified 'altstack_data' at file scope kselftest:sched: remove duplicate include in cs_prctl_test.c selftests: openat2: Fix testing failure for O_LARGEFILE flag commit b250e6d141ce4f0d0ada60e4b5db577050e5feb0 Merge: 4e71add02821b bc7cd2dd1f8e5 Author: Linus Torvalds Date: Fri Sep 3 15:33:47 2021 -0700 Merge tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Add -s option (strict mode) to merge_config.sh to make it fail when any symbol is redefined. - Show a warning if a different compiler is used for building external modules. - Infer --target from ARCH for CC=clang to let you cross-compile the kernel without CROSS_COMPILE. - Make the integrated assembler default (LLVM_IAS=1) for CC=clang. - Add to the kernel source instead of borrowing from the compiler. - Add Nick Desaulniers as a Kbuild reviewer. - Drop stale cc-option tests. - Fix the combination of CONFIG_TRIM_UNUSED_KSYMS and CONFIG_LTO_CLANG to handle symbols in inline assembly. - Show a warning if 'FORCE' is missing for if_changed rules. - Various cleanups * tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (39 commits) kbuild: redo fake deps at include/ksym/*.h kbuild: clean up objtool_args slightly modpost: get the *.mod file path more simply checkkconfigsymbols.py: Fix the '--ignore' option kbuild: merge vmlinux_link() between ARCH=um and other architectures kbuild: do not remove 'linux' link in scripts/link-vmlinux.sh kbuild: merge vmlinux_link() between the ordinary link and Clang LTO kbuild: remove stale *.symversions kbuild: remove unused quiet_cmd_update_lto_symversions gen_compile_commands: extract compiler command from a series of commands x86: remove cc-option-yn test for -mtune= arc: replace cc-option-yn uses with cc-option s390: replace cc-option-yn uses with cc-option ia64: move core-y in arch/ia64/Makefile to arch/ia64/Kbuild sparc: move the install rule to arch/sparc/Makefile security: remove unneeded subdir-$(CONFIG_...) kbuild: sh: remove unused install script kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y kbuild: Switch to 'f' variants of integrated assembler flag kbuild: Shuffle blank line to improve comment meaning ... commit 4e71add02821bdd204dd29c35e66baecc9b6a235 Merge: 7cca308cfdc07 8b7084b848cd9 Author: Linus Torvalds Date: Fri Sep 3 15:21:54 2021 -0700 Merge branch 'stable/for-linus-5.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft Pull ibft fix from Konrad Rzeszutek Wilk: "An arm64 compile fix for the new code that fixed the iBFT KASLR handling. I missed the original 0-day build email report" * 'stable/for-linus-5.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft: iscsi_ibft: Fix isa_bus_to_virt not working under ARM commit 976b805c782a57256e08aeaab45a64536b8887cf Author: Vlastimil Babka Date: Tue Jun 8 01:19:03 2021 +0200 mm, slub: remove redundant unfreeze_partials() from put_cpu_partial() Commit d6e0b7fa1186 ("slub: make dead caches discard free slabs immediately") introduced cpu partial flushing for kmemcg caches, based on setting the target cpu_partial to 0 and adding a flushing check in put_cpu_partial(). This code that sets cpu_partial to 0 was later moved by c9fc586403e7 ("slab: introduce __kmemcg_cache_deactivate()") and ultimately removed by 9855609bde03 ("mm: memcg/slab: use a single set of kmem_caches for all accounted allocations"). However the check and flush in put_cpu_partial() was never removed, although it's effectively a dead code. So this patch removes it. Note that d6e0b7fa1186 also added preempt_disable()/enable() to unfreeze_partials() which could be thus also considered unnecessary. But further patches will rely on it, so keep it. Signed-off-by: Vlastimil Babka commit 84048039d7774c363951ee6fc41c5d26f50f72fd Author: Vlastimil Babka Date: Fri May 21 01:25:06 2021 +0200 mm, slub: don't disable irq for debug_check_no_locks_freed() In slab_free_hook() we disable irqs around the debug_check_no_locks_freed() call, which is unnecessary, as irqs are already being disabled inside the call. This seems to be leftover from the past where there were more calls inside the irq disabled sections. Remove the irq disable/enable operations. Mel noted: > Looks like it was needed for kmemcheck which went away back in 4.15 Signed-off-by: Vlastimil Babka Acked-by: Mel Gorman commit 0a19e7dd928800da66efe429c25b0adc3a07c534 Author: Vlastimil Babka Date: Sun May 23 01:37:07 2021 +0200 mm, slub: allocate private object map for validate_slab_cache() validate_slab_cache() is called either to handle a sysfs write, or from a self-test context. In both situations it's straightforward to preallocate a private object bitmap instead of grabbing the shared static one meant for critical sections, so let's do that. Signed-off-by: Vlastimil Babka Acked-by: Christoph Lameter Acked-by: Mel Gorman commit b3fd64e1451b5efd94aa0ebc755e02558e6f3ca1 Author: Vlastimil Babka Date: Sun May 23 01:28:37 2021 +0200 mm, slub: allocate private object map for debugfs listings Slub has a static spinlock protected bitmap for marking which objects are on freelist when it wants to list them, for situations where dynamically allocating such map can lead to recursion or locking issues, and on-stack bitmap would be too large. The handlers of debugfs files alloc_traces and free_traces also currently use this shared bitmap, but their syscall context makes it straightforward to allocate a private map before entering locked sections, so switch these processing paths to use a private bitmap. Signed-off-by: Vlastimil Babka Acked-by: Christoph Lameter Acked-by: Mel Gorman commit eafb1d64030abf5f885026c2074d120c13e0ca9d Author: Vlastimil Babka Date: Fri May 28 14:32:10 2021 +0200 mm, slub: don't call flush_all() from slab_debug_trace_open() slab_debug_trace_open() can only be called on caches with SLAB_STORE_USER flag and as with all slub debugging flags, such caches avoid cpu or percpu partial slabs altogether, so there's nothing to flush. Signed-off-by: Vlastimil Babka Acked-by: Christoph Lameter commit abf36fe0be7d754f2a1c733d684d11474e85b7ea Author: Alyssa Rosenzweig Date: Fri Sep 3 11:18:26 2021 -0400 docs: kernel-hacking: Remove inappropriate text Remove inappropriate sexual (and ableist) text from the locking documentation, aligning it with the kernel code-of-conduct. As the text was unrelated to locking, this change streamlines the document and improves readability. Signed-off-by: Alyssa Rosenzweig Link: https://lore.kernel.org/r/20210903151826.6300-1-alyssa@rosenzweig.io Signed-off-by: Jonathan Corbet commit d66e3edee7af87fe212df611ab9846b987a5070f Author: Thomas Gleixner Date: Fri Sep 3 22:47:06 2021 +0200 futex: Remove unused variable 'vpid' in futex_proxy_trylock_atomic() The recent bug fix left the variable 'vpid' and an assignment to it around, but the variable is otherwise unused. clang dose not complain even with W=1, but gcc exposed this. Fixes: 4f07ec0d76f2 ("futex: Prevent inconsistent state and exit race") Signed-off-by: Thomas Gleixner commit 7cca308cfdc0725363ac5943dca9dcd49cc1d2d5 Merge: 11d5576880aed a3314262eede9 Author: Linus Torvalds Date: Fri Sep 3 11:22:50 2021 -0700 Merge tag 'powerpc-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Convert pseries & powernv to use MSI IRQ domains. - Rework the pseries CPU numbering so that CPUs that are removed, and later re-added, are given a CPU number on the same node as previously, when possible. - Add support for a new more flexible device-tree format for specifying NUMA distances. - Convert powerpc to GENERIC_PTDUMP. - Retire sbc8548 and sbc8641d board support. - Various other small features and fixes. Thanks to Alexey Kardashevskiy, Aneesh Kumar K.V, Anton Blanchard, Cédric Le Goater, Christophe Leroy, Emmanuel Gil Peyrot, Fabiano Rosas, Fangrui Song, Finn Thain, Gautham R. Shenoy, Hari Bathini, Joel Stanley, Jordan Niethe, Kajol Jain, Laurent Dufour, Leonardo Bras, Lukas Bulwahn, Marc Zyngier, Masahiro Yamada, Michal Suchanek, Nathan Chancellor, Nicholas Piggin, Parth Shah, Paul Gortmaker, Pratik R. Sampat, Randy Dunlap, Sebastian Andrzej Siewior, Srikar Dronamraju, Wan Jiabing, Xiongwei Song, and Zheng Yongjun. * tag 'powerpc-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (154 commits) powerpc/bug: Cast to unsigned long before passing to inline asm powerpc/ptdump: Fix generic ptdump for 64-bit KVM: PPC: Fix clearing never mapped TCEs in realmode powerpc/pseries/iommu: Rename "direct window" to "dma window" powerpc/pseries/iommu: Make use of DDW for indirect mapping powerpc/pseries/iommu: Find existing DDW with given property name powerpc/pseries/iommu: Update remove_dma_window() to accept property name powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw() powerpc/pseries/iommu: Allow DDW windows starting at 0x00 powerpc/pseries/iommu: Add ddw_list_new_entry() helper powerpc/pseries/iommu: Add iommu_pseries_alloc_table() helper powerpc/kernel/iommu: Add new iommu_table_in_use() helper powerpc/pseries/iommu: Replace hard-coded page shift powerpc/numa: Update cpu_cpu_map on CPU online/offline powerpc/numa: Print debug statements only when required powerpc/numa: convert printk to pr_xxx powerpc/numa: Drop dbg in favour of pr_debug powerpc/smp: Enable CACHE domain for shared processor powerpc/smp: Update cpu_core_map on all PowerPc systems ... commit 11d5576880aed34b8aa4e8049afdab92793b071f Merge: d6742212c0c6c c42813b71a06a Author: Linus Torvalds Date: Fri Sep 3 11:15:49 2021 -0700 Merge tag 'for-5.15/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "Fix an unaligned-access crash in the bootloader and drop asm/swab.h" * tag 'for-5.15/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix unaligned-access crash in bootloader parisc: Drop __arch_swab16(), arch_swab24(), _arch_swab32() and __arch_swab64() functions commit 2cfa946be843834d937e0914552d4967ffd421fc Author: Konrad Dybcio Date: Fri Sep 3 12:17:59 2021 +0200 clk: qcom: gcc-sm6350: Remove unused variable In the commit "clk: qcom: Add SM6350 GCC driver" (no hash yet) an unused variable has been overlooked. Remove it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/5b7edab0-4756-94d0-d601-050120cbf4cb@somainline.org Reported-by: kernel test robot Signed-off-by: Stephen Boyd commit d6742212c0c6ccee2351499db80acba71fa36052 Merge: 603eefda5fcf8 bea6a94a279bc Author: Linus Torvalds Date: Fri Sep 3 11:11:54 2021 -0700 Merge tag 'mips_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - converted Pistachio platform to use MIPS generic kernel - fixes and cleanups * tag 'mips_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (29 commits) MIPS: Malta: fix alignment of the devicetree buffer MIPS: ingenic: Unconditionally enable clock of CPU #0 MIPS: mscc: ocelot: mark the phy-mode for internal PHY ports MIPS: mscc: ocelot: disable all switch ports by default MAINTAINERS: adjust PISTACHIO SOC SUPPORT after its retirement MIPS: Return true/false (not 1/0) from bool functions MIPS: generic: Return true/false (not 1/0) from bool functions MIPS: Make a alias for pistachio_defconfig MIPS: Retire MACH_PISTACHIO MIPS: config: generic: Add config for Marduk board pinctrl: pistachio: Make it as an option phy: pistachio-usb: Depend on MIPS || COMPILE_TEST clocksource/drivers/pistachio: Make it selectable for MIPS clk: pistachio: Make it selectable for generic MIPS kernel MIPS: DTS: Pistachio add missing cpc and cdmm MIPS: generic: Allow generating FIT image for Marduk board MIPS: locking/atomic: Fix atomic{_64,}_sub_if_positive MIPS: loongson2ef: don't build serial.o unconditionally MIPS: Replace deprecated CPU-hotplug functions. MIPS: Alchemy: Fix spelling contraction "cant" -> "can't" ... commit 603eefda5fcf8f9dab3ae253e677abb285f6f3bc Merge: 50ddcdb2635c8 1955d843efc3b Author: Linus Torvalds Date: Fri Sep 3 11:03:00 2021 -0700 Merge tag 'for-linus' of git://github.com/openrisc/linux Pull OpenRISC updates from Stafford Horne: "A few cleanups and compiler warning fixes for OpenRISC. Also, this includes dts and defconfig updates to enable Ethernet on OpenRISC/Litex FPGA SoC's now that the LiteEth driver has gone upstream" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc/litex: Update defconfig openrisc/litex: Add ethernet device openrisc/litex: Update uart address openrisc: Fix compiler warnings in setup openrisc: rename or32 code & comments to or1k openrisc: don't printk() unconditionally commit 50ddcdb2635c82e195a2557341d759c5b9419bf1 Merge: 69a5c49a9147e 1daf08a066cfe Author: Linus Torvalds Date: Fri Sep 3 10:57:25 2021 -0700 Merge tag 'livepatching-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching update from Petr Mladek. * tag 'livepatching-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Replace deprecated CPU-hotplug functions. commit 69a5c49a9147e9daca76201e3d6edfea5ed8403a Merge: 3de18c865f504 d8768d7eb9c21 Author: Linus Torvalds Date: Fri Sep 3 10:44:35 2021 -0700 Merge tag 'iommu-updates-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: - New DART IOMMU driver for Apple Silicon M1 chips - Optimizations for iommu_[map/unmap] performance - Selective TLB flush support for the AMD IOMMU driver to make it more efficient on emulated IOMMUs - Rework IOVA setup and default domain type setting to move more code out of IOMMU drivers and to support runtime switching between certain types of default domains - VT-d Updates from Lu Baolu: - Update the virtual command related registers - Enable Intel IOMMU scalable mode by default - Preset A/D bits for user space DMA usage - Allow devices to have more than 32 outstanding PRs - Various cleanups - ARM SMMU Updates from Will Deacon: SMMUv3: - Minor optimisation to avoid zeroing struct members on CMD submission - Increased use of batched commands to reduce submission latency - Refactoring in preparation for ECMDQ support SMMUv2: - Fix races when probing devices with identical StreamIDs - Optimise walk cache flushing for Qualcomm implementations - Allow deep sleep states for some Qualcomm SoCs with shared clocks - Various smaller optimizations, cleanups, and fixes * tag 'iommu-updates-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (85 commits) iommu/io-pgtable: Abstract iommu_iotlb_gather access iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group() iommu/vt-d: Add present bit check in pasid entry setup helpers iommu/vt-d: Use pasid_pte_is_present() helper function iommu/vt-d: Drop the kernel doc annotation iommu/vt-d: Allow devices to have more than 32 outstanding PRs iommu/vt-d: Preset A/D bits for user space DMA usage iommu/vt-d: Enable Intel IOMMU scalable mode by default iommu/vt-d: Refactor Kconfig a bit iommu/vt-d: Remove unnecessary oom message iommu/vt-d: Update the virtual command related registers iommu: Allow enabling non-strict mode dynamically iommu: Merge strictness and domain type configs iommu: Only log strictness for DMA domains iommu: Expose DMA domain strictness via sysfs iommu: Express DMA strictness via the domain type iommu/vt-d: Prepare for multiple DMA domain types iommu/arm-smmu: Prepare for multiple DMA domain types iommu/amd: Prepare for multiple DMA domain types iommu: Introduce explicit type for non-strict DMA domains ... commit 0c217d5066c84f67cd672cf03ec8f682e5d013c2 Author: NeilBrown Date: Thu Sep 2 09:30:37 2021 +1000 SUNRPC: improve error response to over-size gss credential When the NFS server receives a large gss (kerberos) credential and tries to pass it up to rpc.svcgssd (which is deprecated), it triggers an infinite loop in cache_read(). cache_request() always returns -EAGAIN, and this causes a "goto again". This patch: - changes the error to -E2BIG to avoid the infinite loop, and - generates a WARN_ONCE when rsi_request first sees an over-sized credential. The warning suggests switching to gssproxy. Link: https://bugzilla.kernel.org/show_bug.cgi?id=196583 Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 3de18c865f504ab59ed2588b1e11acd4bcb9ea09 Merge: 14726903c8351 f3c4b1341e832 Author: Linus Torvalds Date: Fri Sep 3 10:34:44 2021 -0700 Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb Pull swiotlb updates from Konrad Rzeszutek Wilk: "A new feature called restricted DMA pools. It allows SWIOTLB to utilize per-device (or per-platform) allocated memory pools instead of using the global one. The first big user of this is ARM Confidential Computing where the memory for DMA operations can be set per platform" * 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb: (23 commits) swiotlb: use depends on for DMA_RESTRICTED_POOL of: restricted dma: Don't fail device probe on rmem init failure of: Move of_dma_set_restricted_buffer() into device.c powerpc/svm: Don't issue ultracalls if !mem_encrypt_active() s390/pv: fix the forcing of the swiotlb swiotlb: Free tbl memory in swiotlb_exit() swiotlb: Emit diagnostic in swiotlb_exit() swiotlb: Convert io_default_tlb_mem to static allocation of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS swiotlb: add overflow checks to swiotlb_bounce swiotlb: fix implicit debugfs declarations of: Add plumbing for restricted DMA pool dt-bindings: of: Add restricted DMA pool swiotlb: Add restricted DMA pool initialization swiotlb: Add restricted DMA alloc/free support swiotlb: Refactor swiotlb_tbl_unmap_single swiotlb: Move alloc_size to swiotlb_find_slots swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing swiotlb: Update is_swiotlb_active to add a struct device argument swiotlb: Update is_swiotlb_buffer to add a struct device argument ... commit 14726903c835101cd8d0a703b609305094350d61 Merge: a9c9a6f741cda d5fffc5aff269 Author: Linus Torvalds Date: Fri Sep 3 10:08:28 2021 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc updates from Andrew Morton: "173 patches. Subsystems affected by this series: ia64, ocfs2, block, and mm (debug, pagecache, gup, swap, shmem, memcg, selftests, pagemap, mremap, bootmem, sparsemem, vmalloc, kasan, pagealloc, memory-failure, hugetlb, userfaultfd, vmscan, compaction, mempolicy, memblock, oom-kill, migration, ksm, percpu, vmstat, and madvise)" * emailed patches from Andrew Morton : (173 commits) mm/madvise: add MADV_WILLNEED to process_madvise() mm/vmstat: remove unneeded return value mm/vmstat: simplify the array size calculation mm/vmstat: correct some wrong comments mm/percpu,c: remove obsolete comments of pcpu_chunk_populated() selftests: vm: add COW time test for KSM pages selftests: vm: add KSM merging time test mm: KSM: fix data type selftests: vm: add KSM merging across nodes test selftests: vm: add KSM zero page merging test selftests: vm: add KSM unmerge test selftests: vm: add KSM merge test mm/migrate: correct kernel-doc notation mm: wire up syscall process_mrelease mm: introduce process_mrelease system call memblock: make memblock_find_in_range method private mm/mempolicy.c: use in_task() in mempolicy_slab_node() mm/mempolicy: unify the create() func for bind/interleave/prefer-many policies mm/mempolicy: advertise new MPOL_PREFERRED_MANY mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY ... commit d5fffc5aff269717a035baa087630adca612a6c4 Author: zhangkui Date: Thu Sep 2 15:01:11 2021 -0700 mm/madvise: add MADV_WILLNEED to process_madvise() There is a usecase in Android that an app process's memory is swapped out by process_madvise() with MADV_PAGEOUT, such as the memory is swapped to zram or a backing device. When the process is scheduled to running, like switch to foreground, multiple page faults may cause the app dropped frames. To reduce the problem, System Management Software can read-ahead memory of the process immediately when the app switches to forground. Calling process_madvise() with MADV_WILLNEED can meet this need. Link: https://lkml.kernel.org/r/20210804082010.12482-1-zhangkui@oppo.com Signed-off-by: zhangkui Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 33090af97350cee9ea0e347301cef704bd5b0d8e Author: Miaohe Lin Date: Thu Sep 2 15:01:08 2021 -0700 mm/vmstat: remove unneeded return value The return value of pagetypeinfo_showfree and pagetypeinfo_showblockcount are unused now. Remove them. Link: https://lkml.kernel.org/r/20210715122911.15700-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 64632fd3eb4611780a1190362f2119d8f2bb5465 Author: Miaohe Lin Date: Thu Sep 2 15:01:05 2021 -0700 mm/vmstat: simplify the array size calculation We can replace the array_num * sizeof(array[0]) with sizeof(array) to simplify the code. Link: https://lkml.kernel.org/r/20210715122911.15700-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ea15ba17b434b7dd7f92bb85b7e5cf53707733ad Author: Miaohe Lin Date: Thu Sep 2 15:01:03 2021 -0700 mm/vmstat: correct some wrong comments Patch series "Cleanup for vmstat". This series contains cleanups to remove unneeded return value, correct wrong comment and simplify the array size calculation. More details can be found in the respective changelogs. This patch (of 3): Correct wrong fls(mem+1) to fls(mem)+1 and remove the duplicated comment with quiet_vmstat(). Link: https://lkml.kernel.org/r/20210715122911.15700-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210715122911.15700-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 319814504992f51ed17af60edb1a237ada1892e8 Author: Jing Xiangfeng Date: Thu Sep 2 15:01:00 2021 -0700 mm/percpu,c: remove obsolete comments of pcpu_chunk_populated() Commit b239f7daf553 ("percpu: set PCPU_BITMAP_BLOCK_SIZE to PAGE_SIZE") removed the parameter 'for_alloc', so remove this comment. Link: https://lkml.kernel.org/r/1630576043-21367-1-git-send-email-jingxiangfeng@huawei.com Signed-off-by: Jing Xiangfeng Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 924a11bd1623787c6604590202e0920eb572fa42 Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:57 2021 -0700 selftests: vm: add COW time test for KSM pages Since merged pages are copied every time they need to be modified, the write access time is different between shared and non-shared pages. Add ksm_cow_time() function which evaluates latency of these COW breaks. First, 4000 pages are allocated and the time, required to modify 1 byte in every other page, is measured. After this, the pages are merged into 2000 pairs and in each pair, 1 page is modified (i.e. they are decoupled) to detect COW breaks. The time needed to break COW of merged pages is then compared with performance of non-shared pages. The test is run as follows: ./ksm_tests -C The output: Total size: 15 MiB Not merged pages: Total time: 0.002185489 s Average speed: 3202.945 MiB/s Merged pages: Total time: 0.004386872 s Average speed: 1595.670 MiB/s Link: https://lkml.kernel.org/r/1d03ee0d1b341959d4b61672c6401d498bff5652.1629386192.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Tyler Hicks Reviewed-by: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9e7cb94ca218816bfd51e07b50bcfeadd3166d42 Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:54 2021 -0700 selftests: vm: add KSM merging time test Patch series "add KSM performance tests", v3. Extend KSM self tests with a performance benchmark. These tests are not part of regular regression testing, as they are mainly intended to be used by developers making changes to the memory management subsystem. This patch (of 2): Add ksm_merge_time() function to determine speed and time needed for merging. The total spent time is shown in seconds while speed is in MiB/s. User must specify the size of duplicated memory area (in MiB) before running the test. The test is run as follows: ./ksm_tests -P -s 100 The output: Total size: 100 MiB Total time: 0.201106786 s Average speed: 497.248 MiB/s Link: https://lkml.kernel.org/r/cover.1629386192.git.zhansayabagdaulet@gmail.com Link: https://lkml.kernel.org/r/318b946ac80cc9205c89d0962048378f7ce0705b.1629386192.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Tyler Hicks Reviewed-by: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 584ff0dfb09a81e1addf02543f7c1fa8e71ce6d2 Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:51 2021 -0700 mm: KSM: fix data type ksm_stable_node_chains_prune_millisecs is declared as int, but in stable__node_chains_prune_millisecs_store(), it can store values up to UINT_MAX. Change its type to unsigned int. Link: https://lkml.kernel.org/r/20210806111351.GA71845@asus Signed-off-by: Zhansaya Bagdauletkyzy Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82e717ad35018ce59ba1b66297dfd898b2a1a03f Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:48 2021 -0700 selftests: vm: add KSM merging across nodes test Add check_ksm_numa_merge() function to test that pages in different NUMA nodes are being handled properly. First, two duplicate pages are allocated in two separate NUMA nodes using the libnuma library. Since there is one unique page in each node, with merge_across_nodes = 0, there won't be any shared pages. If merge_across_nodes is set to 1, the pages will be treated as usual duplicate pages and will be merged. If NUMA config is not enabled or the number of NUMA nodes is less than two, then the test is skipped. The test is run as follows: ./ksm_tests -N Link: https://lkml.kernel.org/r/071c17b5b04ebb0dfeba137acc495e5dd9d2a719.1626252248.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Pavel Tatashin Reviewed-by: Tyler Hicks Cc: Hugh Dickins Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 39619982c5be6ed57390f17aabee6bc11e4af37e Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:45 2021 -0700 selftests: vm: add KSM zero page merging test Add check_ksm_zero_page_merge() function to test that empty pages are being handled properly. For this, several zero pages are allocated and merged using madvise. If use_zero_pages is enabled, the pages must be shared with the special kernel zero pages; otherwise, they are merged as usual duplicate pages. The test is run as follows: ./ksm_tests -Z Link: https://lkml.kernel.org/r/6d0caab00d4bdccf5e3791cb95cf6dfd5eb85e45.1626252248.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Pavel Tatashin Reviewed-by: Tyler Hicks Cc: Hugh Dickins Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a40c80e348fac4ecff8abcc3fae31e2e84c055d6 Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:42 2021 -0700 selftests: vm: add KSM unmerge test Add check_ksm_unmerge() function to verify that KSM is properly unmerging shared pages. For this, two duplicate pages are merged first and then their contents are modified. Since they are not identical anymore, the pages must be unmerged and the number of merged pages has to be 0. The test is run as follows: ./ksm_tests -U Link: https://lkml.kernel.org/r/c0f55420440d704d5b094275b4365aa1b2ad46b5.1626252248.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Pavel Tatashin Reviewed-by: Tyler Hicks Cc: Hugh Dickins Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 68d6289baa35c5e59b5359577d3dc01c00c437d2 Author: Zhansaya Bagdauletkyzy Date: Thu Sep 2 15:00:39 2021 -0700 selftests: vm: add KSM merge test Patch series "add KSM selftests". Introduce selftests to validate the functionality of KSM. The tests are run on private anonymous pages. Since some KSM tunables are modified, their starting values are saved and restored after testing. At the start, run is set to 2 to ensure that only test pages will be merged (we assume that no applications make madvise syscalls in the background). If KSM config not enabled, all tests will be skipped. This patch (of 4): Add check_ksm_merge() function to check the basic merging feature of KSM. First, some number of identical pages are allocated and the MADV_MERGEABLE advice is given to merge these pages. Then, pages_shared and pages_sharing values are compared with the expected numbers using assert_ksm_pages_count() function. The number of pages can be changed using -p option. Link: https://lkml.kernel.org/r/cover.1626252248.git.zhansayabagdaulet@gmail.com Link: https://lkml.kernel.org/r/90287685c13300972ea84de93d1f3f900373f9fe.1626252248.git.zhansayabagdaulet@gmail.com Signed-off-by: Zhansaya Bagdauletkyzy Reviewed-by: Pavel Tatashin Reviewed-by: Tyler Hicks Cc: Shuah Khan Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9bd7d183673b5136e56210003e1d94338d47c45 Author: Randy Dunlap Date: Thu Sep 2 15:00:36 2021 -0700 mm/migrate: correct kernel-doc notation Use the expected "Return:" format to prevent a kernel-doc warning. mm/migrate.c:1157: warning: Excess function parameter 'returns' description in 'next_demotion_node' Link: https://lkml.kernel.org/r/20210808203151.10632-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dce49103962840dd61423d7627748d6c558d58c5 Author: Suren Baghdasaryan Date: Thu Sep 2 15:00:33 2021 -0700 mm: wire up syscall process_mrelease Split off from prev patch in the series that implements the syscall. Link: https://lkml.kernel.org/r/20210809185259.405936-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Geert Uytterhoeven Cc: Andy Lutomirski Cc: Christian Brauner Cc: Christoph Hellwig Cc: David Hildenbrand Cc: David Rientjes Cc: Florian Weimer Cc: Jan Engelhardt Cc: Jann Horn Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Minchan Kim Cc: Oleg Nesterov Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tim Murray Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 884a7e5964e06ed93c7771c0d7cf19c09a8946f1 Author: Suren Baghdasaryan Date: Thu Sep 2 15:00:29 2021 -0700 mm: introduce process_mrelease system call In modern systems it's not unusual to have a system component monitoring memory conditions of the system and tasked with keeping system memory pressure under control. One way to accomplish that is to kill non-essential processes to free up memory for more important ones. Examples of this are Facebook's OOM killer daemon called oomd and Android's low memory killer daemon called lmkd. For such system component it's important to be able to free memory quickly and efficiently. Unfortunately the time process takes to free up its memory after receiving a SIGKILL might vary based on the state of the process (uninterruptible sleep), size and OPP level of the core the process is running. A mechanism to free resources of the target process in a more predictable way would improve system's ability to control its memory pressure. Introduce process_mrelease system call that releases memory of a dying process from the context of the caller. This way the memory is freed in a more controllable way with CPU affinity and priority of the caller. The workload of freeing the memory will also be charged to the caller. The operation is allowed only on a dying process. After previous discussions [1, 2, 3] the decision was made [4] to introduce a dedicated system call to cover this use case. The API is as follows, int process_mrelease(int pidfd, unsigned int flags); DESCRIPTION The process_mrelease() system call is used to free the memory of an exiting process. The pidfd selects the process referred to by the PID file descriptor. (See pidfd_open(2) for further information) The flags argument is reserved for future use; currently, this argument must be specified as 0. RETURN VALUE On success, process_mrelease() returns 0. On error, -1 is returned and errno is set to indicate the error. ERRORS EBADF pidfd is not a valid PID file descriptor. EAGAIN Failed to release part of the address space. EINTR The call was interrupted by a signal; see signal(7). EINVAL flags is not 0. EINVAL The memory of the task cannot be released because the process is not exiting, the address space is shared with another live process or there is a core dump in progress. ENOSYS This system call is not supported, for example, without MMU support built into Linux. ESRCH The target process does not exist (i.e., it has terminated and been waited on). [1] https://lore.kernel.org/lkml/20190411014353.113252-3-surenb@google.com/ [2] https://lore.kernel.org/linux-api/20201113173448.1863419-1-surenb@google.com/ [3] https://lore.kernel.org/linux-api/20201124053943.1684874-3-surenb@google.com/ [4] https://lore.kernel.org/linux-api/20201223075712.GA4719@lst.de/ Link: https://lkml.kernel.org/r/20210809185259.405936-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Shakeel Butt Acked-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Christian Brauner Cc: David Rientjes Cc: Matthew Wilcox (Oracle) Cc: Johannes Weiner Cc: Roman Gushchin Cc: Rik van Riel Cc: Minchan Kim Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: Jann Horn Cc: Geert Uytterhoeven Cc: Andy Lutomirski Cc: Christian Brauner Cc: Florian Weimer Cc: Jan Engelhardt Cc: Tim Murray Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a7259df7670240ee03b0cfce8a3e5d3773911e24 Author: Mike Rapoport Date: Thu Sep 2 15:00:26 2021 -0700 memblock: make memblock_find_in_range method private There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates of all the users outside memblock. Replace the calls to memblock_find_in_range() with an equivalent calls to memblock_phys_alloc() and memblock_phys_alloc_range() and make memblock_find_in_range() private method of memblock. This simplifies the callers, ensures that (unlikely) errors in memblock_reserve() are handled and improves maintainability of memblock_find_in_range(). Link: https://lkml.kernel.org/r/20210816122622.30279-1-rppt@kernel.org Signed-off-by: Mike Rapoport Reviewed-by: Catalin Marinas [arm64] Acked-by: Kirill A. Shutemov Acked-by: Rafael J. Wysocki [ACPI] Acked-by: Russell King (Oracle) Acked-by: Nick Kossifidis [riscv] Tested-by: Guenter Roeck Acked-by: Rob Herring Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 38b031dd4d03542d963eebe600d67ea34f47eb65 Author: Vasily Averin Date: Thu Sep 2 15:00:23 2021 -0700 mm/mempolicy.c: use in_task() in mempolicy_slab_node() Obsoleted in_intrrupt() include task context with disabled BH, it's better to use in_task() instead. Link: https://lkml.kernel.org/r/984ee771-4834-21da-801f-c15c18ddf4d1@virtuozzo.com Signed-off-by: Vasily Averin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit be897d48a971e36daadbd9289967e7e4f3749528 Author: Feng Tang Date: Thu Sep 2 15:00:19 2021 -0700 mm/mempolicy: unify the create() func for bind/interleave/prefer-many policies As they all do the same thing: sanity check and save nodemask info, create one mpol_new_nodemask() to reduce redundancy. Link: https://lkml.kernel.org/r/1627970362-61305-6-git-send-email-feng.tang@intel.com Signed-off-by: Feng Tang Acked-by: Michal Hocko Cc: Andi Kleen Cc: Andrea Arcangeli Cc: Ben Widawsky Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Huang Ying Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a38a59fdfa10be55d08e4530923d950e739ac6a2 Author: Ben Widawsky Date: Thu Sep 2 15:00:16 2021 -0700 mm/mempolicy: advertise new MPOL_PREFERRED_MANY Adds a new mode to the existing mempolicy modes, MPOL_PREFERRED_MANY. MPOL_PREFERRED_MANY will be adequately documented in the internal admin-guide with this patch. Eventually, the man pages for mbind(2), get_mempolicy(2), set_mempolicy(2) and numactl(8) will also have text about this mode. Those shall contain the canonical reference. NUMA systems continue to become more prevalent. New technologies like PMEM make finer grain control over memory access patterns increasingly desirable. MPOL_PREFERRED_MANY allows userspace to specify a set of nodes that will be tried first when performing allocations. If those allocations fail, all remaining nodes will be tried. It's a straight forward API which solves many of the presumptive needs of system administrators wanting to optimize workloads on such machines. The mode will work either per VMA, or per thread. [Michal Hocko: refine kernel doc for MPOL_PREFERRED_MANY] Link: https://lore.kernel.org/r/20200630212517.308045-13-ben.widawsky@intel.com Link: https://lkml.kernel.org/r/1627970362-61305-5-git-send-email-feng.tang@intel.com Signed-off-by: Ben Widawsky Signed-off-by: Feng Tang Acked-by: Michal Hocko Cc: Andi Kleen Cc: Andrea Arcangeli Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Huang Ying Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cfcaa66f803233c50e17239469f6c96136a673a1 Author: Ben Widawsky Date: Thu Sep 2 15:00:13 2021 -0700 mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY Implement the missing huge page allocation functionality while obeying the preferred node semantics. This is similar to the implementation for general page allocation, as it uses a fallback mechanism to try multiple preferred nodes first, and then all other nodes. To avoid adding too many "#ifdef CONFIG_NUMA" check, add a helper function in mempolicy.h to check whether a mempolicy is MPOL_PREFERRED_MANY. [akpm@linux-foundation.org: fix compiling issue when merging with other hugetlb patch] [Thanks to 0day bot for catching the !CONFIG_NUMA compiling issue] [mhocko@suse.com: suggest to remove the #ifdef CONFIG_NUMA check] [ben.widawsky@intel.com: add helpers to avoid ifdefs] Link: https://lore.kernel.org/r/20200630212517.308045-12-ben.widawsky@intel.com Link: https://lkml.kernel.org/r/1627970362-61305-4-git-send-email-feng.tang@intel.com Link: https://lkml.kernel.org/r/20210809024430.GA46432@shbuild999.sh.intel.com [nathan@kernel.org: initialize page to NULL in alloc_buddy_huge_page_with_mpol()] Link: https://lkml.kernel.org/r/20210810200632.3812797-1-nathan@kernel.org Link: https://lore.kernel.org/r/20200630212517.308045-12-ben.widawsky@intel.com Link: https://lkml.kernel.org/r/1627970362-61305-4-git-send-email-feng.tang@intel.com Link: https://lkml.kernel.org/r/20210809024430.GA46432@shbuild999.sh.intel.com Signed-off-by: Ben Widawsky Signed-off-by: Feng Tang Signed-off-by: Nathan Chancellor Co-developed-by: Feng Tang Suggested-by: Michal Hocko Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4c54d94908e089e9741513797eac30a8b8217034 Author: Feng Tang Date: Thu Sep 2 15:00:10 2021 -0700 mm/memplicy: add page allocation function for MPOL_PREFERRED_MANY policy The semantics of MPOL_PREFERRED_MANY is similar to MPOL_PREFERRED, that it will first try to allocate memory from the preferred node(s), and fallback to all nodes in system when first try fails. Add a dedicated function alloc_pages_preferred_many() for it just like for 'interleave' policy, which will be used by 2 general memoory allocation APIs: alloc_pages() and alloc_pages_vma() Link: https://lore.kernel.org/r/20200630212517.308045-9-ben.widawsky@intel.com Link: https://lkml.kernel.org/r/1627970362-61305-3-git-send-email-feng.tang@intel.com Suggested-by: Michal Hocko Originally-by: Ben Widawsky Co-developed-by: Ben Widawsky Signed-off-by: Ben Widawsky Signed-off-by: Feng Tang Acked-by: Michal Hocko Cc: Andi Kleen Cc: Andrea Arcangeli Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Huang Ying Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b27abaccf8e8b012f126da0c2a1ab32723ec8b9f Author: Dave Hansen Date: Thu Sep 2 15:00:06 2021 -0700 mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes Patch series "Introduce multi-preference mempolicy", v7. This patch series introduces the concept of the MPOL_PREFERRED_MANY mempolicy. This mempolicy mode can be used with either the set_mempolicy(2) or mbind(2) interfaces. Like the MPOL_PREFERRED interface, it allows an application to set a preference for nodes which will fulfil memory allocation requests. Unlike the MPOL_PREFERRED mode, it takes a set of nodes. Like the MPOL_BIND interface, it works over a set of nodes. Unlike MPOL_BIND, it will not cause a SIGSEGV or invoke the OOM killer if those preferred nodes are not available. Along with these patches are patches for libnuma, numactl, numademo, and memhog. They still need some polish, but can be found here: https://gitlab.com/bwidawsk/numactl/-/tree/prefer-many It allows new usage: `numactl -P 0,3,4` The goal of the new mode is to enable some use-cases when using tiered memory usage models which I've lovingly named. 1a. The Hare - The interconnect is fast enough to meet bandwidth and latency requirements allowing preference to be given to all nodes with "fast" memory. 1b. The Indiscriminate Hare - An application knows it wants fast memory (or perhaps slow memory), but doesn't care which node it runs on. The application can prefer a set of nodes and then xpu bind to the local node (cpu, accelerator, etc). This reverses the nodes are chosen today where the kernel attempts to use local memory to the CPU whenever possible. This will attempt to use the local accelerator to the memory. 2. The Tortoise - The administrator (or the application itself) is aware it only needs slow memory, and so can prefer that. Much of this is almost achievable with the bind interface, but the bind interface suffers from an inability to fallback to another set of nodes if binding fails to all nodes in the nodemask. Like MPOL_BIND a nodemask is given. Inherently this removes ordering from the preference. > /* Set first two nodes as preferred in an 8 node system. */ > const unsigned long nodes = 0x3 > set_mempolicy(MPOL_PREFER_MANY, &nodes, 8); > /* Mimic interleave policy, but have fallback *. > const unsigned long nodes = 0xaa > set_mempolicy(MPOL_PREFER_MANY, &nodes, 8); Some internal discussion took place around the interface. There are two alternatives which we have discussed, plus one I stuck in: 1. Ordered list of nodes. Currently it's believed that the added complexity is nod needed for expected usecases. 2. A flag for bind to allow falling back to other nodes. This confuses the notion of binding and is less flexible than the current solution. 3. Create flags or new modes that helps with some ordering. This offers both a friendlier API as well as a solution for more customized usage. It's unknown if it's worth the complexity to support this. Here is sample code for how this might work: > // Prefer specific nodes for some something wacky > set_mempolicy(MPOL_PREFER_MANY, 0x17c, 1024); > > // Default > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_SOCKET, NULL, 0); > // which is the same as > set_mempolicy(MPOL_DEFAULT, NULL, 0); > > // The Hare > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE, NULL, 0); > > // The Tortoise > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE_REV, NULL, 0); > > // Prefer the fast memory of the first two sockets > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE, -1, 2); > This patch (of 5): The NUMA APIs currently allow passing in a "preferred node" as a single bit set in a nodemask. If more than one bit it set, bits after the first are ignored. This single node is generally OK for location-based NUMA where memory being allocated will eventually be operated on by a single CPU. However, in systems with multiple memory types, folks want to target a *type* of memory instead of a location. For instance, someone might want some high-bandwidth memory but do not care about the CPU next to which it is allocated. Or, they want a cheap, high capacity allocation and want to target all NUMA nodes which have persistent memory in volatile mode. In both of these cases, the application wants to target a *set* of nodes, but does not want strict MPOL_BIND behavior as that could lead to OOM killer or SIGSEGV. So add MPOL_PREFERRED_MANY policy to support the multiple preferred nodes requirement. This is not a pie-in-the-sky dream for an API. This was a response to a specific ask of more than one group at Intel. Specifically: 1. There are existing libraries that target memory types such as https://github.com/memkind/memkind. These are known to suffer from SIGSEGV's when memory is low on targeted memory "kinds" that span more than one node. The MCDRAM on a Xeon Phi in "Cluster on Die" mode is an example of this. 2. Volatile-use persistent memory users want to have a memory policy which is targeted at either "cheap and slow" (PMEM) or "expensive and fast" (DRAM). However, they do not want to experience allocation failures when the targeted type is unavailable. 3. Allocate-then-run. Generally, we let the process scheduler decide on which physical CPU to run a task. That location provides a default allocation policy, and memory availability is not generally considered when placing tasks. For situations where memory is valuable and constrained, some users want to allocate memory first, *then* allocate close compute resources to the allocation. This is the reverse of the normal (CPU) model. Accelerators such as GPUs that operate on core-mm-managed memory are interested in this model. A check is added in sanitize_mpol_flags() to not permit 'prefer_many' policy to be used for now, and will be removed in later patch after all implementations for 'prefer_many' are ready, as suggested by Michal Hocko. [mhocko@kernel.org: suggest to refine policy_node/policy_nodemask handling] Link: https://lkml.kernel.org/r/1627970362-61305-1-git-send-email-feng.tang@intel.com Link: https://lore.kernel.org/r/20200630212517.308045-4-ben.widawsky@intel.com Link: https://lkml.kernel.org/r/1627970362-61305-2-git-send-email-feng.tang@intel.com Co-developed-by: Ben Widawsky Signed-off-by: Ben Widawsky Signed-off-by: Dave Hansen Signed-off-by: Feng Tang Cc: Michal Hocko Acked-by: Michal Hocko Cc: Andrea Arcangeli Cc: Mel Gorman Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Cc: Andi Kleen Cc: Dan Williams Cc: Huang Ying b Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 062db29358c9bd40d8aa9e96ce7b492b03d669d5 Author: Baolin Wang Date: Thu Sep 2 15:00:03 2021 -0700 mm/mempolicy: use readable NUMA_NO_NODE macro instead of magic number The caller of mpol_misplaced() already use NUMA_NO_NODE to check whether current page node is misplaced, thus using NUMA_NO_NODE in mpol_misplaced() instead of magic number is more readable. Link: https://lkml.kernel.org/r/1b77c0ce21183fa86f4db250b115cf5e27396528.1627558356.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 65d759c8f9f57b96c199f3fe5cfb93ac7da095e9 Author: Charan Teja Reddy Date: Thu Sep 2 14:59:59 2021 -0700 mm: compaction: support triggering of proactive compaction by user The proactive compaction[1] gets triggered for every 500msec and run compaction on the node for COMPACTION_HPAGE_ORDER (usually order-9) pages based on the value set to sysctl.compaction_proactiveness. Triggering the compaction for every 500msec in search of COMPACTION_HPAGE_ORDER pages is not needed for all applications, especially on the embedded system usecases which may have few MB's of RAM. Enabling the proactive compaction in its state will endup in running almost always on such systems. Other side, proactive compaction can still be very much useful for getting a set of higher order pages in some controllable manner(controlled by using the sysctl.compaction_proactiveness). So, on systems where enabling the proactive compaction always may proove not required, can trigger the same from user space on write to its sysctl interface. As an example, say app launcher decide to launch the memory heavy application which can be launched fast if it gets more higher order pages thus launcher can prepare the system in advance by triggering the proactive compaction from userspace. This triggering of proactive compaction is done on a write to sysctl.compaction_proactiveness by user. [1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=facdaa917c4d5a376d09d25865f5a863f906234a [akpm@linux-foundation.org: tweak vm.rst, per Mike] Link: https://lkml.kernel.org/r/1627653207-12317-1-git-send-email-charante@codeaurora.org Signed-off-by: Charan Teja Reddy Acked-by: Vlastimil Babka Acked-by: Rafael Aquini Cc: Mike Rapoport Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Dave Hansen Cc: Mel Gorman Cc: Nitin Gupta Cc: Jonathan Corbet Cc: Khalid Aziz Cc: David Rientjes Cc: Vinayak Menon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1e92bfa3825b72be4957f9fef267b3106d20aa6 Author: Charan Teja Reddy Date: Thu Sep 2 14:59:56 2021 -0700 mm: compaction: optimize proactive compaction deferrals Vlastimil Babka figured out that when fragmentation score didn't go down across the proactive compaction i.e. when no progress is made, next wake up for proactive compaction is deferred for 1 << COMPACT_MAX_DEFER_SHIFT, i.e. 64 times, with each wakeup interval of HPAGE_FRAG_CHECK_INTERVAL_MSEC(=500). In each of this wakeup, it just decrement 'proactive_defer' counter and goes sleep i.e. it is getting woken to just decrement a counter. The same deferral time can also achieved by simply doing the HPAGE_FRAG_CHECK_INTERVAL_MSEC << COMPACT_MAX_DEFER_SHIFT thus unnecessary wakeup of kcompact thread is avoided thus also removes the need of 'proactive_defer' thread counter. [akpm@linux-foundation.org: tweak comment] Link: https://lore.kernel.org/linux-fsdevel/88abfdb6-2c13-b5a6-5b46-742d12d1c910@suse.cz/ Link: https://lkml.kernel.org/r/1626869599-25412-1-git-send-email-charante@codeaurora.org Signed-off-by: Charan Teja Reddy Acked-by: Vlastimil Babka Reviewed-by: Khalid Aziz Acked-by: David Rientjes Cc: Nitin Gupta Cc: Vinayak Menon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1399af7e54896c774d67f1c1acc491b07149421d Author: Vlastimil Babka Date: Thu Sep 2 14:59:53 2021 -0700 mm, vmscan: guarantee drop_slab_node() termination drop_slab_node() is called as part of echo 2>/proc/sys/vm/drop_caches operation. It iterates over all memcgs and calls shrink_slab() which in turn iterates over all slab shrinkers. Freed objects are counted and as long as the total number of freed objects from all memcgs and shrinkers is higher than 10, drop_slab_node() loops for another full memcgs*shrinkers iteration. This arbitrary constant threshold of 10 can result in effectively an infinite loop on a system with large number of memcgs and/or parallel activity that allocates new objects. This has been reported previously by Chunxin Zang [1] and recently by our customer. The previous report [1] has resulted in commit 069c411de40a ("mm/vmscan: fix infinite loop in drop_slab_node") which added a check for signals allowing the user to terminate the command writing to drop_caches. At the time it was also considered to make the threshold grow with each iteration to guarantee termination, but such patch hasn't been formally proposed yet. This patch implements the dynamically growing threshold. At first iteration it's enough to free one object to continue, and this threshold effectively doubles with each iteration. Our customer's feedback was positive. There is always a risk that this change will result on some system in a previously terminating drop_caches operation to terminate sooner and free fewer objects. Ideally the semantics would guarantee freeing all freeable objects that existed at the moment of starting the operation, while not looping forever for newly allocated objects, but that's not feasible to track. In the less ideal solution based on thresholds, arguably the termination guarantee is more important than the exhaustiveness guarantee. If there are reports of large regression wrt being exhaustive, we can tune how fast the threshold grows. [1] https://lore.kernel.org/lkml/20200909152047.27905-1-zangchunxin@bytedance.com/T/#u [vbabka@suse.cz: avoid undefined shift behaviour] Link: https://lkml.kernel.org/r/2f034e6f-a753-550a-f374-e4e23899d3d5@suse.cz Link: https://lkml.kernel.org/r/20210818152239.25502-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Reported-by: Chunxin Zang Cc: Muchun Song Cc: Chris Down Cc: Michal Hocko Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Kefeng Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2e786d9e5a2014c327d9b2eec83fa60b16af26f9 Author: Miaohe Lin Date: Thu Sep 2 14:59:50 2021 -0700 mm/vmscan: add 'else' to remove check_pending label We could add 'else' to remove the somewhat odd check_pending label to make code core succinct. Link: https://lkml.kernel.org/r/20210717065911.61497-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Michal Hocko Cc: Alex Shi Cc: Alistair Popple Cc: David Hildenbrand Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: John Hubbard Cc: Joonsoo Kim Cc: Matthew Wilcox Cc: Minchan Kim Cc: Shaohua Li Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b87c517ac5de168aec6e8318ca0707b11b2ccfaf Author: Miaohe Lin Date: Thu Sep 2 14:59:46 2021 -0700 mm/vmscan: remove unneeded return value of kswapd_run() The return value of kswapd_run() is unused now. Clean it up. Link: https://lkml.kernel.org/r/20210717065911.61497-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Michal Hocko Cc: Alex Shi Cc: Alistair Popple Cc: David Hildenbrand Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: John Hubbard Cc: Joonsoo Kim Cc: Matthew Wilcox Cc: Minchan Kim Cc: Shaohua Li Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eaad1ae7819fa2b8616a31c66d48982b1bb85d62 Author: Miaohe Lin Date: Thu Sep 2 14:59:43 2021 -0700 mm/vmscan: remove misleading setting to sc->priority The priority field of sc is used to control how many pages we should scan at once while we always traverse the list to shrink the pages in these functions. So these settings are unneeded and misleading. Link: https://lkml.kernel.org/r/20210717065911.61497-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alex Shi Cc: Alistair Popple Cc: David Hildenbrand Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: John Hubbard Cc: Joonsoo Kim Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Shaohua Li Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d17be2d9ff6c689fd70d2d451153d613508a56ae Author: Miaohe Lin Date: Thu Sep 2 14:59:39 2021 -0700 mm/vmscan: remove the PageDirty check after MADV_FREE pages are page_ref_freezed Patch series "Cleanups for vmscan", v2. This series contains cleanups to remove unneeded return value, misleading setting and so on. Also this remove the PageDirty check after MADV_FREE pages are page_ref_freezed. More details can be found in the respective changelogs. This patch (of 4): If the MADV_FREE pages are redirtied before they could be reclaimed, put the pages back to anonymous LRU list by setting SwapBacked flag and the pages will be reclaimed in normal swapout way. But as Yu Zhao pointed out, "The page has only one reference left, which is from the isolation. After the caller puts the page back on lru and drops the reference, the page will be freed anyway. It doesn't matter which lru it goes." So we don't bother checking PageDirty here. [Yu Zhao's comment is also quoted in the code.] Link: https://lkml.kernel.org/r/20210717065911.61497-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210717065911.61497-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Yu Zhao Cc: Johannes Weiner Cc: Vlastimil Babka Cc: Michal Hocko Cc: Jens Axboe Cc: Joonsoo Kim Cc: Alex Shi Cc: Alistair Popple Cc: Matthew Wilcox Cc: Minchan Kim Cc: David Hildenbrand Cc: Shaohua Li Cc: Hillf Danton Cc: John Hubbard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9647875be52b33fe22cb034ec3074896c581543f Author: Hui Su Date: Thu Sep 2 14:59:36 2021 -0700 mm/vmpressure: replace vmpressure_to_css() with vmpressure_to_memcg() We can get memcg directly form vmpr instead of vmpr->memcg->css->memcg, so add a new func helper vmpressure_to_memcg(). And no code will use vmpressure_to_css(), so delete it. Link: https://lkml.kernel.org/r/20210630112146.455103-1-suhui@zeku.com Signed-off-by: Hui Su Acked-by: Michal Hocko Acked-by: Chris Down Cc: Johannes Weiner Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20b51af15e014cac63b58a4f8b8b323ac35bccce Author: Huang Ying Date: Thu Sep 2 14:59:33 2021 -0700 mm/migrate: add sysfs interface to enable reclaim migration Some method is obviously needed to enable reclaim-based migration. Just like traditional autonuma, there will be some workloads that will benefit like workloads with more "static" configurations where hot pages stay hot and cold pages stay cold. If pages come and go from the hot and cold sets, the benefits of this approach will be more limited. The benefits are truly workload-based and *not* hardware-based. We do not believe that there is a viable threshold where certain hardware configurations should have this mechanism enabled while others do not. To be conservative, earlier work defaulted to disable reclaim- based migration and did not include a mechanism to enable it. This proposes add a new sysfs file /sys/kernel/mm/numa/demotion_enabled as a method to enable it. We are open to any alternative that allows end users to enable this mechanism or disable it if workload harm is detected (just like traditional autonuma). Once this is enabled page demotion may move data to a NUMA node that does not fall into the cpuset of the allocating process. This could be construed to violate the guarantees of cpusets. However, since this is an opt-in mechanism, the assumption is that anyone enabling it is content to relax the guarantees. Link: https://lkml.kernel.org/r/20210721063926.3024591-9-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-10-ying.huang@intel.com Signed-off-by: Huang Ying Originally-by: Dave Hansen Cc: Michal Hocko Cc: Wei Xu Cc: Yang Shi Cc: Zi Yan Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Cc: Oscar Salvador Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3a235693d3930e1276c8d9cc0ca5807ef292cf0a Author: Dave Hansen Date: Thu Sep 2 14:59:30 2021 -0700 mm/vmscan: never demote for memcg reclaim Global reclaim aims to reduce the amount of memory used on a given node or set of nodes. Migrating pages to another node serves this purpose. memcg reclaim is different. Its goal is to reduce the total memory consumption of the entire memcg, across all nodes. Migration does not assist memcg reclaim because it just moves page contents between nodes rather than actually reducing memory consumption. Link: https://lkml.kernel.org/r/20210715055145.195411-9-ying.huang@intel.com Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Suggested-by: Yang Shi Reviewed-by: Yang Shi Reviewed-by: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a2a36488a61cefe3129295c6e75b3987b9d7fd13 Author: Keith Busch Date: Thu Sep 2 14:59:26 2021 -0700 mm/vmscan: Consider anonymous pages without swap Reclaim anonymous pages if a migration path is available now that demotion provides a non-swap recourse for reclaiming anon pages. Note that this check is subtly different from the can_age_anon_pages() checks. This mechanism checks whether a specific page in a specific context can actually be reclaimed, given current swap space and cgroup limits. can_age_anon_pages() is a much simpler and more preliminary check which just says whether there is a possibility of future reclaim. [kbusch@kernel.org: v11] Link: https://lkml.kernel.org/r/20210715055145.195411-8-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210721063926.3024591-7-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-8-ying.huang@intel.com Cc: Keith Busch Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Oscar Salvador Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2f368a9fb7f408ba7d4e6d588e1958fe8b780d08 Author: Dave Hansen Date: Thu Sep 2 14:59:23 2021 -0700 mm/vmscan: add helper for querying ability to age anonymous pages Anonymous pages are kept on their own LRU(s). These lists could theoretically always be scanned and maintained. But, without swap, there is currently nothing the kernel can *do* with the results of a scanned, sorted LRU for anonymous pages. A check for '!total_swap_pages' currently serves as a valid check as to whether anonymous LRUs should be maintained. However, another method will be added shortly: page demotion. Abstract out the 'total_swap_pages' checks into a helper, give it a logically significant name, and check for the possibility of page demotion. [dave.hansen@linux.intel.com: v11] Link: https://lkml.kernel.org/r/20210715055145.195411-7-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210721063926.3024591-6-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-7-ying.huang@intel.com Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Greg Thelen Reviewed-by: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Keith Busch Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 668e4147d8850df32ca41e28f52c146025ca45c6 Author: Yang Shi Date: Thu Sep 2 14:59:19 2021 -0700 mm/vmscan: add page demotion counter Account the number of demoted pages. Add pgdemote_kswapd and pgdemote_direct VM counters showed in /proc/vmstat. [ daveh: - __count_vm_events() a bit, and made them look at the THP size directly rather than getting data from migrate_pages() ] Link: https://lkml.kernel.org/r/20210721063926.3024591-5-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-6-ying.huang@intel.com Signed-off-by: Yang Shi Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Wei Xu Reviewed-by: Zi Yan Cc: Michal Hocko Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Oscar Salvador Cc: Greg Thelen Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 26aa2d199d6f2cfa6f2ef2a5dfe891f2250e71a0 Author: Dave Hansen Date: Thu Sep 2 14:59:16 2021 -0700 mm/migrate: demote pages during reclaim This is mostly derived from a patch from Yang Shi: https://lore.kernel.org/linux-mm/1560468577-101178-10-git-send-email-yang.shi@linux.alibaba.com/ Add code to the reclaim path (shrink_page_list()) to "demote" data to another NUMA node instead of discarding the data. This always avoids the cost of I/O needed to read the page back in and sometimes avoids the writeout cost when the page is dirty. A second pass through shrink_page_list() will be made if any demotions fail. This essentially falls back to normal reclaim behavior in the case that demotions fail. Previous versions of this patch may have simply failed to reclaim pages which were eligible for demotion but were unable to be demoted in practice. For some cases, for example, MADV_PAGEOUT, the pages are always discarded instead of demoted to follow the kernel API definition. Because MADV_PAGEOUT is defined as freeing specified pages regardless in which tier they are. Note: This just adds the start of infrastructure for migration. It is actually disabled next to the FIXME in migrate_demote_page_ok(). [dave.hansen@linux.intel.com: v11] Link: https://lkml.kernel.org/r/20210715055145.195411-5-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210721063926.3024591-4-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-5-ying.huang@intel.com Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Wei Xu Reviewed-by: Oscar Salvador Reviewed-by: Zi Yan Cc: Michal Hocko Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5ac95884a784e822b8cbe3d4bd6e9f96b3b71e3f Author: Yang Shi Date: Thu Sep 2 14:59:13 2021 -0700 mm/migrate: enable returning precise migrate_pages() success count Under normal circumstances, migrate_pages() returns the number of pages migrated. In error conditions, it returns an error code. When returning an error code, there is no way to know how many pages were migrated or not migrated. Make migrate_pages() return how many pages are demoted successfully for all cases, including when encountering errors. Page reclaim behavior will depend on this in subsequent patches. Link: https://lkml.kernel.org/r/20210721063926.3024591-3-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-4-ying.huang@intel.com Signed-off-by: Yang Shi Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Suggested-by: Oscar Salvador [optional parameter] Reviewed-by: Yang Shi Reviewed-by: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: Dan Williams Cc: David Hildenbrand Cc: David Rientjes Cc: Greg Thelen Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 884a6e5d1f93b5032e5d6dd2a183f8b3f008416b Author: Dave Hansen Date: Thu Sep 2 14:59:09 2021 -0700 mm/migrate: update node demotion order on hotplug events Reclaim-based migration is attempting to optimize data placement in memory based on the system topology. If the system changes, so must the migration ordering. The implementation is conceptually simple and entirely unoptimized. On any memory or CPU hotplug events, assume that a node was added or removed and recalculate all migration targets. This ensures that the node_demotion[] array is always ready to be used in case the new reclaim mode is enabled. This recalculation is far from optimal, most glaringly that it does not even attempt to figure out the hotplug event would have some *actual* effect on the demotion order. But, given the expected paucity of hotplug events, this should be fine. Link: https://lkml.kernel.org/r/20210721063926.3024591-2-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-3-ying.huang@intel.com Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Zi Yan Cc: Michal Hocko Cc: Wei Xu Cc: Oscar Salvador Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79c28a41672278283fa72e03d0bf80e6644d4ac4 Author: Dave Hansen Date: Thu Sep 2 14:59:06 2021 -0700 mm/numa: automatically generate node migration order Patch series "Migrate Pages in lieu of discard", v11. We're starting to see systems with more and more kinds of memory such as Intel's implementation of persistent memory. Let's say you have a system with some DRAM and some persistent memory. Today, once DRAM fills up, reclaim will start and some of the DRAM contents will be thrown out. Allocations will, at some point, start falling over to the slower persistent memory. That has two nasty properties. First, the newer allocations can end up in the slower persistent memory. Second, reclaimed data in DRAM are just discarded even if there are gobs of space in persistent memory that could be used. This patchset implements a solution to these problems. At the end of the reclaim process in shrink_page_list() just before the last page refcount is dropped, the page is migrated to persistent memory instead of being dropped. While I've talked about a DRAM/PMEM pairing, this approach would function in any environment where memory tiers exist. This is not perfect. It "strands" pages in slower memory and never brings them back to fast DRAM. Huang Ying has follow-on work which repurposes NUMA balancing to promote hot pages back to DRAM. This is also all based on an upstream mechanism that allows persistent memory to be onlined and used as if it were volatile: http://lkml.kernel.org/r/20190124231441.37A4A305@viggo.jf.intel.com With that, the DRAM and PMEM in each socket will be represented as 2 separate NUMA nodes, with the CPUs sit in the DRAM node. So the general inter-NUMA demotion mechanism introduced in the patchset can migrate the cold DRAM pages to the PMEM node. We have tested the patchset with the postgresql and pgbench. On a 2-socket server machine with DRAM and PMEM, the kernel with the patchset can improve the score of pgbench up to 22.1% compared with that of the DRAM only + disk case. This comes from the reduced disk read throughput (which reduces up to 70.8%). == Open Issues == * Memory policies and cpusets that, for instance, restrict allocations to DRAM can be demoted to PMEM whenever they opt in to this new mechanism. A cgroup-level API to opt-in or opt-out of these migrations will likely be required as a follow-on. * Could be more aggressive about where anon LRU scanning occurs since it no longer necessarily involves I/O. get_scan_count() for instance says: "If we have no swap space, do not bother scanning anon pages" This patch (of 9): Prepare for the kernel to auto-migrate pages to other memory nodes with a node migration table. This allows creating single migration target for each NUMA node to enable the kernel to do NUMA page migrations instead of simply discarding colder pages. A node with no target is a "terminal node", so reclaim acts normally there. The migration target does not fundamentally _need_ to be a single node, but this implementation starts there to limit complexity. When memory fills up on a node, memory contents can be automatically migrated to another node. The biggest problems are knowing when to migrate and to where the migration should be targeted. The most straightforward way to generate the "to where" list would be to follow the page allocator fallback lists. Those lists already tell us if memory is full where to look next. It would also be logical to move memory in that order. But, the allocator fallback lists have a fatal flaw: most nodes appear in all the lists. This would potentially lead to migration cycles (A->B, B->A, A->B, ...). Instead of using the allocator fallback lists directly, keep a separate node migration ordering. But, reuse the same data used to generate page allocator fallback in the first place: find_next_best_node(). This means that the firmware data used to populate node distances essentially dictates the ordering for now. It should also be architecture-neutral since all NUMA architectures have a working find_next_best_node(). RCU is used to allow lock-less read of node_demotion[] and prevent demotion cycles been observed. If multiple reads of node_demotion[] are performed, a single rcu_read_lock() must be held over all reads to ensure no cycles are observed. Details are as follows. === What does RCU provide? === Imagine a simple loop which walks down the demotion path looking for the last node: terminal_node = start_node; while (node_demotion[terminal_node] != NUMA_NO_NODE) { terminal_node = node_demotion[terminal_node]; } The initial values are: node_demotion[0] = 1; node_demotion[1] = NUMA_NO_NODE; and are updated to: node_demotion[0] = NUMA_NO_NODE; node_demotion[1] = 0; What guarantees that the cycle is not observed: node_demotion[0] = 1; node_demotion[1] = 0; and would loop forever? With RCU, a rcu_read_lock/unlock() can be placed around the loop. Since the write side does a synchronize_rcu(), the loop that observed the old contents is known to be complete before the synchronize_rcu() has completed. RCU, combined with disable_all_migrate_targets(), ensures that the old migration state is not visible by the time __set_migration_target_nodes() is called. === What does READ_ONCE() provide? === READ_ONCE() forbids the compiler from merging or reordering successive reads of node_demotion[]. This ensures that any updates are *eventually* observed. Consider the above loop again. The compiler could theoretically read the entirety of node_demotion[] into local storage (registers) and never go back to memory, and *permanently* observe bad values for node_demotion[]. Note: RCU does not provide any universal compiler-ordering guarantees: https://lore.kernel.org/lkml/20150921204327.GH4029@linux.vnet.ibm.com/ This code is unused for now. It will be called later in the series. Link: https://lkml.kernel.org/r/20210721063926.3024591-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-2-ying.huang@intel.com Signed-off-by: Dave Hansen Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Reviewed-by: Zi Yan Reviewed-by: Oscar Salvador Cc: Michal Hocko Cc: Wei Xu Cc: David Rientjes Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Thelen Cc: Keith Busch Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4410cbb5c9f9371556c4e928b5dd00226b073082 Author: Nadav Amit Date: Thu Sep 2 14:59:02 2021 -0700 selftests/vm/userfaultfd: wake after copy failure When userfaultfd copy-ioctl fails since the PTE already exists, an -EEXIST error is returned and the faulting thread is not woken. The current userfaultfd test does not wake the faulting thread in such case. The assumption is presumably that another thread set the PTE through copy/wp ioctl and would wake the faulting thread or that alternatively the fault handler would realize there is no need to "must_wait" and continue. This is not necessarily true. There is an assumption that the "must_wait" tests in handle_userfault() are sufficient to provide definitive answer whether the offending PTE is populated or not. However, userfaultfd_must_wait() test is lockless. Consequently, concurrent calls to ptep_modify_prot_start(), for instance, can clear the PTE and can cause userfaultfd_must_wait() to wrongly assume it is not populated and a wait is needed. There are therefore 3 options: (1) Change the tests to wake on copy failure. (2) Wake faulting thread unconditionally on zero/copy ioctls before returning -EEXIST. (3) Change the userfaultfd_must_wait() to hold locks. This patch took the first approach, but the others are valid solutions with different tradeoffs. Link: https://lkml.kernel.org/r/20210808020724.1022515-4-namit@vmware.com Signed-off-by: Nadav Amit Cc: Jens Axboe Cc: Andrea Arcangeli Cc: Peter Xu Cc: Alexander Viro Cc: Axel Rasmussen Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 22e5fe2a2a279d9a6fcbdfb4dffe73821bef1c90 Author: Nadav Amit Date: Thu Sep 2 14:58:59 2021 -0700 userfaultfd: prevent concurrent API initialization userfaultfd assumes that the enabled features are set once and never changed after UFFDIO_API ioctl succeeded. However, currently, UFFDIO_API can be called concurrently from two different threads, succeed on both threads and leave userfaultfd's features in non-deterministic state. Theoretically, other uffd operations (ioctl's and page-faults) can be dispatched while adversely affected by such changes of features. Moreover, the writes to ctx->state and ctx->features are not ordered, which can - theoretically, again - let userfaultfd_ioctl() think that userfaultfd API completed, while the features are still not initialized. To avoid races, it is arguably best to get rid of ctx->state. Since there are only 2 states, record the API initialization in ctx->features as the uppermost bit and remove ctx->state. Link: https://lkml.kernel.org/r/20210808020724.1022515-3-namit@vmware.com Fixes: 9cd75c3cd4c3d ("userfaultfd: non-cooperative: add ability to report non-PF events from uffd descriptor") Signed-off-by: Nadav Amit Cc: Alexander Viro Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: Jens Axboe Cc: Mike Rapoport Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a759a909d42d727e918bd5248d6cff7562fa8109 Author: Nadav Amit Date: Thu Sep 2 14:58:56 2021 -0700 userfaultfd: change mmap_changing to atomic Patch series "userfaultfd: minor bug fixes". Three unrelated bug fixes. The first two addresses possible issues (not too theoretical ones), but I did not encounter them in practice. The third patch addresses a test bug that causes the test to fail on my system. It has been sent before as part of a bigger RFC. This patch (of 3): mmap_changing is currently a boolean variable, which is set and cleared without any lock that protects against concurrent modifications. mmap_changing is supposed to mark whether userfaultfd page-faults handling should be retried since mappings are undergoing a change. However, concurrent calls, for instance to madvise(MADV_DONTNEED), might cause mmap_changing to be false, although the remove event was still not read (hence acknowledged) by the user. Change mmap_changing to atomic_t and increase/decrease appropriately. Add a debug assertion to see whether mmap_changing is negative. Link: https://lkml.kernel.org/r/20210808020724.1022515-1-namit@vmware.com Link: https://lkml.kernel.org/r/20210808020724.1022515-2-namit@vmware.com Fixes: df2cc96e77011 ("userfaultfd: prevent non-cooperative events vs mcopy_atomic races") Signed-off-by: Nadav Amit Cc: Mike Rapoport Cc: Peter Xu Cc: Axel Rasmussen Cc: Alexander Viro Cc: Andrea Arcangeli Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09a26e832705fdb7a9484495b71a05e0bbc65207 Author: Mike Kravetz Date: Thu Sep 2 14:58:53 2021 -0700 hugetlb: fix hugetlb cgroup refcounting during vma split Guillaume Morin reported hitting the following WARNING followed by GPF or NULL pointer deference either in cgroups_destroy or in the kill_css path.: percpu ref (css_release) <= 0 (-1) after switching to atomic WARNING: CPU: 23 PID: 130 at lib/percpu-refcount.c:196 percpu_ref_switch_to_atomic_rcu+0x127/0x130 CPU: 23 PID: 130 Comm: ksoftirqd/23 Kdump: loaded Tainted: G O 5.10.60 #1 RIP: 0010:percpu_ref_switch_to_atomic_rcu+0x127/0x130 Call Trace: rcu_core+0x30f/0x530 rcu_core_si+0xe/0x10 __do_softirq+0x103/0x2a2 run_ksoftirqd+0x2b/0x40 smpboot_thread_fn+0x11a/0x170 kthread+0x10a/0x140 ret_from_fork+0x22/0x30 Upon further examination, it was discovered that the css structure was associated with hugetlb reservations. For private hugetlb mappings the vma points to a reserve map that contains a pointer to the css. At mmap time, reservations are set up and a reference to the css is taken. This reference is dropped in the vma close operation; hugetlb_vm_op_close. However, if a vma is split no additional reference to the css is taken yet hugetlb_vm_op_close will be called twice for the split vma resulting in an underflow. Fix by taking another reference in hugetlb_vm_op_open. Note that the reference is only taken for the owner of the reserve map. In the more common fork case, the pointer to the reserve map is cleared for non-owning vmas. Link: https://lkml.kernel.org/r/20210830215015.155224-1-mike.kravetz@oracle.com Fixes: e9fe92ae0cd2 ("hugetlb_cgroup: add reservation accounting for private mappings") Signed-off-by: Mike Kravetz Reported-by: Guillaume Morin Suggested-by: Guillaume Morin Tested-by: Guillaume Morin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e32d20c0c88b1cd0a44f882c4f0eb2f536363d1b Author: Mike Kravetz Date: Thu Sep 2 14:58:50 2021 -0700 hugetlb: before freeing hugetlb page set dtor to appropriate value When removing a hugetlb page from the pool the ref count is set to one (as the free page has no ref count) and compound page destructor is set to NULL_COMPOUND_DTOR. Since a subsequent call to free the hugetlb page will call __free_pages for non-gigantic pages and free_gigantic_page for gigantic pages the destructor is not used. However, consider the following race with code taking a speculative reference on the page: Thread 0 Thread 1 -------- -------- remove_hugetlb_page set_page_refcounted(page); set_compound_page_dtor(page, NULL_COMPOUND_DTOR); get_page_unless_zero(page) __update_and_free_page __free_pages(page, huge_page_order(h)); /* Note that __free_pages() will simply drop the reference to the page. */ put_page(page) __put_compound_page() destroy_compound_page NULL_COMPOUND_DTOR BUG: kernel NULL pointer dereference, address: 0000000000000000 To address this race, set the dtor to the normal compound page dtor for non-gigantic pages. The dtor for gigantic pages does not matter as gigantic pages are changed from a compound page to 'just a group of pages' before freeing. Hence, the destructor is not used. Link: https://lkml.kernel.org/r/20210809184832.18342-4-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Michal Hocko Cc: Oscar Salvador Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: Mina Almasry Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b65a4edae11ecd209a0f7c39e856de24678612d9 Author: Mike Kravetz Date: Thu Sep 2 14:58:47 2021 -0700 hugetlb: drop ref count earlier after page allocation When discussing the possibility of inflated page ref counts, Muuchun Song pointed out this potential issue [1]. It is true that any code could potentially take a reference on a compound page after allocation and before it is converted to and put into use as a hugetlb page. Specifically, this could be done by any users of get_page_unless_zero. There are three areas of concern within hugetlb code. 1) When adding pages to the pool. In this case, new pages are allocated added to the pool by calling put_page to invoke the hugetlb destructor (free_huge_page). If there is an inflated ref count on the page, it will not be immediately added to the free list. It will only be added to the free list when the temporary ref count is dropped. This is deemed acceptable and will not be addressed. 2) A page is allocated for immediate use normally as a surplus page or migration target. In this case, the user of the page will also hold a reference. There is no issue as this is just like normal page ref counting. 3) A page is allocated and MUST be added to the free list to satisfy a reservation. One such example is gather_surplus_pages as pointed out by Muchun in [1]. More specifically, this case covers callers of enqueue_huge_page where the page reference count must be zero. This patch covers this third case. Three routines call enqueue_huge_page when the page reference count could potentially be inflated. They are: gather_surplus_pages, alloc_and_dissolve_huge_page and add_hugetlb_page. add_hugetlb_page is called on error paths when a huge page can not be freed due to the inability to allocate vmemmap pages. In this case, the temporairly inflated ref count is not an issue. When the ref is dropped the appropriate action will be taken. Instead of VM_BUG_ON if the ref count does not drop to zero, simply return. In gather_surplus_pages and alloc_and_dissolve_huge_page the caller expects a page (or pages) to be put on the free lists. In this case we must ensure there are no temporary ref counts. We do this by calling put_page_testzero() earlier and not using pages without a zero ref count. The temporary page flag (HPageTemporary) is used in such cases so that as soon as the inflated ref count is dropped the page will be freed. [1] https://lore.kernel.org/linux-mm/CAMZfGtVMn3daKrJwZMaVOGOaJU+B4dS--x_oPmGQMD=c=QNGEg@mail.gmail.com/ Link: https://lkml.kernel.org/r/20210809184832.18342-3-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 416d85ed3e08c1164c1405249a94343166837802 Author: Mike Kravetz Date: Thu Sep 2 14:58:43 2021 -0700 hugetlb: simplify prep_compound_gigantic_page ref count racing code Code in prep_compound_gigantic_page waits for a rcu grace period if it notices a temporarily inflated ref count on a tail page. This was due to the identified potential race with speculative page cache references which could only last for a rcu grace period. This is overly complicated as this situation is VERY unlikely to ever happen. Instead, just quickly return an error. Also, only print a warning in prep_compound_gigantic_page instead of multiple callers. Link: https://lkml.kernel.org/r/20210809184832.18342-2-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f87060d345232c7d855167a43faf006e24afa999 Author: Michael Wang Date: Thu Sep 2 14:58:40 2021 -0700 mm: fix panic caused by __page_handle_poison() In commit 510d25c92ec4 ("mm/hwpoison: disable pcp for page_handle_poison()"), __page_handle_poison() was introduced, and if we mark: RET_A = dissolve_free_huge_page(); RET_B = take_page_off_buddy(); then __page_handle_poison was supposed to return TRUE When RET_A == 0 && RET_B == TRUE But since it failed to take care the case when RET_A is -EBUSY or -ENOMEM, and just return the ret as a bool which actually become TRUE, it break the original logic. The following result is a huge page in freelist but was referenced as poisoned, and lead into the final panic: kernel BUG at mm/internal.h:95! invalid opcode: 0000 [#1] SMP PTI skip... RIP: 0010:set_page_refcounted mm/internal.h:95 [inline] RIP: 0010:remove_hugetlb_page+0x23c/0x240 mm/hugetlb.c:1371 skip... Call Trace: remove_pool_huge_page+0xe4/0x110 mm/hugetlb.c:1892 return_unused_surplus_pages+0x8d/0x150 mm/hugetlb.c:2272 hugetlb_acct_memory.part.91+0x524/0x690 mm/hugetlb.c:4017 This patch replaces 'bool' with 'int' to handle RET_A correctly. Link: https://lkml.kernel.org/r/61782ac6-1e8a-4f6f-35e6-e94fce3b37f5@linux.alibaba.com Fixes: 510d25c92ec4 ("mm/hwpoison: disable pcp for page_handle_poison()") Signed-off-by: Michael Wang Acked-by: Naoya Horiguchi Reported-by: Abaci Cc: [5.14+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 941ca063eb8ed01e66336b1f493e95b107024bc8 Author: Yang Shi Date: Thu Sep 2 14:58:37 2021 -0700 mm: hwpoison: dump page for unhandlable page Currently just very simple message is shown for unhandlable page, e.g. non-LRU page, like: soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () It is not very helpful for further debug, calling dump_page() could show more useful information. Calling dump_page() in get_any_page() in order to not duplicate the call in a couple of different places. It may be called with pcp disabled and holding memory hotplug lock, it should be not a big deal since hwpoison handler is not called very often. [shy828301@gmail.com: remove redundant pr_info per Noaya Horiguchi] Link: https://lkml.kernel.org/r/20210824020946.195257-3-shy828301@gmail.com Link: https://lkml.kernel.org/r/20210819054116.266126-3-shy828301@gmail.com Signed-off-by: Yang Shi Suggested-by: Matthew Wilcox Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: David Mackey Cc: Jonathan Corbet Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f6533121696b2126a33b436f433a048b4427944f Author: Yang Shi Date: Thu Sep 2 14:58:34 2021 -0700 doc: hwpoison: correct the support for hugepage The hwpoison support for huge page, both hugetlb and THP, has been in kernel for a while, the statement in document is obsolete, correct it. Link: https://lkml.kernel.org/r/20210819054116.266126-2-shy828301@gmail.com Signed-off-by: Yang Shi Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: David Mackey Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d0505e9f7dcec85da6634ec66da2b17656ee177b Author: Yang Shi Date: Thu Sep 2 14:58:31 2021 -0700 mm: hwpoison: don't drop slab caches for offlining non-LRU page In the current implementation of soft offline, if non-LRU page is met, all the slab caches will be dropped to free the page then offline. But if the page is not slab page all the effort is wasted in vain. Even though it is a slab page, it is not guaranteed the page could be freed at all. However the side effect and cost is quite high. It does not only drop the slab caches, but also may drop a significant amount of page caches which are associated with inode caches. It could make the most workingset gone in order to just offline a page. And the offline is not guaranteed to succeed at all, actually I really doubt the success rate for real life workload. Furthermore the worse consequence is the system may be locked up and unusable since the page cache release may incur huge amount of works queued for memcg release. Actually we ran into such unpleasant case in our production environment. Firstly, the workqueue of memory_failure_work_func is locked up as below: BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 stuck for 53s! Showing busy workqueues and worker pools: workqueue events: flags=0x0 pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=14/256 refcnt=15 in-flight: 409271:memory_failure_work_func pending: kfree_rcu_work, kfree_rcu_monitor, kfree_rcu_work, rht_deferred_worker, rht_deferred_worker, rht_deferred_worker, rht_deferred_worker, kfree_rcu_work, kfree_rcu_work, kfree_rcu_work, kfree_rcu_work, drain_local_stock, kfree_rcu_work workqueue mm_percpu_wq: flags=0x8 pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 pending: vmstat_update workqueue cgroup_destroy: flags=0x0 pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/1 refcnt=12072 pending: css_release_work_fn There were over 12K css_release_work_fn queued, and this caused a few lockups due to the contention of worker pool lock with IRQ disabled, for example: NMI watchdog: Watchdog detected hard LOCKUP on cpu 1 Modules linked in: amd64_edac_mod edac_mce_amd crct10dif_pclmul crc32_pclmul ghash_clmulni_intel xt_DSCP iptable_mangle kvm_amd bpfilter vfat fat acpi_ipmi i2c_piix4 usb_storage ipmi_si k10temp i2c_core ipmi_devintf ipmi_msghandler acpi_cpufreq sch_fq_codel xfs libcrc32c crc32c_intel mlx5_core mlxfw nvme xhci_pci ptp nvme_core pps_core xhci_hcd CPU: 1 PID: 205500 Comm: kworker/1:0 Tainted: G L 5.10.32-t1.el7.twitter.x86_64 #1 Hardware name: TYAN F5AMT /z /S8026GM2NRE-CGN, BIOS V8.030 03/30/2021 Workqueue: events memory_failure_work_func RIP: 0010:queued_spin_lock_slowpath+0x41/0x1a0 Code: 41 f0 0f ba 2f 08 0f 92 c0 0f b6 c0 c1 e0 08 89 c2 8b 07 30 e4 09 d0 a9 00 01 ff ff 75 1b 85 c0 74 0e 8b 07 84 c0 74 08 f3 90 <8b> 07 84 c0 75 f8 b8 01 00 00 00 66 89 07 c3 f6 c4 01 75 04 c6 47 RSP: 0018:ffff9b2ac278f900 EFLAGS: 00000002 RAX: 0000000000480101 RBX: ffff8ce98ce71800 RCX: 0000000000000084 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8ce98ce6a140 RBP: 00000000000284c8 R08: ffffd7248dcb6808 R09: 0000000000000000 R10: 0000000000000003 R11: ffff9b2ac278f9b0 R12: 0000000000000001 R13: ffff8cb44dab9c00 R14: ffffffffbd1ce6a0 R15: ffff8cacaa37f068 FS: 0000000000000000(0000) GS:ffff8ce98ce40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fcf6e8cb000 CR3: 0000000a0c60a000 CR4: 0000000000350ee0 Call Trace: __queue_work+0xd6/0x3c0 queue_work_on+0x1c/0x30 uncharge_batch+0x10e/0x110 mem_cgroup_uncharge_list+0x6d/0x80 release_pages+0x37f/0x3f0 __pagevec_release+0x1c/0x50 __invalidate_mapping_pages+0x348/0x380 inode_lru_isolate+0x10a/0x160 __list_lru_walk_one+0x7b/0x170 list_lru_walk_one+0x4a/0x60 prune_icache_sb+0x37/0x50 super_cache_scan+0x123/0x1a0 do_shrink_slab+0x10c/0x2c0 shrink_slab+0x1f1/0x290 drop_slab_node+0x4d/0x70 soft_offline_page+0x1ac/0x5b0 memory_failure_work_func+0x6a/0x90 process_one_work+0x19e/0x340 worker_thread+0x30/0x360 kthread+0x116/0x130 The lockup made the machine is quite unusable. And it also made the most workingset gone, the reclaimabled slab caches were reduced from 12G to 300MB, the page caches were decreased from 17G to 4G. But the most disappointing thing is all the effort doesn't make the page offline, it just returns: soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () It seems the aggressive behavior for non-LRU page didn't pay back, so it doesn't make too much sense to keep it considering the terrible side effect. Link: https://lkml.kernel.org/r/20210819054116.266126-1-shy828301@gmail.com Signed-off-by: Yang Shi Reported-by: David Mackey Acked-by: David Hildenbrand Acked-by: Naoya Horiguchi Cc: Oscar Salvador Cc: Matthew Wilcox (Oracle) Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a21c184fe25eab36fb6efabae55333452171d53b Author: Miaohe Lin Date: Thu Sep 2 14:58:28 2021 -0700 mm/hwpoison: fix some obsolete comments Since commit cb731d6c62bb ("vmscan: per memory cgroup slab shrinkers"), shrink_node_slabs is renamed to drop_slab_node. And doit argument is changed to forcekill since commit 6751ed65dc66 ("x86/mce: Fix siginfo_t->si_addr value for non-recoverable memory faults"). Link: https://lkml.kernel.org/r/20210814105131.48814-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ed8c2f492d4e7248a9c0493c444c47bed84d345d Author: Miaohe Lin Date: Thu Sep 2 14:58:25 2021 -0700 mm/hwpoison: change argument struct page **hpagep to *hpage It's unnecessary to pass in a struct page **hpagep because it's never modified. Changing to use *hpage to simplify the code. Link: https://lkml.kernel.org/r/20210814105131.48814-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ea3732f7a1cf636284388988d1a1e56d5cba6044 Author: Miaohe Lin Date: Thu Sep 2 14:58:22 2021 -0700 mm/hwpoison: fix potential pte_unmap_unlock pte error If the first pte is equal to poisoned_pfn, i.e. check_hwpoisoned_entry() return 1, the wrong ptep - 1 would be passed to pte_unmap_unlock(). Link: https://lkml.kernel.org/r/20210814105131.48814-3-linmiaohe@huawei.com Fixes: ad9c59c24095 ("mm,hwpoison: send SIGBUS with error virutal address") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ae611d072c5c2968e2cc29431cf58094d8971b94 Author: Miaohe Lin Date: Thu Sep 2 14:58:19 2021 -0700 mm/hwpoison: remove unneeded variable unmap_success Patch series "Cleanups and fixup for hwpoison" This series contains cleanups to remove unneeded variable, fix some obsolete comments and so on. Also we fix potential pte_unmap_unlock on wrong pte. More details can be found in the respective changelogs. This patch (of 4): unmap_success is used to indicate whether page is successfully unmapped but it's irrelated with ZONE_DEVICE page and unmap_success is always true here. Remove this unneeded one. Link: https://lkml.kernel.org/r/20210814105131.48814-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210814105131.48814-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1d09510bcc6bc00ed406f0d65e39ab3b734f124b Author: George G. Davis Date: Thu Sep 2 14:58:16 2021 -0700 mm/page_isolation: tracing: trace all test_pages_isolated failures Some test_pages_isolated failure conditions don't include trace points. For debugging issues caused by "pinned" pages, make sure to trace all calls whether they succeed or fail. In this case, a failure case did not result in a trace point. So add the missing failure case in test_pages_isolated traces. Link: https://lkml.kernel.org/r/20210823202823.13765-1-george_davis@mentor.com Signed-off-by: George G. Davis Cc: Eugeniu Rosca Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 88dc6f208829cfdbc0b96495c5c73a6af0559300 Author: Vasily Averin Date: Thu Sep 2 14:58:13 2021 -0700 mm/page_alloc.c: use in_task() Obsoleted in_intrrupt() include task context with disabled BH, it's better to use in_task() instead. Link: https://lkml.kernel.org/r/877caa99-1994-5545-92d2-d0bb2e394182@virtuozzo.com Signed-off-by: Vasily Averin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3b446da6be7a722d769e23f68dbaf4ebb2eda542 Author: Mike Rapoport Date: Thu Sep 2 14:58:10 2021 -0700 mm/page_alloc: make alloc_node_mem_map() __init rather than __ref alloc_node_mem_map() is never only called from free_area_init_node() that is an __init function. Make the actual alloc_node_mem_map() also __init and its stub version static inline. Link: https://lkml.kernel.org/r/20210716064124.31865-1-rppt@kernel.org Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b346075fcf5dda7f9e9ae671703aae60e8a94564 Author: Nico Pache Date: Thu Sep 2 14:58:08 2021 -0700 mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning When compiling with -Werror, cc1 will warn that 'zone_id' may be used uninitialized in this function warning. Initialize the zone_id as 0. Its safe to assume that if the code reaches this point it has at least one numa node with memory, so no need for an assertion before init_unavilable_range. Link: https://lkml.kernel.org/r/20210716210336.1114114-1-npache@redhat.com Fixes: 122e093c1734 ("mm/page_alloc: fix memory map initialization for descending nodes") Signed-off-by: Nico Pache Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 08678804e0b305bbbf5b756ad365373e5fe885a2 Author: Mike Rapoport Date: Thu Sep 2 14:58:05 2021 -0700 memblock: stop poisoning raw allocations Functions memblock_alloc_exact_nid_raw() and memblock_alloc_try_nid_raw() are intended for early memory allocation without overhead of zeroing the allocated memory. Since these functions were used to allocate the memory map, they have ended up with addition of a call to page_init_poison() that poisoned the allocated memory when CONFIG_PAGE_POISON was set. Since the memory map is allocated using a dedicated memmep_alloc() function that takes care of the poisoning, remove page poisoning from the memblock_alloc_*_raw() functions. Link: https://lkml.kernel.org/r/20210714123739.16493-5-rppt@kernel.org Signed-off-by: Mike Rapoport Cc: Michal Simek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c803b3c8b3b70f306ee6300bf8acdd70ffd1441a Author: Mike Rapoport Date: Thu Sep 2 14:58:02 2021 -0700 mm: introduce memmap_alloc() to unify memory map allocation There are several places that allocate memory for the memory map: alloc_node_mem_map() for FLATMEM, sparse_buffer_init() and __populate_section_memmap() for SPARSEMEM. The memory allocated in the FLATMEM case is zeroed and it is never poisoned, regardless of CONFIG_PAGE_POISON setting. The memory allocated in the SPARSEMEM cases is not zeroed and it is implicitly poisoned inside memblock if CONFIG_PAGE_POISON is set. Introduce memmap_alloc() wrapper for memblock allocators that will be used for both FLATMEM and SPARSEMEM cases and will makei memory map zeroing and poisoning consistent for different memory models. Link: https://lkml.kernel.org/r/20210714123739.16493-4-rppt@kernel.org Signed-off-by: Mike Rapoport Cc: Michal Simek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 22e7878102f94a50e9a4c2c19f909a9a0898c4ce Author: Mike Rapoport Date: Thu Sep 2 14:57:59 2021 -0700 microblaze: simplify pte_alloc_one_kernel() The microblaze's implementation of pte_alloc_one_kernel() used memblock_alloc_try_nid_raw() along with clear_page() to allocated a zeroed page during early setup. Replace calls of these functions with a call to memblock_alloc_try_nid() that already returns zeroed page and respects the same allocation limits as memblock_alloc_try_nid_raw(). While on it drop early_get_page() wrapper that was only used in pte_alloc_one_kernel(). Link: https://lkml.kernel.org/r/20210714123739.16493-3-rppt@kernel.org Signed-off-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Michal Simek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c3ab6baf6a004eab7344a1d8880a971f2414e1b6 Author: Mike Rapoport Date: Thu Sep 2 14:57:56 2021 -0700 mm/page_alloc: always initialize memory map for the holes Patch series "mm: ensure consistency of memory map poisoning". Currently memory map allocation for FLATMEM case does not poison the struct pages regardless of CONFIG_PAGE_POISON setting. This happens because allocation of the memory map for FLATMEM and SPARSMEM use different memblock functions and those that are used for SPARSMEM case (namely memblock_alloc_try_nid_raw() and memblock_alloc_exact_nid_raw()) implicitly poison the allocated memory. Another side effect of this implicit poisoning is that early setup code that uses the same functions to allocate memory burns cycles for the memory poisoning even if it was not intended. These patches introduce memmap_alloc() wrapper that ensure that the memory map allocation is consistent for different memory models. This patch (of 4): Currently memory map for the holes is initialized only when SPARSEMEM memory model is used. Yet, even with FLATMEM there could be holes in the physical memory layout that have memory map entries. For instance, the memory reserved using e820 API on i386 or "reserved-memory" nodes in device tree would not appear in memblock.memory and hence the struct pages for such holes will be skipped during memory map initialization. These struct pages will be zeroed because the memory map for FLATMEM systems is allocated with memblock_alloc_node() that clears the allocated memory. While zeroed struct pages do not cause immediate problems, the correct behaviour is to initialize every page using __init_single_page(). Besides, enabling page poison for FLATMEM case will trigger PF_POISONED_CHECK() unless the memory map is properly initialized. Make sure init_unavailable_range() is called for both SPARSEMEM and FLATMEM so that struct pages representing memory holes would appear as PG_Reserved with any memory layout. [rppt@kernel.org: fix microblaze] Link: https://lkml.kernel.org/r/YQWW3RCE4eWBuMu/@kernel.org Link: https://lkml.kernel.org/r/20210714123739.16493-1-rppt@kernel.org Link: https://lkml.kernel.org/r/20210714123739.16493-2-rppt@kernel.org Signed-off-by: Mike Rapoport Acked-by: David Hildenbrand Tested-by: Guenter Roeck Cc: Michal Simek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f16de0bcdb55bf18e2533ca625f3e4b4952f254c Author: Andrey Konovalov Date: Thu Sep 2 14:57:53 2021 -0700 kasan: test: avoid corrupting memory in kasan_rcu_uaf kasan_rcu_uaf() writes to freed memory via kasan_rcu_reclaim(), which is only safe with the GENERIC mode (as it uses quarantine). For other modes, this test corrupts kernel memory, which might result in a crash. Turn the write into a read. Link: https://lkml.kernel.org/r/b6f2c3bf712d2457c783fa59498225b66a634f62.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 756e5a47a5ddf0caa3708f922385a92af9d330b5 Author: Andrey Konovalov Date: Thu Sep 2 14:57:50 2021 -0700 kasan: test: avoid corrupting memory in copy_user_test copy_user_test() does writes past the allocated object. As the result, it corrupts kernel memory, which might lead to crashes with the HW_TAGS mode, as it neither uses quarantine nor redzones. (Technically, this test can't yet be enabled with the HW_TAGS mode, but this will be implemented in the future.) Adjust the test to only write memory within the aligned kmalloc object. Link: https://lkml.kernel.org/r/19bf3a5112ee65b7db88dc731643b657b816c5e8.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b38fcca339dbcf680c9e43054502608fabc81508 Author: Andrey Konovalov Date: Thu Sep 2 14:57:47 2021 -0700 kasan: test: clean up ksize_uaf Some KASAN tests use global variables to store function returns values so that the compiler doesn't optimize away these functions. ksize_uaf() doesn't call any functions, so it doesn't need to use kasan_int_result. Use volatile accesses instead, to be consistent with other similar tests. Link: https://lkml.kernel.org/r/a1fc34faca4650f4a6e4dfb3f8d8d82c82eb953a.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 25b12a58e848459ae2dbf2e7d318ef168bd1c5e2 Author: Andrey Konovalov Date: Thu Sep 2 14:57:44 2021 -0700 kasan: test: only do kmalloc_uaf_memset for generic mode kmalloc_uaf_memset() writes to freed memory, which is only safe with the GENERIC mode (as it uses quarantine). For other modes, this test corrupts kernel memory, which might result in a crash. Only enable kmalloc_uaf_memset() for the GENERIC mode. Link: https://lkml.kernel.org/r/2e1c87b607b1292556cde3cab2764f108542b60c.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1b0668be62cfa394903bb368641c80533bf42d5a Author: Andrey Konovalov Date: Thu Sep 2 14:57:41 2021 -0700 kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGS The HW_TAGS mode doesn't check memmove for negative size. As a result, the kmalloc_memmove_invalid_size test corrupts memory, which can result in a crash. Disable this test with HW_TAGS KASAN. Link: https://lkml.kernel.org/r/088733a06ac21eba29aa85b6f769d2abd74f9638.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 555999a009aacd90ea51a6690e8eb2a5d0427edc Author: Andrey Konovalov Date: Thu Sep 2 14:57:38 2021 -0700 kasan: test: avoid corrupting memory via memset kmalloc_oob_memset_*() tests do writes past the allocated objects. As the result, they corrupt memory, which might lead to crashes with the HW_TAGS mode, as it neither uses quarantine nor redzones. Adjust the tests to only write memory within the aligned kmalloc objects. Also add a comment mentioning that memset tests are designed to touch both valid and invalid memory. Link: https://lkml.kernel.org/r/64fd457668a16e7b58d094f14a165f9d5170c5a9.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8fbad19bdcb4b9be8131536e5bb9616ab2e4eeb3 Author: Andrey Konovalov Date: Thu Sep 2 14:57:35 2021 -0700 kasan: test: avoid writing invalid memory Multiple KASAN tests do writes past the allocated objects or writes to freed memory. Turn these writes into reads to avoid corrupting memory. Otherwise, these tests might lead to crashes with the HW_TAGS mode, as it neither uses quarantine nor redzones. Link: https://lkml.kernel.org/r/c3cd2a383e757e27dd9131635fc7d09a48a49cf9.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ab512805710fa0e4ec6b61fee8a52d044a060009 Author: Andrey Konovalov Date: Thu Sep 2 14:57:32 2021 -0700 kasan: test: rework kmalloc_oob_right Patch series "kasan: test: avoid crashing the kernel with HW_TAGS", v2. KASAN tests do out-of-bounds and use-after-free accesses. Running the tests works fine for the GENERIC mode, as it uses qurantine and redzones. But the HW_TAGS mode uses neither, and running the tests might crash the kernel. Rework the tests to avoid corrupting kernel memory. This patch (of 8): Rework kmalloc_oob_right() to do these bad access checks: 1. An unaligned access one byte past the requested kmalloc size (can only be detected by KASAN_GENERIC). 2. An aligned access into the first out-of-bounds granule that falls within the aligned kmalloc object. 3. Out-of-bounds access past the aligned kmalloc object. Test #3 deliberately uses a read access to avoid corrupting memory. Otherwise, this test might lead to crashes with the HW_TAGS mode, as it neither uses quarantine nor redzones. Link: https://lkml.kernel.org/r/cover.1628779805.git.andreyknvl@gmail.com Link: https://lkml.kernel.org/r/474aa8b7b538c6737a4c6d0090350af2e1776bef.1628779805.git.andreyknvl@gmail.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Alexander Potapenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9d1af2b780a7077d253047ccc81c5253cf0974a Author: Woody Lin Date: Thu Sep 2 14:57:29 2021 -0700 mm/kasan: move kasan.fault to mm/kasan/report.c Move the boot parameter 'kasan.fault' from hw_tags.c to report.c, so it can support all KASAN modes - generic, and both tag-based. Link: https://lkml.kernel.org/r/20210713010536.3161822-1-woodylin@google.com Signed-off-by: Woody Lin Reviewed-by: Marco Elver Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f181234a5a21fd0a86b793330016b92c7b3ed8ee Author: Chen Wandun Date: Thu Sep 2 14:57:26 2021 -0700 mm/vmalloc: fix wrong behavior in vread commit f608788cd2d6 ("mm/vmalloc: use rb_tree instead of list for vread() lookups") use rb_tree instread of list to speed up lookup, but function __find_vmap_area is try to find a vmap_area that include target address, if target address is smaller than the leftmost node in vmap_area_root, it will return NULL, then vread will read nothing. This behavior is different from the primitive semantics. The correct way is find the first vmap_are that bigger than target addr, that is what function find_vmap_area_exceed_addr does. Link: https://lkml.kernel.org/r/20210714015959.3204871-1-chenwandun@huawei.com Fixes: f608788cd2d6 ("mm/vmalloc: use rb_tree instead of list for vread() lookups") Signed-off-by: Chen Wandun Reported-by: Hulk Robot Cc: Serapheim Dimitropoulos Cc: Uladzislau Rezki (Sony) Cc: Kefeng Wang Cc: Wei Yongjun Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f8bcbecfb6b48c026e2205679c063d1f16f5a2c0 Author: Uladzislau Rezki (Sony) Date: Thu Sep 2 14:57:23 2021 -0700 lib/test_vmalloc.c: add a new 'nr_pages' parameter In order to simulate different fixed sizes for vmalloc allocation introduce a new parameter that sets number of pages to be allocated for the "fix_size_alloc_test" test. By default 1 page is used unless a different number is specified over the new parameter. Link: https://lkml.kernel.org/r/20210710194151.21370-1-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Cc: Mel Gorman Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Hillf Danton Cc: Michal Hocko Cc: Oleksiy Avramchenko Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 12e376a6f859a000308b6c7cf4a2493eda2bb026 Author: Uladzislau Rezki (Sony) Date: Thu Sep 2 14:57:19 2021 -0700 mm/vmalloc: remove gfpflags_allow_blocking() check Get rid of gfpflags_allow_blocking() check from the vmalloc() path as it is supposed to be sleepable anyway. Thus remove it from the alloc_vmap_area() as well as from the vm_area_alloc_pages(). Link: https://lkml.kernel.org/r/20210707182639.31282-2-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Acked-by: Michal Hocko Cc: Mel Gorman Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Hillf Danton Cc: Oleksiy Avramchenko Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 343ab8178f318b6006d54865972ff9c433b29e10 Author: Uladzislau Rezki (Sony) Date: Thu Sep 2 14:57:16 2021 -0700 mm/vmalloc: use batched page requests in bulk-allocator In case of simultaneous vmalloc allocations, for example it is 1GB and 12 CPUs my system is able to hit "BUG: soft lockup" for !CONFIG_PREEMPT kernel. RIP: 0010:__alloc_pages_bulk+0xa9f/0xbb0 Call Trace: __vmalloc_node_range+0x11c/0x2d0 __vmalloc_node+0x4b/0x70 fix_size_alloc_test+0x44/0x60 [test_vmalloc] test_func+0xe7/0x1f0 [test_vmalloc] kthread+0x11a/0x140 ret_from_fork+0x22/0x30 To address this issue invoke a bulk-allocator many times until all pages are obtained, i.e. do batched page requests adding cond_resched() meanwhile to reschedule. Batched value is hard-coded and is 100 pages per call. Link: https://lkml.kernel.org/r/20210707182639.31282-1-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Acked-by: Michal Hocko Cc: Christoph Hellwig Cc: Hillf Danton Cc: Matthew Wilcox Cc: Mel Gorman Cc: Nicholas Piggin Cc: Oleksiy Avramchenko Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bdbda735508ca83341899a77f143e4d5c58007b3 Author: Miles Chen Date: Thu Sep 2 14:57:13 2021 -0700 mm/sparse: clarify pgdat_to_phys Clarify pgdat_to_phys() by testing if pgdat == &contig_page_data when CONFIG_NUMA=n. We only expect contig_page_data in such case, so we use &contig_page_data directly instead of pgdat. No functional change intended when CONFIG_BUG_VM=n. Comment from Mark [1]: " ... and I reckon it'd be clearer and more robust to define pgdat_to_phys() in the same ifdefs as contig_page_data so that these, stay in-sync. e.g. have: | #ifdef CONFIG_NUMA | #define pgdat_to_phys(x) virt_to_phys(x) | #else /* CONFIG_NUMA */ | | extern struct pglist_data contig_page_data; | ... | #define pgdat_to_phys(x) __pa_symbol(&contig_page_data) | | #endif /* CONIFIG_NUMA */ " [1] https://lore.kernel.org/linux-arm-kernel/20210615131902.GB47121@C02TD0UTHF1T.local/ Link: https://lkml.kernel.org/r/20210723123342.26406-1-miles.chen@mediatek.com Signed-off-by: Miles Chen Reviewed-by: David Hildenbrand Acked-by: Mike Rapoport Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0dbb2bccf19ce5e870afb420a3d0480c582bb7b Author: Matthew Wilcox Date: Thu Sep 2 14:57:10 2021 -0700 include/linux/mmzone.h: avoid a warning in sparse memory support cppcheck warns that we're possibly losing information by shifting an int. It's a false positive, because we don't allow for a NUMA node ID that large, but if we ever change SECTION_NID_SHIFT, it could become a problem, and in any case this is usually a legitimate warning. Fix it by adding the necessary cast, which makes the compiler generate the right code. Link: https://lkml.kernel.org/r/YOya+aBZFFmC476e@casper.infradead.org Link: https://lkml.kernel.org/r/202107130348.6LsVT9Nc-lkp@intel.com Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 01c8d337d195ed105cabab95bc4dcb9e145bf5ea Author: Naoya Horiguchi Date: Thu Sep 2 14:57:07 2021 -0700 mm/sparse: set SECTION_NID_SHIFT to 6 Currently SECTION_NID_SHIFT is set to 3, which is incorrect because bit 3 and 4 can be overlapped by sub-field for early NID, and can be unexpectedly set on NUMA systems. There are a few non-critical issues related to this: - Having SECTION_TAINT_ZONE_DEVICE set for wrong sections forces pfn_to_online_page() through the slow path, but doesn't actually break the kernel. - A kdump generation tool like makedumpfile uses this field to calculate the physical address to read. So wrong bits can make the tool access to wrong address and fail to create kdump. This can be avoided by the tool, so it's not critical. To fix it, set SECTION_NID_SHIFT to 6 which is the minimum number of available bits of section flag field. Link: https://lkml.kernel.org/r/20210707045548.810271-1-naoya.horiguchi@linux.dev Fixes: 1f90a3477df3 ("mm: teach pfn_to_online_page() about ZONE_DEVICE section collisions") Signed-off-by: Naoya Horiguchi Reported-by: Kazuhito Hagio Suggested-by: Dan Williams Acked-by: David Hildenbrand Cc: Oscar Salvador Cc: Wang Wensheng Cc: Rui Xiang Cc: Kazu Cc: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 11e02d3729da1a2d4a33db5ea61291770d411884 Author: Ohhoon Kwon Date: Thu Sep 2 14:57:04 2021 -0700 mm: sparse: remove __section_nr() function As the last users of __section_nr() are gone, let's remove unused function __section_nr(). Link: https://lkml.kernel.org/r/20210707150212.855-4-ohoono.kwon@samsung.com Signed-off-by: Ohhoon Kwon Acked-by: Michal Hocko Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fc1f5e980a463325cf41d39ac6a69aa3cca73995 Author: Ohhoon Kwon Date: Thu Sep 2 14:57:01 2021 -0700 mm: sparse: pass section_nr to find_memory_block With CONFIG_SPARSEMEM_EXTREME enabled, __section_nr() which converts mem_section to section_nr could be costly since it iterates all section roots to check if the given mem_section is in its range. On the other hand, __nr_to_section() which converts section_nr to mem_section can be done in O(1). Let's pass section_nr instead of mem_section ptr to find_memory_block() in order to reduce needless iterations. Link: https://lkml.kernel.org/r/20210707150212.855-3-ohoono.kwon@samsung.com Signed-off-by: Ohhoon Kwon Acked-by: Michal Hocko Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a1bc561bb2d3d9b944878955095f53aeba30a166 Author: Ohhoon Kwon Date: Thu Sep 2 14:56:58 2021 -0700 mm: sparse: pass section_nr to section_mark_present Patch series "mm: sparse: remove __section_nr() function", v4. This patch (of 3): With CONFIG_SPARSEMEM_EXTREME enabled, __section_nr() which converts mem_section to section_nr could be costly since it iterates all section roots to check if the given mem_section is in its range. Since both callers of section_mark_present already know section_nr, let's also pass section_nr as well as mem_section in order to reduce costly translation. Link: https://lkml.kernel.org/r/20210707150212.855-1-ohoono.kwon@samsung.com Link: https://lkml.kernel.org/r/20210707150212.855-2-ohoono.kwon@samsung.com Signed-off-by: Ohhoon Kwon Acked-by: Mike Rapoport Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Cc: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cdcfc631c80e716d4b3bf534471273456bb99556 Author: Muchun Song Date: Thu Sep 2 14:56:55 2021 -0700 mm/bootmem_info.c: mark __init on register_page_bootmem_info_section register_page_bootmem_info_section() is only called from __init functions, so mark it __init as well. Link: https://lkml.kernel.org/r/20210817042221.77172-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5e22928abe671ea1541f19afb80523442938d342 Author: Chen Wandun Date: Thu Sep 2 14:56:52 2021 -0700 mm/mremap: fix memory account on do_munmap() failure mremap will account the delta between new_len and old_len in vma_to_resize, and then call move_vma when expanding an existing memory mapping. In function move_vma, there are two scenarios when calling do_munmap: 1. move_page_tables from old_addr to new_addr success 2. move_page_tables from old_addr to new_addr fail In first scenario, it should account old_len if do_munmap fail, because the delta has already been accounted. In second scenario, new_addr/new_len will assign to old_addr/old_len if move_page_table fail, so do_munmap is try to unmap new_addr actually, if do_munmap fail, it should account the new_len, because error code will be return from move_vma, and delta will be unaccounted. What'more, because of new_len == old_len, so account old_len also is OK. In summary, account old_len will be correct if do_munmap fail. Link: https://lkml.kernel.org/r/20210717101942.120607-1-chenwandun@huawei.com Fixes: 51df7bcb6151 ("mm/mremap: account memory on do_munmap() failure") Signed-off-by: Chen Wandun Acked-by: Dmitry Safonov Cc: Kefeng Wang Cc: Wei Yongjun Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9b593cb20283e68e5e65b09ca10038935297f05b Author: Liam R. Howlett Date: Thu Sep 2 14:56:49 2021 -0700 remap_file_pages: Use vma_lookup() instead of find_vma() Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read code. Link: https://lkml.kernel.org/r/20210817135234.1550204-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b78ed24e8ec48602c1d6f5a188e58d000c81e2b Author: Luigi Rizzo Date: Thu Sep 2 14:56:46 2021 -0700 mm/pagemap: add mmap_assert_locked() annotations to find_vma*() find_vma() and variants need protection when used. This patch adds mmap_assert_lock() calls in the functions. To make sure the invariant is satisfied, we also need to add a mmap_read_lock() around the get_user_pages_remote() call in get_arg_page(). The lock is not strictly necessary because the mm has been newly created, but the extra cost is limited because the same mutex was also acquired shortly before in __bprm_mm_init(), so it is hot and uncontended. [penguin-kernel@i-love.sakura.ne.jp: TOMOYO needs the same protection which get_arg_page() needs] Link: https://lkml.kernel.org/r/58bb6bf7-a57e-8a40-e74b-39584b415152@i-love.sakura.ne.jp Link: https://lkml.kernel.org/r/20210731175341.3458608-1-lrizzo@google.com Signed-off-by: Luigi Rizzo Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e15710bf04063766f428048f4dad7b73b646203f Author: Greg Kroah-Hartman Date: Thu Sep 2 14:56:43 2021 -0700 mm: change fault_in_pages_* to have an unsigned size parameter fault_in_pages_writeable() and fault_in_pages_readable() treat the size parameter as unsigned, doing pointer math with the value, so make this explicit and set it to be a size_t type which all callers currently treat it as anyway. This solves the issue where static checkers get nervous seeing pointer arithmetic happening with a signed value. Link: https://lkml.kernel.org/r/20210727111136.457638-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Reported-by: Jordy Zomer Cc: Matthew Wilcox Cc: David Howells Cc: William Kucharski Cc: "Darrick J. Wong" Cc: Hugh Dickins Cc: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f00230ff8411eaecbea1f2e528e205424f3725ba Author: Huang Ying Date: Thu Sep 2 14:56:40 2021 -0700 mm,do_huge_pmd_numa_page: remove unnecessary TLB flushing code Before commit c5b5a3dd2c1f ("mm: thp: refactor NUMA fault handling"), the TLB flushing is done in do_huge_pmd_numa_page() itself via flush_tlb_range(). But after commit c5b5a3dd2c1f ("mm: thp: refactor NUMA fault handling"), the TLB flushing is done in migrate_pages() as in the following code path anyway. do_huge_pmd_numa_page migrate_misplaced_page migrate_pages So now, the TLB flushing code in do_huge_pmd_numa_page() becomes unnecessary. So the code is deleted in this patch to simplify the code. This is only code cleanup, there's no visible performance difference. The mmu_notifier_invalidate_range() in do_huge_pmd_numa_page() is deleted too. Because migrate_pages() takes care of that too when CPU TLB is flushed. Link: https://lkml.kernel.org/r/20210720065529.716031-1-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Zi Yan Reviewed-by: Yang Shi Cc: Dan Carpenter Cc: Mel Gorman Cc: Christian Borntraeger Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Andrea Arcangeli Cc: Kirill A. Shutemov Cc: Michal Hocko Cc: Vasily Gorbik Cc: Paolo Bonzini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f358afc52c3066f4e8cd7b3a2d75b31e822519e9 Author: Christoph Hellwig Date: Thu Sep 2 14:56:36 2021 -0700 mm: remove flush_kernel_dcache_page flush_kernel_dcache_page is a rather confusing interface that implements a subset of flush_dcache_page by not being able to properly handle page cache mapped pages. The only callers left are in the exec code as all other previous callers were incorrect as they could have dealt with page cache pages. Replace the calls to flush_kernel_dcache_page with calls to flush_dcache_page, which for all architectures does either exactly the same thing, can contains one or more of the following: 1) an optimization to defer the cache flush for page cache pages not mapped into userspace 2) additional flushing for mapped page cache pages if cache aliases are possible Link: https://lkml.kernel.org/r/20210712060928.4161649-7-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Reviewed-by: Ira Weiny Cc: Alex Shi Cc: Geoff Levand Cc: Greentime Hu Cc: Guo Ren Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Nick Hu Cc: Paul Cercueil Cc: Rich Felker Cc: Russell King Cc: Thomas Bogendoerfer Cc: Ulf Hansson Cc: Vincent Chen Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0e84f5dbf8d6c33d685c45300da55bafd5dd786e Author: Christoph Hellwig Date: Thu Sep 2 14:56:33 2021 -0700 scatterlist: replace flush_kernel_dcache_page with flush_dcache_page Pages used in scatterlist can be mapped page cache pages (and often are), so we must use flush_dcache_page here instead of the more limited flush_kernel_dcache_page that is intended for highmem pages only. Also remove the PageSlab check given that page_mapping_file as used by the flush_dcache_page implementations already contains that check. Link: https://lkml.kernel.org/r/20210712060928.4161649-5-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Cc: Alex Shi Cc: Geoff Levand Cc: Greentime Hu Cc: Guo Ren Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Nick Hu Cc: Paul Cercueil Cc: Rich Felker Cc: Russell King Cc: Thomas Bogendoerfer Cc: Ulf Hansson Cc: Vincent Chen Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 64a05fe645e27a318470a9f31c76c86f36725689 Author: Christoph Hellwig Date: Thu Sep 2 14:56:30 2021 -0700 mmc: mmc_spi: replace flush_kernel_dcache_page with flush_dcache_page Pages passed to block drivers can be mapped page cache pages, so we must use flush_dcache_page here instead of the more limited flush_kernel_dcache_page that is intended for highmem pages only. Link: https://lkml.kernel.org/r/20210712060928.4161649-3-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Cc: Alex Shi Cc: Geoff Levand Cc: Greentime Hu Cc: Guo Ren Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Nick Hu Cc: Paul Cercueil Cc: Rich Felker Cc: Russell King Cc: Thomas Bogendoerfer Cc: Ulf Hansson Cc: Vincent Chen Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79c62de859f7e854399efb84a2f04ceeb1c13cc9 Author: Christoph Hellwig Date: Thu Sep 2 14:56:26 2021 -0700 mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data Patch series "_kernel_dcache_page fixes and removal". While looking to convert the block layer away from kmap_atomic towards kmap_local_page and prefeably the helpers that abstract it away I noticed that a few block drivers directly or implicitly call flush_kernel_dcache_page before kunmapping a page that has been written to. flush_kernel_dcache_page is documented to to be used in such cases, but flush_dcache_page is actually required when the page could be in the page cache and mapped to userspace, which is pretty much always the case when kmapping an arbitrary page. Unfortunately the documentation doesn't exactly make that clear, which lead to this misused. And it turns out that only the copy_strings / copy_string_kernel in the exec code were actually correct users of flush_kernel_dcache_page, which is why I think we should just remove it and eat the very minor overhead in exec rather than confusing poor driver writers. This patch (of 6): MIPS now implements flush_kernel_dcache_page (as an alias to flush_dcache_page). Link: https://lkml.kernel.org/r/20210712060928.4161649-1-hch@lst.de Link: https://lkml.kernel.org/r/20210712060928.4161649-2-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Cc: "James E.J. Bottomley" Cc: Russell King Cc: Guo Ren Cc: Thomas Bogendoerfer Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Helge Deller Cc: Yoshinori Sato Cc: Rich Felker Cc: Geoff Levand Cc: Paul Cercueil Cc: Ulf Hansson Cc: Alex Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0c52ec9513b309b250046fdb2c4c6c3726fa5cfb Author: Colin Ian King Date: Thu Sep 2 14:56:11 2021 -0700 selftests: Fix spelling mistake "cann't" -> "cannot" There is a spelling mistake in an error message. Fix it. Link: https://lkml.kernel.org/r/20210826121217.12885-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6260618e09d375ee6aa19be16813dac40cc47513 Author: Po-Hsu Lin Date: Thu Sep 2 14:56:08 2021 -0700 selftests/vm: use kselftest skip code for skipped tests There are several test cases in the vm directory are still using exit 0 when they need to be skipped. Use the kselftest framework to skip code instead so it can help us to distinguish the return status. Criterion to filter out what should be fixed in vm directory: grep -r "exit 0" -B1 | grep -i skip This change might cause some false-positives if people are running these test scripts directly and only checking their return codes, which will change from 0 to 4. However I think the impact should be small as most of our scripts here are already using this skip code. And there will be no such issue if running them with the kselftest framework. Link: https://lkml.kernel.org/r/20210823073433.37653-1-po-hsu.lin@canonical.com Signed-off-by: Po-Hsu Lin Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4ba9515d32bac1c54c2357796e32d68eeab784ce Author: Shakeel Butt Date: Thu Sep 2 14:56:05 2021 -0700 memcg: make memcg->event_list_lock irqsafe The memcg->event_list_lock is usually taken in the normal context but when the userspace closes the corresponding eventfd, eventfd_release through memcg_event_wake takes memcg->event_list_lock with interrupts disabled. This is not an issue on its own but it creates a nested dependency from eventfd_ctx->wqh.lock to memcg->event_list_lock. Independently, for unrelated eventfd, eventfd_signal() can be called in the irq context, thus making eventfd_ctx->wqh.lock an irq lock. For example, FPGA DFL driver, VHOST VPDA driver and couple of VFIO drivers. This will force memcg->event_list_lock to be an irqsafe lock as well. One way to break the nested dependency between eventfd_ctx->wqh.lock and memcg->event_list_lock is to add an indirection. However the simplest solution would be to make memcg->event_list_lock irqsafe. This is cgroup v1 feature, is in maintenance and may get deprecated in near future. So, no need to add more code. BTW this has been discussed previously [1] but there weren't irq users of eventfd_signal() at the time. [1] https://www.spinics.net/lists/cgroups/msg06248.html Link: https://lkml.kernel.org/r/20210830172953.207257-1-shakeelb@google.com Signed-off-by: Shakeel Butt Cc: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5c49cf9ad600f705f595ecbbbac2a5da9a3bb3bd Author: Michal Hocko Date: Thu Sep 2 14:56:02 2021 -0700 memcg: fix up drain_local_stock comment Thomas and Vlastimil have noticed that the comment in drain_local_stock doesn't quite make sense. It talks about a synchronization with the memory hotplug but there is no actual memory hotplug involvement here. I meant to talk about cpu hotplug here. Fix that up and hopefuly make the comment more helpful by referencing the cpu hotplug callback as well. Link: https://lkml.kernel.org/r/YRDwOhVglJmY7ES5@dhcp22.suse.cz Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 27fb0956ed08780e480a14c5cca2fd4818e99fa7 Author: Miaohe Lin Date: Thu Sep 2 14:55:59 2021 -0700 mm, memcg: save some atomic ops when flush is already true Add 'else' to save some atomic ops in obj_stock_flush_required() when flush is already true. No functional change intended here. Link: https://lkml.kernel.org/r/20210807082835.61281-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Vladimir Davydov Cc: Muchun Song Cc: Matthew Wilcox (Oracle) Cc: Alex Shi Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bec49c067c679e9b7ca7c1aac50b56618c12d879 Author: Miaohe Lin Date: Thu Sep 2 14:55:56 2021 -0700 mm, memcg: remove unused functions Since commit 2d146aa3aa84 ("mm: memcontrol: switch to rstat"), last user of memcg_stat_item_in_bytes() is gone. And since commit fa40d1ee9f15 ("mm: vmscan: memcontrol: remove mem_cgroup_select_victim_node()"), only the declaration of mem_cgroup_select_victim_node() is remained here. Remove them. Link: https://lkml.kernel.org/r/20210807082835.61281-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Alex Shi Cc: Matthew Wilcox (Oracle) Cc: Vladimir Davydov Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 37bc3cb9bbef86d1ddbbc789e55b588c8a2cac26 Author: Baolin Wang Date: Thu Sep 2 14:55:53 2021 -0700 mm: memcontrol: set the correct memcg swappiness restriction Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming anon over the file workingset") has expended the swappiness value to make swap to be preferred in some systems. We should also change the memcg swappiness restriction to allow memcg swap-preferred. Link: https://lkml.kernel.org/r/d77469b90c45c49953ccbc51e54a1d465bc18f70.1627626255.git.baolin.wang@linux.alibaba.com Fixes: c843966c556d ("mm: allow swappiness that prefers reclaiming anon over the file workingset") Signed-off-by: Baolin Wang Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 55a68c823951855f3ec313fdb85100db84284505 Author: Vasily Averin Date: Thu Sep 2 14:55:49 2021 -0700 memcg: replace in_interrupt() by !in_task() in active_memcg() set_active_memcg() uses in_interrupt() check to select proper storage for cgroup: pointer on task struct or per-cpu pointer. It isn't fully correct: obsoleted in_interrupt() includes tasks with disabled BH. It's better to use '!in_task()' instead. Link: https://lkml.org/lkml/2021/7/26/487 Link: https://lkml.kernel.org/r/ed4448b0-4970-616f-7368-ef9dd3cb628d@virtuozzo.com Fixes: 37d5985c003d ("mm: kmem: prepare remote memcg charging infra for interrupt contexts") Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 96e51ccf1af33e82f429a0d6baebba29c6448d0f Author: Shakeel Butt Date: Thu Sep 2 14:55:46 2021 -0700 memcg: cleanup racy sum avoidance code We used to have per-cpu memcg and lruvec stats and the readers have to traverse and sum the stats from each cpu. This summing was racy and may expose transient negative values. So, an explicit check was added to avoid such scenarios. Now these stats are moved to rstat infrastructure and are no more per-cpu, so we can remove the fixup for transient negative values. Link: https://lkml.kernel.org/r/20210728012243.3369123-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ec403e2ae0dfc85996aad6e944a98a16e6dfcc6d Author: Vasily Averin Date: Thu Sep 2 14:55:43 2021 -0700 memcg: enable accounting for ldt_struct objects Each task can request own LDT and force the kernel to allocate up to 64Kb memory per-mm. There are legitimate workloads with hundreds of processes and there can be hundreds of workloads running on large machines. The unaccounted memory can cause isolation issues between the workloads particularly on highly utilized machines. It makes sense to account for this objects to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/38010594-50fe-c06d-7cb0-d1f77ca422f3@virtuozzo.com Signed-off-by: Vasily Averin Acked-by: Borislav Petkov Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c509723ec27e925bb91a20682c448e95d4bc8c9f Author: Vasily Averin Date: Thu Sep 2 14:55:39 2021 -0700 memcg: enable accounting for posix_timers_cache slab A program may create multiple interval timers using timer_create(). For each timer the kernel preallocates a "queued real-time signal", Consequently, the number of timers is limited by the RLIMIT_SIGPENDING resource limit. The allocated object is quite small, ~250 bytes, but even the default signal limits allow to consume up to 100 megabytes per user. It makes sense to account for them to limit the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/57795560-025c-267c-6b1a-dea852d95530@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Thomas Gleixner Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5f58c39819ff78ca5ddbba2b3cd8ff4779b19bb5 Author: Vasily Averin Date: Thu Sep 2 14:55:35 2021 -0700 memcg: enable accounting for signals When a user send a signal to any another processes it forces the kernel to allocate memory for 'struct sigqueue' objects. The number of signals is limited by RLIMIT_SIGPENDING resource limit, but even the default settings allow each user to consume up to several megabytes of memory. It makes sense to account for these allocations to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/e34e958c-e785-712e-a62a-2c7b66c646c7@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 18319498fdd4cdf8c1c2c48cd432863b1f915d6f Author: Vasily Averin Date: Thu Sep 2 14:55:31 2021 -0700 memcg: enable accounting of ipc resources When user creates IPC objects it forces kernel to allocate memory for these long-living objects. It makes sense to account them to restrict the host's memory consumption from inside the memcg-limited container. This patch enables accounting for IPC shared memory segments, messages semaphores and semaphore's undo lists. Link: https://lkml.kernel.org/r/d6507b06-4df6-78f8-6c54-3ae86e3b5339@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 30acd0bdfb86548172168a0cc71d455944de0683 Author: Vasily Averin Date: Thu Sep 2 14:55:27 2021 -0700 memcg: enable accounting for new namesapces and struct nsproxy Container admin can create new namespaces and force kernel to allocate up to several pages of memory for the namespaces and its associated structures. Net and uts namespaces have enabled accounting for such allocations. It makes sense to account for rest ones to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/5525bcbf-533e-da27-79b7-158686c64e13@virtuozzo.com Signed-off-by: Vasily Averin Acked-by: Serge Hallyn Acked-by: Christian Brauner Acked-by: Kirill Tkhai Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 839d68206de869b8cb4272c5ea10da2ef7ec34cb Author: Vasily Averin Date: Thu Sep 2 14:55:23 2021 -0700 memcg: enable accounting for fasync_cache fasync_struct is used by almost all character device drivers to set up the fasync queue, and for regular files by the file lease code. This structure is quite small but long-living and it can be assigned for any open file. It makes sense to account for its allocations to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/1b408625-d71c-0b26-b0b6-9baf00f93e69@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0f12156dff2862ac54235fc72703f18770769042 Author: Vasily Averin Date: Thu Sep 2 14:55:19 2021 -0700 memcg: enable accounting for file lock caches User can create file locks for each open file and force kernel to allocate small but long-living objects per each open file. It makes sense to account for these objects to limit the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/b009f4c7-f0ab-c0ec-8e83-918f47d677da@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b655843444152c0a14b749308e4cb35d91cbcf0b Author: Vasily Averin Date: Thu Sep 2 14:55:14 2021 -0700 memcg: enable accounting for pollfd and select bits arrays User can call select/poll system calls with a large number of assigned file descriptors and force kernel to allocate up to several pages of memory till end of these sleeping system calls. We have here long-living unaccounted per-task allocations. It makes sense to account for these allocations to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/56e31cb5-6e1e-bdba-d7ca-be64b9842363@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Borislav Petkov Cc: Christian Brauner Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Johannes Weiner Cc: Kirill Tkhai Cc: Michal Hocko Cc: Oleg Nesterov Cc: Roman Gushchin Cc: Serge Hallyn Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Yutian Yang Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79f6540ba88dfb383ecf057a3425e668105ca774 Author: Vasily Averin Date: Thu Sep 2 14:55:10 2021 -0700 memcg: enable accounting for mnt_cache entries Patch series "memcg accounting from OpenVZ", v7. OpenVZ uses memory accounting 20+ years since v2.2.x linux kernels. Initially we used our own accounting subsystem, then partially committed it to upstream, and a few years ago switched to cgroups v1. Now we're rebasing again, revising our old patches and trying to push them upstream. We try to protect the host system from any misuse of kernel memory allocation triggered by untrusted users inside the containers. Patch-set is addressed mostly to cgroups maintainers and cgroups@ mailing list, though I would be very grateful for any comments from maintainersi of affected subsystems or other people added in cc: Compared to the upstream, we additionally account the following kernel objects: - network devices and its Tx/Rx queues - ipv4/v6 addresses and routing-related objects - inet_bind_bucket cache objects - VLAN group arrays - ipv6/sit: ip_tunnel_prl - scm_fp_list objects used by SCM_RIGHTS messages of Unix sockets - nsproxy and namespace objects itself - IPC objects: semaphores, message queues and share memory segments - mounts - pollfd and select bits arrays - signals and posix timers - file lock - fasync_struct used by the file lease code and driver's fasync queues - tty objects - per-mm LDT We have an incorrect/incomplete/obsoleted accounting for few other kernel objects: sk_filter, af_packets, netlink and xt_counters for iptables. They require rework and probably will be dropped at all. Also we're going to add an accounting for nft, however it is not ready yet. We have not tested performance on upstream, however, our performance team compares our current RHEL7-based production kernel and reports that they are at least not worse as the according original RHEL7 kernel. This patch (of 10): The kernel allocates ~400 bytes of 'struct mount' for any new mount. Creating a new mount namespace clones most of the parent mounts, and this can be repeated many times. Additionally, each mount allocates up to PATH_MAX=4096 bytes for mnt->mnt_devname. It makes sense to account for these allocations to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/045db11f-4a45-7c9b-2664-5b32c2b44943@virtuozzo.com Signed-off-by: Vasily Averin Reviewed-by: Shakeel Butt Acked-by: Christian Brauner Cc: Tejun Heo Cc: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Yutian Yang Cc: Alexander Viro Cc: Alexey Dobriyan Cc: Andrei Vagin Cc: Borislav Petkov Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Jens Axboe Cc: Jiri Slaby Cc: Kirill Tkhai Cc: Oleg Nesterov Cc: Serge Hallyn Cc: Thomas Gleixner Cc: Zefan Li Cc: Borislav Petkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb902cb47cf93b33cd92b3b7a4019330a03ef57f Author: Yutian Yang Date: Thu Sep 2 14:55:07 2021 -0700 memcg: charge fs_context and legacy_fs_context This patch adds accounting flags to fs_context and legacy_fs_context allocation sites so that kernel could correctly charge these objects. We have written a PoC to demonstrate the effect of the missing-charging bugs. The PoC takes around 1,200MB unaccounted memory, while it is charged for only 362MB memory usage. We evaluate the PoC on QEMU x86_64 v5.2.90 + Linux kernel v5.10.19 + Debian buster. All the limitations including ulimits and sysctl variables are set as default. Specifically, the hard NOFILE limit and nr_open in sysctl are both 1,048,576. /*------------------------- POC code ----------------------------*/ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ } while (0) #define STACK_SIZE (8 * 1024) #ifndef __NR_fsopen #define __NR_fsopen 430 #endif static inline int fsopen(const char *fs_name, unsigned int flags) { return syscall(__NR_fsopen, fs_name, flags); } static char thread_stack[512][STACK_SIZE]; int thread_fn(void* arg) { for (int i = 0; i< 800000; ++i) { int fsfd = fsopen("nfs", FSOPEN_CLOEXEC); if (fsfd == -1) { errExit("fsopen"); } } while(1); return 0; } int main(int argc, char *argv[]) { int thread_pid; for (int i = 0; i < 1; ++i) { thread_pid = clone(thread_fn, thread_stack[i] + STACK_SIZE, \ SIGCHLD, NULL); } while(1); return 0; } /*-------------------------- end --------------------------------*/ Link: https://lkml.kernel.org/r/1626517201-24086-1-git-send-email-nglaive@gmail.com Signed-off-by: Yutian Yang Reviewed-by: Shakeel Butt Cc: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit aa48e47e3906c332eaf1e5d7b58be11d3509ad9f Author: Shakeel Butt Date: Thu Sep 2 14:55:04 2021 -0700 memcg: infrastructure to flush memcg stats At the moment memcg stats are read in four contexts: 1. memcg stat user interfaces 2. dirty throttling 3. page fault 4. memory reclaim Currently the kernel flushes the stats for first two cases. Flushing the stats for remaining two casese may have performance impact. Always flushing the memcg stats on the page fault code path may negatively impacts the performance of the applications. In addition flushing in the memory reclaim code path, though treated as slowpath, can become the source of contention for the global lock taken for stat flushing because when system or memcg is under memory pressure, many tasks may enter the reclaim path. This patch uses following mechanisms to solve these challenges: 1. Periodically flush the stats from root memcg every 2 seconds. This will time limit the out of sync stats. 2. Asynchronously flush the stats after fixed number of stat updates. In the worst case the stat can be out of sync by O(nr_cpus * BATCH) for 2 seconds. 3. For avoiding thundering herd to flush the stats particularly from the memory reclaim context, introduce memcg local spinlock and let only one flusher active at a time. This could have been done through cgroup_rstat_lock lock but that lock is used by other subsystem and for userspace reading memcg stats. So, it is better to keep flushers introduced by this patch decoupled from cgroup_rstat_lock. However we would have to use irqsafe version of rstat flush but that is fine as this code path will be flushing for whole tree and do the work for everyone. No one will be waiting for that worker. [shakeelb@google.com: fix sleep-in-wrong context bug] Link: https://lkml.kernel.org/r/20210716212137.1391164-2-shakeelb@google.com Link: https://lkml.kernel.org/r/20210714013948.270662-2-shakeelb@google.com Signed-off-by: Shakeel Butt Tested-by: Marek Szyprowski Cc: Hillf Danton Cc: Huang Ying Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e1c0d6f58207e7e60674647d3935f446f05613c Author: Shakeel Butt Date: Thu Sep 2 14:55:00 2021 -0700 memcg: switch lruvec stats to rstat The commit 2d146aa3aa84 ("mm: memcontrol: switch to rstat") switched memcg stats to rstat infrastructure but skipped the conversion of the lruvec stats as such stats are read in the performance critical code paths and flushing stats may have impacted the performances of the applications. This patch converts the lruvec stats to rstat and later patches add mechanisms to keep the performance impact to minimum. The rstat conversion comes with the price i.e. memory cost. Effectively this patch reverts the savings done by the commit f3344adf38bd ("mm: memcontrol: optimize per-lruvec stats counter memory usage"). However this cost is justified due to negative impact of the inaccurate lruvec stats on many heuristics. One such case is reported in [1]. The memory reclaim code is filled with plethora of heuristics and many of those heuristics reads the lruvec stats. So, inaccurate stats can make such heuristics ineffective. [1] reports the impact of inaccurate lruvec stats on the "cache trim mode" heuristic. Inaccurate lruvec stats can impact the deactivation and aging anon heuristics as well. [1] https://lore.kernel.org/linux-mm/20210311004449.1170308-1-ying.huang@intel.com/ Link: https://lkml.kernel.org/r/20210716212137.1391164-1-shakeelb@google.com Link: https://lkml.kernel.org/r/20210714013948.270662-1-shakeelb@google.com Signed-off-by: Shakeel Butt Cc: Tejun Heo Cc: Johannes Weiner Cc: Muchun Song Cc: Michal Hocko Cc: Roman Gushchin Cc: Huang Ying Cc: Hillf Danton Cc: Michal Koutný Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fab827dbee8c2e06ca4ba000fa6c48bcf9054aba Author: Vasily Averin Date: Thu Sep 2 14:54:57 2021 -0700 memcg: enable accounting for pids in nested pid namespaces Commit 5d097056c9a0 ("kmemcg: account certain kmem allocations to memcg") enabled memcg accounting for pids allocated from init_pid_ns.pid_cachep, but forgot to adjust the setting for nested pid namespaces. As a result, pid memory is not accounted exactly where it is really needed, inside memcg-limited containers with their own pid namespaces. Pid was one the first kernel objects enabled for memcg accounting. init_pid_ns.pid_cachep marked by SLAB_ACCOUNT and we can expect that any new pids in the system are memcg-accounted. Though recently I've noticed that it is wrong. nested pid namespaces creates own slab caches for pid objects, nested pids have increased size because contain id both for all parent and for own pid namespaces. The problem is that these slab caches are _NOT_ marked by SLAB_ACCOUNT, as a result any pids allocated in nested pid namespaces are not memcg-accounted. Pid struct in nested pid namespace consumes up to 500 bytes memory, 100000 such objects gives us up to ~50Mb unaccounted memory, this allow container to exceed assigned memcg limits. Link: https://lkml.kernel.org/r/8b6de616-fd1a-02c6-cbdb-976ecdcfa604@virtuozzo.com Fixes: 5d097056c9a0 ("kmemcg: account certain kmem allocations to memcg") Cc: stable@vger.kernel.org Signed-off-by: Vasily Averin Reviewed-by: Michal Koutný Reviewed-by: Shakeel Butt Acked-by: Christian Brauner Acked-by: Roman Gushchin Cc: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 01c4b28cd2e600160566a7d83b4703800381dae1 Author: Suren Baghdasaryan Date: Thu Sep 2 14:54:54 2021 -0700 mm, memcg: inline swap-related functions to improve disabled memcg config Inline mem_cgroup_try_charge_swap, mem_cgroup_uncharge_swap and cgroup_throttle_swaprate functions to perform mem_cgroup_disabled static key check inline before calling the main body of the function. This minimizes the memcg overhead in the pagefault and exit_mmap paths when memcgs are disabled using cgroup_disable=memory command-line option. This change results in ~1% overhead reduction when running PFT test [1] comparing {CONFIG_MEMCG=n} against {CONFIG_MEMCG=y, cgroup_disable=memory} configuration on an 8-core ARM64 Android device. [1] https://lkml.org/lkml/2006/8/29/294 also used in mmtests suite Link: https://lkml.kernel.org/r/20210713010934.299876-3-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: Tejun Heo Cc: Roman Gushchin Cc: Yang Shi Cc: Alex Shi Cc: Wei Yang Cc: Jens Axboe Cc: Joonsoo Kim Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Alistair Popple Cc: Minchan Kim Cc: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c8d8f97ae2272f1455ee31a5af62b326772eb31 Author: Suren Baghdasaryan Date: Thu Sep 2 14:54:50 2021 -0700 mm, memcg: inline mem_cgroup_{charge/uncharge} to improve disabled memcg config Inline mem_cgroup_{charge/uncharge} and mem_cgroup_uncharge_list functions functions to perform mem_cgroup_disabled static key check inline before calling the main body of the function. This minimizes the memcg overhead in the pagefault and exit_mmap paths when memcgs are disabled using cgroup_disable=memory command-line option. This change results in ~0.4% overhead reduction when running PFT test [1] comparing {CONFIG_MEMCG=n} against {CONFIG_MEMCG=y, cgroup_disable=memory} configuration on an 8-core ARM64 Android device. [1] https://lkml.org/lkml/2006/8/29/294 also used in mmtests suite Link: https://lkml.kernel.org/r/20210713010934.299876-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Michal Hocko Acked-by: Johannes Weiner Cc: Alex Shi Cc: Alistair Popple Cc: David Hildenbrand Cc: Jens Axboe Cc: Joonsoo Kim Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Minchan Kim Cc: Roman Gushchin Cc: Tejun Heo Cc: Wei Yang Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 56cab2859fbe08e1f2a5ac3f4655dcc398bc013d Author: Suren Baghdasaryan Date: Thu Sep 2 14:54:47 2021 -0700 mm, memcg: add mem_cgroup_disabled checks in vmpressure and swap-related functions Add mem_cgroup_disabled check in vmpressure, mem_cgroup_uncharge_swap and cgroup_throttle_swaprate functions. This minimizes the memcg overhead in the pagefault and exit_mmap paths when memcgs are disabled using cgroup_disable=memory command-line option. This change results in ~2.1% overhead reduction when running PFT test [1] comparing {CONFIG_MEMCG=n, CONFIG_MEMCG_SWAP=n} against {CONFIG_MEMCG=y, CONFIG_MEMCG_SWAP=y, cgroup_disable=memory} configuration on an 8-core ARM64 Android device. [1] https://lkml.org/lkml/2006/8/29/294 also used in mmtests suite Link: https://lkml.kernel.org/r/20210713010934.299876-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: Alex Shi Cc: Alistair Popple Cc: David Hildenbrand Cc: Jens Axboe Cc: Joonsoo Kim Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Minchan Kim Cc: Roman Gushchin Cc: Tejun Heo Cc: Wei Yang Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1e6decf30af5c5c75445ed6ad4e65a26de578a03 Author: Hugh Dickins Date: Thu Sep 2 14:54:43 2021 -0700 shmem: shmem_writepage() split unlikely i915 THP drivers/gpu/drm/i915/gem/i915_gem_shmem.c contains a shmem_writeback() which calls shmem_writepage() from a shrinker: that usually works well enough; but if /sys/kernel/mm/transparent_hugepage/shmem_enabled has been set to "always" (intended to be usable) or "force" (forces huge everywhere for easy testing), shmem_writepage() is surprised to be called with a huge page, and crashes on the VM_BUG_ON_PAGE(PageCompound) (I did not find out where the crash happens when CONFIG_DEBUG_VM is off). LRU page reclaim always splits the shmem huge page first: I'd prefer not to demand that of i915, so check and split compound in shmem_writepage(). Patch history: when first sent last year http://lkml.kernel.org/r/alpine.LSU.2.11.2008301401390.5954@eggly.anvils https://lore.kernel.org/linux-mm/20200919042009.bomzxmrg7%25akpm@linux-foundation.org/ Matthew Wilcox noticed that tail pages were wrongly left clean. This version brackets the split with Set and Clear PageDirty as he suggested: which works very well, even if it falls short of our aspirations. And recently I realized that the crash is not limited to the testing option "force", but affects "always" too: which is more important to fix. Link: https://lkml.kernel.org/r/bac6158c-8b3d-4dca-cffc-4982f58d9794@google.com Fixes: 2d6692e642e7 ("drm/i915: Start writeback from the shrinker") Signed-off-by: Hugh Dickins Reviewed-by: Shakeel Butt Acked-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a7fddc36299a8a99073e9e6e922b6cd451508385 Author: Hugh Dickins Date: Thu Sep 2 14:54:40 2021 -0700 huge tmpfs: decide stat.st_blksize by shmem_is_huge() 4.18 commit 89fdcd262fd4 ("mm: shmem: make stat.st_blksize return huge page size if THP is on") added is_huge_enabled() to decide st_blksize: if hugeness is to be defined per file, that will need to be replaced by shmem_is_huge(). This does give a different answer (No) for small files on a "huge=within_size" mount: but that can be considered a minor bugfix. And a different answer (No) for default files on a "huge=advise" mount: I'm reluctant to complicate it, just to reproduce the same debatable answer as before. Link: https://lkml.kernel.org/r/af7fb3f9-4415-9e8e-fdac-b1a5253ad21@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5e6e5a12a44ca5ff2b130d8d39aaf9b8c026de94 Author: Hugh Dickins Date: Thu Sep 2 14:54:37 2021 -0700 huge tmpfs: shmem_is_huge(vma, inode, index) Extend shmem_huge_enabled(vma) to shmem_is_huge(vma, inode, index), so that a consistent set of checks can be applied, even when the inode is accessed through read/write syscalls (with NULL vma) instead of mmaps (the index argument is seldom of interest, but required by mount option "huge=within_size"). Clean up and rearrange the checks a little. This then replaces the checks which shmem_fault() and shmem_getpage_gfp() were making, and eliminates the SGP_HUGE and SGP_NOHUGE modes. Replace a couple of 0s by explicit SHMEM_HUGE_NEVERs; and replace the obscure !shmem_mapping() symlink check by explicit S_ISLNK() - nothing else needs that symlink check, so leave it there in shmem_getpage_gfp(). Link: https://lkml.kernel.org/r/23a77889-2ddc-b030-75cd-44ca27fd4d1@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit acdd9f8e0fed9f1bd7e83a8ff934694bb4c9a72b Author: Hugh Dickins Date: Thu Sep 2 14:54:34 2021 -0700 huge tmpfs: SGP_NOALLOC to stop collapse_file() on race khugepaged's collapse_file() currently uses SGP_NOHUGE to tell shmem_getpage() not to try allocating a huge page, in the very unlikely event that a racing hole-punch removes the swapped or fallocated page as soon as i_pages lock is dropped. We want to consolidate shmem's huge decisions, removing SGP_HUGE and SGP_NOHUGE; but cannot quite persuade ourselves that it's okay to regress the protection in this case - Yang Shi points out that the huge page would remain indefinitely, charged to root instead of the intended memcg. collapse_file() should not even allocate a small page in this case: why proceed if someone is punching a hole? SGP_READ is almost the right flag here, except that it optimizes away from a fallocated page, with NULL to tell caller to fill with zeroes (like a hole); whereas collapse_file()'s sequence relies on using a cache page. Add SGP_NOALLOC just for this. There are too many consecutive "if (page"s there in shmem_getpage_gfp(): group it better; and fix the outdated "bring it back from swap" comment. Link: https://lkml.kernel.org/r/1355343b-acf-4653-ef79-6aee40214ac5@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c852023e6fd4fa5f75175729e0b55abb062ca799 Author: Hugh Dickins Date: Thu Sep 2 14:54:31 2021 -0700 huge tmpfs: move shmem_huge_enabled() upwards shmem_huge_enabled() is about to be enhanced into shmem_is_huge(), so that it can be used more widely throughout: before making functional changes, shift it to its final position (to avoid forward declaration). Link: https://lkml.kernel.org/r/16fec7b7-5c84-415a-8586-69d8bf6a6685@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b9e2faaf6fa0df984d4ecca775f3629a4d5e599b Author: Hugh Dickins Date: Thu Sep 2 14:54:27 2021 -0700 huge tmpfs: revert shmem's use of transhuge_vma_enabled() 5.14 commit e6be37b2e7bd ("mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled()") added transhuge_vma_enabled() as a wrapper for two very different checks (one check is whether the app has marked its address range not to use THPs, the other check is whether the app is running in a hierarchy that has been marked never to use THPs). shmem_huge_enabled() prefers to show those two checks explicitly, as before. Link: https://lkml.kernel.org/r/45e5338-18d-c6f9-c17e-34f510bc1728@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2b5bbcb1c9c2cd05a06dcf54df77255a8c406a7b Author: Hugh Dickins Date: Thu Sep 2 14:54:24 2021 -0700 huge tmpfs: remove shrinklist addition from shmem_setattr() There's a block of code in shmem_setattr() to add the inode to shmem_unused_huge_shrink()'s shrinklist when lowering i_size: it dates from before 5.7 changed truncation to do split_huge_page() for itself, and should have been removed at that time. I am over-stating that: split_huge_page() can fail (notably if there's an extra reference to the page at that time), so there might be value in retrying. But there were already retries as truncation worked through the tails, and this addition risks repeating unsuccessful retries indefinitely: I'd rather remove it now, and work on reducing the chance of split_huge_page() failures separately, if we need to. Link: https://lkml.kernel.org/r/b73b3492-8822-18f9-83e2-938528cdde94@google.com Fixes: 71725ed10c40 ("mm: huge tmpfs: try to split_huge_page() when punching hole") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d144bf6205342a4b5fed5d204ae18849a4de741b Author: Hugh Dickins Date: Thu Sep 2 14:54:21 2021 -0700 huge tmpfs: fix split_huge_page() after FALLOC_FL_KEEP_SIZE A successful shmem_fallocate() guarantees that the extent has been reserved, even beyond i_size when the FALLOC_FL_KEEP_SIZE flag was used. But that guarantee is broken by shmem_unused_huge_shrink()'s attempts to split huge pages and free their excess beyond i_size; and by other uses of split_huge_page() near i_size. It's sad to add a shmem inode field just for this, but I did not find a better way to keep the guarantee. A flag to say KEEP_SIZE has been used would be cheaper, but I'm averse to unclearable flags. The fallocend field is not perfect either (many disjoint ranges might be fallocated), but good enough; and gains another use later on. Link: https://lkml.kernel.org/r/ca9a146-3a59-6cd3-7f28-e9a044bb1052@google.com Fixes: 779750d20b93 ("shmem: split huge pages beyond i_size under memory pressure") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Rik van Riel Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 050dcb5c85bb47f8151175ca5833aa882cc7fe0c Author: Hugh Dickins Date: Thu Sep 2 14:54:18 2021 -0700 huge tmpfs: fix fallocate(vanilla) advance over huge pages Patch series "huge tmpfs: shmem_is_huge() fixes and cleanups". A series of huge tmpfs fixes and cleanups. This patch (of 9): shmem_fallocate() goes to a lot of trouble to leave its newly allocated pages !Uptodate, partly to identify and undo them on failure, partly to leave the overhead of clearing them until later. But the huge page case did not skip to the end of the extent, walked through the tail pages one by one, and appeared to work just fine: but in doing so, cleared and Uptodated the huge page, so there was no way to undo it on failure. And by setting Uptodate too soon, it messed up both its nr_falloced and nr_unswapped counts, so that the intended "time to give up" heuristic did not work at all. Now advance immediately to the end of the huge extent, with a comment on why this is more than just an optimization. But although this speeds up huge tmpfs fallocation, it does leave the clearing until first use, and some users may have come to appreciate slow fallocate but fast first use: if they complain, then we can consider adding a pass to clear at the end. Link: https://lkml.kernel.org/r/da632211-8e3e-6b1-aee-ab24734429a0@google.com Link: https://lkml.kernel.org/r/16201bd2-70e-37e2-e89b-5f929430da@google.com Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: Shakeel Butt Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Mike Kravetz Cc: Michal Hocko Cc: Rik van Riel Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 86a2f3f2d99e9765d13a55ee2e4364deb6cdf794 Author: Miaohe Lin Date: Thu Sep 2 14:54:15 2021 -0700 shmem: include header file to declare swap_info It's bad to extern swap_info[] in .c. Include corresponding header file instead. Link: https://lkml.kernel.org/r/20210812120350.49801-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cdd89d4cb6507f123f6ecbfe51050e9a9844c2ab Author: Miaohe Lin Date: Thu Sep 2 14:54:12 2021 -0700 shmem: remove unneeded function forward declaration The forward declaration for shmem_should_replace_page() and shmem_replace_page() is unnecessary. Remove them. Link: https://lkml.kernel.org/r/20210812120350.49801-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b6378fc8b477921e62fd5763efeec676ff8e7a16 Author: Miaohe Lin Date: Thu Sep 2 14:54:09 2021 -0700 shmem: remove unneeded header file mfill_atomic_install_pte() is introduced to install pte and update mmu cache since commit bf6ebd97aba0 ("userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte()"). So we should remove tlbflush.h as update_mmu_cache() is not called here now. Link: https://lkml.kernel.org/r/20210812120350.49801-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f2b346e4522c2849a3dc59b7077b8952918ef486 Author: Miaohe Lin Date: Thu Sep 2 14:54:06 2021 -0700 shmem: remove unneeded variable ret Patch series "Cleanups for shmem". This series contains cleanups to remove unneeded variable, header file, function forward declaration and so on. More details can be found in the respective changelogs. This patch (of 4): The local variable ret is always equal to -ENOMEM and never touched. So remove it and return -ENOMEM directly to simplify the code. Link: https://lkml.kernel.org/r/20210812120350.49801-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210812120350.49801-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bf11b9a8e9a93c1fc0ebfc2929622d5cf7d43888 Author: Sebastian Andrzej Siewior Date: Thu Sep 2 14:54:03 2021 -0700 shmem: use raw_spinlock_t for ->stat_lock Each CPU has SHMEM_INO_BATCH inodes available in `->ino_batch' which is per-CPU. Access here is serialized by disabling preemption. If the pool is empty, it gets reloaded from `->next_ino'. Access here is serialized by ->stat_lock which is a spinlock_t and can not be acquired with disabled preemption. One way around it would make per-CPU ino_batch struct containing the inode number a local_lock_t. Another solution is to promote ->stat_lock to a raw_spinlock_t. The critical sections are short. The mpol_put() must be moved outside of the critical section to avoid invoking the destructor with disabled preemption. Link: https://lkml.kernel.org/r/20210806142916.jdwkb5bx62q5fwfo@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3969b1a654fb09b7915efc1aa4ad45daf932e12f Author: John Hubbard Date: Thu Sep 2 14:54:00 2021 -0700 mm: delete unused get_kernel_page() get_kernel_page() was added in 2012 by [1]. It was used for a while for NFS, but then in 2014, a refactoring [2] removed all callers, and it has apparently not been used since. Remove get_kernel_page() because it has no callers. [1] commit 18022c5d8627 ("mm: add get_kernel_page[s] for pinning of kernel addresses for I/O") [2] commit 91f79c43d1b5 ("new helper: iov_iter_get_pages_alloc()") Link: https://lkml.kernel.org/r/20210729221847.1165665-1-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: David Hildenbrand Cc: Mel Gorman Cc: Rik van Riel Cc: David S. Miller Cc: Eric B Munson Cc: Eric Paris Cc: James Morris Cc: Mike Christie Cc: Neil Brown Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Trond Myklebust Cc: Xiaotian Feng Cc: Mark Salter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 51cc3a6620a6ca934d468bda345678768493f5d8 Author: Hugh Dickins Date: Thu Sep 2 14:53:57 2021 -0700 fs, mm: fix race in unlinking swapfile We had a recurring situation in which admin procedures setting up swapfiles would race with test preparation clearing away swapfiles; and just occasionally that got stuck on a swapfile "(deleted)" which could never be swapped off. That is not supposed to be possible. 2.6.28 commit f9454548e17c ("don't unlink an active swapfile") admitted that it was leaving a race window open: now close it. may_delete() makes the IS_SWAPFILE check (amongst many others) before inode_lock has been taken on target: now repeat just that simple check in vfs_unlink() and vfs_rename(), after taking inode_lock. Which goes most of the way to fixing the race, but swapon() must also check after it acquires inode_lock, that the file just opened has not already been unlinked. Link: https://lkml.kernel.org/r/e17b91ad-a578-9a15-5e3-4989e0f999b5@google.com Fixes: f9454548e17c ("don't unlink an active swapfile") Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9857a17f206ff374aea78bccfb687f145368be2e Author: John Hubbard Date: Thu Sep 2 14:53:54 2021 -0700 mm/gup: remove try_get_page(), call try_get_compound_head() directly try_get_page() is very similar to try_get_compound_head(), and in fact try_get_page() has fallen a little behind in terms of maintenance: try_get_compound_head() handles speculative page references more thoroughly. There are only two try_get_page() callsites, so just call try_get_compound_head() directly from those, and remove try_get_page() entirely. Also, seeing as how this changes try_get_compound_head() into a non-static function, provide some kerneldoc documentation for it. Link: https://lkml.kernel.org/r/20210813044133.1536842-4-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Vasily Gorbik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 54d516b1d62ff8f17cee2da06e5e4706a0d00b8a Author: John Hubbard Date: Thu Sep 2 14:53:51 2021 -0700 mm/gup: small refactoring: simplify try_grab_page() try_grab_page() does the same thing as try_grab_compound_head(..., refs=1, ...), just with a different API. So there is a lot of code duplication there. Change try_grab_page() to call try_grab_compound_head(), while keeping the API contract identical for callers. Also, now that try_grab_compound_head() always has a caller, remove the __maybe_unused annotation. Link: https://lkml.kernel.org/r/20210813044133.1536842-3-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Vasily Gorbik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3967db22ba324939762f618f0d654b13317ca7a4 Author: John Hubbard Date: Thu Sep 2 14:53:48 2021 -0700 mm/gup: documentation corrections for gup/pup Patch series "A few gup refactorings and documentation updates", v3. While reviewing some of the other things going on around gup.c, I noticed that the documentation was wrong for a few of the routines that I wrote. And then I noticed that there was some significant code duplication too. So this fixes those issues. This is not entirely risk-free, but after looking closely at this, I think it's actually a useful improvement, getting rid of the code duplication here. This patch (of 3): The documentation for try_grab_compound_head() and try_grab_page() has fallen a little out of date. Update and clarify a few points. Also make it kerneldoc-correct, by adding @args documentation. Link: https://lkml.kernel.org/r/20210813044133.1536842-1-jhubbard@nvidia.com Link: https://lkml.kernel.org/r/20210813044133.1536842-2-jhubbard@nvidia.com Signed-off-by: John Hubbard Cc: Matthew Wilcox Cc: Christoph Hellwig Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit be51eb18b81b2f0a0a562bac0f6fe0f4b05c439e Author: Miaohe Lin Date: Thu Sep 2 14:53:45 2021 -0700 mm: gup: use helper PAGE_ALIGNED in populate_vma_page_range() Use helper PAGE_ALIGNED to check if address is aligned to PAGE_SIZE. Minor readability improvement. Link: https://lkml.kernel.org/r/20210807093620.21347-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6401c4eb57f947a49eb144b5b0787cde3318e82e Author: Miaohe Lin Date: Thu Sep 2 14:53:42 2021 -0700 mm: gup: fix potential pgmap refcnt leak in __gup_device_huge() When failed to try_grab_page, put_dev_pagemap() is missed. So pgmap refcnt will leak in this case. Also we remove the check for pgmap against NULL as it's also checked inside the put_dev_pagemap(). [akpm@linux-foundation.org: simplify, cleanup] [akpm@linux-foundation.org: fix return value] Link: https://lkml.kernel.org/r/20210807093620.21347-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages") Reviewed-by: John Hubbard Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 06a9e696639c5e0f457ae117c39ec4cbe5096dc9 Author: Miaohe Lin Date: Thu Sep 2 14:53:39 2021 -0700 mm: gup: remove useless BUG_ON in __get_user_pages() Indeed, this BUG_ON couldn't catch anything useful. We are sure ret == 0 here because we would already bail out if ret != 0 and ret is untouched till here. Link: https://lkml.kernel.org/r/20210807093620.21347-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0fef147ba7329d54a08b3b8c7e152b6dd5391199 Author: Miaohe Lin Date: Thu Sep 2 14:53:36 2021 -0700 mm: gup: remove unneed local variable orig_refs Remove unneed local variable orig_refs since refs is unchanged now. Link: https://lkml.kernel.org/r/20210807093620.21347-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: Claudio Imbrenda Reviewed-by: David Hildenbrand Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8fed2f3cd6da9fba1045c557f88fc3c46dc7d2d2 Author: Miaohe Lin Date: Thu Sep 2 14:53:33 2021 -0700 mm: gup: remove set but unused local variable major Patch series "Cleanups and fixup for gup". This series contains cleanups to remove unneeded variable, useless BUG_ON and use helper to improve readability. Also we fix a potential pgmap refcnt leak. More details can be found in the respective changelogs. This patch (of 5): Since commit a2beb5f1efed ("mm: clean up the last pieces of page fault accountings"), the local variable major is unused. Remove it. Link: https://lkml.kernel.org/r/20210807093620.21347-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210807093620.21347-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6de522d1667f628376517e4b177af10c739d745b Author: Jing Yangyang Date: Thu Sep 2 14:53:30 2021 -0700 include/linux/buffer_head.h: fix boolreturn.cocci warnings ./include/linux/buffer_head.h:412:64-65:WARNING:return of 0/1 in function 'has_bh_in_lru' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Link: https://lkml.kernel.org/r/20210824055828.58783-1-deng.changcheng@zte.com.cn Signed-off-by: Jing Yangyang Reported-by: Zeal Robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7490a2d248145d8694e1e9828801b496250fd697 Author: Shakeel Butt Date: Thu Sep 2 14:53:27 2021 -0700 writeback: memcg: simplify cgroup_writeback_by_id Currently cgroup_writeback_by_id calls mem_cgroup_wb_stats() to get dirty pages for a memcg. However mem_cgroup_wb_stats() does a lot more than just get the number of dirty pages. Just directly get the number of dirty pages instead of calling mem_cgroup_wb_stats(). Also cgroup_writeback_by_id() is only called for best-effort dirty flushing, so remove the unused 'nr' parameter and no need to explicitly flush memcg stats. Link: https://lkml.kernel.org/r/20210722182627.2267368-1-shakeelb@google.com Signed-off-by: Shakeel Butt Reviewed-by: Jan Kara Cc: Tejun Heo Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7ae12c809f6a31d3da7b96339dbefa141884c711 Author: Johannes Weiner Date: Thu Sep 2 14:53:24 2021 -0700 fs: inode: count invalidated shadow pages in pginodesteal pginodesteal is supposed to capture the impact that inode reclaim has on the page cache state. Currently, it doesn't consider shadow pages that get dropped this way, even though this can have a significant impact on paging behavior, memory pressure calculations etc. To improve visibility into these effects, make sure shadow pages get counted when they get dropped through inode reclaim. This changes the return value semantics of invalidate_mapping_pages() semantics slightly, but the only two users are the inode shrinker itsel and a usb driver that logs it for debugging purposes. Link: https://lkml.kernel.org/r/20210614211904.14420-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 16e2df2a05d46c983bf310b19432c5ca4684b2bc Author: Johannes Weiner Date: Thu Sep 2 14:53:21 2021 -0700 fs: drop_caches: fix skipping over shadow cache inodes When drop_caches truncates the page cache in an inode it also includes any shadow entries for evicted pages. However, there is a preliminary check on whether the inode has pages: if it has *only* shadow entries, it will skip running truncation on the inode and leave it behind. Fix the check to mapping_empty(), such that it runs truncation on any inode that has cache entries at all. Link: https://lkml.kernel.org/r/20210614211904.14420-2-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Reported-by: Roman Gushchin Acked-by: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3047250972ff935b1d7a0629fa3acb04c12dcc07 Author: Johannes Weiner Date: Thu Sep 2 14:53:18 2021 -0700 mm: remove irqsave/restore locking from contexts with irqs enabled The page cache deletion paths all have interrupts enabled, so no need to use irqsafe/irqrestore locking variants. They used to have irqs disabled by the memcg lock added in commit c4843a7593a9 ("memcg: add per cgroup dirty page accounting"), but that has since been replaced by memcg taking the page lock instead, commit 0a31bc97c80c ("mm: memcontrol: rewrite uncharge AP"). Link: https://lkml.kernel.org/r/20210614211904.14420-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20792ebf3eeb828a692b29f3000673cb9ca83c3a Author: Jan Kara Date: Thu Sep 2 14:53:15 2021 -0700 writeback: use READ_ONCE for unlocked reads of writeback stats We do some unlocked reads of writeback statistics like avg_write_bandwidth, dirty_ratelimit, or bw_time_stamp. Generally we are fine with getting somewhat out-of-date values but actually getting different values in various parts of the functions because the compiler decided to reload value from original memory location could confuse calculations. Use READ_ONCE for these unlocked accesses and WRITE_ONCE for the updates to be on the safe side. Link: https://lkml.kernel.org/r/20210713104716.22868-5-jack@suse.cz Signed-off-by: Jan Kara Cc: Michael Stapelberg Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 42dd235cb15c06c8446f9aed695648a3c2eb8d11 Author: Jan Kara Date: Thu Sep 2 14:53:12 2021 -0700 writeback: rename domain_update_bandwidth() Rename domain_update_bandwidth() to domain_update_dirty_limit(). The original name is a misnomer. The function has nothing to do with a bandwidth, it updates dirty limits. Link: https://lkml.kernel.org/r/20210713104716.22868-4-jack@suse.cz Signed-off-by: Jan Kara Cc: Michael Stapelberg Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 45a2966fd64147518dc5bca25f447bd0fb5359ac Author: Jan Kara Date: Thu Sep 2 14:53:09 2021 -0700 writeback: fix bandwidth estimate for spiky workload Michael Stapelberg has reported that for workload with short big spikes of writes (GCC linker seem to trigger this frequently) the write throughput is heavily underestimated and tends to steadily sink until it reaches zero. This has rather bad impact on writeback throttling (causing stalls). The problem is that writeback throughput estimate gets updated at most once per 200 ms. One update happens early after we submit pages for writeback (at that point writeout of only small fraction of pages is completed and thus observed throughput is tiny). Next update happens only during the next write spike (updates happen only from inode writeback and dirty throttling code) and if that is more than 1s after previous spike, we decide system was idle and just ignore whatever was written until this moment. Fix the problem by making sure writeback throughput estimate is also updated shortly after writeback completes to get reasonable estimate of throughput for spiky workloads. [jack@suse.cz: avoid division by 0 in wb_update_dirty_ratelimit()] Link: https://lore.kernel.org/lkml/20210617095309.3542373-1-stapelberg+linux@google.com Link: https://lkml.kernel.org/r/20210713104716.22868-3-jack@suse.cz Signed-off-by: Jan Kara Reported-by: Michael Stapelberg Tested-by: Michael Stapelberg Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fee468fdf41cdf36ba6b5a780e2474d0a3e066ac Author: Jan Kara Date: Thu Sep 2 14:53:06 2021 -0700 writeback: reliably update bandwidth estimation Currently we trigger writeback bandwidth estimation from balance_dirty_pages() and from wb_writeback(). However neither of these need to trigger when the system is relatively idle and writeback is triggered e.g. from fsync(2). Make sure writeback estimates happen reliably by triggering them from do_writepages(). Link: https://lkml.kernel.org/r/20210713104716.22868-2-jack@suse.cz Signed-off-by: Jan Kara Cc: Michael Stapelberg Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 633a2abb9e1cd5c95f3b600f4b2c12cce22ae4a0 Author: Jan Kara Date: Thu Sep 2 14:53:04 2021 -0700 writeback: track number of inodes under writeback Patch series "writeback: Fix bandwidth estimates", v4. Fix estimate of writeback throughput when device is not fully busy doing writeback. Michael Stapelberg has reported that such workload (e.g. generated by linking) tends to push estimated throughput down to 0 and as a result writeback on the device is practically stalled. The first three patches fix the reported issue, the remaining two patches are unrelated cleanups of problems I've noticed when reading the code. This patch (of 4): Track number of inodes under writeback for each bdi_writeback structure. We will use this to decide whether wb does any IO and so we can estimate its writeback throughput. In principle we could use number of pages under writeback (WB_WRITEBACK counter) for this however normal percpu counter reads are too inaccurate for our purposes and summing the counter is too expensive. Link: https://lkml.kernel.org/r/20210713104519.16394-1-jack@suse.cz Link: https://lkml.kernel.org/r/20210713104716.22868-1-jack@suse.cz Signed-off-by: Jan Kara Cc: Wu Fengguang Cc: Michael Stapelberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eb2169cee36fc492407a2d483c286b977a46288a Author: liuhailong Date: Thu Sep 2 14:53:01 2021 -0700 mm: add kernel_misc_reclaimable in show_free_areas Print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas() so users can check whether the shrinker is working correctly and to show the current memory usage. Link: https://lkml.kernel.org/r/20210813104725.4562-1-liuhailong@oppo.com Signed-off-by: liuhailong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4f3eaf452a14ff3982f71c1ca8bdf757254231fa Author: Matthew Wilcox (Oracle) Date: Thu Sep 2 14:52:58 2021 -0700 mm: report a more useful address for reclaim acquisition A recent lockdep report included these lines: [ 96.177910] 3 locks held by containerd/770: [ 96.177934] #0: ffff88810815ea28 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x115/0x770 [ 96.177999] #1: ffffffff82915020 (rcu_read_lock){....}-{1:2}, at: get_swap_device+0x33/0x140 [ 96.178057] #2: ffffffff82955ba0 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30 While it was not useful to that bug report to know where the reclaim lock had been acquired, it might be useful under other circumstances. Allow the caller of __fs_reclaim_acquire to specify the instruction pointer to use. Link: https://lkml.kernel.org/r/20210719185709.1755149-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Omar Sandoval Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Boqun Feng Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8c5b3a8adad2152d162fc0230c822f907c816be9 Author: Gavin Shan Date: Thu Sep 2 14:52:54 2021 -0700 mm/debug_vm_pgtable: fix corrupted page flag In page table entry modifying tests, set_xxx_at() are used to populate the page table entries. On ARM64, PG_arch_1 (PG_dcache_clean) flag is set to the target page flag if execution permission is given. The logic exits since commit 4f04d8f00545 ("arm64: MMU definitions"). The page flag is kept when the page is free'd to buddy's free area list. However, it will trigger page checking failure when it's pulled from the buddy's free area list, as the following warning messages indicate. BUG: Bad page state in process memhog pfn:08000 page:0000000015c0a628 refcount:0 mapcount:0 \ mapping:0000000000000000 index:0x1 pfn:0x8000 flags: 0x7ffff8000000800(arch_1|node=0|zone=0|lastcpupid=0xfffff) raw: 07ffff8000000800 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set This fixes the issue by clearing PG_arch_1 through flush_dcache_page() after set_xxx_at() is called. For architectures other than ARM64, the unexpected overhead of cache flushing is acceptable. Link: https://lkml.kernel.org/r/20210809092631.1888748-13-gshan@redhat.com Fixes: a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers") Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fda88cfda1ab666ee6c136eeb401b4ead7ecd066 Author: Gavin Shan Date: Thu Sep 2 14:52:51 2021 -0700 mm/debug_vm_pgtable: remove unused code The variables used by old implementation isn't needed as we switched to "struct pgtable_debug_args". Lets remove them and related code in debug_vm_pgtable(). Link: https://lkml.kernel.org/r/20210809092631.1888748-12-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2f87f8c39a91effbbfd88a4642bd245b9c2b7ad3 Author: Gavin Shan Date: Thu Sep 2 14:52:48 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in PGD and P4D modifying tests This uses struct pgtable_debug_args in PGD/P4D modifying tests. No allocated huge page is used in these tests. Besides, the unused variable @saved_p4dp and @saved_pudp are dropped. Link: https://lkml.kernel.org/r/20210809092631.1888748-11-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cbde03bdb0b832503999387f5e86b006fa54674 Author: Gavin Shan Date: Thu Sep 2 14:52:45 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in PUD modifying tests This uses struct pgtable_debug_args in PUD modifying tests. The allocated huge page is used when set_pud_at() is used. The corresponding tests are skipped if the huge page doesn't exist. Besides, the following unused variables in debug_vm_pgtable() are dropped: @prot, @paddr, @pud_aligned. Link: https://lkml.kernel.org/r/20210809092631.1888748-10-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c0fe07b0aa72b530d5da63a24eb10d503cae5a95 Author: Gavin Shan Date: Thu Sep 2 14:52:41 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in PMD modifying tests This uses struct pgtable_debug_args in PMD modifying tests. The allocated huge page is used when set_pmd_at() is used. The corresponding tests are skipped if the huge page doesn't exist. Besides, the unused variable @pmd_aligned in debug_vm_pgtable() is dropped. Link: https://lkml.kernel.org/r/20210809092631.1888748-9-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 44966c4480f8024776c9ecc68f5589f023f19884 Author: Gavin Shan Date: Thu Sep 2 14:52:38 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in PTE modifying tests This uses struct pgtable_debug_args in PTE modifying tests. The allocated page is used as set_pte_at() is used there. The tests are skipped if the allocated page doesn't exist. It's notable that args->ptep need to be mapped before the tests. The reason why we don't map args->ptep at the beginning is PTE entry is only mapped and accessible in atomic context when CONFIG_HIGHPTE is enabled. So we avoid to do that so that atomic context is only enabled if needed. Besides, the unused variable @pte_aligned and @ptep in debug_vm_pgtable() are dropped. Link: https://lkml.kernel.org/r/20210809092631.1888748-8-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4878a888824bd69ad4fff18efa93901ba2ba24f3 Author: Gavin Shan Date: Thu Sep 2 14:52:35 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in migration and thp tests This uses struct pgtable_debug_args in the migration and thp test functions. It's notable that the pre-allocated page is used in swap_migration_tests() as set_pte_at() is used there. Link: https://lkml.kernel.org/r/20210809092631.1888748-7-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5f447e8067fd9f472bc418de219f3cb9a8c3fbe8 Author: Gavin Shan Date: Thu Sep 2 14:52:32 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in soft_dirty and swap tests This uses struct pgtable_debug_args in the soft_dirty and swap test functions. Link: https://lkml.kernel.org/r/20210809092631.1888748-6-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8cb183f2f2a014e818cf60de3afd5a06410fd5b9 Author: Gavin Shan Date: Thu Sep 2 14:52:28 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in protnone and devmap tests This uses struct pgtable_debug_args in protnone and devmap test functions. After that, the unused variable @protnone in debug_vm_pgtable() is dropped. Link: https://lkml.kernel.org/r/20210809092631.1888748-5-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8983d231c7cc1adaebed89153552da1e3fd55f61 Author: Gavin Shan Date: Thu Sep 2 14:52:25 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in leaf and savewrite tests This uses struct pgtable_debug_args in the leaf and savewrite test functions. Link: https://lkml.kernel.org/r/20210809092631.1888748-4-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36b77d1e159283da3c9414cbe6d9cb8e79a59c19 Author: Gavin Shan Date: Thu Sep 2 14:52:22 2021 -0700 mm/debug_vm_pgtable: use struct pgtable_debug_args in basic tests This uses struct pgtable_debug_args in the basic test functions. The unused variables @pgd_aligned and @p4d_aligned in debug_vm_pgtable() are dropped. Link: https://lkml.kernel.org/r/20210809092631.1888748-3-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Chunyu Hu Cc: Qian Cai Cc: Vineet Gupta Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c9b84f044a9e54cf56d1b2c9b80a2d2ce56d70a Author: Gavin Shan Date: Thu Sep 2 14:52:19 2021 -0700 mm/debug_vm_pgtable: introduce struct pgtable_debug_args Patch series "mm/debug_vm_pgtable: Enhancements", v6. There are a couple of issues with current implementations and this series tries to resolve the issues: (a) All needed information are scattered in variables, passed to various test functions. The code is organized in pretty much relaxed fashion. (b) The page isn't allocated from buddy during page table entry modifying tests. The page can be invalid, conflicting to the implementations of set_xxx_at() on ARM64. The target page is accessed so that the iCache can be flushed when execution permission is given on ARM64. Besides, the target page can be unmapped and accessing to it causes kernel crash. "struct pgtable_debug_args" is introduced to address issue (a). For issue (b), the used page is allocated from buddy in page table entry modifying tests. The corresponding tets will be skipped if we fail to allocate the (huge) page. For other test cases, the original page around to kernel symbol (@start_kernel) is still used. The patches are organized as below. PATCH[2-10] could be combined to one patch, but it will make the review harder: PATCH[1] introduces "struct pgtable_debug_args" as place holder of all needed information. With it, the old and new implementation can coexist. PATCH[2-10] uses "struct pgtable_debug_args" in various test functions. PATCH[11] removes the unused code for old implementation. PATCH[12] fixes the issue of corrupted page flag for ARM64 This patch (of 6): In debug_vm_pgtable(), there are many local variables introduced to track the needed information and they are passed to the functions for various test cases. It'd better to introduce a struct as place holder for these information. With it, what the tests functions need is the struct. In this way, the code is simplified and easier to be maintained. Besides, set_xxx_at() could access the data on the corresponding pages in the page table modifying tests. So the accessed pages in the tests should have been allocated from buddy. Otherwise, we're accessing pages that aren't owned by us. This causes issues like page flag corruption or kernel crash on accessing unmapped page when CONFIG_DEBUG_PAGEALLOC is enabled. This introduces "struct pgtable_debug_args". The struct is initialized and destroyed, but the information in the struct isn't used yet. It will be used in subsequent patches. Link: https://lkml.kernel.org/r/20210809092631.1888748-1-gshan@redhat.com Link: https://lkml.kernel.org/r/20210809092631.1888748-2-gshan@redhat.com Signed-off-by: Gavin Shan Reviewed-by: Anshuman Khandual Tested-by: Christophe Leroy [powerpc 8xx] Tested-by: Gerald Schaefer [s390] Cc: Anshuman Khandual Cc: Aneesh Kumar K.V Cc: Qian Cai Cc: Catalin Marinas Cc: Will Deacon Cc: Vineet Gupta Cc: Chunyu Hu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4bdffd2708d65e68ff254d90793bb167d828219f Author: kernel test robot Date: Thu Sep 2 14:50:20 2021 -0700 arch/csky/kernel/probes/kprobes.c: fix bugon.cocci warnings Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Link: https://lkml.kernel.org/r/alpine.DEB.2.22.394.2107061049150.7197@hadrien Fixes: 7d37cb2c912d ("lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS") Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Reported-by: kernel test robot Cc: Julian Braha Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9673e0050c39b0534d0e2ca431223f52089f4959 Author: Gang He Date: Thu Sep 2 14:50:17 2021 -0700 ocfs2: ocfs2_downconvert_lock failure results in deadlock Usually, ocfs2_downconvert_lock() function always downconverts dlm lock to the expected level for satisfy dlm bast requests from the other nodes. But there is a rare situation. When dlm lock conversion is being canceled, ocfs2_downconvert_lock() function will return -EBUSY. You need to be aware that ocfs2_cancel_convert() function is asynchronous in fsdlm implementation. If we does not requeue this lockres entry, ocfs2 downconvert thread no longer handles this dlm lock bast request. Then, the other nodes will not get the dlm lock again, the current node's process will be blocked when acquire this dlm lock again. Link: https://lkml.kernel.org/r/20210830044621.12544-1-ghe@suse.com Signed-off-by: Gang He 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 Signed-off-by: Linus Torvalds commit 6c85c2c728193d19d6a908ae9fb312d0325e65ca Author: Tuo Li Date: Thu Sep 2 14:50:14 2021 -0700 ocfs2: quota_local: fix possible uninitialized-variable access in ocfs2_local_read_info() A memory block is allocated through kmalloc(), and its return value is assigned to the pointer oinfo. However, oinfo->dqi_gqinode is not initialized but it is accessed in: iput(oinfo->dqi_gqinode); To fix this possible uninitialized-variable access, assign NULL to oinfo->dqi_gqinode, and add ocfs2_qinfo_lock_res_init() behind the assignment in ocfs2_local_read_info(). Remove ocfs2_qinfo_lock_res_init() in ocfs2_global_read_info(). Link: https://lkml.kernel.org/r/20210804031832.57154-1-islituo@gmail.com Signed-off-by: Tuo Li Reported-by: TOTE Robot 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 Signed-off-by: Linus Torvalds commit 2f566394467c86c3c89022013a99aa2d9d4a0208 Author: Dan Carpenter Date: Thu Sep 2 14:50:11 2021 -0700 ocfs2: remove an unnecessary condition The case where "tmp_oh" is NULL is handled at the start of the function. At this point we know it's non-NULL so this will always return 1. Link: https://lkml.kernel.org/r/YOcItgIXtisi3MaO@mwanda Signed-off-by: Dan Carpenter Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Larry Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e4265c88968d4e53b164944c05e12e79d8ff9c6 Author: Geert Uytterhoeven Date: Thu Sep 2 14:50:08 2021 -0700 ia64: make num_rsvd_regions static Commit f62800992e5917f2 ("ia64: switch to NO_BOOTMEM") removed the last user of num_rsvd_regions outside arch/ia64/kernel/setup.c. Link: https://lkml.kernel.org/r/a377b5437e3e9da93d02f996fe06a2b956cb0990.1629884459.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Frank Rowand Cc: Jay Lan Cc: Magnus Damm Cc: Mike Rapoport Cc: Rob Herring Cc: Simon Horman Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70b2e9912a018e9fddb3a1e0cbb397d4d3c0e98f Author: Geert Uytterhoeven Date: Thu Sep 2 14:50:04 2021 -0700 ia64: make reserve_elfcorehdr() static There never was a reason for reserve_elfcorehdr() to be global. Make the function static, and move it before its sole caller. Link: https://lkml.kernel.org/r/fe236cd73b64abc4abd03dd808cb015c907f4c8c.1629884459.git.geert+renesas@glider.be Fixes: cee87af2a5f75713 ("[IA64] kexec: Use EFI_LOADER_DATA for ELF core header") Signed-off-by: Geert Uytterhoeven Cc: Frank Rowand Cc: Jay Lan Cc: Magnus Damm Cc: Mike Rapoport Cc: Rob Herring Cc: Simon Horman Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1d1f4bf845d36d73b27ed37790cae0da3112ca77 Author: Geert Uytterhoeven Date: Thu Sep 2 14:50:01 2021 -0700 ia64: fix #endif comment for reserve_elfcorehdr() Patch series "ia64: Miscellaneous fixes and cleanups". This patch series contains some miscellaneous fixes and cleanups for ia64. The second patch fixes a naming conflict triggered by a patch for the FDT code. This patch (of 3): The definition of reserve_elfcorehdr() depends on CONFIG_CRASH_DUMP, not CONFIG_PROC_VMCORE. Link: https://lkml.kernel.org/r/cover.1629884459.git.geert+renesas@glider.be Link: https://lkml.kernel.org/r/77b4c0648f200cab7e1c2c5171c06763e09362aa.1629884459.git.geert+renesas@glider.be Fixes: d9a9855d0b06ca6d ("always reserve elfcore header memory in crash kernel") Fixes: 17c1f07ed70afa4f ("[IA64] Reserve elfcorehdr memory in CONFIG_CRASH_DUMP") Signed-off-by: Geert Uytterhoeven Cc: Simon Horman Cc: Tony Luck Cc: Jay Lan Cc: Magnus Damm Cc: Mike Rapoport Cc: Rob Herring Cc: Frank Rowand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 577706de69c1e53bc23893953770d829a2242c38 Author: Jason Wang Date: Thu Sep 2 14:49:58 2021 -0700 ia64: fix typo in a comment s/when when/when/ Link: https://lkml.kernel.org/r/20210817112500.12848-1-wangborong@cdjrlc.com Signed-off-by: Jason Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 592ca09be8333bd226f50100328a905bfc377133 Author: David Hildenbrand Date: Fri Apr 23 09:45:45 2021 +0200 fs: update documentation of get_write_access() and friends As VM_DENYWRITE does no longer exists, let's spring-clean the documentation of get_write_access() and friends. Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 6128b3af2a5e42386aa7faf37609b57f39fb7d00 Author: David Hildenbrand Date: Fri Apr 23 09:38:14 2021 +0200 mm: ignore MAP_DENYWRITE in ksys_mmap_pgoff() Let's also remove masking off MAP_DENYWRITE from ksys_mmap_pgoff(): the last in-tree occurrence of MAP_DENYWRITE is now in LEGACY_MAP_MASK, which accepts the flag e.g., for MAP_SHARED_VALIDATE; however, the flag is ignored throughout the kernel now. Add a comment to LEGACY_MAP_MASK stating that MAP_DENYWRITE is ignored. Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 8d0920bde5eb8ec7e567939b85e65a0596c8580d Author: David Hildenbrand Date: Thu Apr 22 12:08:20 2021 +0200 mm: remove VM_DENYWRITE All in-tree users of MAP_DENYWRITE are gone. MAP_DENYWRITE cannot be set from user space, so all users are gone; let's remove it. Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 4589ff7ca81516381393649dec8dd4948884b2b2 Author: David Hildenbrand Date: Fri Apr 23 09:42:41 2021 +0200 binfmt: remove in-tree usage of MAP_DENYWRITE At exec time when we mmap the new executable via MAP_DENYWRITE we have it opened via do_open_execat() and already deny_write_access()'ed the file successfully. Once exec completes, we allow_write_acces(); however, we set mm->exe_file in begin_new_exec() via set_mm_exe_file() and also deny_write_access() as long as mm->exe_file remains set. We'll effectively deny write access to our executable via mm->exe_file until mm->exe_file is changed -- when the process is removed, on new exec, or via sys_prctl(PR_SET_MM_MAP/EXE_FILE). Let's remove all usage of MAP_DENYWRITE, it's no longer necessary for mm->exe_file. In case of an elf interpreter, we'll now only deny write access to the file during exec. This is somewhat okay, because the interpreter behaves (and sometime is) a shared library; all shared libraries, especially the ones loaded directly in user space like via dlopen() won't ever be mapped via MAP_DENYWRITE, because we ignore that from user space completely; these shared libraries can always be modified while mapped and executed. Let's only special-case the main executable, denying write access while being executed by a process. This can be considered a minor user space visible change. While this is a cleanup, it also fixes part of a problem reported with VM_DENYWRITE on overlayfs, as VM_DENYWRITE is effectively unused with this patch and will be removed next: "Overlayfs did not honor positive i_writecount on realfile for VM_DENYWRITE mappings." [1] [1] https://lore.kernel.org/r/YNHXzBgzRrZu1MrD@miu.piliscsaba.redhat.com/ Reported-by: Chengguang Xu Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit fe69d560b5bd9ec77b5d5749bd7027344daef47e Author: David Hildenbrand Date: Fri Apr 23 10:29:59 2021 +0200 kernel/fork: always deny write access to current MM exe_file We want to remove VM_DENYWRITE only currently only used when mapping the executable during exec. During exec, we already deny_write_access() the executable, however, after exec completes the VMAs mapped with VM_DENYWRITE effectively keeps write access denied via deny_write_access(). Let's deny write access when setting or replacing the MM exe_file. With this change, we can remove VM_DENYWRITE for mapping executables. Make set_mm_exe_file() return an error in case deny_write_access() fails; note that this should never happen, because exec code does a deny_write_access() early and keeps write access denied when calling set_mm_exe_file. However, it makes the code easier to read and makes set_mm_exe_file() and replace_mm_exe_file() look more similar. This represents a minor user space visible change: sys_prctl(PR_SET_MM_MAP/EXE_FILE) can now fail if the file is already opened writable. Also, after sys_prctl(PR_SET_MM_MAP/EXE_FILE) the file cannot be opened writable. Note that we can already fail with -EACCES if the file doesn't have execute permissions. Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 35d7bdc86031a2c1ae05ac27dfa93b2acdcbaecc Author: David Hildenbrand Date: Fri Apr 23 10:20:25 2021 +0200 kernel/fork: factor out replacing the current MM exe_file Let's factor the main logic out into replace_mm_exe_file(), such that all mm->exe_file logic is contained in kernel/fork.c. While at it, perform some simple cleanups that are possible now that we're simplifying the individual functions. Acked-by: Christian Brauner Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 42be8b42535183f84df99acbaf799e38724348f3 Author: David Hildenbrand Date: Thu Apr 22 12:53:00 2021 +0200 binfmt: don't use MAP_DENYWRITE when loading shared libraries via uselib() uselib() is the legacy systemcall for loading shared libraries. Nowadays, applications use dlopen() to load shared libraries, completely implemented in user space via mmap(). For example, glibc uses MAP_COPY to mmap shared libraries. While this maps to MAP_PRIVATE | MAP_DENYWRITE on Linux, Linux ignores any MAP_DENYWRITE specification from user space in mmap. With this change, all remaining in-tree users of MAP_DENYWRITE use it to map an executable. We will be able to open shared libraries loaded via uselib() writable, just as we already can via dlopen() from user space. This is one step into the direction of removing MAP_DENYWRITE from the kernel. This can be considered a minor user space visible change. Acked-by: "Eric W. Biederman" Acked-by: Christian König Signed-off-by: David Hildenbrand commit 730affed24bffcd1eebd5903171960f5ff9f1f22 Author: Benjamin Hesmans Date: Fri Sep 3 15:23:35 2021 +0200 netfilter: socket: icmp6: fix use-after-scope Bug reported by KASAN: BUG: KASAN: use-after-scope in inet6_ehashfn (net/ipv6/inet6_hashtables.c:40) Call Trace: (...) inet6_ehashfn (net/ipv6/inet6_hashtables.c:40) (...) nf_sk_lookup_slow_v6 (net/ipv6/netfilter/nf_socket_ipv6.c:91 net/ipv6/netfilter/nf_socket_ipv6.c:146) It seems that this bug has already been fixed by Eric Dumazet in the past in: commit 78296c97ca1f ("netfilter: xt_socket: fix a stack corruption bug") But a variant of the same issue has been introduced in commit d64d80a2cde9 ("netfilter: x_tables: don't extract flow keys on early demuxed sks in socket match") `daddr` and `saddr` potentially hold a reference to ipv6_var that is no longer in scope when the call to `nf_socket_get_sock_v6` is made. Fixes: d64d80a2cde9 ("netfilter: x_tables: don't extract flow keys on early demuxed sks in socket match") Acked-by: Matthieu Baerts Signed-off-by: Benjamin Hesmans Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8b7084b848cd9d7071ed9e253e1c600a25f72ddd Merge: a9c9a6f741cda 799206c1302e8 Author: Konrad Rzeszutek Wilk Date: Fri Sep 3 11:57:31 2021 -0400 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft into HEAD * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft: iscsi_ibft: Fix isa_bus_to_virt not working under ARM commit fcb958ee8e832e9cdf43408535207e15f14af755 Author: Sugar Zhang Date: Fri Sep 3 21:07:14 2021 +0800 ASoC: rockchip: i2s: Fix concurrency between tx/rx This patch adds lock to fix comcurrency between tx/rx to fix 'rockchip-i2s ff070000.i2s; fail to clear' Considering the situation; tx stream rx stream | | | disable enable | | reset After this patch: lock | tx stream | enable | unlock -------- --------- lock | rx stream | disable | reset | unlock Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1630674434-650-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 31efe48eb5dc4de3e31e84b54f287e9665410ab3 Author: Xiaoguang Wang Date: Fri Sep 3 22:24:36 2021 +0800 io_uring: fix possible poll event lost in multi shot mode IIUC, IORING_POLL_ADD_MULTI is similar to epoll's edge-triggered mode, that means once one pure poll request returns one event(cqe), we'll need to read or write continually until EAGAIN is returned, then I think there is a possible poll event lost race in multi shot mode: t1 poll request add | | t2 | | t3 event happens | | t4 task work add | | t5 | task work run | t6 | commit one cqe | t7 | | user app handles cqe t8 | new event happen | t9 | add back to waitqueue | t10 | After t6 but before t9, if new event happens, there'll be no wakeup operation, and if user app has picked up this cqe in t7, read or write until EAGAIN is returned. In t8, new event happens and will be lost, though this race window maybe small. To fix this possible race, add poll request back to waitqueue before committing cqe. Fixes: 88e41cf928a6 ("io_uring: add multishot mode for IORING_OP_POLL_ADD") Signed-off-by: Xiaoguang Wang Link: https://lore.kernel.org/r/20210903142436.5767-1-xiaoguang.wang@linux.alibaba.com Signed-off-by: Jens Axboe commit 7a8526a5cd51cf5f070310c6c37dd7293334ac49 Author: Kate Hsuan Date: Fri Sep 3 17:44:11 2021 +0800 libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD. Many users are reporting that the Samsung 860 and 870 SSD are having various issues when combined with AMD/ATI (vendor ID 0x1002) SATA controllers and only completely disabling NCQ helps to avoid these issues. Always disabling NCQ for Samsung 860/870 SSDs regardless of the host SATA adapter vendor will cause I/O performance degradation with well behaved adapters. To limit the performance impact to ATI adapters, introduce the ATA_HORKAGE_NO_NCQ_ON_ATI flag to force disable NCQ only for these adapters. Also, two libata.force parameters (noncqati and ncqati) are introduced to disable and enable the NCQ for the system which equipped with ATI SATA adapter and Samsung 860 and 870 SSDs. The user can determine NCQ function to be enabled or disabled according to the demand. After verifying the chipset from the user reports, the issue appears on AMD/ATI SB7x0/SB8x0/SB9x0 SATA Controllers and does not appear on recent AMD SATA adapters. The vendor ID of ATI should be 0x1002. Therefore, ATA_HORKAGE_NO_NCQ_ON_AMD was modified to ATA_HORKAGE_NO_NCQ_ON_ATI. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=201693 Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20210903094411.58749-1-hpa@redhat.com Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit 8a6430ab9c9c87cb64c512e505e8690bbaee190b Author: Hans de Goede Date: Mon Aug 23 11:52:20 2021 +0200 libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs Commit ca6bfcb2f6d9 ("libata: Enable queued TRIM for Samsung SSD 860") limited the existing ATA_HORKAGE_NO_NCQ_TRIM quirk from "Samsung SSD 8*", covering all Samsung 800 series SSDs, to only apply to "Samsung SSD 840*" and "Samsung SSD 850*" series based on information from Samsung. But there is a large number of users which is still reporting issues with the Samsung 860 and 870 SSDs combined with Intel, ASmedia or Marvell SATA controllers and all reporters also report these problems going away when disabling queued trims. Note that with AMD SATA controllers users are reporting even worse issues and only completely disabling NCQ helps there, this will be addressed in a separate patch. Fixes: ca6bfcb2f6d9 ("libata: Enable queued TRIM for Samsung SSD 860") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=203475 Cc: stable@vger.kernel.org Cc: Kate Hsuan Signed-off-by: Hans de Goede Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210823095220.30157-1-hdegoede@redhat.com Signed-off-by: Jens Axboe commit 0ef47db1cb64a9a226e8983e8b2691f8e1c02a37 Author: Jens Axboe Date: Fri Sep 3 07:42:13 2021 -0600 bio: fix kerneldoc documentation for bio_alloc_kiocb() Apparently the last fixup got butter fingered a bit, the correct variable name is 'nr_vecs', not 'nr_iovecs'. Link: https://lore.kernel.org/lkml/20210903164939.02f6e8c5@canb.auug.org.au/ Reported-by: Stephen Rothwell Signed-off-by: Jens Axboe commit a3314262eede9c909a0c797f16f25f941d12c78d Merge: e432fe97f3e5d 787c70f2f9990 Author: Michael Ellerman Date: Fri Sep 3 22:54:12 2021 +1000 Merge branch 'fixes' into next Merge our fixes branch into next. That lets us resolve a conflict in arch/powerpc/sysdev/xive/common.c. Between cbc06f051c52 ("powerpc/xive: Do not skip CPU-less nodes when creating the IPIs"), which moved request_irq() out of xive_init_ipis(), and 17df41fec5b8 ("powerpc: use IRQF_NO_DEBUG for IPIs") which added IRQF_NO_DEBUG to that request_irq() call, which has now moved. commit 9756e44fd4d283ebcc94df353642f322428b73de Author: 王贇 Date: Fri Sep 3 10:27:18 2021 +0800 net: remove the unnecessary check in cipso_v4_doi_free The commit 733c99ee8be9 ("net: fix NULL pointer reference in cipso_v4_doi_free") was merged by a mistake, this patch try to cleanup the mess. And we already have the commit e842cb60e8ac ("net: fix NULL pointer reference in cipso_v4_doi_free") which fixed the root cause of the issue mentioned in it's description. Suggested-by: Paul Moore Signed-off-by: Michael Wang Signed-off-by: David S. Miller commit ddd0d5293810c1882e2a96f8cce1678823b1dd38 Author: Nikolay Aleksandrov Date: Fri Sep 3 12:34:15 2021 +0300 net: bridge: mcast: fix vlan port router deadlock Before vlan/port mcast router support was added br_multicast_set_port_router was used only with bh already disabled due to the bridge port lock, but that is no longer the case and when it is called to configure a vlan/port mcast router we can deadlock with the timer, so always disable bh to make sure it can be called from contexts with both enabled and disabled bh. Fixes: 2796d846d74a ("net: bridge: vlan: convert mcast router global option to per-vlan entry") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f1181e39d6ac13c0879b3766138aaa384fe62a55 Author: Arnd Bergmann Date: Fri Sep 3 12:29:07 2021 +0000 net: cs89x0: disable compile testing on powerpc The ISA DMA API is inconsistent between architectures, and while powerpc implements most of what the others have, it does not provide isa_virt_to_bus(): ../drivers/net/ethernet/cirrus/cs89x0.c: In function ‘net_open’: ../drivers/net/ethernet/cirrus/cs89x0.c:897:20: error: implicit declaration of function ‘isa_virt_to_bus’ [-Werror=implicit-function-declaration] (unsigned long)isa_virt_to_bus(lp->dma_buff)); ../drivers/net/ethernet/cirrus/cs89x0.c:894:3: note: in expansion of macro ‘cs89_dbg’ cs89_dbg(1, debug, "%s: dma %lx %lx\n", I tried a couple of approaches to handle this consistently across all architectures, but as this driver is really only used on ARM, I ended up taking the easy way out and just disable compile testing on powerpc. Reported-by: Guenter Roeck Reported-by: Stephen Rothwell Reported-by: Reported-by: kernel test robot Fixes: 47fd22f2b847 ("cs89x0: rework driver configuration") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 8d17a33b076d24aa4861f336a125c888fb918605 Author: Carlo Lobrano Date: Fri Sep 3 14:09:53 2021 +0200 net: usb: qmi_wwan: add Telit 0x1060 composition This patch adds support for Telit LN920 0x1060 composition 0x1060: tty, adb, rmnet, tty, tty, tty, tty Signed-off-by: Carlo Lobrano Signed-off-by: David S. Miller commit 5457773ef99f25fcc4b238ac76b68e28273250f4 Author: Tobias Schramm Date: Fri Aug 27 07:03:57 2021 +0200 spi: rockchip: handle zero length transfers without timing out Previously zero length transfers submitted to the Rokchip SPI driver would time out in the SPI layer. This happens because the SPI peripheral does not trigger a transfer completion interrupt for zero length transfers. Fix that by completing zero length transfers immediately at start of transfer. Signed-off-by: Tobias Schramm Link: https://lore.kernel.org/r/20210827050357.165409-1-t.schramm@manjaro.org Signed-off-by: Mark Brown commit 7eac1e24fbf6c56c9e3be302748ae73104bb40bd Author: Trevor Wu Date: Fri Sep 3 14:00:49 2021 +0800 ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX According to the description in dt-bindings, phandle assignment of HDMI TX and DP TX are not required properties, but driver regards them as required properties. In real use case, it's expected that DP TX and HDMI TX are optional features, so correct the behavior in driver. Fixes: 40d605df0a7b ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682") Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210903060049.20764-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit b3dded7e2f98e2672deb9606514c0e13e3094640 Author: Nathan Chancellor Date: Thu Sep 2 11:12:18 2021 -0700 ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select When CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH is enabled without CONFIG_EXPERT, there is a Kconfig warning about unmet dependencies: WARNING: unmet direct dependencies detected for SND_SOC_SDW_MOCKUP Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && EXPERT [=n] && SOUNDWIRE [=y] Selected by [y]: - SND_SOC_INTEL_SOUNDWIRE_SOF_MACH [=y] && ... Selecting a symbol does not account for dependencies. There are three ways to resolve this: 1. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select CONFIG_SND_SOC_SDW_MOCKUP only if CONFIG_EXPERT is set. 2. Make CONFIG_SND_SOC_SDW_MOCKUP's prompt depend on CONFIG_EXPERT so that it can be selected by options that only depend on CONFIG_SOUNDWIRE but still appear as a prompt to the user when CONFIG_EXPERT is set. 3. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH imply CONFIG_SND_SOC_SDW_MOCKUP, which will select CONFIG_SND_SOC_SDW_MOCKUP when its dependencies are enabled but still allow the user to disable it. Go with the third option as it gives the most flexibility while retaining the original intent of the select. Fixes: 0ccac3bcf356 ("ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests") Suggested-by: Pierre-Louis Bossart Acked-by: Pierre-Louis Bossart Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210902181217.2958966-1-nathan@kernel.org Signed-off-by: Mark Brown commit 8d4ad41e3e8e4b907f088f25aee4a92f3f864027 Author: Pavel Begunkov Date: Thu Sep 2 00:38:23 2021 +0100 io_uring: prolong tctx_task_work() with flushing io_submit_flush_completions() may enqueue linked requests for task_work execution, so don't leave tctx_task_work() right after the tw list is exhausted, but try to flush and then retry. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0755d4c2c36301447c63bdd4146c10477cea4249.1630539342.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 636378535afb837f165beb7de3907896480cf3b2 Author: Pavel Begunkov Date: Thu Sep 2 00:38:22 2021 +0100 io_uring: don't disable kiocb_done() CQE batching Not passing issue_flags from kiocb_done() into __io_complete_rw() means that completion batching for this case is disabled, e.g. for most of buffered reads. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b2689462835c3ee28a5999ef4f9a581e24be04a2.1630539342.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit fa84693b3c896460831fe0750554121121a23da8 Author: Jens Axboe Date: Wed Sep 1 14:15:59 2021 -0600 io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL SQPOLL has a different thread doing submissions, we need to check for that and use the right task context when updating the worker values. Just hold the sqd->lock across the operation, this ensures that the thread cannot go away while we poke at ->io_uring. Link: https://github.com/axboe/liburing/issues/420 Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers") Reported-by: Johannes Lundberg Tested-by: Johannes Lundberg Signed-off-by: Jens Axboe commit c7a3828d98db2730079265b5f51933dfcef8bb5f Author: Jin Yao Date: Thu Sep 2 14:59:55 2021 +0800 perf tests: Add test for PMU aliases A perf uncore PMU may have two PMU names, a real name and an alias. Add one test case to verify that the real and alias names have the same effect. Iterate sysfs to get one event which has an alias and create an evlist by adding two evsels. Evsel1 is created by event and evsel2 is created by alias. Test asserts: evsel1->core.attr.type == evsel2->core.attr.type evsel1->core.attr.config == evsel2->core.attr.config Signed-off-by: Jin Yao Reviewed-by: Andi Kleen Cc: Alexander Shishkin Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Peter Zijlstra Cc: Riccardo Mancini Link: http://lore.kernel.org/lkml/20210902065955.1299-3-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 13d60ba0738b0532edab3e1492b2005d36ba0802 Author: Kan Liang Date: Thu Sep 2 14:59:54 2021 +0800 perf pmu: Add PMU alias support A perf uncore PMU may have two PMU names, a real name and an alias. The alias is exported at /sys/bus/event_source/devices/uncore_*/alias. The perf tool should support the alias as well. Add alias_name in the struct perf_pmu to store the alias. For the PMU which doesn't have an alias. It's NULL. Introduce two X86 specific functions to retrieve the real name and the alias separately. Only go through the sysfs to retrieve the mapping between the real name and the alias once. The result is cached in a list, uncore_pmu_list. Nothing changed for the other ARCHs. With the patch, the perf tool can monitor the PMU with either the real name or the alias. Use the real name, $ perf stat -e uncore_cha_2/event=1/ -x, 4044879584,,uncore_cha_2/event=1/,2528059205,100.00,, Use the alias, $ perf stat -e uncore_type_0_2/event=1/ -x, 3659675336,,uncore_type_0_2/event=1/,2287306455,100.00,, Committer notes: Rename 'struct perf_pmu_alias_name' to 'pmu_alias', the 'perf_' prefix should be used for libperf, things inside just tools/perf/ are being moved away from that prefix. Also 'pmu_alias' is shorter and reflects the abstraction. Also don't use 'pmu' as the name for variables for that type, we should use that for the 'struct perf_pmu' variables, avoiding confusion. Use 'pmu_alias' for 'struct pmu_alias' variables. Co-developed-by: Jin Yao Co-developed-by: Arnaldo Carvalho de Melo Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Peter Zijlstra Cc: Riccardo Mancini Link: http://lore.kernel.org/lkml/20210902065955.1299-2-yao.jin@linux.intel.com Signed-off-by: Jin Yao Signed-off-by: Arnaldo Carvalho de Melo commit bf0df73a2f0d1674bcc930ddff0de0544e512b6e Author: Colin Ian King Date: Thu Sep 2 15:35:05 2021 +0100 seg6_iptunnel: Remove redundant initialization of variable err The variable err is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit c68b421d8ebe15b509144a6ec5a08ff7089a7dd5 Author: Suzuki K Poulose Date: Wed Jul 28 10:12:19 2021 +0100 perf session: Report collisions in AUX records Just like the other flags in the AUX records, report a summary of the Collisions if there were any. Signed-off-by: Suzuki Poulouse Reviewed-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org LPU-Reference: 20210728091219.527886-1-suzuki.poulose@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 538d9c1829eddf375436c52604f82ff3f53c6690 Author: Stephen Brennan Date: Wed Sep 1 14:08:15 2021 -0700 perf script python: Allow reporting the [un]throttle PERF_RECORD_ meta event perf_events may sometimes throttle an event due to creating too many samples during a given timer tick. As of now, the perf tool will not report on throttling, which means this is a silent error. Implement a callback for the throttle and unthrottle events within the Python scripting engine, which can allow scripts to detect and report when events may have been lost due to throttling. The simplest script to report throttle events is: def throttle(*args): print("throttle" + repr(args)) def unthrottle(*args): print("unthrottle" + repr(args)) Signed-off-by: Stephen Brennan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210901210815.133251-1-stephen.s.brennan@oracle.com Signed-off-by: Arnaldo Carvalho de Melo commit 71f7f897c309bcddc9c07505cd1a6442176f72cb Author: Leo Yan Date: Thu Sep 2 16:18:00 2021 +0800 perf build: Report failure for testing feature libopencsd When build perf tool with passing option 'CORESIGHT=1' explicitly, if the feature test fails for library libopencsd, the build doesn't complain the feature failure and continue to build the tool with disabling the CoreSight feature insteadly. This patch changes the building behaviour, when build perf tool with the option 'CORESIGHT=1' and detect the failure for testing feature libopencsd, the build process will be aborted and it shows the complaint info. Committer testing: First make sure there is no opencsd library installed: $ rpm -qa | grep -i csd $ sudo rm -rf `find /usr/local -name "*csd*"` $ find /usr/local -name "*csd*" $ Then cleanup the perf build output directory: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; $ And try to build explicitely asking for coresight: $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j24' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. Stop. make[1]: *** [Makefile.perf:238: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/var/home/acme/git/perf/tools/perf' $ Now install the opencsd library present in Fedora 34: $ sudo dnf install opencsd-devel Installed: opencsd-1.0.0-1.fc34.x86_64 opencsd-devel-1.0.0-1.fc34.x86_64 Complete! $ Try again building with coresight: $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j24' parallel build Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. Stop. make[1]: *** [Makefile.perf:238: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/var/home/acme/git/perf/tools/perf' $ Since Fedora 34 is pretty recent, one assumes we need to get it from its upstream git repository, use rpm to find where that is: $ rpm -q --qf "%{URL}\n" opencsd https://github.com/Linaro/OpenCSD $ Go there, clone the repo, build it and install into /usr/local, then try again: $ cd ~acme/git/perf $ make O=/tmp/build/perf VF=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin | grep -i opencsd ... libopencsd: [ on ] PERF_VERSION = 5.14.g454719f67a3d $ export LD_LIBRARY_PATH=/usr/local/lib $ ldd ~/bin/perf | grep opencsd libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007f28f78a4000) libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007f28f6a2e000) $ Now it works. Requested-by: Arnaldo Carvalho de Melo Signed-off-by: Leo Yan Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20210902081800.550016-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit a80aea64aa07361a57f2245a0695878f2ae67ee7 Author: James Clark Date: Fri Aug 6 14:41:09 2021 +0100 perf cs-etm: Show a warning for an unknown magic number Currently perf reports "Cannot allocate memory" which isn't very helpful for a potentially user facing issue. If we add a new magic number in the future, perf will be able to report unrecognised magic numbers. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-10-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 56c62f52b6f25802a2154243b6dacdc6ff4f75bd Author: James Clark Date: Fri Aug 6 14:41:08 2021 +0100 perf cs-etm: Print the decoder name Use the real name of the decoder instead of hard-coding "ETM" to avoid confusion when the trace is ETE. This also now distinguishes between ETMv3 and ETMv4. Reviewed-by: Leo Yan Reviewed-by: Suzuki Poulouse Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-9-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 779f414a4849fb3e650cad8525c84e76fdd3c0ea Author: James Clark Date: Fri Aug 6 14:41:07 2021 +0100 perf cs-etm: Create ETE decoder If the magic number indicates ETE instantiate a OCSD_BUILTIN_DCD_ETE decoder instead of OCSD_BUILTIN_DCD_ETMV4I. ETE is the new trace feature for Armv9. Testing performed ================= * Old files with v0 and v1 headers for ETMv4 still open correctly * New files with new magic number open on new versions of perf * New files with new magic number fail to open on old versions of perf * Decoding with the ETE decoder results in the same output as the ETMv4 decoder as long as there are no new ETE packet types Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-8-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 212095f7ca4a5182487ae12b62a8616ed87d617e Author: James Clark Date: Fri Aug 6 14:41:06 2021 +0100 perf cs-etm: Update OpenCSD decoder for ETE OpenCSD v1.1.1 has a bug fix for the installation of the ETE decoder headers. This also means that including headers separately for each decoder is unnecessary so remove these. Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-7-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 050a0fc4edc75a97b4dba7b834fd6bf243bf06ed Author: James Clark Date: Fri Aug 6 14:41:05 2021 +0100 perf cs-etm: Fix typo TRCIRD2 should be TRCIDR2 Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-6-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 51ba8811318ac9a8f800c1d446af3f1ce81ec911 Author: James Clark Date: Fri Aug 6 14:41:04 2021 +0100 perf cs-etm: Save TRCDEVARCH register When ETE is present save the TRCDEVARCH register and set a new magic number. It will be used to configure the decoder in a later commit. Old versions of perf will not be able to open files with this new magic number, but old files will still work with newer versions of perf. Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-5-james.clark@arm.com [ Addressed some cosmetic suggestions by Suzuki Poulouse ] Signed-off-by: Arnaldo Carvalho de Melo commit c9ccc96bf6f28d83ef497ee985b8f6ffd493de2a Author: James Clark Date: Fri Aug 6 14:41:03 2021 +0100 perf cs-etm: Refactor out ETMv4 header saving Extract a function for saving the ETMv4 header because this will be used for ETE in a later commit. Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f4aef1ea2663ac7efddd796970678911e56ea1f7 Author: James Clark Date: Fri Aug 6 14:41:02 2021 +0100 perf cs-etm: Initialise architecture based on TRCIDR1 Currently the architecture is hard coded as ARCH_V8, but from ETMv4.4 onwards this should be ARCH_AA64. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 991f69e9e0bb33e4917485bead62b51f0afefac0 Author: James Clark Date: Fri Aug 6 14:41:01 2021 +0100 perf cs-etm: Refactor initialisation of decoder params. The initialisation of the decoder params is duplicated between creation of the packet printer and packet decoder. Put them both into one function so that future changes only need to be made in one place. Reviewed-by: Leo Yan Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210806134109.1182235-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f1940d4e9cbe6208e7e77e433c587af108152a17 Author: Vitaly Kuznetsov Date: Tue Aug 31 16:39:16 2021 +0200 Drivers: hv: vmbus: Fix kernel crash upon unbinding a device from uio_hv_generic driver The following crash happens when a never-used device is unbound from uio_hv_generic driver: kernel BUG at mm/slub.c:321! invalid opcode: 0000 [#1] SMP PTI CPU: 0 PID: 4001 Comm: bash Kdump: loaded Tainted: G X --------- --- 5.14.0-0.rc2.23.el9.x86_64 #1 Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090008 12/07/2018 RIP: 0010:__slab_free+0x1d5/0x3d0 ... Call Trace: ? pick_next_task_fair+0x18e/0x3b0 ? __cond_resched+0x16/0x40 ? vunmap_pmd_range.isra.0+0x154/0x1c0 ? __vunmap+0x22d/0x290 ? hv_ringbuffer_cleanup+0x36/0x40 [hv_vmbus] kfree+0x331/0x380 ? hv_uio_remove+0x43/0x60 [uio_hv_generic] hv_ringbuffer_cleanup+0x36/0x40 [hv_vmbus] vmbus_free_ring+0x21/0x60 [hv_vmbus] hv_uio_remove+0x4f/0x60 [uio_hv_generic] vmbus_remove+0x23/0x30 [hv_vmbus] __device_release_driver+0x17a/0x230 device_driver_detach+0x3c/0xa0 unbind_store+0x113/0x130 ... The problem appears to be that we free 'ring_info->pkt_buffer' twice: first, when the device is unbound from in-kernel driver (netvsc in this case) and second from hv_uio_remove(). Normally, ring buffer is supposed to be re-initialized from hv_uio_open() but this happens when UIO device is being opened and this is not guaranteed to happen. Generally, it is OK to call hv_ringbuffer_cleanup() twice for the same channel (which is being handed over between in-kernel drivers and UIO) even if we didn't call hv_ringbuffer_init() in between. We, however, need to avoid kfree() call for an already freed pointer. Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andrea Parri Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20210831143916.144983-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit 743902c5446190d9293672e717a6933dffabcb24 Author: Colin Ian King Date: Fri Sep 3 00:00:11 2021 +0100 tipc: clean up inconsistent indenting There is a statement that is indented one character too deeply, clean this up. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit c645fe9bf6ae589ff9163d6c515d3517ec2e32d5 Author: Colin Ian King Date: Thu Sep 2 23:56:23 2021 +0100 skbuff: clean up inconsistent indenting There is a statement that is indented one character too deeply, clean this up. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 73fc98154e9cb40c608a2af16cab12c09886c751 Author: Colin Ian King Date: Thu Sep 2 23:25:57 2021 +0100 drivers: net: smc911x: clean up inconsistent indenting There are various function arguments that are not indented correctly, clean these up with correct indentation. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 743238892156eb3e1825543744bbc8d2da45a019 Author: Colin Ian King Date: Thu Sep 2 23:17:45 2021 +0100 net: 3com: 3c59x: clean up inconsistent indenting There is a statement that is not indented correctly, add in the missing tab. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 340fa6667a696338e707cd5531a9631093d1be29 Author: Mat Martineau Date: Thu Sep 2 11:51:19 2021 -0700 mptcp: Only send extra TCP acks in eligible socket states Recent changes exposed a bug where specifically-timed requests to the path manager netlink API could trigger a divide-by-zero in __tcp_select_window(), as syzkaller does: divide error: 0000 [#1] SMP KASAN NOPTI CPU: 0 PID: 9667 Comm: syz-executor.0 Not tainted 5.14.0-rc6+ #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:__tcp_select_window+0x509/0xa60 net/ipv4/tcp_output.c:3016 Code: 44 89 ff e8 c9 29 e9 fd 45 39 e7 0f 8d 20 ff ff ff e8 db 28 e9 fd 44 89 e3 e9 13 ff ff ff e8 ce 28 e9 fd 44 89 e0 44 89 e3 99 7c 24 04 29 d3 e9 fc fe ff ff e8 b7 28 e9 fd 44 89 f1 48 89 ea RSP: 0018:ffff888031ccf020 EFLAGS: 00010216 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000040000 RDX: 0000000000000000 RSI: ffff88811532c080 RDI: 0000000000000002 RBP: 0000000000000000 R08: ffffffff835807c2 R09: 0000000000000000 R10: 0000000000000004 R11: ffffed1020b92441 R12: 0000000000000000 R13: 1ffff11006399e08 R14: 0000000000000000 R15: 0000000000000000 FS: 00007fa4c8344700(0000) GS:ffff88811ae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2f424000 CR3: 000000003e4e2003 CR4: 0000000000770ef0 PKRU: 55555554 Call Trace: tcp_select_window net/ipv4/tcp_output.c:264 [inline] __tcp_transmit_skb+0xc00/0x37a0 net/ipv4/tcp_output.c:1351 __tcp_send_ack.part.0+0x3ec/0x760 net/ipv4/tcp_output.c:3972 __tcp_send_ack net/ipv4/tcp_output.c:3978 [inline] tcp_send_ack+0x7d/0xa0 net/ipv4/tcp_output.c:3978 mptcp_pm_nl_addr_send_ack+0x1ab/0x380 net/mptcp/pm_netlink.c:654 mptcp_pm_remove_addr+0x161/0x200 net/mptcp/pm.c:58 mptcp_nl_remove_id_zero_address+0x197/0x460 net/mptcp/pm_netlink.c:1328 mptcp_nl_cmd_del_addr+0x98b/0xd40 net/mptcp/pm_netlink.c:1359 genl_family_rcv_msg_doit.isra.0+0x225/0x340 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x341/0x5b0 net/netlink/genetlink.c:792 netlink_rcv_skb+0x148/0x430 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x537/0x750 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x846/0xd80 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0x14e/0x190 net/socket.c:724 ____sys_sendmsg+0x709/0x870 net/socket.c:2403 ___sys_sendmsg+0xff/0x170 net/socket.c:2457 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2486 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae mptcp_pm_nl_addr_send_ack() was attempting to send a TCP ACK on the first subflow in the MPTCP socket's connection list without validating that the subflow was in a suitable connection state. To address this, always validate subflow state when sending extra ACKs on subflows for address advertisement or subflow priority change. Fixes: 84dfe3677a6f ("mptcp: send out dedicated ADD_ADDR packet") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/229 Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Acked-by: Geliang Tang Signed-off-by: David S. Miller commit 20e7b9f82b6e7efc487e2c1a1dededbc4231fe81 Author: Eric Dumazet Date: Thu Sep 2 10:17:09 2021 -0700 pktgen: remove unused variable pktgen_thread_worker() no longer needs wait variable, delete it. Fixes: ef87979c273a ("pktgen: better scheduler friendliness") Signed-off-by: Eric Dumazet Cc: Stephen Hemminger Signed-off-by: David S. Miller commit 79a58c06c2d1b93a9d3ec29df08e5b726a8c63e1 Author: Shannon Nelson Date: Thu Sep 2 09:34:07 2021 -0700 ionic: fix double use of queue-lock Deadlock seen in an instance where the hwstamp configuration is changed while the driver is running: [ 3988.736671] schedule_preempt_disabled+0xe/0x10 [ 3988.736676] __mutex_lock.isra.5+0x276/0x4e0 [ 3988.736683] __mutex_lock_slowpath+0x13/0x20 [ 3988.736687] ? __mutex_lock_slowpath+0x13/0x20 [ 3988.736692] mutex_lock+0x2f/0x40 [ 3988.736711] ionic_stop_queues_reconfig+0x16/0x40 [ionic] [ 3988.736726] ionic_reconfigure_queues+0x43e/0xc90 [ionic] [ 3988.736738] ionic_lif_config_hwstamp_rxq_all+0x85/0x90 [ionic] [ 3988.736751] ionic_lif_hwstamp_set_ts_config+0x29c/0x360 [ionic] [ 3988.736763] ionic_lif_hwstamp_set+0x76/0xf0 [ionic] [ 3988.736776] ionic_eth_ioctl+0x33/0x40 [ionic] [ 3988.736781] dev_ifsioc+0x12c/0x420 [ 3988.736785] dev_ioctl+0x316/0x720 This can be demonstrated with "ptp4l -m -i " To fix this, we pull the use of the queue_lock further up above the callers of ionic_reconfigure_queues() and ionic_stop_queues_reconfig(). Fixes: 7ee99fc5ed2e ("ionic: pull hwstamp queue_lock up a level") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 05a444d3f90a3c3e6362e88a1bf13e1a60f8cace Author: Colin Ian King Date: Sun Aug 29 19:18:24 2021 +0100 ceph: fix dereference of null pointer cf Currently in the case where kmem_cache_alloc fails the null pointer cf is dereferenced when assigning cf->is_capsnap = false. Fix this by adding a null pointer check and return path. Cc: stable@vger.kernel.org Addresses-Coverity: ("Dereference null return") Fixes: b2f9fa1f3bd8 ("ceph: correctly handle releasing an embedded cap flush") Signed-off-by: Colin Ian King Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 0ddc5e55e6f1da1286fb2646f4248bf7da31a601 Author: Marc Zyngier Date: Fri Sep 3 09:29:07 2021 +0100 Documentation: Fix irq-domain.rst build warning Correctly escape the * not to be used as emphasis. Also take this opportunity to clarify the fate of the rest of the legacy APIs. Reported-by: Stephen Rothwell Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210903085343.923036-1-maz@kernel.org commit c42813b71a06a2ff4a155aa87ac609feeab76cf3 Author: Helge Deller Date: Thu Sep 2 23:24:42 2021 +0200 parisc: Fix unaligned-access crash in bootloader Kernel v5.14 has various changes to optimize unaligned memory accesses, e.g. commit 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers"). Those changes triggered an unalignment-exception and thus crashed the bootloader on parisc because the unaligned "output_len" variable now suddenly was read word-wise while it was read byte-wise in the past. Fix this issue by declaring the external output_len variable as char which then forces the compiler to generate byte-accesses. Signed-off-by: Helge Deller Cc: Arnd Bergmann Cc: John David Anglin Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Fixes: 8c031ba63f8f ("parisc: Unbreak bootloader due to gcc-7 optimizations") Fixes: 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers") Cc: # v5.14+ commit bc7cd2dd1f8e5889cc68b69984033ac5bef6ba61 Author: Masahiro Yamada Date: Mon Aug 30 17:20:33 2021 +0900 kbuild: redo fake deps at include/ksym/*.h Commit 0e0345b77ac4 ("kbuild: redo fake deps at include/config/*.h") simplified the Kconfig/fixdep interaction a lot. For CONFIG_FOO_BAR_BAZ, Kconfig now touches include/config/FOO_BAR_BAZ instead of the previous include/config/foo/bar/baz.h . This commit simplifies the TRIM_UNUSED_KSYMS feature in a similar way: - delete .h suffix - delete tolower() - put everything in 1 directory For EXPORT_SYMBOL(FOO_BAR_BAZ), scripts/adjust_autoksyms.sh now touches include/ksym/FOO_BAR_BAZ instead of include/ksym/foo/bar/baz.h . This is more precise, avoiding possibly unnecessary rebuilds. EXPORT_SYMBOL(FOO_BAR_BAZ) EXPORT_SYMBOL(_FOO_BAR_BAZ) EXPORT_SYMBOL(__FOO_BAR_BAZ) were previously mapped to the same header, include/ksym/foo/bar/baz.h but now are handled separately. Signed-off-by: Masahiro Yamada commit 44815c90210cd858c4a116c3eb35270160cecf81 Author: Masahiro Yamada Date: Sat Aug 28 18:51:01 2021 +0900 kbuild: clean up objtool_args slightly The code: $(if $(or $(CONFIG_GCOV_KERNEL),$(CONFIG_LTO_CLANG)), ...) ... can be simpled to: $(if $(CONFIG_GCOV_KERNEL)$(CONFIG_LTO_CLANG), ...) Also, remove meaningless commas at the end of $(if ...). Signed-off-by: Masahiro Yamada commit e54dd93a08228b9942d708b133ad3715d92712b0 Author: Masahiro Yamada Date: Sat Aug 28 18:50:59 2021 +0900 modpost: get the *.mod file path more simply get_src_version() strips 'o' or 'lto.o' from the end of the object file path (so, postfixlen is 1 or 5), then adds 'mod'. If you look at the code closely, mod->name already holds the base path with the extension stripped. Most of the code changes made by commit 7ac204b545f2 ("modpost: lto: strip .lto from module names") was actually unneeded. sumversion.c does not need strends(), so it can get back local in modpost.c again. Signed-off-by: Masahiro Yamada commit 1439ebd2ce77242400518d4e6a1e85bebcd8084f Author: Ariel Marcovitch Date: Sun Aug 22 22:22:01 2021 +0300 checkkconfigsymbols.py: Fix the '--ignore' option It seems like the implementation of the --ignore option is broken. In check_symbols_helper, when going through the list of files, a file is added to the list of source files to check if it matches the ignore pattern. Instead, as stated in the comment below this condition, the file should be added if it doesn't match the pattern. This means that when providing an ignore pattern, the only files that will be checked will be the ones we want the ignore, in addition to the Kconfig files that don't match the pattern (the check in parse_kconfig_files is done right) Signed-off-by: Ariel Marcovitch Signed-off-by: Masahiro Yamada commit 5df77ad61fd71b1b342ba40d913ad5595480691c Author: Masahiro Yamada Date: Thu Aug 19 09:57:39 2021 +0900 kbuild: merge vmlinux_link() between ARCH=um and other architectures For ARCH=um, ${CC} is used as the linker driver. Hence, the linker options are prefixed with -Wl, . Merge the similar code. I replaced the -T option with the long option --script= so that it works well with/without ${wl}. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit d40aecd108d2a6413d53f6f8339e787a23150595 Author: Masahiro Yamada Date: Thu Aug 19 09:57:38 2021 +0900 kbuild: do not remove 'linux' link in scripts/link-vmlinux.sh arch/um/Makefile passes the -f option to the ln command: linux: vmlinux @echo ' LINK $@' $(Q)ln -f $< $@ So, the hard link is always re-created, and the old one is removed anyway. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit 8f1305124ea48943d1dd07683ed4f82c69b232ee Author: Masahiro Yamada Date: Thu Aug 19 09:57:37 2021 +0900 kbuild: merge vmlinux_link() between the ordinary link and Clang LTO When Clang LTO is enabled, vmlinux_link() reuses vmlinux.o instead of re-linking ${KBUILD_VMLINUX_OBJS} and ${KBUILD_VMLINUX_LIBS}. That is the only difference here, so merge the similar code. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit a8390ba9ddce15242a41ca04d097b75fd54fd63f Author: Masahiro Yamada Date: Thu Aug 19 09:57:36 2021 +0900 kbuild: remove stale *.symversions cmd_update_lto_symversions merges all the existing *.symversions, but some of them might be stale. If the last EXPORT_SYMBOL is removed from a C file, the *.symversions file is not deleted or updated. It contains stale CRCs, but still they will be used for linking the vmlinux or modules. It is not a big deal when the EXPORT_SYMBOL is really removed. However, when the EXPORT_SYMBOL is moved to another file, the same __crc_ will appear twice in the merged *.symversions, possibly with different CRCs if the function argument is changed at the same time. It would confuse module versioning. If no EXPORT_SYMBOL is found, let's remove *.symversions explicitly. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit f01ac2a15218f3282b0b09b7ef7f314cbd7dd2b3 Author: Masahiro Yamada Date: Thu Aug 19 09:57:35 2021 +0900 kbuild: remove unused quiet_cmd_update_lto_symversions This is not used anywhere because the short log is displayed when it is used through a $(call cmd,...) invocation. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit 265264b814c2121513eab2e1cffe196502af0961 Author: Masahiro Yamada Date: Thu Aug 19 09:57:33 2021 +0900 gen_compile_commands: extract compiler command from a series of commands The current gen_compile_commands.py assumes that objects are always built by a single command. It makes sense to support cases where objects are built by a series of commands: cmd_ := ; One use-case is that is a compiler command, and an objtool command. It allows *.cmd files to contain an objtool command so that any change in it triggers object rebuilds. If ; appears after the C source file, take the first command. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit 7ab44e9ee5f241c0ed19e350d17e80bd90bde93d Author: Nick Desaulniers Date: Mon Aug 16 17:21:07 2021 -0700 x86: remove cc-option-yn test for -mtune= As noted in the comment, -mtune= has been supported since GCC 3.4. The minimum required version of GCC to build the kernel (as specified in Documentation/process/changes.rst) is GCC 4.9. tune is not immediately expanded. Instead it defines a macro that will test via cc-option later values for -mtune=. But we can skip the test whether to use -mtune= vs. -mcpu=. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Signed-off-by: Masahiro Yamada commit 43e6b58f793c47b0a6772a112e6586cd1e24b239 Author: Nick Desaulniers Date: Mon Aug 16 17:21:06 2021 -0700 arc: replace cc-option-yn uses with cc-option cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit ff00f64bceb164267dccc3648eb299aeafd3a342 Author: Nick Desaulniers Date: Mon Aug 16 17:21:04 2021 -0700 s390: replace cc-option-yn uses with cc-option cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Acked-by: Heiko Carstens Signed-off-by: Masahiro Yamada commit ba3e87cfa2a0f2db889297b6fc8a9e91a35c2d21 Author: Masahiro Yamada Date: Thu Aug 12 01:43:12 2021 +0900 ia64: move core-y in arch/ia64/Makefile to arch/ia64/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada commit 87c3cb564f3e34626f1afc0286b864045559b403 Author: Masahiro Yamada Date: Thu Jul 29 23:24:40 2021 +0900 sparc: move the install rule to arch/sparc/Makefile Currently, the install target in arch/sparc/Makefile descends into arch/sparc/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/sparc/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada commit e052826ff1a685a5c3a7033e907213de8433253e Author: Masahiro Yamada Date: Sat May 29 03:01:40 2021 +0900 security: remove unneeded subdir-$(CONFIG_...) All of these are unneeded. The directories to descend are specified by obj-$(CONFIG_...). Signed-off-by: Masahiro Yamada commit 25c648a066c1cc5ed763f2354531fdff41ac83a1 Author: Greg Kroah-Hartman Date: Wed Apr 7 07:34:17 2021 +0200 kbuild: sh: remove unused install script The sh arch has a install.sh script, but no Makefile actually calls it. Remove it to keep anyone from accidentally calling it in the future. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit 52d83df682c82055961531853c066f4f16e234ea Author: Masahiro Yamada Date: Thu Aug 19 09:01:14 2021 +0900 kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y When CONFIG_TRIM_UNUSED_KSYMS is enabled, I see some warnings like this: nm: arch/x86/entry/vdso/vdso32/note.o: no symbols $NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr. Fangrui Song mentioned binutils>=2.37 `nm -q` can be used to suppress "no symbols" [1], and llvm-nm>=13.0.0 supports -q as well. We cannot use it for now, but note it as a TODO. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=27408 Fixes: bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor commit 2185a7e4b0ade86c2c57fc63d4a7535c40254bd0 Author: Nathan Chancellor Date: Mon Aug 16 13:52:47 2021 -0700 kbuild: Switch to 'f' variants of integrated assembler flag It has been brought up a few times in various code reviews that clang 3.5 introduced -f{,no-}integrated-as as the preferred way to enable and disable the integrated assembler, mentioning that -{no-,}integrated-as are now considered legacy flags. Switch the kernel over to using those variants in case there is ever a time where clang decides to remove the non-'f' variants of the flag. Also, fix a typo in a comment ("intergrated" -> "integrated"). Link: https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 6272cc389fec78d1c0685599b8cad974476d89bb Author: Nathan Chancellor Date: Mon Aug 16 13:20:56 2021 -0700 kbuild: Shuffle blank line to improve comment meaning -Wunused-but-set-variable and -Wunused-const-variable are both disabled for the same reason but there is a blank line between them and no blank line between -Wno-unused-const-variable and the block. Shuffle the new line so that it is clear that the comment applied to both flags and the next block is separate from them. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 5c6ae0efca8d7aeac02f8734825067cd9475a264 Author: Nathan Chancellor Date: Mon Aug 16 13:20:55 2021 -0700 kbuild: Add a comment above -Wno-gnu Whenever a warning is disabled, it is helpful for future travelers to understand why the warning is disabled and why it is acceptable to do so. Add a comment for -Wno-gnu so that people understand why it is disabled. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit a312b60d6c4f09cebb727ffab68754fbf39dc1f1 Author: Nathan Chancellor Date: Mon Aug 16 13:20:54 2021 -0700 kbuild: Remove -Wno-format-invalid-specifier from clang block Turning on -Wformat does not reveal any instances of this warning across several different builds so remove this line to keep the number of disabled warnings as slim as possible. This has been disabled since commit 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang"), which does not explain exactly why it was turned off but since it was so long ago in terms of both the kernel and LLVM so it is possible that some bug got fixed along the way. Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit e1f86d7b4b2a5213b012c2b4fe3e5b6ad537686e Author: Masahiro Yamada Date: Fri Aug 13 15:30:05 2021 +0900 kbuild: warn if FORCE is missing for if_changed(_dep,_rule) and filechk if_changed, if_changed_dep, and if_changed_rule must have FORCE as a prerequisite so the command line change is detected. Documentation/kbuild/makefiles.rst clearly explains it: Note: It is a typical mistake to forget the FORCE prerequisite. However, not all people follow the document. This mistake occurred again and again, so a compelling force is needed. Show a warning if FORCE is missing in the prerequisite of if_changed and friends. Same for filechk. Signed-off-by: Masahiro Yamada Tested-by: Nicolas Schier commit 6796e80409b9031458e33dc39a3ac8aa3b93855b Author: Masahiro Yamada Date: Fri Aug 13 15:30:04 2021 +0900 kbuild: macrofy the condition of if_changed and friends Add a new macro that expands into $(newer-prereqs)$(cmd-check). It makes it easier to add common code for if_changed, if_changed_dep, and if_changed_rule. Signed-off-by: Masahiro Yamada commit 55a6d00ed0c1b4d20d7966d00fda6848d776658d Author: Masahiro Yamada Date: Thu Aug 19 10:22:51 2021 +0900 x86/build/vdso: fix missing FORCE for *.so build rule Add FORCE so that if_changed can detect the command line change. Signed-off-by: Masahiro Yamada commit 850ded46c64299f04d15e39caaba21963fb966f8 Author: Sami Tolvanen Date: Mon Aug 16 11:05:19 2021 -0700 kbuild: Fix TRIM_UNUSED_KSYMS with LTO_CLANG With CONFIG_LTO_CLANG, we currently link modules into native code just before modpost, which means with TRIM_UNUSED_KSYMS enabled, we still look at the LLVM bitcode in the .o files when generating the list of used symbols. As the bitcode doesn't yet have calls to compiler intrinsics and llvm-nm doesn't see function references that only exist in function-level inline assembly, we currently need a whitelist for TRIM_UNUSED_KSYMS to work with LTO. This change moves module LTO linking to happen earlier, and thus avoids the issue with LLVM bitcode and TRIM_UNUSED_KSYMS entirely, allowing us to also drop the whitelist from gen_autoksyms.sh. Link: https://github.com/ClangBuiltLinux/linux/issues/1369 Signed-off-by: Sami Tolvanen Reviewed-by: Alexander Lobakin Tested-by: Alexander Lobakin Signed-off-by: Masahiro Yamada commit 7d73c3e9c51400d3e0e755488050804e4d44737a Author: Nick Desaulniers Date: Mon Aug 16 13:25:01 2021 -0700 Makefile: remove stale cc-option checks cc-option, cc-option-yn, and cc-disable-warning all invoke the compiler during build time, and can slow down the build when these checks become stale for our supported compilers, whose minimally supported versions increases over time. See Documentation/process/changes.rst for the current supported minimal versions (GCC 4.9+, clang 10.0.1+). Compiler version support for these flags may be verified on godbolt.org. The following flags are GCC only and supported since at least GCC 4.9. Remove cc-option and cc-disable-warning tests. * -fno-tree-loop-im * -Wno-maybe-uninitialized * -fno-reorder-blocks * -fno-ipa-cp-clone * -fno-partial-inlining * -femit-struct-debug-baseonly * -fno-inline-functions-called-once * -fconserve-stack The following flags are supported by all supported versions of GCC and Clang. Remove their cc-option, cc-option-yn, and cc-disable-warning tests. * -fno-delete-null-pointer-checks * -fno-var-tracking * -Wno-array-bounds The following configs are made dependent on GCC, since they use GCC specific flags. * READABLE_ASM * DEBUG_SECTION_MISMATCH -mfentry was not supported by s390-linux-gnu-gcc until gcc-9+, add a comment. --param=allow-store-data-races=0 was renamed to -fno-allow-store-data-races in the GCC 10 release; add a comment. -Wmaybe-uninitialized (GCC specific) was being added for CONFIG_GCOV, then again unconditionally; add it only once. Also, base RETPOLINE_CFLAGS and RETPOLINE_VDSO_CFLAGS on CONFIC_CC_IS_* then remove cc-option tests for Clang. Link: https://github.com/ClangBuiltLinux/linux/issues/1436 Acked-by: Miguel Ojeda Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 36f1386d341209bf5ec792938fbc0786b914f8dd Author: Nick Desaulniers Date: Tue Aug 10 13:56:10 2021 -0700 MAINTAINERS: add Nick to Kbuild reviewers Kees' post inspired me to get more involved. I still have a long way to go in terms of mastery of GNU make, but at the least I can help with more code review. It's also helpful for me to pick up on what's missing from the LLVM ecosystem. Link: https://security.googleblog.com/2021/08/linux-kernel-security-done-right.html Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit a9c9a6f741cdaa2fa9ba24a790db8d07295761e3 Merge: 23852bec534a1 9b5ac8ab4e8bf Author: Linus Torvalds Date: Thu Sep 2 15:09:46 2021 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This series consists of the usual driver updates (ufs, qla2xxx, target, smartpqi, lpfc, mpt3sas). The core change causing the most churn was replacing the command request field request with a macro, allowing us to offset map to it and remove the redundant field; the same was also done for the tag field. The most impactful change is the final removal of scsi_ioctl, which has been deprecated for over a decade" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (293 commits) scsi: ufs: Fix ufshcd_request_sense_async() for Samsung KLUFG8RHDA-B2D1 scsi: ufs: ufs-exynos: Fix static checker warning scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI scsi: lpfc: Use the proper SCSI midlayer interfaces for PI scsi: lpfc: Copyright updates for 14.0.0.1 patches scsi: lpfc: Update lpfc version to 14.0.0.1 scsi: lpfc: Add bsg support for retrieving adapter cmf data scsi: lpfc: Add cmf_info sysfs entry scsi: lpfc: Add debugfs support for cm framework buffers scsi: lpfc: Add support for maintaining the cm statistics buffer scsi: lpfc: Add rx monitoring statistics scsi: lpfc: Add support for the CM framework scsi: lpfc: Add cmfsync WQE support scsi: lpfc: Add support for cm enablement buffer scsi: lpfc: Add cm statistics buffer support scsi: lpfc: Add EDC ELS support scsi: lpfc: Expand FPIN and RDF receive logging scsi: lpfc: Add MIB feature enablement support scsi: lpfc: Add SET_HOST_DATA mbox cmd to pass date/time info to firmware scsi: fc: Add EDC ELS definition ... commit c1fe77e42440d2cad76055df6fb58caabf622d51 Merge: ee28b42006c37 6b430c7595e4e Author: Miquel Raynal Date: Fri Sep 3 00:04:16 2021 +0200 Merge tag 'nand/for-5.15' into mtd/next NAND core changes: * Repair Miquel Raynal's email address in MAINTAINERS * Fix a couple of spelling mistakes in Kconfig * bbt: Skip bad blocks when searching for the BBT in NAND * Remove never changed ret variable Raw NAND changes: * cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' * intel: Fix error handling in probe * omap: Fix kernel doc warning on 'calcuate' typo * gpmc: Fix the ECC bytes vs. OOB bytes equation SPI-NAND core changes: * Properly fill the OOB area. * Fix comment SPI-NAND drivers changes: * macronix: Add Quad support for serial NAND flash commit e5a2cac908df691f1637f9272d4c6dec83239611 Author: Helge Deller Date: Thu Sep 2 23:54:03 2021 +0200 parisc: Drop __arch_swab16(), arch_swab24(), _arch_swab32() and __arch_swab64() functions No need to keep those as inline assembly functions, the compiler now generates the same or even better optimized code. Signed-off-by: Helge Deller commit 23852bec534a1633dc08f4df88b8493ae99953a9 Merge: 83ec91697412a 6a217437f9f54 Author: Linus Torvalds Date: Thu Sep 2 14:47:21 2021 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "This is quite a small cycle, no major series stands out. The HNS and rxe drivers saw the most activity this cycle, with rxe being broken for a good chunk of time. The significant deleted line count is due to a SPDX cleanup series. Summary: - Various cleanup and small features for rtrs - kmap_local_page() conversions - Driver updates and fixes for: efa, rxe, mlx5, hfi1, qed, hns - Cache the IB subnet prefix - Rework how CRC is calcuated in rxe - Clean reference counting in iwpm's netlink - Pull object allocation and lifecycle for user QPs to the uverbs core code - Several small hns features and continued general code cleanups - Fix the scatterlist confusion of orig_nents/nents introduced in an earlier patch creating the append operation" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (90 commits) RDMA/mlx5: Relax DCS QP creation checks RDMA/hns: Delete unnecessary blank lines. RDMA/hns: Encapsulate the qp db as a function RDMA/hns: Adjust the order in which irq are requested and enabled RDMA/hns: Remove RST2RST error prints for hw v1 RDMA/hns: Remove dqpn filling when modify qp from Init to Init RDMA/hns: Fix QP's resp incomplete assignment RDMA/hns: Fix query destination qpn RDMA/hfi1: Convert to SPDX identifier IB/rdmavt: Convert to SPDX identifier RDMA/hns: Bugfix for incorrect association between dip_idx and dgid RDMA/hns: Bugfix for the missing assignment for dip_idx RDMA/hns: Bugfix for data type of dip_idx RDMA/hns: Fix incorrect lsn field RDMA/irdma: Remove the repeated declaration RDMA/core/sa_query: Retry SA queries RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append RDMA/hns: Delete unused hns bitmap interface ... commit 83ec91697412ae64d25dcca74597ed03029aa00d Merge: c793011242d18 46a226b50ec3d Author: Linus Torvalds Date: Thu Sep 2 14:30:46 2021 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - Fix in i2c-hid driver for Elan touchpad quirk regression (Jim Broadus) - Quirk preventing ASUS Claymore from accidentally suspending whole system (Luke D. Jones) - Updates to the existing FW reporting mechanism, MP2 FW status checks, adding proper power management support for amd-sfh (Basavaraj Natikar) - Regression fix for an issue in HID core that got uncovered by recent USB core cleanup leading to issues when transfer_buffer_length is not in line with wLength (Alan Stern) - Memory leak fix in USB HID core (Anirudh Rayabharam) - Improvement of stylus battery reporting (Dmitry Torokhov) - Power management improvement for Goodix driver (Douglas Anderson) - High-resolution scroll support for Magicmouse devices (José Expósito) - Support for GHLive PS4 dongles (Daniel Nguyen) - Support proper EV_MSC emissions to hid-apple (Vincent Lefevre) * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (31 commits) HID: usbhid: Simplify code in hid_submit_ctrl() HID: usbhid: Fix warning caused by 0-length input reports HID: usbhid: Fix flood of "control queue full" messages HID: sony: Fix more ShanWan clone gamepads to not rumble when plugged in. HID: sony: support for the ghlive ps4 dongles HID: thrustmaster: clean up Makefile and adapt quirks HID: i2c-hid: Fix Elan touchpad regression HID: asus: Prevent Claymore sending suspend event HID: amd_sfh: Add dyndbg prints for debugging HID: amd_sfh: Add support for PM suspend and resume HID: amd_sfh: Move hid probe after sensor is enabled HID: amd_sfh: Add command response to check command status HID: amd_sfh: Fix period data field to enable sensor HID: logitech-hidpp: battery: provide CAPACITY property for newer devices HID: thrustmaster: Fix memory leak in thrustmaster_interrupts() HID: thrustmaster: Fix memory leak in remove HID: thrustmaster: Fix memory leaks in probe HID: elo: update the reference count of the usb device structure HID: logitech-hidpp: Use 'atomic_inc_return' instead of hand-writing it HID: apple: Add missing scan code event for keys handled by hid-apple ... commit c793011242d182e5f12800c12dbaf37af80be735 Merge: 75d6e7d9ced83 04853352952b7 Author: Linus Torvalds Date: Thu Sep 2 14:22:56 2021 -0700 Merge tag 'pinctrl-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "This is the bulk of pin control changes for the v5.15 kernel cycle, no core changes at all this time, just driver work! New drivers: - New subdriver for Intel Keem Bay (an ARM-based SoC) - New subdriver for Qualcomm MDM9607 and SM6115 - New subdriver for ST Microelectronics STM32MP135 - New subdriver for Freescale i.MX8ULP ("Ultra Low Power") - New subdriver for Ingenic X2100 - Support for Qualcomm PMC8180, PMC8180C, SA8155p-adp PMIC GPIO - Support Samsung Exynos850 - Support Renesas RZ/G2L Enhancements: - A major refactoring of the Rockchip driver, breaking part of it out to a separate GPIO driver in drivers/gpio - Pin bias support on Renesas r8a77995 - Add SCI pins support to Ingenic JZ4755 and JZ4760 - Mediatek device tree bindings converted to YAML" * tag 'pinctrl-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (53 commits) pinctrl: renesas: Add RZ/G2L pin and gpio controller driver pinctrl: samsung: Add Exynos850 SoC specific data dt-bindings: pinctrl: samsung: Add Exynos850 doc MAINTAINERS: Add maintainers for amd-pinctrl driver pinctrl: Add Intel Keem Bay pinctrl driver dt-bindings: pinctrl: Add bindings for Intel Keembay pinctrl driver pinctrl: zynqmp: Drop pinctrl_unregister for devm_ registered device dt-bindings: pinctrl: qcom-pmic-gpio: Remove the interrupts property dt-bindings: pinctrl: qcom-pmic-gpio: Convert qcom pmic gpio bindings to YAML dt-bindings: pinctrl: mt8195: Use real world values for drive-strength arguments dt-bindings: mediatek: convert pinctrl to yaml arm: dts: mt8183: Move pinfunc to include/dt-bindings/pinctrl arm: dts: mt8135: Move pinfunc to include/dt-bindings/pinctrl pinctrl: ingenic: Add .max_register in regmap_config pinctrl: ingenic: Fix bias config for X2000(E) pinctrl: ingenic: Fix incorrect pull up/down info pinctrl: Ingenic: Add pinctrl driver for X2100. dt-bindings: pinctrl: Add bindings for Ingenic X2100. pinctrl: Ingenic: Add SSI pins support for JZ4755 and JZ4760. pinctrl: Ingenic: Improve the code. ... commit 75d6e7d9ced83e937757e278c3ce1ccd6606a96a Merge: a180eab0b564a 47505bf3a8216 Author: Linus Torvalds Date: Thu Sep 2 14:17:24 2021 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "Nothing changed in the clk framework core this time around. We did get some updates to the basic clk types to use determine_rate for the divider type and add a power of two fractional divider flag though. Otherwise, this is a collection of clk driver updates. More than half the diffstat is in the Qualcomm clk driver where we add a bunch of data to describe clks on various SoCs and fix bugs. The other big new thing in here is the Mediatek MT8192 clk driver. That's been under review for a while and it's nice to see that it's finally upstream. Beyond that it's the usual set of minor fixes and tweaks to clk drivers. There are some non-clk driver bits in here which have all been acked by the respective maintainers. New Drivers: - Support video, gpu, display clks on qcom sc7280 SoCs - GCC clks on qcom MSM8953, SM4250/6115, and SM6350 SoCs - Multimedia clks (MMCC) on qcom MSM8994/MSM8992 - RPMh clks on qcom SM6350 SoCs - Support for Mediatek MT8192 SoCs - Add display (DU and DSI) clocks on Renesas R-Car V3U - Add I2C, DMAC, USB, sound (SSIF-2), GPIO, CANFD, and ADC clocks and resets on Renesas RZ/G2L Updates: - Support the SD/OE pin on IDT VersaClock 5 and 6 clock generators - Add power of two flag to fractional divider clk type - Migrate some clk drivers to clk_divider_ops.determine_rate - Migrate to clk_parent_data in gcc-sdm660 - Fix CLKOUT clocks on i.MX8MM and i.MX8MN by using imx_clk_hw_mux2 - Switch from .round_rate to .determine_rate in clk-divider-gate - Fix clock tree update for TF-A controlled clocks for all i.MX8M - Add missing M7 core clock for i.MX8MN - YAML conversion of rk3399 clock controller binding - Removal of GRF dependency for the rk3328/rk3036 pll types - Drop CLK_IS_CRITICAL flag from Tegra fuse clk - Make CLK_R9A06G032 Kconfig symbol invisible - Convert various DT bindings to YAML" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (128 commits) dt-bindings: clock: samsung: fix header path in example clk: tegra: fix old-style declaration clk: qcom: Add SM6350 GCC driver MAINTAINERS: clock: include S3C and S5P in Samsung SoC clock entry dt-bindings: clock: samsung: convert S5Pv210 AudSS to dtschema dt-bindings: clock: samsung: convert Exynos AudSS to dtschema dt-bindings: clock: samsung: convert Exynos4 to dtschema dt-bindings: clock: samsung: convert Exynos3250 to dtschema dt-bindings: clock: samsung: convert Exynos542x to dtschema dt-bindings: clock: samsung: add bindings for Exynos external clock dt-bindings: clock: samsung: convert Exynos5250 to dtschema clk: vc5: Add properties for configuring SD/OE behavior clk: vc5: Use dev_err_probe dt-bindings: clk: vc5: Add properties for configuring the SD/OE pin dt-bindings: clock: brcm,iproc-clocks: fix armpll properties clk: zynqmp: Fix kernel-doc format clk: at91: clk-generated: Limit the requested rate to our range clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates clk: zynqmp: Fix a memory leak clk: zynqmp: Check the return type ... commit a180eab0b564a9dc149beb0517136ef7129f1260 Merge: 7ba88a2a09f47 85dfdbfc13ea9 Author: Linus Torvalds Date: Thu Sep 2 14:12:24 2021 -0700 Merge tag 'mailbox-v5.15' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - mtk: - added support for mt8192 and mt8195 - minor fix regarding address shift - qcom: - added compatibles for MSM8953, SM6350 and SM6115 - enable loading IPCC as a module - misc: - change Altera maintainer - fix sti kernel-doc warnings * tag 'mailbox-v5.15' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: cmdq: add multi-gce clocks support for mt8195 mailbox: cmdq: add mediatek mailbox support for mt8195 dt-bindings: gce: add gce header file for mt8195 dt-bindings: mailbox: add definition for mt8195 mailbox: qcom-apcs-ipc: Add compatible for MSM8953 SoC dt-bindings: mailbox: Add compatible for the MSM8953 dt-bindings: mailbox: qcom-ipcc: Add compatible for SM6350 mailbox: qcom: Add support for SM6115 APCS IPC dt-bindings: mailbox: qcom: Add SM6115 APCS compatible soc: mediatek: cmdq: add address shift in jump mailbox: cmdq: add mt8192 support dt-binding: gce: add gce header file for mt8192 MAINTAINERS: Replace Ley Foon Tan as Altera Mailbox maintainer mailbox: qcom-ipcc: Enable loading QCOM_IPCC as a module mailbox: sti: quieten kernel-doc warnings commit 7ba88a2a09f47e2e4f3e34215677a1d78a9e6a73 Merge: 89b6b8cd92c06 0487d4fc42d7f Author: Linus Torvalds Date: Thu Sep 2 13:49:39 2021 -0700 Merge tag 'platform-drivers-x86-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "Highlights: - Move all the Intel drivers into their own subdir(s) (mostly Kate's work) - New meraki-mx100 platform driver - Asus WMI driver enhancements, including support for /sys/firmware/acpi/platform_profile - New BIOS SAR driver for Intel M.2 WWAM modems - Alder Lake support for the Intel PMC driver - A whole bunch of cleanups + fixes all over the place" * tag 'platform-drivers-x86-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (65 commits) platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from run_smbios_call platform/x86: dell-smbios-wmi: Avoid false-positive memcpy() warning platform/x86: ISST: use semi-colons instead of commas platform/x86: asus-wmi: Fix "unsigned 'retval' is never less than zero" smatch warning platform/x86: asus-wmi: Delete impossible condition platform/x86: hp_accel: Convert to be a platform driver platform/x86: hp_accel: Remove _INI method call platform/mellanox: mlxbf-pmc: fix kernel-doc notation platform/x86/intel: pmc/core: Add GBE Package C10 fix for Alder Lake PCH platform/x86/intel: pmc/core: Add Alder Lake low power mode support for pmc core platform/x86/intel: pmc/core: Add Latency Tolerance Reporting (LTR) support to Alder Lake platform/x86/intel: pmc/core: Add Alderlake support to pmc core driver platform/x86: intel-wmi-thunderbolt: Move to intel sub-directory platform/x86: intel-wmi-sbl-fw-update: Move to intel sub-directory platform/x86: intel-vbtn: Move to intel sub-directory platform/x86: intel_oaktrail: Move to intel sub-directory platform/x86: intel_int0002_vgpio: Move to intel sub-directory platform/x86: intel-hid: Move to intel sub-directory platform/x86: intel_atomisp2: Move to intel sub-directory platform/x86: intel_speed_select_if: Move to intel sub-directory ... commit 9f3589993c0c69ab9f2401a6b65b21c419b482d6 Author: Jeff Layton Date: Tue Jan 26 13:22:31 2021 -0500 ceph: drop the mdsc_get_session/put_session dout messages These are very chatty, racy, and not terribly useful. Just remove them. Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 3eaf5aa1cfa8c97c72f5824e2e9263d6cc977b03 Author: Jeff Layton Date: Thu Sep 2 08:31:03 2021 -0400 ceph: lockdep annotations for try_nonblocking_invalidate Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit a76d0a9c288ea7f5fc01bf05485573ce6b36b839 Author: Xiubo Li Date: Wed Aug 25 21:45:45 2021 +0800 ceph: don't WARN if we're forcibly removing the session caps For example in the case of a forced umount, we'll remove all the session caps even if they are dirty. Move the warning to a wrapper function and make most of the callers use it. Call the core function when removing caps due to a forced umount. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 42ad631b4d0e0d6da0bfe375af99887251fbf970 Author: Xiubo Li Date: Wed Aug 25 21:45:44 2021 +0800 ceph: don't WARN if we're force umounting Force umount will try to close the sessions by setting the session state to _CLOSING. We don't want to WARN in this situation, since it's expected. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit a6d37ccdd240e80f26aaea0e62cda310e0e184d7 Author: Xiubo Li Date: Wed Aug 25 21:45:43 2021 +0800 ceph: remove the capsnaps when removing caps capsnaps will take inode references via ihold when queueing to flush. When force unmounting, the client will just close the sessions and may never get a flush reply, causing a leak and inode ref leak. Fix this by removing the capsnaps for an inode when removing the caps. URL: https://tracker.ceph.com/issues/52295 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit b11ed50346683a749632ea664959b28d524d7395 Author: Jeff Layton Date: Wed Aug 11 06:40:42 2021 -0400 ceph: request Fw caps before updating the mtime in ceph_write_iter The current code will update the mtime and then try to get caps to handle the write. If we end up having to request caps from the MDS, then the mtime in the cap grant will clobber the updated mtime and it'll be lost. This is most noticable when two clients are alternately writing to the same file. Fw caps are continually being granted and revoked, and the mtime ends up stuck because the updated mtimes are always being overwritten with the old one. Fix this by changing the order of operations in ceph_write_iter to get the caps before updating the times. Also, make sure we check the pool full conditions before even getting any caps or uninlining. URL: https://tracker.ceph.com/issues/46574 Reported-by: Jozef Kováč Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Reviewed-by: Luis Henriques Signed-off-by: Ilya Dryomov commit d517b3983dd3106ca92d6c5d0d09415a4a09481c Author: Xiubo Li Date: Wed Aug 18 09:31:19 2021 +0800 ceph: reconnect to the export targets on new mdsmaps In the case where the export MDS has crashed just after the EImportStart journal is flushed, a standby MDS takes over for it and when replaying the EImportStart journal the MDS will wait the client to reconnect. That may never happen because the client may not have registered or opened the sessions yet. When receiving a new map, ensure we reconnect to valid export targets as well if their sessions don't exist yet. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 692e17159792a13e8c5031bdc0ae9b0f3158593d Author: Jeff Layton Date: Mon Aug 2 15:32:47 2021 -0400 ceph: print more information when we can't find snaprealm Print a bit more information when we can't find the realm during ceph_add_cap. Show both the inode number and the old realm inode number. Suggested-by: Sage Weil Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 0ba92e1c5f7ce7e9c1c828a84e873d7be51c1b9f Author: Jeff Layton Date: Mon Aug 2 11:01:26 2021 -0400 ceph: add ceph_change_snap_realm() helper Consolidate some fiddly code for changing an inode's snap_realm into a new helper function, and change the callers to use it. While we're in here, nothing uses the i_snap_realm_counter field, so remove that from the inode. Signed-off-by: Jeff Layton Reviewed-by: Luis Henriques Signed-off-by: Ilya Dryomov commit c80dc3aee984c647d747bb07c108862effc917d8 Author: Jeff Layton Date: Tue Jul 27 10:50:02 2021 -0400 ceph: remove redundant initializations from mdsc and session The ceph_mds_client and ceph_mds_session structures are kzalloc'ed so there's no need to explicitly initialize either of their fields to 0. Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit b4002173b7989588b6feaefc42edaf011b596782 Author: Jeff Layton Date: Tue Jul 27 15:47:12 2021 -0400 ceph: cancel delayed work instead of flushing on mdsc teardown The first thing metric_delayed_work does is check mdsc->stopping, and then return immediately if it's set. That's good since we would have already torn down the metric structures at this point, otherwise, but there is no locking around mdsc->stopping. It's possible that the ceph_metric_destroy call could race with the delayed_work, in which case we could end up with the delayed_work accessing destroyed percpu variables. At this point in the mdsc teardown, the "stopping" flag has already been set, so there's no benefit to flushing the work. Move the work cancellation in ceph_metric_destroy ahead of the percpu variable destruction, and eliminate the flush_delayed_work call in ceph_mdsc_destroy. Fixes: 18f473b384a6 ("ceph: periodically send perf metrics to MDSes") Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 40e309de4dd84ba91b9e0549a5173ce13ef02c5e Author: Jeff Layton Date: Mon Jul 26 07:07:50 2021 -0400 ceph: add a new vxattr to return auth mds for an inode Add a new vxattr that shows what MDS is authoritative for an inode (if we happen to have auth caps). If we don't have an auth cap for the inode then just return -1. URL: https://tracker.ceph.com/issues/1276 Signed-off-by: Jeff Layton Reviewed-by: Luis Henriques Signed-off-by: Ilya Dryomov commit 49f8899e5edfc4b8a97d3959e1ded5a95f2e46b3 Author: Jeff Layton Date: Wed Jul 7 12:26:47 2021 -0400 ceph: remove some defunct forward declarations We missed these in the recent fscache rework. Reported-by: Steve French Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit e1a4541ec0b951685a49d1f72d183681e6433a45 Author: Xiubo Li Date: Mon Jul 5 09:22:57 2021 +0800 ceph: flush the mdlog before waiting on unsafe reqs For the client requests who will have unsafe and safe replies from MDS daemons, in the MDS side the MDS daemons won't flush the mdlog (journal log) immediatelly, because they think it's unnecessary. That's true for most cases but not all, likes the fsync request. The fsync will wait until all the unsafe replied requests to be safely replied. Normally if there have multiple threads or clients are running, the whole mdlog in MDS daemons could be flushed in time if any request will trigger the mdlog submit thread. So usually we won't experience the normal operations will stuck for a long time. But in case there has only one client with only thread is running, the stuck phenomenon maybe obvious and the worst case it must wait at most 5 seconds to wait the mdlog to be flushed by the MDS's tick thread periodically. This patch will trigger to flush the mdlog in the relevant and auth MDSes to which the in-flight requests are sent just before waiting the unsafe requests to finish. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit d095559ce4100f0c02aea229705230deac329c97 Author: Xiubo Li Date: Mon Jul 5 09:22:56 2021 +0800 ceph: flush mdlog before umounting Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 59b312f36230ea91ebb6ce1b11f2781604495d30 Author: Xiubo Li Date: Mon Jul 5 09:22:55 2021 +0800 ceph: make iterate_sessions a global symbol Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit fba97e8025015b63b1bdb73cd868c8ea832a1620 Author: Xiubo Li Date: Mon Jul 5 09:22:54 2021 +0800 ceph: make ceph_create_session_msg a global symbol Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit ce3a8732ae0d43a6d14aa24624c0f12b3e6281b9 Author: Jeff Layton Date: Mon Jun 14 07:15:38 2021 -0400 ceph: fix comment about short copies in ceph_write_end Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 2ad32cf09bd28a21e6ad1595355a023ed631b529 Author: Jeff Layton Date: Thu Jul 1 10:41:46 2021 -0400 ceph: fix memory leak on decode error in ceph_handle_caps If we hit a decoding error late in the frame, then we might exit the function without putting the pool_ns string. Ensure that we always put that reference on the way out of the function. Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 89b6b8cd92c068cd1bdf877ec7fb1392568ef35d Merge: 9ae5fceb9a201 ea870730d83fc Author: Linus Torvalds Date: Thu Sep 2 13:41:33 2021 -0700 Merge tag 'vfio-v5.15-rc1' of git://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Fix dma-valid return WAITED implementation (Anthony Yznaga) - SPDX license cleanups (Cai Huoqing) - Split vfio-pci-core from vfio-pci and enhance PCI driver matching to support future vendor provided vfio-pci variants (Yishai Hadas, Max Gurtovoy, Jason Gunthorpe) - Replace duplicated reflck with core support for managing first open, last close, and device sets (Jason Gunthorpe, Max Gurtovoy, Yishai Hadas) - Fix non-modular mdev support and don't nag about request callback support (Christoph Hellwig) - Add semaphore to protect instruction intercept handler and replace open-coded locks in vfio-ap driver (Tony Krowiak) - Convert vfio-ap to vfio_register_group_dev() API (Jason Gunthorpe) * tag 'vfio-v5.15-rc1' of git://github.com/awilliam/linux-vfio: (37 commits) vfio/pci: Introduce vfio_pci_core.ko vfio: Use kconfig if XX/endif blocks instead of repeating 'depends on' vfio: Use select for eventfd PCI / VFIO: Add 'override_only' support for VFIO PCI sub system PCI: Add 'override_only' field to struct pci_device_id vfio/pci: Move module parameters to vfio_pci.c vfio/pci: Move igd initialization to vfio_pci.c vfio/pci: Split the pci_driver code out of vfio_pci_core.c vfio/pci: Include vfio header in vfio_pci_core.h vfio/pci: Rename ops functions to fit core namings vfio/pci: Rename vfio_pci_device to vfio_pci_core_device vfio/pci: Rename vfio_pci_private.h to vfio_pci_core.h vfio/pci: Rename vfio_pci.c to vfio_pci_core.c vfio/ap_ops: Convert to use vfio_register_group_dev() s390/vfio-ap: replace open coded locks for VFIO_GROUP_NOTIFY_SET_KVM notification s390/vfio-ap: r/w lock for PQAP interception handler function pointer vfio/type1: Fix vfio_find_dma_valid return vfio-pci/zdev: Remove repeated verbose license text vfio: platform: reset: Convert to SPDX identifier vfio: Remove struct vfio_device_ops open/release ... commit 3f2b16734914fa7c53ef7f8a10a63828890dbd37 Author: Jitao Shi Date: Sun Aug 8 21:24:33 2021 +0800 pwm: mtk-disp: Implement atomic API .get_state() Switch the driver to support the .get_state() method. Signed-off-by: Jitao Shi [thierry.reding@gmail.com: add missing linux/bitfield.h include] Signed-off-by: Thierry Reding commit 331e049dec64c2d269648a3ea4ea6aae8a54b4ac Author: Jitao Shi Date: Sun Aug 8 21:24:32 2021 +0800 pwm: mtk-disp: Fix overflow in period and duty calculation Current calculation for period and high_width may have 64-bit overflow. state->period and rate are u64. rate * state->period will overflow. clk_div = div_u64(rate * state->period, NSEC_PER_SEC) period = div64_u64(rate * state->period, div); high_width = div64_u64(rate * state->duty_cycle, div); This patch is to resolve it by using mul_u64_u64_div_u64(). Signed-off-by: Jitao Shi Signed-off-by: Thierry Reding commit 888a623db5d025cc72cd2887bacc3cf3fad10b6f Author: Jitao Shi Date: Sun Aug 8 21:24:31 2021 +0800 pwm: mtk-disp: Implement atomic API .apply() Switch the driver to support the .apply() method. Signed-off-by: Jitao Shi Signed-off-by: Thierry Reding commit 799206c1302e8fabfab5a4151e74a2fe90090590 Author: Konrad Rzeszutek Wilk Date: Wed Sep 1 20:22:11 2021 -0400 iscsi_ibft: Fix isa_bus_to_virt not working under ARM The isa_bus_to_virt is only needed under X86 and in fact the code that sets the ibft_phys_addr is only compiled under X86. As such lets just ifdef the code. Reported-by: kernel test robot Reported-by: Vijayendra Suman CC: Maurizio Lombardi CC: Mike Rapoport Signed-off-by: Konrad Rzeszutek Wilk --- v2: Remove the ibft_phys_addr as it is defined in iscsi_ibft.h commit 9ae5fceb9a20154d74586fe17d1096b981b23e34 Merge: a2d616b935a0d 58e636039b512 Author: Linus Torvalds Date: Thu Sep 2 13:20:11 2021 -0700 Merge tag 'for-linus-5.15-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - some small cleanups - a fix for a bug when running as Xen PV guest which could result in not all memory being transferred in case of a migration of the guest - a small series for getting rid of code for supporting very old Xen hypervisor versions nobody should be using since many years now - a series for hardening the Xen block frontend driver - a fix for Xen PV boot code issuing warning messages due to a stray preempt_disable() on the non-boot processors * tag 'for-linus-5.15-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: remove stray preempt_disable() from PV AP startup code xen/pcifront: Removed unnecessary __ref annotation x86: xen: platform-pci-unplug: use pr_err() and pr_warn() instead of raw printk() drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings xen/blkfront: don't trust the backend response data blindly xen/blkfront: don't take local copy of a request from the ring page xen/blkfront: read response from backend only once xen: assume XENFEAT_gnttab_map_avail_bits being set for pv guests xen: assume XENFEAT_mmu_pt_update_preserve_ad being set for pv guests xen: check required Xen features xen: fix setting of max_pfn in shared_info commit a2d616b935a0df24bc9375785b19bf30d7fc9c6a Merge: b5d6d2633c1b6 6f1fce595b78b Author: Linus Torvalds Date: Thu Sep 2 13:16:00 2021 -0700 Merge tag 'for-5.15/parisc' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture updates from Helge Deller: - Fix a kernel crash when a signal is delivered to bad userspace stack - Fix fall-through warnings in math-emu code - Increase size of gcc stack frame check - Switch coding from 'pci_' to 'dma_' API - Make struct parisc_driver::remove() return void - Some parisc related Makefile changes - Minor cleanups, e.g. change to octal permissions, fix macro collisions, fix PMD_ORDER collision, replace spaces with tabs * tag 'for-5.15/parisc' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: math-emu: Fix fall-through warnings parisc: fix crash with signals and alloca parisc: Fix compile failure when building 64-bit kernel natively parisc: ccio-dma.c: Added tab instead of spaces parisc/parport_gsc: switch from 'pci_' to 'dma_' API parisc: move core-y in arch/parisc/Makefile to arch/parisc/Kbuild parisc: switch from 'pci_' to 'dma_' API parisc: Make struct parisc_driver::remove() return void parisc: remove unused arch/parisc/boot/install.sh and its phony target parisc: Rename PMD_ORDER to PMD_TABLE_ORDER parisc: math-emu: Avoid "fmt" macro collision parisc: Increase size of gcc stack frame check parisc: Replace symbolic permissions with octal permissions commit b5d6d2633c1b6b2b4599f658f8abe7eb1358cc77 Merge: aa829778b16f1 7b7cec477fc3c Author: Linus Torvalds Date: Thu Sep 2 13:12:44 2021 -0700 Merge tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa updates from Max Filippov: - fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG - add fairness to handling IRQs of the same priority - fix pointer usage before NULL check in ISS console driver - build system cleanups * tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild xtensa: build platform directories unconditionally xtensa: do not build variants directory xtensa: remove unneeded exports xtensa: ISS: don't use string pointer before NULL check xtensa: add fairness to IRQ handling xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG commit 340576590dac4bb58d532a8ad5bfa806d8ab473c Author: Thomas Gleixner Date: Thu Sep 2 11:48:51 2021 +0200 futex: Avoid redundant task lookup No need to do the full VPID based task lookup and validation of the top waiter when the user space futex was acquired on it's behalf during the requeue_pi operation. The task is known already and it cannot go away before requeue_pi_wake_futex() has been invoked. Split out the actual attach code from attach_pi_state_owner() and use that instead of the full blown variant. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210902094414.676104881@linutronix.de commit 249955e51c8136189b3c66f54e212981a1350a0f Author: Thomas Gleixner Date: Thu Sep 2 11:48:50 2021 +0200 futex: Clarify comment for requeue_pi_wake_futex() It's slightly confusing. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210902094414.618613025@linutronix.de commit 4f07ec0d76f242d4ca0f0c0c6f7293c28254a554 Author: Thomas Gleixner Date: Thu Sep 2 11:48:48 2021 +0200 futex: Prevent inconsistent state and exit race The recent rework of the requeue PI code introduced a possibility for going back to user space in inconsistent state: CPU 0 CPU 1 requeue_futex() if (lock_pifutex_user()) { dequeue_waiter(); wake_waiter(task); sched_in(task); return_from_futex_syscall(); ---> Inconsistent state because PI state is not established It becomes worse if the woken up task immediately exits: sys_exit(); attach_pistate(vpid); <--- FAIL Attach the pi state before dequeuing and waking the waiter. If the waiter gets a spurious wakeup before the dequeue operation it will wait in futex_requeue_pi_wakeup_sync() and therefore cannot return and exit. Fixes: 07d91ef510fb ("futex: Prevent requeue_pi() lock nesting issue on RT") Reported-by: syzbot+4d1bd0725ef09168e1a0@syzkaller.appspotmail.com Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210902094414.558914045@linutronix.de commit a974b54036f79dd5e395e9f6c80c3decb4661a14 Author: Colin Ian King Date: Wed Aug 18 14:18:40 2021 +0100 futex: Return error code instead of assigning it without effect The check on the rt_waiter and top_waiter->pi_state is assigning an error return code to ret but this later gets re-assigned, hence the check is ineffective. Return -EINVAL rather than assigning it to ret which was the original intent. Fixes: dc7109aaa233 ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()") Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Thomas Gleixner Reviewed-by: André Almeida Link: https://lore.kernel.org/r/20210818131840.34262-1-colin.king@canonical.com commit 15eb7c888e749fbd1cc0370f3d38de08ad903700 Author: Mike Galbraith Date: Tue Aug 31 08:38:19 2021 +0200 locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT 730633f0b7f95 became the first direct caller of __init_rwsem() vs the usual init_rwsem(), exposing PREEMPT_RT's lack thereof. Add it. [ tglx: Move it out of line ] Signed-off-by: Mike Galbraith Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/50a936b7d8f12277d6ec7ed2ef0421a381056909.camel@gmx.de commit d7a4e582587d97a586b1f7709e3bddcf35928e96 Author: Jitao Shi Date: Sun Aug 8 21:24:29 2021 +0800 pwm: mtk-disp: Adjust the clocks to avoid them mismatch The clks "main" and "mm" are prepared in .probe() (and unprepared in .remove()). This results in the clocks being on during suspend which results in unnecessarily increased power consumption. Remove the clock operations from .probe() and .remove(). Add the clk_prepare_enable() in .enable() and the clk_disable_unprepare() in .disable(). Signed-off-by: Jitao Shi [thierry.reding@gmail.com: squashed in fixup patch] Signed-off-by: Thierry Reding commit aa829778b16f15266fefe2640f04931b16ce39c0 Merge: aef4892a63c24 4812c9111220b Author: Linus Torvalds Date: Thu Sep 2 13:00:15 2021 -0700 Merge tag 'locking-debug-2021-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull memory model updates from Ingo Molnar: "LKMM updates: - Update documentation and code example KCSAN updates: - Introduce CONFIG_KCSAN_STRICT (which RCU uses) - Optimize use of get_ctx() by kcsan_found_watchpoint() - Rework atomic.h into permissive.h - Add the ability to ignore writes that change only one bit of a given data-racy variable. - Improve comments" * tag 'locking-debug-2021-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tools/memory-model: Document data_race(READ_ONCE()) tools/memory-model: Heuristics using data_race() must handle all values tools/memory-model: Add example for heuristic lockless reads tools/memory-model: Make read_foo_diagnostic() more clearly diagnostic kcsan: Make strict mode imply interruptible watchers kcsan: permissive: Ignore data-racy 1-bit value changes kcsan: Print if strict or non-strict during init kcsan: Rework atomic.h into permissive.h kcsan: Reduce get_ctx() uses in kcsan_found_watchpoint() kcsan: Introduce CONFIG_KCSAN_STRICT kcsan: Remove CONFIG_KCSAN_DEBUG kcsan: Improve some Kconfig comments commit d7109fe3a0991a0f7b4ac099b78c908e3b619787 Author: Andy Shevchenko Date: Thu Aug 26 18:03:17 2021 +0300 x86/platform: Increase maximum GPIO number for X86_64 By default the 512 GPIOs is the maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Reviewed-by: Linus Walleij Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20210826150317.29435-1-andriy.shevchenko@linux.intel.com commit 742a4c49a82a8fe1369e4ec2af4a9bf69123cb88 Merge: e3c825c93e623 224d8031e482b Author: Bjorn Helgaas Date: Thu Sep 2 14:56:52 2021 -0500 Merge branch 'remotes/lorenzo/pci/tools' - Zero-initialize pcitest param to avoid random "-d" setting (Shunyong Yang) * remotes/lorenzo/pci/tools: tools: PCI: Zero-initialize param commit e3c825c93e623198ad08e73f49377489ff6fb03b Merge: 6e129176c3afd 9f1168cf263aa Author: Bjorn Helgaas Date: Thu Sep 2 14:56:52 2021 -0500 Merge branch 'remotes/lorenzo/pci/misc' - Make ixp4xx driver depend on ARCH_IXP4XX (Geert Uytterhoeven) * remotes/lorenzo/pci/misc: PCI: controller: PCI_IXP4XX should depend on ARCH_IXP4XX commit 6e129176c3afd337966562fc3de236cc48447582 Merge: eccefc748e0ed 0c84f5bf3eb32 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:51 2021 -0500 Merge branch 'remotes/lorenzo/pci/endpoint' - Add max-virtual-functions to endpoint binding (Kishon Vijay Abraham I) - Add pci_epf_add_vepf() API to add virtual function to endpoint (Kishon Vijay Abraham I) - Add pci_epf_vepf_link() to link virtual function to endpoint physical function (Kishon Vijay Abraham I) - Add virtual function number to pci_epc_ops endpoint ops interfaces (Kishon Vijay Abraham I) - Simplify register base address computation for endpoint BAR configuration (Kishon Vijay Abraham I) - Add support to configure virtual functions in cadence endpoint driver (Kishon Vijay Abraham I) - Add SR-IOV configuration to endpoint test driver (Kishon Vijay Abraham I) - Document configfs usage to create virtual functions for endpoints (Kishon Vijay Abraham I) * remotes/lorenzo/pci/endpoint: Documentation: PCI: endpoint/pci-endpoint-cfs: Guide to use SR-IOV misc: pci_endpoint_test: Populate sriov_configure ops to configure SR-IOV device PCI: cadence: Add support to configure virtual functions PCI: cadence: Simplify code to get register base address for configuring BAR PCI: endpoint: Add virtual function number in pci_epc ops PCI: endpoint: Add support to link a physical function to a virtual function PCI: endpoint: Add support to add virtual function in endpoint core dt-bindings: PCI: pci-ep: Add binding to specify virtual function commit eccefc748e0edbb3ae8be846c4cd17bc20397898 Merge: 09cfc9db2db1a de0a01f529665 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:51 2021 -0500 Merge branch 'remotes/lorenzo/pci/xilinx-nwl' - Document optional clock DT property (Michal Simek) - Enable PCIe ref clock (Hyun Kwon) * remotes/lorenzo/pci/xilinx-nwl: PCI: xilinx-nwl: Enable the clock through CCF dt-bindings: pci: xilinx-nwl: Document optional clock property commit 09cfc9db2db1a0c7a38033b16e2471c7c6becaf8 Merge: 4a4547db5612d 9e4ae52cabd8a Author: Bjorn Helgaas Date: Thu Sep 2 14:56:51 2021 -0500 Merge branch 'remotes/lorenzo/pci/xgene' - Remove redundant dev_err() after devm_ioremap_resource() (ErKun Yang) * remotes/lorenzo/pci/xgene: PCI: xgene-msi: Remove redundant dev_err() call in xgene_msi_probe() commit 4a4547db5612da9ac2404c014b258add369b5b16 Merge: db2d64f83703a f62750e6918d2 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:50 2021 -0500 Merge branch 'remotes/lorenzo/pci/tegra194' - Fix handling BME_CHGED event (Om Prakash Singh) - Fix MSI-X programming (Om Prakash Singh) - Disable interrupts before entering L2 (Om Prakash Singh) - Don't allow suspend when Tegra PCIe is in EP mode (Om Prakash Singh) * remotes/lorenzo/pci/tegra194: PCI: tegra194: Cleanup unused code PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode PCI: tegra194: Disable interrupts before entering L2 PCI: tegra194: Fix MSI-X programming PCI: tegra194: Fix handling BME_CHGED event commit db2d64f83703aca8d560abcf83166fac3d111d94 Merge: c2863b217edc1 fd44e8efccd4d Author: Bjorn Helgaas Date: Thu Sep 2 14:56:50 2021 -0500 Merge branch 'remotes/lorenzo/pci/tegra' - Remove unused struct tegra_pcie_bus (Krzysztof Wilczyński) * remotes/lorenzo/pci/tegra: PCI: tegra: make const array err_msg static PCI: tegra: Use 'seq_puts' instead of 'seq_printf' PCI: tegra: Fix OF node reference leak PCI: tegra: Remove unused struct tegra_pcie_bus commit c2863b217edc1438b275bfebc4815952964a3a61 Merge: c501cf9cbeacc a115b1bd3af0c Author: Bjorn Helgaas Date: Thu Sep 2 14:56:49 2021 -0500 Merge branch 'remotes/lorenzo/pci/rcar' - Fix runtime PM imbalance in rcar_pcie_ep_probe() (Dinghao Liu) * remotes/lorenzo/pci/rcar: PCI: rcar: Add L1 link state fix into data abort hook PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe() commit c501cf9cbeacc4cf2dfb03a20d27c3661ddd9643 Merge: af42a0d4a88b6 77216702c8f62 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:49 2021 -0500 Merge branch 'remotes/lorenzo/pci/mediatek' - Split DT bindings for PCIe controllers with independent MSI domains into separate nodes for MT2712/MT7622 (Chuanjia Liu) - Locate shared registers from "mediatek,generic-pciecfg" property (Chuanjia Liu) - Get IRQ from "pcie_irq" if "interrupt-names" property is present to fix an MSI issue (Chuanjia Liu) - Get PCI domain from "linux,pci-domain" property if present (Chuanjia Liu) * remotes/lorenzo/pci/mediatek: PCI: mediatek: Use PCI domain to handle ports detection PCI: mediatek: Add new method to get irq number PCI: mediatek: Add new method to get shared pcie-cfg base address dt-bindings: PCI: mediatek: Update the Device tree bindings commit af42a0d4a88b658e848d4c27732203a364788b2d Merge: c1bb1449fa8e3 0c87f90b4c135 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:48 2021 -0500 Merge branch 'remotes/lorenzo/pci/keembay' - Add Intel Keem Bay PCIe controller driver and DT binding (Srikanth Thokala) * remotes/lorenzo/pci/keembay: PCI: keembay: Add support for Intel Keem Bay dt-bindings: PCI: Add Intel Keem Bay PCIe controller commit c1bb1449fa8e3e769c0e7a5861bb49974fe63fb0 Merge: a1e4ca8eb963f aeaea8969b402 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:48 2021 -0500 Merge branch 'remotes/lorenzo/pci/iproc' - Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' (Rob Herring) - Fix BCMA probe resource handling (Rob Herring) * remotes/lorenzo/pci/iproc: PCI: iproc: Fix BCMA probe resource handling PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' commit a1e4ca8eb963f58fc9c2c26a971d86456ea717f5 Merge: 53cb14d256620 88f94c7f8f40d Author: Bjorn Helgaas Date: Thu Sep 2 14:56:47 2021 -0500 Merge branch 'remotes/lorenzo/pci/hyper-v' - Add domain_nr in struct pci_host_bridge (Boqun Feng) - Use host bridge MSI domain for root buses if present (Boqun Feng) - Allow ARM64 virtual host bridge with no ACPI companion (e.g., Hyper-V) (Boqun Feng) - Make Hyper-V enumeration more generic (Arnd Bergmann) - Set Hyper-V domain_nr at probe-time (Boqun Feng) - Set up Hyper-V MSI domain at bridge probe-time (Boqun Feng) - Enable Hyper-V bridge probing on ARM64 (Boqun Feng) * remotes/lorenzo/pci/hyper-v: PCI: hv: Turn on the host bridge probing on ARM64 PCI: hv: Set up MSI domain at bridge probing time PCI: hv: Set ->domain_nr of pci_host_bridge at probing time PCI: hv: Generify PCI probing arm64: PCI: Support root bridge preparation for Hyper-V arm64: PCI: Restructure pcibios_root_bridge_prepare() PCI: Support populating MSI domains of root buses via bridges PCI: Introduce domain_nr in pci_host_bridge commit 53cb14d2566205ed9a08649fdc59e9446adf0727 Merge: 2b5a949eea282 8f6a6b3c50ce1 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:47 2021 -0500 Merge branch 'remotes/lorenzo/pci/hv' - Support Hyper-V Create Interrupt v3 message (Sunil Muthuswamy) * remotes/lorenzo/pci/hv: PCI: hv: Support for create interrupt v3 commit 2b5a949eea282d03d1ace935936b1f73c5dd6cd7 Merge: 540267e236dd6 7c52009d94ab5 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:47 2021 -0500 Merge branch 'remotes/lorenzo/pci/cadence' - Convert bool in structs to bitfield (Kishon Vijay Abraham I) - Work around J7200 non-PCIe SERDES lane electrical issue that prevents PCIe link training (Nadeem Athani) - Add J7200 PCIe support to j721e (Kishon Vijay Abraham I) - Add AM64 PCIe support to j721e (Kishon Vijay Abraham I) - Add J7200 and AM64 device IDs to endpoint test (Kishon Vijay Abraham I) * remotes/lorenzo/pci/cadence: misc: pci_endpoint_test: Add deviceID for AM64 and J7200 PCI: j721e: Add PCIe support for AM64 PCI: j721e: Add PCIe support for J7200 PCI: cadence: Add quirk flag to set minimum delay in LTSSM Detect.Quiet state PCI: cadence: Use bitfield for *quirk_retrain_flag* instead of bool commit 540267e236dd66fc3cb7429c8e88e3077f9a735b Merge: a549a33c37ef0 d212dcee27c1f Author: Bjorn Helgaas Date: Thu Sep 2 14:56:46 2021 -0500 Merge branch 'remotes/lorenzo/pci/aardvark' - Fix PIO config access status checking (Evan Wang) - Increase config access polling delay to 1.5s (Pali Rohár) - Add PCIe Root Capabilities to bridge emulation (Pali Rohár) - Report Config Request Retry Status when Software Visibility enabled (Pali Rohár) - Add back configuration of PCIe resources from 'ranges' DT property and pay attention to DT size and CPU/PCI offset to fix issues with I/O port space (Pali Rohár) - Serialize masking and unmasking legacy INTx interrupts (Pali Rohár) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Fix masking and unmasking legacy INTx interrupts PCI: aardvark: Configure PCIe resources from 'ranges' DT property PCI: aardvark: Fix reporting CRS value PCI: pci-bridge-emul: Add PCIe Root Capabilities Register PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response PCI: aardvark: Fix checking for PIO status commit a549a33c37ef081593dff266f0c3a9e78a28bdf0 Merge: 0e52059a82567 89761eefc7ad5 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:46 2021 -0500 Merge branch 'pci/visconti' - Add Toshiba Visconti PCIe host controller driver (Nobuhiro Iwamatsu) * pci/visconti: MAINTAINERS: Add entries for Toshiba Visconti PCIe controller PCI: visconti: Add Toshiba Visconti PCIe host controller driver commit 0e52059a8256730f5c9555943b52fc115cdb3680 Merge: bd8bb4d097e4c 0e898eb8df4e3 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:45 2021 -0500 Merge branch 'pci/rockchip-dwc' - Add Rockchip RK356X host controller driver (Simon Xue) * pci/rockchip-dwc: PCI: rockchip-dwc: Add Rockchip RK356X host controller driver commit bd8bb4d097e4ca31c234b4dfce8b2efaf11d9889 Merge: dbf0b9bad0400 71121fdd79f56 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:45 2021 -0500 Merge branch 'pci/dwc' - Remove surplus break statement (Krzysztof Wilczyński) * pci/dwc: PCI: dwc: Remove surplus break statement after return commit dbf0b9bad040049cab56d39cc2a4d16f26135586 Merge: 739c4747a25af 30492c12d2324 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:45 2021 -0500 Merge branch 'pci/artpec6' - Remove surplus break statement and local code block (Krzysztof Wilczyński) * pci/artpec6: PCI: artpec6: Remove local code block from switch statement PCI: artpec6: Remove surplus break statement after return commit 739c4747a25af3a2571f69e4709f2b476a17d5d4 Merge: 74797618e2022 0da14a19493da Author: Bjorn Helgaas Date: Thu Sep 2 14:56:44 2021 -0500 Merge branch 'pci/misc' - Add pci_numachip_init() declaration (Krzysztof Wilczyński) - Allocate pci_dev_str_match_path() string atomically (Dan Carpenter) - Drop error message when Precision Time Measurement supported but not enabled (Jakub Kicinski) - Correct the pci_iomap.h header guard #endif comment (Jonathan Cameron) - Add schedule point in proc_bus_pci_read() (Krzysztof Wilczyński) - Make saved capability state private to core (Bjorn Helgaas) - Sync __pci_register_driver() stub for CONFIG_PCI=n (Andy Shevchenko) - Convert sta2x11 from PCI-DMA-API to generic DMA-API (Christophe JAILLET) * pci/misc: x86/PCI: sta2x11: switch from 'pci_' to 'dma_' API PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n PCI: Make saved capability state private to core PCI: Add schedule point in proc_bus_pci_read() PCI: Correct the pci_iomap.h header guard #endif comment PCI/PTM: Remove error message at boot PCI: Fix pci_dev_str_match_path() alloc while atomic bug x86/PCI: Add pci_numachip_init() declaration # Conflicts: # include/linux/pci.h commit 74797618e2022dfcd923f1ea8903ba4959f746a4 Merge: 1295d187abfb8 2c208abd4f9ef Author: Bjorn Helgaas Date: Thu Sep 2 14:56:44 2021 -0500 Merge branch 'pci/vpd' - Check Resource Item Names against those defined for type (Bjorn Helgaas) - Treat initial 0xff as missing EEPROM (Heiner Kallweit) - Reject resource tags with invalid size (Bjorn Helgaas) - Don't check Large Resource Item Names for validity (Bjorn Helgaas) - Allow access to valid parts of VPD if some is invalid (Bjorn Helgaas) - Remove pci_vpd_size() old_size argument (Heiner Kallweit) - Make pci_vpd_wait() uninterruptible (Heiner Kallweit) - Remove struct pci_vpd.flag (Heiner Kallweit) - Remove struct pci_vpd_ops (Heiner Kallweit) - Remove struct pci_vpd.valid member (Heiner Kallweit) - Embed struct pci_vpd in struct pci_dev (Heiner Kallweit) - Determine VPD size in pci_vpd_init() (Heiner Kallweit) - Treat invalid VPD like missing VPD capability (Heiner Kallweit) - Add pci_vpd_alloc() to allocate buffer and read VPD into it (Heiner Kallweit) - Add pci_vpd_find_ro_info_keyword() (Heiner Kallweit) - Add pci_vpd_check_csum() (Heiner Kallweit) - Add pci_vpd_find_id_string() (Heiner Kallweit) - Read VPD with pci_vpd_alloc() (bnx2x, bnxt, sfc, sfc falcon, tg3 drivers) (Heiner Kallweit) - Search VPD with pci_vpd_find_ro_info_keyword() (bnx2, bnx2x, bnxt, cxgb4, cxlflash SCSI, sfc, sfc falcon, tg3 drivers) (Heiner Kallweit) - Search VPD with pci_vpd_find_id_string() (cxgb4 driver) (Heiner Kallweit) - Validate VPD checksum with pci_vpd_check_csum() (cxgb4, tg3 drivers) (Heiner Kallweit) - Replace open-coded byte swapping with swab32s() in bnx2 (Heiner Kallweit) - Remove unused vpd_param member ec (Heiner Kallweit) - Stop exporting pci_vpd_find_tag(), pci_vpd_find_info_keyword() (Heiner Kallweit) - Move several VPD defines and inlines to internal PCI core (Heiner Kallweit) * pci/vpd: PCI/VPD: Use unaligned access helpers PCI/VPD: Clean up public VPD defines and inline functions cxgb4: Use pci_vpd_find_id_string() to find VPD ID string PCI/VPD: Add pci_vpd_find_id_string() PCI/VPD: Include post-processing in pci_vpd_find_tag() PCI/VPD: Stop exporting pci_vpd_find_info_keyword() PCI/VPD: Stop exporting pci_vpd_find_tag() scsi: cxlflash: Search VPD with pci_vpd_find_ro_info_keyword() cxgb4: Search VPD with pci_vpd_find_ro_info_keyword() cxgb4: Remove unused vpd_param member ec cxgb4: Validate VPD checksum with pci_vpd_check_csum() bnxt: Search VPD with pci_vpd_find_ro_info_keyword() bnxt: Read VPD with pci_vpd_alloc() bnx2x: Search VPD with pci_vpd_find_ro_info_keyword() bnx2x: Read VPD with pci_vpd_alloc() bnx2: Replace open-coded byte swapping with swab32s() bnx2: Search VPD with pci_vpd_find_ro_info_keyword() sfc: falcon: Search VPD with pci_vpd_find_ro_info_keyword() sfc: falcon: Read VPD with pci_vpd_alloc() tg3: Search VPD with pci_vpd_find_ro_info_keyword() tg3: Validate VPD checksum with pci_vpd_check_csum() tg3: Read VPD with pci_vpd_alloc() sfc: Search VPD with pci_vpd_find_ro_info_keyword() sfc: Read VPD with pci_vpd_alloc() PCI/VPD: Add pci_vpd_check_csum() PCI/VPD: Add pci_vpd_find_ro_info_keyword() PCI/VPD: Add pci_vpd_alloc() PCI/VPD: Treat invalid VPD like missing VPD capability PCI/VPD: Determine VPD size in pci_vpd_init() PCI/VPD: Embed struct pci_vpd in struct pci_dev PCI/VPD: Remove struct pci_vpd.valid member PCI/VPD: Remove struct pci_vpd_ops PCI/VPD: Reorder pci_read_vpd(), pci_write_vpd() PCI/VPD: Remove struct pci_vpd.flag PCI/VPD: Make pci_vpd_wait() uninterruptible PCI/VPD: Remove pci_vpd_size() old_size argument PCI/VPD: Allow access to valid parts of VPD if some is invalid PCI/VPD: Don't check Large Resource Item Names for validity PCI/VPD: Reject resource tags with invalid size PCI/VPD: Treat initial 0xff as missing EEPROM PCI/VPD: Check Resource Item Names against those valid for type PCI/VPD: Correct diagnostic for VPD read failure commit 1295d187abfb80514240ea3179b722a2d8f7871d Merge: 9045f63e67bc9 7cae7849fccee Author: Bjorn Helgaas Date: Thu Sep 2 14:56:43 2021 -0500 Merge branch 'pci/virtualization' - Add ACS quirks for NXP LX2xx0 and LX2xx2 platforms (Wasim Khan) - Add ACS quirks for Cavium multi-function devices (George Cherian) - Enforce pci=noats with Transaction Blocking (Alex Williamson) * pci/virtualization: PCI/ACS: Enforce pci=noats with Transaction Blocking PCI: Add ACS quirks for Cavium multi-function devices PCI: Add ACS quirks for NXP LX2xx0 and LX2xx2 platforms commit 9045f63e67bc91f02be245346fff9fb9703e7a3c Merge: e210d9fc0903e ca32b5310a1a3 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:43 2021 -0500 Merge branch 'pci/resource' - Refactor pci_ioremap_bar() and pci_ioremap_wc_bar() (Krzysztof Wilczyński) - Optimize pci_resource_len() to reduce kernel size (Zhen Lei) * pci/resource: PCI: Optimize pci_resource_len() to reduce kernel size PCI: Refactor pci_ioremap_bar() and pci_ioremap_wc_bar() commit e210d9fc0903e83aa018a32227f7ff529e593004 Merge: 34627f4dcd0f4 9bdc81ce440ec Author: Bjorn Helgaas Date: Thu Sep 2 14:56:42 2021 -0500 Merge branch 'pci/reset' - Cache PCIe Device Capabilities register (Amey Narkhede) - Add pcie_reset_flr() with 'probe' argument (Amey Narkhede) - Add pdev->reset_methods[] array to track reset method ordering (Amey Narkhede) - Remove reset_fn field from pci_dev (Amey Narkhede) - Add sysfs interface to query and set device reset mechanism (Amey Narkhede) - Add pci_set_acpi_fwnode() to set ACPI_COMPANION (Shanker Donthineni) - Use acpi_pci_power_manageable() instead of duplicating logic (Shanker Donthineni) - Set ACPI fwnode early and at the same time with OF (Shanker Donthineni) - Add support for ACPI _RST reset method (Shanker Donthineni) - Change reset function 'probe' argument to bool (Amey Narkhede) * pci/reset: PCI: Change the type of probe argument in reset functions PCI: Add support for ACPI _RST reset method PCI: Setup ACPI fwnode early and at the same time with OF PCI: Use acpi_pci_power_manageable() PCI: Add pci_set_acpi_fwnode() to set ACPI_COMPANION PCI: Allow userspace to query and set device reset mechanism PCI: Remove reset_fn field from pci_dev PCI: Add array to track reset method ordering PCI: Add pcie_reset_flr() with 'probe' argument PCI: Cache PCIe Device Capabilities register commit 34627f4dcd0f4fefab9e0eb88a45aad4178064f7 Merge: 03816e7f78877 00823dcbdd415 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:42 2021 -0500 Merge branch 'pci/portdrv' - Enable Bandwidth Notification only if port supports it (Stuart Hayes) * pci/portdrv: PCI/portdrv: Enable Bandwidth Notification only if port supports it commit 03816e7f7887747548fc2ced59933cd421bf0cf8 Merge: 9d102c7437247 d21faba11693c Author: Bjorn Helgaas Date: Thu Sep 2 14:56:42 2021 -0500 Merge branch 'pci/irq' - Convert irq_find_mapping() + generic_handle_irq() to generic_handle_domain_irq() (Marc Zyngier) * pci/irq: PCI: Bulk conversion to generic_handle_domain_irq() commit 9d102c7437247a909dd6f46cbda11cde5526f7b6 Merge: 4f6f0b86d3605 8304a3a199eeb Author: Bjorn Helgaas Date: Thu Sep 2 14:56:41 2021 -0500 Merge branch 'pci/iommu' - Allow PASID on fake PCIe devices, e.g., HiSilicon KunPeng920 and KunPeng930 AMBA devices, without TLP prefixes (Zhangfei Gao) - Allow SVA / dma-can-stall on fake PCIe devices (Zhangfei Gao) * pci/iommu: PCI: Set dma-can-stall for HiSilicon chips PCI: Allow PASID on fake PCIe devices without TLP prefixes commit 4f6f0b86d3605464865e9a9d60b5e88f88f03783 Merge: 52d44f3c61975 faa2e05ad0dcc Author: Bjorn Helgaas Date: Thu Sep 2 14:56:41 2021 -0500 Merge branch 'pci/hotplug' - Fix ibmphp double unmap of io_mem (Vishal Aslot) * pci/hotplug: PCI: ibmphp: Fix double unmap of io_mem commit 52d44f3c61975cacfa2379a94e470b33a7639e73 Merge: e73f0f0ee7541 d6b1715999fc2 Author: Bjorn Helgaas Date: Thu Sep 2 14:56:40 2021 -0500 Merge branch 'pci/enumeration' - Call Max Payload Size-related fixup quirks early, so they're considered by pci_configure_mps() (Marek Behún) - Restrict Max Payload Size Supported to work around ASMedia ASM1062 SATA erratum (Marek Behún) - Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure (Krzysztof Wilczyński) * pci/enumeration: PCI: Return int from pciconfig_read() syscall PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported PCI: Call Max Payload Size-related fixup quirks early commit aeef8b5089b76852bd84889f2809e69a7cfb414e Author: Jeff Moyer Date: Wed Aug 11 17:07:37 2021 -0400 x86/pat: Pass valid address to sanitize_phys() The end address passed to memtype_reserve() is handed directly to sanitize_phys(). However, end is exclusive and sanitize_phys() expects an inclusive address. If end falls at the end of the physical address space, sanitize_phys() will return 0. This can result in drivers failing to load, and the following warning: WARNING: CPU: 26 PID: 749 at arch/x86/mm/pat.c:354 reserve_memtype+0x262/0x450 reserve_memtype failed: [mem 0x3ffffff00000-0xffffffffffffffff], req uncached-minus Call Trace: [] reserve_memtype+0x262/0x450 [] ioremap_nocache+0x1a/0x20 [] mpt3sas_base_map_resources+0x151/0xa60 [mpt3sas] [] mpt3sas_base_attach+0xf5/0xa50 [mpt3sas] ---[ end trace 6d6eea4438db89ef ]--- ioremap reserve_memtype failed -22 mpt3sas_cm0: unable to map adapter memory! or resource not found mpt3sas_cm0: failure at drivers/scsi/mpt3sas/mpt3sas_scsih.c:10597/_scsih_probe()! Fix this by passing the inclusive end address to sanitize_phys(). Fixes: 510ee090abc3 ("x86/mm/pat: Prepare {reserve, free}_memtype() for "decoy" addresses") Signed-off-by: Jeff Moyer Signed-off-by: Thomas Gleixner Reviewed-by: David Hildenbrand Reviewed-by: Dan Williams Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/x49o8a3pu5i.fsf@segfault.boston.devel.redhat.com commit aef4892a63c248c31718d23941536b86829a49f0 Merge: b55060d796c53 cb181da161963 Author: Linus Torvalds Date: Thu Sep 2 12:51:41 2021 -0700 Merge tag 'integrity-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity subsystem updates from Mimi Zohar: - Limit the allowed hash algorithms when writing security.ima xattrs or verifying them, based on the IMA policy and the configured hash algorithms. - Return the calculated "critical data" measurement hash and size to avoid code duplication. (Preparatory change for a proposed LSM.) - and a single patch to address a compiler warning. * tag 'integrity-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: IMA: reject unknown hash algorithms in ima_get_hash_algo IMA: prevent SETXATTR_CHECK policy rules with unavailable algorithms IMA: introduce a new policy option func=SETXATTR_CHECK IMA: add a policy option to restrict xattr hash algorithms on appraisal IMA: add support to restrict the hash algorithms used for file appraisal IMA: block writes of the security.ima xattr with unsupported algorithms IMA: remove the dependency on CRYPTO_MD5 ima: Add digest and digest_len params to the functions to measure a buffer ima: Return int in the functions to measure a buffer ima: Introduce ima_get_current_hash_algo() IMA: remove -Wmissing-prototypes warning commit dd8f6b299a2b86c4839de4a60a28ce2399453bc0 Author: Liang Chen Date: Mon Jul 26 11:03:54 2021 +0200 dt-bindings: pwm: rockchip: Add description for rk3568 Add "rockchip,rk3568-pwm", "rockchip,rk3328-pwm" compatible strings for PWM nodes found on a rk3568 platform. Signed-off-by: Liang Chen Signed-off-by: Heiko Stuebner Acked-by: Uwe Kleine-König Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 8083f58d08fd52f547c0a62c0f4e448e15e6726b Author: Uwe Kleine-König Date: Wed Jul 7 18:28:35 2021 +0200 pwm: Make pwmchip_remove() return void Since some time pwmchip_remove() always returns 0 so the return value isn't usefull. Now that all callers are converted to ignore its value the function can be changed to return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 7587f8a863ce4a5514802eeaed48f60663d69179 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:34 2021 +0200 pwm: sun4i: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of sun4i_pwm_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit ceb2c2842f3664dcc4e6d8cb317e1e83bb81b1e5 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:33 2021 +0200 pwm: sifive: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pwm_sifive_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 4e334973541de4d31c20be22d6198c646f58eb81 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:32 2021 +0200 pwm: samsung: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pwm_samsung_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 81d4b5c449ced26685c736eaaa6a7093d87e3891 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:31 2021 +0200 pwm: renesas-tpu: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of tpu_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 15d217614fcfde5386f4ebf7c74c6e98df2777c0 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:30 2021 +0200 pwm: rcar: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of rcar_pwm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit f0e96e2e2cb292594483b0ff3cd00b45e386c45f Author: Uwe Kleine-König Date: Wed Jul 7 18:28:29 2021 +0200 pwm: pca9685: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pca9685_pwm_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit faaa2222213b0c44e4f477c93d6f980e0156cda8 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:28 2021 +0200 pwm: omap-dmtimer: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pwm_omap_dmtimer_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 9b7b5736ffd5da6f8f6329ebe5f1829cbcf8afae Author: Uwe Kleine-König Date: Wed Jul 7 18:28:27 2021 +0200 pwm: mtk-disp: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of mtk_disp_pwm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit bfecbc9490dcbe7a32d554dfd3d0f34bf17f10d8 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:26 2021 +0200 pwm: imx-tpm: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pwm_imx_tpm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit fc3f3f565eacf6d2d9aab9f065612a9a5152d879 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:25 2021 +0200 pwm: img: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pwm_imx_tpm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a08be12771c0c212790953b65b897e8f551eaa0e Author: Uwe Kleine-König Date: Wed Jul 7 18:28:24 2021 +0200 pwm: cros-ec: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of cros_ec_pwm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b4334246cc3d7b6163f6bc2f96f56676967e93b4 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:23 2021 +0200 pwm: brcmstb: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of brcmstb_pwm_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 319333b0c48e98fe84e81c1f68384353dc37dd61 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:22 2021 +0200 pwm: atmel-tcb: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of atmel_tcb_pwm_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 632927511c3a362989625b38d7f70080cab8d8b0 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:21 2021 +0200 pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of atmel_hlcdc_pwm_remove() and considers the device removed anyhow. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a75bc6b783ab5844d70cc54314c593de34782844 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:20 2021 +0200 pwm: twl: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c9bb1c9e5460f6e84e95b65fe4c5bb09d5dff10a Author: Uwe Kleine-König Date: Wed Jul 7 18:28:19 2021 +0200 pwm: twl-led: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a64a5853a827147b36abecd5aabab11d07d67177 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:18 2021 +0200 pwm: tiecap: Simplify using devm_pwmchip_add() With devm_pwmchip_add() there is no need to explicitly call pwmchip_remove(), so this call can be dropped from the remove callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 8614e210083e7ef135719e00bbc81e10f3f53286 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:17 2021 +0200 pwm: stm32-lp: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 02dd2e417e7dfe63c810d356175b560e12c8fb8c Author: Uwe Kleine-König Date: Wed Jul 7 18:28:16 2021 +0200 pwm: sl28cpld: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b7783c62581523fbb66e4624d5f90f190b1f8036 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:15 2021 +0200 pwm: raspberrypi-poe: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 97f290357df22c0564a8addb782875e6275b7479 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:14 2021 +0200 pwm: pxa: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 9c3fac7aaf27f7f026a22087605a67683adfd551 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:13 2021 +0200 pwm: ntxec: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 43f5f48d095c31e67777c41ad3ee65186f384b03 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:12 2021 +0200 pwm: mxs: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e0150252a6437d12de3db84bb3af12bd5aa5cc70 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:11 2021 +0200 pwm: mediatek: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit da68a9f4b03cb090bf725595815782a5c6b38937 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:10 2021 +0200 pwm: lpc32xx: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 071beb7c5ee37e778f8a85c95e271d93f0e6ffef Author: Uwe Kleine-König Date: Wed Jul 7 18:28:09 2021 +0200 pwm: lp3943: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 0aa2bec5a8ed0f5f3c01f218f7bd37981f043de9 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:08 2021 +0200 pwm: keembay: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit f0d6d7f26007907b108ed3624c641dc7614da505 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:07 2021 +0200 pwm: jz4740: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2e27afd0557f76a036183e0db3507aa94aab61bd Author: Uwe Kleine-König Date: Wed Jul 7 18:28:06 2021 +0200 pwm: iqs620a: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit d8c11a6505d277025e3b5a0ed29d65ed990f65cc Author: Uwe Kleine-König Date: Wed Jul 7 18:28:05 2021 +0200 pwm: intel-lgm: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit acfdc2030a773a7ca9c94bdeb32e943159fc1f9a Author: Uwe Kleine-König Date: Wed Jul 7 18:28:04 2021 +0200 pwm: imx27: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 5ba3eb4bb3b5d3742805b799b965a4bc9e0ab7a6 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:03 2021 +0200 pwm: fsl-ftm: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a0b336a35216b0f45c221824097757e12231e33e Author: Uwe Kleine-König Date: Wed Jul 7 18:28:02 2021 +0200 pwm: ep93xx: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit ccc2df6f802b527d684c0fe171f3f4c9f883b833 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:01 2021 +0200 pwm: bcm-kona: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 14ac9e17f9bd4bd0dfe18e384a3c2ca8dfbffcc8 Author: Uwe Kleine-König Date: Wed Jul 7 18:28:00 2021 +0200 pwm: ab8500: Simplify using devm_pwmchip_add() This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit cf83f7b7ae765e3d5eed65f8186c8d6ff320722d Author: Uwe Kleine-König Date: Wed Jul 7 18:27:59 2021 +0200 pwm: keembay: Improve compile coverage by allowing to enable on !ARM64 There are no arm64 specific constructs in this driver and it compiles just fine with ARCH=arm. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2ee4bc91b62e8ff2d8ffd4f1a4a02a36ad7a4f3b Author: Uwe Kleine-König Date: Wed Jul 7 18:27:58 2021 +0200 pwm: jz4740: Improve compile coverage by allowing to enable on !MIPS There are no mips specific constructs in this driver and it compiles just fine with ARCH=arm. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 97966ade662e912cbbbf4ff101baccf8b0bac9ae Author: Uwe Kleine-König Date: Wed Jul 7 18:27:57 2021 +0200 pwm: ntxec: Drop useless assignment to struct pwmchip::base Since commit f9a8ee8c8bcd ("pwm: Always allocate PWM chip base ID dynamically") there is no effect any more for assigning this variable. When the patch resulting in f9a8ee8c8bcd was created, this driver didn't exist yet, so this was missed. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1a0c97b6460f30d8b164eaef07d77369e466dda3 Author: Uwe Kleine-König Date: Wed Jul 7 18:27:56 2021 +0200 pwm: tiehrpwm: Unprepare clock only after the PWM was unregistered The driver is supposed to stay functional until pwmchip_remove() returns. So disable clocks only after that. pwmchip_remove() always returns 0, so the return code can be ignored which keeps ehrpwm_pwm_remove() a bit simpler and eventually allows to make pwmchip_remove() return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 84ea61f65d7016dd9a087ef40c4da09f0deaa648 Author: Uwe Kleine-König Date: Wed Jul 7 18:27:55 2021 +0200 pwm: rockchip: Unprepare clocks only after the PWM was unregistered The driver is supposed to stay functional until pwmchip_remove() returns. So disable clocks only after that. pwmchip_remove() always returns 0, so the return code can be ignored which keeps rockchip_pwm_remove() a bit simpler and allows to eventually make pwmchip_remove() return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 04d775210fb99609b1725ca33313da908a40d767 Author: Uwe Kleine-König Date: Wed Jul 7 18:27:54 2021 +0200 pwm: hibvt: Disable the clock only after the PWM was unregistered The driver is supposed to stay functional until pwmchip_remove() returns. So disable clocks and reset the hardware only after that. The return value of pwmchip_remove doesn't need to be checked because it returns zero anyhow and should be changed to return void eventually. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit d44084c93427bb0a9261432db1a8ca76a42d805e Author: Uwe Kleine-König Date: Wed Jul 7 18:27:53 2021 +0200 pwm: stm32-lp: Don't modify HW state in .remove() callback A consumer is expected to disable a PWM before calling pwm_put(). And if they didn't there is hopefully a good reason (or the consumer needs fixing). Also if disabling an enabled PWM was the right thing to do, this should better be done in the framework instead of in each low level driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 9d768cd7fd42bb0be16f36aec48548fca5260759 Author: Uwe Kleine-König Date: Wed Jul 7 18:27:52 2021 +0200 pwm: rockchip: Don't modify HW state in .remove() callback A consumer is expected to disable a PWM before calling pwm_put(). And if they didn't there is hopefully a good reason (or the consumer needs fixing). Also if disabling an enabled PWM was the right thing to do, this should better be done in the framework instead of in each low level driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c68eb29c8e9067c08175dd0414f6984f236f719d Author: Uwe Kleine-König Date: Wed Jul 7 18:27:51 2021 +0200 pwm: img: Don't modify HW state in .remove() callback A consumer is expected to disable a PWM before calling pwm_put(). And if they didn't there is hopefully a good reason (or the consumer needs fixing). Also if disabling an enabled PWM was the right thing to do, this should better be done in the framework instead of in each low level driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 020162d6f49f2963062229814a56a89c86cbeaa8 Author: Uwe Kleine-König Date: Wed Jul 7 18:27:50 2021 +0200 pwm: mxs: Don't modify HW state in .probe() after the PWM chip was registered This fixes a race condition: After pwmchip_add() is called there might already be a consumer and then modifying the hardware behind the consumer's back is bad. So reset before calling pwmchip_add(). Note that reseting the hardware isn't the right thing to do if the PWM is already running as it might e.g. disable (or even enable) a backlight that is supposed to be on (or off). Fixes: 4dce82c1e840 ("pwm: add pwm-mxs support") Cc: Sascha Hauer Cc: Shawn Guo Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 3d2813fb17e5fd0d73c1d1442ca0192bde4af10e Author: Uwe Kleine-König Date: Wed Jul 7 18:27:49 2021 +0200 pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered This fixes a race condition: After pwmchip_add() is called there might already be a consumer and then modifying the hardware behind the consumer's back is bad. So set the default before. (Side-note: I don't know what this register setting actually does, if this modifies the polarity there is an inconsistency because the inversed polarity isn't considered if the PWM is already running during .probe().) Fixes: acfd92fdfb93 ("pwm: lpc32xx: Set PWM_PIN_LEVEL bit to default value") Cc: Sylvain Lemieux Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b55060d796c5300ad7a410cb5faec36582925570 Merge: c815f04ba9494 a8fc576d4af2f Author: Linus Torvalds Date: Thu Sep 2 12:35:34 2021 -0700 Merge tag 'hardening-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening updates from Kees Cook: - Expand lib/test_stackinit to include more initialization styles - Improve Kconfig for CLang's auto-var-init feature - Introduce support for GCC's zero-call-used-regs feature * tag 'hardening-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lib/test_stackinit: Add assigned initializers lib/test_stackinit: Allow building stand-alone lib/test_stackinit: Fix static initializer test hardening: Clarify Kconfig text for auto-var-init hardening: Introduce CONFIG_ZERO_CALL_USED_REGS commit eb41f334589d66b9da6f2b1acf7963ef8ca8d94e Author: Uwe Kleine-König Date: Mon Jul 5 18:55:10 2021 +0200 pwm: ab8500: Fix register offset calculation to not depend on probe order The assumption that lead to commit 5e5da1e9fbee ("pwm: ab8500: Explicitly allocate pwm chip base dynamically") was wrong: The pwm-ab8500 devices are not directly instantiated from device tree, but from the ab8500 mfd driver. So the pdev->id isn't -1, but a number between 1 and 3. Now that pwmchip ids are always allocated dynamically, this cannot easily be reverted. Introduce a new member in the driver data struct that tracks the hardware id and use this to calculate the register offset. Side-note: Using chip->base to calculate the offset was never robust because if there was already a PWM with id 1 at the time ab8500-pwm.1 was probed, the associated pwmchip would get assigned chip->base = 2 (or something bigger). Fixes: 5e5da1e9fbee ("pwm: ab8500: Explicitly allocate pwm chip base dynamically") Fixes: 6173f8f4ed9c ("pwm: Move AB8500 PWM driver to PWM framework") Signed-off-by: Uwe Kleine-König Acked-by: Linus Walleij Signed-off-by: Thierry Reding commit 52eaba4cedbda728f78d7083a05725e537b3df91 Author: Uwe Kleine-König Date: Wed Apr 21 11:26:08 2021 +0200 pwm: atmel: Rework tracking updates pending in hardware This improves the driver's behavior in several ways: - The lock is held for shorter periods and so a channel that is currently waited for doesn't block disabling another channel. - It's easier to understand because the procedure is split into more semantic units and documentation is improved - A channel is only set to pending when such an event is actually scheduled in hardware (by writing the CUPD register). - Also wait in .get_state() to report the last configured state instead of (maybe) the previous one. This fixes the read back duty cycle and so prevents a warning being emitted when PWM_DEBUG is on. Tested on an AriettaG25. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c815f04ba94940fbc303a6ea9669e7da87f8e77d Merge: 612b23f27793e acd8e8407b8fc Author: Linus Torvalds Date: Thu Sep 2 12:32:12 2021 -0700 Merge tag 'linux-kselftest-kunit-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: "This KUnit update for Linux 5.15-rc1 adds new features and tests: Tool: - support for '--kernel_args' to allow setting module params - support for '--raw_output' option to show just the kunit output during make Tests: - new KUnit tests for checksums and timestamps - Print test statistics on failure - Integrates UBSAN into the KUnit testing framework. It fails KUnit tests whenever it reports undefined behavior" * tag 'linux-kselftest-kunit-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: Print test statistics on failure kunit: tool: make --raw_output support only showing kunit output kunit: tool: add --kernel_args to allow setting module params kunit: ubsan integration fat: Add KUnit tests for checksums and timestamps commit 612b23f27793ea1cf41621ca6dc552eb4699f41c Merge: 4a3bb4200a595 e888fa7bb882a Author: Linus Torvalds Date: Thu Sep 2 12:26:31 2021 -0700 Merge tag 'memblock-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock updates from Mike Rapoport: "Robustness and debug improvements: - add check for memory add/cap ordering - add missing debug code to memblock_add_node()" * tag 'memblock-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: Check memory add/cap ordering memblock: Add missing debug code to memblock_add_node() commit 4a3bb4200a5958d76cc26ebe4db4257efa56812b Merge: eceae1e7acaef c1dec343d7abd Author: Linus Torvalds Date: Thu Sep 2 10:32:06 2021 -0700 Merge tag 'dma-mapping-5.15' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - fix debugfs initialization order (Anthony Iliopoulos) - use memory_intersects() directly (Kefeng Wang) - allow to return specific errors from ->map_sg (Logan Gunthorpe, Martin Oliveira) - turn the dma_map_sg return value into an unsigned int (me) - provide a common global coherent pool іmplementation (me) * tag 'dma-mapping-5.15' of git://git.infradead.org/users/hch/dma-mapping: (31 commits) hexagon: use the generic global coherent pool dma-mapping: make the global coherent pool conditional dma-mapping: add a dma_init_global_coherent helper dma-mapping: simplify dma_init_coherent_memory dma-mapping: allow using the global coherent pool for !ARM ARM/nommu: use the generic dma-direct code for non-coherent devices dma-direct: add support for dma_coherent_default_memory dma-mapping: return an unsigned int from dma_map_sg{,_attrs} dma-mapping: disallow .map_sg operations from returning zero on error dma-mapping: return error code from dma_dummy_map_sg() x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: return error code from gart_map_sg() xen: swiotlb: return error code from xen_swiotlb_map_sg() parisc: return error code from .map_sg() ops sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: return error codes from .map_sg() ops s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: return error code from s390_dma_map_sg() powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: return error code from .map_sg() ops ... commit eceae1e7acaefc0a71e4dd4b8cd49270172b4731 Merge: 265113f70f3d6 c42dd069be8df Author: Linus Torvalds Date: Thu Sep 2 10:27:17 2021 -0700 Merge tag 'configfs-5.15' of git://git.infradead.org/users/hch/configfs Pull configfs updates from Christoph Hellwig: - fix a race in configfs_lookup (Sishuai Gong) - minor cleanups (me) * tag 'configfs-5.15' of git://git.infradead.org/users/hch/configfs: configfs: fix a race in configfs_lookup() configfs: fold configfs_attach_attr into configfs_lookup configfs: simplify the configfs_dirent_is_ready configfs: return -ENAMETOOLONG earlier in configfs_lookup commit 265113f70f3d63ae8b6eb1ce4303d14dbbd71b2d Merge: b0cfcdd9b9672 ecd95673142ef Author: Linus Torvalds Date: Thu Sep 2 10:19:45 2021 -0700 Merge tag 'dlm-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This set includes a number of minor fixes and cleanups related to the networking changes in the last release. A patch to delay ack messages reduces network traffic significantly" * tag 'dlm-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: fs: dlm: avoid comms shutdown delay in release_lockspace fs: dlm: fix return -EINTR on recovery stopped fs: dlm: implement delayed ack handling fs: dlm: move receive loop into receive handler fs: dlm: fix multiple empty writequeue alloc fs: dlm: generic connect func fs: dlm: auto load sctp module fs: dlm: introduce generic listen fs: dlm: move to static proto ops fs: dlm: introduce con_next_wq helper fs: dlm: cleanup and remove _send_rcom fs: dlm: clear CF_APP_LIMITED on close fs: dlm: fix typo in tlv prefix fs: dlm: use READ_ONCE for config var fs: dlm: use sk->sk_socket instead of con->sock commit 3146cba99aa284b1d4a10fbd923df953f1d18035 Author: Jens Axboe Date: Wed Sep 1 11:20:10 2021 -0600 io-wq: make worker creation resilient against signals If a task is queueing async work and also handling signals, then we can run into the case where create_io_thread() is interrupted and returns failure because of that. If this happens for creating the first worker in a group, then that worker will never get created and we can hang the ring. If we do get a fork failure, retry from task_work. With signals we have to be a bit careful as we cannot simply queue as task_work, as we'll still have signals pending at that point. Punt over a normal workqueue first and then create from task_work after that. Lastly, ensure that we handle fatal worker creations. Worker creation failures are normally not fatal, only if we fail to create one in an empty worker group can we not make progress. Right now that is ignored, ensure that we handle that and run cancel on the work item. There are two paths that create new workers - one is the "existing worker going to sleep", and the other is "no workers found for this work, create one". The former is never fatal, as workers do exist in the group. Only the latter needs to be carefully handled. Signed-off-by: Jens Axboe commit 05c5f4ee4da7086cceacc78bf3a080e314c241fa Author: Jens Axboe Date: Wed Sep 1 13:01:17 2021 -0600 io-wq: get rid of FIXED worker flag It makes the logic easier to follow if we just get rid of the fixed worker flag, and simply ensure that we never exit the last worker in the group. This also means that no particular worker is special. Just track the last timeout state, and if we have hit it and no work is pending, check if there are other workers. If yes, then we can exit this one safely. Signed-off-by: Jens Axboe commit b0cfcdd9b9672ea90642f33d6c0dd8516553adf2 Author: Linus Torvalds Date: Fri Jul 16 14:01:12 2021 -0700 d_path: make 'prepend()' fill up the buffer exactly on overflow Instead of just marking the buffer as having overflowed, fill it up as much as we can. That will allow the overflow case to then return whatever truncated result if it wants to. Cc: Al Viro Signed-off-by: Linus Torvalds commit faa2e05ad0dccf37f995bcfbb8d1980d66c02c11 Author: Vishal Aslot Date: Wed Aug 18 11:57:51 2021 -0500 PCI: ibmphp: Fix double unmap of io_mem ebda_rsrc_controller() calls iounmap(io_mem) on the error path. Its caller, ibmphp_access_ebda(), also calls iounmap(io_mem) on good and error paths. Remove the iounmap(io_mem) invocation from ebda_rsrc_controller(). [bhelgaas: remove item from TODO] Link: https://lore.kernel.org/r/20210818165751.591185-1-os.vaslot@gmail.com Signed-off-by: Vishal Aslot Signed-off-by: Bjorn Helgaas commit 7661809d493b426e979f39ab512e3adf41fbcc69 Author: Linus Torvalds Date: Wed Jul 14 09:45:49 2021 -0700 mm: don't allow oversized kvmalloc() calls 'kvmalloc()' is a convenience function for people who want to do a kmalloc() but fall back on vmalloc() if there aren't enough physically contiguous pages, or if the allocation is larger than what kmalloc() supports. However, let's make sure it doesn't get _too_ easy to do crazy things with it. In particular, don't allow big allocations that could be due to integer overflow or underflow. So make sure the allocation size fits in an 'int', to protect against trivial integer conversion issues. Acked-by: Willy Tarreau Cc: Kees Cook Signed-off-by: Linus Torvalds commit 851c8e761c393a63d6346b472ae40b4ef74eba1f Author: Luca Coelho Date: Wed Sep 1 13:14:12 2021 +0300 iwlwifi: bump FW API to 66 for AX devices Start supporting API version 66 for AX devices. Th iwlwifi FW API is frozen every 6 weeks, so we need to bump the newest version number that the driver supports accordingly. In this specific case, support for new HW will only be possible with the new FW version. This change still keeps backwards compatibility with older FW API versions for existing devices. Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210901101412.300012-1-luca@coelho.fi commit 2f32c147a3816d789722c0bd242a9431332ec3ed Author: Justin M. Forbes Date: Fri Jul 2 17:31:53 2021 -0500 iwlwifi Add support for ax201 in Samsung Galaxy Book Flex2 Alpha The Samsung Galaxy Book Flex2 Alpha uses an ax201 with the ID a0f0/6074. This works fine with the existing driver once it knows to claim it. Simple patch to add the device. Signed-off-by: Justin M. Forbes Reviewed-by: Jaehoon Chung Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210702223155.1981510-1-jforbes@fedoraproject.org commit 111c1aa8cad4a0069dfe98fc093507b5b2cdfda7 Merge: 815409a12c0a9 baaae979b1126 Author: Linus Torvalds Date: Thu Sep 2 09:37:09 2021 -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: "In addition to some ext4 bug fixes and cleanups, this cycle we add the orphan_file feature, which eliminates bottlenecks when doing a large number of parallel truncates and file deletions, and move the discard operation out of the jbd2 commit thread when using the discard mount option, to better support devices with slow discard operations" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (23 commits) ext4: make the updating inode data procedure atomic ext4: remove an unnecessary if statement in __ext4_get_inode_loc() ext4: move inode eio simulation behind io completeion ext4: Improve scalability of ext4 orphan file handling ext4: Orphan file documentation ext4: Speedup ext4 orphan inode handling ext4: Move orphan inode handling into a separate file ext4: Support for checksumming from journal triggers ext4: fix race writing to an inline_data file while its xattrs are changing jbd2: add sparse annotations for add_transaction_credits() ext4: fix sparse warnings ext4: Make sure quota files are not grabbed accidentally ext4: fix e2fsprogs checksum failure for mounted filesystem ext4: if zeroout fails fall back to splitting the extent node ext4: reduce arguments of ext4_fc_add_dentry_tlv ext4: flush background discard kwork when retry allocation ext4: get discard out of jbd2 commit kthread contex ext4: remove the repeated comment of ext4_trim_all_free ext4: add new helper interface ext4_try_to_trim_range() ext4: remove the 'group' parameter of ext4_trim_extent ... commit 0da14a19493da0f9b4c5ee5930ab05a4c61f5883 Author: Christophe JAILLET Date: Sun Aug 22 20:49:20 2021 +0200 x86/PCI: sta2x11: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Link: https://lore.kernel.org/r/99656452963ba3c63a6cb12e151279d81da365eb.1629658069.git.christophe.jaillet@wanadoo.fr Link: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ Signed-off-by: Christophe JAILLET Signed-off-by: Bjorn Helgaas commit 815409a12c0a9c0de17a910fd95fe11e1eb97f32 Merge: 412106c203b75 332f606b32b62 Author: Linus Torvalds Date: Thu Sep 2 09:21:27 2021 -0700 Merge tag 'ovl-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs update from Miklos Szeredi: - Copy up immutable/append/sync/noatime attributes (Amir Goldstein) - Improve performance by enabling RCU lookup. - Misc fixes and improvements The reason this touches so many files is that the ->get_acl() method now gets a "bool rcu" argument. The ->get_acl() API was updated based on comments from Al and Linus: Link: https://lore.kernel.org/linux-fsdevel/CAJfpeguQxpd6Wgc0Jd3ks77zcsAv_bn0q17L3VNnnmPKu11t8A@mail.gmail.com/ * tag 'ovl-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: enable RCU'd ->get_acl() vfs: add rcu argument to ->get_acl() callback ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup() ovl: use kvalloc in xattr copy-up ovl: update ctime when changing fileattr ovl: skip checking lower file's i_writecount on truncate ovl: relax lookup error on mismatch origin ftype ovl: do not set overlay.opaque for new directories ovl: add ovl_allow_offline_changes() helper ovl: disable decoding null uuid with redirect_dir ovl: consistent behavior for immutable/append-only inodes ovl: copy up sync/noatime fileattr flags ovl: pass ovl_fs to ovl_check_setxattr() fs: add generic helper for filling statx attribute flags commit fa209644a7124b3f4cf811ced55daef49ae39ac6 Author: Mario Limonciello Date: Wed Sep 1 09:21:11 2021 -0500 ACPI: PM: s2idle: Run both AMD and Microsoft methods if both are supported It was reported that on "HP ENVY x360" that power LED does not come back, certain keys like brightness controls do not work, and the fan never spins up, even under load on 5.14 final. In analysis of the SSDT it's clear that the Microsoft UUID doesn't provide functional support, but rather the AMD UUID should be supporting this system. Because this is a gap in the expected logic, we checked back with internal team. The conclusion was that on Windows AMD uPEP *does* run even when Microsoft UUID present, but most OEM systems have adopted value of "0x3" for supported functions and hence nothing runs. Henceforth add support for running both Microsoft and AMD methods. This approach will also allow the same logic on Intel systems if desired at a future time as well by pulling the evaluation of `lps0_dsm_func_mask_microsoft` out of the `if` block for `acpi_s2idle_vendor_amd`. Link: https://gitlab.freedesktop.org/drm/amd/uploads/9fbcd7ec3a385cc6949c9bacf45dc41b/acpi-f.20.bin BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1691 Reported-by: Maxwell Beck Signed-off-by: Mario Limonciello [ rjw: Edits of the new comments ] Signed-off-by: Rafael J. Wysocki commit 412106c203b759fa7fbcc4f855a90ab18e681ccb Merge: 89594c746b00d 1266b4a7ecb67 Author: Linus Torvalds Date: Thu Sep 2 09:12:05 2021 -0700 Merge tag 'erofs-for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "In this cycle, direct I/O and fsdax support for uncompressed files are now added in order to avoid double-caching for loop device and VM container use cases. All uncompressed cases are now turned into iomap infrastructure, which looks much simpler and cleaner. In addition, fiemap support is added for both (un)compressed files by using iomap infrastructure as well so end users can easily get file distribution. We've also added chunk-based uncompressed files support for data deduplication as the next step of VM container use cases. Summary: - support direct I/O for all uncompressed files - support fsdax for non-tailpacking regular files - use iomap infrastructure for all uncompressed cases - support fiemap for both (un)compressed files - introduce chunk-based files for chunk deduplication - some cleanups" * tag 'erofs-for-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix double free of 'copied' erofs: support reading chunk-based uncompressed files erofs: introduce chunk-based file on-disk format erofs: add fiemap support with iomap erofs: add support for the full decompressed length erofs: remove the mapping parameter from erofs_try_to_free_cached_page() erofs: directly use wrapper erofs_page_is_managed() when shrinking erofs: convert all uncompressed cases to iomap erofs: dax support for non-tailpacking regular file erofs: iomap support for non-tailpacking DIO commit 17b121ad0c43342bc894632f6710b894849ca372 Author: Andy Shevchenko Date: Sun Aug 29 16:22:43 2021 +0300 Documentation: ACPI: Align the SSDT overlays file with the code This updates the following: 1) The ASL code to follow latest ACPI requirements, i.e. - static buffer to be defined outside of the method - The _ADR and _HID shouldn't be together for the same device 2) EFI section relies on the additional kernel configuration option, i.e. CONFIG_EFI_CUSTOM_SSDT_OVERLAYS 3) Refer to ACPI machine language as AML (capitalized) 4) Miscellaneous amendments Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 89594c746b00d3755e0792a2407f0b557a30ef37 Merge: 75ae663d053bd 20ec197bfa13c Author: Linus Torvalds Date: Thu Sep 2 09:06:28 2021 -0700 Merge tag 'fscache-next-20210829' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull fscache updates from David Howells: "Preparatory work for the fscache rewrite that's being worked on and fix some bugs. These include: - Always select netfs stats when enabling fscache stats since they're displayed through the same procfile. - Add a cookie debug ID that can be used in tracepoints instead of a pointer and cache it in the netfs_cache_resources struct rather than in the netfs_read_request struct to make it more available. - Use file_inode() in cachefiles rather than dereferencing file->f_inode directly. - Provide a procfile to display fscache cookies. - Remove the fscache and cachefiles histogram procfiles. - Remove the fscache object list procfile. - Avoid using %p in fscache and cachefiles as the value is hashed and not comparable to the register dump in an oops trace. - Fix the cookie hash function to actually achieve useful dispersion. - Fix fscache_cookie_put() so that it doesn't dereference the cookie pointer in the tracepoint after the refcount has been decremented (we're only allowed to do that if we decremented it to zero). - Use refcount_t rather than atomic_t for the fscache_cookie refcount" * tag 'fscache-next-20210829' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: fscache: Use refcount_t for the cookie refcount instead of atomic_t fscache: Fix fscache_cookie_put() to not deref after dec fscache: Fix cookie key hashing cachefiles: Change %p in format strings to something else fscache: Change %p in format strings to something else fscache: Remove the object list procfile fscache, cachefiles: Remove the histogram stuff fscache: Procfile to display cookies fscache: Add a cookie debug ID and use that in traces cachefiles: Use file_inode() rather than accessing ->f_inode netfs: Move cookie debug ID to struct netfs_cache_resources fscache: Select netfs stats if fscache stats are enabled commit 4bf8e582119ed9767f907abb6dc62ef9dddf10df Author: Viresh Kumar Date: Wed Sep 1 14:41:57 2021 +0530 cpufreq: Remove ready() callback This isn't used anymore, get rid of it. Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 9ab0a6cb76b998f5f2231e1c428bee3771893002 Author: Viresh Kumar Date: Wed Sep 1 14:41:56 2021 +0530 cpufreq: sh: Remove sh_cpufreq_cpu_ready() The ->ready() callback is going away and since we don't do any important stuff in sh_cpufreq_cpu_ready(), remove it. Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 692a3b9a89947b27fc76d40b2613b33286a1690b Author: Viresh Kumar Date: Wed Sep 1 14:41:55 2021 +0530 cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() The ready() callback was implemented earlier for acpi-cpufreq driver as we wanted to use policy->cpuinfo.max_freq for which the policy was required to be verified. That is no longer the case and we can do the pr_warn() right from ->init() callback now. Remove acpi_cpufreq_cpu_ready(). Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 59dc33252ee777e02332774fbdf3381b1d5d5f5d Author: Rafael J. Wysocki Date: Tue Aug 24 16:43:55 2021 +0200 PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus On some systems, in order to get to the deepest low-power state of the platform (which may be necessary to save significant enough amounts of energy while suspended to idle. for example), devices on the PCI bus exposed by the VMD driver need to be power-managed via ACPI. However, the layout of the ACPI namespace below the VMD controller device object does not reflect the layout of the PCI bus under the VMD host bridge, so in order to identify the ACPI companion objects for the devices on that bus, it is necessary to use a special _ADR encoding on the ACPI side. In other words, acpi_pci_find_companion() does not work for these devices, so it needs to be amended with a special lookup logic specific to the VMD bus. Address this issue by allowing the VMD driver to temporarily install an ACPI companion lookup hook containing the code matching the devices on the VMD PCI bus with the corresponding objects in the ACPI namespace. Signed-off-by: Rafael J. Wysocki Acked-by: Jon Derrick commit 75ae663d053bddf7c70a24cccf53c83ae03deff8 Author: Luca Coelho Date: Thu Sep 2 13:11:01 2021 +0300 iwlwifi: mvm: add rtnl_lock() in iwl_mvm_start_get_nvm() Due to a rebase damage, we lost the rtnl_lock() when the patch was sent out. This causes an RTNL imbalance and failed assertions, due to missing RTNL protection, for instance: RTNL: assertion failed at net/wireless/reg.c (4025) WARNING: CPU: 60 PID: 1720 at net/wireless/reg.c:4025 regulatory_set_wiphy_regd_sync+0x7f/0x90 [cfg80211] Call Trace: iwl_mvm_init_mcc+0x170/0x190 [iwlmvm] iwl_op_mode_mvm_start+0x824/0xa60 [iwlmvm] iwl_opmode_register+0xd0/0x130 [iwlwifi] init_module+0x23/0x1000 [iwlmvm] Fix this by adding the missing rtnl_lock() back to the code. Fixes: eb09ae93dabf ("iwlwifi: mvm: load regdomain at INIT stage") Link: https://lore.kernel.org/lkml/CAHk-=wjB_zBwZ+WR9LOpvgjvaQn=cqryoKigod8QnZs=iYGEhA@mail.gmail.com/ Reported-by: Linus Torvalds Signed-off-by: Luca Coelho Acked-by: David S. Miller Signed-off-by: Linus Torvalds commit 2e3a51b59ea26544303e168de8a0479915f09aa3 Author: Kari Argillander Date: Sun Aug 29 17:42:39 2021 +0300 fs/ntfs3: Change how module init/info messages are displayed Usually in file system init() messages are only displayed in info level. Change level from notice to info, but keep CONFIG_NTFS3_64BIT_CLUSTER in notice level. Also this need even more attention so let's put big warning here so that nobody will not try accidentally use it. There is also no good reason to display internal stuff like binary tree search. This is always on option which can only disabled for debugging purposes by developer. Also this message does not even check if developer has disabled it or not so it is useless info. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 989e795bfe360cca0affb0a4224f37bd8494b46d Author: Kari Argillander Date: Fri Aug 27 00:44:41 2021 +0300 fs/ntfs3: Remove GPL boilerplates from decompress lib files Files already have SDPX identifier so no reason to keep boilerplates in these files anymore. Signed-off-by: Kari Argillander Acked-by: Eric Biggers Signed-off-by: Konstantin Komarov commit dd854e4b5b12016d27bfa2694226a1c15acbd640 Author: Kari Argillander Date: Wed Aug 25 21:25:22 2021 +0300 fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter This check will be also performed in generic_file_read_iter() so we do not want to check this two times in a row. This was founded with Smatch fs/ntfs3/file.c:803 ntfs_file_read_iter() warn: unused return: count = iov_iter_count() Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit d4e8e135a9af7d8d939bba1874ab314322fc2dc2 Author: Kari Argillander Date: Wed Aug 25 21:24:35 2021 +0300 fs/ntfs3: Fix integer overflow in ni_fiemap with fiemap_prep() Use fiemap_prep() to check valid flags. It also shrink request scope (@len) to what the fs can actually handle. This address following Smatch static checker warning: fs/ntfs3/frecord.c:1894 ni_fiemap() warn: potential integer overflow from user 'vbo + len' Because fiemap_prep() shrinks @len this cannot happened anymore. Reported-by: Dan Carpenter Link: lore.kernel.org/ntfs3/20210825080440.GA17407@kili/ Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 1fd95c05d8f742abfe906620780aee4dbe1a2db0 Author: Theodore Ts'o Date: Thu Sep 2 11:36:01 2021 -0400 ext4: add error checking to ext4_ext_replay_set_iblocks() If the call to ext4_map_blocks() fails due to an corrupted file system, ext4_ext_replay_set_iblocks() can get stuck in an infinite loop. This could be reproduced by running generic/526 with a file system that has inline_data and fast_commit enabled. The system will repeatedly log to the console: EXT4-fs warning (device dm-3): ext4_block_to_path:105: block 1074800922 > max in inode 131076 and the stack that it gets stuck in is: ext4_block_to_path+0xe3/0x130 ext4_ind_map_blocks+0x93/0x690 ext4_map_blocks+0x100/0x660 skip_hole+0x47/0x70 ext4_ext_replay_set_iblocks+0x223/0x440 ext4_fc_replay_inode+0x29e/0x3b0 ext4_fc_replay+0x278/0x550 do_one_pass+0x646/0xc10 jbd2_journal_recover+0x14a/0x270 jbd2_journal_load+0xc4/0x150 ext4_load_journal+0x1f3/0x490 ext4_fill_super+0x22d4/0x2c00 With this patch, generic/526 still fails, but system is no longer locking up in a tight loop. It's likely the root casue is that fast_commit replay is corrupting file systems with inline_data, and we probably need to add better error handling in the fast commit replay code path beyond what is done here, which essentially just breaks the infinite loop without reporting the to the higher levels of the code. Fixes: 8016E29F4362 ("ext4: fast commit recovery path") Cc: stable@kernel.org Cc: Harshad Shirwadkar Signed-off-by: Theodore Ts'o commit f97a2103f1a75ca70f23deadb4d96a16c4d85e7d Author: Hans de Goede Date: Thu Sep 2 17:28:53 2021 +0200 firmware: dmi: Move product_sku info to the end of the modalias Commit e26f023e01ef ("firmware/dmi: Include product_sku info to modalias") added a new field to the modalias in the middle of the modalias, breaking some existing udev/hwdb matches on the whole modalias without a wildcard ('*') in between the pvr and rvn fields. All modalias matches in e.g. : https://github.com/systemd/systemd/blob/main/hwdb.d/60-sensor.hwdb deliberately end in ':*' so that new fields can be added at *the end* of the modalias, but adding a new field in the middle like this breaks things. Move the new sku field to the end of the modalias to fix some hwdb entries no longer matching. The new sku field has already been put to use in 2 new hwdb entries: sensor:modalias:platform:HID-SENSOR-200073:dmi:*svnDell*:sku0A3E:* ACCEL_LOCATION=base sensor:modalias:platform:HID-SENSOR-200073:dmi:*svnDell*:sku0B0B:* ACCEL_LOCATION=base The wildcard use before and after the sku in these matches means that they should keep working with the sku moved to the end. Note that there is a second instance of in essence the same problem, commit f5152f4ded3c ("firmware/dmi: Report DMI Bios & EC firmware release") Added 2 new br and efr fields in the middle of the modalias. This too breaks some hwdb modalias matches, but this has gone unnoticed for over a year. So some newer hwdb modalias matches actually depend on these fields being in the middle of the string. Moving these to the end now would break 3 hwdb entries, while fixing 8 entries. Since there is no good answer for the new br and efr fields I have chosen to leave these as is. Instead I'll submit a hwdb update to put a wildcard at the place where these fields may or may not be present depending on the kernel version. BugLink: https://github.com/systemd/systemd/issues/20550 Link: https://github.com/systemd/systemd/pull/20562 Fixes: e26f023e01ef ("firmware/dmi: Include product_sku info to modalias") Cc: stable@vger.kernel.org Cc: Kai-Chuan Hsieh Cc: Erwan Velu Signed-off-by: Hans de Goede Signed-off-by: Jean Delvare commit 90c90cda05aecf0f7c45f9f35384b31bba38455f Merge: 4ac6d90867a4d f38a032b165d8 Author: Linus Torvalds Date: Thu Sep 2 08:26:03 2021 -0700 Merge tag 'xfs-5.15-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "There's a lot in this cycle. Starting with bug fixes: To avoid livelocks between the logging code and the quota code, we've disabled the ability of quotaoff to turn off quota accounting. (Admins can still disable quota enforcement, but truly turning off accounting requires a remount.) We've tried to do this in a careful enough way that there shouldn't be any user visible effects aside from quotaoff no longer randomly hanging the system. We've also fixed some bugs in runtime log behavior that could trip up log recovery if (otherwise unrelated) transactions manage to start and commit concurrently; some bugs in the GETFSMAP ioctl where we would incorrectly restrict the range of records output if the two xfs devices are of different sizes; a bug that resulted in fallocate funshare failing unnecessarily; and broken behavior in the xfs inode cache when DONTCACHE is in play. As for new features: we now batch inode inactivations in percpu background threads, which sharply decreases frontend thread wait time when performing file deletions and should improve overall directory tree deletion times. This eliminates both the problem where closing an unlinked file (especially on a frozen fs) can stall for a long time, and should also ease complaints about direct reclaim bogging down on unlinked file cleanup. Starting with this release, we've enabled pipelining of the XFS log. On workloads with high rates of metadata updates to different shards of the filesystem, multiple threads can be used to format committed log updates into log checkpoints. Lastly, with this release, two new features have graduated to supported status: inode btree counters (for faster mounts), and support for dates beyond Y2038. Expect these to be enabled by default in a future release of xfsprogs. Summary: - Fix a potential log livelock on busy filesystems when there's so much work going on that we can't finish a quotaoff before filling up the log by removing the ability to disable quota accounting. - Introduce the ability to use per-CPU data structures in XFS so that we can do a better job of maintaining CPU locality for certain operations. - Defer inode inactivation work to per-CPU lists, which will help us batch that processing. Deletions of large sparse files will *appear* to run faster, but all that means is that we've moved the work to the backend. - Drop the EXPERIMENTAL warnings from the y2038+ support and the inode btree counters, since it's been nearly a year and no complaints have come in. - Remove more of our bespoke kmem* variants in favor of using the standard Linux calls. - Prepare for the addition of log incompat features in upcoming cycles by actually adding code to support this. - Small cleanups of the xattr code in preparation for landing support for full logging of extended attribute updates in a future cycle. - Replace the various log shutdown state and flag code all over xfs with a single atomic bit flag. - Fix a serious log recovery bug where log item replay can be skipped based on the start lsn of a transaction even though the transaction commit lsn is the key data point for that by enforcing start lsns to appear in the log in the same order as commit lsns. - Enable pipelining in the code that pushes log items to disk. - Drop ->writepage. - Fix some bugs in GETFSMAP where the last fsmap record reported for a device could extend beyond the end of the device, and a separate bug where query keys for one device could be applied to another. - Don't let GETFSMAP query functions edit their input parameters. - Small cleanups to the scrub code's handling of perag structures. - Small cleanups to the incore inode tree walk code. - Constify btree function parameters that aren't changed, so that there will never again be confusion about range query functions changing their input parameters. - Standardize the format and names of tracepoint data attributes. - Clean up all the mount state and feature flags to use wrapped bitset functions instead of inconsistently open-coded flag checks. - Fix some confusion between xfs_buf hash table key variable vs. block number. - Fix a mis-interaction with iomap where we reported shared delalloc cow fork extents to iomap, which would cause the iomap unshare operation to return IO errors unnecessarily. - Fix DONTCACHE behavior" * tag 'xfs-5.15-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (103 commits) xfs: fix I_DONTCACHE xfs: only set IOMAP_F_SHARED when providing a srcmap to a write xfs: fix perag structure refcounting error when scrub fails xfs: rename buffer cache index variable b_bn xfs: convert bp->b_bn references to xfs_buf_daddr() xfs: introduce xfs_buf_daddr() xfs: kill xfs_sb_version_has_v3inode() xfs: introduce xfs_sb_is_v5 helper xfs: remove unused xfs_sb_version_has wrappers xfs: convert xfs_sb_version_has checks to use mount features xfs: convert scrub to use mount-based feature checks xfs: open code sb verifier feature checks xfs: convert xfs_fs_geometry to use mount feature checks xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown xfs: convert remaining mount flags to state flags xfs: convert mount flags to features xfs: consolidate mount option features in m_features xfs: replace xfs_sb_version checks with feature flag checks xfs: reflect sb features in xfs_mount xfs: rework attr2 feature and mount options ... commit 4f89ff026ddbaab49dba993ad2dc757920d0ad49 Author: Shengjiu Wang Date: Thu Sep 2 11:32:05 2021 +0800 ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP Add compatible string for i.MX8ULP platform which support audio function through rpmsg audio channel on M core. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630553525-25655-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit c4f3a3460a5daebc772d9263500e4099b11e7300 Author: Geert Uytterhoeven Date: Thu Sep 2 14:49:11 2021 +0200 dma-buf: DMABUF_MOVE_NOTIFY should depend on DMA_SHARED_BUFFER Move notify between drivers is an option of DMA-BUF. Enabling DMABUF_MOVE_NOTIFY without DMA_SHARED_BUFFER does not have any impact, as drivers/dma-buf/ is not entered during the build when DMA_SHARED_BUFFER is disabled. Fixes: bb42df4662a44765 ("dma-buf: add dynamic DMA-buf handling v15") Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210902124913.2698760-2-geert@linux-m68k.org commit 49ca6153208f6efc409c1deb82dd5bcbb519d7e1 Author: Daniel Borkmann Date: Tue Aug 24 09:39:31 2021 +0200 bpf: Relicense disassembler as GPL-2.0-only OR BSD-2-Clause Some time ago we dual-licensed both libbpf and bpftool through commits 1bc38b8ff6cc ("libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause") and 907b22365115 ("tools: bpftool: dual license all files"). The latter missed the disasm.{c,h} which we pull in via kernel/bpf/ such that we have a single source for verifier as well as bpftool asm dumping, see also f4ac7e0b5cc8 ("bpf: move instruction printing into a separate file"). It is currently GPL-2.0-only and missed the conversion in 907b22365115, therefore relicense the two as GPL-2.0-only OR BSD-2-Clause as well. Spotted-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Acked-by: Thomas Graf Acked-by: Brendan Jackman Acked-by: Jakub Kicinski Acked-by: Jiri Olsa Acked-by: Simon Horman Acked-by: Martin KaFai Lau Acked-by: Xu Kuohai Acked-by: Edward Cree commit 2d52c58b9c9bdae0ca3df6a1eab5745ab3f7d80b Author: Paolo Valente Date: Mon Aug 2 16:13:52 2021 +0200 block, bfq: honor already-setup queue merges The function bfq_setup_merge prepares the merging between two bfq_queues, say bfqq and new_bfqq. To this goal, it assigns bfqq->new_bfqq = new_bfqq. Then, each time some I/O for bfqq arrives, the process that generated that I/O is disassociated from bfqq and associated with new_bfqq (merging is actually a redirection). In this respect, bfq_setup_merge increases new_bfqq->ref in advance, adding the number of processes that are expected to be associated with new_bfqq. Unfortunately, the stable-merging mechanism interferes with this setup. After bfqq->new_bfqq has been set by bfq_setup_merge, and before all the expected processes have been associated with bfqq->new_bfqq, bfqq may happen to be stably merged with a different queue than the current bfqq->new_bfqq. In this case, bfqq->new_bfqq gets changed. So, some of the processes that have been already accounted for in the ref counter of the previous new_bfqq will not be associated with that queue. This creates an unbalance, because those references will never be decremented. This commit fixes this issue by reestablishing the previous, natural behaviour: once bfqq->new_bfqq has been set, it will not be changed until all expected redirections have occurred. Signed-off-by: Davide Zini Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20210802141352.74353-2-paolo.valente@linaro.org Signed-off-by: Jens Axboe commit 55a51ea14094a1e7dd0d7f33237d246033dd39ab Author: Geert Uytterhoeven Date: Mon Aug 30 11:11:28 2021 +0200 block/mq-deadline: Move dd_queued() to fix defined but not used warning If CONFIG_BLK_DEBUG_FS=n: block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function] 274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio) | ^~~~~~~~~ Fix this by moving dd_queued() just before the sole function that calls it. Fixes: 7b05bf771084ff78 ("Revert "block/mq-deadline: Prioritize high-priority requests"") Signed-off-by: Geert Uytterhoeven Fixes: 38ba64d12d4c ("block/mq-deadline: Track I/O statistics") Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20210830091128.1854266-1-geert@linux-m68k.org Signed-off-by: Jens Axboe commit d12e1c4649883e8ca5e8ff341e1948b3b6313259 Author: Rafał Miłecki Date: Thu Sep 2 10:30:51 2021 +0200 net: dsa: b53: Set correct number of ports in the DSA struct Setting DSA_MAX_PORTS caused DSA to call b53 callbacks (e.g. b53_disable_port() during dsa_register_switch()) for invalid (non-existent) ports. That made b53 modify unrelated registers and is one of reasons for a broken BCM5301x support. This problem exists for years but DSA_MAX_PORTS usage has changed few times. It seems the most accurate to reference commit dropping dsa_switch_alloc() in the Fixes tag. Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper") Signed-off-by: Rafał Miłecki Signed-off-by: David S. Miller commit cdb067d31c0fe4cce98b9d15f1f2ef525acaa094 Author: Rafał Miłecki Date: Thu Sep 2 10:30:50 2021 +0200 net: dsa: b53: Fix calculating number of switch ports It isn't true that CPU port is always the last one. Switches BCM5301x have 9 ports (port 6 being inactive) and they use port 5 as CPU by default (depending on design some other may be CPU ports too). A more reliable way of determining number of ports is to check for the last set bit in the "enabled_ports" bitfield. This fixes b53 internal state, it will allow providing accurate info to the DSA and is required to fix BCM5301x support. Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Signed-off-by: Rafał Miłecki Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit aabbdc67f3485b5db27ab4eba01e5fbf1ffea62c Author: Daniele Palmas Date: Thu Sep 2 12:51:22 2021 +0200 net: usb: cdc_mbim: avoid altsetting toggling for Telit LN920 Add quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE for Telit LN920 0x1061 composition in order to avoid bind error. Signed-off-by: Daniele Palmas Signed-off-by: David S. Miller commit ecdc28defc46af476566fffd9e5cb4495a2f176e Author: Ziyang Xuan Date: Thu Sep 2 16:36:09 2021 +0800 net: hso: add failure handler for add_net_device If the network devices connected to the system beyond HSO_MAX_NET_DEVICES. add_net_device() in hso_create_net_device() will be failed for the network_table is full. It will lead to business failure which rely on network_table, for example, hso_suspend() and hso_resume(). It will also lead to memory leak because resource release process can not search the hso_device object from network_table in hso_free_interface(). Add failure handler for add_net_device() in hso_create_net_device() to solve the above problems. Fixes: 72dc1c096c70 ("HSO: add option hso driver") Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit b9edbfe1adecfc48fd11061dce68afb03d6adbdc Author: Tetsuo Handa Date: Thu Sep 2 14:36:17 2021 +0900 flow: fix object-size-mismatch warning in flowi{4,6}_to_flowi_common() Commit 3df98d79215ace13 ("lsm,selinux: pass flowi_common instead of flowi to the LSM hooks") introduced flowi{4,6}_to_flowi_common() functions which cause UBSAN warning when building with LLVM 11.0.1 on Ubuntu 21.04. ================================================================================ UBSAN: object-size-mismatch in ./include/net/flow.h:197:33 member access within address ffffc9000109fbd8 with insufficient space for an object of type 'struct flowi' CPU: 2 PID: 7410 Comm: systemd-resolve Not tainted 5.14.0 #51 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 02/27/2020 Call Trace: dump_stack_lvl+0x103/0x171 ubsan_type_mismatch_common+0x1de/0x390 __ubsan_handle_type_mismatch_v1+0x41/0x50 udp_sendmsg+0xda2/0x1300 ? ip_skb_dst_mtu+0x1f0/0x1f0 ? sock_rps_record_flow+0xe/0x200 ? inet_send_prepare+0x2d/0x90 sock_sendmsg+0x49/0x80 ____sys_sendmsg+0x269/0x370 __sys_sendmsg+0x15e/0x1d0 ? syscall_enter_from_user_mode+0xf0/0x1b0 do_syscall_64+0x3d/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7081a50497 Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 RSP: 002b:00007ffc153870f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007f7081a50497 RDX: 0000000000000000 RSI: 00007ffc15387140 RDI: 000000000000000c RBP: 00007ffc15387140 R08: 0000563f29a5e4fc R09: 000000000000cd28 R10: 0000563f29a68a30 R11: 0000000000000246 R12: 000000000000000c R13: 0000000000000001 R14: 0000563f29a68a30 R15: 0000563f29a5e50c ================================================================================ I don't think we need to call flowi{4,6}_to_flowi() from these functions because the first member of "struct flowi4" and "struct flowi6" is struct flowi_common __fl_common; while the first member of "struct flowi" is union { struct flowi_common __fl_common; struct flowi4 ip4; struct flowi6 ip6; struct flowidn dn; } u; which should point to the same address without access to "struct flowi". Signed-off-by: Tetsuo Handa Signed-off-by: David S. Miller commit 9aca491e0dccf8a9d84a5b478e5eee3c6ea7803b Author: Ryoga Saito Date: Thu Sep 2 05:20:14 2021 +0000 Set fc_nlinfo in nh_create_ipv4, nh_create_ipv6 This patch fixes kernel NULL pointer dereference when creating nexthop which is bound with SRv6 decapsulation. In the creation of nexthop, __seg6_end_dt_vrf_build is called. __seg6_end_dt_vrf_build expects fc_lninfo in fib6_config is set correctly, but it isn't set in nh_create_ipv6, which causes kernel crash. Here is steps to reproduce kernel crash: 1. modprobe vrf 2. ip -6 nexthop add encap seg6local action End.DT4 vrftable 1 dev eth0 We got the following message: [ 901.370336] BUG: kernel NULL pointer dereference, address: 0000000000000ba0 [ 901.371658] #PF: supervisor read access in kernel mode [ 901.372672] #PF: error_code(0x0000) - not-present page [ 901.373672] PGD 0 P4D 0 [ 901.374248] Oops: 0000 [#1] SMP PTI [ 901.374944] CPU: 0 PID: 8593 Comm: ip Not tainted 5.14-051400-generic #202108310811-Ubuntu [ 901.376404] Hardware name: Red Hat KVM, BIOS 1.11.1-4.module_el8.2.0+320+13f867d7 04/01/2014 [ 901.377907] RIP: 0010:vrf_ifindex_lookup_by_table_id+0x19/0x90 [vrf] [ 901.379182] Code: c1 e9 72 ff ff ff e8 96 49 01 c2 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 89 f5 41 54 53 8b 05 47 4c 00 00 <48> 8b 97 a0 0b 00 00 48 8b 1c c2 e8 57 27 53 c1 4c 8d a3 88 00 00 [ 901.382652] RSP: 0018:ffffbf2d02043590 EFLAGS: 00010282 [ 901.383746] RAX: 000000000000000b RBX: ffff990808255e70 RCX: ffffbf2d02043aa8 [ 901.385436] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000000 [ 901.386924] RBP: ffffbf2d020435b0 R08: 00000000000000c0 R09: ffff990808255e40 [ 901.388537] R10: ffffffff83b08c90 R11: 0000000000000009 R12: 0000000000000000 [ 901.389937] R13: 0000000000000001 R14: 0000000000000000 R15: 000000000000000b [ 901.391226] FS: 00007fe49381f740(0000) GS:ffff99087dc00000(0000) knlGS:0000000000000000 [ 901.392737] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 901.393803] CR2: 0000000000000ba0 CR3: 000000000e3e8003 CR4: 0000000000770ef0 [ 901.395122] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 901.396496] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 901.397833] PKRU: 55555554 [ 901.398578] Call Trace: [ 901.399144] l3mdev_ifindex_lookup_by_table_id+0x3b/0x70 [ 901.400179] __seg6_end_dt_vrf_build+0x34/0xd0 [ 901.401067] seg6_end_dt4_build+0x16/0x20 [ 901.401904] seg6_local_build_state+0x271/0x430 [ 901.402797] lwtunnel_build_state+0x81/0x130 [ 901.403645] fib_nh_common_init+0x82/0x100 [ 901.404465] ? sock_def_readable+0x4b/0x80 [ 901.405285] fib6_nh_init+0x115/0x7c0 [ 901.406033] nh_create_ipv6.isra.0+0xe1/0x140 [ 901.406932] rtm_new_nexthop+0x3b7/0xeb0 [ 901.407828] rtnetlink_rcv_msg+0x152/0x3a0 [ 901.408663] ? rtnl_calcit.isra.0+0x130/0x130 [ 901.409535] netlink_rcv_skb+0x55/0x100 [ 901.410319] rtnetlink_rcv+0x15/0x20 [ 901.411026] netlink_unicast+0x1a8/0x250 [ 901.411813] netlink_sendmsg+0x238/0x470 [ 901.412602] ? _copy_from_user+0x2b/0x60 [ 901.413394] sock_sendmsg+0x65/0x70 [ 901.414112] ____sys_sendmsg+0x218/0x290 [ 901.414929] ? copy_msghdr_from_user+0x5c/0x90 [ 901.415814] ___sys_sendmsg+0x81/0xc0 [ 901.416559] ? fsnotify_destroy_marks+0x27/0xf0 [ 901.417447] ? call_rcu+0xa4/0x230 [ 901.418153] ? kmem_cache_free+0x23f/0x410 [ 901.418972] ? dentry_free+0x37/0x70 [ 901.419705] ? mntput_no_expire+0x4c/0x260 [ 901.420574] __sys_sendmsg+0x62/0xb0 [ 901.421297] __x64_sys_sendmsg+0x1f/0x30 [ 901.422057] do_syscall_64+0x5c/0xc0 [ 901.422756] ? syscall_exit_to_user_mode+0x27/0x50 [ 901.423675] ? __x64_sys_close+0x12/0x40 [ 901.424462] ? do_syscall_64+0x69/0xc0 [ 901.425219] ? irqentry_exit_to_user_mode+0x9/0x20 [ 901.426149] ? irqentry_exit+0x19/0x30 [ 901.426901] ? exc_page_fault+0x89/0x160 [ 901.427709] ? asm_exc_page_fault+0x8/0x30 [ 901.428536] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 901.429514] RIP: 0033:0x7fe493945747 [ 901.430248] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 901.433549] RSP: 002b:00007ffe9932cf68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 901.434981] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe493945747 [ 901.436303] RDX: 0000000000000000 RSI: 00007ffe9932cfe0 RDI: 0000000000000003 [ 901.437607] RBP: 00000000613053f7 R08: 0000000000000001 R09: 00007ffe9932d07c [ 901.438990] R10: 000055f4a903a010 R11: 0000000000000246 R12: 0000000000000001 [ 901.440340] R13: 0000000000000001 R14: 000055f4a802b163 R15: 000055f4a8042020 [ 901.441630] Modules linked in: vrf nls_utf8 isofs nls_iso8859_1 dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua intel_rapl_msr intel_rapl_common isst_if_mbox_msr isst_if_common nfit rapl input_leds joydev serio_raw qemu_fw_cfg mac_hid sch_fq_codel drm virtio_rng 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 crypto_simd virtio_net net_failover cryptd psmouse virtio_blk failover i2c_piix4 pata_acpi floppy [ 901.450808] CR2: 0000000000000ba0 [ 901.451514] ---[ end trace c27b934b99ade304 ]--- [ 901.452403] RIP: 0010:vrf_ifindex_lookup_by_table_id+0x19/0x90 [vrf] [ 901.453626] Code: c1 e9 72 ff ff ff e8 96 49 01 c2 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 89 f5 41 54 53 8b 05 47 4c 00 00 <48> 8b 97 a0 0b 00 00 48 8b 1c c2 e8 57 27 53 c1 4c 8d a3 88 00 00 [ 901.456910] RSP: 0018:ffffbf2d02043590 EFLAGS: 00010282 [ 901.457912] RAX: 000000000000000b RBX: ffff990808255e70 RCX: ffffbf2d02043aa8 [ 901.459238] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000000 [ 901.460552] RBP: ffffbf2d020435b0 R08: 00000000000000c0 R09: ffff990808255e40 [ 901.461882] R10: ffffffff83b08c90 R11: 0000000000000009 R12: 0000000000000000 [ 901.463208] R13: 0000000000000001 R14: 0000000000000000 R15: 000000000000000b [ 901.464529] FS: 00007fe49381f740(0000) GS:ffff99087dc00000(0000) knlGS:0000000000000000 [ 901.466058] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 901.467189] CR2: 0000000000000ba0 CR3: 000000000e3e8003 CR4: 0000000000770ef0 [ 901.468515] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 901.469858] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 901.471139] PKRU: 55555554 Signed-off-by: Ryoga Saito Signed-off-by: David S. Miller commit d2cabd2dc8da78faf9b690ea521d03776686c9fe Author: Dan Carpenter Date: Thu Sep 2 13:08:51 2021 +0300 net: qrtr: revert check in qrtr_endpoint_post() I tried to make this check stricter as a hardenning measure but it broke audo and wifi on these devices so revert it. Fixes: aaa8e4922c88 ("net: qrtr: make checks in qrtr_endpoint_post() stricter") Reported-by: John Stultz Signed-off-by: Dan Carpenter Tested-by: Srinivas Kandagatla Signed-off-by: David S. Miller commit 552799f8b3b0074d2617f53a63a088f9514a66e3 Author: Jan Hoffmann Date: Wed Sep 1 20:49:33 2021 +0200 net: dsa: lantiq_gswip: fix maximum frame length Currently, outgoing packets larger than 1496 bytes are dropped when tagged VLAN is used on a switch port. Add the frame check sequence length to the value of the register GSWIP_MAC_FLEN to fix this. This matches the lantiq_ppa vendor driver, which uses a value consisting of 1518 bytes for the MAC frame, plus the lengths of special tag and VLAN tags. Fixes: 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Cc: stable@vger.kernel.org Signed-off-by: Jan Hoffmann Acked-by: Hauke Mehrtens Signed-off-by: David S. Miller commit 025efa0a82dfa79ac2b126f622ba9244f795e707 Author: Jakub Kicinski Date: Wed Sep 1 08:55:01 2021 -0700 selftests: add simple GSO GRE test Test case for commit a6e3f2985a80 ("ip6_tunnel: fix GRE6 segmentation"). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 3f22bb137eb03ab27eaaa8b40d3e072eb541444e Author: Jiwon Kim Date: Thu Sep 2 00:34:49 2021 +0900 ipv6: change return type from int to void for mld_process_v2 The mld_process_v2 only returned 0. So, the return type is changed to void. Signed-off-by: Jiwon Kim Signed-off-by: David S. Miller commit 66abf5fb4cf713c6fdfccfbbabdcdf834f8bb9e2 Author: Geert Uytterhoeven Date: Wed Sep 1 14:17:35 2021 +0200 net/sun3_82586: Fix return value of sun3_82586_probe() drivers/net/ethernet/i825xx/sun3_82586.c: In function ‘sun3_82586_probe’: drivers/net/ethernet/i825xx/sun3_82586.c:317:9: warning: returning ‘struct net_device *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion] 317 | return dev; | ^~~ The return type of sun3_82586_probe() was changed, but one return value was forgotten to be updated. Fixes: e179d78ee11a70e2 ("m68k: remove legacy probing") Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit bea6a94a279bcbe6b2cde348782b28baf12255a5 Author: Oleksij Rempel Date: Thu Sep 2 09:19:51 2021 +0200 MIPS: Malta: fix alignment of the devicetree buffer Starting with following patch MIPS Malta is not able to boot: | commit 79edff12060fe7772af08607eff50c0e2486c5ba | Author: Rob Herring | scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 The reason is the alignment test added to the fdt_ro_probe_(). To fix this issue, we need to make sure that fdt_buf is aligned. Since the dtc patch was designed to uncover potential issue, I handle initial MIPS Malta patch as initial bug. Fixes: e81a8c7dabac ("MIPS: Malta: Setup RAM regions via DT") Signed-off-by: Oleksij Rempel Signed-off-by: Thomas Bogendoerfer commit 4ac6d90867a4de2e12117e755dbd76e08d88697f Merge: df43d903828c5 37397b092e7f4 Author: Linus Torvalds Date: Wed Sep 1 18:49:47 2021 -0700 Merge tag 'docs-5.15' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "Yet another set of documentation changes: - A reworking of PDF generation to yield better results for documents using CJK fonts in particular. - A new set of translations into traditional Chinese, a dialect for which I am assured there is a community of interested readers. - A lot more regular Chinese translation work as well. ... plus the usual assortment of updates, fixes, typo tweaks, etc" * tag 'docs-5.15' of git://git.lwn.net/linux: (55 commits) docs: sphinx-requirements: Move sphinx_rtd_theme to top docs: pdfdocs: Enable language-specific font choice of zh_TW translations docs: pdfdocs: Teach xeCJK about character classes of quotation marks docs: pdfdocs: Permit AutoFakeSlant for CJK fonts docs: pdfdocs: One-half spacing for CJK translations docs: pdfdocs: Add conf.py local to translations for ascii-art alignment docs: pdfdocs: Preserve inter-phrase space in Korean translations docs: pdfdocs: Choose Serif font as CJK mainfont if possible docs: pdfdocs: Add CJK-language-specific font settings docs: pdfdocs: Refactor config for CJK document scripts/kernel-doc: Override -Werror from KCFLAGS with KDOC_WERROR docs/zh_CN: Add zh_CN/accounting/psi.rst doc: align Italian translation Documentation/features/vm: riscv supports THP now docs/zh_CN: add infiniband user_verbs translation docs/zh_CN: add infiniband user_mad translation docs/zh_CN: add infiniband tag_matching translation docs/zh_CN: add infiniband sysfs translation docs/zh_CN: add infiniband opa_vnic translation docs/zh_CN: add infiniband ipoib translation ... commit df43d903828c59afb9e93b59835127a02e1f8144 Merge: 9e5f3ffcf1cb3 c985aafb60e97 Author: Linus Torvalds Date: Wed Sep 1 18:41:13 2021 -0700 Merge tag 'printk-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Optionally, provide an index of possible printk messages via /printk/index/. It can be used when monitoring important kernel messages on a farm of various hosts. The monitor has to be updated when some messages has changed or are not longer available by a newly deployed kernel. - Add printk.console_no_auto_verbose boot parameter. It allows to generate crash dump even with slow consoles in a reasonable time frame. - Remove printk_safe buffers. The messages are always stored directly to the main logbuffer, even in NMI or recursive context. Also it allows to serialize syslog operations by a mutex instead of a spin lock. - Misc clean up and build fixes. * tag 'printk-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk/index: Fix -Wunused-function warning lib/nmi_backtrace: Serialize even messages about idle CPUs printk: Add printk.console_no_auto_verbose boot parameter printk: Remove console_silent() lib/test_scanf: Handle n_bits == 0 in random tests printk: syslog: close window between wait and read printk: convert @syslog_lock to mutex printk: remove NMI tracking printk: remove safe buffers printk: track/limit recursion lib/nmi_backtrace: explicitly serialize banner and regs printk: Move the printk() kerneldoc comment to its new home printk/index: Fix warning about missing prototypes MIPS/asm/printk: Fix build failure caused by printk printk: index: Add indexing support to dev_printk printk: Userspace format indexing support printk: Rework parse_prefix into printk_parse_prefix printk: Straighten out log_flags into printk_info_flags string_helpers: Escape double quotes in escape_special printk/console: Check consistent sequence number when handling race in console_unlock() commit 9e5f3ffcf1cb34e7c7beb3f79a96f58536730924 Merge: 6104dde096eba b1e202503508d Author: Linus Torvalds Date: Wed Sep 1 18:34:51 2021 -0700 Merge tag 'devicetree-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - Refactor arch kdump DT related code to a common implementation - Add fw_devlink tracking for 'phy-handle', 'leds', 'backlight', 'resets', and 'pwm' properties - Various clean-ups to DT FDT code - Fix a runtime error for !CONFIG_SYSFS - Convert Synopsys DW PCI and derivative binding docs to schemas. Add Toshiba Visconti PCIe binding. - Convert a bunch of memory controller bindings to schemas - Covert eeprom-93xx46, Samsung Exynos TRNG, Samsung Exynos IRQ combiner, arm-charlcd, img-ascii-lcd, UniPhier eFuse, Xilinx Zynq MPSoC FPGA, Xilinx Zynq MPSoC reset, Mediatek mmsys, Gemini boards, brcm,iproc-i2c, faraday,ftpci100, and ks8851 net to DT schema. - Extend nvmem bindings to handle bit offsets in unit-addresses - Add DT schemas for HiKey 970 PCIe PHY - Remove unused ZTE, energymicro,efm32-timer, and Exynos SATA bindings - Enable dtc pci_device_reg warning by default - Fixes for handling 'unevaluatedProperties' in preparation to enable pending support in the tooling for jsonschema 2020-12 draft * tag 'devicetree-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (78 commits) dt-bindings: display: remove zte,vou.txt binding doc dt-bindings: hwmon: merge max1619 into trivial devices dt-bindings: mtd-physmap: Add 'arm,vexpress-flash' compatible dt-bindings: PCI: imx6: convert the imx pcie controller to dtschema dt-bindings: Use 'enum' instead of 'oneOf' plus 'const' entries dt-bindings: Add vendor prefix for Topic Embedded Systems of: fdt: Rename reserve_elfcorehdr() to fdt_reserve_elfcorehdr() arm64: kdump: Remove custom linux,usable-memory-range handling arm64: kdump: Remove custom linux,elfcorehdr handling riscv: Remove non-standard linux,elfcorehdr handling of: fdt: Use IS_ENABLED(CONFIG_BLK_DEV_INITRD) instead of #ifdef of: fdt: Add generic support for handling usable memory range property of: fdt: Add generic support for handling elf core headers property crash_dump: Make elfcorehdr address/size symbols always visible dt-bindings: memory: convert Samsung Exynos DMC to dtschema dt-bindings: devfreq: event: convert Samsung Exynos PPMU to dtschema dt-bindings: devfreq: event: convert Samsung Exynos NoCP to dtschema kbuild: Enable dtc 'pci_device_reg' warning by default dt-bindings: soc: remove obsolete zte zx header dt-bindings: clock: remove obsolete zte zx header ... commit 6104dde096eba9f443845686a2c4b3fa31129eb4 Merge: c07f191907e7d db87db65c1059 Author: Linus Torvalds Date: Wed Sep 1 18:31:45 2021 -0700 Merge tag 'm68knommu-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "A collection of fixes: - flexcan platform support (for m5441x) - fix CONFIG_ROMKERNEL linking - fix compilation when CONFIG_ISA_DMA_API is set - fix local ColdFire clk_enable() for NULL clk" * tag 'm68knommu-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch m68k: coldfire: return success for clk_enable(NULL) m68k: m5441x: add flexcan support m68k: stmark2: update board setup m68k/nommu: prevent setting ROMKERNEL when ROM is not set commit c07f191907e7d7e04034a2b9657a6bbf1355c60a Merge: 7c636d4d20f8c 9d68cd9120e4e Author: Linus Torvalds Date: Wed Sep 1 18:25:20 2021 -0700 Merge tag 'hyperv-next-signed-20210831' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: - make Hyper-V code arch-agnostic (Michael Kelley) - fix sched_clock behaviour on Hyper-V (Ani Sinha) - fix a fault when Linux runs as the root partition on MSHV (Praveen Kumar) - fix VSS driver (Vitaly Kuznetsov) - cleanup (Sonia Sharma) * tag 'hyperv-next-signed-20210831' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: hv_utils: Set the maximum packet size for VSS driver to the length of the receive buffer Drivers: hv: Enable Hyper-V code to be built on ARM64 arm64: efi: Export screen_info arm64: hyperv: Initialize hypervisor on boot arm64: hyperv: Add panic handler arm64: hyperv: Add Hyper-V hypercall and register access utilities x86/hyperv: fix root partition faults when writing to VP assist page MSR hv: hyperv.h: Remove unused inline functions drivers: hv: Decouple Hyper-V clock/timer code from VMbus drivers x86/hyperv: add comment describing TSC_INVARIANT_CONTROL MSR setting bit 0 Drivers: hv: Move Hyper-V misc functionality to arch-neutral code Drivers: hv: Add arch independent default functions for some Hyper-V handlers Drivers: hv: Make portions of Hyper-V init code be arch neutral x86/hyperv: fix for unwanted manipulation of sched_clock when TSC marked unstable asm-generic/hyperv: Add missing #include of nmi.h commit 205b95fe658ddba25236c60da777f67b4eec3fd3 Author: Ivan Mikhaylov Date: Mon Aug 30 20:18:06 2021 +0300 net/ncsi: add get MAC address command to get Intel i210 MAC address This patch adds OEM Intel GMA command and response handler for it. Signed-off-by: Brad Ho Signed-off-by: Paul Fertser Signed-off-by: Ivan Mikhaylov Link: https://lore.kernel.org/r/20210830171806.119857-2-i.mikhaylov@yadro.com Signed-off-by: Jakub Kicinski commit 5240118f08a07669537677be19edbf008682f8bd Author: Edwin Peer Date: Wed Sep 1 11:53:15 2021 -0700 bnxt_en: fix kernel doc warnings in bnxt_hwrm.c Parameter names in the comments did not match the function arguments. Fixes: 213808170840 ("bnxt_en: add support for HWRM request slices") Signed-off-by: Edwin Peer Reported-by: Jakub Kicinski Reviewed-by: Michael Chan Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20210901185315.57137-1-edwin.peer@broadcom.com Signed-off-by: Jakub Kicinski commit 7c636d4d20f8c5acfbfbc60f326fddb0e1cf5daa Merge: 32b47072f319b 9e62ec0e661ca Author: Linus Torvalds Date: Wed Sep 1 15:39:09 2021 -0700 Merge tag 'dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC DT updates from Arnd Bergmann: "As usual, the bulk of work in the SoC tree goes into DT files, this time with a roughly even split between 32-bit and 64-bit SoCs rather than the usual mostly 64-bit changes. New SoCs: - Microchip SAMA7 SoC family based on Cortex-A7, a new 32-bit platform based on the older SAMA5 series. - Qualcomm Snapdragon SDM636 and SM8150, variations of the existing phone SoCs. - Renesas R-Car H3e-2G and M3e-2G SoCs, variations of older Renesas SoCs. New boards: - Marvell CN913x reference boards - ASpeed AST2600 BMC implementations for Facebook Cloudripper, Elbert and Fuji server boards. - Snapdragon 665 based Sony Xperia 10II - Snapdragon MSM8916 based Xiaomi Redmi 2 - Snapdragon MSM8226 based Samsung Galaxy S3 Neo - NXP i.MX based 32-bit boards: - DHCOM based PicoITX - DHSOM based DRC0ỉ - SolidRun SolidSense - SKOV i.MX6 boards. - NXP i.MX based 64-bit boards: - Nitrogen8 SoM and MNT Reform2 - LS1088A based Traverse Ten64 - i.MX8M based GW7902. - NVIDIA Jetson TX2 NX Developer Kit - 4KOpen STiH418-b2264 development board - ux500 based Samsung phones: Gavini, Codina and Kyle - TI AM335x based Sancloud BBE Lite - ixp4xx dts files to replace all old board files Other changes: - Treewide fixes for dtc warnings - Rockchips i/o domain support - TI OMAP/AM3 CPSW switch driver support - Improved device support for allwinner, aspeed, qualcomm, NXP, nvidia, Renesas, Samsung, Amlogic, Mediatek, ixp4xx, stm32, sti, OMAP and actions" * tag 'dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (412 commits) arm/arm64: dts: Fix remaining dtc 'unit_address_format' warnings ARM: dts: rockchip: Add SFC to RV1108 arm64: dts: marvell: armada-37xx: Extend PCIe MEM space ARM: dts: aspeed: p10bmc: Add power control pins ARM: dts: aspeed: cloudripper: Add comments for "mdio1" ARM: dts: aspeed: minipack: Update flash partition table dt-bindings: arm: fsl: Add Traverse Ten64 (LS1088A) board dt-bindings: vendor-prefixes: add Traverse Technologies arm64: dts: add device tree for Traverse Ten64 (LS1088A) arm64: dts: ls1088a: add missing PMU node arm64: dts: ls1088a: add internal PCS for DPMAC1 node ARM: dts: imx6qp-prtwd3: configure ENET_REF clock to 125MHz ARM: dts: vf610-zii-dev-rev-b: Remove #address-cells and #size-cells property from at93c46d dt node ARM: dts: add SKOV imx6q and imx6dl based boards dt-bindings: arm: fsl: add SKOV imx6q and imx6dl based boards dt-bindings: vendor-prefixes: Add an entry for SKOV A/S arm64: dts: imx8mq-reform2: add sound support arm64: dts: imx8m: drop interrupt-affinity for pmu arm64: dts: imx8qxp: update pmu compatible arm64: dts: imx8mm: update pmu compatible ... commit 32b47072f319bb65e9afad59e78153d83496f1f5 Merge: 866147b8fa595 79cd0bb66e359 Author: Linus Torvalds Date: Wed Sep 1 15:28:28 2021 -0700 Merge tag 'defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "The usual set of defconfig updates, including one new defconfig file for the new sama7 family of SoCs" * tag 'defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: config: aspeed: Regenerate defconfigs ARM: config: aspeed_g4: Enable EDAC and SPGIO ARM: config: aspeed: Enable KCS adapter for raw SerIO ARM: config: aspeed: Enable hardened allocator feature ARM: imx_v6_v7_defconfig: enable driver of the LTC3676 PMIC ARM: multi_v7_defconfig: Enable CONFIG_TEGRA30_TSENSOR ARM: multi_v7_defconfig: Enable Acer A500 drivers ARM: tegra: Rebuild default configuration ARM: tegra: Enable CONFIG_CROS_EC ARM: tegra: Enable Acer A500 drivers ARM: tegra: Enable CONFIG_FB ARM: tegra: Enable CONFIG_TEGRA30_TSENSOR ARM: configs: multi_v7: enable PL35x NAND controller arm64: defconfig: Enable Qualcomm MSM8996 CPU clock driver ARM: imx_v6_v7_defconfig: Let CONFIG_SCSI_LOWLEVEL be selected ARM: imx_v6_v7_defconfig: Select CONFIG_KPROBES ARM: multi_v7_defconfig: Enable CONFIG_MMC_MESON_MX_SDHC ARM: multi_v7_defconfig: add sama7g5 SoC ARM: configs: at91: add defconfig for sama7 family of SoCs commit 47505bf3a82166c3576155c229e941af922bf147 Merge: 8fb59ce15c43d aaedb9e00e540 3e061910b2a2e 46d4ee48aaef1 e7296d16ef7be c16edf5ff8ece Author: Stephen Boyd Date: Wed Sep 1 15:27:07 2021 -0700 Merge branches 'clk-kirkwood', 'clk-imx', 'clk-doc', 'clk-zynq' and 'clk-ralink' into clk-next * clk-kirkwood: clk: kirkwood: Fix a clocking boot regression * clk-imx: clk: imx8mn: Add M7 core clock clk: imx8m: fix clock tree update of TF-A managed clocks clk: imx: clk-divider-gate: Switch to clk_divider.determine_rate clk: imx8mn: use correct mux type for clkout path clk: imx8mm: use correct mux type for clkout path * clk-doc: dt-bindings: clock: samsung: fix header path in example MAINTAINERS: clock: include S3C and S5P in Samsung SoC clock entry dt-bindings: clock: samsung: convert S5Pv210 AudSS to dtschema dt-bindings: clock: samsung: convert Exynos AudSS to dtschema dt-bindings: clock: samsung: convert Exynos4 to dtschema dt-bindings: clock: samsung: convert Exynos3250 to dtschema dt-bindings: clock: samsung: convert Exynos542x to dtschema dt-bindings: clock: samsung: add bindings for Exynos external clock dt-bindings: clock: samsung: convert Exynos5250 to dtschema dt-bindings: clock: brcm,iproc-clocks: fix armpll properties clk: zynqmp: Fix kernel-doc format clk: at91: sama7g5: remove all kernel-doc & kernel-doc warnings clk: zynqmp: fix kernel doc * clk-zynq: clk: zynqmp: Fix a memory leak clk: zynqmp: Check the return type * clk-ralink: clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates commit 8fb59ce15c43d025dadc2df3d21590bd1e91eff0 Merge: 1faa7cb2b066a 27115441b938b 1d070108354b6 af7651e67b9d5 d83e561d43bc7 Author: Stephen Boyd Date: Wed Sep 1 15:26:58 2021 -0700 Merge branches 'clk-nvidia', 'clk-rockchip', 'clk-at91' and 'clk-vc5' into clk-next - Support the SD/OE pin on IDT VersaClock 5 and 6 clock generators * clk-nvidia: clk: tegra: fix old-style declaration clk: tegra: Remove CLK_IS_CRITICAL flag from fuse clock soc/tegra: fuse: Enable fuse clock on suspend for Tegra124 soc/tegra: fuse: Add runtime PM support soc/tegra: fuse: Clear fuse->clk on driver probe failure soc/tegra: pmc: Prevent racing with cpuilde driver soc/tegra: bpmp: Remove unused including * clk-rockchip: clk: rockchip: make rk3308 ddrphy4x clock critical clk: rockchip: drop GRF dependency for rk3328/rk3036 pll types dt-bindings: clk: Convert rockchip,rk3399-cru to DT schema clk: rockchip: Add support for hclk_sfc on rk3036 clk: rockchip: rk3036: fix up the sclk_sfc parent error clk: rockchip: add dt-binding clkid for hclk_sfc on rk3036 * clk-at91: clk: at91: clk-generated: Limit the requested rate to our range * clk-vc5: clk: vc5: Add properties for configuring SD/OE behavior clk: vc5: Use dev_err_probe dt-bindings: clk: vc5: Add properties for configuring the SD/OE pin commit 1faa7cb2b066a3f8966a1311d574832ccb93a72c Merge: 7110569a096d8 e81b917a78c7e Author: Stephen Boyd Date: Wed Sep 1 15:26:42 2021 -0700 Merge branch 'clk-frac-divider' into clk-next - Add power of two flag to fractional divider clk type * clk-frac-divider: clk: fractional-divider: Document the arithmetics used behind the code clk: fractional-divider: Introduce POWER_OF_TWO_PS flag clk: fractional-divider: Hide clk_fractional_divider_ops from wide audience clk: fractional-divider: Export approximation algorithm to the CCF users commit 866147b8fa59530812fc769027a94468d89401e7 Merge: 634135a07b887 06779631d18ff Author: Linus Torvalds Date: Wed Sep 1 15:25:28 2021 -0700 Merge tag 'drivers-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "These are updates for drivers that are tied to a particular SoC, including the correspondig device tree bindings: - A couple of reset controller changes for unisoc, uniphier, renesas and zte platforms - memory controller driver fixes for omap and tegra - Rockchip io domain driver updates - Lots of updates for qualcomm platforms, mostly touching their firmware and power management drivers - Tegra FUSE and firmware driver updateѕ - Support for virtio transports in the SCMI firmware framework - cleanup of ixp4xx drivers, towards enabling multiplatform support and bringing it up to date with modern platforms - Minor updates for keystone, mediatek, omap, renesas" * tag 'drivers-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (96 commits) reset: simple: remove ZTE details in Kconfig help soc: rockchip: io-domain: Remove unneeded semicolon soc: rockchip: io-domain: add rk3568 support dt-bindings: power: add rk3568-pmu-io-domain support bus: ixp4xx: return on error in ixp4xx_exp_probe() soc: renesas: Prefer memcpy() over strcpy() firmware: tegra: Stop using seq_get_buf() soc/tegra: fuse: Enable fuse clock on suspend for Tegra124 soc/tegra: fuse: Add runtime PM support soc/tegra: fuse: Clear fuse->clk on driver probe failure soc/tegra: pmc: Prevent racing with cpuilde driver soc/tegra: bpmp: Remove unused including dt-bindings: soc: ti: pruss: Add dma-coherent property soc: ti: Remove pm_runtime_irq_safe() usage for smartreflex soc: ti: pruss: Enable support for ICSSG subsystems on K3 AM64x SoCs dt-bindings: soc: ti: pruss: Update bindings for K3 AM64x SoCs firmware: arm_scmi: Use WARN_ON() to check configured transports firmware: arm_scmi: Fix boolconv.cocci warnings soc: mediatek: mmsys: Fix missing UFOE component in mt8173 table routing soc: mediatek: mmsys: add MT8365 support ... commit 7110569a096d820876f99543660741bd8a96af7c Merge: 4990d8c1333dc a1cde1f0172ee 28fc39f7abeca 23a57ee7af01a Author: Stephen Boyd Date: Wed Sep 1 15:25:15 2021 -0700 Merge branches 'clk-renesas', 'clk-cleanup' and 'clk-determine-divider' into clk-next - Migrate some clk drivers to clk_divider_ops.determine_rate * clk-renesas: clk: renesas: Make CLK_R9A06G032 invisible clk: renesas: r9a07g044: Add entry for fixed clock P0_DIV2 dt-bindings: clock: r9a07g044-cpg: Add entry for P0_DIV2 core clock clk: renesas: r9a07g044: Add clock and reset entries for ADC clk: renesas: r9a07g044: Add clock and reset entries for CANFD clk: renesas: Rename renesas-rzg2l-cpg.[ch] to rzg2l-cpg.[ch] clk: renesas: r9a07g044: Add GPIO clock and reset entries clk: renesas: r9a07g044: Add SSIF-2 clock and reset entries clk: renesas: r9a07g044: Add USB clocks/resets clk: renesas: r9a07g044: Add DMAC clocks/resets clk: renesas: r9a07g044: Add I2C clocks/resets clk: renesas: r8a779a0: Add the DSI clocks clk: renesas: r8a779a0: Add the DU clock clk: renesas: rzg2: Rename i2c-dvfs to iic-pmic clk: renesas: rzg2l: Fix off-by-one check in rzg2l_cpg_clk_src_twocell_get() clk: renesas: rzg2l: Avoid mixing error pointers and NULL clk: renesas: rzg2l: Fix a double free on error clk: renesas: rzg2l: Fix return value and unused assignment clk: renesas: rzg2l: Remove unneeded semicolon * clk-cleanup: clk: palmas: Add a missing SPDX license header clk: Align provider-specific CLK_* bit definitions * clk-determine-divider: clk: stm32mp1: Switch to clk_divider.determine_rate clk: stm32h7: Switch to clk_divider.determine_rate clk: stm32f4: Switch to clk_divider.determine_rate clk: bcm2835: Switch to clk_divider.determine_rate clk: divider: Implement and wire up .determine_rate by default commit 4990d8c1333dc827aff8f18ff616bec4e9a32e2d Merge: 2734d6c1b1a08 131abae905df9 d17929eb1066d d17e4e62df328 284c537a8aceb cf0a95659e659 Author: Stephen Boyd Date: Wed Sep 1 15:24:59 2021 -0700 Merge branches 'clk-qcom', 'clk-socfpga', 'clk-mediatek', 'clk-lmk' and 'clk-x86' into clk-next - Support video, gpu, display clks on qcom sc7280 SoCs - GCC clks on qcom MSM8953, SM4250/6115, and SM6350 SoCs - Multimedia clks (MMCC) on qcom MSM8994/MSM8992 - Migrate to clk_parent_data in gcc-sdm660 - RPMh clks on qcom SM6350 SoCs - Support for Mediatek MT8192 SoCs * clk-qcom: (38 commits) clk: qcom: Add SM6350 GCC driver dt-bindings: clock: Add SM6350 GCC clock bindings clk: qcom: rpmh: Add support for RPMH clocks on SM6350 dt-bindings: clock: Add RPMHCC bindings for SM6350 clk: qcom: adjust selects for SM_VIDEOCC_8150 and SM_VIDEOCC_8250 clk: qcom: Add Global Clock controller (GCC) driver for SM6115 dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC clk: qcom: mmcc-msm8994: Add MSM8992 support clk: qcom: Add msm8994 MMCC driver dt-bindings: clock: Add support for MSM8992/4 MMCC clk: qcom: Add Global Clock Controller driver for MSM8953 dt-bindings: clock: add Qualcomm MSM8953 GCC driver bindings clk: qcom: gcc-sdm660: Replace usage of parent_names clk: qcom: gcc-sdm660: Move parent tables after PLLs clk: qcom: use devm_pm_runtime_enable and devm_pm_clk_create PM: runtime: add devm_pm_clk_create helper PM: runtime: add devm_pm_runtime_enable helper clk: qcom: a53-pll: Add MSM8939 a53pll support dt-bindings: clock: Update qcom,a53pll bindings for MSM8939 support clk: qcom: a53pll/mux: Use unique clock name ... * clk-socfpga: clk: socfpga: agilex: add the bypass register for s2f_usr0 clock clk: socfpga: agilex: fix up s2f_user0_clk representation clk: socfpga: agilex: fix the parents of the psi_ref_clk * clk-mediatek: (22 commits) clk: mediatek: make COMMON_CLK_MT8167* depend on COMMON_CLK_MT8167 clk: mediatek: Add MT8192 vencsys clock support clk: mediatek: Add MT8192 vdecsys clock support clk: mediatek: Add MT8192 scp adsp clock support clk: mediatek: Add MT8192 msdc clock support clk: mediatek: Add MT8192 mmsys clock support clk: mediatek: Add MT8192 mfgcfg clock support clk: mediatek: Add MT8192 mdpsys clock support clk: mediatek: Add MT8192 ipesys clock support clk: mediatek: Add MT8192 imp i2c wrapper clock support clk: mediatek: Add MT8192 imgsys clock support clk: mediatek: Add MT8192 camsys clock support clk: mediatek: Add MT8192 audio clock support clk: mediatek: Add MT8192 basic clocks support clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers clk: mediatek: Add configurable enable control to mtk_pll_data clk: mediatek: Fix asymmetrical PLL enable and disable control clk: mediatek: Get regmap without syscon compatible check clk: mediatek: Add dt-bindings of MT8192 clocks dt-bindings: ARM: Mediatek: Add audsys document binding for MT8192 ... * clk-lmk: clk: lmk04832: drop redundant fallthrough statements * clk-x86: clk: x86: Rename clk-lpt to more specific clk-lpss-atom commit 634135a07b887a8ad8904da8c147407650747a38 Merge: 4cdc4cc2ad35f 51e321fed0ff8 Author: Linus Torvalds Date: Wed Sep 1 15:19:43 2021 -0700 Merge tag 'soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "There are three noteworthy updates for 32-bit arm platforms this time: - The Microchip SAMA7 family based on Cortex-A7 gets introduced, a new cousin to the older SAM9 (ARM9xx based) and SAMA5 (Cortex-A5 based) SoCs. - The ixp4xx platform (based on Intel XScale) is finally converted to device tree, and all the old board files are getting removed now. - The Cirrus Logic EP93xx platform loses support for the old MaverickCrunch FPU. Support for compiling user space applications was already removed in gcc-4.9, and the kernel support for old applications could not be built with clang ias. After confirming that there are no remaining users, removing this from the kernel seemed better than adding support for unused features to clang. There are minor updates to the aspeed, omap and samsung platforms" * tag 'soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (48 commits) soc: aspeed-lpc-ctrl: Fix clock cleanup in error path ARM: s3c: delete unneed local variable "delay" soc: aspeed: Re-enable FWH2AHB on AST2600 soc: aspeed: socinfo: Add AST2625 variant soc: aspeed: p2a-ctrl: Fix boundary check for mmap soc: aspeed: lpc-ctrl: Fix boundary check for mmap ARM: ixp4xx: Delete the Freecom FSG-3 boardfiles ARM: ixp4xx: Delete GTWX5715 board files ARM: ixp4xx: Delete Coyote and IXDPG425 boardfiles ARM: ixp4xx: Delete Intel reference design boardfiles ARM: ixp4xx: Delete Avila boardfiles ARM: ixp4xx: Delete the Arcom Vulcan boardfiles ARM: ixp4xx: Delete Gateway WG302v2 boardfiles ARM: ixp4xx: Delete Omicron boardfiles ARM: ixp4xx: Delete the D-Link DSM-G600 boardfiles ARM: ixp4xx: Delete NAS100D boardfiles ARM: ixp4xx: Delete NSLU2 boardfiles arm: omap2: Drop the unused OMAP_PACKAGE_* KConfig entries arm: omap2: Drop obsolete MACH_OMAP3_PANDORA entry ARM: ep93xx: remove MaverickCrunch support ... commit 4cdc4cc2ad35f92338497d53d3e8b7876cf2a51d Merge: 57c78a234e809 8f76f9c469526 Author: Linus Torvalds Date: Wed Sep 1 15:13:02 2021 -0700 Merge tag 'asm-generic-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic updates from Arnd Bergmann: "The main content for 5.15 is a series that cleans up the handling of strncpy_from_user() and strnlen_user(), removing a lot of slightly incorrect versions of these in favor of the lib/strn*.c helpers that implement these correctly and more efficiently. The only architectures that retain a private version now are mips, ia64, um and parisc. I had offered to convert those at all, but Thomas Bogendoerfer wanted to keep the mips version for the moment until he had a chance to do regression testing. The branch also contains two patches for bitops and for ffs()" * tag 'asm-generic-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: bitops/non-atomic: make @nr unsigned to avoid any DIV asm-generic: ffs: Drop bogus reference to ffz location asm-generic: reverse GENERIC_{STRNCPY_FROM,STRNLEN}_USER symbols asm-generic: remove extra strn{cpy_from,len}_user declarations asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user s390: use generic strncpy/strnlen from_user microblaze: use generic strncpy/strnlen from_user csky: use generic strncpy/strnlen from_user arc: use generic strncpy/strnlen from_user hexagon: use generic strncpy/strnlen from_user h8300: remove stale strncpy_from_user asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user commit 57c78a234e809e3a0516491e37ae5ccc6eeb21e8 Merge: bcfeebbff3627 65266a7c6abfa Author: Linus Torvalds Date: Wed Sep 1 15:04:29 2021 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: - Support for 32-bit tasks on asymmetric AArch32 systems (on top of the scheduler changes merged via the tip tree). - More entry.S clean-ups and conversion to C. - MTE updates: allow a preferred tag checking mode to be set per CPU (the overhead of synchronous mode is smaller for some CPUs than others); optimisations for kernel entry/exit path; optionally disable MTE on the kernel command line. - Kselftest improvements for SVE and signal handling, PtrAuth. - Fix unlikely race where a TLBI could use stale ASID on an ASID roll-over (found by inspection). - Miscellaneous fixes: disable trapping of PMSNEVFR_EL1 to higher exception levels; drop unnecessary sigdelsetmask() call in the signal32 handling; remove BUG_ON when failing to allocate SVE state (just signal the process); SYM_CODE annotations. - Other trivial clean-ups: use macros instead of magic numbers, remove redundant returns, typos. * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (56 commits) arm64: Do not trap PMSNEVFR_EL1 arm64: mm: fix comment typo of pud_offset_phys() arm64: signal32: Drop pointless call to sigdelsetmask() arm64/sve: Better handle failure to allocate SVE register storage arm64: Document the requirement for SCR_EL3.HCE arm64: head: avoid over-mapping in map_memory arm64/sve: Add a comment documenting the binutils needed for SVE asm arm64/sve: Add some comments for sve_save/load_state() kselftest/arm64: signal: Add a TODO list for signal handling tests kselftest/arm64: signal: Add test case for SVE register state in signals kselftest/arm64: signal: Verify that signals can't change the SVE vector length kselftest/arm64: signal: Check SVE signal frame shows expected vector length kselftest/arm64: signal: Support signal frames with SVE register data kselftest/arm64: signal: Add SVE to the set of features we can check for arm64: replace in_irq() with in_hardirq() kselftest/arm64: pac: Fix skipping of tests on systems without PAC Documentation: arm64: describe asymmetric 32-bit support arm64: Remove logic to kill 32-bit tasks on 64-bit-only cores arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 arm64: Advertise CPUs capable of running 32-bit applications in sysfs ... commit bcfeebbff3627093014c7948aec9cc4730e50c3d Merge: 48983701a1e0e d21918e5a94a8 Author: Linus Torvalds Date: Wed Sep 1 14:52:05 2021 -0700 Merge branch 'exit-cleanups-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull exit cleanups from Eric Biederman: "In preparation of doing something about PTRACE_EVENT_EXIT I have started cleaning up various pieces of code related to do_exit. Most of that code I did not manage to get tested and reviewed before the merge window opened but a handful of very useful cleanups are ready to be merged. The first change is simply the removal of the bdflush system call. The code has now been disabled long enough that even the oldest userspace working userspace setups anyone can find to test are fine with the bdflush system call being removed. Changing m68k fsp040_die to use force_sigsegv(SIGSEGV) instead of calling do_exit directly is interesting only in that it is nearly the most difficult of the incorrect uses of do_exit to remove. The change to the seccomp code to simply send a signal instead of calling do_coredump directly is a very nice little cleanup made possible by realizing the existing signal sending helpers were missing a little bit of functionality that is easy to provide" * 'exit-cleanups-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal/seccomp: Dump core when there is only one live thread signal/seccomp: Refactor seccomp signal and coredump generation signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die exit/bdflush: Remove the deprecated bdflush system call commit 48983701a1e0e252faa4aab274ba14419cb286fa Merge: 477f70cd2a679 ee53488cc7414 Author: Linus Torvalds Date: Wed Sep 1 14:42:36 2021 -0700 Merge branch 'siginfo-si_trapno-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull siginfo si_trapno updates from Eric Biederman: "The full set of si_trapno changes was not appropriate as a fix for the newly added SIGTRAP TRAP_PERF, and so I postponed the rest of the related cleanups. This is the rest of the cleanups for si_trapno that reduces it from being a really weird arch special case that is expect to be always present (but isn't) on the architectures that support it to being yet another field in the _sigfault union of struct siginfo. The changes have been reviewed and marinated in linux-next. With the removal of this awkward special case new code (like SIGTRAP TRAP_PERF) that works across architectures should be easier to write and maintain" * 'siginfo-si_trapno-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: Rename SIL_PERF_EVENT SIL_FAULT_PERF_EVENT for consistency signal: Verify the alignment and size of siginfo_t signal: Remove the generic __ARCH_SI_TRAPNO support signal/alpha: si_trapno is only used with SIGFPE and SIGTRAP TRAP_UNK signal/sparc: si_trapno is only used with SIGILL ILL_ILLTRP arm64: Add compile-time asserts for siginfo_t offsets arm: Add compile-time asserts for siginfo_t offsets sparc64: Add compile-time asserts for siginfo_t offsets commit d6043581e1d9d0507a8413a302db0e35c8506e0e Author: Alex Sierra Date: Tue Aug 31 21:05:02 2021 -0500 drm/amdkfd: drop process ref count when xnack disable During svm restore pages interrupt handler, kfd_process ref count was never dropped when xnack was disabled. Therefore, the object was never released. Fixes: 2383f56bbe4a ("drm/amdkfd: page table restore through svm API") Signed-off-by: Alex Sierra Reviewed-by: Philip Yang Reviewed-by: Jonathan Kim Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c8b177b6e3a005bd8fb0395a4bc5db3470301c28 Author: Alexander Tsoy Date: Tue Aug 31 03:25:31 2021 +0300 ALSA: usb-audio: Add registration quirk for JBL Quantum 800 Add another device ID for JBL Quantum 800. It requires the same quirk as other JBL Quantum devices. Signed-off-by: Alexander Tsoy Cc: Link: https://lore.kernel.org/r/20210831002531.116957-1-alexander@tsoy.me Signed-off-by: Takashi Iwai commit 6f1fce595b78b775d7fb585c15c2dc3a6994f96e Author: Helge Deller Date: Wed Sep 1 22:18:18 2021 +0200 parisc: math-emu: Fix fall-through warnings Fix lots of fallthrough warnings, e.g.: arch/parisc/math-emu/fpudispatch.c:323:33: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Helge Deller commit 46a226b50ec3d5d9ff2f4399702ff6c1b427f824 Merge: 2501ce96ecd00 3b41fb4094914 Author: Jiri Kosina Date: Wed Sep 1 22:11:24 2021 +0200 Merge branch 'for-5.15/apple' into for-linus - Support proper EV_MSC emissions to hid-apple (Vincent Lefevre) commit 2501ce96ecd00f817323c1014a870dc9710ddb82 Merge: fcbc26eb92545 9d339fe4cbd5d Author: Jiri Kosina Date: Wed Sep 1 22:04:50 2021 +0200 Merge branch 'for-5.15/wacom' into for-linus commit fcbc26eb92545ba5e2828f2dcffd1c4bdd82b373 Merge: 854a95877f4d9 c3800eed22d21 Author: Jiri Kosina Date: Wed Sep 1 22:04:05 2021 +0200 Merge branch 'for-5.15/thrustmaster' into for-linus - Fixes for memory leaks commit 854a95877f4d95b65918cb126fdc0c84ea564676 Merge: 163a312466790 a4bfe13f96bf8 Author: Jiri Kosina Date: Wed Sep 1 22:03:18 2021 +0200 Merge branch 'for-5.15/sony' into for-linus - Support for GHLive PS4 dongles commit 163a3124667901c29978bf67c0ffdcc9650515ac Merge: 1138b33192426 9d60648c607a2 Author: Jiri Kosina Date: Wed Sep 1 22:02:37 2021 +0200 Merge branch 'for-5.15/magicmouse' into for-linus - High-resolution scroll support for Magicmouse devices commit 1138b3319242695dce82896e710c2290cf53770c Merge: 6ef9233f4a42c b23cdfbddb73b Author: Jiri Kosina Date: Wed Sep 1 22:02:15 2021 +0200 Merge branch 'for-5.15/logitech' into for-linus commit 6ef9233f4a42c290ef745a8a5242673707894856 Merge: dab6e4f452c2f 25ddd7cfc582d Author: Jiri Kosina Date: Wed Sep 1 22:01:27 2021 +0200 Merge branch 'for-5.15/goodix' into for-linus - power management improvement for Goodix driver commit dab6e4f452c2fd45c15c701e6f7be665a72c7add Merge: e4ee5090e3e5e d2f311ec91984 Author: Jiri Kosina Date: Wed Sep 1 22:00:06 2021 +0200 Merge branch 'for-5.15/core' into for-linus - Regression fix for an issue in HID core that got uncovered by recent USB core cleanup leading to issues when transfer_buffer_length is not in line with wLength - Memory leak fix in USB HID core - Improvement of stylus battery reporting commit e4ee5090e3e5e9c2f38aa761436fc494e3a80937 Merge: 56e527b0f790d bebf8820b355e Author: Jiri Kosina Date: Wed Sep 1 21:56:46 2021 +0200 Merge branch 'for-5.15/cmedia' into for-linus commit 56e527b0f790dd8e7f077b9197eba11f2117a527 Merge: bab94e97323ba e665775591865 Author: Jiri Kosina Date: Wed Sep 1 21:54:57 2021 +0200 Merge branch 'for-5.15/amd-sfh' into for-linus - Updates to the existing FW reporting mechanism, MP2 FW status checks, adding proper power management support for amd-sfh commit 030f653078316a9cc9ca6bd1b0234dcf858be35d Author: Mikulas Patocka Date: Mon Aug 30 05:42:27 2021 -0400 parisc: fix crash with signals and alloca I was debugging some crashes on parisc and I found out that there is a crash possibility if a function using alloca is interrupted by a signal. The reason for the crash is that the gcc alloca implementation leaves garbage in the upper 32 bits of the sp register. This normally doesn't matter (the upper bits are ignored because the PSW W-bit is clear), however the signal delivery routine in the kernel uses full 64 bits of sp and it fails with -EFAULT if the upper 32 bits are not zero. I created this program that demonstrates the problem: #include #include #include #include static __attribute__((noinline,noclone)) void aa(int *size) { void * volatile p = alloca(-*size); while (1) ; } static void handler(int sig) { write(1, "signal delivered\n", 17); _exit(0); } int main(void) { int size = -0x100; signal(SIGALRM, handler); alarm(1); aa(&size); } If you compile it with optimizations, it will crash. The "aa" function has this disassembly: 000106a0 : 106a0: 08 03 02 41 copy r3,r1 106a4: 08 1e 02 43 copy sp,r3 106a8: 6f c1 00 80 stw,ma r1,40(sp) 106ac: 37 dc 3f c1 ldo -20(sp),ret0 106b0: 0c 7c 12 90 stw ret0,8(r3) 106b4: 0f 40 10 9c ldw 0(r26),ret0 ; ret0 = 0x00000000FFFFFF00 106b8: 97 9c 00 7e subi 3f,ret0,ret0 ; ret0 = 0xFFFFFFFF0000013F 106bc: d7 80 1c 1a depwi 0,31,6,ret0 ; ret0 = 0xFFFFFFFF00000100 106c0: 0b 9e 0a 1e add,l sp,ret0,sp ; sp = 0xFFFFFFFFxxxxxxxx 106c4: e8 1f 1f f7 b,l,n 106c4 ,r0 This patch fixes the bug by truncating the "usp" variable to 32 bits. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e Author: Masahiro Yamada Date: Thu Jun 10 11:03:31 2021 +0900 parisc: Fix compile failure when building 64-bit kernel natively Commit 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") broke 64-bit parisc builds on 32-bit parisc systems. Helge mentioned: - 64-bit parisc userspace is not supported yet [1] - hppa gcc does not support "-m64" flag [2] That means, parisc developers working on a 32-bit parisc machine need to use hppa64-linux-gnu-gcc (cross compiler) for building the 64-bit parisc kernel. After the offending commit, gcc is used in such a case because both $(SRCARCH) and $(SUBARCH) are 'parisc', hence cross_compiling is unset. A correct way is to introduce ARCH=parisc64 because building the 64-bit parisc kernel on a 32-bit parisc system is not exactly a native build, but rather a semi-cross build. [1]: https://lore.kernel.org/linux-parisc/5dfd81eb-c8ca-b7f5-e80e-8632767c022d@gmx.de/#t [2]: https://lore.kernel.org/linux-parisc/89515325-fc21-31da-d238-6f7a9abbf9a0@gmx.de/ Fixes: 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") Signed-off-by: Masahiro Yamada Reported-by: Meelis Roos Tested-by: Meelis Roos Cc: # v5.13+ Signed-off-by: Helge Deller commit 8ef5b28d670b76601e14476b00a505854abc838b Author: Shubhankar Kuranagatti Date: Wed Apr 28 21:09:42 2021 +0530 parisc: ccio-dma.c: Added tab instead of spaces Single spaces has been removed and replaced with tabs. This is done to maintain code uniformity. Signed-off-by: Shubhankar Kuranagatti Reported-by: kernel test robot Signed-off-by: Helge Deller commit d2f311ec91984adb219ac6985d4dd72c37ae734d Author: Alan Stern Date: Wed Sep 1 12:36:06 2021 -0400 HID: usbhid: Simplify code in hid_submit_ctrl() This patch makes a small simplification to the code in hid_submit_ctrl(). The test for maxpacket being > 0 is unnecessary, because endpoint 0 always has a maxpacket value which is >= 8. Furthermore, endpoint 0's maxpacket value is always a power of 2, so instead of open-coding the round-to-next-multiple computation we can call the optimized round_up() routine. Signed-off-by: Alan Stern Tested-by: Benjamin Tissoires Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 0a824efdb724e07574bafcd2c2486b2a3de35ff6 Author: Alan Stern Date: Wed Sep 1 12:36:00 2021 -0400 HID: usbhid: Fix warning caused by 0-length input reports Syzbot found a warning caused by hid_submit_ctrl() submitting a control request to transfer a 0-length input report: usb 1-1: BOGUS control dir, pipe 80000280 doesn't match bRequestType a1 (The warning message is a little difficult to understand. It means that the control request claims to be for an IN transfer but this contradicts the USB spec, which requires 0-length control transfers always to be in the OUT direction.) Now, a zero-length report isn't good for anything and there's no reason for a device to have one, but the fuzzer likes to pick out these weird edge cases. In the future, perhaps we will decide to reject 0-length reports at probe time. For now, the simplest approach for avoiding these warnings is to pretend that the report actually has length 1. Signed-off-by: Alan Stern Reported-and-tested-by: syzbot+9b57a46bf1801ce2a2ca@syzkaller.appspotmail.com Tested-by: Oleksandr Natalenko Tested-by: Benjamin Tissoires Acked-by: Benjamin Tissoires Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina commit 5049307d37a760e304ad191c5dc7c6851266d2f8 Author: Michal Kubecek Date: Wed Sep 1 12:35:49 2021 -0400 HID: usbhid: Fix flood of "control queue full" messages [patch description by Alan Stern] Commit 7652dd2c5cb7 ("USB: core: Check buffer length matches wLength for control transfers") causes control URB submissions to fail if the transfer_buffer_length value disagrees with the setup packet's wLength valuel. Unfortunately, it turns out that the usbhid can trigger this failure mode when it submits a control request for an input report: It pads the transfer buffer size to a multiple of the maxpacket value but does not increase wLength correspondingly. These failures have caused problems for people using an APS UPC, in the form of a flood of log messages resembling: hid-generic 0003:051D:0002.0002: control queue full This patch fixes the problem by setting the wLength value equal to the padded transfer_buffer_length value in hid_submit_ctrl(). As a nice bonus, the code which stores the transfer_buffer_length value is now shared between the two branches of an "if" statement, so it can be de-duplicated. Signed-off-by: Michal Kubecek Signed-off-by: Alan Stern Fixes: 7652dd2c5cb7 ("USB: core: Check buffer length matches wLength for control transfers") Tested-by: Oleksandr Natalenko Tested-by: Benjamin Tissoires Acked-by: Benjamin Tissoires Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina commit 15e20db2e0cecce0bfc6a67b69e55020fe9cda00 Author: Jens Axboe Date: Wed Sep 1 11:18:41 2021 -0600 io-wq: only exit on fatal signals If the application uses io_uring and also relies heavily on signals for communication, that can cause io-wq workers to spuriously exit just because the parent has a signal pending. Just ignore signals unless they are fatal. Signed-off-by: Jens Axboe commit f95dc207b93da9c88ddbb7741ec3730c6657b88e Author: Jens Axboe Date: Tue Aug 31 13:57:32 2021 -0600 io-wq: split bounded and unbounded work into separate lists We've got a few issues that all boil down to the fact that we have one list of pending work items, yet two different types of workers to serve them. This causes some oddities around workers switching type and even hashed work vs regular work on the same bounded list. Just separate them out cleanly, similarly to how we already do accounting of what is running. That provides a clean separation and removes some corner cases that can cause stalls when handling IO that is punted to io-wq. Fixes: ecc53c48c13d ("io-wq: check max_worker limits if a worker transitions bound state") Signed-off-by: Jens Axboe commit 477f70cd2a67904e04c2c2b9bd0fa2e95222f2f6 Merge: 835d31d319d9c 8f0284f190e6a Author: Linus Torvalds Date: Wed Sep 1 11:26:46 2021 -0700 Merge tag 'drm-next-2021-08-31-1' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Highlights: - i915 has seen a lot of refactoring and uAPI cleanups due to a change in the upstream direction going forward This has all been audited with known userspace, but there may be some pitfalls that were missed. - i915 now uses common TTM to enable discrete memory on DG1/2 GPUs - i915 enables Jasper and Elkhart Lake by default and has preliminary XeHP/DG2 support - amdgpu adds support for Cyan Skillfish - lots of implicit fencing rules documented and fixed up in drivers - msm now uses the core scheduler - the irq midlayer has been removed for non-legacy drivers - the sysfb code now works on more than x86. Otherwise the usual smattering of stuff everywhere, panels, bridges, refactorings. Detailed summary: core: - extract i915 eDP backlight into core - DP aux bus support - drm_device.irq_enabled removed - port drivers to native irq interfaces - export gem shadow plane handling for vgem - print proper driver name in framebuffer registration - driver fixes for implicit fencing rules - ARM fixed rate compression modifier added - updated fb damage handling - rmfb ioctl logging/docs - drop drm_gem_object_put_locked - define DRM_FORMAT_MAX_PLANES - add gem fb vmap/vunmap helpers - add lockdep_assert(once) helpers - mark drm irq midlayer as legacy - use offset adjusted bo mapping conversion vgaarb: - cleanups fbdev: - extend efifb handling to all arches - div by 0 fixes for multiple drivers udmabuf: - add hugepage mapping support dma-buf: - non-dynamic exporter fixups - document implicit fencing rules amdgpu: - Initial Cyan Skillfish support - switch virtual DCE over to vkms based atomic - VCN/JPEG power down fixes - NAVI PCIE link handling fixes - AMD HDMI freesync fixes - Yellow Carp + Beige Goby fixes - Clockgating/S0ix/SMU/EEPROM fixes - embed hw fence in job - rework dma-resv handling - ensure eviction to system ram amdkfd: - uapi: SVM address range query added - sysfs leak fix - GPUVM TLB optimizations - vmfault/migration counters i915: - Enable JSL and EHL by default - preliminary XeHP/DG2 support - remove all CNL support (never shipped) - move to TTM for discrete memory support - allow mixed object mmap handling - GEM uAPI spring cleaning - add I915_MMAP_OBJECT_FIXED - reinstate ADL-P mmap ioctls - drop a bunch of unused by userspace features - disable and remove GPU relocations - revert some i915 misfeatures - major refactoring of GuC for Gen11+ - execbuffer object locking separate step - reject caching/set-domain on discrete - Enable pipe DMC loading on XE-LPD and ADL-P - add PSF GV point support - Refactor and fix DDI buffer translations - Clean up FBC CFB allocation code - Finish INTEL_GEN() and friends macro conversions nouveau: - add eDP backlight support - implicit fence fix msm: - a680/7c3 support - drm/scheduler conversion panfrost: - rework GPU reset virtio: - fix fencing for planes ast: - add detect support bochs: - move to tiny GPU driver vc4: - use hotplug irqs - HDMI codec support vmwgfx: - use internal vmware device headers ingenic: - demidlayering irq rcar-du: - shutdown fixes - convert to bridge connector helpers zynqmp-dsub: - misc fixes mgag200: - convert PLL handling to atomic mediatek: - MT8133 AAL support - gem mmap object support - MT8167 support etnaviv: - NXP Layerscape LS1028A SoC support - GEM mmap cleanups tegra: - new user API exynos: - missing unlock fix - build warning fix - use refcount_t" * tag 'drm-next-2021-08-31-1' of git://anongit.freedesktop.org/drm/drm: (1318 commits) drm/amd/display: Move AllowDRAMSelfRefreshOrDRAMClockChangeInVblank to bounding box drm/amd/display: Remove duplicate dml init drm/amd/display: Update bounding box states (v2) drm/amd/display: Update number of DCN3 clock states drm/amdgpu: disable GFX CGCG in aldebaran drm/amdgpu: Clear RAS interrupt status on aldebaran drm/amdgpu: Add support for RAS XGMI err query drm/amdkfd: Account for SH/SE count when setting up cu masks. drm/amdgpu: rename amdgpu_bo_get_preferred_pin_domain drm/amdgpu: drop redundant cancel_delayed_work_sync call drm/amdgpu: add missing cleanups for more ASICs on UVD/VCE suspend drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend drm/amdkfd: map SVM range with correct access permission drm/amdkfd: check access permisson to restore retry fault drm/amdgpu: Update RAS XGMI Error Query drm/amdgpu: Add driver infrastructure for MCA RAS drm/amd/display: Add Logging for HDMI color depth information drm/amd/amdgpu: consolidate PSP TA init shared buf functions drm/amd/amdgpu: add name field back to ras_common_if drm/amdgpu: Fix build with missing pm_suspend_target_state module export ... commit 4cd67adc44a3ccdb3b8526c9f932f905284e028f Merge: ba1dc7f273c73 8ea32183072a8 Author: Greg Kroah-Hartman Date: Wed Sep 1 20:13:05 2021 +0200 Merge tag 'misc-habanalabs-next-2021-09-01' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-next Oded writes: This tag contains habanalabs driver changes for v5.15: - Add a new uAPI (under the cs ioctl) to enable to user to reserve signals and signal them from within its workloads, while the driver performs the waiting. This allows finer granularity of pipelining between the different engines and resource utilization. - Add a new uAPI (under the wait_for_cs ioctl) to allow waiting on multiple command submissions (workloads) at the same time. This is an optimization for the user process so it won't need to call multiple times to the wait_for_cs ioctl. - Add new feature of "state dump", which can be triggered through new debugfs node. This is a similar concept to the kernel panic dump. This new mechanism retrieves information from the device in case one of the workloads that was sent by the user got stuck. This is very helpful for debugging the hang. - Add a new debugfs node to perform lookup of user pointers that are mapped to habana device's pmmu. - Fix to the tracking of user process when running inside a container. - Allow user to map more than 4GB of memory to the device MMU in single IOCTL call. - Minimize number of register reads done in GAUDI during user operation. - Allow user to retrieve the device's server type that the device is connected to. - Several fixes to the code of waiting on interrupts on behalf of the user. - Fixes and improvements to the hint mechanism in our VA allocation. - Update the firmware header files to the latest version while maintaining backward compatibility with older firmware versions. - Multiple fixes to various bugs. * tag 'misc-habanalabs-next-2021-09-01' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (61 commits) habanalabs/gaudi: hwmon default card name habanalabs: add support for f/w reset habanalabs/gaudi: block ICACHE_BASE_ADDERESS_HIGH in TPC habanalabs: cannot sleep while holding spinlock habanalabs: never copy_from_user inside spinlock habanalabs: remove unnecessary device status check habanalabs: disable IRQ in user interrupts spinlock habanalabs: add "in device creation" status habanalabs/gaudi: invalidate PMMU mem cache on init habanalabs/gaudi: size should be printed in decimal habanalabs/gaudi: define DC POWER for secured PMC habanalabs/gaudi: unmask out of bounds SLM access interrupt habanalabs: add userptr_lookup node in debugfs habanalabs/gaudi: fetch TPC/MME ECC errors from F/W habanalabs: modify multi-CS to wait on stream masters habanalabs/gaudi: add monitored SOBs to state dump habanalabs/gaudi: restore user registers when context opens habanalabs/gaudi: increase boot fit timeout habanalabs: update to latest firmware headers habanalabs/gaudi: minimize number of register reads ... commit 1b4f3dfb4792f03b139edf10124fcbeb44e608e6 Merge: 2037e5d6fbbce dcf097e7d21fb Author: Greg Kroah-Hartman Date: Wed Sep 1 20:11:41 2021 +0200 Merge tag 'usb-serial-5.15-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial fix for 5.15-rc1 Here's a single fix for a pl2303 type detection regression, and which has been in linux-next over night. * tag 'usb-serial-5.15-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: pl2303: fix GL type detection commit 2037e5d6fbbcee276a10737a0ed40694dcd2d071 Merge: 835d31d319d9c a65ab973c1669 Author: Greg Kroah-Hartman Date: Wed Sep 1 20:10:40 2021 +0200 Merge tag 'usb-serial-5.15-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.15-rc1 Here are the USB serial updates for 5.15-rc1, including: - a couple of fixes for cp210x termios error handling - retrieval of fw revisions for more cp210x types - a switch to octal permissions for all module-parameter definitions Included are also various clean ups. All have been in linux-next with no reported issues. * tag 'usb-serial-5.15-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: replace symbolic permissions by octal permissions USB: serial: cp210x: determine fw version for CP2105 and CP2108 USB: serial: cp210x: clean up type detection USB: serial: cp210x: clean up set-chars request USB: serial: cp210x: clean up control-request timeout USB: serial: cp210x: fix flow-control error handling USB: serial: cp210x: fix control-characters error handling USB: serial: io_edgeport: drop unused descriptor helper commit 36e784a60b85eb41a34b3232e95bf111931b9b09 Merge: 780aa1209f88f bfd862a7e9318 Author: Jakub Kicinski Date: Wed Sep 1 10:55:51 2021 -0700 Merge branch 'mptcp-prevent-tcp_push-crash-and-selftest-temp-file-buildup' Mat Martineau says: ==================== mptcp: Prevent tcp_push() crash and selftest temp file buildup These are two fixes for the net tree, addressing separate issues. Patch 1 addresses a divide-by-zero crash seen in syzkaller and also reported by a user on the netdev list. This changes MPTCP code so tcp_push() cannot be called with an invalid (0) mss_now value. Patch 2 fixes a selftest temp file cleanup issue that consumes excessive disk space when running repeated tests. ==================== Link: https://lore.kernel.org/r/20210901171537.121255-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit bfd862a7e9318dd906844807a713d27cdd1a72b1 Author: Matthieu Baerts Date: Wed Sep 1 10:15:37 2021 -0700 selftests: mptcp: clean tmp files in simult_flows '$cin' and '$sin' variables are local to a function: they are then not available from the cleanup trap. Instead, we need to use '$large' and '$small' that are not local and defined just before setting the trap. Without this patch, running this script in a loop might cause a: write: No space left on device issue. Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests") Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 1094c6fe7280e17e0e87934add5ad2585e990def Author: Paolo Abeni Date: Wed Sep 1 10:15:36 2021 -0700 mptcp: fix possible divide by zero Florian noted that if mptcp_alloc_tx_skb() allocation fails in __mptcp_push_pending(), we can end-up invoking mptcp_push_release()/tcp_push() with a zero mss, causing a divide by 0 error. This change addresses the issue refactoring the skb allocation code checking if skb collapsing will happen for sure and doing the skb allocation only after such check. Skb allocation will now happen only after the call to tcp_send_mss() which correctly initializes mss_now. As side bonuses we now fill the skb tx cache only when needed, and this also clean-up a bit the output path. v1 -> v2: - use lockdep_assert_held_once() - Jakub - fix indentation - Jakub Reported-by: Florian Westphal Fixes: 724cfd2ee8aa ("mptcp: allocate TX skbs in msk context") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 835d31d319d9c8c4eb6cac074643360ba0ecab10 Merge: 0d290223a6c77 9c3a0f2852488 Author: Linus Torvalds Date: Wed Sep 1 10:34:52 2021 -0700 Merge tag 'media/v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new sensor drivers: imx335, imx412, ov9282 - new IR transmitter driver: meson-ir-tx - handro driver gained support for H.264 for Rockchip VDPU2 - imx gained support for i.MX8MQ - ti-vpe has gained support for other SoC variants - lots of cleanups, fixes, board additions and doc improvements * tag 'media/v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (195 commits) media: venus: venc: add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control media: venus: venc: Add support for intra-refresh period media: v4l2-ctrls: Add intra-refresh period control media: docs: ext-ctrls-codec: Document cyclic intra-refresh zero control value media: venus: helper: do not set constrained parameters for UBWC media: venus: venc: Fix potential null pointer dereference on pointer fmt media: venus: hfi: fix return value check in sys_get_prop_image_version() media: tegra-cec: Handle errors of clk_prepare_enable() media: cec-pin: rename timer overrun variables media: TDA1997x: report -ENOLINK after disconnecting HDMI source media: TDA1997x: fix tda1997x_query_dv_timings() return value media: Fix cosmetic error in TDA1997x driver media: v4l2-dv-timings.c: fix wrong condition in two for-loops media: imx: add a driver for i.MX8MQ mipi csi rx phy and controller media: dt-bindings: media: document the nxp,imx8mq-mipi-csi2 receiver phy and controller media: imx: imx7_mipi_csis: convert some switch cases to the default media: imx: imx7-media-csi: Fix buffer return upon stream start failure media: imx: imx7-media-csi: Don't set PIXEL_BIT in CSICR1 media: imx: imx7-media-csi: Set TWO_8BIT_SENSOR for >= 10-bit formats media: dt-bindings: media: nxp,imx7-csi: Add i.MX8MM support ... commit 0d290223a6c77107b1c3988959e49279a8dafaba Merge: ea7b4244b3656 a8729efbbb847 Author: Linus Torvalds Date: Wed Sep 1 10:29:29 2021 -0700 Merge tag 'sound-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "There are a few intensive changes in ALSA core side at this time that helped with significant code reduction. Meanwhile we keep getting new stuff, so the total size still grows... Anyway, the below are some highlights in this development cycle. ALSA core: - New helpers to manage page allocations and card object with devres - Refactoring for memory allocation with wc-pages - A new PCM hardware flag SNDRV_PCM_INFO_EXPLICIT_SYNC for controlling the explicit sync of the stream control; it'll be used for ASoC SOF and non-coherent memory in future ASoC: - Lots of cleanups and improvements to the Intel drivers, including some new systems support - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L, Rockchip RK3568 S/PDIF USB-audio: - Re-organized the quirk handling and a new option quirk_flags - Fix for a regression in 5.14 code change for JACK - Quirks for Sony WALKMAN, Digidesign mbox HD-audio: - Enhanced support for CS8409 codec - More consistent shutdown behavior with the runtime PM - The model option can accept the PCI or codec SSID as an alias - Quirks for ASUS ROG, HP Spectre x360 Others: - Lots of code reduction in legacy drivers with devres helpers - FireWire MOTU 896HD support" * tag 'sound-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (421 commits) ASoC: Revert PCM trigger changes ALSA: usb-audio: Add lowlatency module option ALSA: hda/cs8409: Initialize Codec only in init fixup. ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary ALSA: usb-audio: Work around for XRUN with low latency playback ALSA: pcm: fix divide error in snd_pcm_lib_ioctl ASoC: soc-pcm: test refcount before triggering ASoC: soc-pcm: protect BE dailink state changes in trigger ASoC: wcd9335: Disable irq on slave ports in the remove function ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function ASoC: wcd9335: Fix a double irq free in the remove function ALSA: hda: Disable runtime resume at shutdown ASoC: rockchip: i2s: Add support for frame inversion ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs ASoC: rockchip: i2s: Add compatible for more SoCs ASoC: rockchip: i2s: Make playback/capture optional ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B ASoC: dt-bindings: rockchip: Document reset property for i2s ASoC: rockchip: i2s: Fix regmap_ops hang ASoC: rockchip: i2s: Improve dma data transfer efficiency ... commit ea7b4244b3656ca33b19a950f092b5bbc718b40c Author: Nathan Chancellor Date: Wed Sep 1 09:07:01 2021 -0700 x86/setup: Explicitly include acpi.h After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical memory remapping") x86_64_defconfig shows the following errors: arch/x86/kernel/setup.c: In function ‘setup_arch’: arch/x86/kernel/setup.c:916:13: error: implicit declaration of function ‘acpi_mps_check’ [-Werror=implicit-function-declaration] 916 | if (acpi_mps_check()) { | ^~~~~~~~~~~~~~ arch/x86/kernel/setup.c:1110:9: error: implicit declaration of function ‘acpi_table_upgrade’ [-Werror=implicit-function-declaration] 1110 | acpi_table_upgrade(); | ^~~~~~~~~~~~~~~~~~ [... more acpi noise ...] acpi.h was being implicitly included from iscsi_ibft.h in this configuration so the removal of that header means these functions have no definition or declaration. In most other configurations, continued to be included through at least if CONFIG_INTEL_TXT was enabled, and there were probably other implicit include paths too. Add acpi.h explicitly so there is no more error, and so that we don't continue to depend on these unreliable implicit include paths. Tested-by: Matthieu Baerts Signed-off-by: Nathan Chancellor Cc: Maurizio Lombardi Cc: Mike Rapoport Cc: Konrad Rzeszutek Wilk Signed-off-by: Linus Torvalds commit 07281a257a6868b900da5de1eda808c9e20253f1 Merge: 7c314bdfb64e4 9c1587d99f930 Author: Linus Torvalds Date: Wed Sep 1 09:59:34 2021 -0700 Merge tag 'usb-5.15-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 patches for 5.15-rc1. Nothing huge in here, just lots of constant forward progress on a number of different drivers and hardware support: - more USB 4/Thunderbolt support added - dwc3 driver updates and additions - usb gadget fixes and addtions for new types - udc gadget driver updates - host controller updates - removal of obsolete drivers - other minor driver updates All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (148 commits) usb: isp1760: otg control register access usb: isp1760: use the right irq status bit usb: isp1760: write to status and address register usb: isp1760: fix qtd fill length usb: isp1760: fix memory pool initialization usb: typec: tcpm: Fix spelling mistake "atleast" -> "at least" usb: dwc2: Fix spelling mistake "was't" -> "wasn't" usb: renesas_usbhs: Fix spelling mistake "faile" -> "failed" usb: host: xhci-rcar: Don't reload firmware after the completion usb: xhci-mtk: allow bandwidth table rollover usb: mtu3: fix random remote wakeup usb: mtu3: return successful suspend status usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint usb: xhci-mtk: modify the SOF/ITP interval for mt8195 usb: xhci-mtk: add a member of num_esit usb: xhci-mtk: check boundary before check tt usb: xhci-mtk: update fs bus bandwidth by bw_budget_table usb: xhci-mtk: fix issue of out-of-bounds array access usb: xhci-mtk: support option to disable usb2 ports usb: xhci-mtk: fix use-after-free of mtk->hcd ... commit 7c314bdfb64e4bb8d2f829376ed56ce663483752 Merge: ebf435d3b51b2 2e5f3a69b6fcd Author: Linus Torvalds Date: Wed Sep 1 09:51:16 2021 -0700 Merge tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty / serial updates from Greg KH: "Here is the "big" set of tty/serial driver patches for 5.15-rc1 Nothing major in here at all, just some driver updates and more cleanups on old tty apis and code that needed it that includes: - tty.h cleanup of things that didn't belong in it - other tty cleanups by Jiri - driver cleanups - rs485 support added to amba-pl011 driver - dts updates - stm32 serial driver updates - other minor fixes and driver updates All have been in linux-next for a while with no reported problems" * tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (83 commits) tty: serial: uartlite: Use read_poll_timeout for a polling loop tty: serial: uartlite: Use constants in early_uartlite_putc tty: Fix data race between tiocsti() and flush_to_ldisc() serial: vt8500: Use of_device_get_match_data serial: tegra: Use of_device_get_match_data serial: 8250_ingenic: Use of_device_get_match_data tty: serial: linflexuart: Remove redundant check to simplify the code tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp tty: serial: fsl_lpuart: enable two stop bits for lpuart32 tty: serial: fsl_lpuart: fix the wrong mapbase value mxser: use semi-colons instead of commas tty: moxa: use semi-colons instead of commas tty: serial: fsl_lpuart: check dma_tx_in_progress in tx dma callback tty: replace in_irq() with in_hardirq() serial: sh-sci: fix break handling for sysrq serial: stm32: use devm_platform_get_and_ioremap_resource() serial: stm32: use the defined variable to simplify code Revert "arm pl011 serial: support multi-irq request" tty: serial: samsung: Add Exynos850 SoC data tty: serial: samsung: Fix driver data macros style ... commit ebf435d3b51b22340ef047aad0c2936ec4833ab2 Merge: c6c3c5704ba70 4adb389e08c95 Author: Linus Torvalds Date: Wed Sep 1 09:45:57 2021 -0700 Merge tag 'staging-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull IIO and staging driver updates from Greg KH: "Here is the big set of staging and IIO driver updates for 5.15-rc1. Also included in here are the counter driver subsystem updates as the IIO drivers needed them. Lots of churn in some staging drivers, we dropped the "old" rtl8188eu driver and replaced it with a newer version of the driver that had been maintained out-of-tree by Larry with the end goal of actually being able to get this driver out of staging eventually. Despite that driver being "newer" the line count of this pull request is going up. Some drivers moved out of staging as well, which is always nice to see, that is why there are additions to the mfc and misc driver subsystems. All of these were acked by the various subsystem maintainers involved. But by far, as normal, it's coding style cleanups all over the drivers/staging/ tree in here. Full details of these changes are in the shortlog. All of these have been in linux-next for a while with no reported problems" [ Note: the r8188eu merge clashed with commit 89939e890605 ("staging: rtlwifi: use siocdevprivate") from the networking tree. When resolving the issue, I noted that the whole r8188eu rtw_android code is dead since commit ae7471cae00a ("staging: r8188eu: remove rtw_ioctl function"). End result: the merge resolution was to throw all of that away, rather than do the mindless fixup to code that isn't actually reachable - Linus ] * tag 'staging-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (551 commits) staging: vt6655: Remove filenames in files staging: r8188eu: add extra TODO entries staging: vt6656: Remove filenames in files staging: wlan-ng: fix invalid assignment warning staging: r8188eu: rename fields of struct rtl_ps staging: r8188eu: remove ODM_DynamicPrimaryCCA_DupRTS() staging: r8188eu: rename fields of struct dyn_primary_cca staging: r8188eu: rename struct field Wifi_Error_Status staging: r8188eu: Provide a TODO file for this driver staging: r8188eu: remove unneeded variable staging: r8188eu: remove unneeded conversions to bool staging: r8188eu: remove {read,write}_macreg staging: r8188eu: core: remove condition with no effect staging: r8188eu: remove ethernet.h header file staging: r8188eu: remove ip.h header file staging: r8188eu: remove if_ether.h header file staging: r8188eu: make rtw_deinit_intf_priv return void staging: r8188eu: use is_multicast_ether_addr in os_dep/recv_linux.c staging: r8188eu: use is_multicast_ether_addr in hal/rtl8188eu_xmit.c staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c ... commit 863580418bc82062083be854355f2213d3d804f5 Author: Dmitry Baryshkov Date: Wed Sep 1 14:43:50 2021 +0300 regulator: qcom-rpmh-regulator: fix pm8009-1 ldo7 resource name Fix a typo in the pm8009 LDO7 declaration, it uses resource name ldo%s6 instead of ldo%s7. Fixes: 951384cabc5d ("regulator: qcom-rpmh-regulator: add pm8009-1 chip revision") Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210901114350.1106073-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown commit 0866d645b76d062b7d55091fd6fb80f058d0c384 Author: Shuming Fan Date: Wed Sep 1 18:07:54 2021 +0800 ASoC: rt5682: fix headset background noise when S3 state Remove CBJ power off setting to avoid floating state. Signed-off-by: Jack Yu Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20210901100754.21045-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 0f2ef911de0bdf3a0ea1d9b28e9126d3e018bbd5 Merge: 222039a2503e0 38b7673000949 Author: Mark Brown Date: Wed Sep 1 17:30:37 2021 +0100 Merge tag 'asoc-v5.15' into asoc-5.15 ASoC: Updates for v5.15 Quite a quiet release this time, mostly a combination of cleanups and a good set of new drivers. - Lots of cleanups and improvements to the Intel drivers, including some new systems support. - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L,, Rockchip RK3568 S/PDIF. commit ecd95673142ef80169a6c003b569b8a86d1e6329 Author: Alexander Aring Date: Thu Aug 26 10:06:31 2021 -0400 fs: dlm: avoid comms shutdown delay in release_lockspace When dlm_release_lockspace does active shutdown on connections to other nodes, the active shutdown will wait for any exisitng passive shutdowns to be resolved. But, the sequence of operations during dlm_release_lockspace can prevent the normal resolution of passive shutdowns (processed normally by way of lockspace recovery.) This disruption of passive shutdown handling can cause the active shutdown to wait for a full timeout period, delaying the completion of dlm_release_lockspace. To fix this, make dlm_release_lockspace resolve existing passive shutdowns (by calling dlm_clear_members earlier), before it does active shutdowns. The active shutdowns will not find any passive shutdowns to wait for, and will not be delayed. Reported-by: Chris Mackowski Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 222039a2503e0839f859e18e6f09acb9997480d1 Author: Trevor Wu Date: Tue Aug 31 16:39:56 2021 +0800 ASoC: dt-bindings: mt8195: remove dependent headers in the example Drop the use of the defines including clock and power id, so that we can remove the headers which are not applied in the example. Fixes: b5bac34fcfb4 ("dt-bindings: mediatek: mt8195: add audio afe document") Signed-off-by: Trevor Wu Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210831083956.9804-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 940ffa19454704ca2ecd23b0d8dd604c93421bfa Author: Geert Uytterhoeven Date: Tue Aug 31 15:18:54 2021 +0200 ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK The Mediatek MT8195 sound hardware is only present on Mediatek MT8195 SoCs. Hence add a dependency on ARCH_MEDIATEK, to prevent asking the user about this driver when configuring a kernel without Mediatek SoC support. Fixes: 6746cc858259985a ("ASoC: mediatek: mt8195: add platform driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7e628e359bde04ceb9ddd74a45931059b4a4623c.1630415860.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit 2a6a0a03117ee349308ab77ac0925fdca8ef32f5 Author: Colin Ian King Date: Fri Aug 27 19:50:03 2021 +0100 ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210827185003.507006-1-colin.king@canonical.com Signed-off-by: Mark Brown commit c6c3c5704ba70820f6b632982abde06661b7222a Merge: ba1dc7f273c73 049d1693db781 Author: Linus Torvalds Date: Wed Sep 1 08:44:42 2021 -0700 Merge tag 'driver-core-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the big set of driver core patches for 5.15-rc1. These do change a number of different things across different subsystems, and because of that, there were 2 stable tags created that might have already come into your tree from different pulls that did the following - changed the bus remove callback to return void - sysfs iomem_get_mapping rework Other than those two things, there's only a few small things in here: - kernfs performance improvements for huge numbers of sysfs users at once - tiny api cleanups - other minor changes All of these have been in linux-next for a while with no reported problems, other than the before-mentioned merge issue" * tag 'driver-core-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (33 commits) MAINTAINERS: Add dri-devel for component.[hc] driver core: platform: Remove platform_device_add_properties() ARM: tegra: paz00: Handle device properties with software node API bitmap: extend comment to bitmap_print_bitmask/list_to_buf drivers/base/node.c: use bin_attribute to break the size limitation of cpumap ABI topology: use bin_attribute to break the size limitation of cpumap ABI lib: test_bitmap: add bitmap_print_bitmask/list_to_buf test cases cpumask: introduce cpumap_print_list/bitmask_to_buf to support large bitmask and list sysfs: Rename struct bin_attribute member to f_mapping sysfs: Invoke iomem_get_mapping() from the sysfs open callback debugfs: Return error during {full/open}_proxy_open() on rmmod zorro: Drop useless (and hardly used) .driver member in struct zorro_dev zorro: Simplify remove callback sh: superhyway: Simplify check in remove callback nubus: Simplify check in remove callback nubus: Make struct nubus_driver::remove return void kernfs: dont call d_splice_alias() under kernfs node lock kernfs: use i_lock to protect concurrent inode updates kernfs: switch kernfs to use an rwsem kernfs: use VFS negative dentry caching ... commit 8ea32183072a83fc26df481168eecab46f9aba1d Author: Rajaravi Krishna Katta Date: Tue Aug 17 12:34:10 2021 +0300 habanalabs/gaudi: hwmon default card name This commit corrects CARD NAME for Gaudi as "HL205" Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 8d9aa980beb8664457011e57e84fea4143b214a9 Author: Oded Gabbay Date: Mon Aug 9 22:43:37 2021 +0300 habanalabs: add support for f/w reset When the f/w runs in secured mode, it can reset the ASIC when certain events occur. In unsecured mode, the driver asks the f/w to reset the ASIC for those events. We need to perform the entire reset procedure but without accessing the ASIC. i.e. without halting the engines and without sending messages to the f/w. Signed-off-by: Oded Gabbay commit 56e753d5956647f942f76611cd179bc27c739bd8 Author: Oded Gabbay Date: Wed Aug 11 12:20:39 2021 +0300 habanalabs/gaudi: block ICACHE_BASE_ADDERESS_HIGH in TPC This register shouldn't be modified by user. Prefetch is disabled in Gaudi. Signed-off-by: Oded Gabbay commit 607b1468c2263e082d74c1a3e71399a9026b41ce Author: farah kassabri Date: Sun Aug 15 11:16:16 2021 +0300 habanalabs: cannot sleep while holding spinlock Fix 2 areas in the code where it's possible the code will go to sleep while holding a spinlock. Reported-by: Dan Carpenter Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 698f744aa858e4a5bfcef3f5e0cfc57a15d5b64a Author: Oded Gabbay Date: Fri Aug 20 14:24:48 2021 +0300 habanalabs: never copy_from_user inside spinlock copy_from_user might sleep so we can never call it when we have a spinlock. Moreover, it is not necessary in waiting for user interrupt, because if multiple threads will call this function on the same interrupt, each one will have it's own fence object inside the driver. The user address might be the same, but it doesn't really matter to us, as we only read from it. Signed-off-by: Oded Gabbay commit 053caa267fd1a46f6cea37bb6ee39b4a8779840f Author: Oded Gabbay Date: Fri Aug 20 14:10:40 2021 +0300 habanalabs: remove unnecessary device status check Checking if the device is operational when entering the function to wait for user interrupt is not something that is useful or necessary. It is not done in any other wait_for_cs ioctl path. If the device becomes non-operational during the wait, the reset function will make sure the process wait is interrupted. Instead, move the check to the beginning of hl_wait_ioctl(). It will block any attempt to wait on CS or user interrupt once the device is already marked as non-operational. Signed-off-by: Oded Gabbay commit 176d23a77edb7f10611bf61f1196abde119c7694 Author: Oded Gabbay Date: Fri Aug 20 13:49:39 2021 +0300 habanalabs: disable IRQ in user interrupts spinlock Because this spinlock is taken in an interrupt handler, we must use the spin_lock_irqsave/irqrestore version to disable the interrupts on the local CPU. Otherwise, we can have a potential deadlock (if the interrupt handler is scheduled to run on the same cpu that the code who took the lock was running on). Signed-off-by: Oded Gabbay commit 71731090ab17a208a58020e4b342fdfee280458a Author: Omer Shpigelman Date: Mon Aug 16 13:27:12 2021 +0300 habanalabs: add "in device creation" status On init, the disabled state is cleared right before hw_init and that causes the device to report on "Operational" state before the device initialization is finished. Although the char device is not yet exposed to the user at this stage, the sysfs entries are exposed. This can cause errors in monitoring applications that use the sysfs entries. In order to avoid this, a new state "in device creation" is introduced to ne reported when the device is not disabled but is still in init flow. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e1b61f8e975ae3de555b9fa1f2939f47c70afeba Author: Oded Gabbay Date: Tue Aug 17 13:36:06 2021 +0300 habanalabs/gaudi: invalidate PMMU mem cache on init This must be done to clear the internal mem cache so we won't get ecc errors on the first invalidation. Signed-off-by: Oded Gabbay commit 6be42f0a1c3a0745f0d42572654a443e09b2470b Author: Oded Gabbay Date: Wed Aug 11 15:39:00 2021 +0300 habanalabs/gaudi: size should be printed in decimal It's more readable for the size to be in decimal. Signed-off-by: Oded Gabbay commit da105e6108a2ea0d1aa2034299fb67c4361f207d Author: Oded Gabbay Date: Tue Aug 10 21:02:33 2021 +0300 habanalabs/gaudi: define DC POWER for secured PMC In secured mode, the CGM is disabled. Therefore, the DC power is higher. Without taking it into consideration, the utilization is 12-15% at idle. Signed-off-by: Oded Gabbay commit 83d93e2bed14bafb30f9dca1babf4bf5de4e7a5a Author: Tomer Tayar Date: Sun Aug 8 20:36:48 2021 +0300 habanalabs/gaudi: unmask out of bounds SLM access interrupt The out of bounds SLM access TPC interrupt indicates a severe compiler bug and needs to be informed to user. This interrupt is currently masked so unmask it. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 89b213657c71aa292921f72a81d405679b1ea8df Author: Yuri Nudelman Date: Thu Jul 29 11:44:28 2021 +0300 habanalabs: add userptr_lookup node in debugfs It is useful to have the ability to see which user address was pinned to which physical address during the initial mapping. We already have all that info stored, but no means to search this data (which may be quite large). Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 816a6c6d99a3758baed317263efe7efd91770004 Author: Ofir Bitton Date: Thu Aug 5 17:36:24 2021 +0300 habanalabs/gaudi: fetch TPC/MME ECC errors from F/W In case F/W security is enabled driver cannot access ECC registers, hence driver must fetch the ECC info from F/W. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 72d6625570c16b9c097d4b9f16c2016974f83366 Author: Ohad Sharabi Date: Sun Aug 1 23:02:07 2021 +0300 habanalabs: modify multi-CS to wait on stream masters During the integration, the multi-CS requirements were refined: - The multi CS call shall wait on "per-ASIC" predefined stream masters instead of set of streams. - Stream masters are set of QIDs used by the upper SW layers (synapse) for completion (must be an external/HW queue). Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1f6bdee76553b484a218eeffafd16a7232e5a00e Author: Alon Mizrahi Date: Thu Jul 22 18:12:18 2021 +0300 habanalabs/gaudi: add monitored SOBs to state dump Current "state dump" is lacking of monitored SOB IDs. Add for convenience. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 929cbab5b3c8be3038b95e7443adbe23c223d8dc Author: Oded Gabbay Date: Tue Aug 3 08:13:39 2021 +0300 habanalabs/gaudi: restore user registers when context opens Because we don't have multiple contexts in GAUDI, and to minimize calls to is_idle function (which uses many register reads), move the call to clear the user registers to the opening of the single user context. Signed-off-by: Oded Gabbay commit 60d86e74df306795e97f7404ccaf89ec1019448c Author: Oded Gabbay Date: Tue Aug 3 13:22:06 2021 +0300 habanalabs/gaudi: increase boot fit timeout Various f/w versions have different timeouts, so increase the default timeout to accommodate all the options. Signed-off-by: Oded Gabbay commit c2aa71361806c8e04d33a4f516d2ca6c125f8a7a Author: Oded Gabbay Date: Tue Aug 3 15:53:46 2021 +0300 habanalabs: update to latest firmware headers Add several new packets between driver and firmware. Add matching compatibility bits for backward compatibility. Add support for 4K event types. Add information about pcie errors. Signed-off-by: Oded Gabbay commit 1fd984f5fe62c864b8ec66b637f73c0f46be45d4 Author: Oded Gabbay Date: Sun Aug 1 22:24:18 2021 +0300 habanalabs/gaudi: minimize number of register reads Because the register reads might be trapped by the hypervisor in certain deployments, minimize the number of reads during runtime by moving static initializations to functions that occur during device initialization instead of context open. Signed-off-by: Oded Gabbay commit 09ae43043c748423a5dcdc7bb1e63e4dcabe9bd6 Author: Yuri Nudelman Date: Thu Jul 29 11:54:50 2021 +0300 habanalabs: fix mmu node address resolution in debugfs The address resolution via debugfs was not taking into consideration the page offset, resulting in a wrong address. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 714fccbf48245482b9d5ed356a9ef23f2eb68612 Author: Yuri Nudelman Date: Tue Jul 27 17:39:42 2021 +0300 habanalabs: save pid per userptr Currently userptr endpoint in debugfs prints out virtual addresses in the user process memory space, without specifying their owner process ID. User space virtual address is meaningless without knowing the owner process. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 83f14f2f9b632da439e8e1e51826db5eab5c242b Author: Oded Gabbay Date: Wed Jul 28 00:16:31 2021 +0300 habanalabs/gaudi: move scrubbing to late init HW init is mostly about configuring registers. Therefore, it is better to activate DMAs only in late init and afterwards. Signed-off-by: Oded Gabbay commit f5137aff6dcc3a85d0143ee91e6061c2c3611bf7 Author: Ofir Bitton Date: Tue Jul 27 10:54:22 2021 +0300 habanalabs/gaudi: scrub HBM to a specific value In order to enhance debuggability, we will scrub the whole HBM to a specific value, in case HBM scrubbing is enabled. Scrubbing will be performed after reset and after user closes the FD. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a6c849012b0f51c674f52384bd9a4f3dc0a33c31 Author: Ofir Bitton Date: Tue Jul 20 09:16:05 2021 +0300 habanalabs: add validity check for event ID received from F/W Currently there is no validity check for event ID received from F/W, Thus exposing driver to memory overrun. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cc5b4c4c75c43184c1d8684299efef2a68b87720 Author: Koby Elbaz Date: Mon Jul 19 08:28:34 2021 +0300 habanalabs: clear msg_to_cpu_reg to avoid misread after reset For some ASICs, the f/w reads the msg_to_cpu_reg value after reset, and for some it doesn't. Therefore, to be sure f/w doesn't read a wrong value after reset, we need to clear this register before the reset occurs. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b9317d513098d0da45ea96deff19058d1d37ae4d Author: Ohad Sharabi Date: Thu Jul 15 15:20:44 2021 +0300 habanalabs: make set_pci_regions asic function In order to better support variants of the same ASIC the set_pci_regions function is now an ASIC function which allows each ASIC to implement it internally, thus keeping all definitions static to the file. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 932adf1645cd3917dfc5678b2c3ffc84e5fa65a1 Author: Ohad Sharabi Date: Sun Jul 18 12:06:41 2021 +0300 habanalabs: convert PCI BAR offset to u64 Done as the bar size can exceed 4GB. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5dc9ffaff1420676827c4054bc789a7710f2a272 Author: Oded Gabbay Date: Thu Jul 15 10:48:43 2021 +0300 habanalabs: expose server type in INFO IOCTL Add the server type property to the hl_info_hw_ip_info structure that is exposed to the user via the INFO IOCTL. This is needed by the userspace s/w stack to know the connections map of the internal links that connect the ASIC among themselves inside the server. The F/W will tell us, as part of the NIC information, the server type that the GAUDI is located in. Signed-off-by: Oded Gabbay commit ba1dc7f273c73b93e0e1dd9707b239ed69eebd70 Merge: 9e9fb7655ed58 0dc3ad3f859d3 Author: Linus Torvalds Date: Wed Sep 1 08:35:06 2021 -0700 Merge tag 'char-misc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc driver updates from Greg KH: "Here is the big set of char/misc driver changes for 5.15-rc1. Lots of different driver subsystems are being updated in here, notably: - mhi subsystem update - fpga subsystem update - coresight/hwtracing subsystem update - interconnect subsystem update - nvmem subsystem update - parport drivers update - phy subsystem update - soundwire subsystem update and there are some other char/misc drivers being updated as well: - binder driver additions - new misc drivers - lkdtm driver updates - mei driver updates - sram driver updates - other minor driver updates. Note, there are no habanalabs driver updates in this pull request, that will probably come later before -rc1 is out in a different request. All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits) Revert "bus: mhi: Add inbound buffers allocation flag" misc/pvpanic: fix set driver data VMCI: fix NULL pointer dereference when unmapping queue pair char: mware: fix returnvar.cocci warnings parport: remove non-zero check on count soundwire: cadence: do not extend reset delay soundwire: intel: conditionally exit clock stop mode on system suspend soundwire: intel: skip suspend/resume/wake when link was not started soundwire: intel: fix potential race condition during power down phy: qcom-qmp: Add support for SM6115 UFS phy dt-bindings: phy: qcom,qmp: Add SM6115 UFS PHY bindings phy: qmp: Provide unique clock names for DP clocks lkdtm: remove IDE_CORE_CP crashpoint lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ coresight: Replace deprecated CPU-hotplug functions. Documentation: coresight: Add documentation for CoreSight config coresight: syscfg: Add initial configfs support coresight: config: Add preloaded configurations coresight: etm4x: Add complex configuration handlers to etmv4 coresight: etm-perf: Update to activate selected configuration ... commit 5f939f49771002f347039edf984aca42f30fc31a Author: Kuninori Morimoto Date: Mon Aug 30 09:44:44 2021 +0900 ASoC: audio-graph: respawn Platform Support commit 63f2f9cceb09f8 ("ASoC: audio-graph: remove Platform support") removed Platform support from audio-graph, because it doesn't have "plat" support on DT (simple-card has). But, Platform support is needed if user is using snd_dmaengine_pcm_register() which adds generic DMA as Platform. And this Platform dev is using CPU dev. Without this patch, at least STM32MP15 audio sound card is no more functional (v5.13 or later). This patch respawn Platform Support on audio-graph again. Reported-by: Olivier MOYSAN Signed-off-by: Kuninori Morimoto Tested-by: Olivier MOYSAN Link: https://lore.kernel.org/r/878s0jzrpf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit cd5e4efde23ad8050921672ed777ec3f7aa310ec Author: Trevor Wu Date: Tue Aug 31 10:13:03 2021 +0800 ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency randconfig builds show the warning below, WARNING: unmet direct dependencies detected for SND_SOC_MT6359 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MTK_PMIC_WRAP [=n] Selected by [y]: - SND_SOC_MT8195_MT6359_RT1019_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y] Add a dependency to avoid it. Signed-off-by: Trevor Wu Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20210831021303.5230-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit e38b3f20059426a0adbde014ff71071739ab5226 Author: NeilBrown Date: Mon Aug 30 08:36:34 2021 +1000 SUNRPC: don't pause on incomplete allocation alloc_pages_bulk_array() attempts to allocate at least one page based on the provided pages, and then opportunistically allocates more if that can be done without dropping the spinlock. So if it returns fewer than requested, that could just mean that it needed to drop the lock. In that case, try again immediately. Only pause for a time if no progress could be made. Reported-and-tested-by: Mike Javorski Reported-and-tested-by: Lothar Paltins Fixes: f6e70aab9dfe ("SUNRPC: refresh rq_pages using a bulk page allocator") Signed-off-by: NeilBrown Acked-by: Mel Gorman Signed-off-by: Chuck Lever commit 8af52e69772d053bc7caab12ad1c59f18ef2e3e2 Author: James Clark Date: Mon Aug 16 14:07:05 2021 +0100 tools build: Fix feature detect clean for out of source builds Currently the clean target when using O= isn't cleaning the feature detect output. This is because O= and OUTPUT= are set to canonical paths. For example in tools/perf/Makefile: FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O)) This means that OUTPUT ends in a / and most usages prepend it to a file without adding an extra /. This line that was changed adds an extra / before the 'feature' folder but not to the end, resulting in a clean command like this: rm -f /tmp/build//featuretest-all.bin ... After the change the clean command looks like this: rm -f /tmp/build/feature/test-all.bin ... Fixes: 762323eb39a257c3 ("perf build: Move feature cleanup under tools/build") Signed-off-by: James Clark Acked-by: Jiri Olsa Link: http://lore.kernel.org/lkml/20210816130705.1331868-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 79e7ed56d7e8899827d977d9dbd381b0ddb7a52a Author: Riccardo Mancini Date: Sat Aug 21 11:19:33 2021 +0200 perf evlist: Add evlist__for_each_entry_from() macro This patch adds a new iteration macro for evlist that resumes iteration from a given evsel in the evlist. This macro will be used in the workqueue series. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/2386505f8b598adf0dbcd04ec21804c6bcf00826.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 780aa1209f88fd96d40572b62df922662f2b896d Author: Wan Jiabing Date: Wed Sep 1 11:19:32 2021 +0800 mptcp: Fix duplicated argument in protocol.h Fix the following coccicheck warning: ./net/mptcp/protocol.h:36:50-73: duplicated argument to & or | The OPTION_MPTCP_MPJ_SYNACK here is duplicate. Here should be OPTION_MPTCP_MPJ_ACK. Fixes: 74c7dfbee3e18 ("mptcp: consolidate in_opt sub-options fields in a bitmask") Signed-off-by: Wan Jiabing Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit e432fe97f3e5de325b40021e505cce53877586c5 Author: Michael Ellerman Date: Fri Aug 27 22:51:06 2021 +1000 powerpc/bug: Cast to unsigned long before passing to inline asm In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously it would take the warning condition, x, and double negate it before converting the result to int, and passing that int to the underlying inline asm. ie: #define WARN_ON(x) ({ int __ret_warn_on = !!(x); if (__builtin_constant_p(__ret_warn_on)) { ... } else { BUG_ENTRY(PPC_TLNEI " %4, 0", BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), "r" (__ret_warn_on)); The asm then does a full register width comparison with zero and traps if it is non-zero (PPC_TLNEI). The new code instead passes the full expression, x, with some arbitrary type, to the inline asm: #define WARN_ON(x) ({ ... do { if (__builtin_constant_p((x))) { ... } else { ... WARN_ENTRY(PPC_TLNEI " %4, 0", BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), __label_warn_on, "r" (x)); As reported[1] by Nathan, when building with clang this can cause spurious warnings to fire repeatedly at boot: WARNING: CPU: 0 PID: 1 at lib/klist.c:62 .klist_add_tail+0x3c/0x110 Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 5.14.0-rc7-next-20210825 #1 NIP: c0000000007ff81c LR: c00000000090a038 CTR: 0000000000000000 REGS: c0000000073c32a0 TRAP: 0700 Tainted: G W (5.14.0-rc7-next-20210825) MSR: 8000000002029032 CR: 22000a40 XER: 00000000 CFAR: c00000000090a034 IRQMASK: 0 GPR00: c00000000090a038 c0000000073c3540 c000000001be3200 0000000000000001 GPR04: c0000000072d65c0 0000000000000000 c0000000091ba798 c0000000091bb0a0 GPR08: 0000000000000001 0000000000000000 c000000008581918 fffffffffffffc00 GPR12: 0000000044000240 c000000001dd0000 c000000000012300 0000000000000000 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24: 0000000000000000 c0000000017e3200 0000000000000000 c000000001a0e778 GPR28: c0000000072d65b0 c0000000072d65a8 c000000007de72c8 c0000000073c35d0 NIP .klist_add_tail+0x3c/0x110 LR .bus_add_driver+0x148/0x290 Call Trace: 0xc0000000073c35d0 (unreliable) .bus_add_driver+0x148/0x290 .driver_register+0xb8/0x190 .__hid_register_driver+0x70/0xd0 .redragon_driver_init+0x34/0x58 .do_one_initcall+0x130/0x3b0 .do_initcall_level+0xd8/0x188 .do_initcalls+0x7c/0xdc .kernel_init_freeable+0x178/0x21c .kernel_init+0x34/0x220 .ret_from_kernel_thread+0x58/0x60 Instruction dump: fba10078 7c7d1b78 38600001 fb810070 3b9d0008 fbc10080 7c9e2378 389d0018 fb9d0008 fb9d0010 90640000 fbdd0000 <0b1e0000> e87e0018 28230000 41820024 The instruction dump shows that we are trapping because r30 is not zero: tdnei r30,0 Where r30 = c000000007de72c8 The WARN_ON() comes from: static void knode_set_klist(struct klist_node *knode, struct klist *klist) { knode->n_klist = klist; /* no knode deserves to start its life dead */ WARN_ON(knode_dead(knode)); ^^^^^^^^^^^^^^^^^ Where: #define KNODE_DEAD 1LU static bool knode_dead(struct klist_node *knode) { return (unsigned long)knode->n_klist & KNODE_DEAD; } The full disassembly shows that clang has not generated any code to apply the "& KNODE_DEAD" to the n_klist pointer, which is surprising. Nathan filed an LLVM bug [2], in which Eli Friedman explained that clang believes it is only passing a single bit to the asm (ie. a bool) and so the mask of bit 0 with 1 can be omitted, and suggested that if we want the full 64-bit value passed to the inline asm we should cast to a 64-bit type (or 32-bit on 32-bits). In fact we already do that for BUG_ENTRY(), which was added to fix a possibly similar bug in 2005 in commit 32818c2eb6b8 ("[PATCH] ppc64: Fix issue with gcc 4.0 compiled kernels"). So cast the value we pass to the inline asm to long. For GCC this appears to have no effect on code generation, other than causing sign extension in some cases. [1]: http://lore.kernel.org/r/YSa1O4fcX1nNKqN/@Ryzen-9-3900X.localdomain [2]: https://bugs.llvm.org/show_bug.cgi?id=51634 Fixes: 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto") Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210901112522.1085134-1-mpe@ellerman.id.au commit 0e90dfa7a8d817db755c7b5d89d77b9c485e4180 Author: Linus Walleij Date: Tue Aug 31 20:50:50 2021 +0200 net: dsa: tag_rtl4_a: Fix egress tags I noticed that only port 0 worked on the RTL8366RB since we started to use custom tags. It turns out that the format of egress custom tags is actually different from ingress custom tags. While the lower bits just contain the port number in ingress tags, egress tags need to indicate destination port by setting the bit for the corresponding port. It was working on port 0 because port 0 added 0x00 as port number in the lower bits, and if you do this the packet appears at all ports, including the intended port. Ooops. Fix this and all ports work again. Use the define for shifting the "type A" into place while we're at it. Tested on the D-Link DIR-685 by sending traffic to each of the ports in turn. It works. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Cc: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ef6c8da71eaffe4e251b0ff2a1d0da96f89fe6b0 Author: Geetha sowjanya Date: Wed Sep 1 15:25:50 2021 +0530 octeontx2-pf: cn10K: Reserve LMTST lines per core This patch reserves the LMTST lines per cpu instead of separate LMTST lines for NPA(buffer free) and NIX(sqe flush). LMTST line of the core on which SQ or RQ is processed is used for LMTST operation. This patch also replace STEOR with STEORL release semantics and updates driver name in ethtool file. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 21274aa1781941884599a97ab59be7f8f36af98c Author: Smadar Fuks Date: Wed Sep 1 11:08:59 2021 +0530 octeontx2-af: Add additional register check to rvu_poll_reg() Check one more time before exiting the API with an error. Fix API to poll at least twice, in case there are other high priority tasks and this API doesn't get CPU cycles for multiple jiffies update. In addition, increase timeout from usecs_to_jiffies(10000) to usecs_to_jiffies(20000), to prevent the case that for CONFIG_100HZ timeout will be a single jiffies. A single jiffies results actual timeout that can be any time between 1usec and 10msec. To solve this, a value of usecs_to_jiffies(20000) ensures that timeout is 2 jiffies. Signed-off-by: Smadar Fuks Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 8eebaf4a11fc78aa5662112cfaaff9fe3834a02c Author: Wan Jiabing Date: Wed Sep 1 10:20:57 2021 +0800 net: ixp46x: Remove duplicate include of module.h Remove repeated include of linux/module.h as it has been included at line 8. Signed-off-by: Wan Jiabing Signed-off-by: David S. Miller commit c6132f6f2e682c958f7022ecfd8bec35723a1a9d Author: Michael Chan Date: Tue Aug 31 21:15:23 2021 -0400 bnxt_en: Fix 64-bit doorbell operation on 32-bit kernels The driver requires 64-bit doorbell writes to be atomic on 32-bit architectures. So we redefined writeq as a new macro with spinlock protection on 32-bit architectures. This created a new warning when we added a new file in a recent patchset. writeq is defined on many 32-bit architectures to do the memory write non-atomically and it generated a new macro redefined warning. This warning was fixed incorrectly in the recent patch. Fix this properly by adding a new bnxt_writeq() function that will do the non-atomic write under spinlock on 32-bit systems. All callers in the driver will now call bnxt_writeq() instead. v2: Need to pass in bp to bnxt_writeq() Use lo_hi_writeq() [suggested by Florian] Reported-by: kernel test robot Fixes: f9ff578251dc ("bnxt_en: introduce new firmware message API based on DMA pools") Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 58e636039b512697554b579c2bb23774061877f5 Author: Juergen Gross Date: Wed Aug 25 13:31:58 2021 +0200 xen: remove stray preempt_disable() from PV AP startup code In cpu_bringup() there is a call of preempt_disable() without a paired preempt_enable(). This is not needed as interrupts are off initially. Additionally this will result in early boot messages like: BUG: scheduling while atomic: swapper/1/0/0x00000002 Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20210825113158.11716-1-jgross@suse.com Signed-off-by: Juergen Gross commit f956c1b0d58a50dd92ec82ae4923f7cc97e2ea52 Author: Sergio Miguéns Iglesias Date: Mon Aug 30 19:53:05 2021 +0200 xen/pcifront: Removed unnecessary __ref annotation An unnecessary "__ref" annotation was removed from the "drivers/pci/xen_pcifront.c" file. The function where the annotation was used was "pcifront_backend_changed()", which does not call any functions annotated as "__*init" nor "__*exit". This makes "__ref" unnecessary since this annotation is used to make the compiler ignore section miss-matches when they are not happening here in the first place. In addition to the aforementioned change, some code style issues were fixed in the same file. Signed-off-by: Sergio Miguéns Iglesias Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20210830175305.13370-1-sergio@lony.xyz Signed-off-by: Juergen Gross commit 4b92d4add5f6dcf21275185c997d6ecb800054cd Author: Thomas Gleixner Date: Tue Aug 31 13:48:34 2021 +0200 drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() DEFINE_SMP_CALL_CACHE_FUNCTION() was usefel before the CPU hotplug rework to ensure that the cache related functions are called on the upcoming CPU because the notifier itself could run on any online CPU. The hotplug state machine guarantees that the callbacks are invoked on the upcoming CPU. So there is no need to have this SMP function call obfuscation. That indirection was missed when the hotplug notifiers were converted. This also solves the problem of ARM64 init_cache_level() invoking ACPI functions which take a semaphore in that context. That's invalid as SMP function calls run with interrupts disabled. Running it just from the callback in context of the CPU hotplug thread solves this. Fixes: 8571890e1513 ("arm64: Add support for ACPI based firmware tables") Reported-by: Guenter Roeck Signed-off-by: Thomas Gleixner Tested-by: Guenter Roeck Acked-by: Will Deacon Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/871r69ersb.ffs@tglx commit b14b8b1ed0e15b8f43fba9c25654278a31ee3c2f Author: Michael Ellerman Date: Tue Aug 31 23:51:51 2021 +1000 powerpc/ptdump: Fix generic ptdump for 64-bit Since the conversion to generic ptdump we see crashes on 64-bit: BUG: Unable to handle kernel data access on read at 0xc0eeff7f00000000 Faulting instruction address: 0xc00000000045e5fc Oops: Kernel access of bad area, sig: 11 [#1] ... NIP __walk_page_range+0x2bc/0xce0 LR __walk_page_range+0x240/0xce0 Call Trace: __walk_page_range+0x240/0xce0 (unreliable) walk_page_range_novma+0x74/0xb0 ptdump_walk_pgd+0x98/0x170 ptdump_check_wx+0x88/0xd0 mark_rodata_ro+0x48/0x80 kernel_init+0x74/0x1a0 ret_from_kernel_thread+0x5c/0x64 What's happening is that have walked off the end of the kernel page tables, and started dereferencing junk values. That happens because we initialised the ptdump_range to span all the way up to 0xffffffffffffffff: static struct ptdump_range ptdump_range[] __ro_after_init = { {TASK_SIZE_MAX, ~0UL}, But the kernel page tables don't span that far. So on 64-bit set the end of the range to be the address immediately past the end of the kernel page tables, to limit the page table walk to valid addresses. Fixes: e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210831135151.886620-1-mpe@ellerman.id.au commit 46d4ee48aaef1671adfddbbde588af2259573ba7 Author: Krzysztof Kozlowski Date: Tue Aug 31 15:06:43 2021 +0200 dt-bindings: clock: samsung: fix header path in example The proper header is exynos4.h: samsung,exynos4412-isp-clock.example.dts:19:18: fatal error: dt-bindings/clock/exynos4412.h: No such file or directory Fixes: 7ac615780926 ("dt-bindings: clock: samsung: convert Exynos4 to dtschema") Reported-by: Stephen Boyd Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210831130643.83249-1-krzysztof.kozlowski@canonical.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 85dfdbfc13ea9614a2168ce4a7d2cd089d84cb64 Author: jason-jh.lin Date: Tue Aug 31 15:09:03 2021 +0800 mailbox: cmdq: add multi-gce clocks support for mt8195 For the design of GCE hardware event signal transportation, evnet rx will send the event signal to all GCE event merges after receiving the event signal from the other hardware. Because GCE event merges need to response to event rx, their clocks must be enabled at that time. To make sure all the gce clock is enabled while receiving the hardware event, each cmdq mailbox should enable or disable the others gce clk at the same time. Signed-off-by: jason-jh.lin Signed-off-by: Jassi Brar commit 8d4f5a9e012abb7919f7b63656ea571f22789918 Author: jason-jh.lin Date: Tue Aug 31 15:09:02 2021 +0800 mailbox: cmdq: add mediatek mailbox support for mt8195 Add mt8195 compatible name in the driver data of cmdq mailbox driver. Signed-off-by: jason-jh.lin Signed-off-by: Jassi Brar commit 704446b935bd7061b8799b16922265f88b2a4445 Author: jason-jh.lin Date: Tue Aug 31 15:09:00 2021 +0800 dt-bindings: gce: add gce header file for mt8195 Add gce header file to define the gce subsys id, hardware event id and constant for mt8195. Signed-off-by: jason-jh.lin Signed-off-by: Jassi Brar commit 0553fb51686ee53c25386ded56848862cb66ae19 Author: jason-jh.lin Date: Tue Aug 31 15:08:59 2021 +0800 dt-bindings: mailbox: add definition for mt8195 Add definition of compatible and dt-binding header for mt8195. Signed-off-by: jason-jh.lin Signed-off-by: Jassi Brar commit 9e9fb7655ed585da8f468e29221f0ba194a5f613 Merge: 86ac54e79fe09 29ce8f9701072 Author: Linus Torvalds Date: Tue Aug 31 16:43:06 2021 -0700 Merge tag 'net-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "Core: - Enable memcg accounting for various networking objects. BPF: - Introduce bpf timers. - Add perf link and opaque bpf_cookie which the program can read out again, to be used in libbpf-based USDT library. - Add bpf_task_pt_regs() helper to access user space pt_regs in kprobes, to help user space stack unwinding. - Add support for UNIX sockets for BPF sockmap. - Extend BPF iterator support for UNIX domain sockets. - Allow BPF TCP congestion control progs and bpf iterators to call bpf_setsockopt(), e.g. to switch to another congestion control algorithm. Protocols: - Support IOAM Pre-allocated Trace with IPv6. - Support Management Component Transport Protocol. - bridge: multicast: add vlan support. - netfilter: add hooks for the SRv6 lightweight tunnel driver. - tcp: - enable mid-stream window clamping (by user space or BPF) - allow data-less, empty-cookie SYN with TFO_SERVER_COOKIE_NOT_REQD - more accurate DSACK processing for RACK-TLP - mptcp: - add full mesh path manager option - add partial support for MP_FAIL - improve use of backup subflows - optimize option processing - af_unix: add OOB notification support. - ipv6: add IFLA_INET6_RA_MTU to expose MTU value advertised by the router. - mac80211: Target Wake Time support in AP mode. - can: j1939: extend UAPI to notify about RX status. Driver APIs: - Add page frag support in page pool API. - Many improvements to the DSA (distributed switch) APIs. - ethtool: extend IRQ coalesce uAPI with timer reset modes. - devlink: control which auxiliary devices are created. - Support CAN PHYs via the generic PHY subsystem. - Proper cross-chip support for tag_8021q. - Allow TX forwarding for the software bridge data path to be offloaded to capable devices. Drivers: - veth: more flexible channels number configuration. - openvswitch: introduce per-cpu upcall dispatch. - Add internet mix (IMIX) mode to pktgen. - Transparently handle XDP operations in the bonding driver. - Add LiteETH network driver. - Renesas (ravb): - support Gigabit Ethernet IP - NXP Ethernet switch (sja1105): - fast aging support - support for "H" switch topologies - traffic termination for ports under VLAN-aware bridge - Intel 1G Ethernet - support getcrosststamp() with PCIe PTM (Precision Time Measurement) for better time sync - support Credit-Based Shaper (CBS) offload, enabling HW traffic prioritization and bandwidth reservation - Broadcom Ethernet (bnxt) - support pulse-per-second output - support larger Rx rings - Mellanox Ethernet (mlx5) - support ethtool RSS contexts and MQPRIO channel mode - support LAG offload with bridging - support devlink rate limit API - support packet sampling on tunnels - Huawei Ethernet (hns3): - basic devlink support - add extended IRQ coalescing support - report extended link state - Netronome Ethernet (nfp): - add conntrack offload support - Broadcom WiFi (brcmfmac): - add WPA3 Personal with FT to supported cipher suites - support 43752 SDIO device - Intel WiFi (iwlwifi): - support scanning hidden 6GHz networks - support for a new hardware family (Bz) - Xen pv driver: - harden netfront against malicious backends - Qualcomm mobile - ipa: refactor power management and enable automatic suspend - mhi: move MBIM to WWAN subsystem interfaces Refactor: - Ambient BPF run context and cgroup storage cleanup. - Compat rework for ndo_ioctl. Old code removal: - prism54 remove the obsoleted driver, deprecated by the p54 driver. - wan: remove sbni/granch driver" * tag 'net-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1715 commits) net: Add depends on OF_NET for LiteX's LiteETH ipv6: seg6: remove duplicated include net: hns3: remove unnecessary spaces net: hns3: add some required spaces net: hns3: clean up a type mismatch warning net: hns3: refine function hns3_set_default_feature() ipv6: remove duplicated 'net/lwtunnel.h' include net: w5100: check return value after calling platform_get_resource() net/mlxbf_gige: Make use of devm_platform_ioremap_resourcexxx() net: mdio: mscc-miim: Make use of the helper function devm_platform_ioremap_resource() net: mdio-ipq4019: Make use of devm_platform_ioremap_resource() fou: remove sparse errors ipv4: fix endianness issue in inet_rtm_getroute_build_skb() octeontx2-af: Set proper errorcode for IPv4 checksum errors octeontx2-af: Fix static code analyzer reported issues octeontx2-af: Fix mailbox errors in nix_rss_flowkey_cfg octeontx2-af: Fix loop in free and unmap counter af_unix: fix potential NULL deref in unix_dgram_connect() dpaa2-eth: Replace strlcpy with strscpy octeontx2-af: Use NDC TX for transmit packet data ... commit 86ac54e79fe09b34c52691a780a6e31d12fa57f4 Merge: 69dc8010b8fca bdb0a6548d223 Author: Linus Torvalds Date: Tue Aug 31 15:53:20 2021 -0700 Merge branch 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: "There is a long-standing subtle destroy_workqueue() bug where a workqueue can be destroyed while internal work items used for flushing are still in flight. Lai fixed it by assigning a flush color to the internal work items so that they are correctly waited for during destruction. Other than that, all are minor cleanups" * 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Remove unused WORK_NO_COLOR workqueue: Assign a color to barrier work items workqueue: Mark barrier work with WORK_STRUCT_INACTIVE workqueue: Change the code of calculating work_flags in insert_wq_barrier() workqueue: Change arguement of pwq_dec_nr_in_flight() workqueue: Rename "delayed" (delayed by active management) to "inactive" workqueue: Replace deprecated CPU-hotplug functions. workqueue: Replace deprecated ida_simple_*() with ida_alloc()/ida_free() workqueue: Fix typo in comments workqueue: Fix possible memory leaks in wq_numa_init() commit 69dc8010b8fca475170650a4ebbc0074541df859 Merge: 81b0b29bf70bb d20d30ebb1993 Author: Linus Torvalds Date: Tue Aug 31 15:49:04 2021 -0700 Merge branch 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Two cpuset behavior changes: - cpuset on cgroup2 is changed to enable memory migration based on nodemask by default. - A notification is generated when cpuset partition state changes. All other patches are minor fixes and cleanups" * 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Avoid compiler warnings with no subsystems cgroup/cpuset: Avoid memory migration when nodemasks match cgroup/cpuset: Enable memory migration for cpuset v2 cgroup/cpuset: Enable event notification when partition state changes cgroup: cgroup-v1: clean up kernel-doc notation cgroup: Replace deprecated CPU-hotplug functions. cgroup/cpuset: Fix violation of cpuset locking rule cgroup/cpuset: Fix a partition bug with hotplug cgroup/cpuset: Miscellaneous code cleanup cgroup: remove cgroup_mount from comments commit 81b0b29bf70bb8b459cf1f0b4a6a4898be457850 Merge: efa916af13206 7fd1d00bf8181 Author: Linus Torvalds Date: Tue Aug 31 15:28:21 2021 -0700 Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft Pull ibft updates from Konrad Rzeszutek Wilk: "A fix for iBFT parsing code badly interfacing when KASLR is enabled" * 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft: iscsi_ibft: fix warning in reserve_ibft_region() iscsi_ibft: fix crash due to KASLR physical memory remapping commit efa916af13206eb15916e102c45c99a13ea78f33 Merge: a998a62be9cdb d3703ef331297 Author: Linus Torvalds Date: Tue Aug 31 14:55:09 2021 -0700 Merge tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Add DM infrastructure for IMA-based remote attestion. These changes are the basis for deploying DM-based storage in a "cloud" that must validate configurations end-users run to maintain trust. These DM changes allow supported DM targets' configurations to be measured via IMA. But the policy and enforcement (of which configurations are valid) is managed by something outside the kernel (e.g. Keylime). - Fix DM crypt scalability regression on systems with many cpus due to percpu_counter spinlock contention in crypt_page_alloc(). - Use in_hardirq() instead of deprecated in_irq() in DM crypt. - Add event counters to DM writecache to allow users to further assess how the writecache is performing. - Various code cleanup in DM writecache's main IO mapping function. * tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm crypt: use in_hardirq() instead of deprecated in_irq() dm ima: update dm documentation for ima measurement support dm ima: update dm target attributes for ima measurements dm ima: add a warning in dm_init if duplicate ima events are not measured dm ima: prefix ima event name related to device mapper with dm_ dm ima: add version info to dm related events in ima log dm ima: prefix dm table hashes in ima log with hash algorithm dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc() dm: add documentation for IMA measurement support dm: update target status functions to support IMA measurement dm ima: measure data on device rename dm ima: measure data on table clear dm ima: measure data on device remove dm ima: measure data on device resume dm ima: measure data on table load dm writecache: add event counters dm writecache: report invalid return from writecache_map helpers dm writecache: further writecache_map() cleanup dm writecache: factor out writecache_map_remap_origin() dm writecache: split up writecache_map() to improve code readability commit a998a62be9cdb509491731ffe81575aa09943a32 Merge: e7c1bbcf0c315 239f32b4f161c Author: Linus Torvalds Date: Tue Aug 31 14:41:41 2021 -0700 Merge tag 'leds-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Usual driver changes, some documentation that should hopefully get LED names standartized, and many fixes" * tag 'leds-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: (32 commits) leds: pca955x: Switch to i2c probe_new leds: pca955x: Let the core process the fwnode leds: pca955x: Implement the default-state property leds: pca955x: Add brightness_get function leds: pca955x: Clean up code formatting leds: leds-core: Implement the retain-state-shutdown property dt-bindings: leds: Add retain-state-shutdown boolean Documentation: leds: standartizing LED names leds: trigger: remove reference to obsolete CONFIG_IDE_GD_ATA leds: lp50xx: Fix chip name in KConfig leds: pwm: add support for default-state device property leds: move default_state read from fwnode to core leds: flash: Remove redundant initialization of variable ret leds: lgm-sso: Propagate error codes from callee to caller leds: trigger: audio: Add an activate callback to ensure the initial brightness is set leds: rt8515: Put fwnode in any case during ->probe() leds: lt3593: Put fwnode in any case during ->probe() leds: lm3697: Make error handling more robust leds: lm3697: Update header block to reflect reality leds: lm3692x: Correct headers (of*.h -> mod_devicetable.h) ... commit 9605f75cf36e0bcc0f4ada07b5be712d30107607 Author: Jaegeuk Kim Date: Mon Aug 30 13:30:45 2021 -0700 f2fs: should put a page beyond EOF when preparing a write The prepare_compress_overwrite() gets/locks a page to prepare a read, and calls f2fs_read_multi_pages() which checks EOF first. If there's any page beyond EOF, we unlock the page and set cc->rpages[i] = NULL, which we can't put the page anymore. This makes page leak, so let's fix by putting that page. Fixes: a949dc5f2c5c ("f2fs: compress: fix race condition of overwrite vs truncate") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 827f02842e40ea2e00f401e8f4cb1bccf3b8cd86 Author: Jaegeuk Kim Date: Mon Aug 30 11:37:32 2021 -0700 f2fs: deallocate compressed pages when error happens In f2fs_write_multi_pages(), f2fs_compress_pages() allocates pages for compression work in cc->cpages[]. Then, f2fs_write_compressed_pages() initiates bio submission. But, if there's any error before submitting the IOs like early f2fs_cp_error(), previously it didn't free cpages by f2fs_compress_free_page(). Let's fix memory leak by putting that just before deallocating cc->cpages. Fixes: 4c8ff7095bef ("f2fs: support data compression") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e7c1bbcf0c315c56cd970642214aa1df3d8cf61d Merge: 871dda463c6f2 0e35f63f7f4ee Author: Linus Torvalds Date: Tue Aug 31 14:37:41 2021 -0700 Merge tag 'hwmon-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers for: - Aquacomputer D5 Next - SB-RMI power module Added chip support to existing drivers: - Support for various Zen2 and Zen3 APUs and for Yellow Carp (SMU v13) added to k10temp driver - Support for Silicom n5010 PAC added to intel-m10-bmc driver - Support for BPD-RS600 added to pmbus/bpa-rs600 driver Other notable changes: - In k10temp, do not display Tdie on Zen CPUs if there is no difference between Tdie and Tctl - Converted adt7470 and dell-smm drivers to use devm_hwmon_device_register_with_info API - Support for temperature/pwm tables added to axi-fan-control driver - Enabled fan control for Dell Precision 7510 in dell-smm driver Various other minor improvements and fixes in several drivers" * tag 'hwmon-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (41 commits) hwmon: add driver for Aquacomputer D5 Next hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API hwmon: (adt7470) Convert to use regmap hwmon: (adt7470) Fix some style issues hwmon: (k10temp) Add support for yellow carp hwmon: (k10temp) Rework the temperature offset calculation hwmon: (k10temp) Don't show Tdie for all Zen/Zen2/Zen3 CPU/APU hwmon: (k10temp) Add additional missing Zen2 and Zen3 APUs hwmon: remove amd_energy driver in Makefile hwmon: (dell-smm) Rework SMM function debugging hwmon: (dell-smm) Mark i8k_get_fan_nominal_speed as __init hwmon: (dell-smm) Mark tables as __initconst hwmon: (pmbus/bpa-rs600) Add workaround for incorrect Pin max hwmon: (pmbus/bpa-rs600) Don't use rated limits as warn limits hwmon: (axi-fan-control) Support temperature vs pwm points hwmon: (axi-fan-control) Handle irqs in natural order hwmon: (axi-fan-control) Make sure the clock is enabled hwmon: (pmbus/ibm-cffps) Fix write bits for LED control hwmon: (w83781d) Match on device tree compatibles dt-bindings: hwmon: Add bindings for Winbond W83781D ... commit 871dda463c6f2c2a4a660937e2f57616146f42de Merge: 359f3d743f3a7 8b51a8e64443b Author: Linus Torvalds Date: Tue Aug 31 14:34:01 2021 -0700 Merge branch 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "I2C has a smaller pull reuest this time: - new driver for I2C virtio - removal of PMC SMP driver because platform is already gone - IRQ probing and DMAENGINE API cleanups - add SI metric prefix definitions to units.h - beginning of i801 refactorization - a few driver improvements" * 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (28 commits) i2c: cadence: Implement save restore i2c: xlp9xx: fix main IRQ check i2c: mt65xx: fix IRQ check i2c: virtio: add a virtio i2c frontend driver i2c: hix5hd2: fix IRQ check i2c: s3c2410: fix IRQ check i2c: iop3xx: fix deferred probing i2c: synquacer: fix deferred probing i2c: sun6i-pw2i: Prefer strscpy over strlcpy i2c: remove dead PMC MSP TWI/SMBus/I2C driver i2c: dev: Use sysfs_emit() in "show" functions i2c: dev: Define pr_fmt() and drop duplication substrings i2c: designware: Fix indentation in the header i2c: designware: Use DIV_ROUND_CLOSEST() macro units: Add SI metric prefix definitions i2c: at91: mark PM ops as __maybe unused i2c: sh_mobile: : use proper DMAENGINE API for termination i2c: qup: : use proper DMAENGINE API for termination i2c: mxs: : use proper DMAENGINE API for termination i2c: imx: : use proper DMAENGINE API for termination ... commit 359f3d743f3a762cc2cc7ddb7c6fb4c57b9a06cc Merge: 8e235ff9a1e3d a75c956162978 Author: Linus Torvalds Date: Tue Aug 31 14:31:10 2021 -0700 Merge tag 'mmc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC and MEMSTICK updates from Ulf Hansson: "MMC core: - Return a proper response in case of an ioctl error - Issue HPI to interrupt BKOPS for eMMC if it timed out - Avoid hogging the CPU while polling for busy - Extend sd8787 pwrseq to support the wilc1000 SDIO - Remove a couple of confusing warning messages - Clarify comment for ->card_busy() host ops MMC host: - dw_mmc: Add data CRC error injection - mmci: De-assert reset during ->probe() - rtsx_pci: Fix long reads when clock is pre-scaled - sdhci: Correct the tuning command handle for PIO mode - sdhci-esdhc-imx: Improve support for auto tuning - sdhci-msm: Add support for the sc7280 - sdhci-of-arasan: Don't auto tune for DDR50 mode for ZynqMP - sdhci-of-arasan: Enable support for auto cmd12 - sdhci-of-arasan: Use 19MHz for SD default speed for ZynqMP for level shifter - usdhi6rol0: Implement the ->card_busy() host ops MEMSTICK: - A couple of minor cleanups" * tag 'mmc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (52 commits) mmc: queue: Remove unused parameters(request_queue) mmc: pwrseq: sd8787: fix compilation warning mmc: core: Return correct emmc response in case of ioctl error mmc: sdhci-esdhc-imx: Select the correct mode for auto tuning mmc: sdhci-esdhc-imx: Remove redundant code for manual tuning mmc: core: Issue HPI in case the BKOPS timed out mmc: queue: Match the data type of max_segments mmc: switch from 'pci_' to 'dma_' API memstick: switch from 'pci_' to 'dma_' API memstick: r592: Change the name of the 'pci_driver' structure to be consistent mmc: pwrseq: add wilc1000_sdio dependency for pwrseq_sd8787 mmc: pwrseq: sd8787: add support for wilc1000 dt-bindings: mmc: Extend pwrseq-sd8787 binding for wilc1000 dt-bindings: mmc: fsl-imx-esdhc: change the pinctrl-names rule dt-bindings: mmc: fsl-imx-esdhc: add a new compatible string dt-bindings: mmc: renesas,sdhi: Document RZ/G2L bindings dt-bindings: mmc: renesas,sdhi: Fix dtbs-check warning mmc: core: Update ->card_busy() callback comment mmc: usdhi6rol0: Implement card_busy function mmc: sdhci: Correct the tuning command handle for PIO mode ... commit 2c208abd4f9efac02622d8f3c9989f4b7b1ad973 Author: Heiner Kallweit Date: Thu Aug 26 20:58:07 2021 +0200 PCI/VPD: Use unaligned access helpers Use unaligned access helpers to simplify the code. Link: https://lore.kernel.org/r/0f1c7e21-5330-72ab-139d-f5ce3c65f04a@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 06e1913d457121a98ee276179734c34dab30f388 Author: Heiner Kallweit Date: Thu Aug 26 20:57:01 2021 +0200 PCI/VPD: Clean up public VPD defines and inline functions After recent introduction of new VPD API functions and user migration these defines and inline functions aren't used outside VPD core any longer. Link: https://lore.kernel.org/r/d33e06bf-bc5e-ece7-bf35-7245ae224d1b@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 24c521f81c305191a7c3938932ed7de1f157ff64 Author: Heiner Kallweit Date: Thu Aug 26 20:56:22 2021 +0200 cxgb4: Use pci_vpd_find_id_string() to find VPD ID string Use pci_vpd_find_id_string() to find the VPD ID string. This simplifies the code and avoids the need for pci_vpd_lrdt_size(). Link: https://lore.kernel.org/r/19ea2e9b-6e94-288a-6612-88db01b1b417@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit acfbb1b8a494d7bfd316dfb363a820e6df637e8d Author: Heiner Kallweit Date: Thu Aug 26 20:55:43 2021 +0200 PCI/VPD: Add pci_vpd_find_id_string() Add a pci_vpd_find_id_string() API function to retrieve the ID string from VPD. This way callers don't need pci_vpd_lrdt_size() any longer, and it can be made private to the VPD core. Link: https://lore.kernel.org/r/c5225bf6-8d29-970d-e271-0d7b52252630@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 46a347835cc50b04da0996a070939ed8927d69bd Author: Heiner Kallweit Date: Thu Aug 26 20:55:07 2021 +0200 PCI/VPD: Include post-processing in pci_vpd_find_tag() Move pci_vpd_find_tag() post-processing from pci_vpd_find_ro_info_keyword() to pci_vpd_find_tag(). This simplifies function pci_vpd_find_id_string() that will be added in a subsequent patch. Link: https://lore.kernel.org/r/fb15393f-d3b2-e140-2643-570d3abd7382@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 59b83b29bb5532bbff54a271e0b4f321e28b954f Author: Heiner Kallweit Date: Thu Aug 26 20:54:23 2021 +0200 PCI/VPD: Stop exporting pci_vpd_find_info_keyword() Now that the last users have been migrated to pci_vpd_find_ro_keyword() we can stop exporting this function. It's still used in VPD core code. Link: https://lore.kernel.org/r/96ca2a56-383e-9b61-9cba-4f1e5611dc15@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit a61590892ef097c180144fa469abe2256b9ae715 Author: Heiner Kallweit Date: Thu Aug 26 20:53:42 2021 +0200 PCI/VPD: Stop exporting pci_vpd_find_tag() Now that the last users have been migrated to pci_vpd_find_ro_keyword() we can stop exporting this function. It's still used in VPD core code. Link: https://lore.kernel.org/r/71131eca-0502-7878-365f-30b6614161cf@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 8e235ff9a1e3dc3d800224ab97bcd2418d3b19c3 Merge: 6f1e8b12eec44 a90887705668f Author: Linus Torvalds Date: Tue Aug 31 13:36:01 2021 -0700 Merge tag 'devprop-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework updates from Rafael Wysocki: "These improve the handling of secondary firmware nodes in fwnode_graph_get_next_endpoint() (Daniel Scally)" * tag 'devprop-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "media: device property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary" device property: Check fwnode->secondary in fwnode_graph_get_next_endpoint() commit 6f1e8b12eec44ee047dc9e0a9544b2cfed739503 Merge: 5cbba60596b1f 2cbd40709a9d4 Author: Linus Torvalds Date: Tue Aug 31 13:29:22 2021 -0700 Merge tag 'acpi-5.15-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 20210730, clean up the ACPI companion binding code, optimize the I2C handling in the XPower PMIC driver, add 16550-compatible Serial Port Subtype support to the SPCR parsing code, add a few LoongArch support bits, add a ne quirk to the button driver, add new PCH FIVR methods to the DPTF code, replace deprecated CPU-hotplug functions in the processor driver, improve the acpi_os_map_memory() handling on non-x86 and do some assorted cleanups. Specifics: - Update ACPICA code in the kernel to upstream revision 20210730 including the following changes: - Add support for the AEST table (data compiler) to iASL (Bob Moore) - Fix an if statement (add parens) (Bob Moore) - Drop trailing semicolon from some macros (Bob Moore) - Fix compilation of WPBT table with no command-line arguments in iASL (Bob Moore) - Add method name "_DIS" for use with aslmethod.c (Bob Moore) - Add new DBG2 Serial Port Subtypes (Marcin Wojtas) - Add new PCH FIVR methods to the DPTF code (Srinivas Pandruvada) - Add support for the new 16550-compatible Serial Port Subtype to the SPCR table parsing code (Marcin Wojtas) - Add DMI quirk for Lenovo Yoga 9 (14INTL5) to the ACPI button driver (Ulrich Huber) - Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA (Huacai Chen) - Add memory semantics to acpi_os_map_memory() (Lorenzo Pieralisi) - Replace deprecated CPU-hotplug functions in the ACPI processor driver (Sebastian Andrzej Siewior) - Optimize I2C-bus handling in the XPower PMIC driver (Hans de Goede) - Make platform-profile catch profile changes initiated by user space and notify user processes of them (Hans de Goede) - Clean up the ACPI companion binding and unbinding code and update debug messaging in the ACPI power resources code (Rafael Wysocki) - Clean up a couple of code pieces related to configfs (Andy Shevchenko) - Rearrange the FPDT table parsing code to avoid printing warning messages for reserved record types (Adrian Huang)" * tag 'acpi-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (27 commits) ACPI: power: Drop name from struct acpi_power_resource ACPI: power: Use acpi_handle_debug() to print debug messages ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved ACPI: button: Add DMI quirk for Lenovo Yoga 9 (14INTL5) ACPI: Add memory semantics to acpi_os_map_memory() ACPI: SPCR: Add support for the new 16550-compatible Serial Port Subtype ACPI: platform-profile: call sysfs_notify() from platform_profile_store() ACPICA: Update version to 20210730 ACPICA: Add method name "_DIS" For use with aslmethod.c ACPICA: iASL: Fix for WPBT table with no command-line arguments ACPICA: Headers: Add new DBG2 Serial Port Subtypes ACPICA: Macros should not use a trailing semicolon ACPICA: Fix an if statement (add parens) ACPICA: iASL: Add support for the AEST table (data compiler) ACPI: processor: Replace deprecated CPU-hotplug functions ACPI: DPTF: Add new PCH FIVR methods ACPI: configfs: Make get_header() to return error pointer ACPI: configfs: Use sysfs_emit() in "show" functions driver core: Split device_platform_notify() software nodes: Split software_node_notify() ... commit 5cbba60596b1f32f637190ca9ed5b1acdadb852c Merge: 9b2eacd8f0462 fe583359ddf0d Author: Linus Torvalds Date: Tue Aug 31 13:21:58 2021 -0700 Merge tag 'pm-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These address some PCI device power management issues, add new hardware support to the RAPL power capping driver, add HWP guaranteed performance change notification support to the intel_pstate driver, replace deprecated CPU-hotplug functions in a few places, update CPU PM notifiers to use raw spinlocks, update the PM domains framework (new DT property support, Kconfig fix), do a couple of cleanups in code related to system sleep, and improve the energy model and the schedutil cpufreq governor. Specifics: - Address 3 PCI device power management issues (Rafael Wysocki). - Add Power Limit4 support for Alder Lake to the Intel RAPL power capping driver (Sumeet Pawnikar). - Add HWP guaranteed performance change notification support to the intel_pstate driver (Srinivas Pandruvada). - Replace deprecated CPU-hotplug functions in code related to power management (Sebastian Andrzej Siewior). - Update CPU PM notifiers to use raw spinlocks (Valentin Schneider). - Add support for 'required-opps' DT property to the generic power domains (genpd) framework and use this property for I2C on ARM64 sc7180 (Rajendra Nayak). - Fix Kconfig issue related to genpd (Geert Uytterhoeven). - Increase energy calculation precision in the Energy Model (Lukasz Luba). - Fix kobject deletion in the exit code of the schedutil cpufreq governor (Kevin Hao). - Unmark some functions as kernel-doc in the PM core to avoid false-positive documentation build warnings (Randy Dunlap). - Check RTC features instead of ops in suspend_test Alexandre Belloni)" * tag 'pm-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: domains: Fix domain attach for CONFIG_PM_OPP=n powercap: Add Power Limit4 support for Alder Lake SoC cpufreq: intel_pstate: Process HWP Guaranteed change notification thermal: intel: Allow processing of HWP interrupt notifier: Remove atomic_notifier_call_chain_robust() PM: cpu: Make notifier chain use a raw_spinlock_t PM: sleep: unmark 'state' functions as kernel-doc arm64: dts: sc7180: Add required-opps for i2c PM: domains: Add support for 'required-opps' to set default perf state opp: Don't print an error if required-opps is missing cpufreq: schedutil: Use kobject release() method to free sugov_tunables PM: EM: Increase energy calculation precision PM: sleep: check RTC features instead of ops in suspend_test PM: sleep: s2idle: Replace deprecated CPU-hotplug functions cpufreq: Replace deprecated CPU-hotplug functions powercap: intel_rapl: Replace deprecated CPU-hotplug functions PCI: PM: Enable PME if it can be signaled from D3cold PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently PCI: Use pci_update_current_state() in pci_enable_device_flags() commit 8304a3a199eeb3e6434fc855ac072e7374d0c490 Author: Zhangfei Gao Date: Tue Jul 13 10:54:36 2021 +0800 PCI: Set dma-can-stall for HiSilicon chips HiSilicon KunPeng920 and KunPeng930 have devices that appear as PCI but are actually on the AMBA bus. These fake PCI devices can support SVA via the SMMU stall feature. DT systems can indicate this in the device tree, but ACPI systems don't have that mechanism, so add a "dma-can-stall" property manually for them. [bhelgaas: add text from Robin as comment near quirk] Link: https://lore.kernel.org/r/1626144876-11352-4-git-send-email-zhangfei.gao@linaro.org Signed-off-by: Zhangfei Gao Signed-off-by: Jean-Philippe Brucker Signed-off-by: Zhou Wang Signed-off-by: Bjorn Helgaas Acked-by: Robin Murphy commit 9b2eacd8f04625c6cb2dd82469972a3bba3a783a Merge: 8e0cd9525ca7a bfc3cac0c7612 Author: Linus Torvalds Date: Tue Aug 31 13:01:40 2021 -0700 Merge tag 'Smack-for-5.15' of git://github.com/cschaufler/smack-next Pull smack updates from Casey Schaufler: "There is a variable used only during start-up that's now marked __initdata and a change where the code was working by sheer luck that is now done properly. Both have been in next for several weeks and pass the Smack testsuite" * tag 'Smack-for-5.15' of git://github.com/cschaufler/smack-next: smack: mark 'smack_enabled' global variable as __initdata Smack: Fix wrong semantics in smk_access_entry() commit 0e898eb8df4e34c7b129452444eb7cef68a11f43 Author: Simon Xue Date: Fri Jun 25 14:55:11 2021 +0800 PCI: rockchip-dwc: Add Rockchip RK356X host controller driver Add a driver for the DesignWare-based PCIe controller found on RK356X. The existing pcie-rockchip-host driver is only used for the Rockchip-designed IP found on RK3399. Link: https://lore.kernel.org/r/20210625065511.1096935-1-xxm@rock-chips.com Tested-by: Peter Geis Signed-off-by: Simon Xue Signed-off-by: Shawn Lin Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kever Yang Reviewed-by: Rob Herring commit 71121fdd79f562c891900ff21c27316ddeac73af Author: Krzysztof Wilczyński Date: Thu Jul 1 21:02:52 2021 +0000 PCI: dwc: Remove surplus break statement after return As part of code refactoring completed in a0fd361db8e5 ("PCI: dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common code"), dw_plat_add_pcie_ep() was removed and the call to the dw_pcie_ep_init() was moved into dw_plat_pcie_probe(). This left a break statement behind that is not needed any more as as dw_plat_pcie_probe() returns immediately after calling dw_pcie_ep_init(). Remove this surplus break statement that became dead code. Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210701210252.1638709-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 8e0cd9525ca7ab8ba87135d85b10596e61b10e63 Merge: befa491ce6954 67d69e9d1a6c8 Author: Linus Torvalds Date: Tue Aug 31 12:55:50 2021 -0700 Merge tag 'audit-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit updates from Paul Moore: "Two patches in the audit pull request for v5.15; one is trivial ("header protection") but the second is a real patch that fixes a refcounting problem. The refcount fix normally would have been sent up during the -rcX cycle, but since we merged it less than a week before v5.14 proper I felt it was better to wait for the merge window to open; the patch is marked with the usual -stable markings" * tag 'audit-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: move put_tree() to avoid trim_trees refcount underflow and UAF audit: add header protection to kernel/audit.h commit 30492c12d2324e8bc9a35ef3f3c1d92a5bd7753d Author: Krzysztof Wilczyński Date: Thu Jul 1 20:44:01 2021 +0000 PCI: artpec6: Remove local code block from switch statement The switch statement in the artpec6_pcie_probe() has a local code block where "val" is defined and immediately used by the artpec6_pcie_readl(). This extra code block adds brackets at the same indentation level as the switch statement itself which can hinder readability of the code. Move the "val" declaration to the top of the function and remove the extra code block from the switch statement. Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210701204401.1636562-2-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Jesper Nilsson commit befa491ce6954adadb181c464d0318925f18e499 Merge: e55f0c439a268 893c47d1964f5 Author: Linus Torvalds Date: Tue Aug 31 12:53:34 2021 -0700 Merge tag 'selinux-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux update from Paul Moore: "We've got an unusually small SELinux pull request for v5.15 that consists of only one (?!) patch that is really pretty minor when you look at it. Unsurprisingly it passes all of our tests and merges cleanly on top of your tree right now, please merge this for v5.15" * tag 'selinux-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: return early for possible NULL audit buffers commit ee6f85683e859728eba6cbca6ed338fb608286b3 Author: Krzysztof Wilczyński Date: Thu Jul 1 20:44:00 2021 +0000 PCI: artpec6: Remove surplus break statement after return As part of code refactoring completed in a0fd361db8e5 ("PCI: dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common code"), artpec6_add_pcie_ep() was removed and the call to the dw_pcie_ep_init() was moved into artpec6_pcie_probe(). This left a break statement behind that is not needed any more as artpec6_pcie_probe() returns immediately after calling dw_pcie_ep_init(). Remove this surplus break statement that became dead code. Link: https://lore.kernel.org/r/20210701204401.1636562-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Jesper Nilsson commit 0242f6426ea78fbe3933b44f8c55ae93ec37f6cc Author: Jens Axboe Date: Tue Aug 31 13:53:00 2021 -0600 io-wq: fix queue stalling race We need to set the stalled bit early, before we drop the lock for adding us to the stall hash queue. If not, then we can race with new work being queued between adding us to the stall hash and io_worker_handle_work() marking us stalled. Signed-off-by: Jens Axboe commit 28667a526980bd713ccd55e955e9a9a9c9bc7724 Author: Riccardo Mancini Date: Sat Aug 21 11:19:30 2021 +0200 perf evsel: Handle precise_ip fallback in evsel__open_cpu() This is another patch in the effort to separate the fallback mechanisms from the open itself. In case of precise_ip fallback, the original precise_ip will be stored in the evsel (it was stored in a local variable) and the open will be retried. Since the precise_ip fallback will be the first in the chain of fallbacks, there should be no functional change with this patch. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/74208c433d2024a6c4af9c0b140b54ed6b5ea810.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 89761eefc7ad59ebe7d8436a4fe9a1830be9c3b0 Author: Nobuhiro Iwamatsu Date: Wed Aug 11 17:38:30 2021 +0900 MAINTAINERS: Add entries for Toshiba Visconti PCIe controller Add entries for Toshiba Visconti PCIe controller binding and driver. Link: https://lore.kernel.org/r/20210811083830.784065-4-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit da36024a4e838b52408cf3d04999ae934728092a Author: Nobuhiro Iwamatsu Date: Wed Aug 11 17:38:29 2021 +0900 PCI: visconti: Add Toshiba Visconti PCIe host controller driver Add support for the PCIe RC controller on Toshiba Visconti ARM SoCs. This PCIe controller is based on the Synopsys DesignWare PCIe core. Link: https://lore.kernel.org/r/20210811083830.784065-3-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Yuji Ishikawa Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Rob Herring commit 91233d003b0906f146765fbef3572509c99d9386 Author: Riccardo Mancini Date: Sat Aug 21 11:19:29 2021 +0200 perf evsel: Move bpf_counter__install_pe() to success path in evsel__open_cpu() I don't see why bpf_counter__install_pe() should get called even if fd = -1, so I'm moving it to the success path. This will be useful in following patches to separate the actual open and the related operations from the fallback mechanisms. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Link: http://lore.kernel.org/lkml/64f8a1b0a838a6e6049cd43c1beafd432999ae57.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit ebfb045a417415d8ac3f588e443f001b1278c01c Author: Riccardo Mancini Date: Sat Aug 21 11:19:28 2021 +0200 perf evsel: Move test_attr__open() to success path in evsel__open_cpu() test_attr__open() ignores the fd if -1, therefore it is safe to move it to the success path (fd >= 0). Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/b3baf11360ca96541c9631730614fd7d217496fc.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit da7c3b462293431ea2558765a977a55007a26379 Author: Riccardo Mancini Date: Sat Aug 21 11:19:27 2021 +0200 perf evsel: Move ignore_missing_thread() to fallback code This patch moves ignore_missing_thread outside the perf_event_open loop. Doing so, we need to move the retry_open flag a few places higher, with minimal impact. Furthermore, thread need not be decreased since it won't get increased by the for loop (since we're jumping back inside), but we need to check that the nthreads decrease didn't put thread out of range. The goal is to have fallbacks handled in one place only, since in the future parallel code, these would be handled separately. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/4eca51443c786baaf6811b7cd8e73aafd97f7606.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 71efc48a4cbd208707b4ee4464b9eabd3b6438aa Author: Riccardo Mancini Date: Sat Aug 21 11:19:26 2021 +0200 perf evsel: Separate rlimit increase from evsel__open_cpu() This is a preparatory patch for the workqueue patches with the goal to separate from evlist__open_cpu() the actual opening (which could be performed in parallel), from the existing fallback mechanisms, which should be handled sequentially. This patch separates the rlimit increase from evsel__open_cpu(). Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/2f256de8ec37b9809a5cef73c2fa7bce416af5d3.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit d21fc5f077f7760bbae5742e185691718518f255 Author: Riccardo Mancini Date: Sat Aug 21 11:19:25 2021 +0200 perf evsel: Separate missing feature detection from evsel__open_cpu() This is a preparatory patch for the workqueue patches with the goal to separate in evlist__open_cpu() the actual opening, which could be performed in parallel, from the existing fallback mechanisms, which should be handled sequentially. This patch separates the missing feature detection in evsel__open_cpu() into a new evsel__detect_missing_features() function. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/cba0b7d939862473662adeedb0f9c9b69566ee9a.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 6efd06e3741944e528bc8243c88d9e3320c1c80c Author: Riccardo Mancini Date: Sat Aug 21 11:19:24 2021 +0200 perf evsel: Add evsel__prepare_open() This function will prepare the evsel and disable the missing features. It will be used in one of the following patches. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/fa5e78bbb92c848226f044278fdcf777b3ce4583.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 588f4ac7639941d12fa669c30e64e0d68fb96b08 Author: Riccardo Mancini Date: Sat Aug 21 11:19:23 2021 +0200 perf evsel: Separate missing feature disabling from evsel__open_cpu This is a preparatory patch for the patches in the workqueue series with the goal to separate in evlist__open_cpu() the actual opening, which could be performed in parallel, from the existing fallback mechanisms, which should be handled sequentially. This patch separates the disabling of missing features from evlist__open_cpu() into a new function evsel__disable_missing_features((). Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/48138bd2932646dde315505da733c2ca635ad2ee.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 46def08f5db0d84275bd0a3ba4a279a2197aa3a6 Author: Riccardo Mancini Date: Sat Aug 21 11:19:22 2021 +0200 perf evsel: Save open flags in evsel in prepare_open() This patch caches the flags used in perf_event_open() inside evsel, so that they can be set in __evsel__prepare_open() (this will be useful in patches in the workqueue series, when the fallback mechanisms will be handled outside the open itself). This also optimizes the code, by not having to recompute them everytime. Since flags are now saved in evsel, the flags argument in perf_event_open() is removed. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/d9f63159098e56fa518eecf25171d72e6f74df37.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit d45ce03434fd0f9177a0d3a7237fce4263eed24b Author: Riccardo Mancini Date: Sat Aug 21 11:19:21 2021 +0200 perf evsel: Separate open preparation from open itself This is a preparatory patch for the following patches with the goal to separate in evlist__open_cpu the actual perf_event_open, which could be performed in parallel, from the existing fallback mechanisms, which should be handled sequentially. This patch separates the first lines of evsel__open_cpu into a new __evsel__prepare_open function. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/e14118b934c338dbbf68b8677f20d0d7dbf9359a.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit bc0496043edf9c78e443bcf74ed2fa04566fdc18 Author: Riccardo Mancini Date: Sat Aug 21 11:19:20 2021 +0200 perf evsel: Remove retry_sample_id goto label As far as I can tell, there is no good reason, apart from optimization to have the retry_sample_id separate from fallback_missing_features. Probably, this label was added to avoid reapplying patches for missing features that had already been applied. However, missing features that have been added later have not used this optimization, always jumping to fallback_missing_features and reapplying all missing features. This patch removes that label, replacing it with fallback_missing_features. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/340af0d03408d6621fd9c742e311db18b3585b3b.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d4da30f76b96682dfefbe34717b7c0bf69ffc74 Author: Riccardo Mancini Date: Sat Aug 21 11:19:11 2021 +0200 perf mmap: Add missing bitops.h header MMAP_CPU_MASK_BYTES uses the BITS_TO_LONGS macro, which is defined in linux/bitops.h. However, this header is not included directly, but gets imported indirectly in files using the macro. This patch adds the missing include. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/c5b91ee432a2e28e7f16337c740b43b4d0b0e86c.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 6e93bc534f1408e0e1f890e760596099b12f0d8c Author: Riccardo Mancini Date: Sat Aug 21 11:19:08 2021 +0200 libperf cpumap: Take into advantage it is sorted to optimize perf_cpu_map__max() From commit 7074674e7338863e ("perf cpumap: Maintain cpumaps ordered and without dups"), perf_cpu_map elements are sorted in ascending order. This patch improves the perf_cpu_map__max function by returning the last element. Committer notes: Do it as a ternary to keep it in just one return line, add a comment explaining it is sorted and what functions does it. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/fb79f02e7b86ea8044d563adb1e9890c906f982f.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit e55f0c439a2681a3c299bedd99ebe998049fa508 Merge: 67b03f93a30fa 2863643fb8b92 Author: Linus Torvalds Date: Tue Aug 31 12:16:05 2021 -0700 Merge tag 'kernel.sys.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull set_user() update from Christian Brauner: "This contains a single fix to set_user() which aligns permission checks with the corresponding fork() codepath. No one involved in this could come up with a reason for the difference. A capable caller can already circumvent the check when they fork where the permission checks are already for the relevant capabilities in addition to also allowing to exceed nproc when it is the init user. So apply the same logic to set_user()" * tag 'kernel.sys.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: set_user: add capability check when rlimit(RLIMIT_NPROC) exceeds commit 00823dcbdd415c868390feaca16f0265101efab4 Author: Stuart Hayes Date: Thu May 13 03:03:14 2021 +0530 PCI/portdrv: Enable Bandwidth Notification only if port supports it Previously we assumed that all Root Ports and Switch Downstream Ports supported Link Bandwidth Notification. Per spec, this is only required for Ports supporting Links wider than x1 and/or multiple Link speeds (PCIe r5.0, sec 7.5.3.6). Because we assumed all Ports supported it, we tried to set up a Bandwidth Notification IRQ, which failed for devices that don't support IRQs at all, which meant pcieport didn't attach to the Port at all. Check the Link Bandwidth Notification Capability bit and enable the service only when the Port supports it. [bhelgaas: commit log] Fixes: e8303bb7a75c ("PCI/LINK: Report degraded links via link bandwidth notification") Link: https://lore.kernel.org/r/20210512213314.7778-1-stuart.w.hayes@gmail.com Signed-off-by: Stuart Hayes Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Cc: stable@vger.kernel.org commit 67b03f93a30facabf105b8b8632e3b9b6ef9200a Merge: 927bc120a248b ad19607a90b29 Author: Linus Torvalds Date: Tue Aug 31 12:06:17 2021 -0700 Merge tag 'fs.idmapped.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull idmapping documentation updates from Christian Brauner: "The bulk of the idmapped work this cycle was adding support for idmapped mounts to btrfs. While this required the addition of a (simple) new vfs helper all the work is going through David Sterba's btrfs tree. It was way simpler to do it this way rather then forcing David to coordinate between his btrfs and my tree. Plus I don't care who merges it as long as I feel I can trust the maintainer and the btrfs folks were really fast and helpful in reviewing this work. As always, associated with the btrfs port for idmapped mounts is a new fstests extension specifically concerned with btrfs ioctls (e.g. subvolume creation, deletion etc.) on idmapped mounts which can be found in the fstests repo as 5f8179ce8b00 ("btrfs: introduce btrfs specific idmapped mounts tests"). Consequently, this cycle the idmapping pull is boring. It only contains documentation updates, specifically about how idmappings and idmapped mounts work" * tag 'fs.idmapped.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: doc: give a more thorough id handling explanation commit 927bc120a248b658acc2f5206ec4e81a794d8a57 Merge: 1dd5915a5cbda 03ba0fe4d09f2 Author: Linus Torvalds Date: Tue Aug 31 12:00:07 2021 -0700 Merge tag 'fs.close_range.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull close_range() cleanup from Christian Brauner: "This is a cleanup for close_range() which was sent as part of a bugfix we did some time ago in commit 9b5b872215fe ("file: fix close_range() for unshare+cloexec"). We used to share more code between some helpers for close_range() which made retrieving the maximum number of open fds before calling into the helpers sensible. But with the introduction of CLOSE_RANGE_CLOEXEC and the need to retrieve the number of maximum fds once more for CLOSE_RANGE_CLOEXEC that stopped making sense. So the code was in a dumb in-limbo state. Fix this by simplifying the code a bit. The original idea was to only fix the bug itself and make backporting easy. And since the cleanup wasn't very pressing I left it in linux-next for a very long time. I didn't pull the patches from the list again back then which is why they don't have lore-links. So I'm listing them below explicitly" Commit 03ba0fe4d09f ("file: simplify logic in __close_range()") Link: https://lore.kernel.org/linux-fsdevel/20210402123548.108372-3-brauner@kernel.org Commit f49fd6d3c070 ("file: let pick_file() tell caller it's done") Link: https://lore.kernel.org/linux-fsdevel/20210402123548.108372-4-brauner@kernel.org * tag 'fs.close_range.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: file: simplify logic in __close_range() file: let pick_file() tell caller it's done commit 1dd5915a5cbda100e67823e7a4ca7af919185ea6 Merge: 0ee7c3e25d8c2 8374f43123a59 Author: Linus Torvalds Date: Tue Aug 31 11:54:02 2021 -0700 Merge tag 'fs.move_mount.move_mount_set_group.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull move_mount updates from Christian Brauner: "This contains an extension to the move_mount() syscall making it possible to add a single private mount into an existing propagation tree. The use-case comes from the criu folks which have been struggling with restoring complex mount trees for a long time. Variations of this work have been discussed at Plumbers before, e.g. https://www.linuxplumbersconf.org/event/7/contributions/640/ The extension to move_mount() enables criu to restore any set of mount namespaces, mount trees and sharing group trees without introducing yet more complexity into mount propagation itself. The changes required to criu to make use of this and restore complex propagation trees are available at https://github.com/Snorch/criu/commits/mount-v2-poc A cleaned-up version of this will go up for merging into the main criu repo after this lands" * tag 'fs.move_mount.move_mount_set_group.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: tests: add move_mount(MOVE_MOUNT_SET_GROUP) selftest move_mount: allow to add a mount into an existing group commit f3c4b1341e8320e63f197a554fc5a25686a11d22 Author: Claire Chang Date: Fri Aug 27 11:48:02 2021 +0800 swiotlb: use depends on for DMA_RESTRICTED_POOL Use depends on instead of select for DMA_RESTRICTED_POOL; otherwise it will make SWIOTLB user configurable and cause compile errors for some arch (e.g. mips). Fixes: 0b84e4f8b793 ("swiotlb: Add restricted DMA pool initialization") Acked-by: Will Deacon Reported-by: Guenter Roeck Signed-off-by: Claire Chang Signed-off-by: Konrad Rzeszutek Wilk commit b75f299d6960e773a28fcd38bad901998035e69e Author: Riccardo Mancini Date: Sat Aug 21 11:19:37 2021 +0200 libsubcmd: add OPT_UINTEGER_OPTARG option type This patch adds OPT_UINTEGER_OPTARG, which is the same as OPT_UINTEGER, but also makes it possible to use the option without any value, setting the variable to a default value, d. Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/c46749b3dff796729078352ff164d363457a3587.1629490974.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 7884d0e9e30e0ba41a2d0d36de3d605fc314b532 Author: Jiawei Gu Date: Wed Aug 4 15:19:16 2021 +0800 drm/amdgpu: enable more pm sysfs under SRIOV 1-VF mode Enable pp_num_states, pp_cur_state, pp_force_state, pp_table sysfs under SRIOV 1-VF scenario. Signed-off-by: Jiawei Gu Signed-off-by: Alex Deucher commit d7eff46c214c036606dd3cd305bd5a128aecfe8c Author: Philip Yang Date: Thu Jul 29 17:19:54 2021 -0400 drm/amdgpu: fix fdinfo race with process exit Get process vm root BO ref in case process is exiting and root BO is freed, to avoid NULL pointer dereference backtrace: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 Call Trace: amdgpu_show_fdinfo+0xfe/0x2a0 [amdgpu] seq_show+0x12c/0x180 seq_read+0x153/0x410 vfs_read+0x91/0x140[ 3427.206183] ksys_read+0x4f/0xb0 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 703677d9345d87d7288ed8a2483ca424af7d4b3b Author: xinhui pan Date: Tue Aug 31 13:49:59 2021 +0800 drm/amdgpu: Fix a deadlock if previous GEM object allocation fails Fall through to handle the error instead of return. Fixes: f8aab60422c37 ("drm/amdgpu: Initialise drm_gem_object_funcs for imported BOs") Cc: stable@vger.kernel.org Signed-off-by: xinhui pan Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f7d6779df642720e22bffd449e683bb8690bd3bf Author: Guchun Chen Date: Fri Aug 27 18:31:41 2021 +0800 drm/amdgpu: stop scheduler when calling hw_fini (v2) This gurantees no more work on the ring can be submitted to hardware in suspend/resume case, otherwise a potential race will occur and the ring will get no chance to stay empty before suspend. v2: Call drm_sched_resubmit_job before drm_sched_start to restart jobs from the pending list. Suggested-by: Andrey Grodzovsky Suggested-by: Christian König Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 156872b07e893d01454ce9a4cf33f1b025aea516 Author: John Clements Date: Tue Aug 31 14:43:53 2021 +0800 drm/amdgpu: Clear RAS interrupt status on aldebaran Resolve incorrect register address Reviewed-by: Candice Li Signed-off-by: John Clements Signed-off-by: Alex Deucher commit e5b310f900ccf2380b2432ad33e5b4c0cd699b78 Author: Michael Strauss Date: Mon Aug 16 16:15:36 2021 -0400 drm/amd/display: Initialize lt_settings on instantiation [WHY] lt_settings' pointers remain uninitialized but nonzero if display fails to light up with no DPCD/EDID info populated, leading to a hang on access Reviewed-by: Nicholas Kazlauskas Acked-by: Mikita Lipski Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0e62b094a82d5266283b6acb862e5dcc15b7422f Author: Angus Wang Date: Thu Aug 12 16:33:43 2021 -0400 drm/amd/display: cleanup idents after a revert [WHY] The change has caused high idle memory clock speed and power consumption at some resolutions and frame rates for Navi10 [HOW] Reverted change "drm/amd/display: Fixed Intermittent blue screen on OLED panel" Reviewed-by: Aric Cyr Acked-by: Mikita Lipski Signed-off-by: Angus Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 03388a347fe7cf7c3bdf68b0823ba316d177d470 Author: Anson Jacob Date: Fri Aug 13 17:11:51 2021 -0400 drm/amd/display: Fix memory leak reported by coverity Free memory allocated if any of the previous allocations failed. >>> CID 1487129: Resource leaks (RESOURCE_LEAK) >>> Variable "vpg" going out of scope leaks the storage it points to. Addresses-Coverity-ID: 1487129: ("Resource leaks") Reviewed-by: Aric Cyr Acked-by: Mikita Lipski Signed-off-by: Anson Jacob Signed-off-by: Alex Deucher commit 40a72c6472c52ce765d5c57ab053083c8cbcc3c9 Author: James Clark Date: Tue Aug 31 15:55:01 2021 +0100 perf tools: Fix LLVM download hint link http://llvm.org/apt returns 404, it has moved to https://apt.llvm.org/ Signed-off-by: James Clark Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20210831145501.2135754-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 792adb1aa97251c48da7035bf927920b611925c8 Author: James Clark Date: Tue Aug 31 15:55:00 2021 +0100 perf tools: Fix LLVM test failure when running in verbose mode A CI system might want to run all tests in verbose mode so that there is enough information to diagnose issues. This LLVM test is the only test that uses "-v" to signify to not skip the test if the preconditions aren't met (LLVM isn't installed). This means that running the test in verbose mode without LLVM installed causes a test failure. For consistency with the other tests, remove this verbose/skip check. An alternate solution would be to make _all_ tests not skip when run in verbose mode, but I don't think that would be intuitive. Also change the search_program() call to search_program_and_warn(). Previously the hint about installing LLVM was only printed by the actual test because this check was skipped in verbose mode. To maintain the old behaviour, the precondition check must also print the full warning. Previous output: $ ./perf test llvm 40: LLVM search and compile : 40.1: Basic BPF llvm compile : Skip $ ./perf test -v llvm 40: LLVM search and compile : 40.1: Basic BPF llvm compile : --- start --- test child forked, pid 2085835 ERROR: unable to find clang. Hint: Try to install latest clang/llvm to support BPF. Check your $PATH ... test child finished with -1 ---- end ---- LLVM search and compile subtest 1: FAILED! New output (non verbose mode is identical, verbose changes from fail to skip): $ ./perf test llvm 40: LLVM search and compile : 40.1: Basic BPF llvm compile : Skip $ ./perf test -v llvm 40: LLVM search and compile : 40.1: Basic BPF llvm compile : --- start --- test child forked, pid 2087680 ERROR: unable to find clang. Hint: Try to install latest clang/llvm to support BPF. Check your $PATH ... No clang, skip this test test child finished with -2 ---- end ---- LLVM search and compile subtest 1: Skip Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20210831145501.2135754-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit a8a2d5c0b33ed32e6056f197e065cd1800b21948 Author: James Clark Date: Tue Aug 31 15:54:59 2021 +0100 perf tools: Refactor LLVM test warning for missing binary The same warning is duplicated in two places so refactor it into a single function "search_program_and_warn". This will be used a third time in a later commit. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20210831145501.2135754-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0ee7c3e25d8c28845fceb4dd1c3cb5f50b9c45a9 Merge: 916d636e0a2df 03b8df8d43ecc Author: Linus Torvalds Date: Tue Aug 31 11:13:35 2021 -0700 Merge tag 'iomap-5.15-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap updates from Darrick Wong: "The most notable externally visible change for this cycle is the addition of support for reads to inline tail fragments of files, which was requested by the erofs developers; and a correction for a kernel memory corruption bug if the sysadmin tries to activate a swapfile with more pages than the swapfile header suggests. We also now report writeback completion errors to the file mapping correctly, instead of munging all errors into EIO. Internally, the bulk of the changes are Christoph's patchset to reduce the indirect function call count by a third to a half by converting iomap iteration from a loop pattern to a generator/consumer pattern. As an added bonus, fsdax no longer open-codes iomap apply loops. Summary: - Simplify the bio_end_page usage in the buffered IO code. - Support reading inline data at nonzero offsets for erofs. - Fix some typos and bad grammar. - Convert kmap_atomic usage in the inline data read path. - Add some extra inline data input checking. - Fix a memory corruption bug stemming from iomap_swapfile_activate trying to activate more pages than mm was expecting. - Pass errnos through the page writeback code so that writeback errors are reported correctly instead of being munged to EIO. - Replace iomap_apply with a open-coded iterator loops to reduce the number of indirect calls by a third to a half. - Refactor the fsdax code to use iomap iterators instead of the open-coded iomap_apply code that it had before. - Format file range iomap tracepoint data in hexadecimal and standardize the names used in the pretty-print string" * tag 'iomap-5.15-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (41 commits) iomap: standardize tracepoint formatting and storage mm/swap: consider max pages in iomap_swapfile_add_extent iomap: move loop control code to iter.c iomap: constify iomap_iter_srcmap fsdax: switch the fault handlers to use iomap_iter fsdax: factor out a dax_fault_actor() helper fsdax: factor out helpers to simplify the dax fault code iomap: rework unshare flag iomap: pass an iomap_iter to various buffered I/O helpers iomap: remove iomap_apply fsdax: switch dax_iomap_rw to use iomap_iter iomap: switch iomap_swapfile_activate to use iomap_iter iomap: switch iomap_seek_data to use iomap_iter iomap: switch iomap_seek_hole to use iomap_iter iomap: switch iomap_bmap to use iomap_iter iomap: switch iomap_fiemap to use iomap_iter iomap: switch __iomap_dio_rw to use iomap_iter iomap: switch iomap_page_mkwrite to use iomap_iter iomap: switch iomap_zero_range to use iomap_iter iomap: switch iomap_file_unshare to use iomap_iter ... commit 474b3f2882b21180a23672a1f80b0591b2bed039 Author: Leo Yan Date: Sun Aug 29 18:22:38 2021 +0800 perf auxtrace arm: Support compat_auxtrace_mmap__{read_head|write_tail} When the tool runs with compat mode on Arm platform, the kernel is in 64-bit mode and user space is in 32-bit mode; the user space can use instructions "ldrd" and "strd" for 64-bit value atomicity. This patch adds compat_auxtrace_mmap__{read_head|write_tail} for arm building, it uses "ldrd" and "strd" instructions to ensure accessing atomicity for aux head and tail. The file arch/arm/util/auxtrace.c is built for arm and arm64 building, these two functions are not needed for arm64, so check the compiler macro "__arm__" to only include them for arm building. Signed-off-by: Leo Yan Reviewed-by: James Clark Tested-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: "Russell King (oracle)" Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210829102238.19693-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit bbc49f1202030d8563140f307af3ab541d649bd3 Author: Leo Yan Date: Sun Aug 29 18:22:37 2021 +0800 perf auxtrace: Add compat_auxtrace_mmap__{read_head|write_tail} When perf runs in compat mode (kernel in 64-bit mode and the perf is in 32-bit mode), the 64-bit value atomicity in the user space cannot be assured, E.g. on some architectures, the 64-bit value accessing is split into two instructions, one is for the low 32-bit word accessing and another is for the high 32-bit word. This patch introduces weak functions compat_auxtrace_mmap__read_head() and compat_auxtrace_mmap__write_tail(), as their naming indicates, when perf tool works in compat mode, it uses these two functions to access the AUX head and tail. These two functions can allow the perf tool to work properly in certain conditions, e.g. when perf tool works in snapshot mode with only using AUX head pointer, or perf tool uses the AUX buffer and the incremented tail is not bigger than 4GB. When perf tool cannot handle the case when the AUX tail is bigger than 4GB, the function compat_auxtrace_mmap__write_tail() returns -1 and tells the caller to bail out for the error. These two functions are declared as weak attribute, this allows to implement arch specific functions if any arch can support the 64-bit value atomicity in compat mode. Suggested-by: Adrian Hunter Signed-off-by: Leo Yan Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: "Russell King (oracle)" Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210829102238.19693-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 298105b78b0ede160c2b94293b86d4ba4e936ad5 Author: Ian Rogers Date: Thu Aug 26 11:48:33 2021 -0700 perf bpf: Fix memory leaks relating to BTF. BTF needs to be freed with btf__free(). Signed-off-by: Ian Rogers Reviewed-by: Kajol Jain Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210826184833.408563-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 760f5e77e662e0141bd46ade28d72fc884ca64d9 Author: Joshua Martinez Date: Tue Aug 24 13:58:29 2021 -0700 perf data: Correct -h output There is currently only 1 'perf data' command, but supporting extra commands was breaking the help output. Simplify for now so that the help output is correct. Before: $ perf data -h Usage: perf data [] [] $ perf data Usage: perf data [] [] Available commands: convert - converts data file between formats After: $ perf data Usage: perf data convert [] -f, --force don't complain, do it -i, --input input file name -v, --verbose be more verbose --all Convert all events --to-ctf ... Convert to CTF format --to-json ... Convert to JSON format --tod Convert time to wall clock time $ perf data -h Usage: perf data convert [] -f, --force don't complain, do it -i, --input input file name -v, --verbose be more verbose --all Convert all events --to-ctf ... Convert to CTF format --to-json ... Convert to JSON format --tod Convert time to wall clock time Signed-off-by: Joshua Martinez Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210824205829.52822-1-irogers@google.com Signed-off-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo commit cb5a2ebbf15b87728bf1b47a12a44bdcc9a80313 Author: Colin Ian King Date: Thu Aug 26 13:18:01 2021 +0100 perf header: Fix spelling mistake "cant'" -> "can't" There is a spelling mistake in a warning message. Fix it. Signed-off-by: Colin King Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Link: http://lore.kernel.org/lkml/20210826121801.13281-1-colin.king@canonical.com Signed-off-by: Arnaldo Carvalho de Melo commit e807ffe6692bd545a2529a5c0ff6b0078b79a491 Author: Arnaldo Carvalho de Melo Date: Mon Aug 30 18:20:11 2021 -0300 perf dlfilters: Fix build on environments with a --sysroot gcc arg Such as cross building on Android, so just add EXTRA_CFLAGS to the dlfilters rules as it is where --sysroot= has been specified. Acked-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/YS1JwIMTNNWcbGdT@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 916d636e0a2df48be48b573d8ec9070408d7681f Merge: 8bda95577627d d03ef4daf33a3 Author: Linus Torvalds Date: Tue Aug 31 11:06:32 2021 -0700 Merge tag 'vfs-5.15-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull project quota update from Darrick Wong: "A single VFS patch that prevents userspace from setting project quota ids on files that the VFS considers invalid" * tag 'vfs-5.15-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: fs: forbid invalid project ID commit 8bda95577627dc0633c48d581ea3605c27efe829 Merge: 4529fb1546b9c 0bcc7ca40bd82 Author: Linus Torvalds Date: Tue Aug 31 10:57:06 2021 -0700 Merge tag 'nfsd-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "New features: - Support for server-side disconnect injection via debugfs - Protocol definitions for new RPC_AUTH_TLS authentication flavor Performance improvements: - Reduce page allocator traffic in the NFSD splice read actor - Reduce CPU utilization in svcrdma's Send completion handler Notable bug fixes: - Stabilize lockd operation when re-exporting NFS mounts - Fix the use of %.*s in NFSD tracepoints - Fix /proc/sys/fs/nfs/nsm_use_hostnames" * tag 'nfsd-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (31 commits) nfsd: fix crash on LOCKT on reexported NFSv3 nfs: don't allow reexport reclaims lockd: don't attempt blocking locks on nfs reexports nfs: don't atempt blocking locks on nfs reexports Keep read and write fds with each nlm_file lockd: update nlm_lookup_file reexport comment nlm: minor refactoring nlm: minor nlm_lookup_file argument change lockd: lockd server-side shouldn't set fl_ops SUNRPC: Add documentation for the fail_sunrpc/ directory SUNRPC: Server-side disconnect injection SUNRPC: Move client-side disconnect injection SUNRPC: Add a /sys/kernel/debug/fail_sunrpc/ directory svcrdma: xpt_bc_xprt is already clear in __svc_rdma_free() nfsd4: Fix forced-expiry locking rpc: fix gss_svc_init cleanup on failure SUNRPC: Add RPC_AUTH_TLS protocol numbers lockd: change the proc_handler for nsm_use_hostnames sysctl: introduce new proc handler proc_dobool SUNRPC: Fix a NULL pointer deref in trace_svc_stats_latency() ... commit b8ce1b9d25ccf81e1bbabd45b963ed98b2222df8 Author: Pavel Begunkov Date: Tue Aug 31 14:13:11 2021 +0100 io_uring: don't submit half-prepared drain request [ 3784.910888] BUG: kernel NULL pointer dereference, address: 0000000000000020 [ 3784.910904] RIP: 0010:__io_file_supports_nowait+0x5/0xc0 [ 3784.910926] Call Trace: [ 3784.910928] ? io_read+0x17c/0x480 [ 3784.910945] io_issue_sqe+0xcb/0x1840 [ 3784.910953] __io_queue_sqe+0x44/0x300 [ 3784.910959] io_req_task_submit+0x27/0x70 [ 3784.910962] tctx_task_work+0xeb/0x1d0 [ 3784.910966] task_work_run+0x61/0xa0 [ 3784.910968] io_run_task_work_sig+0x53/0xa0 [ 3784.910975] __x64_sys_io_uring_enter+0x22/0x30 [ 3784.910977] do_syscall_64+0x3d/0x90 [ 3784.910981] entry_SYSCALL_64_after_hwframe+0x44/0xae io_drain_req() goes before checks for REQ_F_FAIL, which protect us from submitting under-prepared request (e.g. failed in io_init_req(). Fail such drained requests as well. Fixes: a8295b982c46d ("io_uring: fix failed linkchain code logic") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e411eb9924d47a131b1e200b26b675df0c2b7627.1630415423.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c6d3d9cbd659de8f2176b4e4721149c88ac096d4 Author: Pavel Begunkov Date: Tue Aug 31 14:13:10 2021 +0100 io_uring: fix queueing half-created requests [ 27.259845] general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] SMP KASAN PTI [ 27.261043] KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] [ 27.263730] RIP: 0010:sock_from_file+0x20/0x90 [ 27.272444] Call Trace: [ 27.272736] io_sendmsg+0x98/0x600 [ 27.279216] io_issue_sqe+0x498/0x68d0 [ 27.281142] __io_queue_sqe+0xab/0xb50 [ 27.285830] io_req_task_submit+0xbf/0x1b0 [ 27.286306] tctx_task_work+0x178/0xad0 [ 27.288211] task_work_run+0xe2/0x190 [ 27.288571] exit_to_user_mode_prepare+0x1a1/0x1b0 [ 27.289041] syscall_exit_to_user_mode+0x19/0x50 [ 27.289521] do_syscall_64+0x48/0x90 [ 27.289871] entry_SYSCALL_64_after_hwframe+0x44/0xae io_req_complete_failed() -> io_req_complete_post() -> io_req_task_queue() still would try to enqueue hard linked request, which can be half prepared (e.g. failed init), so we can't allow that to happen. Fixes: a8295b982c46d ("io_uring: fix failed linkchain code logic") Reported-by: syzbot+f9704d1878e290eddf73@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/70b513848c1000f88bd75965504649c6bb1415c0.1630415423.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 08bdbd39b58474d762242e1fadb7f2eb9ffcca71 Author: Jens Axboe Date: Tue Aug 31 06:57:25 2021 -0600 io-wq: ensure that hash wait lock is IRQ disabling A previous commit removed the IRQ safety of the worker and wqe locks, but that left one spot of the hash wait lock now being done without already having IRQs disabled. Ensure that we use the right locking variant for the hashed waitqueue lock. Fixes: a9a4aa9fbfc5 ("io-wq: wqe and worker locks no longer need to be IRQ safe") Signed-off-by: Jens Axboe commit 7db304375e11741e5940f9bc549155035bfb4dc1 Author: Ming Lei Date: Sat Aug 21 23:07:51 2021 +0800 io_uring: retry in case of short read on block device In case of buffered reading from block device, when short read happens, we should retry to read more, otherwise the IO will be completed partially, for example, the following fio expects to read 2MB, but it can only read 1M or less bytes: fio --name=onessd --filename=/dev/nvme0n1 --filesize=2M \ --rw=randread --bs=2M --direct=0 --overwrite=0 --numjobs=1 \ --iodepth=1 --time_based=0 --runtime=2 --ioengine=io_uring \ --registerfiles --fixedbufs --gtod_reduce=1 --group_reporting Fix the issue by allowing short read retry for block device, which sets FMODE_BUF_RASYNC really. Fixes: 9a173346bd9e ("io_uring: fix short read retries for non-reg files") Cc: Pavel Begunkov Signed-off-by: Ming Lei Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20210821150751.1290434-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 7b3188e7ed54102a5dcc73d07727f41fb528f7c8 Author: Jens Axboe Date: Mon Aug 30 19:37:41 2021 -0600 io_uring: IORING_OP_WRITE needs hash_reg_file set During some testing, it became evident that using IORING_OP_WRITE doesn't hash buffered writes like the other writes commands do. That's simply an oversight, and can cause performance regressions when doing buffered writes with this command. Correct that and add the flag, so that buffered writes are correctly hashed when using the non-iovec based write command. Cc: stable@vger.kernel.org Fixes: 3a6820f2bb8a ("io_uring: add non-vectored read/write commands") Signed-off-by: Jens Axboe commit 94ffb0a282872c2f4b14f757fa1aef2302aeaabb Author: Jens Axboe Date: Mon Aug 30 11:55:22 2021 -0600 io-wq: fix race between adding work and activating a free worker The attempt to find and activate a free worker for new work is currently combined with creating a new one if we don't find one, but that opens io-wq up to a race where the worker that is found and activated can put itself to sleep without knowing that it has been selected to perform this new work. Fix this by moving the activation into where we add the new work item, then we can retain it within the wqe->lock scope and elimiate the race with the worker itself checking inside the lock, but sleeping outside of it. Cc: stable@vger.kernel.org Reported-by: Andres Freund Signed-off-by: Jens Axboe commit 4529fb1546b9cd3f5dbd8a36595aa4159331c963 Merge: cd358208d703f 08d736667185d Author: Linus Torvalds Date: Tue Aug 31 10:20:14 2021 -0700 Merge tag 'gfs2-v5.14-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - Various withdraw related fixes (freeze glock recursion, thread initialization / destruction order, journal recovery, glock cleanup, withdraw under journal lock). - Some error message improvements. - Various minor cleanups. * tag 'gfs2-v5.14-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Remove redundant check from gfs2_glock_dq gfs2: Delay withdraw from atomic context gfs2: Don't call dlm after protocol is unmounted gfs2: don't stop reads while withdraw in progress gfs2: Mark journal inodes as "don't cache" gfs2: nit: gfs2_drop_inode shouldn't return bool gfs2: Eliminate vestigial HIF_FIRST gfs2: Make recovery error more readable gfs2: Don't release and reacquire local statfs bh gfs2: init system threads before freeze lock gfs2: tiny cleanup in gfs2_log_reserve gfs2: trivial clean up of gfs2_ail_error gfs2: be more verbose replaying invalid rgrp blocks gfs2: Fix glock recursion in freeze_go_xmote_bh gfs2: Fix memory leak of object lsi on error return path commit cd358208d703fca446b52f3cf8f23c18f9e7705e Merge: 87045e6546078 38ef66b05cfa3 Author: Linus Torvalds Date: Tue Aug 31 10:01:14 2021 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt updates from Eric Biggers: "Some small fixes and cleanups for fs/crypto/: - Fix ->getattr() for ext4, f2fs, and ubifs to report the correct st_size for encrypted symlinks - Use base64url instead of a custom Base64 variant - Document struct fscrypt_operations" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: document struct fscrypt_operations fscrypt: align Base64 encoding with RFC 4648 base64url fscrypt: remove mention of symlink st_size quirk from documentation ubifs: report correct st_size for encrypted symlinks f2fs: report correct st_size for encrypted symlinks ext4: report correct st_size for encrypted symlinks fscrypt: add fscrypt_symlink_getattr() for computing st_size commit 67d6d80d90fb27b3cc7659f464fa3b87fd67bc14 Author: Li Zhijian Date: Tue Aug 31 18:23:16 2021 +0800 selftests/cpufreq: Rename DEBUG_PI_LIST to DEBUG_PLIST DEBUG_PI_LIST was renamed to DEBUG_PLIST since 8e18faeac3 ("lib/plist: rename DEBUG_PI_LIST to DEBUG_PLIST") - It's not reasonable to keep the deprecated configs. - configs under kselftests are recommended by corresponding tests. So if some configs are missing, it will impact the testing results CC: "Rafael J. Wysocki" CC: Viresh Kumar CC: linux-pm@vger.kernel.org Signed-off-by: Li Zhijian Acked-by: Viresh Kumar Signed-off-by: Shuah Khan commit 00712d01820fcc34052090eff41516c1e7f57382 Author: Li Zhijian Date: Tue Aug 31 18:23:15 2021 +0800 selftests/sync: Remove the deprecated config SYNC SYNC was removed since aff9da10e21 ("staging/android: make sync_timeline internal to sw_sync") LKP/0Day will check if all configs listing under selftests are able to be enabled properly. For the missing configs, it will report something like: LKP WARN miss config CONFIG_SYNC= of sync/config - it's not reasonable to keep the deprecated configs. - configs under kselftests are recommended by corresponding tests. So if some configs are missing, it will impact the testing results CC: Philip Li Reported-by: kernel test robot Signed-off-by: Li Zhijian Signed-off-by: Shuah Khan commit 87045e6546078dae215d1bd3b2bc82b3ada3ca77 Merge: 9c849ce86e0fa 0d977e0eba234 Author: Linus Torvalds Date: Tue Aug 31 09:41:22 2021 -0700 Merge tag 'for-5.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "The highlights of this round are integrations with fs-verity and idmapped mounts, the rest is usual mix of minor improvements, speedups and cleanups. There are some patches outside of btrfs, namely updating some VFS interfaces, all straightforward and acked. Features: - fs-verity support, using standard ioctls, backward compatible with read-only limitation on inodes with previously enabled fs-verity - idmapped mount support - make mount with rescue=ibadroots more tolerant to partially damaged trees - allow raid0 on a single device and raid10 on two devices, degenerate cases but might be useful as an intermediate step during conversion to other profiles - zoned mode block group auto reclaim can be disabled via sysfs knob Performance improvements: - continue readahead of node siblings even if target node is in memory, could speed up full send (on sample test +11%) - batching of delayed items can speed up creating many files - fsync/tree-log speedups - avoid unnecessary work (gains +2% throughput, -2% run time on sample load) - reduced lock contention on renames (on dbench +4% throughput, up to -30% latency) Fixes: - various zoned mode fixes - preemptive flushing threshold tuning, avoid excessive work on almost full filesystems Core: - continued subpage support, preparation for implementing remaining features like compression and defragmentation; with some limitations, write is now enabled on 64K page systems with 4K sectors, still considered experimental - no readahead on compressed reads - inline extents disabled - disabled raid56 profile conversion and mount - improved flushing logic, fixing early ENOSPC on some workloads - inode flags have been internally split to read-only and read-write incompat bit parts, used by fs-verity - new tree items for fs-verity - descriptor item - Merkle tree item - inode operations extended to be namespace-aware - cleanups and refactoring Generic code changes: - fs: new export filemap_fdatawrite_wbc - fs: removed sync_inode - block: bio_trim argument type fixups - vfs: add namespace-aware lookup" * tag 'for-5.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (114 commits) btrfs: reset replace target device to allocation state on close btrfs: zoned: fix ordered extent boundary calculation btrfs: do not do preemptive flushing if the majority is global rsv btrfs: reduce the preemptive flushing threshold to 90% btrfs: tree-log: check btrfs_lookup_data_extent return value btrfs: avoid unnecessarily logging directories that had no changes btrfs: allow idmapped mount btrfs: handle ACLs on idmapped mounts btrfs: allow idmapped INO_LOOKUP_USER ioctl btrfs: allow idmapped SUBVOL_SETFLAGS ioctl btrfs: allow idmapped SET_RECEIVED_SUBVOL ioctls btrfs: relax restrictions for SNAP_DESTROY_V2 with subvolids btrfs: allow idmapped SNAP_DESTROY ioctls btrfs: allow idmapped SNAP_CREATE/SUBVOL_CREATE ioctls btrfs: check whether fsgid/fsuid are mapped during subvolume creation btrfs: allow idmapped permission inode op btrfs: allow idmapped setattr inode op btrfs: allow idmapped tmpfile inode op btrfs: allow idmapped symlink inode op btrfs: allow idmapped mkdir inode op ... commit 9c849ce86e0fa93a218614eac562ace44053d7ce Merge: e24c567b7ecff 3998f0b8bc49e Author: Linus Torvalds Date: Tue Aug 31 09:22:37 2021 -0700 Merge tag '5.15-rc-smb3-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client updates from Steve French: "Eleven cifs/smb3 client fixes: - mostly restructuring to allow disabling less secure algorithms (this will allow eventual removing rc4 and md4 from general use in the kernel) - four fixes, including two for stable - enable r/w support with fscache and cifs.ko I am working on a larger set of changes (the usual ... multichannel, auth and signing improvements), but wanted to get these in earlier to reduce chance of merge conflicts later in the merge window" * tag '5.15-rc-smb3-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: cifs: Do not leak EDEADLK to dgetents64 for STATUS_USER_SESSION_DELETED cifs: add cifs_common directory to MAINTAINERS file cifs: cifs_md4 convert to SPDX identifier cifs: create a MD4 module and switch cifs.ko to use it cifs: fork arc4 and create a separate module for it for cifs and other users cifs: remove support for NTLM and weaker authentication algorithms cifs: enable fscache usage even for files opened as rw oid_registry: Add OIDs for missing Spnego auth mechanisms to Macs smb3: fix posix extensions mount option cifs: fix wrong release in sess_alloc_buffer() failed path CIFS: Fix a potencially linear read overflow commit 11a427be2c4749954e8b868ef5301dc65ca5a14b Author: Dan Carpenter Date: Fri Aug 27 11:54:10 2021 +0300 dmaengine: sh: fix some NULL dereferences The dma_free_coherent() function needs a valid device pointer or it will crash. Fixes: 550c591a89a1 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210827085410.GA9183@kili Signed-off-by: Vinod Koul commit 1e008336b9f590eb749ac96ccef4ea0301f79619 Author: Colin Ian King Date: Sun Aug 29 16:28:11 2021 +0100 dmaengine: sh: Fix unused initialization of pointer lmdesc Pointer lmdesc is being inintialized with a value that is never read, it is later being re-assigned a new value. Fix this by initializing it with the latter value. Addresses-Coverity: ("Unused value") Fixes: 550c591a89a1 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210829152811.529766-1-colin.king@canonical.com Signed-off-by: Vinod Koul commit 8f031494df0e5bed90f262c138f592535946910d Author: Geert Uytterhoeven Date: Tue Aug 31 14:42:21 2021 +0200 MAINTAINERS: Fix AMD PTDMA DRIVER entry Remove the bogus leading plus signs from the entry for the AMD PTDMA driver. Fixes: fa5d823b16a9442d ("dmaengine: ptdma: Initial driver for the AMD PTDMA") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/28b7663ebcaf9363324a615129417b24625a7038.1630413650.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit e24c567b7ecff1c8b6023a10d7f78256cef742c4 Merge: b91db6a0b52e0 7d5d8d7156892 Author: Linus Torvalds Date: Tue Aug 31 09:11:55 2021 -0700 Merge tag '5.15-rc-first-ksmbd-merge' of git://git.samba.org/ksmbd Pull initial ksmbd implementation from Steve French: "Initial merge of kernel smb3 file server, ksmbd. The SMB family of protocols is the most widely deployed network filesystem protocol, the default on Windows and Macs (and even on many phones and tablets), with clients and servers on all major operating systems, but lacked a kernel server for Linux. For many cases the current userspace server choices were suboptimal either due to memory footprint, performance or difficulty integrating well with advanced Linux features. ksmbd is a new kernel module which implements the server-side of the SMB3 protocol. The target is to provide optimized performance, GPLv2 SMB server, and better lease handling (distributed caching). The bigger goal is to add new features more rapidly (e.g. RDMA aka "smbdirect", and recent encryption and signing improvements to the protocol) which are easier to develop on a smaller, more tightly optimized kernel server than for example in Samba. The Samba project is much broader in scope (tools, security services, LDAP, Active Directory Domain Controller, and a cross platform file server for a wider variety of purposes) but the user space file server portion of Samba has proved hard to optimize for some Linux workloads, including for smaller devices. This is not meant to replace Samba, but rather be an extension to allow better optimizing for Linux, and will continue to integrate well with Samba user space tools and libraries where appropriate. Working with the Samba team we have already made sure that the configuration files and xattrs are in a compatible format between the kernel and user space server. Various types of functional and regression tests are regularly run against it. One example is the automated 'buildbot' regression tests which use the Linux client to test against ksmbd, e.g. http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/8/builds/56 but other test suites, including Samba's smbtorture functional test suite are also used regularly" * tag '5.15-rc-first-ksmbd-merge' of git://git.samba.org/ksmbd: (219 commits) ksmbd: fix __write_overflow warning in ndr_read_string MAINTAINERS: ksmbd: add cifs_common directory to ksmbd entry MAINTAINERS: ksmbd: update my email address ksmbd: fix permission check issue on chown and chmod ksmbd: don't set FILE DELETE and FILE_DELETE_CHILD in access mask by default MAINTAINERS: add git adddress of ksmbd ksmbd: update SMB3 multi-channel support in ksmbd.rst ksmbd: smbd: fix kernel oops during server shutdown ksmbd: remove select FS_POSIX_ACL in Kconfig ksmbd: use proper errno instead of -1 in smb2_get_ksmbd_tcon() ksmbd: update the comment for smb2_get_ksmbd_tcon() ksmbd: change int data type to boolean ksmbd: Fix multi-protocol negotiation ksmbd: fix an oops in error handling in smb2_open() ksmbd: add ipv6_addr_v4mapped check to know if connection from client is ipv4 ksmbd: fix missing error code in smb2_lock ksmbd: use channel signingkey for binding SMB2 session setup ksmbd: don't set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO ksmbd: Return STATUS_OBJECT_PATH_NOT_FOUND if smb2_creat() returns ENOENT ksmbd: fix -Wstringop-truncation warnings ... commit d3624466b56dd5b1886c1dff500525b544c19c83 Author: Konstantin Komarov Date: Tue Aug 31 16:57:40 2021 +0300 fs/ntfs3: Restyle comments to better align with kernel-doc Signed-off-by: Konstantin Komarov commit 78ab59fee07f22464f32eafebab2bd97ba94ff2d Author: Konstantin Komarov Date: Tue Aug 31 18:52:39 2021 +0300 fs/ntfs3: Rework file operations Rename now works "Add new name and remove old name". "Remove old name and add new name" may result in bad inode if we can't add new name and then can't restore (add) old name. Signed-off-by: Konstantin Komarov commit a97131c29c997e81b6fa1d1adf8f3ca07b63a2e1 Author: Kari Argillander Date: Tue Aug 24 21:20:20 2021 +0300 fs/ntfs3: Remove fat ioctl's from ntfs3 driver for now For some reason we have FAT ioctl calls. Even old ntfs driver did not use these. We should not use these because it his hard to get things out of kernel when they are upstream. That's why we remove these for now. More discussion is needed what ioctl should be implemented and what is important. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 29ce8f9701072fc221d9c38ad952de1a9578f95c Merge: c3496da580b0f 57f780f1c4336 Author: Jakub Kicinski Date: Tue Aug 31 09:06:04 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net include/linux/netdevice.h net/socket.c d0efb16294d1 ("net: don't unconditionally copy_from_user a struct ifreq for socket ioctls") 876f0bf9d0d5 ("net: socket: simplify dev_ifconf handling") 29c4964822aa ("net: socket: rework compat_ifreq_ioctl()") Signed-off-by: Jakub Kicinski commit c3496da580b0fc10fdeba8f6a5e6aef4c78b5598 Author: Slark Xiao Date: Tue Aug 31 10:40:25 2021 +0800 net: Add depends on OF_NET for LiteX's LiteETH Current settings may produce a build error when CONFIG_OF_NET is disabled. The CONFIG_OF_NET controls a headfile and some functions in . Signed-off-by: Slark Xiao Signed-off-by: Jakub Kicinski commit b1e202503508d5b66bf1532bea36b5776b00d869 Author: Zenghui Yu Date: Tue Aug 31 11:49:24 2021 +0800 dt-bindings: display: remove zte,vou.txt binding doc The zte zx platform was removed in commit 89d4f98ae90d ("ARM: remove zte zx platform") and the zxdrm driver is going to be removed in v5.15 via drm tree. Let's remove the now obsolete binding doc. Cc: Arnd Bergmann Cc: Jun Nie Cc: Shawn Guo Signed-off-by: Zenghui Yu Link: https://lore.kernel.org/r/20210831034924.86-1-yuzenghui@huawei.com Signed-off-by: Rob Herring commit 785b66427ee173609670876ea9c9d3eb35d8f3dc Author: Krzysztof Kozlowski Date: Thu Aug 19 20:25:43 2021 +0200 dt-bindings: hwmon: merge max1619 into trivial devices Ther Maxim max1619 bindings are trivial, so simply merge it into trivial-devices.yaml. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210819182544.224121-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit c47cbd4f565983c4f9c415ffc41d0e45c845b4ef Author: Rob Herring Date: Thu Aug 19 13:24:27 2021 -0500 dt-bindings: mtd-physmap: Add 'arm,vexpress-flash' compatible The 'arm,vexpress-flash' compatible is in use, but has never been documented, so add it now. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Miquel Raynal Link: https://lore.kernel.org/r/20210819182427.1175753-1-robh@kernel.org Signed-off-by: Rob Herring commit 1955d843efc3b5cf3ab4878986a87ad4972ff4e1 Author: Joel Stanley Date: Thu Aug 26 22:59:46 2021 +0930 openrisc/litex: Update defconfig Add the liteeth network device and basic network options, and update the options by doing a savedefconfig. Signed-off-by: Joel Stanley Signed-off-by: Stafford Horne commit 978c791491bce8cc1a27cb50392a2e8bbcea79d4 Author: Joel Stanley Date: Thu Aug 26 22:59:45 2021 +0930 openrisc/litex: Add ethernet device Add the liteeth ethernet device. Signed-off-by: Joel Stanley Signed-off-by: Stafford Horne commit 7851155a1a7c33f2270dcd979ab6532a89be5293 Author: Joel Stanley Date: Thu Aug 26 22:59:44 2021 +0930 openrisc/litex: Update uart address Recent litex socs will place the UART at 0xe0006800. Signed-off-by: Joel Stanley Signed-off-by: Stafford Horne commit 81912856e0fbc294deed595db568a7a00f962d95 Author: Sven Schnelle Date: Sat Aug 28 10:18:44 2021 +0200 s390/configs: enable CONFIG_KFENCE in debug_defconfig Signed-off-by: Sven Schnelle Signed-off-by: Heiko Carstens commit 15256194eff64f9a774b33b7817ea663e352394a Author: Heiko Carstens Date: Fri Aug 27 13:45:14 2021 +0200 s390/entry: make oklabel within CHKSTG macro local Make the oklabel within the CHKSTG macro local. This makes sure that tools like objdump and the crash debugging tool still disassemble full functions where the macro has been used instead of stopping half way where such a global label is used and one has to guess how to disassemble the rest of such a function: E.g.: 0000000000cb0270 : cb0270: b2 05 03 20 stck 800 ... cb0354: a7 74 00 97 jne cb0482 0000000000cb0358 : cb0358: c0 e0 00 22 4e 8f larl %r14,10fa076 ... Fixes: d35925b34996 ("s390/mcck: move storage error checks to assembler") Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 436fc4feeabbf103d78d50a8e091b3aac28cc37f Author: Sven Schnelle Date: Fri Aug 27 08:36:06 2021 +0200 s390: add kmemleak annotation in stack_alloc() kmemleak with enabled auto scanning reports that our stack allocation is lost. This is because we're saving the pointer + STACK_INIT_OFFSET to lowcore. When kmemleak now scans the objects, it thinks that this one is lost because it can't find a corresponding pointer. Reported-by: Marc Hartmayer Signed-off-by: Sven Schnelle Tested-by: Marc Hartmayer Signed-off-by: Heiko Carstens commit 2297791c92d04a154ad29ba5a073f9f627982110 Author: Vineeth Vijayan Date: Sun Apr 25 10:41:59 2021 +0200 s390/cio: dont unregister subchannel from child-drivers The devices owned by the parent-driver (css) was getting unregistered from the io-subchannel driver is clearly a layering violation. Remove the subchannel unregistration from the child-drivers. This also means, if the device connected to the subchannel is not operational, or not accessible, the subchannel will not be unregistered. Instead the CIO layer will allow valid subchannels without any operational devices in sysfs. And the userspace tooling might need to be modified to optimally handle this new situation. Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 59bda8ecee2ffc6a602b7bf2b9e43ca669cdbdcd Author: Miklos Szeredi Date: Tue Aug 31 14:18:08 2021 +0200 fuse: flush extending writes Callers of fuse_writeback_range() assume that the file is ready for modification by the server in the supplied byte range after the call returns. If there's a write that extends the file beyond the end of the supplied range, then the file needs to be extended to at least the end of the range, but currently that's not done. There are at least two cases where this can cause problems: - copy_file_range() will return short count if the file is not extended up to end of the source range. - FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE will not extend the file, hence the region may not be fully allocated. Fix by flushing writes from the start of the range up to the end of the file. This could be optimized if the writes are non-extending, etc, but it's probably not worth the trouble. Fixes: a2bc92362941 ("fuse: fix copy_file_range() in the writeback case") Fixes: 6b1bdb56b17c ("fuse: allow fallocate(FALLOC_FL_ZERO_RANGE)") Cc: # v5.2 Signed-off-by: Miklos Szeredi commit b2a6181e27c325f0e654b8d33e5fb621fc3db52b Merge: d0e936adbd225 f0712ace7fe07 Author: Rafael J. Wysocki Date: Tue Aug 31 14:02:16 2021 +0200 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq driver changes for v5.15 from Viresh Kumar: "This contains: - Update cpufreq-dt blocklist with more platforms (Bjorn Andersson). - Allow freq changes from any CPU for qcom-hw driver (Taniya Das). - Add DSVS interrupt's support for qcom-hw driver (Thara Gopinath). - A new callback (->register_em()) to register EM at a more convenient point of time." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qcom-hw: Set dvfs_possible_from_any_cpu cpufreq driver flag cpufreq: blocklist more Qualcomm platforms in cpufreq-dt-platdev cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support cpufreq: scmi: Use .register_em() to register with energy model cpufreq: vexpress: Use .register_em() to register with energy model cpufreq: scpi: Use .register_em() to register with energy model cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy model cpufreq: omap: Use .register_em() to register with energy model cpufreq: mediatek: Use .register_em() to register with energy model cpufreq: imx6q: Use .register_em() to register with energy model cpufreq: dt: Use .register_em() to register with energy model cpufreq: Add callback to register with energy model cpufreq: vexpress: Set CPUFREQ_IS_COOLING_DEV flag commit 2a3441f59464cfe5e7bdc99176142726f3a1e70e Merge: 1f8b66d9654b2 94274f20f6bf5 Author: Rafael J. Wysocki Date: Tue Aug 31 13:59:25 2021 +0200 Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull operating performance points (OPP) framework changes for v5.15 from Viresh Kumar: "This moves the OPP bindings to DT schema (Rob Herring)." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: dt-bindings: opp: Convert to DT schema dt-bindings: Clean-up OPP binding node names in examples ARM: dts: omap: Drop references to opp.txt commit a9e7c3cedc2914f63cd135b75832b9bf850af782 Author: Lv Ruyi Date: Tue Aug 31 04:22:50 2021 -0700 ipv6: seg6: remove duplicated include Remove all but the first include of net/lwtunnel.h from 'seg6_local.c. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: David S. Miller commit 7f2d4b7ffa42565a41f0fd6aa147d84863bb088b Author: Hao Chen Date: Mon Aug 30 21:51:09 2021 +0800 net: hns3: remove unnecessary spaces This patch removes some unnecessary spaces for cleanup. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit c74e503572ea0dbfa6ef3449944a286354f9f9b4 Author: Hao Chen Date: Mon Aug 30 21:51:08 2021 +0800 net: hns3: add some required spaces Add some required spaces to improve readability. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e79c0e324b011b0288cd411a5b53870a7730f163 Author: Guojia Liao Date: Mon Aug 30 21:51:07 2021 +0800 net: hns3: clean up a type mismatch warning abs() returns signed long, which could not convert the type as unsigned, and it may cause a mismatch type warning from static tools. To fix it, this patch uses an variable to save the abs()'s result and does a explicit conversion. Signed-off-by: Guojia Liao Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit dc9b5ce03124cf86bac3bd714369a8387d6e2012 Author: Jian Shen Date: Mon Aug 30 21:51:06 2021 +0800 net: hns3: refine function hns3_set_default_feature() Currently, the driver sets default feature for netdev->features, netdev->hw_features, netdev->vlan_features and netdev->hw_enc_features separately. It's fussy, because most of the feature bits are same. So refine it by copy value from netdev->features. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 53c622db99df0789ade7082d028bf4f3b6064c95 Author: Lv Ruyi Date: Tue Aug 31 02:09:06 2021 -0700 ipv6: remove duplicated 'net/lwtunnel.h' include Remove all but the first include of net/lwtunnel.h from seg6_iptunnel.c. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: David S. Miller commit a39ff4a47f3e1da3b036817ef436b1a9be10783a Author: Yang Yingliang Date: Tue Aug 31 16:40:18 2021 +0800 net: w5100: 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: David S. Miller commit 464a57281f29afc202905b456b0cb8bc729b383a Author: Cai Huoqing Date: Tue Aug 31 16:02:31 2021 +0800 net/mlxbf_gige: Make use of devm_platform_ioremap_resourcexxx() Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing Signed-off-by: David S. Miller commit 672a1c39495023e7e4e03f946ec792c17704267d Author: Cai Huoqing Date: Tue Aug 31 15:58:18 2021 +0800 net: mdio: mscc-miim: 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 Signed-off-by: David S. Miller commit fa14d03e014a130839f9dc1b97ea61fe598d873d Author: Cai Huoqing Date: Tue Aug 31 15:56:58 2021 +0800 net: mdio-ipq4019: Make use of 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 Signed-off-by: David S. Miller commit 8d65cd8d25fa23951171094553901d69a88ccdff Author: Eric Dumazet Date: Mon Aug 30 20:26:08 2021 -0700 fou: remove sparse errors We need to add __rcu qualifier to avoid these errors: net/ipv4/fou.c:250:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:250:18: expected struct net_offload const **offloads net/ipv4/fou.c:250:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:251:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:251:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:251:15: struct net_offload const * net/ipv4/fou.c:272:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:272:18: expected struct net_offload const **offloads net/ipv4/fou.c:272:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:273:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:273:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:273:15: struct net_offload const * net/ipv4/fou.c:442:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:442:18: expected struct net_offload const **offloads net/ipv4/fou.c:442:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:443:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:443:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:443:15: struct net_offload const * net/ipv4/fou.c:489:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:489:18: expected struct net_offload const **offloads net/ipv4/fou.c:489:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:490:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:490:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:490:15: struct net_offload const * net/ipv4/udp_offload.c:170:26: warning: incorrect type in assignment (different address spaces) net/ipv4/udp_offload.c:170:26: expected struct net_offload const **offloads net/ipv4/udp_offload.c:170:26: got struct net_offload const [noderef] __rcu ** net/ipv4/udp_offload.c:171:23: error: incompatible types in comparison expression (different address spaces): net/ipv4/udp_offload.c:171:23: struct net_offload const [noderef] __rcu * net/ipv4/udp_offload.c:171:23: struct net_offload const * Fixes: efc98d08e1ec ("fou: eliminate IPv4,v6 specific GRO functions") Fixes: 8bce6d7d0d1e ("udp: Generalize skb_udp_segment") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 92548b0ee220e000d81c27ac9a80e0ede895a881 Author: Eric Dumazet Date: Mon Aug 30 19:02:10 2021 -0700 ipv4: fix endianness issue in inet_rtm_getroute_build_skb() The UDP length field should be in network order. This removes the following sparse error: net/ipv4/route.c:3173:27: warning: incorrect type in assignment (different base types) net/ipv4/route.c:3173:27: expected restricted __be16 [usertype] len net/ipv4/route.c:3173:27: got unsigned long Fixes: 404eb77ea766 ("ipv4: support sport, dport and ip_proto in RTM_GETROUTE") Signed-off-by: Eric Dumazet Cc: Roopa Prabhu Cc: David Ahern Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 616920a6a567e2fc5b9437b84703de717bb7295e Merge: dc56ad7028c5f 1e4428b6dba9b Author: David S. Miller Date: Tue Aug 31 11:35:26 2021 +0100 Merge branch 'octeon-npc-fixes' Subbaraya Sundeep says: ==================== octeontx2-af: Miscellaneous fixes in npc This patchset consists of consolidated fixes in rvu_npc file. Two of the patches prevent infinite loop which can happen in corner cases. One patch is for fixing static code analyzer reported issues. And the last patch is a minor change in npc protocol checker hardware block to report ipv4 checksum errors as a known error codes. ==================== Signed-off-by: David S. Miller commit 1e4428b6dba9b683dc2ec0a56ed7879de3200cce Author: Sunil Goutham Date: Mon Aug 30 23:30:46 2021 +0530 octeontx2-af: Set proper errorcode for IPv4 checksum errors With current config, for packets with IPv4 checksum errors, errorcode is being set to UNKNOWN. Hence added a separate errorcodes for outer and inner IPv4 checksum and changed NPC configuration accordingly. Also turn on L2 multicast address check in NPC protocol check block. Fixes: 6b3321bacc5a ("octeontx2-af: Enable packet length and csum validation") Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 698a82ebfb4b2f2014baf31b7324b328a2a6366e Author: Subbaraya Sundeep Date: Mon Aug 30 23:30:45 2021 +0530 octeontx2-af: Fix static code analyzer reported issues This patch fixes the static code analyzer reported issues in rvu_npc.c. The reported errors are different sizes of operands in bitops and returning uninitialized values. Fixes: 651cd2652339 ("octeontx2-af: MCAM entry installation support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit f2e4568ec95166605c77577953b2787c7f909978 Author: Subbaraya Sundeep Date: Mon Aug 30 23:30:44 2021 +0530 octeontx2-af: Fix mailbox errors in nix_rss_flowkey_cfg In npc_update_vf_flow_entry function the loop cursor 'index' is being changed inside the loop causing the loop to spin forever. This in turn hogs the kworker thread forever and no other mbox message is processed by AF driver after that. Fix this by using another variable in the loop. Fixes: 55307fcb9258 ("octeontx2-af: Add mbox messages to install and delete MCAM rules") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 6537e96d743b89294b397b4865c6c061abae31b0 Author: Subbaraya Sundeep Date: Mon Aug 30 23:30:43 2021 +0530 octeontx2-af: Fix loop in free and unmap counter When the given counter does not belong to the entry then code ends up in infinite loop because the loop cursor, entry is not getting updated further. This patch fixes that by updating entry for every iteration. Fixes: a958dd59f9ce ("octeontx2-af: Map or unmap NPC MCAM entry and counter") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit dc56ad7028c5f559b3ce90d5cca2e6b7b839f1d5 Author: Eric Dumazet Date: Mon Aug 30 10:21:37 2021 -0700 af_unix: fix potential NULL deref in unix_dgram_connect() syzbot was able to trigger NULL deref in unix_dgram_connect() [1] This happens in if (unix_peer(sk)) sk->sk_state = other->sk_state = TCP_ESTABLISHED; // crash because @other is NULL Because locks have been dropped, unix_peer() might be non NULL, while @other is NULL (AF_UNSPEC case) We need to move code around, so that we no longer access unix_peer() and sk_state while locks have been released. [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: 10341 Comm: syz-executor239 Not tainted 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:unix_dgram_connect+0x32a/0xc60 net/unix/af_unix.c:1226 Code: 00 00 45 31 ed 49 83 bc 24 f8 05 00 00 00 74 69 e8 eb 5b a6 f9 48 8d 7d 12 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 e0 07 00 00 RSP: 0018:ffffc9000a89fcd8 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000002 RSI: ffffffff87cf4ef5 RDI: 0000000000000012 RBP: 0000000000000000 R08: 0000000000000000 R09: ffff88802e1917c3 R10: ffffffff87cf4eba R11: 0000000000000001 R12: ffff88802e191740 R13: 0000000000000000 R14: ffff88802e191d38 R15: ffff88802e1917c0 FS: 00007f3eb0052700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000004787d0 CR3: 0000000029c0a000 CR4: 00000000001506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __sys_connect_file+0x155/0x1a0 net/socket.c:1890 __sys_connect+0x161/0x190 net/socket.c:1907 __do_sys_connect net/socket.c:1917 [inline] __se_sys_connect net/socket.c:1914 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:1914 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:0x446a89 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3eb0052208 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00000000004cc4d8 RCX: 0000000000446a89 RDX: 000000000000006e RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00000000004cc4d0 R08: 00007f3eb0052700 R09: 0000000000000000 R10: 00007f3eb0052700 R11: 0000000000000246 R12: 00000000004cc4dc R13: 00007ffd791e79cf R14: 00007f3eb0052300 R15: 0000000000022000 Modules linked in: ---[ end trace 4eb809357514968c ]--- RIP: 0010:unix_dgram_connect+0x32a/0xc60 net/unix/af_unix.c:1226 Code: 00 00 45 31 ed 49 83 bc 24 f8 05 00 00 00 74 69 e8 eb 5b a6 f9 48 8d 7d 12 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 e0 07 00 00 RSP: 0018:ffffc9000a89fcd8 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000002 RSI: ffffffff87cf4ef5 RDI: 0000000000000012 RBP: 0000000000000000 R08: 0000000000000000 R09: ffff88802e1917c3 R10: ffffffff87cf4eba R11: 0000000000000001 R12: ffff88802e191740 R13: 0000000000000000 R14: ffff88802e191d38 R15: ffff88802e1917c0 FS: 00007f3eb0052700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd791fe960 CR3: 0000000029c0a000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fixes: 83301b5367a9 ("af_unix: Set TCP_ESTABLISHED for datagram sockets too") Signed-off-by: Eric Dumazet Cc: Cong Wang Cc: Alexei Starovoitov Reported-by: syzbot Signed-off-by: David S. Miller commit 995786ba0dab6c96780e411bf22347270e837c89 Author: Jason Wang Date: Mon Aug 30 21:05:31 2021 +0800 dpaa2-eth: Replace strlcpy with strscpy 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: David S. Miller commit a7314371b3f3e682bad8d814434e65f8682aade1 Author: Geetha sowjanya Date: Mon Aug 30 18:25:18 2021 +0530 octeontx2-af: Use NDC TX for transmit packet data For better performance set hardware to use NDC TX for reading packet data specified NIX_SEND_SG_S. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 6baeb3951c271cff30828c4763fa1362da56454a Author: MichelleJin Date: Sun Aug 29 04:32:29 2021 +0000 net: bridge: use mld2r_ngrec instead of icmpv6_dataun br_ip6_multicast_mld2_report function uses icmp6h to parse mld2_report packet. mld2r_ngrec defines mld2r_hdr.icmp6_dataun.un_data16[1] in include/net/mld.h. So, it is more compact to use mld2r rather than icmp6h. By doing printk test, it is confirmed that icmp6h->icmp6_dataun.un_data16[1] and mld2r->mld2r_ngrec are indeed equivalent. Also, sizeof(*mld2r) and sizeof(*icmp6h) are equivalent, too. Signed-off-by: MichelleJin Signed-off-by: David S. Miller commit 429205da6c834447a57279af128bdd56ccd5225e Author: Stefan Wahren Date: Sat Aug 28 16:23:15 2021 +0200 net: qualcomm: fix QCA7000 checksum handling Based on tests the QCA7000 doesn't support checksum offloading. So assume ip_summed is CHECKSUM_NONE and let the kernel take care of the checksum handling. This fixes data transfer issues in noisy environments. Reported-by: Michael Heimpold Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren Signed-off-by: David S. Miller commit 889a1b3f35db6ba5ba6a0c23a3a55594570b6a17 Author: Christophe JAILLET Date: Fri Aug 20 17:38:13 2021 +0200 gpio: mpc8xxx: Use 'devm_gpiochip_add_data()' to simplify the code and avoid a leak If an error occurs after a 'gpiochip_add_data()' call it must be undone by a corresponding 'gpiochip_remove()' as already done in the remove function. To simplify the code a fix a leak in the error handling path of the probe, use the managed version instead (i.e. 'devm_gpiochip_add_data()') Fixes: 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski commit 7d6588931ccd4c09e70a08175cf2e0cf7fc3b869 Author: Christophe JAILLET Date: Fri Aug 20 17:38:03 2021 +0200 gpio: mpc8xxx: Fix a potential double iounmap call in 'mpc8xxx_probe()' Commit 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") has switched to a managed version when dealing with 'mpc8xxx_gc->regs'. So the corresponding 'iounmap()' call in the error handling path and in the remove should be removed to avoid a double unmap. This also allows some simplification in the probe. All the error handling paths related to managed resources can be direct returns and a NULL check in what remains in the error handling path can be removed. Fixes: 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski commit 555bda42b0c1a5ffb72d3227c043e8afde778f1f Author: Christophe JAILLET Date: Fri Aug 20 17:37:55 2021 +0200 gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()' Commit 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") has introduced a new 'goto err;' at the very end of the function, but has not updated the error handling path accordingly. Add the now missing 'irq_domain_remove()' call which balances a previous 'irq_domain_create_linear() call. Fixes: 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski commit 6b4a2a427245fd357208ccf427891805354ef5b1 Author: Alexandru Ardelean Date: Wed Aug 25 10:01:25 2021 +0300 gpio: viperboard: remove platform_set_drvdata() call in probe The platform_set_drvdata() call is only useful if we need to retrieve back the private information. Since the driver doesn't do that, it's not useful to have it. This change removes it. Also removing with this change is some logging about the failure to init the gpio chip data. There are other logging methods to view that this failed. Signed-off-by: Alexandru Ardelean Signed-off-by: Bartosz Golaszewski commit dacd59b4b3586862b00d9894b6e65c294f4ec413 Author: Viresh Kumar Date: Tue Aug 31 12:09:17 2021 +0530 gpio: virtio: Add missing mailings lists in MAINTAINERS entry Add gpio and virtualization lists in the MAINTAINERS entry for Virtio gpio driver. Reported-by: "Michael S. Tsirkin" Signed-off-by: Viresh Kumar Signed-off-by: Bartosz Golaszewski commit 17395d7742baa4737e9d3b4672cc3d10e5970998 Author: Viresh Kumar Date: Tue Aug 31 10:59:25 2021 +0530 gpio: virtio: Fix sparse warnings Fix warnings reported by sparse, related to type mismatch between u16 and __le16. Reported-by: kernel test robot Fixes: 3a29355a22c0 ("gpio: Add virtio-gpio driver") Signed-off-by: Viresh Kumar Acked-by: Michael S. Tsirkin Signed-off-by: Bartosz Golaszewski commit efcefc7127290e7e9fa98dea029163ad8eda8fb3 Author: Thomas Hellström Date: Tue Aug 31 09:15:36 2021 +0200 drm/ttm: Fix ttm_bo_move_memcpy() for subclassed struct ttm_resource The code was making a copy of a struct ttm_resource. However, recently the struct ttm_resources were allowed to be subclassed and also were allowed to be malloced, hence the driver could end up assuming the copy we handed it was subclassed and worse, the original could have been freed at this point. Fix this by using the original struct ttm_resource before it is potentially freed in ttm_bo_move_sync_cleanup() v2: Base on drm-misc-next-fixes rather than drm-tip. Reported-by: Ben Skeggs Reported-by: Dave Airlie Cc: Christian König Cc: Fixes: 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") Signed-off-by: Thomas Hellström Reviewed-by: Christian König Reviewed-by: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/20210831071536.80636-1-thomas.hellstrom@linux.intel.com commit 65266a7c6abfa1ad915a362c41bf38576607f1f9 Merge: 1a7f67e618d42 702f43872665e Author: Catalin Marinas Date: Tue Aug 31 09:10:00 2021 +0100 Merge remote-tracking branch 'tip/sched/arm64' into for-next/core * tip/sched/arm64: (785 commits) Documentation: arm64: describe asymmetric 32-bit support arm64: Remove logic to kill 32-bit tasks on 64-bit-only cores arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 arm64: Advertise CPUs capable of running 32-bit applications in sysfs arm64: Prevent offlining first CPU with 32-bit EL0 on mismatched system arm64: exec: Adjust affinity for compat tasks with mismatched 32-bit EL0 arm64: Implement task_cpu_possible_mask() sched: Introduce dl_task_check_affinity() to check proposed affinity sched: Allow task CPU affinity to be restricted on asymmetric systems sched: Split the guts of sched_setaffinity() into a helper function sched: Introduce task_struct::user_cpus_ptr to track requested affinity sched: Reject CPU affinity changes based on task_cpu_possible_mask() cpuset: Cleanup cpuset_cpus_allowed_fallback() use in select_fallback_rq() cpuset: Honour task_cpu_possible_mask() in guarantee_online_cpus() cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 sched: Introduce task_cpu_possible_mask() to limit fallback rq selection sched: Cgroup SCHED_IDLE support sched/topology: Skip updating masks for non-online nodes Linux 5.14-rc6 lib: use PFN_PHYS() in devmem_is_allowed() ... commit baaae979b112642a41b71c71c599d875c067d257 Author: Zhang Yi Date: Thu Aug 26 21:04:09 2021 +0800 ext4: make the updating inode data procedure atomic Now that ext4_do_update_inode() return error before filling the whole inode data if we fail to set inode blocks in ext4_inode_blocks_set(). This error should never happen in theory since sb->s_maxbytes should not have allowed this, we have already init sb->s_maxbytes according to this feature in ext4_fill_super(). So even through that could only happen due to the filesystem corruption, we'd better to return after we finish updating the inode because it may left an uninitialized buffer and we could read this buffer later in "errors=continue" mode. This patch make the updating inode data procedure atomic, call EXT4_ERROR_INODE() after we dropping i_raw_lock after something bad happened, make sure that the inode is integrated, and also drop a BUG_ON and do some small cleanups. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210826130412.3921207-4-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 8e33fadf945a918c50d92fab6a769661df484156 Author: Zhang Yi Date: Thu Aug 26 21:04:08 2021 +0800 ext4: remove an unnecessary if statement in __ext4_get_inode_loc() The "if (!buffer_uptodate(bh))" hunk covered almost the whole code after getting buffer in __ext4_get_inode_loc() which seems unnecessary, remove it and switch to check ext4_buffer_uptodate(), it simplify code and make it more readable. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210826130412.3921207-3-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 0904c9ae3465c7acc066a564a76b75c0af83e6c7 Author: Zhang Yi Date: Thu Aug 26 21:04:07 2021 +0800 ext4: move inode eio simulation behind io completeion No EIO simulation is required if the buffer is uptodate, so move the simulation behind read bio completeion just like inode/block bitmap simulation does. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210826130412.3921207-2-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 4a79a98c7b19dd3d4cfe9200fbc384ba9119e039 Author: Jan Kara Date: Mon Aug 16 11:57:08 2021 +0200 ext4: Improve scalability of ext4 orphan file handling Even though the length of the critical section when adding / removing orphaned inodes was significantly reduced by using orphan file, the contention of lock protecting orphan file still appears high in profiles for truncate / unlink intensive workloads with high number of threads. This patch makes handling of orphan file completely lockless. Also to reduce conflicts between CPUs different CPUs start searching for empty slot in orphan file in different blocks. Performance comparison of locked orphan file handling, lockless orphan file handling, and completely disabled orphan inode handling from 80 CPU Xeon Server with 526 GB of RAM, filesystem located on SAS SSD disk, average of 5 runs: stress-orphan (microbenchmark truncating files byte-by-byte from N processes in parallel) Threads Time Time Time Orphan locked Orphan lockless No orphan 1 0.945600 0.939400 0.891200 2 1.331800 1.246600 1.174400 4 1.995000 1.780600 1.713200 8 6.424200 4.900000 4.106000 16 14.937600 8.516400 8.138000 32 33.038200 24.565600 24.002200 64 60.823600 39.844600 38.440200 128 122.941400 70.950400 69.315000 So we can see that with lockless orphan file handling, addition / deletion of orphaned inodes got almost completely out of picture even for a microbenchmark stressing it. For reaim creat_clo workload on ramdisk there are also noticeable gains (average of 5 runs): Clients Vanilla (ops/s) Patched (ops/s) creat_clo-1 14705.88 ( 0.00%) 14354.07 * -2.39%* creat_clo-3 27108.43 ( 0.00%) 28301.89 ( 4.40%) creat_clo-5 37406.48 ( 0.00%) 45180.73 * 20.78%* creat_clo-7 41338.58 ( 0.00%) 54687.50 * 32.29%* creat_clo-9 45226.13 ( 0.00%) 62937.07 * 39.16%* creat_clo-11 44000.00 ( 0.00%) 65088.76 * 47.93%* creat_clo-13 36516.85 ( 0.00%) 68661.97 * 88.03%* creat_clo-15 30864.20 ( 0.00%) 69551.78 * 125.35%* creat_clo-17 27478.45 ( 0.00%) 67729.08 * 146.48%* creat_clo-19 25000.00 ( 0.00%) 61621.62 * 146.49%* creat_clo-21 18772.35 ( 0.00%) 63829.79 * 240.02%* creat_clo-23 16698.94 ( 0.00%) 61938.96 * 270.92%* creat_clo-25 14973.05 ( 0.00%) 56947.61 * 280.33%* creat_clo-27 16436.69 ( 0.00%) 65008.03 * 295.51%* creat_clo-29 13949.01 ( 0.00%) 69047.62 * 395.00%* creat_clo-31 14283.52 ( 0.00%) 67982.45 * 375.95%* Reviewed-by: Theodore Ts'o Reviewed-by: Lukas Czerner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20210816095713.16537-5-jack@suse.cz Signed-off-by: Theodore Ts'o commit 3a6541e97c035dba90cdf37169d73b2d8057e55d Author: Jan Kara Date: Mon Aug 16 11:57:07 2021 +0200 ext4: Orphan file documentation Add documentation about the orphan file feature. Reviewed-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20210816095713.16537-4-jack@suse.cz Signed-off-by: Theodore Ts'o commit 02f310fcf47fa9311d6ba2946a8d19e7d7d11f37 Author: Jan Kara Date: Mon Aug 16 11:57:06 2021 +0200 ext4: Speedup ext4 orphan inode handling Ext4 orphan inode handling is a bottleneck for workloads which heavily truncate / unlink small files since it contends on the global s_orphan_mutex lock (and generally it's difficult to improve scalability of the ondisk linked list of orphaned inodes). This patch implements new way of handling orphan inodes. Instead of linking orphaned inode into a linked list, we store it's inode number in a new special file which we call "orphan file". Only if there's no more space in the orphan file (too many inodes are currently orphaned) we fall back to using old style linked list. Currently we protect operations in the orphan file with a spinlock for simplicity but even in this setting we can substantially reduce the length of the critical section and thus speedup some workloads. In the next patch we improve this by making orphan handling lockless. Note that the change is backwards compatible when the filesystem is clean - the existence of the orphan file is a compat feature, we set another ro-compat feature indicating orphan file needs scanning for orphaned inodes when mounting filesystem read-write. This ro-compat feature gets cleared on unmount / remount read-only. Some performance data from 80 CPU Xeon Server with 512 GB of RAM, filesystem located on SSD, average of 5 runs: stress-orphan (microbenchmark truncating files byte-by-byte from N processes in parallel) Threads Time Time Vanilla Patched 1 1.057200 0.945600 2 1.680400 1.331800 4 2.547000 1.995000 8 7.049400 6.424200 16 14.827800 14.937600 32 40.948200 33.038200 64 87.787400 60.823600 128 206.504000 122.941400 So we can see significant wins all over the board. Reviewed-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20210816095713.16537-3-jack@suse.cz Signed-off-by: Theodore Ts'o commit 25c6d98fc4c245d164cf688815a7b259257ead2a Author: Jan Kara Date: Mon Aug 16 11:57:05 2021 +0200 ext4: Move orphan inode handling into a separate file Move functions for handling orphan inodes into a new file fs/ext4/orphan.c to have them in one place and somewhat reduce size of other files. No code changes. Reviewed-by: Andreas Dilger Reviewed-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20210816095713.16537-2-jack@suse.cz Signed-off-by: Theodore Ts'o commit b33d9f5909c8d30f1429fb9aefbb32760901a023 Author: Theodore Ts'o Date: Sat Aug 14 10:54:09 2021 -0400 jbd2: add sparse annotations for add_transaction_credits() Signed-off-by: Theodore Ts'o commit 188c299e2a26cc33747187f87c9e044dfd85a782 Author: Jan Kara Date: Mon Aug 16 11:57:04 2021 +0200 ext4: Support for checksumming from journal triggers JBD2 layer support triggers which are called when journaling layer moves buffer to a certain state. We can use the frozen trigger, which gets called when buffer data is frozen and about to be written out to the journal, to compute block checksums for some buffer types (similarly as does ocfs2). This avoids unnecessary repeated recomputation of the checksum (at the cost of larger window where memory corruption won't be caught by checksumming) and is even necessary when there are unsynchronized updaters of the checksummed data. So add superblock and journal trigger type arguments to ext4_journal_get_write_access() and ext4_journal_get_create_access() so that frozen triggers can be set accordingly. Also add inode argument to ext4_walk_page_buffers() and all the callbacks used with that function for the same purpose. This patch is mostly only a change of prototype of the above mentioned functions and a few small helpers. Real checksumming will come later. Reviewed-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20210816095713.16537-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit a5fda11338180db13f3e9eec20c9deda1f7bad72 Author: Theodore Ts'o Date: Sat Aug 14 10:41:30 2021 -0400 ext4: fix sparse warnings Add sparse annotations to suppress false positive context imbalance warnings, and use NULL instead of 0 in EXT_MAX_{EXTENT,INDEX}. Signed-off-by: Theodore Ts'o commit a54c4613dac1500b40e4ab55199f7c51f028e848 Author: Theodore Ts'o Date: Fri Aug 20 23:44:17 2021 -0400 ext4: fix race writing to an inline_data file while its xattrs are changing The location of the system.data extended attribute can change whenever xattr_sem is not taken. So we need to recalculate the i_inline_off field since it mgiht have changed between ext4_write_begin() and ext4_write_end(). This means that caching i_inline_off is probably not helpful, so in the long run we should probably get rid of it and shrink the in-memory ext4 inode slightly, but let's fix the race the simple way for now. Cc: stable@kernel.org Fixes: f19d5870cbf72 ("ext4: add normal write support for inline data") Reported-by: syzbot+13146364637c7363a7de@syzkaller.appspotmail.com Signed-off-by: Theodore Ts'o commit bd2c38cf1726ea913024393a0d11f2e2a3f4c180 Author: Jan Kara Date: Thu Aug 12 15:31:22 2021 +0200 ext4: Make sure quota files are not grabbed accidentally If ext4 filesystem is corrupted so that quota files are linked from directory hirerarchy, bad things can happen. E.g. quota files can get corrupted or deleted. Make sure we are not grabbing quota file inodes when we expect normal inodes. Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210812133122.26360-1-jack@suse.cz commit b2bbb92f7042e8075fb036bf97043339576330c3 Author: Jan Kara Date: Thu Aug 12 14:47:37 2021 +0200 ext4: fix e2fsprogs checksum failure for mounted filesystem Commit 81414b4dd48 ("ext4: remove redundant sb checksum recomputation") removed checksum recalculation after updating superblock free space / inode counters in ext4_fill_super() based on the fact that we will recalculate the checksum on superblock writeout. That is correct assumption but until the writeout happens (which can take a long time) the checksum is incorrect in the buffer cache and if programs such as tune2fs or resize2fs is called shortly after a file system is mounted can fail. So return back the checksum recalculation and add a comment explaining why. Fixes: 81414b4dd48f ("ext4: remove redundant sb checksum recomputation") Cc: stable@kernel.org Reported-by: Boyang Xue Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210812124737.21981-1-jack@suse.cz commit 308c57ccf4318236be75dfa251c84713e694457b Author: Theodore Ts'o Date: Fri Aug 13 11:20:48 2021 -0400 ext4: if zeroout fails fall back to splitting the extent node If the underlying storage device is using thin-provisioning, it's possible for a zeroout operation to return ENOSPC. Commit df22291ff0fd ("ext4: Retry block allocation if we have free blocks left") added logic to retry block allocation since we might get free block after we commit a transaction. But the ENOSPC from thin-provisioning will confuse ext4, and lead to an infinite loop. Since using zeroout instead of splitting the extent node is an optimization, if it fails, we might as well fall back to splitting the extent node. Reported-by: yangerkun Signed-off-by: Theodore Ts'o commit facec450a8243cd3310ff8a8b9bb2f71d35df9e9 Author: Guoqing Jiang Date: Tue Jul 27 16:07:08 2021 +0800 ext4: reduce arguments of ext4_fc_add_dentry_tlv Let's pass fc_dentry directly since those arguments (tag, parent_ino and ino etc) can be deferenced from it. Signed-off-by: Guoqing Jiang Reviewed-by: Harshad Shirwadkar Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20210727080708.3708814-1-guoqing.jiang@linux.dev commit 5036ab8df278f9879d8958679bd043e32515a3e4 Author: Wang Jianchao Date: Mon Aug 30 15:52:46 2021 +0800 ext4: flush background discard kwork when retry allocation The background discard kwork tries to mark blocks used and issue discard. This can make filesystem suffer from NOSPC error, xfstest generic/371 can fail due to it. Fix it by flushing discard kwork in ext4_should_retry_alloc. At the same time, give up discard at the moment. Signed-off-by: Wang Jianchao Link: https://lore.kernel.org/r/20210830075246.12516-6-jianchao.wan9@gmail.com Signed-off-by: Theodore Ts'o commit 55cdd0af2bc5ffc92a2deb745627755aecd5db33 Author: Wang Jianchao Date: Sat Jul 24 15:41:23 2021 +0800 ext4: get discard out of jbd2 commit kthread contex Right now, discard is issued and waited to be completed in jbd2 commit kthread context after the logs are committed. When large amount of files are deleted and discard is flooding, jbd2 commit kthread can be blocked for long time. Then all of the metadata operations can be blocked to wait the log space. One case is the page fault path with read mm->mmap_sem held, which wants to update the file time but has to wait for the log space. When other threads in the task wants to do mmap, then write mmap_sem is blocked. Finally all of the following read mmap_sem requirements are blocked, even the ps command which need to read the /proc/pid/ -cmdline. Our monitor service which needs to read /proc/pid/cmdline used to be blocked for 5 mins. This patch frees the blocks back to buddy after commit and then do discard in a async kworker context in fstrim fashion, namely, - mark blocks to be discarded as used if they have not been allocated - do discard - mark them free After this, jbd2 commit kthread won't be blocked any more by discard and we won't get NOSPC even if the discard is slow or throttled. Link: https://marc.info/?l=linux-kernel&m=162143690731901&w=2 Suggested-by: Theodore Ts'o Reviewed-by: Jan Kara Signed-off-by: Wang Jianchao Link: https://lore.kernel.org/r/20210830075246.12516-5-jianchao.wan9@gmail.com Signed-off-by: Theodore Ts'o commit a16ef91aa61ac2a42b1bb199fccb897d54ab3dcd Author: Christophe JAILLET Date: Sat Aug 28 13:28:48 2021 +0200 net: pasemi: Remove usage of the deprecated "pci-dma-compat.h" API In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation Only relevant parts are given below. An 'unlikely()' has been removed when calling 'dma_mapping_error()' because this function, which is inlined, already has such an annotation. @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/bc6cd281eae024b26fd9c7ef6678d2d1dc9d74fd.1630150008.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit c66070125837900163b81a03063ddd657a7e9bfb Author: Xiyu Yang Date: Sun Aug 29 23:58:01 2021 +0800 net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed The reference counting issue happens in one exception handling path of cbq_change_class(). When failing to get tcf_block, the function forgets to decrease the refcount of "rtab" increased by qdisc_put_rtab(), causing a refcount leak. Fix this issue by jumping to "failure" label when get tcf_block failed. Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure") Signed-off-by: Xiyu Yang Reviewed-by: Cong Wang Link: https://lore.kernel.org/r/1630252681-71588-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Jakub Kicinski commit b91db6a0b52e019b6bdabea3f1dbe36d85c7e52c Merge: 3b629f8d6dc04 cf30da90bc3a2 Author: Linus Torvalds Date: Mon Aug 30 19:39:59 2021 -0700 Merge tag 'for-5.15/io_uring-vfs-2021-08-30' of git://git.kernel.dk/linux-block Pull io_uring mkdirat/symlinkat/linkat support from Jens Axboe: "This adds io_uring support for mkdirat, symlinkat, and linkat" * tag 'for-5.15/io_uring-vfs-2021-08-30' of git://git.kernel.dk/linux-block: io_uring: add support for IORING_OP_LINKAT io_uring: add support for IORING_OP_SYMLINKAT io_uring: add support for IORING_OP_MKDIRAT namei: update do_*() helpers to return ints namei: make do_linkat() take struct filename namei: add getname_uflags() namei: make do_symlinkat() take struct filename namei: make do_mknodat() take struct filename namei: make do_mkdirat() take struct filename namei: change filename_parentat() calling conventions namei: ignore ERR/NULL names in putname() commit 3b629f8d6dc04d3af94429c18fe17239d6fbe2c3 Merge: c547d89a9a445 3d5b3fbedad65 Author: Linus Torvalds Date: Mon Aug 30 19:30:30 2021 -0700 Merge tag 'io_uring-bio-cache.5-2021-08-30' of git://git.kernel.dk/linux-block Pull support for struct bio recycling from Jens Axboe: "This adds bio recycling support for polled IO, allowing quick reuse of a bio for high IOPS scenarios via a percpu bio_set list. It's good for almost a 10% improvement in performance, bumping our per-core IO limit from ~3.2M IOPS to ~3.5M IOPS" * tag 'io_uring-bio-cache.5-2021-08-30' of git://git.kernel.dk/linux-block: bio: improve kerneldoc documentation for bio_alloc_kiocb() block: provide bio_clear_hipri() helper block: use the percpu bio cache in __blkdev_direct_IO io_uring: enable use of bio alloc cache block: clear BIO_PERCPU_CACHE flag if polling isn't supported bio: add allocation cache abstraction fs: add kiocb alloc cache flag bio: optimize initialization of a bio commit c547d89a9a445f6bb757b93247de43d312e722da Merge: 44d7d3b0d1cdb 87df7fb922d18 Author: Linus Torvalds Date: Mon Aug 30 19:22:52 2021 -0700 Merge tag 'for-5.15/io_uring-2021-08-30' of git://git.kernel.dk/linux-block Pull io_uring updates from Jens Axboe: - cancellation cleanups (Hao, Pavel) - io-wq accounting cleanup (Hao) - io_uring submit locking fix (Hao) - io_uring link handling fixes (Hao) - fixed file improvements (wangyangbo, Pavel) - allow updates of linked timeouts like regular timeouts (Pavel) - IOPOLL fix (Pavel) - remove batched file get optimization (Pavel) - improve reference handling (Pavel) - IRQ task_work batching (Pavel) - allow pure fixed file, and add support for open/accept (Pavel) - GFP_ATOMIC RT kernel fix - multiple CQ ring waiter improvement - funnel IRQ completions through task_work - add support for limiting async workers explicitly - add different clocksource support for timeouts - io-wq wakeup race fix - lots of cleanups and improvement (Pavel et al) * tag 'for-5.15/io_uring-2021-08-30' of git://git.kernel.dk/linux-block: (87 commits) io-wq: fix wakeup race when adding new work io-wq: wqe and worker locks no longer need to be IRQ safe io-wq: check max_worker limits if a worker transitions bound state io_uring: allow updating linked timeouts io_uring: keep ltimeouts in a list io_uring: support CLOCK_BOOTTIME/REALTIME for timeouts io-wq: provide a way to limit max number of workers io_uring: add build check for buf_index overflows io_uring: clarify io_req_task_cancel() locking io_uring: add task-refs-get helper io_uring: fix failed linkchain code logic io_uring: remove redundant req_set_fail() io_uring: don't free request to slab io_uring: accept directly into fixed file table io_uring: hand code io_accept() fd installing io_uring: openat directly into fixed fd table net: add accept helper not installing fd io_uring: fix io_try_cancel_userdata race for iowq io_uring: IRQ rw completion batching io_uring: batch task work locking ... commit 44d7d3b0d1cdb2119dba33bbedd602ce30528d6c Merge: 9a1d6c9e3f537 62283c6c9d4c1 Author: Linus Torvalds Date: Mon Aug 30 19:09:45 2021 -0700 Merge tag 'for-5.15/libata-2021-08-30' of git://git.kernel.dk/linux-block Pull libata updates from Jens Axboe: "libata changes for the 5.15 release: - NCQ priority improvements (Damien, Niklas) - coccinelle warning fix (Jing) - dwc_460ex phy fix (Andy)" * tag 'for-5.15/libata-2021-08-30' of git://git.kernel.dk/linux-block: include:libata: fix boolreturn.cocci warnings docs: sysfs-block-device: document ncq_prio_supported docs: sysfs-block-device: improve ncq_prio_enable documentation libata: Introduce ncq_prio_supported sysfs sttribute libata: print feature list on device scan libata: fix ata_read_log_page() warning libata: cleanup NCQ priority handling libata: cleanup ata_dev_configure() libata: cleanup device sleep capability detection libata: simplify ata_scsi_rbuf_fill() libata: fix ata_host_start() ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() commit 9a1d6c9e3f53732f2f48f4424e028642db616663 Merge: 679369114e55f b5b0eba590f08 Author: Linus Torvalds Date: Mon Aug 30 19:01:46 2021 -0700 Merge tag 'for-5.15/drivers-2021-08-30' of git://git.kernel.dk/linux-block Pull block driver updates from Jens Axboe: "Sitting on top of the core block changes, here are the driver changes for the 5.15 merge window: - NVMe updates via Christoph: - suspend improvements for devices with an HMB (Keith Busch) - handle double completions more gacefull (Sagi Grimberg) - cleanup the selects for the nvme core code a bit (Sagi Grimberg) - don't update queue count when failing to set io queues (Ruozhu Li) - various nvmet connect fixes (Amit Engel) - cleanup lightnvm leftovers (Keith Busch, me) - small cleanups (Colin Ian King, Hou Pu) - add tracing for the Set Features command (Hou Pu) - CMB sysfs cleanups (Keith Busch) - add a mutex_destroy call (Keith Busch) - remove lightnvm subsystem. It's served its purpose and ultimately led to zoned nvme support, we no longer need it (Christoph) - revert floppy O_NDELAY fix (Denis) - nbd fixes (Hou, Pavel, Baokun) - nbd locking fixes (Tetsuo) - nbd device removal fixes (Christoph) - raid10 rcu warning fix (Xiao) - raid1 write behind fix (Guoqing) - rnbd fixes (Gioh, Md Haris) - misc fixes (Colin)" * tag 'for-5.15/drivers-2021-08-30' of git://git.kernel.dk/linux-block: (42 commits) Revert "floppy: reintroduce O_NDELAY fix" raid1: ensure write behind bio has less than BIO_MAX_VECS sectors md/raid10: Remove unnecessary rcu_dereference in raid10_handle_discard nbd: remove nbd->destroy_complete nbd: only return usable devices from nbd_find_unused nbd: set nbd->index before releasing nbd_index_mutex nbd: prevent IDR lookups from finding partially initialized devices nbd: reset NBD to NULL when restarting in nbd_genl_connect nbd: add missing locking to the nbd_dev_add error path nvme: remove the unused NVME_NS_* enum nvme: remove nvm_ndev from ns nvme: Have NVME_FABRICS select NVME_CORE instead of transport drivers block: nbd: add sanity check for first_minor nvmet: check that host sqsize does not exceed ctrl MQES nvmet: avoid duplicate qid in connect cmd nvmet: pass back cntlid on successful completion nvme-rdma: don't update queue count when failing to set io queues nvme-tcp: don't update queue count when failing to set io queues nvme-tcp: pair send_mutex init with destroy nvme: allow user toggling hmb usage ... commit 679369114e55f422dc593d0628cfde1d04ae59b3 Merge: 8596e589b7877 1d1cf156dc176 Author: Linus Torvalds Date: Mon Aug 30 18:52:11 2021 -0700 Merge tag 'for-5.15/block-2021-08-30' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: "Nothing major in here - lots of good cleanups and tech debt handling, which is also evident in the diffstats. In particular: - Add disk sequence numbers (Matteo) - Discard merge fix (Ming) - Relax disk zoned reporting restrictions (Niklas) - Bio error handling zoned leak fix (Pavel) - Start of proper add_disk() error handling (Luis, Christoph) - blk crypto fix (Eric) - Non-standard GPT location support (Dmitry) - IO priority improvements and cleanups (Damien)o - blk-throtl improvements (Chunguang) - diskstats_show() stack reduction (Abd-Alrhman) - Loop scheduler selection (Bart) - Switch block layer to use kmap_local_page() (Christoph) - Remove obsolete disk_name helper (Christoph) - block_device refcounting improvements (Christoph) - Ensure gendisk always has a request queue reference (Christoph) - Misc fixes/cleanups (Shaokun, Oliver, Guoqing)" * tag 'for-5.15/block-2021-08-30' of git://git.kernel.dk/linux-block: (129 commits) sg: pass the device name to blk_trace_setup block, bfq: cleanup the repeated declaration blk-crypto: fix check for too-large dun_bytes blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN blk-zoned: allow zone management send operations without CAP_SYS_ADMIN block: mark blkdev_fsync static block: refine the disk_live check in del_gendisk mmc: sdhci-tegra: Enable MMC_CAP2_ALT_GPT_TEGRA mmc: block: Support alternative_gpt_sector() operation partitions/efi: Support non-standard GPT location block: Add alternative_gpt_sector() operation bio: fix page leak bio_add_hw_page failure block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT block: remove a pointless call to MINOR() in device_add_disk null_blk: add error handling support for add_disk() virtio_blk: add error handling support for add_disk() block: add error handling for device_add_disk / add_disk block: return errors from disk_alloc_events block: return errors from blk_integrity_add block: call blk_register_queue earlier in device_add_disk ... commit 751ca492f131290155fd48e16601629ecf5ee058 Author: Richard Zhu Date: Fri Aug 27 14:42:58 2021 +0800 dt-bindings: PCI: imx6: convert the imx pcie controller to dtschema Convert the fsl,imx6q-pcie.txt into a schema. - ranges property should be grouped by region, with no functional changes. - only one propert is allowed in the compatible string, remove "snps,dw-pcie". Signed-off-by: Richard Zhu Link: https://lore.kernel.org/r/1630046580-19282-2-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Rob Herring commit 4665584888ad2175831c972c004115741ec799e9 Author: Gwendal Grignou Date: Mon Aug 30 11:00:50 2021 -0700 platform/chrome: cros_ec_trace: Fix format warnings Fix printf format issues in new tracing events. Fixes: 814318242687 ("platform/chrome: cros_ec_trace: Add fields to command traces") Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20210830180050.2077261-1-gwendal@chromium.org Signed-off-by: Benson Leung commit 19a31d79219cdd66484721f564ee68293dcc6c24 Merge: ca49bfd90a9dd fca35b11e18a9 Author: Jakub Kicinski Date: Mon Aug 30 16:42:46 2021 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== bpf-next 2021-08-31 We've added 116 non-merge commits during the last 17 day(s) which contain a total of 126 files changed, 6813 insertions(+), 4027 deletions(-). The main changes are: 1) Add opaque bpf_cookie to perf link which the program can read out again, to be used in libbpf-based USDT library, from Andrii Nakryiko. 2) Add bpf_task_pt_regs() helper to access userspace pt_regs, from Daniel Xu. 3) Add support for UNIX stream type sockets for BPF sockmap, from Jiang Wang. 4) Allow BPF TCP congestion control progs to call bpf_setsockopt() e.g. to switch to another congestion control algorithm during init, from Martin KaFai Lau. 5) Extend BPF iterator support for UNIX domain sockets, from Kuniyuki Iwashima. 6) Allow bpf_{set,get}sockopt() calls from setsockopt progs, from Prankur Gupta. 7) Add bpf_get_netns_cookie() helper for BPF_PROG_TYPE_{SOCK_OPS,CGROUP_SOCKOPT} progs, from Xu Liu and Stanislav Fomichev. 8) Support for __weak typed ksyms in libbpf, from Hao Luo. 9) Shrink struct cgroup_bpf by 504 bytes through refactoring, from Dave Marchevsky. 10) Fix a smatch complaint in verifier's narrow load handling, from Andrey Ignatov. 11) Fix BPF interpreter's tail call count limit, from Daniel Borkmann. 12) Big batch of improvements to BPF selftests, from Magnus Karlsson, Li Zhijian, Yucong Sun, Yonghong Song, Ilya Leoshkevich, Jussi Maki, Ilya Leoshkevich, others. 13) Another big batch to revamp XDP samples in order to give them consistent look and feel, from Kumar Kartikeya Dwivedi. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (116 commits) MAINTAINERS: Remove self from powerpc BPF JIT selftests/bpf: Fix potential unreleased lock samples: bpf: Fix uninitialized variable in xdp_redirect_cpu selftests/bpf: Reduce more flakyness in sockmap_listen bpf: Fix bpf-next builds without CONFIG_BPF_EVENTS bpf: selftests: Add dctcp fallback test bpf: selftests: Add connect_to_fd_opts to network_helpers bpf: selftests: Add sk_state to bpf_tcp_helpers.h bpf: tcp: Allow bpf-tcp-cc to call bpf_(get|set)sockopt selftests: xsk: Preface options with opt selftests: xsk: Make enums lower case selftests: xsk: Generate packets from specification selftests: xsk: Generate packet directly in umem selftests: xsk: Simplify cleanup of ifobjects selftests: xsk: Decrease sending speed selftests: xsk: Validate tx stats on tx thread selftests: xsk: Simplify packet validation in xsk tests selftests: xsk: Rename worker_* functions that are not thread entry points selftests: xsk: Disassociate umem size with packets sent selftests: xsk: Remove end-of-test packet ... ==================== Link: https://lore.kernel.org/r/20210830225618.11634-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit ca49bfd90a9dde175d2929dc1544b54841e33804 Author: Maxim Mikityanskiy Date: Thu Aug 26 14:54:25 2021 +0300 sch_htb: Fix inconsistency when leaf qdisc creation fails In HTB offload mode, qdiscs of leaf classes are grafted to netdev queues. sch_htb expects the dev_queue field of these qdiscs to point to the corresponding queues. However, qdisc creation may fail, and in that case noop_qdisc is used instead. Its dev_queue doesn't point to the right queue, so sch_htb can lose track of used netdev queues, which will cause internal inconsistencies. This commit fixes this bug by keeping track of the netdev queue inside struct htb_class. All reads of cl->leaf.q->dev_queue are replaced by the new field, the two values are synced on writes, and WARNs are added to assert equality of the two values. The driver API has changed: when TC_HTB_LEAF_DEL needs to move a queue, the driver used to pass the old and new queue IDs to sch_htb. Now that there is a new field (offload_queue) in struct htb_class that needs to be updated on this operation, the driver will pass the old class ID to sch_htb instead (it already knows the new class ID). Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20210826115425.1744053-1-maximmi@nvidia.com Signed-off-by: Jakub Kicinski commit 927c1e56cc5e0e22da975c72433da2458b3f4fd5 Author: Lukas Bulwahn Date: Mon Aug 30 14:22:20 2021 -0700 Input: remove dead CSR Prima2 PWRC driver Commit f3a732843acc ("ARM: remove sirf prima2/atlas platforms") removes the config ARCH_SIRF in ./arch/arm/mach-prima2/Kconfig. Hence, since then, the corresponding CSR Prima2 PWRC Driver is dead code. Remove this dead driver. Signed-off-by: Lukas Bulwahn Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210817072842.8640-1-lukas.bulwahn@gmail.com Signed-off-by: Dmitry Torokhov commit 1c6aacecea383b5982299c34b4b191f6f21eb14d Author: Linus Walleij Date: Mon Aug 30 14:23:10 2021 -0700 Input: adp5589-keys - use the right header This keyboard driver is implementing a GPIO driver, so it need to include and not the legacy header. Signed-off-by: Linus Walleij Acked-by: Michael Hennerich Link: https://lore.kernel.org/r/20210816232707.485031-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 9d9bfd180c8e3748be1f1a8843b0b54ed0ef42c9 Author: Linus Walleij Date: Mon Aug 30 14:18:59 2021 -0700 Input: adp5588-keys - use the right header This keyboard driver is implementing a GPIO driver, so it need to include and not the legacy header. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210820222958.57238-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 8596e589b787732c8346f0482919e83cc9362db1 Merge: bed91667415be d25a025201ed9 Author: Linus Torvalds Date: Mon Aug 30 15:31:33 2021 -0700 Merge tag 'timers-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "Updates for timekeeping, timers and related drivers: Core code: - Cure a couple of correctness issues in the posix CPU timer code to prevent that the tick dependency for NOHZ full is kept alive for no reason. - Avoid expensive double reprogramming of the clockevent device in hrtimer_start_range_ns(). - Avoid pointless SMP function calls when the clock was set to avoid disturbing CPUs which do not have any affected timers queued. - Make the clocksource watchdog test work correctly when CONFIG_HZ is less than 100. Drivers: - Prefer the ARM architected timer over the Exynos timer which is way more expensive to access. - Add device tree bindings for new Ingenic SoCs - The usual improvements and cleanups all over the place" * tag 'timers-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (29 commits) clocksource: Make clocksource watchdog test safe for slow-HZ systems dt-bindings: timer: Add ABIs for new Ingenic SoCs clocksource/drivers/fttmr010: Pass around less pointers clocksource/drivers/mediatek: Optimize systimer irq clear flow on shutdown clocksource/drivers/ingenic: Use bitfield macro helpers clocksource/drivers/sh_cmt: Fix wrong setting if don't request IRQ for clock source channel dt-bindings: timer: convert rockchip,rk-timer.txt to YAML clocksource/drivers/exynos_mct: Mark MCT device as CLOCK_EVT_FEAT_PERCPU clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64 hrtimer: Unbreak hrtimer_force_reprogram() hrtimer: Use raw_cpu_ptr() in clock_was_set() hrtimer: Avoid more SMP function calls in clock_was_set() hrtimer: Avoid unnecessary SMP function calls in clock_was_set() hrtimer: Add bases argument to clock_was_set() time/timekeeping: Avoid invoking clock_was_set() twice timekeeping: Distangle resume and clock-was-set events timerfd: Provide timerfd_resume() hrtimer: Force clock_was_set() handling for the HIGHRES=n, NOHZ=y case hrtimer: Ensure timerfd notification for HIGHRES=n hrtimer: Consolidate reprogramming code ... commit bed91667415be768be4e5d7691011f2b5e16d796 Merge: ccd8ec4a3f9a5 a729691b541f6 Author: Linus Torvalds Date: Mon Aug 30 15:27:15 2021 -0700 Merge tag 'x86-misc-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Thomas Gleixner: "A set of updates for the x86 reboot code: - Limit the Dell Optiplex 990 quirk to early BIOS versions to avoid the full 'power cycle' alike reboot which is required for the buggy BIOSes. - Update documentation for the reboot=pci command line option and document how DMI platform quirks can be overridden" * tag 'x86-misc-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions x86/reboot: Document how to override DMI platform quirks x86/reboot: Document the "reboot=pci" option commit ccd8ec4a3f9a5d3d97766231b04e7321dcc2df1e Merge: 0a096f240aa19 34739a2809e1e Author: Linus Torvalds Date: Mon Aug 30 15:20:05 2021 -0700 Merge tag 'x86-irq-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 PIRQ updates from Thomas Gleixner: "A set of updates to support port 0x22/0x23 based PCI configuration space which can be found on various ALi chipsets and is also available on older Intel systems which expose a PIRQ router. While the Intel support is more or less nostalgia, the ALi chips are still in use on popular embedded boards used for routers" * tag 'x86-irq-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Fix typo s/ECLR/ELCR/ for the PIC register x86: Avoid magic number with ELCR register accesses x86/PCI: Add support for the Intel 82426EX PIRQ router x86/PCI: Add support for the Intel 82374EB/82374SB (ESC) PIRQ router x86/PCI: Add support for the ALi M1487 (IBC) PIRQ router x86: Add support for 0x22/0x23 port I/O configuration space commit 0a096f240aa1992ddac65f8e704f7b0c0795fe1c Merge: 7d6e3fa87e732 b7fe54f6c2d43 Author: Linus Torvalds Date: Mon Aug 30 15:00:33 2021 -0700 Merge tag 'x86-cpu-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cache flush updates from Thomas Gleixner: "A reworked version of the opt-in L1D flush mechanism. This is a stop gap for potential future speculation related hardware vulnerabilities and a mechanism for truly security paranoid applications. It allows a task to request that the L1D cache is flushed when the kernel switches to a different mm. This can be requested via prctl(). Changes vs the previous versions: - Get rid of the software flush fallback - Make the handling consistent with other mitigations - Kill the task when it ends up on a SMT enabled core which defeats the purpose of L1D flushing obviously" * tag 'x86-cpu-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation: Add L1D flushing Documentation x86, prctl: Hook L1D flushing in via prctl x86/mm: Prepare for opt-in based L1D flush in switch_mm() x86/process: Make room for TIF_SPEC_L1D_FLUSH sched: Add task_work callback for paranoid L1D flush x86/mm: Refactor cond_ibpb() to support other use cases x86/smp: Add a per-cpu view of SMT state commit 7d6e3fa87e732ec1e7761bf325c0907685c8571b Merge: e5e726f7bb9f7 47fb0cfdb7a71 Author: Linus Torvalds Date: Mon Aug 30 14:38:37 2021 -0700 Merge tag 'irq-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "Updates to the interrupt core and driver subsystems: Core changes: - The usual set of small fixes and improvements all over the place, but nothing stands out MSI changes: - Further consolidation of the PCI/MSI interrupt chip code - Make MSI sysfs code independent of PCI/MSI and expose the MSI interrupts of platform devices in the same way as PCI exposes them. Driver changes: - Support for ARM GICv3 EPPI partitions - Treewide conversion to generic_handle_domain_irq() for all chained interrupt controllers - Conversion to bitmap_zalloc() throughout the irq chip drivers - The usual set of small fixes and improvements" * tag 'irq-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (57 commits) platform-msi: Add ABI to show msi_irqs of platform devices genirq/msi: Move MSI sysfs handling from PCI to MSI core genirq/cpuhotplug: Demote debug printk to KERN_DEBUG irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy irqdomain: Export irq_domain_disconnect_hierarchy() irqchip/gic-v3: Fix priority comparison when non-secure priorities are used irqchip/apple-aic: Fix irq_disable from within irq handlers pinctrl/rockchip: drop the gpio related codes gpio/rockchip: drop irq_gc_lock/irq_gc_unlock for irq set type gpio/rockchip: support next version gpio controller gpio/rockchip: use struct rockchip_gpio_regs for gpio controller gpio/rockchip: add driver for rockchip gpio dt-bindings: gpio: change items restriction of clock for rockchip,gpio-bank pinctrl/rockchip: add pinctrl device to gpio bank struct pinctrl/rockchip: separate struct rockchip_pin_bank to a head file pinctrl/rockchip: always enable clock for gpio controller genirq: Fix kernel doc indentation EDAC/altera: Convert to generic_handle_domain_irq() powerpc: Bulk conversion to generic_handle_domain_irq() nios2: Bulk conversion to generic_handle_domain_irq() ... commit e5e726f7bb9f711102edea7e5bd511835640e3b4 Merge: 08403e2174c4a a055fcc132d4c Author: Linus Torvalds Date: Mon Aug 30 14:26:36 2021 -0700 Merge tag 'locking-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking and atomics updates from Thomas Gleixner: "The regular pile: - A few improvements to the mutex code - Documentation updates for atomics to clarify the difference between cmpxchg() and try_cmpxchg() and to explain the forward progress expectations. - Simplification of the atomics fallback generator - The addition of arch_atomic_long*() variants and generic arch_*() bitops based on them. - Add the missing might_sleep() invocations to the down*() operations of semaphores. The PREEMPT_RT locking core: - Scheduler updates to support the state preserving mechanism for 'sleeping' spin- and rwlocks on RT. This mechanism is carefully preserving the state of the task when blocking on a 'sleeping' spin- or rwlock and takes regular wake-ups targeted at the same task into account. The preserved or updated (via a regular wakeup) state is restored when the lock has been acquired. - Restructuring of the rtmutex code so it can be utilized and extended for the RT specific lock variants. - Restructuring of the ww_mutex code to allow sharing of the ww_mutex specific functionality for rtmutex based ww_mutexes. - Header file disentangling to allow substitution of the regular lock implementations with the PREEMPT_RT variants without creating an unmaintainable #ifdef mess. - Shared base code for the PREEMPT_RT specific rw_semaphore and rwlock implementations. Contrary to the regular rw_semaphores and rwlocks the PREEMPT_RT implementation is writer unfair because it is infeasible to do priority inheritance on multiple readers. Experience over the years has shown that real-time workloads are not the typical workloads which are sensitive to writer starvation. The alternative solution would be to allow only a single reader which has been tried and discarded as it is a major bottleneck especially for mmap_sem. Aside of that many of the writer starvation critical usage sites have been converted to a writer side mutex/spinlock and RCU read side protections in the past decade so that the issue is less prominent than it used to be. - The actual rtmutex based lock substitutions for PREEMPT_RT enabled kernels which affect mutex, ww_mutex, rw_semaphore, spinlock_t and rwlock_t. The spin/rw_lock*() functions disable migration across the critical section to preserve the existing semantics vs per-CPU variables. - Rework of the futex REQUEUE_PI mechanism to handle the case of early wake-ups which interleave with a re-queue operation to prevent the situation that a task would be blocked on both the rtmutex associated to the outer futex and the rtmutex based hash bucket spinlock. While this situation cannot happen on !RT enabled kernels the changes make the underlying concurrency problems easier to understand in general. As a result the difference between !RT and RT kernels is reduced to the handling of waiting for the critical section. !RT kernels simply spin-wait as before and RT kernels utilize rcu_wait(). - The substitution of local_lock for PREEMPT_RT with a spinlock which protects the critical section while staying preemptible. The CPU locality is established by disabling migration. The underlying concepts of this code have been in use in PREEMPT_RT for way more than a decade. The code has been refactored several times over the years and this final incarnation has been optimized once again to be as non-intrusive as possible, i.e. the RT specific parts are mostly isolated. It has been extensively tested in the 5.14-rt patch series and it has been verified that !RT kernels are not affected by these changes" * tag 'locking-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (92 commits) locking/rtmutex: Return success on deadlock for ww_mutex waiters locking/rtmutex: Prevent spurious EDEADLK return caused by ww_mutexes locking/rtmutex: Dequeue waiter on ww_mutex deadlock locking/rtmutex: Dont dereference waiter lockless locking/semaphore: Add might_sleep() to down_*() family locking/ww_mutex: Initialize waiter.ww_ctx properly static_call: Update API documentation locking/local_lock: Add PREEMPT_RT support locking/spinlock/rt: Prepare for RT local_lock locking/rtmutex: Add adaptive spinwait mechanism locking/rtmutex: Implement equal priority lock stealing preempt: Adjust PREEMPT_LOCK_OFFSET for RT locking/rtmutex: Prevent lockdep false positive with PI futexes futex: Prevent requeue_pi() lock nesting issue on RT futex: Simplify handle_early_requeue_pi_wakeup() futex: Reorder sanity checks in futex_requeue() futex: Clarify comment in futex_requeue() futex: Restructure futex_requeue() futex: Correct the number of requeued waiters for PI futex: Remove bogus condition for requeue PI ... commit c611e4f24c79841f5637e62a8014f42da3dae5ae Author: Andreas Gerstmayr Date: Mon Aug 30 18:47:27 2021 +0200 perf flamegraph: flamegraph.py script improvements * display perf.data header * display PIDs of user stacks * added option to change color scheme * default to blue/green color scheme to improve accessibility * correctly identify kernel stacks when kernel-debuginfo is installed Signed-off-by: Andreas Gerstmayr Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210830164729.116049-1-agerstmayr@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit bb07d62e039b592f8006c9faedab48cd627e20c4 Author: Namhyung Kim Date: Fri Aug 27 16:32:12 2021 -0700 perf record: Fix wrong comm in system-wide mode with delay Stephane found that the name of the forked process in a system-wide mode is wrong when --delay option is used. For example, # perf record -a --delay=1000 noploop 3 The noploop process will run a busy loop for 3 second. And on an idle machine it should show up at the top in the perf report. It works well without the --delay option. But if I add the option, it showed 'perf' not 'noploop'. # perf report -s comm -q | head -3 52.94% perf 16.65% swapper 12.04% chrome It turned out that the dummy event didn't work at all and it missed COMM and MMAP events for the noploop process (and others too). We should enable the dummy event immediately in system-wide mode, as the enable-on-exec would work only for task events. With this change, # perf report -s comm -q | head -3 52.75% noploop 17.03% swapper 12.83% chrome Reported-by: Stephane Eranian Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210827233212.3121037-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1c02f6c9043e9a6f359278cc2f17b4283ac0bd67 Author: Namhyung Kim Date: Mon Aug 30 10:02:00 2021 -0700 perf stat: Do not allow --for-each-cgroup without cpu The cgroup mode should work with cpu events. Warn if --for-each-cgroup option is used with a task target like existing -G option. # perf stat --for-each-cgroup . sleep 1 both cgroup and no-aggregation modes only available in system-wide mode Usage: perf stat [] [] -G, --cgroup monitor event in cgroup name only -A, --no-aggr disable CPU count aggregation -a, --all-cpus system-wide collection from all CPUs --for-each-cgroup expand events for each cgroup Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210830170200.55652-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a32762b864f889cff884249c1273819bb79a05bb Author: Arnaldo Carvalho de Melo Date: Mon Aug 30 15:42:57 2021 -0300 perf bench evlist-open-close: Use PRIu64 with u64 to fix build on 32-bit architectures 73 9.00 ubuntu:18.04-x-powerpc : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) bench/evlist-open-close.c: In function 'bench_evlist_open_close__run': bench/evlist-open-close.c:173:12: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] pr_debug("Iteration %d took:\t%ldus\n", i, runtime_us); ^ bench/../util/debug.h:18:21: note: in definition of macro 'pr_fmt' #define pr_fmt(fmt) fmt ^~~ bench/evlist-open-close.c:173:3: note: in expansion of macro 'pr_debug' pr_debug("Iteration %d took:\t%ldus\n", i, runtime_us); ^~~~~~~~ cc1: all warnings being treated as errors /git/perf-5.14.0/tools/build/Makefile.build:139: recipe for target 'bench' failed Cc: Riccardo Mancini Fixes: 4241eabf59d5b7e9 ("perf bench: Add benchmark for evlist open/close operations") Link: http://lore.kernel.org/lkml/YS0oTcA9Zuy8Wjm9@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 08403e2174c4ac8b23922b5b7abe670129f8acb5 Merge: e4c3562e1bc79 7625eccd1852a Author: Linus Torvalds Date: Mon Aug 30 14:10:07 2021 -0700 Merge tag 'smp-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SMP core updates from Thomas Gleixner: - Replace get/put_online_cpus() in various places. The final removal will happen shortly before v5.15-rc1 when the rest of the patches have been merged. - Add debug code to help the analysis of CPU hotplug failures - A set of kernel doc updates * tag 'smp-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: mm: Replace deprecated CPU-hotplug functions. md/raid5: Replace deprecated CPU-hotplug functions. Documentation: Replace deprecated CPU-hotplug functions. smp: Fix all kernel-doc warnings cpu/hotplug: Add debug printks for hotplug callback failures cpu/hotplug: Use DEVICE_ATTR_*() macro cpu/hotplug: Eliminate all kernel-doc warnings cpu/hotplug: Fix kernel doc warnings for __cpuhp_setup_state_cpuslocked() cpu/hotplug: Fix comment typo smpboot: Replace deprecated CPU-hotplug functions. commit e4c3562e1bc79f912457cb062cd0c147026d4a1e Merge: 46f4945e2b39d 4bedcc28469a2 Author: Linus Torvalds Date: Mon Aug 30 14:06:31 2021 -0700 Merge tag 'core-debugobjects-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull debugobjects update from Thomas Gleixner: "A single commit for debugobjects to make them work on PREEMPT_RT by preventing object pool refill in atomic contexts" * tag 'core-debugobjects-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Make them PREEMPT_RT aware commit 46f4945e2b39dda4b832909434785483e028419d Merge: 4a2b88eb0265a 1be72c8e07867 Author: Linus Torvalds Date: Mon Aug 30 13:57:55 2021 -0700 Merge tag 'efi-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI updates from Ingo Molnar: "A handful of EFI changes for this cycle: - EFI CPER parsing improvements - Don't take the address of efi_guid_t internal fields" * tag 'efi-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: cper: check section header more appropriately efi: Don't use knowledge about efi_guid_t internals efi: cper: fix scnprintf() use in cper_mem_err_location() commit 4a2b88eb0265a9d550982b188abf20618a0c1a84 Merge: 5d3c0db4598c5 6a371bafe613b Author: Linus Torvalds Date: Mon Aug 30 13:50:20 2021 -0700 Merge tag 'perf-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 perf event updates from Ingo Molnar: - Add support for Intel Sapphire Rapids server CPU uncore events - Allow the AMD uncore driver to be built as a module - Misc cleanups and fixes * tag 'perf-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) perf/x86/amd/ibs: Add bitfield definitions in new header perf/amd/uncore: Allow the driver to be built as a module x86/cpu: Add get_llc_id() helper function perf/amd/uncore: Clean up header use, use Date: Mon Aug 30 13:42:10 2021 -0700 Merge tag 'sched-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: - The biggest change in this cycle is scheduler support for asymmetric scheduling affinity, to support the execution of legacy 32-bit tasks on AArch32 systems that also have 64-bit-only CPUs. Architectures can fill in this functionality by defining their own task_cpu_possible_mask(p). When this is done, the scheduler will make sure the task will only be scheduled on CPUs that support it. (The actual arm64 specific changes are not part of this tree.) For other architectures there will be no change in functionality. - Add cgroup SCHED_IDLE support - Increase node-distance flexibility & delay determining it until a CPU is brought online. (This enables platforms where node distance isn't final until the CPU is only.) - Deadline scheduler enhancements & fixes - Misc fixes & cleanups. * tag 'sched-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) eventfd: Make signal recursion protection a task bit sched/fair: Mark tg_is_idle() an inline in the !CONFIG_FAIR_GROUP_SCHED case sched: Introduce dl_task_check_affinity() to check proposed affinity sched: Allow task CPU affinity to be restricted on asymmetric systems sched: Split the guts of sched_setaffinity() into a helper function sched: Introduce task_struct::user_cpus_ptr to track requested affinity sched: Reject CPU affinity changes based on task_cpu_possible_mask() cpuset: Cleanup cpuset_cpus_allowed_fallback() use in select_fallback_rq() cpuset: Honour task_cpu_possible_mask() in guarantee_online_cpus() cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 sched: Introduce task_cpu_possible_mask() to limit fallback rq selection sched: Cgroup SCHED_IDLE support sched/topology: Skip updating masks for non-online nodes sched: Replace deprecated CPU-hotplug functions. sched: Skip priority checks with SCHED_FLAG_KEEP_PARAMS sched: Fix UCLAMP_FLAG_IDLE setting sched/deadline: Fix missing clock update in migrate_task_rq_dl() sched/fair: Avoid a second scan of target in select_idle_cpu sched/fair: Use prev instead of new target as recent_used_cpu sched: Don't report SCHED_FLAG_SUGOV in sched_getattr() ... commit 230bda0873a6ce4d089afde22aa5e487888ddebb Merge: 42f6e869a028a 5b3fd8aa5df02 Author: Linus Torvalds Date: Mon Aug 30 13:35:36 2021 -0700 Merge tag 'x86_cleanups_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Borislav Petkov: "The usual round of minor cleanups and fixes" * tag 'x86_cleanups_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kaslr: Have process_mem_region() return a boolean x86/power: Fix kernel-doc warnings in cpu.c x86/mce/inject: Replace deprecated CPU-hotplug functions. x86/microcode: Replace deprecated CPU-hotplug functions. x86/mtrr: Replace deprecated CPU-hotplug functions. x86/mmiotrace: Replace deprecated CPU-hotplug functions. commit 42f6e869a028abcf61422bc0d5de59d823db17b1 Merge: ced119b6308df 111136e69c9df Author: Linus Torvalds Date: Mon Aug 30 13:31:36 2021 -0700 Merge tag 'x86_cache_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 resource control updates from Borislav Petkov: "A first round of changes towards splitting the arch-specific bits from the filesystem bits of resctrl, the ultimate goal being to support ARM's equivalent technology MPAM, with the same fs interface (James Morse)" * tag 'x86_cache_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits) x86/resctrl: Make resctrl_arch_get_config() return its value x86/resctrl: Merge the CDP resources x86/resctrl: Expand resctrl_arch_update_domains()'s msr_param range x86/resctrl: Remove rdt_cdp_peer_get() x86/resctrl: Merge the ctrl_val arrays x86/resctrl: Calculate the index from the configuration type x86/resctrl: Apply offset correction when config is staged x86/resctrl: Make ctrlval arrays the same size x86/resctrl: Pass configuration type to resctrl_arch_get_config() x86/resctrl: Add a helper to read a closid's configuration x86/resctrl: Rename update_domains() to resctrl_arch_update_domains() x86/resctrl: Allow different CODE/DATA configurations to be staged x86/resctrl: Group staged configuration into a separate struct x86/resctrl: Move the schemata names into struct resctrl_schema x86/resctrl: Add a helper to read/set the CDP configuration x86/resctrl: Swizzle rdt_resource and resctrl_schema in pseudo_lock_region x86/resctrl: Pass the schema to resctrl filesystem functions x86/resctrl: Add resctrl_arch_get_num_closid() x86/resctrl: Store the effective num_closid in the schema x86/resctrl: Walk the resctrl schema list instead of an arch list ... commit ced119b6308df8ad2e4345e88f94d2bdcd6d6d4e Merge: 8f645b420822f 081551266d2fb Author: Linus Torvalds Date: Mon Aug 30 13:27:16 2021 -0700 Merge tag 'x86_build_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build updates from Borislav Petkov: - Remove cc-option checks which are old and already supported by the minimal compiler version the kernel uses and thus avoid the need to invoke the compiler unnecessarily. - Cleanups * tag 'x86_build_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/build: Move the install rule to arch/x86/Makefile x86/build: Remove the left-over bzlilo target x86/tools/relocs: Mark die() with the printf function attr format x86/build: Remove stale cc-option checks commit 8f645b420822f2061a41d022e8bd9a02fae5ba28 Merge: 05b5fdb2a8f7f 3bff147b187d5 Author: Linus Torvalds Date: Mon Aug 30 13:23:17 2021 -0700 Merge tag 'ras_core_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RAS update from Borislav Petkov: "A single RAS change for 5.15: - Do not start processing MCEs logged early because the decoding chain is not up yet - delay that processing until everything is ready" * tag 'ras_core_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Defer processing of early errors commit fca35b11e18a9d854cda6b18ed39a78011f4b082 Author: Sandipan Das Date: Fri Aug 27 16:49:05 2021 +0530 MAINTAINERS: Remove self from powerpc BPF JIT Stepping down as I haven't had a chance to look into the powerpc BPF JIT compilers for a while. Signed-off-by: Sandipan Das Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210827111905.396145-1-sandipan@linux.ibm.com commit 05b5fdb2a8f7f981b9b1aa77a6c4b810e19f01ab Merge: c7a5238ef68b9 cf4e6d52f5839 Author: Linus Torvalds Date: Mon Aug 30 13:17:29 2021 -0700 Merge tag 'edac_updates_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: "The usual EDAC stuff which managed to trickle in for 5.15: - Add new HBM2 (High Bandwidth Memory Gen 2) type and add support for it to the Intel SKx drivers - Print additional useful per-channel error information on i10nm, like on SKL - Don't load the AMD EDAC decoder in virtual images - The usual round of fixes and cleanups" * tag 'edac_updates_for_v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/i10nm: Retrieve and print retry_rd_err_log registers EDAC/i10nm: Fix NVDIMM detection EDAC/skx_common: Set the memory type correctly for HBM memory EDAC/altera: Skip defining unused structures for specific configs EDAC/mce_amd: Do not load edac_mce_amd module on guests EDAC/mc: Add new HBM2 memory type EDAC/amd64: Use DEVICE_ATTR helper macros commit c7a5238ef68b98130fe36716bb3fa44502f56001 Merge: adc5ea221089e 927932240aa17 Author: Linus Torvalds Date: Mon Aug 30 13:07:15 2021 -0700 Merge tag 's390-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Heiko Carstens: - Improve ftrace code patching so that stop_machine is not required anymore. This requires a small common code patch acked by Steven Rostedt: https://lore.kernel.org/linux-s390/20210730220741.4da6fdf6@oasis.local.home/ - Enable KCSAN for s390. This comes with a small common code change to fix a compile warning. Acked by Marco Elver: https://lore.kernel.org/r/20210729142811.1309391-1-hca@linux.ibm.com - Add KFENCE support for s390. This also comes with a minimal x86 patch from Marco Elver who said also this can be carried via the s390 tree: https://lore.kernel.org/linux-s390/YQJdarx6XSUQ1tFZ@elver.google.com/ - More changes to prepare the decompressor for relocation. - Enable DAT also for CPU restart path. - Final set of register asm removal patches; leaving only three locations where needed and sane. - Add NNPA, Vector-Packed-Decimal-Enhancement Facility 2, PCI MIO support to hwcaps flags. - Cleanup hwcaps implementation. - Add new instructions to in-kernel disassembler. - Various QDIO cleanups. - Add SCLP debug feature. - Various other cleanups and improvements all over the place. * tag 's390-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (105 commits) s390: remove SCHED_CORE from defconfigs s390/smp: do not use nodat_stack for secondary CPU start s390/smp: enable DAT before CPU restart callback is called s390: update defconfigs s390/ap: fix state machine hang after failure to enable irq KVM: s390: generate kvm hypercall functions s390/sclp: add tracing of SCLP interactions s390/debug: add early tracing support s390/debug: fix debug area life cycle s390/debug: keep debug data on resize s390/diag: make restart_part2 a local label s390/mm,pageattr: fix walk_pte_level() early exit s390: fix typo in linker script s390: remove do_signal() prototype and do_notify_resume() function s390/crypto: fix all kernel-doc warnings in vfio_ap_ops.c s390/pci: improve DMA translation init and exit s390/pci: simplify CLP List PCI handling s390/pci: handle FH state mismatch only on disable s390/pci: fix misleading rc in clp_set_pci_fn() s390/boot: factor out offset_vmlinux_info() function ... commit adc5ea221089e8eff8207d6e9c98751e0347b0de Merge: 44a7d4441181d 87d93029fe83e Author: Linus Torvalds Date: Mon Aug 30 13:02:19 2021 -0700 Merge tag 'm68k-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - miscellaneous fixes - defconfig updates * tag 'm68k-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Fix asm register constraints for atomic ops m68k: Fix invalid RMW_INSNS on CPUs that lack CAS m68k: defconfig: Update defconfigs for v5.14-rc1 m68k: emu: Fix invalid free in nfeth_cleanup() commit 44a7d4441181d0f2d622dc9bb512d7f5ca13f768 Merge: 4ca4256453eff 6ae51ffe5e768 Author: Linus Torvalds Date: Mon Aug 30 12:57:10 2021 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "Algorithms: - Add AES-NI/AVX/x86_64 implementation of SM4. Drivers: - Add Arm SMCCC TRNG based driver" [ And obviously a lot of random fixes and updates - Linus] * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (84 commits) crypto: sha512 - remove imaginary and mystifying clearing of variables crypto: aesni - xts_crypt() return if walk.nbytes is 0 padata: Remove repeated verbose license text crypto: ccp - Add support for new CCP/PSP device ID crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation crypto: x86/sm4 - export reusable AESNI/AVX functions crypto: rmd320 - remove rmd320 in Makefile crypto: skcipher - in_irq() cleanup crypto: hisilicon - check _PS0 and _PR0 method crypto: hisilicon - change parameter passing of debugfs function crypto: hisilicon - support runtime PM for accelerator device crypto: hisilicon - add runtime PM ops crypto: hisilicon - using 'debugfs_create_file' instead of 'debugfs_create_regset32' crypto: tcrypt - add GCM/CCM mode test for SM4 algorithm crypto: testmgr - Add GCM/CCM mode test of SM4 algorithm crypto: tcrypt - Fix missing return value check crypto: hisilicon/sec - modify the hardware endian configuration crypto: hisilicon/sec - fix the abnormal exiting process crypto: qat - store vf.compatible flag crypto: qat - do not export adf_iov_putmsg() ... commit 4ca4256453effb885c1688633676682529593f82 Merge: 6f01c935d96cd b770efc4608d2 Author: Linus Torvalds Date: Mon Aug 30 12:48:01 2021 -0700 Merge branch 'core-rcu.2021.08.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU updates from Paul McKenney: "RCU changes for this cycle were: - Documentation updates - Miscellaneous fixes - Offloaded-callbacks updates - Updates to the nolibc library - Tasks-RCU updates - In-kernel torture-test updates - Torture-test scripting, perhaps most notably the pinning of torture-test guest OSes so as to force differences in memory latency. For example, in a two-socket system, a four-CPU guest OS will have one pair of its CPUs pinned to threads in a single core on one socket and the other pair pinned to threads in a single core on the other socket. This approach proved able to force race conditions that earlier testing missed. Some of these race conditions are still being tracked down" * 'core-rcu.2021.08.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (61 commits) torture: Replace deprecated CPU-hotplug functions. rcu: Replace deprecated CPU-hotplug functions rcu: Print human-readable message for schedule() in RCU reader rcu: Explain why rcu_all_qs() is a stub in preemptible TREE RCU rcu: Use per_cpu_ptr to get the pointer of per_cpu variable rcu: Remove useless "ret" update in rcu_gp_fqs_loop() rcu: Mark accesses in tree_stall.h rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack rcu: Mark lockless ->qsmask read in rcu_check_boost_fail() srcutiny: Mark read-side data races rcu: Start timing stall repetitions after warning complete rcu: Do not disable GP stall detection in rcu_cpu_stall_reset() rcu/tree: Handle VM stoppage in stall detection rculist: Unify documentation about missing list_empty_rcu() rcu: Mark accesses to ->rcu_read_lock_nesting rcu: Weaken ->dynticks accesses and updates rcu: Remove special bit at the bottom of the ->dynticks counter rcu: Fix stall-warning deadlock due to non-release of rcu_node ->lock rcu: Fix to include first blocked task in stall warning torture: Make kvm-test-1-run-qemu.sh check for reboot loops ... commit 6f01c935d96cd4eb8bbbc5249bd9a754b6939e0a Merge: 451819aa5ad0a 2949e8427af3b Author: Linus Torvalds Date: Mon Aug 30 12:38:13 2021 -0700 Merge tag 'locks-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux Pull file locking updates from Jeff Layton: "This starts with a couple of fixes for potential deadlocks in the fowner/fasync handling. The next patch removes the old mandatory locking code from the kernel altogether. The last patch cleans up rw_verify_area a bit more after the mandatory locking removal" * tag 'locks-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: fs: clean up after mandatory file locking support removal fs: remove mandatory file locking support fcntl: fix potential deadlock for &fasync_struct.fa_lock fcntl: fix potential deadlocks for &fown_struct.lock commit f5d8e16488056d9ad48d2561ef4eaf7fdd11c162 Author: Colin Ian King Date: Fri Aug 27 19:59:14 2021 +0100 drm/amdgpu/swsmu: fix spelling mistake "minimun" -> "minimum" There are three identical spelling mistakes in dev_err messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit b3dc549986eb7b38eba4a144e979dc93f386751f Author: Koba Ko Date: Mon Aug 30 10:02:00 2021 +0800 drm/amdgpu: Disable PCIE_DPM on Intel RKL Platform Due to high latency in PCIE clock switching on RKL platforms, switching the PCIE clock dynamically at runtime can lead to HDMI/DP audio problems. On newer asics this is handled in the SMU firmware. For SMU7-based asics, disable PCIE clock switching to avoid the issue. AMD provide a parameter to disable PICE_DPM. modprobe amdgpu ppfeaturemask=0xfff7bffb It's better to contorl PCIE_DPM in amd gpu driver, switch PCI_DPM by determining intel RKL platform for SMU7-based asics. Fixes: 1a31474cdb48 ("drm/amd/pm: workaround for audio noise issue") Ref: https://lists.freedesktop.org/archives/amd-gfx/2021-August/067413.html Signed-off-by: Koba Ko Signed-off-by: Alex Deucher commit 50c6dedeb1aac21c445ee4193f7660503873f395 Author: Lang Yu Date: Fri Aug 27 11:38:55 2021 +0800 drm/amdgpu: show both cmd id and name when psp cmd failed To cover the corner case that people want to know the ID of an UNKNOWN CMD. Suggested-by: John Clements Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 3ca001aff0878546494d7f403334c8d987924977 Author: Aaron Liu Date: Mon Aug 23 12:26:50 2021 +0800 drm/amd/display: setup system context for APUs Scatter/gather is APU feature starting from carrizo. adev->apu_flags is not used for all APUs. adev->flags & AMD_IS_APU can be used for all APUs. Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c5d3c9a093d353e7f38183a70df425f92e3c329d Author: Nicholas Kazlauskas Date: Thu Jan 14 14:49:27 2021 -0500 drm/amdgpu: Enable S/G for Yellow Carp Missing code for Yellow Carp to enable scatter gather - follows how DCN21 support was added. Tested that 8k framebuffer allocation and display can now succeed after applying the patch. v2: Add hookup in DM Reviewed-by: Aaron Liu Acked-by: Huang Rui Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 4a9bd6db19be735f5f9d883ed15fb2b70ba36187 Author: Kees Cook Date: Thu Aug 26 20:16:47 2021 -0700 drm/amd/pm: And destination bounds checking to struct copy In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. The "Board Parameters" members of the structs: struct atom_smc_dpm_info_v4_5 struct atom_smc_dpm_info_v4_6 struct atom_smc_dpm_info_v4_7 struct atom_smc_dpm_info_v4_10 are written to the corresponding members of the corresponding PPTable_t variables, but they lack destination size bounds checking, which means the compiler cannot verify at compile time that this is an intended and safe memcpy(). Since the header files are effectively immutable[1] and a struct_group() cannot be used, nor a common struct referenced by both sides of the memcpy() arguments, add a new helper, amdgpu_memcpy_trailing(), to perform the bounds checking at compile time. Replace the open-coded memcpy()s with amdgpu_memcpy_trailing() which includes enough context for the bounds checking. "objdump -d" shows no object code changes. [1] https://lore.kernel.org/lkml/e56aad3c-a06f-da07-f491-a894a570d78f@amd.com Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: Feifei Xu Cc: Likun Gao Cc: Jiawei Gu Cc: Evan Quan Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Reviewed-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Kees Cook Signed-off-by: Alex Deucher commit 602e338ffed31b1f15c706ea109366e3bae6e39b Author: Evan Quan Date: Tue Aug 24 11:32:44 2021 +0800 drm/amdgpu: reenable BACO support for 699F:C7 polaris12 SKU This reverts the commit below: "drm/amdgpu: disable BACO support for 699F:C7 polaris12 SKU temporarily". As the S3 hang issue has been fixed by another commit: "drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend". Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 64261a0d0600ab335677073c54b1989565ceddad Author: YuBiao Wang Date: Fri Aug 27 14:48:51 2021 +0800 drm/amd/amdgpu: Add ready_to_reset resp for vega10 Send response to host after received the flr notification from host. Port NV change to vega10. Signed-off-by: YuBiao Wang Reviewed-by: Jingwen Chen Signed-off-by: Alex Deucher commit 8f0c93f454bd7ab04eaec1d3c436c4c7c2378f07 Author: Alex Deucher Date: Thu Aug 26 15:43:18 2021 -0400 drm/amdgpu: add some additional RDNA2 PCI IDs New PCI IDs. Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 6333a495f53347067cc25012043f4876b249f8e7 Author: Yifan Zhang Date: Thu Aug 26 17:58:21 2021 +0800 drm/amdgpu: correct comments in memory type managers The parameters were renamed. Signed-off-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit cc947bf91bad65d4f0ef85a3cd7272a1cf26f53d Author: Luben Tuikov Date: Wed Aug 25 13:50:20 2021 -0400 drm/amdgpu: Process any VBIOS RAS EEPROM address We can now process any RAS EEPROM address from VBIOS. Generalize so as to compute the top three bits of the 19-bit EEPROM address, from any byte returned as the "i2c address" from VBIOS. Cc: John Clements Cc: Hawking Zhang Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a6a355a22f7a0efa6a11bc90b5161f394d51fe95 Author: Luben Tuikov Date: Tue Aug 24 11:01:32 2021 -0400 drm/amdgpu: Fixes to returning VBIOS RAS EEPROM address 1) Generalize the function--if the user didn't set i2c_address, still return true/false to indicate whether VBIOS contains the RAS EEPROM address. This function shouldn't evaluate whether the user set the i2c_address pointer or not. 2) Don't touch the caller's i2c_address, unless you have to--this function shouldn't have side effects. 3) Correctly set the function comment as a kernel-doc comment. Cc: John Clements Cc: Hawking Zhang Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fbd2a6003a259fe12750ceb5efc47432c3cc7ce4 Author: Jing Yangyang Date: Mon Aug 23 22:52:32 2021 -0700 drm:dcn31: fix boolreturn.cocci warnings ./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:112:9-10:WARNING: return of 0/1 in function 'dcn31_is_panel_backlight_on' with return type bool ./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:122:9-10:WARNING: return of 0/1 in function 'dcn31_is_panel_powered_on' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Signed-off-by: Alex Deucher commit 451819aa5ad0a22b23f0eb178816dc72b73ab903 Merge: 4520dcbe0df41 f985911b7bc75 Author: Linus Torvalds Date: Mon Aug 30 11:53:24 2021 -0700 Merge tag 'tpmdd-next-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm driver updates from Jarkko Sakkinen: "The highlights are: - Support for signing LKM's with ECDSA keys - An integer overflow bug fix in pkey" * tag 'tpmdd-next-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: crypto: public_key: fix overflow during implicit conversion tpm: ibmvtpm: Avoid error message when process gets signal while waiting certs: Add support for using elliptic curve keys for signing modules certs: Trigger creation of RSA module signing key if it's not an RSA key char: tpm: cr50_i2c: convert to new probe interface char: tpm: Kconfig: remove bad i2c cr50 select commit 4520dcbe0df41385288f24e61f322ee97063fa03 Merge: 0da9bc6d2fc3f c9398455b046f Author: Linus Torvalds Date: Mon Aug 30 11:47:32 2021 -0700 Merge tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Battery/charger related: - cros-peripheral-charger: new driver - mt6360-charger: new driver - simple-battery: support reading chemistry info - max17042-battery: add max77849 support - sbs-battery: add time_to_empty_now support - smb347-charger: prepare USB OTG support - rn5t618: add voltage_now support - axp288: cleanup & optimizations - max17042_battery: cleanups - ab8500: cleanups - misc minor cleanups and DT binding fixes reset related: - tps65086-restart: new driver - linkstation-poweroff: support NETGEAR ReadyNAS Duo v2" * tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (51 commits) power: supply: core: Fix parsing of battery chemistry/technology power: supply: max17042_battery: log SOC threshold using debug log level power: supply: max17042_battery: more robust chip type checks power: supply: max17042_battery: fix typo in MAx17042_TOFF power: supply: max17042_battery: clean up MAX17055_V_empty power: supply: smb347-charger: Implement USB VBUS regulator power: supply: smb347-charger: Add missing pin control activation power: supply: smb347-charger: Utilize generic regmap caching power: supply: smb347-charger: Make smb347_set_writable() IRQ-safe dt-bindings: power: supply: smb347-charger: Document USB VBUS regulator power: reset: Add TPS65086 restart driver dt-bindings: power: supply: max17042: describe interrupt power: supply: max17042: remove duplicated STATUS bit defines power: supply: max17042: handle fails of reading status register power: supply: core: Parse battery chemistry/technology dt-bindings: power: Extend battery bindings with chemistry power: reset: linkstation-poweroff: add new device power: reset: linkstation-poweroff: prepare for new devices power: supply: bq24735: reorganize ChargeOption command macros power: supply: rn5t618: Add voltage_now property ... commit 0da9bc6d2fc3f98095d69f34c17f7d5730bbcc6c Merge: d46e0d335497d 6e9c846aa0c53 Author: Linus Torvalds Date: Mon Aug 30 11:41:46 2021 -0700 Merge tag 'spi-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "A quiet release for SPI, some fixes and a couple of new drivers plus one small refactoring: - Move the chip select timing configuration from the controller to the device to allow a bit more flexibility - New drivers for Rockchip SFC and Spreadtrum ADI" * tag 'spi-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (47 commits) spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible spi: add sprd ADI for sc9863 and ums512 spi: Convert sprd ADI bindings to yaml spi: sprd: Add ADI r3 support spi: sprd: Fix the wrong WDG_LOAD_VAL spi: davinci: invoke chipselect callback spi: sprd: fill offset only to RD_CMD register for reading from slave device spi: sprd: Make sure offset not equal to slave address size spi: sprd: Pass offset instead of physical address to adi_read/_write() spi: rockchip-sfc: Fix assigned but never used return error codes spi: rockchip-sfc: Remove redundant IO operations spi: stm32: fix excluded_middle.cocci warnings spi: coldfire-qspi: Use clk_disable_unprepare in the remove function spi: tegra20-slink: remove spi_master_put() in tegra_slink_remove() spi: rockchip-sfc: add rockchip serial flash controller spi: rockchip-sfc: Bindings for Rockchip serial flash controller spi: orion: Prevent incorrect chip select behaviour spi: mxic: add missing braces spi: spi-pic32: Fix issue with uninitialized dma_slave_config spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config ... commit d46e0d335497d89e36a8dab3ce5b605d7088c67a Merge: 4aed6ee53fcc0 7aa6d700b089d Author: Linus Torvalds Date: Mon Aug 30 11:37:15 2021 -0700 Merge tag 'regulator-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "A very quiet releases, some fixes and cleanups but not really that many of them. There were a couple of new driver specific pieces: - Support for controlling the over/under voltage protection on BD718xx devices - New drivers for Richtek RTQ2134, and RTQ6752" * tag 'regulator-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (37 commits) regulator: vctrl: Avoid lockdep warning in enable/disable ops regulator: vctrl: Use locked regulator_get_voltage in probe path regulator: Documentation fix for regulator error notification helper regulator: Minor regulator documentation fixes. regulator: sy7636a: Use the regmap directly regulator: sy7636a: Store the epd-pwr-good GPIO locally regulator: sy7636a: Use the parent driver data regulator: sy7636a: Remove the poll_enable_time regulator: sy8827n: Enable REGCACHE_FLAT regulator: sy8824x: Enable REGCACHE_FLAT regulator: rtq2134: Fix coding style regulator: hi6421v600: rename voltage range arrays regulator: hi6421v600: use lowercase for ldo regulator: fixed: use dev_err_probe for register regulator: rtq2134: Add support for Richtek RTQ2134 SubPMIC regulator: rtq2134: Add binding document for Richtek RTQ2134 SubPMIC regulator: Fix a couple of spelling mistakes in Kconfig regulator: rtq6752: fix reg reset behavior regulator: da9063: Add support for full-current mode. regulator: rt6245: make a const array func_base static, makes object smaller ... commit 4aed6ee53fcc012ea599f1be6b2c8d76cb7f7354 Merge: aa99f3c2b9c79 ca5537c9be13c Author: Linus Torvalds Date: Mon Aug 30 11:33:34 2021 -0700 Merge tag 'regmap-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "A few small fixes for regmaps this time, plus support for allowing drivers to select raw spinlocks for the locks in order to allow usage in interrutpt controllers" * tag 'regmap-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: teach regmap to use raw spinlocks if requested in the config regmap: allow const array for {devm_,}regmap_field_bulk_alloc reg_fields regmap: Prefer unsigned int to bare use of unsigned regmap: fix the offset of register error log commit 2cbd40709a9d44b8b0d418589de12efad6f71c15 Merge: 2fec5b82f9312 437b38c51162f 2bc4eb943b1b2 1a20d409c8742 Author: Rafael J. Wysocki Date: Mon Aug 30 20:03:28 2021 +0200 Merge branches 'acpi-osl', 'acpi-power' and 'acpi-misc' * acpi-osl: ACPI: Add memory semantics to acpi_os_map_memory() * acpi-power: ACPI: power: Drop name from struct acpi_power_resource ACPI: power: Use acpi_handle_debug() to print debug messages * acpi-misc: ACPI: button: Add DMI quirk for Lenovo Yoga 9 (14INTL5) commit 2fec5b82f93127629c67285ae7f6bd5d8e37a8e5 Merge: 7c85154643df0 7a6226db072be 95ac706744de7 97e03410bc5f6 b25d5a1cd1989 Author: Rafael J. Wysocki Date: Mon Aug 30 20:03:05 2021 +0200 Merge branches 'acpi-dptf', 'acpi-processor', 'acpi-tables' and 'acpi-platform' * acpi-dptf: ACPI: DPTF: Add new PCH FIVR methods * acpi-processor: ACPI: processor: Replace deprecated CPU-hotplug functions * acpi-tables: ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved ACPI: SPCR: Add support for the new 16550-compatible Serial Port Subtype * acpi-platform: ACPI: platform-profile: call sysfs_notify() from platform_profile_store() commit d20d30ebb199354729c64c86945ed25c66ff4991 Author: Kees Cook Date: Fri Aug 27 17:02:55 2021 -0700 cgroup: Avoid compiler warnings with no subsystems As done before in commit cb4a31675270 ("cgroup: use bitmask to filter for_each_subsys"), avoid compiler warnings for the pathological case of having no subsystems (i.e. CGROUP_SUBSYS_COUNT == 0). This condition is hit for the arm multi_v7_defconfig config under -Wzero-length-bounds: In file included from ./arch/arm/include/generated/asm/rwonce.h:1, from include/linux/compiler.h:264, from include/uapi/linux/swab.h:6, from include/linux/swab.h:5, from arch/arm/include/asm/opcodes.h:86, from arch/arm/include/asm/bug.h:7, from include/linux/bug.h:5, from include/linux/thread_info.h:13, from include/asm-generic/current.h:5, from ./arch/arm/include/generated/asm/current.h:1, from include/linux/sched.h:12, from include/linux/cgroup.h:12, from kernel/cgroup/cgroup-internal.h:5, from kernel/cgroup/cgroup.c:31: kernel/cgroup/cgroup.c: In function 'of_css': kernel/cgroup/cgroup.c:651:42: warning: array subscript '' is outside the bounds of an interior zero-length array 'struct cgroup_subsys_state *[0]' [-Wzero-length-bounds] 651 | return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); Reported-by: Stephen Rothwell Cc: Tejun Heo Cc: Zefan Li Cc: Johannes Weiner Cc: cgroups@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Tejun Heo commit 7c85154643df00f19db43c49dfef23b8fa93f0c9 Merge: b46a8eda83b4d b1121e2a182dc b2ebd9dd52670 45c16fe1d1283 fd080a01ecfc9 Author: Rafael J. Wysocki Date: Mon Aug 30 19:30:37 2021 +0200 Merge branches 'acpi-numa', 'acpi-glue', 'acpi-config' and 'acpi-pmic' * acpi-numa: ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA * acpi-glue: driver core: Split device_platform_notify() software nodes: Split software_node_notify() ACPI: glue: Eliminate acpi_platform_notify() ACPI: bus: Rename functions to avoid name collision ACPI: glue: Change return type of two functions to void ACPI: glue: Rearrange acpi_device_notify() * acpi-config: ACPI: configfs: Make get_header() to return error pointer ACPI: configfs: Use sysfs_emit() in "show" functions * acpi-pmic: ACPI / PMIC: XPower: optimize MIPI PMIQ sequence I2C-bus accesses ACPI / PMIC: XPower: optimize I2C-bus accesses commit b46a8eda83b4d8cf6fff0971bc17baba48535582 Merge: 294c34e704e78 696e0c937d07a Author: Rafael J. Wysocki Date: Mon Aug 30 19:27:13 2021 +0200 Merge branch 'acpica' * acpica: ACPICA: Update version to 20210730 ACPICA: Add method name "_DIS" For use with aslmethod.c ACPICA: iASL: Fix for WPBT table with no command-line arguments ACPICA: Headers: Add new DBG2 Serial Port Subtypes ACPICA: Macros should not use a trailing semicolon ACPICA: Fix an if statement (add parens) ACPICA: iASL: Add support for the AEST table (data compiler) commit fe583359ddf0d509275b87b635fa8b2e3794321e Merge: 88e9c0bf1ca38 0e00392a895c9 dbcfa7156f48e bc0d0b1dfe271 1cc5b9a411e43 Author: Rafael J. Wysocki Date: Mon Aug 30 19:25:42 2021 +0200 Merge branches 'pm-pci', 'pm-sleep', 'pm-domains' and 'powercap' * pm-pci: PCI: PM: Enable PME if it can be signaled from D3cold PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently PCI: Use pci_update_current_state() in pci_enable_device_flags() * pm-sleep: PM: sleep: unmark 'state' functions as kernel-doc PM: sleep: check RTC features instead of ops in suspend_test PM: sleep: s2idle: Replace deprecated CPU-hotplug functions * pm-domains: PM: domains: Fix domain attach for CONFIG_PM_OPP=n arm64: dts: sc7180: Add required-opps for i2c PM: domains: Add support for 'required-opps' to set default perf state opp: Don't print an error if required-opps is missing * powercap: powercap: Add Power Limit4 support for Alder Lake SoC powercap: intel_rapl: Replace deprecated CPU-hotplug functions commit 88e9c0bf1ca38b11b48b97b5821a7ac99d42e825 Merge: 7ee5fd12e8cac d0e936adbd225 15538a20579fa 7fcc17d0cb129 Author: Rafael J. Wysocki Date: Mon Aug 30 19:25:13 2021 +0200 Merge branches 'pm-cpufreq', 'pm-cpu' and 'pm-em' * pm-cpufreq: cpufreq: intel_pstate: Process HWP Guaranteed change notification thermal: intel: Allow processing of HWP interrupt cpufreq: schedutil: Use kobject release() method to free sugov_tunables cpufreq: Replace deprecated CPU-hotplug functions * pm-cpu: notifier: Remove atomic_notifier_call_chain_robust() PM: cpu: Make notifier chain use a raw_spinlock_t * pm-em: PM: EM: Increase energy calculation precision commit aa99f3c2b9c797d8fee28c674a2cbb5adb2ce2ef Merge: a1ca8e7147d07 7882c55ef64a8 Author: Linus Torvalds Date: Mon Aug 30 10:24:50 2021 -0700 Merge tag 'hole_punch_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fs hole punching vs cache filling race fixes from Jan Kara: "Fix races leading to possible data corruption or stale data exposure in multiple filesystems when hole punching races with operations such as readahead. This is the series I was sending for the last merge window but with your objection fixed - now filemap_fault() has been modified to take invalidate_lock only when we need to create new page in the page cache and / or bring it uptodate" * tag 'hole_punch_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: filesystems/locking: fix Malformed table warning cifs: Fix race between hole punch and page fault ceph: Fix race between hole punch and page fault fuse: Convert to using invalidate_lock f2fs: Convert to using invalidate_lock zonefs: Convert to using invalidate_lock xfs: Convert double locking of MMAPLOCK to use VFS helpers xfs: Convert to use invalidate_lock xfs: Refactor xfs_isilocked() ext2: Convert to using invalidate_lock ext4: Convert to use mapping->invalidate_lock mm: Add functions to lock invalidate_lock for two mappings mm: Protect operations adding pages to page cache with invalidate_lock documentation: Sync file_operations members with reality mm: Fix comments mentioning i_mutex commit 8cfb9015280d49f9d92d5b0f88cedf5f0856c0fd Author: Trond Myklebust Date: Fri Aug 27 14:00:56 2021 -0400 NFS: Always provide aligned buffers to the RPC read layers Instead of messing around with XDR padding in the RDMA layer, we should just give the RPC layer an aligned buffer. Try to avoid creating extra RPC calls by aligning to the smaller value of ALIGN(len, rsize) and PAGE_SIZE. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit bc0d0b1dfe27158c06c3a891953174d06b96a419 Merge: 3c5a272202c28 656164181eece Author: Rafael J. Wysocki Date: Mon Aug 30 19:20:32 2021 +0200 Merge back new PM domains material for v5.15. commit a1ca8e7147d07cb8649c618bc9902a9a7e6444e1 Merge: 63b0c403394d4 58bc6d1be2f3b Author: Linus Torvalds Date: Mon Aug 30 10:18:07 2021 -0700 Merge tag 'fs_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull UDF and isofs updates from Jan Kara: "Several smaller fixes and cleanups in UDF and isofs" * tag 'fs_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf_get_extendedattr() had no boundary checks. isofs: joliet: Fix iocharset=utf8 mount option udf: Fix iocharset=utf8 mount option udf: Get rid of 0-length arrays in struct fileIdentDesc udf: Get rid of 0-length arrays udf: Remove unused declaration udf: Check LVID earlier commit 63b0c403394d4e2644751d090db8a5da80272e50 Merge: 3513431926f9b 9acb9c48b9408 Author: Linus Torvalds Date: Mon Aug 30 10:13:02 2021 -0700 Merge tag 'fiemap_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull FIEMAP cleanups from Jan Kara: "FIEMAP cleanups from Christoph transitioning all remaining filesystems supporting FIEMAP (ext2, hpfs) to iomap API and removing the old helper" * tag 'fiemap_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fs: remove generic_block_fiemap hpfs: use iomap_fiemap to implement ->fiemap ext2: use iomap_fiemap to implement ->fiemap ext2: make ext2_iomap_ops available unconditionally commit f7db8dd6981e0d94e5e35b45c1d288c94357de52 Author: Chao Yu Date: Mon Aug 30 08:35:33 2021 +0800 f2fs: enable realtime discard iff device supports discard Let's only enable realtime discard if and only if device supports discard functionality. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit dddd3d65293a52c2c3850c19b1e5115712e534d8 Author: Jaegeuk Kim Date: Thu Aug 19 14:00:57 2021 -0700 f2fs: guarantee to write dirty data when enabling checkpoint back We must flush all the dirty data when enabling checkpoint back. Let's guarantee that first by adding a retry logic on sync_inodes_sb(). In addition to that, this patch adds to flush data in fsync when checkpoint is disabled, which can mitigate the sync_inodes_sb() failures in advance. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c8dc3047c48540183744f959412d44b08c5435e1 Author: Chao Yu Date: Wed Aug 25 19:34:19 2021 +0800 f2fs: fix to unmap pages from userspace process in punch_hole() We need to unmap pages from userspace process before removing pagecache in punch_hole() like we did in f2fs_setattr(). Similar change: commit 5e44f8c374dc ("ext4: hole-punch use truncate_pagecache_range") Fixes: fbfa2cc58d53 ("f2fs: add file operations") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit adf9ea89c719c1d23794e363f631e376b3ff8cbc Author: Chao Yu Date: Thu Aug 26 10:03:15 2021 +0800 f2fs: fix unexpected ENOENT comes from f2fs_map_blocks() In below path, it will return ENOENT if filesystem is shutdown: - f2fs_map_blocks - f2fs_get_dnode_of_data - f2fs_get_node_page - __get_node_page - read_node_page - is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN) return -ENOENT - force return value from ENOENT to 0 It should be fine for read case, since it indicates a hole condition, and caller could use .m_next_pgofs to skip the hole and continue the lookup. However it may cause confusing for write case, since leaving a hole there, and said nothing was wrong doesn't help. There is at least one case from dax_iomap_actor() will complain that, so fix this in prior to supporting dax in f2fs. xfstest generic/388 reports below warning: ubuntu godown: xfstests-induced forced shutdown of /mnt/scratch_f2fs: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 485833 at fs/dax.c:1127 dax_iomap_actor+0x339/0x370 Call Trace: iomap_apply+0x1c4/0x7b0 ? dax_iomap_rw+0x1c0/0x1c0 dax_iomap_rw+0xad/0x1c0 ? dax_iomap_rw+0x1c0/0x1c0 f2fs_file_write_iter+0x5ab/0x970 [f2fs] do_iter_readv_writev+0x273/0x2e0 do_iter_write+0xab/0x1f0 vfs_iter_write+0x21/0x40 iter_file_splice_write+0x287/0x540 do_splice+0x37c/0xa60 __x64_sys_splice+0x15f/0x3a0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae ubuntu godown: xfstests-induced forced shutdown of /mnt/scratch_f2fs: ------------[ cut here ]------------ RIP: 0010:dax_iomap_pte_fault.isra.0+0x72e/0x14a0 Call Trace: dax_iomap_fault+0x44/0x70 f2fs_dax_huge_fault+0x155/0x400 [f2fs] f2fs_dax_fault+0x18/0x30 [f2fs] __do_fault+0x4e/0x120 do_fault+0x3cf/0x7a0 __handle_mm_fault+0xa8c/0xf20 ? find_held_lock+0x39/0xd0 handle_mm_fault+0x1b6/0x480 do_user_addr_fault+0x320/0xcd0 ? rcu_read_lock_sched_held+0x67/0xc0 exc_page_fault+0x77/0x3f0 ? asm_exc_page_fault+0x8/0x30 asm_exc_page_fault+0x1e/0x30 Fixes: 83a3bfdb5a8a ("f2fs: indicate shutdown f2fs to allow unmount successfully") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ad126ebddecbf696e0cf214ff56c7b170fa9f0f7 Author: Chao Yu Date: Tue Aug 24 08:12:08 2021 +0800 f2fs: fix to account missing .skipped_gc_rwsem There is a missing place we forgot to account .skipped_gc_rwsem, fix it. Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d75da8c8a4c5c761936e4a51403f5f21e3aba935 Author: Chao Yu Date: Tue Aug 24 08:11:38 2021 +0800 f2fs: adjust unlock order for cleanup This patch adjusts unlock order of .i_mmap_sem and .i_gc_rwsem for cleanup. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4d67490498acb4ffcef5ba7bc44990d46e66a44c Author: Fengnan Chang Date: Thu Aug 19 16:02:37 2021 +0800 f2fs: Don't create discard thread when device doesn't support realtime discard Don't create discard thread when device doesn't support realtime discard or user specifies nodiscard mount option. Signed-off-by: Fengnan Chang Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3513431926f9bfe3f4fcb06a39d9ec59b0470311 Merge: 2287a51ba8223 e43de7f0862b8 Author: Linus Torvalds Date: Mon Aug 30 10:04:31 2021 -0700 Merge tag 'fsnotify_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "fsnotify speedups when notification actually isn't used and support for identifying processes which caused fanotify events through pidfd instead of normal pid" * tag 'fsnotify_for_v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: optimize the case of no marks of any type fsnotify: count all objects with attached connectors fsnotify: count s_fsnotify_inode_refs for attached connectors fsnotify: replace igrab() with ihold() on attach connector fanotify: add pidfd support to the fanotify API fanotify: introduce a generic info record copying helper fanotify: minor cosmetic adjustments to fid labels kernel/pid.c: implement additional checks upon pidfd_create() parameters kernel/pid.c: remove static qualifier from pidfd_create() commit 2287a51ba822384834dafc1c798453375d1107c7 Author: Linus Torvalds Date: Mon Aug 30 08:55:18 2021 -0700 vt_kdsetmode: extend console locking As per the long-suffering comment. Reported-by: Minh Yuan Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Linus Torvalds commit e8b8e97f91b80f08a2f1b7ea4f81e7af61b2cc2f Author: Kari Argillander Date: Tue Aug 3 14:57:09 2021 +0300 fs/ntfs3: Restyle comments to better align with kernel-doc Capitalize comments and end with period for better reading. Also function comments are now little more kernel-doc style. This way we can easily convert them to kernel-doc style if we want. Note that these are not yet complete with this style. Example function comments start with /* and in kernel-doc style they start /**. Use imperative mood in function descriptions. Change words like ntfs -> NTFS, linux -> Linux. Use "we" not "I" when commenting code. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 3a2b2eb55681158d3e3ef464fbf47574cf0c517c Author: nick black Date: Mon Aug 30 04:56:15 2021 -0400 console: consume APC, DM, DCS The Linux console's VT102 implementation already consumes OSC ("Operating System Command") sequences, probably because that's how palette changes are transmitted. In addition to OSC, there are three other major clases of ANSI control strings: APC ("Application Program Command"), PM ("Privacy Message"), and DCS ("Device Control String"). They are handled similarly to OSC in terms of termination. Source: vt100.net Add three new enumerated states, one for each of these types. All three are handled the same way right now--they simply consume input until terminated. I hope to expand upon this firmament in the future. Add new predicate ansi_control_string(), returning true for any of these states. Replace explicit checks against ESosc with calls to this function. Transition to these states appropriately from the escape initiation (ESesc) state. This was motivated by the following Notcurses bugs: https://github.com/dankamongmen/notcurses/issues/2050 https://github.com/dankamongmen/notcurses/issues/1828 https://github.com/dankamongmen/notcurses/issues/2069 where standard VT sequences are not consumed by the Linux console. It's not necessary that the Linux console *support* these sequences, but it ought *consume* these well-specified classes of sequences. Tested by sending a variety of escape sequences to the console, and verifying that they still worked, or were now properly consumed. Verified that the escapes were properly terminated at a generic level. Verified that the Notcurses tools continued to show expected output on the Linux console, except now without escape bleedthrough. Link: https://lore.kernel.org/lkml/YSydL0q8iaUfkphg@schwarzgerat.orthanc/ Signed-off-by: nick black Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Tetsuo Handa Cc: Daniel Vetter Signed-off-by: Linus Torvalds commit 291d47ccad191322524d77e0769dadcc8a811630 Author: Linus Torvalds Date: Wed Jul 21 12:01:28 2021 -0700 string: improve default out-of-line memcmp() implementation This just does the "if the architecture does efficient unaligned handling, start the memcmp using 'unsigned long' accesses", since Nikolay Borisov found a load that cares. This is basically the minimal patch, and limited to architectures that are known to not have slow unaligned handling. We've had the stupid byte-at-a-time version forever, and nobody has ever even noticed before, so let's keep the fix minimal. A potential further improvement would be to align one of the sources in order to at least minimize unaligned cases, but the only real case of bigger memcmp() users seems to be the FIDEDUPERANGE ioctl(). As David Sterba says, the dedupe ioctl is typically called on ranges spanning many pages so the common case will all be page-aligned anyway. All the relevant architectures select HAVE_EFFICIENT_UNALIGNED_ACCESS, so I'm not going to worry about the combination of a very rare use-case and a rare architecture until somebody actually hits it. Particularly since Nikolay also tested the more complex patch with extra alignment handling code, and it only added overhead. Link: https://lore.kernel.org/lkml/20210721135926.602840-1-nborisov@suse.com/ Reported-by: Nikolay Borisov Cc: David Sterba Signed-off-by: Linus Torvalds commit c985aafb60e972c0a6b8d0bd65e03af5890b748a Merge: 715d3edb79c6c 26d1982fd17c2 Author: Petr Mladek Date: Mon Aug 30 16:36:10 2021 +0200 Merge branch 'rework/printk_safe-removal' into for-linus commit 715d3edb79c6c2b68dedf348b0aa96e61f360292 Merge: baa99c926718c 11e4b63abbe23 Author: Petr Mladek Date: Mon Aug 30 16:33:04 2021 +0200 Merge branch 'rework/fixup-for-5.15' into for-linus commit 87df7fb922d18e96992aa5e824aa34b2065fef59 Author: Jens Axboe Date: Mon Aug 30 07:45:47 2021 -0600 io-wq: fix wakeup race when adding new work When new work is added, io_wqe_enqueue() checks if we need to wake or create a new worker. But that check is done outside the lock that otherwise synchronizes us with a worker going to sleep, so we can end up in the following situation: CPU0 CPU1 lock insert work unlock atomic_read(nr_running) != 0 lock atomic_dec(nr_running) no wakeup needed Hold the wqe lock around the "need to wakeup" check. Then we can also get rid of the temporary work_flags variable, as we know the work will remain valid as long as we hold the lock. Cc: stable@vger.kernel.org Reported-by: Andres Freund Signed-off-by: Jens Axboe commit a9a4aa9fbfc5b87f315c63d9a317648774a46879 Author: Jens Axboe Date: Mon Aug 30 06:33:08 2021 -0600 io-wq: wqe and worker locks no longer need to be IRQ safe io_uring no longer queues async work off completion handlers that run in hard or soft interrupt context, and that use case was the only reason that io-wq had to use IRQ safe locks for wqe and worker locks. Signed-off-by: Jens Axboe commit ecc53c48c13d995e6fe5559e30ffee48d92784fd Author: Jens Axboe Date: Sun Aug 29 16:13:03 2021 -0600 io-wq: check max_worker limits if a worker transitions bound state For the two places where new workers are created, we diligently check if we are allowed to create a new worker. If we're currently at the limit of how many workers of a given type we can have, then we don't create any new ones. If you have a mixed workload with various types of bound and unbounded work, then it can happen that a worker finishes one type of work and is then transitioned to the other type. For this case, we don't check if we are actually allowed to do so. This can cause io-wq to temporarily exceed the allowed number of workers for a given type. When retrieving work, check that the types match. If they don't, check if we are allowed to transition to the other type. If not, then don't handle the new work. Cc: stable@vger.kernel.org Reported-by: Johannes Lundberg Signed-off-by: Jens Axboe commit a05b42702d69776db27aee81dca965c02c42e13f Author: James Clark Date: Wed Aug 25 17:42:59 2021 +0100 perf tests: Fix *probe_vfs_getname.sh test failures The commit 4d6101f5fd5d9960 ("perf probe: Clarify error message about not finding kernel modules debuginfo") changed the error message "Failed to find the path for kernel" to "Failed to find the path for the kernel". Update the regex so that the tests still skip rather than fail when kernel debug symbols aren't present. Signed-off-by: James Clark Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Link: http://lore.kernel.org/lkml/20210825164259.833222-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit edf7b4a2d85e37a1ee77156bddaed4aa6af9c5e1 Author: Arnaldo Carvalho de Melo Date: Wed Aug 25 11:50:37 2021 -0300 perf bench inject-buildid: Handle writen() errors The build on fedora:35 and fedora:rawhide with clang is failing with: 49 41.00 fedora:35 : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35) bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable] u64 len = 0; ^ 1 error generated. make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2 50 41.11 fedora:rawhide : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35) bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable] u64 len = 0; ^ 1 error generated. make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2 That 'len' variable is not used at all, so just make sure all the synthesize_RECORD() routines return ssize_t to propagate the writen() return, as it may fail, ditch the 'ret' var and bail out if those routines fail. Fixes: 0bf02a0d80427f26 ("perf bench: Add build-id injection benchmark") Acked-by: Namhyung Kim Link: http://lore.kernel.org/lkml/CAM9d7cgEZNSor+B+7Y2C+QYGme_v5aH0Zn0RLfxoQ+Fy83EHrg@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit cdf32b44678c382a31dc183d9a767306915cda7b Author: Li Huafei Date: Mon Aug 23 21:43:40 2021 +0800 perf unwind: Do not overwrite FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} When setting LIBUNWIND_DIR, we first set FEATURE_CHECK_LDFLAGS-libunwind-{aarch64,x86} = -L$(LIBUNWIND_DIR)/lib. This happens a bit before, the overwritting, in: libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code)) define libunwind_arch_set_flags_code FEATURE_CHECK_CFLAGS-libunwind-$(1) = -I$(LIBUNWIND_DIR)/include FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib endef ifdef LIBUNWIND_DIR LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64 $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch))) endif Look at that 'foreach' on all the LIBUNWIND_ARCHS. After commit 5c4d7c82c0dc ("perf unwind: Do not put libunwind-{x86,aarch64} in FEATURE_TESTS_BASIC"), FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} is overwritten. As a result, the remote libunwind libraries cannot be searched from $(LIBUNWIND_DIR)/lib directory during feature check tests. Fix it with variable appending. Before this patch: perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64 BUILD: Doing 'make -j16' parallel build ... ... libopencsd: [ OFF ] ... libunwind-x86: [ OFF ] ... libunwind-x86_64: [ OFF ] ... libunwind-arm: [ OFF ] ... libunwind-aarch64: [ OFF ] ... libunwind-debug-frame: [ OFF ] ... libunwind-debug-frame-arm: [ OFF ] ... libunwind-debug-frame-aarch64: [ OFF ] ... cxx: [ OFF ] perf$ cat ../build/feature/test-libunwind-aarch64.make.output /usr/bin/ld: cannot find -lunwind-aarch64 /usr/bin/ld: cannot find -lunwind-aarch64 collect2: error: ld returned 1 exit status After this patch: perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64 BUILD: Doing 'make -j16' parallel build ... libopencsd: [ OFF ] ... libunwind-x86: [ OFF ] ... libunwind-x86_64: [ OFF ] ... libunwind-arm: [ OFF ] ... libunwind-aarch64: [ on ] ... libunwind-debug-frame: [ OFF ] ... libunwind-debug-frame-arm: [ OFF ] ... libunwind-debug-frame-aarch64: [ OFF ] ... cxx: [ OFF ] perf$ cat ../build/feature/test-libunwind-aarch64.make.output perf$ ldd ./perf linux-vdso.so.1 (0x00007ffdf07da000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f30953dc000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f30951d4000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3094e36000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3094c32000) libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f3094a18000) libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f30947cc000) libunwind-x86_64.so.8 => /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007f30945ad000) libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f3094392000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f309416c000) libunwind-aarch64.so.8 => not found libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f3093c8a000) libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 (0x00007f309386b000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f309364e000) libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f3093443000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3093052000) /lib64/ld-linux-x86-64.so.2 (0x00007f3096097000) libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3092e42000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3092c3f000) Fixes: 5c4d7c82c0dceccf ("perf unwind: Do not put libunwind-{x86,aarch64} in FEATURE_TESTS_BASIC") Signed-off-by: Li Huafei Cc: Alexander Shishkin Cc: He Kuang Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Zhang Jinhao Link: http://lore.kernel.org/lkml/20210823134340.60955-1-lihuafei1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 261f491133aecb943ccfdc3b3794e2d775607a87 Author: Arnaldo Carvalho de Melo Date: Fri Aug 20 11:13:36 2021 -0300 perf config: Fix caching and memory leak in perf_home_perfconfig() Acaict, perf_home_perfconfig() is supposed to cache the result of home_perfconfig, which returns the default location of perfconfig for the user, given the HOME environment variable. However, the current implementation calls home_perfconfig every time perf_home_perfconfig() is called (so no caching is actually performed), replacing the previous pointer, thus also causing a memory leak. This patch adds a check of whether either config or failed is set and, in that case, directly returns config without calling home_perfconfig at each invocation. Fixes: f5f03e19ce14fc31 ("perf config: Add perf_home_perfconfig function") Signed-off-by: Riccardo Mancini Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Link: http://lore.kernel.org/lkml/20210820130817.740536-1-rickyman7@gmail.com [ Removed needless double check for the 'failed' variable ] Signed-off-by: Arnaldo Carvalho de Melo commit 128dbd78bd673f9edbc4413072b23efb6657feb0 Author: Alexey Dobriyan Date: Tue Aug 17 14:58:33 2021 +0300 perf tools: Fixup get_current_dir_name() compilation strdup() prototype doesn't live in stdlib.h . Add limits.h for PATH_MAX definition as well. This fixes the build on Android. Signed-off-by: Alexey Dobriyan (SK hynix) Acked-by: Namhyung Kim Link: http://lore.kernel.org/lkml/YRukaQbrgDWhiwGr@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo commit c635813fef0b2327ffecbfbd642f0009e186b3a5 Merge: 37c3193fa4d7d 7d2a07b769330 Author: Arnaldo Carvalho de Melo Date: Mon Aug 30 10:05:46 2021 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit a8729efbbb847f6ea9b06e73491ec8ddb560465e Merge: f7b82b12626e1 38b7673000949 Author: Takashi Iwai Date: Mon Aug 30 14:57:03 2021 +0200 Merge tag 'asoc-v5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.15 Quite a quiet release this time, mostly a combination of cleanups and a good set of new drivers. - Lots of cleanups and improvements to the Intel drivers, including some new systems support. - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L,, Rockchip RK3568 S/PDIF. commit baa99c926718c1a1549a7e08383f53a8e2944f04 Merge: 71af75b692945 10102a890b543 Author: Petr Mladek Date: Mon Aug 30 14:56:28 2021 +0200 Merge branch 'for-5.15-verbose-console' into for-linus commit 71af75b6929458d85f63c0649dc26d6f4c19729e Merge: fe8e3ee0d5885 bc17bed5fd73e Author: Petr Mladek Date: Mon Aug 30 14:56:06 2021 +0200 Merge branch 'for-5.15-printk-index' into for-linus commit 6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac Merge: 65f90c8e38c99 79fbd3e1241ce Author: Jason Gunthorpe Date: Mon Aug 30 09:49:59 2021 -0300 Merge branch 'sg_nents' into rdma.git for-next From Maor Gottlieb ==================== Fix the use of nents and orig_nents in the sg table append helpers. The nents should be used by the DMA layer to store the number of DMA mapped sges, the orig_nents is the number of CPU sges. Since the sg append logic doesn't always create a SGL with exactly orig_nents entries store a total_nents as well to allow the table to be properly free'd and reorganize the freeing logic to share across all the use cases. ==================== Signed-off-by: Jason Gunthorpe * 'sg_nents': RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append commit 65f90c8e38c9900692338864156e7824cf8a6501 Author: Lior Nahmanson Date: Mon Aug 30 13:48:49 2021 +0300 RDMA/mlx5: Relax DCS QP creation checks In order to create DCS QPs, we don't need to rely on both log_max_dci_stream_channels and log_max_dci_errored_streams capabilities. Fixes: 11656f593a86 ("RDMA/mlx5: Add DCS offload support") Link: https://lore.kernel.org/r/3e7b3363fd73686176cc584295e86832a7cf99b2.1630320354.git.leonro@nvidia.com Signed-off-by: Lior Nahmanson Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1c3ac086fd6956ae6124f45672bec227086e05db Author: Rob Herring Date: Tue Aug 24 14:51:54 2021 -0500 dt-bindings: Use 'enum' instead of 'oneOf' plus 'const' entries 'enum' is equivalent to 'oneOf' with a list of 'const' entries, but 'enum' is more concise and yields better error messages. Cc: Maxime Ripard Cc: Vignesh R Cc: Marc Zyngier Cc: Mauro Carvalho Chehab Cc: Lee Jones Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Bjorn Helgaas Cc: Kishon Vijay Abraham I Cc: Daniel Lezcano Cc: dmaengine@vger.kernel.org Cc: linux-i2c@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: linux-phy@lists.infradead.org Cc: linux-serial@vger.kernel.org Cc: alsa-devel@alsa-project.org Cc: linux-spi@vger.kernel.org Acked-by: Sakari Ailus (mipi-ccs) Acked-by: Mark Brown Reviewed-by: Vinod Koul Acked-By: Vinod Koul Acked-by: Wolfram Sang # for I2C Acked-by: Greg Kroah-Hartman Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210824202014.978922-1-robh@kernel.org commit 1b9fbe813016b08e08b22ddba4ddbf9cb1b04b00 Author: Yajun Deng Date: Mon Aug 30 17:16:40 2021 +0800 net: ipv4: Fix the warning for dereference Add a if statements to avoid the warning. Dan Carpenter report: The patch faf482ca196a: "net: ipv4: Move ip_options_fragment() out of loop" from Aug 23, 2021, leads to the following Smatch complaint: net/ipv4/ip_output.c:833 ip_do_fragment() warn: variable dereferenced before check 'iter.frag' (see line 828) Reported-by: Dan Carpenter Fixes: faf482ca196a ("net: ipv4: Move ip_options_fragment() out of loop") Link: https://lore.kernel.org/netdev/20210830073802.GR7722@kadam/T/#t Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 38b7673000949ca784fcb8a9feb70d2a802befa6 Merge: a617f7d45c499 3202e2f5fac00 Author: Mark Brown Date: Mon Aug 30 12:30:33 2021 +0100 Merge remote-tracking branch 'asoc/for-5.15' into asoc-linus commit a617f7d45c499b56689cdcef37dfa86fdeb99940 Merge: e22ce8eb631bd e6d0b92ac00b5 Author: Mark Brown Date: Mon Aug 30 12:30:31 2021 +0100 Merge remote-tracking branch 'asoc/for-5.14' into asoc-linus commit aaa8e4922c887ff47ad66ef918193682bccc1905 Author: Dan Carpenter Date: Mon Aug 30 11:37:17 2021 +0300 net: qrtr: make checks in qrtr_endpoint_post() stricter These checks are still not strict enough. The main problem is that if "cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is guaranteed to be 4 but we need to be at least 16 bytes. In fact, we can reject everything smaller than sizeof(*pkt) which is 20 bytes. Also I don't like the ALIGN(size, 4). It's better to just insist that data is needs to be aligned at the start. Fixes: 0baa99ee353c ("net: qrtr: Allow non-immediate node routing") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit efe487fce3061d94222c6501d7be3aa549b3dc78 Author: Haimin Zhang Date: Mon Aug 30 11:47:01 2021 +0800 fix array-index-out-of-bounds in taprio_change syzbot report an array-index-out-of-bounds in taprio_change index 16 is out of range for type '__u16 [16]' that's because mqprio->num_tc is lager than TC_MAX_QUEUE,so we check the return value of netdev_set_num_tc. Reported-by: syzbot+2b3e5fb6c7ef285a94f6@syzkaller.appspotmail.com Signed-off-by: Haimin Zhang Signed-off-by: David S. Miller commit e842cb60e8ac1d8a15b01e0dd4dad453807a597d Author: 王贇 Date: Mon Aug 30 18:28:01 2021 +0800 net: fix NULL pointer reference in cipso_v4_doi_free In netlbl_cipsov4_add_std() when 'doi_def->map.std' alloc failed, we sometime observe panic: BUG: kernel NULL pointer dereference, address: ... RIP: 0010:cipso_v4_doi_free+0x3a/0x80 ... Call Trace: netlbl_cipsov4_add_std+0xf4/0x8c0 netlbl_cipsov4_add+0x13f/0x1b0 genl_family_rcv_msg_doit.isra.15+0x132/0x170 genl_rcv_msg+0x125/0x240 This is because in cipso_v4_doi_free() there is no check on 'doi_def->map.std' when doi_def->type got value 1, which is possibe, since netlbl_cipsov4_add_std() haven't initialize it before alloc 'doi_def->map.std'. This patch just add the check to prevent panic happen in similar cases. Reported-by: Abaci Signed-off-by: Michael Wang Signed-off-by: David S. Miller commit 63cad4c7439c826be31e03af9edf7fa4e2e0cd46 Merge: 9dfa859da0f5f 67d6d681e15b5 Author: David S. Miller Date: Mon Aug 30 12:21:38 2021 +0100 Merge branch 'inet-exceptions-less-predictable' Eric Dumazet says: ==================== inet: make exception handling less predictible This second round of patches is addressing Keyu Man recommendations to make linux hosts more robust against a class of brute force attacks. ==================== Signed-off-by: David S. Miller commit 67d6d681e15b578c1725bad8ad079e05d1c48a8e Author: Eric Dumazet Date: Sun Aug 29 15:16:15 2021 -0700 ipv4: make exception cache less predictible Even after commit 6457378fe796 ("ipv4: use siphash instead of Jenkins in fnhe_hashfun()"), an attacker can still use brute force to learn some secrets from a victim linux host. One way to defeat these attacks is to make the max depth of the hash table bucket a random value. Before this patch, each bucket of the hash table used to store exceptions could contain 6 items under attack. After the patch, each bucket would contains a random number of items, between 6 and 10. The attacker can no longer infer secrets. This is slightly increasing memory size used by the hash table, by 50% in average, we do not expect this to be a problem. This patch is more complex than the prior one (IPv6 equivalent), because IPv4 was reusing the oldest entry. Since we need to be able to evict more than one entry per update_or_create_fnhe() call, I had to replace fnhe_oldest() with fnhe_remove_oldest(). Also note that we will queue extra kfree_rcu() calls under stress, which hopefully wont be a too big issue. Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") Signed-off-by: Eric Dumazet Reported-by: Keyu Man Cc: Willy Tarreau Signed-off-by: David S. Miller Reviewed-by: David Ahern Tested-by: David Ahern Signed-off-by: David S. Miller commit a00df2caffed3883c341d5685f830434312e4a43 Author: Eric Dumazet Date: Sun Aug 29 15:16:14 2021 -0700 ipv6: make exception cache less predictible Even after commit 4785305c05b2 ("ipv6: use siphash in rt6_exception_hash()"), an attacker can still use brute force to learn some secrets from a victim linux host. One way to defeat these attacks is to make the max depth of the hash table bucket a random value. Before this patch, each bucket of the hash table used to store exceptions could contain 6 items under attack. After the patch, each bucket would contains a random number of items, between 6 and 10. The attacker can no longer infer secrets. This is slightly increasing memory size used by the hash table, we do not expect this to be a problem. Following patch is dealing with the same issue in IPv4. Fixes: 35732d01fe31 ("ipv6: introduce a hash table to store dst cache") Signed-off-by: Eric Dumazet Reported-by: Keyu Man Cc: Wei Wang Cc: Martin KaFai Lau Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3202e2f5fac0032cb1128fb8d5b7f3368902c8d8 Author: Mark Brown Date: Mon Aug 30 12:13:46 2021 +0100 ASoC: Revert PCM trigger changes These have turned up some issues in further testing. Signed-off-by: Mark Brown commit 927932240aa1739ac8c92b142a5e2dcc490f36e0 Author: Heiko Carstens Date: Mon Aug 30 12:46:17 2021 +0200 s390: remove SCHED_CORE from defconfigs This causes too many problems. Enable it again when everything has been sorted out. Signed-off-by: Heiko Carstens commit 1a0df28c09831dc4bd336fe6e090bbe85a07e79f Author: zhaoxiao Date: Wed Aug 25 19:41:11 2021 +0800 x86: xen: platform-pci-unplug: use pr_err() and pr_warn() instead of raw printk() Since we have the nice helpers pr_err() and pr_warn(), use them instead of raw printk(). [jgross@suse.com] Move the "#define pr_fmt" above the #includes in order to avoid build warnings due to redefinition. Signed-off-by: zhaoxiao Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20210825114111.29009-1-zhaoxiao@uniontech.com Signed-off-by: Juergen Gross commit bb70913dceca050e8f4f60ba5361fcf62460df06 Author: Jing Yangyang Date: Tue Aug 24 23:24:51 2021 -0700 drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Reviewed-by: SeongJae Park Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20210825062451.69998-1-deng.changcheng@zte.com.cn Signed-off-by: Juergen Gross commit b94e4b147fd1992ad450e1fea1fdaa3738753373 Author: Juergen Gross Date: Fri Jul 30 12:38:54 2021 +0200 xen/blkfront: don't trust the backend response data blindly Today blkfront will trust the backend to send only sane response data. In order to avoid privilege escalations or crashes in case of malicious backends verify the data to be within expected limits. Especially make sure that the response always references an outstanding request. Introduce a new state of the ring BLKIF_STATE_ERROR which will be switched to in case an inconsistency is being detected. Recovering from this state is possible only via removing and adding the virtual device again (e.g. via a suspend/resume cycle). Make all warning messages issued due to valid error responses rate limited in order to avoid message floods being triggered by a malicious backend. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Acked-by: Roger Pau Monné Link: https://lore.kernel.org/r/20210730103854.12681-4-jgross@suse.com Signed-off-by: Juergen Gross commit 8f5a695d99000fc3aa73934d7ced33cfc64dcdab Author: Juergen Gross Date: Fri Jul 30 12:38:53 2021 +0200 xen/blkfront: don't take local copy of a request from the ring page In order to avoid a malicious backend being able to influence the local copy of a request build the request locally first and then copy it to the ring page instead of doing it the other way round as today. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Acked-by: Roger Pau Monné Link: https://lore.kernel.org/r/20210730103854.12681-3-jgross@suse.com Signed-off-by: Juergen Gross commit 71b66243f9898d0e54296b4e7035fb33cdcb0707 Author: Juergen Gross Date: Fri Jul 30 12:38:52 2021 +0200 xen/blkfront: read response from backend only once In order to avoid problems in case the backend is modifying a response on the ring page while the frontend has already seen it, just read the response into a local buffer in one go and then operate on that buffer only. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Acked-by: Roger Pau Monné Link: https://lore.kernel.org/r/20210730103854.12681-2-jgross@suse.com Signed-off-by: Juergen Gross commit 9dfa859da0f5fe9dae4d2fca76c5c0272e43c702 Merge: 724812d8561c3 7a3f5b0de3647 Author: David S. Miller Date: Mon Aug 30 10:57:54 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next: 1) Clean up and consolidate ct ecache infrastructure by merging ct and expect notifiers, from Florian Westphal. 2) Missing counters and timestamp in nfnetlink_queue and _log conntrack information. 3) Missing error check for xt_register_template() in iptables mangle, as a incremental fix for the previous pull request, also from Florian Westphal. 4) Add netfilter hooks for the SRv6 lightweigh tunnel driver, from Ryoga Sato. The hooks are enabled via nf_hooks_lwtunnel sysctl to make sure existing netfilter rulesets do not break. There is a static key to disable the hooks by default. The pktgen_bench_xmit_mode_netif_receive.sh shows no noticeable impact in the seg6_input path for non-netfilter users: similar numbers with and without this patch. This is a sample of the perf report output: 11.67% kpktgend_0 [ipv6] [k] ipv6_get_saddr_eval 7.89% kpktgend_0 [ipv6] [k] __ipv6_addr_label 7.52% kpktgend_0 [ipv6] [k] __ipv6_dev_get_saddr 6.63% kpktgend_0 [kernel.vmlinux] [k] asm_exc_nmi 4.74% kpktgend_0 [ipv6] [k] fib6_node_lookup_1 3.48% kpktgend_0 [kernel.vmlinux] [k] pskb_expand_head 3.33% kpktgend_0 [ipv6] [k] ip6_rcv_core.isra.29 3.33% kpktgend_0 [ipv6] [k] seg6_do_srh_encap 2.53% kpktgend_0 [ipv6] [k] ipv6_dev_get_saddr 2.45% kpktgend_0 [ipv6] [k] fib6_table_lookup 2.24% kpktgend_0 [kernel.vmlinux] [k] ___cache_free 2.16% kpktgend_0 [ipv6] [k] ip6_pol_route 2.11% kpktgend_0 [kernel.vmlinux] [k] __ipv6_addr_type ==================== Signed-off-by: David S. Miller commit 30dcc56bba911db561c35d4131baf983a41023f8 Author: Juergen Gross Date: Fri Jul 30 09:18:04 2021 +0200 xen: assume XENFEAT_gnttab_map_avail_bits being set for pv guests XENFEAT_gnttab_map_avail_bits is always set in Xen 4.0 and newer. Remove coding assuming it might be zero. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210730071804.4302-4-jgross@suse.com Signed-off-by: Juergen Gross commit 2526cff7c4f944924f39043dc657189eccc4fe5c Author: Juergen Gross Date: Fri Jul 30 09:18:03 2021 +0200 xen: assume XENFEAT_mmu_pt_update_preserve_ad being set for pv guests XENFEAT_mmu_pt_update_preserve_ad is always set in Xen 4.0 and newer. Remove coding assuming it might be zero. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210730071804.4302-3-jgross@suse.com Signed-off-by: Juergen Gross commit ac4c403c9036793dfbf63e75acd1772cdac778de Author: Juergen Gross Date: Fri Jul 30 09:18:02 2021 +0200 xen: check required Xen features Linux kernel is not supported to run on Xen versions older than 4.0. Add tests for required Xen features always being present in Xen 4.0 and newer. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210730071804.4302-2-jgross@suse.com Signed-off-by: Juergen Gross commit 4b511d5bfa74b1926daefd1694205c7f1bcf677f Author: Juergen Gross Date: Fri Jul 30 11:26:21 2021 +0200 xen: fix setting of max_pfn in shared_info Xen PV guests are specifying the highest used PFN via the max_pfn field in shared_info. This value is used by the Xen tools when saving or migrating the guest. Unfortunately this field is misnamed, as in reality it is specifying the number of pages (including any memory holes) of the guest, so it is the highest used PFN + 1. Renaming isn't possible, as this is a public Xen hypervisor interface which needs to be kept stable. The kernel will set the value correctly initially at boot time, but when adding more pages (e.g. due to memory hotplug or ballooning) a real PFN number is stored in max_pfn. This is done when expanding the p2m array, and the PFN stored there is even possibly wrong, as it should be the last possible PFN of the just added P2M frame, and not one which led to the P2M expansion. Fix that by setting shared_info->max_pfn to the last possible PFN + 1. Fixes: 98dd166ea3a3c3 ("x86/xen/p2m: hint at the last populated P2M entry") Cc: stable@vger.kernel.org Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Link: https://lore.kernel.org/r/20210730092622.9973-2-jgross@suse.com Signed-off-by: Juergen Gross commit d7e7747ac5c2496c98291944c6066adaa9f3b975 Author: Florian Westphal Date: Thu Aug 26 15:54:22 2021 +0200 netfilter: refuse insertion if chain has grown too large Also add a stat counter for this that gets exported both via old /proc interface and ctnetlink. Assuming the old default size of 16536 buckets and max hash occupancy of 64k, this results in 128k insertions (origin+reply), so ~8 entries per chain on average. The revised settings in this series will result in about two entries per bucket on average. This allows a hard-limit ceiling of 64. This is not tunable at the moment, but its possible to either increase nf_conntrack_buckets or decrease nf_conntrack_max to reduce average lengths. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit dd6d2910c5e071a8683827df1a89e527aa5145ab Author: Florian Westphal Date: Thu Aug 26 15:54:20 2021 +0200 netfilter: conntrack: switch to siphash Replace jhash in conntrack and nat core with siphash. While at it, use the netns mix value as part of the input key rather than abuse the seed value. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d532bcd0b2699d84d71a0c71d37157ac6eb3be25 Author: Florian Westphal Date: Thu Aug 26 15:54:19 2021 +0200 netfilter: conntrack: sanitize table size default settings conntrack has two distinct table size settings: nf_conntrack_max and nf_conntrack_buckets. The former limits how many conntrack objects are allowed to exist in each namespace. The second sets the size of the hashtable. As all entries are inserted twice (once for original direction, once for reply), there should be at least twice as many buckets in the table than the maximum number of conntrack objects that can exist at the same time. Change the default multiplier to 1 and increase the chosen bucket sizes. This results in the same nf_conntrack_max settings as before but reduces the average bucket list length. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 724812d8561c32d2564a90c2fdf94fd7431658b4 Merge: 27c779437cbc9 e9e506221b425 Author: David S. Miller Date: Mon Aug 30 09:59:11 2021 +0100 Merge branch 'IXP46x-PTP-Timer' Linus Walleij says: ==================== IXP46x PTP Timer clean-up and DT ChangeLog v2->v3: - Dropped the patch enabling compile tests: we are still dependent on some machine-specific headers. The plan is to get rid of this after device tree conversion. We include one of the compile testing fixes anyway, because it is nice to have fixed. - Rebased on the latest net-next ==================== Signed-off-by: David S. Miller commit e9e506221b425f3c48fbace164d9d7543643ff1f Author: Linus Walleij Date: Sat Aug 28 19:15:48 2021 +0200 ixp4xx_eth: Probe the PTP module from the device tree This adds device tree probing support for the PTP module adjacent to the ethernet module. It is pretty straight forward, all resources are in the device tree as they come to the platform device. Cc: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 323fb75dae2808750a87250ffc502ba10c231dad Author: Linus Walleij Date: Sat Aug 28 19:15:47 2021 +0200 ixp4xx_eth: Add devicetree bindings This adds device tree bindings for the IXP46x PTP Timer, a companion to the IXP4xx ethernet in newer platforms. Cc: devicetree@vger.kernel.org Cc: Arnd Bergmann Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 13dc931918ac7c1f5bc919f4a9049aa10f27ceee Author: Linus Walleij Date: Sat Aug 28 19:15:46 2021 +0200 ixp4xx_eth: Stop referring to GPIOs The driver is being passed interrupts, then looking up the same interrupts as GPIOs a second time to convert them into interrupts and set properties on them. This is pointless: the GPIO and irqchip APIs of a GPIO chip are orthogonal. Just request the interrupts and be done with it, drop reliance on any GPIO functions or definitions. Use devres-managed functions and add a small devress quirk to unregister the clock as well and we can rely on devres to handle all the resources and cut down a bunch of boilerplate in the process. Cc: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit f52749a285646d51a1b3f8fdc33881983e15ee5d Author: Arnd Bergmann Date: Sat Aug 28 19:15:45 2021 +0200 ixp4xx_eth: fix compile-testing Change the driver to use portable integer types to avoid warnings during compile testing, including: drivers/net/ethernet/xscale/ixp4xx_eth.c:721:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast] memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); ^ drivers/net/ethernet/xscale/ixp4xx_eth.c:963:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] &port->desc_tab_phys))) ^~~~~~~~~~~~~~~~~~~~ include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here dma_addr_t *handle); ^ Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 9055a2f591629b952910503e72ddae1371c44bf1 Author: Arnd Bergmann Date: Sat Aug 28 19:15:44 2021 +0200 ixp4xx_eth: make ptp support a platform driver After the recent ixp4xx cleanups, the ptp driver has gained a build failure in some configurations: drivers/net/ethernet/xscale/ptp_ixp46x.c: In function 'ptp_ixp_init': drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: error: 'IXP4XX_TIMESYNC_BASE_VIRT' undeclared (first use in this function) Avoid the last bit of hardcoded constants from platform headers by turning the ptp driver bit into a platform driver and passing the IRQ and MMIO address as resources. This is a bit tricky: - The interface between the two drivers is now the new ixp46x_ptp_find() function, replacing the global ixp46x_phc_index variable. The call is done as late as possible, in hwtstamp_set(), to ensure that the ptp device is fully probed. - As the ptp driver is now called by the network driver, the link dependency is reversed, which in turn requires a small Makefile hack - The GPIO number is still left hardcoded. This is clearly not great, but it can be addressed later. Note that commit 98ac0cc270b7 ("ARM: ixp4xx: Convert to MULTI_IRQ_HANDLER") changed the IRQ number to something meaningless. Passing the correct IRQ in a resource fixes this. - When the PTP driver is disabled, ethtool .get_ts_info() now correctly lists only software timestamping regardless of the hardware. Signed-off-by: Arnd Bergmann [Fix a missing include] Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 27c779437cbc903d318c12a5f54ea151aa3f307f Merge: 49f9df5ba298a 52d89333d2191 Author: David S. Miller Date: Mon Aug 30 09:43:19 2021 +0100 Merge branch 'hns3-cleanups' Guangbin Huang says: ==================== net: hns3: add some cleanups This series includes some cleanups for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 52d89333d21918ff0ac25d6f8307b7fe6cbfde11 Author: Hao Chen Date: Mon Aug 30 14:06:42 2021 +0800 net: hns3: uniform parameter name of hclge_ptp_clean_tx_hwts() The parameter name of hclge_ptp_clean_tx_hwts() in declaration is "dev", but the definition of this function is used the common name "hdev" as other functions, so modify it. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 38b99e1ede3280f0e286071956bd8632737be57b Author: Hao Chen Date: Mon Aug 30 14:06:41 2021 +0800 net: hnss3: use max() to simplify code Replace the "? :" statement wich max() to simplify code. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5aea2da5930392055afc82e2fc02e706a022ba43 Author: Hao Chen Date: Mon Aug 30 14:06:40 2021 +0800 net: hns3: modify a print format of hns3_dbg_queue_map() The type of tqp_vector->vector_irq is int, so modify its print format to "%d". Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 04d96139ddb32dd15e5941c303f511a92759a5be Author: Guangbin Huang Date: Mon Aug 30 14:06:39 2021 +0800 net: hns3: refine function hclge_dbg_dump_tm_pri() To improve flexibility, simplicity and maintainability to dump info of every element of tm priority, add a struct hclge_dbg_item array of tm priority and fill string of every data according to this array. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 161ad669e6c23529415bffed5cb3bfa012e46cb4 Author: Guangbin Huang Date: Mon Aug 30 14:06:38 2021 +0800 net: hns3: reconstruct function hclge_ets_validate() This patch reconstructs function hclge_ets_validate() to reduce the code cycle complexity and make code more concise. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 4c8dab1c709c5a715bce14efdb8f4e889d86aa04 Author: Peng Li Date: Mon Aug 30 14:06:37 2021 +0800 net: hns3: reconstruct function hns3_self_test This patch reconstructs function hns3_self_test to reduce the code cycle complexity and make code more concise. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 60fe9ff9b7cbbf78a755cd849a3575d3b04b7394 Author: Jiaran Zhang Date: Mon Aug 30 14:06:36 2021 +0800 net: hns3: initialize each member of structure array on a separate line To make the format of each member initialization of structure array clearer, initialize each member on a separate line. Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 49f9df5ba298a4b6754281e40ea80878a4d49c44 Merge: eaf2aaec0be46 68f684e257d7f Author: David S. Miller Date: Mon Aug 30 09:35:05 2021 +0100 Merge branch 'bnxt_en-fw-messages' Michael Chan says: ==================== bnxt_en: Implement new driver APIs to send FW messages The current driver APIs to send messages to the firmware allow only one outstanding message in flight. There is only one buffer for the firmware response for each firmware channel. To send a firmware message, all callers must take a mutex and it is released after the firmware response has been read. This scheme does not allow multiple firmware messages in flight. Firmware may take a long time to respond to some messages (e.g. NVRAM related ones) and this causes the mutex to be held for a long time, blocking other callers. This patchset intoduces the new driver APIs to address the above shortcomings. The new APIs are compatible with new and old firmware. But the new deferred firmware response mechanism will require newer firmware in order to allow multiple outstanding firmware commands. All callers are updated to use the new APIs. v2: Patch 4 and patch 9 updated to fix issues reported by test robot ==================== Signed-off-by: David S. Miller commit 68f684e257d7f3a6303b0e838bfa982c74f2c8da Author: Edwin Peer Date: Sun Aug 29 03:35:06 2021 -0400 bnxt_en: support multiple HWRM commands in flight Add infrastructure to maintain a pending list of HWRM commands awaiting completion and reduce the scope of the hwrm_cmd_lock mutex so that it protects only the request mailbox. The mailbox is free to use for one or more concurrent commands after receiving deferred response events. For uniformity and completeness, use the same pending list for collecting completions for commands that respond via a completion ring. These commands are only used for freeing rings and for IRQ test and we only support one such command in flight. Note deferred responses are also only supported on the main channel. The secondary channel (KONG) does not support deferred responses. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b34695a894b88e50e16dd3dcb1098fe919023f14 Author: Edwin Peer Date: Sun Aug 29 03:35:05 2021 -0400 bnxt_en: remove legacy HWRM interface There are no longer any callers relying on the old API. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit bbf33d1d9805fc3a59ded637ab6555fb20edb5d2 Author: Edwin Peer Date: Sun Aug 29 03:35:04 2021 -0400 bnxt_en: update all firmware calls to use the new APIs The conversion follows this general pattern for most of the calls: 1. The input message is changed from a stack variable initialized using bnxt_hwrm_cmd_hdr_init() to a pointer allocated and intialized using hwrm_req_init(). 2. If we don't need to read the firmware response, the hwrm_send_message() call is replaced with hwrm_req_send(). 3. If we need to read the firmware response, the mutex lock is replaced by hwrm_req_hold() to hold the response. When the response is read, the mutex unlock is replaced by hwrm_req_drop(). If additional DMA buffers are needed for firmware response data, the hwrm_req_dma_slice() is used instead of calling dma_alloc_coherent(). Some minor refactoring is also done while doing these conversions. v2: Fix unintialized variable warnings in __bnxt_hwrm_get_tx_rings() and bnxt_approve_mac() Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 3c10ed497fa87780a9ee8c31092373e5f1e20f64 Author: Edwin Peer Date: Sun Aug 29 03:35:03 2021 -0400 bnxt_en: use link_lock instead of hwrm_cmd_lock to protect link_info We currently use the hwrm_cmd_lock to serialize the update of the firmware's link status response data and the copying of link status data to the VF. This won't work when we update the firmware message APIs, so we use the link_lock mutex instead. All link_info data should be updated under the link_lock mutex. Also add link_lock to functions that touch link_info in __bnxt_open_nic() and bnxt_probe_phy(). The locking is probably not strictly necessary during probe, but it's more consistent. Signed-off-by: Edwin Peer Reviewed-by: Michael Chan Signed-off-by: David S. Miller commit 2138081708405fb9c16a76a9b6ef46c35d3f17a9 Author: Edwin Peer Date: Sun Aug 29 03:35:02 2021 -0400 bnxt_en: add support for HWRM request slices Slices are a mechanism for suballocating DMA mapped regions from the request buffer. Such regions can be used for indirect command data instead of creating new mappings with dma_alloc_coherent(). The advantage of using a slice is that the lifetime of the slice is bound to the request and will be automatically unmapped when the request is consumed. A single external region is also supported. This allows for regions that will not fit inside the spare request buffer space such that the same API can be used consistently even for larger mappings. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ecddc29d928d0ecccbc8f339b59ed75e5c8e8ecf Author: Edwin Peer Date: Sun Aug 29 03:35:01 2021 -0400 bnxt_en: add HWRM request assignment API hwrm_req_replace() provides an assignment like operation to replace a managed HWRM request object with data from a pre-built source. This is useful for handling request data provided by higher layer HWRM clients. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 02b9aa1068682319508f9a1678e993ad958a8a4f Author: Edwin Peer Date: Sun Aug 29 03:35:00 2021 -0400 bnxt_en: discard out of sequence HWRM responses During firmware crash recovery, it is possible for firmware to respond to stale HWRM commands that have already timed out. Because response buffers may be reused, any out of sequence responses need to be ignored and only the matching seq_id should be accepted. Also, READ_ONCE should be used for the reads from the DMA buffer to ensure that the necessary loads are scheduled. Reviewed-by: Scott Branden Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit f9ff578251dc2f1cf5b9b007e050033d8414829d Author: Edwin Peer Date: Sun Aug 29 03:34:59 2021 -0400 bnxt_en: introduce new firmware message API based on DMA pools This change constitutes a major step towards supporting multiple firmware commands in flight by maintaining a separate response buffer for the duration of each request. These firmware commands are also known as Hardware Resource Manager (HWRM) commands. Using separate response buffers requires an API change in order for callers to be able to free the buffer when done. It is impossible to keep the existing APIs unchanged. The existing usage for a simple HWRM message request such as the following: struct input req = {0}; bnxt_hwrm_cmd_hdr_init(bp, &req, REQ_TYPE, -1, -1); rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); if (rc) /* error */ changes to: struct input *req; rc = hwrm_req_init(bp, req, REQ_TYPE); if (rc) /* error */ rc = hwrm_req_send(bp, req); /* consumes req */ if (rc) /* error */ The key changes are: 1. The req is no longer allocated on the stack. 2. The caller must call hwrm_req_init() to allocate a req buffer and check for a valid buffer. 3. The req buffer is automatically released when hwrm_req_send() returns. 4. If the caller wants to check the firmware response, the caller must call hwrm_req_hold() to take ownership of the response buffer and release it afterwards using hwrm_req_drop(). The caller is no longer required to explicitly hold the hwrm_cmd_lock mutex to read the response. 5. Because the firmware commands and responses all have different sizes, some safeguards are added to the code. This patch maintains legacy API compatibiltiy, implementing the old API in terms of the new. The follow-on patches will convert all callers to use the new APIs. v2: Fix redefined writeq with parisc .config Fix "cast from pointer to integer of different size" warning in hwrm_calc_sentinel() Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 3c8c20db769cd68e299b487035825e026b1a6ce9 Author: Edwin Peer Date: Sun Aug 29 03:34:58 2021 -0400 bnxt_en: move HWRM API implementation into separate file Move all firmware messaging functions and definitions to new bnxt_hwrm.[ch]. The follow-on patches will make major modifications to these APIs. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 7b370ad77392455dccd77c121b48bc9f76a14cbe Author: Edwin Peer Date: Sun Aug 29 03:34:57 2021 -0400 bnxt_en: Refactor the HWRM_VER_GET firmware calls Refactor the code so that __bnxt_hwrm_ver_get() does not call bnxt_hwrm_do_send_msg() directly. The new APIs will not expose this internal call. Add a new bnxt_hwrm_poll() to poll the HWRM_VER_GET firmware call silently. The other bnxt_hwrm_ver_get() function will send the HWRM_VER_GET message directly with error logs enabled. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6c172d59ad79d3973e393ba49d819ed6f0417202 Author: Edwin Peer Date: Sun Aug 29 03:34:56 2021 -0400 bnxt_en: remove DMA mapping for KONG response The additional response buffer serves no useful purpose. There can be only one firmware command in flight due to the hwrm_cmd_lock mutex, which is taken for the entire duration of any command completion, KONG or otherwise. It is thus safe to share a single DMA buffer. Removing the code associated with the additional mapping will simplify matters in the next patch, which allocates response buffers from DMA pools on a per request basis. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ab9c13a4b539709c7a080089b34de1bf4d1024d0 Author: Christophe JAILLET Date: Mon Aug 23 23:30:39 2021 +0200 parisc/parport_gsc: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller commit 6ef4661cad32b5098ffb31be3282c866befde85f Author: Masahiro Yamada Date: Thu Aug 12 01:41:16 2021 +0900 parisc: move core-y in arch/parisc/Makefile to arch/parisc/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Helge Deller commit 0c38502cee6f63a27c7af476948eac18e067d5ff Author: Christophe JAILLET Date: Sun Aug 22 22:29:01 2021 +0200 parisc: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller commit 87875c1084a28364dad8cd4f9ecbfdfe0b845ad5 Author: Uwe Kleine-König Date: Sat Aug 7 11:19:27 2021 +0200 parisc: Make struct parisc_driver::remove() return void The caller of this function (parisc_driver_remove() in arch/parisc/kernel/drivers.c) ignores the return value, so better don't return any value at all to not wake wrong expectations in driver authors. The only function that could return a non-zero value before was ipmi_parisc_remove() which returns the return value of ipmi_si_remove_by_dev(). Make this function return void, too, as for all other callers the value is ignored, too. Also fold in a small checkpatch fix for: WARNING: Unnecessary space before function pointer arguments + void (*remove) (struct parisc_device *dev); Acked-by: Dmitry Torokhov (for drivers/input) Signed-off-by: Uwe Kleine-König Acked-by: Sudip Mukherjee Acked-by: Jiri Slaby Signed-off-by: Helge Deller commit d220da0967dbda232350c5dc39317e04e0892743 Author: Masahiro Yamada Date: Wed Aug 25 00:48:20 2021 +0900 parisc: remove unused arch/parisc/boot/install.sh and its phony target Parisc has two similar installation scripts: arch/parisc/install.sh arch/parisc/boot/install.sh The latter is never used because 'make ARCH=parisc install' always invokes the 'install' target in arch/parisc/Makefile. The target in arch/parisc/boot/Makefile is not used either. Signed-off-by: Masahiro Yamada Signed-off-by: Helge Deller commit 7bf82eb3873fbbee8273f60ddef584194b99f6c1 Author: Matthew Wilcox (Oracle) Date: Thu Jul 15 14:46:12 2021 +0100 parisc: Rename PMD_ORDER to PMD_TABLE_ORDER This is the order of the page table allocation, not the order of a PMD. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Helge Deller commit 7f2dcc7371c1ab6e5d3678a7eff1cb0eb9725de9 Author: Kees Cook Date: Tue Aug 17 20:18:09 2021 -0700 parisc: math-emu: Avoid "fmt" macro collision The printk "fmt" macro was colliding. Rename like the others with a "bits" suffix. Fixes a build failure: arch/parisc/math-emu/decode_exc.c: In function 'decode_fpu': arch/parisc/math-emu/decode_exc.c:49:14: error: expected identifier before numeric constant 49 | #define fmt 11 /* bits 19 & 20 */ | ^~ ./include/linux/printk.h:379:6: note: in expansion of macro 'fmt' 379 | .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \ | ^~~ ./include/linux/printk.h:417:3: note: in expansion of macro '__printk_index_emit' 417 | __printk_index_emit(_fmt, NULL, NULL); \ | ^~~~~~~~~~~~~~~~~~~ ./include/linux/printk.h:446:26: note: in expansion of macro 'printk_index_wrap' 446 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ arch/parisc/math-emu/decode_exc.c:339:3: note: in expansion of macro 'printk' 339 | printk("%s(%d) Unknown FPU exception 0x%x\n", __FILE__, | ^~~~~~ Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Helge Deller commit 55b70eed81cba1331773d4aaf5cba2bb07475cd8 Author: Helge Deller Date: Wed Jul 7 15:38:08 2021 +0200 parisc: Increase size of gcc stack frame check parisc uses much bigger frames than other architectures, so increase the stack frame check value to avoid compiler warnings. Cc: Arnd Bergmann Cc: Abd-Alrhman Masalkhi Cc: Christoph Hellwig Signed-off-by: Helge Deller commit 7e07b7475b5274b4739511a0d81e29dd8198743b Author: Jinchao Wang Date: Sat Jun 26 18:20:52 2021 +0800 parisc: Replace symbolic permissions with octal permissions Resolve following checkpatch issue, Replace symbolic permissions with octal permissions Signed-off-by: Jinchao Wang Signed-off-by: Helge Deller commit dcf097e7d21fbdfbf20e473ac155f4d154018374 Author: Robert Marko Date: Thu Aug 26 13:02:39 2021 +0200 USB: serial: pl2303: fix GL type detection At least some PL2303GL have a bcdDevice of 0x405 instead of 0x100 as the datasheet claims. Add it to the list of known release numbers for the HXN (G) type. Fixes: 894758d0571d ("USB: serial: pl2303: tighten type HXN (G) detection") Signed-off-by: Robert Marko Cc: stable@vger.kernel.org # 5.13 Link: https://lore.kernel.org/r/20210826110239.5269-1-robert.marko@sartura.hr Signed-off-by: Johan Hovold commit f7b82b12626e10a2f5332b699cc79819ac8decc7 Merge: ea41a498cc646 4801bee7d5a36 Author: Takashi Iwai Date: Mon Aug 30 08:04:04 2021 +0200 Merge branch 'for-linus' into for-next commit e5c11ee3106072ef4b949eca93db160f55e6b55b Author: Vladimir Lypak Date: Tue Aug 10 16:44:33 2021 +0000 mailbox: qcom-apcs-ipc: Add compatible for MSM8953 SoC MSM8953 has an APCS block similar to MSM8916 but with different clocks which are spread over 2MB IO region next to it. Signed-off-by: Vladimir Lypak Signed-off-by: Sireesh Kodali Signed-off-by: Jassi Brar commit 04d2c3b7832c04e1daa27aa29403dff3d819cac3 Author: Vladimir Lypak Date: Tue Aug 10 16:44:26 2021 +0000 dt-bindings: mailbox: Add compatible for the MSM8953 Add the mailbox compatible for the MSM8953 SoC. Signed-off-by: Vladimir Lypak Signed-off-by: Sireesh Kodali Signed-off-by: Jassi Brar commit fb339971bfc4266f8af35c7d966f31cf67fe83ce Author: Konrad Dybcio Date: Fri Aug 20 22:31:05 2021 +0200 dt-bindings: mailbox: qcom-ipcc: Add compatible for SM6350 Add IPCC compatible for SM6350 SoC. Signed-off-by: Konrad Dybcio Signed-off-by: Jassi Brar commit dc2b8edfa3b3e691fa43694c4bd1e16b682393e1 Author: Iskren Chernev Date: Sun Jun 27 21:58:28 2021 +0300 mailbox: qcom: Add support for SM6115 APCS IPC Qcom SM4250/6115, have APCS mailbox setup similar to msm8998 and msm8916. Signed-off-by: Iskren Chernev Signed-off-by: Jassi Brar commit affa8da916e87c63086f5f1fdda8fe7b7b366972 Author: Iskren Chernev Date: Sun Jun 27 21:58:27 2021 +0300 dt-bindings: mailbox: qcom: Add SM6115 APCS compatible Add compatible for the Qualcomm SM4250/6115 APCS block to the Qualcomm APCS binding. Signed-off-by: Iskren Chernev Acked-by: Rob Herring Signed-off-by: Jassi Brar commit 8b60ed2b1674b78ebc433a11efa7d48821229037 Author: Yongqiang Niu Date: Mon Aug 2 15:52:26 2021 +0800 soc: mediatek: cmdq: add address shift in jump Add address shift when compose jump instruction to compatible with 35bit format. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Yongqiang Niu Reviewed-by: Nicolas Boichat Signed-off-by: Jassi Brar commit 84fd4201b78b96f8d31f6a2624be27ad6306a9bc Author: Yongqiang Niu Date: Mon Aug 2 15:46:05 2021 +0800 mailbox: cmdq: add mt8192 support add mt8192 support Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Signed-off-by: Jassi Brar commit 5f48ed2e812e6d084b106ed8fae6212f7dddb70b Author: Yongqiang Niu Date: Mon Aug 2 15:46:03 2021 +0800 dt-binding: gce: add gce header file for mt8192 Add documentation for the mt8192 gce. Add gce header file defined the gce hardware event, subsys number and constant for mt8192. Signed-off-by: Yongqiang Niu Reviewed-by: Rob Herring Signed-off-by: Hsin-Yi Wang Signed-off-by: Jassi Brar commit f0712ace7fe0723b40733c3b98591d34c1b0bfb9 Author: Taniya Das Date: Mon Aug 23 15:45:46 2021 +0530 cpufreq: qcom-hw: Set dvfs_possible_from_any_cpu cpufreq driver flag As remote cpufreq updates are supported on QCOM platforms, set dvfs_possible_from_any_cpu cpufreq driver flag. Signed-off-by: Taniya Das Signed-off-by: Viresh Kumar commit 5e79d6d9ea00c273f3efbced841212de85a384d1 Author: Bjorn Andersson Date: Fri Aug 20 14:57:00 2021 -0700 cpufreq: blocklist more Qualcomm platforms in cpufreq-dt-platdev The Qualcomm sa8155p, sm6350, sm8250 and sm8350 platforms also uses the qcom-cpufreq-hw driver, so add them to the cpufreq-dt-platdev driver's blocklist. Signed-off-by: Bjorn Andersson Signed-off-by: Viresh Kumar commit 275157b367f479334f3e2df7be93a3dd772f359c Author: Thara Gopinath Date: Mon Aug 9 15:16:01 2021 -0400 cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support Add interrupt support to notify the kernel of h/w initiated frequency throttling by LMh. Convey this to scheduler via thermal presssure interface. Signed-off-by: Thara Gopinath [Viresh: Added changes for arch_topology.c to fix build errors ] Signed-off-by: Viresh Kumar commit 37f188318ea3f1da75b32df3b1a19f45d9840652 Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: scmi: Use .register_em() to register with energy model Set the newly added .register_em() callback to register with the EM after the cpufreq policy is properly initialized. Acked-by: Sudeep Holla Signed-off-by: Viresh Kumar commit 3fd23111185d2167696547d59235bda8d307425c Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: vexpress: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Acked-by: Sudeep Holla Signed-off-by: Viresh Kumar commit 4d584efae0b28928011dd5b3b9b3a3ac4324bcac Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: scpi: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Acked-by: Sudeep Holla Signed-off-by: Viresh Kumar commit d8037ae359a6fb0f347a842a860e778aae808cd0 Author: Joyce Ooi Date: Thu Jul 1 14:57:35 2021 +0800 MAINTAINERS: Replace Ley Foon Tan as Altera Mailbox maintainer This patch replaces Ley Foon Tan as Altera Mailbox maintainer as she has moved to a different role. Signed-off-by: Joyce Ooi Acked-by: Ley Foon Tan Signed-off-by: Jassi Brar commit 8d7e5908c0bcf8a0abc437385e58e49abab11a93 Author: Amit Pundir Date: Fri Jul 16 13:19:46 2021 +0530 mailbox: qcom-ipcc: Enable loading QCOM_IPCC as a module This patch enables the qcom_ipcc driver to be loaded as a module. IPCC is fairly core to system, so as such it should never be unloaded. It registers as a mailbox + irq controller and the irq controller drivers in kernel are not supposed to be unloaded as they don't have the visibility over the clients consuming the irqs. Hence adding supress_bind_attrs to disable bind/unbind via sysfs. Signed-off-by: Amit Pundir Reviewed-by: Manivannan Sadhasivam Signed-off-by: Jassi Brar commit 23e6a7ca464ed2b9d949520e07f7e0735bc025f4 Author: Randy Dunlap Date: Fri Jul 23 11:25:58 2021 -0700 mailbox: sti: quieten kernel-doc warnings Use kernel-doc struct notation for the mailbox structs to prevent these kernel-doc warnings: drivers/mailbox/mailbox-sti.c:39: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * STi Mailbox device data drivers/mailbox/mailbox-sti.c:63: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * STi Mailbox platform specific configuration drivers/mailbox/mailbox-sti.c:74: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * STi Mailbox allocated channel information Also move the field descriptions ahead of the function description as is expected in kernel-doc. This prevents another kernel-doc warning. Fixes: 9ef4546cbd7e ("mailbox: Add support for ST's Mailbox IP") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Lee Jones Signed-off-by: Jassi Brar commit 1d78dfde33a02da1d816279c2e3452978b7abd39 Author: Alexey Kardashevskiy Date: Fri Aug 27 14:07:06 2021 +1000 KVM: PPC: Fix clearing never mapped TCEs in realmode Since commit e1a1ef84cd07 ("KVM: PPC: Book3S: Allocate guest TCEs on demand too"), pages for TCE tables for KVM guests are allocated only when needed. This allows skipping any update when clearing TCEs. This works mostly fine as TCE updates are handled when the MMU is enabled. The realmode handlers fail with H_TOO_HARD when pages are not yet allocated, except when clearing a TCE in which case KVM prints a warning and proceeds to dereference a NULL pointer, which crashes the host OS. This has not been caught so far as the change in commit e1a1ef84cd07 is reasonably new, and POWER9 runs mostly radix which does not use realmode handlers. With hash, the default TCE table is memset() by QEMU when the machine is reset which triggers page faults and the KVM TCE device's kvm_spapr_tce_fault() handles those with MMU on. And the huge DMA windows are not cleared by VMs which instead successfully create a DMA window big enough to map the VM memory 1:1 and then VMs just map everything without clearing. This started crashing now as commit 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") added a mode when a dymanic DMA window not big enough to map the VM memory 1:1 but it is used anyway, and the VM now is the first (i.e. not QEMU) to clear a just created table. Note that upstream QEMU needs to be modified to trigger the VM to trigger the host OS crash. This replaces WARN_ON_ONCE_RM() with a check and return, and adds another warning if TCE is not being cleared. Fixes: e1a1ef84cd07 ("KVM: PPC: Book3S: Allocate guest TCEs on demand too") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210827040706.517652-1-aik@ozlabs.ru commit 247141f5286b6a915dd225de076c29d8591e9a94 Author: Marek Vasut Date: Fri Jul 23 17:47:41 2021 -0700 dt-bindings: input: tsc2005: Convert to YAML schema Convert the TI TSC2004/TSC2005 DT bindings to YAML schema. Signed-off-by: Marek Vasut Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210620210708.100147-1-marex@denx.de Signed-off-by: Dmitry Torokhov commit 62e4fe9f608f4eda65942f4e492fafdf4ff0381a Author: Alexander Sverdlin Date: Mon Jun 14 10:38:56 2021 -0700 Input: ep93xx_keypad - prepare clock before using it Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework. Signed-off-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20210613233041.128961-4-alexander.sverdlin@gmail.com Signed-off-by: Dmitry Torokhov commit 7a3f5b0de3647c854e34269c3332d7a1e902901a Author: Ryoga Saito Date: Tue Aug 17 08:39:37 2021 +0000 netfilter: add netfilter hooks to SRv6 data plane This patch introduces netfilter hooks for solving the problem that conntrack couldn't record both inner flows and outer flows. This patch also introduces a new sysctl toggle for enabling lightweight tunnel netfilter hooks. Signed-off-by: Ryoga Saito Signed-off-by: Pablo Neira Ayuso commit 8f0284f190e6a0aa09015090568c03f18288231a Merge: 5bea1c8ce673a 61d861cf47857 Author: Dave Airlie Date: Mon Aug 30 09:06:01 2021 +1000 Merge tag 'amd-drm-next-5.15-2021-08-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.15-2021-08-27: amdgpu: - PLL fix for SI - Misc code cleanups - RAS fixes - PSP cleanups - Polaris UVD/VCE suspend fixes - aldebaran fixes - DCN3.x mclk fixes amdkfd: - CWSR fixes for arcturus and aldebaran - SVM fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210827192336.4649-1-alexander.deucher@amd.com commit 5bea1c8ce673ad93253f4b327277c011049ba24d Merge: 7d8eb202719b9 fb43ebc83e069 Author: Dave Airlie Date: Mon Aug 30 09:04:47 2021 +1000 Merge tag 'drm-intel-next-fixes-2021-08-26' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 fixes for v5.15-rc1: - Disable underrun recovery with eDP MSO panels on ADL-P - Use designated initializers for init/exit table - Fix some error pointer usages Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87r1egd1cg.fsf@intel.com commit f1042b6ccb887f07301f6b096b3d0cfcf9189323 Author: Pavel Begunkov Date: Sat Aug 28 19:54:39 2021 -0600 io_uring: allow updating linked timeouts We allow updating normal timeouts, add support for adjusting timings of linked timeouts as well. Reported-by: Victor Stewart Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit ef9dd637084d437463f5e9efa153dfc94e7e5f08 Author: Pavel Begunkov Date: Sat Aug 28 19:54:38 2021 -0600 io_uring: keep ltimeouts in a list A preparation patch. Keep all queued linked timeout in a list, so they may be found and updated. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 47fb0cfdb7a71a8a0ff8fe1d117363dc81f6ca77 Merge: 00ed1401a0058 6e3b473ee0644 Author: Thomas Gleixner Date: Sun Aug 29 21:19:50 2021 +0200 Merge tag 'irqchip-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - API updates: - Treewide conversion to generic_handle_domain_irq() for anything that looks like a chained interrupt controller - Update the irqdomain documentation - Use of bitmap_zalloc() throughout the tree - New functionalities: - Support for GICv3 EPPI partitions - Fixes: - Qualcomm PDC hierarchy fixes - Yet another priority decoding fix for the GICv3 pseudo-NMIs - Fix the apple-aic driver irq_eoi() callback to always unmask the interrupt - Properly handle edge interrupts on loongson-pch-pic - Let the mtk-sysirq driver advertise IRQCHIP_SKIP_SET_WAKE Link: https://lore.kernel.org/r/20210828121013.2647964-1-maz@kernel.org commit 27115441b938b0287471ac351041dbac81095178 Author: Arnd Bergmann Date: Mon Mar 22 22:50:41 2021 +0100 clk: tegra: fix old-style declaration With extra warnings enabled, gcc complains about a slightly odd prototype: drivers/clk/tegra/clk-dfll.c:1380:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration] 1380 | static void inline dfll_debug_init(struct tegra_dfll *td) { } Move the 'inline' keyword to the start of the line. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210322215047.1062540-1-arnd@kernel.org Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit eaf2aaec0be4623b1d19f5c6ef770a78a91cf460 Merge: 3dcc1edcbbc68 8d4be124062bd Author: David S. Miller Date: Sun Aug 29 15:11:16 2021 +0100 Merge tag 'wireless-drivers-next-2021-08-29' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== pull-request: wireless-drivers-next-2021-08-29 here's a pull request to net-next tree, more info below. Please let me know if there are any problems. wireless-drivers-next patches for v5.15 Second, and most likely last, set of patches for v5.15. Lots of iwlwifi patches this time, but smaller changes to other drivers as well. Nothing special standing out. Major changes: rtw88 * add quirk to disable pci caps on HP Pavilion 14-ce0xxx brcmfmac * Add WPA3 Personal with FT to supported cipher suites wcn36xx * allow firmware name to be overridden by DT iwlwifi * support scanning hidden 6GHz networks * support for a new hardware family (Bz) * support for new firmware API versions mwifiex * add reset_d3cold quirk for Surface gen4+ devices ==================== Signed-off-by: David S. Miller commit 50c1df2b56e0f581b1dbf334dbf807d6fb8f77b2 Author: Jens Axboe Date: Fri Aug 27 17:11:06 2021 -0600 io_uring: support CLOCK_BOOTTIME/REALTIME for timeouts Certain use cases want to use CLOCK_BOOTTIME or CLOCK_REALTIME rather than CLOCK_MONOTONIC, instead of the default CLOCK_MONOTONIC. Add an IORING_TIMEOUT_BOOTTIME and IORING_TIMEOUT_REALTIME flag that allows timeouts and linked timeouts to use the selected clock source. Only one clock source may be selected, and we -EINVAL the request if more than one is given. If neither BOOTIME nor REALTIME are selected, the previous default of MONOTONIC is used. Link: https://github.com/axboe/liburing/issues/369 Signed-off-by: Jens Axboe commit 2e480058ddc21ec53a10e8b41623e245e908bdbc Author: Jens Axboe Date: Fri Aug 27 11:33:19 2021 -0600 io-wq: provide a way to limit max number of workers io-wq divides work into two categories: 1) Work that completes in a bounded time, like reading from a regular file or a block device. This type of work is limited based on the size of the SQ ring. 2) Work that may never complete, we call this unbounded work. The amount of workers here is just limited by RLIMIT_NPROC. For various uses cases, it's handy to have the kernel limit the maximum amount of pending workers for both categories. Provide a way to do with with a new IORING_REGISTER_IOWQ_MAX_WORKERS operation. IORING_REGISTER_IOWQ_MAX_WORKERS takes an array of two integers and sets the max worker count to what is being passed in for each category. The old values are returned into that same array. If 0 is being passed in for either category, it simply returns the current value. The value is capped at RLIMIT_NPROC. This actually isn't that important as it's more of a hint, if we're exceeding the value then our attempt to fork a new worker will fail. This happens naturally already if more than one node is in the system, as these values are per-node internally for io-wq. Reported-by: Johannes Lundberg Link: https://github.com/axboe/liburing/issues/420 Signed-off-by: Jens Axboe commit e037e36c35c2587879ba6db90e626ffd9d3e2618 Author: Sanjay R Mehta Date: Sat Aug 28 14:28:28 2021 -0500 dmaengine: ptdma: remove PT_OFFSET to avoid redefnition Building on ARCH=um causes a "redefined" warning, so remove this PT_OFFSET macro to avoid the warning. drivers/dma/ptdma/ptdma.h:34: warning: "PT_OFFSET" redefined 34 | #define PT_OFFSET 0x0 | In file included from ./arch/um/include/asm/thread_info.h:17, from ./include/linux/thread_info.h:60, from ./include/asm-generic/preempt.h:5, from ./arch/um/include/generated/asm/preempt.h:1, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from ./include/linux/debugfs.h:15, from drivers/dma/ptdma/ptdma-debugfs.c:12: ./arch/x86/um/shared/sysdep/ptrace_user.h:4: note: this is the location of the previous definition 4 | #define PT_OFFSET(r) ((r) * sizeof(long)) Reported-by: kernel test robot Fixes: 2a99524459ce ("dmaengine: ptdma: Initial driver for the AMD PTDMA") Signed-off-by: Sanjay R Mehta Link: https://lore.kernel.org/r/1630178908-54973-1-git-send-email-Sanju.Mehta@amd.com Signed-off-by: Vinod Koul commit e2fb2e2a33fae6009bf68574a7eec8fcfdf9c78e Author: Sanjay R Mehta Date: Tue Aug 17 08:55:59 2021 -0500 dmaengine: ptdma: Add debugfs entries for PTDMA Expose data about the configuration and operation of the PTDMA through debugfs entries: device name, capabilities, configuration, statistics. Signed-off-by: Sanjay R Mehta Link: https://lore.kernel.org/r/1629208559-51964-4-git-send-email-Sanju.Mehta@amd.com Signed-off-by: Vinod Koul commit b0b4a6b10577a2e7eaf36f46781f4759b03321a7 Author: Sanjay R Mehta Date: Tue Aug 17 08:55:58 2021 -0500 dmaengine: ptdma: register PTDMA controller as a DMA resource Register ptdma queue to Linux dmaengine framework as general-purpose DMA channels. Signed-off-by: Sanjay R Mehta Link: https://lore.kernel.org/r/1629208559-51964-3-git-send-email-Sanju.Mehta@amd.com Signed-off-by: Vinod Koul commit fa5d823b16a9442d609617abeec31da8b6afa224 Author: Sanjay R Mehta Date: Tue Aug 17 08:55:57 2021 -0500 dmaengine: ptdma: Initial driver for the AMD PTDMA Add support for AMD PTDMA controller. It performs high-bandwidth memory to memory and IO copy operation. Device commands are managed via a circular queue of 'descriptors', each of which specifies source and destination addresses for copying a single buffer of data. Signed-off-by: Sanjay R Mehta Link: https://lore.kernel.org/r/1629208559-51964-2-git-send-email-Sanju.Mehta@amd.com Signed-off-by: Vinod Koul commit 64d57d2c64e56ceac85554cd0f653ca3a12aaa9a Author: Colin Ian King Date: Thu Aug 26 13:25:00 2021 +0100 dmaengine: fsl-dpaa2-qdma: Fix spelling mistake "faile" -> "failed" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210826122500.13743-1-colin.king@canonical.com Signed-off-by: Vinod Koul commit cf84a4b968f38383534bcd0484385c9254828b2c Author: Dave Jiang Date: Tue Aug 24 14:24:27 2021 -0700 dmaengine: idxd: remove interrupt disable for dev_lock The spinlock is not being used in hard interrupt context. There is no need to disable irq when acquiring the lock. The interrupt thread handler also is not in bottom half context, therefore we can also remove disabling of the bh. Convert all dev_lock acquisition to plain spin_lock() calls. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162984026772.1939166.11504067782824765879.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit f9f4082dbc56c40093bcb5c1f62c04a916eca9a2 Author: Dave Jiang Date: Tue Aug 24 14:24:39 2021 -0700 dmaengine: idxd: remove interrupt disable for cmd_lock The cmd_lock spinlock is not being used in hard interrupt context. There is no need to disable irq when acquiring the lock. Convert all cmd_lock acquisition to plain spin_lock() calls. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162984027930.1939209.15758413737332339204.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit d8071323c5632bdf0a8ef9b9e5662fac43649f9d Author: Dave Jiang Date: Thu Aug 19 09:34:06 2021 -0700 dmaengine: idxd: fix setting up priv mode for dwq DSA spec says WQ priv bit is 0 if the Privileged Mode Enable field of the PCI Express PASID capability is 0 and pasid is enabled. Make sure that the WQCFG priv field is set correctly according to usage type. Reject config if setting up kernel WQ type and no support. Also add the correct priv setup for a descriptor. Fixes: 484f910e93b4 ("dmaengine: idxd: fix wq config registers offset programming") Cc: Ramesh Thomas Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162939084657.903168.14160019185148244596.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit aac6c0f90799d66b8989be1e056408f33fd99fe6 Author: Radhey Shyam Pandey Date: Thu Aug 19 14:28:48 2021 +0530 dmaengine: xilinx_dma: Set DMA mask for coherent APIs The xilinx dma driver uses the consistent allocations, so for correct operation also set the DMA mask for coherent APIs. It fixes the below kernel crash with dmatest client when DMA IP is configured with 64-bit address width and linux is booted from high (>4GB) memory. Call trace: [ 489.531257] dma_alloc_from_pool+0x8c/0x1c0 [ 489.535431] dma_direct_alloc+0x284/0x330 [ 489.539432] dma_alloc_attrs+0x80/0xf0 [ 489.543174] dma_pool_alloc+0x160/0x2c0 [ 489.547003] xilinx_cdma_prep_memcpy+0xa4/0x180 [ 489.551524] dmatest_func+0x3cc/0x114c [ 489.555266] kthread+0x124/0x130 [ 489.558486] ret_from_fork+0x10/0x3c [ 489.562051] ---[ end trace 248625b2d596a90a ]--- Signed-off-by: Radhey Shyam Pandey Reviewed-by: Harini Katakam Link: https://lore.kernel.org/r/1629363528-30347-1-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul commit 5e70a09c54c4d7ce8c8a573005889a5301cda4c4 Author: Pratyush Yadav Date: Thu Aug 19 16:31:05 2021 +0530 dmaengine: ti: k3-psil-j721e: Add entry for CSI2RX The CSI2RX subsystem on J721E is serviced by UDMA via PSI-L to transfer frames to memory. It can have up to 32 threads per instance. J721E has two instances of the subsystem, so there are 64 threads total. Add them to the endpoint map. Signed-off-by: Pratyush Yadav Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210819110106.31409-1-p.yadav@ti.com Signed-off-by: Vinod Koul commit 5000d37042a61ca556fde2782ca40dbfa802ea16 Author: Biju Das Date: Fri Aug 6 10:53:22 2021 +0100 dmaengine: sh: Add DMAC driver for RZ/G2L SoC Add DMA Controller driver for RZ/G2L SoC. Based on the work done by Chris Brandt for RZ/A DMA driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210806095322.2326-4-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit ab959c7d4ea086852f35c7ff20ecd79b7471cfad Author: Biju Das Date: Fri Aug 6 10:53:21 2021 +0100 dmaengine: Extend the dma_slave_width for 128 bytes Add DMA_SLAVE_BUSWIDTH_128_BYTES to dma_slave_width for DMA engines and users to select 128 bytes as bus width. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210806095322.2326-3-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit 9b9b12537d3a7b5bea6b9e8f20bffc2338724269 Author: Biju Das Date: Fri Aug 6 10:53:20 2021 +0100 dt-bindings: dma: Document RZ/G2L bindings Document RZ/G2L DMAC bindings. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210806095322.2326-2-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit b5b0eba590f08e2b06c830b8343c1da7059c7a88 Merge: 461d971215dfb c7e9d0020361f Author: Jens Axboe Date: Sun Aug 29 06:50:58 2021 -0600 Merge tag 'floppy-for-5.15' of https://github.com/evdenis/linux-floppy into for-5.15/drivers Pull floppy fix from Denis: "Bring back O_NDELAY for floppy Only one commit this time with revert of O_NDELAY removal for the floppy. Users reported that the commit breaks userspace utils and known floppy workflow patterns. We already reverted the same commit back in 2016 presumably for the same reason. Completely drop O_NDELAY for floppy seems excessive to solve problems it introduces. I started to write basic selftests for the floppy to prevent this kind of userspace breaks in the future. Signed-off-by: Denis Efremov " * tag 'floppy-for-5.15' of https://github.com/evdenis/linux-floppy: Revert "floppy: reintroduce O_NDELAY fix" commit 8d4be124062bddbb2bcb887702a0601b790b9a83 Author: Jing Yangyang Date: Mon Aug 23 23:13:41 2021 -0700 ssb: fix boolreturn.cocci warning ./include/linux/ssb/ssb_driver_extif.h:200:8-9:WARNING: return of 0/1 in function 'ssb_extif_available' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210824061341.59255-1-deng.changcheng@zte.com.cn commit ebe9e6514b40f8aac7387466b898541b84c4ef1f Author: Christophe JAILLET Date: Sun Aug 22 10:03:50 2021 +0200 intel: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/f55043d0c847bfae60087707778563cf732a7bf9.1629619229.git.christophe.jaillet@wanadoo.fr commit a847666accf2c1d4f4ed6c50be43dbc30ebc3a11 Author: Tsuchiya Yuto Date: Fri Aug 20 16:20:50 2021 +0200 mwifiex: pcie: add reset_d3cold quirk for Surface gen4+ devices To reset mwifiex on Surface gen4+ (Pro 4 or later gen) devices, it seems that putting the wifi device into D3cold is required according to errata.inf file on Windows installation (Windows/INF/errata.inf). This patch adds a function that performs power-cycle (put into D3cold then D0) and call the function at the end of reset_prepare(). Note: Need to also reset the parent device (bridge) of wifi on SB1; it might be because the bridge of wifi always reports it's in D3hot. When I tried to reset only the wifi device (not touching parent), it gave the following error and the reset failed: acpi device:4b: Cannot transition to power state D0 for parent in D3hot mwifiex_pcie 0000:03:00.0: can't change power state from D3cold to D0 (config space inaccessible) Signed-off-by: Tsuchiya Yuto Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210820142050.35741-3-verdre@v0yd.nl commit 5448bc2a426c2199db9b8bd87ae2b5c06b77ef92 Author: Jonas Dreßler Date: Fri Aug 20 16:20:49 2021 +0200 mwifiex: pcie: add DMI-based quirk implementation for Surface devices This commit adds the ability to apply device-specific quirks to the mwifiex driver. It uses DMI matching similar to the quirks brcmfmac uses with dmi.c. We'll add identifiers to match various MS Surface devices, which this is primarily meant for, later. This commit is a slightly modified version of a previous patch sent in by Tsuchiya Yuto. Co-developed-by: Tsuchiya Yuto Signed-off-by: Tsuchiya Yuto Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210820142050.35741-2-verdre@v0yd.nl commit d745ca4f2c4ae9f1bd8cf7d8ac6e22d739bffd19 Author: Ahmad Fatoum Date: Tue Aug 17 08:35:22 2021 +0200 brcmfmac: pcie: fix oops on failure to resume and reprobe When resuming from suspend, brcmf_pcie_pm_leave_D3 will first attempt a hot resume and then fall back to removing the PCI device and then reprobing. If this probe fails, the kernel will oops, because brcmf_err, which is called to report the failure will dereference the stale bus pointer. Open code and use the default bus-less brcmf_err to avoid this. Fixes: 8602e62441ab ("brcmfmac: pass bus to the __brcmf_err() in pcie.c") Signed-off-by: Ahmad Fatoum Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210817063521.22450-1-a.fatoum@pengutronix.de commit 9fc8048c56f33e0e969844a2f1b1e89cf30ee5ba Author: Zenghui Yu Date: Tue Jul 27 10:52:32 2021 +0800 bcma: Drop the unused parameter of bcma_scan_read32() As it had never been used since the initial commit 8369ae33b705 ("bcma: add Broadcom specific AMBA bus driver"). Signed-off-by: Zenghui Yu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210727025232.663-3-yuzenghui@huawei.com commit b63aed3ff195130fef12e0af590f4838cf0201d8 Author: Zenghui Yu Date: Tue Jul 27 10:52:31 2021 +0800 bcma: Fix memory leak for internally-handled cores kmemleak reported that dev_name() of internally-handled cores were leaked on driver unbinding. Let's use device_initialize() to take refcounts for them and put_device() to properly free the related stuff. While looking at it, there's another potential issue for those which should be *registered* into driver core. If device_register() failed, we put device once and freed bcma_device structures. In bcma_unregister_cores(), they're treated as unregistered and we hit both UAF and double-free. That smells not good and has also been fixed now. Fixes: ab54bc8460b5 ("bcma: fill core details for every device") Signed-off-by: Zenghui Yu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210727025232.663-2-yuzenghui@huawei.com commit 71f8817c28e2e1e5549138e2aef68c2fd784e162 Author: Paul Cercueil Date: Mon Aug 23 18:34:05 2021 +0100 MIPS: ingenic: Unconditionally enable clock of CPU #0 Make sure that the PLL that feeds the CPU won't be stopped while the kernel is running. This fixes a problem on JZ4760 (and probably others) where under very specific conditions, the main PLL would be turned OFF when the kernel was shutting down, causing the shutdown process to fail. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit aee7c86a61c7b846ece6ee462a1145f2a209f24c Merge: a0929621eb498 e257d969f3650 Author: Kalle Valo Date: Sun Aug 29 13:20:48 2021 +0300 Merge commit 'e257d969f36503b8eb1240f32653a1afb3109f86' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next I think last commits in tag iwlwifi-next-for-kalle-2021-08-26 are not ready yet so I'm skipping those and pulling an earlier commit. I modified Luca's description below to not include the skipped commits. iwlwifi patches for v5.15 * Support scanning hidden 6GHz networks; * Some improvements in the FW error dumps; * Add some HE capability flags * A bunch of janitorial clean-ups; * Clean-ups in the TX code; * Small fix for SMPS; * Support for a new hardware family (Bz); * Small fix in the scan code; * A bunch of changes in the D3 code, including new FW API; * Finalize the refactoring of 6GHz scan; * Initial changes in the SAR profile code; * Fix reading one of our ACPI tables (WTAS); * Support some new ACPI table revisions; * Support new API of the WoWlan status FW notification; * Fixes in SAR ACPI tables handling; * Some debugging improvements; * Fix in ROC; * Support for new FW API versions; * Support new FW command versions; * Some other small fixes, clean-ups and improvements. commit 3dcc1edcbbc68991e7b3b1be6a6a7962a730fa35 Author: Li RongQing Date: Thu Aug 26 16:21:35 2021 +0800 virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq smp_processor_id()/raw* will be called once each when not more queues in virtnet_xdp_get_sq() which is called in non-preemptible context, so it's safe to call the function smp_processor_id() once. Signed-off-by: Li RongQing Signed-off-by: David S. Miller commit 9b0df250a708ed9de9552fdf543f070fe930e7ea Author: Christophe JAILLET Date: Fri Aug 27 22:06:37 2021 +0200 niu: switch from 'pci_' to 'dma_' API In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation Only relevant parts are given below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. Finally, the now useless 'dma_mask' variable has been removed. It has been compile tested. @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit a3ba7fd1d3bf6ce68a06632e755c18ae56cb1a7a Author: Christophe JAILLET Date: Fri Aug 27 22:00:57 2021 +0200 fddi: switch from 'pci_' to 'dma_' API In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation Only relevant parts are given below. It has been compile tested. @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 27d57f85102b3746f19ccd7b79c3a7f8aa8b8714 Author: Christophe JAILLET Date: Fri Aug 27 21:56:28 2021 +0200 net: spider_net: switch from 'pci_' to 'dma_' API In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation Only relevant parts are given below. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Signed-off-by: Christophe JAILLET Acked-by: Geoff Levand Signed-off-by: David S. Miller commit dce677da57c0edac7a53f1fce58fca180b7ea89b Author: Subbaraya Sundeep Date: Fri Aug 27 19:00:55 2021 +0530 octeontx2-pf: Add vlan-etype to ntuple filters NPC extraction profile marks layer types NPC_LT_LB_CTAG for CTAG and NPC_LT_LB_STAG_QINQ for STAG after parsing input packet. Those layer types can be used to install ntuple filters using vlan-etype option. Below are the commands and corresponding behavior with this patch in place. > alias nt "ethtool -U eth0 flow-type ether" > nt vlan 5 m 0xf000 action 0 Input packets with outer VLAN id as 5 i.e, stag packets with VLAN id 5 and ctag packets with VLAN id as 5 are hit. > nt vlan-etype 0x8100 action 0 All input ctag packets with any VLAN id are hit. > nt vlan-etype 0x88A8 action 0 All input stag packets with any VLAN id are hit. > nt vlan-etype 0x8100 vlan 5 m 0xf000 action 0 All input ctag packets with VLAN id 5 are hit. > nt vlan-etype 0x88A8 vlan 5 m 0xf000 action 0 All input stag packets with VLAN id 5 are hit. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 57f780f1c43362b86fd23d20bd940e2468237716 Author: Sudarsana Reddy Kalluru Date: Fri Aug 27 04:52:25 2021 -0700 atlantic: Fix driver resume flow. Driver crashes when restoring from the Hibernate. In the resume flow, driver need to clean up the older nic/vec objects and re-initialize them. Fixes: 8aaa112a57c1d ("net: atlantic: refactoring pm logic") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit c7cd6c5a460c92a58a0074936250462f539fa80d Author: Sunil Goutham Date: Fri Aug 27 17:16:44 2021 +0530 octeontx2-af: Fix inconsistent license text Fixed inconsistent license text across the RVU admin function driver. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit cb0e3ec4e67923e00699e5ed59e5718ed159a344 Author: Sunil Goutham Date: Fri Aug 27 17:15:07 2021 +0530 octeontx2-pf: Fix inconsistent license text Fixed inconsistent license text across the netdev drivers. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit d65a606b90ee2d4abd9961aadc9c3c69b9691e04 Merge: c77225119daa0 1ab011b0bf073 Author: David S. Miller Date: Sun Aug 29 10:44:31 2021 +0100 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 2021-08-27 ravindhan Gunasekaran says: This adds support for Credit-based shaper qdisc offload from Traffic Control system. It enables traffic prioritization and bandwidth reservation via the Credit-Based Shaper which is implemented in hardware by i225 controller. Patch 1/3 adds a default cycle-time for TSN mode to be configured. Patch 2/3 helps to separate TSN mode programming on the fly and during reset sequence. It also simplifies handling features flags for various TSN modes supported by i225 in the driver. Patch 3/3 adds support for IEEE802.1Qav(CBS) standard implemented in i225 HW. Two sets of CBS HW shapers are present in i225 and driver enables them in the two high priority queues. ==================== Signed-off-by: David S. Miller commit a0929621eb49863645a0103109c466b01cb59ea2 Merge: 50cbbfd41e9f7 fd6729ec534cf Author: Kalle Valo Date: Sun Aug 29 11:56:22 2021 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.15. Major changes: wcn36xx * allow firmware name to be overridden by DT commit 50cbbfd41e9f7716baa976ae2d60309a088a246e Author: David Mosberger-Tang Date: Sat Aug 28 15:19:11 2021 +0000 wilc1000: Convert module-global "isinit" to device-specific variable Move static "isinit" variable to wilc_spi structure to allow multiple WILC1000 devices per machine. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210828151346.3012697-1-davidm@egauge.net commit 4b51de063d5310f1fb297388b7955926e63e45c9 Author: Paweł Drewniak Date: Tue Aug 24 23:13:30 2021 +0100 brcmfmac: Add WPA3 Personal with FT to supported cipher suites This allows the driver to connect to BSSIDs supporting SAE with 802.11r. Tested on Raspberry Pi 4 Model B (STA) and UniFi 6LR/OpenWRT 21.02.0-rc2. AP was set to 'sae-mixed' (WPA2/3 Personal). Signed-off-by: Paweł Drewniak Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210824221330.3847139-1-czajernia@gmail.com commit 81f9ebd43659320a88cae8ed5124c50b4d47ab66 Author: Linus Walleij Date: Sun Aug 22 01:58:00 2021 +0200 ssb: Drop legacy header include The SSB header only uses the legacy header to get struct gpio_chip so inluce which is the right include to deal with gpio_chip. Cc: Michael Buesch Cc: Kalle Valo Signed-off-by: Linus Walleij Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210821235800.138817-1-linus.walleij@linaro.org commit f4c813641897cfb43b3b99edd8c8851a1c98c70f Author: Colin Ian King Date: Thu Aug 19 13:50:18 2021 +0100 rsi: make array fsm_state static const, makes object smaller Don't populate the array fsm_state on the stack but instead it static const. Makes the object code smaller by 154 bytes: Before: text data bss dec hex filename 9213 3904 0 13117 333d .../wireless/rsi/rsi_91x_debugfs.o After: text data bss dec hex filename 8995 3968 0 12963 32a3 .../wireless/rsi/rsi_91x_debugfs.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210819125018.8577-1-colin.king@canonical.com commit 4801bee7d5a36c199b734a28cde5259183aff822 Author: Takashi Iwai Date: Sun Aug 29 09:38:30 2021 +0200 ALSA: usb-audio: Add lowlatency module option For making user to switch back to the old playback mode, this patch adds a new module option 'lowlatency' to snd-usb-audio driver. When user face a regression due to the recent low-latency playback support, they can test easily by passing lowlatency=0 option without rebuilding the kernel. Fixes: 307cc9baac5c ("ALSA: usb-audio: Reduce latency at playback start, take#2") Link: https://lore.kernel.org/r/20210829073830.22686-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 533ccdae76faa6fd8e0857ec494b264a5d87a191 Author: Nathan Chancellor Date: Mon Aug 23 15:20:14 2021 -0700 rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() Clang warns: drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning: variable 'place' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (chnl > 14) { ^~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:909:9: note: uninitialized use occurs here return place; ^~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:2: note: remove the 'if' if its condition is always true if (chnl > 14) { ^~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:899:10: note: initialize the variable 'place' to silence this warning u8 place; ^ = '\0' 1 warning generated. Commit 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations") removed the initialization of place but it appears that this removal was in the wrong function. _rtl92c_phy_get_rightchnlplace() returns place's value at the end of the function so now if the if statement is false, place never gets initialized. Add that initialization back to address the warning. place's initialization is not necessary in rtl92d_get_rightchnlplace_for_iqk() as place is only used within the if statement so it can be removed, which is likely what was intended in the first place. Fixes: 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations") Signed-off-by: Nathan Chancellor Acked-by: Ping-Ke Shih Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210823222014.764557-1-nathan@kernel.org commit 1d4dcaf3db9bd073cebf709d081957068de88bdc Author: Ugo Rémery Date: Sun Aug 22 14:49:32 2021 -0500 rtw88: add quirk to disable pci caps on HP Pavilion 14-ce0xxx 8821CE causes random freezes on HP Pavilion 14-ce0019nf. Add a quirk to disable pci ASPM capability. Signed-off-by: Ugo Rémery Signed-off-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210822194932.29630-1-Larry.Finger@lwfinger.net commit 131abae905df99f63d825e47b4df100d34f518ce Author: Konrad Dybcio Date: Fri Aug 20 22:36:24 2021 +0200 clk: qcom: Add SM6350 GCC driver This adds Global Clock controller (GCC) driver for SM6350 SoC Acked-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210820203624.232268-3-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit fd6729ec534cffbbeb3917761e6d1fe6a412d3fe Author: Dan Carpenter Date: Fri Aug 13 14:34:38 2021 +0300 ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point() This error path is unlikely because of it checked for NULL and returned -ENOMEM earlier in the function. But it should return an error code here as well if we ever do hit it because of a race condition or something. Fixes: bdcd81707973 ("Add ath6kl cleaned up driver") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210813113438.GB30697@kili commit 7c48662b9d56666219f526a71ace8c15e6e12f1f Author: Miaoqing Pan Date: Mon Aug 9 12:05:16 2021 +0800 ath9k: fix sleeping in atomic context The problem is that gpio_free() can sleep and the cfg_soc() can be called with spinlocks held. One problematic call tree is: --> ath_reset_internal() takes &sc->sc_pcu_lock spin lock --> ath9k_hw_reset() --> ath9k_hw_gpio_request_in() --> ath9k_hw_gpio_request() --> ath9k_hw_gpio_cfg_soc() Remove gpio_free(), use error message instead, so we should make sure there is no GPIO conflict. Also remove ath9k_hw_gpio_free() from ath9k_hw_apply_gpio_override(), as gpio_mask will never be set for SOC chips. Signed-off-by: Miaoqing Pan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1628481916-15030-1-git-send-email-miaoqing@codeaurora.org commit 23151b9ae79e3bc4f6a0c4cd3a7f355f68dad128 Author: Zekun Shen Date: Sat Jun 19 09:29:14 2021 -0400 ath9k: fix OOB read ar9300_eeprom_restore_internal Bad header can have large length field which can cause OOB. cptr is the last bytes for read, and the eeprom is parsed from high to low address. The OOB, triggered by the condition length > cptr could cause memory error with a read on negative index. There are some sanity check around length, but it is not compared with cptr (the remaining bytes). Here, the corrupted/bad EEPROM can cause panic. I was able to reproduce the crash, but I cannot find the log and the reproducer now. After I applied the patch, the bug is no longer reproducible. Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YM3xKsQJ0Hw2hjrc@Zekuns-MBP-16.fios-router.home commit 8678fd31f2d3eb14f2b8b39c9bc266f16fa24b22 Author: Loic Poulain Date: Thu Aug 26 17:46:08 2021 +0200 wcn36xx: Fix missing frame timestamp for beacon/probe-resp When receiving a beacon or probe response, we should update the boottime_ns field which is the timestamp the frame was received at. (cf mac80211.h) This fixes a scanning issue with Android since it relies on this timestamp to determine when the AP has been seen for the last time (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter). Signed-off-by: Loic Poulain Reviewed-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1629992768-23785-1-git-send-email-loic.poulain@linaro.org commit b7f96d5c79cd9584bb1193a3c9008bd1e2683906 Author: Bjorn Andersson Date: Tue Aug 24 10:12:25 2021 -0700 wcn36xx: Allow firmware name to be overridden by DT The WLAN NV firmware blob differs between platforms, and possibly devices, so add support in the wcn36xx driver for reading the path of this file from DT in order to allow these files to live in a generic file system (or linux-firmware). For some reason the parent (wcnss_ctrl) also needs to upload this blob, so rather than specifying the same information in both nodes wcn36xx reads the string from the parent's of_node. Signed-off-by: Bjorn Andersson Tested-by: Bryan O'Donoghue Tested-by: Aníbal Limón Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210824171225.686683-1-bjorn.andersson@linaro.org commit d195d7aac09bddabc2c8326fb02fcec2b0a2de02 Author: Joseph Gates Date: Wed Aug 18 13:31:43 2021 +0200 wcn36xx: Ensure finish scan is not requested before start scan If the operating channel is the first in the scan list, it was seen that a finish scan request would be sent before a start scan request was sent, causing the firmware to fail all future scans. Track the current channel being scanned to avoid requesting the scan finish before it starts. Cc: Fixes: 5973a2947430 ("wcn36xx: Fix software-driven scan") Signed-off-by: Joseph Gates Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1629286303-13179-1-git-send-email-loic.poulain@linaro.org commit faa6a1f9de51bc56a9384864ced067f5fa4f9bf7 Author: Krzysztof Kozlowski Date: Wed Aug 25 15:42:51 2021 +0200 MAINTAINERS: clock: include S3C and S5P in Samsung SoC clock entry Cover the S3C and S5Pv210 clock controller binding headers by Samsung SoC clock controller drivers maintainer entry. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20210825134251.220098-3-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 80204ac4bca95ff7f5f4e1022a98b0323a7f2e86 Author: Krzysztof Kozlowski Date: Wed Aug 25 15:42:50 2021 +0200 dt-bindings: clock: samsung: convert S5Pv210 AudSS to dtschema Convert Samsung S5Pv210 Audio SubSystem clock controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20210825134251.220098-2-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit e1ec390920888705e3a53b62dd594478a34ee610 Author: Krzysztof Kozlowski Date: Wed Aug 25 15:42:49 2021 +0200 dt-bindings: clock: samsung: convert Exynos AudSS to dtschema Convert Samsung Exynos Audio SubSystem clock controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20210825134251.220098-1-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 7ac615780926ae08bee9c13d940699d63155fa85 Author: Krzysztof Kozlowski Date: Wed Aug 25 15:40:53 2021 +0200 dt-bindings: clock: samsung: convert Exynos4 to dtschema Merge Exynos4210 and Exynos4412 clock controller bindings to existing DT schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210825134056.219884-6-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit e9385b93ffdd4c416c57fa460f3e824d9806bc8f Author: Krzysztof Kozlowski Date: Wed Aug 25 15:40:52 2021 +0200 dt-bindings: clock: samsung: convert Exynos3250 to dtschema Merge Exynos3250 clock controller bindings to existing DT schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210825134056.219884-5-krzysztof.kozlowski@canonical.com Signed-off-by: Stephen Boyd commit 41059b5d8b9ad833ce99d5964adbc0eef3f34ddb Author: Krzysztof Kozlowski Date: Wed Aug 25 15:40:51 2021 +0200 dt-bindings: clock: samsung: convert Exynos542x to dtschema Merge Exynos542x clock controller bindings to existing DT schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20210825134056.219884-4-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit ea7b028a00e4c24c5c51479ea540e0da8b79bb4a Author: Krzysztof Kozlowski Date: Wed Aug 25 15:40:50 2021 +0200 dt-bindings: clock: samsung: add bindings for Exynos external clock Document the bindings for Samsung Exynos external to SoC (oscclk/XXTI/XusbXTI) clock provided on boards. The bindings are already implemented in most of the Exynos clock drivers and DTS files. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210825134056.219884-3-krzysztof.kozlowski@canonical.com Signed-off-by: Stephen Boyd commit ae910bf9d8b22d9e590f4a2c76f0e62490ab5b41 Author: Krzysztof Kozlowski Date: Wed Aug 25 15:40:49 2021 +0200 dt-bindings: clock: samsung: convert Exynos5250 to dtschema Convert Samsung Exynos5250 clock controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20210825134056.219884-2-krzysztof.kozlowski@canonical.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit e62ada5e23d06dfeba2d3b098a9c70ac027c19b6 Author: Oded Gabbay Date: Wed Jul 14 11:01:21 2021 +0300 habanalabs: remove redundant warning message This warning is redundant as we will print a notice in case the device is still in use after the FD was closed. No need to print the same message per context. Signed-off-by: Oded Gabbay commit e4cdccd2ec0d178219dce0707aa2a63746119e3f Author: farah kassabri Date: Wed May 26 10:43:36 2021 +0300 habanalabs: add support for encapsulated signals submission This commit is the second part of the encapsulated signals feature. It contains the driver support for submission of cs with encapsulated signals and the wait for them. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit dadf17abb7245d9556591d8cc78bf57462e3b20a Author: farah kassabri Date: Mon May 24 18:09:22 2021 +0300 habanalabs: add support for encapsulated signals reservation The signaling from within encapsulated OP capability is merged into the existing stream architecture, such that one can trigger multiple signaling from an encapsulated op, according to the time the event was done in the graph execution and avoid the need to wait for the whole encapsulated OP execution to be complete before the stream can signal. This commit implements only the reserve/unreserve part. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 8ca2072ed8936076ae3ec7e508290a29be9024d8 Author: farah kassabri Date: Sun Jun 20 11:08:19 2021 +0300 habanalabs: signal/wait change sync object reset flow Currently the SOB reset was in fence release function which happens only at the CS wraparound during the CS allocation time. In order to support the new encapsulated signals reservation feature, we need to move the SOB reset to an earlier phase because this SOB could reach it's max value very fast using the signal reservation. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 215f0c1775d5506c8a833b5c85a77b5fb65bf26b Author: Ohad Sharabi Date: Mon Jun 14 22:18:41 2021 +0300 habanalabs: add wait-for-multi-CS uAPI When user sends multiple CSs, waiting for each CS is not efficient as it involves many user-kernel context switches. In order to address this issue we add support to "wait on multiple CSs" using a new uAPI which can wait on maximum of 32 CSs. The new uAPI is defined using a new flag - WAIT_FOR_MULTI_CS - in the wait_for_cs IOCTL. The input parameters for this uAPI will be: @seq: user pointer to an array of up to 32 CS's sequence numbers. @seq_array_len: length of sequence array. @timeout_us: timeout for waiting for any CS. The output paramateres for this API will be: @status: multi CS ioctl completion status (dedicated status was added as well). @flags: bitmap of output flags of the CS. @cs_completion_map: bitmap for multi CS, if CS sequence that was placed in index N in input seq array has completed- the N-th bit in cs_completion_map will be 1, otherwise it will be 0. @timestamp_nsec: timestamp of the first completed CS Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c457d5abf8d370d710132b28aa17ce528e0866e3 Author: Ohad Sharabi Date: Sun Jun 20 11:00:26 2021 +0300 habanalabs: get multiple fences under same cs_lock To add proper support for wait-for-multi-CS, locking the CS lock for each CS fence in the list is not efficient. Instead, this patch add support to lock the CS lock once to get all required fences. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a6cd2551d7874ce276ff64348471a9e22ce35020 Author: Oded Gabbay Date: Tue Jul 13 08:11:54 2021 +0300 habanalabs: revise prints on FD close The driver quietly handles memory mappings that were not freed so no need to print a warning about that when user closes the FD. Accordingly, revise the text that is printed in case the device is still in use after the user process closed the FD. Signed-off-by: Oded Gabbay commit 7886acb60b7d35fa265ea52b0c81f60229890055 Author: Oded Gabbay Date: Tue Jul 13 10:14:36 2021 +0300 habanalabs/goya: add missing initialization Need to initialize f/w Linux loaded indication to false to prevent wrong communication with the f/w. Signed-off-by: Oded Gabbay commit 2a2c4b74031423c181f330dcfde9fcf47d05dce8 Author: Oded Gabbay Date: Tue Jul 13 10:13:30 2021 +0300 habanalabs: update firmware header to latest version Add two new fields regarding interrupts communication between driver and f/w. Signed-off-by: Oded Gabbay commit 8bb8b505761238be0d6a83dc41188867d65e5d4c Author: Koby Elbaz Date: Tue Jul 6 20:50:33 2021 +0300 habanalabs: fix race between soft reset and heartbeat There is a scenario where an ongoing soft reset would race with an ongoing heartbeat routine, eventually causing heartbeat to fail and thus to escalate into a hard reset. With this fix, soft-reset procedure will disable heartbeat CPU messages and flush the (ongoing) current one before continuing with reset code. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ae2021d320e9b454ca4ea7b32fdf1d111d3902c4 Author: Oded Gabbay Date: Mon Jul 12 13:48:56 2021 +0300 habanalabs/gaudi: fix information printed on SM event Print the SM name instead of index because it is more informational for the user to know the SM name instead of id when a SM interrupt occurs. In addition, the index that is printed is of the SOB group, not a specific SOB. Signed-off-by: Oded Gabbay commit 7148e647a585075ee9996bc437c2ac95c5cea6bf Author: Ofir Bitton Date: Mon Jul 12 14:18:30 2021 +0300 habanalabs/gaudi: trigger state dump in case of SM errors State dump is relevant to the user in case of Sync Manager error, so we need to trigger it in that case as well. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a6946151110e8ec8c675c6709e03c15b30a85def Author: Oded Gabbay Date: Sun Jul 11 08:55:42 2021 +0300 habanalabs: set dma max segment size This is required from any device that is capable to perform DMA. Signed-off-by: Oded Gabbay commit 2b5bbef5e88c6ffce59f935417e9b729afb44756 Author: Oded Gabbay Date: Sat Jul 10 21:12:45 2021 +0300 habanalabs: add asic property of host dma offset Each ASIC can have a different offset to add to a host dma address, to enable the ASIC to access that host memory. The usage for this can be common code so add this to the asic property structure. Signed-off-by: Oded Gabbay commit d18bf13e225258b6ee5325fc7cce48059c7b871f Author: Oded Gabbay Date: Sat Jul 10 20:00:35 2021 +0300 habanalabs: fix type of variable Recently, the size parameter in userptr structure was change to u64. As a result, we need to change the type of the local range_size in device_va_to_pa() to u64 to avoid overflow. Signed-off-by: Oded Gabbay commit a9623a8b3ae67d04187b7a4478d4e4155720eebc Author: Tomer Tayar Date: Fri Jul 9 17:34:45 2021 +0300 habanalabs: mark linux image as not loaded after hw_fini If hard reset fails after the call to hw_fini and before loading the linux image to the device, a subsequent call to hw_fini should communicate via COMMS (or MSG_TO_CPU regs for old FW versions). However, the driver still tries in this case to communicate via the GIC, and thus no hard reset is actually done. To avoid that, the patch clears the linux_loaded flag after every call to hw_fini. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 89aad770d692e4d2d9a604c1674e9dfa69421430 Author: Tomer Tayar Date: Fri Jul 9 00:06:47 2021 +0300 habanalabs: fix nullifying of destroyed mmu pgt pool In case of host-resident MMU, when the page tables pool is destroyed, its pointer is not nullified correctly. As a result, on a device fini which happens after a failing reset, the already destroyed pool is accessed, which leads to a kernel panic. The patch fixes the setting of the pool pointer to NULL. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1ee8e2bab509297bbc8320638c2a8a2d739c9b84 Author: Zvika Yehudai Date: Tue Jul 6 13:50:32 2021 +0300 habanalabs: rename cb_mmap to mmap This function will be used for more mmap operations than just mmaping CBs. Signed-off-by: Zvika Yehudai Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 40e35d195d8c18016011ae3e8ffbac765edc3e6f Author: Ofir Bitton Date: Tue Jul 6 12:06:15 2021 +0300 habanalabs: missing mutex_unlock in process kill procedure missing mutex unlock once driver is giving up killing user processes. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 77977ac875f2f1928aa24362f490eef37e063308 Author: Yuri Nudelman Date: Sun Jun 6 10:30:41 2021 +0300 habanalabs/gaudi: implement state dump At the first stage, only gaudi core dump shall be implemented, not including the status registers. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fd2010b5cc5ebe564121be40ed44fb28209850fe Author: Yuri Nudelman Date: Wed Jun 9 14:04:26 2021 +0300 habanalabs: state dump monitors and fences infrastructure With the infrastructure in place, monitors and fences dump shall be implemented. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 938b793fdede518e10c67dc1dcfba1804faf98a6 Author: Yuri Nudelman Date: Sun Jun 6 10:28:51 2021 +0300 habanalabs: expose state dump To improve the user's ability to debug the case where a workload that is part of executing training/inference of a topology is getting stuck, we need to add a 'core dump' each time a CS times-out. The 'core dump' shall contain all relevant Sync Manager information and corresponding fence values. The most recent dumps shall be accessible via debugfs, under 'state_dump' node. Reading from the node will provide the oldest dump available. Writing an integer value X will discard X dumps, starting with the oldest one, i.e. subsequent read will now return newer dumps. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e79e745b208b3c709cc5e689e587d04a4c0fe1bb Author: Oded Gabbay Date: Sat Jul 3 11:50:32 2021 +0300 habanalabs: use get_task_pid() to take PID The previous function we used, find_get_pid(), wasn'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: Oded Gabbay commit fbcd0efefc7e32f2acb9ca5d9196306dfa3da880 Author: Oded Gabbay Date: Tue Jun 29 18:23:41 2021 +0300 habanalabs: allow disabling huge page use Sometimes we may need to disable optimization of using huge pages in our memory management code. Add such a flag to the function that creates the list of physical pages that would be programmed into the device MMU. Signed-off-by: Oded Gabbay commit 00ce06539c068929f239dd1b338267b3403e8b93 Author: Oded Gabbay Date: Tue Jun 29 18:12:46 2021 +0300 habanalabs: user mappings can be 64-bit Increase the size variable in the userptr structure to 64-bit. That variable describes the size of the memory allocation of the user that is now being mapped into the device. The mapping can be larger than 4GB, so we need to support it. Signed-off-by: Oded Gabbay commit 429d77ca2760e0f42523fda72db59861c1b3aefc Author: Oded Gabbay Date: Thu Jul 1 10:36:16 2021 +0300 habanalabs: handle case of interruptable wait Same as we handle it in the regular wait for CS, we need to handle the case where the waiting for user interrupt was interrupted. In that case, we need to return correct error code to the user. Signed-off-by: Oded Gabbay commit b07e6c7ef5c7a094c20fa9962f9af2b42546ee94 Author: Oded Gabbay Date: Thu Jul 1 10:09:28 2021 +0300 habanalabs: release pending user interrupts on device fini In device fini there was missing a call to release all pending user interrupts. That can cause a process to be stuck inside the driver's IOCTL of wait for interrupts, in case the device is removed or simulator is killed at the same time. In addition, also call to remove inactive codec job was missing. Moreover, to prevent such errors in the future (where code is added to reset path but not to device fini), we moved some common parts to two dedicated functions: cleanup_resources take_release_locks Signed-off-by: Oded Gabbay commit d5546d78ad409b90dbcb62100458875e8eaf6a0d Author: Oded Gabbay Date: Thu Jul 1 11:42:53 2021 +0300 habanalabs: re-init completion object upon retry In case user interrupt arrived but the completion value is less than the target value, we want to retry the wait. However, before the retry we must reinitialize the completion object, under spin-lock, so the wait function won't exit immediately because the completion object is already completed (from the previous interrupt). Signed-off-by: Oded Gabbay commit 82629c71c26c1a67a26b0b25971da97003c3b287 Author: Oded Gabbay Date: Tue Jun 29 18:08:05 2021 +0300 habanalabs: rename enum vm_type_t to vm_type We don't use typedefs so the enum name shouldn't end with _t Signed-off-by: Oded Gabbay commit c67b0579b8eb97e8671341e889d5148f72f39f35 Author: Ofir Bitton Date: Mon Jun 28 11:21:56 2021 +0300 habanalabs: update firmware header files Update recent changes made in firmware header files, which contain a minor COMMS protocol change and new error status definitions. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 486e19795f2ee11f0334e2e3fcf8951d4981ff88 Author: Yuri Nudelman Date: Thu Jun 3 17:51:58 2021 +0300 habanalabs: allow fail on inability to respect hint A new user flag is required to make memory map hint mandatory, in contrast to the current situation where it is best effort. This is due to the requirement to map certain data to specific pre-determined device virtual address ranges. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1ae32b9094984efa39ca6d22d4106963458dfd20 Author: farah kassabri Date: Sun Jan 31 18:56:03 2021 +0200 habanalabs: support hint addresses range reservation Add support for pre-determined driver-reserved device VA address ranges. This is needed for future ASIC support where some contents must be mapped into these pre-determined ranges because the H/W will be configured using these ranges. In case the user asks to map a VA without a hint address, avoid allocating the device VA from the reserved ranges. Make sure the validation checks of the hint address take into account situation where the DRAM page size is not pow of 2. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d83e561d43bc71e5404e277b0263774ecd1d1f40 Author: Sean Anderson Date: Mon Aug 9 18:38:13 2021 -0400 clk: vc5: Add properties for configuring SD/OE behavior The SD/OE pin may be configured to enable output when high or low, and to shutdown the device when high. This behavior is controller by the SH and SP bits of the Primary Source and Shutdown Register (and to a lesser extent the OS and OE bits). By default, both bits are 0 (unless set by OTP memory), but they may need to be configured differently, depending on the external circuitry controlling the SD/OE pin. Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20210809223813.3766204-3-sean.anderson@seco.com Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit 2ef162548a53085499c08485228daa968d66dc5a Author: Sean Anderson Date: Mon Aug 9 18:38:12 2021 -0400 clk: vc5: Use dev_err_probe Convert uses of dev_err (+ return) to dev_err_probe. Signed-off-by: Sean Anderson Reviewed-by: Geert Uytterhoeven Reviewed-by: Luca Ceresoli Link: https://lore.kernel.org/r/20210809223813.3766204-2-sean.anderson@seco.com Signed-off-by: Stephen Boyd commit 275e4e2dc0411508506acb591a45daf01d22f8eb Author: Sean Anderson Date: Mon Aug 9 18:38:11 2021 -0400 dt-bindings: clk: vc5: Add properties for configuring the SD/OE pin These properties allow configuring the SD/OE pin as described in the datasheet. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring Reviewed-by: Luca Ceresoli Link: https://lore.kernel.org/r/20210809223813.3766204-1-sean.anderson@seco.com Signed-off-by: Stephen Boyd commit 6880d94f84262e721f7da6eaa41cd8fd5d87164c Author: Rafał Miłecki Date: Thu Aug 19 07:29:18 2021 +0200 dt-bindings: clock: brcm,iproc-clocks: fix armpll properties armpll clocks (available on Cygnus and Northstar Plus) are simple clocks with no cells. Adjust binding props #clock-cells and clock-output-names to handle them. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20210819052918.6753-1-zajec5@gmail.com Acked-by: Florian Fainelli Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 6e1cc688e4501c129ff4e0f001588e2859c5be33 Author: Michal Simek Date: Mon Aug 23 13:33:47 2021 +0200 clk: zynqmp: Fix kernel-doc format Align structure and function names with definitions. Issues are reported by kernel-doc script as: drivers/clk/zynqmp/clk-gate-zynqmp.c:24: warning: expecting prototype for struct clk_gate. Prototype was for struct zynqmp_clk_gate instead drivers/clk/zynqmp/clk-gate-zynqmp.c:75: warning: expecting prototype for zynqmp_clk_gate_is_enable(). Prototype was for zynqmp_clk_gate_is_enabled() instead Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/26526e144296373b2c75e75865dd023158f9bfc7.1629718424.git.michal.simek@xilinx.com Signed-off-by: Stephen Boyd commit af7651e67b9d5f7e63ea23b118e3672ac662244a Author: Codrin Ciubotariu Date: Wed Jul 7 16:12:13 2021 +0300 clk: at91: clk-generated: Limit the requested rate to our range On clk_generated_determine_rate(), the requested rate could be outside of clk's range. Limit the rate to the clock's range to not return an error. Fixes: df70aeef6083 ("clk: at91: add generated clock driver") Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20210707131213.3283509-1-codrin.ciubotariu@microchip.com Acked-by: Nicolas Ferre Signed-off-by: Stephen Boyd commit c16edf5ff8ece9c4135175da4103cee1bec360be Author: Sergio Paracuellos Date: Tue Jul 27 07:55:37 2021 +0200 clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates 'clk_init_data' for gates is setting up 'CLK_IS_CRITICAL' flag for all of them. This was being doing because some drivers of this SoC might not be ready to use the clock and we don't wanted the kernel to disable them since default behaviour without clock driver was to set all gate bits to enabled state. After a bit more testing and checking driver code it is safe to remove this flag and just let the kernel to disable those gates that are not in use. No regressions seems to appear. Fixes: 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC") Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20210727055537.11785-1-sergio.paracuellos@gmail.com Signed-off-by: Stephen Boyd commit e7296d16ef7be11a6001be9bd89906ef55ab2405 Author: Shubhrajyoti Datta Date: Wed Aug 18 12:29:28 2021 +0530 clk: zynqmp: Fix a memory leak Fix a memory leak of mux. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20210818065929.12835-3-shubhrajyoti.datta@xilinx.com Signed-off-by: Stephen Boyd commit 47d0fbd1cd42d5458c05a7244f7fa3384557b6cc Author: Shubhrajyoti Datta Date: Wed Aug 18 12:29:27 2021 +0530 clk: zynqmp: Check the return type Currently the return value of of_clk_add_hw_provider is ignored. lets check and return value. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20210818065929.12835-2-shubhrajyoti.datta@xilinx.com Signed-off-by: Stephen Boyd commit a3ef91f501b0a4bcae8627342f7a23401963490d Author: Randy Dunlap Date: Thu Aug 19 15:32:37 2021 -0700 clk: at91: sama7g5: remove all kernel-doc & kernel-doc warnings Remove all "/**" kernel-doc markers from sama7g5.c since they are all internal to this driver source file only. This eliminates 14 warnings that were reported by the kernel test robot. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Claudiu Beznea Cc: Michael Turquette Cc: Stephen Boyd Cc: Eugen Hristev Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20210819223237.20115-1-rdunlap@infradead.org Reviewed-by: Claudiu Beznea Signed-off-by: Stephen Boyd commit 0cbc0eb14e99eeac8b34625aa1a5ab83671af6a7 Author: Rajan Vaja Date: Mon Aug 23 05:07:13 2021 -0700 clk: zynqmp: fix kernel doc Add missing description of 'custom_type_flag' structure member. Fixes: e605fa9c4a0c ("clk: zynqmp: Add support for custom type flags") Signed-off-by: Rajan Vaja Link: https://lore.kernel.org/r/1629720433-19019-1-git-send-email-rajan.vaja@xilinx.com Signed-off-by: Stephen Boyd commit 3e061910b2a2ea2bc25861068a11df011fd3a0f8 Merge: e73f0f0ee7541 86842d255b45f Author: Stephen Boyd Date: Sat Aug 28 21:15:35 2021 -0700 Merge tag 'clk-imx-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clock driver updates from Abel Vesa - Fix CLKOUT clocks on i.MX8MM and i.MX8MN by using imx_clk_hw_mux2 - Switch from .round_rate to .determine_rate in clk-divider-gate - Fix clock tree update for TF-A controlled clocks for all i.MX8M - Add missing M7 core clock for i.MX8MN * tag 'clk-imx-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx8mn: Add M7 core clock clk: imx8m: fix clock tree update of TF-A managed clocks clk: imx: clk-divider-gate: Switch to clk_divider.determine_rate clk: imx8mn: use correct mux type for clkout path clk: imx8mm: use correct mux type for clkout path commit aaedb9e00e5400220a8871180d23a83e67f29f63 Author: Linus Walleij Date: Sun Aug 15 01:55:14 2021 +0200 clk: kirkwood: Fix a clocking boot regression Since a few kernel releases the Pogoplug 4 has crashed like this during boot: Unable to handle kernel NULL pointer dereference at virtual address 00000002 (...) [] (strlen) from [] (kstrdup+0x1c/0x4c) [] (kstrdup) from [] (__clk_register+0x44/0x37c) [] (__clk_register) from [] (clk_hw_register+0x20/0x44) [] (clk_hw_register) from [] (__clk_hw_register_mux+0x198/0x1e4) [] (__clk_hw_register_mux) from [] (clk_register_mux_table+0x5c/0x6c) [] (clk_register_mux_table) from [] (kirkwood_clk_muxing_setup.constprop.0+0x13c/0x1ac) [] (kirkwood_clk_muxing_setup.constprop.0) from [] (of_clk_init+0x12c/0x214) [] (of_clk_init) from [] (time_init+0x20/0x2c) [] (time_init) from [] (start_kernel+0x3dc/0x56c) [] (start_kernel) from [<00000000>] (0x0) Code: e3130020 1afffffb e12fff1e c08a1078 (e5d03000) This is because the "powersave" mux clock 0 was provided in an unterminated array, which is required by the loop in the driver: /* Count, allocate, and register clock muxes */ for (n = 0; desc[n].name;) n++; Here n will go out of bounds and then call clk_register_mux() on random memory contents after the mux clock. Fix this by terminating the array with a blank entry. Fixes: 105299381d87 ("cpufreq: kirkwood: use the powersave multiplexer") Cc: stable@vger.kernel.org Cc: Andrew Lunn Cc: Chris Packham Cc: Gregory CLEMENT Cc: Sebastian Hesselbarth Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210814235514.403426-1-linus.walleij@linaro.org Reviewed-by: Andrew Lunn Signed-off-by: Stephen Boyd commit 920e9b9cd15413d87920b68acaee34850938fb01 Author: Konrad Dybcio Date: Fri Aug 20 22:36:23 2021 +0200 dt-bindings: clock: Add SM6350 GCC clock bindings Add device tree bindings for global clock controller on SM6350 SoC. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210820203624.232268-2-konrad.dybcio@somainline.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit be5b605d34cdf2ddd6bc8fb771f6351a39ba958c Author: Konrad Dybcio Date: Fri Aug 20 22:32:43 2021 +0200 clk: qcom: rpmh: Add support for RPMH clocks on SM6350 Add support for RPMH clocks on SM6350 SoCs. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210820203243.230157-3-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit 4966c52ad700040dc84f3335f149a66467f1a921 Author: Konrad Dybcio Date: Fri Aug 20 22:32:42 2021 +0200 dt-bindings: clock: Add RPMHCC bindings for SM6350 Add bindings and update documentation for clock rpmh driver on SM6350. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210820203243.230157-2-konrad.dybcio@somainline.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 386ea3bd8eae577cf463ef79bd354cf14e1f50d0 Author: Lukas Bulwahn Date: Mon Aug 16 15:59:30 2021 +0200 clk: qcom: adjust selects for SM_VIDEOCC_8150 and SM_VIDEOCC_8250 Commit 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150") and commit 0e94711a1f29 ("clk: qcom: add video clock controller driver for SM8250") add config SM_VIDEOCC_8150 and config SM_VIDEOCC_8250, which select the non-existing configs SDM_GCC_8150 and SDM_GCC_8250, respectively. Hence, ./scripts/checkkconfigsymbols.py warns: SDM_GCC_8150 Referencing files: drivers/clk/qcom/Kconfig SDM_GCC_8250 Referencing files: drivers/clk/qcom/Kconfig It is probably just a typo (or naming confusion of using SM_GCC_xxx and SDM_GCC_xxx for various Qualcomm clock drivers) in the config definitions for config SM_VIDEOCC_8150 and SM_VIDEOCC_8250, and intends to select the existing SM_GCC_8150 and SM_GCC_8250, respectively. Adjust the selects to the existing configs. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210816135930.11810-1-lukas.bulwahn@gmail.com Signed-off-by: Stephen Boyd commit cbe63bfdc54fa289b8bfa943fbce97e70af04122 Author: Iskren Chernev Date: Thu Aug 5 19:11:07 2021 +0300 clk: qcom: Add Global Clock controller (GCC) driver for SM6115 Add support for the global clock controller found on SM6115 based devices. This should allow most non-multimedia device drivers to probe and control their clocks. Based on CAF implementation. GDSCs ported from downstream DT. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210805161107.1194521-3-iskren.chernev@gmail.com Signed-off-by: Stephen Boyd commit dce25b3e0bb26dc8929bb3b8eec18dd8a6777c9f Author: Iskren Chernev Date: Thu Aug 5 19:11:06 2021 +0300 dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC Add device tree bindings for global clock controller on SM6115 and SM4250 SoCs (pin and software compatible). Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210805161107.1194521-2-iskren.chernev@gmail.com Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 0e35f63f7f4eebd268ec236fd1bbf4e561ce8de5 Author: Aleksa Savic Date: Sat Aug 28 07:26:28 2021 +0200 hwmon: add driver for Aquacomputer D5 Next This driver exposes hardware sensors of the Aquacomputer D5 Next watercooling pump, which communicates through a proprietary USB HID protocol. Available sensors are pump and fan speed, power, voltage and current, as well as coolant temperature. Also available through debugfs are the serial number, firmware version and power-on count. Attaching a fan is optional and allows it to be controlled using temperature curves directly from the pump. If it's not connected, the fan-related sensors will report zeroes. The pump can be configured either through software or via its physical interface. Configuring the pump through this driver is not implemented, as it seems to require sending it a complete configuration. That includes addressable RGB LEDs, for which there is no standard sysfs interface. Thus, that task is better suited for userspace tools. This driver has been tested on x86_64, both in-kernel and as a module. Signed-off-by: Aleksa Savic Signed-off-by: Guenter Roeck commit d25a025201ed98f4b93775e0999a3f2135702106 Author: Paul E. McKenney Date: Thu Aug 12 09:31:28 2021 -0700 clocksource: Make clocksource watchdog test safe for slow-HZ systems The clocksource watchdog test sets a local JIFFIES_SHIFT macro and assumes that HZ is >= 100. For smaller HZ values this shift value is too large and causes undefined behaviour. Move the HZ-based definitions of JIFFIES_SHIFT from kernel/time/jiffies.c to kernel/time/tick-internal.h so the clocksource watchdog test can utilize them, which makes it work correctly with all HZ values. [ tglx: Resolved conflicts and massaged changelog ] Signed-off-by: Paul E. McKenney Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/20210812000133.GA402890@paulmck-ThinkPad-P17-Gen-1/ commit 2619835e31cb0ed760e5cba546ac02af8917fc9a Merge: 0d55649d2ad72 b357d9717be7f Author: David S. Miller Date: Sat Aug 28 12:31:41 2021 +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 2021-08-27 This series contains updates to ice driver only. Jake corrects the iterator used for looping Tx timestamp and removes dead code related to pin configuration. He also adds locking around flushing of the Tx tracker and restarts the periodic clock following time changes. Brett corrects the locking around updating netdev dev_addr. ==================== Signed-off-by: David S. Miller commit c77225119daa0ca0a9c6c007945c0a87b3e4a2e8 Merge: 4af874f40ebb4 ccbbd002a419b Author: David S. Miller Date: Sat Aug 28 11:23:09 2021 +0100 Merge branch 'ionic-queue-mgmt' Shannon Nelson says: ==================== ionic: queue mgmt updates The first pair of patches help smooth the driver's response when the firmware has gone through a recovery/reboot cycle. The next four patches take care of a couple things seen when changing the interface status. ==================== Signed-off-by: David S. Miller commit ccbbd002a419b5b4df481be8d42c3c7a3ce86426 Author: Shannon Nelson Date: Fri Aug 27 11:55:12 2021 -0700 ionic: recreate hwstamp queues on ifup The queues can be freed in ionic_close(). They need to be recreated after ionic_open(). It doesn't need to replay the whole config. It only needs to create the timestamping queues again. Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 7ee99fc5ed2e5e299ef46a9ca9d24d93be08c461 Author: Shannon Nelson Date: Fri Aug 27 11:55:11 2021 -0700 ionic: pull hwstamp queue_lock up a level Move the hwstamp configuration use of queue_lock up a level to simplify use and error handling. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit af3d2ae1144327490f4eb96accbfa1d0f404eb8a Author: Shannon Nelson Date: Fri Aug 27 11:55:10 2021 -0700 ionic: add queue lock around open and stop Add the queue configuration lock to ionic_open() and ionic_stop() so that they don't collide with other in parallel queue configuration actions such as MTU changes as can be demonstrated with a tight loop of ifup/change-mtu/ifdown. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 92c90dff687f86ca02bcc1bf7d43626fcf06f4c9 Author: Shannon Nelson Date: Fri Aug 27 11:55:09 2021 -0700 ionic: fill mac addr earlier in add_addr Make sure the ctx struct has the new mac address before any save operations happen. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 970dfbf428c47b9d91960fc9e30f97c3ce59a22b Author: Shannon Nelson Date: Fri Aug 27 11:55:08 2021 -0700 ionic: squelch unnecessary fw halted message Since the heartbeat check will already have complained about the firmware status, don't bother complaining about the DEVCMD failing. We'll keep the print message but demote it to a debug messages so that we normally no longer see it. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit d3e2dcdb6853ee263283121360f5facb73627cfd Author: Shannon Nelson Date: Fri Aug 27 11:55:07 2021 -0700 ionic: fire watchdog again after fw_down In some cases of fw_down it was called because there was a fw_generation change, and the firmware is already back up. In order to keep the down time to a minimum, don't wait for the next watchdog polling cycle, fire another watchdog off as soon as we can - an out-of-cycle check won't hurt, and may well speed up the recovery. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 4af874f40ebb4c906eb632d8756673648c5724e6 Merge: 49b99da2c9ce1 0cb0704149f0d Author: David S. Miller Date: Sat Aug 28 11:20:05 2021 +0100 Merge branch 'hns3-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. This series includes some optimizations, cleanups and one ==================== Signed-off-by: David S. Miller commit 0cb0704149f0d9d3b7c68ebab932fc27222c740b Author: Hao Chen Date: Sat Aug 28 14:55:21 2021 +0800 net: hns3: add required space in comment Add some required spaces in comment for cleanup. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 1026b1534fa12a9dbdcebd34d417513fca4647f0 Author: Hao Chen Date: Sat Aug 28 14:55:20 2021 +0800 net: hns3: remove unnecessary "static" of local variables in function Some local variable declarations are no need to add "static", so remove it. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7f2f8cf6ef668c1c745e229023f98663f47aa702 Author: Guangbin Huang Date: Sat Aug 28 14:55:19 2021 +0800 net: hns3: don't config TM DWRR twice when set ETS The function hclge_tm_dwrr_cfg() will be called twice in function hclge_ieee_setets() when map_changed is true, the calling flow is hclge_ieee_setets() hclge_map_update() | hclge_tm_schd_setup_hw() | hclge_tm_dwrr_cfg() hclge_notify_init_up() hclge_tm_dwrr_cfg() It is no need to call hclge_tm_dwrr_cfg() twice actually, so just return after calling hclge_notify_init_up(). Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit aec35aecc3ccc822b358e2594ff70ff54245261e Author: Guangbin Huang Date: Sat Aug 28 14:55:18 2021 +0800 net: hns3: add new function hclge_get_speed_bit() Currently, function hclge_check_port_speed() uses switch/case statement to get speed bit according to speed. To reuse this part of code and improve code readability and maintainability, add a new function hclge_get_speed_bit() to get speed bit according to map relationship of speed and speed bit defined in array speed_bit_map. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 81414ba71356b174d62370195a2bb99592e1b2a2 Author: Guangbin Huang Date: Sat Aug 28 14:55:17 2021 +0800 net: hns3: refactor function hclgevf_parse_capability() The function hclgevf_parse_capability() will add more if statement in the future, to improve code readability, maintainability and simplicity, refactor this function by using a bit mapping array of IMP capabilities and driver capabilities. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e1d93bc6ef3bf497675f9ac2b35b79c48577b970 Author: Guangbin Huang Date: Sat Aug 28 14:55:16 2021 +0800 net: hns3: refactor function hclge_parse_capability() The function hclge_parse_capability() uses too many if statement, and it may add more in the future. To improve code readability, maintainability and simplicity, refactor this function by using a bit mapping array of IMP capabilities and driver capabilities. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0fc36e37d5c0e940d6347e8c10a9fe2d8d5b0074 Author: Yufeng Mo Date: Sat Aug 28 14:55:15 2021 +0800 net: hns3: add trace event in hclge_gen_resp_to_vf() Add a trace to get the info of pf responds to the mailbox message of vf. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit c7e9d0020361f4308a70cdfd6d5335e273eb8717 Author: Denis Efremov Date: Sat Aug 7 10:37:02 2021 +0300 Revert "floppy: reintroduce O_NDELAY fix" The patch breaks userspace implementations (e.g. fdutils) and introduces regressions in behaviour. Previously, it was possible to O_NDELAY open a floppy device with no media inserted or with write protected media without an error. Some userspace tools use this particular behavior for probing. It's not the first time when we revert this patch. Previous revert is in commit f2791e7eadf4 (Revert "floppy: refactor open() flags handling"). This reverts commit 8a0c014cd20516ade9654fc13b51345ec58e7be8. Link: https://lore.kernel.org/linux-block/de10cb47-34d1-5a88-7751-225ca380f735@compro.net/ Reported-by: Mark Hounschell Cc: Jiri Kosina Cc: Wim Osterholt Cc: Kurt Garloff Cc: Signed-off-by: Denis Efremov commit 4adb389e08c95fdf91995271932c59250ff0d561 Author: Aldas Taraškevičius Date: Sat Aug 28 10:21:19 2021 +0300 staging: vt6655: Remove filenames in files Fix checkpatch warnings about having filenames in the files. Signed-off-by: Aldas Taraškevičius Link: https://lore.kernel.org/r/20210828072119.1395-1-aldas60@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6506cd9f3ae9c9777a581b309f2ca1a215128fbf Author: Phillip Potter Date: Sat Aug 28 01:02:31 2021 +0100 staging: r8188eu: add extra TODO entries Add entry for CFG80211 to reflect that it is currently being worked on and is a desirable feature to have for this driver. Leave entries for LIB80211 and MAC80211 in case anyone else wishes to work on them - they can always be removed later, but MAC80211 in particular would certainly be good to aim for. Also, include an entry for improving error handling, as this is another goal of the cleanup effort. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210828000231.1458-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit e1e0ee8ed2b0e95df46785a98118465de880137e Author: Aldas Taraškevičius Date: Fri Aug 27 19:32:03 2021 +0300 staging: vt6656: Remove filenames in files checkpatch.pl warning: It's generally not useful to have the filename in the file Remove the filenames. Signed-off-by: Aldas Taraškevičius Link: https://lore.kernel.org/r/20210827163203.4100-1-aldas60@gmail.com Signed-off-by: Greg Kroah-Hartman commit 65bbdabe2a27a4f46387a3b6976d2355d67f9706 Author: Aakash Hemadri Date: Sat Aug 28 09:59:49 2021 +0530 staging: wlan-ng: fix invalid assignment warning p80211_hdr->frame_control is u16, change to __le16 to satisfy sparse warning: wlan-ng/prism2sta.c:253:43: warning: invalid assignment: |= wlan-ng/prism2sta.c:253:43: left side has type unsigned short wlan-ng/prism2sta.c:253:43: right side has type restricted __le16 Fixes: 6277fbfdd29c ("staging: wlan-ng: Remove pointless a3/a4 union") Reviewed-by: Kees Cook Signed-off-by: Aakash Hemadri Link: https://lore.kernel.org/r/20210828042949.2276341-1-aakashhemadri123@gmail.com Signed-off-by: Greg Kroah-Hartman commit 49b99da2c9ce13ffcd93fe3a0f5670791c1d76f7 Author: Rocco Yue Date: Fri Aug 27 23:04:12 2021 +0800 ipv6: add IFLA_INET6_RA_MTU to expose mtu value The kernel provides a "/proc/sys/net/ipv6/conf//mtu" file, which can temporarily record the mtu value of the last received RA message when the RA mtu value is lower than the interface mtu, but this proc has following limitations: (1) when the interface mtu (/sys/class/net//mtu) is updeated, mtu6 (/proc/sys/net/ipv6/conf//mtu) will be updated to the value of interface mtu; (2) mtu6 (/proc/sys/net/ipv6/conf//mtu) only affect ipv6 connection, and not affect ipv4. Therefore, when the mtu option is carried in the RA message, there will be a problem that the user sometimes cannot obtain RA mtu value correctly by reading mtu6. After this patch set, if a RA message carries the mtu option, you can send a netlink msg which nlmsg_type is RTM_GETLINK, and then by parsing the attribute of IFLA_INET6_RA_MTU to get the mtu value carried in the RA message received on the inet6 device. In addition, you can also get a link notification when ra_mtu is updated so it doesn't have to poll. In this way, if the MTU values that the device receives from the network in the PCO IPv4 and the RA IPv6 procedures are different, the user can obtain the correct ipv6 ra_mtu value and compare the value of ra_mtu and ipv4 mtu, then the device can use the lower MTU value for both IPv4 and IPv6. Signed-off-by: Rocco Yue Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20210827150412.9267-1-rocco.yue@mediatek.com Signed-off-by: Jakub Kicinski commit 0d55649d2ad7296acfda9127e1d05518d025734a Author: Vladimir Oltean Date: Fri Aug 27 15:25:41 2021 +0200 net: phy: marvell10g: fix broken PHY interrupts for anyone after us in the driver probe list Enabling interrupts via device tree for the internal PHYs on the mv88e6390 DSA switch does not work. The driver insists to use poll mode. Stage one debugging shows that the fwnode_mdiobus_phy_device_register function calls fwnode_irq_get properly, and phy->irq is set to a valid interrupt line initially. But it is then cleared. Stage two debugging shows that it is cleared here: phy_probe: /* Disable the interrupt if the PHY doesn't support it * but the interrupt is still a valid one */ if (!phy_drv_supports_irq(phydrv) && phy_interrupt_is_valid(phydev)) phydev->irq = PHY_POLL; Okay, so does the "Marvell 88E6390 Family" PHY driver not have the .config_intr and .handle_interrupt function pointers? Yes it does. Stage three debugging shows that the PHY device does not attempt a probe against the "Marvell 88E6390 Family" driver, but against the "mv88x3310" driver. Okay, so why does the "mv88x3310" driver match on a mv88x6390 internal PHY? The PHY IDs (MARVELL_PHY_ID_88E6390_FAMILY vs MARVELL_PHY_ID_88X3310) are way different. Stage four debugging has us looking through: phy_device_register -> device_add -> bus_probe_device -> device_initial_probe -> __device_attach -> bus_for_each_drv -> driver_match_device -> drv->bus->match -> phy_bus_match Okay, so as we said, the MII_PHYSID1 of mv88e6390 does not match the mv88x3310 driver's PHY mask & ID, so why would phy_bus_match return... Ahh, phy_bus_match calls a shortcircuit method, phydrv->match_phy_device, and does not even bother to compare the PHY ID if that is implemented. So of course, we go inside the marvell10g.c driver and sure enough, it implements .match_phy_device and does not bother to check the PHY ID. What's interesting though is that at the end of the device_add() from phy_device_register(), the driver for the internal PHYs _is_ the proper "Marvell 88E6390 Family". This is because "mv88x3310" ends up failing to probe after all, and __device_attach_driver(), to quote: /* * Ignore errors returned by ->probe so that the next driver can try * its luck. */ The next (and only other) driver that matches is the 6390 driver. For this one, phy_probe doesn't fail, and everything expects to work as normal, EXCEPT phydev->irq has already been cleared by the previous unsuccessful probe of a driver which did not implement PHY interrupts, and therefore cleared that IRQ. Okay, so it is not just Marvell 6390 that has PHY interrupts broken. Stuff like Atheros, Aquantia, Broadcom, Qualcomm work because they are lexicographically before Marvell, and stuff like NXP, Realtek, Vitesse are broken. This goes to show how fragile it is to reset phydev->irq = PHY_POLL from the actual beginning of phy_probe itself. That seems like an actual bug of its own too, since phy_probe has side effects which are not restored on probe failure, but the line of thought probably was, the same driver will attempt probe again, so it doesn't matter. Well, looks like it does. Maybe it would make more sense to move the phydev->irq clearing after the actual device_add() in phy_device_register() completes, and the bound driver is the actual final one. (also, a bit frightening that drivers are permitted to bypass the MDIO bus matching in such a trivial way and perform PHY reads and writes from the .match_phy_device method, on devices that do not even belong to them. In the general case it might not be guaranteed that the MDIO accesses one driver needs to make to figure out whether to match on a device is safe for all other PHY devices) Fixes: a5de4be0aaaa ("net: phy: marvell10g: fix differentiation of 88X3310 from 88X3340") Signed-off-by: Vladimir Oltean Tested-by: Marek Behún Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210827132541.28953-1-kabel@kernel.org Signed-off-by: Jakub Kicinski commit 0975d8b4bfa011b2943c53d3c169277f5e3cf799 Merge: 4baf0e0b32987 907fd4a294dbb Author: Jakub Kicinski Date: Fri Aug 27 17:14:33 2021 -0700 Merge branch 'bnxt-add-rx-discards-stats-for-oom-and-netpool' Jakub Kicinski says: ==================== bnxt: add rx discards stats for oom and netpoll Drivers should avoid silently dropping frames. This set adds two stats for previously unaccounted events to bnxt - packets dropped due to allocation failures and packets dropped during emergency ring polling. ==================== Link: https://lore.kernel.org/r/20210827152745.68812-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 907fd4a294dbb9ce12d9e47cb6fcf4dcc7b2a5f3 Author: Jakub Kicinski Date: Fri Aug 27 08:27:45 2021 -0700 bnxt: count discards due to memory allocation errors Count packets dropped due to buffer or skb allocation errors. Report as part of rx_dropped. v2: drop the ethtool -S entry [Vladimir] Reviewed-by: Michael Chan Reviewed-by: Edwin Peer Signed-off-by: Jakub Kicinski commit 40bedf7cb2ac949052bf9741ccb9d673d782ae2c Author: Jakub Kicinski Date: Fri Aug 27 08:27:44 2021 -0700 bnxt: count packets discarded because of netpoll bnxt may discard packets if Rx completions are consumed in an attempt to let netpoll make progress. It should be extremely rare in practice but nonetheless such events should be counted. Since completion ring memory is allocated dynamically use a similar scheme to what is done for HW stats to save them. Report the stats in rx_dropped and per-netdev ethtool counter. Chances that users care which ring dropped are very low. v3: only save the stat to rx_dropped on reset, rx_total_netpoll_discards will now only show drops since last reset, similar to other "total_discard" counters. Reviewed-by: Michael Chan Reviewed-by: Edwin Peer Signed-off-by: Jakub Kicinski commit 7625eccd1852ac84d3aa6a06ffc2f710e683b3fe Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:03 2021 +0200 mm: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-21-bigeasy@linutronix.de commit 252034e03f04e54acfb5f5924dd26ae638e3215e Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:58 2021 +0200 md/raid5: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Song Liu Link: https://lore.kernel.org/r/20210803141621.780504-16-bigeasy@linutronix.de commit c7483d823ee0da31e42d32e51a752f667a059735 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:44 2021 +0200 Documentation: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Update the documentation accordingly. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-2-bigeasy@linutronix.de commit b542e383d8c005f06a131e2b40d5889b812f19c6 Author: Thomas Gleixner Date: Thu Jul 29 13:01:59 2021 +0200 eventfd: Make signal recursion protection a task bit The recursion protection for eventfd_signal() is based on a per CPU variable and relies on the !RT semantics of spin_lock_irqsave() for protecting this per CPU variable. On RT kernels spin_lock_irqsave() neither disables preemption nor interrupts which allows the spin lock held section to be preempted. If the preempting task invokes eventfd_signal() as well, then the recursion warning triggers. Paolo suggested to protect the per CPU variable with a local lock, but that's heavyweight and actually not necessary. The goal of this protection is to prevent the task stack from overflowing, which can be achieved with a per task recursion protection as well. Replace the per CPU variable with a per task bit similar to other recursion protection bits like task_struct::in_page_owner. This works on both !RT and RT kernels and removes as a side effect the extra per CPU storage. No functional change for !RT kernels. Reported-by: Daniel Bristot de Oliveira Signed-off-by: Thomas Gleixner Tested-by: Daniel Bristot de Oliveira Acked-by: Jason Wang Cc: Al Viro Link: https://lore.kernel.org/r/87wnp9idso.ffs@tglx commit 461d971215dfb55bcd5f7d040b2b222592040f95 Merge: 7ee656c3ac3d0 6607cd319b6b9 Author: Jens Axboe Date: Fri Aug 27 16:32:01 2021 -0600 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.15/drivers Pull MD changes from Song. * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: raid1: ensure write behind bio has less than BIO_MAX_VECS sectors md/raid10: Remove unnecessary rcu_dereference in raid10_handle_discard commit 6607cd319b6b91bff94e90f798a61c031650b514 Author: Guoqing Jiang Date: Tue Aug 24 09:16:54 2021 +0800 raid1: ensure write behind bio has less than BIO_MAX_VECS sectors We can't split write behind bio with more than BIO_MAX_VECS sectors, otherwise the below call trace was triggered because we could allocate oversized write behind bio later. [ 8.097936] bvec_alloc+0x90/0xc0 [ 8.098934] bio_alloc_bioset+0x1b3/0x260 [ 8.099959] raid1_make_request+0x9ce/0xc50 [raid1] [ 8.100988] ? __bio_clone_fast+0xa8/0xe0 [ 8.102008] md_handle_request+0x158/0x1d0 [md_mod] [ 8.103050] md_submit_bio+0xcd/0x110 [md_mod] [ 8.104084] submit_bio_noacct+0x139/0x530 [ 8.105127] submit_bio+0x78/0x1d0 [ 8.106163] ext4_io_submit+0x48/0x60 [ext4] [ 8.107242] ext4_writepages+0x652/0x1170 [ext4] [ 8.108300] ? do_writepages+0x41/0x100 [ 8.109338] ? __ext4_mark_inode_dirty+0x240/0x240 [ext4] [ 8.110406] do_writepages+0x41/0x100 [ 8.111450] __filemap_fdatawrite_range+0xc5/0x100 [ 8.112513] file_write_and_wait_range+0x61/0xb0 [ 8.113564] ext4_sync_file+0x73/0x370 [ext4] [ 8.114607] __x64_sys_fsync+0x33/0x60 [ 8.115635] do_syscall_64+0x33/0x40 [ 8.116670] entry_SYSCALL_64_after_hwframe+0x44/0xae Thanks for the comment from Christoph. [1]. https://bugs.archlinux.org/task/70992 Cc: stable@vger.kernel.org # v5.12+ Reported-by: Jens Stutte Tested-by: Jens Stutte Reviewed-by: Christoph Hellwig Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit fc958a61ff6d34a0ec42744d3ff524ee202b2e9f Author: Chris Packham Date: Thu Aug 26 14:41:20 2021 +1200 hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API Use the devm_hwmon_device_register_with_info API and remove code that deals with the standard sensor attributes. Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210826024121.15665-4-chris.packham@alliedtelesis.co.nz [groeck: Fixed alignment issues] Signed-off-by: Guenter Roeck commit ef67959c42539bfece4d7c4335c07656703bb027 Author: Chris Packham Date: Thu Aug 26 14:41:19 2021 +1200 hwmon: (adt7470) Convert to use regmap Convert the adt7470 to using regmap which allows better error handling. Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210826024121.15665-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 23bd022aa6182367e1add7b4d05777cdba283756 Author: Chris Packham Date: Thu Aug 26 14:41:18 2021 +1200 hwmon: (adt7470) Fix some style issues In preparation for the changes that follow fix up some existing style issues. Specifically: - add blank line between variable declaration and code - use strscpy instead of strlcpy - remove unnecessary braces Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210826024121.15665-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 25572c818d2e40b5d7231a9dc49bd45a6b6c3dfa Author: Mario Limonciello Date: Fri Aug 27 15:15:26 2021 -0500 hwmon: (k10temp) Add support for yellow carp Yellow carp matches same behavior as green sardine and other Zen3 products, but have different CCD offsets. Signed-off-by: Mario Limonciello Acked-by: Borislav Petkov Link: https://lore.kernel.org/r/20210827201527.24454-3-mario.limonciello@amd.com Signed-off-by: Guenter Roeck commit 0e3f52bbd9ebaef5fba1b4c70e4132b9782c7c7e Author: Mario Limonciello Date: Fri Aug 27 15:15:25 2021 -0500 hwmon: (k10temp) Rework the temperature offset calculation Some of the existing assumptions made do not scale properly to new silicon in upcoming changes. This commit should cause no functional changes to existing silicon. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20210827201527.24454-2-mario.limonciello@amd.com Signed-off-by: Guenter Roeck commit 2a7a451a9084877a0b9d335c77d57e4cda1e5882 Author: Olga Kornievskaia Date: Fri Aug 27 14:37:19 2021 -0400 NFSv4.1 add network transport when session trunking is detected After trunking is discovered in nfs4_discover_server_trunking(), add the transport to the old client structure if the allowed limit of transports has not been reached. An example: there exists a multi-homed server and client mounts one server address and some volume and then doest another mount to a different address of the same server and perhaps a different volume. Previously, the client checks that this is a session trunkable servers (same server), and removes the newly created client structure along with its transport. Now, the client adds the connection from the 2nd mount into the xprt switch of the existing client (it leads to having 2 available connections). Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit dc48e0abee245e2f0361bd8d4e3b00f70450fab2 Author: Olga Kornievskaia Date: Fri Aug 27 14:37:18 2021 -0400 SUNRPC enforce creation of no more than max_connect xprts If we are adding new transports via rpc_clnt_test_and_add_xprt() then check if we've reached the limit. Currently only pnfs path adds transports via that function but this is done in preparation when the client would add new transports when session trunking is detected. A warning is logged if the limit is reached. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 7e134205f62955369619021a695cd78fefd32451 Author: Olga Kornievskaia Date: Fri Aug 27 14:37:17 2021 -0400 NFSv4 introduce max_connect mount options This option will control up to how many xprts can the client establish to the server with a distinct address (that means nconnect connections are not counted towards this new limit). This patch is setting up nfs structures to keeep track of the max_connect limit (does not enforce it). The default value is kept at 1 so that no current mounts that don't want any additional connections would be effected. The maximum value is set at 16. Mounts to DS are not limited to default value of 1 but instead set to the maximum default value of 16 (NFS_MAX_TRANSPORTS). Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit df205d0a8ea1b873a29f1333f232f884e9728acc Author: Olga Kornievskaia Date: Fri Aug 27 14:37:16 2021 -0400 SUNRPC add xps_nunique_destaddr_xprts to xprt_switch_info in sysfs In sysfs's xprt_switch_info attribute also display the value of number of transports with unique destination addresses for this xprt_switch. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 3a3f976639f267823e443fdd8bffa03848fa1c3f Author: Olga Kornievskaia Date: Fri Aug 27 14:37:14 2021 -0400 SUNRPC keep track of number of transports to unique addresses Currently, xprt_switch keeps a number of all xprts (xps_nxprts) that were added to the switch regardless of whethere it's an nconnect transport or a transport to a trunkable address. Introduce a new counter to keep track of transports to unique destination addresses per xprt_switch. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 79d534f8cbf9714e2ba735f5b6c97678d266b2de Author: Ye Bin Date: Wed Aug 18 10:02:52 2021 +0800 NFSv3: Delete duplicate judgement in nfs3_async_handle_jukebox As eb96d5c97b08 ("SUNRPC handle EKEYEXPIRED in call_refreshresult") commit handle EKEYEXPIRED in call_refreshresult, so there is only handle when "task->tk_status" is equal "-EJUKEBOX" in nfs3_async_handle_jukebox. Signed-off-by: Ye Bin Signed-off-by: Anna Schumaker commit 7c81e6a9d75bd2c094005b64b442cec729dbdf66 Author: Trond Myklebust Date: Tue Aug 24 11:38:18 2021 -0400 SUNRPC: Tweak TCP socket shutdown in the RPC client We only really need to call shutdown() if we're in the ESTABLISHED TCP state, since that is the only case where the client is initiating a close of an established connection. If the socket is in FIN_WAIT1 or FIN_WAIT2, then we've already initiated socket shutdown and are waiting for the server's reply, so do nothing. In all other cases where we've already received a FIN from the server, we should be able to just close the socket. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 0a6ff58edbfb26469a095ab964095506352fc960 Author: Trond Myklebust Date: Tue Aug 24 11:38:17 2021 -0400 SUNRPC: Simplify socket shutdown when not reusing TCP ports If we're not required to reuse the TCP port, then we can just immediately close the socket, and leave the cleanup details to the TCP layer. Fixes: e6237b6feb37 ("NFSv4.1: Don't rebind to the same source port when reconnecting to the server") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit ea41a498cc646349d64eda7e8a4e23ae999bc259 Author: Stefan Binding Date: Fri Aug 27 12:02:52 2021 +0100 ALSA: hda/cs8409: Initialize Codec only in init fixup. It is not necessary to initialize the codec during both probe and inside the init fixup. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210827110252.5361-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 424e531b47f83da87490464c5bf633dfb624fe6a Author: Stefan Binding Date: Fri Aug 27 12:02:51 2021 +0100 ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary Type Detection should only be run after init and when the controls have been built. There is no need to run it multiple times. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210827110252.5361-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 4267c5a8f3133db0572cd9abee059b42cafbbdad Author: Takashi Iwai Date: Fri Aug 27 22:33:11 2021 +0200 ALSA: usb-audio: Work around for XRUN with low latency playback The recent change for low latency playback works in most of test cases but it turned out still to hit errors on some use cases, most notably with JACK with small buffer sizes. This is because USB-audio driver fills up and submits full URBs at the beginning, while the URBs would return immediately and try to fill more -- that can easily trigger XRUN. It was more or less expected, but in the small buffer size, the problem became pretty obvious. Fixing this behavior properly would require the change of the fundamental driver design, so it's no trivial task, unfortunately. Instead, here we work around the problem just by switching back to the old method when the given configuration is too fragile with the low latency stream handling. As a threshold, we calculate the total buffer bytes in all plus one URBs, and check whether it's beyond the PCM buffer bytes. The one extra URB is needed because XRUN happens at the next submission after the first round. Fixes: 307cc9baac5c ("ALSA: usb-audio: Reduce latency at playback start, take#2") Cc: Link: https://lore.kernel.org/r/20210827203311.5987-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit f3eef46f0518a2b32ca1244015820c35a22cfe4a Author: Zubin Mithra Date: Fri Aug 27 08:37:35 2021 -0700 ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Syzkaller reported a divide error in snd_pcm_lib_ioctl. fifo_size is of type snd_pcm_uframes_t(unsigned long). If frame_size is 0x100000000, the error occurs. Fixes: a9960e6a293e ("ALSA: pcm: fix fifo_size frame calculation") Signed-off-by: Zubin Mithra Reviewed-by: Guenter Roeck Cc: Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org Signed-off-by: Takashi Iwai commit b357d9717be7f95fde2c6c4650b186a995b71e59 Author: Brett Creeley Date: Tue Aug 24 12:27:53 2021 -0700 ice: Only lock to update netdev dev_addr commit 3ba7f53f8bf1 ("ice: don't remove netdev->dev_addr from uc sync list") introduced calls to netif_addr_lock_bh() and netif_addr_unlock_bh() in the driver's ndo_set_mac() callback. This is fine since the driver is updated the netdev's dev_addr, but since this is a spinlock, the driver cannot sleep when the lock is held. Unfortunately the functions to add/delete MAC filters depend on a mutex. This was causing a trace with the lock debug kernel config options enabled when changing the mac address via iproute. [ 203.273059] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281 [ 203.273065] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6698, name: ip [ 203.273068] Preemption disabled at: [ 203.273068] [] ice_set_mac_address+0x8b/0x1c0 [ice] [ 203.273097] CPU: 31 PID: 6698 Comm: ip Tainted: G S W I 5.14.0-rc4 #2 [ 203.273100] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020 [ 203.273102] Call Trace: [ 203.273107] dump_stack_lvl+0x33/0x42 [ 203.273113] ? ice_set_mac_address+0x8b/0x1c0 [ice] [ 203.273124] ___might_sleep.cold.150+0xda/0xea [ 203.273131] mutex_lock+0x1c/0x40 [ 203.273136] ice_remove_mac+0xe3/0x180 [ice] [ 203.273155] ? ice_fltr_add_mac_list+0x20/0x20 [ice] [ 203.273175] ice_fltr_prepare_mac+0x43/0xa0 [ice] [ 203.273194] ice_set_mac_address+0xab/0x1c0 [ice] [ 203.273206] dev_set_mac_address+0xb8/0x120 [ 203.273210] dev_set_mac_address_user+0x2c/0x50 [ 203.273212] do_setlink+0x1dd/0x10e0 [ 203.273217] ? __nla_validate_parse+0x12d/0x1a0 [ 203.273221] __rtnl_newlink+0x530/0x910 [ 203.273224] ? __kmalloc_node_track_caller+0x17f/0x380 [ 203.273230] ? preempt_count_add+0x68/0xa0 [ 203.273236] ? _raw_spin_lock_irqsave+0x1f/0x30 [ 203.273241] ? kmem_cache_alloc_trace+0x4d/0x440 [ 203.273244] rtnl_newlink+0x43/0x60 [ 203.273245] rtnetlink_rcv_msg+0x13a/0x380 [ 203.273248] ? rtnl_calcit.isra.40+0x130/0x130 [ 203.273250] netlink_rcv_skb+0x4e/0x100 [ 203.273256] netlink_unicast+0x1a2/0x280 [ 203.273258] netlink_sendmsg+0x242/0x490 [ 203.273260] sock_sendmsg+0x58/0x60 [ 203.273263] ____sys_sendmsg+0x1ef/0x260 [ 203.273265] ? copy_msghdr_from_user+0x5c/0x90 [ 203.273268] ? ____sys_recvmsg+0xe6/0x170 [ 203.273270] ___sys_sendmsg+0x7c/0xc0 [ 203.273272] ? copy_msghdr_from_user+0x5c/0x90 [ 203.273274] ? ___sys_recvmsg+0x89/0xc0 [ 203.273276] ? __netlink_sendskb+0x50/0x50 [ 203.273278] ? mod_objcg_state+0xee/0x310 [ 203.273282] ? __dentry_kill+0x114/0x170 [ 203.273286] ? get_max_files+0x10/0x10 [ 203.273288] __sys_sendmsg+0x57/0xa0 [ 203.273290] do_syscall_64+0x37/0x80 [ 203.273295] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 203.273296] RIP: 0033:0x7f8edf96e278 [ 203.273298] Code: 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 25 63 2c 00 8b 00 85 c0 75 17 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 41 89 d4 55 [ 203.273300] RSP: 002b:00007ffcb8bdac08 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 203.273303] RAX: ffffffffffffffda RBX: 000000006115e0ae RCX: 00007f8edf96e278 [ 203.273304] RDX: 0000000000000000 RSI: 00007ffcb8bdac70 RDI: 0000000000000003 [ 203.273305] RBP: 0000000000000000 R08: 0000000000000001 R09: 00007ffcb8bda5b0 [ 203.273306] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 203.273306] R13: 0000555e10092020 R14: 0000000000000000 R15: 0000000000000005 Fix this by only locking when changing the netdev->dev_addr. Also, make sure to restore the old netdev->dev_addr on any failures. Fixes: 3ba7f53f8bf1 ("ice: don't remove netdev->dev_addr from uc sync list") Signed-off-by: Brett Creeley Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 9ee313433c483e4a6ecd517c38c0f8aee1962c53 Author: Jacob Keller Date: Mon Aug 23 17:01:49 2021 -0700 ice: restart periodic outputs around time changes When we enabled auxiliary input/output support for the E810 device, we forgot to add logic to restart the output when we change time. This is important as the periodic output will be incorrect after a time change otherwise. This unfortunately includes the adjust time function, even though it uses an atomic hardware interface. The atomic adjustment can still cause the pin output to stall permanently, so we need to stop and restart it. Introduce wrapper functions to temporarily disable and then re-enable the clock outputs. Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins") Signed-off-by: Jacob Keller Tested-by: Sunitha D Mekala Signed-off-by: Tony Nguyen commit 0dc3ad3f859d3a65b335c861ec342d31d91e8bc8 Author: Greg Kroah-Hartman Date: Fri Aug 27 21:21:25 2021 +0200 Revert "bus: mhi: Add inbound buffers allocation flag" This reverts commit 0092a1e3f7636ff4e202a41b0320690699247e22 This should be reverted in the char-misc-next branch to make merging with Linus's branch possible due to issues with the mhi code that was found in the networking tree. Link: https://lore.kernel.org/r/20210827175852.GB15018@thinkpad Reported-by: Manivannan Sadhasivam Reported-by: Stephen Rothwell Cc: Arnd Bergmann Cc: Bhaumik Bhatt Cc: Hemant Kumar Cc: Jakub Kicinski Cc: Kalle Valo Cc: Loic Poulain Cc: Manivannan Sadhasivam Signed-off-by: Greg Kroah-Hartman commit 2bc4eb943b1b27606cd6d63be69f2197cad15173 Author: Rafael J. Wysocki Date: Wed Aug 25 20:31:10 2021 +0200 ACPI: power: Drop name from struct acpi_power_resource Drop the name field (that only is used in diagnostic messages) from struct acpi_power_resource and use the name of the power resource device object instead of it. Signed-off-by: Rafael J. Wysocki commit fad40a624854ad14a88ee0277b9e8207bfc6d95a Author: Rafael J. Wysocki Date: Fri Aug 27 21:07:58 2021 +0200 ACPI: power: Use acpi_handle_debug() to print debug messages Use acpi_handle_debug() to print diagnostic messages regarding ACPI power resources so as to make it easier to correlate the kernel messages with the power resource objects in the ACPI namespace that they are about. Signed-off-by: Rafael J. Wysocki commit 7d5d8d7156892f82cf40b63228ce788248cc57a3 Author: Namjae Jeon Date: Fri Aug 27 10:18:05 2021 +0900 ksmbd: fix __write_overflow warning in ndr_read_string Dan reported __write_overflow warning in ndr_read_string. CC [M] fs/ksmbd/ndr.o In file included from ./include/linux/string.h:253, from ./include/linux/bitmap.h:11, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:22, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/ksmbd/ndr.c:7: In function memcpy, inlined from ndr_read_string at fs/ksmbd/ndr.c:86:2, inlined from ndr_decode_dos_attr at fs/ksmbd/ndr.c:167:2: ./include/linux/fortify-string.h:219:4: error: call to __write_overflow declared with attribute error: detected write beyond size of object __write_overflow(); ^~~~~~~~~~~~~~~~~~ This seems to be a false alarm because hex_attr size is always smaller than n->length. This patch fix this warning by allocation hex_attr with n->length. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 656164181eece68a2f99f0b8a1c5558184b67d7b Author: Geert Uytterhoeven Date: Tue Aug 24 17:23:38 2021 +0200 PM: domains: Fix domain attach for CONFIG_PM_OPP=n If CONFIG_PM_OPP=n, of_get_required_opp_performance_state() always returns -EOPNOTSUPP, and all drivers for devices that are part of a PM Domain fail to probe with: failed to set required performance state for power-domain foo: -95 probe of bar failed with error -95 Fix this by treating -EOPNOTSUPP the same as -ENODEV. Fixes: c016baf7dc58e77a ("PM: domains: Add support for 'required-opps' to set default perf state") Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 47bb27a20d6ea22cd092c1fc2bb4fcecac374838 Author: Chengfeng Ye Date: Fri Aug 27 00:41:40 2021 -0700 selftests/bpf: Fix potential unreleased lock This lock is not released if the program return at the patched branch. Signed-off-by: Chengfeng Ye Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210827074140.118671-1-cyeaa@connect.ust.hk commit 02a2484cf8d17a2acf3b9b151147bafaa55ad38c Author: Mario Limonciello Date: Thu Aug 26 13:40:56 2021 -0500 hwmon: (k10temp) Don't show Tdie for all Zen/Zen2/Zen3 CPU/APU Tdie is an offset calculation that should only be shown when temp_offset is actually put into a table. This is useless to show for all CPU/APU. Show it only when necessary. Signed-off-by: Mario Limonciello Signed-off-by: Guenter Roeck commit 128066c88770c7b26352fa400cb67297775cc4e8 Author: Mario Limonciello Date: Thu Aug 26 13:40:52 2021 -0500 hwmon: (k10temp) Add additional missing Zen2 and Zen3 APUs These follow the rest of the existing codepaths for families 17h and 19h. Signed-off-by: Mario Limonciello Signed-off-by: Guenter Roeck commit a3e03bc1368c1bc16e19b001fc96dc7430573cc8 Author: Halil Pasic Date: Fri Aug 27 14:54:29 2021 +0200 KVM: s390: index kvm->arch.idle_mask by vcpu_idx While in practice vcpu->vcpu_idx == vcpu->vcp_id is often true, it may not always be, and we must not rely on this. Reason is that KVM decides the vcpu_idx, userspace decides the vcpu_id, thus the two might not match. Currently kvm->arch.idle_mask is indexed by vcpu_id, which implies that code like for_each_set_bit(vcpu_id, kvm->arch.idle_mask, online_vcpus) { vcpu = kvm_get_vcpu(kvm, vcpu_id); do_stuff(vcpu); } is not legit. Reason is that kvm_get_vcpu expects an vcpu_idx, not an vcpu_id. The trouble is, we do actually use kvm->arch.idle_mask like this. To fix this problem we have two options. Either use kvm_get_vcpu_by_id(vcpu_id), which would loop to find the right vcpu_id, or switch to indexing via vcpu_idx. The latter is preferable for obvious reasons. Let us make switch from indexing kvm->arch.idle_mask by vcpu_id to indexing it by vcpu_idx. To keep gisa_int.kicked_mask indexed by the same index as idle_mask lets make the same change for it as well. Fixes: 1ee0bc559dc3 ("KVM: s390: get rid of local_int array") Signed-off-by: Halil Pasic Reviewed-by: Christian Bornträger Reviewed-by: Claudio Imbrenda Cc: # 3.15+ Link: https://lore.kernel.org/r/20210827125429.1912577-1-pasic@linux.ibm.com Signed-off-by: Christian Borntraeger commit 7119decf47d9867266459615be502e5d2cecedba Author: Janis Schoetterl-Glausch Date: Tue Jun 29 10:55:30 2021 +0200 KVM: s390: Enable specification exception interpretation When this feature is enabled the hardware is free to interpret specification exceptions generated by the guest, instead of causing program interruption interceptions. This benefits (test) programs that generate a lot of specification exceptions (roughly 4x increase in exceptions/sec). Interceptions will occur as before if ICTL_PINT is set, i.e. if guest debug is enabled. There is no indication if this feature is available or not and the hardware is free to interpret or not. So we can simply set this bit and if the hardware ignores it we fall back to intercept 8 handling. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/linux-s390/20210706114714.3936825-1-scgl@linux.ibm.com/ Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit 1ab011b0bf073ef02abf15344bb59e383aa15457 Author: Aravindhan Gunasekaran Date: Mon Aug 9 20:23:40 2021 +0530 igc: Add support for CBS offloading Implement support for Credit-based shaper(CBS) Qdisc hardware offload mode in the driver. There are two sets of IEEE802.1Qav (CBS) HW logic in i225 controller and this patch supports enabling them in the top two priority TX queues. Driver implemented as recommended by Foxville External Architecture Specification v0.993. Idleslope and Hi-credit are the CBS tunable parameters for i225 NIC, programmed in TQAVCC and TQAVHC registers respectively. In-order for IEEE802.1Qav (CBS) algorithm to work as intended and provide BW reservation CBS should be enabled in highest priority queue first. If we enable CBS on any of low priority queues, the traffic in high priority queue does not allow low priority queue to be selected for transmission and bandwidth reservation is not guaranteed. Signed-off-by: Aravindhan Gunasekaran Signed-off-by: Mallikarjuna Chilakala Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 61572d5f8f91d8603d8db028e1ec9e18fc0ca245 Author: Vinicius Costa Gomes Date: Mon Aug 9 20:23:39 2021 +0530 igc: Simplify TSN flags handling Separates the procedure done during reset from applying a configuration, knowing when the code is executing allow us to separate the better what changes the hardware state from what changes only the driver state. Introduces a flag for bookkeeping the driver state of TSN features. When Qav and frame-preemption is also implemented this flag makes it easier to keep track on whether a TSN feature driver state is enabled or not though controller state changes, say, during a reset. Signed-off-by: Vinicius Costa Gomes Signed-off-by: Aravindhan Gunasekaran Signed-off-by: Mallikarjuna Chilakala Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit c814a2d2d48f04eb3c4480e8f7835a5f2b235f85 Author: Vinicius Costa Gomes Date: Mon Aug 9 20:23:38 2021 +0530 igc: Use default cycle 'start' and 'end' values for queues Sets default values for each queue cycle start and cycle end. This allows some simplification in the handling of these configurations as most TSN features in i225 require a cycle to be configured. In i225, cycle start and end time is required to be programmed for CBS to work properly. Signed-off-by: Vinicius Costa Gomes Signed-off-by: Aravindhan Gunasekaran Signed-off-by: Mallikarjuna Chilakala Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 4dd0d5c33c3ebf24a07cae6141648aeb7ba56072 Author: Jacob Keller Date: Mon Aug 23 17:01:48 2021 -0700 ice: add lock around Tx timestamp tracker flush The driver didn't take the lock while flushing the Tx tracker, which could cause a race where one thread is trying to read timestamps out while another thread is trying to read the tracker to check the timestamps. Avoid this by ensuring that flushing is locked against read accesses. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 1f0cbb3e8916142382551c336065cbcbfb77a11e Author: Jacob Keller Date: Mon Aug 23 17:01:47 2021 -0700 ice: remove dead code for allocating pin_config We have code in the ice driver which allocates the pin_config structure if n_pins is > 0, but we never set n_pins to be greater than zero. There's no reason to keep this code until we actually have pin_config support. Remove this. We can re-add it properly when we implement support for pin_config for E810-T devices. Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins") Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 84c5fb8c4264ec12ef9d21905c562d2297a0234e Author: Jacob Keller Date: Mon Aug 23 17:01:46 2021 -0700 ice: fix Tx queue iteration for Tx timestamp enablement The driver accidentally copied the ice_for_each_rxq iterator when implementing enablement of the ptp_tx bit for the Tx rings. We still load the Tx rings and set the ptp_tx field, but we iterate over the count of the num_rxq. If the number of Tx and Rx queues differ, this could either cause a buffer overrun when accessing the tx_rings list if num_txq is greater than num_rxq, or it could cause us to fail to enable Tx timestamps for some rings. This was not noticed originally as we generally have the same number of Tx and Rx queues. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 90499ad00ca59320b5bb43392b7931e1bd84cad2 Author: Pavel Begunkov Date: Wed Aug 25 20:51:40 2021 +0100 io_uring: add build check for buf_index overflows req->buf_index is u16 and so we rely on registered buffers indexes fitting into it. Add a build check, so when the upper limit for the number of buffers is lifted we get a compliation fail but not lurking problems. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/787e8e1a17cea51ca6301426b1c4c4887b8bd676.1629920396.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b18a1a4574d2d15f1b0c84658d4549ccbf241fee Author: Pavel Begunkov Date: Wed Aug 25 20:51:39 2021 +0100 io_uring: clarify io_req_task_cancel() locking It's too easy to forget and misjudge about synchronisation in io_req_task_cancel(), add a comment clarifying it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/71099083835f983a1fd73d5a3da6391924da8300.1629920396.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit bc17bed5fd73ef1a9aed39f3b0ea26936dad60b8 Author: YueHaibing Date: Wed Aug 4 21:01:05 2021 +0800 printk/index: Fix -Wunused-function warning If CONFIG_MODULES is n, we got this: kernel/printk/index.c:146:13: warning: ‘pi_remove_file’ defined but not used [-Wunused-function] Move it inside #ifdef block to fix this warning. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210804130105.18732-1-yuehaibing@huawei.com commit a75c956162978097c0a60d95971c97ae486a68d7 Merge: f80c8e6864eb1 885814a97f5a1 Author: Ulf Hansson Date: Fri Aug 27 16:35:55 2021 +0200 Merge branch 'fixes' into next commit 2e5f3a69b6fcd52a64ce3d746c6ee8390b6cabe8 Author: Sean Anderson Date: Thu Aug 26 15:25:49 2021 -0400 tty: serial: uartlite: Use read_poll_timeout for a polling loop read_poll_timeout was recently introduced, and can be used to simplify our console polling loop. This results in a slight reduction in code. early_uartlite_putc can't get the same treatment, because it can be called before udelay is set up. Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20210826192549.3203071-1-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman commit 3620a89b7d27138c716e5cf537a0bf6606a3a1b3 Author: Sean Anderson Date: Thu Aug 26 15:43:23 2021 -0400 tty: serial: uartlite: Use constants in early_uartlite_putc Use the constants defined at the beginning of this file instead of integer literals when accessing registers. This makes this code easier to read, and obviates the need for some explanatory comments. Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20210826194323.3209227-1-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman commit a99009bc4f2f0b46e6c553704fda0b67e04395f5 Author: Mihai Carabas Date: Thu Aug 19 18:12:26 2021 +0300 misc/pvpanic: fix set driver data Add again dev_set_drvdata(), but this time in devm_pvpanic_probe(), in order for dev_get_drvdata() to not return NULL. Fixes: 394febc9d0a6 ("misc/pvpanic: Make 'pvpanic_probe()' resource managed") Reviewed-by: Andy Shevchenko Signed-off-by: Mihai Carabas Link: https://lore.kernel.org/r/1629385946-4584-2-git-send-email-mihai.carabas@oracle.com Signed-off-by: Greg Kroah-Hartman commit a30dc6cf0dc51419021550152e435736aaef8799 Author: Wang Hai Date: Wed Aug 18 20:48:45 2021 +0800 VMCI: fix NULL pointer dereference when unmapping queue pair I got a NULL pointer dereference report when doing fuzz test: Call Trace: qp_release_pages+0xae/0x130 qp_host_unregister_user_memory.isra.25+0x2d/0x80 vmci_qp_broker_unmap+0x191/0x320 ? vmci_host_do_alloc_queuepair.isra.9+0x1c0/0x1c0 vmci_host_unlocked_ioctl+0x59f/0xd50 ? do_vfs_ioctl+0x14b/0xa10 ? tomoyo_file_ioctl+0x28/0x30 ? vmci_host_do_alloc_queuepair.isra.9+0x1c0/0x1c0 __x64_sys_ioctl+0xea/0x120 do_syscall_64+0x34/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae When a queue pair is created by the following call, it will not register the user memory if the page_store is NULL, and the entry->state will be set to VMCIQPB_CREATED_NO_MEM. vmci_host_unlocked_ioctl vmci_host_do_alloc_queuepair vmci_qp_broker_alloc qp_broker_alloc qp_broker_create // set entry->state = VMCIQPB_CREATED_NO_MEM; When unmapping this queue pair, qp_host_unregister_user_memory() will be called to unregister the non-existent user memory, which will result in a null pointer reference. It will also change VMCIQPB_CREATED_NO_MEM to VMCIQPB_CREATED_MEM, which should not be present in this operation. Only when the qp broker has mem, it can unregister the user memory when unmapping the qp broker. Only when the qp broker has no mem, it can register the user memory when mapping the qp broker. Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Cc: stable Reported-by: Hulk Robot Reviewed-by: Jorgen Hansen Signed-off-by: Wang Hai Link: https://lore.kernel.org/r/20210818124845.488312-1-wanghai38@huawei.com Signed-off-by: Greg Kroah-Hartman commit f8cefead37ddc111786b14da73286204eb8509b5 Author: jing yangyang Date: Thu Aug 19 19:17:52 2021 -0700 char: mware: fix returnvar.cocci warnings Remove unneeded variables when "0" can be returned. Generated by: scripts/coccinelle/misc/returnvar.cocci Reported-by: Zeal Robot Signed-off-by: jing yangyang Link: https://lore.kernel.org/r/20210820021752.10927-1-jing.yangyang@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 0be883a0d795d9146f5325de582584147dd0dcdc Author: Colin Ian King Date: Fri Jul 30 11:07:10 2021 +0100 parport: remove non-zero check on count The check for count appears to be incorrect since a non-zero count check occurs a couple of statements earlier. Currently the check is always false and the dev->port->irq != PARPORT_IRQ_NONE part of the check is never tested and the if statement is dead-code. Fix this by removing the check on count. Note that this code is pre-git history, so I can't find a sha for it. Acked-by: Sudip Mukherjee Signed-off-by: Colin Ian King Addresses-Coverity: ("Logically dead code") Link: https://lore.kernel.org/r/20210730100710.27405-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit f6bc526accf861728d36b12fbc25ac94cd057fc9 Author: Michael Straube Date: Fri Aug 27 11:41:44 2021 +0200 staging: r8188eu: rename fields of struct rtl_ps Rename fields of struct rtl_ps to avoid camel case. PreCCAState -> pre_cca_state CurCCAState -> cur_cca_state PreRFState -> pre_rf_state CurRFState -> cur_rf_state Rssi_val_min -> rssi_val_min Reg874 -> reg_874 RegC70 -> reg_c70 Reg85C -> reg_85c RegA74 -> reg_a74 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210827094144.13290-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9f801ac94d8b6613174a1bafdac684a1c05646ba Author: Michael Straube Date: Fri Aug 27 11:41:43 2021 +0200 staging: r8188eu: remove ODM_DynamicPrimaryCCA_DupRTS() Function ODM_DynamicPrimaryCCA_DupRTS() is unused, remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210827094144.13290-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9f30a2312c0b6d19f444903491ff794ad40b6009 Author: Michael Straube Date: Fri Aug 27 11:41:42 2021 +0200 staging: r8188eu: rename fields of struct dyn_primary_cca Rename fields of struct dyn_primary_cca to avoid camel case. PriCCA_flag -> pri_cca_flag DupRTS_flag -> dup_rts_flag Monitor_flag -> monitor_flag Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210827094144.13290-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a01b0006de7632656b2711b67c1d59b76af4d6a2 Author: Michael Straube Date: Fri Aug 27 11:41:41 2021 +0200 staging: r8188eu: rename struct field Wifi_Error_Status Rename struct field Wifi_Error_Status to avoid camel case. Wifi_Error_Status -> wifi_error_status Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210827094144.13290-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 71419e03d85ff3e46b3c61238bd1e369f313c280 Author: Fabio M. De Francesco Date: Fri Aug 27 12:08:13 2021 +0200 staging: r8188eu: Provide a TODO file for this driver Provide a TODO file that lists the tasks that should be carried out in order to move this driver off drivers/staging. Acked-by: Phillip Potter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210827100813.18610-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c1587d99f9305aa4f10b47fcf1981012aa5381f Author: Rui Miguel Silva Date: Fri Aug 27 14:11:54 2021 +0100 usb: isp1760: otg control register access The set/clear of the otg control values is done writing to two different 16bit registers, however we setup the regmap width for isp1760/61 to 32bit value bits. So, just access the clear register address (0x376)as the high part of the otg control register set (0x374), and write the values in one go to make sure they get clear/set. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-6-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 955d0fb590f18ec5c3a4085c7d0e39b6abde0dd6 Author: Rui Miguel Silva Date: Fri Aug 27 14:11:53 2021 +0100 usb: isp1760: use the right irq status bit Instead of using the fields enum values to check interrupts trigged, use the correct bit values. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-5-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 36815a4a0763bb405ebd776c45553005c1ef7a15 Author: Rui Miguel Silva Date: Fri Aug 27 14:11:52 2021 +0100 usb: isp1760: write to status and address register We were already writing directly the port status register to trigger changes in isp1763. The same is needed in other IP from the family, including also to setup the read address before reading from device. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-4-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit cbfa3effdf5c2d411c9ce9820f3d33d77bc4697d Author: Rui Miguel Silva Date: Fri Aug 27 14:11:51 2021 +0100 usb: isp1760: fix qtd fill length When trying to send bulks bigger than the biggest block size we need to split them over several qtd. Fix this limiting the maximum qtd size to largest block size. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit f757f9291f920e1da4c6cfd4064c6bf59639983e Author: Rui Miguel Silva Date: Fri Aug 27 14:11:50 2021 +0100 usb: isp1760: fix memory pool initialization The loops to setup the memory pool were skipping some blocks, that was not visible on the ISP1763 because it has fewer blocks than the ISP1761. But won testing on that IP from the family that would be an issue. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-2-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4baf0e0b329874ec5e85480f53851b5f05a7ae58 Author: Johannes Berg Date: Fri Aug 27 09:48:04 2021 +0200 um: vector: adjust to coalesce API changes The API changes were propagated to most drivers, but clearly arch/um/drivers/ was missed, perhaps due to looking only at the drivers/ folder. Fix that. Fixes: f3ccfda19319 ("ethtool: extend coalesce setting uAPI with CQE mode") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20210827094759.f3ab06684bd0.I985181cc00fe017cfe6413d9e1bb720cbe852e6d@changeid Signed-off-by: Jakub Kicinski commit b8155e95de38b25a69dfb03e4731fd6c5a28531e Author: Dan Carpenter Date: Tue Aug 24 10:51:04 2021 +0300 fs/ntfs3: Fix error handling in indx_insert_into_root() There are three bugs in this code: 1) If indx_get_root() fails, then return -EINVAL instead of success. 2) On the "/* make root external */" -EOPNOTSUPP; error path it should free "re" but it has a memory leak. 3) If indx_new() fails then it will lead to an error pointer dereference when we call put_indx_node(). I've re-written the error handling to be more clear. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dan Carpenter Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 8c83a4851da1c7eda83098ade238665b15774da3 Author: Dan Carpenter Date: Tue Aug 24 10:50:15 2021 +0300 fs/ntfs3: Potential NULL dereference in hdr_find_split() The "e" pointer is dereferenced before it has been checked for NULL. Move the dereference after the NULL check to prevent an Oops. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dan Carpenter Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 04810f000afdbdd37825ca7f563f036119422cb7 Author: Dan Carpenter Date: Tue Aug 24 10:49:32 2021 +0300 fs/ntfs3: Fix error code in indx_add_allocate() Return -EINVAL if ni_find_attr() fails. Don't return success. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dan Carpenter Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 2926e4297053c735ab65450192dfba32a4f47fa9 Author: Dan Carpenter Date: Tue Aug 24 14:48:58 2021 +0300 fs/ntfs3: fix an error code in ntfs_get_acl_ex() The ntfs_get_ea() function returns negative error codes or on success it returns the length. In the original code a zero length return was treated as -ENODATA and results in a NULL return. But it should be treated as an invalid length and result in an PTR_ERR(-EINVAL) return. Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Signed-off-by: Dan Carpenter Signed-off-by: Konstantin Komarov commit a1b04d380ab64790a7b4a8eb52e14679e47065ab Author: Dan Carpenter Date: Tue Aug 24 14:52:36 2021 +0300 fs/ntfs3: add checks for allocation failure Add a check for when the kzalloc() in init_rsttbl() fails. Some of the callers checked for NULL and some did not. I went down the call tree and added NULL checks where ever they were missing. Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") Signed-off-by: Dan Carpenter Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 345482bc431f6492beb464696341626057f67771 Author: Kari Argillander Date: Tue Aug 24 21:37:08 2021 +0300 fs/ntfs3: Use kcalloc/kmalloc_array over kzalloc/kmalloc Use kcalloc/kmalloc_array over kzalloc/kmalloc when we allocate array. Checkpatch found these after we did not use our own defined allocation wrappers. Reviewed-by: Christoph Hellwig Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 195c52bdd5d5ecfdabf5a7c6159efe299e534f84 Author: Kari Argillander Date: Tue Aug 24 21:37:07 2021 +0300 fs/ntfs3: Do not use driver own alloc wrappers Problem with these wrapper is that we cannot take off example GFP_NOFS flag. It is not recomended use those in all places. Also if we change one driver specific wrapper to kernel wrapper then it would look really weird. People should be most familiar with kernel wrappers so let's just use those ones. Driver specific alloc wrapper also confuse some static analyzing tools, good example is example kernels checkpatch tool. After we converter these to kernel specific then warnings is showed. Following Coccinelle script was used to automate changing. virtual patch @alloc depends on patch@ expression x; expression y; @@ ( - ntfs_malloc(x) + kmalloc(x, GFP_NOFS) | - ntfs_zalloc(x) + kzalloc(x, GFP_NOFS) | - ntfs_vmalloc(x) + kvmalloc(x, GFP_NOFS) | - ntfs_free(x) + kfree(x) | - ntfs_vfree(x) + kvfree(x) | - ntfs_memdup(x, y) + kmemdup(x, y, GFP_NOFS) ) Reviewed-by: Christoph Hellwig Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit fa3cacf544636b2dc48cfb2f277a2071f14d66a2 Author: Kari Argillander Date: Thu Aug 26 11:56:29 2021 +0300 fs/ntfs3: Use kernel ALIGN macros over driver specific The static checkers (Smatch) were complaining because QuadAlign() was buggy. If you try to align something higher than UINT_MAX it got truncated to a u32. Smatch warning was: fs/ntfs3/attrib.c:383 attr_set_size_res() warn: was expecting a 64 bit value instead of '~7' So that this will not happen again we will change all these macros to kernel made ones. This can also help some other static analyzing tools to give us better warnings. Patch was generated with Coccinelle script and after that some style issue was hand fixed. Coccinelle script: virtual patch @alloc depends on patch@ expression x; @@ ( - #define QuadAlign(n) (((n) + 7u) & (~7u)) | - QuadAlign(x) + ALIGN(x, 8) | - #define IsQuadAligned(n) (!((size_t)(n)&7u)) | - IsQuadAligned(x) + IS_ALIGNED(x, 8) | - #define Quad2Align(n) (((n) + 15u) & (~15u)) | - Quad2Align(x) + ALIGN(x, 16) | - #define IsQuad2Aligned(n) (!((size_t)(n)&15u)) | - IsQuad2Aligned(x) + IS_ALIGNED(x, 16) | - #define Quad4Align(n) (((n) + 31u) & (~31u)) | - Quad4Align(x) + ALIGN(x, 32) | - #define IsSizeTAligned(n) (!((size_t)(n) & (sizeof(size_t) - 1))) | - IsSizeTAligned(x) + IS_ALIGNED(x, sizeof(size_t)) | - #define DwordAlign(n) (((n) + 3u) & (~3u)) | - DwordAlign(x) + ALIGN(x, 4) | - #define IsDwordAligned(n) (!((size_t)(n)&3u)) | - IsDwordAligned(x) + IS_ALIGNED(x, 4) | - #define WordAlign(n) (((n) + 1u) & (~1u)) | - WordAlign(x) + ALIGN(x, 2) | - #define IsWordAligned(n) (!((size_t)(n)&1u)) | - IsWordAligned(x) + IS_ALIGNED(x, 2) | ) Reported-by: Dan Carpenter Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 24516d481dfc6c7728ffe36280ca8cf4640d119a Author: Kari Argillander Date: Tue Aug 24 21:37:06 2021 +0300 fs/ntfs3: Restyle comment block in ni_parse_reparse() First of this fix one none utf8 char in this comment block. Maybe this happened because error in filesystem ;) Also this block was hard to read because long lines so make it max 80 long. And while we doing this stuff make little better grammer. Signed-off-by: Kari Argillander Reviewed-by: Christoph Hellwig Signed-off-by: Konstantin Komarov commit 1263eddfea9988125a4b9608efecc8aff2c721f9 Author: Jiapeng Chong Date: Thu Aug 19 16:23:37 2021 +0800 fs/ntfs3: Remove unused including Eliminate the follow versioncheck warning: ./fs/ntfs3/inode.c: 16 linux/version.h not needed. Reported-by: Abaci Robot Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Jiapeng Chong Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit abfeb2ee2103f07dd93b9d7b32317e26d1c8ef79 Author: Gustavo A. R. Silva Date: Wed Aug 18 17:21:46 2021 -0500 fs/ntfs3: Fix fall-through warnings for Clang Fix the following fallthrough warnings: fs/ntfs3/inode.c:1792:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/ntfs3/index.c:178:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Nathan Chancellor Signed-off-by: Konstantin Komarov commit be87e821fdb5ec8c6d404f29e118130c7879ce5b Author: Kari Argillander Date: Wed Aug 18 04:06:47 2021 +0300 fs/ntfs3: Fix one none utf8 char in source file In one source file there is for some reason non utf8 char. But hey this is fs development so this kind of thing might happen. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 8c01308b6d6b2bc8e9163c6a3400856fb782dee6 Author: Nathan Chancellor Date: Mon Aug 16 12:30:41 2021 -0700 fs/ntfs3: Remove unused variable cnt in ntfs_security_init() Clang warns: fs/ntfs3/fsntfs.c:1874:9: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] size_t cnt, off; ^ 1 warning generated. It is indeed unused so remove it. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 71eeb6ace80be7389d942b9647765417e5b039f7 Author: Colin Ian King Date: Mon Aug 16 17:30:25 2021 +0100 fs/ntfs3: Fix integer overflow in multiplication The multiplication of the u32 data_size with a int is being performed using 32 bit arithmetic however the results is being assigned to the variable nbits that is a size_t (64 bit) value. Fix a potential integer overflow by casting the u32 value to a size_t before the multiply to use a size_t sized bit multiply operation. Addresses-Coverity: ("Unintentional integer overflow") Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Colin Ian King Signed-off-by: Konstantin Komarov commit 87790b65343932411af43bc9b218f086ecebd6a5 Author: Kari Argillander Date: Mon Aug 16 15:01:56 2021 +0300 fs/ntfs3: Add ifndef + define to all header files Add guards so that compiler will only include header files once. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 528c9b3d1edf291685151afecd741d176f527ddf Author: Kari Argillander Date: Mon Aug 16 13:37:32 2021 +0300 fs/ntfs3: Use linux/log2 is_power_of_2 function We do not need our own implementation for this function in this driver. It is much better to use generic one. Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov commit f8d87ed9f0d546ac5b05e8e7d2b148d4b77599fa Author: Colin Ian King Date: Mon Aug 16 11:13:08 2021 +0100 fs/ntfs3: Fix various spelling mistakes There is a spelling mistake in a ntfs_err error message. Also fix various spelling mistakes in comments. Signed-off-by: Colin Ian King Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 1be72c8e0786727df375f11c8178ce7e65eea20e Author: Shuai Xue Date: Mon Aug 23 19:56:54 2021 +0800 efi: cper: check section header more appropriately When checking a generic status block, we iterate over all the generic data blocks. The loop condition checks that the generic data block is valid. Because the size of data blocks (excluding error data) may vary depending on the revision and the revision is contained within the data block, we should ensure that enough of the current data block is valid appropriately for different revision. Signed-off-by: Shuai Xue Signed-off-by: Ard Biesheuvel commit b31eea2e04c1002e5cb864eefdc718b70d2cb08c Author: Andy Shevchenko Date: Tue Feb 9 18:45:06 2021 +0200 efi: Don't use knowledge about efi_guid_t internals When print GUIDs supply pointer to the efi_guid_t (guid_t) type rather its internal members. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Hallyn Signed-off-by: Ard Biesheuvel commit 5eff88dd6b4badd664d7d3b648103d540b390248 Author: Rasmus Villemoes Date: Wed Apr 21 21:31:46 2021 +0200 efi: cper: fix scnprintf() use in cper_mem_err_location() The last two if-clauses fail to update n, so whatever they might have written at &msg[n] would be cut off by the final nul-termination. That nul-termination is redundant; scnprintf(), just like snprintf(), guarantees a nul-terminated output buffer, provided the buffer size is positive. And there's no need to discount one byte from the initial buffer; vsnprintf() expects to be given the full buffer size - it's not going to write the nul-terminator one beyond the given (buffer, size) pair. Signed-off-by: Rasmus Villemoes Signed-off-by: Ard Biesheuvel commit 9a10867ae54e02a0f204d2eebea5a446fb7a86f9 Author: Pavel Begunkov Date: Fri Aug 27 11:55:01 2021 +0100 io_uring: add task-refs-get helper As we have a more complicated task referencing, which apart from normal task references includes taking tctx->inflight and caching all that, it would be a good idea to have all that isolated in helpers. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d9114d037f1c195897aa13f38a496078eca2afdb.1630023531.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a8295b982c46d4a7c259a4cdd58a2681929068a9 Author: Hao Xu Date: Fri Aug 27 17:46:09 2021 +0800 io_uring: fix failed linkchain code logic Given a linkchain like this: req0(link_flag)-->req1(link_flag)-->...-->reqn(no link_flag) There is a problem: - if some intermediate linked req like req1 's submittion fails, reqs after it won't be cancelled. - sqpoll disabled: maybe it's ok since users can get the error info of req1 and stop submitting the following sqes. - sqpoll enabled: definitely a problem, the following sqes will be submitted in the next round. The solution is to refactor the code logic to: - if a linked req's submittion fails, just mark it and the head(if it exists) as REQ_F_FAIL. Leverage req->result to indicate whether it is failed or cancelled. - submit or fail the whole chain when we come to the end of it. Signed-off-by: Hao Xu Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20210827094609.36052-3-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 14afdd6ee3a0db7bcae887d1951ed21c4d1539cd Author: Hao Xu Date: Fri Aug 27 17:46:08 2021 +0800 io_uring: remove redundant req_set_fail() req_set_fail() in io_submit_sqe() is redundant, remove it. Signed-off-by: Hao Xu Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20210827094609.36052-2-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 20ec197bfa13c5b799fc9527790ea7b5374fc8f2 Author: David Howells Date: Mon Mar 29 13:53:50 2021 +0100 fscache: Use refcount_t for the cookie refcount instead of atomic_t Use refcount_t for the fscache_cookie refcount instead of atomic_t and rename the 'usage' member to 'ref' in such cases. The tracepoints that reference it change from showing "u=%d" to "r=%d". Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431204358.2908479.8006938388213098079.stgit@warthog.procyon.org.uk/ commit 33cba859220b0878b3b2931caa1629a3d2432379 Author: David Howells Date: Fri Jun 18 11:19:49 2021 +0100 fscache: Fix fscache_cookie_put() to not deref after dec fscache_cookie_put() accesses the cookie it has just put inside the tracepoint that monitors the change - but this is something it's not allowed to do if we didn't reduce the count to zero. Fix this by dropping most of those values from the tracepoint and grabbing the cookie debug ID before doing the dec. Also take the opportunity to switch over the usage and where arguments on the tracepoint to put the reason last. Fixes: a18feb55769b ("fscache: Add tracepoints") Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431203107.2908479.3259582550347000088.stgit@warthog.procyon.org.uk/ commit 35b72573e977ed6b18b094136a4fa3e0ffb13603 Author: David Howells Date: Thu Jun 17 14:21:00 2021 +0100 fscache: Fix cookie key hashing The current hash algorithm used for hashing cookie keys is really bad, producing almost no dispersion (after a test kernel build, ~30000 files were split over just 18 out of the 32768 hash buckets). Borrow the full_name_hash() hash function into fscache to do the hashing for cookie keys and, in the future, volume keys. I don't want to use full_name_hash() as-is because I want the hash value to be consistent across arches and over time as the hash value produced may get used on disk. I can also optimise parts of it away as the key will always be a padded array of aligned 32-bit words. Fixes: ec0328e46d6e ("fscache: Maintain a catalogue of allocated cookies") Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431201844.2908479.8293647220901514696.stgit@warthog.procyon.org.uk/ commit 8beabdde18d31ac10c7d211347c361f07c7cd5b0 Author: David Howells Date: Mon Oct 19 21:40:32 2020 +0100 cachefiles: Change %p in format strings to something else Change plain %p in format strings in cachefiles code to something more useful, since %p is now hashed before printing and thus no longer matches the contents of an oops register dump. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/160588476042.3465195.6837847445880367183.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/162431200692.2908479.9253374494073633778.stgit@warthog.procyon.org.uk/ commit c97a72ded933a1ec88fa8f8d7aecef098d3e540b Author: David Howells Date: Mon Oct 19 21:32:55 2020 +0100 fscache: Change %p in format strings to something else Change plain %p in format strings in fscache code to something more useful, since %p is now hashed before printing and thus no longer matches the contents of an oops register dump. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/160588474843.3465195.5446072310069374803.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/162431199509.2908479.2950631488219944294.stgit@warthog.procyon.org.uk/ commit 58f386a73f16cea1f78e8466cc5c402eb7f6fcf8 Author: David Howells Date: Wed May 12 09:59:17 2021 +0100 fscache: Remove the object list procfile Remove the object list procfile from fscache as objects will become entirely internal to the cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431198332.2908479.5847286163455099669.stgit@warthog.procyon.org.uk/ commit 6ae9bd8bb037b7c422bafde746f2338a716f6058 Author: David Howells Date: Wed May 12 09:40:19 2021 +0100 fscache, cachefiles: Remove the histogram stuff Remove the histogram stuff as it's mostly going to be outdated. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431195953.2908479.16770977195634296638.stgit@warthog.procyon.org.uk/ commit 884a76881fc5f5c9c04de1b640bed2c340929842 Author: David Howells Date: Mon Feb 10 10:00:22 2020 +0000 fscache: Procfile to display cookies Add /proc/fs/fscache/cookies to display active cookies. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/158861211871.340223.7223853943667440807.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/159465771021.1376105.6933857529128238020.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/160588460994.3465195.16963417803501149328.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/162431194785.2908479.786917990782538164.stgit@warthog.procyon.org.uk/ commit a055fcc132d4c25b96d1115aea514258810dc6fc Author: Peter Zijlstra Date: Thu Aug 26 10:48:18 2021 +0200 locking/rtmutex: Return success on deadlock for ww_mutex waiters ww_mutexes can legitimately cause a deadlock situation in the lock graph which is resolved afterwards by the wait/wound mechanics. The rtmutex chain walk can detect such a deadlock and returns EDEADLK which in turn skips the wait/wound mechanism and returns EDEADLK to the caller. That's wrong because both lock chains might get EDEADLK or the wrong waiter would back out. Detect that situation and return 'success' in case that the waiter which initiated the chain walk is a ww_mutex with context. This allows the wait/wound mechanics to resolve the situation according to the rules. [ tglx: Split it apart and added changelog ] Reported-by: Sebastian Siewior Fixes: add461325ec5 ("locking/rtmutex: Extend the rtmutex core to support ww_mutex") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YSeWjCHoK4v5OcOt@hirez.programming.kicks-ass.net commit 6467822b8cc96e5feda98c7bf5c6329c6a896c91 Author: Peter Zijlstra Date: Thu Aug 26 09:36:53 2021 +0200 locking/rtmutex: Prevent spurious EDEADLK return caused by ww_mutexes rtmutex based ww_mutexes can legitimately create a cycle in the lock graph which can be observed by a blocker which didn't cause the problem: P1: A, ww_A, ww_B P2: ww_B, ww_A P3: A P3 might therefore be trapped in the ww_mutex induced cycle and run into the lock depth limitation of rt_mutex_adjust_prio_chain() which returns -EDEADLK to the caller. Disable the deadlock detection walk when the chain walk observes a ww_mutex to prevent this looping. [ tglx: Split it apart and added changelog ] Reported-by: Sebastian Siewior Fixes: add461325ec5 ("locking/rtmutex: Extend the rtmutex core to support ww_mutex") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YSeWjCHoK4v5OcOt@hirez.programming.kicks-ass.net commit 2908f5e101e3fb1d478cff1c556966e1af816641 Author: David Howells Date: Mon Feb 10 10:00:22 2020 +0000 fscache: Add a cookie debug ID and use that in traces Add a cookie debug ID and use that in traces and in procfiles rather than displaying the (hashed) pointer to the cookie. This is easier to correlate and we don't lose anything when interpreting oops output since that shows unhashed addresses and registers that aren't comparable to the hashed values. Changes: ver #2: - Fix the fscache_op tracepoint to handle a NULL cookie pointer. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/158861210988.340223.11688464116498247790.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/159465769844.1376105.14119502774019865432.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/160588459097.3465195.1273313637721852165.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/162431193544.2908479.17556704572948300790.stgit@warthog.procyon.org.uk/ commit 49d6baea798672ae42f73e4662ad792797339ad6 Author: Harman Kalra Date: Thu Aug 26 18:03:40 2021 +0530 octeontx2-af: cn10K: support for sched lmtst and other features Enhancing the mailbox scope to support important configurations like enabling scheduled LMTST, disable LMTLINE prefetch, disable early completion for ordered LMTST, as per request from the application. On FLR these configurations will be reset to default. This patch also adds the 95XXO silicon version to octeontx2 silicon list. Signed-off-by: Harman Kalra Signed-off-by: Sunil Goutham Signed-off-by: Geetha sowjanya Signed-off-by: David S. Miller commit 0c1f5f2a5581827fadf493711c4e95528a5730aa Author: Pali Rohár Date: Fri Aug 27 11:27:53 2021 +0200 phy: marvell: phy-mvebu-a3700-comphy: Remove unsupported modes Armada 3700 does not support RXAUI, XFI and neither SFI. Remove unused macros for these unsupported modes. Signed-off-by: Pali Rohár Fixes: 9695375a3f4a ("phy: add A3700 COMPHY support") Signed-off-by: David S. Miller commit b756bbec9cdd83c4702552d30c9fb11d07487000 Author: Pali Rohár Date: Fri Aug 27 11:27:52 2021 +0200 phy: marvell: phy-mvebu-a3700-comphy: Rename HS-SGMMI to 2500Base-X Comphy phy mode 0x3 is incorrectly named. It is not SGMII but rather 2500Base-X mode which runs at 3.125 Gbps speed. Rename macro names and comments to 2500Base-X. Signed-off-by: Pali Rohár Fixes: 9695375a3f4a ("phy: add A3700 COMPHY support") Signed-off-by: David S. Miller commit 3f141ad617458a1dcbd8a473acb7d05fb35ac545 Author: Pali Rohár Date: Fri Aug 27 11:27:51 2021 +0200 phy: marvell: phy-mvebu-cp110-comphy: Rename HS-SGMMI to 2500Base-X Comphy phy mode 0x3 is incorrectly named. It is not SGMII but rather 2500Base-X mode which runs at 3.125 Gbps speed. Rename macro names and comments to 2500Base-X. Signed-off-by: Pali Rohár Fixes: eb6a1fcb53e2 ("phy: mvebu-cp110-comphy: Add SMC call support") Fixes: c2afb2fef595 ("phy: mvebu-cp110-comphy: Rename the macro handling only Ethernet modes") Signed-off-by: David S. Miller commit e31a8cf50292aad57fe2ab817d6ea391a1eefd00 Merge: fe50893aa86eb 0c5c135cdbdac Author: David S. Miller Date: Fri Aug 27 11:20:21 2021 +0100 Merge branch 'hns3-cleanups' Guangbin Huang says: ==================== net: hns3: add some cleanups This series includes some cleanups for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 0c5c135cdbdacdf82ca537c433db07e4a1664065 Author: Hao Chen Date: Fri Aug 27 17:28:24 2021 +0800 net: hns3: uniform type of function parameter cmd The parameter cmd in function definition of hns3_dbg_bd_file_init and hns3_dbg_common_file_init is used type u32, this patch uniforms them in function declaration to type u32 too. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5a24b1fd301e0cf0fc58a76f2716c54d378002cf Author: Peng Li Date: Fri Aug 27 17:28:23 2021 +0800 net: hns3: merge some repetitive macros There are some repetitive macros have same meaning and value, this patch merges them to make code clean. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d7517f8f6b3b12c883ca0975659450ae009b1524 Author: Peng Li Date: Fri Aug 27 17:28:22 2021 +0800 net: hns3: package new functions to simplify hclgevf_mbx_handler code This patch packages two new function to simplify the function hclgevf_mbx_handler, and it can reduce the code cycle complexity and make code more concise. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5f22a80f32deed391011f7ab3ce8951ea89282f8 Author: Peng Li Date: Fri Aug 27 17:28:21 2021 +0800 net: hns3: remove redundant param to simplify code The param msg_q is redundant, copy &req->msg to hdev->arq.msg_q[hdev->arq.tail] directly makes code clean. So removes the redundant param msg_q. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 304cd8e776ddca5021dd9c1d7603ea40afc48ec6 Author: Peng Li Date: Fri Aug 27 17:28:20 2021 +0800 net: hns3: use memcpy to simplify code Use memcpy to copy req->msg.resp_data to resp->additional_info, to simplify the code and improve a little efficiency. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 67821a0cf5c97690d7d00b5afe5137ebe29f60fd Author: Peng Li Date: Fri Aug 27 17:28:19 2021 +0800 net: hns3: remove redundant param mbx_event_pending This patch removes the redundant param mbx_event_pending. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit c511dfff4b655685d7341962a76d9a340150e0ac Author: Huazhong Tan Date: Fri Aug 27 17:28:18 2021 +0800 net: hns3: add hns3_state_init() to do state initialization To improve the readability and maintainability, add hns3_state_init() to initialize the state, and this new function will be used to add more state initialization in the future. Signed-off-by: Huazhong Tan Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 4c116f85ecf8c147450602ed47ee25de60807f45 Author: Guangbin Huang Date: Fri Aug 27 17:28:17 2021 +0800 net: hns3: add macros for mac speeds of firmware command To improve code readability, replace digital numbers of mac speeds defined by firmware command with macros. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit fe50893aa86eb9f1c6ccf2ceef274193b6313aad Merge: a550409378d2a 5d8dbb7fb82b8 Author: David S. Miller Date: Fri Aug 27 11:16:29 2021 +0100 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 2021-08-27 1) Remove an unneeded extra variable in esp4 esp_ssg_unref. From Corey Minyard. 2) Add a configuration option to change the default behaviour to block traffic if there is no matching policy. Joint work with Christian Langrock and Antony Antony. 3) Fix a shift-out-of-bounce bug reported from syzbot. From Pavel Skripkin. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit a550409378d2aea4d2104a551c192e7a65ddd6c0 Merge: 5ab54e5792a44 a2ebfbb7b1817 Author: David S. Miller Date: Fri Aug 27 09:53:31 2021 +0100 Merge tag 'mlx5-updates-2021-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== This patch series contains various fixes, additions and improvements to mlx5 software steering. Patch 1: adds support for REMOVE_HEADER packet reformat - a new reformat type that is supported starting with ConnectX-6 DX, and allows removing an arbitrary size packet segment at a selected position. Patches 2 and 3: add support for VLAN pop on TX and VLAN push on RX flows. Patch 4: enables retransmission mechanism for the SW Steering RC QP. Patch 5: does some improvements to error flow in building STE array and adds a more informative printout of an invalid actions sequence. Patch 6: improves error flow on SW Steering QP error. Patch 7: reduces the log level of a message that is printed when a table is connected to a lower/same level destination table, as this case proves to be not as rare as it was in the past. Patch 8: adds missing support for matching on IPv6 flow label for devices older than ConnectX-6 DX. Patch 9: replaces uintN_t types with kernel-style types. Patch 10: allows for using the right API for updating flow tables - if it is a FW-owned table, then FW API will be used. Patch 11: adds support for 'ignore_flow_level' on multi-destination flow tables that are created by SW Steering. Patch 12: optimizes FDB RX steering rule by skipping matching on source port, as the source port for all incoming packets equals to wire. Patch 13: is a small code refactoring - it merges several DR_STE_SIZE enums into a single enum. Patch 14: does some additional refactoring and removes HW-specific STE type from NIC domain. Patch 15: removes rehash ctrl struct from dr_htbl struct and saves some memory. Patch 16: does a more significant improvement in terms of memory consumption and was able to save about 1.6 Gb for 8M rules. Patch 17: adds support for update FTE, which is needed for cases where there are multiple rules with the same match. ==================== Signed-off-by: David S. Miller commit 5ab54e5792a44dc7431cef0d57755d3c0aa9740b Merge: 3aa7857fe1d7a 9758f40e90f77 Author: David S. Miller Date: Fri Aug 27 09:45:07 2021 +0100 Merge branch 'mptcp-Optimize-received-options-handling' Mat Martineau says: ==================== mptcp: Optimize received options handling These patches optimize received MPTCP option handling in terms of both storage and fewer conditionals to evaluate in common cases, and also add a couple of cleanup patches. Patches 1 and 5 do some cleanup in checksum option parsing and clarification of lock handling. Patches 2 and 3 rearrange struct mptcp_options_received to shrink it slightly and consolidate frequently used fields in the same cache line. Patch 4 optimizes incoming MPTCP option parsing to skip many extra comparisons in the common case where only a DSS option is present. ==================== Signed-off-by: David S. Miller commit 9758f40e90f77e457dd4edef1ca506006d7f471a Author: Paolo Abeni Date: Thu Aug 26 17:44:54 2021 -0700 mptcp: make the locking tx schema more readable Florian noted the locking schema used by __mptcp_push_pending() is hard to follow, let's add some more descriptive comments and drop an unneeded and confusing check. Suggested-by: Florian Westphal Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f6c2ef59bcc7e1fbe4ea6f9de7f6e0df178d5882 Author: Paolo Abeni Date: Thu Aug 26 17:44:53 2021 -0700 mptcp: optimize the input options processing Most MPTCP packets carries a single MPTCP subption: the DSS containing the mapping for the current packet. Check explicitly for the above, so that is such scenario we replace most conditional statements with a single likely() one. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 74c7dfbee3e185b3c3a03f194e25689ed037fa3c Author: Paolo Abeni Date: Thu Aug 26 17:44:52 2021 -0700 mptcp: consolidate in_opt sub-options fields in a bitmask This makes input options processing more consistent with output ones and will simplify the next patch. Also avoid clearing the suboption field after processing it, since it's not needed. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit a086aebae0ebe37e93ed8f6e686ca0d5c4375b44 Author: Paolo Abeni Date: Thu Aug 26 17:44:51 2021 -0700 mptcp: better binary layout for mptcp_options_received This change reorder the mptcp_options_received fields to shrink the structure a bit and to ensure the most frequently used fields are all in the first cacheline. Sub-opt specific flags are moved out of the suboptions area, and we must now explicitly set them when the relevant suboption is parsed. There is a notable exception: 'csum_reqd' is used by both DSS and MPC suboptions, and keeping such field in the suboptions flag area will simplfy the next patch. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 8d548ea1dd157a40ff5882224795a82a5b9abfe6 Author: Paolo Abeni Date: Thu Aug 26 17:44:50 2021 -0700 mptcp: do not set unconditionally csum_reqd on incoming opt Should be set only if the ingress packets present it, otherwise we can confuse csum validation. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 5fe2a6b4344cbb2120d6d81e371b7ec8e75f03e2 Merge: d0efb16294d14 6cc64770fb386 Author: David S. Miller Date: Fri Aug 27 09:42:21 2021 +0100 Merge tag 'mlx5-fixes-2021-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2021-08-26 This series introduces some fixes to mlx5 driver. Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller commit 049d1693db78144c979b34e2084287ada912cf7f Author: Daniel Vetter Date: Thu Aug 26 11:13:43 2021 +0200 MAINTAINERS: Add dri-devel for component.[hc] dri-devel is the main user, and somehow there's been the assumption that component stuff is unmaintained. Cc: Ezequiel Garcia Cc: "Rafael J. Wysocki" Signed-off-by: Daniel Vetter References: https://lore.kernel.org/dri-devel/CAAEAJfDWOzCJxZFNtxeT7Cvr2pWbYrfz-YnA81sVNs-rM=8n4Q@mail.gmail.com/ Link: https://lore.kernel.org/r/20210826091343.1039763-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman commit d0efb16294d145d157432feda83877ae9d7cdf37 Author: Peter Collingbourne Date: Thu Aug 26 12:46:01 2021 -0700 net: don't unconditionally copy_from_user a struct ifreq for socket ioctls A common implementation of isatty(3) involves calling a ioctl passing a dummy struct argument and checking whether the syscall failed -- bionic and glibc use TCGETS (passing a struct termios), and musl uses TIOCGWINSZ (passing a struct winsize). If the FD is a socket, we will copy sizeof(struct ifreq) bytes of data from the argument and return -EFAULT if that fails. The result is that the isatty implementations may return a non-POSIX-compliant value in errno in the case where part of the dummy struct argument is inaccessible, as both struct termios and struct winsize are smaller than struct ifreq (at least on arm64). Although there is usually enough stack space following the argument on the stack that this did not present a practical problem up to now, with MTE stack instrumentation it's more likely for the copy to fail, as the memory following the struct may have a different tag. Fix the problem by adding an early check for whether the ioctl is a valid socket ioctl, and return -ENOTTY if it isn't. Fixes: 44c02a2c3dc5 ("dev_ioctl(): move copyin/copyout to callers") Link: https://linux-review.googlesource.com/id/I869da6cf6daabc3e4b7b82ac979683ba05e27d4d Signed-off-by: Peter Collingbourne Cc: # 4.19 Signed-off-by: David S. Miller commit 7990b535d2987201187d750f809ed17b502eb608 Author: Jing Yangyang Date: Tue Aug 24 23:15:31 2021 -0700 staging: r8188eu: remove unneeded variable Eliminate the following coccicheck warning: ./drivers/staging/r8188eu/os_dep/os_intfs.c:505:6-12: Unneeded variable "status". Return "_SUCCESS" on line 577 ./drivers/staging/r8188eu/os_dep/os_intfs.c:772: 4-7: Unneeded variable "ret". Return "_SUCCESS" on line 818 ./drivers/staging/r8188eu/os_dep/os_intfs.c:823:4-8: Unneeded variable "ret8". Return "_SUCCESS" on line 849 Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Link: https://lore.kernel.org/r/20210825061531.69678-1-deng.changcheng@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 62dbd849e03ce2cb2fb605ed7a6ca93b42cc99f4 Author: Jing Yangyang Date: Mon Aug 23 23:34:43 2021 -0700 staging: r8188eu: remove unneeded conversions to bool Found with scripts/coccinelle/misc/boolconv.cocci. Reported-by: Zeal Robot Reviewed-by: Pavel Skripkin Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Jing Yangyang Link: https://lore.kernel.org/r/20210824063443.59724-1-deng.changcheng@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 6ae51ffe5e768d9e25a7f4298e2e7a058472bcc3 Author: Lukas Bulwahn Date: Sun Aug 22 12:31:07 2021 +0200 crypto: sha512 - remove imaginary and mystifying clearing of variables The function sha512_transform() assigns all local variables to 0 before returning to its caller with the intent to erase sensitive data. However, make clang-analyzer warns that all these assignments are dead stores, and as commit 7a4295f6c9d5 ("crypto: lib/sha256 - Don't clear temporary variables") already points out for sha256_transform(): The assignments to clear a through h and t1/t2 are optimized out by the compiler because they are unused after the assignments. Clearing individual scalar variables is unlikely to be useful, as they may have been assigned to registers, and even if stack spilling was required, there may be compiler-generated temporaries that are impossible to clear in any case. This applies here again as well. Drop meaningless clearing of local variables and avoid this way that the code suggests that data is erased, which simply does not happen. Signed-off-by: Lukas Bulwahn Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu commit 72ff2bf04db2a48840df93a461b7115900f46c05 Author: Shreyansh Chouhan Date: Sun Aug 22 09:15:14 2021 +0530 crypto: aesni - xts_crypt() return if walk.nbytes is 0 xts_crypt() code doesn't call kernel_fpu_end() after calling kernel_fpu_begin() if walk.nbytes is 0. The correct behavior should be not calling kernel_fpu_begin() if walk.nbytes is 0. Reported-by: syzbot+20191dc583eff8602d2d@syzkaller.appspotmail.com Signed-off-by: Shreyansh Chouhan Signed-off-by: Herbert Xu commit cedcf527d59bcca5f87f52ea34a157bbc6e7a3a8 Author: Cai Huoqing Date: Sun Aug 22 10:27:34 2021 +0800 padata: Remove repeated verbose license text remove it because SPDX-License-Identifier is already used Signed-off-by: Cai Huoqing Acked-by: Daniel Jordan Signed-off-by: Herbert Xu commit 3438de03e98ad305129bdd033cb63e46debd67f4 Author: John Allen Date: Fri Aug 20 14:56:21 2021 +0000 crypto: ccp - Add support for new CCP/PSP device ID Add a new CCP/PSP PCI device ID and corresponding entry in the dev_vdata struct. Signed-off-by: John Allen Signed-off-by: Herbert Xu commit 5b2efa2bb865eb784e06987c7ce98c3c835b495b Author: Tianjia Zhang Date: Wed Aug 18 11:31:17 2021 +0800 crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation Like the implementation of AESNI/AVX, this patch adds an accelerated implementation of AESNI/AVX2. In terms of code implementation, by reusing AESNI/AVX mode-related codes, the amount of code is greatly reduced. From the benchmark data, it can be seen that when the block size is 1024, compared to AVX acceleration, the performance achieved by AVX2 has increased by about 70%, it is also 7.7 times of the pure software implementation of sm4-generic. The main algorithm implementation comes from SM4 AES-NI work by libgcrypt and Markku-Juhani O. Saarinen at: https://github.com/mjosaarinen/sm4ni This optimization supports the four modes of SM4, ECB, CBC, CFB, and CTR. Since CBC and CFB do not support multiple block parallel encryption, the optimization effect is not obvious. Benchmark on Intel i5-6200U 2.30GHz, performance data of three implementation methods, pure software sm4-generic, aesni/avx acceleration, and aesni/avx2 acceleration, the data comes from the 218 mode and 518 mode of tcrypt. The abscissas are blocks of different lengths. The data is tabulated and the unit is Mb/s: block-size | 16 64 128 256 1024 1420 4096 sm4-generic ECB enc | 60.94 70.41 72.27 73.02 73.87 73.58 73.59 ECB dec | 61.87 70.53 72.15 73.09 73.89 73.92 73.86 CBC enc | 56.71 66.31 68.05 69.84 70.02 70.12 70.24 CBC dec | 54.54 65.91 68.22 69.51 70.63 70.79 70.82 CFB enc | 57.21 67.24 69.10 70.25 70.73 70.52 71.42 CFB dec | 57.22 64.74 66.31 67.24 67.40 67.64 67.58 CTR enc | 59.47 68.64 69.91 71.02 71.86 71.61 71.95 CTR dec | 59.94 68.77 69.95 71.00 71.84 71.55 71.95 sm4-aesni-avx ECB enc | 44.95 177.35 292.06 316.98 339.48 322.27 330.59 ECB dec | 45.28 178.66 292.31 317.52 339.59 322.52 331.16 CBC enc | 57.75 67.68 69.72 70.60 71.48 71.63 71.74 CBC dec | 44.32 176.83 284.32 307.24 328.61 312.61 325.82 CFB enc | 57.81 67.64 69.63 70.55 71.40 71.35 71.70 CFB dec | 43.14 167.78 282.03 307.20 328.35 318.24 325.95 CTR enc | 42.35 163.32 279.11 302.93 320.86 310.56 317.93 CTR dec | 42.39 162.81 278.49 302.37 321.11 310.33 318.37 sm4-aesni-avx2 ECB enc | 45.19 177.41 292.42 316.12 339.90 322.53 330.54 ECB dec | 44.83 178.90 291.45 317.31 339.85 322.55 331.07 CBC enc | 57.66 67.62 69.73 70.55 71.58 71.66 71.77 CBC dec | 44.34 176.86 286.10 501.68 559.58 483.87 527.46 CFB enc | 57.43 67.60 69.61 70.52 71.43 71.28 71.65 CFB dec | 43.12 167.75 268.09 499.33 558.35 490.36 524.73 CTR enc | 42.42 163.39 256.17 493.95 552.45 481.58 517.19 CTR dec | 42.49 163.11 256.36 493.34 552.62 481.49 516.83 Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit de79d9aae493a29d02926f396a4fd1a1309436fc Author: Tianjia Zhang Date: Wed Aug 18 11:31:16 2021 +0800 crypto: x86/sm4 - export reusable AESNI/AVX functions Export the reusable functions in the SM4 AESNI/AVX implementation, mainly public functions, which are used to develop the SM4 AESNI/AVX2 implementation, and eliminate unnecessary duplication of code. At the same time, in order to make the public function universal, minor fixes was added. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit ff1469a21df5a2e981dd2f78e96e412fecb3ba59 Author: Lukas Bulwahn Date: Mon Aug 16 14:44:33 2021 +0200 crypto: rmd320 - remove rmd320 in Makefile Commit 93f64202926f ("crypto: rmd320 - remove RIPE-MD 320 hash algorithm") removes the Kconfig and code, but misses to adjust the Makefile. Hence, ./scripts/checkkconfigsymbols.py warns: CRYPTO_RMD320 Referencing files: crypto/Makefile Remove the missing piece of this code removal. Fixes: 93f64202926f ("crypto: rmd320 - remove RIPE-MD 320 hash algorithm") Signed-off-by: Lukas Bulwahn Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit f73800a905a8a9c35b989e8de9ce5cdf328c2b63 Author: Colin Ian King Date: Thu Aug 26 13:39:59 2021 +0100 usb: typec: tcpm: Fix spelling mistake "atleast" -> "at least" There are spelling mistakes in a comment and a literal string. Fix them. Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210826123959.14838-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit a76cb3d999b12219620d41a186ec2af2b247ac71 Author: Colin Ian King Date: Thu Aug 26 15:38:49 2021 +0100 usb: dwc2: Fix spelling mistake "was't" -> "wasn't" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210826143849.55115-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit cc7f8825cdbb05fa10782a34732f5d8082daa5c3 Author: Colin Ian King Date: Thu Aug 26 13:26:58 2021 +0100 usb: renesas_usbhs: Fix spelling mistake "faile" -> "failed" There is a spelling mistake in a dev_err error message. Fix it. Reviewed-by: Yoshihiro Shimoda Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210826122658.13914-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 57f3ffdc11143f56f1314972fe86fe17a0dcde85 Author: Yoshihiro Shimoda Date: Fri Aug 27 15:32:27 2021 +0900 usb: host: xhci-rcar: Don't reload firmware after the completion According to the datasheet, "Upon the completion of FW Download, there is no need to write or reload FW.". Otherwise, it's possible to cause unexpected behaviors. So, adds such a condition. Fixes: 4ac8918f3a73 ("usb: host: xhci-plat: add support for the R-Car H2 and M2 xHCI controllers") Cc: stable@vger.kernel.org # v3.17+ Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20210827063227.81990-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Greg Kroah-Hartman commit b7d509a92bb0216b01f428166be3770d04bbdd87 Author: Chunfeng Yun Date: Fri Aug 27 11:31:05 2021 +0800 usb: xhci-mtk: allow bandwidth table rollover xhci-mtk has 64 slots for periodic bandwidth calculations and each slot represents byte budgets on a microframe. When an endpoint's allocation sits on the boundary of the table, byte budgets' slot can be rolled over but the current implementation doesn't. This patch allows the microframe index rollover and prevent out-of-bounds array access. Signed-off-by: Ikjoon Jang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210827033105.26595-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 452d1ea55c3e621dc94ac8b832c5e00feb59aad4 Merge: d98a30ccdc839 e5d6a7c6cfae9 Author: Greg Kroah-Hartman Date: Fri Aug 27 10:09:26 2021 +0200 Merge tag 'usb-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: Only one patch for improving port index calculation for chipidea driver, no big changes. * tag 'usb-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb: usb: chipidea: host: fix port index underflow and UBSAN complains commit c24a19674258dcc968a198d8e0d4717c8f27700c Author: Chen Wandun Date: Tue Aug 10 21:51:05 2021 +0800 riscv: add support for hugepage migration Generic arch_hugetlb_migration_supported can provide appropriate support for hugepage migration when enable ARCH_ENABLE_HUGEPAGE_MIGRATION, so enable it for hugepage migration in riscv. Signed-off-by: Chen Wandun Signed-off-by: Palmer Dabbelt commit 3aa7857fe1d7ac7f600f5b7e1530396fb06822bf Author: Neil Spring Date: Wed Aug 25 14:01:17 2021 -0700 tcp: enable mid stream window clamp The TCP_WINDOW_CLAMP socket option is defined in tcp(7) to "Bound the size of the advertised window to this value." Window clamping is distributed across two variables, window_clamp ("Maximal window to advertise" in tcp.h) and rcv_ssthresh ("Current window clamp"). This patch updates the function where the window clamp is set to also reduce the current window clamp, rcv_sshthresh, if needed. With this, setting the TCP_WINDOW_CLAMP option has the documented effect of limiting the window. Signed-off-by: Neil Spring Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20210825210117.1668371-1-ntspring@fb.com Signed-off-by: Jakub Kicinski commit 97c78d0af55fff206947a5f2b85b690b5acf28ce Merge: deecae7d96843 73367f05b25db Author: Jakub Kicinski Date: Thu Aug 26 13:45:47 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/wwan/mhi_wwan_mbim.c - drop the extra arg. Signed-off-by: Jakub Kicinski commit bdd3c50d83bf7f6acc869b48d02670d19030ae03 Author: Christoph Hellwig Date: Thu Aug 26 15:55:10 2021 +0200 dax: remove bdev_dax_supported All callers already have a dax_device obtained from fs_dax_get_by_bdev at hand, so just pass that to dax_supported() insted of doing another lookup. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-10-hch@lst.de Signed-off-by: Dan Williams commit a384f088e4a102b97a59bc0fdaf8b60bca177679 Author: Christoph Hellwig Date: Thu Aug 26 15:55:09 2021 +0200 xfs: factor out a xfs_buftarg_is_dax helper Refactor the DAX setup code in preparation of removing bdev_dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20210826135510.6293-9-hch@lst.de Signed-off-by: Dan Williams commit 60b8340f0d6587d7b51990689fcdae567f309fbf Author: Christoph Hellwig Date: Thu Aug 26 15:55:08 2021 +0200 dax: stub out dax_supported for !CONFIG_FS_DAX dax_supported calls into ->dax_supported which checks for fsdax support. Don't bother building it for !CONFIG_FS_DAX as it will always return false. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-8-hch@lst.de Signed-off-by: Dan Williams commit cd93a2a4d1b076f5c73d70d836c202bbcbeea49e Author: Christoph Hellwig Date: Thu Aug 26 15:55:07 2021 +0200 dax: remove __generic_fsdax_supported Just implement generic_fsdax_supported directly out of line instead of adding a wrapper. Given that generic_fsdax_supported is only supplied for CONFIG_FS_DAX builds this also allows to not provide it at all for !CONFIG_FS_DAX builds. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-7-hch@lst.de Signed-off-by: Dan Williams commit 673a0658f6ac359131a881c0dcf1b91c2500ab9c Author: Christoph Hellwig Date: Thu Aug 26 15:55:06 2021 +0200 dax: move the dax_read_lock() locking into dax_supported Move the dax_read_lock/dax_read_unlock pair from the callers into dax_supported to make it a little easier to use. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-6-hch@lst.de Signed-off-by: Dan Williams commit 1b7646014e0d838b06be7288e2dec3262948cc56 Author: Christoph Hellwig Date: Thu Aug 26 15:55:05 2021 +0200 dax: mark dax_get_by_host static And move the code around a bit to avoid a forward declaration. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-5-hch@lst.de Signed-off-by: Dan Williams commit dfa584f6f91586dbf7bb9f35f8bbdc06590cde1f Author: Christoph Hellwig Date: Thu Aug 26 15:55:04 2021 +0200 dm: use fs_dax_get_by_bdev instead of dax_get_by_host There is no point in trying to finding the dax device if the DAX flag is not set on the queue as none of the users of the device mapper exported block devices could make use of the DAX capability. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210826135510.6293-4-hch@lst.de Signed-off-by: Dan Williams commit 39b6389a7fdc0457d980a3ea1e77ca457402f477 Author: Christoph Hellwig Date: Thu Aug 26 15:55:03 2021 +0200 dax: stop using bdevname Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20210826135510.6293-3-hch@lst.de Signed-off-by: Dan Williams commit 6c97ec172a1c058a66e7c79308a0d7f11753865d Author: Christoph Hellwig Date: Thu Aug 26 15:55:02 2021 +0200 fsdax: improve the FS_DAX Kconfig description and help text Rename the main option text to clarify it is for file system access, and add a bit of text that explains how to actually switch a nvdimm to a fsdax capable state. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210826135510.6293-2-hch@lst.de Signed-off-by: Dan Williams commit d21918e5a94a862ccb297b9f2be38574c865fda0 Author: Eric W. Biederman Date: Wed Jun 23 16:51:49 2021 -0500 signal/seccomp: Dump core when there is only one live thread Replace get_nr_threads with atomic_read(¤t->signal->live) as that is a more accurate number that is decremented sooner. Acked-by: Kees Cook Link: https://lkml.kernel.org/r/87lf6z6qbd.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit a2ebfbb7b181774570224faee570f717ae11b6d8 Author: Yevgeny Kliteynik Date: Thu Jul 8 16:58:39 2021 +0300 net/mlx5: DR, Add support for update FTE Add the support for update FTE, which is needed for cases where there are multiple rules with the same match. In such case fs_core will merge the actions and call update FTE to update current FTE. Since we don't want to disrupt the traffic, we will add the new duplicate rule, and only then remove the old duplicate rule. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 8a015baef50a7b60c866a58ae2dc0406958061d9 Author: Yevgeny Kliteynik Date: Thu Jul 8 16:51:29 2021 +0300 net/mlx5: DR, Improve rule tracking memory consumption To track each STE of the rule a rule member was allocated, each member would point to one STE. This means that we would allocate 40B (rule member) * number of STEs per rule. To reduce this per rule allocation we use the STE tree pointers for next_htbl and pointing STE to navigate the tree, this allows us to keep only the pointer to the last STE of rule (always unique). From the last rule STE we are able to traverse and rebuild all of the STEs that construct the rule. In our testing with 8M rules, each consisting of 7 STES, we were able to reduce 1.6GB of memory. Signed-off-by: Alex Vesker Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 32c8e3b23020e4815480a169d4b144d2976fcb06 Author: Yevgeny Kliteynik Date: Sun Jul 4 20:54:26 2021 +0300 net/mlx5: DR, Remove rehash ctrl struct from dr_htbl The calculations to decide for the maximum allowed collision threshold are simple and there is no reason to save them on the htbl struct. Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 46f2a8ae8a7008f845b537ba800faf0f1f1f86e7 Author: Yevgeny Kliteynik Date: Sun Jul 4 20:43:10 2021 +0300 net/mlx5: DR, Remove HW specific STE type from nic domain Instead of using the HW specific STEv0 type, it is better to use an enum to indicate if this is an RX or TX nic domain. This means that now we will need to convert the nic domain type to the corresponding STE type. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit ab9d1f96120b4a6269befa80c446a51afdc32963 Author: Yevgeny Kliteynik Date: Sun Jul 4 18:01:54 2021 +0300 net/mlx5: DR, Merge DR_STE_SIZE enums Merge DR_STE_SIZE enums - no need for a separate enum for reduced STE size. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 990467f8afde8c85215f6f4ab439b9615fd151e7 Author: Yevgeny Kliteynik Date: Sun Jul 4 17:48:24 2021 +0300 net/mlx5: DR, Skip source port matching on FDB RX domain The FDB RX pipe is connected to the wire and the source port for all incoming packets equals to wire, single uplink port per PF, this means there is no point of matching on the source port in such case. Once we recognize such case, we will optimize the RX steering rule. Note that in such case we clean both source_eswitch_owner_vhca_id and source_port. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 63b85f49c05af3cc2dea6c4e0cfbac3786b3c638 Author: Yevgeny Kliteynik Date: Sun Jul 4 17:42:04 2021 +0300 net/mlx5: DR, Add ignore_flow_level support for multi-dest flow tables When creating an FTE, we might need to create multi-destination flow table, which is eventually created by FW. In such case, this FW table should include all the FTE properties as requested by the upper layer, including the ability to point to another flow table with level lower or equal to the current table - indicated by the "ignore_flow_level" property. Signed-off-by: Chris Mi Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit a01a43fa16e1d9e6810246e38aeb80c3dd645956 Author: Yevgeny Kliteynik Date: Sun Jul 4 17:29:01 2021 +0300 net/mlx5: DR, Use FW API when updating FW-owned flow table Need to call the DR API only when it is DR table. To update FW-owned table the driver should call the FW API. Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit ae3eddcff7aa6c162a425e1a772f4f6f2eeade01 Author: Yevgeny Kliteynik Date: Sun Jul 4 17:25:11 2021 +0300 net/mlx5: DR, replace uintN_t with kernel-style types Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 0733535d59e1541c69ad43c029b6efb89622f919 Author: Yevgeny Kliteynik Date: Sun Jul 4 17:17:33 2021 +0300 net/mlx5: DR, Support IPv6 matching on flow label for STEv0 Add missing support for matching on IPv6 flow label for STEv0. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit d7d0b2450e93acd8c05b9f7abae7d8b31663a0e5 Author: Bodong Wang Date: Wed Aug 26 10:59:54 2020 -0500 net/mlx5: DR, Reduce print level for FT chaining level check There are usecases with Connection Tracking that have such connection as default, printing this warning in dmesg confuses the user. Signed-off-by: Bodong Wang Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit d5a84e968f3dc6d9d95ed6bfd8a9be5228e13be9 Author: Yevgeny Kliteynik Date: Sun Jul 4 11:57:38 2021 +0300 net/mlx5: DR, Warn and ignore SW steering rule insertion on QP err In the event of SW steering QP entering error state, SW steering cannot insert more rules, and will silently ignore the insertion after issuing a warning. Signed-off-by: Yuval Avnery Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit f35715a6574707ecfeac795d451fccd751e614b5 Author: Yevgeny Kliteynik Date: Thu Sep 24 20:58:44 2020 +0300 net/mlx5: DR, Improve error flow in actions_build_ste_arr Improve error flow and print actions sequence when an invalid/unsupported sequence provided. Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit ec449ed8230cd30769de3cb70ee0fce293047372 Author: Yevgeny Kliteynik Date: Thu Sep 24 20:58:50 2020 +0300 net/mlx5: DR, Enable QP retransmission Under high stress, SW steering might get stuck on polling for completion that never comes. For such cases QP needs to have protocol retransmission mechanism enabled. Currently the retransmission timeout is defined as 0 (unlimited). Fix this by defining a real timeout. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 2de40f68cf76510c790663101b670868ba5ef9cf Author: Yevgeny Kliteynik Date: Sun Jun 27 23:05:28 2021 +0300 net/mlx5: DR, Enable VLAN pop on TX and VLAN push on RX Enable pop VLAN action in TX and push VLAN in RX. These actions are supported only on STEv1. On TX: when a host sends a packet, VLAN is popped at the beginning. On RX: just before passing the packet to the host the VLAN is pushed. Signed-off-by: Muhammad Sammar Signed-off-by: Alex Vesker Signed-off-by: Yishai Hadas Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit f5e22be534e094f0ea3a4e9fb1223b3de1ed8107 Author: Yevgeny Kliteynik Date: Sun Jun 27 15:01:12 2021 +0300 net/mlx5: DR, Split modify VLAN state to separate pop/push states Split modify vlan state in the actions state machine to pop vlan and push vlan states. This enables using of pop/push vlan without restrictions (e.g. pop vlan on TX in STEv1). Signed-off-by: Muhammad Sammar Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 0139145fb8d8988f9c464b83cdd0c3f44038f7b3 Author: Yevgeny Kliteynik Date: Thu Apr 22 11:32:56 2021 +0300 net/mlx5: DR, Added support for REMOVE_HEADER packet reformat ConnectX supports offloading of various encapsulations and decapsulations (e.g. VXLAN), which are performed by 'Packet Reformat' action. Starting with ConnectX-6 DX, a new reformat type is supported - REMOVE_HEADER, which allows deleting an arbitrary size chunk at the selected position in the packet. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 6cc64770fb386b10a64a1fe09328396de7bb5262 Author: Wentao_Liang Date: Thu Aug 19 22:30:05 2021 +0800 net/mlx5: DR, fix a potential use-after-free bug In line 849 (#1), "mlx5dr_htbl_put(cur_htbl);" drops the reference to cur_htbl and may cause cur_htbl to be freed. However, cur_htbl is subsequently used in the next line, which may result in an use-after-free bug. Fix this by calling mlx5dr_err() before the cur_htbl is put. Signed-off-by: Wentao_Liang Signed-off-by: Saeed Mahameed commit f9d196bd632b8b79261ec3366c30ec3923ea9a02 Author: Dmytro Linkin Date: Thu Jun 24 13:37:36 2021 +0300 net/mlx5e: Use correct eswitch for stack devices with lag If link aggregation is used within stack devices driver rejects encap rules if PF of the VF tunnel device is down. This happens because route resolved for other PF and its eswitch instance is used to determine correct vport. To fix that use devcom feature to retrieve other eswitch instance if failed to find vport for the 1st eswitch and LAG is active. Fixes: 10742efc20a4 ("net/mlx5e: VF tunnel TX traffic offloading") Signed-off-by: Dmytro Linkin Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit ca6891f9b27db7764bba0798202b0a21d0dc909c Author: Maor Dickman Date: Thu Aug 12 14:30:39 2021 +0300 net/mlx5: E-Switch, Set vhca id valid flag when creating indir fwd group When indirect forward group is created, flow is added with vhca id but without setting vhca id valid flag which violates the PRM. Fix by setting the missing flag, vhca id valid. Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 9a5f9cc794e17cf6ed2a5bb215d2e8b6832db444 Author: Roi Dayan Date: Sun Aug 22 10:14:58 2021 +0300 net/mlx5e: Fix possible use-after-free deleting fdb rule After neigh-update-add failure we are still with a slow path rule but the driver always assume the rule is an fdb rule. Fix neigh-update-del by checking slow path tc flag on the flow. Also fix neigh-update-add for when neigh-update-del fails the same. Fixes: 5dbe906ff1d5 ("net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available") Signed-off-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 8e7e2e8ed0e251138926838b7933f8eb6dd56b12 Author: Leon Romanovsky Date: Sat Aug 21 15:05:11 2021 +0300 net/mlx5: Remove all auxiliary devices at the unregister event The call to mlx5_unregister_device() means that mlx5_core driver is removed. In such scenario, we need to disregard all other flags like attach/detach and forcibly remove all auxiliary devices. Fixes: a5ae8fc9058e ("net/mlx5e: Don't create devices during unload flow") Tested-and-Reported-by: Yicong Yang Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 2f8b6161cca5fb34b0065e2eac8bb2b61b7bfe87 Author: Dima Chumak Date: Wed Jun 30 14:56:32 2021 +0300 net/mlx5: Lag, fix multipath lag activation When handling FIB_EVENT_ENTRY_REPLACE event for a new multipath route, lag activation can be missed if a stale (struct lag_mp)->mfi pointer exists, which was associated with an older multipath route that had been removed. Normally, when a route is removed, it triggers mlx5_lag_fib_event(), which handles FIB_EVENT_ENTRY_DEL and clears mfi pointer. But, if mlx5_lag_check_prereq() condition isn't met, for example when eswitch is in legacy mode, the fib event is skipped and mfi pointer becomes stale. Fix by resetting mfi pointer to NULL in mlx5_deactivate_lag(). Fixes: 8a66e4585979 ("net/mlx5: Change ownership model for lag") Signed-off-by: Dima Chumak Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 7ce05074b93c7f130c48e04defa63d157adeb143 Author: Colin Ian King Date: Thu Aug 26 13:14:45 2021 +0100 selftests: safesetid: Fix spelling mistake "cant" -> "can't" There is a spelling mistake in an error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Shuah Khan commit 56809a28d45fcad94b28cfd614600568c0d46545 Author: Vineet Gupta Date: Tue Oct 13 19:44:07 2020 -0700 ARC: mm: vmalloc sync from kernel to user table to update PMD ... ... not PGD vmalloc() sets up the kernel page table (starting from @swapper_pg_dir). But when vmalloc area is accessed in context of a user task, say opening terminal in n_tty_open(), the user page tables need to be synced from kernel page tables so that TLB entry is created in "user context". The old code was doing this incorrectly, as it was updating the user pgd entry (first level itself) to point to kernel pud table (2nd level), effectively yanking away the entire user space translation with kernel one. The correct way to do this is to ONLY update a user space pgd/pud/pmd entry if it is not popluated already. This ensures that only the missing leaf pmd entry gets updated to point to relevant kernel pte table. From code change pov, we are chaging the pattern: p4d = p4d_offset(pgd, address); p4d_k = p4d_offset(pgd_k, address); if (!p4d_present(*p4d_k)) goto bad_area; set_p4d(p4d, *p4d_k); with p4d = p4d_offset(pgd, address); p4d_k = p4d_offset(pgd_k, address); if (p4d_none(*p4d_k)) goto bad_area; if (!p4d_present(*p4d)) set_p4d(p4d, *p4d_k); Signed-off-by: Vineet Gupta commit 8747ff704ac886f6ef992b1b7eadcf77d151fd3a Author: Vineet Gupta Date: Thu Oct 1 15:46:42 2020 -0700 ARC: mm: support 4 levels of page tables Acked-by: Mike Rapoport Signed-off-by: Vineet Gupta commit 2dde02ab6d1a725ddccc7144ff6bf5f55d37f916 Author: Vineet Gupta Date: Wed Sep 30 18:58:50 2020 -0700 ARC: mm: support 3 levels of page tables ARCv2 MMU is software walked and Linux implements 2 levels of paging: pgd/pte. Forthcoming hw will have multiple levels, so this change preps mm code for same. It is also fun to try multi levels even on soft-walked code to ensure generic mm code is robust to handle. overview ________ 2 levels {pgd, pte} : pmd is folded but pmd_* macros are valid and operate on pgd 3 levels {pgd, pmd, pte}: - pud is folded and pud_* macros point to pgd - pmd_* macros operate on actual pmd code changes ____________ 1. #include 2. Define CONFIG_PGTABLE_LEVELS 3 3a. Define PMD_SHIFT, PMD_SIZE, PMD_MASK, pmd_t 3b. Define pmd_val() which actually deals with pmd (pmd_offset(), pmd_index() are provided by generic code) 3c. pmd_alloc_one()/pmd_free() also provided by generic code (pmd_populate/pmd_free already exist) 4. Define pud_none(), pud_bad() macros based on generic pud_val() which internally pertains to pgd now. 4b. define pud_populate() to just setup pgd Acked-by: Mike Rapoport Signed-off-by: Vineet Gupta commit 9f3c76aedcbfee61dcdf299e708888141c7132fd Author: Vineet Gupta Date: Thu Aug 12 14:31:36 2021 -0700 ARC: mm: switch to asm-generic/pgalloc.h With previous patch ARC pgalloc functions are same as generic, hence switch to that. Suggested-by: Mike Rapoport Acked-by: Mike Rapoport Signed-off-by: Vineet Gupta commit d9820ff76f95fa26d33e412254a89cd65b23142d Author: Vineet Gupta Date: Thu Aug 12 12:54:43 2021 -0700 ARC: mm: switch pgtable_t back to struct page * So far ARC pgtable_t has not been struct page based to avoid extra page_address() calls involved. However the differences are down to noise and get in the way of using generic code, hence this patch. This also allows us to reuse generic THP depost/withdraw code. There's some additional consideration for PGDIR_SHIFT in 4K page config. Now due to page tables being PAGE_SIZE deep only, the address split can't be really arbitrary. Tested-by: kernel test robot Suggested-by: Mike Rapoport Acked-by: Mike Rapoport Signed-off-by: Vineet Gupta commit e257d969f36503b8eb1240f32653a1afb3109f86 Author: Johannes Berg Date: Thu Aug 26 22:47:43 2021 +0300 iwlwifi: mvm: don't use FW key ID in beacon protection To check beacon protection had a mismatch of the key ID we currently use the key ID from the firmware, but firmware side we want to clean up the API to stop reporting this. Instead, check the IWL_RX_MPDU_STATUS_KEY_VALID bit that indicates that the firmware used the correct key, and if that's set but we get invalid MIC/replay use the key ID from the frame to look up the key and notify mac80211 of MIC error or replay. Since both keys must have the same cipher and thus MIC length, we can use either of them to look up the MIC length. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.30e665d39b07.I78bf7d304ef5a80cecf5fa1c1fca0b51b956cceb@changeid Signed-off-by: Luca Coelho commit 090f1be3abf3069ef856b29761f181808bf55917 Author: Ilan Peer Date: Thu Aug 26 22:47:42 2021 +0300 iwlwifi: mvm: Fix scan channel flags settings The iwl_mvm_scan_ch_n_aps_flag() is called with a variable before the value of the variable is set. Fix it. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.f6f188980a5e.Ie7331a8b94004d308f6cbde44e519155a5be91dd@changeid Signed-off-by: Luca Coelho commit cde5dbaa35edbf4467cd6ac5b3588861257685a1 Author: Shaul Triebitz Date: Thu Aug 26 22:47:41 2021 +0300 iwlwifi: mvm: support broadcast TWT alone Tell the firmware about broadcast TWT support even if individual TWT is not supported. In that case the firmware will negotiate only a broadcast TWT session. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.556934ed023a.I843677252be64f4732e434ab9ef72f487625e49e@changeid Signed-off-by: Luca Coelho commit fb3fac5fafa8a6d45853b183c36cda4c13e1c279 Author: Gregory Greenman Date: Thu Aug 26 22:47:40 2021 +0300 iwlwifi: mvm: introduce iwl_stored_beacon_notif_v3 The new version sends station id in the notification. It's still not used, but need to adjust the code since the offset of the data was changed. Signed-off-by: Gregory Greenman Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.87bc9e45c40b.I770493dc4a293ed8bdf059518e94dccf5dd1b3a7@changeid Signed-off-by: Luca Coelho commit b05c1d14a177eaffe3aa7fa18b39df3a3e1f3a47 Author: Dror Moshe Date: Thu Aug 26 22:47:39 2021 +0300 iwlwifi: move get pnvm file name to a separate function Move code that generates the pnvm file name to a separate function, so that it can be reused. Signed-off-by: Dror Moshe Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.7d2dd18c75a2.I3652584755b9ab44909ddcd09ff4d80c6690a1ad@changeid Signed-off-by: Luca Coelho commit bd34ff380e783d129bf3fc6b8762967ee8eab14f Author: Avraham Stern Date: Thu Aug 26 22:47:38 2021 +0300 iwlwifi: mvm: add support for responder config command version 9 This version adds the following configuration options: 1. Enable/disable setting the session id in the FTM frame 2. Set the BSS color for the responder 3. Set the minimum and maximum time between measurements for non trigger based NDP ranging. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.0a10d43f3d7f.Ice4112c1910cf94babd1c2d492a3a3de9f7ee6cb@changeid Signed-off-by: Luca Coelho commit 830aa3e7d1ca1a7c8b6f414ac5bf8da561a45867 Author: Avraham Stern Date: Thu Aug 26 22:47:37 2021 +0300 iwlwifi: mvm: add support for range request command version 13 This version adds the following configuration options: 1. Set the BSS color for NDP ranging 2. Set the minimum and maximum time between measurements for non trigger based NDP ranging. 3. Terminate the session in case the responder requests LMR feedback. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210826224715.9dcd5210b7e5.I76f6977cde852de0f251344e279ad85076eef8d6@changeid Signed-off-by: Luca Coelho commit 7e47f41648b215d458f2e0f35e26fe4157b9eb98 Author: Johannes Berg Date: Thu Aug 19 18:40:35 2021 +0300 iwlwifi: allow debug init in RF-kill We can send this even if initializing in RF-kill, thus suppressing a bunch of error messages about it. In fact, we _want_ to, since we might still want to debug the firmware even if in RF-kill. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.bcdb076609e2.I2d177c00772510b5338d8aa45af7558138b08448@changeid Signed-off-by: Luca Coelho commit a76b57311b1a247e31b055872d021c38707dc3a8 Author: Avraham Stern Date: Thu Aug 19 18:40:34 2021 +0300 iwlwifi: mvm: don't schedule the roc_done_wk if it is already running When P2P roc is removed, the IWL_MVM_STATUS_NEED_FLUSH_P2P bit is set to indicate to iwl_mvm_roc_done_wk() that the removed roc is a P2P one, so it will flush the broadcast station and not the aux station. However, since setting this bit and scheduling the worker is done in roc ended flow as well as in case the roc is removed, there is a race where the worker has already started running (but did not test this bit yet) and then it is scheduled again. In this case, the first run of the worker will clear this bit, and thus the second run will find it already cleared and will try to flush and remove the aux station by mistake. Fix it by scheduling the worker only if this bit is not yet set. In case this bit is already set, the worker is either running or scheduled, so there is no need to re-schedule it. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.8c147659b331.If5924375e9bfd46214ab8ab81cb9d0f5c82fbcbc@changeid Signed-off-by: Luca Coelho commit 89639e06d0f35625db506f43971d08b0489cd2ce Author: Mukesh Sisodiya Date: Thu Aug 19 18:40:33 2021 +0300 iwlwifi: yoyo: support for new DBGI_SRAM region new region handling is added for dump collection. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.af9a24b82396.I53c5f82bd2d0f56fd699e3841c922082d99f1c90@changeid Signed-off-by: Luca Coelho commit 4e110e799cb50dcbf6b57254fd41b595479c91b9 Author: Shaul Triebitz Date: Thu Aug 19 18:40:32 2021 +0300 iwlwifi: add 'Rx control frame to MBSSID' HE capability 'Rx control frame to MBSSID' is supported by HW and FW. Add the capability to the HE mac capabilities. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.f3d6561dd8ee.I193d5331b43a1ecdae59eaedb37f0190a6d2311d@changeid Signed-off-by: Luca Coelho commit 8a433cb64ec5494571f313ba04f28ff58490c8c4 Author: Johannes Berg Date: Thu Aug 19 18:40:31 2021 +0300 iwlwifi: fw: fix debug dump data declarations The debug dump ranges aren't just an array of such ranges since each range has a variable size. Therefore, the use of a struct array is misleading at best. Change it to be a u8 data[] instead of the struct array, the code doesn't significantly change since it's actually doing things correctly now. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.693c9891097d.Idcaab1fd659e8be2f56be647b2534befd61a4460@changeid Signed-off-by: Luca Coelho commit 394f419296727cb614494c74b233d9bd3b24e271 Author: Johannes Berg Date: Thu Aug 19 18:40:30 2021 +0300 iwlwifi: api: remove datamember from struct We don't use this, but we embed this struct elsewhere and having structs with flexible arrays embedded isn't quite right, with sparse (for example) complaining. Remove the data[] member in this case. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.72ca1232b27c.I6ec766691b89670e1683f9fc0fbd12648309a574@changeid Signed-off-by: Luca Coelho commit 4246465edb16e493be2f2f1523866b589a234ec5 Author: Johannes Berg Date: Thu Aug 19 18:40:29 2021 +0300 iwlwifi: fix __percpu annotation Sparse warns about some type mismatches, which really is just because of the strangely placed __percpu annotation. Put it into the correct place. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.0a292b05fcf4.I7e89dfa6495143585021cb628ebb17d52e4588e5@changeid Signed-off-by: Luca Coelho commit 59a6ee97e0d4d8f9f3f47df1b82d850ce8e0f0b1 Author: Johannes Berg Date: Thu Aug 19 18:40:28 2021 +0300 iwlwifi: pcie: avoid dma unmap/remap in crash dump DMA-API debug code pointed out that in this code path we never check the return value of dma_map_page(), which could fail. However, we don't really even want to unmap/remap, we just want to ensure that we can actually access the last version of the data that the (now-dead) device may have written, so only need to dma_sync_single_for_cpu() instead. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.5987f35883a2.I2d9ea5ecc69a5e5947b546fb15f33363a0595651@changeid Signed-off-by: Luca Coelho commit 40063f602868aaeab5afe7f84237e3d95801680f Author: Luca Coelho Date: Thu Aug 19 18:40:27 2021 +0300 iwlwifi: acpi: fill in SAR tables with defaults If the tables we get in the iwl_sar_set_profile() is smaller than the revision we support, we need to fill the values with 0. Make sure that's the case. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.7fb9716db7ba.I75541846e0720f80695186ba39398133c8758280@changeid Signed-off-by: Luca Coelho commit c5b42c674ad88643c8a7d31611114bda62425fcf Author: Luca Coelho Date: Thu Aug 19 18:40:26 2021 +0300 iwlwifi: acpi: fill in WGDS table with defaults The tables we store are the larger of all the revisions, so we need to fill in the values that we don't get from ACPI when using older revisions. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.01b12461a30b.I08d1f9154f26eca25c44616efdb5223bcc1935f3@changeid Signed-off-by: Luca Coelho commit a6a39ab2645c696d5ed203a0d40300276da99f99 Author: Luca Coelho Date: Thu Aug 19 18:40:25 2021 +0300 iwlwifi: bump FW API to 65 for AX devices Start supporting API version 65 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210819183728.1cb15b015485.I2818924b772d7518f4d9fc38b4caab3494ab11f9@changeid Signed-off-by: Luca Coelho commit 664c011b763e437cbe2662432ec8e09128515700 Author: Luca Coelho Date: Thu Aug 5 14:21:58 2021 +0300 iwlwifi: acpi: support reading and storing WGDS revision 2 Revisions 0 and 1 are identical, so we were already supporting that. But revision 2 has a different size, so we have to try to read them separately. Add support for this new revision. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.78e441b16f9c.I2d79492f05624ddd02c533c673811a36eaf8a396@changeid Signed-off-by: Luca Coelho commit eb09ae93dabfd0980f5226dfd0bd531eb87902f5 Author: Miri Korenblit Date: Thu Aug 5 14:21:57 2021 +0300 iwlwifi: mvm: load regdomain at INIT stage We used to load the regdomain only in the load stage, this caused the 'iw phy phy0 reg get' command to fail if we booted a machine with wifi off. Therefor we should load it in INIT stage already. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.a6077801d7d5.I7d8d5c895bc467efbf81ea055dde366ea01cced1@changeid Signed-off-by: Luca Coelho commit 78a19d5285d93e281b40c3b8d5a959fbbd2fe006 Author: Miri Korenblit Date: Thu Aug 5 14:21:56 2021 +0300 iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage We used to read the PPAG, WRDS, EWRD, WGDS tables from ACPI in the load stage only. This prevented vendor commands from being executed before bringing the interface up. Move reading those tables to INIT stage. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ce3b60f0b426.I3643bf00e714aae930880cc7d6cf390b142eaccb@changeid Signed-off-by: Luca Coelho commit b537ffb6ea16b803b5ab5ef73c3bccc68a104af9 Author: Shaul Triebitz Date: Thu Aug 5 14:21:55 2021 +0300 iwlwifi: mvm: trigger WRT when no beacon heard If the session protection ends but no beacon was heard, the driver triggers a disconnection. Trigger WRT in that case so it can be debugged. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.7bf71939826b.Id73f1a466929670f5ec54301227d68883afd9207@changeid Signed-off-by: Luca Coelho commit e6344c060209ef4e970cac18adeac1676a2a73cd Author: Johannes Berg Date: Thu Aug 5 14:21:54 2021 +0300 iwlwifi: fw: correctly limit to monitor dump In commit 79f033f6f229 ("iwlwifi: dbg: don't limit dump decisions to all or monitor") we changed the code to pass around a bitmap, but in the monitor_only case, one place accidentally used the bit number, not the bit mask, resulting in CSR and FW_INFO getting dumped instead of monitor data. Fix that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.774fd8729a33.Ic985a787071d1c0b127ef0ba8367da896ee11f57@changeid Signed-off-by: Luca Coelho commit 19426d54302e199b3fd2d575f926a13af66be2b9 Author: Abhishek Naik Date: Thu Aug 5 14:21:53 2021 +0300 iwlwifi: skip first element in the WTAS ACPI table By mistake we were considering the first element of the WTAS wifi package as part of the data we want to rid, but that element is the wifi package signature (always 0x07), so it should be skipped. Change the code to read the data starting from element 1 instead. Signed-off-by: Abhishek Naik Fixes: 28dd7ccdc56f ("iwlwifi: acpi: read TAS table from ACPI and send it to the FW") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ff8148197b15.I70636c04e37b2b57a5df3ce611511f62203d27a7@changeid Signed-off-by: Luca Coelho commit 058b94dc9bf8310b93da864f9fe5bee5b50b0cf4 Author: Gregory Greenman Date: Thu Aug 5 14:21:52 2021 +0300 iwlwifi: mvm: support version 11 of wowlan statuses notification The new version of the command has same size and layout as version 10. It just sends corresponding station id in one of the reserved fields. It's not used in the driver, so just be ready to accept version 11. Signed-off-by: Gregory Greenman Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.0a387598eef1.I3be0bbf603ef95c644218be8a12b329411f11646@changeid Signed-off-by: Luca Coelho commit 5bf7a9edddbb9d7c7deae58663aedd4dbc731a9e Author: Luca Coelho Date: Thu Aug 5 14:21:51 2021 +0300 iwlwifi: convert flat GEO profile table to a struct version The GEO profiles have been stored in single-dimension arrays and the access has been done via a single index. We will soon need to support different revisions of this table, which will make the flat array even harder to handle. To prepare for that, convert the single-dimension array to a struct with substructures. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.56f3506411a2.I600ed3708d19f2263a5a8d143f6711d08499bbb0@changeid Signed-off-by: Luca Coelho commit de95c9288ae15b53be63e52097fe0d5b374e6a13 Author: Luca Coelho Date: Thu Aug 5 14:21:50 2021 +0300 iwlwifi: remove unused ACPI_WGDS_TABLE_SIZE definition When we started supporting the new FW API for the geo profiles, we stopped using this definition, but left it there. Remove it now. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.91dec6fad3e8.Ica42d5538d83b1407efe0c441c61aa8830e7496d@changeid Signed-off-by: Luca Coelho commit 51266c11ceccbe95a5abe98e4c4b0f4932b5b023 Author: Luca Coelho Date: Thu Aug 5 14:21:49 2021 +0300 iwlwifi: support reading and storing EWRD revisions 1 and 2 As an extension to the WRDS support for revisions 1 and 2, do the same for the EWRD tables. These tables have a very similar format to the WRDS table, so most of the code is similar. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.2d5494de683c.Ia024b1368873d488906a639e29454cbbdc788d03@changeid Signed-off-by: Luca Coelho commit 2a8084147bff7a1fe9f567ed39c340a6a3fc27ef Author: Luca Coelho Date: Thu Aug 5 14:21:48 2021 +0300 iwlwifi: acpi: support reading and storing WRDS revision 1 and 2 Change the SAR profile tables storage to revision 2 regardless of the revision we read from ACPI. Revision 2 is a superset of revision 1, which is in turn a superset of revision 0, so they can all be stored inside revision 2. Add support for reading and storing also revisions 1 and 2, whose only difference is the number of chains and number of sub-bands. So most of the code revolves around passing different chain and sub-band sizes. With this patch we still pass only revision 0 to the firmware, but that will be changed in a separate patch. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.2edad09415c8.I36297aef90a9ec6a3ea1bf1a151a62f272826d59@changeid Signed-off-by: Luca Coelho commit 8ecf0477b990791949752578e7706908682db6e5 Author: Luca Coelho Date: Thu Aug 5 14:21:47 2021 +0300 iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile() The number of chains and sub-bands read from the ACPI tables varies depending on the revision. Pass these numbers to the iwl_sar_set_profile() function in order to make using different revisions easier. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.905b54c398f8.I9bac8c3bc3b1b6bbe813de53746daee33e53fc86@changeid Signed-off-by: Luca Coelho commit dac7171c81323afa3a8c4fa1c08719ff9fd033cb Author: Luca Coelho Date: Thu Aug 5 13:19:34 2021 +0300 iwlwifi: remove ACPI_SAR_NUM_TABLES definition This definition was only used to pass the size of the tables in the FW API to the iwl_sar_select_profile() function, but we should actually pass the definition from the FW API file. We don't have the concept of tables in the ACPI definition, so we can remove it. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.00b5084be918.I18efb3c45bffacfa9a356c2c8d34e5ffbb3eb423@changeid Signed-off-by: Luca Coelho commit 81870d138dfe9450d99411113c57258449f250b3 Author: Luca Coelho Date: Thu Aug 5 13:19:33 2021 +0300 iwlwifi: convert flat SAR profile table to a struct version The SAR profiles have been stored in single-dimension arrays and the access has been done via a single index. We will soon need to support different revisions of this table, which will make the flat array even harder to handle. To prepare for that, convert the single-dimension array to a struct with substructures. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.01530088097f.I903c236a574c7e4c0fc4db101fc39c0f5415ca43@changeid Signed-off-by: Luca Coelho commit 248e7e2a1d8d1140f0d5cc507812987c33c7b020 Author: Luca Coelho Date: Thu Aug 5 13:19:32 2021 +0300 iwlwifi: rename ACPI_SAR_NUM_CHAIN_LIMITS to ACPI_SAR_NUM_CHAINS The "LIMITS" in the macro name don't have much meaning, so remove it to make the macro shorter and better reflect that this is the number of chains that we have limits for. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.65591c9fa2af.Ie7e4ba94c903ef444cb07df61891394c11c7c864@changeid Signed-off-by: Luca Coelho commit 6c608cd6962ebdf84fd3de6d42f88ed64d2f4e1b Author: Johannes Berg Date: Thu Aug 5 13:19:31 2021 +0300 iwlwifi: mvm: fix access to BSS elements BSS elements are protected using RCU, so we need to use RCU properly to access them, fix that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.fd8b5791ab44.Iba26800a6301078d3782fb249c476dd8ac2bf3c6@changeid Signed-off-by: Luca Coelho commit 967a39832ebe72e7b3826368e26ca1adda66814d Author: Ilan Peer Date: Thu Aug 5 13:19:30 2021 +0300 iwlwifi: mvm: Refactor setting of SSIDs for 6GHz scan - Short SSIDs should always be added for direct SSIDs included in the scan request. However, this was not done in case that information for collocated APs was included. Fix this. - With the above fix, if the FW also supports discovery of hidden APs over the 6GHz band, also set the corresponding full SSID information. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.02512b7a1443.Ibb023b09b86179ed049a195f4e32e887c2f4971d@changeid Signed-off-by: Luca Coelho commit 3df5c0ddcf81f2fe2d6a5e48efc3a37aa0feda5b Author: Avraham Stern Date: Thu Aug 5 13:19:29 2021 +0300 iwlwifi: mvm: silently drop encrypted frames for unknown station When a station is removed, the driver-mac80211 station mapping is removed before the station is actually deleted from the FW. As a result, it is reasonable that the FW will continue to pass frames although the driver doesn't have a station for them anymore. Thus change the message severity level from ERR to DEBUG_DROP. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.a751177743c6.I5607504dade88ba461508643f58390dd661c05ba@changeid Signed-off-by: Luca Coelho commit 79e561f0f05afaa10b8d9bd18f89ec7d7168126d Author: Johannes Berg Date: Thu Aug 5 13:19:28 2021 +0300 iwlwifi: mvm: d3: implement RSC command version 5 In later firmware we haven't needed the TSC anyway since we have it already (and firmware image doesn't change), but the new version adds the ability to send down replay counters for more than one GTK. Implement that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.28cd065e8c4a.Ic8406a78ee46b07e0ca1b8199522ef08ec6eef53@changeid Signed-off-by: Luca Coelho commit af3aab9ce2989d7378e468c4d6a4eb39e0479c9b Author: Johannes Berg Date: Thu Aug 5 13:19:27 2021 +0300 iwlwifi: mvm: d3: make key reprogramming iteration optional Now that only reprogramming is left in the initial key iteration, skip it entirely on unified firmware images instead of skipping only the command sending inside of it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.c6f77325c430.I798ce9d757492a9e3d223c1de5d4e62ebbc00b2c@changeid Signed-off-by: Luca Coelho commit be05fae23d03a228b2b10b18e1a3e7dbaa363b0f Author: Johannes Berg Date: Thu Aug 5 13:19:26 2021 +0300 iwlwifi: mvm: d3: add separate key iteration for GTK type If we're sending the KEK/KCK data we also need the GTK and IGTK type, add a separate key iteration for that so we can make the configure_key iteration optional later. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.c99f86423702.Icf7d4e93be77ea05a80235d01851ad0155593de9@changeid Signed-off-by: Luca Coelho commit 631ee512028589835b48fdfa104654d0f563e27a Author: Johannes Berg Date: Thu Aug 5 13:19:25 2021 +0300 iwlwifi: mvm: d3: refactor TSC/RSC configuration Refactor the TSC/RSC configuration out from the normal wowlan key iteration so we can replace it later with a different one adapted to a different firmware API. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.78e431c9aaeb.I5b83b8b30e3e7c04706a1f99b3970e4e5f36af9e@changeid Signed-off-by: Luca Coelho commit 398760aa9679bbf985e00e1502f1d63d7fd25a67 Author: Johannes Berg Date: Thu Aug 5 13:19:24 2021 +0300 iwlwifi: mvm: d3: remove fixed cmd_flags argument We only ever pass cmd_flags == CMD_ASYNC, so might as well not have the argument. Remove it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.9130db608b77.I352cbc35fefd98cc00aa0c69ea43863942aa62f5@changeid Signed-off-by: Luca Coelho commit 0419e5e672d6d931fcaa83f7a715364ab4dc1ac9 Author: Johannes Berg Date: Thu Aug 5 13:19:23 2021 +0300 iwlwifi: mvm: d3: separate TKIP data from key iteration We do a key iteration to program the keys, and while at it we also collect the data necessary for TKIP. This code has all kinds of dependencies on the firmware API though, so take out the TKIP phase 1 key generation and do that in a separate key iteration only if necessary. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.80721fc0fd61.I5a8fbba4e3a9606f700ee41c7a4244dd5e2af935@changeid Signed-off-by: Luca Coelho commit 95a62c331f6ac38bd22b0353cab9d719d031c892 Author: Johannes Berg Date: Mon Aug 2 21:58:56 2021 +0300 iwlwifi: mvm: simplify __iwl_mvm_set_sta_key() There's no need to differentiate identical default and cipher type cases, nor do we really need to have a 'ret' variable. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.e89178b22fbf.I4d62baad9a9fdfd5c645a3cc5dbffb22feab5033@changeid Signed-off-by: Luca Coelho commit 199d895f47601fcd2c24d484e5ce1f5d283b5d4f Author: Johannes Berg Date: Mon Aug 2 21:58:55 2021 +0300 iwlwifi: mvm: support new station key API The new version 3 of the station key API has gotten rid of the strange hole in the sequence counter values, support that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.39a00ca1a1a6.Ifb4adeb4edd2b72232046dd2d59c0b3732f497c2@changeid Signed-off-by: Luca Coelho commit 35fc5feca7b24b97e828e6e6a4243b4b9b0131f8 Author: Ilan Peer Date: Mon Aug 2 21:58:54 2021 +0300 iwlwifi: mvm: Fix umac scan request probe parameters Both 'iwl_scan_probe_params_v3' and 'iwl_scan_probe_params_v4' wrongly addressed the 'bssid_array' field which should supposed to be any array of BSSIDs each of size ETH_ALEN and not the opposite. Fix it. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.04146f24794f.I90726440ddff75013e9fecbe9fa1a05c69e3f17b@changeid Signed-off-by: Luca Coelho commit 9de168a01279db655052a19b56662656bc94ea89 Author: Johannes Berg Date: Mon Aug 2 21:58:53 2021 +0300 iwlwifi: pcie: implement Bz reset flow Bz device reset flow changed, now the hardware (instead of firmware) will reset the PCI bus etc., this can take up to 100ms. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.df30875c6ff9.I962ed0f2c3358903dc6ba1abb65726ce5acbbd48@changeid Signed-off-by: Luca Coelho commit 6c0795f1a52410f2dccc63cd0993ae1a38856c77 Author: Johannes Berg Date: Mon Aug 2 21:58:52 2021 +0300 iwlwifi: implement Bz NMI behaviour The method to NMI the firmware also changed in Bz devices, implement the new logic. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.c9bd2034dc05.I983c25caa09c3776c7640fff73fe739362ecc5b6@changeid Signed-off-by: Luca Coelho commit 9ce041f5966fd07a4326b81add4ae472400351cd Author: Johannes Berg Date: Mon Aug 2 21:58:51 2021 +0300 iwlwifi: pcie: implement Bz device startup Device startup changed in Bz, some register bits moved around. Change the code accordingly. The new Bz hardware changes also the way we wake it (grab NIC access) and the way we disable bus mastering, update the driver code accordingly. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.00a137364a95.I059a2abac948965458862941ee7db6a2e1076fa6@changeid Signed-off-by: Luca Coelho commit 7e6dffda95d09bf008db0a35aee9045cb78b191f Author: Johannes Berg Date: Mon Aug 2 21:58:50 2021 +0300 iwlwifi: read MAC address from correct place on Bz On Bz devices, the MAC address CSRs changed from 0x380 to 0x30. Change the boolean configuration "mac_addr_from_csr" to hold the base address instead, and set it correctly for the different devices using this feature. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.928c7983f014.Ic5ba92d98946c1b4640280a05dcfd75119c0f0c0@changeid Signed-off-by: Luca Coelho commit d01408ee3a2bdfb1a6e0ae086c628dccf27ab811 Author: Johannes Berg Date: Mon Aug 2 21:58:49 2021 +0300 iwlwifi: give Bz devices their own name The real name isn't determined yet, but give them a new name that isn't clashing with older devices. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.46b86c8074b2.I94d58b8e622ca87658dc05b05483fb954d526eab@changeid Signed-off-by: Luca Coelho commit d98cee05e3fdc7499583deb224eda52af577eae8 Author: Johannes Berg Date: Mon Aug 2 21:58:48 2021 +0300 iwlwifi: split off Bz devices into their own family These devices have some places with different behaviour required, so split them off into their own family as they should be. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.90257303559f.I4c4342229dcb9513099a3152605f0947423e86dc@changeid Signed-off-by: Luca Coelho commit e75bc5f3f110aa6c4c372e574bd2c37a8cad495f Author: Mukesh Sisodiya Date: Mon Aug 2 21:58:47 2021 +0300 iwlwifi: yoyo: cleanup internal buffer allocation in D3 With recent changes in the firmware SRAM debug during D3 is enabled by default and need not be enabled by driver. cleaning the code to align the same. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802215208.8535203d0ef7.Ib1695ce5de921b0472d0b1052e729e071573b863@changeid Signed-off-by: Luca Coelho commit 105167830d5fa7ca39d764c28e8f72bef5a16528 Author: Johannes Berg Date: Mon Aug 2 17:28:29 2021 +0300 iwlwifi: mvm: treat MMPDUs in iwl_mvm_mac_tx() as bcast There's no need for all the complicated conditions here, any bufferable MMPDUs or MMPDUs for client interfaces are already coming through the TXQ interface, not iwl_mvm_mac_tx(). Simplify the logic. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.3939f7c5c43a.I1d5cb5262e31a000023d79acbb897b8db50adf0d@changeid Signed-off-by: Luca Coelho commit 366fc672d6250bd747b745111b6a0d16b62aa60b Author: Johannes Berg Date: Mon Aug 2 17:28:28 2021 +0300 iwlwifi: mvm: clean up number of HW queues Since switching to mac80211 TXQs, we no longer need to advertise more hardware queues than ACs, since we don't even set QUEUE_CONTROL anyway, so the vif->hw_queue[] mapping array won't be used. All we need (at least for now) is for hw->queues to indicate that we have enough queues to handle QoS. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.80611a3c1ee7.I8a3d2b269421b6d8bada8c12cce3e095e6cfaeed@changeid Signed-off-by: Luca Coelho commit c6ce1c74ef2923b8ffd85f7f8b486f804f343b39 Author: Johannes Berg Date: Mon Aug 2 17:28:27 2021 +0300 iwlwifi: mvm: avoid static queue number aliasing When TVQM is enabled (iwl_mvm_has_new_tx_api() is true), then queue numbers are just sequentially assigned 0, 1, 2, ... Prior to TVQM, in DQA, there were some statically allocated queue numbers: * IWL_MVM_DQA_AUX_QUEUE == 1, * both IWL_MVM_DQA_INJECT_MONITOR_QUEUE and IWL_MVM_DQA_P2P_DEVICE_QUEUE == 2, and * IWL_MVM_DQA_AP_PROBE_RESP_QUEUE == 9. Now, these values are assigned to the members mvm->aux_queue, mvm->snif_queue, mvm->probe_queue and mvm->p2p_dev_queue by default. Normally, this doesn't really matter, and if TVQM is in fact available we override them to the real values after allocating a queue for use there. However, this allocation doesn't always happen. For example, for mvm->p2p_dev_queue (== 2) it only happens when the P2P Device interface is started, if any. If it's not started, the value in mvm->p2p_dev_queue remains 2. This wouldn't really matter all that much if it weren't for iwl_mvm_is_static_queue() which checks a queue number against one of those four static numbers. Now, if no P2P Device or monitor interface is added then queue 2 may be dynamically allocated, yet alias mvm->p2p_dev_queue or mvm->snif_queue, and thus iwl_mvm_is_static_queue() erroneously returns true for it. If it then gets full, all interface queues are stopped, instead of just backpressuring against the one TXQ that's really the only affected one. This clearly can lead to issues, as everything is stopped even if just a single TXQ filled its corresponding HW queue, if it happens to have an appropriate number (2 or 9, AUX is always reassigned.) Due to a mac80211 bug, this also led to a situation in which the queues remained stopped across a deauthentication and then attempts to connect to a new AP started failing, but that's fixed separately. Fix all of this by simply initializing the queue numbers to the invalid value until they're used, if TVQM is enabled, and also setting them back to that value when the queues are later freed again. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2e47e623f9e2.I9b0830dafbb68ef35b7b8f0f46160abec02ac7d0@changeid Signed-off-by: Luca Coelho commit 5993c90ccb56b34aaedfd77a1c67c7a2039090ee Author: Zheng Yongjun Date: Mon Aug 2 17:28:26 2021 +0300 iwlwifi: use DEFINE_MUTEX() for mutex lock mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2a583d006739.Ia782c08525397b6430b1c877a870d688a7f3f494@changeid Signed-off-by: Luca Coelho commit 2b06127df02fbca66d0098e9a1d3eaf62bb5e9c8 Author: Tom Rix Date: Mon Aug 2 17:28:25 2021 +0300 iwlwifi: remove trailing semicolon in macro definition The macro use will already have a semicolon. Signed-off-by: Tom Rix Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.3db450ebbb3c.Ic63f85b85a043256318da49d7b5a63f7dddf3986@changeid Signed-off-by: Luca Coelho commit 0f5d44ac6e55551798dd3da0ff847c8df5990822 Author: Zhang Qilong Date: Mon Aug 2 17:28:24 2021 +0300 iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed If beacon_inject_active is true, we will return without freeing beacon. Fid that by freeing it before returning. Signed-off-by: Zhang Qilong [reworded the commit message] Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.d16206ca60fc.I9984a9b442c84814c307cee3213044e24d26f38a@changeid Signed-off-by: Luca Coelho commit cd7ae5493448e12183e0b01070f060d617dd1edd Author: Wei Yongjun Date: Mon Aug 2 17:28:23 2021 +0300 iwlwifi: mvm: fix old-style static const declaration GCC reports warning as follows: drivers/net/wireless/intel/iwlwifi/mvm/rfi.c:14:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] 14 | const static struct iwl_rfi_lut_entry iwl_rfi_table[IWL_RFI_LUT_SIZE] = { | ^~~~~ Move static to the beginning of declaration. Fixes: 21254908cbe9 ("iwlwifi: mvm: add RFI-M support") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.f60b39bbb0c0.I8b0ad9105003d13cc4aa64fc957aec9582e8b26d@changeid Signed-off-by: Luca Coelho commit c1868c0b78892a8b2329dae835786a8a7f643fe2 Author: Luca Coelho Date: Mon Aug 2 17:28:22 2021 +0300 iwlwifi: mvm: remove check for vif in iwl_mvm_vif_from_mac80211() This check is useless, because we would return NULL in that case and none of the callers actually check that the return value was not NULL before accessing it. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.f1c4844a2650.If4dc009e22cda51099a1dc4237d04bf4313055d6@changeid Signed-off-by: Luca Coelho commit 02289645a085eedb55b185da2766b5c6f9492577 Author: Luca Coelho Date: Mon Aug 2 17:28:21 2021 +0300 iwlwifi: pcie: remove spaces from queue names If we use spaces in the queue names, we get files with spaces in their name in procfs, which is ugly. Remove the spaces. Reported-by: Joe Perches Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.0ef8aedd4f9b.If527b9ae5bf8de8c6877d4b6a21ed8d81b0f877e@changeid Signed-off-by: Luca Coelho commit de34d1c1d30d6d9373f536522c04b86b54711c3b Author: Johannes Berg Date: Mon Aug 2 17:28:20 2021 +0300 iwlwifi: mvm: restrict FW SMPS request The firmware SMPS request should only be honoured if the connection is currently with HE and on 160 MHz, so check that and then potentially reapply any request if the BW changes. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.0cdcac5660da.I9ee7956fd4f48399855d1f97728bc58b36caf112@changeid Signed-off-by: Luca Coelho commit a6dfbd040e26d0fa429545d37ca9d3dc8a80cf3b Author: Johannes Berg Date: Mon Aug 2 17:28:19 2021 +0300 iwlwifi: mvm: set replay counter on key install When installing a (new) key, set the replay counter so that after FW restart the firmware has the correct value of the replay counters. This doesn't have a large effect - for frames that reach the driver, it will do a replay check, and when installing a new key, the counter is normally zero to start with (not for GTK though, if joining the BSS for the first time). Since this only affects frames handled entirely by the FW, and that's restricted to a few unicast management frames, the only affect here is for those after a firmware restart. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.1cedf2ca7bb6.I2e609c28eaa301436e6740f4f1beca838f69a96a@changeid Signed-off-by: Luca Coelho commit 1a81bddf7f47443240b7703bf9e5ffb12c4261cf Author: Mordechay Goodstein Date: Mon Aug 2 17:28:18 2021 +0300 iwlwifi: mvm: remove trigger EAPOL time event EAPOL failure results in deauthentication with various reasons, not related to AUTH failure specifically, so we just merge AUTH failure with failed to assoc to AP. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2ff350d85eab.I02c5b5d29c0d5c2e014bd1081b07ed33772ae04d@changeid Signed-off-by: Luca Coelho commit 8fc3015d0d35f42ee57c04bfe3c17f112afce5fe Author: Mordechay Goodstein Date: Mon Aug 2 17:09:44 2021 +0300 iwlwifi: iwl-dbg-tlv: add info about loading external dbg bin This helps understand why and what debug capabilities are running. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.98980f8bd17f.Ifcedf415a545a87cb341a4142085b5723d8cac4d@changeid Signed-off-by: Luca Coelho commit 16cff731a3a17d30b1e556c474b6dddb09c64b41 Author: Ilan Peer Date: Mon Aug 2 17:09:43 2021 +0300 iwlwifi: mvm: Add support for hidden network scan on 6GHz band Add support for discovery of hidden networks on the 6GHz band, by including the scan request direct SSIDs in the FW scan request command: - In case a short SSID matches one of the direct SSIDs in the scan request command, add the matching SSID in the same offset in the 'direct_ssids' array. - Otherwise, add the SSID in one of the available slots. Additionally, as a preparation to handle hidden APs, refactor iwl_mvm_umac_scan_cfg_channels_v6_6g() the function. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.ffb540a70212.Ia2bb9bc9435b833820bcc7dc30adcedb5a5a9869@changeid Signed-off-by: Luca Coelho commit deedf9b97cd4ef45da476c9bdd2a5f3276053956 Author: Ilan Peer Date: Mon Aug 2 17:09:42 2021 +0300 iwlwifi: mvm: Do not use full SSIDs in 6GHz scan The scan request processing populated the direct SSIDs in the FW scan request command also for 6GHz scan, which is not needed and might result in unexpected behavior. Fix the code to add the direct SSIDs only in case the scan is not a 6GHz scan. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.f465937c7bbf.Ic11a1659ddda850c3ec1b1afbe9e2b9577ac1800@changeid Signed-off-by: Luca Coelho commit 2a1d2fcf2bedd5aef9e7cc638211ffdef062e5dd Author: Luca Coelho Date: Mon Aug 2 17:09:41 2021 +0300 iwlwifi: print PNVM complete notification status in hexadecimal This value is not a simple incrementing integer, it contains some flags as well, so reading it in hexadecimal is easier. Change the print to do it in hex instead of decimal. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.5e35f930d0ed.I5f94575a835f060bdc8ed3477871256f8a2cbaaa@changeid Signed-off-by: Luca Coelho commit e63aafea74393e6c6ca0dd439e72021830a0fcac Author: Johannes Berg Date: Mon Aug 2 17:09:40 2021 +0300 iwlwifi: pcie: dump error on FW reset handshake failures If the firmware crashes while we're waiting for the reset handshake then it cannot possibly make progress anymore, and we will just time out the wait. That's pointless, so just stop waiting at that point. Additionally, if it never acknowledges the reset handshake, something went wrong. Dump an error in both of these cases, but we need to do it synchronously here since the device will be turned off. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.8b6a33544b4b.I55f97f70f8efa64db064a9207177a094c60ac8f1@changeid Signed-off-by: Luca Coelho commit b8221b0f750a05a7ae9cbca84932e2a36a3ee658 Author: Johannes Berg Date: Mon Aug 2 17:09:39 2021 +0300 iwlwifi: prepare for synchronous error dumps In some cases it may be necessary to synchronously create a firmware error report, add the necessary infrastructure for this. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.481b6642f0fc.I7c9c958408a285e3d19aceed2a5a3341cfc08382@changeid Signed-off-by: Luca Coelho commit 6ac5720086c8b176794eb74c5cc09f8b79017f38 Author: Johannes Berg Date: Mon Aug 2 17:09:38 2021 +0300 iwlwifi: pcie: free RBs during configure When switching op-modes, or more generally when reconfiguring, we might switch the RB size. In _iwl_pcie_rx_init() we have a comment saying we must free all RBs since we might switch the size, but this is actually too late: the switch has been done and we'll free the buffers with the wrong size. Fix this by always freeing the buffers, if any, at the start of configure, instead of only after the size may have changed. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.42d7c93279c4.I07f74e65aab0e3d965a81206fcb289dc92d74878@changeid Signed-off-by: Luca Coelho commit 95fe8d89bb8c9c114ca3e46f8b2457f894f55746 Author: Johannes Berg Date: Mon Aug 2 17:09:37 2021 +0300 iwlwifi: pcie: optimise struct iwl_rx_mem_buffer layout On 64-bit machines, struct iwl_rx_mem_buffer has a lot of padding due to the use of pointers after the small items. Move the list entry before them, and while at it also add documentation for it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.6a62255b3df0.I47bb36530a3c2cdbd73454c796ce608ee2a32a6c@changeid Signed-off-by: Luca Coelho commit 2f308f008f1ccda4dcf9816c7dad0a33fbffdd18 Author: Johannes Berg Date: Mon Aug 2 17:09:36 2021 +0300 iwlwifi: mvm: avoid FW restart while shutting down If the firmware crashes while we're already shutting down the system, there isn't much we can do since the shutdown process is continuing and we wanted to do that. Don't do a FW restart, with the implied debug collection, in this case. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.43a7351ae6bd.I164d48ce4379accf76ea0637983fd946d52dc6f5@changeid Signed-off-by: Luca Coelho commit 0eb5a554bb49bf62f929612dd964e4a834b71a81 Author: Johannes Berg Date: Mon Aug 2 17:09:35 2021 +0300 iwlwifi: nvm: enable IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF The device is capable of receiving MU-MIMO frames with 8 symbols, enable the bit here that says so. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.90cf2eb42794.I692e6d0fde6e99a1db97d2e678952f043f48f603@changeid Signed-off-by: Luca Coelho commit 1269ba1ce35d91799a43fc52e9eeb04364f50dfd Author: Shaul Triebitz Date: Mon Aug 2 17:09:34 2021 +0300 iwlwifi: mvm: set BROADCAST_TWT_SUPPORTED in MAC policy If broadcast TWT is supported in the BSS, tell the firmware about it by setting the BROADCAST_TWT_SUPPORTED in the MAC context command. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.736c3b1bc915.I10583bb6f808aa60954da26106bbc8c26620cbe8@changeid Signed-off-by: Luca Coelho commit f2d1bdf053d0cafff61a32103b20403958cb5232 Author: Mordechay Goodstein Date: Mon Aug 2 17:09:33 2021 +0300 iwlwifi: iwl-nvm-parse: set STBC flags for HE phy capabilities Our HW supersets STBC for HE but never set it in assoc IE, fix it by setting it and enable using it. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802170640.0108f3e322b6.Ib25a91b5c48ff1fb2185b86a9e4bf5eec637df90@changeid Signed-off-by: Luca Coelho commit adf9ae0d159d3dc94f58d788fc4757c8749ac0df Author: Johannes Berg Date: Tue Jul 13 23:47:10 2021 +0200 um: fix stub location calculation In commit 9f0b4807a44f ("um: rework userspace stubs to not hard-code stub location") I changed stub_segv_handler() to do a calculation with a pointer to a stack variable to find the data page that we're using for the stack and the rest of the data. This same commit was meant to do it as well for stub_clone_handler(), but the change inadvertently went into commit 84b2789d6115 ("um: separate child and parent errors in clone stub") instead. This was reported to not be compiled correctly by gcc 5, causing the code to crash here. I'm not sure why, perhaps it's UB because the var isn't initialized? In any case, this trick always seemed bad, so just create a new inline function that does the calculation in assembly. Reported-by: subashab@codeaurora.org Fixes: 9f0b4807a44f ("um: rework userspace stubs to not hard-code stub location") Fixes: 84b2789d6115 ("um: separate child and parent errors in clone stub") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 6a241d2923c2c0f6893c78c79421ceb3935691fd Author: Johannes Berg Date: Tue Aug 17 17:53:29 2021 +0200 um: virt-pci: fix uapi documentation The identifier names in the documentation here didn't match the real ones, and the reserved was missing. Fix that. Reported-by: Bjorn Helgaas Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit bc5c49d79206b40ad16e055837a33b6dc6160bed Author: Johannes Berg Date: Wed Aug 11 16:58:26 2021 +0200 um: enable VMAP_STACK This works just fine, so select HAVE_ARCH_VMAP_STACK to let users enable VMAP_STACK if desired. Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 4a22c4cebd61f67bd8a2c79f8dae10df074f62b9 Author: Johannes Berg Date: Wed Aug 11 16:58:25 2021 +0200 um: virt-pci: don't do DMA from stack When enabling VMAP_STACK, SG helpers immediately complained that we were doing DMA from stack. Use per-CPU variables to avoid that. Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 1568cb0e6d97f233a5a3e37c27677bb6a0d44b4d Author: Johannes Berg Date: Tue Jul 6 23:12:42 2021 +0200 hostfs: support splice_write There's really no good reason not to, and e.g. trace-cmd currently requires it for the temporary per-CPU files. Hook up splice_write just like everyone else does. Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 7ad28e0df7ee9dbcb793bb88dd81d4d22bb9a10e Author: Johannes Berg Date: Fri Jun 25 10:34:37 2021 +0200 um: virtio_uml: fix memory leak on init failures If initialization fails, e.g. because the connection failed, we leak the 'vu_dev'. Fix that. Reported by smatch. Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver") Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 21976f2b747edd9350336cdd6700b792a3bc2170 Author: Johannes Berg Date: Fri Jun 25 10:34:36 2021 +0200 um: virtio_uml: include linux/virtio-uml.h This fixes a sparse warning, since the function defined here should have a declaration (or be static). Reported-by: kernel test robot Fixes: 43c590cb8666 ("um: virtio/pci: enable suspend/resume") Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 68fdb64485014802152725a4aec63296847f740e Author: Johannes Berg Date: Fri Jun 25 10:34:35 2021 +0200 lib/logic_iomem: fix sparse warnings A couple of sparse warnings happened here due to casts on the prints, a missing static and a missing include. Fix all of them. Reported-by: kernel test robot Fixes: ca2e334232b6 ("lib: add iomem emulation (logic_iomem)") Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit b76dd9302af7803aac62243ae94d53067fc819b4 Author: Johannes Berg Date: Fri Jun 25 10:34:34 2021 +0200 um: make PCI emulation driver init/exit static The functions aren't used elsewhere, so they can be static. Reported-by: kernel test robot Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 0bcc7ca40bd823193224e9f38bafbd8325aaf566 Author: J. Bruce Fields Date: Tue Aug 24 22:36:03 2021 -0400 nfsd: fix crash on LOCKT on reexported NFSv3 Unlike other filesystems, NFSv3 tries to use fl_file in the GETLK case. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit bb0a55bb7148a49e549ee992200860e7a040d3a5 Author: J. Bruce Fields Date: Fri Aug 20 17:02:06 2021 -0400 nfs: don't allow reexport reclaims In the reexport case, nfsd is currently passing along locks with the reclaim bit set. The client sends a new lock request, which is granted if there's currently no conflict--even if it's possible a conflicting lock could have been briefly held in the interim. We don't currently have any way to safely grant reclaim, so for now let's just deny them all. I'm doing this by passing the reclaim bit to nfs and letting it fail the call, with the idea that eventually the client might be able to do something more forgiving here. Signed-off-by: J. Bruce Fields Acked-by: Anna Schumaker Signed-off-by: Chuck Lever commit b840be2f00c0bc00d993f8f76e251052b83e4382 Author: J. Bruce Fields Date: Fri Aug 20 17:02:05 2021 -0400 lockd: don't attempt blocking locks on nfs reexports As in the v4 case, it doesn't work well to block waiting for a lock on an nfs filesystem. As in the v4 case, that means we're depending on the client to poll. It's probably incorrect to depend on that, but I *think* clients do poll in practice. In any case, it's an improvement over hanging the lockd thread indefinitely as we currently are. Signed-off-by: J. Bruce Fields Acked-by: Anna Schumaker Signed-off-by: Chuck Lever commit f657f8eef3ff870552c9fd2839e0061046f44618 Author: J. Bruce Fields Date: Fri Aug 20 17:02:04 2021 -0400 nfs: don't atempt blocking locks on nfs reexports NFS implements blocking locks by blocking inside its lock method. In the reexport case, this blocks the nfs server thread, which could lead to deadlocks since an nfs server thread might be required to unlock the conflicting lock. It also causes a crash, since the nfs server thread assumes it can free the lock when its lm_notify lock callback is called. Ideal would be to make the nfs lock method return without blocking in this case, but for now it works just not to attempt blocking locks. The difference is just that the original client will have to poll (as it does in the v4.0 case) instead of getting a callback when the lock's available. Signed-off-by: J. Bruce Fields Acked-by: Anna Schumaker Signed-off-by: Chuck Lever commit 8c09e896cef8d908dd9a20a9f2a5c3fcb9799de3 Author: Zhangfei Gao Date: Tue Jul 13 10:54:34 2021 +0800 PCI: Allow PASID on fake PCIe devices without TLP prefixes Some systems, e.g., HiSilicon KunPeng920 and KunPeng930, have devices that appear as PCI but are actually on the AMBA bus. Some of these fake PCI devices support a PASID-like feature and they do have a working PASID capability even though they do not use the PCIe Transport Layer Protocol and do not support TLP prefixes. Add a pasid_no_tlp bit for this "PASID works without TLP prefixes" case and update pci_enable_pasid() so it can enable PASID on these devices. Set this bit for HiSilicon KunPeng920 and KunPeng930. [bhelgaas: squashed, commit log] Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/1626144876-11352-2-git-send-email-zhangfei.gao@linaro.org Link: https://lore.kernel.org/r/1626144876-11352-3-git-send-email-zhangfei.gao@linaro.org Signed-off-by: Zhangfei Gao Signed-off-by: Jean-Philippe Brucker Signed-off-by: Zhou Wang Signed-off-by: Bjorn Helgaas commit 48b2e71c2e53263ebbb6798bbf208e191937e691 Author: Kumar Kartikeya Dwivedi Date: Thu Aug 26 17:39:10 2021 +0530 samples: bpf: Fix uninitialized variable in xdp_redirect_cpu While at it, also improve help output when CPU number is greater than possible. Fixes: e531a220cc59 ("samples: bpf: Convert xdp_redirect_cpu to XDP samples helper") Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210826120910.454081-1-memxor@gmail.com commit e0be99864d99712d86feff67c552eee9ef50ae44 Author: Konrad Dybcio Date: Fri Jun 18 13:14:34 2021 +0200 clk: qcom: mmcc-msm8994: Add MSM8992 support MSM8992 features less clocks & GDSCS and has different freq tables for some of them. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210618111435.595689-3-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit 4d5b4572c4753f2637ea9ac7eda465a1ca0d6f7b Author: Konrad Dybcio Date: Fri Jun 18 13:14:33 2021 +0200 clk: qcom: Add msm8994 MMCC driver Add a driver for managing MultiMedia SubSystem clocks on msm8994 and its derivatives. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210618111435.595689-2-konrad.dybcio@somainline.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 7972609631fd74163494b8b23a233b6d4862e795 Author: Konrad Dybcio Date: Fri Jun 18 13:14:32 2021 +0200 dt-bindings: clock: Add support for MSM8992/4 MMCC Document the multimedia clock controller found on MSM8992/4. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210618111435.595689-1-konrad.dybcio@somainline.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 3599bc5101b36d9ff88da17fe65b001aeadd9c62 Author: Yucong Sun Date: Wed Aug 25 11:47:45 2021 -0700 selftests/bpf: Reduce more flakyness in sockmap_listen This patch adds similar retry logic to more places where read() is used, to reduce flakyness in slow CI environment. Signed-off-by: Yucong Sun Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825184745.2680830-1-fallentree@fb.com commit 9bb6cfc3c77e68dc54647152ec4e1b5f2d16f569 Author: Vladimir Lypak Date: Thu Aug 5 09:06:57 2021 +0000 clk: qcom: Add Global Clock Controller driver for MSM8953 This driver provides clocks, resets and power domains for MSM8953 and compatible SoCs: APQ8053, SDM450, SDA450, SDM632, SDA632. Signed-off-by: Vladimir Lypak Signed-off-by: Adam Skladowski Reviewed-by: Konrad Dybcio Signed-off-by: Sireesh Kodali Link: https://lore.kernel.org/r/IPvVnyRWbHuQFswiFz0W08Kj1dKoH55ddQVyIIPhMJw@cp7-web-043.plabs.ch Signed-off-by: Stephen Boyd commit 1b9de19e244d79c1f8db208a0691f97426aef81f Author: Vladimir Lypak Date: Thu Aug 5 09:06:42 2021 +0000 dt-bindings: clock: add Qualcomm MSM8953 GCC driver bindings Add bindings and compatible to document MSM8953 GCC (Global Clock Controller) driver. Signed-off-by: Vladimir Lypak Signed-off-by: Adam Skladowski Signed-off-by: Sireesh Kodali Link: https://lore.kernel.org/r/Q6uB3NRxqtD8Prsmliv8ZdsTXGeviv7lb2jQ743jr1E@cp4-web-036.plabs.ch Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit da09577ab562e2700f0aba3f17cc741717ca9e38 Author: Bjorn Andersson Date: Wed Aug 25 13:45:17 2021 -0700 clk: qcom: gcc-sdm660: Replace usage of parent_names Using parent_data and parent_hws, instead of parent_names, does protect against some cases of incompletely defined clock trees. While it turns out that the bug being chased this time was totally unrelated, this patch converts the SDM660 GCC driver to avoid such issues. The "xo" fixed_factor clock is unused within the gcc driver, but referenced from the DSI PHY. So it's left in place until the DSI driver is updated. Tested-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Marijn Suijten Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210825204517.1278130-1-bjorn.andersson@linaro.org [sboyd@kernel.org: Reduce diff by moving enum and tables back to original position in previous patch] Signed-off-by: Stephen Boyd commit a61ca021fe28ab7163ca879fc3532c3cca25063c Author: Stephen Boyd Date: Thu Aug 26 11:49:14 2021 -0700 clk: qcom: gcc-sdm660: Move parent tables after PLLs In the next patch we're going to change these tables to reference the PLL structures directly. Let's move them here so the diff is easier to read. No functional change in this patch. Signed-off-by: Stephen Boyd commit 72cfc73f4663abe0b5c420d255c932ae5e7c126d Author: Dmitry Baryshkov Date: Sat Jul 31 22:50:34 2021 +0300 clk: qcom: use devm_pm_runtime_enable and devm_pm_clk_create Use two new helpers instead of pm_runtime_enable() and pm_clk_create(), removing the need for calling pm_runtime_disable and pm_clk_destroy(). Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210731195034.979084-4-dmitry.baryshkov@linaro.org Signed-off-by: Stephen Boyd commit a649136b17af6361355874a10e9219390c266a2c Author: Dmitry Baryshkov Date: Sat Jul 31 22:50:33 2021 +0300 PM: runtime: add devm_pm_clk_create helper A typical code pattern for pm_clk_create() call is to call it in the _probe function and to call pm_clk_destroy() both from _probe error path and from _remove function. For some drivers the whole remove function would consist of the call to pm_remove_disable(). Add helper function to replace this bolierplate piece of code. Calling devm_pm_clk_create() removes the need for calling pm_clk_destroy() both in the probe()'s error path and in the remove() function. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210731195034.979084-3-dmitry.baryshkov@linaro.org Acked-by: Rafael J. Wysocki Signed-off-by: Stephen Boyd commit b3636a3a2c51715736d3ec45f635ed03191962ce Author: Dmitry Baryshkov Date: Sat Jul 31 22:50:32 2021 +0300 PM: runtime: add devm_pm_runtime_enable helper A typical code pattern for pm_runtime_enable() call is to call it in the _probe function and to call pm_runtime_disable() both from _probe error path and from _remove function. For some drivers the whole remove function would consist of the call to pm_remove_disable(). Add helper function to replace this bolierplate piece of code. Calling devm_pm_runtime_enable() removes the need for calling pm_runtime_disable() both in the probe()'s error path and in the remove() function. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210731195034.979084-2-dmitry.baryshkov@linaro.org Acked-by: Rafael J. Wysocki Signed-off-by: Stephen Boyd commit d6be5d0ad304e81d4719ee47c429493aab033e38 Author: Alexander Gordeev Date: Tue Aug 24 15:30:22 2021 +0200 s390/smp: do not use nodat_stack for secondary CPU start The secondary CPU start C routine uses nodat_stack as a interim stack before finally switching to kernel_stack. Such scheme is superfluous, since the assembler restart interrupt handler (that secondary CPU starter is called from) does not need to use any stack for switching into DAT mode. Once DAT is on, any stack including virtually- mapped one could be used. Avoid the use of nodat_stack and smp_start_secondary() helper. Instead, initiate kernel_stack directly from the restart interrupt handler. Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 915fea04f9320d0f4ab6ecbb6bf759eebcd2c41d Author: Alexander Gordeev Date: Tue Aug 24 15:30:21 2021 +0200 s390/smp: enable DAT before CPU restart callback is called The restart interrupt is triggered whenever a secondary CPU is brought online, a remote function call dispatched from another CPU or a manual PSW restart is initiated and causes the system to kdump. The handling routine is always called with DAT turned off. It then initializes the stack frame and invokes a callback. The existing callbacks handle DAT as follows: * __do_restart() and __machine_kexec() turn in on upon entry; * __ipl_run(), __reipl_run() and __dump_run() do not turn it right away, but all of them call diag308() - which turns DAT on, but only if kasan is enabled; In addition to the described complexity all callbacks (and the functions they call) should avoid kasan instrumentation while DAT is off. This update enables DAT in the assembler restart handler and relieves any callbacks (which are mostly C functions) from dealing with DAT altogether. There are four types of CPU restart that initialize control registers in different ways: 1. Start of secondary CPU on boot - control registers are inherited from the IPL CPU; 2. Restart of online CPU - control registers of the CPU being restarted are kept; 3. Hotplug of offline CPU - control registers are inherited from the starting CPU; 4. Start of offline CPU triggered by manual PSW restart - the control registers are read from the absolute lowcore and contain the boot time IPL CPU values updated with all follow-up calls of smp_ctl_set_bit() and smp_ctl_clear_bit() routines; In first three cases contents of the control registers is the most recent. In the latter case control registers are good enough to facilitate successful completion of kdump operation. Suggested-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit e7dc78d3d9ad1e70f2e955bdfef807a9f1dfcce7 Author: Heiko Carstens Date: Wed Aug 25 16:52:44 2021 +0200 s390: update defconfigs Ingo Franzki reported that our defconfig and debug_config went out of sync with respect to DM_INTEGRITY. Fix it. Reported-by: Ingo Franzki Signed-off-by: Heiko Carstens commit cabebb697c98fb1f05cc950a747a9b6ec61a5b01 Author: Harald Freudenberger Date: Wed Aug 25 10:55:02 2021 +0200 s390/ap: fix state machine hang after failure to enable irq If for any reason the interrupt enable for an ap queue fails the state machine run for the queue returned wrong return codes to the caller. So the caller assumed interrupt support for this queue in enabled and thus did not re-establish the high resolution timer used for polling. In the end this let to a hang for the user space process waiting "forever" for the reply. This patch reworks these return codes to return correct indications for the caller to re-establish the timer when a queue runs without interrupt support. Please note that this is fixing a wrong behavior after a first failure (enable interrupt support for the queue) failed. However, looks like this occasionally happens on KVM systems. Signed-off-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit 52c64e5f7b79ce5c366ea88e7f02d81affeb1300 Merge: 6479f7588651c d3efd26af2e04 Author: Mark Brown Date: Thu Aug 26 19:15:14 2021 +0100 Merge series "ASoC: wcd9335: Firx some resources leak in the probe and remove function" from Christophe JAILLET : The first 2 patches are sraightforward and look logical to me. However, the 3rd one in purely speculative. It is based on the fact that a comment states that we enable some irqs on some slave ports. That said, it writes 0xFF in some registers. So, I guess that we should disable these irqs when the driver is removed. That said, writing 0x00 at the same place looks logical to me. This cis untested and NOT based on any documentation. Just a blind fix. Review with care. You'll be warned :) Christophe JAILLET (3): ASoC: wcd9335: Fix a double irq free in the remove function ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function ASoC: wcd9335: Disable irq on slave ports in the remove function sound/soc/codecs/wcd9335.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) -- 2.30.2 commit 61d861cf478576d85d6032f864360a34b26084b1 Author: Nicholas Kazlauskas Date: Wed May 13 11:58:50 2020 -0400 drm/amd/display: Move AllowDRAMSelfRefreshOrDRAMClockChangeInVblank to bounding box [Why] This is a global parameter, not a per pipe parameter and it's useful for experimenting with the prefetch schedule to be adjustable from the SOC bb. [How] Add a parameter to the SOC bb, default is the existing policy for all DCN. Fill it in when filling SOC bb parameters. Revert the policy to use MinDCFClk at the same time since that's not going to give us P-State in most cases on the spreadsheet. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403 Signed-off-by: Nicholas Kazlauskas Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b6d585041fd084ca28b605f8c9ca43aae9800ab1 Author: Aurabindo Pillai Date: Wed Aug 25 11:53:05 2021 -0400 drm/amd/display: Remove duplicate dml init [Why & How] DML is initialized again unnecessarily after its done conditionally. Remove the duplicate initialization Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403 Signed-off-by: Aurabindo Pillai Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit a7a9d11e12fcc32160d55e8612e72e5ab51b15dc Author: Jerry (Fangzhi) Zuo Date: Wed Jun 17 20:34:33 2020 -0400 drm/amd/display: Update bounding box states (v2) [Why] Drop hardcoded dispclk, dppclk, phyclk [How] Read the corresponding values from clock table entries already populated. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403 Cc: stable@vger.kernel.org Signed-off-by: Jerry (Fangzhi) Zuo Signed-off-by: Aurabindo Pillai Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0bbf06d888734041e813b916d7821acd4f72005a Author: Aurabindo Pillai Date: Tue Aug 24 15:10:50 2021 -0400 drm/amd/display: Update number of DCN3 clock states [Why & How] The DCN3 SoC parameter num_states was calculated but not saved into the object. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403 Cc: stable@vger.kernel.org Signed-off-by: Aurabindo Pillai Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 192fb630fbd49eb1d27dceaf16e9676fe915f385 Author: Hawking Zhang Date: Thu Aug 26 13:54:53 2021 +0800 drm/amdgpu: disable GFX CGCG in aldebaran disable GFX CGCG and CGLS to workaround a hardware issue found in aldebaran. Signed-off-by: Hawking Zhang Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 54e6badbedd89f2cca29809c54c53e56da6f6558 Author: John Clements Date: Thu Aug 26 15:10:39 2021 +0800 drm/amdgpu: Clear RAS interrupt status on aldebaran resolve register address issue for detecting/clearing RAS interrupt Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 3c4ff2dcc0dffbfa79f7f55237f502a74ed018b7 Author: John Clements Date: Thu Aug 26 13:55:52 2021 +0800 drm/amdgpu: Add support for RAS XGMI err query Update XGMI RAS to support error query on aldebaran Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 1ec06c2dee679e9f089e78ed20cb74ee90155f61 Author: Sean Keely Date: Thu Aug 19 21:26:14 2021 -0500 drm/amdkfd: Account for SH/SE count when setting up cu masks. On systems with multiple SH per SE compute_static_thread_mgmt_se# is split into independent masks, one for each SH, in the upper and lower 16 bits. We need to detect this and apply cu masking to each SH. The cu mask bits are assigned first to each SE, then to alternate SHs, then finally to higher CU id. This ensures that the maximum number of SPIs are engaged as early as possible while balancing CU assignment to each SH. v2: Use max SH/SE rather than max SH in cu_per_sh. v3: Fix comment blocks, ensure se_mask is initially zero filled, and correctly assign se.sh.cu positions to unset bits in cu_mask. Signed-off-by: Sean Keely Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ea870730d83fc13a5fa2bd0e175176d7ac8a400a Merge: 29848a034ac74 ffc95d1b8edb8 7fa005caa35ed eb0feefd4c025 Author: Alex Williamson Date: Thu Aug 26 11:08:50 2021 -0600 Merge branches 'v5.15/vfio/spdx-license-cleanups', 'v5.15/vfio/dma-valid-waited-v3', 'v5.15/vfio/vfio-pci-core-v5' and 'v5.15/vfio/vfio-ap' into v5.15/vfio/next commit 6479f7588651cbc9c91e61c20ff39119cbc8feba Author: Pierre-Louis Bossart Date: Tue Aug 17 11:40:54 2021 -0500 ASoC: soc-pcm: test refcount before triggering On start/pause_release/resume, when more than one FE is connected to the same BE, it's possible that the trigger is sent more than once. This is not desirable, we only want to trigger a BE once, which is straightforward to implement with a refcount. For stop/pause/suspend, the problem is more complicated: the check implemented in snd_soc_dpcm_can_be_free_stop() may fail due to a conceptual deadlock when we trigger the BE before the FE. In this case, the FE states have not yet changed, so there are corner cases where the TRIGGER_STOP is never sent - the dual case of start where multiple triggers might be sent. This patch suggests an unconditional trigger in all cases, without checking the FE states, using a refcount protected by a spinlock. Signed-off-by: Pierre-Louis Bossart Message-Id: <20210817164054.250028-3-pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown commit 0c75fc7193387776c10f7c7b440d93496e3d5e21 Author: Pierre-Louis Bossart Date: Tue Aug 17 11:40:53 2021 -0500 ASoC: soc-pcm: protect BE dailink state changes in trigger When more than one FE is connected to a BE, e.g. in a mixing use case, the BE can be triggered multiple times when the FE are opened/started concurrently. This race condition is problematic in the case of SoundWire BE dailinks, and this is not desirable in a general case. The code carefully checks when the BE can be stopped or hw_free'ed, but the trigger code does not use any mutual exclusion. Fix by using the same spinlock already used to check FE states, and set the state before the trigger. In case of errors, the initial state will be restored. This patch does not change how the triggers are handled, it only makes sure the states are handled in critical sections. Signed-off-by: Pierre-Louis Bossart Message-Id: <20210817164054.250028-2-pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown commit d3efd26af2e044ff2b48d38bb871630282d77e60 Author: Christophe JAILLET Date: Mon Aug 16 07:25:28 2021 +0200 ASoC: wcd9335: Disable irq on slave ports in the remove function The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave ports. This must be undone in the remove function. Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()' function, and call it from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown commit fc6fc81caa63900cef9ebb8b2e365c3ed5a9effb Author: Christophe JAILLET Date: Mon Aug 16 07:25:20 2021 +0200 ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in 'wcd_clsh_ctrl_alloc()', as already done in the remove function. Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown commit 7a6a723e98aa45f393e6add18f7309dfffa1b0e2 Author: Christophe JAILLET Date: Mon Aug 16 07:25:10 2021 +0200 ASoC: wcd9335: Fix a double irq free in the remove function There is no point in calling 'free_irq()' explicitly for 'WCD9335_IRQ_SLIMBUS' in the remove function. The irqs are requested in 'wcd9335_setup_irqs()' using a resource managed function (i.e. 'devm_request_threaded_irq()'). 'wcd9335_setup_irqs()' requests all what is defined in the 'wcd9335_irqs' structure. This structure has only one entry for 'WCD9335_IRQ_SLIMBUS'. So 'devm_request...irq()' + explicit 'free_irq()' would lead to a double free. Remove the unneeded 'free_irq()' from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET Message-Id: <0614d63bc00edd7e81dd367504128f3d84f72efa.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown commit 7fa005caa35ed92563b9e9d88d319b2623763a77 Author: Max Gurtovoy Date: Thu Aug 26 13:39:12 2021 +0300 vfio/pci: Introduce vfio_pci_core.ko Now that vfio_pci has been split into two source modules, one focusing on the "struct pci_driver" (vfio_pci.c) and a toolbox library of code (vfio_pci_core.c), complete the split and move them into two different kernel modules. As before vfio_pci.ko continues to present the same interface under sysfs and this change will have no functional impact. Splitting into another module and adding exports allows creating new HW specific VFIO PCI drivers that can implement device specific functionality, such as VFIO migration interfaces or specialized device requirements. Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-14-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 85c94dcffcb775bafffd6e966db49253e1b789d9 Author: Jason Gunthorpe Date: Thu Aug 26 13:39:11 2021 +0300 vfio: Use kconfig if XX/endif blocks instead of repeating 'depends on' This results in less kconfig wordage and a simpler understanding of the required "depends on" to create the menu structure. The next patch increases the nesting level a lot so this is a nice preparatory simplification. Signed-off-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-13-yishaih@nvidia.com Signed-off-by: Alex Williamson commit ca4ddaac7fa710a250bbd650cc719425bec973a0 Author: Jason Gunthorpe Date: Thu Aug 26 13:39:10 2021 +0300 vfio: Use select for eventfd If VFIO_VIRQFD is required then turn on eventfd automatically. The majority of kconfig users of the EVENTFD use select not depends on. Signed-off-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-12-yishaih@nvidia.com Signed-off-by: Alex Williamson commit cc6711b0bf36de068b10490198d05ac168377989 Author: Max Gurtovoy Date: Thu Aug 26 13:39:09 2021 +0300 PCI / VFIO: Add 'override_only' support for VFIO PCI sub system Expose an 'override_only' helper macro (i.e. PCI_DRIVER_OVERRIDE_DEVICE_VFIO) for VFIO PCI sub system and add the required code to prefix its matching entries with "vfio_" in modules.alias file. It allows VFIO device drivers to include match entries in the modules.alias file produced by kbuild that are not used for normal driver autoprobing and module autoloading. Drivers using these match entries can be connected to the PCI device manually, by userspace, using the existing driver_override sysfs. For example the resulting modules.alias may have: alias pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_core alias vfio_pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_vfio_pci alias vfio_pci:v*d*sv*sd*bc*sc*i* vfio_pci In this example mlx5_core and mlx5_vfio_pci match to the same PCI device. The kernel will autoload and autobind to mlx5_core but the kernel and udev mechanisms will ignore mlx5_vfio_pci. When userspace wants to change a device to the VFIO subsystem it can implement a generic algorithm: 1) Identify the sysfs path to the device: /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 2) Get the modalias string from the kernel: $ cat /sys/bus/pci/devices/0000:01:00.0/modalias pci:v000015B3d00001021sv000015B3sd00000001bc02sc00i00 3) Prefix it with vfio_: vfio_pci:v000015B3d00001021sv000015B3sd00000001bc02sc00i00 4) Search modules.alias for the above string and select the entry that has the fewest *'s: alias vfio_pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_vfio_pci 5) modprobe the matched module name: $ modprobe mlx5_vfio_pci 6) cat the matched module name to driver_override: echo mlx5_vfio_pci > /sys/bus/pci/devices/0000:01:00.0/driver_override 7) unbind device from original module echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind 8) probe PCI drivers (or explicitly bind to mlx5_vfio_pci) echo 0000:01:00.0 > /sys/bus/pci/drivers_probe The algorithm is independent of bus type. In future the other buses with VFIO device drivers, like platform and ACPI, can use this algorithm as well. This patch is the infrastructure to provide the information in the modules.alias to userspace. Convert the only VFIO pci_driver which results in one new line in the modules.alias: alias vfio_pci:v*d*sv*sd*bc*sc*i* vfio_pci Later series introduce additional HW specific VFIO PCI drivers, such as mlx5_vfio_pci. Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe Acked-by: Bjorn Helgaas # for pci.h Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-11-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 343b7258687ecfbb363bfda8833a7cf641aac524 Author: Max Gurtovoy Date: Thu Aug 26 13:39:08 2021 +0300 PCI: Add 'override_only' field to struct pci_device_id Add 'override_only' field to struct pci_device_id to be used as part of pci_match_device(). When set, a driver only matches the entry when dev->driver_override is set to that driver. In addition, add a helper macro named 'PCI_DEVICE_DRIVER_OVERRIDE' to enable setting some data on it. Next patch from this series will use the above functionality. Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-10-yishaih@nvidia.com Signed-off-by: Alex Williamson commit c61302aa48f7c46b5c9d893109488af951be12e4 Author: Yishai Hadas Date: Thu Aug 26 13:39:07 2021 +0300 vfio/pci: Move module parameters to vfio_pci.c This is a preparation before splitting vfio_pci.ko to 2 modules. As module parameters are a kind of uAPI they need to stay on vfio_pci.ko to avoid a user visible impact. For now continue to keep the implementation of these options in vfio_pci_core.c. Arguably they are vfio_pci functionality, but further splitting of vfio_pci_core.c will be better done in another series Signed-off-by: Yishai Hadas Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20210826103912.128972-9-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 2fb89f56a624fd74e6e15154f3e9fdceca98b784 Author: Max Gurtovoy Date: Thu Aug 26 13:39:06 2021 +0300 vfio/pci: Move igd initialization to vfio_pci.c igd is related to the vfio_pci pci_driver implementation, move it out of vfio_pci_core.c. This is preparation for splitting vfio_pci.ko into 2 drivers. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-8-yishaih@nvidia.com Signed-off-by: Alex Williamson commit ff53edf6d6ab0970f86595b3f5d179df51848723 Author: Max Gurtovoy Date: Thu Aug 26 13:39:05 2021 +0300 vfio/pci: Split the pci_driver code out of vfio_pci_core.c Split the vfio_pci driver into two logical parts, the 'struct pci_driver' (vfio_pci.c) which implements "Generic VFIO support for any PCI device" and a library of code (vfio_pci_core.c) that helps implementing a struct vfio_device on top of a PCI device. vfio_pci.ko continues to present the same interface under sysfs and this change should have no functional impact. Following patches will turn vfio_pci and vfio_pci_core into a separate module. This is a preparation for allowing another module to provide the pci_driver and allow that module to customize how VFIO is setup, inject its own operations, and easily extend vendor specific functionality. At this point the vfio_pci_core still contains a lot of vfio_pci functionality mixed into it. Following patches will move more of the large scale items out, but another cleanup series will be needed to get everything. Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-7-yishaih@nvidia.com Signed-off-by: Alex Williamson commit c39f8fa76cdd0c96f82fa785a0d6c92afe8f4a77 Author: Max Gurtovoy Date: Thu Aug 26 13:39:04 2021 +0300 vfio/pci: Include vfio header in vfio_pci_core.h The vfio_device structure is embedded into the vfio_pci_core_device structure, so there is no reason for not including the header file in the vfio_pci_core header as well. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-6-yishaih@nvidia.com Signed-off-by: Alex Williamson commit bf9fdc9a74cf61fe9f646c43eac4823481f1e20a Author: Max Gurtovoy Date: Thu Aug 26 13:39:03 2021 +0300 vfio/pci: Rename ops functions to fit core namings This is another preparation patch for separating the vfio_pci driver to a subsystem driver and a generic pci driver. This patch doesn't change any logic. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-5-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 536475109c82841126ca341ef0f138e7298880c1 Author: Max Gurtovoy Date: Thu Aug 26 13:39:02 2021 +0300 vfio/pci: Rename vfio_pci_device to vfio_pci_core_device This is a preparation patch for separating the vfio_pci driver to a subsystem driver and a generic pci driver. This patch doesn't change any logic. The new vfio_pci_core_device structure will be the main structure of the core driver and later on vfio_pci_device structure will be the main structure of the generic vfio_pci driver. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-4-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 9a389938695a068a3149c2d21a16c34b63ca002f Author: Max Gurtovoy Date: Thu Aug 26 13:39:01 2021 +0300 vfio/pci: Rename vfio_pci_private.h to vfio_pci_core.h This is a preparation patch for separating the vfio_pci driver to a subsystem driver and a generic pci driver. This patch doesn't change any logic. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-3-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 1cbd70fe37870b938463fd0a4a07e45fc4a3db3c Author: Max Gurtovoy Date: Thu Aug 26 13:39:00 2021 +0300 vfio/pci: Rename vfio_pci.c to vfio_pci_core.c This is a preparation patch for separating the vfio_pci driver to a subsystem driver and a generic pci driver. This patch doesn't change any logic. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20210826103912.128972-2-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 127c92feb74a6721f62587f1b89128808f049cf1 Merge: f80e21489590c f196ae282070d Author: Thomas Gleixner Date: Thu Aug 26 18:20:50 2021 +0200 Merge tag 'timers-v5.15' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull timer driver updates from Daniel Lezcano: - Prioritize the ARM architected timer on Exynos platform when the architecture is ARM64 (Will Deacon) - Mark the Exynos timer as a per CPU timer (Will Deacon) - DT conversion to yaml for the rockchip platform (Ezequiel Garcia) - Fix IRQ setup if there are two channels on the sh_cmt timer (Phong Hoang) - Use bitfield helper macros in the Ingenic timer (Zhou Yanjie) - Clear any pending interrupt to prevent an abort of the suspend on the Mediatek platform (Fengquan Chen) - Add DT bindings for new Ingenic SoCs (Zhou Yanjie) Link: https://lore.kernel.org/r/c14ad27a-b1c6-6043-0f5e-71dd984bb4ba@linaro.org commit 03b8df8d43ecc3c5724e6bfb80bc0b9ea2aa2612 Author: Darrick J. Wong Date: Sat Aug 21 19:24:53 2021 -0700 iomap: standardize tracepoint formatting and storage Print all the offset, pos, and length quantities in hexadecimal. While we're at it, update the types of the tracepoint structure fields to match the types of the values being recorded in them. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner commit 46d4703b1db4c86ab5acb2331b10df999f005e8e Author: Xiao Ni Date: Wed Aug 18 13:57:48 2021 +0800 md/raid10: Remove unnecessary rcu_dereference in raid10_handle_discard We are seeing the following warning in raid10_handle_discard. [ 695.110751] ============================= [ 695.131439] WARNING: suspicious RCU usage [ 695.151389] 4.18.0-319.el8.x86_64+debug #1 Not tainted [ 695.174413] ----------------------------- [ 695.192603] drivers/md/raid10.c:1776 suspicious rcu_dereference_check() usage! [ 695.225107] other info that might help us debug this: [ 695.260940] rcu_scheduler_active = 2, debug_locks = 1 [ 695.290157] no locks held by mkfs.xfs/10186. In the first loop of function raid10_handle_discard. It already determines which disk need to handle discard request and add the rdev reference count rdev->nr_pending. So the conf->mirrors will not change until all bios come back from underlayer disks. It doesn't need to use rcu_dereference to get rdev. Cc: stable@vger.kernel.org Fixes: d30588b2731f ('md/raid10: improve raid10 discard request') Signed-off-by: Xiao Ni Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit 2eaf1635f9d62a2774c1c8114db24456dfd00721 Author: Takashi Iwai Date: Thu Aug 26 17:47:52 2021 +0200 ALSA: hda: Disable runtime resume at shutdown Although we modified the codec shutdown callback to perform runtime-suspend, it's still not fully effective, as this may be resumed again at any time later. For fixing such an unwanted resume, this patch replaces pm_runtime_suspend() with pm_runtime_force_suspend(), and call pm_runtime_disable() afterward. It assures to keep the device suspended. Also for code simplification, we apply the code unconditionally; when it's been already suspended, nothing would happen by calls of snd_pcm_suspend_all() and pm_runtime_force_suspend(), just proceed to pm_runtime_disable(). Fixes: b98444ed597d ("ALSA: hda: Suspend codec at shutdown") Reported-and-tested-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210826154752.25674-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 307d522f5eb86cd6ac8c905f5b0577dedac54ec5 Author: Eric W. Biederman Date: Wed Jun 23 16:44:32 2021 -0500 signal/seccomp: Refactor seccomp signal and coredump generation Factor out force_sig_seccomp from the seccomp signal generation and place it in kernel/signal.c. The function force_sig_seccomp takes a parameter force_coredump to indicate that the sigaction field should be reset to SIGDFL so that a coredump will be generated when the signal is delivered. force_sig_seccomp is then used to replace both seccomp_send_sigsys and seccomp_init_siginfo. force_sig_info_to_task gains an extra parameter to force using the default signal action. With this change seccomp is no longer a special case and there becomes exactly one place do_coredump is called from. Further it no longer becomes necessary for __seccomp_filter to call do_group_exit. Acked-by: Kees Cook Link: https://lkml.kernel.org/r/87r1gr6qc4.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit 1a0182785a6d2f9e626b861406bdd587642b218e Author: Xinhao Liu Date: Thu Aug 26 21:37:36 2021 +0800 RDMA/hns: Delete unnecessary blank lines. Just delete unnecessary blank lines. Link: https://lore.kernel.org/r/1629985056-57004-8-git-send-email-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit ae2854c5d318c8415e2f033b29fcfcb81a9e9aa7 Author: Yixing Liu Date: Thu Aug 26 21:37:35 2021 +0800 RDMA/hns: Encapsulate the qp db as a function Encapsulate qp db into two functions: user and kernel. Link: https://lore.kernel.org/r/1629985056-57004-7-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 7fac71691b61777d938226d06e5034746d482ef3 Author: Wenpeng Liang Date: Thu Aug 26 21:37:34 2021 +0800 RDMA/hns: Adjust the order in which irq are requested and enabled It should first alloc workqueue and request irq, and finally enable irq. Link: https://lore.kernel.org/r/1629985056-57004-6-git-send-email-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit ab5cbb9d287ce72bd4bd6efea112f87ca34caa44 Author: Weihang Li Date: Thu Aug 26 21:37:33 2021 +0800 RDMA/hns: Remove RST2RST error prints for hw v1 There is no need to prints error for hw_v1. Link: https://lore.kernel.org/r/1629985056-57004-5-git-send-email-liangwenpeng@huawei.com Signed-off-by: Weihang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit fe164fc8d7b246987c54841e0d4e929a72d837e8 Author: Wenpeng Liang Date: Thu Aug 26 21:37:32 2021 +0800 RDMA/hns: Remove dqpn filling when modify qp from Init to Init According to the IB specification, the destination qpn is allowed to be filled into the qpc only when the qp transitions from Init to RTR, so this code is unused. Link: https://lore.kernel.org/r/1629985056-57004-4-git-send-email-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit d2e0ccffcdd7209fc9881c8970d2a7e28dcb43b9 Author: Wenpeng Liang Date: Thu Aug 26 21:37:31 2021 +0800 RDMA/hns: Fix QP's resp incomplete assignment The resp passed to the user space represents the enable flag of qp, incomplete assignment will cause some features of the user space to be disabled. Fixes: 90ae0b57e4a5 ("RDMA/hns: Combine enable flags of qp") Fixes: aba457ca890c ("RDMA/hns: Support owner mode doorbell") Link: https://lore.kernel.org/r/1629985056-57004-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit e788a3cd5787aca74e0ee00202d4dca64b43f043 Author: Wenpeng Liang Date: Thu Aug 26 21:37:30 2021 +0800 RDMA/hns: Fix query destination qpn The bit width of dqpn is 24 bits, using u8 will cause truncation error. Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Link: https://lore.kernel.org/r/1629985056-57004-2-git-send-email-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit a3616a3c02722d1edb95acc7fceade242f6553ba Author: Eric W. Biederman Date: Mon Jul 26 14:23:11 2021 -0500 signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die In the fpsp040 code when copyin or copyout fails call force_sigsegv(SIGSEGV) instead of do_exit(SIGSEGV). This solves a couple of problems. Because do_exit embeds the ptrace stop PTRACE_EVENT_EXIT a complete stack frame needs to be present for that to work correctly. There is always the information needed for a ptrace stop where get_signal is called. So exiting with a signal solves the ptrace issue. Further exiting with a signal ensures that all of the threads in a process are killed not just the thread that malfunctioned. Which avoids confusing userspace. To make force_sigsegv(SIGSEGV) work in fpsp040_die modify the code to save all of the registers and jump to ret_from_exception (which ultimately calls get_signal) after fpsp040_die returns. v2: Updated the branches to use gas's pseudo ops that automatically calculate the best branch instruction to use for the purpose. v1: https://lkml.kernel.org/r/87a6m8kgtx.fsf_-_@disp2133 Link: https://lkml.kernel.org/r/87tukghjfs.fsf_-_@disp2133 Acked-by: Geert Uytterhoeven Signed-off-by: "Eric W. Biederman" commit 57dbbe590f152e5e8a3ff8bf5ba163df34eeae0b Author: Leonardo Bras Date: Tue Aug 17 03:39:29 2021 -0300 powerpc/pseries/iommu: Rename "direct window" to "dma window" A previous change introduced the usage of DDW as a bigger indirect DMA mapping when the DDW available size does not map the whole partition. As most of the code that manipulates direct mappings was reused for indirect mappings, it's necessary to rename all names and debug/info messages to reflect that it can be used for both kinds of mapping. This should cause no behavioural change, just adjust naming. Signed-off-by: Leonardo Bras Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-12-leobras.c@gmail.com commit 381ceda88c4c4c8345cad1cffa6328892f15dca6 Author: Leonardo Bras Date: Tue Aug 17 03:39:28 2021 -0300 powerpc/pseries/iommu: Make use of DDW for indirect mapping So far it's assumed possible to map the guest RAM 1:1 to the bus, which works with a small number of devices. SRIOV changes it as the user can configure hundreds VFs and since phyp preallocates TCEs and does not allow IOMMU pages bigger than 64K, it has to limit the number of TCEs per a PE to limit waste of physical pages. As of today, if the assumed direct mapping is not possible, DDW creation is skipped and the default DMA window "ibm,dma-window" is used instead. By using DDW, indirect mapping can get more TCEs than available for the default DMA window, and also get access to using much larger pagesizes (16MB as implemented in qemu vs 4k from default DMA window), causing a significant increase on the maximum amount of memory that can be IOMMU mapped at the same time. Indirect mapping will only be used if direct mapping is not a possibility. For indirect mapping, it's necessary to re-create the iommu_table with the new DMA window parameters, so iommu_alloc() can use it. Removing the default DMA window for using DDW with indirect mapping is only allowed if there is no current IOMMU memory allocated in the iommu_table. enable_ddw() is aborted otherwise. Even though there won't be both direct and indirect mappings at the same time, we can't reuse the DIRECT64_PROPNAME property name, or else an older kexec()ed kernel can assume direct mapping, and skip iommu_alloc(), causing undesirable behavior. So a new property name DMA64_PROPNAME "linux,dma64-ddr-window-info" was created to represent a DDW that does not allow direct mapping. Signed-off-by: Leonardo Bras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-11-leobras.c@gmail.com commit 8599395d34f2dd7b77bef42da1d99798e7a3d58f Author: Leonardo Bras Date: Tue Aug 17 03:39:27 2021 -0300 powerpc/pseries/iommu: Find existing DDW with given property name At the moment pseries stores information about created directly mapped DDW window in DIRECT64_PROPNAME. With the objective of implementing indirect DMA mapping with DDW, it's necessary to have another propriety name to make sure kexec'ing into older kernels does not break, as it would if we reuse DIRECT64_PROPNAME. In order to have this, find_existing_ddw_windows() needs to be able to look for different property names. Extract find_existing_ddw_windows() into find_existing_ddw_windows_named() and calls it with current property name. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-10-leobras.c@gmail.com commit a5fd95120c653962a9e75e260a35436b96d2c991 Author: Leonardo Bras Date: Tue Aug 17 03:39:26 2021 -0300 powerpc/pseries/iommu: Update remove_dma_window() to accept property name Update remove_dma_window() so it can be used to remove DDW with a given property name. This enables the creation of new property names for DDW, so we can have different usage for it, like indirect mapping. Also, add return values to it so we can check if the property was found while removing the active DDW. This allows skipping the remaining property names while reducing the impact of multiple property names. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-9-leobras.c@gmail.com commit fc8cba8f989fb98e496b33a78476861e246c42a0 Author: Leonardo Bras Date: Tue Aug 17 03:39:25 2021 -0300 powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper Add a new helper _iommu_table_setparms(), and use it in iommu_table_setparms() and iommu_table_setparms_lpar() to avoid duplicated code. Also, setting tbl->it_ops was happening outsite iommu_table_setparms*(), so move it to the new helper. Since we need the iommu_table_ops to be declared before used, declare iommu_table_lpar_multi_ops and iommu_table_pseries_ops to before their respective iommu_table_setparms*(). Signed-off-by: Leonardo Bras Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-8-leobras.c@gmail.com commit 7ed2ed2db2685a285cb09ab330dc4efea0b64022 Author: Leonardo Bras Date: Tue Aug 17 03:39:24 2021 -0300 powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw() Code used to create a ddw property that was previously scattered in enable_ddw() is now gathered in ddw_property_create(), which deals with allocation and filling the property, letting it ready for of_property_add(), which now occurs in sequence. This created an opportunity to reorganize the second part of enable_ddw(): Without this patch enable_ddw() does, in order: kzalloc() property & members, create_ddw(), fill ddwprop inside property, ddw_list_new_entry(), do tce_setrange_multi_pSeriesLP_walk in all memory, of_add_property(), and list_add(). With this patch enable_ddw() does, in order: create_ddw(), ddw_property_create(), of_add_property(), ddw_list_new_entry(), do tce_setrange_multi_pSeriesLP_walk in all memory, and list_add(). This change requires of_remove_property() in case anything fails after of_add_property(), but we get to do tce_setrange_multi_pSeriesLP_walk in all memory, which looks the most expensive operation, only if everything else succeeds. Also, the error path got remove_ddw() replaced by a new helper __remove_dma_window(), which only removes the new DDW with an rtas-call. For this, a new helper clean_dma_window() was needed to clean anything that could left if walk_system_ram_range() fails. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-7-leobras.c@gmail.com commit 2ca73c54ce24489518a56d816331b774044c2445 Author: Leonardo Bras Date: Tue Aug 17 03:39:23 2021 -0300 powerpc/pseries/iommu: Allow DDW windows starting at 0x00 enable_ddw() currently returns the address of the DMA window, which is considered invalid if has the value 0x00. Also, it only considers valid an address returned from find_existing_ddw if it's not 0x00. Changing this behavior makes sense, given the users of enable_ddw() only need to know if direct mapping is possible. It can also allow a DMA window starting at 0x00 to be used. This will be helpful for using a DDW with indirect mapping, as the window address will be different than 0x00, but it will not map the whole partition. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-6-leobras.c@gmail.com commit 92a23219299cedde52e3298788484f4875d5ce0f Author: Leonardo Bras Date: Tue Aug 17 03:39:22 2021 -0300 powerpc/pseries/iommu: Add ddw_list_new_entry() helper There are two functions creating direct_window_list entries in a similar way, so create a ddw_list_new_entry() to avoid duplicity and simplify those functions. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-5-leobras.c@gmail.com commit 4ff8677a0b192a58d998d1d34fc5168203041a24 Author: Leonardo Bras Date: Tue Aug 17 03:39:21 2021 -0300 powerpc/pseries/iommu: Add iommu_pseries_alloc_table() helper Creates a helper to allow allocating a new iommu_table without the need to reallocate the iommu_group. This will be helpful for replacing the iommu_table for the new DMA window, after we remove the old one with iommu_tce_table_put(). Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-4-leobras.c@gmail.com commit 3c33066a21903076722a2881556a92aa3cd7d359 Author: Leonardo Bras Date: Tue Aug 17 03:39:20 2021 -0300 powerpc/kernel/iommu: Add new iommu_table_in_use() helper Having a function to check if the iommu table has any allocation helps deciding if a tbl can be reset for using a new DMA window. It should be enough to replace all instances of !bitmap_empty(tbl...). iommu_table_in_use() skips reserved memory, so we don't need to worry about releasing it before testing. This causes iommu_table_release_pages() to become unnecessary, given it is only used to remove reserved memory for testing. Also, only allow storing reserved memory values in tbl if they are valid in the table, so there is no need to check it in the new helper. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-3-leobras.c@gmail.com commit 0c634bafe3bbee7a36dca7f1277057e05bf14d91 Author: Leonardo Bras Date: Tue Aug 17 03:39:19 2021 -0300 powerpc/pseries/iommu: Replace hard-coded page shift Some functions assume IOMMU page size can only be 4K (pageshift == 12). Update them to accept any page size passed, so we can use 64K pages. In the process, some defines like TCE_SHIFT were made obsolete, and then removed. IODA3 Revision 3.0_prd1 (OpenPowerFoundation), Figures 3.4 and 3.5 show a RPN of 52-bit, and considers a 12-bit pageshift, so there should be no need of using TCE_RPN_MASK, which masks out any bit after 40 in rpn. It's usage removed from tce_build_pSeries(), tce_build_pSeriesLP(), and tce_buildmulti_pSeriesLP(). Most places had a tbl struct, so using tbl->it_page_shift was simple. tce_free_pSeriesLP() was a special case, since callers not always have a tbl struct, so adding a tceshift parameter seems the right thing to do. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817063929.38701-2-leobras.c@gmail.com commit 9a245d0e1f006bc7ccf0285d0d520ed304d00c4a Author: Srikar Dronamraju Date: Thu Aug 26 15:35:20 2021 +0530 powerpc/numa: Update cpu_cpu_map on CPU online/offline cpu_cpu_map holds all the CPUs in the DIE. However in PowerPC, when onlining/offlining of CPUs, this mask doesn't get updated. This mask is however updated when CPUs are added/removed. So when both operations like online/offline of CPUs and adding/removing of CPUs are done simultaneously, then cpumaps end up broken. WARNING: CPU: 13 PID: 1142 at kernel/sched/topology.c:898 build_sched_domains+0xd48/0x1720 Modules linked in: rpadlpar_io rpaphp mptcp_diag xsk_diag tcp_diag udp_diag raw_diag inet_diag unix_diag af_packet_diag netlink_diag bonding tls nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables nfnetlink pseries_rng xts vmx_crypto uio_pdrv_genirq uio binfmt_misc ip_tables xfs libcrc32c dm_service_time sd_mod t10_pi sg ibmvfc scsi_transport_fc ibmveth dm_multipath dm_mirror dm_region_hash dm_log dm_mod fuse CPU: 13 PID: 1142 Comm: kworker/13:2 Not tainted 5.13.0-rc6+ #28 Workqueue: events cpuset_hotplug_workfn NIP: c0000000001caac8 LR: c0000000001caac4 CTR: 00000000007088ec REGS: c00000005596f220 TRAP: 0700 Not tainted (5.13.0-rc6+) MSR: 8000000000029033 CR: 48828222 XER: 00000009 CFAR: c0000000001ea698 IRQMASK: 0 GPR00: c0000000001caac4 c00000005596f4c0 c000000001c4a400 0000000000000036 GPR04: 00000000fffdffff c00000005596f1d0 0000000000000027 c0000018cfd07f90 GPR08: 0000000000000023 0000000000000001 0000000000000027 c0000018fe68ffe8 GPR12: 0000000000008000 c00000001e9d1880 c00000013a047200 0000000000000800 GPR16: c000000001d3c7d0 0000000000000240 0000000000000048 c000000010aacd18 GPR20: 0000000000000001 c000000010aacc18 c00000013a047c00 c000000139ec2400 GPR24: 0000000000000280 c000000139ec2520 c000000136c1b400 c000000001c93060 GPR28: c00000013a047c20 c000000001d3c6c0 c000000001c978a0 000000000000000d NIP [c0000000001caac8] build_sched_domains+0xd48/0x1720 LR [c0000000001caac4] build_sched_domains+0xd44/0x1720 Call Trace: [c00000005596f4c0] [c0000000001caac4] build_sched_domains+0xd44/0x1720 (unreliable) [c00000005596f670] [c0000000001cc5ec] partition_sched_domains_locked+0x3ac/0x4b0 [c00000005596f710] [c0000000002804e4] rebuild_sched_domains_locked+0x404/0x9e0 [c00000005596f810] [c000000000283e60] rebuild_sched_domains+0x40/0x70 [c00000005596f840] [c000000000284124] cpuset_hotplug_workfn+0x294/0xf10 [c00000005596fc60] [c000000000175040] process_one_work+0x290/0x590 [c00000005596fd00] [c0000000001753c8] worker_thread+0x88/0x620 [c00000005596fda0] [c000000000181704] kthread+0x194/0x1a0 [c00000005596fe10] [c00000000000ccec] ret_from_kernel_thread+0x5c/0x70 Instruction dump: 485af049 60000000 2fa30800 409e0028 80fe0000 e89a00f8 e86100e8 38da0120 7f88e378 7ce53b78 4801fb91 60000000 <0fe00000> 39000000 38e00000 38c00000 Fix this by updating cpu_cpu_map aka cpumask_of_node() on every CPU online/offline. Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100521.412639-5-srikar@linux.vnet.ibm.com commit 544a09ee7434b949552266d20ece538d35535bd5 Author: Srikar Dronamraju Date: Thu Aug 26 15:35:19 2021 +0530 powerpc/numa: Print debug statements only when required Currently, a debug message gets printed every time an attempt to add(remove) a CPU. However this is redundant if the CPU is already added (removed) from the node. Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100521.412639-4-srikar@linux.vnet.ibm.com commit 506c2075ffd8db352c53201ef166948a272e3bce Author: Srikar Dronamraju Date: Thu Aug 26 15:35:18 2021 +0530 powerpc/numa: convert printk to pr_xxx Convert the remaining printk to pr_xxx One advantage would be all prints will now have prefix "numa:" from pr_fmt(). [ convert printk(KERN_ERR) to pr_warn : Suggested by Laurent Dufour ] Suggested-by: Michael Ellerman Signed-off-by: Srikar Dronamraju [mpe: Rebase onto powerpc/next, s/WARNING/Warning/] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100521.412639-3-srikar@linux.vnet.ibm.com commit 544af6429777cefae2f8af9a9866df5e8cb21763 Author: Srikar Dronamraju Date: Thu Aug 26 15:35:17 2021 +0530 powerpc/numa: Drop dbg in favour of pr_debug powerpc supported numa=debug which is not documented. This option was used to print early debug output. However something more flexible can be achieved by using CONFIG_DYNAMIC_DEBUG. Hence drop dbg (and numa=debug) in favour of pr_debug Suggested-by: Michael Ellerman Signed-off-by: Srikar Dronamraju [mpe: Rebase on to powerpc/next form2 affinity changes] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100521.412639-2-srikar@linux.vnet.ibm.com commit 5bf63497b8ddf53d8973f68076119e482639b2bb Author: Srikar Dronamraju Date: Thu Aug 26 15:34:01 2021 +0530 powerpc/smp: Enable CACHE domain for shared processor Currently CACHE domain is not enabled on shared processor mode PowerVM LPARS. On PowerVM systems, 'ibm,thread-group' device-tree property 2 under cpu-device-node indicates which all CPUs share L2-cache. However 'ibm,thread-group' device-tree property 2 is a relatively new property. In absence of 'ibm,thread-group' property 2, 'l2-cache' device property under cpu-device-node could help system to identify CPUs sharing L2-cache. However this property is not exposed by PhyP in shared processor mode configurations. In absence of properties that inform OS about which CPUs share L2-cache, fallback on core boundary. Here are some stats from Power9 shared LPAR with the changes. $ lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Thread(s) per core: 8 Core(s) per socket: 1 Socket(s): 3 NUMA node(s): 2 Model: 2.2 (pvr 004e 0202) Model name: POWER9 (architected), altivec supported Hypervisor vendor: pHyp Virtualization type: para L1d cache: 32K L1i cache: 32K NUMA node0 CPU(s): 16-23 NUMA node1 CPU(s): 0-15,24-31 Physical sockets: 2 Physical chips: 1 Physical cores/chip: 10 Before patch $ grep -r . /sys/kernel/debug/sched/domains/cpu0/domain*/name Before /sys/kernel/debug/sched/domains/cpu0/domain0/name:SMT /sys/kernel/debug/sched/domains/cpu0/domain1/name:DIE /sys/kernel/debug/sched/domains/cpu0/domain2/name:NUMA After /sys/kernel/debug/sched/domains/cpu0/domain0/name:SMT /sys/kernel/debug/sched/domains/cpu0/domain1/name:CACHE /sys/kernel/debug/sched/domains/cpu0/domain2/name:DIE /sys/kernel/debug/sched/domains/cpu0/domain3/name:NUMA $ awk '/domain/{print $1, $2}' /proc/schedstat | sort -u | sed -e 's/00000000,//g' Before domain0 00000055 domain0 000000aa domain0 00005500 domain0 0000aa00 domain0 00550000 domain0 00aa0000 domain0 55000000 domain0 aa000000 domain1 00ff0000 domain1 ff00ffff domain2 ffffffff After domain0 00000055 domain0 000000aa domain0 00005500 domain0 0000aa00 domain0 00550000 domain0 00aa0000 domain0 55000000 domain0 aa000000 domain1 000000ff domain1 0000ff00 domain1 00ff0000 domain1 ff000000 domain2 ff00ffff domain2 ffffffff domain3 ffffffff (Lower is better) perf stat -a -r 5 -n perf bench sched pipe | tail -n 2 Before 153.798 +- 0.142 seconds time elapsed ( +- 0.09% ) After 111.545 +- 0.652 seconds time elapsed ( +- 0.58% ) which is an improvement of 27.47% Signed-off-by: Srikar Dronamraju Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100401.412519-4-srikar@linux.vnet.ibm.com commit b8b928030332a0ca16d42433eb2c3085600d8704 Author: Srikar Dronamraju Date: Thu Aug 26 15:34:00 2021 +0530 powerpc/smp: Update cpu_core_map on all PowerPc systems lscpu() uses core_siblings to list the number of sockets in the system. core_siblings is set using topology_core_cpumask. While optimizing the powerpc bootup path, Commit 4ca234a9cbd7 ("powerpc/smp: Stop updating cpu_core_mask"). it was found that updating cpu_core_mask() ended up taking a lot of time. It was thought that on Powerpc, cpu_core_mask() would always be same as cpu_cpu_mask() i.e number of sockets will always be equal to number of nodes. As an optimization, cpu_core_mask() was made a snapshot of cpu_cpu_mask(). However that was found to be false with PowerPc KVM guests, where each node could have more than one socket. So with Commit c47f892d7aa6 ("powerpc/smp: Reintroduce cpu_core_mask"), cpu_core_mask was updated based on chip_id but in an optimized way using some mask manipulations and chip_id caching. However on non-PowerNV and non-pseries KVM guests (i.e not implementing cpu_to_chip_id(), continued to use a copy of cpu_cpu_mask(). There are two issues that were noticed on such systems 1. lscpu would report one extra socket. On a IBM,9009-42A (aka zz system) which has only 2 chips/ sockets/ nodes, lscpu would report Architecture: ppc64le Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Thread(s) per core: 8 Core(s) per socket: 6 Socket(s): 3 <-------------- NUMA node(s): 2 Model: 2.2 (pvr 004e 0202) Model name: POWER9 (architected), altivec supported Hypervisor vendor: pHyp Virtualization type: para L1d cache: 32K L1i cache: 32K L2 cache: 512K L3 cache: 10240K NUMA node0 CPU(s): 0-79 NUMA node1 CPU(s): 80-159 2. Currently cpu_cpu_mask is updated when a core is added/removed. However its not updated when smt mode switching or on CPUs are explicitly offlined. However all other percpu masks are updated to ensure only active/online CPUs are in the masks. This results in build_sched_domain traces since there will be CPUs in cpu_cpu_mask() but those CPUs are not present in SMT / CACHE / MC / NUMA domains. A loop of threads running smt mode switching and core add/remove will soon show this trace. Hence cpu_cpu_mask has to be update at smt mode switch. This will have impact on cpu_core_mask(). cpu_core_mask() is a snapshot of cpu_cpu_mask. Different CPUs within the same socket will end up having different cpu_core_masks since they are snapshots at different points of time. This means when lscpu will start reporting many more sockets than the actual number of sockets/ nodes / chips. Different ways to handle this problem: A. Update the snapshot aka cpu_core_mask for all CPUs whenever cpu_cpu_mask is updated. This would a non-optimal solution. B. Instead of a cpumask_var_t, make cpu_core_map a cpumask pointer pointing to cpu_cpu_mask. However percpu cpumask pointer is frowned upon and we need a clean way to handle PowerPc KVM guest which is not a snapshot. C. Update cpu_core_masks all PowerPc systems like in PowerPc KVM guests using mask manipulations. This approach is relatively simple and unifies with the existing code. D. On top of 3, we could also resurrect get_physical_package_id which could return a nid for the said CPU. However this is not needed at this time. Option C is the preferred approach for now. While this is somewhat a revert of Commit 4ca234a9cbd7 ("powerpc/smp: Stop updating cpu_core_mask"). 1. Plain revert has some conflicts 2. For chip_id == -1, the cpu_core_mask is made identical to cpu_cpu_mask, unlike previously where cpu_core_mask was set to a core if chip_id doesn't exist. This goes by the principle that if chip_id is not exposed, then sockets / chip / node share the same set of CPUs. With the fix, lscpu o/p would be Architecture: ppc64le Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Thread(s) per core: 8 Core(s) per socket: 6 Socket(s): 2 <-------------- NUMA node(s): 2 Model: 2.2 (pvr 004e 0202) Model name: POWER9 (architected), altivec supported Hypervisor vendor: pHyp Virtualization type: para L1d cache: 32K L1i cache: 32K L2 cache: 512K L3 cache: 10240K NUMA node0 CPU(s): 0-79 NUMA node1 CPU(s): 80-159 Fixes: 4ca234a9cbd7 ("powerpc/smp: Stop updating cpu_core_mask") Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100401.412519-3-srikar@linux.vnet.ibm.com commit 8efd249babea2fec268cff90b9f5ca723dbb7499 Author: Srikar Dronamraju Date: Thu Aug 26 15:33:59 2021 +0530 powerpc/smp: Fix a crash while booting kvm guest with nr_cpus=2 Aneesh reported a crash with a fairly recent upstream kernel when booting kernel whose commandline was appended with nr_cpus=2 1:mon> e cpu 0x1: Vector: 300 (Data Access) at [c000000008a67bd0] pc: c00000000002557c: cpu_to_chip_id+0x3c/0x100 lr: c000000000058380: start_secondary+0x460/0xb00 sp: c000000008a67e70 msr: 8000000000001033 dar: 10 dsisr: 80000 current = 0xc00000000891bb00 paca = 0xc0000018ff981f80 irqmask: 0x03 irq_happened: 0x01 pid = 0, comm = swapper/1 Linux version 5.13.0-rc3-15704-ga050a6d2b7e8 (kvaneesh@ltc-boston8) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #433 SMP Tue May 25 02:38:49 CDT 2021 1:mon> t [link register ] c000000000058380 start_secondary+0x460/0xb00 [c000000008a67e70] c000000008a67eb0 (unreliable) [c000000008a67eb0] c0000000000589d4 start_secondary+0xab4/0xb00 [c000000008a67f90] c00000000000c654 start_secondary_prolog+0x10/0x14 Current code assumes that num_possible_cpus() is always greater than threads_per_core. However this may not be true when using nr_cpus=2 or similar options. Handle the case where num_possible_cpus() is not an exact multiple of threads_per_core. Fixes: c1e53367dab1 ("powerpc/smp: Cache CPU to chip lookup") Reported-by: Aneesh Kumar K.V Signed-off-by: Srikar Dronamraju Debugged-by: Michael Ellerman Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826100401.412519-2-srikar@linux.vnet.ibm.com commit 3e18e271182206c996a3a7efbbe70c66307ef137 Author: Joel Stanley Date: Thu Aug 26 21:56:53 2021 +0930 powerpc/configs/microwatt: Enable options for systemd When booting with systemd these options are required. This increases the image by about 50KB, or 2%. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826122653.3236867-4-joel@jms.id.au commit ef4fcaf99cd27eb48790f2adc4eff456dbe1dec4 Author: Joel Stanley Date: Thu Aug 26 21:56:52 2021 +0930 powerpc/configs/microwattt: Enable Liteeth Liteeth is the network device used by Microwatt. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826122653.3236867-3-joel@jms.id.au commit 602d0f96563c2e0b8e1ddb22ac46bf7f58480d64 Author: Joel Stanley Date: Thu Aug 26 21:56:51 2021 +0930 powerpc/microwatt: Add Ethernet to device tree The liteeth network device is used in the Microwatt soc. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210826122653.3236867-2-joel@jms.id.au commit 8149238ffd210875f5a77e3c654bb59b58da35e3 Author: Christophe Leroy Date: Wed Aug 25 13:34:45 2021 +0000 powerpc: Redefine HMT_xxx macros as empty on PPC32 HMT_xxx macros are macros for adjusting thread priority (hardware multi-threading) are macros inherited from PPC64 via commit 5f7c690728ac ("[PATCH] powerpc: Merged ppc_asm.h") Those instructions are pointless on PPC32, but some common fonctions like arch_cpu_idle() use them. So make them empty on PPC32 to avoid those instructions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c5a07fadea33d640ad10cecf0ac8faaec1c524e0.1629898474.git.christophe.leroy@csgroup.eu commit f50da6edbf1ebf35dd8070847bfab5cb988d472b Author: Aneesh Kumar K.V Date: Wed Aug 25 09:54:47 2021 +0530 powerpc/doc: Fix htmldocs errors Fix make htmldocs related errors with the newly added associativity.rst doc file. Reported-by: Stephen Rothwell Tested-by: Stephen Rothwell # build test Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210825042447.106219-1-aneesh.kumar@linux.ibm.com commit 627e66f29aa28f267395aab0dabc1c757d84aead Merge: 465e333e77a69 5bd4ae07e7970 Author: Michael Ellerman Date: Fri Aug 27 00:49:06 2021 +1000 Merge changes from Paul Gortmaker Merge the changes to retire the legacy WR sbc8548 and sbc8641 platforms from Paul. These were sent as a pull request, but I rebased them onto rc2 so as not to pull too many unrelated changes in to my next. Description from Paul's pull request follows: In v2.6.27 (2008, 917f0af9e5a9) the sbc8260 support was implicitly retired by not being carried forward through the ppc --> powerpc device tree transition. Then, in v3.6 (2012, b048b4e17cbb) we retired the support for the sbc8560 boards. Next, in v4.18 (2017, 3bc6cf5a86e5) we retired the support for the 2006 vintage sbc834x boards. The sbc8548 and sbc8641d boards were maybe 1-2 years newer than the sbc834x boards, but it is also 3+ years later, so it makes sense to now retire them as well - which is what is done here. These two remaining WR boards were based on the Freescale MPC8548-CDS and the MPC8641D-HPCN reference board implementations. Having had the chance to use these and many other Fsl ref boards, I know this: The Freescale reference boards were typically produced in limited quantity and primarily available to BSP developers and hardware designers, and not likely to have found a 2nd life with hobbyists and/or collectors. It was good to have that BSP code subjected to mainline review and hence also widely available back in the day. But given the above, we should probably also be giving serious consideration to retiring additional similar age/type reference board platforms as well. I've always felt it is important for us to be proactive in retiring old code, since it has a genuine non-zero carrying cost, as described in the 930d52c012b8 merge log. But for the here and now, we just clean up the remaining BSP code that I had added for SBC platforms. Link: https://lore.kernel.org/r/20210824174209.GB160508@windriver.com commit 5bd4ae07e7970d73e3372910e60bb38623ac3064 Author: Paul Gortmaker Date: Thu Jan 7 14:18:59 2021 -0500 MAINTAINERS: update for Paul Gortmaker Signed-off-by: Paul Gortmaker Signed-off-by: Michael Ellerman commit d7c1814f2f4f812d7a39447f975abdc095dbf7aa Author: Paul Gortmaker Date: Thu Jan 7 13:45:32 2021 -0500 powerpc: retire sbc8641d board support The support was for this was added to mainline over 12 years ago, in v2.6.26 [4e8aae89a35d] just around the ppc --> powerpc migration. I believe the board was introduced shortly after the sbc8548 board, making it roughly a 14 year old platform - with the CPU speed and memory size typical for that era. I haven't had one of these boards for several years, and availability was discontinued several years before that. Given that, there is no point in adding a burden to testing coverage that builds all possible defconfigs, so it makes sense to remove it. Of course it will remain in the git history forever, for anyone who happens to find a functional board and wants to tinker with it. Acked-by: Scott Wood Signed-off-by: Paul Gortmaker Signed-off-by: Michael Ellerman commit c12adb0678446b3284a6135dc5fa7aa3b6a968a5 Author: Paul Gortmaker Date: Thu Jan 7 08:40:38 2021 -0500 powerpc: retire sbc8548 board support The support was for this was mainlined 13 years ago, in v2.6.25 [0e0fffe88767] just around the ppc --> powerpc migration. I believe the board was introduced a year or two before that, so it is roughly a 15 year old platform - with the CPU speed and memory size that was typical for that era. I haven't had one of these boards for several years, and availability was discontinued several years before that. Given that, there is no point in adding a burden to testing coverage that builds all possible defconfigs, so it makes sense to remove it. Of course it will remain in the git history forever, for anyone who happens to find a functional board and wants to tinker with it. Acked-by: Scott Wood Signed-off-by: Paul Gortmaker Signed-off-by: Michael Ellerman commit 6e9c846aa0c53673c5d53925a6122aa0e53a9795 Merge: d5f78f50fff3c 26cfc0dbe43aa Author: Mark Brown Date: Thu Aug 26 15:09:52 2021 +0100 Merge remote-tracking branch 'spi/for-5.15' into spi-next commit d5f78f50fff3c69915bde28be901b8da56da7e06 Merge: e22ce8eb631bd ea4ab99cb58cc Author: Mark Brown Date: Thu Aug 26 15:09:50 2021 +0100 Merge remote-tracking branch 'spi/for-5.14' into spi-linus commit 0487d4fc42d7f31a56cfd9e2237f9ebd889e6112 Author: Hans de Goede Date: Thu Aug 26 16:08:22 2021 +0200 platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from run_smbios_call As pointed out be Kees Cook if we return -EIO because the obj->type != ACPI_TYPE_BUFFER, then we must kfree the output buffer before the return. Fixes: 1a258e670434 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver") Reported-by: Kees Cook Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210826140822.71198-1-hdegoede@redhat.com commit 515b436be291ff197c52198282bbb19e79c9d197 Merge: dac825b6a6bdc 917f07719b133 Author: Mark Brown Date: Thu Aug 26 15:08:30 2021 +0100 Merge series "Patches to update for rockchip i2s" from Sugar Zhang : These patches fixup or update for rockchip i2s. Changes in v3: - Drop property 'rockchip,playback-only', 'rockchip,capture-only'. Implement it by 'dma-names' of DT instead. Changes in v2: - split property trcm into single 'trcm-sync-tx-only' and 'trcm-sync-rx-only' suggested by Nicolas. - split property trcm into single 'trcm-sync-tx-only' and 'trcm-sync-rx-only' suggested by Nicolas. - drop change-id Sugar Zhang (12): ASoC: rockchip: i2s: Add support for set bclk ratio ASoC: rockchip: i2s: Fixup clk div error ASoC: rockchip: i2s: Improve dma data transfer efficiency ASoC: rockchip: i2s: Fix regmap_ops hang ASoC: rockchip: i2s: Fix concurrency between tx/rx ASoC: rockchip: i2s: Reset the controller if soft reset failed ASoC: dt-bindings: rockchip: Document reset property for i2s ASoC: rockchip: i2s: Make playback/capture optional ASoC: rockchip: i2s: Add compatible for more SoCs ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs ASoC: rockchip: i2s: Add support for frame inversion ASoC: dt-bindings: rockchip: i2s: Document property TRCM Xiaotan Luo (1): ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B Xing Zheng (1): ASoC: rockchip: i2s: Add support for TRCM property .../devicetree/bindings/sound/rockchip-i2s.yaml | 19 ++ sound/soc/rockchip/rockchip_i2s.c | 278 +++++++++++++++------ sound/soc/rockchip/rockchip_i2s.h | 10 +- 3 files changed, 224 insertions(+), 83 deletions(-) -- 2.7.4 commit dac825b6a6bdca41347e25f07354ad94fdc97445 Merge: 11a08e05079a9 e79ef3c2cfe0b Author: Mark Brown Date: Thu Aug 26 15:08:28 2021 +0100 Merge series "Patches to update for rockchip spdif" from Sugar Zhang : These patches fixup or update for rockchip spdif. Sugar Zhang (4): ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile ASoC: rockchip: spdif: Fix some coding style ASoC: rockchip: spdif: Add support for rk3568 spdif ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif .../devicetree/bindings/sound/rockchip-spdif.yaml | 1 + sound/soc/rockchip/rockchip_spdif.c | 38 ++++++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) -- 2.7.4 commit fb49d9946f96081f9a05d8f305b3f40285afe4a9 Author: Kees Cook Date: Wed Aug 25 09:07:49 2021 -0700 platform/x86: dell-smbios-wmi: Avoid false-positive memcpy() warning In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Since all the size checking has already happened, use input.pointer (void *) so memcpy() doesn't get confused about how much is being written. Avoids this false-positive warning when run-time memcpy() strict bounds checking is enabled: memcpy: detected field-spanning write (size 4096) of single field (size 36) WARNING: CPU: 0 PID: 357 at drivers/platform/x86/dell/dell-smbios-wmi.c:74 run_smbios_call+0x110/0x1e0 [dell_smbios] Cc: Hans de Goede Cc: Mark Gross Cc: Mario Limonciello Cc: "Pali Rohár" Cc: Andy Shevchenko Cc: "Uwe Kleine-König" Cc: Dell.Client.Kernel@dell.com Cc: platform-driver-x86@vger.kernel.org Reported-by: Andy Lavr Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210825160749.3891090-1-keescook@chromium.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 55879dc4d095232609fe81498c1b43f042708eef Author: Dan Carpenter Date: Wed Aug 25 10:23:57 2021 +0300 platform/x86: ISST: use semi-colons instead of commas The code works the same either way, but it's better to use semi-colons to separate statements. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210825072357.GA12957@kili Signed-off-by: Hans de Goede commit 828857f6709f1b13582049a1ef84eadb07f50c05 Author: Jiapeng Chong Date: Wed Aug 25 18:37:02 2021 +0800 platform/x86: asus-wmi: Fix "unsigned 'retval' is never less than zero" smatch warning Eliminate the follow smatch warnings: drivers/platform/x86/asus-wmi.c:478 panel_od_write() warn: unsigned 'retval' is never less than zero. drivers/platform/x86/asus-wmi.c:566 panel_od_write() warn: unsigned 'retval' is never less than zero. drivers/platform/x86/asus-wmi.c:1451 panel_od_write() warn: unsigned 'retval' is never less than zero. Reported-by: Abaci Robot Fixes: 98829e84dc67 ("asus-wmi: Add dgpu disable method") Fixes: 382b91db8044 ("asus-wmi: Add egpu enable method") Fixes: ca91ea34778f ("asus-wmi: Add panel overdrive functionality") Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/1629887822-23918-1-git-send-email-jiapeng.chong@linux.alibaba.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b72067c64b226fc42fd5262cfbb675ec68fb4934 Author: Dan Carpenter Date: Tue Aug 24 14:36:54 2021 +0300 platform/x86: asus-wmi: Delete impossible condition The "asus->throttle_thermal_policy_mode" variable is a u8 so it can't be negative. And we always verify that the value is valid before setting the policy mode so there is no need to check again here. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210824113654.GA31143@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8ebcb6c94c712ee15679c8ee6a40598077b9a9af Author: Andy Shevchenko Date: Mon Aug 23 12:32:22 2021 +0300 platform/x86: hp_accel: Convert to be a platform driver ACPI core in conjunction with platform driver core provides an infrastructure to enumerate ACPI devices. Use it in order to remove a lot of boilerplate code. Signed-off-by: Andy Shevchenko Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20210823093222.19544-3-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 34570a898eef01b5311bfc9c448877eb717d3285 Author: Andy Shevchenko Date: Mon Aug 23 12:32:21 2021 +0300 platform/x86: hp_accel: Remove _INI method call According to ACPI specification the _INI method must be called when device is enumerated first time. After that there is no need to repeat the procedure. Convert the lis3lv02d_acpi_init() to be a stub (Note, we may not remove it because it is called unconditionally by the accelerometer main driver). Signed-off-by: Andy Shevchenko Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20210823093222.19544-2-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 917f07719b133093680ed57dd7b5bc30b6a5b45d Author: Sugar Zhang Date: Thu Aug 26 12:03:12 2021 +0800 ASoC: rockchip: i2s: Add support for frame inversion This patch adds support for frame inversion. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950594-14345-2-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit d5ceed036f7cde29bf17173e9a9c8bbde0a70389 Author: Sugar Zhang Date: Thu Aug 26 12:03:11 2021 +0800 ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs This patch adds compatible strings for more SoCs. Signed-off-by: Sugar Zhang Acked-by: Rob Herring Link: https://lore.kernel.org/r/1629950594-14345-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit f005dc6db136a477166dd86e983351fec9129cce Author: Sugar Zhang Date: Thu Aug 26 12:02:38 2021 +0800 ASoC: rockchip: i2s: Add compatible for more SoCs This patch adds more compatible strings for SoCs. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950562-14281-5-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 4455f26a551c86e31c7d27495903a11c3d660034 Author: Sugar Zhang Date: Thu Aug 26 12:02:37 2021 +0800 ASoC: rockchip: i2s: Make playback/capture optional There are some controllers which support playback only or capture only. so, make it optional. and initial capability by 'dma-names' of DT. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950562-14281-4-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 1bf56843e664eef2525bdbfae6a561e98910f676 Author: Xiaotan Luo Date: Thu Aug 26 12:02:36 2021 +0800 ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B - DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC - DSP_B: PCM no delay mode, L data MSB during FRM LRC Signed-off-by: Xiaotan Luo Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950562-14281-3-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 296713a3609deaf4ad2c460ffe196c09084792e0 Author: Sugar Zhang Date: Thu Aug 26 12:02:35 2021 +0800 ASoC: dt-bindings: rockchip: Document reset property for i2s This patch documents reset property for i2s. Signed-off-by: Sugar Zhang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1629950562-14281-2-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 53ca9b9777b95cdd689181d7c547e38dc79adad0 Author: Sugar Zhang Date: Thu Aug 26 12:01:50 2021 +0800 ASoC: rockchip: i2s: Fix regmap_ops hang API 'set_fmt' maybe called when PD is off, in the situation, any register access will hang the system. so, enable PD before r/w register. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950520-14190-4-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 7a2df53bc090a161713da057df7455b39f6cd00d Author: Sugar Zhang Date: Thu Aug 26 12:01:49 2021 +0800 ASoC: rockchip: i2s: Improve dma data transfer efficiency This patch changes dma data burst from 4 to 8 to improve data transfer efficiency. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950520-14190-3-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 6b76bcc004b046ea3c8eb66bbc6954f1d23cc2af Author: Sugar Zhang Date: Thu Aug 26 12:01:48 2021 +0800 ASoC: rockchip: i2s: Fixup clk div error MCLK maybe not precise as required because of PLL, but which still can be used and no side effect. so, using DIV_ROUND_CLOSEST instead div. e.g. set mclk to 11289600 Hz, but get 11289598 Hz. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950520-14190-2-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit ebfea67125767a779af63ae6de176709713c8826 Author: Sugar Zhang Date: Thu Aug 26 12:01:47 2021 +0800 ASoC: rockchip: i2s: Add support for set bclk ratio This patch adds support for set bclk ratio from machine driver. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629950520-14190-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit e79ef3c2cfe0b39878496eac87450698a2e84e3f Author: Sugar Zhang Date: Tue Aug 24 18:16:02 2021 +0800 ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif This patch adds compatible string for rk3568 spdif. Signed-off-by: Sugar Zhang Acked-by: Rob Herring Link: https://lore.kernel.org/r/1629800162-12824-5-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit c5d4f09feb9f74e704d87a304f0c20001488fe10 Author: Sugar Zhang Date: Tue Aug 24 18:16:01 2021 +0800 ASoC: rockchip: spdif: Add support for rk3568 spdif This patch adds support for rk3568 spdif which is the same with rk3366. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-4-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit acc8b9d117912c2d5952868fba0d4fca49cde3c8 Author: Sugar Zhang Date: Tue Aug 24 18:16:00 2021 +0800 ASoC: rockchip: spdif: Fix some coding style This patch fix some coding style. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-3-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit 023a3f3a1c4f9be9cc1ae92579ba816120fb5807 Author: Sugar Zhang Date: Tue Aug 24 18:15:59 2021 +0800 ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile This patch marks SPDIF_SMPDR as volatile to make it resaonable, which also requires marking it as readable, even though it isn't. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-2-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown commit bb2853a6a421a052268eee00fd5d3f6b3504b2b1 Author: Nguyen Dinh Phi Date: Mon Aug 23 08:06:41 2021 +0800 tty: Fix data race between tiocsti() and flush_to_ldisc() The ops->receive_buf() may be accessed concurrently from these two functions. If the driver flushes data to the line discipline receive_buf() method while tiocsti() is waiting for the ops->receive_buf() to finish its work, the data race will happen. For example: tty_ioctl |tty_ldisc_receive_buf ->tioctsi | ->tty_port_default_receive_buf | ->tty_ldisc_receive_buf ->hci_uart_tty_receive | ->hci_uart_tty_receive ->h4_recv | ->h4_recv In this case, the h4 receive buffer will be overwritten by the latecomer, and we will lost the data. Hence, change tioctsi() function to use the exclusive lock interface from tty_buffer to avoid the data race. Reported-by: syzbot+97388eb9d31b997fe1d0@syzkaller.appspotmail.com Reviewed-by: Jiri Slaby Signed-off-by: Nguyen Dinh Phi Link: https://lore.kernel.org/r/20210823000641.2082292-1-phind.uet@gmail.com Cc: stable Signed-off-by: Greg Kroah-Hartman commit 74d2fb7e708433b7397d9647ea7ec1cbcb0ae379 Author: Tang Bin Date: Sun Aug 22 11:28:06 2021 +0800 serial: vt8500: Use of_device_get_match_data Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210822032806.3256-4-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit a6a65f9ee0937d02e8084ee1ed305e38aae848e6 Author: Tang Bin Date: Sun Aug 22 11:28:05 2021 +0800 serial: tegra: Use of_device_get_match_data Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210822032806.3256-3-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 618bf2b04bd6a903a9ebf0edb8d1700ba9a1a6da Author: Tang Bin Date: Sun Aug 22 11:28:04 2021 +0800 serial: 8250_ingenic: Use of_device_get_match_data Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Acked-by: Paul Cercueil Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210822032806.3256-2-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit fa934fc1a8679f0704dddaefb6946c3da26c58a5 Author: Tang Bin Date: Mon Aug 23 19:07:54 2021 +0800 tty: serial: linflexuart: Remove redundant check to simplify the code In the function uart_add_one_port(), it can return zero or non-zero, so remove redundant check to simplify the code. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210823110754.11232-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 77216702c8f6288f948ee230772b4612b835c5d6 Author: Chuanjia Liu Date: Mon Aug 23 11:27:58 2021 +0800 PCI: mediatek: Use PCI domain to handle ports detection Use of_get_pci_domain_nr() to get the pci domain. If the "linux,pci-domain" property is present, we assume that the PCIe bridge is an individual bridge, hence we only need to parse one port. Link: https://lore.kernel.org/r/20210823032800.1660-5-chuanjia.liu@mediatek.com Signed-off-by: Chuanjia Liu [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Ryder Lee commit bd5305dcabbc208560521bc0617f0a82715e41c9 Author: Fugang Duan Date: Mon Aug 23 17:18:01 2021 +0800 tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp Do software reset for communication port on imx7ulp and imx8qxp after the port is registered if the UART controller support the feature. Do partition reset with LPUART's power on, LPUART registers will keep the previous status, like on i.MX8QXP platform, which is not expected action, so need to set the RST bit of GLOBAL register to reset all uart internal logic and registers. Currently, only i.MX7ULP and i.MX8QXP LPUART controllers include global register that support the software reset. Signed-off-by: Fugang Duan Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20210823091801.17447-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 48422152a8f1c290f74d8fb16ec6c77a1263834c Author: Fugang Duan Date: Mon Aug 23 16:17:33 2021 +0800 tty: serial: fsl_lpuart: enable two stop bits for lpuart32 Add two stop bits support. User can run the command to enable two stop bits for test: stty cstopb -F /dev/ttyLPx Signed-off-by: Fugang Duan Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20210823081733.31941-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit d5c38948448abc2bb6b36dbf85a554bf4748885e Author: Andy Duan Date: Thu Aug 19 10:10:33 2021 +0800 tty: serial: fsl_lpuart: fix the wrong mapbase value Register offset needs to be applied on mapbase also. dma_tx/rx_request use the physical address of UARTDATA. Register offset is currently only applied to membase (the corresponding virtual addr) but not on mapbase. Fixes: 24b1e5f0e83c ("tty: serial: lpuart: add imx7ulp support") Reviewed-by: Leonard Crestez Signed-off-by: Adriana Reus Signed-off-by: Sherry Sun Signed-off-by: Andy Duan Link: https://lore.kernel.org/r/20210819021033.32606-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 436960bb0045854119a61efab20578f55b311a87 Author: Chuanjia Liu Date: Mon Aug 23 11:27:57 2021 +0800 PCI: mediatek: Add new method to get irq number Use platform_get_irq_byname() to get the irq number if the "interrupt-names" property is defined. Link: https://lore.kernel.org/r/20210823032800.1660-4-chuanjia.liu@mediatek.com Signed-off-by: Chuanjia Liu [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Ryder Lee commit 2285c496392979c9ac9d84e19a313ee9212d9b62 Author: Dan Carpenter Date: Wed Aug 25 10:24:35 2021 +0300 mxser: use semi-colons instead of commas This code works, but it's cleaner to use semi-colons at the end of a statement instead of a comma. Acked-by: Jiri Slaby Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210825072435.GB13013@kili Signed-off-by: Greg Kroah-Hartman commit 87e8657ba99cac87b84c7f8ead91b44d88345504 Author: Chuanjia Liu Date: Mon Aug 23 11:27:56 2021 +0800 PCI: mediatek: Add new method to get shared pcie-cfg base address For the new dts format, add a new method to get shared pcie-cfg base address and use it to configure the PCIECFG controller Link: https://lore.kernel.org/r/20210823032800.1660-3-chuanjia.liu@mediatek.com Signed-off-by: Chuanjia Liu Signed-off-by: Lorenzo Pieralisi Acked-by: Ryder Lee commit aa6eca5b81663a59e1a8765481eb48fa2edfab05 Author: Chuanjia Liu Date: Mon Aug 23 11:27:55 2021 +0800 dt-bindings: PCI: mediatek: Update the Device tree bindings There are two independent PCIe controllers in MT2712 and MT7622 platform. Each of them should contain an independent MSI domain. In old dts architecture, MSI domain will be inherited from the root bridge, and all of the devices will share the same MSI domain. Hence that, the PCIe devices will not work properly if the irq number which required is more than 32. Split the PCIe node for MT2712 and MT7622 platform to comply with the hardware design and fix MSI issue. Link: https://lore.kernel.org/r/20210823032800.1660-2-chuanjia.liu@mediatek.com Signed-off-by: Chuanjia Liu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Ryder Lee commit 322003b907d6c74d16154091bca492a2b2829ac0 Author: Dan Carpenter Date: Wed Aug 25 10:24:05 2021 +0300 tty: moxa: use semi-colons instead of commas This code works but it's cleaner to use a semi-colon to end a statement instead of a comma. Acked-by: Jiri Slaby Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210825072405.GA13013@kili Signed-off-by: Greg Kroah-Hartman commit ca5537c9be13c205492e704c5a3016f54b2fefec Merge: e22ce8eb631bd d287801c49715 Author: Mark Brown Date: Thu Aug 26 13:45:27 2021 +0100 Merge remote-tracking branch 'regmap/for-5.15' into regmap-next commit 26cfc0dbe43aae60dc03af27077775244f26c167 Author: Quanyang Wang Date: Thu Aug 26 08:59:30 2021 +0800 spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible The function wait_for_completion_interruptible_timeout will return -ERESTARTSYS immediately when receiving SIGKILL signal which is sent by "jffs2_gcd_mtd" during umounting jffs2. This will break the SPI memory operation because the data transmitting may begin before the command or address transmitting completes. Use wait_for_completion_timeout to prevent the process from being interruptible. Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") Signed-off-by: Quanyang Wang Link: https://lore.kernel.org/r/20210826005930.20572-1-quanyang.wang@windriver.com Signed-off-by: Mark Brown commit 11a08e05079a9328023d236b82bd7981bcde0852 Author: Colin Ian King Date: Thu Aug 26 12:26:11 2021 +0100 ASoC: mediatek: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210826112611.10356-1-colin.king@canonical.com Signed-off-by: Mark Brown commit d212dcee27c1f89517181047e5485fcbba4a25c2 Author: Pali Rohár Date: Fri Aug 20 17:50:20 2021 +0200 PCI: aardvark: Fix masking and unmasking legacy INTx interrupts irq_mask and irq_unmask callbacks need to be properly guarded by raw spin locks as masking/unmasking procedure needs atomic read-modify-write operation on hardware register. Link: https://lore.kernel.org/r/20210820155020.3000-1-pali@kernel.org Reported-by: Marc Zyngier Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Marc Zyngier Cc: stable@vger.kernel.org commit d287801c497151a44e5577fb3bbab673fe52e7b0 Merge: 29c34975c9391 67021f25d9529 Author: Mark Brown Date: Thu Aug 26 13:40:35 2021 +0100 Merge series "Use raw spinlocks in the ls-extirq driver" from Vladimir Oltean : The ls-extirq irqchip driver accesses regmap inside its implementation of the struct irq_chip :: irq_set_type method, and currently regmap only knows to lock using normal spinlocks. But the method above wants raw spinlock context, so this isn't going to work and triggers a "[ BUG: Invalid wait context ]" splat. The best we can do given the arrangement of the code is to patch regmap and the syscon driver: regmap to support raw spinlocks, and syscon to request them on behalf of its ls-extirq consumer. Link: https://lore.kernel.org/lkml/20210825135438.ubcuxm5vctt6ne2q@skbuf/T/#u Vladimir Oltean (2): regmap: teach regmap to use raw spinlocks if requested in the config mfd: syscon: request a regmap with raw spinlocks for some devices drivers/base/regmap/internal.h | 4 ++++ drivers/base/regmap/regmap.c | 35 +++++++++++++++++++++++++++++----- drivers/mfd/syscon.c | 16 ++++++++++++++++ include/linux/regmap.h | 2 ++ 4 files changed, 52 insertions(+), 5 deletions(-) -- 2.25.1 base-commit: 6efb943b8616ec53a5e444193dccf1af9ad627b5 commit 9e62ec0e661ca7161e5830bdbf8e69831b41e866 Author: Rob Herring Date: Mon Aug 23 11:51:26 2021 -0500 arm/arm64: dts: Fix remaining dtc 'unit_address_format' warnings Fix all the remaining dtc 'unit_address_format' warnings except for the ones related to 'register-bit-led'. For those, we need to decide on and document the node name. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210823165126.2320910-1-robh@kernel.org' Signed-off-by: Arnd Bergmann commit d98a30ccdc839947c9233369744341d1fa54439c Author: Chunfeng Yun Date: Thu Aug 26 16:36:37 2021 +0800 usb: mtu3: fix random remote wakeup Some platforms, e.g. 8183/8192, use low level latch way to keep wakeup signal, it may latch a wrong signal if debounce more time, and enable wakeup earlier. ____________________ ip_sleep ____/ \__________ ___________________ wakeup_signal ____________/ \______ _______________________________ wakeup_en _______/ ^ ^ |(1) |(2) latch wakeup_signal mistakenly at (1), should latch it at (2); Workaround: delay about 100us to enable wakeup, meanwhile decrease debounce time. Fixes: b1a344589eea ("usb: mtu3: support ip-sleep wakeup for MT8183") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210826083637.33237-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 50fdcb56c41904c3535687a0e1e1dbd9423a8f9a Author: Chunfeng Yun Date: Thu Aug 26 16:36:36 2021 +0800 usb: mtu3: return successful suspend status Forgot 'return 0;' when suspend successfully, make the mistake when I split patches. Fixes: 6b587394c65c ("usb: mtu3: support suspend/resume for dual-role mode") Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210826083637.33237-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 4ce186665e7c3e9edde648dfb373ca0d213fb312 Author: Chunfeng Yun Date: Thu Aug 26 10:51:43 2021 +0800 usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint xhci-mtk depends on xhci's internal virt_dev when it retrieves its internal data from usb_host_endpoint both in add_endpoint and drop_endpoint callbacks. But when setup packet was retired by transaction errors in xhci_setup_device() path, a virt_dev for the slot is newly created with real_port 0. This leads to xhci-mtks's NULL pointer dereference from drop_endpoint callback as xhci-mtk assumes that virt_dev's real_port is always started from one. The similar problems were addressed by [1] but that can't cover the failure cases from setup_device. This patch drops the usages of xhci's virt_dev in xhci-mtk's drop_endpoint callback by adopting hashtable for searching mtk's schedule entity from a given usb_host_endpoint pointer instead of searching a linked list. So mtk's drop_endpoint callback doesn't have to rely on virt_dev at all. [1] f351f4b63dac ("usb: xhci-mtk: fix oops when unbind driver") Signed-off-by: Ikjoon Jang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210826025144.51992-5-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 926d60ae64a623db3c1afcc524c23709615893d7 Author: Chunfeng Yun Date: Tue Aug 17 16:36:29 2021 +0800 usb: xhci-mtk: modify the SOF/ITP interval for mt8195 There are 4 USB controllers on MT8195, the controllers (IP1~IP3, exclude IP0) have a wrong default SOF/ITP interval which is calculated from the frame counter clock 24Mhz by default, but in fact, the frame counter clock is 48Mhz, so we should set the accurate interval according to 48Mhz for those controllers. Note: the first controller no need set it. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-9-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 82799c80b46a151abc693b20ffea08bfba14be8e Author: Chunfeng Yun Date: Tue Aug 17 16:36:28 2021 +0800 usb: xhci-mtk: add a member of num_esit Add a member num_esit to save the number of esit, then no need caculate it in some functions. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-8-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 614c8c67a071d44be54266b78c21e2a505ac1b32 Author: Chunfeng Yun Date: Tue Aug 17 16:36:27 2021 +0800 usb: xhci-mtk: check boundary before check tt check_sch_tt() will access fs_bus_bw[] array, check boundary firstly to avoid out-of-bounds issue. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-7-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 451d3912586aad3f71f1c97780a1c21e3de98413 Author: Chunfeng Yun Date: Tue Aug 17 16:36:26 2021 +0800 usb: xhci-mtk: update fs bus bandwidth by bw_budget_table Use @bw_budget_table[] to update fs bus bandwidth due to not all microframes consume @bw_cost_per_microframe, see setup_sch_info(). Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-6-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit de5107f473190538a65aac7edea85209cd5c1a8f Author: Chunfeng Yun Date: Tue Aug 17 16:36:25 2021 +0800 usb: xhci-mtk: fix issue of out-of-bounds array access Bus bandwidth array access is based on esit, increase one will cause out-of-bounds issue; for example, when esit is XHCI_MTK_MAX_ESIT, will overstep boundary. Fixes: 7c986fbc16ae ("usb: xhci-mtk: get the microframe boundary for ESIT") Cc: Reported-by: Stan Lu Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 7465d7b66ac73db87b9eb99be01500093f80b575 Author: Chunfeng Yun Date: Tue Aug 17 16:36:24 2021 +0800 usb: xhci-mtk: support option to disable usb2 ports Add support to disable specific usb2 host ports, it's useful when a usb2 port is disabled on some platforms, but enabled on others for the same SoC. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 7f85c16f40d8be5656fb3476909db5c3a5a9c6ea Author: Chunfeng Yun Date: Tue Aug 17 16:36:23 2021 +0800 usb: xhci-mtk: fix use-after-free of mtk->hcd BUG: KASAN: use-after-free in usb_hcd_is_primary_hcd+0x38/0x60 Call trace: dump_backtrace+0x0/0x3dc show_stack+0x20/0x2c dump_stack+0x15c/0x1d4 print_address_description+0x7c/0x510 kasan_report+0x164/0x1ac __asan_report_load8_noabort+0x44/0x50 usb_hcd_is_primary_hcd+0x38/0x60 xhci_mtk_runtime_suspend+0x68/0x148 pm_generic_runtime_suspend+0x90/0xac __rpm_callback+0xb8/0x1f4 rpm_callback+0x54/0x1d0 rpm_suspend+0x4e0/0xc84 __pm_runtime_suspend+0xc4/0x114 xhci_mtk_probe+0xa58/0xd00 This may happen when probe fails, needn't suspend it synchronously, fix it by using pm_runtime_put_noidle(). Reported-by: Pi Hsun Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit e2cd76907fcc8c7438a50b4c44a8073f2228208c Author: Chunfeng Yun Date: Tue Aug 17 16:36:22 2021 +0800 dt-bindings: usb: mtk-xhci: add compatible for mt8195 There are 4 USB controllers on MT8195, the controllers (IP1~IP3, exclude IP0) have a wrong default SOF/ITP interval which is calculated from the frame counter clock 24Mhz by default, but in fact, the frame counter clock is 48Mhz, so we should set the accurate interval according to 48Mhz. Here add a new compatible for MT8195, it's also supported in driver. But the first controller (IP0) has no such issue, we prefer to use generic compatible, e.g. mt8192's compatible. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 51018cde5b55b7b0d65af0d363531cddd360fe11 Author: Chunfeng Yun Date: Tue Aug 17 16:36:21 2021 +0800 dt-bindings: usb: mtk-xhci: add optional property to disable usb2 ports Add support to disable specific usb2 host ports, it's useful when a usb2 port is disabled on some platforms, but enabled on others for the same SoC, another case is that the different package may support different number of ports. Reviewed-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629189389-18779-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 6f15a2a09cecb7a2faba4a75bbd101f6f962294b Author: Christophe JAILLET Date: Wed Aug 18 21:32:49 2021 +0200 usb: bdc: Fix a resource leak in the error handling path of 'bdc_probe()' If an error occurs after a successful 'clk_prepare_enable()' call, it must be undone by a corresponding 'clk_disable_unprepare()' call. This call is already present in the remove function. Add this call in the error handling path and reorder the code so that the 'clk_prepare_enable()' call happens later in the function. The goal is to have as much managed resources functions as possible before the 'clk_prepare_enable()' call in order to keep the error handling path simple. While at it, remove the now unneeded 'clk' variable. Fixes: c87dca047849 ("usb: bdc: Add clock enable for new chips with a separate BDC clock") Acked-by: Florian Fainelli Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f8a4a6897deb0c8cb2e576580790303550f15fcd.1629314734.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit d2f42e09393c774ab79088d8e3afcc62b3328fc9 Author: Christophe JAILLET Date: Wed Aug 18 21:32:38 2021 +0200 usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available If no suitable DMA configuration is available, a previous 'bdc_phy_init()' call must be undone by a corresponding 'bdc_phy_exit()' call. Branch to the existing error handling path instead of returning directly. Fixes: cc29d4f67757 ("usb: bdc: Add support for USB phy") Acked-by: Florian Fainelli Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit f2a9797b4efe54c94cc5ceb82ce1a4fba8b70a51 Author: Chunfeng Yun Date: Fri Aug 20 14:59:13 2021 +0800 Revert "usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint" I find the patch introduce some issues, e.g. 1. oops happens when xhci_gen_setup() failed, and hash is not init but try to destroy it; 2. memory leakage happens when fail to insert ep, need free sch_ep, or insert ep after insert int list; 3. memory leakage happens when fail to allocate sch_array, need destroy rhashtable; 4. it's better to check ep->hcpriv when drop ep; so prefer to revert this patch, and resend it after the issues are fixed. This reverts commit b8731209958a1dffccc2888121f4c0280c990550. Cc: Ikjoon Jang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210820065913.64490-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 76d55a633ab61e70cb56720830e7be3dec0842fe Author: Chunfeng Yun Date: Fri Aug 20 14:59:12 2021 +0800 Revert "usb: xhci-mtk: relax TT periodic bandwidth allocation" As discussed in following patch: https://patchwork.kernel.org/patch/12420339 No need calculate number of uframes again, but should use value form check_sch_tt(), if we plan to remove extra CS, also can do it in check_sch_tt(). So revert this patch, and prepare to send new patch for it. This reverts commit 548011957d1d72e0b662300c8b32b81d593b796e. Cc: Ikjoon Jang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20210820065913.64490-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit de940244e8987a76d73fb2b0057ecd494cbfeefd Author: Rui Miguel Silva Date: Thu Aug 19 19:09:29 2021 +0100 usb: isp1760: clean never read udc_enabled warning When CONFIG_USB_ISP1761_UDC is not enabled the udc_enabled variable is never used since it is short circuited before in the logic operations. This would trigger the following warning by clang analyzer: drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores] udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) || ^ drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read Just swap the other of the operands in the logic operations. Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210819180929.1327349-6-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7d1d3882fd9da1ee42fe3ad3a5ffd41fb8204380 Author: Rui Miguel Silva Date: Thu Aug 19 19:09:28 2021 +0100 usb: isp1760: do not shift in uninitialized slot Even though it is not expected, and would trigger a WARN_ON, killing a transfer in a uninitialized slot this sequence is warned by clang analyzer, twice: drivers/usb/isp1760/isp1760-hcd.c:1976:18: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult] skip_map |= (1 << qh->slot); drivers/usb/isp1760/isp1760-hcd.c:1983:18: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult] skip_map |= (1 << qh->slot); Only set skip map if slot is active. Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210819180929.1327349-5-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5e4cd1b6556302fe6a457e525c256cbef3563543 Author: Rui Miguel Silva Date: Thu Aug 19 19:09:27 2021 +0100 usb: isp1760: do not reset retval We do not really need to reset retval before get used bellow. This will avoid the clang-analyzer warning: drivers/usb/isp1760/isp1760-hcd.c:1919:2: warning: Value stored to 'retval' is never read [clang-analyzer-deadcode.DeadStores] retval = 0; Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210819180929.1327349-4-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8e58b7710d6634ed46ae26fedb8459f84f08fd51 Author: Rui Miguel Silva Date: Thu Aug 19 19:09:26 2021 +0100 usb: isp1760: check maxpacketsize before using it When checking if we need one more packet on a bulk pipe we may, even though not probable at all, get there with a zero maxpacketsize. In that case for sure no packet, no even a one more, will be allocated. This will clean the clang-analyzer warning: drivers/usb/isp1760/isp1760-hcd.c:1856:38: warning: Division by zero [clang-analyzer-core.DivideZero] && !(urb->transfer_buffer_length % Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210819180929.1327349-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8472896f39cfab2d8fec9ca746070aaf02609169 Author: Rui Miguel Silva Date: Thu Aug 19 19:09:25 2021 +0100 usb: isp1760: ignore return value for bus change pattern We do not care about the return value of that read between the scratch register write and read, we really just want to make sure that the pattern in the bus get changed to make sure we are testing correctly the scratch pattern. Clang-analyzer complains about the never read scratch variable: >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores] scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH); Just ignore the return value of that CHIP_ID_HIGH read, add more information to the comment above why we are doing this. And as at it, just do a small format change in the error message bellow. Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210819180929.1327349-2-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9fe3c93f9de702fa764351201c574a9d0769fab3 Author: Wei Ming Chen Date: Sat Aug 21 22:26:47 2021 +0800 usb: gadget: Add description for module parameter The description for "qlen" is missing, and there is a description for this parameter in "Documentation/usb/gadget_printer.rst" Signed-off-by: Wei Ming Chen Link: https://lore.kernel.org/r/20210821142647.2904-1-jj251510319013@gmail.com Signed-off-by: Greg Kroah-Hartman commit 66cce9e73ec61967ed1f97f30cee79bd9a2bb7ee Author: Shuah Khan Date: Thu Aug 19 16:59:37 2021 -0600 usbip:vhci_hcd USB port can get stuck in the disabled state When a remote usb device is attached to the local Virtual USB Host Controller Root Hub port, the bound device driver may send a port reset command. vhci_hcd accepts port resets only when the device doesn't have port address assigned to it. When reset happens device is in assigned/used state and vhci_hcd rejects it leaving the port in a stuck state. This problem was found when a blue-tooth or xbox wireless dongle was passed through using usbip. A few drivers reset the port during probe including mt76 driver specific to this bug report. Fix the problem with a change to honor reset requests when device is in used state (VDEV_ST_USED). Reported-and-tested-by: Michael Suggested-by: Michael Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20210819225937.41037-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 5289253b01d7bfa5e8ae23fdc2482acacd301e7d Author: Anirudh Rayabharam Date: Sat Aug 21 00:31:22 2021 +0530 usbip: clean up code in vhci_device_unlink_cleanup The cleanup code for unlink_tx and unlink_rx lists is almost the same. So, extract it into a new function and call it for both unlink_rx and unlink_tx. Also, remove unnecessary log messages. Signed-off-by: Anirudh Rayabharam Link: https://lore.kernel.org/r/20210820190122.16379-3-mail@anirudhrb.com Signed-off-by: Greg Kroah-Hartman commit 258c81b341c8025d79073ce2d6ce19dcdc7d10d2 Author: Anirudh Rayabharam Date: Sat Aug 21 00:31:21 2021 +0530 usbip: give back URBs for unsent unlink requests during cleanup In vhci_device_unlink_cleanup(), the URBs for unsent unlink requests are not given back. This sometimes causes usb_kill_urb to wait indefinitely for that urb to be given back. syzbot has reported a hung task issue [1] for this. To fix this, give back the urbs corresponding to unsent unlink requests (unlink_tx list) similar to how urbs corresponding to unanswered unlink requests (unlink_rx list) are given back. [1]: https://syzkaller.appspot.com/bug?id=08f12df95ae7da69814e64eb5515d5a85ed06b76 Reported-by: syzbot+74d6ef051d3d2eacf428@syzkaller.appspotmail.com Tested-by: syzbot+74d6ef051d3d2eacf428@syzkaller.appspotmail.com Reviewed-by: Shuah Khan Signed-off-by: Anirudh Rayabharam Link: https://lore.kernel.org/r/20210820190122.16379-2-mail@anirudhrb.com Signed-off-by: Greg Kroah-Hartman commit 5786b433f721059f65b55a5ed0520ff5c375697d Author: Cai Huoqing Date: Mon Aug 23 12:58:07 2021 +0800 usb: gadget: aspeed: Remove repeated verbose license text remove it because SPDX-License-Identifier is already used Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210823045807.49-1-caihuoqing@baidu.com Signed-off-by: Greg Kroah-Hartman commit 0b9f6cc845ce8ea4ee72bfabbaf9bfbf68f5fbde Author: Cai Huoqing Date: Sun Aug 22 12:30:05 2021 +0800 usb: gadget: mass_storage: Remove repeated verbose license text remove it because SPDX-License-Identifier is already used Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210822043005.192-1-caihuoqing@baidu.com Signed-off-by: Greg Kroah-Hartman commit 7c75bde329d7e2a93cf86a5c15c61f96f1446cdc Author: Nadezda Lutovinova Date: Thu Aug 19 19:33:23 2021 +0300 usb: musb: musb_dsps: request_irq() after initializing musb If IRQ occurs between calling dsps_setup_optional_vbus_irq() and dsps_create_musb_pdev(), then null pointer dereference occurs since glue->musb wasn't initialized yet. The patch puts initializing of neccesery data before registration of the interrupt handler. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210819163323.17714-1-lutovinova@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 465e333e77a697fe8bfe4e24c6be1795f50c4fda Merge: 806c0e6e7e97a 0c8fb653d487d Author: Michael Ellerman Date: Thu Aug 26 21:21:11 2021 +1000 Merge branch 'topic/ppc-kvm' into next Merge some KVM patches we are keeping in a topic branch in case there are any merge conflicts that need resolving. commit 806c0e6e7e97adc17389c8dc1f52d4736f49299b Author: Christophe Leroy Date: Mon Aug 23 08:24:21 2021 +0000 powerpc: Refactor verification of MSR_RI 40x and BOOKE don't have MSR_RI therefore all tests involving MSR_RI may be problematic on those plateforms. Create helpers to check or set MSR_RI in regs, and use them in common code. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c2fb93708196734f4176dda334aaa3055f213b89.1629707037.git.christophe.leroy@csgroup.eu commit 133c17a1788d68c9fff59d5f724a4ba14647a16d Author: Christophe Leroy Date: Mon Aug 23 08:24:20 2021 +0000 powerpc: Remove MSR_PR check in interrupt_exit_{user/kernel}_prepare() In those hot functions that are called at every interrupt, any saved cycle is worth it. interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare() are called from three places: - From entry_32.S - From interrupt_64.S - From interrupt_exit_user_restart() and interrupt_exit_kernel_restart() In entry_32.S, there are inambiguously called based on MSR_PR: interrupt_return: lwz r4,_MSR(r1) addi r3,r1,STACK_FRAME_OVERHEAD andi. r0,r4,MSR_PR beq .Lkernel_interrupt_return bl interrupt_exit_user_prepare ... .Lkernel_interrupt_return: bl interrupt_exit_kernel_prepare In interrupt_64.S, that's similar: interrupt_return_\srr\(): ld r4,_MSR(r1) andi. r0,r4,MSR_PR beq interrupt_return_\srr\()_kernel interrupt_return_\srr\()_user: /* make backtraces match the _kernel variant */ addi r3,r1,STACK_FRAME_OVERHEAD bl interrupt_exit_user_prepare ... interrupt_return_\srr\()_kernel: addi r3,r1,STACK_FRAME_OVERHEAD bl interrupt_exit_kernel_prepare In interrupt_exit_user_restart() and interrupt_exit_kernel_restart(), MSR_PR is verified respectively by BUG_ON(!user_mode(regs)) and BUG_ON(user_mode(regs)) prior to calling interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare(). The verification in interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare() are therefore useless and can be removed. Signed-off-by: Christophe Leroy Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/385ead49ccb66a259b25fee3eebf0bd4094068f3.1629707037.git.christophe.leroy@csgroup.eu commit d9db6e420268b2d561731468a31f0b15e2e9a145 Author: Xiongwei Song Date: Sat Aug 7 09:02:39 2021 +0800 powerpc/64e: Get dear offset with _DEAR macro Use _DEAR to get the offset of dear register in pr_regs for 64e cpus. Signed-off-by: Xiongwei Song Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210807010239.416055-5-sxwjean@me.com commit 4872cbd0ca35ca5b20d52e2539e7e1950f126e7b Author: Xiongwei Song Date: Sat Aug 7 09:02:38 2021 +0800 powerpc: Add dear as a synonym for pt_regs.dar register Create an anonymous union for dar and dear regsiters, we can reference dear to get the effective address when CONFIG_4xx=y or CONFIG_BOOKE=y. Otherwise, reference dar. This makes code more clear. Signed-off-by: Xiongwei Song [mpe: Reword commit title] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210807010239.416055-4-sxwjean@me.com commit cfa47772ca8d53d7a6c9b331a7f6e7c4c9827214 Author: Xiongwei Song Date: Sat Aug 7 09:02:37 2021 +0800 powerpc/64e: Get esr offset with _ESR macro Use _ESR to get the offset of esr register in pr_regs for 64e cpus. Signed-off-by: Xiongwei Song Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210807010239.416055-3-sxwjean@me.com commit 4f8e78c0757e3c5a65d9d8ac76e2434c71a78f5a Author: Xiongwei Song Date: Sat Aug 7 09:02:36 2021 +0800 powerpc: Add esr as a synonym for pt_regs.dsisr Create an anonymous union for dsisr and esr regsiters, we can reference esr to get the exception detail when CONFIG_4xx=y or CONFIG_BOOKE=y. Otherwise, reference dsisr. This makes code more clear. Signed-off-by: Xiongwei Song [mpe: Reword commit title] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210807010239.416055-2-sxwjean@me.com commit e42edf9b9d126bb1c743f2e7984877ba27f09fe7 Author: Jordan Niethe Date: Thu Jul 29 14:13:17 2021 +1000 selftests: Skip TM tests on synthetic TM implementations Transactional Memory was removed from the architecture in ISA v3.1. For threads running in P8/P9 compatibility mode on P10 a synthetic TM implementation is provided. In this implementation, tbegin. always sets cr0 eq meaning the abort handler is always called. This is not an issue as users of TM are expected to have a fallback non transactional way to make forward progress in the abort handler. The TEXASR indicates if a transaction failure is due to a synthetic implementation. Some of the TM self tests need a non-degenerate TM implementation for their testing to be meaningful so check for a synthetic implementation and skip the test if so. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729041317.366612-2-jniethe5@gmail.com commit c95278a0534449efc64ac8169382bce217963be2 Author: Jordan Niethe Date: Thu Jul 29 14:13:16 2021 +1000 selftests/powerpc: Add missing clobbered register to to ptrace TM tests ISA v3.1 removes TM but includes a synthetic implementation for backwards compatibility. With this implementation, the tests ptrace-tm-spd-gpr and ptrace-tm-gpr should never be able to make any forward progress and eventually should be killed by the timeout. Instead on a P10 running in P9 mode, ptrace_tm_gpr fails like so: test: ptrace_tm_gpr tags: git_version:unknown Starting the child ... ... GPR[27]: 1 Expected: 2 GPR[28]: 1 Expected: 2 GPR[29]: 1 Expected: 2 GPR[30]: 1 Expected: 2 GPR[31]: 1 Expected: 2 [FAIL] Test FAILED on line 98 failure: ptrace_tm_gpr selftests: ptrace-tm-gpr [FAIL] The problem is in the inline assembly of the child. r0 is loaded with a value in the child's transaction abort handler but this register is not included in the clobbers list. This means it is possible that this statement: cptr[1] = 0; which is meant to signal the parent to wait may actually use the value placed into r0 by the inline assembly incorrectly signal the parent to continue. By inspection the same problem is present in ptrace-tm-spd-gpr. Adding r0 to the clobbbers list makes the test fail correctly via a timeout on a P10 running in P8/P9 compatibility mode. Suggested-by: Michael Neuling Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729041317.366612-1-jniethe5@gmail.com commit 0f887ac82971cbde59e563d6490c05c6b15aa82f Author: Chunyan Zhang Date: Thu Aug 26 17:15:49 2021 +0800 spi: add sprd ADI for sc9863 and ums512 This patch adds support for sc9863 and ums512. Signed-off-by: Chunyan Zhang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210826091549.2138125-5-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit f15e60d460391d16bdad2e446e9dca4f264ccdfe Author: Chunyan Zhang Date: Thu Aug 26 17:15:48 2021 +0800 spi: Convert sprd ADI bindings to yaml Convert spi-sprd-adi.txt to yaml. Signed-off-by: Chunyan Zhang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210826091549.2138125-4-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 1abade64563ef5388db545b55cf158e849f6e717 Author: Nehal Bakulchandra Shah Date: Tue Aug 24 00:14:48 2021 +0530 usb: dwc3: pci: add support for AMD's newer generation platform. AMD's latest platforms has DWC3 controller. Add the PCI ID and properties for the same. Signed-off-by: Nehal Bakulchandra Shah Acked-by: Felipe Balbi Link: https://lore.kernel.org/r/20210823184449.2796184-2-Nehal-Bakulchandra.shah@amd.com Signed-off-by: Greg Kroah-Hartman commit deecae7d96843fceebae06445b3f4bf8cceca31a Merge: bc8e05d6b9658 ee7da21ac4c3b Author: David S. Miller Date: Thu Aug 26 12:13:52 2021 +0100 Merge branch 'LiteETH-driver' Joel Stanley says: ==================== net: Add LiteETH network driver This adds a driver for the LiteX network device, LiteEth. v4 Fixes the bindings and adds r-b tags from Gabriel and Rob. v3 Updates the bindings to describe the slots in a way that makes more sense for the hardware, instead of trying to fit some existing properties. The driver is updated to use these bindings, and fix some issues pointed out by Gabriel. v2 Addresses feedback from Jakub, with detailed changes in each patch. It also moves to the litex register accessors so the system works on big endian litex platforms. I tested with mor1k on an Arty A7-100T. I have removed the mdio aspects of the driver as they are not needed for basic operation. I will continue to work on adding support in the future, but I don't think it needs to block the mac driver going in. The binding describes the mdio registers, and has been fixed to not show any warnings against dtschema master. LiteEth is a simple driver for the FPGA based Ethernet device used in various RISC-V, PowerPC's microwatt, OpenRISC's mor1k and other FPGA based systems on chip. ==================== Signed-off-by: David S. Miller commit ee7da21ac4c3be1f618b6358e0a38739a5d1773e Author: Joel Stanley Date: Thu Aug 26 07:51:06 2021 +0930 net: Add driver for LiteX's LiteETH network interface LiteX is a soft system-on-chip that targets FPGAs. LiteETH is a basic network device that is commonly used in LiteX designs. The driver was first written in 2017 and has been maintained by the LiteX community in various trees. Thank you to all who have contributed. Co-developed-by: Gabriel Somlo Co-developed-by: David Shah Co-developed-by: Stafford Horne Signed-off-by: Joel Stanley Tested-by: Gabriel Somlo Reviewed-by: Gabriel Somlo Signed-off-by: David S. Miller commit b0f8d3077f8feacbd2642fce6e65d3bf04f57501 Author: Joel Stanley Date: Thu Aug 26 07:51:05 2021 +0930 dt-bindings: net: Add bindings for LiteETH LiteETH is a small footprint and configurable Ethernet core for FPGA based system on chips. The hardware is parametrised by the size and number of the slots in it's receive and send buffers. These are described as properties, with the commonly used values set as the default. Signed-off-by: Joel Stanley Signed-off-by: David S. Miller commit 6a48d0ae01a6ab05ae5e78328546a2f5f6d3054a Author: Nadezda Lutovinova Date: Thu Aug 19 18:48:18 2021 +0300 usb: dwc3: imx8mp: request irq after initializing dwc3 If IRQ occurs between calling devm_request_threaded_irq() and initializing dwc3_imx->dwc3, then null pointer dereference occurs since dwc3_imx->dwc3 is used in dwc3_imx8mp_interrupt(). The patch puts registration of the interrupt handler after initializing of neccesery data. Found by Linux Driver Verification project (linuxtesting.org). Reviewed-by: Fabio Estevam Acked-by: Felipe Balbi Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210819154818.18334-1-lutovinova@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 3b66ca9783d1d1b7be7bf41e8934ca2eaf50a9c0 Author: Chunyan Zhang Date: Thu Aug 26 17:15:47 2021 +0800 spi: sprd: Add ADI r3 support ADI r3p0 is used on SC9863 and UMS512 SoCs. Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20210826091549.2138125-3-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 245ca2cc212bb2a078332ec99afbfbb202f44c2d Author: Chunyan Zhang Date: Thu Aug 26 17:15:46 2021 +0800 spi: sprd: Fix the wrong WDG_LOAD_VAL Use 50ms as default timeout value and the time clock is 32768HZ. The original value of WDG_LOAD_VAL is not correct, so this patch fixes it. Fixes: ac1775012058 ("spi: sprd: Add the support of restarting the system") Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20210826091549.2138125-2-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 4720f1bf4ee4a784d9ece05420ba33c9222a3004 Author: Evgeny Novikov Date: Wed Aug 25 20:09:02 2021 +0300 usb: ehci-orion: Handle errors of clk_prepare_enable() in probe ehci_orion_drv_probe() did not account for possible errors of clk_prepare_enable() that in particular could cause invocation of clk_disable_unprepare() on clocks that were not prepared/enabled yet, e.g. in remove or on handling errors of usb_add_hcd() in probe. Though, there were several patches fixing different issues with clocks in this driver, they did not solve this problem. Add handling of errors of clk_prepare_enable() in ehci_orion_drv_probe() to avoid calls of clk_disable_unprepare() without previous successful invocation of clk_prepare_enable(). Found by Linux Driver Verification project (linuxtesting.org). Fixes: 8c869edaee07 ("ARM: Orion: EHCI: Add support for enabling clocks") Co-developed-by: Kirill Shilimanov Reviewed-by: Andrew Lunn Acked-by: Alan Stern Signed-off-by: Evgeny Novikov Signed-off-by: Kirill Shilimanov Link: https://lore.kernel.org/r/20210825170902.11234-1-novikov@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 67021f25d95292d285dd213c58401642b98eaf24 Author: Vladimir Oltean Date: Wed Aug 25 23:50:40 2021 +0300 regmap: teach regmap to use raw spinlocks if requested in the config Some drivers might access regmap in a context where a raw spinlock is held. An example is drivers/irqchip/irq-ls-extirq.c, which calls regmap_update_bits() from struct irq_chip :: irq_set_type, which is a method called by __irq_set_trigger() under the desc->lock raw spin lock. Since desc->lock is a raw spin lock and the regmap internal lock for mmio is a plain spinlock (which can become sleepable on RT), this is an invalid locking scheme and we get a splat stating that this is a "[ BUG: Invalid wait context ]". It seems reasonable for regmap to have an option use a raw spinlock too, so add that in the config such that drivers can request it. Suggested-by: Mark Brown Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210825205041.927788-2-vladimir.oltean@nxp.com Signed-off-by: Mark Brown commit 2fd276c3ee4bd42eb034f8954964a5ae74187c6b Author: Robin Murphy Date: Wed Aug 25 16:42:03 2021 +0100 ASoC: dwc: Get IRQ optionally The IRQ is explicitly optional, so use platform_get_irq_optional() and avoid platform_get_irq() logging a spurious error when trying to use the thing in DMA mode. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/c857f334e3c9e651e088b675b3938cb5f798b133.1629906123.git.robin.murphy@arm.com Signed-off-by: Mark Brown commit bc8e05d6b9658b6b59cb770d981064244cdc574b Author: Jonathan Lemon Date: Wed Aug 25 14:17:33 2021 -0700 ptp: ocp: Simplify Kconfig. Remove the 'imply' statements, these apparently are not doing what I expected. Platform modules which are used by the driver still need to be enabled in the overall config for them to be used, but there isn't a hard dependency on them. Use 'depend' for selectable modules which provide functions used directly by the driver. Signed-off-by: Jonathan Lemon Reviewed-by: Arnd Bergmann Reviewed-by: Randy Dunlap Signed-off-by: David S. Miller commit 669bc5a188b40a4edc9c2a42e5b32f19182767d9 Author: Mathias Nyman Date: Fri Aug 20 15:35:03 2021 +0300 xhci: Add bus number to some debug messages As we register two usb buses for each xHC, and systems with several hosts are more and more common it is getting hard to follow the flow of debug messages without knowing which bus they belong to Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0d9b9f533bf1aa555fcd28fa459332b7731316b3 Author: Mathias Nyman Date: Fri Aug 20 15:35:02 2021 +0300 xhci: Add additional dynamic debug to follow URBs in cancel and error cases. Add more debugging messages to follow what happends to a URB internally in special cases like URB cancel, halted endpoints and endpoint reset. Helps tracking issues like URB never given back by host. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2847c46c61486fd8bca9136a6e27177212e78c69 Author: Mathias Nyman Date: Fri Aug 20 15:35:01 2021 +0300 Revert "USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set" This reverts commit 5d5323a6f3625f101dbfa94ba3ef7706cce38760. That commit effectively disabled Intel host initiated U1/U2 lpm for devices with periodic endpoints. Before that commit we disabled host initiated U1/U2 lpm if the exit latency was larger than any periodic endpoint service interval, this is according to xhci spec xhci 1.1 specification section 4.23.5.2 After that commit we incorrectly checked that service interval was smaller than U1/U2 inactivity timeout. This is not relevant, and can't happen for Intel hosts as previously set U1/U2 timeout = 105% * service interval. Patch claimed it solved cases where devices can't be enumerated because of bandwidth issues. This might be true but it's a side effect of accidentally turning off lpm. exit latency calculations have been revised since then Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 94f339147fc3eb9edef7ee4ef6e39c569c073753 Author: Mathias Nyman Date: Fri Aug 20 15:35:00 2021 +0300 xhci: Fix failure to give back some cached cancelled URBs. Only TDs with status TD_CLEARING_CACHE will be given back after cache is cleared with a set TR deq command. xhci_invalidate_cached_td() failed to set the TD_CLEARING_CACHE status for some cancelled TDs as it assumed an endpoint only needs to clear the TD it stopped on. This isn't always true. For example with streams enabled an endpoint may have several stream rings, each stopping on a different TDs. Note that if an endpoint has several stream rings, the current code will still only clear the cache of the stream pointed to by the last cancelled TD in the cancel list. This patch only focus on making sure all canceled TDs are given back, avoiding hung task after device removal. Another fix to solve clearing the caches of all stream rings with cancelled TDs is needed, but not as urgent. This issue was simultanously discovered and debugged by by Tao Wang, with a slightly different fix proposal. Fixes: 674f8438c121 ("xhci: split handling halted endpoints into two steps") Cc: #5.12 Reported-by: Tao Wang Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4843b4b5ec64b875a5e334f280508f1f75e7d3e4 Author: Mathias Nyman Date: Fri Aug 20 15:34:59 2021 +0300 xhci: fix even more unsafe memory usage in xhci tracing Removes static char buffer usage in the following decode functions: xhci_decode_ctrl_ctx() xhci_decode_slot_context() xhci_decode_usbsts() xhci_decode_doorbell() xhci_decode_ep_context() Caller must provide a buffer to use. In tracing use __get_str() as recommended to pass buffer. Minor changes are needed in other xhci code as these functions are also used elsewhere Cc: Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit cbf286e8ef8337308c259ff5b9ce2e74d403be5a Author: Mathias Nyman Date: Fri Aug 20 15:34:58 2021 +0300 xhci: fix unsafe memory usage in xhci tracing Removes static char buffer usage in the following decode functions: xhci_decode_trb() xhci_decode_ptortsc() Caller must provide a buffer to use. In tracing use __get_str() as recommended to pass buffer. Minor chanes are needed in xhci debugfs code as these functions are also used there. Changes include moving XHCI_MSG_MAX definititon from xhci-trace.h to xhci.h Cc: Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20210820123503.2605901-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4b33433ee734661e5d50851f9bbe7934fc2b1928 Author: Heiner Kallweit Date: Wed Aug 25 18:29:48 2021 +0200 r8169: add rtl_enable_exit_l1 This adds a function for what has been magic register writes so far. It's based on recent changes to vendor drivers r8101, r8168, r8125, and deals with events that trigger an early ASPM L1 exit. Description of the bits has been kindly provided by Realtek. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 9af771d2ec044ffc19192711ac29f1d5c31dc181 Author: Paolo Abeni Date: Thu Aug 26 09:30:42 2021 +0200 selftests/net: allow GRO coalesce test on veth This change extends the existing GRO coalesce test to allow running on top of a veth pair, so that no H/W dep is required to run them. By default gro.sh will use the veth backend, and will try to use exiting H/W in loopback mode if a specific device name is provided with the '-i' command line option. No functional change is intended for the loopback-based tests, just move all the relevant initialization/cleanup code into the related script. Introduces a new initialization helper script for the veth backend, and plugs the correct helper script according to the provided command line. Additionally, enable veth-based tests by default. v1 -> v2: - drop unused code in setup_veth_ns() - Willem Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 1a7f67e618d42e9870dcd9fb0c7b2682d71fd631 Merge: 622909e51a002 e130338eed5de Author: Catalin Marinas Date: Thu Aug 26 11:49:33 2021 +0100 Merge branch 'for-next/entry' into for-next/core * for-next/entry: : More entry.S clean-ups and conversion to C. arm64: entry: call exit_to_user_mode() from C arm64: entry: move bulk of ret_to_user to C arm64: entry: clarify entry/exit helpers arm64: entry: consolidate entry/exit helpers commit 622909e51a00222a7e74cc8f703e533dc5c22d63 Merge: fd264b310579e 7a062ce31807e 50cb99fa89aa2 fa5ca80db89e8 Author: Catalin Marinas Date: Thu Aug 26 11:49:27 2021 +0100 Merge branches 'for-next/mte', 'for-next/misc' and 'for-next/kselftest', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: arm64/perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF * for-next/mte: : Miscellaneous MTE improvements. arm64/cpufeature: Optionally disable MTE via command-line arm64: kasan: mte: remove redundant mte_report_once logic arm64: kasan: mte: use a constant kernel GCR_EL1 value arm64: avoid double ISB on kernel entry arm64: mte: optimize GCR_EL1 modification on kernel entry/exit Documentation: document the preferred tag checking mode feature arm64: mte: introduce a per-CPU tag checking mode preference arm64: move preemption disablement to prctl handlers arm64: mte: change ASYNC and SYNC TCF settings into bitfields arm64: mte: rename gcr_user_excl to mte_ctrl arm64: mte: avoid TFSRE0_EL1 related operations unless in async mode * for-next/misc: : Miscellaneous updates. arm64: Do not trap PMSNEVFR_EL1 arm64: mm: fix comment typo of pud_offset_phys() arm64: signal32: Drop pointless call to sigdelsetmask() arm64/sve: Better handle failure to allocate SVE register storage arm64: Document the requirement for SCR_EL3.HCE arm64: head: avoid over-mapping in map_memory arm64/sve: Add a comment documenting the binutils needed for SVE asm arm64/sve: Add some comments for sve_save/load_state() arm64: replace in_irq() with in_hardirq() arm64: mm: Fix TLBI vs ASID rollover arm64: entry: Add SYM_CODE annotation for __bad_stack arm64: fix typo in a comment arm64: move the (z)install rules to arch/arm64/Makefile arm64/sve: Make fpsimd_bind_task_to_cpu() static arm64: unnecessary end 'return;' in void functions arm64/sme: Document boot requirements for SME arm64: use __func__ to get function name in pr_err arm64: SSBS/DIT: print SSBS and DIT bit when printing PSTATE arm64: cpufeature: Use defined macro instead of magic numbers arm64/kexec: Test page size support with new TGRAN range values * for-next/kselftest: : Kselftest additions for arm64. kselftest/arm64: signal: Add a TODO list for signal handling tests kselftest/arm64: signal: Add test case for SVE register state in signals kselftest/arm64: signal: Verify that signals can't change the SVE vector length kselftest/arm64: signal: Check SVE signal frame shows expected vector length kselftest/arm64: signal: Support signal frames with SVE register data kselftest/arm64: signal: Add SVE to the set of features we can check for kselftest/arm64: pac: Fix skipping of tests on systems without PAC kselftest/arm64: mte: Fix misleading output when skipping tests kselftest/arm64: Add a TODO list for floating point tests kselftest/arm64: Add tests for SVE vector configuration kselftest/arm64: Validate vector lengths are set in sve-probe-vls kselftest/arm64: Provide a helper binary and "library" for SVE RDVL kselftest/arm64: Ignore check_gcr_el1_cswitch binary commit ce6a7007048b0abcf263a2b43a63d18614802e53 Author: Pavel Skripkin Date: Tue Aug 24 10:27:13 2021 +0300 staging: r8188eu: remove {read,write}_macreg These 2 functions are unused, so they can be simply removed Signed-off-by: Pavel Skripkin Acked-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/d591e29d77da73790c71f7a8e508a8b16fd48f65.1629789580.git.paskripkin@gmail.com Signed-off-by: Greg Kroah-Hartman commit 419025b3b4190ee867ef4fc48fb3bd7da2e67a0c Merge: 7c7b363d62a51 8ce8a6fce9bfd Author: Marc Zyngier Date: Thu Aug 26 11:36:12 2021 +0100 Merge branch kvm-arm64/misc-5.15 into kvmarm-master/next * kvm-arm64/misc-5.15: : Misc improvements for 5.15: : : - Account the number of VMID-wide TLB invalidations as : remote TLB flushes : - Fix comments in the VGIC code : - Cleanup the PMU IMPDEF identification : - Streamline the TGRAN2 usage : - Avoid advertising a 52bit IPA range for non-64KB configs : - Avoid spurious signalling when a HW-mapped interrupt is in the : A+P state on entry, and in the P state on exit, but that the : physical line is not pending anymore. : - Bunch of minor cleanups KVM: arm64: Trim guest debug exception handling Signed-off-by: Marc Zyngier commit 50cb99fa89aa2bec2cab2f9917010bbd7769bfa3 Author: Alexandru Elisei Date: Tue Aug 24 16:45:23 2021 +0100 arm64: Do not trap PMSNEVFR_EL1 Commit 31c00d2aeaa2 ("arm64: Disable fine grained traps on boot") zeroed the fine grained trap registers to prevent unwanted register traps from occuring. However, for the PMSNEVFR_EL1 register, the corresponding HDFG{R,W}TR_EL2.nPMSNEVFR_EL1 fields must be 1 to disable trapping. Set both fields to 1 if FEAT_SPEv1p2 is detected to disable read and write traps. Fixes: 31c00d2aeaa2 ("arm64: Disable fine grained traps on boot") Cc: # 5.13.x Signed-off-by: Alexandru Elisei Reviewed-by: Mark Brown Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20210824154523.906270-1-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit 8ce8a6fce9bfd3fcabe230ad104e2caf08b2e58d Author: Raghavendra Rao Ananta Date: Mon Aug 23 22:39:40 2021 +0000 KVM: arm64: Trim guest debug exception handling The switch-case for handling guest debug exception covers all the debug exception classes, but functionally, doesn't do anything with them other than ESR_ELx_EC_WATCHPT_LOW. Moreover, even though handled well, the 'default' case could be confusing from a security point of view, stating that the guests' actions can potentially flood the syslog. But in reality, the code is unreachable. Hence, trim down the function to only handle the case with ESR_ELx_EC_WATCHPT_LOW with a simple 'if' check. Suggested-by: Marc Zyngier Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210823223940.1878930-1-rananta@google.com commit 3f60c32f15b0d2956074d684526b128505be0bb7 Author: Saurav Girepunje Date: Sun Aug 22 01:53:08 2021 +0530 staging: r8188eu: core: remove condition with no effect Remove the condition with no effect (if == else) in rtw_led.c file. Acked-by: Phillip Potter Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YSFgrLUfXzgcT6k4@user Signed-off-by: Greg Kroah-Hartman commit f7766f1b0030e7af179a5e75df52838268102fab Author: Michael Straube Date: Tue Aug 24 14:36:21 2021 +0200 staging: r8188eu: remove ethernet.h header file There are only two definitions from ethernet.h used in the driver. Namely: #define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ #define LLC_HEADER_SIZE 6 /* LLC Header Length */ Both are only used in the file core/rtw_recv.c. Replace the usage of ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE into rtw_recv.h and remove the now unused ethernet.h header file. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210824123621.10801-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f09dc911bd26c26bee20e349eb19eaf861c27aab Author: Michael Straube Date: Tue Aug 24 14:36:20 2021 +0200 staging: r8188eu: remove ip.h header file The struct ip_options declared in ip.h is only unsed in the optlength macro which is also defined in ip.h and not used in the driver code. All other definitions/declarations in ip.h are duplicated from . Remove the ip.h header file and its includes. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210824123621.10801-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 68ad97bc5a1b9b5b2c3717ae8c5ca1071d3a88f5 Author: Michael Straube Date: Tue Aug 24 14:36:19 2021 +0200 staging: r8188eu: remove if_ether.h header file All constants, declarations and macros in if_ether.h are either duplicated from or unused. Remove the file if_ether.h and its includes. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210824123621.10801-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f228d1d50904e6a9ac91560578b935b1d853122b Author: Pavel Skripkin Date: Mon Aug 23 21:40:59 2021 +0300 staging: r8188eu: make rtw_deinit_intf_priv return void rtw_deinit_intf_priv() always return success, so there is no need in return value Acked-by: Michael Straube Acked-by: Phillip Potter Acked-by: Martin Kaiser Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20210823184059.19742-1-paskripkin@gmail.com Signed-off-by: Greg Kroah-Hartman commit bd5f258affb124a5bd9d3be94628951b0a8a14c6 Author: Michael Straube Date: Mon Aug 23 14:01:06 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in os_dep/recv_linux.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, the buffer is properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0b704920fba990ad6d0e731f315c71a2422d02cb Author: Michael Straube Date: Mon Aug 23 14:01:05 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in hal/rtl8188eu_xmit.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, the buffer is properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 544984a774f2802c928c92358106f9863fe112ab Author: Michael Straube Date: Mon Aug 23 14:01:04 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, all buffers are properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d4fe65101b5216838c1d92e6c39a150fc72c837 Author: Michael Straube Date: Mon Aug 23 14:01:03 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in core/rtw_security.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, all buffers are properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d0624c3379a17b9c6c267378831cdaa60c0af835 Author: Michael Straube Date: Mon Aug 23 14:01:02 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in core/rtw_recv.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, all buffers are properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 129f4197f22d407d47d05babb538bef7339c6cdb Author: Michael Straube Date: Mon Aug 23 14:01:01 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in core/rtw_mp.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, the buffer is properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 08cff18916f5a1d918a902d1f8fe1ef76c2520d4 Author: Michael Straube Date: Mon Aug 23 14:01:00 2021 +0200 staging: r8188eu: use is_multicast_ether_addr in core/rtw_mlme.c Use is_multicast_ether_addr instead of custom macro IS_MCAST, the buffer is properly aligned. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8aa824f2ec1b66fdbf7e5b87e519bced35a35114 Author: Michael Straube Date: Mon Aug 23 14:00:59 2021 +0200 staging: r8188eu: ensure proper alignment for eth address buffers Add __aligned(2) to eth address buffers in structs rx_pkt_attrib and pkt_attrib to ensure proper alignment for usage with functions from Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823120106.9633-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2a3afb168ea7002884ce7e56f5c2e061420a3bcf Author: Michael Straube Date: Sun Aug 22 13:40:14 2021 +0200 staging: r8188eu: remove unnecessary parentheses Remove unnecessary parentheses to improve readability. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210822114014.21584-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9f72f7f722e32d8f5645e53c1ca90347dedc95c Author: Michael Straube Date: Sun Aug 22 13:40:13 2021 +0200 staging: r8188eu: remove dead code if (0) is never true, remove code that is never executed. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210822114014.21584-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3eaa30d1623e109143c2e30b5738720c1816b851 Author: Michael Straube Date: Mon Aug 23 21:30:28 2021 +0200 staging: r8188eu: remove 5 GHz code The driver is for chips that do not operate in the 5 GHz band. Remove some 5 GHz related code. Acked-by: Phillip Potter Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210823193028.12391-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8d82693b0b562086935d23b55877d007b03c532a Author: Michael Straube Date: Sat Aug 21 17:51:51 2021 +0200 staging: r8188eu: remove cmd_osdep.h header file All functions declared in the cmd_osdep.h header file are only used in a single c source file. Make the functions static and remove the header file and its includes. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210821155151.25822-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6ca88cb5e8478e6694b4cccfb2d331435d5bb77c Author: Larry Finger Date: Sat Aug 21 10:14:59 2021 -0500 staging: r8188eu: Make mult-byte entities in dhcp header be big endian The 16- and 32-bit quantities in the dhcp message definition must be big endian. Acked-by: Phillip Potter Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210821151459.26078-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit e92e5f30ad320474346bfd5884cf170ad8c88968 Author: Phillip Potter Date: Sat Aug 21 11:56:15 2021 +0100 staging: r8188eu: change declaration of Efuse_Read1ByteFromFakeContent Remove forward declaration of Efuse_Read1ByteFromFakeContent function from core/rtw_efuse.c, as the function is defined in full directly after this and therefore this forward declaration is redundant. In addition, convert the storage class of the function to static, as the function is only used with rtw_efuse.c, and tidy up the signature alignment. Acked-by: Fabio M. De Francesco Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210821105615.6307-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 2d29f81ce82208626f4278d6aa9faa5547c5bf02 Author: Xiangyang Zhang Date: Sat Aug 21 16:18:24 2021 +0800 staging: r8188eu: Fix a resource leak in update_bcn_wps_ie The "pbackup_remainder_ie" variable is not freed when "pwps_ie_src" is null Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Acked-by: Michael Straube Signed-off-by: Xiangyang Zhang Link: https://lore.kernel.org/r/20210821081824.14745-1-xyz.sun.ok@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5598e47a79b4300ba3ff2a8c7f44a4f8ed4af20d Author: Martin Kaiser Date: Sat Aug 21 18:48:59 2021 +0200 staging: r8188eu: set pipe only once Set the pipe for reading or writing in usbctrl_vendorreq only once. There's no need to set it again for every retry. This patch is an adaptation of commit 889ed8b5e374 ("staging: rtl8188eu: set pipe only once") for the new r8188eu driver. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f7231a04e4f12757ca46d99dd6e7b71deea25300 Author: Martin Kaiser Date: Sat Aug 21 18:48:58 2021 +0200 staging: r8188eu: remove unused members of struct _io_ops Remove function pointers which are not used by the r8188eu driver. Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 22d0d6104e4d6c7d86ade11888422762db15ab75 Author: Martin Kaiser Date: Sat Aug 21 18:48:57 2021 +0200 staging: r8188eu: clean up the usb_writeN Remove unnecessary variables, check the length. Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e8baed3c765e0f88f4107c52a3505f52d174b41f Author: Martin Kaiser Date: Sat Aug 21 18:48:56 2021 +0200 staging: r8188eu: clean up the usb_writeXY functions Remove unnecessary variables, summarize declarations and assignments. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0d3e1be506dda7a0a3d43fad4d943cfbfabadd39 Author: Martin Kaiser Date: Sat Aug 21 18:48:55 2021 +0200 staging: r8188eu: clean up the usb_readXY functions Remove unnecessary variables, summarize declarations and assignments. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2214ea8299f5dcf1201521ab527b750ec53fbba8 Author: Martin Kaiser Date: Sat Aug 21 18:48:54 2021 +0200 staging: r8188eu: remove an unused enum The VENDOR_READ and VENDOR_WRITE defines are not used. Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f410923ad5f577d08bad22bdb11d9660a2a75d25 Author: Martin Kaiser Date: Sat Aug 21 18:48:53 2021 +0200 staging: r8188eu: rewrite usb vendor request defines Replace the numeric values with USB constants to make their meaning clearer. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 805ac0da01f867d5b3412a77110e970063f698c0 Author: Martin Kaiser Date: Sat Aug 21 18:48:52 2021 +0200 staging: rtl8188eu: use actual request type as parameter At the moment, usbctrl_vendorreq's requesttype parameter must be set to 1 for reading and 0 for writing. It's then converted to the actual bmRequestType for the USB control request. We can simplify the code and avoid this conversion if the caller passes the actual bmRequestType. This patch is an adaptation of commit 788fde031027 ("staging: rtl8188eu: use actual request type as parameter") for the new r8188eu driver. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 74f64654ecd22f8e29580f93435406622c90d975 Author: Martin Kaiser Date: Sat Aug 21 18:48:51 2021 +0200 staging: r8188eu: remove unused define _HCI_OPS_OS_C_ is not used in the r8188eu driver. Remove it. Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 65945da601e816875426b5866746ced4acbc85e6 Author: Martin Kaiser Date: Sat Aug 21 18:48:50 2021 +0200 staging: r8188eu: remove unnecessary cast name is a const char * by default. This type should be ok for r8188eu. Acked-by: Phillip Potter Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210821164859.4351-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9bfb54a8c88e025b9ae1fe19afd6500a206dbba5 Author: Michael Straube Date: Wed Aug 25 12:08:42 2021 +0200 staging: rtl8723bs: remove header file ethernet.h The header file ehternet.h defines only two constants. #define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ #define LLC_HEADER_SIZE 6 /* LLC Header Length */ Both are only used in the file core/rtw_recv.c and ETHERNET_HEADER_SIZE just duplicates the in-kernel constant ETH_HLEN. Replace the usage of ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE into rtw_rev.h (renamed to LLC_HEADER_LENGTH) and remove the now unused header file ethernet.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210825100842.13217-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 07e7f36da8abb4563d145399270c0b92f8d79ff7 Author: Len Baker Date: Tue Aug 24 11:00:39 2021 +0200 staging/rtl8192u: 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. In this case these aren't actually dynamic sizes: both sides of the multiplication are constant values. However it is best to refactor these anyway, just to keep the open-coded math idiom out of code. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Reviewed-by: Kees Cook Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210824090039.GA7999@titan Signed-off-by: Greg Kroah-Hartman commit c4b30776bf2941e0d17d3f164e54e553b2456888 Author: Len Baker Date: Tue Aug 24 10:59:58 2021 +0200 staging/rtl8192u: Initialize variables in the definition block Initialize the pre_cmd_cnt, post_cmd_cnt and rf_cmd_cnt variables in the definition block as it is not necessary to do this in the middle of the function. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210824073643.GA7396@titan Signed-off-by: Greg Kroah-Hartman commit 7dfe9fac786769e1a49fa350158d39b4fef237ba Author: Len Baker Date: Tue Aug 24 09:25:43 2021 +0200 staging/rtl8192u: Avoid CamelCase in names of variables Avoid CameCase in the names of all local variables inside the function rtl8192_phy_SwChnlStepByStep(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210824072545.7321-2-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 07abf8b41eaf28ea6e342730b91d5a62fa914431 Author: Fabio Aiuto Date: Mon Aug 23 16:12:03 2021 +0200 staging: rtl8723bs: remove unused rtw_set_802_11_bssid() function remove rtw_set_802_11_bssid() function left unused after wext routines removal. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/b3d1756b6ae4be7ca4fc50e12bd7e10587a6020c.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit b516456cedb66439f33c8878f73bf5dad0223471 Author: Fabio Aiuto Date: Mon Aug 23 16:12:02 2021 +0200 staging: rtl8723bs: remove functions notifying wext events remove functions that once were meant to notify wext events to userspace. Now they are donig nothing useful so just remove them. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0d745350ff3d411dda329b8c1e2261361570db6e.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 105bc6b94f0587f1d37c5f3581f94455a2e52722 Author: Fabio Aiuto Date: Mon Aug 23 16:12:01 2021 +0200 staging: rtl8723bs: fix logical continuation issue fix the following post-commit hook checkpatch issue: CHECK: Logical continuations should be on the previous line 52: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389: + if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ CHECK: Logical continuations should be on the previous line 53: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390: + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ + || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5d4e7ab18005e69e8cc162619149d6fa93568875.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit fafb8a21a5c9b899b251994332da1eae01bf44ef Author: Fabio Aiuto Date: Mon Aug 23 16:12:00 2021 +0200 staging: rtl8723bs: fix code indent issues fix the following post commit hook checkpatch issues: ERROR: code indent should use tabs where possible 2463: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:388: + if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_$ ERROR: code indent should use tabs where possible 2464: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389: + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_$ ERROR: code indent should use tabs where possible 2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390: + || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)$ ERROR: code indent should use tabs where possible 2466: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:391: + /* WPS open need to enable multicast */$ ERROR: code indent should use tabs where possible 2467: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:392: + /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */$ ERROR: code indent should use tabs where possible 2468: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:393: + rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);$ Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/aa394052c8d81b4a00356adf5f98fc3c81f8b1d9.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 174ac41a7aafb31041cba3fe54ccd89b9daeef5d Author: Fabio Aiuto Date: Mon Aug 23 16:11:59 2021 +0200 staging: rtl8723bs: remove obsolete wext support cfg80211 has been fully implemented so remove all wext and wext private handlers and their registration. Now wext userspace calls can be managed via cfg80211 wext compatibility. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/61c4bb20bbb6ce30e4ddd01aa73de3f686a99445.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7d761b084b3c785e1fbbe707fbdf7baba905c6ad Author: Sergio Paracuellos Date: Mon Aug 23 19:08:03 2021 +0200 staging: mt7621-pci: fix hang when nothing is connected to pcie ports When nothing is connected to pcie ports, each port is set to reset state. When this occurs, next access result in a hang on boot as follows: mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK) mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK) [ HANGS HERE ] Fix this just detecting 'nothing is connected state' to avoid next accesses to pcie port related configuration registers. Fixes: b99cc3a2b6b6 ("staging: mt7621-pci: avoid custom 'map_irq' function") Cc: stable Reported-by: DENG Qingfang Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20210823170803.2108-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8b325d2a099e6fa0f3e1113fc1e7b590360594fa Merge: 723783d077e39 90bd5bee50f2a Author: David S. Miller Date: Thu Aug 26 10:47:43 2021 +0100 Merge tag 'mac80211-next-for-net-next-2021-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== A few more things: * Use correct DFS domain for self-managed devices * some preparations for transmit power element handling and other 6 GHz regulatory handling * TWT support in AP mode in mac80211 ==================== Signed-off-by: David S. Miller commit 723783d077e39c256a1fafebbd97cbb14207c28f Author: Yunsheng Lin Date: Thu Aug 26 10:49:47 2021 +0800 sock: remove one redundant SKB_FRAG_PAGE_ORDER macro Both SKB_FRAG_PAGE_ORDER are defined to the same value in net/core/sock.c and drivers/vhost/net.c. Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h, as both net/core/sock.c and drivers/vhost/net.c include it, and it seems a reasonable file to put the macro. Signed-off-by: Yunsheng Lin Acked-by: Jason Wang Signed-off-by: David S. Miller commit 9fdbbe8443a372088c809eb8f2cf4488a41333e8 Merge: bb4544c6d415d c387eea58f931 Author: Arnd Bergmann Date: Thu Aug 26 11:45:06 2021 +0200 Merge tag 'zynq-dt-for-v5.15' of https://github.com/Xilinx/linux-xlnx into arm/dt ARM: dts: Zynq DT changes for v5.15 - Enable nand flash controller for ebaz4205 board * tag 'zynq-dt-for-v5.15' of https://github.com/Xilinx/linux-xlnx: ARM: dts: ebaz4205: enable NAND support ARM: dts: zynq: add NAND flash controller node Link: https://lore.kernel.org/r/f3dc69c8-8a22-e938-4ddf-b1052b8c1437@monstr.eu Signed-off-by: Arnd Bergmann commit 5e8243e66b4d80eeaf9ed8cb0235ff133630a014 Author: Yang Yingliang Date: Wed Aug 25 14:34:47 2021 +0800 octeontx2-pf: cn10k: Fix error return code in otx2_set_flowkey_cfg() If otx2_mbox_get_rsp() fails, otx2_set_flowkey_cfg() need return an error code. Fixes: e7938365459f ("octeontx2-pf: Fix algorithm index in MCAM rules with RSS action") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit bb4544c6d415d42018ecd67826c0ac714bf86b7d Merge: c4d3928250de9 9d508827c7939 Author: Arnd Bergmann Date: Thu Aug 26 11:37:55 2021 +0200 Merge tag 'v5.15-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt io-domains for rk3188 and rv1108, sfc (flash) support fpr rv1108 and some cleanups. * tag 'v5.15-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Add SFC to RV1108 ARM: dts: rockchip: add io-domains nodes to rv1108.dtsi ARM: dts: rockchip: add io-domains node to rk3188.dtsi ARM: dts: rockchip: remove interrupt-names from iommu nodes ARM: dts: rockchip: rename timer compatible strings for rk3066a ARM: dts: rockchip: add space after &grf on rk3188 ARM: dts: rockchip: rename pcfg_* nodenames for rk3066/rk3188 Link: https://lore.kernel.org/r/4142796.VLH7GnMWUR@phil Signed-off-by: Arnd Bergmann commit 79cd0bb66e359f5f9398de9d2e86eac776947691 Merge: 07e7e1c9969ff 75b4c5deef011 Author: Arnd Bergmann Date: Thu Aug 26 11:32:31 2021 +0200 Merge tag 'zynq-soc-for-v5.15' of https://github.com/Xilinx/linux-xlnx into arm/defconfig ARM: dts: Zynq SoC changes for v5.15 - Enable PL35X nand driver in multi_v7_defconfig * tag 'zynq-soc-for-v5.15' of https://github.com/Xilinx/linux-xlnx: ARM: configs: multi_v7: enable PL35x NAND controller Link: https://lore.kernel.org/r/5a25f882-103f-4df0-0d90-868d264c900b@monstr.eu Signed-off-by: Arnd Bergmann commit 51e321fed0ff8d64eff809a4ee0547254cdcc4a1 Author: Yang Yingliang Date: Wed Aug 25 09:42:14 2021 +0930 soc: aspeed-lpc-ctrl: Fix clock cleanup in error path Move syscon_regmap_lookup_by_compatible() above the devm_clk_get() to avoid missing clk_disable_unprepare(). Fixes: 2f9b25fa6682 ("soc: aspeed: Re-enable FWH2AHB on AST2600") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Joel Stanley Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210824085522.1849410-1-yangyingliang@huawei.com Link: https://lore.kernel.org/r/20210825001214.3056193-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit 06779631d18ff2901af604eadea0d7b2193db7a1 Merge: 9b3878a99ad60 09f3824342f66 Author: Arnd Bergmann Date: Thu Aug 26 11:29:06 2021 +0200 Merge tag 'reset-for-v5.15' of git://git.pengutronix.de/pza/linux into arm/drivers Reset controller updates for v5.15 Add support for the SC7280 PDC Global and RZ/G2L USB/PHY reset controllers, convert UniPhier glue device tree bindings to json-schema and remove a leftover mention of ZTE zx2967 from Kconfig. * tag 'reset-for-v5.15' of git://git.pengutronix.de/pza/linux: reset: simple: remove ZTE details in Kconfig help reset: renesas: Add RZ/G2L usbphy control driver dt-bindings: reset: Document RZ/G2L USBPHY Control bindings dt-bindings: reset: Convert UniPhier glue reset to json-schema reset: qcom: Add PDC Global reset signals for WPSS dt-bindings: reset: pdc: Add PDC Global bindings dt-bindings: reset: aoss: Add AOSS reset controller binding Link: https://lore.kernel.org/r/d42a75fc17ce718ef1b3fa4c5d3f5c7fb0bd2bc2.camel@pengutronix.de Signed-off-by: Arnd Bergmann commit 9b3878a99ad606fe76a50a290273d7b801f0f895 Merge: 5c785014b67fb 9e5747c57807a Author: Arnd Bergmann Date: Thu Aug 26 11:17:45 2021 +0200 Merge tag 'v5.15-rockchip-driver1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/drivers Yaml conversion of io-domain bindings and addition of rk3568 io domains. * tag 'v5.15-rockchip-driver1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc: rockchip: io-domain: Remove unneeded semicolon soc: rockchip: io-domain: add rk3568 support dt-bindings: power: add rk3568-pmu-io-domain support dt-bindings: soc: rockchip: add rockchip-io-domain.yaml object to grf.yaml dt-bindings: power: convert rockchip-io-domain.txt to YAML soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally Link: https://lore.kernel.org/r/9718620.EvYhyI6sBW@phil Signed-off-by: Arnd Bergmann commit 90bd5bee50f2a209ba66f013866959a56ff400b9 Author: Sriram R Date: Thu Aug 26 05:08:50 2021 +0530 cfg80211: use wiphy DFS domain if it is self-managed Currently during CAC start or other radar events, the DFS domain is fetched from cfg based on global DFS domain, even if the wiphy regdomain disagrees. But this could be different in case of self managed wiphy's in case the self managed driver updates its database or supports regions which has DFS domain set to UNSET in cfg80211 local regdomain. So for explicitly self-managed wiphys, just use their DFS domain. Signed-off-by: Sriram R Link: https://lore.kernel.org/r/1629934730-16388-1-git-send-email-srirrama@codeaurora.org Signed-off-by: Johannes Berg commit 366e7ad6ba5f4cb2ffd0b7316e404d6ee9c0f401 Author: Ingo Molnar Date: Thu Aug 26 10:47:09 2021 +0200 sched/fair: Mark tg_is_idle() an inline in the !CONFIG_FAIR_GROUP_SCHED case It's not actually used in the !CONFIG_FAIR_GROUP_SCHED case: kernel/sched/fair.c:488:12: warning: ‘tg_is_idle’ defined but not used [-Wunused-function] Keep around a placeholder nevertheless, for API completeness. Mark it inline, so the compiler doesn't think it must be used. Fixes: 304000390f88: ("sched: Cgroup SCHED_IDLE support") Signed-off-by: Ingo Molnar Cc: Josh Don Cc: Peter Zijlstra (Intel) Cc: Vincent Guittot commit a69bbd2f77a6e26b2b1c3d7fcc5c715169dc01c5 Author: Michael Straube Date: Thu Aug 19 13:22:00 2021 +0200 staging: r8188eu: remove unused function rtw_remove_bcn_ie() Function rtw_remove_bcn_ie() is not used anywhere, remove it. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210819112200.32030-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fbdbd861c8be66dc6d87f3bdeaec41d7a8efde9a Author: Michael Straube Date: Thu Aug 19 13:21:59 2021 +0200 staging: r8188eu: remove unused function rtw_add_bcn_ie() Function rtw_add_bcn_ie() is not used anywhere, remove it. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210819112200.32030-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 30e98ce81bbb51f78134dbeca232f1d4ab215434 Author: Yang Li Date: Fri Aug 20 17:08:25 2021 +0800 staging: r8188eu: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c:73:66-67: Unneeded semicolon ./drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:2225:68-69: Unneeded semicolon ./drivers/staging/r8188eu/core/rtw_xmit.c:615:75-76: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/1629450505-28247-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman commit b13cead1eca5d8f26eda6c85fb0d6f618f154cdb Merge: 7fe2f1bc15be0 a0c007b3f6455 Author: David S. Miller Date: Thu Aug 26 09:41:50 2021 +0100 Merge branch 'ionic-next' Shannon Nelson says: ==================== ionic: queue and filter mgmt updates After a pair of simple code cleanups, we change the mac filter management to split the updates between the driver's filter list and the device's filter list so that we can keep the calls to dev_uc_sync() and dev_mc_sync() under the netif_addr_lock in ndo_set_rx_mode, and then sync the driver's list to the device later in the rx_mode work task. ==================== Signed-off-by: David S. Miller commit a0c007b3f6455641c5ba7fb5c474401d82387121 Author: Shannon Nelson Date: Wed Aug 25 18:24:50 2021 -0700 ionic: handle mac filter overflow Make sure we go into PROMISC mode when we have too many filters by specifically counting the filters that successfully get saved to the firmware. The device advertises max_ucast_filters and max_mcast_filters, but really only has max_ucast_filters slots available for uc and mc filters combined. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 8b41517313e571344a116cb75f8fc994c5447ffb Author: Shannon Nelson Date: Wed Aug 25 18:24:49 2021 -0700 ionic: refactor ionic_lif_addr to remove a layer The filter counting in ionic_lif_addr() really isn't useful, and potentially misleading, especially when we're checking in ionic_lif_rx_mode() to see if we need to go into PROMISC mode. We can safely refactor this and remove a calling layer. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 969f843946041a8ac10a5af06127a68ab7880ad5 Author: Shannon Nelson Date: Wed Aug 25 18:24:48 2021 -0700 ionic: sync the filters in the work task In order to separate the atomic needs of __dev_uc_sync() and __dev_mc_sync() from the safe rx_mode handling, we need to have the ndo handler manipulate the driver's filter list, and later have the driver sync the filters to the firmware, outside of the atomic context. Here we put __dev_mc_sync() and __dev_uc_sync() back into the ndo callback to give them their netif_addr_lock context and have them update the driver's filter list, flagging changes that should be made to the device filter list. Later, in the rx_mode handler, we read those hints and sync up the device's list as needed. It is possible for multiple add/delete requests to come from the stack before the rx_mode task processes the list, but the handling of the sync status flag should keep everything sorted correctly. For example, if a delete of an existing filter is followed by another add before the rx_mode task is run, as can happen when going in and out of a bond, the add will cancel the delete and no actual changes will be sent to the device. We also add a check in the watchdog to see if there are any stray unsync'd filters, possibly left over from a filter overflow and waiting to get sync'd after some other filter gets removed to make room. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit b941ea057177daf7dd661959803f351808754e6e Author: Shannon Nelson Date: Wed Aug 25 18:24:47 2021 -0700 ionic: flatten calls to set-rx-mode Since only two functions call through ionic_set_rx_mode(), one that can sleep and one that can't, we can split the function and put the bits of code into the callers. This removes an unnecessary calling layer. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 56c8a53b6280732a6e8ae386eec09ca97c9c5373 Author: Shannon Nelson Date: Wed Aug 25 18:24:46 2021 -0700 ionic: remove old work task types With the move of mac filter handling to outside of the ndo_rx_mode context using the IONIC_DW_TYPE_RX_MODE, we no longer are using IONIC_DW_TYPE_RX_ADDR_ADD and IONIC_DW_TYPE_RX_ADDR_DEL and they can be removed. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 86a0727b096dfeb90c10e74b4d6e70c1c237b29a Author: Kees Cook Date: Thu Aug 19 10:45:37 2021 -0700 staging: wlan-ng: Avoid duplicate header in tx/rx frames Instead of open-coding the same header details in the tx/rx frames, directly include the actual struct. Rename associated variables to the more verbose of the two versions. This also has the benefit of being able to replace a field-spanning memcpy() with a direct assignment, helping clear the way for coming FORTIFY_SOURCE improvements. "diffoscope" reports no object code differences after this change, excepting the selection of different registers when switching from memcpy() to direct assignment: --- drivers/staging/wlan-ng/prism2usb.o.before +++ drivers/staging/wlan-ng/prism2usb.o.after ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {} │ @@ -4887,24 +4887,24 @@ │ sub %rdi,%rcx │ add $0x3c,%ecx │ shr $0x3,%ecx │ rep stos %rax,%es:(%rdi) │ mov $0x8,%eax │ movl $0x123,0x23e(%rbx) │ mov %ax,0x244(%rbx) │ - mov (%rdx),%rcx │ - mov %rcx,0x246(%rbx) │ - mov 0x8(%rdx),%rcx │ - mov %rcx,0x24e(%rbx) │ - mov 0x10(%rdx),%rcx │ - mov %rcx,0x256(%rbx) │ - mov 0x18(%rdx),%ecx │ - mov %ecx,0x25e(%rbx) │ - movzwl 0x1c(%rdx),%edx │ - mov %dx,0x262(%rbx) │ + mov (%rdx),%rax │ + mov %rax,0x246(%rbx) │ + mov 0x8(%rdx),%rax │ + mov %rax,0x24e(%rbx) │ + mov 0x10(%rdx),%rax │ + mov %rax,0x256(%rbx) │ + mov 0x18(%rdx),%eax │ + mov %eax,0x25e(%rbx) │ + movzwl 0x1c(%rdx),%eax │ + mov %ax,0x262(%rbx) │ cmpq $0x0,0x0(%rbp) │ movzwl 0x70(%rsi),%eax │ je 477a │ add $0x8,%eax │ mov $0x44,%r12d │ mov %ax,0x264(%rbx) │ mov 0x70(%r13),%edx Cc: Romain Perier Cc: Allen Pais Cc: Ivan Safonov Cc: Arnd Bergmann Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210819174537.3499227-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 6277fbfdd29ca2fbf5da33e3931087b5356c770b Author: Kees Cook Date: Thu Aug 19 10:45:36 2021 -0700 staging: wlan-ng: Remove pointless a3/a4 union There is no need for the a3/a4 union. The two structs are identical except for the addition of a4. Excepting one place, the structs are only ever used in the union, and the union is always allocated at full size. The one instance of the a3-specific struct can be replaced with the full version, as no sizing information is used. Replace the union with the a4 version of the struct. "diffoscope" reports there are no object code differences after this change. Cc: Allen Pais Cc: Romain Perier Cc: Chen Lin Cc: Ivan Safonov Cc: Arnd Bergmann Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210819174537.3499227-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 55cdf7d7b2a187d0c2bcf11ed70e2eeb192713da Author: Michael Straube Date: Thu Aug 19 17:29:14 2021 +0200 staging: r8188eu: use GFP_ATOMIC under spinlock kmalloc() in function update_bcn_wps_ie() is called under a spinlock so the allocation have to be atomic. -> update_beacon() <- takes a spinlock -> update_bcn_vendor_spec_ie() -> update_bcn_wps_ie() Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()") Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210819152914.17482-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 89b9f3f39a088a7a0f833621dc62acb201a37ac5 Author: Michael Straube Date: Thu Aug 19 11:24:23 2021 +0200 staging: r8188eu: fix scheduling while atomic bugs These allocations are sometimes done under a spin lock so they have to be atomic. The function call tree is: -> update_beacon() <- takes a spin lock -> update_BCNTIM() -> set_tx_beacon_cmd() Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()") Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210819092423.4349-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b0345850ad770c5164bf6d4a0aa0c40ef2419cb0 Author: Wen Gong Date: Fri Aug 20 08:20:40 2021 -0400 mac80211: parse transmit power envelope element Parse and store the transmit power envelope element. Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20210820122041.12157-8-wgong@codeaurora.org Signed-off-by: Johannes Berg commit ad31393b98e4addbc5f1ccc484bfbb8d07c92056 Author: Wen Gong Date: Fri Aug 20 08:20:39 2021 -0400 ieee80211: add definition for transmit power envelope element IEEE Std 802.11ax™-2021 makes changes to the transmit power envelope element, adjust the code accordingly. Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20210820122041.12157-7-wgong@codeaurora.org Signed-off-by: Johannes Berg commit a1ef61825469b874920f4afb889e1a92353680ff Author: Wen Gong Date: Fri Aug 20 08:20:35 2021 -0400 ieee80211: add definition of regulatory info in 6 GHz operation information IEEE Std 802.11ax™-2021 added regulatory info subfield in HE operation element, add it to the header file. Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20210820122041.12157-3-wgong@codeaurora.org Signed-off-by: Johannes Berg commit 7fe2f1bc15be08779246f1d46efbaec8b141c9b7 Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:59 2021 +0200 nfc: st95hf: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 994a63434133fdfcf1faea7d9daf3451afdff237 Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:58 2021 +0200 nfc: st21nfca: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 2603ca8720409667e2250f370ea2827c073336df Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:57 2021 +0200 nfc: st-nci: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 9b3f66bc0eca844bf269befdd620ecf527170e20 Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:56 2021 +0200 nfc: pn544: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit d8eb4eb0ef1da9f6792cd749378be425278ba973 Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:55 2021 +0200 nfc: mrvl: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit ffb239e29518578c45f278fccd32db958ff59174 Author: Krzysztof Kozlowski Date: Wed Aug 25 16:24:54 2021 +0200 nfc: microread: remove unused header includes Do not include unnecessary headers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit a65ab973c1669d3edc27719527bb3906f7b09918 Author: Utkarsh Verma Date: Wed Aug 25 21:53:02 2021 +0530 USB: serial: replace symbolic permissions by octal permissions Replace symbolic permission macros with octal permission numbers because octal permission numbers are easier to read and understand instead of their symbolic macro names. No functional change. Suggested-by: Lukas Bulwahn Signed-off-by: Utkarsh Verma Signed-off-by: Johan Hovold commit 6a371bafe613b7746c3d3ac486bdb3035f77e029 Author: Kim Phillips Date: Tue Aug 17 17:10:48 2021 -0500 perf/x86/amd/ibs: Add bitfield definitions in new header Add with bitfield definitions for IBS MSRs, and demonstrate usage within the driver. Also move 'struct perf_ibs_data' where it can be shared with the perf tool that will soon be using it. No functional changes. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-9-kim.phillips@amd.com commit 05485745ad482c1910a45f23a5c255f6a0df0f46 Author: Kim Phillips Date: Tue Aug 17 17:10:47 2021 -0500 perf/amd/uncore: Allow the driver to be built as a module Add support to build the AMD uncore driver as a module. This is in order to facilitate development without having to reboot the kernel in most cases. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-8-kim.phillips@amd.com commit 9164d9493a792682143af12b182be12d7c32b195 Author: Kim Phillips Date: Tue Aug 17 17:10:46 2021 -0500 x86/cpu: Add get_llc_id() helper function Factor out a helper function rather than export cpu_llc_id, which is needed in order to be able to build the AMD uncore driver as a module. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-7-kim.phillips@amd.com commit 0a0b53e0c3793c0930d258786702d48d21fc6383 Author: Kim Phillips Date: Tue Aug 17 17:10:45 2021 -0500 perf/amd/uncore: Clean up header use, use Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-6-kim.phillips@amd.com commit 6cf295b21608f9253037335f47cd0dfcce812d81 Author: Kim Phillips Date: Tue Aug 17 17:10:44 2021 -0500 perf/amd/uncore: Simplify code, use free_percpu()'s built-in check for NULL free_percpu() has its own check for NULL, no need to open-code it. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-5-kim.phillips@amd.com commit ffec09f9c7d7b21b0aff29dd5c3972f4631c0b6b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:54 2021 +0200 perf/hw_breakpoint: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210803141621.780504-12-bigeasy@linutronix.de commit eda8a2c599d1ff874a63de7684b430740e747dea Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:53 2021 +0200 perf/x86/intel: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210803141621.780504-11-bigeasy@linutronix.de commit 4f32da76a1401dcd088930f0ac8658425524368b Author: Colin Ian King Date: Wed Aug 4 12:57:10 2021 +0100 perf/x86: Remove unused assignment to pointer 'e' The pointer 'e' is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20210804115710.109608-1-colin.king@canonical.com commit 46466ae3a105d9620e1355e33125a413b8c6ce18 Merge: 3f2cbe3810a60 ccf26483416a3 Author: Ingo Molnar Date: Thu Aug 26 09:14:05 2021 +0200 Merge branch 'perf/urgent' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit a290f510a178830a01bfc06e66a54bbe4ece5d2a Author: Palmer Dabbelt Date: Wed Aug 25 22:52:45 2021 -0700 RISC-V: Fix VDSO build for !MMU We don't have a VDSO for the !MMU configurations, so don't try to build one. Fixes: fde9c59aebaf ("riscv: explicitly use symbol offsets for VDSO") Signed-off-by: Palmer Dabbelt commit 803930ee35fafd005fd978d0c0a0d8db5bcba654 Author: Jason Wang Date: Sat Aug 7 15:14:27 2021 +0800 riscv: 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: Palmer Dabbelt commit 7d8eb202719b967d4794e679bdb40017685e6515 Merge: 571a9233fcd44 c626f3864bbbb Author: Dave Airlie Date: Thu Aug 26 13:23:57 2021 +1000 Merge tag 'exynos-drm-next-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Two fixups - Fix missing unlock issue in exynos_drm_g2d.c - Fix a build warning in exynos_drm_dma.c One cleanup - Replace atomic_t with refcount_t in exynos_drm_g2d.c Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20210821172825.54720-1-inki.dae@samsung.com commit 571a9233fcd44309399ee273d7ce12dc49564839 Merge: 0def4b732b20e fed0289394173 Author: Dave Airlie Date: Thu Aug 26 13:05:10 2021 +1000 Merge tag 'drm/tegra/for-5.15-rc1' of ssh://git.freedesktop.org/git/tegra/linux into drm-next drm/tegra: Changes for v5.15-rc1 The bulk of these changes is a more modern ABI that can be efficiently used on newer SoCs as well as older ones. The userspace parts for this are available here: - libdrm support: https://gitlab.freedesktop.org/tagr/drm/-/commits/drm-tegra-uabi-v8 - VAAPI driver: https://github.com/cyndis/vaapi-tegra-driver In addition, existing userspace from the grate reverse-engineering project has been updated to use this new ABI: - X11 driver: https://github.com/grate-driver/xf86-video-opentegra - 3D driver: https://github.com/grate-driver/grate Other than that, there's also support for display memory bandwidth management for various generations and a bit of cleanup. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20210813163616.2822355-1-thierry.reding@gmail.com commit 0def4b732b20e7621b88f675d0e9f92f3219c1c9 Merge: 697b6e28d0e8e 81fd23e2b3ccf Author: Dave Airlie Date: Thu Aug 26 12:46:52 2021 +1000 Merge commit '81fd23e2b3ccf71c807e671444e8accaba98ca53' of https://git.pengutronix.de/git/lst/linux into drm-next things are still slow in etnaviv land. Just one hardware support addition for the GPU found on the NXP Layerscape LS1028A SoC from Michael and the GEM mmap cleanup from Thomas. Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/4d16197fa5e4147117fea842f1ed9f0fdadb1d57.camel@pengutronix.de commit eb529c5b10b9401a0f2d1f469e82c6a0ba98082c Author: Daniel Xu Date: Wed Aug 25 18:48:31 2021 -0700 bpf: Fix bpf-next builds without CONFIG_BPF_EVENTS This commit fixes linker errors along the lines of: s390-linux-ld: task_iter.c:(.init.text+0xa4): undefined reference to `btf_task_struct_ids'` Fix by defining btf_task_struct_ids unconditionally in kernel/bpf/btf.c since there exists code that unconditionally uses btf_task_struct_ids. Reported-by: kernel test robot Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/05d94748d9f4b3eecedc4fddd6875418a396e23c.1629942444.git.dxu@dxuuu.xyz commit 697b6e28d0e8ed87a0bc1bf1d2c1a3f3abbce9d3 Merge: 397ab98e2d69c 90a9266269eb9 Author: Dave Airlie Date: Thu Aug 26 12:18:26 2021 +1000 Merge tag 'amd-drm-next-5.15-2021-08-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.15-2021-08-20: amdgpu: - embed hw fence into job - Misc SMU fixes - PSP TA code cleanup - RAS fixes - PWM fan speed fixes - DC workqueue cleanups - SR-IOV fixes - gfxoff delayed work fix - Pin domain check fix amdkfd: - SVM fixes radeon: - Code cleanup Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210820172335.4190-1-alexander.deucher@amd.com commit 0584e965fb2517f41b7057ffa26f3b6e15a53754 Merge: 7d789bd0089ad 574ee20928675 Author: Alexei Starovoitov Date: Wed Aug 25 17:40:36 2021 -0700 Merge branch 'bpf: tcp: Allow bpf-tcp-cc to call bpf_(get|set)sockopt' Martin KaFai says: ==================== This set allows the bpf-tcp-cc to call bpf_setsockopt. One use case is to allow a bpf-tcp-cc switching to another cc during init(). For example, when the tcp flow is not ecn ready, the bpf_dctcp can switch to another cc by calling setsockopt(TCP_CONGESTION). bpf_getsockopt() is also added to have a symmetrical API, so less usage surprise. v2: - Not allow switching to kernel's tcp_cdg because it is the only kernel tcp-cc that stores a pointer to icsk_ca_priv. Please see the commit log in patch 1 for details. Test is added in patch 4 to check switching to tcp_cdg. - Refactor the logic finding the offset of a func ptr in the "struct tcp_congestion_ops" to prog_ops_moff() in patch 1. - bpf_setsockopt() has been disabled in release() since v1 (please see commit log in patch 1 for reason). bpf_getsockopt() is also disabled together in release() in v2 to avoid usage surprise because both of them are usually expected to be available together. bpf-tcp-cc can already use PTR_TO_BTF_ID to read from tcp_sock. ==================== Signed-off-by: Alexei Starovoitov commit 574ee209286755ae57449196bfa11a90d2d724e5 Author: Martin KaFai Lau Date: Tue Aug 24 10:30:26 2021 -0700 bpf: selftests: Add dctcp fallback test This patch makes the bpf_dctcp test to fallback to cubic by using setsockopt(TCP_CONGESTION) when the tcp flow is not ecn ready. It also checks setsockopt() is not available to release(). The settimeo() from the network_helpers.h is used, so the local one is removed. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210824173026.3979130-1-kafai@fb.com commit 3d7789831df9bda0941bda41cface6687b7c3e04 Author: Martin KaFai Lau Date: Tue Aug 24 10:30:19 2021 -0700 bpf: selftests: Add connect_to_fd_opts to network_helpers The next test requires to setsockopt(TCP_CONGESTION) before connect(), so a new arg is needed for the connect_to_fd() to specify the cc's name. This patch adds a new "struct network_helper_opts" for the future option needs. It starts with the "cc" and "timeout_ms" option. A new helper connect_to_fd_opts() is added to take the new "const struct network_helper_opts *opts" as an arg. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210824173019.3977910-1-kafai@fb.com commit 700dcf0f447691f35abc7121f234457f90fcfb1c Author: Martin KaFai Lau Date: Tue Aug 24 10:30:13 2021 -0700 bpf: selftests: Add sk_state to bpf_tcp_helpers.h Add sk_state define to bpf_tcp_helpers.h. Rename the existing global variable "sk_state" in the kfunc_call test to "sk_state_res". Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210824173013.3977316-1-kafai@fb.com commit eb18b49ea758ec052ac2a12c6bb204e1e877ec31 Author: Martin KaFai Lau Date: Tue Aug 24 10:30:07 2021 -0700 bpf: tcp: Allow bpf-tcp-cc to call bpf_(get|set)sockopt This patch allows the bpf-tcp-cc to call bpf_setsockopt. One use case is to allow a bpf-tcp-cc switching to another cc during init(). For example, when the tcp flow is not ecn ready, the bpf_dctcp can switch to another cc by calling setsockopt(TCP_CONGESTION). During setsockopt(TCP_CONGESTION), the new tcp-cc's init() will be called and this could cause a recursion but it is stopped by the current trampoline's logic (in the prog->active counter). While retiring a bpf-tcp-cc (e.g. in tcp_v[46]_destroy_sock()), the tcp stack calls bpf-tcp-cc's release(). To avoid the retiring bpf-tcp-cc making further changes to the sk, bpf_setsockopt is not available to the bpf-tcp-cc's release(). This will avoid release() making setsockopt() call that will potentially allocate new resources. Although the bpf-tcp-cc already has a more powerful way to read tcp_sock from the PTR_TO_BTF_ID, it is usually expected that bpf_getsockopt and bpf_setsockopt are available together. Thus, bpf_getsockopt() is also added to all tcp_congestion_ops except release(). When the old bpf-tcp-cc is calling setsockopt(TCP_CONGESTION) to switch to a new cc, the old bpf-tcp-cc will be released by bpf_struct_ops_put(). Thus, this patch also puts the bpf_struct_ops_map after a rcu grace period because the trampoline's image cannot be freed while the old bpf-tcp-cc is still running. bpf-tcp-cc can only access icsk_ca_priv as SCALAR. All kernel's tcp-cc is also accessing the icsk_ca_priv as SCALAR. The size of icsk_ca_priv has already been raised a few times to avoid extra kmalloc and memory referencing. The only exception is the kernel's tcp_cdg.c that stores a kmalloc()-ed pointer in icsk_ca_priv. To avoid the old bpf-tcp-cc accidentally overriding this tcp_cdg's pointer value stored in icsk_ca_priv after switching and without over-complicating the bpf's verifier for this one exception in tcp_cdg, this patch does not allow switching to tcp_cdg. If there is a need, bpf_tcp_cdg can be implemented and then use the bpf_sk_storage as the extended storage. bpf_sk_setsockopt proto has only been recently added and used in bpf-sockopt and bpf-iter-tcp, so impose the tcp_cdg limitation in the same proto instead of adding a new proto specifically for bpf-tcp-cc. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210824173007.3976921-1-kafai@fb.com commit a051b2e56f2aa287b37ab0134a8af852f84e3f8e Author: Jun Miao Date: Tue Aug 24 10:43:58 2021 +0800 selftests/x86: Fix error: variably modified 'altstack_data' at file scope A glibc 2.34 feature adds support for variable MINSIGSTKSZ and SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. glibc 2.34 flags code paths assuming MINSIGSTKSZ or SIGSTKSZ are constant. Fix these error in x86 test. Feature description and build error: NEWS for version 2.34 ===================== Major new features: * Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ). This supports dynamic sized register sets for modern architectural features like Arm SVE. ===================== If _SC_SIGSTKSZ_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are redefined as: /* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ # undef SIGSTKSZ # define SIGSTKSZ sysconf (_SC_SIGSTKSZ) /* Minimum stack size for a signal handler: SIGSTKSZ. */ # undef MINSIGSTKSZ # define MINSIGSTKSZ SIGSTKSZ Compilation will fail if the source assumes constant MINSIGSTKSZ or SIGSTKSZ. Build error with the GNU C Library 2.34: DEBUG: | sigreturn.c:150:13: error: variably modified 'altstack_data' at file scope | sigreturn.c:150:13: error: variably modified 'altstack_data' at file scope DEBUG: | 150 | static char altstack_data[SIGSTKSZ]; | 150 | static char altstack_data[SIGSTKSZ]; DEBUG: | | ^~~~~~~~~~~~~ DEBUG: | single_step_syscall.c:60:22: error: variably modified 'altstack_data' at file scope DEBUG: | 60 | static unsigned char altstack_data[SIGSTKSZ]; DEBUG: | | ^~~~~~~~~~~~~ Fixed commit log to improve formatting and clarity: Shuah Khan Link: https://sourceware.org/pipermail/libc-alpha/2021-January/121996.html Link: https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html Suggested-by: Jianwei Hu Signed-off-by: Jun Miao Signed-off-by: Shuah Khan commit f35534a2bcc7fd614a11aa7e3d91a0b1d6c962fb Author: Vineet Gupta Date: Thu Oct 1 16:42:15 2020 -0700 ARC: mm: hack to allow 2 level build with 4 level code PMD_SHIFT is mapped to PUD_SHIFT or PGD_SHIFT by asm-generic/pgtable-* but only for !__ASSEMBLY__ tlbex.S asm code has PTRS_PER_PTE which uses PMD_SHIFT hence barfs for CONFIG_PGTABLE_LEVEL={2,3} and works for 4. So add a workaround local to tlbex.S - the proper fix is to change asm-generic/pgtable-* headers to expose the defines for __ASSEMBLY__ too Signed-off-by: Vineet Gupta commit fe6cb7b043b69cd9498616592bb9e28648fb4f7a Author: Vineet Gupta Date: Fri Sep 13 15:25:52 2019 -0700 ARC: mm: disintegrate pgtable.h into levels and flags - pgtable-bits-arcv2.h (MMU specific page table flags) - pgtable-levels.h (paging levels) No functional changes, but paves way for easy addition of new MMU code with different bits and levels etc Signed-off-by: Vineet Gupta commit 2cc1121bc993ca3090cc4267bc38d3da61b68602 Author: Vineet Gupta Date: Thu Oct 1 19:39:15 2020 -0700 ARC: mm: disintegrate mmu.h (arcv2 bits out) non functional change Tested-by: kernel test robot Signed-off-by: Vineet Gupta commit d035f84d834cd09d0c083f4d4cb3e46c2ae56cb2 Author: Yifan Zhang Date: Wed Aug 25 17:05:09 2021 +0800 drm/amdgpu: rename amdgpu_bo_get_preferred_pin_domain amdgpu_bo_get_preferred_pin_domain is used for page tables creation, which is not involved with page pinning. And it is used in more cases than display scanout, modify its documentation as well. Signed-off-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 416e1fab475281905e6a45883bc7e5ac8b3f0248 Author: Evan Quan Date: Thu Aug 19 12:14:20 2021 +0800 drm/amdgpu: drop redundant cancel_delayed_work_sync call As those _sw_fini() APIs follow just after _suspend() APIs. And the cancel_delayed_work_sync was already called in latter. Signed-off-by: Evan Quan Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 859e4659273f1df3a23e3990826bcb41e85f68a5 Author: Evan Quan Date: Thu Aug 19 12:07:59 2021 +0800 drm/amdgpu: add missing cleanups for more ASICs on UVD/VCE suspend This is a supplement for commit below: "drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend". Signed-off-by: Evan Quan Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit bf756fb833cbe8c6881c964f09db718bade6e591 Author: Evan Quan Date: Tue Aug 17 14:06:21 2021 +0800 drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend Perform proper cleanups on UVD/VCE suspend: powergate enablement, clockgating enablement and dpm disablement. This can fix some hangs observed on suspending when UVD/VCE still using(e.g. issue "pm-suspend" when video is still playing). Signed-off-by: Evan Quan Signed-off-by: xinhui pan Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 3998f0b8bc49ec784990971dc1f16bf367b19078 Author: Ronnie Sahlberg Date: Wed Aug 25 21:16:56 2021 +1000 cifs: Do not leak EDEADLK to dgetents64 for STATUS_USER_SESSION_DELETED RHBZ: 1994393 If we hit a STATUS_USER_SESSION_DELETED for the Create part in the Create/QueryDirectory compound that starts a directory scan we will leak EDEADLK back to userspace and surprise glibc and the application. Pick this up initiate_cifs_search() and retry a small number of tries before we return an error to userspace. Cc: stable@vger.kernel.org Reported-by: Xiaoli Feng Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 8b51a8e64443b95fb9fec9f76f1c93777b35310a Author: Shubhrajyoti Datta Date: Tue Jul 13 12:30:11 2021 +0530 i2c: cadence: Implement save restore The zynqmp platform now supports chip-off so the registers can lose context. Implement save restore for i2c module. Since we have only a couple of registers an unconditional restore is done. Acked-by: Michal Simek Signed-off-by: Shubhrajyoti Datta Signed-off-by: Wolfram Sang commit 661e8a88e8317eb9ffe69c69d6cb4876370fe7e2 Author: Sergey Shtylyov Date: Sun Jul 4 17:47:54 2021 +0300 i2c: xlp9xx: fix main IRQ check Iff platform_get_irq() returns 0 for the main IRQ, the driver's probe() method will return 0 early (as if the method's call was successful). Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always override that decision... Fixes: 2bbd681ba2b ("i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller") Signed-off-by: Sergey Shtylyov Reviewed-by: George Cherian Signed-off-by: Wolfram Sang commit 58fb7c643d346e2364404554f531cfa6a1a3917c Author: Sergey Shtylyov Date: Sun Jul 4 17:38:45 2021 +0300 i2c: mt65xx: fix IRQ check Iff platform_get_irq() returns 0, the driver's probe() method will return 0 early (as if the method's call was successful). Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always override that decision... Fixes: ce38815d39ea ("I2C: mediatek: Add driver for MediaTek I2C controller") Signed-off-by: Sergey Shtylyov Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang commit 332c404a55ef3b39837e958284275622a2a4849d Author: Steve French Date: Tue Aug 24 16:14:53 2021 -0500 cifs: add cifs_common directory to MAINTAINERS file With some files moving into the cifs_common directory, we need to add it to the CIFS entry in the MAINTAINERS file. Suggested-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 38f4910b8b26d3a940167f207bddfcc589310c8a Author: Steve French Date: Tue Aug 24 12:07:46 2021 -0500 cifs: cifs_md4 convert to SPDX identifier Add SPDX license identifier and replace license boilerplate for cifs_md4.c Signed-off-by: Steve French commit 42c21973fa3c0f4898330fa30d327fbab67b5460 Author: Ronnie Sahlberg Date: Fri Aug 20 09:32:56 2021 +1000 cifs: create a MD4 module and switch cifs.ko to use it MD4 support will likely be removed from the crypto directory, but is needed for compression of NTLMSSP in SMB3 mounts. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 71c02863246167b3d1639b8278681ca8ebedcb4e Author: Ronnie Sahlberg Date: Thu Aug 19 20:34:59 2021 +1000 cifs: fork arc4 and create a separate module for it for cifs and other users We can not drop ARC4 and basically destroy CIFS connectivity for almost all CIFS users so create a new forked ARC4 module that CIFS and other subsystems that have a hard dependency on ARC4 can use. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 76a3c92ec9e0668e4cd0e9ff1782eb68f61a179c Author: Ronnie Sahlberg Date: Thu Aug 19 20:34:58 2021 +1000 cifs: remove support for NTLM and weaker authentication algorithms for SMB1. This removes the dependency to DES. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 18d04062f83b3eedb64e9f64ede26ee83ae7f152 Author: Shyam Prasad N Date: Tue Aug 10 10:22:28 2021 +0000 cifs: enable fscache usage even for files opened as rw So far, the fscache implementation we had supports only a small set of use cases. Particularly for files opened with O_RDONLY. This commit enables it even for rw based file opens. It also enables the reuse of cached data in case of mount option (cache=singleclient) where it is guaranteed that this is the only client (and server) which operates on the files. There's also a single line change in fscache.c to get around a bug seen in fscache. Signed-off-by: Shyam Prasad N Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 3d2b50e0e7682b2453ccfac775ad7c2c1d5ceb45 Author: Steve French Date: Fri Aug 20 18:10:36 2021 -0500 oid_registry: Add OIDs for missing Spnego auth mechanisms to Macs In testing mounts to Macs, noticed that the OIDS for some GSSAPI/SPNEGO auth mechanisms sent by the server were not recognized and were missing from the header. Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 7321be2663da5922343cc121f1ff04924cee2e76 Author: Steve French Date: Mon Aug 23 13:52:12 2021 -0500 smb3: fix posix extensions mount option We were incorrectly initializing the posix extensions in the conversion to the new mount API. CC: # 5.11+ Reported-by: Christian Brauner Acked-by: Christian Brauner Suggested-by: Namjae Jeon Signed-off-by: Steve French commit d72c74197b70bc3c95152f351a568007bffa3e11 Author: Ding Hui Date: Tue Aug 17 22:55:10 2021 +0800 cifs: fix wrong release in sess_alloc_buffer() failed path smb_buf is allocated by small_smb_init_no_tc(), and buf type is CIFS_SMALL_BUFFER, so we should use cifs_small_buf_release() to release it in failed path. Signed-off-by: Ding Hui Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit f980d055a0f858d73d9467bb0b570721bbfcdfb8 Author: Len Baker Date: Tue Aug 17 12:27:09 2021 +0200 CIFS: Fix a potencially linear read overflow strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated. Also, the strnlen() call does not avoid the read overflow in the strlcpy function when a not NUL-terminated string is passed. So, replace this block by a call to kstrndup() that avoids this type of overflow and does the same. Fixes: 066ce6899484d ("cifs: rename cifs_strlcpy_to_host and make it use new functions") Signed-off-by: Len Baker Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Jeff Layton Signed-off-by: Steve French commit 7ee656c3ac3d047b4cf1269f83ac9d6c0bba916b Author: Christoph Hellwig Date: Wed Aug 25 18:31:08 2021 +0200 nbd: remove nbd->destroy_complete The nbd->destroy_complete pointer is not really needed. For creating a device without a specific index we now simplify skip devices marked NBD_DESTROY_ON_DISCONNECT as there is not much point to reuse them. For device creation with a specific index there is no real need to treat the case of a requested but not finished disconnect different than any other device that is being shutdown, i.e. we can just return an error, as a slightly different race window would anyway. Fixes: 6e4df4c64881 ("nbd: reduce the nbd_index_mutex scope") Reported-by: Tetsuo Handa Reported-by: syzbot+2c98885bcd769f56b6d6@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-7-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 438cd318c8dfa5228ffd43af1b98d7cd7d92e1c6 Author: Christoph Hellwig Date: Wed Aug 25 18:31:07 2021 +0200 nbd: only return usable devices from nbd_find_unused Device marked as NBD_DESTROY_ON_DISCONNECT can and should be skipped given that they won't survive the disconnect. So skip them and try to grab a reference directly and just continue if the the devices is being torn down or created and thus has a zero refcount. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-6-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit b190300decb352a0b865d7aa379e89b17d772a43 Author: Tetsuo Handa Date: Wed Aug 25 18:31:06 2021 +0200 nbd: set nbd->index before releasing nbd_index_mutex Set nbd->index before releasing nbd_index_mutex, as populate_nbd_status() might access nbd->index as soon as nbd_index_mutex is released. Fixes: 6e4df4c64881 ("nbd: reduce the nbd_index_mutex scope") Signed-off-by: Tetsuo Handa [hch: split from a larger patch] Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-5-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 75b7f62aa65d5c496391ec2c3db3561aaf81a403 Author: Tetsuo Handa Date: Wed Aug 25 18:31:05 2021 +0200 nbd: prevent IDR lookups from finding partially initialized devices Previously nbd_index_mutex was held during whole add/remove/lookup operations in order to guarantee that partially initialized devices are not reachable via idr_find() or idr_for_each(). But now that partially initialized devices become reachable as soon as idr_alloc() succeeds, we need to skip partially initialized devices. Since it seems that all functions use refcount_inc_not_zero(&nbd->refs) in order to skip destroying devices, update nbd->refs from zero to non-zero as the last step of device initialization in order to also skip partially initialized devices. Fixes: 6e4df4c64881 ("nbd: reduce the nbd_index_mutex scope") Signed-off-by: Tetsuo Handa [hch: split from a larger patch, added comments] Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-4-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 409e0ff10ead30a620ee48acb6d4545d9cb95359 Author: Christoph Hellwig Date: Wed Aug 25 18:31:04 2021 +0200 nbd: reset NBD to NULL when restarting in nbd_genl_connect When nbd_genl_connect restarts to wait for a disconnecting device, nbd needs to be reset to NULL. Do that by facoring out a helper to find an unused device. Fixes: 6177b56c96ff ("nbd: refactor device search and allocation in nbd_genl_connect") Reported-by: Tetsuo Handa Reported-by: Hillf Danton Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-3-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 93f63bc41f699318807df202a175d564c26bda87 Author: Tetsuo Handa Date: Wed Aug 25 18:31:03 2021 +0200 nbd: add missing locking to the nbd_dev_add error path idr_remove needs external synchronization. Fixes: 6e4df4c64881 ("nbd: reduce the nbd_index_mutex scope") Signed-off-by: Tetsuo Handa [hch: split from a larger patch] Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210825163108.50713-2-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 3673fdeafd5f9d9aa90b35f7e11a556fe0cbbe62 Author: Changcheng Deng Date: Mon Aug 23 20:03:38 2021 -0700 kselftest:sched: remove duplicate include in cs_prctl_test.c Clean up the following includecheck warning: ./tools/testing/selftests/sched/cs_prctl_test.c: Include files sys/types.h and sys/wait.h are included more than once. No functional change. Fixed commit header and log: Shuah Khan Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Shuah Khan commit d538ddb97e066571e4fc58b832f40739621b42bb Author: Baolin Wang Date: Wed Aug 25 09:49:04 2021 +0800 selftests: openat2: Fix testing failure for O_LARGEFILE flag The openat2 test suite fails on ARM64 because the definition of O_LARGEFILE is different on ARM64. Fix the problem by defining the correct O_LARGEFILE definition on ARM64. "openat2 unexpectedly returned # 3['.../tools/testing/selftests/openat2'] with 208000 (!= 208000) not ok 102 openat2 with incompatible flags (O_PATH | O_LARGEFILE) fails with -22 (Invalid argument)" Fixed change log to improve formatting and clarity: Shuah Khan Signed-off-by: Baolin Wang Reviewed-by: Aleksa Sarai Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 7d789bd0089ad2a6cc2315f281018bfafae820bc Merge: 35cba2988fc65 33a6bef8cf920 Author: Alexei Starovoitov Date: Wed Aug 25 12:22:01 2021 -0700 Merge branch 'selftests: xsk: various simplifications' Magnus Karlsson says: ==================== This patch set mainly contains various simplifications to the xsk selftests. The only exception is the introduction of packet streams that describes what the Tx process should send and what the Rx process should receive. If it receives anything else, the test fails. This mechanism can be used to produce tests were all packets are not received by the Rx thread or modified in some way. An example of this is if an XDP program does XDP_PASS on some of the packets. This patch set will be followed by another patch set that implements a new structure that will facilitate adding new tests. A couple of new tests will also be included in that patch set. v2 -> v3: * Reworked patch 12 so that it now has functions for creating and destroying ifobjects. Simplifies the code. [Maciej] * The packet stream now allocates the supplied buffer array length, instead of the default one. [Maciej] * pkt_stream_get_pkt() now returns NULL when indexing a non-existing packet. [Maciej] * pkt_validate() is now is_pkt_valid(). [Maciej] * Slowed down packet sending speed even more in patch 11 so that slow systems do not silenty drop packets in skb mode. v1 -> v2: * Dropped the patch with per process limit changes as it is not needed [Yonghong] * Improved the commit message of patch 1 [Yonghong] * Fixed a spelling error in patch 9 Thanks: Magnus ==================== Acked-by: Maciej Fijalkowski Signed-off-by: Alexei Starovoitov commit 33a6bef8cf92017ff48e3bd597d7d60652f37b6d Author: Magnus Karlsson Date: Wed Aug 25 11:37:22 2021 +0200 selftests: xsk: Preface options with opt Preface all options with opt_ and make them booleans. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-17-magnus.karlsson@gmail.com commit 279bdf6b79d5f6a4decbf2699092b55c8c782eec Author: Magnus Karlsson Date: Wed Aug 25 11:37:21 2021 +0200 selftests: xsk: Make enums lower case Make enums lower case as that is the standard. Also drop the unnecessary TEST_MODE_UNCONFIGURED mode. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-16-magnus.karlsson@gmail.com commit 29f128b38b346a16dc6749b66f20fca29430d271 Author: Magnus Karlsson Date: Wed Aug 25 11:37:20 2021 +0200 selftests: xsk: Generate packets from specification Generate packets from a specification instead of something hard coded. The idea is that a test generates one or more packet specifications and provides it/them to both Tx and Rx. The Tx thread will generate from this specification and Rx will validate that it receives what is in the specification. The specification can be the same on both ends, meaning that everything that was sent should be received, or different which means that Rx will only receive part of the sent packets. Currently, the packet specification is the same for both Rx and Tx and the same for each test. This will change in later work as features and tests are added. The data path functions are also renamed to better reflect what actions they are performing after introducing this feature. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-15-magnus.karlsson@gmail.com commit 960b6e0153fb383bd634313fbd41bd4813dd73fc Author: Magnus Karlsson Date: Wed Aug 25 11:37:19 2021 +0200 selftests: xsk: Generate packet directly in umem Generate the packet directly in the umem instead of in a temporary buffer that is copied out. Simplifies the code and improves performance. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-14-magnus.karlsson@gmail.com commit 1034b03e54ac80f093619ead6c3b77d0c3086a2b Author: Magnus Karlsson Date: Wed Aug 25 11:37:18 2021 +0200 selftests: xsk: Simplify cleanup of ifobjects Simpify the cleanup of ifobjects right before the program exits by introducing functions for creating and destroying these objects. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-13-magnus.karlsson@gmail.com commit ab7c95abb5f9d05470ede8e75a105c81c2dbf2c1 Author: Magnus Karlsson Date: Wed Aug 25 11:37:17 2021 +0200 selftests: xsk: Decrease sending speed Decrease sending speed to avoid potentially overflowing some buffers in the skb case that leads to dropped packets we cannot control (and thus the tests may generate false negatives). Decrease batch size and introduce a usleep in the transmit thread to not overflow the receiver. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-12-magnus.karlsson@gmail.com commit b04fdc4ce31fe5ae411737ec6705fcdfc493d6c8 Author: Magnus Karlsson Date: Wed Aug 25 11:37:16 2021 +0200 selftests: xsk: Validate tx stats on tx thread Validate the tx stats on the Tx thread instead of the Rx thread. Depending on your settings, you might not be allowed to query the statistics of a socket you do not own, so better to do this on the correct thread to start with. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-11-magnus.karlsson@gmail.com commit 0d41f59f458a4f08353f7aba64bbc6388a858265 Author: Magnus Karlsson Date: Wed Aug 25 11:37:15 2021 +0200 selftests: xsk: Simplify packet validation in xsk tests Simplify packet validation in the xsk selftests by performing it at once for every packet. The current code performed this per batch and did this on copied packet data. Make it simpler and faster by validating it at once and on the umem packet data thus skipping the copy and the memory allocation for the temprary buffer. The optional packet dump feature is also simplified in the same manner. Memory allocation and copying is removed and the dump is performed directly on the umem data. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-10-magnus.karlsson@gmail.com commit 9da2ea4fe8d10060a417a71f808df7e825660867 Author: Magnus Karlsson Date: Wed Aug 25 11:37:14 2021 +0200 selftests: xsk: Rename worker_* functions that are not thread entry points Rename worker_* functions that are not thread entry points to something else. This was confusing. Now only thread entry points are worker_something. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-9-magnus.karlsson@gmail.com commit d40ba9d33ae8ed937234fd12b7303a997406bd87 Author: Magnus Karlsson Date: Wed Aug 25 11:37:13 2021 +0200 selftests: xsk: Disassociate umem size with packets sent Disassociate the number of packets sent with the number of buffers in the umem. This so we can loop over the umem to test more things. Set the size of the umem to be a multiple of 2M. A requirement for huge pages that are needed in unaligned mode. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-8-magnus.karlsson@gmail.com commit 9c5ce931b16ea83fa01e5e4ca95b5172f1cde01a Author: Magnus Karlsson Date: Wed Aug 25 11:37:12 2021 +0200 selftests: xsk: Remove end-of-test packet Get rid of the end-of-test packet and just count the number of packets received and quit when the expected number as been received. Simplifies the code. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-7-magnus.karlsson@gmail.com commit 1314c3537f661002a65999784c0f3f42d7de87f6 Author: Magnus Karlsson Date: Wed Aug 25 11:37:11 2021 +0200 selftests: xsk: Simplify the retry code Simplify the retry code and make it more efficient by waiting first, instead of trying immediately which always fails due to the asynchronous nature of xsk socket close. Also decrease the wait time to significantly lower the run-time of the test suite. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-6-magnus.karlsson@gmail.com commit 083be682d97695979e1bdfac1d4274234555f77b Author: Magnus Karlsson Date: Wed Aug 25 11:37:10 2021 +0200 selftests: xsk: Return correct error codes Return the correct error codes so they can be printed correctly. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-5-magnus.karlsson@gmail.com commit 13a6ebd9084a398b93e3e06ca59254df9aa95336 Author: Magnus Karlsson Date: Wed Aug 25 11:37:09 2021 +0200 selftests: xsk: Remove unused variables Remove unused variables and typedefs. The *_npkts variables are incremented but never used. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-4-magnus.karlsson@gmail.com commit 25c0a30541e4a7ddb4b45c2c923f799c76c95ef5 Author: Magnus Karlsson Date: Wed Aug 25 11:37:08 2021 +0200 selftests: xsk: Remove the num_tx_packets option Remove the number of tx packet option as this should be decided by the test itself. Also change the number of packets to be sent to 4096 speeding up the execution. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-3-magnus.karlsson@gmail.com commit d18b09bf67bb821807de202a1b8d239a946118e7 Author: Magnus Karlsson Date: Wed Aug 25 11:37:07 2021 +0200 selftests: xsk: Remove color mode Remove color mode since it does not add any value and having less code means less maintenance which is a good thing. Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210825093722.10219-2-magnus.karlsson@gmail.com commit 0c6e1d7fd5e7560fdc4bb3418c2c0f0d7a95bf76 Author: Hao Xu Date: Thu Aug 26 01:58:56 2021 +0800 io_uring: don't free request to slab It's not necessary to free the request back to slab when we fail to get sqe, just move it to state->free_list. Signed-off-by: Hao Xu Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20210825175856.194299-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 9d68cd9120e4e3af38f843e165631c323b86b4e4 Author: Vitaly Kuznetsov Date: Wed Aug 25 15:38:57 2021 +0200 hv_utils: Set the maximum packet size for VSS driver to the length of the receive buffer Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") introduced a notion of maximum packet size and for KVM and FCOPY drivers set it to the length of the receive buffer. VSS driver wasn't updated, this means that the maximum packet size is now VMBUS_DEFAULT_MAX_PKT_SIZE (4k). Apparently, this is not enough. I'm observing a packet of 6304 bytes which is being truncated to 4096. When VSS driver tries to read next packet from ring buffer it starts from the wrong offset and receives garbage. Set the maximum packet size to 'HV_HYP_PAGE_SIZE * 2' in VSS driver. This matches the length of the receive buffer and is in line with other utils drivers. Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20210825133857.847866-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit eb0feefd4c025b2697464d141f7ff178095f34df Author: Jason Gunthorpe Date: Mon Aug 23 11:42:04 2021 -0300 vfio/ap_ops: Convert to use vfio_register_group_dev() This is straightforward conversion, the ap_matrix_mdev is actually serving as the vfio_device and we can replace all the mdev_get_drvdata()'s with a simple container_of() or a dev_get_drvdata() for sysfs paths. Cc: Alex Williamson Cc: Cornelia Huck Cc: kvm@vger.kernel.org Cc: Christoph Hellwig Reviewed-by: Tony Krowiak Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v4-0203a4ab0596+f7-vfio_ap_jgg@nvidia.com Signed-off-by: Alex Williamson commit 13b11b316f52272ccbf2f664b14a740cc616526f Author: Michal Simek Date: Wed Aug 25 09:46:28 2021 +0200 dt-bindings: Add vendor prefix for Topic Embedded Systems Add vendor prefix for Topic Embedded Systems (http://topic.nl). Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/b6e42012977876c421672a84bdb7636be819d664.1629877585.git.michal.simek@xilinx.com Signed-off-by: Rob Herring commit 2fcf9a178ba1f2d4f2bf715312b84508850701d2 Author: Geert Uytterhoeven Date: Wed Aug 25 11:40:40 2021 +0200 of: fdt: Rename reserve_elfcorehdr() to fdt_reserve_elfcorehdr() On ia64/allmodconfig: drivers/of/fdt.c:609:20: error: conflicting types for 'reserve_elfcorehdr'; have 'void(void)' 609 | static void __init reserve_elfcorehdr(void) | ^~~~~~~~~~~~~~~~~~ arch/ia64/include/asm/meminit.h:43:12: note: previous declaration of 'reserve_elfcorehdr' with type 'int(u64 *, u64 *)' {aka 'int(long long unsigned int *, long long unsigned int *)'} 43 | extern int reserve_elfcorehdr(u64 *start, u64 *end); | ^~~~~~~~~~~~~~~~~~ Fix this by prefixing the FDT function name with "fdt_". Fixes: f7e7ce93aac13118 ("of: fdt: Add generic support for handling elf core headers property") Reported-by: kernel test robot Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f6eabbbce0fba6da3da0264c1e1cf23c01173999.1629884393.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 1cc5b9a411e43aa2cb5060429ede6c50217bad90 Author: Sumeet Pawnikar Date: Fri Aug 20 17:22:33 2021 +0530 powercap: Add Power Limit4 support for Alder Lake SoC Add Power Limit4 support for Alder Lake SoC. Signed-off-by: Sumeet Pawnikar Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit d0e936adbd2250cb03f2e840c6651d18edc22ace Author: Srinivas Pandruvada Date: Thu Aug 19 19:40:06 2021 -0700 cpufreq: intel_pstate: Process HWP Guaranteed change notification It is possible that HWP guaranteed ratio is changed in response to change in power and thermal limits. For example when Intel Speed Select performance profile is changed or there is change in TDP, hardware can send notifications. It is possible that the guaranteed ratio is increased. This creates an issue when turbo is disabled, as the old limits set in MSR_HWP_REQUEST are still lower and hardware will clip to older limits. This change enables HWP interrupt and process HWP interrupts. When guaranteed is changed, calls cpufreq_update_policy() so that driver callbacks are called to update to new HWP limits. This callback is called from a delayed workqueue of 10ms to avoid frequent updates. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 950809cd6ca2ff2e2bb9d826c4d9e35d134d7de0 Author: Srinivas Pandruvada Date: Thu Aug 19 19:40:05 2021 -0700 thermal: intel: Allow processing of HWP interrupt Add a weak function to process HWP (Hardware P-states) notifications and move updating HWP_STATUS MSR to this function. This allows HWP interrupts to be processed by the intel_pstate driver in HWP mode by overriding the implementation. Signed-off-by: Srinivas Pandruvada Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 97e03410bc5f6a20d46b15740c2eae240f766e39 Author: Adrian Huang Date: Thu Aug 19 15:14:16 2021 +0800 ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved In ACPI 6.4 spec, record types "0x0002-0xffff" of FPDT Performance Record Types [1] and record types "0x0003-0xffff" of Runtime Performance Record Types [2] are reserved. Users might be confused with the FW_BUG message, and they think this is the FW issue. Here is the example in a Lenovo box: ACPI: FPDT 0x00000000A820A000 000044 (v01 LENOVO THINKSYS 00000100 01000013) ACPI: Reserving FPDT table memory at [mem 0xa820a000-0xa820a043] ACPI FPDT: [Firmware Bug]: Invalid record 4113 found So, remove the FW_BUG message to avoid confusion since those types are reserved in ACPI 6.4 spec. [1] https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fpdt-performance-record-types-table [2] https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#runtime-performance-record-types-table Signed-off-by: Adrian Huang Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 1a20d409c874255086e2f42a729826d490294c91 Author: Ulrich Huber Date: Tue Aug 24 14:57:44 2021 +0200 ACPI: button: Add DMI quirk for Lenovo Yoga 9 (14INTL5) The Lenovo Yoga 9 (14INTL5)'s ACPI _LID is bugged: After hibernation the lid is initially reported as closed. Once closing and then reopening the lid reports the lid as open again. This leads to the conclusion that the initial notification of the lid is missing but subsequent notifications are correct. In order fo the Linux LID code to handle this device properly the lid_init_state must be set to ACPI_BUTTON_LID_INIT_OPEN. Signed-off-by: Ulrich Huber Signed-off-by: Rafael J. Wysocki commit 145eba1aaec9f6798c30842d201920a80f9049a3 Author: Cai Huoqing Date: Mon Aug 23 12:26:22 2021 +0800 RDMA/hfi1: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Link: https://lore.kernel.org/r/20210823042622.109-1-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Signed-off-by: Jason Gunthorpe commit d164bf64a9006ceafb534e411784a2f77de909c9 Author: Cai Huoqing Date: Mon Aug 23 10:35:30 2021 +0800 IB/rdmavt: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Link: https://lore.kernel.org/r/20210823023530.48-1-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Signed-off-by: Jason Gunthorpe commit 437b38c51162f8b87beb28a833c4d5dc85fa864e Author: Lorenzo Pieralisi Date: Mon Aug 23 11:46:18 2021 +0100 ACPI: Add memory semantics to acpi_os_map_memory() The memory attributes attached to memory regions depend on architecture specific mappings. For some memory regions, the attributes specified by firmware (eg uncached) are not sufficient to determine how a memory region should be mapped by an OS (for instance a region that is define as uncached in firmware can be mapped as Normal or Device memory on arm64) and therefore the OS must be given control on how to map the region to match the expected mapping behaviour (eg if a mapping is requested with memory semantics, it must allow unaligned accesses). Rework acpi_os_map_memory() and acpi_os_ioremap() back-end to split them into two separate code paths: acpi_os_memmap() -> memory semantics acpi_os_ioremap() -> MMIO semantics The split allows the architectural implementation back-ends to detect the default memory attributes required by the mapping in question (ie the mapping API defines the semantics memory vs MMIO) and map the memory accordingly. Link: https://lore.kernel.org/linux-arm-kernel/31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com Tested-by: Hanjun Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Ard Biesheuvel Acked-by: Catalin Marinas Signed-off-by: Rafael J. Wysocki commit 35cba2988fc65239d10566edc03cc0978382c25f Merge: 3bbc8ee7c363a 576d47bb1a926 Author: Alexei Starovoitov Date: Wed Aug 25 10:37:06 2021 -0700 Merge branch 'bpf: Add bpf_task_pt_regs() helper' Daniel Xu says: ==================== The motivation behind this helper is to access userspace pt_regs in a kprobe handler. uprobe's ctx is the userspace pt_regs. kprobe's ctx is the kernelspace pt_regs. bpf_task_pt_regs() allows accessing userspace pt_regs in a kprobe handler. The final case (kernelspace pt_regs in uprobe) is pretty rare (usermode helper) so I think that can be solved later if necessary. More concretely, this helper is useful in doing BPF-based DWARF stack unwinding. Currently the kernel can only do framepointer based stack unwinds for userspace code. This is because the DWARF state machines are too fragile to be computed in kernelspace [0]. The idea behind DWARF-based stack unwinds w/ BPF is to copy a chunk of the userspace stack (while in prog context) and send it up to userspace for unwinding (probably with libunwind) [1]. This would effectively enable profiling applications with -fomit-frame-pointer using kprobes and uprobes. [0]: https://lkml.org/lkml/2012/2/10/356 [1]: https://github.com/danobi/bpf-dwarf-walk Changes from v1: - Conwolidate BTF_ID decls for task_struct - Enable bpf_get_current_task_btf() for all prog types - Enable bpf_task_pt_regs() for all prog types - Use ASSERT_* macros instead of CHECK ==================== Signed-off-by: Alexei Starovoitov commit 576d47bb1a926fe8162253e0bca28e9bede8cf48 Author: Daniel Xu Date: Mon Aug 23 19:43:50 2021 -0700 bpf: selftests: Add bpf_task_pt_regs() selftest This test retrieves the uprobe's pt_regs in two different ways and compares the contents in an arch-agnostic way. Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/5581eb8800f6625ec8813fe21e9dce1fbdef4937.1629772842.git.dxu@dxuuu.xyz commit dd6e10fbd9fb86a571d925602c8a24bb4d09a2a7 Author: Daniel Xu Date: Mon Aug 23 19:43:49 2021 -0700 bpf: Add bpf_task_pt_regs() helper The motivation behind this helper is to access userspace pt_regs in a kprobe handler. uprobe's ctx is the userspace pt_regs. kprobe's ctx is the kernelspace pt_regs. bpf_task_pt_regs() allows accessing userspace pt_regs in a kprobe handler. The final case (kernelspace pt_regs in uprobe) is pretty rare (usermode helper) so I think that can be solved later if necessary. More concretely, this helper is useful in doing BPF-based DWARF stack unwinding. Currently the kernel can only do framepointer based stack unwinds for userspace code. This is because the DWARF state machines are too fragile to be computed in kernelspace [0]. The idea behind DWARF-based stack unwinds w/ BPF is to copy a chunk of the userspace stack (while in prog context) and send it up to userspace for unwinding (probably with libunwind) [1]. This would effectively enable profiling applications with -fomit-frame-pointer using kprobes and uprobes. [0]: https://lkml.org/lkml/2012/2/10/356 [1]: https://github.com/danobi/bpf-dwarf-walk Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/e2718ced2d51ef4268590ab8562962438ab82815.1629772842.git.dxu@dxuuu.xyz commit a396eda5517ac958fb4eb7358f4708eb829058c4 Author: Daniel Xu Date: Mon Aug 23 19:43:48 2021 -0700 bpf: Extend bpf_base_func_proto helpers with bpf_get_current_task_btf() bpf_get_current_task() is already supported so it's natural to also include the _btf() variant for btf-powered helpers. This is required for non-tracing progs to use bpf_task_pt_regs() in the next commit. Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/f99870ed5f834c9803d73b3476f8272b1bb987c0.1629772842.git.dxu@dxuuu.xyz commit 33c5cb36015ac1034b50b823fae367e908d05147 Author: Daniel Xu Date: Mon Aug 23 19:43:47 2021 -0700 bpf: Consolidate task_struct BTF_ID declarations No need to have it defined 5 times. Once is enough. Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/6dcefa5bed26fe1226f26683f36819bb53ec19a2.1629772842.git.dxu@dxuuu.xyz commit 1b07d00a15d6a96d1a36b6a284c4fd5f2e2fa383 Author: Daniel Xu Date: Mon Aug 23 19:43:46 2021 -0700 bpf: Add BTF_ID_LIST_GLOBAL_SINGLE macro Same as BTF_ID_LIST_SINGLE macro except defines a global ID. Signed-off-by: Daniel Xu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/a867a97517df42fd3953eeb5454402b57e74538f.1629772842.git.dxu@dxuuu.xyz commit 5845e703f9b5f949dc1db4122b7fc6d8563048a2 Author: Xujun Leng Date: Wed Aug 25 23:05:26 2021 +0800 arm64: mm: fix comment typo of pud_offset_phys() Fix a typo in the comment of macro pud_offset_phys(). Signed-off-by: Xujun Leng Link: https://lore.kernel.org/r/20210825150526.12582-1-lengxujun2007@126.com Signed-off-by: Catalin Marinas commit eb653eda1e91dd3e7d1d2448d528d033dbfbe78f Author: Junxian Huang Date: Wed Aug 25 17:43:12 2021 +0800 RDMA/hns: Bugfix for incorrect association between dip_idx and dgid dip_idx and dgid should be a one-to-one mapping relationship, but when qp_num loops back to the start number, it may happen that two different dgid are assiociated to the same dip_idx incorrectly. One solution is to store the qp_num that is not assigned to dip_idx in an array. When a dip_idx needs to be allocated to a new dgid, an spare qp_num is extracted and assigned to dip_idx. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Link: https://lore.kernel.org/r/1629884592-23424-4-git-send-email-liangwenpeng@huawei.com Signed-off-by: Junxian Huang Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 074f315fc54a9ce45559a44ca36d9fa1ee1ea2cd Author: Junxian Huang Date: Wed Aug 25 17:43:11 2021 +0800 RDMA/hns: Bugfix for the missing assignment for dip_idx When the dgid-dip_idx mapping relationship exists, dip should be assigned. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Link: https://lore.kernel.org/r/1629884592-23424-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Junxian Huang Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 4303e61264c45cb535255c5b76400f5c4ab1305d Author: Junxian Huang Date: Wed Aug 25 17:43:10 2021 +0800 RDMA/hns: Bugfix for data type of dip_idx dip_idx is associated with qp_num whose data type is u32. However, dip_idx is incorrectly defined as u8 data in the hns_roce_dip struct, which leads to data truncation during value assignment. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Link: https://lore.kernel.org/r/1629884592-23424-2-git-send-email-liangwenpeng@huawei.com Signed-off-by: Junxian Huang Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 9bed8a70716ba65d300b9cc30eb7e0276353f7bf Author: Yixing Liu Date: Wed Aug 25 17:19:29 2021 +0800 RDMA/hns: Fix incorrect lsn field In RNR NAK screnario, according to the specification, when no credit is available, only the first fragment of the send request can be sent. The LSN(Limit Sequence Number) field should be 0 or the entire packet will be resent. Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Link: https://lore.kernel.org/r/1629883169-2306-1-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 9f72daf7edfa8f7e86ce8940d52266b5e931dcb0 Author: Nicolas Saenz Julienne Date: Wed Aug 25 12:54:15 2021 +0200 cgroup/cpuset: Avoid memory migration when nodemasks match With the introduction of ee9707e8593d ("cgroup/cpuset: Enable memory migration for cpuset v2") attaching a process to a different cgroup will trigger a memory migration regardless of whether it's really needed. Memory migration is an expensive operation, so bypass it if the nodemasks passed to cpuset_migrate_mm() are equal. Note that we're not only avoiding the migration work itself, but also a call to lru_cache_disable(), which triggers and flushes an LRU drain work on every online CPU. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Tejun Heo commit 24de5838db7044401c719042e95f646d72a78c49 Author: Will Deacon Date: Wed Aug 25 10:39:11 2021 +0100 arm64: signal32: Drop pointless call to sigdelsetmask() Commit 77097ae503b1 ("most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set") extended set_current_blocked() to remove SIGKILL and SIGSTOP from the new signal set and updated all callers accordingly. Unfortunately, this collided with the merge of the arm64 architecture, which duly removes these signals when restoring the compat sigframe, as this was what was previously done by arch/arm/. Remove the redundant call to sigdelsetmask() from compat_restore_sigframe(). Reported-by: Al Viro Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20210825093911.24493-1-will@kernel.org Signed-off-by: Catalin Marinas commit fc3bf30f1ba8b3e8e4f56eb932f971598bbe400c Author: Shaokun Zhang Date: Wed Aug 25 11:21:14 2021 +0800 RDMA/irdma: Remove the repeated declaration Functions 'irdma_alloc_ws_node_id' and 'irdma_free_ws_node_id' are declared twice, so remove the repeated declaration. Link: https://lore.kernel.org/r/1629861674-53343-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Shaokun Zhang Signed-off-by: Jason Gunthorpe commit 5f5a650999d5718af766fc70a120230b04235a6f Author: Håkon Bugge Date: Thu Aug 12 18:12:35 2021 +0200 RDMA/core/sa_query: Retry SA queries A MAD packet is sent as an unreliable datagram (UD). SA requests are sent as MAD packets. As such, SA requests or responses may be silently dropped. IB Core's MAD layer has a timeout and retry mechanism, which amongst other, is used by RDMA CM. But it is not used by SA queries. The lack of retries of SA queries leads to long specified timeout, and error being returned in case of packet loss. The ULP or user-land process has to perform the retry. Fix this by taking advantage of the MAD layer's retry mechanism. First, a check against a zero timeout is added in rdma_resolve_route(). In send_mad(), we set the MAD layer timeout to one tenth of the specified timeout and the number of retries to 10. The special case when timeout is less than 10 is handled. With this fix: # ucmatose -c 1000 -S 1024 -C 1 runs stable on an Infiniband fabric. Without this fix, we see an intermittent behavior and it errors out with: cmatose: event: RDMA_CM_EVENT_ROUTE_ERROR, error: -110 (110 is ETIMEDOUT) Link: https://lore.kernel.org/r/1628784755-28316-1-git-send-email-haakon.bugge@oracle.com Signed-off-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit 7aa6d700b089d960a03f6459898c096f4346990c Merge: c1ff860065741 21e39809fd7c4 Author: Mark Brown Date: Wed Aug 25 16:05:26 2021 +0100 Merge remote-tracking branch 'regulator/for-5.15' into regulator-next commit c1ff8600657411cdc51da170a5f51b8ecc7a90e2 Merge: e22ce8eb631bd ccb2a74eec211 Author: Mark Brown Date: Wed Aug 25 16:05:24 2021 +0100 Merge remote-tracking branch 'regulator/for-5.14' into regulator-linus commit bd7ffbc3ca12629aeb66fb9e28cf42b7f37e3e3b Author: Alyssa Rosenzweig Date: Tue Aug 24 13:30:27 2021 -0400 drm/panfrost: Clamp lock region to Bifrost minimum When locking a region, we currently clamp to a PAGE_SIZE as the minimum lock region. While this is valid for Midgard, it is invalid for Bifrost, where the minimum locking size is 8x larger than the 4k page size. Add a hardware definition for the minimum lock region size (corresponding to KBASE_LOCK_REGION_MIN_SIZE_LOG2 in kbase) and respect it. Signed-off-by: Alyssa Rosenzweig Tested-by: Chris Morgan Reviewed-by: Steven Price Reviewed-by: Rob Herring Cc: Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210824173028.7528-4-alyssa.rosenzweig@collabora.com commit a77b58825d7221d4a45c47881c35a47ba003aa73 Author: Alyssa Rosenzweig Date: Tue Aug 24 13:30:26 2021 -0400 drm/panfrost: Use u64 for size in lock_region Mali virtual addresses are 48-bit. Use a u64 instead of size_t to ensure we can express the "lock everything" condition as ~0ULL without overflow. This code was silently broken on any platform where a size_t is less than 48-bits; in particular, it was broken on 32-bit armv7 platforms which remain in use with panfrost. (Mainly RK3288) Signed-off-by: Alyssa Rosenzweig Suggested-by: Rob Herring Tested-by: Chris Morgan Reviewed-by: Steven Price Reviewed-by: Rob Herring Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") Cc: Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210824173028.7528-3-alyssa.rosenzweig@collabora.com commit b5fab345654c603c07525100d744498f28786929 Author: Alyssa Rosenzweig Date: Tue Aug 24 13:30:25 2021 -0400 drm/panfrost: Simplify lock_region calculation In lock_region, simplify the calculation of the region_width parameter. This field is the size, but encoded as ceil(log2(size)) - 1. ceil(log2(size)) may be computed directly as fls(size - 1). However, we want to use the 64-bit versions as the amount to lock can exceed 32-bits. This avoids undefined (and completely wrong) behaviour when locking all memory (size ~0). In this case, the old code would "round up" ~0 to the nearest page, overflowing to 0. Since fls(0) == 0, this would calculate a region width of 10 + 0 = 10. But then the code would shift by (region_width - 11) = -1. As shifting by a negative number is undefined, UBSAN flags the bug. Of course, even if it were defined the behaviour is wrong, instead of locking all memory almost none would get locked. The new form of the calculation corrects this special case and avoids the undefined behaviour. Signed-off-by: Alyssa Rosenzweig Reported-and-tested-by: Chris Morgan Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") Cc: Reviewed-by: Steven Price Reviewed-by: Rob Herring Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210824173028.7528-2-alyssa.rosenzweig@collabora.com commit 185981958c920dd28e35cba7cda69486c8551781 Author: David Howells Date: Thu Jun 3 10:51:28 2021 +0100 cachefiles: Use file_inode() rather than accessing ->f_inode Use the file_inode() helper rather than accessing ->f_inode directly. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431192403.2908479.4590814090994846904.stgit@warthog.procyon.org.uk/ commit a7e20e31f6c063d928868ecc8e2effb7d4b9fe1b Author: David Howells Date: Wed May 12 14:10:09 2021 +0100 netfs: Move cookie debug ID to struct netfs_cache_resources Move the cookie debug ID from struct netfs_read_request to struct netfs_cache_resources and drop the 'cookie_' prefix. This makes it available for things that want to use netfs_cache_resources without having a netfs_read_request. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/162431190784.2908479.13386972676539789127.stgit@warthog.procyon.org.uk/ commit 4c5e413994e632fc317e521b207d372e28184aef Author: David Howells Date: Fri Jun 4 11:37:45 2021 +0100 fscache: Select netfs stats if fscache stats are enabled Unconditionally select the stats produced by the netfs lib if fscache stats are enabled as the former are displayed in the latter's procfile. Signed-off-by: David Howells cc: linux-cachefs@redhat.com Reviewed-by: Jeff Layton Link: https://lore.kernel.org/r/162280352566.3319242.10615341893991206961.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/162431189627.2908479.9165349423842063755.stgit@warthog.procyon.org.uk/ commit 1266b4a7ecb679587dc4d098abe56ea53313d569 Author: Gao Xiang Date: Wed Aug 25 20:07:57 2021 +0800 erofs: fix double free of 'copied' Dan reported a new smatch warning [1] "fs/erofs/inode.c:210 erofs_read_inode() error: double free of 'copied'" Due to new chunk-based format handling logic, the error path can be called after kfree(copied). Set "copied = NULL" after kfree(copied) to fix this. [1] https://lore.kernel.org/r/202108251030.bELQozR7-lkp@intel.com Link: https://lore.kernel.org/r/20210825120757.11034-1-hsiangkao@linux.alibaba.com Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 37e8abff2bebbf9947d6b784f5c75ed48a717089 Author: Thomas Gleixner Date: Wed Aug 25 12:33:14 2021 +0200 locking/rtmutex: Dequeue waiter on ww_mutex deadlock The rt_mutex based ww_mutex variant queues the new waiter first in the lock's rbtree before evaluating the ww_mutex specific conditions which might decide that the waiter should back out. This check and conditional exit happens before the waiter is enqueued into the PI chain. The failure handling at the call site assumes that the waiter, if it is the top most waiter on the lock, is queued in the PI chain and then proceeds to adjust the unmodified PI chain, which results in RB tree corruption. Dequeue the waiter from the lock waiter list in the ww_mutex error exit path to prevent this. Fixes: add461325ec5 ("locking/rtmutex: Extend the rtmutex core to support ww_mutex") Reported-by: Sebastian Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210825102454.042280541@linutronix.de commit c3123c431447da99db160264506de9897c003513 Author: Thomas Gleixner Date: Wed Aug 25 12:33:12 2021 +0200 locking/rtmutex: Dont dereference waiter lockless The new rt_mutex_spin_on_onwer() loop checks whether the spinning waiter is still the top waiter on the lock by utilizing rt_mutex_top_waiter(), which is broken because that function contains a sanity check which dereferences the top waiter pointer to check whether the waiter belongs to the lock. That's wrong in the lockless spinwait case: CPU 0 CPU 1 rt_mutex_lock(lock) rt_mutex_lock(lock); queue(waiter0) waiter0 == rt_mutex_top_waiter(lock) rt_mutex_spin_on_onwer(lock, waiter0) { queue(waiter1) waiter1 == rt_mutex_top_waiter(lock) ... top_waiter = rt_mutex_top_waiter(lock) leftmost = rb_first_cached(&lock->waiters); -> signal dequeue(waiter1) destroy(waiter1) w = rb_entry(leftmost, ....) BUG_ON(w->lock != lock) <- UAF The BUG_ON() is correct for the case where the caller holds lock->wait_lock which guarantees that the leftmost waiter entry cannot vanish. For the lockless spinwait case it's broken. Create a new helper function which avoids the pointer dereference and just compares the leftmost entry pointer with current's waiter pointer to validate that currrent is still elegible for spinning. Fixes: 992caf7f1724 ("locking/rtmutex: Add adaptive spinwait mechanism") Reported-by: Sebastian Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210825102453.981720644@linutronix.de commit 21e39809fd7c4b8ff3662f23e0168e87594c8ca8 Author: Chen-Yu Tsai Date: Wed Aug 25 11:37:04 2021 +0800 regulator: vctrl: Avoid lockdep warning in enable/disable ops vctrl_enable() and vctrl_disable() call regulator_enable() and regulator_disable(), respectively. However, vctrl_* are regulator ops and should not be calling the locked regulator APIs. Doing so results in a lockdep warning. Instead of exporting more internal regulator ops, model the ctrl supply as an actual supply to vctrl-regulator. At probe time this driver still needs to use the consumer API to fetch its constraints, but otherwise lets the regulator core handle the upstream supply for it. The enable/disable/is_enabled ops are not removed, but now only track state internally. This preserves the original behavior with the ops being available, but one could argue that the original behavior was already incorrect: the internal state would not match the upstream supply if that supply had another consumer that enabled the supply, while vctrl-regulator was not enabled. The lockdep warning is as follows: WARNING: possible circular locking dependency detected 5.14.0-rc6 #2 Not tainted ------------------------------------------------------ swapper/0/1 is trying to acquire lock: ffffffc011306d00 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent (arch/arm64/include/asm/current.h:19 include/linux/ww_mutex.h:111 drivers/regulator/core.c:329) but task is already holding lock: ffffff8004a77160 (regulator_ww_class_mutex){+.+.}-{3:3}, at: regulator_lock_recursive (drivers/regulator/core.c:156 drivers/regulator/core.c:263) which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (regulator_ww_class_mutex){+.+.}-{3:3}: __mutex_lock_common (include/asm-generic/atomic-instrumented.h:606 include/asm-generic/atomic-long.h:29 kernel/locking/mutex.c:103 kernel/locking/mutex.c:144 kernel/locking/mutex.c:963) ww_mutex_lock (kernel/locking/mutex.c:1199) regulator_lock_recursive (drivers/regulator/core.c:156 drivers/regulator/core.c:263) regulator_lock_dependent (drivers/regulator/core.c:343) regulator_enable (drivers/regulator/core.c:2808) set_machine_constraints (drivers/regulator/core.c:1536) regulator_register (drivers/regulator/core.c:5486) devm_regulator_register (drivers/regulator/devres.c:196) reg_fixed_voltage_probe (drivers/regulator/fixed.c:289) platform_probe (drivers/base/platform.c:1427) [...] -> #1 (regulator_ww_class_acquire){+.+.}-{0:0}: regulator_lock_dependent (include/linux/ww_mutex.h:129 drivers/regulator/core.c:329) regulator_enable (drivers/regulator/core.c:2808) set_machine_constraints (drivers/regulator/core.c:1536) regulator_register (drivers/regulator/core.c:5486) devm_regulator_register (drivers/regulator/devres.c:196) reg_fixed_voltage_probe (drivers/regulator/fixed.c:289) [...] -> #0 (regulator_list_mutex){+.+.}-{3:3}: __lock_acquire (kernel/locking/lockdep.c:3052 (discriminator 4) kernel/locking/lockdep.c:3174 (discriminator 4) kernel/locking/lockdep.c:3789 (discriminator 4) kernel/locking/lockdep.c:5015 (discriminator 4)) lock_acquire (arch/arm64/include/asm/percpu.h:39 kernel/locking/lockdep.c:438 kernel/locking/lockdep.c:5627) __mutex_lock_common (include/asm-generic/atomic-instrumented.h:606 include/asm-generic/atomic-long.h:29 kernel/locking/mutex.c:103 kernel/locking/mutex.c:144 kernel/locking/mutex.c:963) mutex_lock_nested (kernel/locking/mutex.c:1125) regulator_lock_dependent (arch/arm64/include/asm/current.h:19 include/linux/ww_mutex.h:111 drivers/regulator/core.c:329) regulator_enable (drivers/regulator/core.c:2808) vctrl_enable (drivers/regulator/vctrl-regulator.c:400) _regulator_do_enable (drivers/regulator/core.c:2617) _regulator_enable (drivers/regulator/core.c:2764) regulator_enable (drivers/regulator/core.c:308 drivers/regulator/core.c:2809) _set_opp (drivers/opp/core.c:819 drivers/opp/core.c:1072) dev_pm_opp_set_rate (drivers/opp/core.c:1164) set_target (drivers/cpufreq/cpufreq-dt.c:62) __cpufreq_driver_target (drivers/cpufreq/cpufreq.c:2216 drivers/cpufreq/cpufreq.c:2271) cpufreq_online (drivers/cpufreq/cpufreq.c:1488 (discriminator 2)) cpufreq_add_dev (drivers/cpufreq/cpufreq.c:1563) subsys_interface_register (drivers/base/bus.c:?) cpufreq_register_driver (drivers/cpufreq/cpufreq.c:2819) dt_cpufreq_probe (drivers/cpufreq/cpufreq-dt.c:344) [...] other info that might help us debug this: Chain exists of: regulator_list_mutex --> regulator_ww_class_acquire --> regulator_ww_class_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(regulator_ww_class_mutex); lock(regulator_ww_class_acquire); lock(regulator_ww_class_mutex); lock(regulator_list_mutex); *** DEADLOCK *** 6 locks held by swapper/0/1: #0: ffffff8002d32188 (&dev->mutex){....}-{3:3}, at: __device_driver_lock (drivers/base/dd.c:1030) #1: ffffffc0111a0520 (cpu_hotplug_lock){++++}-{0:0}, at: cpufreq_register_driver (drivers/cpufreq/cpufreq.c:2792 (discriminator 2)) #2: ffffff8002a8d918 (subsys mutex#9){+.+.}-{3:3}, at: subsys_interface_register (drivers/base/bus.c:1033) #3: ffffff800341bb90 (&policy->rwsem){+.+.}-{3:3}, at: cpufreq_online (include/linux/bitmap.h:285 include/linux/cpumask.h:405 drivers/cpufreq/cpufreq.c:1399) #4: ffffffc011f0b7b8 (regulator_ww_class_acquire){+.+.}-{0:0}, at: regulator_enable (drivers/regulator/core.c:2808) #5: ffffff8004a77160 (regulator_ww_class_mutex){+.+.}-{3:3}, at: regulator_lock_recursive (drivers/regulator/core.c:156 drivers/regulator/core.c:263) stack backtrace: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc6 #2 7c8f8996d021ed0f65271e6aeebf7999de74a9fa Hardware name: Google Scarlet (DT) Call trace: dump_backtrace (arch/arm64/kernel/stacktrace.c:161) show_stack (arch/arm64/kernel/stacktrace.c:218) dump_stack_lvl (lib/dump_stack.c:106 (discriminator 2)) dump_stack (lib/dump_stack.c:113) print_circular_bug (kernel/locking/lockdep.c:?) check_noncircular (kernel/locking/lockdep.c:?) __lock_acquire (kernel/locking/lockdep.c:3052 (discriminator 4) kernel/locking/lockdep.c:3174 (discriminator 4) kernel/locking/lockdep.c:3789 (discriminator 4) kernel/locking/lockdep.c:5015 (discriminator 4)) lock_acquire (arch/arm64/include/asm/percpu.h:39 kernel/locking/lockdep.c:438 kernel/locking/lockdep.c:5627) __mutex_lock_common (include/asm-generic/atomic-instrumented.h:606 include/asm-generic/atomic-long.h:29 kernel/locking/mutex.c:103 kernel/locking/mutex.c:144 kernel/locking/mutex.c:963) mutex_lock_nested (kernel/locking/mutex.c:1125) regulator_lock_dependent (arch/arm64/include/asm/current.h:19 include/linux/ww_mutex.h:111 drivers/regulator/core.c:329) regulator_enable (drivers/regulator/core.c:2808) vctrl_enable (drivers/regulator/vctrl-regulator.c:400) _regulator_do_enable (drivers/regulator/core.c:2617) _regulator_enable (drivers/regulator/core.c:2764) regulator_enable (drivers/regulator/core.c:308 drivers/regulator/core.c:2809) _set_opp (drivers/opp/core.c:819 drivers/opp/core.c:1072) dev_pm_opp_set_rate (drivers/opp/core.c:1164) set_target (drivers/cpufreq/cpufreq-dt.c:62) __cpufreq_driver_target (drivers/cpufreq/cpufreq.c:2216 drivers/cpufreq/cpufreq.c:2271) cpufreq_online (drivers/cpufreq/cpufreq.c:1488 (discriminator 2)) cpufreq_add_dev (drivers/cpufreq/cpufreq.c:1563) subsys_interface_register (drivers/base/bus.c:?) cpufreq_register_driver (drivers/cpufreq/cpufreq.c:2819) dt_cpufreq_probe (drivers/cpufreq/cpufreq-dt.c:344) [...] Reported-by: Brian Norris Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Fixes: e9153311491d ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage") Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20210825033704.3307263-3-wenst@chromium.org Signed-off-by: Mark Brown commit 98e47570ba985f2310586c80409238200fa3170f Author: Chen-Yu Tsai Date: Wed Aug 25 11:37:03 2021 +0800 regulator: vctrl: Use locked regulator_get_voltage in probe path In commit e9153311491d ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage"), all calls to get/set the voltage of the control regulator were switched to unlocked versions to avoid deadlocks. However, the call in the probe path is done without regulator locks held. In this case the locked version should be used. Switch back to the locked regulator_get_voltage() in the probe path to avoid any mishaps. Fixes: e9153311491d ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage") Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20210825033704.3307263-2-wenst@chromium.org Signed-off-by: Mark Brown commit a8946f032eeace6eeb4e51e518275010e5528660 Author: Shengjiu Wang Date: Wed Aug 25 15:14:41 2021 +0800 ASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER Change dev_err to dev_err_probe for no need print error message when defer probe happens. Fixes: 39f8405c3e50 ("ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1629875681-16373-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 8d3019b63b3d92c9b5f1548f600485d39262bbe1 Author: Derek Fang Date: Wed Aug 25 12:03:46 2021 +0800 ASoC: rt5682: Fix the vol+ button detection issue Fix the wrong button vol+ detection issue with some brand headsets by fine tuning the threshold of button vol+ and SAR ADC button accuracy. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20210825040346.28346-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit dc2d01c754c378a4748ac72c5516d45da7640123 Author: Peter Ujfalusi Date: Wed Aug 25 15:25:19 2021 +0300 ASoC: Intel: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static Marking the two jack gpio as static fixes the following Sparse errors: sound/soc/intel/boards/bytcr_rt5640.c:468:26: error: symbol 'rt5640_jack_gpio' was not declared. Should it be static? sound/soc/intel/boards/bytcr_rt5640.c:475:26: error: symbol 'rt5640_jack2_gpio' was not declared. Should it be static? Fixes: 9ba00856686ad ("ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210825122519.3364-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 2d02e7d7d04f54fa573685a92c4a34eb8a76c9de Merge: 88939e7375735 e6d0b92ac00b5 Author: Mark Brown Date: Wed Aug 25 14:14:30 2021 +0100 Merge branch 'for-5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.15 commit 1d1cf156dc176e30eeaced5cf1450d582d387b81 Author: Christoph Hellwig Date: Wed Aug 25 09:54:38 2021 +0200 sg: pass the device name to blk_trace_setup Fix a regression that passed a NULL device name to blk_trace_setup accidentally. Fixes: aebbb5831fbd ("sg: do not allocate a gendisk") Reported-by: syzbot+f74aa89114a236643919@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig Reviewed-by: Max Gurtovoy Link: https://lore.kernel.org/r/20210825075438.1883687-1-hch@lst.de Signed-off-by: Jens Axboe commit 1e294970fc00f45c1f17fb442c26a7e3fc9789b1 Author: Shaokun Zhang Date: Wed Aug 25 14:19:51 2021 +0800 block, bfq: cleanup the repeated declaration Function 'bfq_entity_to_bfqq' is declared twice, so remove the repeated declaration and blank line. Cc: Paolo Valente Cc: Jens Axboe Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/1629872391-46399-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Jens Axboe commit cc40b7225151f611ef837f6403cfaeadc7af214a Author: Eric Biggers Date: Tue Aug 24 22:59:18 2021 -0700 blk-crypto: fix check for too-large dun_bytes dun_bytes needs to be less than or equal to the IV size of the encryption mode, not just less than or equal to BLK_CRYPTO_MAX_IV_SIZE. Currently this doesn't matter since blk_crypto_init_key() is never actually passed invalid values, but we might as well fix this. Fixes: a892c8d52c02 ("block: Inline encryption support for blk-mq") Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20210825055918.51975-1-ebiggers@kernel.org Signed-off-by: Jens Axboe commit e3f30ab28ac866256169153157f466d90f44f122 Merge: 9270c565b031c 246b184fffdce Author: David S. Miller Date: Wed Aug 25 13:44:30 2021 +0100 Merge branch 'pktgen-samples-next' Juhee Kang says: ==================== samples: pktgen: enhance the ability to print the execution results of samples This patch series improves the ability to print the execution result of pktgen samples by adding a line which calls the function before termination and adding trap SIGINT. Also, this series documents the latest pktgen usage options. Currently, pktgen samples print the execution result when terminated usually. However, sample03 is not working properly. This is results of sample04 and sample03: # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 1 Running... ctrl^C to stop Device: eth0@0 Result: OK: 19(c5+d13) usec, 1 (60byte,0frags) 51762pps 24Mb/sec (24845760bps) errors: 0 # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample03_burst_single_flow.sh -n 1 Running... ctrl^C to stop Because sample03 doesn't call the function which prints the execution result when terminated normally, unlike other samples. So the first commit solves this issue by adding a line which calls the function before termination. Also, all pktgen samples are able to send infinite messages per thread by setting the count option to 0, and pktgen is stopped by Ctrl-C. However, the sample besides sample{3...5} don't work appropriately because Ctrl-C stops the script, not just pktgen. This is results of samples: # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 0 Running... ctrl^C to stop ^CDevice: eth0@0 Result: OK: 569657(c569538+d118) usec, 84650 (60byte,0frags) 148597pps 71Mb/sec (71326560bps) errors: 0 # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -n 0 Running... ctrl^C to stop ^C # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample02_multiqueue.sh -n 0 Running... ctrl^C to stop ^C # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample06_numa_awared_queue_irq_affinity.sh -n 0 Running... ctrl^C to stop ^C # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_bench_xmit_mode_netif_receive.sh -n 0 Running... ctrl^C to stop ^C # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_bench_xmit_mode_queue_xmit.sh -n 0 Running... ctrl^C to stop ^C So the second commit solves this issue by adding trap SIGINT. Also, changes control_c function to print_results to maintain consistency with other samples on the first commit and second commit. And current pktgen.rst documentation doesn't add the latest pktgen sample usage options such as count and IPv6, and so on. Also, the old pktgen sample scripts are still included in the document. The old scripts were removed by the commit a4b6ade8359f ("samples/pktgen: remove remaining old pktgen sample scripts"). Thus, the last commit documents the latest pktgen sample usage and removes old sample scripts. And fixes a minor typo. ==================== Signed-off-by: David S. Miller commit 246b184fffdcead3710228e3bff744ce8c9828a3 Author: Juhee Kang Date: Wed Aug 25 19:57:17 2021 +0900 pktgen: document the latest pktgen usage options Currently, the pktgen.rst documentation doesn't cover the latest pktgen sample usage options such as count and IPv6, and so on. Also, this documentation includes the old sample scripts which are no longer use because it was removed by the commit a4b6ade8359f ("samples/pktgen : remove remaining old pktgen sample scripts") Thus, this commit documents pktgen sample usage using the latest options and removes old sample scripts, and fixes a minor typo. Signed-off-by: Juhee Kang Signed-off-by: David S. Miller commit 6c882bdc4bcd63e164f05738e7677b8a62fc0ec1 Author: Juhee Kang Date: Wed Aug 25 19:57:16 2021 +0900 samples: pktgen: add trap SIGINT for printing execution result All pktgen samples can send indefinitely num messages per thread by setting the count option to 0(-n 0). If running sample with setting count 0 and press Ctrl-C to stop this program, the program prints the result of the execution so far. Currently, the samples besides sample{3...5} don't work properly. Because Ctrl-C stops the script, not just pktgen. This is results of samples: # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 0 Running... ctrl^C to stop ^CDevice: eth0@0 Result: OK: 569657(c569538+d118) usec, 84650 (60byte,0frags) 148597pps 71Mb/sec (71326560bps) errors: 0 # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -n 0 Running... ctrl^C to stop ^C In order to solve this, this commit adds trap SIGINT. Also, this commit changes control_c function to print_result to maintain consistency with other samples. Signed-off-by: Juhee Kang Signed-off-by: David S. Miller commit c0e9422c4e6ca9abd4bd6e1598400c7231eb600b Author: Juhee Kang Date: Wed Aug 25 19:57:15 2021 +0900 samples: pktgen: fix to print when terminated normally Currently, most pktgen samples print the execution result when the program is terminated normally. However, sample03 doesn't work appropriately. This is results of samples: # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 1 Running... ctrl^C to stop Device: eth0@0 Result: OK: 19(c5+d13) usec, 1 (60byte,0frags) 51762pps 24Mb/sec (24845760bps) errors: 0 # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample03_burst_single_flow.sh -n 1 Running... ctrl^C to stop The reason why it doesn't print the execution result when the program is terminated usually is that sample03 doesn't call the function which prints the result, unlike other samples. So, this commit solves this issue by calling the function before termination. Also, this commit changes control_c function to print_result to maintain consistency with other samples. Signed-off-by: Juhee Kang Signed-off-by: David S. Miller commit 9270c565b031cb54f74e9f0e326f2fcef020c872 Merge: fbcf8a340150a 66c312ea1d374 Author: David S. Miller Date: Wed Aug 25 13:39:02 2021 +0100 Merge branch 'octeontx2-traffic-shaping' Sunil Goutham says: ==================== Octeontx2: Traffic shaping and SDP link config support This patch series adds support for traffic shaping configuration on all silicons available after 96xx C0. And also adds SDP link related configuration needed when Octeon is connected as an end-point and traffic needs to flow from end-point to host and vice versa. Series also has other changes like - New mbox messages in admin function driver for PF/VF drivers to retrieve available HW resource count. HW resources like block LFs, bandwidth profiles etc are covered. - Added PTP device ID for new CN10K and 95O silicons. - etc ==================== Signed-off-by: David S. Miller commit 66c312ea1d3749783440f12e8dfb6db45512ea14 Author: Sunil Goutham Date: Wed Aug 25 17:48:46 2021 +0530 octeontx2-af: Add mbox to retrieve bandwidth profile free count Added mbox for PF/VF drivers to retrieve current ingress bandwidth profile free count. Also added current policer timeunit configuration info based on which ratelimiting decisions can be taken by PF/VF drivers. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 18603683d7663b3a4da31ce8296a3049f4464e50 Author: Sunil Goutham Date: Wed Aug 25 17:48:45 2021 +0530 octeontx2-af: Remove channel verification while installing MCAM rules New usecases are popping up where in user wants to install common MCAM filters for all interfaces. Having channel verification will result in duplicating such MCAM filters for each of the ingress interface. Hence removed channel verification. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit a8b90c9d26d64993f7649794be8144a74431a274 Author: Subbaraya Sundeep Date: Wed Aug 25 17:48:44 2021 +0530 octeontx2-af: Add PTP device id for CN10K and 95O silcons CN10K slicon has different device id for PTP device. Hence this patch updates the driver with new id. Though ptp driver being a separate driver AF manages configuring PTP block by all PFs. To manage ptp, AF driver checks in its probe whether 1. ptp hardware device found on silicon 2. A driver is bound to ptp device 3. The ptp driver probe is successful In failure of cases 1 and 3, AF proceeds with out ptp and for case 2 defers the probe. This patch refactors code also to check for all the PTP device ids given in ptp device ids table for case 1. Also added PTP device ID for 95O silicon Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 275e5d175de12dc9df594733b2f6738e5199e261 Author: George Cherian Date: Wed Aug 25 17:48:43 2021 +0530 octeontx2-af: Add free rsrc count mbox msg Upon receiving the MBOX_MSG_FREE_RSRC_CNT, the AF will find out the current number of free resources and reply it back to the requester. No guarantee is given on the future state of the free resources yet. If another requester sends MBOX_MSG_ATTACH_RESOURCES after this call, the number of available resources might change. Signed-off-by: George Cherian Signed-off-by: Stanislaw Kardach Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit fe1939bb23407f2110eecff212ba4c07c4c83fd3 Author: Radha Mohan Chintakuntla Date: Wed Aug 25 17:48:42 2021 +0530 octeontx2-af: Add SDP interface support Added support for packet IO via SDK links which is used when Octeon is connected as a end-point. Traffic host to end-point and vice versa flow through SDP links. This patch also support dual SDP blocks supported in 98xx silicon. Signed-off-by: Radha Mohan Chintakuntla Signed-off-by: Nalla Pradeep Signed-off-by: Subrahmanyam Nilla Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit aefaa8c71555de4db7fc8d9247a2c896dfdf0eb0 Author: Harman Kalra Date: Wed Aug 25 17:48:41 2021 +0530 octeontx2-af: nix and lbk in loop mode in 98xx In 98xx, there are 2 NIX blocks and 4 LBK blocks present. The way these NIX-LBK should be configured depends on the use case. By default loopback functionality is supported in AF VF pairs which are attached to NIX0 and NIX1 LFs alternatively to ensure load balancing. NIX0 transmits a packet to LBK1 which will be received by NIX1 and packet transmitted by NIX1 will get received by NIX0 via LBK2. There are some requirements where only one AF VF is used and respective NIX is expected to operate in a mode where it can receive it own packet back. This can be achieved if NIX0 sends packet to LBK0 and not LBK1. Adding a flag in LF alloc request mailbox which can setup NIX0 to use LBK0 and NIX1 can use LBK3. Signed-off-by: Harman Kalra Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 039190bb353a16657b44c5833bcad57e029c6934 Author: Subbaraya Sundeep Date: Wed Aug 25 17:48:40 2021 +0530 octeontx2-pf: cleanup transmit link deriving logic Unlike OcteonTx2, the channel numbers used by CGX/RPM and LBK on CN10K silicons aren't fixed in HW. They are SW programmable, hence we cannot derive transmit link from static channel numbers anymore. Get the same from admin function via mailbox. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 72e192a163d0959d4e74342850a31b241baba422 Author: Jerin Jacob Date: Wed Aug 25 17:48:39 2021 +0530 octeontx2-af: Allow to configure flow tag LSB byte as RSS adder Before C0 HW revision, The RSS adder was computed based the following static formula. rss_adder<7:0> = flow_tag<7:0> ^ flow_tag<15:8> ^ flow_tag<23:16> ^ flow_tag<31:24> The above scheme has the following drawbacks: 1) It is not in line with other standard NIC behavior. 2) There can be an SW use case where SW can compute the hash upfront using Toeplitz function and predict the queue selection to optimize some packet lookup function. The nonstandard way of doing XOR makes the consumer to not predict the queue selection. C0 HW revision onwards, The HW can configure the rss_adder<7:0> as flow_tag<7:0> to align with standard NICs. This patch adds an option to select legacy RSS adder mode vs standard NIC behavior by setting NIX_LF_RSS_TAG_LSB_AS_ADDER flag. Since this bit field is used as reserved in old HW revisions, No need to have an additional HW version check. Signed-off-by: Jerin Jacob Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit d06411632e80d0ef4472a7cace28a6e3669d169a Author: Nithin Dabilpuram Date: Wed Aug 25 17:48:38 2021 +0530 octeontx2-af: enable tx shaping feature for 96xx C0 Starting from 96xx C0 onwards all silicons support traffic shaping. This patch enables that feature along with other changes - When PIR/CIR shaping config is modified, toggle SW_XOFF for config to take effect - Before SMQ flush, clear SW_XOFF at all parent schedulers - Support to read current transmit scheduler configuration via mbox Signed-off-by: Nithin Dabilpuram Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 3c69a5f22223fa3e312689ec218b5059784d49d7 Author: Kajol Jain Date: Wed Aug 18 22:45:56 2021 +0530 powerpc/perf: Fix the check for SIAR value Incase of random sampling, there can be scenarios where Sample Instruction Address Register(SIAR) may not latch to the sampled instruction and could result in the value of 0. In these scenarios it is preferred to return regs->nip. These corner cases are seen in the previous generation (p9) also. Patch adds the check for SIAR value along with regs_use_siar and siar_valid checks so that the function will return regs->nip incase SIAR is zero. Patch drops the code under PPMU_P10_DD1 flag check which handles SIAR 0 case only for Power10 DD1. Fixes: 2ca13a4cc56c9 ("powerpc/perf: Use regs->nip when SIAR is zero") Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210818171556.36912-3-kjain@linux.ibm.com commit cc90c6742ef5b438f4cb86029d7a794bd0a44a06 Author: Kajol Jain Date: Wed Aug 18 22:45:55 2021 +0530 powerpc/perf: Drop the case of returning 0 as instruction pointer Drop the case of returning 0 as instruction pointer since kernel never executes at 0 and userspace almost never does either. Fixes: e6878835ac47 ("powerpc/perf: Sample only if SIAR-Valid bit is set in P7+") Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210818171556.36912-2-kjain@linux.ibm.com commit b1643084d164cea0c107a39bcdf0119fc52619af Author: Kajol Jain Date: Wed Aug 18 22:45:54 2021 +0530 powerpc/perf: Use stack siar instead of mfspr Minor optimization in the 'perf_instruction_pointer' function code by making use of stack siar instead of mfspr. Fixes: 75382aa72f06 ("powerpc/perf: Move code to select SIAR or pt_regs into perf_read_regs") Signed-off-by: Kajol Jain Tested-by: Nageswara R Sastry Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210818171556.36912-1-kjain@linux.ibm.com commit aaa4db12ef7bdc3e343580d1d3c0b2a8874fc1fb Author: Pavel Begunkov Date: Wed Aug 25 12:25:47 2021 +0100 io_uring: accept directly into fixed file table As done with open opcodes, allow accept to skip installing fd into processes' file tables and put it directly into io_uring's fixed file table. Same restrictions and design as for open. Suggested-by: Josh Triplett Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/6d16163f376fac7ac26a656de6b42199143e9721.1629888991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a7083ad5e30767ede4ff49d7471ea9c078702db2 Author: Pavel Begunkov Date: Wed Aug 25 12:25:46 2021 +0100 io_uring: hand code io_accept() fd installing Make io_accept() to handle file descriptor allocations and installation. A preparation patch for bypassing file tables. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/5b73d204caa0ce979ccb98136695b60f52a3d98c.1629888991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b9445598d8c60a1379887b957024b71343965f74 Author: Pavel Begunkov Date: Wed Aug 25 12:25:45 2021 +0100 io_uring: openat directly into fixed fd table Instead of opening a file into a process's file table as usual and then registering the fd within io_uring, some users may want to skip the first step and place it directly into io_uring's fixed file table. This patch adds such a capability for IORING_OP_OPENAT and IORING_OP_OPENAT2. The behaviour is controlled by setting sqe->file_index, where 0 implies the old behaviour using normal file tables. If non-zero value is specified, then it will behave as described and place the file into a fixed file slot sqe->file_index - 1. A file table should be already created, the slot should be valid and empty, otherwise the operation will fail. Keep the error codes consistent with IORING_OP_FILES_UPDATE, ENXIO and EINVAL on inappropriate fixed tables, and return EBADF on collision with already registered file. Note: IOSQE_FIXED_FILE can't be used to switch between modes, because accept takes a file, and it already uses the flag with a different meaning. Suggested-by: Josh Triplett Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/e9b33d1163286f51ea707f87d95bd596dada1e65.1629888991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d32f89da7fa8ccc8b3fb8f909d61e42b9bc39329 Author: Pavel Begunkov Date: Wed Aug 25 12:25:44 2021 +0100 net: add accept helper not installing fd Introduce and reuse a helper that acts similarly to __sys_accept4_file() but returns struct file instead of installing file descriptor. Will be used by io_uring. Signed-off-by: Pavel Begunkov Acked-by: Jakub Kicinski Signed-off-by: Jens Axboe Acked-by: David S. Miller Link: https://lore.kernel.org/r/c57b9e8e818d93683a3d24f8ca50ca038d1da8c4.1629888991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit bbac7a92a46f0876e588722ebe552ddfe6fd790f Author: Johannes Berg Date: Mon Aug 9 11:24:09 2021 +0200 dmaengine: ioat: depends on !UML Now that UML has PCI support, this driver must depend also on !UML since it pokes at X86_64 architecture internals that don't exist on ARCH=um. Reported-by: Geert Uytterhoeven Signed-off-by: Johannes Berg Acked-by: Dave Jiang Link: https://lore.kernel.org/r/20210809112409.a3a0974874d2.I2ffe3d11ed37f735da2f39884a74c953b258b995@changeid Signed-off-by: Vinod Koul commit 9806eb5c79579e200f88660e043706eb490547e6 Author: Dave Jiang Date: Fri Aug 6 10:38:37 2021 -0700 dmaengine: idxd: set descriptor allocation size to threshold for swq Since submission is sent to limited portal, the actual wq size for shared wq is set by the threshold rather than the wq size. When the wq type is shared, set the allocated descriptors to the threshold. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162827151733.3459223.3829837172226042408.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 0b030f54f094fcd42f4a607a675c1851129a58c8 Author: Dave Jiang Date: Fri Aug 6 10:37:40 2021 -0700 dmaengine: idxd: make submit failure path consistent on desc freeing The submission path for dmaengine API does not do descriptor freeing on failure. Also, with the abort mechanism, the freeing of descriptor happens when the abort callback is completed. Therefore free descriptor on all error paths for submission call to make things consistent. Also remove the double free that would happen on abort in idxd_dma_tx_submit() call. Fixes: 6b4b87f2c31a ("dmaengine: idxd: fix submission race window") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162827146072.3459011.10255348500504659810.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit fbcf8a340150abd20bf44fc706362b0827157fe8 Author: Cai Huoqing Date: Wed Aug 25 14:25:13 2021 +0800 net: ethernet: actions: Add helper dependency on COMPILE_TEST it's helpful for complie test in other platform(e.g.X86) Signed-off-by: Cai Huoqing Signed-off-by: David S. Miller commit 7bc416f1471686faa8030cd5338f6a5370e01b25 Author: Lukas Bulwahn Date: Mon Aug 23 22:27:29 2021 +0200 netfilter: x_tables: handle xt_register_template() returning an error value Commit fdacd57c79b7 ("netfilter: x_tables: never register tables by default") introduces the function xt_register_template(), and in one case, a call to that function was missing the error-case handling. Handle when xt_register_template() returns an error value. This was identified with the clang-analyzer's Dead-Store analysis. Signed-off-by: Lukas Bulwahn Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6c89dac5b98573222798a6b9c4973a031eea89ee Author: Pablo Neira Ayuso Date: Wed Aug 18 13:56:39 2021 +0200 netfilter: ctnetlink: missing counters and timestamp in nfnetlink_{log,queue} Add counters and timestamps (if available) to the conntrack object that is represented in nfnetlink_log and _queue messages. Signed-off-by: Pablo Neira Ayuso commit 1c74b89171c39eabc0faba7eb0500c3d73a0e1d1 Author: Nithin Dabilpuram Date: Wed Aug 25 11:16:21 2021 +0530 octeontx2-af: Wait for TX link idle for credits change NIX_AF_TX_LINKX_NORM_CREDIT holds running counter of tx credits available per link. But, tx credits should be configured based on MTU config. So MTU change needs tx credit count update. An issue exists whereby when both PF & VF are enabled and PF traffic is flowing, if VF requests for MTU update, updating the NORM_CREDIT register will lead to corruption of credit count and subsequent deadlock of tx link as the NORM_CREDIT register holds running count. This patch provides workaround by pausing link traffic using NIX_AF_TL1X_SW_XOFF, waiting for existing packets to drain, and used credits be returned before updating new credit count. Signed-off-by: Nithin Dabilpuram Signed-off-by: Sunil Goutham Signed-off-by: Geetha sowjanya Signed-off-by: David S. Miller commit 906999c9b653dc27d22d9a7f53a5a6637c0e670e Author: Nithin Dabilpuram Date: Wed Aug 25 11:09:04 2021 +0530 octeontx2-af: Change the order of queue work and interrupt disable Clear and disable interrupt before queueing work as there might be a chance that work gets completed on other core faster and interrupt enable as a part of the work completes before interrupt disable in the interrupt context. This leads to permanent disable of interrupt. Signed-off-by: Nithin Dabilpuram Signed-off-by: Sunil Goutham Signed-off-by: Geetha sowjanya Signed-off-by: David S. Miller commit ae2c341eb010b5a78499fcf6a97ca47056d217ae Author: Geetha sowjanya Date: Wed Aug 25 11:05:03 2021 +0530 octeontx2-af: cn10k: Set cache lines for NPA batch alloc Set NPA batch allocation engine to process 35 cache lines per turn on CN10k platform. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit bd1431db0b8131098a285c8cc6a357629b4362e5 Author: Florian Westphal Date: Mon Aug 16 17:16:26 2021 +0200 netfilter: ecache: remove nf_exp_event_notifier structure Reuse the conntrack event notofier struct, this allows to remove the extra register/unregister functions and avoids a pointer in struct net. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b86c0e6429dac2458694495aeebf15f4fe6b269d Author: Florian Westphal Date: Mon Aug 16 17:16:25 2021 +0200 netfilter: ecache: prepare for event notifier merge This prepares for merge for ct and exp notifier structs. The 'fcn' member is renamed to something unique. Second, the register/unregister api is simplified. There is only one implementation so there is no need to do any error checking. Replace the EBUSY logic with WARN_ON_ONCE. This allows to remove error unwinding. The exp notifier register/unregister function is removed in a followup patch. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b3afdc17586392e023ac57155970269d03d4e886 Author: Florian Westphal Date: Mon Aug 16 17:16:24 2021 +0200 netfilter: ecache: add common helper for nf_conntrack_eventmask_report nf_ct_deliver_cached_events and nf_conntrack_eventmask_report are very similar. Split nf_conntrack_eventmask_report into a common helper function that can be used for both cases. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 9291f0902d0c3d2af8def02dc1387481d25b0a7e Author: Florian Westphal Date: Mon Aug 16 17:16:23 2021 +0200 netfilter: ecache: remove another indent level ... by changing: if (unlikely(ret < 0 || missed)) { if (ret < 0) { to if (likely(ret >= 0 && !missed)) goto out; if (ret < 0) { After this nf_conntrack_eventmask_report and nf_ct_deliver_cached_events look pretty much the same, next patch moves common code to a helper. This patch has no effect on generated code. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 478374a3c15f369e57fdd79d64d7a1d2eb307e16 Author: Florian Westphal Date: Mon Aug 16 17:16:22 2021 +0200 netfilter: ecache: remove one indent level nf_conntrack_eventmask_report and nf_ct_deliver_cached_events shared most of their code. This unifies the layout by changing if (nf_ct_is_confirmed(ct)) { foo } to if (!nf_ct_is_confirmed(ct))) return foo This removes one level of indentation. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 87e5ef4b19cec86c861e3ebab3a5d840ecc2f4a4 Author: Shaokun Zhang Date: Wed Aug 25 14:34:31 2021 +0800 mctp: Remove the repeated declaration Function 'mctp_dev_get_rtnl' is declared twice, so remove the repeated declaration. Cc: Jeremy Kerr Cc: Matt Johnston Cc: "David S. Miller" Cc: Jakub Kicinski Signed-off-by: Shaokun Zhang Signed-off-by: David S. Miller commit 45bc6125d1429b6d9db8595c794b5d71a09fef7d Merge: b87a542c5bb42 cbe8cd7d83e25 Author: David S. Miller Date: Wed Aug 25 11:19:38 2021 +0100 Merge tag 'linux-can-next-for-5.15-20210825' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine says: ==================== pull-request: can-next 2021-08-25 this is a pull request of 4 patches for net-next/master. The first patch is by Cai Huoqing, and enables COMPILE_TEST for the rcar CAN drivers. Lad Prabhakar contributes a patch for the rcar_canfd driver, fixing a redundant assignment. The last 2 patches are by Tang Bin, target the mscan driver, and clean up the driver by converting it to of_device_get_match_data() and removing a useless BUG_ON. ==================== Signed-off-by: David S. Miller commit b87a542c5bb42fb101ada5294b87fd2df0cab429 Merge: 6956fa394a474 0d13a1a464a02 Author: David S. Miller Date: Wed Aug 25 11:18:17 2021 +0100 Merge branch 'ravb-gbit-refactor' Biju Das says: ==================== Add Factorisation code to support Gigabit Ethernet driver The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are similar to the R-Car Ethernet AVB IP. The Gigabit Ethernet IP consists of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC). With a few changes in the driver we can support both IPs. This patch series aims to add factorisation code to support RZ/G2L SoC, hardware feature bits for gPTP feature, Multiple irq feature and optional reset support. Ref:- * https://lore.kernel.org/linux-renesas-soc/TYCPR01MB59334319695607A2683C1A5E86E59@TYCPR01MB5933.jpnprd01.prod.outlook.com/T/#t ==================== Signed-off-by: David S. Miller commit 0d13a1a464a023379291218ac051e2bf8f46b5d1 Author: Biju Das Date: Wed Aug 25 08:01:54 2021 +0100 ravb: Add reset support Reset support is present on R-Car. Let's support it, if it is available. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 511d74d9d86ceccb3463fd49adf9de95d4cb3772 Author: Biju Das Date: Wed Aug 25 08:01:53 2021 +0100 ravb: Factorise ravb_emac_init function The E-MAC IP on the R-Car AVB module has different initialization parameters for RX frame size, duplex settings, different offset for transfer speed setting and has magic packet detection support compared to E-MAC on RZ/G2L Gigabit Ethernet module. Factorise the ravb_emac_init function to support the later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit eb4fd127448b173df15b4e92ace016467b2fc441 Author: Biju Das Date: Wed Aug 25 08:01:52 2021 +0100 ravb: Factorise ravb_dmac_init function The DMAC IP on the R-Car AVB module has different initialization parameters for RCR, TGC, TCCR, RIC0, RIC2, and TIC compared to DMAC IP on the RZ/G2L Gigabit Ethernet module. Factorise the ravb_dmac_init function to support the later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 80f35a0df0866ad0eb88575bbdeba6c81123c20b Author: Biju Das Date: Wed Aug 25 08:01:51 2021 +0100 ravb: Factorise ravb_set_features RZ/G2L supports HW checksum on RX and TX whereas R-Car supports on RX. Factorise ravb_set_features to support this feature. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit cb21104f2c35c97a1c803c48f26ad99ff5c5c9d4 Author: Biju Das Date: Wed Aug 25 08:01:50 2021 +0100 ravb: Factorise ravb_adjust_link function R-Car supports 100 and 1000 Mbps transfer speed whereas RZ/G2L in addition support 10Mbps. Factorise ravb_adjust_link function in order to support 10Mbps speed. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit d5d95c11365bc880669bbc52786b176cf60dcd92 Author: Biju Das Date: Wed Aug 25 08:01:49 2021 +0100 ravb: Factorise ravb_rx function R-Car uses an extended descriptor in RX whereas, RZ/G2L uses normal descriptor in RX. Factorise the ravb_rx function to support the later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 7870a41848abf8ae634e2de54effbbf32d2a472d Author: Biju Das Date: Wed Aug 25 08:01:48 2021 +0100 ravb: Factorise ravb_ring_init function The ravb_ring_init function uses an extended descriptor in RX for R-Car and normal descriptor for RZ/G2L. Add a helper function for RX ring buffer allocation to support later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 1ae22c19e75cfbd36b24b43f9d8649b1988a4dff Author: Biju Das Date: Wed Aug 25 08:01:47 2021 +0100 ravb: Factorise ravb_ring_format function The ravb_ring_format function uses an extended descriptor in RX for R-Car compared to the normal descriptor for RZ/G2L. Factorise RX ring buffer buildup to extend the support for later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit bf46b7578404f6fbde0bc2e1ea60fe0fd6f207a8 Author: Biju Das Date: Wed Aug 25 08:01:46 2021 +0100 ravb: Factorise ravb_ring_free function R-Car uses extended descriptor in RX, whereas RZ/G2L uses normal descriptor. Factorise ravb_ring_free function so that it can support later SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit a69a3d094de38007ce54e4e1411b5769ed66a426 Author: Biju Das Date: Wed Aug 25 08:01:45 2021 +0100 ravb: Add ptp_cfg_active to struct ravb_hw_info There are some H/W differences for the gPTP feature between R-Car Gen3, R-Car Gen2, and RZ/G2L as below. 1) On R-Car Gen3, gPTP support is active in config mode. 2) On R-Car Gen2, gPTP support is not active in config mode. 3) RZ/G2L does not support the gPTP feature. Add a ptp_cfg_active hw feature bit to struct ravb_hw_info for supporting gPTP active in config mode for R-Car Gen3. This patch also removes enum ravb_chip_id, chip_id from both struct ravb_hw_info and struct ravb_private, as it is unused. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 8f27219a6191679333e703daf8bb66e5a1241aed Author: Biju Das Date: Wed Aug 25 08:01:44 2021 +0100 ravb: Add no_ptp_cfg_active to struct ravb_hw_info There are some H/W differences for the gPTP feature between R-Car Gen3, R-Car Gen2, and RZ/G2L as below. 1) On R-Car Gen2, gPTP support is not active in config mode. 2) On R-Car Gen3, gPTP support is active in config mode. 3) RZ/G2L does not support the gPTP feature. Add a no_ptp_cfg_active hw feature bit to struct ravb_hw_info for handling gPTP for R-Car Gen2. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 6de19fa0e9f7d8d1033810df1e53ae5b0c7b0d65 Author: Biju Das Date: Wed Aug 25 08:01:43 2021 +0100 ravb: Add multi_irq to struct ravb_hw_info R-Car Gen3 supports separate interrupts for E-MAC and DMA queues, whereas R-Car Gen2 and RZ/G2L have a single interrupt instead. Add a multi_irq hw feature bit to struct ravb_hw_info to enable this only for R-Car Gen3. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit c81d894226b94439c543e9cfac406c8024172fd7 Author: Biju Das Date: Wed Aug 25 08:01:42 2021 +0100 ravb: Remove the macros NUM_TX_DESC_GEN[23] For addressing 4 bytes alignment restriction on transmission buffer for R-Car Gen2 we use 2 descriptors whereas it is a single descriptor for other cases. Replace the macros NUM_TX_DESC_GEN[23] with magic number and add a comment to explain it. Signed-off-by: Biju Das Suggested-by: Geert Uytterhoeven Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit 6956fa394a474404d76f4c0584c70bcaefa7659e Merge: 1ca8a193cade7 8ded9160928e5 Author: David S. Miller Date: Wed Aug 25 11:14:34 2021 +0100 Merge branch 'dsa-sja1105-vlan-tags' Vladimir Oltean says: ==================== Make sja1105 treat tag_8021q VLANs more like real DSA tags This series solves a nuisance with the sja1105 driver, which is that non-DSA tagged packets sent directly by the DSA master would still exit the switch just fine. We also had an issue for packets coming from the outside world with a crafted DSA tag, the switch would not reject that tag but think it was valid. ==================== commit 8ded9160928e545c2e694b77a87263fa078ff4c6 Author: Vladimir Oltean Date: Tue Aug 24 20:15:02 2021 +0300 net: dsa: tag_sja1105: stop asking the sja1105 driver in sja1105_xmit_tpid Introduced in commit 38b5beeae7a4 ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously"), the sja1105_xmit_tpid function solved quite a different problem than our needs are now. Then, we used best-effort VLAN filtering and we were using the xmit_tpid to tunnel packets coming from an 8021q upper through the TX VLAN allocated by tag_8021q to that egress port. The need for a different VLAN protocol depending on switch revision came from the fact that this in itself was more of a hack to trick the hardware into accepting tunneled VLANs in the first place. Right now, we deny 8021q uppers (see sja1105_prechangeupper). Even if we supported them again, we would not do that using the same method of {tunneling the VLAN on egress, retagging the VLAN on ingress} that we had in the best-effort VLAN filtering mode. It seems rather simpler that we just allocate a VLAN in the VLAN table that is simply not used by the bridge at all, or by any other port. Anyway, I have 2 gripes with the current sja1105_xmit_tpid: 1. When sending packets on behalf of a VLAN-aware bridge (with the new TX forwarding offload framework) plus untagged (with the tag_8021q VLAN added by the tagger) packets, we can see that on SJA1105P/Q/R/S and later (which have a qinq_tpid of ETH_P_8021AD), some packets sent through the DSA master have a VLAN protocol of 0x8100 and others of 0x88a8. This is strange and there is no reason for it now. If we have a bridge and are therefore forced to send using that bridge's TPID, we can as well blend with that bridge's VLAN protocol for all packets. 2. The sja1105_xmit_tpid introduces a dependency on the sja1105 driver, because it looks inside dp->priv. It is desirable to keep as much separation between taggers and switch drivers as possible. Now it doesn't do that anymore. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b0b8c67eaa5c65f8426017e78fcce12dc7d85110 Author: Vladimir Oltean Date: Tue Aug 24 20:15:01 2021 +0300 net: dsa: sja1105: drop untagged packets on the CPU and DSA ports The sja1105 driver is a bit special in its use of VLAN headers as DSA tags. This is because in VLAN-aware mode, the VLAN headers use an actual TPID of 0x8100, which is understood even by the DSA master as an actual VLAN header. Furthermore, control packets such as PTP and STP are transmitted with no VLAN header as a DSA tag, because, depending on switch generation, there are ways to steer these control packets towards a precise egress port other than VLAN tags. Transmitting control packets as untagged means leaving a door open for traffic in general to be transmitted as untagged from the DSA master, and for it to traverse the switch and exit a random switch port according to the FDB lookup. This behavior is a bit out of line with other DSA drivers which have native support for DSA tagging. There, it is to be expected that the switch only accepts DSA-tagged packets on its CPU port, dropping everything that does not match this pattern. We perhaps rely a bit too much on the switches' hardware dropping on the CPU port, and place no other restrictions in the kernel data path to avoid that. For example, sja1105 is also a bit special in that STP/PTP packets are transmitted using "management routes" (sja1105_port_deferred_xmit): when sending a link-local packet from the CPU, we must first write a SPI message to the switch to tell it to expect a packet towards multicast MAC DA 01-80-c2-00-00-0e, and to route it towards port 3 when it gets it. This entry expires as soon as it matches a packet received by the switch, and it needs to be reinstalled for the next packet etc. All in all quite a ghetto mechanism, but it is all that the sja1105 switches offer for injecting a control packet. The driver takes a mutex for serializing control packets and making the pairs of SPI writes of a management route and its associated skb atomic, but to be honest, a mutex is only relevant as long as all parties agree to take it. With the DSA design, it is possible to open an AF_PACKET socket on the DSA master net device, and blast packets towards 01-80-c2-00-00-0e, and whatever locking the DSA switch driver might use, it all goes kaput because management routes installed by the driver will match skbs sent by the DSA master, and not skbs generated by the driver itself. So they will end up being routed on the wrong port. So through the lens of that, maybe it would make sense to avoid that from happening by doing something in the network stack, like: introduce a new bit in struct sk_buff, like xmit_from_dsa. Then, somewhere around dev_hard_start_xmit(), introduce the following check: if (netdev_uses_dsa(dev) && !skb->xmit_from_dsa) kfree_skb(skb); Ok, maybe that is a bit drastic, but that would at least prevent a bunch of problems. For example, right now, even though the majority of DSA switches drop packets without DSA tags sent by the DSA master (and therefore the majority of garbage that user space daemons like avahi and udhcpcd and friends create), it is still conceivable that an aggressive user space program can open an AF_PACKET socket and inject a spoofed DSA tag directly on the DSA master. We have no protection against that; the packet will be understood by the switch and be routed wherever user space says. Furthermore: there are some DSA switches where we even have register access over Ethernet, using DSA tags. So even user space drivers are possible in this way. This is a huge hole. However, the biggest thing that bothers me is that udhcpcd attempts to ask for an IP address on all interfaces by default, and with sja1105, it will attempt to get a valid IP address on both the DSA master as well as on sja1105 switch ports themselves. So with IP addresses in the same subnet on multiple interfaces, the routing table will be messed up and the system will be unusable for traffic until it is configured manually to not ask for an IP address on the DSA master itself. It turns out that it is possible to avoid that in the sja1105 driver, at least very superficially, by requesting the switch to drop VLAN-untagged packets on the CPU port. With the exception of control packets, all traffic originated from tag_sja1105.c is already VLAN-tagged, so only STP and PTP packets need to be converted. For that, we need to uphold the equivalence between an untagged and a pvid-tagged packet, and to remember that the CPU port of sja1105 uses a pvid of 4095. Now that we drop untagged traffic on the CPU port, non-aggressive user space applications like udhcpcd stop bothering us, and sja1105 effectively becomes just as vulnerable to the aggressive kind of user space programs as other DSA switches are (ok, users can also create 8021q uppers on top of the DSA master in the case of sja1105, but in future patches we can easily deny that, but it still doesn't change the fact that VLAN-tagged packets can still be injected over raw sockets). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 73ceab8326522cc06af9036c15fa2c21fdbdf4b0 Author: Vladimir Oltean Date: Tue Aug 24 20:15:00 2021 +0300 net: dsa: sja1105: prevent tag_8021q VLANs from being received on user ports Currently it is possible for an attacker to craft packets with a fake DSA tag and send them to us, and our user ports will accept them and preserve that VLAN when transmitting towards the CPU. Then the tagger will be misled into thinking that the packets came on a different port than they really came on. Up until recently there wasn't a good option to prevent this from happening. In SJA1105P and later, the MAC Configuration Table introduced two options called: - DRPSITAG: Drop Single Inner Tagged Frames - DRPSOTAG: Drop Single Outer Tagged Frames Because the sja1105 driver classifies all VLANs as "outer VLANs" (S-Tags), it would be in principle possible to enable the DRPSOTAG bit on ports using tag_8021q, and drop on ingress all packets which have a VLAN tag. When the switch is VLAN-unaware, this works, because it uses a custom TPID of 0xdadb, so any "tagged" packets received on a user port are probably a spoofing attempt. But when the switch overall is VLAN-aware, and some ports are standalone (therefore they use tag_8021q), the TPID is 0x8100, and the port can receive a mix of untagged and VLAN-tagged packets. The untagged ones will be classified to the tag_8021q pvid, and the tagged ones to the VLAN ID from the packet header. Yes, it is true that since commit 4fbc08bd3665 ("net: dsa: sja1105: deny 8021q uppers on ports") we no longer support this mixed mode, but that is a temporary limitation which will eventually be lifted. It would be nice to not introduce one more restriction via DRPSOTAG, which would make the standalone ports of a VLAN-aware switch drop genuinely VLAN-tagged packets. Also, the DRPSOTAG bit is not available on the first generation of switches (SJA1105E, SJA1105T). So since one of the key features of this driver is compatibility across switch generations, this makes it an even less desirable approach. The breakthrough comes from commit bef0746cf4cc ("net: dsa: sja1105: make sure untagged packets are dropped on ingress ports with no pvid"), where it became obvious that untagged packets are not dropped even if the ingress port is not in the VMEMB_PORT vector of that port's pvid. However, VLAN-tagged packets are subject to VLAN ingress checking/dropping. This means that instead of using the catch-all DRPSOTAG bit introduced in SJA1105P, we can drop tagged packets on a per-VLAN basis, and this is already compatible with SJA1105E/T. This patch adds an "allowed_ingress" argument to sja1105_vlan_add(), and we call it with "false" for tag_8021q VLANs on user ports. The tag_8021q VLANs still need to be allowed, of course, on ingress to DSA ports and CPU ports. We also need to refine the drop_untagged check in sja1105_commit_pvid to make it not freak out about this new configuration. Currently it will try to keep the configuration consistent between untagged and pvid-tagged packets, so if the pvid of a port is 1 but VLAN 1 is not in VMEMB_PORT, packets tagged with VID 1 will behave the same as untagged packets, and be dropped. This behavior is what we want for ports under a VLAN-aware bridge, but for the ports with a tag_8021q pvid, we want untagged packets to be accepted, but packets tagged with a header recognized by the switch as a tag_8021q VLAN to be dropped. So only restrict the drop_untagged check to apply to the bridge_pvid, not to the tag_8021q_pvid. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 1ca8a193cade7f49801cc79e20d5f2a123991cdf Author: DENG Qingfang Date: Wed Aug 25 00:52:52 2021 +0800 net: dsa: mt7530: manually set up VLAN ID 0 The driver was relying on dsa_slave_vlan_rx_add_vid to add VLAN ID 0. After the blamed commit, VLAN ID 0 won't be set up anymore, breaking software bridging fallback on VLAN-unaware bridges. Manually set up VLAN ID 0 to fix this. Fixes: 06cfb2df7eb0 ("net: dsa: don't advertise 'rx-vlan-filter' when not needed") Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e93826d35c647bd68c83af9ca97bba6eb3b2b711 Merge: 807d1032e09a4 c1a3e9f98dde4 Author: David S. Miller Date: Wed Aug 25 11:06:54 2021 +0100 Merge branch 'mana-EQ-sharing' Haiyang Zhang says: ==================== net: mana: Add support for EQ sharing The existing code uses (1 + #vPorts * #Queues) MSIXs, which may exceed the device limit. Support EQ sharing, so that multiple vPorts can share the same set of MSIXs. ==================== Signed-off-by: David S. Miller commit c1a3e9f98dde4782290d2c4871e42b7e76ad5593 Author: Haiyang Zhang Date: Tue Aug 24 09:46:01 2021 -0700 net: mana: Add WARN_ON_ONCE in case of CQE read overflow This is not an expected case normally. Add WARN_ON_ONCE in case of CQE read overflow, instead of failing silently. Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller commit 1e2d0824a9c3de5371a46601aac0c14af5c0a50a Author: Haiyang Zhang Date: Tue Aug 24 09:46:00 2021 -0700 net: mana: Add support for EQ sharing The existing code uses (1 + #vPorts * #Queues) MSIXs, which may exceed the device limit. Support EQ sharing, so that multiple vPorts (NICs) can share the same set of MSIXs. And, report the EQ-sharing capability bit to the host, which means the host can potentially offer more vPorts and queues to the VM. Also update the resource limit checking and error handling for better robustness. Now, we support up to 256 virtual ports per VF (it was 16/VF), and support up to 64 queues per vPort (it was 16). Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller commit e1b5683ff62e7b328317aec08869495992053e9d Author: Haiyang Zhang Date: Tue Aug 24 09:45:59 2021 -0700 net: mana: Move NAPI from EQ to CQ The existing code has NAPI threads polling on EQ directly. To prepare for EQ sharing among vPorts, move NAPI from EQ to CQ so that one EQ can serve multiple CQs from different vPorts. The "arm bit" is only set when CQ processing is completed to reduce the number of EQ entries, which in turn reduce the number of interrupts on EQ. Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller commit 807d1032e09a42732c374304554a088c6b5e8f92 Author: Shaokun Zhang Date: Wed Aug 25 11:06:55 2021 +0800 netxen_nic: Remove the repeated declaration Function 'netxen_rom_fast_read' is declared twice, so remove the repeated declaration. Cc: Manish Chopra Cc: Rahul Verma Cc: "David S. Miller" Cc: Jakub Kicinski Signed-off-by: Shaokun Zhang Signed-off-by: David S. Miller commit bc4f128d867289df2310d7e589372502a5d6e0cd Author: Nathan Chancellor Date: Tue Aug 24 13:51:04 2021 -0700 cxgb4: Properly revert VPD changes Clang warns: drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2785:2: error: variable 'kw_offset' is uninitialized when used here [-Werror,-Wuninitialized] FIND_VPD_KW(i, "RV"); ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2776:39: note: expanded from macro 'FIND_VPD_KW' var = pci_vpd_find_info_keyword(vpd, kw_offset, vpdr_len, name); \ ^~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2748:34: note: initialize the variable 'kw_offset' to silence this warning unsigned int vpdr_len, kw_offset, id_len; ^ = 0 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2785:2: error: variable 'vpdr_len' is uninitialized when used here [-Werror,-Wuninitialized] FIND_VPD_KW(i, "RV"); ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2776:50: note: expanded from macro 'FIND_VPD_KW' var = pci_vpd_find_info_keyword(vpd, kw_offset, vpdr_len, name); \ ^~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2748:23: note: initialize the variable 'vpdr_len' to silence this warning unsigned int vpdr_len, kw_offset, id_len; ^ = 0 2 errors generated. The series "PCI/VPD: Convert more users to the new VPD API functions" was applied to net-next when it should have been applied to the PCI tree because of build errors. However, commit 82e34c8a9bdf ("Revert "Revert "cxgb4: Search VPD with pci_vpd_find_ro_info_keyword()""") reapplied a change, resulting in the warning above. Properly revert commit 8d63ee602da3 ("cxgb4: Search VPD with pci_vpd_find_ro_info_keyword()") to fix the warning and restore proper functionality. This also reverts commit 3a93bedea050 ("cxgb4: Remove unused vpd_param member ec") to avoid future merge conflicts, as that change has been applied to the PCI tree. Link: https://lore.kernel.org/r/20210823120929.7c6f7a4f@canb.auug.org.au/ Link: https://lore.kernel.org/r/1ca29408-7bc7-4da5-59c7-87893c9e0442@gmail.com/ Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit cb0f8b034c761346bac72abe2685f52e9f8c8bd0 Merge: d484dc2b21a71 6bb3ab4913e97 Author: David S. Miller Date: Wed Aug 25 11:02:35 2021 +0100 Merge branch 'mptcp-next' Mat Martineau says: ==================== mptcp: Optimize output options and add MP_FAIL This patch set contains two groups of changes that we've been testing in the MPTCP tree. The first optimizes the code path and data structure for populating MPTCP option headers when transmitting. Patch 1 reorganizes code to reduce the number of conditionals that need to be evaluated in common cases. Patch 2 rearranges struct mptcp_out_options to save 80 bytes (on x86_64). The next five patches add partial support for the MP_FAIL option as defined in RFC 8684. MP_FAIL is an option header used to cleanly handle MPTCP checksum failures. When the MPTCP checksum detects an error in the MPTCP DSS header or the data mapped by that header, the receiver uses a TCP RST with MP_FAIL to close the subflow that experienced the error and provide associated MPTCP sequence number information to the peer. RFC 8684 also describes how a single-subflow connection can discard corrupt data and remain connected under certain conditions using MP_FAIL, but that feature is not implemented here. Patches 3-5 implement MP_FAIL transmit and receive, and integrates with checksum validation. Patches 6 & 7 add MP_FAIL selftests and the MIBs required for those tests. ==================== Signed-off-by: David S. Miller commit 6bb3ab4913e97b083561d22f5afe1124b7ec4954 Author: Geliang Tang Date: Tue Aug 24 16:26:19 2021 -0700 selftests: mptcp: add MP_FAIL mibs check This patch added a function chk_fail_nr to check the mibs for MP_FAIL. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit eb7f33654dc146aeb1ff245dae6e48b759dd8985 Author: Geliang Tang Date: Tue Aug 24 16:26:18 2021 -0700 mptcp: add the mibs for MP_FAIL This patch added the mibs for MP_FAIL: MPTCP_MIB_MPFAILTX and MPTCP_MIB_MPFAILRX. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 478d770008b03ed9d74bdc8add2315b7fd124ecc Author: Geliang Tang Date: Tue Aug 24 16:26:17 2021 -0700 mptcp: send out MP_FAIL when data checksum fails When a bad checksum is detected, set the send_mp_fail flag to send out the MP_FAIL option. Add a new function mptcp_has_another_subflow() to check whether there's only a single subflow. When multiple subflows are in use, close the affected subflow with a RST that includes an MP_FAIL option and discard the data with the bad checksum. Set the sk_state of the subsocket to TCP_CLOSE, then the flag MPTCP_WORK_CLOSE_SUBFLOW will be set in subflow_sched_work_if_closed, and the subflow will be closed. When a single subfow is in use, temporarily handled by sending MP_FAIL with a RST too. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 5580d41b758af12134d5c6b4c385fc25d0c6bfb0 Author: Geliang Tang Date: Tue Aug 24 16:26:16 2021 -0700 mptcp: MP_FAIL suboption receiving This patch added handling for receiving MP_FAIL suboption. Add a new members mp_fail and fail_seq in struct mptcp_options_received. When MP_FAIL suboption is received, set mp_fail to 1 and save the sequence number to fail_seq. Then invoke mptcp_pm_mp_fail_received to deal with the MP_FAIL suboption. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit c25aeb4e095355eec3beb6a2b2b30322bd6d0dd4 Author: Geliang Tang Date: Tue Aug 24 16:26:15 2021 -0700 mptcp: MP_FAIL suboption sending This patch added the MP_FAIL suboption sending support. Add a new flag named send_mp_fail in struct mptcp_subflow_context. If this flag is set, send out MP_FAIL suboption. Add a new member fail_seq in struct mptcp_out_options to save the data sequence number to put into the MP_FAIL suboption. An MP_FAIL option could be included in a RST or on the subflow-level ACK. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit d7b269083786dca3b1b0141bde6cea834062b691 Author: Paolo Abeni Date: Tue Aug 24 16:26:14 2021 -0700 mptcp: shrink mptcp_out_options struct After the previous patch we can alias with a union several fields in mptcp_out_options. Such struct is stack allocated and memset() for each plain TCP out packet. Every saved byted counts. Before: pahole -EC mptcp_out_options # ... /* size: 136, cachelines: 3, members: 17 */ After: pahole -EC mptcp_out_options # ... /* size: 56, cachelines: 1, members: 9 */ Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1bff1e43a30e2f7500a49d47fd26a425643a6a37 Author: Paolo Abeni Date: Tue Aug 24 16:26:13 2021 -0700 mptcp: optimize out option generation Currently we have several protocol constraints on MPTCP options generation (e.g. MPC and MPJ subopt are mutually exclusive) and some additional ones required by our implementation (e.g. almost all ADD_ADDR variant are mutually exclusive with everything else). We can leverage the above to optimize the out option generation: we check DSS/MPC/MPJ presence in a mutually exclusive way, avoiding many unneeded conditionals in the common cases. Additionally extend the existing constraints on ADD_ADDR opt on all subvariants, so that it becomes fully mutually exclusive with the above and we can skip another conditional statement for the common case. This change is also needed by the next patch. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 081551266d2fbf6ce69a30c13a355ee476b2e745 Author: Masahiro Yamada Date: Thu Jul 29 23:00:23 2021 +0900 x86/build: Move the install rule to arch/x86/Makefile Currently, the install target in arch/x86/Makefile descends into arch/x86/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/x86/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210729140023.442101-2-masahiroy@kernel.org commit d484dc2b21a71642665159d2f7c33828e637ab91 Merge: 38cbd6e77f85c a90ec84837325 Author: David S. Miller Date: Wed Aug 25 10:57:19 2021 +0100 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 2021-08-24 Vinicius Costa Gomes says: This adds support for PCIe PTM (Precision Time Measurement) to the igc driver. PCIe PTM allows the NIC and Host clocks to be compared more precisely, improving the clock synchronization accuracy. Patch 1/4 reverts a commit that made pci_enable_ptm() private to the PCI subsystem, reverting makes it possible for it to be called from the drivers. Patch 2/4 adds the pcie_ptm_enabled() helper. Patch 3/4 calls pci_enable_ptm() from the igc driver. Patch 4/4 implements the PCIe PTM support. Exposing it via the .getcrosststamp() API implies that the time measurements are made synchronously with the ioctl(). The hardware was implemented so the most convenient way to retrieve that information would be asynchronously. So, to follow the expectations of the ioctl() we have to use less convenient ways, triggering an PCIe PTM dialog every time a ioctl() is received. Some questions are raised (also pointed out in the commit message): 1. Using convert_art_ns_to_tsc() is too x86 specific, there should be a common way to create a 'system_counterval_t' from a timestamp. 2. convert_art_ns_to_tsc() says that it should only be used when X86_FEATURE_TSC_KNOWN_FREQ is true, but during tests it works even when it returns false. Should that check be done? ==================== Signed-off-by: David S. Miller commit 38cbd6e77f85c7fbf5a34a0aebf9c3e6d01fc214 Merge: fbd029df29c67 df0d6f7a342cd Author: David S. Miller Date: Wed Aug 25 10:55:43 2021 +0100 Merge branch 'lan7800-improvements' John Efstathiades says: ==================== LAN7800 driver improvements This patch set introduces a number of improvements and fixes for problems found during testing of a modification to add a NAPI-style approach to packet handling to improve performance. NOTE: the NAPI changes are not part of this patch set and the issues fixed by this patch set are not coupled to the NAPI changes. Patch 1 fixes white space and style issues Patch 2 removes an unused timer Patch 3 introduces macros to set the internal packet FIFO flow control levels, which makes it easier to update the levels in future. Patch 4 removes an unused queue Patch 5 (updated for v2) introduces function return value checks and error propagation to various parts of the driver where a return code was captured but then ignored. This patch is completely different to patch 5 in version 1 of this patch set. The changes in the v1 patch 5 are being set aside for the time being. Patch 6 updates the LAN7800 MAC reset code to ensure there is no PHY register access in progress when the MAC is reset. This change prevents a kernel exception that can otherwise occur. Patch 7 fixes problems with system suspend and resume handling while the device is transmitting and receiving data. Patch 8 fixes problems with auto-suspend and resume handling and depends on changes introduced by patch 7. Patch 9 fixes problems with device disconnect handling that can result in kernel exceptions and/or hang. Patch 10 limits the rate at which driver warning messages are emitted. ==================== Signed-off-by: David S. Miller commit df0d6f7a342cd8e4fad1dff4ca262462300223f7 Author: John Efstathiades Date: Tue Aug 24 19:56:13 2021 +0100 lan78xx: Limit number of driver warning messages Device removal can result in a large burst of driver warning messages (20 - 30) sent to the kernel log. Most of these are register read/write failures. This change limits the rate at which these messages are emitted. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 77dfff5bb7e20ce1eaaf4c599d9c54a8f4331124 Author: John Efstathiades Date: Tue Aug 24 19:56:12 2021 +0100 lan78xx: Fix race condition in disconnect handling If there is a device disconnect at roughly the same time as a deferred PHY link reset there is a race condition that can result in a kernel lock up due to a null pointer dereference in the driver's deferred work handling routine lan78xx_delayedwork(). The following changes fix this problem. Add new status flag EVENT_DEV_DISCONNECT to indicate when the device has been removed and use it to prevent operations, such as register access, that will fail once the device is removed. Stop processing of deferred work items when the driver's USB disconnect handler is invoked. Disconnect the PHY only after the network device has been unregistered and all delayed work has been cancelled. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 5f4cc6e25148cc141f97afb41b4dfe9eb1cce613 Author: John Efstathiades Date: Tue Aug 24 19:56:11 2021 +0100 lan78xx: Fix race conditions in suspend/resume handling If the interface is given an IP address while the device is suspended (as a result of an auto-suspend event) there is a race between lan78xx_resume() and lan78xx_open() that can result in an exception or failure to handle incoming packets. The following changes fix this problem. Introduce a mutex to serialise operations in the network interface open and stop entry points with respect to the USB driver suspend and resume entry points. Move Tx and Rx data path start/stop to lan78xx_start() and lan78xx_stop() respectively and flush the packet FIFOs before starting the Tx and Rx data paths. This prevents the MAC and FIFOs getting out of step and delivery of malformed packets to the network stack. Stop processing of received packets before disconnecting the PHY from the MAC to prevent a kernel exception caused by handling packets after the PHY device has been removed. Refactor device auto-suspend code to make it consistent with the the system suspend code and make the suspend handler easier to read. Add new code to stop wake-on-lan packets or PHY events resuming the host or device from suspend if the device has not been opened (typically after an IP address is assigned). This patch is dependent on changes to lan78xx_suspend() and lan78xx_resume() introduced in the previous patch of this patch set. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit e1210fe63bf8b080edd0805240e90b81b6b069c1 Author: John Efstathiades Date: Tue Aug 24 19:56:10 2021 +0100 lan78xx: Fix partial packet errors on suspend/resume The MAC can get out of step with the internal packet FIFOs if the system goes to sleep when the link is active, especially at high data rates. This can result in partial frames in the packet FIFOs that in result in malformed frames being delivered to the host. This occurs because the driver does not enable/disable the internal packet FIFOs in step with the corresponding MAC data path. The following changes fix this problem. Update code that enables/disables the MAC receiver and transmitter to the more general Rx and Tx data path, where the data path in each direction consists of both the MAC function (Tx or Rx) and the corresponding packet FIFO. In the receive path the packet FIFO must be enabled before the MAC receiver but disabled after the MAC receiver. In the transmit path the opposite is true: the packet FIFO must be enabled after the MAC transmitter but disabled before the MAC transmitter. The packet FIFOs can be flushed safely once the corresponding data path is stopped. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit b1f6696daafebea243ed59ed18a8b10cfd33b474 Author: John Efstathiades Date: Tue Aug 24 19:56:09 2021 +0100 lan78xx: Fix exception on link speed change An exception is sometimes seen when the link speed is changed from auto-negotiation to a fixed speed, or vice versa. The exception occurs when the MAC is reset (due to the link speed change) at the same time as the PHY state machine is accessing a PHY register. The following changes fix this problem. Rework the MAC reset to ensure there is no outstanding MDIO register transaction before the reset and then wait until the reset is complete before allowing any further MAC register access. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 3415f6baaddb9b39d7112247ab39ef3c700f882e Author: John Efstathiades Date: Tue Aug 24 19:56:08 2021 +0100 lan78xx: Add missing return code checks There are many places in the driver where the return code from a function call is captured but without a subsequent test of the return code and appropriate action taken. This patch adds the missing return code tests and action. In most cases the action is an early exit from the calling function. The function lan78xx_set_suspend() was also updated to make it consistent with lan78xx_suspend(). Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 40b8452fa8b4567ab7d862c7d4c3d02f635f17fd Author: John Efstathiades Date: Tue Aug 24 19:56:07 2021 +0100 lan78xx: Remove unused pause frame queue Remove the pause frame queue from the driver. It is initialised but not actually used. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit dc35f8548e005b8a32fedaa5b01d52585eba5f1d Author: John Efstathiades Date: Tue Aug 24 19:56:06 2021 +0100 lan78xx: Set flow control threshold to prevent packet loss Set threshold at which flow control is triggered to 3/4 full of the internal Rx packet FIFO to prevent packet drops at high data rates. The new setting reduces the number of dropped UDP frames and TCP retransmit requests especially on less capable CPUs. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 3bef6b9e98888456805331201c0d8587c14fa108 Author: John Efstathiades Date: Tue Aug 24 19:56:05 2021 +0100 lan78xx: Remove unused timer Remove kernel timer that is not used by the driver. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 9ceec7d33adf9647293f24d2fd9a055b89c63864 Author: John Efstathiades Date: Tue Aug 24 19:56:04 2021 +0100 lan78xx: Fix white space and style issues Fix white space and code style issues identified by checkpatch. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 88939e737573552310d9ef4caf74501f67306bfc Merge: 0be10d7122ceb 5f8c991e89509 Author: Mark Brown Date: Wed Aug 25 10:50:21 2021 +0100 Merge series "ASoC: mediatek: Add support for MT8195 SoC" from Trevor Wu : This series of patches adds support for Mediatek AFE of MT8195 SoC. Patches are based on broonie tree "for-next" branch. Changes since v4: - removed sof related code Changes since v3: - fixed warnings found by kernel test robot - removed unused critical section - corrected the lock protected sections on etdm driver - added DPTX and HDMITX audio support Changes since v2: - added audio clock gate control - added 'mediatek' prefix to private dts properties - added consumed clocks to dt-bindins and adopted suggestions from Rob - refined clock usage and remove unused clock and control code - fixed typos Changes since v1: - fixed some problems related to dt-bindings - added some missing properties to dt-bindings - added depency declaration on dt-bindings - fixed some warnings found by kernel test robot Trevor Wu (11): ASoC: mediatek: mt8195: update mediatek common driver ASoC: mediatek: mt8195: support audsys clock control ASoC: mediatek: mt8195: support etdm in platform driver ASoC: mediatek: mt8195: support adda in platform driver ASoC: mediatek: mt8195: support pcm in platform driver ASoC: mediatek: mt8195: add platform driver dt-bindings: mediatek: mt8195: add audio afe document ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682 ASoC: mediatek: mt8195: add DPTX audio support ASoC: mediatek: mt8195: add HDMITX audio support dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document .../bindings/sound/mt8195-afe-pcm.yaml | 184 + .../sound/mt8195-mt6359-rt1019-rt5682.yaml | 47 + sound/soc/mediatek/Kconfig | 24 + sound/soc/mediatek/Makefile | 1 + sound/soc/mediatek/common/mtk-afe-fe-dai.c | 22 +- sound/soc/mediatek/common/mtk-base-afe.h | 10 +- sound/soc/mediatek/mt8195/Makefile | 15 + sound/soc/mediatek/mt8195/mt8195-afe-clk.c | 441 +++ sound/soc/mediatek/mt8195/mt8195-afe-clk.h | 109 + sound/soc/mediatek/mt8195/mt8195-afe-common.h | 158 + sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 3281 +++++++++++++++++ sound/soc/mediatek/mt8195/mt8195-audsys-clk.c | 214 ++ sound/soc/mediatek/mt8195/mt8195-audsys-clk.h | 15 + .../soc/mediatek/mt8195/mt8195-audsys-clkid.h | 93 + sound/soc/mediatek/mt8195/mt8195-dai-adda.c | 830 +++++ sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 2639 +++++++++++++ sound/soc/mediatek/mt8195/mt8195-dai-pcm.c | 389 ++ .../mt8195/mt8195-mt6359-rt1019-rt5682.c | 1087 ++++++ sound/soc/mediatek/mt8195/mt8195-reg.h | 2796 ++++++++++++++ 19 files changed, 12350 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml create mode 100644 Documentation/devicetree/bindings/sound/mt8195-mt6359-rt1019-rt5682.yaml create mode 100644 sound/soc/mediatek/mt8195/Makefile create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.h create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-common.h create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.h create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clkid.h create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-adda.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-pcm.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c create mode 100644 sound/soc/mediatek/mt8195/mt8195-reg.h -- 2.18.0 commit 6d61b8e66d343d61b650f9a2ca4d8746dc6cf774 Author: Masahiro Yamada Date: Thu Jul 29 23:00:22 2021 +0900 x86/build: Remove the left-over bzlilo target Commit f279b49f13bd ("x86/boot: Modernize genimage script; hdimage+EFI support") removed the bzlilo target from arch/x86/boot/Makefile. Remove the left-over from arch/x86/Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210729140023.442101-1-masahiroy@kernel.org commit fbd029df29c6701a2df02ec69923caef5811eabd Merge: 755f905340802 a884daa61a7d9 Author: David S. Miller Date: Wed Aug 25 10:43:22 2021 +0100 Merge branch 'xen-harden-netfront' Juergen Gross says: ==================== xen: harden netfront against malicious backends Xen backends of para-virtualized devices can live in dom0 kernel, dom0 user land, or in a driver domain. This means that a backend might reside in a less trusted environment than the Xen core components, so a backend should not be able to do harm to a Xen guest (it can still mess up I/O data, but it shouldn't be able to e.g. crash a guest by other means or cause a privilege escalation in the guest). Unfortunately netfront in the Linux kernel is fully trusting its backend. This series is fixing netfront in this regard. It was discussed to handle this as a security problem, but the topic was discussed in public before, so it isn't a real secret. It should be mentioned that a similar series has been posted some years ago by Marek Marczykowski-Górecki, but this series has not been applied due to a Xen header not having been available in the Xen git repo at that time. Additionally my series is fixing some more DoS cases. ==================== Signed-off-by: David S. Miller commit a884daa61a7d91650987e855464526aef219590f Author: Juergen Gross Date: Tue Aug 24 12:28:09 2021 +0200 xen/netfront: don't trust the backend response data blindly Today netfront will trust the backend to send only sane response data. In order to avoid privilege escalations or crashes in case of malicious backends verify the data to be within expected limits. Especially make sure that the response always references an outstanding request. Note that only the tx queue needs special id handling, as for the rx queue the id is equal to the index in the ring page. Introduce a new indicator for the device whether it is broken and let the device stop working when it is set. Set this indicator in case the backend sets any weird data. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: David S. Miller commit 21631d2d741a64a073e167c27769e73bc7844a2f Author: Juergen Gross Date: Tue Aug 24 12:28:08 2021 +0200 xen/netfront: disentangle tx_skb_freelist The tx_skb_freelist elements are in a single linked list with the request id used as link reference. The per element link field is in a union with the skb pointer of an in use request. Move the link reference out of the union in order to enable a later reuse of it for requests which need a populated skb pointer. Rename add_id_to_freelist() and get_id_from_freelist() to add_id_to_list() and get_id_from_list() in order to prepare using those for other lists as well. Define ~0 as value to indicate the end of a list and place that value into the link for a request not being on the list. When freeing a skb zero the skb pointer in the request. Use a NULL value of the skb pointer instead of skb_entry_is_link() for deciding whether a request has a skb linked to it. Remove skb_entry_set_link() and open code it instead as it is really trivial now. Signed-off-by: Juergen Gross Signed-off-by: David S. Miller commit 162081ec33c2686afa29d91bf8d302824aa846c7 Author: Juergen Gross Date: Tue Aug 24 12:28:07 2021 +0200 xen/netfront: don't read data from request on the ring page In order to avoid a malicious backend being able to influence the local processing of a request build the request locally first and then copy it to the ring page. Any reading from the request influencing the processing in the frontend needs to be done on the local instance. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: David S. Miller commit 8446066bf8c1f9f7b7412c43fbea0fb87464d75b Author: Juergen Gross Date: Tue Aug 24 12:28:06 2021 +0200 xen/netfront: read response from backend only once In order to avoid problems in case the backend is modifying a response on the ring page while the frontend has already seen it, just read the response into a local buffer in one go and then operate on that buffer only. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: David S. Miller commit 755f905340802e2efb1ea96b9ce0f442916c2645 Author: Alok Prasad Date: Tue Aug 24 04:02:46 2021 +0000 qed: Enable automatic recovery on error condition. This patch enables automatic recovery by default in case of various error condition like fw assert , hardware error etc. This also ensure driver can handle multiple iteration of assertion conditions. Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: Igor Russkikh Signed-off-by: Alok Prasad Signed-off-by: David S. Miller commit 406f42fa0d3cbcea3766c3111d79ac5afe711c5b Author: Gilad Naaman Date: Thu Aug 19 10:17:27 2021 +0300 net-next: When a bond have a massive amount of VLANs with IPv6 addresses, performance of changing link state, attaching a VRF, changing an IPv6 address, etc. go down dramtically. The source of most of the slow down is the `dev_addr_lists.c` module, which mainatins a linked list of HW addresses. When using IPv6, this list grows for each IPv6 address added on a VLAN, since each IPv6 address has a multicast HW address associated with it. When performing any modification to the involved links, this list is traversed many times, often for nothing, all while holding the RTNL lock. Instead, this patch adds an auxilliary rbtree which cuts down traversal time significantly. Performance can be seen with the following script: #!/bin/bash ip netns del test || true 2>/dev/null ip netns add test echo 1 | ip netns exec test tee /proc/sys/net/ipv6/conf/all/keep_addr_on_down > /dev/null set -e ip -n test link add foo type veth peer name bar ip -n test link add b1 type bond ip -n test link add florp type vrf table 10 ip -n test link set bar master b1 ip -n test link set foo up ip -n test link set bar up ip -n test link set b1 up ip -n test link set florp up VLAN_COUNT=1500 BASE_DEV=b1 echo Creating vlans ip netns exec test time -p bash -c "for i in \$(seq 1 $VLAN_COUNT); do ip -n test link add link $BASE_DEV name foo.\$i type vlan id \$i; done" echo Bringing them up ip netns exec test time -p bash -c "for i in \$(seq 1 $VLAN_COUNT); do ip -n test link set foo.\$i up; done" echo Assiging IPv6 Addresses ip netns exec test time -p bash -c "for i in \$(seq 1 $VLAN_COUNT); do ip -n test address add dev foo.\$i 2000::\$i/64; done" echo Attaching to VRF ip netns exec test time -p bash -c "for i in \$(seq 1 $VLAN_COUNT); do ip -n test link set foo.\$i master florp; done" On an Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz machine, the performance before the patch is (truncated): Creating vlans real 108.35 Bringing them up real 4.96 Assiging IPv6 Addresses real 19.22 Attaching to VRF real 458.84 After the patch: Creating vlans real 5.59 Bringing them up real 5.07 Assiging IPv6 Addresses real 5.64 Attaching to VRF real 25.37 Cc: David S. Miller Cc: Jakub Kicinski Cc: Lu Wei Cc: Xiongfeng Wang Cc: Taehee Yoo Signed-off-by: Gilad Naaman Signed-off-by: David S. Miller commit f80c8e6864eb14b71f58c1a159654e4f379673a6 Author: ChanWoo Lee Date: Wed Aug 25 16:46:01 2021 +0900 mmc: queue: Remove unused parameters(request_queue) In function mmc_exit_request, the request_queue structure(*q) is not used. I remove the unnecessary code related to the request_queue structure. Signed-off-by: ChanWoo Lee Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20210825074601.8881-1-cw9316.lee@samsung.com Signed-off-by: Ulf Hansson commit dba914b248845492080162c0b604a5e25e52dc7b Author: Claudiu Beznea Date: Wed Aug 25 11:19:31 2021 +0300 mmc: pwrseq: sd8787: fix compilation warning Fixed compilation warning "cast from pointer to integer of different size [-Wpointer-to-int-cast]" Fixes: b2832b96fcf5 ("mmc: pwrseq: sd8787: add support for wilc1000") Reported-by: kernel test robot Reported-by: Stephen Rothwell Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20210825081931.598934-1-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit e72a55f2e5ddcfb3dce0701caf925ce435b87682 Author: Nishad Kamdar Date: Wed Aug 25 00:47:26 2021 +0530 mmc: core: Return correct emmc response in case of ioctl error When a read/write command is sent via ioctl to the kernel, and the command fails, the actual error response of the emmc is not sent to the user. IOCTL read/write tests are carried out using commands 17 (Single BLock Read), 24 (Single Block Write), 18 (Multi Block Read), 25 (Multi Block Write) The tests are carried out on a 64Gb emmc device. All of these tests try to access an "out of range" sector address (0x09B2FFFF). It is seen that without the patch the response received by the user is not OUT_OF_RANGE error (R1 response 31st bit is not set) as per JEDEC specification. After applying the patch proper response is seen. This is because the function returns without copying the response to the user in case of failure. This patch fixes the issue. Hence, this memcpy is required whether we get an error response or not. Therefor it is moved up from the current position up to immediately after we have called mmc_wait_for_req(). The test code and the output of only the CMD17 is included in the commit to limit the message length. CMD17 (Test Code Snippet): ========================== printf("Forming CMD%d\n", opt_idx); /* single block read */ cmd.blksz = 512; cmd.blocks = 1; cmd.write_flag = 0; cmd.opcode = 17; //cmd.arg = atoi(argv[3]); cmd.arg = 0x09B2FFFF; /* Expecting response R1B */ cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; memset(data, 0, sizeof(__u8) * 512); mmc_ioc_cmd_set_data(cmd, data); printf("Sending CMD%d: ARG[0x%08x]\n", opt_idx, cmd.arg); if(ioctl(fd, MMC_IOC_CMD, &cmd)) perror("Error"); printf("\nResponse: %08x\n", cmd.response[0]); CMD17 (Output without patch): ============================= test@test-LIVA-Z:~$ sudo ./mmc cmd_test /dev/mmcblk0 17 Entering the do_mmc_commands:Device: /dev/mmcblk0 nargs:4 Entering the do_mmc_commands:Device: /dev/mmcblk0 options[17, 0x09B2FFF] Forming CMD17 Sending CMD17: ARG[0x09b2ffff] Error: Connection timed out Response: 00000000 (Incorrect response) CMD17 (Output with patch): ========================== test@test-LIVA-Z:~$ sudo ./mmc cmd_test /dev/mmcblk0 17 [sudo] password for test: Entering the do_mmc_commands:Device: /dev/mmcblk0 nargs:4 Entering the do_mmc_commands:Device: /dev/mmcblk0 options[17, 09B2FFFF] Forming CMD17 Sending CMD17: ARG[0x09b2ffff] Error: Connection timed out Response: 80000900 (Correct OUT_OF_ERROR response as per JEDEC specification) Signed-off-by: Nishad Kamdar Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20210824191726.8296-1-nishadkamdar@gmail.com Signed-off-by: Ulf Hansson commit 45334ee13858de4c8c8c781b3b0f94b7b81e9e69 Author: Haibo Chen Date: Wed Aug 18 19:16:51 2021 +0800 mmc: sdhci-esdhc-imx: Select the correct mode for auto tuning USDHC hardware auto tuning circuit support check 1/4/8 data lines and cmd line. Out of reset uSDHC, it default select check 4 data lines and do not check cmd line. This is incorrect if we use 8 data lines. So need to config the auto tuning mode according to current bus width. Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1629285415-7495-2-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit a0dbbdc2036e7406bf937912f7997c0b34042464 Author: Haibo Chen Date: Wed Aug 18 19:16:50 2021 +0800 mmc: sdhci-esdhc-imx: Remove redundant code for manual tuning For manual tuning method, already call esdhc_prepare_tuning() config the necessary registers, so remove the redundant code in esdhc_writew_le() for SDHCI_HOST_CONTROL2. Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1629285415-7495-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 0d6d75d2a2c341ce99f0549fa28bee93fa56505d Author: Heiko Carstens Date: Tue Jul 13 16:57:13 2021 +0200 KVM: s390: generate kvm hypercall functions Generate kvm hypercall functions with a macro instead of duplicating the more or less identical code seven times. This also reduces number of lines of code. However the main purpose is to get rid of as many as possible open coded error prone register asm constructs in s390 architecture code. For the only user of kvm_hypercall identical code is created before/after this patch (drivers/s390/virtio/virtio_ccw.c). Reviewed-by: Christian Borntraeger Acked-by: Christian Borntraeger Link: https://lore.kernel.org/r/20210713145713.2815167-1-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit 70aa5d39826528e77f5595a5f9297d919112d396 Author: Peter Oberparleiter Date: Fri Aug 13 15:05:05 2021 +0200 s390/sclp: add tracing of SCLP interactions Add tracing of interactions between the SCLP base driver, firmware and other drivers to support problem determination in case of SCLP-related issues. For that purpose this patch introduces two new s390dbf debug areas: - sclp: An abbreviated log of all common interactions - sclp_err: A full log of failed or abnormal interactions Tracing of full SCCB contents can be enabled for the sclp area by setting its debug level to maximum (6). Overview of added trace events: * Firmware interaction: - SRV1: Service call about to be issued - SRV2: Service call was issued - INT: Interrupt received * Driver interaction: - RQAD: Request was added - RQOK: Request success - RQAB: Request aborted - RQTM: Request timed out - REG: Event listener registered - UREG: Event listener unregistered - EVNT: Event callback - STCG: State-change callback * Abnormal events: - TMO: A timeout occurred - UNEX: Unexpected SCCB completion * Other (not traced at default level): - SYN1: Synchronous wait start - SYN2: Synchronous wait end Since the SCLP interface is used by console drivers this patch also moves s390dbf printks outside the critical section protected by debug area locks to prevent a potential deadlock that would otherwise be introduced between console_owner --> sclp_lock --> sclp_debug.lock. Signed-off-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit d72541f945127b4873dace501406a1bc8cd8e1e9 Author: Peter Oberparleiter Date: Fri Aug 13 15:05:04 2021 +0200 s390/debug: add early tracing support Debug areas can currently only be used after s390dbf initialization which occurs as a postcore_initcall. This is too late for tracing earlier code such as that related to console_init(). This patch introduces a macro for defining a statically initialized debug area that can be used to trace very early code. The macro is made available for built-in code only because modules are never running during early boot. Example usage: 1. Define static debug area: DEFINE_STATIC_DEBUG_INFO(my_debug, "my_debug", 4, 1, 16, &debug_hex_ascii_view); 2. Add trace entry: debug_event(&my_debug, 0, "DATA", 4); Note: The debug area is automatically registered in debugfs during boot. A driver must not call any of the debug_register()/_unregister() functions on a static debug_info_t! Signed-off-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 9372a82892c2caa6bccab9a4081166fa769699f8 Author: Peter Oberparleiter Date: Fri Aug 13 15:05:03 2021 +0200 s390/debug: fix debug area life cycle Currently allocation and registration of s390dbf debug areas are tied together. As a result, a debug area cannot be unregistered and re-registered while any process has an associated debugfs file open. Fix this by splitting alloc/release from register/unregister. Signed-off-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 1204777867e8486a88dbb4793fe256b31ea05eeb Author: Peter Oberparleiter Date: Fri Aug 13 15:05:02 2021 +0200 s390/debug: keep debug data on resize Any previously recorded s390dbf debug data is reset when a debug area is resized using the 'pages' sysfs attribute. This can make live-debugging unnecessarily complex. Fix this by copying existing debug data to the newly allocated debug area when resizing. Signed-off-by: Peter Oberparleiter Signed-off-by: Heiko Carstens commit 2879048c7ea1bcfbacda5af5f555666134323e3a Author: Heiko Carstens Date: Tue Aug 24 17:21:12 2021 +0200 s390/diag: make restart_part2 a local label Avoid that the "restart_part2" label, which is in the middle of a function, appears in /proc/kallsyms. Signed-off-by: Heiko Carstens commit c4f0e5cfde354b1d6cf2388c0920264985c6c139 Author: Heiko Carstens Date: Tue Aug 24 15:21:44 2021 +0200 s390/mm,pageattr: fix walk_pte_level() early exit In case of splitting to 4k mapping the early exit in walk_pte_level() must only be taken iff flags is equal to SET_MEMORY_4K. Currently the early exit is taken if the flag is set, and also others might be set. This may lead to the situation that a mapping is split but other changes are not done, like e.g. setting pages to R/W. There is currently no such caller, but there might be in the future. Fixes: b3e1a00c8fa4 ("s390/mm: implement set_memory_4k()") Signed-off-by: Heiko Carstens commit 8b5f08b484bd948e1bedcd5a637a4f7609f1c7c1 Author: Heiko Carstens Date: Tue Aug 24 14:15:50 2021 +0200 s390: fix typo in linker script Rename amod31 to amode31 like it was supposed to be. Fixes: c78d0c7484f0 ("s390: rename dma section to amode31") Signed-off-by: Heiko Carstens commit 28be5743c6306b3070012c00ca2ff2bff5c02258 Author: Sven Schnelle Date: Mon Aug 23 21:20:36 2021 +0200 s390: remove do_signal() prototype and do_notify_resume() function Both are no longer used since the conversion to generic entry, therefore remove them. Fixes: 56e62a737028 ("s390: convert to generic entry") Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 0c1abe7c28902067bad2865a582c461f57dccd61 Author: Randy Dunlap Date: Thu Aug 5 22:01:49 2021 -0700 s390/crypto: fix all kernel-doc warnings in vfio_ap_ops.c The 0day bot reported some kernel-doc warnings in this file so clean up all of the kernel-doc and use proper kernel-doc formatting. There are no more kernel-doc errors or warnings reported in this file. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Jason Gunthorpe Cc: Tony Krowiak Cc: Halil Pasic Cc: Jason Herne Cc: Harald Freudenberger Cc: linux-s390@vger.kernel.org Reviewed-by: Tony Krowiak Link: https://lore.kernel.org/r/20210806050149.9614-1-rdunlap@infradead.org Signed-off-by: Heiko Carstens commit 1f3f76812d5dfc791193b39c2140a8bd09962c0e Author: Niklas Schnelle Date: Fri Jul 16 11:53:37 2021 +0200 s390/pci: improve DMA translation init and exit Currently zpci_dma_init_device()/zpci_dma_exit_device() is called as part of zpci_enable_device()/zpci_disable_device() and errors for zpci_dma_exit_device() are always ignored even if we could abort. Improve upon this by moving zpci_dma_exit_device() out of zpci_disable_device() and check for errors whenever we have a way to abort the current operation. Note that for example in zpci_event_hard_deconfigured() the device is expected to be gone so we really can't abort and proceed even in case of error. Similarly move the cc == 3 special case out of zpci_unregister_ioat() and into the callers allowing to abort when finding an already disabled devices precludes proceeding with the operation. While we are at it log IOAT register/unregister errors in the s390 debugfs log, Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit cc049eecfb7adc4bfecd05eb25e425d8def96fce Author: Niklas Schnelle Date: Thu Jul 22 11:44:08 2021 +0200 s390/pci: simplify CLP List PCI handling Currently clp_get_state() and clp_refresh_fh() awkwardly use the clp_list_pci() callback mechanism to find the entry for a specific FID and update its zdev, respectively return its state. This is both needlessly complex and means we are always going through the entire PCI function list even if the FID has already been found. Instead lets introduce a clp_find_pci() function to find a specific entry and share the CLP List PCI request handling code with clp_list_pci(). With that in place we can also easily make the function handle a simple out parameter instead of directly altering the zdev allowing easier access to the updated function handle by the caller. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 8256adda1f44ea1ec763711aefcd25f8c0cf93f3 Author: Niklas Schnelle Date: Thu Jul 22 12:38:29 2021 +0200 s390/pci: handle FH state mismatch only on disable Instead of always treating CLP_RC_SETPCIFN_ALRDY as success and blindly updating the function handle restrict this special handling to the disable case by moving it into zpci_disable_device() and still treating it as an error while also updating the function handle such that a subsequent zpci_disable_device() succeeds or the caller can ignore the error when aborting is not an option such as for zPCI event 0x304. Also print this occurrence to the log such that an admin can tell why a disable operation returned an error. A mismatch between the state of the underlying device and our view of it can naturally happen when the device suddenly enters the error state but we haven't gotten the error notification yet, it must not happen on enable though. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit f7addcdd527a6dddfebe20c358b87bdb95624612 Author: Niklas Schnelle Date: Wed Jul 21 19:58:54 2021 +0200 s390/pci: fix misleading rc in clp_set_pci_fn() Currently clp_set_pci_fn() always returns 0 as long as the CLP request itself succeeds even if the operation itself returns a response code other than CLP_RC_OK or CLP_RC_SETPCIFN_ALRDY. This is highly misleading because calling code assumes that a zero rc means that the operation was successful. Fix this by returning the response code or cc on failure with the exception of the special handling for CLP_RC_SETPCIFN_ALRDY. Also let's not assume that the returned function handle for CLP_RC_SETPCIFN_ALRDY is 0, we don't need it anyway. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit e8f06683d40e705da2d85bc6bc498e651d1ef31b Author: Alexander Gordeev Date: Fri Aug 6 12:55:09 2021 +0200 s390/boot: factor out offset_vmlinux_info() function Move offsetting all of vmlinux_info fields to a separate function for better readability. Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit ddd63c85ef67ea9ea7282ad35eafb6568047126e Author: Alexander Gordeev Date: Fri Aug 6 12:55:08 2021 +0200 s390/kasan: fix large PMD pages address alignment check It is currently possible to initialize a large PMD page when the address is not aligned on page boundary. Signed-off-by: Alexander Gordeev Reviewed-by: Vasily Gorbik Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit c42257d64079f41af5debcba9dcd15dad3b2969e Author: Julian Wiedmann Date: Mon Jun 7 11:18:45 2021 +0200 s390/zcrypt: remove gratuitious NULL check in .remove() callbacks As .remove() is only called after a successful .probe() call, we can trust that the drvdata is valid. Signed-off-by: Julian Wiedmann Signed-off-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit b5adbbf896d8375a1054ac56ac23194ac483ae96 Author: Julian Wiedmann Date: Mon Jun 7 11:18:44 2021 +0200 s390/ap: use the common driver-data pointer The device struct provides a pointer for driver-private data. Use this in the zcrypt drivers (as vfio_ap already does), and then remove the custom pointer from the AP device structs. As really_probe() will always clear the drvdata pointer on error, we no longer have to do so ourselves. Signed-off-by: Julian Wiedmann Signed-off-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit c8c68c5fca47add52f7830a4e791434e98ba69c7 Author: Julian Wiedmann Date: Mon Jun 7 11:18:43 2021 +0200 s390/ap: use the common device_driver pointer The device struct itself already contains a pointer to its driver. Use this consistently, instead of duplicating it. Signed-off-by: Julian Wiedmann Signed-off-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit 81a076171e72dcb6545a8a508b800aec59d6e82b Author: Niklas Schnelle Date: Fri Aug 6 12:12:11 2021 +0200 s390/pci: reset zdev->zbus on registration failure On failure to register a struct zpci_dev with a struct zpci_bus we left a dangling pointer in zdev->zbus. As zpci_create_device() bails if zpci_bus_device_register() fails this is of no consequence but still bad practice. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 02368b7cf6c7badefa13741aed7a8b91d9a11b19 Author: Niklas Schnelle Date: Fri Aug 6 10:28:40 2021 +0200 s390/pci: cleanup resources only if necessary It's currently safe to call zpci_cleanup_bus_resources() even if the resources were never created but it makes no sense so check zdev->has_resources before we call zpci_cleanup_bus_resources() in zpci_release_device(). Reviewed-by: Matthew Rosato Acked-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 315511166469a641c1b838eaca6bdd3af5c362c4 Author: Masahiro Yamada Date: Thu Aug 12 01:45:18 2021 +0900 microblaze: move core-y in arch/microblaze/Makefile to arch/microblaze/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20210811164518.187497-1-masahiroy@kernel.org Signed-off-by: Michal Simek commit 0c8fb653d487d2873f5eefdcaf4cecff4e103828 Author: Nicholas Piggin Date: Thu Aug 12 02:00:44 2021 +1000 powerpc/64s: Remove WORT SPR from POWER9/10 This register is not architected and not implemented in POWER9 or 10, it just reads back zeroes for compatibility. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20210811160134.904987-11-npiggin@gmail.com commit 1782663897945a5cf28e564ba5eed730098e9aa4 Author: Nicholas Piggin Date: Thu Aug 12 02:00:43 2021 +1000 KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live After the L1 saves its PMU SPRs but before loading the L2's PMU SPRs, switch the pmcregs_in_use field in the L1 lppaca to the value advertised by the L2 in its VPA. On the way out of the L2, set it back after saving the L2 PMU registers (if they were in-use). This transfers the PMU liveness indication between the L1 and L2 at the points where the registers are not live. This fixes the nested HV bug for which a workaround was added to the L0 HV by commit 63279eeb7f93a ("KVM: PPC: Book3S HV: Always save guest pmu for guest capable of nesting"), which explains the problem in detail. That workaround is no longer required for guests that include this bug fix. Fixes: 360cae313702 ("KVM: PPC: Book3S HV: Nested guest entry via hypercall") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20210811160134.904987-10-npiggin@gmail.com commit f2e29db156523bf08a0524e0f4306a641912c6d9 Author: Fabiano Rosas Date: Thu Aug 12 02:00:42 2021 +1000 KVM: PPC: Book3S HV Nested: save_hv_return_state does not require trap argument vcpu is already anargument so vcpu->arch.trap can be used directly. Signed-off-by: Fabiano Rosas Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-9-npiggin@gmail.com commit 7c3ded5735141ff4d049747c9f76672a8b737c49 Author: Fabiano Rosas Date: Thu Aug 12 02:00:41 2021 +1000 KVM: PPC: Book3S HV Nested: Stop forwarding all HFUs to L1 If the nested hypervisor has no access to a facility because it has been disabled by the host, it should also not be able to see the Hypervisor Facility Unavailable that arises from one of its guests trying to access the facility. This patch turns a HFU that happened in L2 into a Hypervisor Emulation Assistance interrupt and forwards it to L1 for handling. The ones that happened because L1 explicitly disabled the facility for L2 are still let through, along with the corresponding Cause bits in the HFSCR. Signed-off-by: Fabiano Rosas [np: move handling into kvmppc_handle_nested_exit] Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-8-npiggin@gmail.com commit 8b210a880b35ba75eb42b79dfd65e369c1feb119 Author: Nicholas Piggin Date: Thu Aug 12 02:00:40 2021 +1000 KVM: PPC: Book3S HV Nested: Make nested HFSCR state accessible When the L0 runs a nested L2, there are several permutations of HFSCR that can be relevant. The HFSCR that the L1 vcpu L1 requested, the HFSCR that the L1 vcpu may use, and the HFSCR that is actually being used to run the L2. The L1 requested HFSCR is not accessible outside the nested hcall handler, so copy that into a new kvm_nested_guest.hfscr field. The permitted HFSCR is taken from the HFSCR that the L1 runs with, which is also not accessible while the hcall is being made. Move this into a new kvm_vcpu_arch.hfscr_permitted field. These will be used by the next patch to improve facility handling for nested guests, and later by facility demand faulting patches. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-7-npiggin@gmail.com commit 7487cabc7ed2f7716bf304e4e97c57fd995cf70e Author: Fabiano Rosas Date: Thu Aug 12 02:00:39 2021 +1000 KVM: PPC: Book3S HV Nested: Sanitise vcpu registers As one of the arguments of the H_ENTER_NESTED hypercall, the nested hypervisor (L1) prepares a structure containing the values of various hypervisor-privileged registers with which it wants the nested guest (L2) to run. Since the nested HV runs in supervisor mode it needs the host to write to these registers. To stop a nested HV manipulating this mechanism and using a nested guest as a proxy to access a facility that has been made unavailable to it, we have a routine that sanitises the values of the HV registers before copying them into the nested guest's vcpu struct. However, when coming out of the guest the values are copied as they were back into L1 memory, which means that any sanitisation we did during guest entry will be exposed to L1 after H_ENTER_NESTED returns. This patch alters this sanitisation to have effect on the vcpu->arch registers directly before entering and after exiting the guest, leaving the structure that is copied back into L1 unchanged (except when we really want L1 to access the value, e.g the Cause bits of HFSCR). Signed-off-by: Fabiano Rosas Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Link: https://lore.kernel.org/r/20210811160134.904987-6-npiggin@gmail.com commit d82b392d9b3556b63e3f9916cf057ea847e173a9 Author: Nicholas Piggin Date: Thu Aug 12 02:00:38 2021 +1000 KVM: PPC: Book3S HV Nested: Fix TM softpatch HFAC interrupt emulation Have the TM softpatch emulation code set up the HFAC interrupt and return -1 in case an instruction was executed with HFSCR bits clear, and have the interrupt exit handler fall through to the HFAC handler. When the L0 is running a nested guest, this ensures the HFAC interrupt is correctly passed up to the L1. The "direct guest" exit handler will turn these into PROGILL program interrupts so functionality in practice will be unchanged. But it's possible an L1 would want to handle these in a different way. Also rearrange the FAC interrupt emulation code to match the HFAC format while here (mainly, adding the FSCR_INTR_CAUSE mask). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-5-npiggin@gmail.com commit 4782e0cd0d184d727ad3b0cfe20d1d44d9f98239 Author: Nicholas Piggin Date: Thu Aug 12 02:00:37 2021 +1000 KVM: PPC: Book3S HV P9: Fixes for TM softpatch interrupt NIP The softpatch interrupt sets HSRR0 to the faulting instruction +4, so it should subtract 4 for the faulting instruction address in the case it is a TM softpatch interrupt (the instruction was not executed) and it was not emulated. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-4-npiggin@gmail.com commit daac40e8d7a63ab8608132a7cfce411986feac32 Author: Nicholas Piggin Date: Thu Aug 12 02:00:36 2021 +1000 KVM: PPC: Book3S HV: Remove TM emulation from POWER7/8 path TM fake-suspend emulation is only used by POWER9. Remove it from the old code path. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-3-npiggin@gmail.com commit fd42b7b09c602c904452c0c3e5955ca21d8e387a Author: Nicholas Piggin Date: Thu Aug 12 02:00:35 2021 +1000 KVM: PPC: Book3S HV: Initialise vcpu MSR with MSR_ME It is possible to create a VCPU without setting the MSR before running it, which results in a warning in kvmhv_vcpu_entry_p9() that MSR_ME is not set. This is pretty harmless because the MSR_ME bit is added to HSRR1 before HRFID to guest, and a normal qemu guest doesn't hit it. Initialise the vcpu MSR with MSR_ME set. Reported-by: Alexey Kardashevskiy Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210811160134.904987-2-npiggin@gmail.com commit cbe8cd7d83e251bff134a57ea4b6378db992ad82 Author: Tang Bin Date: Mon Aug 23 22:10:33 2021 +0800 can: mscan: mpc5xxx_can: mpc5xxx_can_probe(): remove useless BUG_ON() In the function mpc5xxx_can_probe(), the variable 'data' has already been determined in the above code, so the BUG_ON() in this place is useless, remove it. Link: https://lore.kernel.org/r/20210823141033.17876-1-tangbin@cmss.chinamobile.com Signed-off-by: Tang Bin Signed-off-by: Marc Kleine-Budde commit a4583c1deb1b6e574ec0f4095d5a44d7160353f1 Author: Tang Bin Date: Mon Aug 23 19:33:38 2021 +0800 can: mscan: mpc5xxx_can: mpc5xxx_can_probe(): use of_device_get_match_data to simplify code Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Link: https://lore.kernel.org/r/20210823113338.3568-4-tangbin@cmss.chinamobile.com Signed-off-by: Tang Bin Signed-off-by: Marc Kleine-Budde commit 1d38ec4974143827631d44a6a2a4c069fc4c05bd Author: Lad Prabhakar Date: Fri Aug 20 17:14:49 2021 +0100 can: rcar_canfd: rcar_canfd_handle_channel_tx(): fix redundant assignment Fix redundant assignment of 'priv' to itself in rcar_canfd_handle_channel_tx(). Fixes: 76e9353a80e9 ("can: rcar_canfd: Add support for RZ/G2L family") Link: https://lore.kernel.org/r/20210820161449.18169-1-prabhakar.mahadev-lad.rj@bp.renesas.com Reported-by: kernel test robot Signed-off-by: Lad Prabhakar Signed-off-by: Marc Kleine-Budde commit ac4224087312d7212bd3411f1e393f4b7cb1ff15 Author: Cai Huoqing Date: Wed Aug 25 14:23:41 2021 +0800 can: rcar: Kconfig: Add helper dependency on COMPILE_TEST it's helpful for complie test in other platform(e.g.X86) Link: https://lore.kernel.org/r/20210825062341.2332-1-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Signed-off-by: Marc Kleine-Budde commit c42dd069be8dfc9b2239a5c89e73bbd08ab35de0 Author: Sishuai Gong Date: Wed Aug 25 07:52:20 2021 +0200 configfs: fix a race in configfs_lookup() When configfs_lookup() is executing list_for_each_entry(), it is possible that configfs_dir_lseek() is calling list_del(). Some unfortunate interleavings of them can cause a kernel NULL pointer dereference error Thread 1 Thread 2 //configfs_dir_lseek() //configfs_lookup() list_del(&cursor->s_sibling); list_for_each_entry(sd, ...) Fix this by grabbing configfs_dirent_lock in configfs_lookup() while iterating ->s_children. Signed-off-by: Sishuai Gong Signed-off-by: Christoph Hellwig commit d07f132a225c013e59aa77f514ad9211ecab82ee Author: Christoph Hellwig Date: Wed Aug 25 07:50:32 2021 +0200 configfs: fold configfs_attach_attr into configfs_lookup This makes it more clear what gets added to the dcache and prepares for an additional locking fix. Signed-off-by: Christoph Hellwig commit 899587c8d0908e5124fd074d52bf05b4b0633a79 Author: Christoph Hellwig Date: Wed Aug 25 07:43:55 2021 +0200 configfs: simplify the configfs_dirent_is_ready Return the error directly instead of using a goto. Signed-off-by: Christoph Hellwig commit 417b962ddeca2b70eb72d28c87541bdad4e234f8 Author: Christoph Hellwig Date: Wed Aug 25 07:42:44 2021 +0200 configfs: return -ENAMETOOLONG earlier in configfs_lookup Just like most other file systems: get the simple checks out of the way first. Signed-off-by: Christoph Hellwig commit fde9c59aebafb91caeed816cc510b56f14aa63ae Author: Saleem Abdulrasool Date: Wed Aug 4 17:32:14 2021 +0000 riscv: explicitly use symbol offsets for VDSO The current implementation of the `__rt_sigaction` reference computed an absolute offset relative to the mapped base of the VDSO. While this can be handled in the medlow model, the medany model cannot handle this as it is meant to be position independent. The current implementation relied on the BFD linker relaxing the PC-relative relocation into an absolute relocation as it was a near-zero address allowing it to be referenced relative to `zero`. We now extract the offsets and create a generated header allowing the build with LLVM and lld to succeed as we no longer depend on the linker rewriting address references near zero. This change was largely modelled after the ARM64 target which does something similar. Signed-off-by: Saleem Abdulrasool Tested-by: Nathan Chancellor Signed-off-by: Palmer Dabbelt commit 32e19d12fc7c0bd027b3e657e790f986ac80d837 Merge: 0bffa153a2f46 e9e3d5f9e34c0 Author: Steve French Date: Tue Aug 24 23:39:46 2021 -0500 Merge pull request #69 from namjaejeon/cifsd-for-next ksmbd-fixes commit e9e3d5f9e34c00b57dbec0d422cf2ad7318c0155 Author: Namjae Jeon Date: Wed Aug 25 09:57:09 2021 +0900 MAINTAINERS: ksmbd: add cifs_common directory to ksmbd entry The codes that shared between cifs and ksmbd will move into the cifs_common directory. This patch add it to the ksmbd entry in the MAINTAINERS file. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1923b544bf6094f7c3a86692de8a026b9d52efc1 Author: Namjae Jeon Date: Wed Aug 25 09:42:22 2021 +0900 MAINTAINERS: ksmbd: update my email address My email address in ksmbd entry will be not available in a few days. Update it to my own kernel.org address. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8341dcfbd8dda98a3b2836a421016f7d88e35b1c Author: Jisheng Zhang Date: Thu Aug 5 00:30:59 2021 +0800 riscv: Enable Undefined Behavior Sanitizer UBSAN Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for ubsan checks. VDSO is excluded because its build doesn't include the __ubsan_handle_*() functions from lib/ubsan.c, and the VDSO has no sane way to report errors even if it has definitions of these functions. Passed lib/test_ubsan.c test. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 7f85b04b08ca264923358e2c4e93422bad59a6e0 Author: Jisheng Zhang Date: Thu Aug 5 00:29:08 2021 +0800 riscv: Keep the riscv Kconfig selects sorted Move three Kconfig selects: ARCH_STACKWALK, ARCH_SUPPORTS_ATOMIC_RMW and ARCH_SUPPORTS_DEBUG_PAGEALLOC to the right place. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 9401f4e46cf6965e23738f70e149172344a01eef Author: Christophe Leroy Date: Tue Mar 2 08:48:11 2021 +0000 powerpc: Use lwarx/ldarx directly instead of PPC_LWARX/LDARX macros Force the eh flag at 0 on PPC32. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1fc81f07cabebb875b963e295408cc3dd38c8d85.1614674882.git.christophe.leroy@csgroup.eu commit 19e932eb6ea47f4f37513eb2ae0daee19117765c Author: Christophe Leroy Date: Tue Aug 17 16:00:14 2021 +0000 powerpc/ptrace: Make user_mode() common to PPC32 and PPC64 Today we have: #ifdef __powerpc64__ #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1) #else #define user_mode(regs) (((regs)->msr & MSR_PR) != 0) #endif With ppc64_defconfig, we get: if (!user_mode(regs)) 14b4: e9 3e 01 08 ld r9,264(r30) 14b8: 71 29 40 00 andi. r9,r9,16384 14bc: 41 82 07 a4 beq 1c60 <.emulate_instruction+0x7d0> If taking the ppc32 definition of user_mode(), the exact same code is generated for ppc64_defconfig. So, only keep one version of user_mode(), preferably the one not using MSR_PR_LG which should be kept internal to reg.h. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/000a28c51808bbd802b505af42d2cb316c2be7d3.1629216000.git.christophe.leroy@csgroup.eu commit 316389e904f968d24d44cd96a6d171ee1ef269cf Author: Christophe Leroy Date: Fri Jun 25 10:58:33 2021 +0000 powerpc/syscalls: Simplify do_mmap2() When shift is nul, operations remain valid so no test needed. And 'ret' is unnecessary. And use IS_ALIGNED() to check alignment, that's more clear. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/373ec500f386374bc5735007df3d3869eac47be1.1624618701.git.christophe.leroy@csgroup.eu commit e084728393a58e7fdafeee2e6b20e0faff09b557 Author: Christophe Leroy Date: Thu Jul 8 16:49:43 2021 +0000 powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP This patch converts powerpc to the generic PTDUMP implementation. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/03166d569526be70214fe9370a7bad219d2f41c8.1625762907.git.christophe.leroy@csgroup.eu commit cf98d2b6eea6a1b2c43f85680ad58fcc3ea9496b Author: Christophe Leroy Date: Thu Jul 8 16:49:42 2021 +0000 powerpc/ptdump: Reduce level numbers by 1 in note_page() and add p4d level Do the same as commit f8f0d0b6fa20 ("mm: ptdump: reduce level numbers by 1 in note_page()") and add missing p4d level. This will align powerpc to the users of generic ptdump. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d76495c574132b197b445a1f133755cca4b912a4.1625762906.git.christophe.leroy@csgroup.eu commit 64b87b0c70e0fd28352895cba3c0a9631e0072dd Author: Christophe Leroy Date: Thu Jul 8 16:49:41 2021 +0000 powerpc/ptdump: Remove unused 'page_size' parameter note_page_update_state() doesn't use page_size. Remove it. Could also be removed to note_page() but as a following patch will remove all current users of note_page(), just leave it as is for now. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e2f80d052001155251bfe009c360d0c5d9242c6b.1625762906.git.christophe.leroy@csgroup.eu commit 11f27a7fa4ca27935de74e3eb052bdc430d5f8d8 Author: Christophe Leroy Date: Thu Jul 8 16:49:40 2021 +0000 powerpc/ptdump: Use DEFINE_SHOW_ATTRIBUTE() Use DEFINE_SHOW_ATTRIBUTE() instead of open coding open() and fops. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b864a92693ca8413ef0b19f0c12065c212899b6e.1625762905.git.christophe.leroy@csgroup.eu commit 33e1402435cb9f3021439a15935ea2dc69ec1844 Author: Christophe Leroy Date: Tue Aug 24 07:56:35 2021 +0000 powerpc: Avoid link stack corruption in misc asm functions bl;mflr is used at several places to get code position. Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c6eabb4fb6c156f75d56dcbcc6f243e5ac0fba42.1629791763.git.christophe.leroy@csgroup.eu commit f5007dbf4da729baa850b33a64dc3cc53757bdf8 Author: Christophe Leroy Date: Tue Aug 24 07:56:26 2021 +0000 powerpc/booke: Avoid link stack corruption in several places Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e9fbc285eceb720e6c0e032ef47fe8b05f669b48.1629791751.git.christophe.leroy@csgroup.eu commit 113ec9ccc8049c3772f0eab46b62c5d6654c09f7 Author: Christophe Leroy Date: Fri Aug 20 05:16:05 2021 +0000 powerpc/32: indirect function call use bctrl rather than blrl in ret_from_kernel_thread Copied from commit 89bbe4c798bc ("powerpc/64: indirect function call use bctrl rather than blrl in ret_from_kernel_thread") blrl is not recommended to use as an indirect function call, as it may corrupt the link stack predictor. This is not a performance critical path but this should be fixed for consistency. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/91b1d242525307ceceec7ef6e832bfbacdd4501b.1629436472.git.christophe.leroy@csgroup.eu commit 9b5ac8ab4e8bf5636d1d425aee68ddf45af12057 Author: Adrian Hunter Date: Tue Aug 24 14:41:50 2021 +0300 scsi: ufs: Fix ufshcd_request_sense_async() for Samsung KLUFG8RHDA-B2D1 Samsung KLUFG8RHDA-B2D1 does not clear the unit attention condition if the length is zero. So go back to requesting all the sense data, as it was before patch "scsi: ufs: Request sense data asynchronously". That is simpler than creating and maintaining a quirk for affected devices. Link: https://lore.kernel.org/r/20210824114150.2105-1-adrian.hunter@intel.com Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit 313bf281f2091552f509fd05a74172c70ce7572f Author: Alim Akhtar Date: Thu Aug 19 22:41:31 2021 +0530 scsi: ufs: ufs-exynos: Fix static checker warning clk_get_rate() returns unsigned long and currently this driver stores the return value in u32 type, resulting the below warning: Fixed smatch warnings: drivers/scsi/ufs/ufs-exynos.c:286 exynos_ufs_get_clk_info() warn: wrong type for 'ufs->mclk_rate' (should be 'ulong') drivers/scsi/ufs/ufs-exynos.c:287 exynos_ufs_get_clk_info() warn: wrong type for 'pclk_rate' (should be 'ulong') Link: https://lore.kernel.org/r/20210819171131.55912-1-alim.akhtar@samsung.com Fixes: 55f4b1f73631 ("scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs") Reported-by: Dan Carpenter Signed-off-by: Alim Akhtar Signed-off-by: Martin K. Petersen commit b3e2c72af1d553a646c86bbb4c0be278686a295a Author: Martin K. Petersen Date: Mon Aug 16 22:50:13 2021 -0400 scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags. Link: https://lore.kernel.org/r/20210817025014.12085-2-martin.petersen@oracle.com Cc: Sreekanth Reddy Cc: Kashyap Desai Signed-off-by: Martin K. Petersen commit 125c12f71783a2aa394f6e16a5de3424ad4f7dfb Author: Martin K. Petersen Date: Mon Aug 16 22:50:14 2021 -0400 scsi: lpfc: Use the proper SCSI midlayer interfaces for PI Use the SCSI midlayer interfaces to query protection interval, reference tag, per-command DIX flags, and logical block count. Link: https://lore.kernel.org/r/20210817025014.12085-3-martin.petersen@oracle.com CC: James Smart CC: Dick Kennedy Reviewed-by: James Smart Signed-off-by: Martin K. Petersen commit 9eb636b639b43dc17fd4081359403ab2af8f4046 Author: James Smart Date: Mon Aug 16 09:29:01 2021 -0700 scsi: lpfc: Copyright updates for 14.0.0.1 patches Update copyrights to 2021 for files modified in the 14.0.0.1 patch set. Link: https://lore.kernel.org/r/20210816162901.121235-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 2dbf7cde53bec4f4d197b9d9af6f0fd6c37e5959 Author: James Smart Date: Mon Aug 16 09:29:00 2021 -0700 scsi: lpfc: Update lpfc version to 14.0.0.1 Update lpfc version to 14.0.0.1 Link: https://lore.kernel.org/r/20210816162901.121235-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 acbaa8c8ed17e768dab3f09f457fd265d7c94848 Author: James Smart Date: Mon Aug 16 09:28:59 2021 -0700 scsi: lpfc: Add bsg support for retrieving adapter cmf data Add a bsg ioctl to allow user applications to retrieve the adapter congestion management framework buffer. Link: https://lore.kernel.org/r/20210816162901.121235-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 74a7baa2a3ee8be200ea5421fe025d5eb8621a6a Author: James Smart Date: Mon Aug 16 09:28:58 2021 -0700 scsi: lpfc: Add cmf_info sysfs entry Allow abbreviated cm framework status information to be obtained via sysfs. Link: https://lore.kernel.org/r/20210816162901.121235-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 9f77870870d8cd42407a6df7bdc1347c8c9536ed Author: James Smart Date: Mon Aug 16 09:28:57 2021 -0700 scsi: lpfc: Add debugfs support for cm framework buffers Add support via debugfs to report the cm statistics, cm enablement, and rx monitor information. Link: https://lore.kernel.org/r/20210816162901.121235-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 7481811c3ac39498636acdbcc4cab74ae2a1ffe5 Author: James Smart Date: Mon Aug 16 09:28:56 2021 -0700 scsi: lpfc: Add support for maintaining the cm statistics buffer Add the logic to move the congestion management and event information into the cmd statistics buffer maintained for the adapter. The update includes rolling up values for the last minute, hour, and day information. Link: https://lore.kernel.org/r/20210816162901.121235-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 17b27ac5922454ff7de91cbed458643608c36abc Author: James Smart Date: Mon Aug 16 09:28:55 2021 -0700 scsi: lpfc: Add rx monitoring statistics The driver provides overwatch of the cm behavior by maintaining a set of rx I/O statistics. This information is also used in later updating of the cm statistics buffer. Link: https://lore.kernel.org/r/20210816162901.121235-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 02243836ad6f384284f10302e6b820b893960d1c Author: James Smart Date: Mon Aug 16 09:28:54 2021 -0700 scsi: lpfc: Add support for the CM framework Complete the enablement of the cm framework feature in the adapter. Perform the following: - Detect the presence of the congestion management framework feature. When the cm framework is present: - Issue the SET_FEATURE command to enable the feature. - Register the cm statistics buffer with the adapter. - Read the cm enablement buffer to determine the cm framework state for cm management. When cm management is enabled: - Monitor all FPIN and congestion signalling events, incrementing counters. - Regularly sync with the adapter to communicate congestion events and to receive an rx request limit. - Monitor requests for rx data and ensure that no more than the adapter prescribed limit is issued on the link. If the limit is exceeded, SCSI and/or NVMe traffic is temporarily suspended. - Maintain the minute, hourly, daily statistics buffer. - Monitor for congestion enablement change events, causing a reread of the enablement buffer and acting on any change in enablement. And: - Add teardown logic, including buffer deregistration, on adapter detachment or reset. Link: https://lore.kernel.org/r/20210816162901.121235-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 daebf93fc3a5d12b3bc928aebb168c68e754dda2 Author: James Smart Date: Mon Aug 16 09:28:53 2021 -0700 scsi: lpfc: Add cmfsync WQE support When congestion mgmt is enabled, cmf has the driver regularly issue a command to synchronize reporting of congestion mgmt events such as fpin and signal delivery. This patch adds the definition of the CMF_SYNC WQE and its CQE fields as well as support for issuing the command. The patch also adds the few remaining cmf-related SLI additions, such as feature definition for enablement of CMF and notifications to the driver if the cm enablement mode changes. Link: https://lore.kernel.org/r/20210816162901.121235-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 72df8a452883b0be334396acba07df77c3c3f6c7 Author: James Smart Date: Mon Aug 16 09:28:52 2021 -0700 scsi: lpfc: Add support for cm enablement buffer As part of the cmf framework, the firmware maintains a table with congestion related state information, specifically whether enabled and if enabled, whether monitoring or actively managing congestion. Add definition of the table and add support to read the table from the adapter and determine if it is enabled. In support of this, the READ_OBJECT mailbox command definition is added to the driver. Link: https://lore.kernel.org/r/20210816162901.121235-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 8c42a65c391732254d4da66aac6c6f9ed1a290ae Author: James Smart Date: Mon Aug 16 09:28:51 2021 -0700 scsi: lpfc: Add cm statistics buffer support The cmf framework requires the driver to maintain a cm statistics table, accessible inband, of congestion related statistics that are reported per minute, rolled up to per hour, and rolled up again per day. Several days worth may be maintained. The table is registered with the adapter when the MIB feature is enabled. Add definition of the table and add support to register the table with the adapter. Includes definition and initialization of event counters that are later added to the statistics table. Link: https://lore.kernel.org/r/20210816162901.121235-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 9064aeb2df8e8185f649afa4600edcd8f6a9f6fd Author: James Smart Date: Mon Aug 16 09:28:50 2021 -0700 scsi: lpfc: Add EDC ELS support When congestion management is enabled, issue EDC ELS to register congestion signaling capabilities with the fabric. The response handling will process the fabric parameters and set the reporting parameters. Similarly, add support for receiving an EDC request from the fabric generating a corresponding response. Implement handlers for congestion signals from the fabric and maintain statistics for them. Link: https://lore.kernel.org/r/20210816162901.121235-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 428569e66fa7ef4a41fbea9fa80f559914a74667 Author: James Smart Date: Mon Aug 16 09:28:49 2021 -0700 scsi: lpfc: Expand FPIN and RDF receive logging Expand FPIN logging: - Display Attached Port Names for Link Integrity and Peer Congestion events - Log Delivery, Peer Congestion, and Congestion events - Sanity check FPIN descriptor lengths when processing FPIN descriptors. Log RDF events when congestion logging is enabled. Link: https://lore.kernel.org/r/20210816162901.121235-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 c6a5c747a3f9b035f836ba084416a4336291f276 Author: James Smart Date: Mon Aug 16 09:28:48 2021 -0700 scsi: lpfc: Add MIB feature enablement support MIB support is currently limited to detecting support in the adapter and ensuring FDMI support is enabled if present. For the new framework MIB support also requires active enablement of support via the SET_FEATURES command with the firmware. Rework the MIB detection and enablement for the following: - Move detection away from the get_sli4_parameters routine, and into the hba_setup path. get_sli4_parameters is only called once at attachment while hba_setup is called as part of any SLI port reset path. This ensures detection after firmware download. - Update SET_FEATURES mbx command for the MIB enablement feature and add support for the feature. - Create the cmf_setup routine to encapsulate the detection of MIB support and perform the enablement of the MIB support feature. Link: https://lore.kernel.org/r/20210816162901.121235-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 3b0009c8be75bb5e4d5385e500735c07ec104467 Author: James Smart Date: Mon Aug 16 09:28:47 2021 -0700 scsi: lpfc: Add SET_HOST_DATA mbox cmd to pass date/time info to firmware Implement the SET_HOST_DATA mbox command to set date / time during initialization. It is used by the firmware for various purposes including congestion management and firmware dumps. Link: https://lore.kernel.org/r/20210816162901.121235-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 54404d357284d1405d98c424951357d970f41168 Author: James Smart Date: Mon Aug 16 09:28:46 2021 -0700 scsi: fc: Add EDC ELS definition Add Exchange Diagnostic Capabilities (EDC) ELS definition and the following capability descriptors: - Link Fault Capability Descriptor - Congestion Signaling Capability Descriptor Definitions taken from FC-LS-5 r5.01 Link: https://lore.kernel.org/r/20210816162901.121235-2-jsmart2021@gmail.com Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 922ad26ebeaa8531f3dec4f38e9e5b6381244b20 Author: Keoseong Park Date: Wed Aug 18 18:41:39 2021 +0900 scsi: ufs: ufshpb: Fix typo in comments Change "allcation" to "allocation". Link: https://lore.kernel.org/r/1891546521.01629282781634.JavaMail.epsvc@epcpadp4 Signed-off-by: Keoseong Park Signed-off-by: Martin K. Petersen commit 0da66348c26ffde19d69ed7770514d202afde222 Author: Kashyap Desai Date: Wed Aug 18 13:47:55 2021 +0530 scsi: mpi3mr: Set up IRQs in resume path Driver is not setting up IRQs in the resume path. As a result, hibernation path is broken and controller will not be operational after system is resumed. Set up IRQs to handle the hibernation case. Link: https://lore.kernel.org/r/20210818081755.1274470-1-kashyap.desai@broadcom.com Cc: sathya.prakash@broadcom.com Cc: thenzl@redhat.com Reported-by: Marco Patalano Tested-by: Marco Patalano Signed-off-by: Kashyap Desai Signed-off-by: Martin K. Petersen commit 04a71cdc46a94b13ee876290ad961b4886e24c76 Author: Halil Pasic Date: Mon Aug 23 15:34:58 2021 +0200 scsi: core: scsi_ioctl: Fix error code propagation in SG_IO Link: https://lore.kernel.org/r/20210823133458.3536824-1-pasic@linux.ibm.com Fixes: f2542a3be327 ("scsi: scsi_ioctl: Move the "block layer" SCSI ioctl handling to drivers/scsi") Reviewed-by: Christoph Hellwig Signed-off-by: Halil Pasic Signed-off-by: Martin K. Petersen commit 6c9783e6296e8c7bf45464c00a52c457b4c321b5 Author: Keoseong Park Date: Mon Aug 23 18:07:14 2021 +0900 scsi: ufs: ufshpb: Fix possible memory leak When HPB pinned region exists and mctx allocation for this region fails, a memory leak is possible because memory is not released for the subregion table of the current region. Free memory for the subregion table of the current region. Link: https://lore.kernel.org/r/1891546521.01629711601304.JavaMail.epsvc@epcpadp3 Reviewed-by: Bart Van Assche Signed-off-by: Keoseong Park Signed-off-by: Martin K. Petersen commit 1259d5f0f5ef1ce39463b9cf3db7a1757acbeb69 Author: Colin Ian King Date: Fri Aug 20 16:18:35 2021 +0100 scsi: snic: Fix spelling mistake 'progres' -> 'progress' There is a spelling mistake in a SNIC_HOST_INFO message. Fix it. Link: https://lore.kernel.org/r/20210820151835.59804-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 1c22e327545c3eb4f43db5099fe8f134798d98a9 Author: Hannes Reinecke Date: Fri Aug 20 11:54:05 2021 +0200 scsi: ncr53c8xx: Remove unused code Link: https://lore.kernel.org/r/20210820095405.12801-4-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit f434e4984f5f2ce373902f14b816cc6f4ab809d9 Author: Hannes Reinecke Date: Fri Aug 20 11:54:04 2021 +0200 scsi: ncr53c8xx: Complete all commands during bus reset ncr_reset_bus() will complete all outstanding commands anyway, so there's no need to single out a specific command. Link: https://lore.kernel.org/r/20210820095405.12801-3-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 227a13cf12f9d1a35c40033dd00e5cb87a5db932 Author: Hannes Reinecke Date: Fri Aug 20 11:54:03 2021 +0200 scsi: ncr53c8xx: Remove 'sync_reset' argument from ncr_reset_bus() Always '1', so we can remove it. Link: https://lore.kernel.org/r/20210820095405.12801-2-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit f38a032b165d812b0ba8378a5cd237c0888ff65f Author: Dave Chinner Date: Tue Aug 24 19:13:04 2021 -0700 xfs: fix I_DONTCACHE Yup, the VFS hoist broke it, and nobody noticed. Bulkstat workloads make it clear that it doesn't work as it should. Fixes: dae2f8ed7992 ("fs: Lift XFS_IDONTCACHE to the VFS layer") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a37c5c26693eadb3aa4101d8fe955e40d206b386 Author: Kangmin Park Date: Mon Aug 23 19:21:18 2021 +0900 net: bridge: change return type of br_handle_ingress_vlan_tunnel br_handle_ingress_vlan_tunnel() is only referenced in br_handle_frame(). If br_handle_ingress_vlan_tunnel() is called and return non-zero value, goto drop in br_handle_frame(). But, br_handle_ingress_vlan_tunnel() always return 0. So, the routines that check the return value and goto drop has no meaning. Therefore, change return type of br_handle_ingress_vlan_tunnel() to void and remove if statement of br_handle_frame(). Signed-off-by: Kangmin Park Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20210823102118.17966-1-l4stpr0gr4m@gmail.com Signed-off-by: Jakub Kicinski commit 7844ec21a915cc60f1e2cd8682b943b916a7d2fc Author: Po-Hsu Lin Date: Mon Aug 23 16:58:54 2021 +0800 selftests/net: Use kselftest skip code for skipped tests There are several test cases in the net directory are still using exit 0 or exit 1 when they need to be skipped. Use kselftest framework skip code instead so it can help us to distinguish the return status. Criterion to filter out what should be fixed in net directory: grep -r "exit [01]" -B1 | grep -i skip This change might cause some false-positives if people are running these test scripts directly and only checking their return codes, which will change from 0 to 4. However I think the impact should be small as most of our scripts here are already using this skip code. And there will be no such issue if running them with the kselftest framework. Signed-off-by: Po-Hsu Lin Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Link: https://lore.kernel.org/r/20210823085854.40216-1-po-hsu.lin@canonical.com Signed-off-by: Jakub Kicinski commit 79fbd3e1241cea83dded06db2b8bcd5893d877d7 Author: Maor Gottlieb Date: Tue Aug 24 17:25:31 2021 +0300 RDMA: Use the sg_table directly and remove the opencoded version from umem This allows using the normal sg_table APIs and makes all the code cleaner. Remove sgt, nents and nmapd from ib_umem. Link: https://lore.kernel.org/r/20210824142531.3877007-4-maorg@nvidia.com Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3e302dbc6774a27edaea39a1d5107f0c12e35cf2 Author: Maor Gottlieb Date: Tue Aug 24 17:25:30 2021 +0300 lib/scatterlist: Fix wrong update of orig_nents orig_nents should represent the number of entries with pages, but __sg_alloc_table_from_pages sets orig_nents as the number of total entries in the table. This is wrong when the API is used for dynamic allocation where not all the table entries are mapped with pages. It wasn't observed until now, since RDMA umem who uses this API in the dynamic form doesn't use orig_nents implicit or explicit by the scatterlist APIs. Fix it by changing the append API to track the SG append table state and have an API to free the append table according to the total number of entries in the table. Now all APIs set orig_nents as number of enries with pages. Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages") Link: https://lore.kernel.org/r/20210824142531.3877007-3-maorg@nvidia.com Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 67d69e9d1a6c889d98951c1d74b19332ce0565af Author: Richard Guy Briggs Date: Mon Aug 23 22:04:09 2021 -0400 audit: move put_tree() to avoid trim_trees refcount underflow and UAF AUDIT_TRIM is expected to be idempotent, but multiple executions resulted in a refcount underflow and use-after-free. git bisect fingered commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations of refcount_t") but this patch with its more thorough checking that wasn't in the x86 assembly code merely exposed a previously existing tree refcount imbalance in the case of tree trimming code that was refactored with prune_one() to remove a tree introduced in commit 8432c7006297 ("audit: Simplify locking around untag_chunk()") Move the put_tree() to cover only the prune_one() case. Passes audit-testsuite and 3 passes of "auditctl -t" with at least one directory watch. Cc: Jan Kara Cc: Will Deacon Cc: Alexander Viro Cc: Seiji Nishikawa Cc: stable@vger.kernel.org Fixes: 8432c7006297 ("audit: Simplify locking around untag_chunk()") Signed-off-by: Richard Guy Briggs Reviewed-by: Jan Kara [PM: reformatted/cleaned-up the commit description] Signed-off-by: Paul Moore commit b261dba2fdb2c2656935a048cdbc6f2d24231e08 Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:06 2021 +0200 arm64: kdump: Remove custom linux,usable-memory-range handling Remove the architecture-specific code for handling the "linux,usable-memory-range" property under the "/chosen" node in DT, as the platform-agnostic FDT core code already takes care of this. Signed-off-by: Geert Uytterhoeven Acked-by: Catalin Marinas Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/7356c531c49a24b4a55577bf8e46d93f4d8ae460.1628670468.git.geert+renesas@glider.be commit 57beb9bd18fca085e6627526d64d68b6080f605c Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:05 2021 +0200 arm64: kdump: Remove custom linux,elfcorehdr handling Remove the architecture-specific code for handling the "linux,elfcorehdr" property under the "/chosen" node in DT, as the platform-agnostic handling in the FDT core code already takes care of this. Signed-off-by: Geert Uytterhoeven Acked-by: Catalin Marinas Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/3b8f801f9b92066855e87f3079fafc153ab20f69.1628670468.git.geert+renesas@glider.be commit 2931ea847dcc54275cda8c39c548b03347d4943b Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:04 2021 +0200 riscv: Remove non-standard linux,elfcorehdr handling RISC-V uses platform-specific code to locate the elf core header in memory. However, this does not conform to the standard "linux,elfcorehdr" DT bindings, as it relies on a reserved memory node with the "linux,elfcorehdr" compatible value, instead of on a "linux,elfcorehdr" property under the "/chosen" node. The non-compliant code can just be removed, as the standard behavior is already implemented by platform-agnostic handling in the FDT core code. Fixes: 5640975003d0234d ("RISC-V: Add crash kernel support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/41c75d6ee3114ae6304f8afe0051895af91200ee.1628670468.git.geert+renesas@glider.be commit bf2e8609734bd773610d414b72eb1cfe09b4c24d Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:03 2021 +0200 of: fdt: Use IS_ENABLED(CONFIG_BLK_DEV_INITRD) instead of #ifdef Replace the conditional compilation using "#ifdef CONFIG_BLK_DEV_INITRD" by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to increase compile coverage and to simplify the code. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/604c13747f09d800da6a7c12f661e1ec146f1dfd.1628670468.git.geert+renesas@glider.be commit 2af2b50acf9b9c38080a45f32a9c162e2a0f2de2 Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:02 2021 +0200 of: fdt: Add generic support for handling usable memory range property Add support for handling the "linux,usable-memory-range" property in the "/chosen" node to the FDT core code. This can co-exist safely with the architecture-specific handling, until the latter has been removed. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/3bd69bada93ee59b7d23c38b3527fc1654e19343.1628670468.git.geert+renesas@glider.be commit f7e7ce93aac13118281bcef8407b5df1a6b16822 Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:01 2021 +0200 of: fdt: Add generic support for handling elf core headers property There are two methods to specify the location of the elf core headers: using the "elfcorehdr=" kernel parameter, as handled by generic code in kernel/crash_dump.c, or using the "linux,elfcorehdr" property under the "/chosen" node in the Device Tree, as handled by architecture-specific code in arch/arm64/mm/init.c. Extend support for "linux,elfcorehdr" to all platforms supporting DT by adding platform-agnostic handling for handling this property to the FDT core code. This can co-exist safely with the architecture-specific handling, until the latter has been removed. This requires moving the call to of_scan_flat_dt() up, as the code scanning the "/chosen" node now needs to be aware of the values of "#address-cells" and "#size-cells". Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/c7e46e50aaf87ef49bdaa61358d25b122f32b7df.1628670468.git.geert+renesas@glider.be commit 33709413014cd5b8e54d4d9efa07a30ba028e1db Author: Geert Uytterhoeven Date: Wed Aug 11 10:51:00 2021 +0200 crash_dump: Make elfcorehdr address/size symbols always visible Make the forward declarations of elfcorehdr_addr and elfcorehdr_size, and the definitions of ELFCORE_ADDR_MAX and ELFCORE_ADDR_ERR always available, like is done for phys_initrd_start and phys_initrd_size. Code referring to these symbols can then just check for IS_ENABLED(CONFIG_CRASH_DUMP), instead of requiring conditional compilation using an #ifdef, thus preparing to increase compile coverage. Suggested-by: Rob Herring Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/ba965ca613c0cc82c1ec2fe353ee34fb13b36474.1628670468.git.geert+renesas@glider.be commit 0b3813014c865a74b6322a4512de6610abf999b6 Author: Krzysztof Kozlowski Date: Fri Aug 20 17:03:52 2021 +0200 dt-bindings: memory: convert Samsung Exynos DMC to dtschema Convert Samsung Exynos5422 SoC frequency and voltage scaling for Dynamic Memory Controller to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Acked-by: Lukasz Luba Link: https://lore.kernel.org/r/20210820150353.161161-3-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit c507f1523106c266927813f4da64b8c42e5ea7e0 Author: Krzysztof Kozlowski Date: Fri Aug 20 17:03:51 2021 +0200 dt-bindings: devfreq: event: convert Samsung Exynos PPMU to dtschema Convert Samsung Exynos PPMU bindings to DT schema format using json-schema. The example is quite different due to the nature of dtschema examples parsing (no overriding via-label allowed). New bindings contain copied description from previous bindings document, therefore the license is set as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210820150353.161161-2-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 3bbc8ee7c363a83aa192d796ad37b6bf462a2947 Merge: d7af7e497f030 594a116b2aa19 Author: Alexei Starovoitov Date: Tue Aug 24 14:48:43 2021 -0700 Merge branch 'Improve XDP samples usability and output' Kumar Kartikeya says: ==================== This set revamps XDP samples related to redirection to show better output and implement missing features consolidating all their differences and giving them a consistent look and feel, by implementing common features and command line options. Some of the TODO items like reporting redirect error numbers (ENETDOWN, EINVAL, ENOSPC, etc.) have also been implemented. Some of the features are: * Received packet statistics * xdp_redirect/xdp_redirect_map tracepoint statistics * xdp_redirect_err/xdp_redirect_map_err tracepoint statistics (with support for showing exact errno) * xdp_cpumap_enqueue/xdp_cpumap_kthread tracepoint statistics * xdp_devmap_xmit tracepoint statistics * xdp_exception tracepoint statistics * Per ifindex pair devmap_xmit stats shown dynamically (for xdp_monitor) to decompose the total. * Use of BPF skeleton and BPF static linking to share BPF programs. * Use of vmlinux.h and tp_btf for raw_tracepoint support. * Removal of redundant -N/--native-mode option (enforced by default now) * ... and massive cleanups all over the place. All tracepoints also use raw_tp now, and tracepoints like xdp_redirect are only enabled when requested explicitly to capture successful redirection statistics. The set of programs converted as part of this series are: * xdp_redirect_cpu * xdp_redirect_map_multi * xdp_redirect_map * xdp_redirect * xdp_monitor Explanation of the output: There is now a concise output mode by default that shows primarily four fields: rx/s Number of packets received per second redir/s Number of packets successfully redirected per second err,drop/s Aggregated count of errors per second (including dropped packets) xmit/s Number of packets transmitted on the output device per second Some examples: ; sudo ./xdp_redirect_map veth0 veth1 -s Redirecting from veth0 (ifindex 15; driver veth) to veth1 (ifindex 14; driver veth) veth0->veth1 0 rx/s 0 redir/s 0 err,drop/s 0 xmit/s veth0->veth1 9,998,660 rx/s 9,998,658 redir/s 0 err,drop/s 9,998,654 xmit/s ... There is also a verbose mode, that can also be enabled by default using -v (--verbose). The output mode can be switched dynamically at runtime using Ctrl + \ (SIGQUIT). To make the concise output more useful, the errors that occur are expanded inline (as if verbose mode was enabled) to let the user pin down the source of the problem without having to clutter output (or possibly miss it) or always use verbose mode. For instance, let's consider a case where the output device link state is set to down while redirection is happening: [...] veth0->veth1 24,503,376 rx/s 0 err,drop/s 24,503,372 xmit/s veth0->veth1 25,044,775 rx/s 0 err,drop/s 25,044,783 xmit/s veth0->veth1 25,263,046 rx/s 4 err,drop/s 25,263,028 xmit/s redirect_err 4 error/s ENETDOWN 4 error/s [...] The same holds for xdp_exception actions. An example of how a complete xdp_redirect_map session would look: ; sudo ./xdp_redirect_map veth0 veth1 Redirecting from veth0 (ifindex 5; driver veth) to veth1 (ifindex 4; driver veth) veth0->veth1 7,411,506 rx/s 0 err,drop/s 7,411,470 xmit/s veth0->veth1 8,931,770 rx/s 0 err,drop/s 8,931,771 xmit/s ^\ veth0->veth1 8,787,295 rx/s 0 err,drop/s 8,787,325 xmit/s receive total 8,787,295 pkt/s 0 drop/s 0 error/s cpu:7 8,787,295 pkt/s 0 drop/s 0 error/s redirect_err 0 error/s xdp_exception 0 hit/s xmit veth0->veth1 8,787,325 xmit/s 0 drop/s 0 drv_err/s 2.00 bulk-avg cpu:7 8,787,325 xmit/s 0 drop/s 0 drv_err/s 2.00 bulk-avg veth0->veth1 8,842,610 rx/s 0 err,drop/s 8,842,606 xmit/s receive total 8,842,610 pkt/s 0 drop/s 0 error/s cpu:7 8,842,610 pkt/s 0 drop/s 0 error/s redirect_err 0 error/s xdp_exception 0 hit/s xmit veth0->veth1 8,842,606 xmit/s 0 drop/s 0 drv_err/s 2.00 bulk-avg cpu:7 8,842,606 xmit/s 0 drop/s 0 drv_err/s 2.00 bulk-avg ^C Packets received : 33,973,181 Average packets/s : 4,246,648 Packets transmitted : 33,973,172 Average transmit/s : 4,246,647 The xdp_redirect tracepoint (for success stats) needs to be enabled explicitly using --stats/-s. Documentation for entire output and options is provided when user specifies --help/-h with a sample. Changelog: ---------- v3 -> v4: v3: https://lore.kernel.org/bpf/20210728165552.435050-1-memxor@gmail.com * Address all feedback from Daniel * Use READ_ONCE/WRITE_ONCE from linux/compiler.h (cannot directly include due to conflicts with vmlinux.h) * Fix MAX_CPUS hardcoding by switching to mmapable array maps, that are resized based on the value of libbpf_num_possible_cpus * s/ELEMENTS_OF/ARRAY_SIZE/g * Use tools/include/linux/hashtable.h * Coding style fixes * Remove hyperlinks for tracepoints * Split into smaller reviewable changes * Restore support for specifying custom xdp_redirect_cpu cpumap prog with some enhancements, including built-in programs for common actions (pass, drop, redirect). By default, cpumap prog is now disabled. * Misc bug fixes all over the place The printing stuff is a lot more basic without hyperlink support, hence it has not been exported into a more general facility. v2 -> v3 v2: https://lore.kernel.org/bpf/20210721212833.701342-1-memxor@gmail.com * Address all feedback from Andrii * Replace usage of libbpf hashmap (internal API) with custom one * Rename ATOMIC_* macros to NO_TEAR_* to better reflect their use * Use size_t as a portable word sized data type * Set libbpf_set_strict_mode * Invert conditions in BPF programs to exit early and reduce nesting * Use canonical SEC("xdp") naming for all XDP BPF progams * Add missing help description for cpumap enqueue and kthread tracepoints * Move private struct declarations from xdp_sample_user.h to .c file * Improve help output for cpumap enqueue and cpumap kthread tracepoints * Fix a bug where keys array for BPF_MAP_LOOKUP_BATCH is overallocated * Fix some conditions for printing stats (earlier only checked pps, now pps, drop, err and print if any is greater than zero) * Fix alloc_stats_record to properly return and cleanup allocated memory on allocation failure instead of calling exit(3) * Bump bpf_map_lookup_batch count to 32 to reduce lookup time with multiple devices in map * Fix a bug where devmap_xmit_multi stats are not printed when previous record is missing (i.e. when the first time stats are printed), by simply using a dummy record that is zeroed out * Also print per-CPU counts for devmap_xmit_multi which we collect already * Change mac_map to be BPF_MAP_TYPE_HASH instead of array to prevent resizing to a large size when max_ifindex is high, in xdp_redirect_map_multi * Fix instance of strerror(errno) in sample_install_xdp to use saved errno * Provide a usage function from samples helper * Provide a fix where incorrect stats are shown for parallel sessions of xdp_redirect_* samples by introducing matching support for input device(s), output device(s) and cpumap map id for enqueue and kthread stats. Only xdp_monitor doesn't filter stats, all others do. RFC (v1) -> v2 RFC (v1): https://lore.kernel.org/bpf/20210528235250.2635167-1-memxor@gmail.com * Address all feedback from Andrii * Use BPF static linking * Use vmlinux.h * Use BPF_PROG macro * Use global variables instead of maps * Use of tp_btf for raw_tracepoint progs * Switch to timerfd for polling * Use libbpf hashmap for maintaing device sets for per ifindex pair devmap_xmit stats * Fix Makefile to specify object dependencies properly * Use in-tree bpftool * ... misc fixes and cleanups all over the place ==================== Signed-off-by: Alexei Starovoitov commit 594a116b2aa1985dbb5318c2be39b64b74ebff84 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:10 2021 +0530 samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper Use the libbpf skeleton facility and other utilities provided by XDP samples helper. Also adapt to change of type of mac address map, so that no resizing is required. Add a new flag for sample mask that skips priting the from_device->to_device heading for each line, as xdp_redirect_map_multi may have two devices but the flow of data may be bidirectional, so the output would be confusing. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-23-memxor@gmail.com commit a29b3ca17ee69e3e5182f1ed29be6b6ec306c149 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:09 2021 +0530 samples: bpf: Convert xdp_redirect_map_multi_kern.o to XDP samples helper One of the notable changes is using a BPF_MAP_TYPE_HASH instead of array map to store mac addresses of devices, as the resizing behavior was based on max_ifindex, which unecessarily maximized the capacity of map beyond what was needed. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-22-memxor@gmail.com commit bbe65865aa05fdbd20e37bbd3b2c95a0e9e24416 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:08 2021 +0530 samples: bpf: Convert xdp_redirect_map to XDP samples helper Use the libbpf skeleton facility and other utilities provided by XDP samples helper. Since get_mac_addr is already provided by XDP samples helper, we drop it. Also convert to XDP samples helper similar to prior samples to minimize duplication of code. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-21-memxor@gmail.com commit 54af769db92a47be8a9d23a4434dbd343b36f216 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:07 2021 +0530 samples: bpf: Convert xdp_redirect_map_kern.o to XDP samples helper Also update it to use consistent SEC("xdp") and SEC("xdp_devmap") naming, and use global variable instead of BPF map for copying the mac address. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-20-memxor@gmail.com commit e531a220cc59282a3f371608f1a6fa960416e231 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:06 2021 +0530 samples: bpf: Convert xdp_redirect_cpu to XDP samples helper Use the libbpf skeleton facility and other utilities provided by XDP samples helper. Similar to xdp_monitor, xdp_redirect_cpu was quite featureful except a few minor omissions (e.g. redirect errno reporting). All of these have been moved to XDP samples helper, hence drop the unneeded code and convert to usage of helpers provided by it. One of the important changes here is dropping of mprog-disable option, as we make that the default. Also, we support built-in programs for some common actions on the packet when it reaches kthread (pass, drop, redirect to device). If the user still needs to install a custom program, they can still supply a BPF object, however the program should be suitably tagged with SEC("xdp_cpumap") annotation so that the expected attach type is correct when updating our cpumap map element. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-19-memxor@gmail.com commit 79ccf4529ee67510fdad8ecdfcf37528d353a36c Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:05 2021 +0530 samples: bpf: Convert xdp_redirect_cpu_kern.o to XDP samples helper Similar to xdp_monitor_kern, a lot of these BPF programs have been reimplemented properly consolidating missing features from other XDP samples. Hence, drop the unneeded code and rename to .bpf.c suffix. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-18-memxor@gmail.com commit b926c55d856cbe2593c44e783b31e2cdb0ef6371 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:04 2021 +0530 samples: bpf: Convert xdp_redirect to XDP samples helper Use the libbpf skeleton facility and other utilities provided by XDP samples helper. One important note: The XDP samples helper handles ownership of installed XDP programs on devices, including responding to SIGINT and SIGTERM, so drop the code here and use the helpers we provide going forward for all xdp_redirect* conversions. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-17-memxor@gmail.com commit 66fc4ca85d910bdeecf019c3999bc2df7c80b726 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:03 2021 +0530 samples: bpf: Convert xdp_redirect_kern.o to XDP samples helper We moved swap_src_dst_mac to xdp_sample.bpf.h to be shared with other potential users, so drop it while moving code to the new file. Also, consistently use SEC("xdp") naming instead. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-16-memxor@gmail.com commit 6e1051a54e3100df59dae01c24ff4a6d6027e303 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:02 2021 +0530 samples: bpf: Convert xdp_monitor to XDP samples helper Use the libbpf skeleton facility and other utilities provided by XDP samples helper. A lot of the code in xdp_monitor and xdp_redirect_cpu has been moved to the xdp_sample_user.o helper, so we remove the duplicate functions here that are no longer needed. Thanks to BPF skeleton, we no longer depend on order of tracepoints to uninstall them on startup. Instead, the sample mask is used to install the needed tracepoints. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-15-memxor@gmail.com commit 3f19956010d26906e84baec4cd9c48bd8808de96 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:01 2021 +0530 samples: bpf: Convert xdp_monitor_kern.o to XDP samples helper We already moved all the functionality it provided in XDP samples helper userspace and kernel BPF object, so just delete the unneeded code. We also add generation of BPF skeleton and compilation using clang -target bpf for files ending with .bpf.c suffix (to denote that they use vmlinux.h). Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-14-memxor@gmail.com commit 384b6b3bbf0d3b60ca118459a91b7b8ce1dcd6bd Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:50:00 2021 +0530 samples: bpf: Add vmlinux.h generation support Also, take this opportunity to depend on in-tree bpftool, so that we can use static linking support in subsequent commits for XDP samples BPF helper object. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-13-memxor@gmail.com commit af93d58c27b6ac4154f1651f47be2a159f8ce30f Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:59 2021 +0530 samples: bpf: Add devmap_xmit tracepoint statistics support This adds support for retrieval and printing for devmap_xmit total and mutli mode tracepoint. For multi mode, we keep a hash map entry for each redirection stream, such that we can dynamically add and remove entries on output. The from_match and to_match will be set by individual samples when setting up the XDP program on these devices. The multi mode tracepoint is also handy for xdp_redirect_map_multi, where up to 32 devices can be specified. Also add samples_init_pre_load macro to finally set up the resized maps and mmap them in place for low overhead stats retrieval. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-12-memxor@gmail.com commit 5f116212f4018fc9aa7a2a828b27aab540b8e5fa Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:58 2021 +0530 samples: bpf: Add BPF support for devmap_xmit tracepoint This adds support for the devmap_xmit tracepoint, and its multi device variant that can be used to obtain streams for each individual net_device to net_device redirection. This is useful for decomposing total xmit stats in xdp_monitor. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-11-memxor@gmail.com commit d771e217506adcfbfb08c693fb9332ee4859d61d Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:57 2021 +0530 samples: bpf: Add cpumap tracepoint statistics support This consolidates retrieval and printing into the XDP sample helper. For the kthread stats, it expands xdp_stats separately with its own per-CPU stats. For cpumap enqueue, we display FROM->TO stats also with its per-CPU stats. The help out explains in detail the various aspects of the output. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-10-memxor@gmail.com commit 0cf3c2fc4b1afbd8d9c376754af34c1d2bd56de7 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:56 2021 +0530 samples: bpf: Add BPF support for cpumap tracepoints These are invoked in two places, when the XDP frame or SKB (for generic XDP) enqueued to the ptr_ring (cpumap_enqueue) and when kthread processes the frame after invoking the CPUMAP program for it (returning stats for the batch). We use cpumap_map_id to filter on the map_id as a way to avoid printing incorrect stats for parallel sessions of xdp_redirect_cpu. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-9-memxor@gmail.com commit 82c450803a917da6edb34a0a769d0b5a0b10990c Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:55 2021 +0530 samples: bpf: Add xdp_exception tracepoint statistics support This implements the retrieval and printing, as well the help output. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-8-memxor@gmail.com commit 451588764e2f3e3ab197b23c7958f750707e2a24 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:54 2021 +0530 samples: bpf: Add BPF support for xdp_exception tracepoint This would allow us to store stats for each XDP action, including their per-CPU counts. Consolidating this here allows all redirect samples to detect xdp_exception events. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-7-memxor@gmail.com commit 1d930fd2cdbf5e156c32c73ea7f3d5b12bdc41d7 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:53 2021 +0530 samples: bpf: Add redirect tracepoint statistics support This implements per-errno reporting (for the ones we explicitly recognize), adds some help output, and implements the stats retrieval and printing functions. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-6-memxor@gmail.com commit 323140389405e5d5d2020b2e3e04863d12cf3e32 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:52 2021 +0530 samples: bpf: Add BPF support for redirect tracepoint This adds the shared BPF file that will be used going forward for sharing tracepoint programs among XDP redirect samples. Since vmlinux.h conflicts with tools/include for READ_ONCE/WRITE_ONCE and ARRAY_SIZE, they are copied in to xdp_sample.bpf.h along with other helpers that will be required. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-5-memxor@gmail.com commit 156f886cf69715265f7b65cb4153bce8f8570326 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:51 2021 +0530 samples: bpf: Add basic infrastructure for XDP samples This file implements some common helpers to consolidate differences in features and functionality between the various XDP samples and give them a consistent look, feel, and reporting capabilities. This commit only adds support for receive statistics, which does not rely on any tracepoint, but on the XDP program installed on the device by each XDP redirect sample. Some of the key features are: * A concise output format accompanied by helpful text explaining its fields. * An elaborate output format building upon the concise one, and folding out details in case of errors and staying out of view otherwise. * Printing driver names for devices redirecting packets. * Getting mac address for interface. * Printing summarized total statistics for the entire session. * Ability to dynamically switch between concise and verbose mode, using SIGQUIT (Ctrl + \). In later patches, the support will be extended for each tracepoint with its own custom output in concise and verbose mode. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-4-memxor@gmail.com commit f2e85d4a751663514c1e84ea65f334ce1ca13a28 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:50 2021 +0530 tools: include: Add ethtool_drvinfo definition to UAPI header Instead of copying the whole header in, just add the struct definitions we need for now. In the future it can be synced as a copy of in-tree header if required. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-3-memxor@gmail.com commit 50b796e645a5d217fd9d8648ec594241e6f1dd57 Author: Kumar Kartikeya Dwivedi Date: Sat Aug 21 05:49:49 2021 +0530 samples: bpf: Fix a couple of warnings cookie_uid_helper_example.c: In function ‘main’: cookie_uid_helper_example.c:178:69: warning: ‘ -j ACCEPT’ directive writing 10 bytes into a region of size between 8 and 58 [-Wformat-overflow=] 178 | sprintf(rules, "iptables -A OUTPUT -m bpf --object-pinned %s -j ACCEPT", | ^~~~~~~~~~ /home/kkd/src/linux/samples/bpf/cookie_uid_helper_example.c:178:9: note: ‘sprintf’ output between 53 and 103 bytes into a destination of size 100 178 | sprintf(rules, "iptables -A OUTPUT -m bpf --object-pinned %s -j ACCEPT", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 179 | file); | ~~~~~ Fix by using snprintf and a sufficiently sized buffer. tracex4_user.c:35:15: warning: ‘write’ reading 12 bytes from a region of size 11 [-Wstringop-overread] 35 | key = write(1, "\e[1;1H\e[2J", 12); /* clear screen */ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use size as 11. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210821002010.845777-2-memxor@gmail.com commit d7af7e497f0308bc97809cc48b58e8e0f13887e1 Author: Andrey Ignatov Date: Fri Aug 20 09:39:35 2021 -0700 bpf: Fix possible out of bound write in narrow load handling Fix a verifier bug found by smatch static checker in [0]. This problem has never been seen in prod to my best knowledge. Fixing it still seems to be a good idea since it's hard to say for sure whether it's possible or not to have a scenario where a combination of convert_ctx_access() and a narrow load would lead to an out of bound write. When narrow load is handled, one or two new instructions are added to insn_buf array, but before it was only checked that cnt >= ARRAY_SIZE(insn_buf) And it's safe to add a new instruction to insn_buf[cnt++] only once. The second try will lead to out of bound write. And this is what can happen if `shift` is set. Fix it by making sure that if the BPF_RSH instruction has to be added in addition to BPF_AND then there is enough space for two more instructions in insn_buf. The full report [0] is below: kernel/bpf/verifier.c:12304 convert_ctx_accesses() warn: offset 'cnt' incremented past end of array kernel/bpf/verifier.c:12311 convert_ctx_accesses() warn: offset 'cnt' incremented past end of array kernel/bpf/verifier.c 12282 12283 insn->off = off & ~(size_default - 1); 12284 insn->code = BPF_LDX | BPF_MEM | size_code; 12285 } 12286 12287 target_size = 0; 12288 cnt = convert_ctx_access(type, insn, insn_buf, env->prog, 12289 &target_size); 12290 if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf) || ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Bounds check. 12291 (ctx_field_size && !target_size)) { 12292 verbose(env, "bpf verifier is misconfigured\n"); 12293 return -EINVAL; 12294 } 12295 12296 if (is_narrower_load && size < target_size) { 12297 u8 shift = bpf_ctx_narrow_access_offset( 12298 off, size, size_default) * 8; 12299 if (ctx_field_size <= 4) { 12300 if (shift) 12301 insn_buf[cnt++] = BPF_ALU32_IMM(BPF_RSH, ^^^^^ increment beyond end of array 12302 insn->dst_reg, 12303 shift); --> 12304 insn_buf[cnt++] = BPF_ALU32_IMM(BPF_AND, insn->dst_reg, ^^^^^ out of bounds write 12305 (1 << size * 8) - 1); 12306 } else { 12307 if (shift) 12308 insn_buf[cnt++] = BPF_ALU64_IMM(BPF_RSH, 12309 insn->dst_reg, 12310 shift); 12311 insn_buf[cnt++] = BPF_ALU64_IMM(BPF_AND, insn->dst_reg, ^^^^^^^^^^^^^^^ Same. 12312 (1ULL << size * 8) - 1); 12313 } 12314 } 12315 12316 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); 12317 if (!new_prog) 12318 return -ENOMEM; 12319 12320 delta += cnt - 1; 12321 12322 /* keep walking new program and skip insns we just inserted */ 12323 env->prog = new_prog; 12324 insn = new_prog->insnsi + i + delta; 12325 } 12326 12327 return 0; 12328 } [0] https://lore.kernel.org/bpf/20210817050843.GA21456@kili/ v1->v2: - clarify that problem was only seen by static checker but not in prod; Fixes: 46f53a65d2de ("bpf: Allow narrow loads with offset > 0") Reported-by: Dan Carpenter Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210820163935.1902398-1-rdna@fb.com commit 32b2397c1e56f33b0b1881def965bb89bd12f448 Author: sumiyawang Date: Sun Aug 22 19:49:09 2021 +0800 libnvdimm/pmem: Fix crash triggered when I/O in-flight during unbind There is a use after free crash when the pmem driver tears down its mapping while I/O is still inbound. This is triggered by driver unbind, "ndctl destroy-namespace", while I/O is in flight. Fix the sequence of blk_cleanup_queue() vs memunmap(). The crash signature is of the form: BUG: unable to handle page fault for address: ffffc90080200000 CPU: 36 PID: 9606 Comm: systemd-udevd Call Trace: ? pmem_do_bvec+0xf9/0x3a0 ? xas_alloc+0x55/0xd0 pmem_rw_page+0x4b/0x80 bdev_read_page+0x86/0xb0 do_mpage_readpage+0x5d4/0x7a0 ? lru_cache_add+0xe/0x10 mpage_readpages+0xf9/0x1c0 ? bd_link_disk_holder+0x1a0/0x1a0 blkdev_readpages+0x1d/0x20 read_pages+0x67/0x1a0 ndctl Call Trace in vmcore: PID: 23473 TASK: ffff88c4fbbe8000 CPU: 1 COMMAND: "ndctl" __schedule schedule blk_mq_freeze_queue_wait blk_freeze_queue blk_cleanup_queue pmem_release_queue devm_action_release release_nodes devres_release_all device_release_driver_internal device_driver_detach unbind_store Cc: Signed-off-by: sumiyawang Reviewed-by: yongduan Link: https://lore.kernel.org/r/1629632949-14749-1-git-send-email-sumiyawang@tencent.com Fixes: 50f44ee7248a ("mm/devm_memremap_pages: fix final page put race") Signed-off-by: Dan Williams commit a79a9c765f95a73e087f11f0994297cd69987bda Author: Vineet Gupta Date: Mon Sep 16 10:54:34 2019 -0700 ARC: mm: move MMU specific bits out of entry code ... ... to avoid polluting shared entry code (across three ISA variants) with ISA/MMU specific code. Cc: Jose Abreu Signed-off-by: Vineet Gupta commit 89d0d42412a116563c28c763d9c1bdee83b5b6af Author: Vineet Gupta Date: Fri Sep 13 15:20:01 2019 -0700 ARC: mm: move MMU specific bits out of ASID allocator And while at it, rewrite commentary on ASID allocator Signed-off-by: Vineet Gupta commit be43b096ed787bad9e1a74f79486159c6cd6e648 Author: Vineet Gupta Date: Wed Sep 30 18:58:16 2020 -0700 ARC: mm: non-functional code movement/cleanup Signed-off-by: Vineet Gupta commit e93e59ac1e699d07a2bfd0bb03f36b0d2f931834 Author: Vineet Gupta Date: Wed Oct 30 16:54:32 2019 -0700 ARC: mm: pmd_populate* to use the canonical set_pmd (and drop pmd_set) Signed-off-by: Vineet Gupta commit da773cf20eb3745e18be995e00be0d57aa862564 Author: Vineet Gupta Date: Thu Sep 12 12:01:04 2019 -0700 ARC: ioremap: use more commonly used PAGE_KERNEL based uncached flag and remove the one off uncached definition for ARC Signed-off-by: Vineet Gupta commit 1b4013b9aebca87636dc9edc8903ffa87267704f Author: Vineet Gupta Date: Mon Oct 28 13:49:41 2019 -0700 ARC: mm: Enable STRICT_MM_TYPECHECKS In the past I've refrained from doing this (at least 2 times) due to the slight code bloat due to ABI implications of pte_t etc becoming struct Per ARC ABI, functions return struct via memory and not through register r0, even if the struct would fit in register(s) - caller allocates space on stack and passes the address as first arg (r0), shifting rest of args by one - callee creates return struct in memory (referenced via r0) This time around the code actually shrunk slightly (due to subtle inlining heuristic effects), but still slightly inefficient due to return values passed through memory. That however seems like a small cost compared to maintenance burden given the impending new mmu support for page walk etc Signed-off-by: Vineet Gupta commit 366440eec855dad6527adaf2f1dcc305fb5eef99 Author: Vineet Gupta Date: Mon Oct 28 12:02:47 2019 -0700 ARC: mm: Fixes to allow STRICT_MM_TYPECHECKS Signed-off-by: Vineet Gupta commit 47910ca3ce946662f950d700f26e51c563a9821f Author: Vineet Gupta Date: Fri Sep 13 13:19:44 2019 -0700 ARC: mm: move mmu/cache externs out to setup.h Don't pollute mmu.h and cache.h with ARC internal bootlog/setup related functions. Move them aside to setup.h Signed-off-by: Vineet Gupta commit 12e7804c264143c63d1cae7e3a62d21fbed06f59 Author: Vineet Gupta Date: Mon Sep 9 16:59:59 2019 -0700 ARC: mm: remove tlb paranoid code This was used back in arc700 days when ASID allocator was fragile. Not needed in last 5 years Signed-off-by: Vineet Gupta commit 6128df5be48f48d63efdc7c52022dd163f612373 Author: Vineet Gupta Date: Mon Jan 13 09:16:06 2020 -0800 ARC: mm: use SCRATCH_DATA0 register for caching pgdir in ARCv2 only MMU SCRATCH_DATA0 register is intended to cache task pgd. However in ARC700 SMP port, it has to be repurposed for re-entrant interrupt handling, while UP port doesn't. We currently handle these use-cases using a fabricated #define which has usual issues of dependency nesting and obvious ugliness. So clean this up: for ARC700 don't use to cache pgd (even in UP) and do the opposite for ARCv2. And while here, switch to canonical pgd_offset(). Acked-by: Mike Rapoport Signed-off-by: Vineet Gupta commit 288ff7de62af0936353c9394de9d0b2c6dd22c80 Author: Vineet Gupta Date: Mon Sep 9 17:36:34 2019 -0700 ARC: retire MMUv1 and MMUv2 support There's no known/active customer using them with latest kernels anyways. Removal helps cleanup code and remove the hack for MMU_VER to MMU_V[3-4] conversion Signed-off-by: Vineet Gupta commit 767a697e75769fdae092a15d92bf562d5631a490 Author: Vineet Gupta Date: Thu Aug 5 23:38:44 2021 -0700 ARC: retire ARC750 support There's no known/active customer using them with latest kernels anyways. Signed-off-by: Vineet Gupta commit 301014cf6d72836dd5fd5b3e9c92633f35b298c0 Author: Vineet Gupta Date: Mon May 11 13:27:23 2020 -0700 ARC: atomic_cmpxchg/atomic_xchg: implement relaxed variants And move them out of cmpxchg.h to canonical atomic.h Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit ddc348c44d82d0b55236210d5606ac868e6cc364 Author: Vineet Gupta Date: Sat May 9 00:15:36 2020 -0700 ARC: cmpxchg/xchg: implement relaxed variants (LLSC config only) It only makes sense to do this for the LLSC config Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit e188f3330a13df904d77003846eafd3edf99009d Author: Vineet Gupta Date: Wed May 6 15:13:25 2020 -0700 ARC: cmpxchg/xchg: rewrite as macros to make type safe Existing code forces/assume args to type "long" which won't work in LP64 regime, so prepare code for that Interestingly this should be a non functional change but I do see some codegen changes | bloat-o-meter vmlinux-cmpxchg-A vmlinux-cmpxchg-B | add/remove: 0/0 grow/shrink: 17/12 up/down: 218/-150 (68) | | Function old new delta | rwsem_optimistic_spin 518 550 +32 | rwsem_down_write_slowpath 1244 1274 +30 | __do_sys_perf_event_open 2576 2600 +24 | down_read 192 200 +8 | __down_read 192 200 +8 ... | task_work_run 168 148 -20 | dma_fence_chain_walk.part 760 736 -24 | __genradix_ptr_alloc 674 646 -28 Total: Before=6187409, After=6187477, chg +0.00% Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit ecf51c9fa0960fd25cd66f2280fb1980b0d2e300 Author: Vineet Gupta Date: Wed May 6 14:41:12 2020 -0700 ARC: xchg: !LLSC: remove UP micro-optimization/hack It gets in the way of cleaning things up and is a maintenance pain-in-neck ! Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit 9d011e12075dc51fb57f8203a08cc5229fbcb2ef Author: Vineet Gupta Date: Tue May 5 13:54:24 2020 -0700 ARC: bitops: fls/ffs to take int (vs long) per asm-generic defines Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit cea43147905f1c2b7b48104a5304cf5229f45bec Author: Vineet Gupta Date: Tue Sep 4 16:11:29 2018 -0700 ARC: switch to generic bitops - !LLSC now only needs a single spinlock for atomics and bitops - Some codegen changes (slight bloat) with generic bitops 1. code increase due to LD-check-atomic paradigm vs. unconditonal atomic (but dirty'ing the cache line even if set already). So despite increase, generic is right thing to do. 2. code decrease (but use of costlier instructions such as DIV vs. shifts based math) due to signed arithmetic. This needs to be revisited seperately. arc: static inline int test_bit(unsigned int nr, const volatile unsigned long *addr) ^^^^^^^^^^^^ generic: static inline int test_bit(int nr, const volatile unsigned long *addr) ^^^ Link: https://lore.kernel.org/r/20180830135749.GA13005@arm.com Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) [vgupta: wrote patch based on Will's poc, analysed codegen diffs] Signed-off-by: Vineet Gupta commit b64be6836993c431e54fad239fcba0543854ee35 Author: Vineet Gupta Date: Mon Apr 13 18:07:49 2020 -0700 ARC: atomics: implement relaxed variants The current ARC fetch/return atomics provide fully ordered semantics only with 2 full barriers around the operation. Instead implement them as relaxed variants without any barriers and rely on generic code to generate the fully-ordered, acquire and release varaints by adding the appropriate full barriers. This helps elide some extra barriers in case of acquire/release/relaxed calls. bloat-o-meter for hsdk defconfig shows codegen improvements, although numbers below inflated due to unrelated inlining heuristic changes | bloat-o-meter vmlinux-643babe34fd7-non-relaxed vmlinux-45aa05cb44d7-relaxed | add/remove: 2/5 grow/shrink: 42/1222 up/down: 4158/-14312 (-10154) | Function old new delta | .. | sys_renameat 462 476 +14 | ip_mc_inc_group 424 436 +12 | do_read_cache_page 1882 1894 +12 | .. | refcount_dec_and_mutex_lock 254 250 -4 | refcount_dec_and_lock_irqsave 258 254 -4 | refcount_dec_and_lock 254 250 -4 | .. | tcp_v6_route_req 246 238 -8 | tcp_v4_destroy_sock 286 278 -8 | tcp_twsk_unique 352 344 -8 Link: https://lore.kernel.org/r/20180830144344.GW24142@hirez.programming.kicks-ass.net Suggested-by: Peter Zijlstra (Intel) Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit 7e8f8cbb43990861e5881594e14d491f81931f8d Author: Vineet Gupta Date: Mon Apr 13 17:41:24 2020 -0700 ARC: atomic64: LLSC: elide unused atomic_{and,or,xor,andnot}_return This is a non-functional change since those wrappers are not used in kernel sources at all. Link: http://lists.infradead.org/pipermail/linux-snps-arc/2018-August/004246.html Suggested-by: Peter Zijlstra (Intel) Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit ca766f04ad1dc4527e3e388fe3736e6b1bf0e6b2 Author: Vineet Gupta Date: Tue May 5 22:59:57 2020 -0700 ARC: atomic: !LLSC: use int data type consistently Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit b1040148b2ea4ecbdb60c0d20393f4d15eee13ac Author: Vineet Gupta Date: Tue Jan 21 09:56:33 2020 -0800 ARC: atomic: !LLSC: remove hack in atomic_set() for for UP !LLSC atomics use spinlock (SMP) or irq-disable (UP) to implement criticla regions. UP atomic_set() however was "cheating" by not doing any of that so and still being functional. Remove this anomaly (primarily as cleanup for future code improvements) given that this config is not worth hassle of special case code. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit b0f839b4b91588c24bac8d320f7fc9fe2dea4517 Author: Vineet Gupta Date: Tue Aug 3 20:26:09 2021 -0700 ARC: atomics: disintegrate header Non functional change, to ease future addition/removal Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta commit 6b5ff0405e4190f23780362ea324b250bc495683 Author: Randy Dunlap Date: Mon Aug 16 14:05:33 2021 -0700 ARC: export clear_user_page() for modules 0day bot reports a build error: ERROR: modpost: "clear_user_page" [drivers/media/v4l2-core/videobuf-dma-sg.ko] undefined! so export it in arch/arc/ to fix the build error. In most ARCHes, clear_user_page() is a macro. OTOH, in a few ARCHes it is a function and needs to be exported. PowerPC exported it in 2004. It looks like nds32 and nios2 still need to have it exported. Fixes: 4102b53392d63 ("ARC: [mm] Aliasing VIPT dcache support 2/4") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Guenter Roeck Cc: linux-snps-arc@lists.infradead.org Signed-off-by: Vineet Gupta commit 82a423053eb3cf27209c78ce1852ea18d173722a Author: Changcheng Deng Date: Sat Aug 14 00:30:38 2021 +0800 arch/arc/kernel/: fix misspellings using codespell tool Some typos are found out by codespell tool: ./intc-compact.c:145: prioity ==> priority ./smp.c:286: recevier ==> receiver ./stacktrace.c:152 prelogue ==> prologue Fix typos found by codespell. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Yi Wang Signed-off-by: Vineet Gupta commit f63693e3ae1bdb5dd8ba2bcd4d9dcb5bc28d9111 Merge: 8c0bb89e8e4dd 6cbca1ee0d74e Author: Alexei Starovoitov Date: Tue Aug 24 14:17:53 2021 -0700 Merge branch 'bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_SK_MSG' Xu Liu says: ==================== We'd like to be able to identify netns from sk_msg hooks to accelerate local process communication form different netns. ==================== Signed-off-by: Alexei Starovoitov commit 6cbca1ee0d74ea14d7b6cff16745b66b8f0fda5c Author: Xu Liu Date: Fri Aug 20 15:17:12 2021 +0800 selftests/bpf: Test for get_netns_cookie Add test to use get_netns_cookie() from BPF_PROG_TYPE_SK_MSG. Signed-off-by: Xu Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210820071712.52852-3-liuxu623@gmail.com commit fab60e29fcc6d60396da20d63d45fd0d305ba4e4 Author: Xu Liu Date: Fri Aug 20 15:17:11 2021 +0800 bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_SK_MSG We'd like to be able to identify netns from sk_msg hooks to accelerate local process communication form different netns. Signed-off-by: Xu Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210820071712.52852-2-liuxu623@gmail.com commit 8c0bb89e8e4ddc3519b1a2cf1d503f6b3d1cd38a Merge: a6258837c8a81 00e1116031e15 Author: Alexei Starovoitov Date: Tue Aug 24 14:01:11 2021 -0700 Merge branch 'selftests/bpf: minor fixups' Li Zhijian says: ==================== Fix a few issues reported by 0Day/LKP during runing selftests/bpf. Changelog: V2: - folded previous similar standalone patch to [1/5], and add acked tag from Song Liu - add acked tag to [2/5], [3/5] from Song Liu - [4/5]: move test_bpftool.py to TEST_PROGS_EXTENDED, files in TEST_GEN_PROGS_EXTENDED are generated by make. Otherwise, it will break out-of-tree install: 'make O=/kselftest-build SKIP_TARGETS= V=1 -C tools/testing/selftests install INSTALL_PATH=/kselftest-install' - [5/5]: new patch ==================== Signed-off-by: Alexei Starovoitov commit 00e1116031e154098c55441e4936b32e4b20b31c Author: Li Zhijian Date: Fri Aug 20 10:55:49 2021 +0800 selftests/bpf: Exit with KSFT_SKIP if no Makefile found This would happend when we run the tests after install kselftests root@lkp-skl-d01 ~# /kselftests/run_kselftest.sh -t bpf:test_doc_build.sh TAP version 13 1..1 # selftests: bpf: test_doc_build.sh perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_ADDRESS = "en_US.UTF-8", LC_NAME = "en_US.UTF-8", LC_MONETARY = "en_US.UTF-8", LC_PAPER = "en_US.UTF-8", LC_IDENTIFICATION = "en_US.UTF-8", LC_TELEPHONE = "en_US.UTF-8", LC_MEASUREMENT = "en_US.UTF-8", LC_TIME = "en_US.UTF-8", LC_NUMERIC = "en_US.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). # skip: bpftool files not found! # ok 1 selftests: bpf: test_doc_build.sh # SKIP Signed-off-by: Li Zhijian Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210820025549.28325-1-lizhijian@cn.fujitsu.com commit 404bd9ff5d7ccb938ab033f6971c6ee2b8384387 Author: Li Zhijian Date: Fri Aug 20 09:55:56 2021 +0800 selftests/bpf: Add missing files required by test_bpftool.sh for installing test_bpftool.sh relies on bpftool and test_bpftool.py. 'make install' will install bpftool to INSTALL_PATH/bpf/bpftool, and export it to PATH so that it can be used after installing. Signed-off-by: Li Zhijian Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210820015556.23276-5-lizhijian@cn.fujitsu.com commit 7a3bdca20b10fb93a34aca22e19c4b27c5602edb Author: Li Zhijian Date: Fri Aug 20 09:55:55 2021 +0800 selftests/bpf: Add default bpftool built by selftests to PATH For 'make run_tests': selftests will build bpftool into tools/testing/selftests/bpf/tools/sbin/bpftool by default. ================== root@lkp-skl-d01 /opt/rootfs/v5.14-rc4# make -C tools/testing/selftests/bpf run_tests make: Entering directory '/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf' MKDIR include MKDIR libbpf MKDIR bpftool [...] GEN /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/profiler.skel.h CC /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/prog.o GEN /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/pid_iter.skel.h CC /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/pids.o LINK /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/bpftool INSTALL bpftool GEN vmlinux.h [...] # test_feature_dev_json (test_bpftool.TestBpftool) ... ERROR # test_feature_kernel (test_bpftool.TestBpftool) ... ERROR # test_feature_kernel_full (test_bpftool.TestBpftool) ... ERROR # test_feature_kernel_full_vs_not_full (test_bpftool.TestBpftool) ... ERROR # test_feature_macros (test_bpftool.TestBpftool) ... Error: bug: failed to retrieve CAP_BPF status: Invalid argument # ERROR # # ====================================================================== # ERROR: test_feature_dev_json (test_bpftool.TestBpftool) # ---------------------------------------------------------------------- # Traceback (most recent call last): # File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 57, in wrapper # return f(*args, iface, **kwargs) # File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 82, in test_feature_dev_json # res = bpftool_json(["feature", "probe", "dev", iface]) # File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 42, in bpftool_json # res = _bpftool(args) # File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 34, in _bpftool # return subprocess.check_output(_args) # File "/usr/lib/python3.7/subprocess.py", line 395, in check_output # **kwargs).stdout # File "/usr/lib/python3.7/subprocess.py", line 487, in run # output=stdout, stderr=stderr) # subprocess.CalledProcessError: Command '['bpftool', '-j', 'feature', 'probe', 'dev', 'dummy0']' returned non-zero exit status 255. # ================== Signed-off-by: Li Zhijian Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210820015556.23276-4-lizhijian@cn.fujitsu.com commit 5a980b5baf3942653d30c451416ca485ec09577f Author: Li Zhijian Date: Fri Aug 20 09:55:54 2021 +0800 selftests/bpf: Make test_doc_build.sh work from script directory Previously, it fails as below: ------------- root@lkp-skl-d01 /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf# ./test_doc_build.sh ++ realpath --relative-to=/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf ./test_doc_build.sh + SCRIPT_REL_PATH=test_doc_build.sh ++ dirname test_doc_build.sh + SCRIPT_REL_DIR=. ++ realpath /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/./../../../../ + KDIR_ROOT_DIR=/opt/rootfs/v5.14-rc4 + cd /opt/rootfs/v5.14-rc4 + for tgt in docs docs-clean + make -s -C /opt/rootfs/v5.14-rc4/. docs make: *** No rule to make target 'docs'. Stop. + for tgt in docs docs-clean + make -s -C /opt/rootfs/v5.14-rc4/. docs-clean make: *** No rule to make target 'docs-clean'. Stop. ----------- Reported-by: kernel test robot Signed-off-by: Li Zhijian Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210820015556.23276-3-lizhijian@cn.fujitsu.com commit 2d82d73da35b72b53fe0d96350a2b8d929d07e42 Author: Li Zhijian Date: Fri Aug 20 09:55:53 2021 +0800 selftests/bpf: Enlarge select() timeout for test_maps 0Day robot observed that it's easily timeout on a heavy load host. ------------------- # selftests: bpf: test_maps # Fork 1024 tasks to 'test_update_delete' # Fork 1024 tasks to 'test_update_delete' # Fork 100 tasks to 'test_hashmap' # Fork 100 tasks to 'test_hashmap_percpu' # Fork 100 tasks to 'test_hashmap_sizes' # Fork 100 tasks to 'test_hashmap_walk' # Fork 100 tasks to 'test_arraymap' # Fork 100 tasks to 'test_arraymap_percpu' # Failed sockmap unexpected timeout not ok 3 selftests: bpf: test_maps # exit=1 # selftests: bpf: test_lru_map # nr_cpus:8 ------------------- Since this test will be scheduled by 0Day to a random host that could have only a few cpus(2-8), enlarge the timeout to avoid a false NG report. In practice, i tried to pin it to only one cpu by 'taskset 0x01 ./test_maps', and knew 10S is likely enough, but i still perfer to a larger value 30. Reported-by: kernel test robot Signed-off-by: Li Zhijian Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210820015556.23276-2-lizhijian@cn.fujitsu.com commit ea4ab99cb58cc9f8d64c0961ff9a059825f304cf Author: Matija Glavinic Pecotic Date: Tue Aug 24 11:25:56 2021 +0200 spi: davinci: invoke chipselect callback Davinci needs to configure chipselect on transfer. Fixes: 4a07b8bcd503 ("spi: bitbang: Make chipselect callback optional") Signed-off-by: Matija Glavinic Pecotic Reviewed-by: Alexander Sverdlin Link: https://lore.kernel.org/r/735fb7b0-82aa-5b9b-85e4-53f0c348cc0e@nokia.com Signed-off-by: Mark Brown commit 2f617f4df8dfef68f175160d533f5820a368023e Author: Philip Yang Date: Wed Aug 18 09:34:53 2021 -0400 drm/amdkfd: map SVM range with correct access permission Restore retry fault or prefetch range, or restore svm range after eviction to map range to GPU with correct read or write access permission. Range may includes multiple VMAs, update GPU page table with offset of prange, number of pages for each VMA according VMA access permission. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit bf608ebc364e204ced4fc09c0e0a4c33fe671344 Author: Hu Haowen Date: Sat Aug 21 17:40:59 2021 +0800 docs/zh_TW: add translations for zh_TW/filesystems Create new translations for zh_TW/filesystems and link them to index. Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20210821094059.64300-3-src.res@email.cn Signed-off-by: Jonathan Corbet commit ac8fa1bdc02671ff9c3e548878e68886b3f5daee Author: Hu Haowen Date: Sat Aug 21 17:40:58 2021 +0800 docs/zh_TW: add translations for zh_TW/cpu-freq Create new translations for zh_TW/cpu-freq and link them to index. Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20210821094059.64300-2-src.res@email.cn Signed-off-by: Jonathan Corbet commit e5cb9494fe799f7358554d5b66568ac16e305499 Author: Hu Haowen Date: Sat Aug 21 17:40:57 2021 +0800 docs/zh_TW: add translations for zh_TW/arm64 Create new translations for zh_TW/arm64 and link them to index. Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20210821094059.64300-1-src.res@email.cn Signed-off-by: Jonathan Corbet commit ff891a2e6431f79c239ab0c5bc05834c0235821c Author: Philip Yang Date: Sun Aug 15 14:42:33 2021 -0400 drm/amdkfd: check access permisson to restore retry fault Check range access permission to restore GPU retry fault, if GPU retry fault on address which belongs to VMA, and VMA has no read or write permission requested by GPU, failed to restore the address. The vm fault event will pass back to user space. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f24d991bb9641d9467d2a0096239c58bf3d2b388 Author: John Clements Date: Tue Aug 24 14:56:53 2021 +0800 drm/amdgpu: Update RAS XGMI Error Query Resolve bug querying error on unsupported ASIC Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 3907c492184e13a5d8d336963a6ec1f6ebe0064d Author: John Clements Date: Tue Aug 24 13:24:25 2021 +0800 drm/amdgpu: Add driver infrastructure for MCA RAS Add MCA specific IP blocks targetting RAS features Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 3341d30d1cc7c37ca5fd49b7f9b0f3cce66c727e Author: Praful Swarnakar Date: Thu Aug 19 21:31:37 2021 +0530 drm/amd/display: Add Logging for HDMI color depth information [Why] Recent HDMI2.0 HF1-1 V-Swing testing showed that logging deep color status helps in validation of testcase. [How] Add logging based on various color depths and pixel encoding formats. Signed-off-by: Praful Swarnakar Reviewed-by: Hersen Wu Signed-off-by: Alex Deucher commit 30acef3c4ad1a9112c851cd3c75704fc665174da Author: Candice Li Date: Wed Aug 18 19:33:27 2021 +0800 drm/amd/amdgpu: consolidate PSP TA init shared buf functions Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 355e3e4ccc2cd4b29cc37546474448a8f02e3bbc Author: Candice Li Date: Mon Aug 23 15:17:35 2021 +0800 drm/amd/amdgpu: add name field back to ras_common_if Adding name field back to ras_common_if to work around error injection failure with amdgpuras tool. Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit a47f6a5806da4f24fbb66148a1519bf72fe060db Author: Borislav Petkov Date: Tue Aug 24 11:42:47 2021 +0200 drm/amdgpu: Fix build with missing pm_suspend_target_state module export Building a randconfig here triggered: ERROR: modpost: "pm_suspend_target_state" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! because the module export of that symbol happens in kernel/power/suspend.c which is enabled with CONFIG_SUSPEND. The ifdef guards in amdgpu_acpi_is_s0ix_supported(), however, test for CONFIG_PM_SLEEP which is defined like this: config PM_SLEEP def_bool y depends on SUSPEND || HIBERNATE_CALLBACKS and that randconfig has: # CONFIG_SUSPEND is not set CONFIG_HIBERNATE_CALLBACKS=y leading to the module export missing. Change the ifdeffery to depend directly on CONFIG_SUSPEND. Fixes: 5706cb3c910c ("drm/amdgpu: fix checking pmops when PM_SLEEP is not enabled") Reviewed-by: Lijo Lazar Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/YSP6Lv53QV0cOAsd@zn.tnic Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit a5f61dd41273d75c63f226ab66d2e69dfe4dd045 Author: Christophe JAILLET Date: Sun Aug 22 23:23:25 2021 +0200 drm/radeon: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Reviewed-by: Christian König Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit 8a1d1bdb845affbb2a9887826e5e991e290bde56 Author: Christophe JAILLET Date: Sun Aug 22 23:21:43 2021 +0200 drm/amdgpu: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Reviewed-by: Christian König Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit f270921a17b94ae7c1acfc8cead4108c03e6550f Author: Mukul Joshi Date: Thu Aug 19 13:18:04 2021 -0400 drm/amdkfd: CWSR with sw scheduler on Aldebaran and Arcturus Program trap handler settings to enable CWSR with software scheduler on Aldebaran and Arcturus. Signed-off-by: Mukul Joshi Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 7301757ea1fbead24f7c5687f828940a698a95db Author: Shashank Sharma Date: Fri Aug 20 10:20:02 2021 +0530 drm/amdgpu/OLAND: clip the ref divider max value This patch limits the ref_div_max value to 100, during the calculation of PLL feedback reference divider. With current value (128), the produced fb_ref_div value generates unstable output at particular frequencies. Radeon driver limits this value at 100. On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I know), it demands a clock of 221270 Khz. It's been observed that the PLL calculations using values 128 and 100 are vastly different, and look like this: +------------------------------------------+ |Parameter |AMDGPU |Radeon | | | | | +-------------+----------------------------+ |Clock feedback | | |divider max | 128 | 100 | |cap value | | | | | | | | | | | +------------------------------------------+ |ref_div_max | | | | | 42 | 20 | | | | | | | | | +------------------------------------------+ |ref_div | 42 | 20 | | | | | +------------------------------------------+ |fb_div | 10326 | 8195 | +------------------------------------------+ |fb_div | 1024 | 163 | +------------------------------------------+ |fb_dev_p | 4 | 9 | |frac fb_de^_p| | | +----------------------------+-------------+ With ref_div_max value clipped at 100, AMDGPU driver can also drive videmode 2048x1280@60 (221Mhz) and produce proper output without any blanking and distortion on the screen. PS: This value was changed from 128 to 100 in Radeon driver also, here: https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 V1: Got acks from: Acked-by: Alex Deucher Acked-by: Christian König V2: - Restricting the changes only for OLAND, just to avoid any regression for other cards. - Changed unsigned -> unsigned int to make checkpatch quiet. V3: Apply the change on SI family (not only oland) (Christian) Cc: Alex Deucher Cc: Christian König Cc: Eddy Qin Reviewed-by: Christian König Signed-off-by: Shashank Sharma Signed-off-by: Alex Deucher commit 234b4fd9176c60480190ef4f75cc1b920df58329 Author: Eric Yang Date: Fri Jul 9 17:47:39 2021 -0400 drm/amd/display: refactor riommu invalidation wa [Why] A cleaner solution, only done once on boot. [How] Remove previous workaround and configure an extra vmid one time on boot Reviewed-by: Kazlauskas Nicholas Acked-by: Solomon Chiu Signed-off-by: Eric Yang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8137a49e1567726eb10fcf55ad141ac19804ca6b Author: Yanteng Si Date: Sat Aug 21 16:18:00 2021 +0800 docs/zh_CN: Modify the translator tag and fix the wrong word Fix a wrong word; Fix old Original tag; Remove unnecessary blank lines; Modify the translator tag to be consistent with the current. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20210821081800.2205103-1-siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit d4477209c8fbc1bb0035ca44426e02238f68c5fd Author: Mark Rutland Date: Tue Aug 17 10:16:21 2021 +0100 Documentation/features/vm: correct huge-vmap APIs In commit: bbc180a5adb05ee8 ("mm: HUGE_VMAP arch support cleanup") We replaced: * ioremap_pud_enabled() with arch_vmap_pud_supported() * ioremap_pmd_enabled() with arch_vmap_pmd_supported() Update the documentation accordingly. Signed-off-by: Mark Rutland Cc: Andrew Morton Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Nicholas Piggin Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/20210817091621.16799-1-mark.rutland@arm.com Signed-off-by: Jonathan Corbet commit c19430eec84f7440651266e5f5a811df3d6f46ae Author: Jinay Jain Date: Thu Aug 12 08:25:28 2021 -0700 Documentation: block: blk-mq: Fix small typo in multi-queue docs Fixed a small typo in the documentation for multi-queue block IO. Signed-off-by: Jinay Jain Link: https://lore.kernel.org/r/20210812152528.300668-1-jinaybjain@gmail.com Signed-off-by: Jonathan Corbet commit fe450eeb4e6f1c19d088c99d2206ecabb8d0892b Author: Changbin Du Date: Sat Aug 14 09:48:31 2021 +0800 Documentation: in_irq() cleanup Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20210814014831.53083-1-changbin.du@gmail.com Signed-off-by: Jonathan Corbet commit f08fe9d29366c0204c3d571fa0088b1f0efd1a17 Author: Pali Rohár Date: Sat Aug 14 14:48:05 2021 +0200 Documentation: arm: marvell: Add 88F6825 model into list 88F6825 is just 88F6820 but without encryption acceleration hardware and is used e.g. in DTS file arch/arm/boot/dts/armada-385-clearfog-gtr.dtsi Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210814124805.14568-1-pali@kernel.org Signed-off-by: Jonathan Corbet commit 59c6a716b14ba3092ea685b6274d5233c18cc194 Author: SeongJae Park Date: Thu Aug 12 09:50:30 2021 +0000 Documentation/process/maintainer-pgp-guide: Replace broken link to PGP path finder PGP pathfinder[1], which is suggested for finding a trust path to unknown PGP keys by 'maintainer-pgp-guide.rst', is not working now. This commit replaces it with other available tools. [1] https://pgp.cs.uu.nl/ Signed-off-by: SeongJae Park Reviewed-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20210812095030.4704-2-sj38.park@gmail.com Signed-off-by: Jonathan Corbet commit 8c7a729d09644dafbb90207c35cab495d3a33175 Author: Alexander Aring Date: Mon Aug 23 14:31:43 2021 -0400 Documentation: locking: fix references This patch fixes file references from txt to rst file ending in ww-mutex-design.rst and futex-requeue-pi.rst. While on it fix a spelling issue "desgin" to "design" reported by Matthew Wilcox. Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20210823183143.1691344-1-aahringo@redhat.com Signed-off-by: Jonathan Corbet commit a6e6d722957273afebf26b9a36b90acfc27dca8a Author: Dan Williams Date: Tue Aug 24 09:06:07 2021 -0700 libnvdimm/labels: Add claim class helpers In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. CXL labels do have the concept of a claim class represented by an "abstraction" identifier. It turns out both label implementations use the same ids, but EFI encodes them as GUIDs and CXL labels encode them as UUIDs. For now abstract out the claim class such that the UUID vs GUID distinction can later be hidden in the helper. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982116719.1124374.9917866609080940364.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 8b03aa0e0e5aea61d5a7fc6434faba2a05a6095b Author: Dan Williams Date: Tue Aug 24 09:06:02 2021 -0700 libnvdimm/labels: Add type-guid helpers In preparation for CXL label support, which does not have the type-guid concept, wrap the existing users with nsl_set_type_guid, and nsl_validate_type_guid. Recall that the type-guid is a value in the ACPI NFIT table to indicate how the memory range is used / should be presented to upper layers. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982116208.1124374.13938280892226800953.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit de8fa48b9a281e69f944c58ae2adbd8a277787a6 Author: Dan Williams Date: Tue Aug 24 09:05:57 2021 -0700 libnvdimm/labels: Add blk special cases for nlabel and position helpers In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. Finish off the BLK-mode specific helper conversion with the nlabel and position behaviour that is specific to EFI v1.2 labels and not the original v1.1 definition. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982115698.1124374.10182273478536799613.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit f56541a7122c68ef3074e41c2cb14182eb11d3a5 Author: Dan Williams Date: Tue Aug 24 09:05:51 2021 -0700 libnvdimm/labels: Add blk isetcookie set / validation helpers In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. Given BLK-mode is not even supported on CXL push hide the BLK-mode specific details inside the helpers. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982115185.1124374.13459190993792729776.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 7cd35b2920500908eb3d9d00939f2aea3e8f8361 Author: Dan Williams Date: Tue Aug 24 09:05:46 2021 -0700 libnvdimm/labels: Add a checksum calculation helper In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. CXL labels support checksums by default, but early versions of the EFI labels did not. Add a validate function that can return true in the case the label format does not implement a checksum. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982114637.1124374.6966639787307077105.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 8176f147891258a8eb42bf5579fa344fef34e5bc Author: Dan Williams Date: Tue Aug 24 09:05:41 2021 -0700 libnvdimm/labels: Introduce label setter helpers In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. Reported-by: kernel test robot Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982114123.1124374.17153270107594686116.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 9761b02d40de4b7f9f4947f801b69993817883ee Author: Dan Williams Date: Tue Aug 24 09:05:35 2021 -0700 libnvdimm/labels: Add isetcookie validation helper In preparation to handle CXL labels with the same code that handles EFI labels, add a specific interleave-set-cookie validation helper rather than a getter since the CXL label type does not support this concept. The answer for CXL labels will always be true. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982113550.1124374.206762177785773038.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit b4366a827f6cf6e58c93e076e335d9ee9ee0480f Author: Dan Williams Date: Tue Aug 24 09:05:30 2021 -0700 libnvdimm/labels: Introduce getters for namespace label fields In preparation for LIBNVDIMM to manage labels on CXL devices deploy helpers that abstract the label type from the implementation. The CXL label format is mostly similar to the EFI label format with concepts / fields added, like dynamic region creation and label type guids, and other concepts removed like BLK-mode and interleave-set-cookie ids. In addition to nsl_get_* helpers there is the nsl_ref_name() helper that returns a pointer to a label field rather than copying the data. Where changes touch the old whitespace style, update to clang-format expectations. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162982113002.1124374.15922077050771304490.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit a90ec84837325df4b9a6798c2cc0df202b5680bd Author: Vinicius Costa Gomes Date: Mon Jul 26 20:36:57 2021 -0700 igc: Add support for PTP getcrosststamp() i225 supports PCIe Precision Time Measurement (PTM), allowing us to support the PTP_SYS_OFFSET_PRECISE ioctl() in the driver via the getcrosststamp() function. The easiest way to expose the PTM registers would be to configure the PTM dialogs to run periodically, but the PTP_SYS_OFFSET_PRECISE ioctl() semantics are more aligned to using a kind of "one-shot" way of retrieving the PTM timestamps. But this causes a bit more code to be written: the trigger registers for the PTM dialogs are not cleared automatically. i225 can be configured to send "fake" packets with the PTM information, adding support for handling these types of packets is left for the future. PTM improves the accuracy of time synchronization, for example, using phc2sys, while a simple application is sending packets as fast as possible. First, without .getcrosststamp(): phc2sys[191.382]: enp4s0 sys offset -959 s2 freq -454 delay 4492 phc2sys[191.482]: enp4s0 sys offset 798 s2 freq +1015 delay 4069 phc2sys[191.583]: enp4s0 sys offset 962 s2 freq +1418 delay 3849 phc2sys[191.683]: enp4s0 sys offset 924 s2 freq +1669 delay 3753 phc2sys[191.783]: enp4s0 sys offset 664 s2 freq +1686 delay 3349 phc2sys[191.883]: enp4s0 sys offset 218 s2 freq +1439 delay 2585 phc2sys[191.983]: enp4s0 sys offset 761 s2 freq +2048 delay 3750 phc2sys[192.083]: enp4s0 sys offset 756 s2 freq +2271 delay 4061 phc2sys[192.183]: enp4s0 sys offset 809 s2 freq +2551 delay 4384 phc2sys[192.283]: enp4s0 sys offset -108 s2 freq +1877 delay 2480 phc2sys[192.383]: enp4s0 sys offset -1145 s2 freq +807 delay 4438 phc2sys[192.484]: enp4s0 sys offset 571 s2 freq +2180 delay 3849 phc2sys[192.584]: enp4s0 sys offset 241 s2 freq +2021 delay 3389 phc2sys[192.684]: enp4s0 sys offset 405 s2 freq +2257 delay 3829 phc2sys[192.784]: enp4s0 sys offset 17 s2 freq +1991 delay 3273 phc2sys[192.884]: enp4s0 sys offset 152 s2 freq +2131 delay 3948 phc2sys[192.984]: enp4s0 sys offset -187 s2 freq +1837 delay 3162 phc2sys[193.084]: enp4s0 sys offset -1595 s2 freq +373 delay 4557 phc2sys[193.184]: enp4s0 sys offset 107 s2 freq +1597 delay 3740 phc2sys[193.284]: enp4s0 sys offset 199 s2 freq +1721 delay 4010 phc2sys[193.385]: enp4s0 sys offset -169 s2 freq +1413 delay 3701 phc2sys[193.485]: enp4s0 sys offset -47 s2 freq +1484 delay 3581 phc2sys[193.585]: enp4s0 sys offset -65 s2 freq +1452 delay 3778 phc2sys[193.685]: enp4s0 sys offset 95 s2 freq +1592 delay 3888 phc2sys[193.785]: enp4s0 sys offset 206 s2 freq +1732 delay 4445 phc2sys[193.885]: enp4s0 sys offset -652 s2 freq +936 delay 2521 phc2sys[193.985]: enp4s0 sys offset -203 s2 freq +1189 delay 3391 phc2sys[194.085]: enp4s0 sys offset -376 s2 freq +955 delay 2951 phc2sys[194.185]: enp4s0 sys offset -134 s2 freq +1084 delay 3330 phc2sys[194.285]: enp4s0 sys offset -22 s2 freq +1156 delay 3479 phc2sys[194.386]: enp4s0 sys offset 32 s2 freq +1204 delay 3602 phc2sys[194.486]: enp4s0 sys offset 122 s2 freq +1303 delay 3731 Statistics for this run (total of 2179 lines), in nanoseconds: average: -1.12 stdev: 634.80 max: 1551 min: -2215 With .getcrosststamp() via PCIe PTM: phc2sys[367.859]: enp4s0 sys offset 6 s2 freq +1727 delay 0 phc2sys[367.959]: enp4s0 sys offset -2 s2 freq +1721 delay 0 phc2sys[368.059]: enp4s0 sys offset 5 s2 freq +1727 delay 0 phc2sys[368.160]: enp4s0 sys offset -1 s2 freq +1723 delay 0 phc2sys[368.260]: enp4s0 sys offset -4 s2 freq +1719 delay 0 phc2sys[368.360]: enp4s0 sys offset -5 s2 freq +1717 delay 0 phc2sys[368.460]: enp4s0 sys offset 1 s2 freq +1722 delay 0 phc2sys[368.560]: enp4s0 sys offset -3 s2 freq +1718 delay 0 phc2sys[368.660]: enp4s0 sys offset 5 s2 freq +1725 delay 0 phc2sys[368.760]: enp4s0 sys offset -1 s2 freq +1721 delay 0 phc2sys[368.860]: enp4s0 sys offset 0 s2 freq +1721 delay 0 phc2sys[368.960]: enp4s0 sys offset 0 s2 freq +1721 delay 0 phc2sys[369.061]: enp4s0 sys offset 4 s2 freq +1725 delay 0 phc2sys[369.161]: enp4s0 sys offset 1 s2 freq +1724 delay 0 phc2sys[369.261]: enp4s0 sys offset 4 s2 freq +1727 delay 0 phc2sys[369.361]: enp4s0 sys offset 8 s2 freq +1732 delay 0 phc2sys[369.461]: enp4s0 sys offset 7 s2 freq +1733 delay 0 phc2sys[369.561]: enp4s0 sys offset 4 s2 freq +1733 delay 0 phc2sys[369.661]: enp4s0 sys offset 1 s2 freq +1731 delay 0 phc2sys[369.761]: enp4s0 sys offset 1 s2 freq +1731 delay 0 phc2sys[369.861]: enp4s0 sys offset -5 s2 freq +1725 delay 0 phc2sys[369.961]: enp4s0 sys offset -4 s2 freq +1725 delay 0 phc2sys[370.062]: enp4s0 sys offset 2 s2 freq +1730 delay 0 phc2sys[370.162]: enp4s0 sys offset -7 s2 freq +1721 delay 0 phc2sys[370.262]: enp4s0 sys offset -3 s2 freq +1723 delay 0 phc2sys[370.362]: enp4s0 sys offset 1 s2 freq +1726 delay 0 phc2sys[370.462]: enp4s0 sys offset -3 s2 freq +1723 delay 0 phc2sys[370.562]: enp4s0 sys offset -1 s2 freq +1724 delay 0 phc2sys[370.662]: enp4s0 sys offset -4 s2 freq +1720 delay 0 phc2sys[370.762]: enp4s0 sys offset -7 s2 freq +1716 delay 0 phc2sys[370.862]: enp4s0 sys offset -2 s2 freq +1719 delay 0 Statistics for this run (total of 2179 lines), in nanoseconds: average: 0.14 stdev: 5.03 max: 48 min: -27 For reference, the statistics for runs without PCIe congestion show that the improvements from enabling PTM are less dramatic. For two runs of 16466 entries: without PTM: avg -0.04 stdev 10.57 max 39 min -42 with PTM: avg 0.01 stdev 4.20 max 19 min -16 One possible explanation is that when PTM is not enabled, and there's a lot of traffic in the PCIe fabric, some register reads will take more time than the others because of congestion on the PCIe fabric. When PTM is enabled, even if the PTM dialogs take more time to complete under heavy traffic, the time measurements do not depend on the time to read the registers. This was implemented following the i225 EAS version 0.993. Signed-off-by: Vinicius Costa Gomes Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 1b5d73fb862414106cf270a1a7300ce8ae77de83 Author: Vinicius Costa Gomes Date: Mon Jul 26 20:36:56 2021 -0700 igc: Enable PCIe PTM Enables PCIe PTM (Precision Time Measurement) support in the igc driver. Notifies the PCI devices that PCIe PTM should be enabled. PCIe PTM is similar protocol to PTP (Precision Time Protocol) running in the PCIe fabric, it allows devices to report time measurements from their internal clocks and the correlation with the PCIe root clock. The i225 NIC exposes some registers that expose those time measurements, those registers will be used, in later patches, to implement the PTP_SYS_OFFSET_PRECISE ioctl(). Signed-off-by: Vinicius Costa Gomes Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 890317950fcaafbc16372d1b9855bcadf0fc5843 Author: Heiner Kallweit Date: Sun Aug 22 16:01:08 2021 +0200 scsi: cxlflash: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Link: https://lore.kernel.org/r/b5f71c97-61fb-86cb-6bec-84b042392ce7@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit fc9279298e3a903dce511caa5fe9eda298a7949e Author: Heiner Kallweit Date: Sun Aug 22 15:59:21 2021 +0200 cxgb4: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Link: https://lore.kernel.org/r/db576a3e-e877-b37b-98ed-cfc03d225ab3@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit f9f3caa8dcd73a145861b69cc1f4bcd1b6fb0f81 Author: Heiner Kallweit Date: Sun Aug 22 15:58:26 2021 +0200 cxgb4: Remove unused vpd_param member ec Member ec isn't used, so remove it. Link: https://lore.kernel.org/r/30648e95-bfb9-9af3-0c8f-dd3e34df8b6b@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 52f0a1e007703a99d77cc43fcb8661158d86c861 Author: Heiner Kallweit Date: Sun Aug 22 15:57:27 2021 +0200 cxgb4: Validate VPD checksum with pci_vpd_check_csum() Validate the VPD checksum with pci_vpd_check_csum() to simplify the code. Link: https://lore.kernel.org/r/70404ece-0036-c0ce-f824-f5637e54115e@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 0ff25f6a17c76d50e5d4bdd29bb69ad173a3cde1 Author: Heiner Kallweit Date: Sun Aug 22 15:56:24 2021 +0200 bnxt: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Link: https://lore.kernel.org/r/f062921c-ad33-3b3e-8ada-b53427a9cd4a@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 550cd7c1b45b568ccac28fd46663799f1ff8a62d Author: Heiner Kallweit Date: Sun Aug 22 15:55:23 2021 +0200 bnxt: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This simplifies the code, and we no longer have to make assumptions about VPD size. Link: https://lore.kernel.org/r/62522a24-f39a-2b35-1577-1fbb41695bed@gmail.com Reported-by: kernel test robot Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 1d070108354b6c77a41931b16e8007255b70f90b Merge: e73f0f0ee7541 c0c81245dac7c Author: Stephen Boyd Date: Tue Aug 24 11:40:25 2021 -0700 Merge tag 'v5.15-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull Rockchip clk driver updates from Heiko Stuebner: - YAML conversion of rk3399 clock controller binding - Removal of GRF dependency for the rk3328/rk3036 pll types - some clock tree fixes * tag 'v5.15-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: make rk3308 ddrphy4x clock critical clk: rockchip: drop GRF dependency for rk3328/rk3036 pll types dt-bindings: clk: Convert rockchip,rk3399-cru to DT schema clk: rockchip: Add support for hclk_sfc on rk3036 clk: rockchip: rk3036: fix up the sclk_sfc parent error clk: rockchip: add dt-binding clkid for hclk_sfc on rk3036 commit 3831cba07a4bf96bc75fb963451a49d7f676c7d6 Author: Heiner Kallweit Date: Sun Aug 22 15:54:23 2021 +0200 bnx2x: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Use strncasecmp() to match Vendor ID instead of comparing with lower- and upper-case hex string. [bhelgaas: convert to strncasecmp()] Link: https://lore.kernel.org/r/a9f730cf-e31e-902b-7b39-0ff2e99636e0@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 923ba4604a9be794e4ef4911f6c5e15b4bb39b3f Merge: e73f0f0ee7541 faa8605f9f92e Author: Stephen Boyd Date: Tue Aug 24 11:39:04 2021 -0700 Merge tag 'for-5.15-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-nvidia Pull a Tegra clk driver cleanup from Thierry Reding: The FUSE driver has been updated to take manual control of the FUSE clock over suspend/resume cycles, so the CLK_IS_CRITICAL flag can now be dropped. * tag 'for-5.15-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: clk: tegra: Remove CLK_IS_CRITICAL flag from fuse clock soc/tegra: fuse: Enable fuse clock on suspend for Tegra124 soc/tegra: fuse: Add runtime PM support soc/tegra: fuse: Clear fuse->clk on driver probe failure soc/tegra: pmc: Prevent racing with cpuilde driver soc/tegra: bpmp: Remove unused including commit a1cde1f0172eefe55c97310b27aca2076fdaff01 Merge: 5f1fc9726ff79 e8425dd55abb1 Author: Stephen Boyd Date: Tue Aug 24 11:37:53 2021 -0700 Merge tag 'renesas-clk-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull more Renesas clk driver updates from Geert Uytterhoeven: - Make CLK_R9A06G032 invisible * tag 'renesas-clk-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: Make CLK_R9A06G032 invisible commit 014408cd624e9fd2820f4a593b710325ee05fec9 Author: Vinicius Costa Gomes Date: Mon Jul 26 20:36:55 2021 -0700 PCI: Add pcie_ptm_enabled() Add a predicate that returns if PCIe PTM (Precision Time Measurement) is enabled. It will only return true if it's enabled in all the ports in the path from the device to the root. Signed-off-by: Vinicius Costa Gomes Acked-by: Bjorn Helgaas Signed-off-by: Tony Nguyen commit 8c85bdafdd307fb4b5a3f6f2de9720684239a37d Author: Krzysztof Kozlowski Date: Fri Aug 20 17:03:50 2021 +0200 dt-bindings: devfreq: event: convert Samsung Exynos NoCP to dtschema Convert Samsung Exynos NoC Probe bindings to DT schema format using json-schema. New bindings contain copied description from previous bindings document, therefore the license is set as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210820150353.161161-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 90e7a6de62781c27d6a111fccfb19b807f9b6887 Author: Maor Gottlieb Date: Tue Aug 24 17:25:29 2021 +0300 lib/scatterlist: Provide a dedicated function to support table append RDMA is the only in-kernel user that uses __sg_alloc_table_from_pages to append pages dynamically. In the next patch. That mode will be extended and that function will get more parameters. So separate it into a unique function to make such change more clear. Link: https://lore.kernel.org/r/20210824142531.3877007-2-maorg@nvidia.com Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f674aacd5005184acf3cf7b851a299573d64fdd6 Author: Chunyan Zhang Date: Tue Aug 24 15:02:12 2021 +0800 spi: sprd: fill offset only to RD_CMD register for reading from slave device RD_CMD can accept slave address offset only, higher bits are reserved. Writing the whole slave address including slave base seems unnecessary. Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20210824070212.2089255-3-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 2b961c51f4d35c45116b21936b563cbb78fba540 Author: Chunyan Zhang Date: Tue Aug 24 15:02:11 2021 +0800 spi: sprd: Make sure offset not equal to slave address size The slave register offset shouldn't equal to the max slave address which ADI can support to access. Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20210824070212.2089255-2-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 5dc349ec131c6d40aeb2545064e285f0025fbb39 Author: Chunyan Zhang Date: Tue Aug 24 15:02:10 2021 +0800 spi: sprd: Pass offset instead of physical address to adi_read/_write() The register offset would be added a physical address base and then pass to the function sprd_adt_read()/_write() each time before calling them. So we can do that within these two functions instead, that would make the code more clear. Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20210824070212.2089255-1-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 0be10d7122ceb8f322086283420a59ee89c1947f Author: Changcheng Deng Date: Mon Aug 23 20:00:15 2021 -0700 ASoC: SOF: intel: remove duplicate include Clean up the following includecheck warning: ./sound/soc/sof/intel/pci-tng.c: shim.h is included more than once. No functional change. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210824030015.57267-1-deng.changcheng@zte.com.cn Signed-off-by: Mark Brown commit 86956e70761b3292156d668e87126844334dd71b Author: Tony Krowiak Date: Mon Aug 23 17:20:47 2021 -0400 s390/vfio-ap: replace open coded locks for VFIO_GROUP_NOTIFY_SET_KVM notification It was pointed out during an unrelated patch review that locks should not be open coded - i.e., writing the algorithm of a standard lock in a function instead of using a lock from the standard library. The setting and testing of a busy flag and sleeping on a wait_event is the same thing a lock does. The open coded locks are invisible to lockdep, so potential locking problems are not detected. This patch removes the open coded locks used during VFIO_GROUP_NOTIFY_SET_KVM notification. The busy flag and wait queue were introduced to resolve a possible circular locking dependency reported by lockdep when starting a secure execution guest configured with AP adapters and domains. Reversing the order in which the kvm->lock mutex and matrix_dev->lock mutex are locked resolves the issue reported by lockdep, thus enabling the removal of the open coded locks. Signed-off-by: Tony Krowiak Acked-by: Halil Pasic Link: https://lore.kernel.org/r/20210823212047.1476436-3-akrowiak@linux.ibm.com Signed-off-by: Alex Williamson commit 1e753732bda6dcf888ea0b90b2a91ac1c1a0bae9 Author: Tony Krowiak Date: Mon Aug 23 17:20:46 2021 -0400 s390/vfio-ap: r/w lock for PQAP interception handler function pointer The function pointer to the interception handler for the PQAP instruction can get changed during the interception process. Let's add a semaphore to struct kvm_s390_crypto to control read/write access to the function pointer contained therein. The semaphore must be locked for write access by the vfio_ap device driver when notified that the KVM pointer has been set or cleared. It must be locked for read access by the interception framework when the PQAP instruction is intercepted. Signed-off-by: Tony Krowiak Reviewed-by: Jason Gunthorpe Reviewed-by: Christian Borntraeger Link: https://lore.kernel.org/r/20210823212047.1476436-2-akrowiak@linux.ibm.com Signed-off-by: Alex Williamson commit 5f8c991e8950971cd1f81b61f79c83a511ad9fc8 Author: Trevor Wu Date: Thu Aug 19 16:41:44 2021 +0800 dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document This patch adds document for mt8195 board with mt6359, rt1019 and rt5682 Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-12-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit ef46cd42ecf00f0468df3ad1bf0f30db9634a04a Author: Trevor Wu Date: Thu Aug 19 16:41:43 2021 +0800 ASoC: mediatek: mt8195: add HDMITX audio support This patch adds HDMITX audio support on mt8195-mt6359-rt1019-rt5682 board. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-11-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit e581e3014cc4acee9025aa5704cf85a36a572b95 Author: Trevor Wu Date: Thu Aug 19 16:41:42 2021 +0800 ASoC: mediatek: mt8195: add DPTX audio support This patch adds DPTX audio support on mt8195-mt6359-rt1019-rt5682 board. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-10-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 40d605df0a7bf7723ed690f502f364c5320de440 Author: Trevor Wu Date: Thu Aug 19 16:41:41 2021 +0800 ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682 This patch adds support for mt8195 board with mt6359, rt1019 and rt5682. Signed-off-by: Trevor Wu Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210819084144.18483-9-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit b5bac34fcfb444e33f532e291ad1394ca05887e8 Author: Trevor Wu Date: Thu Aug 19 16:41:40 2021 +0800 dt-bindings: mediatek: mt8195: add audio afe document This patch adds mt8195 audio afe document. In order to support dynamic clock reparenting for ADDA and ETDM, PLL and MUX clocks are requested even though they are not consumed by afe directly. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-8-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 6746cc858259985a945a07075a19ec4d24352407 Author: Trevor Wu Date: Thu Aug 19 16:41:39 2021 +0800 ASoC: mediatek: mt8195: add platform driver This patch adds mt8195 platform and affiliated driver. Signed-off-by: Trevor Wu Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210819084144.18483-7-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 1f95c019115cc503c4c47fd7108675a56cdb29b4 Author: Trevor Wu Date: Thu Aug 19 16:41:38 2021 +0800 ASoC: mediatek: mt8195: support pcm in platform driver This patch adds mt8195 pcm dai driver. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-6-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 3de3eba588bb7f6c39bf12de5761ff75c53b9961 Author: Trevor Wu Date: Thu Aug 19 16:41:37 2021 +0800 ASoC: mediatek: mt8195: support adda in platform driver This patch adds mt8195 adda dai driver. audio_h clock is used by ADSP bus and ADDA module. When ADDA requires audio_h clock, it is switched to APLL1, otherwise it is switched to Xtal_26m so that APLL1 can be turned off when audio feature is not used. ADSP bus only requires that the clock is on, so dynamic reparenting is used for the purpose of lowering power consumption. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 1de9a54acafba2f0e3ea2856ad0b22556d59ec45 Author: Trevor Wu Date: Thu Aug 19 16:41:36 2021 +0800 ASoC: mediatek: mt8195: support etdm in platform driver This patch adds mt8195 tdm/i2s dai driver. MCLK clock tree is as follows. PLL -> MUX -> DIVIDER -> MCLK For PLL source of MCLK, driver only supports APLL1 and APLL2 now. APLL3 and APLL4 are used to track external clock source, so they are only used when slave input is connected. For example, case 1: (HDMI RX connected) DL memif (a1sys) -> etdm out2 (clk from apll1/apll2) -> codec case 2: (HDMI RX disconnected) HDMI RX -> a3sys -> UL memif (a3sys) -> DL memif (a3sys) -> .... -> etdm out2 (clk from apll3) -> codec We keep all modules in the pipeline working on the same clock domain. MCLK is expected to output the clock generated from the same clock source as the pipeline, so dynamic reparenting is required for MCLK configuration. As a result, clk_set_parent() is used to select PLL source, and clk_set_rate() is used to configure divider to get MCLK output rate. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit d62ad762f67585acfb5e03f71b28a52dc4604cf2 Author: Trevor Wu Date: Thu Aug 19 16:41:35 2021 +0800 ASoC: mediatek: mt8195: support audsys clock control This patch adds mt8195 audio cg control. Audio clock gates are registered to CCF for reference count and clock parent management. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210819084144.18483-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit cab2b9e5fc0e868ed8453ef4f433c795bda8bf84 Author: Trevor Wu Date: Thu Aug 19 16:41:34 2021 +0800 ASoC: mediatek: mt8195: update mediatek common driver Update mediatek common driver to support MT8195 Signed-off-by: Trevor Wu Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210819084144.18483-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit e6d0b92ac00b53121a35b2a1ce8d393dc9179fdf Author: Charles Keepax Date: Tue Aug 24 11:15:52 2021 +0100 ASoC: wm_adsp: Put debugfs_remove_recursive back in This patch reverts commit acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs"), and adds an alternate solution to the issue. That patch removes the call to debugfs_remove_recursive, which cleans up the DSPs debugfs. The intention was to avoid an unbinding issue on an out of tree driver/platform. The issue with the patch is it means the driver no longer cleans up its own debugfs, instead relying on ASoC to remove recurive on the parent debugfs node. This is conceptually rather unclean, but also it would prevent DSPs being added/removed independently of ASoC and soon we are going to be upstreaming some non-audio parts with these DSPs, which will require this. Finally, it seems the issue on the platform is a result of the wm_adsp2_cleanup_debugfs getting called twice. This is very likely a problem on the platform side and will be resolved there. But in the mean time make the code a little more robust to such issues, and again conceptually a bit nicer, but clearing the debugfs_root variable in the DSP structure when the debugfs is removed. Fixes: acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs" Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20210824101552.1119-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit ffc95d1b8edb80d2dab77f2e8a823c8d93b06419 Author: Anthony Yznaga Date: Mon Aug 23 09:35:50 2021 -0700 vfio/type1: Fix vfio_find_dma_valid return vfio_find_dma_valid is defined to return WAITED on success if it was necessary to wait. However, the loop forgets the WAITED value returned by vfio_wait() and returns 0 in a later iteration. Fix it. Signed-off-by: Anthony Yznaga Reviewed-by: Steve Sistare Link: https://lore.kernel.org/r/1629736550-2388-1-git-send-email-anthony.yznaga@oracle.com Signed-off-by: Alex Williamson commit 37c3193fa4d7ddf93947264fa38d71120ff20c2a Author: Shunsuke Nakamura Date: Fri Aug 20 18:39:07 2021 +0900 libperf tests: Fix verbose printing libperf's verbose printing checks the -v option every time the macro _T_ START is called. Since there are currently four libperf tests registered, the macro _T_ START is called four times, but verbose printing after the second time is not output. Resets the index of the element processed by getopt() and fix verbose printing so that it prints in all tests. Signed-off-by: Shunsuke Nakamura Acked-by: Rob Herring Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210820093908.734503-3-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit 29848a034ac749622f5ef4686f9e48d69254f4dc Author: Cai Huoqing Date: Tue Aug 24 08:37:49 2021 +0800 vfio-pci/zdev: Remove repeated verbose license text The SPDX and verbose license text are redundant, however in this case the verbose license indicates a GPL v2 only while SPDX specifies v2+. Remove the verbose license and correct SPDX to the more restricted version. Signed-off-by: Cai Huoqing Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/20210824003749.1039-1-caihuoqing@baidu.com [aw: commit log] Signed-off-by: Alex Williamson commit ce73af80876dba7b855fe36d1ec473f77300c214 Author: Nghia Le Date: Tue Aug 24 15:59:47 2021 +0700 perf tools: Add missing newline at the end of header file Add missing newline at the end of file parse-sublevel-options.h. Thus removing relevant warning reported by checkpatch. Signed-off-by: Nghia Le Reviewed-by: Lukas Bulwahn Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http //lore.kernel.org/lkml/20210824085947.224062-1-nghialm78@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit ab78130e6e99e74c2c6d5670fa3e7f290e07c2c5 Author: Cai Huoqing Date: Sun Aug 22 12:36:43 2021 +0800 vfio: platform: reset: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210822043643.2040-1-caihuoqing@baidu.com Signed-off-by: Alex Williamson commit 1d71eb53e45187f58089d32b51e27784c791d90e Author: Vinicius Costa Gomes Date: Mon Jul 26 20:36:54 2021 -0700 Revert "PCI: Make pci_enable_ptm() private" Make pci_enable_ptm() accessible from the drivers. Exposing this to the driver enables the driver to use the 'ptm_enabled' field of 'pci_dev' to check if PTM is enabled or not. This reverts commit ac6c26da29c1 ("PCI: Make pci_enable_ptm() private"). Signed-off-by: Vinicius Costa Gomes Acked-by: Bjorn Helgaas Signed-off-by: Tony Nguyen commit df87589475e73b9e34369a075b6b5375f0daa7d6 Author: Heiner Kallweit Date: Sun Aug 22 15:53:23 2021 +0200 bnx2x: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This simplifies the code, and we no longer have to make assumptions about VPD size. Link: https://lore.kernel.org/r/821a334d-ff9d-386e-5f42-9b620ab3dbfa@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 35e7f1be7972be8da9d0a37bd89bcc4b990c6e67 Author: Heiner Kallweit Date: Sun Aug 22 15:52:01 2021 +0200 bnx2: Replace open-coded byte swapping with swab32s() Read NVRAM directly into buffer and use swab32s() to byte swap it in-place instead of reading it into the end of the buffer and swapping it manually while copying it. [bhelgaas: commit log] Link: https://lore.kernel.org/r/e4ac6229-1df5-8760-3a87-1ad0ace87137@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 1a41fdb805705251fc61715167cadc0829de587a Author: Heiner Kallweit Date: Sun Aug 22 15:50:50 2021 +0200 bnx2: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Link: https://lore.kernel.org/r/7ca2b8b5-4c94-f644-1d80-b2ffb8df2d05@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 2d57dd6673a87ea23d8660257162d6280fe7b2e6 Author: Heiner Kallweit Date: Sun Aug 22 15:49:36 2021 +0200 sfc: falcon: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Replace netif_err() with pci_err() because the netdevice isn't registered yet, which results in very ugly messages. Use kmemdup_nul() instead of open-coding it. This is the same as 37838aa437c7 ("sfc: Search VPD with pci_vpd_find_ro_info_keyword()"), just for the falcon chip version. Link: https://lore.kernel.org/r/898282a1-13bd-17bc-2e9a-d3dcd336b46c@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 667bb0e8f7106c6ca3b30254a7fdcd1ea04d3580 Author: Heiner Kallweit Date: Sun Aug 22 15:48:33 2021 +0200 sfc: falcon: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This avoids having to allocate a buffer on the stack, and we don't have to make any assumptions on VPD size and location of information in VPD. This is the same as 5119e20facfa ("sfc: Read VPD with pci_vpd_alloc()"), just for the falcon chip version. Link: https://lore.kernel.org/r/2a8d069e-9516-50d8-6520-2614222c8f5f@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 4d643b66089591b4769bcdb6fd1bfeff2fe301b8 Author: Niklas Cassel Date: Wed Aug 11 11:05:19 2021 +0000 blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN A user space process should not need the CAP_SYS_ADMIN capability set in order to perform a BLKREPORTZONE ioctl. Getting the zone report is required in order to get the write pointer. Neither read() nor write() requires CAP_SYS_ADMIN, so it is reasonable that a user space process that can read/write from/to the device, also can get the write pointer. (Since e.g. writes have to be at the write pointer.) Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls") Signed-off-by: Niklas Cassel Reviewed-by: Damien Le Moal Reviewed-by: Aravind Ramesh Reviewed-by: Adam Manzanares Reviewed-by: Himanshu Madhani Reviewed-by: Johannes Thumshirn Cc: stable@vger.kernel.org # v4.10+ Link: https://lore.kernel.org/r/20210811110505.29649-3-Niklas.Cassel@wdc.com Signed-off-by: Jens Axboe commit ead3b768bb51259e3a5f2287ff5fc9041eb6f450 Author: Niklas Cassel Date: Wed Aug 11 11:05:18 2021 +0000 blk-zoned: allow zone management send operations without CAP_SYS_ADMIN Zone management send operations (BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE) should be allowed under the same permissions as write(). (write() does not require CAP_SYS_ADMIN). Additionally, other ioctls like BLKSECDISCARD and BLKZEROOUT only check if the fd was successfully opened with FMODE_WRITE. (They do not require CAP_SYS_ADMIN). Currently, zone management send operations require both CAP_SYS_ADMIN and that the fd was successfully opened with FMODE_WRITE. Remove the CAP_SYS_ADMIN requirement, so that zone management send operations match the access control requirement of write(), BLKSECDISCARD and BLKZEROOUT. Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls") Signed-off-by: Niklas Cassel Reviewed-by: Damien Le Moal Reviewed-by: Aravind Ramesh Reviewed-by: Adam Manzanares Reviewed-by: Himanshu Madhani Reviewed-by: Johannes Thumshirn Cc: stable@vger.kernel.org # v4.10+ Link: https://lore.kernel.org/r/20210811110505.29649-2-Niklas.Cassel@wdc.com Signed-off-by: Jens Axboe commit 62283c6c9d4c1018badcd0b9c5b6ca66d978fa0d Author: Jing Yangyang Date: Mon Aug 23 23:07:02 2021 -0700 include:libata: fix boolreturn.cocci warnings ./include/linux/libata.h:1462:8-9:WARNING: return of 0/1 in function 'ata_is_host_link' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Link: https://lore.kernel.org/r/20210824060702.59006-1-deng.changcheng@zte.com.cn Signed-off-by: Jens Axboe commit 158ee7b65653d9f841823c249014c2d0dfdeeb8f Author: Christoph Hellwig Date: Tue Aug 24 17:18:23 2021 +0200 block: mark blkdev_fsync static blkdev_fsync is only used inside of block_dev.c since the removal of the raw drіver. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210824151823.1575100-1-hch@lst.de Signed-off-by: Jens Axboe commit 9f2869921f2a102e209297d4f742f34b46ed3d36 Author: Christoph Hellwig Date: Tue Aug 24 16:43:10 2021 +0200 block: refine the disk_live check in del_gendisk hidden gendisks will never be marked live. Fixes: 40b3a52ffc5b ("block: add a sanity check for a live disk in del_gendisk") Reported-by: Bruno Goncalves Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210824144310.1487816-1-hch@lst.de Signed-off-by: Jens Axboe commit 1743fa54c9e8247000e060fcdab406ab3a808223 Author: Dmitry Osipenko Date: Fri Aug 20 03:45:36 2021 +0300 mmc: sdhci-tegra: Enable MMC_CAP2_ALT_GPT_TEGRA Tegra20/30/114/124 Android devices place GPT at a non-standard location. Enable GPT entry scanning at that location. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/20210820004536.15791-5-digetx@gmail.com Signed-off-by: Jens Axboe commit dc913385dd74e625271482c30aefedd1e5af7b8c Author: Dmitry Osipenko Date: Fri Aug 20 03:45:35 2021 +0300 mmc: block: Support alternative_gpt_sector() operation Support generic alternative_gpt_sector() block device operation. It calculates location of GPT entry for eMMC of NVIDIA Tegra Android devices. Add new MMC_CAP2_ALT_GPT_TEGRA flag that enables scanning of alternative GPT sector and add raw_boot_mult field to mmc_ext_csd which allows to get size of the boot partitions that is needed for the calculation. Signed-off-by: Dmitry Osipenko Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/20210820004536.15791-4-digetx@gmail.com Signed-off-by: Jens Axboe commit 466d9c4904deb25e2e8dcd29d3a998f4e3fa7c17 Author: Dmitry Osipenko Date: Fri Aug 20 03:45:34 2021 +0300 partitions/efi: Support non-standard GPT location Support looking up GPT at a non-standard location specified by a block device driver. Acked-by: Davidlohr Bueso Reviewed-by: Christoph Hellwig Signed-off-by: Dmitry Osipenko Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/20210820004536.15791-3-digetx@gmail.com Signed-off-by: Jens Axboe commit 0bdfbca8a623e262e0f343b143151000a300cbaf Author: Dmitry Osipenko Date: Fri Aug 20 03:45:33 2021 +0300 block: Add alternative_gpt_sector() operation Add alternative_gpt_sector() block device operation which specifies alternative location of a GPT entry. This allows us to support Android devices that have GPT entry at a non-standard location and can't be repartitioned easily. Reviewed-by: Christoph Hellwig Suggested-by: Christoph Hellwig Signed-off-by: Dmitry Osipenko Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/20210820004536.15791-2-digetx@gmail.com Signed-off-by: Jens Axboe commit 7559b7d7d651d397debbcd838bd49ec4b9e0a4a4 Author: Mark Brown Date: Tue Aug 24 16:34:17 2021 +0100 arm64/sve: Better handle failure to allocate SVE register storage Currently we "handle" failure to allocate the SVE register storage by doing a BUG_ON() and hoping for the best. This is obviously not great and the memory allocation failure will already be loud enough without the BUG_ON(). As the comment says it is a corner case but let's try to do a bit better, remove the BUG_ON() and add code to handle the failure in the callers. For the ptrace and signal code we can return -ENOMEM gracefully however we have no real error reporting path available to us for the SVE access trap so instead generate a SIGKILL if the allocation fails there. This at least means that we won't try to soldier on and end up trying to access the nonexistant state and while it's obviously not ideal for userspace SIGKILL doesn't allow any handling so minimises the ABI impact, making it easier to improve the interface later if we come up with a better idea. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210824153417.18371-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit e3849765037b85e61b2432ded488ee9fb3ff126d Author: Marc Zyngier Date: Thu Aug 12 20:02:13 2021 +0100 arm64: Document the requirement for SCR_EL3.HCE It is amazing that we never documented this absolutely basic requirement: if you boot the kernel at EL2, you'd better enable the HVC instruction from EL3. Really, just do it. Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20210812190213.2601506-6-maz@kernel.org Signed-off-by: Catalin Marinas commit 90268574a3e8a6b883bd802d702a2738577e1006 Author: Mark Rutland Date: Mon Aug 23 11:12:53 2021 +0100 arm64: head: avoid over-mapping in map_memory The `compute_indices` and `populate_entries` macros operate on inclusive bounds, and thus the `map_memory` macro which uses them also operates on inclusive bounds. We pass `_end` and `_idmap_text_end` to `map_memory`, but these are exclusive bounds, and if one of these is sufficiently aligned (as a result of kernel configuration, physical placement, and KASLR), then: * In `compute_indices`, the computed `iend` will be in the page/block *after* the final byte of the intended mapping. * In `populate_entries`, an unnecessary entry will be created at the end of each level of table. At the leaf level, this entry will map up to SWAPPER_BLOCK_SIZE bytes of physical addresses that we did not intend to map. As we may map up to SWAPPER_BLOCK_SIZE bytes more than intended, we may violate the boot protocol and map physical address past the 2MiB-aligned end address we are permitted to map. As we map these with Normal memory attributes, this may result in further problems depending on what these physical addresses correspond to. The final entry at each level may require an additional table at that level. As EARLY_ENTRIES() calculates an inclusive bound, we allocate enough memory for this. Avoid the extraneous mapping by having map_memory convert the exclusive end address to an inclusive end address by subtracting one, and do likewise in EARLY_ENTRIES() when calculating the number of required tables. For clarity, comments are updated to more clearly document which boundaries the macros operate on. For consistency with the other macros, the comments in map_memory are also updated to describe `vstart` and `vend` as virtual addresses. Fixes: 0370b31e4845 ("arm64: Extend early page table code to allow for larger kernels") Cc: # 4.16.x Signed-off-by: Mark Rutland Cc: Anshuman Khandual Cc: Ard Biesheuvel Cc: Steve Capper Cc: Will Deacon Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210823101253.55567-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 04fa17d1368c1f49801c852aac874d99ba5a6d20 Author: Mark Brown Date: Mon Aug 16 13:50:23 2021 +0100 arm64/sve: Add a comment documenting the binutils needed for SVE asm At some point it would be nice to avoid the need to manually encode SVE instructions, add a note of the binutils version required to save looking it up. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210816125024.8112-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 38ee3c5e36a134050df93ab911d4713e30a6cde5 Author: Mark Brown Date: Thu Aug 12 21:11:43 2021 +0100 arm64/sve: Add some comments for sve_save/load_state() The use of macros for the actual function bodies means legibility is always going to be a bit of a challenge, especially while we can't rely on SVE support in the toolchain, but this helps a little. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210812201143.35578-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit fe72d08a961f9e09a7b04c15904a98f7c8cd537e Author: Bean Huo Date: Wed Aug 18 00:42:07 2021 +0200 mmc: core: Issue HPI in case the BKOPS timed out If the BKOPS timed out, the card is probably still busy in the R1_STATE_PRG. Rather than continue as nothing has happened and hitting and error for the next command being sent, let's try to abort the running BKOPS by sending a HPI command to get back into R1_STATE_TRAN. Signed-off-by: Bean Huo Link: https://lore.kernel.org/r/20210817224208.153652-2-huobean@gmail.com Signed-off-by: Ulf Hansson commit f6f607070aa6f0c730c5ca38e888c88f34bea7d6 Author: ChanWoo Lee Date: Tue Aug 24 16:39:34 2021 +0900 mmc: queue: Match the data type of max_segments Each function has a different data type for max_segments, Modify to match unsigned short(host->max_segs). * unsigned short max_segs; /* see blk_queue_max_segments */ 1) Return type : unsigned int static unsigned int mmc_get_max_segments(struct mmc_host *host) { return host->can_dma_map_merge ? MMC_DMA_MAP_MERGE_SEGMENTS : host->max_segs; } 2) Parameter type : int mmc_alloc_sg(mmc_get_max_segments(host), gfp); -> static struct scatterlist *mmc_alloc_sg(int sg_len, gfp_t gfp) 3) Parameter type : unsigned short blk_queue_max_segments(mq->queue, mmc_get_max_segments(host)); -> void blk_queue_max_segments(struct request_queue *q, unsigned short max_segments) Signed-off-by: ChanWoo Lee Acked-by: Coly Li Link: https://lore.kernel.org/r/20210824073934.19727-1-cw9316.lee@samsung.com Signed-off-by: Ulf Hansson commit b048457c54e4dcf3e326ddd4974d5e3d2a74d03b Author: Christophe JAILLET Date: Sun Aug 22 15:48:37 2021 +0200 mmc: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/b617f284e2ab8b6b48fff150eba1638641646edd.1629640046.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit 89d74b30f44371c2fc388f7fb172a583977ef0d8 Author: Christophe JAILLET Date: Sat Aug 21 23:13:07 2021 +0200 memstick: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. No memory allocation in involved in this patch, so no GFP_ tweak is needed. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f6fe24f2372c8c627a08ace7187bfe60d35788b6.1629580314.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit 2b50c81fb7284d9122b98e8227cd8c6495238bd6 Author: Christophe JAILLET Date: Sat Aug 21 23:17:15 2021 +0200 memstick: r592: Change the name of the 'pci_driver' structure to be consistent This driver is all about r592. Axe the reference to r852 in the 'pci_driver' structure name. This is likely a copy/paste typo left as is when the driver has been created. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/258f76acc73d5c448b9cb5dab4c39d80d517c7a9.1629580585.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit 09cedbd8dbc057c07885cfacdcdb09ef4880c5cb Author: Claudiu Beznea Date: Fri Aug 20 12:28:02 2021 +0300 mmc: pwrseq: add wilc1000_sdio dependency for pwrseq_sd8787 pwseq_sd8787 could also be used with wilc1000_sdio driver. Add a dependency for this. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20210820092803.78523-4-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit b2832b96fcf50270d69dae3f95bf14949ff638e4 Author: Claudiu Beznea Date: Fri Aug 20 12:28:01 2021 +0300 mmc: pwrseq: sd8787: add support for wilc1000 Add new compatible for wilc1000 devices and specify the delay in .data member of struct of_device_id. WILC1000, WILC3000 devices needs a minimum of 5ms delay b/w reset and power lines. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20210820092803.78523-3-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit 2c2eaf882f7b4d8bb9a68856eae9cb0b7d77f371 Author: Claudiu Beznea Date: Fri Aug 20 12:28:00 2021 +0300 dt-bindings: mmc: Extend pwrseq-sd8787 binding for wilc1000 Extend the DT bindings to support wilc1000 devices. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210820092803.78523-2-claudiu.beznea@microchip.com Signed-off-by: Ulf Hansson commit 4bdda3db47db079b9b487ea05fd6ca7dbd71c4e7 Author: Haibo Chen Date: Thu Aug 19 19:52:18 2021 +0800 dt-bindings: mmc: fsl-imx-esdhc: change the pinctrl-names rule Change the pinctrl-names rule to cover all cases. Signed-off-by: Haibo Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/1629373938-9226-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 3a62c333497b164868fdcd241842a1dd4e331825 Merge: 95d1d2490c278 cce1689eb58d2 Author: Jakub Kicinski Date: Tue Aug 24 07:36:56 2021 -0700 Merge branch 'ethtool-extend-coalesce-uapi' Yufeng Mo says: ==================== ethtool: extend coalesce uAPI In order to support some configuration in coalesce uAPI, this series extend coalesce uAPI and add support for CQE mode. Below is some test result with HNS3 driver: 1. old ethtool(ioctl) + new kernel: estuary:/$ ethtool -c eth0 Coalesce parameters for eth0: Adaptive RX: on TX: on stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 20 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 20 tx-frames: 0 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frame-low: 0 tx-usecs-low: 0 tx-frame-low: 0 rx-usecs-high: 0 rx-frame-high: 0 tx-usecs-high: 0 tx-frame-high: 0 2. ethtool(netlink with cqe mode) + kernel without cqe mode: estuary:/$ ethtool -c eth0 Coalesce parameters for eth0: Adaptive RX: on TX: on stats-block-usecs: n/a sample-interval: n/a pkt-rate-low: n/a pkt-rate-high: n/a rx-usecs: 20 rx-frames: 0 rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 20 tx-frames: 0 tx-usecs-irq: n/a tx-frames-irq: n/a rx-usecs-low: n/a rx-frame-low: n/a tx-usecs-low: n/a tx-frame-low: n/a rx-usecs-high: 0 rx-frame-high: n/a tx-usecs-high: 0 tx-frame-high: n/a CQE mode RX: n/a TX: n/a 3. ethool(netlink with cqe mode) + kernel with cqe mode: estuary:/$ ethtool -c eth0 Coalesce parameters for eth0: Adaptive RX: on TX: on stats-block-usecs: n/a sample-interval: n/a pkt-rate-low: n/a pkt-rate-high: n/a rx-usecs: 20 rx-frames: 0 rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 20 tx-frames: 0 tx-usecs-irq: n/a tx-frames-irq: n/a rx-usecs-low: n/a rx-frame-low: n/a tx-usecs-low: n/a tx-frame-low: n/a rx-usecs-high: 0 rx-frame-high: n/a tx-usecs-high: 0 tx-frame-high: n/a CQE mode RX: off TX: off 4. ethool(netlink without cqe mode) + kernel with cqe mode: estuary:/$ ethtool -c eth0 Coalesce parameters for eth0: Adaptive RX: on TX: on stats-block-usecs: n/a sample-interval: n/a pkt-rate-low: n/a pkt-rate-high: n/a rx-usecs: 20 rx-frames: 0 rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 20 tx-frames: 0 tx-usecs-irq: n/a tx-frames-irq: n/a rx-usecs-low: n/a rx-frame-low: n/a tx-usecs-low: n/a tx-frame-low: n/a rx-usecs-high: 0 rx-frame-high: n/a tx-usecs-high: 0 tx-frame-high: n/a Change log: V2 -> V3: fix some warning on W=1 builds in #2 V1 -> V2: 1. fix compile error using allmodconfig in #2 2. move some property-related modifications from #2 to #1 for better review suggested by Jakub Kicinski. Change log from RFC: V3 -> V4: add document explaining the difference between CQE and EQE in #1 suggested by Jakub Kicinski. V2 -> V3: 1. split #1 into adding new parameter and adding new attributes. 2. use NLA_POLICY_MAX(NLA_U8, 1) instead of NLA_U8. 3. modify the description of CQE in Document. V1 -> V2: refactor #1 in V1 suggestted by Jakub Kicinski. ==================== Link: https://lore.kernel.org/r/1629444920-25437-1-git-send-email-moyufeng@huawei.com Signed-off-by: Jakub Kicinski commit cce1689eb58d2fe3219da2ecd27cef8e644c4cc6 Author: Yufeng Mo Date: Fri Aug 20 15:35:20 2021 +0800 net: hns3: add ethtool support for CQE/EQE mode configuration Add support in ethtool for switching EQE/CQE mode. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit 9f0c6f4b7475dd97e1f0eed81dd6ff173cf8c7fc Author: Yufeng Mo Date: Fri Aug 20 15:35:19 2021 +0800 net: hns3: add support for EQE/CQE mode configuration For device whose version is above V3(include V3), the GL can select EQE or CQE mode, so adds support for it. In CQE mode, the coalesced timer will restart when the first new completion occurs, while in EQE mode, the timer will not restart. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit f3ccfda1931977b80267ba54070a1aeafa18f6ca Author: Yufeng Mo Date: Fri Aug 20 15:35:18 2021 +0800 ethtool: extend coalesce setting uAPI with CQE mode In order to support more coalesce parameters through netlink, add two new parameter kernel_coal and extack for .set_coalesce and .get_coalesce, then some extra info can return to user with the netlink API. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit 029ee6b14356b94120bedb852dcdaefc0a282cf1 Author: Yufeng Mo Date: Fri Aug 20 15:35:17 2021 +0800 ethtool: add two coalesce attributes for CQE mode Currently, there are many drivers who support CQE mode configuration, some configure it as a fixed when initialized, some provide an interface to change it by ethtool private flags. In order to make it more generic, add two new 'ETHTOOL_A_COALESCE_USE_CQE_TX' and 'ETHTOOL_A_COALESCE_USE_CQE_RX' coalesce attributes, then these parameters can be accessed by ethtool netlink coalesce uAPI. Also add an new structure kernel_ethtool_coalesce, then the new parameter can be added into this struct. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit 95d1d2490c278ea316a4350f4c24818275fb989c Author: Jakub Kicinski Date: Mon Aug 23 11:01:35 2021 -0700 netdevice: move xdp_rxq within netdev_rx_queue Both struct netdev_rx_queue and struct xdp_rxq_info are cacheline aligned. This causes extra padding before and after the xdp_rxq member. Move the member upfront, so that it's naturally aligned. Before: /* size: 256, cachelines: 4, members: 6 */ /* sum members: 160, holes: 1, sum holes: 40 */ /* padding: 56 */ /* paddings: 1, sum paddings: 36 */ /* forced alignments: 1, forced holes: 1, sum forced holes: 40 */ After: /* size: 192, cachelines: 3, members: 6 */ /* padding: 32 */ /* paddings: 1, sum paddings: 36 */ /* forced alignments: 1 */ Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20210823180135.1153608-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fb43ebc83e069625cfeeb2490efc3ffa0013bfa4 Author: Nathan Chancellor Date: Fri Aug 13 10:11:58 2021 -0700 drm/i915/selftest: Fix use of err in igt_reset_{fail, nop}_engine() Clang warns: In file included from drivers/gpu/drm/i915/gt/intel_reset.c:1514: drivers/gpu/drm/i915/gt/selftest_hangcheck.c:465:62: warning: variable 'err' is uninitialized when used here [-Wuninitialized] pr_err("[%s] Create context failed: %d!\n", engine->name, err); ^~~ ... drivers/gpu/drm/i915/gt/selftest_hangcheck.c:580:62: warning: variable 'err' is uninitialized when used here [-Wuninitialized] pr_err("[%s] Create context failed: %d!\n", engine->name, err); ^~~ ... 2 warnings generated. This appears to be a copy and paste issue. Use ce directly using the %pe specifier to pretty print the error code so that err is not used uninitialized in these functions. Fixes: 3a7b72665ea5 ("drm/i915/selftest: Bump selftest timeouts for hangcheck") Reported-by: Dan Carpenter Signed-off-by: Nathan Chancellor Reviewed-by: Joonas Lahtinen Signed-off-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20210813171158.2665823-1-nathan@kernel.org (cherry picked from commit ac5a2dff428ab59b5c5bbb4b28311141aa461c07) Signed-off-by: Jani Nikula commit 2c772cf5fe20ef0adf7691c5df1e4b5843e0a109 Author: Dan Carpenter Date: Fri Aug 13 14:36:00 2021 +0300 drm/i915/gt: Potential error pointer dereference in pinned_context() If the intel_engine_create_pinned_context() function returns an error pointer, then dereferencing "ce" will Oops. Use "vm" instead of "ce->vm". Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration") Signed-off-by: Dan Carpenter Reviewed-by: Thomas Hellström Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210813113600.GC30697@kili (cherry picked from commit ff12ce2c9cb1cd09017151424db66de803984abc) Signed-off-by: Jani Nikula commit 3070d934a0b870575ce37da671dfdc969b153412 Author: Matt Roper Date: Mon Aug 16 13:41:12 2021 -0700 drm/i915/adl_p: Also disable underrun recovery with MSO One of the cases that the bspec lists for when underrun recovery must be disabled is "COG;" that note actually refers to eDP multi-segmented operation (MSO). Let's ensure the this additional restriction is honored by the driver. Bspec: 50351 Cc: Ville Syrjälä Fixes: ba3b049f4774 ("drm/i915/adl_p: Allow underrun recovery when possible") Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210816204112.2960624-1-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza (cherry picked from commit c00e14cd4d3fbc5469d6e367371f9e4786a08c03) Signed-off-by: Jani Nikula commit 37bf34e10ccf71667af5f89a645289796d2c92f4 Author: Kees Cook Date: Tue Aug 17 16:33:57 2021 -0700 drm/i915: Use designated initializers for init/exit table The kernel builds with -Werror=designated-init, and __designated_init is used by CONFIG_GCC_PLUGIN_RANDSTRUCT for automatically selected (all function pointer) structures. Include the field names in the init/exit table. Avoids warnings like: drivers/gpu/drm/i915/i915_module.c:59:4: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Fixes: a04ea6ae7c67 ("drm/i915: Use a table for i915_init/exit (v2)") Signed-off-by: Kees Cook Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210817233357.2379455-1-keescook@chromium.org (cherry picked from commit 90fd2194a0cc52eb7a61dfa6412a0e498c58c688) Signed-off-by: Jani Nikula commit d9cf3bd531844ffbfe94b16e417037a16efc988d Author: Pavel Begunkov Date: Mon Jul 19 11:53:00 2021 +0100 bio: fix page leak bio_add_hw_page failure __bio_iov_append_get_pages() doesn't put not appended pages on bio_add_hw_page() failure, so potentially leaking them, fix it. Also, do the same for __bio_iov_iter_get_pages(), even though it looks like it can't be triggered by userspace in this case. Fixes: 0512a75b98f8 ("block: Introduce REQ_OP_ZONE_APPEND") Cc: stable@vger.kernel.org # 5.8+ Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1edfa6a2ffd66d55e6345a477df5387d2c1415d0.1626653825.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4420f5b1be7b117330526f3eabd13d840f510b15 Author: Steven Rostedt (VMware) Date: Mon Aug 23 10:00:07 2021 -0400 tracing/doc: Fix table format in histogram code The addition of the buckets conversion for the histogram code, updated the documentation table of available conversions, but did not update the format to accommodate the extra size needed to cover the description. Link: https://lkml.kernel.org/r/20210823100007.71ce2ba9@oasis.local.home Reported-by: Stephen Rothwell Tested-by: Stephen Rothwell Signed-off-by: Steven Rostedt (VMware) commit 3f6e276270de935296caea6fb10a545f7388478b Author: Haibo Chen Date: Wed Aug 18 17:17:57 2021 +0800 dt-bindings: mmc: fsl-imx-esdhc: add a new compatible string Lack a compatible string "fsl,imx6sll-usdhc", so add it here. Signed-off-by: Haibo Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/1629278277-7313-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit d7428bc26fc767942c38d74b80299bcd4f01e7cb Author: Maxim Devaev Date: Sat Aug 21 16:40:04 2021 +0300 usb: gadget: f_hid: optional SETUP/SET_REPORT mode f_hid provides the OUT Endpoint as only way for receiving reports from the host. SETUP/SET_REPORT method is not supported, and this causes a number of compatibility problems with various host drivers, especially in the case of keyboard emulation using f_hid. - Some hosts do not support the OUT Endpoint and ignore it, so it becomes impossible for the gadget to receive a report from the host. In the case of a keyboard, the gadget loses the ability to receive the status of the LEDs. - Some BIOSes/UEFIs can't work with HID devices with the OUT Endpoint at all. This may be due to their bugs or incomplete implementation of the HID standard. For example, absolutely all Apple UEFIs can't handle the OUT Endpoint if it goes after IN Endpoint in the descriptor and require the reverse order (OUT, IN) which is a violation of the standard. Other hosts either do not initialize gadgets with a descriptor containing the OUT Endpoint completely (like some HP and DELL BIOSes and embedded firmwares like on KVM switches), or initialize them, but will not poll the IN Endpoint. This patch adds configfs option no_out_endpoint=1 to disable the OUT Endpoint and allows f_hid to receive reports from the host via SETUP/SET_REPORT. Previously, there was such a feature in f_hid, but it was replaced by the OUT Endpoint [1] in the commit 99c515005857 ("usb: gadget: hidg: register OUT INT endpoint for SET_REPORT"). So this patch actually returns the removed functionality while making it optional. For backward compatibility reasons, the OUT Endpoint mode remains the default behaviour. - The OUT Endpoint mode provides the report queue and reduces USB overhead (eliminating SETUP routine) on transmitting a report from the host. - If the SETUP/SET_REPORT mode is used, there is no report queue, so the userspace will only read last report. For classic HID devices like keyboards this is not a problem, since it's intended to transmit the status of the LEDs and only the last report is important. This mode provides better compatibility with strange and buggy host drivers. Both modes passed USBCV tests. Checking with the USB protocol analyzer also confirmed that everything is working as it should and the new mode ensures operability in all of the described cases. Link: https://www.spinics.net/lists/linux-usb/msg65494.html [1] Reviewed-by: Maciej Żenczykowski Acked-by: Felipe Balbi Signed-off-by: Maxim Devaev Link: https://lore.kernel.org/r/20210821134004.363217-1-mdevaev@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8c61951b372d83b426a66dafc9c4ac24b3ce3335 Merge: 96e9df335ae3c 2564a2d4418ba Author: Greg Kroah-Hartman Date: Tue Aug 24 15:39:01 2021 +0200 Merge tag 'soundwire-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 5.15-rc1 - Core has updates to support SoundWire mockup device (includes tag from asoc), improved error handling and slave status. - Drivers has update on Intel driver for new quriks and better handling of errors and suspend routines * tag 'soundwire-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: cadence: do not extend reset delay soundwire: intel: conditionally exit clock stop mode on system suspend soundwire: intel: skip suspend/resume/wake when link was not started soundwire: intel: fix potential race condition during power down soundwire: cadence: override PDI configurations to create loopback soundwire: cadence: add debugfs interface for PDI loopbacks soundwire: stream: don't program mockup device ports soundwire: bus: squelch error returned by mockup devices soundwire: add flag to ignore all command/control for mockup devices soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA soundwire: cadence: add paranoid check on self-clearing bits soundwire: dmi-quirks: add quirk for Intel 'Bishop County' NUC M15 soundwire: bus: update Slave status in sdw_clear_slave_status soundwire: cadence: Remove ret variable from sdw_cdns_irq() soundwire: bus: filter out more -EDATA errors on clock stop soundwire: dmi-quirks: add ull suffix for SoundWire _ADR values ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests ASoC: soc-acpi: tgl: add table for SoundWire mockup devices ASoC: soc-acpi: cnl: add table for SoundWire mockup devices ASoC: codecs: add SoundWire mockup device support commit bfadee4554c3782bfbc5943866bd2ad44d631e50 Author: Biju Das Date: Tue Aug 17 10:03:13 2021 +0100 dt-bindings: mmc: renesas,sdhi: Document RZ/G2L bindings Document RZ/G2L SDHI controller bindings. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210817090313.31858-3-biju.das.jz@bp.renesas.com Signed-off-by: Ulf Hansson commit 4aba5dc71eae041aa1a9240de10ad2e30e9f32dd Author: Biju Das Date: Tue Aug 17 10:03:12 2021 +0100 dt-bindings: mmc: renesas,sdhi: Fix dtbs-check warning Fix dtbs-check warning pinctrl-names:0:'default' was expected for r8a77470-iwg23s-sbc.dts file. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210817090313.31858-2-biju.das.jz@bp.renesas.com Signed-off-by: Ulf Hansson commit 96e9df335ae3c3529c10994b43ca83352083df27 Merge: c446e40ed388d 152a810eae03f Author: Greg Kroah-Hartman Date: Tue Aug 24 15:35:24 2021 +0200 Merge tag 'phy-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next Vinod writes: phy-for-5.15 - Updates: - Yaml conversion for Freescale imx8mq usb phy, TI AM654 SERDES phy, Cadence torrent phy - Updates for Amlogic Meson8b-usb2 phy, Samsung ufs phy - New support: - UFS phy for Qualcomm SM6115 - PCIe & USB/DP phy for Qualcomm sc8180x - USB3 PHY support for Qualcomm IPQ6018 - Renesas USB2.0 PHY for RZ/G2L * tag 'phy-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (45 commits) phy: qcom-qmp: Add support for SM6115 UFS phy dt-bindings: phy: qcom,qmp: Add SM6115 UFS PHY bindings phy: qmp: Provide unique clock names for DP clocks phy: xilinx: zynqmp: skip PHY initialization and PLL lock for USB phy: amlogic: meson8b-usb2: don't log an error on -EPROBE_DEFER phy: amlogic: meson8b-usb2: Power off the PHY by putting it into reset mode phy: phy-mtk-mipi-dsi: convert to devm_platform_ioremap_resource phy: phy-mtk-mipi-dsi: remove dummy assignment of error number phy: phy-mtk-hdmi: convert to devm_platform_ioremap_resource phy: phy-mtk-ufs: use clock bulk to get clocks phy: phy-mtk-tphy: remove error log of ioremap failure phy: phy-mtk-tphy: print error log using child device phy: phy-mtk-tphy: support type switch by pericfg phy: phy-mtk-tphy: use clock bulk to get clocks dt-bindings: phy: mediatek: tphy: support type switch by pericfg phy: cadence-torrent: Check PIPE mode PHY status to be ready for operation phy: cadence-torrent: Add debug information for PHY configuration phy: cadence-torrent: Add separate functions for reusable code phy: cadence-torrent: Add PHY configuration for DP with 100MHz ref clock phy: cadence-torrent: Add PHY registers for DP in array format ... commit c446e40ed388d98157891dd5edc1d98212a13d78 Merge: 637d0957516ee 8bf5d31c4f06d Author: Greg Kroah-Hartman Date: Tue Aug 24 15:33:04 2021 +0200 Merge tag 'icc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 5.15 Here are changes for the 5.15-rc1 merge window consisting of interconnect core and driver updates. Framework change: - Add sanity check to detect if node is already added to provider. Driver changes: - RPMh drivers probe function consolidation - Add driver for SC8180x platforms - Add support for SC8180x OSM L3 - Use driver-specific naming in OSM L3 Signed-off-by: Georgi Djakov * tag 'icc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: osm-l3: Use driver-specific naming interconnect: qcom: osm-l3: Add sc8180x support dt-bindings: interconnect: Add SC8180x to OSM L3 DT binding interconnect: qcom: Add SC8180x providers dt-bindings: interconnect: Add Qualcomm SC8180x DT bindings interconnect: Sanity check that node isn't already on list interconnect: qcom: icc-rpmh: Consolidate probe functions commit bfa109d761a46d5116f3d4f216152653d8b4815b Merge: 85fb1a27b128f 42716425ad7e1 Author: Greg Kroah-Hartman Date: Tue Aug 24 15:31:33 2021 +0200 Merge tag 'thunderbolt-for-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.15 merge window This includes following Thunderbolt/USB4 changes for the v5.15 merge window: * Include authorized value in the KOBJ_CHANGE event of a device router * A couple of improvements to get the driver working also with the AMD USB4 host controller. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix port linking by checking all adapters thunderbolt: Do not read control adapter config space thunderbolt: Handle ring interrupt by reading interrupt status register thunderbolt: Add vendor specific NHI quirk for auto-clearing interrupt status thunderbolt: Add authorized value to the KOBJ_CHANGE uevent commit 637d0957516eef3e861ca5889912c3234a9b593f Merge: b2159182dd498 e22ce8eb631bd Author: Greg Kroah-Hartman Date: Tue Aug 24 15:24:21 2021 +0200 Merge 5.14-rc7 into char-misc-next We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 85fb1a27b128f6404cb9a08f3a4a094e92a78ac0 Merge: e4788edc730a0 e22ce8eb631bd Author: Greg Kroah-Hartman Date: Tue Aug 24 15:21:10 2021 +0200 Merge 5.14-rc7 into usb-next We need the USB fix in here as well. Signed-off-by: Greg Kroah-Hartman commit 291ee9d5da535f8c72408850a413074c4719c8d3 Author: Mårten Lindahl Date: Mon Aug 16 17:30:54 2021 +0200 mmc: core: Update ->card_busy() callback comment According to SD specification checking state of DAT0 only, is enough while polling for card busy completion. Let's update the comment in the header file to correct this, as the comment says DAT[0:3]. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20210816153054.24082-1-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit 4850c225dd0e82c8aff8fe4bddc183c37551ede9 Author: Mårten Lindahl Date: Mon Aug 16 16:23:14 2021 +0200 mmc: usdhi6rol0: Implement card_busy function When switching card voltage to UHS voltage the mmc framework tries to check the card busy signal, meaning the card pulling DAT0 line low, before the switch is made. Drivers that does not implement the card_busy function will manage to do the switch anyway, but the framework will print a warning about not being able to verify the voltage signal. Implement card_busy function. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20210816142314.1168-1-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit 0eb596f1e6103ebe122792a425b88c5dc21c4087 Author: Fabiano Rosas Date: Thu Aug 5 18:26:16 2021 -0300 KVM: PPC: Book3S HV: Stop exporting symbols from book3s_64_mmu_radix The book3s_64_mmu_radix.o object is not part of the KVM builtins and all the callers of the exported symbols are in the same kvm-hv.ko module so we should not need to export any symbols. Signed-off-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210805212616.2641017-4-farosas@linux.ibm.com commit c232461c0c3b0aca637f0d7658a7f5d0bb393a4e Author: Fabiano Rosas Date: Thu Aug 5 18:26:15 2021 -0300 KVM: PPC: Book3S HV: Add sanity check to copy_tofrom_guest Both paths into __kvmhv_copy_tofrom_guest_radix ensure that we arrive with an effective address that is smaller than our total addressable space and addresses quadrant 0. - The H_COPY_TOFROM_GUEST hypercall path rejects the call with H_PARAMETER if the effective address has any of the twelve most significant bits set. - The kvmhv_copy_tofrom_guest_radix path clears the top twelve bits before calling the internal function. Although the callers make sure that the effective address is sane, any future use of the function is exposed to a programming error, so add a sanity check. Suggested-by: Nicholas Piggin Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210805212616.2641017-3-farosas@linux.ibm.com commit 5d7d6dac8fe99ed59eee2300e4a03370f94d5222 Author: Fabiano Rosas Date: Thu Aug 5 18:26:14 2021 -0300 KVM: PPC: Book3S HV: Fix copy_tofrom_guest routines The __kvmhv_copy_tofrom_guest_radix function was introduced along with nested HV guest support. It uses the platform's Radix MMU quadrants to provide a nested hypervisor with fast access to its nested guests memory (H_COPY_TOFROM_GUEST hypercall). It has also since been added as a fast path for the kvmppc_ld/st routines which are used during instruction emulation. The commit def0bfdbd603 ("powerpc: use probe_user_read() and probe_user_write()") changed the low level copy function from raw_copy_from_user to probe_user_read, which adds a check to access_ok. In powerpc that is: static inline bool __access_ok(unsigned long addr, unsigned long size) { return addr < TASK_SIZE_MAX && size <= TASK_SIZE_MAX - addr; } and TASK_SIZE_MAX is 0x0010000000000000UL for 64-bit, which means that setting the two MSBs of the effective address (which correspond to the quadrant) now cause access_ok to reject the access. This was not caught earlier because the most common code path via kvmppc_ld/st contains a fallback (kvm_read_guest) that is likely to succeed for L1 guests. For nested guests there is no fallback. Another issue is that probe_user_read (now __copy_from_user_nofault) does not return the number of bytes not copied in case of failure, so the destination memory is not being cleared anymore in kvmhv_copy_from_guest_radix: ret = kvmhv_copy_tofrom_guest_radix(vcpu, eaddr, to, NULL, n); if (ret > 0) <-- always false! memset(to + (n - ret), 0, ret); This patch fixes both issues by skipping access_ok and open-coding the low level __copy_to/from_user_inatomic. Fixes: def0bfdbd603 ("powerpc: use probe_user_read() and probe_user_write()") Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210805212616.2641017-2-farosas@linux.ibm.com commit 86842d255b45fc2103da1cd202f5064397ed41f8 Author: Marek Vasut Date: Thu Aug 19 22:20:36 2021 +0200 clk: imx8mn: Add M7 core clock Add missing M7 core clock entry to the iMX8MN clock driver. Signed-off-by: Marek Vasut Reviewed-by: Abel Vesa Reviewed-by: Fabio Estevam Cc: Abel Vesa Cc: Fabio Estevam Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo Link: https://lore.kernel.org/r/20210819202036.2084782-1-marex@denx.de Signed-off-by: Abel Vesa commit d36207b848a6490e14664e2197a1c8ab51d8148e Author: Ahmad Fatoum Date: Tue Aug 10 17:14:33 2021 +0200 clk: imx8m: fix clock tree update of TF-A managed clocks On the i.MX8M*, the TF-A exposes a SiP (Silicon Provider) service for DDR frequency scaling. The imx8m-ddrc-devfreq driver calls the SiP and then does clk_set_parent on the DDR muxes to synchronize the clock tree. Since 936c383673b9 ("clk: imx: fix composite peripheral flags"), these TF-A managed muxes have SET_PARENT_GATE set, which results in imx8m-ddrc-devfreq's clk_set_parent after SiP failing with -EBUSY: echo 25000000 > userspace/set_freq imx8m-ddrc-devfreq 3d400000.memory-controller: failed to set dram_apb parent: -16 Fix this by adding a new i.MX composite flag for firmware managed clocks, which clears SET_PARENT_GATE. This is safe to do, because updating the Linux clock tree to reflect reality will always be glitch-free. Fixes: 936c383673b9 ("clk: imx: fix composite peripheral flags") Signed-off-by: Ahmad Fatoum Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20210810151432.9228-1-a.fatoum@pengutronix.de Signed-off-by: Abel Vesa commit fb549644eeb116c6de8c988bf05f136ee969606f Author: Martin Blumenstingl Date: Sat Jul 3 00:51:41 2021 +0200 clk: imx: clk-divider-gate: Switch to clk_divider.determine_rate .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Guenter Roeck Cc: Abel Vesa Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Martin Blumenstingl Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20210702225145.2643303-3-martin.blumenstingl@googlemail.com Signed-off-by: Abel Vesa commit 8ee749ec7fc6f9355f89d170c4f6805be011b2a9 Author: Lucas Stach Date: Mon Jun 28 23:15:54 2021 +0200 clk: imx8mn: use correct mux type for clkout path The mux in the clkout path needs the current selected parent to be enabled for the switch to work. Use the correct mux type to have the clk framework take care of this requirement. Fixes: af4df655040 ("clk: imx8mn: add clkout1/2 support") Signed-off-by: Lucas Stach Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20210628211554.2510238-2-l.stach@pengutronix.de Signed-off-by: Abel Vesa commit 1822b4dedc4d8cab96fd1d87bf8ff98194e29d9b Author: Lucas Stach Date: Mon Jun 28 23:15:53 2021 +0200 clk: imx8mm: use correct mux type for clkout path The mux in the clkout path needs the current selected parent to be enabled for the switch to work. Use the correct mux type to have the clk framework take care of this requirement. Fixes: c1ae5c6f789a ("clk: imx8mm: add clkout1/2 support") Signed-off-by: Lucas Stach Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20210628211554.2510238-1-l.stach@pengutronix.de Signed-off-by: Abel Vesa commit f4ff24f8a7c144e6d2107a2f2d16bcd9e2b2578f Author: Haibo Chen Date: Fri Aug 13 20:34:01 2021 +0800 mmc: sdhci: Correct the tuning command handle for PIO mode If sdhci use PIO mode, and use mmc_send_tuning() to send the tuning command, system will stuck because of the storm irq of sdhci. For PIO mode, use mmc_send_tuning(), it will trigger buffer_read_ready interrupt and data transfer complete interrupt. In current code logic, it will directly return in sdhci_data_irq, can not call the sdhci_transfer_pio(). So the buffer_read_ready interrupt storm happen. So for standard tuning method, need to exclude this case. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1628858041-1911-1-git-send-email-haibo.chen@nxp.com [Ulf: Dropped redundant parenthesis in an expression] Signed-off-by: Ulf Hansson commit c4b2b7d150d2b155b317b3e2f66492c6befab2b5 Author: Christoph Hellwig Date: Tue Aug 24 09:52:16 2021 +0200 block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT This might have been a neat debug aid when the extended dev_t was added, but that time is long gone. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210824075216.1179406-3-hch@lst.de Signed-off-by: Jens Axboe commit 539711d7d6fe382a73254cc966602e63242a6fb3 Author: Christoph Hellwig Date: Tue Aug 24 09:52:15 2021 +0200 block: remove a pointless call to MINOR() in device_add_disk blk_alloc_ext_minor already returns just a minor number, so no need to mask the high bits. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210824075216.1179406-2-hch@lst.de Signed-off-by: Jens Axboe commit f0a64199195e5adfff921cb7bf4e4e67e1916401 Author: Yangyang Li Date: Thu Aug 19 09:36:20 2021 +0800 RDMA/hns: Delete unused hns bitmap interface The resources that use the hns bitmap interface: qp, cq, mr, pd, xrcd, uar, srq, have been changed to IDA interfaces, and the unused hns' own bitmap interfaces need to be deleted. Link: https://lore.kernel.org/r/1629336980-17499-4-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit c4f11b36f817cf76d58a86b2aadcd8e66eda6047 Author: Yangyang Li Date: Thu Aug 19 09:36:19 2021 +0800 RDMA/hns: Use IDA interface to manage srq index Switch srq index allocation and release from hns' own bitmap interface to IDA interface. Link: https://lore.kernel.org/r/1629336980-17499-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 8feafd9017ba5b01c3ea256b59ac2c867a762659 Author: Yangyang Li Date: Thu Aug 19 09:36:18 2021 +0800 RDMA/hns: Use IDA interface to manage uar index Switch uar index allocation and release from hns' own bitmap interface to IDA interface. Link: https://lore.kernel.org/r/1629336980-17499-2-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 2949e8427af3bb74a1e26354cb68c1700663c827 Author: Lukas Bulwahn Date: Tue Aug 24 13:12:59 2021 +0200 fs: clean up after mandatory file locking support removal Commit 3efee0567b4a ("fs: remove mandatory file locking support") removes some operations in functions rw_verify_area(). As these functions are now simplified, do some syntactic clean-up as follow-up to the removal as well, which was pointed out by compiler warnings and static analysis. No functional change. Signed-off-by: Lukas Bulwahn Signed-off-by: Jeff Layton commit 18a9eae240cb24d4771fed746c70662c0926a9e8 Author: Heiner Kallweit Date: Tue Aug 24 08:23:20 2021 +0200 r8169: enable ASPM L0s state ASPM is disabled completely because we've seen different types of problems in the past. However it seems these problems occurred with L1 or L1 sub-states only. On all the chip versions I've seen the acceptable L0s exit latency is 512ns. This should be short enough not to cause problems. If the actual L0s exit latency of the PCIe link is bigger than 512ns then the PCI core will disable L0s anyway. So let's give it a try and disable L1 and L1 sub-states only. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7fb9b66dc9ce52b058b3f9f3016b4d39f692c3b9 Author: Yunsheng Lin Date: Tue Aug 24 17:06:49 2021 +0800 page_pool: use relaxed atomic for release side accounting There is no need to synchronize the account updating, so use the relaxed atomic to avoid some memory barrier in the data path. Acked-by: Jesper Dangaard Brouer Signed-off-by: Yunsheng Lin Acked-by: Ilias Apalodimas Signed-off-by: David S. Miller commit 5b3fd8aa5df0244fc19f2572598dee406bcc6b07 Author: Jing Yangyang Date: Tue Aug 24 00:05:15 2021 -0700 x86/kaslr: Have process_mem_region() return a boolean Fix the following coccicheck warning: ./arch/x86/boot/compressed/kaslr.c:671:10-11:WARNING:return of 0/1 in function 'process_mem_region' with return type bool Generated by: scripts/coccinelle/misc/boolreturn.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210824070515.61065-1-deng.changcheng@zte.com.cn commit 3bff147b187d5dfccfca1ee231b0761a89f1eff5 Author: Borislav Petkov Date: Mon Aug 23 17:31:29 2021 -0700 x86/mce: Defer processing of early errors When a fatal machine check results in a system reset, Linux does not clear the error(s) from machine check bank(s) - hardware preserves the machine check banks across a warm reset. During initialization of the kernel after the reboot, Linux reads, logs, and clears all machine check banks. But there is a problem. In: 5de97c9f6d85 ("x86/mce: Factor out and deprecate the /dev/mcelog driver") the call to mce_register_decode_chain() moved later in the boot sequence. This means that /dev/mcelog doesn't see those early error logs. This was partially fixed by: cd9c57cad3fe ("x86/MCE: Dump MCE to dmesg if no consumers") which made sure that the logs were not lost completely by printing to the console. But parsing console logs is error prone. Users of /dev/mcelog should expect to find any early errors logged to standard places. Add a new flag MCP_QUEUE_LOG to machine_check_poll() to be used in early machine check initialization to indicate that any errors found should just be queued to genpool. When mcheck_late_init() is called it will call mce_schedule_work() to actually log and flush any errors queued in the genpool. [ Based on an original patch, commit message by and completely productized by Tony Luck. ] Fixes: 5de97c9f6d85 ("x86/mce: Factor out and deprecate the /dev/mcelog driver") Reported-by: Sumanth Kamatala Signed-off-by: Borislav Petkov Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210824003129.GA1642753@agluck-desk2.amr.corp.intel.com commit 669f047ec12624e1fa07e0df88a84104b1d4dcd9 Merge: 0384dd9d2d807 58adf9dcb15b9 Author: David S. Miller Date: Tue Aug 24 09:30:58 2021 +0100 Merge branch 'dsa-sw-bridging' Vladimir Oltean says: ==================== Plug holes in DSA's software bridging support Changes in v2: - Make sure that leaving an unoffloaded bridge works well too - Remove a set but unused variable - Tweak a commit message This series addresses some oddities reported by Alvin while he was working on the new rtl8365mb driver (a driver which does not implement bridge offloading for now, and relies on software bridging). First is that DSA behaves, in the lack of a .port_bridge_join method, as if the operation succeeds, and does not kick off its internal procedures for software bridging (the same procedures that were written for indirect software bridging, meaning bridging with an unoffloaded software LAG). Second is that even after being patched to treat ports with software bridging as standalone, we still don't get rid of bridge VLANs, even though we have code to ignore them, that code manages to get bypassed. This is in fact a recurring issue which was brought up by Tobias Waldekranz a while ago, but the solution never made it to the git tree. After debugging with Florian the last time: https://patchwork.kernel.org/project/netdevbpf/patch/20210320225928.2481575-3-olteanv@gmail.com/ I became very concerned about sending these patches to stable kernels. They are relatively large reworks, and they are only tested properly on net-next. A few commands on my test vehicle which has ds->vlan_filtering_is_global set to true: | Nothing is committed to hardware when we add VLAN 100 on a standalone | port $ ip link add link sw0p2 name sw0p2.100 type vlan id 100 | When a neighbor port joins a VLAN-aware bridge, VLAN filtering gets | enabled globally on the switch. This replays the VLAN 100 from | sw0p2.100 and also installs VLAN 1 from the bridge on sw0p0. $ ip link add br0 type bridge vlan_filtering 1 && ip link set sw0p0 master br0 [ 97.948087] sja1105 spi2.0: Reset switch and programmed static config. Reason: VLAN filtering [ 97.957989] sja1105 spi2.0: sja1105_bridge_vlan_add: port 2 vlan 100 [ 97.964442] sja1105 spi2.0: sja1105_bridge_vlan_add: port 4 vlan 100 [ 97.971202] device sw0p0 entered promiscuous mode [ 97.976129] sja1105 spi2.0: sja1105_bridge_vlan_add: port 0 vlan 1 [ 97.982640] sja1105 spi2.0: sja1105_bridge_vlan_add: port 4 vlan 1 | We can see that sw0p2, the standalone port, is now filtering because | of the bridge $ ethtool -k sw0p2 | grep vlan rx-vlan-filter: on [fixed] | When we make the bridge VLAN-unaware, the 8021q upper sw0p2.100 is | uncomitted from hardware. The VLANs managed by the bridge still remain | committed to hardware, because they are managed by the bridge. $ ip link set br0 type bridge vlan_filtering 0 [ 134.218869] sja1105 spi2.0: Reset switch and programmed static config. Reason: VLAN filtering [ 134.228913] sja1105 spi2.0: sja1105_bridge_vlan_del: port 2 vlan 100 | And now the standalone port is not filtering anymore. ethtool -k sw0p2 | grep vlan rx-vlan-filter: off [fixed] The same test with .port_bridge_join and .port_bridge_leave commented out from this driver: | Not a flinch $ ip link add link sw0p2 name sw0p2.100 type vlan id 100 $ ip link add br0 type bridge vlan_filtering 1 && ip link set sw0p0 master br0 Warning: dsa_core: Offloading not supported. $ ethtool -k sw0p2 | grep vlan rx-vlan-filter: off [fixed] $ ip link set br0 type bridge vlan_filtering 0 $ ethtool -k sw0p2 | grep vlan rx-vlan-filter: off [fixed] ==================== Signed-off-by: David S. Miller commit 58adf9dcb15b99f047e80e10c85fb51ed3c88215 Author: Vladimir Oltean Date: Tue Aug 24 00:22:58 2021 +0300 net: dsa: let drivers state that they need VLAN filtering while standalone As explained in commit e358bef7c392 ("net: dsa: Give drivers the chance to veto certain upper devices"), the hellcreek driver uses some tricks to comply with the network stack expectations: it enforces port separation in standalone mode using VLANs. For untagged traffic, bridging between ports is prevented by using different PVIDs, and for VLAN-tagged traffic, it never accepts 8021q uppers with the same VID on two ports, so packets with one VLAN cannot leak from one port to another. That is almost fine*, and has worked because hellcreek relied on an implicit behavior of the DSA core that was changed by the previous patch: the standalone ports declare the 'rx-vlan-filter' feature as 'on [fixed]'. Since most of the DSA drivers are actually VLAN-unaware in standalone mode, that feature was actually incorrectly reflecting the hardware/driver state, so there was a desire to fix it. This leaves the hellcreek driver in a situation where it has to explicitly request this behavior from the DSA framework. We configure the ports as follows: - Standalone: 'rx-vlan-filter' is on. An 8021q upper on top of a standalone hellcreek port will go through dsa_slave_vlan_rx_add_vid and will add a VLAN to the hardware tables, giving the driver the opportunity to refuse it through .port_prechangeupper. - Bridged with vlan_filtering=0: 'rx-vlan-filter' is off. An 8021q upper on top of a bridged hellcreek port will not go through dsa_slave_vlan_rx_add_vid, because there will not be any attempt to offload this VLAN. The driver already disables VLAN awareness, so that upper should receive the traffic it needs. - Bridged with vlan_filtering=1: 'rx-vlan-filter' is on. An 8021q upper on top of a bridged hellcreek port will call dsa_slave_vlan_rx_add_vid, and can again be vetoed through .port_prechangeupper. *It is not actually completely fine, because if I follow through correctly, we can have the following situation: ip link add br0 type bridge vlan_filtering 0 ip link set lan0 master br0 # lan0 now becomes VLAN-unaware ip link set lan0 nomaster # lan0 fails to become VLAN-aware again, therefore breaking isolation This patch fixes that corner case by extending the DSA core logic, based on this requested attribute, to change the VLAN awareness state of the switch (port) when it leaves the bridge. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 06cfb2df7eb0da54a37d37732665a1993244c25f Author: Vladimir Oltean Date: Tue Aug 24 00:22:57 2021 +0300 net: dsa: don't advertise 'rx-vlan-filter' when not needed There have been multiple independent reports about dsa_slave_vlan_rx_add_vid being called (and consequently calling the drivers' .port_vlan_add) when it isn't needed, and sometimes (not always) causing problems in the process. Case 1: mv88e6xxx_port_vlan_prepare is stubborn and only accepts VLANs on bridged ports. That is understandably so, because standalone mv88e6xxx ports are VLAN-unaware, and VTU entries are said to be a scarce resource. Otherwise said, the following fails lamentably on mv88e6xxx: ip link add br0 type bridge vlan_filtering 1 ip link set lan3 master br0 ip link add link lan10 name lan10.1 type vlan id 1 [485256.724147] mv88e6085 d0032004.mdio-mii:12: p10: hw VLAN 1 already used by port 3 in br0 RTNETLINK answers: Operation not supported This has become a worse issue since commit 9b236d2a69da ("net: dsa: Advertise the VLAN offload netdev ability only if switch supports it"). Up to that point, the driver was returning -EOPNOTSUPP and DSA was reconverting that error to 0, making the 8021q upper think all is ok (but obviously the error message was there even prior to this change). After that change the -EOPNOTSUPP is propagated to vlan_vid_add, and it is a hard error. Case 2: Ports that don't offload the Linux bridge (have a dp->bridge_dev = NULL because they don't implement .port_bridge_{join,leave}). Understandably, a standalone port should not offload VLANs either, it should remain VLAN unaware and any VLAN should be a software VLAN (as long as the hardware is not quirky, that is). In fact, dsa_slave_port_obj_add does do the right thing and rejects switchdev VLAN objects coming from the bridge when that bridge is not offloaded: case SWITCHDEV_OBJ_ID_PORT_VLAN: if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) return -EOPNOTSUPP; err = dsa_slave_vlan_add(dev, obj, extack); But it seems that the bridge is able to trick us. The __vlan_vid_add from br_vlan.c has: /* Try switchdev op first. In case it is not supported, fallback to * 8021q add. */ err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); if (err == -EOPNOTSUPP) return vlan_vid_add(dev, br->vlan_proto, v->vid); So it says "no, no, you need this VLAN in your life!". And we, naive as we are, say "oh, this comes from the vlan_vid_add code path, it must be an 8021q upper, sure, I'll take that". And we end up with that bridge VLAN installed on our port anyway. But this time, it has the wrong flags: if the bridge was trying to install VLAN 1 as a pvid/untagged VLAN, failed via switchdev, retried via vlan_vid_add, we have this comment: /* This API only allows programming tagged, non-PVID VIDs */ So what we do makes absolutely no sense. Backtracing a bit, we see the common pattern. We allow the network stack to think that our standalone ports are VLAN-aware, but they aren't, for the vast majority of switches. The quirky ones should not dictate the norm. The dsa_slave_vlan_rx_add_vid and dsa_slave_vlan_rx_kill_vid methods exist for drivers that need the 'rx-vlan-filter: on' feature in ethtool -k, which can be due to any of the following reasons: 1. vlan_filtering_is_global = true, and some ports are under a VLAN-aware bridge while others are standalone, and the standalone ports would otherwise drop VLAN-tagged traffic. This is described in commit 061f6a505ac3 ("net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation"). 2. the ports that are under a VLAN-aware bridge should also set this feature, for 8021q uppers having a VID not claimed by the bridge. In this case, the driver will essentially not even know that the VID is coming from the 8021q layer and not the bridge. 3. Hellcreek. This driver needs it because in standalone mode, it uses unique VLANs per port to ensure separation. For separation of untagged traffic, it uses different PVIDs for each port, and for separation of VLAN-tagged traffic, it never accepts 8021q uppers with the same vid on two ports. If a driver does not fall under any of the above 3 categories, there is no reason why it should advertise the 'rx-vlan-filter' feature, therefore no reason why it should offload the VLANs added through vlan_vid_add. This commit fixes the problem by removing the 'rx-vlan-filter' feature from the slave devices when they operate in standalone mode, and when they offload a VLAN-unaware bridge. The way it works is that vlan_vid_add will now stop its processing here: vlan_add_rx_filter_info: if (!vlan_hw_filter_capable(dev, proto)) return 0; So the VLAN will still be saved in the interface's VLAN RX filtering list, but because it does not declare VLAN filtering in its features, the 8021q module will return zero without committing that VLAN to hardware. This gives the drivers what they want, since it keeps the 8021q VLANs away from the VLAN table until VLAN awareness is enabled (point at which the ports are no longer standalone, hence in the mv88e6xxx case, the check in mv88e6xxx_port_vlan_prepare passes). Since the issue predates the existence of the hellcreek driver, case 3 will be dealt with in a separate patch. The main change that this patch makes is to no longer set NETIF_F_HW_VLAN_CTAG_FILTER unconditionally, but toggle it dynamically (for most switches, never). The second part of the patch addresses an issue that the first part introduces: because the 'rx-vlan-filter' feature is now dynamically toggled, and our .ndo_vlan_rx_add_vid does not get called when 'rx-vlan-filter' is off, we need to avoid bugs such as the following by replaying the VLANs from 8021q uppers every time we enable VLAN filtering: ip link add link lan0 name lan0.100 type vlan id 100 ip addr add 192.168.100.1/24 dev lan0.100 ping 192.168.100.2 # should work ip link add br0 type bridge vlan_filtering 0 ip link set lan0 master br0 ping 192.168.100.2 # should still work ip link set br0 type bridge vlan_filtering 1 ping 192.168.100.2 # should still work but doesn't As reported by Florian, some drivers look at ds->vlan_filtering in their .port_vlan_add() implementation. So this patch also makes sure that ds->vlan_filtering is committed before calling the driver. This is the reason why it is first committed, then restored on the failure path. Reported-by: Tobias Waldekranz Reported-by: Alvin Šipraga Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: David S. Miller commit 67b5fb5db76dbbdbd7bbed220134c7be4217aed9 Author: Vladimir Oltean Date: Tue Aug 24 00:22:56 2021 +0300 net: dsa: properly fall back to software bridging If the driver does not implement .port_bridge_{join,leave}, then we must fall back to standalone operation on that port, and trigger the error path of dsa_port_bridge_join. This sets dp->bridge_dev = NULL. In turn, having a non-NULL dp->bridge_dev when there is no offloading support makes the following things go wrong: - dsa_default_offload_fwd_mark make the wrong decision in setting skb->offload_fwd_mark. It should set skb->offload_fwd_mark = 0 for ports that don't offload the bridge, which should instruct the bridge to forward in software. But this does not happen, dp->bridge_dev is incorrectly set to point to the bridge, so the bridge is told that packets have been forwarded in hardware, which they haven't. - switchdev objects (MDBs, VLANs) should not be offloaded by ports that don't offload the bridge. Standalone ports should behave as packet-in, packet-out and the bridge should not be able to manipulate the pvid of the port, or tag stripping on egress, or ingress filtering. This should already work fine because dsa_slave_port_obj_add has: case SWITCHDEV_OBJ_ID_PORT_VLAN: if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) return -EOPNOTSUPP; err = dsa_slave_vlan_add(dev, obj, extack); but since dsa_port_offloads_bridge_port works based on dp->bridge_dev, this is again sabotaging us. All the above work in case the port has an unoffloaded LAG interface, so this is well exercised code, we should apply it for plain unoffloaded bridge ports too. Reported-by: Alvin Šipraga Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 09dba21b432a13369d6d600941c4902237218f20 Author: Vladimir Oltean Date: Tue Aug 24 00:22:55 2021 +0300 net: dsa: don't call switchdev_bridge_port_unoffload for unoffloaded bridge ports For ports that have a NULL dp->bridge_dev, dsa_port_to_bridge_port() also returns NULL as expected. Issue #1 is that we are performing a NULL pointer dereference on brport_dev. Issue #2 is that these are ports on which switchdev_bridge_port_offload has not been called, so we should not call switchdev_bridge_port_unoffload on them either. Both issues are addressed by checking against a NULL brport_dev in dsa_port_pre_bridge_leave and exiting early. Fixes: 2f5dc00f7a3e ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f5a4c24e689f54e66201f04d343bdd2e8a1d7923 Author: Lorenzo Bianconi Date: Mon Aug 23 20:02:39 2021 +0200 mac80211: introduce individual TWT support in AP mode Introduce TWT action frames parsing support to mac80211. Currently just individual TWT agreement are support in AP mode. Whenever the AP receives a TWT action frame from an associated client, after performing sanity checks, it will notify the underlay driver with requested parameters in order to check if they are supported and if there is enough room for a new agreement. The driver is expected to set the agreement result and report it to mac80211. Drivers supporting this have two new callbacks: - add_twt_setup (mandatory) - twt_teardown_request (optional) mac80211 will send an action frame reply according to the result reported by the driver. Tested-by: Peter Chiu Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/257512f2e22ba42b9f2624942a128dd8f141de4b.1629741512.git.lorenzo@kernel.org [use le16p_replace_bits(), minor cleanups, use (void *) casts, fix to use ieee80211_get_he_iftype_cap() correctly] Signed-off-by: Johannes Berg commit 0384dd9d2d807b7d1470ce0abd549b8855037f99 Merge: faf482ca196a5 33c563ad28e3b Author: David S. Miller Date: Tue Aug 24 09:28:29 2021 +0100 Merge branch 'mptcp-refactor' Mat Martineau says: ==================== mptcp: Refactor ADD_ADDR/RM_ADDR handling This patch set changes the way MPTCP ADD_ADDR and RM_ADDR options are handled to improve the reliability of sending and updating address advertisements. The information used to populate outgoing advertisement option headers is now stored separately to avoid rare cases where a more recent request would overwrite something that had not been sent yet. While the peers would recover from this, it's better to avoid the problem in the first place. Patch 1 moves an advertisement option check under a lock so the changes made in the next several patches will not introduce a race. Patches 2-4 make sure ADD_ADDR, ADD_ADDR echo, and RM_ADDR options use separate flags and data. Patch 5 removes some now-redundant flags. Patch 6 adds a selftest that confirms the advertisement reliability improvements. ==================== Signed-off-by: David S. Miller commit 33c563ad28e3bf614c82450fbf83a7c3c203db87 Author: Yonglong Li Date: Mon Aug 23 18:05:44 2021 -0700 selftests: mptcp: add_addr and echo race test This patch added an extra test for the singal_address_tests() to do the ADD_ADDR and ADD_ADDR_ECHO race test. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit c233ef13907038239303a73ca0565bcc3f3373bc Author: Yonglong Li Date: Mon Aug 23 18:05:43 2021 -0700 mptcp: remove MPTCP_ADD_ADDR_IPV6 and MPTCP_ADD_ADDR_PORT MPTCP_ADD_ADDR_IPV6 and MPTCP_ADD_ADDR_PORT are not necessary, we can get these info from pm.local or pm.remote. Drop mptcp_pm_should_add_signal_ipv6 and mptcp_pm_should_add_signal_port too. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f462a446384d0c00c6e457f7e8eb2053b095a2f1 Author: Yonglong Li Date: Mon Aug 23 18:05:42 2021 -0700 mptcp: build ADD_ADDR/echo-ADD_ADDR option according pm.add_signal According to the MPTCP_ADD_ADDR_SIGNAL or MPTCP_ADD_ADDR_ECHO flag, build the ADD_ADDR/ADD_ADDR_ECHO option. In mptcp_pm_add_addr_signal(), use opts->addr to save the announced ADD_ADDR or ADD_ADDR_ECHO address. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 119c022096f5805680c79dfa74e15044c289856d Author: Yonglong Li Date: Mon Aug 23 18:05:41 2021 -0700 mptcp: fix ADD_ADDR and RM_ADDR maybe flush addr_signal each other ADD_ADDR shares pm.addr_signal with RM_ADDR, so after RM_ADDR/ADD_ADDR has done, we should not clean ADD_ADDR/RM_ADDR's addr_signal. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 18fc1a922e2416998c5d37c26c69aab940c07ffb Author: Yonglong Li Date: Mon Aug 23 18:05:40 2021 -0700 mptcp: make MPTCP_ADD_ADDR_SIGNAL and MPTCP_ADD_ADDR_ECHO separate Use MPTCP_ADD_ADDR_SIGNAL only for the action of sending ADD_ADDR, and use MPTCP_ADD_ADDR_ECHO only for the action of sending ADD_ADDR echo. Use msk->pm.local to save the announced ADD_ADDR address only, and reuse msk->pm.remote to save the announced ADD_ADDR_ECHO address. To prepare for the next patch. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1f5e9e2f5fd55fbf9b58ae6fefb021ad1c91b66a Author: Yonglong Li Date: Mon Aug 23 18:05:39 2021 -0700 mptcp: move drop_other_suboptions check under pm lock This patch moved the drop_other_suboptions check from mptcp_established_options_add_addr() into mptcp_pm_add_addr_signal(), do it under the PM lock to avoid the race between this check and mptcp_pm_add_addr_signal(). For this, added a new parameter for mptcp_pm_add_addr_signal() to get the drop_other_suboptions value. And drop the other suboptions after the option length check if drop_other_suboptions is true. Additionally, always drop the other suboption for TCP pure ack: that makes both the code simpler and the MPTCP behaviour more consistent. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit faf482ca196a5b16007190529b3b2dd32ab3f761 Author: Yajun Deng Date: Mon Aug 23 11:17:59 2021 +0800 net: ipv4: Move ip_options_fragment() out of loop The ip_options_fragment() only called when iter->offset is equal to zero, so move it out of loop, and inline 'Copy the flags to each fragment.' As also, remove the unused parameter in ip_frag_ipcb(). Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 1bb39cb65bcf6c7ef079c57c64041f60155e5f21 Author: Heiner Kallweit Date: Sun Aug 22 19:20:42 2021 +0200 cxgb4: improve printing NIC information Currently the interface name and PCI address are printed twice, because netdev_info() is printing this information implicitly already. This results in messages like the following. remove the duplicated information. cxgb4 0000:81:00.4 eth3: eth3: Chelsio T6225-OCP-SO (0000:81:00.4) 1G/10G/25GBASE-SFP28 Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 71b7597c63d2ddf6d7e5eb01319f9611af437a7b Author: Yoshihiro Shimoda Date: Thu Jul 29 19:32:34 2021 +0900 mmc: renesas_sdhi: Refactor renesas_sdhi_probe() Refactor renesas_sdhi_probe() to avoid increasing numbers of sdhi_quirks_match[] entry when we add other stable SoCs like r8a779m*. Note that the sdhi_quirks_match[] is only needed on renesas_sdhi_internal_dmac.c so that of_data of renesas_sdhi_sys_dmac.c keeps as-is. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Link: https://lore.kernel.org/r/20210729103234.480743-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Ulf Hansson commit ee5165354d498e5bceb0b386e480ac84c5f8c28c Author: Tony Lindgren Date: Tue Aug 10 11:16:44 2021 +0300 mmc: moxart: Fix issue with uninitialized dma_slave_config Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For moxart, this is probably not currently an issue but is still good to fix though. Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver") Cc: Jonas Jensen Cc: Vinod Koul Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210810081644.19353-3-tony@atomide.com Signed-off-by: Ulf Hansson commit c3ff0189d3bc9c03845fe37472c140f0fefd0c79 Author: Tony Lindgren Date: Tue Aug 10 11:16:43 2021 +0300 mmc: dw_mmc: Fix issue with uninitialized dma_slave_config Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For dw_mmc, this is probably not currently an issue but is still good to fix though. Fixes: 3fc7eaef44db ("mmc: dw_mmc: Add external dma interface support") Cc: Shawn Lin Cc: Jaehoon Chung Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210810081644.19353-2-tony@atomide.com Signed-off-by: Ulf Hansson commit 522654d534d315d540710124c57b49ca22ac5f72 Author: Tony Lindgren Date: Tue Aug 10 11:16:42 2021 +0300 mmc: sdhci: Fix issue with uninitialized dma_slave_config Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures at least if external TI SDMA is ever configured for sdhci. For other external DMA cases, this is probably not currently an issue but is still good to fix though. Fixes: 18e762e3b7a7 ("mmc: sdhci: add support for using external DMA devices") Cc: Adrian Hunter Cc: Chunyan Zhang Cc: Faiz Abbas Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Acked-by: Adrian Hunter Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210810081644.19353-1-tony@atomide.com Signed-off-by: Ulf Hansson commit ed78a03d4128ac90f73332d7ac992f952916573c Author: Sahitya Tummala Date: Fri Aug 6 12:25:00 2021 +0530 mmc: sdhci-msm: Use maximum possible data timeout value The Qcom SD controller defines the usage of 0xF in data timeout counter register (0x2E) which is actually a reserved bit as per specification. This would result in maximum of 21.26 secs timeout value. Some SDcard taking more time than 2.67secs (timeout value corresponding to 0xE) and with that observed data timeout errors. So increasing the timeout value to max possible timeout. Signed-off-by: Sahitya Tummala Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1628232901-30897-3-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit e30314f255117f37412d41e918f941a9ae0835f3 Author: Sarthak Garg Date: Fri Aug 6 12:24:59 2021 +0530 mmc: sdhci: Introduce max_timeout_count variable in sdhci_host Introduce max_timeout_count variable in the sdhci_host structure and use in timeout calculation. By default its set to 0xE (max timeout register value as per SDHC spec). But at the same time vendors drivers can update it if they support different max timeout register value than 0xE. Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1628232901-30897-2-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 3ac5e45291f3f0d699a721357380d4593bc2dcb3 Author: Thomas Hebb Date: Sun Aug 1 04:46:14 2021 -0700 mmc: rtsx_pci: Fix long reads when clock is prescaled For unexplained reasons, the prescaler register for this device needs to be cleared (set to 1) while performing a data read or else the command will hang. This does not appear to affect the real clock rate sent out on the bus, so I assume it's purely to work around a hardware bug. During normal operation, the prescaler is already set to 1, so nothing needs to be done. However, in "initial mode" (which is used for sub-MHz clock speeds, like the core sets while enumerating cards), it's set to 128 and so we need to reset it during data reads. We currently fail to do this for long reads. This has no functional affect on the driver's operation currently written, as the MMC core always sets a clock above 1MHz before attempting any long reads. However, the core could conceivably set any clock speed at any time and the driver should still work, so I think this fix is worthwhile. I personally encountered this issue while performing data recovery on an external chip. My connections had poor signal integrity, so I modified the core code to reduce the clock speed. Without this change, I saw the card enumerate but was unable to actually read any data. Writes don't seem to work in the situation described above even with this change (and even if the workaround is extended to encompass data write commands). I was not able to find a way to get them working. Signed-off-by: Thomas Hebb Link: https://lore.kernel.org/r/2fef280d8409ab0100c26c6ac7050227defd098d.1627818365.git.tommyhebb@gmail.com Signed-off-by: Ulf Hansson commit e285b3e064647c6b4b822ade9acb0f3ffd6b1317 Author: Sean Anderson Date: Mon Jul 26 12:36:53 2021 -0400 mmc: sdio: Print contents of unknown CIS tuples Print out the contents of the offending tuples when we do print them. This can make it easier to debug, since these tuples are not exposed to userspace anywhere else. We are limited to 64 bytes, so keep printing out the full length in case the tuple is truncated. Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20210726163654.1110969-2-sean.anderson@seco.com Signed-off-by: Ulf Hansson commit 4b5e37b8fd6491b4a782cbbb8a98e5031b0bc981 Author: Sean Anderson Date: Mon Jul 26 12:36:52 2021 -0400 mmc: sdio: Don't warn about vendor CIS tuples CIS tuples in the range 0x80-0x8F are reserved for vendors. Some devices have tuples in this range which get warned about every boot. Since this is normal behavior, don't print these tuples unless debug is enabled. Unfortunately, we cannot use a variable for the format string since it gets pasted by pr_*_ratelimited. Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20210726163654.1110969-1-sean.anderson@seco.com Signed-off-by: Ulf Hansson commit 60885bfb2a478ceb3b1b766be550eb364a595074 Author: Colin Ian King Date: Wed Jul 28 11:32:54 2021 +0100 memstick: ms_block: Fix spelling contraction "cant" -> "can't" There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210728103254.171546-1-colin.king@canonical.com Signed-off-by: Ulf Hansson commit 8335928849729f8e5f10c1497c67260742f7a8cb Author: Wolfram Sang Date: Wed Jun 30 06:16:58 2021 +0200 mmc: core: Only print retune error when we don't check for card removal Skip printing a retune error when we scan for a removed card because we then expect a failed command. Signed-off-by: Wolfram Sang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20210630041658.7574-1-wsa+renesas@sang-engineering.com [Ulf: Rebased patch] Signed-off-by: Ulf Hansson commit 86c639ce08266ed521974038f0592739fec1c11a Author: Eric Biggers Date: Wed Jul 21 08:47:38 2021 -0700 mmc: core: Store pointer to bio_crypt_ctx in mmc_request Make 'struct mmc_request' contain a pointer to the request's 'struct bio_crypt_ctx' directly, instead of extracting a 32-bit DUN from it which is a cqhci-crypto specific detail. This keeps the cqhci crypto specific details in the cqhci module, and it makes mmc_core and mmc_block ready for MMC crypto hardware that accepts the DUN and/or key in a way that is more flexible than that which will be specified by the eMMC v5.2 standard. Exynos SoCs are an example of such hardware, as their inline encryption hardware takes keys directly (it has no concept of keyslots) and supports 128-bit DUNs. Note that the 32-bit DUN length specified by the standard is very restrictive, so it is likely that more hardware will support longer DUNs despite it not following the standard. Thus, limiting the scope of the 32-bit DUN assumption to the place that actually needs it is warranted. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20210721154738.3966463-1-ebiggers@kernel.org Signed-off-by: Ulf Hansson commit 4a11cc647d7c07388ef00f231fb07c9b01b1db5b Author: Fabio Estevam Date: Mon Jul 19 16:34:13 2021 -0300 mmc: sdhci-esdhc-imx: Remove unneeded mmc-esdhc-imx.h header After the i.MX conversion to a DT-only platform, the mmc-esdhc-imx.h header file is no longer used outside the driver, so move its content to the sdhci-esdhc-imx driver and remove the header. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20210719193413.3792615-1-festevam@gmail.com Signed-off-by: Ulf Hansson commit 6966e6094c6d594044ef1b740dd827e05881331c Author: Ulf Hansson Date: Fri Jul 2 15:42:29 2021 +0200 mmc: core: Avoid hogging the CPU while polling for busy after I/O writes When mmc_blk_card_busy() calls card_busy_detect() to poll for the card's state with CMD13, this is done without any delays in between the commands being sent. Rather than fixing card_busy_detect() in this regards, let's instead convert into using the common __mmc_poll_for_busy(), which also helps us to avoid open-coding. Signed-off-by: Ulf Hansson Reviewed-by: Shawn Lin Link: https://lore.kernel.org/r/20210702134229.357717-4-ulf.hansson@linaro.org commit 468108155b0f89cc08189cc33f9bacfe9da8a125 Author: Ulf Hansson Date: Fri Jul 2 15:42:28 2021 +0200 mmc: core: Avoid hogging the CPU while polling for busy for mmc ioctls When __mmc_blk_ioctl_cmd() calls card_busy_detect() to verify that the card's states moves back into transfer state, the polling with CMD13 is done without any delays in between the commands being sent. Rather than fixing card_busy_detect() in this regards, let's instead convert into using the common mmc_poll_for_busy(), which also helps us to avoid open-coding. Signed-off-by: Ulf Hansson Reviewed-by: Shawn Lin Link: https://lore.kernel.org/r/20210702134229.357717-3-ulf.hansson@linaro.org commit 972d5084831dc9ae30f1a4b66cb4a19fb7ba6f09 Author: Ulf Hansson Date: Fri Jul 2 15:42:27 2021 +0200 mmc: core: Avoid hogging the CPU while polling for busy in the I/O err path When mmc_blk_fix_state() sends a CMD12 to try to move the card into the transfer state, it calls card_busy_detect() to poll for the card's state with CMD13. This is done without any delays in between the commands being sent. Rather than fixing card_busy_detect() in this regards, let's instead convert into using the common mmc_poll_for_busy(), which also helps us to avoid open-coding. Signed-off-by: Ulf Hansson Reviewed-by: Shawn Lin Link: https://lore.kernel.org/r/20210702134229.357717-2-ulf.hansson@linaro.org commit 2b8ac062f33781edbefb482c6abebfde6b373eed Author: Vincent Whitchurch Date: Thu Jul 1 10:05:34 2021 +0200 mmc: dw_mmc: Add data CRC error injection This driver has had problems when handling data errors. Add fault injection support so that the abort handling can be easily triggered and regression-tested. A hrtimer is used to indicate a data CRC error at various points during the data transfer. Note that for the recent problem with hangs in the case of some data CRC errors, a udelay(10) inserted at the start of send_stop_abort() greatly helped in triggering the error, but I've not included this as part of the fault injection support since it seemed too specific. Signed-off-by: Vincent Whitchurch Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20210701080534.23138-1-vincent.whitchurch@axis.com Signed-off-by: Ulf Hansson commit 696068470e38e4bd710c1dea5f0a2a835daf9388 Author: Andy Shevchenko Date: Wed Jun 23 13:17:31 2021 +0300 mmc: mmc_spi: Simplify busy loop in mmc_spi_skip() Infinite loops are hard to read and understand because of hidden main loop condition. Simplify such one in mmc_spi_skip(). Using schedule() to schedule (and be friendly to others) is discouraged and cond_resched() should be used instead. Hence, replace schedule() with cond_resched() at the same time. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210623101731.87885-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit 575cf1046923690c1821cd33c55dc641937404cf Author: Linus Walleij Date: Wed Jun 30 12:24:08 2021 +0200 mmc: mmci: De-assert reset on probe If we find a reset handle when probing the MMCI block, make sure the reset is de-asserted. It could happen that a hardware has reset asserted at boot. Cc: Russell King Cc: Yann Gautier Cc: Ludovic Barre Signed-off-by: Linus Walleij Tested-by: Yann Gautier Link: https://lore.kernel.org/r/20210630102408.3543024-1-linus.walleij@linaro.org Signed-off-by: Ulf Hansson commit 29cef6d47b67c5408d816a6268763bf4dafcac4e Author: Wolfram Sang Date: Wed Jun 23 11:57:33 2021 +0200 mmc: usdhi6rol0: use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210623095734.3046-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 492200f2479d08ac4dddd8a9d59a28b9227a0310 Author: Wolfram Sang Date: Wed Jun 23 11:57:32 2021 +0200 mmc: sh_mmcif: use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210623095734.3046-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 2fc2628a450901069f552ccbe170e6bc56d0458d Author: Wolfram Sang Date: Wed Jun 23 11:57:31 2021 +0200 mmc: renesas_sdhi_sys_dmac: use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20210623095734.3046-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 1a769fb66420289d3787272ca39ea6c204b58f5d Author: Shaik Sajida Bhanu Date: Wed Jun 16 14:50:07 2021 +0530 dt-bindings: mmc: sdhci-msm: Add compatible string for sc7280 Add sc7280 SoC specific compatible strings for qcom-sdhci controller. Signed-off-by: Shaik Sajida Bhanu Acked-by: Rob Herring Link: https://lore.kernel.org/r/1623835207-29462-1-git-send-email-sbhanu@codeaurora.org Signed-off-by: Ulf Hansson commit 5c7e468ab17fe9cc9ce94a6fdef635d5289a8095 Author: Sai Krishna Potthuri Date: Tue Jun 15 16:13:57 2021 +0530 mmc: arasan: Fix the issue in reading tap values from DT 'of_property_read_variable_u32_array' function returns number of elements read on success. This patch updates the condition check in the driver to overwrite the tap values from DT if exist. Signed-off-by: Sai Krishna Potthuri Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-8-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 4dd7080a78925ff293f1ded598b2010bd4ed3729 Author: Manish Narani Date: Tue Jun 15 16:13:56 2021 +0530 mmc: sdhci-of-arasan: Modify data type of the clk_phase array Modify the data type of the clk_phase array to u32 to make it compatible with the argument requirement of "of_property_read_variable_u32_array". Addresses-coverity: ("incompatible_param") Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-7-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 462f58fdb8c0277a49c01831bf4dc8405c37ddaf Author: Manish Narani Date: Tue Jun 15 16:13:55 2021 +0530 mmc: sdhci-of-arasan: Use appropriate type of division macro The division macro DIV_ROUND_CLOSEST takes int values as the argument. However the code here uses unsigned int values for this, which is causing the values comparison with 0 as always true. We can use DIV_ROUND_CLOSEST_ULL instead for the same. Addresses-coverity: ("result_independent_of_operands") Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-6-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 66bad6ed2204fdb78a0a8fb89d824397106a5471 Author: Manish Narani Date: Tue Jun 15 16:13:54 2021 +0530 mmc: sdhci-of-arasan: Check return value of non-void funtions At a couple of places, the return values of the non-void functions were not getting checked. This was reported by the coverity tool. Modify the code to check the return values of the same. Addresses-Coverity: ("check_return") Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-5-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 256e4e4e836ce2452f6874a1612dc3e29f512143 Author: Manish Narani Date: Tue Jun 15 16:13:53 2021 +0530 mmc: sdhci-of-arasan: Skip Auto tuning for DDR50 mode in ZynqMP platform ZynqMP platform does not perform auto tuning in DDR50 mode. Skip the same while the card is operating in DDR50 mode. Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-4-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 25a916645e02123ca4d0ee8a053c198033d8e61c Author: Manish Narani Date: Tue Jun 15 16:13:52 2021 +0530 mmc: sdhci-of-arasan: Add "SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12" quirk. Arasan controller supports AUTO CMD12, this patch adds "SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12" quirk to enable auto cmd12 feature. By using auto cmd12 we can also avoid following error message "Got data interrupt even though no data operation in progress" Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-3-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit c0b4e411a9b09748466ee06d2ae6772effa64dfb Author: Manish Narani Date: Tue Jun 15 16:13:51 2021 +0530 mmc: sdhci-of-arasan: Modified SD default speed to 19MHz for ZynqMP SD standard speed timing was met only at 19MHz and not 25 MHz, that's why changing driver to 19MHz. The reason for this is when a level shifter is used on the board, timing was met for standard speed only at 19MHz. Since this level shifter is commonly required for high speed modes, the driver is modified to use standard speed of 19Mhz. Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-2-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 8ffb2611a752e1067c18fba39968080469394206 Author: Wolfram Sang Date: Thu Jun 24 17:16:16 2021 +0200 mmc: host: factor out clearing the retune state We have this in two places, so let's have a dedicated function. It is also more readable. Signed-off-by: Wolfram Sang Acked-by: Adrian Hunter Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20210624151616.38770-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 68249abd7ae8de55e59844436bcd3c8f51bdd252 Author: Wolfram Sang Date: Thu Jun 24 17:16:15 2021 +0200 mmc: host: add kdoc for mmc_retune_{en|dis}able I wanted to use it in a wrong way, so document the intended way. Signed-off-by: Wolfram Sang Acked-by: Adrian Hunter Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20210624151616.38770-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit dab2ea6c680f87add6d2f7007ce46b6b9e3857f7 Author: Lorenzo Bianconi Date: Mon Aug 23 20:02:38 2021 +0200 ieee80211: add TWT element definitions Introduce TWT definitions and TWT Information element structure in ieee80211.h Tested-by: Peter Chiu Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/71d8b581fe4b5abc5b92f8d77ac2de3e2f7591b6.1629741512.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 00ed1401a0058e8cca4cc1b6ba14b893e5df746e Author: Barry Song Date: Fri Aug 13 15:56:28 2021 +1200 platform-msi: Add ABI to show msi_irqs of platform devices PCI devices expose the associated MSI interrupts via sysfs, but platform devices which utilize MSI interrupts do not. This information is important for user space tools to optimize affinity settings. Utilize the generic MSI sysfs facility to expose this information for platform MSI. Signed-off-by: Barry Song Signed-off-by: Thomas Gleixner Acked-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20210813035628.6844-3-21cnbao@gmail.com commit 2f170814bdd26289e9daaa4ae359290f854e5dcf Author: Barry Song Date: Fri Aug 13 15:56:27 2021 +1200 genirq/msi: Move MSI sysfs handling from PCI to MSI core Move PCI's MSI sysfs code to the irq core so that other busses such as platform can reuse it. Signed-off-by: Barry Song Signed-off-by: Thomas Gleixner Acked-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20210813035628.6844-2-21cnbao@gmail.com commit 88ffe2d0a55a165e55cedad1693f239d47e3e17e Author: Lee Jones Date: Mon Aug 16 14:48:17 2021 +0100 genirq/cpuhotplug: Demote debug printk to KERN_DEBUG This sort of information is only generally useful when debugging. No need to have these sprinkled through the kernel log otherwise. Real world problem: During pre-release testing these have an affect on performance on real products. To the point where so much logging builds up, that it sets off the watchdog(s) on some high profile consumer devices. Signed-off-by: Lee Jones Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210816134817.1503661-1-lee.jones@linaro.org commit 6e41340994e5b5bd9262246e8d1f64406d72ab8b Author: Takashi Iwai Date: Tue Aug 24 07:57:20 2021 +0200 ALSA: usb-audio: Move set-interface-first workaround into common quirk The recent quirk for WALKMAN (commit 7af5a14371c1: "ALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC") may be required for other devices and is worth to be put into the common quirk flags. This patch adds a new quirk flag bit QUIRK_FLAG_SET_IFACE_FIRST and a quirk table entry for the device. Link: https://lore.kernel.org/r/20210824055720.9240-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1a10d5b0f6c2aebecec5f6f99d651bc2e2b4ce44 Merge: e28ac04a705e9 93ab3eafb0b35 Author: Takashi Iwai Date: Tue Aug 24 07:52:41 2021 +0200 Merge branch 'for-linus' into for-next commit 93ab3eafb0b3551c54175cb38afed3b82356a047 Author: Johnathon Clark Date: Mon Aug 23 17:21:10 2021 +0100 ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup This patch extends support for the HP Spectre x360 14 amp enable quirk to support a model of the device with an additional subdevice ID. Signed-off-by: Johnathon Clark Link: https://lore.kernel.org/r/20210823162110.8870-1-john.clark@cantab.net Cc: Signed-off-by: Takashi Iwai commit 7af5a14371c1cf94a41f08eabb62a3faceec8911 Author: Takashi Iwai Date: Tue Aug 24 07:47:00 2021 +0200 ALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC We've got a regression report for USB-audio with Sony WALKMAN NW-A45 DAC device where no sound is audible on recent kernel. The bisection resulted in the code change wrt endpoint management, and the further debug session revealed that it was caused by the order of the USB audio interface. In the earlier code, we always set up the USB interface at first before other setups, but it was changed to be done at the last for UAC2/3, which is more standard way, while keeping the old way for UAC1. OTOH, this device seems requiring the setup of the interface at first just like UAC1. This patch works around the regression by applying the interface setup specifically for the WALKMAN at the beginning of the endpoint setup procedure. This change is written straightforwardly to be easily backported in old kernels. A further cleanup to move the workaround into a generic quirk section will follow in a later patch. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Cc: BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214105 Link: https://lore.kernel.org/r/20210824054700.8236-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 98079418c53fff5f9e2d4087f08eaff2a9ce7714 Author: Masahiro Yamada Date: Thu Aug 19 10:23:39 2021 +0900 scsi: core: Fix missing FORCE for scsi_devinfo_tbl.c build rule Add FORCE so that if_changed can detect the command line change. scsi_devinfo_tbl.c must be added to 'targets' too. Link: https://lore.kernel.org/r/20210819012339.709409-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada Signed-off-by: Martin K. Petersen commit c563c126e293d58b5f730813160c1c2acf156145 Author: John Garry Date: Wed Aug 18 21:53:20 2021 +0800 scsi: qla1280: Stop using scsi_cmnd.tag Use scsi_cmd_to_rq(cmd)->tag instead of scsi_cmnd.tag as preference. Link: https://lore.kernel.org/r/1629294801-32102-2-git-send-email-john.garry@huawei.com Reviewed-by: Hannes Reinecke Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit cbe1f0d70072cbdb28c8687f3fca79d07e8d1860 Author: Hannes Reinecke Date: Thu Aug 19 11:19:13 2021 +0200 scsi: qla2xxx: Open-code qla2xxx_eh_device_reset() Device reset and target reset will be using different calling sequences, so open-code __qla2xxx_eh_generic_reset() in qla2xxx_eh_device_reset(), and remove the now obsolete function __qla2xxx_eh_generic_reset(). No functional changes. Link: https://lore.kernel.org/r/20210819091913.94436-4-hare@suse.de Cc: Nilesh Javali Reviewed-by: Nilesh Javali Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit e56b2234ab64f92486ea246f1322ff236e87e229 Author: Hannes Reinecke Date: Thu Aug 19 11:19:12 2021 +0200 scsi: qla2xxx: Open-code qla2xxx_eh_target_reset() Device reset and target reset will be using different calling sequences, so open-code __qla2xxx_eh_generic_reset() in qla2xxx_eh_target_reset(). No functional changes. Link: https://lore.kernel.org/r/20210819091913.94436-3-hare@suse.de Cc: Nilesh Javali Reviewed-by: Nilesh Javali Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit c74ce061f8983bcb048b895bc127447909321fe8 Author: Hannes Reinecke Date: Thu Aug 19 11:19:11 2021 +0200 scsi: qla2xxx: Do not call fc_block_scsi_eh() during bus reset When calling bus reset the driver will be doing a full SAN resync, so there is no need to wait for any pending RSCNs; they'll be re-issued during resync anyway. Link: https://lore.kernel.org/r/20210819091913.94436-2-hare@suse.de Cc: Nilesh Javali Reviewed-by: Nilesh Javali Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 34f69ec703559f0a43ec3307795c28514861b511 Author: Nilesh Javali Date: Mon Aug 16 22:13:15 2021 -0700 scsi: qla2xxx: Update version to 10.02.06.200-k Link: https://lore.kernel.org/r/20210817051315.2477-13-njavali@marvell.com Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 17f3df8fd718fb229ae3453ae59b3f2349464d06 Author: kernel test robot Date: Mon Aug 16 22:13:14 2021 -0700 scsi: qla2xxx: edif: Fix returnvar.cocci warnings drivers/scsi/qla2xxx/qla_edif.c:213:25-29: Unneeded variable: "rval". Return "0" on line 264 Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci Link: https://lore.kernel.org/r/20210817051315.2477-12-njavali@marvell.com Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs") Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 7a8ff7d9854a1727435557184c8255bbbca60920 Author: Quinn Tran Date: Mon Aug 16 22:13:13 2021 -0700 scsi: qla2xxx: Fix NVMe session down detection When Target port transitions personality from one to another (NVMe <--> FCP), there could be some overlap of the two where one layer is going down while the other layer is coming up. This overlap can cause temporary I/O error. Detect those errors/transitions and recover from them. Triggers session tear down and allow relogin to re-drive the connection under the following conditions: - NVMe command error - On PRLO + N2N (rida format 2) Link: https://lore.kernel.org/r/20210817051315.2477-11-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit f88444570072a6863f3e2bd67878560a51b187f2 Author: Quinn Tran Date: Mon Aug 16 22:13:12 2021 -0700 scsi: qla2xxx: Fix NVMe retry For target port that register itself as both FCP + NVMe, initiator driver will try to login one mode at a time. If the last mode did not succeed, then driver will try the other mode. When error is encountered, current code only flip to other mode one time (NVMe->FCP) and remain on the last mode. Driver wrongly assumed target port does not support PRLI NVMe, instead it was not ready to receive PRLI. This patch will alternate back and forth on every PRLI failure until login retry count has depleted or it is succeeded. Link: https://lore.kernel.org/r/20210817051315.2477-10-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 2cabf10dbbe380e2ef27a69ce2059bcab7c8b419 Author: Arun Easi Date: Mon Aug 16 22:13:11 2021 -0700 scsi: qla2xxx: Fix hang on NVMe command timeouts The abort callback gets called only when it gets posted to firmware. The refcounting is done properly in the callback. On internal errors, the callback is not invoked leading to a hung I/O. Fix this by having separate error code when command gets returned from firmware. Link: https://lore.kernel.org/r/20210817051315.2477-9-njavali@marvell.com Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit f6e327fc09e48271c103efb3b69fc4ccda3f408b Author: Quinn Tran Date: Mon Aug 16 22:13:10 2021 -0700 scsi: qla2xxx: Fix NVMe | FCP personality change Currently driver saves the personality type (FCP|NVMe) at the start of first discovery of the remote device. If the remote device personality do change over time, then qla driver needs to present that to user to decide. Link: https://lore.kernel.org/r/20210817051315.2477-8-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 1dc64a360bda55d632202e3fef266cef7d4f6f00 Author: Quinn Tran Date: Mon Aug 16 22:13:09 2021 -0700 scsi: qla2xxx: edif: Do secure PLOGI when auth app is present For initiator mode, always do secure login when authentication app started. Also remove redundant flags to indicate secure connection. Link: https://lore.kernel.org/r/20210817051315.2477-7-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 4de067e5df12c4db4d3d930ba58354d23674f67c Author: Quinn Tran Date: Mon Aug 16 22:13:08 2021 -0700 scsi: qla2xxx: edif: Add N2N support for EDIF For EDIF + N2N to work, firmware 9.8 or later is required. The driver will pause after PLOGI to allow app to authenticate. Once authentication completes, app will tell driver to do PRLI. Link: https://lore.kernel.org/r/20210817051315.2477-6-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 310e69edfbd57995868a428eeddea09a7b5d2749 Author: Arun Easi Date: Mon Aug 16 22:13:07 2021 -0700 scsi: qla2xxx: Fix hang during NVMe session tear down The following hung task call trace was seen: [ 1230.183294] INFO: task qla2xxx_wq:523 blocked for more than 120 seconds. [ 1230.197749] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 1230.205585] qla2xxx_wq D 0 523 2 0x80004000 [ 1230.205636] Workqueue: qla2xxx_wq qlt_free_session_done [qla2xxx] [ 1230.205639] Call Trace: [ 1230.208100] __schedule+0x2c4/0x700 [ 1230.211607] schedule+0x38/0xa0 [ 1230.214769] schedule_timeout+0x246/0x2f0 [ 1230.222651] wait_for_completion+0x97/0x100 [ 1230.226921] qlt_free_session_done+0x6a0/0x6f0 [qla2xxx] [ 1230.232254] process_one_work+0x1a7/0x360 ...when device side port resets were done. Abort threads were getting out without processing due to the "deleted" flag check. The delete thread, meanwhile, could not proceed with a logout (that would have cleared out pending requests) as the logout IOCB work was not progressing. It appears like the hung qlt_free_session_done() thread is causing the ha->wq works on hold. The qlt_free_session_done() was hung waiting for nvme_fc_unregister_remoteport() + localport_delete cb to be complete, which would only happen when all I/Os are released. Fix this by allowing abort to progress until device delete is completely done. This should make the qlt_free_session_done() proceed without hang and thus clear up the deadlock. Link: https://lore.kernel.org/r/20210817051315.2477-5-njavali@marvell.com Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit d07b75ba96497e9bfb9f0e673800a9d764ac212a Author: Quinn Tran Date: Mon Aug 16 22:13:06 2021 -0700 scsi: qla2xxx: edif: Fix EDIF enable flag edif_enabled is prematurely turned on if hardware is capable of handling the feature. However, firmware also needs to support EDIF before enabling this bit. Link: https://lore.kernel.org/r/20210817051315.2477-4-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 225479296c4fb2d3449e55b48eca2a9d6aca1e4e Author: Quinn Tran Date: Mon Aug 16 22:13:05 2021 -0700 scsi: qla2xxx: edif: Reject AUTH ELS on session down Reject inflight AUTH ELS if driver is going through session recovery. Link: https://lore.kernel.org/r/20210817051315.2477-3-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit b15ce2f34cf42487982db0a8606095db1c8c8f28 Author: Quinn Tran Date: Mon Aug 16 22:13:04 2021 -0700 scsi: qla2xxx: edif: Fix stale session When firmware indicates session has been torn down via UPDATE SA IOCB or ELS Passthrough IOCB, the driver needs to also tear down the session. Link: https://lore.kernel.org/r/20210817051315.2477-2-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit a6258837c8a81dcd9b0f1b061bd35302ad4d5914 Author: Yucong Sun Date: Mon Aug 23 14:36:29 2021 -0700 selftests/bpf: Reduce flakyness in timer_mim This patch extends wait time in timer_mim. As observed in slow CI environment, it is possible to have interrupt/preemption long enough to cause the test to fail, almost 1 failure in 5 runs. Signed-off-by: Yucong Sun Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210823213629.3519641-1-fallentree@fb.com commit 4ed589a2789365991f0565383f7d449cfdfc857e Merge: d359902d5c357 6fc88c354f3af Author: Alexei Starovoitov Date: Mon Aug 23 17:50:24 2021 -0700 Merge branch 'Refactor cgroup_bpf internals to use more specific attach_type' Dave Marchevsky says: ==================== The cgroup_bpf struct has a few arrays (effective, progs, and flags) of size MAX_BPF_ATTACH_TYPE. These are meant to separate progs by their attach type, currently represented by the bpf_attach_type enum. There are some bpf_attach_type values which are not valid attach types for cgroup bpf programs. Programs with these attach types will never be handled by cgroup_bpf_{attach,detach} and thus will never be held in cgroup_bpf structs. Even if such programs did make it into their reserved slot in those arrays, they would never be executed. Accordingly we can migrate to a new internal cgroup_bpf-specific enum for these arrays, saving some bytes per cgroup and making it more obvious which BPF programs belong there. netns_bpf_attach_type is an existing example of this pattern, let's do similar for cgroup_bpf. v1->v2: Address Daniel's comments * Reverse xmas tree ordering for def changes * Helper macro to reduce to_cgroup_bpf_attach_type boilerplate * checkpatch.pl complains: "ERROR: Macros with complex values should be enclosed in parentheses". Found some existing macros (do 'git grep "define case"') which get same complaint. Think it's fine to keep as-is since it's immediately undef'd. * Remove CG_BPF_ prefix from cgroup_bpf_attach_type * Although I agree that the prefix is redundant, the de-prefixed names feel a bit too 'general' given the internal use of the enum. e.g. when someone sees CGROUP_INET6_BIND it's not obvious that it should only be used in certain ways internally. * Don't feel strongly about this, just my thoughts as a noob to the internals. * Rebase onto latest bpf-next/master * No significant conflicts, some small boilerplate adjustments needed to catch up to Andrii's "bpf: Refactor BPF_PROG_RUN_ARRAY family of macros into functions" change ==================== Signed-off-by: Alexei Starovoitov commit 6fc88c354f3af83ffa2c285b86e76c759755693f Author: Dave Marchevsky Date: Thu Aug 19 02:24:20 2021 -0700 bpf: Migrate cgroup_bpf to internal cgroup_bpf_attach_type enum Add an enum (cgroup_bpf_attach_type) containing only valid cgroup_bpf attach types and a function to map bpf_attach_type values to the new enum. Inspired by netns_bpf_attach_type. Then, migrate cgroup_bpf to use cgroup_bpf_attach_type wherever possible. Functionality is unchanged as attach_type_to_prog_type switches in bpf/syscall.c were preventing non-cgroup programs from making use of the invalid cgroup_bpf array slots. As a result struct cgroup_bpf uses 504 fewer bytes relative to when its arrays were sized using MAX_BPF_ATTACH_TYPE. bpf_cgroup_storage is notably not migrated as struct bpf_cgroup_storage_key is part of uapi and contains a bpf_attach_type member which is not meant to be opaque. Similarly, bpf_cgroup_link continues to report its bpf_attach_type member to userspace via fdinfo and bpf_link_info. To ease disambiguation, bpf_attach_type variables are renamed from 'type' to 'atype' when changed to cgroup_bpf_attach_type. Signed-off-by: Dave Marchevsky Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210819092420.1984861-2-davemarchevsky@fb.com commit 72a048c1056a72e37ea2ee34cc73d8c6d6cb4290 Author: Darrick J. Wong Date: Fri Aug 20 14:42:39 2021 -0700 xfs: only set IOMAP_F_SHARED when providing a srcmap to a write While prototyping a free space defragmentation tool, I observed an unexpected IO error while running a sequence of commands that can be recreated by the following sequence of commands: # xfs_io -f -c "pwrite -S 0x58 -b 10m 0 10m" file1 # cp --reflink=always file1 file2 # punch-alternating -o 1 file2 # xfs_io -c "funshare 0 10m" file2 fallocate: Input/output error I then scraped this (abbreviated) stack trace from dmesg: WARNING: CPU: 0 PID: 30788 at fs/iomap/buffered-io.c:577 iomap_write_begin+0x376/0x450 CPU: 0 PID: 30788 Comm: xfs_io Not tainted 5.14.0-rc6-xfsx #rc6 5ef57b62a900814b3e4d885c755e9014541c8732 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:iomap_write_begin+0x376/0x450 RSP: 0018:ffffc90000c0fc20 EFLAGS: 00010297 RAX: 0000000000000001 RBX: ffffc90000c0fd10 RCX: 0000000000001000 RDX: ffffc90000c0fc54 RSI: 000000000000000c RDI: 000000000000000c RBP: ffff888005d5dbd8 R08: 0000000000102000 R09: ffffc90000c0fc50 R10: 0000000000b00000 R11: 0000000000101000 R12: ffffea0000336c40 R13: 0000000000001000 R14: ffffc90000c0fd10 R15: 0000000000101000 FS: 00007f4b8f62fe40(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056361c554108 CR3: 000000000524e004 CR4: 00000000001706f0 Call Trace: iomap_unshare_actor+0x95/0x140 iomap_apply+0xfa/0x300 iomap_file_unshare+0x44/0x60 xfs_reflink_unshare+0x50/0x140 [xfs 61947ea9b3a73e79d747dbc1b90205e7987e4195] xfs_file_fallocate+0x27c/0x610 [xfs 61947ea9b3a73e79d747dbc1b90205e7987e4195] vfs_fallocate+0x133/0x330 __x64_sys_fallocate+0x3e/0x70 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f4b8f79140a Looking at the iomap tracepoints, I saw this: iomap_iter: dev 8:64 ino 0x100 pos 0 length 0 flags WRITE|0x80 (0x81) ops xfs_buffered_write_iomap_ops caller iomap_file_unshare iomap_iter_dstmap: dev 8:64 ino 0x100 bdev 8:64 addr -1 offset 0 length 131072 type DELALLOC flags SHARED iomap_iter_srcmap: dev 8:64 ino 0x100 bdev 8:64 addr 147456 offset 0 length 4096 type MAPPED flags iomap_iter: dev 8:64 ino 0x100 pos 0 length 4096 flags WRITE|0x80 (0x81) ops xfs_buffered_write_iomap_ops caller iomap_file_unshare iomap_iter_dstmap: dev 8:64 ino 0x100 bdev 8:64 addr -1 offset 4096 length 4096 type DELALLOC flags SHARED console: WARNING: CPU: 0 PID: 30788 at fs/iomap/buffered-io.c:577 iomap_write_begin+0x376/0x450 The first time funshare calls ->iomap_begin, xfs sees that the first block is shared and creates a 128k delalloc reservation in the COW fork. The delalloc reservation is returned as dstmap, and the shared block is returned as srcmap. So far so good. funshare calls ->iomap_begin to try the second block. This time there's no srcmap (punch-alternating punched it out!) but we still have the delalloc reservation in the COW fork. Therefore, we again return the reservation as dstmap and the hole as srcmap. iomap_unshare_iter incorrectly tries to unshare the hole, which __iomap_write_begin rejects because shared regions must be fully written and therefore cannot require zeroing. Therefore, change the buffered write iomap_begin function not to set IOMAP_F_SHARED when there isn't a source mapping to read from for the unsharing. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R commit cb181da161963eddc9de0000de6ab2c7942be219 Author: THOBY Simon Date: Sun Aug 22 08:55:26 2021 +0000 IMA: reject unknown hash algorithms in ima_get_hash_algo The new function validate_hash_algo() assumed that ima_get_hash_algo() always return a valid 'enum hash_algo', but it returned the user-supplied value present in the digital signature without any bounds checks. Update ima_get_hash_algo() to always return a valid hash algorithm, defaulting on 'ima_hash_algo' when the user-supplied value inside the xattr is invalid. Signed-off-by: THOBY Simon Reported-by: syzbot+e8bafe7b82c739eaf153@syzkaller.appspotmail.com Fixes: 50f742dd9147 ("IMA: block writes of the security.ima xattr with unsupported algorithms") Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 7f024fcd5c97dc70bb9121c80407cf3cf9be7159 Author: J. Bruce Fields Date: Mon Aug 23 16:44:00 2021 -0400 Keep read and write fds with each nlm_file We shouldn't really be using a read-only file descriptor to take a write lock. Most filesystems will put up with it. But NFS, for example, won't. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 07e7e1c9969ffd033839a1be8ce7048da6819bec Merge: ecdbda1746b5b a4836d5ad127f Author: Arnd Bergmann Date: Mon Aug 23 23:40:35 2021 +0200 Merge tag 'aspeed-5.15-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/defconfig ASPEED defconfig updates for 5.15 - Enable new KCS SerIO driver - Enable SGPIO and EDAC for AST2400 now they are supported there - Switch to SLUB and enable SLAB_FREELIST_HARDENED - Regenerate defconfigs atop v5.14-rc2 * tag 'aspeed-5.15-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: config: aspeed: Regenerate defconfigs ARM: config: aspeed_g4: Enable EDAC and SPGIO ARM: config: aspeed: Enable KCS adapter for raw SerIO ARM: config: aspeed: Enable hardened allocator feature Link: https://lore.kernel.org/r/CACPK8XdzKdnyrpjKukGWieBhLgQnBs+y=LuSr_weot=Ovy3+9A@mail.gmail.com Signed-off-by: Arnd Bergmann commit cf30da90bc3a26911d369f199411f38b701394de Author: Dmitry Kadashev Date: Thu Jul 8 13:34:47 2021 +0700 io_uring: add support for IORING_OP_LINKAT IORING_OP_LINKAT behaves like linkat(2) and takes the same flags and arguments. In some internal places 'hardlink' is used instead of 'link' to avoid confusion with the SQE links. Name 'link' conflicts with the existing 'link' member of io_kiocb. Acked-by: Linus Torvalds Suggested-by: Christian Brauner Link: https://lore.kernel.org/io-uring/20210514145259.wtl4xcsp52woi6ab@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-12-dkadashev@gmail.com [axboe: add splice_fd_in check] Signed-off-by: Jens Axboe commit 7a8721f84fcb3b2946a92380b6fc311e017ff02c Author: Dmitry Kadashev Date: Thu Jul 8 13:34:46 2021 +0700 io_uring: add support for IORING_OP_SYMLINKAT IORING_OP_SYMLINKAT behaves like symlinkat(2) and takes the same flags and arguments. Acked-by: Linus Torvalds Suggested-by: Christian Brauner Link: https://lore.kernel.org/io-uring/20210514145259.wtl4xcsp52woi6ab@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-11-dkadashev@gmail.com [axboe: add splice_fd_in check] Signed-off-by: Jens Axboe commit 3d5b3fbedad65088ec079a4c4d1a2f47e11ae1e7 Author: Jens Axboe Date: Fri Aug 13 07:53:09 2021 -0600 bio: improve kerneldoc documentation for bio_alloc_kiocb() We're missing a description for the 'nr_vecs' parameter. While in there, clarify that freeing a bio allocated through this function must be done from process context. Fixes: 1cbbd31c4ada ("bio: add allocation cache abstraction") Reported-by: Stephen Rothwell Signed-off-by: Jens Axboe commit 270a1c913ebd745ebee716af5f7215e1c2b30cc0 Author: Jens Axboe Date: Thu Aug 12 11:42:53 2021 -0600 block: provide bio_clear_hipri() helper Any case that turns off REQ_HIPRI must also clear BIO_PERCPU_CACHE, as non-polled IO may complete through hard/soft IRQ and hence isn't safe for our polled bio alloc cache. Provide a helper that does just that, and use it in the merging code as well if we split a bio and turn off polling. Fixes: be863b9e4348 ("block: clear BIO_PERCPU_CACHE flag if polling isn't supported") Reported-by: Keith Busch Signed-off-by: Jens Axboe commit 01cfa28af486c9df3775232f10c3dd7ba2e88318 Author: Christoph Hellwig Date: Thu Aug 12 09:05:52 2021 -0600 block: use the percpu bio cache in __blkdev_direct_IO Use bio_alloc_kiocb to dip into the percpu cache of bios when the caller asks for it. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 394918ebb889f99d89db6843bcc93279b2b745f9 Author: Jens Axboe Date: Mon Mar 8 11:40:23 2021 -0700 io_uring: enable use of bio alloc cache Mark polled IO as being safe for dipping into the bio allocation cache, in case the targeted bio_set has it enabled. This brings an IOPOLL gen2 Optane QD=128 workload from ~3.2M IOPS to ~3.5M IOPS. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit be863b9e4348a791e360d25611a1bdde2c9595ed Author: Jens Axboe Date: Wed Aug 11 10:19:06 2021 -0600 block: clear BIO_PERCPU_CACHE flag if polling isn't supported The bio alloc cache relies on the fact that a polled bio will complete in process context, clear the cacheable flag if we disable polling for a given bio. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit be4d234d7aebbfe0c233bc20b9cdef7ab3408ff4 Author: Jens Axboe Date: Mon Mar 8 11:37:47 2021 -0700 bio: add allocation cache abstraction Add a per-cpu bio_set cache for bio allocations, enabling us to quickly recycle them instead of going through the slab allocator. This cache isn't IRQ safe, and hence is only really suitable for polled IO. Very simple - keeps a count of bio's in the cache, and maintains a max of 512 with a slack of 64. If we get above max + slack, we drop slack number of bio's. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6c7ef543df909dbdcd8cb24ef30627cba62a4e91 Author: Jens Axboe Date: Tue Aug 10 09:29:55 2021 -0600 fs: add kiocb alloc cache flag If this kiocb can safely use the polled bio allocation cache, then this flag must be set. Generally this can be set for polled IO, where we will not see IRQ completions of the request. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit da521626ac620d8719d674a48b8ec3620eefd42a Author: Jens Axboe Date: Wed Aug 11 09:20:04 2021 -0600 bio: optimize initialization of a bio The memset() used is measurably slower in targeted benchmarks, wasting about 1% of the total runtime, or 50% of the (later) hot path cached bio alloc. Get rid of it and fill in the bio manually. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit dadebc350da2bef62593b1df007a6e0b90baf42a Author: Pavel Begunkov Date: Mon Aug 23 13:30:44 2021 +0100 io_uring: fix io_try_cancel_userdata race for iowq WARNING: CPU: 1 PID: 5870 at fs/io_uring.c:5975 io_try_cancel_userdata+0x30f/0x540 fs/io_uring.c:5975 CPU: 0 PID: 5870 Comm: iou-wrk-5860 Not tainted 5.14.0-rc6-next-20210820-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:io_try_cancel_userdata+0x30f/0x540 fs/io_uring.c:5975 Call Trace: io_async_cancel fs/io_uring.c:6014 [inline] io_issue_sqe+0x22d5/0x65a0 fs/io_uring.c:6407 io_wq_submit_work+0x1dc/0x300 fs/io_uring.c:6511 io_worker_handle_work+0xa45/0x1840 fs/io-wq.c:533 io_wqe_worker+0x2cc/0xbb0 fs/io-wq.c:582 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 io_try_cancel_userdata() can be called from io_async_cancel() executing in the io-wq context, so the warning fires, which is there to alert anyone accessing task->io_uring->io_wq in a racy way. However, io_wq_put_and_exit() always first waits for all threads to complete, so the only detail left is to zero tctx->io_wq after the context is removed. note: one little assumption is that when IO_WQ_WORK_CANCEL, the executor won't touch ->io_wq, because io_wq_destroy() might cancel left pending requests in such a way. Cc: stable@vger.kernel.org Reported-by: syzbot+b0c9d1588ae92866515f@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/dfdd37a80cfa9ffd3e59538929c99cdd55d8699e.1629721757.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e34a02dc40c95d126bb6486dcf802bbb8d1624a0 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:45 2021 +0700 io_uring: add support for IORING_OP_MKDIRAT IORING_OP_MKDIRAT behaves like mkdirat(2) and takes the same flags and arguments. Acked-by: Linus Torvalds Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-10-dkadashev@gmail.com [axboe: add splice_fd_in check] Signed-off-by: Jens Axboe commit 45f30dab395730aa3b3da14d9f19ea0d7d43db53 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:44 2021 +0700 namei: update do_*() helpers to return ints Update the following to return int rather than long, for uniformity with the rest of the do_* helpers in namei.c: * do_rmdir() * do_unlinkat() * do_mkdirat() * do_mknodat() * do_symlinkat() Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/20210514143202.dmzfcgz5hnauy7ze@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-9-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 020250f31c4c75ac7687a673e29c00786582a5f4 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:43 2021 +0700 namei: make do_linkat() take struct filename Pass in the struct filename pointers instead of the user string, for uniformity with do_renameat2, do_unlinkat, do_mknodat, etc. Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/20210330071700.kpjoyp5zlni7uejm@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-8-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 8228e2c313194f13f1d1806ed5734a26c38d49ac Author: Dmitry Kadashev Date: Thu Jul 8 13:34:42 2021 +0700 namei: add getname_uflags() There are a couple of places where we already open-code the (flags & AT_EMPTY_PATH) check and io_uring will likely add another one in the future. Let's just add a simple helper getname_uflags() that handles this directly and use it. Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/20210415100815.edrn4a7cy26wkowe@wittgenstein/ Signed-off-by: Christian Brauner Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-7-dkadashev@gmail.com Signed-off-by: Jens Axboe commit da2d0cede330192879e8e16ddb3158aa76ba5ec2 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:41 2021 +0700 namei: make do_symlinkat() take struct filename Pass in the struct filename pointers instead of the user string, for uniformity with the recently converted do_mkdnodat(), do_unlinkat(), do_renameat(), do_mkdirat(). Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/20210330071700.kpjoyp5zlni7uejm@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-6-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 7797251bb5ab7f184dafdfebd05f469ff6a67b77 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:40 2021 +0700 namei: make do_mknodat() take struct filename Pass in the struct filename pointers instead of the user string, for uniformity with the recently converted do_unlinkat(), do_renameat(), do_mkdirat(). Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/20210330071700.kpjoyp5zlni7uejm@wittgenstein/ Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-5-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 584d3226d665214dc1c498045c253529acdd3134 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:39 2021 +0700 namei: make do_mkdirat() take struct filename Pass in the struct filename pointers instead of the user string, and update the three callers to do the same. This is heavily based on commit dbea8d345177 ("fs: make do_renameat2() take struct filename"). This behaves like do_unlinkat() and do_renameat2(). Cc: Al Viro Acked-by: Linus Torvalds Signed-off-by: Dmitry Kadashev Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20210708063447.3556403-4-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 0ee50b47532a81ab36046241822d1ecb4e08e76d Author: Dmitry Kadashev Date: Thu Jul 8 13:34:38 2021 +0700 namei: change filename_parentat() calling conventions Since commit 5c31b6cedb675 ("namei: saner calling conventions for filename_parentat()") filename_parentat() had the following behavior WRT the passed in struct filename *: * On error the name is consumed (putname() is called on it); * On success the name is returned back as the return value; Now there is a need for filename_create() and filename_lookup() variants that do not consume the passed filename, and following the same "consume the name only on error" semantics is proven to be hard to reason about and result in confusing code. Hence this preparation change splits filename_parentat() into two: one that always consumes the name and another that never consumes the name. This will allow to implement two filename_create() variants in the same way, and is a consistent and hopefully easier to reason about approach. Link: https://lore.kernel.org/io-uring/CAOKbgA7MiqZAq3t-HDCpSGUFfco4hMA9ArAE-74fTpU+EkvKPw@mail.gmail.com/ Cc: Al Viro Cc: Christian Brauner Acked-by: Linus Torvalds Signed-off-by: Dmitry Kadashev Link: https://lore.kernel.org/r/20210708063447.3556403-3-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 91ef658fb8b82837f94ea0d45d14b5b2d2541e70 Author: Dmitry Kadashev Date: Thu Jul 8 13:34:37 2021 +0700 namei: ignore ERR/NULL names in putname() Supporting ERR/NULL names in putname() makes callers code cleaner, and is what some other path walking functions already support for the same reason. This also removes a few existing IS_ERR checks before putname(). Suggested-by: Linus Torvalds Link: https://lore.kernel.org/io-uring/CAHk-=wgCac9hBsYzKMpHk0EbLgQaXR=OUAjHaBtaY+G8A9KhFg@mail.gmail.com/ Acked-by: Linus Torvalds Cc: Al Viro Cc: Christian Brauner Signed-off-by: Dmitry Kadashev Link: https://lore.kernel.org/r/20210708063447.3556403-2-dkadashev@gmail.com Signed-off-by: Jens Axboe commit 126180b95f27ef6cc536da57115e06665254b0d7 Author: Pavel Begunkov Date: Wed Aug 18 12:42:47 2021 +0100 io_uring: IRQ rw completion batching Employ inline completion logic for read/write completions done via io_req_task_complete(). If ->uring_lock is contended, just do normal request completion, but if not, make tctx_task_work() to grab the lock and do batched inline completions in io_req_task_complete(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/94589c3ce69eaed86a21bb1ec696407a54fab1aa.1629286357.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f237c30a5610d35a584f3296d397b93d80ce374e Author: Pavel Begunkov Date: Wed Aug 18 12:42:46 2021 +0100 io_uring: batch task work locking Many task_work handlers either grab ->uring_lock, or may benefit from having it. Move locking logic out of individual handlers to a lazy approach controlled by tctx_task_work(), so we don't keep doing tons of mutex lock/unlock. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d6a34e147f2507a2f3e2fa1e38a9c541dcad3929.1629286357.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5636c00d3e8ef1f6d1291e71edb48f727ba5a999 Author: Pavel Begunkov Date: Wed Aug 18 12:42:45 2021 +0100 io_uring: flush completions for fallbacks io_fallback_req_func() doesn't expect anyone creating inline completions, and no one currently does that. Teach the function to flush completions preparing for further changes. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8b941516921f72e1a64d58932d671736892d7fff.1629286357.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 26578cda3db983b17cabe4e577af26306beb9987 Author: Pavel Begunkov Date: Fri Aug 20 10:36:37 2021 +0100 io_uring: add ->splice_fd_in checks ->splice_fd_in is used only by splice/tee, but no other request checks it for validity. Add the check for most of request types excluding reads/writes/sends/recvs, we don't want overhead for them and can leave them be as is until the field is actually used. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f44bc2acd6777d932de3d71a5692235b5b2b7397.1629451684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2c5d763c1939fbd130452ee0d4d1a44b5dd97bb7 Author: Jens Axboe Date: Sat Aug 21 07:21:19 2021 -0600 io_uring: add clarifying comment for io_cqring_ev_posted() We've previously had an issue where overflow flush unconditionally calls io_cqring_ev_posted() even if it didn't flush any events to the ring, causing wake and eventfd increment where no new events are available. Some applications don't like that, see commit b18032bb0a88 for details. This came up in discussion for another patch recently, hence add a comment detailing what the relationship between calling the events posted helper and CQ ring entries is. Link: https://lore.kernel.org/io-uring/77a44fce-c831-16a6-8e80-9aee77f496a2@kernel.dk/ Signed-off-by: Jens Axboe commit 0bea96f59ba40e63c0ae93ad6a02417b95f22f4d Author: Pavel Begunkov Date: Fri Aug 20 10:36:36 2021 +0100 io_uring: place fixed tables under memcg limits Fixed tables may be large enough, place all of them together with allocated tags under memcg limits. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b3ac9f5da9821bb59837b5fe25e8ef4be982218c.1629451684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3a1b8a4e843f96b636431450d8d79061605cf74b Author: Pavel Begunkov Date: Fri Aug 20 10:36:35 2021 +0100 io_uring: limit fixed table size by RLIMIT_NOFILE Limit the number of files in io_uring fixed tables by RLIMIT_NOFILE, that's the first and the simpliest restriction that we should impose. Cc: stable@vger.kernel.org Suggested-by: Jens Axboe Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b2756c340aed7d6c0b302c26dab50c6c5907f4ce.1629451684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 99c8bc52d1321ab3a711eba2941eadbe7425230f Author: Hao Xu Date: Sat Aug 21 06:19:54 2021 +0800 io_uring: fix lack of protection for compl_nr coml_nr in ctx_flush_and_put() is not protected by uring_lock, this may cause problems when accessing in parallel: say coml_nr > 0 ctx_flush_and put other context if (compl_nr) get mutex coml_nr > 0 do flush coml_nr = 0 release mutex get mutex do flush (*) release mutex in (*) place, we call io_cqring_ev_posted() and users likely get no events there. To avoid spurious events, re-check the value when under the lock. Fixes: 2c32395d8111 ("io_uring: fix __tctx_task_work() ctx race") Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210820221954.61815-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 187f08c12cd1d81f000cdc9c0119ef6e0a6f47e3 Author: wangyangbo Date: Thu Aug 19 13:56:57 2021 +0800 io_uring: Add register support for non-4k PAGE_SIZE Now allocated rsrc table uses PAGE_SIZE as the size of 2nd-level, and accessing this table relies on each level index from fixed TABLE_SHIFT (12 - 3) in 4k page case. In order to correctly work in non-4k page, define TABLE_SHIFT as non-fixed (PAGE_SHIFT - shift of data) for 2nd-level table entry number. Signed-off-by: wangyangbo Link: https://lore.kernel.org/r/20210819055657.27327-1-wangyangbo@uniontech.com Signed-off-by: Jens Axboe commit e98e49b2bbf777f91732dc916d7ad33876c663c9 Author: Pavel Begunkov Date: Wed Aug 18 17:01:43 2021 +0100 io_uring: extend task put optimisations Now with IRQ completions done via IRQ, almost all requests freeing are done from the context of submitter task, so it makes sense to extend task_put optimisation from io_req_free_batch_finish() to cover all the cases including task_work by moving it into io_put_task(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/824a7cbd745ddeee4a0f3ff85c558a24fd005872.1629302453.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 316319e82f7342ef327223a23199648bfabeadcd Author: Jens Axboe Date: Thu Aug 19 09:41:42 2021 -0600 io_uring: add comments on why PF_EXITING checking is safe We have two checks of task->flags & PF_EXITING left: 1) In io_req_task_submit(), which is called in task_work and hence always in the context of the original task. That means that req->task == current, and hence checking ->flags is totally fine. 2) In io_poll_rewait(), where we need to stop re-arming poll to prevent it interfering with cancelation. This is only run from task_work as well, and hence for this case too req->task == current. Add a comment to both spots detailing that. Signed-off-by: Jens Axboe commit 79dca1846fe979304ad0b998e56b20326e2e5a72 Author: Hao Xu Date: Tue Aug 10 20:55:54 2021 +0800 io-wq: move nr_running and worker_refs out of wqe->lock protection We don't need to protect nr_running and worker_refs by wqe->lock, so narrow the range of raw_spin_lock_irq - raw_spin_unlock_irq Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20210810125554.99229-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit ec3c3d0f3a271b5c7422449262970e7eb98f2126 Author: Pavel Begunkov Date: Wed Aug 18 10:50:52 2021 +0100 io_uring: fix io_timeout_remove locking io_timeout_cancel() posts CQEs so needs ->completion_lock to be held, so grab it in io_timeout_remove(). Fixes: 48ecb6369f1f2 ("io_uring: run timeouts from task_work") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d6f03d653a4d7bf693ef6f39b6a426b6d97fd96f.1629280204.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 23a65db83b3f4549e5eee1fb5517c3365f627699 Author: Pavel Begunkov Date: Tue Aug 17 20:28:11 2021 +0100 io_uring: improve same wq polling Move earlier the check for whether __io_queue_proc() tries to poll already polled waitqueue, and do the same for the second poll entry, if any. Shouldn't really matter, but at least it would have a more predictable behaviour. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8cb428cfe8ade0fd055859fabb878db8777d4c2f.1629228203.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 505657bc6c52b01304d8a7c79b2f98878e3d83db Author: Pavel Begunkov Date: Tue Aug 17 20:28:09 2021 +0100 io_uring: reuse io_req_complete_post() We have io_req_complete_post() to post a CQE and put the request. It takes care of all synchronisation and is more concise and efficent, so replace all hancoded occurrences of "lock; post CQE; unlock; + put_req()" with io_req_complete_post(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2c83463458a613f9d870e5147eb134da2aa70779.1629228203.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ae421d9350b51cba1daa28ee6eb14fbce7517eca Author: Pavel Begunkov Date: Tue Aug 17 20:28:08 2021 +0100 io_uring: better encapsulate buffer select for rw Make io_put_rw_kbuf() to do the REQ_F_BUFFER_SELECTED check, so all the callers don't need to hand code it. The number of places where we call io_put_rw_kbuf() is growing, so saves some pain. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3df3919e5e7efe03420c44ab4d9317a81a9cf398.1629228203.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 906c6caaf586180261ea581915e1cf8bc466bd69 Author: Pavel Begunkov Date: Sun Aug 15 10:40:26 2021 +0100 io_uring: optimise io_prep_linked_timeout() Linked timeout handling during issuing is heavy, it adds extra instructions and forces to save the next linked timeout before io_issue_sqe(). Follwing the same reasoning as in refcounting patches, a request can't be freed by the time it returns from io_issue_sqe(), so now we don't need to do io_prep_linked_timeout() in advance, and it can be delayed to colder paths optimising the generic path. Also, it should also save quite a lot for requests with linked timeouts and completed inline on timeout spinlocking + hrtimer_start() + hrtimer_try_to_cancel() and so on. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/19bfc9a0d26c5c5f1e359f7650afe807ca8ef879.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0756a8691017518ceeca4c083e7a359107186498 Author: Pavel Begunkov Date: Sun Aug 15 10:40:25 2021 +0100 io_uring: cancel not-armed linked touts separately Adjust io_disarm_next(), so it can detect if there is a linked but not-yet-armed timeout and complete/cancel it separately. Will be used in the following patch. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ae228cde2c0df3d92d29d5e4852ed9fa8a2a97db.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4d13d1a4d1e1807e04b846b48934e87016027f90 Author: Pavel Begunkov Date: Sun Aug 15 10:40:24 2021 +0100 io_uring: simplify io_prep_linked_timeout The link test in io_prep_linked_timeout() is pretty bulky, replace it with a flag. It's better for normal path and linked requests, and also will be used further for request failing. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3703770bfae8bc1ff370e43ef5767940202cab42.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b97e736a4b553ff18963019c7ca91cd684f83709 Author: Pavel Begunkov Date: Sun Aug 15 10:40:23 2021 +0100 io_uring: kill REQ_F_LTIMEOUT_ACTIVE Instead of handling double consecutive linked timeouts through tricky flag combinations, just check the submit_state.link during timeout_prep and fail that case in advance. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/04150760b0dc739522264b8abd309409f7421a06.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit fd08e5309bba8672c1190362dff6c92bfd59218d Author: Pavel Begunkov Date: Wed Aug 11 19:28:31 2021 +0100 io_uring: optimise hot path of ltimeout prep io_prep_linked_timeout() grew too heavy and compiler now refuse to inline the function. Help it by splitting in two and annotating with inline. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/560636717a32e9513724f09b9ecaace942dde4d4.1628705069.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 8cb01fac982a3f8622a46821af1eb68136f936ca Author: Pavel Begunkov Date: Sun Aug 15 10:40:22 2021 +0100 io_uring: deduplicate cancellation code IORING_OP_ASYNC_CANCEL and IORING_OP_LINK_TIMEOUT have enough of overlap, so extract a helper for request cancellation and use in both. Also, removes some amount of ugliness because of success_ret. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/900122b588e65b637e71bfec80a260726c6a54d6.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a8576af9d1b03a1b8aba7228e938ab0817fdbda6 Author: Pavel Begunkov Date: Sun Aug 15 10:40:21 2021 +0100 io_uring: kill not necessary resubmit switch 773af69121ecc ("io_uring: always reissue from task_work context") makes all resubmission to be made from task_work, so we don't need that hack with resubmit/not-resubmit switch anymore. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/47fa177cca04e5ffd308a35227966c8e15d8525b.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit fb6820998f57a3e63a382a322530fa28522a2bba Author: Pavel Begunkov Date: Sun Aug 15 10:40:20 2021 +0100 io_uring: optimise initial ltimeout refcounting Linked timeouts are never refcounted when it comes to the first call to __io_prep_linked_timeout(), so save an io_ref_get() and set the desired value directly. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/177b24cc62ffbb42d915d6eb9e8876266e4c0d5a.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 761bcac1573efc99042d59add94d468bf17127f0 Author: Pavel Begunkov Date: Sun Aug 15 10:40:19 2021 +0100 io_uring: don't inflight-track linked timeouts Tracking linked timeouts as infligh was needed to make sure that io-wq is not destroyed by io_uring_cancel_generic() racing with io_async_cancel_one() accessing it. Now, cancellations issued by linked timeouts are done in the task context, so it's already synchronised. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e1b05cf47cb69df2305efdbee8cf7ba36f46c1a3.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 48dcd38d73c22b22bf9dc1c01b0ca0b8414b31da Author: Pavel Begunkov Date: Sun Aug 15 10:40:18 2021 +0100 io_uring: optimise iowq refcounting If a requests is forwarded into io-wq, there is a good chance it hasn't been refcounted yet and we can save one req_ref_get() by setting the refcount number to the right value directly. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2d53f4449faaf73b4a4c5de667fc3c176d974860.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a141dd896f544df9627502cfb3fc1a73fb6587e4 Author: Jens Axboe Date: Thu Aug 12 12:48:34 2021 -0600 io_uring: correct __must_hold annotation io_req_free_batch() has a __must_hold annotation referencing a request being passed in, but we're passing in the context. Signed-off-by: Jens Axboe commit 41a5169c23ebe85fdd0b64a0b6381f486a34ef3c Author: Hao Xu Date: Thu Aug 12 15:47:02 2021 +0800 io_uring: code clean for completion_lock in io_arm_poll_handler() We can merge two spin_unlock() operations to one since we removed some code not long ago. Signed-off-by: Hao Xu Signed-off-by: Jens Axboe commit f552a27afe67f05c47bb0c33b92af2a23b684c31 Author: Hao Xu Date: Thu Aug 12 12:14:35 2021 +0800 io_uring: remove files pointer in cancellation functions When doing cancellation, we use a parameter to indicate where it's from do_exit or exec. So a boolean value is good enough for this, remove the struct files* as it is not necessary. Signed-off-by: Hao Xu [axboe: fixup io_uring_files_cancel for !CONFIG_IO_URING] Signed-off-by: Jens Axboe commit a4aadd11ea4932588e6530ecd021ffe39f9d5adf Author: Hao Xu Date: Thu Aug 12 12:14:34 2021 +0800 io_uring: extract io_uring_files_cancel() in io_uring_task_cancel() Extract io_uring_files_cancel() call in io_uring_task_cancel() to make io_uring_files_cancel() and io_uring_task_cancel() coherent and easy to read. Signed-off-by: Hao Xu Signed-off-by: Jens Axboe commit 20e60a3832089741d6b25c13d291050c5d00b4e7 Author: Pavel Begunkov Date: Wed Aug 11 19:28:30 2021 +0100 io_uring: skip request refcounting As submission references are gone, there is only one initial reference left. Instead of actually doing atomic refcounting, add a flag indicating whether we're going to take more refs or doing any other sync magic. The flag should be set before the request may get used in parallel. Together with the previous patch it saves 2 refcount atomics per request for IOPOLL and IRQ completions, and 1 atomic per req for inline completions, with some exceptions. In particular, currently, there are three cases, when the refcounting have to be enabled: - Polling, including apoll. Because double poll entries takes a ref. Might get relaxed in the near future. - Link timeouts, enabled for both, the timeout and the request it's bound to, because they work in-parallel and we need to synchronise to cancel one of them on completion. - When a request gets in io-wq, because it doesn't hold uring_lock and we need guarantees of submission references. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8b204b6c5f6643062270a1913d6d3a7f8f795fd9.1628705069.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5d5901a3434064e98c1dbb3047b9f9793825ea42 Author: Pavel Begunkov Date: Wed Aug 11 19:28:29 2021 +0100 io_uring: remove submission references Requests are by default given with two references, submission and completion. Completion references are straightforward, they represent request ownership and are put when a request is completed or so. Submission references are a bit more trickier. They're needed when io_issue_sqe() followed deep into the submission stack (e.g. in fs, block, drivers, etc.), request may have given away for concurrent execution or already completed, and the code unwinding back to io_issue_sqe() may be accessing some pieces of our requests, e.g. file or iov. Now, we prevent such async/in-depth completions by pushing requests through task_work. Punting to io-wq is also done through task_works, apart from a couple of cases with a pretty well known context. So, there're two cases: 1) io_issue_sqe() from the task context and protected by ->uring_lock. Either requests return back to io_uring or handed to task_work, which won't be executed because we're currently controlling that task. So, we can be sure that requests are staying alive all the time and we don't need submission references to pin them. 2) io_issue_sqe() from io-wq, which doesn't hold the mutex. The role of submission reference is played by io-wq reference, which is put by io_wq_submit_work(). Hence, it should be fine. Considering that, we can carefully kill the submission reference. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6b68f1c763229a590f2a27148aee77767a8d7750.1628705069.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 91c2f6978311afe1f49094fdd90fd6ab29b66223 Author: Pavel Begunkov Date: Wed Aug 11 19:28:28 2021 +0100 io_uring: remove req_ref_sub_and_test() Soon, we won't need to put several references at once, remove req_ref_sub_and_test() and @nr argument from io_put_req_deferred(), and put the rest of the references by hand. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1868c7554108bff9194fb5757e77be23fadf7fc0.1628705069.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 21c843d5825b949332fe58495007ca531ef6ae91 Author: Pavel Begunkov Date: Wed Aug 11 19:28:27 2021 +0100 io_uring: move req_ref_get() and friends Move all request refcount helpers to avoid forward declarations in the future. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/89fd36f6f3fe5b733dfe4546c24725eee40df605.1628705069.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 79ebeaee8a21a00417d89f1a02019f79840d9bad Author: Jens Axboe Date: Tue Aug 10 15:18:27 2021 -0600 io_uring: remove IRQ aspect of io_ring_ctx completion lock We have no hard/soft IRQ users of this lock left, remove any IRQ disabling/saving and restoring when grabbing this lock. This is straight forward with no users entering with IRQs disabled anymore, the only thing to look out for is the waitqueue poll head lock which nests inside the completion lock. That needs IRQs disabled, and hence we have to do that now instead of relying on the outer lock doing so. Signed-off-by: Jens Axboe commit 8ef12efe26c8e44323011e57753b8c0e87af1582 Author: Jens Axboe Date: Tue Aug 10 15:15:25 2021 -0600 io_uring: run regular file completions from task_work This is in preparation to making the completion lock work outside of hard/soft IRQ context. Signed-off-by: Jens Axboe commit 89b263f6d56e683ddcf7643140271ef6e36c72b9 Author: Jens Axboe Date: Tue Aug 10 15:14:18 2021 -0600 io_uring: run linked timeouts from task_work This is in preparation to making the completion lock work outside of hard/soft IRQ context. Signed-off-by: Jens Axboe commit 89850fce16a1a75caacca77cfa0c829aeea4f886 Author: Jens Axboe Date: Tue Aug 10 15:11:51 2021 -0600 io_uring: run timeouts from task_work This is in preparation to making the completion lock work outside of hard/soft IRQ context. Add a timeout_lock to handle the ordering of timeout completions or cancelations with the timeouts actually triggering. Signed-off-by: Jens Axboe commit 62906e89e63ba497105c0e3558089a10365f4f33 Author: Pavel Begunkov Date: Tue Aug 10 14:52:47 2021 +0100 io_uring: remove file batch-get optimisation For requests with non-fixed files, instead of grabbing just one reference, we get by the number of left requests, so the following requests using the same file can take it without atomics. However, it's not all win. If there is one request in the middle not using files or having a fixed file, we'll need to put back the left references. Even worse if an application submits requests dealing with different files, it will do a put for each new request, so doubling the number of atomics needed. Also, even if not used, it's still takes some cycles in the submission path. If a file used many times, it rather makes sense to pre-register it, if not, we may fall in the described pitfall. So, this optimisation is a matter of use case. Go with the simpliest code-wise way, remove it. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 6294f3686b4d77771ab8b161304ada546e71d36a Author: Pavel Begunkov Date: Tue Aug 10 17:53:55 2021 +0100 io_uring: clean up tctx_task_work() After recent fixes, tctx_task_work() always does proper spinlocking before looking into ->task_list, so now we don't need atomics for ->task_state, replace it with non-atomic task_running using the critical section. Tide it up, combine two separate block with spinlocking, and always try to splice in there, so we do less locking when new requests are arriving during the function execution. Signed-off-by: Pavel Begunkov [axboe: fix missing ->task_running reset on task_work_add() failure] Signed-off-by: Jens Axboe commit 5d70904367b45b74dab9da5c023b6629f511e48f Author: Pavel Begunkov Date: Mon Aug 9 20:18:13 2021 +0100 io_uring: inline io_poll_remove_waitqs Inline io_poll_remove_waitqs() into its only user and clean it up. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2f1a91a19ffcd591531dc4c61e2f11c64a2d6a6d.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 90f67366cb8871951399fb5bcf182e902b896615 Author: Pavel Begunkov Date: Mon Aug 9 20:18:12 2021 +0100 io_uring: remove extra argument for overflow flush Unlike __io_cqring_overflow_flush(), nobody does forced flushing with io_cqring_overflow_flush(), so removed the argument from it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7594f869ca41b7cfb5a35a3c7c2d402242834e9e.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cd0ca2e048dc0ddea4f59354b0b8ce4548a76a91 Author: Pavel Begunkov Date: Mon Aug 9 20:18:11 2021 +0100 io_uring: inline struct io_comp_state Inline struct io_comp_state into struct io_submit_state. They are already coupled tightly, together with mixed responsibilities it only brings confusion having them separately. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e55bba77426b399e3a2e54e3c6c267c6a0fc4b57.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit bb943b8265c84e9553903161bc39ff45f427d00d Author: Pavel Begunkov Date: Mon Aug 9 20:18:10 2021 +0100 io_uring: use inflight_entry instead of compl.list req->compl.list is used to cache freed requests, and so can't overlap in time with req->inflight_entry. So, use inflight_entry to link requests and remove compl.list. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e430e79d22d70a190d718831bda7bfed1daf8976.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7255834ed6ef9658b9e7fb192da6a323a64eac98 Author: Pavel Begunkov Date: Mon Aug 9 20:18:09 2021 +0100 io_uring: remove redundant args from cache_free We don't use @tsk argument of io_req_cache_free(), remove it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6a28b4a58ee0aaf0db98e2179b9c9f06f9b0cca1.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c34b025f2d2149d4351b994a923fa687a32478f8 Author: Pavel Begunkov Date: Mon Aug 9 20:18:08 2021 +0100 io_uring: cache __io_free_req()'d requests Don't kfree requests in __io_free_req() but put them back into the internal request cache. That makes allocations more sustainable and will be used for refcounting optimisations. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9f4950fbe7771c8d41799366d0a3a08ac3040236.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f56165e62fae78200292857628e4f1d8d12a0ed0 Author: Pavel Begunkov Date: Mon Aug 9 20:18:07 2021 +0100 io_uring: move io_fallback_req_func() Move io_fallback_req_func() to kill yet another forward declaration. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d0a8f9d9a0057ed761d6237167d51c9378798d2d.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e9dbe221f5d1c974c853da94eee456803239cab5 Author: Pavel Begunkov Date: Mon Aug 9 13:04:20 2021 +0100 io_uring: optimise putting task struct We cache all the reference to task + tctx, so if io_put_task() is called by the corresponding task itself, we can save on atomics and return the refs right back into the cache. It's beneficial for all inline completions, and also iopolling, when polling and submissions are done by the same task, including SQPOLL|IOPOLL. Note: io_uring_cancel_generic() can return refs to the cache as well, so those should be flushed in the loop for tctx_inflight() to work right. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6fe9646b3cb70e46aca1f58426776e368c8926b3.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit af066f31eb3dac2a11516315d47a286a7b3b07df Author: Pavel Begunkov Date: Mon Aug 9 13:04:19 2021 +0100 io_uring: drop exec checks from io_req_task_submit In case of on-exec io_uring cancellations, tasks already wait for all submitted requests to get completed/cancelled, so we don't need to check for ->in_execve separately. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/be8707049f10df9d20ca03dc4ca3316239b5e8e0.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit bbbca0948989aa1a8a75b99bcdece677ad06dfe6 Author: Pavel Begunkov Date: Mon Aug 9 13:04:18 2021 +0100 io_uring: kill unused IO_IOPOLL_BATCH IO_IOPOLL_BATCH is not used, delete it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b2bdf19dbee2c9fc8865bbab9412135a14e24a64.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 58d3be2c60d2cf4e6bb65bb6200fa39a7bc477f9 Author: Pavel Begunkov Date: Mon Aug 9 13:04:17 2021 +0100 io_uring: improve ctx hang handling If io_ring_exit_work() can't get it done in 5 minutes, something is going very wrong, don't keep spinning at HZ / 20 rate, it doesn't help and it may take much of CPU time if there is a lot of workers stuck as such. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9e2d1ca81d569f6bc628af1a42ff6663bff7ce9c.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d3fddf6dddd84432161eb070ed8e34d14c8bf56a Author: Pavel Begunkov Date: Mon Aug 9 13:04:16 2021 +0100 io_uring: deduplicate open iopoll check Move IORING_SETUP_IOPOLL check into __io_openat_prep(), so both openat and openat2 reuse it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9a73ce83e4ee60d011180ef177eecef8e87ff2a2.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 543af3a13da308f2cea954644b43c2c9f864c350 Author: Pavel Begunkov Date: Mon Aug 9 13:04:15 2021 +0100 io_uring: inline io_free_req_deferred Inline io_free_req_deferred(), there is no reason to keep it separated. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ce04b7180d4eac0d69dd00677b227eefe80c2cc5.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b9bd2bea0f22f502019266dce368a9cd477ac721 Author: Pavel Begunkov Date: Mon Aug 9 09:09:47 2021 -0600 io_uring: move io_rsrc_node_alloc() definition Move the function together with io_rsrc_node_ref_zero() in the source file as it is to get rid of forward declarations. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/4d81f6f833e7d017860b24463a9a68b14a8a5ed2.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6a290a1442b45afb55d6a87619b716e5031d7c3e Author: Pavel Begunkov Date: Mon Aug 9 13:04:13 2021 +0100 io_uring: move io_put_task() definition Move the function in the source file as it is to get rid of forward declarations. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/33d917d69e4206557c75a5b98fe22bcdf77ce47d.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e73c5c7cd3e21bb95032a9ed3593c000f17f9ab8 Author: Pavel Begunkov Date: Mon Aug 9 13:04:12 2021 +0100 io_uring: extract a helper for ctx quiesce Refactor __io_uring_register() by extracting a helper responsible for ctx queisce. Looks better and will make it easier to add more optimisations. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0339e0027504176be09237eefa7945bf9a6f153d.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 90291099f24a82863e00de136d95ad7e73560107 Author: Pavel Begunkov Date: Mon Aug 9 09:07:32 2021 -0600 io_uring: optimise io_cqring_wait() hot path Turns out we always init struct io_wait_queue in io_cqring_wait(), even if it's not used after, i.e. there are already enough of CQEs. And often it's exactly what happens, for instance, requests may have been completed inline, or in case of io_uring_enter(submit=N, wait=1). It shows up in my profiler, so optimise it by delaying the struct init. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6f1b81c60b947d165583dc333947869c3d85d037.1628471125.git.asml.silence@gmail.com [axboe: fixed up for new cqring wait] Signed-off-by: Jens Axboe commit 282cdc86937bd31cf0ea49978ad7a42cfe12ea35 Author: Pavel Begunkov Date: Mon Aug 9 13:04:10 2021 +0100 io_uring: add more locking annotations for submit Add more annotations for submission path functions holding ->uring_lock. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/128ec4185e26fbd661dd3a424aa66108ee8ff951.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a2416e1ec23c6b79010d03d69c0e4e035339b4ad Author: Pavel Begunkov Date: Mon Aug 9 13:04:09 2021 +0100 io_uring: don't halt iopoll too early IOPOLL users should care more about getting completions for requests they submitted, but not in "device did/completed something". Currently, io_do_iopoll() may return a positive number, which will instruct io_iopoll_check() to break the loop and end the syscall, even if there is not enough CQEs or none at all. Don't return positive numbers, so io_iopoll_check() exits only when it gets an actual error, need reschedule or got enough CQEs. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/641a88f751623b6758303b3171f0a4141f06726e.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 864ea921b0300fe5a4db9136b7e307e94b369530 Author: Pavel Begunkov Date: Mon Aug 9 13:04:08 2021 +0100 io_uring: refactor io_alloc_req Replace the main if of io_flush_cached_reqs() with inverted condition + goto, so all the cases are handled in the same way. And also extract io_preinit_req() to make it cleaner and easier to refer to. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1abcba1f7b55dc53bf1dbe95036e345ffb1d5b01.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 8724dd8c833832c398c3578340374f45d6d9dd0d Author: Pavel Begunkov Date: Mon Aug 9 13:04:07 2021 +0100 io-wq: improve wq_list_add_tail() Prepare nodes that we're going to add before actually linking them, it's always safer and costs us nothing. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f7e53f0c84c02ed6748c488ed0789b98f8cc6185.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2215bed9246dbb95df50fcef788b0765c7c2aac0 Author: Pavel Begunkov Date: Mon Aug 9 13:04:06 2021 +0100 io_uring: remove unnecessary PF_EXITING check We prefer nornal task_works even if it would fail requests inside. Kill a PF_EXITING check in io_req_task_work_add(), task_work_add() handles well dying tasks, i.e. return error when can't enqueue due to late stages of do_exit(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fc14297e8441cd8f5d1743a2488cf0df09bf48ac.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ebc11b6c6b87da5c83b4d934893a893f49160bc3 Author: Pavel Begunkov Date: Mon Aug 9 13:04:05 2021 +0100 io_uring: clean io-wq callbacks Move io-wq callbacks closer to each other, so it's easier to work with them, and rename io_free_work() into io_wq_free_work() for consistency. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/851bbc7f0f86f206d8c1333efee8bcb9c26e419f.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c97d8a0f68b30960e9c8089bc37cc3b96a96f84d Author: Pavel Begunkov Date: Mon Aug 9 13:04:04 2021 +0100 io_uring: avoid touching inode in rw prep If we use fixed files, we can be sure (almost) that REQ_F_ISREG is set. However, for non-reg files io_prep_rw() still will look into inode to double check, and that's expensive and can be avoided. The only caveat is that it only currently works with 64+ bit architectures, see FFS_ISREG, so we should consider that. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0a62780c491ca2522cd52db4ae3f16e03aafed0f.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b191e2dfe5955b392bc8c0ae546dfa5a13649c38 Author: Pavel Begunkov Date: Mon Aug 9 13:04:03 2021 +0100 io_uring: rename io_file_supports_async() io_file_supports_async() checks whether a file supports nowait operations, so "async" in the name is misleading. Rename it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/33d55b5ce43aa1884c637c1957f1e30d30dc3bec.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ac177053bb2cb1f3c4c8bf89bce34c3f2c4823a7 Author: Pavel Begunkov Date: Mon Aug 9 13:04:02 2021 +0100 io_uring: inline fixed part of io_file_get() Optimise io_file_get() with registered files, which is in a hot path, by inlining parts of the function. Saves a function call, and inefficiencies of passing arguments, e.g. evaluating (sqe_flags & IOSQE_FIXED_FILE). It couldn't have been done before as compilers were refusing to inline it because of the function size. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/52115cd6ce28f33bd0923149c0e6cb611084a0b1.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 042b0d85eabb79909ef29063fb45d363cbc0a85d Author: Pavel Begunkov Date: Mon Aug 9 13:04:01 2021 +0100 io_uring: use kvmalloc for fixed files Instead of hand-coded two-level tables for registered files, allocate them with kvmalloc(). In many cases small enough tables are enough, and so can be kmalloc()'ed removing an extra memory load and a bunch of bit logic instructions from the hot path. If the table is larger, we trade off all the pros with a TLB-assisted memory lookup. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/280421d3b48775dabab773006bb5588c7b2dabc0.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5fd4617840596884334332f36cabfe0deabe85c8 Author: Jens Axboe Date: Fri Aug 6 14:04:31 2021 -0600 io_uring: be smarter about waking multiple CQ ring waiters Currently we only wake the first waiter, even if we have enough entries posted to satisfy multiple waiters. Improve that situation so that every waiter knows how much the CQ tail has to advance before they can be safely woken up. With this change, if we have N waiters each asking for 1 event and we get 4 completions, then we wake up 4 waiters. If we have N waiters asking for 2 completions and we get 4 completions, then we wake up the first two. Previously, only the first waiter would've been woken up. Signed-off-by: Jens Axboe commit d3e9f732c415cf22faa33d6f195e291ad82dc92e Author: Jens Axboe Date: Wed Aug 4 08:37:25 2021 -0600 io-wq: remove GFP_ATOMIC allocation off schedule out path Daniel reports that the v5.14-rc4-rt4 kernel throws a BUG when running stress-ng: | [ 90.202543] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:35 | [ 90.202549] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 2047, name: iou-wrk-2041 | [ 90.202555] CPU: 5 PID: 2047 Comm: iou-wrk-2041 Tainted: G W 5.14.0-rc4-rt4+ #89 | [ 90.202559] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 | [ 90.202561] Call Trace: | [ 90.202577] dump_stack_lvl+0x34/0x44 | [ 90.202584] ___might_sleep.cold+0x87/0x94 | [ 90.202588] rt_spin_lock+0x19/0x70 | [ 90.202593] ___slab_alloc+0xcb/0x7d0 | [ 90.202598] ? newidle_balance.constprop.0+0xf5/0x3b0 | [ 90.202603] ? dequeue_entity+0xc3/0x290 | [ 90.202605] ? io_wqe_dec_running.isra.0+0x98/0xe0 | [ 90.202610] ? pick_next_task_fair+0xb9/0x330 | [ 90.202612] ? __schedule+0x670/0x1410 | [ 90.202615] ? io_wqe_dec_running.isra.0+0x98/0xe0 | [ 90.202618] kmem_cache_alloc_trace+0x79/0x1f0 | [ 90.202621] io_wqe_dec_running.isra.0+0x98/0xe0 | [ 90.202625] io_wq_worker_sleeping+0x37/0x50 | [ 90.202628] schedule+0x30/0xd0 | [ 90.202630] schedule_timeout+0x8f/0x1a0 | [ 90.202634] ? __bpf_trace_tick_stop+0x10/0x10 | [ 90.202637] io_wqe_worker+0xfd/0x320 | [ 90.202641] ? finish_task_switch.isra.0+0xd3/0x290 | [ 90.202644] ? io_worker_handle_work+0x670/0x670 | [ 90.202646] ? io_worker_handle_work+0x670/0x670 | [ 90.202649] ret_from_fork+0x22/0x30 which is due to the RT kernel not liking a GFP_ATOMIC allocation inside a raw spinlock. Besides that not working on RT, doing any kind of allocation from inside schedule() is kind of nasty and should be avoided if at all possible. This particular path happens when an io-wq worker goes to sleep, and we need a new worker to handle pending work. We currently allocate a small data item to hold the information we need to create a new worker, but we can instead include this data in the io_worker struct itself and just protect it with a single bit lock. We only really need one per worker anyway, as we will have run pending work between to sleep cycles. https://lore.kernel.org/lkml/20210804082418.fbibprcwtzyt5qax@beryllium.lan/ Reported-by: Daniel Wagner Tested-by: Daniel Wagner Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 10e7123d5551dec0025f70e61604ab57483a6ed2 Author: Luis Chamberlain Date: Wed Aug 18 16:45:42 2021 +0200 null_blk: add error handling support for add_disk() We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. The actual cleanup in case of error is already handled by the caller of null_gendisk_register(). Signed-off-by: Luis Chamberlain Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-12-hch@lst.de Signed-off-by: Jens Axboe commit dbb301f91fc855dccf9bc42fbc4281d89365906d Author: Luis Chamberlain Date: Wed Aug 18 16:45:41 2021 +0200 virtio_blk: add error handling support for add_disk() We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Signed-off-by: Luis Chamberlain Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-11-hch@lst.de Signed-off-by: Jens Axboe commit 83cbce9574462c6b4eed6797bdaf18fae6859ab3 Author: Luis Chamberlain Date: Wed Aug 18 16:45:40 2021 +0200 block: add error handling for device_add_disk / add_disk Properly unwind on errors in device_add_disk. This is the initial work as drivers are not converted yet, which will follow in separate patches. Signed-off-by: Luis Chamberlain [hch: major rebase. All bugs are probably mine] Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-10-hch@lst.de Signed-off-by: Jens Axboe commit 92e7755ebc69233e25a2d1b760aeff536dc4016b Author: Luis Chamberlain Date: Wed Aug 18 16:45:39 2021 +0200 block: return errors from disk_alloc_events Prepare for proper error handling in add_disk. Signed-off-by: Luis Chamberlain [hch: split from a larger patch] Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-9-hch@lst.de Signed-off-by: Jens Axboe commit 614310c9c8ca15359f4e71a5bbd9165897b4d54e Author: Luis Chamberlain Date: Wed Aug 18 16:45:38 2021 +0200 block: return errors from blk_integrity_add Prepare for proper error handling in add_disk. Signed-off-by: Luis Chamberlain [hch: split from a larger patch] Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-8-hch@lst.de Signed-off-by: Jens Axboe commit 75f4dca59694dfe288ae6a48d7b147b60d11c95c Author: Christoph Hellwig Date: Wed Aug 18 16:45:37 2021 +0200 block: call blk_register_queue earlier in device_add_disk Ensure that all the sysfs bits are set up before bdev_add is called, as that will make the upcomding error handling much easier. However this means the call to disk_update_readahead has to be split as that requires a bdi. Also remove various sanity checks that don't make sense now that blk_register_queue only has a single caller. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210818144542.19305-7-hch@lst.de Signed-off-by: Jens Axboe commit bab53f6b617d9f530978d6e3693f88e586d81a8a Author: Christoph Hellwig Date: Wed Aug 18 16:45:36 2021 +0200 block: call blk_integrity_add earlier in device_add_disk Doing all the sysfs file creation before adding the bdev and thus allowing it to be opened will simplify the about to be added error handling. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-6-hch@lst.de Signed-off-by: Jens Axboe commit 9d5ee6767c85762205b788ed1245f21fafd6c504 Author: Christoph Hellwig Date: Wed Aug 18 16:45:35 2021 +0200 block: create the bdi link earlier in device_add_disk This will simplify error handling going forward. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-5-hch@lst.de Signed-off-by: Jens Axboe commit 8235b5c1e8c1c0537f03a21a2e380098bed25248 Author: Christoph Hellwig Date: Wed Aug 18 16:45:34 2021 +0200 block: call bdev_add later in device_add_disk Once bdev_add is called userspace can open the block device. Ensure that the struct device, which is used for refcounting of the disk besides various other things, is fully setup at that point. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-4-hch@lst.de Signed-off-by: Jens Axboe commit 52b85909f85d06efa69aaf4210e72467f1f58d2b Author: Christoph Hellwig Date: Wed Aug 18 16:45:33 2021 +0200 block: fold register_disk into device_add_disk There is no real reason these should be separate. Also simplify the groups assignment a bit. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210818144542.19305-3-hch@lst.de Signed-off-by: Jens Axboe commit 40b3a52ffc5bc3b5427d5d35b035cfb19d03fdd6 Author: Christoph Hellwig Date: Wed Aug 18 16:45:32 2021 +0200 block: add a sanity check for a live disk in del_gendisk Add a sanity check to del_gendisk to do nothing when the disk wasn't successfully added. This papers over the complete lack of add_disk error handling, which is about to get fixed gradually. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210818144542.19305-2-hch@lst.de Signed-off-by: Jens Axboe commit d152c682f03ceb65c0d9663d4ba6ee2d46aa784d Author: Christoph Hellwig Date: Mon Aug 16 15:46:24 2021 +0200 block: add an explicit ->disk backpointer to the request_queue Replace the magic lookup through the kobject tree with an explicit backpointer, given that the device model links are set up and torn down at times when I/O is still possible, leading to potential NULL or invalid pointer dereferences. Fixes: edb0872f44ec ("block: move the bdi from the request_queue to the gendisk") Reported-by: syzbot Signed-off-by: Christoph Hellwig Tested-by: Sven Schnelle Link: https://lore.kernel.org/r/20210816134624.GA24234@lst.de Signed-off-by: Jens Axboe commit 61a35cfc26334fe1c8e970ca8fafeae2daae257d Author: Christoph Hellwig Date: Mon Aug 16 15:19:09 2021 +0200 block: hold a request_queue reference for the lifetime of struct gendisk Acquire the queue ref dropped in disk_release in __blk_alloc_disk so any allocate gendisk always has a queue reference. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816131910.615153-9-hch@lst.de Signed-off-by: Jens Axboe commit 4a1fa41d304c7129328d4d5c7f31715b95e23b29 Author: Christoph Hellwig Date: Mon Aug 16 15:19:08 2021 +0200 block: pass a request_queue to __blk_alloc_disk Pass in a request_queue and assign disk->queue in __blk_alloc_disk to ensure struct gendisk always has a valid ->queue pointer. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816131910.615153-8-hch@lst.de Signed-off-by: Jens Axboe commit a58bd7683fcb60ae24c8572f932b48bc65719b7c Author: Christoph Hellwig Date: Mon Aug 16 15:19:07 2021 +0200 block: remove the minors argument to __alloc_disk_node This was a leftover from the legacy alloc_disk interface. Switch the scsi ULPs and dasd to set ->minors directly like all other drivers and remove the argument. Signed-off-by: Christoph Hellwig Reviewed-by: Stefan Haberland [dasd] Link: https://lore.kernel.org/r/20210816131910.615153-7-hch@lst.de Signed-off-by: Jens Axboe commit 9c2b9dbafc067e173db30c4fd0636392d27944e8 Author: Christoph Hellwig Date: Mon Aug 16 15:19:06 2021 +0200 block: remove alloc_disk and alloc_disk_node Most drivers should use and have been converted to use blk_alloc_disk and blk_mq_alloc_disk. Only the scsi ULPs and dasd still allocate a disk separately from the request_queue, so don't bother with convenience macros for something that should not see significant new users and remove these wrappers. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816131910.615153-6-hch@lst.de Signed-off-by: Jens Axboe commit 4dcc4874deb41a11ece9c6e8858385235463c1ac Author: Christoph Hellwig Date: Mon Aug 16 15:19:05 2021 +0200 block: cleanup the lockdep handling in *alloc_disk Pass the lockdep name to the low-level __blk_alloc_disk helper and hardcode the name for it given that the number of minors or node_id are not very useful information. While this passes a pointless argument for non-lockdep builds that is not really an issue as disk allocation is a probe time only slow path. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816131910.615153-5-hch@lst.de Signed-off-by: Jens Axboe commit aebbb5831fbd5352fd9bd2c858bc249026d3c652 Author: Christoph Hellwig Date: Mon Aug 16 15:19:04 2021 +0200 sg: do not allocate a gendisk sg is a character driver and thus does not need to allocate a gendisk, which is only used for file system-like block layer I/O on block devices. Signed-off-by: Christoph Hellwig Reviewed-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210816131910.615153-4-hch@lst.de Signed-off-by: Jens Axboe commit 45938335d0a9773d65a82a7ca722bb76e4b997a8 Author: Christoph Hellwig Date: Mon Aug 16 15:19:03 2021 +0200 st: do not allocate a gendisk st is a character driver and thus does not need to allocate a gendisk, which is only used for file system-like block layer I/O on block devices. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816131910.615153-3-hch@lst.de Signed-off-by: Jens Axboe commit 5f432cceb3e9de5223fa50d882c4a43cab39a3ee Author: Christoph Hellwig Date: Mon Aug 16 15:19:02 2021 +0200 nvme: use blk_mq_alloc_disk Switch to use the blk_mq_alloc_disk helper for allocating the request_queue and gendisk. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20210816131910.615153-2-hch@lst.de Signed-off-by: Jens Axboe commit 1ee7943c33431e93faa49bf8fe38f1ad70c48705 Author: Rob Herring Date: Fri Aug 20 11:24:20 2021 -0500 kbuild: Enable dtc 'pci_device_reg' warning by default There's only a couple of instances of the 'pci_device_reg' warnings left and they look legit, so let's enable the warning by default. Cc: Heiko Stuebner Cc: Nicolas Saenz Julienne Cc: soc@kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210820165011.3257112-1-robh@kernel.org/ commit cc8c99613290126663f7f968f07d2535a6cc235a Author: Zenghui Yu Date: Sat Aug 21 11:09:24 2021 +0800 dt-bindings: soc: remove obsolete zte zx header The zte zx platform had been removed in commit 89d4f98ae90d ("ARM: remove zte zx platform"), so this header is no longer needed. Cc: Arnd Bergmann Cc: Jun Nie Cc: Shawn Guo Signed-off-by: Zenghui Yu Link: https://lore.kernel.org/r/20210821030924.192-2-yuzenghui@huawei.com Signed-off-by: Rob Herring commit d014c93515e9867ad903f4e029626aefbd5f743f Author: Zenghui Yu Date: Sat Aug 21 11:09:23 2021 +0800 dt-bindings: clock: remove obsolete zte zx header The zx296718-clkc driver had been removed in commit bcbe6005eb18 ("clk: remove zte zx driver"), so this header is no longer needed. Cc: Arnd Bergmann Cc: Jun Nie Cc: Shawn Guo Signed-off-by: Zenghui Yu Link: https://lore.kernel.org/r/20210821030924.192-1-yuzenghui@huawei.com Signed-off-by: Rob Herring commit 6211e9cb2f8faf7faae0b6caf844bfe9527cc607 Author: Marc Zyngier Date: Fri Aug 20 15:47:22 2021 +0100 of: Don't allow __of_attached_node_sysfs() without CONFIG_SYSFS Trying to boot without SYSFS, but with OF_DYNAMIC quickly results in a crash: [ 0.088460] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000070 [...] [ 0.103927] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc3 #4179 [ 0.105810] Hardware name: linux,dummy-virt (DT) [ 0.107147] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--) [ 0.108876] pc : kernfs_find_and_get_ns+0x3c/0x7c [ 0.110244] lr : kernfs_find_and_get_ns+0x3c/0x7c [...] [ 0.134087] Call trace: [ 0.134800] kernfs_find_and_get_ns+0x3c/0x7c [ 0.136054] safe_name+0x4c/0xd0 [ 0.136994] __of_attach_node_sysfs+0xf8/0x124 [ 0.138287] of_core_init+0x90/0xfc [ 0.139296] driver_init+0x30/0x4c [ 0.140283] kernel_init_freeable+0x160/0x1b8 [ 0.141543] kernel_init+0x30/0x140 [ 0.142561] ret_from_fork+0x10/0x18 While not having sysfs isn't a very common option these days, it is still expected that such configuration would work. Paper over it by bailing out from __of_attach_node_sysfs() if CONFIG_SYSFS isn't enabled. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210820144722.169226-1-maz@kernel.org Signed-off-by: Rob Herring commit 16109b257d110806e9ea90479199f79b55a6d6ee Author: Krzysztof Kozlowski Date: Wed Aug 18 22:29:53 2021 +0200 dt-bindings: memory: convert H8/300 bus controller to dtschema Convert H8/300 bus controller bindings to DT schema format using json-schema. The conversion also extends the bindings to match what is really used in existing devicetree sources (the original file mentions only "renesas,h8300-bsc" but "renesas,h8300h-bsc" and "renesas,h8s-bsc" are used with it). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210818202953.16862-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit cf4e6d52f58399c777276172ec250502e19d5e63 Author: Youquan Song Date: Wed Aug 18 10:57:01 2021 -0700 EDAC/i10nm: Retrieve and print retry_rd_err_log registers Retrieve and print retry_rd_err_log registers like the earlier change: commit e80634a75aba ("EDAC, skx: Retrieve and print retry_rd_err_log registers") This is a little trickier than on Skylake because of potential interference with BIOS use of the same registers. The default behavior is to ignore these registers. A module parameter retry_rd_err_log(default=0) controls the mode of operation: - 0=off : Default. - 1=bios : Linux doesn't reset any control bits, but just reports values. This is "no harm" mode, but it may miss reporting some data. - 2=linux: Linux tries to take control and resets mode bits, clears valid/UC bits after reading. This should be more reliable (especially if BIOS interference is reduced by disabling eMCA reporting mode in BIOS setup). Co-developed-by: Qiuxu Zhuo Signed-off-by: Qiuxu Zhuo Signed-off-by: Youquan Song Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210818175701.1611513-3-tony.luck@intel.com commit 2294a7299f5e51667b841f63c6d69474491753fb Author: Qiuxu Zhuo Date: Wed Aug 18 10:57:00 2021 -0700 EDAC/i10nm: Fix NVDIMM detection MCDDRCFG is a per-channel register and uses bit{0,1} to indicate the NVDIMM presence on DIMM slot{0,1}. Current i10nm_edac driver wrongly uses MCDDRCFG as per-DIMM register and fails to detect the NVDIMM. Fix it by reading MCDDRCFG as per-channel register and using its bit{0,1} to check whether the NVDIMM is populated on DIMM slot{0,1}. Fixes: d4dc89d069aa ("EDAC, i10nm: Add a driver for Intel 10nm server processors") Reported-by: Fan Du Tested-by: Wen Jin Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210818175701.1611513-2-tony.luck@intel.com commit fd07a4a0d30b5468a1f4a0739e34f5f014df7d44 Author: Qiuxu Zhuo Date: Tue Jul 20 09:30:09 2021 -0700 EDAC/skx_common: Set the memory type correctly for HBM memory Set the memory type to MEM_HBM2 if it's managed by the HBM2 memory controller. Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210720163009.GA1417532@agluck-desk2.amr.corp.intel.com commit 6f02c0894921bde9ee4b36c818a2b3d5e6701d5b Merge: d019403a777e9 b947d2b467c0e Author: Mark Brown Date: Mon Aug 23 18:26:22 2021 +0100 Merge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski : Existing skylake-driver supports very basic scenarios with limited range of modules and their control. Attached changes first fix code as several advanced configurations are 'mentioned' throughout the files but are not actually functional. Follow up are changes adding missing support for said configurations. Cezary Rojewski (5): ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373 ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs ASoC: Intel: Skylake: Fix module resource and format selection ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER ASoC: Intel: Skylake: Select first entry for singular pipe config arrays Gustaw Lewandowski (2): ASoC: Intel: Skylake: Fix passing loadable flag for module ASoC: Intel: Skylake: Simplify m_state for loadable modules Kareem Shaik (1): ASoC: Intel: Skylake: Support multiple format configs Pawel Harlozinski (1): ASoC: Intel: Skylake: Properly configure modules with generic extension Piotr Maziarz (1): ASoC: Intel: Skylake: Select proper format for NHLT blob Szymon Mielczarek (1): ASoC: Intel: Skylake: Support modules with generic extension include/uapi/sound/snd_sst_tokens.h | 6 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 55 +------ sound/soc/intel/skylake/skl-messages.c | 155 ++++++++++++------- sound/soc/intel/skylake/skl-pcm.c | 25 ++- sound/soc/intel/skylake/skl-topology.c | 155 +++++++++++-------- sound/soc/intel/skylake/skl-topology.h | 26 +++- 6 files changed, 231 insertions(+), 191 deletions(-) -- 2.25.1 commit 94c821fb286b545d37549ff30a0c341e066f0d6c Author: Chao Yu Date: Fri Aug 20 18:54:59 2021 +0800 f2fs: rebuild nat_bits during umount If all free_nat_bitmap are available, we can rebuild nat_bits from free_nat_bitmap entirely during umount, let's make another chance to reenable nat_bits for image. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a4b6817625e71d5d4aee16cacf7a7fec077c6dbe Author: Daeho Jeong Date: Fri Aug 20 15:29:09 2021 -0700 f2fs: introduce periodic iostat io latency traces Whenever we notice some sluggish issues on our machines, we are always curious about how well all types of I/O in the f2fs filesystem are handled. But, it's hard to get this kind of real data. First of all, we need to reproduce the issue while turning on the profiling tool like blktrace, but the issue doesn't happen again easily. Second, with the intervention of any tools, the overall timing of the issue will be slightly changed and it sometimes makes us hard to figure it out. So, I added the feature printing out IO latency statistics tracepoint events, which are minimal things to understand filesystem's I/O related behaviors, into F2FS_IOSTAT kernel config. With "iostat_enable" sysfs node on, we can get this statistics info in a periodic way and it would cause the least overhead. [samples] f2fs_ckpt-254:1-507 [003] .... 2842.439683: f2fs_iostat_latency: dev = (254,11), iotype [peak lat.(ms)/avg lat.(ms)/count], rd_data [136/1/801], rd_node [136/1/1704], rd_meta [4/2/4], wr_sync_data [164/16/3331], wr_sync_node [152/3/648], wr_sync_meta [160/2/4243], wr_async_data [24/13/15], wr_async_node [0/0/0], wr_async_meta [0/0/0] f2fs_ckpt-254:1-507 [002] .... 2845.450514: f2fs_iostat_latency: dev = (254,11), iotype [peak lat.(ms)/avg lat.(ms)/count], rd_data [60/3/456], rd_node [60/3/1258], rd_meta [0/0/1], wr_sync_data [120/12/2285], wr_sync_node [88/5/428], wr_sync_meta [52/6/2990], wr_async_data [4/1/3], wr_async_node [0/0/0], wr_async_meta [0/0/0] Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 521187439abfb3e1c946796dc2187c443e5457ab Author: Daeho Jeong Date: Thu Aug 19 20:52:28 2021 -0700 f2fs: separate out iostat feature Added F2FS_IOSTAT config option to support getting IO statistics through sysfs and printing out periodic IO statistics tracepoint events and moved I/O statistics related codes into separate files for better maintenance. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu [Jaegeuk Kim: set default=y] Signed-off-by: Jaegeuk Kim commit f985911b7bc75d5c98ed24d8aaa8b94c590f7c6a Author: zhenwei pi Date: Thu Aug 19 20:37:10 2021 +0800 crypto: public_key: fix overflow during implicit conversion Hit kernel warning like this, it can be reproduced by verifying 256 bytes datafile by keyctl command, run script: RAWDATA=rawdata SIGDATA=sigdata modprobe pkcs8_key_parser rm -rf *.der *.pem *.pfx rm -rf $RAWDATA dd if=/dev/random of=$RAWDATA bs=256 count=1 openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem \ -subj "/C=CN/ST=GD/L=SZ/O=vihoo/OU=dev/CN=xx.com/emailAddress=yy@xx.com" KEY_ID=`openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER | keyctl \ padd asymmetric 123 @s` keyctl pkey_sign $KEY_ID 0 $RAWDATA enc=pkcs1 hash=sha1 > $SIGDATA keyctl pkey_verify $KEY_ID 0 $RAWDATA $SIGDATA enc=pkcs1 hash=sha1 Then the kernel reports: WARNING: CPU: 5 PID: 344556 at crypto/rsa-pkcs1pad.c:540 pkcs1pad_verify+0x160/0x190 ... Call Trace: public_key_verify_signature+0x282/0x380 ? software_key_query+0x12d/0x180 ? keyctl_pkey_params_get+0xd6/0x130 asymmetric_key_verify_signature+0x66/0x80 keyctl_pkey_verify+0xa5/0x100 do_syscall_64+0x35/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae The reason of this issue, in function 'asymmetric_key_verify_signature': '.digest_size(u8) = params->in_len(u32)' leads overflow of an u8 value, so use u32 instead of u8 for digest_size field. And reorder struct public_key_signature, it saves 8 bytes on a 64-bit machine. Cc: stable@vger.kernel.org Signed-off-by: zhenwei pi Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit a8db7a3f8ac69e558c7bfbd04802201c39a104ad Author: Prashant Malani Date: Tue Aug 3 10:36:21 2021 -0700 platform/chrome: cros_ec_typec: Use existing feature check Replace the cros_typec_feature_supported() function with the pre-existing cros_ec_check_features() function which does the same thing. Signed-off-by: Prashant Malani Link: https://lore.kernel.org/r/20210803173619.91539-2-pmalani@chromium.org Signed-off-by: Benson Leung commit b661601a9fdf1af8516e1100de8bba84bd41cca4 Author: J. Bruce Fields Date: Fri Aug 20 17:02:02 2021 -0400 lockd: update nlm_lookup_file reexport comment Update comment to reflect that we *do* allow reexport, whether it's a good idea or not.... Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit a81041b7d8f08c4e1014173c5483a0f18724a576 Author: J. Bruce Fields Date: Mon Aug 23 11:26:39 2021 -0400 nlm: minor refactoring Make this lookup slightly more concise, and prepare for changing how we look this up in a following patch. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 2dc6f19e4f438d4c14987cb17aee38aaf7304e7f Author: J. Bruce Fields Date: Mon Aug 23 12:01:18 2021 -0400 nlm: minor nlm_lookup_file argument change It'll come in handy to get the whole nlm_lock. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 047d4226b0bca1cda5267dc68bc8291cce5364ac Author: Stefan Berger Date: Thu Aug 12 22:45:48 2021 +0300 tpm: ibmvtpm: Avoid error message when process gets signal while waiting When rngd is run as root then lots of these types of message will appear in the kernel log if the TPM has been configured to provide random bytes: [ 7406.275163] tpm tpm0: tpm_transmit: tpm_recv: error -4 The issue is caused by the following call that is interrupted while waiting for the TPM's response. sig = wait_event_interruptible(ibmvtpm->wq, !ibmvtpm->tpm_processing_cmd); Rather than waiting for the response in the low level driver, have it use the polling loop in tpm_try_transmit() that uses a command's duration to poll until a result has been returned by the TPM, thus ending when the timeout has occurred but not responding to signals and ctrl-c anymore. To stay in this polling loop extend tpm_ibmvtpm_status() to return 'true' for as long as the vTPM is indicated as being busy in tpm_processing_cmd. Since the loop requires the TPM's timeouts, get them now using tpm_get_timeouts() after setting the TPM2 version flag on the chip. To recreat the resolved issue start rngd like this: sudo rngd -r /dev/hwrng -t sudo rngd -r /dev/tpm0 -t Link: https://bugzilla.redhat.com/show_bug.cgi?id=1981473 Fixes: 6674ff145eef ("tpm_ibmvtpm: properly handle interrupted packet receptions") Cc: Nayna Jain Cc: George Wilson Reported-by: Nageswara R Sastry Signed-off-by: Stefan Berger Tested-by: Nageswara R Sastry Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit a4aed36ed5924a05ecfadc470584188bfba2b928 Author: Stefan Berger Date: Tue Jun 29 17:34:21 2021 -0400 certs: Add support for using elliptic curve keys for signing modules Add support for using elliptic curve keys for signing modules. It uses a NIST P384 (secp384r1) key if the user chooses an elliptic curve key and will have ECDSA support built into the kernel. Note: A developer choosing an ECDSA key for signing modules should still delete the signing key (rm certs/signing_key.*) when building an older version of a kernel that only supports RSA keys. Unless kbuild automati- cally detects and generates a new kernel module key, ECDSA-signed kernel modules will fail signature verification. Cc: David Howells Cc: David Woodhouse Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit ea35e0d5df6c92fa2e124bb1b91d09b2240715ba Author: Stefan Berger Date: Tue Jun 29 17:34:20 2021 -0400 certs: Trigger creation of RSA module signing key if it's not an RSA key Address a kbuild issue where a developer created an ECDSA key for signing kernel modules and then builds an older version of the kernel, when bi- secting the kernel for example, that does not support ECDSA keys. If openssl is installed, trigger the creation of an RSA module signing key if it is not an RSA key. Fixes: cfc411e7fff3 ("Move certificate handling to its own directory") Cc: David Howells Cc: David Woodhouse Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 6824f8554a98cba516c3bfd5f9064d7ba0501644 Author: Adrian Ratiu Date: Tue Jul 27 20:13:13 2021 +0300 char: tpm: cr50_i2c: convert to new probe interface Way back when this driver was written the I2C framework used to insist an ID table be defined even if the driver did not use it in favor of ACPI/OF matching, so it was added just to placate the hard I2C framework requirement. This is no longer the case so we can drop the table and also convert the driver to the new probe interface. Signed-off-by: Adrian Ratiu Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 847fdae1579f4ee930b01f24a7847b8043bf468c Author: Adrian Ratiu Date: Tue Jul 27 20:13:12 2021 +0300 char: tpm: Kconfig: remove bad i2c cr50 select This fixes a minor bug which went unnoticed during the initial driver upstreaming review: TCG_CR50 does not exist in mainline kernels, so remove it. Fixes: 3a253caaad11 ("char: tpm: add i2c driver for cr50") Cc: stable@vger.kernel.org Reviewed-by: Jarkko Sakkinen Signed-off-by: Adrian Ratiu Signed-off-by: Jarkko Sakkinen commit f8c549afd1e76ad78b1d044a307783c9b94ae3ab Author: Lang Cheng Date: Sat Aug 21 17:53:27 2021 +0800 RDMA/hns: Ownerbit mode add control field The ownerbit mode is for external card mode. Make it controlled by the firmware. Fixes: aba457ca890c ("RDMA/hns: Support owner mode doorbell") Link: https://lore.kernel.org/r/1629539607-33217-4-git-send-email-liangwenpeng@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 260f64a40198309008026447f7fda277a73ed8c3 Author: Yixing Liu Date: Sat Aug 21 17:53:26 2021 +0800 RDMA/hns: Enable stash feature of HIP09 The stash feature is enabled by default on HIP09. Fixes: f93c39bc9547 ("RDMA/hns: Add support for QP stash") Fixes: bfefae9f108d ("RDMA/hns: Add support for CQ stash") Link: https://lore.kernel.org/r/1629539607-33217-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 0110a1ed0e8084f928170e055c87f4f046206908 Author: Lang Cheng Date: Sat Aug 21 17:53:25 2021 +0800 RDMA/hns: Remove unsupport cmdq mode CMDQ support un-interrupt mode only, and firmware ignores this mode flag, so remove it. Fixes: a04ff739f2a9 ("RDMA/hns: Add command queue support for hip08 RoCE driver") Link: https://lore.kernel.org/r/1629539607-33217-2-git-send-email-liangwenpeng@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 3f69f4e0d64e90db2852141e3e493295461655e7 Author: Christophe JAILLET Date: Sun Aug 22 14:24:44 2021 +0200 RDMA: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Link: https://lore.kernel.org/r/259e53b7a00f64bf081d41da8761b171b2ad8f5c.1629634798.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 03da1b26fa13b6911ef09e909dad164249410901 Author: Li Zhijian Date: Mon Aug 23 11:52:46 2021 +0800 IB/core: Remove deprecated current_seq comments current_seq was removed since the commit below. Fixes: 36f30e486dce ("IB/core: Improve ODP to use hmm_range_fault()") Link: https://lore.kernel.org/r/20210823035246.3506-1-lizhijian@cn.fujitsu.com Signed-off-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit 745649c59a0d1fde9dcc02286f23f8c78a1f724d Author: Colin Ian King Date: Wed Aug 18 15:10:51 2021 +0100 spi: rockchip-sfc: Fix assigned but never used return error codes Currently there are two places where the error return variable ret is being assigned -ETIMEDOUT on timeout errors and this value is not being returned. Fix this by returning -ETIMEDOUT rather than redundantly assiging it to ret. Addresses-Coverity: ("Unused value") Fixes: 0b89fc0a367e ("spi: rockchip-sfc: add rockchip serial flash controller") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210818141051.36320-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 8d00f9819458b95301e274c6df705df2963ba34f Author: Jon Lin Date: Sat Aug 21 20:49:25 2021 +0800 spi: rockchip-sfc: Remove redundant IO operations Coherent dma buffer is uncached and memcpy is enough. Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20210821124925.6066-1-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit d019403a777e9978767d0551fa55f624baf7df09 Author: Tzung-Bi Shih Date: Mon Aug 23 23:33:23 2021 +0800 ASoC: rt1015: remove possible unused variable `bclk_ms' bclk_ms is possible unused by using the given config (see [1]). sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is never read [clang-analyzer-deadcode.DeadStores] bclk_ms = frame_size > 32; ^ ~~~~~~~~~~~~~~~ In addition, bclk_ms is meaningless and confusing after applying commit a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv"). The "> 32" in the expression looks like a typo but it was not. Let's remove the confusing variable bclk_ms. [1]: https://lkml.org/lkml/2021/8/23/305 Reported-by: kernel test robot Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com Signed-off-by: Mark Brown commit a5ec377133674a0318bfb9342488d5d0ad0e1327 Author: Hans de Goede Date: Mon Aug 23 13:04:32 2021 +0200 ASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static The byt_rt5640_hp_elitepad_1000g2_jack?_check functions are only used inside bytcr_rt5640.c, mark them as static. Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210823110432.64860-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 0aeb17d1728257f29131a290f0cc8e281cc7274c Author: Krzysztof Kozlowski Date: Thu Aug 19 12:10:20 2021 +0200 ASoC: rt1015p: correct indentation Use common enum instead of oneOf and correct indentation warning: realtek,rt1015p.yaml:18:7: [warning] wrong indentation: expected 4 but found 6 (indentation) Signed-off-by: Krzysztof Kozlowski Acked-by: Tzung-Bi Shih Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210819101020.26368-2-krzysztof.kozlowski@canonical.com Signed-off-by: Mark Brown commit c7bd58940bcb38fc506786fccdf51abeac40383e Author: Angelo Dureghello Date: Sat Aug 21 10:26:58 2021 +0200 ASoC: ics43432: add compatible for CUI Devices Add compatible for CUI Devices CMM-4030D-261-I2S-TR. Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20210821082658.4147595-3-angelo.dureghello@timesys.com Signed-off-by: Mark Brown commit 0f28b69e4b5959ee4ae1363b5f6d5dfe76faf36e Author: Angelo Dureghello Date: Sat Aug 21 10:26:57 2021 +0200 dt-bindings: add compatible vendor prefix for CUI Devices Add vendor prefix for CUI Devices. Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20210821082658.4147595-2-angelo.dureghello@timesys.com Signed-off-by: Mark Brown commit 43d2c4982fcc6ed0adfea1275bc6df28bc48c1ea Author: Angelo Dureghello Date: Sat Aug 21 10:26:56 2021 +0200 ASoC: ics43432: add CMM-4030D-261 support Despite minimal datasheet differences, the driver seems perfectly compatible with CMM-4030D-261. Tested CMM-4030D-261 to work with this changes: / { cmm4030d: cmm4030d { #sound-dai-cells = <0>; compatible = "cui,cmm-4030d-261"; }; sound_mic { compatible = "simple-audio-card"; simple-audio-card,name = "i2s mem mic"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&sound_master>; simple-audio-card,frame-master = <&sound_master>; sound_master: simple-audio-card,cpu { sound-dai = <&ssi2>; system-clock-frequency = <2822400>; }; simple-audio-card,codec { sound-dai = <&cmm4030d>; }; }; }; Audio has been captured and tested successfully by: arecord -D "hw:1,0" -f S24_LE > test.wav aplay test.wav Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20210821082658.4147595-1-angelo.dureghello@timesys.com Signed-off-by: Mark Brown commit b947d2b467c0ea275ac3b468974ebe0dd0c0c3bd Author: Cezary Rojewski Date: Wed Aug 18 09:57:42 2021 +0200 ASoC: Intel: Skylake: Select first entry for singular pipe config arrays When pipe does not expose multiple configuration options, always select the first entry without searching for matching one. Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 5b27a71cbbfe6ffb554c87fde2ad9b71841478c2 Author: Pawel Harlozinski Date: Wed Aug 18 09:57:41 2021 +0200 ASoC: Intel: Skylake: Properly configure modules with generic extension Make use of struct skl_base_cfg_ext and its format setter to configure modules which are described with said structure. Signed-off-by: Gustaw Lewandowski Signed-off-by: Pawel Harlozinski Signed-off-by: Szymon Mielczarek Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit db5a3f83a241a98d855e2cecc67869d06cb3e135 Author: Szymon Mielczarek Date: Wed Aug 18 09:57:40 2021 +0200 ASoC: Intel: Skylake: Support modules with generic extension Some DSP modules require, besides the module base configuration, a generic extension containing audio format for all module's pins that are in use. Signed-off-by: Gustaw Lewandowski Signed-off-by: Szymon Mielczarek Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit a4ad42d28618eef83bee02e0a19af0d467bd9722 Author: Kareem Shaik Date: Wed Aug 18 09:57:39 2021 +0200 ASoC: Intel: Skylake: Support multiple format configs A module can have two kinds of set params, as per topology requirements. For example, one pre-init and one post-init. But currently, there is support for just one type, as the format_config. This patch extends the format_configs to 4, so as to be able to support pre-init, post-init and post-bind type of set params, for the same module, simultaneously. Signed-off-by: Kareem Shaik Signed-off-by: Gustaw Lewandowski Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit e4e95d8291831fa63c32e00b59f544f0812dc0b6 Author: Gustaw Lewandowski Date: Wed Aug 18 09:57:38 2021 +0200 ASoC: Intel: Skylake: Simplify m_state for loadable modules States SKL_MODULE_LOADED and SKL_MODULE_UNLOADED are redundant with 'loadable' flag in struct skl_module. Additionally skl_tplg_mixer_dapm_post_pmd_event() sets m_state always to SKL_MODULE_UNINIT so next unload function isn't called for such modules. Signed-off-by: Gustaw Lewandowski Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit c5ed9c547cba1dc1238c6e8a0c290fd62ee6e127 Author: Gustaw Lewandowski Date: Wed Aug 18 09:57:37 2021 +0200 ASoC: Intel: Skylake: Fix passing loadable flag for module skl_get_module_info() tries to set mconfig->module->loadable before mconfig->module has been assigned thus flag was always set to false and driver did not try to load module binaries. Signed-off-by: Gustaw Lewandowski Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit e4e0633bcadc950b4b4af06c7f1bb7f7e3e86321 Author: Cezary Rojewski Date: Wed Aug 18 09:57:36 2021 +0200 ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER KeyPhrasebuffer, Mixin and Mixout modules configuration is described by firmware's basic module configuration structure. There are no extended parameters required. Update functions taking part in building INIT_INSTANCE IPC payload to reflect that. Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit e8b374b649afe756c2470e0e6668022e90bf8518 Author: Cezary Rojewski Date: Wed Aug 18 09:57:35 2021 +0200 ASoC: Intel: Skylake: Fix module resource and format selection Module configuration may differ between its instances depending on resources required and input and output audio format. Available parameters to select from are stored in module resource and interface (format) lists. These come from topology, together with description of each of pipe's modules. Ignoring index value provided by topology and relying always on 0th entry leads to unexpected module behavior due to under/overbudged resources assigned or impropper format selection. Fix by taking entry at index specified by topology. Fixes: f6fa56e22559 ("ASoC: Intel: Skylake: Parse and update module config structure") Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 87b265260046d4e0ed3f150dac2184b9dbd4bf7c Author: Piotr Maziarz Date: Wed Aug 18 09:57:34 2021 +0200 ASoC: Intel: Skylake: Select proper format for NHLT blob Use actual pipeline format, not PCM format for blob selection. Otherwise selected blobs are not correct in pipelines with format conversion e.g.: SRC module. Signed-off-by: Piotr Maziarz Signed-off-by: Lewandowski, Gustaw Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 126b3422adc80f29d2129db7f61e0113a8a526c6 Author: Cezary Rojewski Date: Wed Aug 18 09:57:33 2021 +0200 ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs Advancing pointer initially fixed issue for some users but caused regression for others. Leave data as it to make it easier for end users to adjust their topology files if needed. Fixes: a8cd7066f042 ("ASoC: Intel: Skylake: Strip T and L from TLV IPCs") Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 6d41bbf2fd3615c56dbf2b67f6cbf9e83d14a2e2 Author: Cezary Rojewski Date: Wed Aug 18 09:57:32 2021 +0200 ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373 Contrary to what is said in board's file, topology targeting kbl_da7219_max98373 expects format 16b, not 24/32b. Partially revert changes added in 'ASoC: Intel: Boards: Add Maxim98373 support' to bring old behavior back, aligning with topology expectations. Fixes: 716d53cc7837 ("ASoC: Intel: Boards: Add Maxim98373 support") Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 11e4e66efd440216032f53ee7e5ca08cd263a292 Merge: 96b18047a7172 e22ce8eb631bd Author: aalexandrovich <88376726+aalexandrovich@users.noreply.github.com> Date: Mon Aug 23 16:44:22 2021 +0300 Merge branch 'torvalds:master' into master commit d359902d5c357b280e7a0862bb8a1ba56b3fc197 Author: Jiang Wang Date: Sat Aug 21 18:07:36 2021 +0000 af_unix: Fix NULL pointer bug in unix_shutdown Commit 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") introduced a bug for af_unix SEQPACKET type. In unix_shutdown, the unhash function will call prot->unhash(), which is NULL for SEQPACKET. And kernel will panic. On ARM32, it will show following messages: (it likely affects x86 too). Fix the bug by checking the prot->unhash is NULL or not first. Kernel log: <--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = 2fba1ffb *pgd=00000000 Internal error: Oops: 80000005 [#1] PREEMPT SMP THUMB2 Modules linked in: CPU: 1 PID: 1999 Comm: falkon Tainted: G W 5.14.0-rc5-01175-g94531cfcbe79-dirty #9240 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) PC is at 0x0 LR is at unix_shutdown+0x81/0x1a8 pc : [<00000000>] lr : [] psr: 600f0013 sp : e45aff70 ip : e463a3c0 fp : beb54f04 r10: 00000125 r9 : e45ae000 r8 : c4a56664 r7 : 00000001 r6 : c4a56464 r5 : 00000001 r4 : c4a56400 r3 : 00000000 r2 : c5a6b180 r1 : 00000000 r0 : c4a56400 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 50c5387d Table: 05aa804a DAC: 00000051 Register r0 information: slab PING start c4a56400 pointer offset 0 Register r1 information: NULL pointer Register r2 information: slab task_struct start c5a6b180 pointer offset 0 Register r3 information: NULL pointer Register r4 information: slab PING start c4a56400 pointer offset 0 Register r5 information: non-paged memory Register r6 information: slab PING start c4a56400 pointer offset 100 Register r7 information: non-paged memory Register r8 information: slab PING start c4a56400 pointer offset 612 Register r9 information: non-slab/vmalloc memory Register r10 information: non-paged memory Register r11 information: non-paged memory Register r12 information: slab filp start e463a3c0 pointer offset 0 Process falkon (pid: 1999, stack limit = 0x9ec48895) Stack: (0xe45aff70 to 0xe45b0000) ff60: e45ae000 c5f26a00 00000000 00000125 ff80: c0100264 c07f7fa3 beb54f04 fffffff7 00000001 e6f3fc0e b5e5e9ec beb54ec4 ffa0: b5da0ccc c010024b b5e5e9ec beb54ec4 0000000f 00000000 00000000 beb54ebc ffc0: b5e5e9ec beb54ec4 b5da0ccc 00000125 beb54f58 00785238 beb5529c beb54f04 ffe0: b5da1e24 beb54eac b301385c b62b6ee8 600f0030 0000000f 00000000 00000000 [] (unix_shutdown) from [] (__sys_shutdown+0x2f/0x50) [] (__sys_shutdown) from [] (__sys_trace_return+0x1/0x16) Exception stack(0xe45affa8 to 0xe45afff0) Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") Reported-by: Dmitry Osipenko Signed-off-by: Jiang Wang Signed-off-by: Daniel Borkmann Tested-by: Dmitry Osipenko Acked-by: Kuniyuki Iwashima Link: https://lore.kernel.org/bpf/20210821180738.1151155-1-jiang.wang@bytedance.com commit 2564a2d4418bac166a9db2d6ca2f8b99953b1df5 Author: Pierre-Louis Bossart Date: Wed Aug 18 11:01:30 2021 +0800 soundwire: cadence: do not extend reset delay The duration of the hw_reset is defined as 4096 cycles. The Cadence IP allows for an additional delay which doesn't seem necessary in practice: the actual reset sequence duration is defined by the sync_go mechanism, not by the IP itself. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210818030130.17113-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 029bfd1cd53cd8ba896a676e5c1bcf6cd0100d3c Author: Pierre-Louis Bossart Date: Wed Aug 18 10:49:54 2021 +0800 soundwire: intel: conditionally exit clock stop mode on system suspend Intel stress tests reported issues with the clock stop mode, specifically when trying to do a system suspend while the link is already pm_runtime suspended. In this case, we need to disable the shim wake, but when the PCI parent device is also pm_runtime suspended the SHIM registers are not accessible. Since this is an invalid corner case, this patch suggests a pm_runtime resume of the entire bus to full power (parent+child devices) before the system suspend so that the shim wake can be disabled. Unlike the suspend operation, the .prepare callbacks are propagated from root device to leaf devices. By adding a .prepare callback at the SoundWire link level, we can double-check the pm_runtime status of the device as well as its parent PCI device. When the problematic configuration is detected, the device is pm_runtime resumed - which by construction also resume its parent. An additional loop is added to resume all child devices. In theory we only need to restart the link, but doing so will also cause the physical devices to synchronize and re-initialize, while their Linux devices remain pm_runtime suspended. It's simpler to make sure the codec devices are fully resumed so that we don't have to deal with zombie states. This additional loop could have been avoided by adding a .prepare callback in SoundWire codec drivers. Functionally this would have been equivalent. The rationale for implementing a loop at the link level is only to reduce the amount of code required to deal at the codec level with an Intel corner case - in other words keep codec drivers independent from Intel platform-specific programming sequences. BugLink: https://github.com/thesofproject/linux/issues/2606 Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210818024954.16873-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e4401abb3485d78eb7987866a4b834f94bb60d90 Author: Pierre-Louis Bossart Date: Wed Aug 18 10:49:53 2021 +0800 soundwire: intel: skip suspend/resume/wake when link was not started The SoundWire Linux devices are created purely based on information provided by platform firmware (e.g. ACPI DSDT table). When the kernel finds a matching driver for the device address (_ADR), the probe will initialize required data structures and initialize pm ops. When the SoundWire link is started at a later point, the physical devices will synchronize on the SoundWire frames and report their attachment status, thereby triggering the enumeration and initialization of device registers. This two-step solution was a conscious design decision to allow e.g. a driver to use sideband mechanisms to turn power rails on. This can also allow OEMs to describe multiple platforms with the same DSDT table, the devices that are not physically present in hardware. The drawback of this approach is a bit of confusion, with more devices than are actually present in hardware. This results in 'ghost' devices, for which the driver successfully probes, but that will not generate any traffic on the bus. suspend-resume transitions are handled by drivers, and skipped when the devices are not physically present. This patch provides a work-around for a second-level of confusion in platform firmware: some platforms only use HDaudio links, but nevertheless expose SoundWire 'ghost' devices. This results in error messages in the Intel driver while trying to suspend/resume these links. The simplest solution is to add a boolean status flag to skip all suspend/resume/wake sequences if the link was never started. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210818024954.16873-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ea6942dad4b2a7e1735aa0f10f3d0b04b847750f Author: Pierre-Louis Bossart Date: Wed Aug 18 10:49:52 2021 +0800 soundwire: intel: fix potential race condition during power down The power down sequence sets the link_up flag as false outside of the mutex_lock. This is potentially unsafe. In additional the flow in that sequence can be improved by first testing if the link was powered, setting the link_up flag as false and proceeding with the power down. In case the CPA bits cannot be cleared, we only flag an error since we cannot deal with interrupts any longer. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210818024954.16873-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 0d977e0eba234e01a60bdde27314dc21374201b3 Author: Desmond Cheong Zhi Xi Date: Sat Aug 21 01:50:40 2021 +0800 btrfs: reset replace target device to allocation state on close This crash was observed with a failed assertion on device close: BTRFS: Transaction aborted (error -28) WARNING: CPU: 1 PID: 3902 at fs/btrfs/extent-tree.c:2150 btrfs_run_delayed_refs+0x1d2/0x1e0 [btrfs] Modules linked in: btrfs blake2b_generic libcrc32c crc32c_intel xor zstd_decompress zstd_compress xxhash lzo_compress lzo_decompress raid6_pq loop CPU: 1 PID: 3902 Comm: kworker/u8:4 Not tainted 5.14.0-rc5-default+ #1532 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs] RIP: 0010:btrfs_run_delayed_refs+0x1d2/0x1e0 [btrfs] RSP: 0018:ffffb7a5452d7d80 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffffabee13c4 RDI: 00000000ffffffff RBP: ffff97834176a378 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: ffff97835195d388 R13: 0000000005b08000 R14: ffff978385484000 R15: 000000000000016c FS: 0000000000000000(0000) GS:ffff9783bd800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056190d003fe8 CR3: 000000002a81e005 CR4: 0000000000170ea0 Call Trace: flush_space+0x197/0x2f0 [btrfs] btrfs_async_reclaim_metadata_space+0x139/0x300 [btrfs] process_one_work+0x262/0x5e0 worker_thread+0x4c/0x320 ? process_one_work+0x5e0/0x5e0 kthread+0x144/0x170 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 irq event stamp: 19334989 hardirqs last enabled at (19334997): [] console_unlock+0x2b7/0x400 hardirqs last disabled at (19335006): [] console_unlock+0x33d/0x400 softirqs last enabled at (19334900): [] __do_softirq+0x30d/0x574 softirqs last disabled at (19334893): [] irq_exit_rcu+0x12c/0x140 ---[ end trace 45939e308e0dd3c7 ]--- BTRFS: error (device vdd) in btrfs_run_delayed_refs:2150: errno=-28 No space left BTRFS info (device vdd): forced readonly BTRFS warning (device vdd): failed setting block group ro: -30 BTRFS info (device vdd): suspending dev_replace for unmount assertion failed: !test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state), in fs/btrfs/volumes.c:1150 ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.h:3431! invalid opcode: 0000 [#1] PREEMPT SMP CPU: 1 PID: 3982 Comm: umount Tainted: G W 5.14.0-rc5-default+ #1532 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 RIP: 0010:assertfail.constprop.0+0x18/0x1a [btrfs] RSP: 0018:ffffb7a5454c7db8 EFLAGS: 00010246 RAX: 0000000000000068 RBX: ffff978364b91c00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffffabee13c4 RDI: 00000000ffffffff RBP: ffff9783523a4c00 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: ffff9783523a4d18 R13: 0000000000000000 R14: 0000000000000004 R15: 0000000000000003 FS: 00007f61c8f42800(0000) GS:ffff9783bd800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056190cffa810 CR3: 0000000030b96002 CR4: 0000000000170ea0 Call Trace: btrfs_close_one_device.cold+0x11/0x55 [btrfs] close_fs_devices+0x44/0xb0 [btrfs] btrfs_close_devices+0x48/0x160 [btrfs] generic_shutdown_super+0x69/0x100 kill_anon_super+0x14/0x30 btrfs_kill_super+0x12/0x20 [btrfs] deactivate_locked_super+0x2c/0xa0 cleanup_mnt+0x144/0x1b0 task_work_run+0x59/0xa0 exit_to_user_mode_loop+0xe7/0xf0 exit_to_user_mode_prepare+0xaf/0xf0 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x4a/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae This happens when close_ctree is called while a dev_replace hasn't completed. In close_ctree, we suspend the dev_replace, but keep the replace target around so that we can resume the dev_replace procedure when we mount the root again. This is the call trace: close_ctree(): btrfs_dev_replace_suspend_for_unmount(); btrfs_close_devices(): btrfs_close_fs_devices(): btrfs_close_one_device(): ASSERT(!test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)); However, since the replace target sticks around, there is a device with BTRFS_DEV_STATE_REPLACE_TGT set on close, and we fail the assertion in btrfs_close_one_device. To fix this, if we come across the replace target device when closing, we should properly reset it back to allocation state. This fix also ensures that if a non-target device has a corrupted state and has the BTRFS_DEV_STATE_REPLACE_TGT bit set, the assertion will still catch the error. Reported-by: David Sterba Fixes: b2a616676839 ("btrfs: fix rw device counting in __btrfs_free_extra_devids") CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Anand Jain Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: David Sterba Signed-off-by: David Sterba commit f6a4e0e8a00ff6fadb29f3646ccd33cc85195a38 Author: Tang Bin Date: Mon Aug 23 19:33:37 2021 +0800 via-velocity: Use of_device_get_match_data to simplify code Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Tang Bin Signed-off-by: David S. Miller commit b708a96d76462614123f4e8a8bb030889ab43ba4 Author: Tang Bin Date: Mon Aug 23 19:33:36 2021 +0800 via-rhine: Use of_device_get_match_data to simplify code Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Tang Bin Signed-off-by: David S. Miller commit 43dde64bb1b45c7e4194f4ae30cf16c37bc317e0 Merge: a87a10961a744 e5c6b312ce3cc Author: Rafael J. Wysocki Date: Mon Aug 23 13:48:40 2021 +0200 Merge back cpufreq changes for v5.15. commit e28ac04a705e946eddc5e7d2fc712dea3f20fe9e Author: Takashi Iwai Date: Sun Aug 22 09:21:27 2021 +0200 ASoC: intel: atom: Revert PCM buffer address setup workaround again We worked around the breakage of PCM buffer setup by the commit 65ca89c2b12c ("ASoC: intel: atom: Fix breakage for PCM buffer address setup"), but this isn't necessary since the CONTINUOUS buffer type also sets runtime->dma_addr since commit f84ba106a018 ("ALSA: memalloc: Store snd_dma_buffer.addr for continuous pages, too"). Let's revert the change again. Link: https://lore.kernel.org/r/20210822072127.9786-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 539a5093e73e0f00c8e481a06407f058cc7a04d3 Merge: 2231af793fe28 13d9c6b998aaa Author: Takashi Iwai Date: Mon Aug 23 13:36:20 2021 +0200 Merge branch 'for-linus' into for-next commit 2231af793fe28d478ab4740a46e2debbc0b4940c Author: Takashi Iwai Date: Mon Aug 23 13:35:18 2021 +0200 ALSA: doc: Fix indentation warning Fix a trivial warning for the indentation by putting an empty line: Documentation/sound/alsa-configuration.rst:2258: WARNING: Unexpected indentation. Fixes: a39978ed6df1 ("ALSA: doc: Add the description of quirk_flags option for snd-usb-audio") Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20210823113518.30134-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 58bc6d1be2f3b0ceecb6027dfa17513ec6aa2abb Author: Stian Skjelstad Date: Sun Aug 22 11:33:32 2021 +0200 udf_get_extendedattr() had no boundary checks. When parsing the ExtendedAttr data, malicous or corrupt attribute length could cause kernel hangs and buffer overruns in some special cases. Link: https://lore.kernel.org/r/20210822093332.25234-1-stian.skjelstad@gmail.com Signed-off-by: Stian Skjelstad Signed-off-by: Jan Kara commit 87d93029fe83e326d5b906e12e95600b157d2c0d Author: Geert Uytterhoeven Date: Mon Aug 9 13:29:03 2021 +0200 m68k: Fix asm register constraints for atomic ops Depending on register assignment by the compiler: {standard input}:3084: Error: operands mismatch -- statement `andl %a1,%d1' ignored {standard input}:3145: Error: operands mismatch -- statement `orl %a1,%d1' ignored {standard input}:3195: Error: operands mismatch -- statement `eorl %a1,%d1' ignored Indeed, the first operand must not be an address register. However, it can be an immediate value. Fix this by adjusting the register constraint from "g" (general purpose register) to "di" (data register or immediate). Fixes: e39d88ea3ce4a471 ("locking/atomic, arch/m68k: Implement atomic_fetch_{add,sub,and,or,xor}()") Fixes: d839bae4269aea46 ("locking,arch,m68k: Fold atomic_ops") Fixes: 1da177e4c3f41524 ("Linux-2.6.12-rc2") Reported-by: kernel test robot Reported-by: Arnd Bergmann Reported-by: Alexander Viro Signed-off-by: Geert Uytterhoeven Tested-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210809112903.3898660-1-geert@linux-m68k.org commit 939c7feb19217c752a4b368d35aae1ed98f40b61 Author: Naohiro Aota Date: Wed Aug 11 15:37:08 2021 +0900 btrfs: zoned: fix ordered extent boundary calculation btrfs_lookup_ordered_extent() is supposed to query the offset in a file instead of the logical address. Pass the file offset from submit_extent_page() to calc_bio_boundaries(). Also, calc_bio_boundaries() relies on the bio's operation flag, so move the call site after setting it. Fixes: 390ed29b817e ("btrfs: refactor submit_extent_page() to make bio and its flag tracing easier") Reviewed-by: Qu Wenruo Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 114623979405abf0b143f9c6688b3ff00ee48338 Author: Josef Bacik Date: Wed Aug 11 14:37:16 2021 -0400 btrfs: do not do preemptive flushing if the majority is global rsv A common characteristic of the bug report where preemptive flushing was going full tilt was the fact that the vast majority of the free metadata space was used up by the global reserve. The hard 90% threshold would cover the majority of these cases, but to be even smarter we should take into account how much of the outstanding reservations are covered by the global block reserve. If the global block reserve accounts for the vast majority of outstanding reservations, skip preemptive flushing, as it will likely just cause churn and pain. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212185 Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 93c60b17f2b5fca2c5931d7944788d1ef5f25528 Author: Josef Bacik Date: Wed Aug 11 14:37:15 2021 -0400 btrfs: reduce the preemptive flushing threshold to 90% The preemptive flushing code was added in order to avoid needing to synchronously wait for ENOSPC flushing to recover space. Once we're almost full however we can essentially flush constantly. We were using 98% as a threshold to determine if we were simply full, however in practice this is a really high bar to hit. For example reports of systems running into this problem had around 94% usage and thus continued to flush. Fix this by lowering the threshold to 90%, which is a more sane value, especially for smaller file systems. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212185 CC: stable@vger.kernel.org # 5.12+ Fixes: 576fa34830af ("btrfs: improve preemptive background space flushing") Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 3736127a3aa805602b7a2ad60ec9cfce68065fbb Author: Marcos Paulo de Souza Date: Mon Aug 2 09:34:00 2021 -0300 btrfs: tree-log: check btrfs_lookup_data_extent return value Function btrfs_lookup_data_extent calls btrfs_search_slot to verify if the EXTENT_ITEM exists in the extent tree. btrfs_search_slot can return values bellow zero if an error happened. Function replay_one_extent currently checks if the search found something (0 returned) and increments the reference, and if not, it seems to evaluate as 'not found'. Fix the condition by checking if the value was bellow zero and return early. Reviewed-by: Filipe Manana Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8be2ba2e0e11ade6ab96d8887dbb12abbd3540f4 Author: Filipe Manana Date: Thu Jul 29 18:52:46 2021 +0100 btrfs: avoid unnecessarily logging directories that had no changes There are several cases where when logging an inode we need to log its parent directories or logging subdirectories when logging a directory. There are cases however where we end up logging a directory even if it was not changed in the current transaction, no dentries added or removed since the last transaction. While this is harmless from a functional point of view, it is a waste time as it brings no advantage. One example where this is triggered is the following: $ mkfs.btrfs -f /dev/sdc $ mount /dev/sdc /mnt $ mkdir /mnt/A $ mkdir /mnt/B $ mkdir /mnt/C $ touch /mnt/A/foo $ ln /mnt/A/foo /mnt/B/bar $ ln /mnt/A/foo /mnt/C/baz $ sync $ rm -f /mnt/A/foo $ xfs_io -c "fsync" /mnt/B/bar This last fsync ends up logging directories A, B and C, however we only need to log directory A, as B and C were not changed since the last transaction commit. So fix this by changing need_log_inode(), to return false in case the given inode is a directory and has a ->last_trans value smaller than the current transaction's ID. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5b9b26f5d0b88b74001dcfe4ab8a8f2f4e744112 Author: Christian Brauner Date: Tue Jul 27 12:48:59 2021 +0200 btrfs: allow idmapped mount Now that we converted btrfs internally to account for idmapped mounts allow the creation of idmapped mounts on by setting the FS_ALLOW_IDMAP flag. We only need to raise this flag on the btrfs_root_fs_type filesystem since btrfs_mount_root() is ultimately responsible for allocating the superblock and is called into from btrfs_mount() associated with btrfs_fs_type. The conversion of the btrfs inode operations was straightforward. Regarding btrfs specific ioctls that perform checks based on inode permissions only those have been allowed that are not filesystem wide operations and hence can be reasonably charged against a specific mount. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4a8b34afa9c94c180d16999e405d380cc0477369 Author: Christian Brauner Date: Tue Jul 27 12:48:58 2021 +0200 btrfs: handle ACLs on idmapped mounts Make the ACL code idmapped mount aware. The POSIX default and POSIX access ACLs are the only ACLs other than some specific xattrs that take DAC permissions into account. On an idmapped mount they need to be translated according to the mount's userns. The main change is done to __btrfs_set_acl() which is responsible for translating POSIX ACLs to their final on-disk representation. The btrfs_init_acl() helper does not need to take the idmapped mount into account since it is called in the context of file creation operations (mknod, create, mkdir, symlink, tmpfile) and is used for btrfs_init_inode_security() to copy POSIX default and POSIX access permissions from the parent directory. These ACLs need to be inherited unmodified from the parent directory. This is identical to what we do for ext4 and xfs. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6623d9a0b0ce340d3e4dc4b18705ad212a49677a Author: Christian Brauner Date: Tue Jul 27 12:48:57 2021 +0200 btrfs: allow idmapped INO_LOOKUP_USER ioctl The INO_LOOKUP_USER is an unprivileged version of the INO_LOOKUP ioctl and has the following restrictions. The main difference between the two is that INO_LOOKUP is filesystem wide operation wheres INO_LOOKUP_USER is scoped beneath the file descriptor passed with the ioctl. Specifically, INO_LOOKUP_USER must adhere to the following restrictions: - The caller must be privileged over each inode of each path component for the path they are trying to lookup. - The path for the subvolume the caller is trying to lookup must be reachable from the inode associated with the file descriptor passed with the ioctl. The second condition makes it possible to scope the lookup of the path to the mount identified by the file descriptor passed with the ioctl. This allows us to enable this ioctl on idmapped mounts. Specifically, this is possible because all child subvolumes of a parent subvolume are reachable when the parent subvolume is mounted. So if the user had access to open the parent subvolume or has been given the fd then they can lookup the path if they had access to it provided they were privileged over each path component. Note, the INO_LOOKUP_USER ioctl allows a user to learn the path and name of a subvolume even though they would otherwise be restricted from doing so via regular VFS-based lookup. So think about a parent subvolume with multiple child subvolumes. Someone could mount he parent subvolume and restrict access to the child subvolumes by overmounting them with empty directories. At this point the user can't traverse the child subvolumes and they can't open files in the child subvolumes. However, they can still learn the path of child subvolumes as long as they have access to the parent subvolume by using the INO_LOOKUP_USER ioctl. The underlying assumption here is that it's ok that the lookup ioctls can't really take mounts into account other than the original mount the fd belongs to during lookup. Since this assumption is baked into the original INO_LOOKUP_USER ioctl we can extend it to idmapped mounts. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 39e1674ff0351f6a47d3105e51bb1f9c72b3f20e Author: Christian Brauner Date: Tue Jul 27 12:48:56 2021 +0200 btrfs: allow idmapped SUBVOL_SETFLAGS ioctl Setting flags on subvolumes or snapshots are core features of btrfs. The SUBVOL_SETFLAGS ioctl is especially important as it allows to make subvolumes and snapshots read-only or read-write. Allow setting flags on btrfs subvolumes and snapshots on idmapped mounts. This is a fairly straightforward operation since all the permission checking helpers are already capable of handling idmapped mounts. So we just need to pass down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit e4fed17a32b6b1017ff2fb4cd73938abeeadd907 Author: Christian Brauner Date: Tue Jul 27 12:48:55 2021 +0200 btrfs: allow idmapped SET_RECEIVED_SUBVOL ioctls The SET_RECEIVED_SUBVOL ioctls are used to set information about a received subvolume. Make it possible to set information about a received subvolume on idmapped mounts. This is a fairly straightforward operation since all the permission checking helpers are already capable of handling idmapped mounts. So we just need to pass down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit aabb34e7a31c608dd7c00db9ad320e05941a39d0 Author: Christian Brauner Date: Tue Jul 27 12:48:54 2021 +0200 btrfs: relax restrictions for SNAP_DESTROY_V2 with subvolids So far we prevented the deletion of subvolumes and snapshots using subvolume ids possible with the BTRFS_SUBVOL_SPEC_BY_ID flag. This restriction is necessary on idmapped mounts as this allows filesystem wide subvolume and snapshot deletions and thus can escape the scope of what's exposed under the mount identified by the fd passed with the ioctl. Deletion by subvolume id works by looking for an alias of the parent of the subvolume or snapshot to be deleted. The parent alias can be anywhere in the filesystem. However, as long as the alias of the parent that is found is the same as the one identified by the file descriptor passed through the ioctl we can allow the deletion. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit c4ed533bdc7960873ab0258a4d18569061b4b0b4 Author: Christian Brauner Date: Tue Jul 27 12:48:53 2021 +0200 btrfs: allow idmapped SNAP_DESTROY ioctls Destroying subvolumes and snapshots are important features of btrfs. Both operations are available to unprivileged users if the filesystem has been mounted with the "user_subvol_rm_allowed" mount option. Allow subvolume and snapshot deletion on idmapped mounts. This is a fairly straightforward operation since all the permission checking helpers are already capable of handling idmapped mounts. So we just need to pass down the mount's userns. Subvolumes and snapshots can either be deleted by specifying their name or - if BTRFS_IOC_SNAP_DESTROY_V2 is used - by their subvolume or snapshot id if the BTRFS_SUBVOL_SPEC_BY_ID is set. This feature is blocked on idmapped mounts as this allows filesystem wide subvolume deletions and thus can escape the scope of what's exposed under the mount identified by the fd passed with the ioctl. This means that even the root or CAP_SYS_ADMIN capable user can't delete a subvolume via BTRFS_SUBVOL_SPEC_BY_ID. This is intentional. The root user is currently already subject to permission checks in btrfs_may_delete() including whether the inode's i_uid/i_gid of the directory the subvolume is located in have a mapping in the caller's idmapping. For this to fail isn't currently possible since a btrfs filesystem can't be mounted with a non-initial idmapping but it shows that even the root user would fail to delete a subvolume if the relevant inode isn't mapped in their idmapping. The idmapped mount case is the same in principle. This isn't a huge problem a root user wanting to delete arbitrary subvolumes can just always create another (even detached) mount without an idmapping attached. In addition, we will allow BTRFS_SUBVOL_SPEC_BY_ID for cases where the subvolume to delete is directly located under inode referenced by the fd passed for the ioctl() in a follow-up commit. Here is an example where a btrfs subvolume is deleted through a subvolume mount that does not expose the subvolume to be delete but it can still be deleted by using the subvolume id: /* Compile the following program as "delete_by_spec". */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include static int rm_subvolume_by_id(int fd, uint64_t subvolid) { struct btrfs_ioctl_vol_args_v2 args = {}; int ret; args.flags = BTRFS_SUBVOL_SPEC_BY_ID; args.subvolid = subvolid; ret = ioctl(fd, BTRFS_IOC_SNAP_DESTROY_V2, &args); if (ret < 0) return -1; return 0; } int main(int argc, char *argv[]) { int subvolid = 0; if (argc < 3) exit(1); fprintf(stderr, "Opening %s\n", argv[1]); int fd = open(argv[1], O_CLOEXEC | O_DIRECTORY); if (fd < 0) exit(2); subvolid = atoi(argv[2]); fprintf(stderr, "Deleting subvolume with subvolid %d\n", subvolid); int ret = rm_subvolume_by_id(fd, subvolid); if (ret < 0) exit(3); exit(0); } #include " #include " #include sudo umount /mnt sudo mount ${LOOPDEV} -o subvol=B/C,user_subvol_rm_allowed /mnt ./delete_by_spec /mnt ${SUBVOLID} With idmapped mounts this can potentially be used by users to delete subvolumes/snapshots they would otherwise not have access to as the idmapping would be applied to an inode that is not exposed in the mount of the subvolume. The fact that this is a filesystem wide operation suggests it might be a good idea to expose this under a separate ioctl that clearly indicates this. In essence, the file descriptor passed with the ioctl is merely used to identify the filesystem on which to operate when BTRFS_SUBVOL_SPEC_BY_ID is used. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4d4340c912ccc351da5578f73c68f1109dcc8e2d Author: Christian Brauner Date: Tue Jul 27 12:48:52 2021 +0200 btrfs: allow idmapped SNAP_CREATE/SUBVOL_CREATE ioctls Creating subvolumes and snapshots is one of the core features of btrfs and is even available to unprivileged users. Make it possible to use subvolume and snapshot creation on idmapped mounts. This is a fairly straightforward operation since all the permission checking helpers are already capable of handling idmapped mounts. So we just need to pass down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5474bf400f16bd1f930627ea65b698bca09dcfc6 Author: Christian Brauner Date: Tue Jul 27 12:48:51 2021 +0200 btrfs: check whether fsgid/fsuid are mapped during subvolume creation When a new subvolume is created btrfs currently doesn't check whether the fsgid/fsuid of the caller actually have a mapping in the user namespace attached to the filesystem. The VFS always checks this to make sure that the caller's fsgid/fsuid can be represented on-disk. This is most relevant for filesystems that can be mounted inside user namespaces but it is in general a good hardening measure to prevent unrepresentable gid/uid from being written to disk. Since we want to support idmapped mounts for btrfs ioctls to create subvolumes in follow-up patches this becomes important since we want to make sure the fsgid/fsuid of the caller as mapped according to the idmapped mount can be represented on-disk. Simply add the missing fsuidgid_has_mapping() line from the VFS may_create() version to btrfs_may_create(). Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3bc71ba02cf5376b390289bef8c9f5d6049f1866 Author: Christian Brauner Date: Tue Jul 27 12:48:50 2021 +0200 btrfs: allow idmapped permission inode op Enable btrfs_permission() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit d4d09464614227a6cc9ae42cd1d761e4320e4ebc Author: Christian Brauner Date: Tue Jul 27 12:48:49 2021 +0200 btrfs: allow idmapped setattr inode op Enable btrfs_setattr() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 98b6ab5fc0988242114a4f0e02ed225685d9cc2b Author: Christian Brauner Date: Tue Jul 27 12:48:48 2021 +0200 btrfs: allow idmapped tmpfile inode op Enable btrfs_tmpfile() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5a0521086e5fc5eb51690d4fc63fd26fdb5ae881 Author: Christian Brauner Date: Tue Jul 27 12:48:47 2021 +0200 btrfs: allow idmapped symlink inode op Enable btrfs_symlink() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit b0b3e44d346c91dde3899d37eddf867b9b36ffdc Author: Christian Brauner Date: Tue Jul 27 12:48:46 2021 +0200 btrfs: allow idmapped mkdir inode op Enable btrfs_mkdir() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit e93ca491d03fda28db54a3d6ddc15f03a61364d7 Author: Christian Brauner Date: Tue Jul 27 12:48:45 2021 +0200 btrfs: allow idmapped create inode op Enable btrfs_create() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit 72105277dcfca69175cea713f5edda4132839e14 Author: Christian Brauner Date: Tue Jul 27 12:48:44 2021 +0200 btrfs: allow idmapped mknod inode op Enable btrfs_mknod() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit c020d2eaf1a84ba8611fe2a232f4951faa98e0e0 Author: Christian Brauner Date: Tue Jul 27 12:48:43 2021 +0200 btrfs: allow idmapped getattr inode op Enable btrfs_getattr() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit ca07274c3da901c7daa2c9280679c282b7c03bef Author: Christian Brauner Date: Tue Jul 27 12:48:42 2021 +0200 btrfs: allow idmapped rename inode op Enable btrfs_rename() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit b3b6f5b9225506abc2e8d1f393761a6e509b791f Author: Christian Brauner Date: Tue Jul 27 12:48:41 2021 +0200 btrfs: handle idmaps in btrfs_new_inode() Extend btrfs_new_inode() to take the idmapped mount into account when initializing a new inode. This is just a matter of passing down the mount's userns. The rest is taken care of in inode_init_owner(). This is a preliminary patch to make the individual btrfs inode operations idmapped mount aware. Reviewed-by: Josef Bacik Signed-off-by: Christian Brauner Reviewed-by: David Sterba Signed-off-by: David Sterba commit c2fd68b6b2b00f0a6280b5971028c10c8f0ba70f Author: Christian Brauner Date: Tue Jul 27 12:48:40 2021 +0200 namei: add mapping aware lookup helper Various filesystems rely on the lookup_one_len() helper to lookup a single path component relative to a well-known starting point. Allow such filesystems to support idmapped mounts by adding a version of this helper to take the idmap into account when calling inode_permission(). This change is a required to let btrfs (and other filesystems) support idmapped mounts. Cc: Christoph Hellwig Cc: Al Viro Cc: Matthew Wilcox (Oracle) Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Josef Bacik Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner Signed-off-by: David Sterba commit e7849e33cf5d785568b181e3c15236e32c7dfdb2 Author: Anand Jain Date: Tue Aug 10 21:55:59 2021 +0800 btrfs: sysfs: document structures and their associated files Sysfs file has grown big. It takes some time to locate the correct struct attribute to add new files. Create a table and map the struct attribute to its sysfs path. Also, fix the comment about the debug sysfs path. And add the comments to the attributes instead of attribute group, where sysfs file names are defined. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit e4571b8c5e9ffa1e85c0c671995bd4dcc5c75091 Author: Qu Wenruo Date: Fri Aug 6 18:24:15 2021 +0800 btrfs: fix NULL pointer dereference when deleting device by invalid id [BUG] It's easy to trigger NULL pointer dereference, just by removing a non-existing device id: # mkfs.btrfs -f -m single -d single /dev/test/scratch1 \ /dev/test/scratch2 # mount /dev/test/scratch1 /mnt/btrfs # btrfs device remove 3 /mnt/btrfs Then we have the following kernel NULL pointer dereference: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 9 PID: 649 Comm: btrfs Not tainted 5.14.0-rc3-custom+ #35 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:btrfs_rm_device+0x4de/0x6b0 [btrfs] btrfs_ioctl+0x18bb/0x3190 [btrfs] ? lock_is_held_type+0xa5/0x120 ? find_held_lock.constprop.0+0x2b/0x80 ? do_user_addr_fault+0x201/0x6a0 ? lock_release+0xd2/0x2d0 ? __x64_sys_ioctl+0x83/0xb0 __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae [CAUSE] Commit a27a94c2b0c7 ("btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly") moves the "missing" device path check into btrfs_rm_device(). But btrfs_rm_device() itself can have case where it only receives @devid, with NULL as @device_path. In that case, calling strcmp() on NULL will trigger the NULL pointer dereference. Before that commit, we handle the "missing" case inside btrfs_find_device_by_devspec(), which will not check @device_path at all if @devid is provided, thus no way to trigger the bug. [FIX] Before calling strcmp(), also make sure @device_path is not NULL. Fixes: a27a94c2b0c7 ("btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly") CC: stable@vger.kernel.org # 5.4+ Reported-by: butt3rflyh4ck Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 63fb5879db7ca94fefac12cf7a5a051cee889c12 Author: Naohiro Aota Date: Mon Aug 9 09:29:18 2021 +0900 btrfs: zoned: add asserts on splitting extent_map We call split_zoned_em() on an extent_map on submitting a bio for it. Thus, we can assume the extent_map is PINNED, not LOGGING, and in the modified list. Add ASSERT()s to ensure the extent_maps after the split also has the proper flags set and are in the modified list. Suggested-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 0ae79c6fe70d5c5c645733b7ed39d5e6021d8c9a Author: Naohiro Aota Date: Mon Aug 9 13:13:44 2021 +0900 btrfs: zoned: fix block group alloc_offset calculation alloc_offset is offset from the start of a block group and @offset is actually an address in logical space. Thus, we need to consider block_group->start when calculating them. Fixes: 011b41bffa3d ("btrfs: zoned: advance allocation pointer after tree log node") CC: stable@vger.kernel.org # 5.12+ Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit ba86dd9fe60e5853fbff96f2658212908b83f271 Author: Naohiro Aota Date: Mon Aug 9 13:32:30 2021 +0900 btrfs: zoned: suppress reclaim error message on EAGAIN btrfs_relocate_chunk() can fail with -EAGAIN when e.g. send operations are running. The message can fail btrfs/187 and it's unnecessary because we anyway add it back to the reclaim list. btrfs_reclaim_bgs_work() `-> btrfs_relocate_chunk() `-> btrfs_relocate_block_group() `-> reloc_chunk_start() `-> if (fs_info->send_in_progress) `-> return -EAGAIN CC: stable@vger.kernel.org # 5.13+ Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 77233c2d2ec95030afcaf9fd90e4bdd6125e5c15 Author: Johannes Thumshirn Date: Mon Aug 9 20:41:17 2021 +0900 btrfs: zoned: allow disabling of zone auto reclaim Automatically reclaiming dirty zones might not always be desired for all workloads, especially as there are currently still some rough edges with the relocation code on zoned filesystems. Allow disabling zone auto reclaim on a per filesystem basis by writing 0 as the threshold value. Reviewed-by: Naohiro Aota Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1f295373022e84683bc5768caca46bdba3a376c1 Author: Filipe Manana Date: Thu Jul 29 15:30:21 2021 +0100 btrfs: update comment at log_conflicting_inodes() A comment at log_conflicting_inodes() mentions that we check the inode's logged_trans field instead of using btrfs_inode_in_log() because the field last_log_commit is not updated when we log that an inode exists and the inode has the full sync flag (BTRFS_INODE_NEEDS_FULL_SYNC) set. The part about the full sync flag is not true anymore since commit 9acc8103ab594f ("btrfs: fix unpersisted i_size on fsync after expanding truncate"), so update the comment to not mention that part anymore. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d135a5339611352047462ef5943aee3a1202aa37 Author: Filipe Manana Date: Thu Jul 29 15:29:01 2021 +0100 btrfs: remove no longer needed full sync flag check at inode_logged() Now that we are checking if the inode's logged_trans is 0 to detect the possibility of the inode having been evicted and reloaded, the test for the full sync flag (BTRFS_INODE_NEEDS_FULL_SYNC) is no longer needed at tree-log.c:inode_logged(). Its purpose was to detect the possibility of a previous eviction as well, since when an inode is loaded the full sync flag is always set on it (and only cleared after the inode is logged). So just remove the check and update the comment. The check for the inode's logged_trans being 0 was added recently by the patch with the subject "btrfs: eliminate some false positives when checking if inode was logged". Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 1c167b87f4f9c89e33dcffb92a45e30f937f04d6 Author: Filipe Manana Date: Thu Jul 29 15:28:34 2021 +0100 btrfs: remove unnecessary NULL check for the new inode during rename exchange At the very end of btrfs_rename_exchange(), in case an error happened, we are checking if 'new_inode' is NULL, but that is not needed since during a rename exchange, unlike regular renames, 'new_inode' can never be NULL, and if it were, we would have a crashed much earlier when we dereference it multiple times. So remove the check because it is not necessary and because it is causing static checkers to emit a warning. I probably introduced the check by copy-pasting similar code from btrfs_rename(), where 'new_inode' can be NULL, in commit 86e8aa0e772cab ("Btrfs: unpin logs if rename exchange operation fails"). Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit dce2815039061116c41da1db24b9282e6e5e1734 Author: Goldwyn Rodrigues Date: Tue Jul 27 16:17:31 2021 -0500 btrfs: allocate backref_ctx on stack in find_extent_clone Instead of using kmalloc() to allocate backref_ctx, allocate backref_ctx on stack. The size is reasonably small. sizeof(backref_ctx) = 48 Reviewed-by: Anand Jain Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit c853a5783ebe123847886d432354931874367292 Author: Goldwyn Rodrigues Date: Tue Jul 27 16:17:30 2021 -0500 btrfs: allocate btrfs_ioctl_defrag_range_args on stack Instead of using kmalloc() to allocate btrfs_ioctl_defrag_range_args, allocate btrfs_ioctl_defrag_range_args on stack, the size is reasonably small and ioctls are called in process context. sizeof(btrfs_ioctl_defrag_range_args) = 48 Reviewed-by: Anand Jain Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0afb603afc3e3dd15c99dd34d5e18b46f9f5c0e4 Author: Goldwyn Rodrigues Date: Tue Jul 27 16:17:29 2021 -0500 btrfs: allocate btrfs_ioctl_quota_rescan_args on stack Instead of using kmalloc() to allocate btrfs_ioctl_quota_rescan_args, allocate btrfs_ioctl_quota_rescan_args on stack, the size is reasonably small and ioctls are called in process context. sizeof(btrfs_ioctl_quota_rescan_args) = 64 Reviewed-by: Anand Jain Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit 98caf9531e1de8104b45fabbab4b6c2f290068fa Author: Goldwyn Rodrigues Date: Tue Jul 27 16:17:26 2021 -0500 btrfs: allocate file_ra_state on stack in readahead_cache Instead of allocating file_ra_state using kmalloc, allocate on stack. sizeof(struct readahead) = 32 bytes. Reviewed-by: Anand Jain Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0ff40a910f5649dfacc4fb5daa7e73692196342d Author: Marcos Paulo de Souza Date: Thu Jul 29 05:22:16 2021 -0300 btrfs: introduce btrfs_search_backwards function It's a common practice to start a search using offset (u64)-1, which is the u64 maximum value, meaning that we want the search_slot function to be set in the last item with the same objectid and type. Once we are in this position, it's a matter to start a search backwards by calling btrfs_previous_item, which will check if we'll need to go to a previous leaf and other necessary checks, only to be sure that we are in last offset of the same object and type. The new btrfs_search_backwards function does the all these steps when necessary, and can be used to avoid code duplication. Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit ea3dc7d2d1f524eb2a34b6501be38c82be5c7ff1 Author: David Sterba Date: Wed Jul 28 18:10:39 2021 +0200 btrfs: print if fsverity support is built in when loading module As fsverity support depends on a config option, print that at module load time like we do for similar features. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 705242538ff348874e642f2ce953e19702af411d Author: Boris Burkov Date: Wed Jun 30 13:01:50 2021 -0700 btrfs: verity metadata orphan items Writing out the verity data is too large of an operation to do in a single transaction. If we are interrupted before we finish creating fsverity metadata for a file, or fail to clean up already created metadata after a failure, we could leak the verity items that we already committed. To address this issue, we use the orphan mechanism. When we start enabling verity on a file, we also add an orphan item for that inode. When we are finished, we delete the orphan. However, if we are interrupted midway, the orphan will be present at mount and we can cleanup the half-formed verity state. There is a possible race with a normal unlink operation: if unlink and verity run on the same file in parallel, it is possible for verity to succeed and delete the still legitimate orphan added by unlink. Then, if we are interrupted and mount in that state, we will never clean up the inode properly. This is also possible for a file created with O_TMPFILE. Check nlink==0 before deleting to avoid this race. A final thing to note is that this is a resurrection of using orphans to signal an operation besides "delete this inode". The old case was to signal the need to do a truncate. That case still technically applies for mounting very old file systems, so we need to take some care to not clobber it. To that end, we just have to be careful that verity orphan cleanup is a no-op for non-verity files. Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 146054090b0859b28fc39015c7704ccc3c3a347f Author: Boris Burkov Date: Wed Jun 30 13:01:49 2021 -0700 btrfs: initial fsverity support Add support for fsverity in btrfs. To support the generic interface in fs/verity, we add two new item types in the fs tree for inodes with verity enabled. One stores the per-file verity descriptor and btrfs verity item and the other stores the Merkle tree data itself. Verity checking is done in end_page_read just before a page is marked uptodate. This naturally handles a variety of edge cases like holes, preallocated extents, and inline extents. Some care needs to be taken to not try to verity pages past the end of the file, which are accessed by the generic buffered file reading code under some circumstances like reading to the end of the last page and trying to read again. Direct IO on a verity file falls back to buffered reads. Verity relies on PageChecked for the Merkle tree data itself to avoid re-walking up shared paths in the tree. For this reason, we need to cache the Merkle tree data. Since the file is immutable after verity is turned on, we can cache it at an index past EOF. Use the new inode ro_flags to store verity on the inode item, so that we can enable verity on a file, then rollback to an older kernel and still mount the file system and read the file. Since we can't safely write the file anymore without ruining the invariants of the Merkle tree, we mark a ro_compat flag on the file system when a file has verity enabled. Acked-by: Eric Biggers Co-developed-by: Chris Mason Signed-off-by: Chris Mason Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 77eea05e7851d910b7992c8c237a6b5d462050da Author: Boris Burkov Date: Wed Jun 30 13:01:48 2021 -0700 btrfs: add ro compat flags to inodes Currently, inode flags are fully backwards incompatible in btrfs. If we introduce a new inode flag, then tree-checker will detect it and fail. This can even cause us to fail to mount entirely. To make it possible to introduce new flags which can be read-only compatible, like VERITY, we add new ro flags to btrfs without treating them quite so harshly in tree-checker. A read-only file system can survive an unexpected flag, and can be mounted. As for the implementation, it unfortunately gets a little complicated. The on-disk representation of the inode, btrfs_inode_item, has an __le64 for flags but the in-memory representation, btrfs_inode, uses a u32. David Sterba had the nice idea that we could reclaim those wasted 32 bits on disk and use them for the new ro_compat flags. It turns out that the tree-checker code which checks for unknown flags is broken, and ignores the upper 32 bits we are hoping to use. The issue is that the flags use the literal 1 rather than 1ULL, so the flags are signed ints, and one of them is specifically (1 << 31). As a result, the mask which ORs the flags is a negative integer on machines where int is 32 bit twos complement. When tree-checker evaluates the expression: btrfs_inode_flags(leaf, iitem) & ~BTRFS_INODE_FLAG_MASK) The mask is something like 0x80000abc, which gets promoted to u64 with sign extension to 0xffffffff80000abc. Negating that 64 bit mask leaves all the upper bits zeroed, and we can't detect unexpected flags. This suggests that we can't use those bits after all. Luckily, we have good reason to believe that they are zero anyway. Inode flags are metadata, which is always checksummed, so any bit flips that would introduce 1s would cause a checksum failure anyway (excluding the improbable case of the checksum getting corrupted exactly badly). Further, unless the 1 << 31 flag is used, the cast to u64 of the 32 bit inode flag should preserve its value and not add leading zeroes (at least for twos complement). The only place that flag (BTRFS_INODE_ROOT_ITEM_INIT) is used is in a special inode embedded in the root item, and indeed for that inode we see 0xffffffff80000000 as the flags on disk. However, that inode is never seen by tree checker, nor is it used in a context where verity might be meaningful. Theoretically, a future ro flag might cause trouble on that inode, so we should proactively clean up that mess before it does. With the introduction of the new ro flags, keep two separate unsigned masks and check them against the appropriate u32. Since we no longer run afoul of sign extension, this also stops writing out 0xffffffff80000000 in root_item inodes going forward. Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit efc222f8d79c0431c92ae8c72bc62d2e6bcf0a00 Author: Anand Jain Date: Wed Jul 28 07:03:05 2021 +0800 btrfs: simplify return values in btrfs_check_raid_min_devices Function btrfs_check_raid_min_devices() returns error code from the enum btrfs_err_code and it starts from 1. So there is no need to check if ret is > 0. So drop this check and also drop the local variable ret. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7361b4ae03d9f3325852eec1a7395ec5f1ff802d Author: Qu Wenruo Date: Wed Jul 28 14:05:05 2021 +0800 btrfs: remove the dead comment in writepage_delalloc() When btrfs_run_delalloc_range() failed, we will error out. But there is a strange comment mentioning that btrfs_run_delalloc_range() could have returned value >0 to indicate the IO has already started. Commit 40f765805f08 ("Btrfs: split up __extent_writepage to lower stack usage") introduced the comment, but unfortunately at that time, we were already using @page_started to indicate that case, and still return 0. Furthermore, even if that comment was right (which is not), we would return -EIO if the IO had already started. By all means the comment is incorrect, just remove the comment along with the dead check. Just to be extra safe, add an ASSERT() in btrfs_run_delalloc_range() to make sure we either return 0 or error, no positive return value. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit b2f78e88052bc0bee56bbf646d245fcfb431a873 Author: David Sterba Date: Thu Jul 22 20:54:37 2021 +0200 btrfs: allow degenerate raid0/raid10 The data on raid0 and raid10 are supposed to be spread over multiple devices, so the minimum constraints are set to 2 and 4 respectively. This is an artificial limit and there's some interest to remove it. Change this to allow raid0 on one device and raid10 on two devices. This works as expected eg. when converting or removing devices. The only difference is when raid0 on two devices gets one device removed. Unpatched would silently create a single profile, while newly it would be raid0. The motivation is to allow to preserve the profile type as long as it possible for some intermediate state (device removal, conversion), or when there are disks of different size, with raid0 the otherwise unusable space of the last device will be used too. Similarly for raid10, though the two largest devices would need to be the same. Unpatched kernel will mount and use the degenerate profiles just fine but won't allow any operation that would not satisfy the stricter device number constraints, eg. not allowing to go from 3 to 2 devices for raid10 or various profile conversions. Example output: # btrfs fi us -T . Overall: Device size: 10.00GiB Device allocated: 1.01GiB Device unallocated: 8.99GiB Device missing: 0.00B Used: 200.61MiB Free (estimated): 9.79GiB (min: 9.79GiB) Free (statfs, df): 9.79GiB Data ratio: 1.00 Metadata ratio: 1.00 Global reserve: 3.25MiB (used: 0.00B) Multiple profiles: no Data Metadata System Id Path RAID0 single single Unallocated -- ---------- --------- --------- -------- ----------- 1 /dev/sda10 1.00GiB 8.00MiB 1.00MiB 8.99GiB -- ---------- --------- --------- -------- ----------- Total 1.00GiB 8.00MiB 1.00MiB 8.99GiB Used 200.25MiB 352.00KiB 16.00KiB # btrfs dev us . /dev/sda10, ID: 1 Device size: 10.00GiB Device slack: 0.00B Data,RAID0/1: 1.00GiB Metadata,single: 8.00MiB System,single: 1.00MiB Unallocated: 8.99GiB Note "Data,RAID0/1", with btrfs-progs 5.13+ the number of devices per profile is printed. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit bd54f381a12ac695593271a663d36d14220215b2 Author: Filipe Manana Date: Tue Jul 27 11:24:45 2021 +0100 btrfs: do not pin logs too early during renames During renames we pin the logs of the roots a bit too early, before the calls to btrfs_insert_inode_ref(). We can pin the logs after those calls, since those will not change anything in a log tree. In a scenario where we have multiple and diverse filesystem operations running in parallel, those calls can take a significant amount of time, due to lock contention on extent buffers, and delay log commits from other tasks for longer than necessary. So just pin logs after calls to btrfs_insert_inode_ref() and right before the first operation that can update a log tree. The following script that uses dbench was used for testing: $ cat dbench-test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-m single -d single" echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor umount $DEV &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT dbench -D $MNT -t 120 16 umount $MNT The tests were run on a machine with 12 cores, 64G of RAN, a NVMe device and using a non-debug kernel config (Debian's default config). The results compare a branch without this patch and without the previous patch in the series, that has the subject: "btrfs: eliminate some false positives when checking if inode was logged" Versus the same branch with these two patches applied. dbench with 8 clients, results before: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 4391359 0.009 249.745 Close 3225882 0.001 3.243 Rename 185953 0.065 240.643 Unlink 886669 0.049 249.906 Deltree 112 2.455 217.433 Mkdir 56 0.002 0.004 Qpathinfo 3980281 0.004 3.109 Qfileinfo 697579 0.001 0.187 Qfsinfo 729780 0.002 2.424 Sfileinfo 357764 0.004 1.415 Find 1538861 0.016 4.863 WriteX 2189666 0.010 3.327 ReadX 6883443 0.002 0.729 LockX 14298 0.002 0.073 UnlockX 14298 0.001 0.042 Flush 307777 2.447 303.663 Throughput 1149.6 MB/sec 8 clients 8 procs max_latency=303.666 ms dbench with 8 clients, results after: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 4269920 0.009 213.532 Close 3136653 0.001 0.690 Rename 180805 0.082 213.858 Unlink 862189 0.050 172.893 Deltree 112 2.998 218.328 Mkdir 56 0.002 0.003 Qpathinfo 3870158 0.004 5.072 Qfileinfo 678375 0.001 0.194 Qfsinfo 709604 0.002 0.485 Sfileinfo 347850 0.004 1.304 Find 1496310 0.017 5.504 WriteX 2129613 0.010 2.882 ReadX 6693066 0.002 1.517 LockX 13902 0.002 0.075 UnlockX 13902 0.001 0.055 Flush 299276 2.511 220.189 Throughput 1187.33 MB/sec 8 clients 8 procs max_latency=220.194 ms +3.2% throughput, -31.8% max latency dbench with 16 clients, results before: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 5978334 0.028 156.507 Close 4391598 0.001 1.345 Rename 253136 0.241 155.057 Unlink 1207220 0.182 257.344 Deltree 160 6.123 36.277 Mkdir 80 0.003 0.005 Qpathinfo 5418817 0.012 6.867 Qfileinfo 949929 0.001 0.941 Qfsinfo 993560 0.002 1.386 Sfileinfo 486904 0.004 2.829 Find 2095088 0.059 8.164 WriteX 2982319 0.017 9.029 ReadX 9371484 0.002 4.052 LockX 19470 0.002 0.461 UnlockX 19470 0.001 0.990 Flush 418936 2.740 347.902 Throughput 1495.31 MB/sec 16 clients 16 procs max_latency=347.909 ms dbench with 16 clients, results after: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 5711833 0.029 131.240 Close 4195897 0.001 1.732 Rename 241849 0.204 147.831 Unlink 1153341 0.184 231.322 Deltree 160 6.086 30.198 Mkdir 80 0.003 0.021 Qpathinfo 5177011 0.012 7.150 Qfileinfo 907768 0.001 0.793 Qfsinfo 949205 0.002 1.431 Sfileinfo 465317 0.004 2.454 Find 2001541 0.058 7.819 WriteX 2850661 0.017 9.110 ReadX 8952289 0.002 3.991 LockX 18596 0.002 0.655 UnlockX 18596 0.001 0.179 Flush 400342 2.879 293.607 Throughput 1565.73 MB/sec 16 clients 16 procs max_latency=293.611 ms +4.6% throughput, -16.9% max latency Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6e8e777deb5cbff76bcd34b1f45bc747f48e8abe Author: Filipe Manana Date: Tue Jul 27 11:24:44 2021 +0100 btrfs: eliminate some false positives when checking if inode was logged When checking if an inode was previously logged in the current transaction through the helper inode_logged(), we can return some false positives that can be easily eliminated. These correspond to the cases where an inode has a ->logged_trans value that is not zero and its value is smaller then the ID of the current transaction. This means we know exactly that the inode was never logged before in the current transaction, so we can return false and avoid the callers to do extra work: 1) Having btrfs_del_dir_entries_in_log() and btrfs_del_inode_ref_in_log() unnecessarily join a log transaction and do deletion searches in a log tree that will not find anything. This just adds unnecessary contention on extent buffer locks; 2) Having btrfs_log_new_name() unnecessarily log an inode when it is not needed. If the inode was not logged before, we don't need to log it in LOG_INODE_EXISTS mode. So just make sure that any false positive only happens when ->logged_trans has a value of 0. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 42b5d73b5d231bbe38639c6dec913505d7f55372 Author: Naohiro Aota Date: Wed Jul 21 21:43:34 2021 +0900 btrfs: drop unnecessary ASSERT from btrfs_submit_direct() When on SINGLE block group, btrfs_get_io_geometry() will return "the size of the block group - the offset of the logical address within the block group" as geom.len. Since we allow up to 8 GiB zone size on zoned filesystem, we can have up to 8 GiB block group, so can have up to 8 GiB geom.len as well. With this setup, we easily hit the "ASSERT(geom.len <= INT_MAX);". The ASSERT looks like to guard btrfs_bio_clone_partial() and bio_trim() which both take "int" (now u64 due to the previous patch). So to be precise the ASSERT should check if clone_len <= UINT_MAX. But actually, clone_len is already capped by bio.bi_iter.bi_size which is unsigned int. So the ASSERT is not necessary. Drop the ASSERT and properly compare submit_len and geom.len in u64. Then, let the implicit casting to convert it to u64. Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 21dda654d4808833668b380e5f0b9befff8640ae Author: Chaitanya Kulkarni Date: Wed Jul 21 21:43:33 2021 +0900 btrfs: fix argument type of btrfs_bio_clone_partial() The offset and can never be negative use unsigned int instead of int type for them. Reviewed-by: Christoph Hellwig Signed-off-by: Chaitanya Kulkarni Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit e83502ca5f1e1f03fb1393008ec22d17e7dc9882 Author: Chaitanya Kulkarni Date: Wed Jul 21 21:43:32 2021 +0900 block: fix argument type of bio_trim() The function bio_trim has offset and size arguments that are declared as int. The callers of this function use sector_t type when passing the offset and size, e.g. drivers/md/raid1.c:narrow_write_error() and drivers/md/raid1.c:narrow_write_error(). Change offset and size arguments to sector_t type for bio_trim(). Also, add WARN_ON_ONCE() to catch their overflow. Reviewed-by: Christoph Hellwig Signed-off-by: Chaitanya Kulkarni Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5662c967c69dfd162a0667d69bad776939bedf85 Author: Josef Bacik Date: Wed Jul 14 14:47:25 2021 -0400 fs: kill sync_inode Now that all users of sync_inode() have been deleted, remove sync_inode(). Reviewed-by: Christoph Hellwig Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 25d23cd01621b740ce3e8f4f0fab40e24d163462 Author: Josef Bacik Date: Wed Jul 14 14:47:24 2021 -0400 9p: migrate from sync_inode to filemap_fdatawrite_wbc We're going to remove sync_inode, so migrate to filemap_fdatawrite_wbc instead. Reviewed-by: Christoph Hellwig Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit b3776305278e5937366f512d3e655ace13b8b027 Author: Josef Bacik Date: Wed Jul 14 14:47:23 2021 -0400 btrfs: use the filemap_fdatawrite_wbc helper for delalloc shrinking sync_inode() has some holes that can cause problems if we're under heavy ENOSPC pressure. If there's writeback running on a separate thread sync_inode() will skip writing the inode altogether. What we really want is to make sure writeback has been started on all the pages to make sure we can see the ordered extents and wait on them if appropriate. Switch to this new helper which will allow us to accomplish this and avoid ENOSPC'ing early. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5a798493b8f30121363359bba834392f044c169b Author: Josef Bacik Date: Wed Jul 14 14:47:22 2021 -0400 fs: add a filemap_fdatawrite_wbc helper Btrfs sometimes needs to flush dirty pages on a bunch of dirty inodes in order to reclaim metadata reservations. Unfortunately most helpers in this area are too smart for us: 1) The normal filemap_fdata* helpers only take range and sync modes, and don't give any indication of how much was written, so we can only flush full inodes, which isn't what we want in most cases. 2) The normal writeback path requires us to have the s_umount sem held, but we can't unconditionally take it in this path because we could deadlock. 3) The normal writeback path also skips inodes with I_SYNC set if we write with WB_SYNC_NONE. This isn't the behavior we want under heavy ENOSPC pressure, we want to actually make sure the pages are under writeback before returning, and if another thread is in the middle of writing the file we may return before they're under writeback and miss our ordered extents and not properly wait for completion. 4) sync_inode() uses the normal writeback path and has the same problem as #3. What we really want is to call do_writepages() with our wbc. This way we can make sure that writeback is actually started on the pages, and we can control how many pages are written as a whole as we write many inodes using the same wbc. Accomplish this with a new helper that does just that so we can use it for our ENOSPC flushing infrastructure. Reviewed-by: Nikolay Borisov Reviewed-by: Christoph Hellwig Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e16460707e94c3d4c1b5418cb68b28b8efa903b2 Author: Josef Bacik Date: Wed Jul 14 14:47:21 2021 -0400 btrfs: wait on async extents when flushing delalloc I've been debugging an early ENOSPC problem in production and finally root caused it to this problem. When we switched to the per-inode in 38d715f494f2 ("btrfs: use btrfs_start_delalloc_roots in shrink_delalloc") I pulled out the async extent handling, because we were doing the correct thing by calling filemap_flush() if we had async extents set. This would properly wait on any async extents by locking the page in the second flush, thus making sure our ordered extents were properly set up. However when I switched us back to page based flushing, I used sync_inode(), which allows us to pass in our own wbc. The problem here is that sync_inode() is smarter than the filemap_* helpers, it tries to avoid calling writepages at all. This means that our second call could skip calling do_writepages altogether, and thus not wait on the pagelock for the async helpers. This means we could come back before any ordered extents were created and then simply continue on in our flushing mechanisms and ENOSPC out when we have plenty of space to use. Fix this by putting back the async pages logic in shrink_delalloc. This allows us to bulk write out everything that we need to, and then we can wait in one place for the async helpers to catch up, and then wait on any ordered extents that are created. Fixes: e076ab2a2ca7 ("btrfs: shrink delalloc pages instead of full inodes") CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 03fe78cc2942c55cc13be5ca42578750f17204a1 Author: Josef Bacik Date: Wed Jul 14 14:47:20 2021 -0400 btrfs: use delalloc_bytes to determine flush amount for shrink_delalloc We have been hitting some early ENOSPC issues in production with more recent kernels, and I tracked it down to us simply not flushing delalloc as aggressively as we should be. With tracing I was seeing us failing all tickets with all of the block rsvs at or around 0, with very little pinned space, but still around 120MiB of outstanding bytes_may_used. Upon further investigation I saw that we were flushing around 14 pages per shrink call for delalloc, despite having around 2GiB of delalloc outstanding. Consider the example of a 8 way machine, all CPUs trying to create a file in parallel, which at the time of this commit requires 5 items to do. Assuming a 16k leaf size, we have 10MiB of total metadata reclaim size waiting on reservations. Now assume we have 128MiB of delalloc outstanding. With our current math we would set items to 20, and then set to_reclaim to 20 * 256k, or 5MiB. Assuming that we went through this loop all 3 times, for both FLUSH_DELALLOC and FLUSH_DELALLOC_WAIT, and then did the full loop twice, we'd only flush 60MiB of the 128MiB delalloc space. This could leave a fair bit of delalloc reservations still hanging around by the time we go to ENOSPC out all the remaining tickets. Fix this two ways. First, change the calculations to be a fraction of the total delalloc bytes on the system. Prior to this change we were calculating based on dirty inodes so our math made more sense, now it's just completely unrelated to what we're actually doing. Second add a FLUSH_DELALLOC_FULL state, that we hold off until we've gone through the flush states at least once. This will empty the system of all delalloc so we're sure to be truly out of space when we start failing tickets. I'm tagging stable 5.10 and forward, because this is where we started using the page stuff heavily again. This affects earlier kernel versions as well, but would be a pain to backport to them as the flushing mechanisms aren't the same. CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit fcdef39c03c5beb2a7bcb627addb0b259b9c5164 Author: Josef Bacik Date: Wed Jul 14 14:47:19 2021 -0400 btrfs: enable a tracepoint when we fail tickets When debugging early enospc problems it was useful to have a tracepoint where we failed all tickets so I could check the state of the enospc counters at failure time to validate my fixes. This adds the tracpoint so you can easily get that information. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8197766d806f02d69d2f54563e0b4672bddcc535 Author: Josef Bacik Date: Wed Jul 14 14:47:18 2021 -0400 btrfs: include delalloc related info in dump space info tracepoint In order to debug delalloc flushing issues I added delalloc_bytes and ordered_bytes to this tracepoint to see if they were non-zero when we were going ENOSPC. This was valuable for me and showed me cases where we weren't waiting on ordered extents properly. In order to add this to the tracepoint we need to take away the const modifier for fs_info, as percpu_sum_counter_positive() will change the counter when it adds up the percpu buckets. This is needed to make sure we're getting accurate information at these tracepoints, as the wrong information could send us down the wrong path when debugging problems. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ac98141d140444fe93e26471d3074c603b70e2ca Author: Josef Bacik Date: Wed Jul 14 14:47:17 2021 -0400 btrfs: wake up async_delalloc_pages waiters after submit We use the async_delalloc_pages mechanism to make sure that we've completed our async work before trying to continue our delalloc flushing. The reason for this is we need to see any ordered extents that were created by our delalloc flushing. However we're waking up before we do the submit work, which is before we create the ordered extents. This is a pretty wide race window where we could potentially think there are no ordered extents and thus exit shrink_delalloc prematurely. Fix this by waking us up after we've done the work to create ordered extents. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 963e4db83e2832ee5e760f3c7f92d68bd66156f6 Author: Qu Wenruo Date: Mon Jul 26 14:35:07 2021 +0800 btrfs: unify regular and subpage error paths in __extent_writepage() [BUG] When running btrfs/160 in a loop for subpage with experimental compression support, it has a high chance to crash (~20%): BTRFS critical (device dm-7): panic in __btrfs_add_ordered_extent:238: inconsistency in ordered tree at offset 0 (errno=-17 Object already exists) ------------[ cut here ]------------ kernel BUG at fs/btrfs/ordered-data.c:238! Internal error: Oops - BUG: 0 [#1] SMP pc : __btrfs_add_ordered_extent+0x550/0x670 [btrfs] lr : __btrfs_add_ordered_extent+0x550/0x670 [btrfs] Call trace: __btrfs_add_ordered_extent+0x550/0x670 [btrfs] btrfs_add_ordered_extent+0x2c/0x50 [btrfs] run_delalloc_nocow+0x81c/0x8fc [btrfs] btrfs_run_delalloc_range+0xa4/0x390 [btrfs] writepage_delalloc+0xc0/0x1ac [btrfs] __extent_writepage+0xf4/0x370 [btrfs] extent_write_cache_pages+0x288/0x4f4 [btrfs] extent_writepages+0x58/0xe0 [btrfs] btrfs_writepages+0x1c/0x30 [btrfs] do_writepages+0x60/0x110 __filemap_fdatawrite_range+0x108/0x170 filemap_fdatawrite_range+0x20/0x30 btrfs_fdatawrite_range+0x34/0x4dc [btrfs] __btrfs_write_out_cache+0x34c/0x480 [btrfs] btrfs_write_out_cache+0x144/0x220 [btrfs] btrfs_start_dirty_block_groups+0x3ac/0x6b0 [btrfs] btrfs_commit_transaction+0xd0/0xbb4 [btrfs] btrfs_sync_fs+0x64/0x1cc [btrfs] sync_fs_one_sb+0x3c/0x50 iterate_supers+0xcc/0x1d4 ksys_sync+0x6c/0xd0 __arm64_sys_sync+0x1c/0x30 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0x4c/0xd4 do_el0_svc+0x30/0x9c el0_svc+0x2c/0x54 el0_sync_handler+0x1a8/0x1b0 el0_sync+0x198/0x1c0 ---[ end trace 336f67369ae6e0af ]--- [CAUSE] For subpage case, we can have multiple sectors inside a page, this makes it possible for __extent_writepage() to have part of its page submitted before returning. In btrfs/160, we are using dm-dust to emulate write error, this means for certain pages, we could have everything running fine, but at the end of __extent_writepage(), one of the submitted bios fails due to dm-dust. Then the page is marked Error, and we change @ret from 0 to -EIO. This makes the caller extent_write_cache_pages() to error out, without submitting the remaining pages. Furthermore, since we're erroring out for free space cache, it doesn't really care about the error and will update the inode and retry the writeback. Then we re-run the delalloc range, and will try to insert the same delalloc range while previous delalloc range is still hanging there, triggering the above error. [FIX] The proper fix is to handle errors from __extent_writepage() properly, by ending the remaining ordered extent. But that fix needs the following changes: - Know at exactly which sector the error happened Currently __extent_writepage_io() works for the full page, can't return at which sector we hit the error. - Grab the ordered extent covering the failed sector As a hotfix for subpage case, here we unify the error paths in __extent_writepage(). In fact, the "if (PageError(page))" branch never get executed if @ret is still 0 for non-subpage cases. As for non-subpage case, we never submit current page in __extent_writepage(), but only add current page into bio. The bio can only get submitted in next page. Thus we never get PageError() set due to IO failure, thus when we hit the branch, @ret is never 0. By simply removing that @ret assignment, we let subpage case ignore the IO failure, thus only error out for fatal errors just like regular sectorsize. So that IO error won't be treated as fatal error not trigger the hanging OE problem. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 95ea0486b20e4de9011d04b05ed667201940b532 Author: Qu Wenruo Date: Mon Jul 26 14:35:06 2021 +0800 btrfs: allow read-write for 4K sectorsize on 64K page size systems Since now we support data and metadata read-write for subpage, remove the RO requirement for subpage mount. There are some extra limitations though: - For now, subpage RW mount is still considered experimental Thus that mount warning will still be there. - No compression support There are still quite some PAGE_SIZE hard coded and quite some call sites use extent_clear_unlock_delalloc() to unlock locked_page. This will screw up subpage helpers. Now for subpage RW mount, no matter what mount option or inode attr is set, all writes will not be compressed. Although reading compressed data has no problem. - No defrag for subpage case The defrag support for subpage case will come in later patches, which will also rework the defrag workflow. - No inline extent will be created This is mostly due to the fact that filemap_fdatawrite_range() will trigger more write than the range specified. In fallocate calls, this behavior can make us to writeback which can be inlined, before we enlarge the i_size. This is a very special corner case, and even current btrfs check won't report error on such inline extent + regular extent. But considering how much effort has been put to prevent such inline + regular, I'd prefer to cut off inline extent completely until we have a good solution. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 9d9ea1e68a05ef852d612f0c49d274c86e1e710a Author: Qu Wenruo Date: Mon Jul 26 14:35:05 2021 +0800 btrfs: subpage: fix relocation potentially overwriting last page data [BUG] When using the following script, btrfs will report data corruption after one data balance with subpage support: mkfs.btrfs -f -s 4k $dev mount $dev -o nospace_cache $mnt $fsstress -w -n 8 -s 1620948986 -d $mnt/ -v > /tmp/fsstress sync btrfs balance start -d $mnt btrfs scrub start -B $mnt Similar problem can be easily observed in btrfs/028 test case, there will be tons of balance failure with -EIO. [CAUSE] Above fsstress will result the following data extents layout in extent tree: item 10 key (13631488 EXTENT_ITEM 98304) itemoff 15889 itemsize 82 refs 2 gen 7 flags DATA extent data backref root FS_TREE objectid 259 offset 1339392 count 1 extent data backref root FS_TREE objectid 259 offset 647168 count 1 item 11 key (13631488 BLOCK_GROUP_ITEM 8388608) itemoff 15865 itemsize 24 block group used 102400 chunk_objectid 256 flags DATA item 12 key (13733888 EXTENT_ITEM 4096) itemoff 15812 itemsize 53 refs 1 gen 7 flags DATA extent data backref root FS_TREE objectid 259 offset 729088 count 1 Then when creating the data reloc inode, the data reloc inode will look like this: 0 32K 64K 96K 100K 104K |<------ Extent A ----->| |<- Ext B ->| Then when we first try to relocate extent A, we setup the data reloc inode with i_size 96K, then read both page [0, 64K) and page [64K, 128K). For page 64K, since the i_size is just 96K, we fill range [96K, 128K) with 0 and set it uptodate. Then when we come to extent B, we update i_size to 104K, then try to read page [64K, 128K). Then we find the page is already uptodate, so we skip the read. But range [96K, 128K) is filled with 0, not the real data. Then we writeback the data reloc inode to disk, with 0 filling range [96K, 128K), corrupting the content of extent B. The behavior is caused by the fact that we still do full page read for subpage case. The bug won't really happen for regular sectorsize, as one page only contains one sector. [FIX] This patch will fix the problem by invalidating range [i_size, PAGE_END] in prealloc_file_extent_cluster(). So that if above example happens, when we preallocate the file extent for extent B, we will clear the uptodate bits for range [96K, 128K), allowing later relocate_one_page() to re-read the needed range. There is a special note for the invalidating part. Since we're not calling real btrfs_invalidatepage(), but just clearing the subpage and page uptodate bits, we can leave a page half dirty and half out of date. Reading such page can cause a deadlock, as we normally expect a dirty page to be fully uptodate. Thus here we flush and wait the data reloc inode before doing the hacked invalidating. This won't cause extra overhead, as we're going to writeback the data later anyway. Reported-by: Ritesh Harjani Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e3c62324e470c0a89df966603156b34fccd01708 Author: Qu Wenruo Date: Mon Jul 26 14:35:04 2021 +0800 btrfs: subpage: fix false alert when relocating partial preallocated data extents [BUG] When relocating partial preallocated data extents (part of the preallocated extent is written) for subpage, it can cause the following false alert and make the relocation to fail: BTRFS info (device dm-3): balance: start -d BTRFS info (device dm-3): relocating block group 13631488 flags data BTRFS warning (device dm-3): csum failed root -9 ino 257 off 4096 csum 0x98757625 expected csum 0x00000000 mirror 1 BTRFS error (device dm-3): bdev /dev/mapper/arm_nvme-test errs: wr 0, rd 0, flush 0, corrupt 1, gen 0 BTRFS warning (device dm-3): csum failed root -9 ino 257 off 4096 csum 0x98757625 expected csum 0x00000000 mirror 1 BTRFS error (device dm-3): bdev /dev/mapper/arm_nvme-test errs: wr 0, rd 0, flush 0, corrupt 2, gen 0 BTRFS info (device dm-3): balance: ended with status: -5 The minimal script to reproduce looks like this: mkfs.btrfs -f -s 4k $dev mount $dev -o nospace_cache $mnt xfs_io -f -c "falloc 0 8k" $mnt/file xfs_io -f -c "pwrite 0 4k" $mnt/file btrfs balance start -d $mnt [CAUSE] Function btrfs_verify_data_csum() checks if the full range has EXTENT_NODATASUM bit for data reloc inode, if *all* bytes of the range have EXTENT_NODATASUM bit, then it skip the range. This works pretty well for regular sectorsize, as in that case btrfs_verify_data_csum() is called for each sector, thus no problem at all. But for subpage case, btrfs_verify_data_csum() is called on each bvec, which can contain several sectors, and since it checks *all* bytes for EXTENT_NODATASUM bit, if we have some range with csum, then we will continue checking all the sectors. For the preallocated sectors, it doesn't have any csum, thus obviously the csum won't match and cause the false alert. [FIX] Move the EXTENT_NODATASUM check into the main loop, so that we can check each sector for EXTENT_NODATASUM bit for subpage case. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 7c11d0ae439565b4560b0c0f36bf05171ed1a146 Author: Qu Wenruo Date: Mon Jul 26 14:35:03 2021 +0800 btrfs: subpage: fix a potential use-after-free in writeback helper [BUG] There is a possible use-after-free bug when running generic/095. BUG: Unable to handle kernel data access on write at 0x6b6b6b6b6b6b725b Faulting instruction address: 0xc000000000283654 c000000000283078 do_raw_spin_unlock+0x88/0x230 c0000000012b1e14 _raw_spin_unlock_irqrestore+0x44/0x90 c000000000a918dc btrfs_subpage_clear_writeback+0xac/0xe0 c0000000009e0458 end_bio_extent_writepage+0x158/0x270 c000000000b6fd14 bio_endio+0x254/0x270 c0000000009fc0f0 btrfs_end_bio+0x1a0/0x200 c000000000b6fd14 bio_endio+0x254/0x270 c000000000b781fc blk_update_request+0x46c/0x670 c000000000b8b394 blk_mq_end_request+0x34/0x1d0 c000000000d82d1c lo_complete_rq+0x11c/0x140 c000000000b880a4 blk_complete_reqs+0x84/0xb0 c0000000012b2ca4 __do_softirq+0x334/0x680 c0000000001dd878 irq_exit+0x148/0x1d0 c000000000016f4c do_IRQ+0x20c/0x240 c000000000009240 hardware_interrupt_common_virt+0x1b0/0x1c0 [CAUSE] There is very small race window like the following in generic/095. Thread 1 | Thread 2 --------------------------------+------------------------------------ end_bio_extent_writepage() | btrfs_releasepage() |- spin_lock_irqsave() | | |- end_page_writeback() | | | | |- if (PageWriteback() ||...) | | |- clear_page_extent_mapped() | | |- kfree(subpage); |- spin_unlock_irqrestore(). The race can also happen between writeback and btrfs_invalidatepage(), although that would be much harder as btrfs_invalidatepage() has much more work to do before the clear_page_extent_mapped() call. [FIX] Here we "wait" for the subapge spinlock to be released before we detach subpage structure. So this patch will introduce a new function, wait_subpage_spinlock(), to do the "wait" by acquiring the spinlock and release it. Since the caller has ensured the page is not dirty nor writeback, and page is already locked, the only way to hold the subpage spinlock is from endio function. Thus we only need to acquire the spinlock to wait for any existing holder. Reported-by: Ritesh Harjani Tested-by: Ritesh Harjani Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e0467866198f7f536806f39e5d0d91ae8018de08 Author: Qu Wenruo Date: Mon Jul 26 14:35:02 2021 +0800 btrfs: subpage: fix race between prepare_pages() and btrfs_releasepage() [BUG] When running generic/095, there is a high chance to crash with subpage data RW support: assertion failed: PagePrivate(page) && page->private ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.h:3403! Internal error: Oops - BUG: 0 [#1] SMP CPU: 1 PID: 3567 Comm: fio Tainted: 5.12.0-rc7-custom+ #17 Hardware name: Khadas VIM3 (DT) Call trace: assertfail.constprop.0+0x28/0x2c [btrfs] btrfs_subpage_assert+0x80/0xa0 [btrfs] btrfs_subpage_set_uptodate+0x34/0xec [btrfs] btrfs_page_clamp_set_uptodate+0x74/0xa4 [btrfs] btrfs_dirty_pages+0x160/0x270 [btrfs] btrfs_buffered_write+0x444/0x630 [btrfs] btrfs_direct_write+0x1cc/0x2d0 [btrfs] btrfs_file_write_iter+0xc0/0x160 [btrfs] new_sync_write+0xe8/0x180 vfs_write+0x1b4/0x210 ksys_pwrite64+0x7c/0xc0 __arm64_sys_pwrite64+0x24/0x30 el0_svc_common.constprop.0+0x70/0x140 do_el0_svc+0x28/0x90 el0_svc+0x2c/0x54 el0_sync_handler+0x1a8/0x1ac el0_sync+0x170/0x180 Code: f0000160 913be042 913c4000 955444bc (d4210000) ---[ end trace 3fdd39f4cccedd68 ]--- [CAUSE] Although prepare_pages() calls find_or_create_page(), which returns the page locked, but in later prepare_uptodate_page() calls, we may call btrfs_readpage() which will unlock the page before it returns. This leaves a window where btrfs_releasepage() can sneak in and release the page, clearing page->private and causing above ASSERT(). [FIX] In prepare_uptodate_page(), we should not only check page->mapping, but also PagePrivate() to ensure we are still holding the correct page which has proper fs context setup. Reported-by: Ritesh Harjani Tested-by: Ritesh Harjani Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit c8050b3b7f76586945003a8a2aeb2c8157f26645 Author: Qu Wenruo Date: Mon Jul 26 14:35:01 2021 +0800 btrfs: subpage: reject raid56 filesystem and profile conversion RAID56 is not only unsafe due to its write-hole problem, but also has tons of hardcoded PAGE_SIZE. Disable it for subpage support for now. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e0eefe07f89516f57dac3fbb759b75a5f0a19ae4 Author: Qu Wenruo Date: Mon Jul 26 14:35:00 2021 +0800 btrfs: subpage: allow submit_extent_page() to do bio split Current submit_extent_page() just checks if the current page range can be fitted into current bio, and if not, submit then re-add. But this behavior can't handle subpage case at all. For subpage case, the problem is in the page size, 64K, which is also the same size as stripe size. This means, if we can't fit a full 64K into a bio, due to stripe limit, then it won't fit into next bio without crossing stripe either. The proper way to handle it is: - Check how many bytes we can be put into current bio - Put as many bytes as possible into current bio first - Submit current bio - Create a new bio - Add the remaining bytes into the new bio Refactor submit_extent_page() so that it does the above iteration. The main loop inside submit_extent_page() will look like this: cur = pg_offset; while (cur < pg_offset + size) { u32 offset = cur - pg_offset; int added; if (!bio_ctrl->bio) { /* Allocate new bio if needed */ } /* Add as many bytes into the bio */ added = btrfs_bio_add_page(); if (added < size - offset) { /* The current bio is full, submit it */ } cur += added; } Also, since we're doing new bio allocation deep inside the main loop, extract that code into a new helper, alloc_new_bio(). Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 7367253a351ef7202d215d3145d7e83e1472be7d Author: Qu Wenruo Date: Mon Jul 26 14:34:59 2021 +0800 btrfs: subpage: disable inline extent creation [BUG] When running the following fsx command (extracted from generic/127) on subpage filesystem, it can create inline extent with regular extents: fsx -q -l 262144 -o 65536 -S 191110531 -N 9057 -R -W $mnt/file > /tmp/fsx The offending extent would look like: item 9 key (257 INODE_REF 256) itemoff 15703 itemsize 14 index 2 namelen 4 name: file item 10 key (257 EXTENT_DATA 0) itemoff 14975 itemsize 728 generation 7 type 0 (inline) inline extent data size 707 ram_bytes 707 compression 0 (none) item 11 key (257 EXTENT_DATA 4096) itemoff 14922 itemsize 53 generation 7 type 2 (prealloc) prealloc data disk byte 102346752 nr 4096 prealloc data offset 0 nr 4096 [CAUSE] For subpage filesystem, the writeback is triggered in page units, which means, even if we just want to writeback range [16K, 20K) for 64K page system, we will still try to writeback any dirty sector of range [0, 64K). This is never a problem if sectorsize == PAGE_SIZE, but for subpage, this can cause unexpected problems. For above test case, the last several operations from fsx are: 9055 trunc from 0x40000 to 0x2c3 9057 falloc from 0x164c to 0x19d2 (0x386 bytes) In operation 9055, we dirtied sector [0, 4096), then in falloc, we call btrfs_wait_ordered_range(inode, start=4096, len=4096), only expecting to writeback any dirty data in [4096, 8192), but nothing else. Unfortunately, in subpage case, above btrfs_wait_ordered_range() will trigger writeback of the range [0, 64K), which includes the data at [0, 4096). And since at the call site, we haven't yet increased i_size, which is still 707, this means cow_file_range() can insert an inline extent. Resulting above inline + regular extent. [WORKAROUND] I don't really have any good short-term solution yet, as this means all operations that would trigger writeback need to be reviewed for any i_size change. So here I choose to disable inline extent creation for subpage case as a workaround. We have done tons of work just to avoid such extent, so I don't to create an exception just for subpage. This only affects inline extent creation, subpage has no problem reading existing inline extents at all. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit cc1d0d93d55ac12e7faee9acfcd7c28c8b86cf89 Author: Qu Wenruo Date: Mon Jul 26 14:34:58 2021 +0800 btrfs: subpage: fix writeback which does not have ordered extent [BUG] When running fsstress with subpage RW support, there are random BUG_ON()s triggered with the following trace: kernel BUG at fs/btrfs/file-item.c:667! Internal error: Oops - BUG: 0 [#1] SMP CPU: 1 PID: 3486 Comm: kworker/u13:2 5.11.0-rc4-custom+ #43 Hardware name: Radxa ROCK Pi 4B (DT) Workqueue: btrfs-worker-high btrfs_work_helper [btrfs] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--) pc : btrfs_csum_one_bio+0x420/0x4e0 [btrfs] lr : btrfs_csum_one_bio+0x400/0x4e0 [btrfs] Call trace: btrfs_csum_one_bio+0x420/0x4e0 [btrfs] btrfs_submit_bio_start+0x20/0x30 [btrfs] run_one_async_start+0x28/0x44 [btrfs] btrfs_work_helper+0x128/0x1b4 [btrfs] process_one_work+0x22c/0x430 worker_thread+0x70/0x3a0 kthread+0x13c/0x140 ret_from_fork+0x10/0x30 [CAUSE] Above BUG_ON() means there is some bio range which doesn't have ordered extent, which indeed is worth a BUG_ON(). Unlike regular sectorsize == PAGE_SIZE case, in subpage we have extra subpage dirty bitmap to record which range is dirty and should be written back. This means, if we submit bio for a subpage range, we do not only need to clear page dirty, but also need to clear subpage dirty bits. In __extent_writepage_io(), we will call btrfs_page_clear_dirty() for any range we submit a bio. But there is loophole, if we hit a range which is beyond i_size, we just call btrfs_writepage_endio_finish_ordered() to finish the ordered io, then break out, without clearing the subpage dirty. This means, if we hit above branch, the subpage dirty bits are still there, if other range of the page get dirtied and we need to writeback that page again, we will submit bio for the old range, leaving a wild bio range which doesn't have ordered extent. [FIX] Fix it by always calling btrfs_page_clear_dirty() in __extent_writepage_io(). Also to avoid such problem from happening again, add a new assert, btrfs_page_assert_not_dirty(), to make sure both page dirty and subpage dirty bits are cleared before exiting __extent_writepage_io(). Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit c2832898126fc320a0e2915b07bf8924cf54770e Author: Qu Wenruo Date: Mon Jul 26 14:34:57 2021 +0800 btrfs: make relocate_one_page() handle subpage case For subpage case, one page of data reloc inode can contain several file extents, like this: |<--- File extent A --->| FE B | FE C |<--- File extent D -->| |<--------- Page --------->| We can no longer use PAGE_SIZE directly for various operations. This patch will relocate_one_page() to handle subpage case by: - Iterating through all extents of a cluster when marking pages When marking pages dirty and delalloc, we need to check the cluster extent boundary. Now we introduce a loop to go extent by extent of a page, until we either finished the last extent, or reach the page end. By this, regular sectorsize == PAGE_SIZE can still work as usual, since we will do that loop only once. - Iteration start from max(page_start, extent_start) Since we can have the following case: | FE B | FE C |<--- File extent D -->| |<--------- Page --------->| Thus we can't always start from page_start, but do a max(page_start, extent_start) - Iteration end when the cluster is exhausted Similar to previous case, the last file extent can end before the page end: |<--- File extent A --->| FE B | FE C | |<--------- Page --------->| In this case, we need to manually exit the loop after we have finished the last extent of the cluster. - Reserve metadata space for each extent range Since now we can hit multiple ranges in one page, we should reserve metadata for each range, not simply PAGE_SIZE. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit f47960f49e59b9d77bd2919c3513dbbe088c3908 Author: Qu Wenruo Date: Mon Jul 26 14:34:56 2021 +0800 btrfs: reloc: factor out relocation page read and dirty part In function relocate_file_extent_cluster(), we have a big loop for marking all involved page delalloc. That part is long enough to be contained in one function, so this patch will move that code chunk into a new function, relocate_one_page(). This also provides enough space for later subpage work. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit a6e66e6f8c1b685e11b778bef614480a9c1a5278 Author: Qu Wenruo Date: Mon Jul 26 14:34:55 2021 +0800 btrfs: rework lzo_decompress_bio() to make it subpage compatible For the initial subpage support, although we won't support compressed write, we still need to support compressed read. But for lzo_decompress_bio() it has several problems: - The abuse of PAGE_SIZE for boundary detection For subpage case, we should follow sectorsize to detect the padding zeros. Using PAGE_SIZE will cause subpage compress read to skip certain bytes, and causing read error. - Too many helper variables There are half a dozen helper variables, which is only making things harder to read This patch will rework lzo_decompress_bio() to make it work for subpage: - Use sectorsize to do boundary check, while still use PAGE_SIZE for page switching This allows us to have the same on-disk format for 4K sectorsize fs, while take advantage of larger page size. - Use two main cursors Only @cur_in and @cur_out is utilized as the main cursor. The helper variables will only be declared inside the loop, and only 2 helper variables needed. - Introduce a helper function to copy compressed segment payload Introduce a new helper, copy_compressed_segment(), to copy a compressed segment to workspace buffer. This function will handle the page switching. Now the net result is, with all the excessive comments and new helper function, the refactored code is still smaller, and easier to read. For other decompression code, they have no special padding rule, thus no need to bother for initial subpage support, but will be refactored to the same style later. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 1c3dc1731ed2b3757b25533c5245926ffc94f7dc Author: Qu Wenruo Date: Mon Jul 5 10:00:58 2021 +0800 btrfs: rework btrfs_decompress_buf2page() There are several bugs inside the function btrfs_decompress_buf2page() - @start_byte doesn't take bvec.bv_offset into consideration Thus it can't handle case where the target range is not page aligned. - Too many helper variables There are tons of helper variables, @buf_offset, @current_buf_start, @start_byte, @prev_start_byte, @working_bytes, @bytes. This hurts anyone who wants to read the function. - No obvious main cursor for the iteartion A new problem caused by previous problem. - Comments for parameter list makes no sense Like @buf_start is the offset to @buf, or offset inside the full decompressed extent? (Spoiler alert, the later case) And @total_out acts more like @buf_start + @size_of_buf. The worst is @disk_start. The real meaning of it is the file offset of the full decompressed extent. This patch will rework the whole function by: - Add a proper comment with ASCII art to explain the parameter list - Rework parameter list The old @buf_start is renamed to @decompressed, to show how many bytes are already decompressed inside the full decompressed extent. The old @total_out is replaced by @buf_len, which is the decompressed data size. For old @disk_start and @bio, just pass @compressed_bio in. - Use single main cursor The main cursor will be @cur_file_offset, to show what's the current file offset. Other helper variables will be declared inside the main loop, and only minimal amount of helper variables: * offset_inside_decompressed_buf: The only real helper * copy_start_file_offset: File offset we start memcpy * bvec_file_offset: File offset of current bvec Even with all these extensive comments, the final function is still smaller than the original function, which is definitely a win. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 557023ea9f06baf2659b232b08b8e8711f7001a6 Author: Qu Wenruo Date: Mon Jul 5 10:00:56 2021 +0800 btrfs: grab correct extent map for subpage compressed extent read [BUG] When subpage compressed read write support is enabled, btrfs/038 always fails with EIO. A simplified script can easily trigger the problem: mkfs.btrfs -f -s 4k $dev mount $dev $mnt -o compress=lzo xfs_io -f -c "truncate 118811" $mnt/foo xfs_io -c "pwrite -S 0x0d -b 39987 92267 39987" $mnt/foo > /dev/null sync btrfs subvolume snapshot -r $mnt $mnt/mysnap1 xfs_io -c "pwrite -S 0x3e -b 80000 200000 80000" $mnt/foo > /dev/null sync xfs_io -c "pwrite -S 0xdc -b 10000 250000 10000" $mnt/foo > /dev/null xfs_io -c "pwrite -S 0xff -b 10000 300000 10000" $mnt/foo > /dev/null sync btrfs subvolume snapshot -r $mnt $mnt/mysnap2 cat $mnt/mysnap2/foo # Above cat will fail due to EIO [CAUSE] The problem is in btrfs_submit_compressed_read(). When it tries to grab the extent map of the read range, it uses the following call: em = lookup_extent_mapping(em_tree, page_offset(bio_first_page_all(bio)), fs_info->sectorsize); The problem is in the page_offset(bio_first_page_all(bio)) part. The offending inode has the following file extent layout item 10 key (257 EXTENT_DATA 131072) itemoff 15639 itemsize 53 generation 8 type 1 (regular) extent data disk byte 13680640 nr 4096 extent data offset 0 nr 4096 ram 4096 extent compression 0 (none) item 11 key (257 EXTENT_DATA 135168) itemoff 15586 itemsize 53 generation 8 type 1 (regular) extent data disk byte 0 nr 0 item 12 key (257 EXTENT_DATA 196608) itemoff 15533 itemsize 53 generation 8 type 1 (regular) extent data disk byte 13676544 nr 4096 extent data offset 0 nr 53248 ram 86016 extent compression 2 (lzo) And the bio passed in has the following parameters: page_offset(bio_first_page_all(bio)) = 131072 bio_first_bvec_all(bio)->bv_offset = 65536 If we use page_offset(bio_first_page_all(bio) without adding bv_offset, we will get an extent map for file offset 131072, not 196608. This means we read uncompressed data from disk, and later decompression will definitely fail. [FIX] Take bv_offset into consideration when trying to grab an extent map. And add an ASSERT() to ensure we're really getting a compressed extent. Thankfully this won't affect anything but subpage, thus we only need to ensure this patch get merged before we enabled basic subpage support. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit ca62e85ded2c02f5e5d469103f2a5b6b09883dcc Author: Qu Wenruo Date: Mon Jul 26 14:34:52 2021 +0800 btrfs: disable compressed readahead for subpage For current subpage support, we only support 64K page size with 4K sector size. This makes compressed readahead less effective, as maximum compressed extent size is only 128K, 2x the page size. On the other hand, the function add_ra_bio_pages() is still assuming sectorsize == PAGE_SIZE, and code change may affect 4K page size systems. So for now, let's disable subpage compressed readahead for now. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 3670e6451bc9c39ab3a46f1da19360219e4319f3 Author: Qu Wenruo Date: Mon Jul 26 14:34:51 2021 +0800 btrfs: subpage: check if there are compressed extents inside one page [BUG] When testing experimental subpage compressed write support, it hits a NULL pointer dereference inside read path: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 pc : __pi_memcmp+0x28/0x1ec lr : check_data_csum+0xd0/0x274 [btrfs] Call trace: __pi_memcmp+0x28/0x1ec btrfs_verify_data_csum+0xf4/0x244 [btrfs] end_bio_extent_readpage+0x1d0/0x6b0 [btrfs] bio_endio+0x15c/0x1dc end_workqueue_fn+0x44/0x64 [btrfs] btrfs_work_helper+0x74/0x250 [btrfs] process_one_work+0x1d4/0x47c worker_thread+0x180/0x400 kthread+0x11c/0x120 ret_from_fork+0x10/0x30 Code: 54000261 d100044c d343fd8c f8408403 (f8408424) ---[ end trace 9e2c59f33ea40866 ]--- [CAUSE] When reading two compressed extents inside the same page, like the following layout, we trigger above crash: 0 32K 64K |-------|\\\\\\\| | \- Compressed extent (A) \--------- Compressed extent (B) For compressed read, we don't need to populate its io_bio->csum, as we rely on compressed_bio->csum to verify the compressed data, and then copy the decompressed to inode pages. Normally btrfs_verify_data_csum() skip such page by checking and clearing its PageChecked flag But since that flag is still for the full page, when endio for inode page range [0, 32K) gets executed, it clears PageChecked flag for the full page. Then when endio for inode page range [32K, 64K) gets executed, since the page no longer has PageChecked flag, it just continues checking, even though io_bio->csum is NULL. [FIX] Thankfully there are only two users of PageChecked bit: - Cow fixup Since subpage has its own way to trace page dirty (dirty_bitmap) and ordered bit (ordered_bitmap), it should never trigger cow fixup. - Compressed read We can distinguish such read by just checking io_bio->csum. So just check io_bio->csum before doing the verification to avoid such NULL pointer dereference. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 4c37a7938496756649096a7ec26320eb8b0d90fb Author: Qu Wenruo Date: Mon Jul 26 14:34:50 2021 +0800 btrfs: reset this_bio_flag to avoid inheriting old flags In btrfs_do_readpage(), we never reset @this_bio_flag after we hit a compressed extent. This is fine, as for PAGE_SIZE == sectorsize case, we can only have one sector for one page, thus @this_bio_flag will only be set at most once. But for subpage case, after hitting a compressed extent, @this_bio_flag will always have EXTENT_BIO_COMPRESSED bit, even we're reading a regular extent. This will lead to various read errors, and causing new ASSERT() in incoming subpage patches, which adds more strict check in btrfs_submit_compressed_read(). Fix it by declaring @this_bio_flag inside the main loop and reset its value for each iteration. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 214cc184321743327c84c4a13ad08d088dfb3c4a Author: David Sterba Date: Mon Jul 26 14:15:26 2021 +0200 btrfs: constify and cleanup variables in comparators Comparators just read the data and thus get const parameters. This should be also preserved by the local variables, update all comparators passed to sort or bsearch. Cleanups: - unnecessary casts are dropped - btrfs_cmp_device_free_bytes is cleaned up to follow the common pattern and 'inline' is dropped as the function address is taken Signed-off-by: David Sterba commit d58ede8d1d9fb0f70d6aa51fa6550d2d580f8c17 Author: David Sterba Date: Mon Jul 26 14:15:24 2021 +0200 btrfs: simplify data stripe calculation helpers There are two helpers doing the same calculations based on nparity and ncopies. calc_data_stripes can be simplified into one expression, so far we don't have profile with both copies and parity, so there's no effective change. calc_stripe_length should reuse the helper and not repeat the same calculation. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit fe4f46d40c1c2ff78a8a7280e455f115c32e6b41 Author: David Sterba Date: Mon Jul 26 14:15:21 2021 +0200 btrfs: merge alloc_device helpers The device allocation is split to two functions, but one just calls the other and they're very far in the file. Merge them together. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 500a44c9b301ae1844e38606c4bff4f15c174fb0 Author: David Sterba Date: Mon Jul 26 14:15:19 2021 +0200 btrfs: uninline btrfs_bg_flags_to_raid_index The helper does a simple translation from block group flags to index to the btrfs_raid_array table. There's no apparent reason to inline the function, the translation happens usually once per function and is not called in a loop. Making it a proper function saves quite some binary code (x86_64, release config): text data bss dec hex filename 1164011 19253 14912 1198176 124860 pre/btrfs.ko 1161559 19253 14912 1195724 123ecc post/btrfs.ko DELTA: -2451 Also add the const attribute as there are no side effects, this could help compiler to optimize a few things without the function body. Signed-off-by: David Sterba commit 6c154ba41bd0b925428e73571df2f80dc8d082ba Author: David Sterba Date: Mon Jul 26 14:15:17 2021 +0200 btrfs: tree-checker: add missing stripe checks for raid1c3/4 profiles The stripe checks for raid1c3/raid1c4 are missing in the sequence in btrfs_check_chunk_valid. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 0ac6e06b6c137e18d95070fdd3c6cbd319005ffb Author: David Sterba Date: Mon Jul 26 14:15:15 2021 +0200 btrfs: tree-checker: use table values for stripe checks There are hardcoded values in several checks regarding chunks and stripe constraints. We have that defined in the raid table and ought to use it. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 809d6902b3b05fd6b4494ff1460c227b99fcb4c3 Author: David Sterba Date: Mon Jul 26 14:15:12 2021 +0200 btrfs: make btrfs_next_leaf static inline btrfs_next_leaf is a simple wrapper for btrfs_next_old_leaf so move it to header to avoid the function call overhead. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit f41b6ba93d8ef990c4acc70987bbc138c1926ebb Author: David Sterba Date: Mon Jul 26 14:15:10 2021 +0200 btrfs: remove uptodate parameter from btrfs_dec_test_first_ordered_pending In commit e65f152e4348 ("btrfs: refactor how we finish ordered extent io for endio functions") there was last caller not using 1 for the uptodate parameter. Now there's only one, passing 1, so we can remove it and simplify the code. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 25c1252a026c6c34ff99c86f31856701b2192c0e Author: David Sterba Date: Mon Jul 26 14:15:08 2021 +0200 btrfs: switch uptodate to bool in btrfs_writepage_endio_finish_ordered The uptodate parameter should be bool, change the type. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit a129ffb8166a5a87162f79b0dd013044df68e497 Author: Qu Wenruo Date: Tue Jul 27 13:41:32 2021 +0800 btrfs: remove unused start and end parameters from btrfs_run_delalloc_range() Since commit d75855b4518b ("btrfs: Remove extent_io_ops::writepage_start_hook") removes the writepage_start_hook() and adds btrfs_writepage_cow_fixup() function, there is no need to follow the old hook parameters. Remove the @start and @end hook, since currently the fixup check is full page check, it doesn't need @start and @end hook. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a7d1c5dc8632e9b370ad26478c468d4e4e29f263 Author: Marcos Paulo de Souza Date: Mon Jul 26 16:19:09 2021 -0300 btrfs: introduce btrfs_lookup_match_dir btrfs_search_slot is called in multiple places in dir-item.c to search for a dir entry, and then calling btrfs_match_dir_name to return a btrfs_dir_item. In order to reduce the number of callers of btrfs_search_slot, create a common function that looks for the dir key, and if found call btrfs_match_dir_item_name. Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit f8ee80de7bcf57bada19df887d8a7f87fd179cfa Author: Marcos Paulo de Souza Date: Mon Jul 26 15:51:07 2021 -0300 btrfs: remove unneeded return variable in btrfs_lookup_file_extent We can return from btrfs_search_slot directly which also shows that it follows the same return value convention. Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit ad9a9378502d5a9da3a47666878246b9404a3391 Author: Marcos Paulo de Souza Date: Tue Jul 13 10:58:03 2021 -0300 btrfs: use btrfs_next_leaf instead of btrfs_next_item when slots > nritems After calling btrfs_search_slot is a common practice to check if the slot found isn't bigger than number of slots in the current leaf, and if so, search for the same key in the next leaf by calling btrfs_next_leaf, which calls btrfs_next_old_leaf to do the job. Calling btrfs_next_item in the same situation would end up in the same code flow, since * btrfs_next_item * btrfs_next_old_item * if slot >= nritems(curr_leaf) btrfs_next_old_leaf Change btrfs_verify_dev_extents and calculate_emulated_zone_size functions to use btrfs_next_leaf in the same situation. Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit c7bcbb2120cb74ce8757e310e5ceea1f3a139597 Author: Filipe Manana Date: Thu Jul 22 15:58:10 2021 +0100 btrfs: remove ignore_offset argument from btrfs_find_all_roots() Currently all the callers of btrfs_find_all_roots() pass a value of false for its ignore_offset argument. This makes the argument pointless and we can remove it and make btrfs_find_all_roots() always pass false as the ignore_offset argument for btrfs_find_all_roots_safe(). So just do that. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2ac691d8b3b1dd300a48b1763fa3a1434863070b Author: Filipe Manana Date: Tue Jul 20 16:03:43 2021 +0100 btrfs: avoid unnecessary lock and leaf splits when updating inode in the log During a fast fsync, if we have already fsynced the file before and in the current transaction, we can make the inode item update more efficient and avoid acquiring a write lock on the leaf's parent. To update the inode item we are always using btrfs_insert_empty_item() to get a path pointing to the inode item, which calls btrfs_search_slot() with an "ins_len" argument of 'sizeof(struct btrfs_inode_item) + sizeof(struct btrfs_item)', and that always results in the search taking a write lock on the level 1 node that is the parent of the leaf that contains the inode item. This adds unnecessary lock contention on log trees when we have multiple fsyncs in parallel against inodes in the same subvolume, which has a very significant impact due to the fact that log trees are short lived and their height very rarely goes beyond level 2. Also, by using btrfs_insert_empty_item() when we need to update the inode item, we also end up splitting the leaf of the existing inode item when the leaf has an amount of free space smaller than the size of an inode item. Improve this by using btrfs_seach_slot(), with a 0 "ins_len" argument, when we know the inode item already exists in the log. This avoids these two inefficiencies. The following script, using fio, was used to perform the tests: $ cat fio-test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-d single -m single" if [ $# -ne 4 ]; then echo "Use $0 NUM_JOBS FILE_SIZE FSYNC_FREQ BLOCK_SIZE" exit 1 fi NUM_JOBS=$1 FILE_SIZE=$2 FSYNC_FREQ=$3 BLOCK_SIZE=$4 cat < /tmp/fio-job.ini [writers] rw=randwrite fsync=$FSYNC_FREQ fallocate=none group_reporting=1 direct=0 bs=$BLOCK_SIZE ioengine=sync size=$FILE_SIZE directory=$MNT numjobs=$NUM_JOBS EOF echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor echo echo "Using config:" echo cat /tmp/fio-job.ini echo echo "mount options: $MOUNT_OPTIONS" echo umount $MNT &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT fio /tmp/fio-job.ini umount $MNT The tests were done on a physical machine, with 12 cores, 64G of RAM, using a NVMEe device and using a non-debug kernel config (the default one from Debian). The summary line from fio is provided below for each test run. With 8 jobs, file size 256M, fsync frequency of 4 and a block size of 4K: Before: WRITE: bw=28.3MiB/s (29.7MB/s), 28.3MiB/s-28.3MiB/s (29.7MB/s-29.7MB/s), io=2048MiB (2147MB), run=72297-72297msec After: WRITE: bw=28.7MiB/s (30.1MB/s), 28.7MiB/s-28.7MiB/s (30.1MB/s-30.1MB/s), io=2048MiB (2147MB), run=71411-71411msec +1.4% throughput, -1.2% runtime With 16 jobs, file size 256M, fsync frequency of 4 and a block size of 4K: Before: WRITE: bw=40.0MiB/s (42.0MB/s), 40.0MiB/s-40.0MiB/s (42.0MB/s-42.0MB/s), io=4096MiB (4295MB), run=99980-99980msec After: WRITE: bw=40.9MiB/s (42.9MB/s), 40.9MiB/s-40.9MiB/s (42.9MB/s-42.9MB/s), io=4096MiB (4295MB), run=97933-97933msec +2.2% throughput, -2.1% runtime The changes are small but it's possible to be better on faster hardware as in the test machine used disk utilization was pretty much 100% during the whole time the tests were running (observed with 'iostat -xz 1'). The tests also included the previous patch with the subject of: "btrfs: avoid unnecessary log mutex contention when syncing log". So they compared a branch without that patch and without this patch versus a branch with these two patches applied. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e68107e51f8466e1fae40d64b873d0a11398a628 Author: Filipe Manana Date: Tue Jul 20 16:03:42 2021 +0100 btrfs: remove unnecessary list head initialization when syncing log One of the last steps of syncing the log is to remove all log contexts from the root's list of contexts, done at btrfs_remove_all_log_ctxs(). There we iterate over all the contexts in the list and delete each one from the list, and after that we call INIT_LIST_HEAD() on the list. That is unnecessary since at that point the list is empty. So just remove the INIT_LIST_HEAD() call. It's not needed, increases code size (bloat-o-meter reported a delta of -122 for btrfs_sync_log() after this change) and increases two critical sections delimited by log mutexes. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e1a6d2648300ef4cfdcfd4838224fe5cefe3caaa Author: Filipe Manana Date: Tue Jul 20 16:03:41 2021 +0100 btrfs: avoid unnecessary log mutex contention when syncing log When syncing the log we acquire the root's log mutex just to update the root's last_log_commit. This is unnecessary because: 1) At this point there can only be one task updating this value, which is the task committing the current log transaction. Any task that enters btrfs_sync_log() has to wait for the previous log transaction to commit and wait for the current log transaction to commit if someone else already started it (in this case it never reaches to the point of updating last_log_commit, as that is done by the committing task); 2) All readers of the root's last_log_commit don't acquire the root's log mutex. This is to avoid blocking the readers, potentially for too long and because getting a stale value of last_log_commit does not cause any functional problem, in the worst case getting a stale value results in logging an inode unnecessarily. Plus it's actually very rare to get a stale value that results in unnecessarily logging the inode. So in order to avoid unnecessary contention on the root's log mutex, which is used for several different purposes, like starting/joining a log transaction and starting writeback of a log transaction, stop acquiring the log mutex for updating the root's last_log_commit. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit cceaa89f02f15f232391ae4be214137b0a0285c0 Author: Filipe Manana Date: Tue Jul 20 16:03:40 2021 +0100 btrfs: remove racy and unnecessary inode transaction update when using no-holes When using the NO_HOLES feature and expanding the size of an inode, we update the inode's last_trans, last_sub_trans and last_log_commit fields at maybe_insert_hole() so that a fsync does know that the inode needs to be logged (by making sure that btrfs_inode_in_log() returns false). This happens for expanding truncate operations, buffered writes, direct IO writes and when cloning extents to an offset greater than the inode's i_size. However the way we do it is racy, because in between setting the inode's last_sub_trans and last_log_commit fields, the log transaction ID that was assigned to last_sub_trans might be committed before we read the root's last_log_commit and assign that value to last_log_commit. If that happens it would make a future call to btrfs_inode_in_log() return true. This is a race that should be extremely unlikely to be hit in practice, and it is the same that was described by commit bc0939fcfab0d7 ("btrfs: fix race between marking inode needs to be logged and log syncing"). The fix would simply be to set last_log_commit to the value we assigned to last_sub_trans minus 1, like it was done in that commit. However updating these two fields plus the last_trans field is pointless here because all the callers of btrfs_cont_expand() (which is the only caller of maybe_insert_hole()) always call btrfs_set_inode_last_trans() or btrfs_update_inode() after calling btrfs_cont_expand(). Calling either btrfs_set_inode_last_trans() or btrfs_update_inode() guarantees that the next fsync will log the inode, as it makes btrfs_inode_in_log() return false. So just remove the code that explicitly sets the inode's last_trans, last_sub_trans and last_log_commit fields. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5a656c3628b241443fd07cda60f3b0587bb8c328 Author: Filipe Manana Date: Tue Jul 20 16:05:23 2021 +0100 btrfs: stop doing GFP_KERNEL memory allocations in the ref verify tool In commit 351cbf6e4410e7 ("btrfs: use nofs allocations for running delayed items") we wrapped all btree updates when running delayed items with memalloc_nofs_save() and memalloc_nofs_restore(), due to a lock inversion detected by lockdep involving reclaim and the mutex of delayed nodes. The problem is because the ref verify tool does some memory allocations with GFP_KERNEL, which can trigger reclaim and reclaim can trigger inode eviction, which requires locking the mutex of an inode's delayed node. On the other hand the ref verify tool is called when allocating metadata extents as part of operations that modify a btree, which is a problem when running delayed nodes, where we do btree updates while holding the mutex of a delayed node. This is what caused the lockdep warning. Instead of wrapping every btree update when running delayed nodes, change the ref verify tool to never do GFP_KERNEL allocations, because: 1) We get less repeated code, which at the moment does not even have a comment mentioning why we need to setup the NOFS context, which is a recommended good practice as mentioned at Documentation/core-api/gfp_mask-from-fs-io.rst 2) The ref verify tool is something meant only for debugging and not something that should be enabled on non-debug / non-development kernels; 3) We may have yet more places outside delayed-inode.c where we have similar problem: doing btree updates while holding some lock and then having the GFP_KERNEL memory allocations, from the ref verify tool, trigger reclaim and trying again to acquire the same lock through the reclaim path. Or we could get more such cases in the future, therefore this change prevents getting into similar cases when using the ref verify tool. Curiously most of the memory allocations done by the ref verify tool were already using GFP_NOFS, except a few ones for no apparent reason. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 506650dcb3a716ad98681f7091ba2f8e748c04b8 Author: Filipe Manana Date: Tue Jul 20 16:05:22 2021 +0100 btrfs: improve the batch insertion of delayed items When we insert the delayed items of an inode, which corresponds to the directory index keys for a directory (key type BTRFS_DIR_INDEX_KEY), we do the following: 1) Pick the first delayed item from the rbtree and insert it into the fs/subvolume btree, using btrfs_insert_empty_item() for that; 2) Without releasing the path returned by btrfs_insert_empty_item(), keep collecting as many consecutive delayed items from the rbtree as possible, as long as each one's BTRFS_DIR_INDEX_KEY key is the immediate successor of the previously picked item and as long as they fit in the available space of the leaf the path points to; 3) Then insert all the collected items into the leaf; 4) Release the reserve metadata space for each collected item and release each item (implies deleting from the rbtree); 5) Unlock the path. While this is much better than inserting items one by one, it can be improved in a few aspects: 1) Instead of adding items based on the remaining free space of the leaf, collect as many items that can fit in a leaf and bulk insert them. This results in less and larger batches, reducing the total amount of time to insert the delayed items. For example when adding 100K files to a directory, we ended up creating 1658 batches with very variable sizes ranging from 1 item to 118 items, on a filesystem with a node/leaf size of 16K. After this change, we end up with 839 batches, with the vast majority of them having exactly 120 items; 2) We do the search for more items to batch, by iterating the rbtree, while holding a write lock on the leaf; 3) While still holding the leaf locked, we are releasing the reserved metadata for each item and then deleting each item, keeping a write lock on the leaf for longer than necessary. Releasing the delayed items one by one can take a significant amount of time, because deleting them from the rbtree can often be a bit slow when the deletion results in rebalancing the rbtree. So change this so that we try to create larger batches, with a total item size up to the maximum a leaf can support, and by unlocking the leaf immediately after inserting the items, releasing the reserved metadata space of each item and releasing each item without holding the write lock on the leaf. The following script that runs fs_mark was used to test this change: $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-m single -d single" FILES=1000000 THREADS=16 FILE_SIZE=0 echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor umount $DEV &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT OPTS="-S 0 -L 5 -n $FILES -s $FILE_SIZE -t 16" for ((i = 1; i <= $THREADS; i++)); do OPTS="$OPTS -d $MNT/d$i" done fs_mark $OPTS umount $MNT It was run on machine with 12 cores, 64G of ram, using a NVMe device and using a non-debug kernel config (Debian's default config). Results before this change: FSUse% Count Size Files/sec App Overhead 1 16000000 0 76182.1 72223046 3 32000000 0 62746.9 80776528 5 48000000 0 77029.0 93022381 6 64000000 0 73691.6 95251075 8 80000000 0 66288.0 85089634 Results after this change: FSUse% Count Size Files/sec App Overhead 1 16000000 0 79049.5 (+3.7%) 69700824 3 32000000 0 65248.9 (+3.9%) 80583693 5 48000000 0 77991.4 (+1.2%) 90040908 6 64000000 0 75096.8 (+1.9%) 89862241 8 80000000 0 66926.8 (+1.0%) 84429169 Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 2b29726c473b3f7d1b8f22d138ed12b2776bb5d2 Author: Qu Wenruo Date: Mon Jul 19 13:43:04 2021 +0800 btrfs: rescue: allow ibadroots to skip bad extent tree when reading block group items When extent tree gets corrupted, normally it's not extent tree root, but one toasted tree leaf/node. In that case, rescue=ibadroots mount option won't help as it can only handle the extent tree root corruption. This patch will enhance the behavior by: - Allow fill_dummy_bgs() to ignore -EEXIST error This means we may have some block group items read from disk, but then hit some error halfway. - Fallback to fill_dummy_bgs() if any error gets hit in btrfs_read_block_groups() Of course, this still needs rescue=ibadroots mount option. With that, rescue=ibadroots can handle extent tree corruption more gracefully and allow a better recover chance. Reported-by: Zhenyu Wu Link: https://www.spinics.net/lists/linux-btrfs/msg114424.html Reviewed-by: Su Yue Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 6534c0c99dddafc47bd4152949751ccd6a5681fc Author: Marcos Paulo de Souza Date: Tue Jul 20 15:02:47 2021 -0300 btrfs: pass NULL as trans to btrfs_search_slot if we only want to search Using a transaction in btrfs_search_slot is only useful when we are searching to add or modify the tree. When the function is used for searching, insert length and mod arguments are 0, there is no need to use a transaction. No functional changes, changing for consistency. Reviewed-by: Nikolay Borisov Signed-off-by: Marcos Paulo de Souza Signed-off-by: David Sterba commit 069a2e37789a9adb236d8f7a5f65a1390b51f184 Author: Filipe Manana Date: Tue Jul 20 16:03:03 2021 +0100 btrfs: continue readahead of siblings even if target node is in memory At reada_for_search(), when attempting to readahead a node or leaf's siblings, we skip the readahead of the siblings if the node/leaf is already in memory. That is probably fine for the READA_FORWARD and READA_BACK readahead types, as they are used on contexts where we end up reading some consecutive leaves, but usually not the whole btree. However for a READA_FORWARD_ALWAYS mode, currently only used for full send operations, it does not make sense to skip the readahead if the target node or leaf is already loaded in memory, since we know the caller is visiting every node and leaf of the btree in ascending order. So change the behaviour to not skip the readahead when the target node is already in memory and the readahead mode is READA_FORWARD_ALWAYS. The following test script was used to measure the improvement on a box using an average, consumer grade, spinning disk, with 32GiB of RAM and using a non-debug kernel config (Debian's default config). $ cat test.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj MKFS_OPTIONS="--nodesize 16384" # default, just to be explicit MOUNT_OPTIONS="-o max_inline=2048" # default, just to be explicit mkfs.btrfs -f $MKFS_OPTIONS $DEV > /dev/null mount $MOUNT_OPTIONS $DEV $MNT # Create files with inline data to make it easier and faster to create # large btrees. add_files() { local total=$1 local start_offset=$2 local number_jobs=$3 local total_per_job=$(($total / $number_jobs)) echo "Creating $total new files using $number_jobs jobs" for ((n = 0; n < $number_jobs; n++)); do ( local start_num=$(($start_offset + $n * $total_per_job)) for ((i = 1; i <= $total_per_job; i++)); do local file_num=$((start_num + $i)) local file_path="$MNT/file_${file_num}" xfs_io -f -c "pwrite -S 0xab 0 2000" $file_path > /dev/null if [ $? -ne 0 ]; then echo "Failed creating file $file_path" break fi done ) & worker_pids[$n]=$! done wait ${worker_pids[@]} sync echo echo "btree node/leaf count: $(btrfs inspect-internal dump-tree -t 5 $DEV | egrep '^(node|leaf) ' | wc -l)" } file_count=2000000 add_files $file_count 0 4 echo echo "Creating snapshot..." btrfs subvolume snapshot -r $MNT $MNT/snap1 umount $MNT echo 3 > /proc/sys/vm/drop_caches blockdev --flushbufs $DEV &> /dev/null hdparm -F $DEV &> /dev/null mount $MOUNT_OPTIONS $DEV $MNT echo echo "Testing full send..." start=$(date +%s) btrfs send $MNT/snap1 > /dev/null end=$(date +%s) echo echo "Full send took $((end - start)) seconds" umount $MNT The duration of the full send operations, in seconds, were the following: Before this change: 85 seconds After this change: 76 seconds (-11.2%) Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5da384799278afe0d2557e4d4482240840c208b8 Author: David Sterba Date: Tue Jun 15 17:15:38 2021 +0200 btrfs: check-integrity: drop kmap/kunmap for block pages The pages in block_ctx have never been allocated from highmem (in btrfsic_read_block) so the mapping is pointless and can be removed. Signed-off-by: David Sterba commit 4c2bf276b56d8d27ddbafcdf056ef3fc60ae50b0 Author: David Sterba Date: Tue Jun 15 17:15:38 2021 +0200 btrfs: compression: drop kmap/kunmap from generic helpers The pages in compressed_pages are not from highmem anymore so we can drop the mapping for checksum calculation and inline extent. Signed-off-by: David Sterba commit bbaf9715f3f5b5ff0de71da91fcc34ee9c198ed8 Author: David Sterba Date: Tue Jun 15 01:00:05 2021 +0200 btrfs: compression: drop kmap/kunmap from zstd As we don't use highmem pages anymore, drop the kmap/kunmap. The kmap is simply page_address and kunmap is a no-op. Signed-off-by: David Sterba commit 696ab562e6df9fbafd6052d8ce4aafcb2ed16069 Author: David Sterba Date: Tue Jun 15 01:00:05 2021 +0200 btrfs: compression: drop kmap/kunmap from zlib As we don't use highmem pages anymore, drop the kmap/kunmap. The kmap is simply page_address and kunmap is a no-op. Signed-off-by: David Sterba commit 8c945d32e60427cbc0859cf7045bbe6196bb03d8 Author: David Sterba Date: Mon Jun 14 22:25:53 2021 +0200 btrfs: compression: drop kmap/kunmap from lzo As we don't use highmem pages anymore, drop the kmap/kunmap. The kmap is simply page_address and kunmap is a no-op. Signed-off-by: David Sterba commit b0ee5e1ec44afda53aaa37f8c41ad00d170506cb Author: David Sterba Date: Mon Jun 14 22:22:22 2021 +0200 btrfs: drop from __GFP_HIGHMEM all allocations The highmem flag is used for allocating pages for compression and for raid56 pages. The high memory makes sense on 32bit systems but is not without problems. On 64bit system's it's just another layer of wrappers. The time the pages are allocated for compression or raid56 is relatively short (about a transaction commit), so the pages are not blocked indefinitely. As the number of pages depends on the amount of data being written/read, there's a theoretical problem. A fast device on a 32bit system could use most of the low memory pool, while with the highmem allocation that would not happen. This was possibly the original idea long time ago, but nowadays we optimize for 64bit systems. This patch removes all usage of the __GFP_HIGHMEM flag for page allocation, the kmap/kunmap are still in place and will be removed in followup patches. Remaining is masking out the bit in alloc_extent_state and __lookup_free_space_inode, that can safely stay. Signed-off-by: David Sterba commit 23608d51a3b2a0e1e884eba7b1d1eadefe4aadcc Author: Anand Jain Date: Sun Jul 4 20:04:57 2021 +0800 btrfs: cleanup fs_devices pointer usage in btrfs_trim_fs Drop variable 'devices' (used only once) and add new variable for the fs_devices, so it is used at two locations within btrfs_trim_fs() function and also helps to access fs_devices->devices. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 67d5e289a193c643a70ceda437c625e2bc876dbc Author: Marcos Paulo de Souza Date: Tue Jul 6 15:13:25 2021 -0300 btrfs: remove max argument from generic_bin_search Both callers use btrfs_header_nritems to feed the max argument. Remove the argument and let generic_bin_search call it itself. Reviewed-by: Nikolay Borisov Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2eadb9e75e8e65eaf3e17628e24798a3c5374f90 Author: Nikolay Borisov Date: Mon Jul 5 12:29:19 2021 +0300 btrfs: make btrfs_finish_chunk_alloc private to block-group.c One of the final things that must be done to add a new chunk is inserting its device extent items in the device tree. They describe the portion of allocated device physical space during phase 1 of chunk allocation. This is currently done in btrfs_finish_chunk_alloc whose name isn't very informative. What's more, this function is only used in block-group.c but is defined as public. There isn't anything special about it that would warrant it being defined in volumes.c. Just move btrfs_finish_chunk_alloc and alloc_chunk_dev_extent to block-group.c, make the former static and rename both functions to insert_dev_extents and insert_dev_extent respectively. Reviewed-by: Filipe Manana Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit 4a9531cf89d29de82ef157513e593e58f49ef8f4 Author: Anand Jain Date: Mon Jul 5 17:06:18 2021 +0800 btrfs: check-integrity: drop unnecessary function prototypes The function prototypes below aren't necessary as the functions are first defined before called. Remove them. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit b3b7e1d0b4c2d80e7be8248305f6f47e46329e7e Author: David Sterba Date: Wed Jun 23 15:48:53 2021 +0200 btrfs: add special case to setget helpers for 64k pages On 64K pages the size of the extent_buffer::pages array is 1 and compilation with -Warray-bounds warns due to kaddr = page_address(eb->pages[idx + 1]); when reading byte range crossing page boundary. This does never actually overflow the array because on 64K because all the data fit in one page and bounds are checked by check_setget_bounds. To fix the reported overflows and warnings add a compile-time condition that will allow compiler to eliminate the dead code that reads from the idx + 1 page. Link: https://lore.kernel.org/lkml/20210623083901.1d49d19d@canb.auug.org.au/ CC: Gustavo A. R. Silva Signed-off-by: David Sterba commit 5a80d1c6a2704d880c1df30315a1d9b0dc1f2cd8 Author: Johannes Thumshirn Date: Tue Jun 29 03:36:45 2021 +0900 btrfs: zoned: remove max_zone_append_size logic There used to be a patch in the original series for zoned support which limited the extent size to max_zone_append_size, but this patch has been dropped somewhere around v9. We've decided to go the opposite direction, instead of limiting extents in the first place we split them before submission to comply with the device's limits. Remove the related code, btrfs_fs_info::max_zone_append_size and btrfs_zoned_device_info::max_zone_append_size. This also removes the workaround for dm-crypt introduced in 1d68128c107a ("btrfs: zoned: fail mount if the device does not support zone append") because the fix has been merged as f34ee1dce642 ("dm crypt: Fix zoned block device support"). Reviewed-by: Anand Jain Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 609c1308fbc6446fd6d8fec42b80e157768a5362 Author: Christophe JAILLET Date: Sun Aug 22 22:49:12 2021 +0200 hinic: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit a14e39041b20187f9f74b638fabc6f5ef5aef92d Author: Christophe JAILLET Date: Sun Aug 22 22:42:45 2021 +0200 qlcnic: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit eb9c5c0d3a739549164e4cf1d95f58ff4da20640 Author: Christophe JAILLET Date: Sun Aug 22 21:12:41 2021 +0200 net/mellanox: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit a0991bf441d52326387a005bec1b2a279590135e Author: Christophe JAILLET Date: Sun Aug 22 21:02:23 2021 +0200 net: 8139cp: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit bf7bec4620352c1931d3bd32112e6c677ae7af88 Author: Christophe JAILLET Date: Sun Aug 22 17:09:48 2021 +0200 vmxnet3: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. The explicit 'err = -EIO;' has been removed because 'dma_set_mask_and_coherent()' returns 0 or -EIO, so its return code can be used directly. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 75bacb6d204ed325504f3a656a829f2c6dce2035 Author: Christophe JAILLET Date: Sun Aug 22 16:23:57 2021 +0200 myri10ge: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. A message split on 2 lines has been merged. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit e6a70a02defd9200ed4b9fbf3714fa9622a93fa3 Merge: 056b29ae071bf 0dc62413c882d Author: David S. Miller Date: Mon Aug 23 11:59:49 2021 +0100 Merge tag 'wireless-drivers-next-2021-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.15 First set of patches for v5.15. This got delayed as I have been mostly offline for the last few weeks. The biggest change is removal of prism54 driver, otherwise just smaller changes. Major changes: ath5k, ath9k, ath10k, ath11k: * switch from 'pci_' to 'dma_' API brcmfmac * allow per-board firmware binaries * add support 43752 SDIO device prism54 * remove the obsoleted driver, everyone should be using p54 driver instead ==================== Signed-off-by: David S. Miller commit 056b29ae071bffc4ed6108a943f7d2929ab61ea1 Author: Christophe JAILLET Date: Sun Aug 22 10:42:21 2021 +0200 net: sunhme: Remove unused macros The usage of these macros has been removed in commit db1a8611c873 ("sunhme: Convert to pure OF driver."). So they can be removed. This simplifies code and helps for removing the wrappers in include/linux/pci-dma-compat.h. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 06e1359cc83bd389d6c903f8ea91762439797fde Author: Christophe JAILLET Date: Sun Aug 22 09:44:07 2021 +0200 qtnfmac: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit e5c88bc91bf64cb6925fc51303698108b96f9af3 Author: Christophe JAILLET Date: Sun Aug 22 08:59:56 2021 +0200 forcedeth: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Reviewed-by: Zhu Yanjun Signed-off-by: David S. Miller commit 83b2d939d1e48c8937593844c732f5d206fa906f Author: Christophe JAILLET Date: Sun Aug 22 08:48:40 2021 +0200 net: jme: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 05fbeb21afa0b8fbe9fd79cbdcecdf78b514b644 Author: Christophe JAILLET Date: Sun Aug 22 08:25:17 2021 +0200 net: ec_bhf: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. A useless "err = -EIO;" assignment has been removed. 'dma_set_mask_and_coherent()' already return only 0 or -EIO. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 4489d8f528d4e465f858e1a01997801130c5f322 Author: Christophe JAILLET Date: Sun Aug 22 08:14:03 2021 +0200 net: chelsio: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit df70303dd14623829a4acdec539c929accb92e0e Author: Christophe JAILLET Date: Sun Aug 22 07:59:44 2021 +0200 net: broadcom: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 3852e54e673699a47407774242cda344476b1b00 Author: Christophe JAILLET Date: Sun Aug 22 07:49:42 2021 +0200 net: atlantic: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. This is less verbose. A useless "!= 0" has also been removed in a test. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 44ee76581dec205dcc7b30b4349538706b2a81ea Author: Christophe JAILLET Date: Sat Aug 21 22:54:57 2021 +0200 net: wwan: iosm: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. 'ipc_protocol_init()' can use GFP_KERNEL, because this flag is already used by a 'kzalloc()' call a few lines above. 'ipc_protocol_msg_prepipe_open()' must use GFP_ATOMIC, because this flag is already used by a 'kcalloc()' call a few lines above. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 09f3824342f665d222fb7ac17c91f8334779630b Author: Peter Robinson Date: Sat Aug 21 10:45:28 2021 +0100 reset: simple: remove ZTE details in Kconfig help The ZTE platform support in the simple reset driver has been removed but the comment in the help wasn't removed so clean this up too. Fixes: 89d4f98ae90d ("ARM: remove zte zx platform") Signed-off-by: Peter Robinson Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210821094528.294579-1-pbrobinson@gmail.com Signed-off-by: Philipp Zabel commit b1165777fe0b44e9c4a482ae98ede158a82760e2 Author: Benjamin Poirier Date: Thu Aug 19 17:38:54 2021 +0900 doc: Document unexpected tcp_l3mdev_accept=1 behavior As suggested by David, document a somewhat unexpected behavior that results from net.ipv4.tcp_l3mdev_accept=1. This behavior was encountered while debugging FRR, a VRF-aware application, on a system which used net.ipv4.tcp_l3mdev_accept=1 and where TCP connections for BGP with MD5 keys were failing to establish. Cc: David Ahern Signed-off-by: Benjamin Poirier Reviewed-by: David Ahern Signed-off-by: David S. Miller commit f5e165e72b29d908214e554ef57f67790ba95934 Author: Vladimir Oltean Date: Thu Aug 19 20:55:00 2021 +0300 net: dsa: track unique bridge numbers across all DSA switch trees Right now, cross-tree bridging setups work somewhat by mistake. In the case of cross-tree bridging with sja1105, all switch instances need to agree upon a common VLAN ID for forwarding a packet that belongs to a certain bridging domain. With TX forwarding offload, the VLAN ID is the bridge VLAN for VLAN-aware bridging, and the tag_8021q TX forwarding offload VID (a VLAN which has non-zero VBID bits) for VLAN-unaware bridging. The VBID for VLAN-unaware bridging is derived from the dp->bridge_num value calculated by DSA independently for each switch tree. If ports from one tree join one bridge, and ports from another tree join another bridge, DSA will assign them the same bridge_num, even though the bridges are different. If cross-tree bridging is supported, this is an issue. Modify DSA to calculate the bridge_num globally across all switch trees. This has the implication for a driver that the dp->bridge_num value that DSA will assign to its ports might not be contiguous, if there are boards with multiple DSA drivers instantiated. Additionally, all bridge_num values eat up towards each switch's ds->num_fwd_offloading_bridges maximum, which is potentially unfortunate, and can be seen as a limitation introduced by this patch. However, that is the lesser evil for now. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f3cfd136aef0184919464b49d5b74d43605abcbc Author: Will Deacon Date: Mon Aug 16 14:26:17 2021 +0100 of: restricted dma: Don't fail device probe on rmem init failure If CONFIG_DMA_RESTRICTED_POOL=n then probing a device with a reference to a "restricted-dma-pool" will fail with a reasonably cryptic error: | pci-host-generic: probe of 10000.pci failed with error -22 Rework of_dma_set_restricted_buffer() so that it does not cause probing failure and instead either returns early if CONFIG_DMA_RESTRICTED_POOL=n or emits a diagnostic if the reserved DMA pool fails to initialise. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Cc: Christoph Hellwig Cc: Rob Herring Cc: Robin Murphy Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit ce5cb67c664fbc93d1af20b3fbd7a07eda9f6ee6 Author: Will Deacon Date: Mon Aug 16 14:26:16 2021 +0100 of: Move of_dma_set_restricted_buffer() into device.c Rob observes that: | of_dma_set_restricted_buffer() [...] should also be moved to | of/device.c. There's no reason for it to be in of/address.c. It has | nothing to do with address parsing. Move it to of/device.c, as he suggests. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Cc: Christoph Hellwig Cc: Robin Murphy Suggested-by: Rob Herring Link: https://lore.kernel.org/r/CAL_JsqJ7ROWWJX84x2kEex9NQ8G+2=ybRuNOobX+j8bjZzSemQ@mail.gmail.com Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 1a6ef20b415220c8611679dcb9c31586641217fc Author: David S. Miller Date: Mon Aug 23 11:15:53 2021 +0100 Revert "sfc: falcon: Read VPD with pci_vpd_alloc()" This reverts commit 3873a9a4d8a87d4a15ff0083cf3b173b190c9089. Signed-off-by: David S. Miller commit f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3 Author: Jeff Layton Date: Thu Aug 19 14:56:38 2021 -0400 fs: remove mandatory file locking support We added CONFIG_MANDATORY_FILE_LOCKING in 2015, and soon after turned it off in Fedora and RHEL8. Several other distros have followed suit. I've heard of one problem in all that time: Someone migrated from an older distro that supported "-o mand" to one that didn't, and the host had a fstab entry with "mand" in it which broke on reboot. They didn't actually _use_ mandatory locking so they just removed the mount option and moved on. This patch rips out mandatory locking support wholesale from the kernel, along with the Kconfig option and the Documentation file. It also changes the mount code to ignore the "mand" mount option instead of erroring out, and to throw a big, ugly warning. Signed-off-by: Jeff Layton commit a7eeb7a7dd9d718a36747ae0d7ab97e6e8000d3f Author: David S. Miller Date: Mon Aug 23 11:15:34 2021 +0100 Revert "sfc: falcon: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit 01dbe7129d9ccd5fe940897888645f06327b34ff. Signed-off-by: David S. Miller commit cd3d5d68819d224e588162404fcd70ab535b93ea Author: David S. Miller Date: Mon Aug 23 11:15:05 2021 +0100 Revert "cxgb4: Validate VPD checksum with pci_vpd_check_csum()" This reverts commit 96ce96f151261e33a170cecb8a4fa664b45743ab. Signed-off-by: David S. Miller commit fa5ca80db89e8ee288eaafb935df77acba3534ec Author: Mark Brown Date: Thu Aug 19 14:42:45 2021 +0100 kselftest/arm64: signal: Add a TODO list for signal handling tests Note down a few gaps in our coverage. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5262b216f4a97f4e2f517dba296a3cad4bc42bab Author: Mark Brown Date: Thu Aug 19 14:42:44 2021 +0100 kselftest/arm64: signal: Add test case for SVE register state in signals Currently this doesn't actually verify that the register contents do the right thing, it just verifes that a SVE context with appropriate size appears. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit d25ac50ce8f742e61fad6175cdbb172532ebfd10 Author: Mark Brown Date: Thu Aug 19 14:42:43 2021 +0100 kselftest/arm64: signal: Verify that signals can't change the SVE vector length We do not support changing the SVE vector length as part of signal return, verify that this is the case if the system supports multiple vector lengths. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit c1f67a19c12eefeb67e6dc98dd09253623a213d1 Author: Mark Brown Date: Thu Aug 19 14:42:42 2021 +0100 kselftest/arm64: signal: Check SVE signal frame shows expected vector length As a basic check that the SVE signal frame is being set up correctly verify that the vector length in the signal frame is the vector length that the process has. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit ace19b1845a5c2906d59f6358b80ed687b52b2cd Author: Mark Brown Date: Thu Aug 19 14:42:41 2021 +0100 kselftest/arm64: signal: Support signal frames with SVE register data A signal frame with SVE may validly either be a bare struct sve_context or a struct sve_context followed by vector length dependent register data. Support either in the generic helpers for the signal tests, and while we're at it validate the SVE vector length reported. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit d4e4dc4fab686c5f3f185272a19b83930664bef5 Author: Mark Brown Date: Thu Aug 19 14:42:40 2021 +0100 kselftest/arm64: signal: Add SVE to the set of features we can check for Allow testcases for SVE signal handling to flag the dependency and be skipped on systems without SVE support. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819134245.13935-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4fb2c383e006c8f1c53ced7b6e73f845f109790f Author: David S. Miller Date: Mon Aug 23 11:08:20 2021 +0100 Revert "bnx2x: Read VPD with pci_vpd_alloc()" This reverts commit bed3db3d734e8e55815d865913ef75d9f707db96. Signed-off-by: David S. Miller commit 82e34c8a9bdfa80b046a74f09f8f77c17e3e82c8 Author: David S. Miller Date: Mon Aug 23 11:07:17 2021 +0100 Revert "Revert "cxgb4: Search VPD with pci_vpd_find_ro_info_keyword()"" This reverts commit df6deaf6731519c6efd68ccd0638564e1afc4309. Signed-off-by: David S. Miller commit ad3ead1efe057029bf112e13d7ef5901915d6abd Author: Matti Vaittinen Date: Mon Aug 23 10:56:51 2021 +0300 regulator: Documentation fix for regulator error notification helper The helper to send IRQ notification for regulator errors had still old description mentioning calling BUG() as a last resort when error status reading has kept failing for more times than a given threshold. The impementation calling BUG() did never end-up in-tree but was replaced by hopefully more sophisticated handler trying to power-off the system. Fix the documentation to reflect actual behaviour. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20210823075651.GA3717293@localhost.localdomain Signed-off-by: Mark Brown commit 3408259b6ae5b01cd216633509f360def1d58dd5 Author: David S. Miller Date: Mon Aug 23 11:05:19 2021 +0100 Revert "bnx2: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit ddc122aac91f6f589ed7e202dbfca9f106d2a06f. Signed-off-by: David S. Miller commit 4fd1315706444aa3ab0f9e0ee2f7b86b6f0502c7 Author: David S. Miller Date: Mon Aug 23 11:04:23 2021 +0100 Revert "bnxt: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit 58a9b5d2621e725526a63847ae77b3a4c2c2bf93. Signed-off-by: David S. Miller commit 4a55c34e305077f5c8a6a2dbcffeccff01c388b5 Author: David S. Miller Date: Mon Aug 23 11:01:55 2021 +0100 Revert "bnx2x: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit da417885a99d36036cc7d2778f94b846e6582434. Signed-off-by: David S. Miller commit 197c316ce45048b96aca1901b230eb81b579ff03 Author: David S. Miller Date: Mon Aug 23 11:01:35 2021 +0100 Revert "bnxt: Read VPD with pci_vpd_alloc()" This reverts commit ebcdc8ebe8acbaef5d130350a8082e12ac7d4e61. Signed-off-by: David S. Miller commit 54c0bcc02857006f03e3dbc5c9f63d5c7629c303 Author: David S. Miller Date: Mon Aug 23 11:00:25 2021 +0100 Revert "bnxt: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit 58a9b5d2621e725526a63847ae77b3a4c2c2bf93. Signed-off-by: David S. Miller commit 88f94c7f8f40d7e26f991f6f6ed914ff44361d75 Author: Boqun Feng Date: Tue Jul 27 02:06:57 2021 +0800 PCI: hv: Turn on the host bridge probing on ARM64 Now we have everything we need, just provide a proper sysdata type for the bus to use on ARM64 and everything else works. Link: https://lore.kernel.org/r/20210726180657.142727-9-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi commit 9e7f9178ab4943b3a7294a12bc38925c515ca3f0 Author: Boqun Feng Date: Tue Jul 27 02:06:56 2021 +0800 PCI: hv: Set up MSI domain at bridge probing time Since PCI_HYPERV depends on PCI_MSI_IRQ_DOMAIN which selects GENERIC_MSI_IRQ_DOMAIN, we can use dev_set_msi_domain() to set up the MSI domain at probing time, and this works for both x86 and ARM64. Therefore use it as the preparation for ARM64 Hyper-V PCI support. As a result, no longer need to maintain ->fwnode in x86 specific pci_sysdata, and make hv_pcibus_device own it instead. Link: https://lore.kernel.org/r/20210726180657.142727-8-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi commit 38c0d266dc80b81f7f72314620f01ff6a1e119fe Author: Boqun Feng Date: Tue Jul 27 02:06:55 2021 +0800 PCI: hv: Set ->domain_nr of pci_host_bridge at probing time No functional change, just store and maintain the PCI domain number in the ->domain_nr of pci_host_bridge. Note that we still need to keep the copy of domain number in x86-specific pci_sysdata, because x86 is not a PCI_DOMAINS_GENERIC=y architecture, so the ->domain_nr of pci_host_bridge doesn't work for it yet. Link: https://lore.kernel.org/r/20210726180657.142727-7-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi commit 418cb6c8e051119125b886c879efdacb04df7165 Author: Arnd Bergmann Date: Tue Jul 27 02:06:54 2021 +0800 PCI: hv: Generify PCI probing In order to support ARM64 Hyper-V PCI, we need to set up the bridge at probing time because ARM64 is a PCI_DOMAIN_GENERIC=y arch and we don't have pci_config_window (ARM64 sysdata) for a PCI root bus on Hyper-V, so it's impossible to retrieve the information (e.g. PCI domains, MSI domains) from bus sysdata on ARM64 after creation. Originally in create_root_hv_pci_bus(), pci_create_root_bus() is used to create the root bus and the corresponding bridge based on x86 sysdata. Now we create a bridge first and then call pci_scan_root_bus_bridge(), which allows us to do the necessary set-ups for the bridge. Link: https://lore.kernel.org/r/20210726180657.142727-6-boqun.feng@gmail.com Signed-off-by: Arnd Bergmann Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi commit 7d40c0f70d92291605c4498b8ee4b3a3c3ba07b1 Author: Boqun Feng Date: Tue Jul 27 02:06:53 2021 +0800 arm64: PCI: Support root bridge preparation for Hyper-V Currently at root bridge preparation, the corresponding ACPI device will be set as the companion, however for a Hyper-V virtual PCI root bridge, there is no corresponding ACPI device, because a Hyper-V virtual PCI root bridge is discovered via VMBus rather than ACPI table. In order to support this, we need to make pcibios_root_bridge_prepare() work with cfg->parent being NULL. Use a NULL pointer as the ACPI device if there is no corresponding ACPI device, and this is fine because: 1) ACPI_COMPANION_SET() can work with the second parameter being NULL, 2) semantically, if a NULL pointer is set via ACPI_COMPANION_SET(), ACPI_COMPANION() (the read API for this field) will return NULL, and since ACPI_COMPANION() may return NULL, so users must have handled the cases where it returns NULL, and 3) since there is no corresponding ACPI device, it would be wrong to use any other value here. Link: https://lore.kernel.org/r/20210726180657.142727-5-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi Acked-by: Catalin Marinas commit b424d4d4263200459615c87ad8dddaf4bb571a9d Author: Boqun Feng Date: Tue Jul 27 02:06:52 2021 +0800 arm64: PCI: Restructure pcibios_root_bridge_prepare() Restructure the pcibios_root_bridge_prepare() as the preparation for supporting cases when no real ACPI device is related to the PCI host bridge. No functional change. Link: https://lore.kernel.org/r/20210726180657.142727-4-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi Acked-by: Catalin Marinas commit 41dd40fd717997085588442821f4463e05c758cf Author: Boqun Feng Date: Tue Jul 27 02:06:51 2021 +0800 PCI: Support populating MSI domains of root buses via bridges Currently, at probing time, the MSI domains of root buses are populated if either the information of MSI domain is available from firmware (DT or ACPI), or arch-specific sysdata is used to pass the fwnode of the MSI domain. These two conditions don't cover all, e.g. Hyper-V virtual PCI on ARM64, which doesn't have the MSI information in the firmware and couldn't use arch-specific sysdata because running on an architecture with PCI_DOMAINS_GENERIC=y. To support populating MSI domains of the root buses at the probing when neither of the above condition is true, the ->msi_domain of the corresponding bridge device is used: in pci_host_bridge_msi_domain(), which should return the MSI domain of the root bus, the ->msi_domain of the corresponding bridge is fetched first as a potential value of the MSI domain of the root bus. In order to use the approach to populate MSI domains, the driver needs to dev_set_msi_domain() on the bridge before calling pci_register_host_bridge(), and makes sure GENERIC_MSI_IRQ_DOMAIN=y. Another advantage of this new approach is providing an arch-independent way to populate MSI domains, which allows sharing the driver code as much as possible between architectures. Originally-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210726180657.142727-3-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas commit 15d82ca23c996d50062286d27ed6a42a8105c04a Author: Boqun Feng Date: Tue Jul 27 02:06:50 2021 +0800 PCI: Introduce domain_nr in pci_host_bridge Currently we retrieve the PCI domain number of the host bridge from the bus sysdata (or pci_config_window if PCI_DOMAINS_GENERIC=y). Actually we have the information at PCI host bridge probing time, and it makes sense that we store it into pci_host_bridge. One benefit of doing so is the requirement for supporting PCI on Hyper-V for ARM64, because the host bridge of Hyper-V doesn't have pci_config_window, whereas ARM64 is a PCI_DOMAINS_GENERIC=y arch, so we cannot retrieve the PCI domain number from pci_config_window on ARM64 Hyper-V guest. As the preparation for ARM64 Hyper-V PCI support, we introduce the domain_nr in pci_host_bridge and a sentinel value to allow drivers to set domain numbers properly at probing time. Currently CONFIG_PCI_DOMAINS_GENERIC=y archs are only users of this newly-introduced field. Link: https://lore.kernel.org/r/20210726180657.142727-2-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas commit df6deaf6731519c6efd68ccd0638564e1afc4309 Author: David S. Miller Date: Mon Aug 23 10:59:19 2021 +0100 Revert "cxgb4: Search VPD with pci_vpd_find_ro_info_keyword()" This reverts commit 8d63ee602da381c437c0a4ef7ea882b71d829eb6. Signed-off-by: David S. Miller commit cc47ad409ba9cc950e9c492c8ba653dabd392148 Author: Cédric Le Goater Date: Mon Aug 23 11:00:39 2021 +0200 powerpc/compat_sys: Declare syscalls This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210823090039.166120-3-clg@kaod.org commit 3accc0faef081b6813967b34f7d05a3edb855cbd Author: Cédric Le Goater Date: Mon Aug 23 11:00:38 2021 +0200 powerpc/prom: Fix unused variable ‘reserve_map’ when CONFIG_PPC32 is not set This fixes a compile error with W=1. arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’: arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable] __be64 *reserve_map; ^~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210823090039.166120-2-clg@kaod.org commit a00ea5b6f2bbef8b004b0b7228c61680a50c7c3f Author: Christophe Leroy Date: Mon Aug 23 06:45:20 2021 +0000 powerpc/syscalls: Remove __NR__exit __NR__exit is nowhere used. On most architectures it was removed by commit 135ab6ec8fda ("[PATCH] remove remaining errno and __KERNEL_SYSCALLS__ references") but not on powerpc. powerpc removed __KERNEL_SYSCALLS__ in commit 3db03b4afb3e ("[PATCH] rename the provided execve functions to kernel_execve"), but __NR__exit was left over. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6457eb4f327313323ed1f70e540bbb4ddc9178fa.1629701106.git.christophe.leroy@csgroup.eu commit 4a1672d183cc0bbf26292390ced0bbcb7e810ee1 Author: Takashi Iwai Date: Mon Aug 23 09:37:22 2021 +0200 ALSA: hda: Update documentation for aliasing via the model option The previous patch allowed user to specify the aliasing of SSID via model option for applying a quirk. Update the documentation accordingly. Link: https://lore.kernel.org/r/20210823073722.14873-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit a235d5b8e550fac7520410440bcc8003fb4cf8d0 Author: Takashi Iwai Date: Mon Aug 23 09:37:21 2021 +0200 ALSA: hda: Allow model option to specify PCI SSID alias There are tons of quirks for HD-audio and many of them are without model string, hence it's not trivial to apply the same quirk for a new device. This patch makes it easier: namely, the model string accepts a form as "XXXX:YYYY" (a pair of hex numbers of the subsystem-vendor and subsystem-device IDs), to specify the alias of PCI (or codec) SSID. e.g. passing model=1234:abcd would apply the quirk that matches with the given SSID 1234:abcd instead of the actual SSID. Link: https://lore.kernel.org/r/20210823073722.14873-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 73355ddd87758865fde6c97b96298ddcd44fdc3b Author: Takashi Iwai Date: Mon Aug 23 09:37:20 2021 +0200 ALSA: hda: Code refactoring snd_hda_pick_fixup() This contains a slight code refactoring of snd_hda_pick_fixup(): - Unify the ID setup - Unify the debug print message - Use snd_pci_quirk_lookup_id() for the codec SSID matching Mostly for simplifying the code flow but also it makes easier to add the codec alias handling in the upcoming patch. Link: https://lore.kernel.org/r/20210823073722.14873-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 23c671be97b9e49846d03ceb0bce3731f4b869ac Author: Takashi Sakamoto Date: Mon Aug 23 17:57:41 2021 +0900 ALSA: firewire-motu: add support for MOTU 896HD Mark of the Unicorn (MOTU) shipped 896HD 2003 as one of models in second generation of its FireWire series, and already discontinued it. The model consists of below ICs: * Texas Instruments TSB41AB2 * Phillips Semiconductors PDI1394L40 * Altera cyclone EP1C3 * Texas Instruments TMS320VC5402 It supports sampling transmission frequency up to 192.0 kHz. The packet format differs depending on both of sampling transfer frequency and enabling ADAT channels. The model doesn't support MIDI message transmission. This commit adds support for it. $ python3 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04101b66 bus_info_length 4, crc_length 16, crc 7014 404 31333934 bus_name "1394" 408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4) 40c 0001f200 company_id 0001f2 | 410 0001dbce device_id 000001dbce | EUI-64 0001f2000001dbce root directory ----------------------------------------------------------------- 414 0004c65c directory_length 4, crc 50780 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 8d000006 --> eui-64 leaf at 438 424 d1000001 --> unit directory at 428 unit directory at 428 ----------------------------------------------------------------- 428 0003dcc1 directory_length 3, crc 56513 42c 120001f2 specifier id 430 13000005 version 434 17102800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 000264f2 leaf_length 2, crc 25842 43c 0001f200 company_id 0001f2 | 440 0001dbce device_id 000001dbce | EUI-64 0001f2000001dbce Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210823085741.33864-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 6b430c7595e4eb95fae8fb54adc3c3ce002e75ae Author: Christophe JAILLET Date: Sat Aug 21 09:58:45 2021 +0200 mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' A successful 'init_rs_non_canonical()' call should be balanced by a corresponding 'free_rs()' call in the error handling path of the probe, as already done in the remove function. Update the error handling path accordingly. Fixes: 8c61b7a7f4d4 ("[MTD] [NAND] Use rslib for CAFÉ ECC") Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/fd313d3fb787458bcc73189e349f481133a2cdc9.1629532640.git.christophe.jaillet@wanadoo.fr commit 6e3b473ee06445d4eae2f8b1e143db70ed66f519 Merge: acdcfd94ef330 9d4f24bfe0432 Author: Marc Zyngier Date: Mon Aug 23 09:50:46 2021 +0100 Merge branch irq/qcom-pdc-nowake-cleanup into irq/irqchip-next * irq/qcom-pdc-nowake-cleanup: : Fix the QCOM PDC mishandling of the interrupt hierarchy by trimming : it when necessary. : Export irq_domain_disconnect_hierarchy as a consequence of it. irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy irqdomain: Export irq_domain_disconnect_hierarchy() Signed-off-by: Marc Zyngier commit 9d4f24bfe043274d9274bcfe223b901bd8fb7182 Author: Marc Zyngier Date: Mon Aug 23 13:34:40 2021 +0530 irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy The QCOM PDC driver creates a bunch of unnecessary levels in the interrupt hierarchy when dealing with non-wakeup-capable interrupts. By definition, these lines are terminated at the PDC level, and everything below this is completely fake. This also results in additional complexity as most of the callbacks have to check for the validity of the parent level. Needless to say, this doesn't look very good. Solve this by disconnecting the interrupt hierarchy below the last valid level, and considerably simplify the handling of all the other interrupts by avoiding now unnecessary cheks. In most cases, the standard irq_*_parent() handlers are directly used. This also cures an issue reporting by Maulik where gpio_to_irq() returns an error after having observed a set of invalid levels. Signed-off-by: Marc Zyngier Signed-off-by: Maulik Shah Tested-by: Maulik Shah Link: https://lore.kernel.org/r/1629705880-27877-3-git-send-email-mkshah@codeaurora.org commit 131d326ba969847daa43d708ac11c27978d78566 Author: Maulik Shah Date: Mon Aug 23 13:34:39 2021 +0530 irqdomain: Export irq_domain_disconnect_hierarchy() Export irq_domain_disconnect_hierarchy() so irqchip module drivers can use it. Signed-off-by: Maulik Shah Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1629705880-27877-2-git-send-email-mkshah@codeaurora.org commit 37cba6432d88d2d49ca863fb5982231f3a7775d5 Merge: 4c59714a41c17 9ce9a02039de7 Author: Bartosz Golaszewski Date: Mon Aug 23 10:04:05 2021 +0200 Merge branch 'ib-rockchip' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl into gpio/for-next commit ee28b42006c37aaeb68c83300fe5608db662082f Author: Christoph Hellwig Date: Mon Aug 23 09:33:59 2021 +0200 mtd_blkdevs: simplify the refcounting in blktrans_{open, release} Always grab a reference to the mtd_blktrans_dev in ->open instead of just on the first open, and do away with the additional temporary references in ->open and ->release. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-9-hch@lst.de commit 37b143d12b5f099bb4375162303ff1df1692cc5e Author: Christoph Hellwig Date: Mon Aug 23 09:33:58 2021 +0200 mtd_blkdevs: simplify blktrans_getgeo No need to grab a mtd_blktrans_dev given that ->open already holds one and ->getgeo can only be called on an open disk. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-8-hch@lst.de commit 560a3915e3df09125d7b20088a177b2872d2d680 Author: Christoph Hellwig Date: Mon Aug 23 09:33:57 2021 +0200 mtd_blkdevs: remove blktrans_ref_mutex blktrans_ref_mutex is not actually needed. The kref is serialized internally, and devnum assignment in add_mtd_blktrans_dev happens before the disk is added and thus any of the block_device_operations methods otherwise using it are called. It is also already serialized by the global mtd_table_mutex. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-7-hch@lst.de commit 89843828399ec825f8ec3e614634a428a951a2b3 Author: Christoph Hellwig Date: Mon Aug 23 09:33:56 2021 +0200 mtd_blkdevs: simplify blktrans_dev_get ->private_data is set before the disk is added and never cleared, so don't bother trying to handle a NULL pointer there. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-6-hch@lst.de commit a0faf5fdfb9967b33eda5eafcb55470180216af3 Author: Christoph Hellwig Date: Mon Aug 23 09:33:55 2021 +0200 mtd/rfd_ftl: don't cast away the type when calling add_mtd_blktrans_dev Pass the actual mtd_blktrans_dev instead of casting the containing structure to void *. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-5-hch@lst.de commit ffd18c97fcb6bf37bb749cfc53c5e698017cbc95 Author: Christoph Hellwig Date: Mon Aug 23 09:33:54 2021 +0200 mtd/ftl: don't cast away the type when calling add_mtd_blktrans_dev Pass the actual mtd_blktrans_dev instead of casting the containing structure to void *. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-4-hch@lst.de commit f214eebf8de4d2e412a35ff140687d88f056143a Author: Christoph Hellwig Date: Mon Aug 23 09:33:53 2021 +0200 mtd_blkdevs: use lockdep_assert_held Use lockdep_assert_held to ensure mtd_table_mutex is held instead of mutex_trylock games. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-3-hch@lst.de commit 799ae31c58ae766a4ce9b198658b286ecaf2c575 Author: Christoph Hellwig Date: Mon Aug 23 09:33:52 2021 +0200 mtd_blkdevs: don't hold del_mtd_blktrans_dev in blktrans_{open, release} There is nothing that this protects against except for slightly reducing the window when new opens can appear just before calling del_gendisk. Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Tested-by: Guenter Roeck Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-2-hch@lst.de commit 4c59714a41c170e7d7852c406dcae4d4a14fdd92 Author: Lukas Bulwahn Date: Tue Aug 17 10:01:18 2021 +0200 gpio: remove the obsolete MX35 3DS BOARD MC9S08DZ60 GPIO functions Commit e1324ece2af4 ("ARM: imx: Remove i.MX35 board files") removes the config MACH_MX35_3DS in arch/arm/mach-imx/Kconfig. Hence, since then, the MX35 3DS BOARD MC9S08DZ60 GPIO functions are dead code as its config GPIO_MC9S08DZ60 depends on the config MACH_MX35_3DS. Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs: MACH_MX35_3DS Referencing files: drivers/gpio/Kconfig Remove the obsolete MX35 3DS BOARD MC9S08DZ60 GPIO functions. Signed-off-by: Lukas Bulwahn Reviewed-by: Linus Walleij Reviewed-by: Fabio Estevam Signed-off-by: Bartosz Golaszewski commit e5e26d80840b69c1bcea4f5b0cb7ed4026a8f6a3 Author: Linus Walleij Date: Sat Aug 21 00:58:21 2021 +0200 gpio: max730x: Use the right include despite the placement of the header, is used by drivers/gpio/gpio-max730*. The include needs struct gpio_chip and needs to include not the legacy include. Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 3a29355a22c0275fe864100794fee58a73175d93 Author: Viresh Kumar Date: Thu Aug 19 10:00:22 2021 +0530 gpio: Add virtio-gpio driver This patch adds a new driver for Virtio based GPIO devices. This allows a guest VM running Linux to access GPIO lines provided by the host. It supports all basic operations, except interrupts for the GPIO lines. Based on the initial work posted by: "Enrico Weigelt, metux IT consult" . Reviewed-by: Linus Walleij Signed-off-by: Viresh Kumar Signed-off-by: Bartosz Golaszewski commit 0c59e612c0b6b94a0f1c5ccf7f4a4418dab77d97 Author: Randy Dunlap Date: Sun Aug 22 10:17:42 2021 -0700 platform/mellanox: mlxbf-pmc: fix kernel-doc notation Fix kernel-doc warnings reported by the kernel test robot: drivers/platform/mellanox/mlxbf-pmc.c:82: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Structure to hold attribute and block info for each sysfs entry drivers/platform/mellanox/mlxbf-pmc.c:94: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Structure to hold info for each HW block drivers/platform/mellanox/mlxbf-pmc.c:121: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Structure to hold PMC context info drivers/platform/mellanox/mlxbf-pmc.c:148: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Structure to hold supported events for each block Also fix typos in a few struct member names. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Hans de Goede Cc: Mark Gross Cc: Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org Link: https://lore.kernel.org/r/20210822171742.26921-1-rdunlap@infradead.org Signed-off-by: Hans de Goede commit 94274f20f6bf5eb0099bbf7e133aac1f5cd087e8 Author: Rob Herring Date: Tue Jul 20 08:41:21 2021 -0600 dt-bindings: opp: Convert to DT schema Convert the OPP v1 and v2 bindings to DT schema format. As the OPPv2 binding can be extended by vendors, we need to split the common part out from the "operating-points-v2" conforming compatible. Cc: Yangtao Li Cc: Nishanth Menon Cc: Stephen Boyd Cc: Maxime Ripard Cc: Chen-Yu Tsai Acked-by: Viresh Kumar Signed-off-by: Rob Herring Acked-by: Maxime Ripard Signed-off-by: Viresh Kumar commit 29fc76957a9754768cfa3884b413ffc10f82d3b4 Author: Rob Herring Date: Tue Jul 20 08:41:20 2021 -0600 dt-bindings: Clean-up OPP binding node names in examples In preparation to convert OPP bindings to DT schema, clean-up a few OPP binding node names in the binding examples. Cc: Georgi Djakov Cc: Shawn Guo Cc: Sascha Hauer Cc: Leonard Crestez Acked-by: Viresh Kumar Signed-off-by: Rob Herring Acked-by: Georgi Djakov Signed-off-by: Viresh Kumar commit d00aa8061e04da5c570a54283462e47fab01bd3c Author: Rob Herring Date: Tue Jul 20 08:41:19 2021 -0600 ARM: dts: omap: Drop references to opp.txt opp.txt is getting removed with the OPP binding converted to DT schema. As it is unusual to reference a binding doc from a dts file, let's just remove the reference. Cc: "Benoît Cousson" Cc: Tony Lindgren Signed-off-by: Rob Herring Signed-off-by: Viresh Kumar commit 13d9c6b998aaa76fd098133277a28a21f2cc2264 Author: Takashi Iwai Date: Fri Aug 20 16:32:14 2021 +0200 ALSA: hda/realtek: Workaround for conflicting SSID on ASUS ROG Strix G17 ASUS ROG Strix G17 has the very same PCI and codec SSID (1043:103f) as ASUS TX300, and unfortunately, the existing quirk for TX300 is broken on ASUS ROG. Actually the device works without the quirk, so we'll need to clear the quirk before applying for this device. Since ASUS ROG has a different codec (ALC294 - while TX300 has ALC282), this patch adds a workaround for the device, just clearing the codec->fixup_id by checking the codec vendor_id. It's a bit ugly to add such a workaround there, but it seems to be the simplest way. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214101 Cc: Link: https://lore.kernel.org/r/20210820143214.3654-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 152a810eae03f16e982444ffe3b0eca933a750cd Author: Iskren Chernev Date: Sat Aug 21 18:56:56 2021 +0300 phy: qcom-qmp: Add support for SM6115 UFS phy Add the tables and constants for init sequences for UFS QMP phy found in SM4250/6115 SoC. The phy is a variation of the v2 phy, but is mistakenly labeled as v3-660 in downstream sources. QSERDES COM, RX, TX registers match fully existing v2 registers, with a few additions. PCS registers don't have much in common, but there are no clashes with existing ones so new registers were added to existing v2 PCS pack. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210821155657.893165-3-iskren.chernev@gmail.com Signed-off-by: Vinod Koul commit 80f652c2661a4f1ed999c28294ebc43847d1b1e7 Author: Iskren Chernev Date: Sat Aug 21 18:56:55 2021 +0300 dt-bindings: phy: qcom,qmp: Add SM6115 UFS PHY bindings Add the compatible strings for the UFS PHY found on SM4250/6115 SoC. Signed-off-by: Iskren Chernev Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210821155657.893165-2-iskren.chernev@gmail.com Signed-off-by: Vinod Koul commit 6e7c1770a212239e88ec01ddc7a741505bfd10e5 Author: Christoph Hellwig Date: Wed Jul 14 16:23:21 2021 -0400 fs: simplify get_filesystem_list / get_all_fs_names Just output the '\0' separate list of supported file systems for block devices directly rather than going through a pointless round of string manipulation. Based on an earlier patch from Al Viro . Vivek: Modified list_bdev_fs_names() and split_fs_names() to return number of null terminted strings to caller. Callers now use that information to loop through all the strings instead of relying on one extra null char being present at the end. Signed-off-by: Christoph Hellwig Signed-off-by: Vivek Goyal Signed-off-by: Al Viro commit f9259be6a9e7c22d92e5a5000913147ae17e8321 Author: Christoph Hellwig Date: Wed Jul 14 16:23:20 2021 -0400 init: allow mounting arbitrary non-blockdevice filesystems as root Currently the only non-blockdevice filesystems that can be used as the initial root filesystem are NFS and CIFS, which use the magic "root=/dev/nfs" and "root=/dev/cifs" syntax that requires the root device file system details to come from filesystem specific kernel command line options. Add a little bit of new code that allows to just pass arbitrary string mount options to any non-blockdevice filesystems so that it can be mounted as the root file system. For example a virtiofs root file system can be mounted using the following syntax: "root=myfs rootfstype=virtiofs rw" Based on an earlier patch from Vivek Goyal . Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit e24d12b7442afa9d41331a951fca467449ff1488 Author: Christoph Hellwig Date: Wed Jul 14 16:23:19 2021 -0400 init: split get_fs_names Split get_fs_names into one function that splits up the command line argument, and one that gets the list of all registered file systems. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 03dca99e200f4d268f70079cf54e3b1200c9eb9d Author: Borislav Petkov Date: Fri Jun 25 17:10:16 2021 +0200 x86/tools/relocs: Mark die() with the printf function attr format Mark die() as a function which accepts printf-style arguments so that the compiler can typecheck them against the supplied format string. Use the C99 inttypes.h format specifiers as relocs.c gets built for both 32- and 64-bit. Original version of the patch by Greg Kroah-Hartman Signed-off-by: Borislav Petkov Reviewed-by: Greg Kroah-Hartman Link: http://lkml.kernel.org/r/YNnb6Q4QHtNYC049@zn.tnic commit db87db65c1059f3be04506d122f8ec9b2fa3b05e Author: Arnd Bergmann Date: Mon Aug 9 18:01:31 2021 +1000 m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch > Hi Arnd, > > First bad commit (maybe != root cause): > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 2f73937c9aa561e2082839bc1a8efaac75d6e244 > commit: 47fd22f2b84765a2f7e3f150282497b902624547 [4771/5318] cs89x0: rework driver configuration > config: m68k-randconfig-c003-20210804 (attached as .config) > compiler: m68k-linux-gcc (GCC) 10.3.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=47fd22f2b84765a2f7e3f150282497b902624547 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 47fd22f2b84765a2f7e3f150282497b902624547 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=m68k > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > > In file included from include/linux/kernel.h:19, > from include/linux/list.h:9, > from include/linux/module.h:12, > from drivers/net/ethernet/cirrus/cs89x0.c:51: > drivers/net/ethernet/cirrus/cs89x0.c: In function 'net_open': > drivers/net/ethernet/cirrus/cs89x0.c:897:20: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration] > 897 | (unsigned long)isa_virt_to_bus(lp->dma_buff)); > | ^~~~~~~~~~~~~~~ > include/linux/printk.h:141:17: note: in definition of macro 'no_printk' > 141 | printk(fmt, ##__VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/net/ethernet/cirrus/cs89x0.c:86:3: note: in expansion of macro 'pr_debug' > 86 | pr_##level(fmt, ##__VA_ARGS__); \ > | ^~~ > drivers/net/ethernet/cirrus/cs89x0.c:894:3: note: in expansion of macro 'cs89_dbg' > 894 | cs89_dbg(1, debug, "%s: dma %lx %lx\n", > | ^~~~~~~~ > >> drivers/net/ethernet/cirrus/cs89x0.c:914:3: error: implicit declaration of function 'disable_dma'; did you mean 'disable_irq'? [-Werror=implicit-function-declaration] As far as I can tell, this is a bug with the m68kmmu architecture, not with my driver: The CONFIG_ISA_DMA_API option is provided for coldfire, which implements it, but dragonball also sets the option as a side-effect, without actually implementing the interfaces. The patch below should fix it. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Ungerer commit f6a4f0b424df957d84fa7b9f2d02981234ff5828 Author: Dan Carpenter Date: Thu Jul 29 15:27:03 2021 +0300 m68k: coldfire: return success for clk_enable(NULL) The clk_enable is supposed work when CONFIG_HAVE_CLK is false, but it returns -EINVAL. That means some drivers fail during probe. [ 1.680000] flexcan: probe of flexcan.0 failed with error -22 Fixes: c1fb1bf64bb6 ("m68k: let clk_enable() return immediately if clk is NULL") Fixes: bea8bcb12da0 ("m68knommu: Add support for the Coldfire m5441x.") Signed-off-by: Dan Carpenter Acked-by: Marc Kleine-Budde Signed-off-by: Greg Ungerer commit 35a9f9363a89aa964c85b769c434a42b8b0f4b0d Author: Angelo Dureghello Date: Fri Jul 2 11:48:39 2021 +0200 m68k: m5441x: add flexcan support Add flexcan support. Signed-off-by: Angelo Dureghello Made the flexcan resource inclusion conditional based on the enablement of the flexcan driver. This commit is no longer dependant on the presence of the updated driver in mainline. Signed-off-by: Greg Ungerer commit 40cff49289d5eab6c1db7792ae043e5b04903dd6 Author: Angelo Dureghello Date: Fri Jul 2 11:48:38 2021 +0200 m68k: stmark2: update board setup Add configuration for flexcan pads. Signed-off-by: Angelo Dureghello Signed-off-by: Greg Ungerer commit cd3bf8cfd6ae94c1af5c657aee35b730976cd1d1 Author: Randy Dunlap Date: Wed Jul 7 09:37:29 2021 -0700 m68k/nommu: prevent setting ROMKERNEL when ROM is not set When CONFIG_ROMKERNEL is set but CONFIG_ROM is not set, the linker complains: m68k-linux-ld:./arch/m68k/kernel/vmlinux.lds:5: undefined symbol `CONFIG_ROMSTART' referenced in expression # CONFIG_ROM is not set # CONFIG_RAMKERNEL is not set CONFIG_ROMKERNEL=y Since ROMSTART depends on ROM, make ROMKERNEL also depend on ROM. Signed-off-by: Randy Dunlap Cc: Greg Ungerer Cc: linux-m68k@lists.linux-m68k.org Cc: uclinux-dev@uclinux.org Signed-off-by: Greg Ungerer commit 273691c3d28d18a9cf6bf3105da38484d90347b9 Author: Gal Pressman Date: Wed Aug 11 18:11:30 2021 +0300 RDMA/efa: Rename vector field in efa_irq struct to irqn The vector field naming is quite confusing, it is better referred to as irqn. Link: https://lore.kernel.org/r/20210811151131.39138-4-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 0043dbcfcbe27bff765cd684725daf1743353e3e Author: Gal Pressman Date: Wed Aug 11 18:11:29 2021 +0300 RDMA/efa: Remove unused cpu field from irq struct The cpu field in efa_irq struct is unused, remove it. Link: https://lore.kernel.org/r/20210811151131.39138-3-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit cbe2de395cd0dc6b673d70581e3611b84ae196a1 Author: Gioh Kim Date: Fri Aug 6 13:21:12 2021 +0200 RDMA/rtrs: Remove (void) casting for functions Casting to (void) does nothing, remove them. Link: https://lore.kernel.org/r/20210806112112.124313-7-haris.iqbal@ionos.com Suggested-by: Leon Romanovsky Signed-off-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jack Wang Signed-off-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 0d8f2cfa23f04ca01f6d4bba09933cb6310193aa Author: Gioh Kim Date: Fri Aug 6 13:21:11 2021 +0200 RDMA/rtrs-clt: Fix counting inflight IO There are mis-match at counting inflight IO after changing the multipath policy. For example, we started fio test with round-robin policy and then we changed the policy to min-inflight. IOs created under the RR policy is finished under the min-inflight policy and inflight counter only decreased. So the counter would be negative value. And also we started fio test with min-inflight policy and changed the policy to the round-robin. IOs created under the min-inflight policy increased the inflight IO counter but the inflight IO counter was not decreased because the policy was the round-robin when IO was finished. So it should count IOs only if the IO is created under the min-inflight policy. It should not care the policy when the IO is finished. This patch adds a field mp_policy in struct rtrs_clt_io_req and stores the multipath policy when an object of rtrs_clt_io_req is created. Then rtrs-clt checks the mp_policy of only struct rtrs_clt_io_req instead of the struct rtrs_clt. Link: https://lore.kernel.org/r/20210806112112.124313-6-haris.iqbal@ionos.com Signed-off-by: Gioh Kim Signed-off-by: Jack Wang Reviewed-by: Leon Romanovsky Signed-off-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 4693d6b767d6cab05fe1f650cea3ebc7e1060e4b Author: Gioh Kim Date: Fri Aug 6 13:21:10 2021 +0200 RDMA/rtrs: Remove all likely and unlikely The IO performance test with fio after swapping the likely and unlikely macros in all if-statement shows no difference. They do not help for the performance of rtrs. Thanks to Haakon Bugge for the test scenario. The fio test did random read on 32 rnbd devices and 64 processes. Test environment: - Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz - 376G memory - kernel version: 5.4.86 - gcc version: gcc (Debian 8.3.0-6) 8.3.0 - Infiniband controller: Mellanox Technologies MT27800 Family [ConnectX-5] Test result: - before swapping: IOPS=829k, BW=3239MiB/s - after swapping: IOPS=829k, BW=3238MiB/s - remove all (un)likely: IOPS=829k, BW=3238MiB/s Link: https://lore.kernel.org/r/20210806112112.124313-5-haris.iqbal@ionos.com Signed-off-by: Gioh Kim Signed-off-by: Jack Wang Reviewed-by: Leon Romanovsky Signed-off-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit d9b9f59ecfa705b44765239e3aa0cca12c218ca3 Author: Jack Wang Date: Fri Aug 6 13:21:08 2021 +0200 RDMA/rtrs: Remove unused functions The two functions are unused, so just remove them. Link: https://lore.kernel.org/r/20210806112112.124313-3-haris.iqbal@ionos.com Signed-off-by: Jack Wang Reviewed-by: Md Haris Iqbal Reviewed-by: Leon Romanovsky Signed-off-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit ac5e8814698c7ceb7188855117b589bc8dd1875e Author: Md Haris Iqbal Date: Fri Aug 6 13:21:07 2021 +0200 RDMA/rtrs-clt: During add_path change for_new_clt according to path_num When all the paths are removed for a session, the addition of the first path is like a new session for the storage server. Hence, for_new_clt has to be set to 1. Link: https://lore.kernel.org/r/20210806112112.124313-2-haris.iqbal@ionos.com Signed-off-by: Md Haris Iqbal Signed-off-by: Jack Wang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1a010d73ef63f3672af2f491321ee2ab6e307d0f Merge: bfeababd5141a 598fe77df855f Author: Jason Gunthorpe Date: Fri Aug 20 11:26:43 2021 -0300 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Saeed Mahameed says: ==================== This pulls mlx5-next branch which includes patches already reviewed on net-next and rdma mailing lists. 1) mlx5 single E-Switch FDB for lag 2) IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq 3) Add DCS caps & fields support We need this in net-next as multiple features are dependent on the single FDB feature. ==================== Signed-off-by: Jason Gunthorpe * mellanox/mlx5-next: net/mlx5: Lag, Create shared FDB when in switchdev mode net/mlx5: E-Switch, add logic to enable shared FDB net/mlx5: Lag, move lag destruction to a workqueue net/mlx5: Lag, properly lock eswitch if needed net/mlx5: Add send to vport rules on paired device net/mlx5: E-Switch, Add event callback for representors net/mlx5e: Use shared mappings for restoring from metadata net/mlx5e: Add an option to create a shared mapping net/mlx5: E-Switch, set flow source for send to uplink rule RDMA/mlx5: Add shared FDB support {net, RDMA}/mlx5: Extend send to vport rules RDMA/mlx5: Fill port info based on the relevant eswitch net/mlx5: Lag, add initial logic for shared FDB net/mlx5: Return mdev from eswitch IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq commit 8d63ee602da381c437c0a4ef7ea882b71d829eb6 Author: Heiner Kallweit Date: Sun Aug 22 15:59:21 2021 +0200 cxgb4: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3a93bedea050aa19208256c15c33ddf69c1373c4 Author: Heiner Kallweit Date: Sun Aug 22 15:58:26 2021 +0200 cxgb4: Remove unused vpd_param member ec Member ec isn't used, so remove it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 96ce96f151261e33a170cecb8a4fa664b45743ab Author: Heiner Kallweit Date: Sun Aug 22 15:57:27 2021 +0200 cxgb4: Validate VPD checksum with pci_vpd_check_csum() Validate the VPD checksum with pci_vpd_check_csum() to simplify the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 58a9b5d2621e725526a63847ae77b3a4c2c2bf93 Author: Heiner Kallweit Date: Sun Aug 22 15:56:24 2021 +0200 bnxt: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ebcdc8ebe8acbaef5d130350a8082e12ac7d4e61 Author: Heiner Kallweit Date: Sun Aug 22 15:55:23 2021 +0200 bnxt: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This simplifies the code, and we no longer have to make assumptions about VPD size. Signed-off-by: Heiner Kallweit Reported-by: kernel test robot Signed-off-by: David S. Miller commit da417885a99d36036cc7d2778f94b846e6582434 Author: Heiner Kallweit Date: Sun Aug 22 15:54:23 2021 +0200 bnx2x: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. str_id_reg and str_id_cap hold the same string and are used in the same comparison. This doesn't make sense, use one string str_id instead. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit bed3db3d734e8e55815d865913ef75d9f707db96 Author: Heiner Kallweit Date: Sun Aug 22 15:53:23 2021 +0200 bnx2x: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This simplifies the code, and we no longer have to make assumptions about VPD size. Signed-off-by: Heiner Kallweit Reported-by: kernel test robot Signed-off-by: David S. Miller commit 0df79c864636a209bf95ca93d986ca4cdd72bb89 Author: Heiner Kallweit Date: Sun Aug 22 15:52:01 2021 +0200 bnx2: Replace open-coded version with swab32s() Use swab32s() instead of open-coding it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ddc122aac91f6f589ed7e202dbfca9f106d2a06f Author: Heiner Kallweit Date: Sun Aug 22 15:50:50 2021 +0200 bnx2: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 01dbe7129d9ccd5fe940897888645f06327b34ff Author: Heiner Kallweit Date: Sun Aug 22 15:49:36 2021 +0200 sfc: falcon: Search VPD with pci_vpd_find_ro_info_keyword() This is the same as 37838aa437c7 "sfc: Search VPD with pci_vpd_find_ro_info_keyword()", just for the falcon chip version. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3873a9a4d8a87d4a15ff0083cf3b173b190c9089 Author: Heiner Kallweit Date: Sun Aug 22 15:48:33 2021 +0200 sfc: falcon: Read VPD with pci_vpd_alloc() This is the same as 5119e20facfa "sfc: Read VPD with pci_vpd_alloc()", just for the falcon chip version. Signed-off-by: Heiner Kallweit Reported-by: kernel test robot Signed-off-by: David S. Miller commit dddb6c2fdbbdc3ed8b44663fd056776b28bc5a99 Merge: 809159ee59dfd 43c1b83305fa7 Author: David S. Miller Date: Sun Aug 22 21:39:56 2021 +0100 Merge branch 'mlxsw-refactor-parser' Ido Schimmel says: ==================== mlxsw: Refactor parsing configuration The Spectrum ASIC has a configurable limit on how deep into the packet it parses. By default, the limit is 96 bytes. There are several cases where this parsing depth is not enough and there is a need to increase it: Decapsulation of VxLAN packets and timestamping of PTP packets. Currently, parsing depth API is maintained as part of VxLAN module, because the MPRS register which configures parsing depth also configures UDP destination port number used for VxLAN encapsulation and decapsulation. However, in addition to two above mentioned users of this API, the multipath hash code also needs to invoke it in order to correctly hash based on inner fields of IPv6-in-IPv6 packets. Upcoming support for IPv6-in-IPv6 tunneling will add another user, as without increasing the parsing depth such packets cannot be properly decapsulated. Therefore, this patchset refactors the parsing configuration API and moves it out of the VxLAN module to the main driver code. Tested using existing selftests. Patch set overview: Patch #1 adds the new parsing configuration infrastructure. Patch #2 converts existing users to the new infrastructure. Patch #3 deletes the old infrastructure. Patch #4 calls the new infrastructure from the multipath hash code. ==================== Signed-off-by: David S. Miller commit 43c1b83305fa7a6f1f66b37e98677958e4606c17 Author: Amit Cohen Date: Sun Aug 22 14:37:16 2021 +0300 mlxsw: spectrum_router: Increase parsing depth for multipath hash Commit 01848e05f8bb ("mlxsw: spectrum_router: Add support for inner layer 3 multipath hash policy") and commit daeabf89eb89 ("mlxsw: spectrum_router: Add support for custom multipath hash policy") added support for multipath hash policies where the hash is calculated based on inner packet fields. For IPv6-in-IPv6 packets, the default parsing depth (96 bytes) is not enough when these policies are used. Therefore, for such cases, call the new API to increase / decrease the parsing depth as necessary. Care is taken to ensure the API is not called multiple times. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c3d2ed93b14d5300530549f08ef5c6b87bbaa5bb Author: Amit Cohen Date: Sun Aug 22 14:37:15 2021 +0300 mlxsw: Remove old parsing depth infrastructure The previous patches added new API to handle parsing depth and converted the existing code to use it. Remove the old infrastructure which is not needed anymore. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0071e7cdc386fb41b1e81c2dd71ce59d3ef3d2fb Author: Amit Cohen Date: Sun Aug 22 14:37:14 2021 +0300 mlxsw: Convert existing consumers to use new API for parsing configuration Convert VxLAN and PTP modules to increase parsing depth using new API that was added in the previous patch. Separate MPRS register's configuration to VxLAN related configuration and parsing depth configuration. Handle each one using the appropriate API. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2d91f0803b84e006bc46de7fb67b8e562fb65355 Author: Amit Cohen Date: Sun Aug 22 14:37:13 2021 +0300 mlxsw: spectrum: Add infrastructure for parsing configuration Spectrum ASICs have a configurable limit on how deep into the packet they parse. By default, the limit is 96 bytes. There are several cases where this parsing depth is not enough and there is a need to increase it. Currently, increasing parsing depth is maintained as part of VxLAN module, because the MPRS register which configures parsing depth also configures UDP destination port number used for VxLAN encapsulation and decapsulation. Add an API for increasing parsing depth as part of spectrum.c code, so that it will be possible to use it from other modules. In addition, add an API for setting UDP destination port and protect it using a dedicated lock for saving parsing configurations. The lock is needed as not all the callers hold RTNL lock. Maintain a counter for increased parsing depth consumers. For first consumer subscription, increase the parsing depth and for last consumer unsubscription, set parsing depth to default value. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 809159ee59dfd532f794b02de619186c9c75e3f3 Merge: 5d1c5594b646d 623da5ca70b70 Author: David S. Miller Date: Sun Aug 22 21:38:16 2021 +0100 Merge branch 'octeontx2-misc-fixes' Sunil Goutham says: ==================== octeontx2: Miscellaneous fixes This patch series contains a bunch of miscellaneous fixes for various issues like - Free unallocated memory during driver unload - HW reading transmit descriptor from wrong address - VF VLAN strip offload MCAM entry installation failure - Pkts not being distributed across queues in RSS context - Wrong interface backpressure configuration for NIX1 block on 98xx - etc ==================== Signed-off-by: David S. Miller commit 623da5ca70b70f01cd483585f5cd4c463cf2f2da Author: Geetha sowjanya Date: Sun Aug 22 17:32:27 2021 +0530 octeontx2-af: cn10k: Use FLIT0 register instead of FLIT1 RVU SMMU widget stores the final translated PA at RVU_AF_SMMU_TLN_FLIT0<57:18> instead of FLIT1 register. This patch fixes the address translation logic to use the correct register. Fixes: 893ae97214c3 ("octeontx2-af: cn10k: Support configurable LMTST regions") Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit e7938365459f3a6d4edf212f435c4ad635621450 Author: Sunil Goutham Date: Sun Aug 22 17:32:26 2021 +0530 octeontx2-pf: Fix algorithm index in MCAM rules with RSS action Otherthan setting action as RSS in NPC MCAM entry, RSS flowkey algorithm index also needs to be set. Otherwise whatever algorithm is defined at flowkey index '0' will be considered by HW and pkt flows will be distributed as such. Fix this by saving the flowkey index sent by admin function while initializing RSS and then use it when framing MCAM rules. Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support") Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 05209e3570e452cdaa644e8398a8875b6a91051d Author: Sunil Goutham Date: Sun Aug 22 17:32:25 2021 +0530 octeontx2-pf: Don't install VLAN offload rule if netdev is down Whenever user changes interface MAC address both default DMAC based MCAM rule and VLAN offload (for strip) rules are updated with new MAC address. To update or install VLAN offload rule PF driver needs interface's receive channel info, which is retrieved from admin function at the time of NIXLF initialization. If user changes MAC address before interface is UP, VLAN offload rule installation will fail and throw error as receive channel is not valid. To avoid this, skip VLAN offload rule installation if netdev is not UP. This rule will anyway be reinslatted as part of open() call. Fixes: fd9d7859db6c ("octeontx2-pf: Implement ingress/egress VLAN offload") Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 07cccffdbdd37820ba13c645af8e74a78a266557 Author: Geetha sowjanya Date: Sun Aug 22 17:32:24 2021 +0530 octeontx2-af: Check capability flag while freeing ipolicer memory Bandwidth profiles (ipolicer structure)is implemented only on CN10K platform. But current code try to free the ipolicer memory without checking the capibility flag leading to driver crash on OCTEONTX2 platform. This patch fixes the issue by add capability flag check. Fixes: e8e095b3b3700 ("octeontx2-af: cn10k: Bandwidth profiles config support") Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 73d33dbc0723ac4d94e9e01fe53404b28ec6abab Author: Geetha sowjanya Date: Sun Aug 22 17:32:23 2021 +0530 octeontx2-af: Use DMA_ATTR_FORCE_CONTIGUOUS attribute in DMA alloc CN10K platform requires physically contiguous memory for LMTST operations which goes beyond a single page. Not having physically contiguous memory will result in HW fetching transmit descriptors from a wrong memory location. Hence use DMA_ATTR_FORCE_CONTIGUOUS attribute while allocating LMTST regions. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 10df5a13ac6785b409ad749c4b10d4b220cc7e71 Author: Naveen Mamindlapalli Date: Sun Aug 22 17:32:22 2021 +0530 octeontx2-pf: send correct vlan priority mask to npc_install_flow_req This patch corrects the erroneous vlan priority mask field that was send to npc_install_flow_req. Fixes: 1d4d9e42c240 ("octeontx2-pf: Add tc flower hardware offload on ingress traffic") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 50602408c8e202690ae6eff09a13cad41b835440 Author: Hariprasad Kelam Date: Sun Aug 22 17:32:21 2021 +0530 octeontx2-pf: Don't mask out supported link modes Supported link modes are updated by firmware in shared structure per interface. Kernel uses this value to display supported link modes via ethtool. Currently there is extra validation that firmware updated modes are validated against internal list of supported modes. As intenal list of supported modes are not updated frequently new modes supported by firmware are not updated to ethtool. Hence remove extra validation and report all firmware updated modes. Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit c0fa2cff8822c40a3f15b244485214f91e326f76 Author: Geetha sowjanya Date: Sun Aug 22 17:32:20 2021 +0530 octeontx2-af: Handle return value in block reset. Print debug message if any of the RVU hardware blocks reset fails. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 477b53f3f95ba5341b4320f8b7a92cedc5a67650 Author: Subbaraya Sundeep Date: Sun Aug 22 17:32:19 2021 +0530 octeontx2-af: cn10k: Fix SDP base channel number As per hardware the base channel number configured for programmable channels of a block must be multiple of number of channels of that block. This condition is not met for SDP base channel currently. Hence this patch ensures all the base channel numbers of all blocks are multiple of number of channels present in the blocks. Also instead of hardcoding SDP number of channels the same is read from the NIX_AF_CONST1 register. Fixes: 242da439214b ("octeontx2-af: cn10k: Add support for programmable") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit e8fb4df1f5d84bc08dd4f4827821a851d2eab241 Author: Subbaraya Sundeep Date: Sun Aug 22 17:32:18 2021 +0530 octeontx2-pf: Fix NIX1_RX interface backpressure 'bp_ena' in Aura context is NIX block index, setting it zero will always backpressure NIX0 block, even if NIXLF belongs to NIX1. Hence fix this by setting it appropriately based on NIX block address. Signed-off-by: Subbaraya Sundeep Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 5d1c5594b646db9310c1f9d557655d360735592f Author: Rafał Miłecki Date: Fri Aug 20 18:15:33 2021 +0200 dt-bindings: net: brcm,unimac-mdio: convert to the json-schema This helps validating DTS files. Introduced example binding changes: 1. Fixed reg formatting 2. Swapped #address-cells and #size-cells incorrect values 3. Renamed node: s/phy/ethernet-phy/ Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 9b60ac54ab7cf92af76240cdad549e8fde605eee Merge: 863434886497d 95ca38194c5aa Author: David S. Miller Date: Sun Aug 22 09:49:04 2021 +0100 Merge branch 'dsa-docs' Vladimir Oltean says: ==================== DSA documentation updates for v5.15 There were some documentation-visible changes made to DSA in the net-next tree for v5.15. There may be more, but these are the ones I am aware of. ==================== Signed-off-by: David S. Miller commit 95ca38194c5aa670e54be2c4511dfaea87849d67 Author: Vladimir Oltean Date: Sun Aug 22 02:04:41 2021 +0300 docs: net: dsa: document the new methods for bridge TX forwarding offload Two new methods have been introduced, add some verbiage about what they do. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 37f299d98989bbac2b819eb5be97e093b817bb01 Author: Vladimir Oltean Date: Sun Aug 22 02:04:40 2021 +0300 docs: net: dsa: remove references to struct dsa_device_ops::filter This function has disappeared in commit edac6f6332d9 ("Revert "net: dsa: Allow drivers to filter packets they can decode source port from""). Also, since commit 4e50025129ef ("net: dsa: generalize overhead for taggers that use both headers and trailers"), the next paragraph is no longer true (it is still discouraged to do that, but it is now supported, so no point in mentioning it). Delete. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5702d94bd9019aaed2993628aa48b3c0acc5971f Author: Vladimir Oltean Date: Sun Aug 22 02:04:39 2021 +0300 docs: net: dsa: sja1105: update list of limitations Remove the paragraphs that talk about the various modes of traffic support, bridging with foreign interfaces, etc etc. There is nothing that the user needs to know now, it should all work out of the box as expected. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 27dd613f10f2d58929f3a56cc229589278079f31 Author: Vladimir Oltean Date: Sun Aug 22 02:04:38 2021 +0300 docs: devlink: remove the references to sja1105 The sja1105 driver has removed its devlink params, so there is nothing to see here. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 863434886497dbccaf71d09f646cee09827983fa Merge: 4af14dbaeae00 2775cbc5afeb6 Author: David S. Miller Date: Sun Aug 22 09:44:17 2021 +0100 Merge branch 'ipa-autosuspend' Alex Elder says: ==================== net: ipa: enable automatic suspend At long last, the first patch in this series enables automatic suspend managed by the power management core. The remaining two just rename things to be "power" oriented rather than "clock" oriented. ==================== Signed-off-by: David S. Miller commit 2775cbc5afeb63f1ddd8c05df216763450772ad9 Author: Alex Elder Date: Fri Aug 20 11:01:29 2021 -0500 net: ipa: rename "ipa_clock.c" Finally, rename "ipa_clock.c" to be "ipa_power.c" and "ipa_clock.h" to be "ipa_power.h". Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 7aa0e8b8bd5b252c94900b19f2af8b7ec8a4e11d Author: Alex Elder Date: Fri Aug 20 11:01:28 2021 -0500 net: ipa: rename ipa_clock_* symbols Rename a number of functions to clarify that there is no longer a notion of an "IPA clock," but rather that the functions are more generally related to IPA power management. ipa_clock_enable() -> ipa_power_enable() ipa_clock_disable() -> ipa_power_disable() ipa_clock_rate() -> ipa_core_clock_rate() ipa_clock_init() -> ipa_power_init() ipa_clock_exit() -> ipa_power_exit() Rename the ipa_clock structure to be ipa_power. Rename all variables and fields using that structure type "power" rather than "clock". Rename the ipa_clock_data structure to be ipa_power_data, and more broadly, just substitute "power" for "clock" in places that previously represented things related to the "IPA clock". Update comments throughout. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 1aac309d32075e73d1f93208b38cd2d5f03e0a5c Author: Alex Elder Date: Fri Aug 20 11:01:27 2021 -0500 net: ipa: use autosuspend Use runtime power management autosuspend. Up until this point, we only suspended the IPA hardware for system suspend; now we'll suspend it aggressively using runtime power management, setting the initial autosuspend delay to half a second of inactivity. Replace pm_runtime_put() calls with pm_runtime_put_autosuspend(), call pm_runtime_mark_last_busy() before each of those. In places where we're shutting things down, or decrementing power references for errors, use pm_runtime_put_noidle() instead. Finally, remove ipa_runtime_idle(), so the ->runtime_suspend callback will occur if idle. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 41e73feb1024929e75eaf2f7cd93f35a3feb331b Author: Sam Shih Date: Tue Aug 17 15:45:55 2021 +0800 dt-bindings: watchdog: Add compatible for Mediatek MT7986 This commit adds dt-binding documentation of watchdog for Mediatek MT7986 SoC Platform. Signed-off-by: Sam Shih Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210726071439.14248-11-sam.shih@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 580b8e2899770cf4768f52e37a1c8bddc46f13e7 Author: Linus Walleij Date: Mon Jul 26 14:12:14 2021 +0200 watchdog: ixp4xx: Rewrite driver to use core This rewrites the IXP4xx watchdog driver as follows: - Spawn the watchdog driver as a platform device from the timer driver. It's one device in the hardware, and the fact that Linux splits the handling into two different devices is a Linux pecularity, and thus it becomes a Linux pecularity to spawn a separate watchdog driver. - Spawn the watchdog driver from the timer driver at probe(). This is well after the timer driver as actually registered and started and we know the register base is available. - Instead of looping back callbacks to the timer drivers for all watchdog calls, pass the register base to the watchdog driver and manage the registers there. The two drivers aren't even interested in the same register so the spinlock is totally surplus, delete it. - Replace pretty much all of the content in the watchdog driver with a simple, modern watchdog driver utilizing the watchdog core instead of registering its own misc device and ioctl() handling. - Drop module parameters as the same already exist in the watchdog core. What remains is a slim elegant (IMO) watchdog driver using the watchdog core, spawning from device tree or boardfile alike. Cc: Daniel Lezcano Cc: Thomas Gleixner Signed-off-by: Linus Walleij Reviewed-by: Guenter Roeck Acked-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210726121214.2572836-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit dbe80cf471f940db3063197b7adb1169f89be9ed Author: Jan Kiszka Date: Sun Aug 1 09:56:25 2021 +0200 watchdog: Start watchdog in watchdog_set_last_hw_keepalive only if appropriate We must not pet a running watchdog when handle_boot_enabled is off because this will kick off automatic triggering before userland is running, defeating the purpose of the handle_boot_enabled control. Furthermore, don't ping in case watchdog_set_last_hw_keepalive was called incorrectly when the hardware watchdog is actually not running. Fixed: cef9572e9af3 ("watchdog: add support for adjusting last known HW keepalive time") Signed-off-by: Jan Kiszka Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/93d56386-6e37-060b-55ce-84de8cde535f@web.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 585ba602b1ff76dd6e7fbd488a8c5921ae422305 Author: Linus Walleij Date: Wed Jul 14 17:33:14 2021 +0200 watchdog: max63xx_wdt: Add device tree probing This adds device tree probing to the MAX63xx driver so it can be instantiated from the device tree. We use the generic fwnode-based method to get to the match data and clean up by constifying the functions as the match is indeed a const. Cc: Marc Zyngier Signed-off-by: Linus Walleij Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210714153314.1004147-2-linus.walleij@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 11648fa1886606f42ca7b7d6eb1ab219de7071f2 Author: Linus Walleij Date: Wed Jul 14 17:33:13 2021 +0200 dt-bindings: watchdog: Add Maxim MAX63xx bindings This adds devicetree bindings for the Maxim MAX63xx watchdog timers. Cc: devicetree@vger.kernel.org Cc: Marc Zyngier Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210714153314.1004147-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8c6b5ea6ac6851b29ee808c413b93fea952cab62 Author: Christine Zhu Date: Fri Aug 6 10:36:06 2021 +0800 watchdog: mediatek: mt8195: add wdt support Support MT8195 watchdog device. Signed-off-by: Christine Zhu Reviewed-by: Guenter Roeck Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20210726122901.12195-4-Christine.Zhu@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 39c5b2f6f22595e0a0c207a1a8475cffb719f5bf Author: Christine Zhu Date: Fri Aug 6 10:36:05 2021 +0800 dt-bindings: reset: mt8195: add toprgu reset-controller header file Add toprgu reset-controller header file for MT8195 platform. Signed-off-by: Christine Zhu Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210726122901.12195-3-Christine.Zhu@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 625e407ce0e78c82ce19f32710d2996f9ea11449 Author: Rikard Falkeborn Date: Wed Jul 28 00:30:41 2021 +0200 watchdog: tqmx86: Constify static struct watchdog_ops The struct tqmx86_wdt_ops is only assigned to the ops pointer in the watchdog_device struct, which is a pointer to const struct watchdog_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210727223042.48150-3-rikard.falkeborn@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 47b45c4a69febd423ecb011fce22559158cd08d9 Author: Rikard Falkeborn Date: Wed Jul 28 00:30:42 2021 +0200 watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops The struct mpc8xxx_wdt_ops is only assigned to the ops pointer in the watchdog_device struct, which is a pointer to const struct watchdog_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210727223042.48150-4-rikard.falkeborn@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ade448c7e58e58b8fb86ebf31497b68b7c4f94d7 Author: Rikard Falkeborn Date: Wed Jul 28 00:30:40 2021 +0200 watchdog: sl28cpld_wdt: Constify static struct watchdog_ops The struct sl28cpld_wdt_ops is only assigned to the ops pointer in the watchdog_device struct, which is a pointer to const struct watchdog_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210727223042.48150-2-rikard.falkeborn@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit aec42642d91fc86ddc03e97f0139c6c34ee6b6b1 Author: Jan Kiszka Date: Mon Jul 26 13:46:13 2021 +0200 watchdog: iTCO_wdt: Fix detection of SMI-off case Obviously, the test needs to run against the register content, not its address. Fixes: cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") Cc: stable@vger.kernel.org Reported-by: Mantas Mikulėnas Signed-off-by: Jan Kiszka Reviewed-by: Paolo Bonzini Reviewed-by: Guenter Roeck Tested-by: Mantas Mikulėnas Link: https://lore.kernel.org/r/d84f8e06-f646-8b43-d063-fb11f4827044@siemens.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a4f95810e3fbc15f077880aef8c787489ec4a8b7 Author: Stefan Wahren Date: Sun Jun 6 14:16:12 2021 +0200 watchdog: bcm2835_wdt: consider system-power-controller property Until now all Raspberry Pi boards used the power off function of the SoC. But the Raspberry Pi 400 uses gpio-poweroff for the whole board which possibly cannot register the poweroff handler because the it's already registered by this watchdog driver. So consider the system-power-controller property for registering, which is already defined in soc/bcm/brcm,bcm2835-pm.txt . Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1622981777-5023-3-git-send-email-stefan.wahren@i2se.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 14244b7c04d6611388e9312059df11b9c39a4f6c Author: Grzegorz Jaszczyk Date: Fri Jun 18 21:50:33 2021 +0200 watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem is not aware of that and can still try to ping wdog through watchdog_ping_work. In order to prevent such condition and therefore prevent from system hang (caused by the wdog register access issued while the wdog clock is disabled) notify watchdog core that the ping worker should be canceled during watchdog core suspend and restored during resume. Signed-off-by: Michal Koziel Signed-off-by: Grzegorz Jaszczyk Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210618195033.3209598-3-grzegorz.jaszczyk@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 60bcd91aafd22ef62cef9ae2037fa2e1d4da2fb3 Author: Grzegorz Jaszczyk Date: Fri Jun 18 21:50:32 2021 +0200 watchdog: introduce watchdog_dev_suspend/resume The watchdog drivers often disable wdog clock during suspend and then enable it again during resume. Nevertheless the ping worker is still running and can issue low-level ping while the wdog clock is disabled causing the system hang. To prevent such condition register pm notifier in the watchdog core which will call watchdog_dev_suspend/resume and actually cancel ping worker during suspend and restore it back, if needed, during resume. Signed-off-by: Grzegorz Jaszczyk Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210618195033.3209598-2-grzegorz.jaszczyk@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c7b178dae139f8857edc50888cfbf251cd974a38 Author: Curtis Klein Date: Tue Jun 22 23:26:23 2021 -0700 watchdog: Fix NULL pointer dereference when releasing cdev watchdog_hrtimer_pretimeout_stop needs the watchdog device to have a valid pointer to the watchdog core data to stop the pretimeout hrtimer. Therefore it needs to be called before the pointers are cleared in watchdog_cdev_unregister. Fixes: 7b7d2fdc8c3e ("watchdog: Add hrtimer-based pretimeout feature") Reported-by: Colin Ian King Signed-off-by: Curtis Klein Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1624429583-5720-1-git-send-email-curtis.klein@hpe.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cf6ea9542372a966544d947c17c94048d4883325 Author: Curtis Klein Date: Sat Jun 26 16:47:45 2021 -0700 watchdog: only run driver set_pretimeout op if device supports it Some watchdog devices might conditionally support pretimeouts (e.g. if an interrupt is exposed for the device) but some watchdog drivers might still define the set_pretimeout operation (e.g. the mtk_wdt driver) and indicate support at runtime through the WDIOF_PRETIMEOUT flag. If the kernel is compiled with CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT enabled, watchdog_set_pretimeout would run the driver specific set_pretimeout even if WDIOF_PRETIMEOUT is not set which might have unintended consequences. So this change checks that the device flags and only runs the driver operation if pretimeouts are supported. Signed-off-by: Curtis Klein Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1624751265-24785-1-git-send-email-curtis.klein@hpe.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 52a5502507bca19644c4d23112130eea361e79f1 Author: Matti Vaittinen Date: Tue May 25 13:14:31 2021 +0300 watchdog: bd70528 drop bd70528 support The only known BD70528 use-cases are such that the PMIC is controlled from separate MCU which is not running Linux. I am not aware of any Linux driver users. Furthermore, it seems there is no demand for this IC. Let's ease the maintenance burden and drop the driver. We can always add it back if there is sudden need for it. Signed-off-by: Matti Vaittinen Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/994d2e374262c3f59f4465c03ef23d3116120778.1621937490.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 989ceac799cb28a477304cdc9ee72995191c6378 Author: Nick Desaulniers Date: Thu Aug 12 11:38:48 2021 -0700 x86/build: Remove stale cc-option checks cc-option, __cc-option, cc-option-yn, and cc-disable-warning all invoke the compiler during build time, and can slow down the build when these checks become stale for our supported compilers, whose minimally supported versions increases over time. See Documentation/process/changes.rst for the current supported minimal versions (GCC 4.9+, clang 10.0.1+). Compiler version support for these flags may be verified on godbolt.org. The following flags are supported by all supported versions of GCC and Clang. Remove their cc-option, __cc-option, and cc-option-yn tests. -Wno-address-of-packed-member -mno-avx -m32 -mno-80387 -march=k8 -march=nocona -march=core2 -march=atom -mtune=generic -mfentry [ mingo: Fixed regression on GCC, via partial revert of the stack-boundary changes. ] Signed-off-by: Nick Desaulniers Signed-off-by: Borislav Petkov Signed-off-by: Ingo Molnar Link: https://github.com/ClangBuiltLinux/linux/issues/1436 Link: https://lkml.kernel.org/r/20210812183848.1519994-1-ndesaulniers@google.com commit a8fc576d4af2f23a87a586424252df97f0ad0b06 Author: Kees Cook Date: Fri Jul 23 15:19:33 2021 -0700 lib/test_stackinit: Add assigned initializers Add whole-variable assignments of cast static initializers. These appear to currently behave like the direct initializers, but best to check them too. For example: struct test_big_hole var; var = (struct test_big_hole){ .one = arg->one, .two= arg->two, .three = arg->three, .four = arg->four }; Additionally adds a test for whole-object assignment, which is expected to fail since it usually falls back to a memcpy(): var = *arg; Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/CAK8P3a20SEoYCrp3jOK32oZc9OkiPv+1KTjNZ2GxLbHpY4WexQ@mail.gmail.com Cc: Ard Biesheuvel Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210723221933.3431999-4-keescook@chromium.org commit 1e2cd3084fff19e12bdf3c83ac1a8d64ef11aa63 Author: Kees Cook Date: Fri Jul 23 15:19:32 2021 -0700 lib/test_stackinit: Allow building stand-alone Especially now that GCC is developing the -ftrivial-auto-var-init option[1], it's helpful to have a stand-alone userspace test for stack variable initialization. Relicense to GPLv2+ (I am the only author), provide stand-alone kernel macro stubs, and update comments for clarity. [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575198.html Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210723221933.3431999-3-keescook@chromium.org commit 2f488f698fda820f8e6fa0407630154eceb145d6 Author: Desmond Cheong Zhi Xi Date: Fri Jul 2 17:18:31 2021 +0800 fcntl: fix potential deadlock for &fasync_struct.fa_lock There is an existing lock hierarchy of &dev->event_lock --> &fasync_struct.fa_lock --> &f->f_owner.lock from the following call chain: input_inject_event(): spin_lock_irqsave(&dev->event_lock,...); input_handle_event(): input_pass_values(): input_to_handler(): evdev_events(): evdev_pass_values(): spin_lock(&client->buffer_lock); __pass_event(): kill_fasync(): kill_fasync_rcu(): read_lock(&fa->fa_lock); send_sigio(): read_lock_irqsave(&fown->lock,...); &dev->event_lock is HARDIRQ-safe, so interrupts have to be disabled while grabbing &fasync_struct.fa_lock, otherwise we invert the lock hierarchy. However, since kill_fasync which calls kill_fasync_rcu is an exported symbol, it may not necessarily be called with interrupts disabled. As kill_fasync_rcu may be called with interrupts disabled (for example, in the call chain above), we replace calls to read_lock/read_unlock on &fasync_struct.fa_lock in kill_fasync_rcu with read_lock_irqsave/read_unlock_irqrestore. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Jeff Layton commit f671a691e299f58835d4660d642582bf0e8f6fda Author: Desmond Cheong Zhi Xi Date: Fri Jul 2 17:18:30 2021 +0800 fcntl: fix potential deadlocks for &fown_struct.lock Syzbot reports a potential deadlock in do_fcntl: ======================================================== WARNING: possible irq lock inversion dependency detected 5.12.0-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor132/8391 just changed the state of lock: ffff888015967bf8 (&f->f_owner.lock){.+..}-{2:2}, at: f_getown_ex fs/fcntl.c:211 [inline] ffff888015967bf8 (&f->f_owner.lock){.+..}-{2:2}, at: do_fcntl+0x8b4/0x1200 fs/fcntl.c:395 but this lock was taken by another, HARDIRQ-safe lock in the past: (&dev->event_lock){-...}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Chain exists of: &dev->event_lock --> &new->fa_lock --> &f->f_owner.lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&f->f_owner.lock); local_irq_disable(); lock(&dev->event_lock); lock(&new->fa_lock); lock(&dev->event_lock); *** DEADLOCK *** This happens because there is a lock hierarchy of &dev->event_lock --> &new->fa_lock --> &f->f_owner.lock from the following call chain: input_inject_event(): spin_lock_irqsave(&dev->event_lock,...); input_handle_event(): input_pass_values(): input_to_handler(): evdev_events(): evdev_pass_values(): spin_lock(&client->buffer_lock); __pass_event(): kill_fasync(): kill_fasync_rcu(): read_lock(&fa->fa_lock); send_sigio(): read_lock_irqsave(&fown->lock,...); However, since &dev->event_lock is HARDIRQ-safe, interrupts have to be disabled while grabbing &f->f_owner.lock, otherwise we invert the lock hierarchy. Hence, we replace calls to read_lock/read_unlock on &f->f_owner.lock, with read_lock_irq/read_unlock_irq. Reported-and-tested-by: syzbot+e6d5398a02c516ce5e70@syzkaller.appspotmail.com Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Jeff Layton commit 0dc62413c882d765db7a3ff4d507e8c0a804ba68 Author: Colin Ian King Date: Thu Aug 19 13:55:52 2021 +0100 brcmsmac: make array addr static const, makes object smaller Don't populate the array addr on the stack but instead it static const. Makes the object code smaller by 79 bytes: Before: text data bss dec hex filename 176015 54652 128 230795 3858b .../broadcom/brcm80211/brcmsmac/main.o After: text data bss dec hex filename 175872 54716 128 230716 3853c .../broadcom/brcm80211/brcmsmac/main.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210819125552.8888-1-colin.king@canonical.com commit d816ce8744db76bed755596a3ae7a49dec64f8c0 Author: Len Baker Date: Sat Jul 31 18:35:46 2021 +0200 rtw88: Remove unnecessary check code The rtw_pci_init_rx_ring function is only ever called with a fixed constant or RTK_MAX_RX_DESC_NUM for the "len" argument. Since this constant is defined as 512, the "if (len > TRX_BD_IDX_MASK)" check can never happen (TRX_BD_IDX_MASK is defined as GENMASK(11, 0) or in other words as 4095). So, remove this check. The true motivation for this patch is to silence a false Coverity warning. Reviewed-by: Brian Norris Signed-off-by: Len Baker Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210731163546.10753-1-len.baker@gmx.com commit 69c7044526d984df672b8d9b6d6998c34617cde4 Author: Chin-Yen Lee Date: Wed Jul 28 09:43:35 2021 +0800 rtw88: wow: fix size access error of probe request Current flow will lead to null ptr access because of trying to get the size of freed probe-request packets. We store the information of packet size into rsvd page instead and also fix the size error issue, which will cause unstable behavoir of sending probe request by wow firmware. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210728014335.8785-6-pkshih@realtek.com commit 4bac10f2de22ebe2d1ca47f8155a333ad669398a Author: Chin-Yen Lee Date: Wed Jul 28 09:43:34 2021 +0800 rtw88: wow: report wow reason through mac80211 api After waking up from WoWLAN, call ieee80211_report_wowlan_wakeup function call to report wakeup reason to userspace via nl80211. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210728014335.8785-5-pkshih@realtek.com commit 05e45887382c4c0f9522515759b34991aa17e69d Author: Ping-Ke Shih Date: Wed Jul 28 09:43:33 2021 +0800 rtw88: wow: build wow function only if CONFIG_PM is on The kernel test robot reports undefined reference after we report wakeup reason to mac80211. This is because CONFIG_PM is not defined in the testing configuration file. In fact, functions within wow.c are used if CONFIG_PM is defined, so use CONFIG_PM to decide whether we build this file or not. The reported messages are: hppa-linux-ld: drivers/net/wireless/realtek/rtw88/wow.o: in function `rtw_wow_show_wakeup_reason': >> (.text+0x6c4): undefined reference to `ieee80211_report_wowlan_wakeup' >> hppa-linux-ld: (.text+0x6e0): undefined reference to `ieee80211_report_wowlan_wakeup' Reported-by: kernel test robot Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210728014335.8785-4-pkshih@realtek.com commit 67368f14a8166b49dcfc6f60043d0d72fe8d17dc Author: Chin-Yen Lee Date: Wed Jul 28 09:43:32 2021 +0800 rtw88: refine the setting of rsvd pages for different firmware The original setting of rsvd pages is compilcated and lead to error for connecting to AP after resuming from pno mode. We refine the setting based on different firmware and the link state to avoid it. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210728014335.8785-3-pkshih@realtek.com commit 02a55c0009a55b204e1e5c17295431f0a9e7d3b6 Author: Chin-Yen Lee Date: Wed Jul 28 09:43:31 2021 +0800 rtw88: use read_poll_timeout instead of fixed sleep In current wow flow, driver calls rtw_wow_fw_start and sleep for 100ms, to wait firmware finish preliminary work and then update the value of WOWLAN_WAKE_REASON register to zero. But later firmware will start wow function with power-saving mode, in which mode the value of WOWLAN_WAKE_REASON register is 0xea. So driver may get 0xea value and return fail. We use read_poll_timeout instead to check the value to avoid this issue. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210728014335.8785-2-pkshih@realtek.com commit 8d52b46caf6846b549198c3fca7a1e3312322c12 Author: Chin-Yen Lee Date: Tue Jul 27 18:05:03 2021 +0800 rtw88: 8822ce: set CLKREQ# signal to low during suspend We find the power sequence of system suspend flow don't meet the criteria when using 8822CE-VR chip by rfe-type 6, because the reference clock form host is sometimes late. To avoid the behavoir, we keep CLKREQ# signal to low during suspend to make sure the reference clock arrival in time. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210727100503.31626-1-pkshih@realtek.com commit 0c283b47539ab11f9efb46800f2a9dd63a48d825 Author: Po-Hao Huang Date: Tue Jul 13 18:45:24 2021 +0800 rtw88: change beacon filter default mode Finetune parameter for firmware. Previous mode neglects environment impacts and could lead to performance downgrade in some cases. This new mode makes fw adapts better under noisy environment. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210713104524.47101-3-pkshih@realtek.com commit 81a68a1424bae4f2cb802691e1d3975fdf929b40 Author: Po-Hao Huang Date: Tue Jul 13 18:45:23 2021 +0800 rtw88: 8822c: add tx stbc support under HT mode Enabling this improves tx performance for long distance transmission. We used to enable stbc by the rx stbc cap of the associated station. But rx cap will be masked out in ieee80211_ht_cap_ie_to_sta_ht_cap if we do not declare tx stbc. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210713104524.47101-2-pkshih@realtek.com commit 584dce175f0461d5d9d63952a1e7955678c91086 Author: Chin-Yen Lee Date: Tue Jul 13 18:45:22 2021 +0800 rtw88: adjust the log level for failure of tx report We find that some disconnect events are related to failure of tx report, so increase log level to improve debuggability. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210713104524.47101-1-pkshih@realtek.com commit 95a581ab3592082c60a08090aabe09ac7d0bd650 Author: Chris Chiu Date: Wed Aug 4 23:13:25 2021 +0800 rtl8xxxu: Fix the handling of TX A-MPDU aggregation The TX A-MPDU aggregation is not handled in the driver since the ieee80211_start_tx_ba_session has never been started properly. Start and stop the TX BA session by tracking the TX aggregation status of each TID. Fix the ampdu_action and the tx descriptor accordingly with the given TID. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210804151325.86600-1-chris.chiu@canonical.com commit f62cdab7f5db4552067996f888d3874e2171c604 Author: Chris Chiu Date: Fri Jul 2 00:33:54 2021 +0800 rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu There will be crazy numbers of interrupts triggered by 8188cu and 8192cu module, around 8000~10000 interrupts per second, on the usb host controller. Compare with the vendor driver source code, it's mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is disabled by default. Since the interrupt transfer is neither used for TX/RX nor H2C commands. Disable it to avoid the excessive amount of interrupts for the 8188cu and 8192cu module which I only have for verification. Signed-off-by: Chris Chiu Tested-by: reto.schneider@husqvarnagroup.com Acked-by: Jes Sorensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210701163354.118403-1-chris.chiu@canonical.com commit da2c9cedc0d0047d3b93764e870969e74835149a Author: Colin Ian King Date: Thu Aug 19 13:16:51 2021 +0100 mwifiex: make arrays static const, makes object smaller Don't populate the arrays wpa_oui and wps_oui on the stack but instead them static const. Makes the object code smaller by 63 bytes: Before: text data bss dec hex filename 29453 5451 64 34968 8898 .../wireless/marvell/mwifiex/sta_ioctl.o After: text data bss dec hex filename 29356 5611 64 35031 88d7 ../wireless/marvell/mwifiex/sta_ioctl.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210819121651.7566-1-colin.king@canonical.com commit 090f2c5d3d077793da6a78db8d9535bc9a759857 Author: Gustavo A. R. Silva Date: Mon Aug 9 16:11:34 2021 -0500 mwifiex: usb: Replace one-element 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]. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). This issue was found with the help of Coccinelle and audited and fixed, manually. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210809211134.GA22488@embeddedor commit 118934041c5fec6c35bcf903a76783ea2fa302f0 Author: Tuo Li Date: Tue Aug 3 19:03:05 2021 -0700 mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw() There is no case in which the variable cmd_node->cmd_skb has no ->data, and thus the variable host_cmd is guaranteed to be not NULL. Therefore, the null-pointer check is redundant and can be dropped. Reported-by: TOTE Robot Signed-off-by: Tuo Li Tested-by: Brian Norris Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210804020305.29812-1-islituo@gmail.com commit 8f86342872e22910eaa319319d25302a847a3f87 Author: wengjianfeng Date: Mon Jul 5 10:37:31 2021 +0800 wilc1000: remove redundant code Some of the code is redundant, so goto statements are used to remove them Signed-off-by: wengjianfeng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210705023731.31496-1-samirweng1979@163.com commit 1d89fd1a39d1d88ab9cac8311222ecad19c197b6 Author: Claudiu Beznea Date: Fri Aug 6 11:12:29 2021 +0300 wilc1000: use devm_clk_get_optional() Use devm_clk_get_optional() for rtc clock: it simplifies a bit the code. Signed-off-by: Claudiu Beznea Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210806081229.721731-4-claudiu.beznea@microchip.com commit f36a0ee599c90899c7382b24f65457cb319afef6 Author: Claudiu Beznea Date: Fri Aug 6 11:12:28 2021 +0300 wilc1000: dispose irq on failure path Dispose IRQ on failure path. Signed-off-by: Claudiu Beznea Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210806081229.721731-3-claudiu.beznea@microchip.com commit dc8b338f3bcd9be35a24d14104a2a28144232633 Author: Claudiu Beznea Date: Fri Aug 6 11:12:27 2021 +0300 wilc1000: use goto labels on error path Use goto labels on error path for probe functions. This makes code easier to read. With this introduce also netdev_cleanup and call it where necessary. Signed-off-by: Claudiu Beznea Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210806081229.721731-2-claudiu.beznea@microchip.com commit b05897ca8c821a16ac03850c4704fe460b3f21a0 Author: Colin Ian King Date: Tue Aug 3 15:49:48 2021 +0100 rtlwifi: rtl8192de: make arrays static const, makes object smaller Don't populate arrays the stack but instead make them static const. Replace array channel_info with channel_all since it contains the same data as channel_all. Makes object code smaller by 961 bytes. Before: text data bss dec hex filename 128147 44250 1024 173421 2a56d ../realtek/rtlwifi/rtl8192de/phy.o After text data bss dec hex filename 127122 44314 1024 172460 2a1ac ../realtek/rtlwifi/rtl8192de/phy.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210803144949.79433-2-colin.king@canonical.com commit 369956ae5720ba1b415b37ba23cea5ede2942398 Author: Colin Ian King Date: Tue Aug 3 15:49:47 2021 +0100 rtlwifi: rtl8192de: Remove redundant variable initializations The variables rtstatus and place are being initialized with a values that are never read, the initializations are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210803144949.79433-1-colin.king@canonical.com commit 9adcdf6758d7c4c9bdaf22d78eb9fcae260ed113 Author: Dan Carpenter Date: Mon Aug 16 21:39:47 2021 +0300 rsi: fix an error code in rsi_probe() Return -ENODEV instead of success for unsupported devices. Fixes: 54fdb318c111 ("rsi: add new device model for 9116") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210816183947.GA2119@kili commit d0f8430332a16c7baa80ce2886339182c5d85f37 Author: Dan Carpenter Date: Thu Aug 5 13:37:46 2021 +0300 rsi: fix error code in rsi_load_9116_firmware() This code returns success if the kmemdup() fails, but obviously it should return -ENOMEM instead. Fixes: e5a1ecc97e5f ("rsi: add firmware loading for 9116 device") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210805103746.GA26417@kili commit 92276c592a6b5d7e3d99b8905429dd5c2bff4ec7 Author: Kees Cook Date: Thu Aug 19 13:28:25 2021 -0700 ray_cs: Split memcpy() to avoid bounds check warning In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Split memcpy() for each address range to help memcpy() correctly reason about the bounds checking. Avoids the future warning: In function 'fortify_memcpy_chk', inlined from 'memcpy_toio' at ./include/asm-generic/io.h:1204:2, inlined from 'ray_build_header.constprop' at drivers/net/wireless/ray_cs.c:984:3: ./include/linux/fortify-string.h:285:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 285 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210819202825.3545692-4-keescook@chromium.org commit d6b6d1bb80beabab43aa5f4289721e6659790f3a Author: Kees Cook Date: Thu Aug 19 13:28:23 2021 -0700 ipw2x00: Avoid field-overflowing memcpy() In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. libipw_read_qos_param_element() copies a struct libipw_info_element into a struct libipw_qos_information_element, but is actually wanting to copy into the larger struct libipw_qos_parameter_info (the contents of ac_params_record[] is later examined). Refactor the routine to perform centralized checks, and copy the entire contents directly (since the id and len members match the elementID and length members): struct libipw_info_element { u8 id; u8 len; u8 data[]; } __packed; struct libipw_qos_information_element { u8 elementID; u8 length; u8 qui[QOS_OUI_LEN]; u8 qui_type; u8 qui_subtype; u8 version; u8 ac_info; } __packed; struct libipw_qos_parameter_info { struct libipw_qos_information_element info_element; u8 reserved; struct libipw_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __packed; Cc: Stanislav Yakovlev Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210819202825.3545692-2-keescook@chromium.org commit 6f78f4a41ee0c348af73ed054ccff2d9c9c17cdb Author: Len Baker Date: Sat Jul 17 16:25:13 2021 +0200 ipw2x00: Use struct_size helper instead of open-coded arithmetic Dynamic size calculations (especially multiplication) should not be performed in memory allocator 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. To avoid this scenario, use the struct_size helper. Signed-off-by: Len Baker Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210717142513.5411-1-len.baker@gmx.com commit 502213fd8fca00fe7ebaf9a147c5038c91738cb5 Author: Andy Shevchenko Date: Mon Jul 12 17:29:43 2021 +0300 ray_cs: use %*ph to print small buffer Use %*ph format to print small buffer as hex string. Signed-off-by: Andy Shevchenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210712142943.23981-1-andriy.shevchenko@linux.intel.com commit d2587c57ffd8dcad04171dfd203dcc4ff98e4782 Author: Angus Ainslie Date: Thu Aug 12 09:52:17 2021 -0700 brcmfmac: add 43752 SDIO ids and initialization Add HW and SDIO ids for use with the SparkLan AP6275S Add the firmware mapping structures for the BRCM43752 chipset. The 43752 needs some things setup similar to the 43012 chipset. The WATERMARK shows better performance when initialized to the 4373 value. Signed-off-by: Angus Ainslie Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210812165218.2508258-2-angus@akkea.ca commit 41b637bac0b0a90424793aa1ec265b24c4c50fb1 Author: Sean Anderson Date: Mon Aug 2 13:09:04 2021 -0400 brcmfmac: Set SDIO workqueue as WQ_HIGHPRI This puts tasks submitted to the SDIO workqueue at the head of the queue and runs them immediately. This gets higher RX throughput with the SDIO bus. This was originally submitted as [1]. The original author Wright Feng reports > throughput result with 43455(11ac) on 1 core 1.6 Ghz platform is > Without WQ_HIGGPRI TX/RX: 293/301 (mbps) > With WQ_HIGHPRI TX/RX: 293/321 (mbps) I tested this with a 43364(11bgn) on a 1 core 800 MHz platform and got Without WQ_HIGHPRI TX/RX: 16/19 (Mbits/sec) With WQ_HIGHPRI TX/RX: 24/20 (MBits/sec) [1] https://lore.kernel.org/linux-wireless/1584604406-15452-4-git-send-email-wright.feng@cypress.com/ Signed-off-by: Sean Anderson Reviewed-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210802170904.3116223-1-sean.anderson@seco.com commit f8d6523891cf07468f0bfe21aba8b562a6f75780 Author: Mikhail Rudenko Date: Thu Aug 5 02:13:08 2021 +0300 brcmfmac: use separate firmware for 43430 revision 2 A separate firmware is needed for Broadcom 43430 revision 2. This chip can be found in e.g. certain revisions of Ampak AP6212 wireless IC. Original firmware file from IC vendor is named 'fw_bcm43436b0.bin', but brcmfmac and also btbcm drivers report chip id 43430, so requested firmware file name is 'brcmfmac43430b0-sdio.bin' in line with other 43430 revisions. Reviewed-by: Arend van Spriel Signed-off-by: Mikhail Rudenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210804231308.576071-1-mike.rudenko@gmail.com commit c626f3864bbbb28bbe06476b0b497c1330aa4463 Author: Nathan Chancellor Date: Tue Jul 27 16:36:56 2021 -0700 drm/exynos: Always initialize mapping in exynos_drm_register_dma() In certain randconfigs, clang warns: drivers/gpu/drm/exynos/exynos_drm_dma.c:121:19: warning: variable 'mapping' is uninitialized when used here [-Wuninitialized] priv->mapping = mapping; ^~~~~~~ drivers/gpu/drm/exynos/exynos_drm_dma.c:111:16: note: initialize the variable 'mapping' to silence this warning void *mapping; ^ = NULL 1 warning generated. This occurs when CONFIG_EXYNOS_IOMMU is enabled and both CONFIG_ARM_DMA_USE_IOMMU and CONFIG_IOMMU_DMA are disabled, which makes the code look like void *mapping; if (0) mapping = arm_iommu_create_mapping() else if (0) mapping = iommu_get_domain_for_dev() ... priv->mapping = mapping; Add an else branch that initializes mapping to the -ENODEV error pointer so that there is no more warning and the driver does not change during runtime. Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Inki Dae commit 8c27cc5b90ed00ed0dc5956b99e455a494ac8970 Author: Xiyu Yang Date: Mon Jul 19 13:58:51 2021 +0800 drm/exynos: Convert from atomic_t to refcount_t on g2d_cmdlist_userptr->refcount refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Inki Dae commit b74a29fac6de62f39b594e8f545b3a26db7edb5e Author: Wei Yongjun Date: Tue Jun 15 17:21:53 2021 +0000 drm/exynos: g2d: fix missing unlock on error in g2d_runqueue_worker() Add the missing unlock before return from function g2d_runqueue_worker() in the error handling case. Fixes: 445d3bed75de ("drm/exynos: use pm_runtime_resume_and_get()") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Inki Dae commit 1ce050c159528ee74e31498411dfed8e0935d10c Author: Arend van Spriel Date: Wed Jul 28 22:50:34 2021 +0200 brcmfmac: support chipsets with different core enumeration space Historically the broadcom wifi chipsets always had enumeration space containing all core information at same place. However, for new chipsets the ASIC developers moved away from that given fact. So we have to accommodate that it can differ per chipset. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1627505434-9544-5-git-send-email-arend.vanspriel@broadcom.com commit a7dd0ac94544dd2465b01a0eeb1786f362477c65 Author: Arend van Spriel Date: Wed Jul 28 22:50:33 2021 +0200 brcmfmac: add xtlv support to firmware interface layer Newer firmware API require commands to use xtlv format. Add support for that in the firmware interface layer. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1627505434-9544-4-git-send-email-arend.vanspriel@broadcom.com commit 8e73facb9b80deba5ab8402e49892051230f6da3 Author: Arend van Spriel Date: Wed Jul 28 22:50:32 2021 +0200 brcmfmac: increase core revision column aligning core list Some cores are getting a revision greater that 99 thus messing up the column alignment in the list of cores. So adding a digit for the core revision. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1627505434-9544-3-git-send-email-arend.vanspriel@broadcom.com commit 2c4fa29eceb3167470a1d391c94ad2f0b87b2af2 Author: Arend van Spriel Date: Wed Jul 28 22:50:31 2021 +0200 brcmfmac: use different error value for invalid ram base address The function brcmf_chip_tcm_rambase() returns 0 as invalid ram base address. However, upcoming chips have ram base address starting at zero so we have to find a more appropriate invalid value to return. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1627505434-9544-2-git-send-email-arend.vanspriel@broadcom.com commit 7de875b231edb807387a81cde288aa9e1015ef9e Author: J. Bruce Fields Date: Fri Aug 20 17:01:59 2021 -0400 lockd: lockd server-side shouldn't set fl_ops Locks have two sets of op arrays, fl_lmops for the lock manager (lockd or nfsd), fl_ops for the filesystem. The server-side lockd code has been setting its own fl_ops, which leads to confusion (and crashes) in the reexport case, where the filesystem expects to be the only one setting fl_ops. And there's no reason for it that I can see-the lm_get/put_owner ops do the same job. Reported-by: Daire Byrne Tested-by: Daire Byrne Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit c2dac3d2d3f1135c7a9b90cb014a32ff739edf44 Author: Linus Walleij Date: Sun Aug 8 21:05:10 2021 +0300 brcmfmac: firmware: Fix firmware loading The patch that would first try the board-specific firmware had a bug because the fallback would not be called: the asynchronous interface is used meaning request_firmware_nowait() returns 0 immediately. Harden the firmware loading like this: - If we cannot build an alt_path (like if no board_type is specified) just request the first firmware without any suffix, like in the past. - If the lookup of a board specific firmware fails, we get a NULL fw in the async callback, so just try again without the alt_path from a dedicated brcm_fw_request_done_alt_path callback. - Drop the unnecessary prototype of brcm_fw_request_done. - Added MODULE_FIRMWARE match for per-board SDIO bins, making userspace tools to pull all the relevant firmware files. Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries") Cc: Stefan Hansson Signed-off-by: Linus Walleij Signed-off-by: Dmitry Osipenko Reviewed-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210808180510.8753-1-digetx@gmail.com commit 0bffa153a2f46dcbced4a48167e91522d8aabe58 Merge: e7a10ed7d7341 e70e392fa768d Author: Steve French Date: Sat Aug 21 10:10:03 2021 -0500 Merge pull request #68 from namjaejeon/cifsd-for-next ksmbd-fixes commit e70e392fa768d46ca59f2f8c0e7374099c980622 Author: Namjae Jeon Date: Sat Aug 21 23:26:01 2021 +0900 ksmbd: fix permission check issue on chown and chmod When commanding chmod and chown on cifs&ksmbd, ksmbd allows it without file permissions check. There is code to check it in settattr_prepare. Instead of setting the inode directly, update the mode and uid/gid through notify_change. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 297e1dcdca3d7f268ccfb175d0a3534bb9481303 Author: Steven Rostedt (VMware) Date: Fri Aug 20 16:46:50 2021 -0400 selftests/ftrace: Add selftest for testing duplicate eprobes and kprobes Add a selftest that makes sure that eprobes and kprobes can not be created with the same group and name as existing events. Link: https://lore.kernel.org/linux-kselftest/20210819152825.715290342@goodmis.org/ Link: https://lkml.kernel.org/r/20210820204742.653288346@goodmis.org Cc: "Tzvetomir Stoyanov" Cc: Tom Zanussi Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 8f022d3a769c5460c325d3444cf5f0c948d5bb52 Author: Steven Rostedt (VMware) Date: Fri Aug 20 16:46:49 2021 -0400 selftests/ftrace: Add selftest for testing eprobe events on synthetic events Add a test to test event probes, by creating a synthetic event across sys_enter_openat and sys_exit_openat that passes the filename pointer from the enter of the system call to the exit, and then add an event probe to the synthetic event to make sure that the file name is seen. Link: https://lore.kernel.org/linux-kselftest/20210819152825.526931866@goodmis.org/ Link: https://lkml.kernel.org/r/20210820204742.463259900@goodmis.org Cc: "Tzvetomir Stoyanov" Cc: Tom Zanussi Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 079db70794ec5494a9e1091a1788e671d30b9103 Author: Steven Rostedt (VMware) Date: Fri Aug 20 16:46:48 2021 -0400 selftests/ftrace: Add test case to test adding and removing of event probe Add a test case that adds an event probe, makes sure that it works, and then removes it. Link: https://lore.kernel.org/linux-kselftest/20210819152825.526931866@goodmis.org/ Link: https://lkml.kernel.org/r/20210820204742.274591200@goodmis.org Cc: "Tzvetomir Stoyanov" Cc: Tom Zanussi Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 210f9df02611cbe641ced3239122b270fd907d86 Author: Steven Rostedt (VMware) Date: Fri Aug 20 16:46:47 2021 -0400 selftests/ftrace: Fix requirement check of README file The selftest for ftrace checks some features by checking if the README has text that states the feature is supported by that kernel. Unfortunately, this check gives false positives because it many not be checked if there's spaces in the string to check. This is due to the compare between the required variable with the ":README" string stripped, because neither has quotes around them. Link: https://lkml.kernel.org/r/20210820204742.087177341@goodmis.org Cc: "Tzvetomir Stoyanov" Cc: Tom Zanussi Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 1b8eec510ba64 ("selftests/ftrace: Support ":README" suffix for requires") Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 817f9916a6e96ae43acdd4e75459ef4f92d96eb1 Author: Andy Shevchenko Date: Fri Aug 13 18:36:19 2021 +0300 PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n The CONFIG_PCI=y case got a new parameter long time ago. Sync the stub as well. [bhelgaas: add parameter names] Fixes: 725522b5453d ("PCI: add the sysfs driver name to all modules") Link: https://lore.kernel.org/r/20210813153619.89574-1-andriy.shevchenko@linux.intel.com Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas commit eba54cbb92d28b4f6dc1ed5f73f5187b09d82c08 Author: Vladimir Oltean Date: Thu Aug 19 20:04:16 2021 +0300 MIPS: mscc: ocelot: mark the phy-mode for internal PHY ports The ocelot driver was converted to phylink, and that expects a valid phy_interface_t. Without a phy-mode, of_get_phy_mode returns PHY_INTERFACE_MODE_NA, which is not ideal because phylink rejects that. The ocelot driver was patched to treat PHY_INTERFACE_MODE_NA as PHY_INTERFACE_MODE_INTERNAL to work with the broken DT blobs, but we should fix the device trees and specify the phy-mode too. Signed-off-by: Vladimir Oltean Signed-off-by: Thomas Bogendoerfer commit 0181f6f19c6c35b24f1516d8db22f3bbce762633 Author: Vladimir Oltean Date: Thu Aug 19 20:04:15 2021 +0300 MIPS: mscc: ocelot: disable all switch ports by default The ocelot switch driver used to ignore ports which do not have a phy-handle property and not probe those, but this is not quite ok since it is valid to not have a phy-handle property if there is a fixed-link. It seems that checking for a phy-handle was a proxy for the proper check which is for the status, but that doesn't make a lot of sense, since the ocelot driver already iterates using for_each_available_child_of_node which skips the disabled ports, so I have no idea. Anyway, a widespread pattern in device trees is for a SoC dtsi to disable by default all hardware, and let board dts files enable what is used. So let's do that and enable only the ports with a phy-handle in the pcb120 and pcb123 device tree files. Signed-off-by: Vladimir Oltean Signed-off-by: Thomas Bogendoerfer commit cd92dbaf5d0444c403ca818ec37d945f05e9d240 Author: Lukas Bulwahn Date: Mon Aug 16 12:53:26 2021 +0200 MAINTAINERS: adjust PISTACHIO SOC SUPPORT after its retirement Commit 104f942b2832 ("MIPS: Retire MACH_PISTACHIO") removes ./arch/mips/pistachio/ and ./arch/mips/configs/pistachio_defconfig, but misses to adjust the corresponding section PISTACHIO SOC SUPPORT in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: arch/mips/configs/pistachio*_defconfig warning: no file matches F: arch/mips/pistachio/ As James Hartley is not reachable with the provided email address, the remaining dtsi file, arch/mips/boot/dts/img/pistachio.dtsi, must be maintained by its only user pistachio_marduk.dts, which is part of MARDUK (CREATOR CI40) DEVICE TREE SUPPORT. Add maintenance of pistachio.dtsi to that section and drop the PISTACHIO SOC SUPPORT after its retirement. Signed-off-by: Lukas Bulwahn Acked-by: Rahul Bedarkar Acked-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 126b39368604dbf155ce6dad8781a0454477022a Author: Huilong Deng Date: Tue Aug 17 10:53:38 2021 +0800 MIPS: Return true/false (not 1/0) from bool functions ./arch/mips/kernel/uprobes.c:261:8-9: WARNING: return of 0/1 in function 'arch_uprobe_skip_sstep' with return type bool ./arch/mips/kernel/uprobes.c:78:10-11: WARNING: return of 0/1 in function 'is_trap_insn' with return type bool ./arch/mips/kvm/mmu.c:489:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool ./arch/mips/kvm/mmu.c:445:8-9: WARNING: return of 0/1 in function 'kvm_unmap_gfn_range' with return type bool Signed-off-by: Huilong Deng Signed-off-by: Thomas Bogendoerfer commit f196ae282070d798c9144771db65577910d58566 Author: 周琰杰 (Zhou Yanjie) Date: Fri Jul 16 01:36:45 2021 +0800 dt-bindings: timer: Add ABIs for new Ingenic SoCs 1.Add OST_CLK_EVENT_TIMER for new XBurst®1 SoCs. 2.Add OST_CLK_EVENT_TIMER0 to OST_CLK_EVENT_TIMER15 for new XBurst®2 SoCs. Signed-off-by: 周琰杰 (Zhou Yanjie) Acked-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1626370605-120775-1-git-send-email-zhouyanjie@wanyeetech.com commit abfc7fad63940b8dfdfd25da6f0fa813d9561645 Author: Changbin Du Date: Sat Aug 14 09:11:14 2021 +0800 crypto: skcipher - in_irq() cleanup Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Signed-off-by: Changbin Du Signed-off-by: Herbert Xu commit 3e1d2c52b2045ba7f90966b02daeb6c438432570 Author: Weili Qian Date: Fri Aug 13 17:50:09 2021 +0800 crypto: hisilicon - check _PS0 and _PR0 method To support runtime PM, use the function 'pci_set_power_state' to change the power state. Therefore, method _PS0 or _PR0 needs to be filled by platform. So check whether the method is supported, if not, print a prompt information. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 74f5edbffcd37162084b6883e059bb6bb686151d Author: Weili Qian Date: Fri Aug 13 17:50:08 2021 +0800 crypto: hisilicon - change parameter passing of debugfs function To avoid repeatedly obtaining 'qm' from 'filp', parameter passing of debugfs function directly use 'qm' instead of 'filp'. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 607c191b371d72952c11dc209e583303a4515f14 Author: Weili Qian Date: Fri Aug 13 17:50:07 2021 +0800 crypto: hisilicon - support runtime PM for accelerator device Add runtime PM support for Kunpeng930 accelerator device. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit d7ea53395b723b1a87b9c0afb3301cc33fbe35e6 Author: Weili Qian Date: Fri Aug 13 17:50:06 2021 +0800 crypto: hisilicon - add runtime PM ops Accelerator devices support runtime PM to reduce power consumption. This patch adds the runtime PM suspend/resume callbacks to the accelerator devices. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 1295292d65b729fc8b234fcdf884d79ff5a63ca1 Author: Weili Qian Date: Fri Aug 13 17:50:05 2021 +0800 crypto: hisilicon - using 'debugfs_create_file' instead of 'debugfs_create_regset32' The accelerator devices support runtime PM, when device is in suspended, an exception will occur if reading registers. Therefore, this patch uses 'debugfs_create_file' instead of 'debugfs_create_regset32' to create debugfs file, and then the driver can get the device status before reading the register. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 357a753f5ec7ccdec196fa825d906c3acc4bd57c Author: Tianjia Zhang Date: Fri Aug 13 15:55:08 2021 +0800 crypto: tcrypt - add GCM/CCM mode test for SM4 algorithm tcrypt supports GCM/CCM mode, CMAC, CBCMAC, and speed test of SM4 algorithm. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 68039d605f7bb34ea6dbd4e099bf98599d52b0ac Author: Tianjia Zhang Date: Fri Aug 13 15:55:07 2021 +0800 crypto: testmgr - Add GCM/CCM mode test of SM4 algorithm The GCM/CCM mode of the SM4 algorithm is defined in the rfc 8998 specification, and the test case data also comes from rfc 8998. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 7b3d52683b3a47c0ba1dfd6b5994a3a795b06972 Author: Tianjia Zhang Date: Fri Aug 13 15:55:06 2021 +0800 crypto: tcrypt - Fix missing return value check There are several places where the return value check of crypto_aead_setkey and crypto_aead_setauthsize were lost. It is necessary to add these checks. At the same time, move the crypto_aead_setauthsize() call out of the loop, and only need to call it once after load transform. Fixee: 53f52d7aecb4 ("crypto: tcrypt - Added speed tests for AEAD crypto alogrithms in tcrypt test suite") Signed-off-by: Tianjia Zhang Reviewed-by: Vitaly Chikunov Signed-off-by: Herbert Xu commit a52626106d6f7edf3d106c065e13a0313cfeb82f Author: Kai Ye Date: Fri Aug 13 15:41:02 2021 +0800 crypto: hisilicon/sec - modify the hardware endian configuration When the endian configuration of the hardware is abnormal, it will cause the SEC engine is faulty that reports empty message. And it will affect the normal function of the hardware. Currently the soft configuration method can't restore the faulty device. The endian needs to be configured according to the system properties. So fix it. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 90367a027a22c3a9ca8b8bac15df34d9e859fc11 Author: Kai Ye Date: Fri Aug 13 15:41:01 2021 +0800 crypto: hisilicon/sec - fix the abnormal exiting process Because the algs registration process has added a judgment. So need to add the judgment for the abnormal exiting process. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 598cf42554749a7c59205879fd6e06ef6d021d94 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:29 2021 +0100 crypto: qat - store vf.compatible flag If the VF is newer than the PF, it decides whether it is compatible or not. In case it is compatible, store that information in the vf.compatible flag in the accel_dev structure. Signed-off-by: Giovanni Cabiddu Suggested-by: Fiona Trahe Signed-off-by: Herbert Xu commit 645ae0af1840199086c33e4f841892ebee73f615 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:28 2021 +0100 crypto: qat - do not export adf_iov_putmsg() The function adf_iov_putmsg() is only used inside the intel_qat module therefore should not be exported. Remove EXPORT_SYMBOL for the function adf_iov_putmsg(). Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 8af4a436e665201872348aa2ba6e7033d4c17823 Author: Ahsan Atta Date: Thu Aug 12 21:21:27 2021 +0100 crypto: qat - flush vf workqueue at driver removal There is a race condition during shutdown in adf_disable_sriov() where both the PF and the VF drivers are loaded on the host system. The PF notifies a VF with a "RESTARTING" message due to which the VF starts an asynchronous worker to stop and shutdown itself. At the same time the PF calls pci_disable_sriov() which invokes the remove() routine on the VF device driver triggering the shutdown flow again. This change fixes the problem by ensuring that the VF flushes the worker that performs stop()/shutdown() before these two functions are called in the remove(). To make sure that no additional PV/VF messages are processed by the VF, interrupts are disabled before flushing the workqueue. Signed-off-by: Ahsan Atta Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit e6dac5ea6f8e68c1d4fda7ffb6903c33161b3b4e Author: Marco Chiappero Date: Thu Aug 12 21:21:26 2021 +0100 crypto: qat - remove the unnecessary get_vintmsk_offset() All QAT GEN2 devices share the same register offset for masking interrupts, so they don't need any complex device specific infrastructure. Remove this function in favor of a constant in order to simplify the code. Also, future generations may require a more complex device specific handling, making the current approach obsolete anyway. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 9ffd49dfba6d5142189ceccf217ac315f8aac884 Author: Marco Chiappero Date: Thu Aug 12 21:21:25 2021 +0100 crypto: qat - fix naming of PF/VF enable functions Currently all the functions related to the activation of the PFVF protocol, both on PF and VF, include the direction specific "vf2pf" name. Replace the existing naming schema with: - a direction agnostic naming, that applies to both PF and VF, for the function pointer ("pfvf") - a direction specific naming schema for the implementations ("pf2vf" or "vf2pf") In particular this patch renames: - adf_pf_enable_vf2pf_comms() in adf_enable_pf2vf_comms() - enable_vf2pf_comms() in enable_pfvf_comms() Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 7c258f501ee09c1388a1ecef232db7b648d46aed Author: Marco Chiappero Date: Thu Aug 12 21:21:24 2021 +0100 crypto: qat - complete all the init steps before service notification Make sure all the steps in the initialization sequence are complete before any completion event notification. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 0b7b6c195845ebc3a9f74bea0db47006e9944995 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:23 2021 +0100 crypto: qat - move IO virtualization functions Move IOV functions at the end of hw_data so that PFVF functions related functions are group together. Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit b90c1c4d3fa8cd90f4e8245b13564380fd0bfad1 Author: Marco Chiappero Date: Thu Aug 12 21:21:22 2021 +0100 crypto: qat - fix naming for init/shutdown VF to PF notifications At start and shutdown, VFs notify the PF about their state. These notifications are carried out through a message exchange using the PFVF protocol. Function names lead to believe they do perform init or shutdown logic. This is to fix the naming to better reflect their purpose. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 07df385e645ed3b7fd3ac2d5c4c3e825b54bb7e4 Author: Kanchana Velusamy Date: Thu Aug 12 21:21:21 2021 +0100 crypto: qat - protect interrupt mask CSRs with a spinlock In the PF interrupt handler, the interrupt is disabled for a set of VFs by writing to the interrupt source mask register, ERRMSK. The interrupt is re-enabled in the bottom half handler by writing to the same CSR. This is done through the functions enable_vf2pf_interrupts() and disable_vf2pf_interrupts() which perform a read-modify-write operation on the ERRMSK registers to mask and unmask the source of interrupt. There can be a race condition where the top half handler for one VF interrupt runs just as the bottom half for another VF is about to re-enable the interrupt. Depending on whether the top or bottom half updates the CSR first, this would result either in a spurious interrupt or in the interrupt not being re-enabled. This patch protects the access of ERRMSK with a spinlock. The functions adf_enable_vf2pf_interrupts() and adf_disable_vf2pf_interrupts() have been changed to acquire a spin lock before accessing and modifying the ERRMSK registers. These functions use spin_lock_irqsave() to disable IRQs and avoid potential deadlocks. In addition, the function adf_disable_vf2pf_interrupts_irq() has been added. This uses spin_lock() and it is meant to be used in the top half only. Signed-off-by: Kanchana Velusamy Co-developed-by: Marco Chiappero Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 9800678f05a8431532e8f87c79b3cba6ec8ab8f5 Author: Marco Chiappero Date: Thu Aug 12 21:21:20 2021 +0100 crypto: qat - move pf2vf interrupt [en|dis]able to adf_vf_isr.c Interrupt code to enable interrupts from PF does not belong to the protocol code, so move it to the interrupt handling specific file for better code organization. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 3d655732b0199562267a05c7ff69ecdd11632939 Author: Marco Chiappero Date: Thu Aug 12 21:21:19 2021 +0100 crypto: qat - fix reuse of completion variable Use reinit_completion() to set to a clean state a completion variable, used to coordinate the VF to PF request-response flow, before every new VF request. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit e6eefd12dd779c098961a698ad98be1e0cd25635 Author: Svyatoslav Pankratov Date: Thu Aug 12 21:21:18 2021 +0100 crypto: qat - remove intermediate tasklet for vf2pf The PF driver uses the tasklet vf2pf_bh_tasklet to schedule a workqueue to handle the vf2vf protocol (pf2vf_resp_wq). Since the tasklet is only used to schedule the workqueue, this patch removes it and schedules the pf2vf_resp_wq workqueue directly for the top half. Signed-off-by: Svyatoslav Pankratov Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 506a16642901e7ab6fd9a2629eee60c7cc844769 Author: Marco Chiappero Date: Thu Aug 12 21:21:17 2021 +0100 crypto: qat - rename compatibility version definition Rename ADF_PFVF_COMPATIBILITY_VERSION in ADF_PFVF_COMPAT_THIS_VERSION since it is used to indicate the current version of the PFVF protocol. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 3213488db01e7ddc389be2390cc154d926e714a2 Author: Marco Chiappero Date: Thu Aug 12 21:21:16 2021 +0100 crypto: qat - prevent spurious MSI interrupt in PF There is a chance that the PFVF handler, adf_vf2pf_req_hndl(), runs twice for the same request when multiple interrupts come simultaneously from different VFs. Since the source VF is identified by a positional bit set in the ERRSOU registers and that is not cleared until the bottom half completes, new top halves from other VFs may reschedule a second bottom half for previous interrupts. This patch solves the problem in the ISR handler by not considering sources with already disabled interrupts (and processing pending), as set in the ERRMSK registers. Also, move some definitions where actually needed. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 7eadcfd633d8ef0082b194693c5057c9652fe243 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:15 2021 +0100 crypto: qat - prevent spurious MSI interrupt in VF QAT GEN2 devices suffer from a defect where the MSI interrupt can be sent multiple times. If the second (spurious) interrupt is handled before the bottom half handler runs, then the extra interrupt is effectively ignored because the bottom half is only scheduled once. However, if the top half runs again after the bottom half runs, this will appear as a spurious PF to VF interrupt. This can be avoided by checking the interrupt mask register in addition to the interrupt source register in the interrupt handler. This patch is based on earlier work done by Conor McLoughlin. Signed-off-by: Giovanni Cabiddu Co-developed-by: Marco Chiappero Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 0a73c762e1eee33a5e5dc0e3488f1b7cd17249b3 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:14 2021 +0100 crypto: qat - handle both source of interrupt in VF ISR The top half of the VF drivers handled only a source at the time. If an interrupt for PF2VF and bundle occurred at the same time, the ISR scheduled only the bottom half for PF2VF. This patch fixes the VF top half so that if both sources of interrupt trigger at the same time, both bottom halves are scheduled. This patch is based on earlier work done by Conor McLoughlin. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 5147f0906d50a9d26f2b8698cd06b5680e9867ff Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:13 2021 +0100 crypto: qat - do not ignore errors from enable_vf2pf_comms() The function adf_dev_init() ignores the error code reported by enable_vf2pf_comms(). If the latter fails, e.g. the VF is not compatible with the pf, then the load of the VF driver progresses. This patch changes adf_dev_init() so that the error code from enable_vf2pf_comms() is returned to the caller. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit a48afd6c7a4ee908f0e3c5691bd1a8e74f8e5d16 Author: Marco Chiappero Date: Thu Aug 12 21:21:12 2021 +0100 crypto: qat - enable interrupts only after ISR allocation Enable device interrupts after the setup of the interrupt handlers. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 462584ca17b4ca85721475cf2744d3229d4006cd Author: Marco Chiappero Date: Thu Aug 12 21:21:11 2021 +0100 crypto: qat - remove empty sriov_configure() Remove the empty implementation of sriov_configure() and set the sriov_configure member of the pci_driver structure to NULL. This way, if a user tries to enable VFs on a device, when kernel and driver are built with CONFIG_PCI_IOV=n, the kernel reports an error message saying that the driver does not support SRIOV configuration via sysfs. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 462354d986b6a89c6449b85f17aaacf44e455216 Author: Giovanni Cabiddu Date: Thu Aug 12 21:21:10 2021 +0100 crypto: qat - use proper type for vf_mask Replace vf_mask type with unsigned long to avoid a stack-out-of-bound. This is to fix the following warning reported by KASAN the first time adf_msix_isr_ae() gets called. [ 692.091987] BUG: KASAN: stack-out-of-bounds in find_first_bit+0x28/0x50 [ 692.092017] Read of size 8 at addr ffff88afdf789e60 by task swapper/32/0 [ 692.092076] Call Trace: [ 692.092089] [ 692.092101] dump_stack+0x9c/0xcf [ 692.092132] print_address_description.constprop.0+0x18/0x130 [ 692.092164] ? find_first_bit+0x28/0x50 [ 692.092185] kasan_report.cold+0x7f/0x111 [ 692.092213] ? static_obj+0x10/0x80 [ 692.092234] ? find_first_bit+0x28/0x50 [ 692.092262] find_first_bit+0x28/0x50 [ 692.092288] adf_msix_isr_ae+0x16e/0x230 [intel_qat] Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV") Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit c02b51b3edb0c5c110301884a638a3360236440f Author: Christophe JAILLET Date: Thu Aug 12 09:18:16 2021 +0100 crypto: qat - fix a typo in a comment s/Enable/Disable/ when describing 'adf_disable_aer()' Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 3660f25186aff60fb7d2f5aba784dddf400aec99 Author: Christophe JAILLET Date: Thu Aug 12 09:18:15 2021 +0100 crypto: qat - disable AER if an error occurs in probe functions If an error occurs after a 'adf_enable_aer()' call, it must be undone by a corresponding 'adf_disable_aer()' call, as already done in the remove function. Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit ae1f5043e2595bf29d348f2b4633fca5e930d3e3 Author: Giovanni Cabiddu Date: Thu Aug 12 09:18:14 2021 +0100 crypto: qat - set DMA mask to 48 bits for Gen2 Change the DMA mask from 64 to 48 for Gen2 devices as they cannot handle addresses greater than 48 bits. Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 6e422ccea4a67929e277f619f75995115511e206 Author: Christophe JAILLET Date: Thu Aug 12 09:18:13 2021 +0100 crypto: qat - simplify code and axe the use of a deprecated API The wrappers in include/linux/pci-dma-compat.h should go away. Replace 'pci_set_dma_mask/pci_set_consistent_dma_mask' by an equivalent and less verbose 'dma_set_mask_and_coherent()' call. Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit fe4d55773b879c785ae61da9b1c2160f0110f67e Author: Ben Hutchings Date: Wed Aug 11 02:06:09 2021 +0200 crypto: omap - Fix inconsistent locking of device lists lockdep complains that in omap-aes, the list_lock is taken both with softirqs enabled at probe time, and also in softirq context, which could lead to a deadlock: ================================ WARNING: inconsistent lock state 5.14.0-rc1-00035-gc836005b01c5-dirty #69 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. ksoftirqd/0/7 [HC0[0]:SC1[3]:HE1:SE0] takes: bf00e014 (list_lock){+.?.}-{2:2}, at: omap_aes_find_dev+0x18/0x54 [omap_aes_driver] {SOFTIRQ-ON-W} state was registered at: _raw_spin_lock+0x40/0x50 omap_aes_probe+0x1d4/0x664 [omap_aes_driver] platform_probe+0x58/0xb8 really_probe+0xbc/0x314 __driver_probe_device+0x80/0xe4 driver_probe_device+0x30/0xc8 __driver_attach+0x70/0xf4 bus_for_each_dev+0x70/0xb4 bus_add_driver+0xf0/0x1d4 driver_register+0x74/0x108 do_one_initcall+0x84/0x2e4 do_init_module+0x5c/0x240 load_module+0x221c/0x2584 sys_finit_module+0xb0/0xec ret_fast_syscall+0x0/0x2c 0xbed90b30 irq event stamp: 111800 hardirqs last enabled at (111800): [] __kmalloc+0x484/0x5ec hardirqs last disabled at (111799): [] __kmalloc+0x490/0x5ec softirqs last enabled at (111776): [] __do_softirq+0x2b8/0x4d0 softirqs last disabled at (111781): [] run_ksoftirqd+0x34/0x50 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(list_lock); lock(list_lock); *** DEADLOCK *** 2 locks held by ksoftirqd/0/7: #0: c0f5e8c8 (rcu_read_lock){....}-{1:2}, at: netif_receive_skb+0x6c/0x260 #1: c0f5e8c8 (rcu_read_lock){....}-{1:2}, at: ip_local_deliver_finish+0x2c/0xdc stack backtrace: CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 5.14.0-rc1-00035-gc836005b01c5-dirty #69 Hardware name: Generic AM43 (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (mark_lock.part.17+0x5bc/0xd04) [] (mark_lock.part.17) from [] (__lock_acquire+0x960/0x2fa4) [] (__lock_acquire) from [] (lock_acquire+0x10c/0x358) [] (lock_acquire) from [] (_raw_spin_lock_bh+0x44/0x58) [] (_raw_spin_lock_bh) from [] (omap_aes_find_dev+0x18/0x54 [omap_aes_driver]) [] (omap_aes_find_dev [omap_aes_driver]) from [] (omap_aes_crypt+0x94/0xd4 [omap_aes_driver]) [] (omap_aes_crypt [omap_aes_driver]) from [] (esp_input+0x1b0/0x2c8) [] (esp_input) from [] (xfrm_input+0x410/0x1290) [] (xfrm_input) from [] (xfrm4_esp_rcv+0x54/0x11c) [] (xfrm4_esp_rcv) from [] (ip_protocol_deliver_rcu+0x48/0x3bc) [] (ip_protocol_deliver_rcu) from [] (ip_local_deliver_finish+0x9c/0xdc) [] (ip_local_deliver_finish) from [] (ip_local_deliver+0x148/0x1b0) [] (ip_local_deliver) from [] (ip_rcv+0x11c/0x180) [] (ip_rcv) from [] (__netif_receive_skb_one_core+0x54/0x74) [] (__netif_receive_skb_one_core) from [] (netif_receive_skb+0xa8/0x260) [] (netif_receive_skb) from [] (cpsw_rx_handler+0x224/0x2fc) [] (cpsw_rx_handler) from [] (__cpdma_chan_process+0xf4/0x188) [] (__cpdma_chan_process) from [] (cpdma_chan_process+0x3c/0x5c) [] (cpdma_chan_process) from [] (cpsw_rx_mq_poll+0x44/0x98) [] (cpsw_rx_mq_poll) from [] (__napi_poll+0x28/0x268) [] (__napi_poll) from [] (net_rx_action+0xcc/0x204) [] (net_rx_action) from [] (__do_softirq+0x140/0x4d0) [] (__do_softirq) from [] (run_ksoftirqd+0x34/0x50) [] (run_ksoftirqd) from [] (smpboot_thread_fn+0xf4/0x1d8) [] (smpboot_thread_fn) from [] (kthread+0x14c/0x174) [] (kthread) from [] (ret_from_fork+0x14/0x38) ... The omap-des and omap-sham drivers appear to have a similar issue. Fix this by using spin_{,un}lock_bh() around device list access in all the probe and remove functions. Signed-off-by: Ben Hutchings Signed-off-by: Herbert Xu commit ffe3ee8bb68aa6c49832c6c101ab0bb1cb635624 Author: Ben Hutchings Date: Wed Aug 11 02:05:55 2021 +0200 crypto: omap - Avoid redundant copy when using truncated sg list omap_crypto_cleanup() currently copies data from sg to orig if either copy flag is set. However OMAP_CRYPTO_SG_COPIED means that sg refers to the same pages as orig, truncated to len bytes. There is no need to copy in this case. Only copy data if the OMAP_CRYPTO_DATA_COPIED flag is set. Fixes: 74ed87e7e7f7 ("crypto: omap - add base support library for common ...") Signed-off-by: Ben Hutchings Signed-off-by: Herbert Xu commit e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6 Author: Li Jun Date: Fri Jun 18 16:28:58 2021 +0800 usb: chipidea: host: fix port index underflow and UBSAN complains If wIndex is 0 (and it often is), these calculations underflow and UBSAN complains, here resolve this by not decrementing the index when it is equal to 0, this copies the solution from commit 85e3990bea49 ("USB: EHCI: avoid undefined pointer arithmetic and placate UBSAN") Reported-by: Zhipeng Wang Signed-off-by: Li Jun Link: https://lore.kernel.org/r/1624004938-2399-1-git-send-email-jun.li@nxp.com Signed-off-by: Peter Chen commit 759e0fd4b67766c96b33a114bba0c7d7521fecd0 Author: Christoph Hellwig Date: Fri Aug 20 11:49:29 2021 +0200 block: add back the bd_holder_dir reference in bd_link_disk_holder This essentially reverts "block: remove the extra kobject reference in bd_link_disk_holder". That commit dropped the extra reference because the condition in the comment can't be true. But it turns out that comment did not actually describe the problematic situation, so add back the extra reference and document it properly. Fixes: fbd9a39542ec ("block: remove the extra kobject reference in bd_link_disk_holder") Reported-by: Tushar Sugandhi Reviewed-by: Mike Snitzer Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 630c8fa02f9adf83614871c16c651f049b92f6a7 Author: Chun-Hung Tseng Date: Fri Aug 20 22:21:52 2021 +0000 Documentation: Update details of The Linux Kernel Module Programming Guide Recently, the content and examples of the book "The Linux Kernel Module Programming Guide" are being actively maintained and added on Github[1]. Currently, the book is being regularly built into webpage and pdf file using Github static page[2]. [1]: https://github.com/sysprog21/lkmpg [2]: https://sysprog21.github.io/lkmpg/ Signed-off-by: Chun-Hung Tseng Link: https://lore.kernel.org/r/20210820222152.971174-1-henrybear327@gmail.com [jc: fixed docs-build warnings] Signed-off-by: Jonathan Corbet commit ca32b5310a1a3835f81f498367f1bb7450c8b67b Author: Zhen Lei Date: Tue Jul 13 15:22:36 2021 +0800 PCI: Optimize pci_resource_len() to reduce kernel size pci_resource_end() can be 0 only when pci_resource_start() is 0. Otherwise, it is definitely an error. In this case, pci_resource_len() should be regarded as 0. Therefore, determining whether pci_resource_start() and pci_resource_end() are both 0 can be reduced to determining only whether pci_resource_end() is 0. Although only one condition judgment is reduced, the macro function pci_resource_len() is widely referenced in the kernel. I used defconfig to compile the latest kernel on X86, and its binary code size was reduced by about 3KB. Before: [ 2] .rela.text RELA 0000000000000000 093bfcb0 0000000001a67168 0000000000000018 I 68 1 8 After: [ 2] .rela.text RELA 0000000000000000 093bfcb0 0000000001a66598 0000000000000018 I 68 1 8 Link: https://lore.kernel.org/r/20210713072236.3043-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Bjorn Helgaas commit f0ab00174eb7574732737fc0734d4b406aed6231 Author: Bjorn Helgaas Date: Mon Aug 2 17:17:28 2021 -0500 PCI: Make saved capability state private to core Interfaces and structs for saving and restoring PCI Capability state were declared in include/linux/pci.h, but aren't needed outside drivers/pci/. Move these to drivers/pci/pci.h: struct pci_cap_saved_data struct pci_cap_saved_state void pci_allocate_cap_save_buffers() void pci_free_cap_save_buffers() int pci_add_cap_save_buffer() int pci_add_ext_cap_save_buffer() struct pci_cap_saved_state *pci_find_saved_cap() struct pci_cap_saved_state *pci_find_saved_ext_cap() Link: https://lore.kernel.org/r/20210802221728.1469304-1-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit a153e5e117ff562546ad3914045f2b5e1c302f88 Author: Krzysztof Wilczyński Date: Sun Aug 15 15:08:24 2021 +0000 PCI: Add schedule point in proc_bus_pci_read() PCI configuration space reads from /proc/bus/pci can often take several milliseconds to complete. Add a schedule point in proc_bus_pci_read() to reduce the maximum latency. A similar change was made for sysfs by 2ce02a864ac1 ("PCI: Add schedule point in pci_read_config()"). Link: https://lore.kernel.org/r/20200824052025.48362-1-benbjiang@tencent.com Link: https://lore.kernel.org/r/20210815150824.96773-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit 1901f8c9ca802a80f31729f5cc21bfb55150c6f1 Author: Jonathan Cameron Date: Tue Aug 3 20:30:14 2021 +0800 PCI: Correct the pci_iomap.h header guard #endif comment Update the include/asm-generic/pci_iomap.h header guard #endif comment to match the corresponding #ifndef. Link: https://lore.kernel.org/r/20210803123014.2963814-1-Jonathan.Cameron@huawei.com Signed-off-by: Jonathan Cameron Signed-off-by: Bjorn Helgaas commit 7cae7849fccee81c20072e3fc9102107837263f3 Author: Alex Williamson Date: Fri Jun 18 14:55:14 2021 -0600 PCI/ACS: Enforce pci=noats with Transaction Blocking PCIe Address Translation Services (ATS) provides a mechanism for a device to provide an on-device caching translation agent (device IOTLB). We already have a means to disable support for this feature via the pci=noats option. For untrusted and externally facing devices, we not only disable ATS support for the device, but we use Access Control Services (ACS) Transaction Blocking to actively prevent devices from sending TLPs with non-default AT field values. Extend pci=noats to also make use of PCI_ACS_TB so that not only is ATS disabled at the device, but blocked at the downstream ports. This provides a means to further lock-down ATS for cases such as device assignment, where it may not be the hardware configuration of the device that makes it untrusted, but the driver running on the device. Link: https://lore.kernel.org/r/162404966325.2362347.12176138291577486015.stgit@omen Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas Cc: Rajat Jain commit 32837d8a8f63eb95dcb9cd005524a27f06478832 Author: George Cherian Date: Tue Aug 10 17:54:25 2021 +0530 PCI: Add ACS quirks for Cavium multi-function devices Some Cavium endpoints are implemented as multi-function devices without ACS capability, but they actually don't support peer-to-peer transactions. Add ACS quirks to declare DMA isolation for the following devices: - BGX device found on Octeon-TX (8xxx) - CGX device found on Octeon-TX2 (9xxx) - RPM device found on Octeon-TX3 (10xxx) Link: https://lore.kernel.org/r/20210810122425.1115156-1-george.cherian@marvell.com Signed-off-by: George Cherian Signed-off-by: Bjorn Helgaas commit ff3a52ab9cab01a53b168dc667fe789f56b90aa9 Author: Jakub Kicinski Date: Wed Aug 11 11:59:55 2021 -0700 PCI/PTM: Remove error message at boot Since 39850ed51062 ("PCI/PTM: Save/restore Precision Time Measurement Capability for suspend/resume"), devices that have PTM capability but don't enable it see this message on calls to pci_save_state(): no suspend buffer for PTM Drop the message, it's perfectly fine not to use a capability. Fixes: 39850ed51062 ("PCI/PTM: Save/restore Precision Time Measurement Capability for suspend/resume") Link: https://lore.kernel.org/r/20210811185955.3112534-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Bjorn Helgaas Acked-by: David E. Box commit 466a79f417be2f2b0d875a9766a3cff10c3bedf1 Author: Heiner Kallweit Date: Wed Aug 18 21:06:40 2021 +0200 tg3: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Link: https://lore.kernel.org/r/0ae9d4c0-590d-682a-a0af-2272e5f71630@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 8d6ab5c5accd1a808b51a69bafa441cedf66006f Author: Heiner Kallweit Date: Wed Aug 18 21:05:26 2021 +0200 tg3: Validate VPD checksum with pci_vpd_check_csum() Validate the VPD checksum with pci_vpd_check_csum() to simplify the code. Link: https://lore.kernel.org/r/7297fce9-47db-3b86-366e-10b9ef43beaf@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit f240e15097c5004811a58f2cbc170bf90d06d0a9 Author: Heiner Kallweit Date: Wed Aug 18 21:04:37 2021 +0200 tg3: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This simplifies the code, and we no longer have to make assumptions about VPD size. Link: https://lore.kernel.org/r/bd3cd19c-b74f-9704-5786-476bf35ab5de@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 37838aa437c78fefd7d818f5f01a3a3950e92f40 Author: Heiner Kallweit Date: Wed Aug 18 21:03:44 2021 +0200 sfc: Search VPD with pci_vpd_find_ro_info_keyword() Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to simplify the code. Replace netif_err() with pci_err() because the netdevice isn't registered yet, which results in very ugly messages. Use kmemdup_nul() instead of open-coding it. Link: https://lore.kernel.org/r/bf5d4ba9-61a9-2bfe-19ec-75472732d74d@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 5119e20facfaa9f5454dd01192f3729415c7b139 Author: Heiner Kallweit Date: Wed Aug 18 21:02:33 2021 +0200 sfc: Read VPD with pci_vpd_alloc() Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and read the full VPD data into it. This avoids having to allocate a buffer on the stack, and we don't have to make any assumptions on VPD size and location of information in VPD. Link: https://lore.kernel.org/r/e58f1e40-c043-0266-9a0f-e5a7f3f6883c@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 6107e5cb907cffc5576cc1297847f9fc69a8d5d9 Author: Heiner Kallweit Date: Fri Aug 20 15:32:42 2021 -0500 PCI/VPD: Add pci_vpd_check_csum() VPD checksum information and checksum calculation are specified by PCIe r5.0, sec 6.28.2.2. Therefore checksum handling can and should be moved into the PCI VPD core. Add pci_vpd_check_csum() to validate the VPD checksum. [bhelgaas: split to separate patch] Link: https://lore.kernel.org/r/1643bd7a-088e-1028-c9b0-9d112cf48d63@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 9e515c9f6c0b6f0ace6f5cf2202b527d745b494d Author: Heiner Kallweit Date: Wed Aug 18 21:00:57 2021 +0200 PCI/VPD: Add pci_vpd_find_ro_info_keyword() All users of pci_vpd_find_info_keyword() are interested in the VPD RO section only. In addition all calls are followed by the same activities to calculate start of tag data area and size of the data area. Add pci_vpd_find_ro_info_keyword() that combines these functionalities. pci_vpd_find_info_keyword() can be phased out once all users are converted. [bhelgaas: split pci_vpd_check_csum() to separate patch] Link: https://lore.kernel.org/r/1643bd7a-088e-1028-c9b0-9d112cf48d63@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit d3703ef331297b6daa97f5228cbe2a657d0cfd21 Author: Changbin Du Date: Sat Aug 14 09:09:09 2021 +0800 dm crypt: use in_hardirq() instead of deprecated in_irq() Signed-off-by: Changbin Du Signed-off-by: Mike Snitzer commit 61e0d0cc51cd6b9d7447923f3ac7e60049de3e2e Author: Darrick J. Wong Date: Thu Aug 19 12:07:49 2021 -0700 xfs: fix perag structure refcounting error when scrub fails The kernel test robot found the following bug when running xfs/355 to scrub a bmap btree: XFS: Assertion failed: !sa->pag, file: fs/xfs/scrub/common.c, line: 412 ------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:110! invalid opcode: 0000 [#1] SMP PTI CPU: 2 PID: 1415 Comm: xfs_scrub Not tainted 5.14.0-rc4-00021-g48c6615cc557 #1 Hardware name: Hewlett-Packard p6-1451cx/2ADA, BIOS 8.15 02/05/2013 RIP: 0010:assfail+0x23/0x28 [xfs] RSP: 0018:ffffc9000aacb890 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffffc9000aacbcc8 RCX: 0000000000000000 RDX: 00000000ffffffc0 RSI: 000000000000000a RDI: ffffffffc09e7dcd RBP: ffffc9000aacbc80 R08: ffff8881fdf17d50 R09: 0000000000000000 R10: 000000000000000a R11: f000000000000000 R12: 0000000000000000 R13: ffff88820c7ed000 R14: 0000000000000001 R15: ffffc9000aacb980 FS: 00007f185b955700(0000) GS:ffff8881fdf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f7f6ef43000 CR3: 000000020de38002 CR4: 00000000001706e0 Call Trace: xchk_ag_read_headers+0xda/0x100 [xfs] xchk_ag_init+0x15/0x40 [xfs] xchk_btree_check_block_owner+0x76/0x180 [xfs] xchk_btree_get_block+0xd0/0x140 [xfs] xchk_btree+0x32e/0x440 [xfs] xchk_bmap_btree+0xd4/0x140 [xfs] xchk_bmap+0x1eb/0x3c0 [xfs] xfs_scrub_metadata+0x227/0x4c0 [xfs] xfs_ioc_scrub_metadata+0x50/0xc0 [xfs] xfs_file_ioctl+0x90c/0xc40 [xfs] __x64_sys_ioctl+0x83/0xc0 do_syscall_64+0x3b/0xc0 The unusual handling of errors while initializing struct xchk_ag is the root cause here. Since the beginning of xfs_scrub, the goal of xchk_ag_read_headers has been to read all three AG header buffers and attach them both to the xchk_ag structure and the scrub transaction. Corruption errors on any of the three headers doesn't necessarily trigger an immediate return to userspace, because xfs_scrub can also tell us to /fix/ the problem. In other words, it's possible for the xchk_ag init functions to return an error code and a partially filled out structure so that scrub can use however much information it managed to pull. Before 5.15, it was sufficient to cancel (or commit) the scrub transaction on the way out of the scrub code to release the buffers. Ccommit 48c6615cc557 added a reference to the perag structure to struct xchk_ag. Since perag structures are not attached to transactions like buffers are, this adds the requirement that the perag ref be released explicitly. The scrub teardown function xchk_teardown was amended to do this for the xchk_ag embedded in struct xfs_scrub. Unfortunately, I forgot that certain parts of the scrub code probe multiple AGs and therefore handle the initialization and cleanup on their own. Specifically, the bmbt scrubber will initialize it long enough to cross-reference AG metadata for btree blocks and for the extent mappings in the bmbt. If one of the AG headers is corrupt, the init function returns with a live perag structure reference and some of the AG header buffers. If an error occurs, the cross referencing will be noted as XCORRUPTion and skipped, but the main scrub process will move on to the next record. It is now necessary to release the perag reference before we try to analyze something from a different AG, or else we'll trip over the assertion noted above. Fixes: 48c6615cc557 ("xfs: grab active perag ref when reading AG headers") Reported-by: kernel test robot Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit 76f3c032adad86aad26f8ad3eebc993b4ba32138 Author: Heiner Kallweit Date: Wed Aug 18 20:59:31 2021 +0200 PCI/VPD: Add pci_vpd_alloc() Several users of the VPD API use a fixed-size buffer and read the VPD into it for further usage. This requires special handling for the case that the buffer isn't big enough to hold the full VPD data. Also the buffer is often allocated on the stack, which isn't too nice. Add pci_vpd_alloc() to dynamically allocate buffer of the correct size and read VPD into it. Link: https://lore.kernel.org/r/955ff598-0021-8446-f856-0c2c077635d7@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 43e540cc9f2ca12a2364ddf64e5ef929a546550d Author: Wei Huang Date: Wed Aug 18 11:55:49 2021 -0500 KVM: SVM: Add 5-level page table support for SVM When the 5-level page table is enabled on host OS, the nested page table for guest VMs must use 5-level as well. Update get_npt_level() function to reflect this requirement. In the meanwhile, remove the code that prevents kvm-amd driver from being loaded when 5-level page table is detected. Signed-off-by: Wei Huang Message-Id: <20210818165549.3771014-4-wei.huang2@amd.com> [Tweak condition as suggested by Sean. - Paolo] Signed-off-by: Paolo Bonzini commit cb0f722aff6e9ba970a9fee9263c7821bbe811de Author: Wei Huang Date: Wed Aug 18 11:55:48 2021 -0500 KVM: x86/mmu: Support shadowing NPT when 5-level paging is enabled in host When the 5-level page table CPU flag is set in the host, but the guest has CR4.LA57=0 (including the case of a 32-bit guest), the top level of the shadow NPT page tables will be fixed, consisting of one pointer to a lower-level table and 511 non-present entries. Extend the existing code that creates the fixed PML4 or PDP table, to provide a fixed PML5 table if needed. This is not needed on EPT because the number of layers in the tables is specified in the EPTP instead of depending on the host CR4. Suggested-by: Paolo Bonzini Signed-off-by: Wei Huang Message-Id: <20210818165549.3771014-3-wei.huang2@amd.com> Signed-off-by: Paolo Bonzini commit 17bfa96851e02968950dfbbce76ca552e7b713a2 Author: Tushar Sugandhi Date: Fri Aug 13 14:38:01 2021 -0700 dm ima: update dm documentation for ima measurement support The ima documentation for measuring DM targets (dm-ima.rst) is missing the attribute information for the targets - 'cache', 'integrity', 'multipath', and 'snapshot'. It is also missing the grammar for various DM events and targets, which can help the attestation servers to determine what data to expect for a given DM device. Further, the documentation needs to be updated to incorporate code changes made to DM ima events and targets as part of this patch series. For instance, prefixing the event names with "dm_", adding the DM version to events, prefixing the table hashes in the ima log with the hash algorithm etc. There are warnings reported by 'make htmldocs' on dm-ima.rst, which need to be fixed. And lastly, the expected behavior needs to be documented when the configuration CONFIG_IMA_DISABLE_HTABLE is disabled. Update the documentation to add examples for 'cache', 'integrity', 'multipath', and 'snapshot' targets. Add the grammar for various DM events and targets in Backus Naur form, so that the attestation servers can interpret and act on the ima measurements for DM target. Fix htmldocs warnings in dm-ima.rst. Update the documentation to be consistent with the code changes that are part of this patch series. Reported-by: Stephen Rothwell Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 33ace4ca125315d7f4f2b022bf6c83dfade8f9d8 Author: Tushar Sugandhi Date: Fri Aug 13 14:38:00 2021 -0700 dm ima: update dm target attributes for ima measurements Certain DM targets ('integrity', 'multipath', 'verity') need to update the way their attributes are recorded in the ima log, so that the attestation servers can interpret the data correctly and decide if the devices meet the attestation requirements. For instance, the "mode=%c" attribute in the 'integrity' target is measured twice, the 'verity' target is missing the attribute "root_hash_sig_key_desc=%s", and the 'multipath' target needs to index the attributes properly. Update 'integrity' target to remove the duplicate measurement of the attribute "mode=%c". Add "root_hash_sig_key_desc=%s" attribute for the 'verity' target. Index various attributes in 'multipath' target. Also, add "nr_priority_groups=%u" attribute to 'multipath' target to record the number of priority groups. Signed-off-by: Tushar Sugandhi Suggested-by: Thore Sommer Signed-off-by: Mike Snitzer commit f1cd6cb24b6b3cd95227e8016d092310a4015e96 Author: Tushar Sugandhi Date: Fri Aug 13 14:37:59 2021 -0700 dm ima: add a warning in dm_init if duplicate ima events are not measured The end-users of DM devices/targets may remove and re-create the same device multiple times. IMA does not measure such duplicate events if the configuration CONFIG_IMA_DISABLE_HTABLE is set to 'n'. To avoid confusion, the end-users need some indication on the client if that configuration option is disabled. Add a one-time warning during dm_init() if CONFIG_IMA_DISABLE_HTABLE is set to 'n', to notify the end-users that duplicate events will not be measured in the ima log. Also cleanup some whitespace in dm_init(). Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 746700d21fd52399c97aeb7791584bbf5426983c Author: Wei Huang Date: Wed Aug 18 11:55:47 2021 -0500 KVM: x86: Allow CPU to force vendor-specific TDP level AMD future CPUs will require a 5-level NPT if host CR4.LA57 is set. To prevent kvm_mmu_get_tdp_level() from incorrectly changing NPT level on behalf of CPUs, add a new parameter in kvm_configure_mmu() to force a fixed TDP level. Signed-off-by: Wei Huang Message-Id: <20210818165549.3771014-2-wei.huang2@amd.com> Signed-off-by: Paolo Bonzini commit ec607a564f70519b340f7eb4cfc0f4a6b55285ac Author: Paolo Bonzini Date: Fri Aug 6 07:05:58 2021 -0400 KVM: x86: clamp host mapping level to max_level in kvm_mmu_max_mapping_level This change started as a way to make kvm_mmu_hugepage_adjust a bit simpler, but it does fix two bugs as well. One bug is in zapping collapsible PTEs. If a large page size is disallowed but not all of them, kvm_mmu_max_mapping_level will return the host mapping level and the small PTEs will be zapped up to that level. However, if e.g. 1GB are prohibited, we can still zap 4KB mapping and preserve the 2MB ones. This can happen for example when NX huge pages are in use. The second would happen when userspace backs guest memory with a 1gb hugepage but only assign a subset of the page to the guest. 1gb pages would be disallowed by the memslot, but not 2mb. kvm_mmu_max_mapping_level() would fall through to the host_pfn_mapping_level() logic, see the 1gb hugepage, and map the whole thing into the guest. Fixes: 2f57b7051fe8 ("KVM: x86/mmu: Persist gfn_lpage_is_disallowed() to max_level") Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 85cc207b8e07df8ee05ee83115c9086aef20a1f5 Author: Maxim Levitsky Date: Wed Aug 11 15:29:27 2021 +0300 KVM: selftests: test KVM_GUESTDBG_BLOCKIRQ Modify debug_regs test to create a pending interrupt and see that it is blocked when single stepping is done with KVM_GUESTDBG_BLOCKIRQ Signed-off-by: Maxim Levitsky Message-Id: <20210811122927.900604-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 61e5f69ef08379cdc74e8f15d3770976ed48480a Author: Maxim Levitsky Date: Wed Aug 11 15:29:26 2021 +0300 KVM: x86: implement KVM_GUESTDBG_BLOCKIRQ KVM_GUESTDBG_BLOCKIRQ will allow KVM to block all interrupts while running. This change is mostly intended for more robust single stepping of the guest and it has the following benefits when enabled: * Resuming from a breakpoint is much more reliable. When resuming execution from a breakpoint, with interrupts enabled, more often than not, KVM would inject an interrupt and make the CPU jump immediately to the interrupt handler and eventually return to the breakpoint, to trigger it again. From the user point of view it looks like the CPU never executed a single instruction and in some cases that can even prevent forward progress, for example, when the breakpoint is placed by an automated script (e.g lx-symbols), which does something in response to the breakpoint and then continues the guest automatically. If the script execution takes enough time for another interrupt to arrive, the guest will be stuck on the same breakpoint RIP forever. * Normal single stepping is much more predictable, since it won't land the debugger into an interrupt handler. * RFLAGS.TF has less chance to be leaked to the guest: We set that flag behind the guest's back to do single stepping but if single step lands us into an interrupt/exception handler it will be leaked to the guest in the form of being pushed to the stack. This doesn't completely eliminate this problem as exceptions can still happen, but at least this reduces the chances of this happening. Signed-off-by: Maxim Levitsky Message-Id: <20210811122927.900604-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 7a4bca85b23f7a573da61f161dfbf8b00e9e2955 Author: Maxim Levitsky Date: Wed Aug 11 15:29:22 2021 +0300 KVM: SVM: split svm_handle_invalid_exit Split the check for having a vmexit handler to svm_check_exit_valid, and make svm_handle_invalid_exit only handle a vmexit that is already not valid. Signed-off-by: Maxim Levitsky Message-Id: <20210811122927.900604-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 9653f2da7522c5e762e2edd2beb53170669d0a2b Author: Sean Christopherson Date: Tue Aug 10 15:45:54 2021 -0700 KVM: x86/mmu: Drop 'shared' param from tdp_mmu_link_page() Drop @shared from tdp_mmu_link_page() and hardcode it to work for mmu_lock being held for read. The helper has exactly one caller and in all likelihood will only ever have exactly one caller. Even if KVM adds a path to install translations without an initiating page fault, odds are very, very good that the path will just be a wrapper to the "page fault" handler (both SNP and TDX RFCs propose patches to do exactly that). No functional change intended. Cc: Ben Gardon Signed-off-by: Sean Christopherson Message-Id: <20210810224554.2978735-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 71f51d2c3253645ccff69d6fa3a870f47005f0b3 Author: Mingwei Zhang Date: Mon Aug 2 21:46:07 2021 -0700 KVM: x86/mmu: Add detailed page size stats Existing KVM code tracks the number of large pages regardless of their sizes. Therefore, when large page of 1GB (or larger) is adopted, the information becomes less useful because lpages counts a mix of 1G and 2M pages. So remove the lpages since it is easy for user space to aggregate the info. Instead, provide a comprehensive page stats of all sizes from 4K to 512G. Suggested-by: Ben Gardon Reviewed-by: David Matlack Reviewed-by: Ben Gardon Signed-off-by: Mingwei Zhang Cc: Jing Zhang Cc: David Matlack Cc: Sean Christopherson Message-Id: <20210803044607.599629-4-mizhang@google.com> Signed-off-by: Paolo Bonzini commit 088acd23526647844aec1c39db4ad02552c86c7b Author: Sean Christopherson Date: Mon Aug 2 21:46:06 2021 -0700 KVM: x86/mmu: Avoid collision with !PRESENT SPTEs in TDP MMU lpage stats Factor in whether or not the old/new SPTEs are shadow-present when adjusting the large page stats in the TDP MMU. A modified MMIO SPTE can toggle the page size bit, as bit 7 is used to store the MMIO generation, i.e. is_large_pte() can get a false positive when called on a MMIO SPTE. Ditto for nuking SPTEs with REMOVED_SPTE, which sets bit 7 in its magic value. Opportunistically move the logic below the check to verify at least one of the old/new SPTEs is shadow present. Use is/was_leaf even though is/was_present would suffice. The code generation is roughly equivalent since all flags need to be computed prior to the code in question, and using the *_leaf flags will minimize the diff in a future enhancement to account all pages, i.e. will change the check to "is_leaf != was_leaf". Reviewed-by: David Matlack Reviewed-by: Ben Gardon Fixes: 1699f65c8b65 ("kvm/x86: Fix 'lpages' kvm stat for TDM MMU") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Mingwei Zhang Message-Id: <20210803044607.599629-3-mizhang@google.com> Signed-off-by: Paolo Bonzini commit 4293ddb788c1a98bdfa6479bcfd63ad5ce0a5ce6 Author: Mingwei Zhang Date: Mon Aug 2 21:46:05 2021 -0700 KVM: x86/mmu: Remove redundant spte present check in mmu_set_spte Drop an unnecessary is_shadow_present_pte() check when updating the rmaps after installing a non-MMIO SPTE. set_spte() is used only to create shadow-present SPTEs, e.g. MMIO SPTEs are handled early on, mmu_set_spte() runs with mmu_lock held for write, i.e. the SPTE can't be zapped between writing the SPTE and updating the rmaps. Opportunistically combine the "new SPTE" logic for large pages and rmaps. No functional change intended. Suggested-by: Ben Gardon Reviewed-by: David Matlack Reviewed-by: Ben Gardon Reviewed-by: Sean Christopherson Signed-off-by: Mingwei Zhang Message-Id: <20210803044607.599629-2-mizhang@google.com> Signed-off-by: Paolo Bonzini commit 8ccba534a1a5c6565220c81113d6157571f380cb Author: Jing Zhang Date: Mon Aug 2 16:56:33 2021 +0000 KVM: stats: Add halt polling related histogram stats Add three log histogram stats to record the distribution of time spent on successful polling, failed polling and VCPU wait. halt_poll_success_hist: Distribution of spent time for a successful poll. halt_poll_fail_hist: Distribution of spent time for a failed poll. halt_wait_hist: Distribution of time a VCPU has spent on waiting. Signed-off-by: Jing Zhang Message-Id: <20210802165633.1866976-6-jingzhangos@google.com> Signed-off-by: Paolo Bonzini commit 87bcc5fa092f82a9890f9e73e4f4c7016ef64049 Author: Jing Zhang Date: Mon Aug 2 16:56:32 2021 +0000 KVM: stats: Add halt_wait_ns stats for all architectures Add simple stats halt_wait_ns to record the time a VCPU has spent on waiting for all architectures (not just powerpc). Signed-off-by: Jing Zhang Message-Id: <20210802165633.1866976-5-jingzhangos@google.com> Signed-off-by: Paolo Bonzini commit d49b11f080b77f5bd66eec938e01b87a16ef201f Author: Jing Zhang Date: Mon Aug 2 16:56:31 2021 +0000 KVM: selftests: Add checks for histogram stats bucket_size field The bucket_size field should be non-zero for linear histogram stats and should be zero for other stats types. Reviewed-by: David Matlack Signed-off-by: Jing Zhang Message-Id: <20210802165633.1866976-4-jingzhangos@google.com> Signed-off-by: Paolo Bonzini commit 0176ec51290f8ef543a8c18a02e932d6ccedbbc5 Author: Jing Zhang Date: Mon Aug 2 16:56:30 2021 +0000 KVM: stats: Update doc for histogram statistics Add documentations for linear and logarithmic histogram statistics. Signed-off-by: Jing Zhang Message-Id: <20210802165633.1866976-3-jingzhangos@google.com> [Small changes to the phrasing. - Paolo] Signed-off-by: Paolo Bonzini commit f95937ccf5bd5e0a6bbac2b8e65a87982ffae403 Author: Jing Zhang Date: Mon Aug 2 16:56:29 2021 +0000 KVM: stats: Support linear and logarithmic histogram statistics Add new types of KVM stats, linear and logarithmic histogram. Histogram are very useful for observing the value distribution of time or size related stats. Signed-off-by: Jing Zhang Message-Id: <20210802165633.1866976-2-jingzhangos@google.com> Signed-off-by: Paolo Bonzini commit 73143035c214f3b0ac5cc2393197f828adeefc1e Author: Maxim Levitsky Date: Tue Aug 10 23:52:51 2021 +0300 KVM: SVM: AVIC: drop unsupported AVIC base relocation code APIC base relocation is not supported anyway and won't work correctly so just drop the code that handles it and keep AVIC MMIO bar at the default APIC base. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-17-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit df7e4827c5490a6a0cc41341497f5267712511cf Author: Maxim Levitsky Date: Tue Aug 10 23:52:50 2021 +0300 KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC Currently it is possible to have the following scenario: 1. AVIC is disabled by svm_refresh_apicv_exec_ctrl 2. svm_vcpu_blocking calls avic_vcpu_put which does nothing 3. svm_vcpu_unblocking enables the AVIC (due to KVM_REQ_APICV_UPDATE) and then calls avic_vcpu_load 4. warning is triggered in avic_vcpu_load since AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK was never cleared While it is possible to just remove the warning, it seems to be more robust to fully disable/enable AVIC in svm_refresh_apicv_exec_ctrl by calling the avic_vcpu_load/avic_vcpu_put Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-16-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit bf5f6b9d7ad6b88df15d691d9759f9a397488c7e Author: Maxim Levitsky Date: Tue Aug 10 23:52:49 2021 +0300 KVM: SVM: move check for kvm_vcpu_apicv_active outside of avic_vcpu_{put|load} No functional change intended. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-15-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 06ef813466c63ff1a61b5f99592e58d049c2c1ac Author: Maxim Levitsky Date: Tue Aug 10 23:52:48 2021 +0300 KVM: SVM: avoid refreshing avic if its state didn't change Since AVIC can be inhibited and uninhibited rapidly it is possible that we have nothing to do by the time the svm_refresh_apicv_exec_ctrl is called. Detect and avoid this, which will be useful when we will start calling avic_vcpu_load/avic_vcpu_put when the avic inhibition state changes. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-14-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 30eed56a7e1cbefe933a33d661827e5c72cd136f Author: Maxim Levitsky Date: Tue Aug 10 23:52:47 2021 +0300 KVM: SVM: remove svm_toggle_avic_for_irq_window Now that kvm_request_apicv_update doesn't need to drop the kvm->srcu lock, we can call kvm_request_apicv_update directly. Signed-off-by: Maxim Levitsky Reviewed-by: Paolo Bonzini Message-Id: <20210810205251.424103-13-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 0f250a646382e017725001a552624be0c86527bf Author: Vitaly Kuznetsov Date: Tue Aug 10 23:52:46 2021 +0300 KVM: x86: hyper-v: Deactivate APICv only when AutoEOI feature is in use APICV_INHIBIT_REASON_HYPERV is currently unconditionally forced upon SynIC activation as SynIC's AutoEOI is incompatible with APICv/AVIC. It is, however, possible to track whether the feature was actually used by the guest and only inhibit APICv/AVIC when needed. TLFS suggests a dedicated 'HV_DEPRECATING_AEOI_RECOMMENDED' flag to let Windows know that AutoEOI feature should be avoided. While it's up to KVM userspace to set the flag, KVM can help a bit by exposing global APICv/AVIC enablement. Maxim: - always set HV_DEPRECATING_AEOI_RECOMMENDED in kvm_get_hv_cpuid, since this feature can be used regardless of AVIC Paolo: - use arch.apicv_update_lock to protect the hv->synic_auto_eoi_used instead of atomic ops Signed-off-by: Vitaly Kuznetsov Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-12-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 4628efcd4e8963a41e877318cd10346dea9a6e00 Author: Maxim Levitsky Date: Tue Aug 10 23:52:45 2021 +0300 KVM: SVM: add warning for mistmatch between AVIC vcpu state and AVIC inhibition It is never a good idea to enter a guest on a vCPU when the AVIC inhibition state doesn't match the enablement of the AVIC on the vCPU. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-11-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit b0a1637f64b06586752cc507b94e4aeff02588d6 Author: Maxim Levitsky Date: Tue Aug 10 23:52:44 2021 +0300 KVM: x86: APICv: fix race in kvm_request_apicv_update on SVM Currently on SVM, the kvm_request_apicv_update toggles the APICv memslot without doing any synchronization. If there is a mismatch between that memslot state and the AVIC state, on one of the vCPUs, an APIC mmio access can be lost: For example: VCPU0: enable the APIC_ACCESS_PAGE_PRIVATE_MEMSLOT VCPU1: access an APIC mmio register. Since AVIC is still disabled on VCPU1, the access will not be intercepted by it, and neither will it cause MMIO fault, but rather it will just be read/written from/to the dummy page mapped into the APIC_ACCESS_PAGE_PRIVATE_MEMSLOT. Fix that by adding a lock guarding the AVIC state changes, and carefully order the operations of kvm_request_apicv_update to avoid this race: 1. Take the lock 2. Send KVM_REQ_APICV_UPDATE 3. Update the apic inhibit reason 4. Release the lock This ensures that at (2) all vCPUs are kicked out of the guest mode, but don't yet see the new avic state. Then only after (4) all other vCPUs can update their AVIC state and resume. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 36222b117e36d487172c36bec187628085b92575 Author: Maxim Levitsky Date: Tue Aug 10 23:52:43 2021 +0300 KVM: x86: don't disable APICv memslot when inhibited Thanks to the former patches, it is now possible to keep the APICv memslot always enabled, and it will be invisible to the guest when it is inhibited This code is based on a suggestion from Sean Christopherson: https://lkml.org/lkml/2021/7/19/2970 Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 9cc13d60ba6b9976e01ec6f66fa1ec4a06992929 Author: Maxim Levitsky Date: Tue Aug 10 23:52:42 2021 +0300 KVM: x86/mmu: allow APICv memslot to be enabled but invisible on AMD, APIC virtualization needs to dynamicaly inhibit the AVIC in a response to some events, and this is problematic and not efficient to do by enabling/disabling the memslot that covers APIC's mmio range. Plus due to SRCU locking, it makes it more complex to request AVIC inhibition. Instead, the APIC memslot will be always enabled, but be invisible to the guest, such as the MMU code will not install a SPTE for it, when it is inhibited and instead jump straight to emulating the access. When inhibiting the AVIC, this SPTE will be zapped. This code is based on a suggestion from Sean Christopherson: https://lkml.org/lkml/2021/7/19/2970 Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 8f32d5e563cbf0507756aa929134b1a110b47a62 Author: Maxim Levitsky Date: Tue Aug 10 23:52:41 2021 +0300 KVM: x86/mmu: allow kvm_faultin_pfn to return page fault handling code This will allow it to return RET_PF_EMULATE for APIC mmio emulation. This code is based on a patch from Sean Christopherson: https://lkml.org/lkml/2021/7/19/2970 Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Reviewed-by: Paolo Bonzini Message-Id: <20210810205251.424103-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 33a5c0009d14e18ca2fbf610efd6cf2e7e34489a Author: Maxim Levitsky Date: Tue Aug 10 23:52:40 2021 +0300 KVM: x86/mmu: rename try_async_pf to kvm_faultin_pfn try_async_pf is a wrong name for this function, since this code is used when asynchronous page fault is not enabled as well. This code is based on a patch from Sean Christopherson: https://lkml.org/lkml/2021/7/19/2970 Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Reviewed-by: Paolo Bonzini Message-Id: <20210810205251.424103-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit edb298c663fccad65fe99fcec6a4f96cc344520d Author: Maxim Levitsky Date: Tue Aug 10 23:52:39 2021 +0300 KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range This together with previous patch, ensures that kvm_zap_gfn_range doesn't race with page fault running on another vcpu, and will make this page fault code retry instead. This is based on a patch suggested by Sean Christopherson: https://lkml.org/lkml/2021/7/22/1025 Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 88f585358b5e6aec8586425bdbaaa2157112ffc2 Author: Maxim Levitsky Date: Tue Aug 10 23:52:38 2021 +0300 KVM: x86/mmu: add comment explaining arguments to kvm_zap_gfn_range This comment makes it clear that the range of gfns that this function receives is non inclusive. Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 2822da446640d82b7bf65800314ef2a825e8df13 Author: Maxim Levitsky Date: Tue Aug 10 23:52:37 2021 +0300 KVM: x86/mmu: fix parameters to kvm_flush_remote_tlbs_with_address kvm_flush_remote_tlbs_with_address expects (start gfn, number of pages), and not (start gfn, end gfn) Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 5a324c24b638d0f3194e1dc8f0cebd28a0745238 Author: Sean Christopherson Date: Tue Aug 10 23:52:36 2021 +0300 Revert "KVM: x86/mmu: Allow zap gfn range to operate under the mmu read lock" This together with the next patch will fix a future race between kvm_zap_gfn_range and the page fault handler, which will happen when AVIC memslot is going to be only partially disabled. The performance impact is minimal since kvm_zap_gfn_range is only called by users, update_mtrr() and kvm_post_set_cr0(). Both only use it if the guest has non-coherent DMA, in order to honor the guest's UC memtype. MTRR and CD setup only happens at boot, and generally in an area where the page tables should be small (for CD) or should not include the affected GFNs at all (for MTRRs). This is based on a patch suggested by Sean Christopherson: https://lkml.org/lkml/2021/7/22/1025 Signed-off-by: Sean Christopherson Signed-off-by: Maxim Levitsky Message-Id: <20210810205251.424103-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 3bcd0662d66fd07e596d2a7445e6b3215631b901 Author: Peter Xu Date: Fri Jul 30 18:04:52 2021 -0400 KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file Use this file to dump rmap statistic information. The statistic is done by calculating the rmap count and the result is log-2-based. An example output of this looks like (idle 6GB guest, right after boot linux): Rmap_Count: 0 1 2-3 4-7 8-15 16-31 32-63 64-127 128-255 256-511 512-1023 Level=4K: 3086676 53045 12330 1272 502 121 76 2 0 0 0 Level=2M: 5947 231 0 0 0 0 0 0 0 0 0 Level=1G: 32 0 0 0 0 0 0 0 0 0 0 Signed-off-by: Peter Xu Message-Id: <20210730220455.26054-5-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 4139b1972af281e0293c2414a0f1cd59fa5b2980 Author: Peter Xu Date: Fri Jul 30 18:04:51 2021 -0400 KVM: X86: Introduce kvm_mmu_slot_lpages() helpers Introduce kvm_mmu_slot_lpages() to calculcate lpage_info and rmap array size. The other __kvm_mmu_slot_lpages() can take an extra parameter of npages rather than fetching from the memslot pointer. Start to use the latter one in kvm_alloc_memslot_metadata(). Signed-off-by: Peter Xu Message-Id: <20210730220455.26054-4-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 9c2adfa6ba134efaf0bdeb15f76f99e9bcffb903 Author: Tushar Sugandhi Date: Fri Aug 13 14:37:58 2021 -0700 dm ima: prefix ima event name related to device mapper with dm_ The event names for the DM events recorded in the ima log do not contain any information to indicate the events are part of the DM devices/targets. Prefix the event names for DM events with "dm_" to indicate that they are part of device-mapper. Signed-off-by: Tushar Sugandhi Suggested-by: Thore Sommer Signed-off-by: Mike Snitzer commit dc7b79cc2466805855f554e5f567ea9222b6e33a Author: Tushar Sugandhi Date: Fri Aug 13 14:37:57 2021 -0700 dm ima: add version info to dm related events in ima log The DM events present in the ima log contain various attributes in the key=value format. The attributes' names/values may change in future, and new attributes may also get added. The attestation server needs some versioning to determine which attributes are supported and are expected in the ima log. Add version information to the DM events present in the ima log to help attestation servers to correctly process the attributes across different versions. Signed-off-by: Tushar Sugandhi Suggested-by: Mimi Zohar Signed-off-by: Mike Snitzer commit 8f509fd4a53ffaf07feeef6dd48cc6bd060ca4f3 Author: Tushar Sugandhi Date: Fri Aug 13 14:37:56 2021 -0700 dm ima: prefix dm table hashes in ima log with hash algorithm The active/inactive table hashes measured in the ima log do not contain the information about hash algorithm. This information is useful for the attestation servers to recreate the hashes and compare them with the ones present in the ima log to verify the table contents. Prefix the table hashes in various DM events in ima log with the hash algorithm used to compute those hashes. Signed-off-by: Tushar Sugandhi Suggested-by: Mimi Zohar Signed-off-by: Mike Snitzer commit 090bf6f84b4d23457a2116891e5de93bc995da90 Author: Changbin Du Date: Sat Aug 14 08:54:05 2021 +0800 arm64: replace in_irq() with in_hardirq() Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20210814005405.2658-1-changbin.du@gmail.com Signed-off-by: Catalin Marinas commit 66a91c00218c5f5d19e5bfaada05432c672b8241 Author: David E. Box Date: Mon Aug 16 09:58:34 2021 -0700 platform/x86/intel: pmc/core: Add GBE Package C10 fix for Alder Lake PCH Alder PCH uses the same Gigabit Ethernet (GBE) device as Tiger Lake PCH which cannot achieve PC10 without ignoring the PMC GBE LTR. Add this work around for Alder Lake PCH as well. Cc: Chao Qin Cc: Srinivas Pandruvada Cc: Andy Shevchenko Tested-by: You-Sheng Yang Acked-by: Rajneesh Bhardwaj Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: David E. Box Link: https://lore.kernel.org/r/9168e8bd687f2d0d5eb0ed116e08d0764eadf7b3.1629091915.git.gayatri.kammela@intel.com Signed-off-by: Hans de Goede commit 6cfce3ef806c1d458a816db7e63a1c13571abf86 Author: Gayatri Kammela Date: Mon Aug 16 09:58:33 2021 -0700 platform/x86/intel: pmc/core: Add Alder Lake low power mode support for pmc core Alder Lake has 14 status registers that are memory mapped. These registers show the status of the low power mode requirements. The registers are latched on every C10 entry or exit and on every s0ix.y entry/exit. Accessing these registers is useful for debugging any low power related activities. Thus, add debugfs entry to access low power mode status registers. Cc: Chao Qin Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Tested-by: You-Sheng Yang Acked-by: Rajneesh Bhardwaj Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Gayatri Kammela Link: https://lore.kernel.org/r/d27ec98589a5aaa569bbce0e937ed03779fc0a22.1629091915.git.gayatri.kammela@intel.com Signed-off-by: Hans de Goede commit ee7e89ff80063616c7f81b97ce7d38733019531a Author: Gayatri Kammela Date: Mon Aug 16 09:58:32 2021 -0700 platform/x86/intel: pmc/core: Add Latency Tolerance Reporting (LTR) support to Alder Lake Add support to show the Latency Tolerance Reporting for the IPs on the Alder Lake PCH as reported by the PMC. This LTR support on Alder Lake is slightly different from the Cannon lake PCH that is being reused by all platforms till Tiger Lake. Cc: Chao Qin Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Tested-by: You-Sheng Yang Acked-by: Rajneesh Bhardwaj Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Gayatri Kammela Link: https://lore.kernel.org/r/5ca3ea090b53a9bf918b055447ab5c8ef2925cc4.1629091915.git.gayatri.kammela@intel.com Signed-off-by: Hans de Goede commit bbab31101f44911b24c9da02733ce196e5702fea Author: Gayatri Kammela Date: Mon Aug 16 09:58:31 2021 -0700 platform/x86/intel: pmc/core: Add Alderlake support to pmc core driver Add Alder Lake client and mobile support to pmc core driver. Cc: Chao Qin Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Tested-by: You-Sheng Yang Acked-by: Rajneesh Bhardwaj Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Gayatri Kammela Link: https://lore.kernel.org/r/8b32e168f8e69dd00aabfb2e4383db78f22b123b.1629091915.git.gayatri.kammela@intel.com Signed-off-by: Hans de Goede commit aaac2820a36707a8f44adbd2774c623b4e21031c Author: Steven Rostedt (VMware) Date: Thu Aug 19 11:26:07 2021 -0400 selftests/ftrace: Add clear_dynamic_events() to test cases Add a function to remove all dynamic events from the tracing directory. It requires a loop as some of the dynamic events may depend on others being removed first. Also add a safety that prevents it from looping infinitely due to a bug where an event never gets removed. Link: https://lkml.kernel.org/r/20210819152825.348941368@goodmis.org Cc: "Tzvetomir Stoyanov" Cc: Tom Zanussi Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7491e2c442781a1860181adb5ab472a52075f393 Author: Tzvetomir Stoyanov (VMware) Date: Thu Aug 19 11:26:06 2021 -0400 tracing: Add a probe that attaches to trace events A new dynamic event is introduced: event probe. The event is attached to an existing tracepoint and uses its fields as arguments. The user can specify custom format string of the new event, select what tracepoint arguments will be printed and how to print them. An event probe is created by writing configuration string in 'dynamic_events' ftrace file: e[:[SNAME/]ENAME] SYSTEM/EVENT [FETCHARGS] - Set an event probe -:SNAME/ENAME - Delete an event probe Where: SNAME - System name, if omitted 'eprobes' is used. ENAME - Name of the new event in SNAME, if omitted the SYSTEM_EVENT is used. SYSTEM - Name of the system, where the tracepoint is defined, mandatory. EVENT - Name of the tracepoint event in SYSTEM, mandatory. FETCHARGS - Arguments: =$[:TYPE] - Fetch given filed of the tracepoint and print it as given TYPE with given name. Supported types are: (u8/u16/u32/u64/s8/s16/s32/s64), basic type (x8/x16/x32/x64), hexadecimal types "string", "ustring" and bitfield. Example, attach an event probe on openat system call and print name of the file that will be opened: echo "e:esys/eopen syscalls/sys_enter_openat file=\$filename:string" >> dynamic_events A new dynamic event is created in events/esys/eopen/ directory. It can be deleted with: echo "-:esys/eopen" >> dynamic_events Filters, triggers and histograms can be attached to the new event, it can be matched in synthetic events. There is one limitation - an event probe can not be attached to kprobe, uprobe or another event probe. Link: https://lkml.kernel.org/r/20210812145805.2292326-1-tz.stoyanov@gmail.com Link: https://lkml.kernel.org/r/20210819152825.142428383@goodmis.org Acked-by: Masami Hiramatsu Co-developed-by: Steven Rostedt (VMware) Signed-off-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Steven Rostedt (VMware) commit 95c3e4b4282a4033ff3b0fe64bd4d2a2f3f0d31d Author: Kate Hsuan Date: Fri Aug 20 14:04:58 2021 +0300 platform/x86: intel-wmi-thunderbolt: Move to intel sub-directory Move Intel WMI Thunderbolt driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-21-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit bd5b4fb47dde86b5e04686463dc2420e5ed6932a Author: Kate Hsuan Date: Fri Aug 20 14:04:57 2021 +0300 platform/x86: intel-wmi-sbl-fw-update: Move to intel sub-directory Move Intel WMI Slim Bootloader FW update driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-20-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 3afeacfd39eadc1f5f19a992eff65f554bd3e717 Author: Kate Hsuan Date: Fri Aug 20 14:04:56 2021 +0300 platform/x86: intel-vbtn: Move to intel sub-directory Move Intel vButton driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-19-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit cdbb8f5e79222dd964ebe3607ca541e1e799d9c8 Author: Kate Hsuan Date: Fri Aug 20 14:04:55 2021 +0300 platform/x86: intel_oaktrail: Move to intel sub-directory Move Intel Oaktrail driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-18-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit daef4c5a042302a047e56e8985f8d50d85f45802 Author: Kate Hsuan Date: Fri Aug 20 14:04:54 2021 +0300 platform/x86: intel_int0002_vgpio: Move to intel sub-directory Move Intel vGPIO (INT0002) driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-17-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit c3d3586d12b106dd96c80febd571760a0b4095a5 Author: Kate Hsuan Date: Fri Aug 20 14:04:53 2021 +0300 platform/x86: intel-hid: Move to intel sub-directory Move Intel HID driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-16-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 76693f5705828aa63c5cc52e407761964c6a4280 Author: Kate Hsuan Date: Fri Aug 20 14:04:52 2021 +0300 platform/x86: intel_atomisp2: Move to intel sub-directory Move Intel AtomISP v2 drivers to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-15-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 6b1e482898e841b577d1d22b97fb65ac8ffacd9a Author: Kate Hsuan Date: Fri Aug 20 14:04:51 2021 +0300 platform/x86: intel_speed_select_if: Move to intel sub-directory Move Intel Speed Select interface driver to intel sub-directory to improve readability and rename it from intel_speed_select_if to speed_select_if. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-14-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 075b559829d2b2f06d84d10f9712f6867b45c202 Author: Kate Hsuan Date: Fri Aug 20 14:04:50 2021 +0300 platform/x86: intel-uncore-frequency: Move to intel sub-directory Move Intel Uncore frequency driver to intel sub-directory to improve readability and rename it from intel-uncore-frequency.c to uncore-frequency.c. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-13-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 1fef1c047bfbeb140d109c9b7bd94410648650ca Author: Kate Hsuan Date: Fri Aug 20 14:04:49 2021 +0300 platform/x86: intel_turbo_max_3: Move to intel sub-directory Move Intel Turbo Max 3 driver to intel sub-directory to improve readability and rename it from intel_turbo_max_3.c to turbo_max_3.c. Signed-off-by: Kate Hsuan Acked-by: Srinivas Pandruvada Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-12-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 47bbe03eaf4493c1c7cc7ac9e24c633ef291f767 Author: Kate Hsuan Date: Fri Aug 20 14:04:48 2021 +0300 platform/x86: intel-smartconnect: Move to intel sub-directory Move Intel Smart Connect driver to intel sub-directory to improve readability and rename it from intel-smartconnect.c to smartconnect.c. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-11-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit e6596c22744e7c3058bc3ef843d1a6c20632e27f Author: Kate Hsuan Date: Fri Aug 20 14:04:47 2021 +0300 platform/x86: intel-rst: Move to intel sub-directory Move Intel RST driver to intel sub-directory to improve readability and rename it from intel-rst.c to rst.c. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-10-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 2b6cb8f2e88b416393d2b34cad51bfe6e1aae8a7 Author: Kate Hsuan Date: Fri Aug 20 14:04:46 2021 +0300 platform/x86: intel_telemetry: Move to intel sub-directory Move Intel telemetry driver to intel sub-directory to improve readability. While at it, spell APL fully in the Kconfig. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Reviewed-by: Rajneesh Bhardwaj Link: https://lore.kernel.org/r/20210820110458.73018-9-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit fa082a7cf5a66a42a06da048afd972e2cc1b67ea Author: Kate Hsuan Date: Fri Aug 20 14:04:44 2021 +0300 platform/x86: intel_pmc_core: Move to intel sub-directory Move Intel PMC core driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Reviewed-by: Rajneesh Bhardwaj Link: https://lore.kernel.org/r/20210820110458.73018-7-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 386d17b22e422da3285e33fe8dcc282f02d98178 Author: Kate Hsuan Date: Fri Aug 20 14:04:43 2021 +0300 platform/x86: intel_punit_ipc: Move to intel sub-directory Move Intel P-Unit IPC driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-6-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit f51c108d361c1f6f738049c3cc5d52734ea74424 Author: Kate Hsuan Date: Fri Aug 20 14:04:42 2021 +0300 platform/x86: intel_mrfld_pwrbtn: Move to intel sub-directory Move Intel Merrifield power button driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-5-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 2e4355e4c15e61729059434c975f81dd8e5bfefe Author: Kate Hsuan Date: Fri Aug 20 14:04:41 2021 +0300 platform/x86: intel_chtdc_ti_pwrbtn: Move to intel sub-directory Move Intel Cherry Trail Dollar Cove TI power button driver to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-4-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 9ed10052b5c9615a45830d75206608b19b830b16 Author: Kate Hsuan Date: Fri Aug 20 14:04:40 2021 +0300 platform/x86: intel_bxtwc_tmu: Move to intel sub-directory Move Intel Broxton Whiskey Cove TMU driver to intel sub-directory to improve readability. While at it, spell BXT fully in the Kconfig and switch to select REGMAP. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-3-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit b38d4ef1f0fdc23d8c0a8d2c349b61f2ae60c717 Author: Andy Shevchenko Date: Fri Aug 20 14:04:39 2021 +0300 platform/x86: intel_scu_ipc: Fix doc of intel_scu_ipc_dev_command_with_size() The kernel doc validator complains: .../ipc.c:478: warning: expecting prototype for intel_scu_ipc_command_with_size(). Prototype was for intel_scu_ipc_dev_command_with_size() instead Fix the prototype name in the kernel documentation. Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-2-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 400edd8c0455b9de91d079a4141ff20ba2d221f2 Author: Chuck Lever Date: Mon Aug 9 14:01:50 2021 -0400 SUNRPC: Add documentation for the fail_sunrpc/ directory Signed-off-by: Chuck Lever commit 3a1261805940d0ff1dbbb9c705dddbc018c0423f Author: Chuck Lever Date: Tue Aug 3 15:55:58 2021 -0400 SUNRPC: Server-side disconnect injection Disconnect injection stress-tests the ability for both client and server implementations to behave resiliently in the face of network instability. A file called /sys/kernel/debug/fail_sunrpc/ignore-server-disconnect enables administrators to turn off server-side disconnect injection while allowing other types of sunrpc errors to be injected. The default setting is that server-side disconnect injection is enabled (ignore=false). Signed-off-by: Chuck Lever commit a4ae308143961bf688e1c8a62f6604e62b491120 Author: Chuck Lever Date: Thu Aug 5 10:25:49 2021 -0400 SUNRPC: Move client-side disconnect injection Disconnect injection stress-tests the ability for both client and server implementations to behave resiliently in the face of network instability. Convert the existing client-side disconnect injection infrastructure to use the kernel's generic error injection facility. The generic facility has a richer set of injection criteria. Signed-off-by: Chuck Lever commit c782af250083f69ba810e79b60a552252e777416 Author: Chuck Lever Date: Tue Aug 3 15:45:18 2021 -0400 SUNRPC: Add a /sys/kernel/debug/fail_sunrpc/ directory This directory will contain a set of administrative controls for enabling error injection for kernel RPC consumers. Signed-off-by: Chuck Lever commit 251a7b3edc197a3947b8cb56fffe61d811aba0a5 Author: Peilin Ye Date: Wed Aug 18 15:01:23 2021 -0700 docs: x86: Remove obsolete information about x86_64 vmalloc() faulting x86_64 vmalloc() mappings are no longer "synchronized" among page tables via faulting since commit 6eb82f994026 ("x86/mm: Pre-allocate P4D/PUD pages for vmalloc area"), since the corresponding P4D or PUD pages are now preallocated at boot, by preallocate_vmalloc_pages(). Drop the "lazily synchronized" description for less confusion. While this file is x86_64-specific, it is worth noting that things are different for x86_32, where vmalloc()-related changes to `init_mm.pgd` are synchronized to all page tables in the system during runtime, via arch_sync_kernel_mappings(). Unfortunately, this synchronization is subject to race condition, which is further handled via faulting, see vmalloc_fault(). See commit 4819e15f740e ("x86/mm/32: Bring back vmalloc faulting on x86_32") for more details. Reviewed-by: Muchun Song Signed-off-by: Peilin Ye Reviewed-by: Joerg Roedel Link: https://lore.kernel.org/r/20210818220123.2623-1-yepeilin.cs@gmail.com Signed-off-by: Jonathan Corbet commit d44f571ff5ce51298df520cc46c3a9f5b983fc0a Author: SeongJae Park Date: Thu Aug 12 09:50:29 2021 +0000 Documentation/process/applying-patches: Activate linux-next man hyperlink There is a url for linux-next in the 'applying-patches.rst', but it's surrounded by backquotes. So the url doesn't have a hyperlink in the built document. To let readers easily move to the page, this commit puts the url outside of the backquotes so that a hyperlink to the url can be automatically made. Signed-off-by: SeongJae Park Link: https://lore.kernel.org/r/20210812095030.4704-1-sj38.park@gmail.com Signed-off-by: Jonathan Corbet commit 4af14dbaeae00af20daf4557f0e25de27cda812f Merge: 0ba218e2530aa c448f0fd2ce59 Author: Jakub Kicinski Date: Fri Aug 20 10:09:22 2021 -0700 Merge tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Minor updates: * BSS coloring support * MEI commands for Intel platforms * various fixes/cleanups * tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next: cfg80211: fix BSS color notify trace enum confusion mac80211: Fix insufficient headroom issue for AMSDU mac80211: add support for BSS color change nl80211: add support for BSS coloring mac80211: Use flex-array for radiotap header bitmap mac80211: radiotap: Use BIT() instead of shifts mac80211: Remove unnecessary variable and label mac80211: include mac80211: Fix monitor MTU limit so that A-MSDUs get through mac80211: remove unnecessary NULL check in ieee80211_register_hw() mac80211: Reject zero MAC address in sta_info_insert_check() nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage ==================== Link: https://lore.kernel.org/r/20210820105329.48674-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit c9398455b046fc7a44b6dd53d9d6fe4b11c21700 Author: Dmitry Osipenko Date: Fri Aug 20 02:51:11 2021 +0300 power: supply: core: Fix parsing of battery chemistry/technology The power_supply_get_battery_info() fails if device-chemistry property is missing in a device-tree because error variable is propagated to the final return of the function, fix it. Fixes: 4eef766b7d4d ("power: supply: core: Parse battery chemistry/technology") Signed-off-by: Dmitry Osipenko Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 90a9266269eb9f71af1f323c33e1dca53527bd22 Author: Michel Dänzer Date: Tue Aug 17 10:23:25 2021 +0200 drm/amdgpu: Cancel delayed work when GFXOFF is disabled schedule_delayed_work does not push back the work if it was already scheduled before, so amdgpu_device_delay_enable_gfx_off ran ~100 ms after the first time GFXOFF was disabled and re-enabled, even if GFXOFF was disabled and re-enabled again during those 100 ms. This resulted in frame drops / stutter with the upcoming mutter 41 release on Navi 14, due to constantly enabling GFXOFF in the HW and disabling it again (for getting the GPU clock counter). To fix this, call cancel_delayed_work_sync when the disable count transitions from 0 to 1, and only schedule the delayed work on the reverse transition, not if the disable count was already 0. This makes sure the delayed work doesn't run at unexpected times, and allows it to be lock-free. v2: * Use cancel_delayed_work_sync & mutex_trylock instead of mod_delayed_work. v3: * Make amdgpu_device_delay_enable_gfx_off lock-free (Christian König) v4: * Fix race condition between amdgpu_gfx_off_ctrl incrementing adev->gfx.gfx_off_req_count and amdgpu_device_delay_enable_gfx_off checking for it to be 0 (Evan Quan) Cc: stable@vger.kernel.org Reviewed-by: Evan Quan Reviewed-by: Lijo Lazar # v3 Acked-by: Christian König # v3 Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 9deb0b3dcf13e573d54bec8498f044da9780f4e2 Author: Christian König Date: Wed Aug 18 14:05:28 2021 +0200 drm/amdgpu: use the preferred pin domain after the check For some reason we run into an use case where a BO is already pinned into GTT, but should be pinned into VRAM|GTT again. Handle that case gracefully as well. Reviewed-by: Shashank Sharma Reviewed-by: Alex Deucher Signed-off-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8ac1696b1d6b9de0d31447d9e86fe8948b12dec1 Author: Evan Quan Date: Fri Aug 20 16:28:59 2021 +0800 drm/amd/pm: a quick fix for "divided by zero" error Considering Arcturus is a dedicated ASIC for computing, it will be more proper to drop the support for fan speed reading and setting. That's on the TODO list. Signed-off-by: Evan Quan Reported-by: Rui Teng Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit d8768d7eb9c21ef928adb93402d9348bcc4a6915 Merge: 7c60610d47676 faf8e7539643e 53f613134984c 8798d36411196 47a70bea54b7a 423d39d8518c1 f7403abf5f06f Author: Joerg Roedel Date: Fri Aug 20 17:14:35 2021 +0200 Merge branches 'apple/dart', 'arm/smmu', 'iommu/fixes', 'x86/amd', 'x86/vt-d' and 'core' into next commit f7403abf5f06f407c50252e003f5fb332325147b Author: Robin Murphy Date: Fri Aug 20 14:14:42 2021 +0100 iommu/io-pgtable: Abstract iommu_iotlb_gather access Previously io-pgtable merely passed the iommu_iotlb_gather pointer through to helpers, but now it has grown its own direct dereference. This turns out to break the build for !IOMMU_API configs where the structure only has a dummy definition. It will probably also crash drivers who don't use the gather mechanism and simply pass in NULL. Wrap this dereference in a suitable helper which can both be stubbed out for !IOMMU_API and encapsulate a NULL check otherwise. Fixes: 7a7c5badf858 ("iommu: Indicate queued flushes via gather data") Reported-by: kernel test robot Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/83672ee76f6405c82845a55c148fa836f56fbbc1.1629465282.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit c5aa903a59db274554718cddfda9039913409ec9 Author: Gao Xiang Date: Fri Aug 20 18:00:19 2021 +0800 erofs: support reading chunk-based uncompressed files Add runtime support for chunk-based uncompressed files described in the previous patch. Link: https://lore.kernel.org/r/20210820100019.208490-2-hsiangkao@linux.alibaba.com Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 2a9dc7a8fec6ca287e2c038f9441e24269e10b5f Author: Gao Xiang Date: Fri Aug 20 18:00:18 2021 +0800 erofs: introduce chunk-based file on-disk format Currently, uncompressed data except for tail-packing inline is consecutive on disk. In order to support chunk-based data deduplication, add a new corresponding inode data layout. In the future, the data source of chunks can be either (un)compressed. Link: https://lore.kernel.org/r/20210820100019.208490-1-hsiangkao@linux.alibaba.com Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 77eca00f8366238398b9f2f6eea1707a0832f79e Merge: cc64c390b215b 9ba00856686ad Author: Mark Brown Date: Fri Aug 20 15:32:26 2021 +0100 Merge series "ASoC: Intel/rt5640: Add support for HP Elite Pad 1000G2 jack-detect" from Hans de Goede : Changes in v2: - Rebase on asoc/for-next - New patch: "ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack" - Addressed Pierre-Louis' comments about calling acpi_dev_add_driver_gpios() twice Original cover-letter: The HP Elitepad 1000 G2 tablet has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec + an external HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for the headset-mic. The codec's GPIO1 is also its only IRQ output pin, so this means that the codec's IRQ cannot be used on this tablet. Instead the jack-detect is connected directly to GPIOs on the main SoC. The dock has a helper chip which also detects if a headset-mic is present or not, so there are 2 GPIOs for the jack-detect status of the dock. The tablet jack uses a single GPIO which indicates if a jack is present or not. Differentiating between between headphones vs a headset on the tablet jack is done by using the usual mic-bias over-current-detection mechanism. Regards, Hans Hans de Goede (6): ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset() ASoC: rt5640: Add rt5640_set_ovcd_params() helper ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect sound/soc/codecs/rt5640.c | 136 ++++++++++++---------- sound/soc/codecs/rt5640.h | 6 + sound/soc/intel/boards/bytcr_rt5640.c | 158 +++++++++++++++++++++++++- 3 files changed, 234 insertions(+), 66 deletions(-) -- 2.31.1 commit 6ca822e57638783e0fff4273153b97d72f485760 Author: Riccardo Mancini Date: Fri Aug 20 13:31:29 2021 +0200 perf tests dlfilter: Free desc and long_desc in check_filter_desc In dlfilter-test.c, check_filter_desc() calls get_filter_desc() which allocates 'desc' and 'long_desc'. However, these variables are never deallocated. This patch adds the missing free() calls. Fixes: 9f9c9a8de2d5e96c ("perf tests: Add dlfilter test") Signed-off-by: Riccardo Mancini Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210820113132.724034-1-rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 08d736667185dca2751cf47eabb0830cecdeb160 Author: Bob Peterson Date: Mon Aug 2 09:08:51 2021 -0500 gfs2: Remove redundant check from gfs2_glock_dq In function gfs2_glock_dq, it checks to see if this is the fast path. Before this patch, it checked both "find_first_holder(gl) == NULL" and list_empty(&gl->gl_holders), which is redundant. If gl_holders is empty then find_first_holder must return NULL. This patch removes the redundancy. Signed-off-by: Bob Peterson commit fffe9bee14b0e04ef632b96279fa44cb3df80812 Author: Bob Peterson Date: Fri Jul 30 13:23:49 2021 -0500 gfs2: Delay withdraw from atomic context Before this patch, if function __gfs2_ail_flush detected an error syncing the ail list, it call gfs2_ail_error which called gfs2_withdraw. Since __gfs2_ail_flush deals with a specific glock, we shouldn't withdraw immediately because the withdraw code (signal_our_withdraw) uses glocks in its processing. This patch changes the call from gfs2_withdraw to gfs2_withdraw_delayed which defers the withdraw until a more appropriate context, such as the logd daemon, discovers the intent to withdraw. Reported-by: Dan Carpenter Signed-off-by: Bob Peterson commit d1340f80f0b8066321b499a376780da00560e857 Author: Bob Peterson Date: Fri Jul 30 12:41:49 2021 -0500 gfs2: Don't call dlm after protocol is unmounted In the gfs2 withdraw sequence, the dlm protocol is unmounted with a call to lm_unmount. After a withdraw, users are allowed to unmount the withdrawn file system. But at that point we may still have glocks left over that we need to free via unmount's call to gfs2_gl_hash_clear. These glocks may have never been completed because of whatever problem caused the withdraw (IO errors or whatever). Before this patch, function gdlm_put_lock would still try to call into dlm to unlock these leftover glocks, which resulted in dlm returning -EINVAL because the lock space was abandoned. These glocks were never freed because there was no mechanism after that to free them. This patch adds a check to gdlm_put_lock to see if the locking protocol was inactive (DFL_UNMOUNT flag) and if so, free the glock and not make the invalid call into dlm. I could have combined this "if" with the one that follows, related to leftover glock LVBs, but I felt the code was more readable with its own if clause. Signed-off-by: Bob Peterson commit 8cc67f704f4b61384343629feb1f1c30d64188c6 Author: Bob Peterson Date: Fri Jul 30 12:41:16 2021 -0500 gfs2: don't stop reads while withdraw in progress When gfs2 withdraws a file system, it calls signal_our_withdraw which triggers another node to replay the withdrawing node's journal. Then it waits until it knows the journal has been replayed. Part of this wait is to repeatedly call check_journal_clean which calls gfs2_jdesc_check, which checks to see if the journal is sane. As part of its sanity checks it needs to re-read its journal's metadata. But with today's code, any attempt to re-read the metadata results in -EIO because of a check for the file system withdraw in function gfs2_meta_wait. This patch adds an additional check for SDF_WITHDRAW_IN_PROG, to tell if the read is done while the withdraw is in progress. In that case we allow the metadata read to not be rejected. Therefore the metadata check is done properly, so the withdraw sequence can finish normally. Signed-off-by: Bob Peterson commit 1b8550b5de7610027609ef605f85dc29f1d9da82 Author: Bob Peterson Date: Fri Jul 30 12:40:25 2021 -0500 gfs2: Mark journal inodes as "don't cache" Before this patch, journal inodes were considered regular inodes, which meant that instead of evicting them, function iput_final would just put them on the lru for later processing. If the file system withdrew for whatever reason, the withdraw would never be seen until the inode was evicted, which could be indefinitely. This patch marks all journal inodes as "don't cache" which means function iput_final will evict them immediately, allowing us to properly recover the journal on other cluster nodes. Signed-off-by: Bob Peterson commit ba3ca2bcf4aa20670849f621f059b3657fd7614a Author: Bob Peterson Date: Thu Jul 29 07:34:39 2021 -0500 gfs2: nit: gfs2_drop_inode shouldn't return bool Today, gfs2_drop_inode can return "false" for an int value. I'm sure this was just an oversight. Change to int value. Signed-off-by: Bob Peterson commit a8f1d32d0f04354ee4dddb83072413f2c299a192 Author: Bob Peterson Date: Tue Jul 27 13:52:42 2021 -0500 gfs2: Eliminate vestigial HIF_FIRST Holder flag HIF_FIRST is no longer used or needed, so remove it. Signed-off-by: Bob Peterson commit 7392fbb0a402ec4e4342a5e26a4bd6c359e67165 Author: Bob Peterson Date: Mon Jul 26 12:53:12 2021 -0500 gfs2: Make recovery error more readable Before this patch, withdraws could cause an error that looked like: Journal recovery skipped for 0 until next mount. This patch changes it to a more readable: Journal recovery skipped for jid 0 until next mount. Signed-off-by: Bob Peterson commit 70c11ba8f2dc6ff216477a8dd7ec0ad8568c410e Author: Bob Peterson Date: Wed Jun 30 11:46:17 2021 -0500 gfs2: Don't release and reacquire local statfs bh Before this patch, several functions in gfs2 related to the updating of the statfs file used a newly acquired/read buffer_head for the local statfs file. This is completely unnecessary, because other nodes should never update it. Recreating the buffer is a waste of time. This patch allows gfs2 to read in the local statefs buffer_head at mount time and keep it around until unmount time. Signed-off-by: Bob Peterson commit acdcfd94ef330d10c344aff9b648056117e3f75b Merge: cf39e60c83f1e 8d474deaba2c4 Author: Marc Zyngier Date: Fri Aug 20 15:03:40 2021 +0100 Merge branch irq/misc-5.15 into irq/irqchip-next * irq/misc-5.15: : . : Various irqchip fixes: : : - Fix edge interrupt support on loongson systems : - Advertise lack of wake-up logic on mtk-sysirq : - Fix mask tracking on the Apple AIC : - Correct priority reading of arm64 pseudo-NMI when SCR_EL3.FIQ==0 : . irqchip/gic-v3: Fix priority comparison when non-secure priorities are used irqchip/apple-aic: Fix irq_disable from within irq handlers Signed-off-by: Marc Zyngier commit 8d474deaba2c4dd33a5e2f5be82e6798ffa6b8a5 Author: Chen-Yu Tsai Date: Thu Aug 12 01:15:05 2021 +0800 irqchip/gic-v3: Fix priority comparison when non-secure priorities are used When non-secure priorities are used, compared to the raw priority set, the value read back from RPR is also right-shifted by one and the highest bit set. Add a macro to do the modifications to the raw priority when doing the comparison against the RPR value. This corrects the pseudo-NMI behavior when non-secure priorities in the GIC are used. Tested on 5.10 with the "IPI as pseudo-NMI" series [1] applied on MT8195. [1] https://lore.kernel.org/linux-arm-kernel/1604317487-14543-1-git-send-email-sumit.garg@linaro.org/ Fixes: 336780590990 ("irqchip/gic-v3: Support pseudo-NMIs when SCR_EL3.FIQ == 0") Reviewed-by: Alexandru Elisei Signed-off-by: Chen-Yu Tsai [maz: Added comment contributed by Alex] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210811171505.1502090-1-wenst@chromium.org commit a28dc123fa66ba7f3eca7cffc4b01d96bfd35c27 Author: Bob Peterson Date: Fri May 14 07:42:33 2021 -0500 gfs2: init system threads before freeze lock Patch 96b1454f2e ("gfs2: move freeze glock outside the make_fs_rw and _ro functions") changed the gfs2 mount sequence so that it holds the freeze lock before calling gfs2_make_fs_rw. Before this patch, gfs2_make_fs_rw called init_threads to initialize the quotad and logd threads. That is a problem if the system needs to withdraw due to IO errors early in the mount sequence, for example, while initializing the system statfs inode: 1. An IO error causes the statfs glock to not sync properly after recovery, and leaves items on the ail list. 2. The leftover items on the ail list causes its do_xmote call to fail, which makes it want to withdraw. But since the glock code cannot withdraw (because the withdraw sequence uses glocks) it relies upon the logd daemon to initiate the withdraw. 3. The withdraw can never be performed by the logd daemon because all this takes place before the logd daemon is started. This patch moves function init_threads from super.c to ops_fstype.c and it changes gfs2_fill_super to start its threads before holding the freeze lock, and if there's an error, stop its threads after releasing it. This allows the logd to run unblocked by the freeze lock. Thus, the logd daemon can perform its withdraw sequence properly. Fixes: 96b1454f2e8e ("gfs2: move freeze glock outside the make_fs_rw and _ro functions") Signed-off-by: Bob Peterson commit 0ba218e2530aa4e8dd6d325a9e9d734276513301 Merge: a515e5b53cc69 2796d846d74a1 Author: David S. Miller Date: Fri Aug 20 15:00:35 2021 +0100 Merge branch 'bridge-vlan' Nikolay Aleksandrov says: ==================== net: bridge: mcast: add support for port/vlan router control This small set adds control over port/vlan mcast router config. Initially I had added host vlan entry router control via vlan's global options but that is really unnecessary and we can use a single per-vlan option to control it both for port/vlan and host/vlan entries. Since it's all still in net-next we can convert BRIDGE_VLANDB_GOPTS_MCAST_ROUTER to BRIDGE_VLANDB_ENTRY_MCAST_ROUTER and use it for both. That makes much more sense and is easier for user-space. Patch 01 prepares the port router function to be used with port mcast context instead of port and then patch 02 converts the global vlan mcast router option to per-vlan mcast router option which directly gives us both host/vlan and port/vlan mcast router control without any additional changes. This way we get the following coherent syntax: [ port/vlan mcast router] $ bridge vlan set vid 100 dev ens20 mcast_router 2 [ bridge/vlan mcast router ] $ bridge vlan set vid 100 dev bridge mcast_router 2 instead of: $ bridge vlan set vid 100 dev bridge mcast_router 1 global The mcast_router should not be regarded as a global option, it controls the port/vlan and bridge/vlan mcast router behaviour. This is the last set needed for the initial per-vlan mcast support. Next patch-sets: - iproute2 support - selftests ==================== Signed-off-by: David S. Miller commit 2796d846d74a18cc6563e96eff8bf28c5e06f912 Author: Nikolay Aleksandrov Date: Fri Aug 20 15:42:55 2021 +0300 net: bridge: vlan: convert mcast router global option to per-vlan entry The per-vlan router option controls the port/vlan and host vlan entries' mcast router config. The global option controlled only the host vlan config, but that is unnecessary and incosistent as it's not really a global vlan option, but rather bridge option to control host router config, so convert BRIDGE_VLANDB_GOPTS_MCAST_ROUTER to BRIDGE_VLANDB_ENTRY_MCAST_ROUTER which can be used to control both host vlan and port vlan mcast router config. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit a53581d5559eaacaac1b4aed8e2f22c40efa5acc Author: Nikolay Aleksandrov Date: Fri Aug 20 15:42:54 2021 +0300 net: bridge: mcast: br_multicast_set_port_router takes multicast context as argument Change br_multicast_set_port_router to take port multicast context as its first argument so we can later use it to control port/vlan mcast router option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit a515e5b53cc699f1f3b60a5135f50657efa2758b Author: Sunil Goutham Date: Fri Aug 20 13:55:22 2021 +0530 octeontx2-pf: Add check for non zero mcam flows This patch ensures that mcam flows are allocated before adding or destroying the flows. Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit fa16ee77364f03d8565e5adeff1b119b29acca69 Author: jing yangyang Date: Thu Aug 19 20:35:27 2021 -0700 tools/net: Use bitwise instead of arithmetic operator for flags This silences the following coccinelle warning: "WARNING: sum of probable bitmasks, consider |" Reported-by: Zeal Robot Signed-off-by: jing yangyang Signed-off-by: David S. Miller commit c1125062fb4074fade7fa1114b9746a6620eb5bf Merge: b8e36e13ea5e4 c3f115aa5e1b6 Author: David S. Miller Date: Fri Aug 20 14:45:48 2021 +0100 Merge branch 'ipa-kill-off-ipa_clock_get' Alex Elder says: ==================== net: ipa: kill off ipa_clock_get() This series replaces the remaining uses of ipa_clock_get() with calls to pm_runtime_get_sync() instead. It replaces all calls to ipa_clock_put() with calls to pm_runtime_put(). This completes the preparation for enabling automated suspend under the control of the power management core code. The next patch (in an upcoming series) enables that. Then the "ipa_clock" files and symbols will switch to using an "ipa_power" naming convention instead. Additional info It is possible for pm_runtime_get_sync() to return an error. There are really three cases, identified by return value: - 1, meaning power was already active - 0, meaning power was not previously active, but is now - EACCES, meaning runtime PM is disabled One additional case is EINVAL, meaning a previous suspend or resume (or idle) call returned an error. But we have always assumed this won't happen (we previously didn't even check for an error). But because we use pm_runtime_force_suspend() to implement system suspend, there's a chance we'd get an EACCES error (the first thing that function does is disable runtime suspend). Individual patches explain what happens in that case, but generally we just accept that it could be an unlikely problem (occurring only at startup time). Similarly, pm_runtime_put() could return an error. There too, we ignore EINVAL, assuming the IPA suspend and resume operations won't produce an error. EBUSY and EPERM are not applicable, EAGAIN is not expected (and harmless). We should never get EACCES (runtime suspend disabled), because pm_runtime_put() calls match prior pm_runtime_get_sync() calls, and a system suspend will not be started while a runtime suspend or resume is underway. In summary, the value returned from pm_runtime_put() is not meaningful, so we explicitly ignore it. ==================== Signed-off-by: David S. Miller commit c3f115aa5e1b6459e2ccd711277435397dd7c6e9 Author: Alex Elder Date: Thu Aug 19 17:19:27 2021 -0500 net: ipa: kill ipa_clock_get() The only remaining user of the ipa_clock_{get,put}() interface is ipa_isr_thread(). Replace calls to ipa_clock_get() there calling pm_runtime_get_sync() instead. And call pm_runtime_put() there rather than ipa_clock_put(). Warn if we ever get an error. With that, we can get rid of ipa_clock_get() and ipa_clock_put(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 724c2d743688f296263df0223c3d95987dfc427b Author: Alex Elder Date: Thu Aug 19 17:19:26 2021 -0500 net: ipa: don't use ipa_clock_get() in "ipa_modem.c" When we open or close the modem network device we need to ensure the hardware is powered. Replace the callers of ipa_clock_get() found in ipa_open() and ipa_stop() with calls to pm_runtime_get_sync(). If an error is returned, simply return that error to the caller (without any error or warning message). This could conceivably occur if the function was called while the system was suspended, but that really shouldn't happen. Replace corresponding calls to ipa_clock_put() with pm_runtime_put() also. If the modem crashes we also need to ensure the hardware is powered to recover. If getting power returns an error there's not much we can do, but at least report the error. (Ideally the remoteproc SSR code would ensure the AP was not suspended when it sends the notification, but that is not (yet) the case.) Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 799c5c24b7acc8af0086f1cbff5be3af7f63f6f1 Author: Alex Elder Date: Thu Aug 19 17:19:25 2021 -0500 net: ipa: don't use ipa_clock_get() in "ipa_uc.c" Replace the ipa_clock_get() call in ipa_uc_clock() when taking the "proxy" clock reference for the microcontroller with a call to pm_runtime_get_sync(). Replace calls of ipa_clock_put() for the microcontroller with pm_runtime_put() calls instead. There is a chance we get an error when taking the microcontroller power reference. This is an unlikely scenario, where system suspend is initiated just before we learn the modem is booting. For now we'll just accept that this could occur, and report it if it does. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c43adc75dc2dee8cc5a29a722c1c1d5a00b434c3 Author: Alex Elder Date: Thu Aug 19 17:19:24 2021 -0500 net: ipa: don't use ipa_clock_get() in "ipa_smp2p.c" If the "modem-init" Device Tree property is present for a platform, the modem performs early IPA hardware initialization, and signals this is complete with an "ipa-setup-ready" SMP2P interrupt. This triggers a call to ipa_setup(), which requires the hardware to be powered. Replace the call to ipa_clock_get() in this case with a call to pm_runtime_get_sync(). And replace the corresponding calls to ipa_clock_put() with calls to pm_runtime_put() instead. There is a chance we get an error when taking this power reference. This is an unlikely scenario, where system suspend is initiated just before the modem signals it has finished initializing the IPA hardware. For now we'll just accept that this could occur, and report it if it does. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4c6a4da84431415b1f451e2715a17487f9b3474e Author: Alex Elder Date: Thu Aug 19 17:19:23 2021 -0500 net: ipa: don't use ipa_clock_get() in "ipa_main.c" We need the hardware to be powered starting at the config stage of initialization when the IPA driver probes. And we need it powered when the driver is removed, at least until the deconfig stage has completed. Replace callers of ipa_clock_get() in ipa_probe() and ipa_exit(), calling pm_runtime_get_sync() instead. Replace the corresponding callers of ipa_clock_put(), calling pm_runtime_put() instead. The only error we expect when getting power would occur when the system is suspended. The ->probe and ->remove driver callbacks won't be called when suspended, so issue a WARN() call if an error is seen getting power. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit b8e36e13ea5e464414b3e6465045cf0689500448 Author: Alex Elder Date: Thu Aug 19 16:12:28 2021 -0500 net: ipa: fix TX queue race Jakub Kicinski pointed out a race condition in ipa_start_xmit() in a recently-accepted series of patches: https://lore.kernel.org/netdev/20210812195035.2816276-1-elder@linaro.org/ We are stopping the modem TX queue in that function if the power state is not active. We restart the TX queue again once hardware resume is complete. TX path Power Management ------- ---------------- pm_runtime_get(); no power Start resume Stop TX queue ... pm_runtime_put() Resume complete return NETDEV_TX_BUSY Start TX queue pm_runtime_get() Power present, transmit pm_runtime_put() (auto-suspend) The issue is that the power management (resume) activity and the network transmit activity can occur concurrently, and there's a chance the queue will be stopped *after* it has been started again. TX path Power Management ------- ---------------- Resume underway pm_runtime_get(); no power ... Resume complete Start TX queue Stop TX queue <-- No more transmits after this pm_runtime_put() return NETDEV_TX_BUSY We address this using a STARTED flag to indicate when the TX queue has been started from the resume path, and a spinlock to make the flag and queue updates happen atomically. TX path Power Management ------- ---------------- Resume underway pm_runtime_get(); no power Resume complete start TX queue \ If STARTED flag is *not* set: > atomic Stop TX queue set STARTED flag / pm_runtime_put() return NETDEV_TX_BUSY A second flag is used to address a different race that involves another path requesting power. TX path Other path Power Management ------- ---------- ---------------- pm_runtime_get_sync() Resume Start TX queue \ atomic Set STARTED flag / (do its thing) pm_runtime_put() (auto-suspend) pm_runtime_get() Mark delayed resume STARTED *is* set, so do *not* stop TX queue <-- Queue should be stopped here pm_runtime_put() return NETDEV_TX_BUSY Suspend done, resume Resume complete pm_runtime_get() Stop TX queue (STARTED is *not* set) Start TX queue \ atomic pm_runtime_put() Set STARTED flag / return NETDEV_TX_BUSY So a STOPPED flag is set in the transmit path when it has stopped the TX queue, and this pair of operations is also protected by the spinlock. The resume path only restarts the TX queue if the STOPPED flag is set. This case isn't a major problem, but it avoids the "non-trivial amount of useless work" done by the networking stack when NETDEV_TX_BUSY is returned. Fixes: 6b51f802d652b ("net: ipa: ensure hardware has power in ipa_start_xmit()") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 6505782c93bee97f2ea25330314056e0dbda6a6d Merge: f2aea90d0bf36 bbf6a2d92361a Author: David S. Miller Date: Fri Aug 20 14:39:52 2021 +0100 Merge branch 'ocelot-vlan' Vladimir Oltean says: ==================== Small ocelot VLAN improvements This small series propagates some VLAN restrictions via netlink extack and creates some helper functions instead of open-coding VLAN table manipulations from multiple places. This is split from the larger "DSA FDB isolation" series, hence the v2 tag: https://patchwork.kernel.org/project/netdevbpf/cover/20210818120150.892647-1-vladimir.oltean@nxp.com/ ==================== Signed-off-by: David S. Miller commit bbf6a2d92361a126f77a29f70a773736c5339f6d Author: Vladimir Oltean Date: Thu Aug 19 20:40:08 2021 +0300 net: mscc: ocelot: use helpers for port VLAN membership This is a mostly cosmetic patch that creates some helpers for accessing the VLAN table. These helpers are also a bit more careful in that they do not modify the ocelot->vlan_mask unless the hardware operation succeeded. Not all callers check the return value (the init code doesn't), but anyway. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3b95d1b29386dd4328e471fda2eee74b7fd4a4b3 Author: Vladimir Oltean Date: Thu Aug 19 20:40:07 2021 +0300 net: mscc: ocelot: transmit the VLAN filtering restrictions via extack We need to transmit more restrictions in future patches, convert this one to netlink extack. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 01af940e9be623c5492ddb8a5d7f02586fea1c5b Author: Vladimir Oltean Date: Thu Aug 19 20:40:06 2021 +0300 net: mscc: ocelot: transmit the "native VLAN" error via extack We need to reject some more configurations in future patches, convert the existing one to netlink extack. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f2aea90d0bf368bda6cd1c5a86fd84c7051b0e0e Merge: 42edc1fca4b5a 5c8bb71dbdf81 Author: David S. Miller Date: Fri Aug 20 14:36:42 2021 +0100 Merge branch 'ocelot-phylink-fixes' Vladimir Oltean says: ==================== Ocelot phylink fixes This series addresses a regression reported by Horatiu which introduced by the ocelot conversion to phylink: there are broken device trees in the wild, and the driver fails to probe the entire switch when a port fails to probe, which it previously did not do. Continue probing even when some ports fail to initialize properly. ==================== Signed-off-by: David S. Miller commit 5c8bb71dbdf816f9da7447557070d344edca8942 Author: Vladimir Oltean Date: Thu Aug 19 19:49:58 2021 +0300 net: mscc: ocelot: allow probing to continue with ports that fail to register The existing ocelot device trees, like ocelot_pcb123.dts for example, have SERDES ports (ports 4 and higher) that do not have status = "disabled"; but on the other hand do not have a phy-handle or a fixed-link either. So from the perspective of phylink, they have broken DT bindings. Since the blamed commit, probing for the entire switch will fail when such a device tree binding is encountered on a port. There used to be this piece of code which skipped ports without a phy-handle: phy_node = of_parse_phandle(portnp, "phy-handle", 0); if (!phy_node) continue; but now it is gone. Anyway, fixed-link setups are a thing which should work out of the box with phylink, so it would not be in the best interest of the driver to add that check back. Instead, let's look at what other drivers do. Since commit 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal"), DSA continues after a switch port fails to register, and works only with the ports that succeeded. We can achieve the same behavior in ocelot by unregistering the devlink port for ports where ocelot_port_phylink_create() failed (called via ocelot_probe_port), and clear the bit in devlink_ports_registered for that port. This will make the next iteration reconsider the port that failed to probe as an unused port, and re-register a devlink port of type UNUSED for it. No other cleanup should need to be performed, since ocelot_probe_port() should be self-contained when it fails. Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink") Reported-and-tested-by: Horatiu Vultur Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b5e33a1571580430ff4c7bd5b176d0450e9918db Author: Horatiu Vultur Date: Thu Aug 19 19:49:57 2021 +0300 net: mscc: ocelot: be able to reuse a devlink_port after teardown There are cases where we would like to continue probing the switch even if one port has failed to probe. When that happens, we need to unregister a devlink_port of type DEVLINK_PORT_FLAVOUR_PHYSICAL and re-register it of type DEVLINK_PORT_FLAVOUR_UNUSED. This is fine, except when calling devlink_port_attrs_set on a structure on which devlink_port_register has been previously called, there is a WARN_ON in devlink_port_attrs_set that devlink_port->devlink must be NULL. So don't assume that the memory behind dlp is clean when calling ocelot_port_devlink_init, just zero-initialize it. Signed-off-by: Horatiu Vultur Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 42edc1fca4b5a000e8e2c1e38f4e08a6b9f7bcb7 Merge: 6985157ce8ee8 860fe1f87eca4 Author: David S. Miller Date: Fri Aug 20 14:34:49 2021 +0100 Merge branch 'dpaa2-switch-phylikn-fixes' Vladimir Oltean says: ==================== dpaa2-switch phylink fixes This is fixing two regressions introduced by the recent conversion of the dpaa2-switch driver to phylink. ==================== Signed-off-by: David S. Miller commit 860fe1f87eca4a2dad9ef8a703f2d046db43c2bb Author: Vladimir Oltean Date: Thu Aug 19 17:40:19 2021 +0300 net: dpaa2-switch: call dpaa2_switch_port_disconnect_mac on probe error path Currently when probing returns an error, the netdev is freed but phylink_disconnect is not called. Create a common function between the unbind path and the error path, call it the opposite of dpaa2_switch_probe_port: dpaa2_switch_remove_port, and call it from both the unbind and the error path. Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Vladimir Oltean Reviewed-by: Ioana Ciornei Signed-off-by: David S. Miller commit d52ef12f7d6c016f3b249db95af33f725e3dd065 Author: Vladimir Oltean Date: Thu Aug 19 17:40:18 2021 +0300 net: dpaa2-switch: phylink_disconnect_phy needs rtnl_lock There is an ASSERT_RTNL in phylink_disconnect_phy which triggers whenever dpaa2_switch_port_disconnect_mac is called. To follow the pattern established by dpaa2_eth_disconnect_mac, take the rtnl_mutex every time we call dpaa2_switch_port_disconnect_mac. Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Vladimir Oltean Reviewed-by: Ioana Ciornei Signed-off-by: David S. Miller commit 60a1cd10b222e004f860d14651e80089c77e8e6b Author: Sven Peter Date: Thu Aug 12 12:09:42 2021 +0200 irqchip/apple-aic: Fix irq_disable from within irq handlers When disable_irq_nosync for an interrupt is called from within its interrupt handler, this interrupt is only marked as disabled with the intention to mask it when it triggers again. The AIC hardware however automatically masks the interrupt when it is read. aic_irq_eoi then unmasks it again if it's not disabled *and* not masked. This results in a state mismatch between the hardware state and the state kept in irq_data: The hardware interrupt is masked but IRQD_IRQ_MASKED is not set. Any further calls to unmask_irq will directly return and the interrupt can never be enabled again. Fix this by keeping the hardware and irq_data state in sync by unmasking in aic_irq_eoi if and only if the irq_data state also assumes the interrupt to be unmasked. Fixes: 76cde2639411 ("irqchip/apple-aic: Add support for the Apple Interrupt Controller") Signed-off-by: Sven Peter Acked-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210812100942.17206-1-sven@svenpeter.dev commit 6985157ce8ee8a02e3899226ac4df351387c3f52 Merge: 600003a364a80 ceaeaafc8b627 Author: David S. Miller Date: Fri Aug 20 14:31:46 2021 +0100 Merge branch 'gmii2rgmii-loopback' Gerhard Engleder says: ==================== Add Xilinx GMII2RGMII loopback support The Xilinx GMII2RGMII driver overrides PHY driver functions in order to configure the device according to the link speed of the PHY attached to it. This is implemented for a normal link but not for loopback. Andrew told me to use phy_loopback and this changes make phy_loopback work in combination with Xilinx GMII2RGMII. ==================== Signed-off-by: David S. Miller commit ceaeaafc8b6278930d9994e29d6826ee893cea65 Author: Gerhard Engleder Date: Thu Aug 19 15:11:54 2021 +0200 net: phy: gmii2rgmii: Support PHY loopback Configure speed if loopback is used. read_status is not called for loopback. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 3ac8eed62596387214869319379c1fcba264d8c6 Author: Gerhard Engleder Date: Thu Aug 19 15:11:53 2021 +0200 net: phy: Uniform PHY driver access struct phy_device contains a pointer to the PHY driver and nearly everywhere this pointer is used to access the PHY driver. Only mdio_bus_phy_may_suspend() is still using to_phy_driver() instead of the PHY driver pointer. Uniform PHY driver access by eliminating to_phy_driver() use in mdio_bus_phy_may_suspend(). Only phy_bus_match() and phy_probe() are still using to_phy_driver(), because PHY driver pointer is not available there. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 4ed311b08a91fe0a214714605d8159fc51166982 Author: Gerhard Engleder Date: Thu Aug 19 15:11:52 2021 +0200 net: phy: Support set_loopback override phy_read_status and various other PHY functions support PHY specific overriding of driver functions by using a PHY specific pointer to the PHY driver. Add support of PHY specific override to phy_loopback too. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 600003a364a8030b79f57ba54a3852abf95aafb0 Merge: f402303ba3ecb 920c293af8d01 Author: David S. Miller Date: Fri Aug 20 14:28:55 2021 +0100 Merge branch 'sparx5-dma' Steen Hegelund says: ==================== Adding Frame DMA functionality to Sparx5 v2: Removed an unused variable (proc_ctrl) from sparx5_fdma_start. This add frame DMA functionality to the Sparx5 platform. Until now the Sparx5 SwitchDev driver has been using register based injection and extraction when sending frames to/from the host CPU. With this series the Frame DMA functionality now added. The Frame DMA is only used if the Frame DMA interrupt is configured in the device tree; otherwise the existing register based injection and extraction is used. The Sparx5 has two ports that can be used for sending and receiving frames, but there are 8 channels that can be configured: 6 for injection and 2 for extraction. The additional channels can be used for more advanced scenarios e.g. where virtual cores are used, but currently the driver only uses port 0 and channel 0 and 6 respectively. DCB (data control block) structures are passed to the Frame DMA with suitable information about frame start/end etc, as well as pointers to DB (data blocks) buffers. The Frame DMA engine can use interrupts to signal back when the frames have been injected or extracted. There is a limitation on the DB alignment also for injection: Block must start on 16byte boundaries, and this is why the driver currently copies the data to into separate buffers. The Sparx5 switch core needs a IFH (Internal Frame Header) to pass information from the port to the switch core, and this header is added before injection and stripped after extraction. ==================== Signed-off-by: David S. Miller commit 920c293af8d01942caa10300ad97eabf778e8598 Author: Steen Hegelund Date: Thu Aug 19 09:39:40 2021 +0200 arm64: dts: sparx5: Add the Sparx5 switch frame DMA support This adds the interrupt for the Sparx5 Frame DMA. If this configuration is present the Sparx5 SwitchDev driver will use the Frame DMA feature, and if not it will use register based injection and extraction for sending and receiving frames to the CPU. Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit 10615907e9b51c9ae92f3a6ecabd01c482f20f32 Author: Steen Hegelund Date: Thu Aug 19 09:39:39 2021 +0200 net: sparx5: switchdev: adding frame DMA functionality This add frame DMA functionality to the Sparx5 platform. Ethernet frames can be extracted or injected autonomously to or from the device’s DDR3/DDR3L memory and/or PCIe memory space. Linked list data structures in memory are used for injecting or extracting Ethernet frames. The FDMA generates interrupts when frame extraction or injection is done and when the linked lists need updating. The FDMA implements two extraction channels, one per switch core port towards the VCore CPU system and a total of six injection channels. Extraction channels are mapped one-to-one to the CPU ports, while injection channels can be individually assigned to any CPU port. - FDMA channel 0 through 5 corresponds to CPU port 0 injection direction FDMA_CH_CFG[channel].CH_INJ_PORT is set to 0. - FDMA channel 0 through 5 corresponds to CPU port 1 injection direction when FDMA_CH_CFG[channel].CH_INJ_PORT is set to 1. - FDMA channel 6 corresponds to CPU port 0 extraction direction. - FDMA channel 7 corresponds to CPU port 1 extraction direction. The FDMA implements a strict priority scheme among channels. Extraction channels are prioritized over injection channels and secondarily channels with higher channel number are prioritized over channels with lower number. On the other hand, ports are being served on an equal-bandwidth principle both on injection and extraction directions. The equal-bandwidth principle will not force an equal bandwidth. Instead, it ensures that the ports perform at their best considering the operating conditions. When more than one injection channel is enabled for injection on the same CPU port, priority determines which channel can inject data. Ownership is re-arbitrated on frame boundaries. The FDMA processes linked lists of DMA Control Block Structures (DCBs). The DCBs have the same basic structure for both injection and extraction. A DCB must be placed on a 64-bit word-aligned address in memory. Each DCB has a per-channel configurable amount of associated data blocks in memory, where the frame data is stored. The data blocks that are used by extraction channels must be placed on 64-bit word aligned addresses in memory, and their length must be a multiple of 128 bytes. A DCB carries the pointer to the next DCB of the linked list, the INFO word which holds information for the DCB, and a pair of status word and memory pointer for every data block that it is associated with. Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit c4fdbf5ebaab1e5bd4a4eea8e9111902e5765528 Author: Rob Herring Date: Thu Aug 19 19:00:47 2021 -0500 dt-bindings: Output yamllint warnings to stderr yamllint warnings go to stdout which means on a quiet build no warnings are output. Fix this and redirect the yamllint output to stderr. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210820000047.1667819-1-robh@kernel.org commit bab94e97323baefe0afccad66e776f9c78b4f521 Author: Ulrich Spörlein Date: Sat Aug 14 17:52:14 2021 +0200 HID: sony: Fix more ShanWan clone gamepads to not rumble when plugged in. The device string on these can differ, apparently, including typos. I've bought 2 of these in 2012 and googling shows many folks out there with that broken spelling in their dmesg. Signed-off-by: Ulrich Spörlein Signed-off-by: Jiri Kosina commit a4bfe13f96bf8b1b2f233d16e960a3e0680d67fb Author: Daniel Nguyen Date: Tue Aug 10 10:09:32 2021 -0400 HID: sony: support for the ghlive ps4 dongles This commit adds support for the Guitar Hero Live PS4 dongles. These dongles require a "magic" USB control message to be sent every 8 seconds otherwise the dongle will not report events where the strumbar is hit while a fret is being held. Note that the GHL_GUITAR_POKE_INTERVAL is reduced to 8 seconds in order to support PS3, Wii U, and PS4 GHL dongles. Also note that the constant for vendor id 0x1430 has been renamed from Activision to RedOctane as self-declared by the device. Co-developed-by: Pascal Giard Signed-off-by: Pascal Giard Signed-off-by: Daniel Nguyen Signed-off-by: Jiri Kosina commit 462ba66198a4a8ea996028915af10a698086e302 Author: Lukas Bulwahn Date: Tue Aug 10 12:21:48 2021 +0200 HID: thrustmaster: clean up Makefile and adapt quirks Commit c49c33637802 ("HID: support for initialization of some Thrustmaster wheels") messed up the Makefile and quirks during the refactoring of this commit. Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs: HID_TMINIT Referencing files: drivers/hid/Makefile, drivers/hid/hid-quirks.c Following the discussion (see Link), CONFIG_HID_THRUSTMASTER is the intended config for CONFIG_HID_TMINIT and the file hid-tminit.c was actually added as hid-thrustmaster.c. So, clean up Makefile and adapt quirks to that refactoring. Fixes: c49c33637802 ("HID: support for initialization of some Thrustmaster wheels") Link: https://lore.kernel.org/linux-input/CAKXUXMx6dByO03f3dX0X5zjvQp0j2AhJBg0vQFDmhZUhtKxRxw@mail.gmail.com/ Signed-off-by: Lukas Bulwahn Signed-off-by: Jiri Kosina commit 786537063bbfb3a7ebc6fc21b2baf37fb91df401 Author: Jim Broadus Date: Sun Aug 8 23:55:05 2021 -0700 HID: i2c-hid: Fix Elan touchpad regression A quirk was recently added for Elan devices that has same device match as an entry earlier in the list. The i2c_hid_lookup_quirk function will always return the last match in the list, so the new entry shadows the old entry. The quirk in the previous entry, I2C_HID_QUIRK_BOGUS_IRQ, silenced a flood of messages which have reappeared in the 5.13 kernel. This change moves the two quirk flags into the same entry. Fixes: ca66a6770bd9 (HID: i2c-hid: Skip ELAN power-on command after reset) Signed-off-by: Jim Broadus Signed-off-by: Jiri Kosina commit 87c7ee7ad85afafc00f3ee70a61b0b5421584626 Author: Luke D. Jones Date: Sat Aug 7 14:49:21 2021 +1200 HID: asus: Prevent Claymore sending suspend event Prevent the ASUS Claymore keyboard from sending a suspend event when the device sleeps itself. The suspend event causes a system suspend if uncaught. Signed off by: Luke D Jones Signed-off-by: Jiri Kosina commit e665775591865f9f5c3ed6ff35d625a99795e4e0 Author: Basavaraj Natikar Date: Mon Aug 2 19:33:41 2021 +0530 HID: amd_sfh: Add dyndbg prints for debugging Add dynamic debug for debugging sensors states during initialization, stop, suspend and resume. Reviewed-by: Shyam Sundar S K Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 0873d1afacd2167e717ea751fe7274011cb4c26a Author: Basavaraj Natikar Date: Mon Aug 2 19:33:40 2021 +0530 HID: amd_sfh: Add support for PM suspend and resume Add support for power management routines. Reviewed-by: Shyam Sundar S K Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit ac15e9196f35d88b4d94bbcf3a5294ebb5622eb0 Author: Basavaraj Natikar Date: Mon Aug 2 19:33:39 2021 +0530 HID: amd_sfh: Move hid probe after sensor is enabled Earlier platforms don’t have sensor status checking mechanism. Sensors are always enabled without checking sensor status. Hence invoke hid probe only after the sensor is enabled by checking sensor status. Reviewed-by: Shyam Sundar S K Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 173709f50e98df4c49c2776834605a2f7ed3e681 Author: Basavaraj Natikar Date: Mon Aug 2 19:33:38 2021 +0530 HID: amd_sfh: Add command response to check command status Sometimes sensor enable/disable may take time, without checking the actual status bits from MP2 FW can lead the amd-sfh to misbehave. Hence add a status check of enable/disable command by waiting on the command response before sending the next command to FW. Reviewed-by: Shyam Sundar S K Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 3978f54817559b28535c58a00d3d31bbd5d0b65a Author: Basavaraj Natikar Date: Mon Aug 2 19:33:37 2021 +0530 HID: amd_sfh: Fix period data field to enable sensor Existing amd-sfh driver is programming the MP2 firmware period field in units of jiffies, but the MP2 firmware expects in milliseconds unit. Changing it to milliseconds. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Reviewed-by: Shyam Sundar S K Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 0c87f90b4c13586a00fbe63524c7be197609d8dc Author: Srikanth Thokala Date: Fri Aug 6 02:40:10 2021 +0530 PCI: keembay: Add support for Intel Keem Bay Add driver for Intel Keem Bay SoC PCIe controller. This controller is based on DesignWare PCIe core. In Root Complex mode, only internal reference clock is possible for Keem Bay A0. For Keem Bay B0, external reference clock can be used and will be the default configuration. Currently, keembay_pcie_of_data structure has one member. It will be expanded later to handle this difference. Endpoint mode link initialization is handled by the boot firmware. Link: https://lore.kernel.org/r/20210805211010.29484-3-srikanth.thokala@intel.com Signed-off-by: Wan Ahmad Zainie Signed-off-by: Srikanth Thokala Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński Reviewed-by: Rob Herring Acked-by: Andy Shevchenko commit 33d2f8e4ffd144a0b0c9968558820af0164a2d53 Author: Srikanth Thokala Date: Fri Aug 6 02:40:09 2021 +0530 dt-bindings: PCI: Add Intel Keem Bay PCIe controller Document DT bindings for PCIe controller found on Intel Keem Bay SoC. Link: https://lore.kernel.org/r/20210805211010.29484-2-srikanth.thokala@intel.com Signed-off-by: Wan Ahmad Zainie Signed-off-by: Srikanth Thokala Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 64f160e19e9264a7f6d89c516baae1473b6f8359 Author: Pali Rohár Date: Thu Jun 24 23:55:45 2021 +0200 PCI: aardvark: Configure PCIe resources from 'ranges' DT property In commit 6df6ba974a55 ("PCI: aardvark: Remove PCIe outbound window configuration") was removed aardvark PCIe outbound window configuration and commit description said that was recommended solution by HW designers. But that commit completely removed support for configuring PCIe IO resources without removing PCIe IO 'ranges' from DTS files. After that commit PCIe IO space started to be treated as PCIe MEM space and accessing it just caused kernel crash. Moreover implementation of PCIe outbound windows prior that commit was incorrect. It completely ignored offset between CPU address and PCIe bus address and expected that in DTS is CPU address always same as PCIe bus address without doing any checks. Also it completely ignored size of every PCIe resource specified in 'ranges' DTS property and expected that every PCIe resource has size 128 MB (also for PCIe IO range). Again without any check. Apparently none of PCIe resource has in DTS specified size of 128 MB. So it was completely broken and thanks to how aardvark mask works, configuration was completely ignored. This patch reverts back support for PCIe outbound window configuration but implementation is a new without issues mentioned above. PCIe outbound window is required when DTS specify in 'ranges' property non-zero offset between CPU and PCIe address space. To address recommendation by HW designers as specified in commit description of 6df6ba974a55, set default outbound parameters as PCIe MEM access without translation and therefore for this PCIe 'ranges' it is not needed to configure PCIe outbound window. For PCIe IO space is needed to configure aardvark PCIe outbound window. This patch fixes kernel crash when trying to access PCIe IO space. Link: https://lore.kernel.org/r/20210624215546.4015-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org # 6df6ba974a55 ("PCI: aardvark: Remove PCIe outbound window configuration") commit 770cec16cdc9d15555e67896dd2214a4fec9a3fa Author: Christophe Leroy Date: Fri Aug 20 09:39:14 2021 +0000 powerpc/audit: Simplify syscall_get_arch() Make use of is_32bit_task() and CONFIG_CPU_LITTLE_ENDIAN to simplify syscall_get_arch(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4be53b9187a4d8c163968f4d224267e41a7fcc33.1629451479.git.christophe.leroy@csgroup.eu commit 898a1ef06ad4a2a8e3c9490ce62624fcd1a7b1f8 Author: Christophe Leroy Date: Fri Aug 20 09:28:19 2021 +0000 powerpc/audit: Avoid unneccessary #ifdef in syscall_get_arguments() Use is_32bit_task() which already handles CONFIG_COMPAT. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ba49cdd574558a0363300c3f6b5b062b397cb071.1629451483.git.christophe.leroy@csgroup.eu commit 53f613134984c293af158920ebadcac045fa0545 Author: Yang Yingliang Date: Fri Aug 20 15:49:49 2021 +0800 iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group() Add the missing unlock before return from function arm_smmu_device_group() in the error handling case. Fixes: b1a1347912a7 ("iommu/arm-smmu: Fix race condition during iommu_group creation") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210820074949.1946576-1-yangyingliang@huawei.com Signed-off-by: Joerg Roedel commit b23cdfbddb73bad9d835baabd076ee4bfe1ab2bb Author: Hamza Mahfooz Date: Mon Aug 2 08:52:32 2021 -0400 HID: logitech-hidpp: battery: provide CAPACITY property for newer devices For devices that only support the BATTERY_VOLTAGE (0x1001) feature, UPower requires the additional information provided by this patch, to set them up. Signed-off-by: Hamza Mahfooz Reviewed-by: Filipe Laíns Signed-off-by: Jiri Kosina commit f402303ba3ecbcbd1ad1c61d33d144dfcbd0970f Merge: f96b48c621d2c a006aa51ea27f Author: David S. Miller Date: Fri Aug 20 13:28:38 2021 +0100 Merge tag 'batadv-next-pullrequest-20210820' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This (updated) cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - update docs about move IRC channel away from freenode, by Sven Eckelmann (updated, added missing sign-off) - Switch to kstrtox.h for kstrtou64, by Sven Eckelmann - Update NULL checks, by Sven Eckelmann (2 patches) - remove remaining skb-copy calls for broadcast packets, by Linus Lüssing ==================== Signed-off-by: David S. Miller commit c3800eed22d21c66912b4461a403b4448ed88d95 Author: Evgeny Novikov Date: Fri Jul 30 19:53:33 2021 +0300 HID: thrustmaster: Fix memory leak in thrustmaster_interrupts() thrustmaster_interrupts() does not free memory for send_buf when usb_interrupt_msg() fails. This is fixed by the given patch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Jiri Kosina commit df3a97bdbc252d3421f1c5d6d713ad6e4f36a469 Author: Evgeny Novikov Date: Fri Jul 30 19:51:09 2021 +0300 HID: thrustmaster: Fix memory leak in remove thrustmaster_remove() does not release memory for tm_wheel->change_request. This is fixed by the patch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Jiri Kosina commit d0f1d5ae23803bd82647a337fa508fa8615defc5 Author: Evgeny Novikov Date: Fri Jul 30 19:51:08 2021 +0300 HID: thrustmaster: Fix memory leaks in probe When thrustmaster_probe() handles errors of usb_submit_urb() it does not free allocated resources and fails. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Jiri Kosina commit fbf42729d0e91332e8ce75a1ecce08b8a2dab9c1 Author: Salah Triki Date: Thu Jul 29 01:45:12 2021 +0100 HID: elo: update the reference count of the usb device structure Use usb_get_dev() to increment the reference count of the usb device structure in order to avoid releasing the structure while it is still in use. And use usb_put_dev() to decrement the reference count and thus, when it will be equal to 0 the structure will be released. Signed-off-by: Salah Triki Signed-off-by: Jiri Kosina commit 46dcd1cc2b2fa43bd99f39c7c236d5cdb80522f0 Author: Christophe JAILLET Date: Fri Jul 23 17:41:52 2021 +0200 HID: logitech-hidpp: Use 'atomic_inc_return' instead of hand-writing it This function logs a warning if the workqueue gets too big. In order to save a few cycles, use 'atomic_inc_return()' instead of an 'atomic_inc()/atomic_read()' sequence. This axes a line of code and saves a 'atomic_read()' call. Signed-off-by: Christophe JAILLET Signed-off-by: Jiri Kosina commit b352ddae7b2ccd2cb29f495ca0a7c9b6848b623f Author: Cédric Le Goater Date: Thu Aug 19 14:56:54 2021 +0200 KVM: PPC: Book3S PR: Remove unused variable This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210819125656.14498-5-clg@kaod.org commit cb53a93e33e108bfec00a13cd12696e1c0ccc8b6 Author: Cédric Le Goater Date: Thu Aug 19 14:56:53 2021 +0200 KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr() This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210819125656.14498-4-clg@kaod.org commit 4cb266074aa17e9cafed3a92e9f43b161516569f Author: Cédric Le Goater Date: Thu Aug 19 14:56:52 2021 +0200 powerpc/pseries/vas: Declare pseries_vas_fault_thread_fn() as static This fixes a compile error with W=1. Fixes: 6d0aaf5e0de0 ("powerpc/pseries/vas: Setup IRQ and fault handling") Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210819125656.14498-3-clg@kaod.org commit e62ebf6253182642255a31320c99e539f25057f9 Author: Aswath Govindraju Date: Wed Aug 18 16:26:21 2021 +0530 dt-bindings: eeprom-93xx46: Convert to json schema Convert eeprom-93xx46 binding documentation from txt to yaml format Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20210818105626.31800-1-a-govindraju@ti.com Signed-off-by: Rob Herring commit 7a4697b201a617907e4b440ae34df601d4755bef Author: kernel test robot Date: Wed Jul 14 03:10:04 2021 +0800 spi: stm32: fix excluded_middle.cocci warnings drivers/spi/spi-stm32.c:915:23-25: WARNING !A || A && B is equivalent to !A || B Condition !A || A && B is equivalent to !A || B. Generated by: scripts/coccinelle/misc/excluded_middle.cocci Fixes: 7ceb0b8a3ced ("spi: stm32: finalize message either on dma callback or EOT") CC: Alain Volmat Reported-by: kernel test robot Signed-off-by: kernel test robot Reviewed-by: Alain Volmat Link: https://lore.kernel.org/r/20210713191004.GA14729@5eb5c2cbef84 Signed-off-by: Mark Brown commit cc64c390b215b404524725a94857d6fb58d9a62a Author: Kuninori Morimoto Date: Fri Aug 20 13:08:26 2021 +0900 ASoC: rsnd: adg: clearly handle clock error / NULL case This driver is assuming that all adg->clk[i] is not NULL. Because of this prerequisites, for_each_rsnd_clk() is possible to work for all clk without checking NULL. In other words, all adg->clk[i] should not NULL. Some SoC might doesn't have clk_a/b/c/i. devm_clk_get() returns error in such case. This driver calls rsnd_adg_null_clk_get() and use null_clk instead of NULL in such cases. But devm_clk_get() might returns NULL even though such clocks exist, but it doesn't mean error (user deliberately chose to disable the feature). NULL clk itself is not error from clk point of view, but is error from this driver point of view because it is not assuming such case. But current code is using IS_ERR() which doesn't care NULL. This driver uses IS_ERR_OR_NULL() instead of IS_ERR() for clk check. And it uses ERR_CAST() to clarify null_clk error. One concern here is that it unconditionally uses null_clk if clk_a/b/c/i was error. It is correct if it doesn't exist, but is not correct if it returns error even though it exist. It needs to check "clock-names" from DT before calling devm_clk_get() to handling such case. But let's assume it is overkill so far. Link: https://lore.kernel.org/r/YMCmhfQUimHCSH/n@mwanda Reported-by: Dan Carpenter Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87v940wyf9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 28889de643cd14617e28f862e6763754ad28f7c4 Author: Kuninori Morimoto Date: Fri Aug 20 13:09:14 2021 +0900 ASoC: rsnd: core: make some arrays static const, makes object smaller Don't populate arrays on the stack but instead them static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 20938 916 104 21958 55c6 ./sound/soc/sh/rcar/core.o After: text data bss dec hex filename 20890 916 104 21910 5596 ./sound/soc/sh/rcar/core.o gcc version 11.1.0) Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tujkwydx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit f96b48c621d2cac276cd08fbf24db64e983c85bd Merge: e61fbee7be4b9 3202ea65f85c5 Author: David S. Miller Date: Fri Aug 20 12:49:04 2021 +0100 Merge tag 'mlx5-updates-2021-08-19' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2021-08-19 This series introduces the support for two new mlx5 features: 1) Sample offload for tunneled traffic 2) devlink rate objects support 1) From Chris Mi: Sample offload for tunneled traffic ===================================================== Background and solution ----------------------- Currently the sample offload actions send the encapsulated packet to software. This series de-capsulates the packet before performing the sampling and set the tunnel properties on the skb metadata fields to make the behavior consistent with OVS sFlow. If de-capsulating first, we can't use the same match like before in default table. So instantiate a post action instance to continue processing the action list. If HW can preserve reg_c, also use the post action instance. Post action infrastructure -------------------------- Some tc actions are modeled in hardware using multiple tables causing a tc action list split. For example, CT action is modeled by jumping to a ct table which is controlled by nf flow table. sFlow jumps in hardware to a sample table, which continues to a "default table" where it should continue processing the action list. Multi table actions are modeled in hardware using a unique fte_id. The fte_id is set before jumping to a table. Split actions continue to a post-action table where the matched fte_id value continues the execution the tc action list. This series also introduces post action infrastructure. Both ct and sample use it. Sample for tunnel in TC SW -------------------------- tc filter add dev vxlan1 protocol ip parent ffff: prio 3 \ flower src_mac 24:25:d0:e1:00:00 dst_mac 02:25:d0:13:01:02 \ enc_src_ip 192.168.1.14 enc_dst_ip 192.168.1.13 \ enc_dst_port 4789 enc_key_id 4 \ action sample rate 1 group 6 \ action tunnel_key unset \ action mirred egress redirect dev enp4s0f0_1 MLX5 sample HW offload ---------------------- For the following typical flow table: +-------------------------------+ + original flow table + +-------------------------------+ + original match + +-------------------------------+ + sample action + other actions + +-------------------------------+ We translate the tc filter with sample action to the following HW model: +---------------------+ + original flow table + +---------------------+ + original match + +---------------------+ | set fte_id (if reg_c preserve cap) | do decap v +------------------------------------------------+ + Flow Sampler Object + +------------------------------------------------+ + sample ratio + +------------------------------------------------+ + sample table id | default table id + +------------------------------------------------+ | | v v +-----------------------------+ +-------------------+ + sample table + + default table + +-----------------------------+ +-------------------+ + forward to management vport + | +-----------------------------+ | +-------+------+ | |reg_c preserve cap | |or decap action v v +-----------------+ +-------------+ + per vport table + + post action + +-----------------+ +-------------+ + original match + +-----------------+ + other actions + +-----------------+ 2) From Dmytro Linkin: devlink rate object support for mlx5_core driver ======================================================================= HIGH-LEVEL OVERVIEW Devlink leaf rate objects created per vport (VF/SF, and PF on BlueField) in switchdev mode on devlink port registration. Implement devlink ops callbacks to create/destroy rate groups, set TX rate values of the vport/group, assign vport to the group. Driver accepts TX rate values as fraction of 1Mbps. Refactor existing eswitch QoS infrastructure to be accessible by legacy NDO rate API and new devlink rate API. NDO rate API is not removed/disabled in switchdev mode to not break existing users. Rate values configured with NDO rate API are not visible for devlink infrastructure, therefore APIs should not be used simultaneously. IMPLEMENTATION DETAILS Driver provide two level rate hierarchy to manage bandwidth - group level and vport level. Initially each vport added to internal unlimited group created by default. Each rate element (vport or group) receive bandwidth relative to its parent element (for groups the parent is a physical link itself) in a Round Robin manner, where element get bandwidth value according to its weight. Example: Created four rate groups with tx_share limits: $ devlink port function rate add \ pci/0000:06:00.0/group_1 tx_share 30gbit $ devlink port function rate add \ pci/0000:06:00.0/group_2 tx_share 20gbit $ devlink port function rate add \ pci/0000:06:00.0/group_3 tx_share 20gbit $ devlink port function rate add \ pci/0000:06:00.0/group_4 tx_share 10gbit Weights created in HW for each group are relative to the bigest tx_share value, which is 30gbit: 1.0 0.67 0.67 0.33 Assuming link speed is 50 Gbit/sec and each group can sustain such amount of traffic, maximum bandwidth is 50 / (1.0 + 0.67 + 0.67 + 0.33) = ~18.75 Gbit/sec. Normilized bandwidth values for groups: 18.75 * 1.0 = 18.75 Gbit/sec 18.75 * 0.67 = 12.5 Gbit/sec 18.75 * 0.67 = 12.5 Gbit/sec 18.75 * 0.33 = 6.25 Gbit/sec If in example above group_1 doesn't produce any traffic, then maximum bandwidth becomes 50 / (0.67 + 0.67 + 0.33) = ~30.0 Gbit/sec. Normalized values: 30.0 * 0.67 = 20.0 Gbit/sec 30.0 * 0.67 = 20.0 Gbit/sec 30.0 * 0.33 = 10.0 Gbit/sec Same normalization applied to each vport in the group. Normalized values are internal, therefore driver provides QoS tracepoints for next events: * vport rate element creation/deletion: * vport rate element configuration; * group rate element creation/deletion; * group rate element configuration. PATCHES OVERVIEW 1 - Moving and isolation of eswitch QoS logic in separate file; 2 - Implement devlink leaf rate object support for vports; 3 - Implement rate groups creation/deletion; 4 - Implement TX rate management for the groups; 5 - Implement parent set for vports; 6 - Eswitch QoS tracepoints. ==================== Signed-off-by: David S. Miller commit 7c7b363d62a51eea987ba63fc916ff8d6f89df0e Merge: deb151a58210d 411d63d8c64c2 Author: Marc Zyngier Date: Fri Aug 20 12:23:53 2021 +0100 Merge branch kvm-arm64/pkvm-fixed-features-prologue into kvmarm-master/next * kvm-arm64/pkvm-fixed-features-prologue: : Rework a bunch of common infrastructure as a prologue : to Fuad Tabba's protected VM fixed feature series. KVM: arm64: Upgrade trace_kvm_arm_set_dreg32() to 64bit KVM: arm64: Add config register bit definitions KVM: arm64: Add feature register flag definitions KVM: arm64: Track value of cptr_el2 in struct kvm_vcpu_arch KVM: arm64: Keep mdcr_el2's value as set by __init_el2_debug KVM: arm64: Restore mdcr_el2 from vcpu KVM: arm64: Refactor sys_regs.h,c for nVHE reuse KVM: arm64: Fix names of config register fields KVM: arm64: MDCR_EL2 is a 64-bit register KVM: arm64: Remove trailing whitespace in comment KVM: arm64: placeholder to check if VM is protected Signed-off-by: Marc Zyngier commit deb151a58210d8dfb1a7cc1f14fec35b520c38a6 Merge: ca3385a507ad9 cf364e08ea1c5 Author: Marc Zyngier Date: Fri Aug 20 12:23:15 2021 +0100 Merge branch kvm-arm64/mmu/vmid-cleanups into kvmarm-master/next * kvm-arm64/mmu/vmid-cleanups: : Cleanup the stage-2 configuration by providing a single helper, : and tidy up some of the ordering requirements for the VMID : allocator. KVM: arm64: Upgrade VMID accesses to {READ,WRITE}_ONCE KVM: arm64: Unify stage-2 programming behind __load_stage2() KVM: arm64: Move kern_hyp_va() usage in __load_guest_stage2() into the callers Signed-off-by: Marc Zyngier commit ca3385a507ad918fb8b7a6a52ad3d321601a66f2 Merge: 78bc117095cc3 6caa5812e2d12 Author: Marc Zyngier Date: Fri Aug 20 12:23:09 2021 +0100 Merge branch kvm-arm64/generic-entry into kvmarm-master/next Switch KVM/arm64 to the generic entry code, courtesy of Oliver Upton * kvm-arm64/generic-entry: KVM: arm64: Use generic KVM xfer to guest work function entry: KVM: Allow use of generic KVM entry w/o full generic support KVM: arm64: Record number of signal exits as a vCPU stat Signed-off-by: Marc Zyngier commit 78bc117095cc30408e2131e81757a6659ac4b002 Merge: cf0c7125d5783 cb97cf95c4402 Author: Marc Zyngier Date: Fri Aug 20 12:23:02 2021 +0100 Merge branch kvm-arm64/psci/cpu_on into kvmarm-master/next PSCI fixes from Oliver Upton: - Plug race on reset - Ensure that a pending reset is applied before userspace accesses - Reject PSCI requests with illegal affinity bits * kvm-arm64/psci/cpu_on: selftests: KVM: Introduce psci_cpu_on_test KVM: arm64: Enforce reserved bits for PSCI target affinities KVM: arm64: Handle PSCI resets before userspace touches vCPU state KVM: arm64: Fix read-side race on updates to vcpu reset state Signed-off-by: Marc Zyngier commit cf0c7125d5783f93b78921845d4b101c65a7998b Merge: 82f8d543674c2 14ecf075fe5be Author: Marc Zyngier Date: Fri Aug 20 12:17:13 2021 +0100 Merge branch kvm-arm64/mmu/el2-tracking into kvmarm-master/next * kvm-arm64/mmu/el2-tracking: (25 commits) : Enable tracking of page sharing between host EL1 and EL2 KVM: arm64: Minor optimization of range_is_memory KVM: arm64: Make hyp_panic() more robust when protected mode is enabled KVM: arm64: Return -EPERM from __pkvm_host_share_hyp() KVM: arm64: Make __pkvm_create_mappings static KVM: arm64: Restrict EL2 stage-1 changes in protected mode KVM: arm64: Refactor protected nVHE stage-1 locking KVM: arm64: Remove __pkvm_mark_hyp KVM: arm64: Mark host bss and rodata section as shared KVM: arm64: Enable retrieving protections attributes of PTEs KVM: arm64: Introduce addr_is_memory() KVM: arm64: Expose pkvm_hyp_id KVM: arm64: Expose host stage-2 manipulation helpers KVM: arm64: Add helpers to tag shared pages in SW bits KVM: arm64: Allow populating software bits KVM: arm64: Enable forcing page-level stage-2 mappings KVM: arm64: Tolerate re-creating hyp mappings to set software bits KVM: arm64: Don't overwrite software bits with owner id KVM: arm64: Rename KVM_PTE_LEAF_ATTR_S2_IGNORED KVM: arm64: Optimize host memory aborts KVM: arm64: Expose page-table helpers ... Signed-off-by: Marc Zyngier commit e61fbee7be4b9566f8e8fcb15aadad0f17936c31 Merge: 815cc21d8d2e4 61969ef867d48 Author: David S. Miller Date: Fri Aug 20 12:16:05 2021 +0100 Merge tag 'for-net-next-2021-08-19' 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 Foxconn Mediatek Chip - Add support for LG LGSBWAC92/TWCM-K505D - hci_h5 flow control fixes and suspend support - Switch to use lock_sock for SCO and RFCOMM - Various fixes for extended advertising - Reword Intel's setup on btusb unifying the supported generations ==================== Signed-off-by: David S. Miller commit 82f8d543674c24be96f279d075721e0c1c6828c1 Merge: 3ce5db8a59779 47e6223c841e0 Author: Marc Zyngier Date: Fri Aug 20 12:15:13 2021 +0100 Merge branch kvm-arm64/mmu/kmemleak-pkvm into kvmarm-master/next Prevent kmemleak from peeking into the HYP data, which is fatal in protected mode. * kvm-arm64/mmu/kmemleak-pkvm: KVM: arm64: Unregister HYP sections from kmemleak in protected mode arm64: Move .hyp.rodata outside of the _sdata.._edata range Signed-off-by: Marc Zyngier commit 3ce5db8a597794c0d0be2a319a0923c6fe81c899 Merge: 2d84f3ce5e980 6e73bc90ec447 Author: Marc Zyngier Date: Fri Aug 20 12:14:56 2021 +0100 Merge branch kvm-arm64/misc-5.15 into kvmarm-master/next * kvm-arm64/misc-5.15: : Misc improvements for 5.15: : : - Account the number of VMID-wide TLB invalidations as : remote TLB flushes : - Fix comments in the VGIC code : - Cleanup the PMU IMPDEF identification : - Streamline the TGRAN2 usage : - Avoid advertising a 52bit IPA range for non-64KB configs : - Avoid spurious signalling when a HW-mapped interrupt is in the : A+P state on entry, and in the P state on exit, but that the : physical line is not pending anymore. : - Bunch of minor cleanups KVM: arm64: vgic: Resample HW pending state on deactivation KVM: arm64: vgic: Drop WARN from vgic_get_irq KVM: arm64: Drop unused REQUIRES_VIRT KVM: arm64: Drop check_kvm_target_cpu() based percpu probe KVM: arm64: Drop init_common_resources() KVM: arm64: Use ARM64_MIN_PARANGE_BITS as the minimum supported IPA arm64/mm: Add remaining ID_AA64MMFR0_PARANGE_ macros KVM: arm64: Restrict IPA size to maximum 48 bits on 4K and 16K page size arm64/mm: Define ID_AA64MMFR0_TGRAN_2_SHIFT KVM: arm64: perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF KVM: arm64: Fix comments related to GICv2 PMR reporting KVM: arm64: Count VMID-wide TLB invalidations arm64/kexec: Test page size support with new TGRAN range values Signed-off-by: Marc Zyngier commit 2d84f3ce5e9802f3e47aa224724d42cb8c9abd71 Merge: a4516f32f0e60 36c3ce6c0d03a Author: Marc Zyngier Date: Fri Aug 20 12:14:40 2021 +0100 Merge branch kvm-arm64/mmu/mapping-levels into kvmarm-master/next Revamp the KVM/arm64 THP code by parsing the userspace page tables instead of relying on an infrastructure that is about to disappear (we are the last user). * kvm-arm64/mmu/mapping-levels: KVM: Get rid of kvm_get_pfn() KVM: arm64: Use get_page() instead of kvm_get_pfn() KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap() KVM: arm64: Avoid mapping size adjustment on permission fault KVM: arm64: Walk userspace page tables to compute the THP mapping size KVM: arm64: Introduce helper to retrieve a PTE and its level Signed-off-by: Marc Zyngier commit a4516f32f0e60c26c20f137417e2ec64de0abcbb Merge: c500bee1c5b2f 7a3ba3095a32f Author: Marc Zyngier Date: Fri Aug 20 12:14:12 2021 +0100 Merge branch kvm-arm64/pmu/reset-values into kvmarm-master/next Fix the reset values for our PMU emulation. As a side effect, it allows a nice optimisation by only tracking the in-use counters when flipping them on and off, now that we are guaranteed not to have any spurious bit set. * kvm-arm64/pmu/reset-values: KVM: arm64: Remove PMSWINC_EL0 shadow register KVM: arm64: Disabling disabled PMU counters wastes a lot of time KVM: arm64: Drop unnecessary masking of PMU registers KVM: arm64: Narrow PMU sysreg reset values to architectural requirements Signed-off-by: Marc Zyngier commit 0c69bd2ca6ee20064dde7853cd749284e053a874 Author: Mark Brown Date: Thu Aug 19 17:57:23 2021 +0100 kselftest/arm64: pac: Fix skipping of tests on systems without PAC The PAC tests check to see if the system supports the relevant PAC features but instead of skipping the tests if they can't be executed they fail the tests which makes things look like they're not working when they are. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819165723.43903-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 815cc21d8d2e47c2d00caf3cd4cddcf0b5b07292 Merge: f444fea7896db 808cfdfad5799 Author: David S. Miller Date: Fri Aug 20 12:04:50 2021 +0100 Merge tag 'batadv-next-pullrequest-20210819' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - update docs about move IRC channel away from freenode, by Sven Eckelmann - Switch to kstrtox.h for kstrtou64, by Sven Eckelmann - Update NULL checks, by Sven Eckelmann (2 patches) - remove remaining skb-copy calls for broadcast packets, by Linus Lüssing ==================== Signed-off-by: David S. Miller commit 14ecf075fe5be01860927fdf3aa11d7b18023ab2 Author: David Brazdil Date: Wed Jul 28 15:32:32 2021 +0000 KVM: arm64: Minor optimization of range_is_memory Currently range_is_memory finds the corresponding struct memblock_region for both the lower and upper bounds of the given address range with two rounds of binary search, and then checks that the two memblocks are the same. Simplify this by only doing binary search on the lower bound and then checking that the upper bound is in the same memblock. Signed-off-by: David Brazdil Reviewed-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210728153232.1018911-3-dbrazdil@google.com commit fb1c16c0aea805500ea62f007a92ea10945e3b63 Merge: ccac96977243d c4d7c51845af9 Author: Marc Zyngier Date: Fri Aug 20 11:57:10 2021 +0100 Merge tag 'kvmarm-fixes-5.14-2' into kvm-arm64/mmu/el2-tracking KVM/arm64 fixes for 5.14, take #2 - Plug race between enabling MTE and creating vcpus - Fix off-by-one bug when checking whether an address range is RAM Signed-off-by: Marc Zyngier commit 6e73bc90ec447b8fcec5fd22fa49e100f3b4f909 Merge: 3134cc8beb69d 79d82cbcbb3d2 Author: Marc Zyngier Date: Fri Aug 20 11:49:23 2021 +0100 Merge branch arm64/for-next/sysreg into kvm-arm64/misc-5.15 Merge the arm64/for-next/sysreg branch to avoid merge conflicts in -next and upstream. * arm64/for-next/sysreg: arm64/kexec: Test page size support with new TGRAN range values Signed-off-by: Marc Zyngier commit 6c974e79d37608bc8fd5cf6b61b4233b82b60428 Author: Geert Uytterhoeven Date: Wed Aug 11 10:27:02 2021 +0100 ARM: 9118/1: div64: Remove always-true __div64_const32_is_OK() duplicate Since commit cafa0010cd51fb71 ("Raise the minimum required gcc version to 4.6"), the kernel can no longer be compiled using gcc-3. Hence __div64_const32_is_OK() is always true. Moreover, __div64_const32_is_OK() is defined in the same way in include/asm-generic/div64.h, so the ARM-specific definition can be removed regardless. Signed-off-by: Geert Uytterhoeven Signed-off-by: Russell King (Oracle) commit c747ce4706190ef40634dd1366efc75a42415f05 Author: Geert Uytterhoeven Date: Wed Aug 11 10:27:04 2021 +0100 ARM: 9117/1: asm-generic: div64: Remove always-true __div64_const32_is_OK() Since commit cafa0010cd51fb71 ("Raise the minimum required gcc version to 4.6"), the kernel can no longer be compiled using gcc-3. Hence __div64_const32_is_OK() is always true, and the corresponding check can thus be removed. While at it, remove the whitespace error that hurts my eyes, and add the missing curly braces for the final else statement, as per coding style. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 88210317eec69d8c06cac6d6751528160e153ffd Author: Geert Uytterhoeven Date: Wed Aug 11 10:27:03 2021 +0100 ARM: 9116/1: unified: Remove check for gcc < 4 Since commit cafa0010cd51fb71 ("Raise the minimum required gcc version to 4.6"), the kernel can no longer be compiled using gcc-3. Hence this condition is never true, and the check can thus be removed. Signed-off-by: Geert Uytterhoeven Signed-off-by: Russell King (Oracle) commit da0b9ee43c152401f711e522c19b1468c84907bf Author: Arnd Bergmann Date: Wed Aug 11 08:30:27 2021 +0100 ARM: 9110/1: oabi-compat: fix oabi epoll sparse warning As my patches change the oabi epoll definition, I received a report from the kernel test robot about a pre-existing issue with a mismatched __poll_t type. The OABI code was correct when it was initially added in linux-2.16, but a later (also correct) change to the generic __poll_t triggered a type mismatch warning from sparse. As __poll_t is always 32-bit bits wide and otherwise compatible, using this instead of __u32 in the oabi_epoll_event definition is a valid workaround. Reported-by: kernel test robot Fixes: 8ced390c2b18 ("define __poll_t, annotate constants") Fixes: ee219b946e4b ("uapi: turn __poll_t sparse checks on by default") Fixes: 687ad0191488 ("[ARM] 3109/1: old ABI compat: syscall wrappers for ABI impedance matching") Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 8ac6f5d7f84bf362e67591708bcb9788cdc42c50 Author: Arnd Bergmann Date: Wed Aug 11 08:30:26 2021 +0100 ARM: 9113/1: uaccess: remove set_fs() implementation There are no remaining callers of set_fs(), so just remove it along with all associated code that operates on thread_info->addr_limit. There are still further optimizations that can be done: - In get_user(), the address check could be moved entirely into the out of line code, rather than passing a constant as an argument, - I assume the DACR handling can be simplified as we now only change it during user access when CONFIG_CPU_SW_DOMAIN_PAN is set, but not during set_fs(). Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 2df4c9a741a0b5e2883cc356c1b724d1f739fb55 Author: Arnd Bergmann Date: Wed Aug 11 08:30:25 2021 +0100 ARM: 9112/1: uaccess: add __{get,put}_kernel_nofault These mimic the behavior of get_user and put_user, except for domain switching, address limit checking and handling of mismatched sizes, none of which are relevant here. To work with pre-Armv6 kernels, this has to avoid TUSER() inside of the new macros, the new approach passes the "t" string along with the opcode, which is a bit uglier but avoids duplicating more code. As there is no __get_user_asm_dword(), I work around it by copying 32 bit at a time, which is possible because the output size is known. Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 7e2d8c29ecdd86afbcedb9d9a977bab8af527add Author: Arnd Bergmann Date: Wed Aug 11 08:30:24 2021 +0100 ARM: 9111/1: oabi-compat: rework fcntl64() emulation This is one of the last users of get_fs(), and this is fairly easy to change, since the infrastructure for it is already there. The replacement here is essentially a copy of the existing fcntl64() syscall entry function. Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit bdec0145286f7e6be9b3134aa35f0f335fa27c38 Author: Arnd Bergmann Date: Wed Aug 11 08:30:23 2021 +0100 ARM: 9114/1: oabi-compat: rework sys_semtimedop emulation sys_oabi_semtimedop() is one of the last users of set_fs() on Arm. To remove this one, expose the internal code of the actual implementation that operates on a kernel pointer and call it directly after copying. There should be no measurable impact on the normal execution of this function, and it makes the overly long function a little shorter, which may help readability. While reworking the oabi version, make it behave a little more like the native one, using kvmalloc_array() and restructure the code flow in a similar way. The naming of __do_semtimedop() is not very good, I hope someone can come up with a better name. One regression was spotted by kernel test robot and fixed before the first mailing list submission. Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 249dbe74d3c4b568a623fb55c56cddf19fdf0b89 Author: Arnd Bergmann Date: Wed Aug 11 08:30:22 2021 +0100 ARM: 9108/1: oabi-compat: rework epoll_wait/epoll_pwait emulation The epoll_wait() system call wrapper is one of the remaining users of the set_fs() infrasturcture for Arm. Changing it to not require set_fs() is rather complex unfortunately. The approach I'm taking here is to allow architectures to override the code that copies the output to user space, and let the oabi-compat implementation check whether it is getting called from an EABI or OABI system call based on the thread_info->syscall value. The in_oabi_syscall() check here mirrors the in_compat_syscall() and in_x32_syscall() helpers for 32-bit compat implementations on other architectures. Overall, the amount of code goes down, at least with the newly added sys_oabi_epoll_pwait() helper getting removed again. The downside is added complexity in the source code for the native implementation. There should be no difference in runtime performance except for Arm kernels with CONFIG_OABI_COMPAT enabled that now have to go through an external function call to check which of the two variants to use. Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 4e57a4ddf6b0d9cce1cf2ffd153df1ad3c2c9cc2 Author: Arnd Bergmann Date: Wed Aug 11 08:30:21 2021 +0100 ARM: 9107/1: syscall: always store thread_info->abi_syscall The system call number is used in a a couple of places, in particular ptrace, seccomp and /proc//syscall. The last one apparently never worked reliably on ARM for tasks that are not currently getting traced. Storing the syscall number in the normal entry path makes it work, as well as allowing us to see if the current system call is for OABI compat mode, which is the next thing I want to hook into. Since the thread_info->syscall field is not just the number any more, it is now renamed to abi_syscall. In kernels that enable both OABI and EABI, the upper bits of this field encode 0x900000 (__NR_OABI_SYSCALL_BASE) for OABI tasks, while normal EABI tasks do not set the upper bits. This makes it possible to implement the in_oabi_syscall() helper later. All other users of thread_info->syscall go through the syscall_get_nr() helper, which in turn filters out the ABI bits. Note that the ABI information is lost with PTRACE_SET_SYSCALL, so one cannot set the internal number to a particular version, but this was already the case. We could change it to let gdb encode the ABI type along with the syscall in a CONFIG_OABI_COMPAT-enabled kernel, but that itself would be a (backwards-compatible) ABI change, so I don't do it here. Acked-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit b6e47f3c11c17965acb2a12001af3b1cd5658f37 Author: Arnd Bergmann Date: Wed Aug 11 08:30:20 2021 +0100 ARM: 9109/1: oabi-compat: add epoll_pwait handler The epoll_wait() syscall has a special version for OABI compat mode to convert the arguments to the EABI structure layout of the kernel. However, the later epoll_pwait() syscall was added in arch/arm in linux-2.6.32 without this conversion. Use the same kind of handler for both. Fixes: 369842658a36 ("ARM: 5677/1: ARM support for TIF_RESTORE_SIGMASK/pselect6/ppoll/epoll_pwait") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 344179fc7ef427910de438affbf3703fed51fe5a Author: Arnd Bergmann Date: Wed Aug 11 08:30:19 2021 +0100 ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs() ARM uses set_fs() and __get_user() to allow the stack dumping code to access possibly invalid pointers carefully. These can be changed to the simpler get_kernel_nofault(), and allow the eventual removal of set_fs(). dump_instr() will print either kernel or user space pointers, depending on how it was called. For dump_mem(), I assume we are only interested in kernel pointers, and the only time that this is called with user_mode(regs)==true is when the regs themselves are unreliable as a result of the condition that caused the trap. Reviewed-by: Christoph Hellwig Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 2423de2e6f4d8676b6f6e43dee437461023ca6a1 Author: Arnd Bergmann Date: Wed Aug 11 08:30:18 2021 +0100 ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault On machines such as ARMv5 that trap unaligned accesses, these two functions can be slow when each access needs to be emulated, or they might not work at all. Change them so that each loop is only used when both the src and dst pointers are naturally aligned. Reviewed-by: Christoph Hellwig Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 99409b935c9ac5ea36ab5218954115c52449234d Author: Xiaoming Ni Date: Mon Aug 9 10:12:15 2021 +0800 locking/semaphore: Add might_sleep() to down_*() family Semaphore is sleeping lock. Add might_sleep() to down*() family (with exception of down_trylock()) to detect atomic context sleep. Signed-off-by: Xiaoming Ni Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210809021215.19991-1-nixiaoming@huawei.com commit 702f43872665e3b1cc6fdb77d238533274fc9d18 Author: Will Deacon Date: Fri Jul 30 12:24:43 2021 +0100 Documentation: arm64: describe asymmetric 32-bit support Document support for running 32-bit tasks on asymmetric 32-bit systems and its impact on the user ABI when enabled. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210730112443.23245-17-will@kernel.org commit 94f9c00f6460c0b175226c8fe6fd137547b239bd Author: Will Deacon Date: Fri Jul 30 12:24:42 2021 +0100 arm64: Remove logic to kill 32-bit tasks on 64-bit-only cores The scheduler now knows enough about these braindead systems to place 32-bit tasks accordingly, so throw out the safety checks and allow the ret-to-user path to avoid do_notify_resume() if there is nothing to do. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210730112443.23245-16-will@kernel.org commit ead7de462ae56b2d2e56fb5a414f6e916dddc4c9 Author: Will Deacon Date: Fri Jul 30 12:24:41 2021 +0100 arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 Allow systems with mismatched 32-bit support at EL0 to run 32-bit applications based on a new kernel parameter. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210730112443.23245-15-will@kernel.org commit 7af33504d1c8077b40121294b5eb6e680a859468 Author: Will Deacon Date: Fri Jul 30 12:24:40 2021 +0100 arm64: Advertise CPUs capable of running 32-bit applications in sysfs Since 32-bit applications will be killed if they are caught trying to execute on a 64-bit-only CPU in a mismatched system, advertise the set of 32-bit capable CPUs to userspace in sysfs. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Greg Kroah-Hartman Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210730112443.23245-14-will@kernel.org commit df950811f4a884d08f05e22a8e0089d54bb4ba70 Author: Will Deacon Date: Fri Jul 30 12:24:39 2021 +0100 arm64: Prevent offlining first CPU with 32-bit EL0 on mismatched system If we want to support 32-bit applications, then when we identify a CPU with mismatched 32-bit EL0 support we must ensure that we will always have an active 32-bit CPU available to us from then on. This is important for the scheduler, because is_cpu_allowed() will be constrained to 32-bit CPUs for compat tasks and forced migration due to a hotplug event will hang if no 32-bit CPUs are available. On detecting a mismatch, prevent offlining of either the mismatching CPU if it is 32-bit capable, or find the first active 32-bit capable CPU otherwise. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210730112443.23245-13-will@kernel.org commit 08cd8f4112dbd33bbfe1112dd6e9f0a228a8e132 Author: Will Deacon Date: Fri Jul 30 12:24:38 2021 +0100 arm64: exec: Adjust affinity for compat tasks with mismatched 32-bit EL0 When exec'ing a 32-bit task on a system with mismatched support for 32-bit EL0, try to ensure that it starts life on a CPU that can actually run it. Similarly, when exec'ing a 64-bit task on such a system, try to restore the old affinity mask if it was previously restricted. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210730112443.23245-12-will@kernel.org commit d82158fa6df4237c9859b27d719c53b4fe09e69e Author: Will Deacon Date: Fri Jul 30 12:24:37 2021 +0100 arm64: Implement task_cpu_possible_mask() Provide an implementation of task_cpu_possible_mask() so that we can prevent 64-bit-only cores being added to the 'cpus_mask' for compat tasks on systems with mismatched 32-bit support at EL0, Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210730112443.23245-11-will@kernel.org commit c94d89fafa49ba70fedbb01cb52dfbbdd7dc0986 Merge: 7c60610d47676 234b8ab6476c5 Author: Peter Zijlstra Date: Fri Aug 20 12:33:05 2021 +0200 Merge branch 'sched/core' commit 234b8ab6476c5edd5262e2ff563de9498d60044a Author: Will Deacon Date: Fri Jul 30 12:24:36 2021 +0100 sched: Introduce dl_task_check_affinity() to check proposed affinity In preparation for restricting the affinity of a task during execve() on arm64, introduce a new dl_task_check_affinity() helper function to give an indication as to whether the restricted mask is admissible for a deadline task. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20210730112443.23245-10-will@kernel.org commit 07ec77a1d4e82526e1588979fff2f024f8e96df2 Author: Will Deacon Date: Fri Jul 30 12:24:35 2021 +0100 sched: Allow task CPU affinity to be restricted on asymmetric systems Asymmetric systems may not offer the same level of userspace ISA support across all CPUs, meaning that some applications cannot be executed by some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do not feature support for 32-bit applications on both clusters. Although userspace can carefully manage the affinity masks for such tasks, one place where it is particularly problematic is execve() because the CPU on which the execve() is occurring may be incompatible with the new application image. In such a situation, it is desirable to restrict the affinity mask of the task and ensure that the new image is entered on a compatible CPU. From userspace's point of view, this looks the same as if the incompatible CPUs have been hotplugged off in the task's affinity mask. Similarly, if a subsequent execve() reverts to a compatible image, then the old affinity is restored if it is still valid. In preparation for restricting the affinity mask for compat tasks on arm64 systems without uniform support for 32-bit applications, introduce {force,relax}_compatible_cpus_allowed_ptr(), which respectively restrict and restore the affinity mask for a task based on the compatible CPUs. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210730112443.23245-9-will@kernel.org commit db3b02ae896e88b6bb7a95c1373602e87e0de84c Author: Will Deacon Date: Fri Jul 30 12:24:34 2021 +0100 sched: Split the guts of sched_setaffinity() into a helper function In preparation for replaying user affinity requests using a saved mask, split sched_setaffinity() up so that the initial task lookup and security checks are only performed when the request is coming directly from userspace. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20210730112443.23245-8-will@kernel.org commit b90ca8badbd11488e5f762346b028666808164e7 Author: Will Deacon Date: Fri Jul 30 12:24:33 2021 +0100 sched: Introduce task_struct::user_cpus_ptr to track requested affinity In preparation for saving and restoring the user-requested CPU affinity mask of a task, add a new cpumask_t pointer to 'struct task_struct'. If the pointer is non-NULL, then the mask is copied across fork() and freed on task exit. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20210730112443.23245-7-will@kernel.org commit 234a503e670be01f72841be9fcf68dfb89a1fa8b Author: Will Deacon Date: Fri Jul 30 12:24:32 2021 +0100 sched: Reject CPU affinity changes based on task_cpu_possible_mask() Reject explicit requests to change the affinity mask of a task via set_cpus_allowed_ptr() if the requested mask is not a subset of the mask returned by task_cpu_possible_mask(). This ensures that the 'cpus_mask' for a given task cannot contain CPUs which are incapable of executing it, except in cases where the affinity is forced. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210730112443.23245-6-will@kernel.org commit 97c0054dbe2c3c59d1156fd233f2d44e91981c8e Author: Will Deacon Date: Fri Jul 30 12:24:31 2021 +0100 cpuset: Cleanup cpuset_cpus_allowed_fallback() use in select_fallback_rq() select_fallback_rq() only needs to recheck for an allowed CPU if the affinity mask of the task has changed since the last check. Return a 'bool' from cpuset_cpus_allowed_fallback() to indicate whether the affinity mask was updated, and use this to elide the allowed check when the mask has been left alone. No functional change. Suggested-by: Valentin Schneider Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20210730112443.23245-5-will@kernel.org commit 431c69fac05baa7477d61a44f2708e069f2bed6c Author: Will Deacon Date: Fri Jul 30 12:24:30 2021 +0100 cpuset: Honour task_cpu_possible_mask() in guarantee_online_cpus() Asymmetric systems may not offer the same level of userspace ISA support across all CPUs, meaning that some applications cannot be executed by some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do not feature support for 32-bit applications on both clusters. Modify guarantee_online_cpus() to take task_cpu_possible_mask() into account when trying to find a suitable set of online CPUs for a given task. This will avoid passing an invalid mask to set_cpus_allowed_ptr() during ->attach() and will subsequently allow the cpuset hierarchy to be taken into account when forcefully overriding the affinity mask for a task which requires migration to a compatible CPU. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lkml.kernel.org/r/20210730112443.23245-4-will@kernel.org commit d4b96fb92ae7fe7533e11e662504d96161928575 Author: Will Deacon Date: Fri Jul 30 12:24:29 2021 +0100 cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 If the scheduler cannot find an allowed CPU for a task, cpuset_cpus_allowed_fallback() will widen the affinity to cpu_possible_mask if cgroup v1 is in use. In preparation for allowing architectures to provide their own fallback mask, just return early if we're either using cgroup v1 or we're using cgroup v2 with a mask that contains invalid CPUs. This will allow select_fallback_rq() to figure out the mask by itself. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Quentin Perret Link: https://lkml.kernel.org/r/20210730112443.23245-3-will@kernel.org commit 9ae606bc74dd0e58d4de894e3c5cbb9d45599267 Author: Will Deacon Date: Fri Jul 30 12:24:28 2021 +0100 sched: Introduce task_cpu_possible_mask() to limit fallback rq selection Asymmetric systems may not offer the same level of userspace ISA support across all CPUs, meaning that some applications cannot be executed by some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do not feature support for 32-bit applications on both clusters. On such a system, we must take care not to migrate a task to an unsupported CPU when forcefully moving tasks in select_fallback_rq() in response to a CPU hot-unplug operation. Introduce a task_cpu_possible_mask() hook which, given a task argument, allows an architecture to return a cpumask of CPUs that are capable of executing that task. The default implementation returns the cpu_possible_mask, since sane machines do not suffer from per-cpu ISA limitations that affect scheduling. The new mask is used when selecting the fallback runqueue as a last resort before forcing a migration to the first active CPU. Signed-off-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210730112443.23245-2-will@kernel.org commit 304000390f88d049c85e9a0958ac5567f38816ee Author: Josh Don Date: Thu Jul 29 19:00:18 2021 -0700 sched: Cgroup SCHED_IDLE support This extends SCHED_IDLE to cgroups. Interface: cgroup/cpu.idle. 0: default behavior 1: SCHED_IDLE Extending SCHED_IDLE to cgroups means that we incorporate the existing aspects of SCHED_IDLE; a SCHED_IDLE cgroup will count all of its descendant threads towards the idle_h_nr_running count of all of its ancestor cgroups. Thus, sched_idle_rq() will work properly. Additionally, SCHED_IDLE cgroups are configured with minimum weight. There are two key differences between the per-task and per-cgroup SCHED_IDLE interface: - The cgroup interface allows tasks within a SCHED_IDLE hierarchy to maintain their relative weights. The entity that is "idle" is the cgroup, not the tasks themselves. - Since the idle entity is the cgroup, our SCHED_IDLE wakeup preemption decision is not made by comparing the current task with the woken task, but rather by comparing their matching sched_entity. A typical use-case for this is a user that creates an idle and a non-idle subtree. The non-idle subtree will dominate competition vs the idle subtree, but the idle subtree will still be high priority vs other users on the system. The latter is accomplished via comparing matching sched_entity in the waken preemption path (this could also be improved by making the sched_idle_rq() decision dependent on the perspective of a specific task). For now, we maintain the existing SCHED_IDLE semantics. Future patches may make improvements that extend how we treat SCHED_IDLE entities. The per-task_group idle field is an integer that currently only holds either a 0 or a 1. This is explicitly typed as an integer to allow for further extensions to this API. For example, a negative value may indicate a highly latency-sensitive cgroup that should be preferred for preemption/placement/etc. Signed-off-by: Josh Don Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20210730020019.1487127-2-joshdon@google.com commit 0083242c93759dde353a963a90cb351c5c283379 Author: Valentin Schneider Date: Wed Aug 18 13:13:33 2021 +0530 sched/topology: Skip updating masks for non-online nodes The scheduler currently expects NUMA node distances to be stable from init onwards, and as a consequence builds the related data structures once-and-for-all at init (see sched_init_numa()). Unfortunately, on some architectures node distance is unreliable for offline nodes and may very well change upon onlining. Skip over offline nodes during sched_init_numa(). Track nodes that have been onlined at least once, and trigger a build of a node's NUMA masks when it is first onlined post-init. Reported-by: Geetika Moolchandani Signed-off-by: Srikar Dronamraju Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210818074333.48645-1-srikar@linux.vnet.ibm.com commit b857174e68e26f9c4f0796971e11eb63ad5a3eb6 Author: Sebastian Andrzej Siewior Date: Thu Aug 19 21:30:30 2021 +0200 locking/ww_mutex: Initialize waiter.ww_ctx properly The consolidation of the debug code for mutex waiter intialization sets waiter::ww_ctx to a poison value unconditionally. For regular mutexes this is intended to catch the case where waiter_ww_ctx is dereferenced accidentally. For ww_mutex the poison value has to be overwritten either with a context pointer or NULL for ww_mutexes without context. The rework broke this as it made the store conditional on the context pointer instead of the argument which signals whether ww_mutex code should be compiled in or optiized out. As a result waiter::ww_ctx ends up with the poison pointer for contextless ww_mutexes which causes a later dereference of the poison pointer because it is != NULL. Use the build argument instead so for ww_mutex the poison value is always overwritten. Fixes: c0afb0ffc06e6 ("locking/ww_mutex: Gather mutex_waiter initialization") Reported-by: Guenter Roeck Suggested-by: Peter Zijlstra Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210819193030.zpwrpvvrmy7xxxiy@linutronix.de commit 411d63d8c64c2f3b0c497fe4658f13b3bca951e2 Author: Marc Zyngier Date: Fri Aug 20 10:46:42 2021 +0100 KVM: arm64: Upgrade trace_kvm_arm_set_dreg32() to 64bit A number of registers pased to trace_kvm_arm_set_dreg32() are actually 64bit. Upgrade the tracepoint to take a 64bit value, despite the name... Signed-off-by: Marc Zyngier commit 2d701243b9f231b5d7f9a8cb81870650d3eb32bc Author: Fuad Tabba Date: Tue Aug 17 09:11:29 2021 +0100 KVM: arm64: Add config register bit definitions Add hardware configuration register bit definitions for HCR_EL2 and MDCR_EL2. Future patches toggle these hyp configuration register bits to trap on certain accesses. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-11-tabba@google.com commit 95b54c3e4c92b9185b15c83e8baab9ba312195f6 Author: Fuad Tabba Date: Tue Aug 17 09:11:28 2021 +0100 KVM: arm64: Add feature register flag definitions Add feature register flag definitions to clarify which features might be supported. Consolidate the various ID_AA64PFR0_ELx flags for all ELs. No functional change intended. Signed-off-by: Fuad Tabba Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-10-tabba@google.com commit cd496228fd8de2e82b6636d3d89105631ea2b69c Author: Fuad Tabba Date: Tue Aug 17 09:11:27 2021 +0100 KVM: arm64: Track value of cptr_el2 in struct kvm_vcpu_arch Track the baseline guest value for cptr_el2 in struct kvm_vcpu_arch, similar to the other registers that control traps. Use this value when setting cptr_el2 for the guest. Currently this value is unchanged (CPTR_EL2_DEFAULT), but future patches will set trapping bits based on features supported for the guest. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-9-tabba@google.com commit 12849badc6d2456f15f8f2c93037628d5176810b Author: Fuad Tabba Date: Tue Aug 17 09:11:26 2021 +0100 KVM: arm64: Keep mdcr_el2's value as set by __init_el2_debug __init_el2_debug configures mdcr_el2 at initialization based on, among other things, available hardware support. Trap deactivation doesn't check that, so keep the initial value. No functional change intended. Signed-off-by: Fuad Tabba Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-8-tabba@google.com commit 1460b4b25fde52cbee746c11a4b1d3185f2e2847 Author: Fuad Tabba Date: Tue Aug 17 09:11:25 2021 +0100 KVM: arm64: Restore mdcr_el2 from vcpu On deactivating traps, restore the value of mdcr_el2 from the newly created and preserved host value vcpu context, rather than directly reading the hardware register. Up until and including this patch the two values are the same, i.e., the hardware register and the vcpu one. A future patch will be changing the value of mdcr_el2 on activating traps, and this ensures that its value will be restored. No functional change intended. Signed-off-by: Fuad Tabba Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-7-tabba@google.com commit f76f89e2f73d93720cfcad7fb7b24d022b2846bf Author: Fuad Tabba Date: Tue Aug 17 09:11:24 2021 +0100 KVM: arm64: Refactor sys_regs.h,c for nVHE reuse Refactor sys_regs.h and sys_regs.c to make it easier to reuse common code. It will be used in nVHE in a later patch. Note that the refactored code uses __inline_bsearch for find_reg instead of bsearch to avoid copying the bsearch code for nVHE. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-6-tabba@google.com commit dabb1667d8573302712a75530cccfee8f3ffff84 Author: Fuad Tabba Date: Tue Aug 17 09:11:23 2021 +0100 KVM: arm64: Fix names of config register fields Change the names of hcr_el2 register fields to match the Arm Architecture Reference Manual. Easier for cross-referencing and for grepping. Also, change the name of CPTR_EL2_RES1 to CPTR_NVHE_EL2_RES1, because res1 bits are different for VHE. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-5-tabba@google.com commit d6c850dd6ce9ce4b410142a600d8c34dc041d860 Author: Fuad Tabba Date: Tue Aug 17 09:11:22 2021 +0100 KVM: arm64: MDCR_EL2 is a 64-bit register Fix the places in KVM that treat MDCR_EL2 as a 32-bit register. More recent features (e.g., FEAT_SPEv1p2) use bits above 31. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-4-tabba@google.com commit e6bc555c96990046d680ff92c8e2e7b6b43b509f Author: Fuad Tabba Date: Tue Aug 17 09:11:21 2021 +0100 KVM: arm64: Remove trailing whitespace in comment Remove trailing whitespace from comment in trap_dbgauthstatus_el1(). No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210817081134.2918285-3-tabba@google.com commit 2ea7f655800b00b109951f22539fe2025add210b Author: Fuad Tabba Date: Tue Aug 17 09:11:20 2021 +0100 KVM: arm64: placeholder to check if VM is protected Add a function to check whether a VM is protected (under pKVM). Since the creation of protected VMs isn't enabled yet, this is a placeholder that always returns false. The intention is for this to become a check for protected VMs in the future (see Will's RFC). No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/kvmarm/20210603183347.1695-1-will@kernel.org/ Link: https://lore.kernel.org/r/20210817081134.2918285-2-tabba@google.com commit 83e5dcbece4ea67ec3ad94b897e2844184802fd7 Author: Mark Brown Date: Thu Aug 19 18:29:02 2021 +0100 kselftest/arm64: mte: Fix misleading output when skipping tests When skipping the tests due to a lack of system support for MTE we currently print a message saying FAIL which makes it look like the test failed even though the test did actually report KSFT_SKIP, creating some confusion. Change the error message to say SKIP instead so things are clearer. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210819172902.56211-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit c63d44ae602419eda128cecd33d226f3d3f18df2 Author: Luke D. Jones Date: Thu Aug 19 07:07:31 2021 +1200 asus-wmi: Add support for platform_profile Add initial support for platform_profile where the support is based on availability of ASUS_THROTTLE_THERMAL_POLICY. Because throttle_thermal_policy is used by platform_profile and is writeable separately to platform_profile any userspace changes to throttle_thermal_policy need to notify platform_profile. In future throttle_thermal_policy sysfs should be removed so that only one method controls the laptop power profile. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20210818190731.19170-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ae26278829a80ad0e60ff004de71e9276cee5dc0 Author: Matan Ziv-Av Date: Wed Aug 18 15:47:31 2021 +0300 platform/x86: lg-laptop: Use correct event for keyboard backlight FN-key Use led_classdev_notify_brightness_hw_changed() instead of F16 key. Signed-off-by: Matan Ziv-Av Link: https://lore.kernel.org/r/2196990f167efe6a42d51fb85f4db4cdf4d9e80e.1629291912.git.matan@svgalib.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 85973bf4c1b19cc1c6e801d492645bd63275573e Author: Matan Ziv-Av Date: Wed Aug 18 12:34:50 2021 +0300 platform/x86: lg-laptop: Use correct event for touchpad toggle FN-key Send F21 which is the standard for this key, instead of F13. Signed-off-by: Matan Ziv-Av Link: https://lore.kernel.org/r/b847895c1f170e2e59df5757a4d603d28149f648.1629291912.git.matan@svgalib.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8983bfd58d61ab29ab4114089d1f42e1ee6103a8 Author: Matan Ziv-Av Date: Wed Aug 18 12:25:14 2021 +0300 platform/x86: lg-laptop: Support for battery charge limit on newer models Add support for the difference between various models: - Use dmi to detect laptop model. - 2019 and newer models use _wmbb method to set battery charge limit. Signed-off-by: Matan Ziv-Av Link: https://lore.kernel.org/r/bd6922a412e50c2dcfb7ce24fc8687f577181d65.1629291912.git.matan@svgalib.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit dcfbd31ef4bcf6ceb373911faa4a5299e0547702 Author: Shravan S Date: Sat Jul 24 02:44:52 2021 +0530 platform/x86: BIOS SAR driver for Intel M.2 Modem Dynamic BIOS SAR driver exposing dynamic SAR information from BIOS The Dynamic SAR (Specific Absorption Rate) driver uses ACPI DSM (Device Specific Method) to communicate with BIOS and retrieve dynamic SAR information and change notifications. The driver uses sysfs to expose this data to userspace via read and notify. Sysfs interface is documented in detail under: Documentation/ABI/testing/sysfs-driver-intc_sar Signed-off-by: Shravan S Link: https://lore.kernel.org/r/20210723211452.27995-2-s.shravan@intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ef195e8a7f43924b9979b2cd81ac7fa54f24bb3c Author: David E. Box Date: Tue Aug 17 15:40:17 2021 -0700 platform/x86: intel_pmt_telemetry: Ignore zero sized entries Some devices may expose non-functioning entries that are reserved for future use. These entries have zero size. Ignore them during probe. Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20210817224018.1013192-5-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3ae86d2d4704796ee658a34245cb86e68c40c5d7 Author: Meng Dong Date: Wed Aug 18 01:12:03 2021 +0800 platform/x86: ideapad-laptop: Fix Legion 5 Fn lock LED This patch fixes the bug 212671. Althrough the Fn lock (Fn + Esc) works on Legion 5 (R7000P), its LED light does not change with the state. This modification sets the Fn lock state to its current value on receiving the wmi event 8FC0DE0C-B4E4-43FD-B0F3-8871711C1294 to update the LED state. Signed-off-by: Meng Dong Link: https://lore.kernel.org/r/20210817171203.12855-1-whenov@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 30f64e2066ab1b51139307eb33dc217838bd19bc Author: Thomas Weißschuh Date: Wed Aug 18 18:44:35 2021 +0200 platform/x86: gigabyte-wmi: add support for B450M S2H V2 Reported as working here: https://github.com/t-8ch/linux-gigabyte-wmi-driver/issues/1#issuecomment-901207693 Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20210818164435.99821-1-linux@weissschuh.net Signed-off-by: Hans de Goede commit 239f32b4f161c1584cd4b386d6ab8766432a6ede Author: Eddie James Date: Fri Jul 16 17:03:31 2021 -0500 leds: pca955x: Switch to i2c probe_new The deprecated i2c probe functionality doesn't work with OF compatible strings, as it only checks for the i2c device id. Switch to the new way of probing and grab the match data to select the chip type. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit 7c4815929276b2e223eb6f2e49afe5071d4294a5 Author: Eddie James Date: Fri Jul 16 17:03:30 2021 -0500 leds: pca955x: Let the core process the fwnode Much of the fwnode processing in the PCA955x driver is now in the LEDs core driver, so pass the fwnode in the init data when registering the LED device. In order to preserve the existing naming scheme, check for an empty name and set it to the LED number. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit e46cb6d0c760a5b15e38138845fad99628fafcb8 Author: Eddie James Date: Fri Jul 16 17:03:29 2021 -0500 leds: pca955x: Implement the default-state property In order to retain the LED state after a system reboot, check the documented default-state device tree property during initialization. Modify the behavior of the probe according to the property. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit 7086625fde6538b2c0623eb767ad23c7ac3d7f3a Author: Eddie James Date: Fri Jul 16 17:03:28 2021 -0500 leds: pca955x: Add brightness_get function Add a function to fetch the state of the hardware LED. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit 2420ae02ce0a926819ebe18f809a57bff3edeac2 Author: Eddie James Date: Fri Jul 16 17:03:27 2021 -0500 leds: pca955x: Clean up code formatting Format the code. Add some variables to help shorten lines. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit 419066324e19a47b98cdcf5defda42de555a8957 Author: Eddie James Date: Fri Jul 16 17:03:26 2021 -0500 leds: leds-core: Implement the retain-state-shutdown property Read the retain-state-shutdown device tree property to set the existing LED_RETAIN_AT_SHUTDOWN flag. Then check the flag when unregistering, and if set, don't set the brightness to OFF. This is useful for systems that want to keep the HW state of the LED across reboots. Signed-off-by: Eddie James Signed-off-by: Pavel Machek commit 5d823d6d69853ae07786ddf786f7693b57e76beb Author: Eddie James Date: Fri Jul 16 17:03:25 2021 -0500 dt-bindings: leds: Add retain-state-shutdown boolean Document the retain-state-shutdown property that indicates that a LED should not be turned off or changed during system shutdown. Signed-off-by: Eddie James Acked-by: Rob Herring Signed-off-by: Pavel Machek commit 09f1273064eea23ec41fb206f6eccc2bf79d1fa1 Author: Pavel Machek Date: Fri Aug 20 10:26:24 2021 +0200 Documentation: leds: standartizing LED names We have a list of valid functions, but LED names in sysfs are still far from being consistent. Create list of "well known" LED names so we nudge people towards using same LED names (except color) for same functionality. Signed-off-by: Pavel Machek commit cf364e08ea1c5dd217afb658d510aaef7d0cc6f4 Author: Marc Zyngier Date: Fri Aug 6 12:31:08 2021 +0100 KVM: arm64: Upgrade VMID accesses to {READ,WRITE}_ONCE Since TLB invalidation can run in parallel with VMID allocation, we need to be careful and avoid any sort of load/store tearing. Use {READ,WRITE}_ONCE consistently to avoid any surprise. Cc: Catalin Marinas Cc: Jade Alglave Cc: Shameer Kolothum Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210806113109.2475-6-will@kernel.org commit 4efc0ede4f31d7ec25c3dee0c8f07f93735cee6d Author: Marc Zyngier Date: Fri Aug 6 12:31:07 2021 +0100 KVM: arm64: Unify stage-2 programming behind __load_stage2() The protected mode relies on a separate helper to load the S2 context. Move over to the __load_guest_stage2() helper instead, and rename it to __load_stage2() to present a unified interface. Cc: Catalin Marinas Cc: Jade Alglave Cc: Shameer Kolothum Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20210806113109.2475-5-will@kernel.org commit 923a547d71b967c808a596968cf8022102f8b5b2 Author: Marc Zyngier Date: Fri Aug 6 12:31:06 2021 +0100 KVM: arm64: Move kern_hyp_va() usage in __load_guest_stage2() into the callers It is a bit awkward to use kern_hyp_va() in __load_guest_stage2(), specially as the helper is shared between VHE and nVHE. Instead, move the use of kern_hyp_va() in the nVHE code, and pass a pointer to the kvm->arch structure instead. Although this may look a bit awkward, it allows for some further simplification. Cc: Catalin Marinas Cc: Jade Alglave Cc: Shameer Kolothum Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20210806113109.2475-4-will@kernel.org commit 3134cc8beb69d0db9de651081707c4651c011621 Author: Marc Zyngier Date: Thu Aug 19 19:03:05 2021 +0100 KVM: arm64: vgic: Resample HW pending state on deactivation When a mapped level interrupt (a timer, for example) is deactivated by the guest, the corresponding host interrupt is equally deactivated. However, the fate of the pending state still needs to be dealt with in SW. This is specially true when the interrupt was in the active+pending state in the virtual distributor at the point where the guest was entered. On exit, the pending state is potentially stale (the guest may have put the interrupt in a non-pending state). If we don't do anything, the interrupt will be spuriously injected in the guest. Although this shouldn't have any ill effect (spurious interrupts are always possible), we can improve the emulation by detecting the deactivation-while-pending case and resample the interrupt. While we're at it, move the logic into a common helper that can be shared between the two GIC implementations. Fixes: e40cc57bac79 ("KVM: arm/arm64: vgic: Support level-triggered mapped interrupts") Reported-by: Raghavendra Rao Ananta Tested-by: Raghavendra Rao Ananta Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210819180305.1670525-1-maz@kernel.org commit e7a10ed7d7341eafb8987f309e91208e5c0f5b07 Merge: 456af438ad490 a9a27d4ab3de2 Author: Steve French Date: Fri Aug 20 02:07:30 2021 -0500 Merge pull request #66 from namjaejeon/cifsd-for-next ksmbd-fixes commit f9addd85fbfacf0d155e83dbee8696d6df5ed0c7 Author: Kajol Jain Date: Fri Aug 13 13:51:58 2021 +0530 powerpc/perf/hv-gpci: Fix counter value parsing H_GetPerformanceCounterInfo (0xF080) hcall returns the counter data in the result buffer. Result buffer has specific format defined in the PAPR specification. One of the fields is counter offset and width of the counter data returned. Counter data are returned in a unsigned char array in big endian byte order. To get the final counter data, the values must be left shifted byte at a time. But commit 220a0c609ad17 ("powerpc/perf: Add support for the hv gpci (get performance counter info) interface") made the shifting bitwise and also assumed little endian order. Because of that, hcall counters values are reported incorrectly. In particular this can lead to counters go backwards which messes up the counter prev vs now calculation and leads to huge counter value reporting: #: perf stat -e hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ -C 0 -I 1000 time counts unit events 1.000078854 18,446,744,073,709,535,232 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 2.000213293 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 3.000320107 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 4.000428392 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 5.000537864 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 6.000649087 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 7.000760312 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 8.000865218 16,448 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 9.000978985 18,446,744,073,709,535,232 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 10.001088891 16,384 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 11.001201435 0 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ 12.001307937 18,446,744,073,709,535,232 hv_gpci/system_tlbie_count_and_time_tlbie_instructions_issued/ Fix the shifting logic to correct match the format, ie. read bytes in big endian order. Fixes: e4f226b1580b ("powerpc/perf/hv-gpci: Increase request buffer size") Cc: stable@vger.kernel.org # v4.6+ Reported-by: Nageswara R Sastry Signed-off-by: Kajol Jain Tested-by: Nageswara R Sastry Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210813082158.429023-1-kjain@linux.ibm.com commit 6cd717fe9b3a787f8e8f9d0bc9b7634a9c104b3e Author: Finn Thain Date: Thu Aug 19 10:46:54 2021 +1000 powerpc/tau: Add 'static' storage qualifier to 'tau_work' definition This patch prevents the following sparse warning. arch/powerpc/kernel/tau_6xx.c:199:1: sparse: sparse: symbol 'tau_work' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/44ab381741916a51e783c4a50d0b186abdd8f280.1629334014.git.fthain@linux-m68k.org commit a9a27d4ab3de2a6a81bad4b158c74a554d78e89b Author: Namjae Jeon Date: Fri Aug 20 15:38:06 2021 +0900 ksmbd: don't set FILE DELETE and FILE_DELETE_CHILD in access mask by default When there is no dacl in request, ksmbd send dacl that coverted by using file permission. This patch don't set FILE DELETE and FILE_DELETE_CHILD in access mask by default. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a006aa51ea27fa64afc7990f8f100ff0baa92413 Author: Linus Lüssing Date: Mon May 17 00:33:09 2021 +0200 batman-adv: bcast: remove remaining skb-copy calls We currently have two code paths for broadcast packets: A) self-generated, via batadv_interface_tx()-> batadv_send_bcast_packet(). B) received/forwarded, via batadv_recv_bcast_packet()-> batadv_forw_bcast_packet(). For A), self-generated broadcast packets: The only modifications to the skb data is the ethernet header which is added/pushed to the skb in batadv_send_broadcast_skb()->batadv_send_skb_packet(). However before doing so, batadv_skb_head_push() is called which calls skb_cow_head() to unshare the space for the to be pushed ethernet header. So for this case, it is safe to use skb clones. For B), received/forwarded packets: The same applies as in A) for the to be forwarded packets. Only the ethernet header is added. However after (queueing for) forwarding the packet in batadv_recv_bcast_packet()->batadv_forw_bcast_packet(), a packet is additionally decapsulated and is sent up the stack through batadv_recv_bcast_packet()->batadv_interface_rx(). Protocols higher up the stack are already required to check if the packet is shared and create a copy for further modifications. When the next (protocol) layer works correctly, it cannot happen that it tries to operate on the data behind the skb clone which is still queued up for forwarding. Co-authored-by: Sven Eckelmann Signed-off-by: Sven Eckelmann Signed-off-by: Linus Lüssing Signed-off-by: Simon Wunderlich commit a2b7b148d97f6be3d5e253280022afe21e8283fa Author: Sven Eckelmann Date: Sun Aug 8 19:11:08 2021 +0200 batman-adv: Drop NULL check before dropping references The check if a batman-adv related object is NULL or not is now directly in the batadv_*_put functions. It is not needed anymore to perform this check outside these function: The changes were generated using a coccinelle semantic patch: @@ expression E; @@ - if (likely(E != NULL)) ( batadv_backbone_gw_put | batadv_claim_put | batadv_dat_entry_put | batadv_gw_node_put | batadv_hardif_neigh_put | batadv_hardif_put | batadv_nc_node_put | batadv_nc_path_put | batadv_neigh_ifinfo_put | batadv_neigh_node_put | batadv_orig_ifinfo_put | batadv_orig_node_put | batadv_orig_node_vlan_put | batadv_softif_vlan_put | batadv_tp_vars_put | batadv_tt_global_entry_put | batadv_tt_local_entry_put | batadv_tt_orig_list_entry_put | batadv_tt_req_node_put | batadv_tvlv_container_put | batadv_tvlv_handler_put )(E); Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit e78783da569a88af4342b7ea707edc247d216847 Author: Sven Eckelmann Date: Sun Aug 8 19:56:17 2021 +0200 batman-adv: Check ptr for NULL before reducing its refcnt The commit b37a46683739 ("netdevice: add the case if dev is NULL") changed the way how the NULL check for net_devices have to be handled when trying to reduce its reference counter. Before this commit, it was the responsibility of the caller to check whether the object is NULL or not. But it was changed to behave more like kfree. Now the callee has to handle the NULL-case. The batman-adv code was scanned via cocinelle for similar places. These were changed to use the paradigm @@ identifier E, T, R, C; identifier put; @@ void put(struct T *E) { + if (!E) + return; kref_put(&E->C, R); } Functions which were used in other sources files were moved to the header to allow the compiler to inline the NULL check and the kref_put call. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 55207227189a07513ba4107d72e256313a66a2f3 Author: Sven Eckelmann Date: Fri Jul 23 19:23:17 2021 +0200 batman-adv: Switch to kstrtox.h for kstrtou64 The commit 4c52729377ea ("kernel.h: split out kstrtox() and simple_strtox() to a separate header") moved the kstrtou64 function to a new header called linux/kstrtox.h. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 3baa9f522a0cad3cd8a45f4a5b85c3694cece672 Author: Sven Eckelmann Date: Sun Jun 13 16:37:47 2021 +0200 batman-adv: Move IRC channel to hackint.org Due to recent developments around the Freenode.org IRC network, the opinions about the usage of this service shifted dramatically. The majority of the still active users of the #batman channel prefers a move to the hackint.org network. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 3202ea65f85c5488926e01aa51d73d53dfe17e6e Author: Dmytro Linkin Date: Tue Jun 1 13:24:00 2021 +0300 net/mlx5: E-switch, Add QoS tracepoints Add tracepoints to log QoS enabling/disabling/configuration for vports and rate groups. Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Saeed Mahameed commit 0fe132eac38cf20fc584c7537e62a11415788269 Author: Dmytro Linkin Date: Tue Jun 1 12:37:39 2021 +0300 net/mlx5: E-switch, Allow to add vports to rate groups Implement eswitch API that allows updating rate groups. If group pointer is NULL, then move the vport to internal unlimited group zero. Implement devlink_ops->rate_parent_node_set() callback in the terms of the new eswitch group update API. Enable QoS for all group's elements if a group has allocated BW share. Co-developed-by: Vlad Buslov Signed-off-by: Vlad Buslov Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Parav Pandit Reviewed-by: Saeed Mahameed commit f47e04eb96e02e6bd870dd5ce5da1d612b43b28d Author: Dmytro Linkin Date: Mon May 31 18:19:50 2021 +0300 net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups Provide eswitch API to allow controlling group rate limits. Use it to implement devlink_ops->mlx5_devlink_rate_node_tx_{share|max}_set(). The share rate will create relative bandwidth share on the groups level while within the group the user can set shared rate on the member vports of that group and this rate will be relative to the group's share rate. The group with the highest shared rate will get a BW share of 100 and the rest of the groups will get a value that reflects the ratio between their share rate and the maximum share rate. Example: Created four rate groups with tx_share limits: $ devlink port function rate add \ pci/0000:06:00.0/group_1 tx_share 30gbit $ devlink port function rate add \ pci/0000:06:00.0/group_2 tx_share 20gbit $ devlink port function rate add \ pci/0000:06:00.0/group_3 tx_share 20gbit $ devlink port function rate add \ pci/0000:06:00.0/group_4 tx_share 10gbit Assuming link speed is 50 Gbit/sec ratio divider will be 50 / (30+20+20+10) = 0.625. Normalized rate values for the groups: 30 * 0.625 = 18.75 Gbit/sec 20 * 0.625 = 12.5 Gbit/sec 20 * 0.625 = 12.5 Gbit/sec 10 * 0.625 = 6.25 Gbit/sec Rate group with unlimited tx_share rate will receive minimum BW value (1Mbit/sec) if presented any group with tx_share rate limit. This allow to not drop all packets in case of heavy traffic. Co-developed-by: Vlad Buslov Signed-off-by: Vlad Buslov Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Parav Pandit Reviewed-by: Saeed Mahameed commit 1ae258f8b343a0c4316c5545bfaf21010e4f0c73 Author: Dmytro Linkin Date: Mon May 31 17:08:14 2021 +0300 net/mlx5: E-switch, Introduce rate limiting groups API Extend eswitch API with rate limiting groups: - Define new struct mlx5_esw_rate_group that is used to hold all internal group data. - Implement functions that allow creation, destruction and cleanup of groups. - Assign all vports to internal unlimited zero group by default. This commit lays the groundwork for group rate limiting by implementing devlink_ops->rate_node_{new|del}() callbacks to support creating and deleting groups through devlink rate node objects. APIs that allows setting rates and adding/removing members are implemented in following patches. Co-developed-by: Vlad Buslov Signed-off-by: Vlad Buslov Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Parav Pandit Reviewed-by: Saeed Mahameed commit ad34f02fe2c931a894c1296fe5c6cd3084b3ee10 Author: Dmytro Linkin Date: Fri May 28 17:42:15 2021 +0300 net/mlx5: E-switch, Enable devlink port tx_{share|max} rate control Register devlink rate leaf object for every eswitch vport. Implement devlink ops that enable setting shared and max tx rates through devlink API. Extract common eswitch code from existing tx rate set function that is accessed through NDO to be reused for the devlink. Values configured with NDO API are not visible for the devlink API, therefore shouldn't be used simultaneously. When normalizing the BW share value, dividing the desired minimum rate by the common divider results in losing information since the quotient is rounded down. This has a significant affect on configurations of low rate where the round down eliminates a large percentage of the total rate. To improve the formula, round up the division result to make sure that the BW share is at least the value it was supposed to be and won't lost a significant amount of the expected value. Co-developed-by: Vlad Buslov Signed-off-by: Vlad Buslov Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Parav Pandit Reviewed-by: Saeed Mahameed commit 2d116e3e7e49b9ef01b8546fd32711e18f8a943d Author: Dmytro Linkin Date: Fri May 28 17:30:22 2021 +0300 net/mlx5: E-switch, Move QoS related code to dedicated file Move eswitch QoS related code into dedicated file. Provide eswitch API to access this code meaning it is isolated and restricted to be used only by eswitch.c. Exception is legacy NDO vf set rate, which moved to esw/legacy.c. Signed-off-by: Dmytro Linkin Reviewed-by: Huy Nguyen Reviewed-by: Mark Bloch Reviewed-by: Parav Pandit Reviewed-by: Saeed Mahameed commit 2741f22309054a2100e47c0aef42159d3d266ebc Author: Chris Mi Date: Mon Jun 21 10:49:50 2021 +0300 net/mlx5e: TC, Support sample offload action for tunneled traffic Currently the sample offload actions send the encapsulated packet to software. This commit decapsulates the packet before performing the sampling and set the tunnel properties on the skb metadata fields to make the behavior consistent with OVS sFlow. If decapsulating first, we can't use the same match like before in default table. So instantiate a post action instance to continue processing the action list. If HW can preserve reg_c, also use the post action instance. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit ee950e5db1b9117683c72ebc8d857a3f463efc20 Author: Chris Mi Date: Fri Apr 30 10:17:33 2021 +0300 net/mlx5e: TC, Restore tunnel info for sample offload Currently the sample offload actions send the encapsulated packet to software. sFlow expects tunneled packets to be decapsulated while having the tunnel properties on the skb metadata fields. Reuse the functions used by connection tracking to map the outer header properties to a unique id. The next patch will use that id to restore the tunnel information of decapsulated packets onto the skb. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d12e20ac0661d619d04bcc653f4044cd9a4ec69a Author: Chris Mi Date: Fri Apr 30 12:08:40 2021 +0300 net/mlx5e: TC, Remove CONFIG_NET_TC_SKB_EXT dependency when restoring tunnel CONFIG_NET_TC_SKB_EXT controls the SKB extension support for restoring chain ids. SKB extension is not required for tunnel restoration. Remove the CONFIG_NET_TC_SKB_EXT dependency as a pre-step for using the tunnel restore methods for sample offload use cases. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit f0da4daa34130ba0e5286df4335f04a3f7e61b34 Author: Chris Mi Date: Tue Aug 17 11:23:09 2021 +0800 net/mlx5e: Refactor ct to use post action infrastructure Move post action table management to common library providing add/del/get API. Refactor the ct action offload to use the common API. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 6f0b692a5aa96b4fd0f14a2ac54b590cd9b9f192 Author: Chris Mi Date: Mon Aug 16 22:00:30 2021 +0800 net/mlx5e: Introduce post action infrastructure Some tc actions are modeled in hardware using multiple tables causing a tc action list split. For example, CT action is modeled by jumping to a ct table which is controlled by nf flowtable. sFlow jumps in hardware to a sample table, which continues to a "default table" where it should continue processing the action list. Multi table actions are modeled in hardware using a unique fte_id. The fte_id is set before jumping to a table. Split actions continue to a post-action table where the matched fte_id value continues the execution the tc action list. Currently the post-action design is implemented only by the ct action. Introduce post action infrastructure as a pre-step for reusing it with the sFlow offload feature. Init and destroy the common post action table. Refactor the ct offload to use the common post table infrastructure in the next patch. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2799797845dba609db61a20a443025d59f4edf0f Author: Chris Mi Date: Wed Jun 2 06:23:08 2021 +0300 net/mlx5e: CT, Use xarray to manage fte ids IDR is deprecated. Use xarray instead. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit bcd6740c6b6ddd301b0998a758063118b3bc2d4e Author: Chris Mi Date: Wed Aug 18 20:18:57 2021 +0800 net/mlx5e: Move sample attribute to flow attribute Currently it is in eswitch attribute. Move it to flow attribute to reflect the change in previous patch. Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0027d70c73c954aacf3e4efb1774dd58151b6e54 Author: Chris Mi Date: Wed Aug 18 15:52:18 2021 +0800 net/mlx5e: Move esw/sample to en/tc/sample Module sample belongs to en/tc instead of esw. Move it and rename accordingly. Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 5024fa95a144ef4ce9c0039155a553e59c3850be Author: Saeed Mahameed Date: Mon Aug 16 11:58:19 2021 -0700 net/mlx5e: Remove mlx5e dependency from E-Switch sample mlx5/esw/sample.c doesn't really need mlx5e_priv object, we can remove this redundant dependency by passing the eswitch object directly to the sample object constructor. Signed-off-by: Saeed Mahameed Reviewed-by: Roi Dayan commit 34633219b8947314d369ddf7bc2e45ac5aec7765 Author: Bjorn Andersson Date: Wed Jul 21 20:07:38 2021 -0700 phy: qmp: Provide unique clock names for DP clocks The USB/DP combo PHY exposes the "qmp_dp_phy_pll_link_clk" and "qmp_dp_phy_pll_vco_div_clk" clocks, that are consumed by the display clock controller. But for boards with multiple enabled QMP USB/DP combo instances the hard coded names collides - and hence only the first probed device is allowed to register. Given that clocks are no longer reference globally by name and it's possible to replace the hard coded names by something unique, but still user friendly. The two new clock names are based on dev_name() and results in names such as "88ee000.phy::link_clk" and "88ee000.phy::vco_div_clk". Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210722030738.3385821-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit c26d4c5d4f0df7207da3975458261927f9305465 Author: Lukas Bulwahn Date: Thu Aug 19 13:39:53 2021 +0200 powerpc/kvm: Remove obsolete and unneeded select Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") selects the non-existing config PPC_DAWR_FORCE_ENABLE for config KVM_BOOK3S_64_HANDLER. As this commit also introduces a config PPC_DAWR and this config PPC_DAWR is selected with PPC if PPC64, there is no need for any further select in the KVM_BOOK3S_64_HANDLER. Remove an obsolete and unneeded select in config KVM_BOOK3S_64_HANDLER. The issue was identified with ./scripts/checkkconfigsymbols.py. Fixes: a278e7ea608b ("powerpc: Fix compile issue with force DAWR") Signed-off-by: Lukas Bulwahn Reviewed-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210819113954.17515-2-lukas.bulwahn@gmail.com commit f444fea7896dbc267249d27f604082a51b8efca2 Merge: 9e5f10fe577be f87d64319e6f9 Author: Jakub Kicinski Date: Thu Aug 19 18:09:18 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/ptp/Kconfig: 55c8fca1dae1 ("ptp_pch: Restore dependency on PCI") e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies") Signed-off-by: Jakub Kicinski commit f2a6ee924d26527dc55a745dc917a820f34e64e5 Author: Prankur Gupta Date: Tue Aug 17 15:42:21 2021 -0700 selftests/bpf: Add tests for {set|get} socket option from setsockopt BPF Adding selftests for the newly added functionality to call bpf_setsockopt() and bpf_getsockopt() from setsockopt BPF programs. Test Details: 1. BPF Program Checks for changes in IPV6_TCLASS(SOL_IPV6) via setsockopt If the cca for the socket is not cubic do nothing If the newly set value for IPV6_TCLASS is 45 (0x2d) (as per our use-case) then change the cc from cubic to reno 2. User Space Program Creates an AF_INET6 socket and set the cca for that to be "cubic" Attach the program and set the IPV6_TCLASS to 0x2d using setsockopt Verify the cca for the socket changed to reno Signed-off-by: Prankur Gupta Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210817224221.3257826-3-prankgup@fb.com commit 2c531639deb5e3ddfd6e8123b82052b2d9fbc6e5 Author: Prankur Gupta Date: Tue Aug 17 15:42:20 2021 -0700 bpf: Add support for {set|get} socket options from setsockopt BPF Add logic to call bpf_setsockopt() and bpf_getsockopt() from setsockopt BPF programs. An example use case is when the user sets the IPV6_TCLASS socket option, we would also like to change the tcp-cc for that socket. We don't have any use case for calling bpf_setsockopt() from supposedly read- only sys_getsockopt(), so it is made available to BPF_CGROUP_SETSOCKOPT only at this point. Signed-off-by: Prankur Gupta Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210817224221.3257826-2-prankgup@fb.com commit 9ba00856686ade106afee2884b5e8ac1e09d137a Author: Hans de Goede Date: Thu Aug 19 21:05:43 2021 +0200 ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect The HP Elitepad 1000 G2 tablet has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec + an external HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for the headset-mic. The codec's GPIO1 is also its only IRQ output pin, so this means that the codec's IRQ cannot be used on this tablet. Instead the jack-detect is connected directly to GPIOs on the main SoC. The dock has a helper chip which also detects if a headset-mic is present or not, so there are 2 GPIOs for the jack-detect status of the dock. The tablet jack uses a single GPIO which indicates if a jack is present or not. Differentiating between headphones vs a headset on the tablet jack is done by using the usual mic-bias over-current-detection mechanism. Add support for this unique setup, this support gets enabled on this tablet through a new BYT_RT5640_JD_HP_ELITEP_1000G2 quirk. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415 Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-7-hdegoede@redhat.com Signed-off-by: Mark Brown commit 0a61bcbba8737fe6d43dc34070ffa84a2f12e990 Author: Hans de Goede Date: Thu Aug 19 21:05:42 2021 +0200 ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack In order to be able to do jack-detection reporting for the mic contact on the 2nd jack found on some devices, the DAPM topology needs to have a separate DAPM pin/input for that microphone, instead of re-using the "Internal Mic" pin which is normally used together with the IN1P input of the codec. Using the "Internal Mic" dapm-pin-switch for this in a snd_soc_jack_pin to report hotplug events causes the "Internal Mic" pin to get deactivated when unplugging a headset from the 2nd jack, thus turning off the actual Internal Mic (typically a pair of digital mics on devices with 2 jacks). Fixes: 79c1123bac3b ("ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input") Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-6-hdegoede@redhat.com Signed-off-by: Mark Brown commit e3f2a6603a982467601e0831d706786ed1ade833 Author: Hans de Goede Date: Thu Aug 19 21:05:41 2021 +0200 ASoC: rt5640: Add rt5640_set_ovcd_params() helper Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection to differentiate between headphones vs a headset. Move the ovcd init code from rt5640_enable_jack_detect() into a new rt5640_set_ovcd_params() helper and export this helper as well as a couple of related ovcd functions. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-5-hdegoede@redhat.com Signed-off-by: Mark Brown commit d21213b4503ea66777313e4345e116cc8a5366bf Author: Hans de Goede Date: Thu Aug 19 21:05:40 2021 +0200 ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset() Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection headphones vs headset detection done by rt5640_detect_headset(). In this case the jack-inserted check done by rt5640_detect_headset() needs to be done through a GPIO rather then by using the codec's builtin jack-detect. Add an optional hp_det_gpio parameter and export rt5640_detect_headset() for use on machines where jack-detect is handled outside of the codec. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com Signed-off-by: Mark Brown commit 15d54840ecf6f00061d03180394a0a21ff8ffa48 Author: Hans de Goede Date: Thu Aug 19 21:05:39 2021 +0200 ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack Delay requesting the IRQ until the machine-drv calls set_jack. The main reason for this is that the codec's IRQ is unused on some boards, in which case we really should not call request_irq at all. On some boards there is an IRQ listed at index 0 for the codec, but this is not connected to the codec, but rather is directly connected to the jack's jack-detect pin. These special setups will be handled by the machine-driver, but the machine driver can only request the IRQ if it is not first requested by the codec driver. Moving the request_irq to the set_jack callback (which will not get called in this case) avoids the codec-driver clobbering the IRQ. Moving the request_irq also removes the need to disable the IRQ immediately after requesting it, avoiding a small race (this could also have been fixed by using the new IRQF_NO_AUTOEN flag when requesting the IRQ). Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com Signed-off-by: Mark Brown commit 5caab9f48b96f6998fb23d38a7b57fca91ef1653 Author: Hans de Goede Date: Thu Aug 19 21:05:38 2021 +0200 ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file Move rt5640_disable_jack_detect() to above rt5640_enable_jack_detect(). This is a preparation patch for reworking how the IRQ gets requested. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210819190543.784415-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 44779a4b85abd1d1dab9e5b90bd5e6adcfc8143a Author: Stanislav Fomichev Date: Wed Aug 18 16:52:16 2021 -0700 bpf: Use kvmalloc for map keys in syscalls Same as previous patch but for the keys. memdup_bpfptr is renamed to kvmemdup_bpfptr (and converted to kvmalloc). Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210818235216.1159202-2-sdf@google.com commit f0dce1d9b7c81fc3dc9d0cc0bc7ef9b3eae22584 Author: Stanislav Fomichev Date: Wed Aug 18 16:52:15 2021 -0700 bpf: Use kvmalloc for map values in syscall Use kvmalloc/kvfree for temporary value when manipulating a map via syscall. kmalloc might not be sufficient for percpu maps where the value is big (and further multiplied by hundreds of CPUs). Can be reproduced with netcnt test on qemu with "-smp 255". Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210818235216.1159202-1-sdf@google.com commit 9e5747c57807ad8a04c356340190cfdd0bd54111 Author: Jiapeng Chong Date: Thu Aug 19 16:29:09 2021 +0800 soc: rockchip: io-domain: Remove unneeded semicolon Fix the following coccicheck warnings: ./drivers/soc/rockchip/io-domain.c:118:2-3: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/1629361749-97977-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Heiko Stuebner commit 9664efeb5b869bbe6bf932b0957e9faaaaf6af5a Author: Jason Wang Date: Wed Aug 18 22:44:22 2021 +0200 ARM: s3c: delete unneed local variable "delay" "delay" variable on line 79 can be deleted by returning "0" on line 88. Signed-off-by: Jason Wang Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210624055627.22295-1-wangborong@cdjrlc.com Link: https://lore.kernel.org/r/20210818204422.17919-1-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit 3666b167ea68997b73dd5b78678a1c3f0d6730bb Author: Yucong Sun Date: Thu Aug 19 09:36:09 2021 -0700 selftests/bpf: Adding delay in socketmap_listen to reduce flakyness This patch adds a 1ms delay to reduce flakyness of the test. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210819163609.2583758-1-fallentree@fb.com commit 3cfc88380413d20f777dc6648a38f683962e52bf Author: Jie Deng Date: Fri Jul 23 13:44:35 2021 +0800 i2c: virtio: add a virtio i2c frontend driver Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The device specification can be found on https://lists.oasis-open.org/archives/virtio-comment/202101/msg00008.html. By following the specification, people may implement different backend drivers to emulate different controllers according to their needs. Co-developed-by: Conghui Chen Signed-off-by: Conghui Chen Signed-off-by: Jie Deng Reviewed-by: Viresh Kumar Tested-by: Viresh Kumar Acked-by: Michael S. Tsirkin Signed-off-by: Wolfram Sang commit 9e5f10fe577be7974c721c0c2050fa6c967d4565 Author: Colin Ian King Date: Wed Aug 18 14:09:27 2021 +0100 octeontx2-af: remove redudant second error check on variable err A recent change added error checking messages and failed to remove one of the previous error checks. There are now two checks on variable err so the second one is redundant dead code and can be removed. Addresses-Coverity: ("Logically dead code") Fixes: a83bdada06bf ("octeontx2-af: Add debug messages for failures") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210818130927.33895-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit 185f690f2989d522b25e169371cb173ab5257199 Merge: 5c8a2bb481591 387da6bc7a826 Author: Jakub Kicinski Date: Thu Aug 19 11:51:13 2021 -0700 Merge tag 'linux-can-next-for-5.15-20210819' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== linux-can-next-for-5.15-20210819 The first patch is by me, for the mailmap file and maps the email address of two former ESD employees to a newly created role account. The next 3 patches are by Oleksij Rempel and add support for GPIO based switchable CAN bus termination. The next 3 patches are by Vincent Mailhol. The first one changes the CAN netlink interface to not bail out if the user switched off unsupported features. The next one adds Vincent as the maintainer of the etas_es58x driver and the last one cleans up the documentation of struct es58x_fd_tx_conf_msg. The next patch is by me, for the mcp251xfd driver and marks some instances of struct mcp251xfd_priv as const. Lad Prabhakar contributes 2 patches for the rcar_canfd driver, that add support for RZ/G2L family. The next 5 patches target the m_can/tcan45x5 driver. 2 are by me an fix trivial checkpatch warnings. The remaining 3 patches are by Matt Kline and improve the performance on the SPI based tcan4x5x chip by batching FIFO reads and writes. The last 7 patches are for the c_can driver. Dario Binacchi's patch converts the DT bindings to yaml, 2 patches by me fix a typo and rename a macro to properly represent the usage. The last 4 patches are again by Dario Binacchi and provide a performance improvement for the TX path by operating the TX mailboxes as a true FIFO. * tag 'linux-can-next-for-5.15-20210819' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: (22 commits) can: c_can: cache frames to operate as a true FIFO can: c_can: support tx ring algorithm can: c_can: exit c_can_do_tx() early if no frames have been sent can: c_can: remove struct c_can_priv::priv field can: c_can: rename IF_RX -> IF_NAPI can: c_can: c_can_do_tx(): fix typo in comment dt-bindings: net: can: c_can: convert to json-schema can: m_can: Batch FIFO writes during CAN transmit can: m_can: Batch FIFO reads during CAN receive can: m_can: Disable IRQs on FIFO bus errors can: m_can: fix block comment style can: tcan4x5x: cdev_to_priv(): remove stray empty line can: rcar_canfd: Add support for RZ/G2L family dt-bindings: net: can: renesas,rcar-canfd: Document RZ/G2L SoC can: mcp251xfd: mark some instances of struct mcp251xfd_priv as const can: etas_es58x: clean-up documentation of struct es58x_fd_tx_conf_msg MAINTAINERS: add Vincent MAILHOL as maintainer for the ETAS ES58X CAN/USB driver can: netlink: allow user to turn off unsupported features can: dev: provide optional GPIO based termination support dt-bindings: can: fsl,flexcan: enable termination-* bindings ... ==================== Link: https://lore.kernel.org/r/20210819133913.657715-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 594286b7574c6e8217b1c233cc0d0650f2268a77 Author: Yonghong Song Date: Thu Aug 19 08:52:09 2021 -0700 bpf: Fix NULL event->prog pointer access in bpf_overflow_handler Andrii reported that libbpf CI hit the following oops when running selftest send_signal: [ 1243.160719] BUG: kernel NULL pointer dereference, address: 0000000000000030 [ 1243.161066] #PF: supervisor read access in kernel mode [ 1243.161066] #PF: error_code(0x0000) - not-present page [ 1243.161066] PGD 0 P4D 0 [ 1243.161066] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 1243.161066] CPU: 1 PID: 882 Comm: new_name Tainted: G O 5.14.0-rc5 #1 [ 1243.161066] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 1243.161066] RIP: 0010:bpf_overflow_handler+0x9a/0x1e0 [ 1243.161066] Code: 5a 84 c0 0f 84 06 01 00 00 be 66 02 00 00 48 c7 c7 6d 96 07 82 48 8b ab 18 05 00 00 e8 df 55 eb ff 66 90 48 8d 75 48 48 89 e7 55 30 41 89 c4 e8 fb c1 f0 ff 84 c0 0f 84 94 00 00 00 e8 6e 0f [ 1243.161066] RSP: 0018:ffffc900000c0d80 EFLAGS: 00000046 [ 1243.161066] RAX: 0000000000000002 RBX: ffff8881002e0dd0 RCX: 00000000b4b47cf8 [ 1243.161066] RDX: ffffffff811dcb06 RSI: 0000000000000048 RDI: ffffc900000c0d80 [ 1243.161066] RBP: 0000000000000000 R08: 0000000000000000 R09: 1a9d56bb00000000 [ 1243.161066] R10: 0000000000000001 R11: 0000000000080000 R12: 0000000000000000 [ 1243.161066] R13: ffffc900000c0e00 R14: ffffc900001c3c68 R15: 0000000000000082 [ 1243.161066] FS: 00007fc0be2d3380(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 [ 1243.161066] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1243.161066] CR2: 0000000000000030 CR3: 0000000104f8e000 CR4: 00000000000006e0 [ 1243.161066] Call Trace: [ 1243.161066] [ 1243.161066] __perf_event_overflow+0x4f/0xf0 [ 1243.161066] perf_swevent_hrtimer+0x116/0x130 [ 1243.161066] ? __lock_acquire+0x378/0x2730 [ 1243.161066] ? __lock_acquire+0x372/0x2730 [ 1243.161066] ? lock_is_held_type+0xd5/0x130 [ 1243.161066] ? find_held_lock+0x2b/0x80 [ 1243.161066] ? lock_is_held_type+0xd5/0x130 [ 1243.161066] ? perf_event_groups_first+0x80/0x80 [ 1243.161066] ? perf_event_groups_first+0x80/0x80 [ 1243.161066] __hrtimer_run_queues+0x1a3/0x460 [ 1243.161066] hrtimer_interrupt+0x110/0x220 [ 1243.161066] __sysvec_apic_timer_interrupt+0x8a/0x260 [ 1243.161066] sysvec_apic_timer_interrupt+0x89/0xc0 [ 1243.161066] [ 1243.161066] asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 1243.161066] RIP: 0010:finish_task_switch+0xaf/0x250 [ 1243.161066] Code: 31 f6 68 90 2a 09 81 49 8d 7c 24 18 e8 aa d6 03 00 4c 89 e7 e8 12 ff ff ff 4c 89 e7 e8 ca 9c 80 00 e8 35 af 0d 00 fb 4d 85 f6 <58> 74 1d 65 48 8b 04 25 c0 6d 01 00 4c 3b b0 a0 04 00 00 74 37 f0 [ 1243.161066] RSP: 0018:ffffc900001c3d18 EFLAGS: 00000282 [ 1243.161066] RAX: 000000000000031f RBX: ffff888104cf4980 RCX: 0000000000000000 [ 1243.161066] RDX: 0000000000000000 RSI: ffffffff82095460 RDI: ffffffff820adc4e [ 1243.161066] RBP: ffffc900001c3d58 R08: 0000000000000001 R09: 0000000000000001 [ 1243.161066] R10: 0000000000000001 R11: 0000000000080000 R12: ffff88813bd2bc80 [ 1243.161066] R13: ffff8881002e8000 R14: ffff88810022ad80 R15: 0000000000000000 [ 1243.161066] ? finish_task_switch+0xab/0x250 [ 1243.161066] ? finish_task_switch+0x70/0x250 [ 1243.161066] __schedule+0x36b/0xbb0 [ 1243.161066] ? _raw_spin_unlock_irqrestore+0x2d/0x50 [ 1243.161066] ? lockdep_hardirqs_on+0x79/0x100 [ 1243.161066] schedule+0x43/0xe0 [ 1243.161066] pipe_read+0x30b/0x450 [ 1243.161066] ? wait_woken+0x80/0x80 [ 1243.161066] new_sync_read+0x164/0x170 [ 1243.161066] vfs_read+0x122/0x1b0 [ 1243.161066] ksys_read+0x93/0xd0 [ 1243.161066] do_syscall_64+0x35/0x80 [ 1243.161066] entry_SYSCALL_64_after_hwframe+0x44/0xae The oops can also be reproduced with the following steps: ./vmtest.sh -s # at qemu shell cd /root/bpf && while true; do ./test_progs -t send_signal Further analysis showed that the failure is introduced with commit b89fbfbb854c ("bpf: Implement minimal BPF perf link"). With the above commit, the following scenario becomes possible: cpu1 cpu2 hrtimer_interrupt -> bpf_overflow_handler (due to closing link_fd) bpf_perf_link_release -> perf_event_free_bpf_prog -> perf_event_free_bpf_handler -> WRITE_ONCE(event->overflow_handler, event->orig_overflow_handler) event->prog = NULL bpf_prog_run(event->prog, &ctx) In the above case, the event->prog is NULL for bpf_prog_run, hence causing oops. To fix the issue, check whether event->prog is NULL or not. If it is, do not call bpf_prog_run. This seems working as the above reproducible step runs more than one hour and I didn't see any failures. Fixes: b89fbfbb854c ("bpf: Implement minimal BPF perf link") Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210819155209.1927994-1-yhs@fb.com commit ab3c0ddb0d71dc214b61d11deb8770196ef46c05 Author: Riccardo Mancini Date: Fri Jul 30 17:34:12 2021 +0200 tools: Add sparse context/locking annotations in compiler-types.h This patch copies sparse context/locking annotations from include/compiler-types.h to tools/include/compiler-types.h. Committer notes: This will be used in the upcoming workqueue patchset. Signed-off-by: Riccardo Mancini Cc: Alexey Bayduraev Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http //lore.kernel.org/lkml/58b2f161ce856ec8b499f4dcf60a10adc84651e0.1627657061.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit dc7674eda002037d7a2d551e272037574507c2db Author: Bob Peterson Date: Wed Jun 30 12:49:59 2021 -0500 gfs2: tiny cleanup in gfs2_log_reserve Function gfs2_log_reserve was setting revoke_blks to 0. There's no need because it calculates it shortly thereafter. This patch removes the unnecessary set. Signed-off-by: Bob Peterson commit 69a61144f32b590650af8b5f1e1262f1a731f9c5 Author: Bob Peterson Date: Mon May 24 11:51:26 2021 -0500 gfs2: trivial clean up of gfs2_ail_error This patch does not change function. It adds variable sdp to clean up function gfs2_ail_error and make it more readable. Signed-off-by: Bob Peterson commit c37453cb87e38623cb47437fdbf54ffc1262cc45 Author: Bob Peterson Date: Mon Feb 22 10:29:46 2021 -0500 gfs2: be more verbose replaying invalid rgrp blocks This patch adds some crucial information when journal replay detects a replay of an obsolete rgrp block. For example, it wasn't printing the journal id or the generation number played. This just supplements what is logged in this unusual case. The function that actually complains about the replaying of an obsolete rgrp block has been split off to avoid long lines and sparse warnings. Signed-off-by: Bob Peterson commit bfeababd5141a110ddffff0fa1e7fd988d76292d Author: Håkon Bugge Date: Wed Aug 11 19:25:36 2021 +0200 RDMA/core/sa_query: Remove unused function ib_sa_service_rec_query() was introduced in kernel v2.6.13 by commit cbae32c56314 ("[PATCH] IB: Add Service Record support to SA client") in 2005. It was not used then and have never been used since. Removing it and related functions/structs. Link: https://lore.kernel.org/r/1628702736-12651-1-git-send-email-haakon.bugge@oracle.com Signed-off-by: Håkon Bugge Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6ef793cbd4656a7a0637404751f608674692235d Author: Prabhakar Kushwaha Date: Wed Aug 11 08:16:50 2021 +0300 RDMA/qedr: Move variables reset to qedr_set_common_qp_params() Qedr code is tightly coupled with existing both INIT transitions. Here, during first INIT transition all variables are reset and the RESET state is checked in post_recv() before any posting. Commit dc70f7c3ed34 ("RDMA/cma: Remove unnecessary INIT->INIT transition") exposed this bug. So moving variables reset to qedr_set_common_qp_params() and also avoid RESET state check for post_recv(). Link: https://lore.kernel.org/r/20210811051650.14914-1-pkushwaha@marvell.com Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: Prabhakar Kushwaha Signed-off-by: Jason Gunthorpe commit 5d925d9823aaf18d55fab784bd4ef11f80fe1099 Author: Colin Ian King Date: Wed Aug 18 16:17:46 2021 +0100 ASoC: uniphier: make arrays mul and div static const, makes object smaller Don't populate the arrays mul and div on the stack but instead make them static const. Makes the object code smaller by 4 bytes. Before: text data bss dec hex filename 16226 4984 64 21274 531a ./sound/soc/uniphier/aio-cpu.o After: text data bss dec hex filename 16062 5144 64 21270 5316 ./sound/soc/uniphier/aio-cpu.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Acked-by: Masami Hiramatsu Link: https://lore.kernel.org/r/20210818151746.38520-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 4b14f17912052a6963580dfba04781cfe6ccba02 Author: Biju Das Date: Wed Aug 18 11:14:50 2021 +0100 ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function dma_request_chan() returns error pointer in case of failures, but the rz_ssi_dma_request() checked for NULL pointer instead. This patch fixes the issue by checking for ERR_PTR() instead of NULL and sets the DMA pointers to NULL in error case so that ssi can fallback to PIO mode. Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support") Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210818101450.15948-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit d68f4c73d729245a47e70eb216fa24bc174ed2e2 Author: Christophe JAILLET Date: Wed Aug 18 22:55:56 2021 +0200 spi: coldfire-qspi: Use clk_disable_unprepare in the remove function 'clk_prepare_enable()' is used in the probe, so 'clk_disable_unprepare()' should be used in the remove function to be consistent. Fixes: 499de01c5c0b ("spi: coldfire-qspi: Use clk_prepare_enable and clk_disable_unprepare") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/ee91792ddba61342b0d3284cd4558a2b0016c4e7.1629319838.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit f9b459c2ba5edfe247e86b45ad5dea8da542f3ea Author: Sergey Shtylyov Date: Sun Jul 4 17:35:54 2021 +0300 i2c: hix5hd2: fix IRQ check Iff platform_get_irq() returns 0, the driver's probe() method will return 0 early (as if the method's call was successful). Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always override that decision... Fixes: 15ef27756b23 ("i2c: hix5hd2: add i2c controller driver") Signed-off-by: Sergey Shtylyov Signed-off-by: Wolfram Sang commit d6840a5e370b7ea4fde16ce2caf431bcc87f9a75 Author: Sergey Shtylyov Date: Sun Jul 4 17:45:25 2021 +0300 i2c: s3c2410: fix IRQ check Iff platform_get_irq() returns 0, the driver's probe() method will return 0 early (as if the method's call was successful). Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always override that decision... Fixes: e0d1ec97853f ("i2c-s3c2410: Change IRQ to be plain integer.") Signed-off-by: Sergey Shtylyov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit a1299505162ad00def3573260c2c68b9c8e8d697 Author: Sergey Shtylyov Date: Thu Aug 12 23:35:09 2021 +0300 i2c: iop3xx: fix deferred probing When adding the code to handle platform_get_irq*() errors in the commit 489447380a29 ("handle errors returned by platform_get_irq*()"), the actual error code was enforced to be -ENXIO in the driver for some strange reason. This didn't matter much until the deferred probing was introduced -- which requires an actual error code to be propagated upstream from the failure site. While fixing this, also stop overriding the errors from request_irq() to -EIO (done since the pre-git era). Fixes: 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()") Signed-off-by: Sergey Shtylyov Signed-off-by: Wolfram Sang commit 4c7f65aea7b7fe66c08f8f7304c1ea3f7a871d5a Author: Dave Chinner Date: Wed Aug 18 18:48:54 2021 -0700 xfs: rename buffer cache index variable b_bn To stop external users from using b_bn as the disk address of the buffer, rename it to b_rhash_key to indicate that it is the buffer cache index, not the block number of the buffer. Code that needs the disk address should use xfs_buf_daddr() to obtain it. Do the rename and clean up any of the remaining internal b_bn users. Also clean up any remaining b_bn cruft that is now unused. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9343ee76909e3f6466d85c9ebb0e343cdf54de71 Author: Dave Chinner Date: Wed Aug 18 18:47:05 2021 -0700 xfs: convert bp->b_bn references to xfs_buf_daddr() Stop directly referencing b_bn in code outside the buffer cache, as b_bn is supposed to be used only as an internal cache index. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 04fcad80cd068731a779fb442f78234732683755 Author: Dave Chinner Date: Wed Aug 18 18:46:57 2021 -0700 xfs: introduce xfs_buf_daddr() Introduce a helper function xfs_buf_daddr() to extract the disk address of the buffer from the struct xfs_buf. This will replace direct accesses to bp->b_bn and bp->b_maps[0].bm_bn, as well as the XFS_BUF_ADDR() macro. This patch introduces the helper function and replaces all uses of XFS_BUF_ADDR() as this is just a simple sed replacement. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit cf28e17c9186c83e7e8702f844bc40b6e782ce6c Author: Dave Chinner Date: Wed Aug 18 18:46:57 2021 -0700 xfs: kill xfs_sb_version_has_v3inode() All callers to xfs_dinode_good_version() and XFS_DINODE_SIZE() in both the kernel and userspace have a xfs_mount structure available which means they can use mount features checks instead looking directly are the superblock. Convert these functions to take a mount and use a xfs_has_v3inodes() check and move it out of the libxfs/xfs_format.h file as it really doesn't have anything to do with the definition of the on-disk format. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d6837c1aab42e70141fd3875ba05eb69ffb220f0 Author: Dave Chinner Date: Wed Aug 18 18:46:56 2021 -0700 xfs: introduce xfs_sb_is_v5 helper Rather than open coding XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 checks everywhere, add a simple wrapper to encapsulate this and make the code easier to read. This allows us to remove the xfs_sb_version_has_v3inode() wrapper which is only used in xfs_format.h now and is just a version number check. There are a couple of places where we should be checking the mount feature bits rather than the superblock version (e.g. remount), so those are converted to use xfs_has_crc(mp) instead. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2beb7b50ddd429f47b6cabd186b3102d2a6aa505 Author: Dave Chinner Date: Wed Aug 18 18:46:56 2021 -0700 xfs: remove unused xfs_sb_version_has wrappers The vast majority of these wrappers are now unused. Remove them leaving just the small subset of wrappers that are used to either add feature bits or make the mount features field setup code simpler. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ebd9027d088b3a4e49d294f79e6cadb7b7a88b28 Author: Dave Chinner Date: Wed Aug 18 18:46:55 2021 -0700 xfs: convert xfs_sb_version_has checks to use mount features This is a conversion of the remaining xfs_sb_version_has..(sbp) checks to use xfs_has_..(mp) feature checks. This was largely done with a vim replacement macro that did: :0,$s/xfs_sb_version_has\(.*\)&\(.*\)->m_sb/xfs_has_\1\2/g A couple of other variants were also used, and the rest touched up by hand. $ size -t fs/xfs/built-in.a text data bss dec hex filename before 1127533 311352 484 1439369 15f689 (TOTALS) after 1125360 311352 484 1437196 15ee0c (TOTALS) Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 55fafb31f9e988a4ba2a38fcfe6f507880394d1f Author: Dave Chinner Date: Wed Aug 18 18:46:54 2021 -0700 xfs: convert scrub to use mount-based feature checks The scrub feature checks are the last place that the superblock feature checks are used. Convert them to mount based feature checks. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fe08cc5044486096bfb5ce9d3db4e915e53281ea Author: Dave Chinner Date: Wed Aug 18 18:46:54 2021 -0700 xfs: open code sb verifier feature checks The superblock verifiers are one of the last places that use the sb version functions to do feature checks. This are all quite simple uses, and there aren't many of them so open code them all. Also, move the good version number check into xfs_sb.c instead of it being an inline function in xfs_format.h Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 03288b19093b9bcff72f0d5f90c578daf053f759 Author: Dave Chinner Date: Wed Aug 18 18:46:54 2021 -0700 xfs: convert xfs_fs_geometry to use mount feature checks Reporting filesystem features to userspace is currently superblock based. Now we have a general mount-based feature infrastructure, switch to using the xfs_mount rather than the superblock directly. This reduces the size of the function by over 300 bytes. $ size -t fs/xfs/built-in.a text data bss dec hex filename before 1127855 311352 484 1439691 15f7cb (TOTALS) after 1127535 311352 484 1439371 15f68b (TOTALS) Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 75c8c50fa16a23f8ac89ea74834ae8ddd1558d75 Author: Dave Chinner Date: Wed Aug 18 18:46:53 2021 -0700 xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown Remove the shouty macro and instead use the inline function that matches other state/feature check wrapper naming. This conversion was done with sed. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2e973b2cd4cdb993be94cca4c33f532f1ed05316 Author: Dave Chinner Date: Wed Aug 18 18:46:52 2021 -0700 xfs: convert remaining mount flags to state flags The remaining mount flags kept in m_flags are actually runtime state flags. These change dynamically, so they really should be updated atomically so we don't potentially lose an update due to racing modifications. Convert these remaining flags to be stored in m_opstate and use atomic bitops to set and clear the flags. This also adds a couple of simple wrappers for common state checks - read only and shutdown. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0560f31a09e523090d1ab2bfe21c69d028c2bdf2 Author: Dave Chinner Date: Wed Aug 18 18:46:52 2021 -0700 xfs: convert mount flags to features Replace m_flags feature checks with xfs_has_() calls and rework the setup code to set flags in m_features. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8970a5b8a46c526a738db2cb89173aa0a2fd02a9 Author: Dave Chinner Date: Wed Aug 18 18:46:51 2021 -0700 xfs: consolidate mount option features in m_features This provides separation of mount time feature flags from runtime mount flags and mount option state. It also makes the feature checks use the same interface as the superblock features. i.e. we don't care if the feature is enabled by superblock flags or mount options, we just care if it's enabled or not. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 38c26bfd90e1999650d5ef40f90d721f05916643 Author: Dave Chinner Date: Wed Aug 18 18:46:37 2021 -0700 xfs: replace xfs_sb_version checks with feature flag checks Convert the xfs_sb_version_hasfoo() to checks against mp->m_features. Checks of the superblock itself during disk operations (e.g. in the read/write verifiers and the to/from disk formatters) are not converted - they operate purely on the superblock state. Everything else should use the mount features. Large parts of this conversion were done with sed with commands like this: for f in `git grep -l xfs_sb_version_has fs/xfs/*.c`; do sed -i -e 's/xfs_sb_version_has\(.*\)(&\(.*\)->m_sb)/xfs_has_\1(\2)/' $f done With manual cleanups for things like "xfs_has_extflgbit" and other little inconsistencies in naming. The result is ia lot less typing to check features and an XFS binary size reduced by a bit over 3kB: $ size -t fs/xfs/built-in.a text data bss dec hex filenam before 1130866 311352 484 1442702 16038e (TOTALS) after 1127727 311352 484 1439563 15f74b (TOTALS) Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a1d86e8dec8c1325d301c9d5594bb794bc428fc3 Author: Dave Chinner Date: Wed Aug 18 18:46:26 2021 -0700 xfs: reflect sb features in xfs_mount Currently on-disk feature checks require decoding the superblock fileds and so can be non-trivial. We have almost 400 hundred individual feature checks in the XFS code, so this is a significant amount of code. To reduce runtime check overhead, pre-process all the version flags into a features field in the xfs_mount at mount time so we can convert all the feature checks to a simple flag check. There is also a need to convert the dynamic feature flags to update the m_features field. This is required for attr, attr2 and quota features. New xfs_mount based wrappers are added for this. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e23b55d537c9be60ae918fa6c3be0d699986f346 Author: Dave Chinner Date: Wed Aug 18 18:46:25 2021 -0700 xfs: rework attr2 feature and mount options The attr2 feature is somewhat unique in that it has both a superblock feature bit to enable it and mount options to enable and disable it. Back when it was first introduced in 2005, attr2 was disabled unless either the attr2 superblock feature bit was set, or the attr2 mount option was set. If the superblock feature bit was not set but the mount option was set, then when the first attr2 format inode fork was created, it would set the superblock feature bit. This is as it should be - the superblock feature bit indicated the presence of the attr2 on disk format. The noattr2 mount option, however, did not affect the superblock feature bit. If noattr2 was specified, the on-disk superblock feature bit was ignored and the code always just created attr1 format inode forks. If neither of the attr2 or noattr2 mounts option were specified, then the behaviour was determined by the superblock feature bit. This was all pretty sane. Fast foward 3 years, and we are dealing with fallout from the botched sb_features2 addition and having to deal with feature mismatches between the sb_features2 and sb_bad_features2 fields. The attr2 feature bit was one of these flags. The reconciliation was done well after mount option parsing and, unfortunately, the feature reconciliation had a bug where it ignored the noattr2 mount option. For reasons lost to the mists of time, it was decided that resolving this issue in commit 7c12f296500e ("[XFS] Fix up noattr2 so that it will properly update the versionnum and features2 fields.") required noattr2 to clear the superblock attr2 feature bit. This greatly complicated the attr2 behaviour and broke rules about feature bits needing to be set when those specific features are present in the filesystem. By complicated, I mean that it introduced problems due to feature bit interactions with log recovery. All of the superblock feature bit checks are done prior to log recovery, but if we crash after removing a feature bit, then on the next mount we see the feature bit in the unrecovered superblock, only to have it go away after the log has been replayed. This means our mount time feature processing could be all wrong. Hence you can mount with noattr2, crash shortly afterwards, and mount again without attr2 or noattr2 and still have attr2 enabled because the second mount sees attr2 still enabled in the superblock before recovery runs and removes the feature bit. It's just a mess. Further, this is all legacy code as the v5 format requires attr2 to be enabled at all times and it cannot be disabled. i.e. the noattr2 mount option returns an error when used on v5 format filesystems. To straighten this all out, this patch reverts the attr2/noattr2 mount option behaviour back to the original behaviour. There is no reason for disabling attr2 these days, so we will only do this when the noattr2 mount option is set. This will not remove the superblock feature bit. The superblock bit will provide the default behaviour and only track whether attr2 is present on disk or not. The attr2 mount option will enable the creation of attr2 format inode forks, and if the superblock feature bit is not set it will be added when the first attr2 inode fork is created. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 51b495eba84dee8c1df4abfc26fc134ea190e28f Author: Dave Chinner Date: Wed Aug 18 18:46:25 2021 -0700 xfs: rename xfs_has_attr() xfs_has_attr() is poorly named. It has global scope as it is defined in a header file, but it has no namespace scope that tells us what it is checking has attributes. It's not even clear what "has_attr" means, because what it is actually doing is an attribute fork lookup to see if the attribute exists. Upcoming patches use this "xfs_has_" namespace for global filesystem features, which conflicts with this function. Rename xfs_has_attr() to xfs_attr_lookup() and make it a static function, freeing up the "xfs_has_" namespace for global scope usage. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8cf07f3dd56195316be97758cb8b4e1d7183ea84 Author: Dave Chinner Date: Wed Aug 18 18:46:24 2021 -0700 xfs: sb verifier doesn't handle uncached sb buffer The verifier checks explicitly for bp->b_bn == XFS_SB_DADDR to match the primary superblock buffer, but the primary superblock is an uncached buffer and so bp->b_bn is always -1ULL. Hence this never matches and the CRC error reporting is wholly dependent on the mount superblock already being populated so CRC feature checks pass and allow CRC errors to be reported. Fix this so that the primary superblock CRC error reporting is not dependent on already having read the superblock into memory. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit e5f2e54a902de721d9cf4e7f7c35612131654cd7 Author: Darrick J. Wong Date: Wed Aug 18 20:04:44 2021 -0700 xfs: start documenting common units and tags used in tracepoints Because there are a lot of tracepoints that express numeric data with an associated unit and tag, document what they are to help everyone else keep these thigns straight. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit c03e4b9e6b645a5020f128aeb739a5424c6abe8c Author: Darrick J. Wong Date: Tue Aug 17 15:42:40 2021 -0700 xfs: decode scrub flags in ftrace output When using pretty-printed scrub tracepoints, decode the meaning of the scrub flags as strings for easier reading. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit b641851cb8e4c2a9fb08567bacfbb86bd9539996 Author: Darrick J. Wong Date: Tue Aug 17 15:45:25 2021 -0700 xfs: standardize inode generation formatting in ftrace output Always print inode generation in hexadecimal and preceded with the unit "gen". Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 7eac3029a2e55edadf78624729d30f2a8af2f358 Author: Darrick J. Wong Date: Tue Aug 17 13:15:53 2021 -0700 xfs: standardize remaining xfs_buf length tracepoints For the remaining xfs_buf tracepoints, convert all the tags to xfs_daddr_t units and retag them 'daddrcount' to match everything else. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit f93f85f77aa80f3e4d5bada01248c98da32933c5 Author: Darrick J. Wong Date: Tue Aug 17 13:09:26 2021 -0700 xfs: resolve fork names in trace output Emit whichfork values as text strings in the ftrace output. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit c23460ebd54c00dfca643397cf5b8bb924ced70b Author: Darrick J. Wong Date: Tue Aug 17 13:03:19 2021 -0700 xfs: rename i_disk_size fields in ftrace output Whenever we record i_disk_size (i.e. the ondisk file size), use the "disize" tag and hexadecimal format consistently. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit d538cf24c603a0a4553ecbc895b5ecc8fa78d8b9 Author: Darrick J. Wong Date: Tue Aug 17 13:00:13 2021 -0700 xfs: disambiguate units for ftrace fields tagged "count" Some of our tracepoints have a field known as "count". That name doesn't describe any units, which makes the fields not very useful. Rename the fields to capture units and ensure the format is hexadecimal when we're referring to blocks, extents, or IO operations. "fsbcount" are in units of fs blocks "bytecount" are in units of bytes Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 7989accc6eb0cba3941493562f810d36062a68f3 Author: Darrick J. Wong Date: Tue Aug 17 12:45:59 2021 -0700 xfs: disambiguate units for ftrace fields tagged "len" Some of our tracepoints have a field known as "len". That name doesn't describe any units, which makes the fields not very useful. Rename the fields to capture units and ensure the format is hexadecimal. "fsbcount" are in units of fs blocks "bbcount" are in units of 512b blocks "ireccount" are in units of inodes Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino commit 49e68c91da5e5bdc91d1b8f4df776663a0f19952 Author: Darrick J. Wong Date: Tue Aug 17 10:09:12 2021 -0700 xfs: disambiguate units for ftrace fields tagged "offset" Some of our tracepoints describe fields as "offset". That name doesn't describe any units, which makes the fields not very useful. Rename the fields to capture units and ensure the format is hexadecimal. "fileoff" means file offset, in units of fs blocks "pos" means file offset, in bytes "forkoff" means inode fork offset, in bytes The one remaining "offset" value is for iclogs, since that's the byte offset of the end of where we've written into the current iclog. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 6f25b211d32b31557e0fde872a01fe7f86136747 Author: Darrick J. Wong Date: Tue Aug 17 10:03:45 2021 -0700 xfs: disambiguate units for ftrace fields tagged "blkno", "block", or "bno" Some of our tracepoints describe fields as "blkno", "block", or "bno". That name doesn't describe any units, which makes the fields not very useful. Rename the fields to capture units and ensure the format is hexadecimal. "startblock" is the startblock field from the bmap structure, which is a segmented fsblock on the data device, or an rfsblock on the realtime device. "fileoff" is a file offset, in units of filesystem blocks "daddr" is a raw device offset, in 512b blocks Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 92eff38665ad9b1ffc4e89c7efee1d78bf51cbd1 Author: Darrick J. Wong Date: Tue Aug 17 09:44:38 2021 -0700 xfs: standardize daddr formatting in ftrace output Always print disk addr (i.e. 512 byte block) numbers in hexadecimal and preceded with the unit "daddr". Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 97f4f9153da53ca24e69fe40c6b4358e5f57cab7 Author: Darrick J. Wong Date: Tue Aug 17 09:35:43 2021 -0700 xfs: standardize rmap owner number formatting in ftrace output Always print rmap owner number in hexadecimal and preceded with the unit "owner". Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit f7b08163b7a9fcaee4a8de43f28caa13e687235b Author: Darrick J. Wong Date: Tue Aug 17 09:28:53 2021 -0700 xfs: standardize AG block number formatting in ftrace output Always print allocation group block numbers in hexadecimal and preceded with the unit "agbno". Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 9febf39dfe5a58c93d58707a1e4fd2fb2d42077d Author: Darrick J. Wong Date: Tue Aug 17 09:24:26 2021 -0700 xfs: standardize AG number formatting in ftrace output Always print allocation group numbers in hexadecimal and preceded with the unit "agno". Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit af6265a008e561170e7c9b3535bb22fb2f29040e Author: Darrick J. Wong Date: Tue Aug 17 09:20:27 2021 -0700 xfs: standardize inode number formatting in ftrace output Always print inode numbers in hexadecimal and preceded with the unit "ino" or "agino", as apropriate. Fix one tracepoint that used "ino %u" for an inode btree block count to reduce confusion. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit 3fd7cb845bee6281e060e695e99a03dba69b7a1d Author: Darrick J. Wong Date: Tue Aug 17 09:49:42 2021 -0700 xfs: fix incorrect unit conversion in scrub tracepoint XFS_DADDR_TO_FSB converts a raw disk address (in units of 512b blocks) to a raw disk address (in units of fs blocks). Unfortunately, the xchk_block_error_class tracepoints incorrectly uses this to decode xfs_daddr_t into segmented AG number and AG block addresses. Use the correct translation code. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Carlos Maiolino commit f9dabe016b63c9629e152bf876c126c29de223cb Author: Daniel Borkmann Date: Thu Aug 19 15:59:33 2021 +0200 bpf: Undo off-by-one in interpreter tail call count limit The BPF interpreter as well as x86-64 BPF JIT were both in line by allowing up to 33 tail calls (however odd that number may be!). Recently, this was changed for the interpreter to reduce it down to 32 with the assumption that this should have been the actual limit "which is in line with the behavior of the x86 JITs" according to b61a28cf11d61 ("bpf: Fix off-by-one in tail call count limiting"). Paul recently reported: I'm a bit surprised by this because I had previously tested the tail call limit of several JIT compilers and found it to be 33 (i.e., allowing chains of up to 34 programs). I've just extended a test program I had to validate this again on the x86-64 JIT, and found a limit of 33 tail calls again [1]. Also note we had previously changed the RISC-V and MIPS JITs to allow up to 33 tail calls [2, 3], for consistency with other JITs and with the interpreter. We had decided to increase these two to 33 rather than decrease the other JITs to 32 for backward compatibility, though that probably doesn't matter much as I'd expect few people to actually use 33 tail calls. [1] https://github.com/pchaigno/tail-call-bench/commit/ae7887482985b4b1745c9b2ef7ff9ae506c82886 [2] 96bc4432f5ad ("bpf, riscv: Limit to 33 tail calls") [3] e49e6f6db04e ("bpf, mips: Limit to 33 tail calls") Therefore, revert b61a28cf11d61 to re-align interpreter to limit a maximum of 33 tail calls. While it is unlikely to hit the limit for the vast majority, programs in the wild could one way or another depend on this, so lets rather be a bit more conservative, and lets align the small remainder of JITs to 33. If needed in future, this limit could be slightly increased, but not decreased. Fixes: b61a28cf11d61 ("bpf: Fix off-by-one in tail call count limiting") Reported-by: Paul Chaignon Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Johan Almbladh Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/CAO5pjwTWrC0_dzTbTHFPSqDwA56aVH+4KFGVqdq8=ASs0MqZGQ@mail.gmail.com commit aee742c9928ab4f5f4e0b00f41fb2d2cffae179e Author: Alexander Aring Date: Wed Aug 18 16:27:14 2021 -0400 fs: dlm: fix return -EINTR on recovery stopped This patch will return -EINTR instead of 1 if recovery is stopped. In case of ping_members() the return value will be checked if the error is -EINTR for signaling another recovery was triggered and the whole recovery process will come to a clean end to process the next one. Returning 1 will abort the recovery process and can leave the recovery in a broken state. It was reported with the following kernel log message attached and a gfs2 mount stopped working: "dlm: bobvirt1: dlm_recover_members error 1" whereas 1 was returned because of a conversion of "dlm_recovery_stopped()" to an errno was missing which this patch will introduce. While on it all other possible missing errno conversions at other places were added as they are done as in other places. It might be worth to check the error case at this recovery level, because some of the functionality also returns -ENOBUFS and check why recovery ends in a broken state. However this will fix the issue if another recovery was triggered at some points of recovery handling. Reported-by: Bob Peterson Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit b97f85259fca5accc2cd5f7c4f42fa0dd8efda48 Author: Alexander Aring Date: Wed Aug 18 16:27:13 2021 -0400 fs: dlm: implement delayed ack handling This patch changes that we don't ack each message. Lowcomms will take care about to send an ack back after a bulk of messages was processed. Currently it's only when the whole receive buffer was processed, there might better positions to send an ack back but only the lowcomms implementation know when there are more data to receive. This patch has also disadvantages that we might retransmit more on errors, however this is a very rare case. Tested with make_panic on gfs2 with three nodes by running: trace-cmd record -p function -l 'dlm_send_ack' sleep 100 and trace-cmd report | wc -l Before patch: - 20548 - 21376 - 21398 After patch: - 18338 - 20679 - 19949 Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 61969ef867d48fc76551fe50cefe0501e624766e Author: Kangmin Park Date: Fri Aug 20 00:27:18 2021 +0900 Bluetooth: Fix return value in hci_dev_do_close() hci_error_reset() return without calling hci_dev_do_open() when hci_dev_do_close() return error value which is not 0. Also, hci_dev_close() return hci_dev_do_close() function's return value. But, hci_dev_do_close() return always 0 even if hdev->shutdown return error value. So, fix hci_dev_do_close() to save and return the return value of the hdev->shutdown when it is called. Signed-off-by: Kangmin Park Signed-off-by: Marcel Holtmann commit f41a4b2b5eb7872109723dab8ae1603bdd9d9ec1 Author: Pavel Skripkin Date: Thu Aug 19 18:15:21 2021 +0300 Bluetooth: add timeout sanity check to hci_inquiry Syzbot hit "task hung" bug in hci_req_sync(). The problem was in unreasonable huge inquiry timeout passed from userspace. Fix it by adding sanity check for timeout value to hci_inquiry(). Since hci_inquiry() is the only user of hci_req_sync() with user controlled timeout value, it makes sense to check timeout value in hci_inquiry() and don't touch hci_req_sync(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-and-tested-by: syzbot+be2baed593ea56c6a84c@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Marcel Holtmann commit 9dbacd465ab733d4ac415ccfaf4a0503387377e8 Merge: 0fbd7409446a8 2f9b25fa66821 Author: Arnd Bergmann Date: Thu Aug 19 17:02:52 2021 +0200 Merge tag 'aspeed-5.15-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/soc ASPEED soc updates for 5.15 * Two fixes for drivers that control the mapping of BMC memory over PCIe and LPC * Re-enable FWH2AHB on systems that have it closed off by default * A new id for the AST2625, an AST2600 variant * tag 'aspeed-5.15-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: soc: aspeed: Re-enable FWH2AHB on AST2600 soc: aspeed: socinfo: Add AST2625 variant soc: aspeed: p2a-ctrl: Fix boundary check for mmap soc: aspeed: lpc-ctrl: Fix boundary check for mmap Signed-off-by: Arnd Bergmann commit 8274db0776d12de1be87a8504e60a608cb1b2212 Author: Max Chou Date: Tue Aug 17 11:03:12 2021 +0800 Bluetooth: btusb: Remove WAKEUP_DISABLE and add WAKEUP_AUTOSUSPEND for Realtek devices For the commit of 9e45524a011107a73bc2cdde8370c61e82e93a4d, wakeup is always disabled for Realtek devices. However, there's the capability for Realtek devices to apply USB wakeup. In this commit, remove WAKEUP_DISABLE feature for Realtek devices. If users would switch wakeup, they should access "/sys/bus/usb/.../power/wakeup" In this commit, it also adds the feature as WAKEUP_AUTOSUSPEND for Realtek devices because it should set do_remote_wakeup on autosuspend. Signed-off-by: Max Chou Tested-by: Hilda Wu Reviewed-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann commit a31e5a4158d03595ca4258b94397d4097be0ebe4 Author: Kees Cook Date: Tue Aug 17 21:39:12 2021 -0700 Bluetooth: mgmt: Pessimize compile-time bounds-check After gaining __alloc_size hints, GCC thinks it can reach a memcpy() with eir_len == 0 (since it can't see into the rewrite of status). Instead, check eir_len == 0, avoiding this future warning: In function 'eir_append_data', inlined from 'read_local_oob_ext_data_complete' at net/bluetooth/mgmt.c:7210:12: ./include/linux/fortify-string.h:54:29: warning: '__builtin_memcpy' offset 5 is out of the bounds [0, 3] [-Warray-bounds] ... net/bluetooth/hci_request.h:133:2: note: in expansion of macro 'memcpy' 133 | memcpy(&eir[eir_len], data, data_len); | ^~~~~~ Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-bluetooth@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Marcel Holtmann commit 4b89451d2c3d488b304306f8b2d1afc7c28b4f78 Author: Christoph Hellwig Date: Tue Aug 10 17:17:11 2021 +0200 RDMA/hfi1: Stop using seq_get_buf in _driver_stats_seq_show Just use seq_write to copy the stats into the seq_file buffer instead of poking holes into the seq_file abstraction. Link: https://lore.kernel.org/r/20210810151711.1795374-1-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Mike Marciniszyn Tested-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 7c52009d94ab561e70cb72e007a6076f20451f85 Author: Kishon Vijay Abraham I Date: Wed Aug 11 18:03:36 2021 +0530 misc: pci_endpoint_test: Add deviceID for AM64 and J7200 Add device ID specific to AM64 and J7200 in pci_endpoint_test so that endpoints configured with those deviceIDs can use pci_endpoint_test driver. Link: https://lore.kernel.org/r/20210811123336.31357-6-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit c8a375a8e15ac31293d7fda08008d6da8f5df3db Author: Kishon Vijay Abraham I Date: Wed Aug 11 18:03:35 2021 +0530 PCI: j721e: Add PCIe support for AM64 AM64 has the same PCIe IP as in J7200 with certain erratas not applicable (quirk_detect_quiet_flag). Add support for "ti,am64-pcie-host" compatible and "ti,am64-pcie-ep" compatible that is specific to AM64. Link: https://lore.kernel.org/r/20210811123336.31357-5-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit f1de58802f0fff364cf49f5e47d1be744baa434f Author: Kishon Vijay Abraham I Date: Wed Aug 11 18:03:34 2021 +0530 PCI: j721e: Add PCIe support for J7200 J7200 has the same PCIe IP as in J721E with minor changes in the wrapper. J7200 allows byte access of bridge configuration space registers and the register field for LINK_DOWN interrupt is different. J7200 also requires "quirk_detect_quiet_flag" to be set. Configure these changes as part of driver data applicable only to J7200. Link: https://lore.kernel.org/r/20210811123336.31357-4-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 09c24094b2e3a15ef3fc44f54a191b3db522fb11 Author: Nadeem Athani Date: Wed Aug 11 18:03:33 2021 +0530 PCI: cadence: Add quirk flag to set minimum delay in LTSSM Detect.Quiet state 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. Add a quirk flag "quirk_detect_quiet_flag" to program the minimum time the LTSSM should wait on entering Detect.Quiet state here. This has to be set for J7200 as it has an incorrect tie-off on unused lanes. Link: https://lore.kernel.org/r/20210811123336.31357-3-kishon@ti.com Signed-off-by: Nadeem Athani Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit f4455748b2126a9ba2bcc9cfb2fbcaa08de29bb2 Author: Kishon Vijay Abraham I Date: Wed Aug 11 18:03:32 2021 +0530 PCI: cadence: Use bitfield for *quirk_retrain_flag* instead of bool No functional change. As we are intending to add additional 1-bit members in struct j721e_pcie_data/struct cdns_pcie_rc, use bitfields instead of bool since it takes less space. As discussed in [1], the preference is to use bitfileds instead of bool inside structures. [1] -> https://lore.kernel.org/linux-fsdevel/CA+55aFzKQ6Pj18TB8p4Yr0M4t+S+BsiHH=BJNmn=76-NcjTj-g@mail.gmail.com/ Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210811123336.31357-2-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 00c85b6576d3a9c9d9f0320a59b1e7b5bd25ade4 Author: Christophe JAILLET Date: Thu Aug 5 19:43:36 2021 +0200 RDMA/rtrs: Remove a useless kfree() 'sess->rbufs' is known to be NULL here, so there is no point in kfree'ing it. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Link: https://lore.kernel.org/r/9a57c9f837fa2c6f0070578a1bc4840688f62962.1628185335.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Acked-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit c4c7d7a43246a42b0355692c3ed53dff7cbb29bb Author: YueHaibing Date: Wed Aug 4 20:59:39 2021 +0800 RDMA/hns: Fix return in hns_roce_rereg_user_mr() If re-registering an MR in hns_roce_rereg_user_mr(), we should return NULL instead of passing 0 to ERR_PTR for clarity. Fixes: 4e9fc1dae2a9 ("RDMA/hns: Optimize the MR registration process") Link: https://lore.kernel.org/r/20210804125939.20516-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Signed-off-by: Jason Gunthorpe commit 8e242060c6a4947e8ae7d29794af6a581db08841 Author: Masami Hiramatsu Date: Thu Aug 19 19:26:02 2021 +0900 tracing/probes: Reject events which have the same name of existing one Since kprobe_events and uprobe_events only check whether the other same-type probe event has the same name or not, if the user gives the same name of the existing tracepoint event (or the other type of probe events), it silently fails to create the tracefs entry (but registered.) as below. /sys/kernel/tracing # ls events/task/task_rename enable filter format hist id trigger /sys/kernel/tracing # echo p:task/task_rename vfs_read >> kprobe_events [ 113.048508] Could not create tracefs 'task_rename' directory /sys/kernel/tracing # cat kprobe_events p:task/task_rename vfs_read To fix this issue, check whether the existing events have the same name or not in trace_probe_register_event_call(). If exists, it rejects to register the new event. Link: https://lkml.kernel.org/r/162936876189.187130.17558311387542061930.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 0c84f5bf3eb324402a836f47b0958a19d6c47a68 Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:43 2021 +0530 Documentation: PCI: endpoint/pci-endpoint-cfs: Guide to use SR-IOV Add Documentation to help users use PCI endpoint to create virtual functions using configfs. An endpoint function is designated as a virtual endpoint function device when it is linked to a physical endpoint function device (instead of a endpoint controller). Link: https://lore.kernel.org/r/20210819123343.1951-9-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 489b1f41e54fc47596ffcb420439204f760153dd Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:42 2021 +0530 misc: pci_endpoint_test: Populate sriov_configure ops to configure SR-IOV device Populate sriov_configure ops with pci_sriov_configure_simple to configure SR-IOV device. Link: https://lore.kernel.org/r/20210819123343.1951-8-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit e19a0adf6e8bb0b93a546b8d4c7f8f6891115bbb Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:41 2021 +0530 PCI: cadence: Add support to configure virtual functions Now that support for SR-IOV is added in PCIe endpoint core, add support to configure virtual functions in the Cadence PCIe EP driver. Link: https://lore.kernel.org/r/20210819123343.1951-7-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 0cf985d6119cc21fc39774b4b29dcf1e0148bf55 Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:40 2021 +0530 PCI: cadence: Simplify code to get register base address for configuring BAR No functional change. Simplify code to get register base address for configuring PCI BAR. Link: https://lore.kernel.org/r/20210819123343.1951-6-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 53fd3cbe5e9d791d6bb6059f73a3851f155ce7c6 Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:39 2021 +0530 PCI: endpoint: Add virtual function number in pci_epc ops Add virtual function number in pci_epc ops. EPC controller driver can perform virtual function specific initialization based on the virtual function number. Link: https://lore.kernel.org/r/20210819123343.1951-5-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 101600e79045c2e93fd984302698e263cffa725b Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:38 2021 +0530 PCI: endpoint: Add support to link a physical function to a virtual function While the physical function has to be linked to endpoint controller, the virtual function has to be linked to a physical function. Add support to link a physical function to a virtual function in pci-ep-cfs. Link: https://lore.kernel.org/r/20210819123343.1951-4-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit 1cf362e907f36f104b9cf590ee6ced786226b388 Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:37 2021 +0530 PCI: endpoint: Add support to add virtual function in endpoint core Add support to add virtual function in endpoint core. The virtual function can only be associated with a physical function instead of a endpoint controller. Provide APIs to associate a virtual function with a physical function here. [weiyongjun1@huawei.com: PCI: endpoint: Fix missing unlock on error in pci_epf_add_vepf() - Reported-by: Hulk Robot ] Link: https://lore.kernel.org/r/20210819123343.1951-3-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Wei Yongjun Signed-off-by: Lorenzo Pieralisi commit f00bfc6489952528947cba05af158a4badf41688 Author: Kishon Vijay Abraham I Date: Thu Aug 19 18:03:36 2021 +0530 dt-bindings: PCI: pci-ep: Add binding to specify virtual function Add binding to specify virtual function (associated with each physical function) in endpoint mode. Link: https://lore.kernel.org/r/20210819123343.1951-2-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 8565a45d0858078b63c7d84074a21a42ba9ebf01 Author: Steven Rostedt (VMware) Date: Thu Aug 19 00:13:28 2021 -0400 tracing/probes: Have process_fetch_insn() take a void * instead of pt_regs In preparation to allow event probes to use the process_fetch_insn() callback in trace_probe_tmpl.h, change the data passed to it from a pointer to pt_regs, as the event probe will not be using regs, and make it a void pointer instead. Update the process_fetch_insn() callers for kprobe and uprobe events to have the regs defined in the function and just typecast the void pointer parameter. Link: https://lkml.kernel.org/r/20210819041842.291622924@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 007517a01995fb24f2f4effc9cf34814361a9d10 Author: Steven Rostedt (VMware) Date: Thu Aug 19 00:13:27 2021 -0400 tracing/probe: Change traceprobe_set_print_fmt() to take a type Instead of a boolean "is_return" have traceprobe_set_print_fmt() take a type (currently just PROBE_PRINT_NORMAL and PROBE_PRINT_RETURN). This will simplify adding different types. For example, the development of the event_probe, will need its own type as it prints an event, and not an IP. Link: https://lkml.kernel.org/r/20210819041842.104626301@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 387da6bc7a826cc6d532b1c0002b7c7513238d5f Author: Dario Binacchi Date: Sat Aug 7 15:08:00 2021 +0200 can: c_can: cache frames to operate as a true FIFO As reported by a comment in the c_can_start_xmit() this was not a FIFO. C/D_CAN controller sends out the buffers prioritized so that the lowest buffer number wins. What did c_can_start_xmit() do if head was less tail in the tx ring ? It waited until all the frames queued in the FIFO was actually transmitted by the controller before accepting a new CAN frame to transmit, even if the FIFO was not full, to ensure that the messages were transmitted in the order in which they were loaded. By storing the frames in the FIFO without requiring its transmission, we will be able to use the full size of the FIFO even in cases such as the one described above. The transmission interrupt will trigger their transmission only when all the messages previously loaded but stored in less priority positions of the buffers have been transmitted. Link: https://lore.kernel.org/r/20210807130800.5246-5-dariobin@libero.it Suggested-by: Gianluca Falavigna Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 28e86e9ab522e65b08545e5008d0f1ac5b19dad1 Author: Dario Binacchi Date: Sat Aug 7 15:07:59 2021 +0200 can: c_can: support tx ring algorithm The algorithm is already used successfully by other CAN drivers (e.g. mcp251xfd). Its implementation was kindly suggested to me by Marc Kleine-Budde following a patch I had previously submitted. You can find every detail at https://lore.kernel.org/patchwork/patch/1422929/. The idea is that after this patch, it will be easier to patch the driver to use the message object memory as a true FIFO. Link: https://lore.kernel.org/r/20210807130800.5246-4-dariobin@libero.it Suggested-by: Marc Kleine-Budde Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit a54cdbba9deee77ca48b5eec0c26fcc72538538c Author: Dario Binacchi Date: Sat Aug 7 15:07:58 2021 +0200 can: c_can: exit c_can_do_tx() early if no frames have been sent The c_can_poll() handles RX/TX events unconditionally. It may therefore happen that c_can_do_tx() is called unnecessarily because the interrupt was triggered by the reception of a frame. In these cases, we avoid to execute unnecessary statements and exit immediately. Link: https://lore.kernel.org/r/20210807130800.5246-3-dariobin@libero.it Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 5064e40596f478fce241cffbc780d3b156d74066 Author: Dario Binacchi Date: Sat Aug 7 15:07:57 2021 +0200 can: c_can: remove struct c_can_priv::priv field It references the clock but it is never used. So let's remove it. Link: https://lore.kernel.org/r/20210807130800.5246-2-dariobin@libero.it Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 05cb2ba4b23154c1b7d66284764651b1dd3456a9 Author: Marc Kleine-Budde Date: Mon Aug 9 09:26:35 2021 +0200 can: c_can: rename IF_RX -> IF_NAPI The C_CAN/D_CAN cores implement 2 interfaces to manage the message objects. To avoid concurrency and the need for locking one interface is used in the TX path (IF_TX). While the other one, named IF_RX is used from NAPI context only. As this interface is not only used to manage RX, but also TX message objects, this patch renames IF_RX to IF_NAPI. Link: https://lore.kernel.org/r/20210809080608.171545-1-mkl@pengutronix.de Cc: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 236de85f6a11346136733ab03c8d97fdf3f1d67b Author: Marc Kleine-Budde Date: Fri Aug 6 10:49:52 2021 +0200 can: c_can: c_can_do_tx(): fix typo in comment This patch fixes a typo in the comment in c_can_do_tx(). Fixes: eddf67115040 ("can: c_can: add a comment about IF_RX interface's use") Link: https://lore.kernel.org/r/20210806105127.103302-1-mkl@pengutronix.de Cc: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 06fc143b2edecea0f9bb3b044b95065fe5aac49f Author: Dario Binacchi Date: Thu Aug 5 21:27:50 2021 +0200 dt-bindings: net: can: c_can: convert to json-schema Convert the Bosch C_CAN/D_CAN controller device tree binding documentation to json-schema. Document missing properties. Remove "ti,hwmods" as it is no longer used in TI dts. Make "clocks" required as it is used in all dts. Update the examples. Link: https://lore.kernel.org/r/20210805192750.9051-1-dariobin@libero.it Signed-off-by: Dario Binacchi Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 812270e5445bd13859b70f9510e84068c6778333 Author: Matt Kline Date: Mon Aug 16 22:08:53 2021 -0700 can: m_can: Batch FIFO writes during CAN transmit Give FIFO writes the same treatment as reads to avoid fixed costs of individual transfers on a slow bus (e.g., tcan4x5x). Link: https://lore.kernel.org/r/20210817050853.14875-4-matt@bitbashing.io Signed-off-by: Matt Kline Signed-off-by: Marc Kleine-Budde commit 1aa6772f64b4a6763f14ae68455d7e42333e208e Author: Matt Kline Date: Mon Aug 16 22:08:52 2021 -0700 can: m_can: Batch FIFO reads during CAN receive On peripherals communicating over a relatively slow SPI line (e.g. tcan4x5x), individual transfers have high fixed costs. This causes the driver to spend most of its time waiting between transfers and severely limits throughput. Reduce these overheads by reading more than one word at a time. Writing could get a similar treatment in follow-on commits. Link: https://lore.kernel.org/r/20210817050853.14875-3-matt@bitbashing.io Signed-off-by: Matt Kline [mkl: remove __packed from struct id_and_dlc] Signed-off-by: Marc Kleine-Budde commit e39381770ec9ca3c51d8b9bd9cc6e01d78ea974a Author: Matt Kline Date: Mon Aug 16 22:08:51 2021 -0700 can: m_can: Disable IRQs on FIFO bus errors If FIFO reads or writes fail due to the underlying regmap (e.g., SPI) I/O, propagate that up to the m_can driver, log an error, and disable interrupts, similar to the mcp251xfd driver. While reworking the FIFO functions to add this error handling, add support for bulk reads and writes of multiple registers. Link: https://lore.kernel.org/r/20210817050853.14875-2-matt@bitbashing.io Signed-off-by: Matt Kline [mkl: re-wrap long lines, remove WARN_ON, convert to netdev block comments] Signed-off-by: Marc Kleine-Budde commit 5020ced4455be2bc6b992714738f34c7b248018d Author: Marc Kleine-Budde Date: Thu Aug 19 12:20:03 2021 +0200 can: m_can: fix block comment style This patch fixes the commenting style in the m_can driver. Fixes: 1be37d3b0414 ("can: m_can: fix periph RX path: use rx-offload to ensure skbs are sent from softirq context") Fixes: df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") Link: https://lore.kernel.org/r/20210819111703.599686-2-mkl@pengutronix.de Cc: Chandrasekar Ramakrishnan Signed-off-by: Marc Kleine-Budde commit fede1ae2d35784a37827f6a437fa742fdd463af1 Author: Marc Kleine-Budde Date: Thu Aug 19 11:48:45 2021 +0200 can: tcan4x5x: cdev_to_priv(): remove stray empty line This patch removes a stray empty line in the cdev_to_priv() function. Fixes: ac33ffd3e2b0 ("can: m_can: let m_can_class_allocate_dev() allocate driver specific private data") Link: https://lore.kernel.org/r/20210819111703.599686-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 76e9353a80e9e9ff65b362a6dd8545d84427ec30 Author: Lad Prabhakar Date: Tue Jul 27 14:30:21 2021 +0100 can: rcar_canfd: Add support for RZ/G2L family CANFD block on RZ/G2L SoC is almost identical to one found on R-Car Gen3 SoC's. On RZ/G2L SoC interrupt sources for each channel are split into different sources and the IP doesn't divide (1/2) CANFD clock within the IP. This patch adds compatible string for RZ/G2L family and splits the irq handlers to accommodate both RZ/G2L and R-Car Gen3 SoC's. Link: https://lore.kernel.org/r/20210727133022.634-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das [mkl: fixed typo: recieve -> receive, thanks Geert] Signed-off-by: Marc Kleine-Budde commit 1aa5a06c0a5dbebd0351ffe5db77c06e9089e4fc Author: Lad Prabhakar Date: Tue Jul 27 14:30:20 2021 +0100 dt-bindings: net: can: renesas,rcar-canfd: Document RZ/G2L SoC Add CANFD binding documentation for Renesas RZ/G2L SoC. Link: https://lore.kernel.org/r/20210727133022.634-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit b2fcc70799368a9bc25509da4c9127583523ec37 Author: Marc Kleine-Budde Date: Mon Aug 9 20:31:54 2021 +0200 can: mcp251xfd: mark some instances of struct mcp251xfd_priv as const With the patch 07ff4aed015c ("time/timecounter: Mark 1st argument of timecounter_cyc2time() as const") some instances of the struct mcp251xfd_priv can be marked as const. This patch marks these as const. Link: https://lore.kernel.org/r/20210813091027.159379-1-mkl@pengutronix.de Cc: Manivannan Sadhasivam Cc: Thomas Kopp Signed-off-by: Marc Kleine-Budde commit c734707820f8550ae492ddfb772234b752a9a798 Author: Vincent Mailhol Date: Sun Aug 15 12:32:48 2021 +0900 can: etas_es58x: clean-up documentation of struct es58x_fd_tx_conf_msg The documentation of struct es58x_fd_tx_conf_msg explains in details the different TDC parameters. However, those description are redundant with the documentation of struct can_tdc. Remove most of the description. Also, fixes a typo in the reference to the datasheet (E701 -> E70). Link: https://lore.kernel.org/r/20210815033248.98111-8-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 7a4573cf3ae8e3ecff2f9865d2091ab4c00de085 Author: Vincent Mailhol Date: Sat Aug 14 18:33:53 2021 +0900 MAINTAINERS: add Vincent MAILHOL as maintainer for the ETAS ES58X CAN/USB driver Adding myself (Vincent Mailhol) as a maintainer for the ETAS ES58X CAN/USB driver. Link: https://lore.kernel.org/r/20210814093353.74391-1-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit e43aaa0fefcec5c02b23cff2589ce4ecb2bfcb9e Author: Vincent Mailhol Date: Sun Aug 15 12:32:42 2021 +0900 can: netlink: allow user to turn off unsupported features The sanity checks on the control modes will reject any request related to an unsupported features, even turning it off. Example on an interface which does not support CAN-FD: $ ip link set can0 type can bitrate 500000 fd off RTNETLINK answers: Operation not supported This patch lets such command go through (but requests to turn on an unsupported feature are, of course, still denied). Link: https://lore.kernel.org/r/20210815033248.98111-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 6e86a1543c378f2e8837ad88f361b7bf606c80f7 Author: Oleksij Rempel Date: Wed Aug 18 09:12:32 2021 +0200 can: dev: provide optional GPIO based termination support For CAN buses to work, a termination resistor has to be present at both ends of the bus. This resistor is usually 120 Ohms, other values may be required for special bus topologies. This patch adds support for a generic GPIO based CAN termination. The resistor value has to be specified via device tree, and it can only be attached to or detached from the bus. By default the termination is not active. Link: https://lore.kernel.org/r/20210818071232.20585-4-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit fe7edf2482e1e3d677cd1b5acebf5dd06d6246e6 Author: Oleksij Rempel Date: Wed Aug 18 09:12:31 2021 +0200 dt-bindings: can: fsl,flexcan: enable termination-* bindings Enable termination-* binding and provide validation example for it. Link: https://lore.kernel.org/r/20210818071232.20585-3-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit ef82641d68027b564ac6b12fca052065f9609f1a Author: Oleksij Rempel Date: Wed Aug 18 09:12:30 2021 +0200 dt-bindings: can-controller: add support for termination-gpios Some boards provide GPIO controllable termination resistor. Provide binding to make use of it. Link: https://lore.kernel.org/r/20210818071232.20585-2-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 729580ddc53efd8093371788721487024c9b2f71 Author: Chuck Lever Date: Wed Aug 18 17:12:26 2021 -0400 svcrdma: xpt_bc_xprt is already clear in __svc_rdma_free() svc_xprt_free() already "puts" the bc_xprt before calling the transport's "free" method. No need to do it twice. Signed-off-by: Chuck Lever commit 5c8a2bb481591fc4dbbdb7f79b70d0a36150dd13 Author: Colin Ian King Date: Thu Aug 19 13:04:43 2021 +0100 net: ethernet: ti: cpsw: make array stpa static const, makes object smaller Don't populate the array stpa on the stack but instead it static const. Makes the object code smaller by 81 bytes: Before: text data bss dec hex filename 54993 17248 0 72241 11a31 ./drivers/net/ethernet/ti/cpsw_new.o After: text data bss dec hex filename 54784 17376 0 72160 119e0 ./drivers/net/ethernet/ti/cpsw_new.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 0bc277cb8234f8e6fcf8842e318e0873dd223565 Author: Colin Ian King Date: Thu Aug 19 12:58:13 2021 +0100 net: hns3: make array spec_opcode static const, makes object smaller Don't populate the array spec_opcode on the stack but instead it static const. Makes the object code smaller by 158 bytes: Before: text data bss dec hex filename 12271 3976 128 16375 3ff7 .../hisilicon/hns3/hns3pf/hclge_cmd.o After: text data bss dec hex filename 12017 4072 128 16217 3f59 .../hisilicon/hns3/hns3pf/hclge_cmd.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 36d5825babbc9a5b504bb566f0241ac005b32721 Author: Colin Ian King Date: Thu Aug 19 12:52:53 2021 +0100 hinic: make array speeds static const, makes object smaller Don't populate the array speeds on the stack but instead it static const. Makes the object code smaller by 17 bytes: Before: text data bss dec hex filename 39987 14200 64 54251 d3eb .../huawei/hinic/hinic_sriov.o After: text data bss dec hex filename 39906 14264 64 54234 d3da .../huawei/hinic/hinic_sriov.o (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 9f3ebe8fb5a40432dfe353a0d8c5f6f21281eb3c Merge: 2274af1d60fee 74fc4f828769c Author: David S. Miller Date: Thu Aug 19 13:19:30 2021 +0100 Merge branch 'indirect-qdisc-order' Eli Cohen says: ==================== Indirect dev ingress qdisc creation order The first patch is just a cleanup of the code. The second patch is fixing the dependency in ingress qdisc creation relative to offloading driver registration to filter configurations. v1 -> v2: Fix warning - variable set but not used ==================== Signed-off-by: David S. Miller commit 74fc4f828769cca1c3be89ea92cb88feaa27ef52 Author: Eli Cohen Date: Tue Aug 17 20:05:18 2021 +0300 net: Fix offloading indirect devices dependency on qdisc order creation Currently, when creating an ingress qdisc on an indirect device before the driver registered for callbacks, the driver will not have a chance to register its filter configuration callbacks. To fix that, modify the code such that it keeps track of all the ingress qdiscs that call flow_indr_dev_setup_offload(). When a driver calls flow_indr_dev_register(), go through the list of tracked ingress qdiscs and call the driver callback entry point so as to give it a chance to register its callback. Reviewed-by: Jiri Pirko Signed-off-by: Eli Cohen Signed-off-by: David S. Miller commit c1c5cb3aee05e77abe9f9a3400692f46079fbf05 Author: Eli Cohen Date: Tue Aug 17 20:05:17 2021 +0300 net/core: Remove unused field from struct flow_indr_dev rcu field is not used. Remove it. Reviewed-by: Jiri Pirko Signed-off-by: Eli Cohen Signed-off-by: David S. Miller commit 2274af1d60fee3fe35f341fc5d4dbf99ab78fb2f Author: Pavel Skripkin Date: Wed Aug 18 18:07:09 2021 +0300 net: mii: make mii_ethtool_gset() return void mii_ethtool_gset() does not return any errors. Since there are no users of this function that rely on its return value, it can be made void. Signed-off-by: Pavel Skripkin Signed-off-by: David S. Miller commit 9fcfd0888cb71da4dbe666b4100e1b2d56d2f0b9 Author: Pavel Skripkin Date: Wed Aug 18 18:06:30 2021 +0300 net: pch_gbe: remove mii_ethtool_gset() error handling mii_ethtool_gset() does not return any errors, so error handling can be omitted to make code more simple. Acked-by: Andy Shevchenko Signed-off-by: Pavel Skripkin Signed-off-by: David S. Miller commit a27919433b44c8ab657e6ed214dad4ed9a66b8fa Merge: 19b8ece42c56a 0b81d67311676 Author: David S. Miller Date: Thu Aug 19 12:05:29 2021 +0100 Merge branch 'ravb-gbit' Biju Das says: ==================== ravb: Add Gigabit Ethernet driver support The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are similar to the R-Car Ethernet AVB IP. The Gigabit Ethernet IP consists of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC). With a few changes in the driver we can support both IPs. Currently a runtime decision based on the chip type is used to distinguish the HW differences between the SoC families. This patch series is in preparation for supporting the RZ/G2L SoC by replacing driver data chip type with struct ravb_hw_info by moving chip type to it and also adding gstrings_stats, gstrings_size, net_hw_features, net_features, aligned_tx, stats_len, max_rx_len variables to it. This patch also adds the feature bit for {RX, TX} clock internal delays and TX counters HW features found on R-Car Gen3 to struct ravb_hw_info. This patch series is based on net-next. v2->v3: * Removed num_gstat_queue variable from struct ravb_hw_info. * started using unsigned int for num_tx_desc variable in struct ravb_private * split the patch 'Add struct ravb_hw_info to driver data' into two * Renamed skb_sz to max_rx_len and tx_drop_cntrs to tx_counters and also updated the comments. v1->v2: * Replaced driver data chip type with struct ravb_hw_info * Added gstrings_stats, gstrings_size, net_hw_features, net_features, num_gstat_queue, num_tx_desc, stats_len, skb_sz to struct ravb_hw_info * Added internal_delay and tx_drop_cntrs hw feature bit to struct ravb_hw_info RFC->V1 * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar * https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=515525 ==================== Signed-off-by: David S. Miller commit 0b81d67311676c9119ed3b027d1518e974dbca8e Author: Biju Das Date: Wed Aug 18 20:08:00 2021 +0100 ravb: Add tx_counters to struct ravb_hw_info The register for retrieving TX counters is present only on R-Car Gen3 and RZ/G2L; it is not present on R-Car Gen2. Add the tx_counters hw feature bit to struct ravb_hw_info, to enable this feature specifically for R-Car Gen3 now and later extend it to RZ/G2L. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8bc4caa0abafd83e25df2a3b1b03480aab071ee1 Author: Biju Das Date: Wed Aug 18 20:07:59 2021 +0100 ravb: Add internal delay hw feature to struct ravb_hw_info R-Car Gen3 supports TX and RX clock internal delay modes, whereas R-Car Gen2 and RZ/G2L do not support it. Add an internal_delay hw feature bit to struct ravb_hw_info to enable this only for R-Car Gen3. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 8912ed25daf6fc811c71ac30794822c824017c0f Author: Biju Das Date: Wed Aug 18 20:07:58 2021 +0100 ravb: Add net_features and net_hw_features to struct ravb_hw_info On R-Car the checksum calculation on RX frames is done by the E-MAC module, whereas on RZ/G2L it is done by the TOE. TOE calculates the checksum of received frames from E-MAC and outputs it to DMAC. TOE also calculates the checksum of transmission frames from DMAC and outputs it E-MAC. Add net_features and net_hw_features to struct ravb_hw_info, to support subsequent SoCs without any code changes in the ravb_probe function. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 896a818e0e1d4a2065e210de88b3d0535bbeac1c Author: Biju Das Date: Wed Aug 18 20:07:57 2021 +0100 ravb: Add gstrings_stats and gstrings_size to struct ravb_hw_info The device stats strings for R-Car and RZ/G2L are different. R-Car provides 30 device stats, whereas RZ/G2L provides only 15. In addition, RZ/G2L has stats "rx_queue_0_csum_offload_errors" instead of "rx_queue_0_missed_errors". Add structure variables gstrings_stats and gstrings_size to struct ravb_hw_info, so that subsequent SoCs can be added without any code changes in the ravb_get_strings function. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 25154301fc2bcc1d949a42218e4dfb870f0f1794 Author: Biju Das Date: Wed Aug 18 20:07:56 2021 +0100 ravb: Add stats_len to struct ravb_hw_info R-Car provides 30 device stats, whereas RZ/G2L provides only 15. In addition, RZ/G2L has stats "rx_queue_0_csum_offload_errors" instead of "rx_queue_0_missed_errors". Replace RAVB_STATS_LEN macro with a structure variable stats_len to struct ravb_hw_info, to support subsequent SoCs without any code changes to the ravb_get_sset_count function. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit cb01c672c2a7aded88915e475463fe1128dc76d7 Author: Biju Das Date: Wed Aug 18 20:07:55 2021 +0100 ravb: Add max_rx_len to struct ravb_hw_info The maximum descriptor size that can be specified on the reception side for R-Car is 2048 bytes, whereas for RZ/G2L it is 8096. Add the max_rx_len variable to struct ravb_hw_info for allocating different RX skb buffer sizes for R-Car and RZ/G2L using the netdev_alloc_skb function. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 68ca3c923213b908c14a673f6c3ec808664fae1f Author: Biju Das Date: Wed Aug 18 20:07:54 2021 +0100 ravb: Add aligned_tx to struct ravb_hw_info R-Car Gen2 needs a 4byte aligned address for the transmission buffer, whereas R-Car Gen3 doesn't have any such restriction. Add aligned_tx to struct ravb_hw_info to select the driver to choose between aligned and unaligned tx buffers. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit ebb091461a9e146f8afd750cb7eddc5b4c8d47be Author: Biju Das Date: Wed Aug 18 20:07:53 2021 +0100 ravb: Add struct ravb_hw_info to driver data The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are similar to the R-Car Ethernet AVB IP. With a few changes in the driver we can support both IPs. This patch adds the struct ravb_hw_info to hold hw features, driver data and function pointers to support both the IPs. It also replaces the driver data chip type with struct ravb_hw_info by moving chip type to it. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit cb537b241725f5261e752add954e08837348edad Author: Biju Das Date: Wed Aug 18 20:07:52 2021 +0100 ravb: Use unsigned int for num_tx_desc variable in struct ravb_private The number of TX descriptors per packet is an unsigned value and the variable for holding this information should be unsigned. This patch replaces the data type of num_tx_desc variable in struct ravb_private from 'int' to 'unsigned int'. This patch also updates the data type of local variables to unsigned int, where the local variables are evaluated using num_tx_desc. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Signed-off-by: David S. Miller commit b9a51949cebcd57bfb9385d9da62ace52564898c Author: Ricardo Koller Date: Wed Aug 18 14:32:05 2021 -0700 KVM: arm64: vgic: Drop WARN from vgic_get_irq vgic_get_irq(intid) is used all over the vgic code in order to get a reference to a struct irq. It warns whenever intid is not a valid number (like when it's a reserved IRQ number). The issue is that this warning can be triggered from userspace (e.g., KVM_IRQ_LINE for intid 1020). Drop the WARN call from vgic_get_irq. Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210818213205.598471-1-ricarkol@google.com commit 6caa5812e2d126a0aa8a17816c1ba6f0a0c2b309 Author: Oliver Upton Date: Mon Aug 2 19:28:09 2021 +0000 KVM: arm64: Use generic KVM xfer to guest work function Clean up handling of checks for pending work by switching to the generic infrastructure to do so. We pick up handling for TIF_NOTIFY_RESUME from this switch, meaning that task work will be correctly handled. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210802192809.1851010-4-oupton@google.com commit e1c6b9e1669e44fb7f9688e34e460b759e3b9187 Author: Oliver Upton Date: Mon Aug 2 19:28:08 2021 +0000 entry: KVM: Allow use of generic KVM entry w/o full generic support Some architectures (e.g. arm64) have yet to adopt the generic entry infrastructure. Despite that, it would be nice to use some common plumbing for guest entry/exit handling. For example, KVM/arm64 currently does not handle TIF_NOTIFY_PENDING correctly. Allow use of only the generic KVM entry code by tightening up the include list. No functional change intended. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210802192809.1851010-3-oupton@google.com commit fe5161d2c39b8c2801f0e786631460c6e8a1cae4 Author: Oliver Upton Date: Mon Aug 2 19:28:07 2021 +0000 KVM: arm64: Record number of signal exits as a vCPU stat Most other architectures that implement KVM record a statistic indicating the number of times a vCPU has exited due to a pending signal. Add support for that stat to arm64. Reviewed-by: Jing Zhang Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210802192809.1851010-2-oupton@google.com commit 1daf08a066cfe500587affd3fa3be8c13b8ff007 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:09 2021 +0200 livepatch: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Josh Poimboeuf Cc: Jiri Kosina Cc: Miroslav Benes Cc: Petr Mladek Cc: Joe Lawrence Cc: live-patching@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Petr Mladek Signed-off-by: Jiri Kosina commit 79fad92f2e596f5a8dd085788a24f540263ef887 Author: Daniel Thompson Date: Thu Jul 22 15:46:23 2021 +0100 backlight: pwm_bl: Improve bootloader/kernel device handover Currently there are (at least) two problems in the way pwm_bl starts managing the enable_gpio pin. Both occur when the backlight is initially off and the driver finds the pin not already in output mode and, as a result, unconditionally switches it to output-mode and asserts the signal. Problem 1: This could cause the backlight to flicker since, at this stage in driver initialisation, we have no idea what the PWM and regulator are doing (an unconfigured PWM could easily "rest" at 100% duty cycle). Problem 2: This will cause us not to correctly honour the post_pwm_on_delay (which also risks flickers). Fix this by moving the code to configure the GPIO output mode until after we have examines the handover state. That allows us to initialize enable_gpio to off if the backlight is currently off and on if the backlight is on. Cc: stable@vger.kernel.org Reported-by: Marek Vasut Signed-off-by: Daniel Thompson Acked-by: Marek Vasut Tested-by: Marek Vasut Signed-off-by: Lee Jones commit 423d39d8518c1bba12e0889a92beeddbb1502392 Author: Liu Yi L Date: Wed Aug 18 21:48:52 2021 +0800 iommu/vt-d: Add present bit check in pasid entry setup helpers The helper functions should not modify the pasid entries which are still in use. Add a check against present bit. Signed-off-by: Liu Yi L Link: https://lore.kernel.org/r/20210817042425.1784279-1-yi.l.liu@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210818134852.1847070-10-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 8123b0b86855185357e4b12f29e327ba773fc58d Author: Liu Yi L Date: Wed Aug 18 21:48:51 2021 +0800 iommu/vt-d: Use pasid_pte_is_present() helper function Use the pasid_pte_is_present() helper for present bit check in the intel_pasid_tear_down_entry(). Signed-off-by: Liu Yi L Link: https://lore.kernel.org/r/20210817042425.1784279-1-yi.l.liu@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210818134852.1847070-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 9ddc348214c775ce5d0861e0363182b18a3dd187 Author: Andy Shevchenko Date: Wed Aug 18 21:48:50 2021 +0800 iommu/vt-d: Drop the kernel doc annotation Kernel doc validator is unhappy with the following .../perf.c:16: warning: Function parameter or member 'latency_lock' not described in 'DEFINE_SPINLOCK' .../perf.c:16: warning: expecting prototype for perf.c(). Prototype was for DEFINE_SPINLOCK() instead Drop kernel doc annotation since the top comment is not in the required format. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210729163538.40101-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210818134852.1847070-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 48811c44349ffbb778d3e36b53beb03ad43a979c Author: Lu Baolu Date: Wed Aug 18 21:48:49 2021 +0800 iommu/vt-d: Allow devices to have more than 32 outstanding PRs The minimum per-IOMMU PRQ queue size is one 4K page, this is more entries than the hardcoded limit of 32 in the current VT-d code. Some devices can support up to 512 outstanding PRQs but underutilized by this limit of 32. Although, 32 gives some rough fairness when multiple devices share the same IOMMU PRQ queue, but far from optimal for customized use case. This extends the per-IOMMU PRQ queue size to four 4K pages and let the devices have as many outstanding page requests as they can. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720013856.4143880-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20210818134852.1847070-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 289b3b005cb9d9dd6b30297b52c2b4596bc878b2 Author: Lu Baolu Date: Wed Aug 18 21:48:48 2021 +0800 iommu/vt-d: Preset A/D bits for user space DMA usage We preset the access and dirty bits for IOVA over first level usage only for the kernel DMA (i.e., when domain type is IOMMU_DOMAIN_DMA). We should also preset the FL A/D for user space DMA usage. The idea is that even the user space A/D bit memory write is unnecessary. We should avoid it to minimize the overhead. Suggested-by: Sanjay Kumar Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720013856.4143880-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20210818134852.1847070-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 792fb43ce2c98878f1539c1d3fdecc1d7a7d78fd Author: Lu Baolu Date: Wed Aug 18 21:48:47 2021 +0800 iommu/vt-d: Enable Intel IOMMU scalable mode by default The commit 8950dcd83ae7d ("iommu/vt-d: Leave scalable mode default off") leaves the scalable mode default off and end users could turn it on with "intel_iommu=sm_on". Using the Intel IOMMU scalable mode for kernel DMA, user-level device access and Shared Virtual Address have been enabled. This enables the scalable mode by default if the hardware advertises the support and adds kernel options of "intel_iommu=sm_on/sm_off" for end users to configure it through the kernel parameters. Suggested-by: Ashok Raj Suggested-by: Sanjay Kumar Signed-off-by: Lu Baolu Cc: Kevin Tian Link: https://lore.kernel.org/r/20210720013856.4143880-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20210818134852.1847070-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 01dac2d9d2364d2a68b37cc1381947ca53413b51 Author: Lu Baolu Date: Wed Aug 18 21:48:46 2021 +0800 iommu/vt-d: Refactor Kconfig a bit Put all sub-options inside a "if INTEL_IOMMU" so that they don't need to always depend on INTEL_IOMMU. Use IS_ENABLED() instead of #ifdef as well. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720013856.4143880-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20210818134852.1847070-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 5e41c998949377c80d03610600228022430daf45 Author: Zhen Lei Date: Wed Aug 18 21:48:45 2021 +0800 iommu/vt-d: Remove unnecessary oom message Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210609124937.14260-1-thunder.leizhen@huawei.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210818134852.1847070-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 4d99efb229e63928c6b03a756a2e38cd4777fbe8 Author: Lu Baolu Date: Wed Aug 18 21:48:44 2021 +0800 iommu/vt-d: Update the virtual command related registers The VT-d spec Revision 3.3 updated the virtual command registers, virtual command opcode B register, virtual command response register and virtual command capability register (Section 10.4.43, 10.4.44, 10.4.45, 10.4.46). This updates the virtual command interface implementation in the Intel IOMMU driver accordingly. Fixes: 24f27d32ab6b7 ("iommu/vt-d: Enlightened PASID allocation") Signed-off-by: Lu Baolu Cc: Ashok Raj Cc: Sanjay Kumar Cc: Kevin Tian Link: https://lore.kernel.org/r/20210713042649.3547403-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20210818134852.1847070-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit cb97cf95c44021278b7637731bc0928026bc29ab Author: Oliver Upton Date: Wed Aug 18 20:21:33 2021 +0000 selftests: KVM: Introduce psci_cpu_on_test Introduce a test for aarch64 that ensures CPU resets induced by PSCI are reflected in the target vCPU's state, even if the target is never run again. This is a regression test for a race between vCPU migration and PSCI. Reviewed-by: Andrew Jones Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210818202133.1106786-5-oupton@google.com commit e10ecb4d6c0761ca545b3946df1707a41f9f845e Author: Oliver Upton Date: Wed Aug 18 20:21:32 2021 +0000 KVM: arm64: Enforce reserved bits for PSCI target affinities According to the PSCI specification, ARM DEN 0022D, 5.1.4 "CPU_ON", the CPU_ON function takes a target_cpu argument that is bit-compatible with the affinity fields in MPIDR_EL1. All other bits in the argument are RES0. Note that the same constraints apply to the target_affinity argument for the AFFINITY_INFO call. Enforce the spec by returning INVALID_PARAMS if a guest incorrectly sets a RES0 bit. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210818202133.1106786-4-oupton@google.com commit 6826c6849b46aaa91300201213701eb861af4ba0 Author: Oliver Upton Date: Wed Aug 18 20:21:31 2021 +0000 KVM: arm64: Handle PSCI resets before userspace touches vCPU state The CPU_ON PSCI call takes a payload that KVM uses to configure a destination vCPU to run. This payload is non-architectural state and not exposed through any existing UAPI. Effectively, we have a race between CPU_ON and userspace saving/restoring a guest: if the target vCPU isn't ran again before the VMM saves its state, the requested PC and context ID are lost. When restored, the target vCPU will be runnable and start executing at its old PC. We can avoid this race by making sure the reset payload is serviced before userspace can access a vCPU's state. Fixes: 358b28f09f0a ("arm/arm64: KVM: Allow a VCPU to fully reset itself") Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210818202133.1106786-3-oupton@google.com commit 6654f9dfcb88fea3b9affc180dc3c04333d0f306 Author: Oliver Upton Date: Wed Aug 18 20:21:30 2021 +0000 KVM: arm64: Fix read-side race on updates to vcpu reset state KVM correctly serializes writes to a vCPU's reset state, however since we do not take the KVM lock on the read side it is entirely possible to read state from two different reset requests. Cure the race for now by taking the KVM lock when reading the reset_state structure. Fixes: 358b28f09f0a ("arm/arm64: KVM: Allow a VCPU to fully reset itself") Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210818202133.1106786-2-oupton@google.com commit 44afeed73e52a2f1cfb8b6ca2a0be8164a3b567a Author: Marc Kleine-Budde Date: Fri Aug 6 12:39:25 2021 +0200 mailmap: update email address of Matthias Fuchs and Thomas Körper Matthias Fuchs's and Thomas Körper's email addresses aren't valid anymore. Use the newly created role account instead. Link: https://lore.kernel.org/r/20210809175843.207864-1-mkl@pengutronix.de Cc: socketcan@esd.eu Cc: Stefan Mätje Acked-by: Stefan Mätje Signed-off-by: Marc Kleine-Budde commit a4836d5ad127fe31fecb29878d81f2e9b4a5591c Author: Joel Stanley Date: Thu Aug 19 16:22:03 2021 +0930 ARM: config: aspeed: Regenerate defconfigs A make defconfig && make savedefconfig was performed for each configuration. Most changes are due to options moving around, except for the following which are due to changing defaults: - SECCOMP is enabled by default as of commit 282a181b1a0d ("seccomp: Move config option SECCOMP to arch/Kconfig") in v5.9 - The soc drivers ASPEED_LPC_CTRL, ASPEED_LPC_SNOOP and ASPEED_P2A_CTRL are enabled by default when the aspeed platform is enabled, as of commit 592693a1f881 ("soc: aspeed: Improve kconfig") in v5.9 - The ZBOOT_ROM_TEXT/BSS values fall out of the defconfig as of commit 39c3e304567a ("ARM: 8984/1: Kconfig: set default ZBOOT_ROM_TEXT/BSS value to 0x0") in v5.8 - I2C_MUX is selected by MEDIA_SUBDRV_AUTOSELECT, probably as of about v5.8. It was in the config as it is required bt the PCA I2C muxes that enabled it Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210819065203.2620911-5-joel@jms.id.au Signed-off-by: Joel Stanley commit c1dec343d7abdf8e71aab2a289ab45ce8b1afb7e Author: Christoph Hellwig Date: Wed Jun 23 16:11:21 2021 +0200 hexagon: use the generic global coherent pool Switch hexagon to use the generic code for dma_alloc_coherent from a global pre-filled pool. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Cain commit 22f9feb49950885cdb6e37513f134d154175e743 Author: Christoph Hellwig Date: Thu Jun 24 19:37:00 2021 +0200 dma-mapping: make the global coherent pool conditional Only build the code to support the global coherent pool if support for it is enabled. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit 2b353fea1820e277c787c84f82ceb23646bce4b6 Author: Joel Stanley Date: Thu Aug 19 16:22:02 2021 +0930 ARM: config: aspeed_g4: Enable EDAC and SPGIO These two devices are part of the AST2400 and the drivers have support for that version of the soc. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210819065203.2620911-4-joel@jms.id.au Signed-off-by: Joel Stanley commit 8c770cbfd597264373496137ae4c9cb76a28615b Author: Joel Stanley Date: Thu Aug 19 16:22:01 2021 +0930 ARM: config: aspeed: Enable KCS adapter for raw SerIO Raw SerIO is used by the OpenBMC debug-trigger application to take signals from the host that applications are unresponsive on the BMC. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210819065203.2620911-3-joel@jms.id.au Signed-off-by: Joel Stanley commit 66a68b0be4ffef6a30d6b40ac1da87d6eaa8cbbf Author: Joel Stanley Date: Thu Aug 19 16:22:00 2021 +0930 ARM: config: aspeed: Enable hardened allocator feature SLAB_FREELIST_HARDENED can protect from freelist overwrite attacks with really small overhead. It works best with the SLUB allocator, so make SLUB the default by removing SLAB=y. total used free shared buff/cache available SLAB 425596 44065.3+/-220 311099+/-3800 14864+/-3900 70432+/-3700 352767+/-3900 SLUB 425592 44225.3+/-280 313275+/-600 12132+/-3.3 68092+/-530 355295+/-280 These figures are the average memory usage from three boots of each option in qemu, running the Romulus userspace. The output is from free(1), reported in kilobytes. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210819065203.2620911-2-joel@jms.id.au Signed-off-by: Joel Stanley commit e879f855e590b40fe3c79f2fbd8f65ca3c724120 Author: Nathan Chancellor Date: Sun Aug 15 12:18:52 2021 -0700 bus: ti-sysc: Add break in switch statement in sysc_init_soc() After commit a6d90e9f2232 ("bus: ti-sysc: AM3: RNG is GP only"), clang with -Wimplicit-fallthrough enabled warns: drivers/bus/ti-sysc.c:2958:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ drivers/bus/ti-sysc.c:2958:3: note: insert 'break;' to avoid fall-through default: ^ break; 1 warning generated. Clang's version of this warning is a little bit more pedantic than GCC's. Add the missing break to satisfy it to match what has been done all over the kernel tree. Fixes: a6d90e9f2232 ("bus: ti-sysc: AM3: RNG is GP only") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Tony Lindgren commit 093991aaadf0fbb34184fa37a46e7a157da3f386 Author: Fabio M. De Francesco Date: Thu Aug 19 07:08:08 2021 +0200 staging: r8188eu: Remove empty rtw_mfree_xmit_priv_lock() Remove rtw_mfree_xmit_priv_lock() because it is empty. Remove its only call from within _rtw_free_xmit_priv(). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210819050808.28825-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 90356e98100fb4a9eeb230bb159956ac71219335 Author: Phillip Potter Date: Thu Aug 19 00:48:53 2021 +0100 staging: r8188eu: remove rtw_update_mem_stat macro and associated flags Remove the unused rtw_update_mem_stat macro and the associated flags from include/osdep_service.h as this is all dead code. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 41b8a938674b5bc9e57aedef9ff104dfc8deeaaf Author: Phillip Potter Date: Thu Aug 19 00:48:52 2021 +0100 staging: r8188eu: remove function _rtw_zvmalloc Remove the function _rtw_zvmalloc from os_dep/osdep_service.c, as this function is now unused and is just an inline wrapper around vmalloc which zeroes out the memory. All previous callers have been converted to use vzalloc. Also remove the declaration from include/osdep_service.h. It is considered generally bad practice to declare functions as inline in the majority of cases, as not only can this qualifier be ignored by the compiler but the compiler generally makes good decisions about inlining anyway. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 00d7a5613be546f2b9d4d6d988b14851f8fe2840 Author: Phillip Potter Date: Thu Aug 19 00:48:51 2021 +0100 staging: r8188eu: remove rtw_zvmalloc preprocessor definition Remove rtw_zvmalloc preprocessor definition from include/osdep_service.h as it now has no callers. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 11d5fd313b8f99780ab631afe3b1e003028d345b Author: Phillip Potter Date: Thu Aug 19 00:48:50 2021 +0100 staging: r8188eu: convert all rtw_zvmalloc calls to vzalloc calls Convert all rtw_zvmalloc calls within the driver to use the existing kernel vzalloc function, which has the same semantics. Also rewrite the two places where it is mentioned in comments to say vzalloc, and remove the redundant cast to struct adapter * in ./os_dep/usb_intf.c as vzalloc returns void *. The reason for the conversion is that rtw_zvmalloc is just a preprocessor definition for _rtw_zvmalloc which itself is just an inline wrapper around vmalloc which then zeroes the memory out. As vzalloc does the same thing via usage of __GFP_ZERO, this code is redundant and can subsequently be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit c29e42afe91980f930b560dad24215569fa64f4a Author: Phillip Potter Date: Thu Aug 19 00:48:49 2021 +0100 staging: r8188eu: remove function _rtw_vmalloc Remove the function _rtw_vmalloc from os_dep/osdep_service.c, converting its only user (also in os_dep/osdep_service.c) to use plain vmalloc. This function is just an inline wrapper around vmalloc which returns a u8 pointer, which isn't needed. Also remove the declaration from include/osdep_service.h. It is considered generally bad practice to declare functions as inline in the majority of cases, as not only can this qualifier be ignored by the compiler but the compiler generally makes good decisions about inlining anyway. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 07f1a10d30e382fcb370b1b7b98ea48af13087c5 Author: Phillip Potter Date: Thu Aug 19 00:48:48 2021 +0100 staging: r8188eu: remove rtw_vmalloc preprocessor definition Remove rtw_vmalloc preprocessor definition from include/osdep_service.h as it now has no callers. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5349ef4fd59f787feadc44629d4ecf6cad42e312 Author: Phillip Potter Date: Thu Aug 19 00:48:47 2021 +0100 staging: r8188eu: convert only rtw_vmalloc call to vmalloc Convert the only call to rtw_vmalloc in os_dep/ioctl_linux.c to the kernel's existing vmalloc function, as rtw_malloc is just a preprocessor definition for _rtw_vmalloc. The _rtw_vmalloc function is defined inline and returns a u8, wrapping standard vmalloc. This behaviour is not necessary. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234853.208448-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit b1d0ebf2ed849635e155cc97ea024659c4b21f1a Author: Phillip Potter Date: Thu Aug 19 00:42:53 2021 +0100 staging: r8188eu: remove free_xmit_priv field from struct hal_ops Remove free_xmit_priv function pointer field from struct hal_ops definition in include/hal_intf.h, as it is now no longer used anywhere in the driver. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit c5de6c20dd79d774a486958c582d8ef0bc211ab7 Author: Phillip Potter Date: Thu Aug 19 00:42:52 2021 +0100 staging: r8188eu: remove function rtw_hal_free_xmit_priv Remove function rtw_hal_free_xmit_priv in hal/hal_intf.c and its declaration in include/hal_intf.h, as well as the single call line in core/rtw_xmit.c. This function now essentially checks a function pointer which will always be NULL (due to previous patches) and therefore will never be called. Acked-by: Fabio M. De Francesco Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 23b752dfa305bfc98685ee288b805615ab284482 Author: Phillip Potter Date: Thu Aug 19 00:42:51 2021 +0100 staging: r8188eu: remove empty function rtl8188eu_free_xmit_priv Remove empty function rtl8188eu_free_xmit_priv from hal/rtl8188eu_xmit.c and its declaration from include/rtl8188e_xmit.h, as well as the one place where it is stored in the free_xmit_priv function pointer of the HalFunc struct inside padapter. This is safe, as the wrapper function checks for NULL before calling this function via the function pointer. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit c05d31893f700ea508e7c82d458375456ad287dd Author: Phillip Potter Date: Thu Aug 19 00:42:50 2021 +0100 staging: r8188eu: remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macros Remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macro definitions from include/rtl8188e_xmit.h, as these were only called from the now removed dump_txrpt_ccx_88e function, which was itself not called from anywhere anyway. Acked-by: Fabio M. De Francesco Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit ff901b60e7521d0294545dd4aa8f404efed18231 Author: Phillip Potter Date: Thu Aug 19 00:42:49 2021 +0100 staging: r8188eu: remove unused function dump_txrpt_ccx_88e Remove unused function dump_txrpt_ccx_88e from hal/rtl8188e_xmit.c and remove its declaration in include/rtl8188e_xmit.h, as this function is not called from anywhere, and is thus dead code. Acked-by: Fabio M. De Francesco Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 2f0f1ec2bd0d3d77c3002aac1ffbda655e3b060c Author: Phillip Potter Date: Thu Aug 19 00:42:48 2021 +0100 staging: r8188eu: remove _dbg_dump_tx_info function Remove _dbg_dump_tx_info from hal/rtl8188e_xmit.c as it is just a dumping function that contains a lot of unclear DBG_88E calls, and has no other external effect, other than calling a function that ultimately determines whether or not to dump/trigger the DBG_88E calls. Also remove its declaration and single call site. Acked-by: Fabio M. De Francesco Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818234253.208271-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit b2159182dd498fdb0f49e371ccc94efbc12d1f8e Author: Kevin Mitchell Date: Wed Aug 18 19:29:40 2021 -0700 lkdtm: remove IDE_CORE_CP crashpoint With the removal of the legacy IDE driver in kb7fb14d3ac63 ("ide: remove the legacy ide driver"), this crashpoint no longer points to a valid function. Acked-by: Kees Cook Signed-off-by: Kevin Mitchell Link: https://lore.kernel.org/r/20210819022940.561875-3-kevmitch@arista.com Signed-off-by: Greg Kroah-Hartman commit d1f278da6b11585f05b2755adfc8851cbf14a1ec Author: Kevin Mitchell Date: Wed Aug 18 19:29:39 2021 -0700 lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ When scsi_dispatch_cmd was moved to scsi_lib.c and made static, some compilers (i.e., at least gcc 8.4.0) decided to compile this inline. This is a problem for lkdtm.ko, which inserted a kprobe on this function for the SCSI_DISPATCH_CMD crashpoint. Move this crashpoint one function up the call chain to scsi_queue_rq. Though this is also a static function, it should never be inlined because it is assigned as a structure entry. Therefore, kprobe_register should always be able to find it. Fixes: 82042a2cdb55 ("scsi: move scsi_dispatch_cmd to scsi_lib.c") Acked-by: Kees Cook Signed-off-by: Kevin Mitchell Link: https://lore.kernel.org/r/20210819022940.561875-2-kevmitch@arista.com Signed-off-by: Greg Kroah-Hartman commit e8bcb4820ac55615ffe4c9730bde75140233fbaa Author: Gustavo A. R. Silva Date: Wed Aug 18 17:14:18 2021 -0500 staging: r8188eu: Fix fall-through warnings for Clang Fix the following fallthrough warnings: drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang. Link: https://github.com/KSPP/linux/issues/115 Reviewed-by: Nathan Chancellor Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20210818221418.GA311735@embeddedor Signed-off-by: Greg Kroah-Hartman commit 2f9b25fa668218f22a85ebe8c55d1d132fc0019d Author: Joel Stanley Date: Tue Jun 29 17:05:19 2021 +0930 soc: aspeed: Re-enable FWH2AHB on AST2600 Recent builds of the vendor u-boot tree disable features of the BMC that may allow unwanted access if not correctly configured. This includes the firmware hub to ahb bridge (FWH2AHB), which is used by this driver. The bit to "un-disable" it is in the SCU. Set it only when the ioctl is called and we are running on the ast2600, as to not open up the 'backdoor' unless there's userspace trying to use it. Fixes: deb50313ba83 ("soc: aspeed-lpc-ctrl: LPC to AHB mapping on ast2600") Link: https://lore.kernel.org/r/20210629073520.318514-2-joel@jms.id.au Signed-off-by: Joel Stanley commit 8812dff6459dd898ba27e49ccac646d12bbcea23 Author: Joel Stanley Date: Wed Aug 18 10:35:34 2021 +0930 soc: aspeed: socinfo: Add AST2625 variant Add AST26XX series AST2625-A3 SOC ID, taken from the vendor u-boot SDK: arch/arm/mach-aspeed/ast2600/scu_info.c + SOC_ID("AST2625-A3", 0x0503040305030403), Reviewed-by: Dylan Hung Link: https://lore.kernel.org/r/20210818010534.2508122-1-joel@jms.id.au Signed-off-by: Joel Stanley commit a437b9b488e36e41026888fc0aa20ec83f39a643 Author: Christoph Hellwig Date: Fri Aug 13 09:16:52 2021 -0700 xfs: remove support for untagged lookups in xfs_icwalk* With quotaoff not allowing disabling of accounting there is no need for untagged lookups in this code, so remove the dead leftovers. Repoted-by: Dan Carpenter Signed-off-by: Christoph Hellwig [djwong: convert to for_each_perag_tag] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 32816fd7920b32c24e1720ce387482fb430959fc Author: Darrick J. Wong Date: Thu Aug 12 10:10:44 2021 -0700 xfs: constify btree function parameters that are not modified Constify the rest of the btree functions that take structure and union pointers and are not supposed to modify them. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 60e265f7f85a3d91c368f9284dc6501fa1f41e50 Author: Darrick J. Wong Date: Thu Aug 12 09:56:49 2021 -0700 xfs: make the start pointer passed to btree update_lastrec functions const This btree function is called when updating a record in the rightmost block of a btree so that we can update the AGF's longest free extent length field. Neither parameter is supposed to be updated, so mark them both const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit deb06b9ab6dfa167c280a68d5acb2f12e007073f Author: Darrick J. Wong Date: Thu Aug 12 09:53:27 2021 -0700 xfs: make the start pointer passed to btree alloc_block functions const The @start pointer passed to each per-AG btree type's ->alloc_block function isn't supposed to be modified, since it's a hint about the location of the btree block being split that is to be fed to the allocator, so mark the parameter const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit b5a6e5fe0e6840bc90e51cf522d6c5a880cde567 Author: Darrick J. Wong Date: Thu Aug 12 09:49:03 2021 -0700 xfs: make the pointer passed to btree set_root functions const The pointer passed to each per-AG btree type's ->set_root function isn't supposed to be modified (that function sets an external pointer to the root block) so mark them const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 22ece4e836beff1df528ee09cf21ca5fab7235f5 Author: Darrick J. Wong Date: Tue Aug 10 17:02:17 2021 -0700 xfs: mark the record passed into xchk_btree functions as const xchk_btree calls a user-supplied function to validate each btree record that it finds. Those functions are not supposed to change the record data, so mark the parameter const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 8e38dc88a67b3c7475cbe8a132d03542717c1e27 Author: Darrick J. Wong Date: Tue Aug 10 17:02:17 2021 -0700 xfs: make the keys and records passed to btree inorder functions const The inorder functions are simple predicates, which means that they don't modify the parameters. Mark them all const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 23825cd148764ce133ee92375da395140d6ccb15 Author: Darrick J. Wong Date: Tue Aug 10 17:02:16 2021 -0700 xfs: mark the record passed into btree init_key functions as const These functions initialize a key from a record, but they aren't supposed to modify the record. Mark it const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 159eb69dba8baf6d5b58b69936920fb311324c82 Author: Darrick J. Wong Date: Tue Aug 10 17:02:16 2021 -0700 xfs: make the record pointer passed to query_range functions const The query_range functions are supposed to call a caller-supplied function on each record found in the dataset. These functions don't own the memory storing the record, so don't let them change the record. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 04dcb47482a9d9e27feba48ca92613edced42ef9 Author: Darrick J. Wong Date: Tue Aug 10 17:02:15 2021 -0700 xfs: make the key parameters to all btree query range functions const Range query functions are not supposed to modify the query keys that are being passed in, so mark them all const. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit d29d5577774d7d032da1343dba80be7423e307f9 Author: Darrick J. Wong Date: Tue Aug 10 17:02:15 2021 -0700 xfs: make the key parameters to all btree key comparison functions const The btree key comparison functions are not allowed to change the keys that are passed in, so mark them const. We'll need this for the next patch, which adds const to the btree range query functions. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 7f89c838396e2e5b484dd59cdd59eb990a79fd9a Author: Darrick J. Wong Date: Tue Aug 10 17:00:54 2021 -0700 xfs: add trace point for fs shutdown Add a tracepoint for fs shutdowns so we can capture that in ftrace output. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 54406764c6a6ce6d7468934e09f0463e4e05433b Author: Darrick J. Wong Date: Mon Aug 9 16:31:14 2021 -0700 xfs: remove unnecessary agno variable from struct xchk_ag Now that we always grab an active reference to a perag structure when dealing with perag metadata, we can remove this unnecessary variable. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 7e1826e05ba62e85fe110939a181c8f0d58c14cf Author: Darrick J. Wong Date: Tue Aug 10 17:00:31 2021 -0700 xfs: make fsmap backend function key parameters const There are several GETFSMAP backend functions for XFS to cover the three devices and various feature support. Each of these functions are passed pointers to the low and high keys for the dataset that userspace requested, and a pointer to scratchpad variables that are used to control the iteration and fill out records. The scratchpad data can be changed arbitrarily, but the keys are supposed to remain unchanged (and under the control of the outermost loop in xfs_getfsmap). Unfortunately, the data and rt backends modify the keys that are passed in from the main control loop, which causes subsequent calls to return incorrect query results. Specifically, each of those two functions set the block number in the high key to the size of their respective device. Since fsmap results are sorted in device number order, if the lower numbered device is smaller than the higher numbered device, the first function will set the high key to the small size, and the key remains unchanged as it is passed into the function for the higher numbered device. The second function will then fail to return all of the results for the dataset that userspace is asking for because the keyspace is incorrectly constrained. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R commit 9ab72f22277487d2a3ffc8dd20fc918e186bb2b3 Author: Darrick J. Wong Date: Tue Aug 10 17:00:31 2021 -0700 xfs: fix off-by-one error when the last rt extent is in use The fsmap implementation for realtime devices uses the gap between info->next_daddr and a free rtextent reported by xfs_rtalloc_query_range to feed userspace fsmap records with an "unknown" owner. We use this trick to report to userspace when the last rtextent in the filesystem is in use by synthesizing a null rmap record starting at the next block after the query range. Unfortunately, there's a minor accounting bug in the way that we construct the null rmap record. Originally, ahigh.ar_startext contains the last rtextent for which the user wants records. It's entirely possible that number is beyond the end of the rt volume, so the location synthesized rmap record /must/ be constrained to the minimum of the high key and the number of extents in the rt volume. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R commit c02f6529864a4f5f91d216d324bac4ba75415d19 Author: Darrick J. Wong Date: Tue Aug 10 17:00:30 2021 -0700 xfs: make xfs_rtalloc_query_range input parameters const In commit 8ad560d2565e, we changed xfs_rtalloc_query_range to constrain the range of bits in the realtime bitmap file that would actually be searched. In commit a3a374bf1889, we changed the range again (incorrectly), leading to the fix in commit d88850bd5516, which finally corrected the range check code. Unfortunately, the author never noticed that the function modifies its input parameters, which is a totaly no-no since none of the other range query functions change their input parameters. So, fix this function yet again to stash the upper end of the query range (i.e. the high key) in a local variable and hope this is the last time I have to fix my own function. While we're at it, mark the key inputs const so nobody makes this mistake again. :( Fixes: 8ad560d2565e ("xfs: strengthen rtalloc query range checks") Not-fixed-by: a3a374bf1889 ("xfs: fix off-by-one error in xfs_rtalloc_query_range") Not-fixed-by: d88850bd5516 ("xfs: fix high key handling in the rt allocator's query_range function") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R commit 21b4ee7029c9072d410e15f64840659241ba8f4a Author: Dave Chinner Date: Tue Aug 10 18:33:41 2021 -0700 xfs: drop ->writepage completely ->writepage is only used in one place - single page writeback from memory reclaim. We only allow such writeback from kswapd, not from direct memory reclaim, and so it is rarely used. When it comes from kswapd, it is effectively random dirty page shoot-down, which is horrible for IO patterns. We will already have background writeback trying to clean all the dirty pages in memory as efficiently as possible, so having kswapd interrupt our well formed IO stream only slows things down. So get rid of xfs_vm_writepage() completely. Signed-off-by: Dave Chinner [djwong: forward port to 5.15] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c0891ac15f0428ffa81b2e818d416bdf3cb74ab6 Author: Alexey Dobriyan Date: Mon Aug 2 23:40:32 2021 +0300 isystem: ship and use stdarg.h Ship minimal stdarg.h (1 type, 4 macros) as . stdarg.h is the only userspace header commonly used in the kernel. GPL 2 version of can be extracted from http://archive.debian.org/debian/pool/main/g/gcc-4.2/gcc-4.2_4.2.4.orig.tar.gz Signed-off-by: Alexey Dobriyan Acked-by: Rafael J. Wysocki Acked-by: Ard Biesheuvel Signed-off-by: Masahiro Yamada commit 39f75da7bcc829ddc4d40bb60d0e95520de7898b Author: Alexey Dobriyan Date: Mon Aug 2 23:40:31 2021 +0300 isystem: trim/fixup stdarg.h and other headers Delete/fixup few includes in anticipation of global -isystem compile option removal. Note: crypto/aegis128-neon-inner.c keeps due to redefinition of uintptr_t error (one definition comes from , another from ). Signed-off-by: Alexey Dobriyan Signed-off-by: Masahiro Yamada commit 9bdc81ce440ec6ea899b236879aee470ec388020 Author: Amey Narkhede Date: Tue Aug 17 23:35:00 2021 +0530 PCI: Change the type of probe argument in reset functions Change the type of probe argument in functions which implement reset methods from int to bool to make the context and intent clear. Suggested-by: Alex Williamson Link: https://lore.kernel.org/r/20210817180500.1253-10-ameynarkhede03@gmail.com Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas commit 6937b7dd434962377e00efc04adac0390c287199 Author: Shanker Donthineni Date: Tue Aug 17 23:34:59 2021 +0530 PCI: Add support for ACPI _RST reset method _RST is a standard ACPI method that performs a function level reset of a device (ACPI v6.3, sec 7.3.25). Add pci_dev_acpi_reset() to probe for _RST method and execute if present. The default priority of this reset is set to below device-specific and above hardware resets. Suggested-by: Alex Williamson Link: https://lore.kernel.org/r/20210817180500.1253-9-ameynarkhede03@gmail.com Signed-off-by: Shanker Donthineni Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Alex Williamson commit 374e74de96310cc63b9e3cde876e031107e6af6c Author: Xu Liu Date: Wed Aug 18 18:58:20 2021 +0800 selftests/bpf: Test for get_netns_cookie Add test to use get_netns_cookie() from BPF_PROG_TYPE_SOCK_OPS. Signed-off-by: Xu Liu Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210818105820.91894-3-liuxu623@gmail.com commit 6cf1770d63dd2d0d0d4048e7b3ee360336c072d9 Author: Xu Liu Date: Wed Aug 18 18:58:19 2021 +0800 bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_SOCK_OPS We'd like to be able to identify netns from sockops hooks to accelerate local process communication form different netns. Signed-off-by: Xu Liu Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210818105820.91894-2-liuxu623@gmail.com commit 36a7aee027bcc55f92370903682487c8a2e30ace Author: Lukas Bulwahn Date: Wed Aug 18 14:41:11 2021 +0200 drm: amdgpu: remove obsolete reference to config CHASH Commit 04ed8459f334 ("drm/amdgpu: remove chash") removes the chash architecture and its corresponding config CHASH. There is still a reference to CHASH in the config DRM_AMDGPU in ./drivers/gpu/drm/Kconfig. Remove this obsolete reference to config CHASH. Signed-off-by: Lukas Bulwahn Signed-off-by: Alex Deucher commit c94126c4aa4886b2be45f9d22cb9aff90a170179 Author: Colin Ian King Date: Tue Aug 17 15:35:14 2021 +0100 drm/amd/pm: Fix spelling mistake "firwmare" -> "firmware" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 691191a2f458e0176414cb5b3993b0c018cdc58c Author: YuBiao Wang Date: Tue Aug 17 17:36:33 2021 +0800 drm/amd/amdgpu:flush ttm delayed work before cancel_sync [Why] In some cases when we unload driver, warning call trace will show up in vram_mgr_fini which claims that LRU is not empty, caused by the ttm bo inside delay deleted queue. [How] We should flush delayed work to make sure the delay deleting is done. Signed-off-by: YuBiao Wang Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit ce97f37be8957a7f3f42eafaa9469b0ab941e63b Author: Candice Li Date: Mon Aug 16 23:28:55 2021 +0800 drm/amd: consolidate TA shared memory structures Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit f2bd514d852eb0f26dde72cd0853e0992b038682 Author: Hawking Zhang Date: Mon Aug 16 16:56:19 2021 +0800 drm/amdgpu: increase max xgmi physical node for aldebaran aldebaran supports up to 16 xgmi physical nodes. Signed-off-by: Hawking Zhang Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 42447deb883903b1b760e71448023fe4cc4415c3 Author: Evan Quan Date: Fri Aug 13 15:09:00 2021 +0800 drm/amdgpu: disable BACO support for 699F:C7 polaris12 SKU temporarily We have a S3 issue on that SKU with BACO enabled. Will bring back this when that root caused. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 65c7e943ea59e0b1c42fa29d27ba3f5ea234b57d Author: Zhan Liu Date: Fri Aug 13 08:31:04 2021 -0700 drm/amd/display: Use DCN30 watermark calc for DCN301 [why] dcn301_calculate_wm_and_dl() causes flickering when external monitor is connected. This issue has been fixed before by commit 0e4c0ae59d7e ("drm/amdgpu/display: drop dcn301_calculate_wm_and_dl for now"), however part of the fix was gone after commit 2cbcb78c9ee5 ("Merge tag 'amd-drm-next-5.13-2021-03-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-next"). [how] Use dcn30_calculate_wm_and_dlg() instead as in the original fix. Fixes: 2cbcb78c9ee5 ("Merge tag 'amd-drm-next-5.13-2021-03-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-next") Signed-off-by: Nikola Cornij Reviewed-by: Zhan Liu Tested-by: Zhan Liu Tested-by: Oliver Logush Signed-off-by: Zhan Liu Signed-off-by: Alex Deucher commit 424f2b2e263e851cc4a470faaaeb46b70d703876 Author: Zhigang Luo Date: Thu Aug 12 11:00:17 2021 -0400 drm/amdgpu: correct MMSCH 1.0 version MMSCH 1.0 doesn't have major/minor version, only verison. Signed-off-by: Zhigang Luo Reviewed by Shaoyun.liu Signed-off-by: Alex Deucher commit 44357a1bd5f5a1012024a127a4653c2dfa4af18a Author: Jonathan Kim Date: Tue Aug 3 19:01:55 2021 -0400 drm/amdgpu: get extended xgmi topology data The TA has a limit to the amount of data that can be retrieved from GET_TOPOLOGY. For setups that exceed this limit, the xGMI topology needs to be re-initialized and data needs to be re-fetched from the extended link records by setting a flag in the shared command buffer. The number of hops and the number of links must be accumulated by the driver. Other data points are all fetched from the first request. Because the TA has already exceeded its link record limit, it cannot hold bidirectional information. Otherwise the driver would have to do more than two fetches so the driver has to reflect the topology information in the opposite direction. v2: squashed with internal reviewed fix Signed-off-by: Jonathan Kim Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 19b8ece42c56aaa122f7e91eb391bb3dd7e193cd Author: Jason Wang Date: Tue Aug 17 20:11:06 2021 +0800 net/mlx4: Use ARRAY_SIZE to get an array's size The ARRAY_SIZE macro is defined to get an array's size which is more compact and more formal in linux source. Thus, we can replace the long sizeof(arr)/sizeof(arr[0]) with the compact ARRAY_SIZE. Signed-off-by: Jason Wang Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20210817121106.44189-1-wangborong@cdjrlc.com Signed-off-by: Jakub Kicinski commit 375553a93201a58a52f142eab19545a07aa1eaf5 Author: Shanker Donthineni Date: Tue Aug 17 23:34:58 2021 +0530 PCI: Setup ACPI fwnode early and at the same time with OF Previously, the ACPI_COMPANION() of a pci_dev was usually set by acpi_bind_one() in this path: pci_device_add pci_configure_device pci_init_capabilities device_add device_platform_notify acpi_platform_notify acpi_device_notify # KOBJ_ADD acpi_bind_one ACPI_COMPANION_SET However, things like pci_configure_device() and pci_init_capabilities() that run before device_add() need the ACPI_COMPANION, e.g., acpi_pci_bridge_d3() uses a _DSD method to learn about D3 support. These places had special-case code to manually look up the ACPI_COMPANION. Set the ACPI_COMPANION earlier, in pci_setup_device(), so it will be available while configuring the device. This covers both paths to creating pci_dev objects: pci_scan_single_device # for normal non-SR-IOV devices pci_scan_device pci_setup_device pci_set_acpi_fwnode pci_device_add pci_iov_add_virtfn # for SR-IOV virtual functions pci_setup_device pci_set_acpi_fwnode Also move the OF fwnode setup to the same spot. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20210817180500.1253-8-ameynarkhede03@gmail.com Signed-off-by: Shanker Donthineni Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit 845cbf3e11acc263ec7a46a89097d88e7e50a9ae Author: Steven Rostedt (VMware) Date: Mon Aug 16 23:43:00 2021 -0400 tracing/probes: Use struct_size() instead of defining custom macros Remove SIZEOF_TRACE_KPROBE() and SIZEOF_TRACE_UPROBE() and use struct_size() as that's what it is made for. No need to have custom macros. Especially since struct_size() has some extra memory checks for correctness. Link: https://lkml.kernel.org/r/20210817035027.795000217@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit bc1b973455fd5d84dac4a094da44202f2d8a98ef Author: Steven Rostedt (VMware) Date: Mon Aug 16 23:42:59 2021 -0400 tracing/probes: Allow for dot delimiter as well as slash for system names Kprobe and uprobe events can add a "system" to the events that are created via the kprobe_events and uprobe_events files respectively. If they do not include a "system" in the name, then the default "kprobes" or "uprobes" is used. The current notation to specify a system for one of these probe events is to add a '/' delimiter in the name, where the content before the '/' will be the system to use, and the content after will be the event name. echo 'p:my_system/my_event' > kprobe_events But this is inconsistent with the way histogram triggers separate their system / event names. The histogram triggers use a '.' delimiter, which can be confusing. To allow this to be more consistent, as well as keep backward compatibility, allow the kprobe and uprobe events to denote a system name with either a '/' or a '.'. That is: echo 'p:my_system/my_event' > kprobe_events is equivalent to: echo 'p:my_system.my_event' > kprobe_events Link: https://lore.kernel.org/linux-trace-devel/20210813004448.51c7de69ce432d338f4d226b@kernel.org/ Link: https://lkml.kernel.org/r/20210817035027.580493202@goodmis.org Suggested-by: Masami Hiramatsu Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit fcd9db51df8e219e3a61b14e9b8c5ee67d39d37c Author: Steven Rostedt (VMware) Date: Mon Aug 16 23:42:58 2021 -0400 tracing/probe: Have traceprobe_parse_probe_arg() take a const arg The two places that call traceprobe_parse_probe_arg() allocate a temporary buffer to copy the argv[i] into, because argv[i] is constant and the traceprobe_parse_probe_arg() will modify it to do the parsing. These two places allocate this buffer and then free it right after calling this function, leaving the onus of this allocation to the caller. As there's about to be a third user of this function that will have to do the same thing, instead of having the caller allocate the temporary buffer, simply move that allocation into the traceprobe_parse_probe_arg() itself, which will simplify the code of the callers. Link: https://lkml.kernel.org/r/20210817035027.385422828@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 1d18538e6a09265003a0a94ca779d7a6127cb76c Author: Steven Rostedt (VMware) Date: Mon Aug 16 23:42:57 2021 -0400 tracing: Have dynamic events have a ref counter As dynamic events are not created by modules, if something is attached to one, calling "try_module_get()" on its "mod" field, is not going to keep the dynamic event from going away. Since dynamic events do not need the "mod" pointer of the event structure, make a union out of it in order to save memory (there's one structure for each of the thousand+ events in the kernel), and have any event with the DYNAMIC flag set to use a ref counter instead. Link: https://lore.kernel.org/linux-trace-devel/20210813004448.51c7de69ce432d338f4d226b@kernel.org/ Link: https://lkml.kernel.org/r/20210817035027.174869074@goodmis.org Suggested-by: Masami Hiramatsu Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 8b0e6c744fef6462382041b30878c91f15069fc6 Author: Steven Rostedt (VMware) Date: Mon Aug 16 23:42:56 2021 -0400 tracing: Add DYNAMIC flag for dynamic events To differentiate between static and dynamic events, add a new flag DYNAMIC to the event flags that all dynamic events have set. This will allow to differentiate when attaching to a dynamic event from a static event. Static events have a mod pointer that references the module they were created in (or NULL for core kernel). This can be incremented when the event has something attached to it. But there exists no such mechanism for dynamic events. This is dangerous as the dynamic events may now disappear without the "attachment" knowing that it no longer exists. To enforce the dynamic flag, change dyn_event_add() to pass the event that is being created such that it can set the DYNAMIC flag of the event. This helps make sure that no location that creates a dynamic event misses setting this flag. Link: https://lore.kernel.org/linux-trace-devel/20210813004448.51c7de69ce432d338f4d226b@kernel.org/ Link: https://lkml.kernel.org/r/20210817035026.936958254@goodmis.org Suggested-by: Masami Hiramatsu Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 4273e64cc4ebb881e1954d768020f5440491dcd9 Author: Shanker Donthineni Date: Tue Aug 17 16:09:47 2021 -0500 PCI: Use acpi_pci_power_manageable() Use acpi_pci_power_manageable() instead of duplicating the logic in acpi_pci_bridge_d3(). No functional change intended. [bhelgaas: split out from https://lore.kernel.org/r/20210817180500.1253-8-ameynarkhede03@gmail.com] Signed-off-by: Shanker Donthineni Signed-off-by: Bjorn Helgaas commit 3a15955d7cf0b6c7527ee3bd97c3c355450e3fa1 Author: Shanker Donthineni Date: Tue Aug 17 23:34:57 2021 +0530 PCI: Add pci_set_acpi_fwnode() to set ACPI_COMPANION Move the existing logic from acpi_pci_bridge_d3() to a separate function pci_set_acpi_fwnode() to set the ACPI fwnode. No functional change intended. Link: https://lore.kernel.org/r/20210817180500.1253-7-ameynarkhede03@gmail.com Signed-off-by: Shanker Donthineni Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit d88f521da3efd698e36d0d504a2abba6ac4f5ef8 Author: Amey Narkhede Date: Tue Aug 17 23:34:56 2021 +0530 PCI: Allow userspace to query and set device reset mechanism Add "reset_method" sysfs attribute to enable user to query and set preferred device reset methods and their ordering. [bhelgaas: on invalid sysfs input, return error and preserve previous config, as in earlier patch versions] Co-developed-by: Alex Williamson Link: https://lore.kernel.org/r/20210817180500.1253-6-ameynarkhede03@gmail.com Signed-off-by: Alex Williamson Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas Reviewed-by: Raphael Norwitz commit 9d508827c7939242e8ed6b06f66aa87d9f7ea832 Author: Chris Morgan Date: Thu Aug 12 21:45:44 2021 +0800 ARM: dts: rockchip: Add SFC to RV1108 Add a devicetree entry for the Rockchip SFC for the RV1108 SOC. Signed-off-by: Chris Morgan Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20210812134546.31340-5-jon.lin@rock-chips.com Signed-off-by: Heiko Stuebner commit 92791836cb7d79bba66389daed57d4d92783f01e Author: Phillip Potter Date: Wed Aug 18 19:08:31 2021 +0100 staging: r8188eu: rename variable within rtl8188e_Add_RateATid Rename 'shortGIrate' within the rtl8188e_Add_RateATid function to 'short_gi_rate', to comply with kernel camel case style rules. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210818180831.67581-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 1fd6d8ffad4a6ffd38d79e42c15472c4ff6332f7 Author: Martin Kaiser Date: Wed Aug 18 22:00:41 2021 +0200 staging: r8188eu: ctrl vendor req index is not used The index for r8188eu's vendor-specific control requests is not used. Remove the index parameter from usbctrl_vendorreq and pass index 0 to usb_control_msg. This patch is an adaptation of commit 3d0be94f62fd ("staging: rtl8188eu: ctrl vendor req index is not used") for the new r8188eu driver. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210818200041.10870-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d580fc6dbf2cca7c28c52cb37733849b67461117 Author: Martin Kaiser Date: Wed Aug 18 22:00:40 2021 +0200 staging: r8188eu: ctrl vendor req value is always 0x05 The bRequest value for the vendor specific control requests sent by this driver is always 0x05. Replace the function parameter with the define from usb_ops.h. This patch is an adaptation of commit eeb4661560ff ("staging: rtl8188eu: ctrl vendor req value is always 0x05") for the new r8188eu driver. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210818200041.10870-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5353dd72f99207e8118a766847df8d60bb559940 Author: Sebastian Andrzej Siewior Date: Wed Aug 18 13:40:22 2021 -0600 coresight: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Link: https://lore.kernel.org/r/20210803141621.780504-15-bigeasy@linutronix.de Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: Alexander Shishkin Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-12-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit f71cd93d5ea49c9993a30bea4e64d704d3caca26 Author: Mike Leach Date: Wed Aug 18 13:40:21 2021 -0600 Documentation: coresight: Add documentation for CoreSight config Adds documentation for the CoreSight System configuration manager. Link: https://lore.kernel.org/r/20210723165444.1048-11-mike.leach@linaro.org [Fixed coresight-config.rst documentation link] Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-11-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit a13d5a246aca17c44514be9afa20b34443182356 Author: Mike Leach Date: Wed Aug 18 13:40:20 2021 -0600 coresight: syscfg: Add initial configfs support Adds configfs subsystem and attributes to the configuration manager to enable the listing of loaded configurations and features. The default values of feature parameters can be accessed and altered from these attributes to affect all installed devices using the feature. Link: https://lore.kernel.org/r/20210723165444.1048-10-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-10-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7fdc9bb2ce113c5318fdacbb717897fede81949d Author: Mike Leach Date: Wed Aug 18 13:40:19 2021 -0600 coresight: config: Add preloaded configurations Preload set of configurations. This patch creates a small set of preloaded configurations and features that are available immediately after coresight has been initialised. The current set provides a strobing feature for ETMv4, that creates a periodic sampling of trace by switching trace generation on and off using counters in the ETM. A configuration called "autofdo" is also provided that uses the 'strobing' feature and provides a couple of preset values, selectable on the perf command line. Link: https://lore.kernel.org/r/20210723165444.1048-9-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-9-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 810ac401db1fe432020d7936a199591000de8279 Author: Mike Leach Date: Wed Aug 18 13:40:18 2021 -0600 coresight: etm4x: Add complex configuration handlers to etmv4 Adds in handlers to allow the ETMv4 to use the complex configuration support. Features and configurations can be loaded and selected in the device. Link: https://lore.kernel.org/r/20210723165444.1048-8-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-8-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit a0114b4740dd739df97d09db7c9bfc11579fc515 Author: Mike Leach Date: Wed Aug 18 13:40:17 2021 -0600 coresight: etm-perf: Update to activate selected configuration Add calls to activate the selected configuration as perf starts and stops the tracing session. Link: https://lore.kernel.org/r/20210723165444.1048-7-mike.leach@linaro.org Reviewed-by: Suzuki K Poulose Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-7-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit f8cce2ff3c04361b8843d8489620fda8880f668b Author: Mike Leach Date: Wed Aug 18 13:40:16 2021 -0600 coresight: syscfg: Add API to activate and enable configurations Configurations are first activated, then when any coresight device is enabled, the active configurations are checked and any matching one is enabled. This patch provides the activation / enable API. Link: https://lore.kernel.org/r/20210723165444.1048-6-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-6-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 94d2bac540762e7517933d365dd6289f54963c97 Author: Mike Leach Date: Wed Aug 18 13:40:15 2021 -0600 coresight: etm-perf: Update to handle configuration selection Loaded coresight configurations are registered in the cs_etm\events sub directory. This extends the etm-perf code to handle these registrations, and the cs_syscfg driver to perform the registration on load. Link: https://lore.kernel.org/r/20210723165444.1048-5-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-5-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit f53e93ac8cf705fffdefe79573ce001d81c3c6fe Author: Mike Leach Date: Wed Aug 18 13:40:14 2021 -0600 coresight: config: Add configuration and feature generic functions Adds a set of generic support functions that allow devices to set and save features values on the device, and enable and disable configurations. Additional functions for other common operations including feature reset. Link: https://lore.kernel.org/r/20210723165444.1048-4-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-4-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 42ff700f3112babac129f4ae33023a7b7ce40a29 Author: Mike Leach Date: Wed Aug 18 13:40:13 2021 -0600 coresight: syscfg: Add registration and feature loading for cs devices API for individual devices to register with the syscfg management system is added. Devices register with matching information, and any features or configurations that match will be loaded into the device. The feature and configuration loading is extended so that on load these are loaded into any currently registered devices. This allows configuration loading after devices have been registered. Link: https://lore.kernel.org/r/20210723165444.1048-3-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-3-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 85e2414c518a03a21dddd4bc88fec2723c5e1197 Author: Mike Leach Date: Wed Aug 18 13:40:12 2021 -0600 coresight: syscfg: Initial coresight system configuration Creates an system management API to allow complex configurations and features to be programmed into a CoreSight infrastructure. A feature is defined as a programming set for a device or class of devices. A configuration is a set of features across the system that are enabled for a trace session. The API will manage system wide configuration, and allow complex programmed features to be added to individual device instances, and provide for system wide configuration selection on trace capture operations. This patch creates the initial data object and the initial API for loading configurations and features. Link: https://lore.kernel.org/r/20210723165444.1048-2-mike.leach@linaro.org Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210818194022.379573-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit e6d468d32cd084edd030a8bae76440b17b854b5c Author: Kees Cook Date: Wed Aug 18 10:48:55 2021 -0700 lkdtm/heap: Avoid __alloc_size hint warning for VMALLOC_LINEAR_OVERFLOW Once __alloc_size hints have been added, the compiler will (correctly!) see this as an overflow. We are, however, trying to test for this condition at run-time (not compile-time), so work around it with a volatile int offset. Cc: Arnd Bergmann Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818174855.2307828-5-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit b8661450bc7f1f3dd746f8cac48534e0dfdc1cdf Author: Kees Cook Date: Wed Aug 18 10:48:54 2021 -0700 lkdtm: Add kernel version to failure hints In an effort to keep as much information in once place as possible in CI logs, report the kernel version and architecture in the failure hints. Cc: Arnd Bergmann Cc: kernelci@groups.io Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818174855.2307828-4-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit fe8e353bfda6d6c8cefd0a933640025ad3d302e5 Author: Kees Cook Date: Wed Aug 18 10:48:53 2021 -0700 lkdtm/fortify: Consolidate FORTIFY_SOURCE tests The FORTIFY_SOURCE tests were split between bugs.c and fortify.c. Move tests into fortify.c, standardize their naming, add CONFIG hints, and add them to the lkdtm selftests. Cc: Arnd Bergmann Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818174855.2307828-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit c75be56e35b2eef824a2ac8d90a98f9e65b28efa Author: Kees Cook Date: Wed Aug 18 10:48:52 2021 -0700 lkdtm/bugs: Add ARRAY_BOUNDS to selftests Add CONFIG hints about why the ARRAY_BOUNDS test might fail, and similarly include the CONFIGs needed to pass the ARRAY_BOUNDS test via the selftests, and add to selftests. Cc: kernelci@groups.io Suggested-by: Guillaume Tucker Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818174855.2307828-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb Author: Kees Cook Date: Wed Aug 18 10:30:18 2021 -0700 USB: EHCI: Add alias for Broadcom INSNREG Refactor struct ehci_regs to avoid accessing beyond the end of port_status. This change results in no difference in the final object code. Avoids several warnings when building with -Warray-bounds: drivers/usb/host/ehci-brcm.c: In function 'ehci_brcm_reset': drivers/usb/host/ehci-brcm.c:113:32: warning: array subscript 16 is above array bounds of 'u32[15]' {aka 'unsigned int[15]'} [-Warray-bounds] 113 | ehci_writel(ehci, 0x00800040, &ehci->regs->port_status[0x10]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/usb/host/ehci.h:274, from drivers/usb/host/ehci-brcm.c:15: ./include/linux/usb/ehci_def.h:132:7: note: while referencing 'port_status' 132 | u32 port_status[HCS_N_PORTS_MAX]; | ^~~~~~~~~~~ Note that the documentation around this proprietary register was confusing. If "USB_EHCI_INSNREG00" is at port_status[0x0f], its offset would be 0x80 (not 0x90). The comments have been adjusted to fix this apparent typo. Fixes: 9df231511bd6 ("usb: ehci: Add new EHCI driver for Broadcom STB SoC's") Cc: Al Cooper Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com Suggested-by: Arnd Bergmann Acked-by: Alan Stern Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818173018.2259231-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 72dd1843232c9de48e21dc1c85d169fe5328e52e Author: Kees Cook Date: Wed Aug 18 10:30:17 2021 -0700 USB: EHCI: Add register array bounds to HCS ports The original EHCI register struct used a trailing 0-element array for addressing the N_PORTS-many available registers. However, after commit a46af4ebf9ff ("USB: EHCI: define extension registers like normal ones") the 0-element array started to overlap the USBMODE extension register. To avoid future compile-time warnings about accessing indexes within a 0-element array, rearrange the struct to actually describe the expected layout (max 15 registers) with a union. All offsets remain the same, and bounds checking becomes possible on accesses to port_status and hostpc. There are no binary differences, and struct offsets continue to match. "pahole --hex -C ehci_regs" before: struct ehci_regs { u32 command; /* 0 0x4 */ u32 status; /* 0x4 0x4 */ u32 intr_enable; /* 0x8 0x4 */ u32 frame_index; /* 0xc 0x4 */ u32 segment; /* 0x10 0x4 */ u32 frame_list; /* 0x14 0x4 */ u32 async_next; /* 0x18 0x4 */ u32 reserved1[2]; /* 0x1c 0x8 */ u32 txfill_tuning; /* 0x24 0x4 */ u32 reserved2[6]; /* 0x28 0x18 */ /* --- cacheline 1 boundary (64 bytes) --- */ u32 configured_flag; /* 0x40 0x4 */ u32 port_status[0]; /* 0x44 0 */ u32 reserved3[9]; /* 0x44 0x24 */ u32 usbmode; /* 0x68 0x4 */ u32 reserved4[6]; /* 0x6c 0x18 */ /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ u32 hostpc[0]; /* 0x84 0 */ u32 reserved5[17]; /* 0x84 0x44 */ /* --- cacheline 3 boundary (192 bytes) was 8 bytes ago --- */ u32 usbmode_ex; /* 0xc8 0x4 */ /* size: 204, cachelines: 4, members: 18 */ /* last cacheline: 12 bytes */ }; after: struct ehci_regs { u32 command; /* 0 0x4 */ u32 status; /* 0x4 0x4 */ u32 intr_enable; /* 0x8 0x4 */ u32 frame_index; /* 0xc 0x4 */ u32 segment; /* 0x10 0x4 */ u32 frame_list; /* 0x14 0x4 */ u32 async_next; /* 0x18 0x4 */ u32 reserved1[2]; /* 0x1c 0x8 */ u32 txfill_tuning; /* 0x24 0x4 */ u32 reserved2[6]; /* 0x28 0x18 */ /* --- cacheline 1 boundary (64 bytes) --- */ u32 configured_flag; /* 0x40 0x4 */ union { u32 port_status[15]; /* 0x44 0x3c */ struct { u32 reserved3[9]; /* 0x44 0x24 */ u32 usbmode; /* 0x68 0x4 */ }; /* 0x44 0x28 */ }; /* 0x44 0x3c */ /* --- cacheline 2 boundary (128 bytes) --- */ u32 reserved4; /* 0x80 0x4 */ u32 hostpc[15]; /* 0x84 0x3c */ /* --- cacheline 3 boundary (192 bytes) --- */ u32 reserved5[2]; /* 0xc0 0x8 */ u32 usbmode_ex; /* 0xc8 0x4 */ /* size: 204, cachelines: 4, members: 16 */ /* last cacheline: 12 bytes */ }; With this fixed, adding -Wzero-length-bounds to the build no longer produces several warnings like this: In file included from drivers/usb/host/ehci-hcd.c:306: drivers/usb/host/ehci-hub.c: In function 'ehci_port_handed_over': drivers/usb/host/ehci-hub.c:1194:8: warning: array subscript '' is outside the bounds of an interior zero-length array 'u32[0]' {aka 'unsigned int[]'} [-Wzero-length-bounds] 1194 | reg = &ehci->regs->port_status[portnum - 1]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/usb/host/ehci.h:274, from drivers/usb/host/ehci-hcd.c:97: ./include/linux/usb/ehci_def.h:130:7: note: while referencing 'port_status' 130 | u32 port_status[0]; /* up to N_PORTS */ | ^~~~~~~~~~~ Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Al Cooper Cc: Alan Stern Cc: linux-usb@vger.kernel.org Acked-by: Alan Stern Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818173018.2259231-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 332f606b32b6291a944c8cf23b91f53a6e676525 Author: Miklos Szeredi Date: Wed Aug 18 22:08:24 2021 +0200 ovl: enable RCU'd ->get_acl() Overlayfs does not cache ACL's (to avoid double caching). Instead it just calls the underlying filesystem's i_op->get_acl(), which will return the cached value, if possible. In rcu path walk, however, get_cached_acl_rcu() is employed to get the value from the cache, which will fail on overlayfs resulting in dropping out of rcu walk mode. This can result in a big performance hit in certain situations. Fix by calling ->get_acl() with rcu=true in case of ACL_DONT_CACHE (which indicates pass-through) Reported-by: garyhuang Signed-off-by: Miklos Szeredi commit 0cad6246621b5887d5b33fea84219d2a71f2f99a Author: Miklos Szeredi Date: Wed Aug 18 22:08:24 2021 +0200 vfs: add rcu argument to ->get_acl() callback Add a rcu argument to the ->get_acl() callback to allow get_cached_acl_rcu() to call the ->get_acl() method in the next patch. Signed-off-by: Miklos Szeredi commit cf39e60c83f1eddcf93d36fe01f1440a91d25214 Merge: 4513fb87e1402 6ecd53f49fad3 Author: Marc Zyngier Date: Wed Aug 18 20:51:53 2021 +0100 Merge branch irq/generic_handle_domain_irq into irq/irqchip-next - Tree-wide conversion to generic_handle_domain_irq() - irqdomain documentation update Drag the pinctl ib-rockchip branch to resolve conflicts. * irq/generic_handle_domain_irq: pinctrl/rockchip: drop the gpio related codes gpio/rockchip: drop irq_gc_lock/irq_gc_unlock for irq set type gpio/rockchip: support next version gpio controller gpio/rockchip: use struct rockchip_gpio_regs for gpio controller gpio/rockchip: add driver for rockchip gpio dt-bindings: gpio: change items restriction of clock for rockchip,gpio-bank pinctrl/rockchip: add pinctrl device to gpio bank struct pinctrl/rockchip: separate struct rockchip_pin_bank to a head file pinctrl/rockchip: always enable clock for gpio controller Signed-off-by: Marc Zyngier commit 36ca7943ac18aebf8aad4c50829eb2ea5ec847df Author: Xu Yu Date: Wed Aug 18 12:47:52 2021 -0700 mm/swap: consider max pages in iomap_swapfile_add_extent When the max pages (last_page in the swap header + 1) is smaller than the total pages (inode size) of the swapfile, iomap_swapfile_activate overwrites sis->max with total pages. However, frontswap_map is a swap page state bitmap allocated using the initial sis->max page count read from the swap header. If swapfile activation increases sis->max, it's possible for the frontswap code to walk off the end of the bitmap, thereby corrupting kernel memory. [djwong: modify the description a bit; the original paragraph reads: "However, frontswap_map is allocated using max pages. When test and clear the sis offset, which is larger than max pages, of frontswap_map in __frontswap_invalidate_page(), neighbors of frontswap_map may be overwritten, i.e., slab is polluted." Note also that this bug resulted in a behavioral change: activating a swap file that was formatted and later extended results in all pages being activated, not the number of pages recorded in the swap header.] This fixes the issue by considering the limitation of max pages of swap info in iomap_swapfile_add_extent(). To reproduce the case, compile kernel with slub RED ZONE, then run test: $ sudo stress-ng -a 1 -x softlockup,resources -t 72h --metrics --times \ --verify -v -Y /root/tmpdir/stress-ng/stress-statistic-12.yaml \ --log-file /root/tmpdir/stress-ng/stress-logfile-12.txt \ --temp-path /root/tmpdir/stress-ng/ We'll get the error log as below: [ 1151.015141] ============================================================================= [ 1151.016489] BUG kmalloc-16 (Not tainted): Right Redzone overwritten [ 1151.017486] ----------------------------------------------------------------------------- [ 1151.017486] [ 1151.018997] Disabling lock debugging due to kernel taint [ 1151.019873] INFO: 0x0000000084e43932-0x0000000098d17cae @offset=7392. First byte 0x0 instead of 0xcc [ 1151.021303] INFO: Allocated in __do_sys_swapon+0xcf6/0x1170 age=43417 cpu=9 pid=3816 [ 1151.022538] __slab_alloc+0xe/0x20 [ 1151.023069] __kmalloc_node+0xfd/0x4b0 [ 1151.023704] __do_sys_swapon+0xcf6/0x1170 [ 1151.024346] do_syscall_64+0x33/0x40 [ 1151.024925] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1151.025749] INFO: Freed in put_cred_rcu+0xa1/0xc0 age=43424 cpu=3 pid=2041 [ 1151.026889] kfree+0x276/0x2b0 [ 1151.027405] put_cred_rcu+0xa1/0xc0 [ 1151.027949] rcu_do_batch+0x17d/0x410 [ 1151.028566] rcu_core+0x14e/0x2b0 [ 1151.029084] __do_softirq+0x101/0x29e [ 1151.029645] asm_call_irq_on_stack+0x12/0x20 [ 1151.030381] do_softirq_own_stack+0x37/0x40 [ 1151.031037] do_softirq.part.15+0x2b/0x30 [ 1151.031710] __local_bh_enable_ip+0x4b/0x50 [ 1151.032412] copy_fpstate_to_sigframe+0x111/0x360 [ 1151.033197] __setup_rt_frame+0xce/0x480 [ 1151.033809] arch_do_signal+0x1a3/0x250 [ 1151.034463] exit_to_user_mode_prepare+0xcf/0x110 [ 1151.035242] syscall_exit_to_user_mode+0x27/0x190 [ 1151.035970] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1151.036795] INFO: Slab 0x000000003b9de4dc objects=44 used=9 fp=0x00000000539e349e flags=0xfffffc0010201 [ 1151.038323] INFO: Object 0x000000004855ba01 @offset=7376 fp=0x0000000000000000 [ 1151.038323] [ 1151.039683] Redzone 000000008d0afd3d: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ [ 1151.041180] Object 000000004855ba01: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 1151.042714] Redzone 0000000084e43932: 00 00 00 c0 cc cc cc cc ........ [ 1151.044120] Padding 000000000864c042: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ [ 1151.045615] CPU: 5 PID: 3816 Comm: stress-ng Tainted: G B 5.10.50+ #7 [ 1151.046846] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 1151.048633] Call Trace: [ 1151.049072] dump_stack+0x57/0x6a [ 1151.049585] check_bytes_and_report+0xed/0x110 [ 1151.050320] check_object+0x1eb/0x290 [ 1151.050924] ? __x64_sys_swapoff+0x39a/0x540 [ 1151.051646] free_debug_processing+0x151/0x350 [ 1151.052333] __slab_free+0x21a/0x3a0 [ 1151.052938] ? _cond_resched+0x2d/0x40 [ 1151.053529] ? __vunmap+0x1de/0x220 [ 1151.054139] ? __x64_sys_swapoff+0x39a/0x540 [ 1151.054796] ? kfree+0x276/0x2b0 [ 1151.055307] kfree+0x276/0x2b0 [ 1151.055832] __x64_sys_swapoff+0x39a/0x540 [ 1151.056466] do_syscall_64+0x33/0x40 [ 1151.057084] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1151.057866] RIP: 0033:0x150340b0ffb7 [ 1151.058481] Code: Unable to access opcode bytes at RIP 0x150340b0ff8d. [ 1151.059537] RSP: 002b:00007fff7f4ee238 EFLAGS: 00000246 ORIG_RAX: 00000000000000a8 [ 1151.060768] RAX: ffffffffffffffda RBX: 00007fff7f4ee66c RCX: 0000150340b0ffb7 [ 1151.061904] RDX: 000000000000000a RSI: 0000000000018094 RDI: 00007fff7f4ee860 [ 1151.063033] RBP: 00007fff7f4ef980 R08: 0000000000000000 R09: 0000150340a672bd [ 1151.064135] R10: 00007fff7f4edca0 R11: 0000000000000246 R12: 0000000000018094 [ 1151.065253] R13: 0000000000000005 R14: 000000000160d930 R15: 00007fff7f4ee66c [ 1151.066413] FIX kmalloc-16: Restoring 0x0000000084e43932-0x0000000098d17cae=0xcc [ 1151.066413] [ 1151.067890] FIX kmalloc-16: Object at 0x000000004855ba01 not freed Fixes: 67482129cdab ("iomap: add a swapfile activation function") Fixes: a45c0eccc564 ("iomap: move the swapfile code into a separate file") Signed-off-by: Gang Deng Signed-off-by: Xu Yu Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 6ecd53f49fad3dc2de2f34a035ffb06bd1972fde Merge: eecb06813d738 9ce9a02039de7 Author: Marc Zyngier Date: Wed Aug 18 20:38:01 2021 +0100 Merge remote-tracking branch 'linusw/ib-rockchip' into irq/generic_handle_domain_irq Merge Linus' ib-rockchip branch to avoid ugly conflicts with the generic_handle_domain_irq rework. Signed-off-by: Marc Zyngier commit a083fadf540dd63812651c7a7a0ce30dfbe5e6ee Author: Rob Herring Date: Tue Aug 17 12:47:43 2021 -0500 dt-bindings: PCI: faraday,ftpci100: Fix 'contains' schema usage The 'contains' keyword applies to elements within an array, so using 'items' only makes sense if the elements of the array are another array which is not the case for 'compatible' properties. Looking at the driver, it seems the intent was the condition should be true when 'faraday,ftpci100' is present, so we can drop 'cortina,gemini-pci'. Fixes: 2720b991337d ("dt-bindings: PCI: ftpci100: convert faraday,ftpci100 to YAML") Cc: Bjorn Helgaas Cc: Linus Walleij Cc: linux-pci@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210817174743.541353-1-robh@kernel.org Signed-off-by: Rob Herring commit 0a7eb4fe831b5966fff9ad2ec0323568c832911e Author: Krzysztof Kozlowski Date: Wed Aug 18 13:32:48 2021 +0200 dt-bindings: memory: convert TI a8xx DDR2/mDDR memory controller to dtschema Convert Texas Instruments da8xx DDR2/mDDR memory controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210818113248.85084-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 47e397a575221e6ccb6a4df6c615270ed4c38cda Author: Krzysztof Kozlowski Date: Wed Aug 18 13:31:39 2021 +0200 dt-bindings: memory: convert Synopsys IntelliDDR memory controller to dtschema Convert Synopsys IntelliDDR Multi Protocol memory controller (present in Xilinx Zynq and ZynqMP) bindings to DT schema format using json-schema. New binding contains copied parts of description from previous binding document, therefore the license is set as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210818113139.84869-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 0aa9ab9c291c7215da3549a379ef0c1c65b3a8e8 Author: Krzysztof Kozlowski Date: Tue Aug 17 11:38:07 2021 +0200 MAINTAINERS: EDAC/armada_xp: include dt-bindings Include dt-bindings for Marvell Armada XP SDRAM in the EDAC-ARMADA entry. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210817093807.59531-2-krzysztof.kozlowski@canonical.com commit ee05ab92ddf4ab502f80154cbe3563e61a343ee3 Author: Krzysztof Kozlowski Date: Tue Aug 17 11:38:06 2021 +0200 dt-bindings: memory: convert Marvell MVEBU SDRAM controller to dtschema Convert Marvell MVEBU SDRAM controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210817093807.59531-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit a0aca5e3dc349f4e3bfa9febf23d9dc401a7a3ed Author: Krzysztof Kozlowski Date: Tue Aug 17 10:06:17 2021 +0200 dt-bindings: memory: convert Broadcom DPFE to dtschema Convert Broadcom DDR PHY Front End (DPFE) bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Acked-by: Markus Mayer Link: https://lore.kernel.org/r/20210817080617.14503-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit cf4b94c8530d14017fbddae26aad064ddc42edd4 Author: Saravana Kannan Date: Tue Aug 17 19:17:16 2021 -0700 of: property: fw_devlink: Add support for "phy-handle" property Allows tracking dependencies between Ethernet PHYs and their consumers. Cc: Andrew Lunn Cc: netdev@vger.kernel.org Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210818021717.3268255-1-saravanak@google.com Signed-off-by: Rob Herring commit d03a493f6782b94b7002388d470cb583e061816a Author: Colin Ian King Date: Tue Aug 17 17:32:04 2021 +0100 drm/mgag200: Fix uninitialized variable delta The variable delta is not initialized and this will cause unexpected behaviour with the comparison of tmpdelta < delta. Fix this by setting it to 0xffffffff. This matches the behaviour as in the similar function mgag200_pixpll_compute_g200se_04. v2: * move fix up by one line to align style with other functions * add additional tags from similar patch Signed-off-by: Colin Ian King Fixes: 2545ac960364 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll") Addresses-Coverity: ("Uninitialized scalar variable") Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Thomas Zimmermann Cc: Sam Ravnborg Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20210817163204.494166-1-colin.king@canonical.com commit 808cfdfad57999c85f9ab13499a38d136d032232 Author: Linus Lüssing Date: Mon May 17 00:33:09 2021 +0200 batman-adv: bcast: remove remaining skb-copy calls We currently have two code paths for broadcast packets: A) self-generated, via batadv_interface_tx()-> batadv_send_bcast_packet(). B) received/forwarded, via batadv_recv_bcast_packet()-> batadv_forw_bcast_packet(). For A), self-generated broadcast packets: The only modifications to the skb data is the ethernet header which is added/pushed to the skb in batadv_send_broadcast_skb()->batadv_send_skb_packet(). However before doing so, batadv_skb_head_push() is called which calls skb_cow_head() to unshare the space for the to be pushed ethernet header. So for this case, it is safe to use skb clones. For B), received/forwarded packets: The same applies as in A) for the to be forwarded packets. Only the ethernet header is added. However after (queueing for) forwarding the packet in batadv_recv_bcast_packet()->batadv_forw_bcast_packet(), a packet is additionally decapsulated and is sent up the stack through batadv_recv_bcast_packet()->batadv_interface_rx(). Protocols higher up the stack are already required to check if the packet is shared and create a copy for further modifications. When the next (protocol) layer works correctly, it cannot happen that it tries to operate on the data behind the skb clone which is still queued up for forwarding. Co-authored-by: Sven Eckelmann Signed-off-by: Sven Eckelmann Signed-off-by: Linus Lüssing Signed-off-by: Simon Wunderlich commit eadcd6b5a1eb39866ab8d8a3e4f2e51bc51a2350 Author: Gao Xiang Date: Fri Aug 13 13:29:31 2021 +0800 erofs: add fiemap support with iomap This adds fiemap support for both uncompressed files and compressed files by using iomap infrastructure. Link: https://lore.kernel.org/r/20210813052931.203280-3-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit d95ae5e25326092d61613acf98280270dde22778 Author: Gao Xiang Date: Wed Aug 18 23:22:31 2021 +0800 erofs: add support for the full decompressed length Previously, there is no need to get the full decompressed length since EROFS supports partial decompression. However for some other cases such as fiemap, the full decompressed length is necessary for iomap to make it work properly. This patch adds a way to get the full decompressed length. Note that it takes more metadata overhead and it'd be avoided if possible in the performance sensitive scenario. Link: https://lore.kernel.org/r/20210818152231.243691-1-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 0284b52e85341e3cd4b70c8b2423fd23b8a003a8 Author: Thara Gopinath Date: Mon Aug 9 15:16:05 2021 -0400 dt-bindings: thermal: Add dt binding for QCOM LMh Add dt binding documentation to describe Qualcomm Limits Management Hardware node. Signed-off-by: Thara Gopinath Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210809191605.3742979-8-thara.gopinath@linaro.org commit d20b41115ad53293201cc07ee429a38740cb056b Author: Grant Seltzer Date: Wed Aug 18 11:13:13 2021 -0400 libbpf: Rename libbpf documentation index file This patch renames a documentation libbpf.rst to index.rst. In order for readthedocs.org to pick this file up and properly build the documentation site. It also changes the title type of the ABI subsection in the naming convention doc. This is so that readthedocs.org doesn't treat this section as a separate document. Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210818151313.49992-1-grantseltzer@gmail.com commit 2af0c5ffadaf9d13eca28409d4238b4e672942d3 Author: Nadezda Lutovinova Date: Wed Aug 18 17:12:47 2021 +0300 usb: gadget: mv_u3d: request_irq() after initializing UDC If IRQ occurs between calling request_irq() and mv_u3d_eps_init(), then null pointer dereference occurs since u3d->eps[] wasn't initialized yet but used in mv_u3d_nuke(). The patch puts registration of the interrupt handler after initializing of neccesery data. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers") Acked-by: Felipe Balbi Signed-off-by: Nadezda Lutovinova Link: https://lore.kernel.org/r/20210818141247.4794-1-lutovinova@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 39a2d3506b2d53c569a6db13d65b2f3728c4feec Author: Christoph Hellwig Date: Wed Jun 23 16:05:05 2021 +0200 dma-mapping: add a dma_init_global_coherent helper Add a new helper to initialize the global coherent pool. This both cleans up the existing initialization which indirects through the reserved_mem_ops that are normally only used for struct device, and also allows using the global pool for non-devicetree architectures. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit a6933571f34a9aee843fff2aa4b96949c57d6274 Author: Christoph Hellwig Date: Wed Jun 23 16:00:04 2021 +0200 dma-mapping: simplify dma_init_coherent_memory Return the allocated dma_coherent_mem structure, set the use_dma_pfn_offset and print the failure warning inside of dma_init_coherent_memory instead of leaving that to the callers. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit 70d6aa0ecfed253a2b14659a6c77359af6d9b3ee Author: Christoph Hellwig Date: Thu Jun 24 19:38:19 2021 +0200 dma-mapping: allow using the global coherent pool for !ARM Switch an ifdef so that the global coherent pool is initialized for any architecture that selects the DMA_GLOBAL_POOL symbol insted of hardcoding ARM. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit 31b089bbc15a53ca7c90c77ef51390d87f612088 Author: Christoph Hellwig Date: Wed Jun 23 14:04:48 2021 +0200 ARM/nommu: use the generic dma-direct code for non-coherent devices Select the right options to just use the generic dma-direct code instead of reimplementing it. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit faf4ef823ac5f3b6a34a73b76c52895dee3dce55 Author: Christoph Hellwig Date: Wed Jun 23 14:21:16 2021 +0200 dma-direct: add support for dma_coherent_default_memory Add an option to allocate uncached memory for dma_alloc_coherent from the global dma_coherent_default_memory. This will allow to move arm-nommu (and eventually other platforms) to use generic code for allocating uncached memory from a pre-populated pool. Note that this is a different pool from the one that platforms that can remap at runtime use for GFP_ATOMIC allocations for now, although there might be opportunities to eventually end up with a common codebase for the two use cases. Signed-off-by: Christoph Hellwig Tested-by: Dillon Min commit d07eeeb8745973389e1d772b3b654f5860441589 Merge: e37be5343ae2b 8ecd39cb61d9e Author: Mimi Zohar Date: Wed Aug 18 10:18:29 2021 -0400 Merge branch 'restrict-digest-alg-v8' into next-integrity Taken from the cover letter "IMA: restrict the accepted digest algorithms for the security.ima xattr": Provide users the ability to restrict the algorithms accepted by their system, both when writing/updating xattrs, and when appraising files, while retaining a permissive behavior by default to preserve backward compatibility. To provide these features, alter the behavior of setxattr to only accept hashes built in the kernel, instead of any hash listed in the kernel (complete list crypto/hash_info.c). In addition, the user can define in his IMA policy the list of digest algorithms allowed for writing to the security.ima xattr. In that case, only algorithms present in that list are accepted for writing. In addition, users may opt-in to allowlist hash algorithms for appraising thanks to the new 'appraise_algos' IMA policy option. By default IMA will keep accepting any hash algorithm, but specifying that option will make appraisal of files hashed with another algorithm fail. Link: https://lore.kernel.org/linux-integrity/20210816081056.24530-1-Simon.THOBY@viveris.fr/ commit bd1e336aa8535a99f339e2d66a611984262221ce Author: Heikki Krogerus Date: Tue Aug 17 13:24:49 2021 +0300 driver core: platform: Remove platform_device_add_properties() There are no more users for it. The last place where it's called is in platform_device_register_full(). Replacing that call with device_create_managed_software_node() and removing the function. Reviewed-by: Andy Shevchenko Reviewed-by: Thierry Reding Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20210817102449.39994-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6d6e03dbe5eff2044e0ae32acbf8b5dad6efb045 Author: Heikki Krogerus Date: Tue Aug 17 13:24:48 2021 +0300 ARM: tegra: paz00: Handle device properties with software node API The old device property API is going to be removed. Replacing the device_add_properties() call with the software node API equivalent, device_create_managed_software_node(). Reviewed-by: Andy Shevchenko Acked-by: Thierry Reding Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20210817102449.39994-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 88c1d2478ec8a420cf60a3c25503e37b34fea5aa Author: Fugang Duan Date: Tue Aug 17 18:02:03 2021 +0800 tty: serial: fsl_lpuart: check dma_tx_in_progress in tx dma callback There have a corner case that tx DMA .callback() is coming after .flush_buffer(), then .callback() should check dma_tx_in_progress flag and return in directly. Signed-off-by: Fugang Duan Signed-off-by: Vipul Kumar Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20210817100203.21300-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 09cbd1df7d2615c19e40facbe31fdcb5f1ebfa96 Author: Christophe JAILLET Date: Fri Aug 6 08:46:11 2021 +0200 firmware: raspberrypi: Fix a leak in 'rpi_firmware_get()' The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the normal and error handling paths. Fixes: 4e3d60656a72 ("ARM: bcm2835: Add the Raspberry Pi firmware driver") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/5e17e5409b934cd08bf6f9279c73be5c1cb11cce.1628232242.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 51ed00e71f0130e0f3534b8e7d78facd16829426 Author: Christophe Leroy Date: Wed Aug 18 08:47:28 2021 +0000 powerpc/32: Remove unneccessary calculations in load_up_{fpu/altivec} No need to re-read SPRN_THREAD, we can calculate thread address from current (r2). And remove a reload of value 1 into r4 as r4 is already 1. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c04cce578b97a76a9e69a096698b1d89f721768a.1629276437.git.christophe.leroy@csgroup.eu commit 0fbd7409446a8ee76ee701ec846ede917c6c89fa Merge: e694952772a7d b71377b3e1e08 Author: Arnd Bergmann Date: Wed Aug 18 15:35:44 2021 +0200 Merge tag 'ixp4xx-del-boardfiles-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/soc This deletes the following IXP4xx boardfiles: - NSLU2 - NAS100D - D-Link DSM-G600 - Omicron - Gateway WG302v2 - Arcom Vulcan - Avila - Intel reference designs - Coyote and IXDPG425 - GTW5715 - Freecom FSG-3 In each case except Omicron, the board has been replaced by a corresponding device tree and tested where someone volunteered: Marc Zyngier has tested Arcom Vulcan and Freecom FSG-3 and I have tested NSLU2 and Avila for example. All that were tested boot to prompt, some devices may need some more massage before working perfectly. We can just as well delete these board files because we are confident that we will fix them to a working state if people are able to test patches. I am holding back the following boards for now: - Gateway 7001 - because Zoltan is working on this board and needs more time. He might need to test things with the board file so let's allow him time for that. - Goramo MLR - the consensus is to replace this with a dry coded device tree, but the bindings for that tree need some more time to make so we keep the boardfile around until we can merge a complete device tree for it. After these two (target v5.16) we can delete the remaining board files and the old mach structure along with the old PCI driver. * tag 'ixp4xx-del-boardfiles-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: ixp4xx: Delete the Freecom FSG-3 boardfiles ARM: ixp4xx: Delete GTWX5715 board files ARM: ixp4xx: Delete Coyote and IXDPG425 boardfiles ARM: ixp4xx: Delete Intel reference design boardfiles ARM: ixp4xx: Delete Avila boardfiles ARM: ixp4xx: Delete the Arcom Vulcan boardfiles ARM: ixp4xx: Delete Gateway WG302v2 boardfiles ARM: ixp4xx: Delete Omicron boardfiles ARM: ixp4xx: Delete the D-Link DSM-G600 boardfiles ARM: ixp4xx: Delete NAS100D boardfiles ARM: ixp4xx: Delete NSLU2 boardfiles Link: https://lore.kernel.org/r/CACRpkdY=sPDkzmbmm+0UQnJi7BXZKH14GLmyVwKC+4cLCJpmdA@mail.gmail.com Signed-off-by: Arnd Bergmann commit 5c785014b67fb25d8e2a36d24940dad0c416a005 Merge: 63db5acb4adf3 e3d4571955050 Author: Arnd Bergmann Date: Wed Aug 18 15:33:01 2021 +0200 Merge tag 'qcom-drivers-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for v5.15 This fixes the "shared memory state machine" (SMSM) interrupt logic to avoid missing transitions happening while the interrupts are masked. SM6115 support is added to smd-rpm and rpmpd. The Qualcomm SCM firmware driver is once again made possible to compile and load as a kernel module. An out-of-bounds error related to the cooling devices of the AOSS driver is corrected. The binding is converted to YAML and a generic compatible is introduced to reduce the driver churn. The GENI wrapper gains a helper function used in I2C and SPI for switching the serial engine hardware to use the wrapper's DMA-engine. Lastly it contains a number of cleanups and smaller fixes for rpmhpd, socinfo, CPR, mdt_loader and the GENI DT binding. * tag 'qcom-drivers-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: soc: qcom: smsm: Fix missed interrupts if state changes while masked soc: qcom: smsm: Implement support for get_irqchip_state soc: qcom: mdt_loader: be more informative on errors dt-bindings: qcom: geni-se: document iommus soc: qcom: smd-rpm: Add SM6115 compatible soc: qcom: geni: Add support for gpi dma soc: qcom: geni: move GENI_IF_DISABLE_RO to common header PM: AVS: qcom-cpr: Use nvmem_cell_read_variable_le_u32() drivers: soc: qcom: rpmpd: Add SM6115 RPM Power Domains dt-bindings: power: rpmpd: Add SM6115 to rpmpd binding dt-bindings: soc: qcom: smd-rpm: Add SM6115 compatible soc: qcom: aoss: Fix the out of bound usage of cooling_devs firmware: qcom_scm: Allow qcom_scm driver to be loadable as a permenent module soc: qcom: socinfo: Don't print anything if nothing found soc: qcom: rpmhpd: Use corner in power_off soc: qcom: aoss: Add generic compatible dt-bindings: soc: qcom: aoss: Convert to YAML dt-bindings: soc: qcom: aoss: Add SC8180X and generic compatible firmware: qcom_scm: remove a duplicative condition firmware: qcom_scm: Mark string array const Link: https://lore.kernel.org/r/20210816214840.581244-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 1bc220835526ae076eecfb7ed513f80f22cf840d Author: Pavel Hofman Date: Tue Aug 17 12:05:55 2021 +0200 usb: gadget: f_uac1: fixing inconsistent indenting Fixing inconsistent indenting identified by kernel test robot. Signed-off-by: Pavel Hofman Acked-By: Felipe Balbi Link: https://lore.kernel.org/r/20210817100555.4437-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit e77939ee63a7faf5def34c97ee0137f234367459 Author: Lukas Bulwahn Date: Wed Aug 18 09:11:37 2021 +0200 usb: remove reference to deleted config STB03xxx Commit 7583b63c343c ("powerpc/40x: Remove STB03xxx") removes the config STB03xxx, but left a reference in ./drivers/usb/Kconfig behind. Hence, ./scripts/checkkconfigsymbols.py warns: STB03xxx Referencing files: drivers/usb/Kconfig Remove this reference to the deleted config. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210818071137.22711-4-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b445c99c756d771cb59840ca3ce46cb15c8b299 Author: Lukas Bulwahn Date: Wed Aug 18 09:11:36 2021 +0200 usb: host: remove line for obsolete config USB_HWA_HCD Commit 71ed79b0e4be ("USB: Move wusbcore and UWB to staging as it is obsolete") misses to adjust some part in ./drivers/usb/host/Makefile. Hence, ./scripts/checkkconfigsymbols.py warns: USB_HWA_HCD Referencing files: drivers/usb/Makefile Remove the missing piece of this code removal. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210818071137.22711-3-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit b2582996a74799c84fd19473c7b914565249b050 Author: Lukas Bulwahn Date: Wed Aug 18 09:11:35 2021 +0200 usb: host: remove dead EHCI support for on-chip PMC MSP71xx USB controller Commit 1b00767fd8e1 ("MIPS: Remove PMC MSP71xx platform") deletes ./arch/mips/pmcs-msp71xx/Kconfig, including its config MSP_HAS_USB. Hence, since then, the corresponding EHCI support for on-chip PMC MSP71xx USB controller is dead code. Remove this dead driver. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210818071137.22711-2-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 63db5acb4adf3a61c42b387c9c79799b86d25e7f Merge: c4361dee2e6cf 148bcca9ad048 Author: Arnd Bergmann Date: Wed Aug 18 15:31:45 2021 +0200 Merge tag 'renesas-drivers-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.15 (take two) - Prefer memcpy() over strcpy(). * tag 'renesas-drivers-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Prefer memcpy() over strcpy() Link: https://lore.kernel.org/r/cover.1628849625.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 843714bb37d9a3780160d7b4a4a72b8077a77589 Author: Jack Pham Date: Thu Aug 12 01:26:35 2021 -0700 usb: dwc3: Decouple USB 2.0 L1 & L2 events On DWC_usb3 revisions 3.00a and newer (including DWC_usb31 and DWC_usb32) the GUCTL1 register gained the DEV_DECOUPLE_L1L2_EVT field (bit 31) which when enabled allows the controller in device mode to treat USB 2.0 L1 LPM & L2 events separately. After commit d1d90dd27254 ("usb: dwc3: gadget: Enable suspend events") the controller will now receive events (and therefore interrupts) for every state change when entering/exiting either L1 or L2 states. Since L1 is handled entirely by the hardware and requires no software intervention, there is no need to even enable these events and unnecessarily notify the gadget driver. Enable the aforementioned bit to help reduce the overall interrupt count for these L1 events that don't need to be handled while retaining the events for full L2 suspend/wakeup. Tested-by: Jun Li Tested-by: Amit Pundir # for RB5 (sm8250) Tested-by: John Stultz # for HiKey960 & db845c Reviewed-by: Jun Li Acked-by: Felipe Balbi Signed-off-by: Jack Pham Link: https://lore.kernel.org/r/20210812082635.12924-1-jackp@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit ca27f5b593b5532f4b3a363daeba45872f381bb2 Merge: b1a811633f732 9891668e43c8e Author: Jens Axboe Date: Wed Aug 18 07:28:19 2021 -0600 Merge tag 'nvme-5.15-2021-08-18' of git://git.infradead.org/nvme into for-5.15/drivers Pull NVMe updates from Christoph: "nvme updates for Linux 5.15. - suspend improvements for devices with an HMB (Keith Busch) - handle double completions more gacefull (Sagi Grimberg) - cleanup the selects for the nvme core code a bit (Sagi Grimberg) - don't update queue count when failing to set io queues (Ruozhu Li) - various nvmet connect fixes (Amit Engel) - cleanup lightnvm leftovers (Keith Busch, me) - small cleanups (Colin Ian King, Hou Pu) - add tracing for the Set Features command (Hou Pu) - CMB sysfs cleanups (Keith Busch) - add a mutex_destroy call (Keith Busch)" * tag 'nvme-5.15-2021-08-18' of git://git.infradead.org/nvme: (21 commits) nvme: remove the unused NVME_NS_* enum nvme: remove nvm_ndev from ns nvme: Have NVME_FABRICS select NVME_CORE instead of transport drivers nvmet: check that host sqsize does not exceed ctrl MQES nvmet: avoid duplicate qid in connect cmd nvmet: pass back cntlid on successful completion nvme-rdma: don't update queue count when failing to set io queues nvme-tcp: don't update queue count when failing to set io queues nvme-tcp: pair send_mutex init with destroy nvme: allow user toggling hmb usage nvme-pci: disable hmb on idle suspend nvmet: remove redundant assignments of variable status nvmet: add set feature tracing support nvme: add set feature tracing support nvme-fabrics: remove superfluous nvmf_host_put in nvmf_parse_options nvme-pci: cmb sysfs: one file, one value nvme-pci: use attribute group for cmb sysfs nvme: code command_id with a genctr for use-after-free validation nvme-tcp: don't check blk_mq_tag_to_rq when receiving pdu data nvme-pci: limit maximum queue depth to 4095 ... commit c4361dee2e6cffa32122e06c9df0a9c2e5c4dd51 Merge: 8745d0e9155f0 59c6fceb2ecc3 Author: Arnd Bergmann Date: Wed Aug 18 15:23:38 2021 +0200 Merge tag 'tegra-for-5.15-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: Changes for v5.15-rc1 Implements runtime PM support for the FUSE block and prepares the driver to work better in conjunction with the CPUIDLE driver. * tag 'tegra-for-5.15-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: fuse: Enable fuse clock on suspend for Tegra124 soc/tegra: fuse: Add runtime PM support soc/tegra: fuse: Clear fuse->clk on driver probe failure soc/tegra: pmc: Prevent racing with cpuilde driver soc/tegra: bpmp: Remove unused including Link: https://lore.kernel.org/r/20210813162157.2820913-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit e70344c05995a190a56bbd1a23dc2218bcc8c924 Author: Damien Le Moal Date: Wed Aug 11 12:37:02 2021 +0900 block: fix default IO priority handling The default IO priority is the best effort (BE) class with the normal priority level IOPRIO_NORM (4). However, get_task_ioprio() returns IOPRIO_CLASS_NONE/IOPRIO_NORM as the default priority and get_current_ioprio() returns IOPRIO_CLASS_NONE/0. Let's be consistent with the defined default and have both of these functions return the default priority IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM) when the user did not define another default IO priority for the task. In include/uapi/linux/ioprio.h, introduce the IOPRIO_BE_NORM macro as an alias to IOPRIO_NORM to clarify that this default level applies to the BE priotity class. In include/linux/ioprio.h, define the macro IOPRIO_DEFAULT as IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NORM) and use this new macro when setting a priority to the default. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210811033702.368488-7-damien.lemoal@wdc.com [axboe: drop unnecessary lightnvm change] Signed-off-by: Jens Axboe commit 8745d0e9155f0ef13656ab3447f71a8b53556842 Merge: 1bb24be00c8c3 dd00d75007d27 Author: Arnd Bergmann Date: Wed Aug 18 15:22:37 2021 +0200 Merge tag 'tegra-for-5.15-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers firmware: tegra: Changes for v5.15-rc1 This contains a single fix to stop a slight abuse of the seq_buf API. * tag 'tegra-for-5.15-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Stop using seq_get_buf() Link: https://lore.kernel.org/r/20210813162157.2820913-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 202bc942c5cd4340d37b06c4e0b8b03f9925d818 Author: Damien Le Moal Date: Wed Aug 11 12:37:01 2021 +0900 block: Introduce IOPRIO_NR_LEVELS The BFQ scheduler and ioprio_check_cap() both assume that the RT priority class (IOPRIO_CLASS_RT) can have up to 8 different priority levels, similarly to the BE class (IOPRIO_CLASS_iBE). This is controlled using the IOPRIO_BE_NR macro , which is badly named as the number of levels also applies to the RT class. Introduce the class independent IOPRIO_NR_LEVELS macro, defined to 8, to make things clear. Keep the old IOPRIO_BE_NR macro definition as an alias for IOPRIO_NR_LEVELS. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210811033702.368488-6-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit ba05200fcce0a73fa8db16c514fbaa476d1d9399 Author: Damien Le Moal Date: Wed Aug 11 12:37:00 2021 +0900 block: fix IOPRIO_PRIO_CLASS() and IOPRIO_PRIO_VALUE() macros The ki_ioprio field of struct kiocb is 16-bits (u16) but often handled as an int in the block layer. E.g. ioprio_check_cap() takes an int as argument. With such implicit int casting function calls, the upper 16-bits of the int argument may be left uninitialized by the compiler, resulting in invalid values for the IOPRIO_PRIO_CLASS() macro (garbage upper bits) and in an error return for functions such as ioprio_check_cap(). Fix this by masking the result of the shift by IOPRIO_CLASS_SHIFT bits in the IOPRIO_PRIO_CLASS() macro. The new macro IOPRIO_CLASS_MASK defines the 3-bits mask for the priority class. Similarly, apply the IOPRIO_PRIO_MASK mask to the data argument of the IOPRIO_PRIO_VALUE() macro to ignore the upper bits of the data value. The IOPRIO_CLASS_MASK mask is also applied to the class argument of this macro before shifting the result by IOPRIO_CLASS_SHIFT bits. While at it, also change the argument name of the IOPRIO_PRIO_CLASS() and IOPRIO_PRIO_DATA() macros from "mask" to "ioprio" to reflect the fact that a priority value should be passed rather than a mask. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210811033702.368488-5-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit a553a835ca57668b0d9907d8ec2507ec51292d9a Author: Damien Le Moal Date: Wed Aug 11 12:36:59 2021 +0900 block: change ioprio_valid() to an inline function Change the ioprio_valid() macro in include/usapi/linux/ioprio.h to an inline function declared on the kernel side in include/linux/ioprio.h. Also improve checks on the class value by checking the upper bound value. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210811033702.368488-4-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 25bca50e523cbe96c0207fbb92f22ff2bc28e9aa Author: Damien Le Moal Date: Wed Aug 11 12:36:58 2021 +0900 block: improve ioprio class description comment In include/usapi/linux/ioprio.h, change the ioprio class enum comment to remove the outdated reference to CFQ and mention BFQ and mq-deadline instead. Also document the high priority NCQ command use for RT class IOs directed at ATA drives that support NCQ priority. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210811033702.368488-3-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit a680dd72ec336b81511e3bff48efac6dbfa563e7 Author: Damien Le Moal Date: Wed Aug 11 12:36:57 2021 +0900 block: bfq: fix bfq_set_next_ioprio_data() For a request that has a priority level equal to or larger than IOPRIO_BE_NR, bfq_set_next_ioprio_data() prints a critical warning but defaults to setting the request new_ioprio field to IOPRIO_BE_NR. This is not consistent with the warning and the allowed values for priority levels. Fix this by setting the request new_ioprio field to IOPRIO_BE_NR - 1, the lowest priority level allowed. Cc: Fixes: aee69d78dec0 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler") Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210811033702.368488-2-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit f5975d18d46ae8485bb08161086e59360844840b Author: Damien Le Moal Date: Mon Aug 16 10:44:56 2021 +0900 docs: sysfs-block-device: document ncq_prio_supported Add documentation for the new device attribute file ncq_prio_supported, and its SAS HBA equivalent sas_ncq_prio_supported. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-12-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 5b8a2345e64b7c9ad00d1bd2d5081d14c574d989 Author: Niklas Cassel Date: Mon Aug 16 10:44:55 2021 +0900 docs: sysfs-block-device: improve ncq_prio_enable documentation NCQ priority is an optional feature of the NCQ feature set and should not be confused with the NCQ feature set itself. Clarify the description of the ncq_prio_enable attribute to avoid this confusion. Also add the missing documentation for the equivalent sas_ncq_prio_enable attribute. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-11-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 5f91b8f54874300a8e3c6c89f39ce5a74a449f2c Author: Damien Le Moal Date: Mon Aug 16 10:44:54 2021 +0900 libata: Introduce ncq_prio_supported sysfs sttribute Currently, the only way a user can determine if a SATA device supports NCQ priority is to try to enable the use of this feature using the ncq_prio_enable sysfs device attribute. If enabling the feature fails, it is because the device does not support NCQ priority. Otherwise, the feature is enabled and success indicates that the device supports NCQ priority. Improve this odd interface by introducing the read-only ncq_prio_supported sysfs device attribute to indicate if a SATA device supports NCQ priority. The value of this attribute reflects the status of device flag ATA_DFLAG_NCQ_PRIO, which is set only for devices supporting NCQ priority. Add this new sysfs attribute to the device attributes group of libahci and libata-sata. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210816014456.2191776-10-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit d633b8a702ab2eb4ef9263f1ab1610bb8cdf71a5 Author: Damien Le Moal Date: Mon Aug 16 10:44:53 2021 +0900 libata: print feature list on device scan Print a list of features supported by a drive when it is configured in ata_dev_configure() using the new function ata_dev_print_features(). The features printed are not already advertized and are: trusted send-recev support, device attention support, device sleep support, NCQ send-recv support and NCQ priority support. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-9-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit fc5c8aa7bc4977205e0ceb93425075f8a8f49501 Author: Damien Le Moal Date: Mon Aug 16 10:44:52 2021 +0900 libata: fix ata_read_log_page() warning Support for the READ LOG PAGE DMA EXT command is indicated by words 119 and 120 of a device identify data. This is tested in ata_read_log_page() with ata_id_has_read_log_dma_ext() and the READ LOG PAGE DMA command used if the device reports supports for it. However, some devices lie about this support and using the DMA version of the command fails, generating the warning message "READ LOG DMA EXT failed, trying PIO". Since READ LOG PAGE DMA EXT is an optional command, this warning is not at all important but may be scary for the user. Change ata_read_log_page() to suppres this warning and to print an error message if both DMA and PIO attempts failed. With this change, there is no need to print again an error message when ata_read_log_page() returns an error. So simplify the users of this function. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-8-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 2360fa1812cd77e1de13d3cca789fbd23462b651 Author: Damien Le Moal Date: Mon Aug 16 10:44:51 2021 +0900 libata: cleanup NCQ priority handling The ata device flag ATA_DFLAG_NCQ_PRIO indicates if a device supports the NCQ Priority feature while the ATA_DFLAG_NCQ_PRIO_ENABLE device flag indicates if the feature is enabled. Enabling NCQ priority use is controlled by the user through the device sysfs attribute ncq_prio_enable. As a result, the ATA_DFLAG_NCQ_PRIO flag should not be cleared when ATA_DFLAG_NCQ_PRIO_ENABLE is not set as the device still supports the feature even after the user disables it. This leads to the following cleanups: - In ata_build_rw_tf(), set a command high priority bit based on the ATA_DFLAG_NCQ_PRIO_ENABLE flag, not on the ATA_DFLAG_NCQ flag. That is, set a command high priority only if the user enabled NCQ priority use. - In ata_dev_config_ncq_prio(), ATA_DFLAG_NCQ_PRIO should not be cleared if ATA_DFLAG_NCQ_PRIO_ENABLE is not set. If the device does not support NCQ priority, both ATA_DFLAG_NCQ_PRIO and ATA_DFLAG_NCQ_PRIO_ENABLE must be cleared. With the above ata_dev_config_ncq_prio() change, ATA_DFLAG_NCQ_PRIO flag is set on device scan and revalidation. There is no need to trigger a device revalidation in ata_ncq_prio_enable_store() when the user enables the use of NCQ priority. Remove the revalidation code from that funciton to simplify it. Also change the return value from -EIO to -EINVAL when a user tries to enable NCQ priority for a device that does not support this feature. While at it, also simplify ata_ncq_prio_enable_show(). Overall, there is no functional change introduced by this patch. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-7-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 891fd7c61952ed3fddb82a3b00ae4b3edfce8733 Author: Damien Le Moal Date: Mon Aug 16 10:44:50 2021 +0900 libata: cleanup ata_dev_configure() Introduce the helper functions ata_dev_config_lba() and ata_dev_config_chs() to configure the addressing capabilities of a device. To control message printing in these new helpers, as well as in ata_dev_configure() and in ata_hpa_resize(), add the helper function ata_dev_print_info() to avoid open coding for the eh context ATA_EHI_PRINTINFO flag in multiple functions. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-6-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit d8d8778c24cc4689250b59c426489a360032d912 Author: Damien Le Moal Date: Mon Aug 16 10:44:49 2021 +0900 libata: cleanup device sleep capability detection Move the code to retrieve the device sleep capability and timings out of ata_dev_configure() into the helper function ata_dev_config_devslp(). While at it, mark the device as supporting the device sleep capability only if the sata settings page was retrieved successfully to ensure that the timing information is correctly initialized. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-5-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 56b4f06c55add95fe508a1746d9173bade6388bf Author: Damien Le Moal Date: Mon Aug 16 10:44:48 2021 +0900 libata: simplify ata_scsi_rbuf_fill() Sparse complains about context imbalance in ata_scsi_rbuf_get() and ata_scsi_rbuf_put() due to these functions respectively only taking and releasing the ata_scsi_rbuf_lock spinlock. Since these functions are only called from ata_scsi_rbuf_fill() with ata_scsi_rbuf_get() being called with a copy_in argument always false, the code can be simplified and ata_scsi_rbuf_{get|put} removed. This change both simplifies the code and fixes the sparse warning. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-4-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 355a8031dc174450ccad2a61c513ad7222d87a97 Author: Damien Le Moal Date: Mon Aug 16 10:44:47 2021 +0900 libata: fix ata_host_start() The loop on entry of ata_host_start() may not initialize host->ops to a non NULL value. The test on the host_stop field of host->ops must then be preceded by a check that host->ops is not NULL. Reported-by: kernel test robot Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 02cea7039ad52593ee05824c19233366914df9b2 Author: Yang Yingliang Date: Tue Aug 10 22:22:30 2021 +0800 spi: tegra20-slink: remove spi_master_put() in tegra_slink_remove() spi_master_put() is already called in spi_unregister_master(), or it will lead a double decrement refcount. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210810142230.2220453-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c049742fbc71129c481a6d5e52392b9aa482cc9e Author: Matti Vaittinen Date: Wed Aug 18 07:18:19 2021 +0300 regulator: Minor regulator documentation fixes. The newly added regulator ramp-delay specifiers in regulator desc lacked the documentation. Add some. Also fix a typo. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20210818041513.GA2408290@dc7vkhyh15000m40t6jht-3.rev.dnainternet.fi Signed-off-by: Mark Brown commit 2fbbcffea5b6adbfe90ffc842a6b3eb2d7e381ed Author: Shengjiu Wang Date: Wed Aug 18 14:03:34 2021 +0800 ASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocks The devm_clk_get() may return -EPROBE_DEFER, then clocks will be assigned to NULL wrongly. As the clocks are optional so we can use devm_clk_get_optional() instead of devm_clk_get(). Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1629266614-6942-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit c4d3928250de919a1d324f6c8a7f26f51af40fd2 Merge: 911f0faf48581 514ef1e62d652 Author: Arnd Bergmann Date: Wed Aug 18 14:47:31 2021 +0200 Merge tag 'mvebu-dt64-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt64 for 5.15 (part 1) - DTS updates for Marvell Armada CN913x platforms + Add support for Armada CN913x Development Board topology "B" + Add support for Armada CN913x Reference Design boards (CRB) + Fixes the NAND partitioning scheme in DTS eliminating gap between consecutive partitions + Fix 10Gb ports PHY mode names - Extend PCIe MEM space on Armada 37xx: useful for some combination of PCIe cards where the initial 16MB was not enough * tag 'mvebu-dt64-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: armada-37xx: Extend PCIe MEM space arch/arm64: dts: change 10gbase-kr to 10gbase-r in Armada arm64: dts: add support for Marvell cn9130-crb platform dts: marvell: Enable 10G interfaces on 9130-DB and 9131-DB boards arm64: dts: cn913x: add device trees for topology B boards Link: https://lore.kernel.org/r/878s10ypxe.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 911f0faf485817a1e70bcaad8121201ef0f30ae2 Merge: 4b2784473108f 2dc30eb9241c2 Author: Arnd Bergmann Date: Wed Aug 18 14:46:46 2021 +0200 Merge tag 'hisi-arm64-dt-for-5.15' of git://github.com/hisilicon/linux-hisi into arm/dt ARM64: DT: HiSilicon ARM64 DT updates for 5.15 - Address a PCI bus range warning of the hi3660 SoC * tag 'hisi-arm64-dt-for-5.15' of git://github.com/hisilicon/linux-hisi: arm64: dts: HiSilicon: hi3660: address a PCI warning Link: https://lore.kernel.org/r/611B9BE9.8050904@hisilicon.com Signed-off-by: Arnd Bergmann commit 4b2784473108ffaac1ab78a2de928931693e47fe Merge: c872138c2c716 9d3ef21dca2c8 Author: Arnd Bergmann Date: Wed Aug 18 14:45:59 2021 +0200 Merge tag 'sunxi-dt-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/dt Our usual round of DT patches for the 5.15 merge window, with some Tanix TX6 improvements this time. * tag 'sunxi-dt-for-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h6: tanix-tx6: enable emmc arm64: dts: allwinner: h6: tanix-tx6: Add PIO power supplies arm64: dts: allwinner: h6: tanix-tx6: Fix regulator node names Link: https://lore.kernel.org/r/39cd7be5-a9a7-42b6-bc29-f895b9a3448a.lettre@localhost Signed-off-by: Arnd Bergmann commit c872138c2c7166dc95c778f4decc165bace9cb33 Merge: a0f480dc6546b 6b8b31269898b Author: Arnd Bergmann Date: Wed Aug 18 14:44:40 2021 +0200 Merge tag 'aspeed-5.15-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/dt ASPEED device tree updates for 5.15 - New machines * Facebook's Cloudripper * Facebook's Elbert * Facebook's Fuji All three carry the description of "Facebook's next generation switch platform with an AST2600 BMC integrated for health monitoring purpose." They share a 128 MB SPI NOR flash layout that is also used by some older platforms. * Inspur's NF5280M6, an x86 platform server with an AST2500-based BMC - SGPIO updates including AST2600 support - GPIO descriptions for the IBM AST2600 machines - Pinctrl fix - Updates to Facebook's AST2500 based machines * tag 'aspeed-5.15-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: (23 commits) ARM: dts: aspeed: p10bmc: Add power control pins ARM: dts: aspeed: cloudripper: Add comments for "mdio1" ARM: dts: aspeed: minipack: Update flash partition table ARM: dts: aspeed: Add Facebook Fuji (AST2600) BMC ARM: dts: aspeed: Add Facebook Elbert (AST2600) BMC ARM: dts: aspeed: Add Facebook Cloudripper (AST2600) BMC ARM: dts: aspeed: Common dtsi for Facebook AST2600 Network BMCs ARM: dts: aspeed: wedge400: Use common flash layout ARM: dts: Add Facebook BMC 128MB flash layout ARM: dts: aspeed-g5: Remove ngpios from sgpio node. ARM: dts: aspeed-g6: Add SGPIO node. dt-bindings: aspeed-sgpio: Add ast2600 sgpio dt-bindings: aspeed-sgpio: Convert txt bindings to yaml. ARM: dts: aspeed: ast2500evb: Enable built in RTC ARM: dts: aspeed: tacoma: Add TPM reset GPIO ARM: dts: rainier, everest: Add TPM reset GPIO ARM: dts: aspeed: wedge100: Enable ADC channels ARM: dts: aspeed: galaxy100: Remove redundant ADC device ARM: dts: aspeed: wedge40: Remove redundant ADC device ARM: dts: aspeed: Enable ADC in Facebook AST2400 common dtsi ... Link: https://lore.kernel.org/r/CACPK8XdWRBb9cuDWGQPfK8R8TsZuydJQHsL4_e2w=HvCKAMogg@mail.gmail.com Signed-off-by: Arnd Bergmann commit a0f480dc6546b9d97027bf7bc8145aad48ddad00 Merge: 4d314179d62b1 198b8c8ede36d Author: Arnd Bergmann Date: Wed Aug 18 14:37:16 2021 +0200 Merge tag 'qcom-arm64-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM64 updates for v5.15 SDM660 and SDM630 was concluded to be similar enough that they should be merged, and the derivative SDM636 was added to the bunch. The combined platform gained support for GPU, DMA, I2C, IMEM, display, power-domains, SDHCI, thermal, USB, interconnects, VADC, WLED and audio remoteproc. The Sony Xperia "Ganges" platform was similarly merged with "Nile", got cleaned up and gained touchscreen, USB, volume keys and uSD support. IPQ6018 gains USB2 and PCIe support and a few minor fixes. IPQ8074 gains SCM, PRNG and Crypto support and a DT style update of the PCIe nodes. MSM8916 gains Coresight STM support. The Xiaomi Redmi 2 is introduced, with touchscreen, notification LED and IMU support. MSM8996 gains support for GPU cooling and v3.0 of the SoC, which is used to introduce support for the Sony Xperia X Performance, XZ and XZs phones. SC7180 finally gains DisplayPort support and LPASS is updated accordingly. A number of fixes are introduced and with the newly introduced DRM aux bus in place Trogdor's panel is moved under the eDP bridge. SC7280 gained USB, eMMC, SD-card, QFPROM and IPA support, the new IDP2 board was added. SM6126 (aka Snapdragon 665) was introduced, together with the Sony Xperia 10II phone with support for framebuffer, USB, eMMC and volume keys. SM8150 gained inline crypto support for UFS enabled, CPU opp-tables was introduced to scale DDR and L3 frequencies and SPI nodes where added, in addition to a number of smaller fixes. SM8250 gained a number of minor fixes and had its serial engines wired up to use the GENI wrappers' DMA engines. SM8350 had wakeup-parent defined for the TLMM gpio node and I2C13 was introduced. SDM845 display clocks was corrected and Lenovo Yoga C630 got IPA enabled and now has working LTE connectivity. Additionally a number of minor fixes throughout to correct DT validation warnings. Lastly v5.14-rc3 is merge in to resolve the merge conflicts caused by the USB maintainer deciding to fix a regression in his tree. * tag 'qcom-arm64-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (114 commits) arm64: dts: qcom: sm8250: assign DSI clock source parents arm64: dts: qcom: sdm845-mtp: assign DSI clock source parents arm64: dts: qcom: sdm845: assign DSI clock source parents arm64: dts: qcom: sc7180: assign DSI clock source parents arm64: dts: qcom: sc7280-idp: Add device tree files for IDP2 dt-bindings: arm: qcom: Document qcom,sc7280-idp2 board arm64: dts: qcom: sm8350: fix IPA interconnects arm64: dts: qcom: sc7180: define ipa_fw_mem node arm64: dts: qcom: sc7280: enable IPA for sc7280-idp arm64: dts: qcom: sc7280: add IPA information arm64: dts: qcom: sc7180-trogdor: Move panel under the bridge chip arm64: dts: qcom: ipq8074: add PRNG node arm64: dts: qcom: ipq8074: add crypto nodes arm64: dts: qcom: sm8350: add qupv3_id_1/i2c13 nodes arm64: dts: qcom: ipq6018: Add pcie support arm64: dts: qcom: pm8150b: Add DTS node for PMIC VBUS booster arm64: dts: qcom: sm8150: add SPI nodes arm64: dts: qcom: msm8916: Enable CoreSight STM component arm64: dts: qcom: sc7280: Add qfprom node arm64: dts: qcom: sc7280: Fixup the cpufreq node ... Link: https://lore.kernel.org/r/20210816231223.586597-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit af1d321c2e99f9d48d1b680ad0260a243bc7d40f Merge: ff1176468d368 fac956710ab08 Author: Joerg Roedel Date: Wed Aug 18 13:30:35 2021 +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.15 - SMMUv3 * Minor optimisation to avoid zeroing struct members on CMD submission * Increased use of batched commands to reduce submission latency * Refactoring in preparation for ECMDQ support - SMMUv2 * Fix races when probing devices with identical StreamIDs * Optimise walk cache flushing for Qualcomm implementations * Allow deep sleep states for some Qualcomm SoCs with shared clocks commit 452e69b58c2889e5546edb92d9e66285410f7463 Author: Robin Murphy Date: Wed Aug 11 13:21:38 2021 +0100 iommu: Allow enabling non-strict mode dynamically Allocating and enabling a flush queue is in fact something we can reasonably do while a DMA domain is active, without having to rebuild it from scratch. Thus we can allow a strict -> non-strict transition from sysfs without requiring to unbind the device's driver, which is of particular interest to users who want to make selective relaxations to critical devices like the one serving their root filesystem. Disabling and draining a queue also seems technically possible to achieve without rebuilding the whole domain, but would certainly be more involved. Furthermore there's not such a clear use-case for tightening up security *after* the device may already have done whatever it is that you don't trust it not to do, so we only consider the relaxation case. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d652966348c78457c38bf18daf369272a4ebc2c9.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit e96763ec42ceb7fc4f1e80b8647bc3ef53b5d286 Author: Robin Murphy Date: Wed Aug 11 13:21:37 2021 +0100 iommu: Merge strictness and domain type configs To parallel the sysfs behaviour, merge the new build-time option for DMA domain strictness into the default domain type choice. Suggested-by: Joerg Roedel Reviewed-by: Lu Baolu Reviewed-by: Jean-Philippe Brucker Reviewed-by: John Garry Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d04af35b9c0f2a1d39605d7a9b451f5e1f0c7736.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 7cf8a638678c89e9ff62520c5f90c4919b3b2af7 Author: Robin Murphy Date: Wed Aug 11 13:21:36 2021 +0100 iommu: Only log strictness for DMA domains When passthrough is enabled, the default strictness policy becomes irrelevant, since any subsequent runtime override to a DMA domain type now embodies an explicit choice of strictness as well. Save on noise by only logging the default policy when it is meaningfully in effect. Reviewed-by: John Garry Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9d2bcba880c6d517d0751ed8bd4960853030b4d7.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 26225bea1d84b090b378838a1797daec62d4ad0e Author: Robin Murphy Date: Wed Aug 11 13:21:35 2021 +0100 iommu: Expose DMA domain strictness via sysfs The sysfs interface for default domain types exists primarily so users can choose the performance/security tradeoff relevant to their own workload. As such, the choice between the policies for DMA domains fits perfectly as an additional point on that scale - downgrading a particular device from a strict default to non-strict may be enough to let it reach the desired level of performance, while still retaining more peace of mind than with a wide-open identity domain. Now that we've abstracted non-strict mode as a distinct type of DMA domain, allow it to be chosen through the user interface as well. Reviewed-by: Lu Baolu Reviewed-by: John Garry Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/0e08da5ed4069fd3473cfbadda758ca983becdbf.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit c208916fe6c7b84e3ec95cd91853039596eeb2cf Author: Robin Murphy Date: Wed Aug 11 13:21:34 2021 +0100 iommu: Express DMA strictness via the domain type Eliminate the iommu_get_dma_strict() indirection and pipe the information through the domain type from the beginning. Besides the flow simplification this also has several nice side-effects: - Automatically implies strict mode for untrusted devices by virtue of their IOMMU_DOMAIN_DMA override. - Ensures that we only end up using flush queues for drivers which are aware of them and can actually benefit. - Allows us to handle flush queue init failure by falling back to strict mode instead of leaving it to possibly blow up later. Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/47083d69155577f1367877b1594921948c366eb3.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 78ca078459d779319a22a8e2a18fc491da8a229b Author: Robin Murphy Date: Wed Aug 11 13:21:33 2021 +0100 iommu/vt-d: Prepare for multiple DMA domain types In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type, and test the specific feature flag where we want to identify DMA domains in general. The DMA ops reset/setup can simply be made unconditional, since iommu-dma already knows only to touch DMA domains. Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/31a8ef868d593a2f3826a6a120edee81815375a7.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit f9afa313ad0ebbdcf0f01c0453022be6ef2e9c1c Author: Robin Murphy Date: Wed Aug 11 13:21:32 2021 +0100 iommu/arm-smmu: Prepare for multiple DMA domain types In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/8f217ef285bd0bb9456c27ef622d2efdbbca1ad8.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 6d596039392bac2a0160fb71300d314943411e2a Author: Robin Murphy Date: Wed Aug 11 13:21:31 2021 +0100 iommu/amd: Prepare for multiple DMA domain types The DMA ops reset/setup can simply be unconditional, since iommu-dma already knows only to touch DMA domains. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/6450b4f39a5a086d505297b4a53ff1e4a7a0fe7c.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit bf3aed4660c6e3c44c69f07d8927ee5a22a952ac Author: Robin Murphy Date: Wed Aug 11 13:21:30 2021 +0100 iommu: Introduce explicit type for non-strict DMA domains Promote the difference between strict and non-strict DMA domains from an internal detail to a distinct domain feature and type, to pave the road for exposing it through the sysfs default domain interface. Reviewed-by: Lu Baolu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/08cd2afaf6b63c58ad49acec3517c9b32c2bb946.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit a8e5f04458c4e496eada2b029ce96713bb6c388d Author: Robin Murphy Date: Wed Aug 11 13:21:29 2021 +0100 iommu/io-pgtable: Remove non-strict quirk IO_PGTABLE_QUIRK_NON_STRICT was never a very comfortable fit, since it's not a quirk of the pagetable format itself. Now that we have a more appropriate way to convey non-strict unmaps, though, this last of the non-quirk quirks can also go, and with the flush queue code also now enforcing its own ordering we can have a lovely cleanup all round. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/155b5c621cd8936472e273a8b07a182f62c6c20d.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 7a7c5badf85806eab75e31ab8d45021f1545b0e3 Author: Robin Murphy Date: Wed Aug 11 13:21:28 2021 +0100 iommu: Indicate queued flushes via gather data Since iommu_iotlb_gather exists to help drivers optimise flushing for a given unmap request, it is also the logical place to indicate whether the unmap is strict or not, and thus help them further optimise for whether to expect a sync or a flush_all subsequently. As part of that, it also seems fair to make the flush queue code take responsibility for enforcing the really subtle ordering requirement it brings, so that we don't need to worry about forgetting that if new drivers want to add flush queue support, and can consolidate the existing versions. While we're adding to the kerneldoc, also fill in some info for @freelist which was overlooked previously. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/bf5f8e2ad84e48c712ccbf80fa8c610594c7595f.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 8d971243a9a7d73a410450951a21f298f1394dc7 Author: Robin Murphy Date: Wed Aug 11 13:21:27 2021 +0100 iommu/dma: Remove redundant "!dev" checks iommu_dma_init_domain() is now only called from iommu_setup_dma_ops(), which has already assumed dev to be non-NULL. Reviewed-by: John Garry Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/06024523c080364390016550065e3cfe8031367e.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ca84ed7f724cf9f9620a607756482e297c2d8fea Author: Robin Murphy Date: Wed Aug 11 13:21:25 2021 +0100 iommu/virtio: Drop IOVA cookie management The core code bakes its own cookies now. Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/f05cd2d0a0f414de3180e2536c7656faf1e52418.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit aa6546423a5678c79e00599d147153230e71abea Author: Robin Murphy Date: Wed Aug 11 13:21:24 2021 +0100 iommu/sun50i: Drop IOVA cookie management The core code bakes its own cookies now. CC: Maxime Ripard Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/147edb0ba59be563df19cec3e63e621aa65b7b68.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 5ad5f667147848037f2e697f065816c47310d4f9 Author: Robin Murphy Date: Wed Aug 11 13:21:23 2021 +0100 iommu/sprd: Drop IOVA cookie management The core code bakes its own cookies now. Acked-by: Chunyan Zhang Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/4e7fc6e523cb4b63fb13f5be10041eb24c0dcb1e.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit b811a451519036e54d1af10e695c9b2ff014fcc3 Author: Robin Murphy Date: Wed Aug 11 13:21:22 2021 +0100 iommu/rockchip: Drop IOVA cookie management The core code bakes its own cookies now. Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/aff51e2da1e431987ae5fdafa62a6a7c4bd042dc.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit a88a42be04db17d07eaca9a88e894a3c28443262 Author: Robin Murphy Date: Wed Aug 11 13:21:21 2021 +0100 iommu/mtk: Drop IOVA cookie management The core code bakes its own cookies now. CC: Yong Wu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b856648e7ee2b1017e7c7c02e2ddd50eaf72cbf7.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 5d8941824e4042728c4f64ebde0f7791742ff571 Author: Robin Murphy Date: Wed Aug 11 13:21:20 2021 +0100 iommu/ipmmu-vmsa: Drop IOVA cookie management The core code bakes its own cookies now. Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/dc5513293942d81f84edf61b354b236e5ac51dc2.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 4a376d4ac189ea097524eb53b3137c46a0dcc2d4 Author: Robin Murphy Date: Wed Aug 11 13:21:19 2021 +0100 iommu/exynos: Drop IOVA cookie management The core code bakes its own cookies now. Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/12d88cbf44e57faa4f0512760e7ed3a9cba05ca8.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit f297e27f831705de50811d933a394969602e8564 Author: Robin Murphy Date: Wed Aug 11 13:21:18 2021 +0100 iommu/vt-d: Drop IOVA cookie management The core code bakes its own cookies now. Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e9dbe3b6108f8538e17e0c5f59f8feeb714f51a4.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 229496a0eb088b34849fcc3ab25f0f9e3f90794a Author: Robin Murphy Date: Wed Aug 11 13:21:17 2021 +0100 iommu/arm-smmu: Drop IOVA cookie management The core code bakes its own cookies now. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/7ae3680dad9735cc69c3618866666896bd11e031.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 3f166dae1ab54872d02d910148388c6a17b43f46 Author: Robin Murphy Date: Wed Aug 11 13:21:16 2021 +0100 iommu/amd: Drop IOVA cookie management The core code bakes its own cookies now. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/648e74e7422caa6a7db7fb0c36813c7bd2007af8.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 46983fcd67ac5a830d41ebe3755314db67a6dd16 Author: Robin Murphy Date: Wed Aug 11 13:21:15 2021 +0100 iommu: Pull IOVA cookie management into the core Now that everyone has converged on iommu-dma for IOMMU_DOMAIN_DMA support, we can abandon the notion of drivers being responsible for the cookie type, and consolidate all the management into the core code. CC: Yong Wu CC: Chunyan Zhang CC: Maxime Ripard Tested-by: Heiko Stuebner Tested-by: Marek Szyprowski Tested-by: Yoshihiro Shimoda Reviewed-by: Jean-Philippe Brucker Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/46a2c0e7419c7d1d931762dc7b6a69fa082d199a.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ec8554b8170ac22c66b57971d72f50c0138cfb86 Author: Michael Straube Date: Wed Aug 18 10:08:54 2021 +0200 staging: r8188eu: clean up comparsions to false Clean up comparsions to false. x == false -> !x Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210818080854.15847-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b3cab9a174e347462795330b915ae8ddcaf36fdc Author: Michael Straube Date: Wed Aug 18 10:08:53 2021 +0200 staging: r8188eu: clean up comparsions to true Clean up comparsions to true. x == true -> x Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210818080854.15847-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 39876a013b3e16e7c78e3638e674a18df999069f Author: Michael Straube Date: Wed Aug 18 10:58:09 2021 +0200 staging: r8188eu: remove null pointer checks before kfree kfree(NULL) is safe, so remove unnecessary null pointer checks before calls to kfree. Reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210818085809.31451-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7972067ad028ed5182d2b6663396de9dc6c629a6 Author: Cai Huoqing Date: Wed Aug 18 17:53:31 2021 +0800 staging: r8188eu: Remove unused including Remove including that don't need it Acked-by: Michael Straube Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210818095331.3422-1-caihuoqing@baidu.com Signed-off-by: Greg Kroah-Hartman commit 0a9b92020d755c4c7a50c7b4b9a0fa047e393083 Author: Kees Cook Date: Wed Aug 18 01:19:37 2021 -0700 staging: wlan-ng: Disable buggy MIB ioctl struct hfa384x_wpa_data ends with a flexible array, but it is allocated on the stack. This means it can never hold any data. Disable the memcpy() calls in and out of the structure, since it must always be zero. This could never have worked. Cc: Greg Kroah-Hartman Cc: Igor Matheus Andrade Torrente Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818081937.1668775-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 7e5a3ef6b4e6cf9b0a04b8906d02f7c896f5b85c Author: Nick Richardson Date: Wed Aug 18 01:31:26 2021 +0000 pktgen: Remove fill_imix_distribution() CONFIG_XFRM dependency Currently, the declaration of fill_imix_distribution() is dependent on CONFIG_XFRM. This is incorrect. Move fill_imix_distribution() declaration out of #ifndef CONFIG_XFRM block. Signed-off-by: Nick Richardson Signed-off-by: David S. Miller commit 4b1327be9fe57443295ae86fe0fcf24a18469e9f Author: Wei Wang Date: Tue Aug 17 12:40:03 2021 -0700 net-memcg: pass in gfp_t mask to mem_cgroup_charge_skmem() Add gfp_t mask as an input parameter to mem_cgroup_charge_skmem(), to give more control to the networking stack and enable it to change memcg charging behavior. In the future, the networking stack may decide to avoid oom-kills when fallbacks are more appropriate. One behavior change in mem_cgroup_charge_skmem() by this patch is to avoid force charging by default and let the caller decide when and if force charging is needed through the presence or absence of __GFP_NOFAIL. Signed-off-by: Wei Wang Reviewed-by: Shakeel Butt Signed-off-by: David S. Miller commit ab44035d308227723b490487ff0feba521e87029 Author: Subbaraya Sundeep Date: Wed Aug 18 12:12:55 2021 +0530 octeontx2-pf: Allow VLAN priority also in ntuple filters VLAN TCI is a 16 bit field which includes Priority(3 bits), CFI(1 bit) and VID(12 bits). Currently ntuple filters support installing rules to steer packets based on VID only. This patch extends that support such that filters can be installed for entire VLAN TCI. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit d3cec5ca299602a9ec0667cd224730178e5d2971 Author: Lahav Schlesinger Date: Wed Aug 18 08:52:12 2021 +0000 selftests: vrf: Add test for SNAT over VRF Commit 09e856d54bda ("vrf: Reset skb conntrack connection on VRF rcv") fixes the "reverse-DNAT" of an SNAT-ed packet over a VRF. This patch adds a test for this scenario. Signed-off-by: Lahav Schlesinger Signed-off-by: David S. Miller commit 89161cd00838ac25f401e3d149171908148af7be Author: Piyush Mehta Date: Wed Aug 18 14:13:11 2021 +0530 phy: xilinx: zynqmp: skip PHY initialization and PLL lock for USB PHY initialization for USB is required on linux boot or when gt lane is changed from the current one and it is applicable on PLL lock too. Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20210818084311.2643986-1-piyush.mehta@xilinx.com Signed-off-by: Vinod Koul commit 41467d2ff4dfe1837cbb0f45e2088e6e787580c6 Author: Yajun Deng Date: Tue Aug 17 23:23:00 2021 +0800 net: net_namespace: Optimize the code There is only one caller for ops_free(), so inline it. Separate net_drop_ns() and net_free(), so the net_free() can be called directly. Add free_exit_list() helper function for free net_exit_list. ==================== v2: - v1 does not apply, rebase it. ==================== Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 994d2cbb08ca05e3c1af954ec63a3ae32a862ac5 Author: Vladimir Oltean Date: Tue Aug 17 17:58:47 2021 +0300 net: dsa: tag_sja1105: be dsa_loop-safe Add support for tag_sja1105 running on non-sja1105 DSA ports, by making sure that every time we dereference dp->priv, we check the switch's dsa_switch_ops (otherwise we access a struct sja1105_port structure that is in fact something else). This adds an unconditional build-time dependency between sja1105 being built as module => tag_sja1105 must also be built as module. This was there only for PTP before. Some sane defaults must also take place when not running on sja1105 hardware. These are: - sja1105_xmit_tpid: the sja1105 driver uses different VLAN protocols depending on VLAN awareness and switch revision (when an encapsulated VLAN must be sent). Default to 0x8100. - sja1105_rcv_meta_state_machine: this aggregates PTP frames with their metadata timestamp frames. When running on non-sja1105 hardware, don't do that and accept all frames unmodified. - sja1105_defer_xmit: calls sja1105_port_deferred_xmit in sja1105_main.c which writes a management route over SPI. When not running on sja1105 hardware, bypass the SPI write and send the frame as-is. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 93e271632ccf0c65395900a9c12720652f769d2a Merge: ec18e84554843 61612511e55c8 Author: David S. Miller Date: Wed Aug 18 10:17:57 2021 +0100 Merge branch 'nci-ext' Bongsu Jeon says: ==================== Update the virtual NCI device driver and add the NCI testcase This series updates the virtual NCI device driver and NCI selftest code and add the NCI test case in selftests. 1/8 to use wait queue in virtual device driver. 2/8 to remove the polling code in selftests. 3/8 to fix a typo. 4/8 to fix the next nlattr offset calculation. 5/8 to fix the wrong condition in if statement. 6/8 to add a flag parameter to the Netlink send function. 7/8 to extract the start/stop discovery function. 8/8 to add the NCI testcase in selftests. ==================== Signed-off-by: David S. Miller commit 61612511e55c886c96c0586abe3ac428402777df Author: Bongsu Jeon Date: Tue Aug 17 06:28:18 2021 -0700 selftests: nci: Add the NCI testcase reading T4T Tag Add the NCI testcase reading T4T Tag that has NFC TEST in plain text. the virtual device application acts as T4T Tag in this testcase. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 72696bd8a09d6dc46196b23cf42562ee7e169ebc Author: Bongsu Jeon Date: Tue Aug 17 06:28:17 2021 -0700 selftests: nci: Extract the start/stop discovery function To reuse the start/stop discovery code in other testcase, extract the code. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 6ebbc9680a33e5e073b04d8a1f486bd9e1809515 Author: Bongsu Jeon Date: Tue Aug 17 06:28:16 2021 -0700 selftests: nci: Add the flags parameter for the send_cmd_mt_nla To reuse the send_cmd_mt_nla for NLM_F_REQUEST and NLM_F_DUMP flag, add the flags parameter to the function. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 1d5b8d01db98abb8c176838fad73287366874582 Author: Bongsu Jeon Date: Tue Aug 17 06:28:15 2021 -0700 selftests: nci: Fix the wrong condition memcpy should be executed only in case nla_len's value is greater than 0. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 78a7b2a8a0fa31f63ac16ac13601db6ed8259dfc Author: Bongsu Jeon Date: Tue Aug 17 06:28:14 2021 -0700 selftests: nci: Fix the code for next nlattr offset nlattr could have a padding for 4 bytes alignment. So next nla's offset should be calculated with a padding. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 366f6edf5dea88451720b0b1f3ea477ee6b3aa80 Author: Bongsu Jeon Date: Tue Aug 17 06:28:13 2021 -0700 selftests: nci: Fix the typo Fix typo: rep_len -> resp_len Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit 4ef956c643942ad93a420a7106413f3a86a1c84c Author: Bongsu Jeon Date: Tue Aug 17 06:28:12 2021 -0700 selftests: nci: Remove the polling code to read a NCI frame Because the virtual NCI device uses Wait Queue, the virtual device application doesn't need to poll the NCI frame. Signed-off-by: Bongsu Jeon Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 8675569d73cab15e5127d1f228afd3317cbeb5bf Author: Bongsu Jeon Date: Tue Aug 17 06:28:11 2021 -0700 nfc: virtual_ncidev: Use wait queue instead of polling In previous version, the user level virtual device application that used this driver should have the polling scheme to read a NCI frame. To remove this polling scheme, use Wait Queue. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller commit ec18e8455484370d633a718c6456ddbf6eceef21 Author: Yajun Deng Date: Mon Aug 16 16:57:57 2021 +0800 net: procfs: add seq_puts() statement for dev_mcast Add seq_puts() statement for dev_mcast, make it more readable. As also, keep vertical alignment for {dev, ptype, dev_mcast} that under /proc/net. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 95d5e6759b16012b8ef674a219d940818ddda967 Author: Randy Dunlap Date: Sun Aug 15 17:05:42 2021 -0700 net: RxRPC: make dependent Kconfig symbols be shown indented Make all dependent RxRPC kconfig entries be dependent on AF_RXRPC so that they are presented (indented) after AF_RXRPC instead of being presented at the same level on indentation. Signed-off-by: Randy Dunlap Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit ccac96977243d7916053550f62e6489760ad0adc Author: Will Deacon Date: Fri Aug 13 14:03:36 2021 +0100 KVM: arm64: Make hyp_panic() more robust when protected mode is enabled When protected mode is enabled, the host is unable to access most parts of the EL2 hypervisor image, including 'hyp_physvirt_offset' and the contents of the hypervisor's '.rodata.str' section. Unfortunately, nvhe_hyp_panic_handler() tries to read from both of these locations when handling a BUG() triggered at EL2; the former for converting the ELR to a physical address and the latter for displaying the name of the source file where the BUG() occurred. Hack the EL2 panic asm to pass both physical and virtual ELR values to the host and utilise the newly introduced CONFIG_NVHE_EL2_DEBUG so that we disable stage-2 protection for the host before returning to the EL1 panic handler. If the debug option is not enabled, display the address instead of the source file:line information. Cc: Andrew Scull Cc: Quentin Perret Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210813130336.8139-1-will@kernel.org commit 606befcd5db4c2493d4b7db9d186eb3e881c483c Merge: 3349d3625d62e f7713dd5d23a1 Author: David S. Miller Date: Wed Aug 18 10:10:01 2021 +0100 Merge branch 'mptcp-mesh-path-manager' Mat Martineau says: ==================== mptcp: Add full mesh path manager option The path manager in MPTCP controls the creation of additional subflows after the initial connection is created. As each peer advertises available endpoints with the ADD_ADDR MPTCP option, the recipient of those advertisements must decide which subflows to create from the known local and remote interfaces that are available for use by MPTCP. The existing in-kernel path manager will create one additional subflow when an ADD_ADDR is received, or a local address is newly configured for MPTCP use. The maximum number of subflows has a configurable limit. This patch set adds a MPTCP_PM_ADDR_FLAG_FULLMESH flag to the MPTCP netlink API that enables subflows to be created more aggressively. When an ADD_ADDR is received from a peer, new subflows are created between that address/port and all local addresses configured for MPTCP. Similarly, when a new local address is newly configured for use by MPTCP, new subflows are created between that local address and all known remote addresses for that MPTCP connection. The configurable limit on the number of subflows still applies. If the new flag is not used the path manager behavior is unchanged. Patch 1 adds a helper function and refactors another function to prepare for the rest of the patch series. Patches 2 and 3 add two mesh connection capabilities: initiating subflows based on added local addresses, or reacting to incoming advertisements. Patches 4-6 add full mesh cases to the self tests. ==================== Signed-off-by: David S. Miller commit f7713dd5d23a1fbb8758fca09847906c62774277 Author: Geliang Tang Date: Tue Aug 17 15:07:27 2021 -0700 selftests: mptcp: delete uncontinuous removing ids The removing addresses testcases can only deal with the continuous ids. This patch added the uncontinuous removing ids support. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4f49d63352da98aba910d0181effddf6262e5c76 Author: Geliang Tang Date: Tue Aug 17 15:07:26 2021 -0700 selftests: mptcp: add fullmesh testcases This patch added the testcases for the fullmesh address flag of the path manager. 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 371b90377e6041ddacbee59068ebdbff85774829 Author: Geliang Tang Date: Tue Aug 17 15:07:25 2021 -0700 selftests: mptcp: set and print the fullmesh flag This patch dealt with the MPTCP_PM_ADDR_FLAG_FULLMESH flag in add_addr() and print_addr(), to set and print out the fullmesh flag. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1a0d6136c5f0af62850b0f4a27e75e1ca4bbcdda Author: Geliang Tang Date: Tue Aug 17 15:07:24 2021 -0700 mptcp: local addresses fullmesh In mptcp_pm_nl_add_addr_received(), fill a temporary allocate array of all local address corresponding to the fullmesh endpoint. If such array is empty, keep the current behavior. Elsewhere loop on such array and create a subflow for each local address towards the given remote address Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 2843ff6f36db7074e17bf5d637a14da08c54aed8 Author: Geliang Tang Date: Tue Aug 17 15:07:23 2021 -0700 mptcp: remote addresses fullmesh This patch added and managed a new per endpoint flag, named MPTCP_PM_ADDR_FLAG_FULLMESH. In mptcp_pm_create_subflow_or_signal_addr(), if such flag is set, instead of: remote_address((struct sock_common *)sk, &remote); fill a temporary allocated array of all known remote address. After releaseing the pm lock loop on such array and create a subflow for each remote address from the given local. Note that the we could still use an array even for non 'fullmesh' endpoint: with a single entry corresponding to the primary MPC subflow remote address. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ee285257a9c1bc73ad095d8a3aa5d04b7da4990f Author: Geliang Tang Date: Tue Aug 17 15:07:22 2021 -0700 mptcp: drop flags and ifindex arguments This patch added a new helper mptcp_pm_get_flags_and_ifindex_by_id(), and used it in __mptcp_subflow_connect() to get the flags and ifindex values. Then the two arguments flags and ifindex of __mptcp_subflow_connect() can be dropped. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 9329752bc8659e3934e2b13434b2fddb0df0bb13 Author: Anshuman Khandual Date: Thu Aug 12 10:39:54 2021 +0530 KVM: arm64: Drop unused REQUIRES_VIRT This seems like a residue from the past. REQUIRES_VIRT is no more available . Hence it can just be dropped along with the related code section. Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628744994-16623-6-git-send-email-anshuman.khandual@arm.com commit 6b7982fefc1fdcaa31b712f5fbc2e993cc99ad23 Author: Anshuman Khandual Date: Thu Aug 12 10:39:53 2021 +0530 KVM: arm64: Drop check_kvm_target_cpu() based percpu probe kvm_target_cpu() never returns a negative error code, so check_kvm_target() would never have 'ret' filled with a negative error code. Hence the percpu probe via check_kvm_target_cpu() does not make sense as its never going to find an unsupported CPU, forcing kvm_arch_init() to exit early. Hence lets just drop this percpu probe (and also check_kvm_target_cpu()) altogether. While here, this also changes kvm_target_cpu() return type to a u32, making it explicit that an error code will not be returned from this function. Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Acked-by: Will Deacon Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628744994-16623-5-git-send-email-anshuman.khandual@arm.com commit bf249d9e362f1011a839d57e771b4b1a7eed9656 Author: Anshuman Khandual Date: Thu Aug 12 10:39:52 2021 +0530 KVM: arm64: Drop init_common_resources() Could do without this additional indirection via init_common_resources() by just calling kvm_set_ipa_limit() directly instead. Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628744994-16623-4-git-send-email-anshuman.khandual@arm.com commit 9788c14060f3c179c376b2a87af1a430d4d84973 Author: Anshuman Khandual Date: Thu Aug 12 10:39:51 2021 +0530 KVM: arm64: Use ARM64_MIN_PARANGE_BITS as the minimum supported IPA Drop hard coded value for the minimum supported IPA range bits (i.e 32). Instead use ARM64_MIN_PARANGE_BITS which improves the code readability. Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628744994-16623-3-git-send-email-anshuman.khandual@arm.com commit 504c6295b998effa682089747a96d7bb5933d4db Author: Anshuman Khandual Date: Thu Aug 12 10:39:50 2021 +0530 arm64/mm: Add remaining ID_AA64MMFR0_PARANGE_ macros Currently there are macros only for 48 and 52 bits parange value extracted from the ID_AA64MMFR0.PARANGE field. This change completes the enumeration and updates the helper id_aa64mmfr0_parange_to_phys_shift(). While here it also defines ARM64_MIN_PARANGE_BITS as the absolute minimum shift value PA range which could be supported on a given platform. Cc: Marc Zyngier Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628744994-16623-2-git-send-email-anshuman.khandual@arm.com commit cbe34165cc1b7d1110b268ba8b9f30843c941639 Author: Kees Cook Date: Tue Aug 17 21:42:52 2021 -0700 staging: rts5208: Fix get_ms_information() heap buffer size Fix buf allocation size (it needs to be 2 bytes larger). Found when __alloc_size() annotations were added to kmalloc() interfaces. In file included from ./include/linux/string.h:253, from ./include/linux/bitmap.h:10, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:17, from ./arch/x86/include/asm/irqflags.h:63, from ./include/linux/irqflags.h:16, from ./include/linux/rcupdate.h:26, from ./include/linux/rculist.h:11, from ./include/linux/pid.h:5, from ./include/linux/sched.h:14, from ./include/linux/blkdev.h:5, from drivers/staging/rts5208/rtsx_scsi.c:12: In function 'get_ms_information', inlined from 'ms_sp_cmnd' at drivers/staging/rts5208/rtsx_scsi.c:2877:12, inlined from 'rtsx_scsi_handler' at drivers/staging/rts5208/rtsx_scsi.c:3247:12: ./include/linux/fortify-string.h:54:29: warning: '__builtin_memcpy' forming offset [106, 107] is out of the bounds [0, 106] [-Warray-bounds] 54 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:417:2: note: in expansion of macro '__underlying_memcpy' 417 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:463:26: note: in expansion of macro '__fortify_memcpy_chk' 463 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx_scsi.c:2851:3: note: in expansion of macro 'memcpy' 2851 | memcpy(buf + i, ms_card->raw_sys_info, 96); | ^~~~~~ Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210818044252.1533634-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 08c63a33f34186e0e818cd625efe4f6efab03a5b Author: Fabio M. De Francesco Date: Tue Aug 17 20:57:23 2021 +0200 staging: r8188eu: Remove code depending on NAT25_LOOKUP Remove all the code related to the management of the NAT25_LOOKUP method in nat25_db_handle(). The only function that used that method was the now deleted nat25_handle_frame(). Remove the NAT25_LOOKUP entry from the NAT25_METHOD enum because it is not anymore used everywhere else in the code of the driver. Remove the 'sender' pointer to integer. Remove __nat25_db_network_lookup_and_replace(). Following the deletion of the code related to the NAT25_LOOKUP method, they are no more needed. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210817185723.15192-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7c0eaa78b9cddf56a9b1ae45b6b12bcfb0f34cec Author: Alexander Egorenkov Date: Tue Aug 10 15:20:00 2021 +0200 s390/sclp: reserve memory occupied by sclp early buffer The memory block occupied by the SCLP early buffer that is allocated by the decompressor and then handed over to the decompressed kernel, must be reserved to prevent it from being reused for other purposes. This is necessary because the SCLP early buffer is still in use during kernel initialization. Fixes: f1d3c5323772 ("s390/boot: move sclp early buffer from fixed address in asm to C") Signed-off-by: Alexander Egorenkov Reported-by: Alexander Gordeev Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 8617bb74006252cb2286008afe7d6575a6425857 Author: Harald Freudenberger Date: Fri Aug 6 12:02:00 2021 +0200 s390/zcrypt: fix wrong offset index for APKA master key valid state Tests showed a mismatch between what the CCA tool reports about the APKA master key state and what's displayed by the zcrypt dd in sysfs. After some investigation, we found out that the documentation which was the source for the zcrypt dd implementation lacks the listing of 3 fields. So this patch now moves the evaluation of the APKA master key state to the correct offset. Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit cf6031d0da5fa3d2eeddbbcae10245705e5d1d49 Author: David Hildenbrand Date: Fri Aug 6 09:54:30 2021 +0200 s390/mm: remove unused cmma functions The last user of arch_set_page_states(), arch_set_page_nodat() and arch_test_page_nodat() was removed in commit 394216275c7d ("s390: remove broken hibernate / power management support"), let's remove these functions. Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20210806075430.6103-1-david@redhat.com Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 9f79b5495145e295af8519a90c456fd3ab3c50c4 Author: Julian Wiedmann Date: Mon Jul 26 08:27:58 2021 +0200 s390/qdio: remove unused support for SLIB parameters Neither of the two drivers provides any SLIB parameter data, so get rid of the dead code. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 44d9a21a19bd40c063a9a7ae823ec570f9ea4850 Author: Julian Wiedmann Date: Mon Jul 26 08:25:41 2021 +0200 s390/qdio: consolidate QIB code Move all QIB-related code into qdio_setup_qib(), and slightly re-order it according to the order of the struct's fields. This makes it easier to understand what the QIB actually looks like before we send it to HW. Also get rid of the qebsm_possible() helper - as 31-bit support is long gone, the comment doesn't make any sense. And while removing some stale QIB-related comment, also move the clearing of the QDR into its proper place. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit f86991b3a95ab245510ccd111926d1f40ae13b91 Author: Julian Wiedmann Date: Mon Jul 12 09:39:57 2021 +0200 s390/qdio: use dev_info() in qdio_print_subchannel_info() Prefer dev_info() over a raw printk. This also adds the device and driver names into the output, so that we have: Before: qdio: 0.0.17c0 ZFCP on SC 17 using [...] After: zfcp 0.0.17c0: qdio: ZFCP on SC 17 using [...] Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 87e225bfa0015aee2812246de56a09126a743192 Author: Julian Wiedmann Date: Fri Jul 23 10:02:17 2021 +0200 s390/qdio: fine-tune the queue sync Push the sync check from qdio_inspect_queue() down into the two get_*_buffer_frontier() code paths, where we actually need the sync to look at the current queue state. This lets us avoid the check when we know that there is no work on the queue (ie. when q->nr_buf_used is 0). While at it introduce the qdio_sync_*_queue() helpers, so that we can avoid the branch on q->is_input_q when we already know the queue type. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 10376b53502ef14661274c40a78cb860b54455fa Author: Julian Wiedmann Date: Fri Jul 23 08:06:50 2021 +0200 s390/qdio: clean up SIGA capability tracking Don't bother with translating the SIGA-related capability bits into our own internal format, just cache the full qdioac1 field instead. Also adjust the helper macros so that they take a qdio_irq argument and can be used everywhere, instead of taking a qdio_q and then internally dereferencing the parent pointer. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit e2af48df5cc6bd6327697af44cc3f0d5e88611a2 Author: Julian Wiedmann Date: Tue Mar 23 23:43:02 2021 +0100 s390/qdio: remove unused sync-after-IRQ infrastructure The queue processing is fully decoupled from any preceding interrupt, so we're no longer making any use of the sync-after-IRQ HW capabilities. And as SIGA-sync is a legacy feature, there's also not much point in re-designing the driver & qdio-layer code just so that we can potentially avoid a few syncs. So just remove all the leftover code. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit eade5f61a56f7589ebc5d321bfa2fdf349552e45 Author: Julian Wiedmann Date: Thu Jul 8 08:32:46 2021 +0200 s390/qdio: use absolute data address in ESTABLISH ccw Clean up yet another path where HW wants an absolute address, and we've been implicitly relying on V=R. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit d3683c055212bf910d4e318f7944910ce10dbee6 Author: Vineeth Vijayan Date: Sun Apr 25 10:52:38 2021 +0200 s390/cio: add dev_busid sysfs entry for each subchannel Introduce dev_busid, which exports the device-id associated with the io-subchannel (and message-subchannel). The dev_busid indicates that of the device which may be physically installed on the corrosponding subchannel. The dev_busid value "none" indicates that the subchannel is not valid, there is no I/O device currently associated with the subchannel. The dev_busid information would be helpful to write device-specific udev-rules associated with the subchannel. The dev_busid interface would be available even when the sch is not bound to any driver or if there is no operational device connected on it. Hence this attribute can be used to write udev-rules which are specific to the device associated with the subchannel. Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit cec0c58d34f26a8ed7bf7ca8726608edbac7e958 Author: Vineeth Vijayan Date: Sun Apr 25 11:27:59 2021 +0200 s390/cio: add rescan functionality on channel subsystem This patch introduces a new rescan sys-interface for channel-subsystem. The rescan interface allows the user to invoke an evaluation of all subchannels defined in the I/O configuration. The new rescan interface can be found at /sys/devices/css0/rescan and can be triggered by, echo > /sys/devices/css0/rescan Writing to this interface triggers subchannel evaluation. The write request completes only after scan-related work has completed This user-invoked subchannel evaluation allows manual recovery in error situations such as: - restart of device discovery after resolution of temporary device error - inconsistent OS view of subchannel state due to missing state-change interrupts (CRWs) Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit f709d0bbad1975dc037287b6fa49781cfce791e5 Author: Thomas Weißschuh Date: Tue Aug 17 17:46:28 2021 +0200 platform/x86: gigabyte-wmi: add support for X570 GAMING X Reported as working here: https://github.com/t-8ch/linux-gigabyte-wmi-driver/issues/1#issuecomment-900263115 Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20210817154628.84992-1-linux@weissschuh.net Signed-off-by: Hans de Goede commit f5bc0157be9baf1e2f12fb53f1e392b955e1c57f Author: Mark Pearson Date: Mon Aug 16 20:15:01 2021 -0400 platform/x86: think-lmi: add debug_cmd Many Lenovo BIOS's support the ability to send a debug command which is useful for debugging and testing unreleased or early features. Adding support for this feature as a module parameter. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20210817001501.293501-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 17d3d3a6146c72c7b2e1aa97191bbefce167e0ad Author: Jiapeng Chong Date: Fri Jul 30 18:26:34 2021 +0800 drm/vc4: hdmi: make vc4_hdmi_codec_pdata static This symbol is not used outside of vc4_hdmi.c, so marks it static. Fix the following sparse warning: drivers/gpu/drm/vc4/vc4_hdmi.c:1479:25: warning: symbol 'vc4_hdmi_codec_pdata' was not declared. Should it be static? Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/1627640794-15718-1-git-send-email-jiapeng.chong@linux.alibaba.com commit 53bca371cdf7addc1e93e1b99285b3d3935685ec Author: Thara Gopinath Date: Mon Aug 9 15:16:00 2021 -0400 thermal/drivers/qcom: Add support for LMh driver Driver enabling various pieces of Limits Management Hardware(LMh) for cpu cluster0 and cpu cluster1 namely kick starting monitoring of temperature, current, battery current violations, enabling reliability algorithm and setting up various temperature limits. The following has been explained in the cover letter. I am including this here so that this remains in the commit message as well. LMh is a hardware infrastructure on some Qualcomm SoCs that can enforce temperature and current limits as programmed by software for certain IPs like CPU. On many newer LMh is configured by firmware/TZ and no programming is needed from the kernel side. But on certain SoCs like sdm845 the firmware does not do a complete programming of the h/w. On such soc's kernel software has to explicitly set up the temperature limits and turn on various monitoring and enforcing algorithms on the hardware. Tested-by: Steev Klimaszewski # Lenovo Yoga C630 Signed-off-by: Thara Gopinath Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210809191605.3742979-3-thara.gopinath@linaro.org commit de3438c47a8ddc75548e62a03736a9321c2b7bac Author: Thara Gopinath Date: Mon Aug 9 15:15:59 2021 -0400 firmware: qcom_scm: Introduce SCM calls to access LMh Introduce SCM calls to access/configure limits management hardware(LMH). Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210809191605.3742979-2-thara.gopinath@linaro.org commit c448f0fd2ce59947b3b8b8d6b56e15036449d1f1 Author: Johannes Berg Date: Wed Aug 18 09:20:53 2021 +0200 cfg80211: fix BSS color notify trace enum confusion The wrong enum was used here, leading to warnings. Just use a u32 instead. Reported-by: kernel test robot Fixes: 0d2ab3aea50b ("nl80211: add support for BSS coloring") Signed-off-by: Johannes Berg commit 5358680e675744962a8adc99263adf59adfa8960 Author: Lukas Bulwahn Date: Wed Aug 4 14:34:25 2021 +0200 leds: trigger: remove reference to obsolete CONFIG_IDE_GD_ATA Commit b7fb14d3ac63 ("ide: remove the legacy ide driver") removes the definition of the config IDE_GD_ATA. So, remove the obsolete reference in ./drivers/leds/trigger/Kconfig. Signed-off-by: Lukas Bulwahn Signed-off-by: Pavel Machek commit 8b624007e72f448df91e3bd4a9f23ad516599040 Author: Jan Kundrát Date: Fri Jul 30 23:59:11 2021 +0200 leds: lp50xx: Fix chip name in KConfig The 9-channel one is called LP5009, not LP509. Signed-off-by: Jan Kundrát Reviewed-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 4812c9111220b0af00f7a436cc02ffaed289962c Merge: 7f3b457977d26 87859a8e3f083 Author: Ingo Molnar Date: Wed Aug 18 08:40:09 2021 +0200 Merge branch 'lkmm' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/debug Pull LKMM changes from Paul E. McKenney: "These changes focus on documentation, providing additional examples and use cases." Signed-off-by: Ingo Molnar commit 7f3b457977d26e2b202d1d043bfef024aa0a9799 Merge: 9ae6ab27f44ee e04938042d77a Author: Ingo Molnar Date: Wed Aug 18 08:35:23 2021 +0200 Merge branch 'kcsan' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/debug Pull KCSAN updates from Paul E. McKenney: - improve comments - introduce CONFIG_KCSAN_STRICT (which RCU uses) - optimize use of get_ctx() by kcsan_found_watchpoint() - rework atomic.h into permissive.h - add the ability to ignore writes that change only one bit of a given data-racy variable. Signed-off-by: Ingo Molnar commit 3d3d65bd27645830a6f23af29d0f9ebe5cc8bcb2 Author: Denis Osterland-Heim Date: Tue Jun 8 08:35:54 2021 +0200 leds: pwm: add support for default-state device property This patch adds support for "default-state" devicetree property, which allows to defer pwm init to first use of led. This allows to configure the PWM early in bootloader to let the LED blink until an application in Linux userspace sets something different. Signed-off-by: Denis Osterland-Heim Signed-off-by: Pavel Machek commit 791bc41163c51f870972d6c6b82d971ce951096c Author: Denis Osterland-Heim Date: Tue Jun 8 08:35:53 2021 +0200 leds: move default_state read from fwnode to core This patch introduces a new function to read initial default_state from fwnode. Suggested-by: Pavel Machek Signed-off-by: Denis Osterland-Heim Signed-off-by: Pavel Machek commit 528b16bfc3ae5f11638e71b3b63a81f9999df727 Author: Arne Welzel Date: Sat Aug 14 00:40:38 2021 +0200 dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc() On systems with many cores using dm-crypt, heavy spinlock contention in percpu_counter_compare() can be observed when the page allocation limit for a given device is reached or close to be reached. This is due to percpu_counter_compare() taking a spinlock to compute an exact result on potentially many CPUs at the same time. Switch to non-exact comparison of allocated and allowed pages by using the value returned by percpu_counter_read_positive() to avoid taking the percpu_counter spinlock. This may over/under estimate the actual number of allocated pages by at most (batch-1) * num_online_cpus(). Currently, batch is bounded by 32. The system on which this issue was first observed has 256 CPUs and 512GB of RAM. With a 4k page size, this change may over/under estimate by 31MB. With ~10G (2%) allowed dm-crypt allocations, this seems an acceptable error. Certainly preferred over running into the spinlock contention. This behavior was reproduced on an EC2 c5.24xlarge instance with 96 CPUs and 192GB RAM as follows, but can be provoked on systems with less CPUs as well. * Disable swap * Tune vm settings to promote regular writeback $ echo 50 > /proc/sys/vm/dirty_expire_centisecs $ echo 25 > /proc/sys/vm/dirty_writeback_centisecs $ echo $((128 * 1024 * 1024)) > /proc/sys/vm/dirty_background_bytes * Create 8 dmcrypt devices based on files on a tmpfs * Create and mount an ext4 filesystem on each crypt devices * Run stress-ng --hdd 8 within one of above filesystems Total %system usage collected from sysstat goes to ~35%. Write throughput on the underlying loop device is ~2GB/s. perf profiling an individual kworker kcryptd thread shows the following profile, indicating spinlock contention in percpu_counter_compare(): 99.98% 0.00% kworker/u193:46 [kernel.kallsyms] [k] ret_from_fork | --ret_from_fork kthread worker_thread | --99.92%--process_one_work | |--80.52%--kcryptd_crypt | | | |--62.58%--mempool_alloc | | | | | --62.24%--crypt_page_alloc | | | | | --61.51%--__percpu_counter_compare | | | | | --61.34%--__percpu_counter_sum | | | | | |--58.68%--_raw_spin_lock_irqsave | | | | | | | --58.30%--native_queued_spin_lock_slowpath | | | | | --0.69%--cpumask_next | | | | | --0.51%--_find_next_bit | | | |--10.61%--crypt_convert | | | | | |--6.05%--xts_crypt ... After applying this patch and running the same test, %system usage is lowered to ~7% and write throughput on the loop device increases to ~2.7GB/s. perf report shows mempool_alloc() as ~8% rather than ~62% in the profile and not hitting the percpu_counter() spinlock anymore. |--8.15%--mempool_alloc | | | |--3.93%--crypt_page_alloc | | | | | --3.75%--__alloc_pages | | | | | --3.62%--get_page_from_freelist | | | | | --3.22%--rmqueue_bulk | | | | | --2.59%--_raw_spin_lock | | | | | --2.57%--native_queued_spin_lock_slowpath | | | --3.05%--_raw_spin_lock_irqsave | | | --2.49%--native_queued_spin_lock_slowpath Suggested-by: DJ Gregor Reviewed-by: Mikulas Patocka Signed-off-by: Arne Welzel Fixes: 5059353df86e ("dm crypt: limit the number of allocated pages") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit d2d837563743590cbf07bf786941e73a8c40b031 Author: Nathan Chancellor Date: Tue Aug 17 18:27:05 2021 -0700 ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards When CONFIG_PM is not set, there is an unused function warning: sound/pci/hda/patch_analog.c:115:13: warning: unused function 'ad198x_shutup' [-Wunused-function] static void ad198x_shutup(struct hda_codec *codec) ^ 1 warning generated. Sink ad198x_shutup() into ad198x_suspend(), as it is only called in that one space. Move the CONFIG_PM guards above ad198x_power_eapd_write() as it is only called in ad198x_power_eapd(), which is in turn only called in ad198x_power_eapd(). Those two functions are large enough that they are left alone. Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210818012705.311963-2-nathan@kernel.org Signed-off-by: Takashi Iwai commit f8b32a6daf35f54f6260df7446e4069af64f0fcc Author: Nathan Chancellor Date: Tue Aug 17 18:27:04 2021 -0700 ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() When CONFIG_PM is not set, there is an unused function warning: sound/pci/hda/patch_sigmatel.c:4383:13: warning: unused function 'stac_shutup' [-Wunused-function] static void stac_shutup(struct hda_codec *codec) ^ 1 warning generated. Sink the contents of stac_shutup() into stac_suspend() since stac_shutup() is only called in that one location now. Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210818012705.311963-1-nathan@kernel.org Signed-off-by: Takashi Iwai commit 848ade90ba9c1e2bc2f7869fbe5d08bb32f3db09 Author: Christian Loehle Date: Mon Aug 16 09:37:51 2021 +0000 scsi: sd: Do not exit sd_spinup_disk() quietly The sd_spinup_disk() function logs what is happening. Unfortunately this output stops if the media was marked as removed in the meantime. Add a print for this case too. Link: https://lore.kernel.org/r/CWXP265MB26803209FD08A64222EEEA02C4FD9@CWXP265MB2680.GBRP265.PROD.OUTLOOK.COM Reviewed-by: Bart Van Assche Signed-off-by: Christian Loehle Signed-off-by: Martin K. Petersen commit 7a3795f28795e5bdc71498728bdfe4f921ce6c27 Author: Hannes Reinecke Date: Tue Aug 17 09:53:06 2021 +0200 scsi: ibmvfc: Do not wait for initial device scan The initial device scan might take some time, and there really is no need to wait for it during probe(). So return immediately from scsi_scan_host() during probe() and avoid any udev stalls during booting. Link: https://lore.kernel.org/r/20210817075306.11315-1-mwilck@suse.com Acked-by: Tyrel Datwyler Signed-off-by: Hannes Reinecke Signed-off-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 0394b5048efd73b04276979d014a67f30c0ad699 Author: Sergey Samoylenko Date: Tue Aug 3 17:54:10 2021 +0300 scsi: target: Fix sense key for invalid EXTENDED COPY request TCM fails to pass the following tests in libiscsi: SCSI.ExtendedCopy.DescrType SCSI.ExtendedCopy.DescrLimits SCSI.ExtendedCopy.ParamHdr SCSI.ExtendedCopy.ValidSegDescr SCSI.ExtendedCopy.ValidTgtDescr The xcopy code always returns the same NOT READY sense key for all detected errors. Change the sense key for invalid requests to ILLEGAL REQUEST, and for aborted transfers to COPY ABORTED. Link: https://lore.kernel.org/r/20210803145410.80147-3-s.samoylenko@yadro.com Fixes: d877d7275be3 ("target: Fix a deadlock between the XCOPY code and iSCSI session shutdown") Reviewed-by: David Disseldorp Reviewed-by: Roman Bolshakov Reviewed-by: Konstantin Shelekhin Signed-off-by: Sergey Samoylenko Signed-off-by: Martin K. Petersen commit 44678553ad7eb59be3092d6677d8d4a00289afda Author: Sergey Samoylenko Date: Tue Aug 3 17:54:09 2021 +0300 scsi: target: Allows backend drivers to fail with specific sense codes Currently, backend drivers can fail I/O with SAM_STAT_CHECK_CONDITION which gets us TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE. Add a new helper that allows backend drivers to fail with specific sense codes. This is based on a patch from Mike Christie . Cc: Mike Christie Link: https://lore.kernel.org/r/20210803145410.80147-2-s.samoylenko@yadro.com Reviewed-by: David Disseldorp Signed-off-by: Sergey Samoylenko Signed-off-by: Martin K. Petersen commit 5f492a7aa13b4ebf8ca85e818585394053065240 Author: Gustavo A. R. Silva Date: Tue Aug 10 16:07:41 2021 -0500 scsi: smartpqi: Replace one-element 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]. Refactor the code a bit according to the use of a flexible-array member in struct pqi_event_config instead of a one-element array, and use the struct_size() helper. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). This issue was found with the help of Coccinelle and audited and fixed, manually. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210810210741.GA58765@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 0f99792c01d1d6d35b86e850e9ccadd98d6f3e0c Author: Tuo Li Date: Mon Aug 9 21:04:13 2021 -0700 scsi: target: pscsi: Fix possible null-pointer dereference in pscsi_complete_cmd() The return value of transport_kmap_data_sg() is assigned to the variable buf: buf = transport_kmap_data_sg(cmd); And then it is checked: if (!buf) { This indicates that buf can be NULL. However, it is dereferenced in the following statements: if (!(buf[3] & 0x80)) buf[3] |= 0x80; if (!(buf[2] & 0x80)) buf[2] |= 0x80; To fix these possible null-pointer dereferences, dereference buf and call transport_kunmap_data_sg() only when buf is not NULL. Link: https://lore.kernel.org/r/20210810040414.248167-1-islituo@gmail.com Reported-by: TOTE Robot Reviewed-by: Bodo Stroesser Signed-off-by: Tuo Li Signed-off-by: Martin K. Petersen commit 4c7b6ea336c1e415fc002c756449835de768914c Author: John Garry Date: Fri Aug 13 21:49:13 2021 +0800 scsi: core: Remove scsi_cmnd.tag It is never read, so get rid of it. Link: https://lore.kernel.org/r/1628862553-179450-4-git-send-email-john.garry@huawei.com Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 6a036ce0e25c737d5258d42abeee3a31d21801fb Author: John Garry Date: Tue Aug 17 21:43:37 2021 +0800 scsi: ibmvfc: Stop using scsi_cmnd.tag Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag. Link: https://lore.kernel.org/r/1629207817-211936-1-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 3349d3625d62e4c0d90e854a5b7e8efda8a5c994 Merge: 752be2976405b 6e9078a667a36 Author: Jakub Kicinski Date: Tue Aug 17 17:50:23 2021 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Nguyen, Anthony L says: ==================== 40GbE Intel Wired LAN Driver Updates 2021-08-17 This series contains updates to iavf and i40e drivers. Stefan Assmann converts use of flag based locking of critical sections to mutexes for iavf. Colin King fixes a spelling error for i40e. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: i40e: Fix spelling mistake "dissable" -> "disable" iavf: use mutexes for locking of critical sections ==================== Link: https://lore.kernel.org/r/20210817203549.3529860-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 6af0b5570b59ce8dd1608a8e48f59eff3f4bdd04 Author: Zheng Yongjun Date: Fri Mar 26 14:48:08 2021 +0800 selftests/powerpc: Remove duplicated include from tm-poison.c Remove duplicated include. Reported-by: Hulk Robot Signed-off-by: Zheng Yongjun Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210326064808.3262568-1-zhengyongjun3@huawei.com commit e225c4d6bc389701f2f63fc246420a1da3465ab5 Author: Wan Jiabing Date: Tue Mar 23 14:29:05 2021 +0800 powerpc: Remove duplicate includes interrupt.c: asm/interrupt.h has been included at line 12, so remove the duplicate one at line 10. time.c: linux/sched/clock.h has been included at line 33,so remove the duplicate one at line 56 and move sched/cputime.h under sched including segament. Signed-off-by: Wan Jiabing Reviewed-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210323062916.295346-1-wanjiabing@vivo.com commit 4ec36dfeb155b72da8d28ab006a46f2f8b981eac Author: Amey Narkhede Date: Tue Aug 17 23:34:55 2021 +0530 PCI: Remove reset_fn field from pci_dev "reset_fn" indicates whether the device supports any reset mechanism. Remove the use of reset_fn in favor of the reset_methods array that tracks supported reset mechanisms of a device and their ordering. The octeon driver incorrectly used reset_fn to detect whether the device supports FLR or not. Use pcie_reset_flr() to probe whether it supports FLR. Co-developed-by: Alex Williamson Link: https://lore.kernel.org/r/20210817180500.1253-5-ameynarkhede03@gmail.com Signed-off-by: Alex Williamson Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson Reviewed-by: Raphael Norwitz commit e20afa06244eb5d7fa850f9fe2a78ae17ba96f81 Author: Amey Narkhede Date: Tue Aug 17 23:34:54 2021 +0530 PCI: Add array to track reset method ordering Add reset_methods[] in struct pci_dev to keep track of reset mechanisms supported by the device and their ordering. Refactor probing and reset functions to take advantage of calling convention of reset functions. Co-developed-by: Alex Williamson Link: https://lore.kernel.org/r/20210817180500.1253-4-ameynarkhede03@gmail.com Signed-off-by: Alex Williamson Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas Reviewed-by: Raphael Norwitz commit 18c585c7d742b8a207a4a932871dde1aa2a5b8fe Author: Saravana Kannan Date: Fri Aug 13 19:31:30 2021 -0700 of: property: fw_devlink: Add support for "leds" and "backlight" Allows tracking dependencies between leds/backlights devices and their consumers. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210814023132.2729731-2-saravanak@google.com Signed-off-by: Rob Herring commit 577f425859e01fb1e83e86b4a5e04b35205d3e58 Author: Krzysztof Kozlowski Date: Fri Aug 13 16:35:37 2021 +0200 dt-bindings: memory: convert Qualcomm Atheros DDR to dtschema Convert Qualcomm Atheros AR7xxx/AR9xxx DDR controller to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210813143537.130310-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 9634cec586312a4fdc972a995f8d52441ed59b95 Author: Krzysztof Kozlowski Date: Wed Aug 11 10:43:06 2021 +0200 dt-bindings: rng: convert Samsung Exynos TRNG to dtschema Convert Samsung Exynos SoC True Random Number Generator bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210811084306.28740-2-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 22227848d31e7fa58170c8cb1a8e53b1f46c81ae Author: Krzysztof Kozlowski Date: Wed Aug 11 10:43:05 2021 +0200 dt-bindings: irqchip: convert Samsung Exynos IRQ combiner to dtschema Convert Samsung Exynos SoC Interrupt Combiner Controller bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210811084306.28740-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit 3487668d281b53cae7846df25cd90ac1bb2d6685 Author: Krzysztof Kozlowski Date: Wed Aug 11 10:38:58 2021 +0200 dt-bindings: ata: drop unused Exynos SATA bindings The Samsung Exynos SoC SATA bindings are not implemented in the kernel, not used and superseded by generic Documentation/devicetree/bindings/ata/ahci-platform.txt bindings. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210811083859.28234-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit b6c2052a90cece5e2887c6e6c59e985cb2546a60 Author: Biju Das Date: Sun Aug 15 14:39:26 2021 +0100 dt-bindings: net: renesas,etheravb: Drop "int_" prefix and "_n" suffix from interrupt names This patch updates interrupt-names with dropping "int_" prefix and "_n" suffix. Fixes: 1dbd981fcf2a ("dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP") Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20210815133926.22860-1-biju.das.jz@bp.renesas.com Signed-off-by: Rob Herring commit b3a7ab2d4376726178909e27b6956c012277ac4e Author: Lukas Bulwahn Date: Tue Aug 17 10:48:11 2021 +0200 hwmon: remove amd_energy driver in Makefile Commit 9049572fb145 ("hwmon: Remove amd_energy driver") removes the driver, but misses to adjust the Makefile. Hence, ./scripts/checkkconfigsymbols.py warns: SENSORS_AMD_ENERGY Referencing files: drivers/hwmon/Makefile Remove the missing piece of this driver removal. Fixes: 9049572fb145 ("hwmon: Remove amd_energy driver") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210817084811.10673-1-lukas.bulwahn@gmail.com Signed-off-by: Guenter Roeck commit 8713b4a49c8a9acc1fe25e6b98a9bbd0e9b3a680 Author: Armin Wolf Date: Sat Aug 14 21:05:16 2021 +0200 hwmon: (dell-smm) Rework SMM function debugging Drop #ifdef DEBUG and use ktime_us_delta() for improved precision. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20210814190516.26718-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 782a99c146ffe9d0e06f139daea0e56d866eabc8 Author: Armin Wolf Date: Sat Aug 14 16:36:37 2021 +0200 hwmon: (dell-smm) Mark i8k_get_fan_nominal_speed as __init Mark function i8k_get_fan_nominal_speed() as __init since it is only used in code also marked as __init. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20210814143637.11922-5-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit c510f6accbba66af900d710a05b635581f4129f4 Author: Armin Wolf Date: Sat Aug 14 16:36:34 2021 +0200 hwmon: (dell-smm) Mark tables as __initconst Both the config and the DMI tables never change and are only used during module init for setting up the device data struct. Mark all of them as const and __initconst for a smaller runtime memory footprint. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20210814143637.11922-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 1125bacbf36cc53121cecba20d1def032881085d Author: Chris Packham Date: Thu Aug 12 13:40:00 2021 +1200 hwmon: (pmbus/bpa-rs600) Add workaround for incorrect Pin max BPD-RS600 modules running firmware v5.70 misreport the MFR_PIN_MAX. The indicate a maximum of 1640W instead of 700W. Detect the invalid reading and return a sensible value instead. Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210812014000.26293-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 7a8c68c57fd09541377f6971f25efdeb9a926c37 Author: Chris Packham Date: Thu Aug 12 13:39:59 2021 +1200 hwmon: (pmbus/bpa-rs600) Don't use rated limits as warn limits In the initial implementation a number of PMBUS_x_WARN_LIMITs were mapped to MFR fields. This was incorrect as these MFR limits reflect the rated limit as opposed to a limit which will generate warning. Instead return -ENXIO like we were already doing for other WARN_LIMITs. Subsequently these rated limits have been exposed generically as new fields in the sysfs ABI so the values are still available. Fixes: 15b2703e5e02 ("hwmon: (pmbus) Add driver for BluTek BPA-RS600") Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210812014000.26293-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 2aee7e67bee7a5aa741bad6a0a472f108b29ad40 Author: Nuno Sá Date: Wed Aug 11 13:48:53 2021 +0200 hwmon: (axi-fan-control) Support temperature vs pwm points The HW has some predefined points where it will associate a PWM value. However some users might want to better set these points to their usecases. This patch exposes these points as pwm auto_points: * pwm1_auto_point1_temp_hyst: temperature threshold below which PWM should be 0%; * pwm1_auto_point1_temp: temperature threshold above which PWM should be 25%; * pwm1_auto_point2_temp_hyst: temperature threshold below which PWM should be 25%; * pwm1_auto_point2_temp: temperature threshold above which PWM should be 50%; * pwm1_auto_point3_temp_hyst: temperature threshold below which PWM should be 50%; * pwm1_auto_point3_temp: temperature threshold above which PWM should be 75%; * pwm1_auto_point4_temp_hyst: temperature threshold below which PWM should be 75%; * pwm1_auto_point4_temp: temperature threshold above which PWM should be 100%; Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20210811114853.159298-4-nuno.sa@analog.com Signed-off-by: Guenter Roeck commit e66705de8206350bf24cb66c4a0e675be35f3430 Author: Nuno Sá Date: Wed Aug 11 13:48:52 2021 +0200 hwmon: (axi-fan-control) Handle irqs in natural order The core will now start out of reset at boot as soon as clocking is available. Hence, by the time we unmask the interrupts we already might have some of them set. Thus, it's important to handle them in the natural order the core generates them. Otherwise, we could process 'ADI_IRQ_SRC_PWM_CHANGED' before 'ADI_IRQ_SRC_TEMP_INCREASE' and erroneously set 'update_tacho_params' to true. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20210811114853.159298-3-nuno.sa@analog.com Signed-off-by: Guenter Roeck commit a3933625de28e730c7822d2b14f896125577abe8 Author: Nuno Sá Date: Wed Aug 11 13:48:51 2021 +0200 hwmon: (axi-fan-control) Make sure the clock is enabled The core will only work if it's clock is enabled. This patch is a minor enhancement to make sure that's the case. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20210811114853.159298-2-nuno.sa@analog.com Signed-off-by: Guenter Roeck commit 76b72736f574ec38b3e94603ea5f74b1853f26b0 Author: Brandon Wyman Date: Fri Aug 6 22:51:31 2021 +0000 hwmon: (pmbus/ibm-cffps) Fix write bits for LED control When doing a PMBus write for the LED control on the IBM Common Form Factor Power Supplies (ibm-cffps), the DAh command requires that bit 7 be low and bit 6 be high in order to indicate that you are truly attempting to do a write. Signed-off-by: Brandon Wyman Link: https://lore.kernel.org/r/20210806225131.1808759-1-bjwyman@gmail.com Signed-off-by: Guenter Roeck commit 2284ed9ffc062d1755a5299e2cc6896d2cfba000 Author: Linus Walleij Date: Fri Jul 30 01:05:43 2021 +0200 hwmon: (w83781d) Match on device tree compatibles I2C devices should match on the proper compatible string. This is already used in one device tree in the kernel (MIPS) so let's add the matches. Signed-off-by: Linus Walleij Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210729230543.2853485-2-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 542613a25eff333488c331dd92066388a6bf95bb Author: Linus Walleij Date: Fri Jul 30 01:05:42 2021 +0200 dt-bindings: hwmon: Add bindings for Winbond W83781D This adds a device tree binding for the Winbond W83781D and its sibling HW monitoring ICs. This is used in for example the Freecom FSG-3 router/NAS. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210729230543.2853485-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit e104d530f3734c7666edf86bbf1b83b1bfafe6ee Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:56 2021 +0200 hwmon: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20210803141621.780504-14-bigeasy@linutronix.de Signed-off-by: Guenter Roeck commit 95d88d054ad9dfe43c9634865764ac20fc373583 Author: Carlos Alberto Lopez Perez Date: Mon Aug 2 14:15:38 2021 +0100 hwmon: (dell-smm) Add Dell Precision 7510 to fan control whitelist This allows manual PWM control without the BIOS fighting back on Dell Precision 7510. Meanwhile at it, also sort alphabetically the entries of the i8k_whitelist_fan_control struct. Signed-off-by: Carlos Alberto Lopez Perez Acked-by: Pali Rohár Link: https://lore.kernel.org/r/20210802131538.8660-1-clopez@igalia.com Signed-off-by: Guenter Roeck commit 2757269a7defe96e871be795b680b602efb877ce Author: Armin Wolf Date: Thu Jul 29 00:15:57 2021 +0200 hwmon: (dell-smm-hwmon) Fix fan mutliplier detection for 3rd fan There are up to three fans, but the detection omits the 3rd one. Fix that by using DELL_SMM_NO_FANS. Signed-off-by: Armin Wolf Fixes: 747bc8b063ae (hwmon: (dell-smm) Detect fan with index=2) Link: https://lore.kernel.org/r/20210728221557.8891-7-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit deeba244b0feab6180b77fe98f2c19eb89163428 Author: Armin Wolf Date: Thu Jul 29 00:15:56 2021 +0200 hwmon: (dell-smm-hwmon) Convert to devm_hwmon_device_register_with_info() Convert to new registration API to get rid of attribute magic numbers and reduce module size. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210728221557.8891-6-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit ba04d73c26edf1b577b39b708418a931b0b73c40 Author: Armin Wolf Date: Thu Jul 29 00:15:55 2021 +0200 hwmon: (dell-smm-hwmon) Move variables into a driver private data structure Move Variables into a driver private data structure. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210728221557.8891-5-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit a2cb66b476e282b4fc1ce8b69f1fae0f9991d0b6 Author: Armin Wolf Date: Thu Jul 29 00:15:54 2021 +0200 hwmon: (dell-smm-hwmon) Use devm_add_action_or_reset() Use devm_add_action_or_reset() for calling i8k_exit_procfs() so the remove() function in dell_smm_driver can be omitted. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Tested-by: Pali Rohár Link: https://lore.kernel.org/r/20210728221557.8891-4-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit c9363cdf3aab9f48c3c8bd8bfa77dcfd3a3a92d2 Author: Armin Wolf Date: Thu Jul 29 00:15:53 2021 +0200 hwmon: (dell-smm-hwmon) Mark functions as __init i8k_get_dmi_data() and i8k_get_dell_signature() are only called during module init and probe, which both are marked as __init. Also mark these function as __init to lower the runtime memory footprint. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Tested-by: Pali Rohár Link: https://lore.kernel.org/r/20210728221557.8891-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 1492fa21c0ba531e3ae4fc1b5cdaaf96603bf800 Author: Armin Wolf Date: Thu Jul 29 00:15:52 2021 +0200 hwmon: (dell-smm-hwmon) Use platform device Register a platform device for usage with devm_hwmon_device_register_with_groups since the platform device is necessary for future changes. Also fix some checkpatch warnings. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210728221557.8891-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 60b76c3a117ce076f60f58de17bae1122849746a Author: Akshay Gupta Date: Mon Jul 26 19:06:15 2021 +0530 dt-bindings: sbrmi: Add SB-RMI hwmon driver bindings - Document device tree bindings for AMD SB-RMI emulated service. Signed-off-by: Akshay Gupta Signed-off-by: Naveen Krishna Chatradhi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210726133615.9709-3-nchatrad@amd.com Signed-off-by: Guenter Roeck commit 04165fb73f9b8ea9e5cc2f3c21ca2a777516fc7b Author: Akshay Gupta Date: Mon Jul 26 19:06:14 2021 +0530 hwmon: (sbrmi) Add Documentation - Add documentation for SB-RMI module Reviewed-by: Guenter Roeck Signed-off-by: Akshay Gupta Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20210726133615.9709-2-nchatrad@amd.com Signed-off-by: Guenter Roeck commit 5a0f50d110b36aaf624fc2017d5e08357e2c8143 Author: Akshay Gupta Date: Mon Jul 26 19:06:13 2021 +0530 hwmon: Add support for SB-RMI power module On AMD platforms the Out-of-band access is provided by Advanced Platform Management Link (APML), APML is a SMBus v2.0 compatible 2-wire processor client interface. APML is also referred as the sideband interface (SBI). APML is used to communicate with the Side-Band Remote Management Interface (SB-RMI) which provides Soft Mailbox messages to manage power consumption and power limits of the CPU socket. - This module add support to read power consumption, power limit & max power limit and write power limit. - To instantiate this driver on a Board Management Controller (BMC) connected to an AMD CPU with SB-RMI support, the i2c bus number would be the bus connected from the BMC to the CPU. Reviewed-by: Guenter Roeck Signed-off-by: Akshay Gupta Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20210726133615.9709-1-nchatrad@amd.com [groeck: Fix uninitialized variable problem when reporting max power] Signed-off-by: Guenter Roeck commit 6f447ce0f7c16ee501d92091446362aa3359d89a Author: Armin Wolf Date: Sat Jul 24 17:48:17 2021 +0200 hwmon: (w83627ehf) Make DEVICE_ATTR_RO static Make DEVICE_ATTR_RO static to fix sparse warning: warning: symbol 'dev_attr_cpu0_vid' was not declared. Should it be static? Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210724154817.18796-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit ef9e78c0d1ff423be08f34e6a8c226aa7c23ce74 Author: Armin Wolf Date: Wed Jul 21 21:25:19 2021 +0200 hwmon: (w83627ehf) Switch to SIMPLE_DEV_PM_OPS Use SIMPLE_DEV_PM_OPS() to also assign poweroff and thaw callbacks. Remove the now obsolete checking of CONFIG_PM too. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210721192519.28784-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 04fecf0c6155f73ed446b5b67726ff882b8078a9 Author: Mauro Carvalho Chehab Date: Thu Jul 22 11:59:59 2021 +0200 dt-bindings: firmware: update arm,scpi.yaml reference Changeset 1496be719468 ("dt-bindings: firmware: arm,scpi: Convert to json schema") renamed: Documentation/devicetree/bindings/arm/arm,scpi.txt to: Documentation/devicetree/bindings/firmware/arm,scpi.yaml. Update its cross-reference accordingly. Fixes: 1496be719468 ("dt-bindings: firmware: arm,scpi: Convert to json schema") Signed-off-by: Mauro Carvalho Chehab Acked-by: Sudeep Holla Link: https://lore.kernel.org/r/b5a2b0cb83e7f8193b4be4cef9250dd4c42877ab.1626947923.git.mchehab+huawei@kernel.org Signed-off-by: Guenter Roeck commit 1ccdc184056760a620374a7b23fcb8e3aae8ef3a Author: Martin Hundebøll Date: Fri Jul 16 15:54:41 2021 +0200 hwmon: intel-m10-bmc-hwmon: add n5010 sensors Add the list of sensors supported by the Silicom n5010 PAC, and enable the drivers as a subtype of the intel-m10-bmc multi-function driver. Signed-off-by: Martin Hundebøll Reviewed-by: Guenter Roeck Reviewed-by: Moritz Fischer Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/20210716135441.3235863-4-martin@geanix.com Signed-off-by: Guenter Roeck commit 228f2aed8777a6d52cb7fa7f454c1d47511b677f Author: Armin Wolf Date: Fri Jul 9 20:45:00 2021 +0200 hwmon: (w83627ehf) Remove w83627ehf_remove() Using devm_request_region() allows us to omit w83627ehf_remove() and also simplifies error handling during probe. Also fixed a checkpatch issue. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210709184501.6546-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 964c1c91ed60dbae30ea30ebe488a6195aa5b613 Author: Armin Wolf Date: Fri Jul 9 20:44:59 2021 +0200 hwmon: (w83627ehf) Use platform_create_bundle Using platform_create_bundle() simplifies the module init code and allows w83627ehf_probe() to be marked as __init, lowering the runtime memory footprint. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20210709184501.6546-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 129cdce3756117adcb0fced93cb926874355dbba Author: Chris Packham Date: Fri Jul 9 10:06:18 2021 +1200 hwmon: (pmbus/bpa-rs600) Support BPD-RS600 The BPD-RS600 is the DC version of the BPA-RS600. The PMBUS interface is the same between the two models. Keep the same compatible string but accept either BPA-RS600 or BPD-RS600 in the PMBUS_MFR_MODEL. Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20210708220618.23576-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit bd56c1e9603a4c645fcafdef8df9b2b04125d406 Author: Linus Walleij Date: Mon Jul 5 00:20:14 2021 +0200 hwmon: (ntc_thermistor) Use library interpolation The kernel has a helper function for linear interpolation so use it. It incidentally makes the code easier to read as well. Tested on the ST-Ericsson HREFv60plus hardware reference design with two thermistors forming a thermal zone. Cc: Peter Rosin Cc: Chris Lesiak Cc: linux-iio@vger.kernel.org Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210704222014.12058-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 02c9dce4df8dd23e67dac1074be732c65c0e67d8 Author: David Bartley Date: Sun May 16 23:41:31 2021 -0700 hwmon: (k10temp) support Zen3 APUs Add support for Zen3 Ryzen APU. Signed-off-by: David Bartley Link: https://lore.kernel.org/r/20210517064131.4369-1-andareed@gmail.com Signed-off-by: Guenter Roeck commit 276281b8e89863f78cd21922a333fc319c0cc28d Author: Randy Dunlap Date: Tue Jul 27 16:20:54 2021 -0700 hwmon: sht4x: update Documentation for Malformed table Make top and bottom border lines match. Documentation/hwmon/sht4x.rst:42: WARNING: Malformed table. Text in column margin in table line 4. Fixes: 505c2549373f ("hwmon: Add sht4x Temperature and Humidity Sensor Driver") Signed-off-by: Randy Dunlap Cc: Navin Sankar Velliangiri Cc: Guenter Roeck Cc: Jean Delvare Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20210727232054.7426-1-rdunlap@infradead.org Signed-off-by: Guenter Roeck commit 8158da6a33f2656c2a98c30eb9185a44e215a6b6 Author: Mathew McBride Date: Fri Jul 9 04:45:18 2021 +0000 dt-bindings: rtc: add Epson RX-8025 and RX-8035 These are supported by the rtc-rx8025 module. RX-8025 also has support in ds1307 due to compatible time registers. Signed-off-by: Mathew McBride Reviewed-by: Nobuhiro Iwamatsu Acked-by: Rob Herring Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210709044518.28769-3-matt@traverse.com.au commit f120e2e33ac8ba1adac4f59eaf1ae1705305158f Author: Mathew McBride Date: Fri Jul 9 04:45:17 2021 +0000 rtc: rx8025: implement RX-8035 support The RX-8035 is a newer RTC from EPSON that is very similar to the RX-8025. The key difference is in the oscillation stop (XSTP) bit which is inverted on the RX-8035. Signed-off-by: Mathew McBride Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210709044518.28769-2-matt@traverse.com.au commit e1aba37569f0aa9c993f740828871e48eea79f98 Author: Mateusz Jończyk Date: Fri Jul 16 23:04:37 2021 +0200 rtc: cmos: remove stale REVISIT comments It appears mc146818_get_time() and mc146818_set_time() now correctly use the century register as specified in the ACPI FADT table. It is not clear what else could be done here. These comments were introduced by commit 7be2c7c96aff ("[PATCH] RTC framework driver for CMOS RTCs") in 2007, which originally referenced function get_rtc_time() in include/asm-generic/rtc.h . Signed-off-by: Mateusz Jończyk Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210716210437.29622-1-mat.jonczyk@o2.pl commit 8d448fa0a8bb1c8d94eef7647edffe9ac81a281e Author: Dmitry Osipenko Date: Sun Aug 8 19:00:30 2021 +0300 rtc: tps65910: Correct driver module alias The TPS65910 RTC driver module doesn't auto-load because of the wrong module alias that doesn't match the device name, fix it. Cc: stable@vger.kernel.org Reported-by: Anton Bambura Tested-by: Anton Bambura Signed-off-by: Dmitry Osipenko Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210808160030.8556-1-digetx@gmail.com commit 8cacfc85b615cc0bae01241593c4b25da6570efc Author: Colin Ian King Date: Tue Aug 17 18:08:42 2021 +0100 bpf: Remove redundant initialization of variable allow The variable allow is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817170842.495440-1-colin.king@canonical.com commit 04d23194674bf3cf5f6616f3ee4e51fc9305b7d9 Merge: 87bb11ccfe03f b16ac5bf732a5 Author: Andrii Nakryiko Date: Tue Aug 17 14:08:31 2021 -0700 Merge branch 'selftests/bpf: fix flaky send_signal test' Yonghong Song says: ==================== The bpf selftest send_signal() is flaky for its subtests trying to send signals in softirq/nmi context. To reduce flakiness, the signal-targetted process priority is boosted, which should minimize preemption of that process and improve the possibility that the underlying task in softirq/nmi context is the bpf_send_signal() wanted task. Patch #1 did a refactoring to use ASSERT_* instead of old CHECK macros. Patch #2 did actual change of boosting priority. Changelog: v1 -> v2: remove skip logic where the underlying task in interrupt context is not the intended one. ==================== Signed-off-by: Andrii Nakryiko commit b16ac5bf732a5e23d164cf908ec7742d6a6120d3 Author: Yonghong Song Date: Tue Aug 17 12:09:23 2021 -0700 selftests/bpf: Fix flaky send_signal test libbpf CI has reported send_signal test is flaky although I am not able to reproduce it in my local environment. But I am able to reproduce with on-demand libbpf CI ([1]). Through code analysis, the following is possible reason. The failed subtest runs bpf program in softirq environment. Since bpf_send_signal() only sends to a fork of "test_progs" process. If the underlying current task is not "test_progs", bpf_send_signal() will not be triggered and the subtest will fail. To reduce the chances where the underlying process is not the intended one, this patch boosted scheduling priority to -20 (highest allowed by setpriority() call). And I did 10 runs with on-demand libbpf CI with this patch and I didn't observe any failures. [1] https://github.com/libbpf/libbpf/actions/workflows/ondemand.yml Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817190923.3186725-1-yhs@fb.com commit 6f6cc426451bb15a85896efc7c85665b59af04ae Author: Yonghong Song Date: Tue Aug 17 12:09:18 2021 -0700 selftests/bpf: Replace CHECK with ASSERT_* macros in send_signal.c Replace CHECK in send_signal.c with ASSERT_* macros as ASSERT_* macros are generally preferred. There is no funcitonality change. Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817190918.3186400-1-yhs@fb.com commit 56f107d7813f116484019617043393a7753ffcbf Author: Amey Narkhede Date: Tue Aug 17 23:34:53 2021 +0530 PCI: Add pcie_reset_flr() with 'probe' argument Most reset methods are of the form "pci_*_reset(dev, probe)". pcie_flr() was an exception because it relied on a separate pcie_has_flr() function instead of taking a "probe" argument. Add "pcie_reset_flr(dev, probe)" to follow the convention. Remove pcie_has_flr(). Some pcie_flr() callers that did not use pcie_has_flr() remain. [bhelgaas: commit log, rework pcie_reset_flr() to use dev->devcap directly] Link: https://lore.kernel.org/r/20210817180500.1253-3-ameynarkhede03@gmail.com Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas Reviewed-by: Raphael Norwitz commit 69139244806537f9d51364f37fe146bb2ee88a05 Author: Amey Narkhede Date: Tue Aug 17 23:34:52 2021 +0530 PCI: Cache PCIe Device Capabilities register Add a new member called devcap in struct pci_dev for caching the PCIe Device Capabilities register to avoid reading PCI_EXP_DEVCAP multiple times. Refactor pcie_has_flr() to use cached device capabilities. Link: https://lore.kernel.org/r/20210817180500.1253-2-ameynarkhede03@gmail.com Signed-off-by: Amey Narkhede Signed-off-by: Bjorn Helgaas Reviewed-by: Raphael Norwitz commit 04853352952b7dd17f355ed54bd81305b341af55 Merge: 0dda8b013329a cdd3d945dcec0 Author: Linus Walleij Date: Tue Aug 17 21:58:41 2021 +0200 Merge tag 'samsung-pinctrl-5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v5.15 1. Fix number of pins in one GPIO pin bank. 2. Add support for Exynos850 SoC (Exynos3830). commit 99c37d1a63eafcd3673302a7953df760b46d0f6f Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:19 2021 +0200 tracing: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Link: https://lkml.kernel.org/r/20210803141621.780504-37-bigeasy@linutronix.de Cc: Peter Zijlstra Cc: Ingo Molnar Acked-by: Daniel Bristot de Oliveira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Steven Rostedt (VMware) commit 8d744da241b81f4211f4813b0d3c1981326fa9ca Author: Sergey Shtylyov Date: Thu Aug 12 23:39:11 2021 +0300 i2c: synquacer: fix deferred probing The driver overrides the error codes returned by platform_get_irq() to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 0d676a6c4390 ("i2c: add support for Socionext SynQuacer I2C controller") Signed-off-by: Sergey Shtylyov Acked-by: Ard Biesheuvel Signed-off-by: Wolfram Sang commit e47a0ced40472cfbe3e77502098ad489ba16bf97 Author: Len Baker Date: Tue Aug 17 18:58:59 2021 +0200 i2c: sun6i-pw2i: Prefer strscpy over strlcpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated. The safe replacement is strscpy(). This is a previous step in the path to remove the strlcpy() function entirely from the kernel [1]. [1] https://github.com/KSPP/linux/issues/89 Signed-off-by: Len Baker Signed-off-by: Wolfram Sang commit e517992bbce06228f07b9bbea3233cc0fb04e802 Author: Lukas Bulwahn Date: Tue Aug 17 09:11:26 2021 +0200 i2c: remove dead PMC MSP TWI/SMBus/I2C driver Commit 1b00767fd8e1 ("MIPS: Remove PMC MSP71xx platform") removes the config PMC_MSP in ./arch/mips/Kconfig. Hence, since then, the corresponding PMC MSP TWI/SMBus/I2C driver is dead code. Remove this dead driver. Signed-off-by: Lukas Bulwahn Signed-off-by: Wolfram Sang commit 76224355db7570cbe6b6f75c8929a1558828dd55 Author: Miklos Szeredi Date: Tue Aug 17 21:05:16 2021 +0200 fuse: truncate pagecache on atomic_o_trunc fuse_finish_open() will be called with FUSE_NOWRITE in case of atomic O_TRUNC. This can deadlock with fuse_wait_on_page_writeback() in fuse_launder_page() triggered by invalidate_inode_pages2(). Fix by replacing invalidate_inode_pages2() in fuse_finish_open() with a truncate_pagecache() call. This makes sense regardless of FOPEN_KEEP_CACHE or fc->writeback cache, so do it unconditionally. Reported-by: Xie Yongji Reported-and-tested-by: syzbot+bea44a5189836d956894@syzkaller.appspotmail.com Fixes: e4648309b85a ("fuse: truncate pending writes on O_TRUNC") Cc: Signed-off-by: Miklos Szeredi commit bbe1da7e34ac5a830163bfdfa09cbe3dadfda3ce Author: Chao Yu Date: Fri Aug 6 08:02:50 2021 +0800 f2fs: compress: do sanity check on cluster This patch adds f2fs_sanity_check_cluster() to support doing sanity check on cluster of compressed file, it will be triggered from below two paths: - __f2fs_cluster_blocks() - f2fs_map_blocks(F2FS_GET_BLOCK_FIEMAP) And it can detect below three kind of cluster insanity status. C: COMPRESS_ADDR N: NULL_ADDR or NEW_ADDR V: valid blkaddr *: any value 1. [*|C|*|*] 2. [C|*|C|*] 3. [C|N|N|V] Signed-off-by: Chao Yu [Nathan Chancellor: fix missing inline warning] Signed-off-by: Jaegeuk Kim commit b35d71b969096422f1c57d7c1394fe8b1cad9710 Author: Yangtao Li Date: Sun Aug 15 01:58:40 2021 +0800 f2fs: fix description about main_blkaddr node Don't leave a blank line, to keep the style consistent with other node descriptions. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 491f7f71e18411463f348beac1b6d99eb8f2c6c1 Author: Yangtao Li Date: Sat Aug 14 18:37:01 2021 +0800 f2fs: convert S_IRUGO to 0444 To fix: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b96d9b3b09f0427b289332c6f6bfbf747a19b654 Author: Chao Yu Date: Fri Aug 6 10:45:20 2021 +0800 f2fs: fix to keep compatibility of fault injection interface The value of FAULT_* macros and its description in f2fs.rst became inconsistent, fix this to keep compatibility of fault injection interface. Fixes: 67883ade7a98 ("f2fs: remove FAULT_ALLOC_BIO") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 324105775c1982aacbd2972b7024d8cc06474abe Author: Chao Yu Date: Mon Aug 9 08:24:48 2021 +0800 f2fs: support fault injection for f2fs_kmem_cache_alloc() This patch supports to inject fault into f2fs_kmem_cache_alloc(). Usage: a) echo 32768 > /sys/fs/f2fs//inject_type or b) mount -o fault_type=32768 Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4a4fc043f594d39edc976a3a3dce7c40ebb86f3f Author: Fengnan Chang Date: Mon Aug 9 10:21:04 2021 +0800 f2fs: compress: allow write compress released file after truncate to zero For compressed file, after release compress blocks, don't allow write direct, but we should allow write direct after truncate to zero. Reviewed-by: Chao Yu Signed-off-by: Fengnan Chang Signed-off-by: Jaegeuk Kim commit 45b6f75eab6aabf9d88933830f41f532d39f38d2 Author: David E. Box Date: Fri Aug 13 18:47:28 2021 -0700 platform/x86: intel_pmc_core: Prevent possibile overflow Substate priority levels are encoded in 4 bits in the LPM_PRI register. This value was used as an index to an array whose element size was less than 16, leading to the possibility of overflow should we read a larger than expected priority. In addition to the overflow, bad values could lead to incorrect state reporting. So rework the priority code to prevent the overflow and perform some validation of the register. Use the priority register values if they give an ordering of unique numbers between 0 and the maximum number of states. Otherwise, use a default ordering instead. Reported-by: Evgeny Novikov Signed-off-by: David E. Box Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210814014728.520856-1-david.e.box@linux.intel.com Signed-off-by: Hans de Goede commit 87bb11ccfe03f61ef66f0e3dcc7685ddf4798993 Merge: 857f75ea84570 74339a8f866cd Author: Andrii Nakryiko Date: Tue Aug 17 11:16:07 2021 -0700 Merge branch 'selftests/bpf: Improve the usability of test_progs' Yucong Sun says: ==================== This short series adds two new switches to test_progs, "-a" and "-d", adding support for both exact string matching, as well as '*' wildcards. It also cleans up the output to make it possible to generate allowlist/denylist using common cli tools. ==================== Signed-off-by: Andrii Nakryiko commit 74339a8f866cdcca3f701c859b43b538890d905b Author: Yucong Sun Date: Mon Aug 16 21:47:32 2021 -0700 selftests/bpf: Support glob matching for test selector. This patch adds '-a' and '-d' arguments supporting both exact string match as well as using '*' wildcard in test/subtests selection. '-a' and '-t' can co-exists, same as '-d' and '-b', in which case they just add to the list of allowed or denied test selectors. Caveat: Same as the current substring matching mechanism, test and subtest selector applies independently, 'a*/b*' will execute all tests matching "a*", and with subtest name matching "b*", but tests matching "a*" that has no subtests will also be executed. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817044732.3263066-5-fallentree@fb.com commit 99c4fd8b92b3dc6db1afa0e252d3054d501a03ca Author: Yucong Sun Date: Mon Aug 16 21:47:31 2021 -0700 selftests/bpf: Also print test name in subtest status message This patch add test name in subtest status message line, making it possible to grep ':OK' in the output to generate a list of passed test+subtest names, which can be processed to generate argument list to be used with "-a", "-d" exact string matching. Example: #1/1 align/mov:OK .. #1/12 align/pointer variable subtraction:OK #1 align:OK Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817044732.3263066-4-fallentree@fb.com commit f667d1d66760fcb27aee6c9964eefde39a464afe Author: Yucong Sun Date: Mon Aug 16 21:47:30 2021 -0700 selftests/bpf: Correctly display subtest skip status In skip_account(), test->skip_cnt is set to 0 at the end, this makes next print statement never display SKIP status for the subtest. This patch moves the accounting logic after the print statement, fixing the issue. This patch also added SKIP status display for normal tests. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817044732.3263066-3-fallentree@fb.com commit 26d82640d5ba2c3b32d79597be2dcf820ed78b16 Author: Yucong Sun Date: Mon Aug 16 21:47:29 2021 -0700 selftests/bpf: Skip loading bpf_testmod when using -l to list tests. When using "-l", test_progs often is executed as non-root user, load_bpf_testmod() will fail and output errors. This patch skips loading bpf testmod when "-l" is specified, making output cleaner. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817044732.3263066-2-fallentree@fb.com commit cbfa6f33e3a685c329d78e06b0cf1dcb23c9d849 Author: Lukas Bulwahn Date: Tue Aug 17 12:54:04 2021 +0200 clk: staging: correct reference to config IOMEM to config HAS_IOMEM Commit 0a0a66c984b3 ("clk: staging: Specify IOMEM dependency for Xilinx Clocking Wizard driver") introduces a dependency on the non-existing config IOMEM, which basically makes it impossible to include this driver into any build. Fortunately, ./scripts/checkkconfigsymbols.py warns: IOMEM Referencing files: drivers/staging/clocking-wizard/Kconfig The config for IOMEM support is called HAS_IOMEM. Correct this reference to the intended config. Fixes: 0a0a66c984b3 ("clk: staging: Specify IOMEM dependency for Xilinx Clocking Wizard driver") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210817105404.13146-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8f9172d26ca5e4892b09fa670357d195305e5541 Author: Phillip Potter Date: Tue Aug 17 00:44:58 2021 +0100 staging: r8188eu: remove unneeded DBG_88E call from rtl8188e_Add_RateATid Remove unneeded DBG_88E macro call from the rtl8188e_Add_RateATid function in hal/rtl8188e_cmd.c, as it is not particularly clear in my opinion, and we should strive towards use of existing kernel machinery for debugging purposes. Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210816234459.132239-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 25bcf747bdfdb413154a3d47985113474dc8133d Author: Phillip Potter Date: Tue Aug 17 00:44:57 2021 +0100 staging: r8188eu: remove set but unused variable from rtl8188e_Add_RateATid Remove set but unused variable init_rate from the rtl8188e_Add_RateATid function in hal/rtl8188eu_cmd.c, as this fixes a kernel test robot warning. Removing the call to get_highest_rate_idx has no side effects here so is safe. Reported-by: kernel test robot Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210816234459.132239-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 10e13123973bcde7c5d1d2a37a38e4c69a973e98 Author: Michael Straube Date: Mon Aug 16 23:10:53 2021 +0200 staging: r8188eu: clean up spacing style issues in os_dep dir Clean up spacing style issues reported by checkpatch in the os_dep directory. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited before semicolon WARNING: space prohibited between function name and open parenthesis '(' ERROR: spaces required around that '=' (ctx:VxV) Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816211053.31728-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 47a0bab3d95f6897b35eba7279441df4f4d5cc29 Author: Michael Straube Date: Mon Aug 16 22:55:11 2021 +0200 staging: r8188eu: clean up spacing style issues in hal dir, part 3 Clean up spacing style issues reported by checkpatch in the remaining files in the hal directory. CHECK: spaces preferred around that ... Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816205511.20068-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ea105f21c94fd3d40865ba6a4d1e61a310e86336 Author: Michael Straube Date: Mon Aug 16 22:55:10 2021 +0200 staging: r8188eu: clean up spacing style issues in hal dir, part 2 Clean up spacing style issues reported by checkpatch in the next 10 files in the hal directory. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited before semicolon WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816205511.20068-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 550b1cda158c8472984f1e7f86478f154c16a7d3 Author: Michael Straube Date: Mon Aug 16 22:55:09 2021 +0200 staging: r8188eu: clean up spacing style issues in hal dir, part 1 Clean up spacing style issues reported by checkpatch in the first 10 files in the hal directory. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816205511.20068-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 438bb20f00a738c38bf148e134efcfb394d73191 Author: Michael Straube Date: Mon Aug 16 17:58:17 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_sta_mgt.c Clean up spacing style issues in core/rtw_sta_mgt.c reported by checkpatch. WARNING: space prohibited between function name and open parenthesis '(' CHECK: spaces preferred around that '/' (ctx:VxV) WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-23-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3ec10b9d8ead9accdf7c46ade5ab0eca6ff9e2eb Author: Michael Straube Date: Mon Aug 16 17:58:16 2021 +0200 staging: r8188eu: add space around operator in core/rtw_sreset.c Add missing space around operator in core/rtw_sreset.c reported by checkpatch. CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-22-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 77cb924ec6913d3b46816dc964d83c9a775eaba0 Author: Michael Straube Date: Mon Aug 16 17:58:15 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_debug.c Clean up spacing style issues in core/rtw_debug.c reported by checkpatch. CHECK: spaces preferred around that '%' (ctx:VxV) WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-21-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6b6fdf7341d5532e17ca152947ac3a9bdbdcf388 Author: Michael Straube Date: Mon Aug 16 17:58:14 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_xmit.c Clean up spacing style issues in core/rtw_xmit.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-20-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2dcdb9d1a6f670a04b0ca6492efb011254c7b44a Author: Michael Straube Date: Mon Aug 16 17:58:13 2021 +0200 staging: r8188eu: add spaces around operators in core/rtw_wlan_util.c Add missung spaces around operators in core/rtw_wlan_util.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-19-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 88a924bf3f8e895a45a88b6a1178afc580c8f94c Author: Michael Straube Date: Mon Aug 16 17:58:12 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_security.c Clean up spacing style issues in core/rtw_security.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-18-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7527c5ea758cc5219bdf1844c669048653b6c9c8 Author: Michael Straube Date: Mon Aug 16 17:58:11 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_recv.c Clean up spacing style issues in core/rtw_recv.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-17-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 63852ff22d8a6159de4e74b54ca74c1320140e7c Author: Michael Straube Date: Mon Aug 16 17:58:10 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_pwrctrl.c Clean up spacing style issues in core/rtw_pwrctrl.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-16-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 58bd6fc51411f5cfe2817318c5e6801c46b1243f Author: Michael Straube Date: Mon Aug 16 17:58:09 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_p2p.c Clean up spacing style issues in core/rtw_p2p.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited before semicolon WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-15-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0296ded555ba48711ba04737fd3fb2971b67eaa6 Author: Michael Straube Date: Mon Aug 16 17:58:08 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_mp_ioctl.c Clean up spacing style issues in core/rtw_mp_ioctl.c reported by checkpatch. CHECK: spaces preferred around that '|' (ctx:VxV) WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-14-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61249f2268b5e309bbfb9ed148efb134360fbc24 Author: Michael Straube Date: Mon Aug 16 17:58:07 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_mp.c Clean up spacing style issues in core/rtw_mp.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-13-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4257c1c3b0fcb573aba7055db32d00567aac0083 Author: Michael Straube Date: Mon Aug 16 17:58:06 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_mlme_ext.c Clean up spacing style issues in core/rtw_mlme_ext.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c891e014b5796e84a6240e25ec51157d5dd9c8ff Author: Michael Straube Date: Mon Aug 16 17:58:05 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_mlme.c Clean up spacing style issues in core/rtw_mlme.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 174b79fcd0719e515e4dd3f57c33727998cbfc18 Author: Michael Straube Date: Mon Aug 16 17:58:04 2021 +0200 staging: r8188eu: add spaces around operators in core/rtw_iol.c Add missing spaces around operators in core/rtw_iol.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 292c8398d17537340aefe9b833be548286f8d839 Author: Michael Straube Date: Mon Aug 16 17:58:03 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_ioctl_set.c Clean up spacing style issues in core/rtw_ioctl_set.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 35f1fa01c1c2e829f12e03d49c71f2c5625c6c0d Author: Michael Straube Date: Mon Aug 16 17:58:02 2021 +0200 staging: r8188eu: simplify multiplication in core/rtw_ioctl_set.c Simplify multiplication in core/rtw_ioctl_set.c. to improve readability and clear a checkpatch issue. CHECK: spaces preferred around that '/' (ctx:VxV) Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4842e46f703c484598cf055ae4bc108fdf4b26d6 Author: Michael Straube Date: Mon Aug 16 17:58:01 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_ieee80211.c Clean up spacing style issues in core/rtw_ieee80211.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d8f67a53a2a2b82a33ff71f0fa310a3dae9f3f1 Author: Michael Straube Date: Mon Aug 16 17:58:00 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_efuse.c Clean up spacing style issues in core/rtw_efuse.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited before semicolon Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 575da340cdb6aa9b4aa331d95c8a470ea976fe0f Author: Michael Straube Date: Mon Aug 16 17:57:59 2021 +0200 staging: r8188eu: clean up spacing style issues in core/rtw_cmd.c Clean up spacing style issues in core/rtw_cmd.c reported by checkpatch. CHECK: spaces preferred around that ... CHECK: No space is necessary after a cast WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8ccacd41b6d6f7f06fa1a4f602c8fd3e6ad51237 Author: Michael Straube Date: Mon Aug 16 17:57:58 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c Remove unnecessary parentheses in core/rtw_cmd.c. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f1249cfdb35854d1a29b825f53a73cde8ed2b2a2 Author: Michael Straube Date: Mon Aug 16 17:57:57 2021 +0200 staging: r8188eu: rewrite subtraction in core/rtw_cmd.c Rewrite subtraction in core/rtw_cmd.c to clear missing spaces around operator reported by checkpatch. 256-1 -> 255 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8694ef2d90b221cbe7ee67e1edc04414c05999ca Author: Michael Straube Date: Mon Aug 16 17:57:56 2021 +0200 staging: r8188eu: add spaces around operators in core/rtw_ap.c Add missing spaces around operators in core/rtw_ap.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210816155818.24005-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bdb0a6548d2233dada752109a71bcf4c9b8ae6d6 Author: Lai Jiangshan Date: Tue Aug 17 09:32:39 2021 +0800 workqueue: Remove unused WORK_NO_COLOR WORK_NO_COLOR has no user now, just remove it. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit d812796eb3906424cd3c0eea530983961e2f88bd Author: Lai Jiangshan Date: Tue Aug 17 09:32:38 2021 +0800 workqueue: Assign a color to barrier work items There was no strong reason to or not to flush barrier work items in flush_workqueue(). And we have to make barrier work items not participate in nr_active so we had been using WORK_NO_COLOR for them which also makes them can't be flushed by flush_workqueue(). And the users of flush_workqueue() often do not intend to wait barrier work items issued by flush_work(). That made the choice sound perfect. But barrier work items have reference to internal structure (pool_workqueue) and the worker thread[s] is/are still busy for the workqueue user when the barrrier work items are not done. So it is reasonable to make flush_workqueue() also watch for flush_work() to make it more robust. And a problem[1] reported by Li Zhe shows that we need such robustness. The warning logs are listed below: WARNING: CPU: 0 PID: 19336 at kernel/workqueue.c:4430 destroy_workqueue+0x11a/0x2f0 ***** destroy_workqueue: test_workqueue9 has the following busy pwq pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=0/1 refcnt=2 in-flight: 5658:wq_barrier_func Showing busy workqueues and worker pools: ***** It shows that even after drain_workqueue() returns, the barrier work item is still in flight and the pwq (and a worker) is still busy on it. The problem is caused by flush_workqueue() not watching flush_work(): Thread A Worker /* normal work item with linked */ process_scheduled_works() destroy_workqueue() process_one_work() drain_workqueue() /* run normal work item */ /-- pwq_dec_nr_in_flight() flush_workqueue() <---/ /* the last normal work item is done */ sanity_check process_one_work() /-- raw_spin_unlock_irq(&pool->lock) raw_spin_lock_irq(&pool->lock) <-/ /* maybe preempt */ *WARNING* wq_barrier_func() /* maybe preempt by cond_resched() */ Thread A can get the pool lock after the Worker unlocks the pool lock before running wq_barrier_func(). And if there is any preemption happen around wq_barrier_func(), destroy_workqueue()'s sanity check is more likely to get the lock and catch it. (Note: preemption is not necessary to cause the bug, the unlocking is enough to possibly trigger the WARNING.) A simple solution might be just executing all linked barrier work items once without releasing pool lock after the head work item's pwq_dec_nr_in_flight(). But this solution has two problems: 1) the head work item might also be barrier work item when the user-queued work item is cancelled. For example: thread 1: thread 2: queue_work(wq, &my_work) flush_work(&my_work) cancel_work_sync(&my_work); /* Neiter my_work nor the barrier work is scheduled. */ destroy_workqueue(wq); /* This is an easier way to catch the WARNING. */ 2) there might be too much linked barrier work items and running them all once without releasing pool lock just causes trouble. The only solution is to make flush_workqueue() aslo watch barrier work items. So we have to assign a color to these barrier work items which is the color of the head (user-queued) work item. Assigning a color doesn't cause any problem in ative management, because the prvious patch made barrier work items not participate in nr_active via WORK_STRUCT_INACTIVE rather than reliance on the (old) WORK_NO_COLOR. [1]: https://lore.kernel.org/lkml/20210812083814.32453-1-lizhe.67@bytedance.com/ Reported-by: Li Zhe Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 018f3a13dd6300701103f268b6bfec0a56beea57 Author: Lai Jiangshan Date: Tue Aug 17 09:32:37 2021 +0800 workqueue: Mark barrier work with WORK_STRUCT_INACTIVE Currently, WORK_NO_COLOR has two meanings: Not participate in flushing Not participate in nr_active And only non-barrier work items are marked with WORK_STRUCT_INACTIVE when they are in inactive_works list. The barrier work items are not marked INACTIVE even linked in inactive_works list since these tail items are always moved together with the head work item. These definitions are simple, clean and practical. (Except a small blemish that only the first meaning of WORK_NO_COLOR is documented in include/linux/workqueue.h while both meanings are in workqueue.c) But dual-purpose WORK_NO_COLOR used for barrier work items has proven to be problematical[1]. Only the second purpose is obligatory. So we plan to make barrier work items participate in flushing but keep them still not participating in nr_active. So the plan is to mark barrier work items inactive without using WORK_NO_COLOR in this patch so that we can assign a flushing color to them in next patch. The reasonable way is to add or reuse a bit in work data of the work item. But adding a bit will double the size of pool_workqueue. Currently, WORK_STRUCT_INACTIVE is only used in try_to_grab_pending() for user-queued work items and try_to_grab_pending() can't work for barrier work items. So we extend WORK_STRUCT_INACTIVE to also mark barrier work items no matter which list they are in because we don't need to determind which list a barrier work item is in. So the meaning of WORK_STRUCT_INACTIVE becomes just "the work items don't participate in nr_active" (no matter whether it is a barrier work item or a user-queued work item). And WORK_STRUCT_INACTIVE for user-queued work items means they are in inactive_works list. This patch does it by setting WORK_STRUCT_INACTIVE for barrier work items in insert_wq_barrier() and checking WORK_STRUCT_INACTIVE first in pwq_dec_nr_in_flight(). And the meaning of WORK_NO_COLOR is reduced to only "not participating in flushing". There is no functionality change intended in this patch. Because WORK_NO_COLOR+WORK_STRUCT_INACTIVE represents the previous WORK_NO_COLOR in meaning and try_to_grab_pending() doesn't use for barrier work items and avoids being confused by this extended WORK_STRUCT_INACTIVE. A bunch of comment for nr_active & WORK_STRUCT_INACTIVE is also added for documenting how WORK_STRUCT_INACTIVE works in nr_active management. [1]: https://lore.kernel.org/lkml/20210812083814.32453-1-lizhe.67@bytedance.com/ Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit d21cece0dbb424ad3ff9e49bde6954632b8efede Author: Lai Jiangshan Date: Tue Aug 17 09:32:36 2021 +0800 workqueue: Change the code of calculating work_flags in insert_wq_barrier() Add a local var @work_flags to calculate work_flags step by step, so that we don't need to squeeze several flags in only the last line of code. Parepare for next patch to add a bit to barrier work item's flag. Not squshing this to next patch makes it clear that what it will have changed. No functional change intended. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit c4560c2c88a4c809800ba8e76faabaf80bf6ee89 Author: Lai Jiangshan Date: Tue Aug 17 09:32:35 2021 +0800 workqueue: Change arguement of pwq_dec_nr_in_flight() Make pwq_dec_nr_in_flight() use work_data rather just work_color. Prepare for later patch to get WORK_STRUCT_INACTIVE bit from work_data in pwq_dec_nr_in_flight(). No functional change intended. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit f97a4a1a3f8769e3452885967955e21c88f3f263 Author: Lai Jiangshan Date: Tue Aug 17 09:32:34 2021 +0800 workqueue: Rename "delayed" (delayed by active management) to "inactive" There are two kinds of "delayed" work items in workqueue subsystem. One is for timer-delayed work items which are visible to workqueue users. The other kind is for work items delayed by active management which can not be directly visible to workqueue users. We mixed the word "delayed" for both kinds and caused somewhat ambiguity. This patch renames the later one (delayed by active management) to "inactive", because it is used for workqueue active management and most of its related symbols are named with "active" or "activate". All "delayed" and "DELAYED" are carefully checked and renamed one by one to avoid accidentally changing the name of the other kind for timer-delayed. No functional change intended. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 9d9d90a9af5472e0698cc5fb7b2acc37e5837c95 Merge: 9caf92ab573fd d484c21bacfa8 Author: Greg Kroah-Hartman Date: Tue Aug 17 19:48:42 2021 +0200 Merge tag 'iio-for-5.15b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd set of new IIO device support and cleanups for the 5.15 cycle. A small pull request to pick up a few new drivers and some cleanup and fix patches. New device support * ad5110 non-volatile digital potentiometer - New driver * renesas rzl/gl2 12-bit / 8 channel ADC block - New driver and bindings Minor or late breaking fixes and cleanups * ltc2983 - Fix a false assumption of initial interrupt during probe(). * hp03 - Use devm_* to simplify probe and allow the remove function to be dropped. * rockchip_saradc - Use a regulator notifier to reduce overheads of querying the scale. * tag 'iio-for-5.15b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: adc: Add driver for Renesas RZ/G2L A/D converter dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L A/D converter iio: pressure: hp03: update device probe to register with devm functions iio: adc: rockchip_saradc: add voltage notifier so get referenced voltage once at probe iio: ltc2983: fix device probe iio: potentiometer: Add driver support for AD5110 dt-bindings: iio: potentiometer: Add AD5110 in trivial-devices commit 6e9078a667a36455afb438346c693590b3c975cf Author: Colin Ian King Date: Tue Jul 27 18:33:18 2021 +0100 i40e: Fix spelling mistake "dissable" -> "disable" There is a spelling mistake in a dev_info message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Tony Nguyen commit 9ae6ab27f44ee0da47520011afc04218f90e8b12 Author: Peter Zijlstra Date: Thu Aug 5 17:49:54 2021 +0200 static_call: Update API documentation Update the comment with the new features. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Steven Rostedt (VMware) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/YQwIorQBHEq+s73b@hirez.programming.kicks-ass.net commit 026659b9774e4c586baeb457557fcfc4e0ad144b Author: Thomas Gleixner Date: Sun Aug 15 23:29:28 2021 +0200 locking/local_lock: Add PREEMPT_RT support On PREEMPT_RT enabled kernels local_lock maps to a per CPU 'sleeping' spinlock which protects the critical section while staying preemptible. CPU locality is established by disabling migration. Provide the necessary types and macros to substitute the non-RT variant. Co-developed-by: Sebastian Andrzej Siewior Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211306.023630962@linutronix.de commit 31552385f8e9d0869117014bf8e55ba0497e3ec8 Author: Thomas Gleixner Date: Sun Aug 15 23:29:27 2021 +0200 locking/spinlock/rt: Prepare for RT local_lock Add the static and runtime initializer mechanics to support the RT variant of local_lock, which requires the lock type in the lockdep map to be set to LD_LOCK_PERCPU. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.967526724@linutronix.de commit 992caf7f17243d736fc996770bac6566103778f6 Author: Steven Rostedt Date: Sun Aug 15 23:29:25 2021 +0200 locking/rtmutex: Add adaptive spinwait mechanism Going to sleep when locks are contended can be quite inefficient when the contention time is short and the lock owner is running on a different CPU. The MCS mechanism cannot be used because MCS is strictly FIFO ordered while for rtmutex based locks the waiter ordering is priority based. Provide a simple adaptive spinwait mechanism which currently restricts the spinning to the top priority waiter. [ tglx: Provide a contemporary changelog, extended it to all rtmutex based locks and updated it to match the other spin on owner implementations ] Originally-by: Gregory Haskins Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.912050691@linutronix.de commit 48eb3f4fcfd35495a8357459aa6fe437aa430b00 Author: Gregory Haskins Date: Sun Aug 15 23:29:23 2021 +0200 locking/rtmutex: Implement equal priority lock stealing The current logic only allows lock stealing to occur if the current task is of higher priority than the pending owner. Significant throughput improvements can be gained by allowing the lock stealing to include tasks of equal priority when the contended lock is a spin_lock or a rw_lock and the tasks are not in a RT scheduling task. The assumption was that the system will make faster progress by allowing the task already on the CPU to take the lock rather than waiting for the system to wake up a different task. This does add a degree of unfairness, but in reality no negative side effects have been observed in the many years that this has been used in the RT kernel. [ tglx: Refactored and rewritten several times by Steve Rostedt, Sebastian Siewior and myself ] Signed-off-by: Gregory Haskins Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.857240222@linutronix.de commit 015680aa4c5d784513d0a9728bc52ec7c4a64227 Author: Thomas Gleixner Date: Sun Aug 15 23:29:22 2021 +0200 preempt: Adjust PREEMPT_LOCK_OFFSET for RT On PREEMPT_RT regular spinlocks and rwlocks are substituted with rtmutex based constructs. spin/rwlock held regions are preemptible on PREEMPT_RT, so PREEMPT_LOCK_OFFSET has to be 0 to make the various cond_resched_*lock() functions work correctly. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.804246275@linutronix.de commit 51711e825a6d1b2fe7ca46bb06d08c25d97656ee Author: Thomas Gleixner Date: Sun Aug 15 23:29:20 2021 +0200 locking/rtmutex: Prevent lockdep false positive with PI futexes On PREEMPT_RT the futex hashbucket spinlock becomes 'sleeping' and rtmutex based. That causes a lockdep false positive because some of the futex functions invoke spin_unlock(&hb->lock) with the wait_lock of the rtmutex associated to the pi_futex held. spin_unlock() in turn takes wait_lock of the rtmutex on which the spinlock is based which makes lockdep notice a lock recursion. Give the futex/rtmutex wait_lock a separate key. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.750701219@linutronix.de commit 07d91ef510fb16a2e0ca7453222105835b7ba3b8 Author: Thomas Gleixner Date: Sun Aug 15 23:29:18 2021 +0200 futex: Prevent requeue_pi() lock nesting issue on RT The requeue_pi() operation on RT kernels creates a problem versus the task::pi_blocked_on state when a waiter is woken early (signal, timeout) and that early wake up interleaves with the requeue_pi() operation. When the requeue manages to block the waiter on the rtmutex which is associated to the second futex, then a concurrent early wakeup of that waiter faces the problem that it has to acquire the hash bucket spinlock, which is not an issue on non-RT kernels, but on RT kernels spinlocks are substituted by 'sleeping' spinlocks based on rtmutex. If the hash bucket lock is contended then blocking on that spinlock would result in a impossible situation: blocking on two locks at the same time (the hash bucket lock and the rtmutex representing the PI futex). It was considered to make the hash bucket locks raw_spinlocks, but especially requeue operations with a large amount of waiters can introduce significant latencies, so that's not an option for RT. The RT tree carried a solution which (ab)used task::pi_blocked_on to store the information about an ongoing requeue and an early wakeup which worked, but required to add checks for these special states all over the place. The distangling of an early wakeup of a waiter for a requeue_pi() operation is already looking at quite some different states and the task::pi_blocked_on magic just expanded that to a hard to understand 'state machine'. This can be avoided by keeping track of the waiter/requeue state in the futex_q object itself. Add a requeue_state field to struct futex_q with the following possible states: Q_REQUEUE_PI_NONE Q_REQUEUE_PI_IGNORE Q_REQUEUE_PI_IN_PROGRESS Q_REQUEUE_PI_WAIT Q_REQUEUE_PI_DONE Q_REQUEUE_PI_LOCKED The waiter starts with state = NONE and the following state transitions are valid: On the waiter side: Q_REQUEUE_PI_NONE -> Q_REQUEUE_PI_IGNORE Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_WAIT On the requeue side: Q_REQUEUE_PI_NONE -> Q_REQUEUE_PI_INPROGRESS Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_DONE/LOCKED Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_NONE (requeue failed) Q_REQUEUE_PI_WAIT -> Q_REQUEUE_PI_DONE/LOCKED Q_REQUEUE_PI_WAIT -> Q_REQUEUE_PI_IGNORE (requeue failed) The requeue side ignores a waiter with state Q_REQUEUE_PI_IGNORE as this signals that the waiter is already on the way out. It also means that the waiter is still on the 'wait' futex, i.e. uaddr1. The waiter side signals early wakeup to the requeue side either through setting state to Q_REQUEUE_PI_IGNORE or to Q_REQUEUE_PI_WAIT depending on the current state. In case of Q_REQUEUE_PI_IGNORE it can immediately proceed to take the hash bucket lock of uaddr1. If it set state to WAIT, which means the wakeup is interleaving with a requeue in progress it has to wait for the requeue side to change the state. Either to DONE/LOCKED or to IGNORE. DONE/LOCKED means the waiter q is now on the uaddr2 futex and either blocked (DONE) or has acquired it (LOCKED). IGNORE is set by the requeue side when the requeue attempt failed via deadlock detection and therefore the waiter's futex_q is still on the uaddr1 futex. While this is not strictly required on !RT making this unconditional has the benefit of common code and it also allows the waiter to avoid taking the hash bucket lock on the way out in certain cases, which reduces contention. Add the required helpers required for the state transitions, invoke them at the right places and restructure the futex_wait_requeue_pi() code to handle the return from wait (early or not) based on the state machine values. On !RT enabled kernels the waiter spin waits for the state going from Q_REQUEUE_PI_WAIT to some other state, on RT enabled kernels this is handled by rcuwait_wait_event() and the corresponding wake up on the requeue side. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.693317658@linutronix.de commit 6231acbd0802e76580c71ceb52c09646d42170fb Author: Thomas Gleixner Date: Sun Aug 15 23:29:17 2021 +0200 futex: Simplify handle_early_requeue_pi_wakeup() Move the futex key match out of handle_early_requeue_pi_wakeup() which allows to simplify that function. The upcoming state machine for requeue_pi() will make that go away. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.638938670@linutronix.de commit d69cba5c719b0c551f6380ec5da4ed8c20a3815a Author: Thomas Gleixner Date: Sun Aug 15 23:29:15 2021 +0200 futex: Reorder sanity checks in futex_requeue() No point in allocating memory when the input parameters are bogus. Validate all parameters before proceeding. Suggested-by: Davidlohr Bueso Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.581789253@linutronix.de commit c18eaa3aca43688a3aee199d85ce4227686a29b6 Author: Thomas Gleixner Date: Sun Aug 15 23:29:14 2021 +0200 futex: Clarify comment in futex_requeue() The comment about the restriction of the number of waiters to wake for the REQUEUE_PI case is confusing at best. Rewrite it. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.524990421@linutronix.de commit 64b7b715f7f92ae3233446b4a4cdda3524fcd4b0 Author: Thomas Gleixner Date: Sun Aug 15 23:29:12 2021 +0200 futex: Restructure futex_requeue() No point in taking two more 'requeue_pi' conditionals just to get to the requeue. Same for the requeue_pi case just the other way round. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.468835790@linutronix.de commit 59c7ecf1544e1841b5be8847e81bc9842f838e7e Author: Thomas Gleixner Date: Sun Aug 15 23:29:10 2021 +0200 futex: Correct the number of requeued waiters for PI The accounting is wrong when either the PI sanity check or the requeue PI operation fails. Adjust it in the failure path. Will be simplified in the next step. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.416427548@linutronix.de commit 8e74633dcefb280f2cefb49b7201d99650243d96 Author: Thomas Gleixner Date: Sun Aug 15 23:29:09 2021 +0200 futex: Remove bogus condition for requeue PI For requeue PI it's required to establish PI state for the PI futex to which waiters are requeued. This either acquires the user space futex on behalf of the top most waiter on the inner 'waitqueue' futex, or attaches to the PI state of an existing waiter, or creates on attached to the owner of the futex. This code can retry in case of failure, but retry can never happen when the pi state was successfully created. The condition to run this code is: (task_count - nr_wake) < nr_requeue which is always true because: task_count = 0 nr_wake = 1 nr_requeue >= 0 Remove it completely. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.362730187@linutronix.de commit f6f4ec00b57a2c950235435bff8e888daafad5af Author: Thomas Gleixner Date: Sun Aug 15 23:29:07 2021 +0200 futex: Clarify futex_requeue() PI handling When requeuing to a PI futex, then the requeue code tries to trylock the PI futex on behalf of the topmost waiter on the inner 'waitqueue' futex. If that succeeds, then PI state has to be allocated in order to requeue further waiters to the PI futex. The comment and the code are confusing, as the PI state allocation uses lookup_pi_state(), which either attaches to an existing waiter or to the owner. As the PI futex was just acquired, there cannot be a waiter on the PI futex because the hash bucket lock is held. Clarify the comment and use attach_to_pi_owner() directly. As the task on which behalf the PI futex has been acquired is guaranteed to be alive and not exiting, this call must succeed. Add a WARN_ON() in case that fails. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.305142462@linutronix.de commit c363b7ed79253d5b53494197f6ae625cff64694f Author: Thomas Gleixner Date: Sun Aug 15 23:29:06 2021 +0200 futex: Clean up stale comments The futex key reference mechanism is long gone. Clean up the stale comments which still mention it. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.249178312@linutronix.de commit dc7109aaa233d83b573f75763a9f1ae207042a53 Author: Thomas Gleixner Date: Sun Aug 15 23:29:04 2021 +0200 futex: Validate waiter correctly in futex_proxy_trylock_atomic() The loop in futex_requeue() has a sanity check for the waiter, which is missing in futex_proxy_trylock_atomic(). In theory the key2 check is sufficient, but futexes are cursed so add it for completeness and paranoia sake. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.193767519@linutronix.de commit c49f7ece4617807c5de06857d196c825aadf60d5 Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:29:03 2021 +0200 lib/test_lockup: Adapt to changed variables The inner parts of certain locks (mutex, rwlocks) changed due to a rework for RT and non RT code. Most users remain unaffected, but those who fiddle around in the inner parts need to be updated. Match the struct names to the new layout. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.137982730@linutronix.de commit bb630f9f7a7d43869e4e7f5e4c002207396aea59 Author: Thomas Gleixner Date: Sun Aug 15 23:29:01 2021 +0200 locking/rtmutex: Add mutex variant for RT Add the necessary defines, helpers and API functions for replacing struct mutex on a PREEMPT_RT enabled kernel with an rtmutex based variant. No functional change when CONFIG_PREEMPT_RT=n Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.081517417@linutronix.de commit f8635d509d807c0a9deb273e19bc5a8a19c52895 Author: Peter Zijlstra Date: Sun Aug 15 23:29:00 2021 +0200 locking/ww_mutex: Implement rtmutex based ww_mutex API functions Add the actual ww_mutex API functions which replace the mutex based variant on RT enabled kernels. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211305.024057938@linutronix.de commit add461325ec5bc39aa619a1bfcde7245e5f31ac7 Author: Peter Zijlstra Date: Sun Aug 15 23:28:58 2021 +0200 locking/rtmutex: Extend the rtmutex core to support ww_mutex Add a ww acquire context pointer to the waiter and various functions and add the ww_mutex related invocations to the proper spots in the locking code, similar to the mutex based variant. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.966139174@linutronix.de commit 2408f7a3782a6bfa69a573f5408b3a9666db78ca Author: Peter Zijlstra Date: Sun Aug 15 23:28:56 2021 +0200 locking/ww_mutex: Add rt_mutex based lock type and accessors Provide the defines for RT mutex based ww_mutexes and fix up the debug logic so it's either enabled by DEBUG_MUTEXES or DEBUG_RT_MUTEXES on RT kernels. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.908012566@linutronix.de commit 8850d773703f8114d7c8a2421fd20bde8a558f96 Author: Peter Zijlstra Date: Sun Aug 15 23:28:55 2021 +0200 locking/ww_mutex: Add RT priority to W/W order RT mutex based ww_mutexes cannot order based on timestamps. They have to order based on priority. Add the necessary decision logic. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.847536630@linutronix.de commit dc4564f5dc2d4b11f3f3c8d3ac94012b1c7347d6 Author: Peter Zijlstra Date: Sun Aug 15 23:28:53 2021 +0200 locking/ww_mutex: Implement rt_mutex accessors Provide the type defines and the helper inlines for rtmutex based ww_mutexes. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.790760545@linutronix.de commit 653a5b0bd9b405db999d5f4bfe08d34691e2c55a Author: Thomas Gleixner Date: Sun Aug 15 23:28:52 2021 +0200 locking/ww_mutex: Abstract out internal lock accesses Accessing the internal wait_lock of mutex and rtmutex is slightly different. Provide helper functions for that. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.734635961@linutronix.de commit bdb189148ded4ffa826a1387074c795fda43b3ba Author: Peter Zijlstra Date: Sun Aug 15 23:28:50 2021 +0200 locking/ww_mutex: Abstract out mutex types Some ww_mutex helper functions use pointers for the underlying mutex and mutex_waiter. The upcoming rtmutex based implementation needs to share these functions. Add and use defines for the types and replace the direct types in the affected functions. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.678720245@linutronix.de commit 9934ccc75cec2bafac552c2130835630530c4f7e Author: Peter Zijlstra Date: Sun Aug 15 23:28:49 2021 +0200 locking/ww_mutex: Abstract out mutex accessors Move the mutex related access from various ww_mutex functions into helper functions so they can be substituted for rtmutex based ww_mutex later. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.622477030@linutronix.de commit 843dac28f90ef80535b0aee0b78446f1770c8611 Author: Peter Zijlstra Date: Sun Aug 15 23:28:47 2021 +0200 locking/ww_mutex: Abstract out waiter enqueueing The upcoming rtmutex based ww_mutex needs a different handling for enqueueing a waiter. Split it out into a helper function. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.566318143@linutronix.de commit 23d599eb2377404100d0d1508e12b0a2c40b49b1 Author: Peter Zijlstra Date: Sun Aug 15 23:28:45 2021 +0200 locking/ww_mutex: Abstract out the waiter iteration Split out the waiter iteration functions so they can be substituted for a rtmutex based ww_mutex later. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.509186185@linutronix.de commit 5297ccb2c50916c59294a63fae79fe01a7fbb79a Author: Peter Zijlstra Date: Sun Aug 15 23:28:44 2021 +0200 locking/ww_mutex: Remove the __sched annotation from ww_mutex APIs None of these functions will be on the stack when blocking in schedule(), hence __sched is not needed. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.453235952@linutronix.de commit 2674bd181f3338dc2c58a59caa766dc9d5779784 Author: Peter Zijlstra (Intel) Date: Tue Aug 17 16:31:54 2021 +0200 locking/ww_mutex: Split out the W/W implementation logic into kernel/locking/ww_mutex.h Split the W/W mutex helper functions out into a separate header file, so they can be shared with a rtmutex based variant later. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.396893399@linutronix.de commit aaa77de10b7c86fa779b2108802fa9e785fbe2e9 Author: Peter Zijlstra (Intel) Date: Tue Aug 17 16:19:04 2021 +0200 locking/ww_mutex: Split up ww_mutex_unlock() Split the ww related part out into a helper function so it can be reused for a rtmutex based ww_mutex implementation. [ mingo: Fixed bisection failure. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.340166556@linutronix.de commit c0afb0ffc06e6b4e492a3b711f1fb32074f9949c Author: Peter Zijlstra Date: Sun Aug 15 23:28:39 2021 +0200 locking/ww_mutex: Gather mutex_waiter initialization Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.281927514@linutronix.de commit cf702eddcd03dca3184947170930bf284aea27e9 Author: Peter Zijlstra Date: Sun Aug 15 23:28:38 2021 +0200 locking/ww_mutex: Simplify lockdep annotations No functional change. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.222921634@linutronix.de commit ebf4c55c1ddbabaea120fe8d48ce25b4f5da93a1 Author: Thomas Gleixner Date: Sun Aug 15 23:28:36 2021 +0200 locking/mutex: Make mutex::wait_lock raw The wait_lock of mutex is really a low level lock. Convert it to a raw_spinlock like the wait_lock of rtmutex. [ mingo: backmerged the test_lockup.c build fix by bigeasy. ] Co-developed-by: Sebastian Andrzej Siewior Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.166863404@linutronix.de commit 5ac49f3c2702f269d31cc37eb9308bc557953c4d Author: Stefan Assmann Date: Wed Aug 4 10:22:24 2021 +0200 iavf: use mutexes for locking of critical sections As follow-up to the discussion with Jakub Kicinski about iavf locking being insufficient [1] convert iavf to use mutexes instead of bitops. The locking logic is kept as is, just a drop-in replacement of enum iavf_critical_section_t with separate mutexes. The only difference is that the mutexes will be destroyed before the module is unloaded. [1] https://lwn.net/ml/netdev/20210316150210.00007249%40intel.com/ Signed-off-by: Stefan Assmann Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen commit 0792ec82175ec45a0f45af6e0f2d3cb49c527cd4 Author: Evgeny Novikov Date: Tue Aug 17 12:29:30 2021 +0300 mtd: rawnand: intel: Fix error handling in probe ebu_nand_probe() did not invoke ebu_dma_cleanup() and clk_disable_unprepare() on some error handling paths. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Evgeny Novikov Co-developed-by: Kirill Shilimanov Signed-off-by: Kirill Shilimanov Co-developed-by: Anton Vasilyev Signed-off-by: Anton Vasilyev Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210817092930.23040-1-novikov@ispras.ru commit a89d69a44e282be95ae76125dddc79515541efeb Author: Zhihao Cheng Date: Tue Aug 17 19:48:57 2021 +0800 mtd: mtdconcat: Check _read, _write callbacks existence before assignment Since 2431c4f5b46c3 ("mtd: Implement mtd_{read,write}() as wrappers around mtd_{read,write}_oob()") don't allow _write|_read and _write_oob|_read_oob existing at the same time, we should check the existence of callbacks "_read and _write" from subdev's master device (We can trust master device since it has been registered) before assigning, otherwise following warning occurs while making concatenated device: WARNING: CPU: 2 PID: 6728 at drivers/mtd/mtdcore.c:595 add_mtd_device+0x7f/0x7b0 Fixes: 2431c4f5b46c3 ("mtd: Implement mtd_{read,write}() around ...") Signed-off-by: Zhihao Cheng Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210817114857.2784825-3-chengzhihao1@huawei.com commit f9e109a209a8e01e16f37e1252304f1eb3908be4 Author: Zhihao Cheng Date: Tue Aug 17 19:48:56 2021 +0800 mtd: mtdconcat: Judge callback existence based on the master Since commit 46b5889cc2c5("mtd: implement proper partition handling") applied, mtd partition device won't hold some callback functions, such as _block_isbad, _block_markbad, etc. Besides, function mtd_block_isbad() will get mtd device's master mtd device, then invokes master mtd device's callback function. So, following process may result mtd_block_isbad() always return 0, even though mtd device has bad blocks: 1. Split a mtd device into 3 partitions: PA, PB, PC [ Each mtd partition device won't has callback function _block_isbad(). ] 2. Concatenate PA and PB as a new mtd device PN [ mtd_concat_create() finds out each subdev has no callback function _block_isbad(), so PN won't be assigned callback function concat_block_isbad(). ] Then, mtd_block_isbad() checks "!master->_block_isbad" is true, will always return 0. Reproducer: // reproduce.c static int __init init_diy_module(void) { struct mtd_info *mtd[2]; struct mtd_info *mtd_combine = NULL; mtd[0] = get_mtd_device_nm("NAND simulator partition 0"); if (!mtd[0]) { pr_err("cannot find mtd1\n"); return -EINVAL; } mtd[1] = get_mtd_device_nm("NAND simulator partition 1"); if (!mtd[1]) { pr_err("cannot find mtd2\n"); return -EINVAL; } put_mtd_device(mtd[0]); put_mtd_device(mtd[1]); mtd_combine = mtd_concat_create(mtd, 2, "Combine mtd"); if (mtd_combine == NULL) { pr_err("combine failed\n"); return -EINVAL; } mtd_device_register(mtd_combine, NULL, 0); pr_info("Combine success\n"); return 0; } 1. ID="0x20,0xac,0x00,0x15" 2. modprobe nandsim id_bytes=$ID parts=50,100 badblocks=100 3. insmod reproduce.ko 4. flash_erase /dev/mtd3 0 0 libmtd: error!: MEMERASE64 ioctl failed for eraseblock 100 (mtd3) error 5 (Input/output error) // Should be "flash_erase: Skipping bad block at 00c80000" Fixes: 46b5889cc2c54bac ("mtd: implement proper partition handling") Signed-off-by: Zhihao Cheng Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210817114857.2784825-2-chengzhihao1@huawei.com commit 60d0607998d6080db7af1d5bd8c9391f766fe697 Author: Lukas Bulwahn Date: Tue Aug 17 12:45:31 2021 +0200 mtd: maps: remove dead MTD map driver for PMC-Sierra MSP boards Commit 1b00767fd8e1 ("MIPS: Remove PMC MSP71xx platform") removes the config PMC_MSP in ./arch/mips/Kconfig. Hence, since then, the corresponding MTD map driver for PMC-Sierra MSP boards is dead code. Remove this dead driver. Signed-off-by: Lukas Bulwahn Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210817104531.12675-1-lukas.bulwahn@gmail.com commit fa451399d65a06747379ab1e246faf0b28e1c05f Author: Sean Young Date: Sat Aug 7 22:45:38 2021 +0100 mtd: rfd_ftl: use container_of() rather than cast The container_of() is much more readable and also safer. Signed-off-by: Sean Young Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-6-sean@mess.org commit d056f8cd2fc29fbfb45f936cc1ac36ff67d7db93 Author: Sean Young Date: Sat Aug 7 22:45:37 2021 +0100 mtd: rfd_ftl: fix use-after-free del_mtd_blktrans_dev() will kfree part, so after this call both part and dev point to freed memory. Move the call to avoid use-after-free. Signed-off-by: Sean Young Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-5-sean@mess.org commit a3a447848a153d0dae63d02ceb94b02fb43ec899 Author: Sean Young Date: Sat Aug 7 22:45:35 2021 +0100 mtd: rfd_ftl: add discard support I proposed this change 16 years ago before discard was a feature in the block layer: https://lwn.net/Articles/162776/ Now that the block layer has discard, we can finally merge this change. Discard is also known as trim. By implementing discard, both fstrim and the discard filesystem option can be used. Implementing discard in the ftl means that when files are removed, there is less data in the ftl mapping. This means less stuff to move around for erasing and also less erasing to do; this means improved wear levelling and improved performance. Signed-off-by: Sean Young Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-3-sean@mess.org commit e03a81213a9c9dd4f4f45c09a777323dff84827f Author: Sean Young Date: Sat Aug 7 22:45:34 2021 +0100 mtd: rfd_ftl: allow use of MTD_RAM for testing purposes This allows the rfd_ftl to be used with the mtdram module, so we can test different mtd sizes and test the rfd_ftl on machines without a physical nor flash device. Signed-off-by: Sean Young Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-2-sean@mess.org commit e07403a8c6be01857ff75060b2df9a1aa8320fe5 Author: Ezequiel Garcia Date: Sun Aug 1 20:45:09 2021 -0300 mtdblock: Warn if added for a NAND device There is a surprisingly large number of tutorials that suggest using mtdblock to mount SquashFS filesystems on flash devices, including NAND devices. This approach is suboptimal than using UBI. If the flash device is NAND, this is specially true, due to wear leveling, bit-flips and badblocks. In this case UBI is strongly preferred, so be nice to users and print a warning suggesting to consider UBI block, if mtdblock is added for a NAND device. Signed-off-by: Ezequiel Garcia Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210801234509.18774-8-ezequiel@collabora.com commit 514ef1e62d6521c2199d192b1c71b79d2aa21d5a Author: Pali Rohár Date: Thu Jun 24 23:55:46 2021 +0200 arm64: dts: marvell: armada-37xx: Extend PCIe MEM space Current PCIe MEM space of size 16 MB is not enough for some combination of PCIe cards (e.g. NVMe disk together with ath11k wifi card). ARM Trusted Firmware for Armada 3700 platform already assigns 128 MB for PCIe window, so extend PCIe MEM space to the end of 128 MB PCIe window which allows to allocate more PCIe BARs for more PCIe cards. Without this change some combination of PCIe cards cannot be used and kernel show error messages in dmesg during initialization: pci 0000:00:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:00:00.0: BAR 6: assigned [mem 0xe8000000-0xe80007ff pref] pci 0000:01:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:01:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:02:03.0: BAR 8: no space for [mem size 0x01000000] pci 0000:02:03.0: BAR 8: failed to assign [mem size 0x01000000] pci 0000:02:07.0: BAR 8: no space for [mem size 0x00100000] pci 0000:02:07.0: BAR 8: failed to assign [mem size 0x00100000] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit] Due to bugs in U-Boot port for Turris Mox, the second range in Turris Mox kernel DTS file for PCIe must start at 16 MB offset. Otherwise U-Boot crashes during loading of kernel DTB file. This bug is present only in U-Boot code for Turris Mox and therefore other Armada 3700 devices are not affected by this bug. Bug is fixed in U-Boot version 2021.07. To not break booting new kernels on existing versions of U-Boot on Turris Mox, use first 16 MB range for IO and second range with rest of PCIe window for MEM. Signed-off-by: Pali Rohár Fixes: 76f6386b25cc ("arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700") Signed-off-by: Gregory CLEMENT commit 4f1893ec8cfb4b17e3b89158a1e3e550a9a9bf3c Author: Thomas Gleixner Date: Sun Aug 15 23:28:34 2021 +0200 locking/ww_mutex: Move the ww_mutex definitions from into Move the ww_mutex definitions into the ww_mutex specific header where they belong. Preparatory change to allow compiling ww_mutexes standalone. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.110216293@linutronix.de commit 43d2d52d704e025518d35c3079fcbff744623166 Author: Thomas Gleixner Date: Sun Aug 15 23:28:33 2021 +0200 locking/mutex: Move the 'struct mutex_waiter' definition from to the internal header Move the mutex waiter declaration from the public header to the internal kernel/locking/mutex.h header. There is no reason to expose it outside of the core code. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211304.054325923@linutronix.de commit a321fb9038b335f3c447d1810b97d5f7eec152ac Author: Thomas Gleixner Date: Tue Aug 17 16:17:38 2021 +0200 locking/mutex: Consolidate core headers, remove kernel/locking/mutex-debug.h Having two header files which contain just the non-debug and debug variants is mostly waste of disc space and has no real value. Stick the debug variants into the common mutex.h file as counterpart to the stubs for the non-debug case. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.995350521@linutronix.de commit 715f7f9ece4685157bb59560f6c612340d730ab4 Author: Peter Zijlstra Date: Sun Aug 15 23:28:30 2021 +0200 locking/rtmutex: Squash !RT tasks to DEFAULT_PRIO Ensure all !RT tasks have the same prio such that they end up in FIFO order and aren't split up according to nice level. The reason why nice levels were taken into account so far is historical. In the early days of the rtmutex code it was done to give the PI boosting and deboosting a larger coverage. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.938676930@linutronix.de commit 8282947f67345246b4a6344dbceb07484d3d4dad Author: Thomas Gleixner Date: Sun Aug 15 23:28:28 2021 +0200 locking/rwlock: Provide RT variant Similar to rw_semaphores, on RT the rwlock substitution is not writer fair, because it's not feasible to have a writer inherit its priority to multiple readers. Readers blocked on a writer follow the normal rules of priority inheritance. Like RT spinlocks, RT rwlocks are state preserving across the slow lock operations (contended case). Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.882793524@linutronix.de commit 0f383b6dc96e976dfbf2721b0bf10bd96103b341 Author: Thomas Gleixner Date: Sun Aug 15 23:28:27 2021 +0200 locking/spinlock: Provide RT variant Provide the actual locking functions which make use of the general and spinlock specific rtmutex code. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.826621464@linutronix.de commit f7104cc1a9159cd0d3e8526cb638ae0301de4b61 Author: J. Bruce Fields Date: Thu Aug 12 16:41:43 2021 -0400 nfsd4: Fix forced-expiry locking This should use the network-namespace-wide client_lock, not the per-client cl_lock. You shouldn't see any bugs unless you're actually using the forced-expiry interface introduced by 89c905beccbb. Fixes: 89c905beccbb "nfsd: allow forced expiration of NFSv4 clients" Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 5a4753446253a427c0ff1e433b9c4933e5af207c Author: J. Bruce Fields Date: Thu Aug 12 16:41:42 2021 -0400 rpc: fix gss_svc_init cleanup on failure The failure case here should be rare, but it's obviously wrong. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit b4ab2fea7c797b0b8b92332c7e315703c12d37d8 Author: Chuck Lever Date: Fri Jul 30 16:07:36 2021 -0400 SUNRPC: Add RPC_AUTH_TLS protocol numbers Shared by client and server. See: https://www.iana.org/assignments/rpc-authentication-numbers/rpc-authentication-numbers.xhtml Signed-off-by: Chuck Lever commit d02a3a2cb25d384005a6e3446a445013342024b7 Author: Jia He Date: Tue Aug 3 12:59:37 2021 +0200 lockd: change the proc_handler for nsm_use_hostnames nsm_use_hostnames is a module parameter and it will be exported to sysctl procfs. This is to let user sometimes change it from userspace. But the minimal unit for sysctl procfs read/write it sizeof(int). In big endian system, the converting from/to bool to/from int will cause error for proc items. This patch use a new proc_handler proc_dobool to fix it. Signed-off-by: Jia He Reviewed-by: Pan Xinhui [thuth: Fix typo in commit message] Signed-off-by: Thomas Huth Signed-off-by: Chuck Lever commit a2071573d6346819cc4e5787b4206f2184985160 Author: Jia He Date: Tue Aug 3 12:59:36 2021 +0200 sysctl: introduce new proc handler proc_dobool This is to let bool variable could be correctly displayed in big/little endian sysctl procfs. sizeof(bool) is arch dependent, proc_dobool should work in all arches. Suggested-by: Pan Xinhui Signed-off-by: Jia He [thuth: rebased the patch to the current kernel version] Signed-off-by: Thomas Huth Signed-off-by: Chuck Lever commit 5c11720767f70d34357d00a15ba5a0ad052c40fe Author: Chuck Lever Date: Thu Aug 5 15:11:24 2021 -0400 SUNRPC: Fix a NULL pointer deref in trace_svc_stats_latency() Some paths through svc_process() leave rqst->rq_procinfo set to NULL, which triggers a crash if tracing happens to be enabled. Fixes: 89ff87494c6e ("SUNRPC: Display RPC procedure names instead of proc numbers") Signed-off-by: Chuck Lever commit ea49dc79002c416a9003f3204bc14f846a0dbcae Author: NeilBrown Date: Wed Jul 28 08:56:09 2021 +1000 NFSD: remove vanity comments Including one's name in copyright claims is appropriate. Including it in random comments is just vanity. After 2 decades, it is time for these to be gone. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 07a92d009f0b1557d3d58905ce18821a483be2e1 Author: Chuck Lever Date: Mon Feb 8 15:33:16 2021 -0500 svcrdma: Convert rdma->sc_rw_ctxts to llist Relieve contention on sc_rw_ctxt_lock by converting rdma->sc_rw_ctxts to an llist. The goal is to reduce the average overhead of Send completions, because a transport's completion handlers are single-threaded on one CPU core. This change reduces CPU utilization of each Send completion by 2-3% on my server. Signed-off-by: Chuck Lever Reviewed-By: Tom Talpey commit b6c2bfea096ba22583f1071c10ce0745804b9b95 Author: Chuck Lever Date: Tue Feb 9 10:32:20 2021 -0500 svcrdma: Relieve contention on sc_send_lock. /proc/lock_stat indicates the the sc_send_lock is heavily contended when the server is under load from a single client. To address this, convert the send_ctxt free list to an llist. Returning an item to the send_ctxt cache is now waitless, which reduces the instruction path length in the single-threaded Send handler (svc_rdma_wc_send). The goal is to enable the ib_comp_wq worker to handle a higher RPC/RDMA Send completion rate given the same CPU resources. This change reduces CPU utilization of Send completion by 2-3% on my server. Signed-off-by: Chuck Lever Reviewed-By: Tom Talpey commit 6c8c84f525100a1cade5698320b4abe43062e159 Author: Chuck Lever Date: Wed Jul 7 14:57:28 2021 -0400 svcrdma: Fewer calls to wake_up() in Send completion handler Because wake_up() takes an IRQ-safe lock, it can be expensive, especially to call inside of a single-threaded completion handler. What's more, the Send wait queue almost never has waiters, so most of the time, this is an expensive no-op. As always, the goal is to reduce the average overhead of each completion, because a transport's completion handlers are single- threaded on one CPU core. This change reduces CPU utilization of the Send completion thread by 2-3% on my server. Signed-off-by: Chuck Lever Reviewed-By: Tom Talpey commit cd2d644ddba183ec7b451b7c20d5c7cc06fcf0d7 Author: Benjamin Coddington Date: Mon Jul 26 09:33:28 2021 -0400 lockd: Fix invalid lockowner cast after vfs_test_lock After calling vfs_test_lock() the pointer to a conflicting lock can be returned, and that lock is not guarunteed to be owned by nlm. In that case, we cannot cast it to struct nlm_lockowner. Instead return the pid of that conflicting lock. Fixes: 646d73e91b42 ("lockd: Show pid of lockd for remote locks") Signed-off-by: Benjamin Coddington Signed-off-by: Chuck Lever commit d27b74a8675ca34dfd54c4bc4b3a11b7aa87e1a3 Author: Chuck Lever Date: Fri May 14 15:34:57 2021 -0400 NFSD: Use new __string_len C macros for nfsd_clid_class Clean up. Signed-off-by: Chuck Lever commit 408c0de706186bb11aaed87cf86d96d7776d3b6f Author: Chuck Lever Date: Wed May 12 09:39:06 2021 -0400 NFSD: Use new __string_len C macros for the nfs_dirent tracepoint Clean up. Signed-off-by: Chuck Lever commit 883b4aee4dec64bc807a7dda4651c6a5efe9a74d Author: Steven Rostedt (VMware) Date: Fri Jul 16 20:55:10 2021 -0400 tracing: Add trace_event helper macros __string_len() and __assign_str_len() There's a few cases that a string that is to be recorded in a trace event, does not have a terminating 'nul' character, and instead, the tracepoint passes in the length of the string to record. Add two helper macros to the trace event code that lets this work easier, than tricks with "%.*s" logic. __string_len() which is similar to __string() for declaration, but takes a length argument. __assign_str_len() which is similar to __assign_str() for assiging the string, but it too takes a length argument. Note, the TRACE_EVENT() macro will allocate the location on the ring buffer to 'len + 1', that will be used to store the string into. It is a requirement that the 'len' used for this is a most the length of the string being recorded. This string can still use __get_str() just like strings created with __string() can use to retrieve the string. Link: https://lore.kernel.org/linux-nfs/20210513105018.7539996a@gandalf.local.home/ Tested-by: Chuck Lever Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Chuck Lever commit 496d83cf0f2fa70cfe256c2499e2d3523d3868f3 Author: Chuck Lever Date: Mon Jun 28 17:24:27 2021 -0400 NFSD: Batch release pages during splice read Large splice reads call put_page() repeatedly. put_page() is relatively expensive to call, so replace it with the new svc_rqst_replace_page() helper to help amortize that cost. Signed-off-by: Chuck Lever Reviewed-by: NeilBrown commit 2f0f88f42f2eab0421ed37d7494de9124fdf0d34 Author: Chuck Lever Date: Thu Jul 1 10:03:10 2021 -0400 SUNRPC: Add svc_rqst_replace_page() API Replacing a page in rq_pages[] requires a get_page(), which is a bus-locked operation, and a put_page(), which can be even more costly. To reduce the cost of replacing a page in rq_pages[], batch the put_page() operations by collecting "freed" pages in a pagevec, and then release those pages when the pagevec is full. This pagevec is also emptied when each RPC completes. Signed-off-by: Chuck Lever commit c7e0b781b73c2e26e442ed71397cc2bc5945a732 Author: Chuck Lever Date: Mon Jun 28 16:34:20 2021 -0400 NFSD: Clean up splice actor A few useful observations: - The value in @size is never modified. - splice_desc.len is an unsigned int, and so is xdr_buf.page_len. An implicit cast to size_t is unnecessary. - The computation of .page_len is the same in all three arms of the "if" statement, so hoist it out to make it clear that the operation is an unconditional invariant. The resulting function is 18 bytes shorter on my system (-Os). Signed-off-by: Chuck Lever Reviewed-by: NeilBrown commit 1c143c4b65da09081d644110e619decc49c9dee4 Author: Thomas Gleixner Date: Sun Aug 15 23:28:25 2021 +0200 locking/rtmutex: Provide the spin/rwlock core lock function A simplified version of the rtmutex slowlock function, which neither handles signals nor timeouts, and is careful about preserving the state of the blocked task across the lock operation. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.770228446@linutronix.de commit 342a93247e0837101f27bbcca26f402902df98dc Author: Thomas Gleixner Date: Sun Aug 15 23:28:23 2021 +0200 locking/spinlock: Provide RT variant header: Provide the necessary wrappers around the actual rtmutex based spinlock implementation. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.712897671@linutronix.de commit 051790eecc03aff6978763791d38c1daea94c2f8 Author: Thomas Gleixner Date: Sun Aug 15 23:28:22 2021 +0200 locking/spinlock: Provide RT specific spinlock_t RT replaces spinlocks with a simple wrapper around an rtmutex, which turns spinlocks on RT into 'sleeping' spinlocks. The actual implementation of the spinlock API differs from a regular rtmutex, as it does neither handle timeouts nor signals and it is state preserving across the lock operation. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.654230709@linutronix.de commit 52d5a0c6bd8a89f460243ed937856354f8f253a3 Author: chenying Date: Mon Aug 16 18:02:56 2021 +0800 ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup() If function ovl_instantiate() returns an error, ovl_cleanup will be called and try to remove newdentry from wdir, but the newdentry has been moved to udir at this time. This will causes BUG_ON(victim->d_parent->d_inode != dir) in fs/namei.c:may_delete. Signed-off-by: chenying Fixes: 01b39dcc9568 ("ovl: use inode_insert5() to hash a newly created inode") Link: https://lore.kernel.org/linux-unionfs/e6496a94-a161-dc04-c38a-d2544633acb4@bytedance.com/ Cc: # v4.18 Signed-off-by: Miklos Szeredi commit e4e17af3b7f8841279b5a429de14907e26845c39 Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:28:20 2021 +0200 locking/rtmutex: Reduce header dependencies, only include We have the following header dependency problem on RT: - needs the definition of 'struct rb_root_cached'. - includes , which includes That works nicely for non-RT enabled kernels, but on RT enabled kernels spinlocks are based on rtmutexes, which creates another circular header dependency as will require . Include instead. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.598003167@linutronix.de commit 089050cafa10f408c9e18ad53965db839b894840 Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:28:19 2021 +0200 rbtree: Split out the rbtree type definitions into So we have this header dependency problem on RT: - needs the definition of 'struct rb_root_cached'. - includes , which includes . That works nicely for non-RT enabled kernels, but on RT enabled kernels spinlocks are based on rtmutexes, which creates another circular header dependency, as will require . Split out the type definitions and move them into their own header file so the rtmutex header can include just those. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.542123501@linutronix.de commit cbcebf5bd3d056d7a0ae332118888d867ac346c0 Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:28:17 2021 +0200 locking/lockdep: Reduce header dependencies in The inclusion of printk.h leads to a circular dependency if spinlock_t is based on rtmutexes on RT enabled kernels. Include only atomic.h (xchg()) and cache.h (__read_mostly) which is all what debug_locks.h requires. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.484161136@linutronix.de commit a403abbdc715986760821e67731d60ff65bde4bd Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:28:16 2021 +0200 locking/rtmutex: Prevent future include recursion hell rtmutex only needs raw_spinlock_t, but it includes spinlock_types.h, which is not a problem on an non RT enabled kernel. RT kernels substitute regular spinlocks with 'sleeping' spinlocks, which are based on rtmutexes, and therefore must be able to include rtmutex.h. Include instead. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.428224188@linutronix.de commit 4f084ca74c3f0eb321ab50e69afd27c8fcb96a99 Author: Thomas Gleixner Date: Sun Aug 15 23:28:14 2021 +0200 locking/spinlock: Split the lock types header, and move the raw types into Move raw_spinlock into its own file. Prepare for RT 'sleeping spinlocks', to avoid header recursion, as RT locks require rtmutex.h, which in turn requires the raw spinlock types. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.371269088@linutronix.de commit e17ba59b7e8e1f67e36d8fcc46daa13370efcf11 Author: Thomas Gleixner Date: Sun Aug 15 23:28:12 2021 +0200 locking/rtmutex: Guard regular sleeping locks specific functions Guard the regular sleeping lock specific functionality, which is used for rtmutex on non-RT enabled kernels and for mutex, rtmutex and semaphores on RT enabled kernels so the code can be reused for the RT specific implementation of spinlocks and rwlocks in a different compilation unit. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.311535693@linutronix.de commit 456cfbc65cd072f4f53936ee5a37eb1447a7d3ba Author: Thomas Gleixner Date: Sun Aug 15 23:28:11 2021 +0200 locking/rtmutex: Prepare RT rt_mutex_wake_q for RT locks Add an rtlock_task pointer to rt_mutex_wake_q, which allows to handle the RT specific wakeup for spin/rwlock waiters. The pointer is just consuming 4/8 bytes on the stack so it is provided unconditionaly to avoid #ifdeffery all over the place. This cannot use a regular wake_q, because a task can have concurrent wakeups which would make it miss either lock or the regular wakeups, depending on what gets queued first, unless task struct gains a separate wake_q_node for this, which would be overkill, because there can only be a single task which gets woken up in the spin/rw_lock unlock path. No functional change for non-RT enabled kernels. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.253614678@linutronix.de commit 7980aa397cc0968ea3ffee7a985c31c92ad84f81 Author: Thomas Gleixner Date: Sun Aug 15 23:28:09 2021 +0200 locking/rtmutex: Use rt_mutex_wake_q_head Prepare for the required state aware handling of waiter wakeups via wake_q and switch the rtmutex code over to the rtmutex specific wrapper. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.197113263@linutronix.de commit b576e640ce5e22673e12949cf14ae3cb18d9b859 Author: Thomas Gleixner Date: Sun Aug 15 23:28:08 2021 +0200 locking/rtmutex: Provide rt_wake_q_head and helpers To handle the difference between wakeups for regular sleeping locks (mutex, rtmutex, rw_semaphore) and the wakeups for 'sleeping' spin/rwlocks on PREEMPT_RT enabled kernels correctly, it is required to provide a wake_q_head construct which allows to keep them separate. Provide a wrapper around wake_q_head and the required helpers, which will be extended with the state handling later. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.139337655@linutronix.de commit 857f75ea845706a0ec65ce2239da519214a4451a Author: Yucong Sun Date: Mon Aug 16 21:57:13 2021 -0700 selftests/bpf: Add exponential backoff to map_delete_retriable in test_maps Using a fixed delay of 1 microsecond has proven flaky in slow CPU environment, e.g. Github Actions CI system. This patch adds exponential backoff with a cap of 50ms to reduce the flakiness of the test. Initial delay is chosen at random in the range [0ms, 5ms). Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210817045713.3307985-1-fallentree@fb.com commit c014ef69b3acdb8c9e7fc412e96944f4d5c36fa0 Author: Thomas Gleixner Date: Sun Aug 15 23:28:06 2021 +0200 locking/rtmutex: Add wake_state to rt_mutex_waiter Regular sleeping locks like mutexes, rtmutexes and rw_semaphores are always entering and leaving a blocking section with task state == TASK_RUNNING. On a non-RT kernel spinlocks and rwlocks never affect the task state, but on RT kernels these locks are converted to rtmutex based 'sleeping' locks. So in case of contention the task goes to block, which requires to carefully preserve the task state, and restore it after acquiring the lock taking regular wakeups for the task into account, which happened while the task was blocked. This state preserving is achieved by having a separate task state for blocking on a RT spin/rwlock and a saved_state field in task_struct along with careful handling of these wakeup scenarios in try_to_wake_up(). To avoid conditionals in the rtmutex code, store the wake state which has to be used for waking a lock waiter in rt_mutex_waiter which allows to handle the regular and RT spin/rwlocks by handing it to wake_up_state(). Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.079800739@linutronix.de commit 42254105dfe871a0dc4f9d376106aeb010e54341 Author: Thomas Gleixner Date: Sun Aug 15 23:28:05 2021 +0200 locking/rwsem: Add rtmutex based R/W semaphore implementation The RT specific R/W semaphore implementation used to restrict the number of readers to one, because a writer cannot block on multiple readers and inherit its priority or budget. The single reader restricting was painful in various ways: - Performance bottleneck for multi-threaded applications in the page fault path (mmap sem) - Progress blocker for drivers which are carefully crafted to avoid the potential reader/writer deadlock in mainline. The analysis of the writer code paths shows that properly written RT tasks should not take them. Syscalls like mmap(), file access which take mmap sem write locked have unbound latencies, which are completely unrelated to mmap sem. Other R/W sem users like graphics drivers are not suitable for RT tasks either. So there is little risk to hurt RT tasks when the RT rwsem implementation is done in the following way: - Allow concurrent readers - Make writers block until the last reader left the critical section. This blocking is not subject to priority/budget inheritance. - Readers blocked on a writer inherit their priority/budget in the normal way. There is a drawback with this scheme: R/W semaphores become writer unfair though the applications which have triggered writer starvation (mostly on mmap_sem) in the past are not really the typical workloads running on a RT system. So while it's unlikely to hit writer starvation, it's possible. If there are unexpected workloads on RT systems triggering it, the problem has to be revisited. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211303.016885947@linutronix.de commit 943f0edb754fac195043c620b44f920e4fb76ec8 Author: Thomas Gleixner Date: Sun Aug 15 23:28:03 2021 +0200 locking/rt: Add base code for RT rw_semaphore and rwlock On PREEMPT_RT, rw_semaphores and rwlocks are substituted with an rtmutex and a reader count. The implementation is writer unfair, as it is not feasible to do priority inheritance on multiple readers, but experience has shown that real-time workloads are not the typical workloads which are sensitive to writer starvation. The inner workings of rw_semaphores and rwlocks on RT are almost identical except for the task state and signal handling. rw_semaphores are not state preserving over a contention, they are expected to enter and leave with state == TASK_RUNNING. rwlocks have a mechanism to preserve the state of the task at entry and restore it after unblocking taking potential non-lock related wakeups into account. rw_semaphores can also be subject to signal handling interrupting a blocked state, while rwlocks ignore signals. To avoid code duplication, provide a shared implementation which takes the small difference vs. state and signals into account. The code is included into the relevant rw_semaphore/rwlock base code and compiled for each use case separately. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.957920571@linutronix.de commit 6bc8996add9f82d0153b0be44efe282bd45dc702 Author: Thomas Gleixner Date: Sun Aug 15 23:28:02 2021 +0200 locking/rtmutex: Provide rt_mutex_base_is_locked() Provide rt_mutex_base_is_locked(), which will be used for various wrapped locking primitives for RT. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.899572818@linutronix.de commit ebbdc41e90ffce8b6bb3cbba1801ede2dd07a89b Author: Thomas Gleixner Date: Sun Aug 15 23:28:00 2021 +0200 locking/rtmutex: Provide rt_mutex_slowlock_locked() Split the inner workings of rt_mutex_slowlock() out into a separate function, which can be reused by the upcoming RT lock substitutions, e.g. for rw_semaphores. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.841971086@linutronix.de commit 830e6acc8a1cafe153a0d88f9b2455965b396131 Author: Peter Zijlstra Date: Sun Aug 15 23:27:58 2021 +0200 locking/rtmutex: Split out the inner parts of 'struct rtmutex' RT builds substitutions for rwsem, mutex, spinlock and rwlock around rtmutexes. Split the inner working out so each lock substitution can use them with the appropriate lockdep annotations. This avoids having an extra unused lockdep map in the wrapped rtmutex. No functional change. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.784739994@linutronix.de commit 531ae4b06a737ed5539cd75dc6f6b9a28f900bba Author: Thomas Gleixner Date: Sun Aug 15 23:27:57 2021 +0200 locking/rtmutex: Split API from implementation Prepare for reusing the inner functions of rtmutex for RT lock substitutions: introduce kernel/locking/rtmutex_api.c and move them there. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.726560996@linutronix.de commit 709e0b62869f625afd18edd79f190c38cb39dfb2 Author: Thomas Gleixner Date: Sun Aug 15 23:27:55 2021 +0200 locking/rtmutex: Switch to from cmpxchg_*() to try_cmpxchg_*() Allows the compiler to generate better code depending on the architecture. Suggested-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.668958502@linutronix.de commit 785159301bedea25fae9b20cae3d12377246e941 Author: Sebastian Andrzej Siewior Date: Sun Aug 15 23:27:54 2021 +0200 locking/rtmutex: Convert macros to inlines Inlines are type-safe... Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.610830960@linutronix.de commit f07ec52202ca5bfc79d30ca7c54f86454eb1a9b0 Author: Peter Zijlstra Date: Sun Aug 15 23:27:52 2021 +0200 locking/rtmutex: Remove rt_mutex_is_locked() There are no more users left. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.552218335@linutronix.de commit e14c4bd12478faa13a0aceeeea6f964ff8521101 Author: Peter Zijlstra Date: Sun Aug 15 23:27:51 2021 +0200 media/atomisp: Use lockdep instead of *mutex_is_locked() The only user of rt_mutex_is_locked() is an anti-pattern, remove it. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.491442626@linutronix.de commit 2c8bb85151d4bad825f8962792e9f53d22db81db Author: Thomas Gleixner Date: Sun Aug 15 23:27:49 2021 +0200 sched/wake_q: Provide WAKE_Q_HEAD_INITIALIZER() The RT specific spin/rwlock implementation requires special handling of the to be woken waiters. Provide a WAKE_Q_HEAD_INITIALIZER(), which can be used by the rtmutex code to implement an RT aware wake_q derivative. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.429918071@linutronix.de commit 6991436c2b5d91d5358d9914ae2df22b9a1d1dc9 Author: Thomas Gleixner Date: Sun Aug 15 23:27:48 2021 +0200 sched/core: Provide a scheduling point for RT locks RT enabled kernels substitute spin/rwlocks with 'sleeping' variants based on rtmutexes. Blocking on such a lock is similar to preemption versus: - I/O scheduling and worker handling, because these functions might block on another substituted lock, or come from a lock contention within these functions. - RCU considers this like a preemption, because the task might be in a read side critical section. Add a separate scheduling point for this, and hand a new scheduling mode argument to __schedule() which allows, along with separate mode masks, to handle this gracefully from within the scheduler, without proliferating that to other subsystems like RCU. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.372319055@linutronix.de commit b4bfa3fcfe3b827ddb8b16edd45896caac5a1194 Author: Thomas Gleixner Date: Sun Aug 15 23:27:46 2021 +0200 sched/core: Rework the __schedule() preempt argument PREEMPT_RT needs to hand a special state into __schedule() when a task blocks on a 'sleeping' spin/rwlock. This is required to handle rcu_note_context_switch() correctly without having special casing in the RCU code. From an RCU point of view the blocking on the sleeping spinlock is equivalent to preemption, because the task might be in a read side critical section. schedule_debug() also has a check which would trigger with the !preempt case, but that could be handled differently. To avoid adding another argument and extra checks which cannot be optimized out by the compiler, the following solution has been chosen: - Replace the boolean 'preempt' argument with an unsigned integer 'sched_mode' argument and define constants to hand in: (0 == no preemption, 1 = preemption). - Add two masks to apply on that mode: one for the debug/rcu invocations, and one for the actual scheduling decision. For a non RT kernel these masks are UINT_MAX, i.e. all bits are set, which allows the compiler to optimize the AND operation out, because it is not masking out anything. IOW, it's not different from the boolean. RT enabled kernels will define these masks separately. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.315473019@linutronix.de commit 5f220be21418541422335288b6e2360a5ce0613c Author: Thomas Gleixner Date: Sun Aug 15 23:27:44 2021 +0200 sched/wakeup: Prepare for RT sleeping spin/rwlocks Waiting for spinlocks and rwlocks on non RT enabled kernels is task::state preserving. Any wakeup which matches the state is valid. RT enabled kernels substitutes them with 'sleeping' spinlocks. This creates an issue vs. task::__state. In order to block on the lock, the task has to overwrite task::__state and a consecutive wakeup issued by the unlocker sets the state back to TASK_RUNNING. As a consequence the task loses the state which was set before the lock acquire and also any regular wakeup targeted at the task while it is blocked on the lock. To handle this gracefully, add a 'saved_state' member to task_struct which is used in the following way: 1) When a task blocks on a 'sleeping' spinlock, the current state is saved in task::saved_state before it is set to TASK_RTLOCK_WAIT. 2) When the task unblocks and after acquiring the lock, it restores the saved state. 3) When a regular wakeup happens for a task while it is blocked then the state change of that wakeup is redirected to operate on task::saved_state. This is also required when the task state is running because the task might have been woken up from the lock wait and has not yet restored the saved state. To make it complete, provide the necessary helpers to save and restore the saved state along with the necessary documentation how the RT lock blocking is supposed to work. For non-RT kernels there is no functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.258751046@linutronix.de commit 85019c1674890fa0408e324589e20803b3241755 Author: Thomas Gleixner Date: Sun Aug 15 23:27:43 2021 +0200 sched/wakeup: Reorganize the current::__state helpers In order to avoid more duplicate implementations for the debug and non-debug variants of the state change macros, split the debug portion out and make that conditional on CONFIG_DEBUG_ATOMIC_SLEEP=y. Suggested-by: Waiman Long Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.200898048@linutronix.de Signed-off-by: Ingo Molnar commit cd781d0ce8cb4d491910833c5eec90f150432da3 Author: Thomas Gleixner Date: Sun Aug 15 23:27:41 2021 +0200 sched/wakeup: Introduce the TASK_RTLOCK_WAIT state bit RT kernels have an extra quirk for try_to_wake_up() to handle task state preservation across periods of blocking on a 'sleeping' spin/rwlock. For this to function correctly and under all circumstances try_to_wake_up() must be able to identify whether the wakeup is lock related or not and whether the task is waiting for a lock or not. The original approach was to use a special wake_flag argument for try_to_wake_up() and just use TASK_UNINTERRUPTIBLE for the tasks wait state and the try_to_wake_up() state argument. This works in principle, but due to the fact that try_to_wake_up() cannot determine whether the task is waiting for an RT lock wakeup or for a regular wakeup it's suboptimal. RT kernels save the original task state when blocking on an RT lock and restore it when the lock has been acquired. Any non lock related wakeup is checked against the saved state and if it matches the saved state is set to running so that the wakeup is not lost when the state is restored. While the necessary logic for the wake_flag based solution is trivial, the downside is that any regular wakeup with TASK_UNINTERRUPTIBLE in the state argument set will wake the task despite the fact that it is still blocked on the lock. That's not a fatal problem as the lock wait has do deal with spurious wakeups anyway, but it introduces unnecessary latencies. Introduce the TASK_RTLOCK_WAIT state bit which will be set when a task blocks on an RT lock. The lock wakeup will use wake_up_state(TASK_RTLOCK_WAIT), so both the waiting state and the wakeup state are distinguishable, which avoids spurious wakeups and allows better analysis. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.144989915@linutronix.de Signed-off-by: Ingo Molnar commit 43295d73adc8d3780e9f34206663e336678aaff8 Author: Thomas Gleixner Date: Sun Aug 15 23:27:40 2021 +0200 sched/wakeup: Split out the wakeup ->__state check RT kernels have a slightly more complicated handling of wakeups due to 'sleeping' spin/rwlocks. If a task is blocked on such a lock then the original state of the task is preserved over the blocking period, and any regular (non lock related) wakeup has to be targeted at the saved state to ensure that these wakeups are not lost. Once the task acquires the lock it restores the task state from the saved state. To avoid cluttering try_to_wake_up() with that logic, split the wakeup state check out into an inline helper and use it at both places where task::__state is checked against the state argument of try_to_wake_up(). No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.088945085@linutronix.de commit b41cda03765580caf7723b8c1b672d191c71013f Author: Thomas Gleixner Date: Sun Aug 15 23:27:38 2021 +0200 locking/rtmutex: Set proper wait context for lockdep RT mutexes belong to the LD_WAIT_SLEEP class. Make them so. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.031014562@linutronix.de commit d8bbd97ad0b99a9394f2cd8410b884c48e218cf0 Author: Thomas Gleixner Date: Sun Aug 15 23:27:37 2021 +0200 locking/local_lock: Add missing owner initialization If CONFIG_DEBUG_LOCK_ALLOC=y is enabled then local_lock_t has an 'owner' member which is checked for consistency, but nothing initialized it to zero explicitly. The static initializer does so implicit, and the run time allocated per CPU storage is usually zero initialized as well, but relying on that is not really good practice. Fixes: 91710728d172 ("locking: Introduce local_lock()") Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211301.969975279@linutronix.de commit c87866ede44ad7da6b296d732221dc34ce1b154d Merge: 55bccf1f93e4b 7c60610d47676 Author: Ingo Molnar Date: Tue Aug 17 16:16:29 2021 +0200 Merge tag 'v5.14-rc6' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar commit 2499ee9d90795932893576cf065f967a6136bc20 Merge: f8043ef50acae 240fdf3f42fc6 Author: Mark Brown Date: Tue Aug 17 15:14:06 2021 +0100 Merge series "ASoC: tegra30: Fix use of of_device_get_match_data" from Aakash Hemadri : Hi, This patchset fixes my previous incorrect patches. 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data") Aakash Hemadri (2): ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data sound/soc/tegra/tegra30_ahub.c | 6 ++---- sound/soc/tegra/tegra30_i2s.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) -- 2.32.0 commit f50d2ff8f016b79a2ff4acd5943a1eda40c545d4 Author: Chih-Kang Chang Date: Mon Aug 16 16:51:28 2021 +0800 mac80211: Fix insufficient headroom issue for AMSDU ieee80211_amsdu_realloc_pad() fails to account for extra_tx_headroom, the original reserved headroom might be eaten. Add the necessary extra_tx_headroom. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20210816085128.10931-2-pkshih@realtek.com [fix indentation] Signed-off-by: Johannes Berg commit eaa2c490514d2d49c3ef1764530234d07f422289 Author: Sebastian Krzyszkowiak Date: Mon Aug 16 18:50:16 2021 +0200 power: supply: max17042_battery: log SOC threshold using debug log level There's no need to print a message on every change in battery percentage on regular log levels. Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Sebastian Reichel commit 4bf00434a6183a33c1fa315db7cc4d4a00a76be0 Author: Sebastian Krzyszkowiak Date: Mon Aug 16 18:50:15 2021 +0200 power: supply: max17042_battery: more robust chip type checks Prepared by checking the datasheets of max17042, max17047/50 and max170455 for differences in register maps. Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Sebastian Reichel commit ed0d0a0506025f06061325cedae1bbebd081620a Author: Sebastian Krzyszkowiak Date: Mon Aug 16 18:50:14 2021 +0200 power: supply: max17042_battery: fix typo in MAx17042_TOFF Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Sebastian Reichel commit 1e4f30eaf4b81252bbd462cf7e95a08959f5bebd Author: Sebastian Krzyszkowiak Date: Mon Aug 16 18:50:13 2021 +0200 power: supply: max17042_battery: clean up MAX17055_V_empty This register is same as in MAX17047 and MAX17050, so there's no need for custom casing it. Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Sebastian Reichel commit 87e0d46bf68913f4c87dba94aadc00da658a874b Author: Joel Stanley Date: Tue Aug 17 14:24:07 2021 +0930 powerpc/configs: Regenerate mpc885_ads_defconfig Regenerate atop v5.14-rc6 by doing a make savedefconfig. The changes a re-ordering except for the following (which are still set indirectly): - CONFIG_DEBUG_KERNEL=y selected by EXPERT - CONFIG_PPC_EARLY_DEBUG_CPM_ADDR=0xff002008 which is the default setting Signed-off-by: Joel Stanley Acked-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817045407.2445664-4-joel@jms.id.au commit d0e28a6145c3455b69991245e7f6147eb914b34a Author: Joel Stanley Date: Tue Aug 17 14:24:06 2021 +0930 powerpc/config: Renable MTD_PHYSMAP_OF CONFIG_MTD_PHYSMAP_OF is not longer enabled as it depends on MTD_PHYSMAP which is not enabled. This is a regression from commit 642b1e8dbed7 ("mtd: maps: Merge physmap_of.c into physmap-core.c"), which added the extra dependency. Add CONFIG_MTD_PHYSMAP=y so this stays in the config, as Christophe said it is useful for build coverage. Fixes: 642b1e8dbed7 ("mtd: maps: Merge physmap_of.c into physmap-core.c") Signed-off-by: Joel Stanley Acked-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817045407.2445664-3-joel@jms.id.au commit c5ac55b6cbc604ad4144c380feae20f69453df91 Author: Joel Stanley Date: Tue Aug 17 14:24:05 2021 +0930 powerpc/config: Fix IPV6 warning in mpc855_ads When building this config there's a warning: 79:warning: override: reassigning to symbol IPV6 Commit 9a1762a4a4ff ("powerpc/8xx: Update mpc885_ads_defconfig to improve CI") added CONFIG_IPV6=y, but left '# CONFIG_IPV6 is not set' in. IPV6 is default y, so remove both to clean up the build. Fixes: 9a1762a4a4ff ("powerpc/8xx: Update mpc885_ads_defconfig to improve CI") Signed-off-by: Joel Stanley Acked-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817045407.2445664-2-joel@jms.id.au commit e95ad5f21693a37c0d318b5988c5a0de324eb3e3 Author: Michael Ellerman Date: Mon Aug 16 16:36:02 2021 +1000 powerpc/head_check: Fix shellcheck errors Replace "cat file | grep pattern" with "grep pattern file", and quote a few variables. Together that fixes all shellcheck errors. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210817125154.3369884-1-mpe@ellerman.id.au commit 0b89fc0a367edab09065af722894d186bd0ccb0d Author: Chris Morgan Date: Thu Aug 12 21:45:42 2021 +0800 spi: rockchip-sfc: add rockchip serial flash controller Add the rockchip serial flash controller (SFC) driver. Signed-off-by: Chris Morgan Signed-off-by: Jon Lin Tested-by: Peter Geis Tested-by: Chris Morgan Link: https://lore.kernel.org/r/20210812134546.31340-3-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit 538d7c2ed73098850fe80be14eed2739d37e419b Author: Chris Morgan Date: Thu Aug 12 21:45:41 2021 +0800 spi: rockchip-sfc: Bindings for Rockchip serial flash controller Add bindings for the Rockchip serial flash controller. New device specific parameter of rockchip,sfc-no-dma included in documentation. Signed-off-by: Chris Morgan Signed-off-by: Jon Lin Tested-by: Peter Geis Link: https://lore.kernel.org/r/20210812134546.31340-2-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit f8043ef50acaeb396702481bd2701066bac8a2bc Author: Hans de Goede Date: Mon Aug 16 13:47:22 2021 +0200 ASoC: Intel: bytcr_rt5640: Use cfg-lineout:2 in the components string Use "cfg-lineout:2" in the components string on boards with a lineout instead of "cfg-lineout:1", this better mirrors the speaker part of the components string where we use "cfg-spk:1" for devices with a single speaker and "cfg-spk:2" for stereo speakers. The lineout is stereo by default, so using ":2" makes more sense, this way we keep ":1" reserved in case we ever encounter a device with a mono lineout. We can make this change without breaking userspace because no kernel has shipped with "cfg-lineout:1" in the component-string yet; and there also are no userspace bits (UCM profiles) checking for this yet. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210816114722.107363-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 1b5d1d3a2f77250707225509cadc17997bab4353 Author: Biju Das Date: Mon Aug 16 19:23:36 2021 +0100 ASoC: sh: rz-ssi: Fix wrong operator used issue Fix wrong operator used issue reported by Coverity by replacing | operator with & operator. Signed-off-by: Biju Das Reported-by: Colin Ian King Link: https://lore.kernel.org/r/20210816182336.29959-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 240fdf3f42fc6505adecaf5a74fac75b3c702cf1 Author: Aakash Hemadri Date: Tue Aug 17 02:44:52 2021 +0530 ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_i2s_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown commit ea2efedefbc34f782db396c3d90e80aa1fff57a5 Author: Aakash Hemadri Date: Tue Aug 17 02:44:51 2021 +0530 ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_ahub_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri Link: https://lore.kernel.org/r/bb61c41f2ee0cf0d85fecdfea05f23a7205992e6.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown commit 2010319b3c438ba428e9a5c54998c5b05631cf78 Author: Srinivas Pandruvada Date: Sun Aug 15 20:53:56 2021 -0700 thermal/drivers/intel: Move intel_menlow to thermal drivers Moved drivers/platform/x86/intel_menlow.c to drivers/thermal/intel. Signed-off-by: Srinivas Pandruvada Acked-by: Daniel Lezcano Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20210816035356.1955982-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit c7c4024348994208ac3bf85daf1a6195b7c5f7d3 Author: Anand Moon Date: Tue Aug 17 09:45:40 2021 +0530 phy: amlogic: meson8b-usb2: don't log an error on -EPROBE_DEFER devm_phy_create can return -EPROBE_DEFER if the vbus-supply is not ready yet. Silence this warning as the driver framework will re-attempt registering the PHY. Use dev_err_probe() for phy resources to indicate the deferral reason when waiting for the resource to come up. Cc: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Signed-off-by: Anand Moon Link: https://lore.kernel.org/r/20210817041548.1276-7-linux.amoon@gmail.com Signed-off-by: Vinod Koul commit e1f31c93a8d292f2e5b17daa384feaa28453f25e Author: Anand Moon Date: Tue Aug 17 09:45:39 2021 +0530 phy: amlogic: meson8b-usb2: Power off the PHY by putting it into reset mode Power off the PHY by putting it into reset mode. Cc: Martin Blumenstingl Acked-by: Martin Blumenstingl Signed-off-by: Anand Moon Link: https://lore.kernel.org/r/20210817041548.1276-6-linux.amoon@gmail.com Signed-off-by: Vinod Koul commit 7508d1e4031168afac1793bf1f2a29a7c3fce423 Author: Chunfeng Yun Date: Tue Aug 17 17:19:47 2021 +0800 phy: phy-mtk-mipi-dsi: convert to devm_platform_ioremap_resource Use devm_platform_ioremap_resource to simplify code Acked-by: Chun-Kuang Hu Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-9-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 75203e7994feedc52c62eb42f6b7a7087145813b Author: Chunfeng Yun Date: Tue Aug 17 17:19:46 2021 +0800 phy: phy-mtk-mipi-dsi: remove dummy assignment of error number Return the error number directly without assignment Acked-by: Chun-Kuang Hu Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-8-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 9474458753880e63c2b31fec3753316fa5c8e20d Author: Chunfeng Yun Date: Tue Aug 17 17:19:45 2021 +0800 phy: phy-mtk-hdmi: convert to devm_platform_ioremap_resource Use devm_platform_ioremap_resource to simplify code Acked-by: Chun-Kuang Hu Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-7-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 5f71b1e4f719e3c2312f20a76ee039ae209e72da Author: Chunfeng Yun Date: Tue Aug 17 17:19:44 2021 +0800 phy: phy-mtk-ufs: use clock bulk to get clocks Use clock bulk helpers to get/enable/disable clocks Reviewed-by: Stanley Chu Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-6-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 1c6de3fc53ca14d3266d219e2ee62b8e5b1e2a6f Author: Chunfeng Yun Date: Tue Aug 17 17:19:43 2021 +0800 phy: phy-mtk-tphy: remove error log of ioremap failure devm_ioremap_resource() will print log if error happens. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 926b83e5f9f0427f588b6c1e2b3b077979c39d3e Author: Chunfeng Yun Date: Tue Aug 17 17:19:42 2021 +0800 phy: phy-mtk-tphy: print error log using child device Print error log using child devices instead of parent device. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 39099a4433586cdf30a7fc73aae4c77159b4a8c7 Author: Chunfeng Yun Date: Tue Aug 17 17:19:41 2021 +0800 phy: phy-mtk-tphy: support type switch by pericfg Add support type switch between USB3, PCIe, SATA and SGMII by pericfg register, this is used to take the place of efuse or jumper. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 3fd6611242b9f4e218175c11c8233ac4ab9402e6 Author: Chunfeng Yun Date: Tue Aug 17 17:19:40 2021 +0800 phy: phy-mtk-tphy: use clock bulk to get clocks Use clock bulk helpers to get/enable/disable clocks Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit c01608b3b46bfd5285117ab2c66df7cd59b7c67d Author: Chunfeng Yun Date: Tue Aug 17 17:19:39 2021 +0800 dt-bindings: phy: mediatek: tphy: support type switch by pericfg Add support type switch by pericfg register between USB3, PCIe, SATA, SGMII, this is used to replace the way through efuse or jumper. Reviewed-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1629191987-20774-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 48ac6085bdfcf568e24c1efd45615ec3d5d3545b Author: Swapnil Jakhade Date: Wed Jul 28 16:54:54 2021 +0200 phy: cadence-torrent: Check PIPE mode PHY status to be ready for operation PIPE PHY status is used to communicate the completion of several PHY functions. Check if PHY is ready for operation while configured for PIPE mode during startup. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-10-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 84f55df836916be2b052a5000cca8d7d9fcf2520 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:53 2021 +0200 phy: cadence-torrent: Add debug information for PHY configuration Add debug information in probe regarding PHY configuration parameters like single link or multilink protocol along with number of lanes used for each protocol link. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-9-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 8f3ced2fd4906523e251f252dee03f6c22129e08 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:52 2021 +0200 phy: cadence-torrent: Add separate functions for reusable code Torrent PHY driver currently supports single link DP configuration. Prepare driver to support multilink DP configurations by adding separate functions for common initialization sequence. Signed-off-by: Swapnil Jakhade Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20210728145454.15945-8-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 1cc455150b7a67f3bbfe1dce03a97b4ae88778d5 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:51 2021 +0200 phy: cadence-torrent: Add PHY configuration for DP with 100MHz ref clock Add PHY configuration registers for single link DP with 100MHz reference clock and NO_SSC. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-7-sjakhade@cadence.com Signed-off-by: Vinod Koul commit da055e5503893e27d6494f52bd6987f0da0c7658 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:50 2021 +0200 phy: cadence-torrent: Add PHY registers for DP in array format Add PHY registers for single link DP in array format to simplify code and to improve readability. This supports already supported frequencies for DP of 19.2MHz and 25MHz. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-6-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 6a2338a5bf7f9b4df5ed55d7b25ceb996ea09310 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:49 2021 +0200 phy: cadence-torrent: Configure PHY registers as a function of input reference clock rate Torrent PHY supports multiple serdes standards with different input reference clock frequencies. PHY register values differ based on the reference clock rate. Add PHY input reference clock frequency as a new dimension to select proper register configuration. No functional change is intended. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-5-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 3b40162516ca04209d750ddc174eea3e6deac148 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:48 2021 +0200 phy: cadence-torrent: Add enum for supported input reference clock frequencies Torrent PHY supports different input reference clock frequencies. Register configurations will be different based on reference clock value. Prepare driver to support such multiple reference clock frequencies. Signed-off-by: Swapnil Jakhade Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20210728145454.15945-4-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 5b16a790f18d234187f31eab0a222bd53cb12b9e Author: Swapnil Jakhade Date: Wed Jul 28 16:54:47 2021 +0200 phy: cadence-torrent: Reorder few functions to remove function declarations Reorder some functions to avoid function declarations. No functional change. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20210728145454.15945-3-sjakhade@cadence.com Signed-off-by: Vinod Koul commit e956d4fceba3aeb1cc088d043048b1d2157427b0 Author: Swapnil Jakhade Date: Wed Jul 28 16:54:46 2021 +0200 phy: cadence-torrent: Remove use of CamelCase to fix checkpatch CHECK message Script checkpatch with --strict option gives message: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: Fix this by removing CamelCase usage. No functional change. Signed-off-by: Swapnil Jakhade Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20210728145454.15945-2-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 5f9404abdf2ac31c8f4768c39714bfcaca389e3a Author: John Crispin Date: Fri Jul 2 19:44:08 2021 +0200 mac80211: add support for BSS color change The color change announcement is very similar to how CSA works where we have an IE that includes a counter. When the counter hits 0, the new color is applied via an updated beacon. This patch makes the CSA counter functionality reusable, rather than implementing it again. This also allows for future reuse incase support for other counter IEs gets added. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: John Crispin Link: https://lore.kernel.org/r/057c1e67b82bee561ea44ce6a45a8462d3da6995.1625247619.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 0d2ab3aea50bb02ff0c9c3d53c7b2b4b21cdd59d Author: John Crispin Date: Fri Jul 2 19:44:07 2021 +0200 nl80211: add support for BSS coloring This patch adds support for BSS color collisions to the wireless subsystem. Add the required functionality to nl80211 that will notify about color collisions, triggering the color change and notifying when it is completed. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: John Crispin Link: https://lore.kernel.org/r/500b3582aec8fe2c42ef46f3117b148cb7cbceb5.1625247619.git.lorenzo@kernel.org [remove unnecessary NULL initialisation] Signed-off-by: Johannes Berg commit 752be2976405b7499890c0b6bac6d30d34d08bd6 Author: Justin Iurman Date: Mon Aug 16 19:16:38 2021 +0200 selftests: net: improved IOAM tests As previously discussed with David Ahern, here is a refactored and improved version of the IOAM self-test. It is now more complete and more robust. Now, all tests are divided into three categories: OUTPUT (evaluates the IOAM processing by the sender), INPUT (evaluates the IOAM processing by the receiver) and GLOBAL (evaluates wider use cases that do not fall into the other two categories). Both OUTPUT and INPUT tests only use a two-node topology (alpha and beta), while GLOBAL tests use the entire three-node topology (alpha, beta, gamma). Each test is documented inside its own handler in the (bash) script. Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit f945ca1963c8bd29471020d7c58c594ee7007006 Author: Miklos Szeredi Date: Thu Jul 22 14:18:14 2021 +0200 ovl: use kvalloc in xattr copy-up Extended attributes are usually small, but could be up to 64k in size, so use the most efficient method for doing the allocation. Signed-off-by: Miklos Szeredi commit d8991e8622e758b718e2e4291d31dd0bea4e14a4 Author: Chengguang Xu Date: Wed Mar 10 10:09:25 2021 +0800 ovl: update ctime when changing fileattr Currently we keep size, mode and times of overlay inode as the same as upper inode, so should update ctime when changing file attribution as well. Signed-off-by: Chengguang Xu Signed-off-by: Miklos Szeredi commit b71759ef1e1730db81dab98e9dab9455e8c7f5a2 Author: Chengguang Xu Date: Sat Apr 24 22:03:15 2021 +0800 ovl: skip checking lower file's i_writecount on truncate It is possible that a directory tree is shared between multiple overlay instances as a lower layer. In this case when one instance executes a file residing on the lower layer, the other instance denies a truncate(2) call on this file. This only happens for truncate(2) and not for open(2) with the O_TRUNC flag. Fix this interference and inconsistency by removing the preliminary i_writecount check before copy-up. This means that unlike on normal filesystems truncate(argv[0]) will now succeed. If this ever causes a regression in a real world use case this needs to be revisited. One way to fix this properly would be to keep a correct i_writecount in the overlay inode, but that is difficult due to memory mapping code only dealing with the real file/inode. Signed-off-by: Chengguang Xu Signed-off-by: Miklos Szeredi commit ffb24e3c657869b256c3f90792d262fe09f49628 Author: Amir Goldstein Date: Tue Apr 27 13:28:26 2021 +0300 ovl: relax lookup error on mismatch origin ftype We get occasional reports of lookup errors due to mismatched origin ftype from users that re-format a lower squashfs image. Commit 13c6ad0f45fd ("ovl: document lower modification caveats") tries to discourage the practice of re-formating lower layers and describes the expected behavior as undefined. Commit b0e0f69731cd ("ovl: restrict lower null uuid for "xino=auto"") limits the configurations in which origin file handles are followed. In addition to these measures, change the behavior in case of detecting a mismatch origin ftype in lookup to issue a warning, not follow origin, but not fail the lookup operation either. That should make overall more users happy without any big consequences. Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxgPq9E9xxwU2CDyHy-_yCZZeymg+3n+-6AqkGGE1YtwvQ@mail.gmail.com/ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 1fc31aac96d7060ecee18124be6de18cb2268922 Author: Vyacheslav Yurkov Date: Thu May 27 19:45:47 2021 +0200 ovl: do not set overlay.opaque for new directories Enable optimizations only if user opted-in for any of extended features. If optimization is enabled, it breaks existing use case when a lower layer directory appears after directory was created on a merged layer. If overlay.opaque is applied, new files on lower layer are not visible. Consider the following scenario: - /lower and /upper are mounted to /merged - directory /merged/new-dir is created with a file test1 - overlay is unmounted - directory /lower/new-dir is created with a file test2 - overlay is mounted again If opaque is applied by default, file test2 is not going to be visible without explicitly clearing the overlay.opaque attribute Signed-off-by: Vyacheslav Yurkov Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit ca45275cd6b63e917eef681f9f15978b96afdbbe Author: Vyacheslav Yurkov Date: Thu May 27 19:45:46 2021 +0200 ovl: add ovl_allow_offline_changes() helper Allows to check whether any of extended features are enabled Signed-off-by: Vyacheslav Yurkov Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit e4522bc8733dce1cb4443f1d506869781ee9caa8 Author: Vyacheslav Yurkov Date: Thu May 27 19:45:45 2021 +0200 ovl: disable decoding null uuid with redirect_dir Currently decoding origin with lower null uuid is not allowed unless user opted-in to one of the new features that require following the lower inode of non-dir upper (index, xino, metacopy). Now we add redirect_dir too to that feature list. Signed-off-by: Vyacheslav Yurkov Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 096a218a588d78d699adcacb6919cff4718c4cac Author: Amir Goldstein Date: Sat Jun 19 12:26:19 2021 +0300 ovl: consistent behavior for immutable/append-only inodes When a lower file has immutable/append-only fileattr flags, the behavior of overlayfs post copy up is inconsistent. Immediattely after copy up, ovl inode still has the S_IMMUTABLE/S_APPEND inode flags copied from lower inode, so vfs code still treats the ovl inode as immutable/append-only. After ovl inode evict or mount cycle, the ovl inode does not have these inode flags anymore. We cannot copy up the immutable and append-only fileattr flags, because immutable/append-only inodes cannot be linked and because overlayfs will not be able to set overlay.* xattr on the upper inodes. Instead, if any of the fileattr flags of interest exist on the lower inode, we store them in overlay.protattr xattr on the upper inode and we read the flags from xattr on lookup and on fileattr_get(). This gives consistent behavior post copy up regardless of inode eviction from cache. When user sets new fileattr flags, we update or remove the overlay.protattr xattr. Storing immutable/append-only fileattr flags in an xattr instead of upper fileattr also solves other non-standard behavior issues - overlayfs can now copy up children of "ovl-immutable" directories and lower aliases of "ovl-immutable" hardlinks. Reported-by: Chengguang Xu Link: https://lore.kernel.org/linux-unionfs/20201226104618.239739-1-cgxu519@mykernel.net/ Link: https://lore.kernel.org/linux-unionfs/20210210190334.1212210-5-amir73il@gmail.com/ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 72db82115d2bdfbfba8b15a92d91872cfe1b40c6 Author: Amir Goldstein Date: Sat Jun 19 12:26:18 2021 +0300 ovl: copy up sync/noatime fileattr flags When a lower file has sync/noatime fileattr flags, the behavior of overlayfs post copy up is inconsistent. Immediately after copy up, ovl inode still has the S_SYNC/S_NOATIME inode flags copied from lower inode, so vfs code still treats the ovl inode as sync/noatime. After ovl inode evict or mount cycle, the ovl inode does not have these inode flags anymore. To fix this inconsistency, try to copy the fileattr flags on copy up if the upper fs supports the fileattr_set() method. This gives consistent behavior post copy up regardless of inode eviction from cache. We cannot copy up the immutable/append-only inode flags in a similar manner, because immutable/append-only inodes cannot be linked and because overlayfs will not be able to set overlay.* xattr on the upper inodes. Those flags will be addressed by a followup patch. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit a0c236b11706cc223252ad97e80871a18d9ee812 Author: Amir Goldstein Date: Sat Jun 19 12:26:17 2021 +0300 ovl: pass ovl_fs to ovl_check_setxattr() Instead of passing the overlay dentry. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 4f911138c8da94bcff84f1d093d28e378703c43f Author: Amir Goldstein Date: Sat Jun 19 12:26:16 2021 +0300 fs: add generic helper for filling statx attribute flags The immutable and append-only properties on an inode are published on the inode's i_flags and enforced by the VFS. Create a helper to fill the corresponding STATX_ATTR_ flags in the kstat structure from the inode's i_flags. Only orange was converted to use this helper. Other filesystems could use it in the future. Suggested-by: Miklos Szeredi Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 4aefc7973cfc0dace91a9a95f4f554ecd0364caf Merge: 2cb594240b7a2 affce9a774ca2 Author: David S. Miller Date: Tue Aug 17 10:37:29 2021 +0100 Merge branch 'bridge-vlan-fixes' Nikolay Aleksandrov says: ==================== net: bridge: vlan: fixes for vlan mcast contexts These are four fixes for vlan multicast contexts. The first patch enables mcast ctx snooping when adding already existing master vlans to be consistent with the rest of the code. The second patch accounts for the mcast ctx router ports when allocating skb for notification. The third one fixes two suspicious rcu usages due to wrong vlan group helper, and the fourth updates host vlan mcast state along with port mcast state. ==================== Signed-off-by: David S. Miller commit affce9a774ca2514aaa5638fde92c57a476dfd79 Author: Nikolay Aleksandrov Date: Mon Aug 16 17:57:07 2021 +0300 net: bridge: mcast: toggle also host vlan state in br_multicast_toggle_vlan When changing vlan mcast state by br_multicast_toggle_vlan it iterates over all ports and enables/disables the port mcast ctx based on the new state, but I forgot to update the host vlan (bridge master vlan entry) with the new state so it will be left out. Also that function is not used outside of br_multicast.c, so make it static. Fixes: f4b7002a7076 ("net: bridge: add vlan mcast snooping knob") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 3f0d14efe2fa8656a1c46f1d13d42bb5bd88f32f Author: Nikolay Aleksandrov Date: Mon Aug 16 17:57:06 2021 +0300 net: bridge: mcast: use the correct vlan group helper When dereferencing the port vlan group we should use the rcu helper instead of the one relying on rtnl. In br_multicast_pg_to_port_ctx the entry cannot disappear as we hold the multicast lock and rcu as explained in the comment above it. For the same reason we're ok in br_multicast_start_querier. ============================= WARNING: suspicious RCU usage 5.14.0-rc5+ #429 Tainted: G W ----------------------------- net/bridge/br_private.h:1478 suspicious rcu_dereference_protected() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 3 locks held by swapper/2/0: #0: ffff88822be85eb0 ((&p->timer)){+.-.}-{0:0}, at: call_timer_fn+0x5/0x2da #1: ffff88810b32f260 (&br->multicast_lock){+.-.}-{3:3}, at: br_multicast_port_group_expired+0x28/0x13d [bridge] #2: ffffffff824f6c80 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire.constprop.0+0x0/0x22 [bridge] stack backtrace: CPU: 2 PID: 0 Comm: swapper/2 Kdump: loaded Tainted: G W 5.14.0-rc5+ #429 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x59 nbp_vlan_group+0x3e/0x44 [bridge] br_multicast_pg_to_port_ctx+0xd6/0x10d [bridge] br_multicast_star_g_handle_mode+0xa1/0x2ce [bridge] ? netlink_broadcast+0xf/0x11 ? nlmsg_notify+0x56/0x99 ? br_mdb_notify+0x224/0x2e9 [bridge] ? br_multicast_del_pg+0x1dc/0x26d [bridge] br_multicast_del_pg+0x1dc/0x26d [bridge] br_multicast_port_group_expired+0xaa/0x13d [bridge] ? __grp_src_delete_marked.isra.0+0x35/0x35 [bridge] ? __grp_src_delete_marked.isra.0+0x35/0x35 [bridge] call_timer_fn+0x134/0x2da __run_timers+0x169/0x193 run_timer_softirq+0x19/0x2d __do_softirq+0x1bc/0x42a __irq_exit_rcu+0x5c/0xb3 irq_exit_rcu+0xa/0x12 sysvec_apic_timer_interrupt+0x5e/0x75 asm_sysvec_apic_timer_interrupt+0x12/0x20 RIP: 0010:default_idle+0xc/0xd Code: e8 14 40 71 ff e8 10 b3 ff ff 4c 89 e2 48 89 ef 31 f6 5d 41 5c e9 a9 e8 c2 ff cc cc cc cc 0f 1f 44 00 00 e8 7f 55 65 ff fb f4 0f 1f 44 00 00 55 65 48 8b 2c 25 40 6f 01 00 53 f0 80 4d 02 20 RSP: 0018:ffff88810033bf00 EFLAGS: 00000206 RAX: ffffffff819cf828 RBX: ffff888100328000 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff819cfa2d RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 R10: ffff8881008302c0 R11: 00000000000006db R12: 0000000000000000 R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000 ? __sched_text_end+0x4/0x4 ? default_idle_call+0x15/0x7b default_idle_call+0x4d/0x7b do_idle+0x124/0x2a2 cpu_startup_entry+0x1d/0x1f secondary_startup_64_no_verify+0xb0/0xbb Fixes: 74edfd483de8 ("net: bridge: multicast: add helper to get port mcast context from port group") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 05d6f38ec0a5108596941f8b25d92c45aa08fc40 Author: Nikolay Aleksandrov Date: Mon Aug 16 17:57:05 2021 +0300 net: bridge: vlan: account for router port lists when notifying When sending a global vlan notification we should account for the number of router ports when allocating the skb, otherwise we might end up losing notifications. Fixes: dc002875c22b ("net: bridge: vlan: use br_rports_fill_info() to export mcast router ports") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit b92dace38f8f8ee9895fa211b79ad1b5ba3a2020 Author: Nikolay Aleksandrov Date: Mon Aug 16 17:57:04 2021 +0300 net: bridge: vlan: enable mcast snooping for existing master vlans We always create a vlan with enabled mcast snooping, so when the user turns on per-vlan mcast contexts they'll get consistent behaviour with the current situation, but one place wasn't updated when a bridge/master vlan which already exists (created due to port vlans) is being added as real bridge vlan (BRIDGE_VLAN_INFO_BRENTRY). We need to enable mcast snooping for that vlan when that happens. Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 4d314179d62b19d0b5ac8de51b491494359c7a19 Merge: 9b35ab1e314c3 f95c4c56d6522 Author: Arnd Bergmann Date: Tue Aug 17 11:30:40 2021 +0200 Merge tag 'qcom-dts-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm dts updates for v5.15 This introduces the MSM8226 platform and an initial dts for the Samsung Galaxy S III Neo phone. MSM8974 gains another UART and this is used to enable Bluetooth on the Sony Xperia Z2 Tablet. Samsung Galaxy S5 gains regulator definitions for audio and modem remoteprocs, effectively enabling these. DSI clocks on APQ8064 are updates as the old legacy clock names are no longer supported by the driver. And IPQ806x GMAC nodes gains AHB resets wired up. Lastly APQ8060 is converted to a SPDX header and the ethernet node is updates in accordance with the binding. * tag 'qcom-dts-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: add ahb reset to ipq806x-gmac ARM: dts: qcom: Fix up APQ8060 DragonBoard license ARM: dts: qcom: msm8974: castor: Add Bluetooth-related nodes ARM: dts: qcom: msm8974: Add blsp2_uart7 for bluetooth on sirius ARM: dts: qcom: Add initial DTS file for Samsung Galaxy S III Neo phone dt-bindings: arm: qcom: Document MSM8226 SoC binding ARM: dts: qcom: Add support for MSM8226 SoC ARM: dts: qcom: apq8060: Correct Ethernet node name and drop bogus irq property ARM: dts: qcom: apq8064: correct clock names ARM: dts: qcom: msm8974-klte: Enable remote processors Link: https://lore.kernel.org/r/20210816211957.579365-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 2cb594240b7a28cb3badfb651351d8c9bfab228d Merge: 354e1f9d8863d aee512249190b Author: David S. Miller Date: Tue Aug 17 10:06:33 2021 +0100 Merge branch 'octeonx2-mcam-management-rework' Subbaraya Sundeep says: ==================== octeontx2: Rework MCAM flows management for VFs From Octeontx2 hardware point of view there is no difference between PFs and VFs. Hence with refactoring in driver the packet classification features or offloads can be supported by VFs also. This patchset unifies the mcam flows management so that VFs can also support ntuple filters. Since there are MCAM allocations by all PFs and VFs in the system it is required to have the ability to modify number of mcam rules count for a PF/VF in runtime. This is achieved by using devlink. Below is the summary of patches: Patch 1,2,3 are trivial patches which helps in debugging in case of errors by using custom error codes and displaying proper error messages. Patches 4,5 brings rx-all and ntuple support for CGX mapped VFs and LBK VFs. Patches 6,7,8 brings devlink support to PF netdev driver so that mcam entries count can be changed at runtime. To change mcam rule count at runtime where multiple rule allocations are done sorting is required. Also both ntuple and TC rules needs to be unified. Patch 9 is related to AF NPC where a PF allocated entries are allocated at bottom(low priority). On CN10K there is slight change in reading NPC counters which is handled by patch 10. Patch 11 is to allow packets from CPT for NPC parsing on CN10K. ==================== Signed-off-by: David S. Miller commit aee512249190b51599a451e0d151f9335a57d6cc Author: Vidya Date: Tue Aug 17 10:14:53 2021 +0530 octeontx2-af: configure npc for cn10k to allow packets from cpt On CN10K, the higher bits in the channel number represents the CPT channel number. Mask out these higher bits in the npc configuration to allow packets from cpt for parsing. Signed-off-by: Vidya Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 99b8e5479d499bb572538f0f290e720315b78f61 Author: Hariprasad Kelam Date: Tue Aug 17 10:14:52 2021 +0530 octeontx2-af: cn10K: Get NPC counters value The way SW can identify the number NPC counters supported by silicon has changed for CN10K. This patch addresses this reading appropriate registers to find out number of counters available. Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 7df5b4b260ddc1d20ab0e711df68c806ee393178 Author: Subbaraya Sundeep Date: Tue Aug 17 10:14:51 2021 +0530 octeontx2-af: Allocate low priority entries for PF If the mcam entry allocation request is from PF and NOT a priority allocation request then allocate low priority entries so that PF entries always have lower priority than its VFs. This is required so that entries with (base) MCAM match criteria have lower priority compared to entries with (base + additional) match criteria. This patch considers only best case scenario where PF entries are allocated from low priority zone if low priority zone has free space. There are worst case scenarios like: 1. VFs allocating hundreds of MCAM entries leading to VFs using all mid priority zone and low priority zone entries hence no entries free from low priority zone for PF. 2. All the PFs and VFs in the system allocating and freeing entries causing fragmentation in MCAM space and all the entries requested by PF could not fit in low priority zone for allocation. This patch do not handle worst case scenarios. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 2da48943274712fc3204089d9a97078350765635 Author: Sunil Goutham Date: Tue Aug 17 10:14:50 2021 +0530 octeontx2-pf: devlink params support to set mcam entry count Added support for setting or modifying MCAM entry count at runtime via devlink params. commands: devlink dev param show pci/0002:02:00.0: name mcam_count type driver-specific values: cmode runtime value 16 devlink dev param set pci/0002:02:00.0 name mcam_count value 64 cmode runtime Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 2e2a8126ffac66b9b177ce78ad430281c0c8cc74 Author: Sunil Goutham Date: Tue Aug 17 10:14:49 2021 +0530 octeontx2-pf: Unify flow management variables Variables used for TC flow management like maximum number of flows, number of flows installed etc are a copy of ntuple flow management variables. Since both TC and NTUPLE are not supported at the same time, it's better to unify these with common variables. This patch addresses this unification and also does cleanup of other minor stuff wrt TC. Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit cc65fcab88be74ee592387e0df7e6d4407f3a339 Author: Sunil Goutham Date: Tue Aug 17 10:14:48 2021 +0530 octeontx2-pf: Sort the allocated MCAM entry indices Per single mailbox request a maximum of 256 MCAM entries can be allocated. If more than 256 are being allocated, then the mcam indices in the final list could get jumbled. Hence sort the indices. Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 3cffaed2136cd66ed4647ad7d718011c263f54af Author: Rakesh Babu Date: Tue Aug 17 10:14:47 2021 +0530 octeontx2-pf: Ntuple filters support for VF netdev Add packet flow classification support for both LMAC mapped virtual functions and loopback VFs. This patch adds supports for ntuple offload feature. Signed-off-by: Rakesh Babu Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 0b3834aeaf473b2238b83084629d33b564a0114e Author: Sunil Goutham Date: Tue Aug 17 10:14:46 2021 +0530 octeontx2-pf: Enable NETIF_F_RXALL support for VF driver Enabled NETIF_F_RXALL support for VF driver. Also removed MTU range comments which are no longer valid. Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit a83bdada06bfeab43b81ec14551a59e517693f76 Author: Sunil Goutham Date: Tue Aug 17 10:14:45 2021 +0530 octeontx2-af: Add debug messages for failures Added debug messages for various failures during probe. This will help in quickly identifying the API where the failure is happening. Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 7278c359e52cbaa0ef819d15d0f2c27de9cc527b Author: Naveen Mamindlapalli Date: Tue Aug 17 10:14:44 2021 +0530 octeontx2-af: add proper return codes for AF mailbox handlers Add appropriate error codes to be used when returning from AF mailbox handlers due to some error condition. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 9cfc580956888fbb3e74944f32a59ef347469be1 Author: Subbaraya Sundeep Date: Tue Aug 17 10:14:43 2021 +0530 octeontx2-af: Modify install flow error codes When installing a flow using npc_install_flow mailbox there are number of reasons to reject the request like caller is not permitted, invalid channel specified in request, flow not supported in extraction profile and so on. Hence define new error codes for npc flows and use them instead of generic error codes. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 354e1f9d8863d6ef8138a7c61cc169598e17c5d1 Merge: e3faa49bcecdf ff9b7521468bc Author: David S. Miller Date: Tue Aug 17 09:51:19 2021 +0100 Merge tag 'mlx5-updates-2021-08-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2021-08-16 The following patchset provides two separate mlx5 updates 1) Ethtool RSS context and MQPRIO channel mode support: 1.1) enable mlx5e netdev driver to allow creating Transport Interface RX (TIRs) objects on the fly to be used for ethtool RSS contexts and TX MQPRIO channel mode 1.2) Introduce mlx5e_rss object to manage such TIRs. 1.3) Ethtool support for RSS context 1.4) Support MQPRIO channel mode 2) Bridge offloads Lag support: to allow adding bond net devices to mlx5 bridge 2.1) Address bridge port by (vport_num, esw_owner_vhca_id) pair since vport_num is only unique per eswitch and in lag mode we need to manage ports from both eswitches. 2.2) Allow connectivity between representors of different eswitch instances that are attached to same bridge 2.3) Bridge LAG, Require representors to be in shared FDB mode and introduce local and peer ports representors, match on paired eswitch metadata in peer FDB entries, And finally support addition/deletion and aging of peer flows. ==================== Signed-off-by: David S. Miller commit 6f802696c2faf0119781fc3b7977a4eedf9ab239 Author: Jaime Liao Date: Mon Aug 9 09:27:52 2021 +0800 mtd: spinand: macronix: Add Quad support for serial NAND flash Adding FLAG "SPINAND_HAS_QE_BIT" for Quad mode support on Macronix Serial Flash. Validated via normal(default) and QUAD mode by read, erase, read back, on Xilinx Zynq PicoZed FPGA board which included Macronix SPI Host(drivers/spi/spi-mxic.c). Signed-off-by: Jaime Liao Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1628472472-32008-1-git-send-email-jaimeliao@mxic.com.tw commit 8b07e990fb254fcbaa919616ac77f981cb48c73d Author: Iwona Winiarska Date: Wed Aug 4 01:48:19 2021 +0200 soc: aspeed: p2a-ctrl: Fix boundary check for mmap The check mixes pages (vm_pgoff) with bytes (vm_start, vm_end) on one side of the comparison, and uses resource address (rather than just the resource size) on the other side of the comparison. This can allow malicious userspace to easily bypass the boundary check and map pages that are located outside memory-region reserved by the driver. Fixes: 01c60dcea9f7 ("drivers/misc: Add Aspeed P2A control driver") Cc: stable@vger.kernel.org Signed-off-by: Iwona Winiarska Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit b49a0e69a7b1a68c8d3f64097d06dabb770fec96 Author: Iwona Winiarska Date: Wed Aug 4 01:48:18 2021 +0200 soc: aspeed: lpc-ctrl: Fix boundary check for mmap The check mixes pages (vm_pgoff) with bytes (vm_start, vm_end) on one side of the comparison, and uses resource address (rather than just the resource size) on the other side of the comparison. This can allow malicious userspace to easily bypass the boundary check and map pages that are located outside memory-region reserved by the driver. Fixes: 6c4e97678501 ("drivers/misc: Add Aspeed LPC control driver") Cc: stable@vger.kernel.org Signed-off-by: Iwona Winiarska Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit 8fc8e903156f42c66245838441d03607e9067381 Author: Takashi Iwai Date: Tue Aug 17 09:56:30 2021 +0200 ALSA: hda: Drop workaround for a hang at shutdown again The commit 0165c4e19f6e ("ALSA: hda: Fix hang during shutdown due to link reset") modified the shutdown callback of the HD-audio controller for working around a hang. Meanwhile, the actual culprit of the hang was identified to be the leftover active codecs that may interfere with the powered down controller somehow, but we took a minimal fix approach for 5.14, and that was the commit above. Now, since the codec drivers go runtime-suspend at shutdown for 5.15, we can revert the change and make sure that the full runtime-suspend is performed at shutdown of HD-audio controller again. This patch essentially reverts the commit above to restore the behavior. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210817075630.7115-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit c0a7f9372cf0fc9bd0a73eb287664e26e5b18f1e Merge: 327b34f2a97d7 4bf61ad5f0204 Author: Takashi Iwai Date: Tue Aug 17 09:46:27 2021 +0200 Merge branch 'for-linus' into for-next commit 8d04fbe71fa06bb3671f449026178adfbf45dc74 Author: Darrick J. Wong Date: Wed Aug 11 08:26:56 2021 -0700 iomap: move loop control code to iter.c Now that we've moved iomap to the iterator model, rename this file to be in sync with the functions contained inside of it. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit fad0a1ab34f777bd8a95c6cebd70ee899b6e159e Author: Christoph Hellwig Date: Tue Aug 10 18:33:16 2021 -0700 iomap: constify iomap_iter_srcmap The srcmap returned from iomap_iter_srcmap is never modified, so mark the iomap returned from it const and constify a lot of code that never modifies the iomap. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 65dd814a6187ff46e33718d8eb76244e027837a3 Author: Christoph Hellwig Date: Tue Aug 10 18:33:15 2021 -0700 fsdax: switch the fault handlers to use iomap_iter Avoid the open coded calls to ->iomap_begin and ->iomap_end and call iomap_iter instead. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c2436190e492b243235262fc080a2c3189021be9 Author: Shiyang Ruan Date: Tue Aug 10 18:33:15 2021 -0700 fsdax: factor out a dax_fault_actor() helper The core logic in the two dax page fault functions is similar. So, move the logic into a common helper function. Also, to facilitate the addition of new features, such as CoW, switch-case is no longer used to handle different iomap types. Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong Signed-off-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 55f81639a7152848f204f9af3f9b1a14a5944be1 Author: Shiyang Ruan Date: Tue Aug 10 18:33:14 2021 -0700 fsdax: factor out helpers to simplify the dax fault code The dax page fault code is too long and a bit difficult to read. And it is hard to understand when we trying to add new features. Some of the PTE/PMD codes have similar logic. So, factor out helper functions to simplify the code. Signed-off-by: Shiyang Ruan Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong [hch: minor cleanups] Signed-off-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit b74b1293e6cae70bade491067f15b9d33e040cad Author: Christoph Hellwig Date: Tue Aug 10 18:33:14 2021 -0700 iomap: rework unshare flag Instead of another internal flags namespace inside of buffered-io.c, just pass a UNSHARE hint in the main iomap flags field. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1b5c1e36dc0e0f15de9717e81508934cbc3daf15 Author: Christoph Hellwig Date: Tue Aug 10 18:33:14 2021 -0700 iomap: pass an iomap_iter to various buffered I/O helpers Pass the iomap_iter structure instead of individual parameters to various internal helpers for buffered I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 57320a01fe1ffb61c483f3734f62722f74263521 Author: Christoph Hellwig Date: Tue Aug 10 18:33:13 2021 -0700 iomap: remove iomap_apply iomap_apply is unused now, so remove it. Signed-off-by: Christoph Hellwig [djwong: rebase this patch to preserve git history of iomap loop control] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit ca289e0b95afa973d204c77a4ad5c37e06145fbf Author: Christoph Hellwig Date: Tue Aug 10 18:33:13 2021 -0700 fsdax: switch dax_iomap_rw to use iomap_iter Switch the dax_iomap_rw implementation to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3d99a1ce3854a6cee3217247ab6b2cca3985a7a2 Author: Christoph Hellwig Date: Tue Aug 10 18:33:12 2021 -0700 iomap: switch iomap_swapfile_activate to use iomap_iter Switch iomap_swapfile_activate to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c4740bf1edad559c10b1d33c72e885b920bf6029 Author: Christoph Hellwig Date: Tue Aug 10 18:33:12 2021 -0700 iomap: switch iomap_seek_data to use iomap_iter Rewrite iomap_seek_data to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 40670d18e878160a170ba135c5d077471d7a9998 Author: Christoph Hellwig Date: Tue Aug 10 18:33:11 2021 -0700 iomap: switch iomap_seek_hole to use iomap_iter Rewrite iomap_seek_hole to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6d8a1287a48909dbf542470aa2ca1ef7ceab3fc1 Author: Christoph Hellwig Date: Tue Aug 10 18:33:11 2021 -0700 iomap: switch iomap_bmap to use iomap_iter Rewrite the ->bmap implementation based on iomap_iter. Signed-off-by: Christoph Hellwig [djwong: restructure the loop to make its behavior a little clearer] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 7892386d35715d14c469ec98b6deab037e2e2232 Author: Christoph Hellwig Date: Tue Aug 10 18:33:10 2021 -0700 iomap: switch iomap_fiemap to use iomap_iter Rewrite the ->fiemap implementation based on iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a6d3d49587d10d23189675fce11b332a915081ff Author: Christoph Hellwig Date: Tue Aug 10 18:33:10 2021 -0700 iomap: switch __iomap_dio_rw to use iomap_iter Switch __iomap_dio_rw to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 253564bafff31382b412839b0e1bb44c19c51172 Author: Christoph Hellwig Date: Tue Aug 10 18:33:09 2021 -0700 iomap: switch iomap_page_mkwrite to use iomap_iter Switch iomap_page_mkwrite to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2aa3048e03d38d5358be2553d4b638c1a018498c Author: Christoph Hellwig Date: Tue Aug 10 18:33:09 2021 -0700 iomap: switch iomap_zero_range to use iomap_iter Switch iomap_zero_range to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8fc274d1f4b4fe629da3b84b6e5a7ef08a91df49 Author: Christoph Hellwig Date: Tue Aug 10 18:33:09 2021 -0700 iomap: switch iomap_file_unshare to use iomap_iter Switch iomap_file_unshare to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ce83a0251c6ec2152f3449484d22e87f467c4a66 Author: Christoph Hellwig Date: Tue Aug 10 18:33:08 2021 -0700 iomap: switch iomap_file_buffered_write to use iomap_iter Switch iomap_file_buffered_write to use iomap_iter. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f6d480006cea3fa1188931fe9751255f13365c4e Author: Christoph Hellwig Date: Tue Aug 10 18:33:08 2021 -0700 iomap: switch readahead and readpage to use iomap_iter Switch the page cache read functions to use iomap_iter instead of iomap_apply. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f4b896c213f0752adc828ddc11bd55419ffab248 Author: Christoph Hellwig Date: Tue Aug 10 18:33:07 2021 -0700 iomap: add the new iomap_iter model The iomap_iter struct provides a convenient way to package up and maintain all the arguments to the various mapping and operation functions. It is operated on using the iomap_iter() function that is called in loop until the whole range has been processed. Compared to the existing iomap_apply() function this avoid an indirect call for each iteration. For now iomap_iter() calls back into the existing ->iomap_begin and ->iomap_end methods, but in the future this could be further optimized to avoid indirect calls entirely. Based on an earlier patch from Matthew Wilcox . Signed-off-by: Christoph Hellwig [djwong: add to apply.c to preserve git history of iomap loop control] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 740499c78408f75c4e76feac848177cb0d0ccf4f Author: Christoph Hellwig Date: Tue Aug 10 18:33:07 2021 -0700 iomap: fix the iomap_readpage_actor return value for inline data The actor should never return a larger value than the length that was passed in. The current code handles this gracefully, but the opcoming iter model will be more picky. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1acd9e9c015b389aa3201a977454efb92e36806c Author: Christoph Hellwig Date: Tue Aug 10 18:33:06 2021 -0700 iomap: mark the iomap argument to iomap_read_page_sync const iomap_read_page_sync never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 78c64b00f842ac704d0612553dd124c31b4afceb Author: Christoph Hellwig Date: Tue Aug 10 18:33:06 2021 -0700 iomap: mark the iomap argument to iomap_read_inline_data const iomap_read_inline_data never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7e4f4b2d689d959b03cb07dfbdb97b9696cb1076 Author: Christoph Hellwig Date: Tue Aug 10 18:33:05 2021 -0700 fsdax: mark the iomap argument to dax_iomap_sector as const Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6d49cc8545e9e9e9e5a14e75fd044f049bd6077e Author: Christoph Hellwig Date: Tue Aug 10 18:33:05 2021 -0700 fs: mark the iomap argument to __block_write_begin_int const __block_write_begin_int never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e3c4ffb0c2219e720acdc6072c6ddaccac5cab79 Author: Christoph Hellwig Date: Tue Aug 10 18:33:05 2021 -0700 iomap: mark the iomap argument to iomap_inline_data_valid const Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 4495c33e4d302b8d3a9eb483c06b2687d27dab9d Author: Christoph Hellwig Date: Tue Aug 10 18:33:04 2021 -0700 iomap: mark the iomap argument to iomap_inline_data const Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 66b8165ed4b5a2e7ddb7b9bbf3586b7ccdd86a1c Author: Christoph Hellwig Date: Tue Aug 10 18:33:04 2021 -0700 iomap: mark the iomap argument to iomap_sector const Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1d25d0aecfcd480b1a997a709c1b37e56ddc3c38 Author: Christoph Hellwig Date: Tue Aug 10 18:33:03 2021 -0700 iomap: remove the iomap arguments to ->page_{prepare,done} These aren't actually used by the only instance implementing the methods. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d9d381f3ef5b2a4bee3e98d7b9f3b09cf00119c0 Author: Christoph Hellwig Date: Tue Aug 10 18:33:03 2021 -0700 iomap: fix a trivial comment typo in trace.h Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6b8b31269898b8891f1f3a95578ceeb109393e23 Author: Jim Wright Date: Mon Aug 16 11:00:02 2021 -0500 ARM: dts: aspeed: p10bmc: Add power control pins Add to p10bmc systems the GPIO line names used in chassis power on / off control and chassis power good monitoring. Names used are as documented at [1]. [1] https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md Signed-off-by: Jim Wright Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210816160002.18645-1-jlwright@us.ibm.com Signed-off-by: Joel Stanley commit 9891668e43c8e9f2d0d50088b151edefc2e560e5 Author: Christoph Hellwig Date: Mon Aug 16 14:45:29 2021 +0200 nvme: remove the unused NVME_NS_* enum These values are unused now that the lightnvm support is gone. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch commit 29668d7e9d842be722a4c0416bb577828026ce4f Author: Namjae Jeon Date: Tue Aug 17 13:06:38 2021 +0900 MAINTAINERS: add git adddress of ksmbd Add missing git address of ksmbd. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3c3bd542ffbb2ac09631313ede46ae66660ae550 Author: Yucong Sun Date: Mon Aug 16 10:52:50 2021 -0700 selftests/bpf: Add exponential backoff to map_update_retriable in test_maps Using a fixed delay of 1 microsecond has proven flaky in slow CPU environment, e.g. Github Actions CI system. This patch adds exponential backoff with a cap of 50ms to reduce the flakiness of the test. Initial delay is chosen at random in the range [0ms, 5ms). Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210816175250.296110-1-fallentree@fb.com commit 1e1e49df0277815f2c32b2796dc8b53dfcfc38c0 Merge: edce1a2486703 31c50aeed5a12 Author: Andrii Nakryiko Date: Mon Aug 16 18:42:18 2021 -0700 Merge branch 'sockmap: add sockmap support for unix stream socket' Jiang Wang says: ==================== This patch series add support for unix stream type for sockmap. Sockmap already supports TCP, UDP, unix dgram types. The unix stream support is similar to unix dgram. Also add selftests for unix stream type in sockmap tests. ==================== Signed-off-by: Andrii Nakryiko commit 31c50aeed5a12ded8856312c13bb6dc9e64dc87f Author: Jiang Wang Date: Mon Aug 16 19:03:24 2021 +0000 selftest/bpf: Add new tests in sockmap for unix stream to tcp. Add two new test cases in sockmap tests, where unix stream is redirected to tcp and vice versa. Signed-off-by: Jiang Wang Signed-off-by: Andrii Nakryiko Reviewed-by: Cong Wang Acked-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20210816190327.2739291-6-jiang.wang@bytedance.com commit 75e0e27db6cf0d1eaa9f79c4bfab63e209394c0f Author: Jiang Wang Date: Mon Aug 16 19:03:23 2021 +0000 selftest/bpf: Change udp to inet in some function names This is to prepare for adding new unix stream tests. Mostly renames, also pass the socket types as an argument. Signed-off-by: Jiang Wang Signed-off-by: Andrii Nakryiko Reviewed-by: Cong Wang Acked-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20210816190327.2739291-5-jiang.wang@bytedance.com commit 9b03152bd4691ba80f181413799b7fd36e83e564 Author: Jiang Wang Date: Mon Aug 16 19:03:22 2021 +0000 selftest/bpf: Add tests for sockmap with unix stream type. Add two tests for unix stream to unix stream redirection in sockmap tests. Signed-off-by: Jiang Wang Signed-off-by: Andrii Nakryiko Reviewed-by: Cong Wang Acked-by: Jakub Sitnicki Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210816190327.2739291-4-jiang.wang@bytedance.com commit 94531cfcbe79c3598acf96806627b2137ca32eb9 Author: Jiang Wang Date: Mon Aug 16 19:03:21 2021 +0000 af_unix: Add unix_stream_proto for sockmap Previously, sockmap for AF_UNIX protocol only supports dgram type. This patch add unix stream type support, which is similar to unix_dgram_proto. To support sockmap, dgram and stream cannot share the same unix_proto anymore, because they have different implementations, such as unhash for stream type (which will remove closed or disconnected sockets from the map), so rename unix_proto to unix_dgram_proto and add a new unix_stream_proto. Also implement stream related sockmap functions. And add dgram key words to those dgram specific functions. Signed-off-by: Jiang Wang Signed-off-by: Andrii Nakryiko Reviewed-by: Cong Wang Acked-by: Jakub Sitnicki Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210816190327.2739291-3-jiang.wang@bytedance.com commit 77462de14a43f4d98dbd8de0f5743a4e02450b1d Author: Jiang Wang Date: Mon Aug 16 19:03:20 2021 +0000 af_unix: Add read_sock for stream socket types To support sockmap for af_unix stream type, implement read_sock, which is similar to the read_sock for unix dgram sockets. Signed-off-by: Jiang Wang Signed-off-by: Andrii Nakryiko Reviewed-by: Cong Wang Acked-by: Jakub Sitnicki Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210816190327.2739291-2-jiang.wang@bytedance.com commit edce1a248670397f8d0be1f6967eab3c5c082013 Author: Hengqi Chen Date: Sun Aug 15 16:10:35 2021 +0800 selftests/bpf: Test btf__load_vmlinux_btf/btf__load_module_btf APIs Add test for btf__load_vmlinux_btf/btf__load_module_btf APIs. The test loads bpf_testmod module BTF and check existence of a symbol which is known to exist. Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210815081035.205879-1-hengqi.chen@gmail.com commit 397ab98e2d69cede84444a28eab77a171983d14e Merge: f97a1b6580526 cb0927ab80d22 Author: Dave Airlie Date: Tue Aug 17 10:45:26 2021 +1000 Merge tag 'drm-msm-next-2021-08-12' of https://gitlab.freedesktop.org/drm/msm into drm-next This is the main pull for v5.15, after the early pull request with drm/scheduler conversion: * New a6xx GPU support: a680 and 7c3 * dsi: 7nm phi, sc7280 support, test pattern generator support * mdp4 fixes for older hw like the nexus7 * displayport fixes Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGs_tyanTeDGMH1X+Uf4wdyy7jYj-CinGXXVETiYOESahw@mail.gmail.com commit f97a1b658052640e18d14dcefcb90f01ae9e0d95 Merge: 2819cf0e7dbe4 9efb16c2fdd64 Author: Dave Airlie Date: Tue Aug 17 10:29:31 2021 +1000 Merge tag 'mediatek-drm-next-5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 5.15 1. MT8133 AAL support, adjust rdma fifo threshold formula. 2. Implement mmap as GEM object function. 3. Add support for MT8167. 4. Test component initialization earlier in the function mtk_drm_crtc_create. 5. CMDQ refinement. Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20210816232427.13368-1-chunkuang.hu@kernel.org commit e3faa49bcecdfcc80e94dd75709d6acb1a5d89f6 Author: Luke Hsiao Date: Mon Aug 16 20:51:06 2021 +0000 tcp: enable data-less, empty-cookie SYN with TFO_SERVER_COOKIE_NOT_REQD Since the original TFO server code was implemented in commit 168a8f58059a22feb9e9a2dcc1b8053dbbbc12ef ("tcp: TCP Fast Open Server - main code path") the TFO server code has supported the sysctl bit flag TFO_SERVER_COOKIE_NOT_REQD. Currently, when the TFO_SERVER_ENABLE and TFO_SERVER_COOKIE_NOT_REQD sysctl bit flags are set, a server connection will accept a SYN with N bytes of data (N > 0) that has no TFO cookie, create a new fast open connection, process the incoming data in the SYN, and make the connection ready for accepting. After accepting, the connection is ready for read()/recvmsg() to read the N bytes of data in the SYN, ready for write()/sendmsg() calls and data transmissions to transmit data. This commit changes an edge case in this feature by changing this behavior to apply to (N >= 0) bytes of data in the SYN rather than only (N > 0) bytes of data in the SYN. Now, a server will accept a data-less SYN without a TFO cookie if TFO_SERVER_COOKIE_NOT_REQD is set. Caveat! While this enables a new kind of TFO (data-less empty-cookie SYN), some firewall rules setup may not work if they assume such packets are not legit TFOs and will filter them. Signed-off-by: Luke Hsiao Acked-by: Neal Cardwell Acked-by: Yuchung Cheng Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20210816205105.2533289-1-luke.w.hsiao@gmail.com Signed-off-by: Jakub Kicinski commit bb57164920d738076bf91d65af35d8724526c21b Author: grantseltzer Date: Mon Aug 9 22:05:08 2021 -0400 bpf: Reconfigure libbpf docs to remove unversioned API This removes the libbpf_api.rst file from the kernel documentation. The intention for this file was to pull documentation from comments above API functions in libbpf. However, due to limitations of the kernel documentation system, this API documentation could not be versioned, which is counterintuative to how users expect to use it. There is also currently no doc comments, making this a blank page. Once the kernel comment documentation is actually contributed, it will still exist in the kernel repository, just in the code itself. A seperate site is being spun up to generate documentaiton from those comments in a way in which it can be versioned properly. This also reconfigures the bpf documentation index page to make it easier to sync to the previously mentioned documentaiton site. Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210810020508.280639-1-grantseltzer@gmail.com commit 4e25792f05ef843bcd6c79bf8085c734a5186aee Merge: fd04ed1ca37f3 b40fb16df9f49 Author: Jakub Kicinski Date: Mon Aug 16 17:18:49 2021 -0700 Merge branch 'ptp-ocp-minor-updates-and-fixes' Jonathan Lemon says: ==================== ptp: ocp: minor updates and fixes. Fix errors spotted by automated tools. Add myself to the MAINTAINERS for the ptp_ocp driver. ==================== Link: https://lore.kernel.org/r/20210816221337.390645-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski commit b40fb16df9f495ffeb4475950b68ee0fcba86b33 Author: Jonathan Lemon Date: Mon Aug 16 15:13:37 2021 -0700 MAINTAINERS: Update for ptp_ocp driver. Add maintainer info for the OpenCompute PTP driver. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit d79500e66a52103be31e62389cdd7ef345e4fe47 Author: Jonathan Lemon Date: Mon Aug 16 15:13:36 2021 -0700 ptp: ocp: Have Kconfig select NET_DEVLINK NET doesn't imply NET_DEVLINK. Select this separately, so that random config combinations don't complain. Reported-by: kernel test robot Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.") Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit d9fdbf132dab4d844167004ae4ca979fbebd9871 Author: Jonathan Lemon Date: Mon Aug 16 15:13:35 2021 -0700 ptp: ocp: Fix error path for pci_ocp_device_init() If ptp_ocp_device_init() fails, pci_disable_device() is skipped. Fix the error handling so this case is covered. Update ptp_ocp_remove() so the normal exit path is identical. Reported-by: Hulk Robot Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.") Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 7c8075728f4df477d94df2e4d23a95ee69ee9493 Author: Jonathan Lemon Date: Mon Aug 16 15:13:34 2021 -0700 ptp: ocp: Fix uninitialized variable warning spotted by clang. If attempting to flash the firmware with a blob of size 0, the entire write loop is skipped and the uninitialized err is returned. Fix by setting to 0 first. Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.") Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit ff9b7521468bc2909293c1cda66a245a49688f6f Author: Vlad Buslov Date: Sat Jul 17 18:05:44 2021 +0300 net/mlx5: Bridge, support LAG Allow adding bond net devices to mlx5 bridge with following changes: - Modify bridge representor code to obtain uplink represetor that belongs to eswitch that is registered for notification. Require representor to be in shared FDB mode. If representor is the lag master, then consider its port as local, otherwise treat it as peer. - Use devcom to match on paired eswitch metadata in peer FDB entries. This is necessary for shared FDB LAG to function since packets are always received on active eswitch instance as opposed to parent eswitch of port. - Support for deleting peer flows when receiving SWITCHDEV_FDB_DEL_TO_BRIDGE notification was implemented in one of previous patches in series. Now also implement support for handling SWITCHDEV_FDB_ADD_TO_BRIDGE which can be generated on peer by bridge update workqueue task in LAG configuration. Refresh the flow 'lastuse' timestamp to current jiffies when receiving such notification on eswitch that manages the local FDB entry. This allows peer entries to prevent ageing of the FDB. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit c358ea1741bc5dda7032e2145805761119d81608 Author: Vlad Buslov Date: Fri Jun 25 15:21:48 2021 +0300 net/mlx5: Bridge, allow merged eswitch connectivity Allow connectivity between representors of different eswitch instances that are attached to same bridge when merged_eswitch capability is enabled. Add ports of peer eswitch to bridge instance and mark them with MLX5_ESW_BRIDGE_PORT_FLAG_PEER. Mark FDBs offloaded on peer ports with MLX5_ESW_BRIDGE_FLAG_PEER flag. Such FDBs can only be aged out on their local eswitch instance, which then sends SWITCHDEV_FDB_DEL_TO_BRIDGE event. Listen to the event on mlx5 bridge implementation and delete peer FDBs in event handler. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit bf3d56d8f55f96024d18e94d2a87e31d9c1a6682 Author: Vlad Buslov Date: Fri Jul 23 11:15:13 2021 +0300 net/mlx5: Bridge, extract FDB delete notification to function SWITCHDEV_FDB_DEL_TO_BRIDGE notification is generated in multiple places in bridge code. Following patch in series changes the condition for the notification. Extract the notification into dedicated helper function mlx5_esw_bridge_fdb_del_notify() to only modify it in single place in the future changes. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 3ee6233e61a1f95426101cfc35f35f7ed0e7ed66 Author: Vlad Buslov Date: Thu Jun 17 18:07:29 2021 +0300 net/mlx5: Bridge, identify port by vport_num+esw_owner_vhca_id pair Following patches in series allow traffic between vports of different eswitch instances, which requires addressing bridge port by vport_num+esw_owner_vhca_id pair since vport_num is only unique per-eswitch. As a preparation, extend struct mlx5_esw_bridge_port with 'esw_owner_vhca_id' field and use it as part of key for mlx5_esw_bridge->vports xarray. With this change we can't rely on switchdev_handle_port_obj_add() helper to get mlx5 representor from stacked device because we need specifically representor from parent eswitch that registered the callback to obtain correct esw_owner_vhca_id. The helper doesn't allow passing additional parameters to predicate function and doesn't provide access to the notifier block to obtain eswitch through br_offloads. Implement custom helpers to obtain mlx5 representor and use them in mlx5_esw_bridge_port_obj_{add|del|attr_set}() implementations. Remove direct pointer to parent bridge from struct mlx5_vport as it is no longer needed. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit a514d17350597dea242c5486ef70a9ec013c1182 Author: Vlad Buslov Date: Sun Jul 18 18:55:45 2021 +0300 net/mlx5: Bridge, obtain core device from eswitch instead of priv Following patches in series will pass bond device to bridge, which means the code can't assume the device is mlx5 representor. Moreover, the core device can be easily obtained from eswitch instance, so there is no reason for more complex code that obtains struct mlx5_priv from net_device in order to use its mdev. Refactor the code to use esw->dev instead of priv->mdev. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 4de20e9a1225866a9a2ac2e12cddee51455991fa Author: Vlad Buslov Date: Thu Jun 17 15:32:56 2021 +0300 net/mlx5: Bridge, release bridge in same function where it is taken Refactor mlx5_esw_bridge_vport_link() to release the bridge instance if mlx5_esw_bridge_vport_init() returned an error instead of relying on it to release the bridge. This improves the design because object instance is taken and released in same layer and simplifies following patches that add more logic to mlx5_esw_bridge_vport_link(). Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit ec60c4581bd952296c1f81115eabd0a570042458 Author: Tariq Toukan Date: Wed Aug 11 15:06:21 2021 +0300 net/mlx5e: Support MQPRIO channel mode Add support for MQPRIO channel mode, in which a partition to TCs is defined over the channels. We allow partitions with contiguous queue indices, with no holes within. We do not allow modification to the num of channels while this MQPRIO mode is active. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 21ecfcb83a8588f21184eaa57c795c0c5a0eab2b Author: Tariq Toukan Date: Wed Aug 11 15:02:12 2021 +0300 net/mlx5e: Handle errors of netdev_set_num_tc() Add handling for failures in netdev_set_num_tc(). Let mlx5e_netdev_set_tcs return an int. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit e2aeac448f06ac6c6bee41a7ebecf814f7a57eef Author: Tariq Toukan Date: Tue Jul 6 14:11:57 2021 +0300 net/mlx5e: Maintain MQPRIO mode parameter This is in preparation for supporting MQPRIO CHANNEL mode in downstream patch, in addition to DCB mode that's supported today. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 86d747a3f9697abe477ad8fe847afa738d3991a0 Author: Tariq Toukan Date: Tue Jul 6 13:44:19 2021 +0300 net/mlx5e: Abstract MQPRIO params Abstract the MQPRIO params into a struct. Use a getter for DCB mode num_tcs. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 248d3b4c9a396f89da43ec7f6becf377e69efeca Author: Tariq Toukan Date: Mon Aug 16 16:31:57 2021 +0300 net/mlx5e: Support flow classification into RSS contexts Extend the existing flow classification support, to steer flows not only directly to a receive ring, but also into the new RSS contexts. Create needed TIR objects on demand, and hold reference on the RSS context. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit f01cc58c18d6457bd88b2c77c916a9e072f2b633 Author: Tariq Toukan Date: Mon Aug 16 16:30:04 2021 +0300 net/mlx5e: Support multiple RSS contexts Add support to multiple RSS contexts. Resources of the non-default RSS contexts are allocated and created on demand. Each RSS context can be controlled and configured separately, via the implemented ethtool ops. Here we limit the num of total contexts to 16. We do not enforce any kind of new limitation over the indirection table content. More specifically, two separate contexts can be configured to fully or partially point to the same set of receive rings. The default RSS context (index 0) is created with its full set of TIRs. All other contexts are created with an empty set, then TIRs are added upon first usage when steering rules are added. We use a reference counting mechanism to make sure an RSS context is not removed before the rules pointing to it. Block ethtool set_channels operations when multiple RSS contexts exist, as currently the kernel doesn't protect against inconsistent channels configs that break non-default RSS contexts. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 49095f641b69875fd36e9da277dbf299b27e3fb2 Author: Tariq Toukan Date: Sun Aug 15 14:38:08 2021 +0300 net/mlx5e: Dynamically allocate TIRs in RSS contexts Move from static to dynamic memory allocations for TIR. This is in preparation to supporting on-demand TIR operations in downstream patches, where every RSS context will be init with an empty set of TIRs. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 25307a91cb50a044921705c3b7dc714bee70cbcb Author: Tariq Toukan Date: Mon Aug 16 15:50:24 2021 +0300 net/mlx5e: Convert RSS to a dedicated object Code related to RSS is now encapsulated into a dedicated object and put into new files en/rss.{c,h}. All usages are converted. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 713ba5e5f6896cbdde7ddb339cd8b06eb7c7334a Author: Tariq Toukan Date: Sun Aug 15 14:21:46 2021 +0300 net/mlx5e: Introduce abstraction of RSS context Bring all fields that define and maintain RSS behavior together into a new structure. Align all usages with this new structure. Keep it hidden within rx_res.c. This helps supporting multiple RSS contexts in downstream patch. Use dynamic allocations for the RSS context. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit fc651ff9105adb44261774482380ee5f86ac24d9 Author: Tariq Toukan Date: Wed Jul 21 15:23:57 2021 +0300 net/mlx5e: Introduce TIR create/destroy API in rx_res Take TIR control operations in rx_res into functions. This is in preparation to supporting on-demand TIR operations in downstream patches. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 6e5fea51961e60ffd45a480dce23c4dd567fc5ec Author: Tariq Toukan Date: Thu Aug 12 15:19:00 2021 +0300 net/mlx5e: Do not try enable RSS when resetting indir table All calls to mlx5e_rx_res_rss_set_indir_uniform() occur while the RSS state is inactive, i.e. the RQT is pointing to the drop RQ, not to the channels' RQs. It means that the "apply" part of the function is not called. Remove this part from the function, and document the change. It will be useful for next patches in the series, allows code simplifications when multiple RSS contexts are introduced. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 9efb16c2fdd647d3888fd8dae84509f485cd554e Author: Yongqiang Niu Date: Wed Aug 11 09:47:48 2021 +0800 drm/mediatek: Clear pending flag when cmdq packet is done In cmdq mode, packet may be flushed before it is executed, so the pending flag should be cleared after cmdq packet is done. Signed-off-by: Yongqiang Niu Signed-off-by: Chun-Kuang Hu commit bc9241be73d9b2b3bcb7033598521fd669639848 Author: Chun-Kuang Hu Date: Sun Jul 4 16:27:01 2021 +0800 drm/mediatek: Add cmdq_handle in mtk_crtc One mtk_crtc need just one cmdq_handle, so add one cmdq_handle in mtk_crtc to prevent frequently allocation and free of cmdq_handle. Signed-off-by: Chun-Kuang Hu commit 8cdcb365342402fdeb664479b0a04e9debef8efb Author: Chun-Kuang Hu Date: Sun Jul 4 15:59:24 2021 +0800 drm/mediatek: Detect CMDQ execution timeout CMDQ is used to update display register in vblank period, so it should be execute in next vblank. If it fail to execute in next 2 vblank, tiemout happen. Signed-off-by: Chun-Kuang Hu commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837 Author: Chun-Kuang Hu Date: Sun Jul 4 15:36:48 2021 +0800 drm/mediatek: Remove struct cmdq_client In mailbox rx_callback, it pass struct mbox_client to callback function, but it could not map back to mtk_drm_crtc instance because struct cmdq_client use a pointer to struct mbox_client: struct cmdq_client { struct mbox_client client; struct mbox_chan *chan; }; struct mtk_drm_crtc { /* client instance data */ struct cmdq_client *cmdq_client; }; so remove struct cmdq_client and let mtk_drm_crtc instance define mbox_client as: struct mtk_drm_crtc { /* client instance data */ struct mbox_client cl; }; and in rx_callback function, use struct mbox_client to get struct mtk_drm_crtc. Signed-off-by: Chun-Kuang Hu commit c1ec54b7b5af25c779192253f5a9f05e95cb43d7 Author: Chun-Kuang Hu Date: Thu Jul 1 21:20:53 2021 +0800 drm/mediatek: 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. Signed-off-by: Chun-Kuang Hu commit 198b8c8ede36d2135df73fee19506276059a0f8e Merge: 97ec669dfcfa2 ff1176468d368 Author: Bjorn Andersson Date: Mon Aug 16 18:02:26 2021 -0500 Merge tag 'v5.14-rc3' into arm64-for-5.15 The USB maintainer felt the strong need to push '1f958f3dff42 ("Revert "arm64: dts: qcom: Harmonize DWC USB3 DT nodes name"")' through the usb tree, so merge v5.14-rc3 to resolve the resulting merge conflicts. Signed-off-by: Bjorn Andersson commit 0dda8b013329aab86d48f3376b2a5bb44c6b9437 Merge: 8cd99e3e22e20 9ce9a02039de7 Author: Linus Walleij Date: Tue Aug 17 01:02:01 2021 +0200 Merge branch 'ib-rockchip' into devel commit 9ce9a02039de72ec8af1bd4bff14f1780337ffcc Author: Jianqun Xu Date: Mon Aug 16 09:21:46 2021 +0800 pinctrl/rockchip: drop the gpio related codes With the patch to separate the gpio driver from the pinctrl driver, now the pinctrl-rockchip can drop the gpio related codes now. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816012146.1119289-1-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 93103f6eb09ca5152ef9173ec8b91b78df1905e8 Author: Jianqun Xu Date: Mon Aug 16 09:21:35 2021 +0800 gpio/rockchip: drop irq_gc_lock/irq_gc_unlock for irq set type There has spin lock for irq set type already, so drop irq_gc_lock and irq_gc_unlock. Reviewed-by: Heiko Stuebner Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816012135.1119234-1-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 3bcbd1a85b68e5f864029fd6f0bb0bcc8e2f1082 Author: Jianqun Xu Date: Mon Aug 16 09:21:23 2021 +0800 gpio/rockchip: support next version gpio controller The next version gpio controller on SoCs like rk3568 have more write mask bits for registers. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816012123.1119179-1-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit ff96a8c21cdbf4a36fbad341af3a41db44bbf878 Author: Jianqun Xu Date: Mon Aug 16 09:21:11 2021 +0800 gpio/rockchip: use struct rockchip_gpio_regs for gpio controller Store register offsets in the struct rockchip_gpio_regs, this patch prepare for the driver update for new gpio controller. Reviewed-by: Heiko Stuebner Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816012111.1119125-1-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 936ee2675eee1faca0dcdfa79165c7990422e0fc Author: Jianqun Xu Date: Mon Aug 16 09:20:53 2021 +0800 gpio/rockchip: add driver for rockchip gpio This patch add support for rockchip gpio controller, which is supported in pinctrl driver in the past. With this patch, the pinctrl-rockchip driver will drop gpio related codes and populate platform driver to gpio-rockchip. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816012053.1119069-1-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 75d1415ea57c1b0e87f786e85e5f478fab5c91be Author: Jianqun Xu Date: Mon Aug 16 09:19:43 2021 +0800 dt-bindings: gpio: change items restriction of clock for rockchip,gpio-bank In the past we only need on clock which name "pclk" for a gpio controller. In the new version gpio controller, there add some register to change debounce clock dynamic, so the dt node needs to add the second clock, we call it "dbclk". The clock property need 2 items on some rockchip chips such as RK3568 SoCs. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816011948.1118959-5-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 5f82afd868a04f65630c22f75b40c60cba418b8e Author: Jianqun Xu Date: Mon Aug 16 09:19:42 2021 +0800 pinctrl/rockchip: add pinctrl device to gpio bank struct Store a pointer from the pinctrl device for the gpio bank. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816011948.1118959-4-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit e1450694e94657458395af886d2467d6ac3355af Author: Jianqun Xu Date: Mon Aug 16 09:19:41 2021 +0800 pinctrl/rockchip: separate struct rockchip_pin_bank to a head file Separate struct rockchip_pin_bank to pinctrl-rockchip.h file, which will be used by gpio-rockchip driver in the future. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816011948.1118959-3-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 4b522bbf80f67ff17c0cc1fe66654202810b4482 Author: Jianqun Xu Date: Mon Aug 16 09:19:40 2021 +0800 pinctrl/rockchip: always enable clock for gpio controller Since gate and ungate pclk of gpio has very litte benifit for system power consumption, just keep it always ungate. Signed-off-by: Jianqun Xu Link: https://lore.kernel.org/r/20210816011948.1118959-2-jay.xu@rock-chips.com Signed-off-by: Linus Walleij commit 3a4ce01b24a7b61b798dc9b106001584d0a9f43b Merge: 1bda52f804712 4bd11e08e0bb1 Author: Daniel Borkmann Date: Tue Aug 17 00:45:08 2021 +0200 Merge branch 'bpf-perf-link' Andrii Nakryiko says: ==================== This patch set implements an ability for users to specify custom black box u64 value for each BPF program attachment, bpf_cookie, which is available to BPF program at runtime. This is a feature that's critically missing for cases when some sort of generic processing needs to be done by the common BPF program logic (or even exactly the same BPF program) across multiple BPF hooks (e.g., many uniformly handled kprobes) and it's important to be able to distinguish between each BPF hook at runtime (e.g., for additional configuration lookup). The choice of restricting this to a fixed-size 8-byte u64 value is an explicit design decision. Making this configurable by users adds unnecessary complexity (extra memory allocations, extra complications on the verifier side to validate accesses to variable-sized data area) while not really opening up new possibilities. If user's use case requires storing more data per attachment, it's possible to use either global array, or ARRAY/HASHMAP BPF maps, where bpf_cookie would be used as an index into respective storage, populated by user-space code before creating BPF link. This gives user all the flexibility and control while keeping BPF verifier and BPF helper API simple. Currently, similar functionality can only be achieved through: - code-generation and BPF program cloning, which is very complicated and unmaintainable; - on-the-fly C code generation and further runtime compilation, which is what BCC uses and allows to do pretty simply. The big downside is a very heavy-weight Clang/LLVM dependency and inefficient memory usage (due to many BPF program clones and the compilation process itself); - in some cases (kprobes and sometimes uprobes) it's possible to do function IP lookup to get function-specific configuration. This doesn't work for all the cases (e.g., when attaching uprobes to shared libraries) and has higher runtime overhead and additional programming complexity due to BPF_MAP_TYPE_HASHMAP lookups. Up until recently, before bpf_get_func_ip() BPF helper was added, it was also very complicated and unstable (API-wise) to get traced function's IP from fentry/fexit and kretprobe. With libbpf and BPF CO-RE, runtime compilation is not an option, so to be able to build generic tracing tooling simply and efficiently, ability to provide additional bpf_cookie value for each *attachment* (as opposed to each BPF program) is extremely important. Two immediate users of this functionality are going to be libbpf-based USDT library (currently in development) and retsnoop ([0]), but I'm sure more applications will come once users get this feature in their kernels. To achieve above described, all perf_event-based BPF hooks are made available through a new BPF_LINK_TYPE_PERF_EVENT BPF link, which allows to use common LINK_CREATE command for program attachments and generally brings perf_event-based attachments into a common BPF link infrastructure. With that, LINK_CREATE gets ability to pass throught bpf_cookie value during link creation (BPF program attachment) time. bpf_get_attach_cookie() BPF helper is added to allow fetching this value at runtime from BPF program side. BPF cookie is stored either on struct perf_event itself and fetched from the BPF program context, or is passed through ambient BPF run context, added in c7603cfa04e7 ("bpf: Add ambient BPF runtime context stored in current"). On the libbpf side of things, BPF perf link is utilized whenever is supported by the kernel instead of using PERF_EVENT_IOC_SET_BPF ioctl on perf_event FD. All the tracing attach APIs are extended with OPTS and bpf_cookie is passed through corresponding opts structs. Last part of the patch set adds few self-tests utilizing new APIs. There are also a few refactorings along the way to make things cleaner and easier to work with, both in kernel (BPF_PROG_RUN and BPF_PROG_RUN_ARRAY), and throughout libbpf and selftests. Follow-up patches will extend bpf_cookie to fentry/fexit programs. While adding uprobe_opts, also extend it with ref_ctr_offset for specifying USDT semaphore (reference counter) offset. Update attach_probe selftests to validate its functionality. This is another feature (along with bpf_cookie) required for implementing libbpf-based USDT solution. [0] https://github.com/anakryiko/retsnoop v4->v5: - rebase on latest bpf-next to resolve merge conflict; - add ref_ctr_offset to uprobe_opts and corresponding selftest; v3->v4: - get rid of BPF_PROG_RUN macro in favor of bpf_prog_run() (Daniel); - move #ifdef CONFIG_BPF_SYSCALL check into bpf_set_run_ctx (Daniel); v2->v3: - user_ctx -> bpf_cookie, bpf_get_user_ctx -> bpf_get_attach_cookie (Peter); - fix BPF_LINK_TYPE_PERF_EVENT value fix (Jiri); - use bpf_prog_run() from bpf_prog_run_pin_on_cpu() (Yonghong); v1->v2: - fix build failures on non-x86 arches by gating on CONFIG_PERF_EVENTS. ==================== Signed-off-by: Daniel Borkmann commit 4bd11e08e0bb1862fe72495014e33795e412bffb Author: Andrii Nakryiko Date: Sun Aug 15 00:06:09 2021 -0700 selftests/bpf: Add ref_ctr_offset selftests Extend attach_probe selftests to specify ref_ctr_offset for uprobe/uretprobe and validate that its value is incremented from zero. Turns out that once uprobe is attached with ref_ctr_offset, uretprobe for the same location/function *has* to use ref_ctr_offset as well, otherwise perf_event_open() fails with -EINVAL. So this test uses ref_ctr_offset for both uprobe and uretprobe, even though for the purpose of test uprobe would be enough. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-17-andrii@kernel.org commit 5e3b8356de3623987ace530b1977ffeb9ecf5a8a Author: Andrii Nakryiko Date: Sun Aug 15 00:06:08 2021 -0700 libbpf: Add uprobe ref counter offset support for USDT semaphores When attaching to uprobes through perf subsystem, it's possible to specify offset of a so-called USDT semaphore, which is just a reference counted u16, used by kernel to keep track of how many tracers are attached to a given location. Support for this feature was added in [0], so just wire this through uprobe_opts. This is important to enable implementing USDT attachment and tracing through libbpf's bpf_program__attach_uprobe_opts() API. [0] a6ca88b241d5 ("trace_uprobe: support reference counter in fd-based uprobe") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-16-andrii@kernel.org commit 0a80cf67f34cab7c18d74c28bb59e131670dc268 Author: Andrii Nakryiko Date: Sun Aug 15 00:06:07 2021 -0700 selftests/bpf: Add bpf_cookie selftests for high-level APIs Add selftest with few subtests testing proper bpf_cookie usage. Kprobe and uprobe subtests are pretty straightforward and just validate that the same BPF program attached with different bpf_cookie will be triggered with those different bpf_cookie values. Tracepoint subtest is a bit more interesting, as it is the only perf_event-based BPF hook that shares bpf_prog_array between multiple perf_events internally. This means that the same BPF program can't be attached to the same tracepoint multiple times. So we have 3 identical copies. This arrangement allows to test bpf_prog_array_copy()'s handling of bpf_prog_array list manipulation logic when programs are attached and detached. The test validates that bpf_cookie isn't mixed up and isn't lost during such list manipulations. Perf_event subtest validates that two BPF links can be created against the same perf_event (but not at the same time, only one BPF program can be attached to perf_event itself), and that for each we can specify different bpf_cookie value. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-15-andrii@kernel.org commit a549aaa67395eea89c2b9d2bea01ab0455b18408 Author: Andrii Nakryiko Date: Sun Aug 15 00:06:06 2021 -0700 selftests/bpf: Extract uprobe-related helpers into trace_helpers.{c,h} Extract two helpers used for working with uprobes into trace_helpers.{c,h} to be re-used between multiple uprobe-using selftests. Also rename get_offset() into more appropriate get_uprobe_offset(). Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-14-andrii@kernel.org commit f36d3557a132ec0ccb8a3536d3ebd778049d48ca Author: Andrii Nakryiko Date: Sun Aug 15 00:06:05 2021 -0700 selftests/bpf: Test low-level perf BPF link API Add tests utilizing low-level bpf_link_create() API to create perf BPF link. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-13-andrii@kernel.org commit 47faff371755ba0f1ad76e2df7f5003377d974a5 Author: Andrii Nakryiko Date: Sun Aug 15 00:06:04 2021 -0700 libbpf: Add bpf_cookie to perf_event, kprobe, uprobe, and tp attach APIs Wire through bpf_cookie for all attach APIs that use perf_event_open under the hood: - for kprobes, extend existing bpf_kprobe_opts with bpf_cookie field; - for perf_event, uprobe, and tracepoint APIs, add their _opts variants and pass bpf_cookie through opts. For kernel that don't support BPF_LINK_CREATE for perf_events, and thus bpf_cookie is not supported either, return error and log warning for user. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-12-andrii@kernel.org commit 3ec84f4b1638495ebff068a668dc417b4de5727e Author: Andrii Nakryiko Date: Sun Aug 15 00:06:03 2021 -0700 libbpf: Add bpf_cookie support to bpf_link_create() API Add ability to specify bpf_cookie value when creating BPF perf link with bpf_link_create() low-level API. Given BPF_LINK_CREATE command is growing and keeps getting new fields that are specific to the type of BPF_LINK, extend libbpf side of bpf_link_create() API and corresponding OPTS struct to accomodate such changes. Add extra checks to prevent using incompatible/unexpected combinations of fields. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-11-andrii@kernel.org commit 668ace0ea5ab5acdb33cff0b66fcd8f41c16a0b0 Author: Andrii Nakryiko Date: Sun Aug 15 00:06:02 2021 -0700 libbpf: Use BPF perf link when supported by kernel Detect kernel support for BPF perf link and prefer it when attaching to perf_event, tracepoint, kprobe/uprobe. Underlying perf_event FD will be kept open until BPF link is destroyed, at which point both perf_event FD and BPF link FD will be closed. This preserves current behavior in which perf_event FD is open for the duration of bpf_link's lifetime and user is able to "disconnect" bpf_link from underlying FD (with bpf_link__disconnect()), so that bpf_link__destroy() doesn't close underlying perf_event FD.When BPF perf link is used, disconnect will keep both perf_event and bpf_link FDs open, so it will be up to (advanced) user to close them. This approach is demonstrated in bpf_cookie.c selftests, added in this patch set. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-10-andrii@kernel.org commit d88b71d4a91669f0b06693cd094dcd68f67ac58d Author: Andrii Nakryiko Date: Sun Aug 15 00:06:01 2021 -0700 libbpf: Remove unused bpf_link's destroy operation, but add dealloc bpf_link->destroy() isn't used by any code, so remove it. Instead, add ability to override deallocation procedure, with default doing plain free(link). This is necessary for cases when we want to "subclass" struct bpf_link to keep extra information, as is the case in the next patch adding struct bpf_link_perf. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815070609.987780-9-andrii@kernel.org commit 61c7aa5020e98ac2fdcf07d07eec1baf2e9f0a08 Author: Andrii Nakryiko Date: Sun Aug 15 00:06:00 2021 -0700 libbpf: Re-build libbpf.so when libbpf.map changes Ensure libbpf.so is re-built whenever libbpf.map is modified. Without this, changes to libbpf.map are not detected and versioned symbols mismatch error will be reported until `make clean && make` is used, which is a suboptimal developer experience. Fixes: 306b267cb3c4 ("libbpf: Verify versioned symbols") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210815070609.987780-8-andrii@kernel.org commit 7adfc6c9b315e174cf8743b21b7b691c8766791b Author: Andrii Nakryiko Date: Sun Aug 15 00:05:59 2021 -0700 bpf: Add bpf_get_attach_cookie() BPF helper to access bpf_cookie value Add new BPF helper, bpf_get_attach_cookie(), which can be used by BPF programs to get access to a user-provided bpf_cookie value, specified during BPF program attachment (BPF link creation) time. Naming is hard, though. With the concept being named "BPF cookie", I've considered calling the helper: - bpf_get_cookie() -- seems too unspecific and easily mistaken with socket cookie; - bpf_get_bpf_cookie() -- too much tautology; - bpf_get_link_cookie() -- would be ok, but while we create a BPF link to attach BPF program to BPF hook, it's still an "attachment" and the bpf_cookie is associated with BPF program attachment to a hook, not a BPF link itself. Technically, we could support bpf_cookie with old-style cgroup programs.So I ultimately rejected it in favor of bpf_get_attach_cookie(). Currently all perf_event-backed BPF program types support bpf_get_attach_cookie() helper. Follow-up patches will add support for fentry/fexit programs as well. While at it, mark bpf_tracing_func_proto() as static to make it obvious that it's only used from within the kernel/trace/bpf_trace.c. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210815070609.987780-7-andrii@kernel.org commit 82e6b1eee6a8875ef4eacfd60711cce6965c6b04 Author: Andrii Nakryiko Date: Sun Aug 15 00:05:58 2021 -0700 bpf: Allow to specify user-provided bpf_cookie for BPF perf links Add ability for users to specify custom u64 value (bpf_cookie) when creating BPF link for perf_event-backed BPF programs (kprobe/uprobe, perf_event, tracepoints). This is useful for cases when the same BPF program is used for attaching and processing invocation of different tracepoints/kprobes/uprobes in a generic fashion, but such that each invocation is distinguished from each other (e.g., BPF program can look up additional information associated with a specific kernel function without having to rely on function IP lookups). This enables new use cases to be implemented simply and efficiently that previously were possible only through code generation (and thus multiple instances of almost identical BPF program) or compilation at runtime (BCC-style) on target hosts (even more expensive resource-wise). For uprobes it is not even possible in some cases to know function IP before hand (e.g., when attaching to shared library without PID filtering, in which case base load address is not known for a library). This is done by storing u64 bpf_cookie in struct bpf_prog_array_item, corresponding to each attached and run BPF program. Given cgroup BPF programs already use two 8-byte pointers for their needs and cgroup BPF programs don't have (yet?) support for bpf_cookie, reuse that space through union of cgroup_storage and new bpf_cookie field. Make it available to kprobe/tracepoint BPF programs through bpf_trace_run_ctx. This is set by BPF_PROG_RUN_ARRAY, used by kprobe/uprobe/tracepoint BPF program execution code, which luckily is now also split from BPF_PROG_RUN_ARRAY_CG. This run context will be utilized by a new BPF helper giving access to this user-provided cookie value from inside a BPF program. Generic perf_event BPF programs will access this value from perf_event itself through passed in BPF program context. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/bpf/20210815070609.987780-6-andrii@kernel.org commit b89fbfbb854c9afc3047e8273cc3a694650b802e Author: Andrii Nakryiko Date: Sun Aug 15 00:05:57 2021 -0700 bpf: Implement minimal BPF perf link Introduce a new type of BPF link - BPF perf link. This brings perf_event-based BPF program attachments (perf_event, tracepoints, kprobes, and uprobes) into the common BPF link infrastructure, allowing to list all active perf_event based attachments, auto-detaching BPF program from perf_event when link's FD is closed, get generic BPF link fdinfo/get_info functionality. BPF_LINK_CREATE command expects perf_event's FD as target_fd. No extra flags are currently supported. Force-detaching and atomic BPF program updates are not yet implemented, but with perf_event-based BPF links we now have common framework for this without the need to extend ioctl()-based perf_event interface. One interesting consideration is a new value for bpf_attach_type, which BPF_LINK_CREATE command expects. Generally, it's either 1-to-1 mapping from bpf_attach_type to bpf_prog_type, or many-to-1 mapping from a subset of bpf_attach_types to one bpf_prog_type (e.g., see BPF_PROG_TYPE_SK_SKB or BPF_PROG_TYPE_CGROUP_SOCK). In this case, though, we have three different program types (KPROBE, TRACEPOINT, PERF_EVENT) using the same perf_event-based mechanism, so it's many bpf_prog_types to one bpf_attach_type. I chose to define a single BPF_PERF_EVENT attach type for all of them and adjust link_create()'s logic for checking correspondence between attach type and program type. The alternative would be to define three new attach types (e.g., BPF_KPROBE, BPF_TRACEPOINT, and BPF_PERF_EVENT), but that seemed like unnecessary overkill and BPF_KPROBE will cause naming conflicts with BPF_KPROBE() macro, defined by libbpf. I chose to not do this to avoid unnecessary proliferation of bpf_attach_type enum values and not have to deal with naming conflicts. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/bpf/20210815070609.987780-5-andrii@kernel.org commit 652c1b17b85b9c195978c051aa283027529db1fe Author: Andrii Nakryiko Date: Sun Aug 15 00:05:56 2021 -0700 bpf: Refactor perf_event_set_bpf_prog() to use struct bpf_prog input Make internal perf_event_set_bpf_prog() use struct bpf_prog pointer as an input argument, which makes it easier to re-use for other internal uses (coming up for BPF link in the next patch). BPF program FD is not as convenient and in some cases it's not available. So switch to struct bpf_prog, move out refcounting outside and let caller do bpf_prog_put() in case of an error. This follows the approach of most of the other BPF internal functions. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Peter Zijlstra (Intel) Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210815070609.987780-4-andrii@kernel.org commit 7d08c2c9117113fee118487425ed55efa50cbfa9 Author: Andrii Nakryiko Date: Sun Aug 15 00:05:55 2021 -0700 bpf: Refactor BPF_PROG_RUN_ARRAY family of macros into functions Similar to BPF_PROG_RUN, turn BPF_PROG_RUN_ARRAY macros into proper functions with all the same readability and maintainability benefits. Making them into functions required shuffling around bpf_set_run_ctx/bpf_reset_run_ctx functions. Also, explicitly specifying the type of the BPF prog run callback required adjusting __bpf_prog_run_save_cb() to accept const void *, casted internally to const struct sk_buff. Further, split out a cgroup-specific BPF_PROG_RUN_ARRAY_CG and BPF_PROG_RUN_ARRAY_CG_FLAGS from the more generic BPF_PROG_RUN_ARRAY due to the differences in bpf_run_ctx used for those two different use cases. I think BPF_PROG_RUN_ARRAY_CG would benefit from further refactoring to accept struct cgroup and enum bpf_attach_type instead of bpf_prog_array, fetching cgrp->bpf.effective[type] and RCU-dereferencing it internally. But that required including include/linux/cgroup-defs.h, which I wasn't sure is ok with everyone. The remaining generic BPF_PROG_RUN_ARRAY function will be extended to pass-through user-provided context value in the next patch. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210815070609.987780-3-andrii@kernel.org commit fb7dd8bca0139fd73d3f4a6cd257b11731317ded Author: Andrii Nakryiko Date: Sun Aug 15 00:05:54 2021 -0700 bpf: Refactor BPF_PROG_RUN into a function Turn BPF_PROG_RUN into a proper always inlined function. No functional and performance changes are intended, but it makes it much easier to understand what's going on with how BPF programs are actually get executed. It's more obvious what types and callbacks are expected. Also extra () around input parameters can be dropped, as well as `__` variable prefixes intended to avoid naming collisions, which makes the code simpler to read and write. This refactoring also highlighted one extra issue. BPF_PROG_RUN is both a macro and an enum value (BPF_PROG_RUN == BPF_PROG_TEST_RUN). Turning BPF_PROG_RUN into a function causes naming conflict compilation error. So rename BPF_PROG_RUN into lower-case bpf_prog_run(), similar to bpf_prog_run_xdp(), bpf_prog_run_pin_on_cpu(), etc. All existing callers of BPF_PROG_RUN, the macro, are switched to bpf_prog_run() explicitly. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210815070609.987780-2-andrii@kernel.org commit fd04ed1ca37f3f0767b8e42b32fcc078f99e6193 Merge: 1b3f78df6a809 f5c2b9f0fc078 Author: Jakub Kicinski Date: Mon Aug 16 15:12:15 2021 -0700 Merge branch 'net-hns3-add-support-ethtool-extended-link-state' Guangbin Huang says: ==================== net: hns3: add support ethtool extended link state This series adds support for ethtool extended link state in the HNS3 ethernet driver to add one additional information for user to know why a link is not up. ==================== Link: https://lore.kernel.org/r/1629080129-46507-1-git-send-email-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit f5c2b9f0fc078308a88de807d60cd4e352a165fc Author: Guangbin Huang Date: Mon Aug 16 10:15:29 2021 +0800 net: hns3: add support ethtool extended link state In order to know the reason of link up failure, add supporting ethtool extended link state. Driver reads the link status code from firmware if in link down state and converts it to ethtool extended link state. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit edb40bbc17eb589beb3cbd672d341e1505d6cdb1 Author: Guangbin Huang Date: Mon Aug 16 10:15:28 2021 +0800 net: hns3: add header file hns3_ethtoo.h Add a new file hns3_ethtool.h, and move struct type definitions from hns3_ethtool.c to hns3_ethtool.h. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 5b4ecc3d4c4aab8d002fe6358885c10e7b57e432 Author: Guangbin Huang Date: Mon Aug 16 10:15:27 2021 +0800 ethtool: add two link extended substates of bad signal integrity ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST means the input external clock signal for SerDes is too weak or lost. ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS means the received signal for SerDes is too weak because analog loss of signal. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 958ab281eb3e0543a995457fd2d9cb4504cde4b8 Author: Guangbin Huang Date: Mon Aug 16 10:15:26 2021 +0800 docs: ethtool: Add two link extended substates of bad signal integrity Add documentation for two bad signal integrity substates: ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 1bda52f80471260bcc7391f4e6919effedfc88d8 Author: Colin Ian King Date: Sun Aug 15 22:39:50 2021 +0100 bpf, tests: Fix spelling mistake "shoft" -> "shift" There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210815213950.47751-1-colin.king@canonical.com commit 8ecd39cb61d9e302716d73be329c4d4822c24931 Author: THOBY Simon Date: Mon Aug 16 08:11:01 2021 +0000 IMA: prevent SETXATTR_CHECK policy rules with unavailable algorithms SETXATTR_CHECK policy rules assume that any algorithm listed in the 'appraise_algos' flag must be accepted when performing setxattr() on the security.ima xattr. However nothing checks that they are available in the current kernel. A userland application could hash a file with a digest that the kernel wouldn't be able to verify. However, if SETXATTR_CHECK is not in use, the kernel already forbids that xattr write. Verify that algorithms listed in appraise_algos are available to the current kernel and reject the policy update otherwise. This will fix the inconsistency between SETXATTR_CHECK and non-SETXATTR_CHECK behaviors. That filtering is only performed in ima_parse_appraise_algos() when updating policies so that we do not have to pay the price of allocating a hash object every time validate_hash_algo() is called in ima_inode_setxattr(). Signed-off-by: THOBY Simon Signed-off-by: Mimi Zohar commit 4f2946aa0c45c78b4f4ef101bab9694e38c68db0 Author: THOBY Simon Date: Mon Aug 16 08:11:01 2021 +0000 IMA: introduce a new policy option func=SETXATTR_CHECK While users can restrict the accepted hash algorithms for the security.ima xattr file signature when appraising said file, users cannot restrict the algorithms that can be set on that attribute: any algorithm built in the kernel is accepted on a write. Define a new value for the ima policy option 'func' that restricts globally the hash algorithms accepted when writing the security.ima xattr. When a policy contains a rule of the form appraise func=SETXATTR_CHECK appraise_algos=sha256,sha384,sha512 only values corresponding to one of these three digest algorithms will be accepted for writing the security.ima xattr. Attempting to write the attribute using another algorithm (or "free-form" data) will be denied with an audit log message. In the absence of such a policy rule, the default is still to only accept hash algorithms built in the kernel (with all the limitations that entails). Signed-off-by: THOBY Simon Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 583a80ae86b5ceb68119cfb9a37404cf22f6cc46 Author: THOBY Simon Date: Mon Aug 16 08:11:00 2021 +0000 IMA: add a policy option to restrict xattr hash algorithms on appraisal The kernel has the ability to restrict the set of hash algorithms it accepts for the security.ima xattr when it appraises files. Define a new IMA policy rule option "appraise_algos=", using the mentioned mechanism to expose a user-toggable policy knob to opt-in to that restriction and select the desired set of algorithms that must be accepted. When a policy rule uses the 'appraise_algos' option, appraisal of a file referenced by that rule will now fail if the digest algorithm employed to hash the file was not one of those explicitly listed in the option. In its absence, any hash algorithm compiled in the kernel will be accepted. For example, on a system where SELinux is properly deployed, the rule appraise func=BPRM_CHECK obj_type=iptables_exec_t \ appraise_algos=sha256,sha384 will block the execution of iptables if the xattr security.ima of its executables were not hashed with either sha256 or sha384. Signed-off-by: THOBY Simon Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 1624dc0086056c3a35fd34b0235bb1eb88c1c4d5 Author: THOBY Simon Date: Mon Aug 16 08:11:00 2021 +0000 IMA: add support to restrict the hash algorithms used for file appraisal The kernel accepts any hash algorithm as a value for the security.ima xattr. Users may wish to restrict the accepted algorithms to only support strong cryptographic ones. Provide the plumbing to restrict the permitted set of hash algorithms used for verifying file hashes and signatures stored in security.ima xattr. Signed-off-by: THOBY Simon Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 50f742dd91474e7f4954bf88d094eede59783883 Author: THOBY Simon Date: Mon Aug 16 08:10:59 2021 +0000 IMA: block writes of the security.ima xattr with unsupported algorithms By default, writes to the extended attributes security.ima will be allowed even if the hash algorithm used for the xattr is not compiled in the kernel (which does not make sense because the kernel would not be able to appraise that file as it lacks support for validating the hash). Prevent and audit writes to the security.ima xattr if the hash algorithm used in the new value is not available in the current kernel. Signed-off-by: THOBY Simon Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 8510505d55e194d3f6c9644c9f9d12c4f6b0395a Author: THOBY Simon Date: Mon Aug 16 08:10:59 2021 +0000 IMA: remove the dependency on CRYPTO_MD5 MD5 is a weak digest algorithm that shouldn't be used for cryptographic operation. It hinders the efficiency of a patch set that aims to limit the digests allowed for the extended file attribute namely security.ima. MD5 is no longer a requirement for IMA, nor should it be used there. The sole place where we still use the MD5 algorithm inside IMA is setting the ima_hash algorithm to MD5, if the user supplies 'ima_hash=md5' parameter on the command line. With commit ab60368ab6a4 ("ima: Fallback to the builtin hash algorithm"), setting "ima_hash=md5" fails gracefully when CRYPTO_MD5 is not set: ima: Can not allocate md5 (reason: -2) ima: Allocating md5 failed, going to use default hash algorithm sha256 Remove the CRYPTO_MD5 dependency for IMA. Signed-off-by: THOBY Simon Reviewed-by: Lakshmi Ramasubramanian [zohar@linux.ibm.com: include commit number in patch description for stable.] Cc: stable@vger.kernel.org # 4.17 Signed-off-by: Mimi Zohar commit ecdbda1746b5bf771cd86dfeb84c20d62f5bfc51 Merge: 1f69aabe1ac06 20d7a9fb00ebc Author: Arnd Bergmann Date: Mon Aug 16 23:28:08 2021 +0200 Merge tag 'qcom-arm64-defconfig-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM64 defconfig updates for v5.15 This enabled the MSM8996 CPU clock driver, enabling CPUfreq on the platform. * tag 'qcom-arm64-defconfig-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Enable Qualcomm MSM8996 CPU clock driver Link: https://lore.kernel.org/r/20210816210014.577699-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 1f69aabe1ac06cd5005352fb9314e7409b712487 Merge: 03bc43c09d0cd 7fd19c58e48fb Author: Arnd Bergmann Date: Mon Aug 16 23:27:04 2021 +0200 Merge tag 'imx-defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/defconfig i.MX defconfig update for 5.15: - Enable LTC3676 PMIC, SCSI_LOWLEVEL and KPROBES support in imx_v6_v7_defconfig. * tag 'imx-defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: enable driver of the LTC3676 PMIC ARM: imx_v6_v7_defconfig: Let CONFIG_SCSI_LOWLEVEL be selected ARM: imx_v6_v7_defconfig: Select CONFIG_KPROBES Link: https://lore.kernel.org/r/20210814133853.9981-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 03bc43c09d0cd7f4a7813b10433d653ec5a02b09 Merge: 20904527a70de 806b99206b840 Author: Arnd Bergmann Date: Mon Aug 16 23:26:17 2021 +0200 Merge tag 'tegra-for-5.15-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfig ARM: tegra: Default configuration changes for v5.15-rc1 Enables a couple of drivers by default so that the configuration is useful on more devices. This also rebuilds the tegra_defconfig, which hasn't been done in a long time. * tag 'tegra-for-5.15-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: multi_v7_defconfig: Enable CONFIG_TEGRA30_TSENSOR ARM: multi_v7_defconfig: Enable Acer A500 drivers ARM: tegra: Rebuild default configuration ARM: tegra: Enable CONFIG_CROS_EC ARM: tegra: Enable Acer A500 drivers ARM: tegra: Enable CONFIG_FB ARM: tegra: Enable CONFIG_TEGRA30_TSENSOR Link: https://lore.kernel.org/r/20210813162157.2820913-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 9b35ab1e314c3f563f8d6982c0a8f2c8964e4a36 Merge: 6d640913126db 87a8c7164022d Author: Arnd Bergmann Date: Mon Aug 16 23:17:16 2021 +0200 Merge tag 'imx-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm32 device tree changes for 5.15: - A series from Christoph Niedermaier to clean up i.MX6 DHCOM support. - New board support: DHCOM based PicoITX, DHSOM based DRC02, SolidRun SolidSense, SKOV i.MX6 boards. - Add WiFi support for i.MX7D base reMkarkable2 device. - Add FTM devices for i.MX7 to have Flex Timers support. - Configure ENET_REF clock to 125MHz for imx6qp-prtwd3 to support RGMII PHY mode. - Drop unneeded #address-cells and #size-cells from vf610-zii SPI EEPROM device node. - Add missing USB OTG OC pinmux and Crypto device for i.MX6QDL Gateworks boards. * tag 'imx-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (23 commits) ARM: dts: imx6qp-prtwd3: configure ENET_REF clock to 125MHz ARM: dts: vf610-zii-dev-rev-b: Remove #address-cells and #size-cells property from at93c46d dt node ARM: dts: add SKOV imx6q and imx6dl based boards ARM: dts: imx7: add ftm nodes for Flex Timers ARM: dts: imx6qdl-dhcom: Add DHSOM based DRC02 board ARM: dts: imx6qdl-dhcom: Add DHCOM based PicoITX board ARM: dts: imx6qdl-dhcom: Split SoC-independent parts of DHCOM SOM and PDK2 ARM: dts: imx6q-dhcom: Cleanup of the devicetrees ARM: dts: imx6q-dhcom: Rearrange of iomux ARM: dts: imx6q-dhcom: Rework of the DHCOM GPIO pinctrls ARM: dts: imx6q-dhcom: Use 1G ethernet on the PDK2 board ARM: dts: imx6q-dhcom: Set minimum memory size of all DHCOM i.MX6 variants ARM: dts: imx6q-dhcom: Remove ddc-i2c-bus property ARM: dts: imx6q-dhcom: Add keys and leds to the PDK2 board ARM: dts: imx6q-dhcom: Align stdout-path with other DHCOM SoMs ARM: dts: imx6q-dhcom: Adding Wake pin to the PCIe pinctrl ARM: dts: imx6q-dhcom: Fill GPIO line names on DHCOM SoM ARM: dts: imx6q-dhcom: Add interrupt and compatible to the ethernet PHY ARM: dts: imx6q-dhcom: Add the parallel system bus ARM: dts: imx7d-remarkable2: Add WiFi support ... Link: https://lore.kernel.org/r/20210814133853.9981-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 6d640913126db109f2e3389173f0fe42413a8183 Merge: fe3be9941e3c5 418962eea3586 Author: Arnd Bergmann Date: Mon Aug 16 23:09:45 2021 +0200 Merge tag 'imx-dt64-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm64 device tree changes for 5.15: - New board support: Nitrogen8 SoM and MNT Reform2, LS1088A based Traverse Ten64, i.MX8M based GW7902. - A series from Ioana Ciornei to update PHY IRQ configuration for LayerScape SoCs. - A series from Tim Harvey to update Gateworks imx8mm-venice devices. - Replace deprecated `fsl,usbphy` property with phys phandle. - Add MIPI CSI phy and bridge descriptions for i.MX8MQ SoC. - Add JPEG encoder/decoder device nodes for i.MX8M SoCs. - Update PMU compatible and drop interrupt-affinity for i.MX8M SoCs. - Add Cadence HIFI4 DSP for i.MX8 MPlus SoC. - A few small and random updates on various boards. * tag 'imx-dt64-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (27 commits) arm64: dts: add device tree for Traverse Ten64 (LS1088A) arm64: dts: ls1088a: add missing PMU node arm64: dts: ls1088a: add internal PCS for DPMAC1 node arm64: dts: imx8mq-reform2: add sound support arm64: dts: imx8m: drop interrupt-affinity for pmu arm64: dts: imx8qxp: update pmu compatible arm64: dts: imx8mm: update pmu compatible arm64: dts: ls1046a: fix eeprom entries arm64: dts: imx8mm-venice-gw7901: enable pull-down on gpio outputs arm64: dts: imx8mm-venice-gw7901: add support for USB hub subload arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS arm64: dts: imx8mm-venice-gw700x: fix invalid pmic pin config arm64: dts: imx8mm-venice-gw700x: fix mp5416 pmic config arm64: dts: imx8mq: add mipi csi phy and csi bridge descriptions arm64: dts: imx: Add i.mx8mm/imx8mn Gateworks gw7902 dts support arm64: dts: imx8mp: Add dsp node arm64: dts: imx8m: Replace deprecated fsl,usbphy DT props with phys arm64: dts: imx8mq-evk: Remove unnecessary blank lines arm64: dts: imx8mq-evk: add CD pinctrl for usdhc2 arm64: dts: imx8mm-venice-gw7901: Remove unnecessary #address-cells/#size-cells ... Link: https://lore.kernel.org/r/20210814133853.9981-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit fe3be9941e3c5cebd59d3ad02477db86af85e2da Merge: 1de4893238988 0fdedc09af18d Author: Arnd Bergmann Date: Mon Aug 16 23:01:09 2021 +0200 Merge tag 'imx-bindings-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX DT bindings update for 5.15: - Add vendor prefix for MNT Research GmbH, SKOV A/S and Traverse Technologies. - Add compatible for Nitrogen8 SoM, MNT Reform2, Traverse Ten64, SKOV i.MX6, SolidSense and i.MX8M GW7902 boards. - Add compatible for i.MX8QM JPEG codec. * tag 'imx-bindings-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: fsl: Add Traverse Ten64 (LS1088A) board dt-bindings: vendor-prefixes: add Traverse Technologies dt-bindings: arm: fsl: add SKOV imx6q and imx6dl based boards dt-bindings: vendor-prefixes: Add an entry for SKOV A/S dt-bindings: arm: imx: add imx8mm/imx8mn GW7902 support dt-bindings: arm: fsl: Add DHCOM PicoITX and DHCOM DRC02 boards dt-bindings: arm: fsl: add SolidSense boards dt-bindings: media: imx-jpeg: Add compatible for i.MX8QM JPEG codec dt-bindings: arm: fsl: add MNT Reform2 board dt-bindings: vendor-prefixes: add mntre dt-bindings: arm: fsl: add Nitrogen8 SoM Link: https://lore.kernel.org/r/20210814133853.9981-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 5dfb2d2406e5a1c0eefe606797f993d8f17f86cb Author: Mauro Carvalho Chehab Date: Wed Aug 4 09:18:57 2021 +0200 dt-bindings: phy: Add bindings for HiKey 970 PCIe PHY Document the bindings for HiKey 970 (hi3670) PCIe PHY interface, supported via the pcie-kirin driver. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/461495431dd28ad2779658659f137db4bd747aa8.1628061310.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit cfcf126fc6795e843d090d98754391ece55e8b0c Author: Mauro Carvalho Chehab Date: Wed Aug 4 09:18:56 2021 +0200 dt-bindings: PCI: kirin: Add support for Kirin970 Add a new compatible, plus the new bindings needed by HiKey970 board. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/875a4571e253040d3885ee1f37467b0bade7361b.1628061310.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 1de48932389887f83f0f560c741dd57cc69a40b2 Merge: aadf2b3857ad1 f865d0292ff3c Author: Arnd Bergmann Date: Mon Aug 16 23:00:02 2021 +0200 Merge tag 'tegra-for-5.15-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt arm64: tegra: Device tree changes for v5.15-rc1 Contains a couple of fixes across the board and adds support for the recently released NVIDIA Jetson TX2 NX Developer Kit. * tag 'tegra-for-5.15-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Fix compatible string for Tegra132 CPUs arm64: tegra: Add missing interconnects property for USB on Tegra186 arm64: tegra: Add NVIDIA Jetson TX2 NX Developer Kit support arm64: tegra: Add PWM nodes on Tegra186 arm64: tegra194: p2888: Correct interrupt trigger type of temperature sensor arm64: tegra: Fix Tegra194 PCIe EP compatible string Link: https://lore.kernel.org/r/20210813162157.2820913-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit aadf2b3857ad1d09fb28f08058a746f04698f81b Merge: b05cff9f4d38c 2270ad2f4e123 Author: Arnd Bergmann Date: Mon Aug 16 22:58:39 2021 +0200 Merge tag 'tegra-for-5.15-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt ARM: tegra: Device tree changes for v5.15-rc1 The majority of this is temperature sensor additions for various devices and fixes to the trigger type of the thermal interrupts. Other than that there are various minor fixes across the board. * tag 'tegra-for-5.15-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: tamonten: Fix UART pad setting ARM: tegra: nexus7: Improve thermal zones ARM: tegra: acer-a500: Improve thermal zones ARM: tegra: acer-a500: Use verbose variant of atmel,wakeup-method value ARM: tegra: acer-a500: Add power supplies to accelerometer ARM: tegra: acer-a500: Remove bogus USB VBUS regulators ARM: tegra: jetson-tk1: Correct interrupt trigger type of temperature sensor ARM: tegra: dalmore: Correct interrupt trigger type of temperature sensor ARM: tegra: cardhu: Correct interrupt trigger type of temperature sensor ARM: tegra: apalis: Correct interrupt trigger type of temperature sensor ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor ARM: tegra: acer-a500: Add interrupt to temperature sensor node ARM: tegra: nexus7: Add interrupt to temperature sensor node ARM: tegra: paz00: Add interrupt to temperature sensor node ARM: tegra: ouya: Add interrupt to temperature sensor node ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Link: https://lore.kernel.org/r/20210813162157.2820913-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit b05cff9f4d38cd4a9ccc387a8054f9efe8e8414f Merge: fba65f104ea83 900a486ac73df Author: Arnd Bergmann Date: Mon Aug 16 22:56:07 2021 +0200 Merge tag 'tegra-for-5.15-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt dt-bindings: Changes for v5.15-rc1 This contains a single patch that adds the compatible string for the NVIDIA Jetson TX2 NX developer kit. * tag 'tegra-for-5.15-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: tegra: Document NVIDIA Jetson TX2 NX developer kit Link: https://lore.kernel.org/r/20210813162157.2820913-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit fba65f104ea83d188ef470a3f32c519a7f4b5796 Merge: d5aa024586073 c6cf488e3bfdf Author: Arnd Bergmann Date: Mon Aug 16 22:53:49 2021 +0200 Merge tag 'amlogic-arm64-dt-for-v5.15-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM64 DT changes for v5.15 part 2: - add audio to nodes vega-s95 - add audio to nodes nexbox-a1 * tag 'amlogic-arm64-dt-for-v5.15-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson: add audio playback to vega-s95 dtsi arm64: dts: meson: add audio playback to nexbox-a1 Link: https://lore.kernel.org/r/47d77095-eee7-bbd9-d3aa-1dabeea3f0b9@baylibre.com Signed-off-by: Arnd Bergmann commit d5aa0245860732268b94d9989e2ade382770fd13 Merge: 81b6a28573770 13bf92e6dec0e Author: Arnd Bergmann Date: Mon Aug 16 22:51:39 2021 +0200 Merge tag 'renesas-arm-dt-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.15 (take two) - Pin control, ADC, and CANFD support for the RZ/G2L SoC, - Add interrupt-names properties to the Renesas RZ/A and RZ/G2L I2C Bus Interface. * tag 'renesas-arm-dt-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: i2c: renesas,riic: Make interrupt-names required arm64: dts: renesas: r9a07g044: Add I2C interrupt-names ARM: dts: rza: Add I2C interrupt-names dt-bindings: i2c: renesas,riic: Add interrupt-names arm64: dts: renesas: r9a07g044: Add CANFD node arm64: dts: renesas: r9a07g044: Add ADC node arm64: dts: renesas: r9a07g044: Add pinctrl node dt-bindings: clock: r9a07g044-cpg: Add entry for P0_DIV2 core clock Link: https://lore.kernel.org/r/cover.1628849623.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 78e29356d6d2fb455c8318f3201c8884e75f9e09 Author: Mauro Carvalho Chehab Date: Wed Aug 4 09:18:55 2021 +0200 dt-bindings: PCI: kirin: Convert kirin-pcie.txt to yaml Convert the file into a JSON description at the yaml format. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/081c179ef2e0ddf11566144cd5967b15268565b4.1628061310.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 3a6e4106a8fdb87fd3ede0eb242b70b0c4c82bd5 Author: Nathan Chancellor Date: Sun Aug 15 12:29:59 2021 -0700 drm/radeon: Add break to switch statement in radeonfb_create_pinned_object() Clang + -Wimplicit-fallthrough warns: drivers/gpu/drm/radeon/radeon_fb.c:170:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ drivers/gpu/drm/radeon/radeon_fb.c:170:2: note: insert 'break;' to avoid fall-through default: ^ break; 1 warning generated. Clang's version of this warning is a little bit more pedantic than GCC's. Add the missing break to satisfy it to match what has been done all over the kernel tree. Reviewed-by: Christian König Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit 571ca8de5314690446cb26de746a999dfe4e4448 Author: Aric Cyr Date: Sat Aug 7 14:32:03 2021 -0400 drm/amd/display: 3.2.149 This version brings along following fixes: - Ensure DCN save init registers after VM setup - Fix multi-display support for idle opt workqueue - Use vblank control events for PSR enable/disable - Create default dc_sink when fail reading EDID under MST Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 01934c30c04f7f94b318dc512f547c2e30a35334 Author: Anthony Koo Date: Fri Aug 6 18:09:22 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.79 Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 961606872a28f0390dd841cbf68285421a651d8d Author: Nicholas Kazlauskas Date: Thu Aug 12 09:50:24 2021 -0400 drm/amd/display: Guard vblank wq flush with DCN guards [Why] Compilation of the workqueue fails if not building with the DCN config option set. [How] Guard calls to the flush with the DCN config option to fix the build. Reviewed-by: Roman Li Acked-by: Wayne Lin Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f586fea897609a61020a4438ee45542ad848abe9 Author: Jake Wang Date: Thu Aug 5 14:43:41 2021 -0400 drm/amd/display: Ensure DCN save after VM setup [Why] DM initializes VM context after DMCUB initialization. This results in loss of DCN_VM_CONTEXT registers after z10. [How] Notify DMCUB when VM setup is complete, and have DMCUB save init registers. v2: squash in CONFIG_DRM_AMD_DC_DCN3_1 fix Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Jake Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 58aa1c50e5a231c0912b26bce0d15c44d5384fad Author: Nicholas Kazlauskas Date: Tue Aug 3 16:32:31 2021 -0400 drm/amd/display: Use vblank control events for PSR enable/disable [Why] PSR can disable the HUBP along with the OTG when PSR is active. We'll hit a pageflip timeout when the OTG is disable because we're no longer updating the CRTC vblank counter and the pflip high IRQ will not fire on the flip. In order to flip the page flip timeout occur we should modify the enter/exit conditions to match DRM requirements. [How] Use our deferred handlers for DRM vblank control to notify DMCU(B) when it can enable or disable PSR based on whether vblank is disabled or enabled respectively. We'll need to pass along the stream with the notification now because we want to access the CRTC state while the CRTC is locked to get the stream state prior to the commit. Retain a reference to the stream so it remains safe to continue to access and release that reference once we're done with it. Enable/disable logic follows what we were previously doing in update_planes. The workqueue has to be flushed before programming streams or planes to ensure that we exit out of idle optimizations and PSR before these events occur if necessary. To keep the skip count logic the same to avoid FBCON PSR enablement requires copying the allow condition onto the DM IRQ parameters - a field that we can actually access from the worker. Reviewed-by: Roman Li Acked-by: Wayne Lin Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 09a5df6c444cf092f87da0fa113b412138253f9b Author: Nicholas Kazlauskas Date: Tue Aug 3 15:12:26 2021 -0400 drm/amd/display: Fix multi-display support for idle opt workqueue [Why] The current implementation for idle optimization support only has a single work item that gets reshuffled into the system workqueue whenever we receive an enable or disable event. We can have mismatched events if the work hasn't been processed or if we're getting control events from multiple displays at once. This fixes this issue and also makes the implementation usable for PSR control - which will be addressed in another patch. [How] We need to be able to flush remaining work out on demand for driver stop and psr disable so create a driver specific workqueue instead of using the system one. The workqueue will be single threaded to guarantee the ordering of enable/disable events. Refactor the queue to allocate the control work and deallocate it after processing it. Pass the acrtc directly to make it easier to handle psr enable/disable in a later patch. Rename things to indicate that it's not just MALL specific. Reviewed-by: Roman Li Acked-by: Wayne Lin Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 58de0ef2149f762f90bd97cf0bcb425b158488ab Author: Wayne Lin Date: Mon Jun 28 15:02:31 2021 +0800 drm/amd/display: Create dc_sink when EDID fail [Why] While reading remote EDID via Startech 1-to-4 hub, occasionally we won't get response in time and won't light up corresponding monitor. Ideally, we can still add generic modes for userspace to choose to try to light up the monitor and which is done in drm_helper_probe_single_connector_modes(). So the main problem here is that we fail .mode_valid since we don't create remote dc_sink for this case. [How] Also add default dc_sink if we can't get the EDID. Reviewed-by: Nicholas Kazlauskas Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b64625a303de727498f80f8cb9833fc615c0a90f Author: Evan Quan Date: Mon Feb 22 10:37:48 2021 +0800 drm/amd/pm: correct the address of Arcturus fan related registers These registers have different address from other SMU V11 ASICs. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit bc08cab6902c193cd5eeff4f9d9fa6023e70fcd6 Author: Evan Quan Date: Wed Feb 10 15:25:41 2021 +0800 drm/amd/pm: drop unnecessary manual mode check As the fan control was guarded under manual mode before fan speed RPM/PWM setting. Thus the extra check is totally redundant. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0d8318e11203c2d1ec54ae9a4aad71fb0ecf9c36 Author: Evan Quan Date: Wed Feb 10 10:16:08 2021 +0800 drm/amd/pm: drop the unnecessary intermediate percent-based transition Currently, the readout of fan speed pwm is transited into percent-based and then pwm-based. However, the transition into percent-based is totally unnecessary and make the final output less accurate. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit d9ca7567b864322b9fd13b0d29ed510b80bba2f0 Author: Evan Quan Date: Tue Feb 9 12:23:33 2021 +0800 drm/amd/pm: correct the fan speed RPM retrieving The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed RPM. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit fb1f667e71c079defa5918b8f457faa48120b6f1 Author: Evan Quan Date: Tue Feb 9 12:10:43 2021 +0800 drm/amd/pm: correct the fan speed PWM retrieving The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed PWM. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 96401f7c21900ad03b67e49cc3b8e6aa7cccba74 Author: Evan Quan Date: Tue Feb 9 13:36:16 2021 +0800 drm/amd/pm: record the RPM and PWM based fan speed settings As the relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, both the RPM and PWM settings need to be saved. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f3289d049720f356dc35ae72289743d7202b7787 Author: Evan Quan Date: Tue Feb 9 13:20:30 2021 +0800 drm/amd/pm: correct the fan speed RPM setting The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to perform the fan speed RPM setting. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 893cf382c0403d7c4581f0f01f6d06c76485123d Author: Candice Li Date: Fri Aug 13 19:06:33 2021 +0800 drm/amd/amdgpu: remove unnecessary RAS context field Delete ras_if->name in the RAS ctx structure and remove related lines. Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit d0ef631d40baa2be1951d122ca59d0cf6e39cf46 Author: Andy Shevchenko Date: Mon Aug 16 14:59:51 2021 +0300 gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() helper macro Use DEFINE_RES_MEM_NAMED() to save a couple of lines of code, which makes the code a bit shorter and easier to read. Signed-off-by: Andy Shevchenko Acked-by: Asmaa Mnebhi Signed-off-by: Bartosz Golaszewski commit 4e6864f8563df318f1aac92f23d06210a2b3d15f Author: Andy Shevchenko Date: Mon Aug 16 14:59:50 2021 +0300 gpio: mlxbf2: Use devm_platform_ioremap_resource() Simplify the platform_get_resource() and devm_ioremap_resource() calls with devm_platform_ioremap_resource(). Signed-off-by: Andy Shevchenko Acked-by: Asmaa Mnebhi Signed-off-by: Bartosz Golaszewski commit 603607e70e3626e6ceb3ddec86e2a060c6cd6191 Author: Andy Shevchenko Date: Mon Aug 16 14:59:49 2021 +0300 gpio: mlxbf2: Drop wrong use of ACPI_PTR() ACPI_PTR() is more harmful than helpful. For example, in this case if CONFIG_ACPI=n, the ID table left unused which is not what we want. Instead of adding ifdeffery here and there, drop ACPI_PTR() and replace acpi.h with mod_devicetable.h. Signed-off-by: Andy Shevchenko Acked-by: Asmaa Mnehi Signed-off-by: Bartosz Golaszewski commit dabe57c3a32d763b4b096915f8488dd9100c37e9 Author: Andy Shevchenko Date: Mon Aug 16 14:59:48 2021 +0300 gpio: mlxbf2: Convert to device PM ops Convert driver to use modern device PM ops interface. Signed-off-by: Andy Shevchenko Acked-by: Asmaa Mnebhi Signed-off-by: Bartosz Golaszewski commit 2bbab7ce7cf380c1ca452ac90ffcaa190acb11de Author: Yifan Zhang Date: Tue Aug 10 11:01:05 2021 +0800 drm/amdkfd: fix random KFDSVMRangeTest.SetGetAttributesTest test failure KFDSVMRangeTest.SetGetAttributesTest randomly fails in stress test. Note: Google Test filter = KFDSVMRangeTest.* [==========] Running 18 tests from 1 test case. [----------] Global test environment set-up. [----------] 18 tests from KFDSVMRangeTest [ RUN ] KFDSVMRangeTest.BasicSystemMemTest [ OK ] KFDSVMRangeTest.BasicSystemMemTest (30 ms) [ RUN ] KFDSVMRangeTest.SetGetAttributesTest [ ] Get default atrributes /home/yifan/brahma/libhsakmt/tests/kfdtest/src/KFDSVMRangeTest.cpp:154: Failure Value of: expectedDefaultResults[i] Actual: 4294967295 Expected: outputAttributes[i].value Which is: 0 /home/yifan/brahma/libhsakmt/tests/kfdtest/src/KFDSVMRangeTest.cpp:154: Failure Value of: expectedDefaultResults[i] Actual: 4294967295 Expected: outputAttributes[i].value Which is: 0 /home/yifan/brahma/libhsakmt/tests/kfdtest/src/KFDSVMRangeTest.cpp:152: Failure Value of: expectedDefaultResults[i] Actual: 4 Expected: outputAttributes[i].type Which is: 2 [ ] Setting/Getting atrributes [ FAILED ] the root cause is that svm work queue has not finished when svm_range_get_attr is called, thus some garbage svm interval tree data make svm_range_get_attr get wrong result. Flush work queue before iterate svm interval tree. Signed-off-by: Yifan Zhang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3919a485187a8585922d6ab10b025d6e623c2232 Author: Kenneth Feng Date: Fri Aug 13 14:40:18 2021 +0800 drm/amd/pm: change the workload type for some cards change the workload type for some cards as it is needed. Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fe122ee5428293b5f6067c87222085491275fdbd Author: Kenneth Feng Date: Fri Aug 13 14:20:33 2021 +0800 Revert "drm/amd/pm: fix workload mismatch on vega10" This reverts commit 0979d43259e13846d86ba17e451e17fec185d240. Revert this because it does not apply to all the cards. Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6457205c07563f1f6b101ff9ef747bd7ed57e4a7 Author: Candice Li Date: Fri Aug 13 10:14:43 2021 +0800 drm/amd/amdgpu: consolidate PSP TA context Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 3e183e2faea97fb284f82861286de09aa16e3630 Author: Jiange Zhao Date: Fri Mar 19 10:32:04 2021 +0800 drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET response when VF get FLR notification. When guest received FLR notification from host, it would lock adapter into reset state. There will be no more job submission and hardware access after that. Then it should send a response to host that it has prepared for host reset. Signed-off-by: Jiange Zhao Signed-off-by: Peng Ju Zhou Reviewed-by: Emily.Deng Signed-off-by: Alex Deucher commit 1d0e622f8db264240086dc13e3018b5802e8df18 Author: Kevin Wang Date: Wed Aug 11 16:10:26 2021 +0800 drm/amd/pm: change pp_dpm_sclk/mclk/fclk attribute is RO for aldebaran the following clock is only support voltage DPM, change attribute to RO: 1. pp_dpm_sclk 2. pp_dpm_mclk 3. pp_dpm_fclk Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit becf6c95523a69c2807fdfda2d27b40432d8d75a Author: Kevin Wang Date: Wed Aug 11 15:59:27 2021 +0800 drm/amd/pm: change smu msg's attribute to allow working under sriov the following message is allowed in sriov mode: 1. GetEnabledSmuFeaturesLow 2. GetEnabledSmuFeaturesHigh Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit cb5da84a5f080bb02164de2119acaa14656ac057 Author: Kevin Wang Date: Wed Aug 11 16:03:40 2021 +0800 drm/amd/pm: change return value in aldebaran_get_power_limit() v1: 1. change return value to avoid smu driver probe fails when FEATURE_PPT is not enabled. 2. if FEATURE_PPT is not enabled, set power limit value to 0. v2: instead dev_err with dev_warn Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 4a1cac255947faa9a4d346cc238a98ebbda0c658 Author: Kevin Wang Date: Wed Aug 11 15:52:02 2021 +0800 drm/amd/pm: skip to load smu microcode on sriov for aldebaran v1: 1. skip to load smu firmware in sriov mode for aldebaran chip 2. using vbios pptable if in sriov mode. v2: clean up smu driver code in sriov code path Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 19838cbae736b402e661d24bdf814a2c2291ace4 Author: Kevin Wang Date: Wed Aug 11 16:20:54 2021 +0800 drm/amd/pm: correct DPM_XGMI/VCN_DPM feature name the following feature is wrong, it will cause sysnode of pp_features show error: 1. DPM_XGMI 2. VCN_DPM Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit c530b02f39850a639b72d01ebbf7e5d745c60831 Author: Jack Zhang Date: Wed May 12 15:06:35 2021 +0800 drm/amd/amdgpu embed hw_fence into amdgpu_job Why: Previously hw fence is alloced separately with job. It caused historical lifetime issues and corner cases. The ideal situation is to take fence to manage both job and fence's lifetime, and simplify the design of gpu-scheduler. How: We propose to embed hw_fence into amdgpu_job. 1. We cover the normal job submission by this method. 2. For ib_test, and submit without a parent job keep the legacy way to create a hw fence separately. v2: use AMDGPU_FENCE_FLAG_EMBED_IN_JOB_BIT to show that the fence is embedded in a job. v3: remove redundant variable ring in amdgpu_job v4: add tdr sequence support for this feature. Add a job_run_counter to indicate whether this job is a resubmit job. v5 add missing handling in amdgpu_fence_enable_signaling Signed-off-by: Jingwen Chen Signed-off-by: Jack Zhang Reviewed-by: Andrey Grodzovsky Reviewed by: Monk Liu Signed-off-by: Alex Deucher commit b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3 Author: Darrick J. Wong Date: Tue Aug 10 18:32:55 2021 -0700 iomap: pass writeback errors to the mapping Modern-day mapping_set_error has the ability to squash the usual negative error code into something appropriate for long-term storage in a struct address_space -- ENOSPC becomes AS_ENOSPC, and everything else becomes EIO. iomap squashes /everything/ to EIO, just as XFS did before that, but this doesn't make sense. Fix this by making it so that we can pass ENOSPC to userspace when writeback fails due to space problems. Signed-off-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) commit 33c0dd7898a11ef19169abe5c5049fa6aa099c64 Author: Dave Chinner Date: Tue Aug 10 18:00:45 2021 -0700 xfs: move the CIL workqueue to the CIL We only use the CIL workqueue in the CIL, so it makes no sense to hang it off the xfs_mount and have to walk multiple pointers back up to the mount when we have the CIL structures right there. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 39823d0fac9416cb89c252d78e262ee8cd76a7d8 Author: Dave Chinner Date: Tue Aug 10 18:00:45 2021 -0700 xfs: CIL work is serialised, not pipelined Because we use a single work structure attached to the CIL rather than the CIL context, we can only queue a single work item at a time. This results in the CIL being single threaded and limits performance when it becomes CPU bound. The design of the CIL is that it is pipelined and multiple commits can be running concurrently, but the way the work is currently implemented means that it is not pipelining as it was intended. The critical work to switch the CIL context can take a few milliseconds to run, but the rest of the CIL context flush can take hundreds of milliseconds to complete. The context switching is the serialisation point of the CIL, once the context has been switched the rest of the context push can run asynchrnously with all other context pushes. Hence we can move the work to the CIL context so that we can run multiple CIL pushes at the same time and spread the majority of the work out over multiple CPUs. We can keep the per-cpu CIL commit state on the CIL rather than the context, because the context is pinned to the CIL until the switch is done and we aggregate and drain the per-cpu state held on the CIL during the context switch. However, because we no longer serialise the CIL work, we can have effectively unlimited CIL pushes in progress. We don't want to do this - not only does it create contention on the iclogs and the state machine locks, we can run the log right out of space with outstanding pushes. Instead, limit the work concurrency to 4 concurrent works being processed at a time. This is enough concurrency to remove the CIL from being a CPU bound bottleneck but not enough to create new contention points or unbound concurrency issues. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0020a190cf3eac16995143db41b21b82bacdcbe3 Author: Dave Chinner Date: Tue Aug 10 18:00:44 2021 -0700 xfs: AIL needs asynchronous CIL forcing The AIL pushing is stalling on log forces when it comes across pinned items. This is happening on removal workloads where the AIL is dominated by stale items that are removed from AIL when the checkpoint that marks the items stale is committed to the journal. This results is relatively few items in the AIL, but those that are are often pinned as directories items are being removed from are still being logged. As a result, many push cycles through the CIL will first issue a blocking log force to unpin the items. This can take some time to complete, with tracing regularly showing push delays of half a second and sometimes up into the range of several seconds. Sequences like this aren't uncommon: .... 399.829437: xfsaild: last lsn 0x11002dd000 count 101 stuck 101 flushing 0 tout 20 400.099622: xfsaild: target 0x11002f3600, prev 0x11002f3600, last lsn 0x0 400.099623: xfsaild: first lsn 0x11002f3600 400.099679: xfsaild: last lsn 0x1100305000 count 16 stuck 11 flushing 0 tout 50 400.589348: xfsaild: target 0x110032e600, prev 0x11002f3600, last lsn 0x0 400.589349: xfsaild: first lsn 0x1100305000 400.589595: xfsaild: last lsn 0x110032e600 count 156 stuck 101 flushing 30 tout 50 400.950341: xfsaild: target 0x1100353000, prev 0x110032e600, last lsn 0x0 400.950343: xfsaild: first lsn 0x1100317c00 400.950436: xfsaild: last lsn 0x110033d200 count 105 stuck 101 flushing 0 tout 20 401.142333: xfsaild: target 0x1100361600, prev 0x1100353000, last lsn 0x0 401.142334: xfsaild: first lsn 0x110032e600 401.142535: xfsaild: last lsn 0x1100353000 count 122 stuck 101 flushing 8 tout 10 401.154323: xfsaild: target 0x1100361600, prev 0x1100361600, last lsn 0x1100353000 401.154328: xfsaild: first lsn 0x1100353000 401.154389: xfsaild: last lsn 0x1100353000 count 101 stuck 101 flushing 0 tout 20 401.451525: xfsaild: target 0x1100361600, prev 0x1100361600, last lsn 0x0 401.451526: xfsaild: first lsn 0x1100353000 401.451804: xfsaild: last lsn 0x1100377200 count 170 stuck 22 flushing 122 tout 50 401.933581: xfsaild: target 0x1100361600, prev 0x1100361600, last lsn 0x0 .... In each of these cases, every AIL pass saw 101 log items stuck on the AIL (pinned) with very few other items being found. Each pass, a log force was issued, and delay between last/first is the sleep time + the sync log force time. Some of these 101 items pinned the tail of the log. The tail of the log does slowly creep forward (first lsn), but the problem is that the log is actually out of reservation space because it's been running so many transactions that stale items that never reach the AIL but consume log space. Hence we have a largely empty AIL, with long term pins on items that pin the tail of the log that don't get pushed frequently enough to keep log space available. The problem is the hundreds of milliseconds that we block in the log force pushing the CIL out to disk. The AIL should not be stalled like this - it needs to run and flush items that are at the tail of the log with minimal latency. What we really need to do is trigger a log flush, but then not wait for it at all - we've already done our waiting for stuff to complete when we backed off prior to the log force being issued. Even if we remove the XFS_LOG_SYNC from the xfs_log_force() call, we still do a blocking flush of the CIL and that is what is causing the issue. Hence we need a new interface for the CIL to trigger an immediate background push of the CIL to get it moving faster but not to wait on that to occur. While the CIL is pushing, the AIL can also be pushing. We already have an internal interface to do this - xlog_cil_push_now() - but we need a wrapper for it to be used externally. xlog_cil_force_seq() can easily be extended to do what we need as it already implements the synchronous CIL push via xlog_cil_push_now(). Add the necessary flags and "push current sequence" semantics to xlog_cil_force_seq() and convert the AIL pushing to use it. One of the complexities here is that the CIL push does not guarantee that the commit record for the CIL checkpoint is written to disk. The current log force ensures this by submitting the current ACTIVE iclog that the commit record was written to. We need the CIL to actually write this commit record to disk for an async push to ensure that the checkpoint actually makes it to disk and unpins the pinned items in the checkpoint on completion. Hence we need to pass down to the CIL push that we are doing an async flush so that it can switch out the commit_iclog if necessary to get written to disk when the commit iclog is finally released. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Darrick J. Wong commit 68a74dcae6737c27b524b680e070fe41f0cad43a Author: Dave Chinner Date: Tue Aug 10 18:00:44 2021 -0700 xfs: order CIL checkpoint start records Because log recovery depends on strictly ordered start records as well as strictly ordered commit records. This is a zero day bug in the way XFS writes pipelined transactions to the journal which is exposed by fixing the zero day bug that prevents the CIL from pipelining checkpoints. This re-introduces explicit concurrent commits back into the on-disk journal and hence out of order start records. The XFS journal commit code has never ordered start records and we have relied on strict commit record ordering for correct recovery ordering of concurrently written transactions. Unfortunately, root cause analysis uncovered the fact that log recovery uses the LSN of the start record for transaction commit processing. Hence, whilst the commits are processed in strict order by recovery, the LSNs associated with the commits can be out of order and so recovery may stamp incorrect LSNs into objects and/or misorder intents in the AIL for later processing. This can result in log recovery failures and/or on disk corruption, sometimes silent. Because this is a long standing log recovery issue, we can't just fix log recovery and call it good. This still leaves older kernels susceptible to recovery failures and corruption when replaying a log from a kernel that pipelines checkpoints. There is also the issue that in-memory ordering for AIL pushing and data integrity operations are based on checkpoint start LSNs, and if the start LSN is incorrect in the journal, it is also incorrect in memory. Hence there's really only one choice for fixing this zero-day bug: we need to strictly order checkpoint start records in ascending sequence order in the log, the same way we already strictly order commit records. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit caa80090d17c89d0caca1dcb4c8a9cdef5335e71 Author: Dave Chinner Date: Tue Aug 10 18:00:43 2021 -0700 xfs: attach iclog callbacks in xlog_cil_set_ctx_write_state() Now that we have a mechanism to guarantee that the callbacks attached to an iclog are owned by the context that attaches them until they drop their reference to the iclog via xlog_state_release_iclog(), we can attach callbacks to the iclog at any time we have an active reference to the iclog. xlog_state_get_iclog_space() always guarantees that the commit record will fit in the iclog it returns, so we can move this IO callback setting to xlog_cil_set_ctx_write_state(), record the commit iclog in the context and remove the need for the commit iclog to be returned by xlog_write() altogether. This, in turn, allows us to move the wakeup for ordered commit record writes up into xlog_cil_set_ctx_write_state(), too, because we have been guaranteed that this commit record will be physically located in the iclog before any waiting commit record at a higher sequence number will be granted iclog space. This further cleans up the post commit record write processing in the CIL push code, especially as xlog_state_release_iclog() will now clean up the context when shutdown errors occur. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bf034bc827807ac15affa051e6a94b03f93b1a03 Author: Dave Chinner Date: Tue Aug 10 18:00:43 2021 -0700 xfs: factor out log write ordering from xlog_cil_push_work() So we can use it for start record ordering as well as commit record ordering in future. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit c45aba40cf5b2988c0bebee8c9b846c88aa651eb Author: Dave Chinner Date: Tue Aug 10 18:00:42 2021 -0700 xfs: pass a CIL context to xlog_write() Pass the CIL context to xlog_write() rather than a pointer to a LSN variable. Only the CIL checkpoint calls to xlog_write() need to know about the start LSN of the writes, so rework xlog_write to directly write the LSNs into the CIL context structure. This removes the commit_lsn variable from xlog_cil_push_work(), so now we only have to issue the commit record ordering wakeup from there. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2ce82b722de980deef809438603b7e95156d3818 Author: Dave Chinner Date: Tue Aug 10 18:00:42 2021 -0700 xfs: move xlog_commit_record to xfs_log_cil.c It is only used by the CIL checkpoints, and is the counterpart to start record formatting and writing that is already local to xfs_log_cil.c. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 2562c322404d81ee5fa82f3cf601a2e27393ab57 Author: Dave Chinner Date: Tue Aug 10 18:00:41 2021 -0700 xfs: log head and tail aren't reliable during shutdown I'm seeing assert failures from xlog_space_left() after a shutdown has begun that look like: XFS (dm-0): log I/O error -5 XFS (dm-0): xfs_do_force_shutdown(0x2) called from line 1338 of file fs/xfs/xfs_log.c. Return address = xlog_ioend_work+0x64/0xc0 XFS (dm-0): Log I/O Error Detected. XFS (dm-0): Shutting down filesystem. Please unmount the filesystem and rectify the problem(s) XFS (dm-0): xlog_space_left: head behind tail XFS (dm-0): tail_cycle = 6, tail_bytes = 2706944 XFS (dm-0): GH cycle = 6, GH bytes = 1633867 XFS: Assertion failed: 0, file: fs/xfs/xfs_log.c, line: 1310 ------------[ cut here ]------------ Call Trace: xlog_space_left+0xc3/0x110 xlog_grant_push_threshold+0x3f/0xf0 xlog_grant_push_ail+0x12/0x40 xfs_log_reserve+0xd2/0x270 ? __might_sleep+0x4b/0x80 xfs_trans_reserve+0x18b/0x260 ..... There are two things here. Firstly, after a shutdown, the log head and tail can be out of whack as things abort and release (or don't release) resources, so checking them for sanity doesn't make much sense. Secondly, xfs_log_reserve() can race with shutdown and so it can still fail like this even though it has already checked for a log shutdown before calling xlog_grant_push_ail(). So, before ASSERT failing in xlog_space_left(), make sure we haven't already shut down.... Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 502a01fac0983406e7c312764d7a03e06b3d0748 Author: Dave Chinner Date: Tue Aug 10 18:00:41 2021 -0700 xfs: don't run shutdown callbacks on active iclogs When the log is shutdown, it currently walks all the iclogs and runs callbacks that are attached to the iclogs, regardless of whether the iclog is queued for IO completion or not. This creates a problem for contexts attaching callbacks to iclogs in that a racing shutdown can run the callbacks even before the attaching context has finished processing the iclog and releasing it for IO submission. If the callback processing of the iclog frees the structure that is attached to the iclog, then this leads to an UAF scenario that can only be protected against by holding the icloglock from the point callbacks are attached through to the release of the iclog. While we currently do this, it is not practical or sustainable. Hence we need to make shutdown processing the responsibility of the context that holds active references to the iclog. We know that the contexts attaching callbacks to the iclog must have active references to the iclog, and that means they must be in either ACTIVE or WANT_SYNC states. xlog_state_do_callback() will skip over iclogs in these states -except- when the log is shut down. xlog_state_do_callback() checks the state of the iclogs while holding the icloglock, therefore the reference count/state change that occurs in xlog_state_release_iclog() after the callbacks are atomic w.r.t. shutdown processing. We can't push the responsibility of callback cleanup onto the CIL context because we can have ACTIVE iclogs that have callbacks attached that have already been released. Hence we really need to internalise the cleanup of callbacks into xlog_state_release_iclog() processing. Indeed, we already have that internalisation via: xlog_state_release_iclog drop last reference ->SYNCING xlog_sync xlog_write_iclog if (log_is_shutdown) xlog_state_done_syncing() xlog_state_do_callback() The problem is that xlog_state_release_iclog() aborts before doing anything if the log is already shut down. It assumes that the callbacks have already been cleaned up, and it doesn't need to do any cleanup. Hence the fix is to remove the xlog_is_shutdown() check from xlog_state_release_iclog() so that reference counts are correctly released from the iclogs, and when the reference count is zero we always transition to SYNCING if the log is shut down. Hence we'll always enter the xlog_sync() path in a shutdown and eventually end up erroring out the iclog IO and running xlog_state_do_callback() to process the callbacks attached to the iclog. This allows us to stop processing referenced ACTIVE/WANT_SYNC iclogs directly in the shutdown code, and in doing so gets rid of the UAF vector that currently exists. This then decouples the adding of callbacks to the iclogs from xlog_state_release_iclog() as we guarantee that xlog_state_release_iclog() will process the callbacks if the log has been shut down before xlog_state_release_iclog() has been called. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit aad7272a920869b950d937b87562e494af72523c Author: Dave Chinner Date: Tue Aug 10 18:00:40 2021 -0700 xfs: separate out log shutdown callback processing The iclog callback processing done during a forced log shutdown has different logic to normal runtime IO completion callback processing. Separate out the shutdown callbacks into their own function and call that from the shutdown code instead. We don't need this shutdown specific logic in the normal runtime completion code - we'll always run the shutdown version on shutdown, and it will do what shutdown needs regardless of whether there are racing IO completion callbacks scheduled or in progress. Hence we can also simplify the normal IO completion callpath and only abort if shutdown occurred while we actively were processing callbacks. Further, separating out the IO completion logic from the shutdown logic avoids callback race conditions from being triggered by log IO completion after a shutdown. IO completion will now only run callbacks on iclogs that are in the correct state for a callback to be run, avoiding the possibility of running callbacks on a referenced iclog that hasn't yet been submitted for IO. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8bb92005b0e4682a6e5dad131c5f3636c7d56dc1 Author: Dave Chinner Date: Tue Aug 10 18:00:40 2021 -0700 xfs: rework xlog_state_do_callback() Clean it up a bit by factoring and rearranging some of the code. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b36d4651e1650082d27fa477318183c4a7210e30 Author: Dave Chinner Date: Tue Aug 10 18:00:39 2021 -0700 xfs: make forced shutdown processing atomic The running of a forced shutdown is a bit of a mess. It does racy checks for XFS_MOUNT_SHUTDOWN in xfs_do_force_shutdown(), then does more racy checks in xfs_log_force_unmount() before finally setting XFS_MOUNT_SHUTDOWN and XLOG_IO_ERROR under the log->icloglock. Move the checking and setting of XFS_MOUNT_SHUTDOWN into xfs_do_force_shutdown() so we only process a shutdown once and once only. Serialise this with the mp->m_sb_lock spinlock so that the state change is atomic and won't race. Move all the mount specific shutdown state changes from xfs_log_force_unmount() to xfs_do_force_shutdown() so they are done atomically with setting XFS_MOUNT_SHUTDOWN. Then get rid of the racy xlog_is_shutdown() check from xlog_force_shutdown(), and gate the log shutdown on the test_and_set_bit(XLOG_IO_ERROR) test under the icloglock. This means that the log is shutdown once and once only, and code that needs to prevent races with shutdown can do so by holding the icloglock and checking the return value of xlog_is_shutdown(). This results in a predictable shutdown execution process - we set the shutdown flags once and process the shutdown once rather than the current "as many concurrent shutdowns as can race to the flag setting" situation we have now. Also, now that shutdown is atomic, alway emit a stack trace when the error level for the filesystem is high enough. This means that we always get a stack trace when trying to diagnose the cause of shutdowns in the field, rather than just for SHUTDOWN_CORRUPT_INCORE cases. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit e1d06e5f668a403f48538f0d6b163edfd4342adf Author: Dave Chinner Date: Tue Aug 10 17:59:02 2021 -0700 xfs: convert log flags to an operational state field log->l_flags doesn't actually contain "flags" as such, it contains operational state information that can change at runtime. For the shutdown state, this at least should be an atomic bit because it is read without holding locks in many places and so using atomic bitops for the state field modifications makes sense. This allows us to use things like test_and_set_bit() on state changes (e.g. setting XLOG_TAIL_WARN) to avoid races in setting the state when we aren't holding locks. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fd67d8a07208ab06560287b7b9334c2d50b7d6d7 Author: Dave Chinner Date: Tue Aug 10 17:59:02 2021 -0700 xfs: move recovery needed state updates to xfs_log_mount_finish xfs_log_mount_finish() needs to know if recovery is needed or not to make decisions on whether to flush the log and AIL. Move the handling of the NEED_RECOVERY state out to this function rather than needing a temporary variable to store this state over the call to xlog_recover_finish(). Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5112e2067bd94bd56aace4c7e4d45ff13b9152f8 Author: Dave Chinner Date: Tue Aug 10 17:59:01 2021 -0700 xfs: XLOG_STATE_IOERROR must die We don't need an iclog state field to tell us the log has been shut down. We can just check the xlog_is_shutdown() instead. The avoids the need to have shutdown overwrite the current iclog state while being active used by the log code and so having to ensure that every iclog state check handles XLOG_STATE_IOERROR appropriately. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2039a272300b949c05888428877317b834c0b1fb Author: Dave Chinner Date: Tue Aug 10 17:59:01 2021 -0700 xfs: convert XLOG_FORCED_SHUTDOWN() to xlog_is_shutdown() Make it less shouty and a static inline before adding more calls through the log code. Also convert internal log code that uses XFS_FORCED_SHUTDOWN(mount) to use xlog_is_shutdown(log) as well. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 77979058dfcf4818abf7dd84423a7d66dafd8487 Author: Keith Busch Date: Mon Aug 16 09:24:52 2021 -0700 nvme: remove nvm_ndev from ns Now that the lightnvm driver is removed, we don't need a pointer to it's now non-existent struct. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 0866200ed7fdfbfba0c033aad63ff407e5368570 Author: Sagi Grimberg Date: Tue May 25 08:59:46 2021 -0700 nvme: Have NVME_FABRICS select NVME_CORE instead of transport drivers Transport drivers need both core and fabrics modules, instead of selecting both, have the selection transitive such that NVME_FABRICS selects NVME_CORE and transport drivers select NVME_FABRICS. Suggested-by: Keith Busch Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 7d07deb3b838ae93994003cf824515acb352eef3 Author: Krzysztof Kozlowski Date: Tue Jun 1 11:27:04 2021 +0200 EDAC/altera: Skip defining unused structures for specific configs The Altera EDAC driver has several features conditionally built depending on Kconfig options. The edac_device_prv_data structures are conditionally used in of_device_id tables. They reference other functions and structures which can be defined as __maybe_unused. Silence build warnings like: drivers/edac/altera_edac.c:643:37: warning: ‘altr_edac_device_inject_fops’ defined but not used [-Wunused-const-variable=] Reported-by: kernel test robot Signed-off-by: Krzysztof Kozlowski Signed-off-by: Borislav Petkov Acked-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20210601092704.203555-1-krzysztof.kozlowski@canonical.com commit db396be6ddc4b953db3a725e19945fd4f151cfe9 Author: Steven Rostedt (VMware) Date: Mon Aug 16 13:47:48 2021 -0400 MAINTAINERS: Add an entry for os noise/latency The "latency" tracers have some different requirements than normal tracing, and also includes Daniel as a maintainer. Add a section in the MAINTAINERS file to help direct patches and bug reports to these tracers to the right people. Signed-off-by: Steven Rostedt (VMware) commit e0aebd25fdd93ebfb53b11e3c3e142619ca9fe1e Author: John Garry Date: Fri Aug 13 21:49:12 2021 +0800 scsi: fnic: Stop setting scsi_cmnd.tag It is never read. Setting it and the request tag seems dodgy anyway. Link: https://lore.kernel.org/r/1628862553-179450-3-git-send-email-john.garry@huawei.com Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit e2a1dc571e1944469bab2ffc16f31f0c50e38065 Author: John Garry Date: Fri Aug 13 21:49:11 2021 +0800 scsi: wd719: Stop using scsi_cmnd.tag Use scsi_cmd_to_rq(cmd)->tag instead. Link: https://lore.kernel.org/r/1628862553-179450-2-git-send-email-john.garry@huawei.com Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit ccc89737aa6b9f248cf1623014038beb6c2b7f56 Author: Dan Carpenter Date: Tue Aug 10 11:51:49 2021 +0300 scsi: qedf: Fix error codes in qedf_alloc_global_queues() This driver has some left over "return 1" on failure style code mixed with "return negative error codes" style code. The caller doesn't care so we should just convert everything to return negative error codes. Then there was a problem that there were two variables used to store error codes which just resulted in confusion. If qedf_alloc_bdq() returned a negative error code, we accidentally returned success instead of propagating the error code. So get rid of the "rc" variable and use "status" every where. Also remove the "status = 0" initialization so that these sorts of bugs will be detected by the compiler in the future. Link: https://lore.kernel.org/r/20210810085023.GA23998@kili Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Acked-by: Manish Rangankar Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 4dbe57d46d54a847875fa33e7d05877bb341585e Author: Dan Carpenter Date: Tue Aug 10 11:47:53 2021 +0300 scsi: qedi: Fix error codes in qedi_alloc_global_queues() This function had some left over code that returned 1 on error instead negative error codes. Convert everything to use negative error codes. The caller treats all non-zero returns the same so this does not affect run time. A couple places set "rc" instead of "status" so those error paths ended up returning success by mistake. Get rid of the "rc" variable and use "status" everywhere. Remove the bogus "status = 0" initialization, as a future proofing measure so the compiler will warn about uninitialized error codes. Link: https://lore.kernel.org/r/20210810084753.GD23810@kili Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Acked-by: Manish Rangankar Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit d1f6581a6796c4e9fd8a4a24e8b77463d18f0df1 Author: Dan Carpenter Date: Tue Aug 10 11:46:13 2021 +0300 scsi: smartpqi: Fix an error code in pqi_get_raid_map() Return -EINVAL on failure instead of success. Link: https://lore.kernel.org/r/20210810084613.GB23810@kili Fixes: a91aaae0243b ("scsi: smartpqi: allow for larger raid maps") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 9e1b28b773881963150a7e3a11d4d00b9df0129a Author: Randy Dunlap Date: Sun Aug 15 17:05:31 2021 -0700 char: move RANDOM_TRUST_CPU & RANDOM_TRUST_BOOTLOADER into the Character devices menu Include RANDOM_TRUST_CPU and RANDOM_TRUST_BOOTLOADER inside the "Character devices" menu so that they are listed (presented) with other Character devices. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Hsin-Yi Wang Cc: Theodore Ts'o Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20210816000531.17934-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 16af5357d5842785a5646684281fad259310dce0 Author: Colin Ian King Date: Sun Aug 15 22:42:06 2021 +0100 misc: gehc-achc: Fix spelling mistake "Verfication" -> "Verification" There is a spelling mistake in a dev_dbg debug message. Fix it. Reviewed-by: Sebastian Reichel Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210815214206.47970-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 1143637f00cd8205c43bad702b2aff57c01913f8 Author: Changbin Du Date: Sat Aug 14 08:50:33 2021 +0800 tty: replace in_irq() with in_hardirq() Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Reviewed-by: Jiri Slaby Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20210814005033.2381-1-changbin.du@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0d45a1373e669880b8beaecc8765f44cb0241e47 Author: Sergey Shtylyov Date: Fri Aug 13 23:32:38 2021 +0300 usb: phy: tahvo: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with the invalid IRQ #s. Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/8280d6a4-8e9a-7cfe-1aa9-db586dc9afdf@omp.ru Signed-off-by: Greg Kroah-Hartman commit 4ac5132e8a4300637a2da8f5d6bc7650db735b8a Author: Sergey Shtylyov Date: Fri Aug 13 23:30:18 2021 +0300 usb: host: ohci-tmio: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to usb_add_hcd() (which takes *unsigned* IRQ #), causing request_irq() that it calls to fail with -EINVAL, overriding an original error code. Stop calling usb_add_hcd() with the invalid IRQ #s. Fixes: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell") Acked-by: Alan Stern Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/402e1a45-a0a4-0e08-566a-7ca1331506b1@omp.ru Signed-off-by: Greg Kroah-Hartman commit b1a811633f7321cf1ae2bb76a66805b7720e44c9 Author: Pavel Skripkin Date: Thu Aug 12 12:15:01 2021 +0300 block: nbd: add sanity check for first_minor Syzbot hit WARNING in internal_create_group(). The problem was in too big disk->first_minor. disk->first_minor is initialized by value, which comes from userspace and there wasn't any sanity checks about value correctness. It can cause duplicate creation of sysfs files/links, because disk->first_minor will be passed to MKDEV() which causes truncation to byte. Since maximum minor value is 0xff, let's check if first_minor is correct minor number. NOTE: the root case of the reported warning was in wrong error handling in register_disk(), but we can avoid passing knowingly wrong values to sysfs API, because sysfs error messages can confuse users. For example: user passed 1048576 as index, but sysfs complains about duplicate creation of /dev/block/43:0. It's not obvious how 1048576 becomes 0. Log and reproducer for above example can be found on syzkaller bug report page. Link: https://syzkaller.appspot.com/bug?id=03c2ae9146416edf811958d5fd7acfab75b143d1 Fixes: b0d9111a2d53 ("nbd: use an idr to keep track of nbd devices") Reported-by: syzbot+9937dc42271cd87d4b98@syzkaller.appspotmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Pavel Skripkin Signed-off-by: Jens Axboe commit 1a5f6cd286670238265b3c17ae0e8bd146828f40 Author: Sungbo Eo Date: Sun Aug 8 21:38:39 2021 +0900 dt-bindings: usb: mtk-musb: add MT7623 compatible Document MT7623 compatible for mtk-musb. Signed-off-by: Sungbo Eo Reviewed-by: Matthias Brugger Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210808123840.176738-2-mans0n@gorani.run Signed-off-by: Greg Kroah-Hartman commit 15538a20579fa4047912508b03b39bcdeec26b05 Author: Valentin Schneider Date: Wed Aug 11 21:14:32 2021 +0100 notifier: Remove atomic_notifier_call_chain_robust() This now has no more users, remove it. Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Valentin Schneider Acked-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit b2f6662ac08d0e7c25574ce53623c71bdae9dd78 Author: Valentin Schneider Date: Wed Aug 11 21:14:31 2021 +0100 PM: cpu: Make notifier chain use a raw_spinlock_t Invoking atomic_notifier_chain_notify() requires acquiring a spinlock_t, which can block under CONFIG_PREEMPT_RT. Notifications for members of the cpu_pm notification chain will be issued by the idle task, which can never block. Making *all* atomic_notifiers use a raw_spinlock is too big of a hammer, as only notifications issued by the idle task are problematic. Special-case cpu_pm_notifier_chain by kludging a raw_notifier and raw_spinlock_t together, matching the atomic_notifier behavior with a raw_spinlock_t. Fixes: 70d932985757 ("notifier: Fix broken error handling pattern") Signed-off-by: Valentin Schneider Acked-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit 69f87cc7086558ad84f20001256474aa611fc0eb Author: Christoph Hellwig Date: Mon Aug 16 14:36:49 2021 +0200 block: unexport blk_register_queue Not actually used in any modular code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816123649.601591-1-hch@lst.de Signed-off-by: Jens Axboe commit 87b8061bad9bd4b549b2daf36ffbaa57be2789a2 Author: Ulrich Hecht Date: Mon Aug 16 18:22:01 2021 +0200 serial: sh-sci: fix break handling for sysrq This fixes two issues that cause the sysrq sequence to be inadvertently aborted on SCIF serial consoles: - a NUL character remains in the RX queue after a break has been detected, which is then passed on to uart_handle_sysrq_char() - the break interrupt is handled twice on controllers with multiplexed ERI and BRI interrupts Signed-off-by: Ulrich Hecht Link: https://lore.kernel.org/r/20210816162201.28801-1-uli+renesas@fpond.eu Signed-off-by: Greg Kroah-Hartman commit 3d881e32e295decbc86f5d920bedae929be5bfb0 Author: Tang Bin Date: Sat Aug 14 21:14:18 2021 +0800 serial: stm32: use devm_platform_get_and_ioremap_resource() Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210814131418.13608-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 252c651a4c854b328445a536bd1892e999103fca Author: Christoph Hellwig Date: Tue Aug 10 17:26:23 2021 +0200 blk-cgroup: stop using seq_get_buf seq_get_buf is a crutch that undoes all the memory safety of the seq_file interface. Use the normal seq_printf interfaces instead. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20210810152623.1796144-2-hch@lst.de Signed-off-by: Jens Axboe commit 49cb5168a7c6abf9835f9acdce6263bc2deefeb6 Author: Christoph Hellwig Date: Tue Aug 10 17:26:22 2021 +0200 blk-cgroup: refactor blkcg_print_stat Factor out a helper to deal with a single blkcg_gq to make the code a little bit easier to follow. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20210810152623.1796144-1-hch@lst.de Signed-off-by: Jens Axboe commit 59bd4eedf118a0404631038ece6f6a436b98c256 Author: Tang Bin Date: Sat Aug 14 20:49:51 2021 +0800 serial: stm32: use the defined variable to simplify code Use the defined variable 'dev' to make the code cleaner. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210814124951.30084-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 94560f6156fed8ddb0dfc93620382fadf02d90d0 Author: Qian Cai Date: Fri Aug 13 12:31:35 2021 -0400 Revert "arm pl011 serial: support multi-irq request" This reverts commit b0819465be8be0c76af15436a9e6db4dab4c196e which results in amba_device-specific code being called from sbsa_uart_startup() and sbsa_uart_shutdown(). Signed-off-by: Qian Cai Link: https://lore.kernel.org/r/20210813163135.205-1-quic_qiancai@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 3973e15fa5342783ce0009ab3a423ae9b811fc63 Author: Christoph Hellwig Date: Wed Aug 4 11:56:34 2021 +0200 nvme: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/20210804095634.460779-16-hch@lst.de Signed-off-by: Jens Axboe commit 2b7a8112212afa90f36391e3ab7df531614bfb6a Author: Christoph Hellwig Date: Wed Aug 4 11:56:33 2021 +0200 dcssblk: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-15-hch@lst.de Signed-off-by: Jens Axboe commit bf5fb875b494b32ef81fdfa5530a79fc22486254 Author: Christoph Hellwig Date: Wed Aug 4 11:56:32 2021 +0200 dasd: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Stefan Haberland Link: https://lore.kernel.org/r/20210804095634.460779-14-hch@lst.de Signed-off-by: Jens Axboe commit 6da525b3ecaea04eaaeb3277f6e16d91ecfdb84a Author: Christoph Hellwig Date: Wed Aug 4 11:56:31 2021 +0200 ps3vram: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-13-hch@lst.de Signed-off-by: Jens Axboe commit 25d84545beaae8e9427bbd25feff309363cd0a58 Author: Christoph Hellwig Date: Wed Aug 4 11:56:30 2021 +0200 ubd: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Acked-By: Anton Ivanov Link: https://lore.kernel.org/r/20210804095634.460779-12-hch@lst.de Signed-off-by: Jens Axboe commit c3c770563510aa66fd8e84b374daf43e236fa4ba Author: Christoph Hellwig Date: Wed Aug 4 11:56:29 2021 +0200 sd: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Acked-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210804095634.460779-11-hch@lst.de Signed-off-by: Jens Axboe commit 2fd3e5efe791946be0957c8e1eed9560b541fe46 Author: Christoph Hellwig Date: Wed Aug 4 11:56:28 2021 +0200 bcache: use bvec_virt Use bvec_virt instead of open coding it. Note that the existing code is fine despite ignoring bv_offset as the bio is known to contain exactly one page from the page allocator per bio_vec. Signed-off-by: Christoph Hellwig Reviewed-by: Coly Li Link: https://lore.kernel.org/r/20210804095634.460779-10-hch@lst.de Signed-off-by: Jens Axboe commit 358b348b9197b977276e0f034c474380565879e3 Author: Christoph Hellwig Date: Wed Aug 4 11:56:27 2021 +0200 virtio_blk: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20210804095634.460779-9-hch@lst.de Signed-off-by: Jens Axboe commit cf58b537781df6eee2bbeae0463e45acf727978a Author: Christoph Hellwig Date: Wed Aug 4 11:56:26 2021 +0200 rbd: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Jeff Layton Link: https://lore.kernel.org/r/20210804095634.460779-8-hch@lst.de Signed-off-by: Jens Axboe commit fbc27241e537d3a99d0f843a4080e1d2fb014fb4 Author: Christoph Hellwig Date: Wed Aug 4 11:56:25 2021 +0200 squashfs: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-7-hch@lst.de Signed-off-by: Jens Axboe commit 964cacfdd34cd48e3b5b714c3cc33427001e843f Author: Christoph Hellwig Date: Wed Aug 4 11:56:24 2021 +0200 dm-integrity: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-6-hch@lst.de Signed-off-by: Jens Axboe commit 3a8ba33bd71a4126b9e799e8d29d6d5da08c93f0 Author: Christoph Hellwig Date: Wed Aug 4 11:56:23 2021 +0200 dm-ebs: use bvec_virt Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-5-hch@lst.de Signed-off-by: Jens Axboe commit 1c277e501334238f6c4f57d16d14e7c911550075 Author: Christoph Hellwig Date: Wed Aug 4 11:56:22 2021 +0200 dm: make EBS depend on !HIGHMEM __ebs_rw_bvec use page_address on the submitted bios data, and thus can't deal with highmem. Disable the target on highmem configs. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804095634.460779-4-hch@lst.de Signed-off-by: Jens Axboe commit b93ef45350c0119ddc275601438c89231b198414 Author: Christoph Hellwig Date: Wed Aug 4 11:56:21 2021 +0200 block: use bvec_virt in bio_integrity_{process,free} Use the bvec_virt helper to clean up the bio integrity processing a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210804095634.460779-3-hch@lst.de Signed-off-by: Jens Axboe commit 1113f0b69c6a98ff4e733c306a6658a31f8cbc49 Author: Christoph Hellwig Date: Wed Aug 4 11:56:20 2021 +0200 bvec: add a bvec_virt helper Add a helper to get the virtual address for a bvec. This avoids that all callers need to know about the page + offset representation. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210804095634.460779-2-hch@lst.de Signed-off-by: Jens Axboe commit dbcfa7156f48ebb72dfc8f4e5d702af8ca1d4b3a Author: Randy Dunlap Date: Mon Aug 9 18:44:42 2021 -0700 PM: sleep: unmark 'state' functions as kernel-doc Fix kernel-doc warnings in kernel/power/main.c by unmarking the comment block as kernel-doc notation. This eliminates the following kernel-doc warnings: kernel/power/main.c:593: warning: expecting prototype for state(). Prototype was for state_show() instead kernel/power/main.c:593: warning: Function parameter or member 'kobj' not described in 'state_show' kernel/power/main.c:593: warning: Function parameter or member 'attr' not described in 'state_show' kernel/power/main.c:593: warning: Function parameter or member 'buf' not described in 'state_show' Signed-off-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki commit 889c05cc5834a1eef2dbe1e639cfd7a81c4f4c6d Author: Christoph Hellwig Date: Mon Aug 16 14:26:14 2021 +0200 block: ensure the bdi is freed after inode_detach_wb inode_detach_wb references the "main" bdi of the inode. With the recent change to move the bdi from the request_queue to the gendisk this causes a guaranteed use after free when using certain cgroup configurations. The big itself is older through as any non-default inode reference (e.g. an open file descriptor) could have injected this use after free even before that. Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks") Reported-by: Qian Cai Reported-by: syzbot Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816122614.601358-3-hch@lst.de Signed-off-by: Jens Axboe commit 9451aa0aacaf7ea13d1acfd5de8b63a6e0b24fac Author: Christoph Hellwig Date: Mon Aug 16 14:26:13 2021 +0200 block: free the extended dev_t minor later The dev_t is used as the inode hash, so we should only released it once then block device inode is gone from the inode cache. Move it to bdev_free_inode to ensure that. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210816122614.601358-2-hch@lst.de Signed-off-by: Jens Axboe commit 9caf92ab573fd83c7455b65d4eefcefc1a9d2188 Author: Fabio M. De Francesco Date: Mon Aug 16 18:06:15 2021 +0200 staging: r8188eu: Remove unused nat25_handle_frame() Remove nat25_handle_frame() because it is not called by any other function of the driver. Acked-by: Michael Straube Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210816160617.11949-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 80d4a82e1db819b33742c89917127f4c428e1c98 Author: Rajendra Nayak Date: Thu Aug 12 16:57:22 2021 +0530 arm64: dts: sc7180: Add required-opps for i2c qup-i2c devices on sc7180 are clocked with a fixed clock (19.2 MHz) Though qup-i2c does not support DVFS, it still needs to vote for a performance state on 'CX' to satisfy the 19.2 Mhz clock frequency requirement. Use 'required-opps' to pass this information from device tree, and also add the power-domains property to specify the CX power-domain. Signed-off-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit c016baf7dc58e77acdedb2c75dac2b41b77bcf70 Author: Rajendra Nayak Date: Thu Aug 12 16:57:21 2021 +0530 PM: domains: Add support for 'required-opps' to set default perf state Some devices within power domains with performance states do not support DVFS, but still need to vote on a default/static state while they are active. They can express this using the 'required-opps' property in device tree, which points to the phandle of the OPP supported by the corresponding power-domains. Add support to parse this information from DT and then set the specified performance state during attach and drop it on detach. runtime suspend/resume callbacks already have logic to drop/set the vote as needed and should take care of dropping the default perf state vote on runtime suspend and restore it back on runtime resume. Signed-off-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 020d86fc0df8b865f6dc168d88a7c2dccabd0a9e Author: Rajendra Nayak Date: Thu Aug 12 16:57:20 2021 +0530 opp: Don't print an error if required-opps is missing The 'required-opps' property is considered optional, hence remove the pr_err() in of_parse_required_opp() when we find the property is missing. While at it, also fix the return value of of_get_required_opp_performance_state() when of_parse_required_opp() fails, return a -ENODEV instead of the -EINVAL. Signed-off-by: Rajendra Nayak Reviewed-by: Ulf Hansson Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 2aaea6a1647e887fe91ce3e0324e6be4362e5388 Author: Marcin Wojtas Date: Wed Jul 14 23:43:46 2021 +0200 ACPI: SPCR: Add support for the new 16550-compatible Serial Port Subtype The Microsoft Debug Port Table 2 (DBG2) specification revision May 31, 2017 added definition of the 16550-compatible Serial Port Subtype with parameters defined in Generic Address Structure (GAS) [1] Add its support in the SPCR table parsing routine. [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table Signed-off-by: Marcin Wojtas Signed-off-by: Rafael J. Wysocki commit a90887705668fc5587bf5092c38f353ad36c69fd Author: Daniel Scally Date: Fri Aug 6 23:09:06 2021 +0100 Revert "media: device property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary" This reverts commit acd418bfcfc415cf5e6414b6d1c6acfec850f290. Checking for endpoints against fwnode->secondary in fwnode_graph_get_next_endpoint() is a better way to do this since that function is also used in a bunch of other places, for instance sensor drivers checking that they do have an endpoint connected during probe. This reversion depends on the previous patch in this series, "device property: Check fwnode->secondary in fwnode_graph_get_next_endpoint()". Reviewed-by: Andy Shevchenko Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit b5b41ab6b0c1bb70fe37a0d193006c969e3b5909 Author: Daniel Scally Date: Fri Aug 6 23:09:05 2021 +0100 device property: Check fwnode->secondary in fwnode_graph_get_next_endpoint() Sensor drivers often check for an endpoint to make sure that they're connected to a consuming device like a CIO2 during .probe(). Some of those endpoints might be in the form of software_nodes assigned as a secondary to the device's fwnode_handle. Account for this possibility in fwnode_graph_get_next_endpoint() to avoid having to do it in the sensor drivers themselves. Reviewed-by: Andy Shevchenko Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit b25d5a1cd19896bb87b399d6e24896cf6f854d44 Author: Hans de Goede Date: Mon Aug 16 13:30:07 2021 +0200 ACPI: platform-profile: call sysfs_notify() from platform_profile_store() Drivers like thinkpad_acpi and ideapad_laptop call the platform_profile_notify() helper when the profile is changed by hardware (the embedded-controller/EC) in response to an EC handled hotkey. This allows userspace to monitor for such changes by polling for POLLPRI on the platform_profile sysfs file. But the profile can also be changed underneath a userspace program monitoring it by anonther userspace program storing a new value. Add a sysfs_notify() call to platform_profile_store(), so that userspace programs monitoring for changes also get notified in this case. Also update the documentation to document that POLLPRI polling can be used to watch for changes. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit ecb71f2566673553bc067e5b0036756871d0b9d3 Author: Kiran K Date: Mon Aug 16 05:07:47 2021 +0530 Bluetooth: Fix race condition in handling NOP command For NOP command, need to cancel work scheduled on cmd_timer, on receiving command status or commmand complete event. Below use case might lead to race condition multiple when NOP commands are queued sequentially: hci_cmd_work() { if (atomic_read(&hdev->cmd_cnt) { . . . atomic_dec(&hdev->cmd_cnt); hci_send_frame(hdev,...); schedule_delayed_work(&hdev->cmd_timer,...); } } On receiving event for first NOP, the work scheduled on hdev->cmd_timer is not cancelled and second NOP is dequeued and sent to controller. While waiting for an event for second NOP command, work scheduled on cmd_timer for the first NOP can get scheduled, resulting in sending third NOP command (sending back to back NOP commands). This might cause issues at controller side (like memory overrun, controller going unresponsive) resulting in hci tx timeouts, hardware errors etc. The fix to this issue is to cancel the delayed work scheduled on cmd_timer on receiving command status or command complete event for NOP command (this patch handles NOP command same as any other SIG command). Signed-off-by: Kiran K Reviewed-by: Chethan T N Reviewed-by: Srivatsa Ravishankar Acked-by: Manish Mandlik Signed-off-by: Marcel Holtmann commit 192aa65ac00ce0bc70c3f271cf3ee030acc0655a Author: Angus Ainslie Date: Thu Aug 12 09:52:18 2021 -0700 Bluetooth: btbcm: add patch ram for bluetooth Bluetooth on the BCM43752 needs a patchram file to function correctly. Signed-off-by: Angus Ainslie Signed-off-by: Marcel Holtmann commit 565efae96ca1bd5405dac88d2284cd2167e5d5f0 Author: Dmitry Osipenko Date: Sat Jul 31 20:38:39 2021 +0300 power: supply: smb347-charger: Implement USB VBUS regulator SMB347 can supply power to USB VBUS, implement the USB VBUS regulator. USB VBUS needs to be powered for switching OTG-cable USB port into host mode. Signed-off-by: Dmitry Osipenko Signed-off-by: Sebastian Reichel commit efe2175478d5237949e33c84d9a722fc084b218c Author: Dmitry Osipenko Date: Sat Jul 31 20:38:38 2021 +0300 power: supply: smb347-charger: Add missing pin control activation Pin control needs to be activated by setting the enable bit, otherwise hardware rejects all pin changes. Previously this stayed unnoticed on Nexus 7 because pin control was enabled by default after rebooting from downstream kernel, which uses driver that enables the bit and charger registers are non-volatile until power supply (battery) is disconnected. Configure the pin control enable bit. This fixes the potentially never-enabled charging on devices that use pin control. Signed-off-by: Dmitry Osipenko Signed-off-by: Sebastian Reichel commit 17e7bc532cd540d0e6e2fa1af19faf74ba252051 Author: Dmitry Osipenko Date: Sat Jul 31 20:38:37 2021 +0300 power: supply: smb347-charger: Utilize generic regmap caching Utilize generic regmap caching in order to avoid unnecessary slow I2C accesses to all constant registers each time the supply status updated and remove local caching of charger state to make code cleaner. Signed-off-by: Dmitry Osipenko Signed-off-by: Sebastian Reichel commit 4ac59d85a2369eac88f6042e3b9b8a4789525909 Author: Dmitry Osipenko Date: Sat Jul 31 20:38:36 2021 +0300 power: supply: smb347-charger: Make smb347_set_writable() IRQ-safe The smb347_set_writable() is used by interrupt handler and outside of it. The interrupt should be disabled when the function is used outside of interrupt handler in order to prevent racing with the interrupt context. Add new parameter to smb347_set_writable() that allows to disable IRQ. Signed-off-by: Dmitry Osipenko Signed-off-by: Sebastian Reichel commit 3e81bd7dfb9c72679666d1a54c9dd94b711f0fbc Author: Dmitry Osipenko Date: Sat Jul 31 20:38:35 2021 +0300 dt-bindings: power: supply: smb347-charger: Document USB VBUS regulator SMB347 can supply power to USB VBUS, which is required by OTG-cable devices that want to switch USB port into the host mode. Add USB VBUS regulator properties. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Signed-off-by: Sebastian Reichel commit 7087c4f69487f017722df7d299ef9b7709996b79 Author: Luiz Augusto von Dentz Date: Wed Aug 11 16:20:16 2021 -0700 Bluetooth: Store advertising handle so it can be re-enabled This stores the advertising handle/instance into hci_conn so it is accessible when re-enabling the advertising once disconnected. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit cafae4cd625502f65d1798659c1aa9b62d38cc56 Author: Luiz Augusto von Dentz Date: Wed Aug 11 16:20:15 2021 -0700 Bluetooth: Fix handling of LE Enhanced Connection Complete LE Enhanced Connection Complete contains the Local RPA used in the connection which must be used when set otherwise there could problems when pairing since the address used by the remote stack could be the Local RPA: BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 4, Part E page 2396 'Resolvable Private Address being used by the local device for this connection. This is only valid when the Own_Address_Type (from the HCI_LE_Create_Connection, HCI_LE_Set_Advertising_Parameters, HCI_LE_Set_Extended_Advertising_Parameters, or HCI_LE_Extended_Create_Connection commands) is set to 0x02 or 0x03, and the Controller generated a resolvable private address for the local device using a non-zero local IRK. For other Own_Address_Type values, the Controller shall return all zeros.' Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 0ea53674d07fb6db2dd7a7ec2fdc85a12eb246c2 Author: Kai-Heng Feng Date: Tue Aug 10 12:53:15 2021 +0800 Bluetooth: Move shutdown callback before flushing tx and rx queue Commit 0ea9fd001a14 ("Bluetooth: Shutdown controller after workqueues are flushed or cancelled") introduced a regression that makes mtkbtsdio driver stops working: [ 36.593956] Bluetooth: hci0: Firmware already downloaded [ 46.814613] Bluetooth: hci0: Execution of wmt command timed out [ 46.814619] Bluetooth: hci0: Failed to send wmt func ctrl (-110) The shutdown callback depends on the result of hdev->rx_work, so we should call it before flushing rx_work: -> btmtksdio_shutdown() -> mtk_hci_wmt_sync() -> __hci_cmd_send() -> wait for BTMTKSDIO_TX_WAIT_VND_EVT gets cleared -> btmtksdio_recv_event() -> hci_recv_frame() -> queue_work(hdev->workqueue, &hdev->rx_work) -> clears BTMTKSDIO_TX_WAIT_VND_EVT So move the shutdown callback before flushing TX/RX queue to resolve the issue. Reported-and-tested-by: Mattijs Korpershoek Tested-by: Hsin-Yi Wang Cc: Guenter Roeck Fixes: 0ea9fd001a14 ("Bluetooth: Shutdown controller after workqueues are flushed or cancelled") Signed-off-by: Kai-Heng Feng Signed-off-by: Marcel Holtmann commit bd74095389b378f2292ae32397b23f4b97ff23c8 Author: zhaoxiao Date: Mon Aug 16 13:24:30 2021 +0800 tracepoint: Fix kerneldoc comments Fix function name in tracepoint.c kernel-doc comment to remove a warning found by clang_w1. kernel/tracepoint.c:589: warning: expecting prototype for register_tracepoint_notifier(). Prototype was for register_tracepoint_module_notifier() instead kernel/tracepoint.c:613: warning: expecting prototype for unregister_tracepoint_notifier(). Prototype was for unregister_tracepoint_module_notifier() instead Link: https://lkml.kernel.org/r/20210816052430.16539-1-zhaoxiao@uniontech.com Acked-by: Mathieu Desnoyers Signed-off-by: zhaoxiao Signed-off-by: Steven Rostedt (VMware) commit 54b3498d71ae03f70cb7c366d269d0af49d29ec1 Author: Masami Hiramatsu Date: Tue Aug 10 11:08:22 2021 +0900 bootconfig/tracing/ktest: Update ktest example for boot-time tracing Update ktest example for the boot-time tracing with histogram options. Note that since the histogram option uses "trace()" action instead of "EVENT()", this updates the matching pattern too. Link: https://lkml.kernel.org/r/162856130208.203126.4458319094852152589.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 1eaad3ac3f399434cc50416455dda108aa4ea32e Author: Masami Hiramatsu Date: Tue Aug 10 11:08:14 2021 +0900 tools/bootconfig: Use per-group/all enable option in ftrace2bconf script Use per-group/all enable option instead of ftrace.events option. This will make the bootconfig file more readable. Link: https://lkml.kernel.org/r/162856129436.203126.12462564671412940618.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit f134ebb28126d702c8d99e378fb3fb753e54b8f6 Author: Masami Hiramatsu Date: Tue Aug 10 11:08:06 2021 +0900 tools/bootconfig: Add histogram syntax support to bconf2ftrace.sh Add histogram syntax support to bconf2ftrace.sh script. Link: https://lkml.kernel.org/r/162856128672.203126.8240335908303312607.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 1d8365a553a7caeb75246682b0901ce24a335602 Author: Masami Hiramatsu Date: Tue Aug 10 11:07:58 2021 +0900 tools/bootconfig: Support per-group/all event enabling option Add group or all event enabling syntax support to bconf2ftrace.sh. User can pass a bootconfig file which includes ftrace[.instance.INSTANCE].event.enable and ftrace[.instance.INSTANCE].event.GROUP.enable correctly. Link: https://lkml.kernel.org/r/162856127850.203126.16694505101982548237.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 559789539255bf17dfe2983b0f4d03b9d37a3395 Author: Masami Hiramatsu Date: Tue Aug 10 11:07:51 2021 +0900 Documentation: tracing: Add histogram syntax to boot-time tracing Add the documentation about histogram syntax in boot-time tracing. This will allow user to write the histogram setting in a structured parameters. Link: https://lkml.kernel.org/r/162856127129.203126.15551542847575916525.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 64dc7f6958ef56512137ed6ec228127cef7724e9 Author: Masami Hiramatsu Date: Tue Aug 10 11:07:44 2021 +0900 tracing/boot: Show correct histogram error command Since trigger_process_regex() modifies given trigger actions while parsing, the error message couldn't show what command was passed to the trigger_process_regex() when it returns an error. To fix that, show the backed up trigger action command instead of parsed buffer. Link: https://lkml.kernel.org/r/162856126413.203126.9465564928450701424.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 17abd7c36c77c393fa65cde462059395d6437dba Author: Masami Hiramatsu Date: Tue Aug 10 11:07:36 2021 +0900 tracing/boot: Support multiple histograms for each event Add multiple histograms support for each event. This allows user to set multiple histograms to an event. ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist[.N] { ... } The 'N' is a digit started string and it can be omitted for the default histogram. For example, multiple hist triggers example in the Documentation/trace/histogram.rst can be written as below; ftrace.event.net.netif_receive_skb.hist { 1 { keys = skbaddr.hex values = len filter = len < 0 } 2 { keys = skbaddr.hex values = len filter = len > 4096 } 3 { keys = skbaddr.hex values = len filter = len == 256 } 4 { keys = skbaddr.hex values = len } 5 { keys = len values = common_preempt_count } } Link: https://lkml.kernel.org/r/162856125628.203126.15846930277378572120.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 8993665abcce793f00815b3504a486dce70cc2b9 Author: Masami Hiramatsu Date: Tue Aug 10 11:07:29 2021 +0900 tracing/boot: Support multiple handlers for per-event histogram Support multiple handlers for per-event histogram in boot-time tracing. Since the histogram can register multiple same handler-actions with different parameters, this expands the syntax to support such cases. With this update, the 'onmax', 'onchange' and 'onmatch' handler subkeys under per-event histogram option will take a number subkeys optionally as below. (see [.N]) ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist { onmax|onchange[.N] { var = ; [= ] } onmatch[.N] { event = ; [= ] } } The 'N' must be a digit (or digit started word). Thus user can add several handler-actions to the histogram, for example, ftrace.event.SOMEGROUP.SOMEEVENT.hist { keys = SOME_ID; lat = common_timestamp.usecs-$ts0 onmatch.1 { event = GROUP1.STARTEVENT1 trace = latency_event, SOME_ID, $lat } onmatch.2 { event = GROUP2.STARTEVENT2 trace = latency_event, SOME_ID, $lat } } Then, it can trace the elapsed time from GROUP1.STARTEVENT1 to SOMEGROUP.SOMEEVENT, and from GROUP2.STARTEVENT2 to SOMEGROUP.SOMEEVENT with SOME_ID key. Link: https://lkml.kernel.org/r/162856124905.203126.14913731908137885922.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit e66ed86ca6c52488249e95f7b3a6a3d7d6ab5e1e Author: Masami Hiramatsu Date: Tue Aug 10 11:07:21 2021 +0900 tracing/boot: Add per-event histogram action options Add a hist-trigger action syntax support to boot-time tracing. Currently, boot-time tracing supports per-event actions as option strings. However, for the histogram action, it has a special syntax and usually needs a long action definition. To make it readable and fit to the bootconfig syntax, this introduces a new options for histogram. Here are the histogram action options for boot-time tracing. ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist { keys = [,...] values = [,...] sort = [,...] size = name = var { = ... } pause|continue|clear onmax|onchange { var = ; [= ] } onmatch { event = ; [= ] } filter = } Where is one of below; trace = , [, ...] save = [, ...] snapshot Link: https://lkml.kernel.org/r/162856124106.203126.10501871028479029087.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit c3b1c377f0102e88dea6354d9cdb34a9d1c90971 Author: Huang Shijie Date: Mon Aug 2 14:02:34 2021 +0000 tracing: Fix a typo in tracepoint.h It should be @prev_pid, not @prev_prid. Link: https://lkml.kernel.org/r/20210802140234.5383-1-shijie@os.amperecomputing.com Signed-off-by: Huang Shijie Signed-off-by: Steven Rostedt (VMware) commit 4aae683f132777a92b80d6971d56174d5f4cb3f3 Author: Masahiro Yamada Date: Sat Jul 31 14:22:32 2021 +0900 tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig Make architectures select TRACE_IRQFLAGS_SUPPORT instead of having many defines. Link: https://lkml.kernel.org/r/20210731052233.4703-2-masahiroy@kernel.org Acked-by: Heiko Carstens Acked-by: Vineet Gupta    #arch/arc Acked-by: Michael Ellerman (powerpc) Acked-by: Catalin Marinas Acked-by: Max Filippov Signed-off-by: Masahiro Yamada Signed-off-by: Steven Rostedt (VMware) commit de32951b29be3d6cc7a92bfbf366f48a9f4c4407 Author: Masahiro Yamada Date: Sat Jul 31 14:22:31 2021 +0900 tracing: Simplify the Kconfig dependency of FTRACE The entire FTRACE block is surrounded by 'if TRACING_SUPPORT' ... 'endif'. Using 'depends on' is a simpler way to guard FTRACE. Link: https://lkml.kernel.org/r/20210731052233.4703-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada Signed-off-by: Steven Rostedt (VMware) commit ed2cf90735daf40ab8d938b4b6d3ca43c0f84466 Author: Steven Rostedt (VMware) Date: Thu Jul 22 10:27:07 2021 -0400 tracing: Allow execnames to be passed as args for synthetic events Allow common_pid.execname to be saved in a variable in one histogram to be passed to another histogram that can pass it as a parameter to a synthetic event. ># echo 'hist:keys=pid:__arg__1=common_timestamp.usecs:arg2=common_pid.execname' \ > events/sched/sched_waking/trigger ># echo 'wakeup_lat s32 pid; u64 delta; char wake_comm[]' > synthetic_events ># echo 'hist:keys=next_pid:pid=next_pid,delta=common_timestamp.usecs-$__arg__1,exec=$arg2'\ ':onmatch(sched.sched_waking).trace(wakeup_lat,$pid,$delta,$exec)' \ > events/sched/sched_switch/trigger The above is a wake up latency synthetic event setup that passes the execname of the common_pid that woke the task to the scheduling of that task, which triggers a synthetic event that passes the original execname as a parameter to display it. ># echo 1 > events/synthetic/enable ># cat trace -0 [006] d..4 186.863801: wakeup_lat: pid=1306 delta=65 wake_comm=kworker/u16:3 -0 [000] d..4 186.863858: wakeup_lat: pid=163 delta=27 wake_comm= -0 [001] d..4 186.863903: wakeup_lat: pid=1307 delta=36 wake_comm=kworker/u16:4 -0 [000] d..4 186.863927: wakeup_lat: pid=163 delta=5 wake_comm= -0 [006] d..4 186.863957: wakeup_lat: pid=1306 delta=24 wake_comm=kworker/u16:3 sshd-1306 [006] d..4 186.864051: wakeup_lat: pid=61 delta=62 wake_comm= -0 [000] d..4 186.965030: wakeup_lat: pid=609 delta=18 wake_comm= -0 [006] d..4 186.987582: wakeup_lat: pid=1306 delta=65 wake_comm=kworker/u16:3 -0 [000] d..4 186.987639: wakeup_lat: pid=163 delta=27 wake_comm= Link: https://lkml.kernel.org/r/20210722142837.458596338@goodmis.org Reviewed-by: Tom Zanussi Reviewed-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 3347d80baa41c357cf263923f60aa8051a753d76 Author: Steven Rostedt (VMware) Date: Thu Jul 22 10:27:06 2021 -0400 tracing: Have histogram types be constant when possible Instead of kstrdup("const", GFP_KERNEL), have the hist_field type simply assign the constant hist_field->type = "const"; And when the value passed to it is a variable, use "kstrdup_const(var, GFP_KERNEL);" which will just copy the value if the variable is already a constant. This saves on having to allocate when not needed. All frees of the hist_field->type will need to use kfree_const(). Link: https://lkml.kernel.org/r/20210722142837.280718447@goodmis.org Suggested-by: Masami Hiramatsu Reviewed-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 370364351926e4fcc7c1a486901bfaae0172b7d9 Author: Steven Rostedt (VMware) Date: Wed Jul 7 17:36:25 2021 -0400 tracing/histogram: Update the documentation for the buckets modifier Update both the tracefs README file as well as the histogram.rst to include an explanation of what the buckets modifier is and how to use it. Include an example with the wakeup_latency example for both log2 and the buckets modifiers as there was no existing log2 example. Link: https://lkml.kernel.org/r/20210707213922.167218794@goodmis.org Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit de9a48a360b70d5318061cf1237431d1869555e4 Author: Steven Rostedt (VMware) Date: Wed Jul 7 17:36:24 2021 -0400 tracing: Add linear buckets to histogram logic There's been several times I wished the histogram logic had a "grouping" feature for the buckets. Currently, each bucket has a size of one. That is, if you trace the amount of requested allocations, each allocation is its own bucket, even if you are interested in what allocates 100 bytes or less, 100 to 200, 200 to 300, etc. Also, without grouping, it fills up the allocated histogram buckets quickly. If you are tracking latency, and don't care if something is 200 microseconds off, or 201 microseconds off, but want to track them by say 10 microseconds each. This can not currently be done. There is a log2 but that grouping get's too big too fast for a lot of cases. Introduce a "buckets=SIZE" command to each field where it will record in a rounded number. For example: ># echo 'hist:keys=bytes_req.buckets=100:sort=bytes_req' > events/kmem/kmalloc/trigger ># cat events/kmem/kmalloc/hist # event histogram # # trigger info: hist:keys=bytes_req.buckets=100:vals=hitcount:sort=bytes_req.buckets=100:size=2048 [active] # { bytes_req: ~ 0-99 } hitcount: 3149 { bytes_req: ~ 100-199 } hitcount: 1468 { bytes_req: ~ 200-299 } hitcount: 39 { bytes_req: ~ 300-399 } hitcount: 306 { bytes_req: ~ 400-499 } hitcount: 364 { bytes_req: ~ 500-599 } hitcount: 32 { bytes_req: ~ 600-699 } hitcount: 69 { bytes_req: ~ 700-799 } hitcount: 37 { bytes_req: ~ 1200-1299 } hitcount: 16 { bytes_req: ~ 1400-1499 } hitcount: 30 { bytes_req: ~ 2000-2099 } hitcount: 6 { bytes_req: ~ 4000-4099 } hitcount: 2168 { bytes_req: ~ 5000-5099 } hitcount: 6 Totals: Hits: 7690 Entries: 13 Dropped: 0 Link: https://lkml.kernel.org/r/20210707213921.980359719@goodmis.org Acked-by: Namhyung Kim Reviewed-by: Tom Zanussi Reviewed-by: Masami Hiramatsu Tested-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (VMware) commit 6fe7c745f2acb73e4cc961d7f91125eef5a8861f Author: Masami Hiramatsu Date: Tue Aug 10 11:07:14 2021 +0900 tracing/boot: Fix a hist trigger dependency for boot time tracing Fixes a build error when CONFIG_HIST_TRIGGERS=n with boot-time tracing. Since the trigger_process_regex() is defined only when CONFIG_HIST_TRIGGERS=y, if it is disabled, the 'actions' event option also must be disabled. Link: https://lkml.kernel.org/r/162856123376.203126.582144262622247352.stgit@devnote2 Fixes: 81a59555ff15 ("tracing/boot: Add per-event settings") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit d40dfb860ad72a32b9c2aeae739a2725f8ce011a Author: Biju Das Date: Mon Aug 16 14:20:49 2021 +0100 ASoC: sh: rz-ssi: Fix dereference of noderef expression warning Fix following sparse warning: sound/soc/sh/rz-ssi.c:156:15: sparse: warning: dereference of noderef expression Signed-off-by: Biju Das Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210816132049.28128-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit ff63261978ee1f00758f447d63276a6f180a81dc Author: Greg Kroah-Hartman Date: Mon Aug 16 09:34:50 2021 +0200 staging: r8188eu: remove ipx support from driver The ipx.h header files are being removed from the kernel, and support for them was long removed from the tree, so remove all references to it in the r8188eu driver as well, to allow it to continue to build properly in linux-next Reported-by: Stephen Rothwell Acked-by: Phillip Potter Link: https://lore.kernel.org/r/20210816073450.668993-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit cd40705f6b27313536836e4d3974873bf4e10247 Author: Greg Kroah-Hartman Date: Mon Aug 16 09:34:49 2021 +0200 staging: r8188eu: remove inline markings from functions in rtw_br_ext.c The compiler is free to ignore, or follow, "inline" markings so they really have no use in .c files, so just remove them. This allows functions to properly show up as being unused when all callers to them are removed, otherwise gcc does not warn you about this. Acked-by: Phillip Potter Link: https://lore.kernel.org/r/20210816073450.668993-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 696e0c937d07a79341d6e5da23fb6abc1d2f842b Author: Bob Moore Date: Tue Aug 3 20:11:57 2021 +0200 ACPICA: Update version to 20210730 Version 20210730. ACPICA commit 2195f614e79442beb4d24d7a29a6347493e444e5 Link: https://github.com/acpica/acpica/commit/2195f614 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 89ceb98ac1184e7c28b7f6feb877986f77591103 Author: Bob Moore Date: Tue Aug 3 20:11:21 2021 +0200 ACPICA: Add method name "_DIS" For use with aslmethod.c ACPICA commit 5acc6818c537888be147d9da6b280a0b8c241a1d Link: https://github.com/acpica/acpica/commit/5acc6818 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 87b8ec5846cb81747088d1729acaf55a1155a267 Author: Bob Moore Date: Tue Aug 3 20:10:46 2021 +0200 ACPICA: iASL: Fix for WPBT table with no command-line arguments Handle the case where the Command-line Arguments table field does not exist. ACPICA commit d6487164497fda170a1b1453c5d58f2be7c873d6 Link: https://github.com/acpica/acpica/commit/d6487164 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 200950b615d5d788dfd8b12d73568e420735bfb0 Author: Marcin Wojtas Date: Tue Aug 3 20:10:02 2021 +0200 ACPICA: Headers: Add new DBG2 Serial Port Subtypes The Microsoft Debug Port Table 2 (DBG2) specification revision September 21, 2020 comprises additional Serial Port Subtypes [1]. Reflect that in the actbl1.h header file. [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table ACPICA commit d95c7d206b5836c7770e8e9cd613859887fded8f Link: https://github.com/acpica/acpica/commit/d95c7d20 Signed-off-by: Marcin Wojtas Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 78df71b3a640e7b0197ed9cc19a39b8f236d805e Author: Bob Moore Date: Tue Aug 3 20:09:18 2021 +0200 ACPICA: Macros should not use a trailing semicolon ACPICA commit 8d49c0b2b78b8a8c5dae4d5ff28432729f4d59f2 Link: https://github.com/acpica/acpica/commit/8d49c0b2 Signed-off-by: Huilong Deng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 5ecce804da24c0587a52597e608f81ad982862d6 Author: Bob Moore Date: Tue Aug 3 20:08:45 2021 +0200 ACPICA: Fix an if statement (add parens) ACPICA commit 4dbe4b9a0c203b04918705f022e0db997aa55696 Link: https://github.com/acpica/acpica/commit/4dbe4b9a Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit e692fa1353609a3cd22f4b415c9d1f014e769ecd Author: Bob Moore Date: Tue Aug 3 20:07:53 2021 +0200 ACPICA: iASL: Add support for the AEST table (data compiler) Includes support in the table compiler and the disassembler. ACPICA commit e75074d84d1207339a048486c2d06ecb935d0092 Link: https://github.com/acpica/acpica/commit/e75074d8 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit f75953bca75f8f767c64bb5e91089876ccc1ca4e Merge: 356b94a32a752 834a36ddc6d27 Author: Mark Brown Date: Mon Aug 16 15:20:05 2021 +0100 Merge series "ASoC: soc-xxx: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-xxx. Kuninori Morimoto (9): ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params() ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new() ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user() ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities() ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new() ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report() ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() ASoC: soc-ac97: cleanup cppcheck warning sound/soc/soc-ac97.c | 14 ++++++-------- sound/soc/soc-component.c | 4 ++-- sound/soc/soc-dai.c | 18 ++++++++---------- sound/soc/soc-generic-dmaengine-pcm.c | 9 +++------ sound/soc/soc-jack.c | 15 +++++++-------- 5 files changed, 26 insertions(+), 34 deletions(-) -- 2.25.1 commit a115b1bd3af0c2963e72f6e47143724c59251be6 Author: Marek Vasut Date: Sun Aug 15 20:16:50 2021 +0200 PCI: rcar: Add L1 link state fix into data abort hook When the link is in L1, hardware should return it to L0 automatically whenever a transaction targets a component on the other end of the link (PCIe r5.0, sec 5.2). The R-Car PCIe controller doesn't handle this transition correctly. If the link is not in L0, an MMIO transaction targeting a downstream device fails, and the controller reports an ARM imprecise external abort. Work around this by hooking the abort handler so the driver can detect this situation and help the hardware complete the link state transition. When the R-Car controller receives a PM_ENTER_L1 DLLP from the downstream component, it sets PMEL1RX bit in PMSR register, but then the controller enters some sort of in-between state. A subsequent MMIO transaction will fail, resulting in the external abort. The abort handler detects this condition and completes the link state transition by setting the L1IATN bit in PMCTLR and waiting for the link state transition to complete. Link: https://lore.kernel.org/r/20210815181650.132579-1-marek.vasut@gmail.com Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Lorenzo Pieralisi Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org commit 1b3f78df6a80932d7deb0155d8b0871e8d3e4bca Author: Antoine Tenart Date: Mon Aug 16 12:08:28 2021 +0200 bonding: improve nl error msg when device can't be enslaved because of IFF_MASTER Use a more user friendly netlink error message when a device can't be enslaved because it has IFF_MASTER, by not referring directly to a kernel internal flag. Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit bc239d8d6dd927af1df3fa3984ccf5f531d1be54 Author: Tang Bin Date: Wed Aug 11 20:19:34 2021 +0800 mfd: ti_am335x_tscadc: Delete superfluous error message In the function ti_tscadc_probe(), when get irq failed, platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin Signed-off-by: Lee Jones commit ab6361382fc1cd57e2d06a1ee29bf7b8e98ca257 Merge: 23a44b77e03f5 175e669247190 Author: David S. Miller Date: Mon Aug 16 13:58:00 2021 +0100 Merge branch 'bridge-mcast-fixes' Nikolay Aleksandrov says: ==================== net: bridge: mcast: fixes for mcast querier state These three fix querier state dumping. The first patch can be considered a minor behaviour improvement, it avoids dumping querier state when mcast snooping is disabled. The second patch was a report of sizeof(0) used for nested netlink attribute size which should be just 0, and the third patch accounts for IPv6 querier state size when allocating skb for notifications. ==================== Signed-off-by: David S. Miller commit 175e66924719090f3f43884a419e7c32dabb800f Author: Nikolay Aleksandrov Date: Mon Aug 16 13:11:34 2021 +0300 net: bridge: mcast: account for ipv6 size when dumping querier state We need to account for the IPv6 attributes when dumping querier state. Fixes: 5e924fe6ccfd ("net: bridge: mcast: dump ipv6 querier state") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit cdda378bd8d9076319e5713595b4944b32d95a40 Author: Nikolay Aleksandrov Date: Mon Aug 16 13:11:33 2021 +0300 net: bridge: mcast: drop sizeof for nest attribute's zero size This was a dumb error I made instead of writing nla_total_size(0) for a nest attribute, I wrote nla_total_size(sizeof(0)). Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 606433fe3e11 ("net: bridge: mcast: dump ipv4 querier state") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f137b7d4ecf8fca0891f435a198b3c8beec8a9d2 Author: Nikolay Aleksandrov Date: Mon Aug 16 13:11:32 2021 +0300 net: bridge: mcast: don't dump querier state if snooping is disabled A minor improvement to avoid dumping mcast ctx querier state if snooping is disabled for that context (either bridge or vlan). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 9a8c4bace04a61efbcce4bd44ffa8b86b03ffdfe Author: Matthias Schiffer Date: Fri Jul 16 12:00:53 2021 +0200 mfd: tqmx86: Assume 24MHz LPC clock for unknown boards All future TQMx86 modules should use a 24MHz LPC clock. Warn about unknown boards, but assume this is the case. Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit d5949a35cc29db81f7b50ac0b18a114ffc655ea5 Author: Matthias Schiffer Date: Fri Jul 16 12:00:52 2021 +0200 mfd: tqmx86: Add support for TQ-Systems DMI IDs Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor ID. Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit 3da48ccb1d0f3b53b1e8c9022edbedc2a6e3f50a Author: Matthias Schiffer Date: Fri Jul 16 12:00:51 2021 +0200 mfd: tqmx86: Add support for TQMx110EB and TQMxE40x Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a 24MHz LPC clock. Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit 41e9b5e2d88f6452be0f82a5f66b69ff5d26622e Author: Matthias Schiffer Date: Fri Jul 16 12:00:50 2021 +0200 mfd: tqmx86: Fix typo in "platform" Rename variable from "ocores_platfom_data" to "ocores_platform_data". Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit 16b2ad150f74db0eb91f445061f16140b5aaa650 Author: Matthias Schiffer Date: Fri Jul 16 12:00:49 2021 +0200 mfd: tqmx86: Remove incorrect TQMx90UC board ID No TQMx90UC exists at the moment, and it is undecided whether ID 10 will be used eventually (and if it is, how that SoM will be named). Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit a946506c48f3bd09363c9d2b0a178e55733bcbb6 Author: Matthias Schiffer Date: Fri Jul 16 12:00:48 2021 +0200 mfd: tqmx86: Clear GPIO IRQ resource when no IRQ is set The driver was registering IRQ 0 when no IRQ was set. This leads to warnings with newer kernels. Clear the resource flags, so no resource is registered at all in this case. Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO") Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones commit 80698507e0b20817ab850538080b01c3e0a5314f Author: Emil Renner Berthing Date: Tue Jul 27 11:25:53 2021 +0200 power: reset: Add TPS65086 restart driver The only way to reset the BeagleV Starlight v0.9 board[1] properly is to tell the PMIC to reset itself which will then assert the external reset lines of the SoC, USB hub and ethernet phy. This adds a driver to register a reset handler to do just that. [1] https://github.com/beagleboard/beaglev-starlight Signed-off-by: Emil Renner Berthing Signed-off-by: Sebastian Reichel commit c753ea31781aaab2dccc3e6f297cfde3c99f0ba1 Author: Lee Jones Date: Wed Aug 4 15:21:59 2021 +0100 mfd: simple-mfd-i2c: Add support for registering devices via MFD cells More devices are cropping up requiring only Regmap initialisation and child registration functionality. We currently only support that if all required devices are represented by their own Device Tree nodes complete with compatible strings. However, not everyone is happy with adding empty nodes that provide no additional device information into the Device Tree. Rather than have a plethora of mostly empty, function-less drivers in MFD, we'll support those simple cases in here instead via MFD cells. Cc: Mark Brown Tested-by: Michael Walle Reviewed-by: Alistair Francis Tested-by: Alistair Francis Signed-off-by: Lee Jones commit 80cbd8808f85017b8aff4b223db68926b470be12 Author: Jason Ekstrand Date: Thu Aug 12 15:34:43 2021 -0500 drm/ttm: Include pagemap.h from ttm_tt.h It's needed for pgprot_t which is used in the header. Signed-off-by: Jason Ekstrand Cc: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210812203443.1725307-2-jason@jlekstrand.net Reviewed-by: Christian König Signed-off-by: Christian König commit bd4dadaf04ceafe02f0f397a31f18a5018418e9b Author: Jason Ekstrand Date: Thu Aug 12 15:34:42 2021 -0500 drm/ttm: ttm_bo_device is now ttm_device These names were changed in commit 8af8a109b34fa88b8b91f25d11485b37d37549c3 Author: Christian König Date: Thu Oct 1 14:51:40 2020 +0200 drm/ttm: device naming cleanup But he missed a couple of them. Signed-off-by: Jason Ekstrand Cc: Christian König Fixes: 8af8a109b34f ("drm/ttm: device naming cleanup") Link: https://patchwork.freedesktop.org/patch/msgid/20210812203443.1725307-1-jason@jlekstrand.net Reviewed-by: Christian König Signed-off-by: Christian König commit f28fd3b6f73dd908776145143a63393be3522e54 Author: Linus Walleij Date: Fri Aug 6 11:14:04 2021 +0200 mfd/cpuidle: ux500: Rename driver symbol The PRCMU driver defines this as a DT node but there are no bindings for it and it needs no data from the device tree. Just spawn the device directly in the same way as the watchdog. Name it "db8500-cpuidle" since there are no ambitions to support any more SoCs than this one. This rids this annoying boot message: [ 0.032610] cpuidle-dbx500: Failed to locate of_node [id: 0] However I think the device still spawns and work just fine, despite not finding a device tree node. Cc: Rafael J. Wysocki Cc: linux-pm@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Daniel Lezcano Signed-off-by: Lee Jones commit e19e9f47f341cafcaf41253723f083223a4652a5 Author: Amit Engel Date: Thu Aug 5 18:02:51 2021 +0300 nvmet: check that host sqsize does not exceed ctrl MQES Check that host sqsize is not greater-than Maximum Queue Entries Supported (MQES) value supported by the controller. Signed-off-by: Amit Engel Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit b71df12605cabab47d58bd926badaf4130280e4d Author: Amit Engel Date: Sun Aug 8 18:06:15 2021 +0300 nvmet: avoid duplicate qid in connect cmd According to the NVMe specification, if the host sends a Connect command specifying a queue id which has already been created, a status value of NVME_SC_CMD_SEQ_ERROR is returned. Signed-off-by: Amit Engel Signed-off-by: Christoph Hellwig commit e804d5abe2d74cfe23f5f83be580d1cdc9307111 Author: Amit Engel Date: Sun Aug 8 09:20:14 2021 +0300 nvmet: pass back cntlid on successful completion According to the NVMe specification, the response dword 0 value of the Connect command is based on status code: return cntlid for successful compeltion return IPO and IATTR for connect invalid parameters. Fix a missing error information for a zero sized queue, and return the cntlid also for I/O queue Connect commands. Signed-off-by: Amit Engel Signed-off-by: Christoph Hellwig commit 85032874f80ba17bf187de1d14d9603bf3f582b8 Author: Ruozhu Li Date: Wed Jul 28 17:41:20 2021 +0800 nvme-rdma: don't update queue count when failing to set io queues We update ctrl->queue_count and schedule another reconnect when io queue count is zero.But we will never try to create any io queue in next reco- nnection, because ctrl->queue_count already set to zero.We will end up having an admin-only session in Live state, which is exactly what we try to avoid in the original patch. Update ctrl->queue_count after queue_count zero checking to fix it. Signed-off-by: Ruozhu Li Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 664227fde63844d69e9ec9e90a8a7801e6ff072d Author: Ruozhu Li Date: Sat Aug 7 11:50:23 2021 +0800 nvme-tcp: don't update queue count when failing to set io queues We update ctrl->queue_count and schedule another reconnect when io queue count is zero.But we will never try to create any io queue in next reco- nnection, because ctrl->queue_count already set to zero.We will end up having an admin-only session in Live state, which is exactly what we try to avoid in the original patch. Update ctrl->queue_count after queue_count zero checking to fix it. Signed-off-by: Ruozhu Li Signed-off-by: Christoph Hellwig commit d48f92cd2739258a1292be56bbeadb5b6a57ea09 Author: Keith Busch Date: Fri Aug 6 08:41:43 2021 -0700 nvme-tcp: pair send_mutex init with destroy Each mutex_init() should have a corresponding mutex_destroy(). Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit a5df5e79c43c84d9fb88f56b707c5ff52b27ccca Author: Keith Busch Date: Tue Jul 27 09:40:43 2021 -0700 nvme: allow user toggling hmb usage The NVMe host memory buffer may consume a non-negligable amount of memory. Controllers are required to function without the host memory buffer enabled, but with possibly degraded performance. Export a sysfs property to toggle this feature on a per-device granularity so users may choose to reclaim memory at the expense of storage performance. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e5ad96f388b765fe6b52f64f37e910c0ba4f3de7 Author: Keith Busch Date: Tue Jul 27 09:40:44 2021 -0700 nvme-pci: disable hmb on idle suspend An idle suspend may or may not disable host memory access from devices placed in low power mode. Either way, it should always be safe to disable the host memory buffer prior to entering the low power mode, and this should also always be faster than a full device shutdown. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit ad0e9a80ba0f20db0f86e23d1ad2979513a9a8ee Author: Colin Ian King Date: Tue Jul 6 15:56:50 2021 +0100 nvmet: remove redundant assignments of variable status There are two occurrances where variable status is being assigned a value that is never read and it is being re-assigned a new value almost immediately afterwards on an error exit path. The assignments are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 8d84f9de69ca23f2637dc19d96f39228c8426e97 Author: Hou Pu Date: Mon Jul 5 11:15:29 2021 +0800 nvmet: add set feature tracing support A nvme connect command produces following trace from the target side. Before: kworker/0:1H-56 [000] .... 9012.155139: nvmet_req_init: nvmet1: qid=0, cmdid=16, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, cdw10=07 00 00 00 07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00) kworker/0:1H-56 [000] .... 9012.872272: nvmet_req_init: nvmet1: qid=0, cmdid=13, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, cdw10=0b 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00) cmdline:/sys/kernel/debug/tracing# cat trace | grep feature kworker/0:1H-56 [000] .... 203.493914: nvmet_req_init: nvmet1: qid=0, cmdid=29, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, fid=0x7, sv=0x0, cdw11=0x70007) kworker/0:1H-56 [000] .... 204.197079: nvmet_req_init: nvmet1: qid=0, cmdid=29, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, fid=0xb, sv=0x0, cdw11=0x900) Using ',' to separate different field like others in nvmet_trace_admin_get_features. Signed-off-by: Hou Pu Signed-off-by: Christoph Hellwig commit a7b5e8d864b356fdacfea08d9042261c37bc918e Author: Hou Pu Date: Mon Jul 5 11:15:28 2021 +0800 nvme: add set feature tracing support A nvme connect command produces following trace. Before: /sys/kernel/debug/tracing# cat trace | grep feature kworker/5:1H-98 [005] .... 3221.294844: nvme_setup_cmd: nvme0: qid=0, cmdid=25, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features cdw10=07 00 00 00 07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00) kworker/4:1H-124 [004] .... 3222.009186: nvme_setup_cmd: nvme0: qid=0, cmdid=17, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features cdw10=0b 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00) After: /sys/kernel/debug/tracing# cat trace | grep feature kworker/0:1H-253 [000] .... 196.060509: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0x7, sv=0x0, cdw11=0x70007) kworker/0:1H-253 [000] .... 196.763947: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0xb, sv=0x0, cdw11=0x900) Using ',' to separate different field like others in nvmet_trace_admin_get_features. Signed-off-by: Hou Pu Signed-off-by: Christoph Hellwig commit e23439e977ed2b247912c2b5c6945ef1bc380100 Author: Hou Pu Date: Fri Jul 9 10:32:47 2021 +0800 nvme-fabrics: remove superfluous nvmf_host_put in nvmf_parse_options Opts->host is NULL there. It is checked just before. So remove nvmf_host_put. It is introduced by commit 59a2f3f00fd7 ("nvme: fix potential memory leak in option parsing"). Signed-off-by: Hou Pu Signed-off-by: Christoph Hellwig commit 1751e97aa940656b5de0e620f02cf193a275e014 Author: Keith Busch Date: Fri Jul 16 09:22:49 2021 +0200 nvme-pci: cmb sysfs: one file, one value An attribute should only be exporting one value as recommended in Documentation/filesystems/sysfs.rst. Implement CMB attributes this way. The old attribute will remain for backward compatibility. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 0521905e859fd1a07949cb18efb20cdd4aab3b20 Author: Keith Busch Date: Wed Jul 14 14:02:37 2021 -0700 nvme-pci: use attribute group for cmb sysfs Appending sysfs files to the controller kobject is a bit clunky and becomes a maintenance problem as more attributes are added. The attribute group infrastructure handles this better, so use that. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit e7006de6c23803799be000a5dcce4d916a36541a Author: Sagi Grimberg Date: Wed Jun 16 14:19:36 2021 -0700 nvme: code command_id with a genctr for use-after-free validation We cannot detect a (perhaps buggy) controller that is sending us a completion for a request that was already completed (for example sending a completion twice), this phenomenon was seen in the wild a few times. So to protect against this, we use the upper 4 msbits of the nvme sqe command_id to use as a 4-bit generation counter and verify it matches the existing request generation that is incrementing on every execution. The 16-bit command_id structure now is constructed by: | xxxx | xxxxxxxxxxxx | gen request tag This means that we are giving up some possible queue depth as 12 bits allow for a maximum queue depth of 4095 instead of 65536, however we never create such long queues anyways so no real harm done. Suggested-by: Keith Busch Signed-off-by: Sagi Grimberg Acked-by: Keith Busch Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Tested-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 3b01a9d0caa8276d9ce314e09610f7fb70f49a00 Author: Sagi Grimberg Date: Wed Jun 16 14:19:35 2021 -0700 nvme-tcp: don't check blk_mq_tag_to_rq when receiving pdu data We already validate it when receiving the c2hdata pdu header and this is not changing so this is a redundant check. Reviewed-by: Hannes Reinecke Signed-off-by: Sagi Grimberg Reviewed-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 27453b45e62da8656739f7e1365ea9318e7b040e Author: Sagi Grimberg Date: Wed Jun 16 14:19:34 2021 -0700 nvme-pci: limit maximum queue depth to 4095 We are going to use the upper 4-bits of the command_id for a generation counter, so enforce the new queue depth upper limit. As we enforce both min and max queue depth, use param_set_uint_minmax istead of open coding it. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 2a14c9ae15a38148484a128b84bff7e9ffd90d68 Author: Sagi Grimberg Date: Wed Jun 16 14:19:33 2021 -0700 params: lift param_set_uint_minmax to common code It is a useful helper hence move it to common code so others can enjoy it. Suggested-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 72b89b9ab58fae01f2deea30e0ff4d2349021506 Author: Emil Renner Berthing Date: Tue Jul 27 11:25:54 2021 +0200 mfd: tps65086: Add cell entry for reset driver The only way to reset the BeagleV Starlight v0.9 board[1] properly is to tell the PMIC to reset itself which will then assert the external reset lines of the SoC, USB hub and ethernet phy. This adds an mfd cell entry for the reset driver doing just that. [1] https://github.com/beagleboard/beaglev-starlight Signed-off-by: Emil Renner Berthing Signed-off-by: Lee Jones commit e06f4abb1b79b31b712dc865f8ffc0e20ef2c416 Author: Emil Renner Berthing Date: Tue Jul 27 11:25:52 2021 +0200 mfd: tps65086: Make interrupt line optional The BeagleV Starlight v0.9 board[1] doesn't have the IRQB line routed to the SoC, but it is still useful to be able to reach the PMIC over I2C for the other functionality it provides such as GPIOs and regulator settings. [1] https://github.com/beagleboard/beaglev-starlight Signed-off-by: Emil Renner Berthing Acked-by: Rob Herring Signed-off-by: Lee Jones commit 68f0ba70ded62fa0d678922386ae82c689a737a4 Author: Emil Renner Berthing Date: Tue Jul 27 11:25:51 2021 +0200 dt-bindings: mfd: Convert tps65086.txt to YAML This converts the tps65086.txt binding description to YAML schema so dts files can be verified automatically. Signed-off-by: Emil Renner Berthing Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit cee964a15ff7d3886d7c641b0c118077f402e7cf Author: Lukas Bulwahn Date: Tue Aug 10 21:17:24 2021 +0200 MAINTAINERS: Adjust ARM/NOMADIK/Ux500 ARCHITECTURES to file renaming Commit 8f00b3c41ae7 ("mfd: db8500-prcmu: Rename register header") renames dbx500-prcmu-regs.h to db8500-prcmu-regs.h in drivers/mfd/ but misses to adjust the ARM/NOMADIK/Ux500 ARCHITECTURES section in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: drivers/mfd/dbx500* Remove the obsolete file entry after this file renaming. Signed-off-by: Lukas Bulwahn Signed-off-by: Lee Jones commit 356b94a32a75203616e5a7c3cd2b19101bc87086 Author: Aakash Hemadri Date: Sun Aug 15 01:42:19 2021 +0530 ASoC: tegra30: i2s: Use of_device_get_match_data Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri Acked-by: Thierry Reding Link: https://lore.kernel.org/r/f4e632e0023d90c43b2b927e752585142a9d9c26.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown commit 80165bb8043391f4ef4916bde947a4d805a54aa6 Author: Aakash Hemadri Date: Sun Aug 15 01:42:18 2021 +0530 ASoC: tegra30: ahub: Use of_device_get_match_data Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri Acked-by: Thierry Reding Link: https://lore.kernel.org/r/e568d621c9c05ee23732a6a6f9e3606a780b1707.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown commit 834a36ddc6d276fce177fde6c994751aa40d498f Author: Kuninori Morimoto Date: Mon Aug 16 13:56:23 2021 +0900 ASoC: soc-ac97: cleanup cppcheck warning This patch cleanups below cppcheck warning. sound/soc/soc-ac97.c:41:15: style: struct member 'snd_ac97_gpio_priv::gpios_set' is never used. [unusedStructMember] unsigned int gpios_set; ^ sound/soc/soc-ac97.c:42:28: style: struct member 'snd_ac97_gpio_priv::component' is never used. [unusedStructMember] struct snd_soc_component *component; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r1euyolk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 500b39da62499721ffd287994322a36440d1bb9c Author: Kuninori Morimoto Date: Mon Aug 16 13:56:19 2021 +0900 ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() This patch cleanups below cppcheck warning. sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfzayolo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c7577906865c5da232c1eeabaa80129f4702290d Author: Kuninori Morimoto Date: Mon Aug 16 13:56:15 2021 +0900 ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:21:6: style: struct member 'jack_gpio_tbl::count' is never used. [unusedStructMember] int count; ^ sound/soc/soc-jack.c:23:28: style: struct member 'jack_gpio_tbl::gpios' is never used. [unusedStructMember] struct snd_soc_jack_gpio *gpios; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tujqyols.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c2dea1fba206b6e16940fb2bbf5209b30018833c Author: Kuninori Morimoto Date: Mon Aug 16 13:56:10 2021 +0900 ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report() This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:45:6: style: The scope of the variable 'enable' can be reduced. [variableScope] int enable; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87v946yolx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 454a7422fa287d38fbc433260932383ed70b8af0 Author: Kuninori Morimoto Date: Mon Aug 16 13:56:06 2021 +0900 ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new() This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:553:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int i, ret = 0; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wnomyom1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d490f4e73e3c0b217242d92a8f679e62dc657001 Author: Kuninori Morimoto Date: Mon Aug 16 13:56:01 2021 +0900 ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities() This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:454:7: style: The scope of the variable 'supported_cpu' can be reduced. [variableScope] bool supported_cpu; ^ sound/soc/soc-dai.c:455:7: style: The scope of the variable 'supported_codec' can be reduced. [variableScope] bool supported_codec; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y292yom6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a2659768893bd90be4a243472e8bd2ef614c9de7 Author: Kuninori Morimoto Date: Mon Aug 16 13:55:56 2021 +0900 ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user() This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:310:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zgtiyomb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9cec66fa702646b83ed970a91edd712d156c380f Author: Kuninori Morimoto Date: Mon Aug 16 13:55:51 2021 +0900 ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new() This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:233:28: style: The scope of the variable 'substream' can be reduced. [variableScope] struct snd_pcm_substream *substream; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871r6u0yzs.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0a1e5ac50de2185d6e50b0d09fbed3ef06950d90 Author: Kuninori Morimoto Date: Mon Aug 16 13:55:44 2021 +0900 ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params() This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:82:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8735ra0yzz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ed14666c3f877c4c2a428a92bfeebfba3a4cfe2e Author: Nathan Rossi Date: Mon Aug 16 05:02:28 2021 +0000 spi: orion: Prevent incorrect chip select behaviour When clearing the chip-select mask, the controller will switch to chip selecting the native CS0 line. Because the control register chip-select mask is not updated in a single write this will cause undesirable chip-selection of CS0 even when requesting to select other native chip-select lines. This is additionally problematic as the chip-select may still be asserted. With the ARMADA 38x SoC the controller will assert both the desired native chip-select and CS0. To avoid any undesirable behaviour with the chip-select lines, update the control register with a single write. This avoids selecting CS0 and causes the (de-)assert to apply at the same time. Signed-off-by: Nathan Rossi Link: https://lore.kernel.org/r/20210816050228.3223661-1-nathan@nathanrossi.com Signed-off-by: Mark Brown commit 9c425fa3f273d63539533b14940d08582edd427c Author: Krzysztof Kozlowski Date: Mon Aug 16 10:27:16 2021 +0200 dt-bindings: power: supply: max17042: describe interrupt The Maxim 17042-family of fuel gauges are often embedded in other Maxim chips, e.g. in Maxim 77693 which is a companion power management IC. In such designs there might be actually two interrupts: - INTB signaling change from charger, flash or MUIC, - ALERT signaling change from fuel gauge. Describe the interrupt in bindings to make it clear it is about the fuel gauge ALERT interrupt, not the INT. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 22b6907caf1191f54dd0f4568414076ab479b7d3 Author: Krzysztof Kozlowski Date: Mon Aug 16 10:27:15 2021 +0200 power: supply: max17042: remove duplicated STATUS bit defines All bits of STATUS register are already defined (see STATUS_SMN_BIT and further) so there is no need to define status SoC threshold min/max values one more time. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 54784ffa5b267f57161eb8fbb811499f22a0a0bf Author: Krzysztof Kozlowski Date: Mon Aug 16 10:27:14 2021 +0200 power: supply: max17042: handle fails of reading status register Reading status register can fail in the interrupt handler. In such case, the regmap_read() will not store anything useful under passed 'val' variable and random stack value will be used to determine type of interrupt. Handle the regmap_read() failure to avoid handling interrupt type and triggering changed power supply event based on random stack value. Fixes: 39e7213edc4f ("max17042_battery: Support regmap to access device's registers") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 23a44b77e03f577e93ad1b0ce203bd15e99285f5 Merge: 022522aca4303 af9bf70154eb5 Author: David S. Miller Date: Mon Aug 16 11:36:04 2021 +0100 Merge branch 'stmmac-per-queue-stats' Vijayakannan Ayyathurai says: ==================== net: stmmac: Add ethtool per-queue statistic Adding generic ethtool per-queue statistic framework to display the statistics for each rx/tx queue. In future, users can avail it to add more per-queue specific counters. Number of rx/tx queues displayed is depending on the available rx/tx queues in that particular MAC config and this number is limited up to the MTL_MAX_{RX|TX}_QUEUES defined in the driver. Ethtool per-queue statistic display will look like below, when users start adding more counters. Example - 1: q0_tx_statA: q0_tx_statB: q0_tx_statC: | q0_tx_statX: . . . qMAX_tx_statA: qMAX_tx_statB: qMAX_tx_statC: | qMAX_tx_statX: q0_rx_statA: q0_rx_statB: q0_rx_statC: | q0_rx_statX: . . . qMAX_rx_statA: qMAX_rx_statB: qMAX_rx_statC: | qMAX_rx_statX: Example - 2: Ping test using the tx queue 3. $ tc qdisc add dev enp0s30f4 root mqprio num_tc 2 map 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 queues 3@0 1@3 hw 0 Statistic before ping: --------------------- $ ethtool -S enp0s30f4 [ snip ] q3_tx_pkt_n: 7916 q3_tx_irq_n: 316 [ snip ] $ cat /proc/interrupts [ snip ] 143: 0 0 0 316 0 0 0 0 IR-PCI-MSI 499719-edge enp0s30f4:tx-3 [ snip ] $ ping -I enp0s30f4 192.168.1.10 -i 0.01 -c 100 > /dev/null Statistic after ping: --------------------- $ ethtool -S enp0s30f4 [ snip ] q3_tx_pkt_n: 8016 q3_tx_irq_n: 320 [ snip ] $ cat /proc/interrupts [ snip ] 143: 0 0 0 320 0 0 0 0 IR-PCI-MSI 499719-edge enp0s30f4:tx-3 [ snip ] ==================== Signed-off-by: David S. Miller commit af9bf70154eb5ad36d638eb3ab7aa1f834673b3a Author: Vijayakannan Ayyathurai Date: Mon Aug 16 14:16:00 2021 +0800 net: stmmac: add ethtool per-queue irq statistic support Adding ethtool per-queue statistics support to show number of interrupts generated at DMA tx and DMA rx. All the counters are incremented at dwmac4_dma_interrupt function. Signed-off-by: Vijayakannan Ayyathurai Signed-off-by: David S. Miller commit 68e9c5dee1cf9f5651a894a151d72b7fc21172d3 Author: Vijayakannan Ayyathurai Date: Mon Aug 16 14:15:59 2021 +0800 net: stmmac: add ethtool per-queue statistic framework Adding generic ethtool per-queue statistic framework to display the statistics for each rx/tx queue. In future, users can avail it to add more per-queue specific counters. Number of rx/tx queues displayed is depending on the available rx/tx queues in that particular MAC config and this number is limited up to the MTL_MAX_{RX|TX}_QUEUES defined in the driver. Ethtool per-queue statistic display will look like below, when users start adding more counters. Example: q0_tx_statA: q0_tx_statB: q0_tx_statC: | q0_tx_statX: . . . qMAX_tx_statA: qMAX_tx_statB: qMAX_tx_statC: | qMAX_tx_statX: q0_rx_statA: q0_rx_statB: q0_rx_statC: | q0_rx_statX: . . . qMAX_rx_statA: qMAX_rx_statB: qMAX_rx_statC: | qMAX_rx_statX: In addition, this patch has the support on displaying the number of packets received and transmitted per queue. Signed-off-by: Vijayakannan Ayyathurai Signed-off-by: David S. Miller commit 1975df880b959e30f28d66148a12d77b458abd76 Author: Voon Weifeng Date: Mon Aug 16 14:15:58 2021 +0800 net: stmmac: fix INTR TBU status affecting irq count statistic DMA channel status "Transmit buffer unavailable(TBU)" bit is not considered as a successful dma tx. Hence, it should not affect all the irq count statistic. Fixes: 1103d3a5531c ("net: stmmac: dwmac4: Also use TBU interrupt to clean TX path") Signed-off-by: Voon Weifeng Signed-off-by: Vijayakannan Ayyathurai Signed-off-by: David S. Miller commit 022522aca43037ace6d58e76c198ecf0ed425c9f Author: Vladimir Oltean Date: Sun Aug 15 15:00:35 2021 +0300 net: dsa: sja1105: reorganize probe, remove, setup and teardown ordering The sja1105 driver's initialization and teardown sequence is a chaotic mess that has gathered a lot of cruft over time. It works because there is no strict dependency between the functions, but it could be improved. The basic principle that teardown should be the exact reverse of setup is obviously not held. We have initialization steps (sja1105_tas_setup, sja1105_flower_setup) in the probe method that are torn down in the DSA .teardown method instead of driver unbind time. We also have code after the dsa_register_switch() call, which implicitly means after the .setup() method has finished, which is pretty unusual. Also, sja1105_teardown() has calls set up in a different order than the error path of sja1105_setup(): see the reversed ordering between sja1105_ptp_clock_unregister and sja1105_mdiobus_unregister. Also, sja1105_static_config_load() is called towards the end of sja1105_setup(), but sja1105_static_config_free() is also towards the end of the error path and teardown path. The static_config_load() call should be earlier. Also, making and breaking the connections between struct sja1105_port and struct dsa_port could be refactored into dedicated functions, makes the code easier to follow. We move some code from the DSA .setup() method into the probe method, like the device tree parsing, and we move some code from the probe method into the DSA .setup() method to be symmetric with its placement in the DSA .teardown() method, which is nice because the unbind function has a single call to dsa_unregister_switch(). Example of the latter type of code movement are the connections between ports mentioned above, they are now in the .setup() method. Finally, due to fact that the kthread_init_worker() call is no longer in sja1105_probe() - located towards the bottom of the file - but in sja1105_setup() - located much higher - there is an inverse ordering with the worker function declaration, sja1105_port_deferred_xmit. To avoid that, the entire sja1105_setup() and sja1105_teardown() functions are moved towards the bottom of the file. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c07c8ffc70d54bd9da444483a5b85ec5900e214b Author: Heiner Kallweit Date: Sun Aug 15 10:26:18 2021 +0200 r8169: rename rtl_csi_access_enable to rtl_set_aspm_entry_latency Rename the function to reflect what it's doing. Also add a description of the register values as kindly provided by Realtek. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 793ee362b0aba2b662d359812941752c13c9060d Merge: e871ee6941842 e6e12df625f23 Author: David S. Miller Date: Mon Aug 16 11:19:34 2021 +0100 Merge branch 'ocelot-phylink' Vladimir Oltean says: ==================== Convert ocelot to phylink The ocelot switchdev and felix dsa drivers are interesting because they target the same class of hardware switches but used in different modes. Colin has an interesting use case where he wants to use a hardware switch supported by the ocelot switchdev driver with the felix dsa driver. So far, the existing hardware revisions were similar between the ocelot and felix drivers, but not completely identical. With identical hardware, it is absurd that the felix driver uses phylink while the ocelot driver uses phylib - this should not be one of the differences between the switchdev and dsa driver, and we could eliminate it. Colin will need the common phylink support in ocelot and felix when adding a phylink_pcs driver for the PCS1G block inside VSC7514, which will make the felix driver work with either the NXP or the Microchip PCS. As usual, Alex, Horatiu, sorry for bugging you, but it would be appreciated if you could give this a quick run on actual VSC7514 hardware (which I don't have) to make sure I'm not introducing any breakage. ==================== Fixes: 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") Signed-off-by: David S. Miller commit e6e12df625f23e8011a804250fc22a0c3c9e2463 Author: Vladimir Oltean Date: Sun Aug 15 04:47:48 2021 +0300 net: mscc: ocelot: convert to phylink The felix DSA driver, which is a wrapper over the same hardware class as ocelot, is integrated with phylink, but ocelot is using the plain PHY library. It makes sense to bring together the two implementations, which is what this patch achieves. This is a large patch and hard to break up, but it does the following: The existing ocelot_adjust_link writes some registers, and felix_phylink_mac_link_up writes some registers, some of them are common, but both functions write to some registers to which the other doesn't. The main reasons for this are: - Felix switches so far have used an NXP PCS so they had no need to write the PCS1G registers that ocelot_adjust_link writes - Felix switches have the MAC fixed at 1G, so some of the MAC speed changes actually break the link and must be avoided. The naming conventions for the functions introduced in this patch are: - vsc7514_phylink_{mac_config,validate} are specific to the Ocelot instantiations and placed in ocelot_net.c which is built only for the ocelot switchdev driver. - ocelot_phylink_mac_link_{up,down} are shared between the ocelot switchdev driver and the felix DSA driver (they are put in the common lib). One by one, the registers written by ocelot_adjust_link are: DEV_MAC_MODE_CFG - felix_phylink_mac_link_up had no need to write this register since its out-of-reset value was fine and did not need changing. The write is moved to the common ocelot_phylink_mac_link_up and on felix it is guarded by a quirk bit that makes the written value identical with the out-of-reset one DEV_PORT_MISC - runtime invariant, was moved to vsc7514_phylink_mac_config PCS1G_MODE_CFG - same as above PCS1G_SD_CFG - same as above PCS1G_CFG - same as above PCS1G_ANEG_CFG - same as above PCS1G_LB_CFG - same as above DEV_MAC_ENA_CFG - both ocelot_adjust_link and ocelot_port_disable touched this. felix_phylink_mac_link_{up,down} also do. We go with what felix does and put it in ocelot_phylink_mac_link_up. DEV_CLOCK_CFG - ocelot_adjust_link and felix_phylink_mac_link_up both write this, but to different values. Move to the common ocelot_phylink_mac_link_up and make sure via the quirk that the old values are preserved for both. ANA_PFC_PFC_CFG - ocelot_adjust_link wrote this, felix_phylink_mac_link_up did not. Runtime invariant, speed does not matter since PFC is disabled via the RX_PFC_ENA bits which are cleared. Move to vsc7514_phylink_mac_config. QSYS_SWITCH_PORT_MODE_PORT_ENA - both ocelot_adjust_link and felix_phylink_mac_link_{up,down} wrote this. Ocelot also wrote this register from ocelot_port_disable. Keep what felix did, move in ocelot_phylink_mac_link_{up,down} and delete ocelot_port_disable. ANA_POL_FLOWC - same as above SYS_MAC_FC_CFG - same as above, except slight behavior change. Whereas ocelot always enabled RX and TX flow control, felix listened to phylink (for the most part, at least - see the 2500base-X comment). The registers which only felix_phylink_mac_link_up wrote are: SYS_PAUSE_CFG_PAUSE_ENA - this is why I am not sure that flow control worked on ocelot. Not it should, since the code is shared with felix where it does. ANA_PORT_PORT_CFG - this is a Frame Analyzer block register, phylink should be the one touching them, deleted. Other changes: - The old phylib registration code was in mscc_ocelot_init_ports. It is hard to work with 2 levels of indentation already in, and with hard to follow teardown logic. The new phylink registration code was moved inside ocelot_probe_port(), right between alloc_etherdev() and register_netdev(). It could not be done before (=> outside of) ocelot_probe_port() because ocelot_probe_port() allocates the struct ocelot_port which we then use to assign ocelot_port->phy_mode to. It is more preferable to me to have all PHY handling logic inside the same function. - On the same topic: struct ocelot_port_private :: serdes is only used in ocelot_port_open to set the SERDES protocol to Ethernet. This is logically a runtime invariant and can be done just once, when the port registers with phylink. We therefore don't even need to keep the serdes reference inside struct ocelot_port_private, or to use the devm variant of of_phy_get(). - Phylink needs a valid phy-mode for phylink_create() to succeed, and the existing device tree bindings in arch/mips/boot/dts/mscc/ocelot_pcb120.dts don't define one for the internal PHY ports. So we patch PHY_INTERFACE_MODE_NA into PHY_INTERFACE_MODE_INTERNAL. - There was a strategically placed: switch (priv->phy_mode) { case PHY_INTERFACE_MODE_NA: continue; which made the code skip the serdes initialization for the internal PHY ports. Frankly that is not all that obvious, so now we explicitly initialize the serdes under an "if" condition and not rely on code jumps, so everything is clearer. - There was a write of OCELOT_SPEED_1000 to DEV_CLOCK_CFG for QSGMII ports. Since that is in fact the default value for the register field DEV_CLOCK_CFG_LINK_SPEED, I can only guess the intention was to clear the adjacent fields, MAC_TX_RST and MAC_RX_RST, aka take the port out of reset, which does match the comment. I don't even want to know why this code is placed there, but if there is indeed an issue that all ports that share a QSGMII lane must all be up, then this logic is already buggy, since mscc_ocelot_init_ports iterates using for_each_available_child_of_node, so nobody prevents the user from putting a 'status = "disabled";' for some QSGMII ports which would break the driver's assumption. In any case, in the eventuality that I'm right, we would have yet another issue if ocelot_phylink_mac_link_down would reset those ports and that would be forbidden, so since the ocelot_adjust_link logic did not do that (maybe for a reason), add another quirk to preserve the old logic. The ocelot driver teardown goes through all ports in one fell swoop. When initialization of one port fails, the ocelot->ports[port] pointer for that is reset to NULL, and teardown is done only for non-NULL ports, so there is no reason to do partial teardowns, let the central mscc_ocelot_release_ports() do its job. Tested bind, unbind, rebind, link up, link down, speed change on mock-up hardware (modified the driver to probe on Felix VSC9959). Also regression tested the felix DSA driver. Could not test the Ocelot specific bits (PCS1G, SERDES, device tree bindings). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 46efe4efb9d1fd05e46574819884a362e6a4d7b2 Author: Vladimir Oltean Date: Sun Aug 15 04:47:47 2021 +0300 net: dsa: felix: stop calling ocelot_port_{enable,disable} ocelot_port_enable touches ANA_PORT_PORT_CFG, which has the following fields: - LOCKED_PORTMOVE_CPU, LEARNDROP, LEARNCPU, LEARNAUTO, RECV_ENA, all of which are written with their hardware default values, also runtime invariants. So it makes no sense to write these during every .ndo_open. - PORTID_VAL: this field has an out-of-reset value of zero for all ports and must be initialized by software. Additionally, the ocelot_setup_logical_port_ids() code path sets up different logical port IDs for the ports in a hardware LAG, and we absolutely don't want .ndo_open to interfere there and reset those values. So in fact the write from ocelot_port_enable can better be moved to ocelot_init_port, and the .ndo_open hook deleted. ocelot_port_disable touches DEV_MAC_ENA_CFG and QSYS_SWITCH_PORT_MODE_PORT_ENA, in an attempt to undo what ocelot_adjust_link did. But since .ndo_stop does not get called each time the link falls (i.e. this isn't a substitute for .phylink_mac_link_down), felix already does better at this by writing those registers already in felix_phylink_mac_link_down. So keep ocelot_port_disable (for now, until ocelot is converted to phylink too), and just delete the felix call to it, which is not necessary. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e871ee6941842d4e52a7d81a9986cb6daf441dae Author: Changbin Du Date: Sat Aug 14 09:03:34 2021 +0800 s390/net: replace in_irq() with in_hardirq() Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Signed-off-by: Changbin Du Signed-off-by: David S. Miller commit b2b8913341119491a13d9b11b073dc3c4f907cb8 Author: Vladimir Oltean Date: Sat Aug 14 02:04:22 2021 +0300 net: dsa: tag_8021q: fix notifiers broadcast when they shouldn't, and vice versa During the development of the blamed patch, the "bool broadcast" argument of dsa_port_tag_8021q_vlan_{add,del} was originally called "bool local", and the meaning was the exact opposite. Due to a rookie mistake where the patch was modified at the last minute without retesting, the instances of dsa_port_tag_8021q_vlan_{add,del} are called with the wrong values. During setup and teardown, cross-chip notifiers should not be broadcast to all DSA trees, while during bridging, they should. Fixes: 724395f4dc95 ("net: dsa: tag_8021q: don't broadcast during setup/teardown") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 944f510176ebdf6b3a71f7cefea334bd3d203de2 Author: Randy Dunlap Date: Fri Aug 13 13:30:26 2021 -0700 ptp: ocp: don't allow on S390 Fix kconfig warning on arch/s390/: WARNING: unmet direct dependencies detected for SERIAL_8250 Depends on [n]: TTY [=y] && HAS_IOMEM [=y] && !S390 [=y] Selected by [m]: - PTP_1588_CLOCK_OCP [=m] && PTP_1588_CLOCK [=m] && HAS_IOMEM [=y] && PCI [=y] && SPI [=y] && I2C [=m] && MTD [=m] Signed-off-by: Randy Dunlap Cc: Richard Cochran Cc: Jonathan Lemon Signed-off-by: David S. Miller commit 19eed721079336d515dd2d8fe1f0f4c292b78c70 Author: Rao Shoaib Date: Fri Aug 13 11:19:34 2021 -0700 af_unix: check socket state when queuing OOB edumazet@google.com pointed out that queue_oob does not check socket state after acquiring the lock. He also pointed to an incorrect usage of kfree_skb and an unnecessary setting of skb length. This patch addresses those issue. Signed-off-by: Rao Shoaib Signed-off-by: David S. Miller commit 6164659ff7acc16f3f37a9278f856fd1fb02a8f9 Author: Song Yoong Siang Date: Fri Aug 13 16:45:08 2021 +0800 net: phy: marvell: Add WAKE_PHY support to WOL event Add Wake-on-PHY feature support by enabling the Link Up Event. Signed-off-by: Song Yoong Siang Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 849d2f83f52ec6ade86a90f29b2c9573f392f22c Author: Wong Vee Khee Date: Fri Aug 13 10:11:29 2021 +0800 net: pcs: xpcs: Add Pause Mode support for SGMII and 2500BaseX SGMII/2500BaseX supports Pause frame as defined in the IEEE802.3x Flow Control standardization. Add this as a supported feature under the xpcs_sgmii_features struct. Cc: Vladimir Oltean Signed-off-by: Wong Vee Khee Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5fa5fb8b3b209ce2efd7f61acb3797028bb15927 Merge: cbbb7abdd00ed 0f0c4f1b72e09 Author: David S. Miller Date: Mon Aug 16 11:02:09 2021 +0100 Merge branch 'pktgen-samples' samples: pktgen: enhance the usability of pktgen samples This patchset improves the usability of pktgen samples by adding an option for propagating the environment variable of normal user to sudo. And also adds the missing IPv6 option to pktgen scripts. Currently, all pktgen samples are able to use the environment variable instead of optional parameters. However, it doesn't work appropriately when running samples as normal user. This is results of running sample as root and user: // running as root # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1 Running... ctrl^C to stop // running as normal user $ DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1 [...] ERROR: Please specify output device The reason why passing the environment varaible doesn't work properly when running samples as normal user is that the environment variable of normal user doesn't propagate to sudo (root_check_run_with_sudo)). So the first commit solves this issue by using "-E" (--preserve-env) option of "sudo", which passes normal user's existing environment variables. Also, "sample04" and "sample05" are not working properly when running with IPv6 option parameter("-6"). Because the commit 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") has omitted the addition of this option at these samples. So the second commit adds missing IPv6 option to pktgen scripts. ==================== Fixes: 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") Signed-off-by: David S. Miller commit 0f0c4f1b72e090b23131700bb155944cc28b2a7b Author: Juhee Kang Date: Fri Aug 13 00:08:13 2021 +0900 samples: pktgen: add missing IPv6 option to pktgen scripts Currently, "sample04" and "sample05" are not working properly when running with an IPv6 option("-6"). The commit 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") has omitted the addition of this option at "sample04" and "sample05". In order to support IPv6 option, this commit adds logic related to IPv6 option. Fixes: 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") Signed-off-by: Juhee Kang Signed-off-by: David S. Miller commit 7caeabd726f22e6a6c44c434574fb489986e5baa Author: Juhee Kang Date: Fri Aug 13 00:08:12 2021 +0900 samples: pktgen: pass the environment variable of normal user to sudo All pktgen samples can use the environment variable instead of option parameters(eg. $DEV is able to use instead of '-i' option). This is results of running sample as root and user: // running as root # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1 Running... ctrl^C to stop // running as normal user $ DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1 [...] ERROR: Please specify output device This results show the sample doesn't work properly when the sample runs as normal user. Because the sample is restarted by the function (root_check_run_with_sudo) to run with sudo. In this process, the environment variable of normal user doesn't propagate to sudo. It can be solved by using "-E"(--preserve-env) option of "sudo", which preserve normal user's existing environment variables. So this commit adds "-E" option in the function (root_check_run_with_sudo). Signed-off-by: Juhee Kang Signed-off-by: David S. Miller commit cbbb7abdd00ed583bec374526967b09d8840e264 Merge: e4637f621203c 2a4c32e767adb Author: David S. Miller Date: Mon Aug 16 10:30:27 2021 +0100 Merge branch 'ipq-mdio' Luo Jie says: ==================== net: mdio: Add IPQ MDIO reset related function This patch series add the MDIO reset features, which includes configuring MDIO clock source frequency and indicating CMN_PLL that ethernet LDO has been ready, this ethernet LDO is dedicated in the IPQ5018 platform. Specify more chipset IPQ40xx, IPQ807x, IPQ60xx and IPQ50xx supported by this MDIO driver. Changes in v3: * simplify the function ipq_mdio_reset. Changes in v2: * Addressed review comments (Andrew Lunn). * Remove the IS_ERR(). * make binding patch part of series. * document the property 'reg' and 'clock'. Changes in v1: * make MDIO_IPQ4019 unchanged for backwards compatibility. * remove the PHY reset functions ==================== Signed-off-by: David S. Miller commit 2a4c32e767adb8041fb41af199759b8c4162f7e2 Author: Luo Jie Date: Thu Aug 12 18:06:42 2021 +0800 dt-bindings: net: Add the properties for ipq4019 MDIO The new added properties resource "reg" is for configuring ethernet LDO in the IPQ5018 chipset, the property "clocks" is for configuring the MDIO clock source frequency. Signed-off-by: Luo Jie Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit c76ee26306b2b6ba66540fc4a49a70f427b07a82 Author: Luo Jie Date: Thu Aug 12 18:06:41 2021 +0800 MDIO: Kconfig: Specify more IPQ chipset supported The IPQ MDIO driver currently supports the chipset IPQ40xx, IPQ807x, IPQ60xx and IPQ50xx. Add the compatible 'qcom,ipq5018-mdio' because of ethernet LDO dedicated to the IPQ5018 platform. Signed-off-by: Luo Jie Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 23a890d493e3ec1e957bc925fabb120962ae90a7 Author: Luo Jie Date: Thu Aug 12 18:06:40 2021 +0800 net: mdio: Add the reset function for IPQ MDIO driver 1. configure the MDIO clock source frequency. 2. the LDO resource is needed to configure the ethernet LDO available for CMN_PLL. Signed-off-by: Luo Jie Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit f33ce7100b6b189362cf9d7a9d7e3333b6ba427a Author: Michael Straube Date: Sat Aug 14 18:55:18 2021 +0200 staging: r8188eu: use common ieee80211 constants Many defined constants in wifi.h are unused and/or available from , some with slightly different names. Remove the constants from wifi.h and use the common ones. Rename where necessary. Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210814165518.8672-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 027ed956b526350d7098e31731fa81c5579c2e68 Author: Michael Straube Date: Sun Aug 15 12:24:06 2021 +0200 staging: r8188eu: remove kernel version depended code paths Remove kernel version depended code paths from the driver. Reported by checkpatch. WARNING: LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged Acked-by: Martin Kaiser Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210815102406.3707-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 099ec97ac92911abfb102bb5c68ed270fc12e0dd Author: Nathan Chancellor Date: Sat Aug 14 16:56:26 2021 -0700 staging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb() clang warns: drivers/staging/rtl8192u/r8192U_core.c:4268:20: warning: bitwise and of boolean expressions; did you mean logical and? [-Wbool-operation-and] bpacket_toself = bpacket_match_bssid & ^~~~~~~~~~~~~~~~~~~~~ && 1 warning generated. Replace the bitwise AND with a logical one to clear up the warning, as that is clearly what was intended. Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210814235625.1780033-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 7c715fbce5d300bb782e2b92afab371bc9b8c697 Author: Fabio M. De Francesco Date: Sat Aug 14 18:08:04 2021 +0200 staging: r8188eu: os_dep: Remove defined but not used variables Remove defined but not used const variables. Issues detected by GCC running with -Wunused-const-variable option enabled. Acked-by: Michael Straube Acked-by: Phillip Potter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210814160804.11634-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 11fc4822f9c08c80c55df2303a8b9c42566b74b8 Author: Michael Straube Date: Sat Aug 14 09:39:20 2021 +0200 staging: r8188eu: remove ODM_GetRightChnlPlaceforIQK() Function ODM_GetRightChnlPlaceforIQK() returns always zero for channels <= 14. The driver is for chips that do not support 5 GHz, so remove the function and replace the usage of its return value with zero. Acked-by: Fabio M. De Francesco Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210814073920.3551-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4adfa836c5289df905af19edc9727fc275dc1a1 Author: Nathan Chancellor Date: Fri Aug 13 13:14:18 2021 -0700 staging: r8188eu: Remove unnecessary ret variable in rtw_drv_init() ret is unnecessary as both error paths set the same error code so just return that directly. Suggested-by: Fabio M. De Francesco Reviewed-by: Fabio M. De Francesco Acked-by: Phillip Potter Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210813201418.4018631-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit b38447035aedef5861732dcbf048a0c226073768 Author: Fabio M. De Francesco Date: Fri Aug 13 18:08:12 2021 +0200 staging: r8188eu: Remove variables and simplify PHY_SwChnl8188E() Remove "bResult" and "tmpchannel" and all tests and assignments that are related to them in the code of PHY_SwChnl8188E(). "bResult" was always true, therefore its test led to a null statement. "tmpchannel" was used only to restore "pHalData->CurrentChannel" to its previous value only if _PHY_SwChnl8192C() was not called; therefore assign "channel" to "pHalData->CurrentChannel" if and only if _PHY_SwChnl8192C() is to be executed (and get rid of that temporary storage). Acked-by: Phillip Potter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210813160812.17603-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 40ba17da86cb9ed6ec1457bd05db77df94d09c96 Author: Michael Straube Date: Fri Aug 13 09:31:09 2021 +0200 staging: r8188eu: rename Hal_GetChnlGroup88E() Rename Hal_GetChnlGroup88E() to avoid camel case. HalGetChnlGroup88E -> hal_get_chnl_group_88e Acked-by: Phillip Potter Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210813073109.25609-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 16fe4b303e226739787ee206437bf42b4caf82fe Author: Michael Straube Date: Fri Aug 13 09:31:08 2021 +0200 staging: r8188eu: rename parameter of Hal_GetChnlGroup88E() Rename parameter of Hal_GetChnlGroup88E() to avoid camel case. pGroup -> group Acked-by: Phillip Potter Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210813073109.25609-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1cb5715d273e931e093804e0d81145c9edf15ace Author: Michael Straube Date: Fri Aug 13 09:31:07 2021 +0200 staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void After the removal of 5GHz code from Hal_GetChnlGroup88E() the function always returns true now. Convert the return type to void and change the only user Hal_ReadTxPowerInfo88E() accordingly. Acked-by: Phillip Potter Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210813073109.25609-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6a78bb5c4f92d1a3a2fa5c6bad56c57b916c6a33 Author: Michael Straube Date: Fri Aug 13 09:31:06 2021 +0200 staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Remove 5GHz code from Hal_GetChnlGroup88E(). Acked-by: Phillip Potter Acked-by: Fabio M. De Francesco Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210813073109.25609-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2dec48c32a349e51920b6a53b464982db4ed1563 Merge: cea45a3bd2dd4 7c60610d47676 Author: Greg Kroah-Hartman Date: Mon Aug 16 09:04:28 2021 +0200 Merge 5.14-rc6 into usb-next We need the USB fix in here as well. Signed-off-by: Greg Kroah-Hartman commit a30514a076cfe4b1962980e946a759f5556cf4a5 Merge: f805ef1ce5d69 7c60610d47676 Author: Greg Kroah-Hartman Date: Mon Aug 16 09:02:59 2021 +0200 Merge 5.14-rc6 into staging-next We need the IIO fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 654933ae7d32f278eecd0bb0f175785574ac4775 Author: Pavel Machek Date: Mon Aug 16 08:47:08 2021 +0200 leds: flash: Remove redundant initialization of variable ret Adjust initialization not to trigger Coverity warnings. Reported-by: Colin Ian King Signed-off-by: Pavel Machek commit 47c258d71ebfc832a760a1dc6540cf3c33968023 Author: Randy Dunlap Date: Sun Aug 15 15:23:34 2021 -0700 powerpc/head_check: use stdout for error messages Prefer stderr instead of stdout for error messages. This is a good practice and can help CI error detecting and reporting (0day in this case). Signed-off-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210815222334.9575-1-rdunlap@infradead.org commit 8b893ef190b0c440877de04f767efca4bf4d6af8 Author: Michael Ellerman Date: Mon Aug 16 12:30:11 2021 +1000 powerpc/pseries: Fix build error when NUMA=n As reported by lkp, if NUMA=n we see a build error: arch/powerpc/platforms/pseries/hotplug-cpu.c: In function 'pseries_cpu_hotplug_init': arch/powerpc/platforms/pseries/hotplug-cpu.c:1022:8: error: 'node_to_cpumask_map' undeclared 1022 | node_to_cpumask_map[node]); Use cpumask_of_node() which has an empty stub for NUMA=n, and when NUMA=y does a lookup from node_to_cpumask_map[]. Fixes: bd1dd4c5f528 ("powerpc/pseries: Prevent free CPU ids being reused on another node") Reported-by: kernel test robot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210816041032.2839343-1-mpe@ellerman.id.au commit 2819cf0e7dbe45a2bccf2f6c60fe6a27b299cc3e Merge: a22c074fd1dd5 c7782443a8892 Author: Dave Airlie Date: Mon Aug 16 12:57:26 2021 +1000 Merge tag 'drm-misc-next-2021-08-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.15: UAPI Changes: Cross-subsystem Changes: - Add lockdep_assert(once) helpers. Core Changes: - Add lockdep assert to drm_is_current_master_locked. - Fix typos in dma-buf documentation. - Mark drm irq midlayer as legacy only. - Fix GPF in udmabuf_create. - Rename member to correct value in drm_edid.h Driver Changes: - Build fix to make nouveau build with NOUVEAU_BACKLIGHT. - Add MI101AIT-ICP1, LTTD800480070-L6WWH-RT panels. - Assorted fixes to bridge/it66121, anx7625. - Add custom crtc_state to simple helpers, and use it to convert pll handling in mgag200 to atomic. - Convert drivers to use offset-adjusted framebuffer bo mappings. - Assorted small fixes and fix for a use-after-free in vmwgfx. - Convert remaining callers of non-legacy drivers to use linux irqs directly. - Small cleanup in ingenic. - Small fixes to virtio and ti-sn65dsi86. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/1cf2d7fc-402d-1852-574a-21cbbd2eaebf@linux.intel.com commit 9b5d85056cc853e1d85beb009627ebb9db253bb5 Author: Tao Ren Date: Thu Aug 12 23:19:00 2021 -0700 ARM: dts: aspeed: cloudripper: Add comments for "mdio1" Add some comments to explain the purpose of "mdio1" controller: it's connected to the MDC/MDIO interface of the on-board management switch. Signed-off-by: Tao Ren Link: https://lore.kernel.org/r/20210813061900.24539-1-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 813e3f1d51fda49c7c9ce8552177968cd63a2af6 Author: Tao Ren Date: Mon Jul 19 17:27:04 2021 -0700 ARM: dts: aspeed: minipack: Update flash partition table Update firmware flash "data0" partition size from 4MB to 8MB for larger persistent storage on minipack BMC. Signed-off-by: Tao Ren Link: https://lore.kernel.org/r/20210720002704.7390-1-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit d484c21bacfa8bd2fa9fc26393ec59108f508c4c Author: Lad Prabhakar Date: Wed Aug 4 21:21:17 2021 +0100 iio: adc: Add driver for Renesas RZ/G2L A/D converter Add ADC driver support for Renesas RZ/G2L A/D converter in SW trigger mode. A/D Converter block is a successive approximation analog-to-digital converter with a 12-bit accuracy and supports a maximum of 8 input channels. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210804202118.25745-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Jonathan Cameron commit 08080963162740abdd8a35f6c3aad0e744f71627 Author: Lad Prabhakar Date: Wed Aug 4 21:21:16 2021 +0100 dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L A/D converter Add binding documentation for Renesas RZ/G2L A/D converter block. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210804202118.25745-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Jonathan Cameron commit ffc6659befd63d810a75ead16904813f48afa5e8 Author: Théo Borém Fabris Date: Mon Aug 9 17:30:14 2021 -0300 iio: pressure: hp03: update device probe to register with devm functions Update device probe to register resources with device-managed functions. Further, get rid of device-specific remove callback which is no longer needed. Signed-off-by: Théo Borém Fabris Link: https://lore.kernel.org/r/20210809203014.10955-1-theobf@usp.br Signed-off-by: Jonathan Cameron commit cabd6e9cf22dc80544c3eb09c4169a05e94a6d3f Author: David Wu Date: Tue Aug 10 09:10:07 2021 +0800 iio: adc: rockchip_saradc: add voltage notifier so get referenced voltage once at probe Add voltage notifier, no need to query regulator voltage for every saradc read, just get regulator voltage once at probe. Signed-off-by: David Wu Signed-off-by: Simon Xue Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210810011007.54066-1-xxm@rock-chips.com Signed-off-by: Jonathan Cameron commit b76d26d69ecc97ebb24aaf40427a13c808a4f488 Author: Nuno Sá Date: Wed Aug 11 15:32:20 2021 +0200 iio: ltc2983: fix device probe There is no reason to assume that the IRQ rising edge (indicating that the device start up phase is done) will happen after we request the IRQ. If the device is already up by the time we request it, the call to 'wait_for_completion_timeout()' will timeout and we will fail the device probe even though there's nothing wrong. Fix it by just polling the status register until we get the indication that the device is up and running. As a side effect of this fix, requesting the IRQ is also moved to after the setup function. Fixes: f110f3188e563 ("iio: temperature: Add support for LTC2983") Reported-and-tested-by: Drew Fustini Reviewed-by: Drew Fustini Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Cc: Link: https://lore.kernel.org/r/20210811133220.190264-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 2de207f5ff06db032c03310bde89e60079c88fff Author: Mauro Carvalho Chehab Date: Tue Aug 3 06:38:55 2021 +0200 dt-bindings: PCI: kirin: Fix compatible string The pcie-kirin driver doesn't declare a hisilicon,kirin-pcie. Also, remove the useless comment after the description, as other compat will be supported by the same driver in the future. Acked-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3e3e29a88f8e71eb228edf33d70cbe70db431408.1627965261.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 39c6b3a3dd118173c6da32daacd2eed8cfc5951d Author: Geert Uytterhoeven Date: Wed Aug 11 10:53:37 2021 +0200 of: fdt: Remove weak early_init_dt_mark_hotplug_memory_arch() Commit 41a9ada3e6b4253f ("of/fdt: mark hotpluggable memory") introduced two (for systems with and without memblock) weak versions of early_init_dt_mark_hotplug_memory_arch(), that could be overridden by an architecture-specific version. However, no overrides ever emerged. Later, commit aca52c3983891060 ("mm: remove CONFIG_HAVE_MEMBLOCK") removed the non-memblock version. Remove early_init_dt_mark_hotplug_memory_arch(), and replace it by a direct call to memblock_mark_hotplug(). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1a61f75ec50d3c2922fcdbe33337266a58a4125f.1628671960.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 18250b43f7b6d0085724bf6fc186f9a107066068 Author: Geert Uytterhoeven Date: Wed Aug 11 10:52:28 2021 +0200 of: fdt: Remove early_init_dt_reserve_memory_arch() override capability Commit e7ae8d174eec0b3b ("MIPS: replace add_memory_region with memblock") removed the last architecture-specific override of early_init_dt_reserve_memory_arch(). Convert the common implementation from a weak global function to a static function. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/be0140a0183ecfd0a3afa4fe6d2d77ed418102f9.1628671897.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit d03a74bfaccefcf271bf8e889c31229aa521cd66 Author: Mugilraj Dhavachelvan Date: Sat Aug 14 23:25:40 2021 +0530 iio: potentiometer: Add driver support for AD5110 The AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf Signed-off-by: Mugilraj Dhavachelvan Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210814175607.48399-3-dmugil2000@gmail.com Signed-off-by: Jonathan Cameron commit 88b6509b8d8de47c481a360c7a454b294f02d372 Author: Mugilraj Dhavachelvan Date: Sat Aug 14 23:25:39 2021 +0530 dt-bindings: iio: potentiometer: Add AD5110 in trivial-devices Add AD5110, a Nonvolatile Digital Potentiometer into trivial-devices.yaml. Acked-by: Rob Herring Signed-off-by: Mugilraj Dhavachelvan Link: https://lore.kernel.org/r/20210814175607.48399-2-dmugil2000@gmail.com Signed-off-by: Jonathan Cameron commit fa183a86eefd47188054974e67dff2b8e9012aba Merge: d1bf7c4d5deae ce547335d4a42 Author: Andrii Nakryiko Date: Sun Aug 15 00:13:33 2021 -0700 Merge branch 'BPF iterator for UNIX domain socket.' Kuniyuki Iwashima says: ==================== This patch set adds BPF iterator support for UNIX domain socket. The first patch implements it, and the second adds "%c" support for BPF_SEQ_PRINTF(). Thanks to Yonghong Song for the fix [0] for the LLVM code gen. The fix prevents the LLVM compiler from transforming the loop exit condition '<' to '!=', where the upper bound is not a constant. The transformation leads the verifier to interpret it as an infinite loop. And thanks to Andrii Nakryiko for its workaround [1]. [0] https://reviews.llvm.org/D107483 [1] https://lore.kernel.org/netdev/CAEf4BzZ3sVx1m1mOCcPcuVPiY6cWEAO=6VGHDiXEs9ZVD-RoLg@mail.gmail.com/ Changelog: v6: - Align the header "Inde" column - Change int vars to __u64 not to break test_progs-no_alu32 - Move the if statement into the for loop not to depend on the fix [0] - Drop the README change - Modify "%c" positive test patterns v5: https://lore.kernel.org/netdev/20210812164557.79046-1-kuniyu@amazon.co.jp/ - Align header line of bpf_iter_unix.c - Add test for "%c" v4: https://lore.kernel.org/netdev/20210810092807.13190-1-kuniyu@amazon.co.jp/ - Check IS_BUILTIN(CONFIG_UNIX) - Support "%c" in BPF_SEQ_PRINTF() - Uncomment the code to print the name of the abstract socket - Mention the LLVM fix in README.rst - Remove the 'aligned' attribute in bpf_iter.h - Keep the format string on a single line v3: https://lore.kernel.org/netdev/20210804070851.97834-1-kuniyu@amazon.co.jp/ - Export some functions for CONFIG_UNIX=m v2: https://lore.kernel.org/netdev/20210803011110.21205-1-kuniyu@amazon.co.jp/ - Implement bpf_iter specific seq_ops->stop() - Add bpf_iter__unix in bpf_iter.h - Move common definitions in selftest to bpf_tracing_net.h - Include the code for abstract UNIX domain socket as comment in selftest - Use ASSERT_OK_PTR() instead of CHECK() - Make ternary operators on single line v1: https://lore.kernel.org/netdev/20210729233645.4869-1-kuniyu@amazon.co.jp/ ==================== Signed-off-by: Andrii Nakryiko commit ce547335d4a42e645320402b24aeadb39531f73c Author: Kuniyuki Iwashima Date: Sat Aug 14 10:57:18 2021 +0900 selftest/bpf: Extend the bpf_snprintf() test for "%c". This patch adds various "positive" patterns for "%c" and two "negative" patterns for wide character. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210814015718.42704-5-kuniyu@amazon.co.jp commit 04e928180c14332fb15a1b8c64418b602978a51e Author: Kuniyuki Iwashima Date: Sat Aug 14 10:57:17 2021 +0900 selftest/bpf: Implement sample UNIX domain socket iterator program. The iterator can output almost the same result compared to /proc/net/unix. The header line is aligned, and the Inode column uses "%8lu" because "%5lu" can be easily overflown. # cat /sys/fs/bpf/unix Num RefCount Protocol Flags Type St Inode Path ffff963c06689800: 00000002 00000000 00010000 0001 01 18697 private/defer ffff963c7c979c00: 00000002 00000000 00000000 0001 01 598245 @Hello@World@ # cat /proc/net/unix Num RefCount Protocol Flags Type St Inode Path ffff963c06689800: 00000002 00000000 00010000 0001 01 18697 private/defer ffff963c7c979c00: 00000002 00000000 00000000 0001 01 598245 @Hello@World@ Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210814015718.42704-4-kuniyu@amazon.co.jp commit 3478cfcfcddff0f3aad82891be2992e51c4f7936 Author: Kuniyuki Iwashima Date: Sat Aug 14 10:57:16 2021 +0900 bpf: Support "%c" in bpf_bprintf_prepare(). /proc/net/unix uses "%c" to print a single-byte character to escape '\0' in the name of the abstract UNIX domain socket. The following selftest uses it, so this patch adds support for "%c". Note that it does not support wide character ("%lc" and "%llc") for simplicity. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210814015718.42704-3-kuniyu@amazon.co.jp commit 2c860a43dd77f969bb959336a2f743d7103a8f63 Author: Kuniyuki Iwashima Date: Sat Aug 14 10:57:15 2021 +0900 bpf: af_unix: Implement BPF iterator for UNIX domain socket. This patch implements the BPF iterator for the UNIX domain socket. Currently, the batch optimisation introduced for the TCP iterator in the commit 04c7820b776f ("bpf: tcp: Bpf iter batching and lock_sock") is not used for the UNIX domain socket. It will require replacing the big lock for the hash table with small locks for each hash list not to block other processes. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210814015718.42704-2-kuniyu@amazon.co.jp commit d1bf7c4d5deae6685a42463f4d29418fd2515d05 Author: Muhammad Falak R Wani Date: Sun Aug 15 12:20:13 2021 +0530 samples/bpf: Define MAX_ENTRIES instead of a magic number in offwaketime Define MAX_ENTRIES instead of using 10000 as a magic number in various places. Signed-off-by: Muhammad Falak R Wani Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210815065013.15411-1-falakreyaz@gmail.com commit f805ef1ce5d695c260986fdf2e28f5d6c98cf3a8 Merge: 0bd35146642bd 94a853eca720a Author: Greg Kroah-Hartman Date: Sun Aug 15 08:32:07 2021 +0200 Merge tag 'iio-for-5.15a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of new IIO and counter device support, cleanups and features for 5.15 Usual mix of cleanups and new device support. Counter ====== Cleanups and refactoring: * treewide - Ensure attempts to set invalid modes result in -EINVAL return. - Rename counter_count_function to counter_function as the middle count is redundant. - Standardize error returns when limits are exceeded. * 104-quad: - Document the lock. - Return an error if attempt to set the ceiling value in a mode that doesn't support it. * intel-qep - Drop unused bitops.h include IIO === New device support * bma255 - Add support fo the bosch,bmc156_accel which oddly only exposes the INT2 interrupt pin and not INT1. Patch set includes enabling use of INT2. * ingenic_adc - Add support for JZ4760 and similar and update bindings - Add support for JZ4760B and update bindings * rockchip_saradc - Add support for rk3568 ADC (separate channel array as more channels) * sgp40 gas sensor used to measure air quality - New driver including binding and ABI documentation. Bindings -------- * Add missing bindings for many DACs where the binding was effectively implicit due to fallback probe methods in I2C and SPI. adi,ad5064 adi,ad5360 adi,ad5380 adi,ad5421 adi,ad5449 adi,ad5504 adi,ad5624r adi,ad5686 / adi,ad5696 adi,ad5761 adi,ad5764 adi,ad5791 adi,ad8801 capella,cm3323 (also add explicit of_device_id table) microchip,mcp4922 * bosch,bma255 - Interrupt type in example was opposite of what the device expects. It's possible that a particular board had an inverter, but we definitely don't want the example to suggest this would be normal. - Add interrupt-names to allow for cases where only INT2 is connected. - Sort compatibles - Merge in very similar bosch,bma180 binding. New feature ----------- * Devices only allowed to provide either extended_name or a label for given channel. If extend_name is used (generally discouraged but can't be removed as it would be a userspaece ABI change), then the label sysfs attribute will provide the extended_name. This allows some userspace parser simplications and hardening. * hid-sensors-pres - Add a timestamp channel (either from hardware, or locally filled). * vcnl3020 - Add periodic sensor mode used to provide IIO events. Cleanups / minor fixes ---------------------- * core/buffers - Avoid unnecessary zeroing of bitmaps that are immediately overwritten. - Move a sanity check earlier to simplify error path. * Quite a few cases of refactors to use devm_* for all of probe and drop remove - adjd_s311 - adxl345 - bma220 - da280 - dmard10 - ds311 - max5481 - max5821 - rfd77402 - tcs3414 - tmp006 * ad5624r - Fix incorrect handling of a regulator that was preventing use of internal regulators. * adjd_s311 - Allocate a buffer as part of iio_priv() structure as maximum size is small enough, no significant advantage in making it flexible sized. * bma220 - Make handling of suspend and resume closer to the probe() wrt to the rather odd interface, that suspend mode is entered by reading a register. * ep93xx - Prepare clock before using (part of conversion to CCF) * fsl-imx25-gcq - Use local device pointer. - Adjust handling of platform_get_irq() to not check for 0 as an error. The function is documented as never returning it. * hid-sensors - Use devm_kmemdup() consistently across all drivers to simplify channel structure allocation management. * meson-saradc - Drop BL30 integration on G12A and newer SoCs as not used. - Whitespace fixes. * mpu6050 - Add per device type startup times. This avoids an issue with having to dsicard initial data from gyroscopes when they were still stabilizing. * rfd77402 - Change from passing private data, to passing i2c_client where only that is needed, reducing back and forth in pm functions. * si1145 - Drop pointless continue * st-sensors - Cleanup of includes to remove unused and add missing headers that are used. - Use some devm functions to simplify probe() and remove() - gets us part way towards a fully device managed driver. * sx9310 - Switch from of to generic properties to enable ACPI bindings. * vcnl3020 - Add DMA safe buffer for bulk transfers. - Drop use of iio_claim_direct() in a driver that has no mode changes. A local lock is more appropriate. * tag 'iio-for-5.15a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (77 commits) counter: 104-quad-8: Describe member 'lock' in 'quad8' iio: hid-sensor-press: Add timestamp channel counter: Rename counter_count_function to counter_function counter: Rename counter_signal_value to counter_signal_level counter: Standardize to ERANGE for limit exceeded errors counter: Return error code on invalid modes counter: 104-quad-8: Return error when invalid mode during ceiling_write iio: accel: bmc150: Add support for BMC156 iio: accel: bmc150: Make it possible to configure INT2 instead of INT1 dt-bindings: iio: accel: bma255: Add bosch,bmc156_accel dt-bindings: iio: accel: bma255: Add interrupt-names iio: light: cm3323: Add of_device_id table dt-bindings: Add bindings for Capella cm3323 Ambient Light Sensor iio: chemical: Add driver support for sgp40 dt-bindings: iio: chemical: Add trivial DT binding for sgp40 iio: ep93xx: Prepare clock before using it iio: adc: fsl-imx25-gcq: adjust irq check to match docs and simplify code iio: dac: max5821: convert device register to device managed function dt-bindings: iio/adc: ingenic: add the JZ4760(B) socs to the sadc Documentation iio/adc: ingenic: add JZ4760B support to the sadc driver ... commit 0355785313e2191be4e1108cdbda94ddb0238c48 Author: Fangrui Song Date: Fri Aug 13 13:05:11 2021 -0700 powerpc: Add "-z notext" flag to disable diagnostic Object files used to link .tmp_vmlinux.kallsyms1 have many R_PPC64_ADDR64 relocations in non-SHF_WRITE sections. There are many text relocations (e.g. in .rela___ksymtab_gpl+* and .rela__mcount_loc sections) in a -pie link and are disallowed by LLD: ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in arch/powerpc/kernel/head_64.o >>> referenced by arch/powerpc/kernel/head_64.o:(__restart_table+0x10) Newer GNU ld configured with "--enable-textrel-check=error" will report an error as well: $ ld-new -EL -m elf64lppc -pie ... -o .tmp_vmlinux.kallsyms1 ... ld-new: read-only segment has dynamic relocations Add "-z notext" to suppress the errors. Non-CONFIG_RELOCATABLE builds use the default -no-pie mode and thus R_PPC64_ADDR64 relocations can be resolved at link-time. Reported-by: Itaru Kitayama Co-developed-by: Bill Wendling Signed-off-by: Fangrui Song Signed-off-by: Bill Wendling Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210813200511.1905703-1-morbo@google.com commit 1e688dd2a3d6759d416616ff07afc4bb836c4213 Author: Christophe Leroy Date: Tue Apr 13 16:38:10 2021 +0000 powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto Using asm goto in __WARN_FLAGS() and WARN_ON() allows more flexibility to GCC. For that add an entry to the exception table so that program_check_exception() knowns where to resume execution after a WARNING. Here are two exemples. The first one is done on PPC32 (which benefits from the previous patch), the second is on PPC64. unsigned long test(struct pt_regs *regs) { int ret; WARN_ON(regs->msr & MSR_PR); return regs->gpr[3]; } unsigned long test9w(unsigned long a, unsigned long b) { if (WARN_ON(!b)) return 0; return a / b; } Before the patch: 000003a8 : 3a8: 81 23 00 84 lwz r9,132(r3) 3ac: 71 29 40 00 andi. r9,r9,16384 3b0: 40 82 00 0c bne 3bc 3b4: 80 63 00 0c lwz r3,12(r3) 3b8: 4e 80 00 20 blr 3bc: 0f e0 00 00 twui r0,0 3c0: 80 63 00 0c lwz r3,12(r3) 3c4: 4e 80 00 20 blr 0000000000000bf0 <.test9w>: bf0: 7c 89 00 74 cntlzd r9,r4 bf4: 79 29 d1 82 rldicl r9,r9,58,6 bf8: 0b 09 00 00 tdnei r9,0 bfc: 2c 24 00 00 cmpdi r4,0 c00: 41 82 00 0c beq c0c <.test9w+0x1c> c04: 7c 63 23 92 divdu r3,r3,r4 c08: 4e 80 00 20 blr c0c: 38 60 00 00 li r3,0 c10: 4e 80 00 20 blr After the patch: 000003a8 : 3a8: 81 23 00 84 lwz r9,132(r3) 3ac: 71 29 40 00 andi. r9,r9,16384 3b0: 40 82 00 0c bne 3bc 3b4: 80 63 00 0c lwz r3,12(r3) 3b8: 4e 80 00 20 blr 3bc: 0f e0 00 00 twui r0,0 0000000000000c50 <.test9w>: c50: 7c 89 00 74 cntlzd r9,r4 c54: 79 29 d1 82 rldicl r9,r9,58,6 c58: 0b 09 00 00 tdnei r9,0 c5c: 7c 63 23 92 divdu r3,r3,r4 c60: 4e 80 00 20 blr c70: 38 60 00 00 li r3,0 c74: 4e 80 00 20 blr In the first exemple, we see GCC doesn't need to duplicate what happens after the trap. In the second exemple, we see that GCC doesn't need to emit a test and a branch in the likely path in addition to the trap. We've got some WARN_ON() in .softirqentry.text section so it needs to be added in the OTHER_TEXT_SECTIONS in modpost.c Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/389962b1b702e3c78d169e59bcfac56282889173.1618331882.git.christophe.leroy@csgroup.eu commit 4f1e9630afe6332de7286820fedd019f19eac057 Author: Chunguang Xu Date: Mon Aug 2 11:51:56 2021 +0800 blk-throtl: optimize IOPS throttle for large IO scenarios After patch 54efd50 (block: make generic_make_request handle arbitrarily sized bios), the IO through io-throttle may be larger, and these IOs may be further split into more small IOs. However, IOPS throttle does not seem to be aware of this change, which makes the calculation of IOPS of large IOs incomplete, resulting in disk-side IOPS that does not meet expectations. Maybe we should fix this problem. We can reproduce it by set max_sectors_kb of disk to 128, set blkio.write_iops_throttle to 100, run a dd instance inside blkio and use iostat to watch IOPS: dd if=/dev/zero of=/dev/sdb bs=1M count=1000 oflag=direct As a result, without this change the average IOPS is 1995, with this change the IOPS is 98. Signed-off-by: Chunguang Xu Acked-by: Tejun Heo Link: https://lore.kernel.org/r/65869aaad05475797d63b4c3fed4f529febe3c26.1627876014.git.brookxu@tencent.com Signed-off-by: Jens Axboe commit 9ea9b9c48387edc101d56349492ad9c0492ff78d Author: Christoph Hellwig Date: Thu Aug 12 15:23:08 2021 +0200 remove the lightnvm subsystem Lightnvm supports the OCSSD 1.x and 2.0 specs which were early attempts to produce Open Channel SSDs and never made it into the NVMe spec proper. They have since been superceeded by NVMe enhancements such as ZNS support. Remove the support per the deprecation schedule. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210812132308.38486-1-hch@lst.de Reviewed-by: Matias Bjørling Reviewed-by: Javier González Signed-off-by: Jens Axboe commit 6b2117ad65f1bca9ece6d4b1ee784b42701a2d86 Author: Saravana Kannan Date: Thu Aug 5 15:37:29 2021 -0700 of: property: fw_devlink: Add support for "resets" and "pwms" Allows better tracking of dependencies between devices. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20210805223729.1196047-1-saravanak@google.com Signed-off-by: Rob Herring commit 3e7e69f23045f04205e833e38b3c412d52b3a0f2 Author: Michal Simek Date: Fri Aug 6 12:31:22 2021 +0200 dt-bindings: timer: Remove binding for energymicro,efm32-timer.txt The driver has been removed by commit 523d83ef0979 ("clocksource/drivers/efm32: Drop unused timer code") that's why binding doc shouldn't be also valid anymore. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/571fc4b2e6d41c61b7f4445601a79bb50aace2e7.1628245879.git.michal.simek@xilinx.com Signed-off-by: Rob Herring commit 51ca8fcba2b0fde46416e4a144a21adb132e14c7 Author: Ezequiel Garcia Date: Wed Aug 4 23:59:46 2021 -0300 dt-bindings: gpu: mali-bifrost: Add RK3568 compatible The Rockchip RK3568 SoC has a Bifrost Mali-G52 GPU, add a compatible string for it. Signed-off-by: Ezequiel Garcia Link: https://lore.kernel.org/r/20210805025948.10900-3-ezequiel@collabora.com Signed-off-by: Rob Herring commit 16f944291a4ab896895e78934623b9d33af810cf Author: Dmitry Osipenko Date: Mon Jul 12 03:23:53 2021 +0300 thermal/drivers/tegra-soctherm: Silence message about clamped temperature The Tegra soctherm driver prints message about the clamped temperature trip each time when thermal core disables the low/high trip. The message is confusing and creates illusion that driver is malfunctioning. Turn that noisy info message into a debug message. Signed-off-by: Dmitry Osipenko Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210712002353.17276-1-digetx@gmail.com commit 454f2ed4b34f9ef5726d080b1eb5dc47a7f36d6f Author: Geert Uytterhoeven Date: Wed Jul 14 13:27:01 2021 +0200 thermal: Spelling s/scallbacks/callbacks/ Fix a misspelling of the word "callbacks". Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/ae38372996a23bb67769e2d62ca170ae9457c4df.1626261946.git.geert+renesas@glider.be commit 22fc857538c3a256563bb796f978b6d4693f5aa3 Author: Maxime Ripard Date: Wed Jul 21 16:04:03 2021 +0200 dt-bindings: thermal: Make trips node optional Even though the previous binding made it a required child node, the implementation in Linux never made it mandatory and just ignored thermal zones without trip points. This was even effectively encouraged, since the thermal core wouldn't allow a thermal sensor to probe without a thermal zone. In the case where you had a thermal device that had multiple sensors but with enough knowledge to provide trip points for only a few of them, this meant that the only way to make that driver probe was to provide a thermal zone without the trips node required by the binding. This obviously led to a fair number of device trees doing exactly that, making the initial binding requirement ineffective. Let's make it clear by dropping that requirement. Cc: Amit Kucheria Cc: Daniel Lezcano Cc: linux-pm@vger.kernel.org Cc: Zhang Rui Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210721140424.725744-34-maxime@cerno.tech commit fb83610762dd5927212aa62a468dd3b756b57a88 Author: Arnd Bergmann Date: Thu Jul 22 11:06:44 2021 +0200 thermal/core: Fix thermal_cooling_device_register() prototype There are two pairs of declarations for thermal_cooling_device_register() and thermal_of_cooling_device_register(), and only one set was changed in a recent patch, so the other one now causes a compile-time warning: drivers/net/wireless/mediatek/mt76/mt7915/init.c: In function 'mt7915_thermal_init': drivers/net/wireless/mediatek/mt76/mt7915/init.c:134:48: error: passing argument 1 of 'thermal_cooling_device_register' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 134 | cdev = thermal_cooling_device_register(wiphy_name(wiphy), phy, | ^~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/mediatek/mt76/mt7915/init.c:7: include/linux/thermal.h:407:39: note: expected 'char *' but argument is of type 'const char *' 407 | thermal_cooling_device_register(char *type, void *devdata, | ~~~~~~^~~~ Change the dummy helper functions to have the same arguments as the normal version. Fixes: f991de53a8ab ("thermal: make device_register's type argument const") Signed-off-by: Arnd Bergmann Reviewed-by: Jean-Francois Dagenais Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210722090717.1116748-1-arnd@kernel.org commit f1b07a14694be02b2b87e2fe6def6cff2f4bd452 Author: Sumeet Pawnikar Date: Fri Jul 16 22:09:46 2021 +0530 thermal/drivers/int340x: Use IMOK independently Some chrome platform requires IMOK method in coreboot. But these platforms don't use GDDV data vault in coreboot. As per current code flow, to enable and use IMOK only, we need to have GDDV support as well in coreboot. This patch removes the dependency for IMOK from GDDV to enable and use IMOK independently. Signed-off-by: Sumeet Pawnikar Acked-by: Srinivas Pandruvada Acked-by: Zhang Rui Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210716163946.3142-1-sumeet.r.pawnikar@intel.com commit b5f7912bb604b47a0fe024560488a7556dce8ee7 Author: Rolf Eike Beer Date: Fri Jul 30 13:51:54 2021 +0200 tools/thermal/tmon: Add cross compiling support Default to prefixed pkg-config when crosscompiling, this matches what other parts of the tools/ directory already do. [dlezcano] : Reworked description Signed-off-by: Rolf Eike Beer Cc: stable@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/31302992.qZodDJZGDc@devpool47 commit 99d88c30055376b56316d3c431c9873e88208348 Author: Rolf Eike Beer Date: Fri Jul 30 13:49:04 2021 +0200 thermal/tools/tmon: Improve the Makefile - Remove empty macros assignments - Use directory creation parameter for the install tool - Use $OBJ instead of building the list of object for the 'clean' target [dlezcano] : Changed title and description Signed-off-by: Rolf Eike Beer Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1951386.ZPQrlMDjM2@devpool47 commit e4637f621203cb482f3ddb590cfe9f65045d92a6 Author: Cai Huoqing Date: Fri Aug 13 20:08:03 2021 +0800 MAINTAINERS: Remove the ipx network layer info commit <47595e32869f> ("") indicated the ipx network layer as obsolete in Jan 2018, updated in the MAINTAINERS file. now, after being exposed for 3 years to refactoring, so to remove the ipx network layer info from MAINTAINERS. additionally, there is no module that depends on ipx.h except a broken staging driver(r8188eu) Signed-off-by: Cai Huoqing Signed-off-by: David S. Miller commit 6c9b40844751ea30c72f7a2f92f4d704bc6b2927 Author: Cai Huoqing Date: Fri Aug 13 20:08:02 2021 +0800 net: Remove net/ipx.h and uapi/linux/ipx.h header files commit <47595e32869f> ("") indicated the ipx network layer as obsolete in Jan 2018, updated in the MAINTAINERS file now, after being exposed for 3 years to refactoring, so to delete uapi/linux/ipx.h and net/ipx.h header files for good. additionally, there is no module that depends on ipx.h except a broken staging driver(r8188eu) Signed-off-by: Cai Huoqing Signed-off-by: David S. Miller commit fda4e19d505d5e45c7c37be3494298c7e32c6928 Merge: 8db102a6f48b5 8dc181f2cd621 Author: David S. Miller Date: Sat Aug 14 14:13:39 2021 +0100 Merge branch 'iupa-last-things-before-pm-conversion' Alex Elder says: ==================== net: ipa: last things before PM conversion This series contains a few remaining changes needed before fully switching over to using runtime power management rather than the previous "IPA clock" mechanism. The first patch moves the calls to enable and disable the IPA interrupt as a system wakeup interrupt into "ipa_clock.c" with the rest of the power-related code. The second adds a flag to make it possible to distinguish runtime suspend from system suspend. The third and fourth patches arrange for the ->start_xmit path to resume hardware if necessary, to ensure it is powered. If power is not active, the TX queue is stopped, and arrangements are made for the queue to be restarted once hardware power is active again. The fifth patch keeps the TX queue active during suspend. This isn't necessary for system suspend but it's important for runtime suspend. And the last patch makes it so we don't hold the hardware active while the modem network device is open. ==================== Signed-off-by: David S. Miller commit 8dc181f2cd621e8eaa3d9d432e5ebf0175244c4a Author: Alex Elder Date: Thu Aug 12 14:50:35 2021 -0500 net: ipa: don't hold clock reference while netdev open Currently a clock reference is taken whenever the ->ndo_open callback for the modem netdev is called. That reference is dropped when the device is closed, in ipa_stop(). We no longer need this, because ipa_start_xmit() now handles the situation where the hardware power state is not active. Drop the clock reference in ipa_open() when we're done, and take a new reference in ipa_stop() before we begin closing the interface. Finally (and unrelated, but trivial), change the return type of ipa_start_xmit() to be netdev_tx_t instead of int. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8dcf8bb30f17d4ac1233be877c1650c5a1b34ca8 Author: Alex Elder Date: Thu Aug 12 14:50:34 2021 -0500 net: ipa: don't stop TX on suspend Currently we stop the modem netdev transmit queue when suspending the hardware. For system suspend this ensured we'd never attempt to transmit while attempting to suspend the modem endpoints. For runtime suspend, the IPA hardware might get suspended while the system is operating. In that case we want an attempt to transmit a packet to cause the hardware to resume if necessary. But if we disable the queue this cannot happen. So stop disabling the queue on suspend. In case we end up disabling it in ipa_start_xmit() (see the previous commit), we still arrange to start the TX queue on resume. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 6b51f802d652b9f053ef5103dc33b7a55c67860c Author: Alex Elder Date: Thu Aug 12 14:50:33 2021 -0500 net: ipa: ensure hardware has power in ipa_start_xmit() We need to ensure the hardware is powered when we transmit a packet. But if it's not, we can't block to wait for it. So asynchronously request power in ipa_start_xmit(), and only proceed if the return value indicates the power state is active. If the hardware is not active, a runtime resume request will have been initiated. In that case, stop the network stack from further transmit attempts until the resume completes. Return NETDEV_TX_BUSY, to retry sending the packet once the queue is restarted. If the power request returns an error (other than -EINPROGRESS, which just means a resume requested elsewhere isn't complete), just drop the packet. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a96e73fa1269a1d1b932f465ed0a803d4c153258 Author: Alex Elder Date: Thu Aug 12 14:50:32 2021 -0500 net: ipa: re-enable transmit in PM WQ context Create a new work structure in the modem private data, and use it to re-enable the modem network device transmit queue when resuming. This is needed by the next patch, which stops the TX queue if IPA power isn't active when a transmit request arrives. Packets will start arriving the instant the TX queue is enabled, but resuming isn't complete until ipa_modem_resume() returns. This way we're sure to be resumed before transmits are allowed again. Cancel it before calling ipa_stop() in ipa_modem_stop() to ensure the transmit queue restart completes before it gets stopped there. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit b9c532c11cab21d23a67c2d80a02a444c9e07ac6 Author: Alex Elder Date: Thu Aug 12 14:50:31 2021 -0500 net: ipa: distinguish system from runtime suspend Add a new flag that is set when the hardware is suspended due to a system suspend operation, distingishing it from runtime suspend. Use it in the SUSPEND IPA interrupt handler to determine whether to trigger a system resume because of the event. Define new suspend and resume power management callback functions to set and clear the new flag, respectively. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit d430fe4bac024812f50b8a2ad7a3639128c9db06 Author: Alex Elder Date: Thu Aug 12 14:50:30 2021 -0500 net: ipa: enable wakeup in ipa_power_setup() Move the call to enable the IPA interrupt as a wakeup interrupt into ipa_power_setup(), disable it in ipa_power_teardown(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8db102a6f48b5dffa0d38ef6c013b9a33d232e55 Merge: 2fa16787c4743 ddc649d158c56 Author: David S. Miller Date: Sat Aug 14 14:02:43 2021 +0100 Merge branch 'bridgge-mcast' Nikolay Aleksandrov says: ==================== net: bridge: mcast: dump querier state This set adds the ability to dump the current multicast querier state. This is extremely useful when debugging multicast issues, we've had many cases of unexpected queriers causing strange behaviour and mcast test failures. The first patch changes the querier struct to record a port device's ifindex instead of a pointer to the port itself so we can later retrieve it, I chose this way because it's much simpler and doesn't require us to do querier port ref counting, it is best effort anyway. Then patch 02 makes the querier address/port updates consistent via a combination of multicast_lock and seqcount, so readers can only use seqcount to get a consistent snapshot of address and port. Patch 03 is a minor cleanup in preparation for the dump support, it consolidates IPv4 and IPv6 querier selection paths as they share most of the logic (except address comparisons of course). Finally the last three patches add the new querier state dumping support, for the bridge's global multicast context we embed the BRIDGE_QUERIER_xxx attributes into IFLA_BR_MCAST_QUERIER_STATE and for the per-vlan global mcast contexts we embed them into BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE. The structure is: [IFLA_BR_MCAST_QUERIER_STATE / BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE] `[BRIDGE_QUERIER_IP_ADDRESS] - ip address of the querier `[BRIDGE_QUERIER_IP_PORT] - bridge port ifindex where the querier was seen (set only if external querier) `[BRIDGE_QUERIER_IP_OTHER_TIMER] - other querier timeout `[BRIDGE_QUERIER_IPV6_ADDRESS] - ip address of the querier `[BRIDGE_QUERIER_IPV6_PORT] - bridge port ifindex where the querier was seen (set only if external querier) `[BRIDGE_QUERIER_IPV6_OTHER_TIMER] - other querier timeout Later we can also add IGMP version of seen queriers and last seen values from the queries. ==================== commit ddc649d158c560c6685be1701900a6e456ecceac Author: Nikolay Aleksandrov Date: Fri Aug 13 18:00:02 2021 +0300 net: bridge: vlan: dump mcast ctx querier state Use the new mcast querier state dump infrastructure and export vlans' mcast context querier state embedded in attribute BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 85b4108211742c5dd4f9f56c1d0704b4e0d4c98e Author: Nikolay Aleksandrov Date: Fri Aug 13 18:00:01 2021 +0300 net: bridge: mcast: dump ipv6 querier state Add support for dumping global IPv6 querier state, we dump the state only if our own querier is enabled or there has been another external querier which has won the election. For the bridge global state we use a new attribute IFLA_BR_MCAST_QUERIER_STATE and embed the state inside. The structure is: [IFLA_BR_MCAST_QUERIER_STATE] `[BRIDGE_QUERIER_IPV6_ADDRESS] - ip address of the querier `[BRIDGE_QUERIER_IPV6_PORT] - bridge port ifindex where the querier was seen (set only if external querier) `[BRIDGE_QUERIER_IPV6_OTHER_TIMER] - other querier timeout IPv4 and IPv6 attributes are embedded at the same level of IFLA_BR_MCAST_QUERIER_STATE. If we didn't dump anything we cancel the nest and return. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit c7fa1d9b1fb179375e889ff076a1566ecc997bfc Author: Nikolay Aleksandrov Date: Fri Aug 13 18:00:00 2021 +0300 net: bridge: mcast: dump ipv4 querier state Add support for dumping global IPv4 querier state, we dump the state only if our own querier is enabled or there has been another external querier which has won the election. For the bridge global state we use a new attribute IFLA_BR_MCAST_QUERIER_STATE and embed the state inside. The structure is: [IFLA_BR_MCAST_QUERIER_STATE] `[BRIDGE_QUERIER_IP_ADDRESS] - ip address of the querier `[BRIDGE_QUERIER_IP_PORT] - bridge port ifindex where the querier was seen (set only if external querier) `[BRIDGE_QUERIER_IP_OTHER_TIMER] - other querier timeout Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit c3fb3698f935381161101d2479d66dd48c106183 Author: Nikolay Aleksandrov Date: Fri Aug 13 17:59:59 2021 +0300 net: bridge: mcast: consolidate querier selection for ipv4 and ipv6 We can consolidate both functions as they share almost the same logic. This is easier to maintain and we have a single querier update function. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 67b746f94ff39d8b998c4ea9493c6ab2d6c225d4 Author: Nikolay Aleksandrov Date: Fri Aug 13 17:59:58 2021 +0300 net: bridge: mcast: make sure querier port/address updates are consistent Use a sequence counter to make sure port/address updates can be read consistently without requiring the bridge multicast_lock. We need to zero out the port and address when the other querier has expired and we're about to select ourselves as querier. br_multicast_read_querier will be used later when dumping querier state. Updates are done only with the multicast spinlock and softirqs disabled, while reads are done from process context and from softirqs (due to notifications). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit bb18ef8e7e180d8590df2808ec4014af114756cb Author: Nikolay Aleksandrov Date: Fri Aug 13 17:59:57 2021 +0300 net: bridge: mcast: record querier port device ifindex instead of pointer Currently when a querier port is detected its net_bridge_port pointer is recorded, but it's used only for comparisons so it's fine to have stale pointer, in order to dereference and use the port pointer a proper accounting of its usage must be implemented adding unnecessary complexity. To solve the problem we can just store the netdevice ifindex instead of the port pointer and retrieve the bridge port. It is a best effort and the device needs to be validated that is still part of that bridge before use, but that is small price to pay for avoiding querier reference counting for each port/vlan. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 2fa16787c47437318fc6ceeeddc34ceabd9313c7 Merge: 38e3bfa869649 a1fcb106ae97c Author: David S. Miller Date: Sat Aug 14 13:59:10 2021 +0100 Merge branch 'devlink-cleanup-for-delay-event' Leon Romanovsky says: ==================== Devlink cleanup for delay event series Jakub's request to make sure that devlink events are delayed and not printed till they fully accessible [1] requires us to implement delayed event notification system in the devlink. In order to do it, I moved some of my patches (xarray e.t.c) from the future series to be before "Move devlink_register to be near devlink_reload_enable" [2]. That allows us to rely on DEVLINK_REGISTERED xarray mark to decide if to print event or not. Other patches are simple cleanup which is needed anyway. [1] https://lore.kernel.org/lkml/20210811071817.4af5ab34@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com [2] https://lore.kernel.org/lkml/cover.1628599239.git.leonro@nvidia.com Next in the queue: * Delay event series * Move devlink_register to be near devlink_reload_enable" * Extension of devlink_ops to be set dynamically * devlink_reload_* delete * Devlink locks rework to user xarray and reference counting * ???? ==================== Signed-off-by: David S. Miller commit a1fcb106ae97cc34cc8101efafb89eaa837be009 Author: Leon Romanovsky Date: Sat Aug 14 12:57:31 2021 +0300 net: hns3: remove always exist devlink pointer check The devlink pointer always exists after hclge_devlink_init() succeed. Remove that check together with NULL setting after release and ensure that devlink_register is last command prior to call to devlink_reload_enable(). Fixes: b741269b2759 ("net: hns3: add support for registering devlink for PF") Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit ed43fbac717882165a2a4bd64f7b1f56f7467bb7 Author: Leon Romanovsky Date: Sat Aug 14 12:57:30 2021 +0300 devlink: Clear whole devlink_flash_notify struct The { 0 } doesn't clear all fields in the struct, but tells to the compiler to set all fields to zero and doesn't touch any sub-fields if they exists. The {} is an empty initialiser that instructs to fully initialize whole struct including sub-fields, which is error-prone for future devlink_flash_notify extensions. Fixes: 6700acc5f1fe ("devlink: collect flash notify params into a struct") Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 11a861d767cdd87a34397821b0fd2095893b84b3 Author: Leon Romanovsky Date: Sat Aug 14 12:57:29 2021 +0300 devlink: Use xarray to store devlink instances We can use xarray instead of linearly organized linked lists for the devlink instances. This will let us revise the locking scheme in favour of internal xarray locking that protects database. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 437ebfd90a2567aab19dce47bafc81ebd8a63324 Author: Leon Romanovsky Date: Sat Aug 14 12:57:28 2021 +0300 devlink: Count struct devlink consumers The struct devlink itself is protected by internal lock and doesn't need global lock during operation. That global lock is used to protect addition/removal new devlink instances from the global list in use by all devlink consumers in the system. The future conversion of linked list to be xarray will allow us to actually delete that lock, but first we need to count all struct devlink users. The reference counting provides us a way to ensure that no new user space commands success to grab devlink instance which is going to be destroyed makes it is safe to access it without lock. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 7ca973dc9fe589dc0ab2650641f4c7a19cc49ecd Author: Leon Romanovsky Date: Sat Aug 14 12:57:27 2021 +0300 devlink: Remove check of always valid devlink pointer Devlink objects are accessible only after they were registered and have valid devlink_*->devlink pointers. Remove that check and simplify respective fill functions as an outcome of such change. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit cbf6ab672eb425ac1cd7f8c7c4066f3bb0a78e50 Author: Leon Romanovsky Date: Sat Aug 14 12:57:26 2021 +0300 devlink: Simplify devlink_pernet_pre_exit call The devlink_pernet_pre_exit() will be called if net namespace exits. That routine is relevant for devlink instances that were assigned to that namespaces first. This assignment is possible only with the following command: "devlink reload DEV netns ...", which already checks reload support. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit db87a7199229b75c9996bf78117eceb81854fce2 Author: Christophe Leroy Date: Tue Apr 13 16:38:09 2021 +0000 powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32 powerpc BUG_ON() and WARN_ON() are based on using twnei instruction. For catching simple conditions like a variable having value 0, this is efficient because it does the test and the trap at the same time. But most conditions used with BUG_ON or WARN_ON are more complex and forces GCC to format the condition into a 0 or 1 value in a register. This will usually require 2 to 3 instructions. The most efficient solution would be to use __builtin_trap() because GCC is able to optimise the use of the different trap instructions based on the requested condition, but this is complex if not impossible for the following reasons: - __builtin_trap() is a non-recoverable instruction, so it can't be used for WARN_ON - Knowing which line of code generated the trap would require the analysis of DWARF information. This is not a feature we have today. As mentioned in commit 8d4fbcfbe0a4 ("Fix WARN_ON() on bitfield ops") the way WARN_ON() is implemented is suboptimal. That commit also mentions an issue with 'long long' condition. It fixed it for WARN_ON() but the same problem still exists today with BUG_ON() on PPC32. It will be fixed by using the generic implementation. By using the generic implementation, gcc will naturally generate a branch to the unconditional trap generated by BUG(). As modern powerpc implement zero-cycle branch, that's even more efficient. And for the functions using WARN_ON() and its return, the test on return from WARN_ON() is now also used for the WARN_ON() itself. On PPC64 we don't want it because we want to be able to use CFAR register to track how we entered the code that trapped. The CFAR register would be clobbered by the branch. A simple test function: unsigned long test9w(unsigned long a, unsigned long b) { if (WARN_ON(!b)) return 0; return a / b; } Before the patch: 0000046c : 46c: 7c 89 00 34 cntlzw r9,r4 470: 55 29 d9 7e rlwinm r9,r9,27,5,31 474: 0f 09 00 00 twnei r9,0 478: 2c 04 00 00 cmpwi r4,0 47c: 41 82 00 0c beq 488 480: 7c 63 23 96 divwu r3,r3,r4 484: 4e 80 00 20 blr 488: 38 60 00 00 li r3,0 48c: 4e 80 00 20 blr After the patch: 00000468 : 468: 2c 04 00 00 cmpwi r4,0 46c: 41 82 00 0c beq 478 470: 7c 63 23 96 divwu r3,r3,r4 474: 4e 80 00 20 blr 478: 0f e0 00 00 twui r0,0 47c: 38 60 00 00 li r3,0 480: 4e 80 00 20 blr So we see before the patch we need 3 instructions on the likely path to handle the WARN_ON(). With the patch the trap goes on the unlikely path. See below the difference at the entry of system_call_exception where we have several BUG_ON(), allthough less impressing. With the patch: 00000000 : 0: 81 6a 00 84 lwz r11,132(r10) 4: 90 6a 00 88 stw r3,136(r10) 8: 71 60 00 02 andi. r0,r11,2 c: 41 82 00 70 beq 7c 10: 71 60 40 00 andi. r0,r11,16384 14: 41 82 00 6c beq 80 18: 71 6b 80 00 andi. r11,r11,32768 1c: 41 82 00 68 beq 84 20: 94 21 ff e0 stwu r1,-32(r1) 24: 93 e1 00 1c stw r31,28(r1) 28: 7d 8c 42 e6 mftb r12 ... 7c: 0f e0 00 00 twui r0,0 80: 0f e0 00 00 twui r0,0 84: 0f e0 00 00 twui r0,0 Without the patch: 00000000 : 0: 94 21 ff e0 stwu r1,-32(r1) 4: 93 e1 00 1c stw r31,28(r1) 8: 90 6a 00 88 stw r3,136(r10) c: 81 6a 00 84 lwz r11,132(r10) 10: 69 60 00 02 xori r0,r11,2 14: 54 00 ff fe rlwinm r0,r0,31,31,31 18: 0f 00 00 00 twnei r0,0 1c: 69 60 40 00 xori r0,r11,16384 20: 54 00 97 fe rlwinm r0,r0,18,31,31 24: 0f 00 00 00 twnei r0,0 28: 69 6b 80 00 xori r11,r11,32768 2c: 55 6b 8f fe rlwinm r11,r11,17,31,31 30: 0f 0b 00 00 twnei r11,0 34: 7d 8c 42 e6 mftb r12 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b286e07fb771a664b631cd07a40b09c06f26e64b.1618331881.git.christophe.leroy@csgroup.eu commit 21c1e439fd864828b58f783641b3736197ccc813 Author: Daniel Lezcano Date: Sat Aug 14 13:14:07 2021 +0200 MAINTAINERS: Add missing userspace thermal tools to the thermal section Patches related to the tmon which is in tools/thermal are floating around since years because it is unclear who takes care of it. Add the missing userspace tools directory related to thermal to fix the situation. Signed-off-by: Daniel Lezcano commit 8f76f9c46952659dd925c21c3f62a0d05a3f3e71 Author: Vineet Gupta Date: Thu Aug 5 12:14:08 2021 -0700 bitops/non-atomic: make @nr unsigned to avoid any DIV signed math causes generation of costlier instructions such as DIV when they could be done by barrerl shifter. Worse part is this is not caught by things like bloat-o-meter since instruction length / symbols are typically same size. e.g. stock (signed math) __________________ 919b4614 : 919b4614: div r2,r0,0x20 ^^^ 919b4618: add2 r2,0x920f6050,r2 919b4620: ld_s r2,[r2,0] 919b4622: lsr r0,r2,r0 919b4626: j_s.d [blink] 919b4628: bmsk_s r0,r0,0 919b462a: nop_s (patched) unsigned math __________________ 919b4614 : 919b4614: lsr r2,r0,0x5 @nr/32 ^^^ 919b4618: add2 r2,0x920f6050,r2 919b4620: ld_s r2,[r2,0] 919b4622: lsr r0,r2,r0 #test_bit() 919b4626: j_s.d [blink] 919b4628: bmsk_s r0,r0,0 919b462a: nop_s Signed-off-by: Vineet Gupta Acked-by: Will Deacon Signed-off-by: Arnd Bergmann commit d31eb7c1a2288f61df75558f59328be01a264300 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:02 2021 +0200 thermal/drivers/intel_powerclamp: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Zhang Rui Cc: Daniel Lezcano Cc: Amit Kucheria Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210803141621.780504-20-bigeasy@linutronix.de commit d3a2328e741bf6e9e6bda750e0a63832fa365a74 Author: Niklas Söderlund Date: Wed Aug 4 11:18:18 2021 +0200 thermal/drivers/rcar_gen3_thermal: Store TSC id as unsigned int The TSC id and number of TSC ids should be stored as unsigned int as they can't be negative. Fix the datatype of the loop counter 'i' and rcar_gen3_thermal_tsc.id to reflect this. Signed-off-by: Niklas Söderlund Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210804091818.2196806-3-niklas.soderlund+renesas@ragnatech.se commit 4eef766b7d4d88f0b984781bc1bcb574a6eafdc7 Author: Linus Walleij Date: Thu Aug 5 10:58:28 2021 +0200 power: supply: core: Parse battery chemistry/technology This extends the struct power_supply_battery_info with a "technology" field makes the core DT parser optionally obtain this from the device tree. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 47cf09e0f4fc51200ecea15387bec3584562f55d Author: Niklas Söderlund Date: Wed Aug 4 11:18:17 2021 +0200 thermal/drivers/rcar_gen3_thermal: Add support for hardware trip points All supported hardware except V3U is capable of generating interrupts to the CPU when the temperature go below or above a set value. Use this to implement support for the set_trip() feature of the thermal core on supported hardware. The V3U have its interrupts routed to the ECM module and therefore can not be used to implement set_trip() as the driver can't be made aware of when the interrupt triggers. Each TSC is capable of tracking up-to three different temperatures while only two are needed to implement the tracking of the thermal window. Signed-off-by: Niklas Söderlund Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210804091818.2196806-2-niklas.soderlund+renesas@ragnatech.se commit b171cb623ca253856b7bf7345e8761a7f24b54b9 Author: Linus Walleij Date: Thu Aug 5 10:58:27 2021 +0200 dt-bindings: power: Extend battery bindings with chemistry This adds a battery-chemistry property and bindings for the different "technologies" that are used in Linux. More types can be added. This is needed to convert the custom ST-Ericsson AB8500 battery properties over to the generic battery bindings. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit a414a08aefe6343492b812a50a1b2f3a30ce8b6e Author: Sumeet Pawnikar Date: Mon Aug 9 17:26:35 2021 +0530 drivers/thermal/intel: Add TCC cooling support for AlderLake platform Add tcc cooling support for the AlderLake platform. Signed-off-by: Sumeet Pawnikar Reviewed-by: Zhang Rui Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210809115635.10100-1-sumeet.r.pawnikar@intel.com commit 02d438f62c05f0d055ceeedf12a2f8796b258c08 Author: Dan Carpenter Date: Tue Aug 10 11:44:13 2021 +0300 thermal/drivers/exynos: Fix an error code in exynos_tmu_probe() This error path return success but it should propagate the negative error code from devm_clk_get(). Fixes: 6c247393cfdd ("thermal: exynos: Add TMU support for Exynos7 SoC") Signed-off-by: Dan Carpenter Reviewed-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210810084413.GA23810@kili commit 38e3bfa86964961291760e7da6227794106d2247 Merge: e5f31552674e8 7d1e6f1639044 Author: David S. Miller Date: Sat Aug 14 11:37:25 2021 +0100 Merge branch 'mptcp-improve-backup-subflows' Mat Martineau says: ==================== mptcp: Improve use of backup subflows Multipath TCP combines multiple TCP subflows in to one stream, and the MPTCP-level socket must decide which subflow to use when sending (or resending) chunks of data. The choice of the "best" subflow to transmit on can vary depending on the priority (normal or backup) for each subflow and how well the subflow is performing. In order to improve MPTCP performance when some subflows are failing, this patch set changes how backup subflows are utilized and introduces tracking of "stale" subflows that are still connected but not making progress. Patch 1 adjusts MPTCP-level retransmit timeouts to use data from all subflows. Patch 2 makes MPTCP-level retransmissions less aggressive to avoid resending data that's still queued at the TCP level. Patch 3 changes the way pending data is handled when subflows are closed. Unacked MPTCP-level data still in the subflow tx queue is immediately moved to another subflow for transmission instead of waiting for MPTCP-level timeouts to trigger retransmission. Patch 4 has some sysctl code cleanup. Patches 5 and 6 add tracking of "stale" subflows, so only underlying TCP subflow connections that appear to be making progress are considered when selecting a subflow to (re)transmit data. How fast a subflow goes stale is configurable with a per-namespace sysctl. Related MIBS are added too. Patch 7 makes sure the backup flag is always correctly recorded when the MP_JOIN SYN/ACK is received for an added subflow. Patch 8 adds more test cases for backup subflows and stale subflows. ==================== Signed-off-by: David S. Miller commit 7d1e6f16390443595ab8e25139ecc4f27b8802df Author: Paolo Abeni Date: Fri Aug 13 15:15:48 2021 -0700 selftests: mptcp: add testcase for active-back Add more test-case for link failures scenario, including recovery from link failure using only backup subflows and bi-directional transfer. Additionally explicitly check for stale count Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 0460ce229f5b19f501124adf1485176fbfc8f1c2 Author: Paolo Abeni Date: Fri Aug 13 15:15:47 2021 -0700 mptcp: backup flag from incoming MPJ ack option the parsed incoming backup flag is not propagated to the subflow itself, the client may end-up using it to send data. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/191 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit fc1b4e3b6274379a1ed398e19b850561ccd765db Author: Paolo Abeni Date: Fri Aug 13 15:15:46 2021 -0700 mptcp: add mibs for stale subflows processing This allows monitoring exceptional events like active backup scenarios. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ff5a0b421cb23bf6b2898939ffef5b683045d9d3 Author: Paolo Abeni Date: Fri Aug 13 15:15:45 2021 -0700 mptcp: faster active backup recovery The msk can use backup subflows to transmit in-sequence data only if there are no other active subflow. On active backup scenario, the MPTCP connection can do forward progress only due to MPTCP retransmissions - rtx can pick backup subflows. This patch introduces a new flag flow MPTCP subflows: if the underlying TCP connection made no progresses for long time, and there are other less problematic subflows available, the given subflow become stale. Stale subflows are not considered active: if all non backup subflows become stale, the MPTCP scheduler can pick backup subflows for plain transmissions. Stale subflows can return in active state, as soon as any reply from the peer is observed. Active backup scenarios can now leverage the available b/w with no restrinction. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/207 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 6da14d74e2bd07bca2cba10878dda5dc0485d59c Author: Paolo Abeni Date: Fri Aug 13 15:15:44 2021 -0700 mptcp: cleanup sysctl data and helpers Reorder the data in mptcp_pernet to avoid wasting space with no reasons and constify the access helpers. No functional changes intended. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1e1d9d6f119c55c05e8ea78ed3e49046690abffd Author: Paolo Abeni Date: Fri Aug 13 15:15:43 2021 -0700 mptcp: handle pending data on closed subflow The PM can close active subflow, e.g. due to ingress RM_ADDR option. Such subflow could carry data still unacked at the MPTCP-level, both in the write and the rtx_queue, which has never reached the other peer. Currently the mptcp-level retransmission will deliver such data, but at a very low rate (at most 1 DSM for each MPTCP rtx interval). We can speed-up the recovery a lot, moving all the unacked in the tcp write_queue, so that it will be pushed again via other subflows, at the speed allowed by them. Also make available the new helper for later patches. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/207 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 71b7dec27f340c4ab90ef39ae096d8bb2e1c851c Author: Paolo Abeni Date: Fri Aug 13 15:15:42 2021 -0700 mptcp: less aggressive retransmission strategy The current mptcp re-inject strategy is very aggressive, we have mptcp-level retransmissions even on single subflow connection, if the link in-use is lossy. Let's be a little more conservative: we do retransmit only if at least a subflow has write and rtx queue empty. Additionally use the backup subflows only if the active subflows are stale - no progresses in at least an rtx period and ignore stale subflows for rtx timeout update Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/207 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 33d41c9cd74c56643a710810703b6bce6eb25efa Author: Paolo Abeni Date: Fri Aug 13 15:15:41 2021 -0700 mptcp: more accurate timeout As reported by Maxim, we have a lot of MPTCP-level retransmissions when multilple links with different latencies are in use. This patch refactor the mptcp-level timeout accounting so that the maximum of all the active subflow timeout is used. To avoid traversing the subflow list multiple times, the update is performed inside the packet scheduler. Additionally clean-up a bit timeout handling. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 8f8d8b0334cc4e7908b78e73936a7673bbef0411 Author: Dmitry Osipenko Date: Thu Jun 17 10:24:03 2021 +0300 thermal/drivers/tegra: Correct compile-testing of drivers All Tegra thermal drivers support compile-testing, but the drivers are not available for compile-testing because the whole Kconfig meny entry depends on ARCH_TEGRA, missing the alternative COMPILE_TEST dependency option. Correct the Kconfig entry. Signed-off-by: Dmitry Osipenko Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210617072403.3487-1-digetx@gmail.com commit 3747e4263ff6d6085507a32946f8236c62dd2495 Author: Dmitry Osipenko Date: Wed Jun 16 22:04:14 2021 +0300 thermal/drivers/tegra: Add driver for Tegra30 thermal sensor All NVIDIA Tegra30 SoCs have a two-channel on-chip sensor unit which monitors temperature and voltage of the SoC. Sensors control CPU frequency throttling, which is activated by hardware once preprogrammed temperature level is breached, they also send signal to Power Management controller to perform emergency shutdown on a critical overheat of the SoC die. Add driver for the Tegra30 TSENSOR module, exposing it as a thermal sensor. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Svyatoslav Ryhel # Asus TF201T Tested-by: Ihor Didenko # Asus TF300T Tested-by: Ion Agorria # Asus TF201T Tested-by: Matt Merhar # Ouya Tested-by: Peter Geis # Ouya Acked-by: Thierry Reding Signed-off-by: Dmitry Osipenko Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210616190417.32214-4-digetx@gmail.com commit 3a95de59730eb9ac8dd6a367018f5653a873ecaa Author: Linus Walleij Date: Sun Jul 25 00:44:23 2021 +0200 clocksource/drivers/fttmr010: Pass around less pointers Just pass bool flags from the different initcalls and use the flags to set the right pointers. This results in less pointers passed around in init. Cc: Cédric Le Goater Cc: Joel Stanley Signed-off-by: Linus Walleij Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210724224424.2085404-1-linus.walleij@linaro.org commit 2a047e0662aee1bd773e0415accd785ad26a9398 Author: Christoph Hellwig Date: Mon Aug 9 17:19:36 2021 +0200 dma-mapping: return an unsigned int from dma_map_sg{,_attrs} These can only return 0 for failure or the number of entries, so turn the return value into an unsigned int. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe commit 327b34f2a97d72c41d4854d61336c9ae6ffe4a44 Author: Takashi Iwai Date: Fri Aug 13 10:12:30 2021 +0200 ALSA: hda: Nuke unused reboot_notify callback As reboot_notify callback is no longer used by the codec core, let's get rid of the unused code. Conexant codec needs a slight code change as it used to call the reboot_notify at the codec removal, too. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210813081230.4268-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit b98444ed597dc42be620bcac241c93da50933e69 Author: Takashi Iwai Date: Fri Aug 13 10:12:29 2021 +0200 ALSA: hda: Suspend codec at shutdown So far we have a few workarounds at shutdown for each codec, e.g. turning off the display power and setting the codec to D3. But all those are basically a part of the suspend procedure. Moreover, the streams are still active after that call, hence it might hit the update on the codec that has been already put to D3. In this patch, instead of calling each reboot_notify callback, simply put the codec into the runtime-suspended state after the manual suspend of all PCM streams. It makes the code and the behavior more consistent. The reboot_notify callback is no longer used after this patch, and will be cleaned up later. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210813081230.4268-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 95dc85dba05fa8f84c6db5fee3990fa4dd9fb499 Author: Takashi Iwai Date: Fri Aug 13 10:12:28 2021 +0200 ALSA: hda: conexant: Turn off EAPD at suspend, too Conexant codecs have a workaround for the noise at shutdown to turn off EAPD, but it wasn't applied at suspend. In the later patch, we'll switch from reboot_notify callback to the general suspend-at-shutdown, so let's apply the workaround to the suspend case, too. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210813081230.4268-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 81be10934949da8b12ca4db3de1511a4220fa9b4 Author: Takashi Iwai Date: Fri Aug 13 10:21:42 2021 +0200 ALSA: pcm: Add SNDRV_PCM_INFO_EXPLICIT_SYNC flag ALSA PCM core has an optimized way to communicate with user-space for its control and status data via mmap on the supported architectures like x86. Depending on the situation, however, we'd rather want to enforce user-space notifying the applptr or hwptr change explicitly via ioctl. For example, the upcoming non-contig and non-coherent buffer handling would need an explicit sync, and this needs to catch the applptr and hwptr changes. Also, ASoC SOF driver will have the SPIB support that has the similar requirement for the explicit control of the applptr and hwptr. This patch adds the new PCM hardware info flag, SNDRV_PCM_INFO_EXPLICIT_SYNC. When this flag is set, PCM core disables both the control and the status mmap, which enforces user-space to update via SYNC_PTR ioctl. In that way, drivers can catch the applptr and hwptr update and apply the sync operation if needed. Link: https://lore.kernel.org/r/20210812113818.6479-1-tiwai@suse.de Link: https://lore.kernel.org/r/20210610205326.1176400-1-pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210813082142.5375-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7ac2246f5670f42a3aac3eb05d23112f6ecfd4de Author: Damien Zammit Date: Fri Aug 13 21:34:02 2021 +1000 ALSA: usb-audio: Input source control - digidesign mbox This adds a second mixer control to Digidesign Mbox to select between Analog/SPDIF capture. Users will note that selecting the SPDIF input source automatically switches the clock mode to sync to SPDIF, which is a feature of the hardware. (You can change the clock source back to internal if you want to capture from spdif but not sync to its clock although this mode is probably not recommended). Unfortunately, starting the stream resets both modes to Internally clocked and Analog input mode. Signed-off-by: Damien Zammit Tested-by: Damien Zammit Link: https://lore.kernel.org/r/20210813113402.11849-1-damien@zamaudio.com Signed-off-by: Takashi Iwai commit 28b05a64e47cbceebb8a5f3f643033148d5c06c3 Author: Jianqun Xu Date: Thu Aug 5 14:01:02 2021 +0200 soc: rockchip: io-domain: add rk3568 support The io-domain registers on RK3568 SoCs have three separated bits to enable/disable the 1.8v/2.5v/3.3v power. This patch make the write to be a operation, allow rk3568 uses a private register set function. Since the 2.5v mode hasn't been fully validated yet, the driver only sets 1.8v [enable] + 3.3v [disable] for 1.8v mode 1.8v [disable] + 3.3v [enable] for 3.3v mode There is not register order requirement which has been cleared by our IC team. For future reference the full usage matrix including the 2.5V setting is: case V33 V25 V18 result 0 0 0 0 IO safe, but cannot work 1 0 0 1 IO require 1.8V, should < 1.98V, otherwise IO may damage 2 0 1 0 IO require 2.5V, should < 2.75V, otherwise IO may damage 3 0 1 1 Invalid state, should avoid 4 1 0 0 IO require 3.3V, should < 3.63V, otherwise IO may damage 5 1 0 1 IO require 1.8V, should < 1.98V, otherwise IO may damage 6 1 1 0 IO require 2.5V, should < 2.75V, otherwise IO may damage 7 1 1 1 Invalid state, should avoid Signed-off-by: Jianqun Xu Tested-by: Peter Geis [added mode clarification from Jay] Link: https://lore.kernel.org/r/20210805120107.27007-3-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit fadbd4e7847905d61dd333a0d3d31654f4510bc6 Author: Michael Riesch Date: Thu Aug 5 14:01:01 2021 +0200 dt-bindings: power: add rk3568-pmu-io-domain support Add binding for the RK3568 along a SoC-specific description of voltage supplies. Signed-off-by: Jianqun Xu [add soc-specific section] Signed-off-by: Michael Riesch Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210805120107.27007-2-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 0fdedc09af18d231aa581331821c9ab6ef0903f1 Author: Mathew McBride Date: Tue Aug 10 05:38:27 2021 +0000 dt-bindings: arm: fsl: Add Traverse Ten64 (LS1088A) board Document the compatible for the Ten64 board which will be included as freescale/fsl-ls1088a-ten64.dtb in arm64. Signed-off-by: Mathew McBride Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 94f84698437591e218f8b449a56fd065408d636e Author: Mathew McBride Date: Tue Aug 10 05:38:26 2021 +0000 dt-bindings: vendor-prefixes: add Traverse Technologies Traverse Technologies is a designer and manufacturer of networking appliances. Signed-off-by: Mathew McBride Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 418962eea35869b8e07766d8728ae660d75800a9 Author: Mathew McBride Date: Tue Aug 10 05:38:28 2021 +0000 arm64: dts: add device tree for Traverse Ten64 (LS1088A) The Traverse Technologies Ten64 is a Mini-ITX form factor networking board using the NXP LS1088A SoC. This device tree only describes features which the mainline kernel currently has support for, such as some I2C-connected devices that are not described at present. System documentation may be found at ten64doc.traverse.com.au Signed-off-by: Mathew McBride Reviewed-by: Ioana Ciornei # for the MAC/PHY Signed-off-by: Shawn Guo commit 2cfad132b5013c935262a2050f82981ec55de3f8 Author: Mathew McBride Date: Tue Aug 10 05:38:25 2021 +0000 arm64: dts: ls1088a: add missing PMU node The Performance Manager Unit was not described in the DTS which meant performance event monitoring was not possible. This was exposed by a change to the PMU handling in KVM in 5.11-rc3 which now prevents a PMU being exposed to a guest when the host does not provide one: "KVM: arm64: Don't access PMCR_EL0 when no PMU is available" Signed-off-by: Mathew McBride Signed-off-by: Shawn Guo commit e3f9eb037c41fc8139b1dbae4f40064afa76005e Author: Mathew McBride Date: Tue Aug 10 05:38:24 2021 +0000 arm64: dts: ls1088a: add internal PCS for DPMAC1 node A previous patch added the PCS for DPMAC2 only, as used for the AQR PHY on the LS1088ARDB. DPMAC1 PCS access is required for PHYLINK SFP support on the Traverse Ten64 board. Signed-off-by: Mathew McBride Reviewed-by: Ioana Ciornei Signed-off-by: Shawn Guo commit 87a8c7164022d2e5c558bc0e14075c7a50af7f95 Author: Oleksij Rempel Date: Wed Aug 11 09:38:35 2021 +0200 ARM: dts: imx6qp-prtwd3: configure ENET_REF clock to 125MHz By default ENET_REF is configured to 50MHz, which is usable for the RMII link. In case RGMII is used, we need 125MHz clock. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 85b5d85ce1fb8aac5a38254672bd4db66bef5332 Author: Aswath Govindraju Date: Tue Aug 10 12:14:20 2021 +0530 ARM: dts: vf610-zii-dev-rev-b: Remove #address-cells and #size-cells property from at93c46d dt node Remove #address-cells and #size-cells property from at93c46d device tree node as it does not have child nodes. Fixes: 1556063fde42 ("ARM: dts: vf610-zii-dev: Add ZII development board.") Signed-off-by: Aswath Govindraju Reviewed-by: Andrew Lunn Signed-off-by: Shawn Guo commit 7fd19c58e48fb774de9190f27f2b06a6526f2d3c Author: Pascal Zimmermann Date: Thu Aug 5 15:50:35 2021 +0200 ARM: imx_v6_v7_defconfig: enable driver of the LTC3676 PMIC The LTC3676 is a PMIC which is used on some i.MX6 based boards (like the DHCOM i.MX6 Quad SoM), it was first used on the GW Ventana board, enable LTC3676 driver in imx_v6_v7_defconfig. Signed-off-by: Pascal Zimmermann Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Marek Vasut Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Reviewed-by: Marek Vasut Tested-by: Marek Vasut # On DH iMX6Q DHCOM PDK2 Signed-off-by: Shawn Guo commit b1111358e1e8aec3bdb0a662dfabf8dc1fdd7c2e Author: Sam Ravnborg Date: Wed Aug 4 06:34:39 2021 +0200 ARM: dts: add SKOV imx6q and imx6dl based boards Add SKOV imx6q/dl LT2, LT6 and mi1010ait-1cp1 boards. Signed-off-by: Sam Ravnborg Signed-off-by: Søren Andersen Signed-off-by: Juergen Borleis Signed-off-by: Ulrich Ölmann Signed-off-by: Michael Grzeschik Signed-off-by: Marco Felsch Signed-off-by: Lucas Stach Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 23ee064a20e10f5df3ff75e5d4161f31c693ab11 Author: Oleksij Rempel Date: Wed Aug 4 06:34:38 2021 +0200 dt-bindings: arm: fsl: add SKOV imx6q and imx6dl based boards Add SKOV imx6q/dl LT2, LT6 and mi1010ait-1cp1 boards. Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Shawn Guo commit a756f1b6e34a9536be5961fcad33f6c1948b0fa5 Author: Oleksij Rempel Date: Wed Aug 4 06:34:37 2021 +0200 dt-bindings: vendor-prefixes: Add an entry for SKOV A/S Add "skov" entry for the SKOV A/S: https://www.skov.com/en/ Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 6a47c304316d281677d94fbe92ce544a2e0472d3 Author: Lucas Stach Date: Thu Aug 12 21:47:12 2021 +0200 arm64: dts: imx8mq-reform2: add sound support This adds sound support to the Reform2. It differs from the downstream implementation in that the codec is used as the BCLK and FSYNC master and the i.MX8MQ only supplies a fixed 25MHz MCLK from the oscillator. This allows to support a wider range of audio rates by using the codec PLL and to shut down the audio PLLs on the i.MX8MQ SoC side. Signed-off-by: Lucas Stach Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit d4efa65f30ac84c239ca52f1199301af6b54f68f Author: Peng Fan Date: Sat Aug 7 17:45:37 2021 +0800 arm64: dts: imx8m: drop interrupt-affinity for pmu i.MX8M use PPI for pmu, interrupt-affinity is not needed. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 16ce4ce32dc872a12941dcdcc5330797085f4091 Author: Peng Fan Date: Sat Aug 7 17:45:36 2021 +0800 arm64: dts: imx8qxp: update pmu compatible i.MX8QXP features four Cortex-A35 cores, use more accurate compatible. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit ceec36ee0d156e87f5a49d9f33dd599df6e2e233 Author: Peng Fan Date: Sat Aug 7 17:45:35 2021 +0800 arm64: dts: imx8mm: update pmu compatible i.MX8MM features four Cortex-A53 cores, update the compatible to use more accurate "arm,cortex-a53-pmu" Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit c1a6018d1839c9cb8f807dc863a50102a1a5c412 Author: Raag Jadav Date: Thu Aug 5 00:54:45 2021 +0530 arm64: dts: ls1046a: fix eeprom entries ls1046afrwy and ls1046ardb boards have CAT24C04[1] and CAT24C05[2] eeproms respectively. Both are 4Kb (512 bytes) in size, and compatible with AT24C04[3]. Remove multi-address entries, as both the boards have a single chip each. [1] https://www.onsemi.com/pdf/datasheet/cat24c01-d.pdf [2] https://www.onsemi.com/pdf/datasheet/cat24c03-d.pdf [3] https://ww1.microchip.com/downloads/en/DeviceDoc/doc0180.pdf Signed-off-by: Raag Jadav Acked-by: Li Yang Signed-off-by: Shawn Guo commit a9c577822e98c68f50031b3202c23be66b1ee6a4 Author: Tim Harvey Date: Tue Jul 27 09:11:01 2021 -0700 arm64: dts: imx8mm-venice-gw7901: enable pull-down on gpio outputs Enable internal pull-down on UART transceiver GPIO config pins. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 590dc51bcaf2cb8bb5a6f3c68269fd660e6fad84 Author: Tim Harvey Date: Tue Jul 27 09:11:00 2021 -0700 arm64: dts: imx8mm-venice-gw7901: add support for USB hub subload The USB hub has it's reset as GPIO4_IO17 but can be sub-loaded and VBUS provided by a VBUS regulator with GPIO4_IO2 as the enable and GPIO1_IO15 as the active-low over-current. Enable pull-up for GPIO4_IO17 to keep hub out of reset and move VBUS enable to GPIO4_IO2. Additionally enable pull-up on GPIO1_IO15 so that if the hub is loaded it never over-currents. This allows USB to work in both configurations without a device-tree change. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit bd306fdb4e60bcb1d7ea5431a74092803d3784a6 Author: Tim Harvey Date: Tue Jul 27 09:10:59 2021 -0700 arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS The GW71xx has a USB Type-C connector with USB 2.0 signaling. GPIO1_12 is the power-enable to the TPS25821 Source controller and power switch responsible for monitoring the CC pins and enabling VBUS. Therefore GPIO1_12 must always be enabled and the vbus output enable from the IMX8MM can be ignored. To fix USB OTG VBUS enable a pull-up on GPIO1_12 to always power the TPS25821 and change the regulator output to GPIO1_10 which is unconnected. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 500659f3b401fe6ffd1d63f2449d16d8a4204db7 Author: Tim Harvey Date: Tue Jul 27 09:10:58 2021 -0700 arm64: dts: imx8mm-venice-gw700x: fix invalid pmic pin config The GW700x PMIC does not have an interrupt. Remove the invalid pin config. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 092cd75e527044050ea76bf774e7d730709b7e8b Author: Tim Harvey Date: Tue Jul 27 09:10:57 2021 -0700 arm64: dts: imx8mm-venice-gw700x: fix mp5416 pmic config Fix various MP5416 PMIC configurations: - Update regulator names per dt-bindings - ensure values fit among valid register values - add required regulator-max-microamp property - add regulator-always-on prop Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit bcadd5f66c2afa1b5e71b7a1e1b4594f7aed0ea4 Author: Martin Kepplinger Date: Mon Jul 26 10:21:17 2021 +0200 arm64: dts: imx8mq: add mipi csi phy and csi bridge descriptions Describe the 2 available CSI interfaces on the i.MX8MQ with the MIPI-CSI2 receiver (new driver) and the CSI Bridge that provides the user buffers (existing driver). An image sensor is to be connected to the MIPIs' second port, to be described in board files. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit ef484dfcf6f789dd6ababb6f47c6e84d87e6bd18 Author: Tim Harvey Date: Fri Jul 23 11:41:16 2021 -0700 arm64: dts: imx: Add i.mx8mm/imx8mn Gateworks gw7902 dts support The GW7902 is based on the i.MX 8M Mini / Nano SoC featuring: - LPDDR4 DRAM - eMMC FLASH - Gateworks System Controller - LTE CAT M1 modem - USB 2.0 HUB - M.2 Socket with USB2.0, PCIe, and dual-SIM - IMX8M FEC - PCIe based GbE - RS232/RS485/RS422 serial transceiver - GPS - CAN bus - WiFi / Bluetooth - MIPI header (DSI/CSI/GPIO/PWM/I2S) - PMIC Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit bc3ab388ee84812c2f217965b92fd5e1a4a712f2 Author: Daniel Baluta Date: Fri Jul 23 14:05:40 2021 +0300 arm64: dts: imx8mp: Add dsp node i.MX8 MPlus SoC integrates Cadence HIFI4 DSP. This core runs either a custom firmware or the open source SOF firmware [1] DSP device is handled by SOF OF driver found in sound/soc/sof/sof-of-dev.c Notice that the DSP node makes use of: - dsp_reserved, a reserved memory region for various Audio resources (e.g firmware loading, audio buffers, etc). - Messaging Unit (mu2) for passing notifications betweem ARM core and DSP. [1] https://thesofproject.github.io/latest/platforms/index.html Signed-off-by: Daniel Baluta Signed-off-by: Shawn Guo commit 78e80c4b4238c1f5642b975859664fced4f9c69e Author: Marek Vasut Date: Wed Jul 21 18:39:55 2021 +0200 arm64: dts: imx8m: Replace deprecated fsl,usbphy DT props with phys The fsl,usbphy DT property is deprecated, replace it with phys DT property and specify #phy-cells. No functional change. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP Linux Team Cc: Shawn Guo To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 5ff554dd5c241b36e9bb528c145391b465554e2d Author: Kwon Tae-young Date: Thu Jul 15 16:07:49 2021 +0900 arm64: dts: imx8mq-evk: Remove unnecessary blank lines Unnecessary blank lines do NOT help readability, so remove them. Signed-off-by: Kwon Tae-young Signed-off-by: Shawn Guo commit 7e5f3146670fadc9736c7a445a666a1c31957506 Author: Kwon Tae-young Date: Thu Jul 15 15:54:31 2021 +0900 arm64: dts: imx8mq-evk: add CD pinctrl for usdhc2 Add CD pinctrl for usdhc2. Signed-off-by: Kwon Tae-young Signed-off-by: Shawn Guo commit d05cd0dcb4dbc54dd442ce7a7924423740bb4160 Author: Fabio Estevam Date: Sat Jul 10 09:39:41 2021 -0300 arm64: dts: imx8mm-venice-gw7901: Remove unnecessary #address-cells/#size-cells The following dtc build warning is seen with W=1: arch/arm64/boot/dts/freescale/imx8mm-venice-gw7901.dts:291.14-397.4: Warning (avoid_unnecessary_addr_size): /soc@0/bus@30800000/i2c@30a20000/gsc@20: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Remove the unnecessary #address-cells/#size-cells to fix it. Signed-off-by: Fabio Estevam Reviewed-By: Tim Harvey Signed-off-by: Shawn Guo commit 5bb279171afc4a1617fa86f4abc1f9e75fe31db7 Author: Mirela Rabulea Date: Sat Jun 19 17:36:11 2021 +0300 arm64: dts: imx8: Add jpeg encoder/decoder nodes Add dts for imaging subsytem, include jpeg nodes here. Tested on imx8qxp/qm. Signed-off-by: Mirela Rabulea Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit d6ce0bfaf9ce8f8e58436760f8e55ef0602defad Author: Kwon Tae-young Date: Fri Jun 18 16:27:33 2021 +0900 arm64: dts: imx8qxp-ai_ml: Fix checkpatch warnings Fix the following warnings reported by checkpatch: arch/..../imx8qxp-ai_ml.dts:198: WARNING: please, no space before tabs Signed-off-by: Kwon Tae-young Signed-off-by: Shawn Guo commit 16fe55ba95323fe8de88b258e7f51f37b79d54b0 Author: Ioana Ciornei Date: Tue Jun 15 19:03:37 2021 +0300 arm64: dts: ls1088ardb: update PHY nodes with IRQ information Describe the IRQs for both the QSGMII PHYs and the 10GBASE-R PHY found on the LS1088ARDB board. Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit 915622ce17f96fdf08fd3170507bb006aadfc374 Author: Ioana Ciornei Date: Tue Jun 15 19:03:36 2021 +0300 arm64: dts: ls2088ardb: update PHY nodes with IRQ information Update the DTS nodes corresponding to the 4 10GBASE-R PHYs to describe their IRQ lines. Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit 0c1ed5e704436db4b2352004f4c5e821f81c7627 Author: Ioana Ciornei Date: Tue Jun 15 19:03:35 2021 +0300 arm64: dts: lx2160ardb: update PHY nodes with IRQ information Update the DTS nodes for both the AR8035 and the AQR107 PHYs in order to describe their IRQ lines. Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit 8ba1a8b77ba1eb3aef441ed2caf28ab2b1261f5f Author: Kefeng Wang Date: Fri Jul 30 20:48:41 2021 +0800 riscv: Support allocating gigantic hugepages using CMA This patch adds support to allocate gigantic hugepages using CMA by specifying the hugetlb_cma= kernel parameter. This is only supported on RV64. Reviewed-by: Alexandre Ghiti Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit faff1cca3b8bd730c31f9ceaef8ff43b3a5935f5 Merge: d164dd9a5c08c 6a3a3dcc3f0e5 Author: Andrii Nakryiko Date: Fri Aug 13 17:49:24 2021 -0700 Merge branch 'bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SOCKOPT' Stanislav Fomichev says: ==================== We'd like to be able to identify netns from setsockopt hooks to be able to do the enforcement of some options only in the "initial" netns (to give users the ability to create clear/isolated sandboxes if needed without any enforcement by doing unshare(net)). v3: - remove extra 'ctx->skb == NULL' check (Martin KaFai Lau) - rework test to make sure the helper is really called, not just verified v2: - add missing CONFIG_NET ==================== Signed-off-by: Andrii Nakryiko commit 6a3a3dcc3f0e5dde3c9417f0419ff8efbab60c60 Author: Stanislav Fomichev Date: Fri Aug 13 16:05:30 2021 -0700 selftests/bpf: Verify bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SOCKOPT Add extra calls to sockopt_sk.c. Signed-off-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210813230530.333779-3-sdf@google.com commit f1248dee954c2ddb0ece47a13591e5d55d422d22 Author: Stanislav Fomichev Date: Fri Aug 13 16:05:29 2021 -0700 bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SOCKOPT This is similar to existing BPF_PROG_TYPE_CGROUP_SOCK and BPF_PROG_TYPE_CGROUP_SOCK_ADDR. Signed-off-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210813230530.333779-2-sdf@google.com commit e5f31552674e88bff3a4e3ca3e5357668b5f2973 Author: Arnd Bergmann Date: Thu Aug 12 20:33:58 2021 +0200 ethernet: fix PTP_1588_CLOCK dependencies The 'imply' keyword does not do what most people think it does, it only politely asks Kconfig to turn on another symbol, but does not prevent it from being disabled manually or built as a loadable module when the user is built-in. In the ICE driver, the latter now causes a link failure: aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl': ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config' ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config' aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config' ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config' aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset': ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release' ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release' aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild': This is a recurring problem in many drivers, and we have discussed it several times befores, without reaching a consensus. I'm providing a link to the previous email thread for reference, which discusses some related problems. To solve the dependency issue better than the 'imply' keyword, introduce a separate Kconfig symbol "CONFIG_PTP_1588_CLOCK_OPTIONAL" that any driver can depend on if it is able to use PTP support when available, but works fine without it. Whenever CONFIG_PTP_1588_CLOCK=m, those drivers are then prevented from being built-in, the same way as with a 'depends on PTP_1588_CLOCK || !PTP_1588_CLOCK' dependency that does the same trick, but that can be rather confusing when you first see it. Since this should cover the dependencies correctly, the IS_REACHABLE() hack in the header is no longer needed now, and can be turned back into a normal IS_ENABLED() check. Any driver that gets the dependency wrong will now cause a link time failure rather than being unable to use PTP support when that is in a loadable module. However, the two recently added ptp_get_vclocks_index() and ptp_convert_timestamp() interfaces are only called from builtin code with ethtool and socket timestamps, so keep the current behavior by stubbing those out completely when PTP is in a loadable module. This should be addressed properly in a follow-up. As Richard suggested, we may want to actually turn PTP support into a 'bool' option later on, preventing it from being a loadable module altogether, which would be one way to solve the problem with the ethtool interface. Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices") Link: https://lore.kernel.org/netdev/20210804121318.337276-1-arnd@kernel.org/ Link: https://lore.kernel.org/netdev/CAK8P3a06enZOf=XyZ+zcAwBczv41UuCTz+=0FMf2gBz1_cOnZQ@mail.gmail.com/ Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw@mail.gmail.com/ Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd@kernel.org/ Acked-by: Shannon Nelson Acked-by: Jacob Keller Acked-by: Richard Cochran Reviewed-by: Vladimir Oltean Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210812183509.1362782-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit ce9570657d45d6387a68d7f419fe70d085200a2f Author: Fengquan Chen Date: Fri Apr 9 17:22:42 2021 +0800 clocksource/drivers/mediatek: Optimize systimer irq clear flow on shutdown mtk_syst_clkevt_shutdown is called after irq disabled in suspend flow, clear any pending systimer irq when shutdown to avoid suspend aborted due to timer irq pending Also as for systimer in mediatek socs, there must be firstly enable timer before clear systimer irq Fixes: e3af677607d9("clocksource/drivers/timer-mediatek: Add support for system timer") Signed-off-by: Fengquan Chen Tested-by: Hsin-Yi Wang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1617960162-1988-2-git-send-email-Fengquan.Chen@mediatek.com commit 3b87265d825a2d29eb6b67511f0e7ed62225cd97 Author: 周琰杰 (Zhou Yanjie) Date: Fri Jul 30 17:43:08 2021 +0800 clocksource/drivers/ingenic: Use bitfield macro helpers Use "FIELD_GET()" and "FIELD_PREP()" to simplify the code. [dlezcano] : Changed title Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1627638188-116163-1-git-send-email-zhouyanjie@wanyeetech.com commit b697d9d38a5a5ab405d7cc4743d39fe2c5d7517c Author: Ivan Bornyakov Date: Thu Aug 12 16:42:56 2021 +0300 net: phy: marvell: add SFP support for 88E1510 Add support for SFP cages connected to the Marvell 88E1512 transceiver. 88E1512 supports for SGMII/1000Base-X/100Base-FX media type with RGMII on system interface. Configure PHY to appropriate mode depending on the type of SFP inserted. On SFP removal configure PHY to the RGMII-copper mode so RJ-45 port can still work. Signed-off-by: Ivan Bornyakov Link: https://lore.kernel.org/r/20210812134256.2436-1-i.bornyakov@metrotek.ru Signed-off-by: Jakub Kicinski commit d164dd9a5c08c16a883b3de97d13948c7be7fa4d Author: Ilya Leoshkevich Date: Fri Aug 13 00:48:14 2021 +0200 selftests/bpf: Fix test_core_autosize on big-endian machines The "probed" part of test_core_autosize copies an integer using bpf_core_read() into an integer of a potentially different size. On big-endian machines a destination offset is required for this to produce a sensible result. Fixes: 888d83b961f6 ("selftests/bpf: Validate libbpf's auto-sizing of LD/ST/STX instructions") Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210812224814.187460-1-iii@linux.ibm.com commit a44fc4b6afc2ee9d186a2dcca64b5eaabab969d1 Merge: 593f8c44cc8b2 f75d81556a38b Author: Jakub Kicinski Date: Fri Aug 13 16:30:37 2021 -0700 Merge branch 'kconfig-symbol-clean-up-on-net' Lukas Bulwahn says: ==================== Kconfig symbol clean-up on net The script ./scripts/checkkconfigsymbols.py warns on invalid references to Kconfig symbols (often, minor typos, name confusions or outdated references). This patch series addresses all issues reported by ./scripts/checkkconfigsymbols.py in ./net/ and ./drivers/net/ for Kconfig and Makefile files. Issues in the Kconfig and Makefile files indicate some shortcomings in the overall build definitions, and often are true actionable issues to address. These issues can be identified and filtered by: ./scripts/checkkconfigsymbols.py \ | grep -E "(drivers/)?net/.*(Kconfig|Makefile)" -B 1 -A 1 After applying this patch series on linux-next (next-20210811), the command above yields no further issues to address. ==================== Link: https://lore.kernel.org/r/20210812083806.28434-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit f75d81556a38b1b30a798924ac080e3a1523726a Author: Lukas Bulwahn Date: Thu Aug 12 10:38:06 2021 +0200 net: dpaa_eth: remove dead select in menuconfig FSL_DPAA_ETH The menuconfig FSL_DPAA_ETH selects config FSL_FMAN_MAC, but the config FSL_FMAN_MAC never existed in the kernel tree. Hence, ./scripts/checkkconfigsymbols.py warns: FSL_FMAN_MAC Referencing files: drivers/net/ethernet/freescale/dpaa/Kconfig Remove this dead select in menuconfig FSL_DPAA_ETH. Fixes: 9ad1a3749333 ("dpaa_eth: add support for DPAA Ethernet") Signed-off-by: Lukas Bulwahn Acked-by: Madalin Bucur Signed-off-by: Jakub Kicinski commit d8d9ba8dc9c77358cd7ea73e4e44e8952c9baf35 Author: Lukas Bulwahn Date: Thu Aug 12 10:38:05 2021 +0200 net: 802: remove dead leftover after ipx driver removal Commit 7a2e838d28cf ("staging: ipx: delete it from the tree") removes the ipx driver and the config IPX. Since then, there is some dead leftover in ./net/802/, that was once used by the IPX driver, but has no other user. Remove this dead leftover. Signed-off-by: Lukas Bulwahn Signed-off-by: Jakub Kicinski commit 4fb464db9c72ae671c3f332d9a8d0381557271ce Author: Lukas Bulwahn Date: Thu Aug 12 10:38:04 2021 +0200 net: Kconfig: remove obsolete reference to config MICROBLAZE_64K_PAGES Commit 05cdf457477d ("microblaze: Remove noMMU code") removes config MICROBLAZE_64K_PAGES in arch/microblaze/Kconfig. However, there is still a reference to MICROBLAZE_64K_PAGES in the config VMXNET3 in ./drivers/net/Kconfig. Remove this obsolete reference to config MICROBLAZE_64K_PAGES. Signed-off-by: Lukas Bulwahn Signed-off-by: Jakub Kicinski commit 593f8c44cc8b2290ca122315ba57c3d90ee6e812 Author: Hari Prasath Date: Thu Aug 12 13:14:22 2021 +0530 dt-bindings: net: macb: add documentation for sama5d29 ethernet interface Add documentation for SAMA5D29 ethernet interface. Signed-off-by: Hari Prasath Link: https://lore.kernel.org/r/20210812074422.13487-2-Hari.PrasathGE@microchip.com Signed-off-by: Jakub Kicinski commit 7d13ad501169d129e73a52f240572d0c818b68f7 Author: Hari Prasath Date: Thu Aug 12 13:14:21 2021 +0530 net: macb: Add PTP support for SAMA5D29 Add PTP capability to the macb config object for sama5d29. Signed-off-by: Hari Prasath Link: https://lore.kernel.org/r/20210812074422.13487-1-Hari.PrasathGE@microchip.com Signed-off-by: Jakub Kicinski commit b7cdc9658ac860f0dff55bf2d6f6fc27ce17a0fa Author: Joakim Zhang Date: Thu Aug 12 15:09:48 2021 +0800 net: fec: add WoL support for i.MX8MQ By default FEC driver treat irq[0] (i.e. int0 described in dt-binding) as wakeup interrupt, but this situation changed on i.MX8M serials, SoC integration guys mix wakeup interrupt signal into int2 interrupt line. This patch introduces FEC_QUIRK_WAKEUP_FROM_INT2 to indicate int2 as wakeup interrupt for i.MX8MQ. Signed-off-by: Joakim Zhang Link: https://lore.kernel.org/r/20210812070948.25797-1-qiangqing.zhang@nxp.com Signed-off-by: Jakub Kicinski commit 44e5d08812805bcb0f37e18f6c4eab1174a9d053 Author: Geert Uytterhoeven Date: Wed Aug 11 17:49:00 2021 +0200 ravb: Remove checks for unsupported internal delay modes The EtherAVB instances on the R-Car E3/D3 and RZ/G2E SoCs do not support TX clock internal delay modes, and the EtherAVB driver prints a warning if an unsupported "rgmii-*id" PHY mode is specified, to catch buggy DTBs. Commit a6f51f2efa742df0 ("ravb: Add support for explicit internal clock delay configuration") deprecated deriving the internal delay mode from the PHY mode, in favor of explicit configuration using the now mandatory "rx-internal-delay-ps" and "tx-internal-delay-ps" properties, thus delegating the warning to the legacy fallback code. Since explicit configuration of a (valid) internal clock delay configuration is enforced by validating device tree source files against DT binding files, and all upstream DTS files have been converted as of commit a5200e63af57d05e ("arm64: dts: renesas: rzg2: Convert EtherAVB to explicit delay handling"), the checks in the legacy fallback code can be removed. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/2037542ac56e99413b9807e24049711553cc88a9.1628696778.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit b06a1ffe17addae1036c29aecd7071f00267bee7 Author: Pavel Skripkin Date: Wed Aug 11 20:13:21 2021 +0300 net: hso: drop unused function argument _hso_serial_set_termios() doesn't use it's second argument, so it can be dropped. Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20210811171321.18317-1-paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit 2211c825e7b6b99bbcabab4e0130a2779275dcc3 Author: Hao Luo Date: Wed Aug 11 17:38:19 2021 -0700 libbpf: Support weak typed ksyms. Currently weak typeless ksyms have default value zero, when they don't exist in the kernel. However, weak typed ksyms are rejected by libbpf if they can not be resolved. This means that if a bpf object contains the declaration of a nonexistent weak typed ksym, it will be rejected even if there is no program that references the symbol. Nonexistent weak typed ksyms can also default to zero just like typeless ones. This allows programs that access weak typed ksyms to be accepted by verifier, if the accesses are guarded. For example, extern const int bpf_link_fops3 __ksym __weak; /* then in BPF program */ if (&bpf_link_fops3) { /* use bpf_link_fops3 */ } If actual use of nonexistent typed ksym is not guarded properly, verifier would see that register is not PTR_TO_BTF_ID and wouldn't allow to use it for direct memory reads or passing it to BPF helpers. Signed-off-by: Hao Luo Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210812003819.2439037-1-haoluo@google.com commit 8cd99e3e22e208e027e60efd2bcbd293c48845ba Merge: a58b06083f789 c4c4637eb57f2 Author: Linus Walleij Date: Sat Aug 14 00:39:33 2021 +0200 Merge tag 'renesas-pinctrl-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.15 (take two) - Add pin control and GPIO support for the new RZ/G2L SoC. commit fb31f0a499332a053477ed57312b214e42476e6d Author: Kenneth Lee Date: Wed Jul 28 15:15:57 2021 +0800 riscv: fix the global name pfn_base confliction error RISCV uses a global variable pfn_base for page/pfn translation. But this is a common name and will be used elsewhere. In those cases, the page-pfn macros which refer to this name will be referred to the local/input variable instead. (such as in vfio_pin_pages_remote). This make everything wrong. This patch changes the name from pfn_base to riscv_pfn_base to fix this problem. Signed-off-by: Kenneth Lee Signed-off-by: Palmer Dabbelt commit cf7a5cba86fc2d3000c555b9568f7dd0f43bf0d4 Author: Jussi Maki Date: Wed Aug 11 12:36:27 2021 +0000 selftests/bpf: Fix running of XDP bonding tests An "innocent" cleanup in the last version of the XDP bonding patchset moved the "test__start_subtest" calls to the test main function, but I forgot to reverse the condition, which lead to all tests being skipped. Fix it. Fixes: 6aab1c81b98a ("selftests/bpf: Add tests for XDP bonding") Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210811123627.20223-1-joamaki@gmail.com commit afa79d08c6c8e1901cb1547591e3ccd3ec6965d9 Author: Changbin Du Date: Fri Aug 13 22:57:49 2021 +0800 net: in_irq() cleanup Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq(). Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20210813145749.86512-1-changbin.du@gmail.com Signed-off-by: Jakub Kicinski commit 39a0876d595bd7c7512782dfcce0ee66f65bf221 Author: Jussi Maki Date: Thu Aug 12 14:52:41 2021 +0000 net, bonding: Disallow vlan+srcmac with XDP The new vlan+srcmac xmit policy is not implementable with XDP since in many cases the 802.1Q payload is not present in the packet. This can be for example due to hardware offload or in the case of veth due to use of skbuffs internally. This also fixes the NULL deref with the vlan+srcmac xmit policy reported by Jonathan Toppins by additionally checking the skb pointer. Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff") Reported-by: Jonathan Toppins Signed-off-by: Jussi Maki Reviewed-by: Jonathan Toppins Link: https://lore.kernel.org/r/20210812145241.12449-1-joamaki@gmail.com Signed-off-by: Jakub Kicinski commit 6e4df4c6488165637b95b9701cc862a42a3836ba Author: Christoph Hellwig Date: Wed Aug 11 14:44:28 2021 +0200 nbd: reduce the nbd_index_mutex scope nbd_index_mutex is currently held over add_disk and inside ->open, which leads to lock order reversals. Refactor the device creation code path so that nbd_dev_add is called without nbd_index_mutex lock held and only takes it for the IDR insertation. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-7-hch@lst.de [axboe: fix whitespace] Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 6177b56c96ff3b5e23d47f6b6c8630f31145da93 Author: Christoph Hellwig Date: Wed Aug 11 14:44:27 2021 +0200 nbd: refactor device search and allocation in nbd_genl_connect Use idr_for_each_entry instead of the awkward callback to find an existing device for the index == -1 case, and de-duplicate the device allocation if no existing device was found. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-6-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 7bdc00cf7e369b3be17f26e5643da28de98d9d6d Author: Christoph Hellwig Date: Wed Aug 11 14:44:26 2021 +0200 nbd: return the allocated nbd_device from nbd_dev_add Return the device we just allocated instead of doing an extra search for it in the caller. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-5-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 327b501b1d94342fe17a1b6b1a40746e57ddd472 Author: Christoph Hellwig Date: Wed Aug 11 14:44:25 2021 +0200 nbd: remove nbd_del_disk Fold nbd_del_disk and remove the pointless NULL check on ->disk given that it is always set for a successfully allocated nbd_device structure. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-4-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 3f74e0645c52a08f640380c9c46f9a3a172b9389 Author: Christoph Hellwig Date: Wed Aug 11 14:44:24 2021 +0200 nbd: refactor device removal Share common code for the synchronous and workqueue based device removal, and remove the pointless use of refcount_dec_and_mutex_lock. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-3-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 68c9417b193d0d174b0ada013602272177e61303 Author: Hou Tao Date: Wed Aug 11 14:44:23 2021 +0200 nbd: do del_gendisk() asynchronously for NBD_DESTROY_ON_DISCONNECT Now open_mutex is used to synchronize partition operations (e.g, blk_drop_partitions() and blkdev_reread_part()), however it makes nbd driver broken, because nbd may call del_gendisk() in nbd_release() or nbd_genl_disconnect() if NBD_CFLAG_DESTROY_ON_DISCONNECT is enabled, and deadlock occurs, as shown below: // AB-BA dead-lock nbd_genl_disconnect blkdev_open nbd_disconnect_and_put lock bd_mutex // last ref nbd_put lock nbd_index_mutex del_gendisk nbd_open try lock nbd_index_mutex try lock bd_mutex or // AA dead-lock nbd_release lock bd_mutex nbd_put try lock bd_mutex Instead of fixing block layer (e.g, introduce another lock), fixing the nbd driver to call del_gendisk() in a kworker when NBD_DESTROY_ON_DISCONNECT is enabled. When NBD_DESTROY_ON_DISCONNECT is disabled, nbd device will always be destroy through module removal, and there is no risky of deadlock. To ensure the reuse of nbd index succeeds, moving the calling of idr_remove() after del_gendisk(), so if the reused index is not found in nbd_index_idr, the old disk must have been deleted. And reusing the existing destroy_complete mechanism to ensure nbd_genl_connect() will wait for the completion of del_gendisk(). Also adding a new workqueue for nbd removal, so nbd_cleanup() can ensure all removals complete before exits. Reported-by: syzbot+0fe7752e52337864d29b@syzkaller.appspotmail.com Fixes: c76f48eb5c08 ("block: take bd_mutex around delete_partitions in del_gendisk") Signed-off-by: Hou Tao Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210811124428.2368491-2-hch@lst.de Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit acd8e8407b8fcc3229d6d8558cac338bea801aed Author: David Gow Date: Tue Aug 3 22:08:08 2021 -0700 kunit: Print test statistics on failure When a number of tests fail, it can be useful to get higher-level statistics of how many tests are failing (or how many parameters are failing in parameterised tests), and in what cases or suites. This is already done by some non-KUnit tests, so add support for automatically generating these for KUnit tests. This change adds a 'kunit.stats_enabled' switch which has three values: - 0: No stats are printed (current behaviour) - 1: Stats are printed only for tests/suites with more than one subtest (new default) - 2: Always print test statistics For parameterised tests, the summary line looks as follows: " # inode_test_xtimestamp_decoding: pass:16 fail:0 skip:0 total:16" For test suites, there are two lines looking like this: "# ext4_inode_test: pass:1 fail:0 skip:0 total:1" "# Totals: pass:16 fail:0 skip:0 total:16" The first line gives the number of direct subtests, the second "Totals" line is the accumulated sum of all tests and test parameters. This format is based on the one used by kselftest[1]. [1]: https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/kselftest.h#L109 Signed-off-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 6a499c9c42d039ce9341a0c655a76c8dd56f0578 Author: Daniel Latypov Date: Thu Aug 5 16:51:44 2021 -0700 kunit: tool: make --raw_output support only showing kunit output --raw_output is nice, but it would be nicer if could show only output after KUnit tests have started. So change the flag to allow specifying a string ('kunit'). Make it so `--raw_output` alone will default to `--raw_output=all` and have the same original behavior. Drop the small kunit_parser.raw_output() function since it feels wrong to put it in "kunit_parser.py" when the point of it is to not parse anything. E.g. $ ./tools/testing/kunit/kunit.py run --raw_output=kunit ... [15:24:07] Starting KUnit Kernel ... TAP version 14 1..1 # Subtest: example 1..3 # example_simple_test: initializing ok 1 - example_simple_test # example_skip_test: initializing # example_skip_test: You should not see a line below. ok 2 - example_skip_test # SKIP this test should be skipped # example_mark_skipped_test: initializing # example_mark_skipped_test: You should see a line below. # example_mark_skipped_test: You should see this line. ok 3 - example_mark_skipped_test # SKIP this test should be skipped ok 1 - example [15:24:10] Elapsed time: 6.487s total, 0.001s configuring, 3.510s building, 0.000s running Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 6cb51a1874d0617579a6bf095b87a510f7dc07ba Author: Daniel Latypov Date: Thu Jul 15 09:08:19 2021 -0700 kunit: tool: add --kernel_args to allow setting module params kunit.py currently does not make it possible for users to specify module parameters (/kernel arguments more generally) unless one directly tweaks the kunit.py code itself. This hasn't mattered much so far, but this would make it easier to port existing tests that expose module parameters over to KUnit and/or let current KUnit tests take advantage of them. Tested using an kunit internal parameter: $ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit \ --kernel_args=kunit.filter_glob=kunit_status ... Testing complete. 2 tests run. 0 failed. 0 crashed. 0 skipped. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 1195505f5de2adfee5f277433f0b35498467cc64 Author: Uriel Guajardo Date: Fri Apr 2 14:21:31 2021 -0700 kunit: ubsan integration Integrates UBSAN into the KUnit testing framework. It fails KUnit tests whenever it reports undefined behavior. When CONFIG_KUNIT=n, nothing is printed or even formatted, so this has no behavioral impact outside of tests. kunit_fail_current_test() effectively does a pr_err() as well, so there's some slight duplication, but it also ensures an error is recorded in the debugfs entry for the running KUnit test. Print a shorter version of the message to make it less spammy. Co-developed-by: Daniel Latypov Signed-off-by: Daniel Latypov Signed-off-by: Uriel Guajardo Reviewed-by: Alan Maguire Signed-off-by: Shuah Khan commit b0d4adaf3b3c4402d9c3b6186e02aa1e4f7985cd Author: David Gow Date: Thu Apr 15 23:56:23 2021 -0700 fat: Add KUnit tests for checksums and timestamps Add some basic sanity-check tests for the fat_checksum() function and the fat_time_unix2fat() and fat_time_fat2unix() functions. These unit tests verify these functions return correct output for a number of test inputs. These tests were inspired by -- and serve a similar purpose to -- the timestamp parsing KUnit tests in ext4[1]. Note that, unlike fat_time_unix2fat, fat_time_fat2unix wasn't previously exported, so this patch exports it as well. This is required for the case where we're building the fat and fat_test as modules. Fixed minor checkpatch coding style errors and typos in commit log: Shuah Khan [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inode-test.c Signed-off-by: David Gow Acked-by: OGAWA Hirofumi Reviewed-by: Brendan Higgins Tested-by: Daniel Latypov Signed-off-by: Shuah Khan commit 1927ccdb79906e04c760ed7429c30a5c8054d1a7 Author: Yangtao Li Date: Tue Aug 10 21:27:06 2021 +0800 f2fs: correct comment in segment.h s/two/three Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b6d9246d0315c7379d06513cb8713534b7a4734f Author: Yangtao Li Date: Wed Aug 11 12:45:57 2021 +0800 f2fs: improve sbi status info in debugfs/f2fs/status Do not use numbers but strings to improve readability when flag is set. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit be83c3b6e7b8ff22f72827a613bf6f3aa5afadbb Author: Phong Hoang Date: Thu Apr 22 14:34:43 2021 +0200 clocksource/drivers/sh_cmt: Fix wrong setting if don't request IRQ for clock source channel If CMT instance has at least two channels, one channel will be used as a clock source and another one used as a clock event device. In that case, IRQ is not requested for clock source channel so sh_cmt_clock_event_program_verify() might work incorrectly. Besides, when a channel is only used for clock source, don't need to re-set the next match_value since it should be maximum timeout as it still is. On the other hand, due to no IRQ, total_cycles is not counted up when reaches compare match time (timer counter resets to zero), so sh_cmt_clocksource_read() returns unexpected value. Therefore, use 64-bit clocksoure's mask for 32-bit or 16-bit variants will also lead to wrong delta calculation. Hence, this mask should correspond to timer counter width, and above function just returns the raw value of timer counter register. Fixes: bfa76bb12f23 ("clocksource: sh_cmt: Request IRQ for clock event device only") Fixes: 37e7742c55ba ("clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines") Signed-off-by: Phong Hoang Signed-off-by: Niklas Söderlund Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210422123443.73334-1-niklas.soderlund+renesas@ragnatech.se commit 876c14ad014d0e39c57cbfde53e13d17cdb6d645 Author: Rao Shoaib Date: Wed Aug 11 15:06:52 2021 -0700 af_unix: fix holding spinlock in oob handling syzkaller found that OOB code was holding spinlock while calling a function in which it could sleep. Reported-by: syzbot+8760ca6c1ee783ac4abd@syzkaller.appspotmail.com Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Rao Shoaib Link: https://lore.kernel.org/r/20210811220652.567434-1-Rao.Shoaib@oracle.com Signed-off-by: Jakub Kicinski commit 0c77ec3da8c156d6d02ce0934b590cfe8a313cae Author: Pawel Dembicki Date: Thu Jun 24 11:18:12 2021 +0200 power: reset: linkstation-poweroff: add new device This commit introduces support for NETGEAR ReadyNAS Duo v2. This device use bit 4 of LED[2:0] Polarity Control Register to indicate AC Power loss. For more details about AC loss detection in NETGEAR ReadyNAS Duo v2, please look at the file: RND_5.3.13_WW.src/u-boot/board/mv_feroceon/mv_hal/usibootup/usibootup.c from Netgear GPL sources. Signed-off-by: Pawel Dembicki Signed-off-by: Sebastian Reichel commit e2f471efe1d607a7aff38ce53ec717cebe4283d6 Author: Pawel Dembicki Date: Thu Jun 24 11:18:11 2021 +0200 power: reset: linkstation-poweroff: prepare for new devices This commit prepare driver for another device support. New power_off_cfg structure describes two most important things: name of mdio bus and pointer to register setting function. It allow to add new device with different mdio bus node and other phy register config. Signed-off-by: Pawel Dembicki Signed-off-by: Sebastian Reichel commit ecdf7e7a1d669bc25e13e21b7beb8814f4636bdc Merge: 27a8ff4648f5f 0402e8ebb8b86 Author: Sebastian Reichel Date: Fri Aug 13 18:50:16 2021 +0200 Merge tag 'ib-mt6360-for-5.15-signed' into psy-next Immutable branch between regulator and power-supply for for 5.15 This immutable branch introduces the MT6360 charger driver, which requires a new linear range helper. Signed-off-by: Sebastian Reichel commit 31e53e137c5a1e48cd21b45089ca232d355d064c Merge: f84f6ee0366fe 0bd3c071e6e7e Author: Mark Brown Date: Fri Aug 13 17:49:06 2021 +0100 Merge series "ASoC: Intel: boards: use software node API" from Pierre-Louis Bossart : This is an update on an earlier contribution from Heikki Krogerus The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Thanks for Hans de Goede and Andy Shevchenko for their comments, suggestions and Reviewed-by tags on GitHub. The review thread can be found at https://github.com/thesofproject/linux/pull/3041) v3 changes: Fixed nit-picks from Andy: label, return value, missing commas/periods. Added Andy's Reviewed-by tag v2 changes: feedback from Andy and Hans Better error handling Codec reference is kept until the .remove callback Remove bus search to find device v1 changes from Heikki's patches: Avoid the use of devm_ routines for Baytrail machine drivers. Heikki Krogerus (1): ASoC: Intel: boards: use software node API in Atom boards Pierre-Louis Bossart (7): ASoC: Intel: boards: harden codec property handling ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev() ASoC: Intel: boards: get codec device with ACPI instead of bus search ASoC: Intel: sof_sdw: pass card information to init/exit functions ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove ASoC: Intel: use software node API in SoundWire machines ASoC: Intel: remove device_properties for Atom boards sound/soc/intel/boards/bytcht_es8316.c | 31 ++++++++-- sound/soc/intel/boards/bytcr_rt5640.c | 60 +++++++++++++++----- sound/soc/intel/boards/bytcr_rt5651.c | 63 ++++++++++++++------- sound/soc/intel/boards/sof_sdw.c | 20 ++++--- sound/soc/intel/boards/sof_sdw_common.h | 37 +++++++----- sound/soc/intel/boards/sof_sdw_max98373.c | 3 +- sound/soc/intel/boards/sof_sdw_rt1308.c | 3 +- sound/soc/intel/boards/sof_sdw_rt1316.c | 3 +- sound/soc/intel/boards/sof_sdw_rt5682.c | 3 +- sound/soc/intel/boards/sof_sdw_rt700.c | 3 +- sound/soc/intel/boards/sof_sdw_rt711.c | 51 +++++++++-------- sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 52 +++++++++-------- sound/soc/intel/boards/sof_sdw_rt715.c | 3 +- sound/soc/intel/boards/sof_sdw_rt715_sdca.c | 3 +- 14 files changed, 223 insertions(+), 112 deletions(-) -- 2.25.1 commit f84f6ee0366fe89d1673e3597b308538886e66d3 Merge: 6d9d1652de79e 26ac471c53545 Author: Mark Brown Date: Fri Aug 13 17:49:04 2021 +0100 Merge series "Add RZ/G2L Sound support" from Biju Das : This patch series aims to add ASoC support on RZ/G2L SoC's. It is based on the work done by Chris Brandt for RZ/A ASoC driver. v4->v5 * Moved validation of sample bits in hw_params * Removed validation of frame bits as it is redundant * split the rz_ssi_start_stop function into rz_ssi_start and rz_ssi_stop. * remove the spin_lock around rz_ssi_stream_init. * Updated dmas description and removed fixes as it is an enhancement now. * updated ssi_start functions with setting fifo thresholds and ssi_stop function with cancel all dma txn. v3->v4: * Updated the subject line as per style for the subsystem. * Removed select SND_SIMPLE_CARD from Kconfig * Added C++ comments for copyright and driver description. * Moved validation of channels in hw_params * removed asm issue reported by bot as well as Mark * replaced master/slave macros with provider/consumer macros * Improved locking and added more null pointer checks. v2->v3: * Fixed the dependency on KCONFIG * Merged the binding patch with dma feature added * Updated dt binding example with encoded #dma-cells value. * Improved Error handling in probe function * Removed the passing legacy channel configuration parameters from dmaengine_slave_config function * started using dma_request_chan instead of deprecated dma_request_slave_channel * Removed SoC dtsi and config patches from this series. Will send it later. v1->v2: * Rebased to latest rc kernel Biju Das (3): ASoC: sh: Add RZ/G2L SSIF-2 driver ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel configuration parameters ASoC: sh: rz-ssi: Add SSI DMAC support .../bindings/sound/renesas,rz-ssi.yaml | 22 +- sound/soc/sh/Kconfig | 6 + sound/soc/sh/Makefile | 4 + sound/soc/sh/rz-ssi.c | 1063 +++++++++++++++++ 4 files changed, 1093 insertions(+), 2 deletions(-) create mode 100644 sound/soc/sh/rz-ssi.c -- 2.17.1 commit 6d9d1652de79e190cefc40bb6cb1ea0c1dc1e874 Merge: a1ea05723c27a 246dd4287dfba Author: Mark Brown Date: Fri Aug 13 17:49:03 2021 +0100 Merge series "ASoC: SOF: Intel: DMI L1 power optimization for HDaudio platforms" from Pierre-Louis Bossart : This patchset provides an optimization that result in significant power savings on Intel HDAudio platforms using SOF (Sound Open Firmware). We previously prevented the Intel DSP from enabling the DMI_L1 capability to work-around issues with pause on capture streams. It turns out that this also prevented the platform from entering high C states in full-duplex usages such as videoconferencing - a rather basic use case since the start of the pandemic. The support for pause_push/release was already a bit controversial for Intel platforms, in theory platforms should only enable PAUSE if they can resume on the same sample, which is not the case on any Intel platform. With this patchset, when the user enables DMI L1 via a kernel parameter, the PAUSE support is disabled for capture streams. A kernel parameter is far from ideal but it's a placeholder until we have an API to negotiate capabilities between applications and driver, and it's far less confusing than a Kconfig option. Changes since v1: Removal of SPIB support since it may conflict with Takashi's memalloc changes. These SPIB changes will be provided after rebase. Addition of one cleanup for cppcheck warning Move all changes to intel/ directory, no changes in shared code Flipped the logic: the selection of DMI L1 disables PAUSE Pierre-Louis Bossart (4): ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description ASoC: SOF: Intel: hda-stream: remove always true condition ASoC: SOF: Intel: simplify logic for DMI_L1 handling ASoC: SOF: Intel: make DMI L1 selection more robust sound/soc/sof/intel/Kconfig | 10 ---------- sound/soc/sof/intel/hda-pcm.c | 16 ++++++++++++++-- sound/soc/sof/intel/hda-stream.c | 11 +++++------ 3 files changed, 19 insertions(+), 18 deletions(-) -- 2.25.1 commit 27a8ff4648f5f733026f43d991f651d5724bfa90 Author: Bruno Meneguele Date: Fri Jul 9 11:27:30 2021 -0300 power: supply: bq24735: reorganize ChargeOption command macros Rename ChargeOption macros to match the others for ChargeCurrent and ChargeVoltage and also separate the command & masks macros from the bits of interest macros for each command. This macro doesn't introduce any functional change, only code re-org. Signed-off-by: Bruno Meneguele Signed-off-by: Sebastian Reichel commit 2f5caa26a074854273194207a40b7ee81e51712d Author: Andreas Kemnade Date: Mon Jul 12 23:21:11 2021 +0200 power: supply: rn5t618: Add voltage_now property Read voltage_now via IIO and provide the property. Signed-off-by: Andreas Kemnade Reported-by: kernel test robot # missing depends on IIO Acked-by: Jonathan Cameron Signed-off-by: Sebastian Reichel commit 1a844ddf06b0a6f39c9d8974dfecfda347e87cb6 Author: Andreas Kemnade Date: Mon Jul 12 23:21:10 2021 +0200 iio: adc: rn5t618: Add iio map Add iio map to allow power driver to read out values as a consumer. This approach does not block later addition of devicetree support which would be helpful if there is an in-kernel consumer for AIN0/1. Signed-off-by: Andreas Kemnade Acked-by: Jonathan Cameron Signed-off-by: Sebastian Reichel commit 0402e8ebb8b869e375e8af7243044df21b5ff378 Author: Gene Chen Date: Mon Jul 19 11:39:14 2021 +0800 power: supply: mt6360_charger: add MT6360 charger support Add basic support for the battery charger for MT6360 PMIC Signed-off-by: Gene Chen Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit 23531eec79b659d12f28a6088f0b1ea94975a93c Author: Gene Chen Date: Mon Jul 19 11:39:13 2021 +0800 dt-bindings: power: Add bindings document for Charger support on MT6360 PMIC Add bindings document for Charger support on MT6360 PMIC Signed-off-by: Gene Chen Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit e12ef7bf34113f55c9bf444a680a15b6daf76f26 Author: Gene Chen Date: Mon Jul 19 11:39:12 2021 +0800 lib: add linear range get selector within Add linear range get selector within for choose closest selector between minimum and maximum selector. Signed-off-by: Gene Chen Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit fed0289394173509b3150617e17739d0094ce88e Author: Thierry Reding Date: Fri Jul 9 19:00:12 2021 +0200 gpu: host1x: debug: Dump DMASTART and DMAEND register Show the values of the DMASTART and DMAEND registers when dumping status to help with failure analysis. Signed-off-by: Thierry Reding commit afa770fe57b95672115c88530fae744693d30a51 Author: Thierry Reding Date: Fri Jul 9 18:58:29 2021 +0200 gpu: host1x: debug: Dump only relevant parts of CDMA push buffer Dumping the full CDMA push buffer takes a long time and isn't very useful since most of the contents are not relevant. Instead only show the CDMA push buffer entries associated with current jobs. While at it, tweak the indentation a bit to make the output more readable. Signed-off-by: Thierry Reding commit ff41dd274858436f35bd20abc76f3f3b65ea6872 Author: Thierry Reding Date: Fri Jul 9 18:55:18 2021 +0200 gpu: host1x: debug: Use dma_addr_t more consistently The host1x debug code uses a mix of phys_addr_t, dma_addr_t and u32 to represent addresses. However, these addresses are always DMA addresses so use the appropriate type. This fixes some issues with how these addresses are displayed, because they could be truncated in some cases and not show the full address. Signed-off-by: Thierry Reding commit fad7cd3310db3099f95dd34312c77740fbc455e5 Author: Baokun Li Date: Wed Aug 4 10:12:12 2021 +0800 nbd: add the check to prevent overflow in __nbd_ioctl() If user specify a large enough value of NBD blocks option, it may trigger signed integer overflow which may lead to nbd->config->bytesize becomes a large or small value, zero in particular. UBSAN: Undefined behaviour in drivers/block/nbd.c:325:31 signed integer overflow: 1024 * 4611686155866341414 cannot be represented in type 'long long int' [...] Call trace: [...] handle_overflow+0x188/0x1dc lib/ubsan.c:192 __ubsan_handle_mul_overflow+0x34/0x44 lib/ubsan.c:213 nbd_size_set drivers/block/nbd.c:325 [inline] __nbd_ioctl drivers/block/nbd.c:1342 [inline] nbd_ioctl+0x998/0xa10 drivers/block/nbd.c:1395 __blkdev_driver_ioctl block/ioctl.c:311 [inline] [...] Although it is not a big deal, still silence the UBSAN by limit the input value. Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20210804021212.990223-1-libaokun1@huawei.com [axboe: dropped unlikely()] Signed-off-by: Jens Axboe commit f865d0292ff3c0ca09414436510eb4c815815509 Author: Thierry Reding Date: Tue Jun 22 15:44:22 2021 +0200 arm64: tegra: Fix compatible string for Tegra132 CPUs The documented compatible string for the CPUs found on Tegra132 is "nvidia,tegra132-denver", rather than the previously used compatible string "nvidia,denver". Signed-off-by: Thierry Reding commit 2270ad2f4e123336af685ecedd1618701cb4ca1e Author: Andreas Obergschwandtner Date: Thu Jul 29 16:42:26 2021 +0200 ARM: tegra: tamonten: Fix UART pad setting This patch fixes the tristate and pullup configuration for UART 1 to 3 on the Tamonten SOM. Signed-off-by: Andreas Obergschwandtner Signed-off-by: Thierry Reding commit 0bd3c071e6e7e140c8b39caab99b3b6f05cb5290 Author: Heikki Krogerus Date: Fri Aug 13 10:11:16 2021 -0500 ASoC: Intel: boards: use software node API in Atom boards The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Co-developed-by: Pierre-Louis Bossart Signed-off-by: Pierre-Louis Bossart Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20210813151116.23931-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f1f8a9615451ec3762a45b6985e072c44a995a45 Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:15 2021 -0500 ASoC: Intel: remove device_properties for Atom boards Prepare the transition to the software node API by removing device properties in the probe error handling and .remove callback. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e5a292d39466ca1f45e185be713616f9389e6a4e Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:14 2021 -0500 ASoC: Intel: use software node API in SoundWire machines The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Co-developed-by: Heikki Krogerus Signed-off-by: Heikki Krogerus Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 82027585fce0c5e78e666cfbd0066fe3c80070dd Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:13 2021 -0500 ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove Follow the example of Intel Atom drivers and keep a reference to the headset codec until the properties are removed. There is no guarantee that the module for the codec driver is loaded before the machine driver probe, the use of the deferred probe mechanism is required. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit cdf99c9ab72161885d8670723a21699a384a5dbe Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:12 2021 -0500 ASoC: Intel: sof_sdw: pass card information to init/exit functions If we want to handle a context in init/exit function, we have to pass the card information. This will be necessary to better deal with device properties in the follow-up commits. No functional change other than prototype update. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d3409eb20d3ed7d9e021cd13243e9e63255a315f Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:11 2021 -0500 ASoC: Intel: boards: get codec device with ACPI instead of bus search We have an existing 'adev' handle from which we can find the codec device, no need for an I2C bus search. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 69efe3b834c0803d170ec8957021543963868e63 Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:10 2021 -0500 ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev() acpi_dev_get_first_match_dev() searches for an acpi_handle instantiated by the ACPI table scanning done early during boot. Two of three machine drivers using this search don't deal with errors and the one which does (bytcr_rt5651) returns -ENODEV, which doesn't make sense here: an alternate driver will not be probed. Add consistent error handling and report -ENXIO. Suggested-by: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c50f126b3c9ebb77585838726a3a490ad33b92cd Author: Pierre-Louis Bossart Date: Fri Aug 13 10:11:09 2021 -0500 ASoC: Intel: boards: harden codec property handling In current ACPI-based devices, the DSDT does not include any of the properties required by the codec driver. This is not an ACPI limitation proper since the _DSD method could be used, as done for Camera and SoundWire in newer platforms. For legacy devices, there is unfortunately no other option than using a work-around: we add properties to the codec device from the machine driver. To avoid any issues with the codec driver being unbound, we need to keep a reference to the codec device until the card is removed. Reviewed-by: Andy Shevchenko Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210813151116.23931-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a1ea05723c27a6f77894a60038a7b2b12fcec9a7 Author: Douglas Anderson Date: Fri Aug 13 07:34:05 2021 -0700 ASoC: rt5682: Remove unused variable in rt5682_i2c_remove() In commit 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") I deleted code but forgot to delete a variable that's now unused. Delete it. Fixes: 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") Reported-by: Stephen Rothwell Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210813073402.1.Iaa9425cfab80f5233afa78b32d02b6dc23256eb3@changeid Signed-off-by: Mark Brown commit 38334231965e9a75558e413d1f5a23357994f065 Author: Colin Ian King Date: Tue Jul 20 09:29:22 2021 +0100 power: supply: ab8500: clean up warnings found by checkpatch Clean up a handful of checkpatch warnings: - static const char * array should probably be static const char * const - function arguments should have identifier names - else should follow close brace '}' - suspect code indent for conditional statements - unnecessary parentheses in an if condition - avoid multiple line dereference - remove debug showing function execution, ftrace can trace these better - prefer 'long' over 'long int' as the int is unnecessary Signed-off-by: Colin Ian King Signed-off-by: Sebastian Reichel commit 8f6a6b3c50ce1caa81c47bb5855be02050c0eff7 Author: Sunil Muthuswamy Date: Mon Jul 12 21:58:18 2021 +0000 PCI: hv: Support for create interrupt v3 Hyper-V vPCI protocol version 1_4 adds support for create interrupt v3. Create interrupt v3 essentially makes the size of the vector field bigger in the message, thereby allowing bigger vector values. For example, that will come into play for supporting LPI vectors on ARM, which start at 8192. Link: https://lore.kernel.org/r/MW4PR21MB20026A6EA554A0B9EC696AA8C0159@MW4PR21MB2002.namprd21.prod.outlook.com Signed-off-by: Sunil Muthuswamy Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley Reviewed-by: Wei Liu commit 96b18047a7172037ff4206720f4e889670030b41 Author: Konstantin Komarov Date: Fri Aug 13 17:21:31 2021 +0300 fs/ntfs3: Add MAINTAINERS This adds MAINTAINERS Signed-off-by: Konstantin Komarov commit 6e5be40d32fb1907285277c02e74493ed43d77fe Author: Konstantin Komarov Date: Fri Aug 13 17:21:30 2021 +0300 fs/ntfs3: Add NTFS3 in fs/Kconfig and fs/Makefile This adds NTFS3 in fs/Kconfig and fs/Makefile Signed-off-by: Konstantin Komarov commit 12dad495eaab95e0bb784c43869073617c513ea4 Author: Konstantin Komarov Date: Fri Aug 13 17:21:30 2021 +0300 fs/ntfs3: Add Kconfig, Makefile and doc This adds Kconfig, Makefile and doc Signed-off-by: Konstantin Komarov commit b46acd6a6a627d876898e1c84d3f84902264b445 Author: Konstantin Komarov Date: Fri Aug 13 17:21:30 2021 +0300 fs/ntfs3: Add NTFS journal This adds NTFS journal Signed-off-by: Konstantin Komarov commit 522e010b58379fbe19b38fdef5016bca0c3cf405 Author: Konstantin Komarov Date: Fri Aug 13 17:21:30 2021 +0300 fs/ntfs3: Add compression This patch adds different types of NTFS-applicable compressions: - lznt - lzx - xpress Latter two (lzx, xpress) implement Windows Compact OS feature and were taken from ntfs-3g system comression plugin authored by Eric Biggers (https://github.com/ebiggers/ntfs-3g-system-compression) which were ported to ntfs3 and adapted to Linux Kernel environment. Signed-off-by: Konstantin Komarov commit be71b5cba2e6485e8959da7a9f9a44461a1bb074 Author: Konstantin Komarov Date: Fri Aug 13 17:21:30 2021 +0300 fs/ntfs3: Add attrib operations This adds attrib operations Signed-off-by: Konstantin Komarov commit 4342306f0f0d5ff4315a204d315c1b51b914fca5 Author: Konstantin Komarov Date: Fri Aug 13 17:21:29 2021 +0300 fs/ntfs3: Add file operations and implementation This adds file operations and implementation Signed-off-by: Konstantin Komarov commit 3f3b442b5ad2455507c9bfdacf39a3792eb3a6d0 Author: Konstantin Komarov Date: Fri Aug 13 17:21:29 2021 +0300 fs/ntfs3: Add bitmap This adds bitmap Signed-off-by: Konstantin Komarov commit 82cae269cfa953032fbb8980a7d554d60fb00b17 Author: Konstantin Komarov Date: Fri Aug 13 17:21:29 2021 +0300 fs/ntfs3: Add initialization of super block This adds initialization of super block Signed-off-by: Konstantin Komarov commit 4534a70b7056fd4b9a1c6db5a4ce3c98546b291e Author: Konstantin Komarov Date: Fri Aug 13 17:21:29 2021 +0300 fs/ntfs3: Add headers and misc files This adds headers and misc files Signed-off-by: Konstantin Komarov commit de0a01f5296651d3a539f2d23d0db8f359483696 Author: Hyun Kwon Date: Fri Jun 25 12:48:23 2021 +0200 PCI: xilinx-nwl: Enable the clock through CCF Enable PCIe reference clock. There is no remove function that's why this should be enough for simple operation. Normally this clock is enabled by default by firmware but there are usecases where this clock should be enabled by driver itself. It is also good that PCIe clock is recorded in a clock framework. Link: https://lore.kernel.org/r/ee6997a08fab582b1c6de05f8be184f3fe8d5357.1624618100.git.michal.simek@xilinx.com Fixes: ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller") Signed-off-by: Hyun Kwon Signed-off-by: Bharat Kumar Gogada Signed-off-by: Michal Simek Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 4d79e367185dc8e3f83525a38b77e36fac69a85e Author: Michal Simek Date: Fri Jun 25 12:48:22 2021 +0200 dt-bindings: pci: xilinx-nwl: Document optional clock property Clock property hasn't been documented in binding document but it is used for quite a long time where clock was specified by commit 9c8a47b484ed ("arm64: dts: xilinx: Add the clock nodes for zynqmp"). Link: https://lore.kernel.org/r/67aa2c189337181bb2d7721fb616db5640587d2a.1624618100.git.michal.simek@xilinx.com Signed-off-by: Michal Simek Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit c02aa89b7435c852aad9b2f39bdfd8ba8e22d3dc Author: Tang Bin Date: Wed Aug 11 18:49:29 2021 +0800 power: supply: axp288_charger: Use the defined variable to clean code Use the defined variable "dev" to make the code cleaner. Co-developed-by: Zhang Shengju Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 5f534a81819ec9ed84ec2d97b7786ebafadd56a3 Author: Namhyung Kim Date: Thu Aug 12 16:57:38 2021 -0700 perf test: Do not compare overheads in the zstd comp test The overhead can vary on each run so it'd make the test failed sometimes. Also order of hist entry can change. Use perf report -F option to omit the overhead field and sort the result alphabetically. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Alexei Budankov Cc: Andi Kleen Cc: James Clark Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Thomas Richter Link: http://lore.kernel.org/lkml/20210812235738.1684583-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f4083a752a3b7dc2076432129c8469d02c25318e Merge: b769cf44ed55f f8e6dfc64f613 Author: Jakub Kicinski Date: Fri Aug 13 06:41:22 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Conflicts: drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h 9e26680733d5 ("bnxt_en: Update firmware call to retrieve TX PTP timestamp") 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins") 099fdeda659d ("bnxt_en: Event handler for PPS events") kernel/bpf/helpers.c include/linux/bpf-cgroup.h a2baf4e8bb0f ("bpf: Fix potentially incorrect results with bpf_get_local_storage()") c7603cfa04e7 ("bpf: Add ambient BPF runtime context stored in current") drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c 5957cc557dc5 ("net/mlx5: Set all field of mlx5_irq before inserting it to the xarray") 2d0b41a37679 ("net/mlx5: Refcount mlx5_irq with integer") MAINTAINERS 7b637cd52f02 ("MAINTAINERS: fix Microchip CAN BUS Analyzer Tool entry typo") 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver") Signed-off-by: Jakub Kicinski commit fac956710ab0812f9e395e9f7a27da551412830f Author: John Garry Date: Wed Aug 11 23:49:26 2021 +0800 iommu/arm-smmu-v3: Stop pre-zeroing batch commands Pre-zeroing the batched commands structure is inefficient, as individual commands are zeroed later in arm_smmu_cmdq_build_cmd(). The size is quite large and commonly most commands won't even be used: struct arm_smmu_cmdq_batch cmds = {}; 345c: 52800001 mov w1, #0x0 // #0 3460: d2808102 mov x2, #0x408 // #1032 3464: 910143a0 add x0, x29, #0x50 3468: 94000000 bl 0 Stop pre-zeroing the complete structure and only zero the num member. Signed-off-by: John Garry Link: https://lore.kernel.org/r/1628696966-88386-1-git-send-email-john.garry@huawei.com Signed-off-by: Will Deacon commit 2cbeaf3f36eb300cae1f344e125162c42fb091a3 Author: Zhen Lei Date: Wed Aug 11 19:48:52 2021 +0800 iommu/arm-smmu-v3: Extract reusable function __arm_smmu_cmdq_skip_err() When SMMU_GERROR.CMDQP_ERR is different to SMMU_GERRORN.CMDQP_ERR, it indicates that one or more errors have been encountered on a command queue control page interface. We need to traverse all ECMDQs in that control page to find all errors. For each ECMDQ error handling, it is much the same as the CMDQ error handling. This common processing part is extracted as a new function __arm_smmu_cmdq_skip_err(). Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210811114852.2429-5-thunder.leizhen@huawei.com Signed-off-by: Will Deacon commit 8639cc83aac5dd1a197ed05b8f717acc35bb0248 Author: Zhen Lei Date: Wed Aug 11 19:48:51 2021 +0800 iommu/arm-smmu-v3: Add and use static helper function arm_smmu_get_cmdq() One SMMU has only one normal CMDQ. Therefore, this CMDQ is used regardless of the core on which the command is inserted. It can be referenced directly through "smmu->cmdq". However, one SMMU has multiple ECMDQs, and the ECMDQ used by the core on which the command insertion is executed may be different. So the helper function arm_smmu_get_cmdq() is added, which returns the CMDQ/ECMDQ that the current core should use. Currently, the code that supports ECMDQ is not added. just simply returns "&smmu->cmdq". Many subfunctions of arm_smmu_cmdq_issue_cmdlist() use "&smmu->cmdq" or "&smmu->cmdq.q" directly. To support ECMDQ, they need to call the newly added function arm_smmu_get_cmdq() instead. Note that normal CMDQ is still required until ECMDQ is available. Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210811114852.2429-4-thunder.leizhen@huawei.com Signed-off-by: Will Deacon commit 4537f6f1e2d8d22ec6f9c6bd3844fdccb931f46e Author: Zhen Lei Date: Wed Aug 11 19:48:50 2021 +0800 iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync() The obvious key to the performance optimization of commit 587e6c10a7ce ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is to allow multiple cores to insert commands in parallel after a brief mutex contention. Obviously, inserting as many commands at a time as possible can reduce the number of times the mutex contention participates, thereby improving the overall performance. At least it reduces the number of calls to function arm_smmu_cmdq_issue_cmdlist(). Therefore, function arm_smmu_cmdq_issue_cmd_with_sync() is added to insert the 'cmd+sync' commands at a time. Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210811114852.2429-3-thunder.leizhen@huawei.com Signed-off-by: Will Deacon commit eff19474b1bd60286213e5052ccf246b6a6c7199 Author: Zhen Lei Date: Wed Aug 11 19:48:49 2021 +0800 iommu/arm-smmu-v3: Use command queue batching helpers to improve performance The obvious key to the performance optimization of commit 587e6c10a7ce ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is to allow multiple cores to insert commands in parallel after a brief mutex contention. Obviously, inserting as many commands at a time as possible can reduce the number of times the mutex contention participates, thereby improving the overall performance. At least it reduces the number of calls to function arm_smmu_cmdq_issue_cmdlist(). Therefore, use command queue batching helpers to insert multiple commands at a time. Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210811114852.2429-2-thunder.leizhen@huawei.com Signed-off-by: Will Deacon commit ef75702d6d65a1993dc0d6dd423fefaa08901f24 Author: Sai Prakash Ranjan Date: Wed Aug 11 21:34:26 2021 +0530 iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation Currently for iommu_unmap() of large scatter-gather list with page size elements, the majority of time is spent in flushing of partial walks in __arm_lpae_unmap() which is a VA based TLB invalidation invalidating page-by-page on iommus like arm-smmu-v2 (TLBIVA). For example: to unmap a 32MB scatter-gather list with page size elements (8192 entries), there are 16->2MB buffer unmaps based on the pgsize (2MB for 4K granule) and each of 2MB will further result in 512 TLBIVAs (2MB/4K) resulting in a total of 8192 TLBIVAs (512*16) for 16->2MB causing a huge overhead. On qcom implementation, there are several performance improvements for TLB cache invalidations in HW like wait-for-safe (for realtime clients such as camera and display) and few others to allow for cache lookups/updates when TLBI is in progress for the same context bank. So the cost of over-invalidation is less compared to the unmap latency on several usecases like camera which deals with large buffers. So, ASID based TLB invalidations (TLBIASID) can be used to invalidate the entire context for partial walk flush thereby improving the unmap latency. For this example of 32MB scatter-gather list unmap, this change results in just 16 ASID based TLB invalidations (TLBIASIDs) as opposed to 8192 TLBIVAs thereby increasing the performance of unmaps drastically. Test on QTI SM8150 SoC for 10 iterations of iommu_{map_sg}/unmap: (average over 10 iterations) Before this optimization: size iommu_map_sg iommu_unmap 4K 2.067 us 1.854 us 64K 9.598 us 8.802 us 1M 148.890 us 130.718 us 2M 305.864 us 67.291 us 12M 1793.604 us 390.838 us 16M 2386.848 us 518.187 us 24M 3563.296 us 775.989 us 32M 4747.171 us 1033.364 us After this optimization: size iommu_map_sg iommu_unmap 4K 1.723 us 1.765 us 64K 9.880 us 8.869 us 1M 155.364 us 135.223 us 2M 303.906 us 5.385 us 12M 1786.557 us 21.250 us 16M 2391.890 us 27.437 us 24M 3570.895 us 39.937 us 32M 4755.234 us 51.797 us Real world data also shows big difference in unmap performance as below: There were reports of camera frame drops because of high overhead in iommu unmap without this optimization because of frequent unmaps issued by camera of about 100MB/s taking more than 100ms thereby causing frame drops. Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20210811160426.10312-1-saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit b71377b3e1e08bf1e7e3dbbe4ee7aa07971552dc Author: Linus Walleij Date: Thu Jul 29 16:43:56 2021 +0200 ARM: ixp4xx: Delete the Freecom FSG-3 boardfiles This board is replaced with the corresponding device tree. Acked-by: Marc Zyngier Tested-by: Marc Zyngier Signed-off-by: Linus Walleij commit df412c3560ea15d493bd9571e6c22b83af75063f Author: Linus Walleij Date: Thu Jul 29 10:53:33 2021 +0200 ARM: ixp4xx: Delete GTWX5715 board files This board is replaced with the corresponding device tree. Signed-off-by: Linus Walleij commit 6dc9b80c2a25c5cd1841e9245dff1f22a50e36cb Author: Linus Walleij Date: Wed Jul 28 17:14:10 2021 +0200 ARM: ixp4xx: Delete Coyote and IXDPG425 boardfiles These boards are replaced with the corresponding device trees. Signed-off-by: Linus Walleij commit 73d04ca5f4ac7c1dcbce952de80b55d229c2f613 Author: Linus Walleij Date: Wed Jul 28 00:40:11 2021 +0200 ARM: ixp4xx: Delete Intel reference design boardfiles These boards are replaced with the corresponding device trees. Cc: Deepak Saxena Cc: Vladimir Barinov Signed-off-by: Linus Walleij commit b00ced38e3172823c0a554004585a683dfd95041 Author: Linus Walleij Date: Tue Jul 27 15:00:39 2021 +0200 ARM: ixp4xx: Delete Avila boardfiles This board is replaced with the corresponding device tree. There is also the "loft" board which is just a Kconfi entry and which reuses the same boardfile. If there is interest in the Loft variant and someone is willing to test I can create a special DT superset for this board, which only differs in PCI set-up. Cc: Michael-Luke Jones Cc: Deepak Saxena Cc: Tom Billman Signed-off-by: Linus Walleij commit 5be86f6886c240429aac197c9e8f51629d6302aa Author: Linus Walleij Date: Mon Jul 26 14:22:07 2021 +0200 ARM: ixp4xx: Delete the Arcom Vulcan boardfiles This board is replaced with the corresponding device tree. Cc: Marc Zyngier Signed-off-by: Linus Walleij commit 73907f98d98d17848b59c613ab9b18b5cbe86fe6 Author: Linus Walleij Date: Mon Jul 26 14:19:32 2021 +0200 ARM: ixp4xx: Delete Gateway WG302v2 boardfiles This board is replaced with the corresponding device tree. Cc: Imre Kaloz Signed-off-by: Linus Walleij commit 86687cc42e538558d659826c0e54779960d20f09 Author: Linus Walleij Date: Mon Jul 26 14:30:29 2021 +0200 ARM: ixp4xx: Delete Omicron boardfiles These boards are reported obsoleted by the manufacturer and no known community users exist. Cc: Richard Cochran Signed-off-by: Linus Walleij commit 42be2c98dd7001cd149277ca37c4a1674fd9703c Author: Linus Walleij Date: Mon Jul 26 14:35:38 2021 +0200 ARM: ixp4xx: Delete the D-Link DSM-G600 boardfiles This board is replaced with the corresponding device tree. Cc: Michael-Luke Jones Cc: Rod Whitby Cc: Alessandro Zummo Cc: Michael Westerhof Cc: Deepak Saxena Signed-off-by: Linus Walleij commit ee2f116b646cb19e967d0159c212cd9f1474c7bd Author: Linus Walleij Date: Wed Jul 14 14:01:22 2021 +0200 ARM: ixp4xx: Delete NAS100D boardfiles The NAS100D is now completely migrated to use device tree exclusively so delete the boardfiles. Signed-off-by: Linus Walleij commit 06ce83a4dd42425100b5bbcd98425e7d732d3c7c Author: Linus Walleij Date: Wed Jul 14 13:51:54 2021 +0200 ARM: ixp4xx: Delete NSLU2 boardfiles The NSLU2 is now completely migrated to use device tree exclusively so delete the boardfiles. Signed-off-by: Linus Walleij commit 26ac471c5354583cf4fe0e42537a2c6b84d6d74e Author: Biju Das Date: Fri Aug 13 10:11:56 2021 +0100 ASoC: sh: rz-ssi: Add SSI DMAC support Add SSI DMAC support to RZ/G2L SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210813091156.10700-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit bed0b1c1e88a27b76c74584128cadebc6fa58622 Author: Biju Das Date: Fri Aug 13 10:11:55 2021 +0100 ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel configuration parameter The DMAC on RZ/G2L has specific slave channel configuration parameters for SSI. This patch updates the dmas description and example node to include the encoded slave channel configuration. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210813091156.10700-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 03e786bd43410fa93e5d2459f7a43e90ff0ae801 Author: Biju Das Date: Fri Aug 13 10:11:54 2021 +0100 ASoC: sh: Add RZ/G2L SSIF-2 driver Add serial sound interface(SSIF-2) driver support for RZ/G2L SoC. Based on the work done by Chris Brandt for RZ/A SSI driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210813091156.10700-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 246dd4287dfbaaddc1511c744893621814618bc8 Author: Pierre-Louis Bossart Date: Thu Aug 12 18:19:40 2021 -0500 ASoC: SOF: Intel: make DMI L1 selection more robust Exposing the DMI L1 configuration as a kernel Kconfig option was in hindsight a really bad idea. It led to several errors reported by distributions which selected it by mistake. The Kconfig is now replaced with a kernel parameter. Since DMI L1 entry is incompatible with pause on a capture stream, the latter is disabled when the kernel parameter is set. Experimental results show an increased residency in higher C states and a significant decrease of system power consumption for "work from home" usages such as VoIP calls. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210812231940.172547-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5503e938fef3f66240670d28f7d5db7f2dc8f35a Author: Pierre-Louis Bossart Date: Thu Aug 12 18:19:39 2021 -0500 ASoC: SOF: Intel: simplify logic for DMI_L1 handling We don't need to test in multiple places if the kconfig SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 is enabled or not, we might as well set the existing DMI_L1_COMPATIBLE flag. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210812231940.172547-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d2556edadbf2929dd7b04de59daeb0a571dc0349 Author: Pierre-Louis Bossart Date: Thu Aug 12 18:19:38 2021 -0500 ASoC: SOF: Intel: hda-stream: remove always true condition We test if (!stream) and return and later on re-test for stream. The second test is always true. This was detected by cppcheck but only after additional code changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210812231940.172547-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6f28c883b7ba8c611a842b4701eb4fb8bd76b70b Author: Pierre-Louis Bossart Date: Thu Aug 12 18:19:37 2021 -0500 ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description This option is only valid for HDaudio platforms. This was described in the help but not explicit in the option description. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210812231940.172547-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1c6b5a7e74052768977855f95d6b8812f6e7772c Author: Aneesh Kumar K.V Date: Thu Aug 12 18:52:23 2021 +0530 powerpc/pseries: Add support for FORM2 associativity PAPR interface currently supports two different ways of communicating resource grouping details to the OS. These are referred to as Form 0 and Form 1 associativity grouping. Form 0 is the older format and is now considered deprecated. This patch adds another resource grouping named FORM2. Signed-off-by: Daniel Henrique Barboza Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132223.225214-6-aneesh.kumar@linux.ibm.com commit ef31cb83d19c4c589d650747cd5a7e502be9f665 Author: Aneesh Kumar K.V Date: Thu Aug 12 18:52:22 2021 +0530 powerpc/pseries: Add a helper for form1 cpu distance This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Signed-off-by: Aneesh Kumar K.V Reviewed-by: David Gibson Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132223.225214-5-aneesh.kumar@linux.ibm.com commit 8ddc6448ec5a5ef50eaa581a7dec0e12a02850ff Author: Aneesh Kumar K.V Date: Thu Aug 12 18:52:21 2021 +0530 powerpc/pseries: Consolidate different NUMA distance update code paths The associativity details of the newly added resourced are collected from the hypervisor via "ibm,configure-connector" rtas call. Update the numa distance details of the newly added numa node after the above call. Instead of updating NUMA distance every time we lookup a node id from the associativity property, add helpers that can be used during boot which does this only once. Also remove the distance update from node id lookup helpers. Currently, we duplicate parsing code for ibm,associativity and ibm,associativity-lookup-arrays in the kernel. The associativity array provided by these device tree properties are very similar and hence can use a helper to parse the node id and numa distance details. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132223.225214-4-aneesh.kumar@linux.ibm.com commit 0eacd06bb8adea8dd9edb0a30144166d9f227e64 Author: Aneesh Kumar K.V Date: Thu Aug 12 18:52:20 2021 +0530 powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V Reviewed-by: David Gibson Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132223.225214-3-aneesh.kumar@linux.ibm.com commit 7e35ef662ca05c42dbc2f401bb76d9219dd7fd02 Author: Aneesh Kumar K.V Date: Thu Aug 12 18:52:19 2021 +0530 powerpc/pseries: rename min_common_depth to primary_domain_index No functional change in this patch. Signed-off-by: Aneesh Kumar K.V Reviewed-by: David Gibson Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132223.225214-2-aneesh.kumar@linux.ibm.com commit dbf77fed8b302e87561c7c2fc06050c88f4d3120 Author: Aneesh Kumar K.V Date: Thu Aug 12 18:58:31 2021 +0530 powerpc: rename powerpc_debugfs_root to arch_debugfs_dir No functional change in this patch. arch_debugfs_dir is the generic kernel name declared in linux/debugfs.h for arch-specific debugfs directory. Architectures like x86/s390 already use the name. Rename powerpc specific powerpc_debugfs_root to arch_debugfs_dir. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132831.233794-2-aneesh.kumar@linux.ibm.com commit 3e188b1ae8807f26cc5a530a9d55f3f643fe050a Author: Aneesh Kumar K.V Date: Thu Aug 12 18:58:30 2021 +0530 powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Also add a debugfs entry for tlb_local_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210812132831.233794-1-aneesh.kumar@linux.ibm.com commit f34ee9cb2c5ac5af426fee6fa4591a34d187e696 Author: Pratik R. Sampat Date: Wed Jul 28 17:35:00 2021 +0530 cpufreq: powernv: Fix init_chip_info initialization in numa=off In the numa=off kernel command-line configuration init_chip_info() loops around the number of chips and attempts to copy the cpumask of that node which is NULL for all iterations after the first chip. Hence, store the cpu mask for each chip instead of derving cpumask from node while populating the "chips" struct array and copy that to the chips[i].mask Fixes: 053819e0bf84 ("cpufreq: powernv: Handle throttling due to Pmax capping at chip level") Cc: stable@vger.kernel.org # v4.3+ Reported-by: Shirisha Ganta Signed-off-by: Pratik R. Sampat Reviewed-by: Gautham R. Shenoy [mpe: Rename goto label to out_free_chip_cpu_mask] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210728120500.87549-2-psampat@linux.ibm.com commit 140a89b7bfe65e9649c4a3678f74c32556834ec1 Author: Emmanuel Gil Peyrot Date: Sun Aug 1 09:38:22 2021 +0200 powerpc: wii_defconfig: Enable OTP by default This selects the nintendo-otp module when building for this platform. Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210801073822.12452-6-linkmauve@linkmauve.fr commit 562a610b4c5119034aed300f6ae212ec7a20c4b4 Author: Emmanuel Gil Peyrot Date: Sun Aug 1 09:38:21 2021 +0200 powerpc: wii.dts: Expose the OTP on this platform This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210801073822.12452-5-linkmauve@linkmauve.fr commit b11748e693166679acc13c8a4328a71efe1d4a89 Author: Emmanuel Gil Peyrot Date: Sun Aug 1 09:38:20 2021 +0200 powerpc: wii.dts: Reduce the size of the control area This is wrong, but needed in order to avoid overlapping ranges with the OTP area added in the next commit. A refactor of this part of the device tree is needed: according to Wiibrew[1], this area starts at 0x0d800000 and spans 0x400 bytes (that is, 0x100 32-bit registers), encompassing PIC and GPIO registers, amongst the ones already exposed in this device tree, which should become children of the control@d800000 node. [1] https://wiibrew.org/wiki/Hardware/Hollywood_Registers Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210801073822.12452-4-linkmauve@linkmauve.fr commit ca42c119fc6746e65423257e7eddf5fc9e96edc2 Author: JafarAkhondali Date: Thu Aug 12 17:23:07 2021 +0430 platform/x86: acer-wmi: Add Turbo Mode support for Acer PH315-53 The Acer Predator Helios series (usually denoted by PHxxx-yy) features a particular key above the keyboard named "TURBO". The turbo key does 3 things: 1. Set all fan's speeds to TURBO mode 2. Overclocks the CPU and GPU in the safe range 3. Turn on an LED just below the turbo button All the above actions are operating using WMI function calls, and there is no custom OC level for turbo. It acts as a flag for enabling turbo mode instead of telling processors to use a specific multiply of power (e.g. 1.3x of power). I've run some benchmark tests and it worked fine: GpuTest 0.7.0 http://www.geeks3d.com Module: FurMark Normal mode Score: 7289 points (FPS: 121) Turbo mode Score: 7675 points (FPS: 127) Settings: - 1920x1080 fullscreen - antialiasing: Off - duration: 60000 ms Renderer: - GeForce RTX 2060/PCIe/SSE2 - OpenGL: 4.6.0 NVIDIA 460.32.03 This feature is presented by Acer officially and should not harm hardware in any case. A challenging part of implementing this feature is that calling overclock function requires knowing the exact count of fans for CPU and GPU of each model, which to the best of my knowledge is not available in the kernel. So after checking the official PredatorSense application methods, it turned out they have provided the software the list of fans in each model. I have access to the mentioned list, and all similar PH-iii-jj can be added easily by matching "DMI_PRODUCT_NAME". Creating a specific file for the Acer gaming features is not possible because the current in use WMI event GUID is required for the turbo button and it's not possible to register multiple listeners on a single WMI event. Signed-off-by: JafarAkhondali Link: https://lore.kernel.org/r/20210812125307.1749207-1-jafar.akhoondali@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8599a12b1e01039efb13151ff922bc16e5013767 Author: Hans de Goede Date: Tue Aug 10 18:09:00 2021 +0200 platform/x86: Update Mario Limonciello's email address in the docs Various pdx86 docs under Documentation/ABI/testing still use Mario's old, now defunct, address. Update the docs to point to either the new Dell.Client.Kernel@dell.com email alias for Dell specific drivers, or to Mario's new @outlook.com address for other drivers. Cc: Dell.Client.Kernel@dell.com Cc: Mario Limonciello Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210810160900.106512-1-hdegoede@redhat.com commit 2af8d585c30ad0ff9a89887066a016e150680bc1 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:47 2021 +0300 ARM: tegra: nexus7: Improve thermal zones Use skin temperature for maintaining temperature that is suitable specifically for Nexus 7. Add CPU thermal zone that protects silicon. All these changes don't make a significant difference, but it is a more correct definition of thermal zones. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 3f9c8c113fc86dd132129559c93b4d2591dc89c2 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:46 2021 +0300 ARM: tegra: acer-a500: Improve thermal zones Use skin temperature for maintaining temperature that is suitable specifically for A500. Add CPU thermal zone that protects silicon. All these changes don't make a significant difference, but it is a more correct definition of thermal zones. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit c60e6e981812cf44aec9c579f79d7b5e055a9035 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:45 2021 +0300 ARM: tegra: acer-a500: Use verbose variant of atmel,wakeup-method value The verbose variant of the atmel,wakeup-method value was lost when patch that added the property was merged because it conflicted with other patch, re-add it for consistency. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d8c6c30bd868682a422473faf6b0573965d938c3 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:44 2021 +0300 ARM: tegra: acer-a500: Add power supplies to accelerometer Add power supplies to accelerometer node, for completeness. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 70e740ad55e5f93a19493720f4105555fade4a73 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:43 2021 +0300 ARM: tegra: acer-a500: Remove bogus USB VBUS regulators The configuration of USB VBUS regulators was borrowed from downstream kernel, which is incorrect because the corresponding GPIOs are connected to PROX_EN (A501 3G model) and LED_EN pins in accordance to the board schematics. USB works fine with both GPIOs being disabled, so remove the bogus USB VBUS regulators. The USB VBUS of USB3 is supplied from the fixed 5v system regulator and device-mode USB1 doesn't have VBUS switches. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 457f620150806db94aedb63690be05a0414a98f9 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:42 2021 +0300 ARM: tegra: jetson-tk1: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e824fdfc7149f6ce709172d2b7d432bc1406e66f Author: Dmitry Osipenko Date: Tue Aug 3 00:19:41 2021 +0300 ARM: tegra: dalmore: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d8b17f31f12d9433f5cc636788e60c67bc701362 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:40 2021 +0300 ARM: tegra: cardhu: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 382397f8d66daf8c0cd840b17ad5fd7c39b6381b Author: Dmitry Osipenko Date: Tue Aug 3 00:19:39 2021 +0300 ARM: tegra: apalis: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 965832950e60bc48a762792902546d5daf833823 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:38 2021 +0300 ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 8d78c750e3f623f85e70d8693e2733a8c3478530 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:37 2021 +0300 ARM: tegra: acer-a500: Add interrupt to temperature sensor node The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC. Add interrupt property to the temperature sensor for completeness. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit b844468615cd6cdaef2b2c69d2d33180f375886e Author: Dmitry Osipenko Date: Tue Aug 3 00:19:36 2021 +0300 ARM: tegra: nexus7: Add interrupt to temperature sensor node The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC. Add interrupt property to the temperature sensor for completeness. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 155bfaf7ee1df9c4b1aa2737d394b34bc7a2d746 Author: Dmitry Osipenko Date: Tue Aug 3 00:19:35 2021 +0300 ARM: tegra: paz00: Add interrupt to temperature sensor node The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC. Add interrupt property to the temperature sensor for completeness. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit da0ad8983cc486449b8d6668b5f91334fd35803b Author: Dmitry Osipenko Date: Tue Aug 3 00:19:34 2021 +0300 ARM: tegra: ouya: Add interrupt to temperature sensor node The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC. Add interrupt property to the temperature sensor and enable it in pinmux, for completeness. Tested-by: Matt Merhar Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 13a2a5ea1a36d32c3b26f52df7a7c6035d552cbc Author: Dmitry Osipenko Date: Tue Aug 3 00:19:33 2021 +0300 ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Add the on-chip SoC thermal sensor to Tegra30 device-trees. Now CPU temperature reporting and thermal throttling is available on all Tegra30 devices universally. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit cea45a3bd2dd4d9c35581328f571afd32b3c9f48 Author: Geert Uytterhoeven Date: Wed Aug 11 17:52:54 2021 +0200 usb: gadget: udc: renesas_usb3: Fix soc_device_match() abuse soc_device_match() is intended as a last resort, to handle e.g. quirks that cannot be handled by matching based on a compatible value. As the device nodes for the Renesas USB 3.0 Peripheral Controller on R-Car E3 and RZ/G2E do have SoC-specific compatible values, the latter can and should be used to match against these devices. This also fixes support for the USB 3.0 Peripheral Controller on the R-Car E3e (R8A779M6) SoC, which is a different grading of the R-Car E3 (R8A77990) SoC, using the same SoC-specific compatible value. Fixes: 30025efa8b5e75f5 ("usb: gadget: udc: renesas_usb3: add support for r8a77990") Fixes: 546970fdab1da5fe ("usb: gadget: udc: renesas_usb3: add support for r8a774c0") Reviewed-by: Niklas Söderlund Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/760981fb4cd110d7cbfc9dcffa365e7c8b25c6e5.1628696960.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit e9e6e164ed8f6d017f08b426cfc936bb70ec6d5d Author: Kyle Tso Date: Wed Aug 4 16:19:17 2021 +0800 usb: typec: tcpm: Support non-PD mode Even if the Type-C controller supports PD, it is doable to disable PD capabilities with the current state machine in TCPM. Without enabling RX in low-level drivers and with skipping the power negotiation, the port is eligible to be a non-PD Type-C port. Use new flags whose values are populated from the device tree to decide the port PD capability. Adding "pd-disable" property in device tree indicates that the port does not support PD. If PD is not supported, the device tree property "typec-power-opmode" shall be added to specify the advertised Rp value if the port supports SRC role. Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Kyle Tso Link: https://lore.kernel.org/r/20210804081917.3390341-3-kyletso@google.com Signed-off-by: Greg Kroah-Hartman commit 7a4440bc0d86acfb5342e4483daa184c1b28a24a Author: Kyle Tso Date: Wed Aug 4 16:19:16 2021 +0800 dt-bindings: connector: Add pd-disable property Set "pd-disable" property if the Type-C connector has no power delivery support. Reviewed-by: Rob Herring Signed-off-by: Kyle Tso Link: https://lore.kernel.org/r/20210804081917.3390341-2-kyletso@google.com Signed-off-by: Greg Kroah-Hartman commit 97d99f7e8f1ccaa18d6447f4a3b0b48ed64aa214 Author: Chunfeng Yun Date: Fri Aug 13 14:30:53 2021 +0800 usb: gadget: remove unnecessary AND operation when get ep maxp usb_endpoint_maxp() already returns actual max packet size, no need to AND 0x7ff. Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-7-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit b553c9466fa54d29e314659117b0b24719f24bd3 Author: Chunfeng Yun Date: Fri Aug 13 14:30:52 2021 +0800 usb: gadget: bdc: remove unnecessary AND operation when get ep maxp usb_endpoint_maxp() already returns actual max packet size, no need to AND 0x7ff. Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-6-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit eeb0cfb6b2b6b731902e68af641e30bd31be3c7b Author: Chunfeng Yun Date: Fri Aug 13 14:30:51 2021 +0800 usb: gadget: tegra-xudc: fix the wrong mult value for HS isoc or intr usb_endpoint_maxp() only returns the bit[10:0] of wMaxPacketSize of endpoint descriptor, not includes bit[12:11] anymore, so use usb_endpoint_maxp_mult() instead. Meanwhile no need AND 0x7ff when get maxp, remove it. Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") Cc: stable@vger.kernel.org Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit e9ab75f26eb9354dfc03aea3401b8cfb42cd6718 Author: Chunfeng Yun Date: Fri Aug 13 14:30:50 2021 +0800 usb: cdnsp: fix the wrong mult value for HS isoc or intr usb_endpoint_maxp() only returns the bit[10:0] of wMaxPacketSize of endpoint descriptor, not include bit[12:11] anymore, so use usb_endpoint_maxp_mult() instead. Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Cc: stable@vger.kernel.org Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 44e4439d8f9f8d0e9da767d1f31e7c211081feca Author: Chunfeng Yun Date: Fri Aug 13 14:30:49 2021 +0800 usb: mtu3: fix the wrong HS mult value usb_endpoint_maxp() returns actual max packet size, @mult will always be zero, fix it by using usb_endpoint_maxp_mult() instead to get mult. Fixes: 4d79e042ed8b ("usb: mtu3: add support for usb3.1 IP") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit fd7cb394ec7efccc3985feb0978cee4d352e1817 Author: Chunfeng Yun Date: Fri Aug 13 14:30:48 2021 +0800 usb: mtu3: use @mult for HS isoc or intr For HS isoc or intr, should use @mult but not @burst to save mult value. Fixes: 4d79e042ed8b ("usb: mtu3: add support for usb3.1 IP") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit e88f28514065a6c48aadc367efb0ef6378a01543 Author: Chunfeng Yun Date: Fri Aug 13 14:30:47 2021 +0800 usb: mtu3: restore HS function when set SS/SSP Due to HS function is disabled when set as FS, need restore it when set as SS/SSP. Fixes: dc4c1aa7eae9 ("usb: mtu3: add ->udc_set_speed()") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 0881e22c06e66af0b64773c91c8868ead3d01aa1 Author: Sergey Shtylyov Date: Mon Aug 9 23:53:16 2021 +0300 usb: phy: twl6030: add IRQ checks The driver neglects to check the result of platform_get_irq()'s calls and blithely passes the negative error codes to request_threaded_irq() (which takes *unsigned* IRQ #), causing them both to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with the invalid IRQ #s. Fixes: c33fad0c3748 ("usb: otg: Adding twl6030-usb transceiver driver for OMAP4430") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/9507f50b-50f1-6dc4-f57c-3ed4e53a1c25@omp.ru Signed-off-by: Greg Kroah-Hartman commit ecc2f30dbb25969908115c81ec23650ed982b004 Author: Sergey Shtylyov Date: Mon Aug 9 23:50:18 2021 +0300 usb: phy: fsl-usb: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_irq() with the invalid IRQ #s. Fixes: 0807c500a1a6 ("USB: add Freescale USB OTG Transceiver driver") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/b0a86089-8b8b-122e-fd6d-73e8c2304964@omp.ru Signed-off-by: Greg Kroah-Hartman commit 711087f342914e831269438ff42cf59bb0142c71 Author: Sergey Shtylyov Date: Mon Aug 9 23:45:15 2021 +0300 usb: misc: brcmstb-usb-pinmap: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals") Reviewed-by: Florian Fainelli Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/806d0b1a-365b-93d9-3fc1-922105ca5e61@omp.ru Signed-off-by: Greg Kroah-Hartman commit 04c2721d3530f0723b4c922a8fa9f26b202a20de Author: Thomas Gleixner Date: Fri Aug 13 12:40:04 2021 +0200 genirq: Fix kernel doc indentation Fixes: 61377ec14457 ("genirq: Clarify documentation for request_threaded_irq()") Reported-by: Stephen Rothwell Signed-off-by: Thomas Gleixner commit ad85b0843ee4536593415ca890d7fb52cd7f1fbe Author: Dmitry Osipenko Date: Tue Jun 1 07:21:08 2021 +0300 drm/tegra: dc: Extend debug stats with total number of events It's useful to know the total number of underflow events and currently the debug stats are getting reset each time CRTC is being disabled. Let's account the overall number of events that doesn't get a reset. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 04d5d5df9df79f9045e76404775fc8a084aac23d Author: Dmitry Osipenko Date: Tue Jun 1 07:21:07 2021 +0300 drm/tegra: dc: Support memory bandwidth management Display controller (DC) performs isochronous memory transfers, and thus, has a requirement for a minimum memory bandwidth that shall be fulfilled, otherwise framebuffer data can't be fetched fast enough and this results in a DC's data-FIFO underflow that follows by a visual corruption. The Memory Controller drivers provide facility for memory bandwidth management via interconnect API. Let's wire up the interconnect API support to the DC driver in order to fix the distorted display output on T30 Ouya, T124 TK1 and other Tegra devices. Tested-by: Peter Geis # Ouya T30 Tested-by: Matt Merhar # Ouya T30 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Signed-off-by: Dmitry Osipenko [treding@nvidia.com: unbreak Tegra186+ display support] Signed-off-by: Thierry Reding commit c4c4637eb57f2a25c445421aadeb689a2538b20b Author: Lad Prabhakar Date: Tue Jul 27 12:23:26 2021 +0100 pinctrl: renesas: Add RZ/G2L pin and gpio controller driver Add support for pin and gpio controller driver for RZ/G2L SoC. Based on a patch in the BSP by Hien Huynh . Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210727112328.18809-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e8425dd55abb12881694875972465f40bb0fe41b Author: Geert Uytterhoeven Date: Wed Aug 11 11:06:40 2021 +0200 clk: renesas: Make CLK_R9A06G032 invisible When configuring a kernel including support for Renesas ARM/ARM64 Socs, but excluding support for the RZ/N1D SoC, the user is always asked about the RZ/N1D clock driver. As this driver is already auto-selected when building a kernel including support for the RZ/N1D SoC, there is no need to make the CLK_R9A06G032 symbol visible, unless compile-testing. Align the symbol description with the other symbols. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/4f3d30c730c30546f702715ffc648922a8156703.1628672649.git.geert+renesas@glider.be commit a71bfc0079762b4d3cb36dcc5fe6c23c806cfc8c Merge: fc062ad8e406a e6226997ec5ac Author: Arnd Bergmann Date: Fri Aug 13 12:00:12 2021 +0200 Merge branch 'asm-generic-uaccess-7' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic into asm-generic These two functions appear to be unnecessarily different between architectures, and the asm-generic version is a bit questionable, even for NOMMU architectures. Clean this up to just use the generic library version for anything that uses the generic version today. I've expanded on the patch descriptions a little, as suggested by Christoph Hellwig, but I suspect a more detailed review would uncover additional problems with the custom versions that are getting removed. I ended up adding patches for csky and microblaze as they had the same implementation that I removed elsewhere, these are now gone as well. * 'asm-generic-uaccess-7' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: reverse GENERIC_{STRNCPY_FROM,STRNLEN}_USER symbols asm-generic: remove extra strn{cpy_from,len}_user declarations asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user s390: use generic strncpy/strnlen from_user microblaze: use generic strncpy/strnlen from_user csky: use generic strncpy/strnlen from_user arc: use generic strncpy/strnlen from_user hexagon: use generic strncpy/strnlen from_user h8300: remove stale strncpy_from_user asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user Signed-off-by: Arnd Bergmann commit 3b35f2a6a625126c57475aa56b5357d8e80b404c Author: Yury Norov Date: Fri Aug 6 23:02:51 2021 +1200 bitmap: extend comment to bitmap_print_bitmask/list_to_buf Extend comment to new function to warn potential users about caveats. Signed-off-by: Yury Norov Signed-off-by: Barry Song Link: https://lore.kernel.org/r/20210806110251.560-6-song.bao.hua@hisilicon.com Signed-off-by: Greg Kroah-Hartman commit 75bd50fa841db5434728d238b8b5659498ccf0ab Author: Tian Tao Date: Fri Aug 6 23:02:50 2021 +1200 drivers/base/node.c: use bin_attribute to break the size limitation of cpumap ABI Reading /sys/devices/system/cpu/cpuX/nodeX/ returns cpumap and cpulist. However, the size of this file is limited to PAGE_SIZE because of the limitation for sysfs attribute. This patch moves to use bin_attribute to extend the ABI to be more than one page so that cpumap bitmask and list won't be potentially trimmed. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Reviewed-by: Jonathan Cameron Signed-off-by: Tian Tao Signed-off-by: Barry Song Link: https://lore.kernel.org/r/20210806110251.560-5-song.bao.hua@hisilicon.com Signed-off-by: Greg Kroah-Hartman commit bb9ec13d156e85dfd6a8afd0bb61ccf5736ed257 Author: Tian Tao Date: Fri Aug 6 23:02:49 2021 +1200 topology: use bin_attribute to break the size limitation of cpumap ABI Reading /sys/devices/system/cpu/cpuX/topology/ returns cpu topology. However, the size of this file is limited to PAGE_SIZE because of the limitation for sysfs attribute. This patch moves to use bin_attribute to extend the ABI to be more than one page so that cpumap bitmask and list won't be potentially trimmed. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Reviewed-by: Jonathan Cameron Signed-off-by: Tian Tao Signed-off-by: Barry Song Link: https://lore.kernel.org/r/20210806110251.560-4-song.bao.hua@hisilicon.com Signed-off-by: Greg Kroah-Hartman commit 291f93ca339f5b5e6e90ad037bb8271f0f618165 Author: Barry Song Date: Fri Aug 6 23:02:48 2021 +1200 lib: test_bitmap: add bitmap_print_bitmask/list_to_buf test cases The added test items cover both cases where bitmap buf of the printed result is greater than and less than 4KB. And it also covers the case where offset for printing is non-zero which will happen when printed buf is larger than one page in sysfs bin_attribute. Reported-by: kernel test robot Reviewed-by: Andy Shevchenko Signed-off-by: Barry Song Link: https://lore.kernel.org/r/20210806110251.560-3-song.bao.hua@hisilicon.com Signed-off-by: Greg Kroah-Hartman commit 1fae562983ca5c7eb36d4974be5e235374661806 Author: Tian Tao Date: Fri Aug 6 23:02:47 2021 +1200 cpumask: introduce cpumap_print_list/bitmask_to_buf to support large bitmask and list The existing cpumap_print_to_pagebuf() is used by cpu topology and other drivers to export hexadecimal bitmask and decimal list to userspace by sysfs ABI. Right now, those drivers are using a normal attribute for this kind of ABIs. A normal attribute typically has show entry as below: static ssize_t example_dev_show(struct device *dev, struct device_attribute *attr, char *buf) { ... return cpumap_print_to_pagebuf(true, buf, &pmu_mmdc->cpu); } show entry of attribute has no offset and count parameters and this means the file is limited to one page only. cpumap_print_to_pagebuf() API works terribly well for this kind of normal attribute with buf parameter and without offset, count: static inline ssize_t cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) { return bitmap_print_to_pagebuf(list, buf, cpumask_bits(mask), nr_cpu_ids); } The problem is once we have many cpus, we have a chance to make bitmask or list more than one page. Especially for list, it could be as complex as 0,3,5,7,9,...... We have no simple way to know it exact size. It turns out bin_attribute is a way to break this limit. bin_attribute has show entry as below: static ssize_t example_bin_attribute_show(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t offset, size_t count) { ... } With the new offset and count parameters, this makes sysfs ABI be able to support file size more than one page. For example, offset could be >= 4096. This patch introduces cpumap_print_bitmask/list_to_buf() and their bitmap infrastructure bitmap_print_bitmask/list_to_buf() so that those drivers can move to bin_attribute to support large bitmask and list. At the same time, we have to pass those corresponding parameters such as offset, count from bin_attribute to this new API. Cc: Andrew Morton Cc: Andy Shevchenko Cc: Randy Dunlap Cc: Stefano Brivio Cc: Alexander Gordeev Cc: "Ma, Jianpeng" Cc: Yury Norov Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Daniel Bristot de Oliveira Reviewed-by: Jonathan Cameron Signed-off-by: Tian Tao Signed-off-by: Barry Song Link: https://lore.kernel.org/r/20210806110251.560-2-song.bao.hua@hisilicon.com Signed-off-by: Greg Kroah-Hartman commit 3683b761fe3a10ad18515acd5368dd601268cfe5 Author: Emmanuel Gil Peyrot Date: Tue Aug 10 16:30:36 2021 +0100 nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP This OTP is read-only and contains various keys used by the console to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by writing into one register and reading from the other one, without any additional synchronisation. This driver was written based on reversed documentation, see: https://wiiubrew.org/wiki/Hardware/OTP Tested-by: Jonathan Neuschäfer # on Wii Tested-by: Emmanuel Gil Peyrot # on Wii U Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210810153036.1494-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9aaf4d2a08182b7ef6d939642a6d92564bd83b2f Author: Emmanuel Gil Peyrot Date: Tue Aug 10 16:30:35 2021 +0100 dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Reviewed-by: Rob Herring Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210810153036.1494-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2dc30eb9241c21cbeaf5b668f4eb276278149d97 Author: Mauro Carvalho Chehab Date: Wed Aug 11 09:14:31 2021 +0200 arm64: dts: HiSilicon: hi3660: address a PCI warning When the driver is registered, it produces a warning when registering the PCI bridge: [ 5.363450] pci_bus 0000:00: root bus resource [bus 00-01] [ 5.396998] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [bus 00-01] (conflicts with (null) [bus 00-01]) [ 5.284831] pci 0000:00:00.0: PCI bridge to [bus 01-ff] The reason is that the bus-range is wrong. Address it. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Wei Xu commit bda36b0fc2b6ab0c35d68c1cec8968ee4b920cd9 Author: Takashi Iwai Date: Fri Aug 13 10:16:45 2021 +0200 ALSA: memalloc: Count continuous pages in vmalloc buffer handler This is an enhancement for the SG-style page handling in vmalloc buffer handler to calculate the continuous pages. When snd_sgbuf_get_chunk_size() is called for a vmalloc buffer, currently we return only the size that fits into a single page. However, this API call is rather supposed for obtaining the continuous pages and most of vmalloc or noncontig buffers do have lots of continuous pages indeed. So, in this patch, the callback now calculates the possibly continuous pages up to the given size limit. Note that the end address in the function is calculated from the last byte, hence it's one byte shorter. This is because ofs + size can be above the actual buffer size boundary. Until now, this feature isn't really used, but it'll become useful in a later patch that adds the non-contiguous buffer type that shares the same callback function as vmalloc. Link: https://lore.kernel.org/r/20210812113818.6479-1-tiwai@suse.de Link: https://lore.kernel.org/r/20210813081645.4680-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4bedcc28469a24fe481a8a31b3584e6070457ddb Author: Thomas Gleixner Date: Thu Aug 12 17:43:26 2021 +0200 debugobjects: Make them PREEMPT_RT aware On PREEMPT_RT enabled kernels it is not possible to refill the object pool from atomic context (preemption or interrupts disabled) as the allocator might acquire 'sleeping' spinlocks. Guard the invocation of fill_pool() accordingly. Signed-off-by: Thomas Gleixner Tested-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/87sfzehdnl.ffs@tglx commit 8c89f7b3d3f2880c57b0bc96c72ccd98fe354399 Author: Kees Cook Date: Fri Aug 6 14:53:05 2021 -0700 mac80211: Use flex-array for radiotap header bitmap In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. The it_present member of struct ieee80211_radiotap_header is treated as a flexible array (multiple u32s can be conditionally present). In order for memcpy() to reason (or really, not reason) about the size of operations against this struct, use of bytes beyond it_present need to be treated as part of the flexible array. Add a trailing flexible array and initialize its initial index via pointer arithmetic. Cc: Johannes Berg Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210806215305.2875621-1-keescook@chromium.org Signed-off-by: Johannes Berg commit 5cafd3784a738eab8bbfcda17e8571050794ef32 Author: Kees Cook Date: Fri Aug 6 14:51:12 2021 -0700 mac80211: radiotap: Use BIT() instead of shifts IEEE80211_RADIOTAP_EXT has a value of 31, which means if shift was ever cast to 64-bit, the result would become sign-extended. As a matter of robustness, just replace all the open-coded shifts with BIT(). Suggested-by: David Sterba Link: https://lore.kernel.org/lkml/20210728092323.GW5047@twin.jikos.cz/ Cc: Johannes Berg Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210806215112.2874773-1-keescook@chromium.org Signed-off-by: Johannes Berg commit 0323689d30af3523f26ac05b69537fd90d7b94da Author: dingsenjie Date: Thu Aug 5 14:43:49 2021 +0800 mac80211: Remove unnecessary variable and label The variable ret and label just used as return, so we delete it and use the return statement instead of the goto statement. Signed-off-by: dingsenjie Link: https://lore.kernel.org/r/20210805064349.202148-1-dingsenjie@163.com Signed-off-by: Johannes Berg commit 779969e3c8952dfa12e179a2bb989cf02fc4a1ab Author: Johannes Berg Date: Thu Jul 15 18:02:35 2021 +0200 mac80211: include This is needed for the rbtree, and we shouldn't just rely on it getting included somewhere implicitly. Include it explicitly. Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20210715180234.512d64dee655.Ia51c29a9fb1e651e06bc00eabec90974103d333e@changeid Signed-off-by: Johannes Berg commit 79f5962baea74ce1cd4e5949598944bff854b166 Author: Johan Almbladh Date: Mon Jun 28 14:32:46 2021 +0200 mac80211: Fix monitor MTU limit so that A-MSDUs get through The maximum MTU was set to 2304, which is the maximum MSDU size. While this is valid for normal WLAN interfaces, it is too low for monitor interfaces. A monitor interface may receive and inject MPDU frames, and the maximum MPDU frame size is larger than 2304. The MPDU may also contain an A-MSDU frame, in which case the size may be much larger than the MTU limit. Since the maximum size of an A-MSDU depends on the PHY mode of the transmitting STA, it is not possible to set an exact MTU limit for a monitor interface. Now the maximum MTU for a monitor interface is unrestricted. Signed-off-by: Johan Almbladh Link: https://lore.kernel.org/r/20210628123246.2070558-1-johan.almbladh@anyfinetworks.com Signed-off-by: Johannes Berg commit 4a11174d6dbd0bde6d5a1d6efb0d70f58811db55 Author: Dan Carpenter Date: Mon Jun 28 13:10:38 2021 +0300 mac80211: remove unnecessary NULL check in ieee80211_register_hw() The address "&sband->iftype_data[i]" points to an array at the end of struct. It can't be NULL and so the check can be removed. Fixes: bac2fd3d7534 ("mac80211: remove use of ieee80211_get_he_sta_cap()") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YNmgHi7Rh3SISdog@mwanda Signed-off-by: Johannes Berg commit deebea0ae3f7c1f812ff6b3581dc51445e1be942 Author: YueHaibing Date: Sat Jun 26 21:03:34 2021 +0800 mac80211: Reject zero MAC address in sta_info_insert_check() As commit 52dba8d7d5ab ("mac80211: reject zero MAC address in add station") said, we don't consider all-zeroes to be a valid MAC address in most places, so also reject it here. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20210626130334.13624-1-yuehaibing@huawei.com Signed-off-by: Johannes Berg commit 3d2a2544eae93987f0688c2d6ec06c76f9e1477b Author: Emmanuel Grumbach Date: Fri Jun 25 11:17:16 2021 +0300 nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage iwlmei allows to integrate with the CSME firmware. There are flows that are prioprietary for this purpose: * Get the information of the AP the CSME firmware is connected to. This is useful when we need to speed up the connection process in case the CSME firmware has a TCP connection that must be kept alive across the ownership transition. * Forbid roaming, which will happen when the CSME firmware wants to tell the user space not disrupt the connection. * Request ownership, upon driver boot when the CSME firmware owns the device. This is a notification sent by the kernel. All those commands are expected to be used by any software managing the connection (mainly NetworkManager). Those commands are expected to be used only in case the CSME firmware owns the device and doesn't want to release the device unless the host made sure that it can keep the connectivity. Here are the steps of the expected flow: 1) The machine boots while AMT has an active TCP connection 2) iwlwifi starts and tries to access the device 3) The device is not available because of the active TCP connection. (If there are no active connections, the CSME firmware would have allowed iwlwifi to use the device) Note that all the steps up to here don't involve iwlmei. All this happens in iwlwifi (in iwl_pcie_prepare_card_hw). 4) iwlmei establishes a connection to the CSME firmware (through SAP) Here iwlwifi uses iwlmei to access the device's capabilities (since it can't touch the device), but this is not relevant for the vendor commands. 5) The CSME firmware tells iwlmei that it uses the NIC and that there is an acitve TCP connection, and hence, the host needs to think twice before asking the CSME firmware to release the device 6) iwlmei tells iwlwifi to report HW RFKILL with a special reason Up to here, there was no user space involved. 7) The user space (NetworkManager) boots and sees that the device is in RFKILL because the host doesn't own the device 8) The user space asks the kernel what AP the CSME firmware is connected to (with the first vendor command mentionned above) 9) The user space checks if it has a profile that matches the reply from the CSME firmware 10) The user space installs a network to the wpa_supplicant with a specific BSSID and a specific frequency 11) The user space prevents any type of full scan 12) The user space asks iwlmei to request ownership on the device (with the third vendor command) 13) iwlmei request ownership from the CSME firmware 14) The CSME firmware grants ownership 15) iwlmei tells iwlwifi to lift the RFKILL 16) RFKILL OFF is reported to userspace 17) The host boots the device, loads the firwmare, and connect to a specific BSSID without scanning including IP in less than 600ms (this is what I measured, of course it depends on many factors) 18) The host reports to the CSME firmware that there is a connection 19) The TCP connection is preserved and the host has now connectivity 20) Later, the TCP connection to the CSME firmware is terminated 21) The CSME firmware tells iwlmei that it is now free to do whatever it likes 22) iwlwifi sends the second vendor command to tell the user space that it can remove the special network configuration and pick any SSID / BSSID it likes. Co-Developed-by: Ayala Beker Signed-off-by: Emmanuel Grumbach Link: https://lore.kernel.org/r/20210625081717.7680-4-emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg commit cdd3d945dcec0d0dab845175dc9400ab54512aa6 Author: Sam Protsenko Date: Wed Aug 11 14:48:22 2021 +0300 pinctrl: samsung: Add Exynos850 SoC specific data Add Samsung Exynos850 SoC specific data to enable pinctrl support for all platforms based on Exynos850. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210811114827.27322-3-semen.protsenko@linaro.org [krzysztof: lower-case the hex-numbers] Signed-off-by: Krzysztof Kozlowski commit 71b833b329d65236285cc73f4528f08c7d3c274c Author: Sam Protsenko Date: Wed Aug 11 14:48:21 2021 +0300 dt-bindings: pinctrl: samsung: Add Exynos850 doc Document compatible string for Exynos850 SoC. Nothing else is changed, as Exynos850 SoC uses already existing samsung pinctrl driver. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210811114827.27322-2-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 0a6e7e411896822a04edaf65f232fbbdf1da1a6a Merge: e9a13babd69f0 5111c2b6b0194 Author: Bartosz Golaszewski Date: Fri Aug 13 09:38:04 2021 +0200 Merge tag 'intel-gpio-v5.15-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v5.15-1 * Rework DesignWare driver to use software nodes instead of platform data * Drop duplication of forward declaration for ACPI in consumer.h * Get rid of legacy PCI PM code in ML IOH driver The following is an automated git shortlog grouped by driver: dwapb: - Get rid of legacy platform data - Read GPIO base from gpio-base property - Unify ACPI enumeration checks in get_irq() and configure_irqs() gpiolib: - Deduplicate forward declaration in the consumer.h header mfd: - intel_quark_i2c_gpio: Convert GPIO to use software nodes ml-ioh: - Convert to dev_pm_ops commit 3165af738ed3224a84ead7d97c6909de2e453b4c Author: Peter Xu Date: Fri Jul 30 18:04:49 2021 -0400 KVM: Allow to have arch-specific per-vm debugfs files Allow archs to create arch-specific nodes under kvm->debugfs_dentry directory besides the stats fields. The new interface kvm_arch_create_vm_debugfs() is defined but not yet used. It's called after kvm->debugfs_dentry is created, so it can be referenced directly in kvm_arch_create_vm_debugfs(). Arch should define their own versions when they want to create extra debugfs nodes. Signed-off-by: Peter Xu Message-Id: <20210730220455.26054-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit f7782bb8d818d8f47c26b22079db10599922787a Author: Sean Christopherson Date: Tue Aug 10 07:45:26 2021 -0700 KVM: nVMX: Unconditionally clear nested.pi_pending on nested VM-Enter Clear nested.pi_pending on nested VM-Enter even if L2 will run without posted interrupts enabled. If nested.pi_pending is left set from a previous L2, vmx_complete_nested_posted_interrupt() will pick up the stale flag and exit to userspace with an "internal emulation error" due the new L2 not having a valid nested.pi_desc. Arguably, vmx_complete_nested_posted_interrupt() should first check for posted interrupts being enabled, but it's also completely reasonable that KVM wouldn't screw up a fundamental flag. Not to mention that the mere existence of nested.pi_pending is a long-standing bug as KVM shouldn't move the posted interrupt out of the IRR until it's actually processed, e.g. KVM effectively drops an interrupt when it performs a nested VM-Exit with a "pending" posted interrupt. Fixing the mess is a future problem. Prior to vmx_complete_nested_posted_interrupt() interpreting a null PI descriptor as an error, this was a benign bug as the null PI descriptor effectively served as a check on PI not being enabled. Even then, the new flow did not become problematic until KVM started checking the result of kvm_check_nested_events(). Fixes: 705699a13994 ("KVM: nVMX: Enable nested posted interrupt processing") Fixes: 966eefb89657 ("KVM: nVMX: Disable vmcs02 posted interrupts if vmcs12 PID isn't mappable") Fixes: 47d3530f86c0 ("KVM: x86: Exit to userspace when kvm_check_nested_events fails") Cc: stable@vger.kernel.org Cc: Jim Mattson Signed-off-by: Sean Christopherson Message-Id: <20210810144526.2662272-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c1a527a1de46ad6f0f9d5907b29fc98e50267f8e Author: Like Xu Date: Mon Aug 9 17:34:08 2021 +0800 KVM: x86: Clean up redundant ROL16(val, n) macro definition The ROL16(val, n) macro is repeatedly defined in several vmcs-related files, and it has never been used outside the KVM context. Let's move it to vmcs.h without any intended functional changes. Signed-off-by: Like Xu Message-Id: <20210809093410.59304-4-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 65297341d8e15b04cc9e206597a3d7c407c346f6 Author: Uros Bizjak Date: Mon Aug 9 10:39:55 2021 -0700 KVM: x86: Move declaration of kvm_spurious_fault() to x86.h Move the declaration of kvm_spurious_fault() to KVM's "private" x86.h, it should never be called by anything other than low level KVM code. Cc: Paolo Bonzini Cc: Sean Christopherson Signed-off-by: Uros Bizjak [sean: rebased to a series without __ex()/__kvm_handle_fault_on_reboot()] Signed-off-by: Sean Christopherson Message-Id: <20210809173955.1710866-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ad0577c375299a2cc426913c141086c0e9033c78 Author: Sean Christopherson Date: Mon Aug 9 10:39:54 2021 -0700 KVM: x86: Kill off __ex() and __kvm_handle_fault_on_reboot() Remove the __kvm_handle_fault_on_reboot() and __ex() macros now that all VMX and SVM instructions use asm goto to handle the fault (or in the case of VMREAD, completely custom logic). Drop kvm_spurious_fault()'s asmlinkage annotation as __kvm_handle_fault_on_reboot() was the only flow that invoked it from assembly code. Cc: Uros Bizjak Cc: Like Xu Signed-off-by: Sean Christopherson Message-Id: <20210809173955.1710866-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 2fba4fc155280727b4997c6ee86f24c260dd9155 Author: Sean Christopherson Date: Tue Aug 10 10:19:52 2021 -0700 KVM: VMX: Hide VMCS control calculators in vmx.c Now that nested VMX pulls KVM's desired VMCS controls from vmcs01 instead of re-calculating on the fly, bury the helpers that do the calcluations in vmx.c. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210810171952.2758100-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit b6247686b7571003eca2305b2096f59e1e1ce976 Author: Sean Christopherson Date: Tue Aug 10 10:19:51 2021 -0700 KVM: VMX: Drop caching of KVM's desired sec exec controls for vmcs01 Remove the secondary execution controls cache now that it's effectively dead code; it is only read immediately after it is written. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210810171952.2758100-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 389ab25216c9d09e0d335e764eeeb84c2089614f Author: Sean Christopherson Date: Tue Aug 10 10:19:50 2021 -0700 KVM: nVMX: Pull KVM L0's desired controls directly from vmcs01 When preparing controls for vmcs02, grab KVM's desired controls from vmcs01's shadow state instead of recalculating the controls from scratch, or in the secondary execution controls, instead of using the dedicated cache. Calculating secondary exec controls is eye-poppingly expensive due to the guest CPUID checks, hence the dedicated cache, but the other calculations aren't exactly free either. Explicitly clear several bits (x2APIC, DESC exiting, and load EFER on exit) as appropriate as they may be set in vmcs01, whereas the previous implementation relied on dynamic bits being cleared in the calculator. Intentionally propagate VM_{ENTRY,EXIT}_LOAD_IA32_PERF_GLOBAL_CTRL from vmcs01 to vmcs02. Whether or not PERF_GLOBAL_CTRL is loaded depends on whether or not perf itself is active, so unless perf stops between the exit from L1 and entry to L2, vmcs01 will hold the desired value. This is purely an optimization as atomic_switch_perf_msrs() will set/clear the control as needed at VM-Enter, i.e. it avoids two extra VMWRITEs in the case where perf is active (versus starting with the bits clear in vmcs02, which was the previous behavior). Cc: Zeng Guang Signed-off-by: Sean Christopherson Message-Id: <20210810171952.2758100-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ee3b6e41bc26c628b0c06aacd2758a316fe583be Author: Paolo Bonzini Date: Tue Aug 10 06:21:30 2021 -0400 KVM: stats: remove dead stores These stores are copied and pasted from the "if" statements above. They are dead and while they are not really a bug, they can be confusing to anyone reading the code as well. Remove them. Reported-by: kernel test robot Signed-off-by: Paolo Bonzini commit 1ccb6f983a063e794daeb03f90b3517f87dfae8f Author: Paolo Bonzini Date: Tue Aug 10 06:11:35 2021 -0400 KVM: VMX: Reset DR6 only when KVM_DEBUGREG_WONT_EXIT The commit efdab992813fb ("KVM: x86: fix escape of guest dr6 to the host") fixed a bug by resetting DR6 unconditionally when the vcpu being scheduled out. But writing to debug registers is slow, and it can be visible in perf results sometimes, even if neither the host nor the guest activate breakpoints. Since KVM_DEBUGREG_WONT_EXIT on Intel processors is the only case where DR6 gets the guest value, and it never happens at all on SVM, the register can be cleared in vmx.c right after reading it. Reported-by: Lai Jiangshan Signed-off-by: Paolo Bonzini commit 375e28ffc0cf4fc48862c03994ec4a93254cf1c6 Author: Paolo Bonzini Date: Tue Aug 10 06:07:06 2021 -0400 KVM: X86: Set host DR6 only on VMX and for KVM_DEBUGREG_WONT_EXIT Commit c77fb5fe6f03 ("KVM: x86: Allow the guest to run with dirty debug registers") allows the guest accessing to DRs without exiting when KVM_DEBUGREG_WONT_EXIT and we need to ensure that they are synchronized on entry to the guest---including DR6 that was not synced before the commit. But the commit sets the hardware DR6 not only when KVM_DEBUGREG_WONT_EXIT, but also when KVM_DEBUGREG_BP_ENABLED. The second case is unnecessary and just leads to a more case which leaks stale DR6 to the host which has to be resolved by unconditionally reseting DR6 in kvm_arch_vcpu_put(). Even if KVM_DEBUGREG_WONT_EXIT, however, setting the host DR6 only matters on VMX because SVM always uses the DR6 value from the VMCB. So move this line to vmx.c and make it conditional on KVM_DEBUGREG_WONT_EXIT. Reported-by: Lai Jiangshan Signed-off-by: Paolo Bonzini commit 34e9f860071f717965f1816171a11eaf2d378ee0 Author: Lai Jiangshan Date: Tue Aug 10 01:43:05 2021 +0800 KVM: X86: Remove unneeded KVM_DEBUGREG_RELOAD Commit ae561edeb421 ("KVM: x86: DR0-DR3 are not clear on reset") added code to ensure eff_db are updated when they're modified through non-standard paths. But there is no reason to also update hardware DRs unless hardware breakpoints are active or DR exiting is disabled, and in those cases updating hardware is handled by KVM_DEBUGREG_WONT_EXIT and KVM_DEBUGREG_BP_ENABLED. KVM_DEBUGREG_RELOAD just causes unnecesarry load of hardware DRs and is better to be removed. Suggested-by: Sean Christopherson Signed-off-by: Lai Jiangshan Message-Id: <20210809174307.145263-1-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 9a63b4517c606bfbccd063ffc4188e059d4fa23f Merge: c3e9434c9852c ce25681d59ffc Author: Paolo Bonzini Date: Fri Aug 13 03:35:01 2021 -0400 Merge branch 'kvm-tdpmmu-fixes' into HEAD Merge topic branch with fixes for 5.14-rc6 and 5.15 merge window. commit faa186adbd06f3e7113ae1dc6766e2273d5d9231 Author: Ezequiel Garcia Date: Thu May 6 08:11:36 2021 -0300 dt-bindings: timer: convert rockchip,rk-timer.txt to YAML Convert Rockchip Timer dt-bindings to YAML. Signed-off-by: Ezequiel Garcia Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210506111136.3941-4-ezequiel@collabora.com commit 88183788eacb782eb6e1295f1934fb9531b503d6 Author: Will Deacon Date: Tue Jun 8 16:43:41 2021 +0100 clocksource/drivers/exynos_mct: Mark MCT device as CLOCK_EVT_FEAT_PERCPU The "mct_tick" is a per-cpu clockevents device. Set the CLOCK_EVT_FEAT_PERCPU feature to prevent e.g. mct_tick0 being unsafely designated as the global broadcast timer and instead treat the device as a per-cpu wakeup timer. Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Krzysztof Kozlowski Signed-off-by: Will Deacon Acked-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210608154341.10794-3-will@kernel.org commit ae460fd9164b16654d8ec06cbc280b832f840eac Author: Will Deacon Date: Tue Jun 8 16:43:40 2021 +0100 clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64 All arm64 CPUs feature an architected timer, which offers a relatively low-latency interface to a per-cpu clocksource and timer. For the most part, using this interface is a no-brainer, with the exception of SoCs where it cannot be used to wake up from deep idle state (i.e. CLOCK_EVT_FEAT_C3STOP is set). On the contrary, the Exynos MCT is extremely slow to access yet can be used as a wakeup source. In preparation for using the Exynos MCT as a potential wakeup timer for the Arm architected timer, reduce its ratings so that the architected timer is preferred. This effectively reverts the decision made in 6282edb72bed ("clocksource/drivers/exynos_mct: Increase priority over ARM arch timer") for arm64, as the reasoning for the original change was to work around a 32-bit SoC design. Cc: Marek Szyprowski Cc: Krzysztof Kozlowski Cc: Chanwoo Choi Cc: Thomas Gleixner Signed-off-by: Will Deacon Tested-by: Krzysztof Kozlowski # exynos-5422 Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210608154341.10794-2-will@kernel.org commit 9a4d22f7955ee365f7829859f599a01b3ffd850b Author: Sam Protsenko Date: Wed Aug 11 14:48:26 2021 +0300 tty: serial: samsung: Add Exynos850 SoC data Add serial driver data for Exynos850 SoC. This driver data is basically reusing EXYNOS_COMMON_SERIAL_DRV_DATA, which is common for all Exynos chips, but also enables USI init, which was added in previous commit: "tty: serial: samsung: Init USI to keep clocks running". Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210811114827.27322-7-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit f63299b3972d07c3c436fc13949d05d8dcf5e41c Author: Sam Protsenko Date: Wed Aug 11 14:48:25 2021 +0300 tty: serial: samsung: Fix driver data macros style Make checkpatch happy by fixing this error: ERROR: Macros with complex values should be enclosed in parentheses Although this change is made to keep macros consistent with consequent patches (adding driver data for new SoC), it's intentionally added as a separate patch to ease possible porting efforts in future. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210811114827.27322-6-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit 920792aa44ffb255c66d5295d71cc747d038cc98 Author: Sam Protsenko Date: Wed Aug 11 14:48:24 2021 +0300 tty: serial: samsung: Init USI to keep clocks running UART block is a part of USI (Universal Serial Interface) IP-core in Samsung SoCs since Exynos9810 (e.g. in Exynos850). USI allows one to enable one of three types of serial interface: UART, SPI or I2C. That's possible because USI shares almost all internal circuits within each protocol. USI also provides some additional registers so it's possible to configure it. One USI register called USI_OPTION has reset value of 0x0. Because of this the clock gating behavior is controlled by hardware (HWACG = Hardware Auto Clock Gating), which simply means the serial won't work after reset as is. In order to make it work, USI_OPTION[2:1] bits must be set to 0b01, so that HWACG is controlled manually (by software). Bits meaning: - CLKREQ_ON = 1: clock is continuously provided to IP - CLKSTOP_ON = 0: drive IP_CLKREQ to High (needs to be set along with CLKREQ_ON = 1) USI is not present on older chips, like s3c2410, s3c2412, s3c2440, s3c6400, s5pv210, exynos5433, exynos4210. So the new boolean field '.has_usi' was added to struct s3c24xx_uart_info. USI registers will be only actually accessed when '.has_usi' field is set to "1". This feature is needed for further serial enablement on Exynos850, but some other new Exynos chips (like Exynos9810) may benefit from this feature as well. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210811114827.27322-5-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit 541b84eceef116a215e7c0d8bf1d35020bd4eafb Author: Andy Shevchenko Date: Fri Aug 6 14:17:36 2021 +0300 platform/surface: aggregator: Use serdev_acpi_get_uart_resource() helper serdev provides a generic helper to get UART Serial Bus resources. Use it instead of an open coded variant. Reviewed-by: Maximilian Luz Acked-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210806111736.66591-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0a732d7dfb44da367405b23a54b305d0979e02c1 Author: Andy Shevchenko Date: Fri Aug 6 14:17:35 2021 +0300 serdev: Split and export serdev_acpi_get_uart_resource() The same as for I²C Serial Bus resource split and export serdev_acpi_get_uart_resource(). We have already a few users one of which is converted here. Rationale of this is to consolidate parsing UART Serial Bus resource in one place as it's done, e.g., for I²C Serial Bus. Reviewed-by: Hans de Goede Acked-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210806111736.66591-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 217b04c67b6bca03a484bf8cad44596a34a9de4c Author: Tang Bin Date: Wed Aug 11 18:51:36 2021 +0800 serial: stm32: fix the conditional expression writing In the function stm32_usart_init_port, intent of the code maybe when irq returns a value of zero, the return should be '-ENODEV'. But the conditional expression '? :' maybe clerical error, it should be '?:' to make '-ENODEV' work. But in fact, as the example in platform.c is * int irq = platform_get_irq(pdev, 0); * if (irq < 0) * return irq; So the return value of zero is unnecessary to check, at last remove the unnecessary '?: -ENODEV'. Co-developed-by: Zhang Shengju Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210811105136.25392-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit ecff88e819e31081d41cd05bb199b9bd10e13e90 Author: Sergey Shtylyov Date: Mon Aug 9 23:35:11 2021 +0300 usb: gadget: udc: s3c2410: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_irq() with the invalid IRQ #s. Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Reviewed-by: Krzysztof Kozlowski Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/bd69b22c-b484-5a1f-c798-78d4b78405f2@omp.ru Signed-off-by: Greg Kroah-Hartman commit 50855c31573b02963f0aa2aacfd4ea41c31ae0e0 Author: Sergey Shtylyov Date: Mon Aug 9 23:27:28 2021 +0300 usb: gadget: udc: at91: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management") Signed-off-by: Sergey Shtylyov Acked-by: Felipe Balbi Link: https://lore.kernel.org/r/6654a224-739a-1a80-12f0-76d920f87b6c@omp.ru Signed-off-by: Greg Kroah-Hartman commit 175006956740f70ca23394c58f8d7804776741bd Author: Sergey Shtylyov Date: Mon Aug 9 23:23:51 2021 +0300 usb: dwc3: qcom: add IRQ check In dwc3_qcom_acpi_register_core(), the driver neglects to check the result of platform_get_irq()'s call and blithely assigns the negative error codes to the allocated child device's IRQ resource and then passing this resource to platform_device_add_resources() and later causing dwc3_otg_get_irq() to fail anyway. Stop calling platform_device_add_resources() with the invalid IRQ #s, so that there's less complexity in the IRQ error checking. Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/45fec3da-1679-5bfe-5d74-219ca3fb28e7@omp.ru Signed-off-by: Greg Kroah-Hartman commit baa2986bda3f7b2386607587a4185e3dff8f98df Author: Sergey Shtylyov Date: Mon Aug 9 23:21:14 2021 +0300 usb: dwc3: meson-g12a: add IRQ check The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_threaded_irq() with the invalid IRQ #s. Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching") Reviewed-by: Martin Blumenstingl Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/96106462-5538-0b2f-f2ab-ee56e4853912@omp.ru Signed-off-by: Greg Kroah-Hartman commit 5324bad66f09fdade4d72f3b8b55caf595557e3d Author: Argishti Aleksanyan Date: Tue Aug 10 06:42:58 2021 -0400 usb: dwc2: gadget: implement udc_set_speed() Implemented udc_set_speed() gadget ops to allow the udc to select the gadget speed on initialization. Acked-by: Minas Harutyunyan Signed-off-by: Argishti Aleksanyan Link: https://lore.kernel.org/r/c453469d618100321c876a8c2b0ebee15a456eac.1628583235.git.aleksan@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 0bd35146642bdc56f1b87d75f047b1c92bd2bd39 Author: Nathan Chancellor Date: Thu Aug 12 13:40:27 2021 -0700 staging: r8188eu: Reorganize error handling in rtw_drv_init() After commit 987219ad34a6 ("staging: r8188eu: remove lines from Makefile that silence build warnings"), clang warns: drivers/staging/r8188eu/os_dep/usb_intf.c:726:6: warning: variable 'status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!if1) { ^~~~ drivers/staging/r8188eu/os_dep/usb_intf.c:741:6: note: uninitialized use occurs here if (status != _SUCCESS) ^~~~~~ drivers/staging/r8188eu/os_dep/usb_intf.c:726:2: note: remove the 'if' if its condition is always false if (!if1) { ^~~~~~~~~~~ drivers/staging/r8188eu/os_dep/usb_intf.c:714:12: note: initialize the variable 'status' to silence this warning int status; ^ = 0 1 warning generated. status is not initialized if the call to usb_dvobj_init() or rtw_usb_if1_init() fails. Looking at the error function as a whole, the error handling is odd compared to the rest of the kernel, which prefers to set error codes on goto paths, rather than a global "status" variable which determines the error code at the end of the function and function calls in the case of error. Rearrange the error handling of this function to bring it more inline with how the kernel does it in most cases, which helps readability. The call to rtw_usb_if1_deinit() is eliminated because it is not possible to ever hit it; if rtw_usb_if1_init() fails, the goto call jumps over the call to rtw_usb_if1_deinit() and in the success case, status is set to _SUCCESS. Acked-by: Phillip Potter Acked-by: Fabio M. De Francesco Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210812204027.338872-4-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 72a5e1d7496309e9734d20073a81a9bbffd8d79d Author: Nathan Chancellor Date: Thu Aug 12 13:40:26 2021 -0700 staging: r8188eu: Remove uninitialized use of ether_type in portctrl() After commit 987219ad34a6 ("staging: r8188eu: remove lines from Makefile that silence build warnings"), clang warns: drivers/staging/r8188eu/core/rtw_recv.c:499:8: warning: variable 'ether_type' is uninitialized when used here [-Wuninitialized] if (ether_type == eapol_type) ^~~~~~~~~~ drivers/staging/r8188eu/core/rtw_recv.c:458:16: note: initialize the variable 'ether_type' to silence this warning u16 ether_type; ^ = 0 1 warning generated. This if statement sets the exact same assignment as above so just remove it. Acked-by: Phillip Potter Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210812204027.338872-3-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 32755b2434967e9d88ad626820c5506513c5c728 Author: Nathan Chancellor Date: Thu Aug 12 13:40:25 2021 -0700 staging: r8188eu: Remove unused static inline functions in rtw_recv.h After commit 987219ad34a6 ("staging: r8188eu: remove lines from Makefile that silence build warnings"), clang warns several times: In file included from drivers/staging/r8188eu/os_dep/../include/drv_types.h:22: drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:395:9: warning: variable 'buf_desc' is uninitialized when used here [-Wuninitialized] return buf_desc; ^~~~~~~~ drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:391:25: note: initialize the variable 'buf_desc' to silence this warning unsigned char *buf_desc; ^ = NULL drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:412:52: warning: variable 'buf_star' is uninitialized when used here [-Wuninitialized] precv_frame = rxmem_to_recvframe((unsigned char *)buf_star); ^~~~~~~~ drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:410:14: note: initialize the variable 'buf_star' to silence this warning u8 *buf_star; ^ = NULL 2 warnings generated. The functions that these warnings come from are not used or are called from functions that are not used so just remove them to remove the warnings. Acked-by: Phillip Potter Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210812204027.338872-2-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 347c9e5201a3e2bb2c84bcb7a04a6ac6b6c3cc33 Author: Michael Straube Date: Thu Aug 12 15:20:57 2021 +0200 staging: r8188eu: replace custom hwaddr_aton_i() with mac_pton() Replace custom hwaddr_aton_i() with mac_pton() in core/ioctl_linux.c and remove the now unused functions hwaddr_aton_i() and hex2num_i(). Acked-by: Phillip Potter Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210812132057.22579-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1a04830169d00cde48e13072a1ed2222784a958b Author: Stefan Binding Date: Thu Aug 12 19:34:32 2021 +0100 ALSA: hda/cs8409: Prevent pops and clicks during suspend Some of the register values set for type detection cause pops during suspend, ensure these are cleaned up after type detection completes, as well ensuring that these are cleared when we suspend. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210812183433.6330-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0c4aa67735b754b735b85edfc909163f9289fcc2 Author: Pierre-Louis Bossart Date: Thu Aug 12 17:59:04 2021 -0500 ALSA: hda_audio_ext: fix kernel-doc Add missing @ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210812225904.171529-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 360a5812b9237a1dcc8da259e6e570a4b45379bd Author: Pierre-Louis Bossart Date: Thu Aug 12 17:59:03 2021 -0500 ALSA: core: control_led: use strscpy instead of strlcpy strlcpy is deprecated, use its safe replacement Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Paul Olaru Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20210812225904.171529-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit d75b9fa053e4cd278281386d860c26fdbfbe9d03 Author: Andreas Gruenbacher Date: Wed Jul 28 07:47:34 2021 -0500 gfs2: Switch to may_setattr in gfs2_setattr The permission check in gfs2_setattr is an old and outdated version of may_setattr(). Switch to the updated version. Fixes fstest generic/079. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Signed-off-by: Al Viro commit 7bb698f09bdd01fbb6d48c14bb1dde556dc1af00 Author: Andreas Gruenbacher Date: Wed Jul 28 07:47:33 2021 -0500 fs: Move notify_change permission checks into may_setattr Move the permission checks in notify_change into a separate function to make them available to filesystems. When notify_change is called, the vfs performs those checks before calling into iop->setattr. However, a filesystem like gfs2 can only lock and revalidate the inode inside ->setattr, and it must then repeat those checks to err on the safe side. It would be nice to get rid of the double checking, but moving the permission check into iop->setattr altogether isn't really an option. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Signed-off-by: Al Viro commit 92cc94adfce4683d0b421cbf59013703368aaeb9 Author: Martin K. Petersen Date: Tue Jun 8 23:39:19 2021 -0400 scsi: mpi3mr: Use the proper SCSI midlayer interfaces for PI Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags Link: https://lore.kernel.org/r/20210806040023.5355-4-martin.petersen@oracle.com Cc: Sreekanth Reddy Cc: Kashyap Desai Acked-by: Kashyap Desai Signed-off-by: Martin K. Petersen commit 40cb6373b46cc5bf7d98e23a0c05f6186b23916b Author: Tao Ren Date: Thu Aug 5 15:28:18 2021 -0700 ARM: dts: aspeed: Add Facebook Fuji (AST2600) BMC Add initial version of device tree for Facebook Fuji (AST2600) BMC. Fuji is Facebook's next generation switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-7-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 2f31f8c2a3aae47041687bd26f21ef62f4de081c Author: Tao Ren Date: Thu Aug 5 15:28:17 2021 -0700 ARM: dts: aspeed: Add Facebook Elbert (AST2600) BMC Add initial version of device tree for Facebook Elbert (AST2600) BMC. Elbert is Facebook's next generation switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-6-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 0ccdd60e51f00fefdddc58a6b9a23ccec2db33ee Author: Tao Ren Date: Thu Aug 5 15:28:16 2021 -0700 ARM: dts: aspeed: Add Facebook Cloudripper (AST2600) BMC Add initial version of device tree for Facebook Cloudripper (AST2600) BMC. Cloudripper is Facebook's next generation switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-5-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 0c6881e86d2f07458f284429759c5332112859ed Author: Tao Ren Date: Thu Aug 5 15:28:15 2021 -0700 ARM: dts: aspeed: Common dtsi for Facebook AST2600 Network BMCs This common descirption is included by all Facebook AST2600 Network BMC platforms to minimize duplicated device entries across Facebook Network BMC device trees. Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-4-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 2cbc14749ae7a62b4b9eb22ce3ba2308d9cd88b8 Author: Tao Ren Date: Thu Aug 5 15:28:14 2021 -0700 ARM: dts: aspeed: wedge400: Use common flash layout Simplify wedge400 flash layout by using the common layout defined in "facebook-bmc-flash-layout-128.dtsi". Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-3-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit b74759f753271ee1fc691d434300f3f3a431a0b1 Author: Tao Ren Date: Thu Aug 5 15:28:13 2021 -0700 ARM: dts: Add Facebook BMC 128MB flash layout This is the layout used by Facebook BMC systems. It describes the fixed flash layout of a 128MB mtd device. Signed-off-by: Tao Ren Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210805222818.8391-2-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 668fff017233ed7d1bc684a23cdf2875be1b5aea Author: Namjae Jeon Date: Thu Aug 12 11:32:28 2021 +0900 ksmbd: update SMB3 multi-channel support in ksmbd.rst ksmbd start supporting SMB3 Multi-channel feature. Mark it as Partially supported till replay/retry mechanisms are implemented. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 323b1ea10263e5f11c9fb12e25f6d8beb327228c Author: Hyunchul Lee Date: Thu Aug 12 10:23:08 2021 +0900 ksmbd: smbd: fix kernel oops during server shutdown if server shutdown happens in the situation that there are connections, workqueue could be destroyed before queueing disconnect work. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 777cad1604d68ed4379ec899d1f7d2f6a29f01f0 Author: Namjae Jeon Date: Fri Aug 13 08:15:33 2021 +0900 ksmbd: remove select FS_POSIX_ACL in Kconfig ksmbd is forcing to turn on FS_POSIX_ACL in Kconfig to use vfs acl functions(posix_acl_alloc, get_acl, set_posix_acl). OpenWRT and other platform doesn't use acl and this config is disable by default in kernel. This patch use IS_ENABLED() to know acl config is enable and use acl function if it is enable. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c6ce2b5716b04cc6ec36fa7e3c3b851368e6ee7c Author: Namjae Jeon Date: Thu Aug 12 10:18:18 2021 +0900 ksmbd: use proper errno instead of -1 in smb2_get_ksmbd_tcon() Use proper errno instead of -1 in smb2_get_ksmbd_tcon(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5ec3df8e98f51e21fe1f46633b6085897f9b040e Author: Namjae Jeon Date: Thu Aug 12 10:17:39 2021 +0900 ksmbd: update the comment for smb2_get_ksmbd_tcon() Update the comment for smb2_get_ksmbd_tcon(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f4228b678b410a401148f9ad9911d0013fa0f24e Author: Namjae Jeon Date: Thu Aug 12 10:16:40 2021 +0900 ksmbd: change int data type to boolean Change data type of function that return only 0 or 1 to boolean. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit eebff916f07775b2ecd9186439e69a70af24630b Author: Marios Makassikis Date: Thu Aug 12 10:12:35 2021 +0900 ksmbd: Fix multi-protocol negotiation To negotiate either the SMB2 protocol or SMB protocol, a client must send a SMB_COM_NEGOTIATE message containing the list of dialects it supports, to which the server will respond with either a SMB_COM_NEGOTIATE or a SMB2_NEGOTIATE response. The current implementation responds with the highest common dialect, rather than looking explicitly for "SMB 2.???" and "SMB 2.002", as indicated in [MS-SMB2]: [MS-SMB2] 3.3.5.3.1: If the server does not implement the SMB 2.1 or 3.x dialect family, processing MUST continue as specified in 3.3.5.3.2. Otherwise, the server MUST scan the dialects provided for the dialect string "SMB 2.???". If the string is not present, continue to section 3.3.5.3.2. If the string is present, the server MUST respond with an SMB2 NEGOTIATE Response as specified in 2.2.4. [MS-SMB2] 3.3.5.3.2: The server MUST scan the dialects provided for the dialect string "SMB 2.002". If the string is present, the client understands SMB2, and the server MUST respond with an SMB2 NEGOTIATE Response. This is an issue if a client attempts to negotiate SMB3.1.1 using a SMB_COM_NEGOTIATE, as it will trigger the following NULL pointer dereference: 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = 1917455e [00000000] *pgd=00000000 Internal error: Oops: 17 [#1] ARM CPU: 0 PID: 60 Comm: kworker/0:1 Not tainted 5.4.60-00027-g0518c02b5c5b #35 Hardware name: Marvell Kirkwood (Flattened Device Tree) Workqueue: ksmbd-io handle_ksmbd_work PC is at ksmbd_gen_preauth_integrity_hash+0x24/0x190 LR is at smb3_preauth_hash_rsp+0x50/0xa0 pc : [<802b7044>] lr : [<802d6ac0>] psr: 40000013 sp : bf199ed8 ip : 00000000 fp : 80d1edb0 r10: 80a3471b r9 : 8091af16 r8 : 80d70640 r7 : 00000072 r6 : be95e198 r5 : ca000000 r4 : b97fee00 r3 : 00000000 r2 : 00000002 r1 : b97fea00 r0 : b97fee00 Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 0005317f Table: 3e7f4000 DAC: 00000055 Process kworker/0:1 (pid: 60, stack limit = 0x3dd1fdb4) Stack: (0xbf199ed8 to 0xbf19a000) 9ec0: b97fee00 00000000 9ee0: be95e198 00000072 80d70640 802d6ac0 b3da2680 b97fea00 424d53ff be95e140 9f00: b97fee00 802bd7b0 bf10fa58 80128a78 00000000 000001c8 b6220000 bf0b7720 9f20: be95e198 80d0c410 bf7e2a00 00000000 00000000 be95e19c 80d0c370 80123b90 9f40: bf0b7720 be95e198 bf0b7720 bf0b7734 80d0c410 bf198000 80d0c424 80d116e0 9f60: bf10fa58 801240c0 00000000 bf10fa40 bf1463a0 bf198000 bf0b7720 80123ed0 9f80: bf077ee4 bf10fa58 00000000 80127f80 bf1463a0 80127e88 00000000 00000000 9fa0: 00000000 00000000 00000000 801010d0 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [<802b7044>] (ksmbd_gen_preauth_integrity_hash) from [<802d6ac0>] (smb3_preauth_hash_rsp+0x50/0xa0) [<802d6ac0>] (smb3_preauth_hash_rsp) from [<802bd7b0>] (handle_ksmbd_work+0x348/0x3f8) [<802bd7b0>] (handle_ksmbd_work) from [<80123b90>] (process_one_work+0x160/0x200) [<80123b90>] (process_one_work) from [<801240c0>] (worker_thread+0x1f0/0x2e4) [<801240c0>] (worker_thread) from [<80127f80>] (kthread+0xf8/0x10c) [<80127f80>] (kthread) from [<801010d0>] (ret_from_fork+0x14/0x24) Exception stack(0xbf199fb0 to 0xbf199ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 Code: e1855803 e5d13003 e1855c03 e5903094 (e1d330b0) ---[ end trace 8d03be3ed09e5699 ]--- Kernel panic - not syncing: Fatal exception smb3_preauth_hash_rsp() panics because conn->preauth_info is only allocated when processing a SMB2 NEGOTIATE request. Fix this by splitting the smb_protos array into two, each containing only SMB1 and SMB2 dialects respectively. While here, make ksmbd_negotiate_smb_dialect() static as it not called from anywhere else. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b769cf44ed55f4b277b89cf53df6092f0c9082d0 Author: Alex Elder Date: Wed Aug 11 09:18:02 2021 -0500 dt-bindings: net: qcom,ipa: make imem interconnect optional On some newer SoCs, the interconnect between IPA and SoC internal memory (imem) is not used. Update the binding to indicate that having just the memory and config interconnects is another allowed configuration. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210811141802.2635424-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 676eec8efd8ed7f051ea84bfa9c1332e656b5c7d Author: Alex Elder Date: Wed Aug 11 08:59:48 2021 -0500 net: ipa: always inline ipa_aggr_granularity_val() It isn't required, but all callers of ipa_aggr_granularity_val() pass a constant value (IPA_AGGR_GRANULARITY) as the usec argument. Two of those callers are in ipa_validate_build(), with the result being passed to BUILD_BUG_ON(). Evidently the "sparc64-linux-gcc" compiler (at least) doesn't always inline ipa_aggr_granularity_val(), so the result of the function is not constant at compile time, and that leads to build errors. Define the function with the __always_inline attribute to avoid the errors. We can see by inspection that the value passed is never zero, so we can just remove its WARN_ON() call. Fixes: 5bc5588466a1f ("net: ipa: use WARN_ON() rather than assertions") Reported-by: kernel test robot Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210811135948.2634264-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit ee9707e8593dfb9a375cf4793c3fd03d4142b463 Author: Waiman Long Date: Wed Aug 11 15:57:07 2021 -0400 cgroup/cpuset: Enable memory migration for cpuset v2 When a user changes cpuset.cpus, each task in a v2 cpuset will be moved to one of the new cpus if it is not there already. For memory, however, they won't be migrated to the new nodes when cpuset.mems changes. This is an inconsistency in behavior. In cpuset v1, there is a memory_migrate control file to enable such behavior by setting the CS_MEMORY_MIGRATE flag. Make it the default for cpuset v2 so that we have a consistent set of behavior for both cpus and memory. There is certainly a cost to make memory migration the default, but it is a one time cost that shouldn't really matter as long as cpuset.mems isn't changed frequenty. Update the cgroup-v2.rst file to document the new behavior and recommend against changing cpuset.mems frequently. Since there won't be any concurrent access to the newly allocated cpuset structure in cpuset_css_alloc(), we can use the cheaper non-atomic __set_bit() instead of the more expensive atomic set_bit(). Signed-off-by: Waiman Long Acked-by: Johannes Weiner Signed-off-by: Tejun Heo commit 20904527a70de3aff43edafdf5d18b0f6f976f59 Merge: b528dede9bca2 c8cec81305463 Author: Arnd Bergmann Date: Thu Aug 12 23:06:52 2021 +0200 Merge tag 'amlogic-arm-configs-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/defconfig Amlogic ARM configs change for v5.15: - Enable CONFIG_MMC_MESON_MX_SDHC controller used on meson8/8b * tag 'amlogic-arm-configs-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: multi_v7_defconfig: Enable CONFIG_MMC_MESON_MX_SDHC Link: https://lore.kernel.org/r/8e2b5139-86e6-0da3-75c4-d8df66448d51@baylibre.com Signed-off-by: Arnd Bergmann commit b528dede9bca2afc262b841757fa994bd035cb43 Merge: c500bee1c5b2f b62869dcd4bcf Author: Arnd Bergmann Date: Thu Aug 12 23:06:38 2021 +0200 Merge tag 'at91-defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/defconfig AT91 defconfig for 5.15: - add defconfig entries for new SoC: SAMA7G5 - dedicated sama7_defconfig which avoids having to carry older drivers and dependencies from the sama5 family: CACHE_L2X0, CAN_AT91, TOUCHSCREEN_ADC, AT91SAM9X_WATCHDOG, VIDEO_ATMEL_ISI, SND_ATMEL_SOC_I2S, MMC_ATMELMCI, AT_HDMAC, AT91_ADC, REGULATOR_ACT* Addition of new drivers that are not part of any sama5 SoC: SND_MCHP_SOC_I2S_MCC, SND_MCHP_SOC_SPDIFTX|RX, MICROCHIP_PIT64B plus upcoming MIPI pipeline, audio sample rate converter, ... It also maintains both sama5 and sama7 defconfig tailored for their respective families and easy to identify. - addition to the generic multi_v7_defconfig * tag 'at91-defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: multi_v7_defconfig: add sama7g5 SoC ARM: configs: at91: add defconfig for sama7 family of SoCs Link: https://lore.kernel.org/r/20210809134521.10155-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 81b6a285737700c2e04ef0893617b80481b6b4b7 Merge: f73979109bc11 29fabf5274bfb Author: Arnd Bergmann Date: Thu Aug 12 22:56:26 2021 +0200 Merge tag 'omap-for-v5.15/dt-am3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Changes for am3 cpsw and SanCloud for v5.15 A series of changes to update am3 to use cpsw switch driver and few updates to earlier SanCloud changes. The plan was to send the cpsw switch driver changes earlier but looks like I never tagged the mail thread in my inbox to apply for v5.15. * tag 'omap-for-v5.15/dt-am3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x-sancloud-bbe: Drop usb wifi comment ARM: dts: am335x-sancloud-bbe: Fix missing pinctrl refs ARM: dts: am335x-bone: switch to new cpsw switch drv ARM: dts: am33xx: update ethernet aliases ARM: dts: am335x-sl50: switch to new cpsw switch drv ARM: dts: am335x-shc: switch to new cpsw switch drv ARM: dts: am335x-phycore: switch to new cpsw switch drv ARM: dts: am335x-pepper: switch to new cpsw switch drv ARM: dts: am335x-pdu001: switch to new cpsw switch drv ARM: dts: am335x-osd3358-sm-red: switch to new cpsw switch drv ARM: dts: am335x-myirtech: switch to new cpsw switch drv ARM: dts: am335x-moxa-uc: switch to new cpsw switch drv ARM: dts: am335x-lxm: switch to new cpsw switch drv ARM: dts: am335x-igep0033: switch to new cpsw switch drv ARM: dts: am335x-cm-t335: switch to new cpsw switch drv ARM: dts: am335x-chiliboard: switch to new cpsw switch drv ARM: dts: am335x-nano: switch to new cpsw switch drv ARM: dts: am335x-baltos: switch to new cpsw switch drv Link: https://lore.kernel.org/r/pull-1628751694-126144@atomide.com-3 Signed-off-by: Arnd Bergmann commit f73979109bc11a0ed26b6deeb403fb5d05676ffc Merge: 0b72a27e1d5d2 01c72cad790cb Author: Arnd Bergmann Date: Thu Aug 12 22:55:50 2021 +0200 Merge tag 'samsung-dt64-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM64 changes for v5.15 1. Add CPU topology and cache information to Exynos DTSI files. 2. Correct GIC CPU interfaces address range on Exynos7. * tag 'samsung-dt64-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7 arm64: dts: exynos: add CPU topology to Exynos5433 arm64: dts: exynos: Add cpu cache information to Exynos5433 arm64: dts: exynos: Add cpu cache information to Exynos7 Link: https://lore.kernel.org/r/20210811085128.30103-2-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit 0b72a27e1d5d2dc54d289a147411229fa0ed2084 Merge: c2632c3afead6 6cad6db75231a Author: Arnd Bergmann Date: Thu Aug 12 22:55:17 2021 +0200 Merge tag 'samsung-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM changes for v5.15 Add CPU topology to all Exynos DTSI files. * tag 'samsung-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: add CPU topology to Exynos5422 ARM: dts: exynos: add CPU topology to Exynos5420 ARM: dts: exynos: add CPU topology to Exynos5260 ARM: dts: exynos: add CPU topology to Exynos5250 ARM: dts: exynos: add CPU topology to Exynos4412 ARM: dts: exynos: add CPU topology to Exynos4210 ARM: dts: exynos: add CPU topology to Exynos3250 Link: https://lore.kernel.org/r/20210811085128.30103-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit c2632c3afead6e4c6208f90348d142ce1bb372a2 Merge: bcbe4bd39d47b 72ccc373b064a Author: Arnd Bergmann Date: Thu Aug 12 22:54:50 2021 +0200 Merge tag 'amlogic-arm-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM DT changes for v5.15: - meson8: use a default higher default GPU clock to solve probe failure - meson: add AIU audio controller and codec for ec100 - meson8b: fix pwm regulator supply property name * tag 'amlogic-arm-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: dts: meson8b: ec100: Fix the pwm regulator supply properties ARM: dts: meson8b: mxq: Fix the pwm regulator supply properties ARM: dts: meson8b: odroidc1: Fix the pwm regulator supply properties ARM: dts: meson8b: ec100: wire up the RT5640 audio codec ARM: dts: meson: Add the AIU audio controller ARM: dts: meson8: Use a higher default GPU clock frequency Link: https://lore.kernel.org/r/87519792-c9e7-76a6-5db5-0e955286b564@baylibre.com Signed-off-by: Arnd Bergmann commit bcbe4bd39d47bc75c8842477d6f577977d526045 Merge: 5f49f22db4a82 4b5260032ec69 Author: Arnd Bergmann Date: Thu Aug 12 22:53:54 2021 +0200 Merge tag 'amlogic-arm64-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM64 DT changes for v5.15: - nanoki-k2: enable bluetooth - khadas vim & vim2: improve wifi * tag 'amlogic-arm64-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson: improve gxm-khadas-vim2 wifi arm64: dts: meson: improve gxl-s905x-khadas-vim wifi arm64: dts: meson-gxbb: nanopi-k2: Enable Bluetooth Link: https://lore.kernel.org/r/032895d9-62b6-6c9e-b04b-9c3d316f27ec@baylibre.com Signed-off-by: Arnd Bergmann commit 5f49f22db4a82285fbd76b34026051712fdc28ac Merge: 261a910d6cb7f c1fa5ac6c2f47 Author: Arnd Bergmann Date: Thu Aug 12 22:52:49 2021 +0200 Merge tag 'ti-k3-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nmenon/linux into arm/dt Devicetree changes for TI K3 platforms for v5.15 merge window: * New features: - AM64 adds pwm and ecap capability * tag 'ti-k3-dt-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nmenon/linux: arm64: dts: ti: k3-am642-sk: Add pwm nodes arm64: dts: ti: k3-am642-evm: Add pwm nodes arm64: dts: ti: k3-am64-main: Add ecap pwm nodes arm64: dts: ti: k3-am64-main: Add epwm nodes Link: https://lore.kernel.org/r/20210809130631.pfvntcichsyeekbo@festive Signed-off-by: Arnd Bergmann commit 261a910d6cb7f6079974aa61d31124483832911a Merge: eaf05c1fdc14e ce5db043d2e88 Author: Arnd Bergmann Date: Thu Aug 12 22:52:10 2021 +0200 Merge tag 'v5.14-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt MT8173: - Add regulator for MFG_ASYNC power domain - Use alias for MMC to get fixed numbers MT8183: - Use alia for MMC to get fixed numbers - Add optional event number for Global Comman Engine * tag 'v5.14-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: dt-bindings: mediatek: Add optional mediatek,gce-events property arm64: dts: mt8183: add mediatek,gce-events in mutex arm64: dts: mediatek: mt8173: Add domain supply for mfg_async arm64: dts: mt8173: elm: Use aliases to mmc nodes arm64: dts: mt8183: kukui: Use aliases to mmc nodes Link: https://lore.kernel.org/r/26c4026a-9f26-d5a3-c30f-439120a4eaa0@gmail.com Signed-off-by: Arnd Bergmann commit eaf05c1fdc14ed04a47c8632db5ed45010fccd09 Merge: 34827ffe35022 293cb6b0ea19e Author: Arnd Bergmann Date: Thu Aug 12 22:51:23 2021 +0200 Merge tag 'v5.14-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt Increase trip point on MT7623 * tag 'v5.14-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mt7623: increase passive cooling trip Link: https://lore.kernel.org/r/289ded1c-dae7-54ef-6b56-9433bfcaf9de@gmail.com Signed-off-by: Arnd Bergmann commit 34827ffe3502285ce9f588e7427089aff46df790 Merge: 57798ff216ebf f2841e3ab175d Author: Arnd Bergmann Date: Thu Aug 12 22:50:18 2021 +0200 Merge tag 'ixp4xx-dts-arm-soc-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt IXP4xx DTS file updates for the v5.15 kernel cycle: - Fix up some (non-urgent) IRQ flags for the PCI buses. - Add the second UART to the generic ixp4xx.dtsi - Make use of the new expansion bus driver in all device trees with e.g. flash memory on the expansion bus. - Adds the CF card slot to the Gateworks GW2358. - Add new device trees for: - Iomega NAS 100D - D-Link DSM-G600 - Netgear WG302v2 - Arcom Vulcan - Gateworks Avila GW2348 - Intel IXPD425 and siblings - Coyote and IXDPG425 - Linksys WRV54G * tag 'ixp4xx-dts-arm-soc-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ixp4xx: Add a devicetree for Freecom FSG-3 ARM: dts: ixp4xx: Add devicetree for Linksys WRV54G ARM: dts: ixp4xx: Add device trees for Coyote and IXDPG425 ARM: dts: ixp4xx: Add Intel IXDP425 etc reference designs ARM: dts: ixp4xx: Add CF to GW2358 ARM: dts: ixp4xx: Add Gateworks Avila GW2348 device tree ARM: dts: ixp4xx: Add Arcom Vulcan device tree ARM: dts: ixp4xx: Add devicetree for Netgear WG302v2 ARM: dts: ixp4xx: Use the expansion bus ARM: dts: ixp4xx: Add second UART ARM: dts: ixp4xx: Add devicetree for D-Link DSM-G600 rev A ARM: dts: ixp4xx: Move EPBX100 flash to external bus node ARM: dts: ixp4xx: Add devicetree for Iomega NAS 100D ARM: dts: ixp4xx: Fix up bad interrupt flags Link: https://lore.kernel.org/r/CACRpkdY19AvWT--OcmEKbwFue_EcThVs7uZeHkzORten7xj-RA@mail.gmail.com Signed-off-by: Arnd Bergmann commit 57798ff216ebf1145bbbd5ea014ad65a72c1d064 Merge: f3e22d32e4dde 1e6bc5987a525 Author: Arnd Bergmann Date: Thu Aug 12 22:49:21 2021 +0200 Merge tag 'stm32-dt-for-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/dt STM32 DT for v5.15, round 1 Highlights: ---------- -MPU: - ST boards: - Add coporcessor detach mailbox on ED and DKx boards - Fix dtbs_check SAI warnings - DH boards: -Fix some dtbs_check warnings: usb, backlight, hdmi * tag 'stm32-dt-for-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: dts: stm32: Update AV96 adv7513 node per dtbs_check ARM: dts: stm32: Set {bitclock,frame}-master phandles on ST DKx ARM: dts: stm32: Add coprocessor detach mbox on stm32mp15x-dkx boards ARM: dts: stm32: Add coprocessor detach mbox on stm32mp157c-ed1 board ARM: dts: stm32: Add usbphyc_port1 supply on DHCOM SoM ARM: dts: stm32: Add backlight and panel supply on DHCOM SoM ARM: dts: stm32: Set {bitclock,frame}-master phandles on DHCOM SoM ARM: dts: stm32: Fix touchscreen IRQ line assignment on DHCOM ARM: dts: stm32: Disable LAN8710 EDPD on DHCOM ARM: dts: stm32: Prefer HW RTC on DHCOM SoM Link: https://lore.kernel.org/r/e4f0bea3-4065-38d5-f1b2-007e4094c4a8@foss.st.com Signed-off-by: Arnd Bergmann commit f3e22d32e4ddef2980ff9c9c401f7b948030e0be Merge: 3df512524fa81 f9807f9cb3965 Author: Arnd Bergmann Date: Thu Aug 12 22:48:17 2021 +0200 Merge tag 'sti-dt-for-v5.15-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti into arm/dt Highlights: ----------- - Introduce 4KOpen STiH418-b2264 board - Remove clk_ignore_unused from STi boards DT - Remove clock-output-names and clk_critical properties - Update some clock compatible * tag 'sti-dt-for-v5.15-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti: ARM: dts: sti: remove clk_ignore_unused from bootargs for stih410-b2260 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih418-b2199 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih410-b2120 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih407-b2120 ARM: dts: sti: Introduce 4KOpen (stih418-b2264) board ARM: dts: sti: add the thermal sensor node within stih418 ARM: dts: sti: disable rng11 on the stih418 platform ARM: dts: sti: add the spinor controller node within stih407-family ARM: dts: sti: update clkgen-fsyn entries in stih418-clock ARM: dts: sti: update clkgen-fsyn entries in stih410-clock ARM: dts: sti: update clkgen-fsyn entries in stih407-clock ARM: dts: sti: update clkgen-pll entries in stih418-clock ARM: dts: sti: update clkgen-pll entries in stih410-clock ARM: dts: sti: update clkgen-pll entries in stih407-clock ARM: dts: sti: update flexgen compatible within stih410-clock ARM: dts: sti: update flexgen compatible within stih407-clock ARM: dts: sti: update flexgen compatible within stih418-clock Link: https://lore.kernel.org/r/1d95209f-9cb4-47a3-2696-7a93df7cdc05@foss.st.com Signed-off-by: Arnd Bergmann commit 3df512524fa814d17acaef7d534033f2486a7562 Merge: 8e816b9915a13 8c054cd2818ea Author: Arnd Bergmann Date: Thu Aug 12 22:47:01 2021 +0200 Merge tag 'omap-for-v5.15/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Devicetree changes for omaps for v5.15 Devicetree changes for omaps to configure more devices, and add support for new SoC variants and devices: - Add add gpio-line-names for am335x-boneblue - Add support for dra762 abz package - Two patches for McASP support on omap4 - Three patches to add support for am335x-sancloud-bbe-lite - A series of changes to configure PRUSS for am3/4/5 * tag 'omap-for-v5.15/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am57xx: Add PRUSS MDIO controller nodes ARM: dts: am57xx: Add PRU-ICSS nodes ARM: dts: am4372: Add PRUSS MDIO controller node ARM: dts: am4372: Add the PRU-ICSS0 DT node ARM: dts: am4372: Add the PRU-ICSS1 DT node ARM: dts: am335x-icev2: Enable PRU-ICSS module ARM: dts: am335x-evmsk: Enable PRU-ICSS module ARM: dts: am335x-evm: Enable PRU-ICSS module ARM: dts: am335x-bone-common: Enable PRU-ICSS node ARM: dts: am33xx-l4: Add PRUSS MDIO controller node ARM: dts: am33xx-l4: Add PRUSS node ARM: dts: am335x-sancloud-bbe-lite: New devicetree ARM: dts: am335x-sancloud-bbe: Extract common code ARM: dts: am335x-boneblack: Extract HDMI config ARM: dts: omap4-l4-abe: Add McASP configuration ARM: dts: omap4-l4-abe: Correct sidle modes for McASP ARM: dts: Add support for dra762 abz package ARM: dts: am335x-boneblue: add gpio-line-names Link: https://lore.kernel.org/r/pull-1628153040-834155@atomide.com-3 Signed-off-by: Arnd Bergmann commit a2649315bcb88a136ce978a06af8aa23ea8b4154 Author: Fengnan Chang Date: Thu Aug 12 19:36:41 2021 +0800 f2fs: compress: avoid duplicate counting of valid blocks when read compressed file Since cluster is basic unit of compression, one cluster is compressed or not, so we can calculate valid blocks only for first page in cluster, the other pages just skip. Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1bb24be00c8c360e5e3072301d5f49eac86b384f Merge: 866e1691ed5be c0397c85b53d0 Author: Arnd Bergmann Date: Thu Aug 12 22:38:31 2021 +0200 Merge tag 'scmi-updates-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers SCMI Updates for v5.15 The bulk of the addition this time is mainly refactoring to add support for Virtio transport for SCMI and the addition of the support itself. The refactoring includes allowing transport specific init/exit calls, making each transport as compile time configurable, supporting monotonically increasing tokens instead of using the next available free buffer index as the token for scmi messages which eases handling concurrent and out-of-order messages which is a must have for virtio transport. Virtio support itself is conformant to the virtio SCMI device spec [1]. Virtio device id 32 has been reserved for the SCMI device [2]. Other than the virtio support, there is one bug fix in the probe failure clean up path. [1] https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-scmi.tex [2] https://www.oasis-open.org/committees/ballot.php?id=3496 * tag 'scmi-updates-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Use WARN_ON() to check configured transports firmware: arm_scmi: Fix boolconv.cocci warnings firmware: arm_scmi: Free mailbox channels if probe fails firmware: arm_scmi: Add virtio transport firmware: arm_scmi: Add priv parameter to scmi_rx_callback dt-bindings: arm: Add virtio transport for SCMI firmware: arm_scmi: Add optional link_supplier() transport op firmware: arm_scmi: Add message passing abstractions for transports firmware: arm_scmi: Add method to override max message number firmware: arm_scmi: Make shmem support optional for transports firmware: arm_scmi: Make SCMI transports configurable firmware: arm_scmi: Make polling mode optional firmware: arm_scmi: Make .clear_channel optional firmware: arm_scmi: Handle concurrent and out-of-order messages firmware: arm_scmi: Introduce monotonically increasing tokens firmware: arm_scmi: Add optional transport_init/exit support firmware: arm_scmi: Remove scmi_dump_header_dbg() helper firmware: arm_scmi: Add support for type handling in common functions Link: https://lore.kernel.org/r/20210811075743.707961-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 866e1691ed5beee933c0f8c9268963c33377ede6 Merge: 0dc76ecbbf15c 62e8ce8506f5a Author: Arnd Bergmann Date: Thu Aug 12 22:37:50 2021 +0200 Merge tag 'drivers_soc_for_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/drivers soc: Keystone SOC drivers for v5.15 The pull request contains: - ICSSG subsystem support for Keystone3 AM64x SOCs - Removes smartrefelx PM dependency for deeper low power states * tag 'drivers_soc_for_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: dt-bindings: soc: ti: pruss: Add dma-coherent property soc: ti: Remove pm_runtime_irq_safe() usage for smartreflex soc: ti: pruss: Enable support for ICSSG subsystems on K3 AM64x SoCs dt-bindings: soc: ti: pruss: Update bindings for K3 AM64x SoCs Link: https://lore.kernel.org/r/0A637A41-2353-4900-962C-DBE50BBDE75A@oracle.com Signed-off-by: Arnd Bergmann commit 0dc76ecbbf15c43197f204c6631c6ef12f00d6ba Merge: a8c371f0cfe72 c28b584deb1bc Author: Arnd Bergmann Date: Thu Aug 12 22:36:56 2021 +0200 Merge tag 'memory-controller-drv-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.15 Few minor fixes: maintainer pattern, unused-function warning in Tegra186 and suspend/resume in OMAP GPMC. * tag 'memory-controller-drv-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: omap-gpmc: Drop custom PM calls with cpu_pm notifier memory: omap-gpmc: Clear GPMC_CS_CONFIG7 register on restore if unused MAINTAINERS: update arm,pl353-smc.yaml reference memory: tegra: fix unused-function warning Link: https://lore.kernel.org/r/20210809152639.110576-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit a8c371f0cfe7224e4bc3f3f0495e54a035107653 Merge: a41461b6c4004 25423731956b3 Author: Arnd Bergmann Date: Thu Aug 12 22:35:50 2021 +0200 Merge tag 'v5.14-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers pm-domains: - correct mask define if used for update on TOPAXI bus - mt8173: enable regulator befor turning on MFG_ASYNC mmsys: - add a mask property to the routing information - add support for MT8365 - add UFOE routing for MT8173 * tag 'v5.14-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: mmsys: Fix missing UFOE component in mt8173 table routing soc: mediatek: mmsys: add MT8365 support soc: mmsys: mediatek: add mask to mmsys routes soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD soc: mediatek: pm-domains: Use correct mask for bus_prot_clr Link: https://lore.kernel.org/r/49fc7bef-20db-b98c-9437-dd9e4d00e870@gmail.com Signed-off-by: Arnd Bergmann commit a41461b6c400442fce28f706b7e9d03d3cab8f9e Merge: d2c334f49c830 4e2b10be1f4fe Author: Arnd Bergmann Date: Thu Aug 12 22:34:44 2021 +0200 Merge tag 'imx-ecspi-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX eCSPI errata handling for 5.15: It includes all required changes for handling i.MX6/7 eCSPI errata ERR009165, which causes FIFO transfer to be sent twice in DMA mode. Both SPI and DMA maintainers agree to merge it through arm-soc tree. * tag 'imx-ecspi-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dmaengine: imx-sdma: add terminated list for freed descriptor in worker dmaengine: imx-sdma: add uart rom script dma: imx-sdma: add i.mx6ul compatible name dmaengine: imx-sdma: remove ERR009165 on i.mx6ul spi: imx: remove ERR009165 workaround on i.mx6ul spi: imx: fix ERR009165 dmaengine: imx-sdma: add mcu_2_ecspi script dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script dmaengine: imx-sdma: remove duplicated sdma_load_context Revert "dmaengine: imx-sdma: refine to load context only once" Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Link: https://lore.kernel.org/r/20210809071838.GF30984@dragon Signed-off-by: Arnd Bergmann commit f80e21489590c00f46226d5802d900e6f66e5633 Author: Thomas Gleixner Date: Thu Aug 12 22:32:30 2021 +0200 hrtimer: Unbreak hrtimer_force_reprogram() Since the recent consoliation of reprogramming functions, hrtimer_force_reprogram() is affected by a check whether the new expiry time is past the current expiry time. This breaks the NOHZ logic as that relies on the fact that the tick hrtimer is moved into the future. That means cpu_base->expires_next becomes stale and subsequent reprogramming attempts fail as well until the situation is cleaned up by an hrtimer interrupts. For some yet unknown reason this leads to a complete stall, so for now partially revert the offending commit to a known working state. The root cause for the stall is still investigated and will be fixed in a subsequent commit. Fixes: b14bca97c9f5 ("hrtimer: Consolidate reprogramming code") Reported-by: Mike Galbraith Reported-by: Marek Szyprowski Signed-off-by: Thomas Gleixner Tested-by: Mike Galbraith Link: https://lore.kernel.org/r/8735recskh.ffs@tglx commit 9482fd71dbb8f0d1a61821a83e467dc0a9d7b429 Author: Thomas Gleixner Date: Thu Aug 12 22:31:24 2021 +0200 hrtimer: Use raw_cpu_ptr() in clock_was_set() clock_was_set() can be invoked from preemptible context. Use raw_cpu_ptr() to check whether high resolution mode is active or not. It does not matter whether the task migrates after acquiring the pointer. Fixes: e71a4153b7c2 ("hrtimer: Force clock_was_set() handling for the HIGHRES=n, NOHZ=y case") Reported-by: Mike Galbraith Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/875ywacsmb.ffs@tglx commit d2c334f49c8305ff8ce31ea33183977a2935ba55 Author: Dan Carpenter Date: Sun Aug 8 01:00:16 2021 +0200 bus: ixp4xx: return on error in ixp4xx_exp_probe() This code was intended to return an error code if regmap_read() fails but the return statement was missing. Fixes: 1c953bda90ca ("bus: ixp4xx: Add a driver for IXP4xx expansion bus") Signed-off-by: Dan Carpenter Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210807230016.3607666-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 9c8300b1608748669b4b5b67e3fea71d07ca35af Merge: 775dea4deec67 fdc07ca0724dd Author: Arnd Bergmann Date: Thu Aug 12 22:31:57 2021 +0200 Merge tag 'omap-for-v5.15/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/drivers Driver changes for ti-sysc for v5.15 Few ti-sysc changes to handle quirk for McASP SIDLE mode, correct documentation for sysc_ioremap(), and start using pm_runtime_resume_and_get(). * tag 'omap-for-v5.15/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Add quirk for OMAP4 McASP to disable SIDLE mode bus: ti-sysc: using pm_runtime_resume_and_get instead of pm_runtime_get_sync bus: ti-sysc: Correct misdocumentation of 'sysc_ioremap()' bus: ti-sysc: Fix gpt12 system timer issue with reserved status Link: https://lore.kernel.org/r/pull-1628153040-834155@atomide.com-2 Signed-off-by: Arnd Bergmann commit e694952772a7df091a6cffe828409843f53c9822 Merge: 4108b6cc7a600 4297d1c0834af Author: Arnd Bergmann Date: Thu Aug 12 22:29:50 2021 +0200 Merge tag 'omap-for-v5.15/soc-late-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc Two missed SoC changes for omaps for v5.15 I managed to miss applying two out of three Kconfig changes earlier to drop unused entries, here are the missed changes. * tag 'omap-for-v5.15/soc-late-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: arm: omap2: Drop the unused OMAP_PACKAGE_* KConfig entries arm: omap2: Drop obsolete MACH_OMAP3_PANDORA entry Link: https://lore.kernel.org/r/pull-1628751694-126144@atomide.com Signed-off-by: Arnd Bergmann commit 4108b6cc7a600fe9e97ef485a2b8a60e183af465 Merge: 318845985fa03 8d5a937f10ed0 Author: Arnd Bergmann Date: Thu Aug 12 22:25:25 2021 +0200 Merge tag 'omap-for-v5.15/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc SoC changes for omaps for v5.15 Update MAINTAINERS for SanCloud devices and drop unused old Kconfig * tag 'omap-for-v5.15/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: MAINTAINERS: Adopt SanCloud dts files as supported arm: omap2: Drop MACH_OMAP3517EVM entry Link: https://lore.kernel.org/r/pull-1628153040-834155@atomide.com Signed-off-by: Arnd Bergmann commit e81b917a78c7ed08007de5b502a14535daa106bf Author: Andy Shevchenko Date: Thu Aug 12 20:00:25 2021 +0300 clk: fractional-divider: Document the arithmetics used behind the code It appears that some code lines raise the question why they are needed and how they are participated in the calculus of the resulting values. Document this in a form of the top comment in the module file. Reported-by: Liu Ying Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210812170025.67074-4-andriy.shevchenko@linux.intel.com [sboyd@kernel.org: Remove "die" as it isn't relevant] Signed-off-by: Stephen Boyd commit 82f53f9ee5770177eb102446cc3513bf07e2668a Author: Andy Shevchenko Date: Thu Aug 12 20:00:24 2021 +0300 clk: fractional-divider: Introduce POWER_OF_TWO_PS flag The newly introduced POWER_OF_TWO_PS flag, when set, makes the flow to skip the assumption that the caller will use an additional 2^scale prescaler to get the desired clock rate. Reported-by: Liu Ying Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210812170025.67074-3-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd commit 928f9e2686110825262685b7aedc7b21b805fecd Author: Andy Shevchenko Date: Thu Aug 12 20:00:23 2021 +0300 clk: fractional-divider: Hide clk_fractional_divider_ops from wide audience The providers are all located in drivers/clk/ and hence no need to export the clock operations to wider audience. Hide them by moving to drivers/clk/clk-fractional-divider.h. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210812170025.67074-2-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd commit 4e7cf74fa3b28fcb43531ca6bc350bf8636e3de6 Author: Andy Shevchenko Date: Thu Aug 12 20:00:22 2021 +0300 clk: fractional-divider: Export approximation algorithm to the CCF users At least one user currently duplicates some functions that are provided by fractional divider module. Let's export approximation algorithm and replace the open-coded variant. As a bonus the exported function will get better documentation in place. Signed-off-by: Andy Shevchenko Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210812170025.67074-1-andriy.shevchenko@linux.intel.com [sboyd@kernel.org: Add header guard because why not] Signed-off-by: Stephen Boyd commit bf064c7bec3bfe7e28889774dc9e0ca4f7236775 Author: Dwaipayan Ray Date: Fri Jul 30 11:59:51 2021 +0530 char: ipmi: use DEVICE_ATTR helper macro Instead of open coding DEVICE_ATTR, use the helper macro DEVICE_ATTR_RO to replace DEVICE_ATTR with 0444 octal permissions. This was detected as a part of checkpatch evaluation investigating all reports of DEVICE_ATTR_RO warning type. Signed-off-by: Dwaipayan Ray Message-Id: <20210730062951.84876-1-dwaipayanray1@gmail.com> Signed-off-by: Corey Minyard commit ca8c1c53b03b3b1aef5a6efdab7f1af86be0e6d7 Author: Wen Yang Date: Thu Jul 29 17:32:28 2021 +0800 ipmi: rate limit ipmi smi_event failure message Sometimes we can't get a valid si_sm_data, and we print an error message accordingly. But the ipmi module seem to like retrying a lot, in which case we flood the kernel log with a lot of messages, eg: [46318019.164726] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318020.109700] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318021.158677] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318022.212598] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318023.258564] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318024.210455] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318025.260473] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318026.308445] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318027.356389] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318028.298288] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318029.363302] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. Signed-off-by: Wen Yang Cc: Baoyou Xie Cc: Corey Minyard Cc: openipmi-developer@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Message-Id: <20210729093228.77098-1-wenyang@linux.alibaba.com> [Added a missing comma] Signed-off-by: Corey Minyard commit 7eb6ea4148579b85540a41d57bcec315b8af8ff8 Author: Dan Carpenter Date: Thu Aug 12 10:00:04 2021 +0300 PCI: Fix pci_dev_str_match_path() alloc while atomic bug pci_dev_str_match_path() is often called with a spinlock held so the allocation has to be atomic. The call tree is: pci_specified_resource_alignment() <-- takes spin_lock(); pci_dev_str_match() pci_dev_str_match_path() Fixes: 45db33709ccc ("PCI: Allow specifying devices using a base bus and path of devfns") Link: https://lore.kernel.org/r/20210812070004.GC31863@kili Signed-off-by: Dan Carpenter Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit e15ac2080ec2fde6ebc59f1c8afdf7c52374035e Author: Krzysztof Wilczyński Date: Thu Aug 12 17:17:17 2021 +0000 x86/PCI: Add pci_numachip_init() declaration numachip.c defines pci_numachip_init(), but neglected to include its declaration, causing the following sparse and compile time warnings: arch/x86/pci/numachip.c:108:12: warning: no previous prototype for function 'pci_numachip_init' [-Wmissing-prototypes] arch/x86/pci/numachip.c:108:12: warning: symbol 'pci_numachip_init' was not declared. Should it be static? Include asm/numachip/numachip.h, which includes the missing declaration. Link: https://lore.kernel.org/r/20210812171717.1471243-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit fe7568cf2f2dc3a0783f6ffdb3802c1ce2085466 Author: Heiner Kallweit Date: Sun Aug 8 19:23:57 2021 +0200 PCI/VPD: Treat invalid VPD like missing VPD capability Exporting sysfs files that can't be accessed doesn't make much sense. Therefore, if either a quirk or the dynamic size calculation result in VPD being marked as invalid, treat this as though the device has no VPD capability. One consequence is that the "vpd" sysfs file is not visible. Link: https://lore.kernel.org/r/6a02b204-4ed2-4553-c3b2-eacf9554fa8d@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 7bac54497c3e3b2ca37b7043f1fa78586540f10e Author: Heiner Kallweit Date: Sun Aug 8 19:22:52 2021 +0200 PCI/VPD: Determine VPD size in pci_vpd_init() Determine VPD size in pci_vpd_init(). Quirks set dev->vpd.len to a non-zero value, so they cause us to skip the dynamic size calculation. Prerequisite is that we move the quirks from FINAL to HEADER so they are run before pci_vpd_init(). Link: https://lore.kernel.org/r/cc4a6538-557a-294d-4f94-e6d1d3c91589@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit fd00faa375fbb9d46ae0730d0faf4a3006301005 Author: Heiner Kallweit Date: Sun Aug 8 19:21:56 2021 +0200 PCI/VPD: Embed struct pci_vpd in struct pci_dev Now that struct pci_vpd is really small, simplify the code by embedding struct pci_vpd directly in struct pci_dev instead of dynamically allocating it. Link: https://lore.kernel.org/r/d898489e-22ba-71f1-2f31-f1a78dc15849@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 22ff2bcec704a7a8c43a998251e0757cd2de66e1 Author: Heiner Kallweit Date: Sun Aug 8 19:21:02 2021 +0200 PCI/VPD: Remove struct pci_vpd.valid member Instead of having a separate flag, use vp->len != 0 as indicator that VPD validity has been checked. Now vpd->len == PCI_VPD_SZ_INVALID indicates that VPD is invalid. Link: https://lore.kernel.org/r/9f777bc7-5316-e1b8-e5d4-f9f609bdb5dd@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit a38fccdb6289d9e4796e746040b491bb0f31b151 Author: Heiner Kallweit Date: Sun Aug 8 19:20:05 2021 +0200 PCI/VPD: Remove struct pci_vpd_ops Some multi-function devices share VPD hardware across functions and don't work correctly for concurrent VPD accesses to different functions. Struct pci_vpd_ops was added by 932c435caba8 ("PCI: Add dev_flags bit to access VPD through function 0") so that on these devices, VPD accesses to any function would always go to function 0. It's easier to just check for the PCI_DEV_FLAGS_VPD_REF_F0 quirk bit in the two places we need it than to deal with the struct pci_vpd_ops. Simplify the code by removing struct pci_vpd_ops and removing the indirect calls. [bhelgaas: check for !func0_dev earlier, commit log] Link: https://lore.kernel.org/r/b2532a41-df8b-860f-461f-d5c066c819d0@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit d27f7344ba89897d0ce6ebe0c9eecbe214f9bb8f Author: Heiner Kallweit Date: Sun Aug 8 19:19:10 2021 +0200 PCI/VPD: Reorder pci_read_vpd(), pci_write_vpd() Reorder pci_read_vpd() and pci_write_vpd() to prepare for future patches. No functional change intended. Link: https://lore.kernel.org/r/89f0f5a2-293b-a017-fc67-a36473a792bf@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit b6f5558c304a17d4dfad096da980de6e222a462a Author: Wang Jianchao Date: Sat Jul 24 15:41:22 2021 +0800 ext4: remove the repeated comment of ext4_trim_all_free Reviewed-by: Andreas Dilger Signed-off-by: Wang Jianchao Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210724074124.25731-4-jianchao.wan9@gmail.com Signed-off-by: Theodore Ts'o commit 6920b3913235f517728bb69abe9b39047a987113 Author: Wang Jianchao Date: Sat Jul 24 15:41:21 2021 +0800 ext4: add new helper interface ext4_try_to_trim_range() There is no functional change in this patch but just split the codes, which serachs free block and does trim, into a new function ext4_try_to_trim_range. This is preparing for the following async backgroup discard. Reviewed-by: Andreas Dilger Signed-off-by: Wang Jianchao Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210724074124.25731-3-jianchao.wan9@gmail.com Signed-off-by: Theodore Ts'o commit bd2eea8d0a6b6a9aca22f20bf74f73b71d8808af Author: Wang Jianchao Date: Sat Jul 24 15:41:20 2021 +0800 ext4: remove the 'group' parameter of ext4_trim_extent Get rid of the 'group' parameter of ext4_trim_extent as we can get it from the 'e4b'. Reviewed-by: Andreas Dilger Signed-off-by: Wang Jianchao Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20210724074124.25731-2-jianchao.wan9@gmail.com Signed-off-by: Theodore Ts'o commit c7782443a88926a4f938f0193041616328cf2db2 Author: Rob Clark Date: Wed Aug 11 16:52:47 2021 -0700 drm/bridge: ti-sn65dsi86: Avoid creating multiple connectors If we created our own connector because the driver does not support the NO_CONNECTOR flag, we don't want the downstream bridge to *also* create a connector. And if this driver did pass the NO_CONNECTOR flag (and we supported that mode) this would change nothing. Fixes: 4e5763f03e10 ("drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge") Reported-by: Stephen Boyd Signed-off-by: Rob Clark Tested-by: Stephen Boyd Reviewed-by: Laurent Pinchart Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20210811235253.924867-2-robdclark@gmail.com commit 3d2e79894bd7adc7d14638a0c72ceb8b722d1fa3 Author: Christoph Hellwig Date: Tue Aug 10 17:45:12 2021 +0200 block: pass a gendisk to bdev_resize_partition bdev_resize_partition can only operate on the whole device. Make that clear by passing a gendisk instead of a block_device. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210810154512.1809898-5-hch@lst.de Signed-off-by: Jens Axboe commit 926fbb1677e0d963dd96dae3c0305e855590d524 Author: Christoph Hellwig Date: Tue Aug 10 17:45:11 2021 +0200 block: pass a gendisk to bdev_del_partition bdev_del_partition can only operate on the whole device. Make that clear by passing a gendisk instead of a block_device. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210810154512.1809898-4-hch@lst.de Signed-off-by: Jens Axboe commit 7f6be3765e113e0d4b8e6b65e1074982de94377e Author: Christoph Hellwig Date: Tue Aug 10 17:45:10 2021 +0200 block: pass a gendisk to bdev_add_partition bdev_add_partition can only operate on the whole device. Make that clear by passing a gendisk instead of a block_device. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210810154512.1809898-3-hch@lst.de Signed-off-by: Jens Axboe commit a08aa9bccdc282b5e8d133bf8c239473f057b464 Author: Christoph Hellwig Date: Tue Aug 10 17:45:09 2021 +0200 block: store a gendisk in struct parsed_partitions Partition scanning only happens on the whole device, so pass a struct gendisk instead of the whole device block_device to the scanners. This allows to simplify printing the device name in various places as the disk name is available in disk->name. Signed-off-by: Christoph Hellwig Reviewed-by: Stefan Haberland Link: https://lore.kernel.org/r/20210810154512.1809898-2-hch@lst.de Signed-off-by: Jens Axboe commit 50b4aecfbbb09869db967e4a26212a47e10c0088 Author: Christoph Hellwig Date: Mon Aug 9 08:40:28 2021 +0200 block: remove GENHD_FL_UP Just check inode_unhashed on the whole device bdev inode instead, and provide a helper to check for that information. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210809064028.1198327-9-hch@lst.de Signed-off-by: Jens Axboe commit b75f4aed88febe903bd40a6128b74edd2388417e Author: Christoph Hellwig Date: Mon Aug 9 08:40:27 2021 +0200 bcache: move the del_gendisk call out of bcache_device_free Let the callers call del_gendisk so that we can check if add_disk has been called properly for the cached device case instead of relying on the block layer internal GENHD_FL_UP flag. Signed-off-by: Christoph Hellwig Reviewed-by: Coly Li Link: https://lore.kernel.org/r/20210809064028.1198327-8-hch@lst.de Signed-off-by: Jens Axboe commit 224b0683228c5f332f9cee615d85e75e9a347170 Author: Christoph Hellwig Date: Mon Aug 9 08:40:26 2021 +0200 bcache: add proper error unwinding in bcache_device_init Except for the IDA none of the allocations in bcache_device_init is unwound on error, fix that. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Link: https://lore.kernel.org/r/20210809064028.1198327-7-hch@lst.de Signed-off-by: Jens Axboe commit 4f9e14aecfbdc6b762d5122489604858c5fec5e7 Author: Christoph Hellwig Date: Mon Aug 9 08:40:25 2021 +0200 sx8: use the internal state machine to check if del_gendisk needs to be called Remove usage of the block layer internal GENHD_FL_UP by just looking at the host state. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210809064028.1198327-6-hch@lst.de Signed-off-by: Jens Axboe commit 916a470da02f909cabb65337f65438b8bc3965b2 Author: Christoph Hellwig Date: Mon Aug 9 08:40:24 2021 +0200 nvme: replace the GENHD_FL_UP check in nvme_mpath_shutdown_disk Use the nvme-internal NVME_NSHEAD_DISK_LIVE flag instead of abusing the block layer state. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210809064028.1198327-5-hch@lst.de Signed-off-by: Jens Axboe commit 5eba200526ac5fee7659c45b6c23fb2c576f8813 Author: Christoph Hellwig Date: Mon Aug 9 08:40:23 2021 +0200 nvme: remove the GENHD_FL_UP check in nvme_ns_remove Early probe failure never reaches nvme_ns_remove, so GENHD_FL_UP must be set at this point. Remove the check. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210809064028.1198327-4-hch@lst.de Signed-off-by: Jens Axboe commit a94dcfce70d3f4f6cd99f3b43d74305e3a4f3983 Author: Christoph Hellwig Date: Mon Aug 9 08:40:22 2021 +0200 mmc: block: cleanup gendisk creation Restructure mmc_blk_probe to avoid a failure path with a half created disk. Signed-off-by: Christoph Hellwig Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20210809064028.1198327-3-hch@lst.de Signed-off-by: Jens Axboe commit 29e6a5e01d0adae52a2859ed39cb9e607430e011 Author: Christoph Hellwig Date: Mon Aug 9 08:40:21 2021 +0200 mmc: block: let device_add_disk create disk attributes Pass the attribute group for the attributes on the gendisk to device_add_disk so that they are created atomically with the disk creation. Signed-off-by: Christoph Hellwig Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20210809064028.1198327-2-hch@lst.de Signed-off-by: Jens Axboe commit e4ec7a49ef8bb4edc85a0eee005d59fa65c94a0e Author: Hans de Goede Date: Tue Aug 3 18:00:44 2021 +0200 platform/x86: intel_cht_int33fe: Use the new i2c_acpi_client_count() helper Use the new i2c_acpi_client_count() helper, this results in a nice cleanup. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210803160044.158802-5-hdegoede@redhat.com commit 5791c2648dc468c00de405b2af32c5189d5cb345 Author: Hans de Goede Date: Tue Aug 3 18:00:43 2021 +0200 platform/x86: i2c-multi-instantiate: Use the new i2c_acpi_client_count() helper Use the new i2c_acpi_client_count() helper, this results in a nice cleanup. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210803160044.158802-4-hdegoede@redhat.com commit f13d483eafdf60fc809e555e0329ee6257582612 Author: Hans de Goede Date: Tue Aug 3 18:00:42 2021 +0200 platform/x86: dual_accel_detect: Use the new i2c_acpi_client_count() helper Use the new i2c_acpi_client_count() helper, this results in a nice cleanup. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210803160044.158802-3-hdegoede@redhat.com commit 20a1b3acfc802ad7b6b327f2bdc0570711538561 Author: Hans de Goede Date: Tue Aug 3 18:00:41 2021 +0200 i2c: acpi: Add an i2c_acpi_client_count() helper function We have 3 files now which have the need to count the number of I2cSerialBus resources in an ACPI-device's resource-list. Currently all implement their own helper function for this, add a generic helper function to replace the 3 implementations. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210803160044.158802-2-hdegoede@redhat.com Acked-by: Mika Westerberg Acked-by: Wolfram Sang commit 382b91db8044669d254006df799df9d85d4ad891 Author: Luke D. Jones Date: Sat Aug 7 14:36:56 2021 +1200 asus-wmi: Add egpu enable method The X13 Flow laptops can utilise an external GPU. This requires toggling an ACPI method which will first disable the internal dGPU, and then enable the eGPU. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20210807023656.25020-4-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 98829e84dc67630efb7de675f0a70066620468a3 Author: Luke D. Jones Date: Sat Aug 7 14:36:55 2021 +1200 asus-wmi: Add dgpu disable method In Windows the ASUS Armory Crate program can enable or disable the dGPU via a WMI call. This functions much the same as various Linux methods in software where the dGPU is removed from the device tree. However the WMI call saves the state of dGPU (enabled or not) and this then changes the dGPU visibility in Linux with no way for Linux users to re-enable it. We expose the WMI method so users can see and change the dGPU ACPI state. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20210807023656.25020-3-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ca91ea34778f9b2a44a391b10164bcd73b4b0f25 Author: Luke D. Jones Date: Sat Aug 7 14:36:54 2021 +1200 asus-wmi: Add panel overdrive functionality Some ASUS ROG laptops have the ability to drive the display panel a higher rate to eliminate or reduce ghosting. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20210807023656.25020-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 37397b092e7f4b520a257aaafe83f868cd3d5e27 Author: Akira Yokosawa Date: Tue Aug 10 18:16:32 2021 +0900 docs: sphinx-requirements: Move sphinx_rtd_theme to top sphinx_rtd_theme 0.5.2 has "docutils<0.17" in its requirements. docutils 0.17 released this April caused regression in sphinx_rtd_theme 0.5.1 [1]. By removing docutils and moving sphinx_rtd_theme before Sphinx in requirements.txt, the requirement of "docutils<0.17" can be met naturally. [1]: https://github.com/readthedocs/sphinx_rtd_theme/issues/1112 Signed-off-by: Akira Yokosawa Cc: Mauro Carvalho Chehab Acked-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/75f14c88-6091-1072-41cb-16b886aee5a0@gmail.com Signed-off-by: Jonathan Corbet commit e0d14a5d2ff1bec970b820181d45d2e75369030b Author: Akira Yokosawa Date: Mon Aug 9 10:29:09 2021 +0900 docs: pdfdocs: Enable language-specific font choice of zh_TW translations The "TC" variants are supposed to be the choice for traditional Chinese documents. Signed-off-by: Akira Yokosawa Reviewed-by: Hu Haowen Tested-by: Hu Haowen Link: https://lore.kernel.org/r/9d8e8fa2-3e7a-3a0a-1a0d-7d797a605ff8@gmail.com Signed-off-by: Jonathan Corbet commit 29ac9822358f0680e4020a15dcfea1c76011e872 Author: Akira Yokosawa Date: Mon Aug 9 10:27:18 2021 +0900 docs: pdfdocs: Teach xeCJK about character classes of quotation marks Quotation marks in "KR" and "JP" variants of Noto CJK fonts are half width. xeCJK assumes they are full width by default and does excessive kerning around them in Korean and Japanese translations. Give xeCJK proper hints by the \xeCJKDeclareCharClass command. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/0da9e3c5-2716-f576-1df5-2f28ea69f0e8@gmail.com Signed-off-by: Jonathan Corbet commit 788d28a257991d673e57500353d416488df0c103 Author: Akira Yokosawa Date: Mon Aug 9 10:25:25 2021 +0900 docs: pdfdocs: Permit AutoFakeSlant for CJK fonts Noto CJK fonts don't provide italic shapes. The AutoFakeSlant option of fontspec and xeCJK packages can be used as a workaround. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/502335cc-9a95-3c2a-7744-6cc56ecaf628@gmail.com Signed-off-by: Jonathan Corbet commit 77abc2c230b101fd35af739bf89a4430ddcfea62 Author: Akira Yokosawa Date: Mon Aug 9 10:23:57 2021 +0900 docs: pdfdocs: One-half spacing for CJK translations CJK documents are much easier to read with a wider baseline stretch. Applying onehalfspacing option of "setspace" package looks reasonable. Note: \usepackage{setspace} needs to be before that of hyperref in the preamble. The 'extrapackages' key (available since Sphinx 2.3) is for this purpose. For systems with Sphinx < 2.3, dummy commands of \onehalfspacing and \singlespacing are provided instead. One-half spacing is not effective in LaTeX sources generated by such revisions of Sphinx. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/547a1f1c-0bb5-20a7-ea0e-951bfc3c3925@gmail.com Signed-off-by: Jonathan Corbet commit a90dad8f610a5d14ce1292ac6c7c84b43252afe9 Author: Akira Yokosawa Date: Mon Aug 9 10:21:29 2021 +0900 docs: pdfdocs: Add conf.py local to translations for ascii-art alignment Globally choosing "Noto Sans Mono CJK SC" would result in sub-optimal look of literal blocks in Latin documents. Therefore, localize the font choice to translations by adding conf.py under Documentation/translations/. The local conf.py is enabled when the command: make SPHINXDIRS=translations pdfdocs is used to build the PDF. Resulting translations.pdf (under Documentation/output/translations/pdf) will have properly aligned ascii-art figures. NOTE: There remain mis-aligned ascii-art figures in Korean translations. This is due to the font designer's decision to assign slightly narrower widths (920) to Hangul characters in "Noto Sans Mono CJK KR" than those of Hanja (Hanzi/Kanji) characters (1000) [1]. [1]: https://github.com/googlefonts/noto-cjk/issues/17 Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/79a876fc-a552-f972-4a1b-c6df4cbb36dd@gmail.com Signed-off-by: Jonathan Corbet commit 35382965bdd2feeedd0f2fe326c89db2007149bb Author: Akira Yokosawa Date: Mon Aug 9 10:19:24 2021 +0900 docs: pdfdocs: Preserve inter-phrase space in Korean translations In Korean typesetting, inter-phrase spaces in Hangul text have a similar role as the the inter-word spaces in Latin text. They can be preserved by the \xeCJKsetup{CJKspace=true} option. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/68de2e52-e6d1-3f01-c097-15ba7b28a319@gmail.com Signed-off-by: Jonathan Corbet commit 7eb368cc319bbf87ce1c6091a4ddc8bd01ee35d5 Author: Akira Yokosawa Date: Mon Aug 9 10:17:00 2021 +0900 docs: pdfdocs: Choose Serif font as CJK mainfont if possible "Noto Serif CJK SC" and its variants suit better with the roman font of Latin letters. On some distros such as Fedora, it is possible to partially install "Noto Sans CJK" fonts. So, if the Serif fonts are not found on the system, fall back to the Sans fonts. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/5e454140-5d0c-35d4-8c31-3ffb2420793a@gmail.com Signed-off-by: Jonathan Corbet commit e291ff6f5a034adb9b6ceaeb504ef196cde0ea9e Author: Akira Yokosawa Date: Mon Aug 9 10:14:53 2021 +0900 docs: pdfdocs: Add CJK-language-specific font settings zh_TW, ko_KR, and ja_JP translations have their preferred glyph sets different from that of zh_CN. To switch CJK font in the middle of the translations, introduce custom LaTeX macros listed below: \kerneldocBeginSC \kerneldocEndSC \kerneldocBeginTC \kerneldocEndTC \kerneldocBeginKR \kerneldocEndKR \kerneldocBeginJP \kerneldocEndJP , and embed a pair of macros in each language's index.rst. NOTE 1: Update of zh_TW/index.rst is deferred to a follow-up change. NOTE 2: Custom macros added here do not imply \kerneldocCJK(on|off). This is intentional. For example, \kerneldocCJKoff needs to be at the top of Italian translations' index.rst for the footer of final zh_TW page to be properly typeset. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/31906baf-7490-68cd-7153-4e4d320fb9b0@gmail.com Signed-off-by: Jonathan Corbet commit 659653c9e5468809a83901f833cefed1b04c5922 Author: Akira Yokosawa Date: Mon Aug 9 10:12:05 2021 +0900 docs: pdfdocs: Refactor config for CJK document To make generated LaTeX code portable across systems with different sets of available fonts, convert font-availability check in python code to LaTeX code by using a conditional command provided by the "fontspec" package. This will help those who run Sphinx on one machine/container and run latexmk on other machines/containers. Remove import of check_output as it is unused any more. Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/4baf88af-316d-8aee-240f-6ccbc20907d7@gmail.com Signed-off-by: Jonathan Corbet commit bed4ed3057e495dc91ac4049770319f23c579b32 Author: Laurent Pinchart Date: Sat Jul 31 01:54:01 2021 +0300 scripts/kernel-doc: Override -Werror from KCFLAGS with KDOC_WERROR Since commit 2c12c8103d8f ("scripts/kernel-doc: optionally treat warnings as errors"), the kernel-doc script will treat warnings as errors when one of the following conditions is true: - The KDOC_WERROR environment variable is non-zero - The KCFLAGS environment variable contains -Werror - The -Werror parameter is passed to kernel-doc Checking KCFLAGS for -Werror allows piggy-backing on the C compiler error handling. However, unlike the C compiler, kernel-doc has no provision for -Wno-error. This makes compiling the kernel with -Werror (to catch regressions) and W=1 (to enable more checks) always fail, without the same possibility as offered by the C compiler to treating some selected warnings as warnings despite the global -Werror setting. To fix this, evaluate KDOC_WERROR after KCFLAGS, which allows disabling the warnings-as-errors behaviour of kernel-doc selectively by setting KDOC_WERROR=0. Signed-off-by: Laurent Pinchart Link: https://lore.kernel.org/r/20210730225401.4401-1-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Jonathan Corbet commit 4f3791c3fe277446191f4d0857bd04baf5e6d9bd Author: Yang Yang Date: Sat Jul 31 01:45:03 2021 -0700 docs/zh_CN: Add zh_CN/accounting/psi.rst Add translation zh_CN/accounting/psi.rst and zh_CN/accounting/index.rst. Signed-off-by: Yang Yang Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20210731084502.571451-1-yang.yang29@zte.com.cn Signed-off-by: Jonathan Corbet commit 411f48bb58f49c40a627b052402a90e8301cd07e Author: Hans de Goede Date: Thu Aug 12 16:55:13 2021 +0200 platform/x86: asus-nb-wmi: Add tablet_mode_sw=lid-flip quirk for the TP200s The Asus TP200s / E205SA 360 degree hinges 2-in-1 supports reporting SW_TABLET_MODE info through the ASUS_WMI_DEVID_LID_FLIP WMI device-id. Add a quirk to enable this. BugLink: https://gitlab.freedesktop.org/libinput/libinput/-/issues/639 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210812145513.39117-2-hdegoede@redhat.com commit 6be70ccdd989e40af151ce52db5b2d93e97fc9fb Author: Hans de Goede Date: Thu Aug 12 16:55:12 2021 +0200 platform/x86: asus-nb-wmi: Allow configuring SW_TABLET_MODE method with a module option Unfortunately we have been unable to find a reliable way to detect if and how SW_TABLET_MODE reporting is supported, so we are relying on DMI quirks for this. Add a module-option to specify the SW_TABLET_MODE method so that this can be easily tested without needing to rebuild the kernel. BugLink: https://gitlab.freedesktop.org/libinput/libinput/-/issues/639 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210812145513.39117-1-hdegoede@redhat.com commit 191cf329f109df86d93f7782c3289b50bca15260 Author: Federico Vaga Date: Sat Jul 31 10:55:13 2021 +0200 doc: align Italian translation Translation for the following patches commit 0ca0d55526d3 ("docs/core-api: Consistent code style") commit 9912d0bb9dee ("docs: process: submitting-patches.rst: avoid using ReST :doc:`foo` markup") commit 6349469a4f3c ("Documentation/submitting-patches: Document RESEND tag on patches") commit dbbe7c962c3a ("docs: networking: drop special stable handling") commit 7f3f7bfbbe02 ("docs: kernel-hacking: hacking.rst: avoid using ReST :doc:`foo` markup") commit 6ab0493dfc62 ("deprecated.rst: Include details on "no_hash_pointers" ") commit 77167b966b7e ("docs: submitting-patches: clarify the role of LKML ") Signed-off-by: Federico Vaga Link: https://lore.kernel.org/r/20210731085513.11820-1-federico.vaga@vaga.pv.it Signed-off-by: Jonathan Corbet commit 27f373cb5c9805d1e921ec9c5faf738ecf3fd989 Author: Jisheng Zhang Date: Thu Aug 5 00:27:39 2021 +0800 Documentation/features/vm: riscv supports THP now After commit e88b333142e4 ("riscv: mm: add THP support on 64-bit"), riscv can support THP. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20210805002739.23f44d2d@xhacker Signed-off-by: Jonathan Corbet commit 4d488433dc4071fd55fa1d65f16f81dd149c9cda Author: Yanteng Si Date: Fri Aug 6 10:58:55 2021 +0800 docs/zh_CN: add infiniband user_verbs translation Translate Documentation/infiniband/user_verbs.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/b7c1577cf9758943bff933c46200c7dff1e1c6e0.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 0265e6ee2c5868a3efb7e9b49ccbdb51fd1c7f27 Author: Yanteng Si Date: Fri Aug 6 10:58:54 2021 +0800 docs/zh_CN: add infiniband user_mad translation Translate Documentation/infiniband/user_mad.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/8859ef2b40b380d7db7548f2e6a2d6fd5397062d.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit cc420b883b1fa69990d6b44ebc91831066eb6bf3 Author: Yanteng Si Date: Fri Aug 6 10:58:53 2021 +0800 docs/zh_CN: add infiniband tag_matching translation Translate Documentation/infiniband/tag_matching.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/eaed122a0e5d0e3312cf5a495022a9d0be42a831.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit ccbad6a5216bd45a725feeafab4c05744538e0c9 Author: Yanteng Si Date: Fri Aug 6 10:58:52 2021 +0800 docs/zh_CN: add infiniband sysfs translation Translate Documentation/infiniband/sysfs.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/dbd542628b71160f7bddd33a76cb77b127a9b826.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit e7c640961a2efa93979128645172db7ce26a8d87 Author: Yanteng Si Date: Fri Aug 6 10:58:51 2021 +0800 docs/zh_CN: add infiniband opa_vnic translation Translate Documentation/infiniband/opa_vnic.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/828550a6fb7fded8172c123c37d4c643d2593e53.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 88e37e3d4443d56e674a97a2d717935c23767adf Author: Yanteng Si Date: Fri Aug 6 10:58:50 2021 +0800 docs/zh_CN: add infiniband ipoib translation Translate Documentation/infiniband/ipoib.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/2d71cfe6b11568d9d9c665e829eaf680c249c94a.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 312356129e5836bb6ae4780340325e1f46fda1e7 Author: Yanteng Si Date: Fri Aug 6 10:58:49 2021 +0800 docs/zh_CN: add infiniband core_locking translation Translate Documentation/infiniband/core_locking.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/d035d79b2936be762bc001b3a53831f34f72cbb7.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit f4e60d9f1ba5fa40544ab967513e450fa44656d0 Author: Yanteng Si Date: Fri Aug 6 10:58:48 2021 +0800 docs/zh_CN: add infiniband index translation Translate Documentation/infiniband/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Puyu Wang Link: https://lore.kernel.org/r/e3bca9e59f410fe62489e36c5b9a3fab78bc1421.1628218477.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 96275df87a07aa5f5f3fec8ab239af3ea5fdf325 Author: Lucas De Marchi Date: Wed Aug 11 13:58:18 2021 -0700 drm/edid: fix edid field name Byte 26 in a edid struct is supposed to be "Blue and white least-significant 2 bits", not "black and white". Rename the field accordingly. This field is not used anywhere, so just renaming it here for correctness. Signed-off-by: Lucas De Marchi Reviewed-by: Simon Ser Signed-off-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20210811205818.156100-1-lucas.demarchi@intel.com commit 3bf5548d8e9602ee01b9f39f3127b5933e9e8be0 Author: Yanteng Si Date: Fri Aug 6 09:26:46 2021 +0800 docs/zh_CN: add virt acrn cpuid translation Translate Documentation/virt/acrn/cpuid.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/35730828bc65d3912ba27382d5d70ddacee7d8a5.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit f63c6894f6453e6eedb5f04a1f3d222773abd427 Author: Yanteng Si Date: Fri Aug 6 09:26:45 2021 +0800 docs/zh_CN: add virt acrn io-request translation Translate Documentation/virt/acrn/io-request.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/291079265a8b0555de4d624d7d11fc5ac37a9422.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit ab03e49f13ca8be59c20d8e59c4a4bf1b6410a99 Author: Yanteng Si Date: Fri Aug 6 09:26:44 2021 +0800 docs/zh_CN: add virt acrn introduction translation Translate Documentation/virt/acrn/introduction.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/667a6eb64820d2234d12a0c5dd5b642af16c0d99.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 8dda2eac96844aac6ed25eb490b061b16eaf2e64 Author: Yanteng Si Date: Fri Aug 6 09:26:43 2021 +0800 docs/zh_CN: add virt acrn index translation Translate Documentation/virt/acrn/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/17a0dac5ecc5bdcc98160bdb028c6876ca38a6bc.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit e636a91584ad198f222f68a4ad61e27633976596 Author: Yanteng Si Date: Fri Aug 6 09:26:42 2021 +0800 docs/zh_CN: add virt ne_overview translation Translate Documentation/virt/ne_overview.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/a6e1a2275a397d77957be30d1acdfeda9dc836f4.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 9c987b10fefa6472e49be3f0c6f5b9d9309c42bf Author: Yanteng Si Date: Fri Aug 6 09:26:41 2021 +0800 docs/zh_CN: add virt guest-halt-polling translation Translate Documentation/virt/guest-halt-polling.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/658e255eff55bfdadc1576107bf367a2e80b881a.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit ccb00ddc88cf3953249cd9595df174ff863b18bd Author: Yanteng Si Date: Fri Aug 6 09:26:40 2021 +0800 docs/zh_CN: add virt paravirt_ops translation Translate Documentation/virt/paravirt_ops.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/abba361233e2a58999ef5d31c20f24370d7724f2.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 8ce1162a396068d8e69a88f35562ef3f29d4ab4e Author: Yanteng Si Date: Fri Aug 6 09:26:39 2021 +0800 docs/zh_CN: add virt index translation Add virt to .../zh_CN/index and translate it into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/b28d3a530fe0c3635e7be2462fd14a4ae18f0220.1628212777.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit d6ff10e072e1150a9a135e355b1f85479609bab2 Author: Thierry Reding Date: Thu Aug 12 16:17:12 2021 +0200 arm64: tegra: Add missing interconnects property for USB on Tegra186 The device tree node for the XUDC (USB device mode controller) is missing the interconnects property that describes the path to memory for the controller. Add the property so that the things like the DMA mask can be set by the operating system. Signed-off-by: Thierry Reding commit 28ce50f8d96ec9035f60c9348294ea26b94db944 Author: Pali Rohár Date: Sun Aug 8 18:24:37 2021 +0200 isofs: joliet: Fix iocharset=utf8 mount option Currently iocharset=utf8 mount option is broken. To use UTF-8 as iocharset, it is required to use utf8 mount option. Fix iocharset=utf8 mount option to use be equivalent to the utf8 mount option. If UTF-8 as iocharset is used then s_nls_iocharset is set to NULL. So simplify code around, remove s_utf8 field as to distinguish between UTF-8 and non-UTF-8 it is needed just to check if s_nls_iocharset is set to NULL or not. Link: https://lore.kernel.org/r/20210808162453.1653-5-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Jan Kara commit b645333443712d2613e4e863f81090d5dc509657 Author: Pali Rohár Date: Sun Aug 8 18:24:36 2021 +0200 udf: Fix iocharset=utf8 mount option Currently iocharset=utf8 mount option is broken. To use UTF-8 as iocharset, it is required to use utf8 mount option. Fix iocharset=utf8 mount option to use be equivalent to the utf8 mount option. If UTF-8 as iocharset is used then s_nls_map is set to NULL. So simplify code around, remove UDF_FLAG_NLS_MAP and UDF_FLAG_UTF8 flags as to distinguish between UTF-8 and non-UTF-8 it is needed just to check if s_nls_map set to NULL or not. Link: https://lore.kernel.org/r/20210808162453.1653-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Jan Kara commit 4d2ee1be4c2a5552f083b6d7db4be224f96313b5 Author: Huilong Deng Date: Wed Aug 11 12:36:15 2021 +0800 MIPS: generic: Return true/false (not 1/0) from bool functions ./arch/mips/generic/board-ocelot.c:29:9-10: WARNING: return of 0/1 in function 'ocelot_detect' with return type bool Signed-off-by: Huilong Deng Signed-off-by: Thomas Bogendoerfer commit 3f66601ef3f3e336c1f8181f183001b58be62067 Author: Jiaxun Yang Date: Fri Jul 23 10:25:43 2021 +0800 MIPS: Make a alias for pistachio_defconfig For those who miss the old defconfig, make a alias to generic kernel. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 104f942b2832ab1340dab34ae2dad8b31b772788 Author: Jiaxun Yang Date: Fri Jul 23 10:25:42 2021 +0800 MIPS: Retire MACH_PISTACHIO Now it can be replaced by generic kernel. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 917b64f1df2b9cec0a0859bd8d96b24679038f78 Author: Jiaxun Yang Date: Fri Jul 23 10:25:41 2021 +0800 MIPS: config: generic: Add config for Marduk board The config is minimal config to allow it boot from SD Card. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit f14973038d814c3ad032209794693dceca5eb7cf Author: Jiaxun Yang Date: Fri Jul 23 10:25:40 2021 +0800 pinctrl: pistachio: Make it as an option So it will be avilable for generic MIPS kernel. -- Signed-off-by: Jiaxun Yang v3: Depend on OF as well Acked-by: Linus Walleij Signed-off-by: Thomas Bogendoerfer commit e238f10d8606ddb9a1728628a218c3f740b940be Author: Jiaxun Yang Date: Fri Jul 23 10:25:39 2021 +0800 phy: pistachio-usb: Depend on MIPS || COMPILE_TEST So it will be avilable for generic MIPS kernel. Signed-off-by: Jiaxun Yang Acked-By: Vinod Koul Signed-off-by: Thomas Bogendoerfer commit 1e4fd60b54cf9f65d2d5b89a9289cbbc42922adf Author: Jiaxun Yang Date: Fri Jul 23 10:25:38 2021 +0800 clocksource/drivers/pistachio: Make it selectable for MIPS So it will be avilable for generic MIPS kernel. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 90429205c000f4befdc212cfade39e358292584c Author: Jiaxun Yang Date: Fri Jul 23 10:25:37 2021 +0800 clk: pistachio: Make it selectable for generic MIPS kernel We're moving pistachio to generic MIPS kernel. The clk driver should be avilable to the generic MIPS kernel. Signed-off-by: Jiaxun Yang Acked-by: Stephen Boyd Signed-off-by: Thomas Bogendoerfer commit d32524a2d05791181756bb4ab4f6e0628471fde2 Author: Jiaxun Yang Date: Fri Jul 23 10:25:36 2021 +0800 MIPS: DTS: Pistachio add missing cpc and cdmm CPC and CDMM addresses are adjustable and we should tell kernel how to place them in devicetree. Note that MACH_PISTACHIO code hardcoded CDMM base to 0x1bdd0000, however it will collide with GIC address range. As we don't have any CDMM device on this platform it won't be a problem. I found another spare range, 0x1bdf0000~0x1be00000 to place CDMM instead. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 666173ee32e2d6f2853bd54b11b8127ac97eb019 Author: Jiaxun Yang Date: Fri Jul 23 10:25:35 2021 +0800 MIPS: generic: Allow generating FIT image for Marduk board Marduk is based on IMG pistachio SoC. The platform is using MIPS UHI booting protocol and does have a proper devicetree implement, thus it could be a part of generic kernel. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 8a9dee7e7beb57504aa17166f0d8d6998ac098af Author: Thierry Reding Date: Thu Aug 12 14:26:17 2021 +0200 arm64: tegra: Add NVIDIA Jetson TX2 NX Developer Kit support The Jetson TX2 NX Developer Kit is very similar to the Jetson Nano, but uses the more powerful Tegra186 SoC. Signed-off-by: Thierry Reding commit 913f8ad4fad09510d8ab493dd3393aaaecbc9b2e Author: Thierry Reding Date: Thu Aug 12 14:26:16 2021 +0200 arm64: tegra: Add PWM nodes on Tegra186 These PWMs can be used for fan or LED backlight control. Add the device tree nodes for all existing controllers found on Tegra186 SoCs. None of these are enabled by default, which is left for the board DTS files to do when necessary. Signed-off-by: Thierry Reding commit 900a486ac73dfdf9b1629e7e4df6eacc92da7578 Author: Thierry Reding Date: Thu Aug 12 14:26:15 2021 +0200 dt-bindings: tegra: Document NVIDIA Jetson TX2 NX developer kit The Jetson TX2 NX Developer Kit is the same form factor as Jetson Nano, but uses the more powerful Tegra186 SoC for added performance. Signed-off-by: Thierry Reding commit 3c383a3688b7d8bc83ed22b36d0fb50db0bd2608 Author: David Stevens Date: Wed Aug 11 13:04:01 2021 +0900 drm/virtio: set non-cross device blob uuid_state Blob resources without the cross device flag don't have a uuid to share with other virtio devices. When exporting such blobs, set uuid_state to STATE_ERR so that virtgpu_virtio_get_uuid doesn't hang. Signed-off-by: David Stevens Link: http://patchwork.freedesktop.org/patch/msgid/20210811040401.1264234-1-stevensd@chromium.org Signed-off-by: Gerd Hoffmann commit 2863643fb8b92291a7e97ba46e342f1163595fa8 Author: Ran Xiaokai Date: Wed Jul 28 00:26:29 2021 -0700 set_user: add capability check when rlimit(RLIMIT_NPROC) exceeds in copy_process(): non root users but with capability CAP_SYS_RESOURCE or CAP_SYS_ADMIN will clean PF_NPROC_EXCEEDED flag even rlimit(RLIMIT_NPROC) exceeds. Add the same capability check logic here. Align the permission checks in copy_process() and set_user(). In copy_process() CAP_SYS_RESOURCE or CAP_SYS_ADMIN capable users will be able to circumvent and clear the PF_NPROC_EXCEEDED flag whereas they aren't able to the same in set_user(). There's no obvious logic to this and trying to unearth the reason in the thread didn't go anywhere. The gist seems to be that this code wants to make sure that a program can't successfully exec if it has gone through a set*id() transition while exceeding its RLIMIT_NPROC. A capable but non-INIT_USER caller getting PF_NPROC_EXCEEDED set during a set*id() transition wouldn't be able to exec right away if they still exceed their RLIMIT_NPROC at the time of exec. So their exec would fail in fs/exec.c: if ((current->flags & PF_NPROC_EXCEEDED) && is_ucounts_overlimit(current_ucounts(), UCOUNT_RLIMIT_NPROC, rlimit(RLIMIT_NPROC))) { retval = -EAGAIN; goto out_ret; } However, if the caller were to fork() right after the set*id() transition but before the exec while still exceeding their RLIMIT_NPROC then they would get PF_NPROC_EXCEEDED cleared (while the child would inherit it): retval = -EAGAIN; if (is_ucounts_overlimit(task_ucounts(p), UCOUNT_RLIMIT_NPROC, rlimit(RLIMIT_NPROC))) { if (p->real_cred->user != INIT_USER && !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) goto bad_fork_free; } current->flags &= ~PF_NPROC_EXCEEDED; which means a subsequent exec by the capable caller would now succeed even though they could still exceed their RLIMIT_NPROC limit. This seems inconsistent. Allow a CAP_SYS_ADMIN or CAP_SYS_RESOURCE capable user to avoid PF_NPROC_EXCEEDED as they already can in copy_process(). Cc: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, Ran Xiaokai , , , Link: https://lore.kernel.org/r/20210728072629.530435-1-ran.xiaokai@zte.com.cn Cc: Neil Brown Cc: Kees Cook Cc: Thomas Gleixner Cc: James Morris Cc: Linus Torvalds Cc: Peter Zijlstra Signed-off-by: Ran Xiaokai Signed-off-by: Christian Brauner commit a58b06083f789f6672ae44a21054e8f621125704 Author: Shyam Sundar S K Date: Thu Aug 12 17:23:22 2021 +0530 MAINTAINERS: Add maintainers for amd-pinctrl driver Adding Basavaraj and myself to the maintainers list for amd-pinctrl driver. Signed-off-by: Basavaraj Natikar Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20210812115322.765379-1-Shyam-sundar.S-k@amd.com Signed-off-by: Linus Walleij commit bed5a942e27e1df67250e27e1f2eb5ea2d4cc362 Merge: dea807744439e 61b6a6c395d6a Author: David S. Miller Date: Thu Aug 12 12:45:41 2021 +0100 Merge tag 'mlx5-updates-2021-08-11' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 updates 2021-08-11 This series provides misc updates to mlx5. For more information please see tag log below. Please pull and let me know if there is any problem. mlx5-updates-2021-08-11 Misc. cleanup for mlx5. 1) Typos and use of netdev_warn() 2) smatch cleanup 3) Minor fix to inner TTC table creation 4) Dynamic capability cache allocation ==================== Signed-off-by: David S. Miller commit 7482ec7111fbeff9acf681036faddfcc20fadcb1 Author: Stefan Binding Date: Wed Aug 11 19:56:54 2021 +0100 ALSA: hda/cs8409: Unmute/Mute codec when stream starts/stops Codec is muted on init, and then unmuted when the stream starts. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-28-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 4ff2ae3a135ffe3f849492fd59ebeda3c7d1100f Author: Stefan Binding Date: Wed Aug 11 19:56:53 2021 +0100 ALSA: hda/cs8409: Follow correct CS42L42 power down sequence for suspend Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-27-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit c8b4f0865e82c14924c69c07d985af3ee9133316 Author: Stefan Binding Date: Wed Aug 11 19:56:52 2021 +0100 ALSA: hda/cs8409: Remove unnecessary delays Since delays when starting jack detection after initialization have been reduced/removed, it is necessary to add back in an extra 20ms delay after the init sequence to allow the CS42L42 to power up correctly. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-26-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 928adf0ebc7893ee228a06479b1b797779fd41a9 Author: Stefan Binding Date: Wed Aug 11 19:56:51 2021 +0100 ALSA: hda/cs8409: Use timeout rather than retries for I2C transaction waits Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-25-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit fed0aaca0b0f204ca40b89b22b0e493ceb27d48e Author: Stefan Binding Date: Wed Aug 11 19:56:50 2021 +0100 ALSA: hda/cs8409: Set fixed sample rate of 48kHz for CS42L42 CS42L42 is configured to use a fixed sample rate of 48kHz. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-24-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit e4e6c584f516880a5c3e0963159e201e83d86be7 Author: Stefan Binding Date: Wed Aug 11 19:56:49 2021 +0100 ALSA: hda/cs8409: Enable Full Scale Volume for Line Out Codec on Dolphin Headphones codec will keep reduced maximum volume. Line Out codec will have increased maximum volume. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-23-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 20e507724113300794f16884e7e7507d9b4dec68 Author: Lucas Tanure Date: Wed Aug 11 19:56:48 2021 +0100 ALSA: hda/cs8409: Add support for dolphin Dolphin devices have CS8409 HDA Bridge connected to two CS42L42 codecs. Codec 1 supports Headphone and Headset Mic. Codec 2 supports Line Out. Features: - Front and Read Jacks appear as separate jacks; Removal or connection of on jack should not affect the connection of the other. - Front Jack only shows up on jack detection. - Rear Jack is Phantom Jack. - Separate Volume Controls for each Jack Signed-off-by: Stefan Binding Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-22-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 404e770a9c878bb0db14f1c2a69203081598686f Author: Stefan Binding Date: Wed Aug 11 19:56:47 2021 +0100 ALSA: hda/cs8409: Add Support to disable jack type detection for CS42L42 Some hardware configurations do not support jack type detection. Instead, for those configurations, only tip detection is supported. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-21-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit c076e201d5e16ffa7bcd01edc82cf5a1f9ce0721 Author: Stefan Binding Date: Wed Aug 11 19:56:46 2021 +0100 ALSA: hda/cs8409: Support multiple sub_codecs for Suspend/Resume/Unsol events Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-20-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 24f7ac3d3b6b706217e9b9d2cf0804d312505fbe Author: Lucas Tanure Date: Wed Aug 11 19:56:45 2021 +0100 ALSA: hda/cs8409: Move codec properties to its own struct To accommodate move, cs42l42_resume has been added to mirror the existing function cs42l42_suspend. Function cs42l42_reset is no longer required, since cs42l42_resume and cs42l42_suspend perform the same operations. Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-19-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 636eb9d26f29cd9e195a6bae783315284efa11da Author: Lucas Tanure Date: Wed Aug 11 19:56:44 2021 +0100 ALSA: hda/cs8409: Separate CS8409, CS42L42 and project functions Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-18-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 165b81c4ac3062d61e5422c85fcd55e8d0f805da Author: Lucas Tanure Date: Wed Aug 11 19:56:43 2021 +0100 ALSA: hda/cs8409: Support i2c bulk read/write functions This allows mutex locks to be moved into i2c functions, as the bulk read/write functions can lock/unlock themselves to prevent interruption of sequence reads/writes. Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-17-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 8de4e5a6680df739f2368628e738d08820320484 Author: Lucas Tanure Date: Wed Aug 11 19:56:42 2021 +0100 ALSA: hda/cs8409: Avoid re-setting the same page as the last access Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-16-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit d395fd7864c553908a83e10112184febbb9cf81c Author: Lucas Tanure Date: Wed Aug 11 19:56:41 2021 +0100 ALSA: hda/cs8409: Avoid setting the same I2C address for every access Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-15-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 647d50a0c30402d2156ca201a74d77d58c7ef5ff Author: Lucas Tanure Date: Wed Aug 11 19:56:40 2021 +0100 ALSA: hda/cs8409: Dont disable I2C clock between consecutive accesses Only disable I2C clock 25 ms after not being used. The current implementation enables and disables the I2C clock for each I2C transaction. Each enable/disable call requires two verb transactions. This means each I2C transaction requires a total of four verb transactions to enable and disable the clock. However, if there are multiple consecutive I2C transactions, it is not necessary to enable and disable the clock each time, instead it is more efficient to enable the clock for the first transaction, and disable it after the final transaction, which would improve performance. This is achieved by using a timeout which disables the clock if no request to enable the clock has occurred for 25 ms. Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20210811185654.6837-14-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b2a887748e518b1c355e244ff847293a1bf39c64 Author: Lucas Tanure Date: Wed Aug 11 19:56:39 2021 +0100 ALSA: hda/cs8409: Generalize volume controls Use amp offsets as indexes for saved volumes. Remove dependencies on NID inside volume control functions. Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-13-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a1a6c7df2b2e9e2291e4c1c621b6092b07777934 Author: Lucas Tanure Date: Wed Aug 11 19:56:38 2021 +0100 ALSA: hda/cs8409: Prevent I2C access during suspend time Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-12-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit db0ae848a9896b4d18a793d47dc672257391045c Author: Stefan Binding Date: Wed Aug 11 19:56:37 2021 +0100 ALSA: hda/cs8409: Simplify CS42L42 jack detect. Cleanup interrupt masks. Remove unnecessary read/writes. Ensure Tip Sense/Type Detection interrupts are enabled/disabled when needed. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-11-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 1e0a975a8a8e0d5dac04781e2eb3269912b1386f Author: Stefan Binding Date: Wed Aug 11 19:56:36 2021 +0100 ALSA: hda/cs8409: Mask CS42L42 wake events Wake events are not needed for jack detect. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-10-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 134ae782c468769b5524bed50e8d58ed3cad3587 Author: Lucas Tanure Date: Wed Aug 11 19:56:35 2021 +0100 ALSA: hda/cs8409: Disable unsolicited response for the first boot The subsequence suspend and remuse have their enable/disable unsolicited responses at the correct place already Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-9-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit cc7df1623c523e1d4432492085d0a200245d805c Author: Stefan Binding Date: Wed Aug 11 19:56:34 2021 +0100 ALSA: hda/cs8409: Disable unsolicited responses during suspend Ensure unsolicited responses cannot occur whilst the sub codecs are being disabled. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-8-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 1f03db686583ee1c5cce4db62335fcb685bce27d Author: Stefan Binding Date: Wed Aug 11 19:56:33 2021 +0100 ALSA: hda/cs8409: Disable unnecessary Ring Sense for Cyborg/Warlock/Bullseye Also remove unnecessary repeated register writes. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-7-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 29dbb9bcd3ea7f6c0385dfe714a5511865cd00c6 Author: Stefan Binding Date: Wed Aug 11 19:56:32 2021 +0100 ALSA: hda/cs8409: Reduce HS pops/clicks for Cyborg Enable HSBIAS_SENSE_EN for Cyborg during jack detect to reduce pops and clicks. Do not enable this for Warlock/Bullseye, as it causes ESD issues. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-6-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit cab82a222f3d56e8891e383d5c3e11935c103fff Author: Stefan Binding Date: Wed Aug 11 19:56:31 2021 +0100 ALSA: hda/cs8409: Mask all CS42L42 interrupts on initialization Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-5-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ccff0064a7ce8e6716fe110a278e67514a51b218 Author: Stefan Binding Date: Wed Aug 11 19:56:30 2021 +0100 ALSA: hda/cs8409: Use enums for register names and coefficients Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-4-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 9e7647b5070fb7efdc6d74b82095256af8749133 Author: Lucas Tanure Date: Wed Aug 11 19:56:29 2021 +0100 ALSA: hda/cs8409: Move arrays of configuration to a new file Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-3-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 8c70461bbb83cf4bec058a5da16253ec7ac3fecc Author: Lucas Tanure Date: Wed Aug 11 19:56:28 2021 +0100 ALSA: hda/cirrus: Move CS8409 HDA bridge to separate module Signed-off-by: Lucas Tanure Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20210811185654.6837-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 9491923e4a68d696f7d0817a02829ed238783716 Author: Randy Dunlap Date: Sun Aug 8 13:52:33 2021 -0700 crypto: wp512 - correct a non-kernel-doc comment Don't use "/**" to begin a comment that is not kernel-doc notation. crypto/wp512.c:779: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * The core Whirlpool transform. Signed-off-by: Randy Dunlap Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Signed-off-by: Herbert Xu commit faf8e7539643ed958174ad3dfeb43c179a9c4397 Author: Geert Uytterhoeven Date: Tue Aug 10 15:47:19 2021 +0200 iommu/dart: APPLE_DART should depend on ARCH_APPLE The Apple DART (Device Address Resolution Table) IOMMU is only present on Apple ARM SoCs like the M1. Hence add a dependency on ARCH_APPLE, to prevent asking the user about this driver when configuring a kernel without support for the Apple Silicon SoC family. Signed-off-by: Geert Uytterhoeven Acked-by: Sven Peter Link: https://lore.kernel.org/r/44fcf525273b32c9afcd7e99acbd346d47f0e047.1628603162.git.geert+renesas@glider.be Signed-off-by: Joerg Roedel commit aca196842a9729a198af57c417725c3ac9ca05db Author: Yang Yingliang Date: Tue Aug 10 22:24:05 2021 +0800 spi: mxic: add missing braces Fix the following waring: drivers/spi/spi-mxic.c: In function ‘mxic_spi_mem_exec_op’: drivers/spi/spi-mxic.c:401:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (op->data.dir == SPI_MEM_DATA_IN) ^~ drivers/spi/spi-mxic.c:403:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ if (op->data.dtr) ^~ Signed-off-by: Yang Yingliang Reviewed-by: Zhengxun Li Link: https://lore.kernel.org/r/20210810142405.2221540-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 772d44526e203c062171786e514373f129616278 Author: Douglas Anderson Date: Wed Aug 11 08:17:56 2021 -0700 ASoC: rt5682: Properly turn off regulators if wrong device ID When I booted up on a board that had a slightly different codec stuffed on it, I got this message at bootup: rt5682 9-001a: Device with ID register 6749 is not rt5682 That's normal/expected, but what wasn't normal was the splat that I got after: WARNING: CPU: 7 PID: 176 at drivers/regulator/core.c:2151 _regulator_put+0x150/0x158 pc : _regulator_put+0x150/0x158 ... Call trace: _regulator_put+0x150/0x158 regulator_bulk_free+0x48/0x70 devm_regulator_bulk_release+0x20/0x2c release_nodes+0x1cc/0x244 devres_release_all+0x44/0x60 really_probe+0x17c/0x378 ... This is because the error paths don't turn off the regulator. Let's fix that. Fixes: 0ddce71c21f0 ("ASoC: rt5682: add rt5682 codec driver") Fixes: 87b42abae99d ("ASoC: rt5682: Implement remove callback") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210811081751.v2.1.I4a1d9aa5d99e05aeee15c2768db600158d76cab8@changeid Signed-off-by: Mark Brown commit cf2a19f7d2b7d777b4a0ec6f3faa7fe3e4ad568e Author: Derek Fang Date: Wed Aug 11 16:37:49 2021 +0800 ASoC: rt5682: Adjust headset volume button threshold again This reverts commit 6d20bf7c020f417fdef1810a22da17c126603472. Since it may risk affecting other headset Vol- button. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20210811083750.26680-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit ea5202dff79ce23e1a9fee3e1b2f09e28b77ba3a Author: Weili Qian Date: Sat Aug 7 14:29:11 2021 +0800 crypto: hisilicon - enable hpre device clock gating Kunpeng930 hpre device supports dynamic clock gating. When doing tasks, the algorithm core is opened, and when idle, the algorithm core is closed. This patch enables hpre dynamic clock gating by writing hardware registers. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 3d845d497b23547150fe7f9b3261ead9f4295686 Author: Weili Qian Date: Sat Aug 7 14:29:10 2021 +0800 crypto: hisilicon - enable sec device clock gating Kunpeng930 sec device supports dynamic clock gating. When doing tasks, the algorithm core is opened, and when idle, the algorithm core is closed. This patch enables sec dynamic clock gating by writing hardware registers. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit ed5fa39fa8a62fc55c1c4d53b71f3f4f08a90d22 Author: Weili Qian Date: Sat Aug 7 14:29:09 2021 +0800 crypto: hisilicon - enable zip device clock gating Kunpeng930 zip device supports dynamic clock gating. When executing tasks, the algorithm core is opened, and when idle, the algorithm core is closed. This patch enables zip dynamic clock gating by writing hardware registers. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit b6f756726e4dfe75be1883f6a0202dcecdc801ab Author: Hongbo Li Date: Thu Aug 5 16:53:32 2021 +0800 lib/mpi: use kcalloc in mpi_resize We should set the additional space to 0 in mpi_resize(). So use kcalloc() instead of kmalloc_array(). In lib/mpi/ec.c: /**************** * Resize the array of A to NLIMBS. the additional space is cleared * (set to 0) [done by m_realloc()] */ int mpi_resize(MPI a, unsigned nlimbs) Like the comment of kernel's mpi_resize() said, the additional space need to be set to 0, but when a->d is not NULL, it does not set. The kernel's mpi lib is from libgcrypt, the mpi resize in libgcrypt is _gcry_mpi_resize() which set the additional space to 0. This bug may cause mpi api which use mpi_resize() get wrong result under the condition of using the additional space without initiation. If this condition is not met, the bug would not be triggered. Currently in kernel, rsa, sm2 and dh use mpi lib, and they works well, so the bug is not triggered in these cases. add_points_edwards() use the additional space directly, so it will get a wrong result. Fixes: cdec9cb5167a ("crypto: GnuPG based MPI lib - source files (part 1)") Signed-off-by: Hongbo Li Signed-off-by: Herbert Xu commit 80771c8228029daff4b3402e00883cde06e07d46 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:10 2021 +0200 padata: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Steffen Klassert Cc: Daniel Jordan Cc: linux-crypto@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Daniel Jordan Signed-off-by: Herbert Xu commit d01a9f7009c3812a8955b7ae5798470cd6ab3590 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:55 2021 +0200 crypto: virtio - Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Gonglei Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Herbert Xu Cc: "David S. Miller" Cc: virtualization@lists.linux-foundation.org Cc: linux-crypto@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Herbert Xu commit c391714c04971f5f68e3685bd7da940c9b90036d Author: Jason Wang Date: Tue Aug 3 20:55:25 2021 +0800 crypto: sun8i-ce - use kfree_sensitive to clear and free sensitive data The kfree_sensitive is a kernel API to clear sensitive information that should not be leaked to other future users of the same memory objects and free the memory. Its function is the same as the combination of memzero_explicit and kfree. Thus, we can replace the combination APIs with the single kfree_sensitive API. Signed-off-by: Jason Wang Signed-off-by: Herbert Xu commit 46d1fb072e76b161b0fb1ada9e37bf7e4d1f123f Author: Sven Peter Date: Tue Aug 3 14:16:51 2021 +0200 iommu/dart: Add DART iommu driver Apple's new SoCs use iommus for almost all peripherals. These Device Address Resolution Tables must be setup before these peripherals can act as DMA masters. Tested-by: Alyssa Rosenzweig Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20210803121651.61594-4-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit 9d9cafb45c71c9fe302234807fae8f743056f88a Author: Sven Peter Date: Tue Aug 3 14:16:50 2021 +0200 dt-bindings: iommu: add DART iommu bindings DART (Device Address Resolution Table) is the iommu found on Apple ARM SoCs such as the M1. Reviewed-by: Rob Herring Reviewed-by: Alyssa Rosenzweig Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20210803121651.61594-3-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit 892384cd998a17960dff6ebefc27375f63364111 Author: Sven Peter Date: Tue Aug 3 14:16:49 2021 +0200 iommu/io-pgtable: Add DART pagetable format Apple's DART iommu uses a pagetable format that shares some similarities with the ones already implemented by io-pgtable.c. Add a new format variant to support the required differences so that we don't have to duplicate the pagetable handling code. Reviewed-by: Alexander Graf Reviewed-by: Alyssa Rosenzweig Reviewed-by: Robin Murphy Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20210803121651.61594-2-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit dea807744439e80f5438db15d1f7dca9a8216571 Merge: 0de6fd5fd51c8 724395f4dc958 Author: David S. Miller Date: Thu Aug 12 11:46:21 2021 +0100 Merge branch 'dsa-cross-chip-notifiers' Vladimir Oltean says: ==================== Improvements to the DSA tag_8021q cross-chip notifiers This series improves cross-chip notifier error messages and addresses a benign error message seen during reboot on a system with disjoint DSA trees. ==================== Signed-off-by: David S. Miller commit 724395f4dc9583bfb379ce41575eaaab299810b4 Author: Vladimir Oltean Date: Wed Aug 11 16:46:06 2021 +0300 net: dsa: tag_8021q: don't broadcast during setup/teardown Currently, on my board with multiple sja1105 switches in disjoint trees described in commit f66a6a69f97a ("net: dsa: permit cross-chip bridging between all trees in the system"), rebooting the board triggers the following benign warnings: [ 12.345566] sja1105 spi2.0: port 0 failed to notify tag_8021q VLAN 1088 deletion: -ENOENT [ 12.353804] sja1105 spi2.0: port 0 failed to notify tag_8021q VLAN 2112 deletion: -ENOENT [ 12.362019] sja1105 spi2.0: port 1 failed to notify tag_8021q VLAN 1089 deletion: -ENOENT [ 12.370246] sja1105 spi2.0: port 1 failed to notify tag_8021q VLAN 2113 deletion: -ENOENT [ 12.378466] sja1105 spi2.0: port 2 failed to notify tag_8021q VLAN 1090 deletion: -ENOENT [ 12.386683] sja1105 spi2.0: port 2 failed to notify tag_8021q VLAN 2114 deletion: -ENOENT Basically switch 1 calls dsa_tag_8021q_unregister, and switch 1's TX and RX VLANs cannot be found on switch 2's CPU port. But why would switch 2 even attempt to delete switch 1's TX and RX tag_8021q VLANs from its CPU port? Well, because we use dsa_broadcast, and it is supposed that it had added those VLANs in the first place (because in dsa_port_tag_8021q_vlan_match, all CPU ports match regardless of their tree index or switch index). The two trees probe asynchronously, and when switch 1 probed, it called dsa_broadcast which did not notify the tree of switch 2, because that didn't probe yet. But during unbind, switch 2's tree _is_ probed, so it _is_ notified of the deletion. Before jumping to introduce a synchronization mechanism between the probing across disjoint switch trees, let's take a step back and see whether we _need_ to do that in the first place. The RX and TX VLANs of switch 1 would be needed on switch 2's CPU port only if switch 1 and 2 were part of a cross-chip bridge. And dsa_tag_8021q_bridge_join takes care precisely of that (but if probing was synchronous, the bridge_join would just end up bumping the VLANs' refcount, because they are already installed by the setup path). Since by the time the ports are bridged, all DSA trees are already set up, and we don't need the tag_8021q VLANs of one switch installed on the other switches during probe time, the answer is that we don't need to fix the synchronization issue. So make the setup and teardown code paths call dsa_port_notify, which notifies only the local tree, and the bridge code paths call dsa_broadcast, which let the other trees know as well. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ab97462beb181bc1ce05f6c22f009c93c5cab7a1 Author: Vladimir Oltean Date: Wed Aug 11 16:46:05 2021 +0300 net: dsa: print more information when a cross-chip notifier fails Currently this error message does not say a lot: [ 32.693498] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT [ 32.699725] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT [ 32.705931] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT [ 32.712139] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT [ 32.718347] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT [ 32.724554] DSA: failed to notify tag_8021q VLAN deletion: -ENOENT but in this form, it is immediately obvious (at least to me) what the problem is, even without further looking at the code: [ 12.345566] sja1105 spi2.0: port 0 failed to notify tag_8021q VLAN 1088 deletion: -ENOENT [ 12.353804] sja1105 spi2.0: port 0 failed to notify tag_8021q VLAN 2112 deletion: -ENOENT [ 12.362019] sja1105 spi2.0: port 1 failed to notify tag_8021q VLAN 1089 deletion: -ENOENT [ 12.370246] sja1105 spi2.0: port 1 failed to notify tag_8021q VLAN 2113 deletion: -ENOENT [ 12.378466] sja1105 spi2.0: port 2 failed to notify tag_8021q VLAN 1090 deletion: -ENOENT [ 12.386683] sja1105 spi2.0: port 2 failed to notify tag_8021q VLAN 2114 deletion: -ENOENT Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 13bf92e6dec0e2be1ef0c7dd483f2d8b34eaa905 Author: Geert Uytterhoeven Date: Wed Jul 14 15:20:03 2021 +0200 dt-bindings: i2c: renesas,riic: Make interrupt-names required Now the I2C device nodes in all DTS files have gained "interrupt-names" properties, the "interrupt-names" property can be made required. Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/da8d1973dcd419d8d9c8c662ee614952f3a6969e.1626267422.git.geert+renesas@glider.be commit 8e8890ea1a5e6ba0649e0d4f7447e812884c7ef4 Author: Geert Uytterhoeven Date: Wed Jul 14 15:20:02 2021 +0200 arm64: dts: renesas: r9a07g044: Add I2C interrupt-names Add "interrupt-names" properties to the I2C device nodes, to make it easier to review the interrupt mappings. Signed-off-by: Geert Uytterhoeven Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/d35ba11bd705e3c728f94ff0414ac6ae1156244f.1626267422.git.geert+renesas@glider.be commit 1db70c0277f1086ba546ed5331a5df2cbef4ed8d Author: Geert Uytterhoeven Date: Wed Jul 14 15:20:01 2021 +0200 ARM: dts: rza: Add I2C interrupt-names Add "interrupt-names" properties to the I2C device nodes of the RZ/A1H and RZ/A2M DTS files, to make it easier to review the interrupt mappings. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/7a073439e37f6672e4809af0a2ee9cd4ac820ec6.1626267422.git.geert+renesas@glider.be commit 112dfa5ca16cc95dd6ceef7387a5f0f8a808da56 Author: Geert Uytterhoeven Date: Wed Jul 14 15:20:00 2021 +0200 dt-bindings: i2c: renesas,riic: Add interrupt-names The Renesas RZ/A and RZ/G2L I2C Bus Interface has no less than 8 interrupts. Hence document the "interrupt-names" property, to make it easier to review the interrupt mappings in DTS files. Note that this property cannot be made required yet, as the RIIC nodes in all DTS files lack the property. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/a81d0e14e395f297666e8c3a8ce3e292d2606a65.1626267422.git.geert+renesas@glider.be commit 4513fb87e1402ad815912ec7f027eb17149f44ee Merge: 9b24dab9937d5 c775626fb3379 Author: Marc Zyngier Date: Thu Aug 12 11:40:50 2021 +0100 Merge branch irq/misc-5.15 into irq/irqchip-next - Fix edge interrupt support on loongson systems - Advertise lack of wake-up logic on mtk-sysirq * irq/misc-5.15: irqchip/mtk-sysirq: Skip setting irq-wake irqchip/loongson-pch-pic: Improve edge triggered interrupt support Signed-off-by: Marc Zyngier commit 9b24dab9937d57f6d1d1b0bfd1994fb77657469c Merge: 53b13565fc8c6 eecb06813d738 Author: Marc Zyngier Date: Thu Aug 12 11:40:15 2021 +0100 Merge branch irq/generic_handle_domain_irq into irq/irqchip-next - Tree-wide conversion to generic_handle_domain_irq() - irqdomain documentation update * irq/generic_handle_domain_irq: EDAC/altera: Convert to generic_handle_domain_irq() powerpc: Bulk conversion to generic_handle_domain_irq() nios2: Bulk conversion to generic_handle_domain_irq() xtensa: Bulk conversion to generic_handle_domain_irq() SH: Bulk conversion to generic_handle_domain_irq() gpu: Bulk conversion to generic_handle_domain_irq() mips: Bulk conversion to generic_handle_domain_irq() arc: Bulk conversion to generic_handle_domain_irq() ARM: Bulk conversion to generic_handle_domain_irq() mfd: Bulk conversion to generic_handle_domain_irq() pinctrl: Bulk conversion to generic_handle_domain_irq() gpio: Bulk conversion to generic_handle_domain_irq() Documentation: Update irq_domain.rst with new lookup APIs Signed-off-by: Marc Zyngier commit eecb06813d7381dbee98034983e9db64bfb3a131 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 EDAC/altera: Convert to generic_handle_domain_irq() Replace generic_handle_irq(irq_linear_revmap()) with a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit 2c8996583013a2e2fa09a2c4ddebe6692c45a9c2 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 powerpc: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit 153517d4e7d1c3f5d6174db6177ff3f3f56a9b5c Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 nios2: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit d3c149b768fb54fdea8ce4edbc768fe7e72a22ca Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 xtensa: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit 2e0e0ff41147ee925972dfdf9128635c64c7ee54 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 SH: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit 66c6594b6dd66e04909d35dd5281c67cb81ecd2c Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 gpu: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier commit 0661cb2af0ba628e40a288d134b64c5a9e001a3f Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 mips: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Acked-by: Thomas Bogendoerfer Signed-off-by: Marc Zyngier commit c9604ddd8ad4cca644d00e455c3fd42393adf119 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 arc: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Acked-by: Vineet Gupta Signed-off-by: Marc Zyngier commit a1e5cd9650ed6000e1c0d7c940154e132ed26914 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 ARM: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Acked-by: Krzysztof Kozlowski Signed-off-by: Marc Zyngier commit 3b0cccef0574ef82da2d85180fcfcf9637f8154d Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 mfd: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Acked-by: Lee Jones Signed-off-by: Marc Zyngier commit a9cb09b7be84a7adc9e6f4aaf8d770933d65f953 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 pinctrl: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Acked-by: Krzysztof Kozlowski Acked-by: Linus Walleij Signed-off-by: Marc Zyngier commit dbd1c54fc82051bf7f3271b43517281f5b2cff51 Author: Marc Zyngier Date: Tue May 4 17:42:18 2021 +0100 gpio: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Reviewed-by: Geert Uytterhoeven Acked-by: Linus Walleij Signed-off-by: Marc Zyngier commit 991007ba6ccad588504cbd1eadf19fbf15c67ace Author: Marc Zyngier Date: Sat Jul 24 12:40:23 2021 +0100 Documentation: Update irq_domain.rst with new lookup APIs Catch up with the recent irqdomain updates, and document {generic_,}handle_domain_irq(), irq_resolve_mapping() as well as the deprecation of some of the older APIs. Signed-off-by: Marc Zyngier commit 148bcca9ad0488d623aa36b21ac152bb056a1ae4 Author: Len Baker Date: Sun Aug 8 14:50:11 2021 +0200 soc: renesas: Prefer memcpy() over strcpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. So, use memcpy() as a safe replacement. This is a previous step in the path to remove the strcpy() function entirely from the kernel. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210808125012.4715-3-len.baker@gmx.com Signed-off-by: Geert Uytterhoeven commit a729691b541f6e63043beae72e635635abe5dc09 Author: Paul Gortmaker Date: Sun May 30 12:24:47 2021 -0400 x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions When this platform was relatively new in November 2011, with early BIOS revisions, a reboot quirk was added in commit 6be30bb7d750 ("x86/reboot: Blacklist Dell OptiPlex 990 known to require PCI reboot") However, this quirk (and several others) are open-ended to all BIOS versions and left no automatic expiry if/when the system BIOS fixed the issue, meaning that nobody is likely to come along and re-test. What is really problematic with using PCI reboot as this quirk does, is that it causes this platform to do a full power down, wait one second, and then power back on. This is less than ideal if one is using it for boot testing and/or bisecting kernels when legacy rotating hard disks are installed. It was only by chance that the quirk was noticed in dmesg - and when disabled it turned out that it wasn't required anymore (BIOS A24), and a default reboot would work fine without the "harshness" of power cycling the machine (and disks) down and up like the PCI reboot does. Doing a bit more research, it seems that the "newest" BIOS for which the issue was reported[1] was version A06, however Dell[2] seemed to suggest only up to and including version A05, with the A06 having a large number of fixes[3] listed. As is typical with a new platform, the initial BIOS updates come frequently and then taper off (and in this case, with a revival for CPU CVEs); a search for O990-A.exe reveals the following dates: A02 16 Mar 2011 A03 11 May 2011 A06 14 Sep 2011 A07 24 Oct 2011 A10 08 Dec 2011 A14 06 Sep 2012 A16 15 Oct 2012 A18 30 Sep 2013 A19 23 Sep 2015 A20 02 Jun 2017 A23 07 Mar 2018 A24 21 Aug 2018 While it's overkill to flash and test each of the above, it would seem likely that the issue was contained within A0x BIOS versions, given the dates above and the dates of issue reports[4] from distros. So rather than just throw out the quirk entirely, limit the scope to just those early BIOS versions, in case people are still running systems from 2011 with the original as-shipped early A0x BIOS versions. [1] https://lore.kernel.org/lkml/1320373471-3942-1-git-send-email-trenn@suse.de/ [2] https://www.dell.com/support/kbdoc/en-ca/000131908/linux-based-operating-systems-stall-upon-reboot-on-optiplex-390-790-990-systems [3] https://www.dell.com/support/home/en-ca/drivers/driversdetails?driverid=85j10 [4] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/768039 Fixes: 6be30bb7d750 ("x86/reboot: Blacklist Dell OptiPlex 990 known to require PCI reboot") Signed-off-by: Paul Gortmaker Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210530162447.996461-4-paul.gortmaker@windriver.com commit 12febc181886f0658ce3413f554203c255d338dd Author: Paul Gortmaker Date: Sun May 30 12:24:46 2021 -0400 x86/reboot: Document how to override DMI platform quirks commit 5955633e91bf ("x86/reboot: Skip DMI checks if reboot set by user") made it so that it's not required to recompile the kernel in order to bypass broken reboot quirks compiled into an image: * This variable is used privately to keep track of whether or not * reboot_type is still set to its default value (i.e., reboot= hasn't * been set on the command line). This is needed so that we can * suppress DMI scanning for reboot quirks. Without it, it's * impossible to override a faulty reboot quirk without recompiling. However, at the time it was not eally documented outside the source code, and so this information isn't really available to the average user out there. The change is a little white lie and invented "reboot=default" since it is easy to remember, and documents well. The truth is that any random string that is *not* a currently accepted string will work. Since that doesn't document well for non-coders, and since it's unknown what the future additions might be, lay claim on "default" since that is exactly what it achieves. Signed-off-by: Paul Gortmaker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210530162447.996461-3-paul.gortmaker@windriver.com commit 162a5284faf41b2441b8f686f9ac4771c7a8f669 Author: Paul Gortmaker Date: Sun May 30 12:24:45 2021 -0400 x86/reboot: Document the "reboot=pci" option It is mentioned in the top level non-arch specific file but it was overlooked here for x86. Signed-off-by: Paul Gortmaker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210530162447.996461-2-paul.gortmaker@windriver.com commit 0de6fd5fd51c8c3bbc8e023111ea4fba9b72816b Author: Andy Shevchenko Date: Wed Aug 11 16:39:32 2021 +0300 wwan: core: Unshadow error code returned by ida_alloc_range() ida_alloc_range() may return other than -ENOMEM error code. Unshadow it in the wwan_create_port(). Signed-off-by: Andy Shevchenko Reviewed-by: Sergey Ryazanov Reviewed-by: Loic Poulain Signed-off-by: David S. Miller commit 7428022b50d0fbb4846dd0f00639ea09d36dff02 Author: DENG Qingfang Date: Wed Aug 11 17:50:43 2021 +0800 net: dsa: mt7530: fix VLAN traffic leaks again When a port leaves a VLAN-aware bridge, the current code does not clear other ports' matrix field bit. If the bridge is later set to VLAN-unaware mode, traffic in the bridge may leak to that port. Remove the VLAN filtering check in mt7530_port_bridge_leave. Fixes: 474a2ddaa192 ("net: dsa: mt7530: fix VLAN traffic leaks") Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530") Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit e0ba60509d64a7e91d13d28c247db59bf39d9837 Author: Oleksij Rempel Date: Wed Aug 11 08:37:12 2021 +0200 net: phy: nxp-tja11xx: log critical health state TJA1102 provides interrupt notification for the critical health states like overtemperature and undervoltage. The overtemperature bit is set if package temperature is beyond 155C°. This functionality was tested by heating the package up to 200C° The undervoltage bit is set if supply voltage drops beyond some critical threshold. Currently not tested. In a typical use case, both of this events should be logged and stored (or send to some remote system) for further investigations. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 445af0d25992a92f2caf9c0e089cc7030d6b4eec Merge: 6c4110d9f499e 769afb3fda06b Author: David S. Miller Date: Thu Aug 12 10:50:33 2021 +0100 Merge branch 'pktgen-imix' Nick Richardson says: ==================== pktgen: Add IMIX mode Adds internet mix (IMIX) mode to pktgen. Internet mix is included in many user-space network perf testing tools. It allows for the user to specify a distribution of discrete packet sizes to be generated. This type of test is common among vendors when perf testing their devices. [RFC link: https://datatracker.ietf.org/doc/html/rfc2544#section-9.1] This allows users to get a more complete picture of how their device will perform in the real-world. This feature adds a command that allows users to specify an imix distribution in the following format: imix_weights size_1,weight_1 size_2,weight_2 ... size_n,weight_n The distribution of packets with size_i will be (weight_i / total_weights) where total_weights = weight_1 + weight_2 + ... + weight_n For example: imix_weights 40,7 576,4 1500,1 The pkt_size "40" will account for 7 / (7 + 4 + 1) = ~58% of the total packets sent. This patch was tested with the following: 1. imix_weights = 40,7 576,4 1500,1 2. imix_weights = 0,7 576,4 1500,1 - Packet size of 0 is resized to the minimum, 42 3. imix_weights = 40,7 576,4 1500,1 count = 0 - Zero count. - Runs until user stops pktgen. Invalid Configurations 1. clone_skb = 200 imix_weights = 40,7 576,4 1500,1 - Returns error code -524 (-ENOTSUPP) when setting imix_weights 2. len(imix_weights) > MAX_IMIX_ENTRIES - Returns -7 (-E2BIG) This patch is split into three parts, each provide different aspects of required functionality: 1. Parse internet mix input. 2. Add IMIX Distribution representation. 3. Process and output IMIX results. Changes in v2: * Remove __ prefix outside of uAPI. * Use seq_puts instead of seq_printf where necessary. * Reorder variable declaration. * Return -EINVAL instead of -ENOTSUPP when using IMIX with clone_skb > 0 ==================== Signed-off-by: David S. Miller commit 769afb3fda06b109d524257b46b0416ccf6ea6b2 Author: Nick Richardson Date: Tue Aug 10 19:01:55 2021 +0000 pktgen: Add output for imix results The bps for imix mode is calculated by: sum(imix_entry.size) / time_elapsed The actual counts of each imix_entry are displayed under the "Current:" section of the interface output in the following format: imix_size_counts: size_1,count_1 size_2,count_2 ... size_n,count_n Example (count = 200000): imix_weights: 256,1 859,3 205,2 imix_size_counts: 256,32082 859,99796 205,68122 Result: OK: 17992362(c17964678+d27684) usec, 200000 (859byte,0frags) 11115pps 47Mb/sec (47977140bps) errors: 0 Summary of changes: Calculate bps based on imix counters when in IMIX mode. Add output for IMIX counters. Signed-off-by: Nick Richardson Signed-off-by: David S. Miller commit 90149031325c06fadc806720d57171aacc74a5d7 Author: Nick Richardson Date: Tue Aug 10 19:01:54 2021 +0000 pktgen: Add imix distribution bins In order to represent the distribution of imix packet sizes, a pre-computed data structure is used. It features 100 (IMIX_PRECISION) "bins". Contiguous ranges of these bins represent the respective packet size of each imix entry. This is done to avoid the overhead of selecting the correct imix packet size based on the corresponding weights. Example: imix_weights 40,7 576,4 1500,1 total_weight = 7 + 4 + 1 = 12 pkt_size 40 occurs 7/total_weight = 58% of the time pkt_size 576 occurs 4/total_weight = 33% of the time pkt_size 1500 occurs 1/total_weight = 9% of the time We generate a random number between 0-100 and select the corresponding packet size based on the specified weights. Eg. random number = 358723895 % 100 = 65 Selects the packet size corresponding to index:65 in the pre-computed imix_distribution array. An example of the pre-computed array is below: The imix_distribution will look like the following: 0 -> 0 (index of imix_entry.size == 40) 1 -> 0 (index of imix_entry.size == 40) 2 -> 0 (index of imix_entry.size == 40) [...] -> 0 (index of imix_entry.size == 40) 57 -> 0 (index of imix_entry.size == 40) 58 -> 1 (index of imix_entry.size == 576) [...] -> 1 (index of imix_entry.size == 576) 90 -> 1 (index of imix_entry.size == 576) 91 -> 2 (index of imix_entry.size == 1500) [...] -> 2 (index of imix_entry.size == 1500) 99 -> 2 (index of imix_entry.size == 1500) Create and use "bin" representation of the imix distribution. Signed-off-by: Nick Richardson Signed-off-by: David S. Miller commit 52a62f8603f97e720882c8f5aff2767ac6a11d5f Author: Nick Richardson Date: Tue Aug 10 19:01:53 2021 +0000 pktgen: Parse internet mix (imix) input Adds "imix_weights" command for specifying internet mix distribution. The command is in this format: "imix_weights size_1,weight_1 size_2,weight_2 ... size_n,weight_n" where the probability that packet size_i is picked is: weight_i / (weight_1 + weight_2 + .. + weight_n) The user may provide up to 100 imix entries (size_i,weight_i) in this command. The user specified imix entries will be displayed in the "Params" section of the interface output. Values for clone_skb > 0 is not supported in IMIX mode. Summary of changes: Add flag for enabling internet mix mode. Add command (imix_weights) for internet mix input. Return -ENOTSUPP when clone_skb > 0 in IMIX mode. Display imix_weights in Params. Create data structures to store imix entries and distribution. Signed-off-by: Nick Richardson Signed-off-by: David S. Miller commit 626520f4ba27d92c8caaf2d1f70c4bca4ea3f9de Author: Dan Carpenter Date: Thu Aug 12 09:58:52 2021 +0300 staging: r8188eu: scheduling in atomic in rtw_createbss_cmd() A couple of the callers are holding spinlocks so this allocation has to be atomic. One spinlock is in rtw_set_802_11_connect() but the simpler spinlock to review is when this function is called from rtw_surveydone_event_callback(). Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210812065852.GB31863@kili Signed-off-by: Greg Kroah-Hartman commit 0ea03f795df43643a932cd9ee809fdc7ecafa873 Author: Dan Carpenter Date: Thu Aug 12 09:57:10 2021 +0300 staging: r8188eu: Fix a couple scheduling in atomic bugs These allocations are sometimes done while holding a spin_lock so they have to be atomic. The call tree looks like this: -> rtw_set_802_11_connect() <- takes a spin_lock -> rtw_do_join() -> rtw_sitesurvey_cmd() <-- does a GFP_ATOMIC allocation -> p2p_ps_wk_cmd() Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210812065710.GA31863@kili Signed-off-by: Greg Kroah-Hartman commit 0d5e4bfe47eaf6080c812748a359f64be8073b3c Author: Larry Finger Date: Wed Aug 11 20:52:32 2021 -0500 staging: r8188eu: Fix smatch warnings in os_dep/*.c Smatch shows the following: drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590) drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/mlme_linux.c:106 rtw_os_indicate_disconnect() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/os_intfs.c:1118 ips_netdrv_open() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/osdep_service.c:37 rtw_atoi() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/recv_linux.c:65 rtw_os_recvbuf_resource_free() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/usb_intf.c:338 rtw_hw_suspend() warn: variable dereferenced before check 'padapter' (see line 327) drivers/staging/r8188eu/os_dep/usb_intf.c:381 rtw_hw_suspend() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/usb_intf.c:394 rtw_hw_resume() warn: variable dereferenced before check 'padapter' (see line 391) drivers/staging/r8188eu/os_dep/usb_intf.c:506 rtw_resume() warn: inconsistent indenting Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210812015232.23784-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 178cd80dc15c9f47a839e4a65242cfca5eca4c70 Author: Larry Finger Date: Wed Aug 11 20:52:31 2021 -0500 staging: r8188eu: Fix smatch problems in hal/*.c Smatch detects the folloring: drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting drivers/staging/r8188eu/hal/HalPwrSeqCmd.c:65 HalPwrSeqCmdParsing() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm.c:225 ODM_DMWatchdog() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: if statement not indented drivers/staging/r8188eu/hal/odm.c:491 ODM_Write_DIG() warn: if statement not indented drivers/staging/r8188eu/hal/odm.c:493 ODM_Write_DIG() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm.c:496 ODM_Write_DIG() warn: if statement not indented drivers/staging/r8188eu/hal/odm.c:498 ODM_Write_DIG() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm.c:501 ODM_Write_DIG() warn: if statement not indented drivers/staging/r8188eu/hal/odm.c:551 odm_DIGbyRSSI_LPS() warn: inconsistent indenting drivers/staging/r8188eu/hal/Hal8188ERateAdaptive.c:360 odm_ARFBRefresh_8188E() warn: inconsistent indenting drivers/staging/r8188eu/hal/odm_HWConfig.c:268 odm_RxPhyStatus92CSeries_Parsing() warn: inconsistent indenting drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:726 hal_EfusePowerSwitch_RTL8188E() warn: inconsistent indenting drivers/staging/r8188eu/hal/rtl8188e_mp.c:60 Hal_mpt_SwitchRfSetting() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:547 wpa_set_encryption() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590) drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7055 rtw_mp_thermal() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:856 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:859 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:862 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:887 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:915 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:925 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_halinit.c:929 rtl8188eu_hal_init() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_ops_linux.c:263 usb_writeN() warn: inconsistent indenting drivers/staging/r8188eu/hal/usb_ops_linux.c:568 usb_read_port() warn: inconsistent indenting ` Signed-off-by: Larry Finger drivers/staging/r8188eu/hal/usb_halinit.c:1887:17: warning: mixing declarations and code drivers/staging/r8188eu/hal/usb_ops_linux.c:519:25: error: typename in expression Link: https://lore.kernel.org/r/20210812015232.23784-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 4d50f76395122d1a4e24bbba79986889e4b457ff Author: Larry Finger Date: Wed Aug 11 20:52:30 2021 -0500 staging: r8188eu: Fix Smatch warnings for core/*.c Smatch reports the following problems: drivers/staging/r8188eu/core/rtw_br_ext.c:655 nat25_db_handle() warn: if statement not indented drivers/staging/r8188eu/core/rtw_cmd.c:436 rtw_sitesurvey_cmd() warn: if statement not indented drivers/staging/r8188eu/core/rtw_cmd.c:450 rtw_sitesurvey_cmd() warn: if statement not indented drivers/staging/r8188eu/core/rtw_led.c:330 SwLedBlink2() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:359 SwLedBlink2() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:538 SwLedBlink4() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:567 SwLedBlink4() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:685 SwLedBlink5() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:771 SwLedControlMode1() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:819 SwLedControlMode1() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:845 SwLedControlMode1() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_led.c:1574 LedControl8188eu() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme.c:420 is_same_network() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme.c:986 rtw_joinbss_update_stainfo() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme.c:1162 rtw_joinbss_event_prehandle() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme.c:1858 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'. drivers/staging/r8188eu/core/rtw_mlme.c:1869 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'. drivers/staging/r8188eu/core/rtw_mlme_ext.c:401 _mgt_dispatcher() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme_ext.c:3210 is_matched_in_profilelist() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme_ext.c:4351 dump_mgntframe_and_wait() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme_ext.c:4374 dump_mgntframe_and_wait_ack() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mlme_ext.c:7378 _linked_rx_signal_strehgth_display() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mp.c:694 SetPacketTx() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_mp.c:900 _rtw_mp_xmit_priv() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_p2p.c:1130 process_p2p_group_negotation_req() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_recv.c:188 rtw_free_recvframe() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_recv.c:499 portctrl() error: uninitialized symbol 'ether_type'. drivers/staging/r8188eu/core/rtw_recv.c:507 portctrl() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_recv.c:722 sta2sta_data_frame() warn: if statement not indented drivers/staging/r8188eu/core/rtw_recv.c:1601 amsdu_to_msdu() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_security.c:283 rtw_seccalctkipmic() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_security.c:1116 aes_cipher() warn: for statement not indented drivers/staging/r8188eu/core/rtw_security.c:1213 rtw_aes_encrypt() warn: inconsistent indenting rivers/staging/r8188eu/core/rtw_sta_mgt.c:18 _rtw_init_stainfo() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_sta_mgt.c:475 rtw_get_bcmc_stainfo() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_wlan_util.c:65 cckratesonly_included() warn: if statement not indented drivers/staging/r8188eu/core/rtw_wlan_util.c:1150 should_forbid_n_rate() warn: if statement not indented drivers/staging/r8188eu/core/rtw_wlan_util.c:1401 check_assoc_AP() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_wlan_util.c:1403 check_assoc_AP() warn: inconsistent indenting drivers/staging/r8188eu/core/rtw_xmit.c:805 rtw_make_wlanhdr() warn: if statement not indented drivers/staging/r8188eu/core/rtw_xmit.c:1691 rtw_br_client_tx() warn: inconsistent indenting drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210812015232.23784-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 221abd4d478ab52fd17de9287fa302ac0e06f7b3 Author: Fabio M. De Francesco Date: Thu Aug 12 02:25:19 2021 +0200 staging: r8188eu: Remove no more necessary definitions and code Remove no more necessary further 5GHz related code, along with no more used definitions of macro and variables. Acked-by: Larry Finger Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210812002519.23678-4-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9f68048346276aab4f37d5c6c57259dd61feb88c Author: Fabio M. De Francesco Date: Thu Aug 12 02:25:18 2021 +0200 staging: r8188eu: Remove code related to unsupported channels Remove all code related to unsupported channel bandwidths. rtl8188eu* NICs work only on 20 and 40 Mhz channels. Acked-by: Larry Finger Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210812002519.23678-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1fee0cc9398e511a4c38c3e6dc1d300c4bbef986 Author: Fabio M. De Francesco Date: Thu Aug 12 02:25:17 2021 +0200 staging: r8188eu: Remove all 5GHz network types Remove all 5Ghz network types. r8188eu works on 802.11bgn standards and on 2.4Ghz band. Acked-by: Larry Finger Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210812002519.23678-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit e7dd1a58ce708ae965c143ed6837b503d98cacfa Author: Martin Kaiser Date: Wed Aug 11 22:14:50 2021 +0200 staging: r8188eu: remove CONFIG_USB_HCI from Makefile We already depend on USB. There's no need to set CONFIG_USB_HCI in the Makefile. Some other Realtek drivers use #ifdef CONFIG_USB_HCI in their code, the r8188 driver doesn't. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210811201450.31366-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a1c95234d6e6b2604abff9208e38db162b9a3e7b Author: Martin Kaiser Date: Wed Aug 11 22:14:49 2021 +0200 staging: r8188eu: use proper way to build a module It seems that for now, we can only build this driver as a module. Use the same mechanism as other drivers (such as rtl8723bs or the deprecated rtl8188eu) to enforce building as a module, i.e. depend on m in Kconfig instead of setting CONFIG_R8188EU = m in the Makefile. If we set CONFIG_R8188EU in the Makefile, this setting will not be visible in .config. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210811201450.31366-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ef32cccc7f0656e8affa28b0ace7298c8144acb3 Author: Martin Kaiser Date: Wed Aug 11 22:14:48 2021 +0200 staging: r8188eu: (trivial) remove a duplicate debug print Keep the one that shows the wakeup capability. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210811201450.31366-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 86d90d776e1cfe169457a64666e73abb6dfb1423 Author: Martin Kaiser Date: Wed Aug 11 22:14:47 2021 +0200 staging: r8188eu: remove unused function parameters rtw_usb_if1_init and chip_by_usb_id do not need a struct usb_device_id parameter. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210811201450.31366-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b8a59fed6b1def89f0d14034998ddb757e767751 Author: Martin Kaiser Date: Wed Aug 11 22:14:46 2021 +0200 staging: r8188eu: remove unused efuse hal components struct hal_data_8188e contains some components related to efuses which are not used for rl8188eu. Acked-by: Phillip Potter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210811201450.31366-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 959aabedcd91ba659e17191f1d3da96ceb1c4147 Author: Dee-Jay Anthony Logozzo Date: Wed Aug 11 23:41:32 2021 +1000 staging: gdm724x: Place macro argument within parentheses Place the macro arguments within parentheses to avoid precedence issues. This solves the following checkpatch.pl warnings CHECK: Macro argument 'len' may be better as '(len)' to avoid precedence issues +#define ND_NLMSG_S_LEN(len) (len + ND_IFINDEX_LEN) CHECK: Macro argument 'nlh' may be better as '(nlh)' to avoid precedence issues +#define ND_NLMSG_R_LEN(nlh) (nlh->nlmsg_len - ND_IFINDEX_LEN) Signed-off-by: Dee-Jay Anthony Logozzo Link: https://lore.kernel.org/r/20210811134132.5240-1-dj@djl.id.au Signed-off-by: Greg Kroah-Hartman commit afc880cbb294026c2a43501cad26c21720f7078f Author: Baokun Li Date: Fri Jun 18 10:24:21 2021 +0800 x86/power: Fix kernel-doc warnings in cpu.c Fixes the following kernel-doc warnings: arch/x86/power/cpu.c:76: warning: Function parameter or member 'ctxt' not described in '__save_processor_state' arch/x86/power/cpu.c:192: warning: Function parameter or member 'ctxt' not described in '__restore_processor_state' Signed-off-by: Baokun Li Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210618022421.1595596-1-libaokun1@huawei.com commit b9770b0b6eac2be3772b6f4748e6b899a9ab2870 Author: Pavel Skripkin Date: Wed Aug 11 20:50:52 2021 +0300 udmabuf: fix general protection fault in udmabuf_create Syzbot reported general protection fault in udmabuf_create. The problem was in wrong error handling. In commit 16c243e99d33 ("udmabuf: Add support for mapping hugepages (v4)") shmem_read_mapping_page() call was replaced with find_get_page_flags(), but find_get_page_flags() returns NULL on failure instead PTR_ERR(). Wrong error checking was causing GPF in get_page(), since passed page was equal to NULL. Fix it by changing if (IS_ER(!hpage)) to if (!hpage) Reported-by: syzbot+e9cd3122a37c5d6c51e8@syzkaller.appspotmail.com Fixes: 16c243e99d33 ("udmabuf: Add support for mapping hugepages (v4)") Signed-off-by: Pavel Skripkin Link: http://patchwork.freedesktop.org/patch/msgid/20210811175052.21254-1-paskripkin@gmail.com Signed-off-by: Gerd Hoffmann commit 636a1e697555e73c28cdd6952a409edbfdd16475 Author: Chris Blake Date: Mon Aug 9 19:40:21 2021 -0500 platform/x86: add meraki-mx100 platform driver This adds platform support for the Cisco Meraki MX100 (Tinkerbell) network appliance. This sets up the network LEDs and Reset button. Depends-on: ef0eea5b151ae ("mfd: lpc_ich: Enable GPIO driver for DH89xxCC") Co-developed-by: Christian Lamparter Signed-off-by: Christian Lamparter Signed-off-by: Chris Blake Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210810004021.2538308-1-chrisrblake93@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f6413ba357b7d78a0e2828b51412037447df5d75 Author: Andy Shevchenko Date: Fri Aug 6 18:49:51 2021 +0300 platform/x86/intel: int3472: Use y instead of objs in Makefile The 'objs' is for user space tools, for the kernel modules we should use 'y'. Signed-off-by: Andy Shevchenko Reviewed-by: Daniel Scally Link: https://lore.kernel.org/r/20210806154951.4564-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit cb84acd1165cf3b0f79d2ad09388bb263835974a Author: Andy Shevchenko Date: Fri Aug 6 18:50:17 2021 +0300 platform/x86/intel: pmt: Use y instead of objs in Makefile The 'objs' is for user space tools, for the kernel modules we should use 'y'. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210806155017.4633-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit bde53eafb9257a5c9d2327a1cb887c7bcbf6c38f Author: Andy Shevchenko Date: Fri Aug 6 18:49:41 2021 +0300 platform/x86/intel: int33fe: Use y instead of objs in Makefile The 'objs' is for user space tools, for the kernel modules we should use 'y'. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210806154941.4491-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit bc6b8d7eec4fecb11634bc4256b4b79d0fe617e9 Author: Andy Shevchenko Date: Tue Aug 3 22:40:39 2021 +0300 platform/x86: dell-smo8800: Convert to be a platform driver ACPI core in conjunction with platform driver core provides an infrastructure to enumerate ACPI devices. Use it in order to remove a lot of boilerplate code. Signed-off-by: Andy Shevchenko Reviewed-by: Pali Rohár Tested-by: Pali Rohár Link: https://lore.kernel.org/r/20210803194039.35083-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit b325d78e78a232fb2019023354dd6b7493bc8760 Author: Andy Shevchenko Date: Tue Aug 3 22:25:24 2021 +0300 platform/surface: aggregator: Use y instead of objs in Makefile The 'objs' is for user space tools, for the kernel modules we should use 'y'. Signed-off-by: Andy Shevchenko Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20210803192524.67031-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit eddebe6dbe2c961ee7f6dc4a1fafc81212b44177 Author: Andy Shevchenko Date: Tue Aug 3 19:32:52 2021 +0300 platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper ACPI provides a generic helper to get I²C Serial Bus resources. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20210803163252.60141-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit 560c71d4250f5f32b7952c290ddaf3cd4548a3ec Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:00 2021 +0200 platform/x86: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Stuart Hayes Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20210803141621.780504-18-bigeasy@linutronix.de Signed-off-by: Hans de Goede commit 1d18ed5eab2a22d9af8c1cd7d23ea7c8dbb9088a Author: Hans de Goede Date: Mon Aug 2 14:07:34 2021 +0200 platform/x86: dell-smbios: Remove unused dmi_system_id table dell-smbios is depended on by dell-laptop and that has this same table + some extra entries for chassis-type 30, 31 and 32. Since dell-laptop will already auto-load based on the DMI table in there (which also is more complete) and since dell-laptop will then bring in the dell-smbios module, the only scenario I can think of where this DMI table inside dell-smbios-smm.c is useful is if users have the dell-laptop module disabled and they want to use the sysfs interface offered by dell-smbios-smm.c. But that is such a corner case, even requiring a custom kernel build, that it does not weigh up against having this duplicate table, which as the current state already shows can only grow stale. Users who do hit this corner-case can always explicitly modprobe / insmod the module. Cc: Mario Limonciello Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210802120734.36732-1-hdegoede@redhat.com commit d36d4a1d75d2a8bd14ec00d5cb0ce166f6886146 Author: Srinivas Pandruvada Date: Tue Jul 27 09:50:52 2021 -0700 platform/x86: ISST: Fix optimization with use of numa When numa is used to map CPU to PCI device, the optimized path to read from cached data is not working and still calls _isst_if_get_pci_dev(). The reason is that when caching the mapping, numa information is not available as it is read later. So move the assignment of isst_cpu_info[cpu].numa_node before calling _isst_if_get_pci_dev(). Fixes: aa2ddd242572 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping") Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20210727165052.427238-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit c775626fb3379f0c7c21925743104aeae6d2f8b1 Author: Markus Schneider-Pargmann Date: Wed Jul 7 08:20:04 2021 +0200 irqchip/mtk-sysirq: Skip setting irq-wake mtk-sysirq doesn't require specific logic to work with wakeup IRQs. To allow registered IRQs to be used as a wakeup-source, add the flag IRQCHIP_SKIP_SET_WAKE. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210707062004.782787-1-msp@baylibre.com commit 53b13565fc8c614f89c2c9b25b3c233af6f20233 Merge: 00a2b7c758958 d753f849bf487 Author: Marc Zyngier Date: Thu Aug 12 08:12:30 2021 +0100 Merge branch irq/gicv3-eppi-partition into irq/irqchip-next - Add support for partitionned EPPIs, modeled after the existing partitioned PPI support * irq/gicv3-eppi-partition: irqchip/gic-v3: Fix selection of partition domain for EPPIs irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq Signed-off-by: Marc Zyngier commit d753f849bf487faffd05898e6a8e5aa9d146cb50 Author: James Morse Date: Thu Jul 29 17:27:48 2021 +0000 irqchip/gic-v3: Fix selection of partition domain for EPPIs commit 5f51f803826e ("irqchip/gic-v3: Add EPPI range support") added GIC_IRQ_TYPE_PARTITION support for EPPI to gic_irq_domain_translate(), and commit 52085d3f2028 ("irqchip/gic-v3: Dynamically allocate PPI partition descriptors") made the gic_data.ppi_descs array big enough for EPPI, but neither gic_irq_domain_select() nor partition_domain_translate() were updated. This means partitions are created by partition_create_desc() for the EPPI range, but can't be registered as they will always match the root domain and map to the summary interrupt. Update gic_irq_domain_select() to match PPI and EPPI. The fwspec for PPI and EPPI both start from 0. Use gic_irq_domain_translate() to find the hwirq from the fwspec, then convert this to a ppi index. Reported-by: Valentin Schneider Signed-off-by: James Morse Reviewed-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729172748.28841-3-james.morse@arm.com commit bfa80ee9ce6e2f18da76459c3dd7b0ad57fb2c20 Author: James Morse Date: Thu Jul 29 17:27:47 2021 +0000 irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq gic_get_ppi_index() is a useful concept for ppi partitions, as the GIC has two PPI ranges but needs mapping to a single range when used as an index in the gic_data.ppi_descs[] array. Add a double-underscore version which takes just the intid. This will be used in the partition domain select and translate helpers to enable partition support for the EPPI range. Signed-off-by: James Morse Reviewed-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729172748.28841-2-james.morse@arm.com commit e5dec38ac5d05d17a7110c8045aa101015281e4d Author: Huacai Chen Date: Thu Aug 5 21:22:16 2021 +0800 irqchip/loongson-pch-pic: Improve edge triggered interrupt support Edge-triggered mode and level-triggered mode need different handlers, and edge-triggered mode need a specific ack operation. So improve it. Fixes: ef8c01eb64ca6719da449dab0 ("irqchip: Add Loongson PCH PIC controller") Signed-off-by: Chen Zhu Signed-off-by: Huacai Chen Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210805132216.3539007-1-chenhuacai@loongson.cn commit fe45ffa4c505783637233609b677446020738b87 Author: Alexandre Ghiti Date: Fri Jul 23 15:01:28 2021 +0200 riscv: Move early fdt mapping creation in its own function The code that handles the early fdt mapping is hard to read and does not create the same mapping size depending on the kernel: - for 64-bit, 2 PMD entries are used which amounts to a 4MB mapping - for 32-bit, 2 PGDIR entries are used which amounts to a 8MB mapping So keep using 2 PMD entries for 64-bit and use only one PGD entry for 32-bit needed to cover 4MB. Move that into a new function called create_fdt_early_page_table which, using the same naming as create_kernel_page_table. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 977765ce319b98939205cf07aa1d76150713c69b Author: Alexandre Ghiti Date: Fri Jul 23 15:01:27 2021 +0200 riscv: Simplify BUILTIN_DTB device tree mapping handling __PAGETABLE_PMD_FOLDED defines a 2-level page table that is only used in 32-bit kernel, so there is no need to check for CONFIG_64BIT in #ifndef __PAGETABLE_PMD_FOLDED and vice-versa. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 6f3e5fd241c33d2407f7aaa930b141af6ad7c35b Author: Alexandre Ghiti Date: Fri Jul 23 15:01:26 2021 +0200 riscv: Use __maybe_unused instead of #ifdefs around variable declarations This allows to simplify the code and make it more readable. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 526f83df1d83b9c95e571ea5d4dff12be1b215ec Author: Alexandre Ghiti Date: Fri Jul 23 15:01:25 2021 +0200 riscv: Get rid of map_size parameter to create_kernel_page_table The kernel must always be mapped using PMD_SIZE, and this is already the case, this just simplifies create_kernel_page_table. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 0aba691a7443a7541c1dc56423e0c92cc6ea7164 Author: Alexandre Ghiti Date: Fri Jul 23 15:01:24 2021 +0200 riscv: Introduce va_kernel_pa_offset for 32-bit kernel va_kernel_pa_offset was only used for 64-bit as the kernel mapping lies in the linear mapping for 32-bit kernel and then only the offset between the PAGE_OFFSET and the kernel load address is needed. But this distinction complexifies the code with #ifdefs and especially with a separate definition of the address conversions macros. Simplify the code by defining this variable for both 32-bit and 64-bit. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit e96c2153d0fc0a1c218bf5ba149ccdf75d19a275 Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar commit 361a172d230964807c0b479738749c50d95d7b50 Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: omap: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar commit 3701fd64a3fb947fc805ca0d108ab87562a9659b Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: mediatek: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar commit fcd300c685d5152e76a811c492b0e6eccde29717 Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: imx6q: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar commit 94ab4c3c259c7d00746e5cafb55b5f5125f34b71 Author: Viresh Kumar Date: Tue Aug 10 12:24:36 2021 +0530 cpufreq: dt: Use .register_em() to register with energy model Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar commit c17495b01b72b53bd290f442d39b060e015c7aea Author: Viresh Kumar Date: Tue Aug 10 12:04:33 2021 +0530 cpufreq: Add callback to register with energy model Many cpufreq drivers register with the energy model for each policy and do exactly the same thing. Follow the footsteps of thermal-cooling, to get it done from the cpufreq core itself. Provide a new callback, which will be called, if present, by the cpufreq core at the right moment (more on that in the code's comment). Also provide a generic implementation that uses dev_pm_opp_of_register_em(). This also allows us to register with the EM at a later point of time, compared to ->init(), from where the EM core can access cpufreq policy directly using cpufreq_cpu_get() type of helpers and perform other work, like marking few frequencies inefficient, this will be done separately. Reviewed-by: Quentin Perret Reviewed-by: Lukasz Luba Signed-off-by: Viresh Kumar commit bb8c26d9387fe428068dcab35b1873ea3b881de1 Author: Viresh Kumar Date: Wed Aug 11 10:22:55 2021 +0530 cpufreq: vexpress: Set CPUFREQ_IS_COOLING_DEV flag Reuse the cpufreq core's registration of cooling device by setting the CPUFREQ_IS_COOLING_DEV flag. Set this only if bL switcher isn't enabled. Signed-off-by: Viresh Kumar commit bd19573e05f6e643f003672c799b3b2301f2f493 Author: Nilesh Javali Date: Mon Aug 9 21:37:20 2021 -0700 scsi: qla2xxx: Update version to 10.02.06.100-k Link: https://lore.kernel.org/r/20210810043720.1137-15-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit c8fadf019964d0eb1da410ba8b629494d3339db9 Author: Saurav Kashyap Date: Mon Aug 9 21:37:19 2021 -0700 scsi: qla2xxx: Sync queue idx with queue_pair_map idx The first invocation of function find_first_zero_bit will return 0 and queue_id gets set to 0. An index of queue_pair_map also gets set to 0. qpair_id = find_first_zero_bit(ha->qpair_qid_map, ha->max_qpairs); set_bit(qpair_id, ha->qpair_qid_map); ha->queue_pair_map[qpair_id] = qpair; In the alloc_queue callback driver checks the map, if queue is already allocated: ha->queue_pair_map[qidx] This works fine as long as max_qpairs is greater than nvme_max_hw_queues(8) since the size of the queue_pair_map is equal to max_qpair. In case nr_cpus is less than 8, max_qpairs is less than 8. This creates wrong value returned as qpair. [ 1572.353669] qla2xxx [0000:24:00.3]-2121:6: Returning existing qpair of 4e00000000000000 for idx=2 [ 1572.354458] general protection fault: 0000 [#1] SMP PTI [ 1572.354461] CPU: 1 PID: 44 Comm: kworker/1:1H Kdump: loaded Tainted: G IOE --------- - - 4.18.0-304.el8.x86_64 #1 [ 1572.354462] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 03/01/2013 [ 1572.354467] Workqueue: kblockd blk_mq_run_work_fn [ 1572.354485] RIP: 0010:qla_nvme_post_cmd+0x92/0x760 [qla2xxx] [ 1572.354486] Code: 84 24 5c 01 00 00 00 00 b8 0a 74 1e 66 83 79 48 00 0f 85 a8 03 00 00 48 8b 44 24 08 48 89 ee 4c 89 e7 8b 50 24 e8 5e 8e 00 00 41 ff 47 04 0f ae f0 41 f6 47 24 04 74 19 f0 41 ff 4f 04 b8 f0 [ 1572.354487] RSP: 0018:ffff9c81c645fc90 EFLAGS: 00010246 [ 1572.354489] RAX: 0000000000000001 RBX: ffff8ea3e5070138 RCX: 0000000000000001 [ 1572.354490] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8ea4c866b800 [ 1572.354491] RBP: ffff8ea4c866b800 R08: 0000000000005010 R09: ffff8ea4c866b800 [ 1572.354492] R10: 0000000000000001 R11: 000000069d1ca3ff R12: ffff8ea4bc460000 [ 1572.354493] R13: ffff8ea3e50702b0 R14: ffff8ea4c4c16a58 R15: 4e00000000000000 [ 1572.354494] FS: 0000000000000000(0000) GS:ffff8ea4dfd00000(0000) knlGS:0000000000000000 [ 1572.354495] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1572.354496] CR2: 000055884504fa58 CR3: 00000005a1410001 CR4: 00000000000606e0 [ 1572.354497] Call Trace: [ 1572.354503] ? check_preempt_curr+0x62/0x90 [ 1572.354506] ? dma_direct_map_sg+0x72/0x1f0 [ 1572.354509] ? nvme_fc_start_fcp_op.part.32+0x175/0x460 [nvme_fc] [ 1572.354511] ? blk_mq_dispatch_rq_list+0x11c/0x730 [ 1572.354515] ? __switch_to_asm+0x35/0x70 [ 1572.354516] ? __switch_to_asm+0x41/0x70 [ 1572.354518] ? __switch_to_asm+0x35/0x70 [ 1572.354519] ? __switch_to_asm+0x41/0x70 [ 1572.354521] ? __switch_to_asm+0x35/0x70 [ 1572.354522] ? __switch_to_asm+0x41/0x70 [ 1572.354523] ? __switch_to_asm+0x35/0x70 [ 1572.354525] ? entry_SYSCALL_64_after_hwframe+0xb9/0xca [ 1572.354527] ? __switch_to_asm+0x41/0x70 [ 1572.354529] ? __blk_mq_sched_dispatch_requests+0xc6/0x170 [ 1572.354531] ? blk_mq_sched_dispatch_requests+0x30/0x60 [ 1572.354532] ? __blk_mq_run_hw_queue+0x51/0xd0 [ 1572.354535] ? process_one_work+0x1a7/0x360 [ 1572.354537] ? create_worker+0x1a0/0x1a0 [ 1572.354538] ? worker_thread+0x30/0x390 [ 1572.354540] ? create_worker+0x1a0/0x1a0 [ 1572.354541] ? kthread+0x116/0x130 [ 1572.354543] ? kthread_flush_work_fn+0x10/0x10 [ 1572.354545] ? ret_from_fork+0x35/0x40 Fix is to use index 0 for admin and first IO queue. Link: https://lore.kernel.org/r/20210810043720.1137-14-njavali@marvell.com Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 4a0a542fe5e4273baf9228459ef3f75c29490cba Author: Saurav Kashyap Date: Mon Aug 9 21:37:18 2021 -0700 scsi: qla2xxx: Changes to support kdump kernel for NVMe BFS The MSI-X and MSI calls fails in kdump kernel. Because of this qla2xxx_create_qpair() fails leading to .create_queue callback failure. The fix is to return existing qpair instead of allocating new one and allocate a single hw queue. [ 19.975838] qla2xxx [0000:d8:00.1]-00c7:11: MSI-X: Failed to enable support, giving up -- 16/-28. [ 19.984885] qla2xxx [0000:d8:00.1]-0037:11: Falling back-to MSI mode -- ret=-28. [ 19.992278] qla2xxx [0000:d8:00.1]-0039:11: Falling back-to INTa mode -- ret=-28. .. .. .. [ 21.141518] qla2xxx [0000:d8:00.0]-2104:2: qla_nvme_alloc_queue: handle 00000000e7ee499d, idx =1, qsize 32 [ 21.151166] qla2xxx [0000:d8:00.0]-0181:2: FW/Driver is not multi-queue capable. [ 21.158558] qla2xxx [0000:d8:00.0]-2122:2: Failed to allocate qpair [ 21.164824] nvme nvme0: NVME-FC{0}: reset: Reconnect attempt failed (-22) [ 21.171612] nvme nvme0: NVME-FC{0}: Reconnect attempt in 2 seconds Link: https://lore.kernel.org/r/20210810043720.1137-13-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 62e0dec59c1e139dab55aff5aa442adc97804271 Author: Saurav Kashyap Date: Mon Aug 9 21:37:17 2021 -0700 scsi: qla2xxx: Changes to support kdump kernel Avoid allocating firmware dump and only allocate a single queue for a kexec kernel. Link: https://lore.kernel.org/r/20210810043720.1137-12-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit a5741427322b6158fbe9f1a4c118e95a05cecd53 Author: Arun Easi Date: Mon Aug 9 21:37:16 2021 -0700 scsi: qla2xxx: Suppress unnecessary log messages during login Suppress logging of retryable errors. These can still be seen if extended logging is enabled. Link: https://lore.kernel.org/r/20210810043720.1137-11-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit a57214443f0f85639a0d9bbb8bd658d82dbf0927 Author: Quinn Tran Date: Mon Aug 9 21:37:15 2021 -0700 scsi: qla2xxx: Fix NPIV create erroneous error When user creates multiple NPIVs, the switch capabilities field is checked before a vport is allowed to be created. This field is being toggled if a switch scan is in progress. This creates erroneous reject of vport create. Link: https://lore.kernel.org/r/20210810043720.1137-10-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 0c9a5f3e42f75dbad5966aa59db935b694ab00d1 Author: Quinn Tran Date: Mon Aug 9 21:37:14 2021 -0700 scsi: qla2xxx: Fix unsafe removal from linked list On NPIV delete, the VPort is taken off a linked list in an unsafe manner. The check for VPort refcount should be done behind lock before taking off the element. [ 2733.016907] general protection fault: 0000 [#1] SMP NOPTI [ 2733.016908] qla2xxx [0000:22:00.1]-7088:27: VP[4] deleted. [ 2733.016912] CPU: 22 PID: 23481 Comm: qla2xxx_15_dpc Kdump: loaded Tainted: G OE KX 5.3.18-47-default #1 SLE15-SP3 [ 2733.016914] Hardware name: Dell Inc. PowerEdge R7525/0PYVT1, BIOS 2.1.4 02/17/2021 [ 2733.016929] RIP: 0010:qla2x00_abort_isp+0x90/0x850 [qla2xxx] [ 2733.016933] RSP: 0018:ffffb9cfc91efe98 EFLAGS: 00010087 [ 2733.016935] RAX: 0000000000000292 RBX: dead000000000100 RCX: 0000000000000000 [ 2733.016936] RDX: 0000000000000001 RSI: ffff944bfeb99558 RDI: ffff944bfc4b4488 [ 2733.016937] RBP: ffff944bfc4b2868 R08: 00000000000187a2 R09: 0000000000000001 [ 2733.016937] R10: ffffb9cfc91efcc8 R11: 0000000000000001 R12: ffff944bfc4b4000 [ 2733.016938] R13: ffff944bfc4b4870 R14: ffff944bfc4b4488 R15: ffff944bda895c80 [ 2733.016939] FS: 0000000000000000(0000) GS:ffff944bfeb80000(0000) knlGS:0000000000000000 [ 2733.016940] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2733.016940] CR2: 00007fc173e74458 CR3: 0000001ff57de000 CR4: 0000000000350ee0 [ 2733.016941] Call Trace: [ 2733.016951] qla2xxx_pci_error_detected+0x190/0x190 [qla2xxx] [ 2733.016957] qla2x00_do_dpc+0x560/0xa10 [qla2xxx] [ 2733.016962] kthread+0x10d/0x130 [ 2733.016963] kthread_park+0xa0/0xa0 [ 2733.016966] ret_from_fork+0x22/0x40 Link: https://lore.kernel.org/r/20210810043720.1137-9-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 01c97f2dd8fb4d2188c779a975031c0fe1ec061d Author: Quinn Tran Date: Mon Aug 9 21:37:13 2021 -0700 scsi: qla2xxx: Fix port type info Over time, fcport->port_type became a flag field. The flags within this field were not defined properly. This caused external tools to read wrong info. Link: https://lore.kernel.org/r/20210810043720.1137-8-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 85818882c3d91485a153e7df3a8fdd8a0c4ff763 Author: Quinn Tran Date: Mon Aug 9 21:37:12 2021 -0700 scsi: qla2xxx: Add debug print of 64G link speed Add debug print of 64G link speed. Link: https://lore.kernel.org/r/20210810043720.1137-7-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 137316ba79a686d7193ea6c8e5eb284fa24e4f9f Author: Arun Easi Date: Mon Aug 9 21:37:11 2021 -0700 scsi: qla2xxx: Show OS name and version in FDMI-1 To be consistent with other OS drivers, register OS name and version in FDMI-1 fabric registration. Link: https://lore.kernel.org/r/20210810043720.1137-6-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 44c57f205876518b14ab2b4b5d88a181f41260bb Author: Saurav Kashyap Date: Mon Aug 9 21:37:10 2021 -0700 scsi: qla2xxx: Changes to support FCP2 Target Add changes to support FCP2 Target. Link: https://lore.kernel.org/r/20210810043720.1137-5-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit ade660d4d50645521b6ce16703ccbbf21f1367a1 Author: Quinn Tran Date: Mon Aug 9 21:37:09 2021 -0700 scsi: qla2xxx: Adjust request/response queue size for 28xx Adjust request/respond queue size for 28xx to match 27xx adapter. Link: https://lore.kernel.org/r/20210810043720.1137-4-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 4c15442d9c06ae6ce0a03fd69c4869f343d67473 Author: Arun Easi Date: Mon Aug 9 21:37:07 2021 -0700 scsi: qla2xxx: Add host attribute to trigger MPI hang Add a mechanism to trigger MPI pause for debugging purposes. Link: https://lore.kernel.org/r/20210810043720.1137-2-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 9757f8af04423f60b6ecbd6802ff4e3f618fbb44 Author: Shai Malin Date: Thu Aug 5 01:14:12 2021 +0300 scsi: qedi: Add support for fastpath doorbell recovery Driver fastpath employs doorbells to indicate to the device that work is available. Each doorbell translates to a message sent to the device over PCI. These messages are queued by the doorbell queue HW block, and handled by the HW. If a sufficient amount of CPU cores are sending messages at a sufficient rate, the queue can overflow, and messages can be dropped. There are many entities in the driver which can send doorbell messages. When overflow happens, a fatal HW attention is indicated, and the Doorbell HW block stops accepting new doorbell messages until recovery procedure is done. When overflow occurs, all doorbells are dropped. Since doorbells are aggregatives, if more doorbells are sent nothing has to be done. But if the "last" doorbell is dropped, the doorbelling entity doesn’t know this happened, and may wait forever for the device to perform the action. The doorbell recovery mechanism addresses just that - it sends the last doorbell of every entity. [mkp: fix missing brackets reported by Guenter Roeck] Link: https://lore.kernel.org/r/20210804221412.5048-1-smalin@marvell.com Co-developed-by: Manish Rangankar Signed-off-by: Manish Rangankar Signed-off-by: Shai Malin Signed-off-by: Martin K. Petersen commit 315480209b8e1032e63c70dafc8f4133b3c9a333 Merge: 4cc0096e2d54b f0f82e2476f6a Author: Martin K. Petersen Date: Wed Aug 11 22:37:22 2021 -0400 Merge branch '5.14/scsi-fixes' into 5.15/scsi-staging Resolve mpt3sas conflict between 5.14/scsi-fixes and 5.15/scsi-staging reported by sfr. Signed-off-by: Martin K. Petersen commit 4cc0096e2d54bc31ead127be59e3a2d02a187ac9 Author: Martin K. Petersen Date: Fri Aug 6 00:00:20 2021 -0400 scsi: isci: Use the proper SCSI midlayer interfaces for PI Use scsi_prot_ref_tag() instead of scsi_get_lba() to get the reference tag for a given I/O. Link: https://lore.kernel.org/r/20210806040023.5355-3-martin.petersen@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6a20e21ae1e25f73385cc248f53440e78dd3cb94 Author: Martin K. Petersen Date: Fri Aug 6 00:00:19 2021 -0400 scsi: core: Add helper to return number of logical blocks in a request Link: https://lore.kernel.org/r/20210806040023.5355-2-martin.petersen@oracle.com Cc: Bart Van Assche Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2266a2def97ce11ec979b6c58a1b637a16eca7dd Author: Bart Van Assche Date: Mon Aug 9 16:03:55 2021 -0700 scsi: core: Remove the request member from struct scsi_cmnd Since all scsi_cmnd.request users are gone, remove the request pointer from struct scsi_cmnd. Link: https://lore.kernel.org/r/20210809230355.8186-53-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 12bc2f13f3813e95d7b13239291f9eb36dae83cb Author: Martin K. Petersen Date: Tue Aug 10 00:55:09 2021 -0400 scsi: ufs: ufshpb: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit c5bf198c5edcf279313948029527a755732cd753 Author: Martin K. Petersen Date: Tue Aug 10 00:52:41 2021 -0400 scsi: storvsc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 9c4a6d5281854e1491acd51c7e3794c5d00574ce Author: Bart Van Assche Date: Mon Aug 9 16:03:54 2021 -0700 scsi: usb-storage: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-52-bvanassche@acm.org Acked-by: Alan Stern Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cb22f89e7a12a4a9b3a203b78b3c9a275693d47f Author: Bart Van Assche Date: Mon Aug 9 16:03:53 2021 -0700 scsi: tcm_loop: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-51-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 80ca10b6052dd0148095a6a9825ed1b817a538c7 Author: Bart Van Assche Date: Mon Aug 9 16:03:52 2021 -0700 scsi: xen-scsifront: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-50-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7cc4554ef2c2eef56aaf96610c3bda37a93fd701 Author: Bart Van Assche Date: Mon Aug 9 16:03:51 2021 -0700 scsi: virtio_scsi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-49-bvanassche@acm.org Acked-by: Michael S. Tsirkin Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3f2c1002e0fcb61f0b0776cb24c7dd8f06a152b9 Author: Bart Van Assche Date: Mon Aug 9 16:03:50 2021 -0700 scsi: ufs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-48-bvanassche@acm.org Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 77ff7756c73ebebd2dac936e965b01e645feb53d Author: Bart Van Assche Date: Mon Aug 9 16:03:49 2021 -0700 scsi: sym53c8xx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-47-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6c5d5422c5337ec496991defe2b6bea2b422289a Author: Bart Van Assche Date: Mon Aug 9 16:03:48 2021 -0700 scsi: sun3_scsi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-46-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit bbfa8d7d128397bcfaaf5c0b08f4772047efe086 Author: Bart Van Assche Date: Mon Aug 9 16:03:47 2021 -0700 scsi: stex: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-45-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ec808ef9b83874ffdfef76b0bab4b49e8e1e3e09 Author: Bart Van Assche Date: Mon Aug 9 16:03:46 2021 -0700 scsi: snic: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-44-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 12db0f9347ad1ff82c8b686959a9d73bb046ec9a Author: Bart Van Assche Date: Mon Aug 9 16:03:45 2021 -0700 scsi: smartpqi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-43-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a6e76e6f2c0efd9e2cf8cf93f532c4d46070e5c5 Author: Bart Van Assche Date: Mon Aug 9 16:03:44 2021 -0700 scsi: scsi_debug: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-42-bvanassche@acm.org Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ba4baf0951bba4bf51eb3ab088063c92c35950d1 Author: Bart Van Assche Date: Mon Aug 9 16:03:43 2021 -0700 scsi: qlogicpti: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-41-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 924b3d7a3a74f4b719369b9d25f76f01a6babc06 Author: Bart Van Assche Date: Mon Aug 9 16:03:42 2021 -0700 scsi: qla4xxx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-40-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c7d6b2c2cd5656b05849afb0de3f422da1742d0f Author: Bart Van Assche Date: Mon Aug 9 16:03:41 2021 -0700 scsi: qla2xxx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-39-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3f5e62c5e074242449567ed8843ea99952e13ae8 Author: Bart Van Assche Date: Mon Aug 9 16:03:40 2021 -0700 scsi: qla1280: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. Remove the unused CMD_REQUEST() macro. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-38-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 44656cfb01028d742410e9c1159f33ceee5e8615 Author: Bart Van Assche Date: Mon Aug 9 16:03:39 2021 -0700 scsi: qedi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-37-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d995da61228608bbd4cc986874359e8ad634b13b Author: Bart Van Assche Date: Mon Aug 9 16:03:38 2021 -0700 scsi: qedf: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-36-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0f8f3ea84a894b637b6353191b56ced57f0e69a8 Author: Bart Van Assche Date: Mon Aug 9 16:03:37 2021 -0700 scsi: ncr53c8xx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-35-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 43b2d1b14ed01442f5b9850d8964365e3df4f7e9 Author: Bart Van Assche Date: Mon Aug 9 16:03:36 2021 -0700 scsi: myrs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-34-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2fd8f23aae36113d35827d38aba8ac391b7dcace Author: Bart Van Assche Date: Mon Aug 9 16:03:35 2021 -0700 scsi: myrb: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-33-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ce425dd7dbc9a35ebd6016ca03beb5736cf96fa2 Author: Bart Van Assche Date: Mon Aug 9 16:03:34 2021 -0700 scsi: mvumi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-32-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 24b3c922bc8318dda1047d79489d77596f39eee7 Author: Bart Van Assche Date: Mon Aug 9 16:03:33 2021 -0700 scsi: mpt3sas: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-31-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 69868c3b69391ac52922c9d907a36f41b8bccb7e Author: Bart Van Assche Date: Mon Aug 9 16:03:32 2021 -0700 scsi: mpi3mr: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-30-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4bccecf1c9a95b7094ba75319955e29a3c76e959 Author: Bart Van Assche Date: Mon Aug 9 16:03:31 2021 -0700 scsi: megaraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-29-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4221c8a4bdd347b561ad865f890ffebd8e018ccd Author: Bart Van Assche Date: Mon Aug 9 16:03:30 2021 -0700 scsi: lpfc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-28-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cad1a780e065b7789df7f947dfa635e6481a8379 Author: Bart Van Assche Date: Mon Aug 9 16:03:29 2021 -0700 scsi: libsas: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-27-bvanassche@acm.org Reviewed-by: John Garry Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 240ec1197786f5c81e957f256f9eebc46d5a07a4 Author: Bart Van Assche Date: Mon Aug 9 16:03:28 2021 -0700 scsi: ips: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-26-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0cd75102014b8a72192f3ca72c68a423bede0bc7 Author: Bart Van Assche Date: Mon Aug 9 16:03:27 2021 -0700 scsi: ibmvscsi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-25-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e9ddad785ec2da58ba1d48a280cea868d2009785 Author: Bart Van Assche Date: Mon Aug 9 16:03:26 2021 -0700 scsi: ibmvfc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-24-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 84090d42c437a510598da3710eb5db705cfbe133 Author: Bart Van Assche Date: Mon Aug 9 16:03:25 2021 -0700 scsi: hpsa: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-23-bvanassche@acm.org Acked-by: Don Brace Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1effbface9671659f187547bf60caae043724ba3 Author: Bart Van Assche Date: Mon Aug 9 16:03:24 2021 -0700 scsi: hisi_sas: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-22-bvanassche@acm.org Acked-by: John Garry Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e1c9f0cfac4f2ed2bc6e89f2f4061dcf1538d4cd Author: Bart Van Assche Date: Mon Aug 9 16:03:23 2021 -0700 scsi: fnic: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-21-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3ada9c791b1df0aa1d101d97e6ab46c4bbeb8374 Author: Bart Van Assche Date: Mon Aug 9 16:03:22 2021 -0700 scsi: dpt_i2o: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-20-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d3e16aecea2bee65ef80c4da797029156c014bc6 Author: Bart Van Assche Date: Mon Aug 9 16:03:21 2021 -0700 scsi: cxlflash: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-19-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c14f1fee18f07bd9073defd101ac4ffb4178efb9 Author: Bart Van Assche Date: Mon Aug 9 16:03:20 2021 -0700 scsi: csiostor: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-18-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4bfb9809b877ee9ee8bfdeec7104f0ec80c94ada Author: Bart Van Assche Date: Mon Aug 9 16:03:19 2021 -0700 scsi: bnx2i: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-17-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 11bf4ec580737c77755c1c4ab698d12988dd93e6 Author: Bart Van Assche Date: Mon Aug 9 16:03:18 2021 -0700 scsi: aha1542: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-16-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 40e16ce7b6fa6c75b000bcd984d5094a667b7529 Author: Bart Van Assche Date: Mon Aug 9 16:03:17 2021 -0700 scsi: advansys: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-15-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8779b4bdbc12c3fd3a6567a8ec2a8d375b874ad2 Author: Bart Van Assche Date: Mon Aug 9 16:03:16 2021 -0700 scsi: aacraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-14-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2e4b231ac1252cff05cb9c1a737cf4850ecbcd17 Author: Bart Van Assche Date: Mon Aug 9 16:03:15 2021 -0700 scsi: NCR5380: Use sc_data_direction instead of rq_data_dir() This patch prepares for the removal of the request pointer from struct scsi_cmnd and does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-13-bvanassche@acm.org Cc: Michael Schmitz Suggested-by: Finn Thain Acked-by: Finn Thain Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cd4b46cdb4917a3186bbf6c068aa30cd8d64b6a4 Author: Bart Van Assche Date: Mon Aug 9 16:03:14 2021 -0700 scsi: 53c700: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-12-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d78f31ce7ef9a3bccb63ecb668d124166e591dfc Author: Bart Van Assche Date: Mon Aug 9 16:03:13 2021 -0700 scsi: zfcp: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-11-bvanassche@acm.org Acked-by: Benjamin Block Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9c5274eec75b13e8d26fe562c5276b0b91a254a9 Author: Bart Van Assche Date: Mon Aug 9 16:03:12 2021 -0700 scsi: RDMA/srp: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-10-bvanassche@acm.org Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 99247108c0f2aac3a153fd255f12e17db40432a2 Author: Bart Van Assche Date: Mon Aug 9 16:03:11 2021 -0700 scsi: RDMA/iser: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-9-bvanassche@acm.org Reviewed-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c8329cd55bf4f2ae294121b3db1e44d7612b30fc Author: Bart Van Assche Date: Mon Aug 9 16:03:10 2021 -0700 scsi: ata: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-8-bvanassche@acm.org Cc: Jens Axboe Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit eb43d41de2917a5b290fd1f3e48af85f81495edf Author: Bart Van Assche Date: Mon Aug 9 16:03:09 2021 -0700 scsi: scsi_transport_spi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-7-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3b4720fc8d1c94cabf1a5cfe29f62d49c33aaea3 Author: Bart Van Assche Date: Mon Aug 9 16:03:08 2021 -0700 scsi: scsi_transport_fc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-6-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c4deb5b5ddd4d924d5067988290bde43ec2b519d Author: Bart Van Assche Date: Mon Aug 9 16:03:07 2021 -0700 scsi: sr: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-5-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 5999ccff0fd664e0dac0fe0093b9a5962161d636 Author: Bart Van Assche Date: Mon Aug 9 16:03:06 2021 -0700 scsi: sd: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-4-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit aa8e25e5006aac52c943c84e9056ab488630ee19 Author: Bart Van Assche Date: Mon Aug 9 16:03:05 2021 -0700 scsi: core: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. Cast away constness where necessary when passing a SCSI command pointer to scsi_cmd_to_rq(). This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-3-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 51f3a478892873337c54068d1185bcd797000a52 Author: Bart Van Assche Date: Mon Aug 9 16:03:04 2021 -0700 scsi: core: Introduce the scsi_cmd_to_rq() function The 'request' member of struct scsi_cmnd is superfluous. The struct request and struct scsi_cmnd data structures are adjacent and hence the request pointer can be derived easily from a scsi_cmnd pointer. Introduce a helper function that performs that conversion in a type-safe way. This patch is the first step towards removing the request member from struct scsi_cmnd. Making that change has the following advantages: - This is a performance optimization since adding an offset to a pointer takes less time than dereferencing a pointer. - struct scsi_cmnd becomes smaller. Link: https://lore.kernel.org/r/20210809230355.8186-2-bvanassche@acm.org Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 10163cee1f06fc2e17bcf7bbc2982337202d1d5c Author: Avri Altman Date: Sun Aug 8 12:00:24 2021 +0300 scsi: ufs: ufshpb: Do not report victim error in HCM In host control mode, eviction is perceived as an extreme measure. There are several conditions that both the entering and exiting regions should meet, so that eviction will take place. The common case however, is that those conditions are rarely met, so it is normal that the act of eviction fails. Therefore, do not report an error in host control mode if eviction fails. Link: https://lore.kernel.org/r/20210808090024.21721-5-avri.altman@wdc.com Fixes: 6c59cb501b86 (scsi: ufs: ufshpb: Make eviction depend on region's reads) Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 22aede9f48b6766fb67441610120db9b04adf109 Author: Avri Altman Date: Sun Aug 8 12:00:23 2021 +0300 scsi: ufs: ufshpb: Verify that 'num_inflight_map_req' is non-negative 'num_inflight_map_req' should not be negative. It is incremented and decremented without any protection, allowing it theoretically to be negative, should some weird unbalanced count occur. Verify that the those calls are properly serialized. Link: https://lore.kernel.org/r/20210808090024.21721-4-avri.altman@wdc.com Fixes: 33845a2d844b (scsi: ufs: ufshpb: Limit the number of in-flight map requests) Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 07106f86ae13d9197bfd38c2d47743304b14099e Author: Avri Altman Date: Sun Aug 8 12:00:22 2021 +0300 scsi: ufs: ufshpb: Use a correct max multi chunk In HPB2.0, if pre_req_min_tr_len < transfer_len < pre_req_max_tr_len, the driver is expected to send a HPB-WRITE-BUFFER companion to HPB-READ. The upper bound should fit into a single byte, regardless of bMAX_ DATA_SIZE_FOR_HPB_SINGLE_CMD which being an attribute (u32) can be significantly larger. To further illustrate the issue, consider the following scenario: - SCSI_DEFAULT_MAX_SECTORS is 1024 limiting the I/O chunks to 512KB - The OEM changes scsi_host_template .max_sectors to be 2048 which allows for 1MB requests: transfer_len = 256 - pre_req_max_tr_len = HPB_MULTI_CHUNK_HIGH = 256 - ufshpb_is_supported_chunk() returns true (256 <= 256) - WARN_ON_ONCE(256 > 256) doesn't warn - ufshpb_set_hpb_read_to_upiu() casts transfer_len to u8: transfer_len = 0 - The command is failing with ILLEGAL REQUEST Link: https://lore.kernel.org/r/20210808090024.21721-3-avri.altman@wdc.com Fixes: 41d8a9333cc9 (scsi: ufs: ufshpb: Add HPB 2.0 support) Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 283e61c5a9bed2c2acde3f50a3f76f09816c0aab Author: Avri Altman Date: Sun Aug 8 12:00:21 2021 +0300 scsi: ufs: ufshpb: Rewind the read timeout on every read The purpose of the "cold"-timer is not to hang-on to active regions with no reads. Therefore the read timeout should be rewound on every read, and not just when the region is activated. Link: https://lore.kernel.org/r/20210808090024.21721-2-avri.altman@wdc.com Fixes: 13c044e91678 (scsi: ufs: ufshpb: Add "cold" regions timer) Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 018eca456c4b4dca56aaf1ec27f309c74d0fe246 Author: Guoqing Jiang Date: Wed Jul 21 10:53:15 2021 +0800 block: move some macros to blkdev.h Move them (PAGE_SECTORS_SHIFT, PAGE_SECTORS and SECTOR_MASK) to the generic header file to remove redundancy. Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20210721025315.1729118-1-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit 59a27e1122133831111f9e2e40fec2307d742487 Author: Alexandre Ghiti Date: Wed Jul 21 09:59:37 2021 +0200 riscv: Optimize kernel virtual address conversion macro The current test in kernel_mapping_va_to_pa only applies when CONFIG_XIP_KERNEL is set, so use IS_ENABLED to optimize this macro at compile-time in standard kernels that do not require this test. Signed-off-by: Alexandre Ghiti Tested-by: Emil Renner Berthing Reviewed-by: Jisheng Zhang Reviewed-By: Vitaly Wool Signed-off-by: Palmer Dabbelt commit a22c074fd1dd52a8b41dd6789220409b64093e9c Merge: cb22f12f30258 3bfa7d40ce736 Author: Dave Airlie Date: Thu Aug 12 11:20:16 2021 +1000 Merge tag 'drm-intel-next-2021-08-10-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 changes for v5.15: Features: - Basic DG2 platform enabling (Matt, Animesh, Gwan-gyeong, José) - Add PSF GV point support for display bandwidth calculation (Stan) - Add platform release id version support (Lucas) - Add support for forcing DSC BPP for testing (Vandita, Patnana) Refactoring and cleanups: - Remove CNL support completely (Lucas) - Revid/stepping cleanup (Matt, Anusha) - Make display stepping check upper bounds exclusive (Matt) - Remove old GEN macros (Lucas) - Refactor DG1 interrupt handler (Paulo) - Refactor DMC stepping info (Anusha) Fixes: - Fix XELPD color capability reporting; it's not yet enabled (Uma) - Fix DG1 memory bandwidth computation (Clint) - Fix mux on certain HP laptops (Kai-Heng) - Various display workarounds (José, Matt, Imre) - Fix error state dumps wrt SFC_DONE (Matt) - Fix DG1 and XEPLD audio power domains (Anshuman) - Fix ADL-P and ADL-S ddi buf translation tables (Matt) - Fix DP/HDMI modeset sequences causing issues on ADL-P (José) - PSR2 fixes (José) - Fix DP MST modeset with FEC on TGL+ - Fix MBUS DBOX A credits on ADL-P (José) - Fix DP PHY test training set programming (Khaled) - Fix dgfx pcode uncore init done wait (Badal) - Fix DSC disable fuse check on GLK (Lucas) - Fix shared dpll mismatch for bigjoiner secondary pipe (Manasi) - Fix ADL-P underrun recovery (Matt) - Fix permissions on FEC support debugfs file (Vandita) Misc: - Backmerge drm-next (Rodrigo) - Bump RKL and TGL DMC firmware version (Anusha) Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/i915/i915_drv.h # drivers/gpu/drm/i915/intel_device_info.h From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87a6lpo1a9.fsf@intel.com commit cb22f12f302584a974a68034350bd48798843ffc Merge: 25fed6b324ac5 6ebfd22c96904 Author: Dave Airlie Date: Thu Aug 12 10:03:10 2021 +1000 Merge tag 'drm-xilinx-dpsub-20210809' of git://linuxtv.org/pinchartl/media into drm-next - Miscellaneous fixes in ZynqMP DPSUB driver Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/YRCSRZZV1HZYPvaG@pendragon.ideasonboard.com commit 25fed6b324ac556859d6dd0b7827cc8fb653ca99 Merge: 59b9d6baa1bea 927dfdd09d8c0 Author: Dave Airlie Date: Thu Aug 12 09:43:38 2021 +1000 Merge tag 'drm-intel-gt-next-2021-08-06-1' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-next UAPI Changes: - Add I915_MMAP_OFFSET_FIXED On devices with local memory `I915_MMAP_OFFSET_FIXED` is the only valid type. On devices without local memory, this caching mode is invalid. As caching mode when specifying `I915_MMAP_OFFSET_FIXED`, WC or WB will be used, depending on the object placement on creation. WB will be used when the object can only exist in system memory, WC otherwise. Userspace: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888 - Reinstate the mmap ioctl for (already released) integrated Gen12 platforms Rationale: Otherwise media driver breaks eg. for ADL-P. Long term goal is still to sunset the IOCTL even for integrated and require using mmap_offset. - Reject caching/set_domain IOCTLs on discrete Expected to become immutable property of the BO - Disallow changing context parameters after first use on Gen12 and earlier - Require setting context parameters at creation on platforms after Gen12 Rationale (for both): Allow less dynamic changes to the context to simplify the implementation and avoid user shooting theirselves in the foot. - Drop I915_CONTEXT_PARAM_RINGSIZE Userspace PR for compute-driver has not been merged - Drop I915_CONTEXT_PARAM_NO_ZEROMAP Userspace PR for libdrm / Beignet was never landed - Drop CONTEXT_CLONE API Userspace PR for Mesa was never landed - Drop getparam support for I915_CONTEXT_PARAM_ENGINES Only existed for symmetry wrt. setparam, never used. - Disallow bonding of virtual engines Drop the prep work, no hardware has been released needing it. - (Implicit) Disable gpu relocations Media userspace was the last userspace to still use them. They have converted so performance can be regained with an update. Core Changes: - Merge topic branch 'topic/i915-ttm-2021-06-11' (from Maarten) - Merge topic branch 'topic/revid_steppings' (from Matt R) - Merge topic branch 'topic/xehp-dg2-definitions-2021-07-21' (from Matt R) - Backmerges drm-next (Rodrigo) Driver Changes: - Initial workarounds for ADL-P (Clint) - Preliminary code for XeHP/DG2 (Stuart, Umesh, Matt R, Prathap, Ram, Venkata, Akeem, Tvrtko, John, Lucas) - Fix ADL-S DMA mask size to 39 bits (Tejas) - Remove code for CNL (Lucas) - Add ADL-P GuC/HuC firmwares (John) - Update HuC to 7.9.3 for TGL/ADL-S/RKL (John) - Fix -EDEADLK handling regression (Ville) - Implement Wa_1508744258 for DG1 and Gen12 iGFX (Jose) - Extend Wa_1406941453 to ADL-S (Jose) - Drop unnecessary workarounds per stepping for SKL/BXT/ICL (Matt R) - Use fuse info to enable SFC on Gen12 (Venkata) - Unconditionally flush the pages on acquire on EHL/JSL (Matt A) - Probe existence of backing struct pages upon userptr creation (Chris, Matt A) - Add an intermediate GEM proto-context to delay real context creation (Jason) - Implement SINGLE_TIMELINE with a syncobj (Jason) - Set the watchdog timeout directly in intel_context_set_gem (Jason) - Disallow userspace from creating contexts with too many engines (Jason) - Revert "drm/i915/gem: Asynchronous cmdparser" (Jason) - Revert "drm/i915: Propagate errors on awaiting already signaled fences" (Jason) - Revert "drm/i915: Skip over MI_NOOP when parsing" (Jason) - Revert "drm/i915: Shrink the GEM kmem_caches upon idling" (Daniel) - Always let TTM handle object migration (Jason) - Correct the locking and pin pattern for dma-buf (Thomas H, Michael R, Jason) - Migrate to system at dma-buf attach time (Thomas, Michael R) - MAJOR refactoring of the GuC backend code to allow for enabling on Gen11+ (Matt B, John, Michal Wa., Fernando, Daniele, Vinay) - Update GuC firmware interface to v62.0.0 (John, Michal Wa., Matt B) - Add GuCRC feature to hand over the control of HW RC6 to the GuC on Gen12+ when GuC submission is enabled (Vinay, Sujaritha, Daniele, John, Tvrtko) - Use the correct IRQ during resume and eliminate DRM IRQ midlayer (Thomas Z) - Add pipelined page migration and clearing (Chris, Thomas H) - Use TTM for system memory on discrete (Thomas H) - Implement object migration for display vs. dma-buf (Thomas H) - Perform execbuffer object locking as a separate step (Thomas H) - Add support for explicit L3BANK steering (Matt, Daniele) - Remove duplicated call to ops->pread (Daniel) - Fix pagefault disabling in the first execbuf slowpath (Daniel) - Simplify userptr locking (Thomas H) - Improvements to the GuC CTB code (Matt B, John) - Make GT workaround upper bounds exclusive (Matt R) - Check for nomodeset in i915_init() first (Daniel) - Delete now unused gpu reloc code (Daniel) - Document RFC plans for GuC submission, DRM scheduler and new parallel submit uAPI (Matt B) - Reintroduce buddy allocator this time with TTM (Matt A) - Support forcing page size with LMEM (Matt A) - Add i915_sched_engine to abstract a submission queue between backends (Matt B) - Use accelerated move in TTM (Ram) - Fix memory leaks from TTM backend (Thomas H) - Introduce WW transaction helper (Thomas H) - Improve debug Kconfig texts a bit (Daniel) - Unify user object creation code (Jason) - Use a table for i915_init/exit (Jason) - Move slabs to module init/exit (Daniel) - Remove now unused i915_globals (Daniel) - Extract i915_module.c (Daniel) - Consistently use adl-p/adl-s in WA comments (Jose) - Finish INTEL_GEN and friends conversion (Lucas) - Correct variable/function namings (Lucas) - Code checker fixes (Wan, Matt A) - Tracepoint improvements (Matt B) - Kerneldoc improvements (Tvrtko, Jason, Matt A, Maarten) - Selftest improvements (Chris, Matt A, Tejas, Thomas H, John, Matt B, Rahul, Vinay) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YQ0JmYiXhGskNcrI@jlahtine-mobl.ger.corp.intel.com commit 6c4110d9f499e2170fbb36723b0a5f50a8116304 Author: Nikolay Aleksandrov Date: Tue Aug 10 12:21:39 2021 +0300 net: bridge: vlan: fix global vlan option range dumping When global vlan options are equal sequentially we compress them in a range to save space and reduce processing time. In order to have the proper range end id we need to update range_end if the options are equal otherwise we get ranges with the same end vlan id as the start. Fixes: 743a53d9636a ("net: bridge: vlan: add support for dumping global vlan options") Signed-off-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20210810092139.11700-1-razor@blackwall.org Signed-off-by: Jakub Kicinski commit 83f0a0b7285b299e006b0698a0ddc1ffacff3e43 Author: Jeremy Kerr Date: Tue Aug 10 10:38:34 2021 +0800 mctp: Specify route types, require rtm_type in RTM_*ROUTE messages This change adds a 'type' attribute to routes, which can be parsed from a RTM_NEWROUTE message. This will help to distinguish local vs. peer routes in a future change. This means userspace will need to set a correct rtm_type in RTM_NEWROUTE and RTM_DELROUTE messages; we currently only accept RTN_UNICAST. Signed-off-by: Jeremy Kerr Link: https://lore.kernel.org/r/20210810023834.2231088-1-jk@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit ddccc5e368a33daeb6862192d4dca8e59af9234a Author: Yufeng Mo Date: Tue Aug 10 21:28:48 2021 +0800 net: hns3: add support for triggering reset by ethtool Currently, four reset types are supported for the HNS3 ethernet driver: IMP reset, global reset, function reset, and FLR. Only FLR can now be triggered by the user. To restore the device when an exception occurs, add support for triggering reset by ethtool. Run the "ethtool --reset DEVNAME mgmt | all | dedicated" to trigger the IMP | global | function reset manually. In addition, VF can only trigger function reset. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Link: https://lore.kernel.org/r/1628602128-15640-1-git-send-email-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 6e98893ec0f198ab1be66e149173afe49b3dc578 Merge: bc8968e420dcf 6569fa2d4e014 Author: Jakub Kicinski Date: Wed Aug 11 14:57:33 2021 -0700 Merge branch 'bonding-cleanup-header-file-and-error-msgs' Jonathan Toppins says: ==================== bonding: cleanup header file and error msgs Two small patches removing unreferenced symbols and unifying error messages across netlink and printk. ==================== Link: https://lore.kernel.org/r/cover.1628650079.git.jtoppins@redhat.com Signed-off-by: Jakub Kicinski commit 6569fa2d4e0147759f7580cb36fd6505feab12f7 Author: Jonathan Toppins Date: Tue Aug 10 22:53:31 2021 -0400 bonding: combine netlink and console error messages There seems to be no reason to have different error messages between netlink and printk. It also cleans up the function slightly. Signed-off-by: Jonathan Toppins Signed-off-by: Jakub Kicinski commit 891a88f4f5768b1e6ff52a2386d48558aa5a3f63 Author: Jonathan Toppins Date: Tue Aug 10 22:53:30 2021 -0400 bonding: remove extraneous definitions from bonding.h All of the symbols either only exist in bond_options.c or nowhere at all. These symbols were verified to not exist in the code base by using `git grep` and their removal was verified by compiling bonding.ko. Signed-off-by: Jonathan Toppins Signed-off-by: Jakub Kicinski commit bc8968e420dcff8d240fe1d49fd0b2214be98ca5 Author: Mark Brown Date: Tue Aug 10 13:37:48 2021 +0100 net: mscc: Fix non-GPL export of regmap APIs The ocelot driver makes use of regmap, wrapping it with driver specific operations that are thin wrappers around the core regmap APIs. These are exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap exports which is frowned upon. Add _GPL suffixes to at least the APIs that are doing register I/O. Signed-off-by: Mark Brown Acked-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210810123748.47871-1-broonie@kernel.org Signed-off-by: Jakub Kicinski commit 554594567b1fa3da74f88ec7b2dc83d000c58e98 Author: Tuo Li Date: Tue Aug 10 21:07:03 2021 -0700 drm/display: fix possible null-pointer dereference in dcn10_set_clock() The variable dc->clk_mgr is checked in: if (dc->clk_mgr && dc->clk_mgr->funcs->get_clock) This indicates dc->clk_mgr can be NULL. However, it is dereferenced in: if (!dc->clk_mgr->funcs->get_clock) To fix this null-pointer dereference, check dc->clk_mgr and the function pointer dc->clk_mgr->funcs->get_clock earlier, and return if one of them is NULL. Reported-by: TOTE Robot Signed-off-by: Tuo Li Signed-off-by: Alex Deucher commit a211260c34cfadc6068fece8c9e99e0fe1e2a2b6 Author: Tuo Li Date: Wed Aug 11 04:34:58 2021 -0700 gpu: drm: amd: amdgpu: amdgpu_i2c: fix possible uninitialized-variable access in amdgpu_i2c_router_select_ddc_port() The variable val is declared without initialization, and its address is passed to amdgpu_i2c_get_byte(). In this function, the value of val is accessed in: DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n", addr, *val); Also, when amdgpu_i2c_get_byte() returns, val may remain uninitialized, but it is accessed in: val &= ~amdgpu_connector->router.ddc_mux_control_pin; To fix this possible uninitialized-variable access, initialize val to 0 in amdgpu_i2c_router_select_ddc_port(). Reported-by: TOTE Robot Signed-off-by: Tuo Li Signed-off-by: Alex Deucher commit b53ef0df1ba8001b17da2f972cbc1f6091d1774a Author: Mukul Joshi Date: Mon Aug 9 15:52:50 2021 -0400 drm/amdkfd: CWSR with software scheduler This patch adds support to program trap handler settings when loading driver with software scheduler (sched_policy=2). Signed-off-by: Mukul Joshi Suggested-by: Jay Cornwall Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit eff8cbf096a735116cf6fad94d795652d9e0ff41 Author: Philip Yang Date: Sat Jul 31 21:28:24 2021 -0400 drm/amdkfd: AIP mGPUs best prefetch location for xnack on For xnack on, if range ACCESS or ACCESS_IN_PLACE (AIP) by single GPU, or range is ACCESS_IN_PLACE by mGPUs and all mGPUs connection on XGMI same hive, the best prefetch location is prefetch_loc GPU. Otherwise, the best prefetch location is always CPU because GPU does not have coherent mapping VRAM of other GPUs even with large-BAR PCIe connection. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f5bd523988c8c498ab18a35d729999894e4d2cf5 Author: Ryan Taylor Date: Fri Aug 6 14:19:40 2021 -0700 drm/amd/pm: graceful exit on restore fan mode failure (v2) Attempt od settings restore and disable restore flag on restore fan mode failure. v2: Update fan mode to auto and fan speed to zero (Lijo) Reviewed-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Ryan Taylor Signed-off-by: Alex Deucher commit 5d58f1a52b2e4401ad4970f439ff32ed63989ddb Author: Ryan Taylor Date: Wed Jul 28 12:14:05 2021 -0700 drm/amd/pm: restore fan_mode AMD_FAN_CTRL_NONE on resume (v2) Adds missing edge case to smu_restore_dpm_user_profile. v2: Don't restore fan mode auto (Lijo) Reviewed-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Ryan Taylor Signed-off-by: Alex Deucher commit 1d3351e631fc34d73b530a67263188062fe598ba Author: Jin Yao Date: Fri Jul 23 14:34:33 2021 +0800 perf tools: Enable on a list of CPUs for hybrid The 'perf record' and 'perf stat' commands have supported the option '-C/--cpus' to count or collect only on the list of CPUs provided. This option needs to be supported for hybrid as well. For hybrid support, it needs to check that the cpu list are available on hybrid PMU. One example for AlderLake, cpu0-7 is 'cpu_core', cpu8-11 is 'cpu_atom'. Before: # perf stat -e cpu_core/cycles/ -C11 -- sleep 1 Performance counter stats for 'CPU(s) 11': cpu_core/cycles/ 1.006179431 seconds time elapsed The 'perf stat' command silently returned "" without any helpful information. It should error out pointing out that that cpu11 was not 'cpu_core'. After: # perf stat -e cpu_core/cycles/ -C11 -- sleep 1 WARNING: 11 isn't a 'cpu_core', please use a CPU list in the 'cpu_core' range (0-7) failed to use cpu list 11 We also need to support the events without pmu prefix specified. # perf stat -e cycles -C11 -- sleep 1 WARNING: 11 isn't a 'cpu_core', please use a CPU list in the 'cpu_core' range (0-7) Performance counter stats for 'CPU(s) 11': 1,067,373 cpu_atom/cycles/ 1.005544738 seconds time elapsed The perf tool creates two cycles events automatically, cpu_core/cycles/ and cpu_atom/cycles/. It checks that cpu11 is not 'cpu_core', then shows a warning for cpu_core/cycles/ and only count the cpu_atom/cycles/. If part of cpus are 'cpu_core' and part of cpus are 'cpu_atom', for example, # perf stat -e cycles -C0,11 -- sleep 1 WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list. WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list. Performance counter stats for 'CPU(s) 0,11': 1,914,704 cpu_core/cycles/ 2,036,983 cpu_atom/cycles/ 1.005815641 seconds time elapsed It now automatically selects cpu0 for cpu_core/cycles/, selects cpu11 for cpu_atom/cycles/, and output with some warnings. Some more complex examples, # perf stat -e cycles,instructions -C0,11 -- sleep 1 WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list. WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list. WARNING: use 0 in 'cpu_core' for 'instructions', skip other cpus in list. WARNING: use 11 in 'cpu_atom' for 'instructions', skip other cpus in list. Performance counter stats for 'CPU(s) 0,11': 2,780,387 cpu_core/cycles/ 1,583,432 cpu_atom/cycles/ 3,957,277 cpu_core/instructions/ 1,167,089 cpu_atom/instructions/ 1.006005124 seconds time elapsed # perf stat -e cycles,cpu_atom/instructions/ -C0,11 -- sleep 1 WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list. WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list. WARNING: use 11 in 'cpu_atom' for 'cpu_atom/instructions/', skip other cpus in list. Performance counter stats for 'CPU(s) 0,11': 3,290,301 cpu_core/cycles/ 1,953,073 cpu_atom/cycles/ 1,407,869 cpu_atom/instructions/ 1.006260912 seconds time elapsed Signed-off-by: Jin Yao Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210723063433.7318-4-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b726e3634eb3605bd61d3a7a69dad6455b947256 Author: Jin Yao Date: Fri Jul 23 14:34:32 2021 +0800 perf tools: Create hybrid flag in target The user may count or collect only on a cpu list via '-C/--cpus' option. Previously cpus for an evsel were retrieved from PMU's sysfs. But if the target cpu list is defined, the retrieved cpus are not kept and the target cpu list is used instead. But for hybrid system, we can't directly use target cpu list. The cpu list may not be available on hybrid pmu (e.g. cpu_core or cpu_atom). So we should not set the 'has_user_cpus' flag for hybrid system. The difficulity is that we can't call perf_pmu__has_hybrid() in evlist.c to check hybrid system otherwise 'perf test python' would be failed (undefined symbol for perf_pmu__has_hybrid). If we add pmu.c to python-ext-sources, too many symbol dependencies are hard to resolve. We use an alternative method by using a new 'hybrid' flag in target for hybrid system checking. Signed-off-by: Jin Yao Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210723063433.7318-3-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2696d6e59c00b13a0b27cfc39a509577f937b44e Author: Jin Yao Date: Fri Jul 23 14:34:31 2021 +0800 libperf: Add perf_cpu_map__default_new() libperf already has a static function called 'cpu_map__default_new()'. Add a new API perf_cpu_map__default_new() to export the function. Signed-off-by: Jin Yao Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210723063433.7318-2-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ebdf90a4a1c6d7f4a8a820d1f41bc7fcad95b823 Author: Riccardo Mancini Date: Wed Aug 11 20:06:26 2021 +0200 perf test: Make --skip work on shell tests perf-test has the option --skip to provide a list of tests to skip. However, this option does not work with shell scripts. This patch passes the skiplist to run_shell_tests, so that also shell scripts could be skipped using --skip. Committer tests: Tests 79 onwards are shell tests: Before: # perf test --skip 1,2,81,82,84,88,90 1: vmlinux symtab matches kallsyms : Skip (user override) 2: Detect openat syscall event : Skip (user override) 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 78: x86 Sample parsing : Ok 79: build id cache operations : Ok 80: daemon operations : Ok 81: perf pipe recording and injection test : Ok 82: Add vfs_getname probe to get syscall args filenames : FAILED! 83: probe libc's inet_pton & backtrace it with ping : Ok 84: Use vfs_getname probe to get syscall args filenames : FAILED! 85: Zstd perf.data compression/decompression : Ok 86: perf stat csv summary test : Ok 87: perf stat metrics (shadow stat) test : Ok 88: perf stat --bpf-counters test : Ok 89: Check Arm CoreSight trace data recording and synthesized samples: Skip 90: Check open filename arg using perf trace + vfs_getname : FAILED! # After: # perf test --skip 1,2,81,82,84,88,90 1: vmlinux symtab matches kallsyms : Skip (user override) 2: Detect openat syscall event : Skip (user override) 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 78: x86 Sample parsing : Ok 79: build id cache operations : Ok 80: daemon operations : Ok 81: perf pipe recording and injection test : Skip (user override) 82: Add vfs_getname probe to get syscall args filenames : Skip (user override) 83: probe libc's inet_pton & backtrace it with ping : Ok 84: Use vfs_getname probe to get syscall args filenames : Skip (user override) 85: Zstd perf.data compression/decompression : Ok 86: perf stat csv summary test : Ok 87: perf stat metrics (shadow stat) test : Ok 88: perf stat --bpf-counters test : Skip (user override) 89: Check Arm CoreSight trace data recording and synthesized samples: Skip 90: Check open filename arg using perf trace + vfs_getname : Skip (user override) # Signed-off-by: Riccardo Mancini Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210811180625.160944-1-rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 12593568d7319c34c72038ea799ab1bd0f0eb01c Author: Quentin Perret Date: Wed Aug 11 18:36:25 2021 +0100 KVM: arm64: Return -EPERM from __pkvm_host_share_hyp() Fix the error code returned by __pkvm_host_share_hyp() when the host attempts to share with EL2 a page that has already been shared with another entity. Reported-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210811173630.2536721-1-qperret@google.com commit 7b7cec477fc3cd42ce565dfc3e53f144504fc95c Author: Masahiro Yamada Date: Thu Aug 12 01:37:31 2021 +0900 xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada Message-Id: <20210811163731.186125-4-masahiroy@kernel.org> Signed-off-by: Max Filippov commit 59210499a02a58e5b2c6da763d08adecb760d74b Author: Masahiro Yamada Date: Thu Aug 12 01:37:30 2021 +0900 xtensa: build platform directories unconditionally All of arch/xtensa/platforms/*/ have Makefile. You do not need to check the presence of Makefile. Signed-off-by: Masahiro Yamada Message-Id: <20210811163731.186125-3-masahiroy@kernel.org> Signed-off-by: Max Filippov commit c548584438d1a447900797a40571d95fb36a605f Author: Masahiro Yamada Date: Thu Aug 12 01:37:29 2021 +0900 xtensa: do not build variants directory None of arch/xtensa/variants/*/ has Makefile, so 'buildvar' is always empty. Perhaps, downstream variant code might be dropped in, but given the fact that none of upstream variants builds anything in their variant directory, I doubt this is needed. Signed-off-by: Masahiro Yamada Message-Id: <20210811163731.186125-2-masahiroy@kernel.org> Signed-off-by: Max Filippov commit ef71db4845c02fe9f898e09046857ab1a9ff4be8 Author: Masahiro Yamada Date: Thu Aug 12 01:37:28 2021 +0900 xtensa: remove unneeded exports These are not used in any of subdirectories. Signed-off-by: Masahiro Yamada Message-Id: <20210811163731.186125-1-masahiroy@kernel.org> Signed-off-by: Max Filippov commit 13066c303769b5c6bc67c0b990a4eb80058fb1b4 Author: Max Filippov Date: Tue Aug 10 16:08:06 2021 -0700 xtensa: ISS: don't use string pointer before NULL check Move strlen call inside the if block that checks string pointer for NULL. While at it also fix the following coccicheck warning: ./arch/xtensa/platforms/iss/console.c:204:10-11: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Max Filippov commit 43ba2237281a59b40ea2393da9e89ea3a68de2a5 Author: Max Filippov Date: Fri Jul 9 04:13:23 2021 -0700 xtensa: add fairness to IRQ handling Track which IRQs have been served at each level to make sure that no IRQ is served more than once while other IRQs at the same level are pending. Signed-off-by: Max Filippov commit ed5aacc81cd41efc4d561e14af408d1003f7b855 Author: Randy Dunlap Date: Wed May 26 00:03:37 2021 -0700 xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG XTENSA should only select HAVE_FUTEX_CMPXCHG when FUTEX is set/enabled. This prevents a kconfig warning. WARNING: unmet direct dependencies detected for HAVE_FUTEX_CMPXCHG Depends on [n]: FUTEX [=n] Selected by [y]: - XTENSA [=y] && !MMU [=n] Fixes: d951ba21b959 ("xtensa: nommu: select HAVE_FUTEX_CMPXCHG") Signed-off-by: Randy Dunlap Cc: Max Filippov Cc: Chris Zankel Cc: linux-xtensa@linux-xtensa.org Message-Id: <20210526070337.28130-1-rdunlap@infradead.org> Signed-off-by: Max Filippov commit 5e9cfa71af79ac210d6274a17ca693fb48df1768 Merge: 9f9c9a8de2d5e 761c6d7ec820f Author: Arnaldo Carvalho de Melo Date: Wed Aug 11 15:30:38 2021 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To get in sync with upstream to help people developing in this branch. Signed-off-by: Arnaldo Carvalho de Melo commit 61b6a6c395d6a5d15a85c7c6613d4bd6ffc547ff Author: Cai Huoqing Date: Tue Aug 10 10:08:22 2021 +0800 net/mlx5e: Make use of netdev_warn() to replace printk(KERN_WARNING ...) with netdev_warn() kindly Signed-off-by: Cai Huoqing Signed-off-by: Saeed Mahameed commit 979aa51967add26b37f9d77e01729d44a2da8e5f Author: Eran Ben Elisha Date: Tue Aug 10 21:15:05 2021 +0300 net/mlx5: Fix variable type to match 64bit Fix the following smatch warning: wait_func_handle_exec_timeout() warn: should '1 << ent->idx' be a 64 bit type? Use 1ULL, to have a 64 bit type variable. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 44f66ac981faddbd650ef601e5a7a1c6bfe0c4cc Author: Parav Pandit Date: Wed Jun 16 22:23:23 2021 +0300 net/mlx5: Initialize numa node for all core devices Subsequent patches make use of numa node affinity for memory allocations. Initialize it for PCI PF, VF and SF devices. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 48f02eef7f764f33e520ed8009d293396ca690cd Author: Parav Pandit Date: Tue Jul 13 14:17:03 2021 +0300 net/mlx5: Allocate individual capability Currently mlx5_core_dev contains array of capabilities. It contains 19 valid capabilities of the device, 2 reserved entries and 12 holes. Due to this for 14 unused entries, mlx5_core_dev allocates 14 * 8K = 112K bytes of memory which is never used. Due to this mlx5_core_dev structure size is 270Kbytes odd. This allocation further aligns to next power of 2 to 512Kbytes. By skipping non-existent entries, (a) 112Kbyte is saved, (b) mlx5_core_dev reduces to 8KB with alignment (c) 350KB saved in alignment In future individual capability allocation can be used to skip its allocation when such capability is disabled at the device level. This patch prepares mlx5_core_dev to hold capability using a pointer instead of inline array. Signed-off-by: Parav Pandit Reviewed-by: Leon Romanovsky Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 5958a6fad623ad3b67a9e4d8dbd5f1874cc7039e Author: Parav Pandit Date: Tue Jul 13 12:36:05 2021 +0300 net/mlx5: Reorganize current and maximal capabilities to be per-type In the current code, the current and maximal capabilities are maintained in separate arrays which are both per type. In order to allow the creation of such a basic structure as a dynamically allocated array, we move curr and max fields to a unified structure so that specific capabilities can be allocated as one unit. Signed-off-by: Parav Pandit Reviewed-by: Leon Romanovsky Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 4445abbd13cdc4246284a6c223a734860b4759f3 Author: Parav Pandit Date: Tue May 18 08:50:04 2021 +0300 net/mlx5: SF, use recent sysfs api Use sysfs_emit() which is aware of PAGE_SIZE buffer. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 2d0b41a3767941b53160c940cdaf596a99f50fb6 Author: Shay Drory Date: Tue Jun 22 14:20:16 2021 +0300 net/mlx5: Refcount mlx5_irq with integer Currently, all access to mlx5 IRQs are done undere a lock. Hance, there isn't a reason to have kref in struct mlx5_irq. Switch it to integer. Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 68fefb70898a8d123d1e40b2ae02bc907c460d7d Author: Shay Drory Date: Tue Jun 29 14:47:30 2021 +0300 net/mlx5: Change SF missing dedicated MSI-X err message to dbg When MSI-X vectors allocated are not enough for SFs to have dedicated, MSI-X, kernel log buffer has too many entries. Hence only enable such log with debug level. Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 211f4f99edc0d2cd909f1a37561573f7b7d9fc42 Author: Shay Drory Date: Wed Jun 16 18:58:26 2021 +0300 net/mlx5: Align mlx5_irq structure mlx5_irq structure have holes due to incorrect position of fields in it. Make them naturally align. pahole output after alignment: struct mlx5_irq { struct atomic_notifier_head nh; /* 0 72 */ /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */ cpumask_var_t mask; /* 72 8 */ char name[32]; /* 80 32 */ struct mlx5_irq_pool * pool; /* 112 8 */ struct kref kref; /* 120 4 */ u32 index; /* 124 4 */ /* --- cacheline 2 boundary (128 bytes) --- */ int irqn; /* 128 4 */ /* size: 136, cachelines: 3, members: 7 */ /* padding: 4 */ /* last cacheline: 8 bytes */ }; Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 8e792700b994a4b79abe1303eb379bbd1f4212be Author: Leon Romanovsky Date: Sun Aug 1 11:37:57 2021 +0300 net/mlx5: Delete impossible dev->state checks New mlx5_core device structure is allocated through devlink_alloc with\ kzalloc and that ensures that all fields are equal to zero and it includes ->state too. That means that checks of that field in the mlx5_init_one() is completely redundant, because that function is called only once in the begging of mlx5_core_dev lifetime. PCI: .probe() -> probe_one() -> mlx5_init_one() The recovery flow can't run at that time or before it, because relevant work initialized later in mlx5_init_once(). Such initialization flow ensures that dev->state can't be MLX5_DEVICE_STATE_UNINITIALIZED at all, so remove such impossible checks. Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 90b85d4e313caa73251f5da18786fd1909ff66bc Author: Maor Gottlieb Date: Mon Aug 9 15:12:45 2021 +0300 net/mlx5: Fix inner TTC table creation Fix typo of the cited commit that calls to mlx5_create_ttc_table, instead of mlx5_create_inner_ttc_table. Fixes: f4b45940e9b9 ("net/mlx5: Embed mlx5_ttc_table") Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 39c538d64479c949aaeca4fe73d2226f715adfb7 Author: Cai Huoqing Date: Fri Jul 30 11:03:00 2021 +0800 net/mlx5: Fix typo in comments Fix typo: *vectores ==> vectors *realeased ==> released *erros ==> errors *namepsace ==> namespace *trafic ==> traffic *proccessed ==> processed *retore ==> restore *Currenlty ==> Currently *crated ==> created *chane ==> change *cannnot ==> cannot *usuallly ==> usually *failes ==> fails *importent ==> important *reenabled ==> re-enabled *alocation ==> allocation *recived ==> received *tanslation ==> translation Signed-off-by: Cai Huoqing Signed-off-by: Saeed Mahameed commit e7cc9888dc57927f0977d346dab64a5bdfc3da59 Author: Waiman Long Date: Tue Aug 10 23:06:02 2021 -0400 cgroup/cpuset: Enable event notification when partition state changes A valid cpuset partition can become invalid if all its CPUs are offlined or somehow removed. This can happen through external events without "cpuset.cpus.partition" being touched at all. Users that rely on the property of a partition being present do not currently have a simple way to get such an event notified other than constant periodic polling which is both inefficient and cumbersome. To make life easier for those users, event notification is now enabled for "cpuset.cpus.partition" whenever its state changes. Suggested-by: Tejun Heo Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit b4cc61960879025665a46085cc9b3fa334b34cc8 Author: Randy Dunlap Date: Tue Aug 10 17:03:49 2021 -0700 cgroup: cgroup-v1: clean up kernel-doc notation Fix kernel-doc warnings found in cgroup-v1.c: kernel/cgroup/cgroup-v1.c:55: warning: No description found for return value of 'cgroup_attach_task_all' kernel/cgroup/cgroup-v1.c:94: warning: expecting prototype for cgroup_trasnsfer_tasks(). Prototype was for cgroup_transfer_tasks() instead cgroup-v1.c:96: warning: No description found for return value of 'cgroup_transfer_tasks' kernel/cgroup/cgroup-v1.c:687: warning: No description found for return value of 'cgroupstats_build' Signed-off-by: Randy Dunlap Cc: Tejun Heo Cc: Zefan Li Cc: Johannes Weiner Cc: cgroups@vger.kernel.org Signed-off-by: Tejun Heo commit cb0927ab80d224c9074f53d1a55b087d12ec5a85 Author: David Heidelberg Date: Wed Aug 11 19:06:31 2021 +0200 drm/msi/mdp4: populate priv->kms in mdp4_kms_init Without this fix boot throws NULL ptr exception at msm_dsi_manager_setup_encoder on devices like Nexus 7 2013 (MDP4 v4.4). Fixes: 03436e3ec69c ("drm/msm/dsi: Move setup_encoder to modeset_init") Cc: Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210811170631.39296-1-david@ixit.cz Signed-off-by: Rob Clark commit 111136e69c9df50c3ca7d4e3977344b8a2d0d947 Author: James Morse Date: Wed Aug 11 16:38:31 2021 +0000 x86/resctrl: Make resctrl_arch_get_config() return its value resctrl_arch_get_config() has no return, but does pass a single value back via one of its arguments. Return the value instead. Suggested-by: Borislav Petkov Signed-off-by: James Morse Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210811163831.14917-1-james.morse@arm.com commit 5c3b63cdba441c6a530b974ff73b14161d96a0c3 Author: James Morse Date: Wed Jul 28 17:06:37 2021 +0000 x86/resctrl: Merge the CDP resources resctrl uses struct rdt_resource to describe the available hardware resources. The domains of the CDP aliases share a single ctrl_val[] array. The only differences between the struct rdt_hw_resource aliases is the name and conf_type. The name from struct rdt_hw_resource is visible to user-space. To support another architecture, as many user-visible details should be handled in the filesystem parts of the code that is common to all architectures. The name and conf_type go together. Remove conf_type and the CDP aliases. When CDP is supported and enabled, schemata_list_create() can create two schemata using the single resource, generating the CODE/DATA suffix to the schema name itself. This allows the alloc_ctrlval_array() and complications around free()ing the ctrl_val arrays to be removed. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-25-james.morse@arm.com commit 327364d5b6b6f8c89d2d6253a986d80323512890 Author: James Morse Date: Wed Jul 28 17:06:36 2021 +0000 x86/resctrl: Expand resctrl_arch_update_domains()'s msr_param range resctrl_arch_update_domains() specifies the one closid that has been modified and needs copying to the hardware. resctrl_arch_update_domains() takes a struct rdt_resource and a closid as arguments, but copies all the staged configurations for that closid into the ctrl_val[] array. resctrl_arch_update_domains() is called once per schema, but once the resources and domains are merged, the second call of a L2CODE/L2DATA pair will find no staged configurations, as they were previously applied. The msr_param of the first call only has one index, so would only have update the hardware for the last staged configuration. To avoid a second round of IPIs when changing L2CODE and L2DATA in one go, expand the range of the msr_param if multiple staged configurations are found. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-24-james.morse@arm.com commit fbc06c69805976e1b5c7e6bd0b89c5b0f5282cdf Author: James Morse Date: Wed Jul 28 17:06:35 2021 +0000 x86/resctrl: Remove rdt_cdp_peer_get() When CDP is enabled, rdt_cdp_peer_get() finds the alternative CODE/DATA resource and returns the alternative domain. This is used to determine if bitmaps overlap when there are aliased entries in the two struct rdt_hw_resources. Now that the ctrl_val[] used by the CODE/DATA resources is the same, the search for an alternate resource/domain is not needed. Replace rdt_cdp_peer_get() with resctrl_peer_type(), which returns the alternative type. This can be passed to resctrl_arch_get_config() with the same resource and domain. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-23-james.morse@arm.com commit 43ac1dbf6101722944758f364ea39859d5db3ce0 Author: James Morse Date: Wed Jul 28 17:06:34 2021 +0000 x86/resctrl: Merge the ctrl_val arrays Each struct rdt_hw_resource has its own ctrl_val[] array. When CDP is enabled, two resources are in use, each with its own ctrl_val[] array that holds half of the configuration used by hardware. One uses the odd slots, the other the even. rdt_cdp_peer_get() is the helper to find the alternate resource, its domain, and corresponding entry in the other ctrl_val[] array. Once the CDP resources are merged there will be one struct rdt_hw_resource and one ctrl_val[] array for each hardware resource. This will include changes to rdt_cdp_peer_get(), making it hard to bisect any issue. Merge the ctrl_val[] arrays for three CODE/DATA/NONE resources first. Doing this before merging the resources temporarily complicates allocating and freeing the ctrl_val arrays. Add a helper to allocate the ctrl_val array, that returns the value on the L2 or L3 resource if it already exists. This gets removed once the resources are merged, and there really is only one ctrl_val[] array. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-22-james.morse@arm.com commit 2b8dd4ab65dad1251822fbf74fb0d5623e4eaee0 Author: James Morse Date: Wed Jul 28 17:06:33 2021 +0000 x86/resctrl: Calculate the index from the configuration type resctrl uses cbm_idx() to map a closid to an index in the configuration array. This is based on a multiplier and offset that are held in the resource. To merge the resources, the resctrl arch code needs to calculate the index from something else, as there will only be one resource. Decide based on the staged configuration type. This makes the static mult and offset parameters redundant. [ bp: Remove superfluous brackets in get_config_index() ] Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-21-james.morse@arm.com commit edf27485eb566abae809517520a9adbc242b8b39 Author: Dwaipayan Ray Date: Mon Aug 9 10:14:45 2021 -0700 xfs: cleanup __FUNCTION__ usage __FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__. Signed-off-by: Dwaipayan Ray Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5e68b4c7fb6414c4a48b6d2988312e3b1f31978e Author: Allison Henderson Date: Sun Aug 8 08:27:14 2021 -0700 xfs: Rename __xfs_attr_rmtval_remove Now that xfs_attr_rmtval_remove is gone, rename __xfs_attr_rmtval_remove to xfs_attr_rmtval_remove Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Darrick J. Wong commit 2e7df368fc9260ac2229335755de2f403ec8f08f Author: James Morse Date: Wed Jul 28 17:06:32 2021 +0000 x86/resctrl: Apply offset correction when config is staged When resctrl comes to copy the CAT MSR values from the ctrl_val[] array into hardware, it applies an offset adjustment based on the type of the resource. CODE and DATA resources have their closid mapped into an odd/even range. This mapping is based on a property of the resource. This happens once the new control value has been written to the ctrl_val[] array. Once the CDP resources are merged, there will only be a single property that needs to cover both odd/even mappings to the single ctrl_val[] array. The offset adjustment must be applied before the new value is written to the array. Move the logic from cat_wrmsr() to resctrl_arch_update_domains(). The value provided to apply_config() is now an index in the array, not the closid. The parameters provided via struct msr_param are now indexes too. As resctrl's use of closid is a u32, struct msr_param's type is changed to match. With this, the CODE and DATA resources only use the odd or even indexes in the array. This allows the temporary num_closid/2 fixes in domain_setup_ctrlval() and reset_all_ctrls() to be removed. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-20-james.morse@arm.com commit 141739aa73505539f315d15068b9c0707ab5ecb4 Author: James Morse Date: Wed Jul 28 17:06:31 2021 +0000 x86/resctrl: Make ctrlval arrays the same size The CODE and DATA resources report a num_closid that is half the actual size supported by the hardware. This behaviour is visible to user-space when CDP is enabled. The CODE and DATA resources have their own ctrlval arrays which are half the size of the underlying hardware because num_closid was already adjusted. One holds the odd configurations values, the other even. Before the CDP resources can be merged, the 'half the closids' behaviour needs to be implemented by schemata_list_create(), but this causes the ctrl_val[] array to be full sized. Remove the logic from the architecture specific rdt_get_cdp_config() setup, and add it to schemata_list_create(). Functions that walk all the configurations, such as domain_setup_ctrlval() and reset_all_ctrls(), take num_closid directly from struct rdt_hw_resource also have to halve num_closid as only the lower half of each array is in use. domain_setup_ctrlval() and reset_all_ctrls() both copy struct rdt_hw_resource's num_closid to a struct msr_param. Correct the value here. This is temporary as a subsequent patch will merge all three ctrl_val[] arrays such that when CDP is in use, the CODA/DATA layout in the array matches the hardware. reset_all_ctrls()'s loop over the whole of ctrl_val[] is not touched as this is harmless, and will be required as it is once the resources are merged. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-19-james.morse@arm.com commit fa8f711d2f14381d1a47420b6da94b62e6484c56 Author: James Morse Date: Wed Jul 28 17:06:30 2021 +0000 x86/resctrl: Pass configuration type to resctrl_arch_get_config() The ctrl_val[] array for a struct rdt_hw_resource only holds configurations of one type. The type is implicit. Once the CDP resources are merged, the ctrl_val[] array will hold all the configurations for the hardware resource. When a particular type of configuration is needed, it must be specified explicitly. Pass the expected type from the schema into resctrl_arch_get_config(). Nothing uses this yet, but once a single ctrl_val[] array is used for the three struct rdt_hw_resources that share hardware, the type will be used to return the correct configuration value from the shared array. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-18-james.morse@arm.com commit eb24c1007e6852e024dc33b0dd9617b8500a1291 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:10 2021 -0300 vfio: Remove struct vfio_device_ops open/release Nothing uses this anymore, delete it. Signed-off-by: Yishai Hadas Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/14-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit dd574d9b728d583e30289244be139f82d0de3fb3 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:09 2021 -0300 vfio/gvt: Fix open/close when multiple device FDs are open The user can open multiple device FDs if it likes, however the open function calls vfio_register_notifier() on device global state. Calling vfio_register_notifier() twice will trigger a WARN_ON from notifier_chain_register() and the first close will wrongly delete the notifier and more. Since these really want the new open/close_device() semantics just change the function over. Reviewed-by: Zhenyu Wang Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/13-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit 9b0d6b7e28a9bbbf4cee0727a299c2107047b1a5 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:08 2021 -0300 vfio/ap,ccw: Fix open/close when multiple device FDs are open The user can open multiple device FDs if it likes, however these open() functions call vfio_register_notifier() on some device global state. Calling vfio_register_notifier() twice in will trigger a WARN_ON from notifier_chain_register() and the first close will wrongly delete the notifier and more. Since these really want the new open/close_device() semantics just change the functions over. Reviewed-by: Cornelia Huck Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/12-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit 3cb24827147b75557bddc5b39d63897786935b14 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:07 2021 -0300 vfio/mbochs: Fix close when multiple device FDs are open mbochs_close() iterates over global device state and frees it. Currently this is done every time a device FD is closed, but if multiple device FDs are open this could corrupt other still active FDs. Change this to use close_device() so it only runs on the last close. Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/11-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit db44c17458fb54880b9a65479e464b64c365a87d Author: Jason Gunthorpe Date: Thu Aug 5 22:19:06 2021 -0300 vfio/pci: Reorganize VFIO_DEVICE_PCI_HOT_RESET to use the device set Like vfio_pci_dev_set_try_reset() this code wants to reset all of the devices in the "reset group" which is the same membership as the device set. Instead of trying to reconstruct the device set from the PCI list go directly from the device set's device list to execute the reset. The same basic structure as vfio_pci_dev_set_try_reset() is used. The 'vfio_devices' struct is replaced with the device set linked list and we simply sweep it multiple times under the lock. This eliminates a memory allocation and get/put traffic and another improperly locked test of pci_dev_driver(). Reviewed-off-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/10-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit a882c16a2b7ef6e0ab3f0d1e41345b667893cbfd Author: Jason Gunthorpe Date: Thu Aug 5 22:19:05 2021 -0300 vfio/pci: Change vfio_pci_try_bus_reset() to use the dev_set vfio_pci_try_bus_reset() is triggering a reset of the entire_dev set if any device within it has accumulated a needs_reset. This reset can only be done once all of the drivers operating the PCI devices to be reset are in a known safe state. Make this clearer by directly operating on the dev_set instead of the vfio_pci_device. Rename the function to vfio_pci_dev_set_try_reset(). Use the device list inside the dev_set to check that all drivers are in a safe state instead of working backwards from the pci_device. The dev_set->lock directly prevents devices from joining/leaving the set, or changing their state, which further implies the pci_device cannot change drivers or that the vfio_device be freed, eliminating the need for get/put's. If a pci_device to be reset is not in the dev_set then the reset cannot be used as we can't know what the state of that driver is. Directly measure this by checking that every pci_device is in the dev_set - which effectively proves that VFIO drivers are attached to everything. Remove the odd interaction around vfio_pci_set_power_state() - have the only caller avoid its redundant vfio_pci_set_power_state() instead of avoiding it inside vfio_pci_dev_set_try_reset(). This restructuring corrects a call to pci_dev_driver() without holding the device_lock() and removes a hard wiring to &vfio_pci_driver. Signed-off-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/9-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit 2cd8b14aaa667f5c6b7918e8d769872fa9acb0ac Author: Yishai Hadas Date: Thu Aug 5 22:19:04 2021 -0300 vfio/pci: Move to the device set infrastructure PCI wants to have the usual open/close_device() logic with the slight twist that the open/close_device() must be done under a singelton lock shared by all of the vfio_devices that are in the PCI "reset group". The reset group, and thus the device set, is determined by what devices pci_reset_bus() touches, which is either the entire bus or only the slot. Rely on the core code to do everything reflck was doing and delete reflck entirely. Signed-off-by: Yishai Hadas Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/8-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit ab7e5e34a9f661f5649f48d4531c4a75713ff7cf Author: Jason Gunthorpe Date: Thu Aug 5 22:19:03 2021 -0300 vfio/platform: Use open_device() instead of open coding a refcnt scheme Platform simply wants to run some code when the device is first opened/last closed. Use the core framework and locking for this. Aside from removing a bit of code this narrows the locking scope from a global lock. Reviewed-by: Cornelia Huck Reviewed-by: Eric Auger Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/7-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit da119f387e94642da959a22ae9c22e09abe34926 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:02 2021 -0300 vfio/fsl: Move to the device set infrastructure FSL uses the internal reflck to implement the open_device() functionality, conversion to the core code is straightforward. The decision on which set to be part of is trivially based on the is_fsl_mc_bus_dprc() and we use a 'struct device *' pointer as the set_id. The dev_set lock is protecting the interrupts setup. The FSL MC devices are using MSIs and only the DPRC device is allocating the MSIs from the MSI domain. The other devices just take interrupts from a pool. The lock is protecting the access to this pool. Signed-off-by: Yishai Hadas Tested-by: Diana Craciun OSS Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit 17a1e4fa3f7f07f541c751745b5aa6f2fcab9a48 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:01 2021 -0300 vfio/samples: Delete useless open/close The core code no longer requires these ops to be defined, so delete these empty functions and leave the op as NULL. mtty's functions only log a pointless message, delete that entirely. Signed-off-by: Yishai Hadas Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit 2fd585f4ed9de9b9259e95affdd7d8cde06b48c3 Author: Jason Gunthorpe Date: Thu Aug 5 22:19:00 2021 -0300 vfio: Provide better generic support for open/release vfio_device_ops Currently the driver ops have an open/release pair that is called once each time a device FD is opened or closed. Add an additional set of open/close_device() ops which are called when the device FD is opened for the first time and closed for the last time. An analysis shows that all of the drivers require this semantic. Some are open coding it as part of their reflck implementation, and some are just buggy and miss it completely. To retain the current semantics PCI and FSL depend on, introduce the idea of a "device set" which is a grouping of vfio_device's that share the same lock around opening. The device set is established by providing a 'set_id' pointer. All vfio_device's that provide the same pointer will be joined to the same singleton memory and lock across the whole set. This effectively replaces the oddly named reflck. After conversion the set_id will be sourced from: - A struct device from a fsl_mc_device (fsl) - A struct pci_slot (pci) - A struct pci_bus (pci) - The struct vfio_device (everything) The design ensures that the above pointers are live as long as the vfio_device is registered, so they form reliable unique keys to group vfio_devices into sets. This implementation uses xarray instead of searching through the driver core structures, which simplifies the somewhat tricky locking in this area. Following patches convert all the drivers. Signed-off-by: Yishai Hadas Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit ae03c3771b8cbbed3802ad1153d896c32015c520 Author: Max Gurtovoy Date: Thu Aug 5 22:18:59 2021 -0300 vfio: Introduce a vfio_uninit_group_dev() API call This pairs with vfio_init_group_dev() and allows undoing any state that is stored in the vfio_device unrelated to registration. Add appropriately placed calls to all the drivers. The following patch will use this to add pre-registration state for the device set. Signed-off-by: Max Gurtovoy Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit de5494af4815a4c9328536c72741229b7de88e7f Author: Jason Gunthorpe Date: Thu Aug 5 22:18:58 2021 -0300 vfio/mbochs: Fix missing error unwind of mbochs_used_mbytes Convert mbochs to use an atomic scheme for this like mtty was changed into. The atomic fixes various race conditions with probing. Add the missing error unwind. Also add the missing kfree of mdev_state->pages. Fixes: 681c1615f891 ("vfio/mbochs: Convert to use vfio_register_group_dev()") Reported-by: Cornelia Huck Co-developed-by: Alex Williamson Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/2-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit e1706f0764f8bea42db8d33df5d7f9e754b89693 Author: Jason Gunthorpe Date: Thu Aug 5 22:18:57 2021 -0300 vfio/samples: Remove module get/put The patch to move the get/put to core and the patch to convert the samples to use vfio_device crossed in a way that this was missed. When both patches are together the samples do not need their own get/put. Fixes: 437e41368c01 ("vfio/mdpy: Convert to use vfio_register_group_dev()") Fixes: 681c1615f891 ("vfio/mbochs: Convert to use vfio_register_group_dev()") Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Reviewed-by: Max Gurtovoy Link: https://lore.kernel.org/r/1-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson commit f07e9d0250577a23eb06d4334798291616c01f2d Author: James Morse Date: Wed Jul 28 17:06:29 2021 +0000 x86/resctrl: Add a helper to read a closid's configuration Functions like show_doms() reach into the architecture's private structure to retrieve the configuration from the struct rdt_hw_resource. The hardware configuration may look completely different to the values resctrl gets from user-space. The staged configuration and resctrl_arch_update_domains() allow the architecture to convert or translate these values. Resctrl shouldn't read or write the ctrl_val[] values directly. Add a helper to read the current configuration. This will allow another architecture to scale the bitmaps if necessary, and possibly use controls that don't take the user-space control format at all. Of the remaining functions that access ctrl_val[] directly, apply_config() is part of the architecture-specific code, and is called via resctrl_arch_update_domains(). reset_all_ctrls() will be an architecture specific helper. update_mba_bw() manipulates both ctrl_val[], mbps_val[] and the hardware. The mbps_val[] that matches the mba_sc state of the resource is changed, but the other is left unchanged. Abstracting this is the subject of later patches that affect set_mba_sc() too. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-17-james.morse@arm.com commit 5e5df9571c319fb107d7a523cc96fcc99961ee70 Author: Anshuman Khandual Date: Wed Aug 11 16:41:15 2021 +0530 KVM: arm64: Restrict IPA size to maximum 48 bits on 4K and 16K page size Even though ID_AA64MMFR0.PARANGE reports 52 bit PA size support, it cannot be enabled as guest IPA size on 4K or 16K page size configurations. Hence kvm_ipa_limit must be restricted to 48 bits. This change achieves required IPA capping. Before the commit c9b69a0cf0b4 ("KVM: arm64: Don't constrain maximum IPA size based on host configuration"), the problem here would have been just latent via PHYS_MASK_SHIFT (which earlier in turn capped kvm_ipa_limit), which remains capped at 48 bits on 4K and 16K configs. Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Fixes: c9b69a0cf0b4 ("KVM: arm64: Don't constrain maximum IPA size based on host configuration") Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628680275-16578-1-git-send-email-anshuman.khandual@arm.com commit 979a6e28dd969a2222545001f79566b4bfaf06c0 Author: Jan Kara Date: Mon May 3 11:54:24 2021 +0200 udf: Get rid of 0-length arrays in struct fileIdentDesc Get rid of 0-length arrays in struct fileIdentDesc. This requires a bit of cleaning up as the second variable length array in this structure is often used and the code abuses the fact that the first two arrays have the same type and offset in struct fileIdentDesc. Signed-off-by: Jan Kara commit b3c8c9801eb9b8e0f73246b4b14efbde1a4c570c Author: Jan Kara Date: Mon May 3 11:50:38 2021 +0200 udf: Get rid of 0-length arrays Declare variable length arrays using [] instead of the old-style declarations using arrays with 0 members. Also comment out entries in structures beyond the first variable length array (we still do keep them in comments as a reminder there are further entries in the structure behind the variable length array). Accessing such entries needs a careful offset math anyway so it is safer to not have them declared. Signed-off-by: Jan Kara commit 04e8ee504a677d07dd60f6c8aae912e4842301c8 Author: Jan Kara Date: Mon May 3 11:48:09 2021 +0200 udf: Remove unused declaration Remove declaration of struct virtualAllocationTable15. It is unused. Signed-off-by: Jan Kara commit 781d2a9a2fc7d0be53a072794dc03ef6de770f3d Author: Jan Kara Date: Mon May 3 11:39:03 2021 +0200 udf: Check LVID earlier We were checking validity of LVID entries only when getting implementation use information from LVID in udf_sb_lvidiu(). However if the LVID is suitably corrupted, it can cause problems also to code such as udf_count_free() which doesn't use udf_sb_lvidiu(). So check validity of LVID already when loading it from the disk and just disable LVID altogether when it is not valid. Reported-by: syzbot+7fbfe5fed73ebb675748@syzkaller.appspotmail.com Signed-off-by: Jan Kara commit b18f32d9874ec23f12416c08764d65a318aeb9f6 Author: Andy Shevchenko Date: Mon Jul 12 17:23:23 2021 +0300 i2c: dev: Use sysfs_emit() in "show" functions The sysfs_emit() function was introduced to make it less ambiguous which function is preferred when writing to the output buffer in a "show" callback [1]. Convert the I²C device sysfs interface from sprintf() to sysfs_emit() accordingly, as the latter is aware of the PAGE_SIZE buffer and correctly returns the number of bytes written into the buffer. No functional change intended. [1] Documentation/filesystems/sysfs.rst Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 295e0e7be753e4e329858482236088e41a118487 Author: Andy Shevchenko Date: Mon Jul 12 17:23:22 2021 +0300 i2c: dev: Define pr_fmt() and drop duplication substrings Define pr_fmt() to print module name as prefix and at the same time drop duplication substrings in the messages. While at it, convert printk() to pr_(). Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 85888376a8caf384e1365c63267d97637cfd4644 Author: Andy Shevchenko Date: Mon Jul 12 17:20:27 2021 +0300 i2c: designware: Fix indentation in the header In couple of places the indentation makes harder to read the code. Fix it to be sane. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit c045214a0f31dd5d6be716ed2f119b57b6c5d3a2 Author: Andy Shevchenko Date: Mon Jul 12 17:20:26 2021 +0300 i2c: designware: Use DIV_ROUND_CLOSEST() macro Instead of open-coding DIV_ROUND_CLOSEST() and similar use the macros directly. While at it, replace numbers with predefined SI metric prefixes. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 26471d4a6cf8d5d0bd0fb55c7169de7d67cc703a Author: Andy Shevchenko Date: Mon Jul 12 17:20:25 2021 +0300 units: Add SI metric prefix definitions Sometimes it's useful to have well-defined SI metric prefix to be used to self-describe the formulas or equations. List most popular ones in the units.h. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 2e6678195d59c51b6ca234169ad3de01134d3dec Author: James Morse Date: Wed Jul 28 17:06:28 2021 +0000 x86/resctrl: Rename update_domains() to resctrl_arch_update_domains() update_domains() merges the staged configuration changes into the arch codes configuration array. Rename to make it clear it is part of the arch code interface to resctrl. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-16-james.morse@arm.com commit b31578f627177bda5c16894e3170a7a6a1236136 Author: Anshuman Khandual Date: Tue Aug 10 09:59:42 2021 +0530 arm64/mm: Define ID_AA64MMFR0_TGRAN_2_SHIFT Streamline the Stage-2 TGRAN value extraction from ID_AA64MMFR0 register by adding a page size agnostic ID_AA64MMFR0_TGRAN_2_SHIFT. This is similar to the existing Stage-1 TGRAN shift i.e ID_AA64MMFR0_TGRAN_SHIFT. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1628569782-30213-1-git-send-email-anshuman.khandual@arm.com commit 75408e43509ed6207870c0e7e28656acbbc1f7fd Author: James Morse Date: Wed Jul 28 17:06:27 2021 +0000 x86/resctrl: Allow different CODE/DATA configurations to be staged Before the CDP resources can be merged, struct rdt_domain will need an array of struct resctrl_staged_config, one per type of configuration. Use the type as an index to the array to ensure that a schema configuration string can't specify the same domain twice. This will allow two schemata to apply configuration changes to one resource. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-15-james.morse@arm.com commit 6fadc1241c33fe0228c94bc6a1aa6c1da8872e8b Author: Anshuman Khandual Date: Wed Aug 11 08:57:06 2021 +0530 KVM: arm64: perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF ID_AA64DFR0_PMUVER_IMP_DEF which indicate implementation defined PMU, never actually gets used although there are '0xf' instances scattered all around. Just do the macro replacement to improve readability. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Cc: Marc Zyngier Cc: linux-perf-users@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Marc Zyngier commit e8f7282552b902af3bd1f07a87d657b7f5f12ab8 Author: James Morse Date: Wed Jul 28 17:06:26 2021 +0000 x86/resctrl: Group staged configuration into a separate struct When configuration changes are made, the new value is written to struct rdt_domain's new_ctrl field and the have_new_ctrl flag is set. Later new_ctrl is copied to hardware by a call to update_domains(). Once the CDP resources are merged, there will be one new_ctrl field in use by two struct resctrl_schema requiring a per-schema IPI to copy the value to hardware. Move new_ctrl and have_new_ctrl into a new struct resctrl_staged_config. Before the CDP resources can be merged, struct rdt_domain will need an array of these, one per type of configuration. Using the type as an index to the array will ensure that a schema configuration string can't specify the same domain twice. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-14-james.morse@arm.com commit e198fde3fe0892a5d1e28c0e29f1eebfb6f8c1cd Author: James Morse Date: Wed Jul 28 17:06:25 2021 +0000 x86/resctrl: Move the schemata names into struct resctrl_schema resctrl 'info' directories and schema parsing use the schema name. This lives in the struct rdt_resource, and is specified by the architecture code. Once the CDP resources are merged, there will only be one resource (and one name) in use by two schemata. To allow the CDP CODE/DATA property to be the type of configuration the schema uses, the name should also be per-schema. Add a name field to struct resctrl_schema, and use this wherever the schema name is exposed (or read from) user-space. Calculating max_name_width for padding the schemata file also moves as this is visible to user-space. As the names in struct rdt_resource already include the CDP information, schemata_list_create() copies them. schemata_list_create() includes the length of the CDP suffix when calculating max_name_width in preparation for CDP resources being merged. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-13-james.morse@arm.com commit c091e90721b836c2367fa3017636d92427f3f8f7 Author: James Morse Date: Wed Jul 28 17:06:24 2021 +0000 x86/resctrl: Add a helper to read/set the CDP configuration Whether CDP is enabled for a hardware resource like the L3 cache can be found by inspecting the alloc_enabled flags of the L3CODE/L3DATA struct rdt_hw_resources, even if they aren't in use. Once these resources are merged, the flags can't be compared. Whether CDP is enabled needs tracking explicitly. If another architecture is emulating CDP the behaviour may not be per-resource. 'cdp_capable' needs to be visible to resctrl, even if its not in use, as this affects the padding of the schemata table visible to user-space. Add cdp_enabled to struct rdt_hw_resource and cdp_capable to struct rdt_resource. Add resctrl_arch_set_cdp_enabled() to let resctrl enable or disable CDP on a resource. resctrl_arch_get_cdp_enabled() lets it read the current state. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-12-james.morse@arm.com commit a2c21668a0fe6640bd6b3069bb569e3b201ef92d Author: Wolfram Sang Date: Wed Aug 11 15:10:02 2021 +0200 i2c: at91: mark PM ops as __maybe unused The driver uses pm_ptr(), so the PM ops could be unused. Reported-by: kernel test robot Fixes: dab4b0e8c9a5 ("i2c: at91: remove #define CONFIG_PM") Signed-off-by: Wolfram Sang Reviewed-by: Codrin Ciubotariu Signed-off-by: Wolfram Sang commit 32150edd3fcf6ee002668878e0b010d402db29b2 Author: James Morse Date: Wed Jul 28 17:06:23 2021 +0000 x86/resctrl: Swizzle rdt_resource and resctrl_schema in pseudo_lock_region struct pseudo_lock_region points to the rdt_resource. Once the resources are merged, this won't be unique. The resource name is moving into the schema, so that the filesystem portions of resctrl can generate it. Swap pseudo_lock_region's rdt_resource pointer for a schema pointer. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-11-james.morse@arm.com commit 83326a73a1f2933295d30667ab4996b1b1099708 Author: Paul Cercueil Date: Sun Aug 8 15:45:21 2021 +0200 drm/ingenic: Use standard drm_atomic_helper_commit_tail By making the CRTC's .vblank_enable() function return an error when it is known that the hardware won't deliver a VBLANK, we can drop the ingenic_drm_atomic_helper_commit_tail() function and use the standard drm_atomic_helper_commit_tail() function instead. Signed-off-by: Paul Cercueil Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210808134526.119198-4-paul@crapouillou.net commit 4d3b3c93bcc153d32ffa1c3df8b9d71586283ceb Author: Paul Cercueil Date: Sun Aug 8 15:45:19 2021 +0200 drm/ingenic: Remove dead code The priv->ipu_plane would get a different value further down the code, without the first assigned value being read first; so the first assignation can be dropped. Signed-off-by: Paul Cercueil Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210808134526.119198-2-paul@crapouillou.net commit 88be3263490514854a1445ae95560585601ff160 Merge: 1a8e628c8a3e3 a72808b65834e Author: David S. Miller Date: Wed Aug 11 14:44:59 2021 +0100 Merge branch 'dsa-tagger-helpers' Vladimir Oltean says: ==================== DSA tagger helpers The goal of this series is to minimize the use of memmove and skb->data in the DSA tagging protocol drivers. Unfiltered access to this level of information is not very friendly to drive-by contributors, and sometimes is also not the easiest to review. For starters, I have converted the most common form of DSA tagging protocols: the DSA headers which are placed where the EtherType is. The helper functions introduced by this series are: - dsa_alloc_etype_header - dsa_strip_etype_header - dsa_etype_header_pos_rx - dsa_etype_header_pos_tx This series is just a resend as non-RFC of v1. ==================== Signed-off-by: David S. Miller commit a72808b65834e99534f6c5c7134c201c72fe92aa Author: Vladimir Oltean Date: Tue Aug 10 16:13:56 2021 +0300 net: dsa: create a helper for locating EtherType DSA headers on TX Create a similar helper for locating the offset to the DSA header relative to skb->data, and make the existing EtherType header taggers to use it. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5d928ff4865641309e39e9ec8eec1022f8a0c0ac Author: Vladimir Oltean Date: Tue Aug 10 16:13:55 2021 +0300 net: dsa: create a helper for locating EtherType DSA headers on RX It seems that protocol tagging driver writers are always surprised about the formula they use to reach their EtherType header on RX, which becomes apparent from the fact that there are comments in multiple drivers that mention the same information. Create a helper that returns a void pointer to skb->data - 2, as well as centralize the explanation why that is the case. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6bef794da6d3bd347c18e93ad33483bd8903d9fd Author: Vladimir Oltean Date: Tue Aug 10 16:13:54 2021 +0300 net: dsa: create a helper which allocates space for EtherType DSA headers Hide away the memmove used by DSA EtherType header taggers to shift the MAC SA and DA to the left to make room for the header, after they've called skb_push(). The call to skb_push() is still left explicit in drivers, to be symmetric with dsa_strip_etype_header, and because not all callers can be refactored to do it (for example, brcm_tag_xmit_ll has common code for a pre-Ethernet DSA tag and an EtherType DSA tag). Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f1dacd7aea34333620bd5177a8808a3296a63184 Author: Vladimir Oltean Date: Tue Aug 10 16:13:53 2021 +0300 net: dsa: create a helper that strips EtherType DSA headers on RX All header taggers open-code a memmove that is fairly not all that obvious, and we can hide the details behind a helper function, since the only thing specific to the driver is the length of the header tag. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 1c290682c0c9c47aa7594ffc83b9cedd20c1ec87 Author: James Morse Date: Wed Jul 28 17:06:22 2021 +0000 x86/resctrl: Pass the schema to resctrl filesystem functions Once the CDP resources are merged, there will be two struct resctrl_schema for one struct rdt_resource. CDP becomes a type of configuration that belongs to the schema. Helpers like rdtgroup_cbm_overlaps() need access to the schema to query the configuration (or configurations) based on schema properties. Change these functions to take a struct schema instead of the struct rdt_resource. All the modified functions are part of the filesystem code that will move to /fs/resctrl once it is possible to support a second architecture. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-10-james.morse@arm.com commit eb6f3187694158ca36e50083e861531488d5c1b1 Author: James Morse Date: Wed Jul 28 17:06:21 2021 +0000 x86/resctrl: Add resctrl_arch_get_num_closid() To initialise struct resctrl_schema's num_closid, schemata_list_create() reaches into the architectures private structure to retrieve num_closid from the struct rdt_hw_resource. The 'half the closids' behaviour should be part of the filesystem parts of resctrl that are the same on any architecture. struct resctrl_schema's num_closid should include any correction for CDP. Having two properties called num_closid is likely to be confusing when they have different values. Add a helper to read the resource's num_closid from the arch code. This should return the number of closid that the resource supports, regardless of whether CDP is in use. Once the CDP resources are merged, schemata_list_create() can apply the correction itself. Using a type with an obvious size for the arch helper means changing the type of num_closid to u32, which matches the type already used by struct rdtgroup. reset_all_ctrls() does not use resctrl_arch_get_num_closid(), even though it sets up a structure for modifying the hardware. This function will be part of the architecture code, the maximum closid should be the maximum value the hardware has, regardless of the way resctrl is using it. All the uses of num_closid in core.c are naturally part of the architecture specific code. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-9-james.morse@arm.com commit 1a8e628c8a3e38af1392197adf086de7ce51d24f Merge: e9c130ad665c6 70862a5d609d7 Author: David S. Miller Date: Wed Aug 11 14:34:22 2021 +0100 Merge branch 'devlink-aux-devices' Parav Pandit says: ==================== devlink: Control auxiliary devices Currently, for mlx5 multi-function device, a user is not able to control which functionality to enable/disable. For example, each PCI PF, VF, SF function by default has netdevice, RDMA and vdpa-net devices always enabled. Hence, enable user to control which device functionality to enable/disable. This is achieved by using existing devlink params [1] to enable/disable eth, rdma and vdpa net functionality control knob. For example user interested in only vdpa device function: performs, $ devlink dev param set pci/0000:06:00.0 name enable_rdma value false \ cmode driverinit $ devlink dev param set pci/0000:06:00.0 name enable_eth value false \ cmode driverinit $ devlink dev param set pci/0000:06:00.0 name enable_vnet value true \ cmode driverinit $ devlink dev reload pci/0000:06:00.0 Reload command honors parameters set, initializes the device that user has composed using devlink dev params and resources. Devices before reload: mlx5_core.sf.4 (subfunction device) /\ /| \ / | \ / | \ mlx5_core.eth.4 | mlx5_core.rdma.4 (SF eth aux dev) | (SF rdma aux dev) | | | | | | enp6s0f0s88 | mlx5_0 (SF netdev) | (SF rdma device) | mlx5_core.vnet.4 (SF vnet aux dev) | | auxiliary/mlx5_core.sf.4 (vdpa net mgmt device) Above example reconfigures the device with only VDPA functionality. Devices after reload: mlx5_core.sf.4 (subfunction device) /\ / \ / \ / \ mlx5_core.vnet.4 no eth, no rdma aux devices (SF vnet aux dev) Above parameters enable user to compose the device as needed based on the use case. Since devlink params are done on the devlink instance, these knobs are uniformly usable for PCI PF, VF and SF devices. ==================== Signed-off-by: David S. Miller commit 70862a5d609d7dc8f0501983391f1df9eca6714f Author: Parav Pandit Date: Tue Aug 10 16:24:24 2021 +0300 net/mlx5: Support enable_vnet devlink dev param Enable user to disable VDPA net auxiliary device so that when it is not required, user can disable it. For example, $ devlink dev param set pci/0000:06:00.0 \ name enable_vnet value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create auxiliary device mlx5_core.vnet.2 for the VDPA net functionality. Signed-off-by: Parav Pandit Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 87158cedf00ef225ae111dba96973b172086420e Author: Parav Pandit Date: Tue Aug 10 16:24:23 2021 +0300 net/mlx5: Support enable_rdma devlink dev param Enable user to disable RDMA auxiliary device so that when it is not required, user can disable it. For example, $ devlink dev param set pci/0000:06:00.0 \ name enable_rdma value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create auxiliary device mlx5_core.rdma.2 for the RDMA functionality. Signed-off-by: Parav Pandit Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit a17beb28ed9dfd69e00ecd13cbd945fba8af4550 Author: Parav Pandit Date: Tue Aug 10 16:24:22 2021 +0300 net/mlx5: Support enable_eth devlink dev param Enable user to disable Ethernet auxiliary device so that when it is not required, user can disable it. For example, $ devlink dev param set pci/0000:06:00.0 \ name enable_eth value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create mlx5_core.eth.2 auxiliary device for the Ethernet functionality. Signed-off-by: Parav Pandit Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 6f35723864b42ec9e9bb95a503449633395c4975 Author: Parav Pandit Date: Tue Aug 10 16:24:21 2021 +0300 net/mlx5: Fix unpublish devlink parameters Cleanup routine missed to unpublish the parameters. Add it. Fixes: e890acd5ff18 ("net/mlx5: Add devlink flow_steering_mode parameter") Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 9c4a7665b4237621879caf115a78f69bad67b9c7 Author: Parav Pandit Date: Tue Aug 10 16:24:20 2021 +0300 devlink: Add APIs to publish, unpublish individual parameter Enable drivers to publish/unpublish individual parameter. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit b40c51efefbc4a3ddec682f118adefea1ccf70dc Author: Parav Pandit Date: Tue Aug 10 16:24:19 2021 +0300 devlink: Add API to register and unregister single parameter Currently device configuration parameters can be registered as an array. Due to this a constant array must be registered. A single driver supporting multiple devices each with different device capabilities end up registering all parameters even if it doesn't support it. One possible workaround a driver can do is, it registers multiple single entry arrays to overcome such limitation. Better is to provide a API that enables driver to register/unregister a single parameter. This also further helps in two ways. (1) to reduce the memory of devlink_param_entry by avoiding in registering parameters which are not supported by the device. (2) avoid generating multiple parameter add, delete, publish, unpublish, init value notifications for such unsupported parameters Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 699784f7b72861206e49679f485befbc48b05e53 Author: Parav Pandit Date: Tue Aug 10 16:24:18 2021 +0300 devlink: Create a helper function for one parameter registration Create and use a helper function for one parameter registration. Subsequent patch also will reuse this for driver facing routine to register a single parameter. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 076b2a9dbb28e8b3d9a264a8bca664794255d448 Author: Parav Pandit Date: Tue Aug 10 16:24:17 2021 +0300 devlink: Add new "enable_vnet" generic device param Add new device generic parameter to enable/disable creation of VDPA net auxiliary device and associated device functionality in the devlink instance. User who prefers to disable such functionality can disable it using below example. $ devlink dev param set pci/0000:06:00.0 \ name enable_vnet value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create auxiliary device for the VDPA net functionality. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 8ddaabee3c7994854841a9b097fd94538126c12c Author: Parav Pandit Date: Tue Aug 10 16:24:16 2021 +0300 devlink: Add new "enable_rdma" generic device param Add new device generic parameter to enable/disable creation of RDMA auxiliary device and associated device functionality in the devlink instance. User who prefers to disable such functionality can disable it using below example. $ devlink dev param set pci/0000:06:00.0 \ name enable_rdma value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create auxiliary device for the RDMA functionality. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit f13a5ad88186c142b4f6060fb06f0f8fb1674915 Author: Parav Pandit Date: Tue Aug 10 16:24:15 2021 +0300 devlink: Add new "enable_eth" generic device param Add new device generic parameter to enable/disable creation of Ethernet auxiliary device and associated device functionality in the devlink instance. User who prefers to disable such functionality can disable it using below example. $ devlink dev param set pci/0000:06:00.0 \ name enable_eth value false cmode driverinit $ devlink dev reload pci/0000:06:00.0 At this point devlink instance do not create auxiliary device for the Ethernet functionality. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit ad19607a90b29eef044660aba92a2a2d63b1e977 Author: Christian Brauner Date: Tue Jul 27 12:44:16 2021 +0200 doc: give a more thorough id handling explanation Currently there's no document explaining how idmappings work at all. Add a document that gives an introduction and also goes into a bit more detail for more advanced use-cases. Link: https://lore.kernel.org/r/20210727104416.828293-1-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Aleksa Sarai Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner commit 3183e87c1b797caaeb208b01c99bea8140273a16 Author: James Morse Date: Wed Jul 28 17:06:20 2021 +0000 x86/resctrl: Store the effective num_closid in the schema Struct resctrl_schema holds properties that vary with the style of configuration that resctrl applies to a resource. There are already two values for the hardware's num_closid, depending on whether the architecture presents the L3 or L3CODE/L3DATA resources. As the way CDP changes the number of control groups that resctrl can create is part of the user-space interface, it should be managed by the filesystem parts of resctrl. This allows the architecture code to only describe the value the hardware supports. Add num_closid to resctrl_schema. This is the value seen by the filesystem, which may be different to the maximum value described by the arch code when CDP is enabled. These functions operate on the num_closid value that is exposed to user-space: * rdtgroup_parse_resource() * rdtgroup_schemata_show() * rdt_num_closids_show() * closid_init() Change them to use the schema value instead. schemata_list_create() sets this value, and reaches into the architecture-specific structure to get the value. This will eventually be replaced with a helper. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-8-james.morse@arm.com commit e5a7cb0d9002e3c963df2fa504f536f878a76888 Author: Wolfram Sang Date: Wed Jun 23 11:59:40 2021 +0200 i2c: sh_mobile: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 0425b937a79fb03fa73e39b1bd32b012a146998d Author: Wolfram Sang Date: Wed Jun 23 11:59:38 2021 +0200 i2c: qup: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 101703ca8e37cddf80db2c17a1ca043a65826e17 Author: Wolfram Sang Date: Wed Jun 23 11:59:37 2021 +0200 i2c: mxs: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 73a370cff4db1ad2c19340c38c7ee9a67bfc340d Author: Wolfram Sang Date: Wed Jun 23 11:59:36 2021 +0200 i2c: imx: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Reviewed-by: Oleksij Rempel Signed-off-by: Wolfram Sang commit ffd4e739358be036377563a0c6c33702c700e3ee Author: Lakshmi Sowjanya D Date: Fri Aug 6 19:55:27 2021 +0530 pinctrl: Add Intel Keem Bay pinctrl driver About Intel Keem Bay: ------------------- Intel Keem Bay is a computer vision AI accelerator SoC based on ARM CPU. Documentation of Keem Bay: Documentation/vpu/vpu-stack-overview.rst. Pinctrl IP: ---------- The SoC has a customised pinmux controller IP which controls pin multiplexing and configuration. Keem Bay pinctrl IP is not based on and have nothing in common with the existing pinctrl drivers. The registers used are incompatible with the existing drivers, so it requires a new driver. Add pinctrl driver to enable pin control support in the Intel Keem Bay SoC. Co-developed-by: Vineetha G. Jaya Kumaran Signed-off-by: Vineetha G. Jaya Kumaran Co-developed-by: Vijayakannan Ayyathurai Signed-off-by: Vijayakannan Ayyathurai Signed-off-by: Lakshmi Sowjanya D Reviewed-by: Mark Gross Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210806142527.29113-3-lakshmi.sowjanya.d@intel.com Signed-off-by: Linus Walleij commit d2083893e4ade786498ba7f5f6ab77913c67ab83 Author: Lakshmi Sowjanya D Date: Fri Aug 6 19:55:26 2021 +0530 dt-bindings: pinctrl: Add bindings for Intel Keembay pinctrl driver Add Device Tree bindings documentation for Intel Keem Bay SoC's pin controller. Add entry for INTEL Keem Bay pinctrl driver in MAINTAINERS file Co-developed-by: Vineetha G. Jaya Kumaran Signed-off-by: Vineetha G. Jaya Kumaran Co-developed-by: Vijayakannan Ayyathurai Signed-off-by: Vijayakannan Ayyathurai Signed-off-by: Lakshmi Sowjanya D Acked-by: Mark Gross Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210806142527.29113-2-lakshmi.sowjanya.d@intel.com Signed-off-by: Linus Walleij commit 73c76332a448e522fbcea3b52fee442f531f7b49 Author: Wolfram Sang Date: Wed Jun 23 11:59:35 2021 +0200 i2c: at91-master: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Reviewed-by: Codrin Ciubotariu Signed-off-by: Wolfram Sang commit 3fb5c90452e41d3536106789a532edfa7e7a032f Author: Yang Yingliang Date: Thu Jul 29 15:19:05 2021 +0800 pinctrl: zynqmp: Drop pinctrl_unregister for devm_ registered device It's not necessary to unregister pin controller device registered with devm_pinctrl_register() and using pinctrl_unregister() leads to a double free. Fixes: fa99e7013827 ("pinctrl: zynqmp: some code cleanups") Signed-off-by: Yang Yingliang Reviewed-by: Michal Simek Link: https://lore.kernel.org/r/20210729071905.3235953-1-yangyingliang@huawei.com Signed-off-by: Linus Walleij commit 5111c2b6b0194b509f47e6338c4deeeb4497bda8 Author: Andy Shevchenko Date: Wed Aug 4 19:00:19 2021 +0300 gpio: dwapb: Get rid of legacy platform data Platform data is a legacy interface to supply device properties to the driver. In this case we don't have anymore in-kernel users for it. Just remove it for good. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin Tested-by: Serge Semin commit 36edadf5d336df62288658fcbdbb0fbf14554611 Author: Andy Shevchenko Date: Wed Aug 4 19:00:18 2021 +0300 mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes The driver can provide a software node group instead of passing legacy platform data. This will allow to drop the legacy platform data structures along with unifying a child device driver to use same interface for all property providers, i.e. Device Tree, ACPI, and board files. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-for-MFD-by: Lee Jones Reviewed-by: Linus Walleij commit f973be8ad5dfa2ceac19657444ba57abc205218c Author: Andy Shevchenko Date: Wed Aug 4 19:00:17 2021 +0300 gpio: dwapb: Read GPIO base from gpio-base property For backward compatibility with some legacy devices introduce a new (*) property gpio-base to read GPIO base. This will allow further cleaning up of the driver. *) Note, it's not new for the GPIO library since the mockup driver is using it already. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-by: Serge Semin Reviewed-by: Linus Walleij commit c1b291e96a6d27ac83938596829086945ff8a36e Author: Andy Shevchenko Date: Wed Aug 4 19:00:16 2021 +0300 gpio: dwapb: Unify ACPI enumeration checks in get_irq() and configure_irqs() Shared IRQ is only enabled for ACPI enumeration, there is no need to have a special flag for that, since we simple can test if device has been enumerated by ACPI. This unifies the checks in dwapb_get_irq() and dwapb_configure_irqs(). Signed-off-by: Andy Shevchenko Acked-by: Lee Jones Acked-by: Serge Semin Tested-by: Serge Semin commit b390752191a6e09e8fb89625e227db0d5cc0ca33 Author: Andy Shevchenko Date: Tue Aug 3 20:39:25 2021 +0300 gpiolib: Deduplicate forward declaration in the consumer.h header struct acpi_device is repeated in two branches of ifdeffery. Move it out and hence deduplicate. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 49b3bd213a9f3d685784913c255c6a2cb3d1fcce Author: Randy Dunlap Date: Tue Aug 10 15:50:51 2021 -0700 smp: Fix all kernel-doc warnings Fix the following warnings: kernel/smp.c:1189: warning: cannot understand function prototype: 'struct smp_call_on_cpu_struct ' kernel/smp.c:788: warning: No description found for return value of 'smp_call_function_single_async' kernel/smp.c:990: warning: Function parameter or member 'wait' not described in 'smp_call_function_many' kernel/smp.c:990: warning: Excess function parameter 'flags' description in 'smp_call_function_many' kernel/smp.c:1198: warning: Function parameter or member 'work' not described in 'smp_call_on_cpu_struct' kernel/smp.c:1198: warning: Function parameter or member 'done' not described in 'smp_call_on_cpu_struct' kernel/smp.c:1198: warning: Function parameter or member 'func' not described in 'smp_call_on_cpu_struct' kernel/smp.c:1198: warning: Function parameter or member 'data' not described in 'smp_call_on_cpu_struct' kernel/smp.c:1198: warning: Function parameter or member 'ret' not described in 'smp_call_on_cpu_struct' kernel/smp.c:1198: warning: Function parameter or member 'cpu' not described in 'smp_call_on_cpu_struct' Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210810225051.3938-1-rdunlap@infradead.org commit 9f9c9a8de2d5e96c045deaf769006ef7b7b7fb1b Author: Adrian Hunter Date: Wed Aug 11 13:10:36 2021 +0300 perf tests: Add dlfilter test Add a perf test to test the dlfilter C API. A perf.data file is synthesized and then processed by perf script with a dlfilter named dlfilter-test-api-v0.so. Also a C file is compiled to provide a dso to match the synthesized perf.data file. Committer testing: [root@five ~]# perf test dlfilter 72: dlfilter C API : Ok [root@five ~]# perf test -v dlfilter 72: dlfilter C API : --- start --- test child forked, pid 3387712 Checking for gcc Command: gcc --version gcc (GCC) 11.1.1 20210531 (Red Hat 11.1.1-3) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dlfilters path: /var/home/acme/libexec/perf-core/dlfilters Command: gcc -g -o /tmp/dlfilter-test-3387712-prog /tmp/dlfilter-test-3387712-prog.c Creating new host machine structure Command: /var/home/acme/bin/perf script -i /tmp/dlfilter-test-3387712-perf-data --dlfilter /var/home/acme/libexec/perf-core/dlfilters/dlfilter-test-api-v0.so --dlarg first --dlarg 1 --dlarg 4198669 --dlarg 4198662 --dlarg 0 --dlarg last start API filter_event_early API filter_event API stop API Command: /var/home/acme/bin/perf script -i /tmp/dlfilter-test-3387712-perf-data --dlfilter /var/home/acme/libexec/perf-core/dlfilters/dlfilter-test-api-v0.so --dlarg first --dlarg 1 --dlarg 4198669 --dlarg 4198662 --dlarg 1 --dlarg last start API filter_event_early API filter_event API stop API Command: /var/home/acme/bin/perf script -i /tmp/dlfilter-test-3387712-perf-data --dlfilter /var/home/acme/libexec/perf-core/dlfilters/dlfilter-test-api-v0.so --dlarg first --dlarg 1 --dlarg 4198669 --dlarg 4198662 --dlarg 2 --dlarg last start API filter_event_early API stop API test child finished with 0 ---- end ---- dlfilter C API: Ok [root@five ~]# Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: https //lore.kernel.org/r/20210811101036.17986-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3af1dfdd51e0669721510dadd6c1d3ebe78e5868 Author: Adrian Hunter Date: Wed Aug 11 13:10:35 2021 +0300 perf build: Move perf_dlfilters.h in the source tree Move perf_dlfilters.h in the source tree so that it will be found when building dlfilters as part of the perf build. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https //lore.kernel.org/r/20210811101036.17986-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e9c130ad665c60dc965feb4d84580a01c7abb9e4 Merge: 6899192f648d4 dc002875c22b5 Author: David S. Miller Date: Wed Aug 11 13:34:41 2021 +0100 Merge branch 'bridge-global-mcast' Nikolay Aleksandrov says: ==================== net: bridge: vlan: add global mcast options This is the first follow-up set after the support for per-vlan multicast contexts which extends global vlan options to support bridge's multicast config per-vlan, it enables user-space to change and dump the already existing bridge vlan multicast context options. The global option patches (01 - 09 and 12-13) follow a similar pattern of changing current mcast functions to take multicast context instead of a port/bridge directly. Option equality checks have been added for dumping vlan range compression. The last 2 patches extend the mcast router dump support so it can be re-used when dumping vlan config. patches 01 - 09: add support for various mcast options patches 10 - 11: prepare for per-vlan querier control patches 12 - 13: add support for querier control and router control patches 14 - 15: add support for dumping per-vlan router ports Next patch-sets: - per-port/vlan router option config - iproute2 support for all new vlan options - selftests ==================== Signed-off-by: David S. Miller commit dc002875c22b56c795ec24dc987ac2dd2081588e Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:33 2021 +0300 net: bridge: vlan: use br_rports_fill_info() to export mcast router ports Embed the standard multicast router port export by br_rports_fill_info() into a new global vlan attribute BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS. In order to have the same format for the global bridge mcast context and the per-vlan mcast context we need a double-nesting: - BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS - MDBA_ROUTER Currently we don't compare router lists, if any router port exists in the bridge mcast contexts we consider their option sets as different and export them separately. In addition we export the router port vlan id when dumping similar to the router port notification format. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit e04d377ff6ce915d2d95ba13e7aff3ca64d50781 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:32 2021 +0300 net: bridge: mcast: use the proper multicast context when dumping router ports When we are dumping the router ports of a vlan mcast context we need to use the bridge/vlan and port/vlan's multicast contexts to check if IPv4/IPv6 router port is present and later to dump the vlan id. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit a97df080b6a86c105f98052ca3a9d66149b461b3 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:31 2021 +0300 net: bridge: vlan: add support for mcast router global option Add support to change and retrieve global vlan multicast router state which is used for the bridge itself. We just need to pass multicast context to br_multicast_set_router instead of bridge device and the rest of the logic remains the same. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 62938182c35906c0ed4beb7845b93b8ffb937597 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:30 2021 +0300 net: bridge: vlan: add support for mcast querier global option Add support to change and retrieve global vlan multicast querier state. We just need to pass multicast context to br_multicast_set_querier instead of bridge device and the rest of the logic remains the same. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit cb486ce99576741a84c75623daeffb2f7758cbf9 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:29 2021 +0300 net: bridge: mcast: querier and query state affect only current context type It is a minor optimization and better behaviour to make sure querier and query sending routines affect only the matching multicast context depending if vlan snooping is enabled (vlan ctx vs bridge ctx). It also avoids sending unnecessary extra query packets. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 4d5b4e84c72451face4d7817697684196cbee50d Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:28 2021 +0300 net: bridge: mcast: move querier state to the multicast context We need to have the querier state per multicast context in order to have per-vlan control, so remove the internal option bit and move it to the multicast context. Also annotate the lockless reads of the new variable. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 941121ee22a69935252473f03976f1f1200b9ae9 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:27 2021 +0300 net: bridge: vlan: add support for mcast startup query interval global option Add support to change and retrieve global vlan multicast startup query interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 425214508b1bd3596edb31da8d9aedee30f2b4f5 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:26 2021 +0300 net: bridge: vlan: add support for mcast query response interval global option Add support to change and retrieve global vlan multicast query response interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit d6c08aba4f29f606769939eb6156efceb7dbb790 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:25 2021 +0300 net: bridge: vlan: add support for mcast query interval global option Add support to change and retrieve global vlan multicast query interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit cd9269d463107bc4a53a0965d90a57efeee9ae11 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:24 2021 +0300 net: bridge: vlan: add support for mcast querier interval global option Add support to change and retrieve global vlan multicast querier interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 2da0aea21f1c40d003af6680551eaa5471103164 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:23 2021 +0300 net: bridge: vlan: add support for mcast membership interval global option Add support to change and retrieve global vlan multicast membership interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 77f6ababa299112092a264cac96bedf1a87015ef Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:22 2021 +0300 net: bridge: vlan: add support for mcast last member interval global option Add support to change and retrieve global vlan multicast last member interval option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 50725f6e6b217e7661ca696b7cc1f1b9aa7bda84 Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:21 2021 +0300 net: bridge: vlan: add support for mcast startup query count global option Add support to change and retrieve global vlan multicast startup query count option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 931ba87d2017f3869d656f3c705883549bfeb97f Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:20 2021 +0300 net: bridge: vlan: add support for mcast last member count global option Add support to change and retrieve global vlan multicast last member count option. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit df271cd641f101decaa4f7c1dd5c62939900bd4c Author: Nikolay Aleksandrov Date: Tue Aug 10 18:29:19 2021 +0300 net: bridge: vlan: add support for mcast igmp/mld version global options Add support to change and retrieve global vlan IGMP/MLD versions. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit b29edf35ef7022a6f72695106a6e91f67d00c9e9 Author: Adrian Hunter Date: Wed Aug 11 13:10:34 2021 +0300 perf dlfilter: Amend documentation wrt library dependencies Like all locally-built programs, dlfilters may need to be re-built if shared libraries they use change. Also there may be unexpected results if the dfilter uses different versions of the shared libraries that perf uses. Note those things in the documentation. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https //lore.kernel.org/r/20210811101036.17986-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e8e226307c19bbab679678b44645e542afa7db8 Author: Adrian Hunter Date: Wed Aug 11 13:10:33 2021 +0300 perf script: Fix --list-dlfilters documentation The option --list-dlfilters does use a string value. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Fixes: 638e2b9984ee1b ("perf script Add option to list dlfilters") Link: https //lore.kernel.org/r/20210811101036.17986-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 29159727aa7ed3341dc560e9983e7284f4279ade Author: Adrian Hunter Date: Wed Aug 11 13:10:32 2021 +0300 perf script: Fix unnecessary machine_resolve() machine_resolve() may have already been called. Test for that to avoid calling it again unnecessarily. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https //lore.kernel.org/r/20210811101036.17986-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3b35e7e6daef5a8b4819e2bd2d15898b9b4d1669 Author: Randy Dunlap Date: Tue Aug 10 16:48:35 2021 -0700 genirq: Fix kernel-doc warnings in pm.c, msi.c and ipi.c Fix all kernel-doc warnings in these 3 files and do some simple editing (capitalize acronyms, capitalize Linux). kernel/irq/pm.c:235: warning: expecting prototype for irq_pm_syscore_ops(). Prototype was for irq_pm_syscore_resume() instead kernel/irq/msi.c:530: warning: expecting prototype for __msi_domain_free_irqs(). Prototype was for msi_domain_free_irqs() instead kernel/irq/msi.c:31: warning: No description found for return value of 'alloc_msi_entry' kernel/irq/msi.c:103: warning: No description found for return value of 'msi_domain_set_affinity' kernel/irq/msi.c:288: warning: No description found for return value of 'msi_create_irq_domain' kernel/irq/msi.c:499: warning: No description found for return value of 'msi_domain_alloc_irqs' kernel/irq/msi.c:545: warning: No description found for return value of 'msi_get_domain_info' kernel/irq/ipi.c:264: warning: expecting prototype for ipi_send_mask(). Prototype was for __ipi_send_mask() instead kernel/irq/ipi.c:25: warning: No description found for return value of 'irq_reserve_ipi' kernel/irq/ipi.c:116: warning: No description found for return value of 'irq_destroy_ipi' kernel/irq/ipi.c:163: warning: No description found for return value of 'ipi_get_hwirq' kernel/irq/ipi.c:222: warning: No description found for return value of '__ipi_send_single' kernel/irq/ipi.c:308: warning: No description found for return value of 'ipi_send_single' kernel/irq/ipi.c:329: warning: No description found for return value of 'ipi_send_mask' Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210810234835.12547-1-rdunlap@infradead.org commit 290fdc4b7ef14e33d0e30058042b0e9bfd02b89b Author: Zhen Lei Date: Wed Aug 11 17:33:32 2021 +0800 genirq/timings: Fix error return code in irq_timings_test_irqs() Return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: f52da98d900e ("genirq/timings: Add selftest for irqs circular buffer") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210811093333.2376-1-thunder.leizhen@huawei.com commit 988db17932a78d201e826af3df7e89494ee0c037 Author: Adrian Hunter Date: Wed Aug 11 13:10:31 2021 +0300 perf script: Fix documented const'ness of perf_dlfilter_fns perf_dlfilter_fns must not be const, because it is not. Declaring it const can result in it being mapped read-only, causing a segfaullt when it is written. Update documentation accordingly. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Fixes: 8defa7147d5572 ("perf script Add API for filtering via dynamically loaded shared object") Link: https //lore.kernel.org/r/20210811101036.17986-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6899192f648d4a974efc1a1e081a84d310bfe3d5 Merge: 6f45933dfed0c 0d08026ac6099 Author: David S. Miller Date: Wed Aug 11 13:31:56 2021 +0100 Merge branch 'ipa-runtime-pm' Alex Elder says: ==================== net: ipa: use runtime PM reference counting This series does further rework of the IPA clock code so that we rely on some of the core runtime power management code (including its referencing counting) instead. The first patch makes ipa_clock_get() act like pm_runtime_get_sync(). The second patch makes system suspend occur regardless of the current reference count value, which is again more like how the runtime PM core code behaves. The third patch creates functions to encapsulate all hardware suspend and resume activity. The fourth uses those functions as the ->runtime_suspend and ->runtime_resume power callbacks. With that in place, ipa_clock_get() and ipa_clock_put() are changed to use runtime PM get and put functions when needed. The fifth patch eliminates an extra clock reference previously used to control system suspend. The sixth eliminates the "IPA clock" reference count and mutex. The final patch replaces the one call to ipa_clock_get_additional() with a call to pm_runtime_get_if_active(), making the former unnecessary. ==================== Signed-off-by: David S. Miller commit 0d08026ac6099ef8bd73412005830ce7280b7c80 Author: Alex Elder Date: Tue Aug 10 14:27:04 2021 -0500 net: ipa: kill ipa_clock_get_additional() Now that ipa_clock_get_additional() is a trivial wrapper around pm_runtime_get_if_active(), just open-code it in its only caller and delete the function. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a71aeff3dd0a7d127967d42a86b42b0aa21a90dc Author: Alex Elder Date: Tue Aug 10 14:27:03 2021 -0500 net: ipa: kill IPA clock reference count The runtime power management core code maintains a usage count. This count mirrors the IPA clock reference count, and there's no need to maintain both. So get rid of the IPA clock reference count and just rely on the runtime PM usage count to determine when the hardware should be suspended or resumed. Use pm_runtime_get_if_active() in ipa_clock_get_additional(). We care whether power is active, regardless of whether it's in use, so pass true for its ign_usage_count argument. The IPA clock mutex is just used to make enabling/disabling the clock and updating the reference count occur atomically. Without the reference count, there's no need for the mutex, so get rid of that too. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a3d3e759a487008a78ea35daff1f390f4f9d0deb Author: Alex Elder Date: Tue Aug 10 14:27:02 2021 -0500 net: ipa: get rid of extra clock reference Suspending the IPA hardware is now managed by the runtime PM core code. The ->runtime_idle callback returns a non-zero value, so it will never suspend except when forced. As a result, there's no need to take an extra "do not suspend" clock reference. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 63de79f031dedeb64fb1a5fc7f07f5f51fcbf7a0 Author: Alex Elder Date: Tue Aug 10 14:27:01 2021 -0500 net: ipa: use runtime PM core Use the runtime power management core to cause hardware suspend and resume to occur. Enable it in ipa_clock_init() (without autosuspend), and disable it in ipa_clock_exit(). Use ipa_runtime_suspend() as the ->runtime_suspend power operation, and arrange for it to be called by having ipa_clock_get() call pm_runtime_get_sync() when the first clock reference is taken. Similarly, use ipa_runtime_resume() as the ->runtime_resume power operation, and pm_runtime_put() when the last IPA clock reference is dropped. Introduce ipa_runtime_idle() as the ->runtime_idle power operation, and have it return a non-zero value; this way suspend will never occur except when forced. Use pm_runtime_force_suspend() and pm_runtime_force_resume() as the system suspend and resume callbacks, and remove ipa_suspend() and ipa_resume(). Store a pointer to the device structure passed to ipa_clock_init(), so it can be used by ipa_clock_exit() to disable runtime power management. For now we preserve IPA clock reference counting. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 2abb0c7f98e8f025447c5386389928b87e047738 Author: Alex Elder Date: Tue Aug 10 14:27:00 2021 -0500 net: ipa: resume in ipa_clock_get() Introduce ipa_runtime_suspend() and ipa_runtime_resume(), which encapsulate the activities necessary for suspending and resuming the IPA hardware. Call these functions from ipa_clock_get() and ipa_clock_put() when the first reference is taken or last one is dropped. When the very first clock reference is taken (for ipa_config()), setup isn't complete yet, so (as before) only the core clock gets enabled. When the last clock reference is dropped (after ipa_deconfig()), ipa_teardown() will have made the setup_complete flag false, so there too, the core clock will be stopped without affecting GSI or the endpoints. Otherwise these new functions will perform the desired suspend and resume actions once setup is complete. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 1016c6b8c62152eaa9ad31a9905a816e58333afa Author: Alex Elder Date: Tue Aug 10 14:26:59 2021 -0500 net: ipa: disable clock in suspend Disable the IPA clock rather than dropping a reference to it in the system suspend callback. This forces the suspend to occur without affecting existing references. Similarly, enable the clock rather than taking a reference in ipa_resume(), forcing a resume without changing the reference count. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 7ebd168c3bfc3ebf113545170c2bb28d02f0ba15 Author: Alex Elder Date: Tue Aug 10 14:26:58 2021 -0500 net: ipa: have ipa_clock_get() return a value We currently assume no errors occur when enabling or disabling the IPA core clock and interconnects. And although this commit exposes errors that could occur, we generally assume this won't happen in practice. This commit changes ipa_clock_get() and ipa_clock_put() so each returns a value. The values returned are meant to mimic what the runtime power management functions return, so we can set up error handling here before we make the switch. Have ipa_clock_get() increment the reference count even if it returns an error, to match the behavior of pm_runtime_get(). More details follow. When taking a reference in ipa_clock_get(), return 0 for the first reference, 1 for subsequent references, or a negative error code if an error occurs. Note that if ipa_clock_get() returns an error, we must not touch hardware; in some cases such errors now cause entire blocks of code to be skipped. When dropping a reference in ipa_clock_put(), we return 0 or an error code. The error would come from ipa_clock_disable(), which now returns what ipa_interconnect_disable() returns (either 0 or a negative error code). For now, callers ignore the return value; if an error occurs, a message will have already been logged, and little more can actually be done to improve the situation. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f03f5c75f5dddda2a615a9640f4385138e0ba43b Author: satya priya Date: Mon Aug 2 18:51:04 2021 +0530 dt-bindings: pinctrl: qcom-pmic-gpio: Remove the interrupts property Remove the interrupts property as we no longer specify it. Signed-off-by: satya priya Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1627910464-19363-4-git-send-email-skakit@codeaurora.org Signed-off-by: Linus Walleij commit 328fb93a84686d8884b9b7ce1107ae0a46c194f7 Author: satya priya Date: Mon Aug 2 18:51:03 2021 +0530 dt-bindings: pinctrl: qcom-pmic-gpio: Convert qcom pmic gpio bindings to YAML Convert Qualcomm PMIC GPIO bindings from .txt to .yaml format. Signed-off-by: satya priya Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1627910464-19363-3-git-send-email-skakit@codeaurora.org Signed-off-by: Linus Walleij commit e43de7f0862b8598cd1ef440e3b4701cd107ea40 Author: Amir Goldstein Date: Tue Aug 10 18:12:20 2021 +0300 fsnotify: optimize the case of no marks of any type Add a simple check in the inline helpers to avoid calling fsnotify() and __fsnotify_parent() in case there are no marks of any type (inode/sb/mount) for an inode's sb, so there can be no objects of any type interested in the event. Link: https://lore.kernel.org/r/20210810151220.285179-5-amir73il@gmail.com Reviewed-by: Matthew Bobrowski Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit e888fa7bb882a1f305526d8f49d7016a7bc5f5ca Author: Geert Uytterhoeven Date: Wed Aug 11 10:55:18 2021 +0200 memblock: Check memory add/cap ordering For memblock_cap_memory_range() to work properly, it should be called after memory is detected and added to memblock with memblock_add() or memblock_add_node(). If memblock_cap_memory_range() would be called before memory is registered, we may silently corrupt memory later because the crash kernel will see all memory as available. Print a warning and bail out if ordering is not satisfied. Suggested-by: Mike Rapoport Signed-off-by: Geert Uytterhoeven Reviewed-by: David Hildenbrand Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/aabc5bad008d49f07d542815c6c8d28ec90bb09e.1628672091.git.geert+renesas@glider.be commit ec44610fe2b86daef70f3f53f47d2a2542d7094f Author: Amir Goldstein Date: Tue Aug 10 18:12:19 2021 +0300 fsnotify: count all objects with attached connectors Rename s_fsnotify_inode_refs to s_fsnotify_connectors and count all objects with attached connectors, not only inodes with attached connectors. This will be used to optimize fsnotify() calls on sb without any type of marks. Link: https://lore.kernel.org/r/20210810151220.285179-4-amir73il@gmail.com Signed-off-by: Amir Goldstein Reviewed-by: Matthew Bobrowski Signed-off-by: Jan Kara commit 00974b9a83cb233d9c8f9758f541d9aa2a80c5cd Author: Geert Uytterhoeven Date: Wed Aug 11 10:54:36 2021 +0200 memblock: Add missing debug code to memblock_add_node() All other memblock APIs built on top of memblock_add_range() contain debug code to print their parameters. Signed-off-by: Geert Uytterhoeven Reviewed-by: David Hildenbrand Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/c45e5218b6fcf0e3aeb63d9a9d9792addae0bb7a.1628672041.git.geert+renesas@glider.be commit 11fa333b58ba1518e7c69fafb6513a0117f8fe33 Author: Amir Goldstein Date: Tue Aug 10 18:12:18 2021 +0300 fsnotify: count s_fsnotify_inode_refs for attached connectors Instead of incrementing s_fsnotify_inode_refs when detaching connector from inode, increment it earlier when attaching connector to inode. Next patch is going to use s_fsnotify_inode_refs to count all objects with attached connectors. Link: https://lore.kernel.org/r/20210810151220.285179-3-amir73il@gmail.com Reviewed-by: Matthew Bobrowski Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 09ddbe69c9925b42cb9529f60678c25b241d8b18 Author: Amir Goldstein Date: Tue Aug 10 18:12:17 2021 +0300 fsnotify: replace igrab() with ihold() on attach connector We must have a reference on inode, so ihold is cheaper. Link: https://lore.kernel.org/r/20210810151220.285179-2-amir73il@gmail.com Reviewed-by: Matthew Bobrowski Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 331ebe4c43496cdc7f8d9a32d4ef59300b748435 Author: James Morse Date: Wed Jul 28 17:06:19 2021 +0000 x86/resctrl: Walk the resctrl schema list instead of an arch list When parsing a schema configuration value from user-space, resctrl walks the architectures rdt_resources_all[] array to find a matching struct rdt_resource. Once the CDP resources are merged there will be one resource in use by two schemata. Anything walking rdt_resources_all[] on behalf of a user-space request should walk the list of struct resctrl_schema instead. Change the users of for_each_alloc_enabled_rdt_resource() to walk the schema instead. Schemata were only created for alloc_enabled resources so these two lists are currently equivalent. schemata_list_create() and rdt_kill_sb() are ignored. The first creates the schema list, and will eventually loop over the resource indexes using an arch helper to retrieve the resource. rdt_kill_sb() will eventually make use of an arch 'reset everything' helper. After the filesystem code is moved, rdtgroup_pseudo_locked_in_hierarchy() remains part of the x86 specific hooks to support pseudo lock. This code walks each domain, and still does this after the separate resources are merged. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-7-james.morse@arm.com commit 208ab16847c562c0d53a0266b6628ef6cb5ab5c2 Author: James Morse Date: Wed Jul 28 17:06:18 2021 +0000 x86/resctrl: Label the resources with their configuration type The names of resources are used for the schema name presented to user-space. The name used is rooted in a structure provided by the architecture code because the names are different when CDP is enabled. x86 implements this by swapping between two sets of resource structures based on their alloc_enabled flag. The type of configuration in-use is encoded in the name (and cbm_idx_offset). Once the CDP behaviour is moved into the parts of resctrl that will move to /fs/, there will be two struct resctrl_schema for one struct rdt_resource. The schema describes the type of configuration being applied to the resource. The name of the schema should be generated by resctrl, base on the type of configuration. To do this struct resctrl_schema needs to store the type of configuration in use for a schema. Create an enum resctrl_conf_type describing the options, and add it to struct resctrl_schema. The underlying resources are still separate, as cbm_idx_offset is still in use. Temporarily label all the entries in rdt_resources_all[] and copy that value to struct resctrl_schema. Copying the value ensures there is no mismatch while the filesystem parts of resctrl are modified to use the schema. Once the resources are merged, the filesystem code can assign this value based on the schema being created. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-6-james.morse@arm.com commit f2594492308d2a950c9f765eb719480f3b881f0a Author: James Morse Date: Wed Jul 28 17:06:17 2021 +0000 x86/resctrl: Pass the schema in info dir's private pointer Many of resctrl's per-schema files return a value from struct rdt_resource, which they take as their 'priv' pointer. Moving properties that resctrl exposes to user-space into the core 'fs' code, (e.g. the name of the schema), means some of the functions that back the filesystem need the schema struct (to where the properties are moved), but currently take struct rdt_resource. For example, once the CDP resources are merged, struct rdt_resource no longer reflects all the properties of the schema. For the info dirs that represent a control, the information needed will be accessed via struct resctrl_schema, as this is how the resource is being used. For the monitors, its still struct rdt_resource as the monitors aren't described as schema. This difference means the type of the private pointers varies between control and monitor info dirs. Change the 'priv' pointer to point to struct resctrl_schema for the per-schema files that represent a control. The type can be determined from the fflags field. If the flags are RF_MON_INFO, its a struct rdt_resource. If the flags are RF_CTRL_INFO, its a struct resctrl_schema. No entry in res_common_files[] has both flags. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-5-james.morse@arm.com commit 64a80fb766f9a91e26930bfc56d8e7c12425df12 Author: Quentin Perret Date: Mon Aug 9 16:24:48 2021 +0100 KVM: arm64: Make __pkvm_create_mappings static The __pkvm_create_mappings() function is no longer used outside of nvhe/mm.c, make it static. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-22-qperret@google.com commit 66c57edd3bc79e3527daaae8123f72ecd1e3fa25 Author: Quentin Perret Date: Mon Aug 9 16:24:47 2021 +0100 KVM: arm64: Restrict EL2 stage-1 changes in protected mode The host kernel is currently able to change EL2 stage-1 mappings without restrictions thanks to the __pkvm_create_mappings() hypercall. But in a world where the host is no longer part of the TCB, this clearly poses a problem. To fix this, introduce a new hypercall to allow the host to share a physical memory page with the hypervisor, and remove the __pkvm_create_mappings() variant. The new hypercall implements ownership and permission checks before allowing the sharing operation, and it annotates the shared page in the hypervisor stage-1 and host stage-2 page-tables. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-21-qperret@google.com commit f9370010e92638f66473baf342e19de940403362 Author: Quentin Perret Date: Mon Aug 9 16:24:46 2021 +0100 KVM: arm64: Refactor protected nVHE stage-1 locking Refactor the hypervisor stage-1 locking in nVHE protected mode to expose a new pkvm_create_mappings_locked() function. This will be used in later patches to allow walking and changing the hypervisor stage-1 without releasing the lock. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-20-qperret@google.com commit ad0e0139a8e163245d8f44ab4f6ec3bc9b08034d Author: Quentin Perret Date: Mon Aug 9 16:24:45 2021 +0100 KVM: arm64: Remove __pkvm_mark_hyp Now that we mark memory owned by the hypervisor in the host stage-2 during __pkvm_init(), we no longer need to rely on the host to explicitly mark the hyp sections later on. Remove the __pkvm_mark_hyp() hypercall altogether. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-19-qperret@google.com commit 2c50166c62ba7f3c23c1bbdbb9324db462ddc97b Author: Quentin Perret Date: Mon Aug 9 16:24:44 2021 +0100 KVM: arm64: Mark host bss and rodata section as shared As the hypervisor maps the host's .bss and .rodata sections in its stage-1, make sure to tag them as shared in hyp and host page-tables. But since the hypervisor relies on the presence of these mappings, we cannot let the host in complete control of the memory regions -- it must not unshare or donate them to another entity for example. To prevent this, let's transfer the ownership of those ranges to the hypervisor itself, and share the pages back with the host. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-18-qperret@google.com commit 9024b3d0069ab4b8ef70cf55f0ee09e61f3a0747 Author: Quentin Perret Date: Mon Aug 9 16:24:43 2021 +0100 KVM: arm64: Enable retrieving protections attributes of PTEs Introduce helper functions in the KVM stage-2 and stage-1 page-table manipulation library allowing to retrieve the enum kvm_pgtable_prot of a PTE. This will be useful to implement custom walkers outside of pgtable.c. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-17-qperret@google.com commit e009dce1292c37cf8ee7c33e0887ad3c642f980f Author: Quentin Perret Date: Mon Aug 9 16:24:42 2021 +0100 KVM: arm64: Introduce addr_is_memory() Introduce a helper usable in nVHE protected mode to check whether a physical address is in a RAM region or not. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-16-qperret@google.com commit 2d77e238badb022adb364332b7d6a1d627f77145 Author: Quentin Perret Date: Mon Aug 9 16:24:41 2021 +0100 KVM: arm64: Expose pkvm_hyp_id Allow references to the hypervisor's owner id from outside mem_protect.c. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-15-qperret@google.com commit 39257da0e04e5cdb1e4a3ca715dc3d949fe8b059 Author: Quentin Perret Date: Mon Aug 9 16:24:40 2021 +0100 KVM: arm64: Expose host stage-2 manipulation helpers We will need to manipulate the host stage-2 page-table from outside mem_protect.c soon. Introduce two functions allowing this, and make them usable to users of mem_protect.h. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-14-qperret@google.com commit ec250a67ea8db6209918a389554cf3aec0395b1f Author: Quentin Perret Date: Mon Aug 9 16:24:39 2021 +0100 KVM: arm64: Add helpers to tag shared pages in SW bits We will soon start annotating shared pages in page-tables in nVHE protected mode. Define all the states in which a page can be (owned, shared and owned, shared and borrowed), and provide helpers allowing to convert this into SW bits annotations using the matching prot attributes. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-13-qperret@google.com commit 4505e9b624cefafa4b75d8a28e72f32076c33375 Author: Quentin Perret Date: Mon Aug 9 16:24:38 2021 +0100 KVM: arm64: Allow populating software bits Introduce infrastructure allowing to manipulate software bits in stage-1 and stage-2 page-tables using additional entries in the kvm_pgtable_prot enum. This is heavily inspired by Marc's implementation of a similar feature in the NV patch series, but adapted to allow stage-1 changes as well: https://lore.kernel.org/kvmarm/20210510165920.1913477-56-maz@kernel.org/ Suggested-by: Marc Zyngier Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-12-qperret@google.com commit 5651311941105ca077d3ab74dd4a92e646ecf7fb Author: Quentin Perret Date: Mon Aug 9 16:24:37 2021 +0100 KVM: arm64: Enable forcing page-level stage-2 mappings Much of the stage-2 manipulation logic relies on being able to destroy block mappings if e.g. installing a smaller mapping in the range. The rationale for this behaviour is that stage-2 mappings can always be re-created lazily. However, this gets more complicated when the stage-2 page-table is used to store metadata about the underlying pages. In such cases, destroying a block mapping may lead to losing part of the state, and confuse the user of those metadata (such as the hypervisor in nVHE protected mode). To avoid this, introduce a callback function in the pgtable struct which is called during all map operations to determine whether the mappings can use blocks, or should be forced to page granularity. This is used by the hypervisor when creating the host stage-2 to force page-level mappings when using non-default protection attributes. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-11-qperret@google.com commit b53846c5f279cb5329b82f19a7d313f02cb9d21c Author: Quentin Perret Date: Mon Aug 9 16:24:36 2021 +0100 KVM: arm64: Tolerate re-creating hyp mappings to set software bits The current hypervisor stage-1 mapping code doesn't allow changing an existing valid mapping. Relax this condition by allowing changes that only target software bits, as that will soon be needed to annotate shared pages. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-10-qperret@google.com commit 8a0282c68121e53ab17413283cfed408a47e1a2a Author: Quentin Perret Date: Mon Aug 9 16:24:35 2021 +0100 KVM: arm64: Don't overwrite software bits with owner id We will soon start annotating page-tables with new flags to track shared pages and such, and we will do so in valid mappings using software bits in the PTEs, as provided by the architecture. However, it is possible that we will need to use those flags to annotate invalid mappings as well in the future, similar to what we do to track page ownership in the host stage-2. In order to facilitate the annotation of invalid mappings with such flags, it would be preferable to re-use the same bits as for valid mappings (bits [58-55]), but these are currently used for ownership encoding. Since we have plenty of bits left to use in invalid mappings, move the ownership bits further down the PTE to avoid the conflict. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-9-qperret@google.com commit 178cac08d588e7406a09351a992f57892d8d9cc9 Author: Quentin Perret Date: Mon Aug 9 16:24:34 2021 +0100 KVM: arm64: Rename KVM_PTE_LEAF_ATTR_S2_IGNORED The ignored bits for both stage-1 and stage-2 page and block descriptors are in [55:58], so rename KVM_PTE_LEAF_ATTR_S2_IGNORED to make it applicable to both. And while at it, since these bits are more commonly known as 'software' bits, rename accordingly. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-8-qperret@google.com commit c4f0935e4d957bfcea25ad76860445660a60f3fd Author: Quentin Perret Date: Mon Aug 9 16:24:33 2021 +0100 KVM: arm64: Optimize host memory aborts The kvm_pgtable_stage2_find_range() function is used in the host memory abort path to try and look for the largest block mapping that can be used to map the faulting address. In order to do so, the function currently walks the stage-2 page-table and looks for existing incompatible mappings within the range of the largest possible block. If incompatible mappings are found, it tries the same procedure again, but using a smaller block range, and repeats until a matching range is found (potentially up to page granularity). While this approach has benefits (mostly in the fact that it proactively coalesces host stage-2 mappings), it can be slow if the ranges are fragmented, and it isn't optimized to deal with CPUs faulting on the same IPA as all of them will do all the work every time. To avoid these issues, remove kvm_pgtable_stage2_find_range(), and walk the page-table only once in the host_mem_abort() path to find the closest leaf to the input address. With this, use the corresponding range if it is invalid and not owned by another entity. If a valid leaf is found, return -EAGAIN similar to what is done in the kvm_pgtable_stage2_map() path to optimize concurrent faults. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-7-qperret@google.com commit 51add457733bbc4a442fc280d73d14bfe262e4a0 Author: Quentin Perret Date: Mon Aug 9 16:24:32 2021 +0100 KVM: arm64: Expose page-table helpers The KVM pgtable API exposes the kvm_pgtable_walk() function to allow the definition of walkers outside of pgtable.c. However, it is not easy to implement any of those walkers without some of the low-level helpers. Move some of them to the header file to allow re-use from other places. Signed-off-by: Quentin Perret Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-6-qperret@google.com commit 1bac49d490cbc813f407a5c9806e464bf4a300c9 Author: Quentin Perret Date: Mon Aug 9 16:24:30 2021 +0100 KVM: arm64: Provide the host_stage2_try() helper macro We currently unmap all MMIO mappings from the host stage-2 to recycle the pages whenever we run out. In order to make this pattern easy to re-use from other places, factor the logic out into a dedicated macro. While at it, apply the macro for the kvm_pgtable_stage2_set_owner() calls. They're currently only called early on and are guaranteed to succeed, but making them robust to the -ENOMEM case doesn't hurt and will avoid painful debugging sessions later on. Reviewed-by: Fuad Tabba Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-4-qperret@google.com commit 8e049e0daf23aa380c264e5e15e4c64ea5497ed7 Author: Quentin Perret Date: Mon Aug 9 16:24:29 2021 +0100 KVM: arm64: Introduce hyp_assert_lock_held() Introduce a poor man's lockdep implementation at EL2 which allows to BUG() whenever a hyp spinlock is not held when it should. Hide this feature behind a new Kconfig option that targets the EL2 object specifically, instead of piggy backing on the existing CONFIG_LOCKDEP. EL2 cannot WARN() cleanly to report locking issues, hence BUG() is the only option and it is not clear whether we want this widely enabled. This is most likely going to be useful for local testing until the EL2 WARN() situation has improved. Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-3-qperret@google.com commit d21292f13f1f0721d60e8122e2db46bea8cf6950 Author: Will Deacon Date: Mon Aug 9 16:24:28 2021 +0100 KVM: arm64: Add hyp_spin_is_locked() for basic locking assertions at EL2 Introduce hyp_spin_is_locked() so that functions can easily assert that a given lock is held (albeit possibly by another CPU!) without having to drag full lockdep support up to EL2. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210809152448.1810400-2-qperret@google.com commit cdb9ebc9178461c27d618bb1238e851da17271de Author: James Morse Date: Wed Jul 28 17:06:16 2021 +0000 x86/resctrl: Add a separate schema list for resctrl Resctrl exposes schemata to user-space, which allow the control values to be specified for a group of tasks. User-visible properties of the interface, (such as the schemata names and how the values are parsed) are rooted in a struct provided by the architecture code. (struct rdt_hw_resource). Once a second architecture uses resctrl, this would allow user-visible properties to diverge between architectures. These properties should come from the resctrl code that will be common to all architectures. Resctrl has no per-schema structure, only struct rdt_{hw_,}resource. Create a struct resctrl_schema to hold the rdt_resource. Before a second architecture can be supported, this structure will also need to hold the schema name visible to user-space and the type of configuration values for resctrl. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-4-james.morse@arm.com commit dd00d75007d27677158bf6e64000d2e266035294 Author: Christoph Hellwig Date: Tue Aug 10 17:54:39 2021 +0200 firmware: tegra: Stop using seq_get_buf() Opencode a copy of mrq_debug_read() in bpmp_debug_show() so that it can use seq_write() directly instead of poking holes into the seq_file abstractions using seq_get_buf(). Signed-off-by: Christoph Hellwig Signed-off-by: Thierry Reding commit 806b99206b840bcf3bfa44227dc978880d13ed1b Author: Dmitry Osipenko Date: Wed Jul 14 05:51:27 2021 +0300 ARM: multi_v7_defconfig: Enable CONFIG_TEGRA30_TSENSOR Enable NVIDIA Tegra30 SoC thermal sensor driver in multi_v7_defconfig. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 7fa990a028a9fea55b2330f1924b53752e097e1a Author: Dmitry Osipenko Date: Wed Jul 14 05:51:26 2021 +0300 ARM: multi_v7_defconfig: Enable Acer A500 drivers Enable EC controller drivers of the Acer A500 tablet. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a1bff9474f101f785c727f221f96e412ba240029 Author: Maxim Schwalm Date: Wed Jul 14 05:51:25 2021 +0300 ARM: tegra: Rebuild default configuration Run "make tegra_defconfig; make savedefconfig" to rebuild tegra_defconfig. Signed-off-by: Maxim Schwalm Signed-off-by: Thierry Reding commit 6c3f29edd75f504ec92acb85bc082b19b3de7dcf Author: Maxim Schwalm Date: Wed Jul 14 05:51:24 2021 +0300 ARM: tegra: Enable CONFIG_CROS_EC Updating the tegra_defconfig was omitted, when the ChromeOS EC config options were renamed by a previous commit. Fix it. Fixes: 67c70aa86f8b ("arm/arm64: defconfig: Update configs to use the new CROS_EC options") Signed-off-by: Maxim Schwalm Signed-off-by: Thierry Reding commit 9265d64e846b17dbe2853ce327ecdcc4751a3c55 Author: Dmitry Osipenko Date: Wed Jul 14 05:51:23 2021 +0300 ARM: tegra: Enable Acer A500 drivers Enable EC controller drivers of the Acer A500 tablet. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a422eec5bec79fc4a27da84e96a24c8ca3798341 Author: Dmitry Osipenko Date: Wed Jul 14 05:51:22 2021 +0300 ARM: tegra: Enable CONFIG_FB Previously CONFIG_FB was auto-selected, now it's not. We completely lost framebuffer in tegra_defconfig. Select the CONFIG_FB to fix it. Fixes: f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 4398a03fd199f920f6924bf27767319bf7fc90b1 Author: Dmitry Osipenko Date: Wed Jul 14 05:51:21 2021 +0300 ARM: tegra: Enable CONFIG_TEGRA30_TSENSOR Enable NVIDIA Tegra30 SoC thermal sensor driver in tegra_defconfig. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit dbb096d34a84b2010f6989d013171887b591bd1c Author: Dmitry Osipenko Date: Mon Jul 12 02:49:39 2021 +0300 arm64: tegra194: p2888: Correct interrupt trigger type of temperature sensor The LM90 temperature sensor should use edge-triggered interrupt because LM90 hardware doesn't deassert interrupt line until temperature is back to normal state, which results in interrupt storm. Correct the interrupt trigger type. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit fd264b310579efc14436b2ec86defa5d4c31332e Author: Anshuman Khandual Date: Wed Aug 11 08:57:07 2021 +0530 arm64/perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF ID_AA64DFR0_PMUVER_IMP_DEF, indicating an "implementation defined" PMU, never actually gets used although there are '0xf' instances scattered all around. Use the symbolic name instead of the raw hex constant. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1628652427-24695-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 792e0f6f789bda5e31b1dbcfcc84068da36a79b1 Author: James Morse Date: Wed Jul 28 17:06:15 2021 +0000 x86/resctrl: Split struct rdt_domain resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the features provided by Intel RDT and AMD PQoS, and moved to /fs/. struct rdt_domain contains a mix of architecture private details and properties of the filesystem interface user-space uses. Continue by splitting struct rdt_domain, into an architecture private 'hw' struct, which contains the common resctrl structure that would be used by any architecture. The hardware values in ctrl_val and mbps_val need to be accessed via helpers to allow another architecture to convert these into a different format if necessary. After this split, filesystem code paths touching a 'hw' struct indicates where an abstraction is needed. Splitting this structure only moves types around, and should not lead to any change in behaviour. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-3-james.morse@arm.com commit faa8605f9f92e36c724ecaf03b466cfe31b04b06 Author: Dmitry Osipenko Date: Tue Aug 3 01:13:36 2021 +0300 clk: tegra: Remove CLK_IS_CRITICAL flag from fuse clock FUSE driver now takes care of keeping the clock enabled when necessary. Remove the CLK_IS_CRITICAL flag from the clock. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e278718f314d305e4ad80c64d016cdc617e7356c Merge: e73f0f0ee7541 59c6fceb2ecc3 Author: Thierry Reding Date: Wed Aug 11 11:56:52 2021 +0200 Merge branch 'for-5.15/soc' into for-5.15/clk commit 59c6fceb2ecc382c3d20508a235b539bf23af1f0 Author: Dmitry Osipenko Date: Tue Aug 3 01:13:35 2021 +0300 soc/tegra: fuse: Enable fuse clock on suspend for Tegra124 The FUSE clock should be enabled during suspend on Tegra124. Currently clk driver enables it on all SoCs, but FUSE may require a higher core voltage on Tegra30 while enabled. Move the quirk into the FUSE driver and make it specific to Tegra124. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 24a15252ff049ca76bdcc51dd445503b88b2c6df Author: Dmitry Osipenko Date: Tue Aug 3 01:13:34 2021 +0300 soc/tegra: fuse: Add runtime PM support The Tegra FUSE belongs to the core power domain and we're going to enable GENPD support for the core domain. Now FUSE device must be resumed using runtime PM API in order to initialize the FUSE power state. Add runtime PM support to the FUSE driver. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a65a4ea1563218b401a9a638a198e2b8165e967a Author: Dmitry Osipenko Date: Tue Aug 3 01:13:33 2021 +0300 soc/tegra: fuse: Clear fuse->clk on driver probe failure The fuse->clk must be cleared if FUSE driver fails to probe, otherwise tegra_fuse_readl() will crash. It's unlikely to happen in practice, nevertheless let's correct it for completeness. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 9c93ccfc86f2cdeab8a34408759abad594e439b9 Author: Dmitry Osipenko Date: Mon Jul 19 00:27:05 2021 +0300 soc/tegra: pmc: Prevent racing with cpuilde driver Both PMC and cpuidle drivers are probed at the same init level and cpuidle depends on the PMC suspend mode. Add new default suspend mode that indicates whether PMC driver has been probed and reset the mode in a case of deferred probe of the PMC driver. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 158a9b47a491dd73e73a306e962d4c9a01270132 Author: Cai Huoqing Date: Tue Jul 27 17:28:54 2021 +0800 soc/tegra: bpmp: Remove unused including Remove including that don't need it. V1->V2: Split the patch in two Signed-off-by: Cai Huoqing Acked-by: Randy Dunlap Signed-off-by: Thierry Reding commit 63c8b1231929b8aa80abc753c1c91b6b49e2c0b0 Author: James Morse Date: Wed Jul 28 17:06:14 2021 +0000 x86/resctrl: Split struct rdt_resource resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the features provided by Intel RDT and AMD PQoS, and moved to /fs/. struct rdt_resource contains a mix of architecture private details and properties of the filesystem interface user-space uses. Start by splitting struct rdt_resource, into an architecture private 'hw' struct, which contains the common resctrl structure that would be used by any architecture. The foreach helpers are most commonly used by the filesystem code, and should return the common resctrl structure. for_each_rdt_resource() is changed to walk the common structure in its parent arch private structure. Move as much of the structure as possible into the common structure in the core code's header file. The x86 hardware accessors remain part of the architecture private code, as do num_closid, mon_scale and mbm_width. mon_scale and mbm_width are used to detect overflow of the hardware counters, and convert them from their native size to bytes. Any cross-architecture abstraction should be in terms of bytes, making these properties private. The hardware's num_closid is kept in the private structure to force the filesystem code to use a helper to access it. MPAM would return a single value for the system, regardless of the resource. Using the helper prevents this field from being confused with the version of num_closid that is being exposed to user-space (added in a later patch). After this split, filesystem code touching a 'hw' struct indicates where an abstraction is needed. Splitting this structure only moves types around, and should not lead to any change in behaviour. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-2-james.morse@arm.com commit fc062ad8e406a08b624b3ab3427434800ff886f8 Author: Geert Uytterhoeven Date: Wed Jul 14 11:44:22 2021 +0200 asm-generic: ffs: Drop bogus reference to ffz location The generic definition of ffz() is not defined in the same header files as the generic definitions of ffs(). Signed-off-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit 6f45933dfed0c1d90c2d9acfe6b782c5560ee038 Merge: d3432bf10f17b 8702997074363 Author: David S. Miller Date: Wed Aug 11 10:22:26 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next: 1) Use nfnetlink_unicast() instead of netlink_unicast() in nft_compat. 2) Remove call to nf_ct_l4proto_find() in flowtable offload timeout fixup. 3) CLUSTERIP registers ARP hook on demand, from Florian. 4) Use clusterip_net to store pernet warning, also from Florian. 5) Remove struct netns_xt, from Florian Westphal. 6) Enable ebtables hooks in initns on demand, from Florian. 7) Allow to filter conntrack netlink dump per status bits, from Florian Westphal. 8) Register x_tables hooks in initns on demand, from Florian. 9) Remove queue_handler from per-netns structure, again from Florian. ==================== Signed-off-by: David S. Miller commit e3245a7b7b34bd2e97f744fd79463add6e9d41f4 Author: Pavel Skripkin Date: Tue Aug 10 15:59:20 2021 +0300 netfilter: nft_ct: protect nft_ct_pcpu_template_refcnt with mutex Syzbot hit use-after-free in nf_tables_dump_sets. The problem was in missing lock protection for nft_ct_pcpu_template_refcnt. Before commit f102d66b335a ("netfilter: nf_tables: use dedicated mutex to guard transactions") all transactions were serialized by global mutex, but then global mutex was changed to local per netnamespace commit_mutex. This change causes use-after-free bug, when 2 netnamespaces concurently changing nft_ct_pcpu_template_refcnt without proper locking. Fix it by adding nft_ct_pcpu_mutex and protect all nft_ct_pcpu_template_refcnt changes with it. Fixes: f102d66b335a ("netfilter: nf_tables: use dedicated mutex to guard transactions") Reported-and-tested-by: syzbot+649e339fa6658ee623d3@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 936c985478716b228f42f47c075d4ea10dfa98bb Author: Chen-Yu Tsai Date: Mon Jul 26 19:19:41 2021 +0800 dt-bindings: pinctrl: mt8195: Use real world values for drive-strength arguments The original binding submission for MT8195 pinctrl described the possible drive strength values in micro-amps in its description, but then proceeded to list register values in its device tree binding constraints. However, the macros used with the Mediatek pinctrl bindings directly specify the drive strength in micro-amps, instead of hardware register values. The current driver implementation in Linux does convert the value from micro-amps to hardware register values. This implementation is also used with MT7622 and MT8183, which use real world values in their device trees. Given the above, it was likely an oversight to use the raw register values in the binding. Correct the values in the binding. Also drop the description since the binding combined with its parent, pinctrl/pincfg.yaml, the binding is now self-describing. Fixes: 7f7663899d94 ("dt-bindings: pinctrl: mt8195: add pinctrl file and binding document") Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210726111941.1447057-1-wenst@chromium.org Signed-off-by: Linus Walleij commit 379e28b5b36f523e5afd9c129505580024613e22 Merge: 6626a76ef857c b9ffc18c6388c Author: Linus Walleij Date: Wed Aug 11 10:50:07 2021 +0200 Merge branch 'ib-mt8135' into devel commit b9ffc18c6388c0c62dbcfb486525825c0ca504f8 Author: Hsin-Yi Wang Date: Wed Aug 4 12:40:34 2021 +0800 dt-bindings: mediatek: convert pinctrl to yaml Convert mt65xx, mt6796, mt7622, mt8183 bindings to yaml. Signed-off-by: Hsin-Yi Wang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210804044033.3047296-3-hsinyi@chromium.org Signed-off-by: Linus Walleij commit 4e233326e50bf2787a632f7625b9ef89819478ff Author: Hsin-Yi Wang Date: Wed Aug 4 12:40:32 2021 +0800 arm: dts: mt8183: Move pinfunc to include/dt-bindings/pinctrl Move mt8183-pinfunc.h into include/dt-bindings/pinctrl so that we can include it in yaml examples. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20210804044033.3047296-2-hsinyi@chromium.org Signed-off-by: Linus Walleij commit 3acd5d8b7cf614d8724986b0dbfee52b0944d027 Author: Hsin-Yi Wang Date: Wed Aug 4 12:40:31 2021 +0800 arm: dts: mt8135: Move pinfunc to include/dt-bindings/pinctrl Move mt8135-pinfunc.h into include/dt-bindings/pinctrl so that we can include it in yaml examples. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20210804044033.3047296-1-hsinyi@chromium.org Signed-off-by: Linus Walleij commit 6626a76ef857c937ba7b96f0ea8bb5451c1419eb Author: Paul Cercueil Date: Sat Jul 17 18:48:36 2021 +0100 pinctrl: ingenic: Add .max_register in regmap_config Compute the max register from the GPIO chip offset and number of GPIO chips. This permits to read all registers from debugfs. Signed-off-by: Paul Cercueil Tested-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/20210717174836.14776-3-paul@crapouillou.net Signed-off-by: Linus Walleij commit 7261851e938f4b0fe8c0f5a8e627ae90e1ba9875 Author: Paul Cercueil Date: Sat Jul 17 18:48:35 2021 +0100 pinctrl: ingenic: Fix bias config for X2000(E) The ingenic_set_bias() function's "bias" argument is not a "enum pin_config_param", so its value should not be compared against values of that enum. This should fix the bias config not working on the X2000(E) SoCs. Fixes: 943e0da15370 ("pinctrl: Ingenic: Add pinctrl driver for X2000.") Cc: # v5.12 Signed-off-by: Paul Cercueil Tested-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/20210717174836.14776-2-paul@crapouillou.net Signed-off-by: Linus Walleij commit d5e931403942b3af39212960c2592b5ba741b2bf Author: Paul Cercueil Date: Sat Jul 17 18:48:34 2021 +0100 pinctrl: ingenic: Fix incorrect pull up/down info Fix the pull up/down info for both the JZ4760 and JZ4770 SoCs, as the previous values sometimes contradicted what's written in the programming manual. Fixes: b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs") Cc: # v4.12 Signed-off-by: Paul Cercueil Tested-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/20210717174836.14776-1-paul@crapouillou.net Signed-off-by: Linus Walleij commit 2a18211b8ccfa316d1cb68d00d4ceba0e81653f8 Author: 周琰杰 (Zhou Yanjie) Date: Sat Jul 24 14:36:44 2021 +0800 pinctrl: Ingenic: Add pinctrl driver for X2100. Add support for probing the pinctrl-ingenic driver on the X2100 SoC from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1627108604-91304-5-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Linus Walleij commit bbd33911cf3312dbba9149f544bebf796cd58d58 Author: 周琰杰 (Zhou Yanjie) Date: Sat Jul 24 14:36:43 2021 +0800 dt-bindings: pinctrl: Add bindings for Ingenic X2100. Add the pinctrl bindings for the X2100 SoC from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Acked-by: Rob Herring Link: https://lore.kernel.org/r/1627108604-91304-4-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Linus Walleij commit b638e0f18dea6f51a8f822a03028676ba2f7cf5b Author: 周琰杰 (Zhou Yanjie) Date: Sat Jul 24 14:36:42 2021 +0800 pinctrl: Ingenic: Add SSI pins support for JZ4755 and JZ4760. Add SSI pins support for the JZ4755 SoC and the JZ4760 SoC from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1627108604-91304-3-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Linus Walleij commit 28c1caaf492ed941d9dc7ce643515831f4e98117 Author: 周琰杰 (Zhou Yanjie) Date: Sat Jul 24 14:36:41 2021 +0800 pinctrl: Ingenic: Improve the code. 1.Rename the original "dmicx" ABIs to "dmic-ifx", since these devices have only one DMIC module which has multiple input interfaces. The original naming is easy to make users mistakenly think that the device has multiple dmic modules. Currently, in the mainline, no other devicetree out there is using the "sfc" ABI, so we should be able to replace it safely. 2.Rename the original "ssix-ce0" ABIs to "ssix-ce", since the X2000 have only one ce pin. The original naming is easy to make users mistakenly think that the device has multiple ce pins. Currently, in the mainline, no other devicetree out there is using the "ssix-ce0" ABIs, so we should be able to replace it safely. 3.Split the original "sfc" ABI into "sfc-data", "sfc-ce", "sfc-clk" to increase the flexibility when configuring the pins. Currently, in the mainline, no other devicetree out there is using the "sfc" ABI, so we should be able to replace it safely. 4.There is more than one compatible string in the match table, so renaming "ingenic_xxxx_of_match[]" to "ingenic_xxxx_of_matches" is more reasonable, and remove the unnecessary commas in "ingenic_gpio_of_matches[]" to reduce code size as much as possible. Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1627108604-91304-2-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Linus Walleij commit 25ee7e89d45debc195cc8cec2483e07bbccd1472 Author: Tuo Li Date: Tue Aug 10 20:11:35 2021 -0700 staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect() The variable dev is checked in: if (dev) This indicates that it can be NULL. If so, a null-pointer dereference will occur: priv = rtllib_priv(dev); However, the value of priv is not used in the remaining part of this function. Thus the else-branch can be removed to fix this posible null-pointer dereference. Reported-by: TOTE Robot Reviewed-by: Dan Carpenter Signed-off-by: Tuo Li Link: https://lore.kernel.org/r/20210811031135.4110-1-islituo@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3a330ece235e8d2647d7e9e287e226d77b7cae9f Author: Nathan Chancellor Date: Tue Aug 10 17:55:05 2021 -0700 staging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h After commit 71f09c5ae9d2 ("staging: r8188eu: Remove wrapper around vfree"), the driver fails to build on Hexagon due to an implicit declaration in several different files: drivers/staging/r8188eu/core/rtw_mlme.c:129:3: error: implicit declaration of function 'vfree' [-Werror,-Wimplicit-function-declaration] vfree(pmlmepriv->free_bss_buf); ^ 1 error generated. Previously, vfree() was only called in osdep_service.c, which includes vmalloc.h for vmalloc() and vfree(). Now, the driver relies on vfree() getting implicitly included from another file. Hoist the vmalloc.h include from osdep_service.c to osdep_service.h so that the driver continues to build fine on all architectures. Fixes: 71f09c5ae9d2 ("staging: r8188eu: Remove wrapper around vfree") Acked-by: Larry Finger Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210811005505.3953122-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit e3027f25c6f756056a314b82c11971349cca7a62 Author: Yang Yingliang Date: Tue Aug 10 20:53:14 2021 +0800 staging: r8188eu: Use GFP_ATOMIC under spin lock A spin lock is taken in __nat25_db_network_insert() and update_BCNTIM() is called under spin lock so we should use GFP_ATOMIC in both place. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reported-by: Hulk Robot Reviewed-by: Dan Carpenter Acked-by: Larry Finger Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210810125314.2182112-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit dcda94c9412a079df2e7b6b7e167342349db3a3f Author: Larry Finger Date: Tue Aug 10 13:05:11 2021 -0500 staging: r8188eu: Replace BITn with BIT(n) The driver uses BITn instead of BIT(n). All such usage is converted. Note that this patch does not address any warnings that checkpatch will find. These include missing space around operators and lines that are too long. These problems will be addressed in a separate patch. Acked-by: Phillip Potter Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210810180511.8986-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 987219ad34a67b6160e6f5247578596a1a887031 Author: Phillip Potter Date: Wed Aug 11 00:50:47 2021 +0100 staging: r8188eu: remove lines from Makefile that silence build warnings Remove the several lines from the Makefile that append EXTRA_CFLAGS options to silence build warnings about unused variables, unused functions and such like. This will enable cleanup of missed warnings, and easier spotting of future such problems. Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-9-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6be20b17ff40d71ff08692eccd6cfff3f33f1e8f Author: Phillip Potter Date: Wed Aug 11 00:50:46 2021 +0100 staging: r8188eu: remove unused variable from rtw_init_recv_timer Remove unused variable from rtw_init_recv_timer function in os_dep/recv_linux.c Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8268010e8f0e23ae31331bc250d420677df7a9e7 Author: Phillip Potter Date: Wed Aug 11 00:50:45 2021 +0100 staging: r8188eu: remove unused variable from rtw_init_drv_sw Remove unused variable from rtw_init_drv_sw function in os_dep/os_intfs.c Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit fdd46ffbe4714f9bfd57cccb8033348d76ebcb89 Author: Phillip Potter Date: Wed Aug 11 00:50:44 2021 +0100 staging: r8188eu: remove unused variable from rtl8188e_init_dm_priv Remove unused variable from the rtl8188e_init_dm_priv function in hal/rtl8188e_dm.c Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit aab87047305d2966a9ebfc60a2eb9dff480e6ca0 Author: Phillip Potter Date: Wed Aug 11 00:50:43 2021 +0100 staging: r8188eu: remove rtw_mfree_sta_priv_lock function Remove rtw_mfree_sta_priv_lock function from rtw_sta_mgt.c, as it does nothing and contains an unused variable. Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit d60489b69781104bca0017fcdb0ba39e7f26d3d4 Author: Phillip Potter Date: Wed Aug 11 00:50:42 2021 +0100 staging: r8188eu: remove unused label from recv_indicatepkt_reorder Remove unused goto label from recv_indicatepkt_reorder function in core/rtw_recv.c Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 085f11874b12cc7301ec252313e48fb8a30c980d Author: Phillip Potter Date: Wed Aug 11 00:50:41 2021 +0100 staging: r8188eu: remove unused oid_null_function function Remove unused oid_null_function function from include/rtw_ioctl.h Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit ba4b1d7cdd2cb9f6ded814d8aa555068d7d00ea6 Author: Phillip Potter Date: Wed Aug 11 00:50:40 2021 +0100 staging: r8188eu: remove unused functions from os_dep/ioctl_linux.c Remove unused functions that are now no longer called as a result of the removal of rtw_ioctl in a previous patch. This includes functions not directly called from rtw_ioctl, but anything in that specific call-chain. Acked-by: Michael Straube Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810235047.177883-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 59b9d6baa1bea254d31042c42bcb8f946c263bae Merge: 9efba20291f2e a43e2a0e11491 Author: Dave Airlie Date: Wed Aug 11 14:15:26 2021 +1000 Merge tag 'amd-drm-next-5.15-2021-08-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.15-2021-08-06: amdgpu: - Aldebaran fixes - Powergating fix for Renoir - Switch virtual DCE over to vkms based atomic modesetting - Misc typo fixes - PSP handling cleanups - DC FP cleanups - RAS fixes - Wave debug improvements - Freesync fix - BACO/BOCO fixes - Misc fixes amdkfd: - Expose gfx version in sysfs - Aldebaran fixes radeon: - Coding style fix - Typo fixes - Pageflip fix UAPI: - amdkfd: SVM address range query Proposed userspace: https://github.com/RadeonOpenCompute/ROCR-Runtime/tree/memory_model_queries Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210806205248.3864-1-alexander.deucher@amd.com commit ceeb0da0a0322bcba4c50ab3cf97fe9a7aa8a2e4 Author: Ira Weiny Date: Thu Jun 17 15:16:20 2021 -0700 cxl/mem: Adjust ram/pmem range to represent DPA ranges CXL spec defines the volatile DPA range to be 0 to Volatile memory size. It further defines the persistent DPA range to follow directly after the end of the Volatile DPA through the persistent memory size. Essentially Volatile DPA range = [0, Volatile size) Persistent DPA range = [Volatile size, Volatile size + Persistent size) Adjust the pmem_range start to reflect this and remote the TODO. Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20210617221620.1904031-4-ira.weiny@intel.com Signed-off-by: Dan Williams commit d252ff3de786a28b1bedf4c03fb31d142d32219b Author: Yue Hu Date: Tue Aug 10 15:24:16 2021 +0800 erofs: remove the mapping parameter from erofs_try_to_free_cached_page() The mapping is not used at all, remove it and update related code. Link: https://lore.kernel.org/r/20210810072416.1392-1-zbestahu@gmail.com Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Yue Hu Signed-off-by: Gao Xiang commit f4d4e5fc2b3d03c7e4f3c24ee694a01f8fe27d53 Author: Yue Hu Date: Tue Aug 10 14:54:50 2021 +0800 erofs: directly use wrapper erofs_page_is_managed() when shrinking We already have the wrapper function to identify managed page. Link: https://lore.kernel.org/r/20210810065450.1320-1-zbestahu@gmail.com Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Yue Hu Signed-off-by: Gao Xiang commit d3432bf10f17bd8ef7d6ca0a268f63bfb0c3d372 Author: Lahav Schlesinger Date: Tue Aug 10 09:06:58 2021 +0000 net: Support filtering interfaces on no master Currently there's support for filtering neighbours/links for interfaces which have a specific master device (using the IFLA_MASTER/NDA_MASTER attributes). This patch adds support for filtering interfaces/neighbours dump for interfaces that *don't* have a master. Signed-off-by: Lahav Schlesinger Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20210810090658.2778960-1-lschlesinger@drivenets.com Signed-off-by: Jakub Kicinski commit a5397d68b2dbdb8f725ab2ff420171fbde39dbe5 Author: Mark Bloch Date: Tue Aug 10 03:43:05 2021 +0000 net/sched: cls_api, reset flags on replay tc_new_tfilter() can replay a request if it got EAGAIN. The cited commit didn't account for this when it converted TC action ->init() API to use flags instead of parameters. This can lead to passing stale flags down the call chain which results in trying to lock rtnl when it's already locked, deadlocking the entire system. Fix by making sure to reset flags on each replay. ============================================ WARNING: possible recursive locking detected 5.14.0-rc3-custom-49011-g3d2bbb4f104d #447 Not tainted -------------------------------------------- tc/37605 is trying to acquire lock: ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_setup_cb_add+0x14b/0x4d0 but task is already holding lock: ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(rtnl_mutex); lock(rtnl_mutex); *** DEADLOCK *** May be due to missing lock nesting notation 1 lock held by tc/37605: #0: ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0 stack backtrace: CPU: 0 PID: 37605 Comm: tc Not tainted 5.14.0-rc3-custom-49011-g3d2bbb4f104d #447 Hardware name: Mellanox Technologies Ltd. MSN2010/SA002610, BIOS 5.6.5 08/24/2017 Call Trace: dump_stack_lvl+0x8b/0xb3 __lock_acquire.cold+0x175/0x3cb lock_acquire+0x1a4/0x4f0 __mutex_lock+0x136/0x10d0 fl_hw_replace_filter+0x458/0x630 [cls_flower] fl_change+0x25f2/0x4a64 [cls_flower] tc_new_tfilter+0xa65/0x22e0 rtnetlink_rcv_msg+0x86c/0xc60 netlink_rcv_skb+0x14d/0x430 netlink_unicast+0x539/0x7e0 netlink_sendmsg+0x84d/0xd80 ____sys_sendmsg+0x7ff/0x970 ___sys_sendmsg+0xf8/0x170 __sys_sendmsg+0xea/0x1b0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7b93b6c0a7 Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> RSP: 002b:00007ffe365b3818 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b93b6c0a7 RDX: 0000000000000000 RSI: 00007ffe365b3880 RDI: 0000000000000003 RBP: 00000000610a75f6 R08: 0000000000000001 R09: 0000000000000000 R10: fffffffffffff3a9 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 00007ffe365b7b58 R15: 00000000004822c0 Fixes: 695176bfe5de ("net_sched: refactor TC action init API") Signed-off-by: Mark Bloch Reviewed-by: Vlad Buslov Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Link: https://lore.kernel.org/r/20210810034305.63997-1-mbloch@nvidia.com Signed-off-by: Jakub Kicinski commit 62e8ce8506f5a998796dbdd93363fbed3342d379 Author: Suman Anna Date: Mon Aug 9 11:27:55 2021 -0500 dt-bindings: soc: ti: pruss: Add dma-coherent property Update the PRUSS schema file to include the dma-coherent property that indicates the coherency of the IP. The PRUSS IPs on 66AK2G SoCs do use this property. The new added dma-coherent property is a required property _only_ for 66AK2G SoCs and is not required/applicable for other SoCs, so the binding is backward compatible for other SoCs. This update is being done before the corresponding dts nodes can be added for 66AK2G SoCs. Signed-off-by: Suman Anna Reviewed-by: Grygorii Strashko Reviewed-by: Rob Herring Signed-off-by: Santosh Shilimkar commit ed4520d6a10bbc1d6fdebf325f0395995ce634cf Author: Tony Lindgren Date: Mon Aug 9 11:27:47 2021 -0500 soc: ti: Remove pm_runtime_irq_safe() usage for smartreflex For the smartreflex device, we need to disable smartreflex on SoC idle, and have been using pm_runtime_irq_safe() to do that. But we want to remove the irq_safe usage as PM runtime takes a permanent usage count on the parent device with it. In order to remove the need for pm_runtime_irq_safe(), let's gate the clock directly in the driver. This removes the need to call PM runtime during idle, and allows us to switch to using CPU_PM in the following patch. Note that the smartreflex interconnect target module is configured for smart idle, but the clock does not have autoidle capability, and needs to be gated manually. If the clock supported autoidle, we would not need to even gate the clock. With this change, we can now remove the related quirk flags for ti-sysc also. Signed-off-by: Tony Lindgren Signed-off-by: Santosh Shilimkar commit 22ea87ef3f22742cf2d3dcd31379be3b5612e282 Author: Suman Anna Date: Mon Aug 9 11:27:34 2021 -0500 soc: ti: pruss: Enable support for ICSSG subsystems on K3 AM64x SoCs The K3 AM64x family of SoCs have a similar version of the PRU-ICSS (ICSSG) processor subsystem present on K3 J721E and K3 AM65x SR2.0 SoCs. These SoCs contain typically two ICSSG instances named ICSSG0 and ICSSG1. The two ICSSGs are identical to each other for the most part with minor SoC integration differences and capabilities. SGMII mode is not supported at all on these SoCs (unlike specific instances on AM65x, J721E). The ICSSG1 also has limited pins connected on some sub-modules compared to ICSSG0. There is no change in the Interrupt Controller w.r.t either of AM65x or J721E SoCs. All other integration aspects are also very similar to the existing SoCs. The existing pruss platform driver has been updated to support these similar ICSSG instances through a new AM64x specific compatible. Signed-off-by: Suman Anna Reviewed-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar commit 2a65927edb27a6cd277f4744b59064df839e984f Author: Suman Anna Date: Mon Aug 9 11:27:21 2021 -0500 dt-bindings: soc: ti: pruss: Update bindings for K3 AM64x SoCs The K3 AM64x SoCs also have the Gigabit Ethernet capable PRU-ICSS IP that is present on existing K3 AM65x and J721E SoCs (ICSSG). The IP is similar to the ones used on K3 J721E or AM65x SR2.0 SoCs. Update the PRUSS bindings for these ICSSG instances. Signed-off-by: Suman Anna Reviewed-by: Grygorii Strashko Acked-by: Rob Herring Signed-off-by: Santosh Shilimkar commit 9efba20291f2e816e9c043875bf4e1f0f1416c63 Merge: 49f7844b08844 fc7a6209d5710 Author: Dave Airlie Date: Wed Aug 11 05:06:46 2021 +1000 Merge tag 'bus_remove_return_void-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into drm-next Bus: Make remove callback return void tag Tag for other trees/branches to pull from in order to have a stable place to build off of if they want to add new busses for 5.15. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Dave Airlie [airlied: fixed up merge conflict in drm] From: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/YPkwQwf0dUKnGA7L@kroah.com commit 858c595a3f5d66db1ed003fdefef374ea4a8c961 Author: Dmitry Baryshkov Date: Thu Aug 5 20:08:17 2021 +0300 drm/msm/dsi: add continuous clock support for 7nm PHY Unlike previous generations, 7nm PHYs are required to collaborate with the host for continuos clock mode. Add changes neccessary to enable continuous clock mode in the 7nm DSI PHYs. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210805170817.3337665-1-dmitry.baryshkov@linaro.org [Fix merge conflict, and $description typo] Signed-off-by: Rob Clark commit 26ae419cd9eca4268c267a1910bdac4ae6ef4896 Author: Kuogee Hsieh Date: Tue Aug 10 08:29:22 2021 -0700 drm/msm/dp: add drm debug logs to dp_pm_resume/suspend Changes in V2: -- correct Fixes text -- drop commit text Fixes: 601f0479c583 ("drm/msm/dp: add logs across DP driver for ease of debugging") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628609362-2109-1-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 2e0adc765d884cc080baa501e250bfad97035b09 Author: Kuogee Hsieh Date: Thu Aug 5 13:44:55 2021 -0700 drm/msm/dp: do not end dp link training until video is ready Initialize both pre-emphasis and voltage swing level to 0 before start link training and do not end link training until video is ready to reduce the period between end of link training and video start to meet Link Layer CTS requirement. Some dongle main link symbol may become unlocked again if host did not end link training soon enough after completion of link training 2. Host have to re train main link if loss of symbol locked detected before end link training so that the coming video stream can be transmitted to sink properly. This fixes Link Layer CTS cases 4.3.2.1, 4.3.2.2, 4.3.2.3 and 4.3.2.4. Changes in v3: -- merge retrain link if loss of symbol locked happen into this patch -- replace dp_ctrl_loss_symbol_lock() with dp_ctrl_channel_eq_ok() Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-7-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 7948fe12d47a946fb8025a0534c900e3dd4b5839 Author: Kuogee Hsieh Date: Thu Aug 5 13:44:54 2021 -0700 drm/msm/dp: return correct edid checksum after corrupted edid checksum read Response with correct edid checksum saved at connector after corrupted edid checksum read. This fixes Link Layer CTS cases 4.2.2.3, 4.2.2.6. Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-6-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 7e10bf427850f2d7133fd091999abd5fc1755cdb Author: Kuogee Hsieh Date: Thu Aug 5 13:44:53 2021 -0700 drm/msm/dp: replug event is converted into an unplug followed by an plug events Remove special handling of replug interrupt and instead treat replug event as a sequential unplug followed by a plugin event. This is needed to meet the requirements of DP Link Layer CTS test case 4.2.1.3. Changes in V2: -- add fixes statement Changes in V3: -- delete EV_HPD_REPLUG_INT Fixes: f21c8a276c2d ("drm/msm/dp: handle irq_hpd with sink_count = 0 correctly") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-5-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 0b324564ff74fa0556002be8fbbace556b9b2ad0 Author: Kuogee Hsieh Date: Thu Aug 5 13:44:52 2021 -0700 drm/msm/dp: reset aux controller after dp_aux_cmd_fifo_tx() failed. Aux hardware calibration sequence requires resetting the aux controller in order for the new setting to take effect. However resetting the AUX controller will also clear HPD interrupt status which may accidentally cause pending unplug interrupt to get lost. Therefore reset aux controller only when link is in connection state when dp_aux_cmd_fifo_tx() fail. This fixes Link Layer CTS cases 4.2.1.1 and 4.2.1.2. Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-4-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 4b85d405cfe938ae7ad61656484ae88dee289e3b Author: Kuogee Hsieh Date: Thu Aug 5 13:44:51 2021 -0700 drm/msm/dp: reduce link rate if failed at link training 1 Reduce link rate and re start link training if link training 1 failed due to loss of clock recovery done to fix Link Layer CTS case 4.3.1.7. Also only update voltage and pre-emphasis swing level after link training started to fix Link Layer CTS case 4.3.1.6. Changes in V2: -- replaced cr_status with link_status[DP_LINK_STATUS_SIZE] -- replaced dp_ctrl_any_lane_cr_done() with dp_ctrl_colco_recovery_any_ok() -- replaced dp_ctrl_any_ane_cr_lose() with !drm_dp_clock_recovery_ok() Changes in V3: -- return failed if lane_count <= 1 Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-3-git-send-email-khsieh@codeaurora.org [remove unused cr_status variable] Signed-off-by: Rob Clark commit 52352fe2f86693f52be7db513d3ca5adee8c33cb Author: Kuogee Hsieh Date: Thu Aug 5 13:44:50 2021 -0700 drm/msm/dp: use dp_ctrl_off_link_stream during PHY compliance test run DP cable should always connect to DPU during the entire PHY compliance testing run. Since DP PHY compliance test is executed at irq_hpd event context, dp_ctrl_off_link_stream() should be used instead of dp_ctrl_off(). dp_ctrl_off() is used for unplug event which is triggered when DP cable is dis connected. Changes in V2: -- add fixes statement Fixes: f21c8a276c2d ("drm/msm/dp: handle irq_hpd with sink_count = 0 correctly") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628196295-7382-2-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark commit 34739a2809e1e5d54d41d93cfc6b074e8d781ee2 Author: Maciej W. Rozycki Date: Tue Jul 20 05:28:15 2021 +0200 x86: Fix typo s/ECLR/ELCR/ for the PIC register The proper spelling for the acronym referring to the Edge/Level Control Register is ELCR rather than ECLR. Adjust references accordingly. No functional change. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107200251080.9461@angie.orcam.me.uk commit d25316616842b593de6f89ce2101f1af62f4d559 Author: Maciej W. Rozycki Date: Tue Jul 20 05:28:09 2021 +0200 x86: Avoid magic number with ELCR register accesses Define PIC_ELCR1 and PIC_ELCR2 macros for accesses to the ELCR registers implemented by many chipsets in their embedded 8259A PIC cores, avoiding magic numbers that are difficult to handle, and complementing the macros we already have for registers originally defined with discrete 8259A PIC implementations. No functional change. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107200237300.9461@angie.orcam.me.uk commit 0e8c6f56fab3af3ef9f78f486e198792d3af0fa1 Author: Maciej W. Rozycki Date: Tue Jul 20 05:28:04 2021 +0200 x86/PCI: Add support for the Intel 82426EX PIRQ router The Intel 82426EX ISA Bridge (IB), a part of the Intel 82420EX PCIset, implements PCI interrupt steering with a PIRQ router in the form of two PIRQ Route Control registers, available in the PCI configuration space at locations 0x66 and 0x67 for the PIRQ0# and PIRQ1# lines respectively. The semantics is the same as with the PIIX router, however it is not clear if BIOSes use register indices or line numbers as the cookie to identify PCI interrupts in their routing tables and therefore support either scheme. The IB is directly attached to the Intel 82425EX PCI System Controller (PSC) component of the chipset via a dedicated PSC/IB Link interface rather than the host bus or PCI. Therefore it does not itself appear in the PCI configuration space even though it responds to configuration cycles addressing registers it implements. Use 82425EX's identification then for determining the presence of the IB. References: [1] "82420EX PCIset Data Sheet, 82425EX PCI System Controller (PSC) and 82426EX ISA Bridge (IB)", Intel Corporation, Order Number: 290488-004, December 1995, Section 3.3.18 "PIRQ1RC/PIRQ0RC--PIRQ Route Control Registers", p. 61 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107200213490.9461@angie.orcam.me.uk commit 6b79164f603d14a3ff9c64330c1ca6c05f0b019e Author: Maciej W. Rozycki Date: Tue Jul 20 05:27:59 2021 +0200 x86/PCI: Add support for the Intel 82374EB/82374SB (ESC) PIRQ router The Intel 82374EB/82374SB EISA System Component (ESC) devices implement PCI interrupt steering with a PIRQ router[1] in the form of four PIRQ Route Control registers, available in the port I/O space accessible indirectly via the index/data register pair at 0x22/0x23, located at indices 0x60/0x61/0x62/0x63 for the PIRQ0/1/2/3# lines respectively. The semantics is the same as with the PIIX router, however it is not clear if BIOSes use register indices or line numbers as the cookie to identify PCI interrupts in their routing tables and therefore support either scheme. Accesses to the port I/O space concerned here need to be unlocked by writing the value of 0x0f to the ESC ID Register at index 0x02 beforehand[2]. Do so then and then lock access after use for safety. This locking could possibly interfere with accesses to the Intel MP spec IMCR register, implemented by the 82374SB variant of the ESC only as the PCI/APIC Control Register at index 0x70[3], for which leaving access to the configuration space concerned unlocked may have been a requirement for the BIOS to remain compliant with the MP spec. However we only poke at the IMCR register if the APIC mode is used, in which case the PIRQ router is not, so this arrangement is not going to interfere with IMCR access code. The ESC is implemented as a part of the combined southbridge also made of 82375EB/82375SB PCI-EISA Bridge (PCEB) and does itself appear in the PCI configuration space. Use the PCEB's device identification then for determining the presence of the ESC. References: [1] "82374EB/82374SB EISA System Component (ESC)", Intel Corporation, Order Number: 290476-004, March 1996, Section 3.1.12 "PIRQ[0:3]#--PIRQ Route Control Registers", pp. 44-45 [2] same, Section 3.1.1 "ESCID--ESC ID Register", p. 36 [3] same, Section 3.1.17 "PAC--PCI/APIC Control Register", p. 47 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107192023450.9461@angie.orcam.me.uk commit 1ce849c755342b236fc6236dfe39dbbf536b64b6 Author: Maciej W. Rozycki Date: Tue Jul 20 05:27:54 2021 +0200 x86/PCI: Add support for the ALi M1487 (IBC) PIRQ router The ALi M1487 ISA Bus Controller (IBC), a part of the ALi FinALi 486 chipset, implements PCI interrupt steering with a PIRQ router[1] in the form of four 4-bit mappings, spread across two PCI INTx Routing Table Mapping Registers, available in the port I/O space accessible indirectly via the index/data register pair at 0x22/0x23, located at indices 0x42 and 0x43 for the INT1/INT2 and INT3/INT4 lines respectively. Additionally there is a separate PCI INTx Sensitivity Register at index 0x44 in the same port I/O space, whose bits 3:0 select the trigger mode for INT[4:1] lines respectively[2]. Manufacturer's documentation says that this register has to be set consistently with the relevant ELCR register[3]. Add a router-specific hook then and use it to handle this register. Accesses to the port I/O space concerned here need to be unlocked by writing the value of 0xc5 to the Lock Register at index 0x03 beforehand[4]. Do so then and then lock access after use for safety. The IBC is implemented as a peer bridge on the host bus rather than a southbridge on PCI and therefore it does not itself appear in the PCI configuration space. It is complemented by the M1489 Cache-Memory PCI Controller (CMP) host-to-PCI bridge, so use that device's identification for determining the presence of the IBC. References: [1] "M1489/M1487: 486 PCI Chip Set", Version 1.2, Acer Laboratories Inc., July 1997, Section 4: "Configuration Registers", pp. 76-77 [2] same, p. 77 [3] same, Section 5: "M1489/M1487 Software Programming Guide", pp. 99-100 [4] same, Section 4: "Configuration Registers", p. 37 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107191702020.9461@angie.orcam.me.uk commit fb6a0408eac284688d5262519cbb3be0250e4caf Author: Maciej W. Rozycki Date: Tue Jul 20 05:27:49 2021 +0200 x86: Add support for 0x22/0x23 port I/O configuration space Define macros and accessors for the configuration space addressed indirectly with an index register and a data register at the port I/O locations of 0x22 and 0x23 respectively. This space is defined by the Intel MultiProcessor Specification for the IMCR register used to switch between the PIC and the APIC mode[1], by Cyrix processors for their configuration[2][3], and also some chipsets. Given the lack of atomicity with the indirect addressing a spinlock is required to protect accesses, although for Cyrix processors it is enough if accesses are executed with interrupts locally disabled, because the registers are local to the accessing CPU, and IMCR is only ever poked at by the BSP and early enough for interrupts not to have been configured yet. Therefore existing code does not have to change or use the new spinlock and neither it does. Put the spinlock in a library file then, so that it does not get pulled unnecessarily for configurations that do not refer it. Convert Cyrix accessors to wrappers so as to retain the brevity and clarity of the `getCx86' and `setCx86' calls. References: [1] "MultiProcessor Specification", Version 1.4, Intel Corporation, Order Number: 242016-006, May 1997, Section 3.6.2.1 "PIC Mode", pp. 3-7, 3-8 [2] "5x86 Microprocessor", Cyrix Corporation, Order Number: 94192-00, July 1995, Section 2.3.2.4 "Configuration Registers", p. 2-23 [3] "6x86 Processor", Cyrix Corporation, Order Number: 94175-01, March 1996, Section 2.4.4 "6x86 Configuration Registers", p. 2-23 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2107182353140.9461@angie.orcam.me.uk commit 6977cc89c87506ff17e6c05f0e37f46752256e82 Author: Christophe JAILLET Date: Fri Aug 6 11:15:13 2021 +0200 drm/msm/dsi: Fix some reference counted resource leaks 'of_find_device_by_node()' takes a reference that must be released when not needed anymore. This is expected to be done in 'dsi_destroy()'. However, there are 2 issues in 'dsi_get_phy()'. First, if 'of_find_device_by_node()' succeeds but 'platform_get_drvdata()' returns NULL, 'msm_dsi->phy_dev' will still be NULL, and the reference won't be released in 'dsi_destroy()'. Secondly, as 'of_find_device_by_node()' already takes a reference, there is no need for an additional 'get_device()'. Move the assignment to 'msm_dsi->phy_dev' a few lines above and remove the unneeded 'get_device()' to solve both issues. Fixes: ec31abf6684e ("drm/msm/dsi: Separate PHY to another platform device") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f15bc57648a00e7c99f943903468a04639d50596.1628241097.git.christophe.jaillet@wanadoo.fr Signed-off-by: Rob Clark commit f3a6b02c950a1b9d5c6de9740b98128b45dcd794 Author: Rob Clark Date: Sat Aug 7 09:30:12 2021 -0700 drm/msm: Rework SQE version check This check is really about which SQE firmware, rather than which GPU. Rework to match minimum version based on firmware name, so it doesn't need to be updated when adding additional GPUs using the same fw. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210807163019.379003-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 083cc3a4d451bd9bcfc14f95c0599113f20aeaec Author: Rob Clark Date: Sat Aug 7 09:30:11 2021 -0700 drm/msm: Add adreno_is_a640_family() Combine adreno_is_a640() and adreno_is_a680(). Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210807163019.379003-1-robdclark@gmail.com Signed-off-by: Rob Clark commit b02c96464f443e030be74ddd450c46703fe7ba8c Author: Alexandre Belloni Date: Tue Aug 10 23:20:07 2021 +0200 rtc: move RTC_LIB_KUNIT_TEST to proper location Move RTC_LIB_KUNIT_TEST under RTC_LIB so it is clear in the menu this is part of the RTC subsystem. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210810212008.631359-2-alexandre.belloni@bootlin.com commit 5546e3dfb65a4389e747766ac455a50c3675fb0f Author: Alexandre Belloni Date: Tue Aug 10 23:20:06 2021 +0200 rtc: lib_test: add MODULE_LICENSE As the documentation states, "The exact license information can only be determined via the license information in the corresponding source files." and the SPDX identifier has the proper information. Reported-by: Stephen Rothwell Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210810212008.631359-1-alexandre.belloni@bootlin.com commit 94effcedaa543825ad9c80831450d4fbfa284880 Author: Stafford Horne Date: Thu Aug 5 11:49:36 2021 +0900 openrisc: Fix compiler warnings in setup This was pointed out with the recent name change of or32_early_setup to or1k_early_setup. Investigating the file I found a few other warnings so cleaning them up here. arch/openrisc/kernel/setup.c:220:13: warning: no previous prototype for 'or1k_early_setup' [-Wmissing-prototypes] 220 | void __init or1k_early_setup(void *fdt) | ^~~~~~~~~~~~~~~~ Fix this the missing or1k_early_setup prototype warning by adding an asm/setup.h file to define the prototype. arch/openrisc/kernel/setup.c:246:13: warning: no previous prototype for 'detect_unit_config' [-Wmissing-prototypes] 246 | void __init detect_unit_config(unsigned long upr, unsigned long mask, | ^~~~~~~~~~~~~~~~~~ The function detect_unit_config is not used, just remove it. arch/openrisc/kernel/setup.c:221: warning: Function parameter or member 'fdt' not described in 'or1k_early_setup' Add @fdt docs to the function comment to suppress this warning. Reported-by: kernel test robot Signed-off-by: Stafford Horne Reviewed-by: Randy Dunlap commit dab4b0e8c9a5a4edc406e6fc24030afeb348383d Author: Claudiu Beznea Date: Mon Jul 5 15:15:16 2021 +0300 i2c: at91: remove #define CONFIG_PM Remove #define CONFIG_PM and use __maybe_unused for PM functions and pm_ptr() for PM ops. Signed-off-by: Claudiu Beznea Reviewed-by: Codrin Ciubotariu Signed-off-by: Wolfram Sang commit 9c5b1daa3b24f13b7c517ba616c7a49abd7ab843 Author: Andy Shevchenko Date: Mon Jul 12 17:11:19 2021 +0300 i2c: parport: Switch to use module_parport_driver() Switch to use module_parport_driver() to reduce boilerplate code. Signed-off-by: Andy Shevchenko Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit 92848731c45f4f9c3d9818e6b4ba1b2884002324 Author: Baokun Li Date: Sat Jun 5 14:34:13 2021 +0800 genirq/matrix: Fix kernel doc warnings for irq_matrix_alloc_managed() Describe the arguments correctly. Fixes the following W=1 kernel build warning(s): kernel/irq/matrix.c:287: warning: Function parameter or member 'msk' not described in 'irq_matrix_alloc_managed' kernel/irq/matrix.c:287: warning: Function parameter or member 'mapped_cpu' not described in 'irq_matrix_alloc_managed' kernel/irq/matrix.c:287: warning: Excess function parameter 'cpu' description in 'irq_matrix_alloc_managed' Signed-off-by: Baokun Li Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210605063413.684085-1-libaokun1@huawei.com commit 91cc470e797828d779cd4c1efbe8519bcb358bae Author: Tanner Love Date: Wed Jun 2 14:03:38 2021 -0400 genirq: Change force_irqthreads to a static key With CONFIG_IRQ_FORCED_THREADING=y, testing the boolean force_irqthreads could incur a cache line miss in invoke_softirq() and other places. Replace the test with a static key to avoid the potential cache miss. [ tglx: Dropped the IDE part, removed the export and updated blk-mq ] Suggested-by: Eric Dumazet Signed-off-by: Tanner Love Signed-off-by: Thomas Gleixner Reviewed-by: Eric Dumazet Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20210602180338.3324213-1-tannerlove.kernel@gmail.com commit 60aea76d85ffaf26b5e8de3ff2d98de5339e228e Author: Heiner Kallweit Date: Fri Aug 6 23:14:08 2021 +0200 i2c: i801: Remove not needed debug message If a user is interested in such details he can enable smbus tracing. Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Heiner Kallweit Signed-off-by: Wolfram Sang commit 1a987c69ce2c5a406f7ef3713d3ed74a1af70c56 Author: Heiner Kallweit Date: Fri Aug 6 23:13:29 2021 +0200 i2c: i801: make p2sb_spinlock a mutex p2sb_spinlock is used in i801_add_tco_spt() only, and in process context only. Therefore a mutex is sufficient, and we can make the definition local to i801_add_tco_spt(). Reviewed-by: Jean Delvare Reviewed-by: Mika Westerberg Signed-off-by: Heiner Kallweit Signed-off-by: Wolfram Sang commit 4e60d5dd10cd82014b26a40519b94444547ec95c Author: Heiner Kallweit Date: Fri Aug 6 23:12:18 2021 +0200 i2c: i801: Improve disabling runtime pm Setting the autosuspend delay to a negative value disables runtime pm in a little bit smarter way, because we need no cleanup when removing the driver. Note that this is safe when reloading the driver, because the call to pm_runtime_set_autosuspend_delay() in probe() will reverse the effect. See update_autosuspend() for details. Reviewed-by: Jean Delvare Signed-off-by: Heiner Kallweit Signed-off-by: Wolfram Sang commit ebd0d30cc5e44ed3a6db7683bd357b3eea636e74 Merge: d1a4e0a9576fd 598fe77df855f Author: Jakub Kicinski Date: Tue Aug 10 13:19:16 2021 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Saeed Mahameed says: ==================== pull-request: mlx5-next 2020-08-9 This pulls mlx5-next branch which includes patches already reviewed on net-next and rdma mailing lists. 1) mlx5 single E-Switch FDB for lag 2) IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq 3) Add DCS caps & fields support [1] https://patchwork.kernel.org/project/netdevbpf/cover/20210803231959.26513-1-saeed@kernel.org/ [2] https://patchwork.kernel.org/project/netdevbpf/patch/0e3364dab7e0e4eea5423878b01aa42470be8d36.1626609184.git.leonro@nvidia.com/ [3] https://patchwork.kernel.org/project/netdevbpf/patch/55e1d69bef1fbfa5cf195c0bfcbe35c8019de35e.1624258894.git.leonro@nvidia.com/ * 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Lag, Create shared FDB when in switchdev mode net/mlx5: E-Switch, add logic to enable shared FDB net/mlx5: Lag, move lag destruction to a workqueue net/mlx5: Lag, properly lock eswitch if needed net/mlx5: Add send to vport rules on paired device net/mlx5: E-Switch, Add event callback for representors net/mlx5e: Use shared mappings for restoring from metadata net/mlx5e: Add an option to create a shared mapping net/mlx5: E-Switch, set flow source for send to uplink rule RDMA/mlx5: Add shared FDB support {net, RDMA}/mlx5: Extend send to vport rules RDMA/mlx5: Fill port info based on the relevant eswitch net/mlx5: Lag, add initial logic for shared FDB net/mlx5: Return mdev from eswitch IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq net/mlx5: Add DCS caps & fields support ==================== Link: https://lore.kernel.org/r/20210809202522.316930-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit f847502ad8e3299e7ad256aa0bd7eaf184646117 Author: Ira Weiny Date: Tue Aug 10 11:57:59 2021 -0700 cxl/mem: Account for partitionable space in ram/pmem ranges Memory devices may specify volatile only, persistent only, and partitionable space which when added together result in a total capacity. If Identify Memory Device.Partition Alignment != 0 the device supports partitionable space. This partitionable space can be split between volatile and persistent space. The total volatile and persistent sizes are reported in Get Partition Info. ie active volatile memory = volatile only + partitionable volatile active persistent memory = persistent only + partitionable persistent Define cxl_mem_get_partition(), check for partitionable support, and use cxl_mem_get_partition() if applicable. Reviewed-by: Jonathan Cameron Signed-off-by: Ira Weiny Reported-by: kernel test robot Signed-off-by: Dan Williams commit 55981d3541812234e687062926ff199c83f79a39 Author: Pauli Virtanen Date: Mon Jul 26 21:02:06 2021 +0300 Bluetooth: btusb: check conditions before enabling USB ALT 3 for WBS Some USB BT adapters don't satisfy the MTU requirement mentioned in commit e848dbd364ac ("Bluetooth: btusb: Add support USB ALT 3 for WBS") and have ALT 3 setting that produces no/garbled audio. Some adapters with larger MTU were also reported to have problems with ALT 3. Add a flag and check it and MTU before selecting ALT 3, falling back to ALT 1. Enable the flag for Realtek, restoring the previous behavior for non-Realtek devices. Tested with USB adapters (mtu<72, no/garbled sound with ALT3, ALT1 works) BCM20702A1 0b05:17cb, CSR8510A10 0a12:0001, and (mtu>=72, ALT3 works) RTL8761BU 0bda:8771, Intel AX200 8087:0029 (after disabling ALT6). Also got reports for (mtu>=72, ALT 3 reported to produce bad audio) Intel 8087:0a2b. Signed-off-by: Pauli Virtanen Fixes: e848dbd364ac ("Bluetooth: btusb: Add support USB ALT 3 for WBS") Tested-by: Michał Kępień Tested-by: Jonathan Lampérth Signed-off-by: Luiz Augusto von Dentz commit c4ad8fabd03f76ed3a2a4c8aef6baf6cd4f24542 Author: Jin Yao Date: Mon Aug 9 13:24:57 2021 +0800 perf vendor events: Update metrics for SkyLake Server Update JSON metrics for SkyLake Server. Based on TMA metrics 4.21 at 01.org. https://download.01.org/perfmon/ Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-7-yao.jin@linux.intel.com Signed-off-by: Jin Yao commit d5c0a8d554dfc46e5d03334155f5f656ca10e70c Author: Jin Yao Date: Mon Aug 9 11:03:44 2021 +0800 perf vendor events intel: Update uncore event list for SkyLake Server Update JSON uncore events for SkyLake Server. Based on JSON list v1.24: https://download.01.org/perfmon/SKX/ Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-6-yao.jin@linux.intel.com Signed-off-by: Jin Yao commit b1a1347912a742a4e1fcdc9df6302dd9dd2c3405 Author: Krishna Reddy Date: Tue Aug 10 10:14:01 2021 +0530 iommu/arm-smmu: Fix race condition during iommu_group creation When two devices with same SID are getting probed concurrently through iommu_probe_device(), the iommu_group sometimes is getting allocated more than once as call to arm_smmu_device_group() is not protected for concurrency. Furthermore, it leads to each device holding a different iommu_group and domain pointer, separate IOVA space and only one of the devices' domain is used for translations from IOMMU. This causes accesses from other device to fault or see incorrect translations. Fix this by protecting iommu_group allocation from concurrency in arm_smmu_device_group(). Signed-off-by: Krishna Reddy Signed-off-by: Ashish Mhetre Link: https://lore.kernel.org/r/1628570641-9127-3-git-send-email-amhetre@nvidia.com Signed-off-by: Will Deacon commit 211ff31b3d33b56aa12937e898c9280d07daf0d9 Author: Ashish Mhetre Date: Tue Aug 10 10:14:00 2021 +0530 iommu: Fix race condition during default domain allocation When two devices with same SID are getting probed concurrently through iommu_probe_device(), the iommu_domain sometimes is getting allocated more than once as call to iommu_alloc_default_domain() is not protected for concurrency. Furthermore, it leads to each device holding a different iommu_domain pointer, separate IOVA space and only one of the devices' domain is used for translations from IOMMU. This causes accesses from other device to fault or see incorrect translations. Fix this by protecting iommu_alloc_default_domain() call with group->mutex and let all devices with same SID share same iommu_domain. Signed-off-by: Ashish Mhetre Link: https://lore.kernel.org/r/1628570641-9127-2-git-send-email-amhetre@nvidia.com Signed-off-by: Will Deacon commit 2c72404e950a9e0cf39cedcee9bb34a29b19baf0 Author: Jin Yao Date: Mon Aug 9 10:53:48 2021 +0800 perf vendor events intel: Update core event list for SkyLake Server Update JSON core events for SkyLake Server. Based on JSON list v1.24: https://download.01.org/perfmon/SKX/ Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-5-yao.jin@linux.intel.com Signed-off-by: Jin Yao commit ed97cc6cbb1f440a0a3ab1483c93aff67ebe6f1d Author: Jin Yao Date: Mon Aug 9 13:15:43 2021 +0800 perf vendor events: Update metrics for CascadeLake Server Update JSON metrics for CascadeLake Server. Based on TMA metrics 4.21 at 01.org. https://download.01.org/perfmon/ Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-4-yao.jin@linux.intel.com Signed-off-by: Jin Yao commit ca7d1d1a0b975d3d8aaaeab008a07bb3d3c5ec7e Author: Dai Ngo Date: Fri May 21 15:09:38 2021 -0400 NFSv4.2: remove restriction of copy size for inter-server copy. Currently inter-server copy is allowed only if the copy size is larger than (rsize*14) which is the over-head of the mount operation of the source export. This patch, relying on the delayed unmount feature, removes this restriction since the mount and unmount overhead is now not applicable for every inter-server copy. Signed-off-by: Dai Ngo Signed-off-by: Anna Schumaker commit 9eff97abef057c02a13bb3aa0e4821cd60fd80df Author: Chuck Lever Date: Thu Jul 15 15:52:43 2021 -0400 NFS: Clean up the synopsis of callback process_op() The xdr_stream and rq_arg and rq_res are already accessible via the @rqstp parameter. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 89ef17b6636f2ae3e4e4041f53be7c0118b4b6c1 Author: Chuck Lever Date: Thu Jul 15 15:52:37 2021 -0400 NFS: Extract the xdr_init_encode/decode() calls from decode_compound Clean up: Move the xdr_init_encode() and xdr_init_decode() calls into the dispatcher, just like the NFSD and lockd dispatchers. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c35a810ce59524971c4a3b45faed4d0121e5a305 Author: Chuck Lever Date: Thu Jul 15 15:52:31 2021 -0400 NFS: Remove unused callback void decoder Clean up: The callback RPC dispatcher no longer invokes these call outs, although svc_process_common() relies on seeing a .pc_encode function. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 7d34c96217cf3c2d37ca0a56ca0bc3c3bef1e189 Author: Chuck Lever Date: Thu Jul 15 15:52:25 2021 -0400 NFS: Add a private local dispatcher for NFSv4 callback operations The client's NFSv4 callback service is the only remaining user of svc_generic_dispatch(). Note that the NFSv4 callback service doesn't use the .pc_encode and .pc_decode callouts in any substantial way, so they are removed. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 9082e1d914f8b27114352b1940bbcc7522f682e7 Author: Chuck Lever Date: Thu Jul 15 15:52:19 2021 -0400 SUNRPC: Eliminate the RQ_AUTHERR flag Now that there is an alternate method for returning an auth_stat value, replace the RQ_AUTHERR flag with use of that new method. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5c2465dfd457f3015eebcc3ace50570e1d896aeb Author: Chuck Lever Date: Thu Jul 15 15:52:12 2021 -0400 SUNRPC: Set rq_auth_stat in the pg_authenticate() callout In a few moments, rq_auth_stat will need to be explicitly set to rpc_auth_ok before execution gets to the dispatcher. svc_authenticate() already sets it, but it often gets reset to rpc_autherr_badcred right after that call, even when authentication is successful. Let's ensure that the pg_authenticate callout and svc_set_client() set it properly in every case. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 438623a06bacd69c40c4af633bb09a3bbb9dfc78 Author: Chuck Lever Date: Thu Jul 15 15:52:06 2021 -0400 SUNRPC: Add svc_rqst::rq_auth_stat I'd like to take commit 4532608d71c8 ("SUNRPC: Clean up generic dispatcher code") even further by using only private local SVC dispatchers for all kernel RPC services. This change would enable the removal of the logic that switches between svc_generic_dispatch() and a service's private dispatcher, and simplify the invocation of the service's pc_release method so that humans can visually verify that it is always invoked properly. All that will come later. First, let's provide a better way to return authentication errors from SVC dispatcher functions. Instead of overloading the dispatch method's *statp argument, add a field to struct svc_rqst that can hold an error value. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c1736b9008cb06a95231410145d0b9d2709ec86f Author: Thomas Zimmermann Date: Fri Jun 25 15:50:33 2021 +0200 drm: IRQ midlayer is now legacy Hide the DRM midlayer behind CONFIG_DRM_LEGACY, make functions use the prefix drm_legacy_, and move declarations to drm_legacy.h. In struct drm_device, move the fields irq and irq_enabled behind CONFIG_DRM_LEGACY. All callers have been updated. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-15-tzimmermann@suse.de commit 0b05dd6b453da1479f635c4e96a962837c8a389b Author: Thomas Zimmermann Date: Tue Aug 3 11:07:03 2021 +0200 drm: Remove unused devm_drm_irq_install() DRM IRQ helpers will become legacy. The function devm_drm_irq_install() is unused and won't be required later. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-14-tzimmermann@suse.de commit 5226711e6c413ed069788f1e3f71def9d8d839d6 Author: Thomas Zimmermann Date: Tue Aug 3 11:07:02 2021 +0200 drm/vc4: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort initialization in this case. The DRM IRQ midlayer does not handle this case correctly. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-13-tzimmermann@suse.de commit b6366814fa77cfbc2a816614f7a981a9d1eadf8d Author: Thomas Zimmermann Date: Tue Aug 3 11:07:01 2021 +0200 drm/tilcdc: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort initialization in this case. The DRM IRQ midlayer does not handle this case correctly. For most drivers, only the DRM IRQ helpers use irq_enabled from struct drm_device. Tilcdc also uses irq_enabled to make its error rollback work correctly. As the field will become legacy, duplicated the state in the driver's local private structure. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-12-tzimmermann@suse.de commit 5518572dce7d0f54a15e1dadeb647e498b9f9844 Author: Thomas Zimmermann Date: Tue Aug 3 11:07:00 2021 +0200 drm/tidss: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Reviewed-by: Tomi Valkeinen Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-11-tzimmermann@suse.de commit 14c615d82872f56d266c113f4e7b83790ea697ff Author: Thomas Zimmermann Date: Tue Aug 3 11:06:59 2021 +0200 drm/radeon: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-10-tzimmermann@suse.de commit 5fc40f41c137cceea8d256d842079f7ee1410a60 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:58 2021 +0200 drm/mxsfb: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort initialization in this case. The DRM IRQ midlayer does not handle this case correctly. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-9-tzimmermann@suse.de commit f026e431cf861197dc03217d1920b38b80b31dd9 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:57 2021 +0200 drm/msm: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Acked-by: Rob Clark Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-8-tzimmermann@suse.de commit 58889cdc39cf456dc097012364a30e84602ec97d Author: Thomas Zimmermann Date: Tue Aug 3 11:06:56 2021 +0200 drm/kmb: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Tested-by: Anitha Chrisanthus Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-7-tzimmermann@suse.de commit 229085070036dfa92f8c9295697c33c8ae777b43 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:55 2021 +0200 drm/gma500: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-6-tzimmermann@suse.de commit 03ac16e584e496230903ba20f2b4bbfd942a16b4 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:54 2021 +0200 drm/fsl-dcu: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-5-tzimmermann@suse.de commit 4009cc7ad6b5f8a260e46cdaabb3763f2e6ca2e0 Author: Theodore Ts'o Date: Tue Aug 10 14:02:33 2021 -0400 jbd2: clean up two gcc -Wall warnings in recovery.c Fix a signed vs unsigned and a void * pointer arithmetic warning. This cleanup is also in e2fsprogs commit aec460db9a93 ("e2fsck: clean up two gcc -Wall warnings in recovery.c"). Signed-off-by: Theodore Ts'o commit 96fe584f9967287f8833c85a7d952af7df6d6d07 Author: Jin Yao Date: Mon Aug 9 09:36:12 2021 +0800 perf vendor events intel: Update uncore event list for CascadeLake Server Update JSON uncore events for CascadeLake Server. Based on JSON list v1.11: https://download.01.org/perfmon/CLX/ Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-3-yao.jin@linux.intel.com Signed-off-by: Jin Yao commit e0ddfd8d5018f4cb203a7c41906c16e841a124a8 Author: Jin Yao Date: Mon Aug 9 09:25:02 2021 +0800 perf vendor events intel: Update core event list for CascadeLake Server Update JSON core events for CascadeLake Server. Based on JSON list v1.11: https://download.01.org/perfmon/CLX/ Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Linux-kernel@vger.kernel.org Cc: Peter Zijlstra Link: https //lore.kernel.org/r/20210810020508.31261-2-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 889652839e55723cc9fa769928b9a87d9025f350 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:53 2021 +0200 drm/atmel-hlcdc: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. v2: * use managed release via devm_request_irq() (Sam) * drop extra test for irq != IRQ_NOTCONNECTED (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Tested-by: Dan Sneddon Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-4-tzimmermann@suse.de commit b770efc4608d24fb446b94e1087d9989425dd39b Merge: 99c0974ffeeab d3dd95a8853f1 cba712beebf32 f916d77eedfeb fed31a4dd3adb ed4fa2442e87b 06ca91448f322 Author: Paul E. McKenney Date: Tue Aug 10 11:00:53 2021 -0700 Merge branches 'doc.2021.07.20c', 'fixes.2021.08.06a', 'nocb.2021.07.20c', 'nolibc.2021.07.20c', 'tasks.2021.07.20c', 'torture.2021.07.27a' and 'torturescript.2021.07.27a' into HEAD doc.2021.07.20c: Documentation updates. fixes.2021.08.06a: Miscellaneous fixes. nocb.2021.07.20c: Callback-offloading (NOCB CPU) updates. nolibc.2021.07.20c: Tiny userspace library updates. tasks.2021.07.20c: Tasks RCU updates. torture.2021.07.27a: In-kernel torture-test updates. torturescript.2021.07.27a: Torture-test scripting updates. commit 71eba7bd262450072f58f553f10073ce85629d46 Author: Thomas Zimmermann Date: Tue Aug 3 11:06:52 2021 +0200 drm/arm/hdlcd: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort initialization in this case. The DRM IRQ midlayer does not handle this case correctly. v2: * name struct drm_device variables 'drm' (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-3-tzimmermann@suse.de commit 450d61794d9c1f8839f81d8daf3466b1b52a783a Author: Thomas Zimmermann Date: Tue Aug 3 11:06:51 2021 +0200 drm/amdgpu: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. The interrupt number returned by pci_msi_vector() is now stored in struct amdgpu_irq. Calls to pci_msi_vector() can fail and return a negative errno code. Abort initlaizaton in thi case. The DRM IRQ midlayer does not handle this correctly. Signed-off-by: Thomas Zimmermann Reviewed-by: Alex Deucher Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-2-tzimmermann@suse.de commit ed4fa2442e87bf9143d608473df117589e4bfc70 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:18 2021 +0200 torture: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Davidlohr Bueso Cc: "Paul E. McKenney" Cc: Josh Triplett Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Paul E. McKenney commit 8ee465a181d0100533c6039bbbcea5517a049aec Author: John Garry Date: Thu Jul 29 21:56:26 2021 +0800 perf test: Add pmu-events sys event support Add support for system events, along with core and uncore events. Support for a sample PMU is also added. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-12-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit d3dd95a8853f1d588e38e9d9d7c8cc2da412cc36 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:14 2021 +0200 rcu: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel Fernandes Cc: rcu@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Paul E. McKenney commit 5abd3988b0382d31a35600732a46fa7f90740658 Author: John Garry Date: Thu Jul 29 21:56:25 2021 +0800 perf jevents: Print SoC name per system event table Print the SoC name per system event table, which will allow the test SoC be identified by the pmu-events test. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-11-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e199f47f159d72f12b91d2b33cee78f95ff8ff59 Author: John Garry Date: Thu Jul 29 21:56:24 2021 +0800 perf pmu: Make pmu_add_sys_aliases() public Function pmu_add_sys_aliases() will be required for the PMU events test for system events aliases, so make it public. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-10-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 6a86657fbc245119190f3f6a477f2331e882af0c Author: John Garry Date: Thu Jul 29 21:56:23 2021 +0800 perf test: Add more pmu-events uncore aliases Add more events to cover the scenarios fixed and also inadvertently broken by commit c47a5599eda324ba ("perf tools: Fix pattern matching for same substring in different PMU type") Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-9-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit c3e9434c9852c09cd1756b05d1474b7c84452819 Merge: 32bdc01988413 7b9cae027ba3a Author: Paolo Bonzini Date: Tue Aug 10 13:45:26 2021 -0400 Merge branch 'kvm-vmx-secctl' into HEAD Merge common topic branch for 5.14-rc6 and 5.15 merge window. commit 5a65c0c8f6fd5e0708e52131940f2306a3be4e55 Author: John Garry Date: Thu Jul 29 21:56:22 2021 +0800 perf test: Re-add pmu-event uncore PMU alias test Add support to match aliases for uncore PMUs. Since we cannot rely on the PMUs being present on the host system, use fake PMUs. The following conditions in the test are ensures: - Expected count of aliases created - All aliases can be matched to an expected alias in perf_pmu_test_pmu.aliases This will catch the condition fixed in commit c47a5599eda3 ("perf tools: Fix pattern matching for same substring in different PMU type"), where excess events were created for a PMU. It will also fix the scenario inadvertently broken there, where no aliases were created for aliases with multiple tokens. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-8-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 5806099a2e2ab36fa7a7705faaf3d7296b701e67 Author: John Garry Date: Thu Jul 29 21:56:21 2021 +0800 perf pmu: Check .is_uncore field in pmu_add_cpu_aliases_map() Calling pmu_is_uncore() for fake PMUs does not work, as it checks sysfs for the PMU details (which won't exist). Check .is_uncore field instead, which makes sense anyway. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-7-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 3bc4526b30f14b70280ec2a7a02fbfdab2ebdb0a Author: John Garry Date: Thu Jul 29 21:56:20 2021 +0800 perf test: Test pmu-events core aliases separately The current method to test uncore event aliasing is limited, as it relies on the uncore PMU being present in the host system to test. As such, breakages of uncore PMU aliases goes unnoticed. To make this more robust, a new method of testing uncore PMUs with fake PMUs will be used in future. This will be separate to testing core PMU aliases. So make the current test function core PMU only. Uncore PMU alias support will be re-added later. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-6-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e1dee2c1de2b4dd00eb44004a4bda6326ed07b59 Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:10 2021 +0800 Bluetooth: fix repeated calls to sco_sock_kill In commit 4e1a720d0312 ("Bluetooth: avoid killing an already killed socket"), a check was added to sco_sock_kill to skip killing a socket if the SOCK_DEAD flag was set. This was done after a trace for a use-after-free bug showed that the same sock pointer was being killed twice. Unfortunately, this check prevents sco_sock_kill from running on any socket. sco_sock_kill kills a socket only if it's zapped and orphaned, however sock_orphan announces that the socket is dead before detaching it. i.e., orphaned sockets have the SOCK_DEAD flag set. To fix this, we remove the check for SOCK_DEAD, and avoid repeated calls to sco_sock_kill by removing incorrect calls in: 1. sco_sock_timeout. The socket should not be killed on timeout as further processing is expected to be done. For example, sco_sock_connect sets the timer then waits for the socket to be connected or for an error to be returned. 2. sco_conn_del. This function should clean up resources for the connection, but the socket itself should be cleaned up in sco_sock_release. 3. sco_sock_close. Calls to sco_sock_close in sco_sock_cleanup_listen and sco_sock_release are followed by sco_sock_kill. Hence the duplicated call should be removed. Fixes: 4e1a720d0312 ("Bluetooth: avoid killing an already killed socket") Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit b7ce436a5d798bc59e71797952566608a4b4626b Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:09 2021 +0800 Bluetooth: switch to lock_sock in RFCOMM Other than rfcomm_sk_state_change and rfcomm_connect_ind, functions in RFCOMM use lock_sock to lock the socket. Since bh_lock_sock and spin_lock_bh do not provide synchronization with lock_sock, these calls should be changed to lock_sock. This is now safe to do because packet processing is now done in a workqueue instead of a tasklet, so bh_lock_sock/spin_lock_bh are no longer necessary to synchronise between user contexts and SOFTIRQ processing. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit 3f2c89fb465f63fe14da804a8afcd7ac6776508e Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:08 2021 +0800 Bluetooth: serialize calls to sco_sock_{set,clear}_timer Currently, calls to sco_sock_set_timer are made under the locked socket, but this does not apply to all calls to sco_sock_clear_timer. Both sco_sock_{set,clear}_timer should be serialized by lock_sock to prevent unexpected concurrent clearing/setting of timers. Additionally, since sco_pi(sk)->conn is only cleared under the locked socket, this change allows us to avoid races between sco_sock_clear_timer and the call to kfree(conn) in sco_conn_del. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit 27c24fda62b601d6f9ca5e992502578c4310876f Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:07 2021 +0800 Bluetooth: switch to lock_sock in SCO Since sco_sock_timeout is now scheduled using delayed work, it is no longer run in SOFTIRQ context. Hence bh_lock_sock is no longer necessary in SCO to synchronise between user contexts and SOFTIRQ processing. As such, calls to bh_lock_sock should be replaced with lock_sock to synchronize with other concurrent processes that use lock_sock. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit 734bc5ff783115aa3164f4e9dd5967ae78e0a8ab Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:06 2021 +0800 Bluetooth: avoid circular locks in sco_sock_connect In a future patch, calls to bh_lock_sock in sco.c should be replaced by lock_sock now that none of the functions are run in IRQ context. However, doing so results in a circular locking dependency: ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc4-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/14867 is trying to acquire lock: ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1613 [inline] ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191 but task is already holding lock: ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1497 [inline] ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1608 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (hci_cb_list_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:959 [inline] __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 hci_connect_cfm include/net/bluetooth/hci_core.h:1482 [inline] hci_remote_features_evt net/bluetooth/hci_event.c:3263 [inline] hci_event_packet+0x2f4d/0x7c50 net/bluetooth/hci_event.c:6240 hci_rx_work+0x4f8/0xd30 net/bluetooth/hci_core.c:5122 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:959 [inline] __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 sco_connect net/bluetooth/sco.c:245 [inline] sco_sock_connect+0x227/0xa10 net/bluetooth/sco.c:601 __sys_connect_file+0x155/0x1a0 net/socket.c:1879 __sys_connect+0x161/0x190 net/socket.c:1896 __do_sys_connect net/socket.c:1906 [inline] __se_sys_connect net/socket.c:1903 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:1903 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 -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 lock_sock_nested+0xca/0x120 net/core/sock.c:3170 lock_sock include/net/sock.h:1613 [inline] sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1202 hci_disconn_cfm include/net/bluetooth/hci_core.h:1500 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x528/0x1130 net/bluetooth/hci_core.c:1778 hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4015 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbd4/0x2a60 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x47f/0x2160 kernel/signal.c:2808 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:288 other info that might help us debug this: Chain exists of: sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(hci_cb_list_lock); lock(&hdev->lock); lock(hci_cb_list_lock); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** The issue is that the lock hierarchy should go from &hdev->lock --> hci_cb_list_lock --> sk_lock-AF_BLUETOOTH-BTPROTO_SCO. For example, one such call trace is: hci_dev_do_close(): hci_dev_lock(); hci_conn_hash_flush(): hci_disconn_cfm(): mutex_lock(&hci_cb_list_lock); sco_disconn_cfm(): sco_conn_del(): lock_sock(sk); However, in sco_sock_connect, we call lock_sock before calling hci_dev_lock inside sco_connect, thus inverting the lock hierarchy. We fix this by pulling the call to hci_dev_lock out from sco_connect. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit ba316be1b6a00db7126ed9a39f9bee434a508043 Author: Desmond Cheong Zhi Xi Date: Tue Aug 10 12:14:05 2021 +0800 Bluetooth: schedule SCO timeouts with delayed_work struct sock.sk_timer should be used as a sock cleanup timer. However, SCO uses it to implement sock timeouts. This causes issues because struct sock.sk_timer's callback is run in an IRQ context, and the timer callback function sco_sock_timeout takes a spin lock on the socket. However, other functions such as sco_conn_del and sco_conn_ready take the spin lock with interrupts enabled. This inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} lock usage could lead to deadlocks as reported by Syzbot [1]: CPU0 ---- lock(slock-AF_BLUETOOTH-BTPROTO_SCO); lock(slock-AF_BLUETOOTH-BTPROTO_SCO); To fix this, we use delayed work to implement SCO sock timouts instead. This allows us to avoid taking the spin lock on the socket in an IRQ context, and corrects the misuse of struct sock.sk_timer. As a note, cancel_delayed_work is used instead of cancel_delayed_work_sync in sco_sock_set_timer and sco_sock_clear_timer to avoid a deadlock. In the future, the call to bh_lock_sock inside sco_sock_timeout should be changed to lock_sock to synchronize with other functions using lock_sock. However, since sco_sock_set_timer and sco_sock_clear_timer are sometimes called under the locked socket (in sco_connect and __sco_sock_close), cancel_delayed_work_sync might cause them to sleep until an sco_sock_timeout that has started finishes running. But sco_sock_timeout would also sleep until it can grab the lock_sock. Using cancel_delayed_work is fine because sco_sock_timeout does not change from run to run, hence there is no functional difference between: 1. waiting for a timeout to finish running before scheduling another timeout 2. scheduling another timeout while a timeout is running. Link: https://syzkaller.appspot.com/bug?id=9089d89de0502e120f234ca0fc8a703f7368b31e [1] Reported-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com Tested-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Luiz Augusto von Dentz commit e386acd79017952ba032aad60e8307befc5aa378 Author: John Garry Date: Thu Jul 29 21:56:19 2021 +0800 perf test: Factor out pmu-events alias comparison Factor out alias test which will be used in multiple places. Also test missing fields. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-5-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit c81e823ff8667f19d2b6ee0ab0e919e3043abd36 Author: John Garry Date: Thu Jul 29 21:56:18 2021 +0800 perf test: Declare pmu-events test events separately Currently all test events are put into arrays of test events. Create pointer arrays of test events instead, so the test events may be referenced later for tighter alias verification. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-4-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 00d43995f0dd7a25961b87f953474d34043d4d4e Author: Tushar Sugandhi Date: Mon Jul 12 17:49:04 2021 -0700 dm: add documentation for IMA measurement support To interpret various DM target measurement data in IMA logs, a separate documentation page is needed under Documentation/admin-guide/device-mapper. Add documentation to help system administrators and attestation client/server component owners to interpret the measurement data generated by various DM targets, on various device/table state changes. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 8ec456629d0bf051e41ef2c87a60755f941dd11c Author: Tushar Sugandhi Date: Mon Jul 12 17:49:03 2021 -0700 dm: update target status functions to support IMA measurement For device mapper targets to take advantage of IMA's measurement capabilities, the status functions for the individual targets need to be updated to handle the status_type_t case for value STATUSTYPE_IMA. Update status functions for the following target types, to log their respective attributes to be measured using IMA. 01. cache 02. crypt 03. integrity 04. linear 05. mirror 06. multipath 07. raid 08. snapshot 09. striped 10. verity For rest of the targets, handle the STATUSTYPE_IMA case by setting the measurement buffer to NULL. For IMA to measure the data on a given system, the IMA policy on the system needs to be updated to have the following line, and the system needs to be restarted for the measurements to take effect. /etc/ima/ima-policy measure func=CRITICAL_DATA label=device-mapper template=ima-buf The measurements will be reflected in the IMA logs, which are located at: /sys/kernel/security/integrity/ima/ascii_runtime_measurements /sys/kernel/security/integrity/ima/binary_runtime_measurements These IMA logs can later be consumed by various attestation clients running on the system, and send them to external services for attesting the system. The DM target data measured by IMA subsystem can alternatively be queried from userspace by setting DM_IMA_MEASUREMENT_FLAG with DM_TABLE_STATUS_CMD. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 7d1d1df8ce31491edda5effb216450aad8f05c0d Author: Tushar Sugandhi Date: Mon Jul 12 17:49:02 2021 -0700 dm ima: measure data on device rename A given block device is identified by it's name and UUID. However, both these parameters can be renamed. For an external attestation service to correctly attest a given device, it needs to keep track of these rename events. Update the device data with the new values for IMA measurements. Measure both old and new device name/UUID parameters in the same IMA measurement event, so that the old and the new values can be connected later. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 99169b93838aa4b45dfed7163bd3302f1b375238 Author: Tushar Sugandhi Date: Mon Jul 12 17:49:01 2021 -0700 dm ima: measure data on table clear For a given block device, an inactive table slot contains the parameters to configure the device with. The inactive table can be cleared multiple times, accidentally or maliciously, which may impact the functionality of the device, and compromise the system. Therefore it is important to measure and log the event when a table is cleared. Measure device parameters, and table hashes when the inactive table slot is cleared. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 84010e519f95c863728e4b1d73cf93cda41ac00e Author: Tushar Sugandhi Date: Mon Jul 12 17:49:00 2021 -0700 dm ima: measure data on device remove Presence of an active block-device, configured with expected parameters, is important for an external attestation service to determine if a system meets the attestation requirements. Therefore it is important for DM to measure the device remove events. Measure device parameters and table hashes when the device is removed, using either remove or remove_all. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 8eb6fab402e23ae5de216c327fcd0dd6b54e135d Author: Tushar Sugandhi Date: Mon Jul 12 17:48:59 2021 -0700 dm ima: measure data on device resume A given block device can load a table multiple times, with different input parameters, before eventually resuming it. Further, a device may be suspended and then resumed. The device may never resume after a table-load. Because of the above valid scenarios for a given device, it is important to measure and log the device resume event using IMA. Also, if the table is large, measuring it in clear-text each time the device changes state, will unnecessarily increase the size of IMA log. Since the table clear-text is already measured during table-load event, measuring the hash during resume should be sufficient to validate the table contents. Measure the device parameters, and hash of the active table, when the device is resumed. Signed-off-by: Tushar Sugandhi Signed-off-by: Mike Snitzer commit 91ccbbac1747eea155632a1c6bb100052309b215 Author: Tushar Sugandhi Date: Mon Jul 12 17:48:58 2021 -0700 dm ima: measure data on table load DM configures a block device with various target specific attributes passed to it as a table. DM loads the table, and calls each target’s respective constructors with the attributes as input parameters. Some of these attributes are critical to ensure the device meets certain security bar. Thus, IMA should measure these attributes, to ensure they are not tampered with, during the lifetime of the device. So that the external services can have high confidence in the configuration of the block-devices on a given system. Some devices may have large tables. And a given device may change its state (table-load, suspend, resume, rename, remove, table-clear etc.) many times. Measuring these attributes each time when the device changes its state will significantly increase the size of the IMA logs. Further, once configured, these attributes are not expected to change unless a new table is loaded, or a device is removed and recreated. Therefore the clear-text of the attributes should only be measured during table load, and the hash of the active/inactive table should be measured for the remaining device state changes. Export IMA function ima_measure_critical_data() to allow measurement of DM device parameters, as well as target specific attributes, during table load. Compute the hash of the inactive table and store it for measurements during future state change. If a load is called multiple times, update the inactive table hash with the hash of the latest populated table. So that the correct inactive table hash is measured when the device transitions to different states like resume, remove, rename, etc. Signed-off-by: Tushar Sugandhi Signed-off-by: Colin Ian King # leak fix Signed-off-by: Mike Snitzer commit e3a35d03407cb3ef9488835aa861e07b45638d0b Author: Mikulas Patocka Date: Tue Jul 27 09:42:21 2021 -0400 dm writecache: add event counters Add 10 counters for various events (hit, miss, etc) and export them in the status line (accessed from userspace with "dmsetup status"). Also add a message "clear_stats" that resets these counters. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit df699cc16ea5ef93a917676dcdd4376e02860ad5 Author: Mikulas Patocka Date: Tue Jul 27 09:45:13 2021 -0400 dm writecache: report invalid return from writecache_map helpers If some "writecache_map_*" function returns invalid state, it is a bug. So, we should report it and not fail silently. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 15cb6f39dbaf391dd3b70389c2882df998d5189a Author: Mike Snitzer Date: Mon Jul 12 21:21:34 2021 -0400 dm writecache: further writecache_map() cleanup Factor out writecache_map_flush() and writecache_map_discard() from writecache_map(). Also eliminate the various goto labels in writecache_map(). Signed-off-by: Mike Snitzer commit 4d020b3a290707b19a3974fe8bc356f0b01b6928 Author: Mike Snitzer Date: Mon Jul 12 16:58:49 2021 -0400 dm writecache: factor out writecache_map_remap_origin() Signed-off-by: Mike Snitzer commit cdd4d7832d51e0414472eb2863b294b783597e5e Author: Mike Snitzer Date: Mon Jul 12 16:47:15 2021 -0400 dm writecache: split up writecache_map() to improve code readability writecache_map() has grown too large and can be confusing to read given all the goto statements. Signed-off-by: Mike Snitzer commit 390add0cc9f4d7fda89cf3db7651717e82cf0afc Author: Theodore Ts'o Date: Tue Aug 10 12:55:51 2021 -0400 jbd2: fix clang warning in recovery.c Remove unused variable store which was never used. This fix is also in e2fsprogs commit 99a2294f85f0 ("e2fsck: value stored to err is never read"). Signed-off-by: Lukas Czerner Signed-off-by: Theodore Ts'o commit ebca71a8c96f0af2ba482489ecc64d88979cd825 Author: Dongli Zhang Date: Thu Apr 8 22:53:16 2021 -0700 cpu/hotplug: Add debug printks for hotplug callback failures CPU hotplug callbacks can fail and cause a rollback to the previous state. These failures are silent and therefore hard to debug. Add pr_debug() to the up and down paths which provide information about the error code, the CPU and the failed state. The debug printks can be enabled via kernel command line or sysfs. [ tglx: Adopt to current mainline, massage printk and changelog ] Signed-off-by: Dongli Zhang Signed-off-by: Thomas Gleixner Reviewed-by: Qais Yousef Link: https://lore.kernel.org/r/20210409055316.1709-1-dongli.zhang@oracle.com commit 1782dc87b2edcf3a6c350ead748a8941b5835975 Author: YueHaibing Date: Thu May 27 22:11:05 2021 +0800 cpu/hotplug: 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: YueHaibing Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210527141105.2312-1-yuehaibing@huawei.com commit 11bc021d1fbaaa1a6e7b92d6631faa875dd40b7d Author: Randy Dunlap Date: Mon Aug 9 15:38:25 2021 -0700 cpu/hotplug: Eliminate all kernel-doc warnings kernel/cpu.c:57: warning: cannot understand function prototype: 'struct cpuhp_cpu_state ' kernel/cpu.c:115: warning: cannot understand function prototype: 'struct cpuhp_step ' kernel/cpu.c:146: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * cpuhp_invoke_callback _ Invoke the callbacks for a given state kernel/cpu.c:75: warning: Function parameter or member 'fail' not described in 'cpuhp_cpu_state' kernel/cpu.c:75: warning: Function parameter or member 'cpu' not described in 'cpuhp_cpu_state' kernel/cpu.c:75: warning: Function parameter or member 'node' not described in 'cpuhp_cpu_state' kernel/cpu.c:75: warning: Function parameter or member 'last' not described in 'cpuhp_cpu_state' kernel/cpu.c:130: warning: Function parameter or member 'list' not described in 'cpuhp_step' kernel/cpu.c:130: warning: Function parameter or member 'multi_instance' not described in 'cpuhp_step' kernel/cpu.c:158: warning: No description found for return value of 'cpuhp_invoke_callback' kernel/cpu.c:1188: warning: No description found for return value of 'cpu_device_down' kernel/cpu.c:1400: warning: No description found for return value of 'cpu_device_up' kernel/cpu.c:1425: warning: No description found for return value of 'bringup_hibernate_cpu' Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210809223825.24512-1-rdunlap@infradead.org commit ed3cd1da674034c4800abfc48c26f2742d5df17e Author: Baokun Li Date: Sat Jun 5 14:30:03 2021 +0800 cpu/hotplug: Fix kernel doc warnings for __cpuhp_setup_state_cpuslocked() Fixes the following W=1 kernel build warning(s): kernel/cpu.c:1949: warning: Function parameter or member 'name' not described in '__cpuhp_setup_state_cpuslocked' Signed-off-by: Baokun Li Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210605063003.681049-1-libaokun1@huawei.com commit c91eb2837310a4e8490fb712598aa7d7148e6d7f Author: John Garry Date: Fri May 21 16:28:09 2021 +0800 cpu/hotplug: Fix comment typo /s/reatdown/teardown/ Signed-off-by: John Garry Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/1621585689-177398-1-git-send-email-john.garry@huawei.com commit 1e7f7fbcd40c69d23e3fe641ead9f3dc128fa8aa Author: Thomas Gleixner Date: Tue Jul 13 15:39:55 2021 +0200 hrtimer: Avoid more SMP function calls in clock_was_set() By unconditionally updating the offsets there are more indicators whether the SMP function calls on clock_was_set() can be avoided: - When the offset update already happened on the remote CPU then the remote update attempt will yield the same seqeuence number and no IPI is required. - When the remote CPU is currently handling hrtimer_interrupt(). In that case the remote CPU will reevaluate the timer bases before reprogramming anyway, so nothing to do. - After updating it can be checked whether the first expiring timer in the affected clock bases moves before the first expiring (softirq) timer of the CPU. If that's not the case then sending the IPI is not required. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.887322464@linutronix.de commit 81d741d3460ca422843ce0ec8351083f259c6166 Author: Marcelo Tosatti Date: Tue Jul 13 15:39:54 2021 +0200 hrtimer: Avoid unnecessary SMP function calls in clock_was_set() Setting of clocks triggers an unconditional SMP function call on all online CPUs to reprogram the clock event device. However, only some clocks have their offsets updated and therefore potentially require a reprogram. That's CLOCK_REALTIME and CLOCK_TAI and in the case of resume (delayed sleep time injection) also CLOCK_BOOTTIME. Instead of sending an IPI unconditionally, check each per CPU hrtimer base whether it has active timers in the affected clock bases which are indicated by the caller in the @bases argument of clock_was_set(). If that's not the case, skip the IPI and update the offsets remotely which ensures that any subsequently armed timers on the affected clocks are evaluated with the correct offsets. [ tglx: Adopted to the new bases argument, removed the softirq_active check, added comment, fixed up stale comment ] Signed-off-by: Marcelo Tosatti Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.787536542@linutronix.de commit 17a1b8826b451c80e7999a7c68e06b70579b2b8f Author: Thomas Gleixner Date: Tue Jul 13 15:39:53 2021 +0200 hrtimer: Add bases argument to clock_was_set() clock_was_set() unconditionaly invokes retrigger_next_event() on all online CPUs. This was necessary because that mechanism was also used for resume from suspend to idle which is not longer the case. The bases arguments allows the callers of clock_was_set() to hand in a mask which tells clock_was_set() which of the hrtimer clock bases are affected by the clock setting. This mask will be used in the next step to check whether a CPU base has timers queued on a clock base affected by the event and avoid the SMP function call if there are none. Add a @bases argument, provide defines for the active bases masking and fixup all callsites. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.691083465@linutronix.de commit 1b267793f4fd9a089ea8558f3b6698186b9a3214 Author: Thomas Gleixner Date: Tue Jul 13 15:39:52 2021 +0200 time/timekeeping: Avoid invoking clock_was_set() twice do_adjtimex() might end up scheduling a delayed clock_was_set() via timekeeping_advance() and then invoke clock_was_set() directly which is pointless. Make timekeeping_advance() return whether an invocation of clock_was_set() is required and handle it at the call sites which allows do_adjtimex() to issue a single direct call if required. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.580966888@linutronix.de commit a761a67f591a8c7476c30bb20ed0f09fdfb1a704 Author: Thomas Gleixner Date: Tue Jul 13 15:39:51 2021 +0200 timekeeping: Distangle resume and clock-was-set events Resuming timekeeping is a clock-was-set event and uses the clock-was-set notification mechanism. This is in the way of making the clock-was-set update for hrtimers selective so unnecessary IPIs are avoided when a CPU base does not have timers queued which are affected by the clock setting. Distangle it by invoking hrtimer_resume() on each unfreezing CPU and invoke the new timerfd_resume() function from timekeeping_resume() which is the only place where this is needed. Rename hrtimer_resume() to hrtimer_resume_local() to reflect the change. With this the clock_was_set*() functions are not longer required to IPI all CPUs unconditionally and can get some smarts to avoid them. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.488853478@linutronix.de commit 66f7b0c8aadd2785fc29f2c71477ebc16f4e38cc Author: Thomas Gleixner Date: Tue Jul 13 15:39:50 2021 +0200 timerfd: Provide timerfd_resume() Resuming timekeeping is a clock-was-set event and uses the clock-was-set notification mechanism. This is in the way of making the clock-was-set update for hrtimers selective so unnecessary IPIs are avoided when a CPU base does not have timers queued which are affected by the clock setting. Provide a seperate timerfd_resume() interface so the resume logic and the clock-was-set mechanism can be distangled in the core code. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.395287410@linutronix.de commit e71a4153b7c256ec103e79875398553808aeffd2 Author: Thomas Gleixner Date: Tue Jul 13 15:39:49 2021 +0200 hrtimer: Force clock_was_set() handling for the HIGHRES=n, NOHZ=y case When CONFIG_HIGH_RES_TIMERS is disabled, but NOHZ is enabled then clock_was_set() is not doing anything. With HIGHRES=n the kernel relies on the periodic tick to update the clock offsets, but when NOHZ is enabled and active then CPUs which are in a deep idle sleep do not have a periodic tick which means the expiry of timers affected by clock_was_set() can be arbitrarily delayed up to the point where the CPUs are brought out of idle again. Make the clock_was_set() logic unconditionaly available so that idle CPUs are kicked out of idle to handle the update. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.288697903@linutronix.de commit 8c3b5e6ec0fee18bc2ce38d1dfe913413205f908 Author: Thomas Gleixner Date: Tue Jul 13 15:39:48 2021 +0200 hrtimer: Ensure timerfd notification for HIGHRES=n If high resolution timers are disabled the timerfd notification about a clock was set event is not happening for all cases which use clock_was_set_delayed() because that's a NOP for HIGHRES=n, which is wrong. Make clock_was_set_delayed() unconditially available to fix that. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.196661266@linutronix.de commit b14bca97c9f5c3e3f133445b01c723e95490d843 Author: Peter Zijlstra Date: Tue Jul 13 15:39:47 2021 +0200 hrtimer: Consolidate reprogramming code This code is mostly duplicated. The redudant store in the force reprogram case does no harm and the in hrtimer interrupt condition cannot be true for the force reprogram invocations. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135158.054424875@linutronix.de commit 627ef5ae2df8eeccb20d5af0e4cfa4df9e61ed28 Author: Thomas Gleixner Date: Tue Jul 13 15:39:46 2021 +0200 hrtimer: Avoid double reprogramming in __hrtimer_start_range_ns() If __hrtimer_start_range_ns() is invoked with an already armed hrtimer then the timer has to be canceled first and then added back. If the timer is the first expiring timer then on removal the clockevent device is reprogrammed to the next expiring timer to avoid that the pending expiry fires needlessly. If the new expiry time ends up to be the first expiry again then the clock event device has to reprogrammed again. Avoid this by checking whether the timer is the first to expire and in that case, keep the timer on the current CPU and delay the reprogramming up to the point where the timer has been enqueued again. Reported-by: Lorenzo Colitti Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210713135157.873137732@linutronix.de commit 8702997074363c294a1f83928cd0c33ca57bf813 Author: Florian Westphal Date: Thu Aug 5 12:02:43 2021 +0200 netfilter: nf_queue: move hookfn registration out of struct net This was done to detect when the pernet->init() function was not called yet, by checking if net->nf.queue_handler is NULL. Once the nfnetlink_queue module is active, all struct net pointers contain the same address. So place this back in nf_queue.c. Handle the 'netns error unwind' test by checking nfnl_queue_net for a NULL pointer and add a comment for this. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ee375328f579f94251eb66d5dc91aba056019a31 Author: Frederic Weisbecker Date: Mon Jul 26 14:55:13 2021 +0200 posix-cpu-timers: Recalc next expiration when timer_settime() ends up not queueing There are several scenarios that can result in posix_cpu_timer_set() not queueing the timer but still leaving the threadgroup cputime counter running or keeping the tick dependency around for a random amount of time. 1) If timer_settime() is called with a 0 expiration on a timer that is already disabled, the process wide cputime counter will be started and won't ever get a chance to be stopped by stop_process_timer() since no timer is actually armed to be processed. The following snippet is enough to trigger the issue. void trigger_process_counter(void) { timer_t id; struct itimerspec val = { }; timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); timer_settime(id, TIMER_ABSTIME, &val, NULL); timer_delete(id); } 2) If timer_settime() is called with a 0 expiration on a timer that is already armed, the timer is dequeued but not really disarmed. So the process wide cputime counter and the tick dependency may still remain a while around. The following code snippet keeps this overhead around for one week after the timer deletion: void trigger_process_counter(void) { timer_t id; struct itimerspec val = { }; val.it_value.tv_sec = 604800; timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); timer_settime(id, 0, &val, NULL); timer_delete(id); } 3) If the timer was initially deactivated, this call to timer_settime() with an early expiration may have started the process wide cputime counter even though the timer hasn't been queued and armed because it has fired early and inline within posix_cpu_timer_set() itself. As a result the process wide cputime counter may never stop until a new timer is ever armed in the future. The following code snippet can reproduce this: void trigger_process_counter(void) { timer_t id; struct itimerspec val = { }; signal(SIGALRM, SIG_IGN); timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); val.it_value.tv_nsec = 1; timer_settime(id, TIMER_ABSTIME, &val, NULL); } 4) If the timer was initially armed with a former expiration value before this call to timer_settime() and the current call sets an early deadline that has already expired, the timer fires inline within posix_cpu_timer_set(). In this case it must have been dequeued before firing inline with its new expiration value, yet it hasn't been disarmed in this case. So the process wide cputime counter and the tick dependency may still be around for a while even after the timer fired. The following code snippet can reproduce this: void trigger_process_counter(void) { timer_t id; struct itimerspec val = { }; signal(SIGALRM, SIG_IGN); timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); val.it_value.tv_sec = 100; timer_settime(id, TIMER_ABSTIME, &val, NULL); val.it_value.tv_sec = 0; val.it_value.tv_nsec = 1; timer_settime(id, TIMER_ABSTIME, &val, NULL); } Fix all these issues with triggering the related base next expiration recalculation on the next tick. This also implies to re-evaluate the need to keep around the process wide cputime counter and the tick dependency, in a similar fashion to disarm_timer(). Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-7-frederic@kernel.org commit 5c8f23e6b73c13d9f7b52614783dcb9169883296 Author: Frederic Weisbecker Date: Mon Jul 26 14:55:12 2021 +0200 posix-cpu-timers: Consolidate timer base accessor Remove the ad-hoc timer base accessors and provide a consolidated one. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-6-frederic@kernel.org commit d9c1b2a1089f606404284b9f5b045a584d73382d Author: Frederic Weisbecker Date: Mon Jul 26 14:55:11 2021 +0200 posix-cpu-timers: Remove confusing return value override The end of the function cannot be reached with an error in variable ret. Unconfuse reviewers about that. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-5-frederic@kernel.org commit 406dd42bd1ba0c01babf9cde169bb319e52f6147 Author: Frederic Weisbecker Date: Mon Jul 26 14:55:10 2021 +0200 posix-cpu-timers: Force next expiration recalc after itimer reset When an itimer deactivates a previously armed expiration, it simply doesn't do anything. As a result the process wide cputime counter keeps running and the tick dependency stays set until it reaches the old ghost expiration value. This can be reproduced with the following snippet: void trigger_process_counter(void) { struct itimerval n = {}; n.it_value.tv_sec = 100; setitimer(ITIMER_VIRTUAL, &n, NULL); n.it_value.tv_sec = 0; setitimer(ITIMER_VIRTUAL, &n, NULL); } Fix this with resetting the relevant base expiration. This is similar to disarming a timer. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-4-frederic@kernel.org commit 175cc3ab28e3509ddee8de4f164b563d99daa570 Author: Frederic Weisbecker Date: Mon Jul 26 14:55:09 2021 +0200 posix-cpu-timers: Force next_expiration recalc after timer deletion A timer deletion only dequeues the timer but it doesn't shutdown the related costly process wide cputimer counter and the tick dependency. The following code snippet keeps this overhead around for one week after the timer deletion: void trigger_process_counter(void) { timer_t id; struct itimerspec val = { }; val.it_value.tv_sec = 604800; timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); timer_settime(id, 0, &val, NULL); timer_delete(id); } Make sure the next target's tick recalculates the nearest expiration and clears the process wide counter and tick dependency if necessary. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-3-frederic@kernel.org commit a5dec9f82ab2ae486119f0b0820ea16db3e522c3 Author: Frederic Weisbecker Date: Mon Jul 26 14:55:08 2021 +0200 posix-cpu-timers: Assert task sighand is locked while starting cputime counter Starting the process wide cputime counter needs to be done in the same sighand locking sequence than actually arming the related timer otherwise this races against concurrent timers setting/expiring in the same threadgroup. Detecting that the cputime counter is started without holding the sighand lock is a first step toward debugging such situations. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210726125513.271824-2-frederic@kernel.org commit ef531d01663a99981c4496a53f06935bead938a8 Author: Mikko Perttunen Date: Thu Jun 10 14:04:56 2021 +0300 drm/tegra: Bump driver version Bump driver version to 1.0.0 to allow userspace to detect availability of new interfaces. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 8cc95f3fd35e1de3495d9e2acb051162c739cd25 Author: Mikko Perttunen Date: Thu Jun 10 14:04:55 2021 +0300 drm/tegra: Add job firewall Add a firewall that validates jobs before submission to ensure they don't do anything they aren't allowed to do, like accessing memory they should not access. The firewall is functionality-wise a copy of the firewall already implemented in gpu/host1x. It is copied here as it makes more sense for it to live on the DRM side, as it is only needed for userspace job submissions, and generally the data it needs to do its job is easier to access here. In the future, the other implementation will be removed. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 13abe0bb15ceac2fb8e8853bd30c278426d95ad0 Author: Mikko Perttunen Date: Thu Jun 10 14:04:54 2021 +0300 drm/tegra: Implement job submission part of new UAPI Implement the job submission IOCTL with a minimum feature set. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 44e961381354df6db92065be3ba2e608c1838b3e Author: Mikko Perttunen Date: Thu Jun 10 14:04:53 2021 +0300 drm/tegra: Implement syncpoint wait UAPI Implement new syncpoint wait UAPI. This is different from the legacy one in taking an absolute timestamp in line with modern DRM conventions. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit fc34833640a14f4d142a8462619fb6665483ead5 Author: Mikko Perttunen Date: Thu Jun 10 14:04:52 2021 +0300 drm/tegra: Implement syncpoint management UAPI Implement TegraDRM IOCTLs for allocating and freeing syncpoints. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit d7c591bc1a3f23d605b43ac5b207e378d02b01ca Author: Mikko Perttunen Date: Thu Jun 10 14:04:51 2021 +0300 drm/tegra: Implement new UAPI Implement the non-submission parts of the new UAPI, including channel management and memory mapping. The UAPI is under the CONFIG_DRM_TEGRA_STAGING config flag for now. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 1dae37c7e41d9a75a615ba7b0480acc2e04094d4 Author: Colin Ian King Date: Wed Jul 21 13:01:47 2021 +0100 posix-timers: Remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210721120147.109570-1-colin.king@canonical.com commit d1a4e0a9576fd2b29a0d13b306a9f52440908ab4 Merge: 4ef3960ea19c3 874be05f525e8 Author: Jakub Kicinski Date: Tue Aug 10 07:27:09 2021 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== bpf-next 2021-08-10 We've added 31 non-merge commits during the last 8 day(s) which contain a total of 28 files changed, 3644 insertions(+), 519 deletions(-). 1) Native XDP support for bonding driver & related BPF selftests, from Jussi Maki. 2) Large batch of new BPF JIT tests for test_bpf.ko that came out as a result from 32-bit MIPS JIT development, from Johan Almbladh. 3) Rewrite of netcnt BPF selftest and merge into test_progs, from Stanislav Fomichev. 4) Fix XDP bpf_prog_test_run infra after net to net-next merge, from Andrii Nakryiko. 5) Follow-up fix in unix_bpf_update_proto() to enforce socket type, from Cong Wang. 6) Fix bpf-iter-tcp4 selftest to print the correct dest IP, from Jose Blanquicet. 7) Various misc BPF XDP sample improvements, from Niklas Söderlund, Matthew Cover, and Muhammad Falak R Wani. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (31 commits) bpf, tests: Add tail call test suite bpf, tests: Add tests for BPF_CMPXCHG bpf, tests: Add tests for atomic operations bpf, tests: Add test for 32-bit context pointer argument passing bpf, tests: Add branch conversion JIT test bpf, tests: Add word-order tests for load/store of double words bpf, tests: Add tests for ALU operations implemented with function calls bpf, tests: Add more ALU64 BPF_MUL tests bpf, tests: Add more BPF_LSH/RSH/ARSH tests for ALU64 bpf, tests: Add more ALU32 tests for BPF_LSH/RSH/ARSH bpf, tests: Add more tests of ALU32 and ALU64 bitwise operations bpf, tests: Fix typos in test case descriptions bpf, tests: Add BPF_MOV tests for zero and sign extension bpf, tests: Add BPF_JMP32 test cases samples, bpf: Add an explict comment to handle nested vlan tagging. selftests/bpf: Add tests for XDP bonding selftests/bpf: Fix xdp_tx.c prog section name net, core: Allow netdev_lower_get_next_private_rcu in bh context bpf, devmap: Exclude XDP broadcast to master device net, bonding: Add XDP support to the bonding driver ... ==================== Link: https://lore.kernel.org/r/20210810130038.16927-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 35267cea901456d16fb3841ab44347937bf0b087 Author: John Garry Date: Thu Jul 29 21:56:17 2021 +0800 perf jevents: Relocate test events to cpu folder In future to add support for sys events, relocate the core and uncore events to a cpu folder. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-3-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 19ac3df32f883a8341b1ceaad40be33b3ac85f23 Author: John Garry Date: Thu Jul 29 21:56:16 2021 +0800 perf test: Factor out pmu-events event comparison Factor out event comparison which will be used in multiple places. Also test "pmu" and "compat" fields. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: https //lore.kernel.org/r/1627566986-30605-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 517db3b59537a59f6cc251b1926df93e93bb9c87 Author: John Garry Date: Tue Aug 3 08:44:09 2021 +0100 perf jevents: Make build dependency on test JSONs Currently all JSONs and the mapfile for an arch are dependencies for building pmu-events.c The test JSONs are missing as a dependency, so add them. Signed-off-by: John Garry Reported-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linuxarm@huawei.com Link: http://lore.kernel.org/lkml/90094733-741c-50e5-ac7d-f5640b5f0bdd@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit fdf8eea5d3bd82b5b2cc387da772299dd9ed6f43 Author: Darren Powell Date: Sun Jul 18 01:20:22 2021 -0400 amdgpu/pm: Replace amdgpu_pm usage of sprintf with sysfs_emit replacing printfs with sysfs_emit === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pwm1_enable pwm1_min pwm1_max pwm1 fan1_input fan1_target fan1_enable power1_cap_min " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6db0c87a0a8ee1f0748856d936073619cb1440cd Author: Darren Powell Date: Sat Jul 17 00:15:43 2021 -0400 amdgpu/pm: Replace hwmgr smu usage of sprintf with sysfs_emit replacing printfs with sysfs_emit minor smu7 change to remove compiler warning comparison of int and uint32_t minor smu8 change to remove compiler warning comparison of int and uint32_t === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 0b023410da60a14090fd9254909c495d730c7aa1 Author: Darren Powell Date: Wed Jul 14 19:11:17 2021 -0400 amdgpu/pm: Replace vega12,20 usage of sprintf with sysfs_emit === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_features pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 21f0742af1ddb69e12b0b7f9d176a528846c4690 Author: Darren Powell Date: Sat Jul 10 00:24:43 2021 -0400 amdgpu/pm: Replace vega10 usage of sprintf with sysfs_emit initial modification of files vega10_hwmgr.c === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_features pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e738c2f0e654832f9209a962c5020741aee30620 Author: Darren Powell Date: Fri Jul 9 23:58:39 2021 -0400 amdgpu/pm: Replace smu12/13 usage of sprintf with sysfs_emit initial modification of files renoir_ppt.c aldebaran_ppt.c yellow_carp_ppt.c === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fe14c2859ffd18ecec263b0e24a5737478ae2529 Author: Darren Powell Date: Wed Jun 30 23:51:13 2021 -0400 amdgpu/pm: Replace smu11 usage of sprintf with sysfs_emit modification of smu11 files arcturus_ppt.c sienna_cichlid_ppt.c vangogh_ppt.c === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 828db598bfcdad388d85c1ff31e530c190d63d16 Author: Darren Powell Date: Wed Jun 30 18:31:51 2021 -0400 amdgpu/pm: Replace navi10 usage of sprintf with sysfs_emit initial modification of files smu_cmn.c navi10_ppt.c === Test === AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1` AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'` HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON} LOGFILE=pp_printf.test.log lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="pp_dpm_sclk pp_sclk_od pp_mclk_od pp_dpm_pcie pp_od_clk_voltage pp_power_profile_mode " for f in $FILES do echo === $f === >> $LOGFILE cat $HWMON_DIR/device/$f >> $LOGFILE done cat $LOGFILE Signed-off-by: Darren Powell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 59066d0083d2e0f2daba9cf839011f7154c5e2b2 Author: Alex Deucher Date: Mon Aug 9 11:22:20 2021 -0400 drm/amdgpu: handle VCN instances when harvesting (v2) There may be multiple instances and only one is harvested. v2: fix typo in commit message Fixes: 83a0b8639185 ("drm/amdgpu: add judgement when add ip blocks (v2)") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1673 Reviewed-by: Guchun Chen Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 4241eabf59d5b7e9b5b567526f6e319f81dff894 Author: Riccardo Mancini Date: Mon Aug 9 22:11:02 2021 +0200 perf bench: Add benchmark for evlist open/close operations This new benchmark finds the total time that is taken to open, mmap, enable, disable, munmap, close an evlist (time taken for new, create_maps, config, delete is not counted in). The evlist can be configured as in perf-record using the -a,-C,-e,-u,--per-thread,-t,-p options. The events can be duplicated in the evlist to quickly test performance with many events using the -n options. Furthermore, also the number of iterations used to calculate the statistics is customizable. Examples: - Open one dummy event system-wide: $ sudo ./perf bench internals evlist-open-close Number of cpus: 4 Number of threads: 1 Number of events: 1 (4 fds) Number of iterations: 100 Average open-close took: 613.870 usec (+- 32.852 usec) - Open the group '{cs,cycles}' on CPU 0 $ sudo ./perf bench internals evlist-open-close -e '{cs,cycles}' -C 0 Number of cpus: 1 Number of threads: 1 Number of events: 2 (2 fds) Number of iterations: 100 Average open-close took: 8503.220 usec (+- 252.652 usec) - Open 10 'cycles' events for user 0, calculate average over 100 runs $ sudo ./perf bench internals evlist-open-close -e cycles -n 10 -u 0 -i 100 Number of cpus: 4 Number of threads: 328 Number of events: 10 (13120 fds) Number of iterations: 100 Average open-close took: 180043.140 usec (+- 2295.889 usec) Committer notes: Replaced a deprecated bzero() call with designated initialized zeroing. Added some missing evlist allocation checks, one noted by Riccardo on the mailing list. Minor cosmetic changes (sent in private). Signed-off-by: Riccardo Mancini Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210809201101.277594-1-rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit a20d1cebb98bba75f2e34fddc768dd8712c1bded Author: Theodore Ts'o Date: Mon May 3 15:37:33 2021 -0400 jbd2: fix portability problems caused by unaligned accesses This commit applies the e2fsck/recovery.c portions of commit 1e0c8ca7c08a ("e2fsck: fix portability problems caused by unaligned accesses) from the e2fsprogs git tree. The on-disk format for the ext4 journal can have unaigned 32-bit integers. This can happen when replaying a journal using a obsolete checksum format (which was never popularly used, since the v3 format replaced v2 while the metadata checksum feature was being stablized). Signed-off-by: Theodore Ts'o commit f2c24ebadd90b4165ce2c49c3c6a100312266f54 Author: Alyssa Ross Date: Mon Aug 9 15:32:26 2021 +0000 perf docs: Fix accidental em-dashes " -- " is an em dash (—) in asciidoc, so all these examples that were supposed to be producing a literal two dashes were being misrendered. Signed-off-by: Alyssa Ross Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210809153226.332545-1-hi@alyssa.is Signed-off-by: Arnaldo Carvalho de Melo commit 5a6c76b5de59ed508d7cb133327a7c54e77fed97 Author: Gustavo A. R. Silva Date: Thu May 13 16:27:29 2021 -0500 genirq/generic_chip: Use struct_size() 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. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210513212729.GA214145@embeddedor commit 5fa9d19b3fb640e3616de2a7615236c0cc45e702 Author: Randy Dunlap Date: Thu Jul 22 20:48:40 2021 -0700 pinctrl: aspeed: placate kernel-doc warnings Eliminate kernel-doc warnings in drivers/pinctrl/aspeed by using proper kernel-doc notation. Fixes these kernel-doc warnings: drivers/pinctrl/aspeed/pinmux-aspeed.c:61: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Query the enabled or disabled state for a mux function's signal on a pin drivers/pinctrl/aspeed/pinctrl-aspeed.c:135: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Search for the signal expression needed to enable the pin's signal for the Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org Cc: openbmc@lists.ozlabs.org Cc: Linus Walleij Cc: linux-gpio@vger.kernel.org Acked-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210723034840.8752-1-rdunlap@infradead.org Signed-off-by: Linus Walleij commit afefe67e0893325d75eb7b816dd394eef2eac628 Author: Sai Prakash Ranjan Date: Tue Aug 10 12:18:08 2021 +0530 iommu/arm-smmu: Add clk_bulk_{prepare/unprepare} to system pm callbacks Some clocks for SMMU can have parent as XO such as gpu_cc_hub_cx_int_clk of GPU SMMU in QTI SC7280 SoC and in order to enter deep sleep states in such cases, we would need to drop the XO clock vote in unprepare call and this unprepare callback for XO is in RPMh (Resource Power Manager-Hardened) clock driver which controls RPMh managed clock resources for new QTI SoCs. Given we cannot have a sleeping calls such as clk_bulk_prepare() and clk_bulk_unprepare() in arm-smmu runtime pm callbacks since the iommu operations like map and unmap can be in atomic context and are in fast path, add this prepare and unprepare call to drop the XO vote only for system pm callbacks since it is not a fast path and we expect the system to enter deep sleep states with system pm as opposed to runtime pm. This is a similar sequence of clock requests (prepare,enable and disable,unprepare) in arm-smmu probe and remove. Signed-off-by: Sai Prakash Ranjan Co-developed-by: Rajendra Nayak Signed-off-by: Rajendra Nayak Link: https://lore.kernel.org/r/20210810064808.32486-1-saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 1bce54250045443d55659b0b23be51e87ed2b919 Author: Marc Zyngier Date: Mon Aug 2 17:26:28 2021 +0100 powerpc: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Signed-off-by: Marc Zyngier Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210802162630.2219813-13-maz@kernel.org commit f5af0a978776b710f16dc99a85496b1e760bf9e0 Author: Cédric Le Goater Date: Tue Jul 20 15:42:09 2021 +0200 KVM: PPC: Book3S HV: XIVE: Add support for automatic save-restore On P10, the feature doing an automatic "save & restore" of a VCPU interrupt context is set by default in OPAL. When a VP context is pulled out, the state of the interrupt registers are saved by the XIVE interrupt controller under the internal NVP structure representing the VP. This saves a costly store/load in guest entries and exits. If OPAL advertises the "save & restore" feature in the device tree, it should also have set the 'H' bit in the CAM line. Check that when vCPUs are connected to their ICP in KVM before going any further. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210720134209.256133-3-clg@kaod.org commit b68c6646cce5ee8caefa6333ee743f960222dcea Author: Cédric Le Goater Date: Tue Jul 20 15:42:08 2021 +0200 KVM: PPC: Book3S HV: XIVE: Add a 'flags' field Use it to hold platform specific features. P9 DD2 introduced single-escalation support. P10 will add others. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210720134209.256133-2-clg@kaod.org commit 17df41fec5b80b16ea4774495f1eb730e2225619 Author: Cédric Le Goater Date: Mon Jul 19 15:06:14 2021 +0200 powerpc: use IRQF_NO_DEBUG for IPIs There is no need to use the lockup detector ("noirqdebug") for IPIs. The ipistorm benchmark measures a ~10% improvement on high systems when this flag is set. Signed-off-by: Cédric Le Goater Reviewed-by: Thomas Gleixner Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210719130614.195886-1-clg@kaod.org commit 59b2bc18b1492b46d45b6b6828ba098f09b9ba67 Author: Cédric Le Goater Date: Thu Jul 1 15:27:49 2021 +0200 powerpc/xive: Use XIVE domain under xmon and debugfs The default domain of the PCI/MSIs is not the XIVE domain anymore. To list the IRQ mappings under XMON and debugfs, query the IRQ data from the low level XIVE domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-32-clg@kaod.org commit 1753081f2d445f9157550692fcc4221cd3ff0958 Author: Cédric Le Goater Date: Thu Jul 1 15:27:48 2021 +0200 KVM: PPC: Book3S HV: XICS: Fix mapping of passthrough interrupts PCI MSIs now live in an MSI domain but the underlying calls, which will EOI the interrupt in real mode, need an HW IRQ number mapped in the XICS IRQ domain. Grab it there. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-31-clg@kaod.org commit c325712b5f85e561ea89bae2ba5d0104e797e42c Author: Cédric Le Goater Date: Thu Jul 1 15:27:47 2021 +0200 powerpc/powernv/pci: Rework pnv_opal_pci_msi_eoi() pnv_opal_pci_msi_eoi() is called from KVM to EOI passthrough interrupts when in real mode. Adding MSI domain broke the hack using the 'ioda.irq_chip' field to deduce the owning PHB. Fix that by using the IRQ chip data in the MSI domain. The 'ioda.irq_chip' field is now unused and could be removed from the pnv_phb struct. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-30-clg@kaod.org commit 5cd69651ceeed15e021cf7d19f1b1be0a80c0c7a Author: Cédric Le Goater Date: Thu Jul 1 15:27:46 2021 +0200 powerpc/powernv/pci: Set the IRQ chip data for P8/CXL devices Before MSI domains, the default IRQ chip of PHB3 MSIs was patched by pnv_set_msi_irq_chip() with the custom EOI handler pnv_ioda2_msi_eoi() and the owning PHB was deduced from the 'ioda.irq_chip' field. This path has been deprecated by the MSI domains but it is still in use by the P8 CAPI 'cxl' driver. Rewriting this driver to support MSI would be a waste of time. Nevertheless, we can still remove the IRQ chip patch and set the IRQ chip data instead. This is cleaner. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-29-clg@kaod.org commit c80198a21792ac59412871e4e6fad5041c9be8e4 Author: Cédric Le Goater Date: Thu Jul 1 15:27:45 2021 +0200 powerpc/xics: Fix IRQ migration desc->irq_data points to the top level IRQ data descriptor which is not necessarily in the XICS IRQ domain. MSIs are in another domain for instance. Fix that by looking for a mapping on the low level XICS IRQ domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-28-clg@kaod.org commit f1a377f86f51b381cfc30bf2270f8a5f81e35ee9 Author: Cédric Le Goater Date: Thu Jul 1 15:27:44 2021 +0200 powerpc/powernv/pci: Adapt is_pnv_opal_msi() to detect passthrough interrupt The pnv_ioda2_msi_eoi() chip handler is not used anymore for MSIs. Simply use the check on the PSI-MSI chip. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-27-clg@kaod.org commit 6d9ba6121b1cf453985d08c141970a1b44cd9cf1 Author: Cédric Le Goater Date: Thu Jul 1 15:27:43 2021 +0200 powerpc/powernv/pci: Drop unused MSI code MSIs should be fully managed by the PCI and IRQ subsystems now. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-26-clg@kaod.org commit 3005123eea0daa18d98602ab64b2ce3ad087d849 Author: Cédric Le Goater Date: Thu Jul 1 15:27:42 2021 +0200 powerpc/pseries/pci: Drop unused MSI code MSIs should be fully managed by the PCI and IRQ subsystems now. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-25-clg@kaod.org commit 1e661f81a522eadfe4bc5bb1ec9fbae27c13f163 Author: Cédric Le Goater Date: Thu Jul 1 15:27:41 2021 +0200 powerpc/xics: Drop unmask of MSIs at startup That was a workaround in the XICS domain because of the lack of MSI domain. This is now handled. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-24-clg@kaod.org commit 679e30b9536eeb93bc8c9a39c0ddc77dec536f6b Author: Cédric Le Goater Date: Thu Jul 1 15:27:40 2021 +0200 powerpc/pci: Drop XIVE restriction on MSI domains The PowerNV and pSeries platforms now have support for both the XICS and XIVE IRQ domains. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-23-clg@kaod.org commit bbb25af8fbdba4acaf955e412a84eb2eea48697c Author: Cédric Le Goater Date: Thu Jul 1 15:27:39 2021 +0200 powerpc/powernv/pci: Customize the MSI EOI handler to support PHB3 PHB3s need an extra OPAL call to EOI the interrupt. The call takes an OPAL HW IRQ number but it is translated into a vector number in OPAL. Here, we directly use the vector number of the in-the-middle "PNV-MSI" domain instead of grabbing the OPAL HW IRQ number in the XICS parent domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-22-clg@kaod.org commit e4f0aa3b4731430ad73fb4485e97f751c7500668 Author: Cédric Le Goater Date: Thu Jul 1 15:27:38 2021 +0200 powerpc/xics: Add support for IRQ domain hierarchy XICS doesn't have any state associated with the IRQ. The support is straightforward and simpler than for XIVE. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-21-clg@kaod.org commit 53b34e8db73af98fa652641bf490384dc665d0f2 Author: Cédric Le Goater Date: Thu Jul 1 15:27:37 2021 +0200 powerpc/xics: Add debug logging to the set_irq_affinity handlers It really helps to know how the HW is configured when tweaking the IRQ subsystem. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-20-clg@kaod.org commit 7d14f6c60b76fa7f3f89d81a95385576ca33b483 Author: Cédric Le Goater Date: Thu Jul 1 15:27:36 2021 +0200 powerpc/xics: Give a name to the default XICS IRQ domain and clean up the error path. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-19-clg@kaod.org commit 248af248a8f45461662fb633eca4adf24ae704ad Author: Cédric Le Goater Date: Thu Jul 1 15:27:35 2021 +0200 powerpc/xics: Rename the map handler in a check handler This moves the IRQ initialization done under the different ICS backends in the common part of XICS. The 'map' handler becomes a simple 'check' on the HW IRQ at the FW level. As we don't need an ICS anymore in xics_migrate_irqs_away(), the XICS domain does not set a chip data for the IRQ. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-18-clg@kaod.org commit 298f6f952885eeb1f25461f085c6c238bcd9fc5e Author: Cédric Le Goater Date: Thu Jul 1 15:27:34 2021 +0200 powerpc/xics: Remove ICS list We always had only one ICS per machine. Simplify the XICS driver by removing the ICS list. The ICS stored in the chip data of the XICS domain becomes useless and we don't need it anymore to migrate away IRQs from a CPU. This will be removed in a subsequent patch. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-17-clg@kaod.org commit 51be9e51a8000ffc6a33083ceca9da9303ed4dc5 Author: Cédric Le Goater Date: Thu Jul 1 15:27:33 2021 +0200 KVM: PPC: Book3S HV: XIVE: Fix mapping of passthrough interrupts PCI MSI interrupt numbers are now mapped in a PCI-MSI domain but the underlying calls handling the passthrough of the interrupt in the guest need a number in the XIVE IRQ domain. Use the IRQ data mapped in the XIVE IRQ domain and not the one in the PCI-MSI domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-16-clg@kaod.org commit e5e78b15113a73d0294141d9796969fa7b10fa3c Author: Cédric Le Goater Date: Thu Jul 1 15:27:32 2021 +0200 KVM: PPC: Book3S HV: XIVE: Change interface of passthrough interrupt routines The routine kvmppc_set_passthru_irq() calls kvmppc_xive_set_mapped() and kvmppc_xive_clr_mapped() with an IRQ descriptor. Use directly the host IRQ number to remove a useless conversion. Add some debug. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-15-clg@kaod.org commit ba418a0278265ad65f2f9544e743b7dbff3b994b Author: Cédric Le Goater Date: Thu Jul 1 15:27:31 2021 +0200 KVM: PPC: Book3S HV: Use the new IRQ chip to detect passthrough interrupts Passthrough PCI MSI interrupts are detected in KVM with a check on a specific EOI handler (P8) or on XIVE (P9). We can now check the PCI-MSI IRQ chip which is cleaner. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-14-clg@kaod.org commit 0fcfe2247e75070361af2b6845030cada92cdbf8 Author: Cédric Le Goater Date: Thu Jul 1 15:27:30 2021 +0200 powerpc/powernv/pci: Add MSI domains This is very similar to the MSI domains of the pSeries platform. The MSI allocator is directly handled under the Linux PHB in the in-the-middle "PNV-MSI" domain. Only the XIVE (P9/P10) parent domain is supported for now. Support for XICS will come later. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-13-clg@kaod.org commit 2c50d7e99e39eba92b93210e740f3f9e5a06ba54 Author: Cédric Le Goater Date: Thu Jul 1 15:27:29 2021 +0200 powerpc/powernv/pci: Introduce __pnv_pci_ioda_msi_setup() It will be used as a 'compose_msg' handler of the MSI domain introduced later. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-12-clg@kaod.org commit 174db9e7f775ce06fc6949c9abbe758b3eb8171c Author: Cédric Le Goater Date: Thu Jul 1 15:27:28 2021 +0200 powerpc/pseries/pci: Add support of MSI domains to PHB hotplug Simply allocate or release the MSI domains when a PHB is inserted in or removed from the machine. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-11-clg@kaod.org commit 9a014f456881e947bf8cdd8c984a207097e6c096 Author: Cédric Le Goater Date: Thu Jul 1 15:27:27 2021 +0200 powerpc/pseries/pci: Add a msi_free() handler to clear XIVE data The MSI domain clears the IRQ with msi_domain_free(), which calls irq_domain_free_irqs_top(), which clears the handler data. This is a problem for the XIVE controller since we need to unmap MMIO pages and free a specific XIVE structure. The 'msi_free()' handler is called before irq_domain_free_irqs_top() when the handler data is still available. Use that to clear the XIVE controller data. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-10-clg@kaod.org commit 07817a578a7a79638537480b8847dc7a12f293c5 Author: Cédric Le Goater Date: Thu Jul 1 15:27:26 2021 +0200 powerpc/pseries/pci: Add a domain_free_irqs() handler The RTAS firmware can not disable one MSI at a time. It's all or nothing. We need a custom free IRQ handler for that. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-9-clg@kaod.org commit 292145a6e598c1e6633b8f5f607706b46f552ab9 Author: Cédric Le Goater Date: Thu Jul 1 15:27:25 2021 +0200 powerpc/xive: Remove irqd_is_started() check when setting the affinity In the early days of XIVE support, commit cffb717ceb8e ("powerpc/xive: Ensure active irqd when setting affinity") tried to fix an issue related to interrupt migration. If the root cause was related to CPU unplug, it should have been fixed and there is no reason to keep the irqd_is_started() check. This test is also breaking affinity setting of MSIs which can set before starting the associated IRQ. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-8-clg@kaod.org commit 5690bcae186084a8544b1819f0d89399268bd0cf Author: Cédric Le Goater Date: Thu Jul 1 15:27:24 2021 +0200 powerpc/xive: Drop unmask of MSIs at startup That was a workaround in the XIVE domain because of the lack of MSI domain. This is now handled. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-7-clg@kaod.org commit a5f3d2c17b07e69166b93209f34a5fb8271a6810 Author: Cédric Le Goater Date: Thu Jul 1 15:27:23 2021 +0200 powerpc/pseries/pci: Add MSI domains Two IRQ domains are added on top of default machine IRQ domain. First, the top level "pSeries-PCI-MSI" domain deals with the MSI specificities. In this domain, the HW IRQ numbers are generated by the PCI MSI layer, they compose a unique ID for an MSI source with the PCI device identifier and the MSI vector number. These numbers can be quite large on a pSeries machine running under the IBM Hypervisor and /sys/kernel/irq/ and /proc/interrupts will require small fixes to show them correctly. Second domain is the in-the-middle "pSeries-MSI" domain which acts as a proxy between the PCI MSI subsystem and the machine IRQ subsystem. It usually allocate the MSI vector numbers but, on pSeries machines, this is done by the RTAS FW and RTAS returns IRQ numbers in the IRQ number space of the machine. This is why the in-the-middle "pSeries-MSI" domain has the same HW IRQ numbers as its parent domain. Only the XIVE (P9/P10) parent domain is supported for now. We still need to add support for IRQ domain hierarchy under XICS. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-6-clg@kaod.org commit 6c2ab2a5d634d4e30445ee5d52d5d1469bf74aa2 Author: Cédric Le Goater Date: Thu Jul 1 15:27:22 2021 +0200 powerpc/xive: Ease debugging of xive_irq_set_affinity() pr_debug() is easier to activate and it helps to know how the kernel configures the HW when tweaking the IRQ subsystem. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-5-clg@kaod.org commit 14be098c5387eb93b794f299f3c3e2ddf6038ec7 Author: Cédric Le Goater Date: Thu Jul 1 15:27:21 2021 +0200 powerpc/xive: Add support for IRQ domain hierarchy This adds handlers to allocate/free IRQs in a domain hierarchy. We could try to use xive_irq_domain_map() in xive_irq_domain_alloc() but we rely on xive_irq_alloc_data() to set the IRQ handler data and duplicating the code is simpler. xive_irq_free_data() needs to be called when IRQ are freed to clear the MMIO mappings and free the XIVE handler data, xive_irq_data structure. This is going to be a problem with MSI domains which we will address later. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-4-clg@kaod.org commit e81202007363bd694b711f307f02320b5f98edaa Author: Cédric Le Goater Date: Thu Jul 1 15:27:20 2021 +0200 powerpc/pseries/pci: Introduce rtas_prepare_msi_irqs() This splits the routine setting the MSIs in two parts: allocation of MSIs for the PCI device at the FW level (RTAS) and the actual mapping and activation of the IRQs. rtas_prepare_msi_irqs() will serve as a handler for the PCI MSI domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-3-clg@kaod.org commit 786e5b102a0007d81579822eac23cb5bfaa0b65f Author: Cédric Le Goater Date: Thu Jul 1 15:27:19 2021 +0200 powerpc/pseries/pci: Introduce __find_pe_total_msi() It will help to size the PCI MSI domain. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701132750.1475580-2-clg@kaod.org commit 2ac78e0c00184a9ba53d507be7549c69a3f566b6 Author: Alexey Kardashevskiy Date: Thu Aug 5 17:56:49 2021 +1000 KVM: PPC: Use arch_get_random_seed_long instead of powernv variant The powernv_get_random_long() does not work in nested KVM (which is pseries) and produces a crash when accessing in_be64(rng->regs) in powernv_get_random_long(). This replaces powernv_get_random_long with the ppc_md machine hook wrapper. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210805075649.2086567-1-aik@ozlabs.ru commit 9b49f979b3d560cb75ea9f1a596baf432d566798 Author: Anton Blanchard Date: Thu Aug 5 11:20:05 2021 +1000 powerpc/configs: Disable legacy ptys on microwatt defconfig We shouldn't need legacy ptys, and disabling the option improves boot time by about 0.5 seconds. Signed-off-by: Anton Blanchard Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210805112005.3cb1f412@kryten.localdomain commit 27fd1111051dc218e5b6cb2da5dbb3f342879ff1 Author: Jordan Niethe Date: Wed Aug 4 11:37:24 2021 +1000 powerpc: Always inline radix_enabled() to fix build failure This is the same as commit acdad8fb4a15 ("powerpc: Force inlining of mmu_has_feature to fix build failure") but for radix_enabled(). The config in the linked bugzilla causes the following build failure: LD .tmp_vmlinux.kallsyms1 powerpc64-linux-ld: arch/powerpc/mm/pgtable.o: in function `.__ptep_set_access_flags': pgtable.c:(.text+0x17c): undefined reference to `.radix__ptep_set_access_flags' powerpc64-linux-ld: arch/powerpc/mm/pageattr.o: in function `.change_page_attr': pageattr.c:(.text+0xc0): undefined reference to `.radix__flush_tlb_kernel_range' etc. This is due to radix_enabled() not being inlined. See extract from building with -Winline: In file included from arch/powerpc/include/asm/lppaca.h:46, from arch/powerpc/include/asm/paca.h:17, from arch/powerpc/include/asm/current.h:13, from include/linux/thread_info.h:23, from include/asm-generic/preempt.h:5, from ./arch/powerpc/include/generated/asm/preempt.h:1, from include/linux/preempt.h:78, from include/linux/spinlock.h:51, from include/linux/mmzone.h:8, from include/linux/gfp.h:6, from arch/powerpc/mm/pgtable.c:21: arch/powerpc/include/asm/book3s/64/pgtable.h: In function '__ptep_set_access_flags': arch/powerpc/include/asm/mmu.h:327:20: error: inlining failed in call to 'radix_enabled': call is unlikely and code size would grow [-Werror=inline] The code relies on constant folding of MMU_FTRS_POSSIBLE at buildtime and elimination of non possible parts of code at compile time. For this to work radix_enabled() must be inlined so make it __always_inline. Reported-by: Erhard F. Suggested-by: Michael Ellerman Tested-by: Randy Dunlap Signed-off-by: Jordan Niethe [mpe: Trimmed error messages in change log] Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=213803 Link: https://lore.kernel.org/r/20210804013724.514468-1-jniethe5@gmail.com commit 5ae36401ca4ea2737d779ce7c267444b16530001 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:46 2021 +0200 powerpc: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210803141621.780504-4-bigeasy@linutronix.de commit c00103abf76fd3916596afd07dd3fdeee0dca15d Author: kernel test robot Date: Tue Aug 3 16:59:55 2021 +0200 powerpc/kexec: fix for_each_child.cocci warning for_each_node_by_type should have of_node_put() before return. Generated by: scripts/coccinelle/iterators/for_each_child.cocci Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2108031654080.17639@hadrien commit bd1dd4c5f5286df0148b5b316f37c583b8f55fa1 Author: Laurent Dufour Date: Thu Apr 29 19:49:08 2021 +0200 powerpc/pseries: Prevent free CPU ids being reused on another node When a CPU is hot added, the CPU ids are taken from the available mask from the lower possible set. If that set of values was previously used for a CPU attached to a different node, it appears to an application as if these CPUs have migrated from one node to another node which is not expected. To prevent this, it is needed to record the CPU ids used for each node and to not reuse them on another node. However, to prevent CPU hot plug to fail, in the case the CPU ids is starved on a node, the capability to reuse other nodes’ free CPU ids is kept. A warning is displayed in such a case to warn the user. A new CPU bit mask (node_recorded_ids_map) is introduced for each possible node. It is populated with the CPU onlined at boot time, and then when a CPU is hot plugged to a node. The bits in that mask remain when the CPU is hot unplugged, to remind this CPU ids have been used for this node. If no id set was found, a retry is made without removing the ids used on the other nodes to try reusing them. This is the way ids have been allocated prior to this patch. The effect of this patch can be seen by removing and adding CPUs using the Qemu monitor. In the following case, the first CPU from the node 2 is removed, then the first one from the node 1 is removed too. Later, the first CPU of the node 2 is added back. Without that patch, the kernel will number these CPUs using the first CPU ids available which are the ones freed when removing the second CPU of the node 0. This leads to the CPU ids 16-23 to move from the node 1 to the node 2. With the patch applied, the CPU ids 32-39 are used since they are the lowest free ones which have not been used on another node. At boot time: [root@vm40 ~]# numactl -H | grep cpus node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 node 1 cpus: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 node 2 cpus: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Vanilla kernel, after the CPU hot unplug/plug operations: [root@vm40 ~]# numactl -H | grep cpus node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 node 1 cpus: 24 25 26 27 28 29 30 31 node 2 cpus: 16 17 18 19 20 21 22 23 40 41 42 43 44 45 46 47 Patched kernel, after the CPU hot unplug/plug operations: [root@vm40 ~]# numactl -H | grep cpus node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 node 1 cpus: 24 25 26 27 28 29 30 31 node 2 cpus: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Signed-off-by: Laurent Dufour Reviewed-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210429174908.16613-1-ldufour@linux.ibm.com commit d144f4d5a8a804133d20ff311d7be70bcdbfaac2 Author: Laurent Dufour Date: Mon May 17 11:06:06 2021 +0200 pseries/drmem: update LMBs after LPM After a LPM, the device tree node ibm,dynamic-reconfiguration-memory may be updated by the hypervisor in the case the NUMA topology of the LPAR's memory is updated. This is handled by the kernel, but the memory's node is not updated because there is no way to move a memory block between nodes from the Linux kernel point of view. If later a memory block is added or removed, drmem_update_dt() is called and it is overwriting the DT node ibm,dynamic-reconfiguration-memory to match the added or removed LMB. But the LMB's associativity node has not been updated after the DT node update and thus the node is overwritten by the Linux's topology instead of the hypervisor one. Introduce a hook called when the ibm,dynamic-reconfiguration-memory node is updated to force an update of the LMB's associativity. However, ignore the call to that hook when the update has been triggered by drmem_update_dt(). Because, in that case, the LMB tree has been used to set the DT property and thus it doesn't need to be updated back. Since drmem_update_dt() is called under the protection of the device_hotplug_lock and the hook is called in the same context, use a simple boolean variable to detect that call. Signed-off-by: Laurent Dufour Reviewed-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210517090606.56930-1-ldufour@linux.ibm.com commit 9c7248bb8de31f51c693bfa6a6ea53b1c07e0fa8 Author: Laurent Dufour Date: Tue May 11 09:31:36 2021 +0200 powerpc/numa: Consider the max NUMA node for migratable LPAR When a LPAR is migratable, we should consider the maximum possible NUMA node instead of the number of NUMA nodes from the actual system. The DT property 'ibm,current-associativity-domains' defines the maximum number of nodes the LPAR can see when running on that box. But if the LPAR is being migrated on another box, it may see up to the nodes defined by 'ibm,max-associativity-domains'. So if a LPAR is migratable, that value should be used. Unfortunately, there is no easy way to know if an LPAR is migratable or not. The hypervisor exports the property 'ibm,migratable-partition' in the case it set to migrate partition, but that would not mean that the current partition is migratable. Without this patch, when a LPAR is started on a 2 node box and then migrated to a 3 node box, the hypervisor may spread the LPAR's CPUs on the 3rd node. In that case if a CPU from that 3rd node is added to the LPAR, it will be wrongly assigned to the node because the kernel has been set to use up to 2 nodes (the configuration of the departure node). With this patch applies, the CPU is correctly added to the 3rd node. Fixes: f9f130ff2ec9 ("powerpc/numa: Detect support for coregroup") Signed-off-by: Laurent Dufour Reviewed-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210511073136.17795-1-ldufour@linux.ibm.com commit c8a6d91005343dea0d53be0ff0620c66934dcd44 Author: Christophe Leroy Date: Mon Jul 5 12:00:50 2021 +0000 powerpc/non-smp: Unconditionaly call smp_mb() on switch_mm Commit 3ccfebedd8cf ("powerpc, membarrier: Skip memory barrier in switch_mm()") added some logic to skip the smp_mb() in switch_mm_irqs_off() before the call to switch_mmu_context(). However, on non SMP smp_mb() is just a compiler barrier and doing it unconditionaly is simpler than the logic used to check whether the barrier is needed or not. After the patch: 00000000 : ... c: 7c 04 18 40 cmplw r4,r3 10: 81 24 00 24 lwz r9,36(r4) 14: 91 25 04 c8 stw r9,1224(r5) 18: 4d 82 00 20 beqlr 1c: 48 00 00 00 b 1c 1c: R_PPC_REL24 switch_mmu_context Before the patch: 00000000 : ... c: 7c 04 18 40 cmplw r4,r3 10: 81 24 00 24 lwz r9,36(r4) 14: 91 25 04 c8 stw r9,1224(r5) 18: 4d 82 00 20 beqlr 1c: 81 24 00 28 lwz r9,40(r4) 20: 71 29 00 0a andi. r9,r9,10 24: 40 82 00 34 bne 58 28: 48 00 00 00 b 28 28: R_PPC_REL24 switch_mmu_context ... 58: 2c 03 00 00 cmpwi r3,0 5c: 41 82 ff cc beq 28 60: 48 00 00 00 b 60 60: R_PPC_REL24 switch_mmu_context Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e9d501da0c59f60ca767b1b3ea4603fce6d02b9e.1625486440.git.christophe.leroy@csgroup.eu commit 09ca497528dac12cbbceab8197011c875a96d053 Author: Christophe Leroy Date: Sun Jun 27 17:09:18 2021 +0000 powerpc: Remove in_kernel_text() Last user of in_kernel_text() stopped using in with commit 549e8152de80 ("powerpc: Make the 64-bit kernel as a position-independent executable"). Generic function is_kernel_text() does the same. So remote it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2a3a5b6f8cc0ef4e854d7b764f66aa8d2ee270d2.1624813698.git.christophe.leroy@csgroup.eu commit 61377ec144574313ebfbf31685895a7b9b9b7a9a Author: Joel Savitz Date: Sat Jul 31 01:07:40 2021 -0400 genirq: Clarify documentation for request_threaded_irq() Clarify wording and document commonly used IRQF_ONESHOT flag. Signed-off-by: Joel Savitz Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210731050740.444454-1-jsavitz@redhat.com commit 99d26de2f6d79badc80f55b54bd90d4cb9d1ad90 Author: Christoph Hellwig Date: Tue Aug 10 14:39:24 2021 +0200 writeback: make the laptop_mode prototypes available unconditionally Fix the !CONFIG_BLOCK build after the recent cleanup. Fixes: 5ed964f8e54e ("mm: hide laptop_mode_wb_timer entirely behind the BDI API") Reported-by: Stephen Rothwell Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 844d87871b6e0ac3ceb177535dcdf6e6a9f1fd4b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:16 2021 +0200 smpboot: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-34-bigeasy@linutronix.de commit 698429f9d0e54ce3964151adff886ee5fc59714b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:17 2021 +0200 clocksource: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-35-bigeasy@linutronix.de commit 746f5ea9c4283d98353c1cd41864aec475e0edbd Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:15 2021 +0200 sched: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-33-bigeasy@linutronix.de commit 428e211641ed808b55cdc7d880a0ee349eff354b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:08 2021 +0200 genirq/affinity: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-26-bigeasy@linutronix.de commit e0f2977c35733fcccafdabcc02bf4f6ddf7f438d Author: Mikko Perttunen Date: Thu Jun 10 14:04:50 2021 +0300 drm/tegra: Allocate per-engine channel in core code To avoid code duplication, allocate the per-engine shared channel in the core code instead. This is the usual channel that all jobs are submitted to when MLOCKing is not in use. Once MLOCKs are implemented on Host1x side, we can also update this to avoid allocating a shared channel when MLOCKs are enabled. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 9916612311a777cdf15a53491243589ea4fcc4e7 Author: Mikko Perttunen Date: Thu Jun 10 14:04:49 2021 +0300 drm/tegra: Boot VIC during runtime PM resume With the new UAPI implementation, engines are powered on and off when there are active jobs, and the core code handles channel allocation. To accommodate that, boot the engine as part of runtime PM instead of using the open_channel callback, which is not used by the new submit path. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 57e203953d150e6304ab6936bd2d9aa2daa687f4 Author: Mikko Perttunen Date: Thu Jun 10 14:04:48 2021 +0300 drm/tegra: Add new UAPI to header Update the tegra_drm.h UAPI header, adding the new proposed UAPI. The old staging UAPI is left in for now, with minor modification to avoid name collisions. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 1b73e588f47397dee6e4bdfd953e0306c60b5fe5 Author: Marc Zyngier Date: Sun Jul 25 19:08:30 2021 +0100 pinctrl: stmfx: Fix hazardous u8[] to unsigned long cast Casting a small array of u8 to an unsigned long is *never* OK: - it does funny thing when the array size is less than that of a long, as it accesses random places in the stack - it makes everything even more fun with a BE kernel Fix this by building the unsigned long used as a bitmap byte by byte, in a way that works across endianess and has no undefined behaviours. An extra BUILD_BUG_ON() catches the unlikely case where the array would be larger than a single unsigned long. Fixes: 1490d9f841b1 ("pinctrl: Add STMFX GPIO expander Pinctrl/GPIO driver") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Cc: Amelie Delaunay Cc: Linus Walleij Cc: Maxime Coquelin Cc: Alexandre Torgue Link: https://lore.kernel.org/r/20210725180830.250218-1-maz@kernel.org Signed-off-by: Linus Walleij commit 8ae9e3f63865bc067c144817da9df025dbb667f2 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:52 2021 +0200 x86/mce/inject: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-10-bigeasy@linutronix.de commit 2089f34f8c5b91f7235023ec72e71e3247261ecc Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:51 2021 +0200 x86/microcode: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-9-bigeasy@linutronix.de commit 1a351eefd4acc97145903b1c07e4d8b626854b82 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:50 2021 +0200 x86/mtrr: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210803141621.780504-8-bigeasy@linutronix.de commit 77ad320cfb2ac172eeba32a77a388281b003ec17 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:49 2021 +0200 x86/mmiotrace: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Reviewed-by: Karol Herbst Reviewed-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/20210803141621.780504-7-bigeasy@linutronix.de commit a022135a19a1b2f8ee1f9e90d5d9de419543904c Author: Alexandre Torgue Date: Fri Jul 23 15:28:05 2021 +0200 pinctrl: stm32: Add STM32MP135 SoC support STM32MP135 SoC embeds 9 GPIO banks of 16 gpios each. Those GPIO banks contain same features as STM32MP157 GPIO banks except that each GPIO line of the STM32MP135 can be secured. Signed-off-by: Alexandre Torgue Acked-by: Arnd Bergmann commit 510fc3487b09ad4a921e18c60de7e3c634eb6e4e Author: Alexandre Torgue Date: Fri Jul 23 15:28:04 2021 +0200 dt-bindings: pinctrl: stm32: add new compatible for STM32MP135 SoC New compatible to manage ball out and pin muxing of STM32MP135 SoC. Signed-off-by: Alexandre Torgue Acked-by: Rob Herring Acked-by: Arnd Bergmann commit f51632cc0ed35b42d5ca1793e364e5942b236ae8 Author: Mikko Perttunen Date: Thu Jun 10 14:04:47 2021 +0300 drm/tegra: Extract tegra_gem_lookup() The static function host1x_bo_lookup() in drm.c is also useful elsewhere. Extract it as tegra_gem_lookup() in gem.c. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 2ac48d0d486d9dbdcca2e6d945031541d880df3b Author: Zhen Lei Date: Thu Jul 22 11:39:30 2021 +0800 pinctrl: single: Move test PCS_HAS_PINCONF in pcs_parse_bits_in_pinctrl_entry() to the beginning The value of pcs->flags is not overwritten in function pcs_parse_bits_in_pinctrl_entry() and its subfunctions, so moving this check to the beginning of the function eliminates unnecessary rollback operations. Signed-off-by: Zhen Lei Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20210722033930.4034-3-thunder.leizhen@huawei.com Signed-off-by: Linus Walleij commit d789a490d32fdf0465275e3607f8a3bc87d3f3ba Author: Zhen Lei Date: Thu Jul 22 11:39:29 2021 +0800 pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() Fix to return -ENOTSUPP instead of 0 when PCS_HAS_PINCONF is true, which is the same as that returned in pcs_parse_pinconf(). Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210722033930.4034-2-thunder.leizhen@huawei.com Signed-off-by: Linus Walleij commit 0fddaa85d66140466df8e848afcda452b7d7b416 Author: Mikko Perttunen Date: Thu Jun 10 14:04:46 2021 +0300 gpu: host1x: Add option to skip firewall for a job The new UAPI will have its own firewall, and we don't want to run the firewall in the Host1x driver for those jobs. As such, add a parameter to host1x_job_alloc to specify if we want to skip the firewall in the Host1x driver. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit e902585fc8b639f1a1258eaa6265e98994e34ef8 Author: Mikko Perttunen Date: Thu Jun 10 14:04:45 2021 +0300 gpu: host1x: Add support for syncpoint waits in CDMA pushbuffer Add support for inserting syncpoint waits in the CDMA pushbuffer. These waits need to be done in HOST1X class, while gather submitted by the application execute in engine class. Support is added by converting the gather list of job into a command list that can include both gathers and waits. When the job is submitted, these commands are pushed as the appropriate opcodes on the CDMA pushbuffer. Also supported are waits relative to the start of the job, which are useful for jobs doing multiple things with an engine that doesn't natively support pipelining. While at it, use 32-bit waits on chips that support them. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 17a298e9ac7c011e64a9c0b6f807b43f9af22eac Author: Mikko Perttunen Date: Thu Jun 10 14:04:44 2021 +0300 gpu: host1x: Add job release callback Add a callback field to the job structure, to be called just before the job is to be freed. This allows the job's submitter to clean up any of its own state, like decrement runtime PM refcounts. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit c78f837ae3d1e532ff4eb90155b42d7a2e892a3f Author: Mikko Perttunen Date: Thu Jun 10 14:04:43 2021 +0300 gpu: host1x: Add no-recovery mode Add a new property for jobs to enable or disable recovery i.e. CPU increments of syncpoints to max value on job timeout. This allows for a more solid model for hanged jobs, where userspace doesn't need to guess if a syncpoint increment happened because the job completed, or because job timeout was triggered. On job timeout, we stop the channel, NOP all future jobs on the channel using the same syncpoint, mark the syncpoint as locked and resume the channel from the next job, if any. The future jobs are NOPed, since because we don't do the CPU increments, the value of the syncpoint is no longer synchronized, and any waiters would become confused if a future job incremented the syncpoint. The syncpoint is marked locked to ensure that any future jobs cannot increment the syncpoint either, until the application has recognized the situation and reallocated the syncpoint. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 687db2207b1bc94ca34743871167923a6de78d85 Author: Mikko Perttunen Date: Thu Jun 10 14:04:42 2021 +0300 gpu: host1x: Add DMA fence implementation Add an implementation of dma_fences based on syncpoints. Syncpoint interrupts are used to signal fences. Additionally, after software signaling has been enabled, a 30 second timeout is started. If the syncpoint threshold is not reached within this period, the fence is signalled with an -ETIMEDOUT error code. This is to allow fences that would never reach their syncpoint threshold to be cleaned up. The timeout can potentially be removed in the future after job tracking code has been refactored. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 182700f258531c75846cb0f070e847e8b4c457b2 Author: Bjorn Andersson Date: Mon Jun 28 17:38:51 2021 -0700 pinctrl: qcom: spmi-gpio: Add pmc8180 & pmc8180c The SC8180x platform comes with PMC8180 and PMC8180c, add support for the GPIO controller in these PMICs. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210629003851.1787673-1-bjorn.andersson@linaro.org Signed-off-by: Linus Walleij commit 976c1de1de147bb7f4e0d87482f375221c05aeaf Author: Tony Lindgren Date: Tue Aug 10 11:17:27 2021 +0300 spi: spi-pic32: Fix issue with uninitialized dma_slave_config Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For spi-pic32, this is probably not currently an issue but is still good to fix though. Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver") Cc: Purna Chandra Mandal Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210810081727.19491-2-tony@atomide.com Signed-off-by: Mark Brown commit 209ab223ad5b18e437289235e3bde12593b94ac4 Author: Tony Lindgren Date: Tue Aug 10 11:17:26 2021 +0300 spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For spi-fsl-dspi, this is probably not currently an issue but is still good to fix though. Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Cc: Sanchayan Maity Cc: Vladimir Oltean Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Acked-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210810081727.19491-1-tony@atomide.com Signed-off-by: Mark Brown commit eb7ab747efd600382bc2e9406ea1fc2a867e9804 Author: Jack Yu Date: Tue Aug 10 10:08:34 2021 +0800 ASoC: dt-bindings: rt1015p: fix syntax error in dts-binding document Fix syntax error in dts-binding document. Signed-off-by: Jack Yu Fixes: 064478e4877c ("ASoC: dt-bindings: rt1015p: add new compatible id") Link: https://lore.kernel.org/r/20210810020834.32414-1-jack.yu@realtek.com Signed-off-by: Mark Brown commit f4eeaed04e861b95f1f2c911263f2fcaa959c078 Author: Curtis Malainey Date: Mon Aug 9 14:35:39 2021 -0700 ASoC: Intel: Fix platform ID matching Sparse warnings triggered truncating the IDs of some platform device tables. Unfortunately some of the IDs in the match tables were missed which breaks audio. The KBL change has been verified to fix audio, the CML change was not tested as it was found through grepping the broken changes and found to match the same situation in anticipation that it should also be fixed. Fixes: 94efd726b947 ("ASoC: Intel: kbl_da7219_max98357a: shrink platform_id below 20 characters") Fixes: 24e46fb811e9 ("ASoC: Intel: bxt_da7219_max98357a: shrink platform_id below 20 characters") Signed-off-by: Curtis Malainey Tested-by: Matt Davis Reviewed-by: Cezary Rojewski Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210809213544.1682444-1-cujomalainey@chromium.org Signed-off-by: Mark Brown commit 9ea0c7b3c200a54e42a4b5171970791e70dd4f53 Author: Lad Prabhakar Date: Tue Jul 27 14:30:22 2021 +0100 arm64: dts: renesas: r9a07g044: Add CANFD node Add CANFD node to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210727133022.634-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fb210df33dd969a5cc16aeba809c5e89430f7c4e Merge: b3f894354aa08 0b256c403d408 Author: Geert Uytterhoeven Date: Tue Aug 10 13:35:03 2021 +0200 Merge tag 'renesas-r9a07g044-dt-binding-defs-tag2' into HEAD Renesas RZ/G2L DT Binding Definitions Update Missing definition for the P0_DIV2 core clock on the Renesas RZ/G2L (R9A07G044) SoC, shared by driver and DT source files. commit b3f894354aa08eb853044a7f5029dbdfc7f3b792 Author: Lad Prabhakar Date: Wed Aug 4 21:21:18 2021 +0100 arm64: dts: renesas: r9a07g044: Add ADC node Add ADC node to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210804202118.25745-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b30d0289de72c62516df03fdad8d53f552c69839 Author: David Heidelberg Date: Mon Aug 9 19:07:30 2021 +0100 ARM: 9105/1: atags_to_fdt: don't warn about stack size The merge_fdt_bootargs() function by definition consumes more than 1024 bytes of stack because it has a 1024 byte command line on the stack, meaning that we always get a warning when building this file: arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs': arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] However, as this is the decompressor and we know that it has a very shallow call chain, and we do not actually risk overflowing the kernel stack at runtime here. This just shuts up the warning by disabling the warning flag for this file. Tested on Nexus 7 2012 builds. Acked-by: Nicolas Pitre Signed-off-by: David Heidelberg Signed-off-by: Arnd Bergmann Cc: Signed-off-by: Russell King (Oracle) commit a8675b2d4608aa86d7e5bbfce88cee670fb51191 Author: Lad Prabhakar Date: Tue Jul 27 12:23:27 2021 +0100 arm64: dts: renesas: r9a07g044: Add pinctrl node Add GPIO/pinctrl node to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210727112328.18809-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6fec92d9b2bfd2fb1a2a4295dc859d9bab16c8fc Author: Linus Walleij Date: Fri Jul 30 10:43:02 2021 +0100 ARM: 9103/1: Drop ARCH_NR_GPIOS definition The conditional by the generic header is the same, hence drop unnecessary duplication. Link: https://lore.kernel.org/r/20210510114107.43006-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit d7bcc5e22967c96685d03dbbd167e1a1ddf9b910 Author: Masahiro Yamada Date: Thu Jul 29 15:03:51 2021 +0100 ARM: 9102/1: move theinstall rules to arch/arm/Makefile Currently, the (z/u)install targets in arch/arm/Makefile descend into arch/arm/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/arm/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King (Oracle) commit b08cae33b88e5f80b419a504b9b8e5530dfc9565 Author: Randy Dunlap Date: Sat Jul 17 16:14:40 2021 +0100 ARM: 9100/1: MAINTAINERS: mark all linux-arm-kernel@infradead list as moderated Consistenly mark all entries of "linux-arm-kernel@lists.infradead.org" as moderated for non-subscribers. Signed-off-by: Randy Dunlap Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Signed-off-by: Russell King (Oracle) commit c755238d2ce0960ced9ffccc2ce14de2cd01b647 Author: Randy Dunlap Date: Sun Jul 11 23:31:43 2021 +0100 ARM: 9099/1: crypto: rename 'mod_init' & 'mod_exit' functions to be module-specific Rename module_init & module_exit functions that are named "mod_init" and "mod_exit" so that they are unique in both the System.map file and in initcall_debug output instead of showing up as almost anonymous "mod_init". This is helpful for debugging and in determining how long certain module_init calls take to execute. Signed-off-by: Randy Dunlap Cc: Jason A. Donenfeld Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Signed-off-by: Russell King (Oracle) commit 7958f88aa6636f1927513c887a00e83168f12e35 Author: Lad Prabhakar Date: Tue Jul 27 12:23:25 2021 +0100 dt-bindings: pinctrl: renesas: Add DT bindings for RZ/G2L pinctrl Add device tree binding documentation and header file for Renesas RZ/G2L pinctrl. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210727112328.18809-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit af579beb666aefb17e9a335c12c788c92932baf1 Author: Matthew Bobrowski Date: Sun Aug 8 15:26:25 2021 +1000 fanotify: add pidfd support to the fanotify API Introduce a new flag FAN_REPORT_PIDFD for fanotify_init(2) which allows userspace applications to control whether a pidfd information record containing a pidfd is to be returned alongside the generic event metadata for each event. If FAN_REPORT_PIDFD is enabled for a notification group, an additional struct fanotify_event_info_pidfd object type will be supplied alongside the generic struct fanotify_event_metadata for a single event. This functionality is analogous to that of FAN_REPORT_FID in terms of how the event structure is supplied to a userspace application. Usage of FAN_REPORT_PIDFD with FAN_REPORT_FID/FAN_REPORT_DFID_NAME is permitted, and in this case a struct fanotify_event_info_pidfd object will likely follow any struct fanotify_event_info_fid object. Currently, the usage of the FAN_REPORT_TID flag is not permitted along with FAN_REPORT_PIDFD as the pidfd API currently only supports the creation of pidfds for thread-group leaders. Additionally, usage of the FAN_REPORT_PIDFD flag is limited to privileged processes only i.e. event listeners that are running with the CAP_SYS_ADMIN capability. Attempting to supply the FAN_REPORT_TID initialization flags with FAN_REPORT_PIDFD or creating a notification group without CAP_SYS_ADMIN will result with -EINVAL being returned to the caller. In the event of a pidfd creation error, there are two types of error values that can be reported back to the listener. There is FAN_NOPIDFD, which will be reported in cases where the process responsible for generating the event has terminated prior to the event listener being able to read the event. Then there is FAN_EPIDFD, which will be reported when a more generic pidfd creation error has occurred when fanotify calls pidfd_create(). Link: https://lore.kernel.org/r/5f9e09cff7ed62bfaa51c1369e0f7ea5f16a91aa.1628398044.git.repnop@google.com Signed-off-by: Matthew Bobrowski Signed-off-by: Jan Kara commit 0aca67bb7f0d8c997dfef8ff0bfeb0afb361f0e6 Author: Matthew Bobrowski Date: Sun Aug 8 15:25:58 2021 +1000 fanotify: introduce a generic info record copying helper The copy_info_records_to_user() helper allows for the separation of info record copying routines/conditionals from copy_event_to_user(), which reduces the overall clutter within this function. This becomes especially true as we start introducing additional info records in the future i.e. struct fanotify_event_info_pidfd. On success, this helper returns the total amount of bytes that have been copied into the user supplied buffer and on error, a negative value is returned to the caller. The newly defined macro FANOTIFY_INFO_MODES can be used to obtain info record types that have been enabled for a specific notification group. This macro becomes useful in the subsequent patch when the FAN_REPORT_PIDFD initialization flag is introduced. Link: https://lore.kernel.org/r/8872947dfe12ce8ae6e9a7f2d49ea29bc8006af0.1628398044.git.repnop@google.com Signed-off-by: Matthew Bobrowski Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit d3424c9bac893bd06f38a20474cd622881d384ca Author: Matthew Bobrowski Date: Sun Aug 8 15:25:32 2021 +1000 fanotify: minor cosmetic adjustments to fid labels With the idea to support additional info record types in the future i.e. fanotify_event_info_pidfd, it's a good idea to rename some of the labels assigned to some of the existing fid related functions, parameters, etc which more accurately represent the intent behind their usage. For example, copy_info_to_user() was defined with a generic function label, which arguably reads as being supportive of different info record types, however the parameter list for this function is explicitly tailored towards the creation and copying of the fanotify_event_info_fid records. This same point applies to the macro defined as FANOTIFY_INFO_HDR_LEN. With fanotify_event_info_len(), we change the parameter label so that the function implies that it can be extended to calculate the length for additional info record types. Link: https://lore.kernel.org/r/7c3ec33f3c718dac40764305d4d494d858f59c51.1628398044.git.repnop@google.com Signed-off-by: Matthew Bobrowski Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit 490b9ba881e2c6337bb09b68010803ae98e59f4a Author: Matthew Bobrowski Date: Sun Aug 8 15:25:05 2021 +1000 kernel/pid.c: implement additional checks upon pidfd_create() parameters By adding the pidfd_create() declaration to linux/pid.h, we effectively expose this function to the rest of the kernel. In order to avoid any unintended behavior, or set false expectations upon this function, ensure that constraints are forced upon each of the passed parameters. This includes the checking of whether the passed struct pid is a thread-group leader as pidfd creation is currently limited to such pid types. Link: https://lore.kernel.org/r/2e9b91c2d529d52a003b8b86c45f866153be9eb5.1628398044.git.repnop@google.com Signed-off-by: Matthew Bobrowski Acked-by: Christian Brauner Signed-off-by: Jan Kara commit c576e0fcd6188d0edb50b0fb83f853433ef4819b Author: Matthew Bobrowski Date: Sun Aug 8 15:24:33 2021 +1000 kernel/pid.c: remove static qualifier from pidfd_create() With the idea of returning pidfds from the fanotify API, we need to expose a mechanism for creating pidfds. We drop the static qualifier from pidfd_create() and add its declaration to linux/pid.h so that the pidfd_create() helper can be called from other kernel subsystems i.e. fanotify. Link: https://lore.kernel.org/r/0c68653ec32f1b7143301f0231f7ed14062fd82b.1628398044.git.repnop@google.com Signed-off-by: Matthew Bobrowski Acked-by: Christian Brauner Signed-off-by: Jan Kara commit a4812d0b7fcf48420b1e981013b496a114003c76 Author: Gal Pressman Date: Mon Aug 9 15:22:46 2021 +0300 dma-buf: Fix a few typos in dma-buf documentation Fix a few typos in the documentation: - Remove an extraneous 'or' - 'unpins' -> 'unpin' - 'braket' -> 'bracket' - 'mappinsg' -> 'mappings' - 'fullfills' -> 'fulfills' Reviewed-by: Randy Dunlap Signed-off-by: Gal Pressman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210809122247.15869-1-galpress@amazon.com commit ae7471cae00a432d1c9692452b1b9175a8f3c1b3 Author: Phillip Potter Date: Tue Aug 10 08:45:04 2021 +0100 staging: r8188eu: remove rtw_ioctl function Remove rtw_ioctl function from os_dep/ioctl_linux.c, its declaration in include/osdep_intf.h, and finally its inclusion as the value of the .ndo_do_ioctl member of struct net_device_ops rtw_netdev_ops in os_dep/os_intfs.c. The e-mail from Arnd Bergmann at: https://lore.kernel.org/linux-next/CAK8P3a0WRMNmBmBDerZ0nWPdFZKALnxrj-uUFBkTP-MOtv48vg@mail.gmail.com explains the justification for this approach. Essentially, changes from net-next make the existing function and its use of SIOCDEVPRIVATE ioctls unworkable without changes. Functions called from rtw_ioctl that are now no longer accessible will be cleaned up in further patches. Additionally, once these changes have made their way downstream to the staging branch, we can modify and reconnect rtw_android_priv_cmd via ndo_siocdevprivate in struct net_device_ops. Suggested-by: Arnd Bergmann Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210810074504.957-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 1c69b0a861d12bad2f76f15d799e5a58742a0763 Author: Michael Straube Date: Mon Aug 9 18:50:07 2021 +0200 staging: r8188eu: remove remaining unnecessary parentheses in core dir Remove remaining unnecessary parentheses in core dir reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-18-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a8165f872b18db09494c21e32922445e7e0975dc Author: Michael Straube Date: Mon Aug 9 18:50:06 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c Remove unnecessary parentheses in core/rtw_cmd.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-17-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6cd1603cc2853a4892c8a9f86a3b219166720029 Author: Michael Straube Date: Mon Aug 9 18:50:05 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_ioctl_set.c Remove unnecessary parentheses in core/rtw_ioctl_set.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-16-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4fdda47ee4356a717f8a7ca3540f557ad6c52969 Author: Michael Straube Date: Mon Aug 9 18:50:04 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_io.c Remove unnecessary parentheses in core/rtw_io.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-15-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9355adf7e52f8f7d9aa23a8e967a6c86d097a9df Author: Michael Straube Date: Mon Aug 9 18:50:03 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_pwrctrl.c Remove unnecessary parentheses in core/rtw_pwrctrl.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-14-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 79c35b74513b5bc1160fec845ec09091ebff9696 Author: Michael Straube Date: Mon Aug 9 18:50:02 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_recv.c Remove unnecessary parentheses in core/rtw_recv.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-13-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e05b0ea4eb872f0563ef74cccd089be12c68cc29 Author: Michael Straube Date: Mon Aug 9 18:50:01 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_sta_mgt.c Remove unnecessary parentheses in core/rtw_sta_mgt.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9f527d09a1e862b78bfea5785c46420ccfefdb1 Author: Michael Straube Date: Mon Aug 9 18:50:00 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_xmit.c Remove unnecessary parentheses in core/rtw_xmit.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a8962b247ae37cd3e543cb465475fd7a627cccbc Author: Michael Straube Date: Mon Aug 9 18:49:59 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_mlme.c Remove unnecessary parentheses in core/rtw_mlme.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e293639ec5a9e95d54e140d0698987b213ec8815 Author: Michael Straube Date: Mon Aug 9 18:49:58 2021 +0200 staging: r8188eu: clean up comparsions to true/false Clean up some comparsions to true/false to clear chackpatch warnings. WARNING: Unnecessary parentheses - maybe == should be = ? Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7bc4f399dc11501bc160d54f2b4943f3a87e1bb8 Author: Michael Straube Date: Mon Aug 9 18:49:57 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_p2p.c Remove unnecessary parentheses in core/rtw_p2p.c. Most of them reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f6cf663a7258292098b19b6959f9ce87894f9c00 Author: Michael Straube Date: Mon Aug 9 18:49:56 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_led.c Remove unnecessary parentheses in core/rtw_led.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b5f7cd5fdfff005728e32a57e0b5817b8675f67d Author: Michael Straube Date: Mon Aug 9 18:49:55 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_wlan_util.c Remove unnecessary parentheses in core/rtw_wlan_util.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b79f4e84500e4985587232b3ac5ab386e2884f63 Author: Michael Straube Date: Mon Aug 9 18:49:54 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_ap.c Remove unnecessary parentheses in core/rtw_ap.c reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b522a11b504767ab245173da74b39395ff1ad0d Author: Michael Straube Date: Mon Aug 9 18:49:53 2021 +0200 staging: r8188eu: remove unnecessary parentheses in core/rtw_mlme_ext.c Remove unnecessary parentheses in core/rtw_mlme_ext.c. Most of them reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6839ff57baa4a600f78a63efa8bb9cfd78aa65ba Author: Michael Straube Date: Mon Aug 9 18:49:52 2021 +0200 staging: r8188eu: remove unnecessary parentheses in hal dir Remove unnecessary parentheses in the hal directory reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 76cdbbc582b682d9b139769c38dbad3fa6beeebf Author: Michael Straube Date: Mon Aug 9 18:49:51 2021 +0200 staging: r8188eu: remove unnecessary parentheses in os_dep dir Remove unnecessary parentheses in the os_dep directory reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210809165007.23204-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7929cc52986cc4d580ab7a74029037b3aa9f4583 Author: Saurav Girepunje Date: Sat Aug 7 15:52:32 2021 +0530 staging: rtl8723bs: os_dep: remove unused variable Remove below unused static variable from os_intfs.c rtw_enusbss rtw_hwpdn_mode rtw_hwpwrp_detect Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20210807102232.6674-5-saurav.girepunje@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3bb8fa376b8a21ccaf25bf64cc70a6a54cf343f8 Author: Saurav Girepunje Date: Sat Aug 7 15:52:31 2021 +0530 staging: rtl8192e: rtl8192e: rtl_core: remove unused global variable Remove unused global variable channels from rtl_core.c Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20210807102232.6674-4-saurav.girepunje@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2abc0000d2970bb631dd39a151b46ba334526130 Author: Martin Kaiser Date: Sat Aug 7 17:36:36 2021 +0200 staging: r8188eu: remove the RT_TRACE macro We've deleted all RT_TRACE calls. The macro itself can now be removed as well. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ac338b17bbf798f9baf2604f65c54c32c063f10c Author: Martin Kaiser Date: Sat Aug 7 17:36:35 2021 +0200 staging: r8188eu: remove unused DEBUG_OID macro The DEBUG_OID macro is not used and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit da2aa1ecad1c9fcbe8fb2c16d91dbe99d264667c Author: Martin Kaiser Date: Sat Aug 7 17:36:34 2021 +0200 staging: r8188eu: use IW_HANDLER to declare wext handlers Use the IW_HANDLER macro to declare the handler functions for wext ioctls. We don't have to skip unused ioctl numbers manually. The same modification was applied to the deprecated rtl8188eu driver in commit af249fce390f ("staging: rtl8188eu: use IW_HANDLER to declare wext handlers"). Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a8357683dbfea39573b3d854fbc56b636ba1ad3a Author: Martin Kaiser Date: Sat Aug 7 17:36:33 2021 +0200 staging: r8188eu: remove RT_TRACE prints from xmit_linux.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8be55d7a3043a6eb2b2217d6e13b46b170277ee8 Author: Martin Kaiser Date: Sat Aug 7 17:36:32 2021 +0200 staging: r8188eu: remove RT_TRACE prints from recv_linux.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bd285cab08d9cba3aca9ad3a6c45bc6c627ae79a Author: Martin Kaiser Date: Sat Aug 7 17:36:31 2021 +0200 staging: r8188eu: remove an RT_TRACE print from osdep_service.c We should use the standard mechanism for debug prints. Remove a print that uses a driver-specific macro. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3fbb0047d12851e0aa0b81371b07711d9347aa9e Author: Martin Kaiser Date: Sat Aug 7 17:36:30 2021 +0200 staging: r8188eu: remove RT_TRACE prints from os_intfs.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Handle errors from dev_alloc_name in one place instead of showing a debug print. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 34f231c525751d43a85a726049b52b34e4f98814 Author: Martin Kaiser Date: Sat Aug 7 17:36:29 2021 +0200 staging: r8188eu: remove RT_TRACE prints from mlme_linux.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ca3515d268e150744a04e1fa555ee91ef650ee2d Author: Martin Kaiser Date: Sat Aug 7 17:36:28 2021 +0200 staging: r8188eu: remove empty function With the RT_TRACE print removed, the rtw_wx_set_freq function is now empty. This function should be removed. At the moment, the setfreq ioctl returns success to the caller although the frequency wasn't set. It makes more sense to inform callers that this driver does not support setfreq. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 71931a7fa85859a76c8ac6ab8efe09ade729df46 Author: Martin Kaiser Date: Sat Aug 7 17:36:27 2021 +0200 staging: r8188eu: remove RT_TRACE prints from ioctl_linux.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7912bb6a4ec8fb1915c80c9c21c52e461162a04d Author: Martin Kaiser Date: Sat Aug 7 17:36:26 2021 +0200 staging: r8188eu: remove RT_TRACE prints from usb_ops_linux.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4f4991098dd0bd224954d864d807143b2ad78984 Author: Martin Kaiser Date: Sat Aug 7 17:36:25 2021 +0200 staging: r8188eu: remove RT_TRACE prints from usb_intf.c We should use the standard mechanism for debug prints. Remove the prints that use driver-specific macros. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210807153636.11712-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 96bee36bdf88f10420b27c47702a348dda12b80f Author: Fabio Aiuto Date: Sat Aug 7 11:48:13 2021 +0200 staging: rtl8723bs: remove unused RF_*T*R enum remove unused RF_*T*R enum, for rtl8723bs is only capable of 1T1R rf path so selection is not needed. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2f2f185a80fbec71af4a165180ed0156d194c96e.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 854a3b21ddd95157f444a60cf73950851fcd05dd Author: Fabio Aiuto Date: Sat Aug 7 11:48:12 2021 +0200 staging: rtl8723bs: fix tx power tables size fix sizes of tx power tables to the real used values (i.e. 2 bandwidth, 3 rate sections). Delete MAX_BASE_NUM_IN_PHY_REG_PG_2_4 macro in this process, for it expands to a larger than needed rate section index value. Modify comments accordingly. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5f52295a8b17f68ad80ffb7b6301da83bfc11a68.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit c4c7c7182ea4dc15d4fe53b5e9611c1fd35e1c57 Author: Fabio Aiuto Date: Sat Aug 7 11:48:11 2021 +0200 staging: rtl8723bs: use MAX_RF_PATH_NUM as ceiling to rf path index use MAX_RF_PATH_NUM as ceiling to rf path index. Only 2 rf paths are used, not 4. Remove also TX_POWER_BY_RATE_NUM_RF left unused. Use RF_PATH_A as loop starting point instead of hardcoded 0, as in other places. Related comments modified accordingly. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/88da23cef57131b39a63b2757b91f959553dd65d.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit da4c99c261bca220f364fc630e8987a60d605e8d Author: Fabio Aiuto Date: Sat Aug 7 11:48:10 2021 +0200 staging: rtl8723bs: remove RF_*TX enum remove RF_*TX enum, its only used value is RF_1TX. So remove it and remove all indexes and loop over these enum items. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/3acc624742a933d90e83a83babb4eecb193cf869.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1b09e3886a983b3ba2a092b12a8d85028332b939 Author: Fabio Aiuto Date: Sat Aug 7 11:48:09 2021 +0200 staging: rtl8723bs: remove unused macro in include/hal_data.h remove unused macro in include/hal_data.h Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/13b4f41247d1b8bc10f0576d82e4dc9a285d88e1.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 05d7d4ba4bcc0bbadf6f5ecfb27612d8c6994bea Author: Fabio Aiuto Date: Sat Aug 7 11:48:08 2021 +0200 staging: rtl8723bs: remove unused rtw_rf_config module param remove unused rtw_rf_config module param and struct field used to store the param value. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a83eaa9b2350d3d16f5b1dddc40870e0f0a6df06.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 24e65aac94578765c8796511e769c08219d52ed9 Author: Fabio Aiuto Date: Sat Aug 7 11:48:07 2021 +0200 staging: rtl8723bs: remove rf type branching (fourth patch) remove all function calls to rtw_get_hw_reg made to read HW_VAR_RF_TYPE and get value of rt_type, which is always 1T1R. Clean up code on removal sites, keeping 1T1R code unconditionally. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8ca2f788c42d81b9cb4dbc46e23c7549dc27d081.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit f75b87a61880ba518c1e712fe033de62b7b9527d Author: Fabio Aiuto Date: Sat Aug 7 11:48:06 2021 +0200 staging: rtl8723bs: remove rf type branching (third patch) remove rf_type struct member, keep all 1T1R code unconditionally, remove the other *T*R branches. Removed dead code related to MCS indexes above 7. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/e626790eb8bd7d96f939e1bbb47b899bf12dab0d.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9d535e9286c8c04f845030e8d888009753cc9269 Author: Fabio Aiuto Date: Sat Aug 7 11:48:05 2021 +0200 staging: rtl8723bs: remove rf type branching (second patch) remove RFType field in dm_odm_t struct, keep unconditioned all code branches related to 1T1R path, delete the others. Remove unused variable to silence gcc warning. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/fd41fbfba16df2b93a7593c1f853a874255e945c.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9df030033e05c9106ca9cefff021998bdb19a9db Author: Fabio Aiuto Date: Sat Aug 7 11:48:04 2021 +0200 staging: rtl8723bs: remove rf type branching (first patch) remove rf type branching, for the baseband works only on 1T1R rf type, so just keep code branches related to 1T1R. Remove RFType from hal_version struct, and all related code. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/72ce98106bb172fce0f43315bc4dbbb7065afef5.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit cddb75f307da56e5079059815dc7558ec6b709e5 Author: Fabio Aiuto Date: Sat Aug 7 11:48:03 2021 +0200 staging: rtl8723bs: remove unused struct member remove unused bIsMPChip struct member and all code storing it. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/ad7831868683a99598cd00a3aacc45f76ba234e8.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit b2f29c8a6baee889fd6d6aa93ca224fed576ed43 Author: Fabio Aiuto Date: Sat Aug 7 11:48:02 2021 +0200 staging: rtl8723bs: remove unused macros remove unused macros in hal/odm_HWConfig.h Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/00575e78b23e36edb3a7e404e26a3c5e84394f3d.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61b919fe3df685a3fa310c44d5ce608f08d679b5 Author: Fabio Aiuto Date: Sat Aug 7 11:48:01 2021 +0200 staging: rtl8723bs: clean driver from unused RF paths rtl8723bs support only two rf paths (A and B), remove all the others (C, D, BC, ...) as they are unused. Keep just one enum selecting rf path, remove unused macro indicating max rf path number, add an item in rf_path enum for this pourpose. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/23060c85ab9aa468c9c021378f0dc8a8f887a578.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit e3678dc1ea40425b7218c20e2fe7b00a72f23a41 Author: Fabio Aiuto Date: Sat Aug 7 11:48:00 2021 +0200 staging: rtl8723bs: fix right side of condition TxNum value is compared against ODM_RF_PATH_D, which is inconsistent. Compare it against RF_MAX_TX_NUM, as in other places in the same file. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/147631fe6f4f5de84cc54a62ba71d739b92697be.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3bd25c9557a8a16e777eb8513b013125785d7d88 Author: Fabio Aiuto Date: Sat Aug 7 11:47:59 2021 +0200 staging: rtl8723bs: beautify function ODM_PhyStatusQuery() beautify function ODM_PhyStatusQuery(). Fix camel case name, put more than one argument per line, fix camel case in arugment names. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5e17b5ece9dbeb526f7a9aff147bf8767d39395c.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit c328eee4ff9d2dc6056b6068b787dc72f7a83934 Author: Fabio Aiuto Date: Sat Aug 7 11:47:58 2021 +0200 staging: rtl8723bs: remove wrapping static function remove unneeded wrapping static function in hal/odm_HWConif.c Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/786fc4d72db2a4b5e22c95e0e1437cfb734e1218.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56f0c0df5e7216100990d8a3896e6cb52e0effe6 Author: Fabio Aiuto Date: Sat Aug 7 11:47:57 2021 +0200 staging: rtl8723bs: remove empty files remove empty files after function move, hal/odm_RTL8723B.h has only an unused macro declaration. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/92cba6beb56150635ab4c7985d733c93fba7fe83.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4db87ba2b69c695831ce833b3f1f5d5991fb7e7f Author: Fabio Aiuto Date: Sat Aug 7 11:47:56 2021 +0200 staging: rtl8723bs: move function to file hal/odm_HWConfig.c move function odm_cck_rssi() to hal/odm_HWConfig.c. As it is used only in this file turn it to static. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c2bb14c3d32d3a654df95288751f0bc8cd6566b0.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit caa976ebf922f8ff68f32037430b9c7d9c9beba5 Author: Fabio Aiuto Date: Sat Aug 7 11:47:55 2021 +0200 staging: rtl8723bs: do some code cleaning in modified function do some code cleaning after changes of previous commit. Fixed comments, camel case names, variable naming conventions; kept function names without chip series numbers (this is just code for 8723), fixed indentations, blank lines and other minor stuff. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2bddef34cebdf35666d8abec4462c1a8d30c8c60.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7942bdd45549770e4b223cb95c055fad0a9796cf Author: Fabio Aiuto Date: Sat Aug 7 11:47:54 2021 +0200 staging: rtl8723bs: remove unneeded loop remove unneeded loop over multiple spatial streams as phy only works on 1 spatial stream. Removed commented code, removed condition always satisfied, beautified comments. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/45f2ed02b8e5bb25057da6e7dc3e7c8713a1a2c0.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0d6dc43772a6a5101ae43548a2716e5b5b249543 Author: Fabio Aiuto Date: Sat Aug 7 11:47:53 2021 +0200 staging: rtl8723bs: remove code related to unsupported MCS index values remove code related to MCS index from 8 to 31 for rtl8723bs works only with index from 0 to 7 and index 32. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/1d5c8ca570a9f1880864f37099d625f96ea4a1d1.1628329348.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit dfac77baa2837a9a4ac66015234854ebccb85bf1 Author: Larry Finger Date: Fri Aug 6 16:32:35 2021 -0500 staging: r8188eu: Fix potential memory leak or NULL dereference In routine c2h_wk_callback(() following a kmalloc() call, the error recovery is flawed. If the kmalloc() returns a pointer that is not NULL, and the following c2h_evt_read() fails, the code will leak that buffer. If the kmalloc() fails, a NULL dereference will occur in the following code. Reported-by: Dan Carpenter Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210806213235.22349-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 859c57f606c78cb8b33cabbd22ad1d4ff9f80e4e Author: Kees Cook Date: Fri Aug 6 13:14:22 2021 -0700 staging: rtl8723bs: Avoid field-overflowing memcpy() In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Adjust memcpy() destination to be the named structure itself, rather than the first member, allowing memcpy() to correctly reason about the size. "objdump -d" shows no object code changes. Cc: Ross Schmidt Cc: Joe Perches Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210806201422.2871679-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 1b3c6cccda3f012ffab8287f1d6151492055340e Author: Kees Cook Date: Fri Aug 6 13:12:07 2021 -0700 staging: rtl8192u: Avoid field-overflowing memcpy() In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't think an overflowing memcpy() happens against the addr1 field (the neighbors are intended to be copied as well). ieee80211_read_qos_param_element() copies a struct ieee80211_info_element into a struct ieee80211_qos_information_element, but is actually wanting to copy into the larger struct ieee80211_qos_parameter_info (the contents of ac_params_record[] is later examined). Refactor the routine to perform centralized checks, and copy the entire contents directly (since the id and len members match the elementID and length members): struct ieee80211_info_element { u8 id; u8 len; u8 data[]; } __packed; struct ieee80211_qos_information_element { u8 elementID; u8 length; u8 qui[QOS_OUI_LEN]; u8 qui_type; u8 qui_subtype; u8 version; u8 ac_info; } __packed; struct ieee80211_qos_parameter_info { struct ieee80211_qos_information_element info_element; u8 reserved; struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __packed; Additionally replace old-style zero-element arrays with flexible arrays. Cc: Greg Kroah-Hartman Cc: Pascal Terjan Cc: Christophe JAILLET Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210806201208.2871467-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit ada0e6dbbb098350e0cb7fd32672ba4fd98500fc Author: Kees Cook Date: Fri Aug 6 13:11:06 2021 -0700 staging: rtl8192e: Avoid field-overflowing memcpy() In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't think an overflowing memcpy() happens against the addr1 field (the neighbors are intended to be copied as well). rtllib_read_qos_param_element() copies a struct rtllib_info_element into a struct rtllib_qos_information_element, but is actually wanting to copy into the larger struct rtllib_qos_parameter_info (the contents of ac_params_record[] is later examined). Refactor the routine to perform centralized checks, and copy the entire contents directly (since the id and len members match the elementID and length members): struct rtllib_info_element { u8 id; u8 len; u8 data[]; } __packed; struct rtllib_qos_information_element { u8 elementID; u8 length; u8 qui[QOS_OUI_LEN]; u8 qui_type; u8 qui_subtype; u8 version; u8 ac_info; } __packed; struct rtllib_qos_parameter_info { struct rtllib_qos_information_element info_element; u8 reserved; struct rtllib_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __packed; Cc: Darshan D V Cc: Aditya Srivastava Cc: devel@driverdev.osuosl.org Cc: Larry Finger Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210806201106.2871169-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 69c92a749b89a7654084d0afd774018008a8de49 Author: Ojaswin Mujoo Date: Mon Aug 2 23:12:11 2021 +0530 staging: vchiq: Add details to Kconfig help texts Add some details to the Kconfig definitions of $CONFIG_VCHIQ_CDEV and $CONFIG_BCM2835_VCHIQ to help make the motive behind the configs a bit more clear. Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/ab88d3222088aca29a319147b50a9d1e9f0f8b81.1627925241.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit bb13dc2b3d8a7c6157ecaf680c435e7b2fbe4613 Author: Ojaswin Mujoo Date: Mon Aug 2 23:12:10 2021 +0530 staging: vchiq: Set $CONFIG_BCM2835_VCHIQ to imply $CONFIG_VCHIQ_CDEV Before $CONFIG_VCHIQ_CDEV was defined, the vchiq cdev used to be created unconditionally when CONFIG_BCM2835_VCHIQ=y. When an earlier commit introduced the new config, its default behavior was set to disabled, which might surprise some unsuspecting users. Hence, modify CONFIG_BCM2835_VCHIQ to imply CONFIG_VCHIQ_CDEV Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/da53207b24bc37f166b05c6835087becdc6b5b4d.1627925241.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit 874be05f525e87768daf0f47b494dc83b9537243 Author: Johan Almbladh Date: Mon Aug 9 11:18:29 2021 +0200 bpf, tests: Add tail call test suite While BPF_CALL instructions were tested implicitly by the cBPF-to-eBPF translation, there has not been any tests for BPF_TAIL_CALL instructions. The new test suite includes tests for tail call chaining, tail call count tracking and error paths. It is mainly intended for JIT development and testing. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-15-johan.almbladh@anyfinetworks.com commit 6a3b24ca489ea01d5b4d5a2539e75dfb5e1e18be Author: Johan Almbladh Date: Mon Aug 9 11:18:28 2021 +0200 bpf, tests: Add tests for BPF_CMPXCHG Tests for BPF_CMPXCHG with both word and double word operands. As with the tests for other atomic operations, these tests only check the result of the arithmetic operation. The atomicity of the operations is not tested. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-14-johan.almbladh@anyfinetworks.com commit e4517b3637c648b215307e3343900ec675fde607 Author: Johan Almbladh Date: Mon Aug 9 11:18:27 2021 +0200 bpf, tests: Add tests for atomic operations Tests for each atomic arithmetic operation and BPF_XCHG, derived from old BPF_XADD tests. The tests include BPF_W/DW and BPF_FETCH variants. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-13-johan.almbladh@anyfinetworks.com commit 53e33f9928cd61272e8e7902a876cb8cdf3f5c07 Author: Johan Almbladh Date: Mon Aug 9 11:18:26 2021 +0200 bpf, tests: Add test for 32-bit context pointer argument passing On a 32-bit architecture, the context pointer will occupy the low half of R1, and the other half will be zero. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809091829.810076-12-johan.almbladh@anyfinetworks.com commit 66e5eb8474554bc021e8a221c336bdaef13f7a69 Author: Johan Almbladh Date: Mon Aug 9 11:18:25 2021 +0200 bpf, tests: Add branch conversion JIT test Some JITs may need to convert a conditional jump instruction to to short PC-relative branch and a long unconditional jump, if the PC-relative offset exceeds offset field width in the CPU instruction. This test triggers such branch conversion on the 32-bit MIPS JIT. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809091829.810076-11-johan.almbladh@anyfinetworks.com commit e5009b4636cb593c06243197fd0742ed2e6ac510 Author: Johan Almbladh Date: Mon Aug 9 11:18:24 2021 +0200 bpf, tests: Add word-order tests for load/store of double words A double word (64-bit) load/store may be implemented as two successive 32-bit operations, one for each word. Check that the order of those operations is consistent with the machine endianness. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-10-johan.almbladh@anyfinetworks.com commit 84024a4e86d9b2085f3444190b30d5f88c76e07b Author: Johan Almbladh Date: Mon Aug 9 11:18:23 2021 +0200 bpf, tests: Add tests for ALU operations implemented with function calls 32-bit JITs may implement complex ALU64 instructions using function calls. The new tests check aspects related to this, such as register clobbering and register argument re-ordering. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809091829.810076-9-johan.almbladh@anyfinetworks.com commit faa576253d5fe757f0c573ef7e183b3416c58dae Author: Johan Almbladh Date: Mon Aug 9 11:18:22 2021 +0200 bpf, tests: Add more ALU64 BPF_MUL tests This patch adds BPF_MUL tests for 64x32 and 64x64 multiply. Mainly testing 32-bit JITs that implement ALU64 operations with two 32-bit CPU registers per operand. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809091829.810076-8-johan.almbladh@anyfinetworks.com commit 3b9890ef80f4285d32f2274d20db108e064e5e9e Author: Johan Almbladh Date: Mon Aug 9 11:18:21 2021 +0200 bpf, tests: Add more BPF_LSH/RSH/ARSH tests for ALU64 This patch adds a number of tests for BPF_LSH, BPF_RSH amd BPF_ARSH ALU64 operations with values that may trigger different JIT code paths. Mainly testing 32-bit JITs that implement ALU64 operations with two 32-bit CPU registers per operand. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809091829.810076-7-johan.almbladh@anyfinetworks.com commit 0f2fca1ab18319dcb47f6b15b7c5d3f29da84b6d Author: Johan Almbladh Date: Mon Aug 9 11:18:20 2021 +0200 bpf, tests: Add more ALU32 tests for BPF_LSH/RSH/ARSH This patch adds more tests of ALU32 shift operations BPF_LSH and BPF_RSH, including the special case of a zero immediate. Also add corresponding BPF_ARSH tests which were missing for ALU32. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-6-johan.almbladh@anyfinetworks.com commit ba89bcf78fba8ff99d84b762c56fbfdabc97731c Author: Johan Almbladh Date: Mon Aug 9 11:18:19 2021 +0200 bpf, tests: Add more tests of ALU32 and ALU64 bitwise operations This patch adds tests of BPF_AND, BPF_OR and BPF_XOR with different magnitude of the immediate value. Mainly checking 32-bit JIT sub-word handling and zero/sign extension. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-5-johan.almbladh@anyfinetworks.com commit e92c813bf1193248dd9f938e76af545fa9cf7361 Author: Johan Almbladh Date: Mon Aug 9 11:18:18 2021 +0200 bpf, tests: Fix typos in test case descriptions This patch corrects the test description in a number of cases where the description differed from what was actually tested and expected. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-4-johan.almbladh@anyfinetworks.com commit 565731acfcf28ffdaeeae3f03f3ced719f30bd99 Author: Johan Almbladh Date: Mon Aug 9 11:18:17 2021 +0200 bpf, tests: Add BPF_MOV tests for zero and sign extension Tests for ALU32 and ALU64 MOV with different sizes of the immediate value. Depending on the immediate field width of the native CPU instructions, a JIT may generate code differently depending on the immediate value. Test that zero or sign extension is performed as expected. Mainly for JIT testing. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-3-johan.almbladh@anyfinetworks.com commit b55dfa850015453144c969208a7518e7095259a4 Author: Johan Almbladh Date: Mon Aug 9 11:18:16 2021 +0200 bpf, tests: Add BPF_JMP32 test cases An eBPF JIT may implement JMP32 operations in a different way than JMP, especially on 32-bit architectures. This patch adds a series of tests for JMP32 operations, mainly for testing JITs. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210809091829.810076-2-johan.almbladh@anyfinetworks.com commit d692a637b4c5151a064f1eabd404944b31e28336 Author: Muhammad Falak R Wani Date: Mon Aug 9 12:30:46 2021 +0530 samples, bpf: Add an explict comment to handle nested vlan tagging. A codeblock for handling nested vlan trips newbies into thinking it as duplicate code. Explicitly add a comment to clarify. Signed-off-by: Muhammad Falak R Wani Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210809070046.32142-1-falakreyaz@gmail.com commit 446a98b19fd6da97a1fb148abb1766ad89c9b767 Author: Thomas Gleixner Date: Thu Jul 29 23:51:58 2021 +0200 PCI/MSI: Use new mask/unmask functions Switch the PCI/MSI core to use the new mask/unmask functions. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729222543.311207034@linutronix.de commit fcacdfbef5a1633211ebfac1b669a7739f5b553e Author: Thomas Gleixner Date: Mon Aug 9 21:08:56 2021 +0200 PCI/MSI: Provide a new set of mask and unmask functions The existing mask/unmask functions are convoluted and generate suboptimal assembly code. Provide a new set of functions which will be used in later patches to replace the exisiting ones. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/875ywetozb.ffs@tglx commit 7327cefebb85d440fa6a589fdf53979d55b29a5a Author: Thomas Gleixner Date: Thu Jul 29 23:51:56 2021 +0200 PCI/MSI: Cleanup msi_mask() msi_mask() is calculating the possible mask bits for MSI per vector masking. Rename it to msi_multi_mask() and hand the MSI descriptor pointer into it to simplify the call sites. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729222543.203905260@linutronix.de commit b296ababcc4bbf8efbb603d3aec6024a78662c1b Author: Thomas Gleixner Date: Thu Jul 29 23:51:55 2021 +0200 PCI/MSI: Deobfuscate virtual MSI-X Handling of virtual MSI-X is obfuscated by letting pci_msix_desc_addr() return NULL and checking the pointer. Just use msi_desc::msi_attrib.is_virtual at the call sites and get rid of that pointer check. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729222543.151522318@linutronix.de commit 8eb5ce3f78a5e5d3f1a12248f6b7dc64ebf71da6 Author: Thomas Gleixner Date: Thu Jul 29 23:51:54 2021 +0200 PCI/MSI: Consolidate error handling in msi_capability_init() Three error exits doing exactly the same ask for a common error exit point. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729222543.098828720@linutronix.de commit 67961e77a39b8e975dd1906179b9224f29150357 Author: Thomas Gleixner Date: Thu Jul 29 23:51:53 2021 +0200 PCI/MSI: Rename msi_desc::masked msi_desc::masked is a misnomer. For MSI it's used to cache the MSI mask bits when the device supports per vector masking. For MSI-X it's used to cache the content of the vector control word which contains the mask bit for the vector. Replace it with a union of msi_mask and msix_ctrl to make the purpose clear and fix up the usage sites. No functional change Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729222543.045993608@linutronix.de commit a6e8b946508cda3c3bf0f9b0e133d293dc9754f6 Author: Thomas Gleixner Date: Thu Jul 29 23:51:52 2021 +0200 PCI/MSI: Simplify msi_verify_entries() No point in looping over all entries when 64bit addressing mode is enabled for nothing. Signed-off-by: Thomas Gleixner Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210729222542.992849326@linutronix.de commit 3998527d2e3ee2bfdf710a45b7b90968ff87babc Author: Thomas Gleixner Date: Thu Jul 29 23:51:51 2021 +0200 s390/pci: Do not mask MSI[-X] entries on teardown The PCI core already ensures that the MSI[-X] state is correct when MSI[-X] is disabled. For MSI the reset state is all entries unmasked and for MSI-X all vectors are masked. S390 masks all MSI entries and masks the already masked MSI-X entries again. Remove it and let the device in the correct state. Signed-off-by: Thomas Gleixner Tested-by: Niklas Schnelle Tested-by: Marc Zyngier Reviewed-by: Marc Zyngier Acked-by: Niklas Schnelle Link: https://lore.kernel.org/r/20210729222542.939798136@linutronix.de commit 4b41ea606e535d47636ac4f5283834e9f6c5fa53 Merge: d92df42d76854 ff363f480e599 Author: Thomas Gleixner Date: Tue Aug 10 11:01:42 2021 +0200 Merge branch 'irq/urgent' into irq/core to pick up fixes on which further changes depend on. commit c6cf488e3bfdf92427686317d99e0342516753de Author: Christian Hewitt Date: Wed Aug 4 14:02:58 2021 +0000 arm64: dts: meson: add audio playback to vega-s95 dtsi Add initial support limited to HDMI i2s and SPDIF (LPCM). Tested-by: Oleg Ivanov <150balbes@yandex.ru> Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210804140258.4666-1-christianshewitt@gmail.com commit c7f5675b345224f212a0006c73a643182e953a5f Author: Christian Hewitt Date: Wed Aug 4 14:00:29 2021 +0000 arm64: dts: meson: add audio playback to nexbox-a1 Add initial support limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210804140029.4445-1-christianshewitt@gmail.com commit 29fabf5274bfb89124918840c79851659a25ba79 Author: Paul Barker Date: Fri Aug 6 09:59:07 2021 +0100 ARM: dts: am335x-sancloud-bbe: Drop usb wifi comment The wifi chip on USB port 4 may not be present on all BBE variants. Signed-off-by: Paul Barker Signed-off-by: Tony Lindgren commit 7244c8af762a0e2ad09d58a71d7440cbd7d6ccb7 Author: Paul Barker Date: Fri Aug 6 09:59:06 2021 +0100 ARM: dts: am335x-sancloud-bbe: Fix missing pinctrl refs pinctrl settings for the USB hub, barometer & accelerometer need to be referenced from the relevant nodes to work. Signed-off-by: Paul Barker Signed-off-by: Tony Lindgren commit 83da6ad6f97e192da49ec479d7811b5f97144d81 Author: Colin Ian King Date: Wed Aug 4 15:33:19 2021 +0100 scsi: pm8001: Remove redundant initialization of variable 'rv' The variable 'rv' is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210804143319.115340-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit 102851fc9a0d5ac8ea8b3e833f565dc1955b67cc Author: Colin Ian King Date: Wed Aug 4 14:32:41 2021 +0100 scsi: ufs: ufshpb: Remove redundant initialization of variable 'lba' The variable 'lba' is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210804133241.113509-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit e71dd41ea002ad73111c2c77d6ce45724ad58ca6 Author: Colin Ian King Date: Wed Aug 4 14:24:51 2021 +0100 scsi: elx: efct: Remove redundant initialization of variable 'ret' The variable 'ret' is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210804132451.113086-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit 632c4ae6da1d629eddf9da1e692d7617c568c256 Author: Wei Li Date: Thu Jul 15 11:26:25 2021 +0800 scsi: fdomain: Fix error return code in fdomain_probe() If request_region() fails the return value is not set. Return -EBUSY on error. Link: https://lore.kernel.org/r/20210715032625.1395495-1-liwei391@huawei.com Fixes: 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support") Reported-by: Hulk Robot Signed-off-by: Wei Li Signed-off-by: Martin K. Petersen commit e9b1adb7c5e35dccace0341db4d9e9c9fb40eeef Author: Colin Ian King Date: Fri Aug 6 12:23:13 2021 +0100 scsi: snic: Remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read, the assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210806112313.12434-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit bf25967ac54129ffb676ee0dbe3b8b34af6c6232 Author: Adrian Hunter Date: Fri Aug 6 16:04:41 2021 +0300 scsi: ufshcd: Fix device links when BOOT WLUN fails to probe Managed device links are deleted by device_del(). However it is possible to add a device link to a consumer before device_add(), and then discovering an error prevents the device from being used. In that case normally references to the device would be dropped and the device would be deleted. However the device link holds a reference to the device, so the device link and device remain indefinitely (unless the supplier is deleted). For UFSHCD, if a LUN fails to probe (e.g. absent BOOT WLUN), the device will not have been registered but can still have a device link holding a reference to the device. The unwanted device link will prevent runtime suspend indefinitely. Amend device link removal to accept removal of a link with an unregistered consumer device (suggested by Rafael), and fix UFSHCD by explicitly deleting the device link when SCSI destroys the SCSI device. Link: https://lore.kernel.org/r/a1c9bac8-b560-b662-f0aa-58c7e000cbbd@intel.com Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Reviewed-by: Rafael J. Wysocki Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit a5402cdcc2a925835db89ea336909b2b724189df Author: Colin Ian King Date: Fri Aug 6 15:43:01 2021 +0100 scsi: ufs: Fix unsigned int compared with less than zero Variable 'tag' is currently an unsigned int and is being compared to less than zero, this check is always false. Fix this by making 'tag' an int. Link: https://lore.kernel.org/r/20210806144301.19864-1-colin.king@canonical.com Fixes: 4728ab4a8e64 ("scsi: ufs: Remove ufshcd_valid_tag()") Reviewed-by: Bart Van Assche Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Macro compares unsigned to 0") commit 4758fd91d5a07d46be1101d6d47b289ed5d904d0 Author: Damien Le Moal Date: Sat Aug 7 13:18:59 2021 +0900 scsi: mpt3sas: Introduce sas_ncq_prio_supported sysfs sttribute Similarly to AHCI, introduce the device sysfs attribute sas_ncq_prio_supported to advertise if a SATA device supports the NCQ priority feature. Without this new attribute, the user can only discover if a SATA device supports NCQ priority by trying to enable the feature use with the sas_ncq_prio_enable sysfs device attribute, which fails when the device does not support high prioity commands. Link: https://lore.kernel.org/r/20210807041859.579409-11-damien.lemoal@wdc.com Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit cdc1767698a2ab5334e788cf4303b83490858391 Author: Suganath Prabu S Date: Mon Aug 9 12:56:39 2021 +0530 scsi: mpt3sas: Update driver version to 39.100.00.00 Update driver version to 39.100.00.00. Link: https://lore.kernel.org/r/20210809072639.21228-3-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit 787f2448c23603d658d955402b166e1dde0dc1e5 Author: Suganath Prabu S Date: Mon Aug 9 12:56:38 2021 +0530 scsi: mpt3sas: Use firmware recommended queue depth Currently, the mpt3sas driver sets the default queue depth based on the physical interface of the attached device: - SAS : 254 - SATA: 32 - NVMe: 128 The IOC firmware provides a recommended queue depth for each device through SAS IO Unit Page1 for SAS/SATA and PCIe IO Unit Page 1 for NVMe devices. If the host sets the queue depth greater than the firmware recommended value, then the IOC places the I/Os above the recommended queue depth in an internal pending queue. This consumes outstanding host-credit/resources, thereby leading to potential starvation of other devices. To avoid this, use the device depth recommended by the IOC firmware. Link: https://lore.kernel.org/r/20210809072639.21228-2-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit 44f88ef3c9f1edf4f8229508649965d85bc6f186 Author: Sreekanth Reddy Date: Tue Aug 3 12:21:34 2021 +0530 scsi: mpt3sas: Bump driver version to 38.100.00.00 Bump driver version to 38.100.00.00. Link: https://lore.kernel.org/r/20210803065134.19090-1-sreekanth.reddy@broadcom.com Reviewed-by: Lee Duncan Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 432bc7caef4eaacc1101ee2569bb870bdfeed7ce Author: Sreekanth Reddy Date: Tue Jul 27 13:42:12 2021 +0530 scsi: mpt3sas: Add io_uring iopoll support Enable the driver to work in non-IRQ mode, i.e. there will not be any MSI-X vectors associated with queues dedicated to polling. The IOC hardware is single submission queue and multiple reply queue. However, using the shared host tagset support it is possible to simulate multiple hardware queues. When poll_queues are enabled through the module parameter, the driver will allocate extra reply queues without an MSI-X association. All I/O completion on these queues will be done through the iopoll interface. Link: https://lore.kernel.org/r/20210727081212.2742-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit da20b58d5bbbb0d23ae9530992a37d0f0d1787a4 Author: Colin Ian King Date: Fri Aug 6 12:06:01 2021 +0100 xen-blkfront: Remove redundant assignment to variable err The variable err is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210806110601.11386-1-colin.king@canonical.com Signed-off-by: Jens Axboe commit f12b034afeb3a977bbb1c6584dedc0f3dc666f14 Author: Nick Desaulniers Date: Fri Aug 6 10:27:01 2021 -0700 scripts/Makefile.clang: default to LLVM_IAS=1 LLVM_IAS=1 controls enabling clang's integrated assembler via -integrated-as. This was an explicit opt in until we could enable assembler support in Clang for more architecures. Now we have support and CI coverage of LLVM_IAS=1 for all architecures except a few more bugs affecting s390 and powerpc. This commit flips the default from opt in via LLVM_IAS=1 to opt out via LLVM_IAS=0. CI systems or developers that were previously doing builds with CC=clang or LLVM=1 without explicitly setting LLVM_IAS must now explicitly opt out via LLVM_IAS=0, otherwise they will be implicitly opted-in. This finally shortens the command line invocation when cross compiling with LLVM to simply: $ make ARCH=arm64 LLVM=1 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 52cc02b910284d6bddba46cce402044ab775f314 Author: Masahiro Yamada Date: Fri Aug 6 00:01:02 2021 +0900 kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS LLVM_IAS is the user interface to set the -(no-)integrated-as flag, and it should be used only for that purpose. LLVM_IAS is checked in some places to determine the assembler type, but it is not precise. For example, $ make CC=gcc LLVM_IAS=1 ... will use the GNU assembler (i.e. binutils) since LLVM_IAS=1 is effective only when $(CC) is clang. Of course, 'CC=gcc LLVM_IAS=1' is an odd combination, but the build system can be more robust against such insane input. Commit ba64beb17493a ("kbuild: check the minimum assembler version in Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise because Kconfig checks the version string from the assembler in use. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nathan Chancellor commit e08831baa032e62786d88b68e26c54389e2486b6 Author: Nick Desaulniers Date: Mon Aug 2 11:39:10 2021 -0700 Documentation/llvm: update CROSS_COMPILE inferencing As noted by Masahiro, document how we can generally infer CROSS_COMPILE (and the more specific details about --target and --prefix) based on ARCH. Change use of env vars to command line parameters. Suggested-by: Masahiro Yamada Reviewed-by: Fangrui Song Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 231ad7f409f16b9f9505f69e058dff488a7e6bde Author: Nick Desaulniers Date: Mon Aug 2 11:39:09 2021 -0700 Makefile: infer --target from ARCH for CC=clang We get constant feedback that the command line invocation of make is too long when compiling with LLVM. CROSS_COMPILE is helpful when a toolchain has a prefix of the target triple, or is an absolute path outside of $PATH. Since a Clang binary is generally multi-targeted, we can infer a given target from SRCARCH/ARCH. If CROSS_COMPILE is not set, simply set --target= for CLANG_FLAGS, KBUILD_CFLAGS, and KBUILD_AFLAGS based on $SRCARCH. Previously, we'd cross compile via: $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make LLVM=1 LLVM_IAS=1 Now: $ ARCH=arm64 make LLVM=1 LLVM_IAS=1 For native builds (not involving cross compilation) we now explicitly specify a target triple rather than rely on the implicit host triple. Link: https://github.com/ClangBuiltLinux/linux/issues/1399 Suggested-by: Arnd Bergmann Suggested-by: Linus Torvalds Suggested-by: Masahiro Yamada Suggested-by: Nathan Chancellor Acked-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Acked-by: Miguel Ojeda Signed-off-by: Masahiro Yamada commit 6f5b41a2f5a6314614e286274eb8e985248aac60 Author: Nick Desaulniers Date: Mon Aug 2 11:39:08 2021 -0700 Makefile: move initial clang flag handling into scripts/Makefile.clang With some of the changes we'd like to make to CROSS_COMPILE, the initial block of clang flag handling which controls things like the target triple, whether or not to use the integrated assembler and how to find GAS, and erroring on unknown warnings is becoming unwieldy. Move it into its own file under scripts/. Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 6072b2c49d23eb69b6dca06ad095d3a9633b2b80 Author: Masahiro Yamada Date: Sun Aug 1 11:53:46 2021 +0900 kbuild: warn if a different compiler is used for external module builds It is always safe to use the same compiler for the kernel and external modules, but in reality, some distributions such as Fedora release a different version of GCC from the one used for building the kernel. There was a long discussion about mixing different compilers [1]. I do not repeat it here, but at least, showing a heads up in that case is better than nothing. Linus suggested [2]: And a warning might be more palatable even if different compiler version work fine together. Just a heads up on "it looks like you might be mixing compiler versions" is a valid note, and isn't necessarily wrong. Even when they work well together, maybe you want to have people at least _aware_ of it. This commit shows a warning unless the compiler is exactly the same. warning: the compiler differs from the one used to build the kernel The kernel was built by: gcc (GCC) 11.1.1 20210531 (Red Hat 11.1.1-3) You are using: gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) Check the difference, and if it is OK with you, please proceed at your risk. To avoid the locale issue as in commit bcbcf50f5218 ("kbuild: fix ld-version.sh to not be affected by locale"), pass LC_ALL=C to "$(CC) --version". [1] https://lore.kernel.org/linux-hardening/efe6b039a544da8215d5e54aa7c4b6d1986fc2b0.1611607264.git.jpoimboe@redhat.com/ [2] https://lore.kernel.org/lkml/CAHk-=wgjwhDy-y4mQh34L+2aF=n6BjzHdqAW2=8wri5x7O04pA@mail.gmail.com/ Acked-by: Josh Poimboeuf Signed-off-by: Masahiro Yamada commit 0058d07ec6aac8b1379f817b31839caa4ac8e448 Author: Masahiro Yamada Date: Wed Jul 28 00:39:24 2021 +0900 scripts: make some scripts executable Set the x bit to some scripts to make them directly executable. Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'. The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration"). [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/ Signed-off-by: Masahiro Yamada commit d8285639550578a1bf2d102391d1a9e08e0586ca Author: Masahiro Yamada Date: Sun Jul 25 03:35:56 2021 +0900 kbuild: do not require sub-make for separate output tree builds As explained in commit 3204a7fb98a3 ("kbuild: prefix $(srctree)/ to some included Makefiles"), I want to stop using --include-dir some day. I already fixed up the top Makefile, but some arch Makefiles (mips, um, x86) still include check-in Makefiles without $(srctree)/. Fix them up so 'need-sub-make := 1' can go away for this case. Signed-off-by: Masahiro Yamada commit a325db2d8f1d7e33cdc0152b61c3f14fb06f9893 Author: Matthias Maennich Date: Wed Dec 2 15:12:39 2020 +0000 scripts: merge_config: add strict mode to fail upon any redefinition When merging configuration fragments, it might be of interest to identify mismatches (redefinitions) programmatically. Hence add the option -s (strict mode) to instruct merge_config.sh to bail out in case any redefinition has been detected. With strict mode, warnings are emitted as before, but the script terminates with rc=1. If -y is set to define "builtin having precedence over modules", fragments are still allowed to set =m (while the base config has =y). Strict mode will tolerate that as demotions from =y to =m are ignored when setting -y. Signed-off-by: Matthias Maennich Reviewed-by: Lee Jones Signed-off-by: Masahiro Yamada commit df0826312a23e495faa91eee0d6ac31bca35dc09 Author: Allison Henderson Date: Sun Aug 8 08:27:13 2021 -0700 xfs: add attr state machine tracepoints This is a quick patch to add a new xfs_attr_*_return tracepoints. We use these to track when ever a new state is set or -EAGAIN is returned Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 4bc619833f738f4fa8d931a71610795ebf5cec0e Author: Darrick J. Wong Date: Sun Aug 8 08:27:13 2021 -0700 xfs: refactor xfs_iget calls from log intent recovery Hoist the code from xfs_bui_item_recover that igets an inode and marks it as being part of log intent recovery. The next patch will want a common function. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Chandan Babu R commit 2b73a2c817be58de2190940dbfa38dbf8a3806e6 Author: Darrick J. Wong Date: Sun Aug 8 08:27:12 2021 -0700 xfs: clear log incompat feature bits when the log is idle When there are no ongoing transactions and the log contents have been checkpointed back into the filesystem, the log performs 'covering', which is to say that it log a dummy transaction to record the fact that the tail has caught up with the head. This is a good time to clear log incompat feature flags, because they are flags that are temporarily set to limit the range of kernels that can replay a dirty log. Since it's possible that some other higher level thread is about to start logging items protected by a log incompat flag, we create a rwsem so that upper level threads can coordinate this with the log. It would probably be more performant to use a percpu rwsem, but the ability to /try/ taking the write lock during covering is critical, and percpu rwsems do not provide that. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Chandan Babu R commit 908ce71e54f8265fa909200410d6c50ab9a2d302 Author: Darrick J. Wong Date: Sun Aug 8 08:27:12 2021 -0700 xfs: allow setting and clearing of log incompat feature flags Log incompat feature flags in the superblock exist for one purpose: to protect the contents of a dirty log from replay on a kernel that isn't prepared to handle those dirty contents. This means that they can be cleared if (a) we know the log is clean and (b) we know that there aren't any other threads in the system that might be setting or relying upon a log incompat flag. Therefore, clear the log incompat flags when we've finished recovering the log, when we're unmounting cleanly, remounting read-only, or freezing; and provide a function so that subsequent patches can start using this. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Chandan Babu R commit d634525db63e9e946c3229fb93c8d9b763afbaf3 Author: Dave Chinner Date: Mon Aug 9 10:10:01 2021 -0700 xfs: replace kmem_alloc_large() with kvmalloc() There is no reason for this wrapper existing anymore. All the places that use KM_NOFS allocation are within transaction contexts and hence covered by memalloc_nofs_save/restore contexts. Hence we don't need any special handling of vmalloc for large IOs anymore and so special casing this code isn't necessary. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 98fe2c3cef21b784e2efd1d9d891430d95b4f073 Author: Dave Chinner Date: Mon Aug 9 10:10:01 2021 -0700 xfs: remove kmem_alloc_io() Since commit 59bb47985c1d ("mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)"), the core slab code now guarantees slab alignment in all situations sufficient for IO purposes (i.e. minimum of 512 byte alignment of >= 512 byte sized heap allocations) we no longer need the workaround in the XFS code to provide this guarantee. Replace the use of kmem_alloc_io() with kmem_alloc() or kmem_alloc_large() appropriately, and remove the kmem_alloc_io() interface altogether. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit de2860f4636256836450c6543be744a50118fc66 Author: Dave Chinner Date: Mon Aug 9 10:10:00 2021 -0700 mm: Add kvrealloc() During log recovery of an XFS filesystem with 64kB directory buffers, rebuilding a buffer split across two log records results in a memory allocation warning from krealloc like this: xfs filesystem being mounted at /mnt/scratch supports timestamps until 2038 (0x7fffffff) XFS (dm-0): Unmounting Filesystem XFS (dm-0): Mounting V5 Filesystem XFS (dm-0): Starting recovery (logdev: internal) ------------[ cut here ]------------ WARNING: CPU: 5 PID: 3435170 at mm/page_alloc.c:3539 get_page_from_freelist+0xdee/0xe40 ..... RIP: 0010:get_page_from_freelist+0xdee/0xe40 Call Trace: ? complete+0x3f/0x50 __alloc_pages+0x16f/0x300 alloc_pages+0x87/0x110 kmalloc_order+0x2c/0x90 kmalloc_order_trace+0x1d/0x90 __kmalloc_track_caller+0x215/0x270 ? xlog_recover_add_to_cont_trans+0x63/0x1f0 krealloc+0x54/0xb0 xlog_recover_add_to_cont_trans+0x63/0x1f0 xlog_recovery_process_trans+0xc1/0xd0 xlog_recover_process_ophdr+0x86/0x130 xlog_recover_process_data+0x9f/0x160 xlog_recover_process+0xa2/0x120 xlog_do_recovery_pass+0x40b/0x7d0 ? __irq_work_queue_local+0x4f/0x60 ? irq_work_queue+0x3a/0x50 xlog_do_log_recovery+0x70/0x150 xlog_do_recover+0x38/0x1d0 xlog_recover+0xd8/0x170 xfs_log_mount+0x181/0x300 xfs_mountfs+0x4a1/0x9b0 xfs_fs_fill_super+0x3c0/0x7b0 get_tree_bdev+0x171/0x270 ? suffix_kstrtoint.constprop.0+0xf0/0xf0 xfs_fs_get_tree+0x15/0x20 vfs_get_tree+0x24/0xc0 path_mount+0x2f5/0xaf0 __x64_sys_mount+0x108/0x140 do_syscall_64+0x3a/0x70 entry_SYSCALL_64_after_hwframe+0x44/0xae Essentially, we are taking a multi-order allocation from kmem_alloc() (which has an open coded no fail, no warn loop) and then reallocating it out to 64kB using krealloc(__GFP_NOFAIL) and that is then triggering the above warning. This is a regression caused by converting this code from an open coded no fail/no warn reallocation loop to using __GFP_NOFAIL. What we actually need here is kvrealloc(), so that if contiguous page allocation fails we fall back to vmalloc() and we don't get nasty warnings happening in XFS. Fixes: 771915c4f688 ("xfs: remove kmem_realloc()") Signed-off-by: Dave Chinner Acked-by: Mel Gorman Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c5c63b9a6a2e53757b598485b8adbafa56d6d9ee Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:07 2021 +0200 cgroup: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Zefan Li Cc: Tejun Heo Cc: Johannes Weiner Cc: cgroups@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tejun Heo commit 6ba34d3c73674e46d9e126e4f0cee79e5ef2481c Author: Waiman Long Date: Tue Jul 20 10:18:28 2021 -0400 cgroup/cpuset: Fix violation of cpuset locking rule The cpuset fields that manage partition root state do not strictly follow the cpuset locking rule that update to cpuset has to be done with both the callback_lock and cpuset_mutex held. This is now fixed by making sure that the locking rule is upheld. Fixes: 3881b86128d0 ("cpuset: Add an error state to cpuset.sched.partition") Fixes: 4b842da276a8 ("cpuset: Make CPU hotplug work with partition") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 4ef3960ea19c3b2bced37405b251f05fd4b35545 Merge: 2a2b6e3640c43 93188e9642c3c Author: Jakub Kicinski Date: Mon Aug 9 15:49:03 2021 -0700 Merge branch 'add-frag-page-support-in-page-pool' Yunsheng Lin says: ==================== add frag page support in page pool This patchset adds frag page support in page pool and enable skb's page frag recycling based on page pool in hns3 drvier. ==================== Link: https://lore.kernel.org/r/1628217982-53533-1-git-send-email-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 93188e9642c3ce11d11b2663905b703dfe89e349 Author: Yunsheng Lin Date: Fri Aug 6 10:46:22 2021 +0800 net: hns3: support skb's frag page recycling based on page pool This patch adds skb's frag page recycling support based on the frag page support in page pool. The performance improves above 10~20% for single thread iperf TCP flow with IOMMU disabled when iperf server and irq/NAPI have a different CPU. The performance improves about 135%(14Gbit to 33Gbit) for single thread iperf TCP flow when IOMMU is in strict mode and iperf server shares the same cpu with irq/NAPI. Signed-off-by: Yunsheng Lin Signed-off-by: Jakub Kicinski commit 53e0961da1c7bbdabd1abebb20de403ec237ec09 Author: Yunsheng Lin Date: Fri Aug 6 10:46:21 2021 +0800 page_pool: add frag page recycling support in page pool Currently page pool only support page recycling when there is only one user of the page, and the split page reusing implemented in the most driver can not use the page pool as bing-pong way of reusing requires the multi user support in page pool. Those reusing or recycling has below limitations: 1. page from page pool can only be used be one user in order for the page recycling to happen. 2. Bing-pong way of reusing in most driver does not support multi desc using different part of the same page in order to save memory. So add multi-users support and frag page recycling in page pool to overcome the above limitation. Signed-off-by: Yunsheng Lin Signed-off-by: Jakub Kicinski commit 0e9d2a0a3a836c37528899010e73b5be8111753e Author: Yunsheng Lin Date: Fri Aug 6 10:46:20 2021 +0800 page_pool: add interface to manipulate frag count in page pool For 32 bit systems with 64 bit dma, dma_addr[1] is used to store the upper 32 bit dma addr, those system should be rare those days. For normal system, the dma_addr[1] in 'struct page' is not used, so we can reuse dma_addr[1] for storing frag count, which means how many frags this page might be splited to. In order to simplify the page frag support in the page pool, the PAGE_POOL_DMA_USE_PP_FRAG_COUNT macro is added to indicate the 32 bit systems with 64 bit dma, and the page frag support in page pool is disabled for such system. The newly added page_pool_set_frag_count() is called to reserve the maximum frag count before any page frag is passed to the user. The page_pool_atomic_sub_frag_count_return() is called when user is done with the page frag. Signed-off-by: Yunsheng Lin Signed-off-by: Jakub Kicinski commit 57f05bc2ab2443b89c2e2562c05053bcc7d30e8b Author: Yunsheng Lin Date: Fri Aug 6 10:46:19 2021 +0800 page_pool: keep pp info as long as page pool owns the page Currently, page->pp is cleared and set everytime the page is recycled, which is unnecessary. So only set the page->pp when the page is added to the page pool and only clear it when the page is released from the page pool. This is also a preparation to support allocating frag page in page pool. Reviewed-by: Ilias Apalodimas Signed-off-by: Yunsheng Lin Signed-off-by: Jakub Kicinski commit ffd8bea81fbb5abe6518bce8d6297a149b935cf7 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:20 2021 +0200 workqueue: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Tejun Heo Reviewed-by: Lai Jiangshan Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tejun Heo commit e441b56fe438fd126b9eea7d30c57d3cd3f34e14 Author: Zhen Lei Date: Wed Aug 4 11:50:36 2021 +0800 workqueue: Replace deprecated ida_simple_*() with ida_alloc()/ida_free() Replace ida_simple_get() with ida_alloc() and ida_simple_remove() with ida_free(), the latter is more concise and intuitive. In addition, if ida_alloc() fails, NULL is returned directly. This eliminates unnecessary initialization of two local variables and an 'if' judgment. Signed-off-by: Zhen Lei Signed-off-by: Tejun Heo commit 67dc8325370844ffce92aa59abe8b453aa6aa83c Author: Cai Huoqing Date: Sat Jul 31 08:01:29 2021 +0800 workqueue: Fix typo in comments Fix typo: *assing ==> assign *alloced ==> allocated *Retun ==> Return *excute ==> execute v1->v2: *reverse 'iff' *update changelog Signed-off-by: Cai Huoqing Signed-off-by: Tejun Heo commit 1d1bb12a8b1805ddeef9793ebeb920179fb0fa38 Author: Cassio Neri Date: Thu Jun 24 21:13:43 2021 +0100 rtc: Improve performance of rtc_time64_to_tm(). Add tests. The current implementation of rtc_time64_to_tm() contains unnecessary loops, branches and look-up tables. The new one uses an arithmetic-based algorithm appeared in [1] and is approximately 4.3 times faster (YMMV). The drawback is that the new code isn't intuitive and contains many 'magic numbers' (not unusual for this type of algorithm). However, [1] justifies all those numbers and, given this function's history, the code is unlikely to need much maintenance, if any at all. Add a KUnit test case that checks every day in a 160,000 years interval starting on 1970-01-01 against the expected result. Add a new config RTC_LIB_KUNIT_TEST symbol to give the option to run this test suite. [1] Neri, Schneider, "Euclidean Affine Functions and Applications to Calendar Algorithms". https://arxiv.org/abs/2102.06959 Signed-off-by: Cassio Neri Reported-by: kernel test robot Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210624201343.85441-1-cassio.neri@gmail.com commit 5f50b7659da63a6b80b4b6406c663c8dcd6401ba Author: Cai Huoqing Date: Mon Aug 2 11:35:52 2021 +0800 drm/vmwgfx: Replace "vmw_num_pages" with "PFN_UP" we counld use PFN_UP instead of vmw_num_pages() Signed-off-by: Cai Huoqing Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210802033552.990-1-caihuoqing@baidu.com commit bc65754ca61498f2bb351f6b0ad56f853fc7a966 Author: Cai Huoqing Date: Mon Aug 2 11:33:08 2021 +0800 drm/vmwgfx: Make use of PFN_ALIGN/PFN_UP helper macro it's a refactor to make use of PFN_ALIGN/PFN_UP helper macro Signed-off-by: Cai Huoqing Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210802033308.927-1-caihuoqing@baidu.com commit 2bc5da528dd570c5ecabc107e6fbdbc55974276f Author: Desmond Cheong Zhi Xi Date: Sat Jul 24 19:18:24 2021 +0800 drm/vmwgfx: fix potential UAF in vmwgfx_surface.c drm_file.master should be protected by either drm_device.master_mutex or drm_file.master_lookup_lock when being dereferenced. However, drm_master_get is called on unprotected file_priv->master pointers in vmw_surface_define_ioctl and vmw_gb_surface_define_internal. This is fixed by replacing drm_master_get with drm_file_get_master. Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Daniel Vetter Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210724111824.59266-4-desmondcheongzx@gmail.com commit 1cb48cf3b1da45e0bfb5046d2d43746dbdd6339e Author: Baokun Li Date: Wed Jun 9 15:22:48 2021 +0800 drm/vmwgfx: Use list_move_tail instead of list_del/list_add_tail in vmwgfx_cmdbuf_res.c Using list_move_tail() instead of list_del() + list_add_tail() in vmwgfx_cmdbuf_res.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210609072248.1353421-1-libaokun1@huawei.com commit 69f2cd6df3ee07ae88befafc038d4dd9154e2799 Author: Anna Schumaker Date: Thu Jul 29 16:46:05 2021 -0400 SUNRPC: Add dst_port to the sysfs xprt info file This is most likely going to be 2049 for NFS, but some servers might be configured to export on a non-standard port. Let's show this information just in case somebody needs it. Signed-off-by: Anna Schumaker commit e44773daf851dc2755144355723c1c305e7246a1 Author: Anna Schumaker Date: Thu Jul 29 16:45:23 2021 -0400 SUNRPC: Add srcaddr as a file in sysfs I don't support changing it right now, but it could be useful information for clients with multiple network cards. Signed-off-by: Anna Schumaker commit 5d46dd04cb68771f77ba66dbf6fd323a4a2ce00d Author: Anna Schumaker Date: Tue Jul 20 16:04:42 2021 -0400 sunrpc: Fix return value of get_srcport() Since bc1c56e9bbe9 transport->srcport may by unset, causing get_srcport() to return 0 when called. Fix this by querying the port from the underlying socket instead of the transport. Fixes: bc1c56e9bbe9 (SUNRPC: prevent port reuse on transports which don't request it) Signed-off-by: Anna Schumaker commit 6aab1c81b98a90a9289a4d5256b6f7374872cc3f Author: Jussi Maki Date: Sat Jul 31 05:57:38 2021 +0000 selftests/bpf: Add tests for XDP bonding Add a test suite to test XDP bonding implementation over a pair of veth devices. Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210731055738.16820-8-joamaki@gmail.com commit 95413846cca37f20000dd095cf6d91f8777129d7 Author: Jussi Maki Date: Sat Jul 31 05:57:37 2021 +0000 selftests/bpf: Fix xdp_tx.c prog section name The program type cannot be deduced from 'tx' which causes an invalid argument error when trying to load xdp_tx.o using the skeleton. Rename the section name to "xdp" so that libbpf can deduce the type. Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210731055738.16820-7-joamaki@gmail.com commit 689186699931313c7a42462602bd5c03eef77f9f Author: Jussi Maki Date: Sat Jul 31 05:57:36 2021 +0000 net, core: Allow netdev_lower_get_next_private_rcu in bh context For the XDP bonding slave lookup to work in the NAPI poll context in which the redudant rcu_read_lock() has been removed we have to follow the same approach as in 694cea395fde ("bpf: Allow RCU-protected lookups to happen from bh context") and modify the WARN_ON to also check rcu_read_lock_bh_held(). Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Cc: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210731055738.16820-6-joamaki@gmail.com commit aeea1b86f9363f3feabb496534d886f082a89f21 Author: Jussi Maki Date: Sat Jul 31 05:57:35 2021 +0000 bpf, devmap: Exclude XDP broadcast to master device If the ingress device is bond slave, do not broadcast back through it or the bond master. Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210731055738.16820-5-joamaki@gmail.com commit 9e2ee5c7e7c35d195e2aa0692a7241d47a433d1e Author: Jussi Maki Date: Sat Jul 31 05:57:34 2021 +0000 net, bonding: Add XDP support to the bonding driver XDP is implemented in the bonding driver by transparently delegating the XDP program loading, removal and xmit operations to the bonding slave devices. The overall goal of this work is that XDP programs can be attached to a bond device *without* any further changes (or awareness) necessary to the program itself, meaning the same XDP program can be attached to a native device but also a bonding device. Semantics of XDP_TX when attached to a bond are equivalent in such setting to the case when a tc/BPF program would be attached to the bond, meaning transmitting the packet out of the bond itself using one of the bond's configured xmit methods to select a slave device (rather than XDP_TX on the slave itself). Handling of XDP_TX to transmit using the configured bonding mechanism is therefore implemented by rewriting the BPF program return value in bpf_prog_run_xdp. To avoid performance impact this check is guarded by a static key, which is incremented when a XDP program is loaded onto a bond device. This approach was chosen to avoid changes to drivers implementing XDP. If the slave device does not match the receive device, then XDP_REDIRECT is transparently used to perform the redirection in order to have the network driver release the packet from its RX ring. The bonding driver hashing functions have been refactored to allow reuse with xdp_buff's to avoid code duplication. The motivation for this change is to enable use of bonding (and 802.3ad) in hairpinning L4 load-balancers such as [1] implemented with XDP and also to transparently support bond devices for projects that use XDP given most modern NICs have dual port adapters. An alternative to this approach would be to implement 802.3ad in user-space and implement the bonding load-balancing in the XDP program itself, but is rather a cumbersome endeavor in terms of slave device management (e.g. by watching netlink) and requires separate programs for native vs bond cases for the orchestrator. A native in-kernel implementation overcomes these issues and provides more flexibility. Below are benchmark results done on two machines with 100Gbit Intel E810 (ice) NIC and with 32-core 3970X on sending machine, and 16-core 3950X on receiving machine. 64 byte packets were sent with pktgen-dpdk at full rate. Two issues [2, 3] were identified with the ice driver, so the tests were performed with iommu=off and patch [2] applied. Additionally the bonding round robin algorithm was modified to use per-cpu tx counters as high CPU load (50% vs 10%) and high rate of cache misses were caused by the shared rr_tx_counter (see patch 2/3). The statistics were collected using "sar -n dev -u 1 10". On top of that, for ice, further work is in progress on improving the XDP_TX numbers [4]. -----------------------| CPU |--| rxpck/s |--| txpck/s |---- without patch (1 dev): XDP_DROP: 3.15% 48.6Mpps XDP_TX: 3.12% 18.3Mpps 18.3Mpps XDP_DROP (RSS): 9.47% 116.5Mpps XDP_TX (RSS): 9.67% 25.3Mpps 24.2Mpps ----------------------- with patch, bond (1 dev): XDP_DROP: 3.14% 46.7Mpps XDP_TX: 3.15% 13.9Mpps 13.9Mpps XDP_DROP (RSS): 10.33% 117.2Mpps XDP_TX (RSS): 10.64% 25.1Mpps 24.0Mpps ----------------------- with patch, bond (2 devs): XDP_DROP: 6.27% 92.7Mpps XDP_TX: 6.26% 17.6Mpps 17.5Mpps XDP_DROP (RSS): 11.38% 117.2Mpps XDP_TX (RSS): 14.30% 28.7Mpps 27.4Mpps -------------------------------------------------------------- RSS: Receive Side Scaling, e.g. the packets were sent to a range of destination IPs. [1]: https://cilium.io/blog/2021/05/20/cilium-110#standalonelb [2]: https://lore.kernel.org/bpf/20210601113236.42651-1-maciej.fijalkowski@intel.com/T/#t [3]: https://lore.kernel.org/bpf/CAHn8xckNXci+X_Eb2WMv4uVYjO2331UWB2JLtXr_58z0Av8+8A@mail.gmail.com/ [4]: https://lore.kernel.org/bpf/20210805230046.28715-1-maciej.fijalkowski@intel.com/T/#t Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Cc: Maciej Fijalkowski Cc: Magnus Karlsson Link: https://lore.kernel.org/bpf/20210731055738.16820-4-joamaki@gmail.com commit 879af96ffd72706c6e3278ea6b45b0b0e37ec5d7 Author: Jussi Maki Date: Sat Jul 31 05:57:33 2021 +0000 net, core: Add support for XDP redirection to slave device This adds the ndo_xdp_get_xmit_slave hook for transforming XDP_TX into XDP_REDIRECT after BPF program run when the ingress device is a bond slave. The dev_xdp_prog_count is exposed so that slave devices can be checked for loaded XDP programs in order to avoid the situation where both bond master and slave have programs loaded according to xdp_state. Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Link: https://lore.kernel.org/bpf/20210731055738.16820-3-joamaki@gmail.com commit a815bde56b15ce626caaacc952ab12501671e45d Author: Jussi Maki Date: Sat Jul 31 05:57:32 2021 +0000 net, bonding: Refactor bond_xmit_hash for use with xdp_buff In preparation for adding XDP support to the bonding driver refactor the packet hashing functions to be able to work with any linear data buffer without an skb. Signed-off-by: Jussi Maki Signed-off-by: Daniel Borkmann Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Link: https://lore.kernel.org/bpf/20210731055738.16820-2-joamaki@gmail.com commit f99fa50880f5300fbbb3c0754ddc7f8738d24fe7 Author: Trond Myklebust Date: Mon Jul 26 08:03:12 2021 -0400 SUNRPC/xprtrdma: Fix reconnection locking The xprtrdma client code currently relies on the task that initiated the connect to hold the XPRT_LOCK for the duration of the connection attempt. If the task is woken early, due to some other event, then that lock could get released early. Avoid races by using the same mechanism that the socket code uses of transferring lock ownership to the RDMA connect worker itself. That frees us to call rpcrdma_xprt_disconnect() directly since we're now guaranteed exclusion w.r.t. other callers. Fixes: 4cf44be6f1e8 ("xprtrdma: Fix recursion into rpcrdma_xprt_disconnect()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit e26d9972720e2484f44cdd94ca4e31cc372ed2ed Author: Trond Myklebust Date: Mon Jul 26 07:59:24 2021 -0400 SUNRPC: Clean up scheduling of autoclose Consolidate duplicated code in xprt_force_disconnect() and xprt_conditional_disconnect(). Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit c2dc3e5fad13aca5d7bdf4bcb52b1a1d707c8555 Author: Trond Myklebust Date: Mon Jul 26 07:59:23 2021 -0400 SUNRPC: Fix potential memory corruption We really should not call rpc_wake_up_queued_task_set_status() with xprt->snd_task as an argument unless we are certain that is actually an rpc_task. Fixes: 0445f92c5d53 ("SUNRPC: Fix disconnection races") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit d6236a98b3bab07c0a1455fd1ab46f79c3978cdc Author: Trond Myklebust Date: Fri Jul 23 08:57:21 2021 -0400 NFSv4/pnfs: The layout barrier indicate a minimal value for the seqid The intention of the layout barrier is to ensure that we do not update the layout to match an older value than the current expectation. Fix the test in pnfs_layout_stateid_blocked() to reflect that it is legal for the seqid of the stateid to match that of the barrier. Fixes: aa95edf309ef ("NFSv4/pnfs: Fix the layout barrier update") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 45baadaad7bf9183651fb74f4ed1200da48505a5 Author: Trond Myklebust Date: Fri Jul 23 08:57:20 2021 -0400 NFSv4/pNFS: Always allow update of a zero valued layout barrier A zero value for the layout barrier indicates that it has been cleared (since seqid '0' is an illegal value), so we should always allow it to be updated. Fixes: d29b468da4f9 ("pNFS/NFSv4: Improve rejection of out-of-order layouts") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 7c0bbf2d3dcd13c906244e0c2e4a0ba3a33dab6a Author: Trond Myklebust Date: Mon Jul 26 07:59:20 2021 -0400 NFSv4/pNFS: Remove dead code Since commit 2b28a7bee453 ("fs, nfs: convert pnfs_layout_hdr.plh_refcount from atomic_t to refcount_t") it has not been legal to bump a zero refcount, so the code that tries to allow it if the NFS_LSEG_VALID flag is still set would cause trouble. Luckily, NFS_LSEG_VALID has its own refcount so we can never hit this bad code snippet in practice. Remove it to avoid confusion. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit e20772cbdf463c12088837e5a08bde1b876bfd25 Author: Trond Myklebust Date: Mon Jul 26 07:58:49 2021 -0400 NFSv4/pNFS: Fix a layoutget livelock loop If NFS_LAYOUT_RETURN_REQUESTED is set, but there is no value set for the layout plh_return_seq, we can end up in a livelock loop in which every layout segment retrieved by a new call to layoutget is immediately invalidated by pnfs_layout_need_return(). To get around this, we should just set plh_return_seq to the current value of the layout stateid's seqid. Fixes: d474f96104bd ("NFS: Don't return layout segments that are in use") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 71d3d0ebc894294ef9454e45a3ac2e9ba60b3351 Author: Trond Myklebust Date: Mon Jul 26 08:01:27 2021 -0400 SUNRPC: Convert rpc_client refcount to use refcount_t There are now tools in the refcount library that allow us to convert the client shutdown code. Reported-by: Xiyu Yang Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit aa841a99f240142409c31167f3a28e4c0a7ac108 Author: Baokun Li Date: Wed Jun 9 15:18:03 2021 +0800 drm/vmwgfx: Use list_move_tail instead of list_del/list_add_tail in vmwgfx_cmdbuf.c Using list_move_tail() instead of list_del() + list_add_tail() in vmwgfx_cmdbuf.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210609071803.1347254-1-libaokun1@huawei.com commit d7bd351faabe848ec93d817a0520fcb9db12a89b Author: Shaokun Zhang Date: Tue May 25 16:09:30 2021 +0800 drm/vmwgfx: Remove the repeated declaration Function 'vmw_context_binding_list' is declared twice, remove the repeated declaration. Cc: VMware Graphics Cc: Roland Scheidegger Cc: Zack Rusin Signed-off-by: Shaokun Zhang Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/1621930170-54923-1-git-send-email-zhangshaokun@hisilicon.com commit 8d863b1f0541ea540cb47d1454eb060963a79d5f Author: Chuck Lever Date: Mon Aug 2 14:44:42 2021 -0400 xprtrdma: Eliminate rpcrdma_post_sends() Clean up. Now that there is only one registration mode, there is only one target "post_send" method: frwr_send(). rpcrdma_post_sends() no longer adds much value, especially since all of its call sites ignore the return code value except to check if it's non-zero. Just have them call frwr_send() directly instead. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit d9ae8134f253e8d0e15b1f0127af3b8b5552b90c Author: Chuck Lever Date: Mon Aug 2 14:44:36 2021 -0400 xprtrdma: Add an xprtrdma_post_send_err tracepoint Unlike xprtrdma_post_send(), this one can be left enabled all the time, and should almost never fire. But we do want to know about immediate errors when they happen. Note that there is already a similar post_linv_err tracepoint. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 683f31c3ab2e60b323b9b88c0ac389ff9cacec1a Author: Chuck Lever Date: Mon Aug 2 14:44:30 2021 -0400 xprtrdma: Add xprtrdma_post_recvs_err() tracepoint In the vast majority of cases, rc=0. Don't record that in the post_recvs tracepoint. Instead, add a separate tracepoint that can be left enabled all the time to capture the very rare immediate errors returned by ib_post_recv(). Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 97480cae13ca3a9c1de3eb6fd66cf9650a60db42 Author: Chuck Lever Date: Mon Aug 2 14:44:24 2021 -0400 xprtrdma: Put rpcrdma_reps before waking the tear-down completion Ensure the tear-down completion is awoken only /after/ we've stopped fiddling with rpcrdma_rep objects in rpcrdma_post_recvs(). Fixes: 15788d1d1077 ("xprtrdma: Do not refresh Receive Queue while it is draining") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 1143129e4d0d27740ce680d2fb0161ad4f27aa7e Author: Chuck Lever Date: Mon Aug 2 14:44:17 2021 -0400 xprtrdma: Disconnect after an ib_post_send() immediate error ib_post_send() does not disconnect the QP when it returns an immediate error. Thus, the code that posts LocalInv has to explicitly disconnect after an immediate error. This is just like the frwr_send() callers handle it. If a disconnect isn't done here, the transport deadlocks. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 866663b7b52d2da267b28e12eed89ee781b8fed1 Author: Ming Lei Date: Thu Jul 29 11:42:26 2021 +0800 block: return ELEVATOR_DISCARD_MERGE if possible When merging one bio to request, if they are discard IO and the queue supports multi-range discard, we need to return ELEVATOR_DISCARD_MERGE because both block core and related drivers(nvme, virtio-blk) doesn't handle mixed discard io merge(traditional IO merge together with discard merge) well. Fix the issue by returning ELEVATOR_DISCARD_MERGE in this situation, so both blk-mq and drivers just need to handle multi-range discard. Reported-by: Oleksandr Natalenko Signed-off-by: Ming Lei Tested-by: Oleksandr Natalenko Fixes: 2705dfb20947 ("block: fix discard request merge") Link: https://lore.kernel.org/r/20210729034226.1591070-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit be17b8caf3a3a20c4d910265a6287b07ab444795 Author: Chuck Lever Date: Mon Jul 19 10:48:34 2021 -0400 SUNRPC: Record timeout value in xprt_retransmit tracepoint The client can alter the timeout value after each retransmit. Record the updated timeout value in the trace log. Suggested-by: Dai Ngo Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit be630b9150b0321e21dbd951d715cff72c73b0c6 Author: Chuck Lever Date: Mon Jul 19 10:48:28 2021 -0400 SUNRPC: xprt_retransmit() displays the the NULL procedure incorrectly Currently: xprt_retransmit: task:11@1 xid=0x55a7ffac nfsv4 (null) ntrans=2 should be: xprt_retransmit: task:11@1 xid=0x55a7ffac nfsv4 NULL ntrans=2 Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit f9d091cff80d303dde6182296e0f4d7b8a7880ac Author: Chuck Lever Date: Mon Jul 19 10:48:22 2021 -0400 SUNRPC: Update trace flags Recent patches added RPC_TASK_MOVEABLE, XPRT_OFFLINE, and XPRT_REMOVE. Update the tracepoint display macros to display these flags properly. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit d480696dc68943538b81a26b0f4f39eb50c41380 Author: Chuck Lever Date: Mon Jul 19 10:48:16 2021 -0400 SUNRPC: Remove unneeded TRACE_DEFINE_ENUMs Clean up: TRACE_DEFINE_ENUM is needed only for enums, not for C macros. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 823c73d0c539a0c1740c7929a7aad3f844e69d70 Author: Chuck Lever Date: Mon Jul 19 10:48:10 2021 -0400 SUNRPC: Unset RPC_TASK_NO_RETRANS_TIMEOUT for NULL RPCs In some rare failure modes, the server is actually reading the transport, but then just dropping the requests on the floor. TCP_USER_TIMEOUT cannot detect that case. Prevent such a stuck server from pinning client resources indefinitely by ensuring that certain idempotent requests (such as NULL) can time out even if the connection is still operational. Otherwise rpc_bind_new_program(), gss_destroy_cred(), or rpc_clnt_test_and_add_xprt() can wait forever. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit aede517207b2bf4e5176492ce3be0e45feb581bd Author: Chuck Lever Date: Mon Jul 19 10:48:04 2021 -0400 SUNRPC: Refactor rpc_ping() Make it use the rpc_null_call_helper() so that it can share the new rpc_call_ops structure to be introduced in the next patch. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 7c0223e1ddd7d1c16b76adf8c9c352771856c632 Author: Leo Yan Date: Mon Aug 9 19:27:25 2021 +0800 perf env: Track kernel 64-bit mode in environment It's useful to know that the kernel is running in 32-bit or 64-bit mode. E.g. We can decide if perf tool is running in compat mode based on the info. This patch adds an item "kernel_is_64_bit" into session's environment structure perf_env, its value is initialized based on the architecture string. Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Catalin Marinas Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Li Huafei Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: russell king Link: http://lore.kernel.org/lkml/20210809112727.596876-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 60fa754b2a5a4e0c44669f8d926a5a980c50b1e8 Author: Leo Yan Date: Mon Aug 9 19:14:07 2021 +0800 tools: Remove feature-sync-compare-and-swap feature detection Since the __sync functions have been removed from perf, it's needless for perf tool to test the feature sync-compare-and-swap. The feature test is not used by any other components, remove it. Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Borislav Petkov Cc: Daniel Díaz Cc: Frank Ch. Eigler Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Michael Petlan Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sedat Dilek Cc: Song Liu Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: coresight@lists.linaro.org Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20210809111407.596077-10-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 65c45afb14691d431a9b9faef10700f740ab1ba0 Author: Leo Yan Date: Mon Aug 9 19:14:06 2021 +0800 perf: Cleanup for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT Since the __sync functions have been dropped, This patch removes unused build and checking for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT in perf tool. Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Borislav Petkov Cc: Daniel Díaz Cc: Frank Ch. Eigler Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Michael Petlan Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sedat Dilek Cc: Song Liu Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: coresight@lists.linaro.org Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20210809111407.596077-9-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 9d6450330879791831e6fd3fc20a55990c889a7d Author: Leo Yan Date: Mon Aug 9 19:14:05 2021 +0800 perf auxtrace: Remove auxtrace_mmap__read_snapshot_head() Since the function auxtrace_mmap__read_snapshot_head() is exactly same with auxtrace_mmap__read_head(), whether the session is in snapshot mode or not, it's unified to use function auxtrace_mmap__read_head() for reading AUX buffer head. And the function auxtrace_mmap__read_snapshot_head() is unused so this patch removes it. Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Borislav Petkov Cc: Daniel Díaz Cc: Frank Ch. Eigler Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Michael Petlan Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sedat Dilek Cc: Song Liu Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: coresight@lists.linaro.org Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20210809111407.596077-8-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 1fc7e593e2028f5e0949a67050b4c15167698a4f Author: Leo Yan Date: Mon Aug 9 19:14:04 2021 +0800 perf auxtrace: Drop legacy __sync functions The main purpose for using __sync built-in functions is to support compat mode for 32-bit perf with 64-bit kernel. But using these built-in functions might cause potential issues. __sync functions originally support Intel Itanium processoer [1] but it cannot promise to support all 32-bit archs. Now these functions have become the legacy functions. Considering __sync functions cannot really fix the 64-bit value atomicity on 32-bit archs, thus this patch drops __sync functions. Credits to Peter for detailed analysis. [1] https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins Suggested-by: Peter Zijlstra Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Borislav Petkov Cc: Daniel Díaz Cc: Frank Ch. Eigler Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Michael Petlan Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sedat Dilek Cc: Song Liu Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: coresight@lists.linaro.org Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20210809111407.596077-7-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 1ea3cb159e304f83136ebeb0e56b0cb8a7203cda Author: Leo Yan Date: Mon Aug 9 19:14:03 2021 +0800 perf auxtrace: Use WRITE_ONCE() for updating aux_tail Use WRITE_ONCE() for updating aux_tail, so can avoid unexpected memory behaviour. Signed-off-by: Leo Yan Acked-by: Adrian Hunter Acked-by: Peter Zijlstra Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Borislav Petkov Cc: Daniel Díaz Cc: Frank Ch. Eigler Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Michael Petlan Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sedat Dilek Cc: Song Liu Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: coresight@lists.linaro.org Cc: x86@kernel.org Link: http //lore.kernel.org/lkml/20210809111407.596077-6-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit b7ae6d43786ed6b834892d444cee28eba24e56f6 Author: Stephen Brennan Date: Fri Aug 6 13:45:01 2021 -0700 perf script python: Fix unintended underline The text ranging from "subsystem__event_name" to "raw_syscalls__sys_enter()" is interpreted by asciidoc as a pair of unconstrained text formatting markers. The result is that the manual page displayed this text as underlined, and the HTML pages displayed this text as italicized. Escape the first double-underscore to prevent this. https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/ Signed-off-by: Stephen Brennan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210806204502.110305-1-stephen.s.brennan@oracle.com Signed-off-by: Arnaldo Carvalho de Melo commit 6940db0fd1bed864de7bd21202e4716455f12204 Author: Sergio Miguéns Iglesias Date: Mon Aug 9 14:00:50 2021 +0200 drm/amdgpu: Removed unnecessary if statement There was an "if" statement that did nothing so it was removed. Signed-off-by: Sergio Miguéns Iglesias Signed-off-by: Alex Deucher commit 7b42552be66717f2257d36a121423fee35c41c5e Author: Randy Dunlap Date: Sat Aug 7 16:38:42 2021 -0700 drm/amdgpu: fix kernel-doc warnings on non-kernel-doc comments Don't use "begin kernel-doc notation" (/**) for comments that are not kernel-doc. This eliminates warnings reported by the 0day bot. drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c:89: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * This shader is used to clear VGPRS and LDS, and also write the input drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c:209: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * The below shaders are used to clear SGPRS, and also write the input drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c:301: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * This shader is used to clear the uninitiated sgprs after the above Fixes: 0e0036c7d13b ("drm/amdgpu: fix no full coverage issue for gprs initialization") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: Dennis Li Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Alex Deucher commit f59a66c1915e644c0f77de894dac0ce15f7edad4 Author: Randy Dunlap Date: Sun Aug 8 19:52:08 2021 -0700 drm/amd/display: use do-while-0 for DC_TRACE_LEVEL_MESSAGE() Building with W=1 complains about an empty 'else' statement, so use the usual do-nothing-while-0 loop to quieten this warning. ../drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_psr.c:113:53: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] 113 | *state, retry_count); Fixes: b30eda8d416c ("drm/amd/display: Add ETW log to dmub_psr_get_state") Signed-off-by: Randy Dunlap Cc: Wyatt Wood Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: Harry Wentland Cc: Leo Li Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Alex Deucher commit 704bd53543c661428f02f5dc52413cb6369603cf Author: Anson Jacob Date: Fri Jul 30 19:46:20 2021 -0400 drm/amd/display: use GFP_ATOMIC in amdgpu_dm_irq_schedule_work Replace GFP_KERNEL with GFP_ATOMIC as amdgpu_dm_irq_schedule_work can't sleep. BUG: sleeping function called from invalid context at include/linux/sched/mm.h:196 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 253, name: kworker/6:1H CPU: 6 PID: 253 Comm: kworker/6:1H Tainted: G W OE 5.11.0-promotion_2021_06_07-18_36_28_prelim_revert_retrain #8 Hardware name: System manufacturer System Product Name/PRIME X570-PRO, BIOS 3405 02/01/2021 Workqueue: events_highpri dm_irq_work_func [amdgpu] Call Trace: dump_stack+0x5e/0x74 ___might_sleep.cold+0x87/0x98 __might_sleep+0x4b/0x80 kmem_cache_alloc_trace+0x390/0x4f0 amdgpu_dm_irq_handler+0x171/0x230 [amdgpu] amdgpu_irq_dispatch+0xc0/0x1e0 [amdgpu] amdgpu_ih_process+0x81/0x100 [amdgpu] amdgpu_irq_handler+0x26/0xa0 [amdgpu] __handle_irq_event_percpu+0x49/0x190 ? __hrtimer_get_next_event+0x4d/0x80 handle_irq_event_percpu+0x33/0x80 handle_irq_event+0x33/0x60 handle_edge_irq+0x82/0x190 asm_call_irq_on_stack+0x12/0x20 common_interrupt+0xbb/0x140 asm_common_interrupt+0x1e/0x40 RIP: 0010:amdgpu_device_rreg.part.0+0x44/0xf0 [amdgpu] Code: 53 48 89 fb 4c 3b af c8 08 00 00 73 6d 83 e2 02 75 0d f6 87 40 62 01 00 10 0f 85 83 00 00 00 4c 03 ab d0 08 00 00 45 8b 6d 00 <8b> 05 3e b6 52 00 85 c0 7e 62 48 8b 43 08 0f b7 70 3e 65 8b 05 e3 RSP: 0018:ffffae7740fff9e8 EFLAGS: 00000286 RAX: ffffffffc05ee610 RBX: ffff8aaf8f620000 RCX: 0000000000000006 RDX: 0000000000000000 RSI: 0000000000005430 RDI: ffff8aaf8f620000 RBP: ffffae7740fffa08 R08: 0000000000000001 R09: 000000000000000a R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000005430 R13: 0000000071000000 R14: 0000000000000001 R15: 0000000000005430 ? amdgpu_cgs_write_register+0x20/0x20 [amdgpu] amdgpu_device_rreg+0x17/0x20 [amdgpu] amdgpu_cgs_read_register+0x14/0x20 [amdgpu] dm_read_reg_func+0x38/0xb0 [amdgpu] generic_reg_wait+0x80/0x160 [amdgpu] dce_aux_transfer_raw+0x324/0x7c0 [amdgpu] dc_link_aux_transfer_raw+0x43/0x50 [amdgpu] dm_dp_aux_transfer+0x87/0x110 [amdgpu] drm_dp_dpcd_access+0x72/0x110 [drm_kms_helper] drm_dp_dpcd_read+0xb7/0xf0 [drm_kms_helper] drm_dp_get_one_sb_msg+0x349/0x480 [drm_kms_helper] drm_dp_mst_hpd_irq+0xc5/0xe40 [drm_kms_helper] ? drm_dp_mst_hpd_irq+0xc5/0xe40 [drm_kms_helper] dm_handle_hpd_rx_irq+0x184/0x1a0 [amdgpu] ? dm_handle_hpd_rx_irq+0x184/0x1a0 [amdgpu] handle_hpd_rx_irq+0x195/0x240 [amdgpu] ? __switch_to_asm+0x42/0x70 ? __switch_to+0x131/0x450 dm_irq_work_func+0x19/0x20 [amdgpu] process_one_work+0x209/0x400 worker_thread+0x4d/0x3e0 ? cancel_delayed_work+0xa0/0xa0 kthread+0x124/0x160 ? kthread_park+0x90/0x90 ret_from_fork+0x22/0x30 Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Anson Jacob Signed-off-by: Anson Jacob Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 314c7629e2024be2a67b1c134746473417c20dac Author: Nicholas Kazlauskas Date: Tue Aug 3 12:03:10 2021 -0400 drm/amd/display: Increase timeout threshold for DMCUB reset [Why] If we're backdoor loading the DMCUB performs more work than just the PHY reset so we can end up resetting before the cleanup has fully finished. [How] Increase timeout, add udelay between spins to guarantee a minimum. Reviewed-by: Roy Chan Reviewed-by: Eric Yang Acked-by: Anson Jacob Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 19c618e613afbd728de59e3c487cb56d8c670607 Author: Nicholas Kazlauskas Date: Tue Aug 3 12:00:12 2021 -0400 drm/amd/display: Clear GPINT after DMCUB has reset [Why] Otherwise we can end up processing whatever was left in the register if the DMCUB was previously reset. If DMCUB gets force reset too early from another client then we might not have even acked the disable yet - causing DMCUB instantly shutdown if the command was 10020000. [How] Move the GPINT clear outside of the reset loop and do it unconditionally after the DMCUB has been properly reset. Reviewed-by: Roy Chan Reviewed-by: Eric Yang Acked-by: Anson Jacob Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c71f260ad4fcc9104cef4cd60707047bdb6a9105 Author: Anthony Koo Date: Sat Jul 31 10:15:46 2021 -0400 drm/amd/display: 3.2.148 This version brings along following fixes: - Fix memory allocation in dm IRQ context to use GFP_ATOMIC - Increase timeout threshold for DMCUB reset - Clear GPINT after DMCUB has reset - Add AUX I2C tracing - Fix code commenting style - Some refactoring - Remove invalid assert for ODM + MPC case Reviewed-by: Wyatt Wood Acked-by: Anson Jacob Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e8272b98b951967c1ee0e6aaf354491ce3ed4270 Author: Anthony Koo Date: Fri Jul 30 18:15:11 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.78 Acked-by: Anson Jacob Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0a95fab36a660021c3127476a8df6518fe47a23e Author: Wenjing Liu Date: Mon Jul 26 14:59:03 2021 -0400 drm/amd/display: add authentication_complete in hdcp output [why] DM needs to be notified when hdcp module has completed authentication attempt. Reviewed-by: Bhawanpreet Lakha Reviewed-by: George Shen Acked-by: Anson Jacob Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 56aca23093019843e881e458f005569ce9e96c47 Author: Ashley Thomas Date: Fri Jul 16 21:18:01 2021 -0700 drm/amd/display: Add AUX I2C tracing. [Why] Developers can find it useful if the driver can produce AUX traces without special equipment. [How] Add AUX tracing. Reviewed-by: Zhan Liu Acked-by: Anson Jacob Signed-off-by: Ashley Thomas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 04c1aad9fa0f17e93aa0a2d9847d7d1bbb4d0636 Author: Roy Chan Date: Fri Jul 23 16:48:57 2021 -0400 drm/amd/display: Correct comment style Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 781e1e23131cce56fb557e6ec2260480a6bd08cc Author: Roy Chan Date: Mon Jul 19 19:00:22 2021 -0400 drm/amd/display: fix incorrect CM/TF programming sequence in dwb [How] the programming sequeune was for old asic. the correct programming sequeunce should be similar to the one used in mpc. the fix is copied from the mpc programming sequeunce. Reviewed-by: Anthony Koo Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4fd771ea441ed98191e8e2c2c1d47e4dc7a0b96a Author: Roy Chan Date: Mon Jul 19 17:41:56 2021 -0400 drm/amd/display: refactor the cursor programing codes Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f9ccaf6da03134206030e697077b7f21d54dbd83 Author: Roy Chan Date: Wed Jul 21 19:35:28 2021 -0400 drm/amd/display: refactor the codes to centralize the stream/pipe checking logic Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 82367e7f22d085092728f45fd5fbb15e3fb997c0 Author: Roy Chan Date: Wed Jul 21 19:33:26 2021 -0400 drm/amd/display: fix missing writeback disablement if plane is removed [Why] If the plane has been removed, the writeback disablement logic doesn't run [How] fix the logic order Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f43a19fd0e976736d8f1b70b6fe1b6b88d6a900b Author: Eric Bernstein Date: Mon Jul 26 15:53:18 2021 -0400 drm/amd/display: Remove invalid assert for ODM + MPC case Reviewed-by: Dmytro Laktyushkin Acked-by: Anson Jacob Signed-off-by: Eric Bernstein Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e78b3197dbf73fc0695dd019e388576d0a551830 Author: YuBiao Wang Date: Thu Aug 5 10:32:40 2021 +0800 drm/amd/amdgpu: skip locking delayed work if not initialized. When init failed in early init stage, amdgpu_object has not been initialized, so hasn't the ttm delayed queue functions. Signed-off-by: YuBiao Wang Reviewed-by: Emily.Deng Signed-off-by: Alex Deucher commit 124e8b1990ac6f01bb7affb0590e322aa462c1c3 Author: Victor Zhao Date: Thu May 6 17:30:41 2021 +0800 drm/amdgpu: Extend full access wait time in guest - Extend wait time and add retry, currently 6s * 2times - Change timing algorithm Signed-off-by: Victor Zhao Signed-off-by: Peng Ju Zhou Signed-off-by: Alex Deucher commit 9c38b671ebd5297d861522806e09cf9e639d0af6 Author: James Clark Date: Thu Aug 5 14:03:54 2021 +0100 perf cs-etm: Add warnings for missing DSOs Currently decode will silently fail if no binary data is available for the decode. This is made worse if only partial data is available because the decode will appear to work, but any trace from that missing DSO will silently not be generated. Add a UI popup once if there is any data missing, and then warn in the bottom left for each individual DSO that's missing. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http //lore.kernel.org/lkml/20210805130354.878120-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b6ac16eed3080169b674bf6e960bd2d272dd1cd3 Author: Jin Yao Date: Fri Aug 6 15:54:04 2021 +0800 perf vendor events: Add metrics for Icelake Server Add JSON metrics for Icelake Server to perf. Based on TMA metrics 4.21 at 01.org. https://download.01.org/perfmon/ Signed-off-by: Jin Yao Reviewed-by: Andi Kleen Reviewed-by: Ian Rogers Cc: Alexander Shishkin Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210806075404.31209-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 94a853eca720ac9e385e59f27e859b4a01123f58 Author: William Breathitt Gray Date: Mon Aug 9 21:37:26 2021 +0900 counter: 104-quad-8: Describe member 'lock' in 'quad8' This adds a kernel-doc comment line describing the 'lock' member of the 'quad8' structure. Acked-by: Syed Nayyar Waris Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/43b4acab9e238638c7067dd4a363a42f94c94ccb.1628511445.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit 3304d2b69a36996fb9bf708310de5cd76a04c09e Author: Ye Xiang Date: Sat Jul 31 11:25:56 2021 +0800 iio: hid-sensor-press: Add timestamp channel Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. The unit of timestamp is nanosecond. Signed-off-by: Ye Xiang Link: https://lore.kernel.org/r/20210731032556.26813-1-xiang.ye@intel.com Signed-off-by: Jonathan Cameron commit 394a0150a0644389ce4d587f5c67393308eec28c Author: William Breathitt Gray Date: Tue Aug 3 21:06:15 2021 +0900 counter: Rename counter_count_function to counter_function The phrase "Counter Count function" is verbose and unintentionally implies that function is a Count extension. This patch adjusts the Counter subsystem code to use the more direct "Counter function" phrase to make the intent of this code clearer. Cc: Jarkko Nikula Cc: Patrick Havelange Cc: Oleksij Rempel Cc: Kamel Bouhara Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: David Lechner Acked-by: Syed Nayyar Waris Reviewed-by: Fabrice Gasnier Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/8268c54d6f42075a19bb08151a37831e22652499.1627990337.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit 493b938a14ed78d7e44c33d1c1e349656a16c360 Author: William Breathitt Gray Date: Tue Aug 3 21:06:14 2021 +0900 counter: Rename counter_signal_value to counter_signal_level Signal values will always be levels so let's be explicit it about it to make the intent of the code clear. Cc: Oleksij Rempel Cc: Kamel Bouhara Acked-by: Syed Nayyar Waris Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/3f17010abe2415859cea9a5fddabd3c97f635ff5.1627990337.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit e2ff3198c580a3a3acfdc50cce5b5f8a941cbcd1 Author: William Breathitt Gray Date: Tue Aug 3 21:06:13 2021 +0900 counter: Standardize to ERANGE for limit exceeded errors ERANGE is a semantically better error code to return when an argument value falls outside the supported limit range of a device. Cc: Jarkko Nikula Cc: Oleksij Rempel Cc: Maxime Coquelin Cc: Alexandre Torgue Acked-by: Syed Nayyar Waris Reviewed-by: David Lechner Reviewed-by: Fabrice Gasnier Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/ae8d3b20b8b02c96b1c9898ffa2f9fa5d99edc81.1627990337.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit b11eed1554e8ea33b748094ea73d8b42fa2bbe3b Author: William Breathitt Gray Date: Tue Aug 3 21:06:12 2021 +0900 counter: Return error code on invalid modes Only a select set of modes (function, action, etc.) are valid for a given device configuration. This patch ensures that invalid modes result in a return -EINVAL. Such a situation should never occur in reality, but it's good to define a default switch case for the sake of making the intent of the code clear. Cc: Kamel Bouhara Cc: Maxime Coquelin Cc: Alexandre Torgue Acked-by: David Lechner Acked-by: Syed Nayyar Waris Reviewed-by: Fabrice Gasnier Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/7af82d4e39610da11edce0ee370285fe1cb1eac8.1627990337.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit 728246e8f7269ecd35a2c6e6795323e6d8f48db7 Author: William Breathitt Gray Date: Tue Aug 3 21:06:11 2021 +0900 counter: 104-quad-8: Return error when invalid mode during ceiling_write The 104-QUAD-8 only has two count modes where a ceiling value makes sense: Range Limit and Modulo-N. Outside of these two modes, setting a ceiling value is an invalid operation -- so let's report it as such by returning -EINVAL. Fixes: fc069262261c ("counter: 104-quad-8: Add lock guards - generic interface") Acked-by: Syed Nayyar Waris Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/a2147f022829b66839a1db5530a7fada47856847.1627990337.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron commit fe943bd8ab75552f2773ee27c7c5ae6b48941582 Author: Heiner Kallweit Date: Thu May 13 23:02:01 2021 +0200 PCI/VPD: Remove struct pci_vpd.flag The struct pci_vpd.flag member was used only to communicate between pci_vpd_wait() and its callers. Remove the flag member and pass the value directly to pci_vpd_wait() to simplify the code. [bhelgaas: commit log] Link: https://lore.kernel.org/r/e4ef6845-6b23-1646-28a0-d5c5a28347b6@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 91ab5d9d02a97264368eb1d72efdba2ec18cc0d4 Author: Heiner Kallweit Date: Thu May 13 22:56:41 2021 +0200 PCI/VPD: Make pci_vpd_wait() uninterruptible Reading/writing 4 bytes should be fast enough even on a slow bus, therefore pci_vpd_wait() doesn't have to be interruptible. Making it uninterruptible allows to simplify the code. In addition make VPD writes uninterruptible in general. It's about vital data, and allowing writes to be interruptible may leave the VPD in an inconsistent state. Link: https://lore.kernel.org/r/258bf994-bc2a-2907-9181-2c7a562986d5@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 1285762c07121b449cd60166b813c0084b792736 Author: Heiner Kallweit Date: Thu May 13 22:56:09 2021 +0200 PCI/VPD: Remove pci_vpd_size() old_size argument vpd->len is initialized to PCI_VPD_MAX_SIZE, and if a quirk is used to set a specific VPD size, then pci_vpd_set_size() sets vpd->valid, resulting in pci_vpd_size() not being called. Therefore we can remove the old_size argument. Note that we don't have to check off < PCI_VPD_MAX_SIZE because that's implicitly done by pci_read_vpd(). Link: https://lore.kernel.org/r/ede36c16-5335-6867-43a1-293641348430@gmail.com Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 5fe204eab174fd474227f23fd47faee4e7a6c000 Author: Bjorn Helgaas Date: Thu Jul 15 16:59:59 2021 -0500 PCI/VPD: Allow access to valid parts of VPD if some is invalid Previously, if we found any error in the VPD, we returned size 0, which prevents access to all of VPD. But there may be valid resources in VPD before the error, and there's no reason to prevent access to those. "off" covers only VPD resources known to have valid header tags. In case of error, return "off" (which may be zero if we haven't found any valid header tags at all). Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit 7fa75dd8c64590850a54991a8bb914667c512b4c Author: Bjorn Helgaas Date: Thu Jul 15 16:59:58 2021 -0500 PCI/VPD: Don't check Large Resource Item Names for validity VPD consists of a series of Small and Large Resources. Computing the size of VPD requires only the length of each, which is specified in the generic tag of each resource. We only expect to see ID_STRING, RO_DATA, and RW_DATA in VPD, but it's not a problem if it contains other resource types because all we care about is the size. Drop the validity checking of Large Resource items. Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit 6303049d16f0e69d0449c3c80d0e3695d4f02f94 Author: Bjorn Helgaas Date: Thu Jul 15 16:59:57 2021 -0500 PCI/VPD: Reject resource tags with invalid size VPD is limited in size by the 15-bit VPD Address field in the VPD Capability. Each resource tag includes a length that determines the overall size of the resource. Reject any resources that would extend past the maximum VPD size. Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit 43059d5416c9441aad8f50b96e00f3e8a8a49673 Author: Darrick J. Wong Date: Fri Aug 6 11:06:35 2021 -0700 xfs: dump log intent items that cannot be recovered due to corruption If we try to recover a log intent item and the operation fails due to filesystem corruption, dump the contents of the item to the log for further analysis. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 48c6615cc557593e4190415a6945b7aca7c8db31 Author: Darrick J. Wong Date: Fri Aug 6 11:06:35 2021 -0700 xfs: grab active perag ref when reading AG headers This patch prepares scrub to deal with the possibility of tearing down entire AGs by changing the order of resource acquisition to match the rest of the XFS codebase. In other words, scrub now grabs AG resources in order of: perag structure, then AGI/AGF/AGFL buffers, then btree cursors; and releases them in reverse order. This requires us to distinguish xchk_ag_init callers -- some are responding to a user request to check AG metadata, in which case we can return ENOENT to userspace; but other callers have an ondisk reference to an AG that they're trying to cross-reference. In this second case, the lack of an AG means there's ondisk corruption, since ondisk metadata cannot point into nonexistent space. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit f19ee6bb1a72e7e1ecbd25d99a48513bc6061832 Author: Darrick J. Wong Date: Fri Aug 6 11:05:44 2021 -0700 xfs: drop experimental warnings for bigtime and inobtcount These two features were merged a year ago, userspace tooling have been merged, and no serious errors have been reported by the developers. Drop the experimental tag to encourage wider testing. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Carlos Maiolino Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig commit b7df7630cccd103671b14b946bcdb3b14be75d68 Author: Darrick J. Wong Date: Fri Aug 6 11:05:44 2021 -0700 xfs: fix silly whitespace problems with kernel libxfs Fix a few whitespace errors such as spaces at the end of the line, etc. This gets us back to something more closely resembling parity. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 40b1de007aca4f9ec4ee4322c29f026ebb60ac96 Author: Darrick J. Wong Date: Fri Aug 6 11:05:43 2021 -0700 xfs: throttle inode inactivation queuing on memory reclaim Now that we defer inode inactivation, we've decoupled the process of unlinking or closing an inode from the process of inactivating it. In theory this should lead to better throughput since we now inactivate the queued inodes in batches instead of one at a time. Unfortunately, one of the primary risks with this decoupling is the loss of rate control feedback between the frontend and background threads. In other words, a rm -rf /* thread can run the system out of memory if it can queue inodes for inactivation and jump to a new CPU faster than the background threads can actually clear the deferred work. The workers can get scheduled off the CPU if they have to do IO, etc. To solve this problem, we configure a shrinker so that it will activate the /second/ time the shrinkers are called. The custom shrinker will queue all percpu deferred inactivation workers immediately and set a flag to force frontend callers who are releasing a vfs inode to wait for the inactivation workers. On my test VM with 560M of RAM and a 2TB filesystem, this seems to solve most of the OOMing problem when deleting 10 million inodes. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit a6343e4d9278b3919c809fab9945c4d8f04fadf5 Author: Darrick J. Wong Date: Fri Aug 6 11:05:43 2021 -0700 xfs: avoid buffer deadlocks when walking fs inodes When we're servicing an INUMBERS or BULKSTAT request or running quotacheck, grab an empty transaction so that we can use its inherent recursive buffer locking abilities to detect inode btree cycles without hitting ABBA buffer deadlocks. This patch requires the deferred inode inactivation patchset because xfs_irele cannot directly call xfs_inactive when the iwalk itself has an (empty) transaction. Found by fuzzing an inode btree pointer to introduce a cycle into the tree (xfs/365). Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit e8d04c2abcebd66bdbacd53bb273d824d4e27080 Author: Darrick J. Wong Date: Fri Aug 6 11:05:42 2021 -0700 xfs: use background worker pool when transactions can't get free space In xfs_trans_alloc, if the block reservation call returns ENOSPC, we call xfs_blockgc_free_space with a NULL icwalk structure to try to free space. Each frontend thread that encounters this situation starts its own walk of the inode cache to see if it can find anything, which is wasteful since we don't have any additional selection criteria. For this one common case, create a function that reschedules all pending background work immediately and flushes the workqueue so that the scan can run in parallel. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit a11d7fc2d05fb509cd9e33d4093507d6eda3ad53 Author: Christoph Hellwig Date: Mon Aug 9 16:17:44 2021 +0200 block: remove the bd_bdi in struct block_device Just retrieve the bdi from the disk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-6-hch@lst.de Signed-off-by: Jens Axboe commit edb0872f44ec9976ea6d052cb4b93cd2d23ac2ba Author: Christoph Hellwig Date: Mon Aug 9 16:17:43 2021 +0200 block: move the bdi from the request_queue to the gendisk The backing device information only makes sense for file system I/O, and thus belongs into the gendisk and not the lower level request_queue structure. Move it there. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-5-hch@lst.de Signed-off-by: Jens Axboe commit 1008162b2782a3624d12b0aee8da58bc75d12e19 Author: Christoph Hellwig Date: Mon Aug 9 16:17:42 2021 +0200 block: add a queue_has_disk helper Add a helper to check if a gendisk is associated with a request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-4-hch@lst.de Signed-off-by: Jens Axboe commit 471aa704db4904f7af5a50019ca3b5b018c0cf62 Author: Christoph Hellwig Date: Mon Aug 9 16:17:41 2021 +0200 block: pass a gendisk to blk_queue_update_readahead .. and rename the function to disk_update_readahead. This is in preparation for moving the BDI from the request_queue to the gendisk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-3-hch@lst.de Signed-off-by: Jens Axboe commit 5ed964f8e54eb3191b8b7b45aeb52672a0c995dc Author: Christoph Hellwig Date: Mon Aug 9 16:17:40 2021 +0200 mm: hide laptop_mode_wb_timer entirely behind the BDI API Don't leak the detaіls of the timer into the block layer, instead initialize the timer in bdi_alloc and delete it in bdi_unregister. Note that this means the timer is initialized (but not armed) for non-block queues as well now. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-2-hch@lst.de Signed-off-by: Jens Axboe commit 6f6490914d9b712004ddad648e47b1bf22647978 Author: Darrick J. Wong Date: Fri Aug 6 11:05:42 2021 -0700 xfs: don't run speculative preallocation gc when fs is frozen Now that we have the infrastructure to switch background workers on and off at will, fix the block gc worker code so that we don't actually run the worker when the filesystem is frozen, same as we do for deferred inactivation. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 01e8f379a4895a9a173391408db4fb49ec91e148 Author: Darrick J. Wong Date: Fri Aug 6 11:05:42 2021 -0700 xfs: flush inode inactivation work when compiling usage statistics Users have come to expect that the space accounting information in statfs and getquota reports are fairly accurate. Now that we inactivate inodes from a background queue, these numbers can be thrown off by whatever resources are singly-owned by the inodes in the queue. Flush the pending inactivations when userspace asks for a space usage report. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 2eb665027b6528c1a8e9158c2f722a6ec0af359d Author: Darrick J. Wong Date: Fri Aug 6 11:05:41 2021 -0700 xfs: inactivate inodes any time we try to free speculative preallocations Other parts of XFS have learned to call xfs_blockgc_free_{space,quota} to try to free speculative preallocations when space is tight. This means that file writes, transaction reservation failures, quota limit enforcement, and the EOFBLOCKS ioctl all call this function to free space when things are tight. Since inode inactivation is now a background task, this means that the filesystem can be hanging on to unlinked but not yet freed space. Add this to the list of things that xfs_blockgc_free_* makes writer threads scan for when they cannot reserve space. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 65f03d8652b240aa66b99a07e3c423a51e967568 Author: Darrick J. Wong Date: Fri Aug 6 11:05:41 2021 -0700 xfs: queue inactivation immediately when free realtime extents are tight Now that we have made the inactivation of unlinked inodes a background task to increase the throughput of file deletions, we need to be a little more careful about how long of a delay we can tolerate. Similar to the patch doing this for free space on the data device, if the file being inactivated is a realtime file and the realtime volume is running low on free extents, we want to run the worker ASAP so that the realtime allocator can make better decisions. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 108523b8de676a45cef1f6c8566c444222b85de0 Author: Darrick J. Wong Date: Fri Aug 6 11:05:40 2021 -0700 xfs: queue inactivation immediately when quota is nearing enforcement Now that we have made the inactivation of unlinked inodes a background task to increase the throughput of file deletions, we need to be a little more careful about how long of a delay we can tolerate. Specifically, if the dquots attached to the inode being inactivated are nearing any kind of enforcement boundary, we want to queue that inactivation work immediately so that users don't get EDQUOT/ENOSPC errors even after they deleted a bunch of files to stay within quota. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 7d6f07d2c5ad9fce298889eeed317d512a2df8cd Author: Darrick J. Wong Date: Fri Aug 6 11:05:40 2021 -0700 xfs: queue inactivation immediately when free space is tight Now that we have made the inactivation of unlinked inodes a background task to increase the throughput of file deletions, we need to be a little more careful about how long of a delay we can tolerate. On a mostly empty filesystem, the risk of the allocator making poor decisions due to fragmentation of the free space on account a lengthy delay in background updates is minimal because there's plenty of space. However, if free space is tight, we want to deallocate unlinked inodes as quickly as possible to avoid fallocate ENOSPC and to give the allocator the best shot at optimal allocations for new writes. Therefore, queue the percpu worker immediately if the filesystem is more than 95% full. This follows the same principle that XFS becomes less aggressive about speculative allocations and lazy cleanup (and more precise about accounting) when nearing full. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit d1254a8749711e0d7441036a74ce592341f89697 Author: Christoph Hellwig Date: Wed Aug 4 11:41:47 2021 +0200 block: remove support for delayed queue registrations Now that device mapper has been changed to register the disk once it is fully ready all this code is unused. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-9-hch@lst.de Signed-off-by: Jens Axboe commit 89f871af1b26d98d983cba7ed0e86effa45ba5f8 Author: Christoph Hellwig Date: Wed Aug 4 11:41:46 2021 +0200 dm: delay registering the gendisk device mapper is currently the only outlier that tries to call register_disk after add_disk, leading to fairly inconsistent state of these block layer data structures. Instead change device-mapper to just register the gendisk later now that the holder mechanism can cope with that. Note that this introduces a user visible change: the dm kobject is now only visible after the initial table has been loaded. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-8-hch@lst.de Signed-off-by: Jens Axboe commit ba30585936b0b88f0fb2b19be279b346a6cc87eb Author: Christoph Hellwig Date: Wed Aug 4 11:41:45 2021 +0200 dm: move setting md->type into dm_setup_md_queue Move setting md->type from both callers into dm_setup_md_queue. This ensures that md->type is only set to a valid value after the queue has been fully setup, something we'll rely on future changes. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-7-hch@lst.de Signed-off-by: Jens Axboe commit 74a2b6ec9380959546d95ecc01a8fe6c7157add9 Author: Christoph Hellwig Date: Wed Aug 4 11:41:44 2021 +0200 dm: cleanup cleanup_mapped_device md->queue is now always set when md->disk is set, so simplify the conditionals a bit. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-6-hch@lst.de Signed-off-by: Jens Axboe commit d626338735909bc2b2e7cafc332f44ed41cfdeee Author: Christoph Hellwig Date: Wed Aug 4 11:41:43 2021 +0200 block: support delayed holder registration device mapper needs to register holders before it is ready to do I/O. Currently it does so by registering the disk early, which can leave the disk and queue in a weird half state where the queue is registered with the disk, except for sysfs and the elevator. And this state has been a bit promlematic before, and will get more so when sorting out the responsibilities between the queue and the disk. Support registering holders on an initialized but not registered disk instead by delaying the sysfs registration until the disk is registered. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-5-hch@lst.de Signed-off-by: Jens Axboe commit 0dbcfe247f22a6d73302dfa691c48b3c14d31c4c Author: Christoph Hellwig Date: Wed Aug 4 11:41:42 2021 +0200 block: look up holders by bdev Invert they way the holder relations are tracked. This very slightly reduces the memory overhead for partitioned devices. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210804094147.459763-4-hch@lst.de Signed-off-by: Jens Axboe commit fbd9a39542ecdd2ade55869c13856b2590db3df8 Author: Christoph Hellwig Date: Wed Aug 4 11:41:41 2021 +0200 block: remove the extra kobject reference in bd_link_disk_holder Since commit 0d02129e76ed ("block: merge struct block_device and struct hd_struct") there is no way for the bdev to go away as long as there is a holder, so remove the extra references. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-3-hch@lst.de Signed-off-by: Jens Axboe commit c66fd019713e9cf7d6f1243c378cd177d01fe18a Author: Christoph Hellwig Date: Wed Aug 4 11:41:40 2021 +0200 block: make the block holder code optional Move the block holder code into a separate file as it is not in any way related to the other block_dev.c code, and add a new selectable config option for it so that we don't have to build it without any remapped drivers selected. The Kconfig symbol contains a _DEPRECATED suffix to match the comments added in commit 49731baa41df ("block: restore multiple bd_link_disk_holder() support"). Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20210804094147.459763-2-hch@lst.de Signed-off-by: Jens Axboe commit 8bf5d31c4f06d806ae24a3ba998a2f4eaccfa7c1 Author: Bjorn Andersson Date: Sat Jul 24 20:14:14 2021 -0700 interconnect: qcom: osm-l3: Use driver-specific naming In situations were the developer screws up by e.g. not giving the OSM nodes unique identifiers the interconnect framework might mix up nodes between the OSM L3 provider and e.g. the RPMh provider. The resulting callstack contains "qcom_icc_set", which is not unique to the OSM L3 provider driver. Once the faulting qcom_icc_set() is identified it's further confusing that "qcom_icc_node" is different between the different drivers. To avoid this confusion, rename the node struct and the setter in the OSM L3 driver to include "osm_l3" in their names. Signed-off-by: Bjorn Andersson Tested-by: Steev Klimaszewski Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210725031414.3961227-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 771c994ea51f572539ca3961c6a7706862b147e2 Author: Gao Xiang Date: Thu Aug 5 08:36:01 2021 +0800 erofs: convert all uncompressed cases to iomap Since tail-packing inline has been supported by iomap now, let's convert all EROFS uncompressed data I/O to iomap, which is pretty straight-forward. Link: https://lore.kernel.org/r/20210805003601.183063-4-hsiangkao@linux.alibaba.com Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 61dc131cecaecfa1ade0f932f306544861e83718 Merge: 06252e9ce05b9 ae44f9c286da3 Author: Gao Xiang Date: Tue Aug 10 00:16:47 2021 +0800 Merge tag 'iomap-5.15-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git Pull 'iomap-5.15-merge-2' to support EROFS iomap tail-packing inline: - Simplify the bio_end_page usage in the buffered IO code. - Support reading inline data at nonzero offsets for erofs. - Fix some typos and bad grammar. - Convert kmap_atomic usage in the inline data read path. - Add some extra inline data input checking. Signed-off-by: Gao Xiang commit 06252e9ce05b94b587e522667b85848a30197b15 Author: Gao Xiang Date: Thu Aug 5 08:36:00 2021 +0800 erofs: dax support for non-tailpacking regular file DAX is quite useful for some VM use cases in order to save guest memory extremely with minimal lightweight EROFS. In order to prepare for such use cases, add preliminary dax support for non-tailpacking regular files for now. Tested with the DRAM-emulated PMEM and the EROFS image generated by "mkfs.erofs -Enoinline_data enwik9.fsdax.img enwik9" Link: https://lore.kernel.org/r/20210805003601.183063-3-hsiangkao@linux.alibaba.com Cc: nvdimm@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit a08e67a0280215f74eccf14fda81dd7fed6596ba Author: Huang Jianan Date: Thu Aug 5 08:35:59 2021 +0800 erofs: iomap support for non-tailpacking DIO Add iomap support for non-tailpacking uncompressed data in order to support DIO and DAX. Direct I/O is useful in certain scenarios for uncompressed files. For example, double pagecache can be avoid by direct I/O when loop device is used for uncompressed files containing upper layer compressed filesystem. This adds iomap DIO support for non-tailpacking cases first and tail-packing inline files are handled in the follow-up patch. Link: https://lore.kernel.org/r/20210805003601.183063-2-hsiangkao@linux.alibaba.com Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Chao Yu Signed-off-by: Huang Jianan Signed-off-by: Gao Xiang commit 064478e4877c76b0c1fd1155934f226f1561aab3 Author: Jack Yu Date: Mon Aug 9 10:27:14 2021 +0000 ASoC: dt-bindings: rt1015p: add new compatible id Add new compatible ID for rt1015p in dt-bindings document. Signed-off-by: Jack Yu Link: https://lore.kernel.org/r/ce9e2f298f0c4fc59f756c39736a297a@realtek.com Signed-off-by: Mark Brown commit 6d0a764d418fb508119e129c73f39ecc66826675 Author: Jack Yu Date: Mon Aug 9 10:27:05 2021 +0000 ASoC: rt1015p: add new acpi id and comapatible id Add new acpi id and compatible id for rt1015p. Signed-off-by: Jack Yu Link: https://lore.kernel.org/r/22be83429956486f9f64b424c26be810@realtek.com Signed-off-by: Mark Brown commit d03c54419274f96434e2ad74e59e67ec6d54ca86 Author: Logan Gunthorpe Date: Mon Aug 9 17:13:31 2021 +0200 dma-mapping: disallow .map_sg operations from returning zero on error Now that all the .map_sg operations have been converted to returning proper error codes, drop the code to handle a zero return value, add a warning if a zero is returned. Signed-off-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig commit 66ab63104f9cab09209851fef168f5972d791903 Author: Martin Oliveira Date: Thu Jul 29 14:15:38 2021 -0600 dma-mapping: return error code from dma_dummy_map_sg() The .map_sg() op now expects an error code instead of zero on failure. The only errno to return is -EINVAL in the case when DMA is not supported. Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig commit 183dc86335e69f516b94f169afd784cf97cb8421 Author: Logan Gunthorpe Date: Thu Jul 29 14:15:37 2021 -0600 x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR Setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention, so remove it. Link: https://lore.kernel.org/linux-mips/20210716063241.GC13345@lst.de/ Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Niklas Schnelle Cc: Thomas Bogendoerfer Cc: Michael Ellerman Signed-off-by: Christoph Hellwig commit fcacc8a614391d3bf009319509c846fef47d9352 Author: Martin Oliveira Date: Thu Jul 29 14:15:36 2021 -0600 x86/amd_gart: return error code from gart_map_sg() The .map_sg() op now expects an error code instead of zero on failure. So make __dma_map_cont() return a valid errno (which is then propagated to gart_map_sg() via dma_map_cont()) and return it in case of failure. Also, return -EINVAL in case of invalid nents. Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Niklas Schnelle Cc: Thomas Bogendoerfer Cc: Michael Ellerman Signed-off-by: Christoph Hellwig commit 2c647ebe17140f1f5de09d4e30817b1b00a3b588 Author: Martin Oliveira Date: Thu Jul 29 14:15:35 2021 -0600 xen: swiotlb: return error code from xen_swiotlb_map_sg() The .map_sg() op now expects an error code instead of zero on failure. xen_swiotlb_map_sg() may only fail if xen_swiotlb_map_page() fails, but xen_swiotlb_map_page() only supports returning errors as DMA_MAPPING_ERROR. So coalesce all errors into EIO per the documentation for dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Reviewed-by: Boris Ostrovsky Cc: Konrad Rzeszutek Wilk Cc: Juergen Gross Cc: Stefano Stabellini Signed-off-by: Christoph Hellwig commit 9a22f2f3435184df2882b8c6d6999e6ef022331b Author: Martin Oliveira Date: Thu Jul 29 14:15:34 2021 -0600 parisc: return error code from .map_sg() ops The .map_sg() op now expects an error code instead of zero on failure. Return -EINVAL if the ioc cannot be obtained. Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: "James E.J. Bottomley" Cc: Helge Deller Signed-off-by: Christoph Hellwig commit ba3a0482db879f33863348b81ed9770888d727a9 Author: Logan Gunthorpe Date: Thu Jul 29 14:15:33 2021 -0600 sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR Setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention, so remove it. Link: https://lore.kernel.org/linux-mips/20210716063241.GC13345@lst.de/ Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Cc: "David S. Miller" Cc: Niklas Schnelle Cc: Michael Ellerman Signed-off-by: Christoph Hellwig commit e02373fddb0ea86ce3962bb5d38e20ea0b6c8a05 Author: Martin Oliveira Date: Thu Jul 29 14:15:32 2021 -0600 sparc/iommu: return error codes from .map_sg() ops The .map_sg() op now expects an error code instead of zero on failure. Returning an errno from __sbus_iommu_map_sg() results in sbus_iommu_map_sg_gflush() and sbus_iommu_map_sg_pflush() returning an errno, as those functions are wrappers around __sbus_iommu_map_sg(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: "David S. Miller" Cc: Niklas Schnelle Cc: Michael Ellerman Signed-off-by: Christoph Hellwig commit 7e4e7d4c54ecc9986041aae84e04280413f2435b Author: Logan Gunthorpe Date: Thu Jul 29 14:15:31 2021 -0600 s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR Setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention, so remove it. Link: https://lore.kernel.org/linux-mips/20210716063241.GC13345@lst.de/ Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Cc: Niklas Schnelle Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Christoph Hellwig commit 911ace0ba628424637e42826c8a8b63b89bd5611 Author: Martin Oliveira Date: Thu Jul 29 14:15:30 2021 -0600 s390/pci: return error code from s390_dma_map_sg() The .map_sg() op now expects an error code instead of zero on failure. So propagate the error from __s390_dma_map_sg() up. __s390_dma_map_sg() returns either -ENOMEM on allocation failure or -EINVAL which is the same as what's expected by dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Acked-by: Niklas Schnelle Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Christoph Hellwig commit eb86ef3b2d7e06b1447d4979e282977a845b611b Author: Logan Gunthorpe Date: Thu Jul 29 14:15:29 2021 -0600 powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR Setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention, so remove it. Link: https://lore.kernel.org/linux-mips/20210716063241.GC13345@lst.de/ Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Geoff Levand Signed-off-by: Christoph Hellwig commit c4e0e892ab0579d4de3ca6d260d537fc16b39790 Author: Martin Oliveira Date: Thu Jul 29 14:15:28 2021 -0600 powerpc/iommu: return error code from .map_sg() ops The .map_sg() op now expects an error code instead of zero on failure. Propagate the error up if vio_dma_iommu_map_sg() fails. ppc_iommu_map_sg() may fail either because of iommu_range_alloc() or because of tbl->it_ops->set(). The former only supports returning an error with DMA_MAPPING_ERROR and an examination of the latter indicates that it may return arch-specific errors (for example, tce_buildmulti_pSeriesLP()). Hence, coalesce all of those errors into -EIO, per the documentation on dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Geoff Levand Signed-off-by: Christoph Hellwig commit af82fe85665d49bdb72dba66cd57e3bf95b71895 Author: Martin Oliveira Date: Thu Jul 29 14:15:27 2021 -0600 MIPS/jazzdma: return error code from jazz_dma_map_sg() The .map_sg() op now expects an error code instead of zero on failure. vdma_alloc() may fail for different reasons, but since it only supports indicating an error via a return of DMA_MAPPING_ERROR, we coalesce the different reasons into -EIO as is documented on dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Thomas Bogendoerfer Signed-off-by: Christoph Hellwig commit 62af5ca50c29a9be266656dfb88db6d439d129a1 Author: Martin Oliveira Date: Thu Jul 29 14:15:26 2021 -0600 ia64/sba_iommu: return error code from sba_map_sg_attrs() The .map_sg() op now expects an error code instead of zero on failure. In the case of a dma_mapping_error() return -EIO as the actual cause is opaque here. sba_coalesce_chunks() may only presently fail if sba_alloc_range() fails, which in turn only fails if the iommu is out of mapping resources, hence a -ENOMEM is used in that case. Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Michael Ellerman Cc: Niklas Schnelle Cc: Thomas Bogendoerfer Signed-off-by: Christoph Hellwig commit 9cf88ec5e0e876c959389b1e695438f98663b92d Author: Logan Gunthorpe Date: Thu Jul 29 14:15:25 2021 -0600 ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR Setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention, so remove it. Link: https://lore.kernel.org/linux-mips/20210716063241.GC13345@lst.de/ Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Cc: Russell King Cc: Thomas Bogendoerfer Signed-off-by: Christoph Hellwig commit 6506932b3268001ff15c081aceb47c7f9aa9fb2d Author: Martin Oliveira Date: Thu Jul 29 14:15:24 2021 -0600 ARM/dma-mapping: return error code from .map_sg() ops The .map_sg() op now expects an error code instead of zero on failure. In the case of a DMA_MAPPING_ERROR, -EIO is returned. Otherwise, -ENOMEM or -EINVAL is returned depending on the error from __map_sg_chunk(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Russell King Cc: Thomas Bogendoerfer Signed-off-by: Christoph Hellwig commit ca33d26ac640bdf74e5fd0fcd711dbc5ab9f36c0 Author: Martin Oliveira Date: Thu Jul 29 14:15:23 2021 -0600 alpha: return error code from alpha_pci_map_sg() The .map_sg() op now expects an error code instead of zero on failure. pci_map_single_1() can fail for different reasons, but since the only supported type of error return is DMA_MAPPING_ERROR, we coalesce those errors into EIO. ENOMEM is returned when no page tables can be allocated. Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Christoph Hellwig commit dabb16f67215918c48cf3ff1fc4bc36ca421da2b Author: Logan Gunthorpe Date: Thu Jul 29 14:15:22 2021 -0600 iommu/dma: return error code from iommu_dma_map_sg() Return appropriate error codes EINVAL or ENOMEM from iommup_dma_map_sg(). If lower level code returns ENOMEM, then we return it, other errors are coalesced into EINVAL. iommu_dma_map_sg_swiotlb() returns -EIO as its an unknown error from a call that returns DMA_MAPPING_ERROR. Signed-off-by: Logan Gunthorpe Cc: Joerg Roedel Cc: Will Deacon Signed-off-by: Christoph Hellwig commit ad8f36e4b6b1c826a0daa5fda2c5839205b5aa8b Author: Logan Gunthorpe Date: Thu Jul 29 14:15:21 2021 -0600 iommu: return full error code from iommu_map_sg[_atomic]() Convert to ssize_t return code so the return code from __iommu_map() can be returned all the way down through dma_iommu_map_sg(). Signed-off-by: Logan Gunthorpe Cc: Joerg Roedel Cc: Will Deacon Signed-off-by: Christoph Hellwig commit c81be74e7d790f090d3c8a52e20a334dc2506a3f Author: Logan Gunthorpe Date: Thu Jul 29 14:15:20 2021 -0600 dma-direct: return appropriate error code from dma_direct_map_sg() Now that the map_sg() op expects error codes instead of return zero on error, convert dma_direct_map_sg() to return an error code. Per the documentation for dma_map_sgtable(), -EIO is returned due to an DMA_MAPPING_ERROR with unknown cause. Signed-off-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig commit fffe3cc8c2194f60c4af4fac7f27d25e8828f001 Author: Logan Gunthorpe Date: Thu Jul 29 14:15:19 2021 -0600 dma-mapping: allow map_sg() ops to return negative error codes Allow dma_map_sgtable() to pass errors from the map_sg() ops. This will be required for returning appropriate error codes when mapping P2PDMA memory. Introduce __dma_map_sg_attrs() which will return the raw error code from the map_sg operation (whether it be negative or zero). Then add a dma_map_sg_attrs() wrapper to convert any negative errors to zero to satisfy the existing calling convention. dma_map_sgtable() defines three error codes that .map_sg implementations are allowed to return: -EINVAL, -ENOMEM and -EIO. The latter of which is a generic return for cases that are passing DMA_MAPPING_ERROR through. dma_map_sgtable() will convert a zero error return for old map_sg() ops into a -EIO return and return any negative errors as reported. This allows map_sg implementations to start returning multiple negative error codes. Legacy map_sg implementations can continue to return zero until they are all converted. Signed-off-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig commit a10facb752535c078c914b1910dd72eb2e8d584b Author: Steve Lee Date: Mon Aug 9 23:21:40 2021 +0900 ASoC: max98390: Add support change dsm param name In case of using different type of speaker, support using different dsm parameter bin file for each amp connected. Signed-off-by: Steve Lee Link: https://lore.kernel.org/r/20210809142140.9293-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown commit 173735c346c412d9f084825ecb04f24ada0e2986 Author: Anthony Iliopoulos Date: Thu Jul 22 16:10:55 2021 +0200 dma-debug: fix debugfs initialization order Due to link order, dma_debug_init is called before debugfs has a chance to initialize (via debugfs_init which also happens in the core initcall stage), so the directories for dma-debug are never created. Decouple dma_debug_fs_init from dma_debug_init and defer its init until core_initcall_sync (after debugfs has been initialized) while letting dma-debug initialization occur as soon as possible to catch any early mappings, as suggested in [1]. [1] https://lore.kernel.org/linux-iommu/YIgGa6yF%2Fadg8OSN@kroah.com/ Fixes: 15b28bbcd567 ("dma-debug: move initialization to common code") Signed-off-by: Anthony Iliopoulos Signed-off-by: Christoph Hellwig commit 1d7db834a027ecfb5ac93be2e8bb45bfcbbf6eaa Author: Kefeng Wang Date: Thu Jul 22 18:55:12 2021 +0800 dma-debug: use memory_intersects() directly There is already a memory_intersects() helper in sections.h, use memory_intersects() directly instead of private overlap(). Signed-off-by: Kefeng Wang Signed-off-by: Christoph Hellwig commit 46f815323b5a8f0e7156f50ea87c354424210e97 Author: Davidlohr Bueso Date: Sun Aug 8 21:33:01 2021 -0700 perf bench futex, requeue: Add --pi parameter This extends the program to measure WAIT_REQUEUE_PI+CMP_REQUEUE_PI pairs, which are the underlying machinery behind priority-inheritance aware condition variables. The defaults are the same as with the regular non-pi version, requeueing one task at a time, with the exception that PI will always wakeup the first waiter. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-8-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit 6f9661b25b1741b180bdaeb85853905078cfd9d8 Author: Davidlohr Bueso Date: Sun Aug 8 21:33:00 2021 -0700 perf bench futex, requeue: Robustify futex_wait() handling Do not assume success and account for EAGAIN or any other return value, however unlikely. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-7-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit d262e6a93b3ceb3db7e6388d89352801f02c3260 Author: Davidlohr Bueso Date: Sun Aug 8 21:32:59 2021 -0700 perf bench futex, requeue: Add --broadcast option Such that all threads are requeued to uaddr2 in a single futex_cmp_requeue(), unlike the default, which is 1. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-6-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit 9f9a3ffe94f263388b99cb75e4ec374e31aaeb0f Author: Davidlohr Bueso Date: Sun Aug 8 21:32:58 2021 -0700 perf bench futex: Add --mlockall parameter This adds, across all futex benchmarks, the -m/--mlockall option which is a common operation for realtime workloads by not incurring in page faults in paths that want determinism. As such, threads started after a call to mlockall(2) will generate page faults immediately since the new stack is immediately forced to memory, due to the MCL_FUTURE flag. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-5-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit b2105a75703ebe098710beedc7a1685f67010675 Author: Davidlohr Bueso Date: Sun Aug 8 21:32:56 2021 -0700 perf bench futex: Remove bogus backslash from comment It obviously doesn't belong there. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-3-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit 09590463036385a1806a2422807da057519207e1 Author: Davidlohr Bueso Date: Sun Aug 8 21:32:55 2021 -0700 perf bench futex: Group test parameters cleanup Do this across all futex-bench tests such that all program parameters neatly share a common structure, which is nicer than how we have them now. No changes in program behavior are expected. Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20210809043301.66002-2-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo commit 5b0ef98ed1e227b3e113a095abcaa0a22bb18400 Author: Dafna Hirschfeld Date: Mon Jul 12 20:12:09 2021 +0200 drm/mediatek: Test component initialization earlier in the function mtk_drm_crtc_create The initialization is currently tested in a later stage in the function for no reason. In addition, the test '!comp' will never fail since comp is set with the '&' operator. Instead, test if a comp was not initialized by testing "!comp->dev". Signed-off-by: Dafna Hirschfeld Signed-off-by: Chun-Kuang Hu commit ca4c5b334f1036d567b6a7d1f695430d7e4fd8a3 Author: Takashi Iwai Date: Mon Aug 9 16:05:32 2021 +0200 ALSA: msnd: Use proper mmap method The old ISA MSND driver basically maps the iomem as the DMA buffer. For this type of buffer, we have already the standard mmap helper, snd_pcm_lib_mmap_iomem(). Correct the PCM info, set the DMA address and use the standard helper for handling the mmap on all architectures properly. Link: https://lore.kernel.org/r/20210809140532.11006-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 58e4c539820020c5c997551b05a4093cae645870 Author: Fabien Parent Date: Fri Oct 23 15:31:30 2020 +0200 drm/mediatek: Add support for main DDP path on MT8167 Add the main (DSI) drm display path for MT8167. Signed-off-by: Fabien Parent Signed-off-by: Chun-Kuang Hu commit 8867c4b39361a2c12d4a4b3343e2b4cf3b32a50e Author: Fabien Parent Date: Fri Oct 23 15:31:27 2020 +0200 dt-bindings: display: mediatek: dsi: add documentation for MT8167 SoC Add binding documentation for the MT8167 SoC. Signed-off-by: Fabien Parent Signed-off-by: Chun-Kuang Hu commit 500007ebbae5e2da31f9220f913d9eb1505c71f8 Author: Thomas Zimmermann Date: Thu Jun 24 11:01:26 2021 +0200 drm/mediatek: Implement mmap as GEM object function Moving the driver-specific mmap code into a GEM object function allows for using DRM helpers for various mmap callbacks. The respective mediatek functions are being removed. The file_operations structure fops is now being created by the helper macro DEFINE_DRM_GEM_FOPS(). Signed-off-by: Thomas Zimmermann Signed-off-by: Chun-Kuang Hu commit 455ecc808e99f154bd80541219f207f752a61c16 Author: Srinivas Kandagatla Date: Mon Aug 9 13:31:37 2021 +0100 ASoC: qdsp6: q6adm: fix cppcheck warnings for unnecessary initialization cppcheck reports below warning. q6adm.c:475]: (style) Variable 'matrix_map' is reassigned a value before the old one has been used. This is due to unnecessary initialization of variable matrix_map, which is now removed as part of this patch. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210809123137.14456-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit e05f9ee5eabf4b88f9b9b264c8594ee6984b2131 Author: Srinivas Kandagatla Date: Mon Aug 9 13:31:36 2021 +0100 ASoC: qdsp6: q6asm: fix cppcheck warnings for unnecessary initialization cppcheck reports below warning. q6asm.c:1631: (style) Variable 'port' is reassigned a value before the old one has been used. This is due to unnecessary initialization of variable port, which is now removed as part of this patch. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210809123137.14456-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 5c842e51ac63130a1344650b0a95bdc398666947 Author: Mason Zhang Date: Mon Aug 9 13:59:12 2021 +0800 spi: mediatek: fix build warnning in set cs timing this patch fixed the build warnning in set cs timing. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210809055911.17538-1-Mason.Zhang@mediatek.com Signed-off-by: Mark Brown commit 2a2b6e3640c43a808dcb5226963e2cc0669294b1 Author: Leon Romanovsky Date: Mon Aug 9 15:03:19 2021 +0300 devlink: Fix port_type_set function pointer check Fix a typo when checking existence of port_type_set function pointer. Fixes: 82564f6c706a ("devlink: Simplify devlink port API calls") Reported-by: kernel test robot Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit ffef0b13bf3ededa07570a2926d13a741a1d5272 Author: Bjorn Andersson Date: Sat Jul 24 19:58:34 2021 -0700 interconnect: qcom: osm-l3: Add sc8180x support Add support for the Qualcomm SC8180x platform to the OSM L3 driver. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210725025834.3941777-2-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 13fa44c0b6bfbbf15e17ca90b4ae378ca072417d Author: Bjorn Andersson Date: Sat Jul 24 19:58:33 2021 -0700 dt-bindings: interconnect: Add SC8180x to OSM L3 DT binding The Qualcomm SC8180x has an OSM L3, add compatible for this. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210725025834.3941777-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 9c8c6bac1ae86f6902baa938101902fb3a0a100b Author: Georgi Djakov Date: Fri Jul 23 12:42:43 2021 -0700 interconnect: qcom: Add SC8180x providers The SC8180x contains the usual RPMH based interconnect providers, add a driver which defines the various busses and ports. Signed-off-by: Georgi Djakov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210723194243.3675795-2-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit d81274f8fd8616724a86be0b9bab92f0f52651ef Author: Georgi Djakov Date: Fri Jul 23 12:42:42 2021 -0700 dt-bindings: interconnect: Add Qualcomm SC8180x DT bindings Add compatibles and port definitions for the SC8180x RPMH interconnect providers. Signed-off-by: Georgi Djakov [bjorn: Split defines from driver patch and added binding update] Signed-off-by: Bjorn Andersson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210723194243.3675795-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 42716425ad7e1b6529ec61c260c11176841f4b5f Author: Sanjay R Mehta Date: Tue Aug 3 07:34:56 2021 -0500 thunderbolt: Fix port linking by checking all adapters In tb_switch_default_link_ports(), while linking of ports, only odd-numbered ports (1,3,5..) are considered and even-numbered ports are not considered. AMD host router has lane adapters at 2 and 3 and link ports at adapter 2 is not considered due to which lane bonding gets disabled. Hence added a fix such that all ports are considered during linking of ports. Signed-off-by: Basavaraj Natikar Signed-off-by: Sanjay R Mehta Signed-off-by: Mika Westerberg commit fb7a89ad2f048489605611801d480c7bb9d03f94 Author: Sanjay R Mehta Date: Tue Aug 3 07:34:55 2021 -0500 thunderbolt: Do not read control adapter config space Adapter 0 is the control adapter and as per USB4 spec in section 2.2.6.2 control Adapters do not have an adapter configuration space. For this reason skip reading adapter config space in tb_port_init() when the port number is 0. This actually simplifies the rest of the function as we don't need to check for the port->port == 0 anymore. While there drop the extra empty line at the end of the function. Signed-off-by: Basavaraj Natikar Signed-off-by: Sanjay R Mehta Signed-off-by: Mika Westerberg commit 7a1808f82a37d638ee6862175e8e5c5433fdd642 Author: Sanjay R Mehta Date: Fri Aug 6 11:59:06 2021 -0500 thunderbolt: Handle ring interrupt by reading interrupt status register As per USB4 specification by default "Disable ISR Auto-Clear" bit is set to zero and the Tx/Rx ring interrupt status needs to be cleared. Hence handle it by reading the interrupt status register (ISR) in the MSI-X handler. Signed-off-by: Basavaraj Natikar Signed-off-by: Sanjay R Mehta Signed-off-by: Mika Westerberg commit e390909ac763589558ffb91856f121820f933e4b Author: Sanjay R Mehta Date: Fri Aug 6 11:59:05 2021 -0500 thunderbolt: Add vendor specific NHI quirk for auto-clearing interrupt status Introduce nhi_check_quirks() routine to handle any vendor specific quirks to manage a hardware specific implementation. On Intel hardware the USB4 controller supports clearing the interrupt status register automatically right after it is being issued. For this reason add a new quirk that does that on all Intel hardware. Signed-off-by: Basavaraj Natikar Signed-off-by: Sanjay R Mehta Signed-off-by: Mika Westerberg commit d05aaa66ba3ca3fdc2b5cd774ff218deb238b352 Author: Zhengxun Li Date: Wed Aug 4 13:27:07 2021 +0800 spi: mxic: patch for octal DTR mode support Driver patch for octal DTR mode support. Owing to the spi_mem_default_supports_op() is not support dtr operation. Based on commit <539cf68cd51b> (spi: spi-mem: add spi_mem_dtr_supports_op()) add spi_mem_dtr_supports_op() to support dtr and keep checking the buswidth and command bytes. Signed-off-by: Zhengxun Li Link: https://lore.kernel.org/r/1628054827-458-1-git-send-email-zhengxunli@mxic.com.tw Signed-off-by: Mark Brown commit 26c863418221344b1cfb8e6c11116b2b81144281 Author: Dmitry Osipenko Date: Sat Jul 31 22:27:31 2021 +0300 spi: tegra20-slink: Don't use resource-managed spi_register helper Don't use resource-managed spi_register helper to correct the driver removal order and make it to match the error unwinding order of the probe function. Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20210731192731.5869-2-digetx@gmail.com Signed-off-by: Mark Brown commit e4bb903fda0e9bbafa1338dcd2ee5e4d3ccc50da Author: Dmitry Osipenko Date: Sat Jul 31 22:27:30 2021 +0300 spi: tegra20-slink: Improve runtime PM usage The Tegra SPI driver supports runtime PM, which controls the clock enable state, but the clk is also enabled separately from the RPM at the driver probe time, and thus, stays always on. Fix it. Runtime PM now is always available on Tegra, hence there is no need to check the RPM presence in the driver anymore. Remove these checks. Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20210731192731.5869-1-digetx@gmail.com Signed-off-by: Mark Brown commit 27fdd3bbb7a13830c05b6bf777e45c392cb00f63 Author: Alistair Francis Date: Fri Aug 6 19:10:51 2021 +1000 regulator: sy7636a: Use the regmap directly Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20210806091058.141-6-alistair@alistair23.me Signed-off-by: Mark Brown commit 1e2c7845421b785282c098712a81556a2b8917a5 Author: Vincent Knecht Date: Fri Aug 6 13:41:16 2021 +0200 ASoC: qcom: apq8016_sbc: Add SEC_MI2S support This patch adds external codec support on secondary mi2s. It is used for headphones on some devices, eg. alcatel-idol347. Signed-off-by: Vincent Knecht Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806114116.895473-1-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 2189e928b62e91d8efbc9826ae7c0968f0d55790 Author: Geert Uytterhoeven Date: Sun Jul 25 12:44:13 2021 +0200 m68k: Fix invalid RMW_INSNS on CPUs that lack CAS When enabling CONFIG_RMW_INSNS in e.g. a Coldfire build: {standard input}:3068: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d4,%d0,(%a6)' ignored Fix this by (a) adding a new config symbol to track if support for any CPU that lacks the CAS instruction is enabled, and (b) making CONFIG_RMW_INSNS depend on the new symbol not being set. Fixes: 0e152d80507b75c0 ("m68k: reorganize Kconfig options to improve mmu/non-mmu selections") Reported-by: kernel test robot Reported-by: Arnd Bergmann Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210725104413.318932-1-geert@linux-m68k.org commit 07aa6c73e7c670c1917e3b2447e8f1b4c236315e Author: Geert Uytterhoeven Date: Mon Jul 12 14:04:56 2021 +0200 m68k: defconfig: Update defconfigs for v5.14-rc1 - Enable modular build of the new Netfilter base hook dump support, - Drop CONFIG_SCSI=y (selected by ATA, as enabled since commit b90257bfddbd01f3 ("m68k: use libata instead of the legacy ide driver")), - Disable CIFS_STATS2 (defaults to enabled since commit 0d52df81e07739db ("cifs: enable extended stats by default")), - Enable modular build of the glob self-test (visible since commit b90257bfddbd01f3 ("m68k: use libata instead of the legacy ide driver")), - Drop CONFIG_TEST_LIST_SORT=m (auto-enabled since commit ebd09577be6c15ee ("lib/test: convert lib/test_list_sort.c to use KUnit")), - Enable modular build of the new test for the scanf() family of functions. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210712120456.4119260-1-geert@linux-m68k.org commit c0397c85b53d0bc6b081ff22d0d07e8eae149bba Author: Cristian Marussi Date: Mon Aug 9 10:22:45 2021 +0100 firmware: arm_scmi: Use WARN_ON() to check configured transports Use a WARN_ON() when SCMI stack is loaded to check the consistency of configured SCMI transports instead of the current compile-time check BUILD_BUG_ON() to avoid breaking bot-builds on random bad configs. Bail-out early and noisy during SCMI stack initialization if no transport was enabled in configuration since SCMI cannot work without at least one enabled transport and such constraint cannot be enforced in Kconfig due to circular dependency issues. Link: https://lore.kernel.org/r/20210809092245.8730-1-cristian.marussi@arm.com Reported-by: kernel test robot Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 01c72cad790cb6cd3ccbe4c1402b6cb6c6bbffd0 Author: Krzysztof Kozlowski Date: Thu Aug 5 09:21:10 2021 +0200 arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7 The GIC-400 CPU interfaces address range is defined as 0x2000-0x3FFF (by ARM). Reported-by: Sam Protsenko Reported-by: Marc Zyngier Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Alim Akhtar Fixes: b9024cbc937d ("arm64: dts: Add initial device tree support for exynos7") Link: https://lore.kernel.org/r/20210805072110.4730-1-krzysztof.kozlowski@canonical.com commit 767f4b620edadac579c9b8b6660761d4285fa6f9 Author: Smita Koralahalli Date: Mon Jun 28 12:27:40 2021 -0500 EDAC/mce_amd: Do not load edac_mce_amd module on guests Hypervisors likely do not expose the SMCA feature to the guest and loading this module leads to false warnings. This module should not be loaded in guests to begin with, but people tend to do so, especially when testing kernels in VMs. And then they complain about those false warnings. Do the practical thing and do not load this module when running as a guest to avoid all that complaining. [ bp: Rewrite commit message. ] Suggested-by: Borislav Petkov Signed-off-by: Smita Koralahalli Signed-off-by: Borislav Petkov Reviewed-by: Yazen Ghannam Tested-by: Kim Phillips Link: https://lkml.kernel.org/r/20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com commit e08d6d42b6f9aaf627df2e0a4c8b1e27ce70fe87 Author: Joakim Zhang Date: Mon Aug 9 12:29:21 2021 +0800 net: fec: fix build error for ARCH m68k reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross make.cross ARCH=m68k m5272c3_defconfig make.cross ARCH=m68k drivers/net/ethernet/freescale/fec_main.c: In function 'fec_enet_eee_mode_set': >> drivers/net/ethernet/freescale/fec_main.c:2758:33: error: 'FEC_LPI_SLEEP' undeclared (first use in this function); did you mean 'FEC_ECR_SLEEP'? 2758 | writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); | ^~~~~~~~~~~~~ arch/m68k/include/asm/io_no.h:25:66: note: in definition of macro '__raw_writel' 25 | #define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b)) | ^~~~ drivers/net/ethernet/freescale/fec_main.c:2758:2: note: in expansion of macro 'writel' 2758 | writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); | ^~~~~~ drivers/net/ethernet/freescale/fec_main.c:2758:33: note: each undeclared identifier is reported only once for each function it appears in 2758 | writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); | ^~~~~~~~~~~~~ arch/m68k/include/asm/io_no.h:25:66: note: in definition of macro '__raw_writel' 25 | #define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b)) | ^~~~ drivers/net/ethernet/freescale/fec_main.c:2758:2: note: in expansion of macro 'writel' 2758 | writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); | ^~~~~~ >> drivers/net/ethernet/freescale/fec_main.c:2759:32: error: 'FEC_LPI_WAKE' undeclared (first use in this function) 2759 | writel(wake_cycle, fep->hwp + FEC_LPI_WAKE); | ^~~~~~~~~~~~ arch/m68k/include/asm/io_no.h:25:66: note: in definition of macro '__raw_writel' 25 | #define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b)) | ^~~~ drivers/net/ethernet/freescale/fec_main.c:2759:2: note: in expansion of macro 'writel' 2759 | writel(wake_cycle, fep->hwp + FEC_LPI_WAKE); | ^~~~~~ This patch adds register definition for M5272 platform to pass build. Fixes: b82f8c3f1409 ("net: fec: add eee mode tx lpi support") Reported-by: kernel test robot Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 67161779a9ea926fccee8de047ae66cbd3482b91 Author: Stefan Raspl Date: Mon Aug 9 10:10:14 2021 +0200 net/smc: Allow SMC-D 1MB DMB allocations Commit a3fe3d01bd0d7 ("net/smc: introduce sg-logic for RMBs") introduced a restriction for RMB allocations as used by SMC-R. However, SMC-D does not use scatter-gather lists to back its DMBs, yet it was limited by this restriction, still. This patch exempts SMC, but limits allocations to the maximum RMB/DMB size respectively. Signed-off-by: Stefan Raspl Signed-off-by: Guvenc Gulce Signed-off-by: David S. Miller commit 919d13a7e455c2e7676042d7a5f94c164e859d8a Author: Leon Romanovsky Date: Sun Aug 8 21:57:43 2021 +0300 devlink: Set device as early as possible All kernel devlink implementations call to devlink_alloc() during initialization routine for specific device which is used later as a parent device for devlink_register(). Such late device assignment causes to the situation which requires us to call to device_register() before setting other parameters, but that call opens devlink to the world and makes accessible for the netlink users. Any attempt to move devlink_register() to be the last call generates the following error due to access to the devlink->dev pointer. [ 8.758862] devlink_nl_param_fill+0x2e8/0xe50 [ 8.760305] devlink_param_notify+0x6d/0x180 [ 8.760435] __devlink_params_register+0x2f1/0x670 [ 8.760558] devlink_params_register+0x1e/0x20 The simple change of API to set devlink device in the devlink_alloc() instead of devlink_register() fixes all this above and ensures that prior to call to devlink_register() everything already set. Signed-off-by: Leon Romanovsky Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 94c0a6fbd5cfc34d3ce5fea5867123402cdc8794 Author: Wei Yongjun Date: Sun Aug 8 06:33:44 2021 +0000 wwan: mhi: Fix missing spin_lock_init() in mhi_mbim_probe() The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. Fixes: aa730a9905b7 ("net: wwan: Add MHI MBIM network driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 403fa18691b7370ad7508292769824ba298c184b Merge: 003352377f15f 8c39ed4876d4e Author: David S. Miller Date: Mon Aug 9 10:13:32 2021 +0100 Merge branch 'iucv-next' Karsten Graul says: ==================== net/iucv: updates 2021-08-09 Please apply the following iucv patches to netdev's net-next tree. Remove the usage of register asm statements and replace deprecated CPU-hotplug functions with the current version. Use use consume_skb() instead of kfree_skb() to avoid flooding dropwatch with false-positives, and 2 patches with cleanups. ==================== Signed-off-by: David S. Miller commit 8c39ed4876d4e541e2044f313c56b1eb20810fe1 Author: Sebastian Andrzej Siewior Date: Mon Aug 9 10:30:50 2021 +0200 net/iucv: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Julian Wiedmann Cc: Karsten Graul Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-s390@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 50348fac29211a54702b375e6e5717198a7d0cf6 Author: Heiko Carstens Date: Mon Aug 9 10:30:49 2021 +0200 net/iucv: get rid of register asm usage Using register asm statements has been proven to be very error prone, especially when using code instrumentation where gcc may add function calls, which clobbers register contents in an unexpected way. Therefore get rid of register asm statements in iucv code, even though there is currently nothing wrong with it. This way we know for sure that the above mentioned bug class won't be introduced here. Acked-by: Karsten Graul Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit ff8424be8ce326e046982768bd20a245714e05b6 Author: Julian Wiedmann Date: Mon Aug 9 10:30:48 2021 +0200 net/af_iucv: remove wrappers around iucv (de-)registration These wrappers are just unnecessary obfuscation. Signed-off-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 4eb9eda6ba64114d98827e2870e024d5ab7cd35b Author: Julian Wiedmann Date: Mon Aug 9 10:30:47 2021 +0200 net/af_iucv: clean up a try_then_request_module() Use IS_ENABLED(CONFIG_IUCV) to determine whether the iucv_if symbol is available, and let depmod deal with the module dependency. This was introduced back with commit 6fcd61f7bf5d ("af_iucv: use loadable iucv interface"). And to avoid sprinkling IS_ENABLED() over all the code, we're keeping the indirection through pr_iucv->...(). Signed-off-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 10d6393dc471de5b8be84a19a967e51058ac5d1e Author: Julian Wiedmann Date: Mon Aug 9 10:30:46 2021 +0200 net/af_iucv: support drop monitoring Change the good paths to use consume_skb() instead of kfree_skb(). This avoids flooding dropwatch with false-positives. Signed-off-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 003352377f15f0014c752a6b7edf8bd947eecc7f Merge: cfe908c116591 bee7c577e6d7b Author: David S. Miller Date: Mon Aug 9 09:57:53 2021 +0100 Merge branch 'dsa-fast-ageing' Vladimir Oltean says: ==================== DSA fast ageing fixes/improvements These are 2 small improvements brought to the DSA fast ageing changes merged earlier today. Patch 1 restores the behavior for DSA drivers that don't implement the .port_bridge_flags function (I don't think there is any breakage due to the new behavior, but just to be sure). This came as a result of Andrew's review. Patch 2 reduces the number of fast ages of a port from 2 to 1 when it leaves a bridge. ==================== Signed-off-by: David S. Miller commit bee7c577e6d7b51fa0d2b30747c2cd3499ef778e Author: Vladimir Oltean Date: Mon Aug 9 01:56:49 2021 +0300 net: dsa: avoid fast ageing twice when port leaves a bridge Drivers that support both the toggling of address learning and dynamic FDB flushing (mv88e6xxx, b53, sja1105) currently need to fast-age a port twice when it leaves a bridge: - once, when del_nbp() calls br_stp_disable_port() which puts the port in the BLOCKING state - twice, when dsa_port_switchdev_unsync_attrs() calls dsa_port_clear_brport_flags() which disables address learning The knee-jerk reaction might be to say "dsa_port_clear_brport_flags does not need to fast-age the port at all", but the thing is, we still need both code paths to flush the dynamic FDB entries in different situations. When a DSA switch port leaves a bonding/team interface that is (still) a bridge port, no del_nbp() will be called, so we rely on dsa_port_clear_brport_flags() function to restore proper standalone port functionality with address learning disabled. So the solution is just to avoid double the work when both code paths are called in series. Luckily, DSA already caches the STP port state, so we can skip flushing the dynamic FDB when we disable address learning and the STP state is one where no address learning takes place at all. Under that condition, not flushing the FDB is safe because there is supposed to not be any dynamic FDB entry at all (they were flushed during the transition towards that state, and none were learned in the meanwhile). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a4ffe09fc2d7138d28b225cc20893f506f2712cf Author: Vladimir Oltean Date: Mon Aug 9 01:56:48 2021 +0300 net: dsa: still fast-age ports joining a bridge if they can't configure learning Commit 39f32101543b ("net: dsa: don't fast age standalone ports") assumed that all standalone ports disable address learning, but if the switch driver implements .port_fast_age but not .port_bridge_flags (like ksz9477, ksz8795, lantiq_gswip, lan9303), then that might not actually be true. So whereas before, the bridge temporarily walking us through the BLOCKING STP state meant that the standalone ports had a checkpoint to flush their baggage and start fresh when they join a bridge, after that commit they no longer do. Restore the old behavior for these drivers by checking if the switch can toggle address learning. If it can't, disregard the "do_fast_age" argument and unconditionally perform fast ageing on STP state changes. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9050ad816f5205c0d069e3e492eb849265ae5167 Author: Linus Walleij Date: Mon Aug 2 01:33:14 2021 +0200 mfd: db8500-prcmu: Handle missing FW variant There was an "unknown" firmware variant turning up in the wild causing problems in the clock driver. Add this missing variant and clarify that varian 11 and 15 are Samsung variants, as this is now very well known from released products. Signed-off-by: Linus Walleij Acked-by: Stephen Boyd Signed-off-by: Lee Jones commit fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 Author: Florian Westphal Date: Tue Aug 3 16:47:19 2021 +0200 netfilter: x_tables: never register tables by default For historical reasons x_tables still register tables by default in the initial namespace. Only newly created net namespaces add the hook on demand. This means that the init_net always pays hook cost, even if no filtering rules are added (e.g. only used inside a single netns). Note that the hooks are added even when 'iptables -L' is called. This is because there is no way to tell 'iptables -A' and 'iptables -L' apart at kernel level. The only solution would be to register the table, but delay hook registration until the first rule gets added (or policy gets changed). That however means that counters are not hooked either, so 'iptables -L' would always show 0-counters even when traffic is flowing which might be unexpected. This keeps table and hook registration consistent with what is already done in non-init netns: first iptables(-save) invocation registers both table and hooks. This applies the same solution adopted for ebtables. All tables register a template that contains the l3 family, the name and a constructor function that is called when the initial table has to be added. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 0c4d7337392d1f69a2865f5242ff55865a2516ca Author: Thomas Perrot Date: Thu Aug 5 17:06:33 2021 +0200 ARM: dts: imx7: add ftm nodes for Flex Timers The i.MX7 has two possible Flex Timers, disabled by default. Moreover, the block is the same as LS1021a, then the drivers can be used as-is. Signed-off-by: Thomas Perrot Signed-off-by: Shawn Guo commit 4d9e9153f1c64d91a125c6967bc0bfb0bb653ea0 Author: Takashi Iwai Date: Mon Aug 9 09:18:29 2021 +0200 ALSA: pci: cs46xx: Fix set up buffer type properly CS46xx driver switches the buffer depending on the number of periods, and in some cases it switches to the own buffer without updating the buffer type properly. This may cause a problem with the mmap on exotic architectures that require the own mmap call for the coherent DMA buffer. This patch addresses the potential breakage by replacing the buffer setup with the proper macro. It also simplifies the source code, too. Link: https://lore.kernel.org/r/20210809071829.22238-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0899a7a23047f106c06888769d6cd6ff43d7395f Author: Takashi Iwai Date: Mon Aug 9 09:18:28 2021 +0200 ALSA: pci: rme: Set up buffer type properly Although the regression of the mmap was fixed in the recent commit dc0dc8a73e8e ("ALSA: pcm: Fix mmap breakage without explicit buffer setup"), RME9652 and HDSP drivers have still potential issues with their mmap handling. Namely, they use the default mmap handler without the standard buffer preallocation, and PCM core wouldn't use the coherent DMA mapping. It's practically OK on x86, but on some exotic architectures, it wouldn't work. This patch addresses the potential breakage by replacing the buffer setup with the proper macro. It also simplifies the source code, too. Link: https://lore.kernel.org/r/20210809071829.22238-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit cbea6e5a7772b7a5b80baa8f98fd77853487fd2a Author: Takashi Iwai Date: Mon Aug 9 09:18:27 2021 +0200 ALSA: pcm: Check mmap capability of runtime dma buffer at first Currently we check only the substream->dma_buffer as the preset of the buffer configuration for verifying the availability of mmap. But a few drivers rather set up the buffer in the own way without the standard buffer preallocation using substream->dma_buffer, and they miss the proper checks. (Now it's working more or less fine as most of them are running only on x86). Actually, they may set up the runtime dma_buffer (referred via snd_pcm_get_dma_buf()) at the open callback, though. That is, this could have been used as the primary source. This patch changes the hw_support_mmap() function to check the runtime dma buffer at first. It's usually NULL with the standard buffer preallocation, and in that case, we continue checking substream->dma_buffer as fallback. Link: https://lore.kernel.org/r/20210809071829.22238-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit a0c1748f365328f0b0ce104edf3f8a6fb5ab4f2c Author: Christoph Niedermaier Date: Mon Aug 2 16:10:38 2021 +0200 ARM: dts: imx6qdl-dhcom: Add DHSOM based DRC02 board Add DT for DH DRC02 unit, which is a universal controller device. The system has two ethernet ports, two CANs, RS485 and RS232, USB, capacitive buttons and an OLED display. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 317d26e92161c434a25d14584d35630894061b50 Author: Christoph Niedermaier Date: Mon Aug 2 16:10:37 2021 +0200 ARM: dts: imx6qdl-dhcom: Add DHCOM based PicoITX board Add DT for DH PicoITX unit, which is a bare-bones carrier board for the DHCOM. The board has ethernet port, USB, CAN, LEDs and a custom board-to-board expansion connector. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit fa0cae955627075a6434b6bf294d0e6d2fcf81ed Author: Christoph Niedermaier Date: Mon Aug 2 16:10:36 2021 +0200 ARM: dts: imx6qdl-dhcom: Split SoC-independent parts of DHCOM SOM and PDK2 The DH electronics PDK2 can be populated with SoM with i.MX6S/DL/D/Q variants. Split the SoC-independent parts of the SoM and PDK2 into the imx6qdl-dhcom-*.dtsi and reduce imx6q-dhcom-pdk2.dts to example of adding i.MX6S/DL/D/Q variants of the SoM into a PDK2 carrier board. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit fea4e8a9d5342d1a3150e9da728df6e3de23b201 Author: Christoph Niedermaier Date: Mon Aug 2 16:10:35 2021 +0200 ARM: dts: imx6q-dhcom: Cleanup of the devicetrees Following cleanups of the devicetrees done, no change in function: - Remove parentheses from the license - Update copyright date - Alphabetical sorting - Add comments - Update pinctrl names - Hex values in lower case - Set 3rd values of fixed regulators gpio property to 0 - Replace interrupt type with a define - Remove superfluous property max-speed from the fec node Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 1f58e94c5462b92d5974c638dce9c8611182d221 Author: Christoph Niedermaier Date: Mon Aug 2 16:10:34 2021 +0200 ARM: dts: imx6q-dhcom: Rearrange of iomux Move iomux to the end, no change in function. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 00342c631eecd55b324f3acfc41a5925e5ff3986 Author: Christoph Niedermaier Date: Mon Aug 2 16:10:33 2021 +0200 ARM: dts: imx6q-dhcom: Rework of the DHCOM GPIO pinctrls The function of each SoM pins is defined in the DHCOM standard [1] and subset of them is defined as GPIOs (pins A-W). To ensure the interchange- ability of the DHCOM SoMs, the function of the pins are fixed and cannot be changed. On board level the DHCOM GPIOs can be used associated with different blocks e.g. for interrupt or reset, but the function is always GPIO. If not used, they can be freely used in the user space. Therefore the whole configuration of SoM pins is made in the SoM DT. Defining the DHCOM GPIO pins as a separate pinctrl nodes makes moving a subset of them to an appropriate block pinctrl group easier on board level, since it is not necessary to have a large pinctrl hog group containing unrelated pinmux entries on board level. This also makes it easy to update the SoM DT without having to update all the board DTs too. If necessary it is also possible to change the electrical properties of the DHCOM GPIOs by overwriting the pinctrl on board level. [1] https://wiki.dh-electronics.com/images/2/2e/DOC_DHCOM-Standard-Specification_R01_2016-11-17.pdf Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 298591bf725afe066f487cf7d58eeddfdd2a0a33 Author: Christoph Niedermaier Date: Mon Aug 2 16:10:32 2021 +0200 ARM: dts: imx6q-dhcom: Use 1G ethernet on the PDK2 board The PDK2 board is capable of running both 100M and 1G ethernet. However, the i.MX6 has only one ethernet MAC, so it is possible to configure either 100M or 1G Ethernet. In case of 100M option, the PHY is on the SoM and the signals are routed to a RJ45 port. For 1G the PHY is on the PDK2 board with another RJ45 port. 100M and 1G ethernet use different signal pins from the i.MX6, but share the MDIO bus. This SoM board combination is used to demonstrate how to enable 1G ethernet configuration. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 2c86446f8e0428cd5c9bb37f9c6727bd4830967d Author: Takashi Iwai Date: Mon Aug 9 09:12:50 2021 +0200 ALSA: harmony: Drop superfluous address setup Harmony driver never uses CONTINUOUS buffer type any longer, hence the code setting the address is superfluous. Moreover, the recent change in the ALSA core already covered the missing address field; it's already set up. So let's drop the superfluous line, which includes the full hw_params callback. Link: https://lore.kernel.org/r/20210809071250.21846-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit bd935a7b21340e2e37f51a7f2d3188145e2fcf1f Merge: 96ba6c6e8922e 36a21d51725af Author: Greg Kroah-Hartman Date: Mon Aug 9 09:03:47 2021 +0200 Merge 5.14-rc5 into driver-core-next We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 96020566a5756d667252a42a26ddf1628dbb49d6 Merge: 282bd08229761 36a21d51725af Author: Greg Kroah-Hartman Date: Mon Aug 9 08:59:23 2021 +0200 Merge 5.14-rc5 into staging-next We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 813272ed5238b37c81e448b302048e8008570121 Merge: de0534df93474 36a21d51725af Author: Greg Kroah-Hartman Date: Mon Aug 9 08:57:03 2021 +0200 Merge 5.14-rc5 into char-misc-next We need the fixes in here as well, and resolves some merge issues with the mhi codebase. Signed-off-by: Greg Kroah-Hartman commit 15e580283f2654b3455970c404ae363197aa176d Merge: 1fe0e1fa3209a 36a21d51725af Author: Greg Kroah-Hartman Date: Mon Aug 9 08:52:46 2021 +0200 Merge 5.14-rc5 into tty-next We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 73e19de7b79a2f26f0b370cc071728cede1ab3a0 Merge: 548011957d1d7 36a21d51725af Author: Greg Kroah-Hartman Date: Mon Aug 9 08:12:09 2021 +0200 Merge 5.14-rc5 into usb-next We need the usb fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit ad797a04f1294b48b0e17c1e858b71ea1b1a77d9 Merge: 9732c148d0ced dc0dc8a73e8e4 Author: Takashi Iwai Date: Mon Aug 9 07:53:22 2021 +0200 Merge branch 'for-linus' into for-next commit d4fda7ec1d2a34ec50fc672896ba79d5ac8b7882 Author: kernel test robot Date: Sun Aug 8 01:31:27 2021 +0800 firmware: arm_scmi: Fix boolconv.cocci warnings drivers/firmware/arm_scmi/virtio.c:225:40-45: WARNING: conversion to bool not needed here Remove unneeded conversion to bool Semantic patch information: Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded. Generated by: scripts/coccinelle/misc/boolconv.cocci Link: https://lore.kernel.org/r/20210807173127.GA43248@a24dbc127934 CC: Igor Skalkin Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Sudeep Holla commit 9760383b22edbfa407a1647969c26d62a501631f Merge: 9fce3b3a0ab4c 36a21d51725af Author: Vinod Koul Date: Mon Aug 9 10:08:37 2021 +0530 Merge tag 'v5.14-rc5' into next Linux 5.14-rc5 commit f2841e3ab175da656e9124a9b032daf5a86c7ade Author: Linus Walleij Date: Thu Jul 29 16:34:57 2021 +0200 ARM: dts: ixp4xx: Add a devicetree for Freecom FSG-3 This adds a devicetree for the Freecom FSG-3, a combined router and NAS. Cc: Rod Whitby Cc: Marc Zyngier Signed-off-by: Linus Walleij commit 0ceddb06be67f4035ab4c2367fedbf79e83c8d26 Author: Linus Walleij Date: Thu Jul 29 10:15:56 2021 +0200 ARM: dts: ixp4xx: Add devicetree for Linksys WRV54G This adds a device tree for the Linksys WRV54G also known as Gemtek GTWX5715. Some enhancements have been folded in from the OpenWrt patches. This supports everything in the upstream kernel with placeholders for the out-of-tree multiphy which exist in OpenWrt. Cc: phj@phj.hu Signed-off-by: Linus Walleij commit e664f7720ab489b1708b25d3ec230659f1b95a36 Author: Linus Walleij Date: Wed Jul 28 17:04:17 2021 +0200 ARM: dts: ixp4xx: Add device trees for Coyote and IXDPG425 This adds device trees for the ADI Engineering Coyote and the Intel IXDPG425 reference design. The ethernet set-up on the IXDPG425 is a bit dubious because I think it uses a DSA switch chip, but this is a good as it gets right now. The Coyote boardfile claims an IDE port exist at 0xFFFE1000 but the implementation does not use this. If you have the board and can/want to test, please contact me. Cc: Deepak Saxena Cc: Vladimir Barinov Cc: Zoltan HERPAI Signed-off-by: Linus Walleij commit ec0384026cd93cb647b0f0ebd042240b9c418300 Author: Linus Walleij Date: Wed Jul 28 00:11:59 2021 +0200 ARM: dts: ixp4xx: Add Intel IXDP425 etc reference designs The IXDP425, IXCDP1100, KIXRP435 and IXDP465 are similar Intel reference designs for IXP42x, IXP43x and IXP4[56]x. This adds device trees for these so the board files can be migrated. Cc: Deepak Saxena Cc: Vladimir Barinov Signed-off-by: Linus Walleij commit 16d8d49b567bcb52621a7b4b25ea66d9cd71d425 Author: Linus Walleij Date: Mon Jul 26 10:27:49 2021 +0200 ARM: dts: ixp4xx: Add CF to GW2358 This adds support for the compact flash card slot on the Gateworks GW2358 router. Signed-off-by: Linus Walleij commit ae751e6325c0e95bfd8b1b41ada3789e047c4950 Author: Linus Walleij Date: Tue Jul 27 10:05:54 2021 +0200 ARM: dts: ixp4xx: Add Gateworks Avila GW2348 device tree This adds a device tree file for the Gateworks Avila GW2348 platform supporting all the features of the in-kernel boardfiles. There are more boards in the Avila family, but this is the one that is supported out-of-the-box by the current boardfiles. Some extra features have been folded in from the upstream OpenWrt sources, such as proper ethernet setup for both ethernet ports. More variants can be added based on this device tree. Some of those have DSA switches, multiple LEDs, multiple serial ports and similar and would need some more elaborate work. Cc: Michael-Luke Jones Cc: Deepak Saxena Cc: Tom Billman Signed-off-by: Linus Walleij commit 36eb2640d3bee36c7e2eb81fa7e8dc9ace45b9d6 Author: Linus Walleij Date: Sat Jul 17 01:00:21 2021 +0200 ARM: dts: ixp4xx: Add Arcom Vulcan device tree This adds a device tree for the Arcom Vulcan IXP42x board. Cc: Marc Zyngier Signed-off-by: Linus Walleij commit 6fb89c46d48706f6390249aef30cd109c2cf777e Author: Linus Walleij Date: Tue Jul 20 10:59:54 2021 +0200 ARM: dts: ixp4xx: Add devicetree for Netgear WG302v2 This adds a devicetree for the Netgear WG302v2 router. The DTS is mostly based on the upstream boardfile but I also added in the ethernet from OpenWrt to get a more complete system. Cc: Imre Kaloz Signed-off-by: Linus Walleij commit f2791ed73193f0f0a5b5fa41da1ee4dfefa64a68 Author: Linus Walleij Date: Fri Jul 16 01:58:54 2021 +0200 ARM: dts: ixp4xx: Use the expansion bus Replace the "simple-bus" simplification by the proper bus for IXP4xx memory or device expansion. Use chip-select addressing with two address cells on all the flashes mounted on the IXP4xx devices. This includes all flash chips. Change the unit-name from @50000000 to @c4000000 as the DTS validation screams. The registers for controlling the bus are at c4000000 but the actual memory windows and ranges are at 50000000. Well it is just syntax, we can live with it. Signed-off-by: Linus Walleij commit e647167967f84b95f64c9ff14dc161fbd645e5cc Author: Linus Walleij Date: Mon Jul 19 13:14:16 2021 +0200 ARM: dts: ixp4xx: Add second UART The IXP4xx has two UARTs and some platforms make use of the second one so add this to the include DTSI. Signed-off-by: Linus Walleij commit 94e8b34be2c0f43da8bc3406bcbf6e459d38b338 Author: Linus Walleij Date: Wed Jul 14 16:15:36 2021 +0200 ARM: dts: ixp4xx: Add devicetree for D-Link DSM-G600 rev A This adds a devicetree for the D-Link DSM-G600 Wireless Network Storage Enclosure so that we can delete the boardfile. The boardfile does not even define an ethernet interface as it has an external ethernet on PCI. This devicetree is for revision A using IXP420 the rev B version uses PowerPC. Cc: Michael-Luke Jones Cc: Rod Whitby Cc: Alessandro Zummo Cc: Michael Westerhof Cc: Deepak Saxena Signed-off-by: Linus Walleij commit 5a68c91d1c273587cc63de2e1e9e3e0096425c0f Author: Linus Walleij Date: Wed Jul 14 13:37:59 2021 +0200 ARM: dts: ixp4xx: Move EPBX100 flash to external bus node This moves the EPBX100 flash under the external bus on CS0 like on the other IXP4xx systems. Cc: Corentin Labbe Signed-off-by: Linus Walleij commit 5900dc0850ff28dae9f8a6723eb9d3273eaa852d Author: Linus Walleij Date: Wed Jun 16 00:53:38 2021 +0200 ARM: dts: ixp4xx: Add devicetree for Iomega NAS 100D This creates a more or less fully featured device tree for the IXP42x-based Iomega NAS 100D. We can't read out the raw flash contents for ethernet MAC, and we cannot handle a power-off-button inside the kernel like the boardfile does. These two things are normally done in userspace. This conversion is part of moving all of the IXP4xx board files over to device tree to modernize the IXP4xx kernel. Cc: Rod Whitby Cc: Alessandro Zummo Signed-off-by: Linus Walleij commit f775d2150cb48bece63270fdefc2a0c69cf17f0f Author: Linus Walleij Date: Wed Jul 28 10:39:34 2021 +0200 ARM: dts: ixp4xx: Fix up bad interrupt flags The PCI hosts had bad IRQ semantics, these are all active low. Use the proper define and fix all in-tree users. Suggested-by: Marc Zyngier Signed-off-by: Linus Walleij commit 6ebfd22c969044bda7b5c3f0a20a958c7ff656b9 Author: Lee Jones Date: Wed Jun 2 15:32:51 2021 +0100 drm/xlnx/zynqmp_disp: Fix incorrectly named enum 'zynqmp_disp_layer_id' Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/xlnx/zynqmp_disp.c:101: warning: expecting prototype for enum zynqmp_disp_id. Prototype was for enum zynqmp_disp_layer_id instead Signed-off-by: Lee Jones Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 8c772f0b2b8e94bfd68f9bf19d7aba293332e4bf Author: Laurent Pinchart Date: Sun Mar 7 02:56:58 2021 +0200 drm: xlnx: zynqmp_dpsub: Expose plane ordering to userspace While the DPSUB has a fixed plane order, it still makes sense to expose it to userspace to avoid hardcoding assumptions. Do so by adding an immutable zpos property to planes. Signed-off-by: Laurent Pinchart commit 650f12042b85322e1459b7e49d50ae09c60e28d3 Author: Laurent Pinchart Date: Sun Mar 7 02:56:58 2021 +0200 drm: xlnx: zynqmp_dpsub: Add global alpha support The graphics plane has a global alpha setting. Expose it through the plane's alpha property. Signed-off-by: Laurent Pinchart commit e06926ecc3d04944ffc44069368d9fddf528413f Author: Laurent Pinchart Date: Sun Mar 7 02:56:58 2021 +0200 drm: xlnx: zynqmp_dpsub: Fix graphics layer blending To display the graphics layer, the global alpha needs to be enabled. Enable it when the graphics plane is enabled (with full opacity), and disable it otherwise. Signed-off-by: Laurent Pinchart commit b7f4753d7b71a87f0769a07da8c4beebc6903a2f Author: Laurent Pinchart Date: Sun Mar 7 02:56:58 2021 +0200 drm: xlnx: zynqmp_dpsub: Pass disp structure to all internal functions The internal functions dealing with the audio/video buffer manager, the blender, and the audio mixer, all receive pointers to the respective objects. Those objects are embedded in the zynqmp_disp structure, and a very small. Treating them as separate objects would require expanding them with back-pointers to the zynqmp_disp in order to access fields such as the device pointer for debug messages, and this isn't worth it. Instead, merge those structures with the zynqmp_disp structure, and pass the zynqmp_disp pointer to all internal functions. Signed-off-by: Laurent Pinchart commit 1e42874b0df79a65fe9a2f4c2d3a71d5b64bcfb6 Author: Quanyang Wang Date: Tue May 18 17:50:18 2021 +0800 drm: xlnx: zynqmp: Add zynqmp_disp_layer_is_video() to simplify the code Add a new function zynqmp_disp_layer_is_video() to simplify the code that judges if a layer is the video layer. Acked-by: Paul Cercueil Signed-off-by: Quanyang Wang Reviewed-by: Laurent Pinchart [Renamed is_layer_vid() to zynqmp_disp_layer_is_video()]] Signed-off-by: Laurent Pinchart commit a338619bd76011035d462f0f9e8b2f24d7fe5a1e Author: Quanyang Wang Date: Tue Mar 23 10:55:01 2021 +0800 drm: xlnx: zynqmp: release reset to DP controller before accessing DP registers When insmod zynqmp-dpsub.ko after rmmod it, system will hang with the error log as below: root@xilinx-zynqmp:~# insmod zynqmp-dpsub.ko [ 88.391289] [drm] Initialized zynqmp-dpsub 1.0.0 20130509 for fd4a0000.display on minor 0 [ 88.529906] Console: switching to colour frame buffer device 128x48 [ 88.549402] zynqmp-dpsub fd4a0000.display: [drm] fb0: zynqmp-dpsubdrm frame buffer device [ 88.571624] zynqmp-dpsub fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed root@xilinx-zynqmp:~# rmmod zynqmp_dpsub [ 94.023404] Console: switching to colour dummy device 80x25 root@xilinx-zynqmp:~# insmod zynqmp-dpsub.ko This is because that in zynqmp_dp_probe it tries to access some DP registers while the DP controller is still in the reset state. When running "rmmod zynqmp_dpsub", zynqmp_dp_reset(dp, true) in zynqmp_dp_phy_exit is called to force the DP controller into the reset state. Then insmod will call zynqmp_dp_probe to program the DP registers, but at this moment the DP controller hasn't been brought out of the reset state yet since the function zynqmp_dp_reset(dp, false) is called later and this will result the system hang. Releasing the reset to DP controller before any read/write operation to it will fix this issue. And for symmetry, move zynqmp_dp_reset() call from zynqmp_dp_phy_exit() to zynqmp_dp_remove(). Signed-off-by: Quanyang Wang Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 97271c7ee1cfb2c3fcc951e4031ffabb7c33f5b1 Author: Dylan Yip Date: Thu Feb 18 12:31:22 2021 -0800 drm: xlnx: zynqmp_dpsub: Update dependencies for ZynqMP DP ZynqMP DP requires the ZynqMP PHY and DPDMA to operate properly. So depend on both the PHY and DPDMA. Signed-off-by: Dylan Yip Signed-off-by: Laurent Pinchart commit a19effb6dbe5bd1be77a6d68eba04dba8993ffeb Author: Quanyang Wang Date: Wed Mar 10 12:59:45 2021 +0800 drm: xlnx: zynqmp_dpsub: Call pm_runtime_get_sync before setting pixel clock The Runtime PM subsystem will force the device "fd4a0000.zynqmp-display" to enter suspend state while booting if the following conditions are met: - the usage counter is zero (pm_runtime_get_sync hasn't been called yet) - no 'active' children (no zynqmp-dp-snd-xx node under dpsub node) - no other device in the same power domain (dpdma node has no "power-domains = <&zynqmp_firmware PD_DP>" property) So there is a scenario as below: 1) DP device enters suspend state <- call zynqmp_gpd_power_off 2) zynqmp_disp_crtc_setup_clock <- configurate register VPLL_FRAC_CFG 3) pm_runtime_get_sync <- call zynqmp_gpd_power_on and clear previous VPLL_FRAC_CFG configuration 4) clk_prepare_enable(disp->pclk) <- enable failed since VPLL_FRAC_CFG configuration is corrupted From above, we can see that pm_runtime_get_sync may clear register VPLL_FRAC_CFG configuration and result the failure of clk enabling. Putting pm_runtime_get_sync at the very beginning of the function zynqmp_disp_crtc_atomic_enable can resolve this issue. Signed-off-by: Quanyang Wang Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit e71ec0bc06038cdfa18cbd23f5cea71fe4785d35 Author: Daniel Thompson Date: Fri Jul 30 10:58:56 2021 +0100 scripts: coccinelle: allow list_entry_is_head() to use pos Currently use_after_iter.cocci generates false positives for code of the following form: ~~~ list_for_each_entry(d, &ddata->irq_list, node) { if (irq == d->irq) break; } if (list_entry_is_head(d, &ddata->irq_list, node)) return IRQ_NONE; ~~~ [This specific example comes from drivers/power/supply/cpcap-battery.c] Most list macros use list_entry_is_head() as loop exit condition meaning it is not unsafe to reuse pos (a.k.a. d) in the code above. Let's avoid reporting these cases. Signed-off-by: Daniel Thompson Signed-off-by: Julia Lawall commit cfe908c11659180e336a36f6f5a1c6591cfd3fc5 Merge: 64ec13ec92d5b 5126ec72a094b Author: David S. Miller Date: Sun Aug 8 20:56:52 2021 +0100 Merge branch 'sja1105-fast-ageing' Vladimir Oltean says: ==================== Fast ageing support for SJA1105 DSA driver While adding support for flushing dynamically learned FDB entries in the sja1105 driver, I noticed a few things that could be improved in DSA. Most notably, drivers could omit a fast age when address learning is turned off, which might mean that ports leaving a bridge and becoming standalone could still have FDB entries pointing towards them. Secondly, when DSA fast ages a port after the 'learning' flag has been turned off, the software bridge still has the dynamically learned 'master' FDB entries installed, and those should be deleted too. ==================== Signed-off-by: David S. Miller commit 5126ec72a094bd3a721941323c48cc80c60139d9 Author: Vladimir Oltean Date: Sun Aug 8 17:35:27 2021 +0300 net: dsa: sja1105: add FDB fast ageing support Delete the dynamically learned FDB entries when the STP state changes and when address learning is disabled. On sja1105 there is no shorthand SPI command for this, so we need to walk through the entire FDB to delete. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5313a37b881e57767bc37185bef2873862be8d47 Author: Vladimir Oltean Date: Sun Aug 8 17:35:26 2021 +0300 net: dsa: sja1105: rely on DSA core tracking of port learning state Now that DSA keeps track of the port learning state, it becomes superfluous to keep an additional variable with this information in the sja1105 driver. Remove it. The DSA core's learning state is present in struct dsa_port *dp. To avoid the antipattern where we iterate through a DSA switch's ports and then call dsa_to_port to obtain the "dp" reference (which is bad because dsa_to_port iterates through the DSA switch tree once again), just iterate through the dst->ports and operate on those directly. The sja1105 had an extra use of priv->learn_ena on non-user ports. DSA does not touch the learning state of those ports - drivers are free to do what they wish on them. Mark that information with a comment in struct dsa_port and let sja1105 set dp->learning for cascade ports. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9264e4ad26112a496398159d200af017e37d97e3 Author: Vladimir Oltean Date: Sun Aug 8 17:35:25 2021 +0300 net: dsa: flush the dynamic FDB of the software bridge when fast ageing a port Currently, when DSA performs fast ageing on a port, 'bridge fdb' shows us that the 'self' entries (corresponding to the hardware bridge, as printed by dsa_slave_fdb_dump) are deleted, but the 'master' entries (corresponding to the software bridge) aren't. Indeed, searching through the bridge driver, neither the brport_attr_learning handler nor the IFLA_BRPORT_LEARNING handler call br_fdb_delete_by_port. However, br_stp_disable_port does, which is one of the paths which DSA uses to trigger a fast ageing process anyway. There is, however, one other very promising caller of br_fdb_delete_by_port, and that is the bridge driver's handler of the SWITCHDEV_FDB_FLUSH_TO_BRIDGE atomic notifier. Currently the s390/qeth HiperSockets card driver is the only user of this. I can't say I understand that driver's architecture or interaction with the bridge, but it appears to not be a switchdev driver in the traditional sense of the word. Nonetheless, the mechanism it provides is a useful way for DSA to express the fact that it performs fast ageing too, in a way that does not change the existing behavior for other drivers. Cc: Alexandra Winter Cc: Julian Wiedmann Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 4eab90d9737b348094a99ba4e4c473e91a8b8038 Author: Vladimir Oltean Date: Sun Aug 8 17:35:24 2021 +0300 net: dsa: don't fast age bridge ports with learning turned off On topology changes, stations that were dynamically learned on ports that are no longer part of the active topology must be flushed - this is described by clause "17.11 Updating learned station location information" of IEEE 802.1D-2004. However, when address learning on the bridge port is turned off in the first place, there is nothing to flush, so skip a potentially expensive operation. We can finally do this now since DSA is aware of the learning state of its bridged ports. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 045c45d1f598c65806f885b59f6fbc4cebb62b15 Author: Vladimir Oltean Date: Sun Aug 8 17:35:23 2021 +0300 net: dsa: centralize fast ageing when address learning is turned off Currently DSA leaves it down to device drivers to fast age the FDB on a port when address learning is disabled on it. There are 2 reasons for doing that in the first place: - when address learning is disabled by user space, through IFLA_BRPORT_LEARNING or the brport_attr_learning sysfs, what user space typically wants to achieve is to operate in a mode with no dynamic FDB entry on that port. But if the port is already up, some addresses might have been already learned on it, and it seems silly to wait for 5 minutes for them to expire until something useful can be done. - when a port leaves a bridge and becomes standalone, DSA turns off address learning on it. This also has the nice side effect of flushing the dynamically learned bridge FDB entries on it, which is a good idea because standalone ports should not have bridge FDB entries on them. We let drivers manage fast ageing under this condition because if DSA were to do it, it would need to track each port's learning state, and act upon the transition, which it currently doesn't. But there are 2 reasons why doing it is better after all: - drivers might get it wrong and not do it (see b53_port_set_learning) - we would like to flush the dynamic entries from the software bridge too, and letting drivers do that would be another pain point So track the port learning state and trigger a fast age process automatically within DSA. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2ca380ea0e6a31046b7c4048e3f61cfc2f6b2aa3 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:28 2021 +0200 drm/vkms: Use offset-adjusted shadow-plane mappings and output For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in vkms. Also provide use the offset-adjusted data address for the writeback job's output buffers. Output framebuffers with non-zero offsets now have their content written to the correct location. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-12-tzimmermann@suse.de commit 0c64f2f3c8d538024af62377e5a72fd66e556f6c Author: Thomas Zimmermann Date: Tue Aug 3 14:59:27 2021 +0200 drm/vbox: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in vbox. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-11-tzimmermann@suse.de commit e5cf6fd4d7006d3ad201c7ab4cd3bc275d39570c Author: Thomas Zimmermann Date: Tue Aug 3 14:59:26 2021 +0200 drm/udl: Use offset-adjusted shadow-plane mapping For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in udl. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-10-tzimmermann@suse.de commit 8b9b88b94b96dbd9aad888ac2c730a9e3ffa4ec3 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:25 2021 +0200 drm/simpledrm: Use offset-adjusted shadow-plane mapping For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in simpledrm. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-9-tzimmermann@suse.de commit 229d94680878c83b5bb163e47f74ef778133a14e Author: Thomas Zimmermann Date: Tue Aug 3 14:59:24 2021 +0200 drm/gm12u320: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in gm12u320. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-8-tzimmermann@suse.de commit 12f84ab2ff568768699f73b0b32feebc25d38406 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:23 2021 +0200 drm/cirrus: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in cirrus. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-7-tzimmermann@suse.de commit af022daf08a41a68e787cca2f66bce39945e7558 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:22 2021 +0200 drm/mgag200: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in mgag200. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-6-tzimmermann@suse.de commit 70594e8bed7f1fc53c52ee639ce60c4ba4dd2ecc Author: Thomas Zimmermann Date: Tue Aug 3 14:59:21 2021 +0200 drm/hyperv: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in hyperv. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-5-tzimmermann@suse.de commit 6d463aaf5632ed9e409fcc72eb90f862341e4d95 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:20 2021 +0200 drm/gud: Get offset-adjusted mapping from drm_gem_fb_vmap() Pass the data parameter to drm_gem_fb_vmap() to retrieve pointers to the data. This address is different from the mapping addresses for framebuffers with non-zero offsets. Replaces gud's internal computation. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-4-tzimmermann@suse.de commit add8b6a9a568b57b3f61d59cc09b3157a275257e Author: Thomas Zimmermann Date: Tue Aug 3 14:59:19 2021 +0200 drm/ast: Use offset-adjusted shadow-plane mappings For framebuffers with non-zero offset fields, shadow-plane helpers provide a pointer to the first byte of the contained data. Use it in ast. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-3-tzimmermann@suse.de commit 43b36232ded23ce943224df3d1451f981446ae23 Author: Thomas Zimmermann Date: Tue Aug 3 14:59:18 2021 +0200 drm/gem: Provide offset-adjusted framebuffer BO mappings Add an additional argument to drm_gem_fb_vmap() to return each BO's mapping adjusted by the respective offset. Update all callers. The newly returned values point to the first byite of the data stored in the framebuffer BOs. Drivers that access the BO data should use it. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-2-tzimmermann@suse.de commit 79a0bffb835a094e523c448295d27ccbe6ac6a9b Author: Sven Eckelmann Date: Sun Aug 8 19:11:08 2021 +0200 batman-adv: Drop NULL check before dropping references The check if a batman-adv related object is NULL or not is now directly in the batadv_*_put functions. It is not needed anymore to perform this check outside these function: The changes were generated using a coccinelle semantic patch: @@ expression E; @@ - if (likely(E != NULL)) ( batadv_backbone_gw_put | batadv_claim_put | batadv_dat_entry_put | batadv_gw_node_put | batadv_hardif_neigh_put | batadv_hardif_put | batadv_nc_node_put | batadv_nc_path_put | batadv_neigh_ifinfo_put | batadv_neigh_node_put | batadv_orig_ifinfo_put | batadv_orig_node_put | batadv_orig_node_vlan_put | batadv_softif_vlan_put | batadv_tp_vars_put | batadv_tt_global_entry_put | batadv_tt_local_entry_put | batadv_tt_orig_list_entry_put | batadv_tt_req_node_put | batadv_tvlv_container_put | batadv_tvlv_handler_put )(E); Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 6340dcbd619450c1bb55eb999e554e4f0e6dab0a Author: Sven Eckelmann Date: Sun Aug 8 19:56:17 2021 +0200 batman-adv: Check ptr for NULL before reducing its refcnt The commit b37a46683739 ("netdevice: add the case if dev is NULL") changed the way how the NULL check for net_devices have to be handled when trying to reduce its reference counter. Before this commit, it was the responsibility of the caller to check whether the object is NULL or not. But it was changed to behave more like kfree. Now the callee has to handle the NULL-case. The batman-adv code was scanned via cocinelle for similar places. These were changed to use the paradigm @@ identifier E, T, R, C; identifier put; @@ void put(struct T *E) { + if (!E) + return; kref_put(&E->C, R); } Functions which were used in other sources files were moved to the header to allow the compiler to inline the NULL check and the kref_put call. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 0a6dab7d07d25c6d1e6dff0c31bac11ef1803f8a Author: Thomas Zimmermann Date: Wed Jul 14 16:22:40 2021 +0200 drm/mgag200: Compute PLL values during atomic check PLL setup can fail if the display mode's clock is not supported by any PLL configuration. Compute the PLL values during atomic check, so that atomic commits can fail at the appropriate time. If successful, use the values in the atomic-update phase. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-14-tzimmermann@suse.de commit 51b569394b47018132edde01b50e77a4e5f3919d Author: Thomas Zimmermann Date: Wed Jul 14 16:22:39 2021 +0200 drm/mgag200: Introduce custom CRTC state Inherit from struct drm_crtc_state by embeding it and providing the rsp callbacks for simple-kms helpers. No functional changes. The new state struct mgag200_crtc_state will hold PLL values for modeset operations. v2: * move the simple-kms changes into a separate patch (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-13-tzimmermann@suse.de commit 38c5af44a75ac1c76da8f8eec578670ff65471c0 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:38 2021 +0200 drm/simple-kms: Support custom CRTC state Simple KMS helpers already support custom state for planes. Extend the helpers to support custom CRTC state as well. Drivers can set the reset, duplicate and destroy callbacks for the display pipeline's CRTC state and inherit from struct drm_crtc_state by embedding an instance. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-12-tzimmermann@suse.de commit 2545ac960364d0395802a27374b46f13827b4cf5 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:37 2021 +0200 drm/mgag200: Abstract pixel PLL via struct mgag200_pll Move all PLL compute and update functions into mgag200_pll.c. No functional changes to the rsp algorithms. Introduce struct mgag200_pll and mgag200_pll_funcs. The data strutures abstract the details of each revision's PLL. Perform calls to compute and update functionality via function pointers. Init the PLL once as part of the driver initialization. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-11-tzimmermann@suse.de commit 8fb60d1bcd90d995af7e7a497795b8d77ad44721 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:36 2021 +0200 drm/mgag200: Declare PLL clock constants static const Move the PLL constants to the RO data section by declaring them as static const. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-10-tzimmermann@suse.de commit ac643ccd3023e967cad895f7eb7ff4a02135020a Author: Thomas Zimmermann Date: Wed Jul 14 16:22:35 2021 +0200 drm/mgag200: Split PLL compute function for G200SE by rev The compute function for G200SE pixel PLLs handles two revisions with different algorithms. Split it accordingly to make it readable. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-9-tzimmermann@suse.de commit 35b36ff4495a4b6f872f304cb97d47b13197874b Author: Thomas Zimmermann Date: Wed Jul 14 16:22:34 2021 +0200 drm/mgag200: Split PLL compute functions by device type Several PLL functions compute values for different device types. Split them up to make the code more readable. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-8-tzimmermann@suse.de commit 2dd040946ecfa5434fb0084fb5b5c2ba55639ea1 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:33 2021 +0200 drm/mgag200: Store values (not bits) in struct mgag200_pll_values The fields in struct mgag200_pll_values currently hold the bits of each register. Store the PLL values instead and let the PLL-update code figure out the bits for each register. Until now, the compute function either stored plain values or register bits in struct mgag200_pll_values. The rsp update function used the values as-is. This made it very hard to correctly interpret the stored values (e.g., for logging or debugging). With the cleanup, the stored values now have a clear meaning. v2: * add a bit more context in the commit message (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-7-tzimmermann@suse.de commit d9d992238a5aaf1a1e2ba013dd37dccf7b48c0a7 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:32 2021 +0200 drm/mgag200: Introduce separate variable for PLL S parameter The S parameter is controls the loop filter bandwidth when programming the PLL. It's currently stored as part of P (i.e., the clock divider.) Add a separate variable for S prepares the PLL code for further refactoring. The value of s is currently 0, so it has not yet an effect on the programming. v2: * add a note on the current value of s to commit message Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-6-tzimmermann@suse.de commit f86c3ed55920ca1d874758cc290890902a6cffc4 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:31 2021 +0200 drm/mgag200: Split PLL setup into compute and update functions The _set_plls() functions compute a pixel clock's PLL values and program the hardware accordingly. This happens during atomic commits. For atomic modesetting, it's better to separate computation and programming from each other. This will allow to compute the PLL value during atomic checks and catch unsupported modes early. Split the PLL setup into a compute and an update functions, and call them one after the other. Computed PLL values are store in struct mgag200_pll_values. There are four parameters for the PLL, m, n, p and s. Every compute function stores a value for each of these parameters, and the rsp update function makes the register bits from them. The values stored by the compute function are either plain values or register bits. An additional change is required to always store plain values. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-5-tzimmermann@suse.de commit 83c90cdb7525e9ebb7d0083e2c107601a7a86a39 Author: Thomas Zimmermann Date: Wed Jul 14 16:22:30 2021 +0200 drm/mgag200: Remove P_ARRAY_SIZE Replace P_ARRAY_SIZE by array pre-initializing and ARRAY_SIZE(). No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-4-tzimmermann@suse.de commit 08a709467c17e89c824a36cae76626527a4ccbbe Author: Thomas Zimmermann Date: Wed Jul 14 16:22:29 2021 +0200 drm/mgag200: Return errno codes from PLL compute functions Return -EINVAL if there's no PLL configuration for the given pixel clock. The returned errors are currently ignored by the caller, but the errno codes will become useful when the compute functions run during atomic checks. v2: * give a rational for this change (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-3-tzimmermann@suse.de commit 147696720eca12ae48d020726208b9a61cdd80bc Author: Thomas Zimmermann Date: Wed Jul 14 16:22:28 2021 +0200 drm/mgag200: Select clock in PLL update functions Put the clock-selection code into each of the PLL-update functions to make them select the correct pixel clock. Instead of copying the code, introduce a new helper WREG_MISC_MASKED, which does masked writes into . Use it from each individual PLL update function. The pixel clock for video output was not actually set before programming the clock's values. It worked because the device had the correct clock pre-set. v2: * don't duplicate update code (Sam) Signed-off-by: Thomas Zimmermann Fixes: db05f8d3dc87 ("drm/mgag200: Split MISC register update into PLL selection, SYNC and I/O") Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Emil Velikov Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: # v5.9+ Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-2-tzimmermann@suse.de commit 53972e43d4a702227caaadbf4e35f58e7bf4b470 Author: Simon Wunderlich Date: Sun Jun 13 17:05:39 2021 +0200 batman-adv: Start new development cycle This version will contain all the (major or even only minor) changes for Linux 5.15. 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 70eeb75d4c4d288411c4312435aad3c8597722b3 Author: Sven Eckelmann Date: Fri Jul 23 19:23:17 2021 +0200 batman-adv: Switch to kstrtox.h for kstrtou64 The commit 4c52729377ea ("kernel.h: split out kstrtox() and simple_strtox() to a separate header") moved the kstrtou64 function to a new header called linux/kstrtox.h. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 71d41c09f1fad1b3b4a26658655922944b56f6e7 Author: Sven Eckelmann Date: Sun Jun 13 16:37:47 2021 +0200 batman-adv: Move IRC channel to hackint.org Due to recent developments around the Freenode.org IRC network, the opinions about the usage of this service shifted dramatically. The majority of the still active users of the #batman channel prefers a move to the hackint.org network. Signed-off-by: Sven Eckelmann commit 52ae7c708d970e28848f206573a9f11a7826a980 Author: Stephan Gerhold Date: Mon Aug 2 17:56:57 2021 +0200 iio: accel: bmc150: Add support for BMC156 BMC156 is another accelerometer that works just fine with the bmc150-accel driver. It's very similar to BMC150 (also a accelerometer + magnetometer combo) but with only one accelerometer interrupt pin. It would make sense if only INT1 was exposed but someone at Bosch decided to only have an INT2 pin. Try to deal with this by making use of the INT2 support introduced in the previous commit and force using INT2 for BMC156. To detect that we need to bring up a simplified version of the previous type IDs. Note that unlike the type IDs removed in commit c06a6aba6835 ("iio: accel: bmc150: Drop misleading/duplicate chip identifiers") here I only add one for the special case of BMC156. Everything else still happens by reading the CHIP_ID register since the chip type information often is not accurate in ACPI tables. Tested-by: Nikita Travkin # BMC156 Reviewed-by: Linus Walleij Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210802155657.102766-5-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit 73d672e63f3062e987f9c92abdeb332e280f47db Author: Stephan Gerhold Date: Mon Aug 2 17:56:56 2021 +0200 iio: accel: bmc150: Make it possible to configure INT2 instead of INT1 Some Bosch accelerometers have two interrupt pins (INT1 and INT2). At the moment, the driver uses only the first one, which is fine for most situations. However, some boards might only have INT2 connected for some reason. Add the necessary bits and configuration to set up INT2. Then try to detect this situation at least for device tree setups by checking if the first interrupt (the one picked by the I2C/SPI core) is actually named "INT2" using the interrupt-names property. of_irq_get_byname() returns either 0 or some error code in case the driver probed without device tree, so in all other cases we fall back to configuring INT1 as before. Signed-off-by: Stephan Gerhold Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210802155657.102766-4-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit 02104141f3fa08c0b8d3924e0db4744212ed5b9a Author: Stephan Gerhold Date: Mon Aug 2 17:56:55 2021 +0200 dt-bindings: iio: accel: bma255: Add bosch,bmc156_accel BMC156 is very smilar to BMC150, but it has only one accelerometer interrupt pin. It would make sense if only INT1 was exposed but someone at Bosch decided to only have an INT2 pin. In this case, it does not make sense if the first interrupt pin is treated as INT1 (since that pin does not exist). Add a note to the bindings that the first interrupt pin is treated as INT2 for BMC156. Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210802155657.102766-3-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit 84c31a0466c12110af72d56c1dcc40759e848c55 Author: Stephan Gerhold Date: Mon Aug 2 17:56:54 2021 +0200 dt-bindings: iio: accel: bma255: Add interrupt-names The binding already allows specifying both interrupt pins, but there is currently no way to describe a board where (for whatever reason) only INT2 is connected. Make it possible to use "interrupt-names" to make it explicit which interrupt pin is meant in the interrupts. Reviewed-by: Linus Walleij Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210802155657.102766-2-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit ee8ea7472ff7e56d015fcaf0924c043688ca29e8 Author: Siddharth Manthan Date: Wed Jul 28 16:30:48 2021 +0530 iio: light: cm3323: Add of_device_id table Add an of_device_id table to explicitly support the Capella cm3323 Ambient Light Sensor rather than relying on matching against the i2c_device_id table. Signed-off-by: Siddharth Manthan Link: https://lore.kernel.org/r/20210728110048.14593-2-siddharth.manthan@gmail.com Signed-off-by: Jonathan Cameron commit a5dfc572eeee7bbba6749814ce39e9fda139c531 Author: Siddharth Manthan Date: Wed Jul 28 16:30:47 2021 +0530 dt-bindings: Add bindings for Capella cm3323 Ambient Light Sensor Update trivial-devices.yaml with Capella cm3323 Ambient Light Sensor description. Signed-off-by: Siddharth Manthan Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210728110048.14593-1-siddharth.manthan@gmail.com Signed-off-by: Jonathan Cameron commit 1081b9d97152e6aa28a1868ec8e0587b2b8fb2ae Author: Andreas Klinger Date: Wed Aug 4 17:46:42 2021 +0200 iio: chemical: Add driver support for sgp40 sgp40 is a gas sensor used for measuring the air quality. This driver is reading the raw resistance value which can be passed to an userspace algorithm for further calculation. The raw value is also used to calculate an estimated absolute voc index in the range from 0 to 500. For this purpose the raw_mean value of the resistance for which the index value is 250 might be set up as a calibration step. This can be done with in_resistance_calibbias. Compensation of relative humidity and temperature is supported and can be used by writing to output values of out_humidityrelative_raw and out_temp_raw. There is a predecesor sensor type (sgp30) already existing. This driver module was not extended because the new sensor is quite different in its i2c telegrams. Signed-off-by: Andreas Klinger Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210804154641.GA3237@arbad Signed-off-by: Jonathan Cameron commit 3722c105ecd1129bba593a9599b8c513c0129536 Author: Andreas Klinger Date: Wed Aug 4 17:45:50 2021 +0200 dt-bindings: iio: chemical: Add trivial DT binding for sgp40 Add devicetree binding for Sensirion sgp40 gas sensor to trivial devices. Acked-by: Rob Herring Signed-off-by: Andreas Klinger Link: https://lore.kernel.org/r/20210804154549.GA3223@arbad Signed-off-by: Jonathan Cameron commit 6c3ce4049b772858f3c86f3088e171a955cdbe95 Author: Alexander Sverdlin Date: Mon Jun 14 01:30:35 2021 +0200 iio: ep93xx: Prepare clock before using it Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared ep93xx-adc CPU: 0 PID: 1 Comm: swapper Not tainted 5.13.0-rc5-... #1 Hardware name: Cirrus Logic EDB9302 Evaluation Board [] (unwind_backtrace) from [] (show_stack+0x10/0x18) [] (show_stack) from [] (dump_stack+0x20/0x2c) [] (dump_stack) from [] (__warn+0x98/0xc0) [] (__warn) from [] (warn_slowpath_fmt+0x90/0xc0) [] (warn_slowpath_fmt) from [] (clk_core_enable+0x9c/0xbc) [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x30) [] (clk_core_enable_lock) from [] (ep93xx_adc_probe+0xe4/0x1a0) [] (ep93xx_adc_probe) from [] (platform_probe+0x34/0x80) [] (platform_probe) from [] (really_probe+0xe8/0x394) [] (really_probe) from [] (device_driver_attach+0x5c/0x64) [] (device_driver_attach) from [] (__driver_attach+0x7c/0xec) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xc4) [] (bus_for_each_dev) from [] (driver_attach+0x18/0x24) [] (driver_attach) from [] (bus_add_driver+0x140/0x1cc) [] (bus_add_driver) from [] (driver_register+0x74/0x114) [] (driver_register) from [] (__platform_driver_register+0x18/0x24) [] (__platform_driver_register) from [] (ep93xx_adc_driver_init+0x10/0x1c) [] (ep93xx_adc_driver_init) from [] (do_one_initcall+0x7c/0x1a4) [] (do_one_initcall) from [] (kernel_init_freeable+0x17c/0x1fc) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf8) [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) ... ep93xx-adc ep93xx-adc: Cannot enable clock ep93xx-adc: probe of ep93xx-adc failed with error -108 Signed-off-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20210613233041.128961-2-alexander.sverdlin@gmail.com Signed-off-by: Jonathan Cameron commit f27b1b2a04dda77454659e0b2572afe9620b55ec Author: Tang Bin Date: Mon Aug 2 20:09:29 2021 +0800 iio: adc: fsl-imx25-gcq: adjust irq check to match docs and simplify code For the function of platform_get_irq(), the example in platform.c is * int irq = platform_get_irq(pdev, 0); * if (irq < 0) * return irq; the return value of zero is unnecessary to check, so make the right check and simplify code. Note that platform_get_irq() is documented as never returning 0 so this is a minor optmization rather than a fix. Co-developed-by: Zhang Shengju Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210802120929.33760-1-tangbin@cmss.chinamobile.com Signed-off-by: Jonathan Cameron commit 64ec13ec92d5b28371cb620928588a324cc74f54 Author: Jun Miao Date: Sat Aug 7 23:41:40 2021 +0800 atm: horizon: Fix spelling mistakes in TX comment It's "must not", not "musn't", meaning "shall not". Let's fix that. Suggested-by: Joe Perches Signed-off-by: Jun Miao Signed-off-by: David S. Miller commit 82564f6c706a37e5f7dec962375581cc9f8fca5d Author: Leon Romanovsky Date: Sun Aug 8 14:41:21 2021 +0300 devlink: Simplify devlink port API calls Devlink port already has pointer to the devlink instance and all API calls that forward these devlink ports to the drivers perform same "devlink_port->devlink" assignment before actual call. This patch removes useless parameter and allows us in the future to create specific devlink_port_ops to manage user space access with reliable ops assignment. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 39f32101543be35c60dd984b44c620d565083d33 Author: Vladimir Oltean Date: Sun Aug 8 14:16:37 2021 +0300 net: dsa: don't fast age standalone ports DSA drives the procedure to flush dynamic FDB entries from a port based on the change of STP state: whenever we go from a state where address learning is enabled (LEARNING, FORWARDING) to a state where it isn't (LISTENING, BLOCKING, DISABLED), we need to flush the existing dynamic entries. However, there are cases when this is not needed. Internally, when a DSA switch interface is not under a bridge, DSA still keeps it in the "FORWARDING" STP state. And when that interface joins a bridge, the bridge will meticulously iterate that port through all STP states, starting with BLOCKING and ending with FORWARDING. Because there is a state transition from the standalone version of FORWARDING into the temporary BLOCKING bridge port state, DSA calls the fast age procedure. Since commit 5e38c15856e9 ("net: dsa: configure better brport flags when ports leave the bridge"), DSA asks standalone ports to disable address learning. Therefore, there can be no dynamic FDB entries on a standalone port. Therefore, it does not make sense to flush dynamic FDB entries on one. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9732c148d0ced6dd0c5feb0da91f979c6beb5c93 Author: Takashi Iwai Date: Sun Aug 8 10:00:34 2021 +0200 ALSA: memalloc: Fix mmap of SG-buffer with WC pages The code refactoring to move the WC page handling into the common memalloc layer caused a breakage for HD-audio HDMI. I overlooked that the driver is using the SG-buffer, which isn't covered by the patch. This patch adds the mmap workaround for WC pages to SG-buffer handler. A caveat is that it falls back to the default handler by returning an error after setting the pgprot, so it won't work in all cases but merely for PCM (which is currently the only use case). Fixes: 623c10108338 ("ALSA: memalloc: Fix pgprot for WC mmap on x86") Reported-and-tested-by: Andy Lavr Link: https://lore.kernel.org/r/20210808080034.20337-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 061a9aeab07feb698e7c732bb66494a109bbecbf Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:22 2021 +0300 dt-bindings: display: msm: dsi-controller-main: restore assigned-clocks Restore the assgined-clocks and assigned-clock-parents properties that were lost during the txt -> YAML conversion. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210709210729.953114-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit a41cdb693595ae1904dd793fc15d6954f4295e27 Author: Dmitry Baryshkov Date: Mon Jul 5 02:05:19 2021 +0300 drm/msm/dpu: make dpu_hw_ctl_clear_all_blendstages clear necessary LMs dpu_hw_ctl_clear_all_blendstages() clears settings for the few first LMs instead of mixers actually used for the CTL. Change it to clear necessary data, using provided mixer ids. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210704230519.4081467-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit f964cfb7bcffc843469756feb15260dd623c38b5 Author: Dmitry Baryshkov Date: Mon Jun 28 22:19:58 2021 +0300 drm/msm/dpu: add support for alpha blending properties Add support for alpha blending properties. Setup the plane blend state according to those properties. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210628191958.2754731-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit e8a767e04dbc7b201cb17ab99dca723a3488b6d4 Author: Kuogee Hsieh Date: Wed Aug 4 08:51:01 2021 -0700 drm/msm/dp: update is_connected status base on sink count at dp_pm_resume() Currently at dp_pm_resume() is_connected state is decided base on hpd connection status only. This will put is_connected in wrongly "true" state at the scenario that dongle attached to DUT but without hmdi cable connecting to it. Fix this problem by adding read sink count from dongle and decided is_connected state base on both sink count and hpd connection status. Changes in v2: -- remove dp_get_sink_count() cand call drm_dp_read_sink_count() Changes in v3: -- delete status local variable from dp_pm_resume() Changes in v4: -- delete un necessary comment at dp_pm_resume() Fixes: d9aa6571b28ba ("drm/msm/dp: check sink_count before update is_connected status") Signed-off-by: Kuogee Hsieh Link: https://lore.kernel.org/r/1628092261-32346-1-git-send-email-khsieh@codeaurora.org Tested-by: Stephen Boyd Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5bccb945f38b2aff334619b23b50bb0a6a9995a5 Author: Kalyan Thota Date: Wed Aug 4 02:40:28 2021 -0700 drm/msm/disp/dpu1: add safe lut config in dpu driver Add safe lut configuration for all the targets in dpu driver as per QOS recommendation. Issue reported on SC7280: With wait-for-safe feature in smmu enabled, RT client buffer levels are checked to be safe before smmu invalidation. Since display was always set to unsafe it was delaying the invalidaiton process thus impacting the performance on NRT clients such as eMMC and NVMe. Validated this change on SC7280, With this change eMMC performance has improved significantly. Changes in v2: - Add fixes tag (Sai) - CC stable kernel (Dimtry) Changes in v3: - Correct fixes tag with appropriate hash (stephen) - Resend patch adding reviewed by tag - Resend patch adding correct format for pushing into stable tree (Greg) Fixes: 591e34a091d1 ("drm/msm/disp/dpu1: add support for display for SC7280 target") Cc: stable@vger.kernel.org Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov Tested-by: Sai Prakash Ranjan (sc7280, sc7180) Link: https://lore.kernel.org/r/1628070028-2616-1-git-send-email-kalyan_t@codeaurora.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5752d58c4e0fe09cbc7a76a3dd05c445a0b5c82e Author: Souptick Joarder Date: Fri Jul 9 08:18:34 2021 +0530 drm/msm/dp: Remove unused variable Kernel test roobot throws below warning -> drivers/gpu/drm/msm/dp/dp_display.c:1017:21: warning: variable 'drm' set but not used [-Wunused-but-set-variable] Removed unused variable drm. Reported-by: kernel test robot Signed-off-by: Souptick Joarder Link: https://lore.kernel.org/r/20210709024834.29680-1-jrdr.linux@gmail.com Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 462f7017a6918d152870bfb8852f3c70fd74b296 Author: Konrad Dybcio Date: Thu Jul 29 00:20:54 2021 +0200 drm/msm/dsi: Fix DSI and DSI PHY regulator config from SDM660 VDDA is not present and the specified load value is wrong. Fix it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222057.52641-1-konrad.dybcio@somainline.org Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 2fd653bbce952af589e326b4663707fc995b0286 Author: Guo Zhengkui Date: Thu Jul 29 11:01:40 2021 +0800 drm/msm: remove a repeated including of Remove a repeated "#include " in line 19 of the original file. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20210729030140.99500-1-guozhengkui@vivo.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 601f0479c583603900d5872bad6623e8866b0e35 Author: Maitreyee Rao Date: Mon Jul 26 17:38:18 2021 -0700 drm/msm/dp: add logs across DP driver for ease of debugging Add trace points across the MSM DP driver to help debug interop issues. Changes in v2: - Got rid of redundant log messages. - Added %#x instead of 0x%x wherever required. - Got rid of __func__ calls in debug messages. - Added newline wherever missing. Changes in v3: - Got rid of redundant log messages. - Unstuck colon from printf specifier in various places. Changes in v4: - Changed goto statement and used if else-if Changes in v5: - Changed if else if statement, to not overwrite the ret variable multiple times. Changes in v6: - Changed a wrong log message. Signed-off-by: Maitreyee Rao Link: https://lore.kernel.org/r/1627346298-11528-1-git-send-email-maitreye@codeaurora.org Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b9007a03275a20c3dc5cf016230f4508839c9c23 Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:16 2021 +0300 drm/msm/kms: drop set_encoder_mode callback set_encoder_mode callback is completely unused now. Drop it from msm_kms_func(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-8-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit ef2cd4273f5392c47ed5cc87f83ec55c15354ee6 Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:15 2021 +0300 drm/msm/dsi: stop calling set_encoder_mode callback None of the display drivers now implement set_encoder_mode callback. Stop calling it from the modeset init code. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-7-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 9b6ce7db0db4b5e1de02e178e921c6ac7a4543e9 Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:14 2021 +0300 drm/msm/dp: stop calling set_encoder_mode callback None of the display drivers now implement set_encoder_mode callback. Stop calling it from the modeset init code. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-6-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0f1b69fea260cf336cb71f9bbdc33d171288d0f9 Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:13 2021 +0300 drm/msm/mdp5: move mdp5_encoder_set_intf_mode after msm_dsi_modeset_init Move a call to mdp5_encoder_set_intf_mode() after msm_dsi_modeset_init(), removing set_encoder_mode callback. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-5-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit a2f3d32f1434becbd17b255c5072b7a20b13292a Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:12 2021 +0300 drm/msm/dpu: support setting up two independent DSI connectors Move setting up encoders from set_encoder_mode to _dpu_kms_initialize_dsi() / _dpu_kms_initialize_displayport(). This allows us to support not only "single DSI" and "bonded DSI" but also "two independent DSI" configurations. In future this would also help adding support for multiple DP connectors. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-4-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit f518f6c111e73614466a471be157b18b4e12a1cc Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:11 2021 +0300 drm/msm/dsi: add three helper functions Add three helper functions to be used by display drivers for setting up encoders. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-3-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 6183606da324b934166e7b47c3be6176fa86f9ff Author: Dmitry Baryshkov Date: Sat Jul 17 15:40:10 2021 +0300 drm/msm/dsi: rename dual DSI to bonded DSI We are preparing to support two independent DSI hosts in the DSI/DPU code. To remove possible confusion (as both configurations can be referenced as dual DSI) let's rename old "dual DSI" (two DSI hosts driving single device, with clocks being locked) to "bonded DSI". Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210717124016.316020-2-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson [DB: add one extra hunk added by one previous patches] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5e2a72d43498a46777c618ef97b8ee3ebf188567 Author: Abhinav Kumar Date: Wed Jul 21 19:50:32 2021 -0700 drm/msm/dsi: add support for dsi test pattern generator During board bringups its useful to have a DSI test pattern generator to isolate a DPU vs a DSI issue and focus on the relevant hardware block. To facilitate this, add an API which triggers the DSI controller test pattern. The expected output is a rectangular checkered pattern. This has been validated on a single DSI video mode panel by calling it right after drm_panel_enable() which is also the ideal location to use this as the DSI host and the panel have been initialized by then. Further validation on dual DSI and command mode panel is pending. If there are any fix ups needed for those, it shall be applied on top of this change. Changes in v2: - generate the new dsi.xml.h and update the bitfield names Signed-off-by: Abhinav Kumar Link: https://lore.kernel.org/r/1626922232-29105-2-git-send-email-abhinavk@codeaurora.org Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 24a5993e5bc2b43673a3547b9ff96615421738f2 Author: Abhinav Kumar Date: Wed Jul 21 19:50:31 2021 -0700 drm/msm/dsi: update dsi register header file for tpg Update the DSI controller header XML file to add registers and bitfields to support rectangular checkered pattern generator. Signed-off-by: Abhinav Kumar Link: https://lore.kernel.org/r/1626922232-29105-1-git-send-email-abhinavk@codeaurora.org Reviewed-by: Stephen Boyd [DB: removed headergen commit changes] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 65c391b3199418d55e1d94a7e1d1ec1fe456fdee Author: Rajeev Nandan Date: Tue Jun 22 18:12:28 2021 +0530 drm/msm/dsi: Add DSI support for SC7280 Add support for v2.5.0 DSI block in the SC7280 SoC. Signed-off-by: Rajeev Nandan Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1624365748-24224-4-git-send-email-rajeevny@codeaurora.org Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 6af927984b549d81a225c8dbcf51c95325b0b1e0 Author: Rajeev Nandan Date: Tue Jun 22 18:12:27 2021 +0530 drm/msm/dsi: Add PHY configuration for SC7280 The SC7280 SoC uses the 7nm (V4.1) DSI PHY driver with different enable|disable regulator loads. Signed-off-by: Rajeev Nandan Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1624365748-24224-3-git-send-email-rajeevny@codeaurora.org Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 9a152785e233c3d62e82ada3cadabe01b75d4758 Author: Rajeev Nandan Date: Tue Jun 22 18:12:26 2021 +0530 dt-bindings: msm/dsi: Add sc7280 7nm dsi phy The SC7280 SoC uses the 7nm (V4.1) DSI PHY driver. Signed-off-by: Rajeev Nandan Link: https://lore.kernel.org/r/1624365748-24224-2-git-send-email-rajeevny@codeaurora.org Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 94ad6ec987393824d253d963e974a798e870c34e Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:29 2021 +0300 drm/msm/dsi: drop msm_dsi_phy_get_shared_timings Instead of fetching shared timing through an extra function call, get them directly from msm_dsi_phy_enable. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit d119b7cb965d527646b9f9311010f1774a333370 Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:28 2021 +0300 drm/msm/dsi: phy: use of_device_get_match_data Use of_device_get_match-data() instead of of_match_node(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-8-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 9e66ccd6526b332d9c97f78344d9ba455c2aa6fc Author: Stephen Boyd Date: Wed Jul 7 23:56:19 2021 -0700 drm/msm/dpu: Add newlines to printks Add some missing newlines to the various DRM printks in this file. Noticed while looking at logs. While we're here unbreak quoted strings so grepping them is easier. Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20210708065619.999199-1-swboyd@chromium.org Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 56bd931ae506730c9ab1e4cc4bfefa43fc2d18fa Author: David Heidelberg Date: Thu Jul 15 08:09:25 2021 +0200 drm/msm: mdp4: drop vblank get/put from prepare/complete_commit msm_atomic is doing vblank get/put's already, currently there no need to duplicate the effort in MDP4 Fix warning: ... WARNING: CPU: 3 PID: 79 at drivers/gpu/drm/drm_vblank.c:1194 drm_vblank_put+0x1cc/0x1d4 ... and multiple vblank time-outs: ... msm 5100000.mdp: vblank time out, crtc=1 ... Tested on Nexus 7 2013 (deb), LTS 5.10.50. Introduced by: 119ecb7fd3b5 ("drm/msm/mdp4: request vblank during modeset") Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210715060925.7880-1-david@ixit.cz Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4af4fc92939dc811ef291c0673946555aa4fb71f Author: David Heidelberg Date: Tue Jul 6 01:16:41 2021 +0200 drm/msm/mdp4: move HW revision detection to earlier phase Fixes if condition, which never worked inside mdp4_kms_init, since HW detection has been done later in mdp4_hw_init. Fixes: eb2b47bb9a03 ("drm/msm/mdp4: only use lut_clk on mdp4.2+") Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210705231641.315804-2-david@ixit.cz Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4d319afe666b0fc9a9855ba9bdf9ae3710ecf431 Author: David Heidelberg Date: Tue Jul 6 01:16:40 2021 +0200 drm/msm/mdp4: refactor HW revision detection into read_mdp_hw_revision Inspired by MDP5 code. Also use DRM_DEV_INFO for MDP version as MDP5 does. Cosmetic change: uint32_t -> u32 - checkpatch suggestion. Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210705231641.315804-1-david@ixit.cz Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit bfddcfe155a2fe448fee0169c5cbc82c7fa73491 Author: Wei Li Date: Mon Jul 5 21:43:02 2021 +0800 drm/msm: Fix error return code in msm_drm_init() When it fail to create crtc_event kthread, it just jump to err_msm_uninit, while the 'ret' is not updated. So assign the return code before that. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reported-by: Hulk Robot Signed-off-by: Wei Li Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210705134302.315813-1-liwei391@huawei.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b93cc4b201372d4ab16f501ef3a2d3aac1f01f08 Author: Dmitry Baryshkov Date: Thu Jul 1 03:00:15 2021 +0300 drm/msm/dsi: drop gdsc regulator handling None of supported devies uses "gdsc" regulator for DSI. GDSC support is now implemented as a power domain. Drop old code and config handling gdsc regulator requesting and enabling. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210701000015.3347713-1-dmitry.baryshkov@linaro.org Reviewed-by: Abhinav Kumar Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5ac178381d2652719566322e7a04ef18c98d5092 Author: Jonathan Marek Date: Thu Jun 17 10:43:35 2021 -0400 drm/msm/dsi: support CPHY mode for 7nm pll/phy Add the required changes to support 7nm pll/phy in CPHY mode. This adds a "qcom,dsi-phy-cphy-mode" property for the PHY node to enable the CPHY mode. Signed-off-by: Jonathan Marek Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210617144349.28448-4-jonathan@marek.ca Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit bb5b94f5bbe75470912b70fb08880fc5273aa62d Author: Jonathan Marek Date: Thu Jun 17 10:43:34 2021 -0400 dt-bindings: msm: dsi: document phy-type property for 7nm dsi phy Document a new phy-type property which will be used to determine whether the phy should operate in D-PHY or C-PHY mode. Signed-off-by: Jonathan Marek Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20210617144349.28448-3-jonathan@marek.ca Acked-by: Rob Herring Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 58890a4bfaa7921033235c9158c300c6a244429e Author: Jonathan Marek Date: Thu Jun 17 10:43:33 2021 -0400 dt-bindings: msm: dsi: add missing 7nm bindings These got lost when going from .txt to .yaml bindings, add them back. Signed-off-by: Jonathan Marek Fixes: 8fc939e72ff8 ("dt-bindings: msm: dsi: add yaml schemas for DSI PHY bindings") Link: https://lore.kernel.org/r/20210617144349.28448-2-jonathan@marek.ca Reviewed-by: Rob Herring Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit a83cc4fb19bda671e89536fe2eb727e88a8178a1 Author: Baokun Li Date: Wed Jun 9 15:28:38 2021 +0800 drm/msm: Use list_move_tail instead of list_del/list_add_tail in msm_gem.c Using list_move_tail() instead of list_del() + list_add_tail() in msm_gem.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li Link: https://lore.kernel.org/r/20210609072838.1369371-1-libaokun1@huawei.com Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit c9f737c7980b2d898a0ca4520bfdb1a6b9823e8e Author: Douglas Anderson Date: Fri May 21 13:45:50 2021 -0700 drm/msm: Use nvmem_cell_read_variable_le_u32() to read speed bin Let's use the newly-added nvmem_cell_read_variable_le_u32() to future proof ourselves a little bit. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20210521134516.v2.1.Id496c6fea0cb92ff6ea8ef1faf5d468eb09465e3@changeid Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0710a740dc211ea4f94f5d2b887d5efafd524193 Author: Rob Clark Date: Wed Apr 28 12:36:49 2021 -0700 drm/msm: Periodically update RPTR shadow On a5xx and a6xx devices that are using CP_WHERE_AM_I to update a ringbuffer read-ptr shadow value, periodically emit a CP_WHERE_AM_I every 32 commands, so that a later submit waiting for ringbuffer space to become available sees partial progress, rather than not seeing rptr advance at all until the GPU gets to the end of the submit that it is currently chewing on. Signed-off-by: Rob Clark Acked-by: Jordan Crouse Link: https://lore.kernel.org/r/20210428193654.1498482-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 510410bfc034c57cc3caf1572aa47c1017bab2f9 Author: Thomas Zimmermann Date: Tue Jul 6 10:47:53 2021 +0200 drm/msm: Implement mmap as GEM object function Moving the driver-specific mmap code into a GEM object function allows for using DRM helpers for various mmap callbacks. The respective msm functions are being removed. The file_operations structure fops is now being created by the helper macro DEFINE_DRM_GEM_FOPS(). v2: * rebase onto latest upstream * remove declaration of msm_gem_mmap_obj() from msm_fbdev.c Signed-off-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20210706084753.8194-1-tzimmermann@suse.de [squash in missing VM_DONTEXPAND flag] Signed-off-by: Rob Clark commit 840d10b64dad17dbb5fabfdbe94884258b916d1e Author: Bjorn Andersson Date: Sat Jul 24 20:20:02 2021 -0700 drm: msm: Add 680 gpu to the adreno gpu list This patch adds a Adreno 680 entry to the gpulist. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210725032002.3961691-1-bjorn.andersson@linaro.org Signed-off-by: Rob Clark commit f9be84db09d2e8930319503683305781378a7dbf Author: Cai Huoqing Date: Sat Aug 7 13:43:36 2021 +0800 net: bonding: bond_alb: Remove the dependency on ipx network layer commit <47595e32869f> ("") indicated the ipx network layer as obsolete in Jan 2018, updated in the MAINTAINERS file now, after being exposed for 3 years to refactoring, so to delete the ipx net layer related code for good. Signed-off-by: Cai Huoqing Signed-off-by: David S. Miller commit 4367355dd90942a71641c98c40c74589c9bddf90 Author: Nathan Chancellor Date: Fri Aug 6 12:13:40 2021 -0700 net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe() When compiling with clang in certain configurations, an objtool warning appears: drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.o: warning: objtool: ipq806x_gmac_probe() falls through to next function phy_modes() This happens because the unreachable annotation in the third switch statement is not eliminated. The compiler should know that the first default case would prevent the second and third from being reached as the comment notes but sanitizer options can make it harder for the compiler to reason this out. Help the compiler out by eliminating the unreachable() annotation and unifying the default case error handling so that there is no objtool warning, the meaning of the code stays the same, and there is less duplication. Reported-by: Sami Tolvanen Tested-by: Sami Tolvanen Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 709db03a8afaf5196b36e633fbaa68b42fba95d5 Merge: 17bd3a1e10615 f7936b7b2663c Author: David S. Miller Date: Sat Aug 7 09:44:02 2021 +0100 Merge branch 's390-qeth' Karsten Graul says: ==================== s390/qeth: Add bridge to switchdev LEARNING_SYNC The netlink bridgeport attribute LEARNING_SYNC can be used to enable qeth interfaces to report MAC addresses that are reachable via this qeth interface to the attached software bridge via switchdev notifiers SWITCHDEV_FDB_ADD_TO_BRIDGE and SWITCHDEV_FDB_DEL_TO_BRIDGE. Extend this support of LEARNING_SYNC to the bridge to switchdev notifiers SWITCHDEV_FDB_ADD_TO_DEVICE and SWITCHDEV_FDB_DEL_TO_DEVICE. Add the capability to sync MAC addresses that are learned by a north-facing, non-isolated bridgeport of a software bridge to south-facing, isolated bridgeports. This enables the software bridge to influence south to north traffic steering in hardware. ==================== Signed-off-by: David S. Miller commit f7936b7b2663c99a096a5c432ba96ab1e91a6c0f Author: Alexandra Winter Date: Fri Aug 6 17:26:03 2021 +0200 s390/qeth: Update MACs of LEARNING_SYNC device Update the MAC addresses that are registered with a LEARNING_SYNC qeth device with the events announced by the attached software bridge. Typically the LEARNING_SYNC qeth bridge port has an isolated sibling (the default interface of an 'HiperSockets Converged Interface' (HSCI)). Update the MACs of isolated siblings as well, to avoid unnecessary flooding in the attached virtualized switches. Signed-off-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 4e20e73e631ac4c2f7af603f14bd44a6d77d919c Author: Alexandra Winter Date: Fri Aug 6 17:26:02 2021 +0200 s390/qeth: Switchdev event handler QETH HiperSockets devices with LEARNING_SYNC capability can be used to construct a linux bridge with: 2 isolated southbound interfaces: a) a default network interface b) a LEARNING-SYNC HiperSockets interface and 1 non-isolated northbound interface. This is called a 'HiperSockets Converged Interface' (HSCI). The existing LEARNING_SYNC functionality is used to update the bridge fdb with MAC addresses that should be sent-out via the HiperSockets interface, instead of the default network interface. Add handling of switchdev events SWITCHDEV_FDB_ADD_TO_DEVICE and SWITCHDEV_FDB_DEL_TO_DEVICE to the qeth LEARNING_SYNC functionality. Thus if the northbound bridgeport of an HSCI doesn't only have a single static MAC address, but instead is a learning bridgeport, work is enqueued, so the HiperSockets virtual switch (that is external to this Linux instance) can update its fdb. When BRIDGE is a loadable module, QETH_L2 mustn't be built-in: drivers/s390/net/qeth_l2_main.o: in function 'qeth_l2_switchdev_event': drivers/s390/net/qeth_l2_main.c:927: undefined reference to 'br_port_flag_is_set' Add Kconfig dependency to enforce usable configurations. Signed-off-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 60bb1089467d52c68190f813105c897b0933bbcc Author: Alexandra Winter Date: Fri Aug 6 17:26:01 2021 +0200 s390/qeth: Register switchdev event handler Conditionally register a qeth_l2 switchdev_event handler to handle bridge to device switchdev events, when at least one qeth interface has the bridgeport attribute LEARNING_SYNC enabled. Signed-off-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 17bd3a1e10615b7a790faf5ff4cd87401d447e7c Author: Colin Ian King Date: Fri Aug 6 13:49:32 2021 +0100 tulip: Remove deadcode on startup true condition The true check on the variable startable in the ternary operator is always false because the previous if statement handles the true condition for startable. Hence the ternary check is dead code and can be removed. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 0b9159d0ff21bc281dbb9ede06ad566330ac0943 Author: Ira Weiny Date: Thu Jun 17 15:16:18 2021 -0700 cxl/pci: Store memory capacity values The Identify Memory Device command returns information about the volatile only and persistent only memory capacities. Store those values in the cxl_mem structure for later use. While at it, reuse those calculations to calculate the ram and pmem ranges. Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20210617221620.1904031-2-ira.weiny@intel.com Signed-off-by: Dan Williams commit 9cbc861095375793a69858f91f3ac4e817f320f0 Author: Andy Shevchenko Date: Thu Aug 5 14:26:19 2021 +0300 leds: lgm-sso: Propagate error codes from callee to caller The one of the latest change to the driver reveals the problem that the error codes from callee aren't propagated to the caller of __sso_led_dt_parse(). Fix this accordingly. Fixes: 9999908ca1ab ("leds: lgm-sso: Put fwnode in any case during ->probe()") Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit c83ae15dc9470da6ddfcb9485235cba1a3ed8740 Merge: 579345e7f2190 f4700a62c2716 Author: Andrii Nakryiko Date: Fri Aug 6 16:53:27 2021 -0700 Merge branch 'samples/bpf: xdpsock: Minor enhancements' Simon Horman says: ==================== This short series provides minor enhancements to the sample code in samples/bpf/xdpsock_user.c. Each change is explained more fully in its own commit message. ==================== Signed-off-by: Andrii Nakryiko commit f4700a62c27161e364f66fdce527e8b04083c444 Author: Niklas Söderlund Date: Fri Aug 6 14:28:55 2021 +0200 samples/bpf: xdpsock: Remove forward declaration of ip_fast_csum() There is a forward declaration of ip_fast_csum() just before its implementation, remove the unneeded forward declaration. While at it mark the implementation as static inline. Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: Andrii Nakryiko Reviewed-by: Louis Peens Link: https://lore.kernel.org/bpf/20210806122855.26115-3-simon.horman@corigine.com commit 29f24c43cbe09b83162776a370848d5a782dc3b7 Author: Niklas Söderlund Date: Fri Aug 6 14:28:54 2021 +0200 samples/bpf: xdpsock: Make the sample more useful outside the tree The xdpsock sample application is a useful base for experiment's around AF_XDP sockets. Compiling the sample outside of the kernel tree is made harder then it has to be as the sample includes two headers and that are not installed by 'make install_header' nor are usually part of distributions kernel headers. The first header asm/barrier.h is not used and can just be dropped. The second linux/compiler.h are only needed for the decorator __force and are only used in ip_fast_csum(), csum_fold() and csum_tcpudp_nofold(). These functions are copied verbatim from include/asm-generic/checksum.h and lib/checksum.c. While it's fine to copy and use these functions in the sample application the decorator brings no value and can be dropped together with the include. With this change it's trivial to compile the xdpsock sample outside the kernel tree from xdpsock_user.c and xdpsock.h. $ gcc -o xdpsock xdpsock_user.c -lbpf -lpthread Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: Andrii Nakryiko Reviewed-by: Louis Peens Link: https://lore.kernel.org/bpf/20210806122855.26115-2-simon.horman@corigine.com commit 35ba6abb73e4d2ba21a566d3671618f4a5503c27 Author: Grygorii Strashko Date: Fri Aug 6 17:28:09 2021 +0300 net: ethernet: ti: davinci_cpdma: revert "drop frame padding" This reverts commit 9ffc513f95ee ("net: ethernet: ti: davinci_cpdma: drop frame padding") which has depndency from not yet merged patch [1] and so breaks cpsw_new driver. [1] https://patchwork.kernel.org/project/netdevbpf/patch/20210805145511.12016-1-grygorii.strashko@ti.com/ Fixes: 9ffc513f95ee ("net: ethernet: ti: davinci_cpdma: drop frame padding") Signed-off-by: Grygorii Strashko Link: https://lore.kernel.org/r/20210806142809.15069-1-grygorii.strashko@ti.com Signed-off-by: Jakub Kicinski commit 06669e6880be7422bb9926f71be39c4924b92fea Author: Dan Carpenter Date: Fri Aug 6 18:04:35 2021 +0300 vrf: fix NULL dereference in vrf_finish_output() The "skb" pointer is NULL on this error path so we can't dereference it. Use "dev" instead. Fixes: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210806150435.GB15586@kili Signed-off-by: Jakub Kicinski commit 6ea0126631b0c3fb03ad69832c409b00a250d8dd Author: Matthias Schiffer Date: Mon Jul 19 09:20:19 2021 +0200 power: supply: sbs-battery: add support for time_to_empty_now attribute As defined by the Smart Battery Data Specification. An _AVG suffix is added to the enum values REG_TIME_TO_EMPTY and REG_TIME_TO_FULL to make the distinction clear. Signed-off-by: Matthias Schiffer Signed-off-by: Sebastian Reichel commit e11544d0cdc16d59a4685872db5d81cd521819d3 Author: Matthias Schiffer Date: Mon Jul 19 09:20:18 2021 +0200 power: supply: sbs-battery: relax voltage limit The Smart Battery Data Specification allows for values 0..65535 mV, there is no reason to limit the value to 20000. Signed-off-by: Matthias Schiffer Signed-off-by: Sebastian Reichel commit 391719dce5ebd416347f35d7a136feb6a04cecb8 Author: Tang Bin Date: Tue Jul 20 22:15:39 2021 +0800 power: supply: qcom_smbb: Remove superfluous error message In the probe function, when get irq failed, the function platform_get_irq_byname() logs an error message, so remove redundant message here. Co-developed-by: Zhang Shengju Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: Sebastian Reichel commit cc2712f24e032f2bebf4355207638bf15ca676b5 Author: Maxime Ripard Date: Wed Jul 21 16:03:59 2021 +0200 dt-bindings: power: supply: axp20x-battery: Add AXP209 compatible The AXP209 compatible was used in Device Trees and the driver, but it was never documented. Cc: Chen-Yu Tsai Cc: linux-pm@vger.kernel.org Cc: Sebastian Reichel Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 83abf9e150f36c6e03644c0608c5f60cd9661a6c Author: Maxime Ripard Date: Wed Jul 21 16:03:58 2021 +0200 dt-bindings: power: supply: axp20x: Add AXP803 compatible The AXP803 compatible was introduced recently with a fallback to the AXP813, but it was never documented. Cc: Chen-Yu Tsai Cc: linux-pm@vger.kernel.org Cc: Sebastian Reichel Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Reviewed-by: Chen-Yu Tsai Signed-off-by: Sebastian Reichel commit 4415e4cea4e6db863829914a48b68b7797db2f59 Author: Nikita Travkin Date: Tue Jul 27 22:03:45 2021 +0500 power: supply: max17042_battery: Add support for MAX77849 Fuel-Gauge MAX77849 is a combined fuel-gauge, charger and MUIC IC. Notably, fuel-gauge has dedicated i2c lines and seems to be fully compatible with max17047. Add new compatible for it reusing max17047 code paths. Signed-off-by: Nikita Travkin Signed-off-by: Sebastian Reichel commit e759e1b95836ec59dbadd8b7e8a7762a3c96798a Author: Nikita Travkin Date: Tue Jul 27 22:03:44 2021 +0500 dt-bindings: power: supply: max17042: Document max77849-battery max77849 is a combined fuel-gauge, charger and MUIC device. Add it to the bindings documentation. Signed-off-by: Nikita Travkin Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 521c89b3a4022269c75b35062358d1dae4ebfa79 Author: Paul E. McKenney Date: Mon Jul 19 11:52:12 2021 -0700 rcu: Print human-readable message for schedule() in RCU reader The WARN_ON_ONCE() invocation within the CONFIG_PREEMPT=y version of rcu_note_context_switch() triggers when there is a voluntary context switch in an RCU read-side critical section, but there is quite a gap between the output of that WARN_ON_ONCE() and this RCU-usage error. This commit therefore converts the WARN_ON_ONCE() to a WARN_ONCE() that explicitly describes the problem in its message. Signed-off-by: Paul E. McKenney commit 508958259bb3d9ca4ec37f0abdb211e9a6f3daa2 Author: Frederic Weisbecker Date: Tue Jul 6 01:43:43 2021 +0200 rcu: Explain why rcu_all_qs() is a stub in preemptible TREE RCU The cond_resched() function reports an RCU quiescent state only in non-preemptible TREE RCU implementation. This commit therefore adds a comment explaining why cond_resched() does nothing in preemptible kernels. Signed-off-by: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Joel Fernandes Cc: Uladzislau Rezki Cc: Boqun Feng Cc: Peter Zijlstra (Intel) Cc: Ingo Molnar Signed-off-by: Paul E. McKenney commit 8211e922de2854130e3633f52cd4fc2d7817ceb0 Author: Liu Song Date: Wed Jun 30 22:08:02 2021 +0800 rcu: Use per_cpu_ptr to get the pointer of per_cpu variable There are a few remaining locations in kernel/rcu that still use "&per_cpu()". This commit replaces them with "per_cpu_ptr(&)", and does not introduce any functional change. Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Neeraj Upadhyay Reviewed-by: Joel Fernandes (Google) Signed-off-by: Liu Song Signed-off-by: Paul E. McKenney commit eb880949ef41c98a203c4a033e06e05854d902ef Author: Liu Song Date: Tue Jun 29 21:55:51 2021 +0800 rcu: Remove useless "ret" update in rcu_gp_fqs_loop() Within rcu_gp_fqs_loop(), the "ret" local variable is set to the return value from swait_event_idle_timeout_exclusive(), but "ret" is unconditionally overwritten later in the code. This commit therefore removes this useless assignment. Signed-off-by: Liu Song Signed-off-by: Paul E. McKenney commit d283aa1b04d9ad9ed34bfc2f51ffe0371a16ee3c Author: Paul E. McKenney Date: Thu May 20 21:08:38 2021 -0700 rcu: Mark accesses in tree_stall.h This commit marks the accesses in tree_stall.h so as to both avoid undesirable compiler optimizations and to keep KCSAN focused on the accesses of the core algorithm. Signed-off-by: Paul E. McKenney commit f74126dcbcbffe0d9fc3cb9bbf171b124a6791e5 Author: Paul E. McKenney Date: Mon Jun 7 21:57:02 2021 -0700 rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack The kbuild test project found an oversized stack frame in rcu_gp_kthread() for some kernel configurations. This oversizing was due to a very large amount of inlining, which is unnecessary due to the fact that this code executes infrequently. This commit therefore marks rcu_gp_init() and rcu_gp_fqs_loop noinline_for_stack to conserve stack space. Reported-by: kernel test robot Tested-by: Rong Chen [ paulmck: noinline_for_stack per Nathan Chancellor. ] Reviewed-by: Nathan Chancellor Signed-off-by: Paul E. McKenney commit d9ee962feb4f26d4eac0042861457d941aa2df5f Author: Paul E. McKenney Date: Thu Jun 3 10:17:36 2021 -0700 rcu: Mark lockless ->qsmask read in rcu_check_boost_fail() Accesses to ->qsmask are normally protected by ->lock, but there is an exception in the diagnostic code in rcu_check_boost_fail(). This commit therefore applies data_race() to this access to avoid KCSAN complaining about the C-language writes protected by ->lock. Signed-off-by: Paul E. McKenney commit 65bfdd36c113f5d579a382d8f2847210ea4cdca6 Author: Paul E. McKenney Date: Wed Jun 2 16:31:38 2021 -0700 srcutiny: Mark read-side data races This commit marks some interrupt-induced read-side data races in __srcu_read_lock(), __srcu_read_unlock(), and srcu_torture_stats_print(). Signed-off-by: Paul E. McKenney commit b169246feb1d82dbee5f3f6a4ce57368644dce95 Author: Paul E. McKenney Date: Fri May 21 14:23:03 2021 -0700 rcu: Start timing stall repetitions after warning complete Systems with low-bandwidth consoles can have very large printk() latencies, and on such systems it makes no sense to have the next RCU CPU stall warning message start output before the prior message completed. This commit therefore sets the time of the next stall only after the prints have completed. While printing, the time of the next stall message is set to ULONG_MAX/2 jiffies into the future. Reviewed-by: Sergey Senozhatsky Signed-off-by: Paul E. McKenney commit a80be428fbc1f1f3bc9ed9245906dd60850887f5 Author: Sergey Senozhatsky Date: Sat May 22 00:56:24 2021 +0900 rcu: Do not disable GP stall detection in rcu_cpu_stall_reset() rcu_cpu_stall_reset() is one of the functions virtual CPUs execute during VM resume in order to handle jiffies skew that can trigger false positive stall warnings. Paul has pointed out that this approach is problematic because rcu_cpu_stall_reset() disables RCU grace period stall-detection virtually forever, while in fact it can just restart the stall-detection timeout. Suggested-by: "Paul E. McKenney" Signed-off-by: Sergey Senozhatsky Signed-off-by: Signed-off-by: Paul E. McKenney commit ccfc9dd6914feaa9a81f10f9cce56eb0f7712264 Author: Sergey Senozhatsky Date: Sat May 22 00:56:23 2021 +0900 rcu/tree: Handle VM stoppage in stall detection The soft watchdog timer function checks if a virtual machine was suspended and hence what looks like a lockup in fact is a false positive. This is what kvm_check_and_clear_guest_paused() does: it tests guest PVCLOCK_GUEST_STOPPED (which is set by the host) and if it's set then we need to touch all watchdogs and bail out. Watchdog timer function runs from IRQ, so PVCLOCK_GUEST_STOPPED check works fine. There is, however, one more watchdog that runs from IRQ, so watchdog timer fn races with it, and that watchdog is not aware of PVCLOCK_GUEST_STOPPED - RCU stall detector. apic_timer_interrupt() smp_apic_timer_interrupt() hrtimer_interrupt() __hrtimer_run_queues() tick_sched_timer() tick_sched_handle() update_process_times() rcu_sched_clock_irq() This triggers RCU stalls on our devices during VM resume. If tick_sched_handle()->rcu_sched_clock_irq() runs on a VCPU before watchdog_timer_fn()->kvm_check_and_clear_guest_paused() then there is nothing on this VCPU that touches watchdogs and RCU reads stale gp stall timestamp and new jiffies value, which makes it think that RCU has stalled. Make RCU stall watchdog aware of PVCLOCK_GUEST_STOPPED and don't report RCU stalls when we resume the VM. Signed-off-by: Sergey Senozhatsky Signed-off-by: Signed-off-by: Paul E. McKenney commit 751b1710eb09b0ba21718add68cd340707ca2446 Author: Julian Wiedmann Date: Fri May 21 12:08:29 2021 +0200 rculist: Unify documentation about missing list_empty_rcu() We have two separate sections that talk about why list_empty_rcu() is not needed, so this commit consolidates them. Signed-off-by: Julian Wiedmann [ paulmck: The usual wordsmithing. ] Signed-off-by: Paul E. McKenney commit 5fcb3a5f04ee6422714adb02f5364042228bfc2e Author: Paul E. McKenney Date: Thu May 20 13:35:50 2021 -0700 rcu: Mark accesses to ->rcu_read_lock_nesting KCSAN flags accesses to ->rcu_read_lock_nesting as data races, but in the past, the overhead of marked accesses was excessive. However, that was long ago, and much has changed since then, both in terms of hardware and of compilers. Here is data taken on an eight-core laptop using Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz with a kernel built using gcc version 9.3.0, with all data in nanoseconds. Unmarked accesses (status quo), measured by three refscale runs: Minimum reader duration: 3.286 2.851 3.395 Median reader duration: 3.698 3.531 3.4695 Maximum reader duration: 4.481 5.215 5.157 Marked accesses, also measured by three refscale runs: Minimum reader duration: 3.501 3.677 3.580 Median reader duration: 4.053 3.723 3.895 Maximum reader duration: 7.307 4.999 5.511 This focused microbenhmark shows only sub-nanosecond differences which are unlikely to be visible at the system level. This commit therefore marks data-racing accesses to ->rcu_read_lock_nesting. Signed-off-by: Paul E. McKenney commit 2be57f732889277b07ccddd205ef0616c8c1941f Author: Paul E. McKenney Date: Wed May 19 17:25:42 2021 -0700 rcu: Weaken ->dynticks accesses and updates Accesses to the rcu_data structure's ->dynticks field have always been fully ordered because it was not possible to prove that weaker ordering was safe. However, with the removal of the rcu_eqs_special_set() function and the advent of the Linux-kernel memory model, it is now easy to show that two of the four original full memory barriers can be weakened to acquire and release operations. The remaining pair must remain full memory barriers. This change makes the memory ordering requirements more evident, and it might well also speed up the to-idle and from-idle fastpaths on some architectures. The following litmus test, adapted from one supplied off-list by Frederic Weisbecker, models the RCU grace-period kthread detecting an idle CPU that is concurrently transitioning to non-idle: C dynticks-from-idle { DYNTICKS=0; (* Initially idle. *) } P0(int *X, int *DYNTICKS) { int dynticks; int x; // Idle. dynticks = READ_ONCE(*DYNTICKS); smp_store_release(DYNTICKS, dynticks + 1); smp_mb(); // Now non-idle x = READ_ONCE(*X); } P1(int *X, int *DYNTICKS) { int dynticks; WRITE_ONCE(*X, 1); smp_mb(); dynticks = smp_load_acquire(DYNTICKS); } exists (1:dynticks=0 /\ 0:x=1) Running "herd7 -conf linux-kernel.cfg dynticks-from-idle.litmus" verifies this transition, namely, showing that if the RCU grace-period kthread (P1) sees another CPU as idle (P0), then any memory access prior to the start of the grace period (P1's write to X) will be seen by any RCU read-side critical section following the to-non-idle transition (P0's read from X). This is a straightforward use of full memory barriers to force ordering in a store-buffering (SB) litmus test. The following litmus test, also adapted from the one supplied off-list by Frederic Weisbecker, models the RCU grace-period kthread detecting a non-idle CPU that is concurrently transitioning to idle: C dynticks-into-idle { DYNTICKS=1; (* Initially non-idle. *) } P0(int *X, int *DYNTICKS) { int dynticks; // Non-idle. WRITE_ONCE(*X, 1); dynticks = READ_ONCE(*DYNTICKS); smp_store_release(DYNTICKS, dynticks + 1); smp_mb(); // Now idle. } P1(int *X, int *DYNTICKS) { int x; int dynticks; smp_mb(); dynticks = smp_load_acquire(DYNTICKS); x = READ_ONCE(*X); } exists (1:dynticks=2 /\ 1:x=0) Running "herd7 -conf linux-kernel.cfg dynticks-into-idle.litmus" verifies this transition, namely, showing that if the RCU grace-period kthread (P1) sees another CPU as newly idle (P0), then any pre-idle memory access (P0's write to X) will be seen by any code following the grace period (P1's read from X). This is a simple release-acquire pair forcing ordering in a message-passing (MP) litmus test. Of course, if the grace-period kthread detects the CPU as non-idle, it will refrain from reporting a quiescent state on behalf of that CPU, so there are no ordering requirements from the grace-period kthread in that case. However, other subsystems call rcu_is_idle_cpu() to check for CPUs being non-idle from an RCU perspective. That case is also verified by the above litmus tests with the proviso that the sense of the low-order bit of the DYNTICKS counter be inverted. Unfortunately, on x86 smp_mb() is as expensive as a cache-local atomic increment. This commit therefore weakens only the read from ->dynticks. However, the updates are abstracted into a rcu_dynticks_inc() function to ease any future changes that might be needed. [ paulmck: Apply Linus Torvalds feedback. ] Link: https://lore.kernel.org/lkml/20210721202127.2129660-4-paulmck@kernel.org/ Suggested-by: Linus Torvalds Acked-by: Mathieu Desnoyers Signed-off-by: Paul E. McKenney commit a86baa69c2b7b85bab41692fa3ec188a5aae1d27 Author: Joel Fernandes (Google) Date: Tue May 18 19:17:16 2021 -0700 rcu: Remove special bit at the bottom of the ->dynticks counter Commit b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter") reserved a bit at the bottom of the ->dynticks counter to defer flushing of TLBs, but this facility never has been used. This commit therefore removes this capability along with the rcu_eqs_special_set() function used to trigger it. Link: https://lore.kernel.org/linux-doc/CALCETrWNPOOdTrFabTDd=H7+wc6xJ9rJceg6OL1S0rTV5pfSsA@mail.gmail.com/ Suggested-by: Andy Lutomirski Signed-off-by: "Joel Fernandes (Google)" [ paulmck: Forward-port to v5.13-rc1. ] Signed-off-by: Paul E. McKenney commit dc87740c8a6806bd2162bfb441770e4e53be5601 Author: Yanfei Xu Date: Sun May 16 17:50:10 2021 +0800 rcu: Fix stall-warning deadlock due to non-release of rcu_node ->lock If rcu_print_task_stall() is invoked on an rcu_node structure that does not contain any tasks blocking the current grace period, it takes an early exit that fails to release that rcu_node structure's lock. This results in a self-deadlock, which is detected by lockdep. To reproduce this bug: tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 3 --trust-make --configs "TREE03" --kconfig "CONFIG_PROVE_LOCKING=y" --bootargs "rcutorture.stall_cpu=30 rcutorture.stall_cpu_block=1 rcutorture.fwd_progress=0 rcutorture.test_boost=0" This will also result in other complaints, including RCU's scheduler hook complaining about blocking rather than preemption and an rcutorture writer stall. Only a partial RCU CPU stall warning message will be printed because of the self-deadlock. This commit therefore releases the lock on the rcu_print_task_stall() function's early exit path. Fixes: c583bcb8f5ed ("rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled") Tested-by: Qais Yousef Signed-off-by: Yanfei Xu Signed-off-by: Paul E. McKenney commit e6a901a44f76878ed1653626c9ff4cfc5a3f58f8 Author: Yanfei Xu Date: Sun May 16 00:45:11 2021 +0800 rcu: Fix to include first blocked task in stall warning The for loop in rcu_print_task_stall() always omits ts[0], which points to the first task blocking the stalled grace period. This in turn fails to count this first task, which means that ndetected will be equal to zero when all CPUs have passed through their quiescent states and only one task is blocking the stalled grace period. This zero value for ndetected will in turn result in an incorrect "All QSes seen" message: rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: rcu: Tasks blocked on level-1 rcu_node (CPUs 12-23): (detected by 15, t=6504 jiffies, g=164777, q=9011209) rcu: All QSes seen, last rcu_preempt kthread activity 1 (4295252379-4295252378), jiffies_till_next_fqs=1, root ->qsmask 0x2 BUG: sleeping function called from invalid context at include/linux/uaccess.h:156 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 70613, name: msgstress04 INFO: lockdep is turned off. Preemption disabled at: [] create_object.isra.0+0x204/0x4b0 CPU: 15 PID: 70613 Comm: msgstress04 Kdump: loaded Not tainted 5.12.2-yoctodev-standard #1 Hardware name: Marvell OcteonTX CN96XX board (DT) Call trace: dump_backtrace+0x0/0x2cc show_stack+0x24/0x30 dump_stack+0x110/0x188 ___might_sleep+0x214/0x2d0 __might_sleep+0x7c/0xe0 This commit therefore fixes the loop to include ts[0]. Fixes: c583bcb8f5ed ("rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled") Tested-by: Qais Yousef Signed-off-by: Yanfei Xu Signed-off-by: Paul E. McKenney commit a43e2a0e11491b73e2acaa27ee74d6c3b86deac0 Author: Felix Kuehling Date: Fri Jul 16 22:46:21 2021 -0400 drm/amdkfd: Allow querying SVM attributes that are clear Currently the SVM get_attr call allows querying, which flags are set in the entire address range. Add the opposite query, which flags are clear in the entire address range. Both queries can be combined in a single get_attr call, which allows answering questions such as, "is this address range coherent, non-coherent, or a mix of both"? Proposed userspace for UAPI: https://github.com/RadeonOpenCompute/ROCR-Runtime/tree/memory_model_queries Signed-off-by: Felix Kuehling Reviewed-by: Philip Yand Signed-off-by: Alex Deucher commit ed7c28c77103e1441ed22eb492b26b9b035403f7 Author: Colin Ian King Date: Fri Aug 6 12:16:15 2021 +0100 drm/amd/display: Remove redundant initialization of variable eng_id The variable eng_id is being initialized with a value that is never read, it is being re-assigned on the next statment. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 420c81c84b596984e0afb6e8b884dc67ddfa13f6 Author: Dan Carpenter Date: Fri Aug 6 18:05:18 2021 +0300 drm/amdgpu: check for allocation failure in amdgpu_vkms_sw_init() Check whether the kcalloc() fails and return -ENOMEM if it does. Fixes: 84ec374bd58036 ("drm/amdgpu: create amdgpu_vkms (v4)") Reviewed-by: Christian König Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 1b41d67ec9612b30aaa2ef3848d86a708eceb2cf Author: Kenneth Feng Date: Fri Aug 6 10:28:04 2021 +0800 drm/amd/pm: bug fix for the runtime pm BACO In some systems only MACO is supported. This is to fix the problem that runtime pm is enabled but BACO is not supported. MACO will be handled seperately. Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 42ba8c3b426342b39341e1b7a97f2387821bff86 Author: Ezequiel Garcia Date: Sun Aug 1 20:45:08 2021 -0300 mtdblock: Add comment about UBI block devices There is a surprisingly large number of tutorials that suggest using mtdblock to mount SquashFS filesystems on flash devices, including NAND devices. Given this approach is suboptimal than using UBI, and given the UBI block device layer was introduced many years ago specifically with this use case in mind, add a small comment inviting users and developers to consider UBI block. Signed-off-by: Ezequiel Garcia Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210801234509.18774-7-ezequiel@collabora.com commit 6bc219b7b2cdd9d45ea15926d32c5e5c1d63881e Author: Ezequiel Garcia Date: Sun Aug 1 20:45:07 2021 -0300 mtdblock: Update old JFFS2 mention in Kconfig JFFS2 can be mounted without 'mtdblock' since a really, really long time. Some git-log archaeology shows that in 2006 it was possible to use 'root=' to mount a JFFS2 rootfs: commit e9482b4374e2596e6f3f1ab30c4ea469f4ac6311 Author: Joern Engel Date: Tue May 30 14:25:46 2006 +0200 [MTD] Allow alternate JFFS2 mount variant for root filesystem. With this patch, "root=mtd3" and "root=mtd:foo" work for a JFFS2 rootfs. However, there are still plenty of tutorials that mention mtdblock, so users are still taking this route. Update the Kconfig to reflect this is no longer needed. Signed-off-by: Ezequiel Garcia Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210801234509.18774-6-ezequiel@collabora.com commit 74a021a632b07dd990e85e815b8757921b23db4b Author: Jason Wang Date: Tue Aug 3 19:33:00 2021 +0800 mtd: rawnand: remove never changed ret variable The ret variable used for returning value in the function `meson_nfc_rw_cmd_prepare_and_execute` is never change after initialising. Therefore, we can remove it safely and return 0 at the end of the function. Signed-off-by: Jason Wang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210803113300.24230-1-wangborong@cdjrlc.com commit 014665ffd7e84bb2f18912f7285190090e218e4c Author: Vladimir Molokov Date: Sun Aug 1 22:59:09 2021 +0200 mtd: rawnand: omap: Fix kernel doc warning on 'calcuate' typo Fix a trivial typo which is reported after enabling W=1 level of warnings: drivers/mtd/nand/raw/omap2.c:927: warning: expecting prototype for omap_calcuate_ecc(). Prototype was for omap_calculate_ecc() instead Signed-off-by: Vladimir Molokov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210801205909.7102-1-vladimir@molokov.se commit df12a75a2be915e7c419707bc71fba0fa7548d81 Author: Daniel Palmer Date: Thu Jun 17 20:08:42 2021 +0900 mtd: spinand: core: Properly fill the OOB area. The comment in spinand_write_to_cache_op() says that spinand_ondie_ecc_prepare_io_req() should 0xff fill the OOB area but it doesn't. This causes the OOB area to get filled with zeros and anytime the first page in a block the bad block marker is cleared and it becomes a bad block on the next boot. This was observed on Longsys FORSEE branded parts and might be specific to these parts. Signed-off-by: Daniel Palmer Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210617110842.2358461-1-daniel@0x0f.com commit 5c2f387b48f063dd8a0c119d3659df8f3e2d88bb Author: Lukas Bulwahn Date: Mon Jul 26 16:49:49 2021 +0200 MAINTAINERS: repair Miquel Raynal's email address Commit d70c6b026069 ("MAINTAINERS: Add PL353 NAND controller entry") and commit 813d52799ad2 ("MAINTAINERS: Add PL353 SMC entry") adds Miquel Raynal as maintainer with an obvious invalid email address, which can be easily fixed. Repair this copy-and-paste error in Miquel Raynal's email address. Signed-off-by: Lukas Bulwahn Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210726144949.10439-1-lukas.bulwahn@gmail.com commit ab23a7768739a23d21d8a16ca37dff96b1ca957a Author: Dave Chinner Date: Fri Aug 6 11:05:39 2021 -0700 xfs: per-cpu deferred inode inactivation queues Move inode inactivation to background work contexts so that it no longer runs in the context that releases the final reference to an inode. This will allow process work that ends up blocking on inactivation to continue doing work while the filesytem processes the inactivation in the background. A typical demonstration of this is unlinking an inode with lots of extents. The extents are removed during inactivation, so this blocks the process that unlinked the inode from the directory structure. By moving the inactivation to the background process, the userspace applicaiton can keep working (e.g. unlinking the next inode in the directory) while the inactivation work on the previous inode is done by a different CPU. The implementation of the queue is relatively simple. We use a per-cpu lockless linked list (llist) to queue inodes for inactivation without requiring serialisation mechanisms, and a work item to allow the queue to be processed by a CPU bound worker thread. We also keep a count of the queue depth so that we can trigger work after a number of deferred inactivations have been queued. The use of a bound workqueue with a single work depth allows the workqueue to run one work item per CPU. We queue the work item on the CPU we are currently running on, and so this essentially gives us affine per-cpu worker threads for the per-cpu queues. THis maintains the effective CPU affinity that occurs within XFS at the AG level due to all objects in a directory being local to an AG. Hence inactivation work tends to run on the same CPU that last accessed all the objects that inactivation accesses and this maintains hot CPU caches for unlink workloads. A depth of 32 inodes was chosen to match the number of inodes in an inode cluster buffer. This hopefully allows sequential allocation/unlink behaviours to defering inactivation of all the inodes in a single cluster buffer at a time, further helping maintain hot CPU and buffer cache accesses while running inactivations. A hard per-cpu queue throttle of 256 inode has been set to avoid runaway queuing when inodes that take a long to time inactivate are being processed. For example, when unlinking inodes with large numbers of extents that can take a lot of processing to free. Signed-off-by: Dave Chinner [djwong: tweak comments and tracepoints, convert opflags to state bits] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67 Author: Darrick J. Wong Date: Fri Aug 6 11:05:39 2021 -0700 xfs: detach dquots from inode if we don't need to inactivate it If we don't need to inactivate an inode, we can detach the dquots and move on to reclamation. This isn't strictly required here; it's a preparation patch for deferred inactivation per reviewer request[1] to move the creation of xfs_inode_needs_inactivation into a separate change. Eventually this !need_inactive chunk will turn into the code path for inodes that skip xfs_inactive and go straight to memory reclaim. [1] https://lore.kernel.org/linux-xfs/20210609012838.GW2945738@locust/T/#mca6d958521cb88bbc1bfe1a30767203328d410b5 Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit c6c2066db3963e519a7ff8f432fcec956f4d23b4 Author: Darrick J. Wong Date: Fri Aug 6 11:05:38 2021 -0700 xfs: move xfs_inactive call to xfs_inode_mark_reclaimable Move the xfs_inactive call and all the other debugging checks and stats updates into xfs_inode_mark_reclaimable because most of that are implementation details about the inode cache. This is preparation for deferred inactivation that is coming up. We also move it around xfs_icache.c in preparation for deferred inactivation. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 0ed17f01c85401abf1706d9825796fc6661c0889 Author: Dave Chinner Date: Fri Aug 6 11:05:38 2021 -0700 xfs: introduce all-mounts list for cpu hotplug notifications The inode inactivation and CIL tracking percpu structures are per-xfs_mount structures. That means when we get a CPU dead notification, we need to then iterate all the per-cpu structure instances to process them. Rather than keeping linked lists of per-cpu structures in each subsystem, add a list of all xfs_mounts that the generic xfs_cpu_dead() function will iterate and call into each subsystem appropriately. This allows us to handle both per-mount and global XFS percpu state from xfs_cpu_dead(), and avoids the need to link subsystem structures that can be easily found from the xfs_mount into their own global lists. Signed-off-by: Dave Chinner [djwong: expand some comments about mount list setup ordering rules] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f1653c2e2831e9db6cd68473bbec581782df03a5 Author: Dave Chinner Date: Fri Aug 6 11:05:37 2021 -0700 xfs: introduce CPU hotplug infrastructure We need to move to per-cpu state for both deferred inode inactivation and CIL tracking, but to do that we need to handle CPUs being removed from the system by the hot-plug code. Introduce generic XFS infrastructure to handle CPU hotplug events that is set up at module init time and torn down at module exit time. Initially, we only need CPU dead notifications, so we only set up a callback for these notifications. The infrastructure can be updated in future for other CPU hotplug state machine notifications easily if ever needed. Signed-off-by: Dave Chinner [djwong: rearrange some macros, fix function prototypes] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 149e53afc851713a70b6a06ebfaf2ebf25975454 Author: Christoph Hellwig Date: Fri Aug 6 11:05:37 2021 -0700 xfs: remove the active vs running quota differentiation These only made a difference when quotaoff supported disabling quota accounting on a mounted file system, so we can switch everyone to use a single set of flags and helpers now. Note that the *QUOTA_ON naming for the helpers is kept as it was the much more commonly used one. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e497dfba6bd7b11856fef4e9e8050de895b7faea Author: Christoph Hellwig Date: Fri Aug 6 11:05:36 2021 -0700 xfs: remove the flags argument to xfs_qm_dquot_walk We always purge all dquots now, so drop the argument. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 777eb1fa857ec38afd518b3adc25cfac0f4af13b Author: Christoph Hellwig Date: Fri Aug 6 11:05:36 2021 -0700 xfs: remove xfs_dqrele_all_inodes xfs_dqrele_all_inodes is unused now, remove it and all supporting code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 40b52225e58cd3adf9358146b4b39dccfbfe5892 Author: Christoph Hellwig Date: Fri Aug 6 11:05:36 2021 -0700 xfs: remove support for disabling quota accounting on a mounted file system Disabling quota accounting is hairy, racy code with all kinds of pitfalls. And it has a very strange mind set, as quota accounting (unlike enforcement) really is a propery of the on-disk format. There is no good use case for supporting this. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9fce3b3a0ab4cad407a27b5e36603c23f1b5b278 Author: Dave Jiang Date: Fri Aug 6 08:36:43 2021 -0700 dmaengine: idxd: remove interrupt flag for completion list spinlock The list lock is never acquired in interrupt context. Therefore there is no need to disable interrupts. Remove interrupt flags for lock operations. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162826417450.3454650.3733188117742416238.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 15cb0321a55e12af6b8456e9ec66a11cb367a673 Author: Andy Shevchenko Date: Mon Aug 2 20:55:32 2021 +0300 dmaengine: acpi: Check for errors from acpi_register_gsi() separately While IRQ test agaist the returned variable in practice is a good enough there is still a room for theoretical mistake in case the vIRQ of the device contains the same error code that acpi_register_gsi() may return. Due to this, check for error code separately from matching the vIRQs. Besides that, append documentation to tell why acpi_gsi_to_irq() can't be used and we call acpi_register_gsi() instead. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210802175532.54311-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 67db87dc8284070adb15b3c02c1c31d5cf51c5d6 Author: Andy Shevchenko Date: Fri Jul 30 23:27:15 2021 +0300 dmaengine: acpi: Avoid comparison GSI with Linux vIRQ Currently the CRST parsing relies on the fact that on most of x86 devices the IRQ mapping is 1:1 with Linux vIRQ. However, it may be not true for some. Fix this by converting GSI to Linux vIRQ before checking it. Fixes: ee8209fd026b ("dma: acpi-dma: parse CSRT to extract additional resources") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210730202715.24375-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 3bfa7d40ce736ffbbfe07127061f54b359ee2b12 Author: Matt Roper Date: Thu Aug 5 09:36:39 2021 -0700 drm/i915/dg2: Add support for new DG2-G11 revid 0x5 The bspec has been updated with a new revision 0x5 that translates to B1 GT stepping and C0 display stepping. Bspec: 44477 Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210805163647.801064-2-matthew.d.roper@intel.com commit 5b68705d1e6340127464ef0ac0e1de94f823f14e Author: Ben Widawsky Date: Fri Jul 16 16:15:47 2021 -0700 cxl/pci: Simplify register setup It is desirable to retain the mappings from the calling function. By simplifying this code, it will be much more straightforward to do that. Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20210716231548.174778-3-ben.widawsky@intel.com Signed-off-by: Dan Williams commit 1e39db573e4cdf798b899de2b1e72ac9bea08013 Author: Ben Widawsky Date: Fri Jul 16 16:15:46 2021 -0700 cxl/pci: Ignore unknown register block types In an effort to explicit avoid supporting vendor specific register blocks (which can happily be mapped from userspace), entirely skip probing unknown types. The secondary benefit of this will be revealed in the future with code simplification. Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20210716231548.174778-2-ben.widawsky@intel.com Signed-off-by: Dan Williams commit 3d135db510240fefd79da46181493d3e3b415f6b Author: Ben Widawsky Date: Mon Aug 2 10:30:05 2021 -0700 cxl/core: Move memdev management to core The motivation for moving cxl_memdev allocation to the core (beyond better file organization of sysfs attributes in core/ and drivers in cxl/), is that device lifetime is longer than module lifetime. The cxl_pci module should be free to come and go without needing to coordinate with devices that need the text associated with cxl_memdev_release() to stay resident. The move fixes a use after free bug when looping driver load / unload with CONFIG_DEBUG_KOBJECT_RELEASE=y. Another motivation for disconnecting cxl_memdev creation from cxl_pci is to enable other drivers, like a unit test driver, to registers memdevs. Fixes: b39cb1052a5c ("cxl/mem: Register CXL memX devices") Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162792540495.368511.9748638751088219595.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 9cc238c7a526dba9ee8c210fa2828886fc65db66 Author: Dan Williams Date: Mon Aug 2 10:29:59 2021 -0700 cxl/pci: Introduce cdevm_file_operations In preparation for moving cxl_memdev allocation to the core, introduce cdevm_file_operations to coordinate file operations shutdown relative to driver data release. The motivation for moving cxl_memdev allocation to the core (beyond better file organization of sysfs attributes in core/ and drivers in cxl/), is that device lifetime is longer than module lifetime. The cxl_pci module should be free to come and go without needing to coordinate with devices that need the text associated with cxl_memdev_release() to stay resident. The move will fix a use after free bug when looping driver load / unload with CONFIG_DEBUG_KOBJECT_RELEASE=y. Another motivation for passing in file_operations to the core cxl_memdev creation flow is to allow for alternate drivers, like unit test code, to define their own ioctl backends. Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162792539962.368511.2962268954245340288.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 0f06157e0135f5563efbc9aadbd93ba3d9322cab Author: Dan Williams Date: Tue Aug 3 07:25:38 2021 -0700 cxl/core: Move register mapping infrastructure The register mapping infrastructure is large enough to move to its own compilation unit. This also cleans up an unnecessary include of core/bus.c. Reported-by: kernel test robot Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162800068975.665205.12895551621746585289.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 06737cd0d216be1cf6e8052e4fca0d391298f184 Author: Dan Williams Date: Mon Aug 2 10:29:49 2021 -0700 cxl/core: Move pmem functionality Refactor the pmem / nvdimm-bridge functionality from core/bus.c to core/pmem.c. Introduce drivers/core/core.h to communicate data structures and helpers between the core bus and other functionality that registers devices on the bus. Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162792538899.368511.3881663908293411300.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 95aaed266801a801add6d17cd3a4f7deb610af2e Author: Ben Widawsky Date: Mon Aug 2 10:29:43 2021 -0700 cxl/core: Improve CXL core kernel docs Now that CXL core's role is well understood, the documentation should reflect that information. Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162792538379.368511.9055351193841619781.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 5161a55c069f53d88da49274cbef6e3c74eadea9 Author: Ben Widawsky Date: Mon Aug 2 10:29:38 2021 -0700 cxl: Move cxl_core to new directory CXL core is growing, and it's already arguably unmanageable. To support future growth, move core functionality to a new directory and rename the file to represent just bus support. Future work will remove non-bus functionality. Note that mem.h is renamed to cxlmem.h to avoid a namespace collision with the global ARCH=um mem.h header. Reported-by: kernel test robot Signed-off-by: Ben Widawsky Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/162792537866.368511.8915631504621088321.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 579345e7f2190c1ee97f44154526dcd458ea790d Author: Andrii Nakryiko Date: Thu Aug 5 16:07:34 2021 -0700 selftests/bpf: Rename reference_tracking BPF programs BPF programs for reference_tracking selftest use "fail_" prefix to notify that they are expected to fail. This is really confusing and inconvenient when trying to grep through test_progs output to find *actually* failed tests. So rename the prefix from "fail_" to "err_". Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210805230734.437914-1-andrii@kernel.org commit 277b134057036df8c657079ca92c3e5e7d10aeaf Author: Jose Blanquicet Date: Thu Aug 5 18:40:36 2021 +0200 selftests/bpf: Fix bpf-iter-tcp4 test to print correctly the dest IP Currently, this test is incorrectly printing the destination port in place of the destination IP. Fixes: 2767c97765cb ("selftests/bpf: Implement sample tcp/tcp6 bpf_iter programs") Signed-off-by: Jose Blanquicet Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210805164044.527903-1-josebl@microsoft.com commit 25423731956b3d72bc35d336227c88ada49148e8 Author: Enric Balletbo i Serra Date: Fri Jun 25 08:24:48 2021 +0200 soc: mediatek: mmsys: Fix missing UFOE component in mt8173 table routing The UFOE (data compression engine) component needs to be enabled to have the imgtec gpu driver working. If we don't enable it we see a black screen. Looks like when we switched to use and array for setting the routing registers in commit 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers") we missed to add this component in the new routing table, it was present before that commit, so fix it by adding this component in the mt8173 routing table. Fixes: 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers") Signed-off-by: Enric Balletbo i Serra Tested-by: Eizan Miyamoto Cc: Link: https://lore.kernel.org/r/20210625062448.3462177-1-enric.balletbo@collabora.com [mb: taking into account mask value] Signed-off-by: Matthias Brugger commit bc3fc5c05100712fa56418f4e3e38f30e6e6f1e7 Author: Fabien Parent Date: Wed May 19 18:18:46 2021 +0200 soc: mediatek: mmsys: add MT8365 support Add DSI mmsys connections for the MT8365 SoC. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20210519161847.3747352-3-fparent@baylibre.com [mb: take the mask field into account] Signed-off-by: Matthias Brugger commit 32bdc01988413031c6e743714c2b40bdd773e5db Author: David Matlack Date: Thu Aug 5 17:28:21 2021 +0000 KVM: selftests: Move vcpu_args_set into perf_test_util perf_test_util is used to set up KVM selftests where vCPUs touch a region of memory. The guest code is implemented in perf_test_util.c (not the calling selftests). The guest code requires a 1 parameter, the vcpuid, which has to be set by calling vcpu_args_set(vm, vcpu_id, 1, vcpu_id). Today all of the selftests that use perf_test_util are making this call. Instead, perf_test_util should just do it. This will save some code but more importantly prevents mistakes since totally non-obvious that this needs to be called and failing to do so results in vCPUs not accessing the right regions of memory. Signed-off-by: David Matlack Message-Id: <20210805172821.2622793-1-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit d803c8b9f3f2b8e5c047f2d0a27a9ea3ef91510f Author: Dave Jiang Date: Tue Aug 3 15:29:30 2021 -0700 dmaengine: idxd: make I/O interrupt handler one shot The interrupt thread handler currently loops forever to process outstanding completions. This causes either an "irq X: nobody cared" kernel splat or the NMI watchdog kicks in due to running too long in the function. The irq thread handler is expected to run again after exiting if there are interrupts fired while the thread handler is running. So the handler code can process all the completed I/O in a single pass and exit without losing the follow on completed I/O. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162802977005.3084234.11836261157026497585.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit bd2f4ae5e019efcfadd6b491204fd60adf14f4a3 Author: Dave Jiang Date: Tue Aug 3 15:37:15 2021 -0700 dmaengine: idxd: clear block on fault flag when clear wq The block on fault flag is not cleared when we disable or reset wq. This causes it to remain set if the user does not clear it on the next configuration load. Add clear of flag in dxd_wq_disable_cleanup() routine. Fixes: da32b28c95a7 ("dmaengine: idxd: cleanup workqueue config after disabling") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162803023553.3086015.8158952172068868803.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 81c2f79c2104c5b48f01da674bc2f7d4bc600db4 Author: Dave Jiang Date: Tue Aug 3 15:32:06 2021 -0700 dmaengine: idxd: add capability check for 'block on fault' attribute The device general capability has a bit that indicate whether 'block on fault' is supported. Add check to wq sysfs knob to check if cap exists before allowing user to toggle. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162802992615.3084999.12539468940404102898.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 4153a7f6440f46261a3004009eaa914914f08055 Author: Marek Vasut Date: Wed Aug 4 21:51:40 2021 +0200 dmaengine: xilinx: Add empty device_config function Various DMA users call the dmaengine_slave_config() and expect it to succeed, but that can only succeed if .device_config is implemented. Add empty device_config function rather than patching all the places which use dmaengine_slave_config(). Signed-off-by: Marek Vasut Cc: Akinobu Mita Cc: Kedareswara rao Appana Cc: Michal Simek Cc: Vinod Koul Link: https://lore.kernel.org/r/20210804195140.61396-1-marex@denx.de Signed-off-by: Vinod Koul commit d6ff82cc1bff97923dfa0640d27271bc220a5004 Author: Andy Shevchenko Date: Mon Aug 2 21:43:55 2021 +0300 dmaengine: dw: Simplify DT property parser Since we converted internal data types to match DT, there is no need to have an intermediate conversion layer, hence drop a few conditionals and for loops for good. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Tested-by: Serge Semin Link: https://lore.kernel.org/r/20210802184355.49879-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 08bf54fcf5ca87328541e035090c6a85c8e064f4 Author: Andy Shevchenko Date: Mon Aug 2 21:43:54 2021 +0300 dmaengine: dw: Convert members to u32 in platform data u32 is a type that is used for properties retrieval from DT. With the type change it allows to clean up properties reading routine. While at it, order the fields in way how they are parsed. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Tested-by: Serge Semin Link: https://lore.kernel.org/r/20210802184355.49879-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit dfa6a2f4c2eab087959faff5a87119c8ff766c74 Author: Andy Shevchenko Date: Mon Aug 2 21:43:53 2021 +0300 dmaengine: dw: Remove error message from DT parsing code Users are a bit frightened of the harmless message that tells that DT is missed on ACPI-based platforms. Remove it for good, it will simplify the future conversion to fwnode and device property APIs. Fixes: a9ddb575d6d6 ("dmaengine: dw_dmac: Enhance device tree support") Depends-on: f5e84eae7956 ("dmaengine: dw: platform: Split OF helpers to separate module") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199379 Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Tested-by: Serge Semin Link: https://lore.kernel.org/r/20210802184355.49879-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 53cbf462f6b5c9de364efdf443ffb74ed082463a Author: Nathan Chancellor Date: Mon Aug 2 10:58:20 2021 -0700 dmaengine: idxd: Remove unused status variable in irq_process_work_list() status is no longer used within this block: drivers/dma/idxd/irq.c:255:6: warning: unused variable 'status' [-Wunused-variable] u8 status = desc->completion->status & DSA_COMP_STATUS_MASK; ^ 1 warning generated. Fixes: b60bb6e2bfc1 ("dmaengine: idxd: fix abort status check") Signed-off-by: Nathan Chancellor Acked-by: Dave Jiang Link: https://lore.kernel.org/r/20210802175820.3153920-1-nathan@kernel.org Signed-off-by: Vinod Koul commit e5c6b312ce3cc97e90ea159446e6bfa06645364d Author: Kevin Hao Date: Thu Aug 5 15:29:17 2021 +0800 cpufreq: schedutil: Use kobject release() method to free sugov_tunables The struct sugov_tunables is protected by the kobject, so we can't free it directly. Otherwise we would get a call trace like this: ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x30 WARNING: CPU: 3 PID: 720 at lib/debugobjects.c:505 debug_print_object+0xb8/0x100 Modules linked in: CPU: 3 PID: 720 Comm: a.sh Tainted: G W 5.14.0-rc1-next-20210715-yocto-standard+ #507 Hardware name: Marvell OcteonTX CN96XX board (DT) pstate: 40400009 (nZcv daif +PAN -UAO -TCO BTYPE=--) pc : debug_print_object+0xb8/0x100 lr : debug_print_object+0xb8/0x100 sp : ffff80001ecaf910 x29: ffff80001ecaf910 x28: ffff00011b10b8d0 x27: ffff800011043d80 x26: ffff00011a8f0000 x25: ffff800013cb3ff0 x24: 0000000000000000 x23: ffff80001142aa68 x22: ffff800011043d80 x21: ffff00010de46f20 x20: ffff800013c0c520 x19: ffff800011d8f5b0 x18: 0000000000000010 x17: 6e6968207473696c x16: 5f72656d6974203a x15: 6570797420746365 x14: 6a626f2029302065 x13: 303378302f307830 x12: 2b6e665f72656d69 x11: ffff8000124b1560 x10: ffff800012331520 x9 : ffff8000100ca6b0 x8 : 000000000017ffe8 x7 : c0000000fffeffff x6 : 0000000000000001 x5 : ffff800011d8c000 x4 : ffff800011d8c740 x3 : 0000000000000000 x2 : ffff0001108301c0 x1 : ab3c90eedf9c0f00 x0 : 0000000000000000 Call trace: debug_print_object+0xb8/0x100 __debug_check_no_obj_freed+0x1c0/0x230 debug_check_no_obj_freed+0x20/0x88 slab_free_freelist_hook+0x154/0x1c8 kfree+0x114/0x5d0 sugov_exit+0xbc/0xc0 cpufreq_exit_governor+0x44/0x90 cpufreq_set_policy+0x268/0x4a8 store_scaling_governor+0xe0/0x128 store+0xc0/0xf0 sysfs_kf_write+0x54/0x80 kernfs_fop_write_iter+0x128/0x1c0 new_sync_write+0xf0/0x190 vfs_write+0x2d4/0x478 ksys_write+0x74/0x100 __arm64_sys_write+0x24/0x30 invoke_syscall.constprop.0+0x54/0xe0 do_el0_svc+0x64/0x158 el0_svc+0x2c/0xb0 el0t_64_sync_handler+0xb0/0xb8 el0t_64_sync+0x198/0x19c irq event stamp: 5518 hardirqs last enabled at (5517): [] console_unlock+0x554/0x6c8 hardirqs last disabled at (5518): [] el1_dbg+0x28/0xa0 softirqs last enabled at (5504): [] __do_softirq+0x4d0/0x6c0 softirqs last disabled at (5483): [] irq_exit+0x1b0/0x1b8 So split the original sugov_tunables_free() into two functions, sugov_clear_global_tunables() is just used to clear the global_tunables and the new sugov_tunables_free() is used as kobj_type::release to release the sugov_tunables safely. Fixes: 9bdcb44e391d ("cpufreq: schedutil: New governor based on scheduler utilization data") Cc: 4.7+ # 4.7+ Signed-off-by: Kevin Hao Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 7fcc17d0cb12938d2b3507973a6f93fc9ed2c7a1 Author: Lukasz Luba Date: Tue Aug 3 11:27:43 2021 +0100 PM: EM: Increase energy calculation precision The Energy Model (EM) provides useful information about device power in each performance state to other subsystems like: Energy Aware Scheduler (EAS). The energy calculation in EAS does arithmetic operation based on the EM em_cpu_energy(). Current implementation of that function uses em_perf_state::cost as a pre-computed cost coefficient equal to: cost = power * max_frequency / frequency. The 'power' is expressed in milli-Watts (or in abstract scale). There are corner cases when the EAS energy calculation for two Performance Domains (PDs) return the same value. The EAS compares these values to choose smaller one. It might happen that this values are equal due to rounding error. In such scenario, we need better resolution, e.g. 1000 times better. To provide this possibility increase the resolution in the em_perf_state::cost for 64-bit architectures. The cost of increasing resolution on 32-bit is pretty high (64-bit division) and is not justified since there are no new 32bit big.LITTLE EAS systems expected which would benefit from this higher resolution. This patch allows to avoid the rounding to milli-Watt errors, which might occur in EAS energy estimation for each PD. The rounding error is common for small tasks which have small utilization value. There are two places in the code where it makes a difference: 1. In the find_energy_efficient_cpu() where we are searching for best_delta. We might suffer there when two PDs return the same result, like in the example below. Scenario: Low utilized system e.g. ~200 sum_util for PD0 and ~220 for PD1. There are quite a few small tasks ~10-15 util. These tasks would suffer for the rounding error. These utilization values are typical when running games on Android. One of our partners has reported 5..10mA less battery drain when running with increased resolution. Some details: We have two PDs: PD0 (big) and PD1 (little) Let's compare w/o patch set ('old') and w/ patch set ('new') We are comparing energy w/ task and w/o task placed in the PDs a) 'old' w/o patch set, PD0 task_util = 13 cost = 480 sum_util_w/o_task = 215 sum_util_w_task = 228 scale_cpu = 1024 energy_w/o_task = 480 * 215 / 1024 = 100.78 => 100 energy_w_task = 480 * 228 / 1024 = 106.87 => 106 energy_diff = 106 - 100 = 6 (this is equal to 'old' PD1's energy_diff in 'c)') b) 'new' w/ patch set, PD0 task_util = 13 cost = 480 * 1000 = 480000 sum_util_w/o_task = 215 sum_util_w_task = 228 energy_w/o_task = 480000 * 215 / 1024 = 100781 energy_w_task = 480000 * 228 / 1024 = 106875 energy_diff = 106875 - 100781 = 6094 (this is not equal to 'new' PD1's energy_diff in 'd)') c) 'old' w/o patch set, PD1 task_util = 13 cost = 160 sum_util_w/o_task = 283 sum_util_w_task = 293 scale_cpu = 355 energy_w/o_task = 160 * 283 / 355 = 127.55 => 127 energy_w_task = 160 * 296 / 355 = 133.41 => 133 energy_diff = 133 - 127 = 6 (this is equal to 'old' PD0's energy_diff in 'a)') d) 'new' w/ patch set, PD1 task_util = 13 cost = 160 * 1000 = 160000 sum_util_w/o_task = 283 sum_util_w_task = 293 scale_cpu = 355 energy_w/o_task = 160000 * 283 / 355 = 127549 energy_w_task = 160000 * 296 / 355 = 133408 energy_diff = 133408 - 127549 = 5859 (this is not equal to 'new' PD0's energy_diff in 'b)') 2. Difference in the 6% energy margin filter at the end of find_energy_efficient_cpu(). With this patch the margin comparison also has better resolution, so it's possible to have better task placement thanks to that. Fixes: 27871f7a8a341ef ("PM: Introduce an Energy Model management framework") Reported-by: CCJ Yeh Reviewed-by: Dietmar Eggemann Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit de0534df93474f268486c486ea7e01b44a478026 Author: Srinivas Kandagatla Date: Fri Aug 6 09:59:47 2021 +0100 nvmem: core: fix error handling while validating keepout regions Current error path on failure of validating keepout regions is calling put_device, eventhough the device is not even registered at that point. Fix this by adding proper error handling of freeing ida and nvmem. Fixes: fd3bb8f54a88 ("nvmem: core: Add support for keepout regions") Cc: Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806085947.22682-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7b808449f572d07bee840cd9da7e2fe6a1b8f4b5 Author: Rajendra Nayak Date: Fri Aug 6 09:59:46 2021 +0100 nvmem: qfprom: sc7280: Handle the additional power-domains vote On sc7280, to reliably blow fuses, we need an additional vote on max performance state of 'MX' power-domain. Add support for power-domain performance state voting in the driver. Reviewed-by: Douglas Anderson Signed-off-by: Rajendra Nayak Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806085947.22682-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 11c4b3e264d68ba6dcd52d12dbcfd3f564f2f137 Author: Rajendra Nayak Date: Fri Aug 6 09:59:45 2021 +0100 nvmem: qfprom: Fix up qfprom_disable_fuse_blowing() ordering qfprom_disable_fuse_blowing() disables a bunch of resources, and then does a few register writes in the 'conf' address space. It works perhaps because the resources are needed only for the 'raw' register space writes, and that the 'conf' space allows read/writes regardless. However that makes the code look confusing, so just move the register writes before turning off the resources in the function. Reviewed-by: Douglas Anderson Signed-off-by: Rajendra Nayak Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806085947.22682-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit cca5644c05220df7e9f9d973fa57060cf4b0ddb5 Author: Rajendra Nayak Date: Fri Aug 6 09:59:44 2021 +0100 dt-bindings: nvmem: qfprom: Add optional power-domains property qfprom devices on some SoCs need to vote on the performance state of a power-domain, so add the power-domains optional property to the bindings Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Rajendra Nayak Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806085947.22682-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2a8faf8dfd7da3c8234f36bc72fd027a5a64db8a Author: Michal Simek Date: Fri Aug 6 12:32:36 2021 +0200 firmware: xilinx: Fix incorrect names in kernel-doc There are some c&p issues reported by kernel-doc as: drivers/firmware/xilinx/zynqmp.c:676: warning: expecting prototype for zynqmp_pm_write_ggs(). Prototype was for zynqmp_pm_read_ggs() instead drivers/firmware/xilinx/zynqmp.c:710: warning: expecting prototype for zynqmp_pm_write_pggs(). Prototype was for zynqmp_pm_read_pggs() instead drivers/firmware/xilinx/zynqmp.c:1023: warning: expecting prototype for zynqmp_pm_aes(). Prototype was for zynqmp_pm_aes_engine() instead Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/a81edd4fc6cff4bd7e4984fceda941b9e9ab01bf.1628245954.git.michal.simek@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 23fd679249df82b57390c8f4f0f290fd1f7b3505 Author: Baruch Siach Date: Wed Aug 4 17:05:06 2021 +0300 phy: qcom-qmp: add USB3 PHY support for IPQ6018 Initialization is identical to the IPQ8074 USB3 PHY. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/6eec7ef4ecd1e8360ebe8e425151121684e997ed.1628085910.git.baruch@tkos.co.il Signed-off-by: Vinod Koul commit 2433ab638f10b6ca94416df501bc8cb24589c6a8 Author: Baruch Siach Date: Wed Aug 4 17:05:05 2021 +0300 dt-bindings: phy: qcom,qmp: Add IPQ6018 USB3 PHY Add compatible string for USB3 PHY in Qualcomm IPQ6018 SoC. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/3d86f45004fe2fcbae0a2cd197df81a1fd076a1e.1628085910.git.baruch@tkos.co.il Signed-off-by: Vinod Koul commit 5e10f9887ed85d4f59266d5c60dd09be96b5dbd4 Author: Will Deacon Date: Fri Aug 6 12:31:04 2021 +0100 arm64: mm: Fix TLBI vs ASID rollover When switching to an 'mm_struct' for the first time following an ASID rollover, a new ASID may be allocated and assigned to 'mm->context.id'. This reassignment can happen concurrently with other operations on the mm, such as unmapping pages and subsequently issuing TLB invalidation. Consequently, we need to ensure that (a) accesses to 'mm->context.id' are atomic and (b) all page-table updates made prior to a TLBI using the old ASID are guaranteed to be visible to CPUs running with the new ASID. This was found by inspection after reviewing the VMID changes from Shameer but it looks like a real (yet hard to hit) bug. Cc: Cc: Marc Zyngier Cc: Jade Alglave Cc: Shameer Kolothum Signed-off-by: Will Deacon Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210806113109.2475-2-will@kernel.org Signed-off-by: Catalin Marinas commit 146af22649020e6b163482bc66150683ebf893bf Author: mark-yw.chen Date: Fri Aug 6 09:35:16 2021 +0800 Bluetooth: btusb: Fix fall-through warnings Fix fall-through warnings: drivers/bluetooth/btusb.c: In function ‘btusb_recv_acl_mtk’: drivers/bluetooth/btusb.c:4033:3: warning: this statement may fall through [-Wimplicit-fallthrough=] 4033 | usb_disable_autosuspend(data->udev); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/bluetooth/btusb.c:4034:2: note: here 4034 | case 0x05ff: /* Firmware debug logging 1 */ | ^~~~ Signed-off-by: mark-yw.chen Signed-off-by: Marcel Holtmann commit b0512a6ec0cd6dcea659d834592bbcb0cae127a4 Author: Biju Das Date: Tue Jul 27 19:55:24 2021 +0100 phy: renesas: phy-rcar-gen3-usb2: Add USB2.0 PHY support for RZ/G2L This patch adds USB2.0 PHY support for RZ/G2L SoC. We need to use a different compatible string due to some differences with R-Car Gen3 USB2.0 PHY. It uses line ctrl register for OTG_ID pin changes and different OTG-BC interrupt bit for device recognition. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda # on R-Car Link: https://lore.kernel.org/r/20210727185527.19907-4-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit 5711af410c28d2b9c99a91e8e6fe9ba6520771f0 Author: Biju Das Date: Tue Jul 27 19:55:23 2021 +0100 dt-bindings: phy: renesas,usb2-phy: Document RZ/G2L phy bindings Document USB phy bindings for RZ/G2L SoC. RZ/G2L USB2.0 phy uses line ctrl register for OTG_ID pin changes. It uses a different OTG-BC interrupt bit for device recognition. Apart from this, the PHY reset is controlled by USBPHY control IP and Document reset is a required property. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Yoshihiro Shimoda Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210727185527.19907-3-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit f4dddf90d58d77b48492b775868af4041a217f4c Author: Quentin Perret Date: Thu Aug 5 11:21:54 2021 +0100 sched: Skip priority checks with SCHED_FLAG_KEEP_PARAMS SCHED_FLAG_KEEP_PARAMS can be passed to sched_setattr to specify that the call must not touch scheduling parameters (nice or priority). This is particularly handy for uclamp when used in conjunction with SCHED_FLAG_KEEP_POLICY as that allows to issue a syscall that only impacts uclamp values. However, sched_setattr always checks whether the priorities and nice values passed in sched_attr are valid first, even if those never get used down the line. This is useless at best since userspace can trivially bypass this check to set the uclamp values by specifying low priorities. However, it is cumbersome to do so as there is no single expression of this that skips both RT and CFS checks at once. As such, userspace needs to query the task policy first with e.g. sched_getattr and then set sched_attr.sched_priority accordingly. This is racy and slower than a single call. As the priority and nice checks are useless when SCHED_FLAG_KEEP_PARAMS is specified, simply inherit them in this case to match the policy inheritance of SCHED_FLAG_KEEP_POLICY. Reported-by: Wei Wang Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Qais Yousef Link: https://lore.kernel.org/r/20210805102154.590709-3-qperret@google.com commit ca4984a7dd863f3e1c0df775ae3e744bff24c303 Author: Quentin Perret Date: Thu Aug 5 11:21:53 2021 +0100 sched: Fix UCLAMP_FLAG_IDLE setting The UCLAMP_FLAG_IDLE flag is set on a runqueue when dequeueing the last uclamp active task (that is, when buckets.tasks reaches 0 for all buckets) to maintain the last uclamp.max and prevent blocked util from suddenly becoming visible. However, there is an asymmetry in how the flag is set and cleared which can lead to having the flag set whilst there are active tasks on the rq. Specifically, the flag is cleared in the uclamp_rq_inc() path, which is called at enqueue time, but set in uclamp_rq_dec_id() which is called both when dequeueing a task _and_ in the update_uclamp_active() path. As a result, when both uclamp_rq_{dec,ind}_id() are called from update_uclamp_active(), the flag ends up being set but not cleared, hence leaving the runqueue in a broken state. Fix this by clearing the flag in update_uclamp_active() as well. Fixes: e496187da710 ("sched/uclamp: Enforce last task's UCLAMP_MAX") Reported-by: Rick Yiu Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Qais Yousef Tested-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20210805102154.590709-2-qperret@google.com commit b4da13aa28d4fd0071247b7b41c579ee8a86c81a Author: Dietmar Eggemann Date: Wed Aug 4 15:59:25 2021 +0200 sched/deadline: Fix missing clock update in migrate_task_rq_dl() A missing clock update is causing the following warning: rq->clock_update_flags < RQCF_ACT_SKIP WARNING: CPU: 112 PID: 2041 at kernel/sched/sched.h:1453 sub_running_bw.isra.0+0x190/0x1a0 ... CPU: 112 PID: 2041 Comm: sugov:112 Tainted: G W 5.14.0-rc1 #1 Hardware name: WIWYNN Mt.Jade Server System B81.030Z1.0007/Mt.Jade Motherboard, BIOS 1.6.20210526 (SCP: 1.06.20210526) 2021/05/26 ... Call trace: sub_running_bw.isra.0+0x190/0x1a0 migrate_task_rq_dl+0xf8/0x1e0 set_task_cpu+0xa8/0x1f0 try_to_wake_up+0x150/0x3d4 wake_up_q+0x64/0xc0 __up_write+0xd0/0x1c0 up_write+0x4c/0x2b0 cppc_set_perf+0x120/0x2d0 cppc_cpufreq_set_target+0xe0/0x1a4 [cppc_cpufreq] __cpufreq_driver_target+0x74/0x140 sugov_work+0x64/0x80 kthread_worker_fn+0xe0/0x230 kthread+0x138/0x140 ret_from_fork+0x10/0x18 The task causing this is the `cppc_fie` DL task introduced by commit 1eb5dde674f5 ("cpufreq: CPPC: Add support for frequency invariance"). With CONFIG_ACPI_CPPC_CPUFREQ_FIE=y and schedutil cpufreq governor on slow-switching system (like on this Ampere Altra WIWYNN Mt. Jade Arm Server): DL task `curr=sugov:112` lets `p=cppc_fie` migrate and since the latter is in `non_contending` state, migrate_task_rq_dl() calls sub_running_bw()->__sub_running_bw()->cpufreq_update_util()-> rq_clock()->assert_clock_updated() on p. Fix this by updating the clock for a non_contending task in migrate_task_rq_dl() before calling sub_running_bw(). Reported-by: Bruno Goncalves Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20210804135925.3734605-1-dietmar.eggemann@arm.com commit b70ee49c98d0e550b324afe869d3d17fec6190f5 Author: Kishon Vijay Abraham I Date: Fri Jul 23 19:26:05 2021 +0530 dt-bindings: phy: Convert AM654 SERDES bindings to YAML Convert SERDES dt-bindings for TI's AM654 SoC to YAML binding. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210723135605.23572-1-kishon@ti.com Signed-off-by: Vinod Koul commit 1633802cd4ac338554ec94cd4d46ac5ef322aa49 Author: Bjorn Andersson Date: Wed Jul 21 15:56:30 2021 -0700 phy: qcom: qmp: Add SC8180x USB/DP combo The two USB QMPs are USB/DP compbo PHYs, add the compatible for this combination to allow DP output. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210721225630.3035861-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 1a00d130596f863243b1a0aa527dd66ecee70065 Author: Bjorn Andersson Date: Wed Jul 21 15:56:29 2021 -0700 dt-bindings: phy: qcom,qmp-usb3-dp: Add support for sc8180x The SC8180x has two instances of the QMP USB/DP combo PHYs, add a compatible for these. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210721225630.3035861-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit e184b1e589a7fbb80bfdd0364c11422999a17a26 Author: David E. Box Date: Tue Jul 27 09:49:28 2021 -0700 platform/x86/intel: Move Intel PMT drivers to new subfolder Move all Intel Platform Monitoring Technology drivers to drivers/platform/x86/intel/pmt. Signed-off-by: David E. Box Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210727164928.3171521-1-david.e.box@linux.intel.com Signed-off-by: Hans de Goede commit 7481f91f1d7e8a004f19b55747d38a934119abe2 Author: Tony Lindgren Date: Tue Jul 27 13:45:12 2021 +0300 phy: phy-twl4030-usb: Disable PHY for suspend Since commit 88d26136a256 ("PM: Prevent runtime suspend during system resume"), PM runtime will not let devices idle during system suspend. This is because of the pm_runtime_get_noresume() call done in device_prepare() that is not released until at device_complete() after resume. We must now disable the USB PHY in suspend if no USB cable is connected. Cc: Andreas Kemnade Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727104512.52968-1-tony@atomide.com Signed-off-by: Vinod Koul commit a69f29cb50a0069f3442c08fcf21fad55d48f4d2 Author: Chunfeng Yun Date: Fri Jul 23 16:22:42 2021 +0800 phy: phy-mtk-tphy: add support mt8195 The controller is designed to use use PLL integer mode, but in fact used fractional mode for some ones on mt8195, this causes signal degradation (e.g. eye diagram test fail), fix it by switching PLL to 26Mhz from default 48Mhz to improve signal quality. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1627028562-23584-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 27974e6208c0c44f89e76fc65ad67f9bc1c279a6 Author: Chunfeng Yun Date: Fri Jul 23 16:22:41 2021 +0800 phy: phy-mtk-tphy: support new hardware version The PHYA arch is updated, and doesn't support slew rate calibrate anymore on 7nm or advanced process, add a new version number to support it. Note: the FreqMeter bank is not used but reserved. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1627028562-23584-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit c52c90dbcb8c2676dab22cb21c0f0c5da527dfd3 Author: Chunfeng Yun Date: Fri Jul 23 16:22:40 2021 +0800 dt-bindings: phy: mediatek: tphy: add support hardware version 3 The PHYA architecture is updated, and doesn't support slew rate calibration anymore on 7nm or advanced process, add a new version number to support it. Due to the FreqMeter bank is not used but reserved, it's backward with v2 until now. For mt8195, no function changes when use generic v2 or v3 compatible, but prefer to use v3's compatible, it will not waste the time to calibrate the slew rate, and also correspond with hardware version. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1627028562-23584-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 609e6202ea5f4ab5fa6f6bed9da5594e3e94c570 Author: David Matlack Date: Wed Aug 4 22:28:44 2021 +0000 KVM: selftests: Support multiple slots in dirty_log_perf_test Introduce a new option to dirty_log_perf_test: -x number_of_slots. This causes the test to attempt to split the region of memory into the given number of slots. If the region cannot be evenly divided, the test will fail. This allows testing with more than one slot and therefore measure how performance scales with the number of memslots. Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-8-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 93e083d4f4bfe790eb1cdc87103bd6a84be9df75 Author: David Matlack Date: Wed Aug 4 22:28:43 2021 +0000 KVM: x86/mmu: Rename __gfn_to_rmap to gfn_to_rmap gfn_to_rmap was removed in the previous patch so there is no need to retain the double underscore on __gfn_to_rmap. Reviewed-by: Paolo Bonzini Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-7-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 601f8af01e5ae535b45cdb91234887c9fd861ad4 Author: David Matlack Date: Wed Aug 4 22:28:42 2021 +0000 KVM: x86/mmu: Leverage vcpu->last_used_slot for rmap_add and rmap_recycle rmap_add() and rmap_recycle() both run in the context of the vCPU and thus we can use kvm_vcpu_gfn_to_memslot() to look up the memslot. This enables rmap_add() and rmap_recycle() to take advantage of vcpu->last_used_slot and avoid expensive memslot searching. This change improves the performance of "Populate memory time" in dirty_log_perf_test with tdp_mmu=N. In addition to improving the performance, "Populate memory time" no longer scales with the number of memslots in the VM. Command | Before | After ------------------------------- | ---------------- | ------------- ./dirty_log_perf_test -v64 -x1 | 15.18001570s | 14.99469366s ./dirty_log_perf_test -v64 -x64 | 18.71336392s | 14.98675076s Reviewed-by: Paolo Bonzini Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-6-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 081de470f1e6e83f9f460ba5ae8f57ff07f37692 Author: David Matlack Date: Wed Aug 4 22:28:41 2021 +0000 KVM: x86/mmu: Leverage vcpu->last_used_slot in tdp_mmu_map_handle_target_level The existing TDP MMU methods to handle dirty logging are vcpu-agnostic since they can be driven by MMU notifiers and other non-vcpu-specific events in addition to page faults. However this means that the TDP MMU is not benefiting from the new vcpu->last_used_slot. Fix that by introducing a tdp_mmu_map_set_spte_atomic() which is only called during a TDP page fault and has access to the kvm_vcpu for fast slot lookups. This improves "Populate memory time" in dirty_log_perf_test by 5%: Command | Before | After ------------------------------- | ---------------- | ------------- ./dirty_log_perf_test -v64 -x64 | 5.472321072s | 5.169832886s Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-5-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit fe22ed827c5b60b895b15c5c3f04e04ac606be38 Author: David Matlack Date: Wed Aug 4 22:28:40 2021 +0000 KVM: Cache the last used slot index per vCPU The memslot for a given gfn is looked up multiple times during page fault handling. Avoid binary searching for it multiple times by caching the most recently used slot. There is an existing VM-wide last_used_slot but that does not work well for cases where vCPUs are accessing memory in different slots (see performance data below). Another benefit of caching the most recently use slot (versus looking up the slot once and passing around a pointer) is speeding up memslot lookups *across* faults and during spte prefetching. To measure the performance of this change I ran dirty_log_perf_test with 64 vCPUs and 64 memslots and measured "Populate memory time" and "Iteration 2 dirty memory time". Tests were ran with eptad=N to force dirty logging to use fast_page_fault so its performance could be measured. Config | Metric | Before | After ---------- | ----------------------------- | ------ | ------ tdp_mmu=Y | Populate memory time | 6.76s | 5.47s tdp_mmu=Y | Iteration 2 dirty memory time | 2.83s | 0.31s tdp_mmu=N | Populate memory time | 20.4s | 18.7s tdp_mmu=N | Iteration 2 dirty memory time | 2.65s | 0.30s The "Iteration 2 dirty memory time" results are especially compelling because they are equivalent to running the same test with a single memslot. In other words, fast_page_fault performance no longer scales with the number of memslots. Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 0f22af940dc8ec4f437189096a5f8677995323b0 Author: David Matlack Date: Wed Aug 4 22:28:39 2021 +0000 KVM: Move last_used_slot logic out of search_memslots Make search_memslots unconditionally search all memslots and move the last_used_slot logic up one level to __gfn_to_memslot. This is in preparation for introducing a per-vCPU last_used_slot. As part of this change convert existing callers of search_memslots to __gfn_to_memslot to avoid making any functional changes. Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 87689270b10fa9e6fac7242233b355cb6792b845 Author: David Matlack Date: Wed Aug 4 22:28:38 2021 +0000 KVM: Rename lru_slot to last_used_slot lru_slot is used to keep track of the index of the most-recently used memslot. The correct acronym would be "mru" but that is not a common acronym. So call it last_used_slot which is a bit more obvious. Suggested-by: Paolo Bonzini Signed-off-by: David Matlack Message-Id: <20210804222844.1419481-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 07e97f744c3bb9249e72e634f713d665436ffd72 Author: Randy Dunlap Date: Thu Jul 22 19:25:48 2021 -0700 phy: qualcomm: phy-qcom-usb-hs: repair non-kernel-doc comment Fix errant use of "/**" to begin a comment although the comment is not kernel-doc notation. Just use "/*" instead. Fixes this kernel-doc warning: drivers/phy/qualcomm/phy-qcom-usb-hs.c:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Copyright (C) 2016 Linaro Ltd Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Andy Gross Cc: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: linux-phy@lists.infradead.org Link: https://lore.kernel.org/r/20210723022548.25695-1-rdunlap@infradead.org Signed-off-by: Vinod Koul commit 0888d04b47a165ae8c429c6fe11b3c43f5017f31 Author: Andre Przywara Date: Sat Jul 31 21:48:45 2021 +0100 hwrng: Add Arm SMCCC TRNG based driver The "Arm True Random Number Generator Firmware Interface"[1] provides an SMCCC based interface to a true hardware random number generator. So far we are using that in arch_get_random_seed(), but it might be useful to expose the entropy through the /dev/hwrng device as well. This allows to assess the quality of the implementation, by using "rngtest" from the rng-tools package, for example. Add a simple platform driver implementing the hw_random interface. The corresponding platform device is created by the SMCCC core code, we just match it here by name and provide a module alias. Since the firmware takes care about serialisation, this can happily coexist with the arch_get_random_seed() bits. [1] https://developer.arm.com/documentation/den0098/latest/ Signed-off-by: Andre Przywara Reviewed-by: Ard Biesheuvel Reviewed-by: Mark Brown Signed-off-by: Herbert Xu commit b83c2d92be719bf7b1d24ac02aaa53db3991ea58 Author: Andre Przywara Date: Sat Jul 31 21:48:44 2021 +0100 firmware: smccc: Register smccc_trng platform device At the moment we probe for the Random Number Generator SMCCC service, and use that in the core code (arch_get_random). However the hardware entropy can also be useful to access from userland, and be it to assess its quality. Register a platform device when the SMCCC TRNG service is detected, to allow a hw_random driver to hook onto this. The function registering the device is deliberately made in a way which allows expansion, so other services that could be exposed via a platform device (or some other interface), can be added here easily. Signed-off-by: Andre Przywara Reviewed-by: Ard Biesheuvel Reviewed-by: Mark Brown Signed-off-by: Herbert Xu commit 5441a07a127f106c9936e4f9fa1a8a93e3f31828 Author: Brijesh Singh Date: Wed Jul 28 10:15:21 2021 -0500 crypto: ccp - shutdown SEV firmware on kexec The commit 97f9ac3db6612 ("crypto: ccp - Add support for SEV-ES to the PSP driver") added support to allocate Trusted Memory Region (TMR) used during the SEV-ES firmware initialization. The TMR gets locked during the firmware initialization and unlocked during the shutdown. While the TMR is locked, access to it is disallowed. Currently, the CCP driver does not shutdown the firmware during the kexec reboot, leaving the TMR memory locked. Register a callback to shutdown the SEV firmware on the kexec boot. Fixes: 97f9ac3db6612 ("crypto: ccp - Add support for SEV-ES to the PSP driver") Reported-by: Lucas Nussbaum Tested-by: Lucas Nussbaum Cc: Cc: Tom Lendacky Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Signed-off-by: Brijesh Singh Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 1dd0d7fe4b7a50f3a9580e994060e8a8a1c3263e Author: Tony Lindgren Date: Tue Jul 27 13:23:39 2021 +0300 crypto: omap-sham - drop pm_runtime_irqsafe() usage Commit b0a3d8986a76 ("crypto: omap-sham - Use pm_runtime_irq_safe()") added the use of pm_runtime_irq_safe() as pm_runtime_get_sync() was called from a tasklet. We now use the crypto engine queue instead of a custom queue since commit 33c3d434d91 ("crypto: omap-sham - convert to use crypto engine"). We want to drop the use of pm_runtime_irq_safe() in general as it takes a permanent usage count on the parent device causing issues for power management. Based on testing with CONFIG_DEBUG_ATOMIC_SLEEP=y, modprobe omap-sham, followed by modprobe tcrypt sec=1 mode=423, I have not been able to reproduce the scheduling while atomic issue seen earlier with current kernels and we can just drop the call to pm_runtime_irq_safe(). Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit 70c68d163986985a41fb86979d379212e11f007f Author: Tony Lindgren Date: Tue Jul 27 13:23:38 2021 +0300 crypto: omap-sham - drop suspend and resume functions Let's get rid of the suspend and resume calls to runtime PM as these calls do not idle the hardware. The runtime suspend has been disabled for system suspend since commit 88d26136a256 ("PM: Prevent runtime suspend during system resume"). Instead of runtime PM, the system suspend and resume functions should call driver internal shared functions to idle the hardware as needed. Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit f23f2186a4d0c9ff681bcf00e02575c0712f8fb5 Author: Tony Lindgren Date: Tue Jul 27 13:23:37 2021 +0300 crypto: omap-sham - drop old hw_init and unused FLAGS_INIT FLAGS_INIT is now unused and we can just use standard runtime PM functions instead. Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit f83fc1a0ee322d6577eca2bb6a3275245de7fccc Author: Tony Lindgren Date: Tue Jul 27 13:23:36 2021 +0300 crypto: omap-sham - add missing pm_runtime_dontuse_autosuspend() We should pair the usage of pm_runtime_use_autosuspend() with pm_runtime_dont_use_autosuspend(). Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit 6a1ec89f2c56da9c2bd0afedb48268dde086d729 Author: Tony Lindgren Date: Tue Jul 27 13:23:35 2021 +0300 crypto: omap-sham - initialize req only after omap_sham_hw_init() Let's only initialize dd->req after omap_sham_hw_init() in case of errors. Looks like leaving dd->req initialized on omap_sham_hw_init() errors is is not causing issues though as we return on errors. So this patch can be applied as clean-up. Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit fe28140b3393b0ba1eb95cc109f974a7e58b26fd Author: Tony Lindgren Date: Tue Jul 27 13:23:34 2021 +0300 crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() We should not clear FLAGS_DMA_ACTIVE before omap_sham_update_dma_stop() is done calling dma_unmap_sg(). We already clear FLAGS_DMA_ACTIVE at the end of omap_sham_update_dma_stop(). The early clearing of FLAGS_DMA_ACTIVE is not causing issues as we do not need to defer anything based on FLAGS_DMA_ACTIVE currently. So this can be applied as clean-up. Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Herbert Xu commit 88d8175ad8badc74d0d53308dbbbf65b1eb0cebb Author: Dong Aisheng Date: Thu Jul 15 16:25:33 2021 +0800 dt-bindings: phy: imx8mq-usb-phy: convert to json schema Convert to jason schema. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Rob Herring Cc: Li Jun Cc: linux-phy@lists.infradead.org Signed-off-by: Dong Aisheng Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210715082536.1882077-5-aisheng.dong@nxp.com Signed-off-by: Vinod Koul commit 1716e49eb8b4478e8952ce9206f1974c3e842e1f Author: kernel test robot Date: Wed Jun 23 16:23:30 2021 +0200 phy: rockchip-inno-usb2: fix for_each_child.cocci warnings For_each_available_child_of_node should have of_node_put() before break around line 1184. The other jumps out of the loop do contain the put. Generated by: scripts/coccinelle/iterators/for_each_child.cocci CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2106231617540.99238@hadrien Signed-off-by: Vinod Koul commit 8fbebef80107d779b8e356cf60323454a4099d76 Author: DENG Qingfang Date: Fri Aug 6 11:47:11 2021 +0800 net: dsa: mt7530: drop untagged frames on VLAN-aware ports without PVID The driver currently still accepts untagged frames on VLAN-aware ports without PVID. Use PVC.ACC_FRM to drop untagged frames in that case. Signed-off-by: DENG Qingfang Signed-off-by: David S. Miller commit 96ba6c6e8922e89ca4908c650072d8f8d7b39cbc Merge: 112cedc8e600b f06aff924f975 Author: Greg Kroah-Hartman Date: Fri Aug 6 13:05:28 2021 +0200 Merge tag 'sysfs_defferred_iomem_get_mapping-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core driver-core-next sysfs: Allow deferred execution of iomem_get_mapping() Tag for toerh trees/branches to pull from in order to have a stable base to build off of for the "Allow deferred execution of iomem_get_mapping()" set of sysfs changes Link: https://lore.kernel.org/r/20210729233235.1508920-1-kw@linux.com Signed-off-by: Greg Kroah-Hartman * tag 'sysfs_defferred_iomem_get_mapping-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: sysfs: Rename struct bin_attribute member to f_mapping sysfs: Invoke iomem_get_mapping() from the sysfs open callback commit 7d066dc73929d5b14501a47ae9cad4f49fe22abc Author: Xin Ji Date: Fri Aug 6 18:44:07 2021 +0800 drm/bridge: anx7625: Tune K value for IVO panel IVO panel require less input video clock variation than video clock variation in DP CTS spec. This patch decreases the K value of ANX7625 which will shrink eDP Tx video clock variation to meet IVO panel's requirement. Acked-by: Sam Ravnborg Signed-off-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210806104407.2208538-1-xji@analogixsemi.com commit c387eea58f931fe5d008df88cc75dfc3c704e3bf Author: Michael Walle Date: Wed Jun 16 17:54:37 2021 +0200 ARM: dts: ebaz4205: enable NAND support The board features a 128MiB NAND chip and recently linux gained support for the NAND controller on the Zynq SoC. Thus add the corresponding devicetree nodes. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20210616155437.27378-4-michael@walle.cc Signed-off-by: Michal Simek commit 3bf9899f87d8709f55138ccbec30b3339b42be56 Author: Michael Walle Date: Wed Jun 16 17:54:36 2021 +0200 ARM: dts: zynq: add NAND flash controller node Recently, a driver for the ARM Primecell PL35x static memory controller (including NAND controller) was added in linux. Add the corresponding device tree node. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20210616155437.27378-3-michael@walle.cc Signed-off-by: Michal Simek commit 75b4c5deef011c7d7b1e23b623455185d60e72a2 Author: Michael Walle Date: Wed Jun 16 17:54:35 2021 +0200 ARM: configs: multi_v7: enable PL35x NAND controller After years, linux finally got a driver for the PL35x NAND controller found on the Xilinx Zynq-7000 SoC for example. Enable support for this driver. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20210616155437.27378-2-michael@walle.cc Signed-off-by: Michal Simek commit ede3241a5f235811b1e66f56cf8fbdfd01266efb Author: Mark Brown Date: Wed Aug 4 19:17:10 2021 +0100 arm64: entry: Add SYM_CODE annotation for __bad_stack When converting arm64 to modern assembler annotations __bad_stack was left as a raw local label without annotations. While this will have little if any practical impact at present it may cause issues in the future if we start using the annotations for things like reliable stack trace. Add SYM_CODE annotations to fix this. Signed-off-by: Mark Brown Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210804181710.19059-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9b9311af4e8657be85bb1d083c531cfb6afb0d9c Merge: 3bacbe04251b7 c73c57081b3d5 Author: David S. Miller Date: Fri Aug 6 11:11:13 2021 +0100 Merge branch 'dsa-cpu-flood' Vladimir Oltean says: ==================== Always flood multicast to the DSA CPU port Discussing with Qingfang, it became obvious that DSA is not prepared to disable multicast flooding towards the CPU port under any circumstance right now, and this in fact breaks traffic quite blatantly. This series is a revert done in reverse chronological order. These should be propagated to stable trees up to commit a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") which is in v5.12. For older kernels, that commit blocks further backporting, so I need to send a modified version of patch 3 separately to Greg after these go into "net". v1->v2: delete unused b53_set_mrouter function prototype ==================== Signed-off-by: David S. Miller commit c73c57081b3d59aa99093fbedced32ea02620cd3 Author: Vladimir Oltean Date: Fri Aug 6 03:20:08 2021 +0300 net: dsa: don't disable multicast flooding to the CPU even without an IGMP querier Commit 08cc83cc7fd8 ("net: dsa: add support for BRIDGE_MROUTER attribute") added an option for users to turn off multicast flooding towards the CPU if they turn off the IGMP querier on a bridge which already has enslaved ports (echo 0 > /sys/class/net/br0/bridge/multicast_router). And commit a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") simply papered over that issue, because it moved the decision to flood the CPU with multicast (or not) from the DSA core down to individual drivers, instead of taking a more radical position then. The truth is that disabling multicast flooding to the CPU is simply something we are not prepared to do now, if at all. Some reasons: - ICMP6 neighbor solicitation messages are unregistered multicast packets as far as the bridge is concerned. So if we stop flooding multicast, the outside world cannot ping the bridge device's IPv6 link-local address. - There might be foreign interfaces bridged with our DSA switch ports (sending a packet towards the host does not necessarily equal termination, but maybe software forwarding). So if there is no one interested in that multicast traffic in the local network stack, that doesn't mean nobody is. - PTP over L4 (IPv4, IPv6) is multicast, but is unregistered as far as the bridge is concerned. This should reach the CPU port. - The switch driver might not do FDB partitioning. And since we don't even bother to do more fine-grained flood disabling (such as "disable flooding _from_port_N_ towards the CPU port" as opposed to "disable flooding _from_any_port_ towards the CPU port"), this breaks standalone ports, or even multiple bridges where one has an IGMP querier and one doesn't. Reverting the logic makes all of the above work. Fixes: a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") Fixes: 08cc83cc7fd8 ("net: dsa: add support for BRIDGE_MROUTER attribute") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit cbbf09b5771e6e9da268bc0d2fb6e428afa787bc Author: Vladimir Oltean Date: Fri Aug 6 03:20:07 2021 +0300 net: dsa: mt7530: remove the .port_set_mrouter implementation DSA's idea of optimizing out multicast flooding to the CPU port leaves quite a few holes open, so it should be reverted. The mt7530 driver is the only new driver which added a .port_set_mrouter implementation after the reorg from commit a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags"), so it needs to be reverted separately so that the other revert commit can go a bit further down the git history. Fixes: 5a30833b9a16 ("net: dsa: mt7530: support MDB and bridge flag operations") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7df4e7449489d82cee6813dccbb4ae4f3f26ef7b Author: Vladimir Oltean Date: Fri Aug 6 03:20:06 2021 +0300 net: dsa: stop syncing the bridge mcast_router attribute at join time Qingfang points out that when a bridge with the default settings is created and a port joins it: ip link add br0 type bridge ip link set swp0 master br0 DSA calls br_multicast_router() on the bridge to see if the br0 device is a multicast router port, and if it is, it enables multicast flooding to the CPU port, otherwise it disables it. If we look through the multicast_router_show() sysfs or at the IFLA_BR_MCAST_ROUTER netlink attribute, we see that the default mrouter attribute for the bridge device is "1" (MDB_RTR_TYPE_TEMP_QUERY). However, br_multicast_router() will return "0" (MDB_RTR_TYPE_DISABLED), because an mrouter port in the MDB_RTR_TYPE_TEMP_QUERY state may not be actually _active_ until it receives an actual IGMP query. So, the br_multicast_router() function should really have been called br_multicast_router_active() perhaps. When/if an IGMP query is received, the bridge device will transition via br_multicast_mark_router() into the active state until the ip4_mc_router_timer expires after an multicast_querier_interval. Of course, this does not happen if the bridge is created with an mcast_router attribute of "2" (MDB_RTR_TYPE_PERM). The point is that in lack of any IGMP query messages, and in the default bridge configuration, unregistered multicast packets will not be able to reach the CPU port through flooding, and this breaks many use cases (most obviously, IPv6 ND, with its ICMP6 neighbor solicitation multicast messages). Leave the multicast flooding setting towards the CPU port down to a driver level decision. Fixes: 010e269f91be ("net: dsa: sync up switchdev objects and port attributes when joining the bridge") Reported-by: DENG Qingfang Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3bacbe04251b7bc5049a8951563d3a9a9b854dc1 Author: Grygorii Strashko Date: Fri Aug 6 01:55:32 2021 +0300 net: ethernet: ti: am65-cpsw: use napi_complete_done() in TX completion This patch enables support for hard irqs deferral feature from Eric Dumazet [1] for TI K3 CPSW driver by using napi_complete_done() in TX completion path. Depending on gro_flush_timeout and napi_defer_hard_irqs at gives up to 30% CPU utilization reduction: gro_flush_timeout=50000 napi_defer_hard_irqs=2 netperf -l 10 -H 192.168.1.1 -t UDP_STREAM -c -C -- -m 1470 MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.1 () port 0 AF_INET Socket Message Elapsed Messages CPU Service Size Size Time Okay Errors Throughput Util Demand bytes bytes secs # # 10^6bits/sec % SS us/KB before: 212992 1470 10.00 809632 0 952.0 42.98 14.792 212992 10.00 809630 952.0 50.66 8.719 after: 212992 1470 10.00 813686 0 956.8 32.14 11.009 212992 10.00 813686 956.8 50.05 8.570 [1] https://lore.kernel.org/netdev/20200422161329.56026-1-edumazet@google.com/ Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 47bfc4d128dedd9e828e33b70b87b591a6d59edf Author: Vignesh Raghavendra Date: Fri Aug 6 01:55:31 2021 +0300 net: ti: am65-cpsw-nuss: fix RX IRQ state after .ndo_stop() On TI K3 am64x platform the issue with RX IRQ is observed - it's become disabled forever after .ndo_stop(). The K3 CPSW driver manipulates RX IRQ by using standard Linux enable_irq()/disable_irq_nosync() API as there is no IRQ enable/disable options in CPSW HW itself, as result during .ndo_stop() following sequence happens phy_stop() teardown TX/RX channels wait for TX tdown complete napi_disable(TX) clean up TX channels (a) napi_disable(RX) At point (a) it's not possible to predict if RX IRQ was triggered or not. if RX IRQ was triggered then it also not possible to definitely say if RX NAPI was run or only scheduled and immediately canceled by napi_disable(RX). Actually the last case causes RX IRQ to be permanently disabled. Another observed issue is that RX IRQ enable counter become unbalanced if (gro_flush_timeout =! 0) while (napi_defer_hard_irqs == 0): Unbalanced enable for IRQ 44 WARNING: CPU: 0 PID: 10 at ../kernel/irq/manage.c:776 __enable_irq+0x38/0x80 __enable_irq+0x38/0x80 enable_irq+0x54/0xb0 am65_cpsw_nuss_rx_poll+0x2f4/0x368 __napi_poll+0x34/0x1b8 net_rx_action+0xe4/0x220 _stext+0x11c/0x284 run_ksoftirqd+0x4c/0x60 To avoid above issues introduce flag indicating if RX was actually disabled before enabling it in am65_cpsw_nuss_rx_poll() and restore RX IRQ state in .ndo_open() Fixes: 4f7cce272403 ("net: ethernet: ti: am65-cpsw: add support for am64x cpsw3g") Signed-off-by: Vignesh Raghavendra Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 370cb73a38747379bfc559b5fe61e575c3bb4f31 Merge: 596690e9f4fc8 8ef8ccbc69677 Author: David S. Miller Date: Fri Aug 6 10:41:28 2021 +0100 Merge branch 'ptp-ocp-fixes' Jonathan Lemon says: ==================== ptp: ocp: assorted fixes. Assorted fixes for the ocp timecard. ==================== Signed-off-by: David S. Miller commit 8ef8ccbc69677e663925f3e758b077d1ad3cd836 Author: Jonathan Lemon Date: Thu Aug 5 12:52:48 2021 -0700 ptp: ocp: Remove pending_image indicator from devlink After writing an image blob to the flash memory, a reboot is required to reload the FPGA. There is no versioning prsent in the FPGA image file, so only a running version is available. The 'stored version' was set to 'pending' in order to indicate a reboot was needed. This isn't reliable, as the module could be unloaded/loaded, losing the "reboot needed" indicator. Also, the devlink 'stored version' information is designed to refer to the actual image version. Unfortunately, there is no method to determine the flash image version other than booting it, so remove the devlink stored version setting. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit 1a052da92924413d8fab15ccf293f886148e8fc9 Author: Jonathan Lemon Date: Thu Aug 5 12:52:47 2021 -0700 ptp: ocp: Rename version string shown by devlink. The TimeCard has two FPGA images in the flash: the actual firmware, and a manufacturing fallback version which is intended to act as a loader in case the flash update failed. Name these "fw" and "loader", which are reflected in devlink: [root@timecard drv]# devlink dev info pci/0000:04:00.0: driver ptp_ocp serial_number fc:c2:3d:2e:d7:c0 versions: running: fw 5 Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit ef0cfb3460a40942c901e15e3df9822b63cb159e Author: Jonathan Lemon Date: Thu Aug 5 12:52:46 2021 -0700 ptp: ocp: Use 'gnss' naming instead of 'gps' GPS is not the only available positioning system. Use the generic naming of "GNSS" instead. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit 37a156ba4cbb44037355087ade03268435a77225 Author: Jonathan Lemon Date: Thu Aug 5 12:52:45 2021 -0700 ptp: ocp: Remove devlink health and unused parameters. "devlink health" was used as a way to monitor the GNSS signal status. This isn't really the intended use, and the same functionality can be achived by monitoring the status file. Remove the devlink heath support entirely, and also remove the currently unused devlink parameters. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit 0d43d4f26cb2b051ad430629d2f0c5866822656a Author: Jonathan Lemon Date: Thu Aug 5 12:52:44 2021 -0700 ptp: ocp: Add the mapping for the external PPS registers. There are two PPS blocks: one handles the external PPS signal output, with the other handling the PPS signal input to the internal clock. Add controls for the external PPS block. Rename the fields so they match their function. Add cable_delay to the register definitions. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit d12f23fa5142594796a0498d11b5f21463060dac Author: Jonathan Lemon Date: Thu Aug 5 12:52:43 2021 -0700 ptp: ocp: Fix the error handling path for the class device. Move the put_device() call to the error handling path, so the device is released after the .release callback, avoiding a use-after-free. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit 596690e9f4fc8f062a3f52b42071086721fd76fe Author: Heiner Kallweit Date: Thu Aug 5 21:08:22 2021 +0200 ethtool: return error from ethnl_ops_begin if dev is NULL Julian reported that after d43c65b05b84 Coverity complains about a missing check whether dev is NULL in ethnl_ops_complete(). There doesn't seem to be any valid case where dev could be NULL when calling ethnl_ops_begin(), therefore return an error if dev is NULL. Fixes: d43c65b05b84 ("ethtool: runtime-resume netdev parent in ethnl_ops_begin") Reported-by: Julian Wiedmann Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 5c0418ed16109759c7aec86b72f9bf56a0358526 Author: Leon Romanovsky Date: Thu Aug 5 17:34:28 2021 +0300 netdevsim: Protect both reload_down and reload_up paths Don't progress with adding and deleting ports as long as devlink reload is running. Fixes: 23809a726c0d ("netdevsim: Forbid devlink reload when adding or deleting ports") Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit a5516053cd442f58929590349809ca0b6f154fdb Merge: 0ca8d3ca45615 9ffc513f95eea Author: David S. Miller Date: Fri Aug 6 10:26:55 2021 +0100 Merge branch 'cpsw-emac-skb_put_padto' Grygorii Strashko says: ==================== net: ethernet: ti: cpsw/emac: switch to use skb_put_padto() Now frame padding in TI TI CPSW/EMAC is implemented in a bit of entangled way as frame SKB padded in drivers (without skb->len) while frame length fixed in CPDMA. Things became even more confusing hence CPSW switcdev driver need to perform min TX frame length correction in switch mode [1]. To avoid further confusion, make xmit path more clear and linear, and avoid updating CPDMA configuration interface for min TX frame length correction (which is not CPDMA job in general) this series switches TI CPSW/EMAC drivers to skb_put_padto() instead of skb_padto() in their xmit path, so skb->len also got updated properly and then removes TX frame length fixup from CPDMA code. [1] https://patchwork.kernel.org/project/netdevbpf/patch/20210611132732.10690-1-grygorii.strashko@ti.com/ ==================== Signed-off-by: David S. Miller commit 9ffc513f95eea67bbdee615637c24d131a2b3186 Author: Grygorii Strashko Date: Thu Aug 5 17:55:55 2021 +0300 net: ethernet: ti: davinci_cpdma: drop frame padding Hence all users of davinci_cpdma switched to skb_put_padto() the frame padding can be removed from it. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 61e7a22da75b5ca97e89f6a935352e6528342b99 Author: Grygorii Strashko Date: Thu Aug 5 17:55:54 2021 +0300 net: ethernet: ti: davinci_emac: switch to use skb_put_padto() Use skb_put_padto() instead of skb_padto() so skb->len also got updated, as preparation for further removing frame padding from cpdma. It also makes xmit path more clear and linear. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 1f88d5d566b8be60ce8f8b53132a706fe3184e9e Author: Grygorii Strashko Date: Thu Aug 5 17:55:53 2021 +0300 net: ethernet: ti: cpsw: switch to use skb_put_padto() Use skb_put_padto() instead of skb_padto() so skb->len also got updated, as preparation for further removing frame padding from cpdma. It also makes xmit path more clear and linear. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit d249ff28b1d8478419caf347c4836361a47b0c5b Author: Lukas Bulwahn Date: Tue Jul 13 07:40:25 2021 +0200 intersil: remove obsolete prism54 wireless driver Commit 1d89cae1b47d ("MAINTAINERS: mark prism54 obsolete") indicated the prism54 driver as obsolete in July 2010. Now, after being exposed for ten years to refactoring, general tree-wide changes and various janitor clean-up, it is really time to delete the driver for good. This was discovered as part of a checkpatch evaluation, investigating all reports of checkpatch's WARNING:OBSOLETE check. p54 replaces prism54 so users should be unaffected. There was a one off chipset someone long ago reported that p54 didn't work with but the reporter never followed up on that. Additionally, distributions have been blacklisting prism54 for years now. Signed-off-by: Lukas Bulwahn Acked-by: Luis Chamberlain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210713054025.32006-1-lukas.bulwahn@gmail.com commit bd03d440e2589b9c328f40ce60203adf2b19d2e2 Author: Robert Foss Date: Thu Aug 5 20:50:39 2021 +0200 drm: bridge: it66121: Check drm_bridge_attach retval The return value of drm_bridge_attach() is ignored during the it66121_bridge_attach() call, which is incorrect. Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver") Signed-off-by: Robert Foss Acked-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20210805185039.402178-1-robert.foss@linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20210805185039.402178-1-robert.foss@linaro.org commit fffd603ae9f6ee1da47fa4ae4c70c324323bc201 Author: Alexandre Belloni Date: Wed Aug 4 12:41:32 2021 +0200 rtc: s5m: set range The S5M8763X type seems to handles dates from year 0000 to 9999, there is no info on leap year handling after 2099. The other models handles dates from 2000 to 2099. Signed-off-by: Alexandre Belloni Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210804104133.5158-4-alexandre.belloni@bootlin.com commit 308247d20464a684f335001f2f835240e67f9126 Author: Alexandre Belloni Date: Wed Aug 4 12:41:31 2021 +0200 rtc: s5m: enable wakeup only when available Call device_init_wakeup() only when alarms are available and the RTC is actually able to wake up the system. Signed-off-by: Alexandre Belloni Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210804104133.5158-3-alexandre.belloni@bootlin.com commit 1ed4dba2bc166bae5af713a114ed91619ef70c43 Author: Alexandre Belloni Date: Wed Aug 4 12:41:30 2021 +0200 rtc: s5m: signal the core when alarm are not available Clear the RTC_FEATURE_ALARM bit to signal to the core when alarms are not available to ensure the alarm callbacks are never called and userspace is aware alarms are not supported. Signed-off-by: Alexandre Belloni Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210804104133.5158-2-alexandre.belloni@bootlin.com commit dae68c6b9620ab694c8334de640c6d64daeb90e2 Author: Alexandre Belloni Date: Wed Aug 4 12:41:29 2021 +0200 rtc: s5m: switch to devm_rtc_allocate_device Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210804104133.5158-1-alexandre.belloni@bootlin.com commit f9807f9cb396544ab6bdb4f4451505211ca602f7 Author: Patrice Chotard Date: Tue Aug 3 14:37:48 2021 +0200 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih410-b2260 Remove clk_ignore_unused from bootargs as it's no more needed. Signed-off-by: Patrice Chotard commit 4e80af1fd639e621a7011141ff32b270a2782d8f Author: Patrice Chotard Date: Tue Aug 3 14:37:36 2021 +0200 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih418-b2199 Remove clk_ignore_unused from bootargs as it's no more needed. Signed-off-by: Patrice Chotard commit bd642467c2736bd19266806e78655bb1bde81268 Author: Patrice Chotard Date: Tue Aug 3 14:37:24 2021 +0200 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih410-b2120 Remove clk_ignore_unused from bootargs as it's no more needed. Signed-off-by: Patrice Chotard commit c2026910fc2697979ae9f07bdcc9ea2fa438804c Author: Patrice Chotard Date: Tue Aug 3 14:37:15 2021 +0200 ARM: dts: sti: remove clk_ignore_unused from bootargs for stih407-b2120 Remove clk_ignore_unused from bootargs as it's no more needed. Signed-off-by: Patrice Chotard commit 41e202f9d9c8e10ea25750bbe1ebb39a3d6bd888 Author: Alain Volmat Date: Wed Mar 31 22:42:28 2021 +0200 ARM: dts: sti: Introduce 4KOpen (stih418-b2264) board 4KOpen (B2264) is a board based on the STMicroelectronics STiH418 soc: - 2GB DDR - HDMI - Ethernet 1000-BaseT - PCIe (mini PCIe connector) - MicroSD slot - USB2 and USB3 connectors - Sata - 40 pins GPIO header Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 11061d6cafcf8f77ec4591a91da1a89bef142637 Author: Alain Volmat Date: Wed Mar 31 22:42:27 2021 +0200 ARM: dts: sti: add the thermal sensor node within stih418 The STiH418 embedded the same sensor as the STiH410. This commit adds the corresponding node, relying on the st_thermal driver. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 7b22ec0c72f3be250c36a335e3f5d048f5f47b0e Author: Alain Volmat Date: Wed Mar 31 22:42:26 2021 +0200 ARM: dts: sti: disable rng11 on the stih418 platform The rng11 is not available on the STiH418 hence is disabled in the stih418.dtsi Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 5d296faf3f45949a5d55e1481d85100d77cc1bb9 Author: Alain Volmat Date: Wed Mar 31 22:42:25 2021 +0200 ARM: dts: sti: add the spinor controller node within stih407-family The STiH407 family (and further versions STiH410/STiH418) embedded a serial flash controller allowing fast access to SPI-NOR. This commit adds the corresponding node, relying on the st-spi-fsm drivers. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit a1b68d6b02b6b3d92dc9093d3f56688bc463bb73 Author: Alain Volmat Date: Wed Mar 31 22:42:24 2021 +0200 ARM: dts: sti: update clkgen-fsyn entries in stih418-clock The clkgen-fsyn driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 7f9ed95ddaa5ac0b8894b0fe6bb130c06cafb44d Author: Alain Volmat Date: Wed Mar 31 22:42:23 2021 +0200 ARM: dts: sti: update clkgen-fsyn entries in stih410-clock The clkgen-fsyn driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 21b6069c3a8e95e4c82813cd328cb3c7a7ffe517 Author: Alain Volmat Date: Wed Mar 31 22:42:22 2021 +0200 ARM: dts: sti: update clkgen-fsyn entries in stih407-clock The clkgen-fsyn driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 19007a65aa13590c8e74d0b4573134be31793c08 Author: Alain Volmat Date: Wed Mar 31 22:42:21 2021 +0200 ARM: dts: sti: update clkgen-pll entries in stih418-clock The clkgen-pll driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit b26ba00c3b232947c5bae7793a0303a9cb03dfba Author: Alain Volmat Date: Wed Mar 31 22:42:20 2021 +0200 ARM: dts: sti: update clkgen-pll entries in stih410-clock The clkgen-pll driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 9528bb46b606eea34b9bbd4aa09fdbc811b5bc6b Author: Alain Volmat Date: Wed Mar 31 22:42:19 2021 +0200 ARM: dts: sti: update clkgen-pll entries in stih407-clock The clkgen-pll driver now embed the clock names (assuming the right compatible is used). Remove all clock-output-names property and update when necessary the compatible. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit d767090d73e1116e09491c05c8113950205a142a Author: Alain Volmat Date: Wed Mar 31 22:42:18 2021 +0200 ARM: dts: sti: update flexgen compatible within stih410-clock With the introduction of new flexgen compatible within the clk-flexgen driver, remove the clock-output-names entry from the flexgen nodes and set the new proper compatible corresponding. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 7c44e1515c84e394142c5e0c132b47af5d9142b8 Author: Alain Volmat Date: Wed Mar 31 22:42:17 2021 +0200 ARM: dts: sti: update flexgen compatible within stih407-clock With the introduction of new flexgen compatible within the clk-flexgen driver, remove the clock-output-names entry from the flexgen nodes and set the new proper compatible corresponding. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit a7056e0423725e21797e72e5c41b2cb535784d3c Author: Alain Volmat Date: Wed Mar 31 22:42:16 2021 +0200 ARM: dts: sti: update flexgen compatible within stih418-clock With the introduction of new flexgen compatible within the clk-flexgen driver, remove the clock-output-names entry from the flexgen nodes and set the new proper compatible corresponding. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 4297d1c0834af97fe992ec7bf766f0a262ce5ffc Author: Peter Robinson Date: Sun Jun 13 13:51:05 2021 +0100 arm: omap2: Drop the unused OMAP_PACKAGE_* KConfig entries The OMAP_PACKAGE_* Kconfig entries are no longer referenced in the kernel so can be dropped as they're obsolete. Signed-off-by: Peter Robinson Signed-off-by: Tony Lindgren commit c8d9a986d0f2466d11ffd07e66fed9f4a34631a7 Author: Peter Robinson Date: Sun Jun 13 13:51:04 2021 +0100 arm: omap2: Drop obsolete MACH_OMAP3_PANDORA entry The MACH_OMAP3_PANDORA is no longer referenced anywhere in the kernel options so it can now be dropped as the board has long moved to DT. Signed-off-by: Peter Robinson Signed-off-by: Tony Lindgren commit c477358e66a3a6db4f1799b7415068d6660c95c3 Author: Grygorii Strashko Date: Fri Aug 6 02:09:56 2021 +0300 ARM: dts: am335x-bone: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, Switch BeagleBone boards to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. For am335x-sancloud-bbe-common.dtsi also removed duplicated davinci_mdio DT nodes which already defined in am335x-bone-common.dtsi. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit d22e0e1afa267ee417b2a7dff190cc6d04832418 Author: Grygorii Strashko Date: Sat Jun 12 04:14:36 2021 +0300 ARM: dts: am33xx: update ethernet aliases Update ethernet aliases to point at CPSW switchdev driver. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 0a8eb8d7f0907304d364ca87476d0947f3845baf Author: Grygorii Strashko Date: Sat Jun 12 04:14:35 2021 +0300 ARM: dts: am335x-sl50: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Toby Churchill SL50 Series to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit a5cacca25ed21fe1a9802cc7c517010020da0e63 Author: Grygorii Strashko Date: Sat Jun 12 04:14:34 2021 +0300 ARM: dts: am335x-shc: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Bosch SHC to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit a71c1446b5ca9e01a6f43714027765022df76134 Author: Grygorii Strashko Date: Sat Jun 12 04:14:33 2021 +0300 ARM: dts: am335x-phycore: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Phytec AM335x phyCORE SOM, phyBOARD-WEGA, phyBOARD-REGOR, PCM-953 to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Cc: Teresa Remmet Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 2bd433270566871f71d9ad74babdf4fe2aa3adcc Author: Grygorii Strashko Date: Sat Jun 12 04:14:32 2021 +0300 ARM: dts: am335x-pepper: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Gumstix Pepper to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit a2f2cd466e7f5b383b8adb26487df3fd072bdfdc Author: Grygorii Strashko Date: Sat Jun 12 04:14:31 2021 +0300 ARM: dts: am335x-pdu001: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch EETS,PDU001 to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit c2fe8276b3feca77994f032230e3c77878e21c9a Author: Grygorii Strashko Date: Sat Jun 12 04:14:30 2021 +0300 ARM: dts: am335x-osd3358-sm-red: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Octavo Systems OSD3358-SM-RED to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 4c0b47f3228a5ddd0679f8b5b702b09fa10715db Author: Grygorii Strashko Date: Sat Jun 12 04:14:29 2021 +0300 ARM: dts: am335x-myirtech: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch MYIR MYC-AM335X/MYD-AM335X to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Cc: Alexander Shiyan Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 5578b73024f321eac7bd9ea5d3007e9d1dae5316 Author: Grygorii Strashko Date: Sat Jun 12 04:14:28 2021 +0300 ARM: dts: am335x-moxa-uc: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Moxa am335x-moxa-uc-210x/8100 to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Cc: Johnson Chen Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 843470ac18d24199b1388b1620f5531623489472 Author: Grygorii Strashko Date: Sat Jun 12 04:14:27 2021 +0300 ARM: dts: am335x-lxm: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch NovaTech OrionLXm to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 45b2c44aa5dea7d918624ea0dba2de1290f6fbb9 Author: Grygorii Strashko Date: Sat Jun 12 04:14:26 2021 +0300 ARM: dts: am335x-igep0033: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch am335x-igep0033 to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 1d3e27982c4d1671aae87064a79c694befad5a10 Author: Grygorii Strashko Date: Sat Jun 12 04:14:25 2021 +0300 ARM: dts: am335x-cm-t335: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch CompuLab CM-T335 to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 17d03506dd860cec7159034db4f4ac2f424a74fa Author: Grygorii Strashko Date: Sat Jun 12 04:14:24 2021 +0300 ARM: dts: am335x-chiliboard: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch AM335x Chiliboard to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 0a8c054defe7d188bc8de83275391482c4e273b7 Author: Grygorii Strashko Date: Sat Jun 12 04:14:23 2021 +0300 ARM: dts: am335x-nano: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch Newflow AM335x NanoBone to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 1c7ba565e70365763ea780666a3eee679344b962 Author: Grygorii Strashko Date: Sat Jun 12 04:14:22 2021 +0300 ARM: dts: am335x-baltos: switch to new cpsw switch drv The dual_mac mode has been preserved the same way between legacy and new driver, and one port devices works the same as 1 dual_mac port - it's safe to switch drivers. So, switch OnRISC Baltos and NetCom/Cam boards to use new cpsw switch driver. Those boards have or 2 Ext. port wired and configured in dual_mac mode by default, or only 1 Ext. port. Cc: Yegor Yefremov Cc: Christina Quast Signed-off-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit 282bd08229761af5c7d529befe38f56c20f77c54 Author: Michael Straube Date: Thu Aug 5 22:50:10 2021 +0200 staging: r8188eu: replace custom macros with is_broadcast_ether_addr Replace usage of custom macros with is_broadcast_ether_addr. All buffers are properly aligned. Remove the now unsued macros MacAddr_isBcst and IS_MAC_ADDRESS_BROADCAST. Signed-off-by: Michael Straube Acked-by: Larry Finger Link: https://lore.kernel.org/r/20210805205010.31192-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d28a4c009bfbbdd26fa196b7b8af1d879470211b Author: Phillip Potter Date: Fri Aug 6 01:40:34 2021 +0100 staging: r8188eu: remove two set but unused variables in core/rtw_mp_ioctl.c Remove two set but unused variables in core/rtw_mp_ioctl.c to fix a kernel test robot warning. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-12-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit fe4bbfb44a222059ae2625b89ab5007cca130b8b Author: Phillip Potter Date: Fri Aug 6 01:40:33 2021 +0100 staging: r8188eu: fix unused variable warnings in core/rtw_ieee80211.c Remove an unused variable and a set but unused variable within core/rtw_ieee80211.c to fix a kernel test robot warning. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-11-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5ea6417afa721c65690f64285aa9b779a6a9eb6a Author: Phillip Potter Date: Fri Aug 6 01:40:32 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_recv.c Remove RT_TRACE macro calls from core/rtw_recv.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-10-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 9bb2e9b1f5b17b79d95a4ad1007292cda839c5b4 Author: Phillip Potter Date: Fri Aug 6 01:40:31 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_xmit.c Remove RT_TRACE macro calls from core/rtw_xmit.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-9-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5833ca54050768a328ca01c1ef29a4aa6d45ec4a Author: Phillip Potter Date: Fri Aug 6 01:40:30 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_sta_mgt.c Remove RT_TRACE macro calls from core/rtw_sta_mgt.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit de30da13709b8f1aa4b9da5135119a3f37a7e0de Author: Phillip Potter Date: Fri Aug 6 01:40:29 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_security.c Remove RT_TRACE macro calls from core/rtw_security.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit fea8d09f804f324d0095d5b3d7938589008e47a7 Author: Phillip Potter Date: Fri Aug 6 01:40:28 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_mp.c Remove RT_TRACE macro calls from core/rtw_mp.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit a0adc4cc74d98ef8aa12d19bf1c8e2890d326d2b Author: Phillip Potter Date: Fri Aug 6 01:40:27 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_mlme_ext.c Remove RT_TRACE macro calls from core/rtw_mlme_ext.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 2965d4b44b3e39632c6235aa8981631aa976415e Author: Phillip Potter Date: Fri Aug 6 01:40:26 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_mlme.c Remove RT_TRACE macro calls from core/rtw_mlme.c, so that ultimately the macro definition itself can eventually be removed. Also remove the (now) empty functions rtw_atimdone_event_callback and rtw_cpwm_event_callback, as well as their declarations and struct inclusions in the relevant header files. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit ef0661507147179afbab278e1364715fd905b7ab Author: Phillip Potter Date: Fri Aug 6 01:40:25 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_ioctl_set.c Remove RT_TRACE macro calls from core/rtw_ioctl_set.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit b72290ce7da235f458316978bf0d38fb10640e50 Author: Phillip Potter Date: Fri Aug 6 01:40:24 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_cmd.c Remove RT_TRACE macro calls from core/rtw_cmd.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210806004034.82233-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit f5efd4fe78de871515444b660029074be17ec11f Author: Bean Huo Date: Wed Aug 4 20:21:28 2021 +0200 scsi: ufs: core: Add lu_enable sysfs node We need to check whether HPB is enabled on a given LU from the userspace tool. Add lu_enable sysfs node. Link: https://lore.kernel.org/r/20210804182128.458356-3-huobean@gmail.com Tested-by: Avri Altman Reviewed-by: Avri Altman Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit 63522bf3aced0a782b59f0314dbad5cdc8b14c59 Author: Bean Huo Date: Wed Aug 4 20:21:27 2021 +0200 scsi: ufs: core: Add L2P entry swap quirk for Micron UFS For Micron UFS devices the L2P entry need to be byteswapped before sending an HPB READ command to the UFS device. Add the quirk UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ to address this. Link: https://lore.kernel.org/r/20210804182128.458356-2-huobean@gmail.com Reviewed-by: Avri Altman Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit f0101af435c4640e78c0fa0dbacb443c0f31cfb7 Author: Bean Huo Date: Mon Aug 2 20:08:03 2021 +0200 scsi: ufs: core: Remove redundant call in ufshcd_add_command_trace() ufshcd_add_cmd_upiu_trace() will be called later anyway. Simplify code by moving if-statement. Link: https://lore.kernel.org/r/20210802180803.100033-1-huobean@gmail.com Reviewed-by: Avri Altman Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit 77d0f07abada8c9aeb54caba879a298a0b94c02a Author: Colin Ian King Date: Wed Aug 4 14:13:44 2021 +0100 scsi: qla2xxx: Remove redundant initialization of variable num_cnt The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210804131344.112635-1-colin.king@canonical.com Reviewed-by: Himanshu Madhani Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit e3d2612f583ba6e234cb7fe4559132c8f28905f1 Author: Dan Carpenter Date: Tue Aug 3 18:56:25 2021 +0300 scsi: qla2xxx: Fix use after free in debug code The sp->free(sp); call frees "sp" and then the debug code dereferences it on the next line. Swap the order. Link: https://lore.kernel.org/r/20210803155625.GA22735@kili Fixes: 84318a9f01ce ("scsi: qla2xxx: edif: Add send, receive, and accept for auth_els") Reviewed-by: Ewan D. Milne Reviewed-by: Himanshu Madhani Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 5d9bc010db0a4f5b17b3f5f982a85c49bb911754 Author: Shawn Guo Date: Sun Jul 4 10:40:32 2021 +0800 clk: qcom: a53-pll: Add MSM8939 a53pll support MSM8939 has 3 a53pll clocks with different frequency table for Cluster0, Cluster1 and CCI. It adds function qcom_a53pll_get_freq_tbl() to create pll_freq_tbl from OPP, so that those a53pll frequencies can be defined in DT with operating-points-v2 bindings rather than being coded in the driver. In this case, one compatible rather than three would be needed for these 3 a53pll clocks. Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20210704024032.11559-5-shawn.guo@linaro.org Signed-off-by: Stephen Boyd commit f9a6a326f66dfb7d62cef79c6755cc773e5fb8ad Author: Shawn Guo Date: Sun Jul 4 10:40:31 2021 +0800 dt-bindings: clock: Update qcom,a53pll bindings for MSM8939 support Update qcom,a53pll bindings for MSM8939 support: - Add optional operating-points-v2 property - Add MSM8939 specific compatible Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20210704024032.11559-4-shawn.guo@linaro.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 05cc560c8cb4c2fe39022c1f397125470b28705c Author: Shawn Guo Date: Sun Jul 4 10:40:30 2021 +0800 clk: qcom: a53pll/mux: Use unique clock name Different from MSM8916 which has only one a53pll/mux clock, MSM8939 gets three for Cluster0 (little cores), Cluster1 (big cores) and CCI (Cache Coherent Interconnect). That said, a53pll/mux clock needs to be named uniquely. Append @unit-address of device node to the clock name, so that a53pll/mux will be named like below on MSM8939. a53pll@b016000 a53pll@b116000 a53pll@b1d0000 a53mux@b1d1000 a53mux@b011000 a53mux@b111000 Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20210704024032.11559-3-shawn.guo@linaro.org Signed-off-by: Stephen Boyd commit 0dfe9bf91f9f2993ae73c603571a85e3c6e6fc24 Author: Shawn Guo Date: Sun Jul 4 10:40:29 2021 +0800 clk: qcom: apcs-msm8916: Flag a53mux instead of a53pll as critical The clock source for MSM8916 cpu cores is like below. |\ a53pll --------| \ a53mux +------+ | |------------| cpus | gpll0_vote --------| / +------+ |/ So a53mux rather than a53pll is actually the parent clock of cpu cores. It makes more sense to flag a53mux as critical instead, so that when either a53pll or gpll0_vote is used by cpu cores, the clock will be kept enabled while the other can be disabled. Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20210704024032.11559-2-shawn.guo@linaro.org Signed-off-by: Stephen Boyd commit 945cb3a105aef63af1354e0fbe10a0d1ca7a32c2 Author: Bjorn Andersson Date: Wed Jul 21 15:53:29 2021 -0700 clk: qcom: gpucc-sm8150: Add SC8180x support The GPU clock controller found in SC8180x is a variant of the same block found in SM8150, but with one additional clock frequency for the gmu_clk_src clock. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210721225329.3035779-1-bjorn.andersson@linaro.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 48662d988d12fcaa6243e48f3407e8f7b2e5773d Author: Konrad Dybcio Date: Fri Aug 6 00:24:00 2021 +0200 clk: qcom: smd-rpm: Add mdm9607 clocks Add support for RPM-managed clocks on the MDM9607 platform. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210805222400.39027-2-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit c45e13fa3851e825c279c2cb0b7f6961f36f1095 Author: Konrad Dybcio Date: Fri Aug 6 00:23:59 2021 +0200 dt-bindings: clock: qcom: rpmcc: Document MDM9607 compatible Add the dt-binding for the RPM Clock Controller on the MDM9607 SoC. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210805222400.39027-1-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit 9c5376856693bf127b7d313e03ed030451064d05 Author: Vladimir Lypak Date: Thu Aug 5 17:19:44 2021 +0000 clk: qcom: rpmcc: Add support for MSM8953 RPM clocks. Add definitions for RPM clocks used on MSM8953 platform. Signed-off-by: Vladimir Lypak Signed-off-by: Adam Skladowski Reviewed-by: Konrad Dybcio Signed-off-by: Sireesh Kodali Link: https://lore.kernel.org/r/QZ0fkozlubDdc7CvqjZPhAviFmjJ28ht7Y4PT3rYM@cp4-web-038.plabs.ch Signed-off-by: Stephen Boyd commit 00555272dcdae71e96de08c924c4fef6b47d7e5b Author: Vladimir Lypak Date: Thu Aug 5 17:19:29 2021 +0000 dt-bindings: clock: qcom-rpmcc: Add compatible for MSM8953 SoC Add compatible for MSM8953 SoC. Signed-off-by: Vladimir Lypak Signed-off-by: Sireesh Kodali Link: https://lore.kernel.org/r/c662hoLme5MIdelk5BVPsVgN77IqTLS0KwYwpauJiDs@cp3-web-047.plabs.ch Signed-off-by: Stephen Boyd commit f55f32ee1070bc1d4e6f5d06a97794d3718381a3 Author: Iskren Chernev Date: Sat Jul 31 19:48:26 2021 +0300 clk: qcom: smd: Add support for SM6115 rpm clocks Add rpm smd clocks, PMIC and bus clocks which are required on SM4250/6115 for clients to vote on. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210731164827.2756798-2-iskren.chernev@gmail.com [sboyd@kernel.org: Drop duplicate define, merge with sm6125 support] Signed-off-by: Stephen Boyd commit edeb2ca74716056b2be62925f21494d7af65150f Author: Martin Botka Date: Fri Jul 30 23:59:24 2021 +0200 clk: qcom: smd: Add support for SM6125 rpm clocks Add rpm smd clocks, PMIC and bus clocks which are required on SM6125 for clients to vote on. Signed-off-by: Martin Botka Link: https://lore.kernel.org/r/20210730215924.733350-2-martin.botka@somainline.org Signed-off-by: Stephen Boyd commit e88ebd83ed50aeaa46eb600ca3315c8eb2cdc4fb Author: Solomon Chiu Date: Wed Jul 28 00:20:30 2021 +0800 drm/amdgpu: Add preferred mode in modeset when freesync video mode's enabled. [Why] With kernel module parameter "freesync_video" is enabled, if the mode is changed to preferred mode(the mode with highest rate), then Freesync fails because the preferred mode is treated as one of freesync video mode, and then be configurated as freesync video mode(fixed refresh rate). [How] Skip freesync fixed rate configurating when modeset to preferred mode. Signed-off-by: Solomon Chiu Signed-off-by: Alex Deucher commit a5467ebd681fa2ba09cfa64689c5fc0773fd0634 Author: Christophe JAILLET Date: Thu Aug 5 20:37:14 2021 +0200 drm/amd/pm: Fix a memory leak in an error handling path in 'vangogh_tables_init()' 'watermarks_table' must be freed instead 'clocks_table', because 'clocks_table' is known to be NULL at this point and 'watermarks_table' is never freed if the last kzalloc fails. Fixes: c98ee89736b8 ("drm/amd/pm: add the fine grain tuning function for vangogh") Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit b5768a78d25963dd3e7dd8181910a0d03324035a Author: Sergio Miguéns Iglesias Date: Wed Aug 4 13:20:53 2021 +0200 DRM: gpu: radeon: Fixed coding style issues Fixed braces, an unnecessary if statement and added a missing space. Reviewed-by: Christian König Signed-off-by: Sergio Miguéns Iglesias Signed-off-by: Alex Deucher commit c841e55274d67a9035f8f6263459280b5fcfdd4e Author: Zhenneng Li Date: Thu Aug 5 18:45:57 2021 +0800 drm/radeon: Update pitch for page flip When primary bo is updated, crtc's pitch may have not been updated, this will lead to show disorder content when user changes display mode, we update crtc's pitch in page flip to avoid this bug. This refers to amdgpu's pageflip. v1->v2: Update all of the pitch in all of the page_flip functions in radeon rather than just the evergreen one. v2->v3: Update pitch set method for r100 according to radeon_legacy_crtc.c 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 Cc: linux-kernel@vger.kernel.org Signed-off-by: Zhenneng Li Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9d6fa9c7ff930decf550eb19697cf27cdba95b89 Author: Graham Sider Date: Mon Jul 12 13:50:33 2021 -0400 drm/amdkfd: Expose GFXIP engine version to sysfs Add u32 gfx_target_version field to kfd_node_properties and kfd_device_info. Populate _device_info structs accordingly and expose to sysfs. This allows eliminating device-ID-based lookup tables in user mode for future ASICs. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a204ea8c20773a21c7fabbc21dab1cd104fa5a97 Author: Tuo Li Date: Tue Aug 3 18:51:32 2021 -0700 drm/amdgpu: drop redundant null-pointer checks in amdgpu_ttm_tt_populate() and amdgpu_ttm_tt_unpopulate() The varialbe gtt in the function amdgpu_ttm_tt_populate() and amdgpu_ttm_tt_unpopulate() is guaranteed to be not NULL in the context. Thus the null-pointer checks are redundant and can be dropped. Reported-by: TOTE Robot Reviewed-by: Christian König Signed-off-by: Tuo Li Signed-off-by: Alex Deucher commit 11e612a093ab6679d488e5e5aef887a551e89562 Author: Alex Deucher Date: Mon Aug 2 10:03:30 2021 -0400 drm/amdgpu: don't enable baco on boco platforms in runpm If the platform uses BOCO, don't use BACO in runtime suspend. We could end up executing the BACO path if the platform supports both. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1669 Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 685967b3c138f3d8a797ac82b39005891de0fb92 Author: Joseph Greathouse Date: Tue Jun 29 21:32:40 2021 -0500 drm/amdgpu: Put MODE register in wave debug info Add the MODE register into the per-wave debug information. This register holds state such as FP rounding and denorm modes, which exceptions are enabled, and active clamping modes. Signed-off-by: Joseph Greathouse Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 14fb496a84f15c1e462c8b7ff5563154174a6c5e Author: John Clements Date: Wed Aug 4 17:11:40 2021 +0800 drm/amdgpu: set RAS EEPROM address from VBIOS update to latest atombios fw table Signed-off-by: John Clements Reviewed-by: Hawking Zhang . Signed-off-by: Alex Deucher commit 564e3dcf79628d0b61a6c354efcdcf3a9e68c35f Author: Peng Ju Zhou Date: Mon Jul 12 10:45:41 2021 +0800 drm/amd/amdgpu: Recovery vcn instance iterate. The previous logic is recording the amount of valid vcn instances to use them on SRIOV, it is a hard task due to the vcn accessment is based on the index of the vcn instance. Check if the vcn instance enabled before do instance init. Signed-off-by: Peng Ju Zhou Reviewed-by: Monk Liu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 4b296527549853eae8f1f0e010eaaea511ab00d7 Author: John Clements Date: Wed Aug 4 11:31:03 2021 +0800 drm/amdgpu: added synchronization for psp cmd buf access resolved race condition accessing psp cmd submission memory Signed-off-by: John Clements Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 9712ee0e44e099d002dcbdd73230457d85f92f9c Author: John Clements Date: Tue Aug 3 16:18:14 2021 +0800 drm/amdgpu: update PSP BL cmd IDs resolved bug with incorrect PSP BL cmd IDs Signed-off-by: John Clements Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 7a3d638353177701c70f4c2a3b0878c4d7852fa4 Author: Xiaomeng Hou Date: Mon Aug 2 16:25:25 2021 +0800 drm/amd/pm: update smu v13.0.1 firmware header Update smu v13.0.1 firmware header for yellow carp. Signed-off-by: Xiaomeng Hou Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit a2e9b1666ea728aac7107e28d2106fce7e2aba5e Author: Chengming Gui Date: Wed Feb 24 11:48:23 2021 +0800 drm/amdgpu: add DID for beige goby Add device ids. Signed-off-by: Chengming Gui Signed-off-by: Alex Deucher commit d2a266fad506aa3dc143280dcf2dd732b40bcdd3 Author: Tom St Denis Date: Tue Mar 23 12:22:45 2021 -0400 drm/amd/amdgpu: add regCP_MEx_INT_STAT_DEBUG for Aldebaran debugging Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 72a74a18015c7f850a6424e28b191c92ebc998d1 Author: Shirish S Date: Tue Aug 3 14:03:44 2021 +0530 drm/amdgpu/display: fix DMUB firmware version info DMUB firmware info is printed before it gets initialized. Correct this order to ensure true value is conveyed. Signed-off-by: Shirish S Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ffb1a145dc9a4c54096093d2e03d8a0adc5e87e6 Author: Aric Cyr Date: Sun Jul 25 22:10:55 2021 -0400 drm/amd/display: 3.2.147 Acked-by: Aurabindo Pillai Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 1cc00e5e63ce532bcae292c24db8e40a29f51058 Author: Anthony Koo Date: Sat Jul 24 12:58:02 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.77 Acked-by: Aurabindo Pillai Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 0ea7ee8217012f1088ceae85634149d55e9052f9 Author: Rodrigo Siqueira Date: Mon Jul 26 20:52:48 2021 -0400 drm/amd/display: Add DC_FP helper to check FPU state To fully isolate FPU operations in a single place, we must avoid situations where compilers spill FP values to registers due to FP enable in a specific C file. Note that even if we isolate all FPU functions in a single file and call its interface from other files, the compiler might enable the use of FPU before we call DC_FP_START. Nevertheless, it is the programmer's responsibility to invoke DC_FP_START/END in the correct place. To highlight situations where developers forgot to use the FP protection before calling the DC FPU interface functions, we introduce a helper that checks if the function is invoked under FP protection. If not, it will trigger a kernel warning. Changes cince V3: - Rebase Changes cince V2 (Christian): - Do not use this_cpu_* between get/put_cpu_ptr(). - In the kernel documentation, better describe restrictions. - Make dc_assert_fp_enabled trigger the ASSERT message. Changes since V1: - Remove fp_enable variables - Rename dc_is_fp_enabled to dc_assert_fp_enabled - Replace wrong variable type Cc: Harry Wentland Cc: Anson Jacob Cc: Christian König Cc: Hersen Wu Cc: Aric Cyr Cc: Jun Lei Cc: Dmytro Laktyushkin Cc: Qingqing Zhuo Reported-by: kernel test robot Signed-off-by: Rodrigo Siqueira Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2d8471dc371f36fd6ba3b5a4716b39555169df3d Author: Rodrigo Siqueira Date: Mon Jul 26 20:52:47 2021 -0400 drm/amd/display: Add control mechanism for FPU utilization DC invokes DC_FPU_START/END in multiple parts of the code; this can create a situation where we invoke this FPU operation in a nested way or exit too early. For avoiding this situation, this commit adds a mechanism where dc_fpu_begin/end manages the access to kernel_fpu_begin/end. Change since V3: - Rebase Change since V2: - Christian: Do not use this_cpu_* between get/put_cpu_ptr(). Change since V1: - Use a better variable names - Use get_cpu_ptr and put_cpu_ptr to better balance preemption enable and disable Cc: Harry Wentland Cc: Anson Jacob Cc: Christian König Cc: Hersen Wu Cc: Aric Cyr Cc: Jun Lei Cc: Dmytro Laktyushkin Cc: Qingqing Zhuo Reported-by: kernel test robot Signed-off-by: Rodrigo Siqueira Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 96ee63730fa30614e943ac352ef772be49a712d9 Author: Rodrigo Siqueira Date: Mon Jul 26 20:52:46 2021 -0400 drm/amd/display: Add control mechanism for FPU DC invokes DC_FPU_START/END in multiple parts of the code; this can create a situation where we invoke this FPU operation in a nested way or exit too early. For avoiding this situation, this commit adds a mechanism where dc_fpu_begin/end manages the access to kernel_fpu_begin/end. Change since V3: - Christian: Move PPC64 code to dc_fpu_begin/end. Change since V2: - Christian: Do not use this_cpu_* between get/put_cpu_ptr(). Change since V1: - Use a better variable names - Use get_cpu_ptr and put_cpu_ptr to better balance preemption enable and disable Cc: Harry Wentland Cc: Anson Jacob Cc: Christian König Cc: Hersen Wu Cc: Aric Cyr Cc: Jun Lei Cc: Dmytro Laktyushkin Cc: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c8b3538d05f7393e09a29bb0c3f9dda19c1e5da6 Author: Rodrigo Siqueira Date: Mon Jul 26 20:52:45 2021 -0400 drm/amd/display: Move specific DCN2x code that uses FPU to DML The display core files rely on FPU, which requires to be compiled with special flags. Ideally, we don't want these FPU operations spread around the DC code; nevertheless, it happens in the current source. This commit introduces a new directory inside DML for centralizing shared DCN functions that require FPU and have been used outside DML. For illustrating this process of transferring FPU functions to the DML folder, this commit moves one of the functions dcn20_populate_dml_writeback_from_context) that require FPU access to a single shared file. Notice that this is the first part of the work, and it does not fix the FPU issue yet; we still need other patches for achieving the complete FPU isolation. Changes since V3: - Jun: Instead of creating a new directory to keep the FPU code, let's make the DML folder the only part that requires FPU access. Drop fpu_operation folder. - Christian: Fix function code style. Changes since V2: - Christian: Remove unnecessary wrapper. - lkp: Add missing prototype. - Only compile the FPU operations if the DCN option is enabled. Change since V1: - Update documentation and rebase. Cc: Harry Wentland Cc: Anson Jacob Cc: Christian König Cc: Hersen Wu Cc: Aric Cyr Cc: Jun Lei Cc: Dmytro Laktyushkin Cc: Qingqing Zhuo Reported-by: kernel test robot Signed-off-by: Rodrigo Siqueira Reviewed-by: Christian König Signed-off-by: Alex Deucher commit dd2939efd52fdf1e554efcc44a31ba0bcf674c5e Author: Qingqing Zhuo Date: Thu Jul 22 14:48:54 2021 -0400 drm/amd/display: workaround for hard hang on HPD on native DP [Why] HPD disable and enable sequences are not mutually exclusive on Linux. For HPDs that spans over 1s (i.e. HPD low = 1s), part of the disable sequence (specifically, a request to SMU to lower refclk) could come right before the call to PHY enable, causing DMUB to access an unresponsive PHY and thus a hard hang on the system. [How] Disable 48mhz refclk off on native DP. Reviewed-by: Hersen Wu Acked-by: Aurabindo Pillai Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit e13c2ea2f522fecb7b2de4342e4fa10d6e15c26d Author: Jaehyun Chung Date: Thu Jul 22 14:15:11 2021 -0400 drm/amd/display: Add check for validating unsupported ODM plus MPO case [Why] We do not currently support ODM plus MPO on only one side of the screen. This unsupported case causes validation calculations to divide by zero due to invalid viewport values. [How] Add stopgap for the validation of ODM plus MPO on one side of screen case. Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Jaehyun Chung Signed-off-by: Alex Deucher commit f39b21c499585b822da3975a7651007acf012f09 Author: Jude Shih Date: Tue Jul 6 18:04:11 2021 +0800 drm/amd/display: Fix resetting DCN3.1 HW when resuming from S4 [Why] On S4 resume we also need to fix detection of when to reload DMCUB firmware because we're currently using the VBIOS version which isn't compatible with the driver version. [How] Update the hardware init check for DCN31 since it's the ASIC that has this issue. Reviewed-by: Nicholas Kazlauskas Acked-by: Aurabindo Pillai Signed-off-by: Jude Shih Signed-off-by: Alex Deucher commit 8c0fc3bf1a9f1a399550e930dda1035d0aa58fdc Author: Roman Li Date: Fri Jul 16 17:22:06 2021 -0400 drm/amd/display: Remove redundant vblank workqueues in DM [Why] Display Manager initializes array of vblank workqueues, but only 1 is used. [How] Use single instance init instead of array. Reviewed-by: Qingqing Zhou Acked-by: Aurabindo Pillai Signed-off-by: Roman Li Signed-off-by: Alex Deucher commit 2eedeb070e3826dde557531010d152d1b98483fa Author: Bing Guo Date: Tue Jul 20 15:13:38 2021 -0400 drm/amd/display: Increase stutter watermark for dcn303 [Why&How] Hardware team suggested to use SRExitTime= 35.5us as w/a to prevent underflow in certain modes. Reviewed-by: Martin Leung Acked-by: Aurabindo Pillai Signed-off-by: Bing Guo Signed-off-by: Alex Deucher commit a453d2fa4b23fb66e2d786a008415e860263cd4f Author: Bing Guo Date: Mon Jul 19 18:24:06 2021 -0400 drm/amd/display: Fix Dynamic bpp issue with 8K30 with Navi 1X Why: In DCN2x, HW doesn't automatically divide MASTER_UPDATE_LOCK_DB_X by the number of pipes ODM Combined. How: Set MASTER_UPDATE_LOCK_DB_X to the value that is adjusted by the number of pipes ODM Combined. Reviewed-by: Martin Leung Acked-by: Aurabindo Pillai Signed-off-by: Bing Guo Signed-off-by: Alex Deucher commit ba18f2350e494e964de075658a1591c08e1f4a88 Author: Wesley Chalmers Date: Mon Jul 19 13:13:33 2021 -0400 drm/amd/display: Assume LTTPR interop for DCN31+ [WHY] For DCN31 onward, LTTPR is to be enabled and set to Transparent by VBIOS. Driver is to assume that VBIOS has done this without needing to check the VBIOS interop bit. [HOW] Add LTTPR enable and interop VBIOS bits into dc->caps, and force-set the interop bit to true for DCN31+. Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Wesley Chalmers Signed-off-by: Alex Deucher commit 4fb930715468442360f9d8740a65592bfbeb9c24 Author: Candice Li Date: Tue Jul 27 20:40:18 2021 +0800 drm/amd/amdgpu: remove redundant host to psp cmd buf allocations Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 733ee71ae0d03a8b03711dca8bc94c8ac05a6bc3 Author: Ryan Taylor Date: Fri Jun 18 13:16:37 2021 -0700 drm/amdgpu: replace dce_virtual with amdgpu_vkms (v3) Move dce_virtual into amdgpu_vkms and update all references to dce_virtual with amdgpu_vkms. v2: Removed more references to dce_virtual. v3: Restored display modes from previous implementation. Signed-off-by: Ryan Taylor Reported-by: kernel test robot Suggested-by: Alex Deucher Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fd922f7a0e90722b571dcd7ad7b7b4f0af4c80be Author: Ryan Taylor Date: Fri Jun 18 13:03:35 2021 -0700 drm/amdgpu: cleanup dce_virtual Remove obsolete functions and variables from dce_virtual. Signed-off-by: Ryan Taylor Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 84ec374bd580364a32818c9fc269c19d6e931cab Author: Ryan Taylor Date: Mon Jun 7 11:53:06 2021 -0700 drm/amdgpu: create amdgpu_vkms (v4) Modify the VKMS driver into an api that dce_virtual can use to create virtual displays that obey drm's atomic modesetting api. v2: Made local functions static. v3: Switched vkms_output kzalloc for kcalloc. Cleanup patches by moving display mode fixes to this patch. v4: Update atomic_check and atomic_update to comply with new kms api. Signed-off-by: Ryan Taylor Reported-by: kernel test robot Suggested-by: Alex Deucher Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d7b5dae099fbb15adaa51b2a39d6d7af36110e7a Author: zhouchuangao Date: Mon Aug 2 00:32:32 2021 -0700 gpu/drm/amd: Remove duplicated include of drm_drv.h Duplicate include header file line 28: #include line 44: #include Signed-off-by: zhouchuangao Signed-off-by: Alex Deucher commit 067f44c8b4590c3f24d21a037578a478590f2175 Author: Guchun Chen Date: Thu Jul 29 18:35:13 2021 +0800 drm/amdgpu: avoid over-handle of fence driver fini in s3 test (v2) In amdgpu_fence_driver_hw_fini, no need to call drm_sched_fini to stop scheduler in s3 test, otherwise, fence related failure will arrive after resume. To fix this and for a better clean up, move drm_sched_fini from fence_hw_fini to fence_sw_fini, as it's part of driver shutdown, and should never be called in hw_fini. v2: rename amdgpu_fence_driver_init to amdgpu_fence_driver_sw_init, to keep sw_init and sw_fini paired. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1668 Fixes: 8d35a2596164c1 ("drm/amdgpu: adjust fence driver enable sequence") Suggested-by: Christian König Tested-by: Mike Lothian Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a38414335d7d94aec647a5b94f624b125c3418c2 Author: Kevin Wang Date: Mon Aug 2 10:49:55 2021 +0800 drm/amd/pm: correct aldebaran smu feature mapping FEATURE_DATA_CALCULATIONS correct smu feature mapping: FEATURE_DATA_CALCULATIONS it will cause sysfs node of "pp_features" show error. Signed-off-by: Kevin Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 719e433ed0521708f5326e424298a2eb49f59d2e Author: Mukul Joshi Date: Fri Jul 23 16:07:40 2021 -0400 drm/amdgpu: Fix channel_index table layout for Aldebaran Fix the channel_index table layout to fetch the correct channel_index when calculating physical address from normalized address during page retirement. Also, fix the number of UMC instances and number of channels within each UMC instance for Aldebaran. Signed-off-by: Mukul Joshi Reviewed-By: John Clements Signed-off-by: Alex Deucher commit 8d70136e2dc76f085b7423b993e13527f5a1fd7e Author: Randy Dunlap Date: Thu Jul 29 20:03:47 2021 -0700 drm/amdgpu: fix checking pmops when PM_SLEEP is not enabled 'pm_suspend_target_state' is only available when CONFIG_PM_SLEEP is set/enabled. OTOH, when both SUSPEND and HIBERNATION are not set, PM_SLEEP is not set, so this variable cannot be used. ../drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: In function ‘amdgpu_acpi_is_s0ix_active’: ../drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:1046:11: error: ‘pm_suspend_target_state’ undeclared (first use in this function); did you mean ‘__KSYM_pm_suspend_target_state’? return pm_suspend_target_state == PM_SUSPEND_TO_IDLE; ^~~~~~~~~~~~~~~~~~~~~~~ __KSYM_pm_suspend_target_state Also use shorter IS_ENABLED(CONFIG_foo) notation for checking the 2 config symbols. Fixes: 91e273712ab8dd ("drm/amdgpu: Check pmops for desired suspend state") Signed-off-by: Randy Dunlap Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-next@vger.kernel.org Signed-off-by: Alex Deucher commit c73aa9b22315e118567f6f755b95c8a6ce06d44d Author: Xiaomeng Hou Date: Thu Jul 29 15:44:39 2021 +0800 drm/amd/pm: update yellow carp pmfw interface version Correct yellow carp driver-PMFW interface version to v4. Signed-off-by: Xiaomeng Hou Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ddaa1ed52c5da64fe9adf1d5ea6202cda3a53eea Merge: 585fb31c2c3aa e2f6867299ac8 Author: Mark Brown Date: Fri Aug 6 01:46:24 2021 +0100 Merge some cs42l42 patches into asoc-5.15 commit 23a57ee7af01a51cf5e8568f3410dd493ecb8d3d Author: Martin Blumenstingl Date: Sat Jul 3 00:51:45 2021 +0200 clk: stm32mp1: Switch to clk_divider.determine_rate .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210702225145.2643303-7-martin.blumenstingl@googlemail.com Signed-off-by: Stephen Boyd commit f9d6b4832ca8a7e00718ad6cabe7371649be4ae9 Author: Martin Blumenstingl Date: Sat Jul 3 00:51:44 2021 +0200 clk: stm32h7: Switch to clk_divider.determine_rate .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210702225145.2643303-6-martin.blumenstingl@googlemail.com Signed-off-by: Stephen Boyd commit d1e40bc9ff0527bfceed1caa6c1a7a1e2013d7e5 Author: Martin Blumenstingl Date: Sat Jul 3 00:51:43 2021 +0200 clk: stm32f4: Switch to clk_divider.determine_rate .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210702225145.2643303-5-martin.blumenstingl@googlemail.com Signed-off-by: Stephen Boyd commit 699470f372bbd9d087fd30444b126729a38217ac Author: Martin Blumenstingl Date: Sat Jul 3 00:51:42 2021 +0200 clk: bcm2835: Switch to clk_divider.determine_rate .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Marek Szyprowski Cc: Nicolas Saenz Julienne Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210702225145.2643303-4-martin.blumenstingl@googlemail.com Tested-by: Marek Szyprowski Signed-off-by: Stephen Boyd commit 69a00fb3d6970681c15a23595ec54233ce10295c Author: Martin Blumenstingl Date: Sat Jul 3 00:51:40 2021 +0200 clk: divider: Implement and wire up .determine_rate by default .determine_rate is meant to replace .round_rate. The former comes with a benefit which is especially relevant on 32-bit systems: since .determine_rate uses an "unsigned long" (compared to a "signed long" which is used by .round_rate) the maximum value on 32-bit systems increases from 2^31 (or approx. 2.14GHz) to 2^32 (or approx. 4.29GHz). Implement .determine_rate in addition to .round_rate so drivers that are using clk_divider_{ro_,}ops can benefit from this by default. Keep the .round_rate callback for now since some drivers rely on clk_divider_ops.round_rate being implemented. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210702225145.2643303-2-martin.blumenstingl@googlemail.com Signed-off-by: Stephen Boyd commit 28fc39f7abecaed2f4633cd5fd3775b8031dffde Author: Jason Wang Date: Sat Jul 31 21:22:26 2021 +0800 clk: palmas: Add a missing SPDX license header Add the missing SPDX license header to drivers/clk/clk-palmas.c. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20210731132226.424853-1-wangborong@cdjrlc.com [sboyd@kernel.org: Also remove boilerplate from comment] Signed-off-by: Stephen Boyd commit edfa378448b566f705f5e81fd1565dc39ef6b716 Author: Geert Uytterhoeven Date: Wed Jul 14 12:17:36 2021 +0200 clk: Align provider-specific CLK_* bit definitions The definition of CLK_MULTIPLIER_ROUND_CLOSEST is not aligned to the two bit definitions next to it. A deeper inspection reveals that the alignment of CLK_MULTIPLIER_ROUND_CLOSEST does match the most common alignment. Align the bit definitions for the various provider types throughout the file at 40 columns, to increase uniformity. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5468cd9e50cda8fc59cb6baab9413c6c0de1a974.1626257689.git.geert+renesas@glider.be Signed-off-by: Stephen Boyd commit 65ddf6564843890a58ee3b18bb46ce67d96333fb Author: Chao Yu Date: Fri Aug 6 08:04:37 2021 +0800 f2fs: fix to do sanity check for sb/cp fields correctly This patch fixes below problems of sb/cp sanity check: - in sanity_check_raw_superi(), it missed to consider log header blocks while cp_payload check. - in f2fs_sanity_check_ckpt(), it missed to check nat_bits_blocks. Cc: Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4b10651864429386ae931167d3518f37a8c762e0 Author: Chao Yu Date: Fri Aug 6 08:05:58 2021 +0800 f2fs: avoid unneeded memory allocation in __add_ino_entry() __add_ino_entry() will allocate slab cache even if we have already cached ino entry in radix tree, e.g. for case of multiple devices. Let's check radix tree first under protection of rcu lock to see whether we need to do slab allocation, it will mitigate memory pressure from "f2fs_ino_entry" slab cache. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7fd1d00bf8181db4b90c3c9dc25696229d185b5b Author: Maurizio Lombardi Date: Thu Aug 5 18:11:50 2021 +0200 iscsi_ibft: fix warning in reserve_ibft_region() Use %pa to print a physical address. Reported-by: kernel test robot Signed-off-by: Maurizio Lombardi Signed-off-by: Konrad Rzeszutek Wilk commit e2f6867299ac85ce227eee18be11ce2c4a568447 Author: Richard Fitzgerald Date: Thu Aug 5 17:11:11 2021 +0100 ASoC: cs42l42: Update module authors Add the current authors of this module. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20210805161111.10410-8-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit c76d572c1ec82e305c97219e28952966958bc31a Author: Richard Fitzgerald Date: Thu Aug 5 17:11:10 2021 +0100 ASoC: cs42l42: Assume 24-bit samples are in 32-bit slots If the machine driver doesn't call snd_soc_dai_set_sysclk() the SCLK is assumed to be sample_rate * sample_bits * 2 (that is, the rate necessary for a standard I2S frame). But 24-bit samples can be sent in either a 24-bit slot or a 32-bit slot. If the PLL is configured for a 24-bit slot, but a 32-bit slot is used, cs42l42 will be overclocked. Ultimately it is the machine driver's responsibilty to call snd_soc_dai_set_sysclk() if SLK will be different from the standard I2S rate. However, it is convenient to assume 32-bit slots to allow this common case without needing special machine driver support. The machine driver then only has to set SCLK if the slots are 24-bit, but if it fails to do this cs42l42 won't be overclocked. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20210805161111.10410-7-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 24cdbb79bbfe690f7fe87507dd0489670eddb5b0 Author: Richard Fitzgerald Date: Thu Aug 5 17:11:09 2021 +0100 ASoC: cs42l42: Validate dai_set_sysclk() frequency If the machine driver calls snd_set_sysclk() with an unsupported SCLK frequency, return an error instead of letting hw_params() fail. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20210805161111.10410-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit b962bae81fa40fcce7662edcb1e426fa37d32abb Author: Richard Fitzgerald Date: Thu Aug 5 17:11:08 2021 +0100 ASoC: cs42l42: Add PLL configuration for 44.1kHz/16-bit 44.1kHz 16-bit standard I2S gives a SCLK of 1.4112 MHz. Add a PLL configuration for this. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20210805161111.10410-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 0ca8d3ca4561535f97b31e7b8de569c69bc3b27b Merge: 23809a726c0d0 902e7f373fff2 Author: Jakub Kicinski Date: Thu Aug 5 14:59:40 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Build failure in drivers/net/wwan/mhi_wwan_mbim.c: add missing parameter (0, assuming we don't want buffer pre-alloc). Conflict in drivers/net/dsa/sja1105/sja1105_main.c between: 589918df9322 ("net: dsa: sja1105: be stateless with FDB entries on SJA1105P/Q/R/S/SJA1110 too") 0fac6aa098ed ("net: dsa: sja1105: delete the best_effort_vlan_filtering mode") Follow the instructions from the commit message of the former commit - removed the if conditions. When looking at commit 589918df9322 ("net: dsa: sja1105: be stateless with FDB entries on SJA1105P/Q/R/S/SJA1110 too") note that the mask_iotag fields get removed by the following patch. Signed-off-by: Jakub Kicinski commit 49f7844b08844ac7029f997702099c552566262b Merge: 04d505de7f82c 5a04227326b04 Author: Dave Airlie Date: Fri Aug 6 06:55:58 2021 +1000 Merge tag 'drm-misc-next-2021-08-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.15: UAPI Changes: Cross-subsystem Changes: Core Changes: - Assorted docbook updates. - Unbreak damage selftests. - Define DRM_FORMAT_MAX_PLANES, maximum planes for a planar format. - Add gem fb vmap/vunmap helpers, use them in gud and vkms drivers. Driver Changes: - Bridge fixes for ti-sn65dsi86. - Use a full-featured driver for ATNA33XC20 to get backlight right, instead of the simple panel driver. - Assorted fixes to pl111,. - Support E Ink VB3300-KCA panel. - Add support for Gopher 2b LCD and ilitek ili9341 panels. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/e460fece-cfd9-6aa4-37c1-0fb1b473196d@linux.intel.com commit 598fe77df855feeeca9dfda2ffe622ac7724e5c3 Author: Mark Bloch Date: Tue Aug 3 16:19:59 2021 -0700 net/mlx5: Lag, Create shared FDB when in switchdev mode If both eswitches are in switchdev mode and the uplink representors are enslaved to the same bond device create a shared FDB configuration. When moving to shared FDB mode not only the hardware needs be configured but the RDMA driver needs to reconfigure itself. When such change is done, unload the RDMA devices, configure the hardware and load the RDMA representors. When destroying the lag (can happen if a PCI function is unbinded, driver is unloaded or by just removing a netdev from the bond) make sure to restore the system to the previous state only if possible. For example, if a PCI function is unbinded there is no need to load the representors as the device is going away. Signed-off-by: Mark Bloch Signed-off-by: Saeed Mahameed commit db202995f5035f13a11df48a0af05edbb3720659 Author: Mark Bloch Date: Tue Aug 3 16:19:58 2021 -0700 net/mlx5: E-Switch, add logic to enable shared FDB Shared FDB allows to direct traffic from all the vports in the HCA to a single eswitch. In order to do that three things are needed. 1) Point the ingress ACL of the slave uplink to that of the master. With this, wire traffic from both uplinks will reach the same eswitch with the same metadata where a single steering rule can catch traffic from both ports. 2) Set the FDB root flow table of the slave's eswitch to that of the master. As this flow table can change dynamically make sure to sync it on any set root flow table FDB command. This will make sure traffic from SFs, VFs, ECPFs and PFs reach the master eswitch. 3) Split wire traffic at the eswitch manager egress ACL so that it's directed to the native eswitch manager. We only treat wire traffic from both ports the same at the eswitch level. If such traffic wasn't handled in the eswitch it needs to reach the right representor to be processed by software. For example LACP packets should *always* reach the right uplink representor for correct operation. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 63d4a9afbcee4167ffb0d126b23b8884b15e5837 Author: Mark Bloch Date: Tue Aug 3 16:19:57 2021 -0700 net/mlx5: Lag, move lag destruction to a workqueue If a netdev is removed from the lag the lag should be destroyed. With downstream patches this might trigger a reconfiguration of representors on a different eswitch and such we don't have the proper locking to so from this path. Move the destruction to be done by the workqueue. As the destruction won't affect the netdev side it okay to do so. The RDMA side will be reconfigured and it already coded to handle such reconfiguration. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit cac1eb2cf2e338260c5e2ffb098dfa0508ee40aa Author: Mark Bloch Date: Tue Aug 3 16:19:56 2021 -0700 net/mlx5: Lag, properly lock eswitch if needed Currently when doing hardware lag we check the eswitch mode but as this isn't done under a lock the check isn't valid. As the code needs to sync between two different devices an extra care is needed. - When going to change eswitch mode, if hardware lag is active destroy it. - While changing eswitch modes block any hardware bond creation. - Delay handling bonding events until there are no mode changes in progress. - When attaching a new mdev to lag, block until there is no mode change in progress. In order for the mode change to finish the interface lock will have to be taken. Release the lock and sleep for 100ms to allow forward progress. As this is a very rare condition (can happen if the user unbinds and binds a PCI function while also changing eswitch mode of the other PCI function) it has no real world impact. As taking multiple eswitch mode locks is now required lockdep will complain about a possible deadlock. Register a key per eswitch to make lockdep happy. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 898b07861565e7276de6f179a196b062a2c72f8d Author: Mark Bloch Date: Tue Aug 3 16:19:55 2021 -0700 net/mlx5: Add send to vport rules on paired device When two mlx5 devices are paired in switchdev mode, always offload the send-to-vport rule to the peer E-Switch. This allows to abstract the logic when this is really necessary (single FDB) and combine the logic of both cases into one. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit c8e6a9e6d6bb29db08e0b69ae97f1e46ccc5691c Author: Mark Bloch Date: Tue Aug 3 16:19:54 2021 -0700 net/mlx5: E-Switch, Add event callback for representors This callback will allow to notify representors about relevant events when in OFFLOADS mode. In downstream patches, this will be used to notify about PAIR/UNPAIR devcom events. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 2198b93279b2fa36bfc51c621d14f93244fb4965 Author: Roi Dayan Date: Tue Aug 3 16:19:53 2021 -0700 net/mlx5e: Use shared mappings for restoring from metadata FTEs are added with mapped metadata which is saved per eswitch. When uplink reps are bonded and we are in a single FDB mode, we could fail to find metadata which was stored on one eswitch mapping but not the other or with a different id. To resolve this issue use shared mapping between eswitch ports. We do not have any conflict using a single mapping, for a type, between the ports. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 5d5defd6b8915d031af5b71bf463991d14644f89 Author: Roi Dayan Date: Tue Aug 3 16:19:52 2021 -0700 net/mlx5e: Add an option to create a shared mapping The shared mapping is identified by an id and type. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit d04442540372b1c0ae0e13eaca5851cb0a4464af Author: Ariel Levkovich Date: Tue Aug 3 16:19:51 2021 -0700 net/mlx5: E-Switch, set flow source for send to uplink rule Set the flow source param to local vport for the uplink rep send-to-vport rule. This will comply with the recent changes in SW steering that use the flow source as an indication for the rule type - rx or tx. Since the uplink send-to-vport rule is forwarding traffic to the wire it has to indicate that it is an sx rule and can't use the any port value in the flow source. Signed-off-by: Ariel Levkovich Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit c446d9da64075b1c8b55df9acaae72c7686c59a5 Author: Mark Bloch Date: Tue Aug 3 16:19:50 2021 -0700 RDMA/mlx5: Add shared FDB support Shared FDB allows to create a single RDMA device that holds representors from both eswitches. As shared FDB is only active when both uplink representors are enslaved there is a single RDMA port that represents both uplinks. The number of ports is the number of vports on both eswitches minus one as we only need 1 port for both uplinks. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 979bf468fc543444eb750c8f8817407f509bd504 Author: Mark Bloch Date: Tue Aug 3 16:19:49 2021 -0700 {net, RDMA}/mlx5: Extend send to vport rules In shared FDB there is only one eswitch which is active and it receives traffic from all representors and all vports in the HCA. While the Ethernet representor will always reside on its native PF the IB representor will not. Extend send to vport rule creation to support such flows. Need to account for source vport that sends the traffic (on which the representors resides) and the target eswitch the traffic which reach. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 6aeb16a1345e480bd395b9168570e93c902a05f3 Author: Mark Bloch Date: Tue Aug 3 16:19:48 2021 -0700 RDMA/mlx5: Fill port info based on the relevant eswitch In shared FDB a single RDMA device can have representors that are connected to two different eswitches. Use the right eswitch when preparing the response to userspace. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit af8c0e25f249abf8829f0cfa074b08d7398e3e38 Author: Mark Bloch Date: Tue Aug 3 16:19:47 2021 -0700 net/mlx5: Lag, add initial logic for shared FDB As shared FDB requires changes in two subsystems first expose the needed core functions so the RDMA side can be changed. mlx5_lag_is_master(): return true if a given mlx5 device is the lag master. mlx5_lag_is_shared_fdb(): Returns true if the lag mode is shared FDB. mlx5_lag_get_peer_mdev(): Return the peer mdev in lag. The mentioned functions will be used by downstream patches in order to add support for shared FDB for the RDMA side. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 97a8a8c1f985baf13a3d0d252b787850330d2ea7 Author: Mark Bloch Date: Tue Aug 3 16:19:46 2021 -0700 net/mlx5: Return mdev from eswitch Export a function so users can retrieve the mellanox device that manages the eswitch from the eswitch device. Signed-off-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Saeed Mahameed commit 4a956abc170acc8c096b86d6e7f2b02b024b25f7 Author: Larry Finger Date: Thu Aug 5 14:26:44 2021 -0500 staging: r8188eu: Remove wrapper rtw_sleep_schedulable() This wrapper is never used. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-6-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 8b2403d0d355008cdcd1975072e12862977eeaa8 Author: Larry Finger Date: Thu Aug 5 14:26:43 2021 -0500 staging: r8188eu: Remove wrapper rtw_get_time_interval_ms() This one is never used. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 49f2a554eb408b75773a42bc1132fe14f825abf7 Author: Larry Finger Date: Thu Aug 5 14:26:42 2021 -0500 staging: r8188eu: Remove wrapper rtw_udelay_os() This wrapper is a simple call to udelay(). Remove it. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit e72e1495c6f77b47598aab1a5df0413d4b883b7d Author: Larry Finger Date: Thu Aug 5 14:26:41 2021 -0500 staging: r8188eu: Remove wrapper rtw_mdelay_os() This wrapper just calls mdelay(). Remove it. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit d21edee5a4276b1c25bf0599846842396c892d5c Author: Larry Finger Date: Thu Aug 5 14:26:40 2021 -0500 staging: r8188eu: Remove wrapper routine rtw_msleep_os() The effect of this macro is to call msleep(). Remove the wrapper. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 0e08f5b76a3c6636a78455a7aeaaa311890c7532 Author: Larry Finger Date: Thu Aug 5 14:26:39 2021 -0500 staging: r8188eu: Remove rtw_yield_os() This wrapper is just a call to yield(). Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805192644.15978-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit e9a13babd69f0ed2ac70b6fbee515afe88397b49 Author: Mauro Carvalho Chehab Date: Thu Jul 22 12:00:09 2021 +0200 MAINTAINERS: update gpio-zynq.yaml reference Changeset 45ca16072b70 ("dt-bindings: gpio: zynq: convert bindings to YAML") renamed: Documentation/devicetree/bindings/gpio/gpio-zynq.txt to: Documentation/devicetree/bindings/gpio/gpio-zynq.yaml. Update its cross-reference accordingly. Fixes: 45ca16072b70 ("dt-bindings: gpio: zynq: convert bindings to YAML") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Bartosz Golaszewski commit 2606e7c9f5fce1d6c8a75c20947049b63c1b8333 Author: Akhil R Date: Mon Jul 19 10:16:41 2021 +0530 gpio: tegra186: Add ACPI support Add ACPI module ID to probe the driver from the ACPI based bootloader firmware. Signed-off-by: Akhil R Reviewed-by: Andy Shevchenko Reviewed-by: Jon Hunter Signed-off-by: Bartosz Golaszewski commit 8990899d84d7f46c0c1cd3f41135707b26d0eeaa Author: Krzysztof Kozlowski Date: Wed Jul 28 16:42:29 2021 +0200 gpiolib: of: constify few local device_node variables gpiolib does not modify struct device_node, so few local pointers can point to a const data. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit e6ae9a833ef4043b940954b8dcac31493706b9d6 Author: Krzysztof Kozlowski Date: Wed Jul 28 16:42:28 2021 +0200 gpiolib: constify passed device_node pointer Several gpiolib functions receive pointer to struct device_node which is later passed to OF functions. These OF functions accept already pointer to const, so gpiolib can follow similar approach to indicate they are not modifying the struct device_node. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit a065d5615fc83908ef21ed8159ffb63d816ff5de Author: Krzysztof Kozlowski Date: Wed Jul 28 16:42:27 2021 +0200 of: unify of_count_phandle_with_args() arguments with !CONFIG_OF Unify the declaration of of_count_phandle_with_args() between enabled and disabled OF by making constifying pointed device_node. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit 585fb31c2c3aad38a5add009171d7e3277b76d45 Author: Dmitry Osipenko Date: Mon Aug 2 21:52:58 2021 +0300 ASoC: rt5640: Silence warning message about missing interrupt Interrupt is optional for the RT5640 codec. Nexus 7 doesn't use interrupt, this results in a noisy warning message that looks like a error condition. Make interrupt explicitly optional to silence the message, use modern IRQF_NO_AUTOEN flag and correct the reg[q]uest typo in the message. Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20210802185258.1881-1-digetx@gmail.com Signed-off-by: Mark Brown commit bcee7ed09b8e70b65d5c04f5d1acd2cf4213c2f3 Author: Srinivas Kandagatla Date: Fri Jul 16 11:59:18 2021 +0100 ASoC: codecs: wcd938x: add Multi Button Headset Control support WCD938x has Multi Button Headset Control hardware to support Headset insertion, type detection, 8 headset buttons detection, Over Current detection and Impedence measurements. This patch adds support for this using wcd-mbhc apis. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210716105918.7301-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit f43837f4f63b1a58084d7147b8b34c0f3dd261f6 Author: Steven Lee Date: Mon Jul 12 18:03:16 2021 +0800 gpio: gpio-aspeed-sgpio: Return error if ngpios is not multiple of 8. Add an else-if condition in the probe function to check whether ngpios is multiple of 8. Per AST datasheet, numbers of available serial GPIO pins in Serial GPIO Configuration Register must be n bytes. For instance, if n = 1, it means AST SoC supports 8 GPIO pins. Signed-off-by: Steven Lee Reviewed-by: Andrew Jeffery Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 1f857b675237d77590d439f16c5927ec3e4b1f0e Author: Steven Lee Date: Mon Jul 12 18:03:15 2021 +0800 gpio: gpio-aspeed-sgpio: Use generic device property APIs Replace all of_property_read_u32() with device_property_read_u32(). Signed-off-by: Steven Lee Acked-by: Andrew Jeffery Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 09ac953b65b167efdaac25c63f2f1786f4faa801 Author: Steven Lee Date: Mon Jul 12 18:03:14 2021 +0800 gpio: gpio-aspeed-sgpio: Move irq_chip to aspeed-sgpio struct The current design initializes irq->chip from a global irqchip struct, which causes multiple sgpio devices use the same irq_chip. The patch moves irq_chip to aspeed_sgpio struct for initializing irq_chip from their private gpio struct. Signed-off-by: Steven Lee Reviewed-by: Andrew Jeffery Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 8a3581c666f97bec53baebf2ed77e4954be0384d Author: Steven Lee Date: Mon Jul 12 18:03:13 2021 +0800 gpio: gpio-aspeed-sgpio: Add set_config function AST SoC supports *retain pin state* function when wdt reset. The patch adds set_config function for handling sgpio reset tolerance register. Signed-off-by: Steven Lee Reviewed-by: Andrew Jeffery Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e1f85d25638cce2c5535efb608adf7a6ee817794 Author: Steven Lee Date: Mon Jul 12 18:03:12 2021 +0800 gpio: gpio-aspeed-sgpio: Add AST2600 sgpio support The maximum number of gpio pins of SoC is hardcoded as 80 and the gpio pin count mask for GPIO Configuration register is hardcode as GENMASK(9,6). However, AST2600 has 2 sgpio master interfaces, one of them supports up to 128 gpio pins and pin count mask of GPIO Configuration Register is 5 bits. The patch adds ast2600 compatibles, removes MAX_NR_HW_SGPIO and corresponding design to make the gpio input/output pin base are determined by ngpios. The patch also removed hardcoded pin mask and adds ast2400, ast2500, ast2600 platform data that include gpio pin count mask for GPIO Configuration Register. The original pin order is as follows: (suppose MAX_NR_HW_SGPIO is 80 and ngpios is 10 as well) Input: 0 1 2 3 ... 9 Output: 80 81 82 ... 89 The new pin order is as follows: Input: 0 2 4 6 ... 18 Output: 1 3 5 7 ... 19 SGPIO pin id and input/output pin mapping is as follows: SGPIO0(0,1), SGPIO1(2,3), ..., SGPIO79(158,159) For example: Access SGPIO5(10,11) Get SGPIO pin 5 (suppose sgpio chip id is 2) gpioget 2 10 Set SGPIO pin 5 (suppose sgpio chip id is 2) gpioset 2 11=1 gpioset 2 11=0 Signed-off-by: Steven Lee Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 41bc951de77aea91913e583bde3a91a3aec66268 Merge: 7002ab41920f3 8c62dbcb489aa Author: Mark Brown Date: Thu Aug 5 20:15:53 2021 +0100 Merge series "ASoC: codecs: cppcheck warnings" from Pierre-Louis Bossart : Two minor corrections for return values, and one more important one for max98090 where duplicate reads don't seem necessary. Pierre-Louis Bossart (3): ASoC: max98090: remove duplicate status reads and useless assignmment ASoC: mt6359-accdet.c: remove useless assignments ASoC: wcd938x: simplify return value sound/soc/codecs/max98090.c | 4 +--- sound/soc/codecs/mt6359-accdet.c | 8 ++++---- sound/soc/codecs/wcd938x.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) -- 2.25.1 commit 7002ab41920f385950cd2b116ce79d4424fa6f9e Merge: 36a9d79e5e951 f2ff5fbe343d0 Author: Mark Brown Date: Thu Aug 5 20:15:52 2021 +0100 Merge series "ASoC: soc-dapm: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-dapm. Kuninori Morimoto (12): ASoC: soc-dapm: cleanup cppcheck warning at dapm_wcache_lookup() ASoC: soc-dapm: cleanup cppcheck warning at dapm_connect_mux() ASoC: soc-dapm: cleanup cppcheck warning at dapm_set_mixer_path_status() ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_pga() ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_dai_link() ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_check_event() ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_run() ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_del_route() ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_add_routes() ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_weak_routes() ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_new_controls() ASoC: soc-dapm: cleanup cppcheck warning at soc_dapm_dai_stream_event() sound/soc/soc-dapm.c | 65 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 32 deletions(-) -- 2.25.1 commit bf7396230f74bf4e9d0da4f703fc73b27a8f01df Author: Nathan Chancellor Date: Thu Aug 5 11:58:07 2021 -0700 staging: r8188eu: Remove pointless NULL check in rtw_check_join_candidate() Clang warns: drivers/staging/r8188eu/core/rtw_mlme.c:1629:28: warning: address of array 'pmlmepriv->assoc_ssid.Ssid' will always evaluate to 'true' [-Wpointer-bool-conversion] if (pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) { ~~~~~~~~~~~~~~~~~~~~~~^~~~ ~~ 1 warning generated. Ssid is an array not at the beginning of a struct so its address cannot be NULL so remove the check. Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210805185807.3296077-4-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 760e7353a6e13e73a73b419cac766b4a718d711c Author: Nathan Chancellor Date: Thu Aug 5 11:58:06 2021 -0700 staging: r8188eu: Remove self assignment in get_rx_power_val_by_reg() Clang warns: drivers/staging/r8188eu/hal/rtl8188e_rf6052.c:344:13: warning: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign] writeVal = writeVal; ~~~~~~~~ ^ ~~~~~~~~ 1 warning generated. Remove this branch as it is useless. Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210805185807.3296077-3-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 717d933d003c88668cbfab145d02c86ff3cf8756 Author: Nathan Chancellor Date: Thu Aug 5 11:58:05 2021 -0700 staging: r8188eu: Remove unnecessary parentheses Clang warns several times across the driver along the lines of: drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((pwrpriv->rpwm == pslv)) { ~~~~~~~~~~~~~~^~~~~~~ drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: remove extraneous parentheses around the comparison to silence this warning if ((pwrpriv->rpwm == pslv)) { ~ ^ ~ drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: use '=' to turn this equality comparison into an assignment if ((pwrpriv->rpwm == pslv)) { ^~ = 1 warning generated. The compilers have agreed that single parentheses are used for equality and double parentheses are used for assignment within control flow statements such as if and while so remove them in these places to fix the warning. Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210805185807.3296077-2-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 0c044f7d96d3e220d4a683827be3dada5e308e8e Author: Søren Andersen Date: Thu Aug 5 13:19:44 2021 +0200 drm/panel: simple: add LOGIC Technologies LTTD800480070-L6WH-RT Add support for the LOGIC Technologies, Inc LTTD800480070-L6WH-RT Signed-off-by: Sam Ravnborg Co-developed-by: Søren Andersen Signed-off-by: Søren Andersen Signed-off-by: Oleksij Rempel Reviewed-by: Ahmad Fatoum Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210805111944.13533-3-o.rempel@pengutronix.de commit 81162f4bdeca7cedd4176f61cfec778af3fa5dc1 Author: Sam Ravnborg Date: Thu Aug 5 13:19:43 2021 +0200 drm/panel: simple: add Multi-Innotechnology MI1010AIT-1CP1 The Multi Innotechnology is a 10.1" 1280x800 panel. The datasheet did not specify specific values for sync, back, front porch. The values are a best guess based on values for similar panels. Signed-off-by: Sam Ravnborg Co-developed-by: Ulrich Ölmann Signed-off-by: Ulrich Ölmann Signed-off-by: Oleksij Rempel Reviewed-by: Ahmad Fatoum Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210805111944.13533-2-o.rempel@pengutronix.de commit d48401b8609ff19db0f461759ac6b5210cd81288 Author: Larry Finger Date: Thu Aug 5 13:37:17 2021 -0500 staging: r8188eu: Remove rtw_buf_free() This routine is just a wrapper around kfree(). The wrapper also sets buffer length to 0, and the pointer to NULL. The length variable is in the struct to be freed, thus setting it to zero is meaningless. Setting the pointer to NULL is also not needed. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805183717.23007-6-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 346d13128a86db4f64e7ffa01527693e0112fb81 Author: Larry Finger Date: Thu Aug 5 13:37:16 2021 -0500 staging: r8188eu: Remove more empty routines After removing some empty routines in os_dep/osdep_service.c, new routines become empty. These include rtw_mfree_stainfo(), _rtw_free_sta_xmit_priv_lock(), and rtw_mfree_recv_priv_lock. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805183717.23007-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 1c10f2b95cc1b24166959c0694a0d812bf665a89 Author: Larry Finger Date: Thu Aug 5 13:37:15 2021 -0500 staging: r8188eu: Remove all calls to _rtw_spinlock_free() This routine is empty, thus all calls to it can be removed. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805183717.23007-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 71f09c5ae9d2c2c1344987b104dc167ab1922b72 Author: Larry Finger Date: Thu Aug 5 13:37:14 2021 -0500 staging: r8188eu: Remove wrapper around vfree This call is so simple that there is no need, or use, for a wrapper. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805183717.23007-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 79f712ea994de30b3887a45e9ca42fd47b840b62 Author: Larry Finger Date: Thu Aug 5 13:37:13 2021 -0500 staging: r8188eu: Remove wrappers for kalloc() and kzalloc() These wrappers involve an in_interrupt() call, which is not frowned on in the kernel. These changes decrease the size of the driver by a trivial amount. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210805183717.23007-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 66e9564aae0185eb7f36d946b0ba22b779a4e193 Author: Fabio M. De Francesco Date: Thu Aug 5 15:11:08 2021 +0200 staging: r8188eu: Fix incorrect types in arguments GCC + Sparse emit warnings of passing incorrect type in arguments of some functions because of different base types. Fix them by changing the types of the parameters of the above-mentioned functions. In the meantime, remove the unnecessary casts of those arguments which are then passed to memcpy() within those same functions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210805131108.19775-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 066eea44c1ea430cabebffc383dcaa861fa9a2b9 Author: Michael Straube Date: Thu Aug 5 16:09:41 2021 +0200 staging: r8188eu: fix build error Remove unnecessary label to fix build error introduced with commit b398ff88aa36 ("staging: r8188eu: remove return from void functions") drivers/staging/r8188eu/hal/rtl8188e_dm.c:182:1: error: label at end of compound statement Reported-by: kernel test robot Signed-off-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210805140941.9130-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 94afd6d6e5253179c9b891d02081cc8355a11768 Author: Chao Yu Date: Wed Aug 4 10:23:48 2021 +0800 f2fs: extent cache: support unaligned extent Compressed inode may suffer read performance issue due to it can not use extent cache, so I propose to add this unaligned extent support to improve it. Currently, it only works in readonly format f2fs image. Unaligned extent: in one compressed cluster, physical block number will be less than logical block number, so we add an extra physical block length in extent info in order to indicate such extent status. The idea is if one whole cluster blocks are contiguous physically, once its mapping info was readed at first time, we will cache an unaligned (or aligned) extent info entry in extent cache, it expects that the mapping info will be hitted when rereading cluster. Merge policy: - Aligned extents can be merged. - Aligned extent and unaligned extent can not be merged. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2112f5c1330a671fa852051d85cb9eadc05d7eb7 Author: Bart Van Assche Date: Thu Aug 5 10:42:00 2021 -0700 loop: Select I/O scheduler 'none' from inside add_disk() We noticed that the user interface of Android devices becomes very slow under memory pressure. This is because Android uses the zram driver on top of the loop driver for swapping, because under memory pressure the swap code alternates reads and writes quickly, because mq-deadline is the default scheduler for loop devices and because mq-deadline delays writes by five seconds for such a workload with default settings. Fix this by making the kernel select I/O scheduler 'none' from inside add_disk() for loop devices. This default can be overridden at any time from user space, e.g. via a udev rule. This approach has an advantage compared to changing the I/O scheduler from userspace from 'mq-deadline' into 'none', namely that synchronize_rcu() does not get called. This patch changes the default I/O scheduler for loop devices from 'mq-deadline' into 'none'. Additionally, this patch reduces the Android boot time on my test setup with 0.5 seconds compared to configuring the loop I/O scheduler from user space. Cc: Christoph Hellwig Cc: Ming Lei Cc: Tetsuo Handa Cc: Martijn Coenen Cc: Jaegeuk Kim Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20210805174200.3250718-3-bvanassche@acm.org Signed-off-by: Jens Axboe commit 90b7198001f23ea37d3b46dc631bdaa2357a20b1 Author: Bart Van Assche Date: Thu Aug 5 10:41:59 2021 -0700 blk-mq: Introduce the BLK_MQ_F_NO_SCHED_BY_DEFAULT flag elevator_get_default() uses the following algorithm to select an I/O scheduler from inside add_disk(): - In case of a single hardware queue or if sharing hardware queues across multiple request queues (BLK_MQ_F_TAG_HCTX_SHARED), use mq-deadline. - Otherwise, use 'none'. This is a good choice for most but not for all block drivers. Make it possible to override the selection of mq-deadline with a new flag, namely BLK_MQ_F_NO_SCHED_BY_DEFAULT. Cc: Christoph Hellwig Cc: Ming Lei Cc: Tetsuo Handa Cc: Martijn Coenen Cc: Jaegeuk Kim Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20210805174200.3250718-2-bvanassche@acm.org Signed-off-by: Jens Axboe commit 6b3ba1e77d8913ee6ffb3972e889bc35550ed95c Author: Tiezhu Yang Date: Thu Aug 5 21:30:24 2021 +0800 f2fs: Kconfig: clean up config options about compression In fs/f2fs/Kconfig, F2FS_FS_LZ4HC depends on F2FS_FS_LZ4 and F2FS_FS_LZ4 depends on F2FS_FS_COMPRESSION, so no need to make F2FS_FS_LZ4HC depends on F2FS_FS_COMPRESSION explicitly, remove the redudant "depends on", do the similar thing for F2FS_FS_LZORLE. At the same time, it is better to move F2FS_FS_LZORLE next to F2FS_FS_LZO, it looks like a little more clear when make menuconfig, the location of "LZO-RLE compression support" is under "LZO compression support" instead of "F2FS compression feature". Without this patch: F2FS compression feature LZO compression support LZ4 compression support LZ4HC compression support ZSTD compression support LZO-RLE compression support With this patch: F2FS compression feature LZO compression support LZO-RLE compression support LZ4 compression support LZ4HC compression support ZSTD compression support Signed-off-by: Tiezhu Yang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ae44f9c286da3fbb3f827076403ea64fa9adfef2 Author: Matthew Wilcox (Oracle) Date: Wed Aug 4 20:07:34 2021 -0700 iomap: Add another assertion to inline data handling Check that the file tail does not cross a page boundary. Requested by Andreas. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ab069d5fdcd14530d4223746c8d01f421d4c4057 Author: Matthew Wilcox (Oracle) Date: Wed Aug 4 20:07:33 2021 -0700 iomap: Use kmap_local_page instead of kmap_atomic kmap_atomic() has the side-effect of disabling pagefaults and preemption. kmap_local_page() does not do this and is preferred. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 213e19d659f9bb891387f105281a63700594a3dd Author: Hans de Goede Date: Sun Aug 1 15:31:05 2021 +0200 power: supply: axp288_fuel_gauge: Take the P-Unit semaphore only once during probe() The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus. If not explicitly taken by the I2C-driver, then this semaphore is automatically taken by the I2C-bus-driver for each I2C-transfer and this is a quite expensive operation. Explicitly take the semaphore in probe() around the register-accesses done during probe, so that this only needs to be done once, rather then once per register-access. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 964b3e9b02bd89a17fdd108a2ecb053beba2b43f Author: Hans de Goede Date: Sun Aug 1 15:31:04 2021 +0200 power: supply: axp288_fuel_gauge: Move the AXP20X_CC_CTRL check together with the other checks The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus. If not explicitly taken by the I2C-driver, then this semaphore is automatically taken by the I2C-bus-driver for each I2C-transfer. Move the AXP20X_CC_CTRL check done in probe() together with the other register-accesses done in probe, so that we can take the semaphore once for the entire set of register-accesses. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 394088f0b0668a1972b35fb25c54dedd1e89da7e Author: Andrejus Basovas Date: Sun Aug 1 15:31:03 2021 +0200 power: supply: axp288_fuel_gauge: Refresh all registers in one go The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus and while the kernel holds the semaphore the CPU and GPU power-states must not be changed otherwise the system will freeze. This is a complex process, which is quite expensive. This is all done by iosf_mbi_block_punit_i2c_access(). To ensure that no unguarded I2C-bus accesses happen, iosf_mbi_block_punit_i2c_access() gets called by the I2C-bus-driver for every I2C transfer. Because this is so expensive it is allowed to call iosf_mbi_block_punit_i2c_access() in a nested fashion, so that higher-level code which does multiple I2C-transfers can call it once for a group of transfers, turning the calls done by the I2C-bus-driver into no-ops. Userspace power-supply API users typically will read all provided properties in one go, refreshing the last read values when power_supply_changed() is called by the driver and/or periodically (e.g. every 2 minutes). The reading of all properties in one go causes the P-Unit semaphore to quickly be taken and released multiple times in a row. Certain PMIC registers like AXP20X_FG_RES are even used in multiple properties so they get read multiple times, leading to a P-Unit take + release each time the register is read. As already mentioned the taking of the P-Unit semaphore is a quite expensive operation and it has also been reported that the "hammering" of the P-Unit semaphore done by the axp288_fuel_gauge driver can even cause stability issues with the system as a whole. Switch over to a scheme where the axp288_fuel_gauge driver keeps a local copy of all the registers which it uses for properties and make it only refresh its copy of the registers if the values are older then 1 minute; or when a fuel-gauge interrupt has triggered since the last read. This not only reduces the amount of reads, it also makes the code do all the reads in one go, rather then reading specific registers based on which property is being queried. This allows calling iosf_mbi_block_punit_i2c_access() once before doing all the reads, so that we now only take the P-Unit semaphore once per update. Tested-by: Andrejus Basovas Signed-off-by: Andrejus Basovas Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit c371d4491ba6356d5e437bd8cc8a72797f3e93bd Author: Hans de Goede Date: Sun Aug 1 15:31:02 2021 +0200 power: supply: axp288_fuel_gauge: Only read PWR_OP_MODE, FG_LOW_CAP_REG regs once Accessing registers on the AXP288 is quite expensive, so we should avoid doing unnecessary accesses. The FG_LOW_CAP_REG never changes underneath us, so we only need to read it once. Devices with an AXP288 do not have user-replace (let alone hot-swappable) batteries and the only bit we care about in the PWR_OP_MODE register is the CHRG_STAT_BAT_PRESENT bit, so we can get away with only reading the PWR_OP_MODE register once too. Note that the FG_LOW_CAP_REG is not marked volatile in the regmap, so we were effectively already reading it once. This change makes this explicit, this is done as preparation of a further patch which moves all remaining register accesses in fuel_gauge_get_property() out of that function. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 7eef3e663834476946ecd4a43b4e1a2cb2bc9884 Author: Hans de Goede Date: Sun Aug 1 15:31:01 2021 +0200 power: supply: axp288_fuel_gauge: Store struct device pointer in axp288_fg_info Directly store the struct device pointer in axp288_fg_info, rather then storing a pointer to the struct platform_device there and then using "&info->pdev->dev" everywhere. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit f17bda7f655fa5ede982a487b8f6d732bbe1959a Author: Hans de Goede Date: Sun Aug 1 15:31:00 2021 +0200 power: supply: axp288_fuel_gauge: Drop retry logic from fuel_gauge_reg_readb() The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus. This semaphore is automatically taken by the I2C-bus-driver. The retry on -EBUSY logic in fuel_gauge_reg_readb() likely was added to deal with the I2C-bus-drive returning -EBUSY when it failed to take the semaphore, but this really should never happen. The semaphore code even has a WARN_ON(ret) to log a kernel backtrace if this does somehow happen, when this happens something is seriously wrong and the system typically freezes soon afterwards. TL;DR: the regmap_read() should never fail with -EBUSY so the retries are unnecessary. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit caa534c3ba40c6e8352b42cbbbca9ba481814ac8 Author: Hans de Goede Date: Sun Aug 1 15:30:59 2021 +0200 power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors When fuel_gauge_reg_readb()/_writeb() fails, report which register we were trying to read / write when the error happened. Also reword the message a bit: - Drop the axp288 prefix, dev_err() already prints this - Switch from telegram / abbreviated style to a normal sentence, aligning the message with those from fuel_gauge_read_*bit_word() Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 8f6cc48e1aff3c1d641a65f3ad6d01c233269ea8 Author: Hans de Goede Date: Sun Aug 1 15:30:58 2021 +0200 power: supply: axp288_fuel_gauge: Silence the chatty IRQ mapping code Drop the IRQ mapping messages, because they are really not interesting at all. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit fc0db6556c4170205391cdcf0f2de0bc99d4ef4e Author: Hans de Goede Date: Sun Aug 1 15:30:57 2021 +0200 power: supply: axp288_fuel_gauge: Remove debugfs support The debugfs code is simply just dumping a bunch of registers, the same information can also easily be gotten through the regmap debugfs interface or through the i2cdump utility. I've not used the debugfs interface once in all these years that I've been working on the axp288_fuel_gauge driver, so lets just remove it. Note this also removes the temperature-channels from the list of IIO ADC channels used by the driver, since these were only used in the debugfs interface. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit f9ac97307b620a08b071a4db33ddb4a26c5b8eb0 Author: Hans de Goede Date: Sun Aug 1 15:30:56 2021 +0200 power: supply: axp288_fuel_gauge: Fix define alignment The values of various defines used in the driver are not aligned properly when tabsize is set to 8 (I guess they were created with a different tabsize). Properly align the defines to make the code easier to read. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit daaca3156dd9832f57709cb858f10ff6b22a8821 Author: Tang Bin Date: Thu Aug 5 20:52:33 2021 +0800 power: supply: sc27xx: Delete superfluous error message In the function sc27xx_fgu_probe(), when get irq failed, platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin Signed-off-by: Sebastian Reichel commit 04e6bb0d6bb127bac929fb35edd2dd01613c9520 Author: Mason Zhang Date: Wed Aug 4 21:37:47 2021 +0800 spi: modify set_cs_timing parameter This patch modified set_cs_timing parameter, no need pass in spi_delay to set_cs_timing callback. By the way, we modified the mediatek and tegra114 spi driver to fix build err. In mediatek spi driver, We have support set absolute time not clk_count, and call this function in prepare_message not user's API. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210804133746.6742-1-Mason.Zhang@mediatek.com Signed-off-by: Mark Brown commit 8c33ebfeeb597ea953df93f84ea25482d29c664f Author: Mason Zhang Date: Wed Aug 4 21:37:17 2021 +0800 spi: move cs spi_delay to spi_device As we know, spi core layer has removed spi_set_cs_timing() API. So this patch moved spi_delay for cs_timing from spi_controller to spi_device, because cs timing should be set by spi_device but not controller. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210804133716.32040-1-Mason.Zhang@mediatek.com Signed-off-by: Mark Brown commit ce5db043d2e8811f30de3ebb5d9e6bd8a33596c4 Author: Hsin-Yi Wang Date: Tue Jun 22 11:07:43 2021 +0800 dt-bindings: mediatek: Add optional mediatek,gce-events property This property is used by gce clients. Signed-off-by: Hsin-Yi Wang Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210622030741.2120393-2-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 02912fb79e7076b1667572a713f6f2433f45dc27 Author: Hsin-Yi Wang Date: Tue Jun 22 11:07:41 2021 +0800 arm64: dts: mt8183: add mediatek,gce-events in mutex mediatek,gce-events is read by mutex node. Signed-off-by: Hsin-Yi Wang Reviewed-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20210622030741.2120393-1-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 109fd20601e2bdab641eec26e28351477f311ff0 Author: Bilal Wasim Date: Thu Jul 1 11:40:24 2021 +0200 arm64: dts: mediatek: mt8173: Add domain supply for mfg_async da9211 regulator needs to be enabled before enabling the mfg_async power domain. Otherwise the subdomain is not enabled and causes failure in imgtec gpu driver boot. Add the "domain-supply" property to the "mfg_async" node in DT. Signed-off-by: Bilal Wasim Signed-off-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20210701114012.RESEND.3.I9e27871bb700c807a564957302b292e9935dae0b@changeid Signed-off-by: Matthias Brugger commit a5d68a87f8f29dabd6990f13acdc77cfb6dc5dfe Author: Hsin-Yi Wang Date: Wed Jul 28 12:07:10 2021 +0800 arm64: dts: mt8173: elm: Use aliases to mmc nodes With commit 1796164fac7e ("dt-bindings: mmc: document alias support"), a way to specify fixed index numbers was provided. This patch use aliases to mmc nodes so the partition name for eMMC and SD card will be consistent across boots. Signed-off-by: Hsin-Yi Wang Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20210728040710.2891955-2-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 42a495fb94d17589aba826bcb392da721877302f Author: Hsin-Yi Wang Date: Wed Jul 28 12:07:09 2021 +0800 arm64: dts: mt8183: kukui: Use aliases to mmc nodes With commit 1796164fac7e ("dt-bindings: mmc: document alias support"), a way to specify fixed index numbers was provided. This patch use aliases to mmc nodes so the partition name for eMMC and SD card will be consistent across boots. Signed-off-by: Hsin-Yi Wang Tested-by: Enric Balletbo i Serra Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20210728040710.2891955-1-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 97ec669dfcfa22f8a595356ceb6ce46e7b4a82e9 Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:26 2021 +0300 arm64: dts: qcom: sm8250: assign DSI clock source parents Assign DSI clock source parents to DSI PHY clocks. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-6-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 77246d45d28f32fee3f92421aaca0e24c97ce6d1 Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:25 2021 +0300 arm64: dts: qcom: sdm845-mtp: assign DSI clock source parents Assign DSI clock source parents to DSI PHY clocks. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-5-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 3289022b32985871cdb5e82d3473eafac6033869 Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:24 2021 +0300 arm64: dts: qcom: sdm845: assign DSI clock source parents Assign DSI clock source parents to DSI PHY clocks. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-4-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit b547b216228fde064e196838f695c2b0d6c110ae Author: Dmitry Baryshkov Date: Sat Jul 10 00:07:23 2021 +0300 arm64: dts: qcom: sc7180: assign DSI clock source parents Assign DSI clock source parents to DSI PHY clocks. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210709210729.953114-3-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 97a5b73b7058206425e7ba465f4c7f6a81fb4888 Author: Rajendra Nayak Date: Wed Aug 4 18:33:19 2021 +0530 arm64: dts: qcom: sc7280-idp: Add device tree files for IDP2 Move all the common device tree bits for both sc7280 IDPs into a sc7280-idp.dtsi and create 2 different dts files (sc7280-idp.dts and sc7280-idp2.dts) in order to manage differences across the IDP SKU1 and SKU2 Boards. PMR735A is present on IDP board only and is not present on IDP2. Signed-off-by: Rajendra Nayak Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/1628082199-17002-3-git-send-email-rnayak@codeaurora.org Signed-off-by: Bjorn Andersson commit 14fec168bf8c654b3c849a98b5ad2195682e8b7a Author: Rajendra Nayak Date: Wed Aug 4 18:33:18 2021 +0530 dt-bindings: arm: qcom: Document qcom,sc7280-idp2 board Document the qcom,sc7280-idp2 board based off sc7280 SoC, The board is also known as piglin in the Chrome OS builds, so document the google,piglin compatible as well. Signed-off-by: Rajendra Nayak Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1628082199-17002-2-git-send-email-rnayak@codeaurora.org Signed-off-by: Bjorn Andersson commit 84173ca359787abd720d150d3d0d7edabf9db46c Author: Alex Elder Date: Wed Aug 4 16:02:14 2021 -0500 arm64: dts: qcom: sm8350: fix IPA interconnects There should only be two interconnects defined for IPA on the QUalcomm SM8350 SoC. The names should also match those specified by the IPA Device Tree binding. Fixes: f11d3e7da32e ("arm64: dts: qcom: sm8350: add IPA information") Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210804210214.1891755-5-elder@linaro.org Signed-off-by: Bjorn Andersson commit 310b266655a341e753a44a9f31836195b00f24c2 Author: Alex Elder Date: Wed Aug 4 16:02:13 2021 -0500 arm64: dts: qcom: sc7180: define ipa_fw_mem node Define the reserved memory space used for IPA firmware for the Qualcomm SC7180 SoC. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210804210214.1891755-4-elder@linaro.org Signed-off-by: Bjorn Andersson commit 8dc7e3e5fe13c0a94ac6732eedb04db08418f4cc Author: Alex Elder Date: Wed Aug 4 16:02:12 2021 -0500 arm64: dts: qcom: sc7280: enable IPA for sc7280-idp Enable IPA for the SC7280 IDP, with the modem performing early initialization. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210804210214.1891755-3-elder@linaro.org Signed-off-by: Bjorn Andersson commit fc4f0273d4fba2c125141ef45474d253f6c28f3f Author: Alex Elder Date: Wed Aug 4 16:02:11 2021 -0500 arm64: dts: qcom: sc7280: add IPA information Add IPA-related nodes and definitions to "sc7280.dtsi", including the reserved memory area used for AP-based IPA firmware loading. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210804210214.1891755-2-elder@linaro.org Signed-off-by: Bjorn Andersson commit ab428819ee3f8a97c3a2a272029c681896f9508a Author: Douglas Anderson Date: Fri Jun 11 10:17:47 2021 -0700 arm64: dts: qcom: sc7180-trogdor: Move panel under the bridge chip Putting the panel under the bridge chip (under the aux-bus node) allows the panel driver to get access to the DP AUX bus, enabling all sorts of fabulous new features. While we're at this, get rid of a level of hierarchy for the panel node. It doesn't need "ports / port" and can just have a "port" child. For Linux, this patch has a hard requirement on the patches adding DP AUX bus support to the ti-sn65dsi86 bridge chip driver. See the patch ("drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus"). Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210611101711.v10.11.Ibdb7735fb1844561b902252215a69526a14f9abd@changeid Signed-off-by: Bjorn Andersson commit f26f6a5e41dc4bda3329e0bbe7e50f1f027bcea5 Author: Robert Marko Date: Tue May 18 20:16:18 2021 +0200 arm64: dts: qcom: ipq8074: add PRNG node PRNG insinde of IPQ8074 is already supported, so simply add the node for it. Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20210518181618.3238386-2-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit f9e2df82d2904dd498450784808426b88d2240de Author: Robert Marko Date: Tue May 18 20:16:17 2021 +0200 arm64: dts: qcom: ipq8074: add crypto nodes IPQ8074 uses Qualcom QCE crypto engine v5.1 which is already supported. So simply add nodes for its DMA and QCE itself. Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20210518181618.3238386-1-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 06bf656eda23affbb7e0117d41733b80bb1bf8f6 Author: Jonathan Marek Date: Thu May 13 14:13:09 2021 -0400 arm64: dts: qcom: sm8350: add qupv3_id_1/i2c13 nodes Add the qupv3_id_1 node and the i2c13 child node used for i2c devices connected to gpio0/gpio1. Signed-off-by: Jonathan Marek Link: https://lore.kernel.org/r/20210513181309.12491-2-jonathan@marek.ca Signed-off-by: Bjorn Andersson commit 095bbdd9a5c302ca4636c8fc92216ac008f46491 Author: Selvam Sathappan Periakaruppan Date: Wed May 5 12:18:32 2021 +0300 arm64: dts: qcom: ipq6018: Add pcie support ipq6018 has 1 pcie gen3 port. This patch adds the support for the same. The GICv2m reg property value is a guess based on similar SoCs description in downstream Codeaurora kernel. It appears to work. Signed-off-by: Selvam Sathappan Periakaruppan [baruch: adjust #address-cells/#size-cells; drop unsupported property; increase parf registers size] Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/0f733656666fa6adaa8e196419ebcfd04677d173.1620203062.git.baruch@tkos.co.il Signed-off-by: Bjorn Andersson commit f70c6dc013c1842b0ca640926cf74e7b99cec33d Author: Wesley Cheng Date: Tue Apr 27 14:07:12 2021 +0100 arm64: dts: qcom: pm8150b: Add DTS node for PMIC VBUS booster Add the required DTS node for the USB VBUS output regulator, which is available on PM8150B. This will provide the VBUS source to connected peripherals. Cc: Rob Herring Signed-off-by: Wesley Cheng Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20210427130712.2005456-3-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 129e1c968457d058d7a8cd21203a3aa42cac7830 Author: Felipe Balbi Date: Fri Apr 16 13:32:24 2021 +0300 arm64: dts: qcom: sm8150: add SPI nodes Add missing SPI nodes for SM8150. Signed-off-by: Felipe Balbi Reviewed-by: Caleb Connolly Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210416103225.1872145-1-balbi@kernel.org Signed-off-by: Bjorn Andersson commit 98b433864c20c7dd98b6da4ce01f1a0cc5c15c03 Author: Georgi Djakov Date: Sun Mar 21 20:42:12 2021 +0800 arm64: dts: qcom: msm8916: Enable CoreSight STM component Add DT binding for CoreSight System Trace Macrocell (STM) on msm8916, which can benefit the CoreSight development on DB410c. Signed-off-by: Georgi Djakov Signed-off-by: Leo Yan Acked-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210321124212.4253-1-leo.yan@linaro.org Signed-off-by: Bjorn Andersson commit c1b2189a19cf2a35b7345f4f94f4d47e452ab8e2 Author: Rajendra Nayak Date: Fri Jul 30 12:16:13 2021 +0530 arm64: dts: qcom: sc7280: Add qfprom node Add the qfprom node and its properties for the sc7280 SoC. Signed-off-by: Rajendra Nayak Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1627627573-32454-5-git-send-email-rnayak@codeaurora.org Signed-off-by: Bjorn Andersson commit 11e03d692101e484df9322f892a8b6e111a82bfd Author: Sibi Sankar Date: Thu Jul 29 23:34:44 2021 +0530 arm64: dts: qcom: sc7280: Fixup the cpufreq node Fixup the register regions used by the cpufreq node on SC7280 SoC to support per core L3 DCVS. Fixes: 7dbd121a2c58 ("arm64: dts: qcom: sc7280: Add cpufreq hw node") Signed-off-by: Sibi Sankar Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1627581885-32165-4-git-send-email-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 53bc6b4170d574e410b2123c37be03ad34e13c09 Author: Baruch Siach Date: Thu Jul 22 13:01:07 2021 +0300 arm64: dts: qcom: ipq6018: correct TCSR block area According to Bjorn Andersson[1], &tcsr_q6 base is 0x01937000 with size 0x21000. Adjust qcom,halt-regs offsets (add 0xe000) to match the new syscon base. Also, rename to just &tcsr as Kathiravan T suggested. [1] https://lore.kernel.org/r/YLgO0Aj1d4w9EcPv@yoga Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/889aae1b88f120cb6281919d27164a959fbe69d0.1626948070.git.baruch@tkos.co.il Signed-off-by: Bjorn Andersson commit b22d313e177281e0c87dbc8725704e4952bb910a Author: V Sujith Kumar Reddy Date: Wed Jul 21 13:35:49 2021 +0530 arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for HDMI Add dai link in sc7180-trogdor.dtsi for supporting audio over DP Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210721080549.28822-3-srivasam@qti.qualcomm.com Signed-off-by: Bjorn Andersson commit 5b01733f4fe60d237f68661fa0e9fc52a8a0dee3 Author: V Sujith Kumar Reddy Date: Wed Jul 21 13:35:48 2021 +0530 arm64: dts: qcom: sc7180: Update lpass cpu node for audio over dp Updaate lpass dts node with HDMI reg, interrupt and iommu for supporting audio over dp. Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210721080549.28822-2-srivasam@qti.qualcomm.com Signed-off-by: Bjorn Andersson commit 3440b1becd3c3d91c1418269cc2ef1d5118c9802 Author: Caleb Connolly Date: Tue Jul 20 15:33:55 2021 +0000 arm64: dts: qcom: sdm845-oneplus: add ipa firmware names Add the correct patch to the ipa firmware now that custom paths are supported. Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20210720153125.43389-6-caleb@connolly.tech Signed-off-by: Bjorn Andersson commit 383409806ed6649c8f6c2ec4fecebedba97692b2 Author: Caleb Connolly Date: Tue Jul 20 15:33:42 2021 +0000 arm64: dts: qcom: sdm845-oneplus-common: enable debug UART A labelled diagram showing the location of the Rx and Tx testpoints for the OnePlus 6 is available on the postmarketOS wiki: https://wiki.postmarketos.org/wiki/Serial_debugging:Cable_schematics The device uses 1.8v UART at a baud rate of 115200, bootloader output is also available here. Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20210720153125.43389-3-caleb@connolly.tech Signed-off-by: Bjorn Andersson commit 87f0b434b91860fd6be0c824b596d9f3cb56d69e Author: Robert Foss Date: Tue Aug 3 14:57:56 2021 +0200 arm64: dts: qcom: sm8350: Rename GENI serial engine DT node In order to conform with downstream and upstream for previous generations of this hardware, rename dt-node 'qupv3_id_1' to 'qupv3_id_0'. Fixes: b7e8f433a673 ("arm64: dts: qcom: Add basic devicetree support for SM8350 SoC") Signed-off-by: Robert Foss Link: https://lore.kernel.org/r/20210803125756.93824-1-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 7dfb52dcc5a482506e0e1f3cee65a30fddd39a29 Author: satya priya Date: Tue Aug 3 18:34:12 2021 +0530 arm64: dts: qcom: sc7280: Remove pm8350 and pmr735b for sc7280-idp Remove pm8350 and pmr735b die temp nodes as these pmics are not present on this board. Correct the tabbing for pmk8350_vadc node. Fixes: fbd5a1d22607 ("arm64: dts: qcom: sc7280: Add ADC channel nodes for PMIC temperatures to sc7280-idp") Signed-off-by: satya priya Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1627995852-24505-1-git-send-email-skakit@codeaurora.org Signed-off-by: Bjorn Andersson commit 6493367f8031b1e5cf0a217d6520c0d79a5d6659 Author: Sandeep Maheswaram Date: Mon Aug 2 10:32:56 2021 +0530 arm64: dts: qcom: sc7280: Add interconnect properties for USB Add interconnect properties in USB DT nodes for sc7280. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1627880576-22391-1-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit 001ce9785c0674d913531345e86222c965fc8bf4 Author: Dmitry Baryshkov Date: Tue Aug 3 13:16:57 2021 +0300 arm64: dts: qcom: sm8250: remove bus clock from the mdss node for sm8250 target Remove the bus clock from the mdss device node, in order to facilitate bus band width scaling on sm8250 target. The parent device MDSS will not vote for bus bw, instead the vote will be triggered by mdp device node. Since a minimum vote is required to turn on bus clock, and since mdp device node already has the bus clock, remove the clock from the mdss device. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210803101657.1072358-3-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 111c52854102983f2260eb819ab9326084a004d7 Author: Dmitry Baryshkov Date: Tue Aug 3 13:16:56 2021 +0300 arm64: dts: qcom: sdm845: move bus clock to mdp node for sdm845 target Move the bus clock to mdp device node,in order to facilitate bus band width scaling on sdm845 target. The parent device MDSS will not vote for bus bw, instead the vote will be triggered by mdp device node. Since a minimum vote is required to turn on bus clock, move the clock node to mdp device from where the votes are requested. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210803101657.1072358-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 67146f0738801d06635942b6faca6dcaafb5e63b Author: Bjorn Andersson Date: Thu Mar 11 19:42:18 2021 -0800 arm64: dts: qcom: sm8350: Add wakeup-parent to tlmm Now that TLMM has the wakeup table, specify the Power Domain Controller to be the wakeup-parent of TLMM. Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20210312034218.3324410-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 437cdef515e29427df9c0d7e5b44b04dd17c3ff8 Author: Ravi Kumar Bokka Date: Wed Feb 17 22:56:32 2021 +0530 arm64: dts: qcom: sc7180:: modified qfprom CORR size as per RAW size modified QFPROM controller CORRECTED region size as per RAW region size Signed-off-by: Ravi Kumar Bokka Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1613582792-5225-1-git-send-email-rbokka@codeaurora.org Signed-off-by: Bjorn Andersson commit 77b53d65dc1e54321ec841912f06bcb558a079c0 Author: Georgi Djakov Date: Thu Feb 11 21:36:37 2021 +0200 arm64: dts: qcom: sm8250: Fix epss_l3 unit address The unit address of the epss_l3 node is incorrect and does not match the address of its "reg" property. Let's fix it. Signed-off-by: Georgi Djakov Reviewed-by: Dmitry Baryshkov Reviewed-by: Sibi Sankar Link: https://lore.kernel.org/r/20210211193637.9737-1-georgi.djakov@linaro.org Signed-off-by: Bjorn Andersson commit 589562946f8590bc57eb4e99ed9739d598f0d765 Author: Yassine Oudjana Date: Wed Feb 10 11:40:45 2021 +0000 arm64: dts: qcom: msm8996: Add gpu cooling support Add cooling-cells property and cooling maps for the GPU. Signed-off-by: Yassine Oudjana Link: https://lore.kernel.org/r/Ku7mRZ_q2mYDZQ048IPlAc8VOVhH8N4uENhMI-JXxjeiZxjbRRs40ZJYwREb_ScgCvtQgtdl1VRjoDd7CR_8vCrbWVe8n3MwyB1S3VbSDis=@protonmail.com Signed-off-by: Bjorn Andersson commit 8dc7dba0cc2596a938974fb600db325b248bc1e7 Author: Konrad Dybcio Date: Thu Feb 25 22:38:42 2021 +0100 arm64: dts: qcom: pm8004: Enable the PMIC peripherals by default It makes no sense to require one more step to enable the PMIC features. If the PMIC is present, it already has to be explicitly #included anyway. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210225213842.117694-1-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 39d66a2e7fbfeda9a36ba55a15fd3eaec0e213e4 Author: Vinod Koul Date: Mon Mar 8 11:38:15 2021 +0530 dt-bindings: arm: qcom: Drop qcom,mtp qcom,mtp is used msm8916-mtp.dts but not documented, it is a generic mtp compatible and we have specfifc ones for each mtp so drop this arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: /: compatible: 'oneOf' conditional failed, one must be fixed: ['qcom,msm8916-mtp', 'qcom,msm8916-mtp/1', 'qcom,msm8916', 'qcom,mtp'] is too long Additional items are not allowed ('qcom,msm8916', 'qcom,mtp' were unexpected) Additional items are not allowed ('qcom,mtp' was unexpected) Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-8-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit e9dd2f7204edbc8ae6842f87a187ade04e381809 Author: Vinod Koul Date: Mon Mar 8 11:38:14 2021 +0530 dt-bindings: arm: qcom: Document alcatel,idol347 board Document the alcatel,idol347 board. It was missing leading to warning: arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dt.yaml: /: compatible: 'oneOf' conditional failed, one must be fixed: Additional items are not allowed ('qcom,msm8916' was unexpected) Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-7-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 84f3efbe5b4654077608bc2fc027177fe4592321 Author: Vinod Koul Date: Mon Mar 8 11:38:17 2021 +0530 arm64: dts: qcom: msm8996: don't use underscore in node name We have underscore (_) in node name leading to warning: arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: clocks: $nodename:0: 'clocks' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: clocks: xo_board: {'type': 'object'} is not allowed for {'compatible': ['fixed-clock'], '#clock-cells': [[0]], 'clock-frequency': [[19200000]], 'clock-output-names': ['xo_board'], 'phandle': [[115]]} Fix this by changing node name to use dash (-) Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-10-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 8c678beca7ed3fa8a2c6d86f6603bc23400f9ad8 Author: Vinod Koul Date: Mon Mar 8 11:38:16 2021 +0530 arm64: dts: qcom: msm8994: don't use underscore in node name We have underscore (_) in node name leading to warning: arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon-cityman.dt.yaml: clocks: xo_board: {'type': 'object'} is not allowed for {'compatible': ['fixed-clock'], '#clock-cells': [[0]], 'clock-frequency': [[19200000]], 'phandle': [[26]]} arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon-cityman.dt.yaml: clocks: sleep_clk: {'type': 'object'} is not allowed for {'compatible': ['fixed-clock'], '#clock-cells': [[0]], 'clock-frequency': [[32768]]} Fix this by changing node name to use dash (-) Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-9-vkoul@kernel.org [bjorn: Added clock-output-names to satisfy parent_names] Signed-off-by: Bjorn Andersson commit 639dfdbecd88ec05bda87b1d5d419afad50af21c Author: Vinod Koul Date: Mon Mar 8 11:38:18 2021 +0530 arm64: dts: qcom: sdm630: don't use underscore in node name We have underscore (_) in node name so fix that up as well. Fix this by changing node name to use dash (-) Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-11-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 1b91b8ef60e9a67141e66af3cca532c00f4605fe Author: Vinod Koul Date: Mon Mar 8 11:38:26 2021 +0530 arm64: dts: qcom: ipq6018: drop '0x' from unit address Nodes need not contain '0x' for the unit address. Drop it to fix the below warning: arch/arm64/boot/dts/qcom/ipq6018-cp01-c1.dt.yaml: reserved-memory: 'memory@0x60000' does not match any of the regexes Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-19-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit c81210e38966cfa1c784364e4035081c3227cf5b Author: Vinod Koul Date: Mon Mar 8 11:38:25 2021 +0530 arm64: dts: qcom: sdm660: use reg value for memory node memory node like other node should be node@reg, which is missing in this case, so fix it up arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: /: memory: False schema does not allow {'device_type': ['memory'], 'reg': [[0, 1073741824, 0, 536870912]]} Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-18-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 52c9887fba71fc8f12d343833fc595c762aac8c7 Author: Vinod Koul Date: Mon Mar 8 11:38:24 2021 +0530 arm64: dts: qcom: ipq8074: fix pci node reg property reg property should be array of values, here it is a single array, leading to below warning: arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@10000000:reg:0: [268435456, 3869, 268439328, 168, 557056, 8192, 269484032, 4096] is too long arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@10000000:ranges: 'oneOf' conditional failed, one must be fixed: arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@10000000:ranges: 'oneOf' conditional failed, one must be fixed: [[2164260864, 0, 270532608, 270532608, 0, 1048576, 2181038080, 0, 271581184, 271581184, 0, 13631488]] is not of type 'null' [2164260864, 0, 270532608, 270532608, 0, 1048576, 2181038080, 0, 271581184, 271581184, 0, 13631488] is too long arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@20000000:reg:0: [536870912, 3869, 536874784, 168, 524288, 8192, 537919488, 4096] is too long arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@20000000:ranges: 'oneOf' conditional failed, one must be fixed: arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: soc: pci@20000000:ranges: 'oneOf' conditional failed, one must be fixed: [[2164260864, 0, 538968064, 538968064, 0, 1048576, 2181038080, 0, 540016640, 540016640, 0, 13631488]] is not of type 'null' [2164260864, 0, 538968064, 538968064, 0, 1048576, 2181038080, 0, 540016640, 540016640, 0, 13631488] is too long Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-17-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit cfdf0c27639571d7a99d00fe1ce931daa6726c27 Author: Vinod Koul Date: Mon Mar 8 11:38:22 2021 +0530 arm64: dts: qcom: sdm630: don't use empty memory node We expect bootloader to full memory details but passing empty values can give warning, so add a default value Signed-off-by: Vinod Koul Tested-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210308060826.3074234-15-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit d53dc79f9b5699873423b7912d835be4594b3577 Author: Vinod Koul Date: Mon Mar 8 11:38:21 2021 +0530 arm64: dts: qcom: msm8998: don't use empty memory node We expect bootloader to full memory details but passing empty values can give warning, so add a default value Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-14-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 184adb500f72d8a65e3cb05d28a0a7de9561734b Author: Vinod Koul Date: Mon Mar 8 11:38:20 2021 +0530 arm64: dts: qcom: msm8996: don't use empty memory node We expect bootloader to full memory details but passing empty values can give warning, so add a default value Signed-off-by: Vinod Koul Tested-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210308060826.3074234-13-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 82e1783890b773e30705be70db5896ebc67b4f22 Author: Martin Botka Date: Mon Jun 21 21:53:05 2021 +0200 arm64: dts: qcom: sm6125: Add support for Sony Xperia 10II This commits add support for Sony Xperia 10II based on the SM6125 SoC. Currently working features: - dmesg output to bootloader preconfigured display - USB - eMMC - Volume down button Signed-off-by: Martin Botka Link: https://lore.kernel.org/r/20210621195308.654587-2-martin.botka@somainline.org Signed-off-by: Bjorn Andersson commit 927dfdd09d8c03ba100ed0c8c3915f8e1d1f5556 Author: Matt Roper Date: Thu Jul 29 09:59:55 2021 -0700 drm/i915/dg2: Add SQIDI steering Although DG2_G10 platforms will always have all SQIDI's present and don't need steering for registers in a SQIDI MMIO range, this isn't true for DG2_G11 platforms; only SQIDI's 2 and 3 can be used on those. We handle SQIDI ranges a bit differently from other types of explicit steering. The SQIDI ranges belong to either the MCFG unit or the SF unit, both of which have their own dedicated steering registers and do not use the typical 0xFDC steering control that all other types of ranges use. Thus we only need to worry about picking a valid initial value for the MCFG and SF steering registers (0xFD0 and 0xFD8 respectively) at driver init; they won't change after we set them up so we don't need to worry about re-steering them explicitly at runtime. Given that any SQIDI value should work fine for DG2-G10 and XeHP SDV, while only values of 2 and 3 are valid for DG2-G11, we'll just initialize the MCFG and SF steering registers to a constant value of "2" for all XeHP-based platforms for simplicity --- that will work in all cases. Bspec: 66534 Cc: Radhakrishna Sripada Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-6-matthew.d.roper@intel.com commit 1705f22c86fb2654df22169c020d9d4ff193e47b Author: Matt Roper Date: Thu Jul 29 09:59:54 2021 -0700 drm/i915/dg2: Update steering tables DG2's replicated register ranges are almost the same at XeHP SDV with the exception of one LNCF sub-range that switches to gslice steering. We can re-use the XeHP SDV mslice steering table and just provide a DG2-specific LNCF steering table. Bspec: 66534 Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-5-matthew.d.roper@intel.com commit 768fe28dd3dcea517d3c491cfe1b5cd768ee1334 Author: Matt Roper Date: Thu Jul 29 09:59:52 2021 -0700 drm/i915/xehpsdv: Define steering tables Define and initialize the MMIO ranges for which XeHP SDV requires MSLICE and LNCF steering. Bspec: 66534 Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-3-matthew.d.roper@intel.com commit 3ffe82d701a4ec6b2c1970609b23c6187503b0a0 Author: Daniele Ceraolo Spurio Date: Thu Jul 29 09:59:51 2021 -0700 drm/i915/xehp: handle new steering options Xe_HP is more modular than its predecessors and as a consequence it has more types of replicated registers. As with l3bank regions on previous platforms, we may need to explicitly re-steer accesses to these new types of ranges at runtime if we can't find a single default steering value that satisfies the fusing of all types. v2: - Add a local 'i915' variable to reduce gt->i915 usage. (Caz) - Drop unused 'intel_gt_read_register' prototype. (Caz) v3: - Drop unnecessary comment text. (Lucas) - Drop unused register bit definition. (Lucas) Bspec: 66534 Cc: Tvrtko Ursulin Cc: Caz Yokoyama Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-2-matthew.d.roper@intel.com commit 36a9d79e5e9518dfd9548e3237e7a49464c16922 Author: Samuel Holland Date: Thu Aug 5 00:07:06 2021 -0500 ASoC: simple-card-utils: Avoid over-allocating DLCs The allocation of the DAI link components (DLCs) passed the wrong pointer to sizeof. Since simple_dai_props is much larger than snd_soc_dai_link_component, there was no out of bounds access, only wasted memory. Fixes: f2138aed231c8 ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform") Fixes: 050c7950fd706 ("ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform") Reviewed-by: Kuninori Morimoto Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20210805050706.46833-1-samuel@sholland.org Signed-off-by: Mark Brown commit 8c62dbcb489aa038fcb9c73faa5c6b56f1f54902 Author: Pierre-Louis Bossart Date: Wed Aug 4 14:24:56 2021 -0500 ASoC: wcd938x: simplify return value cppcheck warning: sound/soc/codecs/wcd938x.c:3701:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/codecs/wcd938x.c:3691:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/codecs/wcd938x.c:3701:9: note: Returning identical expression 'ret' return ret; ^ Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210804192456.278702-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c18abd00333b8b4c6432f4a6789aa02e3b18fdc8 Author: Pierre-Louis Bossart Date: Wed Aug 4 14:24:55 2021 -0500 ASoC: mt6359-accdet.c: remove useless assignments cppcheck warnings (and additional issue found by code inspection) sound/soc/codecs/mt6359-accdet.c:464:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210804192456.278702-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 221034aca4fdcf8a6552267d2d3aa6825fae29b1 Author: Pierre-Louis Bossart Date: Wed Aug 4 14:24:54 2021 -0500 ASoC: max98090: remove duplicate status reads and useless assignmment The logic for the jack detection has not changed since the first commit for this driver. Remove a duplicate read and remove useless assignment sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is reassigned a value before the old one has been used. [redundantAssignment] reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2161:7: note: reg is assigned reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is reassigned a value before the old one has been used. [redundantAssignment] reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2167:7: note: reg is assigned reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210804192456.278702-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f2ff5fbe343d08e880fb1d10dbbdc335a3ceca4b Author: Kuninori Morimoto Date: Thu Aug 5 10:11:44 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at soc_dapm_dai_stream_event() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:4368:15: style: The scope of the variable 'ep' can be reduced. [variableScope] unsigned int ep; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87im0ku23z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3dc72e4251d7ccd90517433b84f133d4a18179c3 Author: Kuninori Morimoto Date: Thu Aug 5 10:11:41 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_new_controls() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:3786:30: style: The scope of the variable 'w' can be reduced. [variableScope] struct snd_soc_dapm_widget *w; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87k0l0u242.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit fd136fdbf4a66add171eb0cedf40f430bda9c139 Author: Kuninori Morimoto Date: Thu Aug 5 10:11:37 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_weak_routes() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:3190:9: style: The scope of the variable 'err' can be reduced. [variableScope] int i, err; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87lf5gu246.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit fcb3f196f808f2d53d3a8f0a728ffd61f9d44e11 Author: Kuninori Morimoto Date: Thu Aug 5 10:11:33 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_add_routes() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:3082:9: style: The scope of the variable 'r' can be reduced. [variableScope] int i, r, ret = 0; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87mtpwu24b.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit fd5ad2346148373890b4e7e7e0b1d7b208772a68 Author: Kuninori Morimoto Date: Thu Aug 5 10:11:28 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_del_route() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:3007:30: style: The scope of the variable 'wsource' can be reduced. [variableScope] struct snd_soc_dapm_widget *wsource, *wsink; ^ sound/soc/soc-dapm.c:3007:40: style: The scope of the variable 'wsink' can be reduced. [variableScope] struct snd_soc_dapm_widget *wsource, *wsink; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o8acu24f.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a71657947d74fbc9e0184079f9e1941d70ccb52c Author: Kuninori Morimoto Date: Thu Aug 5 10:11:24 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_run() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:1648:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret, i; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmusu24j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 65f7316d18f2b447931eef00c04253859bdbe142 Author: Kuninori Morimoto Date: Thu Aug 5 10:11:20 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_check_event() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:1531:13: style: The scope of the variable 'ret' can be reduced. [variableScope] int power, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r1f8u24n.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5c52e48fb1c2ae68b997d81a781ce0104dbbb91a Author: Kuninori Morimoto Date: Thu Aug 5 10:11:15 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_dai_link() This patch cleanups below cppcheck warning, and its related code. sound/soc/soc-dapm.c:1077:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfzou24s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a16cfb1bee80e3a3f7cab59a58580258b6d1efcf Author: Kuninori Morimoto Date: Thu Aug 5 10:11:10 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_pga() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:1063:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tuk4u24x.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 29155bba18182daf46e0c4c784a2344d44ef082a Author: Kuninori Morimoto Date: Thu Aug 5 10:11:05 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_set_mixer_path_status() This patch cleanups below cppcheck warning, and its related code. unsigned int val; ^ sound/soc/soc-dapm.c:789:15: style: The scope of the variable 'val' can be reduced. [variableScope] Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87v94ku252.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit af6b57ab7fdd88e1b251376ee92fd335abd2241e Author: Kuninori Morimoto Date: Thu Aug 5 10:11:00 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_connect_mux() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:751:15: style: The scope of the variable 'val' can be reduced. [variableScope] unsigned int val, item; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wnp0u257.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7453d6d45d5587d3d4d4fdaec746db74ac5f7429 Author: Kuninori Morimoto Date: Thu Aug 5 10:10:55 2021 +0900 ASoC: soc-dapm: cleanup cppcheck warning at dapm_wcache_lookup() This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:653:20: style: The scope of the variable 'wlist' can be reduced. [variableScope] struct list_head *wlist; ^ sound/soc/soc-dapm.c:655:6: style: The scope of the variable 'i' can be reduced. [variableScope] int i = 0; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y29gu25d.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9c3a0f285248899dfa81585bc5d5bc9ebdb8fead Merge: bfee75f73c37a c500bee1c5b2f Author: Mauro Carvalho Chehab Date: Thu Aug 5 16:28:43 2021 +0200 Merge tag 'v5.14-rc4' into media_tree Linux 5.14-rc4 * tag 'v5.14-rc4': (948 commits) Linux 5.14-rc4 pipe: make pipe writes always wake up readers Revert "perf map: Fix dso->nsinfo refcounting" mm/memcg: fix NULL pointer dereference in memcg_slab_free_hook() slub: fix unreclaimable slab stat for bulk free mm/migrate: fix NR_ISOLATED corruption on 64-bit mm: memcontrol: fix blocking rstat function called from atomic cgroup1 thresholding code ocfs2: issue zeroout to EOF blocks ocfs2: fix zero out valid data lib/test_string.c: move string selftest in the Runtime Testing menu gve: Update MAINTAINERS list arch: Kconfig: clean up obsolete use of HAVE_IDE can: esd_usb2: fix memory leak can: ems_usb: fix memory leak can: usb_8dev: fix memory leak can: mcba_usb_start(): add missing urb->transfer_dma initialization can: hi311x: fix a signedness bug in hi3110_cmd() MAINTAINERS: add Yasushi SHOJI as reviewer for the Microchip CAN BUS Analyzer Tool driver scsi: fas216: Fix fall-through warning for Clang scsi: acornscsi: Fix fall-through warning for clang ... commit f95c4c56d65225a537a2d88735fde7ec4d37641d Author: Matthew Hagan Date: Sat Jun 5 18:35:38 2021 +0100 ARM: dts: qcom: add ahb reset to ipq806x-gmac Add GMAC_AHB_RESET to the resets property of each gmac node. Signed-off-by: Matthew Hagan Link: https://lore.kernel.org/r/20210605173546.4102455-2-mnhagan88@gmail.com Signed-off-by: Bjorn Andersson commit 4cae3413c5f497acbf5b03572e693eabbadb70d9 Author: Linus Walleij Date: Fri Apr 9 14:49:54 2021 +0200 ARM: dts: qcom: Fix up APQ8060 DragonBoard license This file is licensed in some kind of BSD manner, put it under the combined GPL+BSD license like what the bindings use, it seems most helpful. I wrote the whole file so whatever. Those are my principles, if you don't like them: I have others. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210409124954.320529-1-linus.walleij@linaro.org Signed-off-by: Bjorn Andersson commit 8822c0d49c730f47ebbdcf481afd55b05f6af8d4 Author: Bjorn Andersson Date: Fri Jul 23 20:21:01 2021 +0000 ARM: dts: qcom: msm8974: castor: Add Bluetooth-related nodes Castor has a BCM4339 attached to BLSP2 UART7, add the necessary nodes to define the uart as well as the serdev BCM. Signed-off-by: Bjorn Andersson Signed-off-by: Julian Weigt Link: https://lore.kernel.org/r/20210723202101.65371-2-juw@posteo.de Signed-off-by: Bjorn Andersson commit b05f82b152c905425586f07fb2575011f67a5053 Author: Craig Tatlor Date: Fri Jul 23 20:21:00 2021 +0000 ARM: dts: qcom: msm8974: Add blsp2_uart7 for bluetooth on sirius Signed-off-by: Craig Tatlor Signed-off-by: Julian Weigt Link: https://lore.kernel.org/r/20210723202101.65371-1-juw@posteo.de Signed-off-by: Bjorn Andersson commit cff4bbaf2a2dee244f852a1c888b281064a9296c Author: Martin Botka Date: Mon Jun 21 21:53:04 2021 +0200 arm64: dts: qcom: Add support for SM6125 This commits adds the Device tree file for SM6125 SoC. Signed-off-by: Martin Botka Link: https://lore.kernel.org/r/20210621195308.654587-1-martin.botka@somainline.org Signed-off-by: Bjorn Andersson commit 1804fdf6e494e5e2938c65d8391690b59bcff897 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:19 2021 -0700 Bluetooth: btintel: Combine setting up MSFT extension This patch combines the setting up MSFT extension for the legacy and TLV based bootloader into the common function based on hw_variant. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit c86c7285bb087b709e31f46e1aedeebb7e2a40d7 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:18 2021 -0700 Bluetooth: btintel: Fix the legacy bootloader returns tlv based version From the ThP, it supports both legacy and TLV based HCI_Intel_Read_Version command after downloading the operational firmware, and it causes the driver to choose the wrong setup routines and missing firmware/ddc file. So, as a workaround, this patch checks the fw variant from the TLV based version, and if the device is legacy bootloader device, the legacy HCI_Intel_Read_Version command is used to get the legacy version information and run the legacy bootloader setup with it. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 0d8603b4ee0ce8b572da6de776172bf235dce1bd Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:17 2021 -0700 Bluetooth: btintel: Clean the exported function to static This patch changes the exported functions to static if they are no longer used by others. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 3df4dfbec0f291e2b6efbe7b1c46ba58111ea3cd Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:16 2021 -0700 Bluetooth: btintel: Move hci quirks to setup routine This patch moves the hci quirks for Intel devices into the setup routines and cleaned up the driver flags. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 019a1caa7fd2c9bb689f9a15fe8cb1d53aa6d8b8 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:15 2021 -0700 Bluetooth: btintel: Refactoring setup routine for bootloader devices This patch refactors the setup routines for legacy and TLV based bootloader devices to the combined setup, and move the related functions from btusb to btintel. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 553807141a1e4088e657e57ece890d9263d8070c Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:14 2021 -0700 Bluetooth: btintel: Add combined set_diag functions This patch adds a combined set_diag functions. It also changes the btintel_set_diag_mfg() to static since it is no longer used by others. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit ffcba827c0a1d81933d4fdc35b925d150cee7dec Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:13 2021 -0700 Bluetooth: btintel: Fix the LED is not turning off immediately Some platforms have an issue with BT LED when the interface is down or BT radio is turned off, which takes 5 seconds to BT LED goes off. This command turns off the BT LED immediately. This patch sends the Intel vendor command to turn off the LED. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit ea7c4c0e44ee6d8cdf149af4e4084b16154ef216 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:12 2021 -0700 Bluetooth: btintel: Fix the first HCI command not work with ROM device The some legacy ROM controllers have a bug with the first HCI command sent to it returning number of completed commands as zero, which would stall the command processing in the Bluetooth core. As a workaround, send HCI Rest command first which will reset the controller to fix the issue. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 53492a668e3b9b823fc9a3ba563a5d10fef32c03 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:11 2021 -0700 Bluetooth: btintel: Add btintel data struct This patch adds a data structure for btintel for btintel object, and the definition of bootloder states. It also adds macros to set/test/clear the flags. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 83f2dafe2a6287e1a332b5c89a9d323104b0da38 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:10 2021 -0700 Bluetooth: btintel: Refactoring setup routine for legacy ROM sku This patch refactors the setup routines for legacy ROM product into combined setup, and move the related functions from btusb to btintel. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit ca5425e15881522fed47ddae60c22a487edef182 Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:09 2021 -0700 Bluetooth: btintel: Add combined setup and shutdown functions There are multiple setup and shutdown functions for Intel device and the setup function to be used is depends on the USB PID/VID, which makes difficult to maintain the code and increases the code size. This patch adds combined setup and shutdown functions to provide a single entry point for all Intel devices and choose the setup functions based on the information read with HCI_Intel_Read_Version command. Starting from TyP device, the command and response parameters for HCI_Intel_Read_Version command are changed even though OCF remains same. However, the legacy devices still can handle the command without error even if it has a extra parameter, so to simplify the flow, the new command format is used to read the version information for both legacy and new (tlv based) format. Also, it also adds a routine to setup the hdev callbacks in btintel. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 6ec566131de0e330fffd33753b325fb4d6b2d00e Author: Tedd Ho-Jeong An Date: Wed Aug 4 17:32:08 2021 -0700 Bluetooth: Add support hdev to allocate private data This patch adds support hdev to allocate extra size for private data. The size of private data is specified in the hdev_alloc_size(priv_size) and the allocated buffer can be accessed with hci_get_priv(hdev). Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 8f00b3c41ae772e7393602a1b2e3bda4269ae636 Author: Linus Walleij Date: Mon Aug 2 10:03:32 2021 +0200 mfd: db8500-prcmu: Rename register header Drop the ambition to support dbx500, the other SoCs in this series were never deleted and the support for them has been deleted. DB8500 is what we support. Signed-off-by: Linus Walleij Signed-off-by: Lee Jones commit 32679a7a6b69d9307e6d89b45d554873ca625896 Author: Hans de Goede Date: Sat Jul 17 18:25:28 2021 +0200 mfd: axp20x: Add supplied-from property to axp288_fuel_gauge cell The power-supply framework has the notion of one power-supply device being supplied by another. A typical example of this is a charger charging a battery. A tablet getting plugged in to charge (or plugged out) only results in events seen by the axp288_charger device / MFD cell. Which means that a change udev-event only gets send for the charger power-supply class device, not for the battery (the axp288_fuel_gauge device). The axp288_fuel_gauge does have an external_power_change'd callback which will generate a change udev-event when called. But before this commit this never got called because the power-supply core only calls this when a power-supply class device's supplier changes and the supplier link from axp288_charger to axp288_fuel_gauge was missing. Add a "supplied-from" property to axp288_fuel_gauge cell, pointing to the "axp288_charger" power-supply class device, so that the axp288_fuel_gauge's external_power_change'd callback gets called on axp288_charger state changes. Signed-off-by: Hans de Goede Reviewed-by: Chen-Yu Tsai Signed-off-by: Lee Jones commit e130338eed5de0f5b6b913e8619d096153cbccb0 Author: Mark Rutland Date: Mon Aug 2 15:07:33 2021 +0100 arm64: entry: call exit_to_user_mode() from C When handling an exception from EL0, we perform the entry work in that exception's C handler, and once the C handler has finished, we return back to the entry assembly. Subsequently in the common `ret_to_user` assembly we perform the exit work that balances with the entry work. This can be somewhat difficult to follow, and makes it hard to rework the return paths (e.g. to pass additional context to the exit code, or to have exception return logic for specific exceptions). This patch reworks the entry code such that each EL0 C exception handler is responsible for both the entry and exit work. This clearly balances the two (and will permit additional variation in future), and avoids an unnecessary bounce between assembly and C in the common case, leaving `ret_from_fork` as the only place assembly has to call the exit code. This means that the exit work is now inlined into the C handler, which is already the case for the entry work, and allows the compiler to generate better code (e.g. by immediately returning when there is no exit work to perform). To align with other exception entry/exit helpers, enter_from_user_mode() is updated to take the EL0 pt_regs as a parameter, though this is currently unused. There should be no functional change as a result of this patch. However, this should lead to slightly better backtraces when an error is encountered within do_notify_resume(), as the C handler should appear in the backtrace, indicating the specific exception that the kernel was entered with. Signed-off-by: Mark Rutland Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Joey Gouly Link: https://lore.kernel.org/r/20210802140733.52716-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 4d1c2ee2709fd6e1655206cafcdb22737f5d7379 Author: Mark Rutland Date: Mon Aug 2 15:07:32 2021 +0100 arm64: entry: move bulk of ret_to_user to C In `ret_to_user` we perform some conditional work depending on the thread flags, then perform some IRQ/context tracking which is intended to balance with the IRQ/context tracking performed in the entry C code. For simplicity and consistency, it would be preferable to move this all to C. As a step towards that, this patch moves the conditional work and IRQ/context tracking into a C helper function. To aid bisectability, this is called from the `ret_to_user` assembly, and a subsequent patch will move the call to C code. As local_daif_mask() handles all necessary tracing and PMR manipulation, we no longer need to handle this explicitly. As we call exit_to_user_mode() directly, the `user_enter_irqoff` macro is no longer used, and can be removed. As enter_from_user_mode() and exit_to_user_mode() are no longer called from assembly, these can be made static, and as these are typically very small, they are marked __always_inline to avoid the overhead of a function call. For now, enablement of single-step is left in entry.S, and for this we still need to read the flags in ret_to_user(). It is safe to read this separately as TIF_SINGLESTEP is not part of _TIF_WORK_MASK. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Joey Gouly Link: https://lore.kernel.org/r/20210802140733.52716-4-mark.rutland@arm.com [catalin.marinas@arm.com: removed unused gic_prio_kentry_setup macro] Signed-off-by: Catalin Marinas commit 1e29cd9983eba1b596bc07f94d81d728007f8a25 Author: Dinghao Liu Date: Thu Apr 8 15:24:02 2021 +0800 PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe() pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Link: https://lore.kernel.org/r/20210408072402.15069-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven commit bc29b71f53b13c9e90a53a42d2431228a869b459 Author: Mark Rutland Date: Mon Aug 2 15:07:31 2021 +0100 arm64: entry: clarify entry/exit helpers When entering an exception, we must perform irq/context state management before we can use instrumentable C code. Similarly, when exiting an exception we cannot use instrumentable C code after we perform irq/context state management. Originally, we'd intended that the enter_from_*() and exit_to_*() helpers would enforce this by virtue of being the first and last functions called, respectively, in an exception handler. However, as they now call instrumentable code themselves, this is not as clearly true. To make this more robust, this patch splits the irq/context state management into separate helpers, with all the helpers commented to make their intended purpose more obvious. In exit_to_kernel_mode() we'll now check TFSR_EL1 before we assert that IRQs are disabled, but this ordering is not important, and other than this there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Joey Gouly Link: https://lore.kernel.org/r/20210802140733.52716-3-mark.rutland@arm.com [catalin.marinas@arm.com: comment typos fix-up] Signed-off-by: Catalin Marinas commit 713baf3dae8f45dc8ada4ed2f5fdcbf94a5c274d Author: Colin Ian King Date: Wed Aug 4 16:09:51 2021 +0100 Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow An earlier commit replaced using batostr to using %pMR sprintf for the construction of session->name. Static analysis detected that this new method can use a total of 21 characters (including the trailing '\0') so we need to increase the BTNAMSIZ from 18 to 21 to fix potential buffer overflows. Addresses-Coverity: ("Out-of-bounds write") Fixes: fcb73338ed53 ("Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr") Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann commit 46a2b02d232ece64af43e9ab0b4c64a7a756e58e Author: Mark Rutland Date: Mon Aug 2 15:07:30 2021 +0100 arm64: entry: consolidate entry/exit helpers To make the various entry/exit helpers easier to understand and easier to compare, this patch moves all the entry/exit helpers to be adjacent at the top of entry-common.c, rather than being spread out throughout the file. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Joey Gouly Link: https://lore.kernel.org/r/20210802140733.52716-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit f06aff924f975881a6abf91d2af0078fc8cd37bf Author: Krzysztof Wilczyński Date: Thu Jul 29 23:32:35 2021 +0000 sysfs: Rename struct bin_attribute member to f_mapping There are two users of iomem_get_mapping(), the struct file and struct bin_attribute. The former has a member called "f_mapping" and the latter has a member called "mapping", and both are poniters to struct address_space. Rename struct bin_attribute member to "f_mapping" to keep both meaning and the usage consistent with other users of iomem_get_mapping(). Acked-by: Bjorn Helgaas Signed-off-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20210729233235.1508920-3-kw@linux.com Signed-off-by: Greg Kroah-Hartman commit 93bb8e352a9136a56dd26762bf54cf6554cfa96c Author: Krzysztof Wilczyński Date: Thu Jul 29 23:32:34 2021 +0000 sysfs: Invoke iomem_get_mapping() from the sysfs open callback Defer invocation of the iomem_get_mapping() to the sysfs open callback so that it can be executed as needed when the binary sysfs object has been accessed. To do that, convert the "mapping" member of the struct bin_attribute from a pointer to the struct address_space into a function pointer with a signature that requires the same return type, and then updates the sysfs_kf_bin_open() to invoke provided function should the function pointer be valid. Also, convert every invocation of iomem_get_mapping() into a function pointer assignment, therefore allowing for the iomem_get_mapping() invocation to be deferred to when the sysfs open callback runs. Thus, this change removes the need for the fs_initcalls to complete before any other sub-system that uses the iomem_get_mapping() would be able to invoke it safely without leading to a failure and an Oops related to an invalid iomem_get_mapping() access. Suggested-by: Dan Williams Reviewed-by: Dan Williams Acked-by: Bjorn Helgaas Signed-off-by: Dan Williams Signed-off-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20210729233235.1508920-2-kw@linux.com Signed-off-by: Greg Kroah-Hartman commit 98c9644f3363d36c41d4cba1703dcc0bf3674b85 Author: Randy Dunlap Date: Wed Jul 14 10:15:23 2021 -0700 drm: nouveau: fix disp.c build when NOUVEAU_BACKLIGHT is not enabled Fix build errors and warnings when CONFIG_DRM_NOUVEAU_BACKLIGHT is not set ../drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_sor_atomic_disable’: ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1665:52: error: ‘struct nouveau_connector’ has no member named ‘backlight’ struct nouveau_backlight *backlight = nv_connector->backlight; ^~ ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1670:28: error: dereferencing pointer to incomplete type ‘struct nouveau_backlight’ if (backlight && backlight->uses_dpcd) { and then fix subsequent build warnings after the above are fixed: ../drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_sor_atomic_disable’: ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1669:6: warning: unused variable ‘ret’ [-Wunused-variable] int ret; ^~~ ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1662:22: warning: unused variable ‘drm’ [-Wunused-variable] struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); ^~~ Fixes: 6eca310e8924 ("drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau") Signed-off-by: Randy Dunlap Cc: Ben Skeggs Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: Lyude Paul Reviewed-by: Lyude Paul Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210714171523.413-1-rdunlap@infradead.org commit 112cedc8e600b668688eb809bf11817adec58ddc Author: Sven Eckelmann Date: Mon Aug 2 18:24:44 2021 +0200 debugfs: Return error during {full/open}_proxy_open() on rmmod If a kernel module gets unloaded then it printed report about a leak before commit 275678e7a9be ("debugfs: Check module state before warning in {full/open}_proxy_open()"). An additional check was added in this commit to avoid this printing. But it was forgotten that the function must return an error in this case because it was not actually opened. As result, the systems started to crash or to hang when a module was unloaded while something was trying to open a file. Fixes: 275678e7a9be ("debugfs: Check module state before warning in {full/open}_proxy_open()") Cc: Taehee Yoo Reported-by: Mário Lopes Signed-off-by: Sven Eckelmann Link: https://lore.kernel.org/r/20210802162444.7848-1-sven@narfation.org Signed-off-by: Greg Kroah-Hartman commit fac58b4a5287c9d37c39d09d9bdc80846b744649 Author: Uwe Kleine-König Date: Fri Jul 30 21:10:35 2021 +0200 zorro: Drop useless (and hardly used) .driver member in struct zorro_dev The only actual use is to check in zorro_device_probe() that the device isn't already bound. The driver core already ensures this however so the check can go away which allows to drop the then assigned-only member from struct zorro_dev. If the value was indeed needed somewhere it can always be calculated by to_zorro_driver(z->dev.driver) . Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210730191035.1455248-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 18d214cc1d83af5dadf12c383686715497f20571 Author: Uwe Kleine-König Date: Fri Jul 30 21:10:34 2021 +0200 zorro: Simplify remove callback The driver core only calls a remove callback when the device was successfully bound (aka probed) before. So dev->driver is never NULL. (And even if it was NULL, to_zorro_driver(NULL) isn't ...) Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210730191035.1455248-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit fe976c4aadae80e4a5a3f665de685ce4f0b0426c Author: Uwe Kleine-König Date: Fri Jul 30 21:10:33 2021 +0200 sh: superhyway: Simplify check in remove callback The driver core only calls a remove callback when the device was successfully bound (aka probed) before. So dev->driver is never NULL. (And even if it was NULL, to_superhyway_driver(NULL) isn't ...) Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210730191035.1455248-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit f52c9ccb86237378d354f7bd71b6fcc9f3ff7f67 Author: Uwe Kleine-König Date: Fri Jul 30 21:10:32 2021 +0200 nubus: Simplify check in remove callback The driver core only calls a remove callback when the device was successfully bound (aka probed) before. So dev->driver is never NULL and the respective check can just be dropped. Acked-by: Finn Thain Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210730191035.1455248-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 23809a726c0d004b9d2474333181f8da07360469 Author: Leon Romanovsky Date: Thu Aug 5 14:02:45 2021 +0300 netdevsim: Forbid devlink reload when adding or deleting ports In order to remove complexity in devlink core related to devlink_reload_enable/disable, let's rewrite new_port/del_port logic to rely on internal to netdevsim lcok. We should protect only reload_down flow because it destroys nsim_dev, which is needed for nsim_dev_port_add/nsim_dev_port_del to hold port_list_lock. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit f8b17a0bd96065e4511858689916bb729dbb881b Author: Vladimir Oltean Date: Thu Aug 5 14:36:12 2021 +0300 net: dsa: tag_sja1105: optionally build as module when switch driver is module if PTP is enabled TX timestamps are sent by SJA1110 as Ethernet packets containing metadata, so they are received by the tagging driver but must be processed by the switch driver - the one that is stateful since it keeps the TX timestamp queue. This means that there is an sja1110_process_meta_tstamp() symbol exported by the switch driver which is called by the tagging driver. There is a shim definition for that function when the switch driver is not compiled, which does nothing, but that shim is not effective when the tagging protocol driver is built-in and the switch driver is a module, because built-in code cannot call symbols exported by modules. So add an optional dependency between the tagger and the switch driver, if PTP support is enabled in the switch driver. If PTP is not enabled, sja1110_process_meta_tstamp() will translate into the shim "do nothing with these meta frames" function. Fixes: 566b18c8b752 ("net: dsa: sja1105: implement TX timestamping for SJA1110") Reported-by: Arnd Bergmann Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0f920277dc22cb794f0572ee5d3423388453435d Author: Sebastian Reichel Date: Mon Aug 2 19:23:09 2021 +0200 misc: gehc-achc: new driver General Electric Healthcare's PPD has a secondary processor from NXP's Kinetis K20 series. That device has two SPI chip selects: The main interface's behaviour depends on the loaded firmware and is currently unused. The secondary interface can be used to update the firmware using EzPort protocol. This is implemented by this driver using the kernel's firmware API. The firmware is being flashed into non-volatile flash memory, so it is enough to flash it once and not on every boot. Flashing will wear the flash memory (it has a life time of at least 10k programming cycles). At the same time only occasional FW updates are expected (like e.g. a BIOS update). Thus the firmware update is triggered via sysfs instead of doing it in the driver's probe routine like many other drivers. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20210802172309.164365-4-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit cd7cd5b716d594e27a933c12f026d4f2426d7bf4 Author: Sebastian Reichel Date: Mon Aug 2 19:23:08 2021 +0200 ARM: dts: imx53-ppd: Fix ACHC entry PPD has only one ACHC device, which effectively is a Kinetis microcontroller. It has one SPI interface used for normal communication. Additionally it's possible to flash the device firmware using NXP's EzPort protocol by correctly driving a second chip select pin and the device reset pin. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20210802172309.164365-3-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit f9d8f4b3131cc84d3faf3210d9c22947fc53691d Author: Sebastian Reichel Date: Mon Aug 2 19:23:07 2021 +0200 dt-bindings: misc: ge-achc: Convert to DT schema format Convert the binding to DT schema format. Also update the binding to fix shortcomings * Add "nxp,kinetis-k20" fallback compatible * add programming SPI interface and reset GPIO * add main clock * add voltage supplies * drop spi-max-frequency from required properties, driver will setup max. frequency Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20210802172309.164365-2-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit b37a466837393af72fe8bcb8f1436410f3f173f3 Author: Yajun Deng Date: Thu Aug 5 19:54:34 2021 +0800 netdevice: add the case if dev is NULL Add the case if dev is NULL in dev_{put, hold}, so the caller doesn't need to care whether dev is NULL or not. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 61106bd2a8e4f02dacfbdf147c641b378a4c3de5 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:55 2021 +0530 bus: mhi: core: Improve debug messages for power up Improve error message to be more descriptive if a failure occurs with an invalid power up execution environment. Additionally, add a debug log to print the execution environment and MHI state before a power up is attempted to confirm if the device is in an expected state. This helps clarify reasons for power up failures such as the device being found in a PBL or Emergency Download Mode execution environment and the host expected a full power up with Pass-Through and no image loading involved. Link: https://lore.kernel.org/r/1620072038-36160-1-git-send-email-bbhatt@codeaurora.org Reviewed-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2e36190de69cb415955bfa8fbd94c44e38e58523 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:54 2021 +0530 bus: mhi: core: Replace DMA allocation wrappers with original APIs There is nothing special done within the mhi_alloc_coherent() and the mhi_free_coherent() wrapper functions. They only directly call the equivalent DMA allocation functions. Replace them with the original function calls such that the implementation is clear and direct. Link: https://lore.kernel.org/r/1624392428-9328-1-git-send-email-bbhatt@codeaurora.org Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-10-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 06e2c4a9eaf2a2ed267b9cee70f91aaf616eb925 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:53 2021 +0530 bus: mhi: core: Add range checks for BHI and BHIe When obtaining the BHI or BHIe offsets during the power up preparation phase, range checks are missing. These can help controller drivers avoid accessing any address outside of the MMIO region. Ensure that mhi_cntrl->reg_len is set before MHI registration as it is a required field and range checks will fail without it. Link: https://lore.kernel.org/r/1620330705-40192-7-git-send-email-bbhatt@codeaurora.org Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-9-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3551a30b9d4c2a5520e6c798758a6f4858adcd0a Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:52 2021 +0530 bus: mhi: pci_generic: Set register access length for MHI driver MHI driver requires register space length to add range checks and prevent memory region accesses outside of that for MMIO space. Set it from the PCI generic controller driver before registering the MHI controller. Link: https://lore.kernel.org/r/1620330705-40192-6-git-send-email-bbhatt@codeaurora.org Reviewed-by: Hemant Kumar Reviewed-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-8-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit c92513b8814f4955c3ea3c685d9a193e1c7823f0 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:51 2021 +0530 ath11k: set register access length for MHI driver MHI driver requires register space length to add range checks and prevent memory region accesses outside of that for MMIO space. Set it before registering the MHI controller. Link: https://lore.kernel.org/r/1620330705-40192-5-git-send-email-bbhatt@codeaurora.org Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Acked-by: Kalle Valo Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-7-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit baa7a08569358d9d16e71ce36f287c39a665d776 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:50 2021 +0530 bus: mhi: Add MMIO region length to controller structure Make controller driver specify the MMIO register region length for range checking of BHI or BHIe space. This can help validate that offsets are in acceptable memory region or not and avoid any boot-up issues due to BHI or BHIe memory accesses. Link: https://lore.kernel.org/r/1620330705-40192-4-git-send-email-bbhatt@codeaurora.org Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-6-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3aa8f43b33687a1170e7b96f9b25037566e7fc04 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:49 2021 +0530 bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up Set the BHI and BHIe pointers to NULL as part of clean-up. This makes sure that stale pointers are not accessed after powering MHI down. Link: https://lore.kernel.org/r/1620330705-40192-3-git-send-email-bbhatt@codeaurora.org Suggested-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-5-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3215d8e0691b4fc3ec26b44759e751cc05b8e2c5 Author: Bhaumik Bhatt Date: Mon Aug 2 10:42:48 2021 +0530 bus: mhi: core: Set BHI/BHIe offsets on power up preparation Set the BHI and/or BHIe offsets in mhi_prepare_for_power_up(), rearrange the function, and remove the equivalent from mhi_async_power_up(). This helps consolidate multiple checks in different parts of the driver and can help MHI fail early on before power up begins if the offsets are not read correctly. Link: https://lore.kernel.org/r/1620330705-40192-2-git-send-email-bbhatt@codeaurora.org Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 87693e092bd06aa25686ed3db7aed460e144849d Author: ULRICH Thomas Date: Mon Aug 2 10:42:47 2021 +0530 bus: mhi: pci_generic: Add Cinterion MV31-W PCIe to MHI This patch adds VendorID/ProductID and MBIM Channel Definitions for M.2 Modem Card (PCIe Variant) to MHI PCI generic controller driver. Cinterion MV31-W (by Thales) Additional information on such Modem Card (USB or PCIe variant) is available at: https://www.thalesgroup.com/en/markets/digital-identity-and-security/iot/iot-connectivity/products/iot-products/mv31-w-ultra-high Link: https://lore.kernel.org/r/PAZP264MB284690134DA010698E6B3BDDE60A9@PAZP264MB2846.FRAP264.PROD.OUTLOOK.COM [mani: fixed the subject, whitespace, and added sideband_wake field] Reviewed-by: Manivannan Sadhasivam Signed-off-by: ULRICH Thomas Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0092a1e3f7636ff4e202a41b0320690699247e22 Author: Loic Poulain Date: Mon Aug 2 10:42:46 2021 +0530 bus: mhi: Add inbound buffers allocation flag Currently, the MHI controller driver defines which channels should have their inbound buffers allocated and queued. But ideally, this is something that should be decided by the MHI device driver instead, which actually deals with that buffers. Add a flag parameter to mhi_prepare_for_transfer allowing to specify if buffers have to be allocated and queued by the MHI stack. Keep auto_queue flag for now, but should be removed at some point. Link: https://lore.kernel.org/r/1624566520-20406-1-git-send-email-loic.poulain@linaro.org Tested-by: Bhaumik Bhatt Reviewed-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Acked-by: Jakub Kicinski Signed-off-by: Loic Poulain Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210802051255.5771-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1160dfa178eb848327e9dec39960a735f4dc1685 Author: Yajun Deng Date: Thu Aug 5 19:55:27 2021 +0800 net: Remove redundant if statements The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit fec29bf04994b478a43a7e60e6dd5ac1f7cb53ae Author: Mikko Perttunen Date: Thu Jul 15 13:34:23 2021 +0300 misc: sram: Only map reserved areas in Tegra SYSRAM On Tegra186 and later, a portion of the SYSRAM may be reserved for use by TZ. Non-TZ memory accesses to this portion, including speculative accesses, trigger SErrors that bring down the system. This does also happen in practice occasionally (due to speculative accesses). To fix the issue, add a flag to the SRAM driver to only map the device tree-specified reserved areas depending on a flag set based on the compatibility string. This would not affect non-Tegra systems that rely on the entire thing being memory mapped. If 64K pages are being used, we cannot exactly map the 4K regions that are placed in SYSRAM - ioremap code instead aligns to closest 64K pages. However, since in practice the non-accessible memory area is 64K aligned, these mappings do not overlap with the non-accessible memory area and things work out. Reviewed-by: Mian Yousaf Kaukab Signed-off-by: Mikko Perttunen Link: https://lore.kernel.org/r/20210715103423.1811101-1-mperttunen@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 72674e86b6fe2f656c93564635b675bcdf012844 Merge: e67adaa1754d5 4f45f34049601 Author: Greg Kroah-Hartman Date: Thu Aug 5 14:26:03 2021 +0200 Merge tag 'fpga-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager changes for 5.15-rc1 FPGA Manager - Colin's change is a simple spelling cleanup. DFL - Martin's fist change exposes DFL feature revision to client drivers - Martin's second change modifies a SPI driver to populate different spi_board_info modaliases based on the DFL feature revision All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my for-next branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: spi: spi-altera-dfl: support n5010 feature revision fpga: dfl: expose feature revision from struct dfl_device fpga: Fix spelling mistake "eXchnage" -> "exchange" in Kconfig commit a8f80c20b373bb46670643db81f043ba7da6a537 Author: Fabio M. De Francesco Date: Thu Aug 5 14:06:09 2021 +0200 staging: r8188eu: Remove unneeded comments in rtw_mp_ioctl.h After commit 85143bdc731b ("staging: r8188eu: include: Remove unused const definitions"), some comments are not anymore needed. Remove them too. In the while, remove also a line with a void comment. Suggested-by: Greg Kroah-Hartman Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210805120609.28588-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit a85b99ab6abb583e051d266c2138647daa5c0ecc Author: David S. Miller Date: Thu Aug 5 13:23:29 2021 +0100 Revert "wwan: mhi: Fix build." This reverts commit ab996c420508761f3313c15c5f72d06ca7dc1a5b. Only aplicable when net is merged into net-next. Signed-off-by: David S. Miller commit 6234219d7fe8bb709f1e9d5afcb420d9cb30beac Merge: ab996c4205087 5ebfb4cc30483 Author: David S. Miller Date: Thu Aug 5 13:14:09 2021 +0100 Merge branch 'GRO-Toeplitz-selftests' Coco Li says: ==================== GRO and Toeplitz hash selftests This patch contains two selftests in net, as well as respective scripts to run the tests on a single machine in loopback mode. GRO: tests the Linux kernel GRO behavior Toeplitz: tests the toeplitz hash implementation ==================== Signed-off-by: David S. Miller commit 5ebfb4cc3048380b43506ffc71b9cf8b83128989 Author: Coco Li Date: Thu Aug 5 07:36:41 2021 +0000 selftests/net: toeplitz test To verify that this hash implements the Toeplitz hash function. Additionally, provide a script toeplitz.sh to run the test in loopback mode on a networking device of choice (see setup_loopback.sh). Since the script modifies the NIC setup, it will not be run by selftests automatically. Tested: ./toeplitz.sh -i eth0 -irq_prefix -t -6 carrier ready rxq 0: cpu 14 rxq 1: cpu 20 rxq 2: cpu 17 rxq 3: cpu 23 cpu 14: rx_hash 0x69103ebc [saddr fda8::2 daddr fda8::1 sport 58938 dport 8000] OK rxq 0 (cpu 14) ... cpu 20: rx_hash 0x257118b9 [saddr fda8::2 daddr fda8::1 sport 59258 dport 8000] OK rxq 1 (cpu 20) count: pass=111 nohash=0 fail=0 Test Succeeded! Signed-off-by: Coco Li Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit 7d1575014a63caeebb13b000ee152ce711580119 Author: Coco Li Date: Thu Aug 5 07:36:40 2021 +0000 selftests/net: GRO coalesce test Implement a GRO testsuite that expects Linux kernel GRO behavior. All tests pass with the kernel software GRO stack. Run against a device with hardware GRO to verify that it matches the software stack. gro.c generates packets and sends them out through a packet socket. The receiver in gro.c (run separately) receives the packets on a packet socket, filters them by destination ports using BPF and checks the packet geometry to see whether GRO was applied. gro.sh provides a wrapper to run the gro.c in NIC loopback mode. It is not included in continuous testing because it modifies network configuration around a physical NIC: gro.sh sets the NIC in loopback mode, creates macvlan devices on the physical device in separate namespaces, and sends traffic generated by gro.c between the two namespaces to observe coalescing behavior. GRO coalescing is time sensitive. Some tests may prove flaky on some hardware. Note that this test suite tests for software GRO unless hardware GRO is enabled (ethtool -K $DEV rx-gro-hw on). To test, run ./gro.sh. The wrapper will output success or failed test names, and generate log.txt and stderr. Sample log.txt result: ... pure data packet of same size: Test succeeded large data packets followed by a smaller one: Test succeeded small data packets followed by a larger one: Test succeeded ... Sample stderr result: ... carrier ready running test ipv4 data Expected {200 }, Total 1 packets Received {200 }, Total 1 packets. ... Signed-off-by: Coco Li Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit c78d0c7484f0a8fc4da0047b81900d00cd26488b Author: Heiko Carstens Date: Wed Aug 4 13:40:31 2021 +0200 s390: rename dma section to amode31 The dma section name is confusing, since the code which resides within that section has nothing to do with direct memory access. Instead the limitation is that the code has to run in 31 bit addressing mode, and therefore has to reside below 2GB. So the name was chosen since ZONE_DMA is the same region. To reduce confusion rename the section to amode31, which hopefully describes better what this is about. Note: this will also change vmcoreinfo strings - SDMA=... gets renamed to SAMODE31=... - EDMA=... gets renamed to EAMODE31=... Acked-by: Vasily Gorbik Reviewed-by: Alexander Egorenkov Signed-off-by: Heiko Carstens commit cfafad6d7897b4add601ed6ee0bd0221b7f81e30 Author: Heiko Carstens Date: Tue Aug 3 14:42:29 2021 +0200 s390/mm: use page_to_virt() in __kernel_map_pages() Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 52b6defae7de31aaa960e78e506f882c12b4af53 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:48 2021 +0200 s390/sclp: replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20210803141621.780504-6-bigeasy@linutronix.de Signed-off-by: Heiko Carstens commit a73de29320287d0e72b9e158879cb047e226ec2b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:47 2021 +0200 s390: replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20210803141621.780504-5-bigeasy@linutronix.de Signed-off-by: Heiko Carstens commit ab996c420508761f3313c15c5f72d06ca7dc1a5b Author: David S. Miller Date: Thu Aug 5 13:10:50 2021 +0100 wwan: mhi: Fix build. Reported-by: Mark Brown Signed-off-by: David S. Miller commit 1fe0e1fa3209ad8e9124147775bd27b1d9f04bd4 Author: Tony Lindgren Date: Tue Jul 27 13:35:33 2021 +0300 serial: 8250_omap: Handle optional overrun-throttle-ms property Handle optional overrun-throttle-ms property as done for 8250_fsl in commit 6d7f677a2afa ("serial: 8250: Rate limit serial port rx interrupts during input overruns"). This can be used to rate limit the UART interrupts on noisy lines that end up producing messages like the following: ttyS ttyS2: 4 input overrun(s) At least on droid4, the multiplexed USB and UART port is left to UART mode by the bootloader for a debug console, and if a USB charger is connected on boot, we get noise on the UART until the PMIC related drivers for PHY and charger are loaded. With this patch and overrun-throttle-ms = <500> we avoid the extra rx interrupts. Cc: Carl Philipp Klemm Cc: Merlijn Wajer Cc: Pavel Machek Cc: Sebastian Reichel Cc: Vignesh Raghavendra Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727103533.51547-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 1a191ddcc76f810654e52aab5a36c399d82e26a0 Author: Tony Lindgren Date: Tue Jul 27 13:35:32 2021 +0300 dt-bindings: serial: 8250: Update for standard overrun-throttle property In some cases we want to specify overrun-throttle like other 8250 drivers are doing. Cc: devicetree@vger.kernel.org Cc: Rob Herring Cc: Vignesh Raghavendra Acked-by: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727103533.51547-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 9ff80e2de36d0554e3a6da18a171719fe8663c17 Author: Marc Zyngier Date: Sun Jul 25 19:07:54 2021 +0100 mfd: Don't use irq_create_mapping() to resolve a mapping Although irq_create_mapping() is able to deal with duplicate mappings, it really isn't supposed to be a substitute for irq_find_mapping(), and can result in allocations that take place in atomic context if the mapping didn't exist. Fix the handful of MFD drivers that use irq_create_mapping() in interrupt context by using irq_find_mapping() instead. Cc: Linus Walleij Cc: Lee Jones Cc: Maxime Coquelin Cc: Alexandre Torgue Signed-off-by: Marc Zyngier Signed-off-by: Lee Jones commit 9344988d2979ce9eefe136a69efcf692615ebba8 Author: Florian Westphal Date: Fri Jul 30 15:14:22 2021 +0200 netfilter: ctnetlink: allow to filter dump by status bits If CTA_STATUS is present, but CTA_STATUS_MASK is not, then the mask is automatically set to 'status', so that kernel returns those entries that have all of the requested bits set. This makes more sense than using a all-one mask since we'd hardly ever find a match. There are no other checks for status bits, so if e.g. userspace sets impossible combinations it will get an empty dump. If kernel would reject unknown status bits, then a program that works on a future kernel that has IPS_FOO bit fails on old kernels. Same for 'impossible' combinations: Kernel never sets ASSURED without first having set SEEN_REPLY, but its possible that a future kernel could do so. Therefore no sanity tests other than a 0-mask. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ff1199db8c3b7cdc3ac4430badfd254023c5142e Author: Florian Westphal Date: Fri Jul 30 15:14:21 2021 +0200 netfilter: ctnetlink: add and use a helper for mark parsing ctnetlink dumps can be filtered based on the connmark. Prepare for status bit filtering by using a named structure and by moving the mark parsing code to a helper. Else ctnetlink_alloc_filter size grows a bit too big for my taste when status handling is added. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d229f0fb10250173989d2086073ff702980ef48b Author: Fabio M. De Francesco Date: Mon Aug 2 02:55:17 2021 +0200 staging: r8188eu: core: Remove rtw_mfree_all_stainfo() Remove rtw_mfree_all_stainfo() and the only line of code that calls it. This function simply takes a spinlock and iterates over a list with no purpose. That iteration has no side effects. Signed-off-by: Fabio M. De Francesco Acked-by: Larry Finger Acked-by: Dan Carpenter Link: https://lore.kernel.org/r/20210802005517.12815-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit e1109da7bebbf1a0faca8a5e3453fe98035578fa Author: Fabio M. De Francesco Date: Wed Aug 4 16:32:18 2021 +0200 staging: r8188eu: Fix cast between incompatible function type Fix sparse warnings of casts between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(long unsigned int)’ [-Wcast-function-type]. Suggested-by: Dan Carpenter Reviewed-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210804143218.13665-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9d39971c0cc648625c841af16e7c96911603e63 Author: Len Baker Date: Sun Aug 1 10:51:55 2021 +0200 staging/fbtft: Fix braces coding style Add braces to the "for" loop. This way, the kernel coding style is followed. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210801085155.3170-4-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 31f0c349dd399ae03df5633abd73830b2429e7a1 Author: Len Baker Date: Sun Aug 1 10:51:54 2021 +0200 staging/fbtft: Remove unnecessary variable initialization Remove the initialization of the variable "i" since it is written a few lines later. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210801085155.3170-3-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit b888897014a9986726b7f8d69356097722834c04 Author: Len Baker Date: Sun Aug 1 10:51:53 2021 +0200 staging/fbtft: Remove all strcpy() uses strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy() but in this case it is simpler to use the "%*ph" format specifier. Moreover, with the "0x%02X " in the sprintf followed by the strcat, the msg buffer (now removed) can print 128/5 values (25 hex values). So, the "%*ph" replacement won't cut output earlier than requested since this format specifier can print up to 64 bytes. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210801085155.3170-2-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 96ac47d2418d32bb8a7aff5973bd5d3375775897 Author: Bryan Brattlof Date: Wed Aug 4 15:01:10 2021 +0000 staging: rtl8723bs: remove unused BT structures remove static BT debugging structures no longer in use. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20210804144812.715695-1-hello@bryanbrattlof.com Signed-off-by: Greg Kroah-Hartman commit 04e424519d320fb4e3486dd929b69a67d06a6b05 Author: Scott J. Crouch Date: Wed Aug 4 10:13:34 2021 +1000 staging: rtl8723bs: Remove initialisation of globals to 0 This fixes the following checkpatch.pl errors: ERROR: do not initialise globals to {0,NULL} Signed-off-by: Scott J. Crouch Link: https://lore.kernel.org/r/20210804001335.16742-1-scottjcrouch@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9e4ae52cabd8aec21360a44b90c4ec6b287eb0d2 Author: ErKun Yang Date: Thu Apr 8 21:27:51 2021 +0800 PCI: xgene-msi: Remove redundant dev_err() call in xgene_msi_probe() devm_ioremap_resource() internally calls __devm_ioremap_resource() which is where error checking and handling is actually taking place. i Therefore, the dev_err() call in xgene_msi_probe() is redundant. Remove it. Link: https://lore.kernel.org/r/20210408132751.1198171-1-yangerkun@huawei.com Reported-by: Hulk Robot Signed-off-by: ErKun Yang [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński commit 9eec0792024983276871baeb201609abb07dd35d Author: Weizhao Ouyang Date: Thu Aug 5 17:58:23 2021 +0800 coccinelle: api: rename kzfree to kfree_sensitive Commit 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()") renamed kzfree() to kfree_sensitive(), it should be applied to coccinelle. Signed-off-by: Weizhao Ouyang Signed-off-by: Julia Lawall Acked-by: Denis Efremov commit 52c3c004727baca39800df0153d8c782ae66a8ac Author: Phillip Potter Date: Wed Aug 4 00:05:35 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/usb_ops_linux.c Remove RT_TRACE macro calls from hal/usb_ops_linux.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-9-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 24b336db31946f1e6780017c664dee1b759b2674 Author: Phillip Potter Date: Wed Aug 4 00:05:34 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/usb_halinit.c Remove RT_TRACE macro calls from hal/usb_halinit.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 392d406b5c1421c4195dc14d54d6ae0bd2707050 Author: Phillip Potter Date: Wed Aug 4 00:05:33 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_mp.c Remove RT_TRACE macro calls from hal/rtl8188e_mp.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit eabc1a26e1ca56e3341cd55354fa074853fc0d5d Author: Phillip Potter Date: Wed Aug 4 00:05:32 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_hal_init.c Remove RT_TRACE macro calls from hal/rtl8188e_hal_init.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 7ca7bbdc1487331a420bb6bec497188de5346643 Author: Phillip Potter Date: Wed Aug 4 00:05:31 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/hal_intf.c Remove RT_TRACE macro calls from hal/hal_intf.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 23f7f44a933805457a8748f6f2469d86ab6a6b3a Author: Phillip Potter Date: Wed Aug 4 00:05:30 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/HalPwrSeqCmd.c Remove RT_TRACE macro calls from hal/HalPwrSeqCmd.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 204270c147de065cafc818bd21405a1651b2bc7e Author: Phillip Potter Date: Wed Aug 4 00:05:29 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_recv.c Remove RT_TRACE macro calls from hal/rtl8188eu_recv.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit fc048dee3902e063bda1d744011fa14ea02a83f7 Author: Phillip Potter Date: Wed Aug 4 00:05:28 2021 +0100 staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_xmit.c Remove RT_TRACE macro calls from hal/rtl8188eu_xmit.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210803230535.74254-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit a9f392d4518214d1de5aa9457f9778dd1ba578a9 Author: Larry Finger Date: Tue Aug 3 08:52:23 2021 -0500 staging: r8188eu: Remove some bit manipulation macros This driver defines a set of macros that get or set a bitfield in the RX and TX descriptors. Most of these have been replaced by the appropriate use of the system macros BIT() or GENMASK(). While reworking these routines, I also fixed camel case variables and missing spaces. Some comments were also converted to the drivers/net/wireless preferred format. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210803135223.12543-11-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 496fd4e78afd7a1802cde83d6171040bd3924c17 Author: Larry Finger Date: Tue Aug 3 08:52:22 2021 -0500 staging: r8188eu: Remove some unused and ugly macros This driver contains a number of macros that are intended to do endian conversion. The first step in getting rid of them is to delete the ones that are not used. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210803135223.12543-10-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit e2530e0b7ded1bc15c1f778b85d3db9981181427 Author: Larry Finger Date: Tue Aug 3 08:52:21 2021 -0500 staging: r8188eu: Remove wrapper around do_div Wrapper routine rtw_modular64() contains only a call to do_div() and is used once in the code. Remove the wrapper. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit b90a6bf384cb0b31278e93ef54ef95682c234806 Author: Larry Finger Date: Tue Aug 3 08:52:20 2021 -0500 staging: r8188eu: Remove rtw_division64() This wrapper is never used. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210803135223.12543-8-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit e50abb3aa5e15453a5ce09f8a1a8fac0ed4ffe48 Author: Lukas Bulwahn Date: Tue Aug 3 09:18:11 2021 +0200 MAINTAINERS: update STAGING - REALTEK RTL8188EU DRIVERS Commit 55dfa29b43d2 ("staging: rtl8188eu: remove rtl8188eu driver from staging dir") removes ./drivers/staging/rtl8188eu, but misses to adjust the STAGING - REALTEK RTL8188EU DRIVERS section in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: no file matches F: drivers/staging/rtl8188eu/ A refurnished rtl8188eu driver is available in ./drivers/staging/r8188eu/ and there is no existing section in MAINTAINERS for that directory. So, reuse the STAGING - REALTEK RTL8188EU DRIVERS section and point to the refurnished driver with its current developers and maintainers according to the current git log. Acked-by: Phillip Potter Acked-by: Larry Finger Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210803071811.8142-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1e7cbfaa66d39e78bd24df0c78b55df68176b59e Author: Rishabh Bhatnagar Date: Wed Aug 4 14:19:59 2021 -0700 firmware: arm_scmi: Free mailbox channels if probe fails Mailbox channels for the base protocol are setup during probe. There can be a scenario where probe fails to acquire the base protocol due to a timeout leading to cleaning up of all device managed memory including the scmi_mailbox structure setup during mailbox_chan_setup function. | arm-scmi soc:qcom,scmi: timed out in resp(caller: version_get+0x84/0x140) | arm-scmi soc:qcom,scmi: unable to communicate with SCMI | arm-scmi: probe of soc:qcom,scmi failed with error -110 Now when a message arrives at cpu slightly after the timeout, the mailbox controller will try to call the rx_callback of the client and might end up accessing freed memory. | rx_callback+0x24/0x160 | mbox_chan_received_data+0x44/0x94 | __handle_irq_event_percpu+0xd4/0x240 This patch frees the mailbox channels setup during probe and adds some more error handling in case the probe fails. Link: https://lore.kernel.org/r/1628111999-21595-1-git-send-email-rishabhb@codeaurora.org Tested-by: Cristian Marussi Reviewed-by: Cristian Marussi Signed-off-by: Rishabh Bhatnagar Signed-off-by: Sudeep Holla commit 5b283ad4c8daeb8f1ddb2324ef0a146fe97bc900 Author: Larry Finger Date: Mon Aug 2 14:27:19 2021 -0500 staging: r8188eu: Remove 4 empty routines from os_sep/service.c Routines rtw_suspend_lock_init(), rtw_suspend_lock_uninit(), rtw_lock_suspend(), and rtw_unlock_suspend() do not conti=ain any code. Simplify by removing them. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210802192721.23110-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 8cc35e0d4d3f4d84744a50eb8d950b73414045c7 Author: Larry Finger Date: Mon Aug 2 14:27:18 2021 -0500 staging: r8188eu: Remove wrappers for atomic operations These wrappers were useful when this driver had the hooks for Windows, but are no longer needed. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 85143bdc731b543b4a184f63cdf42f557fb66f77 Author: Fabio M. De Francesco Date: Mon Aug 2 03:10:25 2021 +0200 staging: r8188eu: include: Remove unused const definitions Remove unused const definitions. Issues detected by sparse. Remove the '#ifdef' and '#endif' preprocessor directives that surround them. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210802011025.23887-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit fd03e7f784a19235bd8114da9de40708fa35279f Author: Fabio M. De Francesco Date: Mon Aug 2 03:00:56 2021 +0200 staging: r8188eu: Remove set but unused variables Remove set but unused variables. Issues detected by sparse. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210802010056.20543-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit d37b3b54f133f282683e59145ee2a906719dee2f Author: Michael Straube Date: Sun Aug 1 23:03:54 2021 +0200 staging: r8188eu: remove empty function odm_DynamicPrimaryCCA() Function odm_DynamicPrimaryCCA() does nothing, remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210801210354.25218-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b398ff88aa362e6fb348b2f39f2bf1b9a1f42d1e Author: Michael Straube Date: Sun Aug 1 23:03:53 2021 +0200 staging: r8188eu: remove return from void functions Remove return from void functions to clear checkpatch warnings. WARNING: void function return statements are not generally useful Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210801210354.25218-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e11c0e258c1a87e478a7a44e7c3d9e8ea4b8438c Author: Gustavo A. R. Silva Date: Wed Aug 4 16:43:52 2021 -0500 net/ipv6/mcast: Use struct_size() helper Replace IP6_SFLSIZE() with struct_size() helper 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: David S. Miller commit e6a1f7e0b0fe5997b896b793c70d12fc5ed06cdd Author: Gustavo A. R. Silva Date: Wed Aug 4 16:18:50 2021 -0500 net/ipv4/igmp: Use struct_size() helper Replace IP_SFLSIZE() with struct_size() helper 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: David S. Miller commit db243b796439c0caba47865564d8acd18a301d18 Author: Gustavo A. R. Silva Date: Wed Aug 4 15:45:36 2021 -0500 net/ipv4/ipv6: Replace one-element arraya 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]. Use an anonymous union with a couple of anonymous structs in order to keep userspace unchanged and refactor the related code accordingly: $ pahole -C group_filter net/ipv4/ip_sockglue.o struct group_filter { union { struct { __u32 gf_interface_aux; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ struct __kernel_sockaddr_storage gf_group_aux; /* 8 128 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ __u32 gf_fmode_aux; /* 136 4 */ __u32 gf_numsrc_aux; /* 140 4 */ struct __kernel_sockaddr_storage gf_slist[1]; /* 144 128 */ }; /* 0 272 */ struct { __u32 gf_interface; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ struct __kernel_sockaddr_storage gf_group; /* 8 128 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ __u32 gf_fmode; /* 136 4 */ __u32 gf_numsrc; /* 140 4 */ struct __kernel_sockaddr_storage gf_slist_flex[0]; /* 144 0 */ }; /* 0 144 */ }; /* 0 272 */ /* size: 272, cachelines: 5, members: 1 */ /* last cacheline: 16 bytes */ }; $ pahole -C compat_group_filter net/ipv4/ip_sockglue.o struct compat_group_filter { union { struct { __u32 gf_interface_aux; /* 0 4 */ struct __kernel_sockaddr_storage gf_group_aux __attribute__((__aligned__(4))); /* 4 128 */ /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ __u32 gf_fmode_aux; /* 132 4 */ __u32 gf_numsrc_aux; /* 136 4 */ struct __kernel_sockaddr_storage gf_slist[1] __attribute__((__aligned__(4))); /* 140 128 */ } __attribute__((__packed__)) __attribute__((__aligned__(4))); /* 0 268 */ struct { __u32 gf_interface; /* 0 4 */ struct __kernel_sockaddr_storage gf_group __attribute__((__aligned__(4))); /* 4 128 */ /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ __u32 gf_fmode; /* 132 4 */ __u32 gf_numsrc; /* 136 4 */ struct __kernel_sockaddr_storage gf_slist_flex[0] __attribute__((__aligned__(4))); /* 140 0 */ } __attribute__((__packed__)) __attribute__((__aligned__(4))); /* 0 140 */ } __attribute__((__aligned__(1))); /* 0 268 */ /* size: 268, cachelines: 5, members: 1 */ /* forced alignments: 1 */ /* last cacheline: 12 bytes */ } __attribute__((__packed__)); This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 3d0d19b174a28d98962fc271953f7e6d526b69e4 Author: Greg Kroah-Hartman Date: Thu Aug 5 12:43:38 2021 +0200 Revert "staging: r8188eu: Fix different base types in assignments and parameters" This reverts commit 56febcc2595e2bf2546c5bb4c35740ce883771a2. It's not correct and instead of fixing it up, let's just revert it for now. Reported-by: Dan Carpenter Cc: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210802203020.9679-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit c8ec10db41e5f95237d10d00d2a41037a370a265 Author: Phillip Potter Date: Sun Aug 1 20:04:36 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_mp_ioctl.c Remove RT_TRACE macro calls from core/rtw_mp_ioctl.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-15-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6a4bcaf1e8397337d496ab3481febd4c1f467ffc Author: Phillip Potter Date: Sun Aug 1 20:04:35 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_led.c Remove RT_TRACE macro calls from core/rtw_led.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-14-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 9bc84d0a4578a835620dfec7cc61de9d9ad085a1 Author: Phillip Potter Date: Sun Aug 1 20:04:27 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_io.c Remove RT_TRACE macro calls from core/rtw_io.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 0399a1e24bbd1b78bf3e73ee46f25c2647ae8927 Author: Phillip Potter Date: Sun Aug 1 20:04:26 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_ieee80211.c Remove RT_TRACE macro calls from core/rtw_ieee80211.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 821e507947fe3a7e6159ab6cf9b5e7da3c529b9e Author: Phillip Potter Date: Sun Aug 1 20:04:25 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_wlan_util.c Remove RT_TRACE macro calls from core/rtw_wlan_util.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit b0c70266e418600ac332c9a1ddaa3c53b394b6cc Author: Phillip Potter Date: Sun Aug 1 20:04:24 2021 +0100 staging: r8188eu: remove RT_TRACE calls from core/rtw_pwrctrl.c Remove RT_TRACE macro calls from core/rtw_pwrctrl.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210801190437.82017-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit fd44e8efccd4de1764d195958bcac3242c921ed7 Author: Christophe JAILLET Date: Tue May 4 19:18:04 2021 +0200 PCI: tegra: make const array err_msg static Don't populate the array err_msg on the stack but instead make it static. Makes the object code smaller by 64 bytes. While at it, add a missing const, as reported by checkpatch. Compiled with gcc 11.0.1 Before: $ size drivers/pci/controller/pci-tegra.o text data bss dec hex filename 25623 2844 32 28499 6f53 drivers/pci/controller/pci-tegra.o After: $ size drivers/pci/controller/pci-tegra.o text data bss dec hex filename 25559 2844 32 28435 6f13 drivers/pci/controller/pci-tegra.o Link: https://lore.kernel.org/r/5f3f35296b944b94546cc7d1e9cc6186484620d8.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Vidya Sagar commit 804b2b6f2a95d924f52c80c80a01b8fea73efb1e Author: Christophe JAILLET Date: Tue May 4 19:17:54 2021 +0200 PCI: tegra: Use 'seq_puts' instead of 'seq_printf' As spotted by checkpatch, use 'seq_puts' instead of 'seq_printf' when possible. It is slightly more efficient. Link: https://lore.kernel.org/r/7bdedb342b9221169ab085540cf25d1992e8b97a.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Vidya Sagar commit eff21f5da308265678e7e59821795e606f3e560f Author: Christophe JAILLET Date: Tue May 4 19:17:42 2021 +0200 PCI: tegra: Fix OF node reference leak Commit 9e38e690ace3 ("PCI: tegra: Fix OF node reference leak") has fixed some node reference leaks in this function but missed some of them. In fact, having 'port' referenced in the 'rp' structure is not enough to prevent the leak, until 'rp' is actually added in the 'pcie->ports' list. Add the missing 'goto err_node_put' accordingly. Link: https://lore.kernel.org/r/55b11e9a7fa2987fbc0869d68ae59888954d65e2.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Vidya Sagar commit 167fc30e8e5185a411f0115302f4ef467517ffb8 Author: Fabio Aiuto Date: Sun Aug 1 15:46:29 2021 +0200 staging: rtl8723bs: remove unused macros remove unused macros detected by -Wunused-macros gcc option. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/20210801134629.23433-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 552838fdcaef2c37442b3072fccc2e9ccc631c57 Author: Michael Straube Date: Sun Aug 1 10:46:14 2021 +0200 staging: r8188eu: clean up comparsions to NULL in core directory Clean up comparsions to NULL in the core directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210801084614.4328-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 725a3f1c4d56b73d2d4089c1dc78d29554f8daba Author: Michael Straube Date: Sun Aug 1 10:46:13 2021 +0200 staging: r8188eu: clean up comparsions to NULL in hal directory Clean up comparsions to NULL in the hal directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210801084614.4328-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d15040a33883c3ab2ee2ea17e6427ce24e9f3ac0 Merge: 4167a960574fc 9384eacd80f3d Author: David S. Miller Date: Thu Aug 5 11:36:59 2021 +0100 Merge branch 'bridge-ioctl-fixes' Nikolay Aleksandrov says: ==================== net: bridge: fix recent ioctl changes These are three fixes for the recent bridge removal of ndo_do_ioctl done by commit ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl"). Patch 01 fixes a deadlock of the new bridge ioctl hook lock and rtnl by taking a netdev reference and always taking the bridge ioctl lock first then rtnl from within the bridge hook. Patch 02 fixes old_deviceless() bridge calls device name argument, and patch 03 checks in dev_ifsioc()'s SIOCBRADD/DELIF cases if the netdevice is actually a bridge before interpreting its private ptr as net_bridge. Patch 01 was tested by running old bridge-utils commands with lockdep enabled. Patch 02 was tested again by using bridge-utils and using the respective ioctl calls on a "up" bridge device. Patch 03 was tested by using the addif ioctl on a non-bridge device (e.g. loopback). ==================== Signed-off-by: David S. Miller commit 9384eacd80f3da8d05fd17073eafd1f7fef80b26 Author: Nikolay Aleksandrov Date: Thu Aug 5 11:29:03 2021 +0300 net: core: don't call SIOCBRADD/DELIF for non-bridge devices Commit ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") changed SIOCBRADD/DELIF to use bridge's ioctl hook (br_ioctl_hook) without checking if the target netdevice is actually a bridge which can cause crashes and generally interpreting other devices' private pointers as net_bridge pointers. Crash example (lo - loopback): $ brctl addif lo ens16 BUG: kernel NULL pointer dereference, address: 000000000000059898 #PF: supervisor read access in kernel modede #PF: error_code(0x0000) - not-present pagege PGD 0 P4D 0 ^Ac Oops: 0000 [#1] SMP NOPTI CPU: 2 PID: 1376 Comm: brctl Kdump: loaded Tainted: G W 5.14.0-rc3+ #405 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014 RIP: 0010:add_del_if+0x1f/0x7c [bridge] Code: 80 bf 1b a0 41 5c e9 c0 3c 03 e1 0f 1f 44 00 00 41 55 41 54 41 89 f4 be 0c 00 00 00 55 48 89 fd 53 48 8b 87 88 00 00 00 89 d3 <4c> 8b a8 98 05 00 00 49 8b bd d0 00 00 00 e8 17 d7 f3 e0 84 c0 74 RSP: 0018:ffff888109d97cb0 EFLAGS: 00010202^Ac RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 000000000000000c RDI: ffff888101239bc0 RBP: ffff888101239bc0 R08: 0000000000000001 R09: 0000000000000000 R10: ffff888109d97cd8 R11: 00000000000000a3 R12: 0000000000000012 R13: 0000000000000000 R14: ffff888101239bc0 R15: ffff888109d97e10 FS: 00007fc1e365b540(0000) GS:ffff88822be80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000598 CR3: 0000000106506000 CR4: 00000000000006e0 Call Trace: br_ioctl_stub+0x7c/0x441 [bridge] br_ioctl_call+0x6d/0x8a dev_ifsioc+0x325/0x4e8 dev_ioctl+0x46b/0x4e1 sock_do_ioctl+0x7b/0xad sock_ioctl+0x2de/0x2f2 vfs_ioctl+0x1e/0x2b __do_sys_ioctl+0x63/0x86 do_syscall_64+0xcb/0xf2 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc1e3589427 Code: 00 00 90 48 8b 05 69 aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 39 aa 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc8d501d38 EFLAGS: 00000202 ORIG_RAX: 000000000000001010 RAX: ffffffffffffffda RBX: 0000000000000012 RCX: 00007fc1e3589427 RDX: 00007ffc8d501d60 RSI: 00000000000089a3 RDI: 0000000000000003 RBP: 00007ffc8d501d60 R08: 0000000000000000 R09: fefefeff77686d74 R10: fffffffffffff8f9 R11: 0000000000000202 R12: 00007ffc8d502e06 R13: 00007ffc8d502e06 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: bridge stp llc bonding ipv6 virtio_net [last unloaded: llc]^Ac CR2: 0000000000000598 Reported-by: syzbot+79f4a8692e267bdb7227@syzkaller.appspotmail.com Fixes: ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit cbd7ad29a5070a75dd076118ce7e400ce4b8d8d1 Author: Nikolay Aleksandrov Date: Thu Aug 5 11:29:02 2021 +0300 net: bridge: fix ioctl old_deviceless bridge argument Commit ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") changed the source of the argument copy in bridge's old_deviceless() from args[1] (user ptr to device name) to uarg (ptr to ioctl arguments) causing wrong device name to be used. Example (broken, bridge exists but is up): $ brctl delbr bridge bridge bridge doesn't exist; can't delete it Example (working): $ brctl delbr bridge bridge bridge is still up; can't delete it Fixes: ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 893b195875340cb44b54c9db99e708145f1210e8 Author: Nikolay Aleksandrov Date: Thu Aug 5 11:29:01 2021 +0300 net: bridge: fix ioctl locking Before commit ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") the bridge ioctl calls were divided in two parts: one was deviceless called by sock_ioctl and didn't expect rtnl to be held, the other was with a device called by dev_ifsioc() and expected rtnl to be held. After the commit above they were united in a single ioctl stub, but it didn't take care of the locking expectations. For sock_ioctl now we acquire (1) br_ioctl_mutex, (2) rtnl and for dev_ifsioc we acquire (1) rtnl, (2) br_ioctl_mutex The fix is to get a refcnt on the netdev for dev_ifsioc calls and drop rtnl then to reacquire it in the bridge ioctl stub after br_ioctl_mutex has been acquired. That will avoid playing locking games and make the rules straight-forward: we always take br_ioctl_mutex first, and then rtnl. Reported-by: syzbot+34fe5894623c4ab1b379@syzkaller.appspotmail.com Fixes: ad2f99aedf8f ("net: bridge: move bridge ioctls out of .ndo_do_ioctl") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 4167a960574fcadc9067f4280951a35b8c021c68 Author: Gustavo A. R. Silva Date: Wed Aug 4 13:23:25 2021 -0500 net/ipv4: Revert use of struct_size() helper Revert the use of structr_size() and stay with IP_MSFILTER_SIZE() for now, as in this case, the size of struct ip_msfilter didn't change with the addition of the flexible array imsf_slist_flex[]. So, if we use struct_size() we will be allocating and calculating the size of struct ip_msfilter with one too many items for imsf_slist_flex[]. We might use struct_size() in the future, but for now let's stay with IP_MSFILTER_SIZE(). Fixes: 2d3e5caf96b9 ("net/ipv4: Replace one-element array with flexible-array member") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 548011957d1d72e0b662300c8b32b81d593b796e Author: Ikjoon Jang Date: Thu Aug 5 13:39:57 2021 +0800 usb: xhci-mtk: relax TT periodic bandwidth allocation Currently xhci-mtk needs software-managed bandwidth allocation for periodic endpoints, it allocates the microframe index for the first start-split packet for each endpoint. As this index allocation logic should avoid the conflicts with other full/low-speed periodic endpoints, it uses the worst case byte budgets on high-speed bus bandwidth For example, for an isochronos IN endpoint with 192 bytes budget, it will consume the whole 4 u-frames(188 * 4) while the actual full-speed bus budget should be just 192bytes. This patch changes the low/full-speed bandwidth allocation logic to use "approximate" best case budget for lower speed bandwidth management. For the same endpoint from the above example, the approximate best case budget is now reduced to (188 * 2) bytes. Without this patch, many usb audio headsets with 3 interfaces (audio input, audio output, and HID) cannot be configured on xhci-mtk. Signed-off-by: Ikjoon Jang Link: https://lore.kernel.org/r/20210805133937.1.Ia8174b875bc926c12ce427a5a1415dea31cc35ae@changeid Signed-off-by: Greg Kroah-Hartman commit b8731209958a1dffccc2888121f4c0280c990550 Author: Ikjoon Jang Date: Thu Aug 5 13:37:47 2021 +0800 usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint xhci-mtk depends on xhci's internal virt_dev when it retrieves its internal data from usb_host_endpoint both in add_endpoint and drop_endpoint callbacks. But when setup packet was retired by transaction errors in xhci_setup_device() path, a virt_dev for the slot is newly created with real_port 0. This leads to xhci-mtks's NULL pointer dereference from drop_endpoint callback as xhci-mtk assumes that virt_dev's real_port is always started from one. The similar problems were addressed by [1] but that can't cover the failure cases from setup_device. This patch drops the usages of xhci's virt_dev in xhci-mtk's drop_endpoint callback by adopting rhashtable for searching mtk's schedule entity from a given usb_host_endpoint pointer instead of searching a linked list. So mtk's drop_endpoint callback doesn't have to rely on virt_dev at all. [1] https://lore.kernel.org/r/1617179142-2681-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Ikjoon Jang Link: https://lore.kernel.org/r/20210805133731.1.Icc0f080e75b1312692d4c7c7d25e7df9fe1a05c2@changeid Signed-off-by: Greg Kroah-Hartman commit af352460b465d7a8afbeb3be07c0268d1d48a4d7 Author: Paolo Abeni Date: Wed Aug 4 21:07:00 2021 +0200 net: fix GRO skb truesize update commit 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock reference") introduces a serious regression at the GRO layer setting the wrong truesize for stolen-head skbs. Restore the correct truesize: SKB_DATA_ALIGN(...) instead of SKB_TRUESIZE(...) Reported-by: Mat Martineau Fixes: 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock reference") Signed-off-by: Paolo Abeni Tested-by: Mat Martineau Signed-off-by: David S. Miller commit 177cd475e1f12d256c9bf7de274fef7bea30cddb Author: Biju Das Date: Tue Jul 27 19:55:26 2021 +0100 dt-bindings: usb: renesas,usbhs: Document RZ/G2L bindings Document RZ/G2L (R9A07G044L) SoC bindings. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210727185527.19907-6-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 9c0edd5649a26e380ed2e687a20f7b301a66c746 Author: Hu Haowen Date: Thu Aug 5 12:01:46 2021 +0800 docs: usb: fix malformed table The tables are separated with tabs and spaces mixed together, leading to malformation. Changed the characters all into spaces to solve this issue. Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20210805040146.121526-1-src.res@email.cn Signed-off-by: Greg Kroah-Hartman commit 59e477af7b1a2a0d1d4c934f9cfda7b753341f12 Author: Colin Ian King Date: Wed Aug 4 13:59:07 2021 +0100 usb: gadget: f_uac2: remove redundant assignments to pointer i_feature Pointer i_feature is being initialized with a value and then immediately re-assigned a new value in the next statement. Fix this by replacing the the redundant initialization with the following assigned value. Acked-by: Felipe Balbi Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20210804125907.111654-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit e21dd90eb86488fb2689c766311eb6fce98b2eb7 Author: Salah Triki Date: Tue Aug 3 01:53:43 2021 +0100 usb: misc: adutux: use swap() Use swap() in order to make code cleaner. Issue found by coccinelle. Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210803005343.GA1578854@pc Signed-off-by: Greg Kroah-Hartman commit 90059e9395cae00d79ecb1f7e1e702756416bc6a Author: Salah Triki Date: Sat Jul 31 18:18:38 2021 +0100 usb: gadget: remove useless cast Remove the cast done by ERR_PTR() and PTR_ERR() since data is of type char * and fss_prepare_buffer() should returns a value of this type. Acked-by: Felipe Balbi Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210731171838.GA912463@pc Signed-off-by: Greg Kroah-Hartman commit 9311a531064be7e136e13df672959c635463be9e Author: Wei Ming Chen Date: Sun Aug 1 13:54:54 2021 +0800 usb: gadget: Fix inconsistent indent Remove whitespace and use tab as indent Acked-by: Felipe Balbi Signed-off-by: Wei Ming Chen Link: https://lore.kernel.org/r/20210801055454.53015-1-jj251510319013@gmail.com Signed-off-by: Greg Kroah-Hartman commit 839454801e08b8ff6c8d97007d044a53fe96f7fa Merge: 1f52247ef840d afb08b7e220ef Author: David S. Miller Date: Thu Aug 5 11:27:05 2021 +0100 Merge branch 'ipa-runtime-pm' Alex Elder says: ==================== net: ipa: more work toward runtime PM The first two patches in this series are basically bug fixes, but in practice I don't think we've seen the problems they might cause. The third patch moves clock and interconnect related error messages around a bit, reporting better information and doing so in the functions where they are enabled or disabled (rather than those functions' callers). The last three patches move power-related code into "ipa_clock.c", as a step toward generalizing the purpose of that source file. ==================== Signed-off-by: David S. Miller commit afb08b7e220ef7278ffceb4f9e201c2a904e18a9 Author: Alex Elder Date: Wed Aug 4 10:36:26 2021 -0500 net: ipa: move IPA flags field The ipa->flags field is only ever used in "ipa_clock.c", related to suspend/resume activity. Move the definition of the ipa_flag enumerated type to "ipa_clock.c". And move the flags field from the ipa structure and to the ipa_clock structure. Rename the type and its values to include "power" or "POWER" in the name. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit afe1baa82db2b7345944b042a6c84757639a4283 Author: Alex Elder Date: Wed Aug 4 10:36:25 2021 -0500 net: ipa: move ipa_suspend_handler() Move ipa_suspend_handler() into "ipa_clock.c" from "ipa_main.c", to group with the reset of the suspend/resume code. This IPA interrupt is triggered if an IPA RX endpoint is suspended but has a packet to be delivered. Introduce ipa_power_setup() and ipa_power_teardown() to add and remove the handler for the IPA SUSPEND interrupt at the same place as before, while allowing the handler to remain private. The "power" naming convention will be adopted elsewhere in this file as well (soon). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 73ff316dac17accc05e28ae4939426044fb437ec Author: Alex Elder Date: Wed Aug 4 10:36:24 2021 -0500 net: ipa: move IPA power operations to ipa_clock.c Move ipa_suspend() and ipa_resume(), as well as the definition of the ipa_pm_ops structure into "ipa_clock.c". Make ipa_pm_ops public and declare it as extern in "ipa_clock.h". This is part of centralizing IPA power management functionality into "ipa_clock.c" (the file will eventually get a name change). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8ee7c40a25c70951c6e5db8e921fd08e4e038c6d Author: Alex Elder Date: Wed Aug 4 10:36:23 2021 -0500 net: ipa: improve IPA clock error messages Rearrange messages reported when errors occur in the IPA clock code, so that the specific interconnect is identified when an error occurs enabling or disabling it, or the core clock is indicated when an error occurs enabling it. Have ipa_interconnect_disable() return zero or the negative error value returned by the first interconnect that produced an error when disabled. For now, the callers ignore the returned value. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 10cc73c4b7feaa74abfbead404ae4eb28ba60310 Author: Alex Elder Date: Wed Aug 4 10:36:22 2021 -0500 net: ipa: reorder netdev pointer assignments Assign the ipa->modem_netdev and endpoint->netdev pointers *before* registering the network device. As soon as the device is registered it can be opened, and by that time we'll want those pointers valid. Similarly, don't make those pointers NULL until *after* the modem network device is unregistered in ipa_modem_stop(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 30c2515b89f1a6361170961e72bebd375f611b9b Author: Alex Elder Date: Wed Aug 4 10:36:21 2021 -0500 net: ipa: don't suspend/resume modem if not up The modem network device is set up by ipa_modem_start(). But its TX queue is not actually started and endpoints enabled until it is opened. So avoid stopping the modem network device TX queue and disabling endpoints on suspend or stop unless the netdev is marked UP. And skip attempting to resume unless it is UP. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 649839d7cf978f08377ba6486c46683d09a3e05d Author: Desmond Cheong Zhi Xi Date: Mon Aug 2 18:59:57 2021 +0800 drm: add lockdep assert to drm_is_current_master_locked In drm_is_current_master_locked, accessing drm_file.master should be protected by either drm_file.master_lookup_lock or drm_device.master_mutex. This was previously awkward to assert with lockdep. Following patch ("locking/lockdep: Provide lockdep_assert{,_once}() helpers"), this assertion is now convenient. So we add in the assertion and explain this lock design in the kerneldoc. Signed-off-by: Desmond Cheong Zhi Xi Acked-by: Boqun Feng Acked-by: Waiman Long Acked-by: Peter Zijlstra (Intel) Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210802105957.77692-3-desmondcheongzx@gmail.com commit d19c81378829e5d774c951219c5a973965b9202c Author: Peter Zijlstra Date: Mon Aug 2 18:59:56 2021 +0800 locking/lockdep: Provide lockdep_assert{,_once}() helpers Extract lockdep_assert{,_once}() helpers to more easily write composite assertions like, for example: lockdep_assert(lockdep_is_held(&drm_device.master_mutex) || lockdep_is_held(&drm_file.master_lookup_lock)); Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Desmond Cheong Zhi Xi Acked-by: Boqun Feng Acked-by: Waiman Long Acked-by: Peter Zijlstra (Intel) Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210802105957.77692-2-desmondcheongzx@gmail.com commit 1f52247ef840db6ddd727fb1bd1c38b7153120c3 Merge: 0fd75f5760b6a 81d45898a59a5 Author: David S. Miller Date: Thu Aug 5 11:05:48 2021 +0100 Merge branch 'sja1105-H' Vladimir Oltean says: ==================== NXP SJA1105 driver support for "H" switch topologies Changes in v3: Preserve the behavior of dsa_tree_setup_default_cpu() which is to pick the first CPU port and not the last. Changes in v2: Send as non-RFC, drop the patches for discarding DSA-tagged packets on user ports and DSA-untagged packets on DSA and CPU ports for now. NXP builds boards like the Bluebox 3 where there are multiple SJA1110 switches connected to an LX2160A, but they are also connected to each other. I call this topology an "H" tree because of the lateral connection between switches. A piece extracted from a non-upstream device tree looks like this: &spi_bridge { /* SW1 */ ethernet-switch@0 { compatible = "nxp,sja1110a"; reg = <0>; dsa,member = <0 0>; ethernet-ports { #address-cells = <1>; #size-cells = <0>; /* SW1_P1 */ port@1 { reg = <1>; label = "con_2x20"; phy-mode = "sgmii"; fixed-link { speed = <1000>; full-duplex; }; }; port@2 { reg = <2>; ethernet = <&dpmac17>; phy-mode = "rgmii-id"; fixed-link { speed = <1000>; full-duplex; }; }; port@3 { reg = <3>; label = "1ge_p1"; phy-mode = "rgmii-id"; phy-handle = <&sw1_mii3_phy>; }; sw1p4: port@4 { reg = <4>; link = <&sw2p1>; phy-mode = "sgmii"; fixed-link { speed = <1000>; full-duplex; }; }; port@5 { reg = <5>; label = "trx1"; phy-mode = "internal"; phy-handle = <&sw1_port5_base_t1_phy>; }; port@6 { reg = <6>; label = "trx2"; phy-mode = "internal"; phy-handle = <&sw1_port6_base_t1_phy>; }; port@7 { reg = <7>; label = "trx3"; phy-mode = "internal"; phy-handle = <&sw1_port7_base_t1_phy>; }; port@8 { reg = <8>; label = "trx4"; phy-mode = "internal"; phy-handle = <&sw1_port8_base_t1_phy>; }; port@9 { reg = <9>; label = "trx5"; phy-mode = "internal"; phy-handle = <&sw1_port9_base_t1_phy>; }; port@a { reg = <10>; label = "trx6"; phy-mode = "internal"; phy-handle = <&sw1_port10_base_t1_phy>; }; }; }; /* SW2 */ ethernet-switch@2 { compatible = "nxp,sja1110a"; reg = <2>; dsa,member = <0 1>; ethernet-ports { #address-cells = <1>; #size-cells = <0>; sw2p1: port@1 { reg = <1>; link = <&sw1p4>; phy-mode = "sgmii"; fixed-link { speed = <1000>; full-duplex; }; }; port@2 { reg = <2>; ethernet = <&dpmac18>; phy-mode = "rgmii-id"; fixed-link { speed = <1000>; full-duplex; }; }; port@3 { reg = <3>; label = "1ge_p2"; phy-mode = "rgmii-id"; phy-handle = <&sw2_mii3_phy>; }; port@4 { reg = <4>; label = "to_sw3"; phy-mode = "2500base-x"; fixed-link { speed = <2500>; full-duplex; }; }; port@5 { reg = <5>; label = "trx7"; phy-mode = "internal"; phy-handle = <&sw2_port5_base_t1_phy>; }; port@6 { reg = <6>; label = "trx8"; phy-mode = "internal"; phy-handle = <&sw2_port6_base_t1_phy>; }; port@7 { reg = <7>; label = "trx9"; phy-mode = "internal"; phy-handle = <&sw2_port7_base_t1_phy>; }; port@8 { reg = <8>; label = "trx10"; phy-mode = "internal"; phy-handle = <&sw2_port8_base_t1_phy>; }; port@9 { reg = <9>; label = "trx11"; phy-mode = "internal"; phy-handle = <&sw2_port9_base_t1_phy>; }; port@a { reg = <10>; label = "trx12"; phy-mode = "internal"; phy-handle = <&sw2_port10_base_t1_phy>; }; }; }; }; Basically it is a single DSA tree with 2 "ethernet" properties, i.e. a multi-CPU-port system. There is also a DSA link between the switches, but it is not a daisy chain topology, i.e. there is no "upstream" and "downstream" switch, the DSA link is only to be used for the bridge data plane (autonomous forwarding between switches, between the RJ-45 ports and the automotive Ethernet ports), otherwise all traffic that should reach the host should do so through the dedicated CPU port of the switch. Of course, plain forwarding in this topology is bound to create packet loops. I have thought long and hard about strategies to cut forwarding in such a way as to prevent loops but also not impede normal operation of the network on such a system, and I believe I have found a solution that does work as expected. This relies heavily on DSA's recent ability to perform RX filtering towards the host by installing MAC addresses as static FDB entries. Since we have 2 distinct DSA masters, we have 2 distinct MAC addresses, and if the bridge is configured to have its own MAC address that makes it 3 distinct MAC addresses. The bridge core, plus the switchdev_handle_fdb_add_to_device() extension, handle each MAC address by replicating it to each port of the DSA switch tree. So the end result is that both switch 1 and switch 2 will have static FDB entries towards their respective CPU ports for the 3 MAC addresses corresponding to the DSA masters and to the bridge net device (and of course, towards any station learned on a foreign interface). So I think the basic design works, and it is basically just as fragile as any other multi-CPU-port system is bound to be in terms of reliance on static FDB entries towards the host (if hardware address learning on the CPU port is to be used, MAC addresses would randomly bounce between one CPU port and the other otherwise). In fact, I think it is even better to start DSA's support of multi-CPU-port systems with something small like the NXP Bluebox 3, because we allow some time for the code paths like dsa_switch_host_address_match(), which were specifically designed for it, to break in, and this board needs no user space configuration of CPU ports, like static assignments between user and CPU ports, or bonding between the CPU ports/DSA masters. ==================== Signed-off-by: David S. Miller commit 81d45898a59a5fb443406603b126a4d1856a1007 Author: Vladimir Oltean Date: Wed Aug 4 16:54:36 2021 +0300 net: dsa: sja1105: enable address learning on cascade ports Right now, address learning is disabled on DSA ports, which means that a packet received over a DSA port from a cross-chip switch will be flooded to unrelated ports. It is desirable to eliminate that, but for that we need a breakdown of the possibilities for the sja1105 driver. A DSA port can be: - a downstream-facing cascade port. This is simple because it will always receive packets from a downstream switch, and there should be no other route to reach that downstream switch in the first place, which means it should be safe to learn that MAC address towards that switch. - an upstream-facing cascade port. This receives packets either: * autonomously forwarded by an upstream switch (and therefore these packets belong to the data plane of a bridge, so address learning should be ok), or * injected from the CPU. This deserves further discussion, as normally, an upstream-facing cascade port is no different than the CPU port itself. But with "H" topologies (a DSA link towards a switch that has its own CPU port), these are more "laterally-facing" cascade ports than they are "upstream-facing". Here, there is a risk that the port might learn the host addresses on the wrong port (on the DSA port instead of on its own CPU port), but this is solved by DSA's RX filtering infrastructure, which installs the host addresses as static FDB entries on the CPU port of all switches in a "H" tree. So even if there will be an attempt from the switch to migrate the FDB entry from the CPU port to the laterally-facing cascade port, it will fail to do that, because the FDB entry that already exists is static and cannot migrate. So address learning should be safe for this configuration too. Ok, so what about other MAC addresses coming from the host, not necessarily the bridge local FDB entries? What about MAC addresses dynamically learned on foreign interfaces, isn't there a risk that cascade ports will learn these entries dynamically when they are supposed to be delivered towards the CPU port? Well, that is correct, and this is why we also need to enable the assisted learning feature, to snoop for these addresses and write them to hardware as static FDB entries towards the CPU, to make the switch's learning process on the cascade ports ineffective for them. With assisted learning enabled, the hardware learning on the CPU port must be disabled. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0f9b762c097c1816bba072fb44b9018a41e2e65b Author: Vladimir Oltean Date: Wed Aug 4 16:54:35 2021 +0300 net: dsa: sja1105: suppress TX packets from looping back in "H" topologies H topologies like this one have a problem: eth0 eth1 | | CPU port CPU port | DSA link | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 -------- sw1p4 sw1p3 sw1p2 sw1p1 sw1p0 | | | | | | user user user user user user port port port port port port Basically any packet sent by the eth0 DSA master can be flooded on the interconnecting DSA link sw0p4 <-> sw1p4 and it will be received by the eth1 DSA master too. Basically we are talking to ourselves. In VLAN-unaware mode, these packets are encoded using a tag_8021q TX VLAN, which dsa_8021q_rcv() rightfully cannot decode and complains. Whereas in VLAN-aware mode, the packets are encoded with a bridge VLAN which _can_ be decoded by the tagger running on eth1, so it will attempt to reinject that packet into the network stack (the bridge, if there is any port under eth1 that is under a bridge). In the case where the ports under eth1 are under the same cross-chip bridge as the ports under eth0, the TX packets will even be learned as RX packets. The only thing that will prevent loops with the software bridging path, and therefore disaster, is that the source port and the destination port are in the same hardware domain, and the bridge will receive packets from the driver with skb->offload_fwd_mark = true and will not forward between the two. The proper solution to this problem is to detect H topologies and enforce that all packets are received through the local switch and we do not attempt to receive packets on our CPU port from switches that have their own. This is a viable solution which works thanks to the fact that MAC addresses which should be filtered towards the host are installed by DSA as static MAC addresses towards the CPU port of each switch. TX from a CPU port towards the DSA port continues to be allowed, this is because sja1105 supports bridge TX forwarding offload, and the skb->dev used initially for xmit does not have any direct correlation with where the station that will respond to that packet is connected. It may very well happen that when we send a ping through a br0 interface that spans all switch ports, the xmit packet will exit the system through a DSA switch interface under eth1 (say sw1p2), but the destination station is connected to a switch port under eth0, like sw0p0. So the switch under eth1 needs to communicate on TX with the switch under eth0. The response, however, will not follow the same path, but instead, this patch enforces that the response is sent by the first switch directly to its DSA master which is eth0. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 777e55e30d1275e0ddd70efdbcd8cf6f4dae554e Author: Vladimir Oltean Date: Wed Aug 4 16:54:34 2021 +0300 net: dsa: sja1105: increase MTU to account for VLAN header on DSA ports Since all packets are transmitted as VLAN-tagged over a DSA link (this VLAN tag represents the tag_8021q header), we need to increase the MTU of these interfaces to account for the possibility that we are already transporting a user-visible VLAN header. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c513002980838af4d65551497f63e403d961ea36 Author: Vladimir Oltean Date: Wed Aug 4 16:54:33 2021 +0300 net: dsa: sja1105: manage VLANs on cascade ports Since commit ed040abca4c1 ("net: dsa: sja1105: use 4095 as the private VLAN for untagged traffic"), this driver uses a reserved value as pvid for the host port (DSA CPU port). Control packets which are sent as untagged get classified to this VLAN, and all ports are members of it (this is to be expected for control packets). Manage all cascade ports in the same way and allow control packets to egress everywhere. Also, all VLANs need to be sent as egress-tagged on all cascade ports. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3fa212707b8e6026cea6a92faea87f556e0cba9b Author: Vladimir Oltean Date: Wed Aug 4 16:54:32 2021 +0300 net: dsa: sja1105: manage the forwarding domain towards DSA ports Manage DSA links towards other switches, be they host ports or cascade ports, the same as the CPU port, i.e. allow forwarding and flooding unconditionally from all user ports. We send packets as always VLAN-tagged on a DSA port, and we rely on the cross-chip notifiers from tag_8021q to install the RX VLAN of a switch port only on the proper remote ports of another switch (the ports that are in the same bridging domain). So if there is no cross-chip bridging in the system, the flooded packets will be sent on the DSA ports too, but they will be dropped by the remote switches due to either (a) a lack of the RX VLAN in the VLAN table of the ingress DSA port, or (b) a lack of valid destinations for those packets, due to a lack of the RX VLAN on the user ports of the switch Note that switches which only transport packets in a cross-chip bridge, but have no user ports of their own as part of that bridge, such as switch 1 in this case: DSA link DSA link sw0p0 sw0p1 sw0p2 -------- sw1p0 sw1p2 sw1p3 -------- sw2p0 sw2p2 sw2p3 ip link set sw0p0 master br0 ip link set sw2p3 master br0 will still work, because the tag_8021q cross-chip notifiers keep the RX VLANs installed on all DSA ports. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 30a100e60cf36ade9902dc71610f93563d0bd7b0 Author: Vladimir Oltean Date: Wed Aug 4 16:54:31 2021 +0300 net: dsa: sja1105: configure the cascade ports based on topology The sja1105 switch family has a feature called "cascade ports" which can be used in topologies where multiple SJA1105/SJA1110 switches are daisy chained. Upstream switches set this bit for the DSA link towards the downstream switches. This is used when the upstream switch receives a control packet (PTP, STP) from a downstream switch, because if the source port for a control packet is marked as a cascade port, then the source port, switch ID and RX timestamp will not be taken again on the upstream switch, it is assumed that this has already been done by the downstream switch (the leaf port in the tree) and that the CPU has everything it needs to decode the information from this packet. We need to distinguish between an upstream-facing DSA link and a downstream-facing DSA link, because the upstream-facing DSA links are "host ports" for the SJA1105/SJA1110 switches, and the downstream-facing DSA links are "cascade ports". Note that SJA1105 supports a single cascade port, so only daisy chain topologies work. With SJA1110, there can be more complex topologies such as: eth0 | host port | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 | | | | cascade cascade user user port port port port | | | | | | | host | port | | | sw1p0 sw1p1 sw1p2 sw1p3 sw1p4 | | | | | | user user user user host port port port port port | sw2p0 sw2p1 sw2p2 sw2p3 sw2p4 | | | | user user user user port port port port Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2c0b03258b8bda0ef6339229d18fbb2594317dbe Author: Vladimir Oltean Date: Wed Aug 4 16:54:30 2021 +0300 net: dsa: give preference to local CPU ports Be there an "H" switch topology, where there are 2 switches connected as follows: eth0 eth1 | | CPU port CPU port | DSA link | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 -------- sw1p4 sw1p3 sw1p2 sw1p1 sw1p0 | | | | | | user user user user user user port port port port port port basically one where each switch has its own CPU port for termination, but there is also a DSA link in case packets need to be forwarded in hardware between one switch and another. DSA insists to see this as a daisy chain topology, basically registering all network interfaces as sw0p0@eth0, ... sw1p0@eth0 and disregarding eth1 as a valid DSA master. This is only half the story, since when asked using dsa_port_is_cpu(), DSA will respond that sw1p1 is a CPU port, however one which has no dp->cpu_dp pointing to it. So sw1p1 is enabled, but not used. Furthermore, be there a driver for switches which support only one upstream port. This driver iterates through its ports and checks using dsa_is_upstream_port() whether the current port is an upstream one. For switch 1, two ports pass the "is upstream port" checks: - sw1p4 is an upstream port because it is a routing port towards the dedicated CPU port assigned using dsa_tree_setup_default_cpu() - sw1p1 is also an upstream port because it is a CPU port, albeit one that is disabled. This is because dsa_upstream_port() returns: if (!cpu_dp) return port; which means that if @dp does not have a ->cpu_dp pointer (which is a characteristic of CPU ports themselves as well as unused ports), then @dp is its own upstream port. So the driver for switch 1 rightfully says: I have two upstream ports, but I don't support multiple upstream ports! So let me error out, I don't know which one to choose and what to do with the other one. Generally I am against enforcing any default policy in the kernel in terms of user to CPU port assignment (like round robin or such) but this case is different. To solve the conundrum, one would have to: - Disable sw1p1 in the device tree or mark it as "not a CPU port" in order to comply with DSA's view of this topology as a daisy chain, where the termination traffic from switch 1 must pass through switch 0. This is counter-productive because it wastes 1Gbps of termination throughput in switch 1. - Disable the DSA link between sw0p4 and sw1p4 and do software forwarding between switch 0 and 1, and basically treat the switches as part of disjoint switch trees. This is counter-productive because it wastes 1Gbps of autonomous forwarding throughput between switch 0 and 1. - Treat sw0p4 and sw1p4 as user ports instead of DSA links. This could work, but it makes cross-chip bridging impossible. In this setup we would need to have 2 separate bridges, br0 spanning the ports of switch 0, and br1 spanning the ports of switch 1, and the "DSA links treated as user ports" sw0p4 (part of br0) and sw1p4 (part of br1) are the gateway ports between one bridge and another. This is hard to manage from a user's perspective, who wants to have a unified view of the switching fabric and the ability to transparently add ports to the same bridge. VLANs would also need to be explicitly managed by the user on these gateway ports. So it seems that the only reasonable thing to do is to make DSA prefer CPU ports that are local to the switch. Meaning that by default, the user and DSA ports of switch 0 will get assigned to the CPU port from switch 0 (sw0p1) and the user and DSA ports of switch 1 will get assigned to the CPU port from switch 1. The way this solves the problem is that sw1p4 is no longer an upstream port as far as switch 1 is concerned (it no longer views sw0p1 as its dedicated CPU port). So here we are, the first multi-CPU port that DSA supports is also perhaps the most uneventful one: the individual switches don't support multiple CPUs, however the DSA switch tree as a whole does have multiple CPU ports. No user space assignment of user ports to CPU ports is desirable, necessary, or possible. Ports that do not have a local CPU port (say there was an extra switch hanging off of sw0p0) default to the standard implementation of getting assigned to the first CPU port of the DSA switch tree. Is that good enough? Probably not (if the downstream switch was hanging off of switch 1, we would most certainly prefer its CPU port to be sw1p1), but in order to support that use case too, we would need to traverse the dst->rtable in search of an optimum dedicated CPU port, one that has the smallest number of hops between dp->ds and dp->cpu_dp->ds. At the moment, the DSA routing table structure does not keep the number of hops between dl->dp and dl->link_dp, and while it is probably deducible, there is zero justification to write that code now. Let's hope DSA will never have to support that use case. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0e8eb9a16e2569ff72f9d2f43d665e15d52bfa2e Author: Vladimir Oltean Date: Wed Aug 4 16:54:29 2021 +0300 net: dsa: rename teardown_default_cpu to teardown_cpu_ports There is nothing specific to having a default CPU port to what dsa_tree_teardown_default_cpu() does. Even with multiple CPU ports, it would do the same thing: iterate through the ports of this switch tree and reset the ->cpu_dp pointer to NULL. So rename it accordingly. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 224d8031e482bb83e2166779f46c7bb1a5f4a888 Author: Shunyong Yang Date: Wed Jul 14 21:23:31 2021 +0800 tools: PCI: Zero-initialize param The values in param may be random if they are not initialized, which may cause use_dma flag set even when "-d" option is not provided in command line. Initializing all members to 0 to solve this. Link: https://lore.kernel.org/r/20210714132331.5200-1-yang.shunyong@gmail.com Signed-off-by: Shunyong Yang Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 0fd75f5760b6a7a7f35dff46a6cdc4f6d1a86ee8 Author: Alex Elder Date: Wed Aug 4 08:54:07 2021 -0500 net: ipa: fix IPA v4.9 interconnects Three interconnects are defined for IPA version 4.9, but there should only be two. They should also use names that match what's used for other platforms (and specified in the Device Tree binding). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit df7ba0eb25edded52b1b3f6bb6ab0c0048a7e0bb Author: Colin Ian King Date: Wed Aug 4 13:15:30 2021 +0100 mctp: remove duplicated assignment of pointer hdr The pointer hdr is being initialized and also re-assigned with the same value from the call to function mctp_hdr. Static analysis reports that the initializated value is unused. The second assignment is duplicated and can be removed. Addresses-Coverity: ("Unused value"). Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 43f5c77bcbd27cce70bf33c2b86d6726ce95dd66 Author: Pali Rohár Date: Thu Jul 22 16:40:41 2021 +0200 PCI: aardvark: Fix reporting CRS value Set CRSVIS flag in emulated root PCI bridge to indicate support for Completion Retry Status. Add check for CRSSVE flag from root PCI brige when issuing Configuration Read Request via PIO to correctly returns fabricated CRS value as it is required by PCIe spec. Link: https://lore.kernel.org/r/20210722144041.12661-5-pali@kernel.org Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org # e0d9d30b7354 ("PCI: pci-bridge-emul: Fix big-endian support") commit e902bb7c24a7099d0eb0eb4cba06f2d91e9299f3 Author: Pali Rohár Date: Thu Jul 22 16:40:40 2021 +0200 PCI: pci-bridge-emul: Add PCIe Root Capabilities Register The 16-bit Root Capabilities register is at offset 0x1e in the PCIe Capability. Rename current 'rsvd' struct member to 'rootcap'. Link: https://lore.kernel.org/r/20210722144041.12661-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Behún commit 02bcec3ea5591720114f586960490b04b093a09e Author: Pali Rohár Date: Thu Jul 22 16:40:39 2021 +0200 PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response Measurements in different conditions showed that aardvark hardware PIO response can take up to 1.44s. Increase wait timeout from 1ms to 1.5s to ensure that we do not miss responses from hardware. After 1.44s hardware returns errors (e.g. Completer abort). The previous two patches fixed checking for PIO status, so now we can use it to also catch errors which are reported by hardware after 1.44s. After applying this patch, kernel can detect and print PIO errors to dmesg: [ 6.879999] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100004 [ 6.896436] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100004 [ 6.913049] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100010 [ 6.929663] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100010 [ 6.953558] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100014 [ 6.970170] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100014 [ 6.994328] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100004 Without this patch kernel prints only a generic error to dmesg: [ 5.246847] advk-pcie d0070000.pcie: config read/write timed out Link: https://lore.kernel.org/r/20210722144041.12661-3-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Behún Cc: stable@vger.kernel.org # 7fbcb5da811b ("PCI: aardvark: Don't rely on jiffies while holding spinlock") commit fcb461e2bc8b83b7eaca20cb2221e8b940f2189c Author: Evan Wang Date: Thu Jul 22 16:40:38 2021 +0200 PCI: aardvark: Fix checking for PIO status There is an issue that when PCIe switch is connected to an Armada 3700 board, there will be lots of warnings about PIO errors when reading the config space. According to Aardvark PIO read and write sequence in HW specification, the current way to check PIO status has the following issues: 1) For PIO read operation, it reports the error message, which should be avoided according to HW specification. 2) For PIO read and write operations, it only checks PIO operation complete status, which is not enough, and error status should also be checked. This patch aligns the code with Aardvark PIO read and write sequence in HW specification on PIO status check and fix the warnings when reading config space. [pali: Fix CRS handling when CRSSVE is not enabled] Link: https://lore.kernel.org/r/20210722144041.12661-2-pali@kernel.org Tested-by: Victor Gu Signed-off-by: Evan Wang Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Victor Gu Reviewed-by: Marek Behún Cc: stable@vger.kernel.org # b1bd5714472c ("PCI: aardvark: Indicate error in 'val' when config read fails") commit b65a9489730a2494f7a2a33a6eb0a12b8f1dd193 Author: Chris Wilson Date: Fri Jul 23 12:34:05 2021 +0100 drm/i915/userptr: Probe existence of backing struct pages upon creation Jason Ekstrand requested a more efficient method than userptr+set-domain to determine if the userptr object was backed by a complete set of pages upon creation. To be more efficient than simply populating the userptr using get_user_pages() (as done by the call to set-domain or execbuf), we can walk the tree of vm_area_struct and check for gaps or vma not backed by struct page (VM_PFNMAP). The question is how to handle VM_MIXEDMAP which may be either struct page or pfn backed... With discrete we are going to drop support for set_domain(), so offering a way to probe the pages, without having to resort to dummy batches has been requested. v2: - add new query param for the PROBE flag, so userspace can easily check if the kernel supports it(Jason). - use mmap_read_{lock, unlock}. - add some kernel-doc. v3: - In the docs also mention that PROBE doesn't guarantee that the pages will remain valid by the time they are actually used(Tvrtko). - Add a small comment for the hole finding logic(Jason). - Move the param next to all the other params which just return true. Testcase: igt/gem_userptr_blits/probe Signed-off-by: Chris Wilson Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Tvrtko Ursulin Acked-by: Kenneth Graunke Reviewed-by: Jason Ekstrand Acked-by: Maarten Lankhorst Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210723113405.427004-1-matthew.auld@intel.com commit 46abe13b5e3db187e52cd0de06c07bbce010726c Author: Igor Skalkin Date: Tue Aug 3 14:10:24 2021 +0100 firmware: arm_scmi: Add virtio transport This transport enables communications with an SCMI platform through virtio; the SCMI platform will be represented by a virtio device. Implement an SCMI virtio driver according to the virtio SCMI device spec [1]. Virtio device id 32 has been reserved for the SCMI device [2]. The virtio transport has one Tx channel (virtio cmdq, A2P channel) and at most one Rx channel (virtio eventq, P2A channel). The following feature bit defined in [1] is not implemented: VIRTIO_SCMI_F_SHARED_MEMORY. The number of messages which can be pending simultaneously is restricted according to the virtqueue capacity negotiated at probing time. As soon as Rx channel message buffers are allocated or have been read out by the arm-scmi driver, feed them back to the virtio device. Since some virtio devices may not have the short response time exhibited by SCMI platforms using other transports, set a generous response timeout. SCMI polling mode is not supported by this virtio transport since deemed meaningless: polling mode operation is offered by the SCMI core to those transports that could not provide a completion interrupt on the TX path, which is never the case for virtio whose core callbacks can easily call into core scmi_rx_callback upon messages reception. [1] https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-scmi.tex [2] https://www.oasis-open.org/committees/ballot.php?id=3496 Link: https://lore.kernel.org/r/20210803131024.40280-16-cristian.marussi@arm.com Cc: "Michael S. Tsirkin" Cc: Jason Wang Co-developed-by: Peter Hilber Co-developed-by: Cristian Marussi Signed-off-by: Igor Skalkin [ Peter: Adapted patch for submission to upstream. ] Signed-off-by: Peter Hilber [ Cristian: simplified driver logic, changed link_supplier and channel available/setup logic, removed dummy callbacks ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 13fba878ccdd15b1c2fdce424995744dc40eaf16 Author: Cristian Marussi Date: Tue Aug 3 14:10:23 2021 +0100 firmware: arm_scmi: Add priv parameter to scmi_rx_callback Add a new opaque void *priv parameter to scmi_rx_callback which can be optionally provided by the transport layer when invoking scmi_rx_callback and that will be passed back to the transport layer in xfer->priv. This can be used by transports that needs to keep track of their specific data structures together with the valid xfers. Link: https://lore.kernel.org/r/20210803131024.40280-15-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 60625667c439e6e1945d464b6eb296d144c5cb2a Author: Igor Skalkin Date: Tue Aug 3 14:10:22 2021 +0100 dt-bindings: arm: Add virtio transport for SCMI Document the properties for arm,scmi-virtio compatible nodes. The backing virtio SCMI device is described in patch [1]. While doing that, make shmem property required only for pre-existing mailbox and smc transports, since virtio-scmi does not need it. [1] https://lists.oasis-open.org/archives/virtio-comment/202102/msg00018.html Link: https://lore.kernel.org/r/20210803131024.40280-14-cristian.marussi@arm.com Co-developed-by: Peter Hilber Reviewed-by: Rob Herring Signed-off-by: Igor Skalkin [ Peter: Adapted patch for submission to upstream. ] Signed-off-by: Peter Hilber [ Cristian: converted to yaml format, moved shmen required property. ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7885281260f9b952dc66b67182a2218b01e7859f Author: Peter Hilber Date: Tue Aug 3 14:10:21 2021 +0100 firmware: arm_scmi: Add optional link_supplier() transport op Some transports are also effectively registered with other kernel subsystem in order to be properly probed and initialized; as a consequence such kind of transports, and their related devices, might still not have been probed and initialized at the time the main SCMI core driver is probed. Add an optional .link_supplier() transport operation which can be used by the core SCMI stack to dynamically check if the transport is ready and dynamically link its device to the SCMI platform instance device. Link: https://lore.kernel.org/r/20210803131024.40280-13-cristian.marussi@arm.com Signed-off-by: Peter Hilber [ Cristian: reworded commit message ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit f301bba0ca7392d16a6ea4f1d264a91f1fadea1a Author: Peter Hilber Date: Tue Aug 3 14:10:20 2021 +0100 firmware: arm_scmi: Add message passing abstractions for transports Add abstractions for future transports using message passing, such as virtio. Derive the abstractions from the shared memory abstractions. Abstract the transport SDU through the opaque struct scmi_msg_payld. Also enable the transport to determine all other required information about the transport SDU. Link: https://lore.kernel.org/r/20210803131024.40280-12-cristian.marussi@arm.com Signed-off-by: Peter Hilber [ Cristian: Adapted to new SCMI Kconfig layout, updated Copyrights ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit c92c3e382ebd2382b26a41e312a266a40c4fb05c Author: Igor Skalkin Date: Tue Aug 3 14:10:19 2021 +0100 firmware: arm_scmi: Add method to override max message number The maximum number of simultaneously pending messages is a transport specific quantity that is usually described statically in struct scmi_desc. Some transports, though, can calculate such number only at run-time after some initial transport specific setup and probing is completed; moreover the resulting max message numbers could also be different between rx and tx channels. Add an optional get_max_msg() operation so that a transport can report more accurate max message numbers for each channel type. The value in scmi_desc.max_msg is still used as default when transport does not provide any get_max_msg() method. Link: https://lore.kernel.org/r/20210803131024.40280-11-cristian.marussi@arm.com Co-developed-by: Peter Hilber Co-developed-by: Cristian Marussi Signed-off-by: Igor Skalkin [ Peter: Adapted patch for submission to upstream. ] Signed-off-by: Peter Hilber [ Cristian: refactored how get_max_msg() is used to minimize core changes ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit a7b1138b921dc19f859296b2eb3daa7c5e22c354 Author: Igor Skalkin Date: Tue Aug 3 14:10:18 2021 +0100 firmware: arm_scmi: Make shmem support optional for transports Upcoming new SCMI transports won't need any kind of shared memory support. Compile shmem.c only if a shmem based transport is selected. Link: https://lore.kernel.org/r/20210803131024.40280-10-cristian.marussi@arm.com Co-developed-by: Peter Hilber Signed-off-by: Igor Skalkin [ Peter: Adapted patch for submission to upstream. ] Signed-off-by: Peter Hilber [ Cristian: Adapted patch/commit_msg to new SCMI Kconfig layout ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit e8419c24bacee45bfe3504814e91fc89ff8c23de Author: Cristian Marussi Date: Tue Aug 3 14:10:17 2021 +0100 firmware: arm_scmi: Make SCMI transports configurable Add configuration options to be able to select which SCMI transports have to be compiled into the SCMI stack. Mailbox and SMC are by default enabled if their related dependencies are satisfied. While doing that move all SCMI related config options in their own dedicated submenu. Link: https://lore.kernel.org/r/20210803131024.40280-9-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 2930abcffd9f0b36e8fd4df01f6311eede686817 Author: Cristian Marussi Date: Tue Aug 3 14:10:16 2021 +0100 firmware: arm_scmi: Make polling mode optional Add a check for the presence of .poll_done transport operation so that transports that do not need to support polling mode have no need to provide a dummy .poll_done callback either and polling mode can be disabled in the SCMI core for that tranport. Link: https://lore.kernel.org/r/20210803131024.40280-8-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit e9b21c96181c36343597ce789e386d296f93a23b Author: Cristian Marussi Date: Tue Aug 3 14:10:15 2021 +0100 firmware: arm_scmi: Make .clear_channel optional Make transport operation .clear_channel optional since some transports do not need it and so avoid to have them implement dummy callbacks. Link: https://lore.kernel.org/r/20210803131024.40280-7-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit ed7c04c1fea3b027c1b2efcf57b50c98ef05840b Author: Cristian Marussi Date: Tue Aug 3 14:10:14 2021 +0100 firmware: arm_scmi: Handle concurrent and out-of-order messages Even though in case of asynchronous commands an SCMI platform is constrained to emit the delayed response message only after the related message response has been sent, the configured underlying transport could still deliver such messages together or in inverted order, causing races due to the concurrent or out-of-order access to the underlying xfer. Introduce a mechanism to grant exclusive access to an xfer in order to properly serialize concurrent accesses to the same xfer originating from multiple correlated messages. Add additional state information to xfer descriptors so as to be able to identify out-of-order message deliveries and act accordingly: - when a delayed response is expected but delivered before the related response, the synchronous response is considered as successfully received and the delayed response processing is carried on as usual. - when/if the missing synchronous response is subsequently received, it is discarded as not congruent with the current state of the xfer, or simply, because the xfer has been already released and so, now, the monotonically increasing sequence number carried by the late response is stale. Link: https://lore.kernel.org/r/20210803131024.40280-6-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 9ca5a1838e593d96d5d1727eed150ed4f7c179e2 Author: Cristian Marussi Date: Tue Aug 3 14:10:13 2021 +0100 firmware: arm_scmi: Introduce monotonically increasing tokens Tokens are sequence numbers embedded in the each SCMI message header: they are used to correlate commands with responses (and delayed responses), but their usage and policy of selection is entirely up to the caller (usually the OSPM agent), while they are completely opaque to the callee (i.e. SCMI platform) which merely copies them back from the command into the response message header. This also means that the platform does not, can not and should not enforce any kind of policy on received messages depending on the contained sequence number: platform can perfectly handle concurrent requests carrying the same identifiying token if that should happen. Moreover the platform is not required to produce in-order responses to agent requests, the only constraint in these regards is that in case of an asynchronous message the delayed response must be sent after the immediate response for the synchronous part of the command transaction. Currenly the SCMI stack of the OSPM agent selects a token for the egressing commands picking the lowest possible number which is not already in use by an existing in-flight transaction, which means, in other words, that we immediately reuse any token after its transaction has completed or it has timed out: this policy indeed does simplify management and lookup of tokens and associated xfers. Under the above assumptions and constraints, since there is really no state shared between the agent and the platform to let the platform know when a token and its associated message has timed out, the current policy of early reuse of tokens can easily lead to the situation in which a spurious or late received response (or delayed_response), related to an old stale and timed out transaction, can be wrongly associated to a newer valid in-flight xfer that just happens to have reused the same token. This misbehaviour on such late/spurious responses is more easily exposed on those transports that naturally have an higher level of parallelism in processing multiple concurrent in-flight messages. This commit introduces a new policy of selection of tokens for the OSPM agent: each new command transfer now gets the next available, monotonically increasing token, until tokens are exhausted and the counter rolls over. Such new policy mitigates the above issues with late/spurious responses since the tokens are now reused as late as possible (when they roll back ideally) and so it is much easier to identify such late/spurious responses to stale timed out transactions: this also helps in simplifying the specific transports implementation since stale transport messages can be easily identified and discarded early on in the rx path without the need to cross check their actual state with the core transport layer. This mitigation is even more effective when, as is usually the case, the maximum number of pending messages is capped by the platform to a much lower number than the whole possible range of tokens values (2^10). This internal policy change in the core SCMI transport layer is fully transparent to the specific transports so it has not and should not have any impact on the transports implementation. Link: https://lore.kernel.org/r/20210803131024.40280-5-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit ceac257db055b8d13aef6fa83e9f2b6733c23532 Author: Cristian Marussi Date: Tue Aug 3 14:10:12 2021 +0100 firmware: arm_scmi: Add optional transport_init/exit support Some SCMI transport could need to perform some transport specific setup before they can be used by the SCMI core transport layer: typically this early setup consists in registering with some other kernel subsystem. Add the optional capability for a transport to provide a couple of init and exit functions that are assured to be called early during the SCMI core initialization phase, well before the SCMI core probing step. [ Peter: Adapted RFC patch by Cristian for submission to upstream. ] Link: https://lore.kernel.org/r/20210803131024.40280-4-cristian.marussi@arm.com Signed-off-by: Peter Hilber [ Cristian: Fixed scmi_transports_exit point of invocation ] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 3669032514be157d48acc4aa01728815d035d0c3 Author: Cristian Marussi Date: Tue Aug 3 14:10:11 2021 +0100 firmware: arm_scmi: Remove scmi_dump_header_dbg() helper Being a while that we have SCMI trace events in the SCMI stack, remove this debug helper and its call sites. Link: https://lore.kernel.org/r/20210803131024.40280-3-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 63b282f172717609136b51571bcc1f74d92d2be6 Author: Cristian Marussi Date: Tue Aug 3 14:10:10 2021 +0100 firmware: arm_scmi: Add support for type handling in common functions Add SCMI type handling to pack/unpack_scmi_header common helper functions. Initialize hdr.type properly when initializing a command xfer. Link: https://lore.kernel.org/r/20210803131024.40280-2-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 5a04227326b04c15b015181772f5c853172fdb68 Author: Dillon Min Date: Sat Jul 24 11:44:03 2021 +0800 drm/panel: Add ilitek ili9341 panel driver This driver combines tiny/ili9341.c mipi_dbi_interface driver with mipi_dpi_interface driver, can support ili9341 with serial mode and parallel rgb interface mode by different dts bindings. Signed-off-by: Dillon Min Reported-by: kernel test robot Reviewed-by: Linus Walleij Reviewed-by: Jagan Teki Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/1627098243-2742-4-git-send-email-dillon.minfei@gmail.com commit 7dbdce8062687de103cba58bb2eded922cd41110 Author: Dillon Min Date: Sat Jul 24 11:44:01 2021 +0800 dt-bindings: display: panel: Add ilitek ili9341 panel bindings Add documentation for "ilitek,ili9341" panel. Signed-off-by: Dillon Min Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/lkml/1626853288-31223-2-git-send-email-dillon.minfei@gmail.com/ Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/1627098243-2742-2-git-send-email-dillon.minfei@gmail.com commit cb95ea79b3fc772c5873a7a4532ab4c14a455da2 Author: Rui Wang Date: Thu Jul 29 17:31:52 2021 +0800 MIPS: locking/atomic: Fix atomic{_64,}_sub_if_positive This looks like a typo and that caused atomic64 test failed. Signed-off-by: Rui Wang Signed-off-by: Thomas Bogendoerfer commit ad548993a66c498267695edd8b19a682be0e3a8b Author: Randy Dunlap Date: Wed Aug 4 17:02:16 2021 -0700 MIPS: loongson2ef: don't build serial.o unconditionally LOONGSON_UART_BASE depends on EARLY_PRINTK || SERIAL_8250, but when neither of these Kconfig symbols is set, the kernel build has errors: ../arch/mips/loongson2ef/common/serial.c: In function 'serial_init': ../arch/mips/loongson2ef/common/serial.c:66:25: error: 'loongson_uart_base' undeclared (first use in this function) 66 | loongson_uart_base; ../arch/mips/loongson2ef/common/serial.c:66:25: note: each undeclared identifier is reported only once for each function it appears in ../arch/mips/loongson2ef/common/serial.c:68:41: error: '_loongson_uart_base' undeclared (first use in this function) 68 | (void __iomem *)_loongson_uart_base; Fix this by building serial.o only when one (or both) of these Kconfig symbols is enabled. Tested with: (a) EARLY_PRINTK=y, SERIAL_8250 not set; (b) EARLY_PRINTK=y, SERIAL_8250=y; (c) EARLY_PRINTK=y, SERIAL_8250=m. (d) EARLY_PRINTK not set, SERIAL_8250=y; (e) EARLY_PRINTK not set, SERIAL_8250=m; (f) EARLY_PRINTK not set, SERIAL_8250 not set. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Jiaxun Yang Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 730d070ae9f12fff5d44fe8fb0547ae37d100da8 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:45 2021 +0200 MIPS: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Bogendoerfer commit 49179e6657a252242ee912472c9d9c81a33800a6 Author: Artjom Vejsel Date: Wed Aug 4 03:23:53 2021 +0300 drm/panel-simple: add Gopher 2b LCD panel The Gopher 2b LCD panel is used in Gopher 2b handhelds. It's simple panel with NewVision NV3047 driver, but SPI lines are not connected. It has no specific name, since it's unique to that handheld. lot name at AliExpress: 4.3 inch 40PIN TFT LCD Screen COG NV3047 Drive IC 480(RGB)*272 No Touch 24Bit RGB Interface Signed-off-by: Artjom Vejsel Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20210804002353.76385-4-akawolf0@gmail.com commit fed4c105acff35bc6e996b28aee5e91faaf5c192 Author: Artjom Vejsel Date: Wed Aug 4 03:23:52 2021 +0300 dt-bindings: Add DT bindings for QiShenglong Gopher 2b panel Add DT bindings for QiShenglong Gopher 2b 4.3" 480(RGB)x272 TFT LCD panel. Signed-off-by: Artjom Vejsel Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20210804002353.76385-3-akawolf0@gmail.com commit 319afe68567b923e25140e744e7f05e3e5d889c1 Author: Paolo Bonzini Date: Wed Aug 4 12:48:41 2021 -0400 KVM: xen: do not use struct gfn_to_hva_cache gfn_to_hva_cache is not thread-safe, so it is usually used only within a vCPU (whose code is protected by vcpu->mutex). The Xen interface implementation has such a cache in kvm->arch, but it is not really used except to store the location of the shared info page. Replace shinfo_set and shinfo_cache with just the value that is passed via KVM_XEN_ATTR_TYPE_SHARED_INFO; the only complication is that the initialization value is not zero anymore and therefore kvm_xen_init_vm needs to be introduced. Signed-off-by: Paolo Bonzini commit 6cad6db75231a18f25dc7d610d5a0683160ac545 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:08 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos5422 Describe Exynos5422 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-7-krzysztof.kozlowski@canonical.com commit a73d3069f6f7717bbd31a2fcfe8ddb3d98076b1d Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:07 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos5420 Describe Exynos5420 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-6-krzysztof.kozlowski@canonical.com commit fa0c56dbc3a1b116d280c3a3a97052ea38e4ea2b Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:06 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos5260 Describe Exynos5260 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-5-krzysztof.kozlowski@canonical.com commit fc6d5c9953757c61042676db9bb32ecd7af958f3 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:05 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos5250 Describe Exynos5250 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-4-krzysztof.kozlowski@canonical.com commit 1fb5b5b0dc491613eaa42bc39457589bfcb2b2b9 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:04 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos4412 Describe Exynos4412 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-3-krzysztof.kozlowski@canonical.com commit 900dd07d13e46b2937522ac7cc46a9ceb49284b6 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:03 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos4210 Describe Exynos4210 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-2-krzysztof.kozlowski@canonical.com commit a2798e309f3c67ab69073582dc4b8102a9013e25 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:02 2021 +0200 ARM: dts: exynos: add CPU topology to Exynos3250 Describe Exynos3250 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-1-krzysztof.kozlowski@canonical.com commit 0cdcca7ec37cfe54cd2f0668eddcf5aef87a05e3 Author: Krzysztof Kozlowski Date: Sat Jul 31 11:24:09 2021 +0200 arm64: dts: exynos: add CPU topology to Exynos5433 Describe Exynos5433 CPU topology. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210731092409.31496-8-krzysztof.kozlowski@canonical.com commit df8bcf36be2755a39c2f1bcc1ea3c18329c29931 Author: Takashi Iwai Date: Thu Aug 5 08:21:48 2021 +0200 ALSA: es1688: Avoid devres management for es1688 object creation The recent refactoring of es1688 object creation with the use of devres caused a problem with the non-PnP probe of GUS driver, as it tries to probe multiple times with different parameters That is, this object needs the immediate resource release and the devres doesn't fit for it. This patch reverts partially the commit for restoring the classic resource management for es1688 object. Fixes: 1bb11c1c7f6e ("ALSA: es1688: Allocate resources with device-managed APIs") Reported-by: kernel test robot Link: https://lore.kernel.org/r/20210805032513.GA30485@xsang-OptiPlex-9020 Link: https://lore.kernel.org/r/20210805062148.30951-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ddddc0d4c76aabd15eddbd905d4bf009f2f30725 Author: Pierre-Louis Bossart Date: Wed Aug 4 13:54:42 2021 -0500 ALSA: pci/korg1212: completely remove 'set but not used' warnings Commit 6cdc01ebdfb0 ("ALSA: pci/korg1212: remove 'set but not used' warnings") missed one __maybe_unused, add to enable make W=1 sound/ compilation with x86_64 allmodconfig Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210804185442.274057-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 5d5b74aa9c766f0dd37d5cc1a2a7a94586130501 Author: Miklos Szeredi Date: Thu Aug 5 05:57:27 2021 +0200 fuse: allow sharing existing sb Make it possible to create a new mount from a already working server. Here's a detailed description of the problem from Jakob: "The background for this question is occasional problems we see with our fuse filesystem [1] and mount namespaces. On a usual client, we have system-wide, autofs managed mountpoints. When a new mount namespace is created (which can be done unprivileged in combination with user namespaces), it can happen that a mountpoint is used inside the new namespace but idle in the root mount namespace. So autofs unmounts the parent, system-wide mountpoint. But the fuse module stays active and still serves mountpoint in the child mount namespace. Because the fuse daemon also blocks other system wide resources corresponding to the mountpoint, this situation effectively prevents new mounts until the child mount namespaces closes. [1] https://github.com/cvmfs/cvmfs" Reported-by: Jakob Blomer Signed-off-by: Miklos Szeredi commit 62dd1fc8cc6b22e3e568be46ebdb817e66f5d6a5 Author: Miklos Szeredi Date: Thu Aug 5 05:57:27 2021 +0200 fuse: move fget() to fuse_get_tree() Affected call chains: fuse_get_tree -> get_tree_(bdev|nodev) -> fuse_fill_super Needed for following patch. Signed-off-by: Miklos Szeredi commit e3d4571955050736bbf3eda0a9538a09d9fcfce8 Author: Stephan Gerhold Date: Mon Jul 12 15:57:03 2021 +0200 soc: qcom: smsm: Fix missed interrupts if state changes while masked The SMSM driver detects interrupt edges by tracking the last state it has seen (and has triggered the interrupt handler for). This works fine, but only if the interrupt does not change state while masked. For example, if an interrupt is unmasked while the state is HIGH, the stored last_value for that interrupt might still be LOW. Then, when the remote processor triggers smsm_intr() we assume that nothing has changed, even though the state might have changed from HIGH to LOW. Attempt to fix this by checking the current remote state before unmasking an IRQ. Use atomic operations to avoid the interrupt handler from interfering with the unmask function. This fixes modem crashes in some edge cases with the BAM-DMUX driver. Specifically, the BAM-DMUX interrupt handler is not called for the HIGH -> LOW smsm state transition if the BAM-DMUX driver is loaded (and therefore unmasks the interrupt) after the modem was already started: qcom-q6v5-mss 4080000.remoteproc: fatal error received: a2_task.c:3188: Assert FALSE failed: A2 DL PER deadlock timer expired waiting for Apps ACK Fixes: c97c4090ff72 ("soc: qcom: smsm: Add driver for Qualcomm SMSM") Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712135703.324748-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit c73a6852b42c8c80cc46590dbbcfa6c448fdbc63 Author: Stephan Gerhold Date: Mon Jul 12 15:57:02 2021 +0200 soc: qcom: smsm: Implement support for get_irqchip_state At the moment there is no way for drivers to get the current state of the interrupt signal reported by a remote processor. The irqchip API has generic functionality for this, using irq_get_irqchip_state(). Implement support for getting the IRQCHIP_STATE_LINE_LEVEL by reading the remote state and checking the bit for the specified IRQ. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712135703.324748-1-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit ad68c620b7b296aab9cbe61802e329c04fde8385 Author: Alex Elder Date: Mon Mar 15 09:44:55 2021 -0500 soc: qcom: mdt_loader: be more informative on errors In __qcom_mdt_load() there are cases where an error occurs that cause a message to be printed. In some of those cases the errno value can be helpful to understand exactly what caused the problem. Print the errno (as well as the firmware file name) where it is helpful, and in a few cases reword the error message. Consistently use the private fw_name for the file name. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210315144455.1770492-1-elder@linaro.org Signed-off-by: Bjorn Andersson commit a95fc720844154acc79064c222335165fe7cb136 Author: Caleb Connolly Date: Thu Apr 8 16:21:14 2021 +0000 dt-bindings: qcom: geni-se: document iommus Document the iommus property for QCOM Geni SE. Signed-off-by: Caleb Connolly Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210408161953.26298-4-caleb@connolly.tech Signed-off-by: Bjorn Andersson commit 11648cbb7b335b7eb54e1ff973fb938939616f46 Author: Randy Dunlap Date: Thu Jul 15 19:23:38 2021 -0700 openrisc: rename or32 code & comments to or1k From Documentation/openrisc/todo.rst, rename "or32" in the source code to "or1k" since this is the name that has been settled on. Signed-off-by: Randy Dunlap Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openrisc@lists.librecores.org Signed-off-by: Stafford Horne commit 946e1052cdcc7e585ee5d1e72528ca49fb295243 Author: Randy Dunlap Date: Sun Jul 18 19:33:09 2021 -0700 openrisc: don't printk() unconditionally Don't call printk() when CONFIG_PRINTK is not set. Fixes the following build errors: or1k-linux-ld: arch/openrisc/kernel/entry.o: in function `_external_irq_handler': (.text+0x804): undefined reference to `printk' (.text+0x804): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `printk' Fixes: 9d02a4283e9c ("OpenRISC: Boot code") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openrisc@lists.librecores.org Signed-off-by: Stafford Horne commit 593cb55b4cdd18a2946efd67c29ec4c6081dea8f Author: Iskren Chernev Date: Sat Jul 31 19:48:27 2021 +0300 soc: qcom: smd-rpm: Add SM6115 compatible Add a compatible for SM6115 Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210731164827.2756798-3-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 372642ea83ff1c71a5d567a704c912359eb59776 Author: Stanislav Fomichev Date: Wed Aug 4 13:55:24 2021 -0700 selftests/bpf: Move netcnt test under test_progs Rewrite to skel and ASSERT macros as well while we are at it. v3: - replace -f with -A to make it work with busybox ping. -A is available on both busybox and iputils, from the man page: On networks with low RTT this mode is essentially equivalent to flood mode. v2: - don't check result of bpf_map__fd (Yonghong Song) - remove from .gitignore (Andrii Nakryiko) - move ping_command into network_helpers (Andrii Nakryiko) - remove assert() (Andrii Nakryiko) Signed-off-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210804205524.3748709-1-sdf@google.com commit d4bf15a7ce172d186d400d606adf4f34a59130d6 Author: Yangtao Li Date: Wed Aug 4 11:29:46 2021 +0800 f2fs: reduce the scope of setting fsck tag when de->name_len is zero I recently found a case where de->name_len is 0 in f2fs_fill_dentries() easily reproduced, and finally set the fsck flag. Thread A Thread B - f2fs_readdir - f2fs_read_inline_dir - ctx->pos = d.max - f2fs_add_dentry - f2fs_add_inline_entry - do_convert_inline_dir - f2fs_add_regular_entry - f2fs_readdir - f2fs_fill_dentries - set_sbi_flag(sbi, SBI_NEED_FSCK) Process A opens the folder, and has been reading without closing it. During this period, Process B created a file under the folder (occupying multiple f2fs_dir_entry, exceeding the d.max of the inline dir). After creation, process A uses the d.max of inline dir to read it again, and it will read that de->name_len is 0. And Chao pointed out that w/o inline conversion, the race condition still can happen as below: dir_entry1: A dir_entry2: B dir_entry3: C free slot: _ ctx->pos: ^ Thread A is traversing directory, ctx-pos moves to below position after readdir() by thread A: AAAABBBB___ ^ Then thread B delete dir_entry2, and create dir_entry3. Thread A calls readdir() to lookup dirents starting from middle of new dirent slots as below: AAAACCCCCC_ ^ In these scenarios, the file system is not damaged, and it's hard to avoid it. But we can bypass tagging FSCK flag if: a) bit_pos (:= ctx->pos % d->max) is non-zero and b) before bit_pos moves to first valid dir_entry. Fixes: ddf06b753a85 ("f2fs: fix to trigger fsck if dirent.name_len is zero") Signed-off-by: Yangtao Li [Chao: clean up description] Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 34ad6d9d8c27293e1895b448af7d6cf5d351ad8d Author: Matthew Cover Date: Fri Jul 30 17:56:32 2021 -0700 bpf, samples: Add missing mprog-disable to xdp_redirect_cpu's optstring Commit ce4dade7f12a ("samples/bpf: xdp_redirect_cpu: Load a eBPF program on cpumap") added the following option, but missed adding it to optstring: - mprog-disable: disable loading XDP program on cpumap entries Fix it and add the missing option character. Fixes: ce4dade7f12a ("samples/bpf: xdp_redirect_cpu: Load a eBPF program on cpumap") Signed-off-by: Matthew Cover Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20210731005632.13228-1-matthew.cover@stackpath.com commit 8e02cceb1f1f4f254625e5338dd997ff61ab40d7 Author: Daniel Vetter Date: Tue Aug 3 14:48:33 2021 +0200 drm/i915: delete gpu reloc code It's already removed, this just garbage collects it all. v2: Rebase over s/GEN/GRAPHICS_VER/ v3: Also ditch eb.reloc_pool and eb.reloc_context (Maarten) Reviewed-by: Jason Ekstrand Signed-off-by: Daniel Vetter Cc: Jon Bloomfield Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Joonas Lahtinen Cc: "Thomas Hellström" Cc: Matthew Auld Cc: Lionel Landwerlin Cc: Dave Airlie Cc: Jason Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20210803124833.3817354-2-daniel.vetter@ffwll.ch commit ce13c78fa93ede18e341b753f21052344ea7eb33 Author: Daniel Vetter Date: Tue Aug 3 14:48:32 2021 +0200 drm/i915: Disable gpu relocations Media userspace was the last userspace to still use them, and they converted now too: https://github.com/intel/media-driver/commit/144020c37770083974bedf59902b70b8f444c799 This means no reason anymore to make relocations faster than they've been for the first 9 years of gem. This code was added in commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb Author: Chris Wilson Date: Fri Jun 16 15:05:24 2017 +0100 drm/i915: Async GPU relocation processing Furthermore there's pretty strong indications it's buggy, since the code to use it by default as the only option had to be reverted: commit ad5d95e4d538737ed3fa25493777decf264a3011 Author: Dave Airlie Date: Tue Sep 8 15:41:17 2020 +1000 Revert "drm/i915/gem: Async GPU relocations only" This code just disables gpu relocations, leaving the garbage collection for later patches and more importantly, much less confusing diff. Also given how much headaches this code has caused in the past, letting this soak for a bit seems justified. Acked-by: Dave Airlie Reviewed-by: Maarten Lankhorst Reviewed-by: Jason Ekstrand Signed-off-by: Daniel Vetter Cc: Jon Bloomfield Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Joonas Lahtinen Cc: Daniel Vetter Cc: "Thomas Hellström" Cc: Matthew Auld Cc: Lionel Landwerlin Cc: Dave Airlie Cc: Jason Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20210803124833.3817354-1-daniel.vetter@ffwll.ch commit 6d4eb36d65979ad48f4b05c3309e0c74f04e5ac6 Author: Andrii Nakryiko Date: Wed Aug 4 08:37:50 2021 -0700 bpf: Fix bpf_prog_test_run_xdp logic after incorrect merge resolution During recent net into net-next merge ([0]) a piece of old logic ([1]) got reintroduced accidentally while resolving merge conflict between bpf's [2] and bpf-next's [3]. This check was removed in bpf-next tree to allow extra ctx_in parameter passed for XDP test runs. Reinstating the check breaks bpf_prog_test_run_xdp logic and causes a corresponding xdp_context_test_run selftest failure. Fix by removing the check and allow ctx_in for XDP test runs. [0] 5af84df962dd ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") [1] 947e8b595b82 ("bpf: explicitly prohibit ctx_{in, out} in non-skb BPF_PROG_TEST_RUN") [2] 5e21bb4e8125 ("bpf, test: fix NULL pointer dereference on invalid expected_attach_type") [3] 47316f4a3053 ("bpf: Support input xdp_md context in BPF_PROG_TEST_RUN") Fixes: 5af84df962dd ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Daniel Borkmann commit 372bbdd5bb3fc454d9c280dc0914486a3c7419d5 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:06 2021 +0200 net: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jakub Kicinski commit a0d1d0f47e3193d6188869ae6bcf08a792f63cf6 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:04 2021 +0200 virtio_net: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtualization@lists.linux-foundation.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jakub Kicinski commit 9f2a5aebb03c19180e3be75ed7263c6ab510b75e Author: Drew Fustini Date: Mon Jul 12 23:30:18 2021 -0700 dt-bindings: riscv: add starfive jh7100 bindings Add DT binding documentation for the StarFive JH7100 Soc [1] and the BeagleV Starlight JH7100 board [2]. [1] https://github.com/starfive-tech/beaglev_doc [2] https://github.com/beagleboard/beaglev-starlight Signed-off-by: Drew Fustini Reviewed-by: Rob Herring Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt commit 59983a5c918ed5aad51d866d320c4beb3b952a08 Author: Konrad Dybcio Date: Tue Jun 15 16:22:49 2021 +0200 arm64: dts: qcom: sm8250: Add DMA to I2C/SPI Add dma properties to I2C and SPI nodes to make sure DMA transfers can go through. While at it, fix up the property order in SPI nodes to make #address- and #size-cells go after all the meaningful properties. Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20210615142249.170512-1-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 2e01e0c2145998ad0b2dfa4a990cc55436194099 Author: Bjorn Andersson Date: Tue Jun 15 18:28:16 2021 -0500 arm64: dts: qcom: sdm850-yoga: Enable IPA Shuffle memory regions to make firmware loading succeed and then enable the ipa device. Tested-by: Steev Klimaszewski Link: https://lore.kernel.org/r/20210615232816.835325-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 712e245fcbfd92f385ea5bc12af399d97953a298 Author: Konrad Dybcio Date: Thu Jul 29 00:25:42 2021 +0200 arm64: dts: qcom: sdm630: Add DMA to I2C hosts Add DMA properties to I2C hosts to allow for DMA transfers. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-40-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 536f44285ff618087256f2059d0d6b5581d3748d Author: Konrad Dybcio Date: Thu Jul 29 00:25:41 2021 +0200 arm64: dts: qcom: sdm630: Add I2C functions to I2C pins This was overlooked earlier, fix it to ensure the busses can work properly. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-39-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 18abedf7d4e6d069f89ba056223a03ba1e17af3b Author: Konrad Dybcio Date: Thu Jul 29 00:25:40 2021 +0200 arm64: dts: qcom: sdm630-nile: Remove gpio-keys autorepeat The autorepeat feature is not needed on gpio-keys. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-38-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit e634d8196f7da05b81a4574e1572ef559f1ba85f Author: Konrad Dybcio Date: Thu Jul 29 00:25:39 2021 +0200 arm64: dts: qcom: sdm630-nile: Enable uSD card slot Enable the internal uSD slot to let the user have more storage. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-37-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit bc81940d8ca568f887d5337ccf97f104a60be955 Author: Konrad Dybcio Date: Thu Jul 29 00:25:38 2021 +0200 arm64: dts: qcom: sdm630-nile: Specify ADSP firmware name Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-36-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit f8fc1c43c51b4aad8a88d2c968d2a63b5ef7ed13 Author: Konrad Dybcio Date: Thu Jul 29 00:25:37 2021 +0200 arm64: dts: qcom: sdm630-nile: Add Synaptics touchscreen. Delete the node on Ganges devices, as they use a different one. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-35-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 4c1d849ec047dde4e21dca7f20f300575307a660 Author: Konrad Dybcio Date: Thu Jul 29 00:25:36 2021 +0200 arm64: dts: qcom: sdm630-xperia: Retire sdm630-sony-xperia-ganges.dtsi After further consideration, it is not worth to keep another separate DTSI, as the differences between Nile and Ganges are very minimal. Instead, let's just address the minimal differences between Kirin and Mermaid. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-34-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit fcbcd062a894067f1f622f927ed7c448723d6f06 Author: Konrad Dybcio Date: Thu Jul 29 00:25:35 2021 +0200 arm64: dts: qcom: sdm630-nile: Add Volume up key Let's get loud! Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-33-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 2c616239f255a66e5989e8fa5cdaefc25eec3d00 Author: Konrad Dybcio Date: Thu Jul 29 00:25:34 2021 +0200 arm64: dts: qcom: sdm630-nile: Add USB Enable and configure DWC3 and QUSB2 PHY to enable USB functionality on Nile and Ganges boards. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-32-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 158f80a68148d7febdbcc3586d2d17e455453563 Author: Konrad Dybcio Date: Thu Jul 29 00:25:33 2021 +0200 arm64: dts: qcom: sdm630-nile: Use &labels Refer to nodes by their labels to match the current convention. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-31-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 8b36c824b9a77a8816258fdd00997a5f78542814 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:32 2021 +0200 arm64: dts: qcom: sdm630-xperia-nile: Add all RPM and fixed regulators Add all of the RPM PM660/PM660L regulators and the fixed ones, defining the common electrical part of this platform. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-30-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit ab290284398d8a33a5e7e9ebe7c7364b481f6dd8 Author: Konrad Dybcio Date: Thu Jul 29 00:25:31 2021 +0200 arm64: dts: qcom: sdm660: Add required nodes for DSI1 Configure the second DSI host/phy and account for them in the mmcc node. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-29-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit f3d5d3cc69710344f152c6b65e54ccc8c818b9d4 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:30 2021 +0200 arm64: dts: qcom: sdm630: Configure the camera subsystem Add nodes for camss, cci and its pinctrl in order to bring up camera functionality. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-28-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit c21512cbfbfdcb72ba3b41e714266149433b11c8 Author: Konrad Dybcio Date: Thu Jul 29 00:25:29 2021 +0200 arm64: dts: qcom: sdm630: Add IMEM node Add IMEM node and PIL reloc info as its child. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-27-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 36c7b98f7935110ff5a65b49f03ae3bbf1cbe181 Author: Konrad Dybcio Date: Thu Jul 29 00:25:28 2021 +0200 arm64: dts: qcom: Add device tree for SDM636 This SoC is almost identical to its older brother, SDM660, with a few minor exceptions like the different GPU. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-26-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 05aa0eb325c98f7e06eeb3f251cbab1b27586c8e Author: Konrad Dybcio Date: Thu Jul 29 00:25:27 2021 +0200 arm64: dts: qcom: sdm660: Make the DTS an overlay on top of 630 There is SO MUCH common code between these two SoCs that it makes no sense to keep what is essentially a duplicate of 630.dtsi. Instead, it's better to just change the things that differ. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-25-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 4bf09754050652885bc123454615ef4f74f9586c Author: Konrad Dybcio Date: Thu Jul 29 00:25:26 2021 +0200 arm64: dts: qcom: pm660(l): Add VADC and temp alarm nodes Add VADC, temperature alarm and thermal zones for pm660(l) to allow for temperature and voltage readouts and prevent PMIC overheating. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-24-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 2a1fbb121aa6d87c618f7f345c3c498cb8a65446 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:25 2021 +0200 arm64: dts: qcom: pm660l: Support SPMI regulators on PMIC sid 3 The PM660L PMIC has SPMI regulators on the PMIC SID 3: let's add the compatible in order to probe them. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-23-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 7b56a804e58b1670cb8f17b66543facd21af4dd2 Author: Konrad Dybcio Date: Thu Jul 29 00:25:24 2021 +0200 arm64: dts: qcom: pm660l: Add WLED support This will enable backlight control on WLED-enabled devices. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-22-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit b59b058c623d274919b4cae5e0625f8231cbb474 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:23 2021 +0200 arm64: dts: qcom: pm660: Support SPMI regulators on PMIC sid 1 The PM660 PMIC has SPMI regulators on the PMIC SID 1: let's declare the second pmic subtree and add the spmi vregs compatible to probe them there. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-21-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 5cf69dcbec8bd6620ecef601a6744489d5201e0e Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:22 2021 +0200 arm64: dts: qcom: sdm630: Add Adreno 508 GPU configuration The SDM630 SoC features an Adreno 508.0 GPU with a minimum frequency of 160MHz and a maximum of (depending on the speed-bin) 775MHz. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-20-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit adc57d4a463b59ec7d3adf7125758de5a1db3944 Author: Konrad Dybcio Date: Thu Jul 29 00:25:21 2021 +0200 arm64: dts: qcom: sdm630: Raise tcsr_mutex_regs size Enlarge the size to make sure all relevant registers can be reached. This will be required to support the modem. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-19-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 7ca2ebc90a4624b361c9b7291d7cafa2deab2c1a Author: Konrad Dybcio Date: Thu Jul 29 00:25:20 2021 +0200 arm64: dts: qcom: sdm630: Add ADSP remoteproc configuration Configure the ADSP remote processor and add a simple sound{} node to make way for future development. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-18-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 3332c59649fea6b00f437c20e294e8b29f07fca7 Author: Konrad Dybcio Date: Thu Jul 29 00:25:19 2021 +0200 arm64: dts: qcom: sdm630: Add thermal-zones configuration Add a basic thermal-zones configuration to make sure the SoC doesn't overheat itself to death. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-17-konrad.dybcio@somainline.org [bjorn: Sorted thermal-zones below "soc"] Signed-off-by: Bjorn Andersson commit c8236767599afb43d4e274cc56efecfe47c55332 Author: Konrad Dybcio Date: Thu Jul 29 00:25:18 2021 +0200 arm64: dts: qcom: sdm630: Add modem/ADSP SMP2P nodes Add SMP2P nodes that are required for ADSP and modem bringup. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-16-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 7c54b82b4545386bb576b7c5df5b8d4f95f11a5b Author: Konrad Dybcio Date: Thu Jul 29 00:25:17 2021 +0200 arm64: dts: qcom: sdm630: Add TSENS node This will enable temperature reporting for various SoC components. Acked-by: Rob Herring Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-15-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 056d4ff8279a1df70eaf2fccb5977508c83627aa Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:16 2021 +0200 arm64: dts: qcom: sdm630: Add qcom,adreno-smmu compatible The Adreno SMMU in SDM630 needs this compatible string for proper context handling and split pagetables support. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-14-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 6bb717fe56f67218715fd3b8eaf65bb1fe8f8458 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:15 2021 +0200 arm64: dts: qcom: sdm630: Add clocks and power domains to SMMU nodes Add the required clocks and power domains for the SMMUs to work. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-13-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit a64fa0e23b5f712828379319d20b32546e0cfb94 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:14 2021 +0200 arm64: dts: qcom: sdm630: Add GPU Clock Controller node Add the GPU Clock Controller in SDM630 and keep it disabled by default. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-12-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 738777ab85ea9aced9e6e139be921c5dd89498f3 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:13 2021 +0200 arm64: dts: qcom: sdm630: Add interconnect and opp table to sdhc_1 The SDHC port 1 has interconnects and can make use of DVFS: define the interconnections and the OPP table in order to optimize performance and power consumption. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-11-konrad.dybcio@somainline.org [bjorn: Dropped "sdhc1-" prefix from opp-table node] Signed-off-by: Bjorn Andersson commit 0b700aa1b3e6240bc9885b18700c95bce6c1d948 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:12 2021 +0200 arm64: dts: qcom: sdm630: Add SDHCI2 node This will enable usage of (generally) uSD cards. While at it, add accompanying OPP table for DVFS. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-10-konrad.dybcio@somainline.org [bjorn: Dropped "sdhci1-" prefix from opp-table node] Signed-off-by: Bjorn Andersson commit 36a0d47aee6a8cfd3c6cf4274732d8ef994a25b4 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:11 2021 +0200 arm64: dts: qcom: sdm630: Fix TLMM node and pinctrl configuration Previous pinctrl configuration was wrong. Fix it and clean up how multi-pin states are described. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-9-konrad.dybcio@somainline.org [bjorn: Polished the commit message] Signed-off-by: Bjorn Andersson commit c65a4ed2ea8bca368e8e8822b61f7309aa706171 Author: Konrad Dybcio Date: Thu Jul 29 00:25:10 2021 +0200 arm64: dts: qcom: sdm630: Add USB configuration This will let us use USB2 on our devices. The SoC supposedly supports USB3, but there are no known cases of devices that actually have USB3 wired up in hardware. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-8-konrad.dybcio@somainline.org [bjorn: Changes dwc3 node name to "usb"] Signed-off-by: Bjorn Andersson commit 142662f8f43c1725418ff13a2c83fb218d2b0911 Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:09 2021 +0200 arm64: dts: qcom: sdm630: Add qfprom subnodes These will be required for USB and Adreno support. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-7-konrad.dybcio@somainline.org [bjorn: y/_/-/ in gpu_speed_bin] Signed-off-by: Bjorn Andersson commit b52555d590d1609ea9577f25f06d366e397afe96 Author: Konrad Dybcio Date: Thu Jul 29 00:25:08 2021 +0200 arm64: dts: qcom: sdm630: Add MDSS nodes Add MDSS node along with its children to enable display functionality. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-6-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 045547a022529d29ad2ddc1981817743d1dac91e Author: Konrad Dybcio Date: Thu Jul 29 00:25:07 2021 +0200 arm64: dts: qcom: sdm630: Add interconnect provider nodes Add interconnect provider nodes to allow for NoC bus scaling. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-5-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 01b182d920a8147f185adfc5364952aeed9eb086 Author: Konrad Dybcio Date: Thu Jul 29 00:25:06 2021 +0200 arm64: dts: qcom: sdm630: Add MMCC node Add MultiMedia Clock Controller node to allow for accessing and controlling Multimedia Subsystem clocks by their respective users. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-4-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 1ce921ae3d30ef86f8313d753e07b67f9bcfc8f8 Author: Konrad Dybcio Date: Thu Jul 29 00:25:05 2021 +0200 arm64: dts: qcom: sdm630: Add RPMPD nodes Add the rpmpd node on the sdm630 and define the available levels. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-3-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 26e02c98a9ad63eb21b9be4ac92002f555130d3b Author: AngeloGioacchino Del Regno Date: Thu Jul 29 00:25:04 2021 +0200 arm64: dts: qcom: sdm630: Rewrite memory map The memory map was wrong. Fix it. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728222542.54269-2-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit ce3b50cf621c018a8bcbc7720e154926fc736c67 Author: Thara Gopinath Date: Wed Aug 4 09:28:47 2021 -0400 arm64: dts: qcom: sm8150: Fix incorrect cpu opp table entry CPU0 frequency 768MHz is wrongly modeled as 576000000 hz in cpu0_opp_table. Use the correct value 768000000 hz. Fixes: 2b6187abafea ("arm64: dts: qcom: sm8150: Add CPU opp tables") Signed-off-by: Thara Gopinath Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210804132847.2503269-1-thara.gopinath@linaro.org Signed-off-by: Bjorn Andersson commit b9650a9e9c576ebe6276581fe325e54fc57c717a Author: Thara Gopinath Date: Wed Aug 4 09:32:23 2021 -0400 arm64: dts: qcom: sm8150-mtp: Add 8150 compatible string Add "qcom,sm8150" as one of the platform compatible strings. This will be later used by cpufreq-dt-platdev to exclude using cpufreq-dt cpufreq driver. Signed-off-by: Thara Gopinath Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210804133223.2503517-1-thara.gopinath@linaro.org Signed-off-by: Bjorn Andersson commit 20d7a9fb00ebc53e73d49df0048afb02ef92a635 Author: Bjorn Andersson Date: Wed Aug 4 12:30:42 2021 -0700 arm64: defconfig: Enable Qualcomm MSM8996 CPU clock driver The MSM8996 supports CPU frequency scaling, so enable the clock driver for this. Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210804193042.1155398-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 9d9b16054b7d357afde69a027514c695092b0d22 Author: Bob Peterson Date: Tue Jun 1 09:41:40 2021 -0500 gfs2: Fix glock recursion in freeze_go_xmote_bh We must not call gfs2_consist (which does a file system withdraw) from the freeze glock's freeze_go_xmote_bh function because the withdraw will try to use the freeze glock, thus causing a glock recursion error. This patch changes freeze_go_xmote_bh to call function gfs2_assert_withdraw_delayed instead of gfs2_consist to avoid recursion. Signed-off-by: Bob Peterson commit 0fa8266294754978da34d7ea785d621f51d939f2 Author: Vinod Koul Date: Fri Jun 25 10:52:10 2021 +0530 soc: qcom: geni: Add support for gpi dma GPI DMA is one of the DMA modes supported on geni, this adds support to enable that mode Also do better documentation of the enum geni_se_xfer_mode. Signed-off-by: Vinod Koul Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210625052213.32260-3-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit cb531cab62a19e97d8de0a2c9935daed93ec3736 Author: Vinod Koul Date: Fri Jun 25 10:52:09 2021 +0530 soc: qcom: geni: move GENI_IF_DISABLE_RO to common header GENI_IF_DISABLE_RO is used by geni spi driver as well to check the status if GENI, so move this to common header qcom-geni-se.h Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210625052213.32260-2-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 95ac706744de78a93a7ec98d603c35fb21de8400 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:12 2021 +0200 ACPI: processor: Replace deprecated CPU-hotplug functions The functions cpu_hotplug_begin, cpu_hotplug_done, get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_write_lock(), cpus_write_unlock, cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit 4fac49fd0a349aa3afb3ad7ec778a00592c7ab59 Author: Alexandre Belloni Date: Wed Aug 4 12:44:07 2021 +0200 PM: sleep: check RTC features instead of ops in suspend_test Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni Signed-off-by: Rafael J. Wysocki commit d2c8cce647f3022d5960a3bf2b50a2da341d9c8b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:13 2021 +0200 PM: sleep: s2idle: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit 09681a0772f773dddffd3c2d1796c87bd0d903b9 Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:11 2021 +0200 cpufreq: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit 5d4c779cb62e676aedc278de910b4bb8ef65a5cc Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:16:01 2021 +0200 powercap: intel_rapl: Replace deprecated CPU-hotplug functions The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki commit 1ca70b24afb999376bee3cf3b4a52732988fa0d7 Author: Nick Desaulniers Date: Tue Jul 20 11:15:42 2021 -0700 MAINTAINERS: add Nick as Reviewer for compiler_attributes.h $ ./scripts/get_maintainer.pl --rolestats --git-blame -f \ include/linux/compiler_attributes.h ... Nick Desaulniers (supporter:CLANG/LLVM BUILD SUPPORT,authored lines:43/331=13%,commits:8/15=53%) It's also important for me to stay up on which compiler attributes clang is missing. Signed-off-by: Nick Desaulniers Signed-off-by: Miguel Ojeda commit a0a77028c85ad1f6f36c3ceea21b30dc43721665 Author: Konrad Dybcio Date: Wed Jul 28 23:52:12 2021 +0200 remoteproc: q6v5_pas: Add sdm660 ADSP PIL compatible This chipset seems to work fine with the "generic" configuration. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728215212.18217-2-konrad.dybcio@somainline.org [bjorn: Use "-pas" suffix for remoteprocs using TrustZone] Signed-off-by: Bjorn Andersson commit f35ef8e4ea0a2b2b35a2c7009fc07b6d80a2b2f3 Author: Konrad Dybcio Date: Wed Jul 28 23:52:11 2021 +0200 dt-bindings: remoteproc: qcom: adsp: Add SDM660 ADSP Add a compatible string for SDM660 ADSP. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728215212.18217-1-konrad.dybcio@somainline.org [bjorn: Use the -pas suffix] Signed-off-by: Bjorn Andersson commit 0e00392a895c95c6d12d42158236c8862a2f43f2 Author: Rafael J. Wysocki Date: Thu Jul 29 16:49:10 2021 +0200 PCI: PM: Enable PME if it can be signaled from D3cold PME signaling is only enabled by __pci_enable_wake() if the target device can signal PME from the given target power state (to avoid pointless reconfiguration of the device), but if the hierarchy above the device goes into D3cold, the device itself will end up in D3cold too, so if it can signal PME from D3cold, it should be enabled to do so in __pci_enable_wake(). [Note that if the device does not end up in D3cold and it cannot signal PME from the original target power state, it will not signal PME, so in that case the behavior does not change.] Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/ Fixes: 5bcc2fb4e815 ("PCI PM: Simplify PCI wake-up code") Reported-by: Mika Westerberg Reported-by: Utkarsh H Patel Reported-by: Koba Ko Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Tested-by: Mika Westerberg commit da9f2150684ea684a7ddd6d7f0e38b2bdf43dcd8 Author: Rafael J. Wysocki Date: Thu Jul 29 17:54:28 2021 +0200 PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently It is inconsistent to return PCI_D0 from pci_target_state() instead of the original target state if 'wakeup' is true and the device cannot signal PME from D0. This only happens when the device cannot signal PME from the original target state and any shallower power states (including D0) and that case is effectively equivalent to the one in which PME singaling is not supported at all. Since the original target state is returned in the latter case, make the function do that in the former one too. Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/ Fixes: 666ff6f83e1d ("PCI/PM: Avoid using device_may_wakeup() for runtime PM") Reported-by: Mika Westerberg Reported-by: Utkarsh H Patel Reported-by: Koba Ko Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Tested-by: Mika Westerberg commit 293cb6b0ea19e628388959da4baa9558e891afc0 Author: Frank Wunderlich Date: Sun Jul 25 18:34:51 2021 +0200 arm: dts: mt7623: increase passive cooling trip MT7623/BPI-R2 has idle temperature after bootup from 48 degrees celsius increase the passive trip temp threshold to not trottle CPU frequency at this temperature Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20210725163451.217610-1-linux@fw-web.de Signed-off-by: Matthias Brugger commit 7bdcead7a75e3eab5e711c2da78c2a0360e7f2a4 Author: CK Hu Date: Thu Jul 29 09:05:49 2021 +0200 soc: mmsys: mediatek: add mask to mmsys routes SOUT has many bits and need to be cleared before set new value. Write only could do the clear, but for MOUT, it clears bits that should not be cleared. So use a mask to reset only the needed bits. this fixes HDMI issues on MT7623/BPI-R2 since 5.13 Fixes: 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers") Signed-off-by: Frank Wunderlich Signed-off-by: CK Hu Reviewed-by: Chun-Kuang Hu Reviewed-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20210729070549.5514-1-linux@fw-web.de Signed-off-by: Matthias Brugger commit 7aff79e297ee1aa0126924921fd87a4ae59d2467 Author: Michael Kelley Date: Wed Aug 4 08:52:39 2021 -0700 Drivers: hv: Enable Hyper-V code to be built on ARM64 Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Exclude the Hyper-V enlightened clocks/timers code from being built for ARM64. Signed-off-by: Michael Kelley Reviewed-by: Boqun Feng Acked-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1628092359-61351-6-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 9b16c2132f34316bf0b59d24357a788cc1e9e352 Author: Michael Kelley Date: Wed Aug 4 08:52:38 2021 -0700 arm64: efi: Export screen_info The Hyper-V frame buffer driver may be built as a module, and it needs access to screen_info. So export screen_info. Signed-off-by: Michael Kelley Acked-by: Ard Biesheuvel Acked-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1628092359-61351-5-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 9bbb888824e38cc2e9118ed351fe3d22403a73e1 Author: Michael Kelley Date: Wed Aug 4 08:52:37 2021 -0700 arm64: hyperv: Initialize hypervisor on boot Add ARM64-specific code to initialize the Hyper-V hypervisor when booting as a guest VM. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley Acked-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1628092359-61351-4-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 512c1117fb2eeb944df1b88bff6e0c002990b369 Author: Michael Kelley Date: Wed Aug 4 08:52:36 2021 -0700 arm64: hyperv: Add panic handler Add a function to inform Hyper-V about a guest panic. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley Reviewed-by: Sunil Muthuswamy Reviewed-by: Boqun Feng Acked-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1628092359-61351-3-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 57d276bbbd322409bb6f7c6446187a29953f8ded Author: Michael Kelley Date: Wed Aug 4 08:52:35 2021 -0700 arm64: hyperv: Add Hyper-V hypercall and register access utilities hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level Functional Spec (TLFS), and #includes the architecture-independent part of hyperv-tlfs.h in include/asm-generic. The published TLFS is distinctly oriented to x86/x64, so the ARM64-specific hyperv-tlfs.h includes information for ARM64 that is not yet formally published. The TLFS is available here: docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs mshyperv.h defines Linux-specific structures and routines for interacting with Hyper-V on ARM64, and #includes the architecture- independent part of mshyperv.h in include/asm-generic. Use these definitions to provide utility functions to make Hyper-V hypercalls and to get and set Hyper-V provided registers associated with a virtual processor. Signed-off-by: Michael Kelley Reviewed-by: Sunil Muthuswamy Acked-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1628092359-61351-2-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 7a6226db072beeb63d4c3aaa844b0676ef7a027f Author: Srinivas Pandruvada Date: Tue Jul 27 09:22:40 2021 -0700 ACPI: DPTF: Add new PCH FIVR methods Some additional information is required for updating PCH FIVR values upon WiFi channel changes. New attributes added to the existing sysfs: fivr_switching_freq_mhz : Get the FIVR switching control frequency. Uses ACPI method GFCS. fivr_switching_fault_status: Read the FIVR switching frequency control fault status. Uses ACPI method GFFS. ssc_clock_info : Presents SSC (spread spectrum clock) information for EMI (Electro magnetic interference) control. Use ACPI method GEMI (refer to the description of GEMI method below). GFFS This ACPI method is used to read the FIVR switching frequency control fault status. Bits Description [0:0] Fault status when set to 1 [31:1] Reserved GFCS This ACPI method is used to read the FIVR switching control frequency. Bits Description [11:0] Actual Frequency = value * XTAL_FREQ / 128 [31:12] Reserved GEMI This ACPI method is used to read the programmed register value for EMI (Electro magnetic interference) control. Bits Description [7:0] Sets clock spectrum spread percentage: 0x00=0.2% , 0x3F=10% 1 LSB = 0.1% increase in spread (for settings 0x01 thru 0x1C) 1 LSB = 0.2% increase in spread (for settings 0x1E thru 0x3F) [8] When set to 1, enables spread spectrum clock [9] 0: Triangle mode. FFC frequency walks around the Fcenter in a linear fashion 1: Random walk mode. FFC frequency changes randomly within the SSC (Spread spectrum clock) range [10] 0: No white noise. 1: Add white noise to spread waveform [11] When 1, future writes are ignored. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit ecd4916c7261edccb2382c9931535e238875a44d Author: Kefeng Wang Date: Thu Jul 8 09:59:49 2021 +0800 riscv: Enable GENERIC_IRQ_SHOW_LEVEL The interrupt controllers on riscv support both edge and level triggered interrupts, it's useful to provide that information in /proc/interrupts. Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit bcf11b5e99b27472ea61231a64e29ad7dd31f0da Author: Kefeng Wang Date: Thu Jul 8 09:59:48 2021 +0800 riscv: Enable idle generic idle loop Enable generic idle loop to support for hlt/nohlt command line options to override default idle loop behavior. Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit 8165c6ae8e3a264601f02fc17e5545d027584a2f Author: Kefeng Wang Date: Thu Jul 8 09:59:47 2021 +0800 riscv: Allow forced irq threading The timer interrupt and the perf interrupt on riscv are with IRQF_PERCPU, so it's safe to allow forced interrupt threading. Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit 6eefec4a0b668de9bbb33bd3e7acfbcc794162b0 Author: Larry Finger Date: Wed Aug 4 09:50:33 2021 -0500 Bluetooth: Add additional Bluetooth part for Realtek 8852AE This Realtek device has both wifi and BT components. The latter reports a USB ID of 04ca:4006, which is not in the table. The portion of /sys/kernel/debug/usb/devices pertaining to this device is T: Bus=02 Lev=01 Prnt=01 Port=12 Cnt=04 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04ca ProdID=4006 Rev= 0.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00e04c000001 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: Larry Finger Cc: Stable Signed-off-by: Marcel Holtmann commit e947802657cb6f540ba04f498dfd4938ed6c569e Author: mark-yw.chen Date: Wed Aug 4 17:06:47 2021 +0800 Bluetooth: btusb: Support Bluetooth Reset for Mediatek Chip(MT7921) When the firmware hang or command no response, driver can reset the bluetooth mcu via USB to recovery it. The reset steps as follows. 1. Cancel USB transfer requests before reset. 2. It use speicific USB HW Register to reset Bluetooth MCU, at the same time, the USB Endpoint0 still keep alive. 3. Poll the USB HW register until reset is completed by Endpoint0. 4. To recovery unexpected USB state and behavior during resetting the Bluetooth MCU, the driver need to reset the USB device for MT7921. 5. After the reset is completed, the Bluetooth MCU need to re-setup, such as download patch, power-on sequence and etc. Signed-off-by: mark-yw.chen Reviewed-by: Michael Sun Reviewed-by: Archie Pusaka Signed-off-by: Marcel Holtmann commit 0b10c8c84c0c78ba4456bdbeb8a5b6ee58f47e39 Author: mark-yw.chen Date: Wed Aug 4 17:03:15 2021 +0800 Bluetooth: btusb: Record debug log for Mediatek Chip. Mediatek Bluetooth controller sends the FW log and FW dump via EP2. This patch creates an MTK specified callback(btusb_recv_acl_mtk) to replace the original one (hci_recv_frame) when an MTK controller is detected. The new callback will separate the firmware dump traffics from the ACL data to have them process separately. 1. Add a new field (recv_acl) to the btusb_data struct to store vendor-specific ACL callback handler. 2. Add the MTK-specific ACL callback handler (btusb_recv_acl_mtk) to process ACL data, debug log, and firmware dump. 3. The debug log traces LMP/LL events and connection quality reports. 4. The upper layer can use hci_channel_monitor to receive these packets. Example btmon: firmware debug log. 1. Enable firmware debug log. < HCI Command: Vendor (0x3f|0x005d) plen 4 00 00 02 02 .... > HCI Event: Command Complete (0x0e) plen 8 Vendor (0x3f|0x005d) ncmd 1 Status: Success (0x00) 00 00 02 02 .... 2. Diagnostic packet from controller = Vendor Diagnostic (len 500) ff 05 f0 01 fd ff 02 0e 08 01 5d fc 00 00 00 02 02 aa aa aa cb e3 f0 15 b0 0c 5f 01 00 d1 0f 33 01 7f 00 08 57 61 0c 00 00 00 00 00 23 37 17 00 fd ff 00 00 29 60 ff ff b1 56 e8 00 57 40 0a 40 39 95 f2 00 47 40 43 00 fc f0 16 00 57 61 0c 00 00 00 00 00 23 37 17 00 fd ff 00 00 29 60 ff ff 65 95 f2 00 57 40 0a 40 ec d3 fc 00 47 40 3b 00 2c f1 17 00 57 61 0c 00 00 00 00 00 23 37 17 00 fd ff 00 00 29 60 ff ff 19 d4 fc 00 57 40 76 1c b2 61 01 01 47 40 b3 04 0b 63 18 00 fe ff 02 01 04 05 33 8b 9e 08 00 aa aa aa aa aa 27 38 01 02 01 00 00 00 02 e0 10 00 20 00 20 00 2a 08 40 00 20 00 20 08 2a 08 02 00 40 00 00 01 2e 08 40 00 01 67 b0 c2 2e 08 3e 07 ff ff ff ff 40 08 01 00 02 00 00 00 34 08 a3 00 00 00 00 00 34 08 a3 00 00 00 00 00 35 08 45 01 00 00 00 00 2e 08 40 00 01 67 b0 c2 30 35 01 02 00 00 00 00 2c 31 01 00 02 00 00 40 2d 19 03 00 00 40 00 00 fd ff 02 0f 04 00 01 01 04 aa aa aa aa aa aa aa 57 61 0c 00 00 00 00 00 23 46 32 00 01 00 00 00 2f 35 00 02 00 00 00 00 29 35 ff 02 00 22 00 00 2d 31 a6 02 02 00 00 00 31 6c 40 00 14 63 18 1b 31 6c 40 00 14 63 18 23 51 08 53 00 12 63 18 00 2c 35 12 01 fe 00 00 00 2b 35 fe 02 02 00 00 00 2f 31 21 00 00 00 02 00 75 61 01 00 4c 1b 93 00 79 61 01 00 00 00 00 00 12 e3 63 18 20 31 86 01 74 61 68 03 00 00 04 00 a1 73 ff 00 b9 01 00 00 a1 73 04 00 00 00 00 00 a1 73 00 00 00 00 00 00 a1 73 00 00 02 00 00 00 31 6c 40 00 16 63 18 0c 31 6c 40 00 16 63 18 1c 77 61 40 00 48 33 40 00 14 e3 63 18 40 31 86 01 00 d1 02 c5 07 23 a1 34 73 61 37 02 02 00 00 a1 Signed-off-by: mark-yw.chen Reviewed-by: Michael Sun Reviewed-by: Archie Pusaka Signed-off-by: Marcel Holtmann commit 67cbdd74c4cba378a715003923fc418a10349fae Author: Andy Shevchenko Date: Wed Aug 4 17:28:37 2021 +0300 Bluetooth: hci_bcm: Fix kernel doc comments Kernel doc validator complains about few missed parameter descriptions. Fill the gap by describing them. Signed-off-by: Andy Shevchenko Signed-off-by: Marcel Holtmann commit 775dea4deec679c24b525b258c341a45ff1de9ea Merge: b6e952c35267b 47adef20e67d6 Author: Arnd Bergmann Date: Wed Aug 4 16:03:40 2021 +0200 Merge tag 'ixp4xx-drivers-arm-soc-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/drivers IXP4xx driver updates for modernizing the IXP4xx platforms, taregeted for v5.15: - Add DT bindings to the expansion bus and PATA libata driver. - Add a new expansion bus driver. - Rewrite the watchdog driver to use the watchdog core and spawn from the timer (clocksource) driver. - Refactor the PATA/libata driver to probe from the device tree and use the expansion bus driver to manipulate chip select timings directly. * tag 'ixp4xx-drivers-arm-soc-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: pata: ixp4xx: Rewrite to use device tree pata: ixp4xx: Add DT bindings pata: ixp4xx: Refer to cmd and ctl rather than csN pata: ixp4xx: Use IS_ENABLED() to determine endianness pata: ixp4xx: Use local dev variable watchdog: ixp4xx: Rewrite driver to use core bus: ixp4xx: Add a driver for IXP4xx expansion bus bus: ixp4xx: Add DT bindings for the IXP4xx expansion bus Link: https://lore.kernel.org/r/CACRpkdZaCosXsgp02nuUbd_nEvdxm5-z0+d0oSA97UTWQ0RQQg@mail.gmail.com Signed-off-by: Arnd Bergmann commit 318845985fa032a865784ef5373f182fcdf037a9 Merge: 12c3dca25d2fa ad9bc2e35cf57 Author: Arnd Bergmann Date: Wed Aug 4 15:58:24 2021 +0200 Merge tag 'at91-soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/soc AT91 soc for 5.15: - add new SoC based on a Cortex-A7 core: the SAMA7G5 family - mach-at91 entry, Kconfig and header files - Power Management Controller (PMC) code and associated power management changes. Support for suspend/resume, Ultra Low Power modes and Backup with Memory in Self-Refresh mode. - Power management association with DDR controller and shutdown controller for addressing this variety of modes. * tag 'at91-soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: (26 commits) ARM: at91: pm: add sama7g5 shdwc ARM: at91: pm: add pm support for SAMA7G5 ARM: at91: sama7: introduce sama7 SoC family ARM: at91: pm: add sama7g5's pmc ARM: at91: pm: add backup mode support for SAMA7G5 ARM: at91: pm: save ddr phy calibration data to securam ARM: at91: pm: add sama7g5 ddr phy controller ARM: at91: pm: add sama7g5 ddr controller ARM: at91: pm: wait for ddr power mode off ARM: at91: pm: add support for 2.5V LDO regulator control ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes ARM: at91: pm: add self-refresh support for sama7g5 ARM: at91: ddr: add registers definitions for sama7g5's ddr ARM: at91: sfrbu: add sfrbu registers definitions for sama7g5 ARM: at91: pm: add support for waiting MCK1..4 ARM: at91: pm: s/CONFIG_SOC_SAM9X60/CONFIG_HAVE_AT91_SAM9X60_PLL/g ARM: at91: pm: avoid push and pop on stack while memory is in self-refersh ARM: at91: pm: use r7 instead of tmp1 ARM: at91: pm: do not initialize pdev ARM: at91: pm: check for different controllers in at91_pm_modes_init() ... Link: https://lore.kernel.org/r/20210804084316.12641-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 55bccf1f93e4bf1b3209cc8648ab53f10f4601a5 Author: Peter Zijlstra Date: Thu Jul 29 16:17:20 2021 +0200 Documentation/atomic_t: Document forward progress expectations Add a few words on forward progress; there's been quite a bit of confusion on the subject. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Acked-by: Boqun Feng Link: https://lkml.kernel.org/r/YQK9ziyogxTH0m9H@hirez.programming.kicks-ass.net commit 9248e52fec9536590852844b0634b5d20483c1ab Author: Mark Rutland Date: Wed Jul 21 16:58:13 2021 +0100 locking/atomic: simplify non-atomic wrappers Since the non-atomic arch_*() bitops use plain accesses, they are implicitly instrumnted by the compiler, and we work around this in the instrumented wrappers to avoid double instrumentation. It's simpler to avoid the wrappers entirely, and use the preprocessor to alias the arch_*() bitops to their regular versions, removing the need for checks in the instrumented wrappers. Suggested-by: Marco Elver Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marco Elver Link: https://lore.kernel.org/r/20210721155813.17082-1-mark.rutland@arm.com commit 56498cfb045d7147cdcba33795d19429afcd1d00 Author: Mel Gorman Date: Wed Aug 4 12:58:57 2021 +0100 sched/fair: Avoid a second scan of target in select_idle_cpu When select_idle_cpu starts scanning for an idle CPU, it starts with a target CPU that has already been checked by select_idle_sibling. This patch starts with the next CPU instead. Signed-off-by: Mel Gorman Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210804115857.6253-3-mgorman@techsingularity.net commit 89aafd67f28c9e3b725aa30b44b7f61ad3e348ce Author: Mel Gorman Date: Wed Aug 4 12:58:56 2021 +0100 sched/fair: Use prev instead of new target as recent_used_cpu After select_idle_sibling, p->recent_used_cpu is set to the new target. However on the next wakeup, prev will be the same as recent_used_cpu unless the load balancer has moved the task since the last wakeup. It still works, but is less efficient than it could be. This patch preserves recent_used_cpu for longer. The impact on SIS efficiency is tiny so the SIS statistic patches were used to track the hit rate for using recent_used_cpu. With perf bench pipe on a 2-socket Cascadelake machine, the hit rate went from 57.14% to 85.32%. For more intensive wakeup loads like hackbench, the hit rate is almost negligible but rose from 0.21% to 6.64%. For scaling loads like tbench, the hit rate goes from almost 0% to 25.42% overall. Broadly speaking, on tbench, the success rate is much higher for lower thread counts and drops to almost 0 as the workload scales to towards saturation. Signed-off-by: Mel Gorman Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210804115857.6253-2-mgorman@techsingularity.net commit 7ad721bf10718a4e480a27ded8bb16b8f6feb2d1 Author: Quentin Perret Date: Tue Jul 27 11:11:02 2021 +0100 sched: Don't report SCHED_FLAG_SUGOV in sched_getattr() SCHED_FLAG_SUGOV is supposed to be a kernel-only flag that userspace cannot interact with. However, sched_getattr() currently reports it in sched_flags if called on a sugov worker even though it is not actually defined in a UAPI header. To avoid this, make sure to clean-up the sched_flags field in sched_getattr() before returning to userspace. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210727101103.2729607-3-qperret@google.com commit f95091536f78971b269ec321b057b8d630b0ad8a Author: Quentin Perret Date: Tue Jul 27 11:11:01 2021 +0100 sched/deadline: Fix reset_on_fork reporting of DL tasks It is possible for sched_getattr() to incorrectly report the state of the reset_on_fork flag when called on a deadline task. Indeed, if the flag was set on a deadline task using sched_setattr() with flags (SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS), then p->sched_reset_on_fork will be set, but __setscheduler() will bail out early, which means that the dl_se->flags will not get updated by __setscheduler_params()->__setparam_dl(). Consequently, if sched_getattr() is then called on the task, __getparam_dl() will override kattr.sched_flags with the now out-of-date copy in dl_se->flags and report the stale value to userspace. To fix this, make sure to only copy the flags that are relevant to sched_deadline to and from the dl_se->flags field. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210727101103.2729607-2-qperret@google.com commit f912d051619d11411867f642d2004928eb0b41b1 Author: Wang Hui Date: Wed Jul 21 17:11:09 2021 +0800 sched: remove redundant on_rq status change activate_task/deactivate_task will change on_rq status, no need to do it again. Signed-off-by: Wang Hui Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210721091109.1406043-1-john.wanghui@huawei.com commit 1c6829cfd3d5124b125e6df41158665aea413b35 Author: Mika Penttilä Date: Thu Jul 22 09:39:46 2021 +0300 sched/numa: Fix is_core_idle() Use the loop variable instead of the function argument to test the other SMT siblings for idle. Fixes: ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks") Signed-off-by: Mika Penttilä Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Acked-by: Pankaj Gupta Link: https://lkml.kernel.org/r/20210722063946.28951-1-mika.penttila@gmail.com commit bfee75f73c37a2f46a6326eaa06f5db701f76f01 Author: Mansur Alisha Shaik Date: Thu Jul 29 13:30:40 2021 +0200 media: venus: venc: add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control Add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control for H264 high profile and constrained high profile. Signed-off-by: Mansur Alisha Shaik Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit f7a3d3dc5831df6f898a5ae2a6ea1d221ea95c8a Author: Stanimir Varbanov Date: Tue Jun 22 13:39:58 2021 +0200 media: venus: venc: Add support for intra-refresh period Add support for intra-refresh period v4l2 control and drop cyclic intra-refresh macroblock control in the same time. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 9d5adeecc409365e45cd89657f0392d0dd5c217f Author: Stanimir Varbanov Date: Tue Jun 22 13:39:57 2021 +0200 media: v4l2-ctrls: Add intra-refresh period control Add a control to set intra-refresh period. Acked-by: Hans Verkuil Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit ea9f91199ca99dd9b3fba004b7614eed233ba1ac Author: Stanimir Varbanov Date: Tue Jun 22 13:39:56 2021 +0200 media: docs: ext-ctrls-codec: Document cyclic intra-refresh zero control value In all drivers _CYCLIC_INTRA_REFRESH_MB default control value is zero which means that the macroblocks will not be intra-refreshed. Document this _CYCLIC_INTRA_REFRESH_MB control behaviour in control description. Acked-by: Hans Verkuil Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 1ac61faf6ebbce59fccbb53d7faf25576e9897ab Author: Mansur Alisha Shaik Date: Tue Jul 6 18:21:22 2021 +0200 media: venus: helper: do not set constrained parameters for UBWC Plane constraints firmware interface is to override the default alignment for a given color format. By default venus hardware has alignments as 128x32, but NV12 was defined differently to meet various usecases. Compressed NV12 has always been aligned as 128x32, hence not needed to override the default alignment. Fixes: bc28936bbba9 ("media: venus: helpers, hfi, vdec: Set actual plane constraints to FW") Signed-off-by: Mansur Alisha Shaik Reviewed-by: Bryan O'Donoghue Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 09ea9719a423fc675d40dd05407165e161ea0c48 Author: Colin Ian King Date: Fri Jul 9 14:30:25 2021 +0200 media: venus: venc: Fix potential null pointer dereference on pointer fmt Currently the call to find_format can potentially return a NULL to fmt and the nullpointer is later dereferenced on the assignment of pixmp->num_planes = fmt->num_planes. Fix this by adding a NULL pointer check and returning NULL for the failure case. Addresses-Coverity: ("Dereference null return") Fixes: aaaa93eda64b ("[media] media: venus: venc: add video encoder files") Signed-off-by: Colin Ian King Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 331e06bbde5856059b7a6bb183f12878ed4decb1 Author: Zhen Lei Date: Wed Jul 7 09:45:17 2021 +0200 media: venus: hfi: fix return value check in sys_get_prop_image_version() In case of error, the function qcom_smem_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d566e78dd6af ("media: venus : hfi: add venus image info into smem") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 38367073c796a37a61549b1f66a71b3adb03802d Author: Evgeny Novikov Date: Wed Jul 28 16:44:32 2021 +0200 media: tegra-cec: Handle errors of clk_prepare_enable() tegra_cec_probe() and tegra_cec_resume() ignored possible errors of clk_prepare_enable(). The patch fixes this. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c8b263937c489ec536193bbe48d810118a387e12 Author: Deborah Brouwer Date: Wed Jul 28 07:56:16 2021 +0200 media: cec-pin: rename timer overrun variables The cec pin timer overruns are measured in microseconds, but the variable names include the millisecond symbol "ms". To avoid confusion, replace "ms" with "us" in the variable names and printed status message. Signed-off-by: Deborah Brouwer Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5cdd19bbad75f6cf1c44ac494b92a3b8d8826001 Author: Krzysztof Hałasa Date: Mon Jul 26 12:49:30 2021 +0200 media: TDA1997x: report -ENOLINK after disconnecting HDMI source The TD1997x chip retains vper, hper and hsper register values when the HDMI source is disconnected. Use a different means of checking if the link is still valid. Signed-off-by: Krzysztof Hałasa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7dee1030871a48d4f3c5a74227a4b4188463479a Author: Krzysztof Hałasa Date: Mon Jul 26 12:46:28 2021 +0200 media: TDA1997x: fix tda1997x_query_dv_timings() return value Correctly propagate the tda1997x_detect_std error value. Signed-off-by: Krzysztof Hałasa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 95d453661172db82ddf2a1864b0ab41ff7725e03 Author: Krzysztof Hałasa Date: Mon Jul 26 12:42:49 2021 +0200 media: Fix cosmetic error in TDA1997x driver The colon isn't followed by anything here. Signed-off-by: Krzysztof Hałasa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4108b3e6db31acc4c68133290bbcc87d4db905c9 Author: Hans Verkuil Date: Fri Jul 23 10:22:59 2021 +0200 media: v4l2-dv-timings.c: fix wrong condition in two for-loops These for-loops should test against v4l2_dv_timings_presets[i].bt.width, not if i < v4l2_dv_timings_presets[i].bt.width. Luckily nothing ever broke, since the smallest width is still a lot higher than the total number of presets, but it is wrong. The last item in the presets array is all 0, so the for-loop must stop when it reaches that sentinel. Signed-off-by: Hans Verkuil Reported-by: Krzysztof Hałasa Signed-off-by: Mauro Carvalho Chehab commit f33fd8d77dd0095b8841542584ba30d26625f8cb Author: Martin Kepplinger Date: Wed Jul 28 11:12:44 2021 +0200 media: imx: add a driver for i.MX8MQ mipi csi rx phy and controller Add a driver to support the i.MX8MQ MIPI CSI receiver. The hardware side is based on https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/imx8/mxc-mipi-csi2_yav.c?h=imx_5.4.70_2.3.0 It's built as part of VIDEO_IMX7_CSI because that's documented to support i.MX8M platforms. This driver adds i.MX8MQ support where currently only the i.MX8MM platform has been supported. Signed-off-by: Martin Kepplinger Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 37255747ecbd691a0050109e8c2133096f4dab50 Author: Martin Kepplinger Date: Wed Jul 28 11:12:43 2021 +0200 media: dt-bindings: media: document the nxp,imx8mq-mipi-csi2 receiver phy and controller The i.MX8MQ SoC integrates a different MIPI CSI receiver as the i.MX8MM so describe the DT bindings for it. Signed-off-by: Martin Kepplinger Reviewed-by: Rob Herring Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 43c3f12dfbbda169b06715bf0b090ca1b1201058 Author: Tom Rix Date: Mon May 31 19:43:00 2021 +0200 media: imx: imx7_mipi_csis: convert some switch cases to the default Static analysis reports this false positive imx7-mipi-csis.c:1027:2: warning: 4th function call argument is an uninitialized value The variable 'align' is falsely reported as uninitialized. Even though all the cases are covered in the switch (csis_fmt->width % 8) { Because there is no default case, it is reported as uninialized. Improve the switch by converting the most numerous set of cases to the default and silence the false positive. Signed-off-by: Tom Rix Reviewed-by: Rui Miguel Silva Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 0ada1697ed4256b38225319c9896661142a3572d Author: Laurent Pinchart Date: Wed May 12 01:44:40 2021 +0200 media: imx: imx7-media-csi: Fix buffer return upon stream start failure When the stream fails to start, the first two buffers in the queue have been moved to the active_vb2_buf array and are returned to vb2 by imx7_csi_dma_unsetup_vb2_buf(). The function is called with the buffer state set to VB2_BUF_STATE_ERROR unconditionally, which is correct when stopping the stream, but not when the start operation fails. In that case, the state should be set to VB2_BUF_STATE_QUEUED. Fix it. Signed-off-by: Laurent Pinchart Tested-by: Martin Kepplinger Reviewed-by: Rui Miguel Silva Signed-off-by: Mauro Carvalho Chehab commit 8b226173a1e9ea1b77dabb3d5583d376c53164c3 Author: Laurent Pinchart Date: Wed Feb 3 03:57:18 2021 +0100 media: imx: imx7-media-csi: Don't set PIXEL_BIT in CSICR1 The PIXEL_BIT field of the CSICR1 register is documented as setting the Bayer data width to 10 bits, and is set by the driver for all non-YUV pixel formats. Test code from NXP showed that the bit shouldn't be set for Bayer formats, and this was confirmed by experimentation with RAW8 capture (which doesn't work when setting the field) and RAW10 capture (for which setting the field doesn't seem to make a difference) on i.MX8MM with an OV5640 sensor connected over CSI-2. Don't set it. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva Tested-by: Martin Kepplinger Signed-off-by: Mauro Carvalho Chehab commit a581c87c681c6202403d74e8e816968841afe2f7 Author: Laurent Pinchart Date: Wed Feb 3 04:08:19 2021 +0100 media: imx: imx7-media-csi: Set TWO_8BIT_SENSOR for >= 10-bit formats Sample code from NXP, as well as experiments on i.MX8MM with RAW10 capture with an OV5640 sensor connected over CSI-2, showed that the TWO_8BIT_SENSOR field of the CSICR3 register needs to be set for formats larger than 8 bits. Do so, even if the reference manual doesn't clearly describe the effect of the field. Signed-off-by: Laurent Pinchart Tested-by: Martin Kepplinger Reviewed-by: Rui Miguel Silva Signed-off-by: Mauro Carvalho Chehab commit e8713c31f8adab67155e245a217d0c7cad05fcf5 Author: Laurent Pinchart Date: Mon Apr 12 04:32:48 2021 +0200 media: dt-bindings: media: nxp,imx7-csi: Add i.MX8MM support The i.MX8MM integrates a CSI bridge IP core, as the i.MX7. There seems to be no difference between the two SoCs according to the reference manual, but as documentation may not be accurate, add a compatible string for the i.MX8MM, with a fallback on the compatible i.MX7. Signed-off-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab commit f809665ee75fff3f4ea8907f406a66d380aeb184 Author: Umang Jain Date: Fri Jul 23 13:22:33 2021 +0200 media: imx258: Limit the max analogue gain to 480 The range for analog gain mentioned in the datasheet is [0, 480]. The real gain formula mentioned in the datasheet is: Gain = 512 / (512 – X) Hence, values larger than 511 clearly makes no sense. The gain register field is also documented to be of 9-bits in the datasheet. Certainly, it is enough to infer that, the kernel driver currently advertises an arbitrary analog gain max. Fix it by rectifying the value as per the data sheet i.e. 480. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 51f93add3669f1b1f540de1cf397815afbd4c756 Author: Laurent Pinchart Date: Fri Jul 23 13:22:32 2021 +0200 media: imx258: Rectify mismatch of VTS value The frame_length_lines (0x0340) registers are hard-coded as follows: - 4208x3118 frame_length_lines = 0x0c50 - 2104x1560 frame_length_lines = 0x0638 - 1048x780 frame_length_lines = 0x034c The driver exposes the V4L2_CID_VBLANK control in read-only mode and sets its value to vts_def - height, where vts_def is a mode-dependent value coming from the supported_modes array. It is set using one of the following macros defined in the driver: #define IMX258_VTS_30FPS 0x0c98 #define IMX258_VTS_30FPS_2K 0x0638 #define IMX258_VTS_30FPS_VGA 0x034c There's a clear mismatch in the value for the full resolution mode i.e. IMX258_VTS_30FPS. Fix it by rectifying the macro with the value set for the frame_length_lines register as stated above. Signed-off-by: Laurent Pinchart Signed-off-by: Umang Jain Reviewed-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d84a2e4900ff43daba4e19b0a7cc56326fe8642a Author: Bingbu Cao Date: Tue Jul 6 11:18:49 2021 +0200 media: ov8856: ignore gpio and regulator for ov8856 with ACPI For ov8856 working with ACPI, it does not depend on the reset gpio and regulator to do reset and power control, so should get the gpio and regulator for non-ACPI cases only, otherwise it will break ov8856 with ACPI. [Sakari Ailus: Wrap a line over 80 chars.] Signed-off-by: Bingbu Cao Signed-off-by: Tianshu Qiu Cc: Robert Foss Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0e2b8552660c5e3f9416c252e42632e780cdbb7b Author: Bingbu Cao Date: Mon Jul 5 09:14:15 2021 +0200 media: ov9734: use group write for digital gain As the RGB digital gains of ov9734 were not applied as group, some artifacts were observed in low light environment, use group write for digital gain can make the RGB digital can be guaranteed to applied together at frame boundary. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 84363509c72588bdbdfdd8503eb173a9b9a798f0 Author: Bingbu Cao Date: Mon Jul 5 08:50:59 2021 +0200 media: ov2740: use group write for digital gain As the RGB digital gains of ov2740 were not applied as group, some artifacts were observed in low light environment, use group write for digital gain can make the RGB digital can be guaranteed to applied together at frame boundary. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4d7adf0236c18befcac449fa1938e32f4bd1ddad Author: Sakari Ailus Date: Thu Jun 24 14:32:02 2021 +0200 media: v4l2-flash: Check whether setting LED brightness succeeded Setting LED brightness may return an error but the return value was never checked by the V4L2 flash LED class. Do it now. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a40eba9b26f70c7a967647a05ce0ef84e82140ba Author: Sakari Ailus Date: Thu Jun 24 14:05:24 2021 +0200 media: v4l2-flash: Add sanity checks for flash and indicator controls The V4L2 flash API supports combinations of indicator and flash LEDs. Due to this, there's a fair amount of code that deals with all the possible options and just reading one part of the file doesn't really tell which combinations are really possible. Make the checks more explicit to keep static analysers happy and to make the code more resilient to future mishaps. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 41a95d043fa59e99ce4440c38640576232ef5f74 Author: Sakari Ailus Date: Wed Jun 23 16:20:50 2021 +0200 media: ccs: Implement support for manual LP control Use the pre_streamon callback to transition the transmitter to either LP-11 or LP-111 mode if supported by the sensor. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 253171a0da67304f0ee7358b37df7b715c65dd77 Author: Sakari Ailus Date: Wed Jun 23 14:44:28 2021 +0200 media: v4l: subdev: Add pre_streamon and post_streamoff callbacks Add pre_streamon and post_streamoff callbacks that can be used to set a CSI-2 transmitter to LP-11 or LP-111 mode. This can be used by receiver drivers to reliably initialise the receiver when its initialisation requires software involvement. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 013c35b22e6216b0bde04a1fc3a1a4b599a4e13f Author: Sakari Ailus Date: Wed Jun 23 14:38:31 2021 +0200 media: Documentation: v4l: Rework LP-11 documentation, add callbacks Rework LP-11 and LP-111 mode documentation to make it more understandable and useful. This involves adding pre_streamon and post_streamon callbacks that make it possible to explicitly transition the transmitter to either mode. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e5a466d4bcf962daa8fea589b09a5675bda275a1 Author: Sakari Ailus Date: Tue Jun 22 13:17:20 2021 +0200 media: Documentation: v4l: Improve frame rate configuration documentation Improve the documentation of the frame rate configuration so that it can be understood by a regular human being. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8925b53083980057de99599ba8dd2a72b03406a6 Author: Sakari Ailus Date: Tue Jun 22 12:52:03 2021 +0200 media: Documentation: v4l: Fix V4L2_CID_PIXEL_RATE documentation The V4L2_CID_PIXEL_RATE is nowadays used to tell pixel sampling rate in the sub-device's pixel array, not the pixel rate over a link (for which it also becomes unfit with the addition of multiplexed streams later on). Fix this. Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Reviewed-by: Andrey Konovalov Signed-off-by: Mauro Carvalho Chehab commit 6f8f9fdec8e4615a2cf539bbcad400d4b3a39070 Author: Sakari Ailus Date: Mon Feb 8 11:33:14 2021 +0100 media: Documentation: media: Fix v4l2-async kerneldoc syntax Fix kerneldoc syntax in v4l2-async. The references were not produced correctly. Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit b9a543364299e09ba236c69acb021ebbf7cebf1a Author: Sakari Ailus Date: Mon Feb 1 10:16:03 2021 +0100 media: Documentation: media: Improve camera sensor documentation Modernise the documentation to make it more precise and update the use of pixel rate control and various other changes. In particular: - Use non-proportional font for file names, properties as well as controls. - The unit of the HBLANK control is pixels, not lines. - The unit of PIXEL_RATE control is pixels per second, not Hz. - Merge common requirements for CSI-2 and parallel busses. - Include all DT properties needed for assigned clocks. - Fix referencing the link rate control. - SMIA driver's new name is CCS driver. - The PIXEL_RATE control denotes pixel rate on the pixel array on camera sensors. Do not suggest it is used to tell the maximum pixel rate on the bus anymore. - Improve ReST syntax (plain struct and function names). - Remove the suggestion to use s_power() in receiver drivers. - Make MIPI website URL use HTTPS, add Wikipedia links to BT.601 and BT.656. Fixes: e4cf8c58af75 ("media: Documentation: media: Document how to write camera sensor drivers") Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Reviewed-by: Andrey Konovalov Signed-off-by: Mauro Carvalho Chehab commit 0368e7d2cd84a90d0518753fac33795e13df553f Author: Wei Yongjun Date: Wed Apr 7 16:37:33 2021 +0200 media: omap3isp: Fix missing unlock in isp_subdev_notifier_complete() Add the missing unlock before return from function isp_subdev_notifier_complete() in the init error handling case. Fixes: ba689d933361 ("media: omap3isp: Acquire graph mutex for graph traversal") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e006558fa4737d6d123ec2c1a0f1a8a42f2199b3 Author: Zhen Lei Date: Thu Jun 3 09:06:13 2021 +0200 media: exynos4-is: use DEVICE_ATTR_RW() helper macro Use DEVICE_ATTR_RW() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the names of the read and write functions of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9256de06942c703e22d61ad73458b52263857157 Author: Zhen Lei Date: Thu Jun 3 09:17:50 2021 +0200 media: i2c: use DEVICE_ATTR_RO() helper macro Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the name of the read function of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5fca4169f5bd8dce5f49123196fb97db52d25a99 Author: Zhen Lei Date: Thu Jun 3 09:15:29 2021 +0200 media: i2c: et8ek8: use DEVICE_ATTR_RO() helper macro Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the name of the read function of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei Acked-by: Pavel Machek Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7b537f290a9a9039d10d8f6da45e21018cc18cb2 Author: Zhen Lei Date: Thu Jun 3 09:12:49 2021 +0200 media: mc-device.c: use DEVICE_ATTR_RO() helper macro Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the name of the read function of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1536fbdbcb7f6bf0442c5158fbda9c73cf706f74 Author: Xavier Roumegue Date: Fri Jun 18 09:59:33 2021 +0200 media: ov5640: Complement yuv mbus formats with their 1X16 versions According to media bus pixel codes definition, data formats on serial busses should be described with one bus sample per pixel. Documentation/userspace-api/media/v4l/subdev-formats.rst states: "The media bus pixel codes document parallel formats. Should the pixel data be transported over a serial bus, the media bus pixel code that describes a parallel format that transfers a sample on a single clock cycle is used. For instance, both MEDIA_BUS_FMT_BGR888_1X24 and MEDIA_BUS_FMT_BGR888_3X8 are used on parallel busses for transferring an 8 bits per sample BGR data, whereas on serial busses the data in this format is only referred to using MEDIA_BUS_FMT_BGR888_1X24. This is because there is effectively only a single way to transport that format on the serial busses." Some MIPI CSI receivers strictly obey this definition and declare support for only *1X_* formats. Hence, complement the supported media bus formats with their 1X16 versions (currently applicable to yuyv, uyvy) to enhance interoperability with CSI receivers. Signed-off-by: Xavier Roumegue Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 14ea315bbeb75aa996b577822999df4edbcfb3d0 Author: Martina Krasteva Date: Thu May 27 16:21:45 2021 +0200 media: i2c: Add ov9282 camera sensor driver Add a v4l2 sub-device driver for the OmniVisison ov9282 black&white image sensor. The camera sensor uses the i2c bus for control and the csi-2 bus for data. The following features are supported: - manual exposure and analog gain control support - vblank/hblank/pixel rate/link freq control support - supported resolution: - 1280x720 @ 30fps [Sakari Ailus: Rebase on commit c802a4174beeb25cb539c806c9d0d3c0f61dfa53.] Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4874ea39874731e589dc5b329f5c03965c2a6474 Author: Martina Krasteva Date: Thu May 27 16:21:44 2021 +0200 media: dt-bindings: media: Add bindings for ov9282 - Add dt-bindings documentation for OmniVision ov9282 sensor driver - Add MAINTAINERS entry for OmniVision ov9282 binding documentation Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9214e86c0cc1ea6c811f14c293fed9ce1baefbae Author: Martina Krasteva Date: Thu May 27 16:21:43 2021 +0200 media: i2c: Add imx412 camera sensor driver Add a v4l2 sub-device driver for the Sony imx412 image sensor. This is a camera sensor using the i2c bus for control and the csi-2 bus for data. The following features are supported: - manual exposure and analog gain control support - vblank/hblank/pixel rate/link freq control support - supported resolution: - 4056x3040 @ 30fps - supported bayer order output: - SRGGB10 [Sakari Ailus: Rebase on commit c802a4174beeb25cb539c806c9d0d3c0f61dfa53.] Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 333b3125d1300e9a06e537295b9eb6042d131492 Author: Martina Krasteva Date: Thu May 27 16:21:42 2021 +0200 media: dt-bindings: media: Add bindings for imx412 - Add dt-bindings documentation for Sony imx412 sensor driver - Add MAINTAINERS entry for Sony imx412 binding documentation Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 45d19b5fb9aeab4d0c8aa20ad8f67205b3bea752 Author: Martina Krasteva Date: Thu May 27 16:21:41 2021 +0200 media: i2c: Add imx335 camera sensor driver Add a v4l2 sub-device driver for the Sony imx335 image sensor. ThE camera sensor uses the i2c bus for control and the csi-2 bus for data. The following features are supported: - manual exposure and analog gain control support - vblank/hblank/pixel rate/link freq control support - supported resolution: - 2592x1940 @ 30fps - supported bayer order output: - SRGGB12 [Sakari Ailus: Rebase on commit c802a4174beeb25cb539c806c9d0d3c0f61dfa53.] Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 932741d451a57819af4e316f9818ff363ac1f02a Author: Martina Krasteva Date: Thu May 27 16:21:40 2021 +0200 media: dt-bindings: media: Add bindings for imx335 - Add dt-bindings documentation for Sony imx335 sensor driver - Add MAINTAINERS entry for Sony imx335 binding documentation Signed-off-by: Martina Krasteva Acked-by: Daniele Alessandrelli Acked-by: Paul J. Murphy Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit c3609c45b7c207e176bbea3dfc2241c5cc2cf746 Author: Paul Kocialkowski Date: Wed Jun 9 13:54:56 2021 +0200 media: v4l2-subdev: Fix documentation of the subdev_notifier member Fix the name of the function that registers the subdev_notifier member of the v4l2_subdev structure. [Sakari Ailus: Drop _sensor from the function name.] Signed-off-by: Paul Kocialkowski Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6fa54bc713c262e1cfbc5613377ef52280d7311f Author: Dongliang Mu Date: Wed Jul 7 11:34:09 2021 +0200 media: em28xx-input: fix refcount bug in em28xx_usb_disconnect If em28xx_ir_init fails, it would decrease the refcount of dev. However, in the em28xx_ir_fini, when ir is NULL, it goes to ref_put and decrease the refcount of dev. This will lead to a refcount bug. Fix this bug by removing the kref_put in the error handling code of em28xx_ir_init. refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 7 at lib/refcount.c:28 refcount_warn_saturate+0x18e/0x1a0 lib/refcount.c:28 Modules linked in: CPU: 0 PID: 7 Comm: kworker/0:1 Not tainted 5.13.0 #3 Workqueue: usb_hub_wq hub_event RIP: 0010:refcount_warn_saturate+0x18e/0x1a0 lib/refcount.c:28 Call Trace: kref_put.constprop.0+0x60/0x85 include/linux/kref.h:69 em28xx_usb_disconnect.cold+0xd7/0xdc drivers/media/usb/em28xx/em28xx-cards.c:4150 usb_unbind_interface+0xbf/0x3a0 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1201 [inline] device_release_driver_internal+0x22a/0x230 drivers/base/dd.c:1232 bus_remove_device+0x108/0x160 drivers/base/bus.c:529 device_del+0x1fe/0x510 drivers/base/core.c:3540 usb_disable_device+0xd1/0x1d0 drivers/usb/core/message.c:1419 usb_disconnect+0x109/0x330 drivers/usb/core/hub.c:2221 hub_port_connect drivers/usb/core/hub.c:5151 [inline] hub_port_connect_change drivers/usb/core/hub.c:5440 [inline] port_event drivers/usb/core/hub.c:5586 [inline] hub_event+0xf81/0x1d40 drivers/usb/core/hub.c:5668 process_one_work+0x2c9/0x610 kernel/workqueue.c:2276 process_scheduled_works kernel/workqueue.c:2338 [inline] worker_thread+0x333/0x5b0 kernel/workqueue.c:2424 kthread+0x188/0x1d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Reported-by: Dongliang Mu Fixes: ac5688637144 ("media: em28xx: Fix possible memory leak of em28xx struct") Signed-off-by: Dongliang Mu Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 49be1c78d575eedf862a05aebfd5ab5c24193f61 Author: Viktor Prutyanov Date: Mon Jul 19 19:05:06 2021 +0200 media: rc: introduce Meson IR TX driver This patch adds the driver for Amlogic Meson IR transmitter. Some Amlogic SoCs such as A311D and T950D4 have IR transmitter (also called blaster) controller onboard. It is capable of sending IR signals with arbitrary carrier frequency and duty cycle. The driver supports 2 modulation clock sources: - xtal3 clock (xtal divided by 3) - 1us clock Signed-off-by: Viktor Prutyanov Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit e9f504f7b585c822b4c7d42bbbf18bbdd0241df4 Author: Viktor Prutyanov Date: Mon Jul 19 19:05:05 2021 +0200 media: rc: meson-ir-tx: document device tree bindings This patch adds binding documentation for the IR transmitter available in Amlogic Meson SoCs. Signed-off-by: Viktor Prutyanov Acked-by: Martin Blumenstingl Reviewed-by: Rob Herring Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 8e816b9915a136c12ab726e92412b917d7e514f7 Merge: 72ee3b4dc2c8c 818c4593434e8 Author: Arnd Bergmann Date: Wed Aug 4 14:31:30 2021 +0200 Merge tag 'at91-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 dt for 5.15: - add sama7g5 SoC and associated evaluation kit, the sama7g5-ek - adaptation of some DT for sama5d27 som1 ek, sama5d4 xplained and sama5d2 icp boards - fixes to gpio and shutdown controller nodes for all boards * tag 'at91-dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: use the right property for shutdown controller ARM: dts: at91: sama5d2_icp: enable digital filter for I2C nodes ARM: dts: at91: sama5d4_xplained: change the key code of the gpio key ARM: dts: at91: add conflict note for d3 ARM: dts: at91: add pinctrl-{names, 0} for all gpios ARM: dts: at91: sama5d27_som1_ek: enable ADC node ARM: dts: at91: sama5d4_xplained: Remove spi0 node dt-bindings: atmel-sysreg: add bindings for sama7g5 ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek dt-bindings: ARM: at91: document sama7g5ek board Link: https://lore.kernel.org/r/20210804085000.13233-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 72ee3b4dc2c8c56aca2608a0c04d0eedaf6fdc67 Merge: c4994975132eb fe2fc0fd37937 Author: Arnd Bergmann Date: Wed Aug 4 14:30:26 2021 +0200 Merge tag 'ux500-dts-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt Ux500 Device Tree updates for the v5.15 kernel cycle: - New device trees for these mobile phones: - Samsung Gavini - Samsung Codina - Samsung Kyle - Flag eMMC cards as non-SD non-SDIO to save time - Link USB PHY to USB controller in the device tree - Fix up the operating points to the actual clock frequencies * tag 'ux500-dts-v5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ux500: Adjust operating points to reality ARM: dts: ux500: Add a device tree for Kyle ARM: dts: ux500: Add devicetree for Codina ARM: dts: ux500: ab8500: Link USB PHY to USB controller node ARM: dts: ux500: Flag eMMCs as non-SDIO/SD ARM: dts: ux500: Add device tree for Samsung Gavini Link: https://lore.kernel.org/r/CACRpkdbjBv5ywZZD8rK07d5sLcHsG8o4iYD-3jHO=HLg6-nKnA@mail.gmail.com Signed-off-by: Arnd Bergmann commit f2553d46783409656d82e46913354ed0c058cc0c Author: Takashi Iwai Date: Wed Aug 4 09:52:23 2021 +0200 ASoC: amd: vangogh: Drop superfluous mmap callback The mmap callback of vangogh driver just calls the default mmap handler, and it's superfluous, as the PCM core would call it if not set. Let's drop the superfluous mmap callback. Fixes: 361414dc1f07 ("ASoC: amd: add vangogh i2s dma driver pm ops") Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20210804075223.9823-1-tiwai@suse.de Signed-off-by: Mark Brown commit 47e6223c841e029bfc23c3ce594dac5525cebaf8 Author: Marc Zyngier Date: Mon Aug 2 13:38:30 2021 +0100 KVM: arm64: Unregister HYP sections from kmemleak in protected mode Booting a KVM host in protected mode with kmemleak quickly results in a pretty bad crash, as kmemleak doesn't know that the HYP sections have been taken away. This is specially true for the BSS section, which is part of the kernel BSS section and registered at boot time by kmemleak itself. Unregister the HYP part of the BSS before making that section HYP-private. The rest of the HYP-specific data is obtained via the page allocator or lives in other sections, none of which is subjected to kmemleak. Fixes: 90134ac9cabb ("KVM: arm64: Protect the .hyp sections from the host") Reviewed-by: Quentin Perret Reviewed-by: Catalin Marinas Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org # 5.13 Link: https://lore.kernel.org/r/20210802123830.2195174-3-maz@kernel.org commit eb48d154cd0dade56a0e244f0cfa198ea2925ed3 Author: Marc Zyngier Date: Mon Aug 2 13:38:29 2021 +0100 arm64: Move .hyp.rodata outside of the _sdata.._edata range The HYP rodata section is currently lumped together with the BSS, which isn't exactly what is expected (it gets registered with kmemleak, for example). Move it away so that it is actually marked RO. As an added benefit, it isn't registered with kmemleak anymore. Fixes: 380e18ade4a5 ("KVM: arm64: Introduce a BSS section for use at Hyp") Suggested-by: Catalin Marinas Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org #5.13 Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20210802123830.2195174-2-maz@kernel.org commit e5d9b714fe40270222a7de9dcd1cf62dad63eeef Author: Praveen Kumar Date: Sat Jul 31 17:35:19 2021 +0530 x86/hyperv: fix root partition faults when writing to VP assist page MSR For root partition the VP assist pages are pre-determined by the hypervisor. The root kernel is not allowed to change them to different locations. And thus, we are getting below stack as in current implementation root is trying to perform write to specific MSR. [ 2.778197] unchecked MSR access error: WRMSR to 0x40000073 (tried to write 0x0000000145ac5001) at rIP: 0xffffffff810c1084 (native_write_msr+0x4/0x30) [ 2.784867] Call Trace: [ 2.791507] hv_cpu_init+0xf1/0x1c0 [ 2.798144] ? hyperv_report_panic+0xd0/0xd0 [ 2.804806] cpuhp_invoke_callback+0x11a/0x440 [ 2.811465] ? hv_resume+0x90/0x90 [ 2.818137] cpuhp_issue_call+0x126/0x130 [ 2.824782] __cpuhp_setup_state_cpuslocked+0x102/0x2b0 [ 2.831427] ? hyperv_report_panic+0xd0/0xd0 [ 2.838075] ? hyperv_report_panic+0xd0/0xd0 [ 2.844723] ? hv_resume+0x90/0x90 [ 2.851375] __cpuhp_setup_state+0x3d/0x90 [ 2.858030] hyperv_init+0x14e/0x410 [ 2.864689] ? enable_IR_x2apic+0x190/0x1a0 [ 2.871349] apic_intr_mode_init+0x8b/0x100 [ 2.878017] x86_late_time_init+0x20/0x30 [ 2.884675] start_kernel+0x459/0x4fb [ 2.891329] secondary_startup_64_no_verify+0xb0/0xbb Since the hypervisor already provides the VP assist pages for root partition, we need to memremap the memory from hypervisor for root kernel to use. The mapping is done in hv_cpu_init during bringup and is unmapped in hv_cpu_die during teardown. Signed-off-by: Praveen Kumar Reviewed-by: Sunil Muthuswamy Link: https://lore.kernel.org/r/20210731120519.17154-1-kumarpraveen@linux.microsoft.com Signed-off-by: Wei Liu commit c2eecaa193ff1e516a1b389637169ae86a6fa867 Author: Nick Richardson Date: Tue Aug 3 16:27:35 2021 +0000 pktgen: Remove redundant clone_skb override When the netif_receive xmit_mode is set, a line is supposed to set clone_skb to a default 0 value. This line is made redundant due to a preceding line that checks if clone_skb is more than zero and returns -ENOTSUPP. Overriding clone_skb to 0 does not make any difference to the behavior because if it was positive we return error. So it can be either 0 or negative, and in both cases the behavior is the same. Remove redundant line that sets clone_skb to zero. Signed-off-by: Nick Richardson Signed-off-by: David S. Miller commit 773bda96492153e11d21eb63ac814669b51fc701 Author: Jonathan Lemon Date: Tue Aug 3 20:33:27 2021 -0700 ptp: ocp: Expose various resources on the timecard. The OpenCompute timecard driver has additional functionality besides a clock. Make the following resources available: - The external timestamp channels (ts0/ts1) - devlink support for flashing and health reporting - GPS and MAC serial ports - board serial number (obtained from i2c device) Also add watchdog functionality for when GNSS goes into holdover. The resources are collected under a timecard class directory: [jlemon@timecard ~]$ ls -g /sys/class/timecard/ocp1/ total 0 -r--r--r--. 1 root 4096 Aug 3 19:49 available_clock_sources -rw-r--r--. 1 root 4096 Aug 3 19:49 clock_source lrwxrwxrwx. 1 root 0 Aug 3 19:49 device -> ../../../0000:04:00.0/ -r--r--r--. 1 root 4096 Aug 3 19:49 gps_sync lrwxrwxrwx. 1 root 0 Aug 3 19:49 i2c -> ../../xiic-i2c.1024/i2c-2/ drwxr-xr-x. 2 root 0 Aug 3 19:49 power/ lrwxrwxrwx. 1 root 0 Aug 3 19:49 pps -> ../../../../../virtual/pps/pps1/ lrwxrwxrwx. 1 root 0 Aug 3 19:49 ptp -> ../../ptp/ptp2/ -r--r--r--. 1 root 4096 Aug 3 19:49 serialnum lrwxrwxrwx. 1 root 0 Aug 3 19:49 subsystem -> ../../../../../../class/timecard/ lrwxrwxrwx. 1 root 0 Aug 3 19:49 ttyGPS -> ../../tty/ttyS7/ lrwxrwxrwx. 1 root 0 Aug 3 19:49 ttyMAC -> ../../tty/ttyS8/ -rw-r--r--. 1 root 4096 Aug 3 19:39 uevent The labeling is needed at the minimum, in order to tell the serial devices apart. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller commit 04190bf8944deb7e3ac165a1a494db23aa0160a9 Author: Pavel Tikhomirov Date: Wed Aug 4 10:55:56 2021 +0300 sock: allow reading and changing sk_userlocks with setsockopt SOCK_SNDBUF_LOCK and SOCK_RCVBUF_LOCK flags disable automatic socket buffers adjustment done by kernel (see tcp_fixup_rcvbuf() and tcp_sndbuf_expand()). If we've just created a new socket this adjustment is enabled on it, but if one changes the socket buffer size by setsockopt(SO_{SND,RCV}BUF*) it becomes disabled. CRIU needs to call setsockopt(SO_{SND,RCV}BUF*) on each socket on restore as it first needs to increase buffer sizes for packet queues restore and second it needs to restore back original buffer sizes. So after CRIU restore all sockets become non-auto-adjustable, which can decrease network performance of restored applications significantly. CRIU need to be able to restore sockets with enabled/disabled adjustment to the same state it was before dump, so let's add special setsockopt for it. Let's also export SOCK_SNDBUF_LOCK and SOCK_RCVBUF_LOCK flags to uAPI so that using these interface one can reenable automatic socket buffer adjustment on their sockets. Signed-off-by: Pavel Tikhomirov Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 625af9f0298b72f5dd23460fa01bb77d6f942dcb Author: Peilin Ye Date: Tue Aug 3 15:16:59 2021 -0700 tc-testing: Add control-plane selftests for sch_mq Recently we added multi-queue support to netdevsim in commit d4861fc6be58 ("netdevsim: Add multi-queue support"); add a few control-plane selftests for sch_mq using this new feature. Use nsPlugin.py to avoid network interface name collisions. Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit a54182b2a51886597116b3097a2d2fbf9d9b1a84 Author: Vladimir Oltean Date: Tue Aug 3 23:34:09 2021 +0300 Revert "net: build all switchdev drivers as modules when the bridge is a module" This reverts commit b0e81817629a496854ff1799f6cbd89597db65fd. Explicit driver dependency on the bridge is no longer needed since switchdev_bridge_port_{,un}offload() is no longer implemented by the bridge driver but by switchdev. Signed-off-by: Vladimir Oltean Tested-by: Grygorii Strashko Signed-off-by: David S. Miller commit 957e2235e5264c97cd6be8e2e17f2e11b41f2239 Author: Vladimir Oltean Date: Tue Aug 3 23:34:08 2021 +0300 net: make switchdev_bridge_port_{,unoffload} loosely coupled with the bridge With the introduction of explicit offloading API in switchdev in commit 2f5dc00f7a3e ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded"), we started having Ethernet switch drivers calling directly into a function exported by net/bridge/br_switchdev.c, which is a function exported by the bridge driver. This means that drivers that did not have an explicit dependency on the bridge before, like cpsw and am65-cpsw, now do - otherwise it is not possible to call a symbol exported by a driver that can be built as module unless you are a module too. There was an attempt to solve the dependency issue in the form of commit b0e81817629a ("net: build all switchdev drivers as modules when the bridge is a module"). Grygorii Strashko, however, says about it: | In my opinion, the problem is a bit bigger here than just fixing the | build :( | | In case, of ^cpsw the switchdev mode is kinda optional and in many | cases (especially for testing purposes, NFS) the multi-mac mode is | still preferable mode. | | There were no such tight dependency between switchdev drivers and | bridge core before and switchdev serviced as independent, notification | based layer between them, so ^cpsw still can be "Y" and bridge can be | "M". Now for mostly every kernel build configuration the CONFIG_BRIDGE | will need to be set as "Y", or we will have to update drivers to | support build with BRIDGE=n and maintain separate builds for | networking vs non-networking testing. But is this enough? Wouldn't | it cause 'chain reaction' required to add more and more "Y" options | (like CONFIG_VLAN_8021Q)? | | PS. Just to be sure we on the same page - ARM builds will be forced | (with this patch) to have CONFIG_TI_CPSW_SWITCHDEV=m and so all our | automation testing will just fail with omap2plus_defconfig. In the light of this, it would be desirable for some configurations to avoid dependencies between switchdev drivers and the bridge, and have the switchdev mode as completely optional within the driver. Arnd Bergmann also tried to write a patch which better expressed the build time dependency for Ethernet switch drivers where the switchdev support is optional, like cpsw/am65-cpsw, and this made the drivers follow the bridge (compile as module if the bridge is a module) only if the optional switchdev support in the driver was enabled in the first place: https://patchwork.kernel.org/project/netdevbpf/patch/20210802144813.1152762-1-arnd@kernel.org/ but this still did not solve the fact that cpsw and am65-cpsw now must be built as modules when the bridge is a module - it just expressed correctly that optional dependency. But the new behavior is an apparent regression from Grygorii's perspective. So to support the use case where the Ethernet driver is built-in, NET_SWITCHDEV (a bool option) is enabled, and the bridge is a module, we need a framework that can handle the possible absence of the bridge from the running system, i.e. runtime bloatware as opposed to build-time bloatware. Luckily we already have this framework, since switchdev has been using it extensively. Events from the bridge side are transmitted to the driver side using notifier chains - this was originally done so that unrelated drivers could snoop for events emitted by the bridge towards ports that are implemented by other drivers (think of a switch driver with LAG offload that listens for switchdev events on a bonding/team interface that it offloads). There are also events which are transmitted from the driver side to the bridge side, which again are modeled using notifiers. SWITCHDEV_FDB_ADD_TO_BRIDGE is an example of this, and deals with notifying the bridge that a MAC address has been dynamically learned. So there is a precedent we can use for modeling the new framework. The difference compared to SWITCHDEV_FDB_ADD_TO_BRIDGE is that the work that the bridge needs to do when a port becomes offloaded is blocking in its nature: replay VLANs, MDBs etc. The calling context is indeed blocking (we are under rtnl_mutex), but the existing switchdev notification chain that the bridge is subscribed to is only the atomic one. So we need to subscribe the bridge to the blocking switchdev notification chain too. This patch: - keeps the driver-side perception of the switchdev_bridge_port_{,un}offload unchanged - moves the implementation of switchdev_bridge_port_{,un}offload from the bridge module into the switchdev module. - makes everybody that is subscribed to the switchdev blocking notifier chain "hear" offload & unoffload events - makes the bridge driver subscribe and handle those events - moves the bridge driver's handling of those events into 2 new functions called br_switchdev_port_{,un}offload. These functions contain in fact the core of the logic that was previously in switchdev_bridge_port_{,un}offload, just that now we go through an extra indirection layer to reach them. Unlike all the other switchdev notification structures, the structure used to carry the bridge port information, struct switchdev_notifier_brport_info, does not contain a "bool handled". This is because in the current usage pattern, we always know that a switchdev bridge port offloading event will be handled by the bridge, because the switchdev_bridge_port_offload() call was initiated by a NETDEV_CHANGEUPPER event in the first place, where info->upper_dev is a bridge. So if the bridge wasn't loaded, then the CHANGEUPPER event couldn't have happened. Signed-off-by: Vladimir Oltean Tested-by: Grygorii Strashko Signed-off-by: David S. Miller commit 12c3dca25d2fa17a101de0d80bf3f238b1cecbae Author: Arnd Bergmann Date: Sat Feb 27 13:40:09 2021 +0100 ARM: ep93xx: remove MaverickCrunch support The MaverickCrunch support for ep93xx never made it into glibc and was removed from gcc in its 4.8 release in 2012. It is now one of the last parts of arch/arm/ that fails to build with the clang integrated assembler, which is unlikely to ever want to support it. The two alternatives are to force the use of binutils/gas when building the crunch support, or to remove it entirely. According to Hartley Sweeten: "Martin Guy did a lot of work trying to get the maverick crunch working but I was never able to successfully use it for anything. It "kind" of works but depending on the EP93xx silicon revision there are still a number of hardware bugs that either give imprecise or garbage results. I have no problem with removing the kernel support for the maverick crunch." Unless someone else comes up with a good reason to keep it around, remove it now. This touches mostly the ep93xx platform, but removes a bit of code from ARM common ptrace and signal frame handling as well. If there are remaining users of MaverickCrunch, they can use LTS kernels for at least another five years before kernel support ends. Link: https://lore.kernel.org/linux-arm-kernel/20210802141245.1146772-1-arnd@kernel.org/ Link: https://lore.kernel.org/linux-arm-kernel/20210226164345.3889993-1-arnd@kernel.org/ Link: https://github.com/ClangBuiltLinux/linux/issues/1272 Link: https://gcc.gnu.org/legacy-ml/gcc/2008-03/msg01063.html Cc: "Martin Guy" Signed-off-by: Arnd Bergmann commit f62750e6918d2ac39ffe019249d2247ff0ac308d Author: Om Prakash Singh Date: Wed Jun 23 15:35:25 2021 +0530 PCI: tegra194: Cleanup unused code Remove unused code from function tegra_pcie_config_ep. Link: https://lore.kernel.org/r/20210623100525.19944-6-omp@nvidia.com Signed-off-by: Om Prakash Singh Signed-off-by: Lorenzo Pieralisi Reviewed-by: Bjorn Helgaas Acked-by: Vidya Sagar commit de2bbf2b71bb994b2bbe5965e25dc06df83c5128 Author: Om Prakash Singh Date: Wed Jun 23 15:35:24 2021 +0530 PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode When Tegra PCIe is in endpoint mode it should be available for root port. PCIe link up by root port fails if it is in suspend state. So, don't allow Tegra to suspend when endpoint mode is enabled. Link: https://lore.kernel.org/r/20210623100525.19944-5-omp@nvidia.com Signed-off-by: Om Prakash Singh Signed-off-by: Lorenzo Pieralisi Reviewed-by: Bjorn Helgaas Acked-by: Vidya Sagar commit 834c5cf2b5876f2fa0441a80826a84d4a64f932f Author: Om Prakash Singh Date: Wed Jun 23 15:35:23 2021 +0530 PCI: tegra194: Disable interrupts before entering L2 In suspend_noirq() call if link doesn't goto L2, PERST# is asserted to bring link to detect state. However, this is causing surprise link down AER error. Since Kernel is executing noirq suspend calls, AER interrupt is not processed. PME and AER are shared interrupts and PCIe subsystem driver enables wake capability of PME irq during suspend. So this AER will cause suspend failure due to pending AER interrupt. After PCIe link is in L2, interrupts are not expected since PCIe controller will be in reset state. Disable PCIe interrupts before going to L2 state to avoid pending AER interrupt. Link: https://lore.kernel.org/r/20210623100525.19944-4-omp@nvidia.com Signed-off-by: Om Prakash Singh Signed-off-by: Lorenzo Pieralisi Reviewed-by: Bjorn Helgaas Acked-by: Vidya Sagar commit 43537cf7e351264a1f05ed42ad402942bfc9140e Author: Om Prakash Singh Date: Wed Jun 23 15:35:22 2021 +0530 PCI: tegra194: Fix MSI-X programming Lower order MSI-X address is programmed in MSIX_ADDR_MATCH_HIGH_OFF DBI register instead of higher order address. This patch fixes this programming mistake. Link: https://lore.kernel.org/r/20210623100525.19944-3-omp@nvidia.com Signed-off-by: Om Prakash Singh Signed-off-by: Lorenzo Pieralisi Reviewed-by: Bjorn Helgaas Acked-by: Vidya Sagar commit ceb1412c1c8ca5b28c4252bdb15f2f1f17b4a1b0 Author: Om Prakash Singh Date: Wed Jun 23 15:35:21 2021 +0530 PCI: tegra194: Fix handling BME_CHGED event In tegra_pcie_ep_hard_irq(), APPL_INTR_STATUS_L0 is stored in val and again APPL_INTR_STATUS_L1_0_0 is also stored in val. So when execution reaches "if (val & APPL_INTR_STATUS_L0_PCI_CMD_EN_INT)", val is not correct. Link: https://lore.kernel.org/r/20210623100525.19944-2-omp@nvidia.com Signed-off-by: Om Prakash Singh Signed-off-by: Lorenzo Pieralisi Reviewed-by: Bjorn Helgaas Acked-by: Vidya Sagar commit badc741459f42f51e244533ce1df1cd9ac5ac6d7 Author: Miklos Szeredi Date: Wed Aug 4 13:22:58 2021 +0200 fuse: move option checking into fuse_fill_super() Checking whether the "fd=", "rootmode=", "user_id=" and "group_id=" mount options are present can be moved from fuse_get_tree() into fuse_fill_super() where the value of the options are consumed. This relaxes semantics of reusing a fuse blockdev mount using the device name. Before this patch presence of these options were enforced but values ignored, after this patch these options are completely ignored in this case. Signed-off-by: Miklos Szeredi commit 84c215075b5723ab946708a6c74c26bd3c51114c Author: Miklos Szeredi Date: Wed Aug 4 13:22:58 2021 +0200 fuse: name fs_context consistently Naming convention under fs/fuse/: struct fuse_conn *fc; struct fs_context *fsc; Signed-off-by: Miklos Szeredi commit e1e71c168813564be0f6ea3d6740a059ca42d177 Author: Miklos Szeredi Date: Wed Aug 4 13:22:58 2021 +0200 fuse: fix use after free in fuse_read_interrupt() There is a potential race between fuse_read_interrupt() and fuse_request_end(). TASK1 in fuse_read_interrupt(): delete req->intr_entry (while holding fiq->lock) TASK2 in fuse_request_end(): req->intr_entry is empty -> skip fiq->lock wake up TASK3 TASK3 request is freed TASK1 in fuse_read_interrupt(): dereference req->in.h.unique ***BAM*** Fix by always grabbing fiq->lock if the request was ever interrupted (FR_INTERRUPTED set) thereby serializing with concurrent fuse_read_interrupt() calls. FR_INTERRUPTED is set before the request is queued on fiq->interrupts. Dequeing the request is done with list_del_init() but FR_INTERRUPTED is not cleared in this case. Reported-by: lijiazi Signed-off-by: Miklos Szeredi commit aeaea8969b402e0081210cc9144404d13996efed Author: Rob Herring Date: Tue Aug 3 15:56:56 2021 -0600 PCI: iproc: Fix BCMA probe resource handling In commit 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()"), calling devm_request_pci_bus_resources() was dropped from the common iProc probe code, but is still needed for BCMA bus probing. Without it, there will be lots of warnings like this: pci 0000:00:00.0: BAR 8: no space for [mem size 0x00c00000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x00c00000] Add back calling devm_request_pci_bus_resources() and adding the resources to pci_host_bridge.windows for BCMA bus probe. Link: https://lore.kernel.org/r/20210803215656.3803204-2-robh@kernel.org Fixes: 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()") Reported-by: Rafał Miłecki Tested-by: Rafał Miłecki Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Lorenzo Pieralisi Cc: "Krzysztof Wilczyński" Cc: Bjorn Helgaas commit d277f6e88c88729b1d57d40bbfb00d0bfc961972 Author: Rob Herring Date: Tue Aug 3 15:56:55 2021 -0600 PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' Commit 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on any DT resource parsing errors, but Broadcom iProc uses devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT resources. In particular, there is no 'ranges' property. Fix iProc by making 'ranges' optional. If 'ranges' is required by a platform, there's going to be more errors latter on if it is missing. Link: https://lore.kernel.org/r/20210803215656.3803204-1-robh@kernel.org Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") Reported-by: Rafał Miłecki Tested-by: Rafał Miłecki Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Bjorn Helgaas Cc: Lorenzo Pieralisi commit 9c0532f9cc939b470e7008fdb659f46d463f386b Merge: 51b8f812e5b32 d85165b2381ce Author: David S. Miller Date: Wed Aug 4 11:30:09 2021 +0100 Merge tag 'linux-can-next-for-5.15-20210804' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2021-08-04 this is a pull request of 5 patches for net-next/master. The first patch is by me and fixes a typo in a comment in the CAN J1939 protocol. The next 2 patches are by Oleksij Rempel and update the CAN J1939 protocol to send RX status updates via the error queue mechanism. The next patch is by me and adds a missing variable initialization to the flexcan driver (the problem was introduced in the current net-next cycle). The last patch is by Aswath Govindraju and adds power-domains to the Bosch m_can DT binding documentation. ==================== Signed-off-by: David S. Miller commit 47adef20e67d657696c953f4b8023017c6005c1b Author: Linus Walleij Date: Mon Jul 26 10:44:45 2021 +0200 pata: ixp4xx: Rewrite to use device tree This rewrites the IXP4xx CF (IDE) libata driver to use the device tree exclusively to look up its resources: - Probe exclusively from the device tree and look up all resources from there. - Allocate a local state container with devres and pass this around in .private_data. - Initialize with struct ata_port_info. - Use the .set_piomode() callback instead of the much wider .set_mode(), we only support PIO after all. - Bump driver version number from 0.2 to 1.0 to reflect this wider change. - Get a handle on the expansion bus syscon regmap to alter the timings on the chip select. - Put in the more elaborate timing adjustment code for PIO0 to PIO4 in 8 and 16bit mode from the downstream OpenWrt patch. The board file initialization path and platform data include is dropped because the board files will be deleted at the same time as this patch is merged. The platform data file is not deleted right now so as not to conflict with the removal of board files. Signed-off-by: Linus Walleij commit be470496eece679490dda90ebe497493f4c8faf6 Author: Linus Walleij Date: Tue Jul 27 10:52:10 2021 +0200 pata: ixp4xx: Add DT bindings This adds device tree bindings for the Intel IXP4xx compact flash card interface. Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 8e3d25a6231832a9525f0e0bb6fb4c13df347175 Author: Linus Walleij Date: Mon Jul 26 10:37:55 2021 +0200 pata: ixp4xx: Refer to cmd and ctl rather than csN The two "cs0" and "cs1" are "chip selects" but on some platforms such as GW2358 they are actually both in CS3 making this terminology very confusing. Call the addresses "cmd" and "ctl" after function instead. Signed-off-by: Linus Walleij commit d2b507acc62d9cdeed0885392ae8c33f8f1a109c Author: Linus Walleij Date: Mon Jul 26 01:28:05 2021 +0200 pata: ixp4xx: Use IS_ENABLED() to determine endianness Instead of an ARM-specific ifdef, use the global CPU config and if (IS_ENABLED()). Signed-off-by: Linus Walleij commit f62b38965ad4cdee29912564f666b9a021d1910d Author: Linus Walleij Date: Tue May 11 00:54:41 2021 +0200 pata: ixp4xx: Use local dev variable Let's simplify all &pdev->dev references by creating a local struct device *dev variable. Signed-off-by: Linus Walleij commit 21a0a29d16c672b0c6e3662ea55969dccdbc5547 Author: Linus Walleij Date: Mon Aug 26 16:38:14 2019 +0200 watchdog: ixp4xx: Rewrite driver to use core This rewrites the IXP4xx watchdog driver as follows: - Spawn the watchdog driver as a platform device from the timer driver. It's one device in the hardware, and the fact that Linux splits the handling into two different devices is a Linux pecularity, and thus it becomes a Linux pecularity to spawn a separate watchdog driver. - Spawn the watchdog driver from the timer driver at probe(). This is well after the timer driver as actually registered and started and we know the register base is available. - Instead of looping back callbacks to the timer drivers for all watchdog calls, pass the register base to the watchdog driver and manage the registers there. The two drivers aren't even interested in the same register so the spinlock is totally surplus, delete it. - Replace pretty much all of the content in the watchdog driver with a simple, modern watchdog driver utilizing the watchdog core instead of registering its own misc device and ioctl() handling. - Drop module parameters as the same already exist in the watchdog core. What remains is a slim elegant (IMO) watchdog driver using the watchdog core, spawning from device tree or boardfile alike. Cc: Daniel Lezcano Cc: Thomas Gleixner Reviewed-by: Guenter Roeck Signed-off-by: Linus Walleij commit 1c953bda90ca7e4a2574a738e41a04a2bbc03bd2 Author: Linus Walleij Date: Fri Jul 16 01:53:34 2021 +0200 bus: ixp4xx: Add a driver for IXP4xx expansion bus The Intel IXP4xx SoCs have an expansion bus that is usually just used for flash memory and configured by the boot loaders and can be accessed using the "simple-bus". However some devices need more elaborate configuration and then we need to provide a proper 3-unit address space indicating chip select for each device and provide timing and similar information. Cc: Marc Zyngier Signed-off-by: Linus Walleij commit 3fbcc6763bb2b6410b2051c983275cd99ba1b5f2 Author: Linus Walleij Date: Sat Jul 17 02:05:25 2021 +0200 bus: ixp4xx: Add DT bindings for the IXP4xx expansion bus This adds device tree bindings for the IXP4xx expansion bus controller. Cc: Marc Zyngier Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit d85165b2381ce2638cfb8c8787a61b97b38251c2 Author: Aswath Govindraju Date: Mon Aug 2 14:48:22 2021 +0530 dt-bindings: net: can: Document power-domains property Document power-domains property for adding the Power domain provider. Link: https://lore.kernel.org/r/20210802091822.16407-1-a-govindraju@ti.com Signed-off-by: Aswath Govindraju Acked-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 3362666972137724496984b4db2b06071aca4b69 Author: Marc Kleine-Budde Date: Wed Jul 28 09:51:42 2021 +0200 can: flexcan: flexcan_clks_enable(): add missing variable initialization This patch adds the missing initialization of the "err" variable in the flexcan_clks_enable() function. Fixes: d9cead75b1c6 ("can: flexcan: add mcf5441x support") Link: https://lore.kernel.org/r/20210728075428.1493568-1-mkl@pengutronix.de Reported-by: kernel test robot Cc: Angelo Dureghello Signed-off-by: Marc Kleine-Budde commit 5b9272e93f2efe3f6cda60cc2c26817b2ce49386 Author: Oleksij Rempel Date: Wed Jul 7 11:48:54 2021 +0200 can: j1939: extend UAPI to notify about RX status To be able to create applications with user friendly feedback, we need be able to provide receive status information. Typical ETP transfer may take seconds or even hours. To give user some clue or show a progress bar, the stack should push status updates. Same as for the TX information, the socket error queue will be used with following new signals: - J1939_EE_INFO_RX_RTS - received and accepted request to send signal. - J1939_EE_INFO_RX_DPO - received data package offset signal - J1939_EE_INFO_RX_ABORT - RX session was aborted Instead of completion signal, user will get data package. To activate this signals, application should set SOF_TIMESTAMPING_RX_SOFTWARE to the SO_TIMESTAMPING socket option. This will avoid unpredictable application behavior for the old software. Link: https://lore.kernel.org/r/20210707094854.30781-3-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit cd85d3aed5cf4410e42ea404db0abb648b296391 Author: Oleksij Rempel Date: Wed Jul 7 11:48:53 2021 +0200 can: j1939: rename J1939_ERRQUEUE_* to J1939_ERRQUEUE_TX_* Prepare the world for the J1939_ERRQUEUE_RX_ version Link: https://lore.kernel.org/r/20210707094854.30781-2-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit e79f49c37ccf273c8aba733f803b3774ebfbe581 Author: Like Xu Date: Wed Jul 28 20:07:05 2021 +0800 KVM: x86/pmu: Introduce pmc->is_paused to reduce the call time of perf interfaces Based on our observations, after any vm-exit associated with vPMU, there are at least two or more perf interfaces to be called for guest counter emulation, such as perf_event_{pause, read_value, period}(), and each one will {lock, unlock} the same perf_event_ctx. The frequency of calls becomes more severe when guest use counters in a multiplexed manner. Holding a lock once and completing the KVM request operations in the perf context would introduce a set of impractical new interfaces. So we can further optimize the vPMU implementation by avoiding repeated calls to these interfaces in the KVM context for at least one pattern: After we call perf_event_pause() once, the event will be disabled and its internal count will be reset to 0. So there is no need to pause it again or read its value. Once the event is paused, event period will not be updated until the next time it's resumed or reprogrammed. And there is also no need to call perf_event_period twice for a non-running counter, considering the perf_event for a running counter is never paused. Based on this implementation, for the following common usage of sampling 4 events using perf on a 4u8g guest: echo 0 > /proc/sys/kernel/watchdog echo 25 > /proc/sys/kernel/perf_cpu_time_max_percent echo 10000 > /proc/sys/kernel/perf_event_max_sample_rate echo 0 > /proc/sys/kernel/perf_cpu_time_max_percent for i in `seq 1 1 10` do taskset -c 0 perf record \ -e cpu-cycles -e instructions -e branch-instructions -e cache-misses \ /root/br_instr a done the average latency of the guest NMI handler is reduced from 37646.7 ns to 32929.3 ns (~1.14x speed up) on the Intel ICX server. Also, in addition to collecting more samples, no loss of sampling accuracy was observed compared to before the optimization. Signed-off-by: Like Xu Message-Id: <20210728120705.6855-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini Acked-by: Peter Zijlstra commit a75b540451d20ef1aebaa09d183ddc5c44c6f86a Author: Peter Xu Date: Fri Jul 30 18:06:05 2021 -0400 KVM: X86: Optimize zapping rmap Using rmap_get_first() and rmap_remove() for zapping a huge rmap list could be slow. The easy way is to travers the rmap list, collecting the a/d bits and free the slots along the way. Provide a pte_list_destroy() and do exactly that. Signed-off-by: Peter Xu Message-Id: <20210730220605.26377-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 13236e25ebab91b3e42ddedf5354b569ace1b555 Author: Peter Xu Date: Fri Jul 30 18:06:02 2021 -0400 KVM: X86: Optimize pte_list_desc with per-array counter Add a counter field into pte_list_desc, so as to simplify the add/remove/loop logic. E.g., we don't need to loop over the array any more for most reasons. This will make more sense after we've switched the array size to be larger otherwise the counter will be a waste. Initially I wanted to store a tail pointer at the head of the array list so we don't need to traverse the list at least for pushing new ones (if without the counter we traverse both the list and the array). However that'll need slightly more change without a huge lot benefit, e.g., after we grow entry numbers per array the list traversing is not so expensive. So let's be simple but still try to get as much benefit as we can with just these extra few lines of changes (not to mention the code looks easier too without looping over arrays). I used the same a test case to fork 500 child and recycle them ("./rmap_fork 500" [1]), this patch further speeds up the total fork time of about 4%, which is a total of 33% of vanilla kernel: Vanilla: 473.90 (+-5.93%) 3->15 slots: 366.10 (+-4.94%) Add counter: 351.00 (+-3.70%) [1] https://github.com/xzpeter/clibs/commit/825436f825453de2ea5aaee4bdb1c92281efe5b3 Signed-off-by: Peter Xu Message-Id: <20210730220602.26327-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit dc1cff969101afd08601e90463b44bd572e62dd4 Author: Peter Xu Date: Fri Jul 30 18:04:53 2021 -0400 KVM: X86: MMU: Tune PTE_LIST_EXT to be bigger Currently rmap array element only contains 3 entries. However for EPT=N there could have a lot of guest pages that got tens of even hundreds of rmap entry. A normal distribution of a 6G guest (even if idle) shows this with rmap count statistics: Rmap_Count: 0 1 2-3 4-7 8-15 16-31 32-63 64-127 128-255 256-511 512-1023 Level=4K: 3089171 49005 14016 1363 235 212 15 7 0 0 0 Level=2M: 5951 227 0 0 0 0 0 0 0 0 0 Level=1G: 32 0 0 0 0 0 0 0 0 0 0 If we do some more fork some pages will grow even larger rmap counts. This patch makes PTE_LIST_EXT bigger so it'll be more efficient for the general use case of EPT=N as we do list reference less and the loops over PTE_LIST_EXT will be slightly more efficient; but still not too large so less waste when array not full. It should not affecting EPT=Y since EPT normally only has zero or one rmap entry for each page, so no array is even allocated. With a test case to fork 500 child and recycle them ("./rmap_fork 500" [1]), this patch speeds up fork time of about 29%. Before: 473.90 (+-5.93%) After: 366.10 (+-4.94%) [1] https://github.com/xzpeter/clibs/commit/825436f825453de2ea5aaee4bdb1c92281efe5b3 Signed-off-by: Peter Xu Message-Id: <20210730220455.26054-6-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 51b8f812e5b327b343232685ea7969e02348d5dd Author: Eric Dumazet Date: Tue Aug 3 08:31:05 2021 -0700 ipv6: exthdrs: get rid of indirect calls in ip6_parse_tlv() As presented last month in our "BIG TCP" talk at netdev 0x15, we plan using IPv6 jumbograms. One of the minor problem we talked about is the fact that ip6_parse_tlv() is currently using tables to list known tlvs, thus using potentially expensive indirect calls. While we could mitigate this cost using macros from indirect_call_wrapper.h, we also can get rid of the tables and let the compiler emit optimized code. Signed-off-by: Eric Dumazet Cc: Justin Iurman Cc: Coco Li Signed-off-by: David S. Miller commit d851798584ffd497b6cf0ae68f9ba75afced0ec3 Merge: 8eceea41347eb 73c447cacbbd4 Author: David S. Miller Date: Wed Aug 4 10:30:00 2021 +0100 Merge branch 'm7530-sw-fallback' DENG Qingfang says: ==================== mt7530 software fallback bridging fix DSA core has gained software fallback support since commit 2f5dc00f7a3e, but it does not work properly on mt7530. This patch series fixes the issues. ==================== Signed-off-by: David S. Miller commit 73c447cacbbd4f854b28909ec316fd8f2e462be9 Author: DENG Qingfang Date: Wed Aug 4 00:04:04 2021 +0800 net: dsa: mt7530: always install FDB entries with IVL and FID 1 This reverts commit 7e777021780e ("mt7530 mt7530_fdb_write only set ivl bit vid larger than 1"). Before this series, the default value of all ports' PVID is 1, which is copied into the FDB entry, even if the ports are VLAN unaware. So `bridge fdb show` will show entries like `dev swp0 vlan 1 self` even on a VLAN-unaware bridge. The blamed commit does not solve that issue completely, instead it may cause a new issue that FDB is inaccessible in a VLAN-aware bridge with PVID 1. This series sets PVID to 0 on VLAN-unaware ports, so `bridge fdb show` will no longer print `vlan 1` on VLAN-unaware bridges, and that special case in fdb_write is not required anymore. Set FDB entries' filter ID to 1 to match the VLAN table. Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit a9e3f62dff3c29b0bca86cb188e61d97be84c087 Author: DENG Qingfang Date: Wed Aug 4 00:04:03 2021 +0800 net: dsa: mt7530: set STP state on filter ID 1 As filter ID 1 is the only one used for bridges, set STP state on it. Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6087175b7991a90c29269be26506f905104d7f12 Author: DENG Qingfang Date: Wed Aug 4 00:04:02 2021 +0800 net: dsa: mt7530: use independent VLAN learning on VLAN-unaware bridges Consider the following bridge configuration, where bond0 is not offloaded: +-- br0 --+ / / | \ / / | \ / | | bond0 / | | / \ swp0 swp1 swp2 swp3 swp4 . . . . . . A B C Ideally, when the switch receives a packet from swp3 or swp4, it should forward the packet to the CPU, according to the port matrix and unknown unicast flood settings. But packet loss will happen if the destination address is at one of the offloaded ports (swp0~2). For example, when client C sends a packet to A, the FDB lookup will indicate that it should be forwarded to swp0, but the port matrix of swp3 and swp4 is configured to only allow the CPU to be its destination, so it is dropped. However, this issue does not happen if the bridge is VLAN-aware. That is because VLAN-aware bridges use independent VLAN learning, i.e. use VID for FDB lookup, on offloaded ports. As swp3 and swp4 are not offloaded, shared VLAN learning with default filter ID of 0 is used instead. So the lookup for A with filter ID 0 never hits and the packet can be forwarded to the CPU. In the current code, only two combinations were used to toggle user ports' VLAN awareness: one is PCR.PORT_VLAN set to port matrix mode with PVC.VLAN_ATTR set to transparent port, the other is PCR.PORT_VLAN set to security mode with PVC.VLAN_ATTR set to user port. It turns out that only PVC.VLAN_ATTR contributes to VLAN awareness, and port matrix mode just skips the VLAN table lookup. The reference manual is somehow misleading when describing PORT_VLAN modes. It states that PORT_MEM (VLAN port member) is used for destination if the VLAN table lookup hits, but actually **PORT_MEM & PORT_MATRIX** (bitwise AND of VLAN port member and port matrix) is used instead, which means we can have two or more separate VLAN-aware bridges with the same PVID and traffic won't leak between them. Therefore, to solve this, enable independent VLAN learning with PVID 0 on VLAN-unaware bridges, by setting their PCR.PORT_VLAN to fallback mode, while leaving standalone ports in port matrix mode. The CPU port is always set to fallback mode to serve those bridges. During testing, it is found that FDB lookup with filter ID of 0 will also hit entries with VID 0 even with independent VLAN learning. To avoid that, install all VLANs with filter ID of 1. Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0b69c54c74bcb60e834013ccaf596caf05156a8e Author: DENG Qingfang Date: Wed Aug 4 00:04:01 2021 +0800 net: dsa: mt7530: enable assisted learning on CPU port Consider the following bridge configuration, where bond0 is not offloaded: +-- br0 --+ / / | \ / / | \ / | | bond0 / | | / \ swp0 swp1 swp2 swp3 swp4 . . . . . . A B C Address learning is enabled on offloaded ports (swp0~2) and the CPU port, so when client A sends a packet to C, the following will happen: 1. The switch learns that client A can be reached at swp0. 2. The switch probably already knows that client C can be reached at the CPU port, so it forwards the packet to the CPU. 3. The bridge core knows client C can be reached at bond0, so it forwards the packet back to the switch. 4. The switch learns that client A can be reached at the CPU port. 5. The switch forwards the packet to either swp3 or swp4, according to the packet's tag. That makes client A's MAC address flap between swp0 and the CPU port. If client B sends a packet to A, it is possible that the packet is forwarded to the CPU. With offload_fwd_mark = 1, the bridge core won't forward it back to the switch, resulting in packet loss. As we have the assisted_learning_on_cpu_port in DSA core now, enable that and disable hardware learning on the CPU port. Signed-off-by: DENG Qingfang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8eceea41347eb3a5ec8e23c4a303e95be8b85383 Merge: 93bbcfee0575e 45a42a3c50b58 Author: David S. Miller Date: Wed Aug 4 10:12:05 2021 +0100 Merge branch 'ipa-pm-irqs' Alex Elder says: ==================== net: ipa: prepare GSI interrupts for runtime PM The last patch in this series arranges for GSI interrupts to be disabled when the IPA hardware is suspended. This ensures the clock is always operational when a GSI interrupt fires. Leading up to that are patches that rearrange the code a bit to allow this to be done. The first two patches aren't *directly* related. They remove some flag arguments to some GSI suspend/resume related functions, using the version field now present in the GSI structure. ==================== Signed-off-by: David S. Miller commit 45a42a3c50b583e78d96038e834909de627f87f1 Author: Alex Elder Date: Tue Aug 3 09:01:03 2021 -0500 net: ipa: disable GSI interrupts while suspended Introduce new functions gsi_suspend() and gsi_resume(), which will disable the GSI interrupt handler after all endpoints are suspended and re-enable it before endpoints are resumed. This will ensure no GSI interrupt handler will fire when the hardware is suspended. Here's a little further explanation. There are seven GSI interrupt types, and most are disabled except when needed. - These two are not used (never enabled): GSI_INTER_EE_CH_CTRL GSI_INTER_EE_EV_CTRL - These two are only used to implement channel and event ring commands, and are only enabled while a command is underway: GSI_CH_CTRL GSI_EV_CTRL - The IEOB interrupt signals I/O completion. It will not fire when a channel is stopped (or "suspended"). GSI_IEOB - This interrupt is used to allocate or halt modem channels, and is only enabled while such a command is underway. GSI_GLOB_EE However it also is used to signal certain errors, and this could occur at any time. - The general interrupt signals general errors, and could occur at any time. GSI_GENERAL The purpose for this change is to ensure no global or general interrupts fire due to errors while the hardware is suspended. We enable the clock on resume, and at that time we can "handle" (at least report) these error conditions. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit b176f95b5728e355ea6b61725cf240a575621e51 Author: Alex Elder Date: Tue Aug 3 09:01:02 2021 -0500 net: ipa: move gsi_irq_init() code into setup The GSI IRQ handler could be triggered as soon as it is registered with request_irq(). The handler function, gsi_isr(), touches hardware, meaning the IPA clock must be operational. The IPA clock is not operating when the handler is registered (in gsi_irq_init()), so this is a problem. Move the call to request_irq() for the GSI interrupt handler into gsi_irq_setup(), which is called when the IPA clock is known to be operational (and furthermore, the GSI firmware will have been loaded). Request the IRQ at the end of that function, after all interrupt types have been disabled and masked. Move the matching free_irq() call into gsi_irq_teardown(), and get rid of the now empty gsi_irq_exit(), Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 1657d8a45823429aabee0a3282b2d249abbd3831 Author: Alex Elder Date: Tue Aug 3 09:01:01 2021 -0500 net: ipa: have gsi_irq_setup() return an error code Change gsi_irq_setup() so it returns an error value, and introduce gsi_irq_teardown() as its inverse. Set the interrupt type (IRQ rather than MSI) in gsi_irq_setup(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a7860a5f898c9f5850ff9d72e6ee473791e5a6cf Author: Alex Elder Date: Tue Aug 3 09:01:00 2021 -0500 net: ipa: move some GSI setup functions Move gsi_irq_setup() and gsi_ring_setup() so they're defined right above gsi_setup() where they're called. This is a trivial movement of code to prepare for upcoming patches. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4a4ba483e4a56cb469f067493265f0173e06d060 Author: Alex Elder Date: Tue Aug 3 09:00:59 2021 -0500 net: ipa: move version check for channel suspend/resume Change the Boolean flags passed to __gsi_channel_start() and __gsi_channel_stop() so they represent whether the request is being made to implement suspend (versus stop) or resume (versus start). Then stop or start the channel for suspend/resume requests only if the hardware version indicates it should be done. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit decfef0fa6b21508657a6e54a01508196988bc95 Author: Alex Elder Date: Tue Aug 3 09:00:58 2021 -0500 net: ipa: use gsi->version for channel suspend/resume The GSI layer has the IPA version now, so there's no need for version-specific flags to be passed from IPA. One instance of this is in gsi_channel_suspend() and gsi_channel_resume(), which indicate whether or not the endpoint suspend is implemented by GSI stopping the channel. We can make that determination based on gsi->version, eliminating the need for a Boolean flag in those functions. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 93bbcfee0575e5f6526a5bbf213b205eeae60c59 Merge: 8730379ee067c 7ffa7542eca6f Author: David S. Miller Date: Wed Aug 4 10:10:12 2021 +0100 Merge branch 'mhi-mbim' Loic Poulain says: ==================== net: mhi: move MBIM to WWAN Implement a proper WWAN driver for MBIM network protocol, with multi link management supported through the WWAN framework (wwan rtnetlink). Until now, MBIM over MHI was supported directly in the mhi_net driver, via some protocol rx/tx fixup callbacks, but with only one session supported (no multilink muxing). We can then remove that part from mhi_net and restore the driver to a simpler version for 'raw' ip transfer (or QMAP via rmnet link). Note that a wwan0 link is created by default for session-id 0. Additional links can be managed via ip tool: $ ip link add dev wwan0mms parentdev wwan0 type wwan linkid 1 ==================== Signed-off-by: David S. Miller commit 7ffa7542eca6fa910edbecf13899cb74a699f37e Author: Loic Poulain Date: Tue Aug 3 15:36:29 2021 +0200 net: mhi: Remove MBIM protocol The MBIM protocol has now been integrated in a proper WWAN driver. We can then revert back to a simpler driver for mhi_net, which is used for raw IP or QMAP protocol (via rmnet link). - Remove protocol management - Remove WWAN framework usage (only valid for mbim) - Remove net/mhi directory for simpler mhi_net.c file Signed-off-by: Loic Poulain Signed-off-by: David S. Miller commit aa730a9905b7b079ef2fffdab7f15dbb842f5c7c Author: Loic Poulain Date: Tue Aug 3 15:36:28 2021 +0200 net: wwan: Add MHI MBIM network driver Add new wwan driver for MBIM over MHI. MBIM is a transport protocol for IP packets, allowing packet aggregation and muxing. Initially designed for USB bus, it is also exposed through MHI bus for QCOM based PCIe wwan modems. This driver supports the new wwan rtnetlink interface for multi-link management and has been tested with Quectel EM120R-GL M2 module. Signed-off-by: Loic Poulain Signed-off-by: David S. Miller commit 8730379ee067ccbd2ea24eb02ea623d688e9707b Merge: 8679c31e0284a e874f4557b365 Author: David S. Miller Date: Wed Aug 4 10:05:13 2021 +0100 Merge branch 'queues' Jakub Kicinski says: ==================== net: add netif_set_real_num_queues() for device reconfig This short set adds a helper to make the implementation of two-phase NIC reconfig easier. ==================== Signed-off-by: David S. Miller commit e874f4557b365fc07f960c0e5a224f9ecaedd838 Author: Jakub Kicinski Date: Tue Aug 3 06:05:27 2021 -0700 nfp: use netif_set_real_num_queues() Avoid reconfig problems due to failures in netif_set_real_num_tx_queues() by using netif_set_real_num_queues(). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 271e5b7d00aeff7c61fb6c5415d14dbedb783b68 Author: Jakub Kicinski Date: Tue Aug 3 06:05:26 2021 -0700 net: add netif_set_real_num_queues() for device reconfig netif_set_real_num_rx_queues() and netif_set_real_num_tx_queues() can fail which breaks drivers trying to implement reconfiguration in a way that can't leave the device half-broken. In other words those functions are incompatible with prepare/commit approach. Luckily setting real number of queues can fail only if the number is increased, meaning that if we order operations correctly we can guarantee ending up with either new config (success), or the old one (on error). Provide a helper implementing such logic so that drivers don't have to duplicate it. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ae4443ba2f837b4bfa8c91cc1abc4c75d6743299 Author: Fabio Estevam Date: Sat Jul 24 10:23:51 2021 -0300 ARM: imx_v6_v7_defconfig: Let CONFIG_SCSI_LOWLEVEL be selected When using Yocto's Ptest DISTRO_FEATURE the CONFIG_SCSI_DEBUG=m option is added, but it cannot be selected as it depends on CONFIG_SCSI_LOWLEVEL. This generates a build warning saying that the CONFIG_SCSI_DEBUG=m option is discarded. Fix this by letting CONFIG_SCSI_LOWLEVEL to be selected. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3d1fc360ac8cd8a9632bc5384ec2d869bceee9d1 Author: Fabio Estevam Date: Sat Jul 24 10:23:50 2021 -0300 ARM: imx_v6_v7_defconfig: Select CONFIG_KPROBES Building lttng-modules without CONFIG_KPROBES selected gives a build error. Select CONFIG_KPROBES by default. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 8679c31e0284aa3aaba038035e443180b5bacb99 Author: Rocco Yue Date: Tue Aug 3 20:02:50 2021 +0800 net: add extack arg for link ops Pass extack arg to validate_linkmsg and validate_link_af callbacks. If a netlink attribute has a reject_message, use the extended ack mechanism to carry the message back to user space. Signed-off-by: Rocco Yue Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 314001f0bf927015e459c9d387d62a231fe93af3 Author: Rao Shoaib Date: Sun Aug 1 00:57:07 2021 -0700 af_unix: Add OOB support This patch adds OOB support for AF_UNIX sockets. The semantics is same as TCP. The last byte of a message with the OOB flag is treated as the OOB byte. The byte is separated into a skb and a pointer to the skb is stored in unix_sock. The pointer is used to enforce OOB semantics. Signed-off-by: Rao Shoaib Signed-off-by: David S. Miller commit 7e89350c901923c48370ae7b922223c6c5a2b7fd Merge: b820c114eba7e f0653a892097c Author: David S. Miller Date: Wed Aug 4 09:53:34 2021 +0100 Merge branch 'dpaa2-switch-next' Ioana Ciornei says: ==================== dpaa2-switch: integrate the MAC endpoint support This patch set integrates the already available MAC support into the dpaa2-switch driver as well. The first 4 patches are fixing up some minor problems or optimizing the code, while the remaining ones are actually integrating the dpaa2-mac support into the switch driver by calling the dpaa2_mac_* provided functions. While at it, we also export the MAC statistics in ethtool like we do for dpaa2-eth. ==================== Signed-off-by: David S. Miller commit f0653a892097ca16c90e32b6615cac5eba0df3a8 Author: Ioana Ciornei Date: Tue Aug 3 19:57:45 2021 +0300 dpaa2-switch: export MAC statistics in ethtool If a switch port is connected to a MAC, use the common dpaa2-mac support for exporting the available MAC statistics. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 8581362d9c8528fb9b013cfb51324447c6bdae54 Author: Ioana Ciornei Date: Tue Aug 3 19:57:44 2021 +0300 dpaa2-switch: add a prefix to HW ethtool stats In the next patch, we'll add support for also exporting the MAC statistics in the ethtool stats. Annotate already present HW stats with a suggestive prefix. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 84cba72956fddf29ba666f885c39ed147024c125 Author: Ioana Ciornei Date: Tue Aug 3 19:57:43 2021 +0300 dpaa2-switch: integrate the MAC endpoint support Integrate the common MAC endpoint management support into the dpaa2-switch driver as well. Nothing special happens here, just that the already available dpaa2-mac functions are also called from dpaa2-switch. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 27cfdadd687deca58146b415f60b23d185cb3532 Author: Ioana Ciornei Date: Tue Aug 3 19:57:42 2021 +0300 bus: fsl-mc: extend fsl_mc_get_endpoint() to pass interface ID In case of a switch DPAA2 object, the interface ID is also needed when querying for the object endpoint. Extend fsl_mc_get_endpoint() so that users can also pass the interface ID that are interested in. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 2b24ffd83e3953e6ff7a67ca1c8f7832598b1bf0 Author: Ioana Ciornei Date: Tue Aug 3 19:57:41 2021 +0300 dpaa2-switch: no need to check link state right after ndo_open The call to dpaa2_switch_port_link_state_update is a leftover from the time when on DPAA2 platforms the PHYs were started at boot time so when an ifconfig was issued on the associated interface, the link status needed to be checked directly from the ndo_open() callback. This is not needed anymore since we are now properly integrated with the PHY layer thus a link interrupt will come directly from the PHY eventually without the need to call the sync function. Fix this up by removing the call to dpaa2_switch_port_link_state_update. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 042ad90ca7ce70f35dc5efd5b2043d2f8aceb12a Author: Ioana Ciornei Date: Tue Aug 3 19:57:40 2021 +0300 dpaa2-switch: do not enable the DPSW at probe time We should not enable the switch interfaces at probe time since this is trigged by the open callback. Remove the call dpsw_enable() which does exactly this. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 24ab724f8a4661b2dc8e696b41df93bdc108f7a1 Author: Ioana Ciornei Date: Tue Aug 3 19:57:39 2021 +0300 dpaa2-switch: use the port index in the IRQ handler The MC firmware supplies us the switch interface index for which an interrupt was triggered. Use this to our advantage instead of looping through all the switch ports and doing unnecessary work. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 1ca6cf5ecbde85ebe2fa9993f2d496926bf0e1da Author: Ioana Ciornei Date: Tue Aug 3 19:57:38 2021 +0300 dpaa2-switch: request all interrupts sources on the DPSW Request all interrupt sources to be read and then cleared on the DPSW object. In the next patches we'll also add support for treating other interrupts. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit f84ba106a0185b4336f58580bb016ce993962b0f Author: Takashi Iwai Date: Wed Aug 4 09:41:25 2021 +0200 ALSA: memalloc: Store snd_dma_buffer.addr for continuous pages, too In the recent fix commit eda80d7c9c4d ("ALSA: memalloc: Fix regression with SNDRV_DMA_TYPE_CONTINUOUS"), we replaced the pfn argument of the remap_page_pfn() call from the uninitialized dmab->addr. It was the right fix, but it'd be more generic if we actually initialize dmab->area for SNDRV_DMA_TYPE_CONTINOUS, too. e.g. the field is used in the common snd_sgbuf_get_addr(), too. This patch adds the initialization of addr field and does revert of the previous change to refer to it again in the mmap call. Link: https://lore.kernel.org/r/20210804074125.8170-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 623c10108338b6b4e2c99de9fbc785f30b526c54 Author: Takashi Iwai Date: Wed Aug 4 08:13:29 2021 +0200 ALSA: memalloc: Fix pgprot for WC mmap on x86 We have a special handling of WC pages on x86, and it's currently specific to HD-audio. The last forgotten piece was the pgprot setup for the mmap with WC pages. This patch moves the pgprot setup for WC pages from HD-audio-specific mmap callback to the common helper code. It allows us to remove the superfluous mmap callback in HD-audio and its prepare_mmap redirection. Link: https://lore.kernel.org/r/20210804061329.29265-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ba447289fd06c8678eaf51ccffb1b0c9a6a56c9a Author: Takashi Iwai Date: Mon Aug 2 09:28:15 2021 +0200 ASoC: sprd: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of sprd driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-16-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8c505b773d3fda7129d5171626860e4caa33a8ef Author: Takashi Iwai Date: Mon Aug 2 09:28:14 2021 +0200 ASoC: qcom: qdsp6: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of qcom qdsp6 driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Srinivas Kandagatla Cc: Banajit Goswami Acked-by: Mark Brown Tested-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210802072815.13551-15-tiwai@suse.de Signed-off-by: Takashi Iwai commit 15a52cdcb0ef4d01c7da97c6db5c20d193ea93f1 Author: Takashi Iwai Date: Mon Aug 2 09:28:13 2021 +0200 ASoC: qcom: lpass: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of qcom lpass driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Srinivas Kandagatla Cc: Banajit Goswami Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-14-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3610a6d1dbd19b344bdf5b6647b2750efe55fe2e Author: Takashi Iwai Date: Mon Aug 2 09:28:12 2021 +0200 ASoC: mpc5200: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of fsl mpc5200 driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-13-tiwai@suse.de Signed-off-by: Takashi Iwai commit e159704f792014a23b92b85f62a8f990b08bd7e2 Author: Takashi Iwai Date: Mon Aug 2 09:28:11 2021 +0200 ASoC: fsl_dma: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of fsl_dma driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Shengjiu Wang Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-12-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1855ce6293c01935a3242a90d08ab221c095d82c Author: Takashi Iwai Date: Mon Aug 2 09:28:10 2021 +0200 ASoC: fsl_asrc_dma: Use managed buffer allocation This patch simplifies the buffer pre-allocation code of fsl_asrc_dma driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Shengjiu Wang Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit 189364872fba07291db7f68fe0161f97e5b61bb1 Author: Takashi Iwai Date: Mon Aug 2 09:28:09 2021 +0200 ASoC: tegra: Use managed buffer allocation As the standard buffer allocation helper supports WC pages now, we can convert imx-pcm-rpmsg driver to use that. This allows us to remove lots of superfluous code. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0e1b598fb427b4512731df8d38c69b83852b72a1 Author: Takashi Iwai Date: Mon Aug 2 09:28:08 2021 +0200 ASoC: fsl: imx-pcm-rpmsg: Use managed buffer allocation As the standard buffer allocation helper supports WC pages now, we can convert imx-pcm-rpmsg driver to use that. This allows us to remove lots of superfluous code. Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Shengjiu Wang Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit f010a4987f61ca6173d5dbd30dc1802036fb187d Author: Takashi Iwai Date: Mon Aug 2 09:28:07 2021 +0200 ASoC: fsl: imx-pcm-fiq: Use managed buffer allocation As the standard buffer allocation helper supports WC pages now, we can convert imx-pcm-fiq driver to use that. This allows us to remove lots of superfluous code. Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Shengjiu Wang Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit 13ce4d8fbf59defb69685c76279e57d4830b411d Author: Takashi Iwai Date: Mon Aug 2 09:28:06 2021 +0200 ASoC: bcm: Use managed PCM buffer allocation As the standard buffer allocation helper supports WC pages now, we can convert bcm driver to use that. This allows us to remove lots of superfluous code. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7f2da3d76b7d5228457d22a2dff0725fbf93d417 Author: Takashi Iwai Date: Mon Aug 2 09:28:05 2021 +0200 ALSA: pxa2xx: Use managed PCM buffer allocation Now with the recent addition of WC buffer allocation support, we can use the standard PCM buffer allocation helpers for pxa2xx drivers. This allows us to remove lots of superfluous code. Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit d5c5055816740bd26f3c0095e7f5e63dfa4bbdf8 Author: Takashi Iwai Date: Mon Aug 2 09:28:04 2021 +0200 ALSA: memalloc: Support WC allocation on all architectures There are the generic DMA API calls for allocating and managing the pages with the write-combined attribute. Let's use them for all architectures but x86; x86 still needs the special handling to override the page attributes. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit ac9245a5406e6074a1aa211f103629d3f154c5a5 Author: Takashi Iwai Date: Mon Aug 2 09:28:03 2021 +0200 ALSA: pcm: Allow exact buffer preallocation A few drivers want to have rather the exact buffer preallocation at the driver probe time and keep using it for the whole operations without allowing dynamic buffer allocation. For satisfying the demands, this patch extends the managed buffer allocation API slightly. Namely, when 0 is passed to max argument of the allocation helper functions snd_pcm_set_managed_buffer*(), it treats as if the fixed size allocation of the given size. If the pre-allocation fails in this mode, the function returns now -ENOMEM. Otherwise, i.e. max argument is non-zero, the function never returns -ENOMEM but tries to fall back to the smaller chunks and allows the dynamic allocation later -- which is still the default behavior until now. For more intuitive use, also two new helpers are added for handling the fixed size buffer allocation, too: snd_pcm_set_fixed_buffer() and snd_pcm_set_fixed_buffer_all(). Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 58a95dfa4fdd9c72e62be34dd025d268c1e04a83 Author: Takashi Iwai Date: Mon Aug 2 09:28:02 2021 +0200 ALSA: memalloc: Correctly name as WC SNDRV_DMA_TYPE_DEV_UC and SNDRV_DMA_TYPE_DEV_UC_SG are incorrectly named as if they were for the uncached memory, while actually we set the pages as write-combined. Rename them to reflect the right attribute. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 723c1252e058dc854f9d031e3e6526ca62f9f5c7 Author: Takashi Iwai Date: Mon Aug 2 09:28:01 2021 +0200 ALSA: memalloc: Minor refactoring Return the pointer directly from alloc ops instead of setting dmab->area at each place. It simplifies the code a bit. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit ab49840272cfa595327fa1212a5a44287b9ac986 Author: Matt Roper Date: Thu Jul 29 10:00:01 2021 -0700 drm/i915/dg2: DG2 uses the same sseu limits as XeHP SDV DG2 supports compute DSS and has the same maximum number of DSS and EU as XeHP SDV. Signed-off-by: Matt Roper Reviewed-by: Caz Yokoyama Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-12-matthew.d.roper@intel.com commit eb962fae0078d6f827473e0eb6019db55d2217f1 Author: Matt Roper Date: Thu Jul 29 09:59:59 2021 -0700 drm/i915/xehpsdv: Add maximum sseu limits Due to the removal of legacy slices and the transition to a gslice/cslice/mslice/etc. design, we'll internally store all DSS under "slice0." Signed-off-by: Matt Roper Reviewed-by: Caz Yokoyama Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-10-matthew.d.roper@intel.com commit 05b78d291d3854aeae5cfd19cc860910b1a8fcdc Author: Matthew Auld Date: Thu Jul 29 09:59:58 2021 -0700 drm/i915/xehp: Changes to ss/eu definitions Xe_HP no longer has "slices" in the same way that old platforms did. There are new concepts (gslices, cslices, mslices) that apply in various contexts, but for the purposes of fusing slices no longer exist and we just have one large pool of dual-subslices (DSS) to work with. Furthermore, the meaning of the DSS fuse is inverted compared to past platforms --- it now specifies which DSS are enabled rather than which ones are disabled. Cc: Rodrigo Vivi Cc: Lucas De Marchi Cc: Tvrtko Ursulin Signed-off-by: Matthew Auld Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Signed-off-by: Prasad Nallani Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-9-matthew.d.roper@intel.com commit e05316366040429ccce7068de17066b1cbf944bb Author: Matt Roper Date: Thu Jul 29 09:59:53 2021 -0700 drm/i915/dg2: Add forcewake table The DG2 forcewake table is very similar to the one used by XeHP SDV (and both platforms are even presented as a single table in the bspec). For the most part DG2 starts using a few additional ranges that were 'reserved' on XeHP SDV and stops using some others. However there is a single range (0xd800-0xd87f) that needs to be handled differently between the two platforms (it needs GT wake on XeHP SDV, but render wake on DG2) so unless we want to wake both domains (which could waste power) or define new types of forcewake domains for this special case we need to have separate tables for the two platforms. Let's define the ranges for both platforms with a parameterized macro so that we don't actually need to duplicate everything in the code. It should be fine for DG2 to re-use the Xe_HP shadow register list so we can continue to use the 'xehpsdv' MMIO write functions and don't need to spin up a separate DG2 instance. Bspec: 66534 Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210729170008.2836648-4-matthew.d.roper@intel.com commit 13e47bebbe83f58ddc41d2987567e97c5068a1ec Author: Tong Tiangen Date: Fri Jul 2 04:54:21 2021 +0000 riscv: Implement thread_struct whitelist for hardened usercopy This whitelists the FPU register state portion of the thread_struct for copying to userspace, instead of the default entire struct. Signed-off-by: Tong Tiangen Signed-off-by: Palmer Dabbelt commit 91803392c732c43b5cf440e885ea89be7f5fecef Author: Chao Yu Date: Wed Aug 4 08:38:38 2021 +0800 f2fs: fix to stop filesystem update once CP failed During f2fs_write_checkpoint(), once we failed in f2fs_flush_nat_entries() or do_checkpoint(), metadata of filesystem such as prefree bitmap, nat/sit version bitmap won't be recovered, it may cause f2fs image to be inconsistent, let's just set CP error flag to avoid further updates until we figure out a scheme to rollback all metadatas in such condition. Reported-by: Yangtao Li Signed-off-by: Yangtao Li Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit cf9c615cde49fb5d2480549c8c955a0a387798d3 Author: Nicholas Piggin Date: Wed Jul 21 00:15:04 2021 +1000 powerpc/64s/perf: Always use SIAR for kernel interrupts If an interrupt is taken in kernel mode, always use SIAR for it rather than looking at regs_sipr. This prevents samples piling up around interrupt enable (hard enable or interrupt replay via soft enable) in PMUs / modes where the PR sample indication is not in synch with SIAR. This results in better sampling of interrupt entry and exit in particular. Signed-off-by: Nicholas Piggin Tested-by: Athira Rajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210720141504.420110-1-npiggin@gmail.com commit e9ef81e1079b0c4c374fba0f9affa7129c7c913b Author: Parth Shah Date: Wed Jul 28 23:26:07 2021 +0530 powerpc/smp: Use existing L2 cache_map cpumask to find L3 cache siblings On POWER10 systems, the "ibm,thread-groups" property "2" indicates the cpus in thread-group share both L2 and L3 caches. Hence, use cache_property = 2 itself to find both the L2 and L3 cache siblings. Hence, create a new thread_group_l3_cache_map to keep list of L3 siblings, but fill the mask using same property "2" array. Signed-off-by: Parth Shah Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210728175607.591679-4-parth@linux.ibm.com commit 69aa8e078545bc14d84a8b4b3cb914ac8f9f280e Author: Gautham R. Shenoy Date: Wed Jul 28 23:26:06 2021 +0530 powerpc/cacheinfo: Remove the redundant get_shared_cpu_map() The helper function get_shared_cpu_map() was added in 'commit 500fe5f550ec ("powerpc/cacheinfo: Report the correct shared_cpu_map on big-cores")' and subsequently expanded upon in 'commit 0be47634db0b ("powerpc/cacheinfo: Print correct cache-sibling map/list for L2 cache")' in order to help report the correct groups of threads sharing these caches on big-core systems where groups of threads within a core can share different sets of caches. Now that powerpc/cacheinfo is aware of "ibm,thread-groups" property, cache->shared_cpu_map contains the correct set of thread-siblings sharing the cache. Hence we no longer need the functions get_shared_cpu_map(). This patch removes this function. We also remove the helper function index_dir_to_cpu() which was only called by get_shared_cpu_map(). With these functions removed, we can still see the correct cache-sibling map/list for L1 and L2 caches on systems with L1 and L2 caches distributed among groups of threads in a core. With this patch, on a SMT8 POWER10 system where the L1 and L2 caches are split between the two groups of threads in a core, for CPUs 8,9, the L1-Data, L1-Instruction, L2, L3 cache CPU sibling list is as follows: $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-15 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-15 $ ppc64_cpu --smt=4 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-11 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-11 $ ppc64_cpu --smt=2 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-9 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-9 $ ppc64_cpu --smt=1 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8 Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210728175607.591679-3-parth@linux.ibm.com commit a4bec516b9c0823d7e2bb8c8928c98b535cf9adf Author: Gautham R. Shenoy Date: Wed Jul 28 23:26:05 2021 +0530 powerpc/cacheinfo: Lookup cache by dt node and thread-group id Currently the cacheinfo code on powerpc indexes the "cache" objects (modelling the L1/L2/L3 caches) where the key is device-tree node corresponding to that cache. On some of the POWER server platforms thread-groups within the core share different sets of caches (Eg: On SMT8 POWER9 systems, threads 0,2,4,6 of a core share L1 cache and threads 1,3,5,7 of the same core share another L1 cache). On such platforms, there is a single device-tree node corresponding to that cache and the cache-configuration within the threads of the core is indicated via "ibm,thread-groups" device-tree property. Since the current code is not aware of the "ibm,thread-groups" property, on the aforementoined systems, cacheinfo code still treats all the threads in the core to be sharing the cache because of the single device-tree node (In the earlier example, the cacheinfo code would says CPUs 0-7 share L1 cache). In this patch, we make the powerpc cacheinfo code aware of the "ibm,thread-groups" property. We indexe the "cache" objects by the key-pair (device-tree node, thread-group id). For any CPUX, for a given level of cache, the thread-group id is defined to be the first CPU in the "ibm,thread-groups" cache-group containing CPUX. For levels of cache which are not represented in "ibm,thread-groups" property, the thread-group id is -1. [parth: Remove "static" keyword for the definition of "thread_group_l1_cache_map" and "thread_group_l2_cache_map" to get rid of the compile error.] Signed-off-by: Gautham R. Shenoy Signed-off-by: Parth Shah Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210728175607.591679-2-parth@linux.ibm.com commit 86ff0bce2e9665c8b074930fe6caed615da070c1 Author: Masahiro Yamada Date: Thu Jul 29 23:19:37 2021 +0900 powerpc: move the install rule to arch/powerpc/Makefile Currently, the install target in arch/powerpc/Makefile descends into arch/powerpc/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/powerpc/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729141937.445051-3-masahiroy@kernel.org commit 9bef456b20581e630ef9a13555ca04fed65a859d Author: Masahiro Yamada Date: Thu Jul 29 23:19:36 2021 +0900 powerpc: 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"). Change the PowerPC installation code in a similar way. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729141937.445051-2-masahiroy@kernel.org commit 156ca4e650bfb9a4259b427069caa11b5a4df3d4 Author: Masahiro Yamada Date: Thu Jul 29 23:19:35 2021 +0900 powerpc: remove unused zInstall target from arch/powerpc/boot/Makefile Commit c913e5f95e54 ("powerpc/boot: Don't install zImage.* from make install") added the zInstall target to arch/powerpc/boot/Makefile, but you cannot use it since the corresponding hook is missing in arch/powerpc/Makefile. It has never worked since its addition. Nobody has complained about it for 7 years, which means this code was unneeded. With this removal, the install.sh will be passed in with 4 parameters. Simplify the shell script. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729141937.445051-1-masahiroy@kernel.org commit d04691d373e75c83424b85c0e68e4a3f9370c10d Author: Nathan Chancellor Date: Tue Aug 3 14:15:47 2021 -0700 cpuidle: pseries: Mark pseries_idle_proble() as __init After commit 7cbd631d4dec ("cpuidle: pseries: Fixup CEDE0 latency only for POWER10 onwards"), pseries_idle_probe() is no longer inlined when compiling with clang, which causes a modpost warning: WARNING: modpost: vmlinux.o(.text+0xc86a54): Section mismatch in reference from the function pseries_idle_probe() to the function .init.text:fixup_cede0_latency() The function pseries_idle_probe() references the function __init fixup_cede0_latency(). This is often because pseries_idle_probe lacks a __init annotation or the annotation of fixup_cede0_latency is wrong. pseries_idle_probe() is a non-init function, which calls fixup_cede0_latency(), which is an init function, explaining the mismatch. pseries_idle_probe() is only called from pseries_processor_idle_init(), which is an init function, so mark pseries_idle_probe() as __init so there is no more warning. Fixes: 054e44ba99ae ("cpuidle: pseries: Add function to parse extended CEDE records") Signed-off-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210803211547.1093820-1-nathan@kernel.org commit d08c8b855140e9f5240b3ffd1b8b9d435675e281 Author: Wasim Khan Date: Thu Jul 29 14:17:47 2021 +0200 PCI: Add ACS quirks for NXP LX2xx0 and LX2xx2 platforms Root Ports in NXP LX2xx0 and LX2xx2, where each Root Port is a Root Complex with unique segment numbers, do provide isolation features to disable peer transactions and validate bus numbers in requests, but do not provide an actual PCIe ACS capability. Add ACS quirks for NXP LX2xx0 A/C/E/N and LX2xx2 A/C/E/N platforms. LX2xx0A : without security features + CAN-FD LX2160A (0x8d81) - 16 cores LX2120A (0x8da1) - 12 cores LX2080A (0x8d83) - 8 cores LX2xx0C : security features + CAN-FD LX2160C (0x8d80) - 16 cores LX2120C (0x8da0) - 12 cores LX2080C (0x8d82) - 8 cores LX2xx0E : security features + CAN LX2160E (0x8d90) - 16 cores LX2120E (0x8db0) - 12 cores LX2080E (0x8d92) - 8 cores LX2xx0N : without security features + CAN LX2160N (0x8d91) - 16 cores LX2120N (0x8db1) - 12 cores LX2080N (0x8d93) - 8 cores LX2xx2A : without security features + CAN-FD LX2162A (0x8d89) - 16 cores LX2122A (0x8da9) - 12 cores LX2082A (0x8d8b) - 8 cores LX2xx2C : security features + CAN-FD LX2162C (0x8d88) - 16 cores LX2122C (0x8da8) - 12 cores LX2082C (0x8d8a) - 8 cores LX2xx2E : security features + CAN LX2162E (0x8d98) - 16 cores LX2122E (0x8db8) - 12 cores LX2082E (0x8d9a) - 8 cores LX2xx2N : without security features + CAN LX2162N (0x8d99) - 16 cores LX2122N (0x8db9) - 12 cores LX2082N (0x8d9b) - 8 cores [bhelgaas: put PCI_VENDOR_ID_NXP definition next to PCI_VENDOR_ID_FREESCALE as a clue that they share the same Device ID namespace] Link: https://lore.kernel.org/r/20210729121747.1823086-1-wasim.khan@oss.nxp.com Link: https://lore.kernel.org/r/20210803180021.3252886-1-wasim.khan@oss.nxp.com Signed-off-by: Wasim Khan Signed-off-by: Bjorn Helgaas commit 9da65e441d4d7a492ce139e4938ac75fa70f449d Author: AngeloGioacchino Del Regno Date: Tue Jun 8 22:21:42 2021 +0200 arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform) Add support for following boards: - Xperia X Performance (dora) - Xperia XZ (kagura) - Xperia XZs (keyaki) They are all based on the SONY Tone platform and feature largely similar hardware with the most obvious differences being lack of USB-C and ToF sensor on Dora and different camera sensor on Keyaki. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210608202143.247427-4-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit 08972f34a264a80c5113706fccc1984f87dd2dbf Author: Konrad Dybcio Date: Tue Jun 8 22:21:41 2021 +0200 arm64: dts: qcom: msm8996-*: Disable HDMI by default Most phones ship without HDMI and leaving it enabled wrecks havoc. Disable it in msm8996.dtsi and re-enable it on the boards that did not disable it previously. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210608202143.247427-3-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit a569b10bf74ff9d62d3deb98890ff4a4b75eb81a Author: Konrad Dybcio Date: Tue Jun 8 22:21:40 2021 +0200 arm64: dts: qcom: Add MSM8996v3.0 DTSI file Add an overlay for MSM8996v3.0, which is a pre-final revision of the said SoC. It has some stark differences with regards to GPU, or more specifically its power delivery path. Oh, and of course a different msm-id. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210608202143.247427-2-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit db718417e87f1eb4562d8bc8b02fb108e80d63a1 Author: Konrad Dybcio Date: Tue Jun 8 22:21:39 2021 +0200 arm64: dts: qcom: Add PMI8996 DTSI file PMI8996 is *almost* the same hardware as PMI8994, say for some annoyances: - Boards equipped with PMI8996 now have to include pmic-id (which wasn't the case before) - Different qpnp-ibb-discharge-resistor value (will be addressed after LABIBB is introduced) - Different inhibit-derating-ua value (will be addressed after BCL is introduced) - Different ramp_up_step value (will be addressed after [if?] QPNP Flash LED is introduced) This DTSI is supposed to be included >>ON TOP OF<< pmi8994.dtsi, like this: -- msm8996-nice-device.dts -- \#include "pmi8994.dtsi" \#include "pmi8996.dtsi" or more likely like this: -- msm8996-some-phone.dts -- \#include "msm8996.dtsi" ... \#include "pmi8994.dtsi" -- msm8996-pmi8996-some-phone.dts -- \#include "msm8996-some-phone.dts" \#include "pmi8996.dtsi" So that we only have to keep 2 DTs for devices that were shipped with both ones, instead of what would be three (device base + pmi8994 + pmi8996) Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210608202143.247427-1-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson commit d4bc18183ee1453e550a3f4cbec0c1ea15999e61 Author: José Roberto de Souza Date: Thu Jul 8 14:18:26 2021 -0700 drm/i915/display/adl_p: Correctly program MBUS DBOX A credits Alderlake-P have different values for MBUS DBOX A credits depending if MBUS join is enabled or not. BSpec: 50343 BSpec: 54369 Cc: Matt Atwood Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210708211827.288601-6-jose.souza@intel.com commit 216d56c5da5c93cb2ae91b911ad6ccfc33e03bee Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:19 2021 -0700 drm/i915/guc/rc: Setup and enable GuCRC feature This feature hands over the control of HW RC6 to the GuC. GuC decides when to put HW into RC6 based on it's internal busyness algorithms. GuCRC needs GuC submission to be enabled, and only supported on Gen12+ for now. When GuCRC is enabled, do not set HW RC6. Use a H2G message to tell GuC to enable GuCRC. When disabling RC6, tell GuC to revert RC6 control back to KMD. KMD is still responsible for enabling everything related to Coarse Power Gating though. v2: Address comments (Michal W) v3: Don't set hysterisis values when GuCRC is used (Matt Roper) v4: checkpatch() Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-15-vinay.belgaumkar@intel.com commit 8ee2c227822e755d0dd4375337e626c9c79c6363 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:18 2021 -0700 drm/i915/guc/slpc: Add SLPC selftest Tests that exercise the SLPC get/set frequency interfaces. Clamp_max will set max frequency to multiple levels and check that SLPC requests frequency lower than or equal to it. Clamp_min will set min frequency to different levels and check if SLPC requests are higher or equal to those levels. v2: Address review comments (Michal W) v3: Checkpatch() corrections v4: Remove unnecessary header file (Matthew Brost) v5: checkpatch() and define const for 50/3 (Matthew Brost) Reviewed-by: Matthew Brost Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-14-vinay.belgaumkar@intel.com commit 41e5c17ebfc20bd840993e9c36e5993298e3fe6d Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:17 2021 -0700 drm/i915/guc/slpc: Sysfs hooks for SLPC Update the get/set min/max freq hooks to work for SLPC case as well. Consolidate helpers for requested/min/max frequency get/set to intel_rps where the proper action can be taken depending on whether SLPC is enabled. v2: Add wrappers for getting rp0/1/n frequencies, update softlimits in set min/max SLPC functions. Also check for boundary conditions before setting them. v3: Address review comments (Michal W) v4: Add helper for host part of intel_rps_set_freq helpers (Michal W) v5: checkpatch() Reviewed-by: Michal Wajdeczko Acked-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Tvrtko Ursulin Signed-off-by: Sujaritha Sundaresan Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-13-vinay.belgaumkar@intel.com commit 025cb07bebfaf9e3703f902cce92b4656129a62b Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:16 2021 -0700 drm/i915/guc/slpc: Cache platform frequency limits Cache rp0, rp1 and rpn platform limits into SLPC structure for range checking while setting min/max frequencies. Also add "soft" limits which keep track of frequency changes made from userland. These are initially set to platform min and max. v2: Address review comments (Michal W) v3: Formatting (Michal W) v4: Add separate function to parse rp values (Michal W) v5: Perform range checking for set min/max (Michal W) v6: checkpatch() and rename static functions (Michal W) v7: check ret code while setting SLPC limits (Michal W) Signed-off-by: Vinay Belgaumkar Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-12-vinay.belgaumkar@intel.com commit 899a0fd73a41f3e3babedbc2e5bf73fd38a4461f Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:15 2021 -0700 drm/i915/guc/slpc: Enable ARAT timer interrupt This interrupt is enabled during RPS initialization, and now needs to be done by SLPC code. It allows ARAT timer expiry interrupts to get forwarded to GuC. v2: Fix comment (Matthew Brost) v3: checkpatch() Reviewed-by: Matthew Brost Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-11-vinay.belgaumkar@intel.com commit f1928ac2a18ffa0784783de09cc6fb5ca17c92f9 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:14 2021 -0700 drm/i915/guc/slpc: Add debugfs for SLPC info This prints out relevant SLPC info from the SLPC shared structure. We will send a H2G message which forces SLPC to update the shared data structure with latest information before reading it. v2: Address review comments (Michal W) v3: Remove unnecessary tasks from slpc_info (Michal W) v4: Rename function to intel_guc_slpc_print_info() (Michal W) v5: checkpatch() Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-10-vinay.belgaumkar@intel.com commit c279bec18e97735aeb4ab2c931da778bb31f4f02 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:13 2021 -0700 drm/i915/guc/slpc: Add get max/min freq hooks Add helpers to read the min/max frequency being used by SLPC. This is done by send a H2G command which forces SLPC to update the shared data struct which can then be read. These helpers will be used in a sysfs patch later on. v2: Address review comments (Michal W) v3: Return err in case of query failure (Michal W) v4: Move decode_min/max_freq to this patch Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-9-vinay.belgaumkar@intel.com commit d41f6f82d319ca0effae840553cac74425328ddf Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:12 2021 -0700 drm/i915/guc/slpc: Add methods to set min/max frequency Add param set h2g helpers to set the min and max frequencies for use by SLPC. v2: Address review comments (Michal W) v3: Check for positive error code (Michal W) v4: Print generic error in set_param (Michal W) Reviewed-by: Michal Wajdeczko Signed-off-by: Sundaresan Sujaritha Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-8-vinay.belgaumkar@intel.com commit db301cffd8a285bbe73879671e6d666a0b654138 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:11 2021 -0700 drm/i915/guc/slpc: Remove BUG_ON in guc_submission_disable The assumption when it was added was that GT would not be holding any gt_pm references. However, uc_init is called from gt_init_hw, which holds a forcewake ref. If SLPC enable fails, we will still be holding this ref, which will result in the BUG_ON. Reviewed-by: Matthew Brost Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-7-vinay.belgaumkar@intel.com commit 63c0eb30bfe9269d79f0cb9cbe6ff86b14928a19 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:10 2021 -0700 drm/i915/guc/slpc: Enable SLPC and add related H2G events Add methods for interacting with GuC for enabling SLPC. Enable SLPC after GuC submission has been established. GuC load will fail if SLPC cannot be successfully initialized. Add various helper methods to set/unset the parameters for SLPC. They can be set using H2G calls or directly setting bits in the shared data structure. v2: Address several review comments, add new helpers for decoding the SLPC min/max frequencies. Use masks instead of hardcoded constants. (Michal W) v3: Split global_state_to_string function, and check for positive non-zero return value from intel_guc_send() (Michal W) v4: Optimize the stringify function and other comments (Michal W) v5: Enable slpc as well before declaring GuC submission status (Michal W) v6: Checkpatch() Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-6-vinay.belgaumkar@intel.com commit 869cd27ece296be710d2039ba930abea3185268f Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:09 2021 -0700 drm/i915/guc/slpc: Allocate, initialize and release SLPC Allocate data structures for SLPC and functions for initializing on host side. v2: Address review comments (Michal W) v3: Remove unnecessary header includes (Michal W) v4: Rebase v5: Move allocation of shared data into slpc_init() (Michal W) Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-5-vinay.belgaumkar@intel.com commit 7695d08f1e30f361502e9c19b6d330234d4ca755 Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:08 2021 -0700 drm/i915/guc/slpc: Adding SLPC communication interfaces Add constants and params that are needed to configure SLPC. v2: Add a new abi header for SLPC. Replace bitfields with genmasks. Address other comments from Michal W. v3: Add slpc H2G format in abi, other review commments (Michal W) v4: Update status bits according to latest spec v5: checkpatch() Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-4-vinay.belgaumkar@intel.com commit 7ba79a671568b8d9d014f7a4c6fc8dfeb70c0d2d Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:07 2021 -0700 drm/i915/guc/slpc: Gate Host RPS when SLPC is enabled Also ensure uc_init is called before we initialize RPS so that we can check for SLPC support. We do not need to enable up/down interrupts when SLPC is enabled. However, we still need the ARAT interrupt, which will be enabled separately later. v2: Explicitly return from intel_rps_enable with slpc check (Matthew B) Reviewed-by: Matthew Brost Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-3-vinay.belgaumkar@intel.com commit dff0fc4990929858eccab824bd310e7fb4bb20ee Author: Vinay Belgaumkar Date: Fri Jul 30 13:21:06 2021 -0700 drm/i915/guc/slpc: Initial definitions for SLPC Add macros to check for SLPC support. This feature is currently supported for Gen12+ and enabled whenever GuC submission is enabled/selected. Include templates for SLPC init/fini and enable. v2: Move SLPC helper functions to intel_guc_slpc.c/.h. Define basic template for SLPC structure in intel_guc_slpc_types.h. Fix copyright (Michal W) v3: Review comments (Michal W) v4: Include supported/selected inside slpc struct (Michal W) Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Signed-off-by: Sundaresan Sujaritha Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-2-vinay.belgaumkar@intel.com commit 6feba6a62c577e98bd9214b73c17860166ac8b91 Author: Douglas Anderson Date: Fri May 21 13:44:53 2021 -0700 PM: AVS: qcom-cpr: Use nvmem_cell_read_variable_le_u32() Let's delete the private function cpr_read_efuse() since it does the basically the same thing as the new API call nvmem_cell_read_variable_le_u32(). Differences between the new API call and the old private function: * less error printing (I assume this is OK). * will give an error if the value doesn't fit in 32-bits (the old code would have truncated silently). Reviewed-by: Bjorn Andersson Acked-by: Niklas Cassel Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20210521134437.v2.1.Id1c70158722750aec0673d60c12e46a9c66bbfed@changeid Signed-off-by: Bjorn Andersson commit edcade2e5e942453f001bd7a0d31f55059cec34f Author: Nobuhiro Iwamatsu Date: Mon May 31 14:12:03 2021 +0900 ASoC: mediatek: mt6359: convert to use module_platform_driver Simplify the code by using module_platform_driver macro for mt6359-accdet. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20210531051203.228567-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Mark Brown commit 726e6f31b1026f62206f1d32b5cbb7e9582c4d03 Merge: b09bff2676be3 7c72dc56a631b Author: Mark Brown Date: Tue Aug 3 23:27:27 2021 +0100 Merge series "arm: ep93xx: CCF conversion" from Nikita Shubin : This series series of patches converts ep93xx to Common Clock Framework. It consists of preparation patches to use clk_prepare_enable where it is needed, instead of clk_enable used in ep93xx drivers prior to CCF and a patch converting mach-ep93xx/clock.c to CCF. Link: https://lore.kernel.org/patchwork/cover/1445563/ Link: https://lore.kernel.org/patchwork/patch/1435884/ v1->v2: - added SoB Alexander Sverdlin (7): iio: ep93xx: Prepare clock before using it spi: spi-ep93xx: Prepare clock before using it Input: ep93xx_keypad: Prepare clock before using it video: ep93xx: Prepare clock before using it dmaengine: ep93xx: Prepare clock before using it ASoC: cirrus: i2s: Prepare clock before using it pwm: ep93xx: Prepare clock before using it Nikita Shubin (1): ep93xx: clock: convert in-place to COMMON_CLK arch/arm/Kconfig | 2 +- arch/arm/mach-ep93xx/clock.c | 975 ++++++++++++++----------- arch/arm/mach-ep93xx/core.c | 2 +- arch/arm/mach-ep93xx/soc.h | 42 +- drivers/dma/ep93xx_dma.c | 6 +- drivers/iio/adc/ep93xx_adc.c | 6 +- drivers/input/keyboard/ep93xx_keypad.c | 4 +- drivers/pwm/pwm-ep93xx.c | 12 +- drivers/spi/spi-ep93xx.c | 4 +- drivers/video/fbdev/ep93xx-fb.c | 4 +- sound/soc/cirrus/ep93xx-i2s.c | 12 +- 11 files changed, 605 insertions(+), 464 deletions(-) base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df -- 2.26.2 commit f3f5798d65167c0f3d50123d7f3df513b73bc9d1 Merge: 8ff9392460ae5 b285b51018a7c Author: Mark Brown Date: Tue Aug 3 23:27:25 2021 +0100 Merge series "ASoC: soc-ops: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-ops. Kuninori Morimoto (4): ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_volsw_sx() ASoC: soc-ops: cleanup cppcheck warning at snd_soc_limit_volume() ASoC: soc-ops: cleanup cppcheck warning at snd_soc_get_xr_sx() ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx() sound/soc/soc-ops.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) -- 2.25.1 commit 8ff9392460ae52846d14f3be3ce7c7bed42fbc68 Merge: 5c8a7efc2fd5e d4321277b3b90 Author: Mark Brown Date: Tue Aug 3 23:27:24 2021 +0100 Merge series "ASoC: SOF/Intel: machine driver updates" from Pierre-Louis Bossart : Two quirks added for Dell XPS 9710 and Intel reference boards, and two minor cleanups. Pierre-Louis Bossart (3): ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710 ASoC: Intel: update sof_pcm512x quirks ASoC: Intel: sof_sdw_max98373: remove useless inits jairaj arava (1): ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682 variant sound/soc/intel/boards/sof_pcm512x.c | 13 +++++++++++-- sound/soc/intel/boards/sof_rt5682.c | 14 ++++++++++++++ sound/soc/intel/boards/sof_sdw.c | 12 ++++++++++++ sound/soc/intel/boards/sof_sdw_max98373.c | 4 ++-- sound/soc/sof/sof-pci-dev.c | 9 +++++++++ 5 files changed, 48 insertions(+), 4 deletions(-) -- 2.25.1 commit 64f67b5240db79eceb0bd57dae8e591fd3103ba0 Author: Hans de Goede Date: Sun Feb 21 12:52:08 2021 +0100 leds: trigger: audio: Add an activate callback to ensure the initial brightness is set Some 2-in-1s with a detachable (USB) keyboard(dock) have mute-LEDs in the speaker- and/or mic-mute keys on the keyboard. Examples of this are the Lenovo Thinkpad10 tablet (with its USB kbd-dock) and the HP x2 10 series. The detachable nature of these keyboards means that the keyboard and thus the mute LEDs may show up after the user (or userspace restoring old mixer settings) has muted the speaker and/or mic. Current LED-class devices with a default_trigger of "audio-mute" or "audio-micmute" initialize the brightness member of led_classdev with ledtrig_audio_get() before registering the LED. This makes the software state after attaching the keyboard match the actual audio mute state, e.g. cat /sys/class/leds/foo/brightness will show the right value. But before this commit nothing was actually calling the led_classdev's brightness_set[_blocking] callback so the value returned by ledtrig_audio_get() was never actually being sent to the hw, leading to the mute LEDs staying in their default power-on state, after attaching the keyboard, even if ledtrig_audio_get() returned a different state. This could be fixed by having the individual LED drivers call brightness_set[_blocking] themselves after registering the LED, but this really is something which should be done by a led-trigger activate callback. Add an activate callback for this, fixing the issue of the mute LEDs being out of sync after (re)attaching the keyboard. Cc: Takashi Iwai Fixes: faa2541f5b1a ("leds: trigger: Introduce audio mute LED trigger") Reviewed-by: Marek Behún Signed-off-by: Hans de Goede Signed-off-by: Pavel Machek commit d6b1715999fc2e215d35f581fb7471bc9c6f16e9 Author: Krzysztof Wilczyński Date: Thu Jul 29 23:37:55 2021 +0000 PCI: Return int from pciconfig_read() syscall Change pciconfig_read() syscall "err" return value from long to int. This makes it consistent with pciconfig_write(). [bhelgaas: commit log] Link: https://lore.kernel.org/r/20210729233755.1509616-2-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit a8bd29bd49c4156ea0ec5a97812333e2aeef44e7 Author: Krzysztof Wilczyński Date: Thu Jul 29 23:37:54 2021 +0000 PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure The pciconfig_read() syscall reads PCI configuration space using hardware-dependent config accessors. If the read fails on PCI, most accessors don't return an error; they pretend the read was successful and got ~0 data from the device, so the syscall returns success with ~0 data in the buffer. When the accessor does return an error, pciconfig_read() normally fills the user's buffer with ~0 and returns an error in errno. But after e4585da22ad0 ("pci syscall.c: Switch to refcounting API"), we don't fill the buffer with ~0 for the EPERM "user lacks CAP_SYS_ADMIN" error. Userspace may rely on the ~0 data to detect errors, but after e4585da22ad0, that would not detect CAP_SYS_ADMIN errors. Restore the original behaviour of filling the buffer with ~0 when the CAP_SYS_ADMIN check fails. [bhelgaas: commit log, fold in Nathan's fix https://lore.kernel.org/r/20210803200836.500658-1-nathan@kernel.org] Fixes: e4585da22ad0 ("pci syscall.c: Switch to refcounting API") Link: https://lore.kernel.org/r/20210729233755.1509616-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 8aa41952ef245449df79100e1942b5e6288b098a Author: Andy Shevchenko Date: Sat May 29 14:19:34 2021 +0300 leds: rt8515: Put fwnode in any case during ->probe() fwnode_get_next_available_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver") Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek Reviewed-by: Linus Walleij commit 7e1baaaa2407a642ea19b58e214fab9a69cda1d7 Author: Andy Shevchenko Date: Sat May 29 14:19:33 2021 +0300 leds: lt3593: Put fwnode in any case during ->probe() device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: 8cd7d6daba93 ("leds: lt3593: Add device tree probing glue") Cc: Daniel Mack Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit d299ae942e0201ce3419501f523fbaac989dd036 Author: Andy Shevchenko Date: Sat May 29 14:19:32 2021 +0300 leds: lm3697: Make error handling more robust It's easy to miss necessary clean up, e.g. firmware node reference counting, during error path in ->probe(). Make it more robust by moving to a single point of return. Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 3a923639d36b1c54866236c2f53d112b797b0101 Author: Andy Shevchenko Date: Sat May 29 14:19:31 2021 +0300 leds: lm3697: Update header block to reflect reality Currently the headers to be included look rather like a random set. Update them a bit to reflect the reality. While at it, drop unneeded dependcy to OF. Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 690e4f3ad363ae5ad27222214509855d40d569a7 Author: Andy Shevchenko Date: Sat May 29 14:19:30 2021 +0300 leds: lm3692x: Correct headers (of*.h -> mod_devicetable.h) There is no user of of*.h headers, but mod_devicetable.h. Update header block accordingly. Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 3dd34dfb09ae814922dd833cad11b215b238a1ba Author: Andy Shevchenko Date: Sat May 29 14:19:29 2021 +0300 leds: lgm-sso: Convert to use list_for_each_entry*() API Convert to use list_for_each_entry*() API insted of open coded variants. It saves few lines of code and makes iteasier to read and maintain. Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit c31ef7004ee1fd417dd9448ba4a43f42090d27fe Author: Andy Shevchenko Date: Sat May 29 14:19:28 2021 +0300 leds: lgm-sso: Remove explicit managed GPIO resource cleanup The idea of managed resources is that they will be cleaned up automatically and in the proper order. Remove explicit GPIO cleanup. Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 1ed4d05e0a0b23ba15e0affcff4008dd537ae3ee Author: Andy Shevchenko Date: Sat May 29 14:19:27 2021 +0300 leds: lgm-sso: Don't spam logs when probe is deferred When requesting GPIO line the probe can be deferred. In such case don't spam logs with an error message. This can be achieved by switching to dev_err_probe(). Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Cc: Amireddy Mallikarjuna reddy Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 9999908ca1abee7aa518a4f6a3739517c137acbf Author: Andy Shevchenko Date: Sat May 29 14:19:26 2021 +0300 leds: lgm-sso: Put fwnode in any case during ->probe() fwnode_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. All the same in fwnode_for_each_child_node() case. Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Cc: Amireddy Mallikarjuna reddy Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit e06ba23b0518875e56e385500613b8651f541742 Author: Andy Shevchenko Date: Sat May 29 14:19:25 2021 +0300 leds: el15203000: Correct headers (of*.h -> mod_devicetable.h) There is no user of of*.h headers, but mod_devicetable.h. Update header block accordingly. Signed-off-by: Andy Shevchenko Reviewed-by: Oleh Kravchenko Signed-off-by: Pavel Machek commit b820c114eba7e105556429031656918ebdd50ab1 Author: Joakim Zhang Date: Tue Aug 3 13:24:24 2021 +0800 net: fec: fix MAC internal delay doesn't work This patch intends to fix MAC internal delay doesn't work, due to use of_property_read_u32() incorrectly, and improve this feature a bit: 1) check the delay value if valid, only program register when it's 2000ps. 2) only enable "enet_2x_txclk" clock when require MAC internal delay. Fixes: fc539459e900 ("net: fec: add MAC internal delayed clock feature support") Signed-off-by: Joakim Zhang Link: https://lore.kernel.org/r/20210803052424.19008-1-qiangqing.zhang@nxp.com Signed-off-by: Jakub Kicinski commit 421297efe63f328c872e6aec059463c37d7bcdd8 Author: Vladimir Oltean Date: Mon Aug 2 22:51:37 2021 +0300 net: dsa: tag_sja1105: consistently fail with arbitrary input Dan Carpenter's smatch tests report that the "vid" variable, populated by sja1105_vlan_rcv when an skb is received by the tagger that has a VLAN ID which cannot be decoded by tag_8021q, may be uninitialized when used here: if (source_port == -1 || switch_id == -1) skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid); The sja1105 driver, by construction, sets up the switch in a way that all data plane packets sent towards the CPU port are VLAN-tagged. So it is practically impossible, in a functional system, for a packet to be processed by sja1110_rcv() which is not a control packet and does not have a VLAN header either. However, it would be nice if the sja1105 tagging driver could consistently do something valid, for example fail, even if presented with packets that do not hold valid sja1105 tags. Currently it is a bit hard to argue that it does that, given the fact that a data plane packet with no VLAN tag will trigger a call to dsa_find_designated_bridge_port_by_vid with a vid argument that is an uninitialized stack variable. To fix this, we can initialize the u16 vid variable with 0, a value that can never be a bridge VLAN, so dsa_find_designated_bridge_port_by_vid will always return a NULL skb->dev. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210802195137.303625-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit c45074d68a9b1e893d86520af71fab37693c3d7e Author: Luiz Augusto von Dentz Date: Mon Aug 2 16:56:19 2021 -0700 Bluetooth: Fix not generating RPA when required Code was checking if random_addr and hdev->rpa match without first checking if the RPA has not been set (BDADDR_ANY), furthermore it was clearing HCI_RPA_EXPIRED before the command completes and the RPA is actually programmed which in case of failure would leave the expired RPA still set. Since advertising instance have a similar problem the clearing of HCI_RPA_EXPIRED has been moved to hci_event.c after checking the random address is in fact the hdev->rap and then proceed to set the expire timeout. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 102793136ce9dacae77c2d1f8dd6878b480f4b95 Author: Luiz Augusto von Dentz Date: Mon Aug 2 16:56:18 2021 -0700 Bluetooth: HCI: Add proper tracking for enable status of adv instances This adds a field to track if advertising instances are enabled or not and only clear HCI_LE_ADV flag if there is no instance left advertising. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 2e19bb35ce15a8b49f4a809469163f668e2d539f Author: Vladimir Oltean Date: Mon Aug 2 14:36:33 2021 +0300 net: bridge: switchdev: fix incorrect use of FDB flags when picking the dst device Nikolay points out that it is incorrect to assume that it is impossible to have an fdb entry with fdb->dst == NULL and the BR_FDB_LOCAL bit in fdb->flags not set. This is because there are reader-side places that test_bit(BR_FDB_LOCAL, &fdb->flags) without the br->hash_lock, and if the updating of the FDB entry happens on another CPU, there are no memory barriers at writer or reader side which would ensure that the reader sees the updates to both fdb->flags and fdb->dst in the same order, i.e. the reader will not see an inconsistent FDB entry. So we must be prepared to deal with FDB entries where fdb->dst and fdb->flags are in a potentially inconsistent state, and that means that fdb->dst == NULL should remain a condition to pick the net_device that we report to switchdev as being the bridge device, which is what the code did prior to the blamed patch. Fixes: 52e4bec15546 ("net: bridge: switchdev: treat local FDBs the same as entries towards the bridge") Suggested-by: Nikolay Aleksandrov Signed-off-by: Vladimir Oltean Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20210802113633.189831-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a0221a0f9ba5820c4a5c0625f965684c6fe76ad7 Author: Alex Elder Date: Mon Aug 2 18:30:19 2021 -0500 Revert "Merge branch 'qcom-dts-updates'" This reverts commit b79c6fba6cd7c49a7dbea9999e182f74cca63e19, reversing these changes made to 0ac26271344478ff718329fa9d4ef81d4bcbc43b: commit 6a0eb6c9d934 ("dt-bindings: net: qcom,ipa: make imem interconnect optional") commit f8bd3c82bf7d ("arm64: dts: qcom: sc7280: add IPA information") commit fd0f72c34bd9 ("arm64: dts: qcom: sc7180: define ipa_fw_mem node") I intend for these commits to go through the Qualcomm repository, to avoid conflicting with other activity being merged there. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210802233019.800250-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 8578880df39cb02dd19812eaa834bfada9e8516f Author: Colin Ian King Date: Tue Aug 3 11:56:17 2021 +0100 octeontx2-af: Fix spelling mistake "Makesure" -> "Make sure" There is a spelling mistake in a NL_SET_ERR_MSG_MOD message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210803105617.338546-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit bebc3bbf5131b7f792b207e8fcac9a798bb23bbf Author: Yajun Deng Date: Tue Aug 3 15:37:39 2021 +0800 net: decnet: Fix refcount warning for new dn_fib_info fib_treeref needs to be set after kzalloc. The old code had a ++ which led to the confusion when the int was replaced by a refcount_t. Fixes: 79976892f7ea ("net: convert fib_treeref from int to refcount_t") Signed-off-by: Yajun Deng Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20210803073739.22339-1-yajun.deng@linux.dev Signed-off-by: Jakub Kicinski commit f16a3bb69aa6baabf8f0aca982c8cf21e2a4f6bc Author: Sergey Shtylyov Date: Sun May 30 22:13:45 2021 +0300 i2c: highlander: add IRQ check The driver is written as if platform_get_irq() returns 0 on errors (while actually it returns a negative error code), blithely passing these error codes to request_irq() (which takes *unsigned* IRQ #) -- which fails with -EINVAL. Add the necessary error check to the pre-existing *if* statement forcing the driver into the polling mode... Fixes: 4ad48e6ab18c ("i2c: Renesas Highlander FPGA SMBus support") Signed-off-by: Sergey Shtylyov Signed-off-by: Wolfram Sang commit 4409273b818cfcbb2f64718d9438629398ac3ae5 Author: Ohhoon Kwon Date: Tue Aug 3 19:13:09 2021 +0900 of: fdt: do not update local variable after use Fix the below warning: drivers/of/fdt.c:196:4: warning: Value stored to 'pprev' is never read [clang-analyzer-deadcode.DeadStores] pprev = &pp->next; ^ ~~~~~~~~~ Signed-off-by: Ohhoon Kwon Link: https://lore.kernel.org/r/20210803101309.904-1-ohoono.kwon@samsung.com Signed-off-by: Rob Herring commit f3c33cbd9221e543bb4dd3c9028aef758fa2aa0e Author: James Clark Date: Thu Jul 29 16:58:04 2021 +0100 perf cs-etm: Improve Coresight zero timestamp warning Only show the warning if the user hasn't already set timeless mode and improve the text because there was ambiguity around the meaning of '...' Change the warning to a UI warning instead of printing straight to stderr because this corrupts the UI when perf report TUI is used. The UI warning function also handles printing to stderr when in perf script mode. Suggested-by: Leo Yan Signed-off-by: James Clark Reviewed-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210729155805.2830-6-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 115520495015591d6a98a5965644cfffd218e399 Author: James Clark Date: Thu Jul 29 16:58:03 2021 +0100 perf tools: Add flag for tracking warnings of missing DSOs Auxtrace support may need DSOs for decoding (for example Arm Coresight). If one of these is missing it would make sense to warn once for each one that's missing, but not flood the output with every address as there could be thousands of lookups. This flag will allow tracking whether a warning was shown for each DSO. Signed-off-by: James Clark Reviewed-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210729155805.2830-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 243c3a3eb4e03201dec36f2edfc4fe604d8b9078 Author: James Clark Date: Thu Jul 29 16:58:02 2021 +0100 perf annotate: Add disassembly warnings for annotate --stdio Currently 'perf annotate --stdio' (and --stdio2) will exit without printing anything if there are disassembly errors. Apply the same error handler that's used for TUI and GTK modes. This makes comparing disassembly across the different modes more consistent. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210729155805.2830-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3d8b92472ae7ba91d759cadb4670bd492ef97d04 Author: James Clark Date: Thu Jul 29 16:58:01 2021 +0100 perf annotate: Re-add annotate_warned functionality Setting annotate_warned to true on errors was removed in commit ee51d851392e ("perf annotate: Introduce strerror for handling symbol__disassemble() errors") which means when 'perf annotate --skip-missing' is used warnings are shown multiple times for the same DSO. Setting this again restores the original behavior of only one warning each. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210729155805.2830-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 1094795eb9f2b17678d944eb38d45af8f8f67362 Author: James Clark Date: Thu Jul 29 16:58:00 2021 +0100 perf tools: Add WARN_ONCE equivalent for UI warnings Currently WARN_ONCE prints to stderr and corrupts the TUI. Add equivalent methods for UI warnings. Signed-off-by: James Clark Reviewed-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210729155805.2830-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d2b10794fc1312f856d67d0a6454aaa3ae96c595 Author: Leon Romanovsky Date: Tue Aug 3 21:20:38 2021 +0300 RDMA/core: Create clean QP creations interface for uverbs Unify create QP creation interface to make clean approach to create XRC_TGT and regular QPs. Link: https://lore.kernel.org/r/5cd50e7d8ad9112545a1a61dea62799a5cb3224a.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5507f67d08cdd947714647caa5c60f96b719fcb7 Author: Leon Romanovsky Date: Tue Aug 3 21:20:37 2021 +0300 RDMA/core: Properly increment and decrement QP usecnts The QP usecnts were incremented through QP attributes structure while decreased through QP itself. Rely on the ib_creat_qp_user() code that initialized all QP parameters prior returning to the user and increment exactly like destroy does. Link: https://lore.kernel.org/r/25d256a3bb1fc480b77d7fe439817b993de48610.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 00a79d6b996d46e9077b0d02a19c87b99305b94a Author: Leon Romanovsky Date: Tue Aug 3 21:20:36 2021 +0300 RDMA/core: Configure selinux QP during creation All QP creation flows called ib_create_qp_security(), but differently. This caused to the need to provide exclusion conditions for the XRC_TGT, because such QP already had selinux configuration call. In order to fix it, move ib_create_qp_security() to the general QP creation routine. Link: https://lore.kernel.org/r/4d7cd6f5828aca37fb62283e6b126b73ab86b18c.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8da9fe4e4fa7d561df0f3fe65bfa6dbf78aa7590 Author: Leon Romanovsky Date: Tue Aug 3 21:20:35 2021 +0300 RDMA/core: Reorganize create QP low-level functions The low-level create QP function grew to be larger than any sensible inline function should be. The inline attribute is not really needed for that function and can be implemented as exported symbol. Link: https://lore.kernel.org/r/2c08709d86f876c3dfb77684357b2a939e570ca4.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 20e2bcc4c2a8ede2fe6e335b9eea357bcfbe79bb Author: Leon Romanovsky Date: Tue Aug 3 21:20:34 2021 +0300 RDMA/core: Remove protection from wrong in-kernel API usage The ib_create_named_qp() is kernel verb that is not used for user supplied attributes. In such case, it is ULP responsibility to provide valid QP attributes. In-kernel API shouldn't check it, exactly like other functions that don't check device capabilities. Link: https://lore.kernel.org/r/b9b9e981d1af148b750750196e686199dbbf61f8.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8fc3beebf623092e446f4c88fca1699c868ca86d Author: Leon Romanovsky Date: Tue Aug 3 21:20:33 2021 +0300 RDMA/core: Delete duplicated and unreachable code The ib_create_named_qp() is kernel verb and no kernel users exist that use XRC_INI QP. Hence such QP path is not reachable. In addition, delete duplicated assignments of QP attributes from the initialization structure. Link: https://lore.kernel.org/r/1b4c0d1def5f8f6d26839e14d19da950cc4a0b05.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5f6bb7e32283b8e3339b7adc00638234ac199cc4 Author: Leon Romanovsky Date: Tue Aug 3 21:20:32 2021 +0300 RDMA/mlx5: Delete not-available udata check XRC_TGT QPs are created through kernel verbs and don't have udata at all. Fixes: 6eefa839c4dd ("RDMA/mlx5: Protect from kernel crash if XRC_TGT doesn't have udata") Fixes: e383085c2425 ("RDMA/mlx5: Set ECE options during QP create") Link: https://lore.kernel.org/r/b68228597e730675020aa5162745390a2d39d3a2.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0f6b56ec958d49e2b3dc955cdac6b62702c04b72 Author: Daeho Jeong Date: Mon Aug 2 21:22:45 2021 -0700 f2fs: add sysfs node to control ra_pages for fadvise seq file fadvise() allows the user to expand the readahead window to double with POSIX_FADV_SEQUENTIAL, now. But, in some use cases, it is not that sufficient and we need to meet the need in a restricted way. We can control the multiplier value of bdi device readahead between 2 (default) and 256 for POSIX_FADV_SEQUENTIAL advise option. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4f993264fe2965c344f223d854ccbb549b16ed71 Author: Chao Yu Date: Tue Aug 3 08:15:43 2021 +0800 f2fs: introduce discard_unit mount option As James Z reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213877 [1.] One-line summary of the problem: Mount multiple SMR block devices exceed certain number cause system non-response [2.] Full description of the problem/report: Created some F2FS on SMR devices (mkfs.f2fs -m), then mounted in sequence. Each device is the same Model: HGST HSH721414AL (Size 14TB). Empirically, found that when the amount of SMR device * 1.5Gb > System RAM, the system ran out of memory and hung. No dmesg output. For example, 24 SMR Disk need 24*1.5GB = 36GB. A system with 32G RAM can only mount 21 devices, the 22nd device will be a reproducible cause of system hang. The number of SMR devices with other FS mounted on this system does not interfere with the result above. [3.] Keywords (i.e., modules, networking, kernel): F2FS, SMR, Memory [4.] Kernel information [4.1.] Kernel version (uname -a): Linux 5.13.4-200.fc34.x86_64 #1 SMP Tue Jul 20 20:27:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [4.2.] Kernel .config file: Default Fedora 34 with f2fs-tools-1.14.0-2.fc34.x86_64 [5.] Most recent kernel version which did not have the bug: None [6.] Output of Oops.. message (if applicable) with symbolic information resolved (see Documentation/admin-guide/oops-tracing.rst) None [7.] A small shell script or example program which triggers the problem (if possible) mount /dev/sdX /mnt/0X [8.] Memory consumption With 24 * 14T SMR Block device with F2FS free -g total used free shared buff/cache available Mem: 46 36 0 0 10 10 Swap: 0 0 0 With 3 * 14T SMR Block device with F2FS free -g total used free shared buff/cache available Mem: 7 5 0 0 1 1 Swap: 7 0 7 The root cause is, there are three bitmaps: - cur_valid_map - ckpt_valid_map - discard_map and each of them will cost ~500MB memory, {cur, ckpt}_valid_map are necessary, but discard_map is optional, since this bitmap will only be useful in mountpoint that small discard is enabled. For a blkzoned device such as SMR or ZNS devices, f2fs will only issue discard for a section(zone) when all blocks of that section are invalid, so, for such device, we don't need small discard functionality at all. This patch introduces a new mountoption "discard_unit=block|segment| section" to support issuing discard with different basic unit which is aligned to block, segment or section, so that user can specify "discard_unit=segment" or "discard_unit=section" to disable small discard functionality. Note that this mount option can not be changed by remount() due to related metadata need to be initialized during mount(). In order to save memory, let's use "discard_unit=section" for blkzoned device by default. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b09bff2676be3ae286e6161a1a581a40c53a3c62 Author: Jason Wang Date: Sat Jul 31 21:33:42 2021 +0800 spi: bcm2835aux: use 'unsigned int' instead of 'unsigned' Prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20210731133342.432575-1-wangborong@cdjrlc.com Signed-off-by: Mark Brown commit 7c72dc56a631b87043e3c5838f5094db30d8c58d Author: Alexander Sverdlin Date: Mon Jul 26 16:59:50 2021 +0300 spi: spi-ep93xx: Prepare clock before using it Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared ep93xx-spi.0 ... Hardware name: Cirrus Logic EDB9302 Evaluation Board ... clk_core_enable clk_core_enable_lock ep93xx_spi_prepare_hardware __spi_pump_messages __spi_sync spi_sync spi_sync_transfer.constprop.0 regmap_spi_write _regmap_raw_write_impl _regmap_bus_raw_write _regmap_update_bits regmap_update_bits_base cs4271_component_probe snd_soc_component_probe soc_probe_component snd_soc_bind_card edb93xx_probe ... spi_master spi0: failed to prepare transfer hardware: -108 Signed-off-by: Alexander Sverdlin Signed-off-by: Nikita Shubin Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210726140001.24820-3-nikita.shubin@maquefel.me Signed-off-by: Mark Brown commit d38d49b140043bba3ea27b89cca5fefaf08e2034 Author: Alistair Francis Date: Tue Aug 3 18:44:54 2021 +1000 regulator: sy7636a: Store the epd-pwr-good GPIO locally Instead of storing the GPIO state in the mfd (where it isn't used) store it in the regulator. Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20210803084456.198-7-alistair@alistair23.me Signed-off-by: Mark Brown commit 4cafe1aeb5fb4eb1778d5e1b91d50a078369dbe1 Author: Alistair Francis Date: Tue Aug 3 18:44:53 2021 +1000 regulator: sy7636a: Use the parent driver data Use the parent's MFD data instead of our data. Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20210803084456.198-6-alistair@alistair23.me Signed-off-by: Mark Brown commit e5dad32d90e0e9b006f5c330e92fa0ec9042ae79 Author: Alistair Francis Date: Tue Aug 3 18:44:52 2021 +1000 regulator: sy7636a: Remove the poll_enable_time From testing on hardware the poll_enable_time isn't required and sometimes causes the driver probe to fail so let's remove it. Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20210803084456.198-5-alistair@alistair23.me Signed-off-by: Mark Brown commit 6bdd1c672a2afbcd1a6d50dc2351ef4ea0bbfc61 Author: Jisheng Zhang Date: Tue Aug 3 16:52:11 2021 +0800 regulator: sy8827n: Enable REGCACHE_FLAT Enable regmap cache to reduce i2c transactions and corresponding interrupts if regulator is accessed frequently. Since the register map is small, we use a FLAT regmap cache. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20210803165211.3b00db29@xhacker.debian Signed-off-by: Mark Brown commit 784ed36958390c511cd48db061401f9ba20ba67a Author: Jisheng Zhang Date: Tue Aug 3 16:50:43 2021 +0800 regulator: sy8824x: Enable REGCACHE_FLAT Enable regmap cache to reduce i2c transactions and corresponding interrupts if regulator is accessed frequently. Since the register map is small -- there's only one register in sy8824c and sy8824e, there are only two registers in sy20276 and sy20278, so we use a FLAT regmap cache. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20210803165043.042ec24d@xhacker.debian Signed-off-by: Mark Brown commit 5c8a7efc2fd5eb716c48d7d7ab4295effbc09ba3 Author: Colin Ian King Date: Sun Aug 1 07:40:23 2021 +0100 ASoC: rt5514: make array div static const, makes object smaller Don't populate the array div on the stack but instead it static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 53894 16368 128 70390 112f6 ./sound/soc/codecs/rt5514.o After: text data bss dec hex filename 53750 16464 128 70342 112c6 ./sound/soc/codecs/rt5514.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801064023.138359-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 0d73297e483e5b7ce197c0a923424e5dd96eae4d Author: Codrin Ciubotariu Date: Tue Aug 3 13:48:25 2021 +0300 ASoC: codecs: ad193x: add support for 96kHz and 192kHz playback rates ad193x devices support 96KHz and 192KHz sampling rates, when PLL/MCLK is referenced to 48kHz. Tested on ad1934. Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20210803104825.2198335-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown commit b285b51018a7ca206401829fb83c8b967c22bfa5 Author: Kuninori Morimoto Date: Tue Aug 3 14:01:00 2021 +0900 ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx() This patch cleanups below cppcheck warning. sound/soc/soc-ops.c:859:18: style: The scope of the variable 'regval' can be reduced. [variableScope] unsigned int i, regval, regmask; ^ sound/soc/soc-ops.c:859:26: style: The scope of the variable 'regmask' can be reduced. [variableScope] unsigned int i, regval, regmask; ^ sound/soc/soc-ops.c:860:6: style: The scope of the variable 'err' can be reduced. [variableScope] int err; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zgtzunoz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b1ebecb90bf69fbd288e873bbf545061f5a6c144 Author: Kuninori Morimoto Date: Tue Aug 3 14:00:55 2021 +0900 ASoC: soc-ops: cleanup cppcheck warning at snd_soc_get_xr_sx() This patch cleanups below cppcheck warning. sound/soc/soc-ops.c:814:15: style: The scope of the variable 'regval' can be reduced. [variableScope] unsigned int regval; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871r7bw29k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 872040f7980b929d75877e7b9d721ea808ce06e1 Author: Kuninori Morimoto Date: Tue Aug 3 14:00:49 2021 +0900 ASoC: soc-ops: cleanup cppcheck warning at snd_soc_limit_volume() This patch cleanups below cppcheck warning. sound/soc/soc-ops.c:576:28: style: The scope of the variable 'mc' can be reduced. [variableScope] struct soc_mixer_control *mc; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8735rrw29q.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 58f42dfd7977599b060996491412fcec688d025d Author: Kuninori Morimoto Date: Tue Aug 3 14:00:37 2021 +0900 ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_volsw_sx() This patch cleanups below cppcheck warning. sound/soc/soc-ops.c:410:30: style: The scope of the variable 'val2' can be reduced. [variableScope] unsigned int val, val_mask, val2 = 0; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/874kc7w2a2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d4321277b3b90474302a9b3b5ca124bcf0f29f00 Author: Pierre-Louis Bossart Date: Mon Aug 2 10:21:51 2021 -0500 ASoC: Intel: sof_sdw_max98373: remove useless inits No need to initialize a variable if the next line overwrites the value. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20210802152151.15832-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 22414cade8dfec25ab94df52b3a4f7aa8edb6120 Author: Pierre-Louis Bossart Date: Mon Aug 2 10:21:50 2021 -0500 ASoC: Intel: update sof_pcm512x quirks The default SOF topology enables SSP capture and DMICs, even though both of these hardware capabilities are not always available in hardware (specific versions of HiFiberry and DMIC kit needed). For the SSP capture, this leads to annoying "SP5-Codec: ASoC: no backend capture" and "streamSSP5-Codec: ASoC: no users capture at close - state 0" errors. Update the quirks to match what the topology needs, which also allows for the ability to remove SSP capture and DMIC support. BugLink: https://github.com/thesofproject/linux/issues/3061 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210802152151.15832-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 46fa9a158327dd40238fa8e76af4bafdfcb8129e Author: jairaj arava Date: Mon Aug 2 10:21:49 2021 -0500 ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682 variant DMI product name is used to support system variants based on adl_mx98373_rt5682 in current implementation. Replace this DMI search with DMI_OEM_STRING and coreboot(BIOS used in these systems) is setting the needed DMI_OEM_STRING field to uniquely identify these systems. Reviewed-by: Bard Liao Signed-off-by: jairaj arava Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802152151.15832-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b8cab69b0ed9ee10f2a86670ce41ffad991c8dc9 Author: Pierre-Louis Bossart Date: Mon Aug 2 10:21:48 2021 -0500 ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710 This device has the same audio subsystem as the 0A5E skew (RT711 headset codec, 2 RT1308 amps and RT715 for mic capture) BugLink: https://github.com/thesofproject/linux/issues/3057 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: FRED OH Link: https://lore.kernel.org/r/20210802152151.15832-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d03ef4daf33a33da8d7c397102fff8ae87d04a93 Author: Wang Shilong Date: Tue Aug 3 09:48:04 2021 -0700 fs: forbid invalid project ID fileattr_set_prepare() should check if project ID is valid, otherwise dqget() will return NULL for such project ID quota. Signed-off-by: Wang Shilong Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 20da44dfe8eff5b61685e394dec690a5d9dc36ce Author: Leon Romanovsky Date: Fri Jul 23 14:39:51 2021 +0300 RDMA/mlx5: Drop in-driver verbs object creations There is no real value in bypassing IB/core APIs for creating standard objects with standard types. The open-coded variant didn't have any restrack task management calls and caused to such objects to be not present when running rdmatoool. Link: https://lore.kernel.org/r/f745590e5fb7d56f90fdb25f64ee3983ba17e1e4.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 514aee660df493cd673154a6ba6bab745ec47b8c Author: Leon Romanovsky Date: Fri Jul 23 14:39:50 2021 +0300 RDMA: Globally allocate and release QP memory Convert QP object to follow IB/core general allocation scheme. That change allows us to make sure that restrack properly kref the memory. Link: https://lore.kernel.org/r/48e767124758aeecc433360ddd85eaa6325b34d9.1627040189.git.leonro@nvidia.com Reviewed-by: Gal Pressman #efa Tested-by: Gal Pressman Reviewed-by: Dennis Dalessandro #rdma and core Tested-by: Dennis Dalessandro Signed-off-by: Leon Romanovsky Tested-by: Tatyana Nikolova Signed-off-by: Jason Gunthorpe commit 44da3730e046a784d088157175d9418ba60661fc Author: Leon Romanovsky Date: Fri Jul 23 14:39:49 2021 +0300 RDMA/rdmavt: Decouple QP and SGE lists allocations The rdmavt QP has fields that are both needed for the control and data path. Such mixed declaration caused to the very specific allocation flow with kzalloc_node and SGE list embedded into the struct rvt_qp. This patch separates QP creation to two: regular memory allocation for the control path and specific code for the SGE list, while the access to the later is performed through derefenced pointer. Such pointer and its context are expected to be in the cache, so performance difference is expected to be negligible, if any exists. Link: https://lore.kernel.org/r/f66c1e20ccefba0db3c69c58ca9c897f062b4d1c.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0dc0da15ed7d1f50ec3ef0cdbb7f2975abefec1f Author: Leon Romanovsky Date: Fri Jul 23 14:39:48 2021 +0300 RDMA/mlx5: Rework custom driver QP type creation Starting from commit 2b1f747071c5 ("RDMA/core: Allow drivers to disable restrack DB") the restrack is able to handle non-standard QP types either. That change allows us to rewrite custom QP calls to their IB/core counterparts, so we will use general QP creation flow even for the driver QP types. Link: https://lore.kernel.org/r/51682ab82298748941f38bd23ee3bf77ef1cab7b.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8c9e7f0325fe57ef55bacfa82d10857b4433fef3 Author: Leon Romanovsky Date: Fri Jul 23 14:39:47 2021 +0300 RDMA/mlx5: Delete device resource mutex that didn't protect anything The dev->devr.mutex was intended to protect GSI QP pointer change in the struct mlx5_ib_port_resources when it is accessed from the pkey_change_work. However that pointer isn't changed during the runtime and once IB/core adds MAD, it stays stable. Link: https://lore.kernel.org/r/6e338c561033df20d92e1371fc6a7a0d93aad945.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b0791dbf1214a9e539fa8507b4b7e50f5367b79a Author: Leon Romanovsky Date: Fri Jul 23 14:39:46 2021 +0300 RDMA/mlx5: Cancel pkey work before destroying device resources In the driver release flow, we are ensuring that notifier is disabled and no new works can be added to pkey_change_handler. It means that we can cancel that handler before destroying resources to make sure that our unwind routine is symmetrical to the allocation one. Link: https://lore.kernel.org/r/f2b1ea1bad952e4e7a48a6f731de9e0344986b29.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f9193d266347fe9bed5c173e7a1bf96268142a79 Author: Leon Romanovsky Date: Fri Jul 23 14:39:45 2021 +0300 RDMA/efa: Remove double QP type assignment The QP type is set by the IB/core and shouldn't be set in the driver. Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation") Link: https://lore.kernel.org/r/838c40134c1590167b888ca06ad51071139ff2ae.1627040189.git.leonro@nvidia.com Acked-by: Gal Pressman Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e66e49592b690d6abd537cc207b07a3db2f413d0 Author: Leon Romanovsky Date: Fri Jul 23 14:39:44 2021 +0300 RDMA/hns: Don't overwrite supplied QP attributes QP attributes that were supplied by IB/core already have all parameters set when they are passed to the driver. The drivers are not supposed to change anything in struct ib_qp_init_attr. Fixes: 66d86e529dd5 ("RDMA/hns: Add UD support for HIP09") Link: https://lore.kernel.org/r/5987138875e8ade9aa339d4db6e1bd9694ed4591.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4ffd3b800e9722ea44fc3755e72d026dd530dc4e Author: Leon Romanovsky Date: Fri Jul 23 14:39:43 2021 +0300 RDMA/hns: Don't skip IB creation flow for regular RC QP The call to internal QP creation function skips QP creation checks and misses the addition of such device QPs to the restrack DB. As a preparation to general allocation scheme, convert hns to use proper API. Link: https://lore.kernel.org/r/7b236c15f7d5abb368958297ac6962d8459cb824.1627040189.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f1f264b4c134ee65cdadece7a20f3c0643602a4a Author: Andreas Gruenbacher Date: Mon Aug 2 14:46:31 2021 -0700 iomap: Fix some typos and bad grammar Fix some typos and bad grammar in buffered-io.c to make the comments easier to read. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b405435b419cb660455ba54fd47086216e58fed6 Author: Matthew Wilcox (Oracle) Date: Mon Aug 2 14:45:57 2021 -0700 iomap: Support inline data with block size < page size Remove the restriction that inline data must start on a page boundary in a file. This allows, for example, the first 2KiB to be stored out of line and the trailing 30 bytes to be stored inline. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 69f4a26c1e0c7c5e5e77c5bd7b271743c124c545 Author: Gao Xiang Date: Tue Aug 3 09:38:22 2021 -0700 iomap: support reading inline data from non-zero pos The existing inline data support only works for cases where the entire file is stored as inline data. For larger files, EROFS stores the initial blocks separately and the remainder of the file ("file tail") adjacent to the inode. Generalise inline data to allow reading the inline file tail. Tails may not cross a page boundary in memory. We currently have no filesystems that support tails and writing, so that case is currently disabled (see iomap_write_begin_inline). Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andreas Gruenbacher Signed-off-by: Gao Xiang Signed-off-by: Darrick J. Wong commit c1b79f11f4ec27d3b3197a9584950a3be178c717 Author: Christoph Hellwig Date: Mon Aug 2 14:43:43 2021 -0700 iomap: simplify iomap_add_to_ioend Now that the outstanding writes are counted in bytes, there is no need to use the low-level __bio_try_merge_page API, we can switch back to always using bio_add_page and simply iomap_add_to_ioend again. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d0364f9490d7e098963ce4d146b51f9cd1199412 Author: Christoph Hellwig Date: Mon Aug 2 14:43:43 2021 -0700 iomap: simplify iomap_readpage_actor Now that the outstanding reads are counted in bytes, there is no need to use the low-level __bio_try_merge_page API, we can switch back to always using bio_add_page and simplify iomap_readpage_actor again. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e96595c55d2397dde599779d75112d21989b37b9 Author: Mark Brown Date: Tue Aug 3 15:04:50 2021 +0100 kselftest/arm64: Add a TODO list for floating point tests Write down some ideas for additional coverage for floating point in case someone feels inspired to look into them. Signed-off-by: Mark Brown Reviewed-by: Dave Martin Link: https://lore.kernel.org/r/20210803140450.46624-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 95cf3f23877b682c56899aa34f9cdd2f910b8924 Author: Mark Brown Date: Tue Aug 3 15:04:49 2021 +0100 kselftest/arm64: Add tests for SVE vector configuration We provide interfaces for configuring the SVE vector length seen by processes using prctl and also via /proc for configuring the default values. Provide tests that exercise all these interfaces and verify that they take effect as expected, though at present no test fully enumerates all the possible vector lengths. A subset of this is already tested via sve-probe-vls but the /proc interfaces are not currently covered at all. In preparation for the forthcoming support for SME, the Scalable Matrix Extension, which has separately but similarly configured vector lengths which we expect to offer similar userspace interfaces for, all the actual files and prctls used are parameterised and we don't validate that the architectural minimum vector length is the minimum we see. Signed-off-by: Mark Brown Reviewed-by: Dave Martin Link: https://lore.kernel.org/r/20210803140450.46624-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit b43ab36a6d86f6c693f5919ee2cf25c543446213 Author: Mark Brown Date: Tue Aug 3 15:04:48 2021 +0100 kselftest/arm64: Validate vector lengths are set in sve-probe-vls Currently sve-probe-vls does not verify that the vector lengths reported by the prctl() interface are actually what is reported by the architecture, use the rdvl_sve() helper to validate this. Signed-off-by: Mark Brown Reviewed-by: Dave Martin Link: https://lore.kernel.org/r/20210803140450.46624-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 7710861017ac25b9b459f3a7f8f1a3332db9ccbe Author: Mark Brown Date: Tue Aug 3 15:04:47 2021 +0100 kselftest/arm64: Provide a helper binary and "library" for SVE RDVL SVE provides an instruction RDVL which reports the currently configured vector length. In order to validate that our vector length configuration interfaces are working correctly without having to build the C code for our test programs with SVE enabled provide a trivial assembly library with a C callable function that executes RDVL. Since these interfaces also control behaviour on exec*() provide a trivial wrapper program which reports the currently configured vector length on stdout, tests can use this to verify that behaviour on exec*() is as expected. In preparation for providing similar helper functionality for SME, the Scalable Matrix Extension, which allows separately configured vector lengths to be read back both the assembler function and wrapper binary have SVE included in their name. Signed-off-by: Mark Brown Reviewed-by: Dave Martin Link: https://lore.kernel.org/r/20210803140450.46624-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 312b7104f39bcb4f7fb4dceeab1e9ae82c7083c8 Author: Jason Wang Date: Tue Aug 3 22:20:20 2021 +0800 arm64: fix typo in a comment The double 'the' after 'If' in this comment "If the the TLB range ops are supported..." is repeated. Consequently, one 'the' should be removed from the comment. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20210803142020.124230-1-wangborong@cdjrlc.com Signed-off-by: Catalin Marinas commit 70a4039bd4d723c9b86b365bf1cd2395beed2d07 Author: Masahiro Yamada Date: Thu Jul 29 23:05:27 2021 +0900 arm64: move the (z)install rules to arch/arm64/Makefile Currently, the (z)install targets in arch/arm64/Makefile descend into arch/arm64/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/arm64/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20210729140527.443116-1-masahiroy@kernel.org Signed-off-by: Catalin Marinas commit 7a062ce31807eb402c38edbec50c1b848b4298f3 Author: Yee Lee Date: Tue Aug 3 15:08:22 2021 +0800 arm64/cpufeature: Optionally disable MTE via command-line MTE support needs to be optionally disabled in runtime for HW issue workaround, FW development and some evaluation works on system resource and performance. This patch makes two changes: (1) moves init of tag-allocation bits(ATA/ATA0) to cpu_enable_mte() as not cached in TLB. (2) allows ID_AA64PFR1_EL1.MTE to be overridden on its shadow value by giving "arm64.nomte" on cmdline. When the feature value is off, ATA and TCF will not set and the related functionalities are accordingly suppressed. Suggested-by: Catalin Marinas Suggested-by: Marc Zyngier Suggested-by: Suzuki K Poulose Signed-off-by: Yee Lee Link: https://lore.kernel.org/r/20210803070824.7586-2-yee.lee@mediatek.com Signed-off-by: Catalin Marinas commit e67adaa1754d5383583c35a703518507e457482b Author: Sebastian Andrzej Siewior Date: Tue Aug 3 16:15:59 2021 +0200 sgi-xpc: Replace deprecated CPU-hotplug functions. The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Robin Holt Cc: Steve Wahl Cc: Mike Travis Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20210803141621.780504-17-bigeasy@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 1ae14df56cc3e87d56f3c159803a289021f8ef7d Author: Ramji Jiyani Date: Mon Aug 2 22:04:45 2021 +0000 binder: Add invalid handle info in user error log In the case of a failed transaction, only the thread and process id are logged. Add the handle info for the reference to the target node in user error log to aid debugging. Acked-by: Todd Kjos Signed-off-by: Ramji Jiyani Link: https://lore.kernel.org/r/20210802220446.1938347-1-ramjiyani@google.com Signed-off-by: Greg Kroah-Hartman commit d1254593e705e3ef088195850959b4adc878fcee Author: Colin Ian King Date: Tue Aug 3 13:28:39 2021 +0100 ALSA: usb-audio: make array static const, makes object smaller Don't populate array names_to_check on the stack but instead it static. Makes the object code smaller by 56 bytes. Also clean up checkpatch warning by adding extra const for names_to_check and pointer s. Before: text data bss dec hex filename 103512 34380 0 137892 21aa4 ./sound/usb/mixer.o After: text data bss dec hex filename 103264 34572 0 137836 21a6c ./sound/usb/mixer.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210803122839.7143-1-colin.king@canonical.com Signed-off-by: Takashi Iwai commit 233624e0d5a0854638eff9e77fc37161890e9440 Author: Imre Deak Date: Mon Aug 2 22:01:48 2021 +0300 drm/i915: Apply CMTG clock disabling WA while DPLL0 is enabled CI test results/further experiments show that the workaround added in commit 573d7ce4f69a ("drm/i915/adlp: Add workaround to disable CMTG clock gating") can be applied only while DPLL0 is enabled. If it's disabled the TRANS_CMTG_CHICKEN register is not accessible. Accordingly move the WA to DPLL0 HW state sanitization and enabling. This fixes an issue where the WA won't get applied (and a WARN is thrown due to an unexpected value in TRANS_CMTG_CHICKEN) if the driver is loaded without DPLL0 being enabled: booting without BIOS enabling an output with this PLL, or reloading the driver. While at it also add a debug print for the unexpected register value. Cc: José Roberto de Souza Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210802190148.2099625-1-imre.deak@intel.com commit a7a48b40c7990749b933250aca5030b3a0bad193 Merge: c27479d762de4 c3cdc019a6bf0 Author: Mauro Carvalho Chehab Date: Tue Aug 3 15:36:58 2021 +0200 Merge commit 'c3cdc019a6bf' into media_tree * commit 'c3cdc019a6bf': media: atomisp: pci: reposition braces as per coding style media: atomisp: i2c: Remove a superfluous else clause in atomisp-mt9m114.c media: atomisp: Move MIPI_PORT_LANES to the only user media: atomisp: Perform a single memset() for union media: atomisp: pci: fix error return code in atomisp_pci_probe() media: atomisp: pci: Remove unnecessary (void *) cast media: atomisp: pci: Remove checks before kfree/kvfree media: atomisp: Remove unused port_enabled variable media: atomisp: Annotate a couple of definitions with __maybe_unused media: atomisp: Remove unused declarations media: atomisp: remove the repeated declaration media: atomisp: improve error handling in gc2235_detect() media: atomisp: Fix whitespace at the beginning of line media: atomisp: Align block comments media: atomisp: Use sysfs_emit() instead of sprintf() where appropriate media: atomisp: Fix line continuation style issue in sh_css.c media: atomisp: Use kcalloc instead of kzalloc with multiply in sh_css.c media: atomisp: Remove unnecessary parens in sh_css.c media: atomisp: Resolve goto style issue in sh_css.c media: atomisp: fix the uninitialized use and rename "retvalue" commit a6cae77f1bc89368a4e2822afcddc45c3062d499 Author: Michal Suchanek Date: Thu Jul 29 20:01:03 2021 +0200 powerpc/stacktrace: Include linux/delay.h commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") introduces udelay() call without including the linux/delay.h header. This may happen to work on master but the header that declares the functionshould be included nonetheless. Fixes: 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") Signed-off-by: Michal Suchanek Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729180103.15578-1-msuchanek@suse.de commit 71737a6c2a8f801622d2b71567d1ec1e4c5b40b8 Author: Gautham R. Shenoy Date: Mon Jul 19 12:03:19 2021 +0530 cpuidle: pseries: Do not cap the CEDE0 latency in fixup_cede0_latency() Currently in fixup_cede0_latency() code, we perform the fixup the CEDE(0) exit latency value only if minimum advertized extended CEDE latency values are less than 10us. This was done so as to not break the expected behaviour on POWER8 platforms where the advertised latency was higher than the default 10us, which would delay the SMT folding on the core. However, after the earlier patch "cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards", we can be sure that the fixup of CEDE0 latency is going to happen only from POWER10 onwards. Hence unconditionally use the minimum exit latency provided by the platform. Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1626676399-15975-3-git-send-email-ego@linux.vnet.ibm.com commit 50741b70b0cbbafbd9199f5180e66c0c53783a4a Author: Gautham R. Shenoy Date: Mon Jul 19 12:03:18 2021 +0530 cpuidle: pseries: Fixup CEDE0 latency only for POWER10 onwards Commit d947fb4c965c ("cpuidle: pseries: Fixup exit latency for CEDE(0)") sets the exit latency of CEDE(0) based on the latency values of the Extended CEDE states advertised by the platform On POWER9 LPARs, the firmwares advertise a very low value of 2us for CEDE1 exit latency on a Dedicated LPAR. The latency advertized by the PHYP hypervisor corresponds to the latency required to wakeup from the underlying hardware idle state. However the wakeup latency from the LPAR perspective should include 1. The time taken to transition the CPU from the Hypervisor into the LPAR post wakeup from platform idle state 2. Time taken to send the IPI from the source CPU (waker) to the idle target CPU (wakee). 1. can be measured via timer idle test, where we queue a timer, say for 1ms, and enter the CEDE state. When the timer fires, in the timer handler we compute how much extra timer over the expected 1ms have we consumed. On a a POWER9 LPAR the numbers are CEDE latency measured using a timer (numbers in ns) N Min Median Avg 90%ile 99%ile Max Stddev 400 2601 5677 5668.74 5917 6413 9299 455.01 1. and 2. combined can be determined by an IPI latency test where we send an IPI to an idle CPU and in the handler compute the time difference between when the IPI was sent and when the handler ran. We see the following numbers on POWER9 LPAR. CEDE latency measured using an IPI (numbers in ns) N Min Median Avg 90%ile 99%ile Max Stddev 400 711 7564 7369.43 8559 9514 9698 1200.01 Suppose, we consider the 99th percentile latency value measured using the IPI to be the wakeup latency, the value would be 9.5us This is in the ballpark of the default value of 10us. Hence, use the exit latency of CEDE(0) based on the latency values advertized by platform only from POWER10 onwards. The values advertized on POWER10 platforms is more realistic and informed by the latency measurements. For earlier platforms stick to the default value of 10us. The fix was suggested by Michael Ellerman. Fixes: d947fb4c965c ("cpuidle: pseries: Fixup exit latency for CEDE(0)") Reported-by: Enrico Joedecke Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1626676399-15975-2-git-send-email-ego@linux.vnet.ibm.com commit de5012b41e5c900a8a3875c7a825394c5f624c05 Author: Ilya Leoshkevich Date: Wed Jul 28 23:25:46 2021 +0200 s390/ftrace: implement hotpatching s390 allows hotpatching the mask of a conditional jump instruction. Make use of this feature in order to avoid the expensive stop_machine() call. The new trampolines are split in 3 stages: - A first stage is a 6-byte relative conditional long branch located at each function's entry point. Its offset always points to the second stage for the corresponding function, and its mask is either all 0s (ftrace off) or all 1s (ftrace on). The code for flipping the mask is borrowed from ftrace_{enable,disable}_ftrace_graph_caller. After flipping, ftrace_arch_code_modify_post_process() syncs with all the other CPUs by sending SIGPs. - Second stages for vmlinux are stored in a separate part of the .text section reserved by the linker script, and in dynamically allocated memory for modules. This prevents the icache pollution. The total size of second stages is about 1.5% of that of the kernel image. Putting second stages in the .bss section is possible and decreases the size of the non-compressed vmlinux, but splits the kernel 1:1 mapping, which is a bad tradeoff. Each second stage contains a call to the third stage, a pointer to the part of the intercepted function right after the first stage, and a pointer to an interceptor function (e.g. ftrace_caller). Second stages are 8-byte aligned for the future direct calls implementation. - There are only two copies of the third stage: in the .text section for vmlinux and in dynamically allocated memory for modules. It can be an expoline, which is relatively large, so inlining it into each second stage is prohibitively expensive. As a result of this organization, phoronix-test-suite with ftrace off does not show any performance degradation. Suggested-by: Sven Schnelle Suggested-by: Vasily Gorbik Co-developed-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20210728212546.128248-3-iii@linux.ibm.com Signed-off-by: Heiko Carstens commit 67ccddf86621b18dbffe56f11a106774ee8f44bd Author: Ilya Leoshkevich Date: Wed Jul 28 23:25:45 2021 +0200 ftrace: Introduce ftrace_need_init_nop() Implementing live patching on s390 requires each function's prologue to contain a very special kind of nop, which gcc and clang don't generate. However, the current code assumes that if CC_USING_NOP_MCOUNT is defined, then whatever the compiler generates is good enough. Move the CC_USING_NOP_MCOUNT check into the new ftrace_need_init_nop() macro, that the architectures can override. An alternative solution is to disable using -mnop-mcount in the Makefile, however, this makes the build logic (even) more complicated and forces the arch-specific code to deal with the useless __fentry__ symbol. Signed-off-by: Ilya Leoshkevich Reviewed-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/20210728212546.128248-2-iii@linux.ibm.com Signed-off-by: Heiko Carstens commit 8c054cd2818ea08555efe24a2ffde330833c2f3f Author: Suman Anna Date: Thu Jul 29 17:46:21 2021 -0500 ARM: dts: am57xx: Add PRUSS MDIO controller nodes The PRUSSs on AM57xx SoCs contain an MDIO controller that can be used to control external PHYs associated with the Industrial Ethernet peripherals within each PRUSS. The MDIO module used within the PRU-ICSS is an instance of the MDIO Controller used in TI Davinci SoCs. The same bus frequency of 1 MHz is chosen as the regular MDIO node. The nodes are added in the common am57-pruss.dtsi file and enabled by default, but are disabled in all the existing AM57xx board dts files. These nodes need pinctrl lines, and so should be enabled only on boards where they are actually wired and pinned out for PRUSS Ethernet. Any new board dts file should disable these if they are not sure. Signed-off-by: Suman Anna Signed-off-by: Andrew F. Davis Signed-off-by: Tony Lindgren commit b8afeaee9d03f644f72b35e8433c9c2f651ade9c Author: Suman Anna Date: Thu Jul 29 17:46:20 2021 -0500 ARM: dts: am57xx: Add PRU-ICSS nodes Add the DT nodes for the PRU-ICSS1 and PRU-ICSS2 processor subsystems that are present on AM57xx family of SoCs. Each PRU-ICSS instance is represented by a pruss node and other child nodes. The two PRU-ICSSs are identical to each other. They are not supported on DRA7xx SoCs in general, so the nodes are added under the respective interconnect target module nodes in a common am57-pruss.dtsi file. The file is already included only in the AM57xx related board files. The PRU-ICSSs on AM57xx are very similar to the PRUSS in AM33xx and AM437x except for variations in the RAM sizes and the number of interrupts coming into the MPU INTC. The interrupt events into the PRU-ICSS also requires programming of the corresponding crossbars properly. The PRUSS subsystem node contains the entire address space. The various sub-modules of the PRU-ICSS are represented as individual child nodes (so platform devices themselves) of the PRUSS subsystem node. These include the two PRU cores and the interrupt controller. All the Data RAMs are represented within a child node of its own named 'memories' without any compatible. The Real Time Media Independent Interface controller (MII_RT), and the CFG sub-module are represented as syscon nodes. The PRUSS CFG module has a clock mux for IEP clock, this clk node is added under the CFG child node 'clocks'. The default source for this mux clock is the ICSS_IEP_CLK clock. The DT nodes use all standard properties. The regs property in the PRU nodes define the addresses for the Instruction RAM, the Debug and Control sub-modules for that PRU core. The firmware for each PRU core is defined through a 'firmware-name' property. The default names for the firmware images for each PRU core are defined as follows (these can be adjusted either in derivative board dts files or through sysfs at runtime if required): PRU-ICSS1 PRU0 Core: am57xx-pru1_0-fw PRU-ICSS1 PRU1 Core: am57xx-pru1_1-fw PRU-ICSS2 PRU0 Core: am57xx-pru2_0-fw PRU-ICSS2 PRU1 Core: am57xx-pru2_1-fw Note: 1. There are few more sub-modules like the Industrial Ethernet Peripheral (IEPs), MDIO, UART, eCAP that do not have bindings and so will be added in the future. 2. The PRUSS INTC on AM57xx SoCs also connect the host interrupts 6 and 7 as possible DMA events, so use the 'ti,irqs-reserved' property in derivative board dts files _if_ any of them should not be handled by the host OS. Signed-off-by: Suman Anna Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit 670be468b3f3177fe5e22fede270a7b158f0d7c6 Author: Andrew F. Davis Date: Thu Jul 29 17:46:19 2021 -0500 ARM: dts: am4372: Add PRUSS MDIO controller node The PRU-ICSS1 instance on AM437x SoCs has a MDIO sub-module that can be used to control external PHYs associated with the Industrial Ethernet peripherals within the PRUSS. The MDIO module used within this PRU-ICSS is an instance of the MDIO Controller used in TI Davinci SoCs. The same bus frequency of 1 MHz is chosen as the regular MDIO node. Note that there is no MDIO node added to the smaller PRU-ICSS0 instance as the MDIO pins are not pinned out. The node is added and enabled in the common am4372.dtsi file by default, and disabled in all the existing AM437x board dts files. This node needs pinctrl lines, and so should be enabled only on boards where they are actually wired and pinned out for PRUSS Ethernet. Any new board dts file should disable these if they are not sure. Signed-off-by: Andrew F. Davis [s-anna@ti.com: fix reg address, add commit description] Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 0de8049ed4cb8c4a00fa3d7e60d8120148b42ff9 Author: Suman Anna Date: Thu Jul 29 17:46:18 2021 -0500 ARM: dts: am4372: Add the PRU-ICSS0 DT node The AM4376+ SoCs have a second smaller PRU-ICSS subsystem (PRUSS0) in addition to the primary PRUSS1 instance. The PRUSS0 has less DRAM per PRU, and no Shared DRAM among other minor differences. The IEP and MII_RT modules even though present within the IP are not pinned out. This PRUSS0 instance has a weird SoC integration. It shares the same L3 OCP interconnect interface with PRUSS1, and also shares its reset line and clocks. Any external accesses from PRUSS0 requires the PRUSS1's PRUSS_SYSCFG register to be programmed properly. That said, it is its own IP instance (a cut-down version), and so it has been added as an independent node (sibling node to PRUSS1 node) and a child node of the corresponding PRUSS target module interconnect node. This allows the PRUSS0 instance to be enabled/disabled independently of the PRUSS1 instance. The nodes are added under the corresponding interconnect target module node in the common am4372 dtsi file. The PRU-ICSS instances are not supported on AM4372 SoC though in the AM437x family, so the interconnect target module node should be disabled in any derivative board dts file that uses AM4372 SoCs. The individual PRUSS node can be disabled in the corresponding board dts file if desired. The default names for the firmware images for each PRU core are defined as follows (these can be adjusted either in derivative board dts files or through sysfs at runtime if required): PRU-ICSS0 PRU0 Core: am437x-pru0_0-fw PRU-ICSS0 PRU1 Core: am437x-pru0_1-fw Note: 1. There are few more sub-modules like the Industrial Ethernet Peripheral (IEP), eCAP, UART, that do not have bindings and so will be added in the future. Only UART is pinned out, so others should be added in disabled state if added. 2. The PRUSS0 INTC on AM437x SoCs routes the host interrupt 5 to the other PRUSS1, so it is already marked reserved through the 'ti,irqs-reserved' property. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 152b53b41dc0ea48e3893ecccb13ba35bfbfce0d Author: Suman Anna Date: Thu Jul 29 17:46:17 2021 -0500 ARM: dts: am4372: Add the PRU-ICSS1 DT node Add the DT node for the PRU-ICSS1 instance on the AM437x family of SoCs. Each PRU-ICSS instance is represented by a pruss node and other child nodes. The nodes are added under the interconnect target module node in the common am4372 dtsi file. The PRU-ICSS instances are supported only on AM4376+ SoCs though in the AM437x family, so the interconnect target module node should be disabled in any derivative board dts file that uses AM4372 SoCs. The PRU-ICSS1 on AM437x is very similar to the PRUSS in AM33xx, except for variations in the RAM sizes, bus addresses and the number of interrupts coming into the MPU INTC (host interrupt 5 is routed to the other PRUSS instead of MPU). The PRUSS subsystem node contains the entire address space. The various sub-modules of the PRU-ICSS are represented as individual child nodes (so platform devices themselves) of the PRUSS subsystem node. These include the two PRU cores and the interrupt controller. All the Data RAMs are represented within a child node of its own named 'memories' without any compatible. The Real Time Media Independent Interface controller (MII_RT), and the CFG sub-module are represented as syscon nodes. The PRUSS CFG module has a clock mux for IEP clock, this clk node is added under the CFG child node 'clocks'. The default source for this mux clock is the PRU_ICSS_IEP_GCLK clock. The DT nodes use all standard properties. The regs property in the PRU nodes define the addresses for the Instruction RAM, the Debug and Control sub-modules for that PRU core. The firmware for each PRU core is defined through a 'firmware-name' property. The default names for the firmware images for each PRU core are defined as follows (these can be adjusted either in derivative board dts files or through sysfs at runtime if required): PRU-ICSS1 PRU0 Core: am437x-pru1_0-fw PRU-ICSS1 PRU1 Core: am437x-pru1_1-fw Note: 1. There are few more sub-modules like the Industrial Ethernet Peripheral (IEP), MDIO, UART, eCAP that do not have bindings and so will be added in the future. 2. The PRUSS INTC on AM437x SoCs also connect the host interrupt 0 to ADC0 and ADC1; 6 and 7 as possible DMA events, so use the 'ti,irqs-reserved' property in derivative board dts files _if_ any of them should not be handled by the host OS. Host interrupt 5 is already marked reserved as it is connected to the other PRUSS instance. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 8668711b00154b190dbb8f9ef5b3e189041f2b73 Author: Suman Anna Date: Thu Jul 29 17:46:16 2021 -0500 ARM: dts: am335x-icev2: Enable PRU-ICSS module The PRU-ICSS target module node was left in disabled state in the base am33xx-l4.dtsi file. PRU-ICSS is supported on the AM335x ICEv2 board, so enable this node to support PRUSS on this board. The PRUSS node and most of its child nodes are already enabled in the base dts file, and so become effective automatically with the enabling of this PRU-ICSS target module node. The corresponding PRU nodes can be disabled later on if there are no use-cases defined to use a particular PRU core or the whole PRU-ICSS subsystem itself if both its PRU cores are unused. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 7acf5661b6a1298ff6489e343867e43fa48aac81 Author: Suman Anna Date: Thu Jul 29 17:46:15 2021 -0500 ARM: dts: am335x-evmsk: Enable PRU-ICSS module The PRU-ICSS target module node was left in disabled state in the base am33xx-l4.dtsi file. PRU-ICSS is supported on the AM335x SK EVM board, so enable this node to support PRUSS on this board. The PRUSS node and most of its child nodes are already enabled in the base dts file, and so become effective automatically with the enabling of this PRU-ICSS target module node. The corresponding PRU nodes can be disabled later on if there are no use-cases defined to use a particular PRU core or the whole PRU-ICSS subsystem itself if both its PRU cores are unused. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 6bcf2b67e06ae40a84033d68c9f38c1586794f7d Author: Suman Anna Date: Thu Jul 29 17:46:14 2021 -0500 ARM: dts: am335x-evm: Enable PRU-ICSS module The PRU-ICSS target module node was left in disabled state in the base am33xx-l4.dtsi file. PRU-ICSS is supported on the AM335x EVM, so enable this node on the AM335x EVM. The PRUSS node and most of its child nodes are already enabled in the base dts file, and so become effective automatically with the enabling of this PRU-ICSS target module node. The corresponding PRU nodes can be disabled later on if there are no use-cases defined to use a particular PRU core or the whole PRU-ICSS subsystem itself if both its PRU cores are unused. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 7c6a0fdcd4c2e5d6adfdf0e28d2bc89ffee7e73c Author: Suman Anna Date: Thu Jul 29 17:46:13 2021 -0500 ARM: dts: am335x-bone-common: Enable PRU-ICSS node The PRU-ICSS target module node was left in disabled state in the base am33xx-l4.dtsi file. Enable this node on all the AM335x beaglebone boards as they mostly use a AM3358 or a AM3359 SoC which do contain the PRU-ICSS IP. The PRUSS node and most of its child nodes are already enabled in the base dts file, and so become effective automatically with the enabling of this PRU-ICSS target-module node. The corresponding PRU nodes can be disabled later on if there are no use-cases defined to use a particular PRU core or the whole PRU-ICSS subsystem itself if both its PRU cores are unused. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 984ba7ee456b716e2667903686ad5ee944c249ba Author: Suman Anna Date: Thu Jul 29 17:46:12 2021 -0500 ARM: dts: am33xx-l4: Add PRUSS MDIO controller node The PRUSS on AM335x SoCs has a MDIO sub-module that can be used to control external PHYs associated with the Industrial Ethernet peripherals within the PRUSS. The MDIO module used within the PRU-ICSS is an instance of the MDIO Controller used in TI Davinci SoCs. The same bus frequency of 1 MHz is chosen as the regular MDIO node. The node is added to the common am33xx-l4.dtsi file and is disabled. This needs to be enabled in the respective board files using the relevant AM335x SoCs supporting PRUSS and where the ethernet is pinned out and connected properly. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 9b694bea4ba94efac1daddbfdef19a15a3518cd6 Author: Suman Anna Date: Thu Jul 29 17:46:11 2021 -0500 ARM: dts: am33xx-l4: Add PRUSS node Add the DT nodes for the PRU-ICSS on AM33xx family of SoCs. The AM33xx SoCs contain a single PRU-ICSS instance and is represented by a pruss node and other child nodes. PRU-ICSS is supported only on AM3356+ SoCs though in the AM33xx family, so the nodes are added under the corresponding disabled interconnect target module node in the common am33xx-l4 dtsi file. The target module node should be enabled in only those derivative board files that use a SoC containing PRU-ICSS. The PRUSS subsystem node contains the entire address space. The various sub-modules of the PRU-ICSS are represented as individual child nodes (so platform devices themselves) of the PRUSS subsystem node. These include the two PRU cores and the interrupt controller. All the Data RAMs are represented within a child node of its own named 'memories' without any compatible. The Real Time Media Independent Interface controller (MII_RT), and the CFG sub-module are represented as syscon nodes. The PRUSS CFG module has a clock mux for IEP clock, this clk node is added under the CFG child node 'clocks'. The default source for this mux clock is the PRU_ICSS_IEP_GCLK clock. The DT nodes use all standard properties. The regs property in the PRU nodes define the addresses for the Instruction RAM, the Debug and Control sub-modules for that PRU core. The firmware for each PRU core is defined through a 'firmware-name' property. The default names for the firmware images for each PRU core are defined as follows (these can be adjusted either in derivative board dts files or through sysfs at runtime if required): PRU-ICSS PRU0 Core: am335x-pru1_0-fw PRU-ICSS PRU1 Core: am335x-pru1_1-fw Note: 1. There are few more sub-modules like the Industrial Ethernet Peripheral (IEP), MDIO, UART, eCAP that do not have bindings and so will be added in the future. 2. The PRUSS INTC on AM335x SoCs also connect the host interrupts 0 to TSC_ADC; 6 and 7 as possible DMA events, so use the 'ti,irqs-reserved' property in derivative board dts files _if_ any of them should not be handled by the host OS. Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit c8f6c77d06fe6147d07cb0e4952db008f72767cb Merge: 2dbf4c2e7e3da a07d8ecf6b39c Author: David S. Miller Date: Tue Aug 3 13:05:27 2021 +0100 Merge branch 'Space-cleanup' Arnd Bergmann says: ==================== drivers/net/Space.c cleanup I discovered that there are still a couple of drivers that rely on beiong statically initialized from drivers/net/Space.c the way we did in the last century. As it turns out, there are a couple of simplifications that can be made here, as well as some minor bugfixes. There are four classes of drivers that use this: - most 10mbit ISA bus ethernet drivers (and one 100mbit one) - both ISA localtalk drivers - several m68k ethernet drivers - one obsolete WAN driver I found that the drivers using in arch/m68k/ don't actually benefit from being probed this way as they do not rely on the netdev= command line arguments, they have simply never been changed to work like a modern driver. I had previously sent a patch to remove the sbni/granch driver, and there were no objections to this patch but forgot to resend it after some discussion about another patch in the same series. For the ISA drivers, there is usually no way to probe multiple devices at boot time other than the netdev= arguments, so all that logic is left in place for the moment, but centralized in a single file that only gets included in the kernel build if one or more of the drivers are built-in. I'm also changing the old-style init_module() functions in these drivers to static functions with a module_init() annotation, to more closely resemble modern drivers. These are the last drivers in the kernel to still use init_module/cleanup_module, removing those may enable future cleanups to the module loading process. Arnd Changes in v2: - replace xsurf100 change with Michael's version - make it PATCH instead of RFC - rebase to net-next as of August 3 ==================== Signed-off-by: David S. Miller commit a07d8ecf6b39cac4c708f5a64cb5c72ffe862e5f Author: Arnd Bergmann Date: Tue Aug 3 13:40:51 2021 +0200 ethernet: isa: convert to module_init/module_exit There are a couple of ISA ethernet drivers that use the old init_module/cleanup_module function names for the main entry points, nothing else uses those any more. Change them to the documented method with module_init() and module_exit() markers next to static functions. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit d52c1069d6589abb46df64193d32316613be8c06 Author: Arnd Bergmann Date: Tue Aug 3 13:40:50 2021 +0200 wan: hostess_sv11: use module_init/module_exit helpers This is one of very few drivers using the old init_module/cleanup_module function names. Change it over to the modern method. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 72bcad5393a7079706fcfe02d84ed1599716d6a2 Author: Arnd Bergmann Date: Tue Aug 3 13:40:49 2021 +0200 wan: remove sbni/granch driver The driver was merged in 1999 and has only ever seen treewide cleanups since then, with no indication whatsoever that anyone has actually had access to hardware for testing the patches. >From the information in the link below, it appears that the hardware is for some leased line system in Russia that has since been discontinued, and useless without any remote end to connect to. As the driver still feels like a Linux-2.2 era artifact today, it appears that the best way forward is to just delete it. Link: https://www.tms.ru/%D0%90%D0%B4%D0%B0%D0%BF%D1%82%D0%B5%D1%80_%D0%B4%D0%BB%D1%8F_%D0%B2%D1%8B%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D1%8B%D1%85_%D0%BB%D0%B8%D0%BD%D0%B8%D0%B9_Granch_SBNI12-10 Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit db3db1f417544c334dd1bf9cb7005753c29e9dfc Author: Arnd Bergmann Date: Tue Aug 3 13:40:48 2021 +0200 wan: remove stale Kconfig entries The dscc4 driver was removed in 2019 but these Kconfig entries remain, so remove them as well. Fixes: 28c9eb9042a9 ("net/wan: dscc4: remove broken dscc4 driver") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 4228c3942821a67b8e313f7c35fdc5832cb67081 Author: Arnd Bergmann Date: Tue Aug 3 13:40:47 2021 +0200 make legacy ISA probe optional There are very few ISA drivers left that rely on the static probing from drivers/net/Space.o. Make them all select a new CONFIG_NETDEV_LEGACY_INIT symbol, and drop the entire probe logic when that is disabled. The 9 drivers that are called from Space.c are the same set that calls netdev_boot_setup_check(). Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 5ea2f5ffde39251115ef9a566262fb9e52b91cb7 Author: Arnd Bergmann Date: Tue Aug 3 13:40:46 2021 +0200 move netdev_boot_setup into Space.c This is now only used by a handful of old ISA drivers, and can be moved into the file they already all depend on. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit f8ade8dddb167eecd369eb3b185a5772c2d7d09b Author: Michael Schmitz Date: Tue Aug 3 13:40:45 2021 +0200 xsurf100: drop include of lib8390.c Now that ax88796.c exports the ax_NS8390_reinit() symbol, we can include 8390.h instead of lib8390.c, avoiding duplication of that function and killing a few compile warnings in the bargain. Fixes: 861928f4e60e826c ("net-next: New ax88796 platform driver for Amiga X-Surf 100 Zorro board (m68k)") Signed-off-by: Michael Schmitz Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 375df5f8c1812c59930cfed14ff4cc15929c8f2f Author: Michael Schmitz Date: Tue Aug 3 13:40:44 2021 +0200 ax88796: export ax_NS8390_init() hook The block I/O code for the new X-Surf 100 ax88796 driver needs ax_NS8390_init() for error fixup in its block_output function. Export this static function through the ax_NS8390_reinit() wrapper so we can lose the lib8380.c include in the X-Surf 100 driver. [arnd: add the declaration in the header to avoid a -Wmissing-prototypes warning] Fixes: 861928f4e60e826c ("net-next: New ax88796 platform driver for Amiga X-Surf 100 Zorro board (m68k)") Signed-off-by: Michael Schmitz Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit e179d78ee11a70e2675bc572f9f4e33d97233b23 Author: Arnd Bergmann Date: Tue Aug 3 13:40:43 2021 +0200 m68k: remove legacy probing There are six m68k specific drivers that use the legacy probe method in drivers/net/Space.c. However, all of these only support a single device, and they completely ignore the command line settings from netdev_boot_setup_check, so there is really no point at all. Aside from sun3_82586, these already have a module_init function that can be used for built-in mode as well, simply by removing the #ifdef. Note that the 82596 driver was previously used on ISA as well, but that got dropped long ago. Reviewed-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 47fd22f2b84765a2f7e3f150282497b902624547 Author: Arnd Bergmann Date: Tue Aug 3 13:40:42 2021 +0200 cs89x0: rework driver configuration There are two drivers in the cs89x0 file, with the CONFIG_CS89x0_PLATFORM symbol deciding which one is getting built. This is somewhat confusing and makes it more likely ton configure a driver that works nowhere. Split up the Kconfig option into separate ISA and PLATFORM drivers, with the ISA symbol explicitly connecting to the static probing in drivers/net/Space.c The two drivers are still mutually incompatible at compile time, which could be lifted by splitting them into multiple files, but in practice this will make no difference. The platform driver can now be enabled for compile-testing on non-ARM machines. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 8bbdf1bdf22c8f079d12d70622892b4e8f0dd3d6 Author: Arnd Bergmann Date: Tue Aug 3 13:40:41 2021 +0200 3c509: stop calling netdev_boot_setup_check This driver never uses the information returned by netdev_boot_setup_check, and is not called by the boot-time probing from driver/net/Space.c, so just remove these stale references. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 81dd3ee5962d767b913d4c4efec3f50e888463c1 Author: Arnd Bergmann Date: Tue Aug 3 13:40:40 2021 +0200 appletalk: ltpc: remove static probing This driver never relies on the netdev_boot_setup_check() to get its configuration, so it can just as well do its own probing all the time. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 19a11bf06c57fbe5d32058c2722c0bf509553b6e Author: Arnd Bergmann Date: Tue Aug 3 13:40:39 2021 +0200 natsemi: sonic: stop calling netdev_boot_setup_check The data from the kernel command line is no longer used since the probe function gets it from the platform device resources instead. The jazz version was changed to be like this in 2007, the xtensa version apparently copied the code from there. Fixes: ed9f0e0bf3ce ("remove setup of platform device from jazzsonic.c") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 0852aeb9c350c8876930377288286106a7b441a4 Author: Arnd Bergmann Date: Tue Aug 3 13:40:38 2021 +0200 bcmgenet: remove call to netdev_boot_setup_check The driver has never used the netdev->{irq,base_addr,mem_start} members, so this call is completely unnecessary. Acked-by: Florian Fainelli Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 2dbf4c2e7e3da6158305e618b340419ea12a6909 Merge: c32325b8fdf2f d43c65b05b848 Author: David S. Miller Date: Tue Aug 3 12:58:22 2021 +0100 Merge branch 'ethtool-runtime-pm' Heiner Kallweit says: ==================== ethtool: runtime-resume netdev parent before ethtool ops If a network device is runtime-suspended then: - network device may be flagged as detached and all ethtool ops (even if not accessing the device) will fail because netif_device_present() returns false - ethtool ops may fail because device is not accessible (e.g. because being in D3 in case of a PCI device) It may not be desirable that userspace can't use even simple ethtool ops that not access the device if interface or link is down. To be more friendly to userspace let's ensure that device is runtime-resumed when executing ethtool ops in kernel. This patch series covers the typical case that the netdev parent is power- managed, e.g. a PCI device. Not sure whether cases exist where the netdev itself is power-managed. If yes then we may need an extension for this. But the series as-is at least shouldn't cause problems in that case. ==================== Signed-off-by: David S. Miller commit d43c65b05b848e0b2db1a6c78b02c189da3a95b5 Author: Heiner Kallweit Date: Sun Aug 1 12:41:31 2021 +0200 ethtool: runtime-resume netdev parent in ethnl_ops_begin If a network device is runtime-suspended then: - network device may be flagged as detached and all ethtool ops (even if not accessing the device) will fail because netif_device_present() returns false - ethtool ops may fail because device is not accessible (e.g. because being in D3 in case of a PCI device) It may not be desirable that userspace can't use even simple ethtool ops that not access the device if interface or link is down. To be more friendly to userspace let's ensure that device is runtime-resumed when executing the respective ethtool op in kernel. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 41107ac22fcf39c45afaf1a59e259e5e0059e31a Author: Heiner Kallweit Date: Sun Aug 1 12:40:05 2021 +0200 ethtool: move netif_device_present check from ethnl_parse_header_dev_get to ethnl_ops_begin If device is runtime-suspended and not accessible then it may be flagged as not present. If checking whether device is present is done too early then we may bail out before we have the chance to runtime-resume the device. Therefore move this check to ethnl_ops_begin(). This is in preparation of a follow-up patch that tries to runtime-resume the device before executing ethtool ops. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c5ab51df03e2d7ec8e57904aaa2c4d03b607b2b5 Author: Heiner Kallweit Date: Sun Aug 1 12:37:39 2021 +0200 ethtool: move implementation of ethnl_ops_begin/complete to netlink.c In preparation of subsequent extensions to both functions move the implementations from netlink.h to netlink.c. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f32a213765739f2a1db319346799f130a3d08820 Author: Heiner Kallweit Date: Sun Aug 1 12:36:48 2021 +0200 ethtool: runtime-resume netdev parent before ethtool ioctl ops If a network device is runtime-suspended then: - network device may be flagged as detached and all ethtool ops (even if not accessing the device) will fail because netif_device_present() returns false - ethtool ops may fail because device is not accessible (e.g. because being in D3 in case of a PCI device) It may not be desirable that userspace can't use even simple ethtool ops that not access the device if interface or link is down. To be more friendly to userspace let's ensure that device is runtime-resumed when executing the respective ethtool op in kernel. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c32325b8fdf2f979befb9fd5587918c0d5412db3 Author: Jakub Kicinski Date: Mon Aug 2 10:57:29 2021 -0700 virtio-net: realign page_to_skb() after merges We ended up merging two versions of the same patch set: commit 8fb7da9e9907 ("virtio_net: get build_skb() buf by data ptr") commit 5c37711d9f27 ("virtio-net: fix for unable to handle page fault for address") into net, and commit 7bf64460e3b2 ("virtio-net: get build_skb() buf by data ptr") commit 6c66c147b9a4 ("virtio-net: fix for unable to handle page fault for address") into net-next. Redo the merge from commit 126285651b7f ("Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net"), so that the most recent code remains. Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski Acked-by: Jason Wang Signed-off-by: David S. Miller commit dc1a8079ebac2d7e79c78059a9abde8b1c9878eb Merge: 0547ffe6248cd c1129b51ca0e6 Author: David S. Miller Date: Tue Aug 3 12:38:47 2021 +0100 Merge branch 'bnxt_en-rx-ring' Michael Chan says: ==================== bnxt_en: Increase maximum RX ring size when jumbo ring is unused The RX jumbo ring is automatically enabled when HW GRO/LRO is enabled or when the MTU exceeds the page size. The RX jumbo ring provides a lot more RX buffer space when it is in use. When the RX jumbo ring is not in use, some users report that the current maximum of 2K buffers is too limiting. This patchset increases the maximum to 8K buffers when the RX jumbo ring is not used. The default RX ring size is unchanged at 511. ==================== Signed-off-by: David S. Miller commit c1129b51ca0e6d261df7b49388af7962c8e9a19e Author: Michael Chan Date: Mon Aug 2 10:52:39 2021 -0400 bnxt_en: Increase maximum RX ring size if jumbo ring is not used The current maximum RX ring size is defined assuming the RX jumbo ring (aka aggregation ring) is used. The RX jumbo ring is automicatically used when the MTU exceeds a threshold or when rx-gro-hw/lro is enabled. The RX jumbo ring is automatically sized up to 4 times the size of the RX ring size. The BNXT_MAX_RX_DESC_CNT constant is the upper limit on the size of the RX ring whether or not the RX jumbo ring is used. Obviously, the maximum amount of RX buffer space is significantly less when the RX jumbo ring is not used. To increase flexibility for the user who does not use the RX jumbo ring, we now define a bigger maximum RX ring size when the RX jumbo ring is not used. The maximum RX ring size is now up to 8K when the RX jumbo ring is not used. The maximum completion ring size also needs to be scaled up to accomodate the larger maximum RX ring size. Note that when the RX jumbo ring is re-enabled, the RX ring size will automatically drop if it exceeds the maximum. Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 03c7448790b87cec82a2f1406ff40dd1a8861170 Author: Michael Chan Date: Mon Aug 2 10:52:38 2021 -0400 bnxt_en: Don't use static arrays for completion ring pages We currently store these page addresses and DMA addreses in static arrays. On systems with 4K pages, we support up to 64 pages per completion ring. The actual number of pages for each completion ring may be much less than 64. For example, when the RX ring size is set to the default 511 entries, only 16 completion ring pages are needed per ring. In the next patch, we'll be doubling the maximum number of completion pages. So we convert to allocate these arrays as needed instead of declaring them statically. Reviewed-by: Pavan Chebbi Reviewed-by: Somnath Kotur Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 40fd8845c025c33629e469f1383151096a21d524 Author: David Disseldorp Date: Wed Jul 28 13:53:54 2021 +0200 scsi: target: core: Drop unnecessary se_cmd ASC/ASCQ members These members are only used for ALUA sense detail propagation, which can just as easily be done via sense_reason_t. Link: https://lore.kernel.org/r/20210728115353.2396-4-ddiss@suse.de Reviewed-by: Mike Christie Signed-off-by: David Disseldorp Signed-off-by: Martin K. Petersen commit 35410f86242694fde04ca3ff70c327755e067e6a Author: David Disseldorp Date: Wed Jul 28 13:53:53 2021 +0200 scsi: target: sbp: Drop incorrect ASC/ASCQ usage The se_cmd scsi_asc and scsi_ascq members are only used for tracking ALUA SCSI sense detail between target_core_alua and translate_sense_reason(), so they're effectively always zero here. Link: https://lore.kernel.org/r/20210728115353.2396-3-ddiss@suse.de Cc: Chris Boot Reviewed-by: Mike Christie Signed-off-by: David Disseldorp Signed-off-by: Martin K. Petersen commit 7e457e5efc2856e10623e28047a4d8c92ef0aa69 Author: David Disseldorp Date: Wed Jul 28 13:53:52 2021 +0200 scsi: target: core: Avoid using lun_tg_pt_gp after unlock core_alua_state_lba_dependent() currently uses lun->lun_tg_pt_gp without holding the lun_tg_pt_gp_lock. The lock is taken in the caller, so obtain the needed tg_pt_gp_id there instead. Link: https://lore.kernel.org/r/20210728115353.2396-2-ddiss@suse.de Cc: Hannes Reinecke Reviewed-by: Mike Christie Signed-off-by: David Disseldorp Signed-off-by: Martin K. Petersen commit 018c14911dd7e2feedd96d440f12ea999e459fff Author: Bodo Stroesser Date: Tue Jul 13 19:50:21 2021 +0200 scsi: target: tcmu: Add new feature KEEP_BUF When running command pipelining for WRITE direction commands (e.g. tape device write), userspace sends cmd completion to cmd ring before processing write data. In that case userspace has to copy data before sending completion, because cmd completion also implicitly releases the data buffer in data area. The new feature KEEP_BUF allows userspace to optionally keep the buffer after completion by setting new bit TCMU_UFLAG_KEEP_BUF in tcmu_cmd_entry_hdr->uflags. In that case buffer has to be released explicitly by writing the cmd_id to new action item free_kept_buf. All kept buffers are released during reset_ring and if userspace closes uio device (tcmu_release). Link: https://lore.kernel.org/r/20210713175021.20103-1-bostroesser@gmail.com Reviewed-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit c11a1ae9b8f65ef7b82a5a1155581a6e6bafa375 Author: Bart Van Assche Date: Wed Jul 21 20:34:39 2021 -0700 scsi: ufs: Add fault injection support Make it easier to test the UFS error handler and abort handler. Link: https://lore.kernel.org/r/20210722033439.26550-19-bvanassche@acm.org Acked-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ced75a2f5da71de5775fda44250e27d7b8024355 Author: Jessica Yu Date: Mon Aug 2 15:26:39 2021 +0200 MAINTAINERS: Add Luis Chamberlain as modules maintainer Luis has kindly agreed to help maintain the module loader. As my responsibilities have shifted, I've found myself with less cycles to devote to upstream maintenance these days. Luis is already very involved and engaged upstream, and with his experience maintaining the kmod module loader and usermode helper, I believe he is a great fit for this area of the kernel. Acked-by: Luis Chamberlain Signed-off-by: Jessica Yu commit 83f31535565c63ac4f62c7b8592210929a630d3d Author: Cong Wang Date: Sat Jul 31 12:50:38 2021 -0700 bpf, unix: Check socket type in unix_bpf_update_proto() As of now, only AF_UNIX datagram socket supports sockmap. But unix_proto is shared for all kinds of AF_UNIX sockets, so we have to check the socket type in unix_bpf_update_proto() to explicitly reject other types, otherwise they could be added into sockmap, too. Fixes: c63829182c37 ("af_unix: Implement ->psock_update_sk_prot()") Reported-by: Jakub Sitnicki Signed-off-by: Cong Wang Signed-off-by: Daniel Borkmann Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20210731195038.8084-1-xiyou.wangcong@gmail.com commit 0547ffe6248cd90361dfa627c4566afb81f06c2b Author: Yajun Deng Date: Mon Aug 2 16:05:08 2021 +0800 net: Keep vertical alignment Those files under /proc/net/stat/ don't have vertical alignment, it looks very difficult. Modify the seq_printf statement, keep vertical alignment. v2: - Use seq_puts() and seq_printf() correctly. Reported-by: kernel test robot Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 3a755cd8b7c601f756cbbf908b84f7cc8c04a02b Author: Hangbin Liu Date: Mon Aug 2 11:02:19 2021 +0800 bonding: add new option lacp_active Add an option lacp_active, which is similar with team's runner.active. This option specifies whether to send LACPDU frames periodically. If set on, the LACPDU frames are sent along with the configured lacp_rate setting. If set off, the LACPDU frames acts as "speak when spoken to". Note, the LACPDU state frames still will be sent when init or unbind port. v2: remove module parameter Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 2414d628042b61fc8af427a160379ff7e11fc59b Author: zhouchuangao Date: Sun Aug 1 19:18:38 2021 -0700 qed: Remove duplicated include of kernel.h Duplicate include header file line 4: #include line 7: #include Signed-off-by: zhouchuangao Signed-off-by: David S. Miller commit 493c3ca6bd754d8587604496eb814f72e933075d Author: Len Baker Date: Sun Aug 1 19:12:26 2021 +0200 drivers/net/usb: Remove all strcpy() uses strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Signed-off-by: David S. Miller commit 9c638eaf42ec8d62ed028feb7a5b7f2759087971 Author: Shai Malin Date: Sun Aug 1 13:28:40 2021 +0300 qed: Remove redundant prints from the iWARP SYN handling Remove redundant prints from the iWARP SYN handling. Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit cdc1d86866582ad931e9d840ee17e686ac33f7ce Author: Shai Malin Date: Sun Aug 1 13:26:38 2021 +0300 qed: Skip DORQ attention handling during recovery The device recovery flow will reset the entire HW device, in that case the DORQ HW block attention is redundant. Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit 995c3d49bd71605c8179e1e129773e37b2da9b20 Author: Shai Malin Date: Sun Aug 1 13:23:40 2021 +0300 qed: Avoid db_recovery during recovery Avoid calling the qed doorbell recovery - qed_db_rec_handler() during device recovery. Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit 07e1d6b3e0203a47128dd7d490e73ebe6dae7c4d Merge: fa976624ae7b6 a1e975e117ad6 Author: David S. Miller Date: Tue Aug 3 11:21:39 2021 +0100 Merge branch 'skb_expand_head' Vasily Averin says: ==================== skbuff: introduce skb_expand_head() currently if skb does not have enough headroom skb_realloc_headrom is called. It is not optimal because it creates new skb. this patch set introduces new helper skb_expand_head() Unlike skb_realloc_headroom, it does not allocate a new skb if possible; copies skb->sk on new skb when as needed and frees original skb in case of failures. This helps to simplify ip[6]_finish_output2(), ip6_xmit() and few other functions in vrf, ax25 and bpf. There are few other cases where this helper can be used but it requires an additional investigations. v3 changes: - ax25 compilation warning fixed - v5.14-rc4 rebase - now it does not depend on non-committed pathces v2 changes: - helper's name was changed to skb_expand_head - fixed few mistakes inside skb_expand_head(): skb_set_owner_w should set sk on nskb kfree was replaced by kfree_skb() improved warning message - added minor refactoring in changed functions in vrf and bpf patches - removed kfree_skb() in ax25_rt_build_path caller ax25_ip_xmit ==================== Signed-off-by: David S. Miller commit a1e975e117ad657dedafed2ab64ce4ddccc9883b Author: Vasily Averin Date: Mon Aug 2 11:52:54 2021 +0300 bpf: use skb_expand_head in bpf_out_neigh_v4/6 Unlike skb_realloc_headroom, new helper skb_expand_head does not allocate a new skb if possible. Additionally this patch replaces commonly used dereferencing with variables. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 53744a4a72afe11779e0c69bbe0fff7dcd83e3ce Author: Vasily Averin Date: Mon Aug 2 11:52:47 2021 +0300 ax25: use skb_expand_head Use skb_expand_head() in ax25_transmit_buffer and ax25_rt_build_path. Unlike skb_realloc_headroom, new helper does not allocate a new skb if possible. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 14ee70ca89e62d5888ba1bb3d8a519f233739fe8 Author: Vasily Averin Date: Mon Aug 2 11:52:40 2021 +0300 vrf: use skb_expand_head in vrf_finish_output Unlike skb_realloc_headroom, new helper skb_expand_head does not allocate a new skb if possible. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 5678a59579647c4d9affe5e6544baf7645b41e4f Author: Vasily Averin Date: Mon Aug 2 11:52:35 2021 +0300 ipv4: use skb_expand_head in ip_finish_output2 Unlike skb_realloc_headroom, new helper skb_expand_head does not allocate a new skb if possible. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 0c9f227bee11910a49e1d159abe102d06e3745d5 Author: Vasily Averin Date: Mon Aug 2 11:52:29 2021 +0300 ipv6: use skb_expand_head in ip6_xmit Unlike skb_realloc_headroom, new helper skb_expand_head does not allocate a new skb if possible. Additionally this patch replaces commonly used dereferencing with variables. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit e415ed3a4b8b246ee5e9d109ff5153efcf96b9f2 Author: Vasily Averin Date: Mon Aug 2 11:52:22 2021 +0300 ipv6: use skb_expand_head in ip6_finish_output2 Unlike skb_realloc_headroom, new helper skb_expand_head does not allocate a new skb if possible. Additionally this patch replaces commonly used dereferencing with variables. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit f1260ff15a71b8fc122b2c9abd8a7abffb6e0168 Author: Vasily Averin Date: Mon Aug 2 11:52:15 2021 +0300 skbuff: introduce skb_expand_head() Like skb_realloc_headroom(), new helper increases headroom of specified skb. Unlike skb_realloc_headroom(), it does not allocate a new skb if possible; copies skb->sk on new skb when as needed and frees original skb in case of failures. This helps to simplify ip[6]_finish_output2() and a few other similar cases. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit fa976624ae7b6226d080ad21adb306ccb640a5ed Merge: 7cdd0a89ec70c bcd68c04c7692 Author: David S. Miller Date: Tue Aug 3 11:16:13 2021 +0100 Merge tag 'mlx5-updates-2021-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== This patch-set changes the TTC (Traffic Type Classification) logic to be independent from the mlx5 ethernet driver by renaming the traffic types enums and making the TTC API generic to the mlx5 core driver. It allows to decouple TTC logic from mlx5e and reused by other parts of mlx5 drivers, namely ADQ and lag TX steering hashing. Patches overview: 1 - Rename traffic type enums to be mlx5 generic. 2 - Rename related TTC arguments and functions. 3 - Remove dependency in the mlx5e driver from the TTC implementation. 4 - Move TTC logic to fs_ttc. 5 - Embed struct mlx5_ttc_table in fs_ttc. The refactoring series is followed by misc' cleanup patches. ==================== Signed-off-by: David S. Miller commit 269e9552d208179bc14ea7f80a9e3e8ae97795a2 Author: Hamza Mahfooz Date: Mon Jul 12 22:33:38 2021 -0400 KVM: const-ify all relevant uses of struct kvm_memory_slot As alluded to in commit f36f3f2846b5 ("KVM: add "new" argument to kvm_arch_commit_memory_region"), a bunch of other places where struct kvm_memory_slot is used, needs to be refactored to preserve the "const"ness of struct kvm_memory_slot across-the-board. Signed-off-by: Hamza Mahfooz Message-Id: <20210713023338.57108-1-someguy@effective-light.com> [Do not touch body of slot_rmap_walk_init. - Paolo] Signed-off-by: Paolo Bonzini commit 071064f14d87536e38235df1bdeabe404023203f Author: Paolo Bonzini Date: Tue Aug 3 03:45:41 2021 -0400 KVM: Don't take mmu_lock for range invalidation unless necessary Avoid taking mmu_lock for .invalidate_range_{start,end}() notifications that are unrelated to KVM. This is possible now that memslot updates are blocked from range_start() to range_end(); that ensures that lock elision happens in both or none, and therefore that mmu_notifier_count updates (which must occur while holding mmu_lock for write) are always paired across start->end. Based on patches originally written by Ben Gardon. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit ab09511fb69bdd4c4767053d7766f4bb9d6e36ec Author: satya priya Date: Fri Jul 23 14:01:12 2021 +0530 dt-bindings: mfd: pm8008: Add gpio-ranges and spmi-gpio compatible Add gpio-ranges and "qcom,spmi-gpio" compatible to match with the parent qcom,pmic-gpio.yaml binding. Signed-off-by: satya priya Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Reviewed-by: Guru Das Srinagesh Signed-off-by: Lee Jones commit 52ac8b358b0cb7e91c966225fca61be5d1c984bc Author: Paolo Bonzini Date: Thu May 27 08:09:15 2021 -0400 KVM: Block memslot updates across range_start() and range_end() We would like to avoid taking mmu_lock for .invalidate_range_{start,end}() notifications that are unrelated to KVM. Because mmu_notifier_count must be modified while holding mmu_lock for write, and must always be paired across start->end to stay balanced, lock elision must happen in both or none. Therefore, in preparation for this change, this patch prevents memslot updates across range_start() and range_end(). Note, technically flag-only memslot updates could be allowed in parallel, but stalling a memslot update for a relatively short amount of time is not a scalability issue, and this is all more than complex enough. A long note on the locking: a previous version of the patch used an rwsem to block the memslot update while the MMU notifier run, but this resulted in the following deadlock involving the pseudo-lock tagged as "mmu_notifier_invalidate_range_start". ====================================================== WARNING: possible circular locking dependency detected 5.12.0-rc3+ #6 Tainted: G OE ------------------------------------------------------ qemu-system-x86/3069 is trying to acquire lock: ffffffff9c775ca0 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}, at: __mmu_notifier_invalidate_range_end+0x5/0x190 but task is already holding lock: ffffaff7410a9160 (&kvm->mmu_notifier_slots_lock){.+.+}-{3:3}, at: kvm_mmu_notifier_invalidate_range_start+0x36d/0x4f0 [kvm] which lock already depends on the new lock. This corresponds to the following MMU notifier logic: invalidate_range_start take pseudo lock down_read() (*) release pseudo lock invalidate_range_end take pseudo lock (**) up_read() release pseudo lock At point (*) we take the mmu_notifiers_slots_lock inside the pseudo lock; at point (**) we take the pseudo lock inside the mmu_notifiers_slots_lock. This could cause a deadlock (ignoring for a second that the pseudo lock is not a lock): - invalidate_range_start waits on down_read(), because the rwsem is held by install_new_memslots - install_new_memslots waits on down_write(), because the rwsem is held till (another) invalidate_range_end finishes - invalidate_range_end sits waits on the pseudo lock, held by invalidate_range_start. Removing the fairness of the rwsem breaks the cycle (in lockdep terms, it would change the *shared* rwsem readers into *shared recursive* readers), so open-code the wait using a readers count and a spinlock. This also allows handling blockable and non-blockable critical section in the same way. Losing the rwsem fairness does theoretically allow MMU notifiers to block install_new_memslots forever. Note that mm/mmu_notifier.c's own retry scheme in mmu_interval_read_begin also uses wait/wake_up and is likewise not fair. Signed-off-by: Paolo Bonzini commit f8145cff0c2024faea2ad391cdb85f95491b5c2b Author: Marc Kleine-Budde Date: Mon Jul 26 11:28:36 2021 +0200 can: j1939: j1939_session_tx_dat(): fix typo This patch fixes a typo in the j1939_session_tx_dat() function. Link: https://lore.kernel.org/r/20210729113917.1655492-1-mkl@pengutronix.de Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Marc Kleine-Budde commit dbc97765328ad03f853b8975c421d65dbf9619ff Author: Steven Lee Date: Mon Jul 12 18:03:11 2021 +0800 ARM: dts: aspeed-g5: Remove ngpios from sgpio node. Remove ngpios property from sgpio node as it should be defined in the platform dts. Signed-off-by: Steven Lee Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210712100317.23298-5-steven_lee@aspeedtech.com Signed-off-by: Joel Stanley commit 09eccdc9ebb533874b7b04a8bcb6a621f55cacb2 Author: Steven Lee Date: Mon Jul 12 18:03:10 2021 +0800 ARM: dts: aspeed-g6: Add SGPIO node. AST2600 supports 2 SGPIO master interfaces one with 128 pins another one with 80 pins. Signed-off-by: Steven Lee Link: https://lore.kernel.org/r/20210712100317.23298-4-steven_lee@aspeedtech.com Signed-off-by: Joel Stanley commit 0ffbfcbc273ef3f290c835ad1781c4f9a58d5090 Author: Steven Lee Date: Mon Jul 12 18:03:09 2021 +0800 dt-bindings: aspeed-sgpio: Add ast2600 sgpio AST2600 SoC has 2 SGPIO master interfaces one with 128 pins another one with 80 pins. Add ast2600-sgpiom compatibles and update descriptions to introduce the max number of available gpio pins that AST2600 supported. Signed-off-by: Steven Lee Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210712100317.23298-3-steven_lee@aspeedtech.com Signed-off-by: Joel Stanley commit 85aef2b218c85991479cfbb0c4c1dab84c30fec2 Author: Steven Lee Date: Mon Jul 12 18:03:08 2021 +0800 dt-bindings: aspeed-sgpio: Convert txt bindings to yaml. sgpio-aspeed bindings should be converted to yaml format. Signed-off-by: Steven Lee Reviewed-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210712100317.23298-2-steven_lee@aspeedtech.com Signed-off-by: Joel Stanley commit bcd68c04c7692416206414dc8971730aa140eba7 Author: Jiapeng Chong Date: Thu Jul 22 17:58:16 2021 +0800 net/mlx5: Fix missing return value in mlx5_devlink_eswitch_inline_mode_set() The return value is missing in this code scenario, add the return value '0' to the return value 'err'. Eliminate the follow smatch warning: drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c:3083 mlx5_devlink_eswitch_inline_mode_set() warn: missing error code 'err'. Reported-by: Abaci Robot Fixes: 8e0aa4bc959c ("net/mlx5: E-switch, Protect eswitch mode changes") Signed-off-by: Jiapeng Chong Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 25f150f4bbe923c45360039d8606491e87655f2e Author: Roi Dayan Date: Mon Jul 26 15:17:31 2021 +0300 net/mlx5e: Return -EOPNOTSUPP if more relevant when parsing tc actions Instead of returning -EINVAL. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 97a8d29ae9d2db223df5543dd5cd4b4e8568350a Author: Roi Dayan Date: Mon Jul 26 15:13:35 2021 +0300 net/mlx5e: Remove redundant assignment of counter to null counter is being initialized before being used. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit c6cfe1137f886dea544a2c5f405c318ead1ed6b4 Author: Roi Dayan Date: Mon Jul 26 15:11:43 2021 +0300 net/mlx5e: Remove redundant parse_attr arg Passing parse_attr is redundant in parse_tc_nic_actions() and mlx5e_tc_add_nic_flow() as we can get it from flow. This is the same as with parse_tc_fdb_actions() and mlx5e_tc_add_fdb_flow(). Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 950b4df9fba95018cddb574567607a2bb2a6c166 Author: Roi Dayan Date: Sun Jul 25 16:04:00 2021 +0300 net/mlx5e: Remove redundant cap check for flow counter The cap is very old and today will always exists. The cap is not being checked anywhere else. Remove the check from drop action when parsing tc rules in nic mode. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 70f8019e7b5670106184bb97976cc14ea5c5e94b Author: Roi Dayan Date: Thu Jul 22 12:10:54 2021 +0300 net/mlx5e: Remove redundant filter_dev arg from parse_tc_fdb_actions() filter_dev is saved in parse_attr. and being used in other cases from there. use it also for the leftover case. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 696ceeb203c75b4422efb1b83898a83e8dae62c7 Author: Roi Dayan Date: Thu Jul 22 11:58:08 2021 +0300 net/mlx5e: Remove redundant tc act includes Since the code changed to use the flow action infra there is no usage of tcf values from those includes. Remove those. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit f4b45940e9b9e0dc5f602e86e93c785547d226d8 Author: Maor Gottlieb Date: Sun Jul 18 15:53:53 2021 +0300 net/mlx5: Embed mlx5_ttc_table mlx5_ttc_table struct shouldn't be exposed to the users so this patch make it internal to ttc. In addition add a getter function to get the TTC flow table for users that need to add a rule which points on it. Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit 371cf74e78f3468016e8c7a159fc288a71d4dc86 Author: Maor Gottlieb Date: Fri Jul 2 10:38:32 2021 +0300 net/mlx5: Move TTC logic to fs_ttc Now that TTC logic is not dependent on mlx5e structs, move it to lib/fs_ttc.c so it could be used other part of the mlx5 driver. Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit bc29764ed9a2335a4f2453eba3f270ca84164a6e Author: Maor Gottlieb Date: Fri Jul 2 14:25:14 2021 +0300 net/mlx5e: Decouple TTC logic from mlx5e Remove dependency in the mlx5e driver from the TTC implementation by changing the TTC related functions to receive mlx5 generic arguments. It allows to decouple TTC logic from mlx5e and reused by other parts of mlx5 driver. Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 5fba089e960c9bc6c683f7e7917a853e5910b79f Author: Maor Gottlieb Date: Fri Jul 2 14:49:37 2021 +0300 net/mlx5e: Rename some related TTC args and functions Since TTC logic is going to be moved to a separate file, make the relevant functions and arguments that used by TTC to be mlx5 generic. Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d443c6f684d35d88d5be05c7c8d6ecd379fb3e0c Author: Maor Gottlieb Date: Fri Jul 2 11:42:28 2021 +0300 net/mlx5e: Rename traffic type enums Rename traffic type enums as part of the preparation for moving the traffic type logic to a separate file. Signed-off-by: Maor Gottlieb Reviewed-by: Tariq Toukan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 3ac90dec3a01226ce7f546a511b7fb56464e0686 Author: Maxim Mikityanskiy Date: Mon Apr 12 19:10:17 2021 +0300 net/mlx5e: Allocate the array of channels according to the real max_nch The channels array in struct mlx5e_rx_res is converted to a dynamic one, which will use the dynamic value of max_nch instead of implementation-defined maximum of MLX5E_MAX_NUM_CHANNELS. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 43ec0f41fa73cc4d4f8a67e56fb398eff6881841 Author: Maxim Mikityanskiy Date: Fri Apr 9 19:01:51 2021 +0300 net/mlx5e: Hide all implementation details of mlx5e_rx_res This commit moves all implementation details of struct mlx5e_rx_res under en/rx_res.c. All access to RX resources is now done using methods. Encapsulating RX resources into an object allows for better manageability, because all the implementation details are now in a single place, and external code can use only a limited set of API methods to init/teardown the whole thing, reconfigure RSS and LRO parameters, connect TIRs to flow steering and activate/deactivate TIRs. mlx5e_rx_res is self-contained and doesn't depend on struct mlx5e_priv or include en.h. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e6e01b5fdc281ea5819b21c48c813bcb156d3735 Author: Maxim Mikityanskiy Date: Fri Apr 9 17:31:09 2021 +0300 net/mlx5e: Introduce mlx5e_channels API to get RQNs Currently, struct mlx5e_channels is defined in en.h, along with a lot of other stuff. In the following commit mlx5e_rx_res will need to get RQNs (RQ hardware IDs), given a pointer to mlx5e_channels and the channel index. In order to make it possible without including the whole en.h, this commit introduces functions that will hide the implementation details of mlx5e_channels. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 43befe99bc62a019142f4760b3c3e29c4892565a Author: Maxim Mikityanskiy Date: Thu Apr 8 12:16:34 2021 +0300 net/mlx5e: Use a new initializer to build uniform indir table Replace mlx5e_build_default_indir_rqt with a new initializer of struct mlx5e_rss_params_indir that works directly with the struct, rather than its internals. The new initializer is called mlx5e_rss_params_indir_init_uniform, which also reflects the purpose (uniform spreading) better. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 73dc3c4ac703c6fea4b40e8ed1ddd80564da3dea Author: Bart Van Assche Date: Wed Jul 21 20:34:38 2021 -0700 scsi: ufs: Retry aborted SCSI commands instead of completing these successfully Neither SAM nor the UFS standard require that the UFS controller fills in the completion status of commands that have been aborted (LUN RESET aborts pending commands). Hence do not rely on the completion status provided by the UFS controller for aborted commands but instead ask the SCSI core to retry SCSI commands that have been aborted. Link: https://lore.kernel.org/r/20210722033439.26550-18-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a113eaaf86373362b053279049907ff82b5df6c8 Author: Bart Van Assche Date: Wed Jul 21 20:34:37 2021 -0700 scsi: ufs: Synchronize SCSI and UFS error handling Use the SCSI error handler instead of a custom error handling strategy. This change reduces the number of potential races in the UFS drivers since the UFS error handler and the SCSI error handler no longer run concurrently. Link: https://lore.kernel.org/r/20210722033439.26550-17-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ac1bc2ba060f9609972fb486073ebd9eab1ef3b6 Author: Bart Van Assche Date: Wed Jul 21 20:34:36 2021 -0700 scsi: ufs: Request sense data asynchronously Clearing a unit attention synchronously from inside the UFS error handler may trigger the following deadlock: - ufshcd_err_handler() calls ufshcd_err_handling_unprepare() and the latter function calls ufshcd_clear_ua_wluns(). - ufshcd_clear_ua_wluns() submits a REQUEST SENSE command and that command activates the SCSI error handler. - The SCSI error handler calls ufshcd_host_reset_and_restore(). - ufshcd_host_reset_and_restore() executes the following code: ufshcd_schedule_eh_work(hba); flush_work(&hba->eh_work); This sequence results in a deadlock (circular wait). Fix this by requesting sense data asynchronously. Link: https://lore.kernel.org/r/20210722033439.26550-16-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 64180742605f772d511903c9e50262afb13726c6 Author: Bart Van Assche Date: Wed Jul 21 20:34:35 2021 -0700 scsi: ufs: Fix the SCSI abort handler Make the following changes in ufshcd_abort(): - Return FAILED instead of SUCCESS if the abort handler notices that a SCSI command has already been completed. Returning SUCCESS in this case triggers a use-after-free and may trigger a kernel crash. - Fix the code for aborting SCSI commands submitted to a WLUN. The current approach for aborting SCSI commands that have been submitted to a WLUN and that timed out is as follows: - Report to the SCSI core that the command has completed successfully. Let the block layer free any data buffers associated with the command. - Mark the command as outstanding in 'outstanding_reqs'. - If the block layer tries to reuse the tag associated with the aborted command, busy-wait until the tag is freed. This approach can result in: - Memory corruption if the controller accesses the data buffer after the block layer has freed the associated data buffers. - A race condition if ufshcd_queuecommand() or ufshcd_exec_dev_cmd() checks the bit that corresponds to an aborted command in 'outstanding_reqs' after it has been cleared and before it is reset. - High energy consumption if ufshcd_queuecommand() repeatedly returns SCSI_MLQUEUE_HOST_BUSY. Fix this by reporting to the SCSI error handler that aborting a SCSI command failed if the SCSI command was submitted to a WLUN. Link: https://lore.kernel.org/r/20210722033439.26550-15-bvanassche@acm.org Fixes: 7a7e66c65d41 ("scsi: ufs: Fix a race condition between ufshcd_abort() and eh_work()") Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 169f5eb28869098ac02d7e03abea36e8ac599bcc Author: Bart Van Assche Date: Wed Jul 21 20:34:34 2021 -0700 scsi: ufs: Optimize SCSI command processing Use a spinlock to protect hba->outstanding_reqs instead of using atomic operations to update this member variable. This patch is a performance improvement because it reduces the number of atomic operations in the hot path (test_and_clear_bit()) and because it reduces the lock contention on the SCSI host lock. On my test setup this patch improves IOPS by about 1%. Link: https://lore.kernel.org/r/20210722033439.26550-14-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Reviewed-by: Daejun Park Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a024ad0d49550e4ea1156e677cd9382e1eefbdd7 Author: Bart Van Assche Date: Wed Jul 21 20:34:33 2021 -0700 scsi: ufs: Optimize serialization of setup_xfer_req() calls Reduce the number of times the host lock is taken in the hot path. Additionally, inline ufshcd_vops_setup_xfer_req() because that function is too short to keep it. Link: https://lore.kernel.org/r/20210722033439.26550-13-bvanassche@acm.org Fixes: a45f937110fa ("scsi: ufs: Optimize host lock on transfer requests send/compl paths") Cc: Jaegeuk Kim Cc: Stanley Chu Cc: Can Guo Cc: Bean Huo Cc: Asutosh Das Reviewed-by: Daejun Park Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1f522c5049016cfea4f9d131ae9089e6fdba3980 Author: Bart Van Assche Date: Wed Jul 21 20:34:32 2021 -0700 scsi: ufs: Revert "Utilize Transfer Request List Completion Notification Register" Using the UTRLCNR register involves two MMIO accesses in the hot path while using the doorbell register only involves a single MMIO access. Since MMIO accesses take time, do not use the UTRLCNR register. The spinlock contention on the SCSI host lock that is reintroduced by this commit will be addressed later. This reverts commit 6f7151729647e58ac7c522081255fd0c07b38105. Link: https://lore.kernel.org/r/20210722033439.26550-12-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Tested-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 815b9a27b0a3055585db37c422146067e55e0617 Author: Bart Van Assche Date: Wed Jul 21 20:34:31 2021 -0700 scsi: ufs: Inline ufshcd_outstanding_req_clear() Inline ufshcd_outstanding_req_clear() since it only has one caller and since its body is only one line long. Link: https://lore.kernel.org/r/20210722033439.26550-11-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3d2ac73d13476fd996e3423863371805780a0663 Author: Bart Van Assche Date: Wed Jul 21 20:34:30 2021 -0700 scsi: ufs: Remove several wmb() calls From arch/arm/include/asm/io.h #define __iowmb() wmb() [ ... ] #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); }) From Documentation/memory-barriers.txt: "Note that, when using writel(), a prior wmb() is not needed to guarantee that the cache coherent memory writes have completed before writing to the MMIO region." In other words, calling wmb() before writel() is not necessary. Hence remove the wmb() calls that precede a writel() call. Remove the wmb() calls that precede a ufshcd_send_command() call since the latter function uses writel(). Remove the wmb() call from ufshcd_wait_for_dev_cmd() since the following chain of events guarantees that the CPU will see up-to-date LRB values: - UFS controller writes to host memory. - UFS controller posts completion interrupt after the memory writes from the previous step are visible to the CPU. - complete(hba->dev_cmd.complete) is called from the UFS interrupt handler. - The wait_for_completion(hba->dev_cmd.complete) call in ufshcd_wait_for_dev_cmd() returns. Link: https://lore.kernel.org/r/20210722033439.26550-10-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Tested-by: Avri altman Reviewed-by: Avri Altman Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9c202090edd4c7679adf5bf040d7ee19966feae6 Author: Bart Van Assche Date: Wed Jul 21 20:34:29 2021 -0700 scsi: ufs: Improve static type checking for the host controller state Assign a name to the enumeration type for UFS host controller states and remove the default clause from switch statements on this enumeration type to make the compiler warn about unhandled enumeration labels. Link: https://lore.kernel.org/r/20210722033439.26550-9-bvanassche@acm.org Cc: Can Guo Reviewed-by: Avri Altman Reviewed-by: Keoseong Park Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 35c7d874f5993db04ce3aa310ae088f14b801eda Author: Bart Van Assche Date: Wed Jul 21 20:34:28 2021 -0700 scsi: ufs: Verify UIC locking requirements at runtime Instead of documenting the locking requirements of the UIC code as comments, use lockdep_assert_held() such that lockdep verifies the lockdep requirements at runtime if lockdep is enabled. Link: https://lore.kernel.org/r/20210722033439.26550-8-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4728ab4a8e64902b0b0c5238ed09128ea20aa5ce Author: Bart Van Assche Date: Wed Jul 21 20:34:27 2021 -0700 scsi: ufs: Remove ufshcd_valid_tag() scsi_add_host() allocates shost->can_queue tags. ufshcd_init() sets shost->can_queue to hba->nutrs. In other words, we know that tag values will less than hba->nutrs. Hence remove the checks that verify that blk_get_request() returns a tag less than hba->nutrs. This check was introduced by commit 14497328b6a6 ("scsi: ufs: verify command tag validity"). Keep the tag >= 0 check because it helps to detect use-after-free issues. Link: https://lore.kernel.org/r/20210722033439.26550-7-bvanassche@acm.org CC: Avri Altman Cc: Alim Akhtar Reviewed-by: Bean Huo Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8a686f26eaa4b8a5c494b6b69e8a97815e3ffb82 Author: Bart Van Assche Date: Wed Jul 21 20:34:26 2021 -0700 scsi: ufs: Use DECLARE_COMPLETION_ONSTACK() where appropriate From Documentation/scheduler/completion.rst: "When a completion is declared as a local variable within a function, then the initialization should always use DECLARE_COMPLETION_ONSTACK() explicitly, not just to make lockdep happy, but also to make it clear that limited scope had been considered and is intentional." Link: https://lore.kernel.org/r/20210722033439.26550-6-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 568dd9959611f097bdce821cef63a50844da98c6 Author: Bart Van Assche Date: Wed Jul 21 20:34:25 2021 -0700 scsi: ufs: Rename the second ufshcd_probe_hba() argument Rename the second argument of ufshcd_probe_hba() such that the name of that argument reflects its purpose instead of how the function is called. See also commit 1b9e21412f72 ("scsi: ufs: Split ufshcd_probe_hba() based on its called flow"). Link: https://lore.kernel.org/r/20210722033439.26550-5-bvanassche@acm.org Cc: Asutosh Das Cc: Can Guo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Daejun Park Reviewed-by: Stanley Chu Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9bb25e5d9d2948249631d3396f72e48035b4f380 Author: Bart Van Assche Date: Wed Jul 21 20:34:24 2021 -0700 scsi: ufs: Only include power management code if necessary This patch slightly reduces the UFS driver size if built with power management support disabled. Link: https://lore.kernel.org/r/20210722033439.26550-4-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Daejun Park Reviewed-by: Stanley Chu Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f1ecbe1e54d5709b839e71f48ab26aab42cb7b82 Author: Bart Van Assche Date: Wed Jul 21 20:34:23 2021 -0700 scsi: ufs: Reduce power management code duplication Move the dev_get_drvdata() calls into the ufshcd_{system,runtime}_*() functions. Remove ufshcd_runtime_idle() since it is empty. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210722033439.26550-3-bvanassche@acm.org Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Daejun Park Reviewed-by: Stanley Chu Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d3d9c4570285090b533b00946b72647361f0345b Author: Bart Van Assche Date: Wed Jul 21 20:34:22 2021 -0700 scsi: ufs: Fix memory corruption by ufshcd_read_desc_param() If param_offset > buff_len then the memcpy() statement in ufshcd_read_desc_param() corrupts memory since it copies 256 + buff_len - param_offset bytes into a buffer with size buff_len. Since param_offset < 256 this results in writing past the bound of the output buffer. Link: https://lore.kernel.org/r/20210722033439.26550-2-bvanassche@acm.org Fixes: cbe193f6f093 ("scsi: ufs: Fix potential NULL pointer access during memcpy") Reviewed-by: Avri Altman Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6e95b23a5b2d1fcbe5a84a362170a4871a3d5731 Author: Uwe Kleine-König Date: Tue Jul 27 14:42:26 2021 +0200 spi: imx: Implement support for CS_WORD This only works when the native chipselect is in use. On a board with a Ti ADS7950 8 channel ADC. This patch reduces the time to read out all channels once from 280 us to 20 us. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210727124226.5571-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit b61a28cf11d61f512172e673b8f8c4a6c789b425 Author: Johan Almbladh Date: Wed Jul 28 18:47:41 2021 +0200 bpf: Fix off-by-one in tail call count limiting Before, the interpreter allowed up to MAX_TAIL_CALL_CNT + 1 tail calls. Now precisely MAX_TAIL_CALL_CNT is allowed, which is in line with the behavior of the x86 JITs. Signed-off-by: Johan Almbladh Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210728164741.350370-1-johan.almbladh@anyfinetworks.com commit 7cdd0a89ec70ce6a720171f1f7817ee9502b134c Author: Colin Ian King Date: Sun Aug 1 16:37:42 2021 +0100 net/mlx4: make the array states static const, makes object smaller Don't populate the array states on the stack but instead it static const. Makes the object code smaller by 79 bytes. Before: text data bss dec hex filename 21309 8304 192 29805 746d drivers/net/ethernet/mellanox/mlx4/qp.o After: text data bss dec hex filename 21166 8368 192 29726 741e drivers/net/ethernet/mellanox/mlx4/qp.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Reviewed-by: Leon Romanovsky Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20210801153742.147304-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit 771edeabcb9530e9e8020fb5f38111ba5dc1ad9c Author: Colin Ian King Date: Sun Aug 1 16:26:50 2021 +0100 net: 3c509: make the array if_names static const, makes object smaller Don't populate the array if_names on the stack but instead it static const. Makes the object code smaller by 99 bytes. Before: text data bss dec hex filename 27886 10752 672 39310 998e ./drivers/net/ethernet/3com/3c509.o After: text data bss dec hex filename 27723 10816 672 39211 992b ./drivers/net/ethernet/3com/3c509.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801152650.146572-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit d5731f891a0c194fa4231c67a984b75f55c7674f Author: Colin Ian King Date: Sun Aug 1 16:22:09 2021 +0100 dpaa2-eth: make the array faf_bits static const, makes object smaller Don't populate the array faf_bits on the stack but instead it static const. Makes the object code smaller by 175 bytes. Before: text data bss dec hex filename 9645 4552 0 14197 3775 ../freescale/dpaa2/dpaa2-eth-devlink.o After: text data bss dec hex filename 9406 4616 0 14022 36c6 ../freescale/dpaa2/dpaa2-eth-devlink.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801152209.146359-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit a6afdb041a2d7f514711b3bd27227e83d3cd9cf4 Author: Colin Ian King Date: Sun Aug 1 16:16:59 2021 +0100 qlcnic: make the array random_data static const, makes object smaller Don't populate the array random_data on the stack but instead it static const. Makes the object code smaller by 66 bytes. Before: text data bss dec hex filename 52895 10976 0 63871 f97f ../qlogic/qlcnic/qlcnic_ethtool.o After: text data bss dec hex filename 52701 11104 0 63805 f93d ../qlogic//qlcnic/qlcnic_ethtool.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801151659.146113-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit 628fe1cedda6cc503ec9ca21ec19938f2e625754 Author: Colin Ian King Date: Sun Aug 1 16:06:47 2021 +0100 net: marvell: make the array name static, makes object smaller Don't populate the const array name on the stack but instead it static. Makes the object code smaller by 28 bytes. Add a missing const to clean up a checkpatch warning. Before: text data bss dec hex filename 124565 31565 384 156514 26362 drivers/net/ethernet/marvell/sky2.o After: text data bss dec hex filename 124441 31661 384 156486 26346 drivers/net/ethernet/marvell/sky2.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801150647.145728-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit e688bdb7099c59c58ae231c6b87e42fb0a7d46bc Author: Colin Ian King Date: Sun Aug 1 16:12:05 2021 +0100 cxgb4: make the array match_all_mac static, makes object smaller Don't populate the array match_all_mac on the stack but instead it static const. Makes the object code smaller by 75 bytes. Before: text data bss dec hex filename 46701 8960 64 55725 d9ad ../chelsio/cxgb4/cxgb4_filter.o After: text data bss dec hex filename 46338 9120 192 55650 d962 ../chelsio/cxgb4/cxgb4_filter.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801151205.145924-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit d08d29c8041b4306d35888eb5b920bb70ae859e3 Author: Baisheng Gao Date: Thu Jul 29 00:01:26 2021 +0800 Documentation: fix incorrect macro referencing in mscc-phy-vsc8531.txt Modify LINK_1000_ACTIVITY and LINK_100_ACTIVITY to VSC8531_LINK_1000_ACTIVITY and VSC8531_LINK_100_ACTIVITY respectively in the example of ethernet-phy node according to include/dt-bindings/net/mscc-phy-vsc8531.h. Signed-off-by: Baisheng Gao Link: https://lore.kernel.org/r/1627488086-200263-1-git-send-email-gaobaisheng@bonc.com.cn Signed-off-by: Rob Herring commit 3fb1712d85962f81265b5018922a2da13cdf6033 Author: Christoph Hellwig Date: Mon Jul 26 16:35:24 2021 +0200 vfio/mdev: don't warn if ->request is not set Only a single driver actually sets the ->request method, so don't print a scary warning if it isn't. Signed-off-by: Christoph Hellwig Reviewed-by: Cornelia Huck Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20210726143524.155779-3-hch@lst.de Signed-off-by: Alex Williamson commit 15a5896e61acb7cbad5efd9cf807a4d9a5e8315d Author: Christoph Hellwig Date: Mon Jul 26 16:35:23 2021 +0200 vfio/mdev: turn mdev_init into a subsys_initcall Without this setups with buіlt-in mdev and mdev-drivers fail to register like this: [1.903149] Driver 'intel_vgpu_mdev' was unable to register with bus_type 'mdev' because the bus was not initialized. Signed-off-by: Christoph Hellwig Reviewed-by: Cornelia Huck Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20210726143524.155779-2-hch@lst.de Signed-off-by: Alex Williamson commit e7500b3ede2c66380a7e9faa6a81e6df2f8e4e55 Author: Yishai Hadas Date: Wed Jul 21 10:05:48 2021 -0300 vfio/pci: Make vfio_pci_regops->rw() return ssize_t The only implementation of this in IGD returns a -ERRNO which is implicitly cast through a size_t and then casted again and returned as a ssize_t in vfio_pci_rw(). Fix the vfio_pci_regops->rw() return type to be ssize_t so all is consistent. Fixes: 28541d41c9e0 ("vfio/pci: Add infrastructure for additional device specific regions") Signed-off-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Reviewed-by: Max Gurtovoy Link: https://lore.kernel.org/r/0-v3-5db12d1bf576+c910-vfio_rw_jgg@nvidia.com Signed-off-by: Alex Williamson commit 26c22cfde5dd6e63f25c48458b0185dcb0fbb2fd Author: Jason Gunthorpe Date: Fri Jul 16 15:39:12 2021 -0300 vfio: Use config not menuconfig for VFIO_NOIOMMU VFIO_NOIOMMU is supposed to be an element in the VFIO menu, not start a new menu. Correct this copy-paste mistake. Fixes: 03a76b60f8ba ("vfio: Include No-IOMMU mode") Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/0-v1-3f0b685c3679+478-vfio_menuconfig_jgg@nvidia.com Signed-off-by: Alex Williamson commit d865e4b8136457da7dc19cad9a13efef6b22f668 Author: Masanari Iida Date: Thu Jul 29 22:53:14 2021 +0900 drm/amdgpu/powerplay/smu10: Fix a typo in error message This patch fixes a spelling typo in error message. Signed-off-by: Masanari Iida Signed-off-by: Alex Deucher commit 04f61f6c85b857b0d7ff201942d8067eeaf39388 Author: Cai Huoqing Date: Thu Jul 29 16:20:46 2021 +0800 gpu/drm/radeon: Fix typo in comments Remove the repeated word 'the' from comments Signed-off-by: Cai Huoqing Signed-off-by: Alex Deucher commit 4dc8e494bb73ed1322f458f1400b8d507cfd32d5 Author: Cai Huoqing Date: Thu Jul 29 16:18:14 2021 +0800 drm/amd/display: Fix typo in comments Remove the repeated word 'the' from comments Signed-off-by: Cai Huoqing Signed-off-by: Alex Deucher commit 198fbe15ce531b290b92dba48bd8eeed2c884a01 Author: Yifan Zhang Date: Thu Jun 10 09:55:01 2021 +0800 drm/amdgpu: fix the doorbell missing when in CGPG issue for renoir. If GC has entered CGPG, ringing doorbell > first page doesn't wakeup GC. Enlarge CP_MEC_DOORBELL_RANGE_UPPER to workaround this issue. Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a50fe707803555f89ad878e3965445be0f70eb9f Author: Eric Huang Date: Wed Jul 14 14:44:53 2021 -0400 drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran It is to workaround HW bug on other Asics and based on reverting two commits back: drm/amdkfd: Add heavy-weight TLB flush after unmapping drm/amdkfd: Add memory sync before TLB flush on unmap Signed-off-by: Eric Huang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3cd293a78a58c7172b338fd41b7b7a052db64955 Author: Eric Huang Date: Mon Jul 26 11:35:16 2021 -0400 Revert "Revert "drm/amdkfd: Only apply TLB flush optimization on ALdebaran"" This reverts commit 53d0533049a573298f74ae07a39db14163960e68. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 626803d1f21719d4a91d3f693fc3b1515993b8e5 Author: Eric Huang Date: Mon Jul 26 11:29:10 2021 -0400 Revert "Revert "drm/amdkfd: Add memory sync before TLB flush on unmap"" This reverts commit 4bba567c8c35a9cbcd16fb4780a0c3dfd162e08e. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit b1f21482affa6b4509077b0d58b6edc11f2ff75d Author: Eric Huang Date: Mon Jul 26 11:27:53 2021 -0400 Revert "Revert "drm/amdgpu: Fix warning of Function parameter or member not described"" This reverts commit 4e7b93ca52fb228b177168d436449c5671415a72. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit fce1a7eb35b2a911a716286387433c1c068bc820 Author: Eric Huang Date: Mon Jul 26 11:24:20 2021 -0400 Revert "Revert "drm/amdkfd: Make TLB flush conditional on mapping"" This reverts commit 7ed9876c9793bfe96fed58ba645d6c8e32f26001. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit cc6152ff4ff339f4d3a3f35d43d416010d62842d Author: Eric Huang Date: Mon Jul 26 11:23:17 2021 -0400 Revert "Revert "drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update"" This reverts commit 024d8811c90ed56d8b90cdcf71e51c9fedeff460. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 4a134261f5d844607b32f875e2a719155408d19f Author: Eric Huang Date: Mon Jul 26 11:21:14 2021 -0400 Revert "Revert "drm/amdkfd: Add heavy-weight TLB flush after unmapping"" This reverts commit 430f8e6edbaac8abfddf76f1aef732d9c6257211. Revert reason: Issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit de5986504296aef86d51268b62ba522cb39b39ca Author: xinhui pan Date: Tue Jul 27 17:43:37 2021 +0800 drm/amdgpu: Fix out-of-bounds read when update mapping If one GTT BO has been evicted/swapped out, it should sit in CPU domain. TTM only alloc struct ttm_resource instead of struct ttm_range_mgr_node for sysMem. Now when we update mapping for such invalidated BOs, we might walk out of bounds of struct ttm_resource. Three possible fix: 1) Let sysMem manager alloc struct ttm_range_mgr_node, like ttm_range_manager does. 2) Pass pages_addr to update_mapping function too, but need memset pages_addr[] to zero when unpopulate. 3) Init amdgpu_res_cursor directly. bug is detected by kfence. ================================================================== BUG: KFENCE: out-of-bounds read in amdgpu_vm_bo_update_mapping+0x564/0x6e0 Out-of-bounds read at 0x000000008ea93fe9 (64B right of kfence-#167): amdgpu_vm_bo_update_mapping+0x564/0x6e0 [amdgpu] amdgpu_vm_bo_update+0x282/0xa40 [amdgpu] amdgpu_vm_handle_moved+0x19e/0x1f0 [amdgpu] amdgpu_cs_vm_handling+0x4e4/0x640 [amdgpu] amdgpu_cs_ioctl+0x19e7/0x23c0 [amdgpu] drm_ioctl_kernel+0xf3/0x180 [drm] drm_ioctl+0x2cb/0x550 [drm] amdgpu_drm_ioctl+0x5e/0xb0 [amdgpu] kfence-#167 [0x000000008e11c055-0x000000001f676b3e ttm_sys_man_alloc+0x35/0x80 [ttm] ttm_resource_alloc+0x39/0x50 [ttm] ttm_bo_swapout+0x252/0x5a0 [ttm] ttm_device_swapout+0x107/0x180 [ttm] ttm_global_swapout+0x6f/0x130 [ttm] ttm_tt_populate+0xb1/0x2a0 [ttm] ttm_bo_handle_move_mem+0x17e/0x1d0 [ttm] ttm_mem_evict_first+0x59d/0x9c0 [ttm] ttm_bo_mem_space+0x39f/0x400 [ttm] ttm_bo_validate+0x13c/0x340 [ttm] ttm_bo_init_reserved+0x269/0x540 [ttm] amdgpu_bo_create+0x1d1/0xa30 [amdgpu] amdgpu_bo_create_user+0x40/0x80 [amdgpu] amdgpu_gem_object_create+0x71/0xc0 [amdgpu] amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x2f2/0xcd0 [amdgpu] kfd_ioctl_alloc_memory_of_gpu+0xe2/0x330 [amdgpu] kfd_ioctl+0x461/0x690 [amdgpu] Signed-off-by: xinhui pan Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 869ab62c2bd734d356e67ebc63ec8f364c452bb6 Author: Geert Uytterhoeven Date: Tue Jul 27 18:11:41 2021 +0200 dt-bindings: auxdisplay: arm-charlcd: Convert to json-schema Convert the ARM Versatile Character LCD Device Tree binding documentation to json-schema. Correct compatible value. Document missing properties. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4a63caa4136e8a31e82c7d75bb6f273498e8cccf.1627402256.git.geert@linux-m68k.org Signed-off-by: Rob Herring commit 9c4073782cb17898d740dc618338fb6043e43721 Author: Geert Uytterhoeven Date: Tue Jul 27 18:10:34 2021 +0200 dt-bindings: auxdisplay: img-ascii-lcd: Convert to json-schema Convert the Device Tree binding documentation for ASCII LCD displays on Imagination Technologies boards to json-schema. Drop bogus regmap property. Add example. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6e74aa466d39ddc9abe502e054d04e8cc7b76b40.1627402094.git.geert@linux-m68k.org [robh: add type to 'offset'] Signed-off-by: Rob Herring commit dbe60e5d7f15454ecc9c7d93dce6240fdaa70da9 Author: Geert Uytterhoeven Date: Tue Jul 27 18:01:05 2021 +0200 dt-bindings: memory: renesas,rpc-if: Miscellaneous improvements - Fix rejection of legitimate flash subnodes containing multiple compatible values, - Add missing list of required properties. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d81b59a513c2a5204c8378b4a89cd07f97c46797.1627401508.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit b189dde9d3e54b607791e9cdf28c7881eac8a37e Merge: 2f535e2cd5135 60e9feb781dfe Author: Mark Brown Date: Mon Aug 2 21:27:55 2021 +0100 Merge series "soundwire/ASoC: abstract platform-dependent bases" from Bard Liao : shim base and alh base are platform-dependent. This series suggests to use variables for those bases. It allows us to use different bases for new platforms. v2: - Update the commit message of "soundwire: move intel sdw register definitions to sdw_intel.h" Bard Liao (6): soundwire: move intel sdw register definitions to sdw_intel.h ASoC: SOF: intel: add sdw_shim/alh_base to sof_intel_dsp_desc ASoC: SOF: intel: hda: remove HDA_DSP_REG_SNDW_WAKE_STS definition ASoC: SOF: intel: move sof_intel_dsp_desc() forward ASoC: SOF: intel: add snd_sof_dsp_check_sdw_irq ops soundwire: intel: introduce shim and alh base drivers/soundwire/intel.c | 74 ------------------------ drivers/soundwire/intel_init.c | 14 ++--- include/linux/soundwire/sdw_intel.h | 87 +++++++++++++++++++++++++++++ sound/soc/sof/intel/cnl.c | 6 ++ sound/soc/sof/intel/hda.c | 39 ++++++++----- sound/soc/sof/intel/hda.h | 8 ++- sound/soc/sof/intel/icl.c | 3 + sound/soc/sof/intel/shim.h | 3 + sound/soc/sof/intel/tgl.c | 12 ++++ 9 files changed, 149 insertions(+), 97 deletions(-) -- 2.17.1 commit 2f535e2cd513571dce1226361dfc0ee160744f41 Merge: ea9df9840fd5d 780feaf4ad884 Author: Mark Brown Date: Mon Aug 2 21:27:54 2021 +0100 Merge series "ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 audio routing" from Hans de Goede : Changes in v2: - Only set lineout_string if BYT_RT5640_LINEOUT is set, since BYT_RT5640_LINEOUT_AS_HP2 only works if the lineout is enabled in the first place Original cover-letter: The HP Elitepad 1000 G2 has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec, combined with an external HP-amp + IN1 for the headset-mic. This series adds support for this, resolving: https://bugzilla.kernel.org/show_bug.cgi?id=213415 Note this series does not add jack-detect support. I plan to add that with a follow-up series when I can make some time to implement that. Regards, Hans Hans de Goede (6): ASoC: Intel: bytcr_rt5640: Move "Platform Clock" routes to the maps for the matching in-/output ASoC: Intel: bytcr_rt5640: Add line-out support ASoC: Intel: bytcr_rt5640: Add a byt_rt5640_get_codec_dai() helper ASoC: Intel: bytcr_rt5640: Add support for a second headphones output ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 quirk sound/soc/intel/boards/bytcr_rt5640.c | 118 ++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 16 deletions(-) -- 2.31.1 commit 28814cd18cd7bfb40321b95f85fd214111ccdf68 Author: David Ahern Date: Mon Aug 2 10:02:21 2021 -0600 ipv4: Fix refcount warning for new fib_info Ioana reported a refcount warning when booting over NFS: [ 5.042532] ------------[ cut here ]------------ [ 5.047184] refcount_t: addition on 0; use-after-free. [ 5.052324] WARNING: CPU: 7 PID: 1 at lib/refcount.c:25 refcount_warn_saturate+0xa4/0x150 ... [ 5.167201] Call trace: [ 5.169635] refcount_warn_saturate+0xa4/0x150 [ 5.174067] fib_create_info+0xc00/0xc90 [ 5.177982] fib_table_insert+0x8c/0x620 [ 5.181893] fib_magic.isra.0+0x110/0x11c [ 5.185891] fib_add_ifaddr+0xb8/0x190 [ 5.189629] fib_inetaddr_event+0x8c/0x140 fib_treeref needs to be set after kzalloc. The old code had a ++ which led to the confusion when the int was replaced by a refcount_t. Fixes: 79976892f7ea ("net: convert fib_treeref from int to refcount_t") Signed-off-by: David Ahern Reported-by: Ioana Ciornei Cc: Yajun Deng Tested-by: Matthieu Baerts Link: https://lore.kernel.org/r/20210802160221.27263-1-dsahern@kernel.org Signed-off-by: Jakub Kicinski commit 1dbd981fcf2a4498bbf66b55b830ca0aadff9476 Author: Biju Das Date: Tue Jul 27 13:34:50 2021 +0100 dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP Document Gigabit Ethernet IP found on RZ/G2L SoC. Gigabit Ethernet Interface includes Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC) for transferring transmitted Ethernet frames to and received Ethernet frames from respective storage areas in the URAM at high speed. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210727123450.15918-1-biju.das.jz@bp.renesas.com Signed-off-by: Rob Herring commit 3087b335b5316cd180aa4c5a28abaa890905634e Author: Md Haris Iqbal Date: Mon Jul 26 13:59:50 2021 +0200 block/rnbd: Use sysfs_emit instead of s*printf function for sysfs show sysfs_emit function was added to be aware of the PAGE_SIZE maximum of the temporary buffer used for outputting sysfs content, so there is no possible overruns. So replace the uses of any s*printf functions for the sysfs show functions with sysfs_emit. Signed-off-by: Md Haris Iqbal Signed-off-by: Jack Wang Link: https://lore.kernel.org/r/20210726115950.470543-3-jinpu.wang@ionos.com Signed-off-by: Jens Axboe commit 94dace8c85717588c2b4d116759cc3253f47d0eb Author: Gioh Kim Date: Mon Jul 26 13:59:49 2021 +0200 block/rnbd-clt: Use put_cpu_ptr after get_cpu_ptr This patch replaces put_cpu_var with put_cpu_ptr because get_cpu_ptr should be paired with put_cpu_ptr. Signed-off-by: Gioh Kim Signed-off-by: Jack Wang Link: https://lore.kernel.org/r/20210726115950.470543-2-jinpu.wang@ionos.com Signed-off-by: Jens Axboe commit 2bc1f6e442eec88fa60f1ee6bef2c9871227cf8a Author: Damien Le Moal Date: Tue Jul 13 17:18:37 2021 +0900 block: remove blk-mq-sysfs dead code In block/blk-mq-sysfs.c, struct blk_mq_ctx_sysfs_entry is not used to define any attribute since the "mq" sysfs directory contains only sub-directories (no attribute files). As a result, blk_mq_sysfs_show(), blk_mq_sysfs_store(), and struct sysfs_ops blk_mq_sysfs_ops are all unused and unnecessary. Remove all this unused code. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20210713081837.524422-1-damien.lemoal@wdc.com Signed-off-by: Jens Axboe commit 9f65c489b68d42427dc0651488dd260d678f525d Author: Matteo Croce Date: Tue Jul 13 01:05:30 2021 +0200 loop: raise media_change event Make the loop device raise a DISK_MEDIA_CHANGE event on attach or detach. # udevadm monitor -up |grep -e DISK_MEDIA_CHANGE -e DEVNAME & # losetup -f zero [ 7.454235] loop0: detected capacity change from 0 to 16384 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop0 DEVNAME=/dev/loop0 DEVNAME=/dev/loop0 # losetup -f zero [ 10.205245] loop1: detected capacity change from 0 to 16384 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop1 DEVNAME=/dev/loop1 DEVNAME=/dev/loop1 # losetup -f zero2 [ 13.532368] loop2: detected capacity change from 0 to 40960 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop2 DEVNAME=/dev/loop2 # losetup -D DEVNAME=/dev/loop1 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop1 DEVNAME=/dev/loop2 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop2 DEVNAME=/dev/loop0 DISK_MEDIA_CHANGE=1 DEVNAME=/dev/loop0 Signed-off-by: Matteo Croce Reviewed-by: Christoph Hellwig Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-7-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit e6138dc12de9df17cbda9c40314d69592855ac5e Author: Matteo Croce Date: Tue Jul 13 01:05:29 2021 +0200 block: add a helper to raise a media changed event Refactor disk_check_events() and move some code into disk_event_uevent(). Then add disk_force_media_change(), a helper which will be used by devices to force issuing a DISK_EVENT_MEDIA_CHANGE event. Co-developed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Matteo Croce Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-6-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit 13927b31b13f3c6556221eff3487247bd3c7a245 Author: Matteo Croce Date: Tue Jul 13 01:05:28 2021 +0200 block: export diskseq in sysfs Add a new sysfs handle to export the new diskseq value. Place it in /block//diskseq and document it. $ grep . /sys/class/block/*/diskseq /sys/class/block/loop0/diskseq:13 /sys/class/block/loop1/diskseq:14 /sys/class/block/loop2/diskseq:5 /sys/class/block/loop3/diskseq:6 /sys/class/block/ram0/diskseq:1 /sys/class/block/ram1/diskseq:2 /sys/class/block/vda/diskseq:7 Reviewed-by: Christoph Hellwig Signed-off-by: Matteo Croce Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-5-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit 7957d93bf32bc211415827e44fdd9cdf1388df59 Author: Matteo Croce Date: Tue Jul 13 01:05:27 2021 +0200 block: add ioctl to read the disk sequence number Add a new BLKGETDISKSEQ ioctl which retrieves the disk sequence number from the genhd structure. # ./getdiskseq /dev/loop* /dev/loop0: 13 /dev/loop0p1: 13 /dev/loop0p2: 13 /dev/loop0p3: 13 /dev/loop1: 14 /dev/loop1p1: 14 /dev/loop1p2: 14 /dev/loop2: 5 /dev/loop3: 6 Reviewed-by: Christoph Hellwig Signed-off-by: Matteo Croce Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-4-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit 87eb710747126ca6606f064deef93d045486ebbe Author: Matteo Croce Date: Tue Jul 13 01:05:26 2021 +0200 block: export the diskseq in uevents Export the newly introduced diskseq in uevents: $ udevadm info /sys/class/block/* |grep -e DEVNAME -e DISKSEQ E: DEVNAME=/dev/loop0 E: DISKSEQ=1 E: DEVNAME=/dev/loop1 E: DISKSEQ=2 E: DEVNAME=/dev/loop2 E: DISKSEQ=3 E: DEVNAME=/dev/loop3 E: DISKSEQ=4 E: DEVNAME=/dev/loop4 E: DISKSEQ=5 E: DEVNAME=/dev/loop5 E: DISKSEQ=6 E: DEVNAME=/dev/loop6 E: DISKSEQ=7 E: DEVNAME=/dev/loop7 E: DISKSEQ=8 E: DEVNAME=/dev/nvme0n1 E: DISKSEQ=9 E: DEVNAME=/dev/nvme0n1p1 E: DISKSEQ=9 E: DEVNAME=/dev/nvme0n1p2 E: DISKSEQ=9 E: DEVNAME=/dev/nvme0n1p3 E: DISKSEQ=9 E: DEVNAME=/dev/nvme0n1p4 E: DISKSEQ=9 E: DEVNAME=/dev/nvme0n1p5 E: DISKSEQ=9 E: DEVNAME=/dev/sda E: DISKSEQ=10 E: DEVNAME=/dev/sda1 E: DISKSEQ=10 E: DEVNAME=/dev/sda2 E: DISKSEQ=10 Reviewed-by: Christoph Hellwig Signed-off-by: Matteo Croce Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-3-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit cf179948554a2e0d2b622317bf6bf33138ac36e5 Author: Matteo Croce Date: Tue Jul 13 01:05:25 2021 +0200 block: add disk sequence number Associating uevents with block devices in userspace is difficult and racy: the uevent netlink socket is lossy, and on slow and overloaded systems has a very high latency. Block devices do not have exclusive owners in userspace, any process can set one up (e.g. loop devices). Moreover, device names can be reused (e.g. loop0 can be reused again and again). A userspace process setting up a block device and watching for its events cannot thus reliably tell whether an event relates to the device it just set up or another earlier instance with the same name. Being able to set a UUID on a loop device would solve the race conditions. But it does not allow to derive orderings from uevents: if you see a uevent with a UUID that does not match the device you are waiting for, you cannot tell whether it's because the right uevent has not arrived yet, or it was already sent and you missed it. So you cannot tell whether you should wait for it or not. Associating a unique, monotonically increasing sequential number to the lifetime of each block device, which can be retrieved with an ioctl immediately upon setting it up, allows to solve the race conditions with uevents, and also allows userspace processes to know whether they should wait for the uevent they need or if it was dropped and thus they should move on. Additionally, increment the disk sequence number when the media change, i.e. on DISK_EVENT_MEDIA_CHANGE event. Reviewed-by: Christoph Hellwig Signed-off-by: Matteo Croce Tested-by: Luca Boccassi Link: https://lore.kernel.org/r/20210712230530.29323-2-mcroce@linux.microsoft.com Signed-off-by: Jens Axboe commit 2164877c7f373e14e55fca20b7c4a9c436fe4462 Author: Christoph Hellwig Date: Wed Jul 28 07:37:56 2021 +0200 block: remove cmdline-parser.c cmdline-parser.c is only used by the cmdline faux partition format, so merge the code into that and avoid an indirect call. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210728053756.409654-1-hch@lst.de Signed-off-by: Jens Axboe commit abd2864a3e46368a58f3718491521779099bfc14 Author: Christoph Hellwig Date: Tue Jul 27 08:25:18 2021 +0200 block: remove disk_name() Remove the disk_name function now that all users are gone. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-7-hch@lst.de Signed-off-by: Jens Axboe commit 1d7035478f64c040441c9cb2aa32e0d7fae526d2 Author: Christoph Hellwig Date: Tue Jul 27 08:25:17 2021 +0200 block: simplify disk name formatting in check_partition disk_name for partition 0 just copies out the disk_name field. Replace the call to disk_name with a %s format specifier. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-6-hch@lst.de Signed-off-by: Jens Axboe commit 453b8ab696b32cfd8bad80a5501937440d1cf214 Author: Christoph Hellwig Date: Tue Jul 27 08:25:16 2021 +0200 block: simplify printing the device names disk_stack_limits Printk ->disk_name directly for the disk and use the %pg format specifier for the block device, which is equivalent to a bdevname call. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-5-hch@lst.de Signed-off-by: Jens Axboe commit a291bb43e5c9fdedc4be3dfd496e64e7c5a78b1f Author: Christoph Hellwig Date: Tue Jul 27 08:25:15 2021 +0200 block: use the %pg format specifier in show_partition Simplify printing the partition name by using the %pg format specifier that is equivalent to a bdevname call. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-4-hch@lst.de Signed-off-by: Jens Axboe commit a9e7bc3de4051d037a8e6f2d30448c347263737e Author: Christoph Hellwig Date: Tue Jul 27 08:25:14 2021 +0200 block: use the %pg format specifier in printk_all_partitions Simplify printing the partition name by using the %pg format specifier that is equivalent to a bdevname call. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-3-hch@lst.de Signed-off-by: Jens Axboe commit 26e2d7a362f6a83146ea3eaa8f17ca9ce35388d3 Author: Abd-Alrhman Masalkhi Date: Tue Jul 27 08:25:13 2021 +0200 block: reduce stack usage in diskstats_show I have compiled the kernel with a cross compiler "hppa-linux-gnu-" v9.3.0 on x86-64 host machine. I got the following warning: block/genhd.c: In function ‘diskstats_show’: block/genhd.c:1227:1: warning: the frame size of 1688 bytes is larger than 1280 bytes [-Wframe-larger-than=] 1227 | } By Reduced the stack footprint by using the %pg printk specifier instead of disk_name to remove the need for the on-stack buffer. Signed-off-by: Abd-Alrhman Masalkhi Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727062518.122108-2-hch@lst.de Signed-off-by: Jens Axboe commit 2f4731dcd0bb73379fbb9e3eb07ae7324125caef Author: Christoph Hellwig Date: Thu Jul 22 09:54:02 2021 +0200 block: remove bdput Now that we've stopped using inode references for anything meaninful in the block layer get rid of the helper to put it and just open code the call to iput on the block_device inode. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20210722075402.983367-10-hch@lst.de Signed-off-by: Jens Axboe commit 14cf1dbb55bb07427babee425fd2a8a9300737cc Author: Christoph Hellwig Date: Thu Jul 22 09:54:01 2021 +0200 block: remove bdgrab All callers are gone, and no one should grab a pure inode reference to a block device anymore. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20210722075402.983367-9-hch@lst.de Signed-off-by: Jens Axboe commit 4b2731226d7de4302e4d8766c86e3a21c56dc3b1 Author: Christoph Hellwig Date: Thu Jul 22 09:54:00 2021 +0200 loop: don't grab a reference to the block device The whole device block device won't be removed while the disk is still alive, so don't bother to grab a reference to it. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Reviewed-by: Ming Lei Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20210722075402.983367-8-hch@lst.de Signed-off-by: Jens Axboe commit 9d3b8813895d737fcef4ec8df518f67e5cc381b8 Author: Christoph Hellwig Date: Thu Jul 22 09:53:58 2021 +0200 block: change the refcounting for partitions Instead of acquiring an inode reference on open make sure partitions always hold device model references to the disk while alive, and switch open to grab only a device model reference to the opened block device. If that is a partition the disk reference is transitively held by the partition already. Link: https://lore.kernel.org/r/20210722075402.983367-6-hch@lst.de Signed-off-by: Jens Axboe commit 0468c5323413c6903e4cbcef841a55e6c5578cd2 Author: Christoph Hellwig Date: Thu Jul 22 09:53:57 2021 +0200 block: allocate bd_meta_info later in add_partitions Move the allocation of bd_meta_info after initializing the struct device to avoid the special bdput error handling path. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20210722075402.983367-5-hch@lst.de Signed-off-by: Jens Axboe commit d7a66574b34e0b354442140927f9b787efccabfd Author: Christoph Hellwig Date: Thu Jul 22 09:53:56 2021 +0200 block: unhash the whole device inode earlier Unhash the whole device inode early in del_gendisk. This allows to remove the first GENHD_FL_UP check in the open path as we simply won't find a just removed inode. The second non-racy check after taking open_mutex is still kept. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210722075402.983367-4-hch@lst.de Signed-off-by: Jens Axboe commit a45e43cad798173b41e0d6f119784826d3ead02c Author: Christoph Hellwig Date: Thu Jul 22 09:53:55 2021 +0200 block: assert the locking state in delete_partition Add a lockdep assert instead of the outdated locking comment. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Reviewed-by: Ming Lei Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20210722075402.983367-3-hch@lst.de Signed-off-by: Jens Axboe commit 503469b5b30f76169c6302d1469e69a2fb67faf9 Author: Christoph Hellwig Date: Tue Jul 27 07:56:46 2021 +0200 block: use bvec_kmap_local in bio_integrity_process Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-16-hch@lst.de Signed-off-by: Jens Axboe commit 8aec120a9ca80c14ce002505cea1e1639f8e9ea5 Author: Christoph Hellwig Date: Tue Jul 27 07:56:45 2021 +0200 block: use bvec_kmap_local in t10_pi_type1_{prepare,complete} Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-15-hch@lst.de Signed-off-by: Jens Axboe commit 4aebe8596ab77b0b7125e3584ed0259c4657a06d Author: Christoph Hellwig Date: Tue Jul 27 07:56:44 2021 +0200 block: use memcpy_from_bvec in __blk_queue_bounce Rewrite the actual bounce buffering loop in __blk_queue_bounce to that the memcpy_to_bvec helper can be used to perform the data copies. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-14-hch@lst.de Signed-off-by: Jens Axboe commit d24920e20ca66780d4059e2ece9f858cbae02310 Author: Christoph Hellwig Date: Tue Jul 27 07:56:43 2021 +0200 block: use memcpy_from_bvec in bio_copy_kern_endio_read Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-13-hch@lst.de Signed-off-by: Jens Axboe commit f434cdc78e01e40fcfb8ef7e6752e3e405b84b58 Author: Christoph Hellwig Date: Tue Jul 27 07:56:42 2021 +0200 block: use memcpy_to_bvec in copy_to_high_bio_irq Use memcpy_to_bvec instead of opencoding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-12-hch@lst.de Signed-off-by: Jens Axboe commit f8b679a070c536600c64a78c83b96aa617f8fa71 Author: Christoph Hellwig Date: Tue Jul 27 07:56:41 2021 +0200 block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec Use the proper helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-11-hch@lst.de Signed-off-by: Jens Axboe commit bda135d9c03fae64c910a8c8d751eccd8408f400 Author: Christoph Hellwig Date: Tue Jul 27 07:56:40 2021 +0200 block: remove bvec_kmap_irq and bvec_kunmap_irq These two helpers are entirely unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20210727055646.118787-10-hch@lst.de Signed-off-by: Jens Axboe commit 6e0a48552b8cfc3767b98e3e8beed3f4cbafc9f4 Author: Christoph Hellwig Date: Tue Jul 27 07:56:39 2021 +0200 ps3disk: use memcpy_{from,to}_bvec Use the bvec helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Tested-by: Geoff Levand Link: https://lore.kernel.org/r/20210727055646.118787-9-hch@lst.de Signed-off-by: Jens Axboe commit 18a6234ccf0661401f07b6316a25d4adbba1d4bd Author: Christoph Hellwig Date: Tue Jul 27 07:56:38 2021 +0200 dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq There is no need to disable interrupts in bio_copy_block, and the local only mappings helps to avoid any sort of problems with stray writes into the bio data. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-8-hch@lst.de Signed-off-by: Jens Axboe commit 732022b86a37e816718786ce0b2cebc2b1739fa3 Author: Christoph Hellwig Date: Tue Jul 27 07:56:37 2021 +0200 rbd: use memzero_bvec Use memzero_bvec instead of reimplementing it. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-7-hch@lst.de Signed-off-by: Jens Axboe commit ab6c340eeac426fb649ddb4f23b7c752f0092204 Author: Christoph Hellwig Date: Tue Jul 27 07:56:36 2021 +0200 block: use memzero_page in zero_fill_bio Use memzero_bvec to zero each segment in the bio instead of manually mapping and zeroing the data. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-6-hch@lst.de Signed-off-by: Jens Axboe commit f93a181af40b159aabea2ccf1a0496e9280be2d5 Author: Christoph Hellwig Date: Tue Jul 27 07:56:35 2021 +0200 bvec: add memcpy_{from,to}_bvec and memzero_bvec helper Add helpers to perform common memory operation on a bvec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-5-hch@lst.de Signed-off-by: Jens Axboe commit e6e7471706dc42cbe0e01278540c0730138d43e5 Author: Christoph Hellwig Date: Tue Jul 27 07:56:34 2021 +0200 bvec: add a bvec_kmap_local helper Add a helper to call kmap_local_page on a bvec. There is no need for an unmap helper given that kunmap_local accept any address in the mapped page. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-4-hch@lst.de Signed-off-by: Jens Axboe commit e45cef51dba9765a6e1df1be724f3d26323512c8 Author: Christoph Hellwig Date: Tue Jul 27 07:56:33 2021 +0200 bvec: fix the include guards for bvec.h Fix the include guards to match the file naming. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-3-hch@lst.de Signed-off-by: Jens Axboe commit 4c7251e1b576d884046e62d23505e75486f88c1f Author: Christoph Hellwig Date: Tue Jul 27 07:56:32 2021 +0200 MIPS: don't include in There is no need to include genhd.h from a random arch header, and not doing so prevents the possibility for nasty include loops. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20210727055646.118787-2-hch@lst.de Signed-off-by: Jens Axboe commit 06447ae5e33bfbc5a777cc06d9854a31f3912833 Author: Oliver Hartkopp Date: Wed Jul 14 21:56:55 2021 +0200 ioprio: move user space relevant ioprio bits to UAPI includes systemd added a modified copy of include/linux/ioprio.h into its code to get the relevant content definitions for the exposed ioprio_[get|set] system calls. Move the user space relevant ioprio bits to the UAPI includes to be able to use the ioprio_[get|set] syscalls as intended. Cc: Kay Sievers Cc: Greg Kroah-Hartman Cc: Jens Axboe Cc: linux-block@vger.kernel.org Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/r/20210714195655.181943-1-socketcan@hartkopp.net Signed-off-by: Jens Axboe commit dc675a97129c4d9d5af55a3d7f23d7e092b8e032 Author: Laibin Qiu Date: Sat Jul 31 11:26:46 2021 +0800 f2fs: fix min_seq_blocks can not make sense in some scenes. F2FS have dirty page count control for batched sequential write in writepages, and get the value of min_seq_blocks by blocks_per_seg * segs_per_sec(segs_per_sec defaults to 1). But in some scenes we set a lager section size, Min_seq_blocks will become too large to achieve the expected effect(eg. 4thread sequential write, the number of merge requests will be reduced). Signed-off-by: Laibin Qiu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2787991516468bfafafb9bf2b45a848e6b202e7c Author: Chao Yu Date: Tue Jul 20 09:03:29 2021 +0800 f2fs: fix to force keeping write barrier for strict fsync mode [1] https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg15126.html As [1] reported, if lower device doesn't support write barrier, in below case: - write page #0; persist - overwrite page #0 - fsync - write data page #0 OPU into device's cache - write inode page into device's cache - issue flush If SPO is triggered during flush command, inode page can be persisted before data page #0, so that after recovery, inode page can be recovered with new physical block address of data page #0, however there may contains dummy data in new physical block address. Then what user will see is: after overwrite & fsync + SPO, old data in file was corrupted, if any user do care about such case, we can suggest user to use STRICT fsync mode, in this mode, we will force to use atomic write sematics to keep write order in between data/node and last node, so that it avoids potential data corruption during fsync(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 277afbde6ca2b38729683fc17c031b4bc942068d Author: Chao Yu Date: Thu Jul 29 09:22:17 2021 +0800 f2fs: fix wrong checkpoint_changed value in f2fs_remount() In f2fs_remount(), return value of test_opt() is an unsigned int type variable, however when we compare it to a bool type variable, it cause wrong result, fix it. Fixes: 4354994f097d ("f2fs: checkpoint disabling") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2e650912c037a501ea6fc367c7075ead63a114f7 Author: Jaegeuk Kim Date: Fri Jul 30 08:10:48 2021 -0700 f2fs: show sbi status in debugfs/f2fs/status We need to get sbi->s_flag to understand the current f2fs status as well. One example is SBI_NEED_FSCK. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4931e0c93e124357308893a3e5e224cbeeabc721 Author: Daeho Jeong Date: Wed Jul 28 12:38:11 2021 -0700 f2fs: turn back remapped address in compressed page endio Turned back the remmaped sector address to the address in the partition, when ending io, for compress cache to work properly. Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Daeho Jeong Signed-off-by: Youngjin Gil Signed-off-by: Hyeong Jun Kim Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 093f0bac32b617960899c7e00f4550373c383dd0 Author: Daeho Jeong Date: Sun Jul 25 21:18:19 2021 -0700 f2fs: change fiemap way in printing compression chunk When we print out a discontinuous compression chunk, it shows like a continuous chunk now. To show it more correctly, I've changed the way of printing fiemap info like below. Plus, eliminated NEW_ADDR(-1) in fiemap info, since it is not in fiemap user api manual. Let's assume 16KB compression cluster. Logical Physical Length Flags 0: 0000000000000000 00000002c091f000 0000000000004000 1008 1: 0000000000004000 00000002c0920000 0000000000004000 1008 ... 9: 0000000000034000 0000000f8c623000 0000000000004000 1008 10: 0000000000038000 000000101a6eb000 0000000000004000 1008 0: 0000000000000000 00000002c091f000 0000000000004000 1008 1: 0000000000004000 00000002c0920000 0000000000004000 1008 ... 9: 0000000000034000 0000000f8c623000 0000000000001000 1008 10: 0000000000035000 000000101a6ea000 0000000000003000 1008 11: 0000000000038000 000000101a6eb000 0000000000002000 1008 12: 000000000003a000 00000002c3544000 0000000000002000 1008 Flags 0x1000 => FIEMAP_EXTENT_MERGED 0x0008 => FIEMAP_EXTENT_ENCODED Signed-off-by: Daeho Jeong Tested-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b7ec2061737f12c33e45beeb967d17f31abc1ada Author: Jaegeuk Kim Date: Mon Jul 26 09:12:15 2021 -0700 f2fs: do not submit NEW_ADDR to read node block After the below patch, give cp is errored, we drop dirty node pages. This can give NEW_ADDR to read node pages. Don't do WARN_ON() which gives generic/475 failure. Fixes: 28607bf3aa6f ("f2fs: drop dirty node pages when cp is in error status") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7eab7a6968278c735b1ca6387056a408f7960265 Author: Fengnan Chang Date: Tue Jun 22 19:50:59 2021 +0800 f2fs: compress: remove unneeded read when rewrite whole cluster when we overwrite the whole page in cluster, we don't need read original data before write, because after write_end(), writepages() can help to load left data in that cluster. Signed-off-by: Fengnan Chang Signed-off-by: Chao Yu Acked-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 767215030150d9d01ff65fbc1c5dff515ffdcfe3 Author: Mark Rutland Date: Wed Jul 14 15:38:43 2021 +0100 arm64: kasan: mte: remove redundant mte_report_once logic We have special logic to suppress MTE tag check fault reporting, based on a global `mte_report_once` and `reported` variables. These can be used to suppress calling kasan_report() when taking a tag check fault, but do not prevent taking the fault in the first place, nor does they affect the way we disable tag checks upon taking a fault. The core KASAN code already defaults to reporting a single fault, and has a `multi_shot` control to permit reporting multiple faults. The only place we transiently alter `mte_report_once` is in lib/test_kasan.c, where we also the `multi_shot` state as the same time. Thus `mte_report_once` and `reported` are redundant, and can be removed. When a tag check fault is taken, tag checking will be disabled by `do_tag_recovery` and must be explicitly re-enabled if desired. The test code does this by calling kasan_enable_tagging_sync(). This patch removes the redundant mte_report_once() logic and associated variables. Signed-off-by: Mark Rutland Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Will Deacon Cc: Vincenzo Frascino Reviewed-by: Catalin Marinas Reviewed-by: Andrey Konovalov Tested-by: Andrey Konovalov Link: https://lore.kernel.org/r/20210714143843.56537-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 82868247897bea2d69a83dca9a6a557e2c96dac4 Author: Mark Rutland Date: Wed Jul 14 15:38:42 2021 +0100 arm64: kasan: mte: use a constant kernel GCR_EL1 value When KASAN_HW_TAGS is selected, KASAN is enabled at boot time, and the hardware supports MTE, we'll initialize `kernel_gcr_excl` with a value dependent on KASAN_TAG_MAX. While the resulting value is a constant which depends on KASAN_TAG_MAX, we have to perform some runtime work to generate the value, and have to read the value from memory during the exception entry path. It would be better if we could generate this as a constant at compile-time, and use it as such directly. Early in boot within __cpu_setup(), we initialize GCR_EL1 to a safe value, and later override this with the value required by KASAN. If CONFIG_KASAN_HW_TAGS is not selected, or if KASAN is disabeld at boot time, the kernel will not use IRG instructions, and so the initial value of GCR_EL1 is does not matter to the kernel. Thus, we can instead have __cpu_setup() initialize GCR_EL1 to a value consistent with KASAN_TAG_MAX, and avoid the need to re-initialize it during hotplug and resume form suspend. This patch makes arem64 use a compile-time constant KERNEL_GCR_EL1 value, which is compatible with KASAN_HW_TAGS when this is selected. This removes the need to re-initialize GCR_EL1 dynamically, and acts as an optimization to the entry assembly, which no longer needs to load this value from memory. The redundant initialization hooks are removed. In order to do this, KASAN_TAG_MAX needs to be visible outside of the core KASAN code. To do this, I've moved the KASAN_TAG_* values into . There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Andrey Konovalov Tested-by: Andrey Konovalov Link: https://lore.kernel.org/r/20210714143843.56537-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit d21faba11693c10072ce3b96b696445175f49be2 Author: Marc Zyngier Date: Mon Aug 2 17:26:19 2021 +0100 PCI: Bulk conversion to generic_handle_domain_irq() Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Link: https://lore.kernel.org/r/20210802162630.2219813-4-maz@kernel.org Signed-off-by: Marc Zyngier Signed-off-by: Bjorn Helgaas Acked-by: Krzysztof Kozlowski commit b24b5205099a342ee38f7db7c18e39da2f2ae8e8 Author: Mark Brown Date: Fri Jul 30 17:58:46 2021 +0100 arm64/sve: Make fpsimd_bind_task_to_cpu() static This function is not referenced outside fpsimd.c so can be static, making it that little bit easier to follow what is called from where. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210730165846.18558-1-broonie@kernel.org Reviewed-by: Dave Martin Signed-off-by: Catalin Marinas commit 1187c8c4642d109037202b43a5054adaef78b760 Author: Colin Ian King Date: Sun Aug 1 08:01:55 2021 +0100 net: phy: mscc: make some arrays static const, makes object smaller Don't populate arrays on the stack but instead them static const. Makes the object code smaller by 280 bytes. Before: text data bss dec hex filename 24142 4368 192 28702 701e ./drivers/net/phy/mscc/mscc_ptp.o After: text data bss dec hex filename 23830 4400 192 28422 6f06 ./drivers/net/phy/mscc/mscc_ptp.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801070155.139057-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit f36c82ac1b1bbb648d93ef715f2d2f06f3663561 Author: Colin Ian King Date: Sun Aug 1 07:53:28 2021 +0100 netdevsim: make array res_ids static const, makes object smaller Don't populate the array res_ids on the stack but instead it static const. Makes the object code smaller by 14 bytes. Before: text data bss dec hex filename 50833 8314 256 59403 e80b ./drivers/net/netdevsim/fib.o After: text data bss dec hex filename 50755 8378 256 59389 e7fd ./drivers/net/netdevsim/fib.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801065328.138906-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski commit 82929a2140eb99f1f1d21855f3f580e70d7abdd8 Author: Matt Roper Date: Wed Jul 28 16:34:11 2021 -0700 drm/i915: Correct SFC_DONE register offset The register offset for SFC_DONE was missing a '0' at the end, causing us to read from a non-existent register address. We only use this register in error state dumps so the mistake hasn't caused any real problems, but fixing it will hopefully make the error state dumps a bit more useful for debugging. Fixes: e50dbdbfd9fb ("drm/i915/tgl: Add SFC instdone to error state") Cc: Mika Kuoppala Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728233411.2365788-1-matthew.d.roper@intel.com Reviewed-by: Mika Kuoppala commit 47a70bea54b7afa983c71fa409785c067f4e865b Author: Joerg Roedel Date: Mon Aug 2 17:06:43 2021 +0200 iommu/amd: Remove stale amd_iommu_unmap_flush usage Remove the new use of the variable introduced in the AMD driver branch. The variable was removed already in the iommu core branch, causing build errors when the brances are merged. Cc: Nadav Amit Cc: Zhen Lei Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20210802150643.3634-1-joro@8bytes.org commit 1651d9e7810e79500b4940122e192b8aaeb2d63c Author: Rajat Jain Date: Fri Jul 30 16:53:04 2021 -0700 thunderbolt: Add authorized value to the KOBJ_CHANGE uevent For security reasons, we would like to monitor and track when the Thunderbolt devices are authorized and deauthorized (i.e. when the Thunderbolt sysfs "authorized" attribute changes). Currently the userspace gets a udev change notification when there is a change, but the state may have changed (again) by the time we look at the authorized attribute in sysfs. So an authorization event may go unnoticed. Thus make it easier by informing the actual change (new value of authorized attribute) in the udev change notification. The change is included as a key value "authorized=" where is the new value of sysfs attribute "authorized", and is described at Documentation/ABI/testing/sysfs-bus-thunderbolt under /sys/bus/thunderbolt/devices/.../authorized. Signed-off-by: Rajat Jain Signed-off-by: Mika Westerberg commit 654e6f7700c46017af309aab594f0afdebc30740 Author: mark-yw.chen Date: Mon Aug 2 20:59:41 2021 +0800 Bluetooth: btusb: Enable MSFT extension for Mediatek Chip (MT7921) The Mdiatek MT7921(7961) support MSFT HCI extensions, we are using 0xFD30 for VsMsftOpCode. Signed-off-by: mark-yw.chen Signed-off-by: Marcel Holtmann commit db105fab8d141fc0d9179600c51eba0d168dad34 Author: Paolo Bonzini Date: Mon Aug 2 08:52:50 2021 -0400 KVM: nSVM: remove useless kvm_clear_*_queue For an event to be in injected state when nested_svm_vmrun executes, it must have come from exitintinfo when svm_complete_interrupts ran: vcpu_enter_guest static_call(kvm_x86_run) -> svm_vcpu_run svm_complete_interrupts // now the event went from "exitintinfo" to "injected" static_call(kvm_x86_handle_exit) -> handle_exit svm_invoke_exit_handler vmrun_interception nested_svm_vmrun However, no event could have been in exitintinfo before a VMRUN vmexit. The code in svm.c is a bit more permissive than the one in vmx.c: if (is_external_interrupt(svm->vmcb->control.exit_int_info) && exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR && exit_code != SVM_EXIT_NPF && exit_code != SVM_EXIT_TASK_SWITCH && exit_code != SVM_EXIT_INTR && exit_code != SVM_EXIT_NMI) but in any case, a VMRUN instruction would not even start to execute during an attempted event delivery. Signed-off-by: Paolo Bonzini commit 4c72ab5aa6e0ac2a5c11f9180e1fff89d7f2d38b Author: Sean Christopherson Date: Tue Jul 13 09:33:24 2021 -0700 KVM: x86: Preserve guest's CR0.CD/NW on INIT Preserve CR0.CD and CR0.NW on INIT instead of forcing them to '1', as defined by both Intel's SDM and AMD's APM. Note, current versions of Intel's SDM are very poorly written with respect to INIT behavior. Table 9-1. "IA-32 and Intel 64 Processor States Following Power-up, Reset, or INIT" quite clearly lists power-up, RESET, _and_ INIT as setting CR0=60000010H, i.e. CD/NW=1. But the SDM then attempts to qualify CD/NW behavior in a footnote: 2. The CD and NW flags are unchanged, bit 4 is set to 1, all other bits are cleared. Presumably that footnote is only meant for INIT, as the RESET case and especially the power-up case are rather non-sensical. Another footnote all but confirms that: 6. Internal caches are invalid after power-up and RESET, but left unchanged with an INIT. Bare metal testing shows that CD/NW are indeed preserved on INIT (someone else can hack their BIOS to check RESET and power-up :-D). Reported-by: Reiji Watanabe Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-47-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 46f4898b207ffeeeaebc0fdd4bf4082bf0f88107 Author: Sean Christopherson Date: Tue Jul 13 09:33:23 2021 -0700 KVM: SVM: Drop redundant clearing of vcpu->arch.hflags at INIT/RESET Drop redundant clears of vcpu->arch.hflags in init_vmcb() since kvm_vcpu_reset() always clears hflags, and it is also always zero at vCPU creation time. And of course, the second clearing in init_vmcb() was always redundant. Suggested-by: Reiji Watanabe Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-46-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 265e43530cb2eb14d5b78e89d310c79959e0eb26 Author: Sean Christopherson Date: Tue Jul 13 09:33:22 2021 -0700 KVM: SVM: Emulate #INIT in response to triple fault shutdown Emulate a full #INIT instead of simply initializing the VMCB if the guest hits a shutdown. Initializing the VMCB but not other vCPU state, much of which is mirrored by the VMCB, results in incoherent and broken vCPU state. Ideally, KVM would not automatically init anything on shutdown, and instead put the vCPU into e.g. KVM_MP_STATE_UNINITIALIZED and force userspace to explicitly INIT or RESET the vCPU. Even better would be to add KVM_MP_STATE_SHUTDOWN, since technically NMI can break shutdown (and SMI on Intel CPUs). But, that ship has sailed, and emulating #INIT is the next best thing as that has at least some connection with reality since there exist bare metal platforms that automatically INIT the CPU if it hits shutdown. Fixes: 46fe4ddd9dbb ("[PATCH] KVM: SVM: Propagate cpu shutdown events to userspace") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-45-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e54949408abfbe3905ae19ac3b42ecd2d29bc3c5 Author: Sean Christopherson Date: Tue Jul 13 09:33:21 2021 -0700 KVM: VMX: Move RESET-only VMWRITE sequences to init_vmcs() Move VMWRITE sequences in vmx_vcpu_reset() guarded by !init_event into init_vmcs() to make it more obvious that they're, uh, initializing the VMCS. No meaningful functional change intended (though the order of VMWRITEs and whatnot is different). Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-44-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 7aa13fc3d8260c4215b8aea971d120e675d8781f Author: Sean Christopherson Date: Tue Jul 13 09:33:20 2021 -0700 KVM: VMX: Remove redundant write to set vCPU as active at RESET/INIT Drop a call to vmx_clear_hlt() during vCPU INIT, the guest's activity state is unconditionally set to "active" a few lines earlier in vmx_vcpu_reset(). No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-43-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 84ec8d2d539f7286d4504c2d377002f1ea7458d6 Author: Sean Christopherson Date: Tue Jul 13 09:33:19 2021 -0700 KVM: VMX: Smush x2APIC MSR bitmap adjustments into single function Consolidate all of the dynamic MSR bitmap adjustments into vmx_update_msr_bitmap_x2apic(), and rename the mode tracker to reflect that it is x2APIC specific. If KVM gains more cases of dynamic MSR pass-through, odds are very good that those new cases will be better off with their own logic, e.g. see Intel PT MSRs and MSR_IA32_SPEC_CTRL. Attempting to handle all updates in a common helper did more harm than good, as KVM ended up collecting a large number of useless "updates". Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-42-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e7c701dd7a5019c8628007c91c0e8d804c194667 Author: Sean Christopherson Date: Tue Jul 13 09:33:18 2021 -0700 KVM: VMX: Remove unnecessary initialization of msr_bitmap_mode Don't bother initializing msr_bitmap_mode to 0, all of struct vcpu_vmx is zero initialized. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-41-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 002f87a41e9a6ef795f7f493f9434f51fb9f7d35 Author: Sean Christopherson Date: Tue Jul 13 09:33:17 2021 -0700 KVM: VMX: Don't redo x2APIC MSR bitmaps when userspace filter is changed Drop an explicit call to update the x2APIC MSRs when the userspace MSR filter is modified. The x2APIC MSRs are deliberately exempt from userspace filtering. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-40-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 284036c644a1dc71890503c849b22c3126308067 Author: Sean Christopherson Date: Tue Jul 13 09:33:16 2021 -0700 KVM: nVMX: Remove obsolete MSR bitmap refresh at nested transitions Drop unnecessary MSR bitmap updates during nested transitions, as L1's APIC_BASE MSR is not modified by the standard VM-Enter/VM-Exit flows, and L2's MSR bitmap is managed separately. In the unlikely event that L1 is pathological and loads APIC_BASE via the VM-Exit load list, KVM will handle updating the bitmap in its normal WRMSR flows. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-39-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 9e4784e19daaa5cd637753d5300fc5a42d0c694a Author: Sean Christopherson Date: Tue Jul 13 09:33:15 2021 -0700 KVM: VMX: Remove obsolete MSR bitmap refresh at vCPU RESET/INIT Remove an unnecessary MSR bitmap refresh during vCPU RESET/INIT. In both cases, the MSR bitmap already has the desired values and state. At RESET, the vCPU is guaranteed to be running with x2APIC disabled, the x2APIC MSRs are guaranteed to be intercepted due to the MSR bitmap being initialized to all ones by alloc_loaded_vmcs(), and vmx->msr_bitmap_mode is guaranteed to be zero, i.e. reflecting x2APIC disabled. At INIT, the APIC_BASE MSR is not modified, thus there can't be any change in x2APIC state. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-38-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f39e805ee115a67878c5475f1ef84466d424bb2e Author: Sean Christopherson Date: Tue Jul 13 09:33:14 2021 -0700 KVM: x86: Move setting of sregs during vCPU RESET/INIT to common x86 Move the setting of CR0, CR4, EFER, RFLAGS, and RIP from vendor code to common x86. VMX and SVM now have near-identical sequences, the only difference being that VMX updates the exception bitmap. Updating the bitmap on SVM is unnecessary, but benign. Unfortunately it can't be left behind in VMX due to the need to update exception intercepts after the control registers are set. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-37-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c5c9f920f7a50ea205c9efec7e589556ebaf85dc Author: Sean Christopherson Date: Tue Jul 13 09:33:13 2021 -0700 KVM: VMX: Don't _explicitly_ reconfigure user return MSRs on vCPU INIT When emulating vCPU INIT, do not unconditionally refresh the list of user return MSRs that need to be loaded into hardware when running the guest. Unconditionally refreshing the list is confusing, as the vast majority of MSRs are not modified on INIT. The real motivation is to handle the case where an INIT during long mode obviates the need to load the SYSCALL MSRs, and that is handled as needed by vmx_set_efer(). Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-36-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 432979b5034208890e323e86724417f02825abb7 Author: Sean Christopherson Date: Tue Jul 13 09:33:12 2021 -0700 KVM: VMX: Refresh list of user return MSRs after setting guest CPUID After a CPUID update, refresh the list of user return MSRs that are loaded into hardware when running the vCPU. This is necessary to handle the oddball case where userspace exposes X86_FEATURE_RDTSCP to the guest after the vCPU is running. Fixes: 0023ef39dc35 ("kvm: vmx: Set IA32_TSC_AUX for legacy mode guests") Fixes: 4e47c7a6d714 ("KVM: VMX: Add instruction rdtscp support for guest") Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-35-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 400dd54b37172b64e4ceaa6bfaf2729585840375 Author: Sean Christopherson Date: Tue Jul 13 09:33:11 2021 -0700 KVM: VMX: Skip pointless MSR bitmap update when setting EFER Split setup_msrs() into vmx_setup_uret_msrs() and an open coded refresh of the MSR bitmap, and skip the latter when refreshing the user return MSRs during an EFER load. Only the x2APIC MSRs are dynamically exposed and hidden, and those are not affected by a change in EFER. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-34-seanjc@google.com> Signed-off-by: Paolo Bonzini commit d0f9f826d8ac06446391ceb3d4a440f5b48b3134 Author: Sean Christopherson Date: Tue Jul 13 09:33:10 2021 -0700 KVM: SVM: Stuff save->dr6 at during VMSA sync, not at RESET/INIT Move code to stuff vmcb->save.dr6 to its architectural init value from svm_vcpu_reset() into sev_es_sync_vmsa(). Except for protected guests, a.k.a. SEV-ES guests, vmcb->save.dr6 is set during VM-Enter, i.e. the extra write is unnecessary. For SEV-ES, stuffing save->dr6 handles a theoretical case where the VMSA could be encrypted before the first KVM_RUN. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-33-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 6cfe7b83acdcdd4d4ea9354f007a88bc0ccb16b9 Author: Sean Christopherson Date: Tue Jul 13 09:33:09 2021 -0700 KVM: SVM: Drop redundant writes to vmcb->save.cr4 at RESET/INIT Drop direct writes to vmcb->save.cr4 during vCPU RESET/INIT, as the values being written are fully redundant with respect to svm_set_cr4(vcpu, 0) a few lines earlier. Note, svm_set_cr4() also correctly forces X86_CR4_PAE when NPT is disabled. No functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-32-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ef8a0fa59be78e7b80bdf35c3391d60c061c7b24 Author: Sean Christopherson Date: Tue Jul 13 09:33:08 2021 -0700 KVM: SVM: Tweak order of cr0/cr4/efer writes at RESET/INIT Hoist svm_set_cr0() up in the sequence of register initialization during vCPU RESET/INIT, purely to match VMX so that a future patch can move the sequences to common x86. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-31-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 816be9e9be8d2e19dcea35fbec06f00cd5749fed Author: Sean Christopherson Date: Tue Jul 13 09:33:07 2021 -0700 KVM: nVMX: Don't evaluate "emulation required" on nested VM-Exit Use the "internal" variants of setting segment registers when stuffing state on nested VM-Exit in order to skip the "emulation required" updates. VM-Exit must always go to protected mode, and all segments are mostly hardcoded (to valid values) on VM-Exit. The bits of the segments that aren't hardcoded are explicitly checked during VM-Enter, e.g. the selector RPLs must all be zero. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-30-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1dd7a4f18fbcc0db1acc07df5c1ae8ba4ce10593 Author: Sean Christopherson Date: Tue Jul 13 09:33:06 2021 -0700 KVM: VMX: Skip emulation required checks during pmode/rmode transitions Don't refresh "emulation required" when stuffing segments during transitions to/from real mode when running without unrestricted guest. The checks are unnecessary as vmx_set_cr0() unconditionally rechecks "emulation required". They also happen to be broken, as enter_pmode() and enter_rmode() run with a stale vcpu->arch.cr0. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-29-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 32437c2aea428f9c3479904e342b02f5eee3a7f6 Author: Sean Christopherson Date: Tue Jul 13 09:33:05 2021 -0700 KVM: VMX: Process CR0.PG side effects after setting CR0 assets Move the long mode and EPT w/o unrestricted guest side effect processing down in vmx_set_cr0() so that the EPT && !URG case doesn't have to stuff vcpu->arch.cr0 early. This also fixes an oddity where CR0 might not be marked available, i.e. the early vcpu->arch.cr0 write would appear to be in danger of being overwritten, though that can't actually happen in the current code since CR0.TS is the only guest-owned bit, and CR0.TS is not read by vmx_set_cr4(). Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-28-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 908b7d43c02c5f1f95beff66ce4ca30dfc3b134c Author: Sean Christopherson Date: Tue Jul 13 09:33:04 2021 -0700 KVM: x86/mmu: Skip the permission_fault() check on MMIO if CR0.PG=0 Skip the MMU permission_fault() check if paging is disabled when verifying the cached MMIO GVA is usable. The check is unnecessary and can theoretically get a false positive since the MMU doesn't zero out "permissions" or "pkru_mask" when guest paging is disabled. The obvious alternative is to zero out all the bitmasks when configuring nonpaging MMUs, but that's unnecessary work and doesn't align with the MMU's general approach of doing as little as possible for flows that are supposed to be unreachable. This is nearly a nop as the false positive is nothing more than an insignificant performance blip, and more or less limited to string MMIO when L1 is running with paging disabled. KVM doesn't cache MMIO if L2 is active with nested TDP since the "GVA" is really an L2 GPA. If L2 is active without nested TDP, then paging can't be disabled as neither VMX nor SVM allows entering the guest without paging of some form. Jumping back to L1 with paging disabled, in that case direct_map is true and so KVM will use CR2 as a GPA; the only time it doesn't is if the fault from the emulator doesn't match or emulator_can_use_gpa(), and that fails only on string MMIO and other instructions with multiple memory operands. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-27-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 81ca0e7340eedcbe67911d97f292837e0cf39709 Author: Sean Christopherson Date: Tue Jul 13 09:33:03 2021 -0700 KVM: VMX: Pull GUEST_CR3 from the VMCS iff CR3 load exiting is disabled Tweak the logic for grabbing vmcs.GUEST_CR3 in vmx_cache_reg() to look directly at the execution controls, as opposed to effectively inferring the controls based on vCPUs. Inferring the controls isn't wrong, but it creates a very subtle dependency between the caching logic, the state of vcpu->arch.cr0 (via is_paging()), and the behavior of vmx_set_cr0(). Using the execution controls doesn't completely eliminate the dependency in vmx_set_cr0(), e.g. neglecting to cache CR3 before enabling interception would still break the guest, but it does reduce the code dependency and mostly eliminate the logical dependency (that CR3 loads are intercepted in certain scenarios). Eliminating the subtle read of vcpu->arch.cr0 will also allow for additional cleanup in vmx_set_cr0(). Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-26-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 470750b3425513b9f63f176e564e63e0e7998afc Author: Sean Christopherson Date: Tue Jul 13 09:33:02 2021 -0700 KVM: nVMX: Do not clear CR3 load/store exiting bits if L1 wants 'em Keep CR3 load/store exiting enable as needed when running L2 in order to honor L1's desires. This fixes a largely theoretical bug where L1 could intercept CR3 but not CR0.PG and end up not getting the desired CR3 exits when L2 enables paging. In other words, the existing !is_paging() check inadvertantly handles the normal case for L2 where vmx_set_cr0() is called during VM-Enter, which is guaranteed to run with paging enabled, and thus will never clear the bits. Removing the !is_paging() check will also allow future consolidation and cleanup of the related code. From a performance perspective, this is all a nop, as the VMCS controls shadow will optimize away the VMWRITE when the controls are in the desired state. Add a comment explaining why CR3 is intercepted, with a big disclaimer about not querying the old CR3. Because vmx_set_cr0() is used for flows that are not directly tied to MOV CR3, e.g. vCPU RESET/INIT and nested VM-Enter, it's possible that is_paging() is not synchronized with CR3 load/store exiting. This is actually guaranteed in the current code, as KVM starts with CR3 interception disabled. Obviously that can be fixed, but there's no good reason to play whack-a-mole, and it tends to end poorly, e.g. descriptor table exiting for UMIP emulation attempted to be precise in the past and ended up botching the interception toggling. Fixes: fe3ef05c7572 ("KVM: nVMX: Prepare vmcs02 from vmcs01 and vmcs12") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-25-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c834fd7fc1308a0e0429d203a6c3af528cd902fa Author: Sean Christopherson Date: Tue Jul 13 09:33:01 2021 -0700 KVM: VMX: Fold ept_update_paging_mode_cr0() back into vmx_set_cr0() Move the CR0/CR3/CR4 shenanigans for EPT without unrestricted guest back into vmx_set_cr0(). This will allow a future patch to eliminate the rather gross stuffing of vcpu->arch.cr0 in the paging transition cases by snapshotting the old CR0. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-24-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4f0dcb544038e016277fb691f1e60d52d7448cf6 Author: Sean Christopherson Date: Tue Jul 13 09:33:00 2021 -0700 KVM: VMX: Remove direct write to vcpu->arch.cr0 during vCPU RESET/INIT Remove a bogus write to vcpu->arch.cr0 that immediately precedes vmx_set_cr0() during vCPU RESET/INIT. For RESET, this is a nop since the "old" CR0 value is meaningless. But for INIT, if the vCPU is coming from paging enabled mode, crushing vcpu->arch.cr0 will cause the various is_paging() checks in vmx_set_cr0() to get false negatives. For the exit_lmode() case, the false negative is benign as vmx_set_efer() is called immediately after vmx_set_cr0(). For EPT without unrestricted guest, the false negative will cause KVM to unnecessarily run with CR3 load/store exiting. But again, this is benign, albeit sub-optimal. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-23-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ee5a5584cba316bc90bc2fad0c6d10b71f1791cb Author: Sean Christopherson Date: Tue Jul 13 09:32:59 2021 -0700 KVM: VMX: Invert handling of CR0.WP for EPT without unrestricted guest Opt-in to forcing CR0.WP=1 for shadow paging, and stop lying about WP being "always on" for unrestricted guest. In addition to making KVM a wee bit more honest, this paves the way for additional cleanup. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-22-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 9e90e215d9c9f013cc354c4fe1a1313531a97a05 Author: Sean Christopherson Date: Tue Jul 13 09:32:58 2021 -0700 KVM: SVM: Don't bother writing vmcb->save.rip at vCPU RESET/INIT Drop unnecessary initialization of vmcb->save.rip during vCPU RESET/INIT, as svm_vcpu_run() unconditionally propagates VCPU_REGS_RIP to save.rip. No true functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-21-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 49d8665cc20b973995b5f519222d3270daa82f3f Author: Sean Christopherson Date: Tue Jul 13 09:32:57 2021 -0700 KVM: x86: Move EDX initialization at vCPU RESET to common code Move the EDX initialization at vCPU RESET, which is now identical between VMX and SVM, into common code. No functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-20-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4547700a4d190ac419abffa317069aaccf1ac118 Author: Sean Christopherson Date: Tue Jul 13 09:32:56 2021 -0700 KVM: x86: Consolidate APIC base RESET initialization code Consolidate the APIC base RESET logic, which is currently spread out across both x86 and vendor code. For an in-kernel APIC, the vendor code is redundant. But for a userspace APIC, KVM relies on the vendor code to initialize vcpu->arch.apic_base. Hoist the vcpu->arch.apic_base initialization above the !apic check so that it applies to both flavors of APIC emulation, and delete the vendor code. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-19-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 421221234ada41b4a9f0beeb08e30b07388bd4bd Author: Sean Christopherson Date: Tue Jul 13 09:32:55 2021 -0700 KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET Stuff vcpu->arch.apic_base and apic->base_address directly during APIC reset, as opposed to bouncing through kvm_set_apic_base() while fudging the ENABLE bit during creation to avoid the other, unwanted side effects. This is a step towards consolidating the APIC RESET logic across x86, VMX, and SVM. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-18-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f0428b3dcb2d7efe4b2a2304841645b48f0b6499 Author: Sean Christopherson Date: Tue Jul 13 09:32:54 2021 -0700 KVM: VMX: Stuff vcpu->arch.apic_base directly at vCPU RESET Write vcpu->arch.apic_base directly instead of bouncing through kvm_set_apic_base(). This is a glorified nop, and is a step towards cleaning up the mess that is local APIC creation. When using an in-kernel APIC, kvm_create_lapic() explicitly sets vcpu->arch.apic_base to MSR_IA32_APICBASE_ENABLE to avoid its own kvm_lapic_set_base() call in kvm_lapic_reset() from triggering state changes. That call during RESET exists purely to set apic->base_address to the default base value. As a result, by the time VMX gets control, the only missing piece is the BSP bit being set for the reset BSP. For a userspace APIC, there are no side effects to process (for the APIC). In both cases, the call to kvm_update_cpuid_runtime() is a nop because the vCPU hasn't yet been exposed to userspace, i.e. there can't be any CPUID entries. No functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-17-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 503bc49424df4802ca34e4e1a024381fd7ced80e Author: Sean Christopherson Date: Tue Jul 13 09:32:53 2021 -0700 KVM: x86: Set BSP bit in reset BSP vCPU's APIC base by default Set the BSP bit appropriately during local APIC "reset" instead of relying on vendor code to clean up at a later point. This is a step towards consolidating the local APIC, VMX, and SVM xAPIC initialization code. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-16-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 01913c57c225a8301e9a53447507f310a4be22b6 Author: Sean Christopherson Date: Tue Jul 13 09:32:52 2021 -0700 KVM: x86: Don't force set BSP bit when local APIC is managed by userspace Don't set the BSP bit in vcpu->arch.apic_base when the local APIC is managed by userspace. Forcing all vCPUs to be BSPs is non-sensical, and was dead code when it was added by commit 97222cc83163 ("KVM: Emulate local APIC in kernel"). At the time, kvm_lapic_set_base() was invoked if and only if the local APIC was in-kernel (and it couldn't be called before the vCPU created its APIC). kvm_lapic_set_base() eventually gained generic usage, but the latent bug escaped notice because the only true consumer would be the guest itself in the form of an explicit RDMSRs on APs. Out of Linux, SeaBIOS, and EDK2/OVMF, only OVMF consumes the BSP bit from the APIC_BASE MSR. For the vast majority of usage in OVMF, BSP confusion would be benign. OVMF's BSP election upon SMI rendezvous might be broken, but practically no one runs KVM with an out-of-kernel local APIC, let alone does so while utilizing SMIs with OVMF. Fixes: 97222cc83163 ("KVM: Emulate local APIC in kernel") Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-15-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 0214f6bbe564632adba299e38023d681c1bd68c5 Author: Sean Christopherson Date: Tue Jul 13 09:32:51 2021 -0700 KVM: x86: Migrate the PIT only if vcpu0 is migrated, not any BSP Make vcpu0 the arbitrary owner of the PIT, as was intended when PIT migration was added by commit 2f5997140f22 ("KVM: migrate PIT timer"). The PIT was unintentionally turned into being owned by the BSP by commit c5af89b68abb ("KVM: Introduce kvm_vcpu_is_bsp() function."), and was then unintentionally converted to a shared ownership model when kvm_vcpu_is_bsp() was modified to check the APIC base MSR instead of hardcoding vcpu0 as the BSP. Functionally, this just means the PIT's hrtimer is migrated less often. The real motivation is to remove the usage of kvm_vcpu_is_bsp(), so that more legacy/broken crud can be removed in a future patch. Fixes: 58d269d8cccc ("KVM: x86: BSP in MSR_IA32_APICBASE is writable") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-14-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 549240e8e09e063b7ba44c9f8497e8499562a34c Author: Sean Christopherson Date: Tue Jul 13 09:32:50 2021 -0700 KVM: x86: Remove defunct BSP "update" in local APIC reset Remove a BSP APIC update in kvm_lapic_reset() that is a glorified and confusing nop. When the code was originally added, kvm_vcpu_is_bsp() queried kvm->arch.bsp_vcpu, i.e. the intent was to set the BSP bit in the BSP vCPU's APIC. But, stuffing the BSP bit at INIT was wrong since the guest can change its BSP(s); this was fixed by commit 58d269d8cccc ("KVM: x86: BSP in MSR_IA32_APICBASE is writable"). In other words, kvm_vcpu_is_bsp() is now purely a reflection of vcpu->arch.apic_base.MSR_IA32_APICBASE_BSP, thus the update will always set the current value and kvm_lapic_set_base() is effectively a nop if the new and old values match. The RESET case, which does need to stuff the BSP for the reset vCPU, is handled by vendor code (though this will soon be moved to common code). No functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-13-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c2f79a65b4b66681894ef7d7e3912ba55acc20d5 Author: Sean Christopherson Date: Tue Jul 13 09:32:49 2021 -0700 KVM: x86: WARN if the APIC map is dirty without an in-kernel local APIC WARN if KVM ends up in a state where it thinks its APIC map needs to be recalculated, but KVM is not emulating the local APIC. This is mostly to document KVM's "rules" in order to provide clarity in future cleanups. Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-12-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5d2d7e41e3b80f37ec8673825fae07ffe9f140c3 Author: Sean Christopherson Date: Tue Jul 13 09:32:46 2021 -0700 KVM: SVM: Drop explicit MMU reset at RESET/INIT Drop an explicit MMU reset in SVM's vCPU RESET/INIT flow now that the common x86 path correctly handles conditional MMU resets, e.g. if INIT arrives while the vCPU is in 64-bit mode. This reverts commit ebae871a509d ("kvm: svm: reset mmu on VCPU reset"). Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 61152cd907d59ffd6b0a9479b2fa3b3b7b080409 Author: Sean Christopherson Date: Tue Jul 13 09:32:45 2021 -0700 KVM: VMX: Remove explicit MMU reset in enter_rmode() Drop an explicit MMU reset when entering emulated real mode now that the vCPU INIT/RESET path correctly handles conditional MMU resets, e.g. if INIT arrives while the vCPU is in 64-bit mode. Note, while there are multiple other direct calls to vmx_set_cr0(), i.e. paths that change CR0 without invoking kvm_post_set_cr0(), only the INIT emulation can reach enter_rmode(). CLTS emulation only toggles CR.TS, VM-Exit (and late VM-Fail) emulation cannot architecturally transition to Real Mode, and VM-Enter to Real Mode is possible if and only if Unrestricted Guest is enabled (exposed to L1). This effectively reverts commit 8668a3c468ed ("KVM: VMX: Reset mmu context when entering real mode") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 665f4d9238ad83c36dd4e078ccab45b3ddec211d Author: Sean Christopherson Date: Tue Jul 13 09:32:44 2021 -0700 KVM: SVM: Fall back to KVM's hardcoded value for EDX at RESET/INIT At vCPU RESET/INIT (mostly RESET), stuff EDX with KVM's hardcoded, default Family-Model-Stepping ID of 0x600 if CPUID.0x1 isn't defined. At RESET, the CPUID lookup is guaranteed to "miss" because KVM emulates RESET before exposing the vCPU to userspace, i.e. userspace can't possibly have done set the vCPU's CPUID model, and thus KVM will always write '0'. At INIT, using 0x600 is less bad than using '0'. While initializing EDX to '0' is _extremely_ unlikely to be noticed by the guest, let alone break the guest, and can be overridden by userspace for the RESET case, using 0x600 is preferable as it will allow consolidating the relevant VMX and SVM RESET/INIT logic in the future. And, digging through old specs suggests that neither Intel nor AMD have ever shipped a CPU that initialized EDX to '0' at RESET. Regarding 0x600 as KVM's default Family, it is a sane default and in many ways the most appropriate. Prior to the 386 implementations, DX was undefined at RESET. With the 386, 486, 586/P5, and 686/P6/Athlon, both Intel and AMD set EDX to 3, 4, 5, and 6 respectively. AMD switched to using '15' as its primary Family with the introduction of AMD64, but Intel has continued using '6' for the last few decades. So, '6' is a valid Family for both Intel and AMD CPUs, is compatible with both 32-bit and 64-bit CPUs (albeit not a perfect fit for 64-bit AMD), and of the common Families (3 - 6), is the best fit with respect to KVM's virtual CPU model. E.g. prior to the P6, Intel CPUs did not have a STI window. Modern operating systems, Linux included, rely on the STI window, e.g. for "safe halt", and KVM unconditionally assumes the virtual CPU has an STI window. Thus enumerating a Family ID of 3, 4, or 5 would be provably wrong. Opportunistically remove a stale comment. Fixes: 66f7b72e1171 ("KVM: x86: Make register state after reset conform to specification") Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 067a456d091d05fdae32cae350410d905968b645 Author: Sean Christopherson Date: Tue Jul 13 09:32:43 2021 -0700 KVM: SVM: Require exact CPUID.0x1 match when stuffing EDX at INIT Do not allow an inexact CPUID "match" when querying the guest's CPUID.0x1 to stuff EDX during INIT. In the common case, where the guest CPU model is an AMD variant, allowing an inexact match is a nop since KVM doesn't emulate Intel's goofy "out-of-range" logic for AMD and Hygon. If the vCPU model happens to be an Intel variant, an inexact match is possible if and only if the max CPUID leaf is precisely '0'. Aside from the fact that there's probably no CPU in existence with a single CPUID leaf, if the max CPUID leaf is '0', that means that CPUID.0.EAX is '0', and thus an inexact match for CPUID.0x1.EAX will also yield '0'. So, with lots of twisty logic, no functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 2a24be79b6b7061a486239c3a3489eb67b9587f6 Author: Sean Christopherson Date: Tue Jul 13 09:32:42 2021 -0700 KVM: VMX: Set EDX at INIT with CPUID.0x1, Family-Model-Stepping Set EDX at RESET/INIT based on the userspace-defined CPUID model when possible, i.e. when CPUID.0x1.EAX is defind by userspace. At RESET/INIT, all CPUs that support CPUID set EDX to the FMS enumerated in CPUID.0x1.EAX. If no CPUID match is found, fall back to KVM's default of 0x600 (Family '6'), which is the least awful approximation of KVM's virtual CPU model. Fixes: 6aa8b732ca01 ("[PATCH] kvm: userspace interface") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4f117ce4aefca0e90cd44680219d4c261c1381b9 Author: Sean Christopherson Date: Tue Jul 13 09:32:41 2021 -0700 KVM: SVM: Zero out GDTR.base and IDTR.base on INIT Explicitly set GDTR.base and IDTR.base to zero when intializing the VMCB. Functionally this only affects INIT, as the bases are implicitly set to zero on RESET by virtue of the VMCB being zero allocated. Per AMD's APM, GDTR.base and IDTR.base are zeroed after RESET and INIT. Fixes: 04d2cc7780d4 ("KVM: Move main vcpu loop into subarch independent code") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit afc8de0118be84f4058b9977d481aeb3e0758dbb Author: Sean Christopherson Date: Tue Jul 13 09:32:40 2021 -0700 KVM: nVMX: Set LDTR to its architecturally defined value on nested VM-Exit Set L1's LDTR on VM-Exit per the Intel SDM: The host-state area does not contain a selector field for LDTR. LDTR is established as follows on all VM exits: the selector is cleared to 0000H, the segment is marked unusable and is otherwise undefined (although the base address is always canonical). This is likely a benign bug since the LDTR is unusable, as it means the L1 VMM is conditioned to reload its LDTR in order to function properly on bare metal. Fixes: 4704d0befb07 ("KVM: nVMX: Exiting from L2 to L1") Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit df37ed38e6c26064d5f97ebbe5cacc75eeb89153 Author: Sean Christopherson Date: Tue Jul 13 09:32:39 2021 -0700 KVM: x86: Flush the guest's TLB on INIT Flush the guest's TLB on INIT, as required by Intel's SDM. Although AMD's APM states that the TLBs are unchanged by INIT, it's not clear that that's correct as the APM also states that the TLB is flush on "External initialization of the processor." Regardless, relying on the guest to be paranoid is unnecessarily risky, while an unnecessary flush is benign from a functional perspective and likely has no measurable impact on guest performance. Note, as of the April 2021 version of Intels' SDM, it also contradicts itself with respect to TLB flushing. The overview of INIT explicitly calls out the TLBs as being invalidated, while a table later in the same section says they are unchanged. 9.1 INITIALIZATION OVERVIEW: The major difference is that during an INIT, the internal caches, MSRs, MTRRs, and x87 FPU state are left unchanged (although, the TLBs and BTB are invalidated as with a hardware reset) Table 9-1: Register Power up Reset INIT Data and Code Cache, TLBs: Invalid[6] Invalid[6] Unchanged Given Core2's erratum[*] about global TLB entries not being flush on INIT, it's safe to assume that the table is simply wrong. AZ28. INIT Does Not Clear Global Entries in the TLB Problem: INIT may not flush a TLB entry when: • The processor is in protected mode with paging enabled and the page global enable flag is set (PGE bit of CR4 register) • G bit for the page table entry is set • TLB entry is present in TLB when INIT occurs • Software may encounter unexpected page fault or incorrect address translation due to a TLB entry erroneously left in TLB after INIT. Workaround: Write to CR3, CR4 (setting bits PSE, PGE or PAE) or CR0 (setting bits PG or PE) registers before writing to memory early in BIOS code to clear all the global entries from TLB. Status: For the steppings affected, see the Summary Tables of Changes. [*] https://www.intel.com/content/dam/support/us/en/documents/processors/mobile/celeron/sb/320121.pdf Fixes: 6aa8b732ca01 ("[PATCH] kvm: userspace interface") Signed-off-by: Sean Christopherson Message-Id: <20210713163324.627647-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit df63202fe52bd1583ce1418c755a81d6d41af3b9 Author: Maxim Levitsky Date: Tue Jul 13 17:20:19 2021 +0300 KVM: x86: APICv: drop immediate APICv disablement on current vCPU Special case of disabling the APICv on the current vCPU right away in kvm_request_apicv_update doesn't bring much benefit vs raising KVM_REQ_APICV_UPDATE on it instead, since this request will be processed on the next entry to the guest. (the comment about having another #VMEXIT is wrong). It also hides various assumptions that APIVc enable state matches the APICv inhibit state, as this special case only makes those states match on the current vCPU. Previous patches fixed few such assumptions so now it should be safe to drop this special case. Signed-off-by: Maxim Levitsky Message-Id: <20210713142023.106183-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 71ba3f3189c78f756a659568fb473600fd78f207 Author: Paolo Bonzini Date: Mon Jul 26 12:30:52 2021 -0400 KVM: x86: enable TDP MMU by default With the addition of fast page fault support, the TDP-specific MMU has reached feature parity with the original MMU. All my testing in the last few months has been done with the TDP MMU; switch the default on 64-bit machines. Signed-off-by: Paolo Bonzini commit 6e8eb2060cc7fbc4d388d0ab70502e265aec98c6 Author: David Matlack Date: Tue Jul 13 22:09:55 2021 +0000 KVM: x86/mmu: fast_page_fault support for the TDP MMU Make fast_page_fault interoperate with the TDP MMU by leveraging walk_shadow_page_lockless_{begin,end} to acquire the RCU read lock and introducing a new helper function kvm_tdp_mmu_fast_pf_get_last_sptep to grab the lowest level sptep. Suggested-by: Ben Gardon Signed-off-by: David Matlack Message-Id: <20210713220957.3493520-5-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit c5c8c7c53004cb70715320018c3b4287071c1cfd Author: David Matlack Date: Tue Jul 13 22:09:54 2021 +0000 KVM: x86/mmu: Make walk_shadow_page_lockless_{begin,end} interoperate with the TDP MMU Acquire the RCU read lock in walk_shadow_page_lockless_begin and release it in walk_shadow_page_lockless_end when the TDP MMU is enabled. This should not introduce any functional changes but is used in the following commit to make fast_page_fault interoperate with the TDP MMU. Signed-off-by: David Matlack Message-Id: <20210713220957.3493520-4-dmatlack@google.com> [Use if...else instead of if(){return;}] Signed-off-by: Paolo Bonzini commit 61bcd360aa9851cec969b7b40f23fd1faa7f85a4 Author: David Matlack Date: Tue Jul 13 22:09:53 2021 +0000 KVM: x86/mmu: Fix use of enums in trace_fast_page_fault Enum values have to be exported to userspace since the formatting is not done in the kernel. Without doing this perf maps RET_PF_FIXED and RET_PF_SPURIOUS to 0, which results in incorrect output: $ perf record -a -e kvmmmu:fast_page_fault --filter "ret==3" -- ./access_tracking_perf_test $ perf script | head -1 [...] new 610006048d25877 spurious 0 fixed 0 <------ should be 1 Fix this by exporting the enum values to userspace with TRACE_DEFINE_ENUM. Fixes: c4371c2a682e ("KVM: x86/mmu: Return unique RET_PF_* values if the fault was fixed") Signed-off-by: David Matlack Message-Id: <20210713220957.3493520-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 76cd325ea75bb2a84c329782d7b8015b6a970c34 Author: David Matlack Date: Tue Jul 13 22:09:52 2021 +0000 KVM: x86/mmu: Rename cr2_or_gpa to gpa in fast_page_fault fast_page_fault is only called from direct_page_fault where we know the address is a gpa. Fixes: 736c291c9f36 ("KVM: x86: Use gpa_t for cr2/gpa to fix TDP support on 32-bit KVM") Reviewed-by: Ben Gardon Reviewed-by: Sean Christopherson Signed-off-by: David Matlack Message-Id: <20210713220957.3493520-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 605c713023e3925d0444f495a42c903cb6ce875f Author: Peter Xu Date: Fri Jun 25 11:32:07 2021 -0400 KVM: Introduce kvm_get_kvm_safe() Introduce this safe version of kvm_get_kvm() so that it can be called even during vm destruction. Use it in kvm_debugfs_open() and remove the verbose comment. Prepare to be used elsewhere. Signed-off-by: Peter Xu Message-Id: <20210625153214.43106-3-peterx@redhat.com> [Preserve the comment in kvm_debugfs_open. - Paolo] Signed-off-by: Paolo Bonzini commit 1694caef426247bb406c2b04672336ef77b5fb87 Author: Juergen Gross Date: Thu Jul 1 17:41:01 2021 +0200 x86/kvm: remove non-x86 stuff from arch/x86/kvm/ioapic.h The file has been moved to arch/x86 long time ago. Time to get rid of non-x86 stuff. Signed-off-by: Juergen Gross Message-Id: <20210701154105.23215-3-jgross@suse.com> Signed-off-by: Paolo Bonzini commit 1d65b90847219e4101dc09ecc1c8178b1d2331b8 Merge: a270be1b3fdfb 75cc1018a9e1e Author: Joerg Roedel Date: Mon Aug 2 17:00:28 2021 +0200 Merge remote-tracking branch 'korg/core' into x86/amd commit 9eec3f9b9e243b554b5804bbdb58ea61068adbda Author: Xiang Chen Date: Sat Jul 31 10:17:11 2021 +0800 iommu/arm-smmu-v3: Implement the map_pages() IOMMU driver callback Implement the map_pages() callback for ARM SMMUV3 driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also remove the map() callback for the ARM SMMUV3 driver as it will no longer be used. Signed-off-by: Xiang Chen Acked-by: Will Deacon Link: https://lore.kernel.org/r/1627697831-158822-3-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Joerg Roedel commit 59103c79f46ab49453270ec9165cfdb38422088f Author: Xiang Chen Date: Sat Jul 31 10:17:10 2021 +0800 iommu/arm-smmu-v3: Implement the unmap_pages() IOMMU driver callback Implement the unmap_pages() callback for ARM SMMUV3 driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Also remove the unmap() callback for the ARM SMMUV3 driver as it will no longer be used. Signed-off-by: Xiang Chen Acked-by: Will Deacon Link: https://lore.kernel.org/r/1627697831-158822-2-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Joerg Roedel commit ea9df9840fd5d766b9e98b0073890de4be68b062 Author: Colin Ian King Date: Sun Aug 1 07:48:07 2021 +0100 ASoC: tlv320aic32x4: make array clocks static, makes object smaller Don't populate the array clocks on the stack but instead it static. Makes the object code smaller by 316 bytes. Before: text data bss dec hex filename 63668 28264 0 91932 1671c ./sound/soc/codecs/tlv320aic32x4.o After: text data bss dec hex filename 62616 29000 0 91616 165e0 ./sound/soc/codecs/tlv320aic32x4.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801064807.138641-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 780feaf4ad8848e48aa679c0fb9d98d45f691e4e Author: Hans de Goede Date: Mon Aug 2 16:25:01 2021 +0200 ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 quirk The HP Elitepad 1000 G2 has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec, combined with an external HP-amp + IN1 for the headset-mic. Fix the HP ElitePad 1000 G2 to properly reflect this now that the machine-driver supports this setup. Note this also changes the mapping for the internal mic. from IN1 (which was pointing to the 2nd headset-jack mic) to DMIC2 which is the actual input for the internal mics. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415 Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-7-hdegoede@redhat.com Signed-off-by: Mark Brown commit 79c1123bac3b878874a8d7163f2eab6a7448733b Author: Hans de Goede Date: Mon Aug 2 16:25:00 2021 +0200 ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input Some devices (HP Elitepad 1000 G2) have 2 headset jacks (1 on the dock, 2nd on the tablet itself). The 2nd headset mic input on these is connected to in1 (the internal mics on the HP Elitepad 1000 G2 use DMIC2). Add support for this through a new BYT_RT5640_HSMIC2_ON_IN1 quirk. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-6-hdegoede@redhat.com Signed-off-by: Mark Brown commit 044c76571277bb87dd3318e55c7ae46a0c27ab0f Author: Hans de Goede Date: Mon Aug 2 16:24:59 2021 +0200 ASoC: Intel: bytcr_rt5640: Add support for a second headphones output Some devices (HP Elitepad 1000 G2) have a second headphones output (1 on the dock, 2nd on the tablet itself) which is implemented through the line-out output of the codec combined with an external hp-amp which gets enabled through the codec's GPIO1 pin. Add support for this through a new BYT_RT5640_LINEOUT_AS_HP2 quirk, note users are expected to use this combined with the BYT_RT5640_LINEOUT quirk. If that quirk is not set the new quirk is ignored. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-5-hdegoede@redhat.com Signed-off-by: Mark Brown commit 810711407467667761f7fd6aa1b8884203ecbeca Author: Hans de Goede Date: Mon Aug 2 16:24:58 2021 +0200 ASoC: Intel: bytcr_rt5640: Add a byt_rt5640_get_codec_dai() helper Add a byt_rt5640_get_codec_dai() helper, which gets the codec_dai from a dapm_context. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-4-hdegoede@redhat.com Signed-off-by: Mark Brown commit dd3e2025100c08d1fabd116bf5b6646f1589a95e Author: Hans de Goede Date: Mon Aug 2 16:24:57 2021 +0200 ASoC: Intel: bytcr_rt5640: Add line-out support Add support for boards which use the codecs Line Out output, this can be enabled by using the newly added BYT_RT5640_LINEOUT quirk. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-3-hdegoede@redhat.com Signed-off-by: Mark Brown commit dccd1dfd0770bfd494b68d1135b4547b2c602c42 Author: Hans de Goede Date: Mon Aug 2 16:24:56 2021 +0200 ASoC: Intel: bytcr_rt5640: Move "Platform Clock" routes to the maps for the matching in-/output Move the "Platform Clock" routes for the "Internal Mic" and "Speaker" routes to the intmic_*_map[] / *_spk_map[] arrays. This ensures that these "Platform Clock" routes do not get added when the BYT_RT5640_NO_INTERNAL_MIC_MAP / BYT_RT5640_NO_SPEAKERS quirks are used. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210802142501.991985-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 60e9feb781dfe84158b4ec7a4d61c5103e96e6f3 Author: Bard Liao Date: Fri Jul 23 19:54:51 2021 +0800 soundwire: intel: introduce shim and alh base shim base and alh base are platform-dependent. Adding these two parameters allows us to use different shim/alh base for each platform. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20210723115451.7245-7-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 198fa4bcf6a1e8685b43e37790d45f3ebcbc2784 Author: Bard Liao Date: Fri Jul 23 19:54:50 2021 +0800 ASoC: SOF: intel: add snd_sof_dsp_check_sdw_irq ops SoundWire IRQ status checks are platform-dependent, add new ops structure to provide abstraction. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210723115451.7245-6-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 2f1315ae94b46bf0d5b4be29be15cc3641364404 Author: Bard Liao Date: Fri Jul 23 19:54:49 2021 +0800 ASoC: SOF: intel: move sof_intel_dsp_desc() forward sof_intel_dsp_desc() will be used by hda_dsp_check_sdw_irq() in the following commit. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210723115451.7245-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 781dd3c822683f4b5dc332b68ac49d2db3d400e9 Author: Bard Liao Date: Fri Jul 23 19:54:48 2021 +0800 ASoC: SOF: intel: hda: remove HDA_DSP_REG_SNDW_WAKE_STS definition HDA_DSP_REG_SNDW_WAKE_STS is actually (SDW_SHIM_BASE + SDW_SHIM_WAKESTS) and SDW_SHIM_BASE is platform-dependent. Removing HDA_DSP_REG_SNDW_WAKE_STS and use (hdev->desc->sdw_shim_base + SDW_SHIM_WAKESTS) instead. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210723115451.7245-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 1cbf6443f0de6489044909b35962ba71940d48fe Author: Bard Liao Date: Fri Jul 23 19:54:47 2021 +0800 ASoC: SOF: intel: add sdw_shim/alh_base to sof_intel_dsp_desc sdw_shim_base and sdw_alh_base are platform-dependent. This change allow us to define different sdw shim/alh base for each platform. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20210723115451.7245-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit f01639589e252a6f72c04716e1b5f9bb10e2debc Author: Bard Liao Date: Fri Jul 23 19:54:46 2021 +0800 soundwire: move intel sdw register definitions to sdw_intel.h Those Intel sdw registers will be used by ASoC SOF drivers in the following commits. So move those definitions to sdw_intel.h and it can be visible to SOF drivers. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20210723115451.7245-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 170c0d7460fc4aa522995ae4096b5a442f50a1fc Merge: 6dfeb70276def b81e8efa245af Author: Mark Brown Date: Mon Aug 2 15:42:31 2021 +0100 Merge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-topology. Kuninori Morimoto (5): ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers() ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load() ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load() ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load() ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link() sound/soc/soc-topology.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) -- 2.25.1 commit 50fff206c5e3a04fcb239ad58d89cad166711b7f Author: Thomas Zimmermann Date: Fri Jul 30 20:35:11 2021 +0200 drm/vkms: Map output framebuffer BOs with drm_gem_fb_vmap() Abstract the framebuffer details by mappings its BOs with a call to drm_gem_fb_vmap(). Unmap with drm_gem_fb_vunamp(). Before, the output address with stored as raw pointer in the priv field of struct drm_writeback_job. Introduce the new type struct vkms_writeback_job, which holds the output mappings addresses while the writeback job is active. The patchset also cleans up some internal casting an setup of the output addresses. No functional changes. v3: * free instances of struct vkms_writeback_job on cleanup or errors Signed-off-by: Thomas Zimmermann Reviewed-by: Rodrigo Siqueira Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-6-tzimmermann@suse.de commit 0029d3182969d8dc67e4fedb00d6cf50eee74670 Author: Thomas Zimmermann Date: Fri Jul 30 20:35:10 2021 +0200 drm/gud: Map framebuffer BOs with drm_gem_fb_vmap() Abstract the framebuffer details by mapping its BOs with a call to drm_gem_fb_vmap(). Unmap with drm_gem_fb_vunmap(). The call to drm_gem_fb_vmap() ensures that all BOs are mapped correctly. Gud still only supports single-plane formats. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-5-tzimmermann@suse.de commit 0ec77bd92b513aa4e556e5b92ccd993677d21cbc Author: Thomas Zimmermann Date: Fri Jul 30 20:35:09 2021 +0200 drm/gem: Clear mapping addresses for unused framebuffer planes Set the returned mapping address to NULL if a framebuffer plane does not have a BO associated with it. Likewise, ignore mappings of NULL during framebuffer unmap operations. Allows users of the functions to perform unmap operations of certain BOs by themselfes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-4-tzimmermann@suse.de commit f6424ecdb3c8aba18997a6992f780ab9c27734bc Author: Thomas Zimmermann Date: Fri Jul 30 20:35:08 2021 +0200 drm/gem: Provide drm_gem_fb_{vmap,vunmap}() Move framebuffer vmap code from shadow-buffered plane state into the new interfaces drm_gem_fb_vmap() and drm_gem_fb_vunmap(). These functions provide mappings of a framebuffer's BOs into kernel address space. No functional changes. v4: * remove duplicated blank line v2: * using [static N] for array parameters enables compile-time checks * include for DRM_FORMAT_MAX_PLANES (kernel test robot) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-3-tzimmermann@suse.de commit 279cc2e9543eb357c0ef299cf398b2e74a021f6b Author: Thomas Zimmermann Date: Fri Jul 30 20:35:07 2021 +0200 drm: Define DRM_FORMAT_MAX_PLANES DRM uses a magic number of 4 for the maximum number of planes per color format. Declare this constant via DRM_FORMAT_MAX_PLANES and update the related code. Some code depends on the length of arrays that are now declared with DRM_FORMAT_MAX_PLANES. Convert it from '4' to ARRAY_SIZE. v2: * mention usage of ARRAY_SIZE() in the commit message (Maxime) * also fix error handling in drm_gem_fb_init_with_funcs() (kernel test robot) * include for DRM_FORMAT_MAX_PLANES Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-2-tzimmermann@suse.de commit bf2942a8b7c38e8cc2d5157b4f0323d7f4e5ec71 Author: Vidya Sagar Date: Wed Jul 28 00:20:55 2021 +0530 arm64: tegra: Fix Tegra194 PCIe EP compatible string The initialization sequence performed by the generic platform driver pcie-designware-plat.c for a DWC based implementation doesn't work for Tegra194. Tegra194 has a different initialization sequence requirement which can only be satisfied by the Tegra194 specific platform driver pcie-tegra194.c. So, remove the generic compatible string "snps,dw-pcie-ep" from Tegra194's endpoint controller nodes. Signed-off-by: Vidya Sagar Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 11e14fc3e49481b6322bbd976bb7dd2f0d7ef3d2 Author: Greg Kroah-Hartman Date: Mon Aug 2 16:30:39 2021 +0200 Revert "staging: r8188eu: remove rtw_buf_free() function" This reverts commit c7e88ecbe328e2bcd892d84c4b26eff86cb776ef as it's broken because somehow I forgot how pointers work... Reported-by: Larry Finger Cc: "Fabio M. De Francesco" Signed-off-by: Greg Kroah-Hartman commit 2d3e5caf96b9449af951e63476657acd759c1a30 Author: Gustavo A. R. Silva Date: Sat Jul 31 12:08:30 2021 -0500 net/ipv4: Replace one-element 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]. Use an anonymous union with a couple of anonymous structs in order to keep userspace unchanged: $ pahole -C ip_msfilter net/ipv4/ip_sockglue.o struct ip_msfilter { union { struct { __be32 imsf_multiaddr_aux; /* 0 4 */ __be32 imsf_interface_aux; /* 4 4 */ __u32 imsf_fmode_aux; /* 8 4 */ __u32 imsf_numsrc_aux; /* 12 4 */ __be32 imsf_slist[1]; /* 16 4 */ }; /* 0 20 */ struct { __be32 imsf_multiaddr; /* 0 4 */ __be32 imsf_interface; /* 4 4 */ __u32 imsf_fmode; /* 8 4 */ __u32 imsf_numsrc; /* 12 4 */ __be32 imsf_slist_flex[0]; /* 16 0 */ }; /* 0 16 */ }; /* 0 20 */ /* size: 20, cachelines: 1, members: 1 */ /* last cacheline: 20 bytes */ }; Also, refactor the code accordingly and make use of the struct_size() and flex_array_size() helpers. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 29a097b7747725da003245412dab61093d4e5976 Author: Vladimir Oltean Date: Sat Jul 31 17:14:32 2021 +0300 net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() No tagging driver uses this. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 35d7a6f1fb53479965e9f99e8c87edc642336eba Author: Krzysztof Kozlowski Date: Sat Jul 31 12:21:44 2021 +0200 nfc: hci: pass callback data param as pointer in nci_request() The nci_request() receives a callback function and unsigned long data argument "opt" which is passed to the callback. Almost all of the nci_request() callers pass pointer to a stack variable as data argument. Only few pass scalar value (e.g. u8). All such callbacks do not modify passed data argument and in previous commit they were made as const. However passing pointers via unsigned long removes the const annotation. The callback could simply cast unsigned long to a pointer to writeable memory. Use "const void *" as type of this "opt" argument to solve this and prevent modifying the pointed contents. This is also consistent with generic pattern of passing data arguments - via "void *". In few places which pass scalar values, use casts via "unsigned long" to suppress any warnings. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 1e0dd56e962e23f7738b32e8eed9ff96177c7fcb Author: Christophe JAILLET Date: Sat Jul 31 09:10:00 2021 +0200 cavium: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. It has been hand modified to use 'dma_set_mask_and_coherent()' instead of 'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable. It has been compile tested. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 244f8a802911f8c36e035641198b60acb617004e Author: Vladimir Oltean Date: Sat Jul 31 01:57:14 2021 +0300 net: dsa: mt7530: drop paranoid checks in .get_tag_protocol() It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as we can, because we now have options for switches without hardware support for DSA tagging, and the occurrence in the mt7530 driver is in fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol() is only called for CPU ports, the checks for a CPU port in mtk_get_tag_protocol() are redundant and can be removed. Signed-off-by: Vladimir Oltean Acked-by: DENG Qingfang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 013cc4c6788f1ce9885d3c0281904f93ee8f2271 Author: Jason Wang Date: Wed Jul 28 21:06:23 2021 +0800 KVM: arm64: Fix comments related to GICv2 PMR reporting Remove the repeated word 'the' from two comments. Signed-off-by: Jason Wang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210728130623.12017-1-wangborong@cdjrlc.com commit 38f703663d4c82ead5b51b8860deeef19d6dcb6d Author: Paolo Bonzini Date: Tue Jul 27 12:32:51 2021 +0200 KVM: arm64: Count VMID-wide TLB invalidations KVM/ARM has an architecture-specific implementation of kvm_flush_remote_tlbs; however, unlike the generic one, it does not count the flushes in kvm->stat.remote_tlb_flush, so that it inexorably remained stuck to zero. Signed-off-by: Paolo Bonzini Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210727103251.16561-1-pbonzini@redhat.com commit ec1cf69c376970f42761e641cf5074b84f8db243 Author: Peter Xu Date: Fri Jun 25 11:32:06 2021 -0400 KVM: X86: Add per-vm stat for max rmap list size Add a new statistic max_mmu_rmap_size, which stores the maximum size of rmap for the vm. Signed-off-by: Peter Xu Message-Id: <20210625153214.43106-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 7fa2a347512ab06ea1558302564879c060d52b0c Author: Sean Christopherson Date: Fri Jul 2 15:04:51 2021 -0700 KVM: x86/mmu: Return old SPTE from mmu_spte_clear_track_bits() Return the old SPTE when clearing a SPTE and push the "old SPTE present" check to the caller. Private shadow page support will use the old SPTE in rmap_remove() to determine whether or not there is a linked private shadow page. Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: Signed-off-by: Paolo Bonzini commit 03fffc5493c8c8d850586df5740c985026c313bf Author: Sean Christopherson Date: Fri Jul 2 15:04:50 2021 -0700 KVM: x86/mmu: Refactor shadow walk in __direct_map() to reduce indentation Employ a 'continue' to reduce the indentation for linking a new shadow page during __direct_map() in preparation for linking private pages. Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: <702419686d5700373123f6ea84e7a946c2cad8b4.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit e489a4a6bddb83385cb3d896776c5a7b2ec653d8 Author: Sean Christopherson Date: Fri Jul 2 15:04:29 2021 -0700 KVM: x86: Hoist kvm_dirty_regs check out of sync_regs() Move the kvm_dirty_regs vs. KVM_SYNC_X86_VALID_FIELDS check out of sync_regs() and into its sole caller, kvm_arch_vcpu_ioctl_run(). This allows a future patch to allow synchronizing select state for protected VMs. Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: <889017a8d31cea46472e0c64b234ef5919278ed9.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit 19025e7bc5977b35c73bea99841245f93470105e Author: Sean Christopherson Date: Fri Jul 2 15:04:26 2021 -0700 KVM: x86/mmu: Mark VM as bugged if page fault returns RET_PF_INVALID Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: <298980aa5fc5707184ac082287d13a800cd9c25f.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit 673692735fdc40ed7da32c0cb3517adaf4227b2b Author: Sean Christopherson Date: Fri Jul 2 15:04:25 2021 -0700 KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: <0e8760a26151f47dc47052b25ca8b84fffe0641e.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit 7ee3e8c39d3aed6ff4cc618d86ba9128f0c80087 Author: Sean Christopherson Date: Fri Jul 2 15:04:24 2021 -0700 KVM: Export kvm_make_all_cpus_request() for use in marking VMs as bugged Export kvm_make_all_cpus_request() and hoist the request helper declarations of request up to the KVM_REQ_* definitions in preparation for adding a "VM bugged" framework. The framework will add KVM_BUG() and KVM_BUG_ON() as alternatives to full BUG()/BUG_ON() for cases where KVM has definitely hit a bug (in itself or in silicon) and the VM is all but guaranteed to be hosed. Marking a VM bugged will trigger a request to all vCPUs to allow arch code to forcefully evict each vCPU from its run loop. Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Message-Id: <1d8cbbc8065d831343e70b5dcaea92268145eef1.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit 0b8f11737cffc1a406d1134b58687abc29d76b52 Author: Sean Christopherson Date: Fri Jul 2 15:04:23 2021 -0700 KVM: Add infrastructure and macro to mark VM as bugged Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini Message-Id: <3a0998645c328bf0895f1290e61821b70f048549.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini commit b6e952c35267b8da9a402f2f0c9ea23d5d929774 Merge: c500bee1c5b2f bfe6b5590ce6c Author: Arnd Bergmann Date: Mon Aug 2 15:29:34 2021 +0200 Merge tag 'renesas-drivers-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.15 - Initial support for the new R-Car H3e-2G and M3e-2G SoCs. * tag 'renesas-drivers-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Identify R-Car H3e-2G and M3e-2G Link: https://lore.kernel.org/r/cover.1627650704.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit c4994975132eb2488ad1259c273812ae38f5fccd Merge: 272614ec1b6bd 3e82868e8523d Author: Arnd Bergmann Date: Mon Aug 2 15:28:35 2021 +0200 Merge tag 'renesas-dt-bindings-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.15 - Document support for the new R-Car H3e-2G and M3e-2G SoCs and boards. * tag 'renesas-dt-bindings-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: arm: renesas: Document R-Car H3e-2G and M3e-2G SoCs and boards Link: https://lore.kernel.org/r/cover.1627650706.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 7a3ba3095a32f9c4ec8f30d680fea5150e12c3f3 Author: Marc Zyngier Date: Mon Jul 19 13:39:02 2021 +0100 KVM: arm64: Remove PMSWINC_EL0 shadow register We keep an entry for the PMSWINC_EL0 register in the vcpu structure, while *never* writing anything there outside of reset. Given that the register is defined as write-only, that we always trap when this register is accessed, there is little point in saving anything anyway. Get rid of the entry, and save a mighty 8 bytes per vcpu structure. We still need to keep it exposed to userspace in order to preserve backward compatibility with previously saved VMs. Since userspace cannot expect any effect of writing to PMSWINC_EL0, treat the register as RAZ/WI for the purpose of userspace access. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210719123902.1493805-5-maz@kernel.org commit ca4f202d08ba7f24cc97dce14c6d20ec7a679135 Author: Alexandre Chartre Date: Mon Jul 19 13:39:01 2021 +0100 KVM: arm64: Disabling disabled PMU counters wastes a lot of time In a KVM guest on arm64, performance counters interrupts have an unnecessary overhead which slows down execution when using the "perf record" command and limits the "perf record" sampling period. The problem is that when a guest VM disables counters by clearing the PMCR_EL0.E bit (bit 0), KVM will disable all counters defined in PMCR_EL0 even if they are not enabled in PMCNTENSET_EL0. KVM disables a counter by calling into the perf framework, in particular by calling perf_event_create_kernel_counter() which is a time consuming operation. So, for example, with a Neoverse N1 CPU core which has 6 event counters and one cycle counter, KVM will always disable all 7 counters even if only one is enabled. This typically happens when using the "perf record" command in a guest VM: perf will disable all event counters with PMCNTENTSET_EL0 and only uses the cycle counter. And when using the "perf record" -F option with a high profiling frequency, the overhead of KVM disabling all counters instead of one on every counter interrupt becomes very noticeable. The problem is fixed by having KVM disable only counters which are enabled in PMCNTENSET_EL0. If a counter is not enabled in PMCNTENSET_EL0 then KVM will not enable it when setting PMCR_EL0.E and it will remain disabled as long as it is not enabled in PMCNTENSET_EL0. So there is effectively no need to disable a counter when clearing PMCR_EL0.E if it is not enabled PMCNTENSET_EL0. Acked-by: Russell King (Oracle) Reviewed-by: Alexandru Elisei Signed-off-by: Alexandre Chartre [maz: moved 'mask' close to the actual user, simplifying the patch] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210712170345.660272-1-alexandre.chartre@oracle.com Link: https://lore.kernel.org/r/20210719123902.1493805-4-maz@kernel.org commit f5eff40058a856c23c5ec2f31756f107a2b1ef84 Author: Marc Zyngier Date: Mon Jul 19 13:39:00 2021 +0100 KVM: arm64: Drop unnecessary masking of PMU registers We always sanitise our PMU sysreg on the write side, so there is no need to do it on the read side as well. Drop the unnecessary masking. Acked-by: Russell King (Oracle) Reviewed-by: Alexandre Chartre Reviewed-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210719123902.1493805-3-maz@kernel.org commit 0ab410a93d627ae73136d1a52c096262360b7992 Author: Marc Zyngier Date: Mon Jul 19 13:38:59 2021 +0100 KVM: arm64: Narrow PMU sysreg reset values to architectural requirements A number of the PMU sysregs expose reset values that are not compliant with the architecture (set bits in the RES0 ranges, for example). This in turn has the effect that we need to pointlessly mask some register fields when using them. Let's start by making sure we don't have illegal values in the shadow registers at reset time. This affects all the registers that dedicate one bit per counter, the counters themselves, PMEVTYPERn_EL0 and PMSELR_EL0. Reported-by: Alexandre Chartre Reviewed-by: Alexandre Chartre Acked-by: Russell King (Oracle) Signed-off-by: Marc Zyngier Reviewed-by: Alexandru Elisei Link: https://lore.kernel.org/r/20210719123902.1493805-2-maz@kernel.org commit 272614ec1b6bde9ab56bf8c9a71c4ff9ccf2eff8 Merge: 062f82a0b7a76 651f8cffade86 Author: Arnd Bergmann Date: Mon Aug 2 15:23:21 2021 +0200 Merge tag 'renesas-arm-dt-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.15 - Switches support for the Draak and Ebisu development boards, - I2C support on RZ/G2L, - I2C EEPROM support on the Ebisu development board, - Sound support for the R-Car D3 SoC and the Draak development board, - Support for the new R-Car H3e-2G and M3e-2G SoCs on the Salvator-XS and ULCB development boards, - IOMMU support for DMAC, EtherAVB, and SDHI on the R-Car M3-W+ SoC, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (29 commits) arm64: dts: renesas: r8a77961: Add iommus to ipmmu_ds[01] related nodes arm64: dts: renesas: Add support for M3ULCB+Kingfisher with R-Car M3e-2G arm64: dts: renesas: Add support for M3ULCB with R-Car M3e-2G arm64: dts: renesas: Add support for Salvator-XS with R-Car M3e-2G arm64: dts: renesas: Add support for H3ULCB+Kingfisher with R-Car H3e-2G arm64: dts: renesas: Add support for H3ULCB with R-Car H3e-2G arm64: dts: renesas: Add support for Salvator-XS with R-Car H3e-2G arm64: dts: renesas: Add Renesas R8A779M3 SoC support arm64: dts: renesas: Add Renesas R8A779M1 SoC support arm64: dts: renesas: hihope-rzg2-ex: Add EtherAVB internal rx delay arm64: dts: renesas: r8a77995: draak: Add R-Car Sound support arm64: dts: renesas: r8a77995: Add R-Car Sound support arm64: dts: renesas: rcar-gen3: Add SoC model to comment headers arm64: dts: renesas: r8a77990: ebisu: Add I2C EEPROM for PMIC arm64: dts: renesas: r8a77995: draak: Remove bogus adv7511w properties arm64: dts: renesas: beacon: Enable micbias arm64: dts: renesas: r9a07g044: Add I2C nodes arm64: dts: renesas: r8a779a0: Restore sort order arm64: dts: renesas: r8a77990: ebisu: Add SW4 support arm64: dts: renesas: r8a77995: draak: Add SW56 support ... Link: https://lore.kernel.org/r/cover.1627650696.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 062f82a0b7a760db3fb08f33c9a919c301c2ad9b Author: Cristian Ciocaltea Date: Mon Jun 28 12:58:17 2021 +0530 ARM: dts: owl-s500-roseapplepi: Add ethernet support Add pinctrl configuration for enabling the Ethernet MAC on RoseapplePi SBC. Additionally, provide the necessary properties for the generic S500 ethernet node in order to setup PHY and MDIO. Signed-off-by: Cristian Ciocaltea Signed-off-by: Manivannan Sadhasivam Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/d0e1fbf81984127f0352eb740c7129424b5e40f9.1623401998.git.cristian.ciocaltea@gmail.com Link: https://lore.kernel.org/r/20210628072817.8269-3-mani@kernel.org' Signed-off-by: Arnd Bergmann commit df5060dce764998800baa085fc1a31c71fa15f2f Author: Cristian Ciocaltea Date: Mon Jun 28 12:58:16 2021 +0530 ARM: dts: owl-s500: Add ethernet support Add Ethernet MAC device tree node for Actions Semi S500 SoC. Reported-by: kernel test robot Signed-off-by: Cristian Ciocaltea Signed-off-by: Manivannan Sadhasivam Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/222ee0c2cb431619f558dce9726585ac92f65e00.1623401998.git.cristian.ciocaltea@gmail.com Link: https://lore.kernel.org/r/20210628072817.8269-2-mani@kernel.org' Signed-off-by: Arnd Bergmann commit 70115558ab02fe8d28a6634350b3491a542aaa02 Author: Jaehyoung Choi Date: Fri Jul 30 22:29:05 2021 +0300 pinctrl: samsung: Fix pinctrl bank pin count Commit 1abd18d1a51a ("pinctrl: samsung: Register pinctrl before GPIO") changes the order of GPIO and pinctrl registration: now pinctrl is registered before GPIO. That means gpio_chip->ngpio is not set when samsung_pinctrl_register() called, and one cannot rely on that value anymore. Use `pin_bank->nr_pins' instead of `pin_bank->gpio_chip.ngpio' to fix mentioned inconsistency. Fixes: 1abd18d1a51a ("pinctrl: samsung: Register pinctrl before GPIO") Signed-off-by: Jaehyoung Choi Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210730192905.7173-1-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit ec02f2b134d86b4a91c5d82eed03319060718a97 Author: Namhyung Kim Date: Mon Jul 19 15:31:53 2021 -0700 perf tools: Add pipe_test.sh to verify pipe operations It builds a test program and use it to verify pipe behavior with perf record, inject and report. $ perf test pipe -v 80: perf pipe recording and injection test : --- start --- test child forked, pid 1109301 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 1109315 1109315 -1 |test.file.MGNff [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 99.99% test.file.MGNff test.file.MGNffM [.] noploop [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 99.99% test.file.MGNff test.file.MGNffM [.] noploop [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.153 MB /tmp/perf.data.dmsnlx (3995 samples) ] 99.99% test.file.MGNff test.file.MGNffM [.] noploop test child finished with 0 ---- end ---- perf pipe recording and injection test: Ok Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719223153.1618812-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c3a057dc3aa9979ce6dc350e05eb2e4c021432cd Author: Namhyung Kim Date: Mon Jul 19 15:31:52 2021 -0700 perf inject: Fix output from a file to a pipe When the input is a regular file but the output is a pipe, it should write a pipe header. But just repiping would write a portion of the existing header which is different in 'size' value. So we need to prevent it and write a new pipe header along with other information like event attributes and features. This can handle something like this: # perf record -a -B sleep 1 # perf inject -b -i perf.data | perf report -i - Factor out perf_event__synthesize_for_pipe() to be shared between perf record and inject. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719223153.1618812-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fea20d66f90cdbdc7dccf1fa001d40e084984e55 Author: Namhyung Kim Date: Mon Jul 19 15:31:51 2021 -0700 perf inject: Fix output from a pipe to a file Sometimes it needs to save the perf inject data to a file for debugging. But normally it assumes the same format for input and output, so the end result cannot be used due to a broken format. # perf record -a -o - sleep 1 | perf inject -b -o my.data # perf report -i my.data --stdio 0x208 [0]: failed to process type: 0 [Invalid argument] Error: failed to process sample # To display the perf.data header info, please use --header/--header-only options. # In this case, it thought the data has a regular file header since the output is not a pipe. But actually it doesn't have one and has a pipe file header. At the end of the session, it tries to rewrite the regular file header with updated features and it overwrites the data just follows the pipe header. Fix it by checking either the input and the output is a pipe. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719223153.1618812-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0ae03893623dd1ddf17c1210265e5d7f9e2f3ed6 Author: Namhyung Kim Date: Mon Jul 19 15:31:50 2021 -0700 perf tools: Pass a fd to perf_file_header__read_pipe() Currently it unconditionally writes to stdout for repipe. But perf inject can direct its output to a regular file. Then it needs to write the header to the file as well. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719223153.1618812-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2681bd85a4b92788e265934d0d76bd56b5b08d16 Author: Namhyung Kim Date: Mon Jul 19 15:31:49 2021 -0700 perf tools: Remove repipe argument from perf_session__new() The repipe argument is only used by perf inject and the all others passes 'false'. Let's remove it from the function signature and add __perf_session__new() to be called from perf inject directly. This is a preparation of the change the pipe input/output. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719223153.1618812-2-namhyung@kernel.org [ Fixed up some trivial conflicts as this patchset fell thru the cracks ;-( ] Signed-off-by: Arnaldo Carvalho de Melo commit 36c3ce6c0d03a6c9992c3359f879cdc70fde836a Author: Marc Zyngier Date: Mon Jul 26 16:35:52 2021 +0100 KVM: Get rid of kvm_get_pfn() Nobody is using kvm_get_pfn() anymore. Get rid of it. Acked-by: Paolo Bonzini Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210726153552.1535838-7-maz@kernel.org commit 63db506e07622c344a3c748a1c06293d48780f83 Author: Marc Zyngier Date: Mon Jul 26 16:35:47 2021 +0100 KVM: arm64: Introduce helper to retrieve a PTE and its level It is becoming a common need to fetch the PTE for a given address together with its level. Add such a helper. Signed-off-by: Marc Zyngier Reviewed-by: Quentin Perret Reviewed-by: Alexandru Elisei Link: https://lore.kernel.org/r/20210726153552.1535838-2-maz@kernel.org commit 0fe49630101b3ce23bd21a2788440ac719ec868a Author: Marc Zyngier Date: Mon Jul 26 16:35:51 2021 +0100 KVM: arm64: Use get_page() instead of kvm_get_pfn() When mapping a THP, we are guaranteed that the page isn't reserved, and we can safely avoid the kvm_is_reserved_pfn() call. Replace kvm_get_pfn() with get_page(pfn_to_page()). Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210726153552.1535838-6-maz@kernel.org commit 205d76ff0684a0b4fe3ff3a283d143a47439d191 Author: Marc Zyngier Date: Mon Jul 26 16:35:50 2021 +0100 KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap() Now that arm64 has stopped using kvm_is_transparent_hugepage(), we can remove it, as well as PageTransCompoundMap() which was only used by the former. Acked-by: Paolo Bonzini Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210726153552.1535838-5-maz@kernel.org commit f2cc327303b13a70311e823bd52aa0bca8c7ddbc Author: Marc Zyngier Date: Mon Jul 26 16:35:49 2021 +0100 KVM: arm64: Avoid mapping size adjustment on permission fault Since we only support PMD-sized mappings for THP, getting a permission fault on a level that results in a mapping being larger than PAGE_SIZE is a sure indication that we have already upgraded our mapping to a PMD. In this case, there is no need to try and parse userspace page tables, as the fault information already tells us everything. Signed-off-by: Marc Zyngier Reviewed-by: Alexandru Elisei Link: https://lore.kernel.org/r/20210726153552.1535838-4-maz@kernel.org commit 6011cf68c88545e16cb32039c2cecfdae6a32315 Author: Marc Zyngier Date: Mon Jul 26 16:35:48 2021 +0100 KVM: arm64: Walk userspace page tables to compute the THP mapping size We currently rely on the kvm_is_transparent_hugepage() helper to discover whether a given page has the potential to be mapped as a block mapping. However, this API doesn't really give un everything we want: - we don't get the size: this is not crucial today as we only support PMD-sized THPs, but we'd like to have larger sizes in the future - we're the only user left of the API, and there is a will to remove it altogether To address the above, implement a simple walker using the existing page table infrastructure, and plumb it into transparent_hugepage_adjust(). No new page sizes are supported in the process. Signed-off-by: Marc Zyngier Reviewed-by: Alexandru Elisei Link: https://lore.kernel.org/r/20210726153552.1535838-3-maz@kernel.org commit 880569296fb8989516be0492eb304cb88c879e5c Author: Eirik Fuller Date: Fri Jun 25 22:38:25 2021 -0400 perf test: Handle fd gaps in test__dso_data_reopen https://github.com/beaker-project/restraint/issues/215 describes a file descriptor leak which revealed the test failure described here. The 'DSO data reopen' perf test assumes that RLIMIT_NOFILE limits the number of open file descriptors, but it actually limits newly opened file descriptors. When the file descriptor limit is reduced, file descriptors already open remain open regardless of the new limit. This test failure does not occur if open file descriptors are contiguous, beginning at zero. The following command triggers this perf test failure. perf test 'DSO data reopen' 3>/dev/null 8>/dev/null This patch determines the file descriptor limit by opening four files and then closing them. The limit is set to the fourth file descriptor, leaving only the first three available because any newly opened file descriptor must be less than the limit. Signed-off-by: Eirik Fuller Acked-by: Jiri Olsa Acked-by: Michael Petlan LPU-Reference: 20210626023825.1398547-1-efuller@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 43c117d809e4d0d1f80a418a0365faa6d307a3ed Author: Jin Yao Date: Mon Aug 2 13:34:40 2021 +0800 perf vendor events intel: Add basic metrics for Elkhartlake Add JSON metrics for Elkhartlake to perf. Signed-off-by: Jin Yao Reviewed-by: Andi Kleen Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210802053440.21035-3-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit aa1bd89235eee73746e7bac52d9e81afea270daa Author: Jin Yao Date: Mon Aug 2 13:34:39 2021 +0800 perf vendor events intel: Add core event list for Elkhartlake Add JSON core events for Elkhartlake to perf. Based on JSON list v1.02: https://download.01.org/perfmon/EHL/ Signed-off-by: Jin Yao Reviewed-by: Andi Kleen Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210802053440.21035-2-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b9efd75b6ec966f50b3db7fd9b2598d32e8f2f8b Author: Jin Yao Date: Fri Jul 16 12:01:37 2021 +0800 perf vendor events: Add metrics for Tigerlake Add JSON metrics for Tigerlake to perf. Based on TMA metrics 4.21 at 01.org. https://download.01.org/perfmon/ Reviewed-by: Andi Kleen Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719070058.4159-2-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 4babba5572e6adf99039beef8408f700dc45f464 Author: Jin Yao Date: Fri Jul 16 11:03:40 2021 +0800 perf vendor events intel: Add core event list for Tigerlake Add JSON core events for Tigerlake to perf. Based on JSON list v1.03: https://download.01.org/perfmon/TGL/ Reviewed-by: Andi Kleen Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210719070058.4159-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c4db54be9bc00f9f6883de798de99744b30ed461 Author: Li Huafei Date: Mon Jul 26 20:38:54 2021 +0800 perf annotate: Add error log in symbol__annotate() When users use 'perf annotate' on unsupported machines, error logs should be printed for user feedback. Signed-off-by: Li Huafei Reviewed-by: James Clark Cc: Alexander Shishkin Cc: Dengcheng Zhu Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Martin Liška Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Zhang Jinhao Link: http://lore.kernel.org/lkml/20210726123854.13463-2-lihuafei1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 4502da0efbdd3119fb94a491fa90c6d761bbed92 Author: Li Huafei Date: Mon Jul 26 20:38:53 2021 +0800 perf env: Normalize aarch64.* and arm64.* to arm64 in normalize_arch() On my aarch64 big endian machine, the perf annotate does not work. # perf annotate Percent | Source code & Disassembly of [kernel.kallsyms] for cycles (253 samples, percent: local period) -------------------------------------------------------------------------------------------------------------- Percent | Source code & Disassembly of [kernel.kallsyms] for cycles (1 samples, percent: local period) ------------------------------------------------------------------------------------------------------------ Percent | Source code & Disassembly of [kernel.kallsyms] for cycles (47 samples, percent: local period) ------------------------------------------------------------------------------------------------------------- ... This is because the arch_find() function uses the normalized architecture name provided by normalize_arch(), and my machine's architecture name aarch64_be is not normalized to arm64. Like other architectures such as arm and powerpc, we can fuzzy match the architecture names associated with aarch64.* and normalize them. It seems that there is also arm64_be architecture name, which we also normalize to arm64. Signed-off-by: Li Huafei Reviewed-by: James Clark Cc: Alexander Shishkin Cc: Dengcheng Zhu Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Martin Liška Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Zhang Jinhao Link: http //lore.kernel.org/lkml/20210726123854.13463-1-lihuafei1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit f463ad7f41d3a042653f55959c77e28db56cb312 Author: Ian Rogers Date: Wed May 12 23:04:41 2021 -0700 perf beauty: Reuse the generic arch errno switch Previously the code would see if, for example, tools/perf/arch/arm/include/uapi/asm/errno.h exists and if not generate a "generic" switch statement using the asm-generic/errno.h. This creates multiple identical "generic" switch statements before the default generic switch statement for an unknown architecture. By simplifying the archlist to be only for architectures that are not "generic" the amount of generated code can be reduced from 14 down to 6 functions. Remove the special case of x86, instead reverse the architecture names so that it comes first. Committer testing: $ tools/perf/trace/beauty/arch_errno_names.sh gcc tools > before Apply this patch and: $ tools/perf/trace/beauty/arch_errno_names.sh gcc tools > after 14 arches down to 6, that are the ones with an explicit errno.h file: $ ls -1 tools/arch/*/include/uapi/asm/errno.h tools/arch/alpha/include/uapi/asm/errno.h tools/arch/mips/include/uapi/asm/errno.h tools/arch/parisc/include/uapi/asm/errno.h tools/arch/powerpc/include/uapi/asm/errno.h tools/arch/sparc/include/uapi/asm/errno.h tools/arch/x86/include/uapi/asm/errno.h $ $ diff -u4 before after @@ -2099,32 +987,16 @@ const char *arch_syscalls__strerrno(const char *arch, int err) { if (!strcmp(arch, "x86")) return errno_to_name__x86(err); - if (!strcmp(arch, "alpha")) - return errno_to_name__alpha(err); - if (!strcmp(arch, "arc")) - return errno_to_name__arc(err); - if (!strcmp(arch, "arm")) - return errno_to_name__arm(err); - if (!strcmp(arch, "arm64")) - return errno_to_name__arm64(err); - if (!strcmp(arch, "csky")) - return errno_to_name__csky(err); - if (!strcmp(arch, "mips")) - return errno_to_name__mips(err); - if (!strcmp(arch, "parisc")) - return errno_to_name__parisc(err); - if (!strcmp(arch, "powerpc")) - return errno_to_name__powerpc(err); - if (!strcmp(arch, "riscv")) - return errno_to_name__riscv(err); - if (!strcmp(arch, "s390")) - return errno_to_name__s390(err); - if (!strcmp(arch, "sh")) - return errno_to_name__sh(err); if (!strcmp(arch, "sparc")) return errno_to_name__sparc(err); - if (!strcmp(arch, "xtensa")) - return errno_to_name__xtensa(err); + if (!strcmp(arch, "powerpc")) + return errno_to_name__powerpc(err); + if (!strcmp(arch, "parisc")) + return errno_to_name__parisc(err); + if (!strcmp(arch, "mips")) + return errno_to_name__mips(err); + if (!strcmp(arch, "alpha")) + return errno_to_name__alpha(err); return errno_to_name__generic(err); } The rest of the patch is the removal of the errno_to_name__generic() unneeded clones. Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210513060441.408507-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c44fc5af3cdcd7e414b793903054e4e9b0999306 Author: Ian Rogers Date: Wed Jul 14 18:33:43 2021 -0700 perf doc: Reorganize ARTICLES variables. Place early, as they are in the git Makefile. Remove references to a 'technical` directory that doesn't exist in perf. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 17ef1f14f62bc17bffadd1d7844bee6220934e20 Author: Ian Rogers Date: Wed Jul 14 18:33:42 2021 -0700 perf doc: Remove howto-index.sh related references. howto-index.sh exists in git but not in perf, as such targets that depend upon it fail. Remove such failing targets. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e30b992f0854d45bd192cfbfa2afcdb14fa4ec44 Author: Ian Rogers Date: Wed Jul 14 18:33:41 2021 -0700 perf doc: Remove cmd-list.perl references cmd-list.perl exists in git but not in perf. As such these targets fail with missing dependencies. Remove them. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 361ac7b462d3efacad5c70e15441dcbf914e2b4a Author: Ian Rogers Date: Wed Jul 14 18:33:40 2021 -0700 perf doc: Add info pages to all target. Enabled to ensure that info pages build. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 33e536103f227c41d00d91056b3f936dac513f14 Author: Ian Rogers Date: Wed Jul 14 18:33:39 2021 -0700 perf doc: Remove references to user-manual Perf doesn't have a user-manual.txt, but git does and this explains why there are references here. Having these references breaks 'make info' as user-manual.info can't be created given the missing dependency. Remove all references to user-manual so that 'make info' can succeed. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a81df63a5df3e195868236f2f77cfccf298950a2 Author: Ian Rogers Date: Wed Jul 14 18:33:38 2021 -0700 perf doc: Fix doc.dep The doc.dep dependencies for the Makefile fail to build as build-docdep.perl is missing. Add this file from git. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f6e7f065c8414c5dffa8b4a6b427062007035c3 Author: Ian Rogers Date: Wed Jul 14 18:33:37 2021 -0700 perf doc: Fix perfman.info build Before this change 'make perfman.info' fails as cat-texi.perl is missing. It also fails as the makeinfo output isn't written into the appropriate file. Add cat-texi.perl from git. Add missing output file flag for makeinfo. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https //lore.kernel.org/r/20210715013343.2286699-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9182f04a85b2c2062bbf4f8e53bec9ce698d55f0 Author: James Clark Date: Wed Jul 21 16:02:02 2021 +0100 perf cs-etm: Pass unformatted flag to decoder The TRBE (Trace Buffer Extension) feature allows a separate trace buffer for each trace source, therefore the trace wouldn't need to be formatted. The driver was introduced in commit 3fbf7f011f24 ("coresight: sink: Add TRBE driver"). The formatted/unformatted mode is encoded in one of the flags of the AUX record. The first AUX record encountered for each event is used to determine the mode, and this will persist for the remaining trace that is either decoded or dumped. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Al Grant Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210721150202.32065-7-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 04aaad262c9aae822c9f108bf6b0ac131e0ec690 Author: James Clark Date: Wed Jul 21 16:02:01 2021 +0100 perf cs-etm: Use existing decoder instead of resetting it When dumping trace, the decoder is continually deleted and recreated to decode each buffer. To support both formatted and unformatted trace in a later commit, the decoder will be configured in advance. This commit removes the deletion of the decoder and allows the formatted/unformatted setting to persist. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Al Grant Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210721150202.32065-6-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b8324f490be886b0e9026f1258fc2db3c9556d86 Author: James Clark Date: Wed Jul 21 16:02:00 2021 +0100 perf cs-etm: Suppress printing when resetting decoder The decoder is quite noisy when being reset. In a future commit, dump-raw-trace will use a code path that resets the decoder rather than creating a new one, so printing has to be suppressed to not flood the output. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Al Grant Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210721150202.32065-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ca50db5917cbb963e87c925422bee5851f55bd7f Author: James Clark Date: Wed Jul 21 16:01:59 2021 +0100 perf cs-etm: Only setup queues when they are modified Continually creating queues in cs_etm__process_event() is unnecessary. They only need to be created when a buffer for a new CPU or thread is encountered. This can be in two places, when building the queues in advance in cs_etm__process_auxtrace_info(), or in cs_etm__process_auxtrace_event() when data_queued is false and the index wasn't available (pipe mode). This change will allow the 'formatted' decoder setting to applied when iterating over aux records in a later commit. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Al Grant Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210721150202.32065-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9ac8afd500e4597edd52b9469368c0126bb42124 Author: James Clark Date: Wed Jul 21 16:01:58 2021 +0100 perf cs-etm: Split setup and timestamp search functions This refactoring has some benefits: * Decoding is done to find the timestamp. If we want to print errors when maps aren't available, then doing it from cs_etm__setup_queue() may cause warnings to be printed. * The cs_etm__setup_queue() flow is shared between timed and timeless modes, so it needs to be guarded by an if statement which can now be removed. * Allows moving the setup queues function earlier. * If data was piped in, then not all queues would be filled so it wouldn't have worked properly anyway. Now it waits for flush so data in all queues will be available. The motivation for this is to decouple setup functions with ones that involve decoding. That way we can move the setup function earlier when the formatted/unformatted trace information is available. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Al Grant Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https //lore.kernel.org/r/20210721150202.32065-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f38e1158bba17c5e45236ac7eedb0a6cbbc2ded Author: James Clark Date: Wed Jul 21 16:01:57 2021 +0100 perf cs-etm: Refactor initialisation of kernel start address The kernel start address is already cached in the machine struct once it is initialised, so storing it in the cs_etm struct is unnecessary. It also depends on kernel maps being available to be initialised. Therefore cs_etm__setup_queues() isn't an appropriate place to call it because it could be called before processing starts. It would be better to initialise it at the point when it is needed, then we can be sure that all the necessary maps are available. Also by calling machine__kernel_start() multiple times it can be initialised at some point, even if it failed to initialise previously due to missing maps. In a later commit cs_etm__setup_queues() will be moved which is the motivation for this change. Reviewed-by: Mathieu Poirier Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Al Grant Cc: Anshuman Khandual Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20210721150202.32065-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ea0056f09a74d96ddad11b0c484961c011baba08 Author: Wei Li Date: Wed Jul 14 09:50:00 2021 +0800 perf trace: Update cmd string table to decode sys_bpf first arg As 'enum bpf_cmd' has been extended a lot, update the cmd string table to decode sys_bpf first arg clearly in perf-trace. Signed-off-by: Wei Li Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Li Bin Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20210714015000.2844867-1-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit dac3ce63bffe0ef5c0a3fa9b5f6140b633cbc830 Author: Mark Brown Date: Wed Jul 28 18:35:39 2021 +0100 kselftest/arm64: Ignore check_gcr_el1_cswitch binary We added check_gcr_el1_cswitch but did not ignore the generated binary, add it. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210728173539.6231-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 29c34975c9391d3ad1fd5dd3c92ba0d41afe9549 Author: Icenowy Zheng Date: Mon Aug 2 14:37:41 2021 +0800 regmap: allow const array for {devm_,}regmap_field_bulk_alloc reg_fields The reg_fields array fed to {devm_}regmap_field_bulk_alloc is currently not const, which is not correct on semantics (the functions shouldn't change reg_field contents) and prevents pre-defined const reg_field array to be used. As the implementation of this function doesn't change the content of it, just add const to its prototype. Signed-off-by: Icenowy Zheng Link: https://lore.kernel.org/r/20210802063741.76301-1-icenowy@sipeed.com Signed-off-by: Mark Brown commit b81e8efa245af00e152a485297c611fe84a514a9 Author: Kuninori Morimoto Date: Mon Aug 2 15:01:12 2021 +0900 ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link() This patch cleanups below cppcheck warning. sound/soc/soc-topology.c:2129:27: style: The scope of the variable 'link' can be reduced. [variableScope] struct snd_soc_dai_link *link; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87mtq0wfkn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ea8f6b29b4a5676ca4b67b571a63ebabec245fd2 Author: Kuninori Morimoto Date: Mon Aug 2 15:01:04 2021 +0900 ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load() This patch cleanups below cppcheck warning. sound/soc/soc-topology.c:1038:31: style: The scope of the variable 'control_hdr' can be reduced. [variableScope] struct snd_soc_tplg_ctl_hdr *control_hdr; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o8agwfkv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e9aa139f95f5995d7010f46c285f5b9a19695b2d Author: Kuninori Morimoto Date: Mon Aug 2 15:00:52 2021 +0900 ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load() This patch cleanups below cppcheck warning. sound/soc/soc-topology.c:1599:35: style: The scope of the variable 'widget' can be reduced. [variableScope] struct snd_soc_tplg_dapm_widget *widget; ^ sound/soc/soc-topology.c:1600:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret, count, i; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmuwwfl7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 65a4cfdd6f2bc04b0c3d3607c48ceeac999c9424 Author: Kuninori Morimoto Date: Mon Aug 2 15:00:42 2021 +0900 ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load() This patch cleanups below cppcheck warning. sound/soc/soc-topology.c:2350:27: style: The scope of the variable 'dai' can be reduced. [variableScope] struct snd_soc_tplg_dai *dai; ^ sound/soc/soc-topology.c:2352:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r1fcwflh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit f79e4b2a38eda4e365f765d363f47cf0c2183ab4 Author: Kuninori Morimoto Date: Mon Aug 2 15:00:27 2021 +0900 ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers() This patch cleanups below cppcheck warning. sound/soc/soc-topology.c:2576:27: style: The scope of the variable 'hdr' can be reduced. [variableScope] struct snd_soc_tplg_hdr *hdr; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfzswflw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 615a77246691f0588a60b0d474e502528c7ed244 Author: Anshuman Gupta Date: Thu Jul 29 17:48:58 2021 +0530 drm/i915/dg1: Adjust the AUDIO power domain DG1 and XE_PLD platforms has Audio MMIO/VERBS lies in PG0 power well. Adjusting the power domain accordingly to POWER_DOMAIN_AUDIO_MMIO for audio detection and POWER_DOMAIN_AUDIO_PLAYBACK for audio playback. While doing this it requires to use POWER_DOMAIN_AUDIO_MMIO power domain instead of POWER_DOMAIN_AUDIO in crtc power domain mask and POWER_DOMAIN_AUDIO_PLAYBACK with intel_display_power_{get, put} to enable/disable display audio codec power. It will save the power in use cases when DP/HDMI connectors configured with PIPE_A without any audio playback. v1: Changes since RFC - changed power domain names. [Imre] - Removed TC{3,6}, AUX_USBC{3,6} and TBT from DG1 power well and PW_3 power domains. [Imre] - Fixed the order of powe wells , power domains and its registration. [Imre] v2: - Not allowe DC states when AUDIO_MMIO domain enabled. [Imre] v3: - Squashes the commits of series to avoid build failure. Cc: Ville Syrjälä Cc: Kai Vehmanen Cc: Uma Shankar Cc: Imre Deak Reviewed-by: Imre Deak Signed-off-by: Anshuman Gupta [Fix typo in commit message and in AUDIO_PLAYBACK domain name] Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20210729121858.16897-2-anshuman.gupta@intel.com commit 6dfeb70276def839aa605edd274f8e9f6189dba3 Author: Colin Ian King Date: Sun Aug 1 07:32:37 2021 +0100 ASoC: rsnd: make some arrays static const, makes object smaller Don't populate arrays on the stack but instead them static const. Makes the object code smaller by 242 bytes. Before: text data bss dec hex filename 23827 8764 0 32591 7f4f ./sound/soc/sh/rcar/ssi.o After: text data bss dec hex filename 23361 8988 0 32349 7e5d ./sound/soc/sh/rcar/ssi.o gcc version 10.2.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210801063237.137998-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 6e5b47a4f1dde38d42b054cc6d16b6840de08bd2 Author: Simon Ser Date: Mon Aug 2 07:28:35 2021 +0000 drm: document drm_mode_get_property It's not obvious what the fields mean and how they should be used. The most important detail is the link to drm_property.flags, which describes how property types work. v2: document enum drm_mode_property_enum, add ref to "Modeset Base Object Abstraction" (Daniel) Signed-off-by: Simon Ser Acked-by: Pekka Paalanen Acked-by: Daniel Vetter Cc: Leandro Ribeiro Link: https://patchwork.freedesktop.org/patch/msgid/20210802072826.500078-1-contact@emersion.fr commit 8f1fbc975b86cb6520da70fa8d8f69ee6f9306fe Author: Jason Wang Date: Mon Jul 26 20:39:40 2021 +0800 arm64: unnecessary end 'return;' in void functions The end 'return;' in a void function is useless and verbose. It can be removed safely. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20210726123940.63232-1-wangborong@cdjrlc.com Signed-off-by: Catalin Marinas commit 5c08c5acdc6ce46296a0f98d06896c818b8b34e0 Author: John Garry Date: Tue Jun 22 00:36:34 2021 +0800 iommu/arm-smmu-v3: Remove some unneeded init in arm_smmu_cmdq_issue_cmdlist() Members of struct "llq" will be zero-inited, apart from member max_n_shift. But we write llq.val straight after the init, so it was pointless to zero init those other members. As such, separately init member max_n_shift only. In addition, struct "head" is initialised to "llq" only so that member max_n_shift is set. But that member is never referenced for "head", so remove any init there. Removing these initializations is seen as a small performance optimisation, as this code is (very) hot path. Signed-off-by: John Garry Link: https://lore.kernel.org/r/1624293394-202509-1-git-send-email-john.garry@huawei.com Signed-off-by: Will Deacon commit 818c4593434e81c9971b8fc278215121622c755e Author: Nicolas Ferre Date: Thu Jul 29 16:28:27 2021 +0200 ARM: dts: at91: use the right property for shutdown controller The wrong property "atmel,shdwc-debouncer" was used to specify the debounce delay for the shutdown controler. Replace it with the documented and implemented property "debounce-delay-us", as mentioned in v4 driver submission. See: https://lore.kernel.org/r/1458134390-23847-3-git-send-email-nicolas.ferre@atmel.com/ Signed-off-by: Nicolas Ferre Reported-by: Clément Léger Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20210730172729.28093-1-nicolas.ferre@microchip.com/ commit a8caaa239c60ad735b92fb2e8147c8c095181afb Author: Mark Brown Date: Tue Jul 20 21:42:20 2021 +0100 arm64/sme: Document boot requirements for SME Document our requirements for initialisation of the Scalable Matrix Extension (SME) at kernel start. While we do have the ability to handle mismatched vector lengths we will reject any late CPUs that can't support the minimum set we determine at boot so for clarity we document a requirement that all CPUs make the same vector length available. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210720204220.22951-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit a3280efd009e6bbfdefd65834af57ba0da4ac8dc Merge: cfba3fb68960b c39830a4ce4df Author: David S. Miller Date: Mon Aug 2 10:47:12 2021 +0100 Merge branch 'octeon-drr-config' Sunil Goutham says: ==================== cn10k: DWRR MTU and weights configuration On OcteonTx2 DWRR quantum is directly configured into each of the transmit scheduler queues. And PF/VF drivers were free to config any value upto 2^24. On CN10K, HW is modified, the quantum configuration at scheduler queues is in terms of weight. And SW needs to setup a base DWRR MTU at NIX_AF_DWRR_RPM_MTU / NIX_AF_DWRR_SDP_MTU. HW will do 'DWRR MTU * weight' to get the quantum. This patch series addresses this HW change on CN10K silicons, both admin function and PF/VF drivers are modified. Also added support to program DWRR MTU via devlink params. ==================== Signed-off-by: David S. Miller commit c39830a4ce4df09ddef29ac388b062537c559228 Author: Sunil Goutham Date: Fri Jul 30 17:19:14 2021 +0530 octeontx2-pf: cn10k: Config DWRR weight based on MTU Program SQ, MDQ, TL4 to TL2 transmit scheduler queues' DWRR weight based on DWRR MTU programmed at NIX_AF_DWRR_RPM_MTU. The DWRR MTU from admin function is retrieved via mbox. On OcteaonTx2 silicon, admin function driver responds with DWRR MTU as '1'. This helps to avoid silicon specific transmit scheduler DWRR quantum/weight configuration logic. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 76660df2b4a264519afef1936b5d848f62781ae5 Author: Sunil Goutham Date: Fri Jul 30 17:19:13 2021 +0530 octeontx2-af: cn10k: DWRR MTU configuration On OcteonTx2 DWRR quantum is directly configured into each of the transmit scheduler queues. And PF/VF drivers were free to config any value upto 2^24. On CN10K, HW is modified, the quantum configuration at scheduler queues is in terms of weight. And SW needs to setup a base DWRR MTU at NIX_AF_DWRR_RPM_MTU / NIX_AF_DWRR_SDP_MTU. HW will do 'DWRR MTU * weight' to get the quantum. For LBK traffic, value programmed into NIX_AF_DWRR_RPM_MTU register is considered as DWRR MTU. This patch programs a default DWRR MTU of 8192 into HW and also provides a way to change this via devlink params. Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 87663c39f898b18905499126548da61450628682 Author: Florian Westphal Date: Fri Jul 23 15:18:01 2021 +0200 netfilter: ebtables: do not hook tables by default If any of these modules is loaded, hooks get registered in all netns: Before: 'unshare -n nft list hooks' shows: family bridge hook prerouting { -2147483648 ebt_broute -0000000300 ebt_nat_hook } family bridge hook input { -0000000200 ebt_filter_hook } family bridge hook forward { -0000000200 ebt_filter_hook } family bridge hook output { +0000000100 ebt_nat_hook +0000000200 ebt_filter_hook } family bridge hook postrouting { +0000000300 ebt_nat_hook } This adds 'template 'tables' for ebtables. Each ebtable_foo registers the table as a template, with an init function that gets called once the first get/setsockopt call is made. ebtables core then searches the (per netns) list of tables. If no table is found, it searches the list of templates instead. If a template entry exists, the init function is called which will enable the table and register the hooks (so packets are diverted to the table). If no entry is found in the template list, request_module is called. After this, hook registration is delayed until the 'ebtables' (set/getsockopt) request is made for a given table and will only happen in the specific namespace. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit cfba3fb68960b4e1fb63b4e3d95970b4a4be8577 Author: Dust Li Date: Fri Jul 30 11:41:55 2021 +0800 selftests/net: remove min gso test in packet_snd This patch removed the 'raw gso min size - 1' test which always fails now: ./in_netns.sh ./psock_snd -v -c -g -l "${mss}" raw gso min size - 1 (expected to fail) tx: 1524 rx: 1472 OK After commit 7c6d2ecbda83 ("net: be more gentle about silly gso requests coming from user"), we relaxed the min gso_size check in virtio_net_hdr_to_skb(). So when a packet which is smaller then the gso_size, GSO for this packet will not be set, the packet will be send/recv successfully. Signed-off-by: Dust Li Reviewed-by: Xuan Zhuo Signed-off-by: David S. Miller commit 220ade77452c15ecb1ab94c3f8aaeb6d033c3582 Author: Yufeng Mo Date: Fri Jul 30 10:19:11 2021 +0800 bonding: 3ad: fix the concurrency between __bond_release_one() and bond_3ad_state_machine_handler() Some time ago, I reported a calltrace issue "did not find a suitable aggregator", please see[1]. After a period of analysis and reproduction, I find that this problem is caused by concurrency. Before the problem occurs, the bond structure is like follows: bond0 - slaver0(eth0) - agg0.lag_ports -> port0 - port1 \ port0 \ slaver1(eth1) - agg1.lag_ports -> NULL \ port1 If we run 'ifenslave bond0 -d eth1', the process is like below: excuting __bond_release_one() | bond_upper_dev_unlink()[step1] | | | | | bond_3ad_lacpdu_recv() | | ->bond_3ad_rx_indication() | | spin_lock_bh() | | ->ad_rx_machine() | | ->__record_pdu()[step2] | | spin_unlock_bh() | | | | bond_3ad_state_machine_handler() | spin_lock_bh() | ->ad_port_selection_logic() | ->try to find free aggregator[step3] | ->try to find suitable aggregator[step4] | ->did not find a suitable aggregator[step5] | spin_unlock_bh() | | | | bond_3ad_unbind_slave() | spin_lock_bh() spin_unlock_bh() step1: already removed slaver1(eth1) from list, but port1 remains step2: receive a lacpdu and update port0 step3: port0 will be removed from agg0.lag_ports. The struct is "agg0.lag_ports -> port1" now, and agg0 is not free. At the same time, slaver1/agg1 has been removed from the list by step1. So we can't find a free aggregator now. step4: can't find suitable aggregator because of step2 step5: cause a calltrace since port->aggregator is NULL To solve this concurrency problem, put bond_upper_dev_unlink() after bond_3ad_unbind_slave(). In this way, we can invalid the port first and skip this port in bond_3ad_state_machine_handler(). This eliminates the situation that the slaver has been removed from the list but the port is still valid. [1]https://lore.kernel.org/netdev/10374.1611947473@famine/ Signed-off-by: Yufeng Mo Acked-by: Jay Vosburgh Signed-off-by: David S. Miller commit a270be1b3fdfb6940dd692c859fdf9a7407047be Author: Nadav Amit Date: Fri Jul 23 02:32:09 2021 -0700 iommu/amd: Use only natural aligned flushes in a VM When running on an AMD vIOMMU, it is better to avoid TLB flushes of unmodified PTEs. vIOMMUs require the hypervisor to synchronize the virtualized IOMMU's PTEs with the physical ones. This process induce overheads. AMD IOMMU allows us to flush any range that is aligned to the power of 2. So when running on top of a vIOMMU, break the range into sub-ranges that are naturally aligned, and flush each one separately. This apporach is better when running with a vIOMMU, but on physical IOMMUs, the penalty of IOTLB misses due to unnecessary flushed entries is likely to be low. Repurpose (i.e., keeping the name, changing the logic) domain_flush_pages() so it is used to choose whether to perform one flush of the whole range or multiple ones to avoid flushing unnecessary ranges. Use NpCache, as usual, to infer whether the IOMMU is physical or virtual. Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Suggested-by: Robin Murphy Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-8-namit@vmware.com Signed-off-by: Joerg Roedel commit 3b122a5666cb7c0bb9a439fba0c9a6cf59f999c3 Author: Nadav Amit Date: Fri Jul 23 02:32:08 2021 -0700 iommu/amd: Sync once for scatter-gather operations On virtual machines, software must flush the IOTLB after each page table entry update. The iommu_map_sg() code iterates through the given scatter-gather list and invokes iommu_map() for each element in the scatter-gather list, which calls into the vendor IOMMU driver through iommu_ops callback. As the result, a single sg mapping may lead to multiple IOTLB flushes. Fix this by adding amd_iotlb_sync_map() callback and flushing at this point after all sg mappings we set. This commit is followed and inspired by commit 933fcd01e97e2 ("iommu/vt-d: Add iotlb_sync_map callback"). Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Robin Murphy Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-7-namit@vmware.com Signed-off-by: Joerg Roedel commit fe6d269d0e9b05fa5233f810a3cb7cce4077b261 Author: Nadav Amit Date: Fri Jul 23 02:32:07 2021 -0700 iommu/amd: Tailored gather logic for AMD AMD's IOMMU can flush efficiently (i.e., in a single flush) any range. This is in contrast, for instnace, to Intel IOMMUs that have a limit on the number of pages that can be flushed in a single flush. In addition, AMD's IOMMU do not care about the page-size, so changes of the page size do not need to trigger a TLB flush. So in most cases, a TLB flush due to disjoint range is not needed for AMD. Yet, vIOMMUs require the hypervisor to synchronize the virtualized IOMMU's PTEs with the physical ones. This process induce overheads, so it is better not to cause unnecessary flushes, i.e., flushes of PTEs that were not modified. Implement and use amd_iommu_iotlb_gather_add_page() and use it instead of the generic iommu_iotlb_gather_add_page(). Ignore disjoint regions unless "non-present cache" feature is reported by the IOMMU capabilities, as this is an indication we are running on a physical IOMMU. A similar indication is used by VT-d (see "caching mode"). The new logic retains the same flushing behavior that we had before the introduction of page-selective IOTLB flushes for AMD. On virtualized environments, check if the newly flushed region and the gathered one are disjoint and flush if it is. Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org> Reviewed-by: Robin Murphy Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-6-namit@vmware.com Signed-off-by: Joerg Roedel commit febb82c208e481eee057c70fa3176bb48712a111 Author: Nadav Amit Date: Fri Jul 23 02:32:06 2021 -0700 iommu: Factor iommu_iotlb_gather_is_disjoint() out Refactor iommu_iotlb_gather_add_page() and factor out the logic that detects whether IOTLB gather range and a new range are disjoint. To be used by the next patch that implements different gathering logic for AMD. Note that updating gather->pgsize unconditionally does not affect correctness as the function had (and has) an invariant, in which gather->pgsize always represents the flushing granularity of its range. Arguably, “size" should never be zero, but lets assume for the matter of discussion that it might. If "size" equals to "gather->pgsize", then the assignment in question has no impact. Otherwise, if "size" is non-zero, then iommu_iotlb_sync() would initialize the size and range (see iommu_iotlb_gather_init()), and the invariant is kept. Otherwise, "size" is zero, and "gather" already holds a range, so gather->pgsize is non-zero and (gather->pgsize && gather->pgsize != size) is true. Therefore, again, iommu_iotlb_sync() would be called and initialize the size. Cc: Joerg Roedel Cc: Jiajun Cao Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org> Reviewed-by: Robin Murphy Acked-by: Will Deacon Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-5-namit@vmware.com Signed-off-by: Joerg Roedel commit 3136895cc5b665c1ab406d78f90c0700a3551e74 Author: Robin Murphy Date: Fri Jul 23 02:32:05 2021 -0700 iommu: Improve iommu_iotlb_gather helpers The Mediatek driver is not the only one which might want a basic address-based gathering behaviour, so although it's arguably simple enough to open-code, let's factor it out for the sake of cleanliness. Let's also take this opportunity to document the intent of these helpers for clarity. Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Robin Murphy Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Robin Murphy Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-4-namit@vmware.com Signed-off-by: Joerg Roedel commit 6664340cf1d541c2a44d588002893f795ab4143f Author: Nadav Amit Date: Fri Jul 23 02:32:04 2021 -0700 iommu/amd: Do not use flush-queue when NpCache is on Do not use flush-queue on virtualized environments, where the NpCache capability of the IOMMU is set. This is required to reduce virtualization overheads. This change follows a similar change to Intel's VT-d and a detailed explanation as for the rationale is described in commit 29b32839725f ("iommu/vt-d: Do not use flush-queue when caching-mode is on"). Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Robin Murphy Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-3-namit@vmware.com Signed-off-by: Joerg Roedel commit fc65d0acaf23179b94de399c204328fa259acb90 Author: Nadav Amit Date: Fri Jul 23 02:32:03 2021 -0700 iommu/amd: Selective flush on unmap Recent patch attempted to enable selective page flushes on AMD IOMMU but neglected to adapt amd_iommu_iotlb_sync() to use the selective flushes. Adapt amd_iommu_iotlb_sync() to use selective flushes and change amd_iommu_unmap() to collect the flushes. As a defensive measure, to avoid potential issues as those that the Intel IOMMU driver encountered recently, flush the page-walk caches by always setting the "pde" parameter. This can be removed later. Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Robin Murphy Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20210723093209.714328-2-namit@vmware.com Signed-off-by: Joerg Roedel commit 695176bfe5dec2051f950bdac0ae0b21e29e6de3 Author: Cong Wang Date: Thu Jul 29 16:12:14 2021 -0700 net_sched: refactor TC action init API TC action ->init() API has 10 parameters, it becomes harder to read. Some of them are just boolean and can be replaced by flags. Similarly for the internal API tcf_action_init() and tcf_exts_validate(). This patch converts them to flags and fold them into the upper 16 bits of "flags", whose lower 16 bits are still reserved for user-space. More specifically, the following kernel flags are introduced: TCA_ACT_FLAGS_POLICE replace 'name' in a few contexts, to distinguish whether it is compatible with policer. TCA_ACT_FLAGS_BIND replaces 'bind', to indicate whether this action is bound to a filter. TCA_ACT_FLAGS_REPLACE replaces 'ovr' in most contexts, means we are replacing an existing action. TCA_ACT_FLAGS_NO_RTNL replaces 'rtnl_held' but has the opposite meaning, because we still hold RTNL in most cases. The only user-space flag TCA_ACT_FLAGS_NO_PERCPU_STATS is untouched and still stored as before. I have tested this patch with tdc and I do not see any failure related to this patch. Tested-by: Vlad Buslov Acked-by: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 451395f798a3f0a9f257338bc1fbce9a1d6eaf52 Author: Martin Kaiser Date: Thu Jul 29 09:43:54 2021 +0200 niu: read property length only if we use it In three places, the driver calls of_get_property and reads the property length although the length is not used. Update the calls to not request the length. Signed-off-by: Martin Kaiser Signed-off-by: David S. Miller commit 2f425cf5242a019e9e8a6b1fe684b022c94fa7f1 Author: Daniel Vetter Date: Fri Jul 30 11:52:51 2021 +0200 drm: Fix oops in damage self-tests by mocking damage property I've added a new check to make sure that drivers which insepct the damage property have it set up correctly, but somehow missed that this borke the damage selftest in the CI result noise. Fix it up by mocking enough of drm_device and drm_plane so we can call drm_plane_enable_fb_damage_clips() to make the new check happy. Since there's a lot of duplicated mock code already copy-pasted into each test I've also refactored this a bit to trim it down. v2: Squash in fixup from 0day for drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: warning: symbol 'mock_device' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: warning: symbol 'mock_obj_props' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:17:18: warning: symbol 'mock_plane' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:18:21: warning: symbol 'mock_prop' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: kernel test robot Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Fixes: c7fcbf251397 ("drm/plane: check that fb_damage is set up when used") Cc: José Roberto de Souza (v1) Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Cc: José Roberto de Souza Cc: Hans de Goede Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210730095251.4343-1-daniel.vetter@ffwll.ch Link: https://patchwork.freedesktop.org/patch/msgid/20210730141948.GA11955@243d74413310 commit 0ae865ef92f1920bd2ca3fc7b6b5a9555b4641cc Author: Cai Huoqing Date: Fri Jul 30 21:27:29 2021 +0800 drm: Fix typo in comments fix typo for drm v1->v2: respin with the change "iff ==> implies that" Signed-off-by: Cai Huoqing Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210730132729.376-1-caihuoqing@baidu.com commit ec343111c056ec3847800302f6dbc57281f833fa Author: Linus Walleij Date: Mon Aug 2 01:33:13 2021 +0200 mfd: db8500-prcmu: Adjust map to reality These are the actual frequencies reported by the PLL, so let's report these. The roundoffs are inappropriate, we should round to the frequency that the clock will later report. Drop some whitespace at the same time. Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Lee Jones commit 614e1bb5305e82f968306bcf63be01693ac82a1f Author: Andre Przywara Date: Mon Aug 2 01:39:42 2021 +0100 dt-bindings: mfd: axp20x: Add AXP305 compatible (plus optional IRQ) The AXP305 PMIC used on many boards with the H616 SoC seems to be fully compatible to the AXP805 PMIC, so add the proper chain of compatible strings. Also at least on one board (Orangepi Zero2) there is no interrupt line connected to the CPU, so make the "interrupts" property optional. Signed-off-by: Andre Przywara Acked-by: Rob Herring Signed-off-by: Lee Jones commit 33e1fc062456f43f17e5240d6e9be11e95ef5103 Author: Simon Ser Date: Wed Jun 9 21:24:10 2021 +0000 drm/connector: add ref to drm_connector_get in iter docs Mention that connectors need to be referenced manually if they are to be accessed after the iteration has progressed or ended. Signed-off-by: Simon Ser Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/KRoUI7OC9lRIvk3YzdGm6tcMVAVlG1fR78Ll7kTZZT4@cp3-web-051.plabs.ch commit a39978ed6df1bc0b29bc6820e8878b49e428426b Author: Takashi Iwai Date: Thu Jul 29 09:44:04 2021 +0200 ALSA: doc: Add the description of quirk_flags option for snd-usb-audio Just briefly described about the new option. Link: https://lore.kernel.org/r/20210729074404.19728-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5b517854420b53541af09dc9e097e93673c9226f Author: Takashi Iwai Date: Thu Jul 29 09:44:03 2021 +0200 ALSA: usb-audio: Add quirk_flags module option This patch adds a new module option, quirk_flags, for allowing user to try some additional device-specific quirk behavior more easily. When this option is set to non-zero, it overrides the quirk_flags, and the specific workaround is applied. Link: https://lore.kernel.org/r/20210729074404.19728-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit 68e851ee4cfd2a3c96f10d984192c2c8abe9a104 Author: Takashi Iwai Date: Thu Jul 29 09:44:02 2021 +0200 ALSA: usb-audio: Move generic DSD raw detection into quirk_flags The generic DSD raw detection is based on the known allow list, and we can integrate it into quirk_flags, too. Link: https://lore.kernel.org/r/20210729074404.19728-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3c69dc9134130deb9682279374d9d97de52b0731 Author: Takashi Iwai Date: Thu Jul 29 09:44:01 2021 +0200 ALSA: usb-audio: Move ignore_ctl_error check into quirk_flags The mixer code has a flag ignore_ctl_error for ignoring the errors returned from the device wrt mixer accesses, and this is set from the entries in mixer_maps.c, as well as ignore_ctl_error module option. Those can be well integrated into the new quirk_flags field, too. Link: https://lore.kernel.org/r/20210729074404.19728-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 44e6fc64dfebf48811219a9c24666b4b87dc0ec5 Author: Takashi Iwai Date: Thu Jul 29 09:44:00 2021 +0200 ALSA: usb-audio: Move autosuspend quirk into quirk_flags The auto-suspend suppression workaround for Lenovo machines are handled in quirks-table.h. Now it's more easier to handle with quirk_flags. Link: https://lore.kernel.org/r/20210729074404.19728-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8bfe17ad975ffbd0c7ce673993ed2242fbc4ad94 Author: Takashi Iwai Date: Thu Jul 29 09:43:59 2021 +0200 ALSA: usb-audio: Move rate validation quirk into quirk_flags The rate validation at the device probe is applied only to the specific devices (currently only for MOTU devices), and this check can be moved to quirk_flags gracefully, too. Link: https://lore.kernel.org/r/20210729074404.19728-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1f074fe569870ed91c8ad2f67cccd9db5265443e Author: Takashi Iwai Date: Thu Jul 29 09:38:55 2021 +0200 ALSA: usb-audio: Move interface setup delay into quirk_flags Yet another delay is applied at switching the interface. This can be moved to quirk_flags, too. Link: https://lore.kernel.org/r/20210729073855.19043-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit f748385471f72992f8d5242a89deab518b38be76 Author: Takashi Iwai Date: Thu Jul 29 09:38:54 2021 +0200 ALSA: usb-audio: Move control message delay quirk into quirk_flags We apply some delay for the control messages on certain devices as a workaround, and this can be moved into the quirk_flags as well. Currently there are three different delay periods (1ms, 5ms and 20ms), so three different quirk bits are assigned for them. Link: https://lore.kernel.org/r/20210729073855.19043-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2de00d5a914ee2cb81ef775dffd0ca955f5644b8 Author: Takashi Iwai Date: Thu Jul 29 09:38:53 2021 +0200 ALSA: usb-audio: Move ITF-USB DSD quirk handling into quirk_flags The devices with ITF-USB DSD type are listed in another function, and this can be integrated into the quirk_flags easily. Link: https://lore.kernel.org/r/20210729073855.19043-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit f21dca857b4c2ab226083330ee31479ddac1e99d Author: Takashi Iwai Date: Thu Jul 29 09:38:52 2021 +0200 ALSA: usb-audio: Move clock setup quirk into quirk_flags There are a couple of device-specific quirks in the clock setup code, and those can be moved gracefully to quirk_flags, too. Link: https://lore.kernel.org/r/20210729073855.19043-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 019c7f912ca947c80b9b6f090fee90f90e1be9c8 Author: Takashi Iwai Date: Thu Jul 29 09:38:51 2021 +0200 ALSA: usb-audio: Move playback_first flag into quirk_flags The snd_usb_audio.playback_first flag is used by the implicit feedback mode handling, and this can be also moved to quirk_flags. Link: https://lore.kernel.org/r/20210729073855.19043-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit c1b034a4214e4ce81132be9db44e9fe3e2369351 Author: Takashi Iwai Date: Thu Jul 29 09:38:50 2021 +0200 ALSA: usb-audio: Move tx_length quirk handling to quirk_flags There is another quirk for the transfer, and that's currently specific to Zoom R16/24, handled in create_standard_audio_quirk(). Let's move this also to the new quirk_flags. Link: https://lore.kernel.org/r/20210729073855.19043-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit af158a7f8d9a858971bbb3c241545928fb327c6a Author: Takashi Iwai Date: Thu Jul 29 09:38:49 2021 +0200 ALSA: usb-audio: Move txfr_quirk handling to quirk_flags The txfr_quirk field was meant for aligning the transfer, and it's set for certain devices in quirks-table.h. Now we can move that stuff also to the new quirk_flags gracefully, and reduce the quirks-table.h entries (that are exposed to module device table). As the quirks-table.h entries are also with the name string override, provide the corresponding entries to the usb_audio_names[] table, too. Link: https://lore.kernel.org/r/20210729073855.19043-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit ce47d47e5cc8768ba6db4a5a6fb166b176fe12e6 Author: Takashi Iwai Date: Thu Jul 29 09:38:48 2021 +0200 ALSA: usb-audio: Move media-controller API quirk into quirk_flags The devices that can have media-controller API entries are currently specified via tables in quirks-table.h, as a part of descriptor override. This can fit better to the new quirk_flags, as we just need a matching with the given ID and create the MC entries accordingly. Link: https://lore.kernel.org/r/20210729073855.19043-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4d4dee0aefec36e6d1568e844a9e75a2e165cb93 Author: Takashi Iwai Date: Thu Jul 29 09:38:47 2021 +0200 ALSA: usb-audio: Introduce quirk_flags field As more and more device-specific workarounds came up and gathered in various places, it becomes harder to manage. Now it's time to clean up and collect workarounds more consistently and make them more easily applicable. This patch is the first step for that: a new field quirk_flags is introduced in snd_usb_audio struct to contain the bit flags for various device-specific quirks. Those are separate one from the quirks in quirks-table.h; the quirks-table.h entries are for more intrusive stuff that needs the descriptor override, while the new quirk_flags is for easier ones that are tied with the vendor:product IDs. In this patch, as the first example, we convert the list of devices and vendors to ignore GET_SAMPLE_RATE, formerly defined in snb_usb_get_sample_rate_quirk(). Link: https://lore.kernel.org/r/20210729073855.19043-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit e9c5b0b53ccca81dd0a35c62309e243a57c7959d Author: Christophe JAILLET Date: Thu Jul 29 14:04:01 2021 +0200 dmaengine: idxd: Fix a possible NULL pointer dereference 'device_driver_attach()' dereferences its first argument (i.e. 'alt_drv') so it must not be NULL. Simplify the error handling logic about NULL 'alt_drv' in order to be more robust and future-proof. Fixes: 568b2126466f ("dmaengine: idxd: fix uninit var for alt_drv") Fixes: 6e7f3ee97bbe ("dmaengine: idxd: move dsa_drv support to compatible mode") Signed-off-by: Christophe JAILLET Acked-by: Dave Jiang Link: https://lore.kernel.org/r/77f0dc4f3966591d1f0cffb614a94085f8895a85.1627560174.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 01099b1ad9101ca3f41071a87b9c496d9ea1d2ad Merge: 825a52482a616 eda80d7c9c4db Author: Takashi Iwai Date: Mon Aug 2 09:04:48 2021 +0200 Merge branch 'for-linus' into for-next commit ffa179ae2af6b32b1f72f4490989cd69f6385688 Merge: dd861267bfecc 7199ddede9f0f Author: Vinod Koul Date: Mon Aug 2 12:34:48 2021 +0530 Merge branch 'fixes' into next commit dd861267bfecc49df5232c33d3566a334ff5e9f6 Author: Juergen Borleis Date: Thu Jul 29 09:18:21 2021 +0200 dma: imx-dma: configure the generic DMA type to make it work Commit dea7a9f dmaengine: imx-dma: remove dma_slave_config direction usage changes the method from a "configuration when called" to an "configuration when used". Due to this, only the cyclic DMA type gets configured correctly, while the generic DMA type is left non-configured. Without this additional call, the struct imxdma_channel::word_size member is stuck at DMA_SLAVE_BUSWIDTH_UNDEFINED and imxdma_prep_slave_sg() always returns NULL. Signed-off-by: Juergen Borleis Link: https://lore.kernel.org/r/20210729071821.9857-1-jbe@pengutronix.de Signed-off-by: Vinod Koul commit b92e83f7c4f0e5dea11fd9aef1039d3121897391 Author: Alexander Sverdlin Date: Mon Jul 26 16:59:53 2021 +0300 dmaengine: ep93xx: Prepare clock before using it Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared m2p0 ... Hardware name: Cirrus Logic EDB9302 Evaluation Board ... clk_core_enable clk_core_enable_lock ep93xx_dma_alloc_chan_resources dma_chan_get find_candidate __dma_request_channel snd_dmaengine_pcm_request_channel dmaengine_pcm_new snd_soc_pcm_component_new soc_new_pcm snd_soc_bind_card edb93xx_probe ... ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0 ep93xx-i2s ep93xx-i2s: ASoC: error at snd_soc_pcm_component_new on ep93xx-i2s: -22 edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22 edb93xx-audio edb93xx-audio: snd_soc_register_card() failed: -22 edb93xx-audio: probe of edb93xx-audio failed with error -22 Signed-off-by: Alexander Sverdlin Signed-off-by: Nikita Shubin Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20210726140001.24820-6-nikita.shubin@maquefel.me Signed-off-by: Vinod Koul commit c454d16a7d5a9af88b844d98bec50d2363c19941 Author: Pandith N Date: Mon Aug 2 11:24:54 2021 +0530 dmaengine: dw-axi-dmac: Burst length settings Burst length, DMA HW capability set in dt-binding is now used in driver. Signed-off-by: Pandith N Tested-by: Pan Kris Link: https://lore.kernel.org/r/20210802055454.15192-4-pandith.n@intel.com Signed-off-by: Vinod Koul commit f95f3b53513d4bd846169fc42705548609494cce Author: Pandith N Date: Mon Aug 2 11:24:53 2021 +0530 dmaengine: dw-axi-dmac: support parallel memory <--> peripheral transfers Added support for multiple DMA_MEM_TO_DEV, DMA_DEV_TO_MEM transfers in parallel. This is required for peripherals using DMA for transmit and receive operations at the same time. APB slot number needs to be programmed in channel hardware handshaking interface Signed-off-by: Pandith N Tested-by: Pan Kris Link: https://lore.kernel.org/r/20210802055454.15192-3-pandith.n@intel.com Signed-off-by: Vinod Koul commit 32286e2793858a8491c2276b2754e9850467bb6b Author: Pandith N Date: Mon Aug 2 11:24:52 2021 +0530 dmaengine: dw-axi-dmac: Remove free slot check algorithm in dw_axi_dma_set_hw_channel Removed free slot check algorithm in dw_axi_dma_set_hw_channel. For 8 DMA channels, use respective handshake slot in DMA_HS_SEL APB register. For every channel, an dedicated slot is provided in hardware handshake register AXIDMA_CTRL_DMA_HS_SEL_n. Peripheral source number is programmed in respective channel slots. Signed-off-by: Pandith N Tested-by: Pan Kris Link: https://lore.kernel.org/r/20210802055454.15192-2-pandith.n@intel.com Signed-off-by: Vinod Koul commit 5eea6c9712bd2a707216d7b923090510d60f9663 Author: Jordy Zomer Date: Sat Jul 31 11:19:38 2021 +0200 dmaengine: usb-dmac: make usb_dmac_get_current_residue unsigned The usb_dmac_get_current_residue function used to take a signed integer as a pos parameter. The only callers of this function passes an unsigned integer to it. Therefore to make it obviously safe, let's just make this an unsgined integer as this is used in pointer arithmetics. Signed-off-by: Jordy Zomer Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20210731091939.510816-1-jordy@pwning.systems Signed-off-by: Vinod Koul commit dd81e7c3f0bb4fbe48b770b389ab6ccb95058dab Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:09 2021 +0800 soundwire: cadence: override PDI configurations to create loopback When we set a source PDI, the target PDI parameters will be overridden by the source register values. The loopback streams can be independently enabled on each link. While the loopback source and target can be configured before any stream is active on each link, the loopback stream should only be prepared/triggered when the playback stream is prepared. Otherwise all registers might be programmed to their reset values and the loopback will not succeed. The SoundWire bus driver currently does not allow two streams to be triggered at the same time, so the playback will have to be started first, and later the loopback. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 8fba8acd399b70aeb262983d32baa9cbbf7dc981 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:08 2021 +0800 soundwire: cadence: add debugfs interface for PDI loopbacks For debug, it's interesting to create a loopback stream for each link and use debugfs to set a source and target PDI. The target PDI would need to be an RX port and use the same register configurations as the source PDI. This capability allows e.g. for the headphone playback stream to be snooped on the headset capture stream, or alternatively for the addition of a dedicated loopback stream, in addition of regular capture for that link. This patch only adds the debugfs part, the port/PDI handling will be handled in the next patches. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-10-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 24f08b3aa5a5e42977c5a1d711d5cb7d9adbd94d Author: Bard Liao Date: Wed Jul 14 11:22:07 2021 +0800 soundwire: stream: don't program mockup device ports Mockup devices don't take part in command/control operations and their virtual ports shall not be programmed. Signed-off-by: Bard Liao Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20210714032209.11284-9-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7fae3cfb7007038a320db43ddffb7688388a0260 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:06 2021 +0800 soundwire: bus: squelch error returned by mockup devices All read and writes from/to SoundWire mockup devices will return -ENODATA/Command_Ignored, this patch forces a Command_OK result to let the bus perform the required configurations, e.g. for the Data Ports, which will only have an effect on the Master side. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-8-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 4a7a603cad3f667fb02e194c0a3412d3a7292093 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:05 2021 +0800 soundwire: add flag to ignore all command/control for mockup devices SoundWire mockup devices don't take part in the command/control protocol, so all commands will complete with -ENODATA or Command_Ignored results. With a flag, we can suppress such errors in the bus management and make it appear as if all read/writes succeed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-7-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e6645314eb2747bef4d9a375997221dede8ce4ce Author: Bard Liao Date: Wed Jul 14 11:22:04 2021 +0800 soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA This change is needed for support of mockup devices, which by construction will not provide any answer to a bank switch, but it's also legit for regular cases. If for some reason a device loses sync and cannot handle a bank switch, we should go ahead anyways. The devices can always resync later. The only case where the error flow should be used is when there is a Command_Aborted composite answer from SoundWire devices. Signed-off-by: Bard Liao Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20210714032209.11284-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 13a5635632af61853e874f9daeffd3f5e83daae5 Merge: ff560946ef15f 0ccac3bcf3564 Author: Vinod Koul Date: Mon Aug 2 10:32:51 2021 +0530 Merge tag 'asoc-sdw-mockup-codec' into next ASoC: Add mockup SoundWire CODEC Useful for bringup testing, not for production usage. commit ff560946ef15fb05b18a660f6b25e9c26fe050e1 Author: Pierre-Louis Bossart Date: Wed Jul 14 13:13:49 2021 +0800 soundwire: cadence: add paranoid check on self-clearing bits The Cadence IP exposes a small number of self-clearing bits in the MCP_CONTROL and MCP_CONFIG_UPDATE registers. We currently do not check that those bits are indeed cleared, e.g. during resume operations. That could lead to resuming peripheral devices too early. In addition, if we happen to read these registers, update one of the fields and write the register back, we may be writing stale data that might have been cleared in hardware. These sort of race conditions could lead to e.g. doing a hw_reset twice or stopping a clock that just restarted. There is no clear way of avoiding these potential race conditions other than making sure that these registers fields are cleared before any read-modify-write sequence. If we detect this sort of errors, we only log them since there is no clear recovery possible. The only way out is likely to restart the IP with a suspend/resume cycle. Note that the checks are performed before updating the registers, as well as after the Intel 'sync go' sequence in multi-link mode. That should cover both the start and end of suspend/resume hardware configurations. The Multi-Master mode gates the configuration updates until the 'sync go' signal is asserted, so we only check on init and after the end of the 'sync go' sequence. The duration of the usleep_range() was defined by the GSYNC frequency used in multi-master mode. With a 4kHz frequency, any configuration change might be deferred by up to 250us. Extending the range to 1000-1500us should guarantee that the configuration change is completed without any significant impact on the overall resume time. Suggested-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714051349.13064-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 456af438ad490bac7ed954cb929bcec1df7f0c82 Merge: a8ab5293dd230 8b99f3504b688 Author: Steve French Date: Sun Aug 1 18:46:26 2021 -0500 Merge pull request #64 from namjaejeon/cifsd-for-next ksmbd-fixes commit fe2fc0fd379371af510caf39181460f2eed4c35b Author: Linus Walleij Date: Mon Aug 2 01:30:14 2021 +0200 ARM: dts: ux500: Adjust operating points to reality The operating points should correspond to the actual frequencies supported for the CPU. Other patches have fixed so these are rounded and reported properly, this fixes the device trees to match. The Codina variant has a lower frequency than other devices so indicate this in the device tree. Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij commit 8b99f3504b688e3b55380521b6bf68c3d0c485d6 Author: Dan Carpenter Date: Mon Aug 2 08:14:03 2021 +0900 ksmbd: fix an oops in error handling in smb2_open() If smb2_get_name() then name is an error pointer. In the clean up code, we try to kfree() it and that will lead to an Oops. Set it to NULL instead. Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f95f59a2bb60f917faf516f2f0a679dc4e58f490 Author: Avri Altman Date: Mon Jul 12 12:50:39 2021 +0300 scsi: ufs: ufshpb: Make host mode parameters configurable Elaborate some more on the host control mode logic parameters, explaining what they do and how to configure them. Link: https://lore.kernel.org/r/20210712095039.8093-13-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 5dea655a09e6395f461ba0f9d38914c2c0d772e4 Author: Avri Altman Date: Mon Jul 12 12:50:38 2021 +0300 scsi: ufs: ufshpb: Add support for host control mode Support devices that report they are using host control mode. Link: https://lore.kernel.org/r/20210712095039.8093-12-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 1afb7ddadcadb3f45b34a434ea32457050ba2119 Author: Avri Altman Date: Mon Jul 12 12:50:37 2021 +0300 scsi: ufs: ufshpb: Do not send umap_all in host control mode HPB WRITE BUFFER with buffer-id = 0x3h is supported in device control mode only. Link: https://lore.kernel.org/r/20210712095039.8093-11-avri.altman@wdc.com Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 33845a2d844be6157914cf81b7170e4b12a5bf17 Author: Avri Altman Date: Mon Jul 12 12:50:36 2021 +0300 scsi: ufs: ufshpb: Limit the number of in-flight map requests In host control mode the host is the originator of map requests. To not flood the device with map requests, use a simple throttling mechanism that limits the number of in-flight map requests. Link: https://lore.kernel.org/r/20210712095039.8093-10-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 13c044e91678d6ef099285705261418bb7b0c748 Author: Avri Altman Date: Mon Jul 12 12:50:35 2021 +0300 scsi: ufs: ufshpb: Add "cold" regions timer In order not to hang on to "cold" regions, we inactivate a region that has had no READ access for a predefined amount of time - READ_TO_MS. For that purpose monitor the active regions list, polling it on every POLLING_INTERVAL_MS. On timeout expiry add the region to the "to-be-inactivated" list unless it is clean and did not exhaust its READ_TO_EXPIRIES - another parameter. None of this applies to pinned regions. Link: https://lore.kernel.org/r/20210712095039.8093-9-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 67001ff171cb4ae79774cdd13dc1d00cbfdbab66 Author: Avri Altman Date: Mon Jul 12 12:50:34 2021 +0300 scsi: ufs: ufshpb: Add HPB dev reset response The spec does not define what the host's recommended response is when the device sends HPB dev reset response (oper 0x2). Update all active HPB regions. Link: https://lore.kernel.org/r/20210712095039.8093-8-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 6f4ad14f0fb9f0e6809057a46489ef3ad3a274ab Author: Avri Altman Date: Mon Jul 12 12:50:33 2021 +0300 scsi: ufs: ufshpb: Region inactivation in host mode In host mode, the host is expected to send HPB WRITE BUFFER with buffer-id = 0x1 when it inactivates a region. Use the map-requests pool as there is no point in assigning a designated cache for umap-requests. [mkp: REQ_OP_DRV_*] Link: https://lore.kernel.org/r/20210712095039.8093-7-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 6c59cb501b86f8cddc486d6846732375f7baef24 Author: Avri Altman Date: Mon Jul 12 12:50:32 2021 +0300 scsi: ufs: ufshpb: Make eviction depend on region's reads In host mode, eviction is considered an extreme measure. Verify that the entering region has enough reads, and the exiting region has fewer reads. Link: https://lore.kernel.org/r/20210712095039.8093-6-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit c76a188856413f0a40585a7bc6801c755a4c0c8d Author: Avri Altman Date: Mon Jul 12 12:50:31 2021 +0300 scsi: ufs: ufshpb: Add reads counter In host control mode, reads are the major source of activation trials. Keep track of those reads counters, for both active as well inactive regions. We reset the read counter upon write - we are only interested in "clean" reads. Keep those counters normalized, as we are using those reads as a comparative score, to make various decisions. If during consecutive normalizations an active region has exhaust its reads - inactivate it. While at it, protect the {active,inactive}_count stats by adding them into the applicable handler. Link: https://lore.kernel.org/r/20210712095039.8093-5-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 8becf4db1e01d6ae2bb9f9877537dffee89b8308 Author: Avri Altman Date: Mon Jul 12 12:50:30 2021 +0300 scsi: ufs: ufshpb: Transform set_dirty to iterate_rgn Given a transfer length, set_dirty meticulously iterates over all the entries, across subregions and regions if needed. Currently its only use is to mark dirty blocks, but HCM may benefit from it as well to manage its read counters. Link: https://lore.kernel.org/r/20210712095039.8093-4-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 3a2c1f6803298c0a8784444cf66645163dd8e61b Author: Avri Altman Date: Mon Jul 12 12:50:29 2021 +0300 scsi: ufs: ufshpb: Add host control mode support to rsp_upiu In device control mode, the device may recommend the host to either activate or inactivate a region, and the host should follow. Meaning those are not actually recommendations, but more of instructions. Conversely, in host control mode, the recommendation protocol is slightly changed: a) The device may only recommend the host to update a subregion of an already-active region. And, b) The device may *not* recommend to inactivate a region. Furthermore, in host control mode, the host may choose not to follow any of the device's recommendations. However, in case of a recommendation to update an active and clean subregion, it is better to follow those recommendation because otherwise the host has no other way to know that some internal relocation took place. Link: https://lore.kernel.org/r/20210712095039.8093-3-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 119ee38c10fa34f37f2880af20b957ce55943ed2 Author: Avri Altman Date: Mon Jul 12 12:50:28 2021 +0300 scsi: ufs: ufshpb: Cache HPB Control mode on init We will use control_mode later when we need to differentiate between device and host control modes. Link: https://lore.kernel.org/r/20210712095039.8093-2-avri.altman@wdc.com Reviewed-by: Daejun Park Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 41d8a9333cc96f5ad4dd7a52786585338257d9f1 Author: Daejun Park Date: Mon Jul 12 18:00:25 2021 +0900 scsi: ufs: ufshpb: Add HPB 2.0 support Version 2.0 of HBP supports reads of varying sizes from 4KB to 1MB. A read operation <= 32KB is supported as single HPB read. A read between 36KB and 1MB is supported by a combination of write buffer command and HPB read command to deliver more PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. [mkp: REQ_OP_DRV_* and blk_rq_is_passthrough()] Link: https://lore.kernel.org/r/20210712090025epcms2p3b3d94f6f1b2cfa394e3d9ba130ca0fa7@epcms2p3 Tested-by: Can Guo Tested-by: Stanley Chu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Can Guo Reviewed-by: Bean Huo Reviewed-by: Stanley Chu Signed-off-by: Daejun Park Signed-off-by: Martin K. Petersen commit 2fff76f87542fae2366448ec8b01dbff415a7d22 Author: Daejun Park Date: Mon Jul 12 17:59:36 2021 +0900 scsi: ufs: ufshpb: Prepare HPB read for cached sub-region If the logical address of a read I/O belongs to an active sub-region, the HPB driver modifies the read I/O command to an HPB read. The driver modifies the UFS UPIU instead of modifying the existing SCSI command. In HPB version 1.0, the maximum read I/O size that can be converted to HPB read is 4KB. The dirty map of the active sub-region prevents an incorrect HPB read that has stale physical page number which is updated by previous write I/O. [mkp: REQ_OP_DRV_* and blk_rq_is_passthrough()] Link: https://lore.kernel.org/r/20210712085936epcms2p4b0ec5c8cecdeea6cc043d684363842b6@epcms2p4 Tested-by: Bean Huo Tested-by: Can Guo Tested-by: Stanley Chu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Can Guo Reviewed-by: Bart Van Assche Reviewed-by: Bean Huo Reviewed-by: Stanley Chu Acked-by: Avri Altman Signed-off-by: Daejun Park Signed-off-by: Martin K. Petersen commit 4b5f49079c52a7eadd2defbd8d2a270664a881d4 Author: Daejun Park Date: Mon Jul 12 17:58:59 2021 +0900 scsi: ufs: ufshpb: L2P map management for HPB read Implement L2P map management in HPB. The HPB divides logical addresses into several regions. A region consists of several sub-regions. The sub-region is a basic unit where L2P mapping is managed. The driver loads L2P mapping data of each sub-region. The loaded sub-region is called active-state. The HPB driver unloads L2P mapping data as region unit. The unloaded region is called inactive-state. Sub-region/region candidates to be loaded and unloaded are delivered from the UFS device. The UFS device delivers the recommended active sub-region and inactivate region to the driver using sense data. The HPB module performs L2P mapping management on the host through the delivered information. A pinned region is a preset region on the UFS device that is always in activate-state. The data structures for map data requests and L2P mappings use the mempool API, minimizing allocation overhead while avoiding static allocation. The mininum size of the memory pool used in the HPB is implemented as a module parameter so that it can be configurable by the user. To guarantee a minimum memory pool size of 4MB: ufshpb_host_map_kbytes=4096. The map_work manages active/inactive via 2 "to-do" lists: - hpb->lh_inact_rgn: regions to be inactivated - hpb->lh_act_srgn: subregions to be activated These lists are maintained on I/O completion. [mkp: switch to REQ_OP_DRV_*] Link: https://lore.kernel.org/r/20210712085859epcms2p36e420f19564f6cd0c4a45d54949619eb@epcms2p3 Tested-by: Bean Huo Tested-by: Can Guo Tested-by: Stanley Chu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Reviewed-by: Can Guo Reviewed-by: Bean Huo Reviewed-by: Stanley Chu Acked-by: Avri Altman Signed-off-by: Daejun Park Signed-off-by: Martin K. Petersen commit f02bc9754a6887bf5e286889265d24ce5e3b1952 Author: Daejun Park Date: Mon Jul 12 17:58:30 2021 +0900 scsi: ufs: ufshpb: Introduce Host Performance Buffer feature Implement Host Performance Buffer (HPB) initialization and add function calls to UFS core driver. NAND flash-based storage devices, including UFS, have mechanisms to translate logical addresses of I/O requests to the corresponding physical addresses of the flash storage. In UFS, logical-to-physical-address (L2P) map data, which is required to identify the physical address for the requested I/Os, can only be partially stored in SRAM from NAND flash. Due to this partial loading, accessing the flash address area, where the L2P information for that address is not loaded in the SRAM, can result in serious performance degradation. The basic concept of HPB is to cache L2P mapping entries in host system memory so that both physical block address (PBA) and logical block address (LBA) can be delivered in HPB read command. The HPB read command allows to read data faster than a regular read command in UFS since it provides the physical address (HPB Entry) of the desired logical block in addition to its logical address. The UFS device can access the physical block in NAND directly without searching and uploading L2P mapping table. This improves read performance because the NAND read operation for uploading L2P mapping table is removed. In HPB initialization, the host checks if the UFS device supports HPB feature and retrieves related device capabilities. Then, HPB parameters are configured in the device. Total start-up time of popular applications was measured and the difference observed between HPB being enabled and disabled. Popular applications are 12 game apps and 24 non-game apps. Each test cycle consists of running 36 applications in sequence. We repeated the cycle for observing performance improvement by L2P mapping cache hit in HPB. The following is the test environment: - kernel version: 4.4.0 - RAM: 8GB - UFS 2.1 (64GB) Results: +-------+----------+----------+-------+ | cycle | baseline | with HPB | diff | +-------+----------+----------+-------+ | 1 | 272.4 | 264.9 | -7.5 | | 2 | 250.4 | 248.2 | -2.2 | | 3 | 226.2 | 215.6 | -10.6 | | 4 | 230.6 | 214.8 | -15.8 | | 5 | 232.0 | 218.1 | -13.9 | | 6 | 231.9 | 212.6 | -19.3 | +-------+----------+----------+-------+ We also measured HPB performance using iozone: $ iozone -r 4k -+n -i2 -ecI -t 16 -l 16 -u 16 -s $IO_RANGE/16 -F \ mnt/tmp_1 mnt/tmp_2 mnt/tmp_3 mnt/tmp_4 mnt/tmp_5 mnt/tmp_6 mnt/tmp_7 \ mnt/tmp_8 mnt/tmp_9 mnt/tmp_10 mnt/tmp_11 mnt/tmp_12 mnt/tmp_13 \ mnt/tmp_14 mnt/tmp_15 mnt/tmp_16 Results: +----------+--------+---------+ | IO range | HPB on | HPB off | +----------+--------+---------+ | 1 GB | 294.8 | 300.87 | | 4 GB | 293.51 | 179.35 | | 8 GB | 294.85 | 162.52 | | 16 GB | 293.45 | 156.26 | | 32 GB | 277.4 | 153.25 | +----------+--------+---------+ Link: https://lore.kernel.org/r/20210712085830epcms2p8c1288b7f7a81b044158a18232617b572@epcms2p8 Reported-by: kernel test robot Tested-by: Bean Huo Tested-by: Can Guo Tested-by: Stanley Chu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Reviewed-by: Can Guo Reviewed-by: Bean Huo Reviewed-by: Stanley Chu Acked-by: Avri Altman Signed-off-by: Daejun Park Signed-off-by: Martin K. Petersen commit 33529018294f1eabc6b5bb2672941165e658e96a Author: Dwaipayan Ray Date: Fri Jul 16 16:58:52 2021 +0530 scsi: qla4xxx: Convert uses of __constant_cpu_to_ to cpu_to_ The macros cpu_to_le16() and cpu_to_le32() have special cases for constants. Their __constant_ versions are not required. On little endian systems, both cpu_to_le16() and __constant_cpu_to_le16() expand to the same expression. Same is the case with cpu_to_le32(). On big endian systems, cpu_to_le16() expands to __swab16() which has a __builtin_constant_p check. Similarly, cpu_to_le32() expands to __swab32(). Consequently these macros can be safely used with constants, and hence all those uses are converted. This was discovered as a part of a checkpatch evaluation, looking at all reports of WARNING:CONSTANT_CONVERSION error type. Link: https://lore.kernel.org/r/20210716112852.24598-1-dwaipayanray1@gmail.com Signed-off-by: Dwaipayan Ray Signed-off-by: Martin K. Petersen commit 2127cd21fb78c6e22d92944253afd967b0ff774d Author: Colin Ian King Date: Fri Jul 30 10:50:31 2021 +0100 scsi: BusLogic: Use %X for u32 sized integer rather than %lX An earlier fix changed the print format specifier for adapter->bios_addr to use %lX. However, the integer is a u32 so the fix was wrong. Fix this by using the correct %X format specifier. Link: https://lore.kernel.org/r/20210730095031.26981-1-colin.king@canonical.com Fixes: 43622697117c ("scsi: BusLogic: use %lX for unsigned long rather than %X") Acked-by: Khalid Aziz Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Invalid type in argument") commit a40662c90d974a89d2f5d627542b63bed88e72f0 Author: Maciej W. Rozycki Date: Tue Apr 20 20:01:52 2021 +0200 scsi: BusLogic: Avoid unbounded vsprintf() use Existing blogic_msg() invocations do not appear to overrun its internal buffer of a fixed length of 100, which would cause stack corruption, but it's easy to miss with possible further updates and a fix is cheap in performance terms, so limit the output produced into the buffer by using vscnprintf() rather than vsprintf(). Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201939390.44318@angie.orcam.me.uk Acked-by: Khalid Aziz Signed-off-by: Maciej W. Rozycki Signed-off-by: Martin K. Petersen commit 44d01fc86d952f5a8b8b32bdb4841504d5833d95 Author: Maciej W. Rozycki Date: Tue Apr 20 20:01:47 2021 +0200 scsi: BusLogic: Fix missing pr_cont() use Update BusLogic driver's messaging system to use pr_cont() for continuation lines, bringing messy output: pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** scsi: Copyright 1995-1998 by Leonard N. Zubkoff scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter scsi0: Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level scsi0: PCI Bus: 0, Device: 19, Address: 0xE0012000, Host Adapter SCSI ID: 7 scsi0: Parity Checking: Enabled, Extended Translation: Enabled scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled scsi0: Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211 scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192 scsi0: Tagged Queue Depth: Automatic , Untagged Queue Depth: 3 scsi0: SCSI Bus Termination: Both Enabled , SCAM: Disabled scsi0: *** BusLogic BT-958 Initialized Successfully *** scsi host0: BusLogic BT-958 back to order: pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** scsi: Copyright 1995-1998 by Leonard N. Zubkoff scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter scsi0: Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level scsi0: PCI Bus: 0, Device: 19, Address: 0xE0012000, Host Adapter SCSI ID: 7 scsi0: Parity Checking: Enabled, Extended Translation: Enabled scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled scsi0: Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211 scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192 scsi0: Tagged Queue Depth: Automatic, Untagged Queue Depth: 3 scsi0: SCSI Bus Termination: Both Enabled, SCAM: Disabled scsi0: *** BusLogic BT-958 Initialized Successfully *** scsi host0: BusLogic BT-958 Also diagnostic output such as with the BusLogic=TraceConfiguration parameter is affected and becomes vertical and therefore hard to read. This has now been corrected, e.g.: pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17 blogic_cmd(86) Status = 30: 4 ==> 4: FF 05 93 00 blogic_cmd(95) Status = 28: (Modify I/O Address) blogic_cmd(91) Status = 30: 1 ==> 1: 01 blogic_cmd(04) Status = 30: 4 ==> 4: 41 41 35 30 blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 ***** scsi: Copyright 1995-1998 by Leonard N. Zubkoff blogic_cmd(04) Status = 30: 4 ==> 4: 41 41 35 30 blogic_cmd(0B) Status = 30: 3 ==> 3: 00 08 07 blogic_cmd(0D) Status = 30: 34 ==> 34: 03 01 07 04 00 00 00 00 00 00 00 00 00 00 00 00 FF 42 44 46 FF 00 00 00 00 00 00 00 00 00 FF 00 FF 00 blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D blogic_cmd(84) Status = 30: 1 ==> 1: 37 blogic_cmd(8B) Status = 30: 5 ==> 5: 39 35 38 20 20 blogic_cmd(85) Status = 30: 1 ==> 1: 42 blogic_cmd(86) Status = 30: 4 ==> 4: FF 05 93 00 blogic_cmd(91) Status = 30: 64 ==> 64: 41 46 3E 20 39 35 38 20 20 00 C4 00 04 01 07 2F 07 04 35 FF FF FF FF FF FF FF FF FF FF 01 00 FE FF 08 FF FF 00 00 00 00 00 00 00 01 00 01 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 FC scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter etc. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201940430.44318@angie.orcam.me.uk Fixes: 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") Cc: stable@vger.kernel.org # v4.9+ Acked-by: Khalid Aziz Signed-off-by: Maciej W. Rozycki Signed-off-by: Martin K. Petersen commit 659a37844abc00c3dc676bb1faed29c1dacbf59f Author: Christoph Hellwig Date: Sat Jul 31 09:40:27 2021 +0200 scsi: bsg-lib: Fix commands without data transfer in bsg_transport_sg_io_fn() Set ret to 0 after the initial permission checks to avoid leaking -EPERM for commands without data transfer. Link: https://lore.kernel.org/r/20210731074027.1185545-3-hch@lst.de Fixes: 75ca56409e5b ("scsi: bsg: Move the whole request execution into the SCSI/transport handlers") Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 5c0f61377b765e650b1bc85298b79add1148c97f Author: Christoph Hellwig Date: Sat Jul 31 09:40:26 2021 +0200 scsi: bsg: Fix commands without data transfer in scsi_bsg_sg_io_fn() Set ret to 0 after the initial permission checks to avoid leaking -EPERM for commands without data transfer. Link: https://lore.kernel.org/r/20210731074027.1185545-2-hch@lst.de Fixes: 75ca56409e5b ("scsi: bsg: Move the whole request execution into the SCSI/transport handlers") Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 18cb62367a8fb357d32cbb132eb1073fdee5ca7e Author: dingsenjie Date: Fri Jun 25 20:11:08 2021 +0800 libertas: Remove unnecessary label of lbs_ethtool_get_eeprom The label is only used once, so we delete it and use the return statement instead of the goto statement. Signed-off-by: dingsenjie Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210625121108.162868-1-dingsenjie@163.com commit 5ff013914c62c493c206d70554cfb1d311ea481a Author: Linus Walleij Date: Mon Jul 12 01:16:59 2021 +0200 brcmfmac: firmware: Allow per-board firmware binaries After some crashes in the 3D engine (!) on the Samsung GT-I8530 it turns out that the main firmware file can be device dependent, something that was previously only handled for the NVRAM parameter file. Rewrite the code a bit so we can a per-board suffixed firmware binary as well, if this does not exist we fall back to the canonical firmware name. Example: a 4330 device with the OF board compatible is "samsung,gavini". We will first try "brcmfmac4330-sdio.samsung,gavini.bin" then "brcmfmac4330-sdio.bin" if that does not work. Cc: phone-devel@vger.kernel.org Cc: newbyte@disroot.org Cc: Stephan Gerhold Signed-off-by: Linus Walleij Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210711231659.255479-1-linus.walleij@linaro.org commit 6c9bd4432b252765b38bfc0bbe4847f43604f06e Author: Gregory Williams Date: Fri Jul 30 20:53:28 2021 -0400 DRM: ast: Fixed coding style issues of ast_mode.c Removed space before comma, fixed if statements by putting trailing statements on new line, fixed unsigned int declaration, and removed not needed else statement after return. Signed-off-by: Gregory Williams Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210731005328.GA19016@devbox commit f2e3778db7e13fd9a83c309dd8c9fbe69ba8efbe Author: Florian Westphal Date: Thu Jul 22 10:48:34 2021 +0200 netfilter: remove xt pernet data clusterip is now handled via net_generic. NOTRACK is tiny compared to rest of xt_CT feature set, even the existing deprecation warning is bigger than the actual functionality. Just remove the warning, its not worth keeping/adding a net_generic one. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ded2d10e9ad816e1f962def22191e38ebfb4bb11 Author: Florian Westphal Date: Thu Jul 22 10:48:33 2021 +0200 netfilter: ipt_CLUSTERIP: use clusterip_net to store pernet warning No need to use struct net for this. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7c1829b6aa74fff71abc1c9565151e50ad1aa3e1 Author: Florian Westphal Date: Thu Jul 22 10:48:32 2021 +0200 netfilter: ipt_CLUSTERIP: only add arp mangle hook when required Do not register the arp mangling hooks from pernet init path. As-is, load of the module is enough for these hooks to become active in each net namespace. Use checkentry instead so hook is only added if a CLUSTERIP rule is used. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 92fb15513edc6ae1eb51f717e70d4d3d538c2d09 Author: Pablo Neira Ayuso Date: Mon Jul 19 18:04:01 2021 +0200 netfilter: flowtable: remove nf_ct_l4proto_find() call TCP and UDP are built-in conntrack protocol trackers and the flowtable only supports for TCP and UDP, remove this call. Signed-off-by: Pablo Neira Ayuso commit 241d1af4c11a75d4c17ecc0193a6ab60553efbfc Author: Pablo Neira Ayuso Date: Thu Jul 15 11:11:26 2021 +0200 netfilter: nft_compat: use nfnetlink_unicast() Use nfnetlink_unicast() which already translates EAGAIN to ENOBUFS, since EAGAIN is reserved to report missing module dependencies to the nfnetlink core. e0241ae6ac59 ("netfilter: use nfnetlink_unicast() forgot to update this spot. Reported-by: Yajun Deng Signed-off-by: Pablo Neira Ayuso commit 0fc7ca624b1452050d31b05cd198e38a1b74d1b3 Author: Alexander Usyskin Date: Sun Aug 1 10:25:32 2021 +0300 samples: mei: don't wait on read completion upon write. The original mei driver communication was strictly write command and receive response flow, the completion of write was determined when response was ready using select(). This paradigm is a long time not true. There can be write without a response and an unsolicited read. The driver is capable of handling those. Adjust also the sample code and remove select() on read() from the write flow. Add select to the read flow to showcase how to do the read with a timeout. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20210801072532.8668-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit c66cd19e2b0c47a042ba219e446e2efefdea82de Author: Phillip Potter Date: Sun Aug 1 00:56:48 2021 +0100 staging: r8188eu: remove RT_PRINT_DATA macro Remove RT_PRINT_DATA definition from include/rtw_debug.h, and its two calling statements in hal/hal_com.c, as this code was not written with best practices in mind and is safer to simply remove. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731235648.67642-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 55dfa29b43d23bab37d98f087615ff46d38241df Author: Phillip Potter Date: Sat Jul 31 14:38:09 2021 +0100 staging: rtl8188eu: remove rtl8188eu driver from staging dir This driver was deprecated with the introduction of the r8188eu driver, based upon Realtek sources that were modified for CFG80211 support and other fixes on GitHub by Larry Finger. As that driver is now progressing at pace, we should remove this one. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731133809.196681-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 06889446a78fb9655332954a2288ecbacc7f0ff8 Author: Phillip Potter Date: Sat Jul 31 14:38:04 2021 +0100 staging: r8188eu: correct set/defined but unused warnings from debug cleanup The recent include/odm_debug.h removal series caused a few kernel test robot warnings. This patch fixes them as well as an existing warning related to an array within include/rtw_security.h not being used. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731133804.196631-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit afc56237fd5e4fe2cb708f84e6e390cbaea4c439 Author: kernel test robot Date: Sat Jul 31 20:18:43 2021 +0800 staging: r8188eu: fix duplicated inclusion Generated by: scripts/checkincludes.pl Reported-by: kernel test robot Signed-off-by: kernel test robot Link: https://lore.kernel.org/r/20210731121843.GA54722@fdce12c5ae77 Signed-off-by: Greg Kroah-Hartman commit 9746f5fe70aa16182bcb505265c4800365438585 Author: Alistair Francis Date: Sun Aug 1 10:47:00 2021 +1000 drm/panel: Add support for E Ink VB3300-KCA Add support for the 10.3" E Ink panel described at: https://www.eink.com/product.html?type=productdetail&id=7 Signed-off-by: Alistair Francis Acked-by: Rob Herring Reviewed-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210801004701.831-1-alistair@alistair23.me commit a449ffaf9181b5a2dc705d8a06b13e0068207fd4 Author: Will Deacon Date: Fri Jul 30 12:42:31 2021 +0100 powerpc/svm: Don't issue ultracalls if !mem_encrypt_active() Commit ad6c00283163 ("swiotlb: Free tbl memory in swiotlb_exit()") introduced a set_memory_encrypted() call to swiotlb_exit() so that the buffer pages are returned to an encrypted state prior to being freed. Sachin reports that this leads to the following crash on a Power server: [ 0.010799] software IO TLB: tearing down default memory pool [ 0.010805] ------------[ cut here ]------------ [ 0.010808] kernel BUG at arch/powerpc/kernel/interrupt.c:98! Nick spotted that this is because set_memory_encrypted() is issuing an ultracall which doesn't exist for the processor, and should therefore be gated by mem_encrypt_active() to mirror the x86 implementation. Cc: Konrad Rzeszutek Wilk Cc: Claire Chang Cc: Christoph Hellwig Cc: Robin Murphy Fixes: ad6c00283163 ("swiotlb: Free tbl memory in swiotlb_exit()") Suggested-by: Nicholas Piggin Reported-by: Sachin Sant Tested-by: Sachin Sant Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/1905CD70-7656-42AE-99E2-A31FC3812EAC@linux.vnet.ibm.com/ Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 342f43af70dbc74f8629381998f92c060e1763a2 Author: Maurizio Lombardi Date: Thu Jul 29 15:52:50 2021 +0200 iscsi_ibft: fix crash due to KASLR physical memory remapping Starting with commit a799c2bd29d1 ("x86/setup: Consolidate early memory reservations") memory reservations have been moved earlier during the boot process, before the execution of the Kernel Address Space Layout Randomization code. setup_arch() calls the iscsi_ibft's find_ibft_region() function to find and reserve the memory dedicated to the iBFT and this function also saves a virtual pointer to the iBFT table for later use. The problem is that if KALSR is active, the physical memory gets remapped somewhere else in the virtual address space and the pointer is no longer valid, this will cause a kernel panic when the iscsi driver tries to dereference it. iBFT detected. BUG: unable to handle page fault for address: ffff888000099fd8 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI ..snip.. Call Trace: ? ibft_create_kobject+0x1d2/0x1d2 [iscsi_ibft] do_one_initcall+0x44/0x1d0 ? kmem_cache_alloc_trace+0x119/0x220 do_init_module+0x5c/0x270 __do_sys_init_module+0x12e/0x1b0 do_syscall_64+0x40/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Fix this bug by saving the address of the physical location of the ibft; later the driver will use isa_bus_to_virt() to get the correct virtual address. N.B. On each reboot KASLR randomizes the virtual addresses so assuming phys_to_virt before KASLR does its deed is incorrect. Simplify the code by renaming find_ibft_region() to reserve_ibft_region() and remove all the wrappers. Signed-off-by: Maurizio Lombardi Reviewed-by: Mike Rapoport Signed-off-by: Konrad Rzeszutek Wilk commit 4b77f1dff5a67bbae9ec44ab97c1e354d893d975 Author: Iskren Chernev Date: Fri Jul 23 22:23:52 2021 +0300 drivers: qcom: pinctrl: Add pinctrl driver for sm6115 Based on CAF implementation with egpio/wake_reg support removed. Similar function names were merged to reduce total number of functions. Signed-off-by: Iskren Chernev Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210723192352.546902-3-iskren.chernev@gmail.com Signed-off-by: Linus Walleij commit d1945f6c5bf82e9eb477565f3496396db4f4d6e5 Author: Iskren Chernev Date: Fri Jul 23 22:23:51 2021 +0300 dt-bindings: pinctrl: qcom: Add SM6115 pinctrl bindings Add device tree binding Documentation details for Qualcomm SM6115 and SM4250 pinctrl. Signed-off-by: Iskren Chernev Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210723192352.546902-2-iskren.chernev@gmail.com Signed-off-by: Linus Walleij commit 853bc39570853a42dfe5d6071d46bb7c69430584 Author: Cai Huoqing Date: Tue Jul 27 13:21:07 2021 +0800 drm/pl111: Remove unused including Remove including that don't need it. Signed-off-by: Cai Huoqing Acked-by: Randy Dunlap Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727052107.659-1-caihuoqing@baidu.com commit d39e8b92c34113e0e406c9853d655b1350a15624 Merge: d2e11fd2b7fcd ab0720ce227cc Author: Jakub Kicinski Date: Sat Jul 31 11:23:25 2021 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Andrii Nakryiko says: ==================== bpf-next 2021-07-30 We've added 64 non-merge commits during the last 15 day(s) which contain a total of 83 files changed, 5027 insertions(+), 1808 deletions(-). The main changes are: 1) BTF-guided binary data dumping libbpf API, from Alan. 2) Internal factoring out of libbpf CO-RE relocation logic, from Alexei. 3) Ambient BPF run context and cgroup storage cleanup, from Andrii. 4) Few small API additions for libbpf 1.0 effort, from Evgeniy and Hengqi. 5) bpf_program__attach_kprobe_opts() fixes in libbpf, from Jiri. 6) bpf_{get,set}sockopt() support in BPF iterators, from Martin. 7) BPF map pinning improvements in libbpf, from Martynas. 8) Improved module BTF support in libbpf and bpftool, from Quentin. 9) Bpftool cleanups and documentation improvements, from Quentin. 10) Libbpf improvements for supporting CO-RE on old kernels, from Shuyi. 11) Increased maximum cgroup storage size, from Stanislav. 12) Small fixes and improvements to BPF tests and samples, from various folks. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (64 commits) tools: bpftool: Complete metrics list in "bpftool prog profile" doc tools: bpftool: Document and add bash completion for -L, -B options selftests/bpf: Update bpftool's consistency script for checking options tools: bpftool: Update and synchronise option list in doc and help msg tools: bpftool: Complete and synchronise attach or map types selftests/bpf: Check consistency between bpftool source, doc, completion tools: bpftool: Slightly ease bash completion updates unix_bpf: Fix a potential deadlock in unix_dgram_bpf_recvmsg() libbpf: Add btf__load_vmlinux_btf/btf__load_module_btf tools: bpftool: Support dumping split BTF by id libbpf: Add split BTF support for btf__load_from_kernel_by_id() tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id() tools: Free BTF objects at various locations libbpf: Rename btf__get_from_id() as btf__load_from_kernel_by_id() libbpf: Rename btf__load() as btf__load_into_kernel() libbpf: Return non-null error on failures in libbpf_find_prog_btf_id() bpf: Emit better log message if bpf_iter ctx arg btf_id == 0 tools/resolve_btfids: Emit warnings and patch zero id for missing symbols bpf: Increase supported cgroup storage value size libbpf: Fix race when pinning maps in parallel ... ==================== Link: https://lore.kernel.org/r/20210730225606.1897330-1-andrii@kernel.org Signed-off-by: Jakub Kicinski commit 32ce3b320343acf8871c63b98e72778f5f60cefc Author: Douglas Anderson Date: Fri Jul 30 08:46:05 2021 -0700 drm/panel: atna33xc20: Introduce the Samsung ATNA33XC20 panel The Samsung ATNA33XC20 panel is an AMOLED eDP panel that has backlight control over the DP AUX channel. This panel is _almost_ able to be controlled in a "simple" way (and it originally was implemented in panel-simple.c), but it's really impossible to get the backlight semantics right there without adding wacky special-case code to panel-simple. Let's give up and clone the parts of panel-simple that we need and implement the power sequence that this panel needs. NOTE: we'll still leave the devicetree bindings alone. Even though the power-sequencing is non-standard the bindings are still "simple". Signed-off-by: Douglas Anderson Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.6.I3a2900080f8749d2bb4baf49ca902db4b0e1df7d@changeid commit 81c3212dd5fbd5274e673c4fb3bf60879d020b35 Author: Douglas Anderson Date: Fri Jul 30 08:46:04 2021 -0700 Revert "drm/panel-simple: Support for delays between GPIO & regulator" This reverts commit 18a1488bf1e13fc3fc96d7948466b2166067c6c8. Those delays were added to support the Samsung ATNA33XC20 panel. However, we've moving that to its own panel driver and out of panel-simple. That means we don't need the ability to specify this delay. NOTE: it's unlikely we want to keep this delay "just in case" some other panel needs it. The enable-gpio and the power supply are really supposed to be different ways to specify the same thing: the main enable of the panel. Supporting a delay between them doesn't really make sense. Signed-off-by: Douglas Anderson Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.5.Ie44e3e5b7a926392541d575ca84c56931596513f@changeid commit 7c4125b093d5e20d1c074fa160c8f07d9a72c435 Author: Douglas Anderson Date: Fri Jul 30 08:46:03 2021 -0700 Revert "drm/panel-simple: Add Samsung ATNA33XC20" This reverts commit 4bfe6c8f7c23b01719671b69fd29b87a35ccd9d6. This panel's power sequencing really can't be handled properly by panel-simple because of the special sequencing needed for the EL_ON3 GPIO. The only way it was sorta working in the past was by trying to jam that signal into the "enable-gpio", but that really wasn't a good fit. We'll add a custom panel driver for this panel to do it right. Signed-off-by: Douglas Anderson Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.4.Id9f076ec5f35633f8ce931051af268a04c45c075@changeid commit e183bf31cf0d3a05162e633e428350ed176ce926 Author: Douglas Anderson Date: Fri Jul 30 08:46:02 2021 -0700 drm/bridge: ti-sn65dsi86: Add some 100 us delays The manual has always said that we need 100 us delays in a few places. Though it hasn't seemed to be a big deal to skip these, let's add them in case it makes something happier. NOTE: this fixes no known issues but it seems good to make it right. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Douglas Anderson Acked-by: Robert Foss Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.3.I842d483139531aa4651da8338512fdf0171ff23c@changeid commit acb06210b096830e28e9ffd2c6501fe99bdb10fd Author: Douglas Anderson Date: Fri Jul 30 08:46:01 2021 -0700 drm/bridge: ti-sn65dsi86: Fix power off sequence When testing with a panel that's apparently a little more persnickety about the correct power sequence (specifically Samsung ATNA33XC20), we found that the ti-sn65dsi86 was doing things just slightly wrong. Looking closely at the ti-sn65dsi86's datasheet, the power off sequence is supposed to be: 1. Clear VSTREAM_ENABLE bit 2. Stop DSI stream from GPU. DSI lanes must be placed in LP11 state. 3. Program the ML_TX_MODE to 0x0 (OFF) 4. Program the DP_NUM_LANES register to 0x0 5. Clear the DP_PLL_EN bit. 6. Deassert the EN pin. 7. Remove power from supply pins Since we were doing the whole sequence in the "disable", I believe that step #2 (stopping the DSI stream from the GPU) wasn't happening. We also weren't setting DP_NUM_LANES to 0. Let's fix this. NOTE: things are a little asymmetric now. For instance, we turn the PLL on in "enable" but now we're not turning it off until "post_disable". It would seem to make sense to move the PLL turning on to "pre_enable" to match. Unfortunately, I don't believe that's allowed. It looks as if (in the non-refclk mode which probably nobody is using) we have to wait until the MIPI clock is there before we can enable the PLL. In any case, the way it is here won't really hurt--it'll just leave the PLL on a little longer. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Douglas Anderson Acked-by: Robert Foss Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.2.If8a8ec3bf1855cf0dbb62c005a71d6698c99c125@changeid commit 64c0274fb15c1daf6618f5f4d2b3ed80822e5e8d Author: Douglas Anderson Date: Fri Jul 30 08:46:00 2021 -0700 drm/dp: Don't zero PWMGEN_BIT_COUNT when driver_pwm_freq_hz not specified The function drm_edp_backlight_init() is defined such that the "driver_pwm_freq_hz" parameter is optional--it's 0 if you don't want to futz with it. If you follow this variable through, you'll find out that if it's 0 we won't ever set the "bl->pwmgen_bit_count", leaving it as 0. That means that before using it in drm_edp_backlight_enable() we need to check to see if it's non-zero. Programming this field to zero was confusing the panel I tested with (Samsung ATNA33XC20). The backlight still worked somewhat but the brightness values didn't correspond to what they should have been. Fixes: 867cf9cd73c3 ("drm/dp: Extract i915's eDP backlight code into DRM helpers") Signed-off-by: Douglas Anderson Reviewed-by: Sean Paul Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.1.If017efce7116ae8ba015ed7def840c390a0e0c77@changeid commit 6a25893cb0e255ab8888d6a4f40e8d1e9d554ad0 Author: Théo Borém Fabris Date: Sat Jul 24 19:02:00 2021 -0300 iio: dac: max5821: convert device register to device managed function Add a device managed hook, via devm_add_action_or_reset() and max5821_regulator_disable(), to disable voltage regulator on device detach. Replace iio_device_register() by devm_iio_device_register() and remove the max5821_remove() function used to unregister the device and disable the voltage regulator. Remove i2c_set_clientdata() from the probe function, since i2c_get_clientdata() is not used anymore. Remove regulator_disable() calls from the probe function. Signed-off-by: Théo Borém Fabris Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210724220159.11998-1-theobf@usp.br Signed-off-by: Jonathan Cameron commit eaaa23d71ebf0c598eedb81d4a814b0a475273f6 Author: Christophe Branchereau Date: Mon Jul 26 10:20:33 2021 +0200 dt-bindings: iio/adc: ingenic: add the JZ4760(B) socs to the sadc Documentation Add both the jz4760 and jz4760b, plus a property to use the internal divider on the b variant and document it. Signed-off-by: Christophe Branchereau Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210726082033.351533-6-cbranchereau@gmail.com Signed-off-by: Jonathan Cameron commit bf1b2418c2f56a81f405925b10a02c25681179cd Author: Christophe Branchereau Date: Mon Jul 26 10:20:32 2021 +0200 iio/adc: ingenic: add JZ4760B support to the sadc driver The JZ4760B variant differs slightly from the JZ4760: it has a bit called VBAT_SEL in the CFG register. In order to correctly sample the battery voltage on existing handhelds using this SOC, the bit must be cleared. We leave the possibility to set the bit, by using the "ingenic,use-internal-divider" in the devicetree. Signed-off-by: Christophe Branchereau Link: https://lore.kernel.org/r/20210726082033.351533-5-cbranchereau@gmail.com Signed-off-by: Jonathan Cameron commit b9e9bdd425a3c99e15f5dfd465bef936130b7491 Author: Christophe Branchereau Date: Mon Jul 26 10:20:31 2021 +0200 iio/adc: ingenic: add JZ4760 support to the sadc driver The jz4760 sadc is very similar to the jz4770 one, but has a VREF of 2.5V and 3 aux channels. modify ingenic_adc_read_chan_info_raw() needs a change to account for it. Signed-off-by: Christophe Branchereau Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20210726082033.351533-4-cbranchereau@gmail.com Signed-off-by: Jonathan Cameron commit d827cbcdb34e1972e31cf7e603410c05de584ca9 Author: Christophe Branchereau Date: Mon Jul 26 10:20:30 2021 +0200 dt-bindings: iio/adc: add an INGENIC_ADC_AUX0 entry The JZ4760(B) socs have 3 AUX inputs, add an entry to prepare including the one named AUX in the sadc driver. Leaving the rest untouched as it's ABI. Signed-off-by: Christophe Branchereau Reviewed-by: Paul Cercueil Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210726082033.351533-3-cbranchereau@gmail.com Signed-off-by: Jonathan Cameron commit 9c5eb724f96f8d15226d7500d9412737598930f1 Author: Christophe Branchereau Date: Mon Jul 26 10:20:29 2021 +0200 iio/adc: ingenic: rename has_aux2 to has_aux_md The jz4760(b) socs have 3 aux channels. The purpose of has_aux2 is to set the MD bits used to select the AUX channel to be sampled, not to describe the hardware. Rename it to a more appropriate name. Signed-off-by: Christophe Branchereau Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20210726082033.351533-2-cbranchereau@gmail.com Signed-off-by: Jonathan Cameron commit d2e11fd2b7fcd10b7bcef418c55490c934aa94e8 Merge: aae950b189413 c7d1022326492 Author: Jakub Kicinski Date: Sat Jul 31 09:14:46 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Conflicting commits, all resolutions pretty trivial: drivers/bus/mhi/pci_generic.c 5c2c85315948 ("bus: mhi: pci-generic: configurable network interface MRU") 56f6f4c4eb2a ("bus: mhi: pci_generic: Apply no-op for wake using sideband wake boolean") drivers/nfc/s3fwrn5/firmware.c a0302ff5906a ("nfc: s3fwrn5: remove unnecessary label") 46573e3ab08f ("nfc: s3fwrn5: fix undefined parameter values in dev_err()") 801e541c79bb ("nfc: s3fwrn5: fix undefined parameter values in dev_err()") MAINTAINERS 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver") 8a7b46fa7902 ("MAINTAINERS: add Yasushi SHOJI as reviewer for the Microchip CAN BUS Analyzer Tool driver") Signed-off-by: Jakub Kicinski commit 192f4ee3e408553992c48d35f1786679476704a6 Author: Akhil P Oommen Date: Fri Jul 30 01:21:25 2021 +0530 drm/msm/a6xx: Add support for Adreno 7c Gen 3 gpu This patch adds support for the gpu found in the Snapdragon 7c Gen 3 compute platform. This gpu is similar to the exisiting a660 gpu with minor delta in the programing sequence. As the Adreno GPUs are moving away from a numeric chipid based naming scheme to a string, it was decided to use 0x06030500 as the chip id of this gpu to communicate to the userspace driver. Signed-off-by: Akhil P Oommen Link: https://lore.kernel.org/r/20210730011945.v4.3.I610377db0934b6b7deda532ec2bf786a02c38c01@changeid Signed-off-by: Rob Clark commit 27514ce2e78e9c0225f10a15867502516df12174 Author: Akhil P Oommen Date: Fri Jul 30 01:21:24 2021 +0530 drm/msm/a6xx: Use rev to identify SKU Use rev instead of revn to identify the SKU. This is in preparation to the introduction of 7c3 gpu which won't have a revn. Signed-off-by: Akhil P Oommen Link: https://lore.kernel.org/r/20210730011945.v4.2.I286ef007fcadd9e6ee3b2c0ad948f990735f9610@changeid Signed-off-by: Rob Clark commit a6f24383f6c0a8d64d1f6afa10733ae4e8f236e0 Author: Akhil P Oommen Date: Fri Jul 30 01:21:23 2021 +0530 drm/msm/a6xx: Fix llcc configuration for a660 gpu Add the missing scache_cntl0 register programing which is required for a660 gpu. Signed-off-by: Akhil P Oommen Link: https://lore.kernel.org/r/20210730011945.v4.1.I110b87677ef16d97397fb7c81c07a16e1f5d211e@changeid Signed-off-by: Rob Clark commit 7a3605bef87801bc7c86e23c608bd2d096433966 Author: Gwendal Grignou Date: Wed Jul 28 11:17:57 2021 -0700 iio: sx9310: Support ACPI property Use device_property_read_... to support both device tree and ACPI bindings. Simplify the logic for reading "combined-sensors" array, as we assume it has been vetted at firmware build time. Signed-off-by: Gwendal Grignou Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210728181757.187627-1-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 825a52482a616d74bd2f5eacc0f8946d025499a7 Author: Takashi Iwai Date: Sat Jul 31 10:34:46 2021 +0200 ALSA: core: Fix double calls of snd_card_free() via devres At the transition to the devres-managed card release, we've put the check of double-free at trigger_card_release(). But this wasn't enough, as the code path calls snd_card_free() again, and it would lead to the doubly snd_card_free() calls. Actually the v1 patch was correct to handle this, but I forgot that corner case and moved the check to the more obvious place as I thought it's clearer. But, as usual, devils live in details. This patch corrects the check of the double-free to the right place, with a bit more comments. Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") Link: https://lore.kernel.org/r/20210731083446.26680-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit fac24b0f34c179c6ca863f5205fad42a676caf9a Author: Jason Wang Date: Sat Jul 31 13:26:47 2021 +0800 ALSA: pcxhr: use __func__ to get funcion's name in an output message Prefer using '"%s...", __func__' to get current function's name in an output message. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20210731052647.141046-1-wangborong@cdjrlc.com Signed-off-by: Takashi Iwai commit 5f1fc9726ff7936f5606eac7f57e4ff856ca14b6 Merge: 2734d6c1b1a08 d28b1e03dc8d1 Author: Stephen Boyd Date: Sat Jul 31 00:57:03 2021 -0700 Merge tag 'renesas-clk-for-v5.15-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 display (DU and DSI) clocks on R-Car V3U - Add I2C, DMAC, USB, sound (SSIF-2), GPIO, CANFD, and ADC clocks and resets on RZ/G2L - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r9a07g044: Add entry for fixed clock P0_DIV2 dt-bindings: clock: r9a07g044-cpg: Add entry for P0_DIV2 core clock clk: renesas: r9a07g044: Add clock and reset entries for ADC clk: renesas: r9a07g044: Add clock and reset entries for CANFD clk: renesas: Rename renesas-rzg2l-cpg.[ch] to rzg2l-cpg.[ch] clk: renesas: r9a07g044: Add GPIO clock and reset entries clk: renesas: r9a07g044: Add SSIF-2 clock and reset entries clk: renesas: r9a07g044: Add USB clocks/resets clk: renesas: r9a07g044: Add DMAC clocks/resets clk: renesas: r9a07g044: Add I2C clocks/resets clk: renesas: r8a779a0: Add the DSI clocks clk: renesas: r8a779a0: Add the DU clock clk: renesas: rzg2: Rename i2c-dvfs to iic-pmic clk: renesas: rzg2l: Fix off-by-one check in rzg2l_cpg_clk_src_twocell_get() clk: renesas: rzg2l: Avoid mixing error pointers and NULL clk: renesas: rzg2l: Fix a double free on error clk: renesas: rzg2l: Fix return value and unused assignment clk: renesas: rzg2l: Remove unneeded semicolon commit fc577e46eb96b9c2d767c13801591f7a7e27d853 Author: Phillip Potter Date: Sat Jul 31 01:39:37 2021 +0100 staging: r8188eu: remove include/odm_debug.h Remove include/odm_debug.h in its entirety. To do this, first: (1) Remove DebugLevel and DebugComponents members from the struct odm_dm_struct definition, and any uses of these elsewhere in the driver. (2) Remove the function ODM_InitDebugSetting from hal/odm_debug.c whilst leaving the file in place for now as it contains a global which is still used and will be removed by further cleanup code. Also remove all of its callers. All the function does is set the members mentioned above. (3) Remove the now redundant constants and their usages: ODM_CMNINFO_DBG_LEVEL ODM_CMNINFO_DBG_COMP HW_DEF_ODM_DBG_FLAG HW_DEF_FA_CNT_DUMP This includes usage within a few hexadecimal ioctl switch cases in os_dep/ioctl_linux.c (although only the call itself within 0x11 as it contains additional code currently). (4) Finally, remove the file itself and its inclusion within include/odm_precomp.h, as none of the remaining content is used from anywhere else in the driver. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-15-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit f8a846911d83e94a59016c72c503b22fcb4483c7 Author: Phillip Potter Date: Sat Jul 31 01:39:36 2021 +0100 staging: r8188eu: remove DbgPrint and RT_PRINTK macro definitions Remove DbgPrint and RT_PRINTK macro definitions from include/odm_debug.h, as they are called from nowhere and are therefore superfluous. Also remove comment in core/rtw_xmit.c referring to DbgPrint so that future confusion is prevented. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-14-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5225e772acd7a69e87e14df99539ac1ab47ff71c Author: Phillip Potter Date: Sat Jul 31 01:39:35 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE macro definition Remove ODM_RT_TRACE macro definition from include/odm_debug.h, as it is called from nowhere and is therefore superfluous. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-13-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit b08c473f3e1534b1f80addc5751daa18321e7124 Author: Phillip Potter Date: Sat Jul 31 01:39:34 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm.c Remove ODM_RT_TRACE calls from hal/odm.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Also remove three empty functions and their calls from hal/odm.c, as they only contained ODM_RT_TRACE calls, and remove the corresponding include/odm_precomp.h declarations. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-12-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit a04e78c3711eddde9706871441a4eaefad3d71f7 Author: Phillip Potter Date: Sat Jul 31 01:39:33 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_RegConfig8188E.c Remove ODM_RT_TRACE calls from hal/odm_RegConfig8188E.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-11-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 40677a39a6dfc61c937ef6344beb41d56b5217f0 Author: Phillip Potter Date: Sat Jul 31 01:39:32 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_RTL8188E.c Remove ODM_RT_TRACE calls from hal/odm_RTL8188E.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-10-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit da232ccb973ac154c1d294ff668eb56fb8dad867 Author: Phillip Potter Date: Sat Jul 31 01:39:31 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_HWConfig.c Remove ODM_RT_TRACE calls from hal/odm_HWConfig.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-9-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 73f1e06f55d44ef1f29feb9d52c04f3d428a3b20 Author: Phillip Potter Date: Sat Jul 31 01:39:30 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/HalPhyRf_8188e.c Remove ODM_RT_TRACE calls from hal/HalPhyRf_8188e.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8bde3b8aaf3d3b4abf3e3f07cf85c377ddc2bbad Author: Phillip Potter Date: Sat Jul 31 01:39:29 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE calls from hal/Hal8188ERateAdaptive.c Remove ODM_RT_TRACE calls from hal/Hal8188ERateAdaptive.c, as by removing these calls in this file and others, we can ultimately then remove the macro definition itself, which does not follow best practice. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8362f65afa3391ba71786114983da7b485876db0 Author: Phillip Potter Date: Sat Jul 31 01:39:28 2021 +0100 staging: r8188eu: remove ASSERT ifndef and macro definition Remove ASSERT ifndef and macro definition from include/odm_debug.h, as these are unused and therefore superfluous. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6a772eabd4014bf7d846a9a661016e9c1deb1dd6 Author: Phillip Potter Date: Sat Jul 31 01:39:27 2021 +0100 staging: r8188eu: remove ODM_RT_TRACE_F macro definition Remove ODM_RT_TRACE_F macro definition from include/odm_debug.h, as it is called from nowhere and is therefore superfluous. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit c32641183bbcf6c000f114c010085c72b15a8796 Author: Phillip Potter Date: Sat Jul 31 01:39:26 2021 +0100 staging: r8188eu: remove ODM_RT_ASSERT macro definition and caller Remove ODM_RT_ASSERT macro definition from include/odm_debug.h and its one caller in hal/odm.c, as this debug code is against best practice. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6a6580673e0b65c45b1bf1e0c866be5de998e1dc Author: Phillip Potter Date: Sat Jul 31 01:39:25 2021 +0100 staging: r8188eu: remove ODM_dbg_* macro definitions Remove ODM_dbg_* macro definitions from include/odm_debug.h, as they are called from nowhere and are therefore superfluous. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 15e4539f58c4b96a7706cab77e58941ca7eb4748 Author: Phillip Potter Date: Sat Jul 31 01:39:24 2021 +0100 staging: r8188eu: remove ODM_PRINT_ADDR macro definition Remove ODM_PRINT_ADDR macro definition from include/odm_debug.h, as it is called from nowhere and is therefore superfluous. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210731003937.68615-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit bf99a7ce2f2f159ffc18749407df526ad469e9a8 Author: Michael Straube Date: Fri Jul 30 22:41:53 2021 +0200 staging: r8188eu: add missing spaces after ',' and before braces Add missing spaces to clear checkpatch errors. ERROR: space required before the open parenthesis '(' ERROR: space required before the open brace '{' ERROR: space required after that ',' (ctx:ExV) Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730204153.27270-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 33852468aa6447fef16c9c3ec79298c8878b7998 Author: Michael Straube Date: Fri Jul 30 22:41:52 2021 +0200 staging: r8188eu: remove spaces before ',' and ')' Remove spaces to clear checkpatch errors. ERROR: space prohibited before that ',' (ctx:WxW) ERROR: space prohibited before that close parenthesis ')' Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730204153.27270-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56febcc2595e2bf2546c5bb4c35740ce883771a2 Author: Fabio M. De Francesco Date: Fri Jul 30 20:14:52 2021 +0200 staging: r8188eu: Fix different base types in assignments and parameters Fix sparse warnings of different base types in assignments and in passing function parameters. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210730181452.23062-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1084514ca9aa5b3fcc485b378b92b632918237f4 Author: Vincent Palomares Date: Tue Jul 27 18:27:43 2021 -0700 scsi: ufs: Allow async suspend/resume callbacks Allow UFS suspend/resume callbacks to run in parallel with other suspend/resume callbacks. This can recoup dozens of milliseconds on the resume path if UFS hardware needs to be powered back on. Suspending and resuming asynchronously is safe to do so long as the driver callbacks only depend on resources made available by either a) parent devices or b) devices explicitly marked as suppliers with device_link_add. Link: https://lore.kernel.org/r/20210728012743.1063928-1-paillon@google.com Cc: Bjorn Helgaas Cc: Jaegeuk Kim Cc: Bart Van Assche Cc: Adrian Hunter Cc: Stanley Chu Cc: Can Guo Cc: Asutosh Das Cc: Avri Altman Cc: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Vincent Palomares Signed-off-by: Martin K. Petersen commit 7740b615b6665e47f162e261d805f1bbbac15876 Author: James Smart Date: Fri Jul 30 09:33:09 2021 -0700 scsi: lpfc: Fix possible ABBA deadlock in nvmet_xri_aborted() The lpfc_sli4_nvmet_xri_aborted() routine takes out the abts_buf_list_lock and traverses the buffer contexts to match the xri. Upon match, it then takes the context lock before potentially removing the context from the associated buffer list. This violates the lock hierarchy used elsewhere in the driver of locking context, then the abts_buf_list_lock - thus a possible deadlock. Resolve by: after matching, release the abts_buf_list_lock, then take the context lock, and if to be deleted from the list, retake the abts_buf_list_lock, maintaining lock hierarchy. This matches same list lock hierarchy as elsewhere in the driver Link: https://lore.kernel.org/r/20210730163309.25809-1-jsmart2021@gmail.com Reported-by: Jia-Ju Bai Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 0f783c2d640ac03ad3bb3ba6b7a1287ddf18031d Author: Colin Ian King Date: Thu Jul 29 09:24:13 2021 +0100 scsi: qla2xxx: Fix spelling mistakes "allloc" -> "alloc" There are two spelling mistakes with the same triple l in alloc, one in a comment, the other in a ql_dbg() debug message. Fix them. Link: https://lore.kernel.org/r/20210729082413.4761-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 75ca56409e5b35aa6ceef94462f39ef4f533fc41 Author: Christoph Hellwig Date: Thu Jul 29 08:48:45 2021 +0200 scsi: bsg: Move the whole request execution into the SCSI/transport handlers Remove the amount of indirect calls by making the handler responsible for the entire execution of the request. Link: https://lore.kernel.org/r/20210729064845.1044147-5-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 1e61c1a804d2a2a3c46add01cac3a6e9eca01080 Author: Christoph Hellwig Date: Thu Jul 29 08:48:44 2021 +0200 scsi: block: Remove the remaining SG_IO-related fields from struct request_queue Move the sg_timeout and sg_reserved_size fields into the bsg_device and scsi_device structures as they have nothing to do with generic block I/O. Note that these values are now separate for bsg vs. SCSI device node access, but that just matches how /dev/sg vs the other nodes has always behaved. Link: https://lore.kernel.org/r/20210729064845.1044147-4-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit cf93a27446fe1a6e0acb9bbedf5fce1e98e4fc5b Author: Christoph Hellwig Date: Thu Jul 29 08:48:43 2021 +0200 scsi: block: Remove BLK_SCSI_MAX_CMDS This was used for the table based SCSI passthough permission checking that is gone now. Link: https://lore.kernel.org/r/20210729064845.1044147-3-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit ead09dd3aed5cc6a6c6288a87a5bfa9bbc8d5ecf Author: Christoph Hellwig Date: Thu Jul 29 08:48:42 2021 +0200 scsi: bsg: Simplify device registration Use the per-device cdev_device_interface to store the bsg data in the char device inode, and thus remove the need to embedd the bsg_class_device structure in the request_queue. Link: https://lore.kernel.org/r/20210729064845.1044147-2-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit ba51bdafaafc065019c6f6a2cdae006d176cee48 Author: Christoph Hellwig Date: Mon Jul 5 15:02:43 2021 +0200 scsi: sr: cdrom: Move cdrom_read_cdda_bpc() into the sr driver cdrom_read_cdda_bpc() relies on sending SCSI command to the low level driver using a REQ_OP_SCSI_IN request. This isn't generic block layer functionality, so move the actual low-level code into the sr driver and call it through a new read_cdda_bpc method in the cdrom_device_ops structure. With this the CDROM code does not have to pull in scsi_normalize_sense() and depend on CONFIG_SCSI_COMMON. Link: https://lore.kernel.org/r/20210730072752.GB23847%40lst.de Tested-by: Anders Roxell Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 3989de0ef562a9168782258f3c6d2f517d82bbed Author: Lucas De Marchi Date: Fri Jul 30 12:11:15 2021 -0700 drm/i915/xehp: Fix missing sentinel on mcr_ranges_xehp There's a missing sentinel since we are not using ARRAY_SIZE(), but rather checking that the .start is 0 to stop the iteration in mcr_range(). BUG: KASAN: global-out-of-bounds in mcr_range.isra.0+0x69/0xa0 [i915] Read of size 4 at addr ffffffffa0889928 by task modprobe/3881 Fixes: d8905ba705ab ("drm/i915/xehp: Define multicast register ranges") Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210730191115.2514581-1-lucas.demarchi@intel.com commit ab0720ce227cc54a2b841dc3c926ed83a819e4fb Merge: 0b84644598589 475a23c2c15fb Author: Andrii Nakryiko Date: Fri Jul 30 15:40:28 2021 -0700 Merge branch 'tools: bpftool: update, synchronise and validate types and options' Quentin Monnet says: ==================== To work with the different program types, map types, attach types etc. supported by eBPF, bpftool needs occasional updates to learn about the new features supported by the kernel. When such types translate into new keyword for the command line, updates are expected in several locations: typically, the help message displayed from bpftool itself, the manual page, and the bash completion file should be updated. The options used by the different commands for bpftool should also remain synchronised at those locations. Several omissions have occurred in the past, and a number of types are still missing today. This set is an attempt to improve the situation. It brings up-to-date the lists of types or options in bpftool, and also adds a Python script to the BPF selftests to automatically check that most of these lists remain synchronised. v2: - Reformat some lines in the bash completion file. - Do not reformat attach types, to preserve git-blame history. - Do not call Python script from tools/testing/selftests/bpf/Makefile. ==================== Signed-off-by: Andrii Nakryiko commit 475a23c2c15fb2af76a27f89f632a48c03166f45 Author: Quentin Monnet Date: Fri Jul 30 22:54:35 2021 +0100 tools: bpftool: Complete metrics list in "bpftool prog profile" doc Profiling programs with bpftool was extended some time ago to support two new metrics, namely itlb_misses and dtlb_misses (misses for the instruction/data translation lookaside buffer). Update the manual page and bash completion accordingly. Fixes: 450d060e8f75 ("bpftool: Add {i,d}tlb_misses support for bpftool profile") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-8-quentin@isovalent.com commit 8cc8c6357c8fa763c650f1bddb69871a254f427c Author: Quentin Monnet Date: Fri Jul 30 22:54:34 2021 +0100 tools: bpftool: Document and add bash completion for -L, -B options The -L|--use-loader option for using loader programs when loading, or when generating a skeleton, did not have any documentation or bash completion. Same thing goes for -B|--base-btf, used to pass a path to a base BTF object for split BTF such as BTF for kernel modules. This patch documents and adds bash completion for those options. Fixes: 75fa1777694c ("tools/bpftool: Add bpftool support for split BTF") Fixes: d510296d331a ("bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command.") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-7-quentin@isovalent.com commit da87772f086fc40e0ced9deb939400b09a182194 Author: Quentin Monnet Date: Fri Jul 30 22:54:33 2021 +0100 selftests/bpf: Update bpftool's consistency script for checking options Update the script responsible for checking that the different types used at various places in bpftool are synchronised, and extend it to check the consistency of options between the help messages in the source code and the manual pages. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-6-quentin@isovalent.com commit c07ba629df97b796ca7bbdfbf4748266ead27745 Author: Quentin Monnet Date: Fri Jul 30 22:54:32 2021 +0100 tools: bpftool: Update and synchronise option list in doc and help msg All bpftool commands support the options for JSON output and debug from libbpf. In addition, some commands support additional options corresponding to specific use cases. The list of options described in the man pages for the different commands are not always accurate. The messages for interactive help are mostly limited to HELP_SPEC_OPTIONS, and are even less representative of the actual set of options supported for the commands. Let's update the lists: - HELP_SPEC_OPTIONS is modified to contain the "default" options (JSON and debug), and to be extensible (no ending curly bracket). - All commands use HELP_SPEC_OPTIONS in their help message, and then complete the list with their specific options. - The lists of options in the man pages are updated. - The formatting of the list for bpftool.rst is adjusted to match formatting for the other man pages. This is for consistency, and also because it will be helpful in a future patch to automatically check that the files are synchronised. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-5-quentin@isovalent.com commit b544342e52fc3dfcc1d430fff8d1a7a3be920ffd Author: Quentin Monnet Date: Fri Jul 30 22:54:31 2021 +0100 tools: bpftool: Complete and synchronise attach or map types Update bpftool's list of attach type names to tell it about the latest attach types, or the "ringbuf" map. Also update the documentation, help messages, and bash completion when relevant. These missing items were reported by the newly added Python script used to help maintain consistency in bpftool. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-4-quentin@isovalent.com commit a2b5944fb4e05d6fe032ab130bfd1738481b892a Author: Quentin Monnet Date: Fri Jul 30 22:54:30 2021 +0100 selftests/bpf: Check consistency between bpftool source, doc, completion Whenever the eBPF subsystem gains new elements, such as new program or map types, it is necessary to update bpftool if we want it able to handle the new items. In addition to the main arrays containing the names of these elements in the source code, there are also multiple locations to update: - The help message in the do_help() functions in bpftool's source code. - The RST documentation files. - The bash completion file. This has led to omissions multiple times in the past. This patch attempts to address this issue by adding consistency checks for all these different locations. It also verifies that the bpf_prog_type, bpf_map_type and bpf_attach_type enums from the UAPI BPF header have all their members present in bpftool. The script requires no argument to run, it reads and parses the different files to check, and prints the mismatches, if any. It currently reports a number of missing elements, which will be fixed in a later patch: $ ./test_bpftool_synctypes.py Comparing [...]/linux/tools/bpf/bpftool/map.c (map_type_name) and [...]/linux/tools/bpf/bpftool/bash-completion/bpftool (BPFTOOL_MAP_CREATE_TYPES): {'ringbuf'} Comparing BPF header (enum bpf_attach_type) and [...]/linux/tools/bpf/bpftool/common.c (attach_type_name): {'BPF_TRACE_ITER', 'BPF_XDP_DEVMAP', 'BPF_XDP', 'BPF_SK_REUSEPORT_SELECT', 'BPF_XDP_CPUMAP', 'BPF_SK_REUSEPORT_SELECT_OR_MIGRATE'} Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/prog.c (do_help() ATTACH_TYPE): {'skb_verdict'} Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/Documentation/bpftool-prog.rst (ATTACH_TYPE): {'skb_verdict'} Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/bash-completion/bpftool (BPFTOOL_PROG_ATTACH_TYPES): {'skb_verdict'} Note that the script does NOT check for consistency between the list of program types that bpftool claims it accepts and the actual list of keywords that can be used. This is because bpftool does not "see" them, they are ELF section names parsed by libbpf. It is not hard to parse the section_defs[] array in libbpf, but some section names are associated with program types that bpftool cannot load at the moment. For example, some programs require a BTF target and an attach target that bpftool cannot handle. The script may be extended to parse the array and check only relevant values in the future. The script is not added to the selftests' Makefile, because doing so would require all patches with BPF UAPI change to also update bpftool. Instead it is to be added to the CI. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-3-quentin@isovalent.com commit 510b4d4c5d4cbfdeaf35e4bc6483e8afa16b0e9e Author: Quentin Monnet Date: Fri Jul 30 22:54:29 2021 +0100 tools: bpftool: Slightly ease bash completion updates Bash completion for bpftool gets two minor improvements in this patch. Move the detection of attach types for "bpftool cgroup attach" outside of the "case/esac" bloc, where we cannot reuse our variable holding the list of supported attach types as a pattern list. After the change, we have only one list of cgroup attach types to update when new types are added, instead of the former two lists. Also rename the variables holding lists of names for program types, map types, and attach types, to make them more unique. This can make it slightly easier to point people to the relevant variables to update, but the main objective here is to help run a script to check that bash completion is up-to-date with bpftool's source code. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730215435.7095-2-quentin@isovalent.com commit d92df42d7685445a2b6c815d9230d9699d9d400b Author: Cédric Le Goater Date: Thu Jul 1 15:27:50 2021 +0200 genirq: Improve "hwirq" output in /proc and /sys/ The HW IRQ numbers generated by the PCI MSI layer can be quite large on a pSeries machine when running under the IBM Hypervisor and they appear as negative. Use '%lu' instead to show them correctly. Signed-off-by: Cédric Le Goater Signed-off-by: Thomas Gleixner commit aae950b189413ed3201354600d44223da0bcf63c Merge: a432934a30679 26713455048eb Author: Jakub Kicinski Date: Fri Jul 30 13:16:40 2021 -0700 Merge branch 'clean-devlink-net-namespace-operations' Leon Romanovsky says: ==================== Clean devlink net namespace operations This short series continues my work on devlink core code to make devlink reload less prone to errors and harden it from API abuse. Despite first patch being a clear fix, I would ask you to apply it to net-next anyway, because the fixed patch is anyway old and it will help us to eliminate merge conflicts that will arise for following patches or even for the second one. ==================== Link: https://lore.kernel.org/r/cover.1627578998.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit 26713455048eb19122b1561b471d30710177ef97 Author: Leon Romanovsky Date: Thu Jul 29 20:19:25 2021 +0300 devlink: Allocate devlink directly in requested net namespace There is no need in extra call indirection and check from impossible flow where someone tries to set namespace without prior call to devlink_alloc(). Instead of this extra logic and additional EXPORT_SYMBOL, use specialized devlink allocation function that receives net namespace as an argument. Such specialized API allows clear view when devlink initialized in wrong net namespace and/or kernel users don't try to change devlink namespace under the hood. Reviewed-by: Jiri Pirko Signed-off-by: Leon Romanovsky Signed-off-by: Jakub Kicinski commit 05a7f4a8dff19999ca8a83a35ff4782689de7bfc Author: Leon Romanovsky Date: Thu Jul 29 20:19:24 2021 +0300 devlink: Break parameter notification sequence to be before/after unload/load driver The change of namespaces during devlink reload calls to driver unload before it accesses devlink parameters. The commands below causes to use-after-free bug when trying to get flow steering mode. * ip netns add n1 * devlink dev reload pci/0000:00:09.0 netns n1 ================================================================== BUG: KASAN: use-after-free in mlx5_devlink_fs_mode_get+0x96/0xa0 [mlx5_core] Read of size 4 at addr ffff888009d04308 by task devlink/275 CPU: 6 PID: 275 Comm: devlink Not tainted 5.12.0-rc2+ #2853 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack+0x93/0xc2 print_address_description.constprop.0+0x18/0x140 ? mlx5_devlink_fs_mode_get+0x96/0xa0 [mlx5_core] ? mlx5_devlink_fs_mode_get+0x96/0xa0 [mlx5_core] kasan_report.cold+0x7c/0xd8 ? mlx5_devlink_fs_mode_get+0x96/0xa0 [mlx5_core] mlx5_devlink_fs_mode_get+0x96/0xa0 [mlx5_core] devlink_nl_param_fill+0x1c8/0xe80 ? __free_pages_ok+0x37a/0x8a0 ? devlink_flash_update_timeout_notify+0xd0/0xd0 ? lock_acquire+0x1a9/0x6d0 ? fs_reclaim_acquire+0xb7/0x160 ? lock_is_held_type+0x98/0x110 ? 0xffffffff81000000 ? lock_release+0x1f9/0x6c0 ? fs_reclaim_release+0xa1/0xf0 ? lock_downgrade+0x6d0/0x6d0 ? lock_is_held_type+0x98/0x110 ? lock_is_held_type+0x98/0x110 ? memset+0x20/0x40 ? __build_skb_around+0x1f8/0x2b0 devlink_param_notify+0x6d/0x180 devlink_reload+0x1c3/0x520 ? devlink_remote_reload_actions_performed+0x30/0x30 ? mutex_trylock+0x24b/0x2d0 ? devlink_nl_cmd_reload+0x62b/0x1070 devlink_nl_cmd_reload+0x66d/0x1070 ? devlink_reload+0x520/0x520 ? devlink_get_from_attrs+0x1bc/0x260 ? devlink_nl_pre_doit+0x64/0x4d0 genl_family_rcv_msg_doit+0x1e9/0x2f0 ? mutex_lock_io_nested+0x1130/0x1130 ? genl_family_rcv_msg_attrs_parse.constprop.0+0x240/0x240 ? security_capable+0x51/0x90 genl_rcv_msg+0x27f/0x4a0 ? genl_get_cmd+0x3c0/0x3c0 ? lock_acquire+0x1a9/0x6d0 ? devlink_reload+0x520/0x520 ? lock_release+0x6c0/0x6c0 netlink_rcv_skb+0x11d/0x340 ? genl_get_cmd+0x3c0/0x3c0 ? netlink_ack+0x9f0/0x9f0 ? lock_release+0x1f9/0x6c0 genl_rcv+0x24/0x40 netlink_unicast+0x433/0x700 ? netlink_attachskb+0x730/0x730 ? _copy_from_iter_full+0x178/0x650 ? __alloc_skb+0x113/0x2b0 netlink_sendmsg+0x6f1/0xbd0 ? netlink_unicast+0x700/0x700 ? lock_is_held_type+0x98/0x110 ? netlink_unicast+0x700/0x700 sock_sendmsg+0xb0/0xe0 __sys_sendto+0x193/0x240 ? __x64_sys_getpeername+0xb0/0xb0 ? do_sys_openat2+0x10b/0x370 ? __up_read+0x1a1/0x7b0 ? do_user_addr_fault+0x219/0xdc0 ? __x64_sys_openat+0x120/0x1d0 ? __x64_sys_open+0x1a0/0x1a0 __x64_sys_sendto+0xdd/0x1b0 ? syscall_enter_from_user_mode+0x1d/0x50 do_syscall_64+0x2d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc69d0af14a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 15 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 76 c3 0f 1f 44 00 00 55 48 83 ec 30 44 89 4c RSP: 002b:00007ffc1d8292f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007fc69d0af14a RDX: 0000000000000038 RSI: 0000555f57c56440 RDI: 0000000000000003 RBP: 0000555f57c56410 R08: 00007fc69d17b200 R09: 000000000000000c R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 146: kasan_save_stack+0x1b/0x40 __kasan_kmalloc+0x99/0xc0 mlx5_init_fs+0xf0/0x1c50 [mlx5_core] mlx5_load+0xd2/0x180 [mlx5_core] mlx5_init_one+0x2f6/0x450 [mlx5_core] probe_one+0x47d/0x6e0 [mlx5_core] pci_device_probe+0x2a0/0x4a0 really_probe+0x20a/0xc90 driver_probe_device+0xd8/0x380 device_driver_attach+0x1df/0x250 __driver_attach+0xff/0x240 bus_for_each_dev+0x11e/0x1a0 bus_add_driver+0x309/0x570 driver_register+0x1ee/0x380 0xffffffffa06b8062 do_one_initcall+0xd5/0x410 do_init_module+0x1c8/0x760 load_module+0x6d8b/0x9650 __do_sys_finit_module+0x118/0x1b0 do_syscall_64+0x2d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 275: kasan_save_stack+0x1b/0x40 kasan_set_track+0x1c/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0x102/0x140 slab_free_freelist_hook+0x74/0x1b0 kfree+0xd7/0x2a0 mlx5_unload+0x16/0xb0 [mlx5_core] mlx5_unload_one+0xae/0x120 [mlx5_core] mlx5_devlink_reload_down+0x1bc/0x380 [mlx5_core] devlink_reload+0x141/0x520 devlink_nl_cmd_reload+0x66d/0x1070 genl_family_rcv_msg_doit+0x1e9/0x2f0 genl_rcv_msg+0x27f/0x4a0 netlink_rcv_skb+0x11d/0x340 genl_rcv+0x24/0x40 netlink_unicast+0x433/0x700 netlink_sendmsg+0x6f1/0xbd0 sock_sendmsg+0xb0/0xe0 __sys_sendto+0x193/0x240 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0x2d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888009d04300 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 8 bytes inside of 128-byte region [ffff888009d04300, ffff888009d04380) The buggy address belongs to the page: page:0000000086a64ecc refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888009d04000 pfn:0x9d04 head:0000000086a64ecc order:1 compound_mapcount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea0000203980 0000000200000002 ffff8880050428c0 raw: ffff888009d04000 000000008020001d 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888009d04200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888009d04280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888009d04300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888009d04380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888009d04400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== The right solution to devlink reload is to notify about deletion of parameters, unload driver, change net namespaces, load driver and notify about addition of parameters. Fixes: 070c63f20f6c ("net: devlink: allow to change namespaces during reload") Reviewed-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jakub Kicinski commit 0b846445985895e75958ecd59061fd7bf77e0c3f Author: Cong Wang Date: Fri Jul 23 11:36:30 2021 -0700 unix_bpf: Fix a potential deadlock in unix_dgram_bpf_recvmsg() As Eric noticed, __unix_dgram_recvmsg() may acquire u->iolock too, so we have to release it before calling this function. Fixes: 9825d866ce0d ("af_unix: Implement unix_dgram_bpf_recvmsg()") Reported-by: Eric Dumazet Signed-off-by: Cong Wang Signed-off-by: Andrii Nakryiko Acked-by: Jakub Sitnicki Acked-by: John Fastabend commit 0c3b533cfdd5275fd556028ffe9121aa64e49778 Author: Hu Haowen Date: Thu Jul 29 23:56:27 2021 +0800 MAINTAINERS: add entry for traditional Chinese documentation Add maintainer information for traditional Chinese documentation. Signed-off-by: Hu Haowen Reviewed-by: Pan Yunwang Link: https://lore.kernel.org/r/20210729155627.41744-3-src.res@email.cn Signed-off-by: Jonathan Corbet commit 390f915a12a668c2add6a37bbf4dc30bc6a0e4d4 Author: Hu Haowen Date: Thu Jul 29 23:56:26 2021 +0800 docs/zh_TW: add translations for zh_TW/process Create new translations for zh_TW/process and link them to index. Signed-off-by: Hu Haowen Reviewed-by: Pan Yunwang Link: https://lore.kernel.org/r/20210729155627.41744-2-src.res@email.cn Signed-off-by: Jonathan Corbet commit 76f1fc266b897de07ad585667b574e03fd2e9d01 Author: Hu Haowen Date: Thu Jul 29 23:56:25 2021 +0800 docs: add traditional Chinese translation for kernel Documentation Add traditional Chinese translation (zh_TW) for the Linux Kernel documentation with a series of translated files. Signed-off-by: Hu Haowen Reviewed-by: Pan Yunwang Link: https://lore.kernel.org/r/20210729155627.41744-1-src.res@email.cn Signed-off-by: Jonathan Corbet commit a710eed386f182fcbfe517b659f60024fdb7c40c Author: Hengqi Chen Date: Fri Jul 30 19:40:12 2021 +0800 libbpf: Add btf__load_vmlinux_btf/btf__load_module_btf Add two new APIs: btf__load_vmlinux_btf and btf__load_module_btf. btf__load_vmlinux_btf is just an alias to the existing API named libbpf_find_kernel_btf, rename to be more precisely and consistent with existing BTF APIs. btf__load_module_btf can be used to load module BTF, add it for completeness. These two APIs are useful for implementing tracing tools and introspection tools. This is part of the effort towards libbpf 1.0 ([0]). [0] Closes: https://github.com/libbpf/libbpf/issues/280 Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210730114012.494408-1-hengqi.chen@gmail.com commit a432934a30679c0e3c47b87f13e4901bc1a3fc03 Author: Paolo Abeni Date: Fri Jul 30 18:30:53 2021 +0200 sk_buff: avoid potentially clearing 'slow_gro' field If skb_dst_set_noref() is invoked with a NULL dst, the 'slow_gro' field is cleared, too. That could lead to wrong behavior if the skb later enters the GRO stage. Fix the potential issue replacing preserving a non-zero value of the 'slow_gro' field. Additionally, fix a comment typo. Reported-by: Sabrina Dubroca Reported-by: Jakub Kicinski Fixes: 8a886b142bd0 ("sk_buff: track dst status in slow_gro") Signed-off-by: Paolo Abeni Link: https://lore.kernel.org/r/aa42529252dc8bb02bd42e8629427040d1058537.1627662501.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski commit 4e0d77f8e831fcbe86a02dd0ead12d9c8c057700 Author: Heiner Kallweit Date: Thu Jul 29 12:22:25 2021 -0500 PCI/VPD: Treat initial 0xff as missing EEPROM Previously we assumed that the first tag being 0x00 meant an EEPROM was missing. The first tag being 0xff means the same thing; check for that also. [bhelgaas: rework error mesage] Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit 70730db0f611a721fe652cfe92c7f94ccf687454 Author: Bjorn Helgaas Date: Thu Jul 15 16:59:56 2021 -0500 PCI/VPD: Check Resource Item Names against those valid for type Previously, we checked for PCI_VPD_STIN_END, PCI_VPD_LTIN_ID_STRING, etc., outside the Large and Small Resource cases, so we checked Large Resource Item Names against a Small Resource name and vice versa. Move these tests into the Large and Small Resource cases, so we only check PCI_VPD_STIN_END for Small Resources and PCI_VPD_LTIN_* for Large Resources. Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit e2cdd86b561719da9ac928635f2a55b370dbb5b1 Author: Bjorn Helgaas Date: Thu Jul 15 16:59:55 2021 -0500 PCI/VPD: Correct diagnostic for VPD read failure Previously, when a VPD read failed, we warned about an "invalid large VPD tag". Warn about the VPD read failure instead. Signed-off-by: Bjorn Helgaas Reviewed-by: Hannes Reinecke commit 219691cf360136591e627badbd62f54097f99fc0 Merge: 9398a834700e1 5df6dfbb6de81 Author: Mark Brown Date: Fri Jul 30 18:34:50 2021 +0100 Merge series "Add RZ/G2L Sound support" from Biju Das : This patch series aims to add ASoC support on RZ/G2L SoC's. It is based on the work done by Chris Brandt for RZ/A ASoC driver. Biju Das (8): ASoC: dt-bindings: Document RZ/G2L bindings sound: soc: sh: Add RZ/G2L SSIF-2 driver arm64: dts: renesas: r9a07g044: Add external audio clock nodes arm64: dts: renesas: r9a07g044: Add SSI support arm64: defconfig: Enable ASoC sound support for RZ/G2L SoC ASoC: dt-bindings: sound: renesas,rz-ssi: Document DMA support sound: sh: rz-ssi: Add SSI DMAC support arm64: dts: renesas: r9a07g044: Add SSI DMA support .../bindings/sound/renesas,rz-ssi.yaml | 100 ++ arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 105 ++ arch/arm64/configs/defconfig | 1 + sound/soc/sh/Kconfig | 10 + sound/soc/sh/Makefile | 4 + sound/soc/sh/rz-ssi.c | 1078 +++++++++++++++++ 6 files changed, 1298 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml create mode 100644 sound/soc/sh/rz-ssi.c -- 2.17.1 commit 78f613ba1efb923342b8e6264f7254a7f17db91c Author: Lucas De Marchi Date: Wed Jul 28 14:59:46 2021 -0700 drm/i915: finish removal of CNL With all the users removed, finish removing the CNL platform definitions. We will leave the PCI IDs around as those are exposed to userspace. Even if mesa doesn't support CNL anymore, let's avoid build breakages due to changing the headers. Also, due to drm/i915/gt still using IS_CANNONLAKE() let's just redefine it instead of removing. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-26-lucas.demarchi@intel.com commit a4d082fc194a73f175dcf235fdfb4268c29ed7fe Author: Lucas De Marchi Date: Wed Jul 28 14:59:45 2021 -0700 drm/i915: rename/remove CNL registers Remove registers that are not used anymore due to CNL removal and rename those that are. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-25-lucas.demarchi@intel.com commit 5dae69a9fd97e34682fc612b3445ce4862967dda Author: Lucas De Marchi Date: Wed Jul 28 14:59:44 2021 -0700 drm/i915: remove GRAPHICS_VER == 10 Replace all remaining handling of GRAPHICS_VER {==,>=} 10 with {==,>=} 11. With the removal of CNL, there is no platform with graphics version equals 10. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-24-lucas.demarchi@intel.com commit 4c6b3021217fb197606c51ff9b9a3af9b2a56481 Author: Lucas De Marchi Date: Wed Jul 28 14:59:43 2021 -0700 drm/i915: switch num_scalers/num_sprites to consider DISPLAY_VER The numbers of scalers and sprites depend on the display version, so use it instead of GRAPHICS_VER. We were mixing both, which let me confused while removing CNL and GRAPHICS_VER == 10. v2 (Rodrigo): Switch IS_GEMINILAKE to DISPLAY_VER == 10 v3 (Lucas): Change check to DISPLAY_VER >= 9, to cover the GLK's num_scalers, otherwise it remains set to 0. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-23-lucas.demarchi@intel.com commit 244dba4cb596379d0e196b031065f8c1e1cecdaf Author: Lucas De Marchi Date: Wed Jul 28 14:59:42 2021 -0700 drm/i915: replace random CNL comments Cleanup remaining cases that we find CNL in the codebase. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-22-lucas.demarchi@intel.com commit a2db1945362b33eb58f596b451757fc4716bdb7b Author: Lucas De Marchi Date: Wed Jul 28 14:59:41 2021 -0700 drm/i915: rename CNL references in intel_dram.c With the removal of CNL, let's consider ICL as the first platform using those constants. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-21-lucas.demarchi@intel.com commit b426c837460a922386703e140b5597ac898c3d58 Author: Lucas De Marchi Date: Wed Jul 28 14:59:40 2021 -0700 drm/i915: remove explicit CNL handling from intel_wopcm.c Consider the new WOPCM size as starting in ICL rather than CNL since the latter is being removed from the driver. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-20-lucas.demarchi@intel.com commit cf9fb29cfc0228cd977d3589817f9a54d14d6d3e Author: Lucas De Marchi Date: Wed Jul 28 14:59:39 2021 -0700 drm/i915: remove explicit CNL handling from intel_pch.c Remove references for CNL from pch detection. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-19-lucas.demarchi@intel.com commit dbac4f3946ec5bb97fb871c34b8d820124d0ac59 Author: Lucas De Marchi Date: Wed Jul 28 14:59:38 2021 -0700 drm/i915: remove explicit CNL handling from intel_pm.c Remove support for CNL as it's highly untested, probably broken, and there is no real platform that requires this code. This is part of CNL removal from i915. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-18-lucas.demarchi@intel.com commit 938a8a9af7b9bb0c086665a90c8afac208cb3a75 Author: Lucas De Marchi Date: Wed Jul 28 14:59:37 2021 -0700 drm/i915: remove explicit CNL handling from i915_irq.c Remove special handling of PORT_F in i915_irq.c and only do it for DISPLAY_VER == 11. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-17-lucas.demarchi@intel.com commit 4a8b03a41b4c42f7078bb3686c8d8de1d47646f0 Author: Lucas De Marchi Date: Wed Jul 28 14:59:36 2021 -0700 drm/i915/display: rename CNL references in skl_scaler.c With the removal of CNL, let's consider GLK as the first platform using those constants since GLK has DISPLAY_VER == 10. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-16-lucas.demarchi@intel.com commit b623aae585cbd9ce7b952567b8e8cc34f7e234bc Author: Lucas De Marchi Date: Thu Jul 29 09:23:33 2021 -0700 drm/i915/display: remove CNL ddi buf translation tables The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210729162332.1774275-1-lucas.demarchi@intel.com commit c27310e3d6baffd9110299cb52264a3a9d58e670 Author: Lucas De Marchi Date: Wed Jul 28 14:59:34 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_display_power.c The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly in intel_display_power.c. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-14-lucas.demarchi@intel.com commit c988d2dcd22706fcad4950f4b33477182f7754ae Author: Lucas De Marchi Date: Wed Jul 28 14:59:33 2021 -0700 drm/i915/display: remove explicit CNL handling from skl_universal_plane.c The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly in skl_universal_plane.c. Remove code and rename functions/macros accordingly to use ICL prefix. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-13-lucas.demarchi@intel.com commit f1be52cb0ee7b79b99a638ab2cf3eb4196a0ff03 Author: Lucas De Marchi Date: Wed Jul 28 14:59:32 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_vdsc.c Only one reference to CNL that is not needed, but code is the same for DISPLAY_VER >= 11, so leave the code around and just remove the special case for CNL. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-12-lucas.demarchi@intel.com commit 8de358cbebd9619d4a63c296a177e27cb0a662db Author: Lucas De Marchi Date: Thu Jul 29 16:39:35 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_dpll_mgr.c The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly in intel_ddi.c. A lot of special code for CNL can be removed. There were some __cnl.*() functions that were created to share the implementation between ICL and CNL. Those are now embedded in the only caller, in ICL. Remove code and rename functions/macros accordingly to use ICL prefix for those that are still needed. Verified with: make EXTRA_CFLAGS=-Wunused drivers/gpu/drm/i915/display/intel_dpll_mgr.o Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210729233934.2059489-1-lucas.demarchi@intel.com commit 94a79070d2770a6602e7dafebcde627da5e7b6dd Author: Lucas De Marchi Date: Wed Jul 28 14:59:30 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_dp.c The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly in intel_dp.c. Remove code and rename functions/macros accordingly to use ICL prefix. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-10-lucas.demarchi@intel.com commit 3a6242e316867b45f60fb55b7ed0f62afe4bd117 Author: Lucas De Marchi Date: Wed Jul 28 14:59:29 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_dmc.c Remove DMC firmware for CNL. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-9-lucas.demarchi@intel.com commit 6e5b3d6b1f54302963ed69cebc238837826adefc Author: Lucas De Marchi Date: Wed Jul 28 14:59:28 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_display_debugfs.c Only one reference to CNL that is not needed, but code is the same for DISPLAY_VER >= 11, so leave the code around and just remove the special case for CNL. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-8-lucas.demarchi@intel.com commit 4da27d5dfe669e231ede7f5e4d6eb4093cc7a574 Author: Lucas De Marchi Date: Wed Jul 28 14:59:27 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_ddi.c The only real platform with DISPLAY_VER == 10 is GLK. We don't need to handle CNL explicitly in intel_ddi.c. Remove code and rename functions/macros accordingly to use ICL prefix. There's one leftover reference to cnl that comes from the struct intel_ddi_buf_trans. This will be renamed later when we get rid of the additional CNL tables. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-7-lucas.demarchi@intel.com commit 89a346007c450c66ce96d90b2af25eb37140b1b2 Author: Lucas De Marchi Date: Wed Jul 28 14:59:26 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_crtc.c No need for special CNL handling as there is no real platform with that configuration. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-6-lucas.demarchi@intel.com commit f9a3a827f7e3738cc0ff0350a796f1d77c0410d5 Author: Lucas De Marchi Date: Wed Jul 28 14:59:25 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_combo_phy.c The only real platform with DISPLAY_VER == 10 is GLK, that doesn't have combo phys. We don't need to handle CNL explicitly in intel_combo_phy.c. Remove code and rename functions/macros accordingly to use ICL prefix. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-5-lucas.demarchi@intel.com commit 44bf1b737be017768d6a617c617960b671541ea2 Author: Lucas De Marchi Date: Wed Jul 28 14:59:24 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_color.c The only real platform with DISPLAY_VER == 10 is GLK, so we don't need any checks and supporting code for CNL. For DISPLAY_VER >= 11, ilk_load_csc_matrix() is not used, so make it handle GLK only. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-4-lucas.demarchi@intel.com commit 1d89509a5dd64ccd3abba8861c909b3707eb7520 Author: Lucas De Marchi Date: Wed Jul 28 14:59:23 2021 -0700 drm/i915/display: remove explicit CNL handling from intel_cdclk.c The only real platform with DISPLAY_VER == 10 is GLK, so we don't need any checks and supporting code for CNL. Remove code and rename functions/macros accordingly. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-3-lucas.demarchi@intel.com commit cad83b405fe482a132ff5163ad0775c22411e3f7 Author: Lucas De Marchi Date: Wed Jul 28 14:59:22 2021 -0700 drm/i915/display: remove PORT_F workaround for CNL Explicit support for CNL is being removed from the driver as it's not expected to work. Remove the workaround for PORT_F from display/intel_bios.c so we can also remove the generic DISPLAY_VER == 10 calls to intel_ddi_init(): the only platform with that display version is already handled separately (GLK). Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-2-lucas.demarchi@intel.com commit bc830525615df6b6b1793ac23750f32695903fd0 Author: Yajun Deng Date: Thu Jul 29 15:48:54 2021 +0800 net: netlink: Remove unused function lockdep_genl_is_held() and its caller arm not used now, just remove them. Signed-off-by: Yajun Deng Link: https://lore.kernel.org/r/20210729074854.8968-1-yajun.deng@linux.dev Signed-off-by: Jakub Kicinski commit c1fa5ac6c2f475b5140e6323801ed93c24e7e5cf Author: Lokesh Vutla Date: Wed Jul 21 17:06:25 2021 +0530 arm64: dts: ti: k3-am642-sk: Add pwm nodes ecap0 can be configured to use pad ECAP0_IN_APWM_OUT (D18) which has a signal connected to Pin 1 of J3. Add support for adding this pinmux so that pwm can be observed on pin 1 of Header J3 Also mark all un-used epwm and ecap pwm nodes as disabled. Signed-off-by: Lokesh Vutla Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20210721113625.17299-5-lokeshvutla@ti.com commit 8032affdf5a156a467d3b109f32cd9f57ea7afda Author: Lokesh Vutla Date: Wed Jul 21 17:06:24 2021 +0530 arm64: dts: ti: k3-am642-evm: Add pwm nodes ecap0 can be configured to use pad ECAP0_IN_APWM_OUT (D18) which has a signal connected to Pin 1 of J12 on EVM. Add support for adding this pinmux so that pwm can be observed on pin 1 of Header J12 Also mark all un-used epwm and ecap pwm nodes as disabled. Signed-off-by: Lokesh Vutla Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20210721113625.17299-4-lokeshvutla@ti.com commit ae0df139b51a8448afb38e9706f257ab56fea097 Author: Lokesh Vutla Date: Wed Jul 21 17:06:23 2021 +0530 arm64: dts: ti: k3-am64-main: Add ecap pwm nodes There are 3 instances of ecap modules that are capable of generating a pwm when configured in apwm mode. Add DT nodes for these 3 ecap instances. Signed-off-by: Lokesh Vutla Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20210721113625.17299-3-lokeshvutla@ti.com commit 13a9a3ef66248a1b6e9acaaa5292d96f8635935b Author: Lokesh Vutla Date: Wed Jul 21 17:06:22 2021 +0530 arm64: dts: ti: k3-am64-main: Add epwm nodes Add DT nodes for all epwm instances present in AM64 SoC. Signed-off-by: Lokesh Vutla Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20210721113625.17299-2-lokeshvutla@ti.com commit 2806556c5e1abf06e37e33a449a5801b02d98939 Author: Jason Wang Date: Mon Jul 26 20:29:07 2021 +0800 arm64: use __func__ to get function name in pr_err Prefer using '"%s...", __func__' to get current function's name in a debug message. Signed-off-by: Jason Wang Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210726122907.51529-1-wangborong@cdjrlc.com Signed-off-by: Catalin Marinas commit ec63e300fa8be5b7bbb32cd231a211aed07c85ce Author: Lingyan Huang Date: Thu Jul 22 10:20:36 2021 +0800 arm64: SSBS/DIT: print SSBS and DIT bit when printing PSTATE The current code to print PSTATE when generating backtraces does not include SSBS bit and DIT bit, so add this information. Cc: Vladimir Murzin Cc: Will Deacon Reviewed-by: Vladimir Murzin Signed-off-by: Lingyan Huang Signed-off-by: Shaokun Zhang Acked-by: Will Deacon Link: https://lore.kernel.org/r/1626920436-54816-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Catalin Marinas commit 373a1f2bd6718c7103ec3ee242b9c2d51587440f Merge: 79976892f7ea3 77411df5f293d Author: Jakub Kicinski Date: Fri Jul 30 17:22:59 2021 +0200 Merge branch 'nfc-constify-pointed-data-missed-part' Krzysztof Kozlowski says: ==================== nfc: constify pointed data - missed part This was previously sent [1] but got lost. It was a prerequisite to part two of NFC const [2]. Changes since v2: 1. Drop patch previously 7/8 which cases new warnings "warning: Using plain integer as NULL pointer". Changes since v1: 1. Add patch 1/8 fixing up nfcmrvl_spi_parse_dt() [1] https://lore.kernel.org/lkml/20210726145224.146006-1-krzysztof.kozlowski@canonical.com/ [2] https://lore.kernel.org/linux-nfc/20210729104022.47761-1-krzysztof.kozlowski@canonical.com/T/#m199fbdde180fa005a10addf28479fcbdc6263eab ==================== Link: https://lore.kernel.org/r/20210730144202.255890-1-krzysztof.kozlowski@canonical.com Signed-off-by: Jakub Kicinski commit 77411df5f293d664892971f84f1d23b74f0cb794 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:42:02 2021 +0200 nfc: hci: cleanup unneeded spaces No need for multiple spaces in variable declaration (the code does not use them in other places). No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit ddecf5556f7fdf871fa8ce26b376e3e8ae6213b6 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:42:01 2021 +0200 nfc: nci: constify several pointers to u8, sk_buff and other structs Several functions receive pointers to u8, sk_buff or other structs but do not modify the contents so make them const. This allows doing the same for local variables and in total makes the code a little bit safer. This makes const also data passed as "unsigned long opt" argument to nci_request() function. Usual flow for such functions is: 1. Receive "u8 *" and store it (the pointer) in a structure allocated on stack (e.g. struct nci_set_config_param), 2. Call nci_request() or __nci_request() passing a callback function an the pointer to the structure via an "unsigned long opt", 3. nci_request() calls the callback which dereferences "unsigned long opt" in a read-only way. This converts all above paths to use proper pointer to const data, so entire flow is safer. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit f2479c0a22948c5998938fa5bb9d98f9931791b7 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:42:00 2021 +0200 nfc: constify local pointer variables Few pointers to struct nfc_target and struct nfc_se can be made const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 3df40eb3a2ea58bf404a38f15a7a2768e4762cb0 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:41:59 2021 +0200 nfc: constify several pointers to u8, char and sk_buff Several functions receive pointers to u8, char or sk_buff but do not modify the contents so make them const. This allows doing the same for local variables and in total makes the code a little bit safer. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 4932c37878c9c68b8f0cffc6848125ce4437a27d Author: Krzysztof Kozlowski Date: Fri Jul 30 16:41:58 2021 +0200 nfc: hci: annotate nfc_llc_init() as __init The nfc_llc_init() is used only in other __init annotated context. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit bf6cd7720b08571875ccdbcb6449e11d8415a283 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:41:57 2021 +0200 nfc: annotate af_nfc_exit() as __exit The af_nfc_exit() is used only in other __exit annotated context (nfc_exit()). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 3833b87408e5722e0b43b9b73f58d17db47a4c98 Author: Krzysztof Kozlowski Date: Fri Jul 30 16:41:56 2021 +0200 nfc: mrvl: correct nfcmrvl_spi_parse_dt() device_node argument The device_node in nfcmrvl_spi_parse_dt() cannot be const as it is passed to OF functions which modify it. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit ff85f10ba8e4d3b4c6f8f5c9f6b47f3e80a067f1 Author: Shaokun Zhang Date: Fri Jul 16 13:58:09 2021 +0800 arm64: cpufeature: Use defined macro instead of magic numbers Use defined macro to simplify the code and make it more readable. Cc: Marc Zyngier Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/1626415089-57584-1-git-send-email-zhangshaokun@hisilicon.com Acked-by: Will Deacon Signed-off-by: Catalin Marinas commit 4e9340bb551a5ad664196465ba7620009d835dbc Author: Johan Hovold Date: Mon Jul 5 10:20:15 2021 +0200 USB: serial: cp210x: determine fw version for CP2105 and CP2108 CP2105, CP2108 and CP2102N have vendor requests that can be used to retrieve the firmware version. Having this information available is essential when trying to work around buggy firmware as a recent CP2102N regression showed. Determine and log the firmware version also for CP2105 and CP2108 during type detection at probe. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 33fb934a0992440e3d645d3965e71217c185fd6d Author: Johan Hovold Date: Mon Jul 5 10:20:14 2021 +0200 USB: serial: cp210x: clean up type detection Clean up attach somewhat by moving type detection into the quirk helper and giving it a more generic name. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 33a61d2cc731d1c8a763f147528fc5e46978599f Author: Johan Hovold Date: Mon Jul 5 10:20:13 2021 +0200 USB: serial: cp210x: clean up set-chars request Use the generic control request helper to implement the SET_CHARS request. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit befc28a720362cb2b14601b5ba3d1f4c600ffaec Author: Johan Hovold Date: Mon Jul 5 10:20:12 2021 +0200 USB: serial: cp210x: clean up control-request timeout For consistency use the USB_CTRL_GET_TIMEOUT define for the read-register request timeout (same value as USB_CTRL_SET_TIMEOUT). Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit ba4bbdabecd11530dca78dbae3ee7e51ffdc0a06 Author: Johan Hovold Date: Mon Jul 5 10:20:11 2021 +0200 USB: serial: cp210x: fix flow-control error handling Make sure that the driver crtscts state is not updated in the unlikely event that the flow-control request fails. Not doing so could break RTS control. Fixes: 5951b8508855 ("USB: serial: cp210x: suppress modem-control errors") Cc: stable@vger.kernel.org # 5.11 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 2d9a00705910ccea2dc5d9cba5469ff2de72fc87 Author: Johan Hovold Date: Mon Jul 5 10:20:10 2021 +0200 USB: serial: cp210x: fix control-characters error handling In the unlikely event that setting the software flow-control characters fails the other flow-control settings should still be updated (just like all other terminal settings). Move out the error message printed by the set_chars() helper to make it more obvious that this is intentional. Fixes: 7748feffcd80 ("USB: serial: cp210x: add support for software flow control") Cc: stable@vger.kernel.org # 5.11 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit a311936b5bcb93de64f930431e754aa9172b32ba Author: Johan Hovold Date: Fri Jul 2 15:43:48 2021 +0200 USB: serial: io_edgeport: drop unused descriptor helper Drop the unused (and not even compiled) string descriptor helper. Signed-off-by: Johan Hovold commit d80d3ea64e5fa2ab20b3774ea0d871484877422b Author: Masahiro Yamada Date: Thu Jul 29 23:23:38 2021 +0900 s390: move the install rule to arch/s390/Makefile Currently, the install target in arch/s390/Makefile descends into arch/s390/boot/Makefile to invoke the shell script, but there is no good reason to do so. arch/s390/Makefile can run the shell script directly. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20210729142338.446002-1-masahiroy@kernel.org Signed-off-by: Heiko Carstens commit e37b3dd063a1a68e28a7cfaf77c84c472112e330 Author: Ilya Leoshkevich Date: Wed Jul 28 13:59:04 2021 +0200 s390: enable KCSAN s390x GCC and SystemZ Clang have ThreadSanitizer support now [1] [2], so enable KCSAN for s390. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ea22954e7c58 [2] https://reviews.llvm.org/D105629 Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens commit 09b1b13461e12e6962baf0c5bb9f65bedf284d90 Author: Heiko Carstens Date: Thu Jul 29 16:28:11 2021 +0200 kcsan: use u64 instead of cycles_t cycles_t has a different type across architectures: unsigned int, unsinged long, or unsigned long long. Depending on architecture this will generate this warning: kernel/kcsan/debugfs.c: In function ‘microbenchmark’: ./include/linux/kern_levels.h:5:25: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘cycles_t’ {aka ‘long unsigned int’} [-Wformat=] To avoid this simply change the type of cycle to u64 in microbenchmark(), since u64 is of type unsigned long long for all architectures. Acked-by: Marco Elver Link: https://lore.kernel.org/r/20210729142811.1309391-1-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit d6de72cf9260723f57cc4c6358b1f55e54898c3e Author: Sven Schnelle Date: Wed Jul 28 21:02:54 2021 +0200 s390: add kfence region to pagetable dumper Signed-off-by: Sven Schnelle Link: https://lore.kernel.org/r/20210728190254.3921642-5-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit e41ba1115a351dd037c21ac75660638219d51485 Author: Sven Schnelle Date: Wed Jul 28 21:02:53 2021 +0200 s390: add support for KFENCE Signed-off-by: Sven Schnelle [hca@linux.ibm.com: simplify/rework code] Link: https://lore.kernel.org/r/20210728190254.3921642-4-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit f99e12b21b84feb1fd9d845a15096772f1659461 Author: Sven Schnelle Date: Wed Jul 28 21:02:52 2021 +0200 kfence: add function to mask address bits s390 only reports the page address during a translation fault. To make the kfence unit tests pass, add a function that might be implemented by architectures to mask out address bits. Signed-off-by: Sven Schnelle Reviewed-by: Marco Elver Link: https://lore.kernel.org/r/20210728190254.3921642-3-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit b3e1a00c8fa41a80aa402e5ca7f8cc78efa4f50b Author: Heiko Carstens Date: Wed Jul 28 21:02:51 2021 +0200 s390/mm: implement set_memory_4k() Implement set_memory_4k() which will split any present large or huge mapping in the given range to a 4k mapping. Link: https://lore.kernel.org/r/20210728190254.3921642-2-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit 00e67bf030e74a01afab8e0109244b9b0d7e2e43 Author: Marco Elver Date: Wed Jul 28 21:57:41 2021 +0200 kfence, x86: only define helpers if !MODULE x86's only declares non-module accessible functions (such as flush_tlb_one_kernel) if !MODULE. In preparation of including from the KFENCE test module, only define the helpers if !MODULE to avoid breaking the build with CONFIG_KFENCE_KUNIT_TEST=m. Signed-off-by: Marco Elver Link: https://lore.kernel.org/r/YQJdarx6XSUQ1tFZ@elver.google.com Signed-off-by: Heiko Carstens commit 15b4d2b972014b789f22d9267bcff1cc48153738 Author: ChiYuan Huang Date: Fri Jul 30 20:32:06 2021 +0800 regulator: rtq2134: Fix coding style Add empty space and put constant number to the right side for 'if' judgement. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1627648326-5026-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 9398a834700e124027e73874450e6aa35fae479e Author: Takashi Iwai Date: Wed Jul 28 16:19:30 2021 +0200 ASoC: intel: skylake: Drop superfluous mmap callback skl_platform_soc_mmap() just calls the standard mmap helper, hence it's superfluous. Let's drop it. Signed-off-by: Takashi Iwai Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20210728141930.17740-1-tiwai@suse.de Signed-off-by: Mark Brown commit f211f5f606335d75c3b346e03bceb9b10261b6b3 Author: Takashi Iwai Date: Wed Jul 28 16:18:43 2021 +0200 ASoC: amd: Drop superfluous mmap callbacks All ASoC AMD drivers just call the standard mmap handler, hence those are superfluous. Let's drop them. Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20210728141843.17685-1-tiwai@suse.de Signed-off-by: Mark Brown commit 5df6dfbb6de815ba3a75c788a916865212fd5221 Author: Biju Das Date: Mon Jul 19 14:40:38 2021 +0100 ASoC: dt-bindings: sound: renesas,rz-ssi: Document DMA support Document DMA support in binding document. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210719134040.7964-7-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 2b761f476f3a6e0a212c8c88e7855f66edb177e0 Author: Biju Das Date: Mon Jul 19 14:40:33 2021 +0100 ASoC: dt-bindings: Document RZ/G2L bindings Document RZ/G2L ASoC serial sound interface bindings. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210719134040.7964-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 9b6818c1ac0e545c632265e4bf0aa1171347ebea Author: Fabio Aiuto Date: Fri Jul 30 16:54:08 2021 +0200 staging: rtl8723bs: put condition parentheses at the end of a line put the closing parenthese at the end of a line Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/295a41c98cd475ae25f9288d99a929b75492db3f.1627656773.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit b8afef0e13720739d41808f0b88970b84c1ec3ff Author: Fabio Aiuto Date: Fri Jul 30 16:54:07 2021 +0200 staging: rtl8723bs: align condition to match open parentheses fix following checkpatch issue: CHECK: Alignment should match open parenthesis 54: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:609: + if (target->reserved[0] != 2 && + target->reserved[0] >= pnetwork->network.reserved[0] Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/941bd42ef6b7d76e80685b133046669a0ca82d8e.1627656773.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8255017976dec902e25fe7669605aa58a6e7c0ac Author: Fabio Aiuto Date: Fri Jul 30 16:54:06 2021 +0200 staging: rtl8723bs: remove unnecessary parentheses fix the following checkpatch issues: CHECK: Unnecessary parentheses around 'pnetwork->network.ie_length > target->ie_length' 33: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:604: + if ((pnetwork->network.ie_length > target->ie_length) && (target->reserved[0] == 1)) CHECK: Unnecessary parentheses around 'target->reserved[0] == 1' 33: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:604: + if ((pnetwork->network.ie_length > target->ie_length) && (target->reserved[0] == 1)) CHECK: Unnecessary parentheses around 'target->reserved[0] != 2' 39: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:608: + if ((target->reserved[0] != 2) && + (target->reserved[0] >= pnetwork->network.reserved[0]) ) { CHECK: Unnecessary parentheses around 'target->reserved[0] >= pnetwork->network.reserved[0]' 39: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:608: + if ((target->reserved[0] != 2) && + (target->reserved[0] >= pnetwork->network.reserved[0]) ) { Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/fca83a857ebb158cf395ea31f1834c04402c39e4.1627656773.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 76ac3b19a702d346674c7b2082af9654b2e58c50 Author: Fabio Aiuto Date: Fri Jul 30 16:54:05 2021 +0200 staging: rtl8723bs: fix camel case issue in struct wlan_bssid_ex fix camel case issue in field Reserved in struct wlan_bssid_ex Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a70fd91a46fd2c75eb27824ea57ae0d87d65bf81.1627656773.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 78f2b22efc8f7649dcde44143e78149457f1162c Author: Greg Kroah-Hartman Date: Fri Jul 30 16:39:21 2021 +0200 staging: r8188eu: fix include directory mess The driver seems to want to include a specific directory for all include files on the build path, but that breaks when trying to build only the module directory, or when building with "O=" option. Fix this up by making all includes for the driver be relative locations. Reported-by: Mark Brown Link: https://lore.kernel.org/r/20210730144227.1770212-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 0050a57638ca4d681ff92bee55246bf64a6afe54 Author: Prabhakar Kushwaha Date: Thu Jul 29 18:17:32 2021 +0300 RDMA/qedr: Improve error logs for rdma_alloc_tid error return Use -EINVAL return type to identify whether error is returned because of "Out of MR resources" or any other error types. Link: https://lore.kernel.org/r/20210729151732.30995-2-pkushwaha@marvell.com Signed-off-by: Shai Malin Signed-off-by: Ariel Elior Signed-off-by: Prabhakar Kushwaha Signed-off-by: Jason Gunthorpe commit 090473004b026747a2795244ecd67bd51a24c923 Author: Prabhakar Kushwaha Date: Thu Jul 29 18:17:31 2021 +0300 RDMA/qed: Use accurate error num in qed_cxt_dynamic_ilt_alloc To have more accurate error return type use -EOPNOTSUPP instead of -EINVAL. Link: https://lore.kernel.org/r/20210729151732.30995-1-pkushwaha@marvell.com Signed-off-by: Shai Malin Signed-off-by: Ariel Elior Signed-off-by: Prabhakar Kushwaha Signed-off-by: Jason Gunthorpe commit d7eb35beda59beed2c3589ec43ec0537452c9446 Merge: cdd57325548af 91d1be9fb7d66 Author: Linus Walleij Date: Fri Jul 30 16:11:37 2021 +0200 Merge tag 'renesas-pinctrl-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.15 - Add bias support for the R-Car D3 SoC, - Miscellaneous fixes and improvements. commit 86949b521fa4e4c88e6ff7be6a1ce2c7c064a0f0 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:17 2021 +0200 staging: r8188eu: remove rtw_usb_control_msg() macro It is a wrapper around usb_control_msg() that does nothing, so remove the macro and just call the correct USB function instead in the one place it is used. Link: https://lore.kernel.org/r/20210730092417.1014392-12-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 48f1f36ae153e3e83680ad3d0e65be2d7f8dfd89 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:16 2021 +0200 staging: r8188eu: remove rtw_usb_bulk_msg() macro No one is using this wrapper macro, so just remove it as it is pointless. Link: https://lore.kernel.org/r/20210730092417.1014392-11-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 18e94ed5f99cde4874b83b9f9f4b1895aea84990 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:15 2021 +0200 staging: r8188eu: remove include/nic_spec.h No one was including this file, so just remove it. Link: https://lore.kernel.org/r/20210730092417.1014392-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 3130547cac53835fa8d7d56f772f8dab2ad69fd7 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:14 2021 +0200 staging: r8188eu: remove unused enum _NIC_VERSION None of these enumerated values were used anywhere in the driver, so just remove them all. Link: https://lore.kernel.org/r/20210730092417.1014392-9-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit c7e88ecbe328e2bcd892d84c4b26eff86cb776ef Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:13 2021 +0200 staging: r8188eu: remove rtw_buf_free() function It is just a wrapper around kfree(), so just replace all calls with kfree() instead. The pointer is also set to NULL and the length set to 0 to emulate the original logic, just to be "safe" as I do not have a device to test with, but odds are that can be removed later on. Link: https://lore.kernel.org/r/20210730092417.1014392-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit b6f700b4b12ea3abcde3726de7483190a06c9ddd Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:12 2021 +0200 staging: r8188eu: remove rtw_mfree2d() function It is just a wrapper around kfree(), so remove it and just call kfree() instead. Link: https://lore.kernel.org/r/20210730092417.1014392-7-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit b3e8e29bc262def7540a4979888ef96c85924b49 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:11 2021 +0200 staging: r8188eu: remove include/Hal8188EReg.h No one is using the defines in this file, so remove it as it is not needed anywhere. Link: https://lore.kernel.org/r/20210730092417.1014392-6-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 4cd1746aa746916db5aa5e351dcbfd54f2538637 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:10 2021 +0200 staging: r8188eu: remove include/autoconf.h No one uses this file, so just remove it. Also remove the pointless Makefile rule that was attempting to create it. Link: https://lore.kernel.org/r/20210730092417.1014392-5-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 099a6ee02488d5a98f8e10d82aaa8213af897fcc Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:09 2021 +0200 staging: r8188eu: remove include/h2clbk.h No one uses this file, so remove it from the tree. Link: https://lore.kernel.org/r/20210730092417.1014392-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit f624b4f1cae3383d843b8044522f46e13eec4482 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:08 2021 +0200 staging: r8188eu: move ODM_GetRightChnlPlaceforIQK() ODM_GetRightChnlPlaceforIQK() is only called in one place, so move the call to the single location and make the file static. This lets us remove the hal/HalPhyRf.c and include/HalPhyRf.h files as they are now empty. Link: https://lore.kernel.org/r/20210730092417.1014392-3-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 67431f25259aec381c8d3b983718d7fcb892d49f Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:07 2021 +0200 staging: r8188eu: move ODM_TARGET_CHNL_NUM_2G_5G The ODM_TARGET_CHNL_NUM_2G_5G define is only used in one place, so move it to the .c file it is used in instead of being in a .h file. Link: https://lore.kernel.org/r/20210730092417.1014392-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit cea32de203f2dc4eccd4dc3d9ef0f833efe534d1 Author: Greg Kroah-Hartman Date: Fri Jul 30 11:24:06 2021 +0200 staging: r8188eu: remove empty ODM_ResetIQKResult() function ODM_ResetIQKResult() is empty and does nothing, so remove it. Link: https://lore.kernel.org/r/20210730092417.1014392-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 658dfbec96620ff08ef17c87b35b6a6bb8d52fc0 Author: Fabio Aiuto Date: Fri Jul 30 15:40:48 2021 +0200 staging: rtl8723bs: remove unused BIT macros definitions BIT(x) macro used all over the driver is defined in include/vsdo/bit.h as - #define BIT(nr) (UL(1) << (nr)) which is safer than the local BIT macros declared. Local macros shift a signed integer which brings unespected results. For example: (unsigned long)(1 << 31) => 0xffffffff80000000 shift.c: int main() { printf("%lx\n", (unsigned long)(1 << 31)); printf("%lx\n", (unsigned long)(1U << 31)); return 0; } ... $ ./shift ffffffff80000000 80000000 ... So just remove redundant, less safe macro declarations. Suggested-by: David Sterba Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/20210730134048.8736-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit d8062f6adca1ef13a0bab70ddcd67881d483338e Author: Michael Straube Date: Fri Jul 30 15:02:04 2021 +0200 staging: r8188eu: clean up comparsions to NULL in os_dep directory Clean up comparsions to NULL in the os_dep directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730130204.18229-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1e6bc5987a5252948e3411e5a2dbb434fd1ea107 Author: Marek Vasut Date: Sun Jun 20 23:24:31 2021 +0200 ARM: dts: stm32: Update AV96 adv7513 node per dtbs_check Swap reg and reg-names order and drop adi,input-justification and adi,input-style to fix the following dtbs_check warnings: arch/arm/boot/dts/stm32mp157a-dhcor-avenger96.dt.yaml: hdmi-transmitter@3d: adi,input-justification: False schema does not allow ['evenly'] arch/arm/boot/dts/stm32mp157a-dhcor-avenger96.dt.yaml: hdmi-transmitter@3d: adi,input-style: False schema does not allow [[1]] arch/arm/boot/dts/stm32mp157a-dhcor-avenger96.dt.yaml: hdmi-transmitter@3d: reg-names:1: 'edid' was expected arch/arm/boot/dts/stm32mp157a-dhcor-avenger96.dt.yaml: hdmi-transmitter@3d: reg-names:2: 'cec' was expected 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 8aec45d7884f16cc21d668693c5b88bff8df0f02 Author: Marek Vasut Date: Thu Jun 10 17:03:06 2021 +0200 ARM: dts: stm32: Set {bitclock,frame}-master phandles on ST DKx Fix the following dtbs_check warning: cs42l51@4a: port:endpoint@0:frame-master: True is not of type 'array' cs42l51@4a: port:endpoint@0:bitclock-master: True is not of type 'array' 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 6257dfc1c412dcdbd76ca5fa92c8444222dbe5b0 Author: Arnaud Pouliquen Date: Mon Jun 14 18:49:40 2021 +0200 ARM: dts: stm32: Add coprocessor detach mbox on stm32mp15x-dkx boards To support the detach feature, add a new mailbox channel to inform the remote processor on a detach. This signal allows the remote processor firmware to stop IPC communication and to reinitialize the resources for a re-attach. Signed-off-by: Arnaud Pouliquen Signed-off-by: Alexandre Torgue commit 9542ca9e9a99ac9fa6103816bf356a3216df8f1b Author: Arnaud Pouliquen Date: Mon Jun 14 18:49:39 2021 +0200 ARM: dts: stm32: Add coprocessor detach mbox on stm32mp157c-ed1 board To support the detach feature, add a new mailbox channel to inform the remote processor on a detach. This signal allows the remote processor firmware to stop IPC communication and to reinitialize the resources for a re-attach. Signed-off-by: Arnaud Pouliquen Signed-off-by: Alexandre Torgue commit e24e70aa76b3753ba4e34b94af1f9779a4e5c5c3 Author: Marek Vasut Date: Thu Jun 10 17:02:43 2021 +0200 ARM: dts: stm32: Add usbphyc_port1 supply on DHCOM SoM The port is unused, but shares the same supply with port0, so fill the DT property in. This fixes the following dtbs_check warning: arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dt.yaml: usbphyc@5a006000: usb-phy@1: 'phy-supply' is a required property Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Patrice Chotard Cc: Patrick Delaunay Cc: kernel@dh-electronics.com Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 10ba166b1140b9c784594e1c50dc08ba75e30676 Author: Marek Vasut Date: Thu Jun 10 17:02:42 2021 +0200 ARM: dts: stm32: Add backlight and panel supply on DHCOM SoM Fix the following dtbs_check warning: arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dt.yaml: display-bl: 'power-supply' is a required property arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dt.yaml: panel: 'power-supply' is a required property Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Patrice Chotard Cc: Patrick Delaunay Cc: kernel@dh-electronics.com Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit a79e78c391dc074742c855dc0108a88f781d56a3 Author: Marek Vasut Date: Thu Jun 10 17:02:41 2021 +0200 ARM: dts: stm32: Set {bitclock,frame}-master phandles on DHCOM SoM Fix the following dtbs_check warning: arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dt.yaml: codec@a: port:endpoint@0:frame-master: True is not of type 'array' arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dt.yaml: codec@a: port:endpoint@0:bitclock-master: True is not of type 'array' Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Patrice Chotard Cc: Patrick Delaunay Cc: kernel@dh-electronics.com Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 79976892f7ea37f44f8bcfb6d266954e8ae0124d Author: Yajun Deng Date: Thu Jul 29 15:13:50 2021 +0800 net: convert fib_treeref from int to refcount_t refcount_t type should be used instead of int when fib_treeref is used as a reference counter,and avoid use-after-free risks. Signed-off-by: Yajun Deng Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20210729071350.28919-1-yajun.deng@linux.dev Signed-off-by: Jakub Kicinski commit 651f8cffade8615bb4fce1ecb3a929892c5e60d7 Author: Yoshihiro Shimoda Date: Wed Jul 21 20:12:47 2021 +0900 arm64: dts: renesas: r8a77961: Add iommus to ipmmu_ds[01] related nodes This patch adds iommus properties to ipmmu_ds[01] related nodes (avb, dmac and sdhi) of r8a77961. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20210721111247.849825-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 1d14ae11ad48aff14ce78471dc0c0eaece326ae0 Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:41 2021 +0200 arm64: dts: renesas: Add support for M3ULCB+Kingfisher with R-Car M3e-2G Add support for the Renesas R-Car Starter Kit Pro and Kingfisher combo equipped with an R-Car M3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/54262b64be6d5c7a7ede3302259e9d15218d48a0.1626708063.git.geert+renesas@glider.be commit 84365481610550aa43ca435d38af7b86c83a21de Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:40 2021 +0200 arm64: dts: renesas: Add support for M3ULCB with R-Car M3e-2G Add support for the Renesas R-Car Starter Kit Pro equipped with an R-Car M3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/c566dfa5f07605a467f8705c3a2f637ea445b1ff.1626708063.git.geert+renesas@glider.be commit c532a55c9b4b1740427b9b8173ac756b5acbee1b Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:39 2021 +0200 arm64: dts: renesas: Add support for Salvator-XS with R-Car M3e-2G Add support for the Renesas Salvator-X 2nd version development board equipped with an R-Car M3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/177666b6ffa0b404e1e45504763dd381107a02f3.1626708063.git.geert+renesas@glider.be commit a04dfa94578b5747719417b561181240d2495ec0 Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:38 2021 +0200 arm64: dts: renesas: Add support for H3ULCB+Kingfisher with R-Car H3e-2G Add support for the Renesas R-Car Starter Kit Premier and Kingfisher combo equipped with an R-Car H3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/985ad56e9f93d08cf3d1014fbba86ea54beb01e1.1626708063.git.geert+renesas@glider.be commit 488cca0a36505969488bac21daed2af202a774cc Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:37 2021 +0200 arm64: dts: renesas: Add support for H3ULCB with R-Car H3e-2G Add support for the Renesas R-Car Starter Kit Premier equipped with an R-Car H3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/561a01ebeeef3f39f56cdc6ba8533bef222a72f2.1626708063.git.geert+renesas@glider.be commit 49596032fb9ba34262faf356ffcb1ca58c16b30b Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:36 2021 +0200 arm64: dts: renesas: Add support for Salvator-XS with R-Car H3e-2G Add support for the Renesas Salvator-X 2nd version development board equipped with an R-Car H3e-2G SiP. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/2a6cc94d27cd87e0231d15c39c5f7cff1e751834.1626708063.git.geert+renesas@glider.be commit 52d348867d902e44707484144781874d5bb658a2 Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:35 2021 +0200 arm64: dts: renesas: Add Renesas R8A779M3 SoC support Add support for the Renesas R-Car M3e-2G (R8A779M3) SoC, which is a different grading of the R-Car M3-W+ (R8A77961) SoC. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/bbb3131ccdd615b59c46297c2ea37147c7ff84e1.1626708063.git.geert+renesas@glider.be commit 89326803091e03e92c8008d539f90b5130421959 Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:34 2021 +0200 arm64: dts: renesas: Add Renesas R8A779M1 SoC support Add support for the Renesas R-Car H3e-2G (R8A779M1) SoC, which is a different grading of the R-Car H3 ES3.0 (R8A77951) SoC. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/ec2196d1b6b142955007e48124eb59ec4e0cee5f.1626708063.git.geert+renesas@glider.be commit c96ca5604a889a142d6b60889cc6da48498806e9 Author: Biju Das Date: Wed Jul 21 19:06:32 2021 +0100 arm64: dts: renesas: hihope-rzg2-ex: Add EtherAVB internal rx delay Hihope boards use Realtek PHY. From the very beginning it use only tx delays. However the phy driver commit bbc4d71d63549bcd003 ("net: phy: realtek: fix rtl8211e rx/tx delay config") introduced NFS mount failure. Now it needs rx delay inaddition to tx delay for NFS mount to work. This patch fixes NFS mount failure issue by adding MAC internal rx delay. Signed-off-by: Biju Das Fixes: bbc4d71d63549bcd ("net: phy: realtek: fix rtl8211e rx/tx delay config") Link: https://lore.kernel.org/r/20210721180632.15080-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 513cea27baece4ead180f29ef1f6ffee4d896c4e Author: Kuninori Morimoto Date: Tue Jul 20 08:45:34 2021 +0900 arm64: dts: renesas: r8a77995: draak: Add R-Car Sound support This patch adds R-Car Sound support for D3 draak. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87czrdx3z5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 5d78c97b4ba96c9ccd0d2bc9aba0f4233563d06d Author: Kuninori Morimoto Date: Tue Jul 20 08:45:28 2021 +0900 arm64: dts: renesas: r8a77995: Add R-Car Sound support This patch adds R-Car Sound and Audio-DMAC support for D3. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87eebtx3zb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit cfd7bf66b2a3f399ecdf67bbdf03d3c3c9078fad Author: Geert Uytterhoeven Date: Wed Jul 14 13:24:51 2021 +0200 arm64: dts: renesas: rcar-gen3: Add SoC model to comment headers Make sure the R-Car Gen3 SoC model present is documented in the comment header of each board DTS, on a single line. This makes it easier to identify boards that are available with different SoC or SiP options. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/251569665d7d4f4ed4bbab7267ce2ddccdef33e5.1626261816.git.geert+renesas@glider.be commit 991c4274dc17b58b642894a48ccae85c9e53aad6 Author: Cai Huoqing Date: Thu Jul 29 16:23:46 2021 +0800 RDMA/hfi1: Fix typo in comments Remove the repeated word 'the' from comments Link: https://lore.kernel.org/r/20210729082346.1882-1-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Signed-off-by: Jason Gunthorpe commit 8d7e415d55610d503fdb8815344846b72d194a40 Author: Leon Romanovsky Date: Wed Jul 28 16:04:12 2021 +0300 docs: Fix infiniband uverbs minor number Starting from the beginning of infiniband subsystem, the uverbs char devices start from 192 as a minor number, see commit bc38a6abdd5a ("[PATCH] IB uverbs: core implementation"). This patch updates the admin guide documentation to reflect it. Fixes: 9d85025b0418 ("docs-rst: create an user's manual book") Link: https://lore.kernel.org/r/bad03e6bcde45550c01e12908a6fe7dfa4770703.1627477347.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bbafcbc2b1c9a9b01ecd97020cf5057a22cb20b2 Author: Leon Romanovsky Date: Fri Jul 23 17:08:57 2021 +0300 RDMA/iwpm: Rely on the rdma_nl_[un]register() to ensure that requests are valid The core netlink code alread guarentees that no netlink callback can be running outside the rdma_nl_register/unregister() region and this registration happens during module init/exit. Thus it is already prevented that iwpm_valid_client() can ever fail. Remove it. Link: https://lore.kernel.org/r/a9f05a78f9996bf6ea47099b5e02671bf742f5ab.1627048781.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bdb0e4e3ff19b6699ab82828412f2fd9ad811b1d Author: Leon Romanovsky Date: Fri Jul 23 17:08:56 2021 +0300 RDMA/iwpm: Remove not-needed reference counting iwpm_init() and iwpm_exit() are called only once during iw_cm module load. This makes whole reference count implementation not needed at all. Link: https://lore.kernel.org/r/1778ded873ba58c9fadc5bb25038de1cec843bec.1627048781.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e677b72a0647249370f2635862bf0241c86f66ad Author: Leon Romanovsky Date: Fri Jul 23 17:08:55 2021 +0300 RDMA/iwcm: Release resources if iw_cm module initialization fails The failure during iw_cm module initialization partially left the system with unreleased memory and other resources. Rewrite the module init/exit routines in such way that netlink commands will be opened only after successful initialization. Fixes: b493d91d333e ("iwcm: common code for port mapper") Link: https://lore.kernel.org/r/b01239f99cb1a3e6d2b0694c242d89e6410bcd93.1627048781.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cdd57325548af9803f0602914de16a8ddcb5bec0 Author: Sai Krishna Potthuri Date: Wed Jul 21 17:22:32 2021 +0530 pinctrl: pinctrl-zynq: Add support for 'power-source' parameter Add support for generic pin parameter 'power-source'. To maintain the backward compatibility, 'io-standard' parameter is still supported in the driver. Signed-off-by: Sai Krishna Potthuri Link: https://lore.kernel.org/r/1626868353-96475-4-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com Signed-off-by: Linus Walleij commit ef641c449e8083c4314c125d8e32b37644ddd852 Author: Sai Krishna Potthuri Date: Wed Jul 21 17:22:31 2021 +0530 dt-bindings: pinctrl-zynq: Replace 'io-standard' with 'power-source' Replace custom pin configuration option 'io-standard' with generic property 'power-source' for Zynq pinctrl also add dt-binding file contains pin configuration defines for Zynq pinctrl. Signed-off-by: Sai Krishna Potthuri Link: https://lore.kernel.org/r/1626868353-96475-3-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com Signed-off-by: Linus Walleij commit 153df45acda08afec4bd13dd9145464111ef7ba7 Author: Sai Krishna Potthuri Date: Wed Jul 21 17:22:30 2021 +0530 dt-bindings: pinctrl: pinctrl-zynq: Convert to yaml Convert the Zynq pinctrl binding file to yaml. Signed-off-by: Sai Krishna Potthuri Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1626868353-96475-2-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com Signed-off-by: Linus Walleij commit 6ceb3c64063cd7b7155709f5ff67b85aa8a0e20b Author: Jiaxun Yang Date: Wed Jul 21 11:01:31 2021 +0800 pinctrl: pistachio: Make it as an option So it will be avilable for generic MIPS kernel. -- Signed-off-by: Jiaxun Yang v3: Depend on OF as well Link: https://lore.kernel.org/r/20210721030134.10562-7-jiaxun.yang@flygoat.com Signed-off-by: Linus Walleij commit a0293eb24936ff30e5a23f9438fd4ad1c4009dbf Author: Xiyu Yang Date: Mon Jul 19 14:00:53 2021 +0800 RDMA/hfi1: Convert from atomic_t to refcount_t on hfi1_devdata->user_refcount refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Link: https://lore.kernel.org/r/1626674454-56075-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Tested-by: Josh Fisher Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 62004871e1fa7f9a60797595c03477af5b5ec36f Author: Mike Marciniszyn Date: Thu Jul 15 12:04:45 2021 -0400 IB/hfi1: Adjust pkey entry in index 0 It is possible for the primary IPoIB network device associated with any RDMA device to fail to join certain multicast groups preventing IPv6 neighbor discovery and possibly other network ULPs from working correctly. The IPv4 broadcast group is not affected as the IPoIB network device handles joining that multicast group directly. This is because the primary IPoIB network device uses the pkey at ndex 0 in the associated RDMA device's pkey table. Anytime the pkey value of index 0 changes, the primary IPoIB network device automatically modifies it's broadcast address (i.e. /sys/class/net/[ib0]/broadcast), since the broadcast address includes the pkey value, and then bounces carrier. This includes initial pkey assignment, such as when the pkey at index 0 transitions from the opa default of invalid (0x0000) to some value such as the OPA default pkey for Virtual Fabric 0: 0x8001 or when the fabric manager is restarted with a configuration change causing the pkey at index 0 to change. Many network ULPs are not sensitive to the carrier bounce and are not expecting the broadcast address to change including the linux IPv6 stack. This problem does not affect IPoIB child network devices as their pkey value is constant for all time. To mitigate this issue, change the default pkey in at index 0 to 0x8001 to cover the predominant case and avoid issues as ipoib comes up and the FM sweeps. At some point, ipoib multicast support should automatically fix non-broadcast addresses as it does with the primary broadcast address. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Link: https://lore.kernel.org/r/20210715160445.142451.47651.stgit@awfm-01.cornelisnetworks.com Suggested-by: Josh Collier Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit e9901043b25000ed21c7073373a7d9fd64f3d1e3 Author: Mike Marciniszyn Date: Thu Jul 15 12:04:40 2021 -0400 IB/hfi1: Indicate DMA wait when txq is queued for wakeup There is no counter for dmawait in AIP, which hampers debugging performance issues. Add the counter increment when the txq is queued. Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets") Link: https://lore.kernel.org/r/20210715160440.142451.8278.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 792a00c16597415e8058c1f4ff8226866e8accf8 Author: Fabio M. De Francesco Date: Fri Jul 30 12:37:16 2021 +0200 staging: r8188eu: Remove no more used functions and variables Remove the functions and variables from rtw_security.c that are no more necessary since the patch that replaces getcrc32() with crc32_le(). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210730103716.27210-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit f52cc32dee4f5eb807237202819d80079a2483a6 Author: Fabio M. De Francesco Date: Fri Jul 30 12:37:15 2021 +0200 staging: r8188eu: Replace a custom function with crc32_le() Use crc32_le() in place of the custom getcrc32(). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210730103716.27210-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7bfeeb4f065dc5ccf793cafbc110be064ae682ab Author: Michael Straube Date: Fri Jul 30 11:09:48 2021 +0200 staging: r8188eu: simplify odm_evm_db_to_percentage() Use clamp() to simplify odm_evm_db_to_percentage(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730090948.32759-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6342a4fa1a188dae1f13f729fd333229681062ca Author: Michael Straube Date: Fri Jul 30 11:09:47 2021 +0200 staging: r8188eu: rename parameter of odm_evm_db_to_percentage() Rename parameter of odm_evm_db_to_percentage() to avoid camel case. Value -> value Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730090948.32759-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 40791b94c1b784b4ed8c5dc4a27f2a337fb066fc Author: Michael Straube Date: Fri Jul 30 11:09:46 2021 +0200 staging: r8188eu: rename odm_EVMdbToPercentage() Rename odm_EVMdbToPercentage() to avoid camel case. odm_EVMdbToPercentage() -> odm_evm_db_to_percentage() Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210730090948.32759-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 79d82cbcbb3d2a56c009ad6a6df92c5dee061dad Author: Anshuman Khandual Date: Wed Jul 14 10:16:15 2021 +0530 arm64/kexec: Test page size support with new TGRAN range values The commit 26f55386f964 ("arm64/mm: Fix __enable_mmu() for new TGRAN range values") had already switched into testing ID_AA64MMFR0_TGRAN range values. This just changes system_supports_[4|16|64]kb_granule() helpers to perform similar range tests as well. While here, it standardizes page size specific supported min and max TGRAN values. Cc: Will Deacon Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1626237975-1909-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 2fefcf2400659f3f2d2c5ed87a4ceebde3dad7a8 Author: Fabio Estevam Date: Fri Jul 16 10:13:41 2021 -0300 pinctrl: imx8dxl: Constify imx_pinctrl_soc_info The imx_pinctrl_soc_info structure content is never changed, so it can be declared as 'const', like it is done on all other i.MX pinctrl drivers. Make it 'const' in this driver too. Reported-by: Dong Aisheng Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20210716131341.3370620-1-festevam@gmail.com Signed-off-by: Linus Walleij commit b013dc8a02d9a604767d589feb6549e2da6a9133 Author: Fabio Estevam Date: Tue Jul 13 09:25:13 2021 -0300 pinctrl: imx8qxp: Constify imx_pinctrl_soc_info The imx_pinctrl_soc_info structure content is never changed, so it can be declared as 'const', like it is done on all other i.MX pinctrl drivers. Make it 'const' in this driver too. Signed-off-by: Fabio Estevam Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20210713122513.3112941-2-festevam@gmail.com Signed-off-by: Linus Walleij commit ff128cdb7f3ddf237989c4ff925b42c9def33f7e Author: Fabio Estevam Date: Tue Jul 13 09:25:12 2021 -0300 pinctrl: imx8mn: Constify imx_pinctrl_soc_info The imx_pinctrl_soc_info structure content is never changed, so it can be declared as 'const', like it is done on all other i.MX pinctrl drivers. Make it 'const' in this driver too. Signed-off-by: Fabio Estevam Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20210713122513.3112941-1-festevam@gmail.com Signed-off-by: Linus Walleij commit 676f11b5a4a06281420070ffdbb09c05851fa819 Author: Desmond Cheong Zhi Xi Date: Fri Jul 30 13:17:59 2021 +0800 drm: clean up unused kerneldoc in drm_lease.c The kerneldoc in drm_lease.c is unused because none of the functions are driver interfaces as the symbols are not exported. Since they aren't used and much of the existing comments don't provide any insights (e.g. they just repeat the function name or list out the function parameters), they should be removed to make them easier to maintain and to make useful info more obvious. As a note, many of the comments mention whether idr_mutex should be held, but these are mostly redundant in cases where the function contains lockdep assertions or grabs the mutex. To simplify review, here's the reasoning behind each update. drm_lease_owner: function name is self-descriptive _drm_find_lessee: function name is self-descriptive _drm_lease_held_master: function name and signature are self-descriptive _drm_has_leased: kerneldoc is summarized into a comment because the function name could be interpreted ambiguously (check if the object has been leased VS check if the master has a lease on the object) _drm_lease_held: Retain the idr_mutex comment because the function does not directly grab the mutex or use a lockdep assertion. Otherwise, the function name is self-descriptive. drm_lease_held: function name is self-descriptive drm_lease_filter_crtcs: Kerneldoc is summarized into a comment because the function name could be interpreted ambiguously (filter leases based on crtcs mask VS filter crtcs mask based on leases) drm_lease_create: Kerneldoc removed. Useful function details such as atomic leasing are retained. Errno interpretations are useful and retained. drm_lease_destroy: function name is self-descriptive. Additional information is also removed as they're already present as comments inside the function. _drm_lease_revoke: function name is self-descriptive drm_lease_revoke: function name is self-descriptive drm_mode_create_lease_ioctl: Kerneldoc removed, but useful function details retained. drm_mode_list_lessees_ioctl: function name is self-descriptive. Additional details restate what the code does. drm_mode_get_lease_ioctl: Function summary retained to clarify that it's the leased objects that are returned, not the lease structure. drm_mode_revoke_lease_ioctl: Kerneldoc removed, but useful function details retained. Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210730051759.1570630-1-desmondcheongzx@gmail.com commit 8ac1247089fdf4ff60274c59c2ff6f5bfd424a4e Author: Linus Walleij Date: Wed Jul 7 02:00:50 2021 +0200 ARM: dts: ux500: Add a device tree for Kyle This adds a basic device tree for the Samsung SGH-I407 mobile phone also known as Kyle. Cc: newbyte@disroot.org Cc: Stephan Gerhold Signed-off-by: Linus Walleij commit 9b58fc860ea44c6a6cb4191f148964e9f289604a Author: Linus Walleij Date: Fri Jun 18 02:45:44 2021 +0200 ARM: dts: ux500: Add devicetree for Codina This adds a devicetree for Samsung GT-I8160 also known as Codina. Cc: newbyte@disroot.org Cc: Stephan Gerhold Signed-off-by: Linus Walleij commit 6d0e4f077c895549bc02b2b3db2d66aae6e865a3 Author: Matthew Auld Date: Thu Jul 29 10:47:31 2021 +0100 drm/i915/selftests: prefer the create_user helper No need to hand roll the set_placements stuff, now that we have a helper for this. v2: add back the -ENODEV checking since it's possible for stolen to be probed, and yet still be non-functional Signed-off-by: Matthew Auld Cc: Jason Ekstrand Reviewed-by: Jason Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20210729094731.1953091-1-matthew.auld@intel.com commit 68cc0c06967b7cced371729ec0718992cf4a6141 Author: Stephan Gerhold Date: Fri Jul 9 20:22:34 2021 +0200 ARM: dts: ux500: ab8500: Link USB PHY to USB controller node At the moment the AB8500 USB PHY driver still uses the old USB PHY subsystem instead of the generic PHY subsystem. This means that there is no explicit link between the USB controller and the USB PHY. In U-Boot the PHY driver is integrated in the generic PHY subsystem, so we need to use the typical PHY device tree bindings to specify which PHY belongs to the USB controller. Add the link between USB controller and PHY to both ste-ab8500.dtsi and ste-ab8505.dtsi. This is mainly for U-Boot for now and will just be ignored in Linux. However, if the AB8500 USB PHY driver in Linux is moved to the generic PHY subsystem at some point these device tree changes can be used as well. Signed-off-by: Stephan Gerhold Signed-off-by: Linus Walleij commit a345142d01ec22e212f82bbfbc238ba4796b6607 Author: Linus Walleij Date: Thu Jun 24 11:17:33 2021 +0200 ARM: dts: ux500: Flag eMMCs as non-SDIO/SD We use the no-sdio and no-sd flags to indicate that these eMMCs are neither, so that the operating system can skip trying to identify them as SDIO or SD during boot, which just takes time. Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij commit 4efdd31bfd59249cf99c112b797baf90db932166 Author: Linus Walleij Date: Wed Mar 31 11:18:09 2021 +0200 ARM: dts: ux500: Add device tree for Samsung Gavini This adds a device tree for the Samsung Galaxy Beam GT-I8530 also known as Gavini. Signed-off-by: Linus Walleij commit e6226997ec5ac272fa76274c3675bd5b7b437c53 Author: Arnd Bergmann Date: Mon May 17 09:22:34 2021 +0200 asm-generic: reverse GENERIC_{STRNCPY_FROM,STRNLEN}_USER symbols Most architectures do not need a custom implementation, and in most cases the generic implementation is preferred, so change the polariy on these Kconfig symbols to require architectures to select them when they provide their own version. The new name is CONFIG_ARCH_HAS_{STRNCPY_FROM,STRNLEN}_USER. The remaining architectures at the moment are: ia64, mips, parisc, um and xtensa. We should probably convert these as well, but I was not sure how far to take this series. Thomas Bogendoerfer had some concerns about converting mips but may still do some more detailed measurements to see which version is better. Cc: "James E.J. Bottomley" Cc: Anton Ivanov Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Helge Deller Cc: Jeff Dike Cc: Max Filippov Cc: Richard Weinberger Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Cc: linux-ia64@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-parisc@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linux-um@lists.infradead.org Cc: linux-xtensa@linux-xtensa.org Acked-by: Geert Uytterhoeven Acked-by: Helge Deller # parisc Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit f5d845be9d1fbeef22173053660ba010b9704c36 Author: Larry Finger Date: Thu Jul 29 19:38:22 2021 -0500 staging: r8188eu: Fix sleeping function called from invalid context The driver can call rtw_addbareq_cmd() from an interrupt routine. resulting in the following splat: [21760.582207] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201 [21760.582219] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/0 [21760.582224] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G C O 5.14.0-rc2-00135-g774ba5f0db67 #3 [21760.582228] Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.50 09/29/2014 [21760.582230] Call Trace: [21760.582232] [21760.582233] dump_stack_lvl+0x34/0x44 [21760.582245] ? rtw_addbareq_cmd+0x2a/0xba [r8188eu] [21760.582306] ___might_sleep.cold+0x88/0x95 [21760.582311] kmem_cache_alloc_trace+0x25a/0x2d0 [21760.582315] rtw_addbareq_cmd+0x2a/0xba [r8188eu] [21760.582368] rtw_issue_addbareq_cmd+0xda/0x17f [r8188eu] [21760.582404] rtw_dump_xframe+0xa6/0x266 [r8188eu] [21760.582433] xmitframe_direct+0x40/0x57 [r8188eu] [21760.582459] pre_xmitframe+0x72/0x110 [r8188eu] [21760.582485] rtl8188eu_hal_xmit+0xa/0xb [r8188eu] [21760.582508] rtw_hal_xmit+0x1b/0x1c [r8188eu] [21760.582539] rtw_xmit+0xd6/0x1cb [r8188eu] [21760.582564] rtw_xmit_entry+0xe4/0x1d2 [r8188eu] [21760.582584] xmit_one.constprop.0+0x98/0x170 [21760.582588] dev_hard_start_xmit+0x40/0x90 [21760.582591] sch_direct_xmit+0xfa/0x230 [21760.582596] __dev_xmit_skb+0x27c/0x530 [21760.582598] __dev_queue_xmit+0x327/0x4e0 [21760.582602] ip_finish_output2+0x279/0x5c0 [21760.582605] __ip_queue_xmit+0x167/0x3f0 [21760.582607] __tcp_transmit_skb+0x4ff/0x9a0 [21760.582610] tcp_rcv_established+0x5c1/0x6f0 [21760.582613] tcp_v4_do_rcv+0x13e/0x240 [21760.582616] tcp_v4_rcv+0xbad/0xc70 [21760.582618] ? ip_rcv_finish_core.constprop.0+0x13c/0x2f0 [21760.582621] ip_protocol_deliver_rcu+0x30/0x1f0 [21760.582623] ip_local_deliver_finish+0x4b/0x60 [21760.582625] __netif_receive_skb_one_core+0x63/0x90 [21760.582628] process_backlog+0x8f/0x140 [21760.582631] __napi_poll+0x2e/0x180 [21760.582634] net_rx_action+0x11b/0x260 [21760.582637] __do_softirq+0xcb/0x2f5 [21760.582640] irq_exit_rcu+0x9e/0xc0 [21760.582643] common_interrupt+0x83/0xa0 [21760.582647] [21760.582647] asm_common_interrupt+0x1e/0x40 [21760.582650] RIP: 0010:cpuidle_enter_state+0xdf/0x5c0 [21760.582655] Code: 49 89 c6 0f 1f 44 00 00 31 ff e8 4c a1 98 ff 45 84 ff 74 12 9c 58 f6 c4 02 0f 85 10 03 00 00 31 ff e8 d5 73 9f ff fb 45 85 ed <0f> 88 59 01 00 00 4d 63 e5 49 83 fc 09 0f 87 05 04 00 00 4b 8d 04 Fix by changing kmalloc() flags argument from GFP_KERNEL to GFP_ATOMIC. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210730003822.12471-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit b5385c77a71c48414c3f8caf777bf277f42d1516 Author: Agam Kohli Date: Thu Jul 29 14:12:08 2021 -0400 Staging: rt18712: hal_init: removed filename from beginning comment block Fixed a coding style issue Signed-off-by: Agam Kohli Link: https://lore.kernel.org/r/YQLveNI2UrnpeeAt@Agam.localdomain Signed-off-by: Greg Kroah-Hartman commit 38baa95e55483108aa14bcf36374d93ed19ea2a4 Author: Larry Finger Date: Thu Jul 29 12:09:30 2021 -0500 staging: r8188eu: Add "fallthrough" statement to quiet compiler Compiler gcc11, and possibly others, emit a warning when a fall-through case is found in a switch statement. Add a "fallthrough" statement to eliminate this warning. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-7-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 3cb9b23d8b16434e7ec3c086e885f5de63ee60ff Author: Larry Finger Date: Thu Jul 29 12:09:29 2021 -0500 staging: r8188eu: Remove header file include/rtw_version.h This file contains only the definition of the driver version. This statement is moved into a header called by all the affected source files, and the now empty header is deleted. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-6-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 9f50d13fbb2bd02dcb16859c6f61c76399a7893d Author: Larry Finger Date: Thu Jul 29 12:09:28 2021 -0500 staging: r8188eu: Remove header file include/usb_hal.h This header only includes one prototype and one define statement. The new definition is used once, thus it can be removed. The prototype is moved to a header that is already called by the supplier and the user of that routine, thus the small header is removed. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit a14c876f76b5cdde6915f49d14ca421d0ae0c1ca Author: Larry Finger Date: Thu Jul 29 12:09:27 2021 -0500 staging: r8188eu: Remove include/rtw_qos.h This header file merely defines a single struct. Move that definition to the header file that uses it, and delete rtw_qos.h. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit efb8bc8683f20c9f80a9b3239934ccc85e7ed59a Author: Larry Finger Date: Thu Jul 29 12:09:26 2021 -0500 staging: r8188eu: Remove tests of kernel version In the GitHub repository from which this driver was derived, old kernels had to be supported. Now that the driver is included in the kernel, this code can be removed as well as all mention of version.h. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 9a730283aec2d6e51f7cc923b04f2d279bc2313c Author: Larry Finger Date: Thu Jul 29 12:09:25 2021 -0500 staging: r8188eu: Remove empty header file File include/drv_types_linux.h is empty. Remove it. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729170930.23171-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 19de0225b84838bcf98dbc2033efb3bd414b8e93 Author: Larry Finger Date: Thu Jul 29 11:48:14 2021 -0500 staging: r8188eu: Convert copyright header info to SPDX format, part 6 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the C source files in hal/. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-7-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 8f97409846950db835a3c03f9accfd04c36daeea Author: Larry Finger Date: Thu Jul 29 11:48:13 2021 -0500 staging: r8188eu: Convert header copyright info to SPDX format, part 5 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the 9 C source files in os_dep/. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-6-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 762b759a4232714f75bdcdf291a64003d5d3292f Author: Larry Finger Date: Thu Jul 29 11:48:12 2021 -0500 staging: r8188eu: Convert header copyright info to SPDX format, part 4 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the 23 C source files in core/. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit b5f3122d22d581f3e037f73a300c12070b5b6b74 Author: Larry Finger Date: Thu Jul 29 11:48:11 2021 -0500 staging: r8188eu: Convert header copyright info to SPDX format, part 3 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the next 49 files. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit d521be8ed93b89364c9334184a43af6a2a759165 Author: Larry Finger Date: Thu Jul 29 11:48:10 2021 -0500 staging: r8188eu: Convert header copyright info to SPDX format, part 2 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the next 23 files. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit d27252b2c69c53a5b81121faf59d6b4b368e365d Author: Larry Finger Date: Thu Jul 29 11:48:09 2021 -0500 staging: r8188eu: Convert header copyright info to SPDX format, part 1 Before this driver can be incorporated in the drivers/net/wireless tree, the copyright info in all files must be converted to SPDX notation. This patch converts the first 20 files. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20210729164814.32097-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit ece42658c85df4c2d6c9b3ddb116003a2de4ecef Author: Greg Kroah-Hartman Date: Thu Jul 29 11:58:12 2021 +0200 staging: vt665X: remove unused CONFIG_PATH The vt6655 and vt6656 drivers have an unused CONFIG_PATH define floating around in the code, but it is never used. Remove it as drivers should never be reading from config files anyway, even if these were valid files. Reported-by: Joe Perches Reported-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20210729095812.1693061-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 26d1982fd17c2cac77f9cf764255362ccb28fe49 Author: Petr Mladek Date: Tue Jul 27 10:09:39 2021 +0200 lib/nmi_backtrace: Serialize even messages about idle CPUs The commit 55d6af1d66885059ffc2a ("lib/nmi_backtrace: explicitly serialize banner and regs") serialized backtraces from more CPUs using the re-entrant printk_printk_cpu lock. It was a preparation step for removing the obsolete nmi_safe buffers. The single-line messages about idle CPUs were not serialized against other CPUs and might appear in the middle of backtrace from another CPU, for example: [56394.590068] NMI backtrace for cpu 2 [56394.590069] CPU: 2 PID: 444 Comm: systemd-journal Not tainted 5.14.0-rc1-default+ #268 [56394.590071] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 [56394.590072] RIP: 0010:lock_is_held_type+0x0/0x120 [56394.590071] NMI backtrace for cpu 0 skipped: idling at native_safe_halt+0xb/0x10 [56394.590076] Code: a2 38 ff 0f 0b 8b 44 24 04 eb bd 48 8d ... [56394.590077] RSP: 0018:ffffab02c07c7e68 EFLAGS: 00000246 [56394.590079] RAX: 0000000000000000 RBX: ffff9a7bc0ec8a40 RCX: ffffffffaab8eb40 It might cause confusion what CPU the following lines belongs to and whether the backtraces are really serialized. Prevent the confusion and serialize also the single line message against other CPUs. Fixes: 55d6af1d66885059ffc2a ("lib/nmi_backtrace: explicitly serialize banner and regs") Reviewed-by: John Ogness Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210727080939.27193-1-pmladek@suse.com commit 04d505de7f82c8f2daa6139b460b05dc01e354e0 Merge: f1b7996551a40 544dcd74b7093 Author: Dave Airlie Date: Fri Jul 30 16:48:35 2021 +1000 Merge tag 'amd-drm-next-5.15-2021-07-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.15-2021-07-29: amdgpu: - VCN/JPEG power down sequencing fixes - Various navi pcie link handling fixes - Clockgating fixes - Yellow Carp fixes - Beige Goby fixes - Misc code cleanups - S0ix fixes - SMU i2c bus rework - EEPROM handling rework - PSP ucode handling cleanup - SMU error handling rework - AMD HDMI freesync fixes - USB PD firmware update rework - MMIO based vram access rework - Misc display fixes - Backlight fixes - Add initial Cyan Skillfish support - Overclocking fixes suspend/resume amdkfd: - Sysfs leak fix - Add counters for vm faults and migration - GPUVM TLB optimizations radeon: - Misc fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210730033455.3852-1-alexander.deucher@amd.com commit f1b7996551a40a4ebb551130c83077a0cabcb935 Merge: cfeeb0b5e09c2 4541e4f2225c3 Author: Dave Airlie Date: Fri Jul 30 16:05:58 2021 +1000 Merge tag 'drm-msm-next-2021-07-28' of https://gitlab.freedesktop.org/drm/msm into drm-next An early pull for v5.15 (there'll be more coming in a week or two), consisting of the drm/scheduler conversion and a couple other small series that one was based one. Mostly sending this now because IIUC danvet wanted it in drm-next so he could rebase on it. (Daniel, if you disagree then speak up, and I'll instead include this in the main pull request once that is ready.) This also has a core patch to drop drm_gem_object_put_locked() now that the last use of it is removed. [airlied: add NULL to drm_sched_init] Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGumRk7H88bqV=H9Fb1SM0zPBo5B7NsCU3jFFKBYxf5k+Q@mail.gmail.com commit cfeeb0b5e09c28bd7eb1e5c514200595e15967aa Merge: 988dbd25b8ae1 c7d30623540b6 Author: Dave Airlie Date: Fri Jul 30 14:51:22 2021 +1000 Merge tag 'drm-misc-next-2021-07-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.15: UAPI Changes: - Add modifiers for arm fixed rate compression. Cross-subsystem Changes: - Assorted dt binding fixes. - Convert ssd1307fb to json-schema. - Update a lot of irc channels to point to OFTC, as everyone moved there. - Fix the same divide by zero for asilantfb, kyro, rivafb. Core Changes: - Document requirements for new atomic properties. - Add drm_gem_fb_(begin/end)_cpu_access helpers, and use them in some drivers. - Document drm_property_enum.value for bitfields. - Add explicit _NO_ for MIPI_DSI flags that disable features. - Assorted documentation fixes. - Update fb_damage handling, and move drm_plane_enable_fb_damage_clips to core. - Add logging and docs to RMFB ioctl. - Assorted small fixes to dp_mst, master handling. - Clarify drm lease usage. Driver Changes: - Assorted small fixes to panfrost, hibmc, bridge/nwl-dsi, rockchip, vc4. - More drm -> linux irq conversions. - Add support for some Logic Technologies and Multi-Inno panels. - Expose phy-functionality for drm/rockchip, to allow controlling from the media subsystem. - Add support for 2 AUO panels. - Add damage handling to ssd1307fb. - Improve FIFO handling on mxsfb. - Assorted small fixes to vmwgfx, and bump version to 2.19 for the new ioctls. - Improve sony acx424akp backlight handling. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/a753221a-e23e-0dc4-7ca6-8c1b179738d0@linux.intel.com commit 089015d36127f2f620c7a1dca28449f676654850 Author: Salah Triki Date: Thu Jul 22 18:08:27 2021 +0100 crypto: atmel-aes - use swap() Use swap() instead of implementing it in order to make code more clean. Signed-off-by: Salah Triki Reviewed-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 0469dede0eeeefe12a9a2fd76078f4a266513457 Author: Mian Yousaf Kaukab Date: Wed Jul 21 10:39:05 2021 +0200 crypto: ecc - handle unaligned input buffer in ecc_swap_digits ecdsa_set_pub_key() makes an u64 pointer at 1 byte offset of the key. This results in an unaligned u64 pointer. This pointer is passed to ecc_swap_digits() which assumes natural alignment. This causes a kernel crash on an armv7 platform: [ 0.409022] Unhandled fault: alignment exception (0x001) at 0xc2a0a6a9 ... [ 0.416982] PC is at ecdsa_set_pub_key+0xdc/0x120 ... [ 0.491492] Backtrace: [ 0.492059] [] (ecdsa_set_pub_key) from [] (test_akcipher_one+0xf4/0x6c0) Handle unaligned input buffer in ecc_swap_digits() by replacing be64_to_cpu() to get_unaligned_be64(). Change type of in pointer to void to reflect it doesn’t necessarily need to be aligned. Fixes: 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature verification") Reported-by: Guillaume Gardet Suggested-by: Takashi Iwai Signed-off-by: Mian Yousaf Kaukab Tested-by: Stefan Berger Signed-off-by: Herbert Xu commit d5ee8e750c9449e9849a09ce6fb6b8adeaa66adc Author: Xiyu Yang Date: Tue Jul 20 11:05:11 2021 -0400 padata: Convert from atomic_t to refcount_t on parallel_data->refcnt refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Acked-by: Daniel Jordan Signed-off-by: Herbert Xu commit 192b722f3866d3fb45b9e6a6ecd02ff09f2aefbe Author: Jason Wang Date: Tue Jul 20 21:01:04 2021 +0800 crypto: sun8i-ss - Use kfree_sensitive The kfree_sensitive is a kernel API to clear sensitive information that should not be leaked to other future users of the same memory objects and free the memory. Its function is the same as the combination of memzero_explicit and kfree. Thus, we can replace the combination APIs with the single kfree_sensitive API. Signed-off-by: Jason Wang Signed-off-by: Herbert Xu commit ec2088b66f7a143eb14063f598d0bb3f64654c38 Author: Tudor Ambarus Date: Tue Jul 20 11:55:35 2021 +0300 crypto: atmel-aes - Allocate aes dev at tfm init time Allocate the atmel_aes_dev data at tfm init time, and not for each crypt request. There's a single AES IP per SoC, clarify that in the code. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit bf2db8e74249e691cbd1df7fca01810d8f48532b Author: Tudor Ambarus Date: Tue Jul 20 11:55:34 2021 +0300 crypto: atmel-aes - Add fallback to XTS software implementation XTS is supported just for input lengths with data units of 128-bit blocks. Add a fallback to software implementation when the last block is shorter than 128 bits. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 76d579f251a2d8501f4504b07355c8738b72c2bd Author: Tudor Ambarus Date: Tue Jul 20 11:55:33 2021 +0300 crypto: atmel - Set OFB's blocksize to 1 Set cra_blocksize to 1 to indicate OFB is a stream cipher. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 031f5e00150895232e658f67e66382b6c867ba13 Author: Tudor Ambarus Date: Tue Jul 20 11:55:32 2021 +0300 crypto: atmel-tdes - Add FIPS81's zero length cryptlen constraint FIPS81 requires for the ECB, CBC, CFB, and OFB modes that the plaintext and ciphertext to have a positive integer length. Add this constraint and just return 0 for a zero length cryptlen. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 0d0433599d84bf7db8caa8fb76915dc0ff818150 Author: Tudor Ambarus Date: Tue Jul 20 11:55:31 2021 +0300 crypto: atmel-aes - Add NIST 800-38A's zero length cryptlen constraint NIST 800-38A requires for the ECB, CBC, CFB, OFB and CTR modes that the plaintext and ciphertext to have a positive integer length. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 26d769ae90907e6f4724b800ba16f11681079f23 Author: Tudor Ambarus Date: Tue Jul 20 11:55:30 2021 +0300 crypto: atmel-aes - Add XTS input length constraint Input length smaller than block size does not make sense for XTS. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 534b32a8be27dc0eb54dccc302b3c9a6f0fe88a2 Author: Tudor Ambarus Date: Tue Jul 20 11:55:29 2021 +0300 crypto: atmel-aes - Add blocksize constraint for ECB and CBC modes NIST 800-38A requires for the ECB and CBC modes that the total number of bits in the plaintext to be a multiple of the block cipher. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 817b804ca36747f0c9db667d7d8aa9fdd55335c7 Author: Tudor Ambarus Date: Tue Jul 20 11:55:28 2021 +0300 crypto: atmel-tdes - Handle error messages Downgrade all runtime error messages to dev_dbg so that we don't pollute the console. All probe error messages are kept with dev_err. Get rid of pr_err and use dev_dbg instead, so that we know from which device the error comes. dma_mapping_error() return code was overwritten, use the error code that the function returns. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 632a761abb29db2c541782b9fe1f1e8d6f833896 Author: Tudor Ambarus Date: Tue Jul 20 11:55:27 2021 +0300 crypto: atmel-tdes - Clarify how tdes dev gets allocated to the tfm The tdes dev gets allocated to the tfm at alg->init time, there's no need to overwrite the pointer to tdes_dd afterwards. There's a single IP per SoC anyway, the first entry from the atmel_tdes.dev_list is chosen without counting for tfms for example, in case one thinks of an even distribution of tfms across the TDES IPs: there's only one. At alg->init time the ctx->dd should already be NULL, there's no need to check its value before requesting for a tdes dev. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit a7fc80bb22eb0f13791ee4f70484e88316cc2a24 Author: Tianjia Zhang Date: Tue Jul 20 11:46:42 2021 +0800 crypto: tcrypt - add the asynchronous speed test for SM4 tcrypt supports testing of SM4 cipher algorithms that use avx instruction set acceleration. The implementation of sm4 instruction set acceleration supports up to 8 blocks in parallel encryption and decryption, which is 128 bytes. Therefore, the 128-byte block size is also added to block_sizes. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit a7ee22ee1445c7fdb00ab80116bb9710ca86a860 Author: Tianjia Zhang Date: Tue Jul 20 11:46:41 2021 +0800 crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation This patch adds AES-NI/AVX/x86_64 assembler implementation of SM4 block cipher. Through two affine transforms, we can use the AES S-Box to simulate the SM4 S-Box to achieve the effect of instruction acceleration. The main algorithm implementation comes from SM4 AES-NI work by libgcrypt and Markku-Juhani O. Saarinen at: https://github.com/mjosaarinen/sm4ni This optimization supports the four modes of SM4, ECB, CBC, CFB, and CTR. Since CBC and CFB do not support multiple block parallel encryption, the optimization effect is not obvious. Benchmark on Intel Xeon Cascadelake, the data comes from the 218 mode and 518 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 | 40.99 46.50 48.05 48.41 49.20 49.25 49.28 ECB dec | 41.07 46.99 48.15 48.67 49.20 49.25 49.29 CBC enc | 37.71 45.28 46.77 47.60 48.32 48.37 48.40 CBC dec | 36.48 44.82 46.43 47.45 48.23 48.30 48.36 CFB enc | 37.94 44.84 46.12 46.94 47.57 47.46 47.68 CFB dec | 37.50 42.84 43.74 44.37 44.85 44.80 44.96 CTR enc | 39.20 45.63 46.75 47.49 48.09 47.85 48.08 CTR dec | 39.64 45.70 46.72 47.47 47.98 47.88 48.06 sm4-aesni-avx ECB enc | 33.75 134.47 221.64 243.43 264.05 251.58 258.13 ECB dec | 34.02 134.92 223.11 245.14 264.12 251.04 258.33 CBC enc | 38.85 46.18 47.67 48.34 49.00 48.96 49.14 CBC dec | 33.54 131.29 223.88 245.27 265.50 252.41 263.78 CFB enc | 38.70 46.10 47.58 48.29 49.01 48.94 49.19 CFB dec | 32.79 128.40 223.23 244.87 265.77 253.31 262.79 CTR enc | 32.58 122.23 220.29 241.16 259.57 248.32 256.69 CTR dec | 32.81 122.47 218.99 241.54 258.42 248.58 256.61 Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit c59de48e125c6d49a8abd165e388ca57bfe37b17 Author: Tianjia Zhang Date: Tue Jul 20 11:46:40 2021 +0800 crypto: arm64/sm4-ce - Make dependent on sm4 library instead of sm4-generic SM4 library is abstracted from sm4-generic algorithm, sm4-ce can depend on the SM4 library instead of sm4-generic, and some functions in sm4-generic do not need to be exported. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 2b31277af577b1b2da62c3ad7d3315b422869102 Author: Tianjia Zhang Date: Tue Jul 20 11:46:39 2021 +0800 crypto: sm4 - create SM4 library based on sm4 generic code Take the existing small footprint and mostly time invariant C code and turn it into a SM4 library that can be used for non-performance critical, casual use of SM4, and as a fallback for, e.g., SIMD code that needs a secondary path that can be taken in contexts where the SIMD unit is off limits. Secondly, some codes have been optimized, such as unrolling small times loop, removing unnecessary memory shifts, exporting sbox, fk, ck arrays, and basic encryption and decryption functions. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 988dbd25b8ae14de70d2be384f5872d6e22e3434 Merge: 15d27b15de965 6571a76af3802 Author: Dave Airlie Date: Fri Jul 30 11:28:11 2021 +1000 Merge tag 'du-next-20210728' of git://linuxtv.org/pinchartl/media into drm-next - R-Car DU shutdown fixes - R-Car DU conversion to bridge connector helper - Misc small fixes Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/YQGHjOSOw2G4+A3x@pendragon.ideasonboard.com commit f309b4ba989d96c192edd0d730d85bc1dd92a64a Merge: d36216429ff3e 211ab78f7658b Author: Andrii Nakryiko Date: Thu Jul 29 17:03:42 2021 -0700 Merge branch 'libbpf: rename btf__get_from_id() and btf__load() APIs, support split BTF' Quentin Monnet says: ==================== As part of the effort to move towards a v1.0 for libbpf [0], this set improves some confusing function names related to BTF loading from and to the kernel: - btf__load() becomes btf__load_into_kernel(). - btf__get_from_id becomes btf__load_from_kernel_by_id(). - A new version btf__load_from_kernel_by_id_split() extends the former to add support for split BTF. The last patch is a trivial change to bpftool to add support for dumping split BTF objects by referencing them by their id (and not only by their BTF path). [0] https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#btfh-apis v3: - Use libbpf_err_ptr() in btf__load_from_kernel_by_id(), ERR_PTR() in bpftool's get_map_kv_btf(). - Move the definition of btf__load_from_kernel_by_id() closer to the btf__parse() group in btf.h (move the legacy function with it). - Fix a bug on the return value in libbpf_find_prog_btf_id(), as a new patch. - Move the btf__free() fixes to their own patch. - Add "Fixes:" tags to relevant patches. v2: - Remove deprecation marking of legacy functions (patch 4/6 from v1). - Make btf__load_from_kernel_by_id{,_split}() return the btf struct, adjust surrounding code and call btf__free() when missing. - Add new functions to v0.5.0 API (and not v0.6.0). ==================== Signed-off-by: Andrii Nakryiko commit 211ab78f7658b50ea10c4569be63ca5009fd39b4 Author: Quentin Monnet Date: Thu Jul 29 17:20:28 2021 +0100 tools: bpftool: Support dumping split BTF by id Split BTF objects are typically BTF objects for kernel modules, which are incrementally built on top of kernel BTF instead of redefining all kernel symbols they need. We can use bpftool with its -B command-line option to dump split BTF objects. It works well when the handle provided for the BTF object to dump is a "path" to the BTF object, typically under /sys/kernel/btf, because bpftool internally calls btf__parse_split() which can take a "base_btf" pointer and resolve the BTF reconstruction (although in that case, the "-B" option is unnecessary because bpftool performs autodetection). However, it did not work so far when passing the BTF object through its id, because bpftool would call btf__get_from_id() which did not provide a way to pass a "base_btf" pointer. In other words, the following works: # bpftool btf dump file /sys/kernel/btf/i2c_smbus -B /sys/kernel/btf/vmlinux But this was not possible: # bpftool btf dump id 6 -B /sys/kernel/btf/vmlinux The libbpf API has recently changed, and btf__get_from_id() has been deprecated in favour of btf__load_from_kernel_by_id() and its version with support for split BTF, btf__load_from_kernel_by_id_split(). Let's update bpftool to make it able to dump the BTF object in the second case as well. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210729162028.29512-9-quentin@isovalent.com commit 61fc51b1d3e5915e356f2c0b67cd3bb13b640413 Author: Quentin Monnet Date: Thu Jul 29 17:20:27 2021 +0100 libbpf: Add split BTF support for btf__load_from_kernel_by_id() Add a new API function btf__load_from_kernel_by_id_split(), which takes a pointer to a base BTF object in order to support split BTF objects when retrieving BTF information from the kernel. Reference: https://github.com/libbpf/libbpf/issues/314 Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210729162028.29512-8-quentin@isovalent.com commit 86f4b7f2578f69284fa782be54e700c42c757897 Author: Quentin Monnet Date: Thu Jul 29 17:20:25 2021 +0100 tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id() Replace the calls to function btf__get_from_id(), which we plan to deprecate before the library reaches v1.0, with calls to btf__load_from_kernel_by_id() in tools/ (bpftool, perf, selftests). Update the surrounding code accordingly (instead of passing a pointer to the btf struct, get it as a return value from the function). Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210729162028.29512-6-quentin@isovalent.com commit 369e955b3d1c12f6ec2e51a95911bb80ada55d79 Author: Quentin Monnet Date: Thu Jul 29 17:20:24 2021 +0100 tools: Free BTF objects at various locations Make sure to call btf__free() (and not simply free(), which does not free all pointers stored in the struct) on pointers to struct btf objects retrieved at various locations. These were found while updating the calls to btf__get_from_id(). Fixes: 999d82cbc044 ("tools/bpf: enhance test_btf file testing to test func info") Fixes: 254471e57a86 ("tools/bpf: bpftool: add support for func types") Fixes: 7b612e291a5a ("perf tools: Synthesize PERF_RECORD_* for loaded BPF programs") Fixes: d56354dc4909 ("perf tools: Save bpf_prog_info and BTF of new BPF programs") Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") Fixes: fa853c4b839e ("perf stat: Enable counting events for BPF programs") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210729162028.29512-5-quentin@isovalent.com commit 6cc93e2f2c1c865acadedfea174bde893a2aa376 Author: Quentin Monnet Date: Thu Jul 29 17:20:23 2021 +0100 libbpf: Rename btf__get_from_id() as btf__load_from_kernel_by_id() Rename function btf__get_from_id() as btf__load_from_kernel_by_id() to better indicate what the function does. Change the new function so that, instead of requiring a pointer to the pointer to update and returning with an error code, it takes a single argument (the id of the BTF object) and returns the corresponding pointer. This is more in line with the existing constructors. The other tools calling the (soon-to-be) deprecated btf__get_from_id() function will be updated in a future commit. References: - https://github.com/libbpf/libbpf/issues/278 - https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#btfh-apis Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210729162028.29512-4-quentin@isovalent.com commit 3c7e58590600eca3402f08e7fbdf4f2d1e36c5c8 Author: Quentin Monnet Date: Thu Jul 29 17:20:22 2021 +0100 libbpf: Rename btf__load() as btf__load_into_kernel() As part of the effort to move towards a v1.0 for libbpf, rename btf__load() function, used to "upload" BTF information into the kernel, as btf__load_into_kernel(). This new name better reflects what the function does. References: - https://github.com/libbpf/libbpf/issues/278 - https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#btfh-apis Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210729162028.29512-3-quentin@isovalent.com commit 6d2d73cdd673d493f9f3751188757129b1d23fb7 Author: Quentin Monnet Date: Thu Jul 29 17:20:21 2021 +0100 libbpf: Return non-null error on failures in libbpf_find_prog_btf_id() Variable "err" is initialised to -EINVAL so that this error code is returned when something goes wrong in libbpf_find_prog_btf_id(). However, a recent change in the function made use of the variable in such a way that it is set to 0 if retrieving linear information on the program is successful, and this 0 value remains if we error out on failures at later stages. Let's fix this by setting err to -EINVAL later in the function. Fixes: e9fc3ce99b34 ("libbpf: Streamline error reporting for high-level APIs") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210729162028.29512-2-quentin@isovalent.com commit 6ef02f9c394c5f821a27b7c54f0145e0c54050eb Author: Sam Shih Date: Mon Jul 26 15:14:35 2021 +0800 dt-bindings: rng: mediatek: add mt7986 to mtk rng binding Add RNG binding for MT7986 SoC. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20210726071439.14248-9-sam.shih@mediatek.com Signed-off-by: Rob Herring commit d36216429ff3e69db4f6ea5e0c86b80010f5f30b Author: Yonghong Song Date: Wed Jul 28 11:30:25 2021 -0700 bpf: Emit better log message if bpf_iter ctx arg btf_id == 0 To avoid kernel build failure due to some missing .BTF-ids referenced functions/types, the patch ([1]) tries to fill btf_id 0 for these types. In bpf verifier, for percpu variable and helper returning btf_id cases, verifier already emitted proper warning with something like verbose(env, "Helper has invalid btf_id in R%d\n", regno); verbose(env, "invalid return type %d of func %s#%d\n", fn->ret_type, func_id_name(func_id), func_id); But this is not the case for bpf_iter context arguments. I hacked resolve_btfids to encode btf_id 0 for struct task_struct. With `./test_progs -n 7/5`, I got, 0: (79) r2 = *(u64 *)(r1 +0) func 'bpf_iter_task' arg0 has btf_id 29739 type STRUCT 'bpf_iter_meta' ; struct seq_file *seq = ctx->meta->seq; 1: (79) r6 = *(u64 *)(r2 +0) ; struct task_struct *task = ctx->task; 2: (79) r7 = *(u64 *)(r1 +8) ; if (task == (void *)0) { 3: (55) if r7 != 0x0 goto pc+11 ... ; BPF_SEQ_PRINTF(seq, "%8d %8d\n", task->tgid, task->pid); 26: (61) r1 = *(u32 *)(r7 +1372) Type '(anon)' is not a struct Basically, verifier will return btf_id 0 for task_struct. Later on, when the code tries to access task->tgid, the verifier correctly complains the type is '(anon)' and it is not a struct. Users still need to backtrace to find out what is going on. Let us catch the invalid btf_id 0 earlier and provide better message indicating btf_id is wrong. The new error message looks like below: R1 type=ctx expected=fp ; struct seq_file *seq = ctx->meta->seq; 0: (79) r2 = *(u64 *)(r1 +0) func 'bpf_iter_task' arg0 has btf_id 29739 type STRUCT 'bpf_iter_meta' ; struct seq_file *seq = ctx->meta->seq; 1: (79) r6 = *(u64 *)(r2 +0) ; struct task_struct *task = ctx->task; 2: (79) r7 = *(u64 *)(r1 +8) invalid btf_id for context argument offset 8 invalid bpf_context access off=8 size=8 [1] https://lore.kernel.org/bpf/20210727132532.2473636-1-hengqi.chen@gmail.com/ Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210728183025.1461750-1-yhs@fb.com commit 5aad03685185b5133a28e1ee1d4e98d3fd3642a3 Author: Hengqi Chen Date: Tue Jul 27 21:25:31 2021 +0800 tools/resolve_btfids: Emit warnings and patch zero id for missing symbols Kernel functions referenced by .BTF_ids may be changed from global to static and get inlined or get renamed/removed, and thus disappears from BTF. This causes kernel build failure when resolve_btfids do id patch for symbols in .BTF_ids in vmlinux. Update resolve_btfids to emit warning messages and patch zero id for missing symbols instead of aborting kernel build process. Suggested-by: Andrii Nakryiko Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210727132532.2473636-2-hengqi.chen@gmail.com commit 7da6ebf5f5a5efef1a7c8ec5a3a79b4298c902f0 Author: Linus Walleij Date: Fri Jul 23 17:23:56 2021 +0200 dt-bindings: arm: Convert Gemini boards to YAML This removes the old plaintext Gemini binding and replace it with a YAML schema, adding some new boards in the process. While we are at it, add the missing vendors to the vendor prefix file. Drop the overly deliberate description of subnodes and the big example from the old document. Keep the elaborate description. I noticed that "wiliboard" is not a real vendor, the vendor is named "wiligear" so deprecated this and replaced with the proper vendor. Cc: Corentin Labbe Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210723152356.1874088-1-linus.walleij@linaro.org Signed-off-by: Rob Herring commit 3e12361b6d23f793580a50a6008633501c56ea1d Author: Tang Bin Date: Thu Jul 29 12:03:00 2021 +0800 bcm63xx_enet: delete a redundant assignment In the function bcm_enetsw_probe(), 'ret' will be assigned by bcm_enet_change_mtu(), so 'ret = 0' make no sense. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit bea7907837c57a0aaac009931eb14efb056dafab Author: Vladimir Oltean Date: Thu Jul 29 17:56:00 2021 +0300 net: dsa: don't set skb->offload_fwd_mark when not offloading the bridge DSA has gained the recent ability to deal gracefully with upper interfaces it cannot offload, such as the bridge, bonding or team drivers. When such uppers exist, the ports are still in standalone mode as far as the hardware is concerned. But when we deliver packets to the software bridge in order for that to do the forwarding, there is an unpleasant surprise in that the bridge will refuse to forward them. This is because we unconditionally set skb->offload_fwd_mark = true, meaning that the bridge thinks the frames were already forwarded in hardware by us. Since dp->bridge_dev is populated only when there is hardware offload for it, but not in the software fallback case, let's introduce a new helper that can be called from the tagger data path which sets the skb->offload_fwd_mark accordingly to zero when there is no hardware offload for bridging. This lets the bridge forward packets back to other interfaces of our switch, if needed. Signed-off-by: Vladimir Oltean Reviewed-by: Tobias Waldekranz Signed-off-by: David S. Miller commit 57fb346cc7d0fc59af70b4650ee10048f61d7b4f Author: Di Zhu Date: Thu Jul 29 21:19:30 2021 +0800 ipvlan: Add handling of NETDEV_UP events When an ipvlan device is created on a bond device, the link state of the ipvlan device may be abnormal. This is because bonding device allows to add physical network card device in the down state and so NETDEV_CHANGE event will not be notified to other listeners, so ipvlan has no chance to update its link status. The following steps can cause such problems: 1) bond0 is down 2) ip link add link bond0 name ipvlan type ipvlan mode l2 3) echo +enp2s7 >/sys/class/net/bond0/bonding/slaves 4) ip link set bond0 up After these steps, use ip link command, we found ipvlan has NO-CARRIER: ipvlan@bond0: mtu ...> We can deal with this problem like VLAN: Add handling of NETDEV_UP events. If we receive NETDEV_UP event, we will update the link status of the ipvlan. Signed-off-by: Di Zhu Signed-off-by: David S. Miller commit 3aa2605594556c676fb88744bd9845acae60683d Author: Davide Caratti Date: Wed Jul 28 20:08:00 2021 +0200 net/sched: store the last executed chain also for clsact egress currently, only 'ingress' and 'clsact ingress' qdiscs store the tc 'chain id' in the skb extension. However, userspace programs (like ovs) are able to setup egress rules, and datapath gets confused in case it doesn't find the 'chain id' for a packet that's "recirculated" by tc. Change tcf_classify() to have the same semantic as tcf_classify_ingress() so that a single function can be called in ingress / egress, using the tc ingress / egress block respectively. Suggested-by: Alaa Hleilel Signed-off-by: Davide Caratti Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit b2492d503b414e25fc9b9fee347567a083e4b911 Merge: 88ea96f8c14e3 d1626a1c273d0 Author: David S. Miller Date: Thu Jul 29 21:34:45 2021 +0100 Merge branch 'dpaa2-switch-add-mirroring-support' Ioana Ciornei says: ==================== dpaa2-switch: add mirroring support This patch set adds per port and per VLAN mirroring in dpaa2-switch. The first 4 patches are just cosmetic changes. We renamed the dpaa2_switch_acl_tbl structure into dpaa2_switch_filter_block so that we can reuse it for filters that do not use the ACL table and reorganized the addition of trap, redirect and drop filters into a separate function. All this just to make for a more streamlined addition of the support for mirroring. The next 4 patches are actually adding the advertised support. Mirroring rules can be added in shared blocks, the driver will replicate the same configuration on all the switch ports part of the same block. The last patch documents the feature, presents its behavior and limitations and gives a couple of examples. ==================== Signed-off-by: David S. Miller commit d1626a1c273d0e66834006b10ebe12062dce2b6f Author: Ioana Ciornei Date: Thu Jul 29 20:19:01 2021 +0300 docs: networking: dpaa2: document mirroring support on the switch Document the mirroring capabilities of the dpaa2-switch driver, any restrictions that are imposed and some example commands. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 7a91f9078d4fb683f162112a32bd52b2d21fb5c9 Author: Ioana Ciornei Date: Thu Jul 29 20:19:00 2021 +0300 dpaa2-switch: offload shared block mirror filters when binding to a port When mirroring rules are added in shared filter blocks, the same mirroring rule has to be configured on all the switch ports that are part of the same block. In case a switch port joins a shared block after mirroring filters have been already added to it, then all the mirror rules should be offloaded to the port. The reverse, removal of mirroring rules, has to be done at block unbind. For this purpose, the dpaa2_switch_block_offload_mirror() and dpaa2_switch_block_unoffload_mirror() functions are added and called upon binding and unbinding a switch port to/from a block. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 0f3faece58085c94066d14ff9f73e990a55516ac Author: Ioana Ciornei Date: Thu Jul 29 20:18:59 2021 +0300 dpaa2-switch: add VLAN based mirroring Using the infrastructure added in the previous patch, extend tc-flower support with FLOW_ACTION_MIRRED based on VLAN. Tested with: tc qdisc add dev eth8 ingress_block 1 clsact tc filter add block 1 ingress protocol 802.1q flower skip_sw \ vlan_id 100 action mirred egress mirror dev eth6 tc filter del block 1 ingress pref 49152 Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit e0ead825a1f1c9ea4b3a0bf7f2a7e0e10fb71074 Author: Ioana Ciornei Date: Thu Jul 29 20:18:58 2021 +0300 dpaa2-switch: add support for port mirroring Add support for per port mirroring for the DPAA2 switch. We support only single mirror port, therefore we allow mirroring rules only as long as the destination port is always the same. Unlike all the actions (drop, redirect, trap) already supported by the dpaa2-switch driver, adding mirroring filters in shared blocks is not achieved by a singular ACL entry added in a table shared by the ports. This is why, when a new mirror filter is added in a block we have to got through all the switch ports sharing it and configure the filter individually on all. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit cbc2a8893b599dad7308e647d68e388bc175070e Author: Ioana Ciornei Date: Thu Jul 29 20:18:57 2021 +0300 dpaa2-switch: add API for setting up mirroring Add the necessary MC API for setting up and configuring the mirroring feature on the DPSW DPAA2 object. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 3fa5514a2966b48478cd7fbb4e1102fc3dae22a3 Author: Ioana Ciornei Date: Thu Jul 29 20:18:56 2021 +0300 dpaa2-switch: reorganize dpaa2_switch_cls_matchall_replace Extract the necessary steps to offload a filter by using the ACL table in a separate function - dpaa2_switch_cls_matchall_replace_acl(). This is intended to help with the code readability when the mirroring support is added. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit c5f6d490c5782c2fe0fbde1337053f28ebeeb5f2 Author: Ioana Ciornei Date: Thu Jul 29 20:18:55 2021 +0300 dpaa2-switch: reorganize dpaa2_switch_cls_flower_replace Extract the necessary steps to offload a filter by using the ACL table in a separate function - dpaa2_switch_cls_flower_replace_acl(). This is intended to help with the code readability when the mirroring support is added. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit adcb7aa335af165bf8481a269347b0c75af254f0 Author: Ioana Ciornei Date: Thu Jul 29 20:18:54 2021 +0300 dpaa2-switch: rename dpaa2_switch_acl_tbl into filter_block Until now, shared filter blocks were implemented only by ACL tables shared between ports. Going forward, when the mirroring support will be added, this will not be true anymore. Rename the dpaa2_switch_acl_tbl into dpaa2_switch_filter_block so that we make it clear that the structure is used not only for filters that use the ACL table but will be used for all the filters that are added in a block. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 3b5d8b448602d158d042744e2edfb95e20ac5cbd Author: Ioana Ciornei Date: Thu Jul 29 20:18:53 2021 +0300 dpaa2-switch: rename dpaa2_switch_tc_parse_action to specify the ACL Until now, the dpaa2_switch_tc_parse_action() function was used for all the supported tc actions since all of them were implemented by adding ACL table entries. In the next commits, the dpaa2-switch driver will gain mirroring support which is not using the same HW feature. Make sure that we specify the ACL in the function name so that we make it clear that it's only used for specific actions. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 390436f17c12819a4a4a143af13545676aefd60c Author: Mauro Carvalho Chehab Date: Thu Jul 22 11:59:58 2021 +0200 dt-bindings: mtd: update mtd-physmap.yaml reference Changeset 63f8e9e0ac65 ("dt-bindings: mtd: Convert mtd-physmap to DT schema") renamed: Documentation/devicetree/bindings/mtd/mtd-physmap.txt to: Documentation/devicetree/bindings/mtd/mtd-physmap.yaml. Update its cross-reference accordingly. Fixes: 63f8e9e0ac65 ("dt-bindings: mtd: Convert mtd-physmap to DT schema") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ab2ff9ee66110c37691b467ec8b4679e9d426416.1626947923.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 4f45f3404960109843eaa92c8a4a850d6bdd9981 Author: Martin Hundebøll Date: Fri Jul 16 15:54:40 2021 +0200 spi: spi-altera-dfl: support n5010 feature revision The Max10 BMC on the Silicom n5010 PAC is slightly different than the existing BMCs, so use a dedicated feature revision detect it. Acked-by: Mark Brown Reviewed-by: Tom Rix Signed-off-by: Martin Hundebøll Signed-off-by: Moritz Fischer commit f4292e2faf522f899b642d2040a2edbcbd455b9f Author: Ismael Ferreras Morezuelas Date: Sat Jul 17 01:21:43 2021 +0200 Bluetooth: btusb: Make the CSR clone chip force-suspend workaround more generic Turns out Hans de Goede completed the work I started last year trying to improve Chinese-clone detection of CSR controller chips. Quirk after quirk these Bluetooth dongles are more usable now. Even after a few BlueZ regressions; these clones are so fickle that some days they stop working altogether. Except on Windows, they work fine. But this force-suspend initialization quirk seems to mostly do the trick, after a lot of testing Bluetooth now seems to work *all* the time. The only problem is that the solution ended up being masked under a very stringent check; when there are probably hundreds of fake dongle models out there that benefit from a good reset. Make it so. Fixes: 81cac64ba258a ("Bluetooth: Deal with USB devices that are faking CSR vendor") Fixes: cde1a8a992875 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers") Fixes: d74e0ae7e0303 ("Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134") Fixes: 0671c0662383e ("Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers") Cc: stable@vger.kernel.org Cc: Hans de Goede Tested-by: Ismael Ferreras Morezuelas Signed-off-by: Ismael Ferreras Morezuelas Reviewed-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 1604986c3e6bd84f3f3fd709c1a619c6fc9d79a9 Author: Martin Hundebøll Date: Fri Jul 16 15:54:39 2021 +0200 fpga: dfl: expose feature revision from struct dfl_device DFL device drivers have a common need for checking feature revision information from the DFL header, as well as other common DFL information like the already exposed feature id and type. This patch exposes the feature revision information directly via the DFL device data structure. Since the DFL core code has already read the DFL header, this this patch saves additional mmio reads from DFL device drivers too. Acked-by: Wu Hao Acked-by: Matthew Gerlach Signed-off-by: Martin Hundebøll Signed-off-by: Moritz Fischer commit f283f4765b65fde8a1b9927702b107e9fbd06d6a Author: Chethan T N Date: Thu Jul 29 09:43:21 2021 -0700 Bluetooth: btusb: Enable MSFT extension for Intel next generation controllers The Intel TyphoonPeak, GarfieldPeak Bluetooth controllers support the Microsoft vendor extension and they are using 0xFC1E for VsMsftOpCode. Verified on a GarfieldPeak device through bluetoothctl show Signed-off-by: Chethan T N Signed-off-by: Michael Sun Signed-off-by: Marcel Holtmann commit cbe6a0441315dfc0d6db62da3904d5f6d5747fab Author: Michael Sun Date: Thu Jul 29 10:10:59 2021 -0700 Bluetooth: btusb: Enable MSFT extension for WCN6855 controller The Qualcomm WCN6855 Bluetooth controller supports the Microsoft vendor extension, enable them by setting VsMsftOpCode to 0xFD70. Verified on a WCN6855 device through bluetoothctl show Signed-off-by: Michael Sun Signed-off-by: Marcel Holtmann commit 5f1895e0e381f04ef759cd33636d861b0fdcb3d1 Author: Colin Ian King Date: Wed Jul 28 22:51:50 2021 +0100 fpga: Fix spelling mistake "eXchnage" -> "exchange" in Kconfig There is a spelling mistake in the Kconfig text. Fix it. Reviewed-by: Tom Rix Signed-off-by: Colin Ian King Signed-off-by: Moritz Fischer commit 90eed0f89520d92b3ee691c1487395b99070fd81 Author: Kunihiko Hayashi Date: Mon Jul 19 11:31:04 2021 +0900 dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema Convert the UniPhier eFuse binding to DT schema format. Cc: Keiji Hayashibara Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1626661864-15473-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Rob Herring commit 4b2545dd19ed61392d183bddc77c53d6d790b8bb Author: Kunihiko Hayashi Date: Mon Jul 19 11:31:03 2021 +0900 dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Allow to extend expression of sub nodes to optionally indicate bit position. This extension is needed to distinguish between different bit positions in the same address. For example, there are two nvmem nodes starting with bit 4 and bit 0 at the same address 0x54. In this case, it can be expressed as follows. trim@54,4 { reg = <0x54 1>; bits = <4 2>; }; trim@54,0 { reg = <0x54 1>; bits = <0 4>; }; Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1626661864-15473-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Rob Herring commit d4fd4f01e19771ee4e1827acb757ac529ac829d7 Author: Nobuhiro Iwamatsu Date: Sat Jul 17 06:26:21 2021 +0900 dt-bindings: fpga: convert Xilinx Zynq MPSoC bindings to YAML Convert FPGA Manager for Xilinx Zynq MPSoC bindings documentation to YAML. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20210716212621.286806-1-iwamatsu@nigauri.org Signed-off-by: Rob Herring commit 7ee9e21c9f28106ad236c66816759047981b6527 Author: Nobuhiro Iwamatsu Date: Thu Jul 15 18:56:27 2021 +0900 dt-bindings: power: reset: convert Xilinx Zynq MPSoC bindings to YAML Convert power managemnet for Xilinx Zynq MPSoC bindings documentation to YAML. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20210715095627.228176-1-iwamatsu@nigauri.org Signed-off-by: Rob Herring commit e5de9d283a36a2923f7f309050b8c51b14753c3a Author: Sergio Paracuellos Date: Wed Jul 28 06:12:53 2021 +0200 gpio: brcmstb: remove custom 'brcmstb_gpio_set_names' Gpiolib core code has been updated to support setting friendly names through properly 'gpio-line-names'. Instead of redefine behaviour here to skip the core to be executed, just properly assign the desired offset per bank to get in the core the expected behaviour. Reviewed-by: Andy Shevchenko Acked-by: Gregory Fong Signed-off-by: Sergio Paracuellos Signed-off-by: Bartosz Golaszewski commit 0fb903914914a10b04dc8e5e5b09c8dca452ca91 Author: Sergio Paracuellos Date: Wed Jul 28 06:12:52 2021 +0200 gpio: mt7621: support gpio-line-names property This driver uses multiple gpiochip banks per device. To support 'gpio-line-names' along the banks 'offset' for each bank must be set explicitly. Reviewed-by: Andy Shevchenko Signed-off-by: Sergio Paracuellos Signed-off-by: Bartosz Golaszewski commit 4e804c39f1be4498d80f379e5b7bc6d4f80f813c Author: Sergio Paracuellos Date: Wed Jul 28 06:12:51 2021 +0200 gpiolib: convert 'devprop_gpiochip_set_names' to support multiple gpiochip banks per device The default gpiolib-of implementation does not work with the multiple gpiochip banks per device structure used for example by the gpio-mt7621 and gpio-brcmstb drivers. To fix these kind of situations driver code is forced to fill the names to avoid the gpiolib code to set names repeated along the banks. Instead of continue with that antipattern fix the gpiolib core function to get expected behaviour for every single situation adding a field 'offset' in the gpiochip structure. Doing in this way, we can assume this offset will be zero for normal driver code where only one gpiochip bank per device is used but can be set explicitly in those drivers that really need more than one gpiochip. Reviewed-by: Andy Shevchenko Reviewed-by: Gregory Fong Signed-off-by: Sergio Paracuellos Signed-off-by: Bartosz Golaszewski commit f728c4a9e8405caae69d4bc1232c54ff57b5d20f Author: Zhen Lei Date: Thu Jul 22 11:03:52 2021 +0800 workqueue: Fix possible memory leaks in wq_numa_init() In error handling branch "if (WARN_ON(node == NUMA_NO_NODE))", the previously allocated memories are not released. Doing this before allocating memory eliminates memory leaks. tj: Note that the condition only occurs when the arch code is pretty broken and the WARN_ON might as well be BUG_ON(). Signed-off-by: Zhen Lei Reviewed-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 6266992cf1052432bcb592dd6f22f9be7960ddb0 Author: Lucas De Marchi Date: Wed Jul 28 15:03:26 2021 -0700 drm/i915/gt: remove GRAPHICS_VER == 10 Replace all remaining handling of GRAPHICS_VER {==,>=} 10 with {==,>=} 11. With the removal of CNL, there is no platform with graphics version equals 10. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728220326.1578242-5-lucas.demarchi@intel.com commit 701d31860d34302190bfb0fdbedc987977562961 Author: Lucas De Marchi Date: Wed Jul 28 15:03:25 2021 -0700 drm/i915/gt: rename CNL references in intel_engine.h With the removal of CNL, let's consider ICL as the first platform using that index. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728220326.1578242-4-lucas.demarchi@intel.com commit 91a197e4e140dcf2a525a43348b87378c9c3a234 Author: Lucas De Marchi Date: Wed Jul 28 15:03:24 2021 -0700 drm/i915/gt: remove explicit CNL handling from intel_sseu.c CNL is the only platform with GRAPHICS_VER == 10. With its removal we don't need to handle that version anymore. Also we can now reduce the max number of slices: the call to intel_sseu_set_info() with the highest number of slices comes from SKL and BDW with 3 slices. Recent platforms actually increase the number of subslices so the number of slices remain 1. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210728220326.1578242-3-lucas.demarchi@intel.com commit 94fd8400c2a37e88f6f82ef1553bf6336b8569b1 Author: Lucas De Marchi Date: Wed Jul 28 15:03:23 2021 -0700 drm/i915/gt: remove explicit CNL handling from intel_mocs.c Only one reference to CNL that is not needed, but code is the same for GEN9_BC, so leave the code around and just remove the special case for CNL. Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210728220326.1578242-2-lucas.demarchi@intel.com commit 155b8645de9e0f07b654025fe91725ca2f67d12a Author: Khaled Almahallawy Date: Fri Feb 26 00:15:54 2021 -0800 drm/i915/dp: DPTX writes Swing/Pre-emphs(DPCD 0x103-0x106) requested during PHY Layer testing Source needs to write DPCD 103-106 after receiving a PHY request to change swing/pre-emphasis after reading DPCD 206-207. This is especially needed if there is a retimer between source and sink and the retimer implements AUX_CH interception scheme to manage DP PHY settings (e.g. adjusting Swing/Pre-emphasis equalization level) for DP output channel. If the source doesn't write to DPCD 103-106, the retimer may not output the requested swing/pre-emphasis and eventually we fail compliance. v2: Rebase and use crtc->lane_count (Imre) Signed-off-by: Khaled Almahallawy Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20210226081554.984307-1-khaled.almahallawy@intel.com Reviewed-by: Imre Deak Signed-off-by: Imre Deak commit 11955c87d209c81cec6bb7c21a2a12c4c48c4fb4 Author: Animesh Manna Date: Fri Jul 23 10:42:38 2021 -0700 drm/i915/dg2: Update to bigjoiner path In verify_mpllb_state() encoder is retrieved from best_encoder of connector_state. As there will be only one connector_state for bigjoiner and checking encoder may not be needed for bigjoiner-slave. This code path related to mpll is done on dg2 and need this fix to avoid null pointer dereference issue. Cc: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Matt Roper Reviewed-by: Manasi Navare Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-30-matthew.d.roper@intel.com commit 7711749a604996a41e14b66e3163e045a89fe8e1 Author: Gwan-gyeong Mun Date: Fri Jul 23 10:42:37 2021 -0700 drm/i915/dg2: Update lane disable power state during PSR The PSR enable/disable sequences now require that we program an extra register in the PHY to adjust the lane disable power setting. Bspec: 49274 Bspec: 53885 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Signed-off-by: Gwan-gyeong Mun Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-29-matthew.d.roper@intel.com commit a6a128116e55970a2df9f39e31e3c8373c0ff558 Author: Matt Roper Date: Fri Jul 23 10:42:36 2021 -0700 drm/i915/dg2: Wait for SNPS PHY calibration during display init Initialization of the PHY is handled by the hardware/firmware, but the driver should wait up to 25ms for the PHY to report that its calibration has completed. Bspec: 49189 Bspec: 50107 Cc: Matt Atwood Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-28-matthew.d.roper@intel.com commit ff6c95d251617f5b2eb1e7ea1d32d51a162e6a01 Merge: dfe1114638d18 51a3dd58424e7 Author: Mark Brown Date: Thu Jul 29 17:24:46 2021 +0100 Merge series "ASoC: soc-core: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-core. Kuninori Morimoto (7): ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name() ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name() ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format() ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component() ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls() ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets() ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing() sound/soc/soc-core.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) -- 2.25.1 commit f82f2563bc6000e01820df7a5a969ec89a77d1d7 Author: Matt Roper Date: Fri Jul 23 10:42:35 2021 -0700 drm/i915/dg2: Update modeset sequences DG2 has some changes to the expected modesetting sequences when compared to gen12. Adjust our driver logic accordingly. Although the DP sequence is pretty similar to TGL's, there are some steps that change, so let's split the handling for that out into a separate function. v2: - Switch wait_for_us() -> _wait_for() so that we can parameterize the timeout rather than duplicating the macro call. (Jani) Bspec: 54128 Cc: Lucas De Marchi Cc: Anusha Srivatsa Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-27-matthew.d.roper@intel.com commit a046a0daa3c6855d63fdf108919bb9666ba96c82 Author: Matt Roper Date: Fri Jul 23 10:42:34 2021 -0700 drm/i915/dg2: Add vswing programming for SNPS phys Vswing programming for SNPS PHYs is just a single step -- look up the value that corresponds to the voltage level from a table and program it into the SNPS_PHY_TX_EQ register. Bspec: 53920 Cc: Matt Atwood Signed-off-by: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-26-matthew.d.roper@intel.com commit 865b73ea18bbbb4da4be61186354aaca89d31303 Author: Matt Roper Date: Fri Jul 23 10:42:33 2021 -0700 drm/i915/dg2: Add MPLLB programming for HDMI At the moment we don't have a proper algorithm that can be used to calculate PHY settings for arbitrary HDMI link rates. The PHY tables here should support the regular modes of real-world HDMI monitors. Bspec: 54032 Cc: Matt Atwood Signed-off-by: Matt Roper Signed-off-by: Vandita Kulkarni Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-25-matthew.d.roper@intel.com commit 29081008047892acb39099c39d39f84c2e7fb028 Author: Matt Roper Date: Fri Jul 23 10:42:32 2021 -0700 drm/i915/dg2: Add MPLLB programming for SNPS PHY DG2's SNPS PHYs incorporate a dedicated port PLL called MPLLB which takes the place of the shared DPLLs we've used on past platforms. Let's add the MPLLB programming sequences; they'll be plugged into the rest of the code in future patches. Bspec: 54032 Bspec: 53881 Cc: Lucas De Marchi Signed-off-by: Matt Roper Signed-off-by: Vandita Kulkarni Signed-off-by: Jani Nikula Signed-off-by: Nidhi Gupta Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-24-matthew.d.roper@intel.com commit 9b945d74a5fc14c1f9a7ae98c10921d48c194105 Author: Andy Shevchenko Date: Mon Jun 7 18:37:29 2021 +0300 pps: clients: parport: Switch to use module_parport_driver() Switch to use module_parport_driver() to reduce boilerplate code. Acked-by: Rodolfo Giometti Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210607153729.58623-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7aaabc37943f383ec8d8e51b7fc43ae60fac4206 Author: Len Baker Date: Sun Jul 18 15:12:17 2021 +0200 staging/vc04_services: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210718131217.3806-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 041878d46ba37157814e6b650c9eff6efa7070d6 Author: Fabio Aiuto Date: Thu Jul 29 14:54:17 2021 +0200 staging: rtl8723bs: remove unused BT static variables remove some unused static variables. One of them is used to toggle on the BT coexistence mechanism, but it is always enabled and it's not conditioned to the value of the related parameter. Remove unused field of the registry_priv struct as well, they were intended for hosting the parameters this patch rids. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/20210729125417.4380-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit fa11c81ce2a19b30af2fc16d3958efece4fd56d0 Author: Andy Shevchenko Date: Wed Jul 21 18:02:16 2021 +0300 parport: serial: Retrieve IRQ vector with help of special getter pci_irq_vector() may be used to retrieve IRQ vector for a PCI device. Use it instead of direct access. Acked-by: Sudip Mukherjee Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210721150216.64823-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 09b18f2f3be256cc32eff028a9416a2ae19d5487 Author: Andy Shevchenko Date: Wed Jul 21 18:02:15 2021 +0300 parport: serial: Get rid of IRQ_NONE abuse IRQ_NONE definition is solely for IRQ handlers and not for generic probe code. Replace it with plain integer. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210721150216.64823-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0912ef4855e8e463a8d724efd6bee08e9b5d3f1e Author: Krzysztof Kozlowski Date: Thu Jul 29 12:28:03 2021 +0200 mei: constify passed buffers and structures Buffers and structures passed to MEI bus and client API can be made const for safer code and clear indication that it is not modified. Acked-by: Arnd Bergmann Acked-by: Tomas Winkler Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210729102803.46289-1-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman commit 6c44eb5905f6cc731b36c4170f703f81e477f039 Author: Tony Lindgren Date: Tue Jul 27 13:31:49 2021 +0300 serial: omap: Only allow if 8250_omap is not selected For years we've been carrying legacy omap-serial in addition to 8250_omap driver and 8250_omap should be used instead. Let's finally start planning on removing omap-serial by first not building it if 8250_omap is selected to save some memory. The defconfigs have switched over to using 8250_omap, and we have a fixup in place for the the serial console since commit 00648d0282dc ("tty: serial: 8250: omap: add ttySx console if the user didn't"). So people updating their systems without omap-serial will see boot time warnings on what is going on. Cc: Andy Shevchenko Cc: Dario Binacchi Cc: Vignesh Raghavendra Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727103149.51175-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 33e5571ebdec49cb87e8cbba730cf046dfb44e80 Author: Tony Lindgren Date: Tue Jul 27 13:31:48 2021 +0300 serial: omap: Disable PM runtime autoidle to remove pm_runtime_irq_safe() We want to remove the use of pm_runtime_irq_safe() from serial drivers to allow making PM runtime handling generic. Let's simplify things by disabling PM runtime autoidle for omap-serial as this driver has been deprecated for years because of the 8250_omap driver. There are still some omap-serial users that seem to hang on to it for some unknown rs485 reasons it seems. But presumably those folks do not need PM runtime autoidle with omap-serial, and hopefully can just move to using 8250_omap driver instead. For 8250_omap driver, we will eventually move to use generic serial layer PM based on patches done by Andy Shevchenko to remove pm_runtime_irq_safe() usage. Cc: Andy Shevchenko Cc: Dario Binacchi Cc: Vignesh Raghavendra Reviewed-by: Andy Shevchenko Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727103149.51175-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 64cd4271ea8e6247f7ed14c443e41d0f5866aac0 Author: Rikard Falkeborn Date: Wed Jul 28 11:20:52 2021 +0200 usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops The struct pxa25x_ep_ops is only assigned to the ops field in the usb_ep struct, which is a pointer to const struct usb_ep_ops. Make it const to allow the compiler to put it in read-only memory. Acked-by: Felipe Balbi Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20210728092052.4178-1-rikard.falkeborn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0132bf6f395837fc77fb38ac3d2806d22426be51 Author: Konrad Dybcio Date: Thu Jul 29 00:19:21 2021 +0200 drivers: usb: dwc3-qcom: Add sdm660 compatible Add a new compatible for SDM660's DWC3. Acked-by: Felipe Balbi Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20210728221921.52068-1-konrad.dybcio@somainline.org Signed-off-by: Greg Kroah-Hartman commit 88ea96f8c14e39f7ee397b815de622ea5e1481ab Author: Shai Malin Date: Thu Jul 29 13:00:42 2021 +0300 qede: Remove the qede module version Removing the qede module version which is not needed and not allowed with inbox drivers. Signed-off-by: Prabhakar Kushwaha Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit 7a3febed44557fc318cf6c853e12d76a4145183e Author: Shai Malin Date: Thu Jul 29 13:00:11 2021 +0300 qed: Remove the qed module version Removing the qed module version which is not needed and not allowed with inbox drivers. Signed-off-by: Prabhakar Kushwaha Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller commit dfe1114638d1888916fd9ceb50314e19f632dfad Author: Jiri Slaby Date: Thu Jul 22 13:51:41 2021 +0200 ASoC: v253_init: eliminate pointer to string There is no need to have an extra pointer to a string (v253_init). Convert it to an array. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210722115141.516-2-jslaby@suse.cz Signed-off-by: Mark Brown commit d7a3a6801913a4b57a7e525c4906d348213acfb0 Author: Jiri Slaby Date: Thu Jul 22 13:51:40 2021 +0200 ASoC: cx20442: tty_ldisc_ops::write_wakeup is optional TTY layer does nothing if tty_ldisc_ops::write_wakeup is NULL, so there is no need to implement an empty one in cx20442. Drop it. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210722115141.516-1-jslaby@suse.cz Signed-off-by: Mark Brown commit 2080acf3d18029ca52189a14b2ee462ea89c5d06 Author: Rikard Falkeborn Date: Wed Jul 28 19:25:48 2021 +0200 ASoC: samsung: Constify static snd_soc_ops These are only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. 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/20210728172548.234943-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 51a3dd58424e7312e70445fcb4bca5924640af2c Author: Kuninori Morimoto Date: Thu Jul 29 10:16:01 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:2931:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o8alyl67.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 99c68653a56528ce66edf3d87bc050eee2ce0aee Author: Kuninori Morimoto Date: Thu Jul 29 10:15:56 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:2777:25: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, j, num_widgets, ret; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmv1yl6b.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit eaf2469c340b854f5c19339d613234ce2c774a38 Author: Kuninori Morimoto Date: Thu Jul 29 10:15:52 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:2239:6: style: The scope of the variable 'err' can be reduced. [variableScope] int err, i; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r1fhyl6f.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5600f3d5ac53304b5068f55c69afa2b8b2380b2b Author: Kuninori Morimoto Date: Thu Jul 29 10:15:47 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:2719:28: style: The scope of the variable 'component' can be reduced. [variableScope] struct snd_soc_component *component; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfzxyl6k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5ad76775a522f728d89687523accb061f3ffb1f6 Author: Kuninori Morimoto Date: Thu Jul 29 10:15:42 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:3056:11: style: The scope of the variable 'i' can be reduced. [variableScope] int ret, i; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tukdyl6p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit bce00560a28e0f62b0250652b611365f363c712b Author: Kuninori Morimoto Date: Thu Jul 29 10:15:38 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name() This patch cleanups below cppcheck warning. sound/soc/soc-core.c:3203:22: style: The scope of the variable 'component_of_node' can be reduced. [variableScope] struct device_node *component_of_node; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87v94tyl6t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit cdb76568b09db0ba1aa47f4e55501024342c9dfc Author: Kuninori Morimoto Date: Thu Jul 29 10:15:33 2021 +0900 ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name() This patch cleanups below cppcheck warning. const char *vendor, *product, *product_version, *board; ^ sound/soc/soc-core.c:1721:33: style: The scope of the variable 'product_version' can be reduced. [variableScope] Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wnp9yl6y.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3bdf4d6196eb5432e7884491456b158d9b670e64 Merge: e5fe3a5fe333b 04a1758348a87 Author: David S. Miller Date: Thu Jul 29 15:35:01 2021 +0100 Merge branch 'sja110-vlan-fixes' Vladimir Oltean says: ==================== NXP SJA1105 VLAN regressions These are 3 patches to fix issues seen with some more varied testing done after the changes in the "Traffic termination for sja1105 ports under VLAN-aware bridge" series were made: https://patchwork.kernel.org/project/netdevbpf/cover/20210726165536.1338471-1-vladimir.oltean@nxp.com/ Issue 1: traffic no longer works on a port after leaving a VLAN-aware bridge Issue 2: untagged traffic not dropped if pvid is absent from a VLAN-aware port Issue 3: PTP and STP broken on ports under a VLAN-aware bridge ==================== Signed-off-by: David S. Miller commit 04a1758348a87eb73b8a4554d0c227831e2bb33e Author: Vladimir Oltean Date: Thu Jul 29 00:54:29 2021 +0300 net: dsa: tag_sja1105: fix control packets on SJA1110 being received on an imprecise port On RX, a control packet with SJA1110 will have: - an in-band control extension (DSA tag) composed of a header and an optional trailer (if it is a timestamp frame). We can (and do) deduce the source port and switch id from this. - a VLAN header, which can either be the tag_8021q RX VLAN (pvid) or the bridge VLAN. The sja1105_vlan_rcv() function attempts to deduce the source port and switch id a second time from this. The basic idea is that even though we don't need the source port information from the tag_8021q header if it's a control packet, we do need to strip that header before we pass it on to the network stack. The problem is that we call sja1105_vlan_rcv for ports under VLAN-aware bridges, and that function tells us it couldn't identify a tag_8021q header, so we need to perform imprecise RX by VID. Well, we don't, because we already know the source port and switch ID. This patch drops the return value from sja1105_vlan_rcv and we just look at the source_port and switch_id values from sja1105_rcv and sja1110_rcv which were initialized to -1. If they are still -1 it means we need to perform imprecise RX. Fixes: 884be12f8566 ("net: dsa: sja1105: add support for imprecise RX") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit bef0746cf4cce238b1943df5d5b8f3103da92ead Author: Vladimir Oltean Date: Thu Jul 29 00:54:28 2021 +0300 net: dsa: sja1105: make sure untagged packets are dropped on ingress ports with no pvid Surprisingly, this configuration: ip link add br0 type bridge vlan_filtering 1 ip link set swp2 master br0 bridge vlan del dev swp2 vid 1 still has the sja1105 switch sending untagged packets to the CPU (and failing to decode them, since dsa_find_designated_bridge_port_by_vid searches by VID 1 and rightfully finds no bridge VLAN 1 on a port). Dumping the switch configuration, the VLANs are managed properly: - the pvid of swp2 is 1 in the MAC Configuration Table, but - only the CPU port is in the port membership of VLANID 1 in the VLAN Lookup Table When the ingress packets are tagged with VID 1, they are properly dropped. But when they are untagged, they are able to reach the CPU port. Also, when the pvid in the MAC Configuration Table is changed to e.g. 55 (an unused VLAN), the untagged packets are also dropped. So it looks like: - the switch bypasses ingress VLAN membership checks for untagged traffic - the reason why the untagged traffic is dropped when I make the pvid 55 is due to the lack of valid destination ports in VLAN 55, rather than an ingress membership violation - the ingress VLAN membership cheks are only done for VLAN-tagged traffic Interesting. It looks like there is an explicit bit to drop untagged traffic, so we should probably be using that to preserve user expectations. Note that only VLAN-aware ports should drop untagged packets due to no pvid - when VLAN-unaware, the software bridge doesn't do this even if there is no pvid on any bridge port and on the bridge itself. So the new sja1105_drop_untagged() function cannot simply be called with "false" from sja1105_bridge_vlan_add() and with "true" from sja1105_bridge_vlan_del. Instead, we need to also consider the VLAN awareness state. That means we need to hook the "drop untagged" setting in all the same places where the "commit pvid" logic is, and it needs to factor in all the state when flipping the "drop untagged" bit: is our current pvid in the VLAN Lookup Table, and is the current port in that VLAN's port membership list? VLAN-unaware ports will never drop untagged frames because these checks always succeed by construction, and the tag_8021q VLANs cannot be changed by the user. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit cde8078e83e32022e30a4f670c2c8179f2f08991 Author: Vladimir Oltean Date: Thu Jul 29 00:54:27 2021 +0300 net: dsa: sja1105: reset the port pvid when leaving a VLAN-aware bridge Now that we no longer have the ultra-central sja1105_build_vlan_table(), we need to be more careful about checking all corner cases manually. For example, when a port leaves a VLAN-aware bridge, it becomes standalone so its pvid should become a tag_8021q RX VLAN again. However, sja1105_commit_pvid() only gets called from sja1105_bridge_vlan_add() and from sja1105_vlan_filtering(), and no VLAN awareness change takes place (VLAN filtering is a global setting for sja1105, so the switch remains VLAN-aware overall). This means that we need to put another sja1105_commit_pvid() call in sja1105_bridge_member(). Fixes: 6dfd23d35e75 ("net: dsa: sja1105: delete vlan delta save/restore logic") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 10102a890b543a8a08457dc69fa55bc032403c7d Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Tue Jul 27 14:06:35 2021 +0100 printk: Add printk.console_no_auto_verbose boot parameter console_verbose() increases console loglevel to CONSOLE_LOGLEVEL_MOTORMOUTH, which provides more information to debug a panic/oops. Unfortunately, in Arista we maintain some DUTs (Device Under Test) that are configured to have 9600 baud rate. While verbose console messages have their value to post-analyze crashes, on such setup they: - may prevent panic/oops messages being printed - take too long to flush on console resulting in watchdog reboot In all our setups we use kdump which saves dmesg buffer after panic, so in reality those extra messages on console provide no additional value, but rather add risk of not getting to __crash_kexec(). Provide printk.console_no_auto_verbose boot parameter, which allows to switch off printk being verbose on oops/panic/lockdep. Cc: Andrew Morton Cc: John Ogness Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Signed-off-by: Dmitry Safonov Suggested-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Tested-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210727130635.675184-3-dima@arista.com commit c9110dfcfccb3f31eda47a36ed0a022e390d1417 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Tue Jul 27 14:06:34 2021 +0100 printk: Remove console_silent() It' unused since removal of mn10300: commit 739d875dd698 ("mn10300: Remove the architecture") x86 stopped using it in v2.6.12 (see history git): commit 7574828b3dbb ("[PATCH] x86_64: add nmi button support") Let's clean it up from the header. Signed-off-by: Dmitry Safonov Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210727130635.675184-2-dima@arista.com commit e5fe3a5fe333b9967eeb99966bcf3ec710318554 Merge: 658e6b1612c6c 6a2d98b189000 Author: David S. Miller Date: Thu Jul 29 15:06:50 2021 +0100 Merge branch 'mctp' Jeremy Kerr says: ==================== Add Management Component Transport Protocol support This series adds core MCTP support to the kernel. From the Kconfig description: Management Component Transport Protocol (MCTP) is an in-system protocol for communicating between management controllers and their managed devices (peripherals, host processors, etc.). The protocol is defined by DMTF specification DSP0236. This option enables core MCTP support. For communicating with other devices, you'll want to enable a driver for a specific hardware channel. This implementation allows a sockets-based API for sending and receiving MCTP messages via sendmsg/recvmsg on SOCK_DGRAM sockets. Kernel stack control is all via netlink, using existing RTM_* messages. The userspace ABI change is fairly small; just the necessary AF_/ETH_P_/ARPHDR_ constants, a new sockaddr, and a new netlink attribute. For MAINTAINERS, I've just included netdev@ as the list entry. I'm happy to alter this based on preferences here - an alternative would be the OpenBMC list (the main user of the MCTP interface), or we can create a new list entirely. We have a couple of interface drivers almost ready to go at the moment, but those can wait until the core code has some review. This is v4 of the series; v1 and v2 were both RFC. selinux folks: CCing 01/15 due to the new PF_MCTP protocol family. linux-doc folks: CCing 15/15 for the new MCTP overview document. Review, comments, questions etc. are most welcome. Cheers, Jeremy v2: - change to match spec terminology: controller -> component - require specific capabilities for bind() & sendmsg() - add address and tag defintions to uapi - add selinux AF_MCTP table definitions - remove strict cflags; warnings are present in common headers v3: - require caps for MCTP bind() & send() - comment typo fixes - switch to an array for local EIDs - fix addrinfo dump iteration & error path - add RTM_DELADDR - remove GENMASK() and BIT() from uapi v4: - drop tun patch; that can be submitted separately - keep nipa happy: add maintainer CCs, including doc and selinux - net-next rebase - Include AF_MCTP in af_family_slock_keys and pf_family_names - Introduce MODULE_ definitions earlier - upstream change: set_link_af no longer called with RTNL held - add kdoc for net_device.mctp_ptr - don't inline mctp_rt_match_eid - require rtm_type == RTN_UNICAST in route management handlers - remove unused RTAX policy table - fix mctp_sock->keys rcu annotations - fix spurious rcu_read_unlock in route input ==================== Signed-off-by: David S. Miller commit 6a2d98b18900002b6d24c4c3850c1c2467d13898 Author: Jeremy Kerr Date: Thu Jul 29 10:20:53 2021 +0800 mctp: Add MCTP overview document This change adds a brief document about the sockets API provided for sending and receiving MCTP messages from userspace. This is roughly based on the OpenBMC design document, at: https://github.com/openbmc/docs/blob/master/designs/mctp/mctp-kernel.md Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 03f2bbc4ee57ca53b2fa1d9caabc5006e0b8f375 Author: Matt Johnston Date: Thu Jul 29 10:20:52 2021 +0800 mctp: Allow per-netns default networks Currently we have a compile-time default network (MCTP_INITIAL_DEFAULT_NET). This change introduces a default_net field on the net namespace, allowing future configuration for new interfaces. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 26ab3fcaf23568cc8fc06aeb9306f3544969f252 Author: Matt Johnston Date: Thu Jul 29 10:20:51 2021 +0800 mctp: Add dest neighbour lladdr to route output Now that we have a neighbour implementation, hook it up to the output path to set the dest hardware address for outgoing packets. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 4a992bbd365094730a31bae1e12a6ca695336d57 Author: Jeremy Kerr Date: Thu Jul 29 10:20:50 2021 +0800 mctp: Implement message fragmentation & reassembly This change implements MCTP fragmentation (based on route & device MTU), and corresponding reassembly. The MCTP specification only allows for fragmentation on the originating message endpoint, and reassembly on the destination endpoint - intermediate nodes do not need to reassemble/refragment. Consequently, we only fragment in the local transmit path, and reassemble locally-bound packets. Messages are required to be in-order, so we simply cancel reassembly on out-of-order or missing packets. In the fragmentation path, we just break up the message into MTU-sized fragments; the skb structure is a simple copy for now, which we can later improve with a shared data implementation. For reassembly, we keep track of incoming message fragments using the existing tag infrastructure, allocating a key on the (src,dest,tag) tuple, and reassembles matching fragments into a skb->frag_list. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 833ef3b91de692ef33b800bca6b1569c39dece74 Author: Jeremy Kerr Date: Thu Jul 29 10:20:49 2021 +0800 mctp: Populate socket implementation Start filling-out the socket syscalls: bind, sendmsg & recvmsg. This requires an input route implementation, so we add to mctp_route_input, allowing lookups on binds & message tags. This just handles single-packet messages at present, we will add fragmentation in a future change. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 831119f8878173adbf31f1151adf0f4627c05e01 Author: Matt Johnston Date: Thu Jul 29 10:20:48 2021 +0800 mctp: Add neighbour netlink interface This change adds the netlink interfaces for manipulating the MCTP neighbour table. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 4d8b9319282ae84f5a17b28d8b5b5d1e7e537312 Author: Matt Johnston Date: Thu Jul 29 10:20:47 2021 +0800 mctp: Add neighbour implementation Add an initial neighbour table implementation, to be used in the route output path. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 06d2f4c583a7d892300920fc85d654d48a15e914 Author: Matt Johnston Date: Thu Jul 29 10:20:46 2021 +0800 mctp: Add netlink route management This change adds RTM_GETROUTE, RTM_NEWROUTE & RTM_DELROUTE handlers, allowing management of the MCTP route table. Includes changes from Jeremy Kerr . Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 889b7da23abf92faf34491df95733bda63639e32 Author: Jeremy Kerr Date: Thu Jul 29 10:20:45 2021 +0800 mctp: Add initial routing framework Add a simple routing table, and a couple of route output handlers, and the mctp packet_type & handler. Includes changes from Matt Johnston . Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 583be982d93479ea3d85091b0fd0b01201ede87d Author: Jeremy Kerr Date: Thu Jul 29 10:20:44 2021 +0800 mctp: Add device handling and netlink interface This change adds the infrastructure for managing MCTP netdevices; we add a pointer to the AF_MCTP-specific data to struct netdevice, and hook up the rtnetlink operations for adding and removing addresses. Includes changes from Matt Johnston . Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 4b2e69305cbbc7c32ecbd946110b505c4ff6071a Author: Jeremy Kerr Date: Thu Jul 29 10:20:43 2021 +0800 mctp: Add initial driver infrastructure Add an empty drivers/net/mctp/, for future interface drivers. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 60fc63981693f807baa0e404104dedea0e8b4e61 Author: Jeremy Kerr Date: Thu Jul 29 10:20:42 2021 +0800 mctp: Add sockaddr_mctp to uapi This change introduces the user-visible MCTP header, containing the protocol-specific addressing definitions. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 2c8e2e9aec7927b387540a88351b8405ee82b34a Author: Jeremy Kerr Date: Thu Jul 29 10:20:41 2021 +0800 mctp: Add base packet definitions Simple packet header format as defined by DMTF DSP0236. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 8f601a1e4f8c84f0a5d249837c567565844fe56e Author: Jeremy Kerr Date: Thu Jul 29 10:20:40 2021 +0800 mctp: Add base socket/protocol definitions Add an empty socket implementation, plus initialisation/destruction handlers. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit bc49d8169aa72295104f1558830c568efb946315 Author: Jeremy Kerr Date: Thu Jul 29 10:20:39 2021 +0800 mctp: Add MCTP base Add basic Kconfig, an initial (empty) af_mctp source object, and {AF,PF}_MCTP definitions, and the required definitions for a new protocol type. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 340cd23d9dec58b1b07ecaa205a161faf50eab8a Author: Ian Mackinnon Date: Fri Apr 23 17:17:16 2021 +0200 Bluetooth: btusb: Load Broadcom firmware for Dell device 413c:8197 Remove the btusb_table entry for 413c:8197 so the device is handled by the later Dell vendor entry, which specifies patchram loading. T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=413c ProdID=8197 Rev= 1.12 S: Manufacturer=Dell Computer Corp S: Product=DW380 Bluetooth Module S: SerialNumber=74E54354F609 C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr= 0mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=btusb E: Ad=84(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none) Signed-off-by: Ian Mackinnon Tested-By: Aathif Naseer Signed-off-by: Marcel Holtmann commit 785077fa2d6791d036b4227924276534ae0f192f Author: Len Baker Date: Sat Jul 24 14:21:52 2021 +0200 Bluetooth: btmrvl_sdio: Remove all strcpy() uses strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy() but in this case it is better to use the scnprintf to simplify the arithmetic. This is a previous step in the path to remove the strcpy() function entirely from the kernel. Signed-off-by: Len Baker Signed-off-by: Marcel Holtmann commit 92fe24a7db751b80925214ede43f8d2be792ea7b Author: Desmond Cheong Zhi Xi Date: Wed Jul 28 15:51:04 2021 +0800 Bluetooth: skip invalid hci_sync_conn_complete_evt Syzbot reported a corrupted list in kobject_add_internal [1]. This happens when multiple HCI_EV_SYNC_CONN_COMPLETE event packets with status 0 are sent for the same HCI connection. This causes us to register the device more than once which corrupts the kset list. As this is forbidden behavior, we add a check for whether we're trying to process the same HCI_EV_SYNC_CONN_COMPLETE event multiple times for one connection. If that's the case, the event is invalid, so we report an error that the device is misbehaving, and ignore the packet. Link: https://syzkaller.appspot.com/bug?extid=66264bf2fd0476be7e6c [1] Reported-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com Tested-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Marcel Holtmann commit 658e6b1612c6cc680381b6827dca9c3ee8862ee6 Merge: 8cb79af5c63ff 2695503729dae Author: David S. Miller Date: Thu Jul 29 12:28:03 2021 +0100 Merge branch 'nfc-const' Krzysztof Kozlowski says: ==================== nfc: constify, continued (part 2) On top of: nfc: constify pointed data https://lore.kernel.org/lkml/20210726145224.146006-1-krzysztof.kozlowski@canonical.com/ ==================== Signed-off-by: David S. Miller commit 2695503729dae562aea5e9bbd1722aa5fa1f05bf Author: Krzysztof Kozlowski Date: Thu Jul 29 12:42:41 2021 +0200 nfc: mrvl: constify static nfcmrvl_if_ops File-scope struct nfcmrvl_if_ops is not modified so can be made const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit fe53159fe3e0639a75ffbe320b9909e0055c743f Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:21 2021 +0200 nfc: mrvl: constify several pointers Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit a751449f8b477e0e1d97f778ed97ae9f6576b690 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:20 2021 +0200 nfc: microread: constify several pointers Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 3d463dd5023b5a58b3c37207d65eeb5acbac2be3 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:19 2021 +0200 nfc: fdp: constify several pointers Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. This allows also making file-scope nci_core_get_config_otp_ram_version array const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit c3e26b6dc1b4e3e8f57be4f004b1f2a410c5c468 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:18 2021 +0200 nfc: fdp: use unsigned int as loop iterator Loop iterators are simple integers, no point to optimize the size and use u8. It only raises the question whether the variable is used in some other context. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 6c755b1d251180fbdfe458591fc4dfe8704b0006 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:17 2021 +0200 nfc: fdp: drop unneeded cast for printing firmware size in dev_dbg() Size of firmware is a type of size_t, so print it directly instead of casting to int. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 582fdc98adc8a0f4286cff0e2c6226750cf190ee Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:16 2021 +0200 nfc: nfcsim: constify drvdata (struct nfcsim) nfcsim_abort_cmd() does not modify struct nfcsim, so local variable can be a pointer to const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 83428dbbac514f33597e6c8c571969027b3fac82 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:15 2021 +0200 nfc: virtual_ncidev: constify pointer to nfc_dev virtual_ncidev_ioctl() does not modify struct nfc_dev, so local variable can be a pointer to const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit ea050c5ee74a996ee4577a5c3852c53cd8219412 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:14 2021 +0200 nfc: trf7970a: constify several pointers Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 9a4af01c35a5bed9d717433651629e4c9865f8f2 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:13 2021 +0200 nfc: port100: constify several pointers Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 894a6e15863307d8821857aaa2ecf80cde2a6c82 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:12 2021 +0200 nfc: mei_phy: constify buffer passed to mei_nfc_send() The buffer passed to mei_nfc_send() can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit dd8987a394c0730380167e0b0aebd766cf3511e1 Author: Krzysztof Kozlowski Date: Thu Jul 29 12:40:11 2021 +0200 nfc: constify passed nfc_dev The struct nfc_dev is not modified by nfc_get_drvdata() and nfc_device_name() so it can be made a const. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 8cb79af5c63ff2dbcab048085302256dd7e8208d Merge: 883d71a55e968 d504fff0d14a0 Author: David S. Miller Date: Thu Jul 29 12:18:51 2021 +0100 Merge branch 'skb-gro-optimize' Paolo Abeni says: ==================== sk_buff: optimize GRO for the common case This is a trimmed down revision of "sk_buff: optimize layout for GRO", specifically dropping the changes to the sk_buff layout[1]. This series tries to accomplish 2 goals: - optimize the GRO stage for the most common scenario, avoiding a bunch of conditional and some more code - let owned skbs entering the GRO engine, allowing backpressure in the veth GRO forward path. A new sk_buff flag (!!!) is introduced and maintained for GRO's sake. Such field uses an existing hole, so there is no change to the sk_buff size. [1] two main reasons: - move skb->inner_ field requires some extra care, as some in kernel users access and the fields regardless of skb->encapsulation. - extending secmark size clash with ct and nft uAPIs address the all above is possible, I think, but for sure not in a single series. ==================== Signed-off-by: David S. Miller commit d504fff0d14a0fd683e9ec1f736c6e1f894667ae Author: Paolo Abeni Date: Wed Jul 28 18:24:04 2021 +0200 veth: use skb_prepare_for_gro() Leveraging the previous patch we can now avoid orphaning the skb in the veth gro path, allowing correct backpressure. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 5e10da5385d20c4bae587bc2921e5fdd9655d5fc Author: Paolo Abeni Date: Wed Jul 28 18:24:03 2021 +0200 skbuff: allow 'slow_gro' for skb carring sock reference This change leverages the infrastructure introduced by the previous patches to allow soft devices passing to the GRO engine owned skbs without impacting the fast-path. It's up to the GRO caller ensuring the slow_gro bit validity before invoking the GRO engine. The new helper skb_prepare_for_gro() is introduced for that goal. On slow_gro, skbs are aggregated only with equal sk. Additionally, skb truesize on GRO recycle and free is correctly updated so that sk wmem is not changed by the GRO processing. rfc-> v1: - fixed bad truesize on dev_gro_receive NAPI_FREE - use the existing state bit Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 9efb4b5baf6ce851b247288992b0632cb4d31c17 Author: Paolo Abeni Date: Wed Jul 28 18:24:02 2021 +0200 net: optimize GRO for the common case. After the previous patches, at GRO time, skb->slow_gro is usually 0, unless the packets comes from some H/W offload slowpath or tunnel. We can optimize the GRO code assuming !skb->slow_gro is likely. This remove multiple conditionals in the most common path, at the price of an additional one when we hit the above "slow-paths". Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit b0999f385ac30cb17880ae1c1512491fbf0c9542 Author: Paolo Abeni Date: Wed Jul 28 18:24:01 2021 +0200 sk_buff: track extension status in slow_gro Similar to the previous one, but tracking the active_extensions field status. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 8a886b142bd03d36612747e9aefdf0282c8b02dd Author: Paolo Abeni Date: Wed Jul 28 18:24:00 2021 +0200 sk_buff: track dst status in slow_gro Similar to the previous patch, but covering the dst field: the slow_gro flag is additionally set when a dst is attached to the skb RFC -> v1: - use the existing flag instead of adding a new one Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 5fc88f93edf2f797f1aa63334cc6c86f9c15d585 Author: Paolo Abeni Date: Wed Jul 28 18:23:59 2021 +0200 sk_buff: introduce 'slow_gro' flags The new flag tracks if any state field is set, so that GRO requires 'unusual'/slow prepare steps. Set such flag when a ct entry is attached to the skb, and never clear it. The new bit uses an existing hole into the sk_buff struct RFC -> v1: - use a single state bit, never clear it - avoid moving the _nfct field Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit c0c81245dac7caaef4db627fb7043495d1afe662 Author: Yunhao Tian Date: Wed Jul 21 20:48:16 2021 +0800 clk: rockchip: make rk3308 ddrphy4x clock critical Currently, no driver support for DDR memory controller (DMC) is present, as a result, no driver is explicitly consuming the ddrphy clock. This means that VPLL1 (parent of ddr clock) will be shutdown if we enable and then disable any child clock of VPLL1 (e.g. SCLK_I2S0_8CH_TX). If VPLL1 is disabled, the whole system will freeze, because the DDR controller will lose its clock. So, it's necessary to prevent VPLL1 from shutting down, by marking the ddrphy4x CLK_IS_CRITICAL. This bug was discovered when I was porting rockchip_i2s_tdm driver to mainline kernel from Rockchip 4.4 kernel. I guess that other Rockchip SoCs without DMC driver may need the same patch. If this applies to other devices, please let us know. Signed-off-by: Yunhao Tian Link: https://lore.kernel.org/r/BYAPR20MB24886765F888A9705CBEB70789E39@BYAPR20MB2488.namprd20.prod.outlook.com [adapted subject, changed to add the clock to the critical list] Signed-off-by: Heiko Stuebner commit a86aadeff2fe9203d9575f1c157d09b3c557d1ce Author: Colin Ian King Date: Wed Jul 28 11:26:12 2021 +0100 MIPS: Alchemy: Fix spelling contraction "cant" -> "can't" There is a spelling mistake in a pr_warn message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Thomas Bogendoerfer commit 6fffe52fb336ec2063270a7305652a93ea677ca1 Author: Peter Geis Date: Wed Jul 28 14:00:28 2021 -0400 clk: rockchip: drop GRF dependency for rk3328/rk3036 pll types The rk3036/rk3328 pll types were converted to checking the lock status via the internal register in january 2020, so don't need the grf reference since then. But it was forgotten to remove grf check when deciding between the pll rate ops (read-only vs. read-write), so a clock driver without the needed grf reference might've been put into the read-only mode just because the grf reference was missing. This affected the rk356x that needs to reclock certain plls at boot. Fix this by removing the check for the grf for selecting the utilized operations. Suggested-by: Heiko Stuebner Fixes: 7f6ffbb885d1 ("clk: rockchip: convert rk3036 pll type to use internal lock status") Signed-off-by: Peter Geis [adjusted the commit message, adjusted the fixes tag] Link: https://lore.kernel.org/r/20210728180034.717953-3-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit c7d30623540b6e979d7e8647fab18feab4688808 Author: Maxime Ripard Date: Wed Jul 7 11:36:32 2021 +0200 drm/vc4: hdmi: Remove unused struct Commit 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec") removed the references to the vc4_hdmi_audio_component_drv structure, but not the structure itself resulting in a warning. Remove it. Fixes: 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec") Reported-by: kernel test robot Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210707093632.1468127-2-maxime@cerno.tech commit f143778d90829ac37e6a481772dc0f26e3071de7 Author: Maxime Ripard Date: Wed Jul 7 11:36:31 2021 +0200 drm/vc4: hdmi: Remove redundant variables The vc4_hdmi_audio_prepare function and the functions it's calling have in several occurences multiple dereferences of either the sample rate or the number of channels. It turns out that these variables are also passed through the hdmi codec parameters structure. Convert all the users to use this structure, and if it's used multiple times use a variable to store it instead of dereferencing it every time. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210707093632.1468127-1-maxime@cerno.tech commit fe8e3ee0d588566c1f44f28a555042ef50eba491 Author: Andy Shevchenko Date: Tue Jul 27 18:01:32 2021 +0300 lib/test_scanf: Handle n_bits == 0 in random tests UBSAN reported (via LKP) [ 11.021349][ T1] UBSAN: shift-out-of-bounds in lib/test_scanf.c:275:51 [ 11.022782][ T1] shift exponent 32 is too large for 32-bit type 'unsigned int' When n_bits == 0, the shift is out of range. Switch code to use GENMASK to handle this case. Fixes: 50f530e176ea ("lib: test_scanf: Add tests for sscanf number conversion") Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Reviewed-by: Richard Fitzgerald Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210727150132.28920-1-andriy.shevchenko@linux.intel.com commit d793b8f732d6acbc6390be7342fb2e92b069dc7f Author: Desmond Cheong Zhi Xi Date: Wed Jul 28 18:27:39 2021 +0800 drm: clarify usage of drm leases We make the following changes to the documentation of drm leases to make it easier to reason about their usage. In particular, we clarify the lifetime and locking rules of lease fields in drm_master: 1. Make it clear that &drm_device.mode_config.idr_mutex protects the lease idr and list structures for drm_master. The lessor field itself doesn't need to be protected as it doesn't change after it's set in drm_lease_create. 2. Add descriptions for the lifetime of lessors and leases. 3. Add an overview DOC: section in drm-uapi.rst that defines the terminology for drm leasing, and explains how leases work and why they're used. Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210728102739.441543-1-desmondcheongzx@gmail.com commit c28b584deb1bc81f8a2454b43c82cdda17ed29f6 Merge: 10dd9a8a5f7ec 77ed5e9dec551 Author: Krzysztof Kozlowski Date: Thu Jul 29 09:03:32 2021 +0200 Merge branch 'for-v5.15/omap-gpmc' into for-next commit 77ed5e9dec551765bde9f2e4b7ed9071ff03d61d Author: Tony Lindgren Date: Tue Jul 27 13:10:34 2021 +0300 memory: omap-gpmc: Drop custom PM calls with cpu_pm notifier We can now switch over to using cpu_pm instead of custom calls and make the context save and restore functions static. Let's also move the save and restore functions to avoid adding forward declarations for them. And get rid of the static data pointer while at it. Cc: Roger Quadros Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727101034.32148-2-tony@atomide.com Signed-off-by: Krzysztof Kozlowski commit 0f78964b523fe9920deae3455324060356ae53d0 Author: Tony Lindgren Date: Tue Jul 27 13:10:33 2021 +0300 memory: omap-gpmc: Clear GPMC_CS_CONFIG7 register on restore if unused We want to clear any unused GPMC_CS_CONFIG7 register on restore to ensure unused chip selects are not enabled. Cc: Roger Quadros Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210727101034.32148-1-tony@atomide.com Signed-off-by: Krzysztof Kozlowski commit 65ad82b2a3e89bbad6a9337b91dab36798e198dd Author: Matt Roper Date: Wed Jul 28 15:10:45 2021 -0700 drm/i915/adl_p: Add ddi buf translation tables for combo PHY ADL-P now has its own set of DDI buf translation tables (except for eDP which appears to be the same as TGL). Add the new values (last updated in bspec 2021-07-22) to the driver. v2: - Actually hook up the new tables via encoder->get_buf_trans() v3: - Create extra table wrapper structures for the tables from past platforms that we're re-using, with names that more accurately reflect the link rate they apply to on ADL-P specifically. (Jose) Bspec: 49291 Signed-off-by: Matt Roper Acked-by: Khaled Almahallawy Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210728221045.2363614-2-matthew.d.roper@intel.com commit bae6764119067484e317f60ed2a2d1e5036a7bd7 Author: Matt Roper Date: Wed Jul 28 15:10:44 2021 -0700 drm/i915/adl_s: Update ddi buf translation tables The hardware team updates the translation tables on 2021-06-23. Let's update the driver accordingly. Bspec: 49291 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210728221045.2363614-1-matthew.d.roper@intel.com commit 5d8dbb7fb82b8661c16d496644b931c0e2e3a12e Author: Pavel Skripkin Date: Wed Jul 28 19:38:18 2021 +0300 net: xfrm: fix shift-out-of-bounce We need to check up->dirmask to avoid shift-out-of-bounce bug, since up->dirmask comes from userspace. Also, added XFRM_USERPOLICY_DIRMASK_MAX constant to uapi to inform user-space that up->dirmask has maximum possible value Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy") Reported-and-tested-by: syzbot+9cd5837a045bbee5b810@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Steffen Klassert commit 38ef66b05cfa3560323344a0b3e09e583f1eb974 Author: Eric Biggers Date: Wed Jul 28 21:37:28 2021 -0700 fscrypt: document struct fscrypt_operations Document all fields of struct fscrypt_operations so that it's more clear what filesystems that use (or plan to use) fs/crypto/ need to implement. Link: https://lore.kernel.org/r/20210729043728.18480-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit b60bb6e2bfc192091b8f792781b83b5e0f9324f6 Author: Dave Jiang Date: Thu Jul 22 13:10:51 2021 -0700 dmaengine: idxd: fix abort status check Coverity static analysis of linux-next found issue. The check (status == IDXD_COMP_DESC_ABORT) is always false since status was previously masked with 0x7f and IDXD_COMP_DESC_ABORT is 0xff. Fixes: 6b4b87f2c31a ("dmaengine: idxd: fix submission race window") Reported-by: Colin Ian King Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162698465160.3560828.18173186265683415384.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 08dc2f9b53afbbc897bc895aa41906194f5af1cf Author: Christoph Hellwig Date: Sat Jul 24 09:20:33 2021 +0200 scsi: scsi_ioctl: Unexport sg_scsi_ioctl() Just call scsi_ioctl() in sg as that has the same effect. Link: https://lore.kernel.org/r/20210724072033.1284840-25-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit b2123d3b0987a2164e5bef116cafe19ac2281e34 Author: Christoph Hellwig Date: Sat Jul 24 09:20:32 2021 +0200 scsi: scsi_ioctl: Factor SG_IO handling into a helper Split the SG_IO handler from the main scsi_ioctl() routine. Link: https://lore.kernel.org/r/20210724072033.1284840-24-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 2102a5cc1233ff84a0ebf95bbc4d346eb4927c8f Author: Christoph Hellwig Date: Sat Jul 24 09:20:31 2021 +0200 scsi: scsi_ioctl: Factor SCSI_IOCTL_GET_IDLUN handling into a helper Split the SCSI_IOCTL_GET_IDLUN handler from the main scsi_ioctl() routine. Link: https://lore.kernel.org/r/20210724072033.1284840-23-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 514761874350b2804ce5027606efc412f0bc78f3 Author: Christoph Hellwig Date: Sat Jul 24 09:20:30 2021 +0200 scsi: scsi_ioctl: Consolidate the START STOP UNIT handling Factor out a helper for the various flavors of START STOP UNIT command ioctls. Link: https://lore.kernel.org/r/20210724072033.1284840-22-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit a9705477f552c1c9a2da8e94bb9914086f7798bf Author: Christoph Hellwig Date: Sat Jul 24 09:20:29 2021 +0200 scsi: scsi_ioctl: Remove a very misleading comment Remove the comment above ioctl_internal_command() which doesn't document this function at all. Link: https://lore.kernel.org/r/20210724072033.1284840-21-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 33ff4ce45b124e0356a396a381f374751b9ec7ba Author: Christoph Hellwig Date: Sat Jul 24 09:20:28 2021 +0200 scsi: core: Rename CONFIG_BLK_SCSI_REQUEST to CONFIG_SCSI_COMMON CONFIG_BLK_SCSI_REQUEST is rather misnamed as it enables building a small amount of code shared by the SCSI initiator, target, and consumers of the scsi_request passthrough API. Rename it and also allow building it as a module. [mkp: add module license] Link: https://lore.kernel.org/r/20210724072033.1284840-20-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit f2542a3be3277a65c766fa6e86b930d3d839f79e Author: Christoph Hellwig Date: Sat Jul 24 09:20:27 2021 +0200 scsi: scsi_ioctl: Move the "block layer" SCSI ioctl handling to drivers/scsi Merge the ioctl handling in block/scsi_ioctl.c into its only caller in drivers/scsi/scsi_ioctl.c. Link: https://lore.kernel.org/r/20210724072033.1284840-19-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7353dc06c9a8e37c80da7ff986e6ef5123bec8ce Author: Christoph Hellwig Date: Sat Jul 24 09:20:26 2021 +0200 scsi: scsi_ioctl: Simplify SCSI passthrough permission checking Remove the separate command filter structure and just use a switch statement (which also cought two duplicate commands), return a bool and give the function a sensible name. Link: https://lore.kernel.org/r/20210724072033.1284840-18-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit b69367dffd86813495cf01e128ff2c8a8e41bb83 Author: Christoph Hellwig Date: Sat Jul 24 09:20:25 2021 +0200 scsi: scsi_ioctl: Move scsi_command_size_tbl to scsi_common.c Move the SCSI command size table to common SCSI code. Link: https://lore.kernel.org/r/20210724072033.1284840-17-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 2cece3778475abc855084d897a3cf61249798ad9 Author: Christoph Hellwig Date: Sat Jul 24 09:20:24 2021 +0200 scsi: scsi_ioctl: Remove scsi_req_init() Merge scsi_req_init() into its only caller. Link: https://lore.kernel.org/r/20210724072033.1284840-16-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 78011042684dfbb50f7060f4623793f7a5c74a01 Author: Christoph Hellwig Date: Sat Jul 24 09:20:23 2021 +0200 scsi: bsg: Move bsg_scsi_ops to drivers/scsi/ Move the SCSI-specific bsg code in the SCSI midlayer instead of in the common bsg code. This just keeps the common bsg code block/ and also allows building it as a module. Link: https://lore.kernel.org/r/20210724072033.1284840-15-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit d52fe8f436a6d9850b5e528cb94a651563a77374 Author: Christoph Hellwig Date: Sat Jul 24 09:20:22 2021 +0200 scsi: bsg: Decouple from scsi_cmd_ioctl() Decouple bsg from scsi_cmd_ioctl(). This requires a small amount of code duplication, but will allow moving all SCSI ioctl handling into SCSI midlayer. Link: https://lore.kernel.org/r/20210724072033.1284840-14-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 547e2f7093b19a993d76c249b4c3ec8af8127d09 Author: Christoph Hellwig Date: Sat Jul 24 09:20:21 2021 +0200 scsi: block: Add a queue_max_bytes() helper Return the max_sectors value in bytes. Lifted from scsi_ioctl.c. Link: https://lore.kernel.org/r/20210724072033.1284840-13-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 2e27f576abc6f056e63ef207b9911b1a04d07020 Author: Christoph Hellwig Date: Sat Jul 24 09:20:20 2021 +0200 scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl() Ensure SCSI ULD only has to call a single ioctl helper. This also adds a bunch of missing ioctls to the ch driver, and removes the need for a duplicate implementation of SCSI_IOCTL_SEND_COMMAND command. Link: https://lore.kernel.org/r/20210724072033.1284840-12-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 4f07bfc56157ebc689ef54879e90c48a47294083 Author: Christoph Hellwig Date: Sat Jul 24 09:20:19 2021 +0200 scsi: scsi_ioctl: Remove scsi_verify_blk_ioctl() Manually verify that the device is not a partition and the caller has admin privіleges at the beginning of the sr ioctl method and open code the trivial check for sd as well. Link: https://lore.kernel.org/r/20210724072033.1284840-11-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit fb1ba406c451045f1063ace70086b4645d4e9d54 Author: Christoph Hellwig Date: Sat Jul 24 09:20:18 2021 +0200 scsi: scsi_ioctl: Remove scsi_cmd_blk_ioctl() Open code scsi_cmd_blk_ioctl() in its two callers. Link: https://lore.kernel.org/r/20210724072033.1284840-10-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit e9ee7fea45787d657c2e56134fa8484382a90444 Author: Christoph Hellwig Date: Sat Jul 24 09:20:17 2021 +0200 scsi: cdrom: Remove the call to scsi_cmd_blk_ioctl() from cdrom_ioctl() Only the sr driver can handle SCSI passthrough requests, so move the call to scsi_cmd_blk_ioctl() there. Link: https://lore.kernel.org/r/20210724072033.1284840-9-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit dba7688fc9037c8343ff298d32a3e56352046d37 Author: Christoph Hellwig Date: Sat Jul 24 09:20:16 2021 +0200 scsi: st: Simplify ioctl handling Merge st_ioctl_common() into st_ioctl() and streamline the invocation of the common ioctl helpers. Link: https://lore.kernel.org/r/20210724072033.1284840-8-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 6fade4505af898c849ebe80f54313aa9c387e6da Author: Christoph Hellwig Date: Sat Jul 24 09:20:15 2021 +0200 scsi: core: Remove scsi_compat_ioctl() Just handle the compat case in scsi_ioctl() using in_compat_syscall(). Link: https://lore.kernel.org/r/20210724072033.1284840-7-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 2c2db2c6059a426ac27f467062ff2ba6871b69e6 Author: Christoph Hellwig Date: Sat Jul 24 09:20:14 2021 +0200 scsi: sg: Consolidate compat ioctl handling Merge the native and compat ioctl handlers into a single one using in_compat_syscall(). Link: https://lore.kernel.org/r/20210724072033.1284840-6-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit bce96675091f2f1f98567c3566944f4009a7fbd1 Author: Christoph Hellwig Date: Sat Jul 24 09:20:13 2021 +0200 scsi: ch: Consolidate compat ioctl handling Merge the native and compat ioctl handlers into a single one using in_compat_syscall(). Link: https://lore.kernel.org/r/20210724072033.1284840-5-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 443283109f5c9dbcd878f4572a1b8876eae3b6c0 Author: Christoph Hellwig Date: Sat Jul 24 09:20:12 2021 +0200 scsi: sd: Consolidate compat ioctl handling Merge the native and compat ioctl handlers into a single one using in_compat_syscall(), and also simplify the calling conventions by merging sd_ioctl_common() into sd_ioctl(). Link: https://lore.kernel.org/r/20210724072033.1284840-4-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 558e3fbe228a495166eda5f594d5976ee7cb18fc Author: Christoph Hellwig Date: Sat Jul 24 09:20:11 2021 +0200 scsi: sr: Consolidate compat ioctl handling Merge the native and compat ioctl handlers into a single one using in_compat_syscall(). Link: https://lore.kernel.org/r/20210724072033.1284840-3-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit beec64d0c9749afedf51c3c10cf52de1d9a89cc0 Author: Christoph Hellwig Date: Sat Jul 24 09:20:10 2021 +0200 scsi: bsg: Remove support for SCSI_IOCTL_SEND_COMMAND SCSI_IOCTL_SEND_COMMAND has been deprecated longer than bsg exists and has been warning for just as long. More importantly it harcodes SCSI CDBs and thus will do the wrong thing on non-SCSI bsg nodes. Link: https://lore.kernel.org/r/20210724072033.1284840-2-hch@lst.de Fixes: aa387cc89567 ("block: add bsg helper library") Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 544dcd74b7093ad4befac99b11d90331aa73348e Author: Luben Tuikov Date: Wed Jul 28 11:07:03 2021 -0400 drm/amd/pm: Fix a bug in semaphore double-lock Fix a bug in smu_cmn_send_msg_without_waiting() in that this function does not need to take the smu->message_lock mutex in order to send a message down to the SMU. The mutex is acquired by the caller of this function instead. Cc: Alex Deucher Cc: Changfeng Zhu Cc: Huang Rui Fixes: 5810323ba69289 ("drm/amd/pm: Fix a bug communicating with the SMU (v5)") Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b8e42844b48d441589eb18ade29dee29bbd78657 Author: Huang Rui Date: Wed Jul 28 17:00:53 2021 +0800 drm/amdgpu: enable psp front door loading by default for cyan_skillfish2 The function is ready on psp firmware, and enable it by default. Signed-off-by: Huang Rui Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 8d35a2596164c1c9d34d4656fd42b445cd1e247f Author: Likun Gao Date: Mon Jul 26 17:17:52 2021 +0800 drm/amdgpu: adjust fence driver enable sequence Fence driver was enabled per ring when sw init on per IP block before. Change to enable all the fence driver at the same time after amdgpu_device_ip_init finished. Rename some function related to fence to make it reasonable for read. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit edc8c81f24386b9593fa9a3051162bc6181d29e5 Author: John Clements Date: Fri Jul 23 13:53:20 2021 +0800 drm/amdgpu: Added PSP13 BL loading support for additional drivers Added BL loading support for soc/intf/dbg drivers Signed-off-by: John Clements Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8abadab37fa128f64ad6e5d9393f1050871ae325 Author: John Clements Date: Fri Jul 23 11:12:57 2021 +0800 drm/amdgpu: Consolidated PSP13 BL FW loading Remove duplicate code Signed-off-by: John Clements Reviewed-by: Hawking Zhang . Signed-off-by: Alex Deucher commit 6ff34fd69093de3b6c37583539eec018b2b7dad0 Author: John Clements Date: Thu Jul 22 14:48:59 2021 +0800 drm/amdgpu: Added support for added psp driver binaries FW Detect psp driver binaries packed into FW and try to load the FW Signed-off-by: John Clements Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f8e487ce83dab13faee82ef54e5643c05c248c3a Author: John Clements Date: Thu Jul 22 14:07:31 2021 +0800 drm/amdgpu: Added latest PSP FW header Improved handling for scalling PSP FW binaries Signed-off-by: John Clements Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b84d029d9f71303e6ca0b3e6580840dafe79a9cf Author: Huang Rui Date: Wed Jul 28 09:59:57 2021 +0800 drm/amdgpu: remove the access of xxx_PSP_DEBUG on cycan_skillfish It won't need to clear the xxx_PSP_DEBUG registers, because firmware will handle this change. Signed-off-by: Huang Rui Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 7fd13baeb7a3a48cae12c36c52f06bf4e9e7d728 Author: Alex Deucher Date: Thu Jul 8 16:31:10 2021 -0400 drm/amdgpu/display: add support for multiple backlights On platforms that support multiple backlights, register each one separately. This lets us manage them independently rather than registering a single backlight and applying the same settings to both. v2: fix typo: Reported-by: kernel test robot Reviewed-by: Roman Li Signed-off-by: Alex Deucher commit a25fca4d3c18766b6f7a3c95fa8faec23ef464c5 Author: Tedd Ho-Jeong An Date: Mon Jul 26 13:22:36 2021 -0700 Bluetooth: mgmt: Fix wrong opcode in the response for add_adv cmd This patch fixes the MGMT add_advertising command repsones with the wrong opcode when it is trying to return the not supported error. Fixes: cbbdfa6f33198 ("Bluetooth: Enable controller RPA resolution using Experimental feature") Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Luiz Augusto von Dentz commit 58ce6d5b271ab25fb2056f84a8e5546945eb5fc9 Author: Tetsuo Handa Date: Tue Jul 27 06:12:04 2021 +0900 Bluetooth: defer cleanup of resources in hci_unregister_dev() syzbot is hitting might_sleep() warning at hci_sock_dev_event() due to calling lock_sock() with rw spinlock held [1]. It seems that history of this locking problem is a trial and error. Commit b40df5743ee8aed8 ("[PATCH] bluetooth: fix socket locking in hci_sock_dev_event()") in 2.6.21-rc4 changed bh_lock_sock() to lock_sock() as an attempt to fix lockdep warning. Then, commit 4ce61d1c7a8ef4c1 ("[BLUETOOTH]: Fix locking in hci_sock_dev_event().") in 2.6.22-rc2 changed lock_sock() to local_bh_disable() + bh_lock_sock_nested() as an attempt to fix sleep in atomic context warning. Then, commit 4b5dd696f81b210c ("Bluetooth: Remove local_bh_disable() from hci_sock.c") in 3.3-rc1 removed local_bh_disable(). Then, commit e305509e678b3a4a ("Bluetooth: use correct lock to prevent UAF of hdev object") in 5.13-rc5 again changed bh_lock_sock_nested() to lock_sock() as an attempt to fix CVE-2021-3573. This difficulty comes from current implementation that hci_sock_dev_event(HCI_DEV_UNREG) is responsible for dropping all references from sockets because hci_unregister_dev() immediately reclaims resources as soon as returning from hci_sock_dev_event(HCI_DEV_UNREG). But the history suggests that hci_sock_dev_event(HCI_DEV_UNREG) was not doing what it should do. Therefore, instead of trying to detach sockets from device, let's accept not detaching sockets from device at hci_sock_dev_event(HCI_DEV_UNREG), by moving actual cleanup of resources from hci_unregister_dev() to hci_release_dev() which is called by bt_host_release when all references to this unregistered device (which is a kobject) are gone. Link: https://syzkaller.appspot.com/bug?extid=a5df189917e79d5e59c9 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Tested-by: syzbot Fixes: e305509e678b3a4a ("Bluetooth: use correct lock to prevent UAF of hdev object") Signed-off-by: Luiz Augusto von Dentz commit 7835ed6a9e868376c3d7758d017fcfb34e35b8bc Author: Linus Walleij Date: Thu Jul 15 11:28:08 2021 +0200 drm/panel-sony-acx424akp: Modernize backlight handling This converts the internal backlight in the Sony ACX424AKP driver to do it the canonical way: - Assign the panel->backlight during probe. - Let the panel framework handle the backlight. - Make the backlight .set_brightness() turn the backlight off completely if blank. - Fix some dev_err_probe() use cases along the way. Tested on the U8500 HREF520 reference design. Signed-off-by: Linus Walleij Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210715092808.1100106-1-linus.walleij@linaro.org commit 28be2405fb753927e18bc1a891617a430b2a0684 Author: Desmond Cheong Zhi Xi Date: Sat Jul 24 19:18:22 2021 +0800 drm: use the lookup lock in drm_is_current_master Inside drm_is_current_master, using the outer drm_device.master_mutex to protect reads of drm_file.master makes the function prone to creating lock hierarchy inversions. Instead, we can use the drm_file.master_lookup_lock that sits at the bottom of the lock hierarchy. Reported-by: Daniel Vetter Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210724111824.59266-2-desmondcheongzx@gmail.com commit 50dea4ec1afbd75ccf5089a7b31c54753a36ec7f Author: Simon Ser Date: Sun Jul 25 16:49:01 2021 +0000 maintainers: add bugs and chat URLs for amdgpu Add links to the issue tracker and the IRC channel for the amdgpu driver. Signed-off-by: Simon Ser Cc: Alex Deucher Cc: Christian König Cc: Pan Xinhui Signed-off-by: Alex Deucher commit d0ae0b64fd13db7676307097e72e2480549eeaa5 Author: Alex Deucher Date: Wed Jul 21 18:11:51 2021 -0400 drm/amdgpu/display: only enable aux backlight control for OLED panels We've gotten a number of reports about backlight control not working on panels which indicate that they use aux backlight control. A recent patch: commit 2d73eabe2984a435737498ab39bb1500a9ffe9a9 Author: Camille Cho Date: Thu Jul 8 18:28:37 2021 +0800 drm/amd/display: Only set default brightness for OLED [Why] We used to unconditionally set backlight path as AUX for panels capable of backlight adjustment via DPCD in set default brightness. [How] This should be limited to OLED panel only since we control backlight via PWM path for SDR mode in LCD HDR panel. Reviewed-by: Krunoslav Kovac Acked-by: Rodrigo Siqueira Signed-off-by: Camille Cho Signed-off-by: Alex Deucher Changes some other code to only use aux for backlight control on OLED panels. The commit message seems to indicate that PWM should be used for SDR mode on HDR panels. Do something similar for backlight control in general. This may need to be revisited if and when HDR started to get used. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1438 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=213715 Reviewed-by: Roman Li Signed-off-by: Alex Deucher commit b521be9bc3c7c0e359832661fa4c51c3aba476dc Author: Evan Quan Date: Wed Jul 21 18:52:35 2021 +0800 drm/amd/pm: restore user customized OD settings properly for Sienna Cichlid Properly restore those committed and non-committed user customized OD settings. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 92cf050868c962bc712b5682b8a0ed04d3dfec3d Author: Evan Quan Date: Wed Jul 21 18:19:38 2021 +0800 drm/amd/pm: restore user customized OD settings properly for NV1x The customized OD settings can be divided into two parts: those committed ones and non-committed ones. - For those changes which had been fed to SMU before S3/S4/Runpm suspend kicked, they are committed changes. They should be properly restored and fed to SMU on S3/S4/Runpm resume. - For those non-committed changes, they are restored only without feeding to SMU. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b928ecfbe369d0e41d9f38df794f3b8615e6f13b Author: Eric Huang Date: Mon Jul 26 11:29:10 2021 -0400 Revert "Revert "drm/amdkfd: Add memory sync before TLB flush on unmap"" This reverts commit 4bba567c8c35a9cbcd16fb4780a0c3dfd162e08e. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 3b2b254425cc92c2c603efac488188d3084595ac Author: Eric Huang Date: Mon Jul 26 11:27:53 2021 -0400 Revert "Revert "drm/amdgpu: Fix warning of Function parameter or member not described"" This reverts commit 4e7b93ca52fb228b177168d436449c5671415a72. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 8f0e2d5c9997710bda7d6a7f0950d16eec9f9b5b Author: Eric Huang Date: Mon Jul 26 11:24:20 2021 -0400 Revert "Revert "drm/amdkfd: Make TLB flush conditional on mapping"" This reverts commit 7ed9876c9793bfe96fed58ba645d6c8e32f26001. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit e9949dd79182a29410379dfebea8870f6abfa6e7 Author: Eric Huang Date: Mon Jul 26 11:23:17 2021 -0400 Revert "Revert "drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update"" This reverts commit 024d8811c90ed56d8b90cdcf71e51c9fedeff460. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit f87534347a5dd9c5860f947f6402c2dee45de2fd Author: Eric Huang Date: Mon Jul 26 11:21:14 2021 -0400 Revert "Revert "drm/amdkfd: Add heavy-weight TLB flush after unmapping"" This reverts commit 430f8e6edbaac8abfddf76f1aef732d9c6257211. Revert reason: Issue has been resolved. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 1df272a8b37e32d4fb3df8125234de379265fe9e Author: Aric Cyr Date: Sun Jul 18 13:08:37 2021 -0400 drm/amd/display: 3.2.146 This version brings along following fixed: - Guard DST_Y_PREFETCH register overflow in DCN21 - Add missing DCN21 IP parameter - Fix PSR command version - Add ETW logging for AUX failures - Add ETW log to dmub_psr_get_state - Fixed EdidUtility build errors - Fix missing reg offset for the dmcub test debug registers - Adding update authentication interface - Remove unused functions of opm state query support - Always wait for update lock status - Refactor riommu invalidation wa - Ensure dentist display clock update finished in DCN20 Reviewed-by: Hsieh Mike Acked-by: Solomon Chiu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit add0733d19c5610b10a1b398fcfb370a9f21afec Author: Anthony Koo Date: Sat Jul 17 21:46:31 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.76 Reviewed-by: Cyr Aric Acked-by: Solomon Chiu Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 849cf9326bd751469cde9ff0d567c6baa2d55405 Author: Dale Zhao Date: Fri Jul 16 09:38:17 2021 +0800 drm/amd/display: ensure dentist display clock update finished in DCN20 [Why] We don't check DENTIST_DISPCLK_CHG_DONE to ensure dentist display clockis updated to target value. In some scenarios with large display clock margin, it will deliver unfinished display clock and cause issues like display black screen. [How] Checking DENTIST_DISPCLK_CHG_DONE to ensure display clock has been update to target value before driver do other clock related actions. Reviewed-by: Cyr Aric Acked-by: Solomon Chiu Signed-off-by: Dale Zhao Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit bbf87050791f763f0aee46d452ac04dec52c0834 Author: Eric Yang Date: Fri Jul 9 17:47:39 2021 -0400 drm/amd/display: refactor riommu invalidation wa [Why] A cleaner solution, only done once on boot. [How] Remove previous workaround and configure an extra vmid one time on boot Reviewed-by: Kazlauskas Nicholas Acked-by: Solomon Chiu Signed-off-by: Eric Yang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 02352bfd78c30152b46c8b6d66c32f9f9389f0b7 Author: Eric Bernstein Date: Wed Jul 14 14:21:08 2021 -0400 drm/amd/display: Always wait for update lock status Remove code that would skip wait for lock status for Diags FPGA case Reviewed-by: Laktyushkin Dmytro Acked-by: Solomon Chiu Signed-off-by: Eric Bernstein Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7ac851bcd54778337fb500e9c03ae1bd44de4f3d Author: Wenjing Liu Date: Thu Jul 15 14:55:28 2021 -0400 drm/amd/display: remove unused functions [why] It has been decided that opm state query support will be dropped. Therefore link encryption enabled and save current encryption states won't be used anymore and there are no foreseeable usages in the future. We will remove these two interfaces for clean up. Acked-by: Solomon Chiu Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 40ef288f90f962998f272630454d10a409554fb8 Author: Wenjing Liu Date: Wed Jul 14 14:14:53 2021 -0400 drm/amd/display: add update authentication interface [why] Previously to toggle authentication, we need to remove and add the same display back with modified adjustment. This method will toggle DTM state without actual hardware changes. This is not per design and would cause potential issues in the long run. [how] We are creating a dedicated interface that does the same thing as remove and add back the display without changing DTM state. Acked-by: Solomon Chiu Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ea2f15ff7eaf86d3e72b619d68397dabb8f404f7 Author: Eric Yang Date: Fri Jul 9 17:11:34 2021 -0400 drm/amd/display: fix missing reg offset [Why] Initializing was missing reg offsets for the dmcub test debug registers causing assert [How] Add initialization Reviewed-by: Kazlauskas Nicholas Acked-by: Solomon Chiu Signed-off-by: Eric Yang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 91a9ead069b8cc91e33cbfd61d95678ef2cf204c Author: Mark Morra Date: Mon Jun 28 18:00:30 2021 -0400 drm/amd/display: Fixed EdidUtility build errors [HOW] Added #ifdefs and refactored various parts of dc to allow dc_link to be built by AMD EDID UTILITY [WHY] dc_dsc was refactored moving some of the code that AMD EDID UTILITY needed to dc_link, so now dc_link needs to be included by AMD EDID UTILITY Squash in DCN config fix (Alex) Reviewed-by: Leung Martin Acked-by: Solomon Chiu Signed-off-by: Mark Morra Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 883d71a55e968371d1ff151249732466b5581f58 Author: Hu Haowen Date: Wed Jul 28 23:59:12 2021 +0800 Documentation: networking: add ioam6-sysctl into index Append ioam6-sysctl to toctree in order to get rid of building warnings. Signed-off-by: Hu Haowen Signed-off-by: David S. Miller commit 3ad51c1743ebd23ec3b5ebc6195dafe867eaebb1 Author: Alex Elder Date: Wed May 19 18:44:18 2021 -0500 remoteproc: use freezable workqueue for crash notifications When a remoteproc has crashed, rproc_report_crash() is called to handle whatever recovery is desired. This can happen at almost any time, often triggered by an interrupt, though it can also be initiated by a write to debugfs file remoteproc/remoteproc*/crash. When a crash is reported, the crash handler worker is scheduled to run (rproc_crash_handler_work()). One thing that worker does is call rproc_trigger_recovery(), which calls rproc_stop(). That calls the ->stop method for any remoteproc subdevices before making the remote processor go offline. The Q6V5 modem remoteproc driver implements an SSR subdevice that notifies registered drivers when the modem changes operational state (prepare, started, stop/crash, unprepared). The IPA driver registers to receive these notifications. With that as context, I'll now describe the problem. There was a situation in which buggy modem firmware led to a modem crash very soon after system (AP) resume had begun. The crash caused a remoteproc SSR crash notification to be sent to the IPA driver. The problem was that, although system resume had begun, it had not yet completed, and the IPA driver was still in a suspended state. This scenario could happen to any driver that registers for these SSR notifications, because they are delivered without knowledge of the (suspend) state of registered recipient drivers. This patch offers a simple fix for this, by having the crash handling worker function run on the system freezable workqueue. This workqueue does not operate if user space is frozen (for suspend). As a result, the SSR subdevice only delivers its crash notification when the system is fully operational (i.e., neither suspended nor in suspend/resume transition). Tested-by: Siddharth Gupta Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20210519234418.1196387-2-elder@linaro.org Signed-off-by: Bjorn Andersson commit 147b589c5f446d602215577835356a96c40a4044 Author: Dong Aisheng Date: Tue Jul 6 22:21:56 2021 +0800 remoteproc: fix kernel doc for struct rproc_ops The load_rsc_table was removed since the commit c1d35c1ab424 ("remoteproc: Rename "load_rsc_table" to "parse_fw"") but got added back again by mistake in the below commit: commit b1a17513a2d6 ("remoteproc: add vendor resources handling"). The patch fixed a small code indent issue which not worth a separate patch. Fixes: b1a17513a2d6 ("remoteproc: add vendor resources handling") Signed-off-by: Dong Aisheng Link: https://lore.kernel.org/r/20210706142156.952794-2-aisheng.dong@nxp.com Signed-off-by: Bjorn Andersson commit c080128b6f05cb803d830e6bf2ec0b214435ce38 Author: Dong Aisheng Date: Tue Jul 6 22:21:55 2021 +0800 remoteproc: fix an typo in fw_elf_get_class code comments Drop 'and' which looks like unnecessary. Fixes: 73516a33588c ("remoteproc: Add elf helpers to access elf64 and elf32 fields") Signed-off-by: Dong Aisheng Link: https://lore.kernel.org/r/20210706142156.952794-1-aisheng.dong@nxp.com Signed-off-by: Bjorn Andersson commit 1fcef985c8bdd542c43da0d87bd9d51980c3859b Author: Bjorn Andersson Date: Thu Mar 11 16:22:51 2021 -0800 remoteproc: qcom: wcnss: Fix race with iris probe The remoteproc driver is split between the responsibilities of getting the SoC-internal ARM core up and running and the external RF (aka "Iris") part configured. In order to satisfy the regulator framework's need of a struct device * to look up supplies this was implemented as two different drivers, using of_platform_populate() in the remoteproc part to probe the iris part. Unfortunately it's possible that the iris part probe defers on yet not available regulators and an attempt to start the remoteproc will have to be rejected, until this has been resolved. But there's no useful mechanism of knowing when this would be. Instead replace the of_platform_populate() and the iris probe with a function that rolls its own struct device, with the relevant of_node associated that is enough to acquire regulators and clocks specified in the DT node and that may propagate the EPROBE_DEFER back to the wcnss device's probe. Acked-by: Mathieu Poirier Reported-by: Anibal Limon Reported-by: Loic Poulain Tested-by: Anibal Limon Link: https://lore.kernel.org/r/20210312002251.3273013-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit b11f0a4c0c81ff062cd3696eadd46266489bca8e Author: Vladimir Oltean Date: Wed Jul 28 21:53:15 2021 +0300 net: dsa: sja1105: be stateless when installing FDB entries Currently there are issues when adding a bridge FDB entry as VLAN-aware and deleting it as VLAN-unaware, or vice versa. However this is an unneeded complication, since the bridge always installs its default FDB entries in VLAN 0 to match on VLAN-unaware ports, and in the default_pvid (VLAN 1) to match on VLAN-aware ports. So instead of trying to outsmart the bridge, just install all entries it gives us, and they will start matching packets when the vlan_filtering mode changes. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b0fdb99943bec486fe8f51f7065a4719325545f5 Merge: 1159da6410a38 52e4bec15546d Author: David S. Miller Date: Wed Jul 28 20:26:05 2021 +0100 Merge branch 'switchdev-notifiers' Vladimir Oltean says: ==================== Plug the last 2 holes in the switchdev notifiers for local FDB entries The work for trapping local FDB entries to the CPU in switchdev/DSA started with the "RX filtering in DSA" series: https://patchwork.kernel.org/project/netdevbpf/cover/20210629140658.2510288-1-olteanv@gmail.com/ and was continued with further improvements such as "Fan out FDB entries pointing towards the bridge to all switchdev member ports": https://patchwork.kernel.org/project/netdevbpf/cover/20210719135140.278938-1-vladimir.oltean@nxp.com/ https://patchwork.kernel.org/project/netdevbpf/cover/20210720173557.999534-1-vladimir.oltean@nxp.com/ There are only 2 more issues left to be addressed (famous last words), and these are: - dynamically learned FDB entries towards interfaces foreign to DSA need to be replayed too - adding/deleting a VLAN on a port causes the local FDB entries in that VLAN to be prematurely deleted This patch series addresses both, and patch 2 depends on 1 to work properly. ==================== Signed-off-by: David S. Miller commit 52e4bec15546d58f2a14dc74a6b8be128aa7db0a Author: Vladimir Oltean Date: Wed Jul 28 21:27:48 2021 +0300 net: bridge: switchdev: treat local FDBs the same as entries towards the bridge Currently the following script: 1. ip link add br0 type bridge vlan_filtering 1 && ip link set br0 up 2. ip link set swp2 up && ip link set swp2 master br0 3. ip link set swp3 up && ip link set swp3 master br0 4. ip link set swp4 up && ip link set swp4 master br0 5. bridge vlan del dev swp2 vid 1 6. bridge vlan del dev swp3 vid 1 7. ip link set swp4 nomaster 8. ip link set swp3 nomaster produces the following output: [ 641.010738] sja1105 spi0.1: port 2 failed to delete 00:1f:7b:63:02:48 vid 1 from fdb: -2 [ swp2, swp3 and br0 all have the same MAC address, the one listed above ] In short, this happens because the number of FDB entry additions notified to switchdev is unbalanced with the number of deletions. At step 1, the bridge has a random MAC address. At step 2, the br_fdb_replay of swp2 receives this initial MAC address. Then the bridge inherits the MAC address of swp2 via br_fdb_change_mac_address(), and it notifies switchdev (only swp2 at this point) of the deletion of the random MAC address and the addition of 00:1f:7b:63:02:48 as a local FDB entry with fdb->dst == swp2, in VLANs 0 and the default_pvid (1). During step 7: del_nbp -> br_fdb_delete_by_port(br, p, vid=0, do_all=1); -> fdb_delete_local(br, p, f); br_fdb_delete_by_port() deletes all entries towards the ports, regardless of vid, because do_all is 1. fdb_delete_local() has logic to migrate local FDB entries deleted from one port to another port which shares the same MAC address and is in the same VLAN, or to the bridge device itself. This migration happens without notifying switchdev of the deletion on the old port and the addition on the new one, just fdb->dst is changed and the added_by_user flag is cleared. In the example above, the del_nbp(swp4) causes the "addr 00:1f:7b:63:02:48 vid 1" local FDB entry with fdb->dst == swp4 that existed up until then to be migrated directly towards the bridge (fdb->dst == NULL). This is because it cannot be migrated to any of the other ports (swp2 and swp3 are not in VLAN 1). After the migration to br0 takes place, swp4 requests a deletion replay of all FDB entries. Since the "addr 00:1f:7b:63:02:48 vid 1" entry now point towards the bridge, a deletion of it is replayed. There was just a prior addition of this address, so the switchdev driver deletes this entry. Then, the del_nbp(swp3) at step 8 triggers another br_fdb_replay, and switchdev is notified again to delete "addr 00:1f:7b:63:02:48 vid 1". But it can't because it no longer has it, so it returns -ENOENT. There are other possibilities to trigger this issue, but this is by far the simplest to explain. To fix this, we must avoid the situation where the addition of an FDB entry is notified to switchdev as a local entry on a port, and the deletion is notified on the bridge itself. Considering that the 2 types of FDB entries are completely equivalent and we cannot have the same MAC address as a local entry on 2 bridge ports, or on a bridge port and pointing towards the bridge at the same time, it makes sense to hide away from switchdev completely the fact that a local FDB entry is associated with a given bridge port at all. Just say that it points towards the bridge, it should make no difference whatsoever to the switchdev driver and should even lead to a simpler overall implementation, will less cases to handle. This also avoids any modification at all to the core bridge driver, just what is reported to switchdev changes. With the local/permanent entries on bridge ports being already reported to user space, it is hard to believe that the bridge behavior can change in any backwards-incompatible way such as making all local FDB entries point towards the bridge. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b4454bc6a0fbf2f9edcddd08862175085b990856 Author: Vladimir Oltean Date: Wed Jul 28 21:27:47 2021 +0300 net: bridge: switchdev: replay the entire FDB for each port Currently when a switchdev port joins a bridge, we replay all FDB entries pointing towards that port or towards the bridge. However, this is insufficient in certain situations: (a) DSA, through its assisted_learning_on_cpu_port logic, snoops dynamically learned FDB entries on foreign interfaces. These are FDB entries that are pointing neither towards the newly joined switchdev port, nor towards the bridge. So these addresses would be missed when joining a bridge where a foreign interface has already learned some addresses, and they would also linger on if the DSA port leaves the bridge before the foreign interface forgets them. None of this happens if we replay the entire FDB when the port joins. (b) There is a desire to treat local FDB entries on a port (i.e. the port's termination MAC address) identically to FDB entries pointing towards the bridge itself. More details on the reason behind this in the next patch. The point is that this cannot be done given the current structure of br_fdb_replay() in this situation: ip link set swp0 master br0 # br0 inherits its MAC address from swp0 ip link set swp1 master br0 What is desirable is that when swp1 joins the bridge, br_fdb_replay() also notifies swp1 of br0's MAC address, but this won't in fact happen because the MAC address of br0 does not have fdb->dst == NULL (it doesn't point towards the bridge), but it has fdb->dst == swp0. So our current logic makes it impossible for that address to be replayed. But if we dump the entire FDB instead of just the entries with fdb->dst == swp1 and fdb->dst == NULL, then the inherited MAC address of br0 will be replayed too, which is what we need. A natural question arises: say there is an FDB entry to be replayed, like a MAC address dynamically learned on a foreign interface that belongs to a bridge where no switchdev port has joined yet. If 10 switchdev ports belonging to the same driver join this bridge, one by one, won't every port get notified 10 times of the foreign FDB entry, amounting to a total of 100 notifications for this FDB entry in the switchdev driver? Well, yes, but this is where the "void *ctx" argument for br_fdb_replay is useful: every port of the switchdev driver is notified whenever any other port requests an FDB replay, but because the replay was initiated by a different port, its context is different from the initiating port's context, so it ignores those replays. So the foreign FDB entry will be installed only 10 times, once per port. This is done so that the following 4 code paths are always well balanced: (a) addition of foreign FDB entry is replayed when port joins bridge (b) deletion of foreign FDB entry is replayed when port leaves bridge (c) addition of foreign FDB entry is notified to all ports currently in bridge (c) deletion of foreign FDB entry is notified to all ports currently in bridge Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 1159da6410a382000528008126b50c7320798434 Merge: 63caca1e3ef6e abf90ac2c2924 Author: David S. Miller Date: Wed Jul 28 20:23:45 2021 +0100 Merge branch 'bnxt_en-ptp' Michael Chan says: ==================== bnxt_en: PTP enhancements This series adds two PTP enhancements. This first one is to register the PHC during probe time and keep it registered whether it is in ifup or ifdown state. It will get unregistered and possibly reregistered if the firmware PTP capability changes after firmware reset. The second one is to add the 1PPS (one pulse per second) feature to support input/output of the 1PPS signal. ==================== Signed-off-by: David S. Miller commit abf90ac2c292410c22bbce4dfedeb49b9b0295ff Author: Pavan Chebbi Date: Wed Jul 28 14:11:45 2021 -0400 bnxt_en: Log if an invalid signal detected on TSIO pin FW can report to driver via ASYNC event if it encountered an invalid signal on any TSIO PIN. Driver will log this event for the user to take corrective action. Reviewed-by: Somnath Kotur Reviewed-by: Arvind Susarla Reviewed-by: Edwin Peer Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 099fdeda659d2071a97753a6479d13342ff2b285 Author: Pavan Chebbi Date: Wed Jul 28 14:11:44 2021 -0400 bnxt_en: Event handler for PPS events Once the PPS pins are configured, the FW can report PPS values using ASYNC event. This patch adds the ASYNC event handler and subsequent reporting of the events to kernel. Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 9e518f25802cc13adcdb26adaaccfc7e9de80d44 Author: Pavan Chebbi Date: Wed Jul 28 14:11:43 2021 -0400 bnxt_en: 1PPS functions to configure TSIO pins Application will send ioctls to set/clear PPS pin functions based on user input. This patch implements the driver callbacks that will configure the TSIO pins using firmware commands. After firmware reset, the TSIO pins will be reconfigured again. Reviewed-by: Edwin Peer Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit caf3eedbcd8d326c9b789cc270b9ddcce254e0ce Author: Pavan Chebbi Date: Wed Jul 28 14:11:42 2021 -0400 bnxt_en: 1PPS support for 5750X family chips 1PPS (One Pulse Per Second) is a signal generated either by the NIC PHC or an external timing source. Integrating the support to configure and use 1PPS using the TSIO pins along with PTP timestamps will add Grand Master capability to the 5750X family chipsets. This patch initializes the driver data structures and registers the 1PPS with kernel, based on the TSIO pins' capability in the hardware. This will create a /dev/ppsX device which applications can use to receive PPS events. Later patches will define functions to configure and use the pins. Reviewed-by: Edwin Peer Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 30e96f487f64c60b2884e37b9dabf287c9d048aa Author: Michael Chan Date: Wed Jul 28 14:11:41 2021 -0400 bnxt_en: Do not read the PTP PHC during chip reset During error recovery or hot firmware upgrade, the chip may be under reset and the PHC register read cycles may cause completion timeouts. Check that the chip is not under reset condition before proceeding to read the PHC by checking the flag BNXT_STATE_IN_FW_RESET. We also need to take the ptp_lock before we set this flag to prevent race conditions. We need this logic because the PHC now will stay registered after bnxt_close(). Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a521c8a01d267bc1732ee83fdbf3ad2e02240d63 Author: Michael Chan Date: Wed Jul 28 14:11:40 2021 -0400 bnxt_en: Move bnxt_ptp_init() from bnxt_open() back to bnxt_init_one() It was pointed out by Richard Cochran that registering the PHC during probe is better than during ifup, so move bnxt_ptp_init() back to bnxt_init_one(). In order to work correctly after firmware reset which may result in PTP config. changes, we modify bnxt_ptp_init() to return if the PHC has been registered earlier. If PTP is no longer supported by the new firmware, we will unregister the PHC and clean up. This partially reverts: d7859afb6880 ("bnxt_en: Move bnxt_ptp_init() to bnxt_open()") Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit c29758cdc78ab4ff2431e02015dd26aefa5097c9 Author: Zack Rusin Date: Fri Jul 23 12:51:53 2021 -0400 drm/vmwgfx: Use 2.19 version number to recognize mks-stats ioctls To let the userspace recognize that it's running on top of a vmwgfx that supports mks-stat ioctls we need to bump the version number. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Neha Bhende Link: https://patchwork.freedesktop.org/patch/msgid/20210723165153.113198-4-zackr@vmware.com commit cfdc3458db8a1620b1e307e3cb07480a161146ab Author: Zack Rusin Date: Fri Jul 23 12:51:52 2021 -0400 drm/vmwgfx: Be a lot more flexible with MOB limits The code was trying to keep a strict limit on the amount of mob memory that was used in the guest by making it match the host settings. There's technically no reason to do that (guests can certainly use more than the host can have resident in renderers at the same time). In particular this is problematic because our userspace is not great at handling OOM conditions and running out of MOB space results in GL apps crashing, e.g. gnome-shell likes to allocate huge surfaces (~61MB for the desktop on 2560x1600 with two workspaces) and running out of memory there means that the gnome-shell crashes on startup taking us back to the login and resulting in a system where one can not login in graphically anymore. Instead of letting the userspace crash we can extend available MOB space, we just don't want to use all of the RAM for graphics, so we're going to limit it to half of RAM. With the addition of some extra logging this should make the "guest has been configured with not enough graphics memory" errors a lot easier to diagnose in cases where the automatic expansion of MOB space fails. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210723165153.113198-3-zackr@vmware.com commit 2b273544f5800a38673883fc591ce4d83a2bedb3 Author: Zack Rusin Date: Fri Jul 23 12:51:51 2021 -0400 drm/vmwgfx: Cleanup logging The code was using the old DRM logging functions, which made it hard to figure out what was coming from vmwgfx. The newer logging helpers include the driver name in the logs and make it explicit which driver they're coming from. This allows us to standardize our logging a bit and clean it up in the process. vmwgfx is a little special because technically the hardware it's running on can be anything from the last 12 years or so which is why we need to include capabilities in the logs in the first place or otherwise we'd have no way of knowing what were the capabilities of the platform the guest was running in. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210723165153.113198-2-zackr@vmware.com commit f1f3e37535a030dad004dc735aaa366596ef318f Author: Zack Rusin Date: Fri Jul 23 12:51:50 2021 -0400 drm/vmwgfx: Switch to using DRM_IOCTL_DEF_DRV The macro has been accounting for DRM_COMMAND_BASE for a long time now so there's no reason to still be duplicating it. Plus we were leaving the name undefined which meant that all the DRM ioctl warnings/errors were always listing "null" ioctl at the culprit. This fixes the undefined ioctl name and removes duplicated code. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210723165153.113198-1-zackr@vmware.com commit ccd1c4d7947907b723a5d43d61383578c2f130b6 Author: Greg Kroah-Hartman Date: Wed Jul 28 20:53:08 2021 +0200 Revert "v253_init: eliminate pointer to string" This reverts commit 8496f60a670debe356a9168a66b7560641e53e93. It will be coming in through the ASoC tree instead. Reported-by: Mark Brown Cc: Liam Girdwood Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman commit a8cb3ede82fea8a0afc7d8ba8f4977a13a410441 Author: Greg Kroah-Hartman Date: Wed Jul 28 20:52:19 2021 +0200 Revert "cx20442: tty_ldisc_ops::write_wakeup is optional" This reverts commit 0e9ffdb236b8d273a086e86887192a62dd8f144a. It will be coming in through the ASoC tree instead. Cc: Liam Girdwood Reported-by: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman commit cc59bde1c920ab6689d40eba1a6fcd4edbec2455 Author: Benjamin Philip Date: Wed Jul 28 00:49:53 2021 +0530 staging: sm750fb: Rename vScreen to v_screen in lynxfb_crtc The struct lynxfb_crtc has a member named vScreen. This name is CamelCase and is frowned upon. This commit renames it to v_screen and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECKs: CHECK: Avoid CamelCase: 454: FILE: sm750.c:454: + memset_io(crtc->vScreen, 0x0, crtc->vidmem_size); CHECK: Avoid CamelCase: 136: FILE: sm750.h:136: + unsigned char __iomem *vScreen; /* virtual address of on_screen */ Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/52db14bfc2f39e246aed7fdf866845a72e503b36.1627413010.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7bca9543512e66c5de1c62f855febeae98801587 Author: Benjamin Philip Date: Wed Jul 28 00:49:52 2021 +0530 staging: sm750fb: Rename vCursor to v_cursor in lynxfb_crtc The struct lynxfb_crtc has a member named vCursor. This name is CamelCase and is frowned upon. This commit renames it to v_cursor and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECK: + unsigned char __iomem *vCursor; /* virtual address of cursor */ Signed-off-by: Benjamin Philip CHECK: Avoid CamelCase: 135: FILE: sm750.h:135: Link: https://lore.kernel.org/r/58dfc3f12deabe3a786ff2b9c75ac24f51724974.1627413010.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit 547265b8873fd8f3efef747316a31b22fbbe9c7c Author: Benjamin Philip Date: Wed Jul 28 00:49:51 2021 +0530 staging: sm750fb: Rename oCursor to o_cursor in lynxfb_crtc The struct lynxfb_crtc has a member named oCursor. This name is CamelCase and is frowned upon. This commit renames it to o_cursor and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECK: CHECK: Avoid CamelCase: 137: FILE: sm750.h:137: + int oCursor; /* cursor address offset in vidmem */ Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/aec911b055687892897feb4899644b9463245f1e.1627413010.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit fdc234d85210d91881119df4818dfb4bbf1ceffc Author: Benjamin Philip Date: Wed Jul 28 00:49:50 2021 +0530 staging: sm750fb: Rename oScreen to o_screen in lynxfb_crtc The struct lynxfb_crtc has a member named oScreen. This name is CamelCase and is frowned upon. This commit renames it to o_screen and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECKs: CHECK: Avoid CamelCase: 138: FILE: sm750.h:138: + int oScreen; /* onscreen address offset in vidmem */ CHECK: Avoid CamelCase: 178: FILE: sm750.c:178: + base = par->crtc.oScreen; Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/8d7c72027f7bc31a1c35a34f9909fa04f4cf8972.1627413010.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit aef1c966a36407e24f9cf2293e0c1941fc32cdb1 Author: Fabio M. De Francesco Date: Wed Jul 28 11:11:17 2021 +0200 staging: rtl8723bs: core: Fix incorrect type in assignment Fix sparse warnings: incorrect type in assignment (different base types). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210728091117.6235-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 274f4e78e5c8adf7d820c22553b22be79e517887 Author: Fabio Aiuto Date: Wed Jul 28 16:18:58 2021 +0200 staging: rtl8723bs: remove BT debug code remove BT dead debug code, probably it was intended for a specific command line interface. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/20210728141858.13024-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit d8133ef655d25f483c2853d5e6a61fce7c912a4e Author: Phillip Potter Date: Wed Jul 28 00:22:19 2021 +0100 staging: r8188eu: attach newly imported driver to build system Modify Kconfig and Makefile to import new r8188eu driver into build system, and allow it to build alongside deprecated older driver, by tweaking build parameters and module name for the older driver at the same time. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 3c56618e6691ca6adf8451a343d1ac2ca0c5e32b Author: Phillip Potter Date: Wed Jul 28 00:22:18 2021 +0100 staging: r8188eu: introduce new supporting files for RTL8188eu driver This patchset is split in order to keep the file sizes down. These supporting files are part of the newer/better driver from GitHub modified by Larry Finger. Import this as the basis for all future work going forward. Also, modify Makefile so that driver has same module filename as original rtl8188eu driver from staging, and rename config params to fit the Kconfig file taken from the old driver. Finally, reword Kconfig description to make it clear this is a newer driver. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 7884fc0a1473c2721f496f1d1ddc9d2c91aefa53 Author: Phillip Potter Date: Wed Jul 28 00:22:17 2021 +0100 staging: r8188eu: introduce new include dir for RTL8188eu driver This patchset is split in order to keep the file sizes down. This include directory is part of the newer/better driver from GitHub modified by Larry Finger. Import this as the basis for all future work going forward. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 2b42bd58b32155a1be4dd78991845dec05aaef9e Author: Phillip Potter Date: Wed Jul 28 00:22:16 2021 +0100 staging: r8188eu: introduce new os_dep dir for RTL8188eu driver This patchset is split in order to keep the file sizes down. This os_dep directory is part of the newer/better driver from GitHub modified by Larry Finger. Import this as the basis for all future work going forward. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8cd574e6af5463af7d693d111c61212e52c44810 Author: Phillip Potter Date: Wed Jul 28 00:22:15 2021 +0100 staging: r8188eu: introduce new hal dir for RTL8188eu driver This patchset is split in order to keep the file sizes down. This hal directory is part of the newer/better driver from GitHub modified by Larry Finger. Import this as the basis for all future work going forward. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 15865124feed880978b79839c756ef6cbb4ec6b3 Author: Phillip Potter Date: Wed Jul 28 00:22:14 2021 +0100 staging: r8188eu: introduce new core dir for RTL8188eu driver This patchset is split in order to keep the file sizes down. This core directory is part of the newer/better driver from GitHub modified by Larry Finger. Import this as the basis for all future work going forward. Suggested-by: Larry Finger Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210727232219.2948-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit d914b80a8f567d052d621197974ae08f729c963d Author: Peter Collingbourne Date: Tue Jul 27 13:54:39 2021 -0700 arm64: avoid double ISB on kernel entry Although an ISB is required in order to make the MTE-related system register update to GCR_EL1 effective, and the same is true for PAC-related updates to SCTLR_EL1 or APIAKey{Hi,Lo}_EL1, we issue two ISBs on machines that support both features while we only need to issue one. To avoid the unnecessary additional ISB, remove the ISBs from the PAC and MTE-specific alternative blocks and add a couple of additional blocks that cause us to only execute one ISB if both features are supported. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/Idee7e8114d5ae5a0b171d06220a0eb4bb015a51c Link: https://lore.kernel.org/r/20210727205439.2557419-1-pcc@google.com Signed-off-by: Catalin Marinas commit afdfd93a53aea68837b34da81d442358ff7552f3 Author: Peter Collingbourne Date: Tue Jul 13 18:36:38 2021 -0700 arm64: mte: optimize GCR_EL1 modification on kernel entry/exit Accessing GCR_EL1 and issuing an ISB can be expensive on some microarchitectures. Although we must write to GCR_EL1, we can restructure the code to avoid reading from it because the new value can be derived entirely from the exclusion mask, which is already in a GPR. Do so. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/I560a190a74176ca4cc5191dad08f77f6b1577c75 Link: https://lore.kernel.org/r/20210714013638.3995315-1-pcc@google.com Signed-off-by: Catalin Marinas commit 80c7c36fb3ddea8e06f75822bfb7634f64d0edcb Author: Peter Collingbourne Date: Tue Jul 27 13:52:59 2021 -0700 Documentation: document the preferred tag checking mode feature Document the functionality added in the previous patches. Link: https://linux-review.googlesource.com/id/I48217cc3e8b8da33abc08cbaddc11cf4360a1b86 Signed-off-by: Peter Collingbourne Reviewed-by: Catalin Marinas Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210727205300.2554659-6-pcc@google.com Acked-by: Will Deacon [catalin.marinas@arm.com: clarify that the change happens on task scheduling] Signed-off-by: Catalin Marinas commit dd061616edcf7deea53d878c690c90d44785d81a Author: Peter Collingbourne Date: Tue Jul 27 13:52:58 2021 -0700 arm64: mte: introduce a per-CPU tag checking mode preference Add a per-CPU sysfs node, mte_tcf_preferred, that allows the preferred tag checking mode to be configured. The current possible values are async and sync. Link: https://linux-review.googlesource.com/id/I7493dcd533a2785a1437b16c3f6b50919f840854 Signed-off-by: Peter Collingbourne Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210727205300.2554659-5-pcc@google.com Acked-by: Will Deacon Signed-off-by: Catalin Marinas commit d2e0d8f9746d3e09bcaf15e46c792e40819c9186 Author: Peter Collingbourne Date: Tue Jul 27 13:52:57 2021 -0700 arm64: move preemption disablement to prctl handlers In the next patch, we will start reading sctlr_user from mte_update_sctlr_user and subsequently writing a new value based on the task's TCF setting and potentially the per-CPU TCF preference. This means that we need to be careful to disable preemption around any code sequences that read from sctlr_user and subsequently write to sctlr_user and/or SCTLR_EL1, so that we don't end up writing a stale value (based on the previous CPU's TCF preference) to either of them. We currently have four such sequences, in the prctl handlers for PR_SET_TAGGED_ADDR_CTRL and PR_PAC_SET_ENABLED_KEYS, as well as in the task initialization code that resets the prctl settings. Change the prctl handlers to disable preemption in the handlers themselves rather than the functions that they call, and change the task initialization code to call the respective prctl handlers instead of setting sctlr_user directly. As a result of this change, we no longer need the helper function set_task_sctlr_el1, nor does its behavior make sense any more, so remove it. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/Ic0e8a0c00bb47d786c1e8011df0b7fe99bee4bb5 Link: https://lore.kernel.org/r/20210727205300.2554659-4-pcc@google.com Acked-by: Will Deacon Signed-off-by: Catalin Marinas commit 433c38f40f6a81cf3988b9372f2983912737f322 Author: Peter Collingbourne Date: Tue Jul 27 13:52:56 2021 -0700 arm64: mte: change ASYNC and SYNC TCF settings into bitfields Allow the user program to specify both ASYNC and SYNC TCF modes by repurposing the existing constants as bitfields. This will allow the kernel to select one of the modes on behalf of the user program. With this patch the kernel will always select async mode, but a subsequent patch will make this configurable. Link: https://linux-review.googlesource.com/id/Icc5923c85a8ea284588cc399ae74fd19ec291230 Signed-off-by: Peter Collingbourne Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210727205300.2554659-3-pcc@google.com Acked-by: Will Deacon Signed-off-by: Catalin Marinas commit 638982a03fbcdcda9bcb97b62ceec2d4a0f88162 Author: Peter Collingbourne Date: Tue Jul 27 13:52:55 2021 -0700 arm64: mte: rename gcr_user_excl to mte_ctrl We are going to use this field to store more data. To prepare for that, rename it and change the users to rely on the bit position of gcr_user_excl in mte_ctrl. Link: https://linux-review.googlesource.com/id/Ie1fd18e480100655f5d22137f5b22f4f3a9f9e2e Signed-off-by: Peter Collingbourne Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20210727205300.2554659-2-pcc@google.com Acked-by: Will Deacon Signed-off-by: Catalin Marinas commit 41c791fcd61a45cf06accf68384699deb7cad6ad Author: Badal Nilawar Date: Tue Jul 27 23:03:38 2021 +0530 drm/i915: dgfx cards need to wait on pcode's uncore init done In discrete cards, the graphics driver shouldn't proceed with the probe or resume unless PCODE indicated everything is done, including memory training and gt bring up. For this reason, the driver probe and resume paths needs to be blocked until PCODE indicates it is done. Also, it needs to aborted if the notification never arrives. In general, the few miliseconds would be enough and the regular PCODE recommendation for the timeout was 10 seconds. However there are some rare cases where this initialization can take up to 1 minute. So, PCODE has increased the recommendation to 3 minutes so we don't fully block the device utilization when something just got delayed for whatever reason. To be on the safest side, let's accept this recommendation, since on the regular case it won't delay or block the driver initialization and resume flows Cc: Rodrigo Vivi Signed-off-by: Badal Nilawar Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210727173338.901264-1-badal.nilawar@intel.com commit 4541e4f2225c30b0e9442be9eb2fb8b7086cdd1f Author: Rob Clark Date: Tue Jul 27 18:06:18 2021 -0700 drm/msm/gem: Mark active before pinning Mark all the bos in the submit as active, before pinning, to prevent evicting a buffer in the same submit to make room for a buffer earlier in the table. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210728010632.2633470-14-robdclark@gmail.com Signed-off-by: Rob Clark commit fc40e5e10c3bcc36f3f765f0d9fae0a13efc7935 Author: Rob Clark Date: Tue Jul 27 18:06:17 2021 -0700 drm/msm: Utilize gpu scheduler priorities The drm/scheduler provides additional prioritization on top of that provided by however many number of ringbuffers (each with their own priority level) is supported on a given generation. Expose the additional levels of priority to userspace and map the userspace priority back to ring (first level of priority) and schedular priority (additional priority levels within the ring). Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-13-robdclark@gmail.com Signed-off-by: Rob Clark commit e3e24ee51ed2c4a5f46b1032b4be1a0a5da90c06 Author: Rob Clark Date: Tue Jul 27 18:06:16 2021 -0700 drm/msm: Drop struct_mutex in submit path It is sufficient to serialize on the submit queue now. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-12-robdclark@gmail.com Signed-off-by: Rob Clark commit bd0b8e9f9c3c0f7f29884f62eec585a6396ba575 Author: Rob Clark Date: Tue Jul 27 18:06:15 2021 -0700 drm/msm: Drop submit bo_list This was only used to detect userspace including the same bo multiple times in a submit. But ww_mutex can already tell us this. When we drop struct_mutex around the submit ioctl, we'd otherwise need to lock the bo before adding it to the bo_list. But since ww_mutex can already tell us this, it is simpler just to remove the bo_list. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210728010632.2633470-11-robdclark@gmail.com Signed-off-by: Rob Clark commit 1d8a5ca436ee4a28eec14cb813f790f7cdeeee19 Author: Rob Clark Date: Tue Jul 27 18:06:14 2021 -0700 drm/msm: Conversion to drm scheduler For existing adrenos, there is one or more ringbuffer, depending on whether preemption is supported. When preemption is supported, each ringbuffer has it's own priority. A submitqueue (which maps to a gl context or vk queue in userspace) is mapped to a specific ring- buffer at creation time, based on the submitqueue's priority. Each ringbuffer has it's own drm_gpu_scheduler. Each submitqueue maps to a drm_sched_entity. And each submit maps to a drm_sched_job. Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/4 Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-10-robdclark@gmail.com Signed-off-by: Rob Clark commit 14db5499d583e0952606fbca3eb37a0f28008d30 Author: Tang Bin Date: Wed Jul 28 20:44:11 2021 +0800 ASoC: bcm: cygnus-pcm: Fix unused assignment about 'rc' Delete unused initialized value of 'rc', because it will be assigned by the function devm_request_irq(). Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210728124411.3168-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit 0f6b04adb58d80e7fb5f8d9229ad22c9931c3bd1 Author: Colin Ian King Date: Wed Jul 28 11:36:02 2021 +0100 ASoC: Intel: Fix spelling contraction "cant" -> "can't" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20210728103602.171817-1-colin.king@canonical.com Signed-off-by: Mark Brown commit b4f8e2d9b5f8ccc4c46bcab203e6d4fa0f6a7251 Merge: af996031e1545 0791ba2bc7d33 Author: Kalle Valo Date: Wed Jul 28 18:21:10 2021 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.15. Major changes: ath5k, ath9k, ath10k, ath11k: * switch from 'pci_' to 'dma_' API commit 708b7df3480aff61449e848876876b930ce93c4a Author: Daniel Vetter Date: Tue Jul 27 14:10:37 2021 +0200 drm/i915: Extract i915_module.c The module init code is somewhat misplaced in i915_pci.c, since it needs to pull in init/exit functions from every part of the driver and pollutes the include list a lot. Extract an i915_module.c file which pulls all the bits together, and allows us to massively trim the include list of i915_pci.c. The downside is that have to drop the error path check Jason added to catch when we set up the pci driver too early. I think that risk is acceptable for this pretty nice include. Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Cc: Tvrtko Ursulin Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-11-daniel.vetter@ffwll.ch commit bb13ea2825356de476b142b8186ea595a722c2b1 Author: Daniel Vetter Date: Tue Jul 27 14:10:36 2021 +0200 drm/i915: Remove i915_globals No longer used. Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-10-daniel.vetter@ffwll.ch commit 64fc7cc71c224cb028107130d7513d964f95ec45 Author: Daniel Vetter Date: Tue Jul 27 14:10:35 2021 +0200 drm/i915: move vma slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_vmas to just a slab_vmas. We have to keep i915_drv.h include in i915_globals otherwise there's nothing anymore that pulls in GEM_BUG_ON. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-9-daniel.vetter@ffwll.ch commit 210a0f5ce46080e6728e54010d50317fc9e1d969 Author: Daniel Vetter Date: Tue Jul 27 14:10:34 2021 +0200 drm/i915: move scheduler slabs to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_dependencies|priorities to just a slab_dependencies|priorities. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-8-daniel.vetter@ffwll.ch commit 47514ac752efdf4ff3ca1edeed8a811dc56a082c Author: Daniel Vetter Date: Tue Jul 27 14:10:33 2021 +0200 drm/i915: move request slabs to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_requests|execute_cbs to just a slab_requests|execute_cbs. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-7-daniel.vetter@ffwll.ch commit c8ad09affd27590fee8dbf6b24419abf9d9bcf3d Author: Daniel Vetter Date: Tue Jul 27 14:10:32 2021 +0200 drm/i915: move gem_objects slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_objects to just a slab_objects. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-6-daniel.vetter@ffwll.ch commit a6270d1d4ceff6ac781d762c5290ce7335e3890b Author: Daniel Vetter Date: Tue Jul 27 14:10:31 2021 +0200 drm/i915: move gem_context slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_luts to just a slab_luts. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-5-daniel.vetter@ffwll.ch commit 2dcec7d3fe536d6b9088453377252b8aeb5cc816 Author: Daniel Vetter Date: Tue Jul 27 14:10:30 2021 +0200 drm/i915: move intel_context slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_ce to just a slab_ce. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-4-daniel.vetter@ffwll.ch commit a28beb344bb1f02b1306ce3ceaecbf2afe3e42cd Author: Daniel Vetter Date: Tue Jul 27 14:10:29 2021 +0200 drm/i915: move i915_buddy slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_blocks to just a slab_blocks. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-3-daniel.vetter@ffwll.ch commit 512ba03e35ccb2897d19d0207ef6bd55a9564fd1 Author: Daniel Vetter Date: Tue Jul 27 14:10:28 2021 +0200 drm/i915: move i915_active slab to direct module init/exit With the global kmem_cache shrink infrastructure gone there's nothing special and we can convert them over. I'm doing this split up into each patch because there's quite a bit of noise with removing the static global.slab_cache to just a slab_cache. v2: Make slab static (Jason, 0day) Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-2-daniel.vetter@ffwll.ch commit 6d5de3275609c6022d6677808968b7adcdee5e66 Author: Daniel Vetter Date: Tue Jul 27 14:10:27 2021 +0200 drm/i915: Check for nomodeset in i915_init() first When modesetting (aka the full pci driver, which has nothing to do with disable_display option, which just gives you the full pci driver without the display driver) is disabled, we load nothing and do nothing. So move that check first, for a bit of orderliness. With Jason's module init/exit table this now becomes trivial. Reviewed-by: Jason Ekstrand Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727121037.2041102-1-daniel.vetter@ffwll.ch commit b2c943e52705b211d1aa0633c9196150cf30be47 Author: Uwe Kleine-König Date: Tue Jul 27 10:08:37 2021 +0200 nubus: Make struct nubus_driver::remove return void The nubus core ignores the return value of the remove callback (in nubus_device_remove()) and all implementers return 0 anyway. So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. Signed-off-by: Uwe Kleine-König Acked-by: Finn Thain Link: https://lore.kernel.org/r/20210727080840.3550927-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6571a76af380290dd9a003a3bc90d4779ec4f8f8 Author: Laurent Pinchart Date: Thu Apr 15 05:23:15 2021 +0300 drm: rcar-du: lvds: Use dev_err_probe() Simplify error handling by using the dev_err_probe() function. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham commit 9b54182ce23946674231bbe3ee22f89dfe274cab Author: Laurent Pinchart Date: Thu Apr 15 05:16:42 2021 +0300 drm: rcar-du: lvds: Don't set bridge driver_private field The drm_bridge.driver_private field is set but never used. Don't set it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham commit c24110a8fd09ac754df36feeece4b98d072f0f64 Author: Laurent Pinchart Date: Mon May 25 06:18:01 2020 +0300 drm: rcar-du: Use drm_bridge_connector_init() helper Use the drm_bridge_connector_init() helper to create a drm_connector for each output, instead of relying on the bridge drivers doing so. Attach the bridges with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to instruct them not to create a connector. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Tested-by: Kieran Bingham # On V3U Reviewed-by: Kieran Bingham commit d0f44e0dac29aca3f85d238dfbcd2e52450b38dc Author: Laurent Pinchart Date: Mon May 25 07:05:26 2020 +0300 drm: rcar-du: dw-hdmi: Set output port number Report the DT output port number in dw_hdmi_plat_data to connect to the next bridge in the dw-hdmi driver. Signed-off-by: Laurent Pinchart Tested-by: Kieran Bingham # On V3U Reviewed-by: Kieran Bingham commit e9e056949c927e5bdfd0ee172ad95658f6c3c198 Author: Laurent Pinchart Date: Thu Apr 16 01:29:53 2020 +0300 drm: rcar-du: lvds: Convert to DRM panel bridge helper Replace the manual panel handling with usage of the DRM panel bridge helper. This simplifies the driver, and brings support for DRM_BRIDGE_ATTACH_NO_CONNECTOR as an added bonus. Signed-off-by: Laurent Pinchart Tested-by: Kieran Bingham # On V3U Reviewed-by: Kieran Bingham commit 5bcc48395b9f35dace564de47fcf434cdb67a8e1 Author: Laurent Pinchart Date: Thu May 14 04:03:07 2020 +0300 drm: bridge: dw-hdmi: Attach to next bridge if available On all platforms except i.MX and Rockchip, the dw-hdmi DT bindings require a video output port connected to an HDMI sink (most likely an HDMI connector, in rare cases another bridges converting HDMI to another protocol). For those platforms, retrieve the next bridge and attach it from the dw-hdmi bridge attach handler. Signed-off-by: Laurent Pinchart Reviewed-by: Neil Armstrong Tested-by: Kieran Bingham # On V3U Reviewed-by: Kieran Bingham commit fb8d617f8fd64f52f62e4f782aed64d1754ed33b Author: Laurent Pinchart Date: Tue Mar 23 23:50:08 2021 +0200 drm/bridge: Centralize error message when bridge attach fails Being informed of a failure to attach a bridge is useful, and many drivers prints an error message in that case. Move the message to drm_bridge_attach() to avoid code duplication. Suggested-by: Stephen Boyd Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Jyri Sarha commit 5e7ef0b85c7718c10f6122caf7af9b2e70d53830 Author: Laurent Pinchart Date: Tue Mar 23 02:09:53 2021 +0200 drm: rcar-du: Shutdown the display on remove When the device is unbound from the driver (the DU being a platform device, this occurs either when removing the DU module, or when unbinding the device manually through sysfs), the display may be active. Make sure it gets shut down. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham commit c29b6b0b126e9ee69a5d6339475e831a149295bd Author: Laurent Pinchart Date: Tue Mar 23 02:09:53 2021 +0200 drm: rcar-du: Don't put reference to drm_device in rcar_du_remove() The reference to the drm_device that was acquired by devm_drm_dev_alloc() is released automatically by the devres infrastructure. It must not be released manually, as that causes a reference underflow.. Fixes: ea6aae151887 ("drm: rcar-du: Embed drm_device in rcar_du_device") Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham commit 015f2ebb93767d40c442e749642fffaf10316d78 Author: Laurent Pinchart Date: Tue Mar 23 02:09:53 2021 +0200 drm: rcar-du: Shutdown the display on system shutdown When the system shuts down or warm reboots, the display may be active, with the hardware accessing system memory. Upon reboot, the DDR will not be accessible, which may cause issues. Implement the platform_driver .shutdown() operation and shut down the display to fix this. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham commit 4b4e7a2a4c535de40ac850ef0245106c655eaa7a Author: Colin Ian King Date: Thu Feb 4 18:33:44 2021 +0000 drm/bridge: make a const array static, makes object smaller Don't populate the const array frs_limits on the stack but instead make it static. Makes the object code smaller by 128 bytes: Before: text data bss dec hex filename 24845 7440 64 32349 7e5d ./drivers/gpu/drm/bridge/tc358768.o After: text data bss dec hex filename 24749 7408 64 32221 7ddd ./drivers/gpu/drm/bridge/tc358768.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit e43c5261a654ff9c9279dc11a8deadb8c2c3e0f7 Author: Matt Roper Date: Fri Jul 23 10:42:10 2021 -0700 drm/i915/xehpsdv: Correct parameters for IS_XEHPSDV_GT_STEP() During a rebase the parameters were partially renamed, but not completely. Since the subsequent patches that start using this macro haven't landed on an upstream tree yet this didn't cause a build failure. Fixes: 086df54e20be ("drm/i915/xehpsdv: add initial XeHP SDV definitions") Signed-off-by: Matt Roper Reviewed-by: Caz Yokoyama Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-2-matthew.d.roper@intel.com commit 7882c55ef64a8179160f24d86e82e525ffcce020 Author: Randy Dunlap Date: Tue Jul 27 16:22:12 2021 -0700 filesystems/locking: fix Malformed table warning Update the bottom border to be the same as the top border. Documentation/filesystems/locking.rst:274: WARNING: Malformed table. Bottom/header table border does not match top border. Fixes: 730633f0b7f9 ("mm: Protect operations adding pages to page cache with invalidate_lock") Link: https://lore.kernel.org/r/20210727232212.12510-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Reviewed-by: Darrick J. Wong Cc: Darrick J. Wong Cc: Christoph Hellwig Cc: Jan Kara Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Jan Kara commit 573d7ce4f69a85010fe2a40f4976326ee347f584 Author: Imre Deak Date: Tue Jul 27 16:44:00 2021 +0300 drm/i915/adlp: Add workaround to disable CMTG clock gating The driver doesn't depend atm on the common mode timing generator functionality (it would be used for some power saving feature and panel timing synchronization), however DMC will corrupt the CMTG registers across DC5 entry/exit sequences unless the CMTG clock gating is disabled. This in turn can lead to at least the DPLL0/1 configuration getting stuck at their last state, which means we can't reprogram them to a new config. Add the corresponding Bspec workaround to prevent the above. v2: Fix checkpatch errors. (CI, Jose) Cc: Uma Shankar Cc: José Roberto de Souza Cc: Anshuman Gupta Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210727134400.101290-1-imre.deak@intel.com commit 63caca1e3ef6e5ff53f97b41f03ec2805cca1e2b Merge: 68f9884837c6e 987e1b96d056d Author: David S. Miller Date: Wed Jul 28 13:39:03 2021 +0100 Merge branch 'fec-next' Joakim Zhang says: ==================== net: fec: add support for i.MX8MQ and i.MX8QM This patch set adds supports for i.MX8MQ and i.MX8QM, both of them extend new features. ChangeLogs: V1->V2: * rebase on schema binding, and update dts compatible string. * use generic ethernet controller property for MAC internal RGMII clock delay rx-internal-delay-ps and tx-internal-delay-ps ==================== Signed-off-by: David S. Miller commit 987e1b96d056d81e6253ba1b1e80a4fd7b7b68a1 Author: Joakim Zhang Date: Wed Jul 28 19:52:03 2021 +0800 arm64: dts: imx8qxp: add "fsl,imx8qm-fec" compatible string for FEC Add "fsl,imx8qm-fec" compatible string for FEC to support new feature (RGMII delayed clock). Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit a758dee8ac50cdabc1229ca82bc7472752a51e1d Author: Joakim Zhang Date: Wed Jul 28 19:52:02 2021 +0800 arm64: dts: imx8m: add "fsl,imx8mq-fec" compatible string for FEC Add "fsl,imx8mq-fec" compatible string for FEC to support new feature (IEEE 802.3az EEE standard). Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit fc539459e900a891dda5b586d7b5e3fd5db14218 Author: Fugang Duan Date: Wed Jul 28 19:52:01 2021 +0800 net: fec: add MAC internal delayed clock feature support i.MX8QM ENET IP version support timing specification that MAC integrate clock delay in RGMII mode, the delayed TXC/RXC as an alternative option to work well with various PHYs. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit b82f8c3f1409f1c97621e9e4b3a24c627b7651ac Author: Fugang Duan Date: Wed Jul 28 19:52:00 2021 +0800 net: fec: add eee mode tx lpi support The i.MX8MQ ENET version support IEEE802.3az eee mode, add eee mode tx lpi enable to support ethtool interface. usage: 1. set sleep and wake timer to 5ms: ethtool --set-eee eth0 eee on tx-lpi on tx-timer 5000 2. check the eee mode: ~# ethtool --show-eee eth0 EEE Settings for eth0: EEE status: enabled - active Tx LPI: 5000 (us) Supported EEE link modes: 100baseT/Full 1000baseT/Full Advertised EEE link modes: 100baseT/Full 1000baseT/Full Link partner advertised EEE link modes: 100baseT/Full Note: For realtime case and IEEE1588 ptp case, it should disable EEE mode. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 947240ebcc635ab063f17ba027352c3a474d2438 Author: Fugang Duan Date: Wed Jul 28 19:51:59 2021 +0800 net: fec: add imx8mq and imx8qm new versions support The ENET of imx8mq and imx8qm are basically the same as imx6sx, but they have new features support based on imx6sx, like: - imx8mq: supports IEEE 802.3az EEE standard. - imx8qm: supports RGMII mode delayed clock. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit df11b8073e19bd0eedae630dae82f38eb374b80d Author: Joakim Zhang Date: Wed Jul 28 19:51:58 2021 +0800 dt-bindings: net: fsl,fec: add RGMII internal clock delay Add RGMII internal clock delay for FEC controller. Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 5d886947039d029f8ba1da6030c0a00ef330373d Author: Joakim Zhang Date: Wed Jul 28 19:51:57 2021 +0800 dt-bindings: net: fsl,fec: update compatible items Add more compatible items for i.MX8/8M platforms. Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 125d10373ad991888c9e94d2da49bcc5ccba2127 Author: Dave Jiang Date: Tue Jul 20 13:42:15 2021 -0700 dmanegine: idxd: add software command status Enabling device and wq returns standard errno and that does not provide enough details to indicate what exactly failed. The hardware command status is only 8bits. Expand the command status to 32bits and use the upper 16 bits to define software errors to provide more details on the exact failure. Bit 31 will be used to indicate the error is software set as the driver is using some of the spec defined hardware error as well. Cc: Ramesh Thomas Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162681373579.1968485.5891788397526827892.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit a9c171527a3403cae6c1907744b1bc9ca301f912 Author: Dave Jiang Date: Tue Jul 20 13:42:04 2021 -0700 dmaengine: idxd: rotate portal address for better performance The device submission portal is on a 4k page and any of those 64bit aligned address on the page can be used for descriptor submission. By rotating the offset through the 4k range and prevent successive writes to the same MMIO address, performance improvement is observed through testing. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162681372446.1968485.10634280461681015569.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 673d812d30be67942762bb9e8548abb26a3ba4a7 Author: Dave Jiang Date: Thu Jul 22 10:54:10 2021 -0700 dmaengine: idxd: fix wq slot allocation index check The sbitmap wait and allocate routine checks the index that is returned from sbitmap_queue_get(). It should be idxd >= 0 as 0 is also a valid index. This fixes issue where submission path hangs when WQ size is 1. Fixes: 0705107fcc80 ("dmaengine: idxd: move submission to sbitmap_queue") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162697645067.3478714.506720687816951762.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 568b2126466f926a10be0b53b40c2d6ae056d8d6 Author: Dave Jiang Date: Wed Jul 21 11:35:03 2021 -0700 dmaengine: idxd: fix uninit var for alt_drv 0-day detected uninitialized alt_drv variable in the bind_store() function. The branch can be taken when device is not idxd device or wq 'struct device'. Init alt_drv to NULL. Fixes: 6e7f3ee97bbe ("dmaengine: idxd: move dsa_drv support to compatible mode") Reported-by: kernel test robot Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162689250332.2114335.636367120454420852.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit ade8a86b512cf8db0d0e975a971ce356953cfcb3 Author: Dave Jiang Date: Tue Jul 20 13:42:10 2021 -0700 dmaengine: idxd: Set defaults for GRPCFG traffic class Set GRPCFG traffic class to value of 1 for best performance on current generation of accelerators. Also add override option to allow experimentation. Sysfs knobs are disabled for DSA/IAX gen1 devices. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162681373005.1968485.3761065664382799202.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 68f9884837c6e40293e5453def3ce656c770e805 Author: Peilin Ye Date: Tue Jul 27 18:33:40 2021 -0700 tc-testing: Add control-plane selftest for skbmod SKBMOD_F_ECN option Recently we added a new option, SKBMOD_F_ECN, to tc-skbmod(8). Add a control-plane selftest for it. Depends on kernel patch "net/sched: act_skbmod: Add SKBMOD_F_ECN option support", as well as iproute2 patch "tc/skbmod: Introduce SKBMOD_F_ECN option". Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit 56af5e749f20c3a540310c207dcc373f4f09156e Author: Peilin Ye Date: Tue Jul 27 18:33:15 2021 -0700 net/sched: act_skbmod: Add SKBMOD_F_ECN option support Currently, when doing rate limiting using the tc-police(8) action, the easiest way is to simply drop the packets which exceed or conform the configured bandwidth limit. Add a new option to tc-skbmod(8), so that users may use the ECN [1] extension to explicitly inform the receiver about the congestion instead of dropping packets "on the floor". The 2 least significant bits of the Traffic Class field in IPv4 and IPv6 headers are used to represent different ECN states [2]: 0b00: "Non ECN-Capable Transport", Non-ECT 0b10: "ECN Capable Transport", ECT(0) 0b01: "ECN Capable Transport", ECT(1) 0b11: "Congestion Encountered", CE As an example: $ tc filter add dev eth0 parent 1: protocol ip prio 10 \ matchall action skbmod ecn Doing the above marks all ECT(0) and ECT(1) packets as CE. It does NOT affect Non-ECT or non-IP packets. In the tc-police scenario mentioned above, users may pipe a tc-police action and a tc-skbmod "ecn" action together to achieve ECN-based rate limiting. For TCP connections, upon receiving a CE packet, the receiver will respond with an ECE packet, asking the sender to reduce their congestion window. However ECN also works with other L4 protocols e.g. DCCP and SCTP [2], and our implementation does not touch or care about L4 headers. The updated tc-skbmod SYNOPSIS looks like the following: tc ... action skbmod { set SETTABLE | swap SWAPPABLE | ecn } ... Only one of "set", "swap" or "ecn" shall be used in a single tc-skbmod command. Trying to use more than one of them at a time is considered undefined behavior; pipe multiple tc-skbmod commands together instead. "set" and "swap" only affect Ethernet packets, while "ecn" only affects IPv{4,6} packets. It is also worth mentioning that, in theory, the same effect could be achieved by piping a "police" action and a "bpf" action using the bpf_skb_ecn_set_ce() helper, but this requires eBPF programming from the user, thus impractical. Depends on patch "net/sched: act_skbmod: Skip non-Ethernet packets". [1] https://datatracker.ietf.org/doc/html/rfc3168 [2] https://en.wikipedia.org/wiki/Explicit_Congestion_Notification Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit d80f6d6665a6aa5875327f12491c90f428bf50b1 Author: Yang Yingliang Date: Wed Jul 28 17:16:31 2021 +0800 nfp: flower-ct: fix error return code in nfp_fl_ct_add_offload() If nfp_tunnel_add_ipv6_off() fails, it should return error code in nfp_fl_ct_add_offload(). Fixes: 5a2b93041646 ("nfp: flower-ct: compile match sections of flow_payload") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Louis Peens Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 258cb692b82025d0e6e1cccb72baa60ff78d0ce8 Author: Clément Léger Date: Wed Jul 28 11:46:07 2021 +0200 dmaengine: at_xdmac: use platform_driver_register When using SCMI clocks, the clocks are probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clocks not being available at that time. This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when clocks will be available. Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20210728094607.50589-1-clement.leger@bootlin.com Signed-off-by: Vinod Koul commit 3b41fb4094914903fd8e50a13def9e47763dc101 Author: Vincent Lefevre Date: Thu Jul 22 03:25:44 2021 +0200 HID: apple: Add missing scan code event for keys handled by hid-apple When an EV_KEY event is generated by hid-apple due to special key mapping, the usual associated scan code event (EV_MSC) is missing. This issue can be seen with the evtest utility. Add the scan code event for these special keys. BugLink: https://bugs.debian.org/757356 Co-developed-by: Daniel Lin Signed-off-by: Daniel Lin Signed-off-by: Vincent Lefevre Signed-off-by: Jiri Kosina commit bebf8820b355e6ac00487f3f36440d502eb4a44c Author: Thomas Weißschuh Date: Tue Jul 20 22:27:08 2021 +0200 HID: cmedia: add support for HS-100B mute button These chips report mute button events in bit 4 of their report without it being part of the report descriptor. Use a custom descriptor that maps this bit. Signed-off-by: Thomas Weißschuh Signed-off-by: Jiri Kosina commit 25ddd7cfc582d6001c3b9e18e96c9b3a58523d66 Author: Douglas Anderson Date: Tue Jul 20 09:07:49 2021 -0700 HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier() In commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator") I added a call to regulator_register_notifier() but no call to unregister. That's a bug. Let's use the devm variant to handle the unregistering. Fixes: 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator") Signed-off-by: Douglas Anderson Signed-off-by: Jiri Kosina commit 9d339fe4cbd5de150f2d9fd554cc7e7213d09f08 Author: Jason Gerecke Date: Mon Jul 19 13:55:33 2021 -0700 HID: wacom: Refactor touch input mute checks into a common function We perform this same set of tests to see if touch input is muted in several places. We might as well replace these independent copies with an inline function. Signed-off-by: Jason Gerecke Signed-off-by: Jiri Kosina commit ccb51c2e3f0598934c3698f3645a3cb99add201c Author: Jason Gerecke Date: Mon Jul 19 13:55:32 2021 -0700 HID: wacom: Avoid sending empty sync events Empty sync events clutter up logs and are a waste of CPU cycles. We can avoid sending mt_sync events if touch is disabled or a specific slot is unused. We can avoid sending full sync events if no events were generated. Signed-off-by: Ping Cheng Signed-off-by: Jason Gerecke Signed-off-by: Jiri Kosina commit 5bed0128868ce0e71f243973b3fc7b3bfca902b5 Author: Jason Gerecke Date: Mon Jul 19 13:55:30 2021 -0700 HID: wacom: Short-circuit processing of touch when it is disabled Avoid doing unnecessary work when touch is disabled by detecting this condition and returning early. Note that the probe process sends GET FEATURE requests to discover e.g. HID_DG_CONTACTMAX, so we can't start ignoring touch reports until probe finishes. Signed-off-by: Ping Cheng Signed-off-by: Jason Gerecke Signed-off-by: Jiri Kosina commit dc9dc864f35dd3b87d52fbe9809773576ac77d32 Author: Ping Cheng Date: Mon Jul 19 13:55:29 2021 -0700 HID: wacom: set initial hardware touch switch state to 'off' Wacom touch devices have two types of touch switches: softkey touch toggle and hardware touch switch. For softkey toggle, we assume touch is on by default in the driver. However the hardware touch switch is controlled by end users. We don't know if it's on or off before getting the status event. This patch sets touch off for devices with a hardware switch until we get the status. This is a bit safer for users who leave the switch "off" and don't want any accidental touches. The tradeoff is a slight delay between device connection and touch becoming enabled for users who leave the switch "on". Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke Tested-by: Jason Gerecke Signed-off-by: Jiri Kosina commit b7fe54f6c2d437082dcbecfbd832f38edd9caaf4 Author: Balbir Singh Date: Fri Jan 8 23:10:56 2021 +1100 Documentation: Add L1D flushing Documentation Add documentation of l1d flushing, explain the need for the feature and how it can be used. Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-6-sblbir@amazon.com commit e893bb1bb4d2eb635eba61e5d9c5135d96855773 Author: Balbir Singh Date: Fri Jan 8 23:10:55 2021 +1100 x86, prctl: Hook L1D flushing in via prctl Use the existing PR_GET/SET_SPECULATION_CTRL API to expose the L1D flush capability. For L1D flushing PR_SPEC_FORCE_DISABLE and PR_SPEC_DISABLE_NOEXEC are not supported. Enabling L1D flush does not check if the task is running on an SMT enabled core, rather a check is done at runtime (at the time of flush), if the task runs on a SMT sibling then the task is sent a SIGBUS which is executed before the task returns to user space or to a guest. This is better than the other alternatives of: a. Ensuring strict affinity of the task (hard to enforce without further changes in the scheduler) b. Silently skipping flush for tasks that move to SMT enabled cores. Hook up the core prctl and implement the x86 specific parts which in turn makes it functional. Suggested-by: Thomas Gleixner Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-5-sblbir@amazon.com commit b5f06f64e269f9820cd5ad9e9a98afa6c8914b7a Author: Balbir Singh Date: Mon Apr 26 21:42:30 2021 +0200 x86/mm: Prepare for opt-in based L1D flush in switch_mm() The goal of this is to allow tasks that want to protect sensitive information, against e.g. the recently found snoop assisted data sampling vulnerabilites, to flush their L1D on being switched out. This protects their data from being snooped or leaked via side channels after the task has context switched out. This could also be used to wipe L1D when an untrusted task is switched in, but that's not a really well defined scenario while the opt-in variant is clearly defined. The mechanism is default disabled and can be enabled on the kernel command line. Prepare for the actual prctl based opt-in: 1) Provide the necessary setup functionality similar to the other mitigations and enable the static branch when the command line option is set and the CPU provides support for hardware assisted L1D flushing. Software based L1D flush is not supported because it's CPU model specific and not really well defined. This does not come with a sysfs file like the other mitigations because it is not bound to any specific vulnerability. Support has to be queried via the prctl(2) interface. 2) Add TIF_SPEC_L1D_FLUSH next to L1D_SPEC_IB so the two bits can be mangled into the mm pointer in one go which allows to reuse the existing mechanism in switch_mm() for the conditional IBPB speculation barrier efficiently. 3) Add the L1D flush specific functionality which flushes L1D when the outgoing task opted in. Also check whether the incoming task has requested L1D flush and if so validate that it is not accidentaly running on an SMT sibling as this makes the whole excercise moot because SMT siblings share L1D which opens tons of other attack vectors. If that happens schedule task work which signals the incoming task on return to user/guest with SIGBUS as this is part of the paranoid L1D flush contract. Suggested-by: Thomas Gleixner Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-1-sblbir@amazon.com commit 8aacd1eab53ec853c2d29cdc9b64e9dc87d2a519 Author: Balbir Singh Date: Mon Apr 26 22:09:43 2021 +0200 x86/process: Make room for TIF_SPEC_L1D_FLUSH The upcoming support for paranoid L1D flush in switch_mm() requires that TIF_SPEC_IB and the new TIF_SPEC_L1D_FLUSH are two consecutive bits in thread_info::flags. Move TIF_SPEC_FORCE_UPDATE to a spare bit to make room for the new one. Suggested-by: Thomas Gleixner Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-1-sblbir@amazon.com commit 58e106e725eed59896b9141a1c9a917d2f67962a Author: Balbir Singh Date: Mon Apr 26 21:59:11 2021 +0200 sched: Add task_work callback for paranoid L1D flush The upcoming paranoid L1D flush infrastructure allows to conditionally (opt-in) flush L1D in switch_mm() as a defense against potential new side channels or for paranoia reasons. As the flush makes only sense when a task runs on a non-SMT enabled core, because SMT siblings share L1, the switch_mm() logic will kill a task which is flagged for L1D flush when it is running on a SMT thread. Add a taskwork callback so switch_mm() can queue a SIG_KILL command which is invoked when the task tries to return to user space. Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-1-sblbir@amazon.com commit 371b09c6fdc436f2c7bb67fc90df5eec8ce90f06 Author: Balbir Singh Date: Fri Jan 8 23:10:53 2021 +1100 x86/mm: Refactor cond_ibpb() to support other use cases cond_ibpb() has the necessary bits required to track the previous mm in switch_mm_irqs_off(). This can be reused for other use cases like L1D flushing on context switch. Suggested-by: Thomas Gleixner Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-3-sblbir@amazon.com commit c52787b590634646d4da3d8f23c4532ba050d40d Author: Balbir Singh Date: Fri Jan 8 23:10:52 2021 +1100 x86/smp: Add a per-cpu view of SMT state A new field smt_active in cpuinfo_x86 identifies if the current core/cpu is in SMT mode or not. This is helpful when the system has some of its cores with threads offlined and can be used for cases where action is taken based on the state of SMT. The upcoming support for paranoid L1D flush will make use of this information. Suggested-by: Thomas Gleixner Signed-off-by: Balbir Singh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210108121056.21940-2-sblbir@amazon.com commit a6b8bb6a813a6621c75ceacd1fa604c0229e9624 Author: Heiner Kallweit Date: Tue Jul 27 22:25:25 2021 +0200 i2c: i801: Fix handling SMBHSTCNT_PEC_EN Bit SMBHSTCNT_PEC_EN is used only if software calculates the CRC and uses register SMBPEC. This is not supported by the driver, it supports hw-calculation of CRC only (using bit SMBAUXSTS_CRCE). The chip spec states the following, therefore never set bit SMBHSTCNT_PEC_EN. Chapter SMBus CRC Generation and Checking If the AAC bit is set in the Auxiliary Control register, the PCH automatically calculates and drives CRC at the end of the transmitted packet for write cycles, and will check the CRC for read cycles. It will not transmit the contents of the PEC register for CRC. The PEC bit must not be set in the Host Control register. If this bit is set, unspecified behavior will result. This patch is based solely on the specification and compile-tested only, because I have no PEC-capable devices. Signed-off-by: Heiner Kallweit Tested-by: Jean Delvare Signed-off-by: Wolfram Sang commit f7744fa16b96da57187dc8e5634152d3b63d72de Author: Anirudh Rayabharam Date: Thu Jun 24 00:10:29 2021 +0530 HID: usbhid: free raw_report buffers in usbhid_stop Free the unsent raw_report buffers when the device is removed. Fixes a memory leak reported by syzbot at: https://syzkaller.appspot.com/bug?id=7b4fa7cb1a7c2d3342a2a8a6c53371c8c418ab47 Reported-by: syzbot+47b26cd837ececfc666d@syzkaller.appspotmail.com Tested-by: syzbot+47b26cd837ececfc666d@syzkaller.appspotmail.com Signed-off-by: Anirudh Rayabharam Signed-off-by: Jiri Kosina commit 3bdc70669eb2d53dc3abef3c1d790bfe408e2e40 Merge: 299b50fc9e8b9 d7907a2b1a3b8 Author: David S. Miller Date: Wed Jul 28 10:23:59 2021 +0100 Merge branch 'devlink-register' Leon Romanovsky says: ==================== Remove duplicated devlink registration check Changelog: v1: * Added two new patches that remove registration field from mlx5 and ti drivers. v0: https://lore.kernel.org/lkml/ed7bbb1e4c51dd58e6035a058e93d16f883b09ce.1627215829.git.leonro@nvidia.com -------------------------------------------------------------------- Both registered flag and devlink pointer are set at the same time and indicate the same thing - devlink/devlink_port are ready. Instead of checking ->registered use devlink pointer as an indication. ==================== Signed-off-by: David S. Miller commit d7907a2b1a3b89bea136025f885035a083525e41 Author: Leon Romanovsky Date: Wed Jul 28 10:33:47 2021 +0300 devlink: Remove duplicated registration check Both registered flag and devlink pointer are set at the same time and indicate the same thing - devlink/devlink_port are ready. Instead of checking ->registered use devlink pointer as an indication. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 35f6986743d78544779a892415c2edefa1f36a1c Author: Leon Romanovsky Date: Wed Jul 28 10:33:46 2021 +0300 net/mlx5: Don't rely on always true registered field Devlink is an integral part of mlx5 driver and all flows ensure that devlink_*_register() will success. That makes the ->registered check an obsolete. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit acf34954efd17d4f65c7bb3e614381e6afc33222 Author: Leon Romanovsky Date: Wed Jul 28 10:33:45 2021 +0300 net: ti: am65-cpsw-nuss: fix wrong devlink release order The commit that introduced devlink support released devlink resources in wrong order, that made an unwind flow to be asymmetrical. In addition, the am65-cpsw-nuss used internal to devlink core field - registered. In order to fix the unwind flow and remove such access to the registered field, rewrite the code to call devlink_port_unregister only on registered ports. Fixes: 58356eb31d60 ("net: ti: am65-cpsw-nuss: Add devlink support") Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit d2ac3a11cba23454516ba17f03e078a6831b8be5 Author: Randy Dunlap Date: Sun Jul 25 09:02:58 2021 -0700 mips: clean up kernel-doc in mm/c-octeon.c Clean up kernel-doc warnings in arch/mips/mm/c-octeon.c. arch/mips/mm/c-octeon.c:34: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Octeon automatically flushes the dcache on tlb changes, so arch/mips/mm/c-octeon.c:65: warning: expecting prototype for Flush caches as necessary for all cores affected by a(). Prototype was for octeon_flush_icache_all_cores() instead arch/mips/mm/c-octeon.c:99: warning: expecting prototype for Called to flush the icache on all cores(). Prototype was for octeon_flush_icache_all() instead arch/mips/mm/c-octeon.c:111: warning: expecting prototype for Called to flush all memory associated with a memory(). Prototype was for octeon_flush_cache_mm() instead arch/mips/mm/c-octeon.c:124: warning: Function parameter or member 'start' not described in 'octeon_flush_icache_range' arch/mips/mm/c-octeon.c:124: warning: Function parameter or member 'end' not described in 'octeon_flush_icache_range' arch/mips/mm/c-octeon.c:124: warning: expecting prototype for Flush a range of kernel addresses out of the icache(). Prototype was for octeon_flush_icache_range() instead arch/mips/mm/c-octeon.c:138: warning: expecting prototype for Flush a range out of a vma(). Prototype was for octeon_flush_cache_range() instead arch/mips/mm/c-octeon.c:153: warning: expecting prototype for Flush a specific page of a vma(). Prototype was for octeon_flush_cache_page() instead arch/mips/mm/c-octeon.c:164: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Probe Octeon's caches arch/mips/mm/c-octeon.c:264: warning: expecting prototype for Setup the Octeon cache flush routines(). Prototype was for octeon_cache_init() instead arch/mips/mm/c-octeon.c:349: warning: expecting prototype for Called when the the exception is not recoverable(). Prototype was for cache_parity_error_octeon_non_recoverable() instead Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 64c888ce33602c66f1a043c1f7943e3d453186c2 Author: Randy Dunlap Date: Sun Jul 25 09:02:57 2021 -0700 mips: clean up kernel-doc in cavium-octeon/*.c Convert function comments to kernel-doc notation to remove kernel-doc warnings in arch/mips/cavium-octeon/*.c. Also clean up the comments in a few places. arch/mips/cavium-octeon/flash_setup.c:66: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Module/ driver initialization. -- arch/mips/cavium-octeon/setup.c:308: warning: expecting prototype for Return non zero if we are currently running in the Octeon simulator(). Prototype was for octeon_is_simulation() instead arch/mips/cavium-octeon/setup.c:314: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return true if Octeon is in PCI Host mode. This means arch/mips/cavium-octeon/setup.c:334: warning: expecting prototype for Get the clock rate of Octeon(). Prototype was for octeon_get_clock_rate() instead arch/mips/cavium-octeon/setup.c:351: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Write to the LCD display connected to the bootbus. This display arch/mips/cavium-octeon/setup.c:380: warning: expecting prototype for Return the console uart passed by the bootloader(). Prototype was for octeon_get_boot_uart() instead arch/mips/cavium-octeon/setup.c:386: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Get the coremask Linux was booted on. arch/mips/cavium-octeon/setup.c:399: warning: expecting prototype for Check the hardware BIST results for a CPU(). Prototype was for octeon_check_cpu_bist() instead arch/mips/cavium-octeon/setup.c:432: warning: expecting prototype for Reboot Octeon(). Prototype was for octeon_restart() instead arch/mips/cavium-octeon/setup.c:452: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Permanently stop a core. arch/mips/cavium-octeon/setup.c:475: warning: expecting prototype for Halt the system(). Prototype was for octeon_halt() instead arch/mips/cavium-octeon/setup.c:520: warning: expecting prototype for Return a string representing the system type(). Prototype was for octeon_board_type_string() instead arch/mips/cavium-octeon/setup.c:661: warning: expecting prototype for Early entry point for arch setup(). Prototype was for prom_init() instead -- arch/mips/cavium-octeon/smp.c:100: warning: Function parameter or member 'cpu' not described in 'octeon_send_ipi_single' arch/mips/cavium-octeon/smp.c:100: warning: Function parameter or member 'action' not described in 'octeon_send_ipi_single' arch/mips/cavium-octeon/smp.c:100: warning: expecting prototype for Cause the function described by call_data to be executed on the passed(). Prototype was for octeon_send_ipi_single() instead arch/mips/cavium-octeon/smp.c:119: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Detect available CPUs, populate cpu_possible_mask arch/mips/cavium-octeon/smp.c:210: warning: Function parameter or member 'cpu' not described in 'octeon_boot_secondary' arch/mips/cavium-octeon/smp.c:210: warning: Function parameter or member 'idle' not described in 'octeon_boot_secondary' arch/mips/cavium-octeon/smp.c:210: warning: expecting prototype for Firmware CPU startup hook(). Prototype was for octeon_boot_secondary() instead arch/mips/cavium-octeon/smp.c:236: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * After we've done initial boot, this function is called to allow the arch/mips/cavium-octeon/smp.c:258: warning: Function parameter or member 'max_cpus' not described in 'octeon_prepare_cpus' arch/mips/cavium-octeon/smp.c:258: warning: expecting prototype for Callout to firmware before smp_init(). Prototype was for octeon_prepare_cpus() instead arch/mips/cavium-octeon/smp.c:276: warning: expecting prototype for Last chance for the board code to finish SMP initialization before(). Prototype was for octeon_smp_finish() instead Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 16df55ce104125b4bf1070467973070fb6fc16ff Author: Randy Dunlap Date: Sun Jul 25 09:02:56 2021 -0700 mips: clean up (remove) kernel-doc in cavium-octeon/executive/ Remove all kernel-doc notation in arch/mips/cavium-octeon/executive/. This removes dozens of kernel-doc warnings. Most of these functions are static and don't need to be documented with kernel-doc. The function comments are still present for anyone who wants to read them. These files are part of the OCTEON SDK so presumably they are documented there as well. arch/mips/cavium-octeon/executive/cvmx-bootmem.c:61: warning: Function parameter or member 'addr' not described in 'CVMX_BOOTMEM_NAMED_GET_FIELD' arch/mips/cavium-octeon/executive/cvmx-bootmem.c:61: warning: Function parameter or member 'field' not described in 'CVMX_BOOTMEM_NAMED_GET_FIELD' arch/mips/cavium-octeon/executive/cvmx-bootmem.c:61: warning: expecting prototype for This macro returns a member of the(). Prototype was for CVMX_BOOTMEM_NAMED_GET_FIELD() instead arch/mips/cavium-octeon/executive/cvmx-bootmem.c:77: warning: Function parameter or member 'base' not described in '__cvmx_bootmem_desc_get' arch/mips/cavium-octeon/executive/cvmx-bootmem.c:77: warning: Function parameter or member 'offset' not described in '__cvmx_bootmem_desc_get' arch/mips/cavium-octeon/executive/cvmx-bootmem.c:77: warning: Function parameter or member 'size' not described in '__cvmx_bootmem_desc_get' arch/mips/cavium-octeon/executive/cvmx-bootmem.c:77: warning: expecting prototype for This function is the implementation of the get macros defined(). Prototype was for __cvmx_bootmem_desc_get() instead arch/mips/cavium-octeon/executive/cvmx-bootmem.c:133: warning: expecting prototype for Allocate a block of memory from the free list that was(). Prototype was for cvmx_bootmem_alloc_range() instead arch/mips/cavium-octeon/executive/cvmx-bootmem.c:554: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Finds a named memory block by name. arch/mips/cavium-octeon/executive/cvmx-bootmem.c:661: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Frees a named block. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-helper-board.c:64: warning: expecting prototype for Return the MII PHY address associated with the given IPD(). Prototype was for cvmx_helper_board_get_mii_address() instead arch/mips/cavium-octeon/executive/cvmx-helper-board.c:211: warning: expecting prototype for This function is the board specific method of determining an(). Prototype was for __cvmx_helper_board_link_get() instead arch/mips/cavium-octeon/executive/cvmx-helper-board.c:278: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * This function is called by cvmx_helper_interface_probe() after it arch/mips/cavium-octeon/executive/cvmx-helper-board.c:324: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Get the clock type used for the USB block based on board type. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-spi.c:77: warning: expecting prototype for Get current SPI4 initialization callbacks(). Prototype was for cvmx_spi_get_callbacks() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:87: warning: expecting prototype for Set new SPI4 initialization callbacks(). Prototype was for cvmx_spi_set_callbacks() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:92: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Initialize and start the SPI interface. arch/mips/cavium-octeon/executive/cvmx-spi.c:151: warning: expecting prototype for This routine restarts the SPI interface after it has lost synchronization(). Prototype was for cvmx_spi_restart_interface() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:196: warning: expecting prototype for Callback to perform SPI4 reset(). Prototype was for cvmx_spi_reset_cb() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:313: warning: expecting prototype for Callback to setup calendar and miscellaneous settings before clock detection(). Prototype was for cvmx_spi_calendar_setup_cb() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:431: warning: expecting prototype for Callback to perform clock detection(). Prototype was for cvmx_spi_clock_detect_cb() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:509: warning: expecting prototype for Callback to perform link training(). Prototype was for cvmx_spi_training_cb() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:578: warning: expecting prototype for Callback to perform calendar data synchronization(). Prototype was for cvmx_spi_calendar_sync_cb() instead arch/mips/cavium-octeon/executive/cvmx-spi.c:634: warning: expecting prototype for Callback to handle interface up(). Prototype was for cvmx_spi_interface_up_cb() instead ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c:67: warning: expecting prototype for Probe a XAUI interface and determine the number of ports(). Prototype was for __cvmx_helper_xaui_probe() instead arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c:106: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Bringup and enable a XAUI interface. After this call packet arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c:253: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return the link state of an IPD/PKO port as returned by arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c:292: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Configure an IPD/PKO port for the specified link state. This ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-pko.c:43: warning: Function parameter or member 'interface' not described in '__cvmx_pko_int' arch/mips/cavium-octeon/executive/cvmx-pko.c:43: warning: Function parameter or member 'index' not described in '__cvmx_pko_int' arch/mips/cavium-octeon/executive/cvmx-pko.c:43: warning: expecting prototype for Internal state of packet output(). Prototype was for __cvmx_pko_int() instead arch/mips/cavium-octeon/executive/cvmx-pko.c:186: warning: expecting prototype for Call before any other calls to initialize the packet(). Prototype was for cvmx_pko_initialize_global() instead arch/mips/cavium-octeon/executive/cvmx-pko.c:241: warning: expecting prototype for This function does per(). Prototype was for cvmx_pko_initialize_local() instead arch/mips/cavium-octeon/executive/cvmx-pko.c:247: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enables the packet output hardware. It must already be arch/mips/cavium-octeon/executive/cvmx-pko.c:270: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Disables the packet output. Does not affect any configuration. arch/mips/cavium-octeon/executive/cvmx-pko.c:282: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Reset the packet output. arch/mips/cavium-octeon/executive/cvmx-pko.c:293: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Shutdown and free resources required by packet output. arch/mips/cavium-octeon/executive/cvmx-pko.c:324: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Configure a output port and the associated queues for use. arch/mips/cavium-octeon/executive/cvmx-pko.c:555: warning: expecting prototype for Show map of ports(). Prototype was for cvmx_pko_show_queue_map() instead arch/mips/cavium-octeon/executive/cvmx-pko.c:577: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Rate limit a PKO port to a max packets/sec. This function is only arch/mips/cavium-octeon/executive/cvmx-pko.c:610: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Rate limit a PKO port to a max bits/sec. This function is only ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:49: warning: cannot understand function prototype: '__cvmx_cmd_queue_all_state_t *__cvmx_cmd_queue_state_ptr; ' arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:53: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Initialize the Global queue state pointer. arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:101: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Initialize a command queue for use. The initial FPA buffer is arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:199: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Shutdown a queue a free it's command buffers to the FPA. The arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:235: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return the number of command words pending in the queue. This arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c:291: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return the command buffer to be written to. The purpose of this ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:53: warning: expecting prototype for Probe RGMII ports and determine the number present(). Prototype was for __cvmx_helper_rgmii_probe() instead arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:92: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Put an RGMII interface in loopback mode. Internal packets sent arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:135: warning: expecting prototype for Workaround ASX setup errata with CN38XX pass1(). Prototype was for __cvmx_helper_errata_asx_pass1() instead arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:152: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Configure all of the ASX, GMX, and PKO registers required arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:255: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return the link state of an IPD/PKO port as returned by arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c:284: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Configure an IPD/PKO port for the specified link state. This -- arch/mips/cavium-octeon/executive/cvmx-l2c.c:768: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Return log base 2 of the number of sets in the L2 cache arch/mips/cavium-octeon/executive/cvmx-l2c.c:861: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Flush a line from the L2 cache Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 059e969c2a7d9efb463c0d8c574f1b3f1e010bed Author: Zhang Qilong Date: Mon Jun 7 14:46:40 2021 +0800 dmaengine: tegra210-adma: Using pm_runtime_resume_and_get to replace open coding use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. this change is just to simplify the code, there is no actual functional change. Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20210607064640.121394-4-zhangqilong3@huawei.com Signed-off-by: Vinod Koul commit 48ae638be56b43cde9ddca20fc5678401886f5db Author: Salah Triki Date: Sat Jul 10 17:54:32 2021 +0100 ppc4xx: replace sscanf() by kstrtoul() Fix the checkpatch.pl warning: "Prefer kstrto to single variable sscanf". Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210710165432.GA690401@pc Signed-off-by: Vinod Koul commit 2b5b74054c214ed2192713b88799fbc4cda8a1fe Author: Amelie Delaunay Date: Thu Jun 24 11:39:59 2021 +0200 dmaengine: stm32-dma: add alternate REQ/ACK protocol management STM32 USART/UART is not managing correctly the default DMA REQ/ACK protocol leading to possibly lock the DMA stream. Default protocol consists in maintaining ACK signal up to the removal of REQuest and the transfer completion. In case of alternative REQ/ACK protocol, ACK de-assertion does not wait the removal of the REQuest, but only the transfer completion. This patch retrieves the need of the alternative protocol through the device tree, and sets the protocol accordingly. It also unwrap STM32_DMA_DIRECT_MODE_GET macro definition for consistency with new STM32_DMA_ALT_ACK_MODE_GET macro definition. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20210624093959.142265-3-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit ef94b0413bf4e0d328989fecf5b773e82c8794ac Author: Amelie Delaunay Date: Thu Jun 24 11:39:58 2021 +0200 dt-bindings: dma: add alternative REQ/ACK protocol selection in stm32-dma Default REQ/ACK protocol consists in maintaining ACK signal up to the removal of REQuest and the transfer completion. In case of alternative REQ/ACK protocol, ACK de-assertion does not wait the removal of the REQuest, but only the transfer completion. Due to a possible DMA stream lock when transferring data to/from STM32 USART/UART, this new bindings allow to select this alternative protocol in device tree, especially for STM32 USART/UART nodes. Signed-off-by: Amelie Delaunay Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210624093959.142265-2-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit af2eec750281e581a16b6449b83ce5e994b79d89 Author: Olivier Dautricourt Date: Thu Jun 17 21:53:18 2021 +0200 dmaengine: altera-msgdma: make response port optional The response slave port can be disabled in some configuration [1] and csr + MSGDMA_CSR_RESP_FILL_LEVEL will be 0 even if transfer has suceeded. We have to only rely on the interrupts in that scenario. This was tested on cyclone V with the controller resp port disabled. [1] https://www.intel.com/content/www/us/en/programmable/documentation/sfo1400787952932.html 30.3.1.2 30.3.1.3 30.5.5 Fixes: https://forum.rocketboards.org/t/ip-msgdma-linux-driver/1919 Signed-off-by: Olivier Dautricourt Reviewed-by: Stefan Roese Link: https://lore.kernel.org/r/8220756f2191ca08cb21702252d1f2d4f753a7f5.1623898678.git.olivier.dautricourt@orolia.com Signed-off-by: Vinod Koul commit 4aece33cacf726d34ecd8824aee369652ec2beec Author: Olivier Dautricourt Date: Thu Jun 17 21:52:32 2021 +0200 dt-bindings: dma: altera-msgdma: make response port optional Response port is not required in some configuration of the IP core. Signed-off-by: Olivier Dautricourt Reviewed-by: Rob Herring Reviewed-by: Stefan Roese Link: https://lore.kernel.org/r/fb28146a23a182be9e5435c1d3e5cac36b372294.1623898678.git.olivier.dautricourt@orolia.com Signed-off-by: Vinod Koul commit 26f1ca91d242a506bc4461c5b8f33f457d2608ba Author: Christophe JAILLET Date: Wed Jun 16 22:34:38 2021 +0200 dmaengine: hisi_dma: Remove some useless code When using 'pcim_enable_device()', 'pci_alloc_irq_vectors()' is auto-magically a managed function. It is useless (but harmless) to record an action to explicitly call 'pci_free_irq_vectors()'. So keep things simple, comment why and how these resources are freed, axe some useless code and save some memory. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/4f8932e2d0d8d092bf60272511100030e013bc72.1623875508.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 48594dbf793a15ee1a63ed879691cf436c14f459 Author: Baokun Li Date: Wed Jun 9 15:13:49 2021 +0800 dmaengine: zynqmp_dma: Use list_move_tail instead of list_del/list_add_tail Using list_move_tail() instead of list_del() + list_add_tail(). Reported-by: Hulk Robot Signed-off-by: Baokun Li Link: https://lore.kernel.org/r/20210609071349.1336853-1-libaokun1@huawei.com Signed-off-by: Vinod Koul commit df208d63cfc5128529059d28565bd8754da2dbd5 Author: Baokun Li Date: Wed Jun 9 15:28:02 2021 +0800 dmaengine: fsl-dpaa2-qdma: Use list_move_tail instead of list_del/list_add_tail Using list_move_tail() instead of list_del() + list_add_tail(). Reported-by: Hulk Robot Signed-off-by: Baokun Li Link: https://lore.kernel.org/r/20210609072802.1368785-1-libaokun1@huawei.com Signed-off-by: Vinod Koul commit 75ba9a715cb65e9c3fb17f13929d8741e570795f Author: Baokun Li Date: Tue Jun 8 11:09:05 2021 +0800 dmaengine: xilinx_dma: Use list_move_tail instead of list_del/list_add_tail Using list_move_tail() instead of list_del() + list_add_tail(). Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/20210608030905.2818831-1-libaokun1@huawei.com Signed-off-by: Vinod Koul commit ba3b049f477436b7e4bb19c293c78c9068582d54 Author: Matt Roper Date: Tue Jul 27 07:50:56 2021 -0700 drm/i915/adl_p: Allow underrun recovery when possible ADL_P requires that we disable underrun recovery when downscaling (or using the scaler for YUV420 pipe output), using DSC, or using PSR2. Otherwise we should be able to enable the underrun recovery. On DG2 we need to keep underrun recovery disabled at all times, but the chicken bit in PIPE_CHICKEN has an inverted meaning (it's an enable bit instead of disable). v2: - Reverse the condition (clear the disable bit when supported, set disable bit when not supported). Bspec: 50351 Signed-off-by: Matt Roper Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20210727145056.2049720-1-matthew.d.roper@intel.com commit 3ad4a31620355358316fa08fcfab37b9d6c33347 Author: Andy Shevchenko Date: Tue Jul 27 15:51:30 2021 +0300 ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Last change to device managed APIs cleaned up error path to simple phy_exit() call, which in some cases has been executed with NULL parameter. This per se is not a problem, but rather logical misconception: no need to free resource when it's for sure has not been allocated yet. Fix the driver accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210727125130.19977-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit db2d7420f8d381c31fc411c818e4d3ff52e538ed Author: Joel Stanley Date: Tue Jul 27 13:16:39 2021 +0930 ARM: dts: aspeed: ast2500evb: Enable built in RTC Enable this device so the RTC driver can be tested on the EVB. Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20210727034639.474458-1-joel@jms.id.au commit dc2de6ed7ee7ade2d7fc3768e3b05e51d79ff029 Author: Joel Stanley Date: Tue Jul 27 13:03:19 2021 +0930 ARM: dts: aspeed: tacoma: Add TPM reset GPIO The GPIO is used to place the BMC-connected TPM in reset. The net is called BMC_TPM_RST_N on Tacoma. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210727033319.473152-3-joel@jms.id.au commit a3034e895aba4b9ef181ea78397834871a716ec1 Author: Joel Stanley Date: Tue Jul 27 13:03:18 2021 +0930 ARM: dts: rainier, everest: Add TPM reset GPIO The GPIO is used to place the BMC-connected TPM in reset. This state is latched until the BMC is next reset, blocking access to the TPM for that boot. On both machines this net is called TPM_RESET_LATCH_B. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210727033319.473152-2-joel@jms.id.au commit 79341eb74c1fd193fe17b015c856e713e82650a2 Author: Rob Clark Date: Tue Jul 27 18:06:13 2021 -0700 drm/msm: Return ERR_PTR() from submit_create() In the next patch, we start having more than a single potential failure reason. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-9-robdclark@gmail.com Signed-off-by: Rob Clark commit a61acbbe9cf873f869fc634ae6f72f214f5994cc Author: Rob Clark Date: Tue Jul 27 18:06:12 2021 -0700 drm/msm: Track "seqno" fences by idr Previously the (non-fd) fence returned from submit ioctl was a raw seqno, which is scoped to the ring. But from UABI standpoint, the ioctls related to seqno fences all specify a submitqueue. We can take advantage of that to replace the seqno fences with a cyclic idr handle. This is in preperation for moving to drm scheduler, at which point the submit ioctl will return after queuing the submit job to the scheduler, but before the submit is written into the ring (and therefore before a ring seqno has been assigned). Which means we need to replace the dma_fence that userspace may need to wait on with a scheduler fence. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-8-robdclark@gmail.com Signed-off-by: Rob Clark commit be40596bb5cf20cf9eaeddeeb57de7c4f570c886 Author: Rob Clark Date: Tue Jul 27 18:06:11 2021 -0700 drm/msm: Consolidate submit bo state Move all the locked/active/pinned state handling to msm_gem_submit.c. In particular, for drm/scheduler, we'll need to do all this before pushing the submit job to the scheduler. But while we're at it we can get rid of the dupicate pin and refcnt. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-7-robdclark@gmail.com Signed-off-by: Rob Clark commit 7039d3f89b2f3f934b02d34225642113f9185a3c Author: Rob Clark Date: Tue Jul 27 18:06:10 2021 -0700 drm/msm/submit: Simplify out-fence-fd handling No need for this to be split in two parts. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-6-robdclark@gmail.com Signed-off-by: Rob Clark commit 390ad4212197558edfba62557c76b560871dcbc3 Author: Rob Clark Date: Tue Jul 27 18:06:09 2021 -0700 drm: Drop drm_gem_object_put_locked() Now that no one is using it, remove it. Signed-off-by: Rob Clark Acked-by: Christian König Reviewed-by: Daniel Vetter Link: https://lore.kernel.org/r/20210728010632.2633470-5-robdclark@gmail.com Signed-off-by: Rob Clark commit 030af2b05aee292ae72e57c2d7ca1c8efd6e89a3 Author: Rob Clark Date: Tue Jul 27 18:06:08 2021 -0700 drm/msm: drop drm_gem_object_put_locked() No idea why we were still using this. It certainly hasn't been needed for some time. So drop the pointless twin codepaths. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-4-robdclark@gmail.com Signed-off-by: Rob Clark commit 86c2a0f000c1059dc45ddbb6fb469ef188e7f598 Author: Rob Clark Date: Tue Jul 27 18:06:07 2021 -0700 drm/msm: Small submitqueue creation cleanup If we don't have a gpu, there is no need to create a submitqueue, which lets us simplify the error handling and submitqueue creation. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 375f9a63a66baeb63ecc7d5fc740b9f02891ceda Author: Rob Clark Date: Tue Jul 27 18:06:06 2021 -0700 drm/msm: Docs and misc cleanup Fix a couple incorrect or misspelt comments, and add submitqueue doc comment. Signed-off-by: Rob Clark Acked-by: Christian König Link: https://lore.kernel.org/r/20210728010632.2633470-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 9bc95570175a7fbca29d86d22c54bbf399f4ad5a Author: Rob Clark Date: Mon Jul 26 07:46:50 2021 -0700 drm/msm: Devfreq tuning This adds a few things to try and make frequency scaling better match the workload: 1) Longer polling interval to avoid whip-lashing between too-high and too-low frequencies in certain workloads, like mobile games which throttle themselves to 30fps. Previously our polling interval was short enough to let things ramp down to minimum freq in the "off" frame, but long enough to not react quickly enough when rendering started on the next frame, leading to uneven frame times. (Ie. rather than a consistent 33ms it would alternate between 16/33/48ms.) 2) Awareness of when the GPU is active vs idle. Since we know when the GPU is active vs idle, we can clamp the frequency down to the minimum while it is idle. (If it is idle for long enough, then the autosuspend delay will eventually kick in and power down the GPU.) Since devfreq has no knowledge of powered-but-idle, this takes a small bit of trickery to maintain a "fake" frequency while idle. This, combined with the longer polling period allows devfreq to arrive at a reasonable "active" frequency, while still clamping to minimum freq when idle to reduce power draw. 3) Boost. Because simple_ondemand needs to see a certain threshold of busyness to ramp up, we could end up needing multiple polling cycles before it reacts appropriately on interactive workloads (ex. scrolling a web page after reading for some time), on top of the already lengthened polling interval, when we see a idle to active transition after a period of idle time we boost the frequency that we return to. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210726144653.2180096-4-robdclark@gmail.com Signed-off-by: Rob Clark commit 552fce98b06f702b041432ad650db3e50c380ce3 Author: Rob Clark Date: Mon Jul 26 07:46:49 2021 -0700 drm/msm: Split out get_freq() helper In the next patch, it grows a bit more, so lets not duplicate the logic in multiple places. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210726144653.2180096-3-robdclark@gmail.com Signed-off-by: Rob Clark commit af5b4fff0fe80c8a43fa218e10c55ab8d2ff4dcb Author: Rob Clark Date: Mon Jul 26 07:46:48 2021 -0700 drm/msm: Split out devfreq handling Before we start adding more cleverness, split it into it's own file. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210726144653.2180096-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 298287f6e79a8a695d9e3a8a0b040f13d0805c77 Author: Rob Clark Date: Mon Jul 26 07:43:58 2021 -0700 drm/msm: Signal fences sooner Nothing we do to in update_fences() can't be done in an atomic context, so move this into the GPU's irq context to reduce latency (and call dma_fence_signal() so we aren't relying on dma_fence_is_signaled() which would defeat the purpose). Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210726144359.2179302-3-robdclark@gmail.com Signed-off-by: Rob Clark commit da3d378dec86348d21c02f311da87fa0742e36f6 Author: Rob Clark Date: Mon Jul 26 07:43:57 2021 -0700 drm/msm: Let fences read directly from memptrs Let dma_fence::signaled, etc, read directly from the address that the hw is writing with updated completed fence seqno, so we can potentially notice that the fence is signaled sooner. Plus add some docs. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210726144359.2179302-2-robdclark@gmail.com Signed-off-by: Rob Clark commit e754dccbc908701bf412378c56824409468152a4 Author: Daniele Ceraolo Spurio Date: Mon Jul 26 17:23:48 2021 -0700 drm/i915/guc: Unblock GuC submission on Gen11+ Unblock GuC submission on Gen11+ platforms. v2: (Martin Peres / John H) - Delete debug message when GuC is disabled by default on certain platforms Signed-off-by: Michal Wajdeczko Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-34-matthew.brost@intel.com commit ee242ca704d386991d7ece0c46134e211d52412b Author: Matthew Brost Date: Mon Jul 26 17:23:47 2021 -0700 drm/i915/guc: Implement GuC priority management Implement a simple static mapping algorithm of the i915 priority levels (int, -1k to 1k exposed to user) to the 4 GuC levels. Mapping is as follows: i915 level < 0 -> GuC low level (3) i915 level == 0 -> GuC normal level (2) i915 level < INT_MAX -> GuC high level (1) i915 level == INT_MAX -> GuC highest level (0) We believe this mapping should cover the UMD use cases (3 distinct user levels + 1 kernel level). In addition to static mapping, a simple counter system is attached to each context tracking the number of requests inflight on the context at each level. This is needed as the GuC levels are per context while in the i915 levels are per request. v2: (Daniele) - Add BUILD_BUG_ON to enforce ordering of priority levels - Add missing lockdep to guc_prio_fini - Check for return before setting context registered flag - Map DISPLAY priority or higher to highest guc prio - Update comment for guc_prio Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-33-matthew.brost@intel.com commit 3a7b72665ea5dcfa24efe857dbb88fe135ae21a6 Author: John Harrison Date: Mon Jul 26 17:23:46 2021 -0700 drm/i915/selftest: Bump selftest timeouts for hangcheck Some testing environments and some heavier tests are slower than previous limits allowed for. For example, it can take multiple seconds for the 'context has been reset' notification handler to reach the 'kill the requests' code in the 'active' version of the 'reset engines' test. During which time the selftest gets bored, gives up waiting and fails the test. There is also an async thread that the selftest uses to pump work through the hardware in parallel to the context that is marked for reset. That also could get bored waiting for completions and kill the test off. Lastly, the flush at the of various test sections can also see timeouts due to the large amount of work backed up. This is also true of the live_hwsp_read test. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-32-matthew.brost@intel.com commit 617e87c05c72a88006b0604ce60cc4b105450016 Author: John Harrison Date: Mon Jul 26 17:23:45 2021 -0700 drm/i915/selftest: Fix hangcheck self test for GuC submission When GuC submission is enabled, the GuC controls engine resets. Rather than explicitly triggering a reset, the driver must submit a hanging context to GuC and wait for the reset to occur. Conversely, one of the tests specifically sends hanging batches to the engines but wants them to sit around until a manual reset of the full GT (including GuC itself). That means disabling GuC based engine resets to prevent those from killing the hanging batch too soon. So, add support to the scheduling policy helper for disabling resets as well as making them quicker! In GuC submission mode, the 'is engine idle' test basically turns into 'is engine PM wakelock held'. Independently, there is a heartbeat disable helper function that the tests use. For unexplained reasons, this acquires the engine wakelock before disabling the heartbeat and only releases it when re-enabling the heartbeat. As one of the tests tries to do a wait for idle in the middle of a heartbeat disabled section, it is therefore guaranteed to always fail. Added a 'no_pm' variant of the heartbeat helper that allows the engine to be asleep while also having heartbeats disabled. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-31-matthew.brost@intel.com commit 716c61c87556234570827b1d287f20691271a0b6 Author: Matthew Brost Date: Mon Jul 26 17:23:44 2021 -0700 drm/i915/selftest: Increase some timeouts in live_requests Requests may take slightly longer with GuC submission, let's increase the timeouts in live_requests. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-30-matthew.brost@intel.com commit 064a1f35bf1956130c84a4280a7ac75136fa2789 Author: Rahul Kumar Singh Date: Mon Jul 26 17:23:43 2021 -0700 drm/i915/selftest: Fix MOCS selftest for GuC submission When GuC submission is enabled, the GuC controls engine resets. Rather than explicitly triggering a reset, the driver must submit a hanging context to GuC and wait for the reset to occur. Signed-off-by: Rahul Kumar Singh Signed-off-by: John Harrison Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-29-matthew.brost@intel.com commit 3a4bfa091c46e90f7d68d219c36a86471b170cb8 Author: Rahul Kumar Singh Date: Mon Jul 26 17:23:42 2021 -0700 drm/i915/selftest: Fix workarounds selftest for GuC submission When GuC submission is enabled, the GuC controls engine resets. Rather than explicitly triggering a reset, the driver must submit a hanging context to GuC and wait for the reset to occur. Signed-off-by: Rahul Kumar Singh Signed-off-by: John Harrison Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-28-matthew.brost@intel.com commit 3f5dff6c18aa0473158686f363184a1bdae0116b Author: John Harrison Date: Mon Jul 26 17:23:41 2021 -0700 drm/i915/selftest: Better error reporting from hangcheck selftest There are many ways in which the hangcheck selftest can fail. Very few of them actually printed an error message to say what happened. So, fill in the missing messages. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-27-matthew.brost@intel.com commit 62eaf0ae217d45e917fd9ca6296205117a69b6d0 Author: Matthew Brost Date: Mon Jul 26 17:23:40 2021 -0700 drm/i915/guc: Support request cancellation This adds GuC backend support for i915_request_cancel(), which in turn makes CONFIG_DRM_I915_REQUEST_TIMEOUT work. This implementation makes use of fence while there are likely simplier options. A fence was chosen because of another feature coming soon which requires a user to block on a context until scheduling is disabled. In that case we return the fence to the user and the user can wait on that fence. v2: (Daniele) - A comment about locking the blocked incr / decr - A comments about the use of the fence - Update commit message explaining why fence - Delete redundant check blocked count in unblock function - Ring buffer implementation - Comment about blocked in submission path - Shorter rpm path v3: (Checkpatch) - Fix typos in commit message (Daniel) - Rework to simplier locking structure in guc_context_block / unblock Signed-off-by: Matthew Brost Cc: Tvrtko Ursulin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-26-matthew.brost@intel.com commit ae8ac10dfd2aa9e20cb5baea3c036d8535649113 Author: Matthew Brost Date: Mon Jul 26 17:23:39 2021 -0700 drm/i915/guc: Implement banned contexts for GuC submission When using GuC submission, if a context gets banned disable scheduling and mark all inflight requests as complete. Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-25-matthew.brost@intel.com commit 481d458caede241607e8463b9920ff9e29cece38 Author: John Harrison Date: Mon Jul 26 17:23:38 2021 -0700 drm/i915/guc: Add golden context to GuC ADS The media watchdog mechanism involves GuC doing a silent reset and continue of the hung context. This requires the i915 driver provide a golden context to GuC in the ADS. v2: (Matthew Brost): - Fix memory corruption in shmem_read (John H) - Use locals rather than defines for LR_* + SKIP_SIZE Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-24-matthew.brost@intel.com commit 731c2ad5e1f812ef91113f1c118a0c7252f17ef6 Author: John Harrison Date: Mon Jul 26 17:23:37 2021 -0700 drm/i915/guc: Include scheduling policies in the debugfs state dump Added the scheduling policy parameters to the 'guc_info' debugfs state dump. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-23-matthew.brost@intel.com commit cb6cc815868ca27e14eef17eedd27e5f7dd99620 Author: John Harrison Date: Mon Jul 26 17:23:36 2021 -0700 drm/i915/guc: Connect reset modparam updates to GuC policy flags Changing the reset module parameter has no effect on a running GuC. The corresponding entry in the ADS must be updated and then the GuC informed via a Host2GuC message. The new debugfs interface to module parameters allows this to happen. However, connecting the parameter data address back to anything useful is messy. One option would be to pass a new private data structure address through instead of just the parameter pointer. However, that means having a new (and different) data structure for each parameter and a new (and different) write function for each parameter. This method keeps everything generic by instead using a string lookup on the directory entry name. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-22-matthew.brost@intel.com commit 7935785240508c738002accfdac07c398dd77abf Author: John Harrison Date: Mon Jul 26 17:23:35 2021 -0700 drm/i915/guc: Hook GuC scheduling policies up Use the official driver default scheduling policies for configuring the GuC scheduler rather than a bunch of hardcoded values. v2: (Matthew Brost) - Move I915_ENGINE_WANT_FORCED_PREEMPTION to later patch Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Cc: Jose Souza Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-21-matthew.brost@intel.com commit dc0dad365c5ed8bd7e2e506e84d2099624247ca4 Author: John Harrison Date: Mon Jul 26 17:23:34 2021 -0700 drm/i915/guc: Fix for error capture after full GPU reset with GuC In the case of a full GPU reset (e.g. because GuC has died or because GuC's hang detection has been disabled), the driver can't rely on GuC reporting the guilty context. Instead, the driver needs to scan all active contexts and find one that is currently executing, as per the execlist mode behaviour. In GuC mode, this scan is different to execlist mode as the active request list is handled very differently. Similarly, the request state dump in debugfs needs to be handled differently when in GuC submission mode. Also refactured some of the request scanning code to avoid duplication across the multiple code paths that are now replicating it. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-20-matthew.brost@intel.com commit 573ba126aef37c8315e5bb68d2dad515efa96994 Author: Matthew Brost Date: Mon Jul 26 17:23:33 2021 -0700 drm/i915/guc: Capture error state on context reset We receive notification of an engine reset from GuC at its completion. Meaning GuC has potentially cleared any HW state we may have been interested in capturing. GuC resumes scheduling on the engine post-reset, as the resets are meant to be transparent, further muddling our error state. There is ongoing work to define an API for a GuC debug state dump. The suggestion for now is to manually disable FW initiated resets in cases where debug state is needed. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-19-matthew.brost@intel.com commit c17b637928f030caac2d1c737959b9627011ac49 Author: John Harrison Date: Mon Jul 26 17:23:32 2021 -0700 drm/i915/guc: Enable GuC engine reset Clear the 'disable resets' flag to allow GuC to reset hung contexts (detected via pre-emption timeout). Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-18-matthew.brost@intel.com commit d75dc57fee98294944f14069fd686b451754627d Author: John Harrison Date: Mon Jul 26 17:23:31 2021 -0700 drm/i915/guc: Don't complain about reset races It is impossible to seal all race conditions of resets occurring concurrent to other operations. At least, not without introducing excesive mutex locking. Instead, don't complain if it occurs. In particular, don't complain if trying to send a H2G during a reset. Whatever the H2G was about should get redone once the reset is over. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-17-matthew.brost@intel.com commit 6de12da166783285c911c177d29e5db7dbafbb98 Author: John Harrison Date: Mon Jul 26 17:23:30 2021 -0700 drm/i915/guc: Provide mmio list to be saved/restored on engine reset The driver must provide GuC with a list of mmio registers that should be saved/restored during a GuC-based engine reset. Unfortunately, the list must be dynamically allocated as its size is variable. That means the driver must generate the list twice - once to work out the size and a second time to actually save it. v2: (Alan / CI) - GEN7_GT_MODE -> GEN6_GT_MODE to fix WA selftest failure Signed-off-by: John Harrison Signed-off-by: Fernando Pacheco Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-16-matthew.brost@intel.com commit 933864af118166655ec5d1075f2bee0bb3bea95c Author: Matthew Brost Date: Mon Jul 26 17:23:29 2021 -0700 drm/i915/guc: Enable the timer expired interrupt for GuC The GuC can implement execution qunatums, detect hung contexts and other such things but it requires the timer expired interrupt to do so. Signed-off-by: Matthew Brost CC: John Harrison Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-15-matthew.brost@intel.com commit f7957e603cbc12e18b5f616e5f0d18e8ba994a1d Author: Matthew Brost Date: Mon Jul 26 17:23:28 2021 -0700 drm/i915/guc: Handle engine reset failure notification GuC will notify the driver, via G2H, if it fails to reset an engine. We recover by resorting to a full GPU reset. v2: (John Harrison): - s/drm_dbg/drm_err Signed-off-by: Matthew Brost Signed-off-by: Fernando Pacheco Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-14-matthew.brost@intel.com commit 1e0fd2b5da1ed5f71985676dc55145dd58367d93 Author: Matthew Brost Date: Mon Jul 26 17:23:27 2021 -0700 drm/i915/guc: Handle context reset notification GuC will issue a reset on detecting an engine hang and will notify the driver via a G2H message. The driver will service the notification by resetting the guilty context to a simple state or banning it completely. v2: (John Harrison) - Move msg[0] lookup after length check v3: (John Harrison) - s/drm_dbg/drm_err Cc: Matthew Brost Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-13-matthew.brost@intel.com commit cad46a332f3d0f0ffeb9f9069499fb19a2ab43f4 Author: Matthew Brost Date: Mon Jul 26 17:23:26 2021 -0700 drm/i915/guc: Suspend/resume implementation for new interface The new GuC interface introduces an MMIO H2G command, INTEL_GUC_ACTION_RESET_CLIENT, which is used to implement suspend. This MMIO tears down any active contexts generating a context reset G2H CTB for each. Once that step completes the GuC tears down the CTB channels. It is safe to suspend once this MMIO H2G command completes and all G2H CTBs have been processed. In practice the i915 will likely never receive a G2H as suspend should only be called after the GPU is idle. Resume is implemented in the same manner as before - simply reload the GuC firmware and reinitialize everything (e.g. CTB channels, contexts, etc..). v2: (Michel / John H) - INTEL_GUC_ACTION_RESET_CLIENT 0x5B01 -> 0x5507 Cc: John Harrison Signed-off-by: Matthew Brost Signed-off-by: Michal Wajdeczko Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-12-matthew.brost@intel.com commit e5a1ad035938e60448cc0cd334359885c4fd3054 Author: Matthew Brost Date: Mon Jul 26 17:23:25 2021 -0700 drm/i915/guc: Add disable interrupts to guc sanitize Add disable GuC interrupts to intel_guc_sanitize(). Part of this requires moving the guc_*_interrupt wrapper function into header file intel_guc.h. Signed-off-by: Matthew Brost Cc: Daniele Ceraolo Spurio Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-11-matthew.brost@intel.com commit c41ee2873eb37ffff1b4185262b8efefc0c0d6e3 Author: Matthew Brost Date: Mon Jul 26 17:23:24 2021 -0700 drm/i915: Reset GPU immediately if submission is disabled If submission is disabled by the backend for any reason, reset the GPU immediately in the heartbeat code as the backend can't be reenabled until the GPU is reset. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-10-matthew.brost@intel.com commit eb5e7da736f36f558b9f8992f5e691a5b3b46b84 Author: Matthew Brost Date: Mon Jul 26 17:23:23 2021 -0700 drm/i915/guc: Reset implementation for new GuC interface Reset implementation for new GuC interface. This is the legacy reset implementation which is called when the i915 owns the engine hang check. Future patches will offload the engine hang check to GuC but we will continue to maintain this legacy path as a fallback and this code path is also required if the GuC dies. With the new GuC interface it is not possible to reset individual engines - it is only possible to reset the GPU entirely. This patch forces an entire chip reset if any engine hangs. v2: (Michal) - Check for -EPIPE rather than -EIO (CT deadlock/corrupt check) v3: (John H) - Split into a series of smaller patches v4: (John H) - Fix typo - Add braces around if statements in reset code v5: (Checkpatch) - Fix warnings Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-9-matthew.brost@intel.com commit d1cee2d37a62888b0fa4babe19bbb06bca976c9f Author: Matthew Brost Date: Mon Jul 26 17:23:22 2021 -0700 drm/i915: Move active request tracking to a vfunc Move active request tracking to a backend vfunc rather than assuming all backends want to do this in the manner. In the of case execlists / ring submission the tracking is on the physical engine while with GuC submission it is on the context. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-8-matthew.brost@intel.com commit 27466222ab8ab60f844869508954222bf05e5a67 Author: Matthew Brost Date: Mon Jul 26 17:23:21 2021 -0700 drm/i915: Add i915_sched_engine destroy vfunc This is required to allow backend specific cleanup v2: (John H) - Rework commit message Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-7-matthew.brost@intel.com commit a95d116098e4ce1c18cfa7f949df3eeeebe6d812 Author: Matthew Brost Date: Mon Jul 26 17:23:20 2021 -0700 drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs With GuC virtual engines the physical engine which a request executes and completes on isn't known to the i915. Therefore we can't attach a request to a physical engines breadcrumbs. To work around this we create a single breadcrumbs per engine class when using GuC submission and direct all physical engine interrupts to this breadcrumbs. v2: (John H) - Rework header file structure so intel_engine_mask_t can be in intel_engine_types.h Signed-off-by: Matthew Brost CC: John Harrison Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-6-matthew.brost@intel.com commit b02d86b915709155b3c61f97be44251bfdcd4834 Author: Matthew Brost Date: Mon Jul 26 17:23:19 2021 -0700 drm/i915/guc: Disable bonding extension with GuC submission Update the bonding extension to return -ENODEV when using GuC submission as this extension fundamentally will not work with the GuC submission interface. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-5-matthew.brost@intel.com commit 1e98d8c52ed5dfbaf273c4423c636525c2ce59e7 Author: Matthew Brost Date: Mon Jul 26 17:23:18 2021 -0700 drm/i915: Hold reference to intel_context over life of i915_request Hold a reference to the intel_context over life of an i915_request. Without this an i915_request can exist after the context has been destroyed (e.g. request retired, context closed, but user space holds a reference to the request from an out fence). In the case of GuC submission + virtual engine, the engine that the request references is also destroyed which can trigger bad pointer dref in fence ops (e.g. i915_fence_get_driver_name). We could likely change i915_fence_get_driver_name to avoid touching the engine but let's just be safe and hold the intel_context reference. v2: (John Harrison) - Update comment explaining how GuC mode and execlists mode deal with virtual engines differently Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-4-matthew.brost@intel.com commit 96d3e0e1ad0af3070f0a01c72b0ecfa8c2e581b7 Author: John Harrison Date: Mon Jul 26 17:23:17 2021 -0700 drm/i915/guc: Make hangcheck work with GuC virtual engines The serial number tracking of engines happens at the backend of request submission and was expecting to only be given physical engines. However, in GuC submission mode, the decomposition of virtual to physical engines does not happen in i915. Instead, requests are submitted to their virtual engine mask all the way through to the hardware (i.e. to GuC). This would mean that the heart beat code thinks the physical engines are idle due to the serial number not incrementing. Which in turns means hangcheck does not work for GuC virtual engines. This patch updates the tracking to decompose virtual engines into their physical constituents and tracks the request against each. This is not entirely accurate as the GuC will only be issuing the request to one physical engine. However, it is the best that i915 can do given that it has no knowledge of the GuC's scheduling decisions. Downside of this is that all physical engines constituting a GuC virtual engine will be periodically unparked (even during just a single context executing) in order to be pinged with a heartbeat request. However the power and performance cost of this is not expected to be measurable (due low frequency of heartbeat pulses) and it is considered an easier option than trying to make changes to GuC firmware. v2: (Tvrtko) - Update commit message - Have default behavior if no vfunc present Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-3-matthew.brost@intel.com commit 556120256ecd25aacea2c7e3ad11ec6584de7252 Author: Matthew Brost Date: Mon Jul 26 17:23:16 2021 -0700 drm/i915/guc: GuC virtual engines Implement GuC virtual engines. Rather simple implementation, basically just allocate an engine, setup context enter / exit function to virtual engine specific functions, set all other variables / functions to guc versions, and set the engine mask to that of all the siblings. v2: Update to work with proto-ctx v3: (Daniele) - Drop include, add comment to intel_virtual_engine_has_heartbeat Cc: Daniele Ceraolo Spurio Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-2-matthew.brost@intel.com commit a8ab5293dd230b7301b489578e1d08cef95ab2b1 Merge: 9a5ca18895ecc f1abdb78a1080 Author: Steve French Date: Tue Jul 27 18:36:14 2021 -0500 Merge pull request #63 from namjaejeon/cifsd-for-next ksmbd-fixes commit 299b50fc9e8b986d21e51ac8bac0a880bf8c5fc5 Merge: f34d9224503f1 2c257248ce8ed Author: David S. Miller Date: Wed Jul 28 00:06:41 2021 +0100 Merge branch 'ipa-clock-refs' Alex Elder says: ==================== net: ipa: add clock references This series continues preparation for implementing runtime power management for IPA. We need to ensure that the IPA core clock and interconnects are operational whenever IPA hardware is accessed. And in particular this means that any external entry point that can lead to accessing IPA hardware must guarantee the hardware is "up" when it is accessed. The first four patches in this series take IPA clock references when needed by such external entry points, dropping those references in those same functions when they are no longer required. The last patch is a bit different, though it too prepares for enabling runtime power management. It avoids suspending/resuming endpoints if setup is not complete. ==================== Signed-off-by: David S. Miller commit 2c257248ce8ed483555eb832d7766ba8f6fde0e7 Author: Alex Elder Date: Tue Jul 27 16:19:33 2021 -0500 net: ipa: don't suspend endpoints if setup not complete Until we complete the setup stage of initialization, GSI is not initialized and therefore endpoints aren't usable. So avoid suspending endpoints during system suspend unless setup is complete. Clear the setup_complete flag at the top of ipa_teardown() to reflect the fact that things are no longer in setup state. Get rid of a misplaced (and superfluous) comment. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f2b0355363f378e0baa466a48e78f5f308b3a1a7 Author: Alex Elder Date: Tue Jul 27 16:19:32 2021 -0500 net: ipa: add a clock reference for netdev operations The IPA network device can be opened at any time, and an opened network device can be stopped any time. Both of these callback functions require access to the hardware, and therefore they need the IPA clock to be operational. Take an IPA clock reference in both the ->open and ->stop callback functions, dropping the reference when they are done accessing hardware. The ->start_xmit callback requires a little different handling, and that will be added separately. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 34c6034b476416c2551dd4648e5f94f4413ce689 Author: Alex Elder Date: Tue Jul 27 16:19:31 2021 -0500 net: ipa: add clock reference for remoteproc SSR The remoteproc SSR callback function for the modem requires hardware access when handling a modem crash or shutdown. Take and later release an IPA clock reference in ipa_modem_crashed(), to ensure the hardware is operational. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit cf8dfe6ab8e7854905b13e7f46d39a2aba687825 Author: Alex Elder Date: Tue Jul 27 16:19:30 2021 -0500 net: ipa: get another clock for ipa_setup() Two places call ipa_setup(). The first, ipa_probe(), holds an IPA clock reference when calling ipa_setup() (if the AP is responsible for IPA firmware loading). But if the modem is loading IPA firmware, ipa_smp2p_modem_setup_ready_isr() calls ipa_setup() after the modem has signaled the hardware is ready. This can happen at any time, and there is no guarantee the hardware is active. Have ipa_smp2p_modem_setup() take an IPA clock reference before it calls ipa_setup(), and release it once setup is complete. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 923a6b698447f4f7872daee47accbab78135ff51 Author: Alex Elder Date: Tue Jul 27 16:19:29 2021 -0500 net: ipa: get clock in ipa_probe() Any entry point that leads to IPA hardware access must ensure the hardware is operational (clocked). Currently we ensure this by taking an extra clock reference during setup that is not released until we receive a system suspend request. But this extra reference will soon go away. When the platform driver ->probe function is called, we first need hardware access in ipa_config(). Although ipa_config() takes an IPA clock reference, it the special reference taken to prevent suspending the hardware. Have ipa_probe() take a reference before calling ipa_config(), so that the "no-suspend" reference can eventually go away. Drop this reference before ipa_probe() returns. Similarly, the driver ->remove function can be called at any time. Take an IPA clock reference at the beginning of that function, and drop it again after the deconfig stage has completed (at which point hardware access is no longer needed). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 33b57e0cc78eb82f2921eb4c6d1c8fcaa733823b Author: Stanislav Fomichev Date: Tue Jul 27 15:23:35 2021 -0700 bpf: Increase supported cgroup storage value size Current max cgroup storage value size is 4k (PAGE_SIZE). The other local storages accept up to 64k (BPF_LOCAL_STORAGE_MAX_VALUE_SIZE). Let's align max cgroup value size with the other storages. For percpu, the max is 32k (PCPU_MIN_UNIT_SIZE) because percpu allocator is not happy about larger values. netcnt test is extended to exercise those maximum values (non-percpu max size is close to, but not real max). v4: * remove inner union (Andrii Nakryiko) * keep net_cnt on the stack (Andrii Nakryiko) v3: * refine SIZEOF_BPF_LOCAL_STORAGE_ELEM comment (Yonghong Song) * anonymous struct in percpu_net_cnt & net_cnt (Yonghong Song) * reorder free (Yonghong Song) v2: * cap max_value_size instead of BUILD_BUG_ON (Martin KaFai Lau) Signed-off-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210727222335.4029096-1-sdf@google.com commit 92bd92c44d0d9be5dcbcda315b4be4b909ed9740 Author: Rajkumar Subbiah Date: Tue Jul 6 08:30:34 2021 -0700 drm/dp_mst: Fix return code on sideband message failure Commit 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests") added some debug code for sideband message tracing. But it seems to have unintentionally changed the behavior on sideband message failure. It catches and returns failure only if DRM_UT_DP is enabled. Otherwise it ignores the error code and returns success. So on an MST unplug, the caller is unaware that the clear payload message failed and ends up waiting for 4 seconds for the response. Fixes the issue by returning the proper error code. Changes in V2: -- Revise commit text as review comment -- add Fixes text Changes in V3: -- remove "unlikely" optimization Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests") Cc: # v5.5+ Signed-off-by: Rajkumar Subbiah Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Reviewed-by: Jani Nikula Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/1625585434-9562-1-git-send-email-khsieh@codeaurora.org commit 4b1ec711ec2e97fca93adf6640fa5fd61fc17827 Author: Martin Botka Date: Tue Jun 29 12:26:22 2021 +0200 dt-bindings: clk: qcom: smd-rpm: Document SM6125 compatible Document the newly added compatible for sm6125 rpmcc. Signed-off-by: Martin Botka Link: https://lore.kernel.org/r/20210629102624.194378-3-martin.botka@somainline.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 04a572c51a33bdebf9e31afb874fb36a8d2a6c17 Author: Iskren Chernev Date: Sun Jun 27 21:59:24 2021 +0300 dt-bindings: clock: qcom: rpmcc: Document SM6115 compatible Add the dt-binding for the RPM Clock Controller on the SM4250/6115 SoCs. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210627185927.695411-3-iskren.chernev@gmail.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 043c5bb3c4f43670ab4fea0b847373ab42d25f3e Author: Martynas Pumputis Date: Mon Jul 26 17:20:01 2021 +0200 libbpf: Fix race when pinning maps in parallel When loading in parallel multiple programs which use the same to-be pinned map, it is possible that two instances of the loader will call bpf_object__create_maps() at the same time. If the map doesn't exist when both instances call bpf_object__reuse_map(), then one of the instances will fail with EEXIST when calling bpf_map__pin(). Fix the race by retrying reusing a map if bpf_map__pin() returns EEXIST. The fix is similar to the one in iproute2: e4c4685fd6e4 ("bpf: Fix race condition with map pinning"). Before retrying the pinning, we don't do any special cleaning of an internal map state. The closer code inspection revealed that it's not required: - bpf_object__create_map(): map->inner_map is destroyed after a successful call, map->fd is closed if pinning fails. - bpf_object__populate_internal_map(): created map elements is destroyed upon close(map->fd). - init_map_slots(): slots are freed after their initialization. Signed-off-by: Martynas Pumputis Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210726152001.34845-1-m@lambda.lt commit c139e40a515d2d1e51f7c08bd63ed4d1c7f64163 Author: Jason Wang Date: Tue Jul 27 19:59:28 2021 +0800 libbpf: Fix comment typo Remove the repeated word 'the' in line 48. Signed-off-by: Jason Wang Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210727115928.74600-1-wangborong@cdjrlc.com commit cf0a95659e659d36838e56cc439d3986dcb46870 Author: Andy Shevchenko Date: Thu Jul 22 22:34:50 2021 +0300 clk: x86: Rename clk-lpt to more specific clk-lpss-atom The LPT stands for Lynxpoint PCH. However the driver is used on a few Intel Atom SoCs. Rename it to reflect this in a way how another clock driver, i.e. clk-pmc-atom, is called. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210722193450.35321-1-andriy.shevchenko@linux.intel.com Acked-by: Rafael J. Wysocki Signed-off-by: Stephen Boyd commit 166ec4633b63c69fabc5d8d745a1c5b73fb53f1d Author: Arnd Bergmann Date: Fri Jan 17 17:26:54 2020 +0100 asm-generic: remove extra strn{cpy_from,len}_user declarations As these are now in asm-generic, it's no longer necessary to declare them in the architecture. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit 98b861a304318e60eea584bef123d924e5d0dcff Author: Arnd Bergmann Date: Sat Jan 23 15:21:22 2021 +0100 asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user The inline version is used on three NOMMU architectures and is particularly inefficient when it scans the string one byte at a time twice. It also lacks a check for user_addr_max(), but this is probably ok on NOMMU targets. Consolidate the asm-generic implementation with the library version that is used everywhere else. This version is generalized enough to work efficiently on both MMU and NOMMU targets, and using the same code everywhere reduces the potential for subtle bugs. Mark the prototypes as __must_check in the process. Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit e93a1cb8d2b3dccd31bde77373c8d5619f0e0a10 Author: Heiko Carstens Date: Thu Jul 22 22:07:30 2021 +0200 s390: use generic strncpy/strnlen from_user The s390 variant of strncpy_from_user() is slightly faster than the generic variant, however convert to the generic variant now to follow most if not all other architectures. Converting to the generic variant was already considered a couple of years ago. See commit f5c8b9601036 ("s390/uaccess: use sane length for __strncpy_from_user()"). Signed-off-by: Heiko Carstens Signed-off-by: Arnd Bergmann commit b26b181651f3214fa2383411fb85029b7f3e1788 Author: Arnd Bergmann Date: Thu Jan 16 15:58:41 2020 +0100 microblaze: use generic strncpy/strnlen from_user Remove the microblaze implemenation of strncpy/strnlen and instead use the generic versions. The microblaze version is fairly slow because it always does byte accesses even for aligned data, and it lacks a checks for user_addr_max(). Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit 84030adb9e27d202a66022488bf0349a8bd45213 Author: José Roberto de Souza Date: Mon Jul 26 11:15:59 2021 -0700 drm/i915/display: Disable audio, DRRS and PSR before planes HDMI and DisplayPort sequences states that audio and PSR should be disabled before planes are disabled. Not following it did not caused any problems up to Alderlake-P but for this platform it causes underruns during the PSR2 disable sequence. Specification don't mention that DRRS should be disabled before planes but it looks safer to switch back to the default refresh rate before following with the rest of the pipe disable sequence. BSpec: 49191 BSpec: 49190 Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210726181559.80855-1-jose.souza@intel.com commit f34d9224503f13cae35ae9d6a43199e3666bbe99 Merge: 8ca34a13f7f9b 176086d870359 Author: David S. Miller Date: Tue Jul 27 21:02:21 2021 +0100 Merge branch 'ipa-interrupts' Alex Elder says: ==================== net: ipa: IPA interrupt cleanup The first patch in this series makes all IPA interrupt handling be done in a threaded context. The remaining ones refactor some code to simplify that threaded handler function. ==================== Signed-off-by: David S. Miller commit 176086d870359fa5e4fe226fdcf43340187134c2 Author: Alex Elder Date: Tue Jul 27 14:46:29 2021 -0500 net: ipa: kill ipa_interrupt_process_all() Now that ipa_isr_thread() is a simple wrapper that gets a clock reference around ipa_interrupt_process_all(), get rid of the called function and just open-code it in ipa_isr_thread(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit fe6a32797971db3d5770a5ddcd0cec15f561e501 Author: Alex Elder Date: Tue Jul 27 14:46:28 2021 -0500 net: ipa: get rid of some unneeded IPA interrupt code The pending IPA interrupts are checked by ipa_isr_thread(), and interrupts are processed only if an enabled interrupt has a condition pending. But ipa_interrupt_process_all() now makes the same check, so the one in ipa_isr_thread() can just be skipped. Also in ipa_isr_thread(), any interrupt conditions pending which are not enabled are cleared. Here too, ipa_interrupt_process_all() now clears such excess interrupt conditions, so ipa_isr_thread() doesn't have to. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit e70e410f8e7c000b5f44ecba8a1b40d2a2b8c6f1 Author: Alex Elder Date: Tue Jul 27 14:46:27 2021 -0500 net: ipa: clear disabled IPA interrupt conditions We ignore any IPA interrupt that has no handler. If any interrupt conditions without a handler exist when an IPA interrupt occurs, clear those conditions. Add a debug message to report which ones are being cleared. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 937a0da43228c719f549fa44b0e227312aa08b84 Author: Alex Elder Date: Tue Jul 27 14:46:26 2021 -0500 net: ipa: make IPA interrupt handler threaded only When the IPA interrupt handler runs, the IPA core clock must already be operational, and the interconnect providing access by the AP to IPA config space must be enabled too. Currently we ensure this by taking a top-level "stay awake" IPA clock reference, but that will soon go away. In preparation for that, move all handling for the IPA IRQ into the thread function. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8ca34a13f7f9b3fa2c464160ffe8cc1a72088204 Author: Pavel Skripkin Date: Tue Jul 27 19:35:30 2021 +0300 net: cipso: fix warnings in netlbl_cipsov4_add_std Syzbot reported warning in netlbl_cipsov4_add(). The problem was in too big doi_def->map.std->lvl.local_size passed to kcalloc(). Since this value comes from userpace there is no need to warn if value is not correct. The same problem may occur with other kcalloc() calls in this function, so, I've added __GFP_NOWARN flag to all kcalloc() calls there. Reported-and-tested-by: syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com Fixes: 96cb8e3313c7 ("[NetLabel]: CIPSOv4 and Unlabeled packet integration") Acked-by: Paul Moore Signed-off-by: Pavel Skripkin Signed-off-by: David S. Miller commit 2f21be447bf0eed63a5c8999a6c449b37e2c6180 Merge: 7c57706b4be5c 18d6426402dea Author: David S. Miller Date: Tue Jul 27 20:15:31 2021 +0100 Merge branch 'ionic-next' Shannon Nelson says: ==================== ionic: driver updates 27-July-2021 This is a collection of small driver updates for adding a couple of small features and for a bit of code cleaning. ==================== Signed-off-by: David S. Miller commit 5e23c98178eb1a2cdb7c4fee9a39baf8cabf282d Author: Marek Vasut Date: Mon Jun 21 00:49:46 2021 +0200 drm: mxsfb: Clear FIFO_CLEAR bit Make sure the FIFO_CLEAR bit is latched in when configuring the controller, so that the FIFO is really cleared. And then clear the FIFO_CLEAR bit, since it is not self-clearing. Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller") Signed-off-by: Marek Vasut Cc: Daniel Abrecht Cc: Emil Velikov Cc: Laurent Pinchart Cc: Lucas Stach Cc: Stefan Agner Reviewed-by: Jagan Teki Tested-by: Jagan Teki # i.Core MX8MM Acked-by: Lucas Stach Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210620224946.189524-1-marex@denx.de commit b776b0f00f246d093c595bac4453c6e51541d5c5 Author: Marek Vasut Date: Mon Jul 26 21:44:57 2021 +0200 drm: mxsfb: Use bus_format from the nearest bridge if present In case there is a bridge connected to the LCDIF, use bus_format from the bridge, otherwise behave as before and use bus_format from the connector. This way, even if there are multiple bridges in the display pipeline, the LCDIF will use the correct format. Reviewed-by: Lucas Stach Signed-off-by: Marek Vasut Cc: Daniel Abrecht Cc: Emil Velikov Cc: Laurent Pinchart Cc: Lucas Stach Cc: Stefan Agner Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210726194457.341696-1-marex@denx.de commit 9891cb54445bc65bf156bda416b6215048c7f617 Author: Marek Vasut Date: Mon Jun 21 00:47:59 2021 +0200 drm: mxsfb: Increase number of outstanding requests on V4 and newer HW In case the DRAM is under high load, the MXSFB FIFO might underflow and that causes visible artifacts. This could be triggered on i.MX8MM using e.g. "$ memtester 128M" on a device with 1920x1080 panel. The first "Stuck Address" test of the memtester will completely corrupt the image on the panel and leave the MXSFB FIFO in odd state. To avoid this underflow, increase number of outstanding requests to DRAM from 2 to 16, which is the maximum. This mitigates the issue and it can no longer be triggered. Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller") Signed-off-by: Marek Vasut Cc: Daniel Abrecht Cc: Emil Velikov Cc: Laurent Pinchart Cc: Lucas Stach Cc: Stefan Agner Reviewed-by: Lucas Stach Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210620224759.189351-1-marex@denx.de commit 0c9856e4edcdcac22d65618e8ceff9eb41447880 Author: Marek Vasut Date: Mon Jun 21 00:47:01 2021 +0200 drm: mxsfb: Enable recovery on underflow There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS bridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted. It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs. All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW bit, which is described in the reference manual since i.MX23 as " Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame. " Enable this bit to mitigate the sporadic underflows. Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller") Signed-off-by: Marek Vasut Cc: Daniel Abrecht Cc: Emil Velikov Cc: Laurent Pinchart Cc: Lucas Stach Cc: Stefan Agner Reviewed-by: Lucas Stach Reviewed-by: Laurent Pinchart Reviewed-by: Jagan Teki Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210620224701.189289-1-marex@denx.de commit 18d6426402deaac0f748bd4476c977ea4bca3b12 Author: Shannon Nelson Date: Tue Jul 27 10:43:34 2021 -0700 ionic: add function tag to debug string Prefix the log output with the function string as in other debug messages. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 6edddead95504fc2e8fc425c3d10a1b25fec735f Author: Shannon Nelson Date: Tue Jul 27 10:43:33 2021 -0700 ionic: enable rxhash only with multiple queues If there's only one queue, there is no need to enable the rxhashing. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit f5123686773660505d8dbc834b304212918f3106 Author: Shannon Nelson Date: Tue Jul 27 10:43:32 2021 -0700 ionic: block some ethtool operations when fw in reset There are a few things that we can't safely do when the fw is resetting, as the driver may be in the middle of rebuilding queue structures. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit a1cda1844bee5fda96cd06f958c4aaf8285f18d5 Author: Shannon Nelson Date: Tue Jul 27 10:43:31 2021 -0700 ionic: remove unneeded comp union fields We don't use these fields, so remove them from the definition. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 73618201acaa17edcf141101af9878d9f16de42a Author: Shannon Nelson Date: Tue Jul 27 10:43:30 2021 -0700 ionic: increment num-vfs before configure Add the new VF to our internal count before we start configuring it. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit e75ccac1d0644c9d7ad531cb9a81c499930c06da Author: Shannon Nelson Date: Tue Jul 27 10:43:29 2021 -0700 ionic: use fewer inits on the buf_info struct Based on Alex's review notes on [1], we don't need to write to the buf_info elements as often, and can tighten up how they are used. Also, use prefetchw() to warm up the page struct for a later get_page(). [1] https://lore.kernel.org/netdev/CAKgT0UfyjoAN7LTnq0NMZfXRv4v7iTCPyAb9pVr3qWMhop_BVw@mail.gmail.com/ Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit e7f52aa44380ea657f0977ded63eee091f8fa123 Author: Shannon Nelson Date: Tue Jul 27 10:43:28 2021 -0700 ionic: init reconfig err to 0 Initialize err to 0 instead of ENOMEM, and specifically set err to ENOMEM in the devm_kcalloc() failure cases. Also, add an error message to the end of reconfig. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 73d618bb7e1998f10735e216578d8f439a60d50c Author: Shannon Nelson Date: Tue Jul 27 10:43:27 2021 -0700 ionic: print firmware version on identify Print the version of the DSC firmware seen when we do a fresh ident check. Because the FW can be updated by the external orchestration system, this helps us track that FW has been updated on the DSC. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit d2662072c094be6dd7544c7752a36a5dc030076c Author: Shannon Nelson Date: Tue Jul 27 10:43:26 2021 -0700 ionic: monitor fw status generation The top 4 bits of the fw_status in dev_info_regs is reserved for the status generation. This generation number is an arbitrary value defined when firmware starts up. If the FW is killed/crashed/stopped and then restarted, it will create a different generation number. With this mechanism, the host driver can detect that the FW has crashed and restarted, and the driver can then take steps to re-initialize its connection. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit c0b03e8399505a5aafe3a38e287213f523d890af Author: Shannon Nelson Date: Tue Jul 27 10:43:25 2021 -0700 ionic: minimize resources when under kdump When running in a small kdump kernel, we can play nice and minimize our resource use to help make sure that kdump is successful in its mission. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 7c57706b4be5cf85ded0721c0619a2122b846c18 Merge: 2fba2eae30d34 3d9d00bd1885a Author: David S. Miller Date: Tue Jul 27 20:12:04 2021 +0100 Merge branch 'ndo_ioctl-rework' Arnd Bergmann says: ==================== ndo_ioctl rework This series is a follow-up to the series for removing compat_alloc_user_space() and copy_in_user() that has now been merged. I wanted to be sure I address all the ways that 'struct ifreq' is used in device drivers through .ndo_do_ioctl, originally to prove that my approach of changing the struct definition was correct, but then I discarded that approach and went on anyway. Roughly, the contents here are: - split out all the users of SIOCDEVPRIVATE ioctls into a separate ndo_siocdevprivate callback, to better see what gets used where - fix compat handling for those drivers that pass data directly inside of 'ifreq' rather than using an indirect ifr_data pointer - remove unreachable code in ndo_ioctl handlers that relies on command codes we never pass into that, in particular for wireless drivers - split out the ethernet specific ioctls into yet another ndo_eth_ioctl callback, as these are by far the most common use of ndo_do_ioctl today. I considered splitting them further into MII and timestamp controls, but went with the simpler change for now. - split out bonding and wandev ioctls into separate helpers - rework the bridge handling with a separate callback At this point, only a few oddball things remain in ndo_do_ioctl: appletalk and ieee802154 pass down SIOCSIFADDR/SIOCGIFADDR and some wireless drivers have completely dead code. I have thoroughly compile tested this on randconfig builds, but not done any notable runtime testing, so please review. All of it is also available as part of a larger branch at https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git \ compat-alloc-user-space-12 Changes since v2: - rebase to net-next - fix qeth regression - Cc driver maintainers for each patch and in cover letter Changes since v1: - rebase to linux-5.14-rc2 - add conversion for ndo_siowandev, bridge and bonding drivers - leave broken wifi drivers untouched for now Link: https://lore.kernel.org/netdev/20201106221743.3271965-14-arnd@kernel.org/ ==================== commit 3d9d00bd1885afa6b2c766cf9bab7b54b1a951ed Author: Arnd Bergmann Date: Tue Jul 27 15:45:17 2021 +0200 net: bonding: move ioctl handling to private ndo operation All other user triggered operations are gone from ndo_ioctl, so move the SIOCBOND family into a custom operation as well. The .ndo_ioctl() helper is no longer called by the dev_ioctl.c code now, but there are still a few definitions in obsolete wireless drivers as well as the appletalk and ieee802154 layers to call SIOCSIFADDR/SIOCGIFADDR helpers from inside the kernel. Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit ad2f99aedf8fa77f3ae647153284fa63c43d3055 Author: Arnd Bergmann Date: Tue Jul 27 15:45:16 2021 +0200 net: bridge: move bridge ioctls out of .ndo_do_ioctl Working towards obsoleting the .ndo_do_ioctl operation entirely, stop passing the SIOCBRADDIF/SIOCBRDELIF device ioctl commands into this callback. My first attempt was to add another ndo_siocbr() callback, but as there is only a single driver that takes these commands and there is already a hook mechanism to call directly into this driver, extend this hook instead, and use it for both the deviceless and the device specific ioctl commands. Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 88fc023f7de22922c6c61e2f3d4c54befb8b3549 Author: Arnd Bergmann Date: Tue Jul 27 15:45:15 2021 +0200 net: socket: return changed ifreq from SIOCDEVPRIVATE Some drivers that use SIOCDEVPRIVATE ioctl commands modify the ifreq structure and expect it to be passed back to user space, which has never really happened for compat mode because the calling these drivers through ndo_do_ioctl requires overwriting the ifr_data pointer. Now that all drivers are converted to ndo_siocdevprivate, change it to handle this correctly in both compat and native mode. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit ad7eab2ab014748b062507b7ac69f8e856057717 Author: Arnd Bergmann Date: Tue Jul 27 15:45:14 2021 +0200 net: split out ndo_siowandev ioctl In order to further reduce the scope of ndo_do_ioctl(), move out the SIOCWANDEV handling into a new network device operation function. Adjust the prototype to only pass the if_settings sub-structure in place of the ifreq, and remove the redundant 'cmd' argument in the process. Cc: Krzysztof Halasa Cc: "Jan \"Yenya\" Kasprzak" Cc: Kevin Curtis Cc: Zhao Qiang Cc: Martin Schiller Cc: Jiri Slaby Cc: linux-x25@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit a76053707dbf0dc020a73b4d90cd952409ef3691 Author: Arnd Bergmann Date: Tue Jul 27 15:45:13 2021 +0200 dev_ioctl: split out ndo_eth_ioctl Most users of ndo_do_ioctl are ethernet drivers that implement the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP. Separate these from the few drivers that use ndo_do_ioctl to implement SIOCBOND, SIOCBR and SIOCWANDEV commands. This is a purely cosmetic change intended to help readers find their way through the implementation. Cc: Doug Ledford Cc: Jason Gunthorpe Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Cc: Vladimir Oltean Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Arnd Bergmann Acked-by: Jason Gunthorpe Signed-off-by: David S. Miller commit a554bf96b49db4c208e305ae92546422e9489380 Author: Arnd Bergmann Date: Tue Jul 27 15:45:12 2021 +0200 dev_ioctl: pass SIOCDEVPRIVATE data separately The compat handlers for SIOCDEVPRIVATE are incorrect for any driver that passes data as part of struct ifreq rather than as an ifr_data pointer, or that passes data back this way, since the compat_ifr_data_ioctl() helper overwrites the ifr_data pointer and does not copy anything back out. Since all drivers using devprivate commands are now converted to the new .ndo_siocdevprivate callback, fix this by adding the missing piece and passing the pointer separately the whole way. This further unifies the native and compat logic for socket ioctls, as the new code now passes the correct pointer as well as the correct data for both native and compat ioctls. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 8fb75b79cd98944c118861ff3194caf731f5ec5a Author: Arnd Bergmann Date: Tue Jul 27 15:45:11 2021 +0200 wan: cosa: remove dead cosa_net_ioctl() function The ndo_do_ioctl callback is never called with the COSAIO* commands, so this is never used. Call the hdlc_ioctl function directly instead. Any user space code that relied on this function working as intended has never worked in a mainline kernel since before linux-1.0. Cc: "Jan \"Yenya\" Kasprzak" Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 73d74f61a559d8fc2266abfb95085bb7d1917a3e Author: Arnd Bergmann Date: Tue Jul 27 15:45:10 2021 +0200 wan: use ndo_siocdevprivate The wan drivers each support some custom SIOCDEVPRIVATE ioctls, plus the common SIOCWANDEV command. Split these so the ioctl callback only deals with SIOCWANDEV and the rest is handled by ndo_siocdevprivate. It might make sense to also split out SIOCWANDEV into a separate callback in order to eventually remove ndo_do_ioctl entirely. Cc: Krzysztof Halasa Cc: Kevin Curtis Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 34f7cac07c4e1a8fe64bd09334ecb49f21e98bf8 Author: Arnd Bergmann Date: Tue Jul 27 15:45:09 2021 +0200 ppp: use ndo_siocdevprivate ppp has a custom statistics interface using SIOCDEVPRIVATE ioctl commands that works correctly in compat mode. Convert it to use ndo_siocdevprivate as a cleanup. Cc: Paul Mackerras Cc: linux-ppp@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit cc0aa831a0d9c3977eed7fd3eba18dcd1d422024 Author: Arnd Bergmann Date: Tue Jul 27 15:45:08 2021 +0200 sb1000: use ndo_siocdevprivate The private sb1000 ioctl commands all work correctly in compat mode. Change the to ndo_siocdevprivate as a cleanup. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 81a68110a22a4ffdc3cb81377e5a565cd3e1a137 Author: Arnd Bergmann Date: Tue Jul 27 15:45:07 2021 +0200 hippi: use ndo_siocdevprivate The rr_ioctl uses private ioctl commands that correctly pass all data through ifr_data, which works fine in compat mode. Change it to use ndo_siocdevprivate as a cleanup. Cc: Jes Sorensen Cc: linux-hippi@sunsite.dk Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3e7a1c7c561ed8508fbdb98ed5708175bbcf7938 Author: Arnd Bergmann Date: Tue Jul 27 15:45:06 2021 +0200 ip_tunnel: use ndo_siocdevprivate The various ipv4 and ipv6 tunnel drivers each implement a set of 12 SIOCDEVPRIVATE commands for managing tunnels. These all work correctly in compat mode. Move them over to the new .ndo_siocdevprivate operation. Cc: Hideaki YOSHIFUJI Cc: David Ahern Cc: Steffen Klassert Cc: Herbert Xu Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit ae6af0120dda5d2ccde33ba8b7a6337066e10cbd Author: Arnd Bergmann Date: Tue Jul 27 15:45:05 2021 +0200 airo: use ndo_siocdevprivate The airo driver overloads SIOCDEVPRIVATE ioctls with another set based on SIOCIWFIRSTPRIV. Only the first ones actually work (also in compat mode) as the others do not get passed down any more. Change it over to ndo_siocdevprivate for clarification. Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 25ec92fbdd23a0a2bfd2bdf489e60ea4f0ae46d1 Author: Arnd Bergmann Date: Tue Jul 27 15:45:04 2021 +0200 hamradio: use ndo_siocdevprivate hamradio uses a set of private ioctls that do seem to work correctly in compat mode, as they only rely on the ifr_data pointer. Move them over to the ndo_siocdevprivate callback as a cleanup. Cc: Thomas Sailer Cc: Joerg Reuter Cc: Jean-Paul Roubelat Cc: linux-hams@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit ebb4a911e09a7c602cc9709c5c785527f63a8871 Author: Arnd Bergmann Date: Tue Jul 27 15:45:03 2021 +0200 cxgb3: use ndo_siocdevprivate cxgb3 has a private multiplexor that works correctly in compat mode, split out the siocdevprivate callback from do_ioctl for simplification. Cc: Raju Rangoju Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 18787eeebd7129ecf4960876d24f349682207783 Author: Arnd Bergmann Date: Tue Jul 27 15:45:02 2021 +0200 qeth: use ndo_siocdevprivate qeth has both standard MII ioctls and custom SIOCDEVPRIVATE ones, all of which work correctly with compat user space. Move the private ones over to the new ndo_siocdevprivate callback. Cc: Julian Wiedmann Cc: Karsten Graul Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: linux-s390@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 76b5878cffab379dd4fd84c04bdf20d21177729d Author: Arnd Bergmann Date: Tue Jul 27 15:45:01 2021 +0200 slip/plip: use ndo_siocdevprivate slip and plip both use a couple of SIOCDEVPRIVATE ioctl commands that overload the ifreq layout in a way that is incompatible with compat mode. Convert to use ndo_siocdevprivate to allow passing the data this way, but return an error in compat mode anyway because the private structure is still incompatible. This could be fixed as well to make compat work properly. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit ef1b5b0c30bc61587a9da19cc0ab078bba53ebcc Author: Arnd Bergmann Date: Tue Jul 27 15:45:00 2021 +0200 net: usb: use ndo_siocdevprivate The pegasus and rtl8150 drivers use SIOCDEVPRIVATE ioctls to access their MII registers, in place of the normal commands. This is broken for all compat ioctls today. Change to ndo_siocdevprivate to fix it. Cc: Petko Manolov Cc: linux-usb@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 043393d8b4786534cd070e0c071a2716313c5558 Author: Arnd Bergmann Date: Tue Jul 27 15:44:59 2021 +0200 fddi: use ndo_siocdevprivate The skfddi driver has a private ioctl and passes the data correctly through ifr_data, but the use of a pointer in s_skfp_ioctl is broken in compat mode. Change the driver to use ndo_siocdevprivate and disallow calling it in compat mode until a conversion handler is added. Cc: "Maciej W. Rozycki" Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit d92f7b59d32bfeace7315b416f5244dd5c3935fa Author: Arnd Bergmann Date: Tue Jul 27 15:44:58 2021 +0200 eql: use ndo_siocdevprivate The private ioctls in eql pass the arguments correctly through ifr_data, but the slaving_request_t and slave_config_t structures are incompatible with compat mode and need special conversion code in the driver. Convert to siocdevprivate for now, and return an error when called in compat mode. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 32d05468c46267db1c0128057d4fcf80332fecf8 Author: Arnd Bergmann Date: Tue Jul 27 15:44:57 2021 +0200 tehuti: use ndo_siocdevprivate Tehuti only implements private ioctl commands, and implements them by overriding the ifreq layout, which is broken in compat mode. Move it to the ndo_siocdevprivate callback in order to fix this. Cc: Andy Gospodarek Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 99b78a37a3717e5879dda70dec5ef6d23073b379 Author: Arnd Bergmann Date: Tue Jul 27 15:44:56 2021 +0200 hamachi: use ndo_siocdevprivate hamachi has one command that overloads the ifreq argument and requires a conversion to ndo_siocdevprivate in order to make compat mode work, so split it from ndo_ioctl. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit dbecb011eb781de411daf5d0c8745cd158a55f06 Author: Arnd Bergmann Date: Tue Jul 27 15:44:55 2021 +0200 appletalk: use ndo_siocdevprivate appletalk has three SIOCDEVPRIVATE ioctl commands that are broken in compat mode because the passed structure contains a pointer. Change it over to ndo_siocdevprivate for consistency and make it return an error when called in compat mode. This could be fixed if there are still users. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 232ec98ec35d72352efb2f52d1b0628f425dbf86 Author: Arnd Bergmann Date: Tue Jul 27 15:44:54 2021 +0200 bonding: use siocdevprivate The bonding driver supports two command codes for each operation: one in the SIOCDEVPRIVATE range and another one with the same definition but a unique command code. Only the second set currently works in compat mode, as the ifr_data expansion overwrites part of the ifr_slave field. Move the private ones into ndo_siocdevprivate and change the implementation to call the other function. This makes both version work correctly. Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 029a4fef6b22b92d4f9b50ac0cdc48dfaff9af68 Author: Arnd Bergmann Date: Tue Jul 27 15:44:53 2021 +0200 tulip: use ndo_siocdevprivate The tulip driver has a debugging method over ioctl built-in, but it does not actually check the command type, which may end up leading to random behavior when trying to run other ioctls on it. Change the driver to use ndo_siocdevprivate and limit the execution further to the first private command code. If anyone still has tools to run these debugging commands, they might have to be patched for it if they pass different ioctl command. The function has existed in this form since the driver was merged in Linux-1.1.86. Cc: linux-parisc@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 4747c1a8bc50a69e9b2cd7eb188fcbd95f177999 Author: Arnd Bergmann Date: Tue Jul 27 15:44:52 2021 +0200 phonet: use siocdevprivate phonet has a single private ioctl that is broken in compat mode on big-endian machines today because the data returned from it is never copied back to user space. Move it over to the ndo_siocdevprivate callback, which also fixes the compat issue. Cc: Remi Denis-Courmont Signed-off-by: Arnd Bergmann Acked-by: Rémi Denis-Courmont Signed-off-by: David S. Miller commit 561d8352818f2ca79c13471f245b992398902090 Author: Arnd Bergmann Date: Tue Jul 27 15:44:51 2021 +0200 bridge: use ndo_siocdevprivate The bridge driver has an old set of ioctls using the SIOCDEVPRIVATE namespace that have never worked in compat mode and are explicitly forbidden already. Move them over to ndo_siocdevprivate and fix compat mode for these, because we can. Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3f3fa5340745c81a2e70a171fb73a44b433d5126 Author: Arnd Bergmann Date: Tue Jul 27 15:44:50 2021 +0200 hostap: use ndo_siocdevprivate hostap has a combination of iwpriv ioctls that do not work at all, and two SIOCDEVPRIVATE commands that work natively but lack a compat conversion handler. For the moment, move them over to the new ndo_siocdevprivate interface and return an error for compat mode. Cc: Jouni Malinen Cc: Kalle Valo Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3343c49a959df1c6ff6560b8dfe178613c5fc38e Author: Arnd Bergmann Date: Tue Jul 27 15:44:49 2021 +0200 staging: wlan-ng: use siocdevprivate wlan-ng has two private ioctls that correctly work in compat mode. Move these over to the new ndo_siocdevprivate mechanism. The p80211netdev_ethtool() function is commented out and has no use here, so this can be removed Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 89939e89060584d40eacad757b76bf636c6b4b52 Author: Arnd Bergmann Date: Tue Jul 27 15:44:48 2021 +0200 staging: rtlwifi: use siocdevprivate rtl8188eu has an "android private" ioctl command multiplexer that is not currently safe for use in compat mode because of its triple-indirect pointer. rtl8723bs uses a different interface on the SIOCDEVPRIVATE command, based on the iwpriv data structure Both also have normal unreachable iwpriv commands, and all of the above should probably just get removed. For the moment, just switch over to the new interface. Cc: Larry Finger Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit b9067f5dc4a07c8e24e01a1b277c6722d91be39e Author: Arnd Bergmann Date: Tue Jul 27 15:44:47 2021 +0200 net: split out SIOCDEVPRIVATE handling from dev_ioctl SIOCDEVPRIVATE ioctl commands are mainly used in really old drivers, and they have a number of problems: - They hide behind the normal .ndo_do_ioctl function that is also used for other things in modern drivers, so it's hard to spot a driver that actually uses one of these - Since drivers use a number different calling conventions, it is impossible to support compat mode for them in a generic way. - With all drivers using the same 16 commands codes, there is no way to introspect the data being passed through things like strace. Add a new net_device_ops callback pointer, to address the first two of these. Separating them from .ndo_do_ioctl makes it easy to grep for drivers with a .ndo_siocdevprivate callback, and the unwieldy name hopefully makes it easier to spot in code review. By passing the ifreq structure and the ifr_data pointer separately, it is no longer necessary to overload these, and the driver can use either one for a given command. Cc: Cong Wang Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 2fba2eae30d3401716d56467007d6938c0d580ed Merge: 409f386b8e5d6 a657db0350bb8 Author: David S. Miller Date: Tue Jul 27 20:09:29 2021 +0100 Merge branch 'tcp-rack' Neal Cardwell says: ==================== more accurate DSACK processing for RACK-TLP This patch series includes two minor improvements to tighten up the accuracy of the processing of incoming DSACK information, so that RACK-TLP behavior is faster and more precise: first, to ensure we detect packet loss in some extra corner cases; and second, to avoid growing the RACK reordering window (and delaying fast recovery) in cases where it seems clear we don't need to. ==================== Signed-off-by: David S. Miller commit a657db0350bb8f568897835b6189c84a89f13292 Author: Neal Cardwell Date: Tue Jul 27 10:42:58 2021 -0400 tcp: more accurately check DSACKs to grow RACK reordering window Previously, a DSACK could expand the RACK reordering window when no reordering has been seen, and/or when the DSACK was due to an unnecessary TLP retransmit (rather than a spurious fast recovery due to reordering). This could result in unnecessarily growing the RACK reordering window and thus unnecessarily delaying RACK-based fast recovery episodes. To avoid these issues, this commit tightens the conditions under which a DSACK triggers the RACK reordering window to grow, so that a connection only expands its RACK reordering window if: (a) reordering has been seen in the connection (b) a DSACKed range does not match the most recent TLP retransmit Signed-off-by: Neal Cardwell Acked-by: Yuchung Cheng Acked-by: Priyaranjan Jha Signed-off-by: David S. Miller commit 63f367d9de77b30f58722c1be9e334fb0f5f342d Author: Yuchung Cheng Date: Tue Jul 27 10:42:57 2021 -0400 tcp: more accurately detect spurious TLP probes Previously TLP is considered spurious if the sender receives any DSACK during a TLP episode. This patch further checks the DSACK sequences match the TLP's to improve accuracy. Signed-off-by: Yuchung Cheng Acked-by: Neal Cardwell Acked-by: Priyaranjan Jha Signed-off-by: David S. Miller commit 284c537a8aceb58ebcdc5a6cf7a21645ce6c4111 Author: Liam Beguin Date: Thu Jul 8 17:16:45 2021 -0400 clk: lmk04832: drop redundant fallthrough statements When the body of a case statement is empty, it is well understood that it is intentional and explicit fallthrough statements are not required. Drop them. Signed-off-by: Liam Beguin Link: https://lore.kernel.org/r/20210708211645.3621902-1-liambeguin@gmail.com Signed-off-by: Stephen Boyd commit 87859a8e3f083bd57b34e6a962544d775a76b15f Author: Paul E. McKenney Date: Tue May 18 10:47:43 2021 -0700 tools/memory-model: Document data_race(READ_ONCE()) It is possible to cause KCSAN to ignore marked accesses by applying __no_kcsan to the function or applying data_race() to the marked accesses. These approaches allow the developer to restrict compiler optimizations while also causing KCSAN to ignore diagnostic accesses. This commit therefore updates the documentation accordingly. Signed-off-by: Paul E. McKenney commit f92975d76d537c06a2118f9c3c63432c0f7c7a88 Author: Manfred Spraul Date: Fri May 14 11:40:06 2021 -0700 tools/memory-model: Heuristics using data_race() must handle all values Data loaded for use by some sorts of heuristics can tolerate the occasional erroneous value. In this case the loads may use data_race() to give the compiler full freedom to optimize while also informing KCSAN of the intent. However, for this to work, the heuristic needs to be able to tolerate any erroneous value that could possibly arise. This commit therefore adds a paragraph spelling this out. Signed-off-by: Manfred Spraul Signed-off-by: Paul E. McKenney commit 436eef23c41fe10dc34ed19a00caf9f1290a8689 Author: Paul E. McKenney Date: Thu May 13 14:54:58 2021 -0700 tools/memory-model: Add example for heuristic lockless reads This commit adds example code for heuristic lockless reads, based loosely on the sem_lock() and sem_unlock() functions. [ paulmck: Apply Alan Stern and Manfred Spraul feedback. ] Reported-by: Manfred Spraul [ paulmck: Update per Manfred Spraul and Hillf Danton feedback. ] Signed-off-by: Paul E. McKenney commit d17e4e62df328a5a9e64c014fbeab732ed9d87c4 Author: Miles Chen Date: Fri Jul 16 13:17:32 2021 +0800 clk: mediatek: make COMMON_CLK_MT8167* depend on COMMON_CLK_MT8167 I found that COMMON_CLK_MT8167* do not depend on COMMON_CLK_MT8167, so it is possible to config: CONFIG_COMMON_CLK_MT8167=n CONFIG_COMMON_CLK_MT8167_*=y Although it does not cause build breaks with such configuration, I think it is clearer to make COMMON_CLK_MT8167* depend on COMMON_CLK_MT8167. Signed-off-by: Miles Chen Link: https://lore.kernel.org/r/20210716051732.3422-1-miles.chen@mediatek.com Signed-off-by: Stephen Boyd commit 06ca91448f32247c436e83116357f891be03b4bd Author: Paul E. McKenney Date: Fri Jul 9 17:13:34 2021 -0700 torture: Make kvm-test-1-run-qemu.sh check for reboot loops It turns out that certain types of early boot bugs can result in reboot loops, even within a guest OS running under qemu/KVM. This commit therefore upgrades the kvm-test-1-run-qemu.sh script's hang-detection heuristics to detect such situations and to terminate the run when they occur. Signed-off-by: Paul E. McKenney commit 5f33809ec2cd1f8383aa1cc14f1ae1a244dd2906 Author: Paul E. McKenney Date: Fri Jul 9 15:25:31 2021 -0700 torture: Add timestamps to kvm-test-1-run-qemu.sh output The kvm-test-1-run-qemu.sh script logs the torture-test start time and also when it starts getting impatient for the test to finish. However, it does not timestamp these log messages, which can make debugging needlessly challenging. This commit therefore adds timestamps to these messages. Signed-off-by: Paul E. McKenney commit b3bf9632efc47cc9ae640863b839c70e84da8ea6 Author: Paul E. McKenney Date: Fri Jul 9 14:31:37 2021 -0700 torture: Don't use "test" command's "-a" argument There was a time long ago when the "test" command's documentation claimed that the "-a" and "-o" arguments did something useful. But this documentation now suggests letting the shell execute these boolean operators, so this commit applies that suggestion to kvm-test-1-run-qemu.sh. Signed-off-by: Paul E. McKenney commit a5202e173d3b1d8f838105b1cda39619941bd44a Author: Paul E. McKenney Date: Thu Jul 8 17:20:08 2021 -0700 torture: Make kvm-test-1-run-batch.sh select per-scenario affinity masks This commit causes kvm-test-1-run-batch.sh to use the new kvm-assign-cpus.sh and kvm-get-cpus-script.sh scripts to create a TORTURE_AFFINITY environment variable containing either an empty string (for no affinity) or a list of CPUs to pin the scenario's vCPUs to. The additional change to kvm-test-1-run.sh places the per-scenario number-of-CPUs information where it can easily be found. If there is some reason why affinity cannot be supplied, this commit prints and logs the reason via changes to kvm-again.sh. Finally, this commit updates the kvm-remote.sh script to copy the qemu-affinity output files back to the host system. Signed-off-by: Paul E. McKenney commit 9e528a84c9f23154e74ed8c8cff128b643da5867 Author: Paul E. McKenney Date: Thu Jul 8 15:35:42 2021 -0700 torture: Consistently name "qemu*" test output files There is "qemu-affinity", "qemu-cmd", "qemu-retval", but also "qemu_pid". This is hard to remember, not so good for bash tab completion, and just plain inconsistent. This commit therefore renames the "qemu_pid" file to "qemu-pid". A couple of the scripts must deal with old runs, and thus must handle both "qemu_pid" and "qemu-pid", but new runs will produce "qemu-pid". Signed-off-by: Paul E. McKenney commit 4567c76a8e45af6b5015b17ea1d1a62af1257cc4 Author: Paul E. McKenney Date: Thu Jul 8 11:02:14 2021 -0700 torture: Use numeric taskset argument in jitter.sh The jitter.sh script has some entertaining awk code to generate a hex mask from a randomly selected CPU number, which is handed to the "taskset" command. Except that this command has a "-c" parameter to take a comma/dash-separated list of CPU numbers. This commit therefore saves a few lines of awk by switching to a single-number CPU list. Signed-off-by: Paul E. McKenney commit de2909461c1a663ab6554493344271e1fad4ecb2 Author: Paul E. McKenney Date: Thu Jul 8 09:22:15 2021 -0700 rcutorture: Upgrade two-CPU scenarios to four CPUs There is no way to place the vCPUs in a two-CPU rcutorture scenario to get variable memory latency. This commit therefore upgrades the current two-CPU rcutorture scenarios to four CPUs. Signed-off-by: Paul E. McKenney commit bdf5ca12015310e1636771a7516b08b1c30c0e73 Author: Paul E. McKenney Date: Wed Jul 7 18:01:29 2021 -0700 torture: Make kvm-test-1-run-qemu.sh apply affinity This commit causes the kvm-test-1-run-qemu.sh script to check the TORTURE_AFFINITY environment variable and to add "taskset" commands to the qemu-cmd file. The first "taskset" command is applied only if the TORTURE_AFFINITY environment variable is a non-empty string, and this command pins the current scenario's guest OS to the specified CPUs. The second "taskset" command reports the guest OS's affinity in a new "qemu-affinity" file. Signed-off-by: Paul E. McKenney commit 8220a1184970b4ce983113cf48009fd8fea8c4a3 Author: Paul E. McKenney Date: Wed Jul 7 17:11:09 2021 -0700 torture: Don't redirect qemu-cmd comment lines Currently, kvm-test-1-run-qemu.sh applies redirection to each and every line of each qemu-cmd script. Only the first line (the only one that is not a bash comment) needs to be redirected. Although redirecting the comments is currently harmless, just adding to the comment, it is an accident waiting to happen. This commit therefore adjusts the "sed" command to redirect only the qemu-system* command itself. Signed-off-by: Paul E. McKenney commit cdeef67d8feddbfe230bd0b95379e0487651a0e0 Author: Paul E. McKenney Date: Wed Jul 7 15:49:40 2021 -0700 torture: Make kvm.sh select per-scenario affinity masks This commit causes kvm.sh to use the new kvm-assign-cpus.sh and kvm-get-cpus-script.sh scripts to create a TORTURE_AFFINITY environment variable containing either an empty string (for no affinity) or a list of CPUs to pin the scenario's vCPUs to. A later commit will make use of this information to actually pin the vCPUs. Signed-off-by: Paul E. McKenney commit 586e4d4193a653eef21f02b50dee89e2e4be208c Author: Paul E. McKenney Date: Fri Jul 9 17:53:27 2021 -0700 scftorture: Avoid NULL pointer exception on early exit When scftorture finds an error in the module parameters controlling the relative frequencies of smp_call_function*() variants, it takes an early exit. So early that it has not allocated memory to track the kthreads running the test, which results in a segfault. This commit therefore checks for the existence of the memory before attempting to stop the kthreads that would otherwise have been recorded in that non-existent memory. Signed-off-by: Paul E. McKenney commit 9b9a80677fd80bd531cb05bfe205a40a51955939 Author: Paul E. McKenney Date: Thu Jun 24 17:53:43 2021 -0700 scftorture: Add RPC-like IPI tests This commit adds the single_weight_rpc module parameter, which causes the IPI handler to awaken the IPI sender. In many scheduler configurations, this will result in an IPI back to the sender that is likely to be received at a time when the sender CPU is idle. The intent is to stress IPI reception during CPU busy-to-idle transitions. Signed-off-by: Paul E. McKenney commit af5f6e27d52cdb2cb3826df19a69a74e9d5eff5e Author: Paul E. McKenney Date: Wed Jun 2 16:04:11 2021 -0700 locktorture: Count lock readers Currently, the lock_is_read_held variable is bool, so that a reader sets it to true just after lock acquisition and then to false just before lock release. This works in a rough statistical sense, but can result in false negatives just after one of a pair of concurrent readers has released the lock. This approach does have low overhead, but at the expense of the setting to true potentially never leaving the reader's store buffer, thus resulting in an unconditional false negative. This commit therefore converts this variable to atomic_t and makes the reader use atomic_inc() just after acquisition and atomic_dec() just before release. This does increase overhead, but this increase is negligible compared to the 10-microsecond lock hold time. Signed-off-by: Paul E. McKenney commit 5b237d650eb8b0870b5d816fecc0be00237cbfff Author: Paul E. McKenney Date: Wed Jun 2 15:51:48 2021 -0700 locktorture: Mark statistics data races The lock_stress_stats structure's ->n_lock_fail and ->n_lock_acquired fields are incremented and sampled locklessly using plain C-language statements, which KCSAN objects to. This commit therefore marks the statistics gathering with data_race() to flag the intent. While in the area, this commit also reduces the number of accesses to the ->n_lock_acquired field, thus eliminating some possible check/use confusion. Signed-off-by: Paul E. McKenney commit 811192c5f24bfd7246ce9ce06f668d8c408bf39b Author: Jiangong.Han Date: Tue Jun 22 18:37:08 2021 +0800 rcuscale: Console output claims too few grace periods The rcuscale console output claims N grace periods, numbered from zero to N, which means that there were really N+1 grace periods. The root cause of this bug is that rcu_scale_writer() stores the number of the last grace period (numbered from zero) into writer_n_durations[me] instead of the number of grace periods. This commit therefore assigns the actual number of grace periods to writer_n_durations[me], and also makes the corresponding adjustment to the loop outputting per-grace-period measurements. Sample of old console output: rcu-scale: writer 0 gps: 133 ...... rcu-scale: 0 writer-duration: 0 44003961 rcu-scale: 0 writer-duration: 1 32003582 ...... rcu-scale: 0 writer-duration: 132 28004391 rcu-scale: 0 writer-duration: 133 27996410 Sample of new console output: rcu-scale: writer 0 gps: 134 ...... rcu-scale: 0 writer-duration: 0 44003961 rcu-scale: 0 writer-duration: 1 32003582 ...... rcu-scale: 0 writer-duration: 132 28004391 rcu-scale: 0 writer-duration: 133 27996410 Signed-off-by: Jiangong.Han Signed-off-by: Paul E. McKenney commit 59e836662860a28880d45b35e1fbc5afca4847ce Author: Paul E. McKenney Date: Sun May 16 21:17:27 2021 -0700 rcutorture: Preempt rather than block when testing task stalls Currently, rcu_torture_stall() does a one-jiffy timed wait when stall_cpu_block is set. This works, but emits a pointless splat in CONFIG_PREEMPT=y kernels. This commit avoids this splat by instead invoking preempt_schedule() in CONFIG_PREEMPT=y kernels. This uses an admittedly ugly #ifdef, but abstracted approaches just looked worse. A prettier approach would provide a preempt_schedule() definition with a WARN_ON() for CONFIG_PREEMPT=n kernels, but this seems quite silly. Signed-off-by: Paul E. McKenney commit 25f6fa53a07422e2bb004229eefd32760c469fb0 Author: Paul E. McKenney Date: Mon May 3 17:04:57 2021 -0700 refscale: Add measurement of clock readout This commit adds a "clock" type to refscale, which checks the performance of ktime_get_real_fast_ns(). Use the "clocksource=" kernel boot parameter to select the underlying clock source. [ paulmck: Work around compiler false positive per kernel test robot. ] Signed-off-by: Paul E. McKenney commit 17fef808ed746972fa5849c6a162d740f41febd7 Author: Bjorn Andersson Date: Wed Jul 21 15:46:10 2021 -0700 clk: qcom: dispcc-sm8250: Add additional parent clocks for DP The clock controller has two additional clock source pairs, in order to support more than a single DisplayPort PHY. List these, so it's possible to describe them all. Also drop the unnecessary freq_tbl for the link clock sources, to allow these parents to be used. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210721224610.3035258-1-bjorn.andersson@linaro.org Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephen Boyd commit 05e9b4f60d31a03815a699be24226bf26b7021f9 Author: Juhee Kang Date: Tue Jul 27 04:10:56 2021 +0000 samples: bpf: Add the omitted xdp samples to .gitignore There are recently added xdp samples (xdp_redirect_map_multi and xdpsock_ctrl_proc) which are not managed by .gitignore. This commit adds these files to .gitignore. Signed-off-by: Juhee Kang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210727041056.23455-2-claudiajkang@gmail.com commit 7d07006f05922b95518be403f08ef8437b67aa32 Author: Juhee Kang Date: Tue Jul 27 04:10:55 2021 +0000 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210727041056.23455-1-claudiajkang@gmail.com commit 441decf91ef01bf2d62f893c33f7ab7d654c5aa1 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:19 2021 +0800 clk: mediatek: Add MT8192 vencsys clock support Add MT8192 vencsys clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-22-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 25f3d97e39a58fd7f057ce3da787adaf9239484a Author: Chun-Jie Chen Date: Mon Jul 26 18:57:18 2021 +0800 clk: mediatek: Add MT8192 vdecsys clock support Add MT8192 vdecsys and vdecsys soc clock providers Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-21-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit aff125adc00c80d59c3ebd71fc17242e65b37b76 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:17 2021 +0800 clk: mediatek: Add MT8192 scp adsp clock support Add MT8192 scp adsp clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-20-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit a1a5b6b0a840dbcd4baa0e775489a52d1e9c2156 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:16 2021 +0800 clk: mediatek: Add MT8192 msdc clock support Add MT8192 msdc and msdc top clock providers Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-19-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 9d44859bfe1fc118012fe24033003d1be92bd05b Author: Chun-Jie Chen Date: Mon Jul 26 18:57:15 2021 +0800 clk: mediatek: Add MT8192 mmsys clock support Add MT8192 mmsys clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20210726105719.15793-18-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 34e1b85549455ec95c46b140526db00447983986 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:14 2021 +0800 clk: mediatek: Add MT8192 mfgcfg clock support Add MT8192 mfgcfg clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-17-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit b565d41f8c2fbdf4d609dfeb4e055b717c8b79cd Author: Chun-Jie Chen Date: Mon Jul 26 18:57:13 2021 +0800 clk: mediatek: Add MT8192 mdpsys clock support Add MT8192 mdpsys clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-16-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 7f621d25d9b88e777f3c4dbfe41e58458219a5d0 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:12 2021 +0800 clk: mediatek: Add MT8192 ipesys clock support Add MT8192 ipesys clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-15-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 71193c46bdbd82f89214407c5943b2decfb0ab6f Author: Chun-Jie Chen Date: Mon Jul 26 18:57:11 2021 +0800 clk: mediatek: Add MT8192 imp i2c wrapper clock support Add MT8192 imp i2c wrapper clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-14-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 014a4881a23f31d245d65df1c6ee5a39c6c05504 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:10 2021 +0800 clk: mediatek: Add MT8192 imgsys clock support Add MT8192 imgsys and imgsys2 clock providers Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-13-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit cebef18833e2db7f65a6c6bc436bd057807e94ee Author: Chun-Jie Chen Date: Mon Jul 26 18:57:09 2021 +0800 clk: mediatek: Add MT8192 camsys clock support Add MT8192 camsys and camsys raw clock providers Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-12-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit f61e83488df777e570acf7ba1e1ca5024aef6611 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:08 2021 +0800 clk: mediatek: Add MT8192 audio clock support Add MT8192 audio clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-11-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit 710573dee31b4ca34abeb384c6e3db499c0af65f Author: Chun-Jie Chen Date: Mon Jul 26 18:57:07 2021 +0800 clk: mediatek: Add MT8192 basic clocks support Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg. Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-10-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit c58cd0e40ffac67961b945793876b973728f9b80 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:06 2021 +0800 clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers Most of subsystem clock providers only need to register clock gates in their probe() function. To reduce the duplicated code by add a generic function. Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-9-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit f384c44754b7de2eceb0789a8837a11b0a80cdba Author: Chun-Jie Chen Date: Mon Jul 26 18:57:05 2021 +0800 clk: mediatek: Add configurable enable control to mtk_pll_data In all MediaTek PLL design, bit0 of CON0 register is always the enable bit. However, there's a special case of usbpll on MT8192. The enable bit of usbpll is moved to bit2 of other register. Add configurable en_reg and pll_en_bit for enable control or default 0 where pll data are static variables. Hence, CON0_BASE_EN could also be removed. And there might have another special case on other chips, the enable bit is still on CON0 register but not at bit0. Reviewed-by: Ikjoon Jang Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-8-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 7cc4e1bbe300c5cf610ece8eca6c6751b8bc74db Author: Chun-Jie Chen Date: Mon Jul 26 18:57:04 2021 +0800 clk: mediatek: Fix asymmetrical PLL enable and disable control In fact, the en_mask is a combination of divider enable mask and pll enable bit(bit0). Before this patch, we enabled both divider mask and bit0 in prepare(), but only cleared the bit0 in unprepare(). In the future, we hope en_mask will only be used as divider enable mask. The enable register(CON0) will be set in 2 steps: first is divider mask, and then bit0 during prepare(), and vice versa. But considering backward compatibility, at this stage we allow en_mask to be a combination or a pure divider enable mask. And then we will make en_mask a pure divider enable mask in another following patch series. Reviewed-by: Ikjoon Jang Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-7-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 197ee5436be5e4c8b55d7d0f449db8c8a81d22b3 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:03 2021 +0800 clk: mediatek: Get regmap without syscon compatible check Not all clock providers need to be marked compatible with "syscon" for system configuration usage, so use device_node_to_regmap() to skip "syscon" check. Signed-off-by: Chun-Jie Chen Link: https://lore.kernel.org/r/20210726105719.15793-6-chun-jie.chen@mediatek.com Reviewed-by: Ikjoon Jang Signed-off-by: Stephen Boyd commit f35f1a23e0e12e3173e9e9dedbc150d139027189 Author: Chun-Jie Chen Date: Mon Jul 26 18:57:02 2021 +0800 clk: mediatek: Add dt-bindings of MT8192 clocks Add MT8192 clock dt-bindings, include topckgen, apmixedsys, infracfg, pericfg and subsystem clocks. Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210726105719.15793-5-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 4af2f62d6fc65e08ca604fab7d7e3beabd927d0d Author: Chun-Jie Chen Date: Mon Jul 26 18:57:01 2021 +0800 dt-bindings: ARM: Mediatek: Add audsys document binding for MT8192 This patch adds the audsys document binding for MT8192 SoC. Signed-off-by: Chun-Jie Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210726105719.15793-4-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit d18eb76bbd6998d57ca647bb0561e10afa404eef Author: Chun-Jie Chen Date: Mon Jul 26 18:57:00 2021 +0800 dt-bindings: ARM: Mediatek: Add mmsys document binding for MT8192 This patch adds the mmsys document binding for MT8192 SoC. Signed-off-by: Chun-Jie Chen Reviewed-by: Chun-Kuang Hu Reviewed-by: Matthias Brugger Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210726105719.15793-3-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 4a803990aeb1582d32e7661e57863cc189a15446 Author: Chun-Jie Chen Date: Mon Jul 26 18:56:59 2021 +0800 dt-bindings: ARM: Mediatek: Add new document bindings of MT8192 clock This patch adds the new binding documentation for system clock and functional clock on Mediatek MT8192. Signed-off-by: Chun-Jie Chen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210726105719.15793-2-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 42b6b10a54f0bf00397511fc6d5b8a296b405563 Author: Peter Collingbourne Date: Thu Jul 8 19:35:32 2021 -0700 arm64: mte: avoid TFSRE0_EL1 related operations unless in async mode There is no reason to touch TFSRE0_EL1 nor issue a DSB unless our task is in asynchronous mode. Since these operations (especially the DSB) may be expensive on certain microarchitectures, only perform them if necessary. Furthermore, stop clearing TFSRE0_EL1 on entry because it will be cleared on exit and it is not necessary to have any particular value in TFSRE0_EL1 between entry and exit. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/Ib353a63e3d0abc2b0b008e96aa2d9692cfc1b815 Link: https://lore.kernel.org/r/20210709023532.2133673-1-pcc@google.com Signed-off-by: Catalin Marinas commit 9bb3a9dddbf1ca6e062464f790a6a18052d63a4a Author: Moritz Fischer Date: Sun Jul 25 20:08:06 2021 -0700 fpga: versal-fpga: Remove empty functions Since the core framework now wraps the functions, ensuring drives only have to implement functions that do something, drop the now no longer required callbacks for state and write_complete. Signed-off-by: Moritz Fischer Link: https://lore.kernel.org/r/20210726030806.714809-1-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman commit c3328c5e644a5d027ecd75878aaa253e5fb417bc Merge: 71e69d7adee10 630211a17055b Author: Greg Kroah-Hartman Date: Tue Jul 27 18:44:33 2021 +0200 Merge tag 'fpga-for-5.15-early' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager Changes for 5.15-rc1 FPGA Manager - Navin's change removes a duplicate word in a comment - Tom's change fixes a spelling mistake - Mauro's change fixes up documentation - Tom's second set adds wrappers to allow drivers not having to implement empty functions by moving checks into fpga-mgr core code - My changes address a bunch of warnings DFL - Martin's change adds a new PCI ID for Silicom N501x PAC cards All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of my for-next branch). I did get a complaint about one of the commit messages w/ a Fixes: tags which has been addressed. Signed-offy-by: Moritz Fischer * tag 'fpga-for-5.15-early' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: fpga-mgr: wrap the write_sg() op fpga: fpga-mgr: wrap the fpga_remove() op fpga: fpga-mgr: wrap the state() op fpga: fpga-mgr: wrap the status() op fpga: fpga-mgr: wrap the write() op fpga: fpga-mgr: make write_complete() op optional fpga: fpga-mgr: wrap the write_init() op fpga: zynqmp-fpga: Address warning about unused variable fpga: xilinx-pr-decoupler: Address warning about unused variable fpga: xiilnx-spi: Address warning about unused variable fpga: altera-freeze-bridge: Address warning about unused variable fpga: dfl: pci: add device IDs for Silicom N501x PAC cards fpga: fpga-bridge: removed repeated word fpga: fix spelling mistakes docs: driver-api: fpga: avoid using UTF-8 chars commit b30eda8d416c8b880b8bd0d422a798c526c549a6 Author: Wyatt Wood Date: Mon Jul 12 12:30:50 2021 -0400 drm/amd/display: Add ETW log to dmub_psr_get_state [Why] GPINT commands have the lowest priority in DMCUB, so it's possible that the command isn't processed in time. [How] Add a log to help identify this case. Reviewed-by: Koo Anthony Acked-by: Solomon Chiu Signed-off-by: Wyatt Wood Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b2abb05364f777cd5cf27594622adde4acc71988 Author: Wyatt Wood Date: Mon Jul 12 12:12:48 2021 -0400 drm/amd/display: Add ETW logging for AUX failures [Why] Would like to identify the cause of AUX transactions failing via ETW logs. [How] Add ETW logging for AUX failures. Reviewed-by: Pavic Josip Acked-by: Solomon Chiu Signed-off-by: Wyatt Wood Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit af1f2b19fd7d404d299355cc95930efee5b3ed8b Author: Mikita Lipski Date: Wed Jul 14 06:41:13 2021 -0400 drm/amd/display: Fix PSR command version [why] For dual eDP when setting the new settings we need to set command version to DMUB_CMD_PSR_CONTROL_VERSION_1, otherwise DMUB will not read panel_inst parameter. [how] Instead of PSR_VERSION_1 pass DMUB_CMD_PSR_CONTROL_VERSION_1 Reviewed-by: Wood Wyatt Acked-by: Solomon Chiu Signed-off-by: Mikita Lipski Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e088068dc9a5e0276cccdeaee6552af80c543e6a Author: Victor Lu Date: Tue Jul 6 15:45:11 2021 -0400 drm/amd/display: Add missing DCN21 IP parameter [why] IP parameter min_meta_chunk_size_bytes is read for bandwidth calculations but it was never defined. [how] Define min_meta_chunk_size_bytes and initialize value to 256. Reviewed-by: Laktyushkin Dmytro Acked-by: Solomon Chiu Signed-off-by: Victor Lu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e868f0a3c4b9c1d7721f08b703142a876814a3f8 Author: Sumit Garg Date: Mon Jul 12 19:16:20 2021 +0530 kdb: Rename members of struct kdbtab_t Remove redundant prefix "cmd_" from name of members in struct kdbtab_t for better readibility. Suggested-by: Doug Anderson Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210712134620.276667-5-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit 9a5db530aa7d98b10c4f5104027565c98cca49e6 Author: Sumit Garg Date: Mon Jul 12 19:16:19 2021 +0530 kdb: Simplify kdb_defcmd macro logic Switch to use a linked list instead of dynamic array which makes allocation of kdb macro and traversing the kdb macro commands list simpler. Suggested-by: Daniel Thompson Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210712134620.276667-4-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit d0260f62eeeb4646af7449006452decfed202fd7 Author: Pratik Vishwakarma Date: Mon Jul 26 13:54:25 2021 +0530 drm/amdgpu: Rename amdgpu_acpi_is_s0ix_supported Rename amdgpu_acpi_is_s0ix_supported to better explain functionality by renaming to amdgpu_acpi_is_s0ix_active Signed-off-by: Pratik Vishwakarma Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9857bb9457fe57248719750cf0f432dce155711f Author: Victor Lu Date: Thu Jul 8 14:50:48 2021 -0400 drm/amd/display: Guard DST_Y_PREFETCH register overflow in DCN21 [why] DST_Y_PREFETCH can overflow when DestinationLinesForPrefetch values are too large due to the former being limited to 8 bits. [how] Set the maximum value of DestinationLinesForPrefetch to be 255 * refclk period. Reviewed-by: Laktyushkin Dmytro Acked-by: Solomon Chiu Signed-off-by: Victor Lu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 91b03fc6b50c7233da3b22f8be6e143f89b2d839 Author: Pratik Vishwakarma Date: Fri Jul 23 18:08:40 2021 +0530 drm/amdgpu: Check pmops for desired suspend state [Why] User might change the suspend behaviour from OS. [How] Check with pm for target suspend state and set s0ix flag only for s2idle state. v2: User might change default suspend state, use target state v3: squash in build fix Suggested-by: Lijo Lazar Signed-off-by: Pratik Vishwakarma Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c25abcd625505f53b72dc156bac32b5120826742 Author: Sumit Garg Date: Mon Jul 12 19:16:18 2021 +0530 kdb: Get rid of redundant kdb_register_flags() Commit e4f291b3f7bb ("kdb: Simplify kdb commands registration") allowed registration of pre-allocated kdb commands with pointer to struct kdbtab_t. Lets switch other users as well to register pre- allocated kdb commands via: - Changing prototype for kdb_register() to pass a pointer to struct kdbtab_t instead. - Embed kdbtab_t structure in kdb_macro_t rather than individual params. With these changes kdb_register_flags() becomes redundant and hence removed. Also, since we have switched all users to register pre-allocated commands, "is_dynamic" flag in struct kdbtab_t becomes redundant and hence removed as well. Suggested-by: Daniel Thompson Signed-off-by: Sumit Garg Acked-by: Steven Rostedt (VMware) Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210712134620.276667-3-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit b39cded834154cf54442489b56b33d047edd6d8f Author: Sumit Garg Date: Mon Jul 12 19:16:17 2021 +0530 kdb: Rename struct defcmd_set to struct kdb_macro Rename struct defcmd_set to struct kdb_macro as that sounds more appropriate given its purpose. Suggested-by: Daniel Thompson Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210712134620.276667-2-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit 833d14a4bf83b9be89e407b8d99b462172fe0a40 Author: Geert Uytterhoeven Date: Tue Jul 27 15:47:30 2021 +0200 video: fbdev: ssd1307fb: Cache address ranges Cache the column and page ranges, to avoid doing unneeded I2C transfers when the values haven't changed. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-6-geert@linux-m68k.org commit 251e48a1db758ad7151e2dce146e63d9f4baf94b Author: Geert Uytterhoeven Date: Tue Jul 27 15:47:29 2021 +0200 video: fbdev: ssd1307fb: Optimize screen updates Currently, each screen update triggers an I2C transfer of all screen data, up to 1 KiB of data for a 128x64 display, which takes at least 20 ms in Fast mode. Reduce the amount of transferred data by only updating the rectangle that changed. Remove the calls to ssd1307fb_set_col_range() and ssd1307fb_set_page_range() during initialization, as ssd1307fb_update_rect() now takes care of that. Note that for now the optimized operation is only used for fillrect, copyarea, and imageblit, which are used by fbcon. Signed-off-by: Geert Uytterhoeven Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-5-geert@linux-m68k.org commit 8a15af3b86f497109dc3a6646eb029d1f934684d Author: Geert Uytterhoeven Date: Tue Jul 27 15:47:28 2021 +0200 video: fbdev: ssd1307fb: Extract ssd1307fb_set_{col,page}_range() Extract the code to set the column and page ranges into two helper functions. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-4-geert@linux-m68k.org commit ef9d793825b56ec4289d2b848c9318352fa2cd13 Author: Geert Uytterhoeven Date: Tue Jul 27 15:47:27 2021 +0200 video: fbdev: ssd1307fb: Simplify ssd1307fb_update_display() Simplify the nested loops to handle conversion from linear frame buffer to ssd1307 page layout: 1. Move last page handling one level up, as the value of "m" is the same inside a page, 2. array->data[] is filled linearly, so there is no need to recalculate array_idx over and over again; a simple increment is sufficient. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-3-geert@linux-m68k.org commit 7b4b3733fd68d986c3f790e47aa6116d229e949e Author: Geert Uytterhoeven Date: Tue Jul 27 15:47:26 2021 +0200 video: fbdev: ssd1307fb: Propagate errors via ssd1307fb_update_display() Make ssd1307fb_update_display() return an error code, so callers that can handle failures can propagate it. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-2-geert@linux-m68k.org commit 6b809c19d4ff6756e73b21f7f6cb4babca53d144 Merge: 37108ef45ae90 9bdc573d84d8f Author: Mark Brown Date: Tue Jul 27 16:14:20 2021 +0100 Merge series "ASoC: soc-pcm: cleanup cppcheck warning" from Kuninori Morimoto : Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-pcm. Kuninori Morimoto (5): ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb() ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close() ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture() ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active() ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan() sound/soc/soc-pcm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.25.1 Thank you for your help !! Best regards --- Kuninori Morimoto commit 72d609dad0876dc7dff1d5cc7a2716e3f76f8981 Author: Codrin Ciubotariu Date: Tue Jul 27 16:41:15 2021 +0300 ARM: dts: at91: sama5d2_icp: enable digital filter for I2C nodes SAMA5D2's I2C controller supports digital filter, so let's enable it. Signed-off-by: Codrin Ciubotariu Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210727134115.1353494-1-codrin.ciubotariu@microchip.com commit 5c872e1d25958aaa9102c57ab8bc4ca591b0e363 Author: Mauro Carvalho Chehab Date: Sat Jul 24 10:41:45 2021 +0200 dt-bindings: hisilicon,hi6421-spmi-pmic.yaml: make some rules stricter Define maxItems for interrupts and accept only "ldo" in lower case. Reviewed-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/b7a775808d9c3a87fbe1c5a6dd71f8f18be7e649.1627116034.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit cbbdb3fe0d974d655c87c3e6ba2990d5496b9f82 Author: Rui Miguel Silva Date: Tue Jul 27 11:05:16 2021 +0100 usb: isp1760: rework cache initialization error handling If we fail to create qtd cache we were not destroying the urb_listitem, rework the error handling logic to cope with that. Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210727100516.4190681-4-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 41f673183862a183d4ea0522c045fabfbd1b28c8 Author: Rui Miguel Silva Date: Tue Jul 27 11:05:15 2021 +0100 usb: isp1760: do not sleep in field register poll When polling for a setup or clear of a register field we were sleeping in atomic context but using a very tight sleep interval. Since the use cases for this poll mechanism are only in setup and stop paths, and in practice this poll is not used most of the times but needs to be there to comply to hardware setup times, remove the sleep time and make the poll loop tighter. Reported-by: Dan Carpenter Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210727100516.4190681-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7de14c88272c05d86fce83a5cead36832ce3a424 Author: Rui Miguel Silva Date: Tue Jul 27 11:05:14 2021 +0100 usb: isp1760: remove debug message as error Remove debug message leftover from the boot error buffer. Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210727100516.4190681-2-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman commit f72999f51da1ae39e59e08ed8658e7a470d6fee5 Author: Fabien Parent Date: Wed May 19 18:18:45 2021 +0200 dt-bindings: arm: mediatek: mmsys: add MT8365 SoC binding Add the MMSYS binding documentation for the MT8365 SoC. Signed-off-by: Fabien Parent Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210519161847.3747352-2-fparent@baylibre.com commit cba3c40d1f97adc89537f6b26b66182a23280ce3 Author: Fabien Parent Date: Wed May 19 18:18:44 2021 +0200 dt-bindings: arm: mediatek: mmsys: convert to YAML format Convert the mmsys bindings to the YAML format. Signed-off-by: Fabien Parent Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210519161847.3747352-1-fparent@baylibre.com commit 61aaaa8110b1207cd70313e219cd8d2ed843b8e3 Author: Rob Herring Date: Tue Jul 20 11:20:25 2021 -0600 dt-bindings: Remove "status" from schema examples There's no reason to have "status" properties in examples. "okay" is the default, and "disabled" turns off some schema checks ('required' specifically). Enabling qca,ar71xx causes a warning, so let's fix the node names: Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: phy@3: '#phy-cells' is a required property From schema: schemas/phy/phy-provider.yaml Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Thierry Reding Cc: Sam Ravnborg Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Robert Marko Cc: Alessandro Zummo Cc: Ramesh Shanmugasundaram Cc: "G. Jaya Kumaran" Cc: ChiYuan Huang Cc: Wei Xu Cc: Dilip Kota Cc: Karol Gugala Cc: Mateusz Holenko Cc: Olivier Moysan Cc: Peter Ujfalusi Cc: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Rob Herring Reviewed-by: Rui Miguel Silva Reviewed-by: Linus Walleij Reviewed-by: Laurent Pinchart Reviewed-by: Mauro Carvalho Chehab # For media Acked-by: Mark Brown Acked-by: Alexandre Belloni Reviewed-by: Oleksij Rempel Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/20210720172025.363238-1-robh@kernel.org commit b4db237e1e23489fdde1fb195e687b50d0ec162f Author: Rob Herring Date: Mon Jul 19 13:50:01 2021 -0600 dt-bindings: display: Fix graph 'unevaluatedProperties' related warnings The graph schema doesn't allow custom properties on endpoint nodes for '#/properties/port' and '#/$defs/port-base' should be used instead. This doesn't matter until 'unevaluatedProperties' support is implemented. Cc: David Airlie Cc: Daniel Vetter Cc: Rob Clark Cc: Sean Paul Cc: Marek Vasut Cc: Krishna Manikandan Cc: dri-devel@lists.freedesktop.org Signed-off-by: Rob Herring Acked-by: Sam Ravnborg Link: https://lore.kernel.org/r/20210719195001.2412345-1-robh@kernel.org commit db60b87e5f11ca8de81724262fb5c1789e577aa0 Author: Rob Herring Date: Mon Jul 19 13:48:50 2021 -0600 dt-bindings: media: Fix graph 'unevaluatedProperties' related warnings The graph schema doesn't allow custom properties on endpoint nodes for '#/properties/port' and '#/$defs/port-base' should be used instead. This doesn't matter until 'unevaluatedProperties' support is implemented. Cc: Eugen Hristev Cc: Mauro Carvalho Chehab Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Fabrizio Castro Cc: Ramesh Shanmugasundaram Cc: linux-media@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210719194850.2410511-1-robh@kernel.org commit 732b33d0dbf17e9483f0b50385bf606f724f50a2 Author: Harshvardhan Jha Date: Tue Jul 27 05:37:10 2021 +0530 9p/xen: Fix end of loop tests for list_for_each_entry This patch addresses the following problems: - priv can never be NULL, so this part of the check is useless - if the loop ran through the whole list, priv->client is invalid and it is more appropriate and sufficient to check for the end of list_for_each_entry loop condition. Link: http://lkml.kernel.org/r/20210727000709.225032-1-harshvardhan.jha@oracle.com Signed-off-by: Harshvardhan Jha Reviewed-by: Stefano Stabellini Tested-by: Stefano Stabellini Cc: Signed-off-by: Dominique Martinet commit f997ea3b7afc108eb9761f321b57de2d089c7c48 Author: Xie Yongji Date: Mon May 17 16:35:57 2021 +0800 9p/trans_virtio: Remove sysfs file on probe failure This ensures we don't leak the sysfs file if we failed to allocate chan->vc_wq during probe. Link: http://lkml.kernel.org/r/20210517083557.172-1-xieyongji@bytedance.com Fixes: 86c8437383ac ("net/9p: Add sysfs mount_tag file for virtio 9P device") Signed-off-by: Xie Yongji Signed-off-by: Dominique Martinet commit 4356ad83792fe1633b8645f68cd4eefafca079a7 Author: Maxime Ripard Date: Wed Jul 21 16:04:07 2021 +0200 dt-bindings: usb: ohci: Add Allwinner A83t compatible The A83t OHCI compatible was introduced in device trees, but it was never documented. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-38-maxime@cerno.tech Signed-off-by: Greg Kroah-Hartman commit 39c0bf564eadbc4cb84e1c81cdd215f33b383a91 Author: Maxime Ripard Date: Wed Jul 21 16:04:06 2021 +0200 dt-bindings: usb: ehci: Add Allwinner A83t compatible The A83t EHCI compatible was introduced in device trees, but it was never documented. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-37-maxime@cerno.tech Signed-off-by: Greg Kroah-Hartman commit fc78941d8169cba40e420eb24a88789b0406c738 Author: Michael Grzeschik Date: Mon Jun 28 17:53:11 2021 +0200 usb: gadget: uvc: decrease the interrupt load to a quarter With usb3 we handle many more requests. Decrease the interrupt load by only enabling the interrupt every quarter of the allocated requests. Reviewed-by: Paul Elder Signed-off-by: Michael Grzeschik -- v1 -> v2: - edited patch description - removed extra parantheses - added a comment for the logic - using unsigned int instead of int - reinitializing req_int_count in uvcg_video_enable v2 -> v3: - Link: https://lore.kernel.org/r/20210628155311.16762-6-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e81e7f9a0eb9536d5976acf5d95290338032a198 Author: Michael Grzeschik Date: Mon Jun 28 17:53:10 2021 +0200 usb: gadget: uvc: add scatter gather support This patch adds support for scatter gather transfers. If the underlying gadgets sg_supported == true, then the videeobuf2-dma-sg is used and the encode routine maps all scatter entries to separate scatterlists for the usb gadget. When streaming 1080p with request size of 1024 times 3 bytes top shows a difference of about 6.4% CPU load applying this patch: PID USER PR NI VIRT RES %CPU %MEM TIME+ S COMMAND 64 root 0 -20 0.0m 0.0m 7.7 0.0 0:01.25 I [kworker/u5:0-uvcvideo] 83 root 0 -20 0.0m 0.0m 4.5 0.0 0:03.71 I [kworker/u5:3-uvcvideo] 307 root -51 0 0.0m 0.0m 3.8 0.0 0:01.05 S [irq/51-dwc3] vs. 64 root 0 -20 0.0m 0.0m 5.8 0.0 0:01.79 I [kworker/u5:0-uvcvideo] 306 root -51 0 0.0m 0.0m 3.2 0.0 0:01.97 S [irq/51-dwc3] 82 root 0 -20 0.0m 0.0m 0.6 0.0 0:01.86 I [kworker/u5:1-uvcvideo] Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20210628155311.16762-5-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b9b82d3d0dbc45ee6b4817c7a7275a65152301f5 Author: Michael Grzeschik Date: Mon Jun 28 17:53:09 2021 +0200 usb: gadget: uvc: set v4l2_dev->dev in f_uvc The v4l2_dev has no corresponding device to it. We will point it to the gadget's dev. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20210628155311.16762-4-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9973772dbb2b9c12a0707eca692f0dabf6295978 Author: Michael Grzeschik Date: Mon Jun 28 17:53:08 2021 +0200 usb: gadget: uvc: make uvc_num_requests depend on gadget speed While sending bigger images is possible with USB_SPEED_SUPER it is better to use more isochronous requests in flight. This patch makes the number uvc_num_requests dynamic by changing it depending on the gadget speed. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20210628155311.16762-3-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit c6e23b89a95db73bb85be28079664c66389323f0 Author: Michael Grzeschik Date: Mon Jun 28 17:53:07 2021 +0200 usb: dwc3: gadget: set gadgets parent to the right controller In case of dwc3 it is possible that the sysdev is the parent of the controller. To ensure the right dev is set to the gadget's dev parent we will hand over sysdev instead of dev, which will always point to the controller. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20210628155311.16762-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6b587394c65c23d5ba05a33e5899e2ed8dab3c97 Author: Chunfeng Yun Date: Thu Jul 15 17:07:58 2021 +0800 usb: mtu3: support suspend/resume for dual-role mode Support suspend/resume for dual-role mode including the single port and multi-ports supported by host controller, when the host supports mult-ports, only port0 (u2/u3) is used to support dual role mode. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-14-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 427c66422e14b8468ee005aa6edf76ef0c2a8fc2 Author: Chunfeng Yun Date: Thu Jul 15 17:07:57 2021 +0800 usb: mtu3: support suspend/resume for device mode Support suspend/resume for device mode if the device is not connected with a host, otherwise reject to suspend. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-13-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 6244831543ec269f40ed9032bb8194c089049718 Author: Chunfeng Yun Date: Thu Jul 15 17:07:56 2021 +0800 usb: mtu3: add helper to power on/down device Add helper to power on/down device ports and ip, it will be used when support device suspend/resume Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-12-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit fa6f59e28c6197150d9aa94f0d617b59090691e5 Author: Chunfeng Yun Date: Thu Jul 15 17:07:55 2021 +0800 usb: mtu3: support runtime PM for host mode Use a dedicated wakeup irq for runtime suspend/resume, and interrupts names are provided if using wakeup irq, this patch only support host mode. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-11-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 0609c1aa10de07b8828cac88bf26140ec1a56a51 Author: Chunfeng Yun Date: Thu Jul 15 17:07:54 2021 +0800 usb: mtu3: add new helpers for host suspend/resume Extract two helpers for host suspend and resume, will make it easy to support dual-role mode suspend/resume later. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-10-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit d7e127242816e06981840880eead898197a3257b Author: Chunfeng Yun Date: Thu Jul 15 17:07:53 2021 +0800 usb: mtu3: support option to disable usb2 ports Add support to disable specific usb2 host ports, it's useful when a usb2 port is disabled on some platforms, but enabled on others for the same SoC. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-9-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 88c6b90188d8ebade3f5b1f80b51aa64e55de27e Author: Chunfeng Yun Date: Thu Jul 15 17:07:52 2021 +0800 usb: mtu3: support property role-switch-default-mode Support default mode config when use usb-role-switch Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-8-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 26f94fe8e739641e96c50f70eb6e78ef1693d9ca Author: Chunfeng Yun Date: Thu Jul 15 17:07:51 2021 +0800 usb: dwc3: drd: use helper to get role-switch-default-mode Use the new helper usb_get_role_switch_default_mode() to get property of "role-switch-default-mode" Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-7-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 2037f2991ddedded1ef4aaabe4caf11e306158dc Author: Chunfeng Yun Date: Thu Jul 15 17:07:50 2021 +0800 usb: common: add helper to get role-switch-default-mode Add helper to get "role-switch-default-mode", and convert it to the corresponding enum usb_dr_mode Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-6-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 72c1b91f5de3cedfefa1921bc3987eced2868bd7 Author: Chunfeng Yun Date: Thu Jul 15 17:07:49 2021 +0800 dt-bindings: usb: mtu3: add wakeup interrupt Add an dedicated interrupt which is usually EINT to support runtime PM, meanwhile add "interrupt-names" property, for backward compatibility, it's optional and used when wakeup interrupt exists Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 0b44e4ec285275418311424e1163ea490f32dd45 Author: Chunfeng Yun Date: Thu Jul 15 17:07:48 2021 +0800 dt-bindings: usb: mtu3: add support property role-switch-default-mode Add support optional property of role-switch-default-mode, used to set default mode while usb role is USB_ROLE_NONE when use usb-role-switch to switch mode. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 88302047803bc16cd614a587fee653450e7b5de6 Author: Chunfeng Yun Date: Thu Jul 15 17:07:47 2021 +0800 dt-bindings: usb: mtu3: add optional property to disable usb2 ports Add support to disable specific usb2 host ports, it's useful when a usb2 port is disabled on some platforms, but enabled on others for the same SoC, another case is that the different package may support different number of ports. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit a71786d7f519a97fa79cd9e020015b2dee788889 Author: Chunfeng Yun Date: Thu Jul 15 17:07:46 2021 +0800 dt-bindings: usb: mtu3: remove support VBUS detection of extcon Due to no platforms use a multi-funtion pin to detect VBUS status until now when support dual role mode, prefer not to support it anymore; Another reason is that the controller doesn't support idle status, the dual role port works as device or as host, using an IDDIG pin is good enough, this will help to save another multi-function pin; And fix a typo of 'neede'; Last modify example using VBUS to turn on/off device, for device only mode, the driver doesn't get extcon. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1626340078-29111-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit bee08559701fb98b43d7061717e7c3131230aa69 Author: Biju Das Date: Mon Jul 19 13:19:32 2021 +0100 reset: renesas: Add RZ/G2L usbphy control driver Add support for RZ/G2L USBPHY Control driver. It mainly controls reset and power down of the USB/PHY. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210719121938.6532-5-biju.das.jz@bp.renesas.com Signed-off-by: Philipp Zabel commit 18931afe5b4fb7f91da43043c867e504e742a781 Author: Biju Das Date: Mon Jul 19 13:19:31 2021 +0100 dt-bindings: reset: Document RZ/G2L USBPHY Control bindings Add device tree binding document for RZ/G2L USBPHY Control Device. It mainly controls reset and power down of the USB/PHY. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210719121938.6532-4-biju.das.jz@bp.renesas.com Signed-off-by: Philipp Zabel commit 95f7f15461fa482a05237669507b4c9b06865b73 Author: Sumit Garg Date: Wed Jul 14 11:26:20 2021 +0530 kdb: Get rid of custom debug heap allocator Currently the only user for debug heap is kdbnearsym() which can be modified to rather use statically allocated buffer for symbol name as per it's current usage. So do that and hence remove custom debug heap allocator. Note that this change puts a restriction on kdbnearsym() callers to carefully use shared namebuf such that a caller should consume the symbol returned immediately prior to another call to fetch a different symbol. Also, this change uses standard KSYM_NAME_LEN macro for namebuf allocation instead of local variable: knt1_size which should avoid any conflicts caused by changes to KSYM_NAME_LEN macro value. This change has been tested using kgdbtest on arm64 which doesn't show any regressions. Suggested-by: Daniel Thompson Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20210714055620.369915-1-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit c28d5d5688c6278a1ad32670cbee35802a9e65c1 Merge: 0e96454ca26cc fc7a6209d5710 Author: Vinod Koul Date: Tue Jul 27 19:12:14 2021 +0530 Merge tag 'bus_remove_return_void-5.15' into next This helps to remove conflict on idxd driver Conflicts: drivers/dma/idxd/sysfs.c drivers/dma/idxd/bus.c Greg says: Bus: Make remove callback return void tag Tag for other trees/branches to pull from in order to have a stable place to build off of if they want to add new busses for 5.15. Signed-off-by: Vinod Koul commit 39f9137268ee3df0047706df4e9b7357a40ffc98 Author: Benjamin Philip Date: Mon Jul 26 18:45:02 2021 +0530 staging: sm750fb: Rename maxW to max_w in lynx_cursor The struct lynx_cursor has a member named maxW. This name is CamelCase and is frowned upon. This commit renames it to max_w and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECK: CHECK: Avoid CamelCase: 115: FILE: drivers/staging/sm750fb/sm750.c:115: + if (fbcursor->image.width > cursor->maxW || Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/c0c84569b155df7b510a505a86863987836e192d.1627304144.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit cfdafb7608b4cf159aec510114be7a364347ca0f Author: Benjamin Philip Date: Mon Jul 26 18:45:01 2021 +0530 staging: sm750fb: Rename maxH to max_h in lynx_cursor The struct lynx_cursor has a member named maxH. This name is CamelCase and is frowned upon. This commit renames it to max_h and makes the necessary changes for the module to build. This change also fixes the following checkpatch CHECK: CHECK: Avoid CamelCase: 116: FILE: drivers/staging/sm750fb/sm750.c:116: + fbcursor->image.height > cursor->maxH || Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/692211000786d76aa41bc24d4ee06b5868d82771.1627304144.git.benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7b9148dcb74a004a4df10df3af9239a46dfc2b2f Author: Ojaswin Mujoo Date: Wed Jul 21 21:50:53 2021 +0530 staging: vchiq: Combine vchiq platform code into single file Combine the vchiq platform initialization code into a single file by merging vchiq_2835_arm.c into vchiq_arm.c Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/647cad50aa3306d1a49bacff76eaa3130fb363f4.1626882325.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2b5930fb3dc06d86149071f9dc8b6992cac1c3aa Author: Ojaswin Mujoo Date: Wed Jul 21 21:50:52 2021 +0530 staging: vchiq: Make creation of vchiq cdev optional Before this commit, vchiq cdev (/dev/vchiq) was always created during platform initialization. Introduce a new Kconfig option CONFIG_VCHIQ_CDEV which determines if the cdev will be created or not. Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/846c424dd4aae14d1cc28c8f30877a06e2b7dd10.1626882325.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit f05916281fd75db2fe32294e26c04d666c762370 Author: Ojaswin Mujoo Date: Wed Jul 21 21:50:51 2021 +0530 staging: vchiq: Move vchiq char driver to its own file Split the initialization code of vchiq char driver and device files from that of vchiq platform. The char driver code now resides in vchiq_dev.c and the platform code resides in the original vchiq_arm.c file. This commit focuses on separating the code into different files while maintaining the same functionality. It does not completely decouple them as the cdev init code is still called from the platform's vchiq_probe() function. Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/ed53690e217f631b746aad0585fccaa6fb1453c1.1626882325.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit c405028f471d6a7fd694cda34a9135345f80d88b Author: Ojaswin Mujoo Date: Wed Jul 21 21:50:50 2021 +0530 staging: vchiq: Move certain declarations to vchiq_arm.h Move certain declarations from vchiq_arm.c to vchiq_arm.h to allow code sharing. This will be useful when we eventually separate the vchiq char driver code from platform code, into its own file. Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/8abcbd9fb3227e2a78ccc4a1186c8c0801061a68.1626882325.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2a4d15a4ae98e27ed59a70c1c25483d24507171b Author: Ojaswin Mujoo Date: Wed Jul 21 21:50:49 2021 +0530 staging: vchiq: Refactor vchiq cdev code Move the vchiq cdev initialization code to its own function for better code organization. Call the initialization function during probe, thus shifting the whole cdev creation logic (which was earlier split in vchiq_probe() and vchiq_driver_init()) to vchiq_probe(). Reviewed-by: Stefan Wahren Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/c0e538eb0644292a52267d39edd85ab2af9f9a4e.1626882325.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman commit 050cbd980e6bc882b8c2a6e954ada48cbd5ce5c2 Author: Lucas Henneman Date: Fri Jul 23 10:43:40 2021 -0400 staging: vt6655: remove filename from upc.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for upc.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-15-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit ed0b62a568d13c8418a930bb4b36cbfc52f8f39b Author: Lucas Henneman Date: Fri Jul 23 10:43:39 2021 -0400 staging: vt6655: remove filename from mac.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for mac.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-14-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 290262b9198d9731e285315056ff4c087f6d92d4 Author: Lucas Henneman Date: Fri Jul 23 10:43:38 2021 -0400 staging: vt6655: kernel style cleanup of mac.c This patch removes from mac.c the file name and an ftrace-like pr_debug per checkpatch's two warnings. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-13-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 56bfb9bc6cd1e4e91ce4376018e361223b737353 Author: Lucas Henneman Date: Fri Jul 23 10:43:37 2021 -0400 staging: vt6655: remove filename from key.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for key.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-12-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 692b3e44b7afe2c3c348cd20edfa0a5336f13b54 Author: Lucas Henneman Date: Fri Jul 23 10:43:36 2021 -0400 staging: vt6655: remove filename from key.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for key.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-11-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 82bcc3174af2472c10d9feeef8ceea32d54d9ef3 Author: Lucas Henneman Date: Fri Jul 23 10:43:35 2021 -0400 staging: vt6655: remove filename from dpc.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for dpc.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-10-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit eee245f5d707f4be2c8592790f15128116a60c3e Author: Lucas Henneman Date: Fri Jul 23 10:43:34 2021 -0400 staging: vt6655: remove filename from dpc.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for dpc.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-9-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0e9e3f6170d633a26c3701eaf6a366ac65a1c4e7 Author: Lucas Henneman Date: Fri Jul 23 10:43:33 2021 -0400 staging: vt6655: remove filename from device_main.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for device_main.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-8-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit f0d52cd214984144ad9500b4a3feff21d6e403d8 Author: Lucas Henneman Date: Fri Jul 23 10:43:32 2021 -0400 staging: vt6655: remove filename from device_cfg.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for device_cfg.h, and adds an empty line after the top description comment to match the style of the other vt6655 files. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-7-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 646ce5315f5806d3ac04a47915e4a90ee7c7bd6b Author: Lucas Henneman Date: Fri Jul 23 10:43:31 2021 -0400 staging: vt6655: remove filename from channel.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for channel.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-6-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit ec32e0776f43f0965be2c9c6195d2871d129509f Author: Lucas Henneman Date: Fri Jul 23 10:43:30 2021 -0400 staging: vt6655: remove filename from channel.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for channel.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-5-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 065dddf31e5a45f67e6de1a18bd3353b4b216327 Author: Lucas Henneman Date: Fri Jul 23 10:43:29 2021 -0400 staging: vt6655: remove filename from card.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for card.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-4-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 51f42c766563061d935d5921f3c660bde45a60d1 Author: Lucas Henneman Date: Fri Jul 23 10:43:28 2021 -0400 staging: vt6655: remove filename from card.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for card.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-3-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit cae9546ac9f160573029dea6e6bec8d8aed471b8 Author: Lucas Henneman Date: Fri Jul 23 10:43:27 2021 -0400 staging: vt6655: remove filename from baseband.c This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for baseband.c. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-2-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 14127269cd516fac7c1711accededddf3f2c7ab3 Author: Lucas Henneman Date: Fri Jul 23 10:43:26 2021 -0400 staging: vt6655: remove filename from baseband.h This patch resolves checkpatch's warning, "It's generally not useful to have the filename in the file" for baseband.h. Signed-off-by: Lucas Henneman Link: https://lore.kernel.org/r/20210723144340.15787-1-lucas.henneman@linaro.org Signed-off-by: Greg Kroah-Hartman commit 246f920cb731950bea4501dc68ab2f8ad66e8b8d Author: Len Baker Date: Sun Jul 18 13:32:07 2021 +0200 staging/rtl8192u: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210718113207.10045-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 3c6675363de5aa168c23431cf90db455c1901b6e Author: Len Baker Date: Fri Jul 23 16:51:22 2021 +0200 staging/ks7010: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210723145122.5746-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit cf79ee6eb0d7d5f45ad58c395ee855e2e1bbc9b2 Author: Len Baker Date: Fri Jul 23 19:32:16 2021 +0200 staging/rtl8192e: Remove all strcpy() uses strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). It is also dangerous a strcpy() followed by a strcat(). In this case, refactor the code using scnprintf() and avoid this combination. Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210723173216.12157-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 36174650c4283c9bc1c6e63d3d835c824c7a2903 Author: Lukas Bulwahn Date: Tue Jul 27 11:31:54 2021 +0200 MAINTAINERS: remove section HISILICON STAGING DRIVERS FOR HIKEY 960/970 Commit 9bd9e0de1cf5 ("mfd: hi6421-spmi-pmic: move driver from staging") moves the last driver out of ./drivers/staging/hikey9xx/ and removes that directory, but missed to adjust the HISILICON STAGING DRIVERS FOR HIKEY 960/970 section in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: drivers/staging/hikey9xx/ As the directory ./drivers/staging/hikey9xx/ is gone, remove the section HISILICON STAGING DRIVERS FOR HIKEY 960/970 in MAINTAINERS as well. Acked-by: Mauro Carvalho Chehab Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20210727093154.553-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4fccfcfe7d5488a071665ea98f7c88b8ea3aa19 Author: Martin Kaiser Date: Sun Jul 25 17:59:02 2021 +0200 staging: rtl8188eu: remove unused IQKMatrixRegSetting array The IQKMatrixRegSetting array in struct odm_rf_cal is initialised but never used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-18-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5b2bd53d9041fe07ec97712aa9c0765f6a688e30 Author: Martin Kaiser Date: Sun Jul 25 17:59:01 2021 +0200 staging: rtl8188eu: simplify phy_lc_calibrate phy_lc_calibrate's is2t parameter is always false. Remove some code that would be called only for is2t == true. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-17-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b973e25ef6a8f2b7d9bbd0875530a586a0c67087 Author: Martin Kaiser Date: Sun Jul 25 17:59:00 2021 +0200 staging: rtl8188eu: simplify path_adda_on path_adda_on's is2t parameter is always false. Remove some code that would be called only for is2t == true. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-16-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a70a91b01db1ae821cd939152ffe2b613fb70404 Author: Martin Kaiser Date: Sun Jul 25 17:58:59 2021 +0200 staging: rtl8188eu: simplify phy_iq_calibrate phy_iq_calibrate's is2t parameter is always false. Remove some code that would be called only for is2t == true. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e17c7d42cd33a6744b0fd0bb33a1308094b73457 Author: Martin Kaiser Date: Mon Jul 26 21:53:54 2021 +0200 staging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate The boolean is2t variable in rtl88eu_phy_iq_calibrate is always false. Remove some code that's unused in this case. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210726195354.28548-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 99e7a944281e21edff48bab0bbe16a793246c5d8 Author: Martin Kaiser Date: Sun Jul 25 17:58:57 2021 +0200 staging: rtl8188eu: remove write-only HwRxPageSize HwRxPageSize from struct hal_data_8188e is set but never read. Remove the component and the code to initialise it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f3946501899998c02f2444a6fbfa5ec46fbe3a86 Author: Martin Kaiser Date: Sun Jul 25 17:58:56 2021 +0200 staging: rtl8188eu: remove unused IntrMask The IntrMask array is set but never read. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bd4680034d1fcb292761bb52a33143827025cac2 Author: Martin Kaiser Date: Sun Jul 25 17:58:55 2021 +0200 staging: rtl8188eu: remove two write-only hal components RegTxPause and RegBcnCtrlVal from struct hal_data_8188e are set but never read. Remove them. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e79942ec2ccbbc26b6a66861377810f9f6db3f4c Author: Martin Kaiser Date: Sun Jul 25 17:58:54 2021 +0200 staging: rtl8188eu: remove write-only power struct component pwrpriv->bFwCurrentInPSMode is initialized and updated but nobody reads its value. Remove this write-only component. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 55937c27cd438a832922f93be2fdd17bdd1b05ed Author: Martin Kaiser Date: Sun Jul 25 17:58:53 2021 +0200 staging: rtl8188eu: remove unused _HAL_INTF_C_ define This define can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 448390332cfb2b033f632f6ec054cdd645a023dc Author: Martin Kaiser Date: Sun Jul 25 17:58:52 2021 +0200 staging: rtl8188eu: remove yet another unused enum The hardware_type enum is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit fc9336eb526c28b92c8e89b735582a3af7af2431 Author: Martin Kaiser Date: Sun Jul 25 17:58:51 2021 +0200 staging: rtl8188eu: remove a bunch of unused defines Only RF_CHANGE_BY_PS is used by this driver, the other RF_CHANGE_BY_... defines can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b5b6cf1a2643f28c77a13d1c13678cb44cd552a6 Author: Martin Kaiser Date: Sun Jul 25 17:58:50 2021 +0200 staging: rtl8188eu: remove another unused enum The rt_eeprom_type enum is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c51a9ea6b4d00fbd212a96391ca494fb6c926e38 Author: Martin Kaiser Date: Sun Jul 25 17:58:49 2021 +0200 staging: rtl8188eu: remove an unused enum The hal_intf_ps_func enum is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3e04209f341052b4a885d20dd1c81f409bcf82b6 Author: Martin Kaiser Date: Sun Jul 25 17:58:48 2021 +0200 staging: rtl8188eu: simplify Hal_EfuseParseMACAddr_8188EU The hwinfo and AutoLoadFail parameters can be obtained from struct adapter, there's no need to pass them as separate function parameters. Use memcpy instead of bytewise copy if we have to fall back to the hard-coded mac address. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bb3462f46462e4d5a66170e3b0c63c1a44c6011d Author: Martin Kaiser Date: Sun Jul 25 17:58:47 2021 +0200 staging: rtl8188eu: remove HW_VAR_TXPAUSE The "HAL layer variable" HW_VAR_TXPAUSE is not used in this driver. Remove its define and the code for setting and for reading a value. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 20a55e6c707a24de7fa4dfcd393c4a73272465d5 Author: Martin Kaiser Date: Sun Jul 25 17:58:46 2021 +0200 staging: rtl8188eu: remove HW_VAR_MEDIA_STATUS1 The "HAL layer variable" HW_VAR_MEDIA_STATUS1 is not used in this driver. Remove its define and the code for setting a value. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2d9f8c5ae660ba1303d155fc9462de39da440494 Author: Martin Kaiser Date: Sun Jul 25 17:58:45 2021 +0200 staging: rtl8188eu: remove unused defines Now that power cut mask is not used any more, we can also remove the defines for power cut masks. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210725155902.32433-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2490e3230245fd0fd3726ec06f3947ca81d0b761 Author: Michael Straube Date: Mon Jul 26 11:21:29 2021 +0200 staging: rtl8188eu: remove braces from single line if blocks Remove braces from single line if blocks to clear checkpatch warnings. WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210726092129.30334-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1f0873da312d0a7686d628fcab91c0606ffab893 Author: Michael Straube Date: Mon Jul 26 11:10:14 2021 +0200 staging: rtl8188eu: remove blank lines Remove unnecessary blank lines reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20210726091014.21405-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 51f59d684b0c65563ad16e5e179ad021a05951c5 Author: Fabio M. De Francesco Date: Fri Jul 23 21:26:20 2021 +0200 staging: rtl8188eu: Remove no more used functions and variables Remove the functions and variables from rtw_security.c that are no more necessary since the patch that replaces getcrc32() with crc32_le(). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210723192620.10669-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit eeacf4cce0b183c2cf61a9c1ea6db7a0ab9c2600 Author: Fabio M. De Francesco Date: Fri Jul 23 21:26:19 2021 +0200 staging: rtl8188eu: Replace a custom function with crc32_le() Use crc32_le() in place of the custom getcrc32(). Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210723192620.10669-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 409f386b8e5d69ba5b13bb94618b6b668a7a3736 Author: Tonghao Zhang Date: Tue Jul 27 21:14:13 2021 +0800 qdisc: add new field for qdisc_enqueue tracepoint qdisc_enqueue tracepoint can work with qdisc:qdisc_dequeue to measure packets latency in qdisc queues. Add a new field txq for it, then we can retrieve more info. Signed-off-by: Tonghao Zhang Signed-off-by: David S. Miller commit c10fe0cc3ec4089d5da21faa732d74a40efbc07a Author: Len Baker Date: Sat Jul 17 17:20:32 2021 +0200 staging/wlan-ng: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210717152032.10164-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit fa8db3989362866ea1beb1314fc4e86f373a6425 Author: Len Baker Date: Sat Jul 17 18:05:12 2021 +0200 staging/most: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210717160512.16176-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 56315e55119c0ea57e142b6efb7c31208628ad86 Author: Christophe JAILLET Date: Wed Jul 21 10:45:11 2021 +0200 staging: ks7010: Fix the initialization of the 'sleep_status' structure 'sleep_status' has 3 atomic_t members. Initialize the 3 of them instead of initializing only 2 of them and setting 0 twice to the same variable. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/d2e52a33a9beab41879551d0ae2fdfc99970adab.1626856991.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 66c1c64ea89d98f971201f3172674ded735642c0 Author: Jignesh Patel Date: Fri Jul 23 15:15:16 2021 +0530 staging: rtl8188eu: Line over 100 characters Break lines into multiple lines to respect 100 character width limit. Reported by checkpatch.pl Signed-off-by: Jignesh Patel Link: https://lore.kernel.org/r/20210723094524.8811-1-jigs0101@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0104c061a880471c6cc66a65c932b74138e04e14 Author: Benjamin Philip Date: Thu Jul 22 12:14:51 2021 +0530 staging: rtl8188eu: remove unnecessary blank lines in core/rtw_ap.c This commit fixes some checkpatch checks for blank lines before and after braces in drivers/staging/rtl8188eu/core/rtw_ap.c Signed-off-by: Benjamin Philip Link: https://lore.kernel.org/r/20210722064451.10331-1-benjamin.philip495@gmail.com Signed-off-by: Greg Kroah-Hartman commit 35c83e29639e5a4ed28d9a77c381a553f723d9f2 Author: Fabio M. De Francesco Date: Wed Jul 21 13:28:29 2021 +0200 staging: rtl8188eu: Remove unused iw_operation_mode[] Remove unused iw_operation_mode array. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210721112829.17317-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 17ce9c61c71cbc0d7e6ba0a9f34c724fb316a31b Author: Simon Ser Date: Mon Jul 26 07:50:32 2021 +0000 drm: document DRM_IOCTL_MODE_RMFB Since there's no struct to attach the docs to, document the IOCTL definition. Signed-off-by: Simon Ser Reviewed-by: Pekka Paalanen Reviewed-by: Daniel Vetter Cc: Leandro Ribeiro Link: https://patchwork.freedesktop.org/patch/msgid/ephVkof3uGu2RpOdBbrHE3qF98zBfIBRzXe4Vyoboh0@cp4-web-034.plabs.ch commit df26600ad3e7608365e42c7fd89e900aab6a838e Author: Simon Ser Date: Mon Jul 26 07:49:06 2021 +0000 drm: add logging for RMFB ioctl We already have logging for ADDFB2. Add some logging for RMFB as well. This can be handy when trying to find out why a CRTC gets magically disabled. v2: make log message more explicit, add log messages to drm_framebuffer_remove (Daniel) Signed-off-by: Simon Ser Reviewed-by: Daniel Vetter Acked-by: Sam Ravnborg Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/EghsoRDcn1SJV0nxVqRCisPd7v0627yLZbBjn4A8Yg@cp3-web-048.plabs.ch commit 37108ef45ae9021d23174ce89e76ad41443090bf Author: Dan Carpenter Date: Tue Jul 27 11:17:56 2021 +0300 ASoC: amd: fix an IS_ERR() vs NULL bug in probe The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Fixes: e550339ee652 ("ASoC: amd: add vangogh i2s controller driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210727081756.GA19121@kili Signed-off-by: Mark Brown commit 89d751d8f9dcfb69d1153070d5e5a86d36ac1b45 Author: Shuming Fan Date: Tue Jul 27 16:48:46 2021 +0800 ASoC: rt5682: enable SAR ADC power saving mode during suspend The SAR ADC power saving mode could reduce power consumption on MICVDD rail. Therefore, this patch saves power consumption during suspend state if the headset was connected. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20210727084846.9867-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 9bdc573d84d8fcfe50b223350598efe4fe1cad08 Author: Kuninori Morimoto Date: Tue Jul 27 11:05:51 2021 +0900 ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan() This patch cleanups below cppcheck warning. sound/soc/soc-pcm.c:1624:30: style: The scope of the variable 'codec_stream' can be reduced. [variableScope] struct snd_soc_pcm_stream *codec_stream; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o8aozf28.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7931df9bf07bfe62831e559e5ffdca6f3657d92c Author: Kuninori Morimoto Date: Tue Jul 27 11:05:47 2021 +0900 ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active() This patch cleanups below cppcheck warning. sound/soc/soc-pcm.c:1305:30: style: The scope of the variable 'widget' can be reduced. [variableScope] struct snd_soc_dapm_widget *widget; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmv4zf2c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 940a1f43572316ba3320fea361db2a5200e2de0e Author: Kuninori Morimoto Date: Tue Jul 27 11:05:43 2021 +0900 ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture() This patch cleanups below cppcheck warning. sound/soc/soc-pcm.c:2578:22: style: The scope of the variable 'codec_dai' can be reduced. [variableScope] struct snd_soc_dai *codec_dai; ^ sound/soc/soc-pcm.c:2580:6: style: The scope of the variable 'stream' can be reduced. [variableScope] int stream; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r1fkzf2g.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 33be10b563dc56c33d28562ff83065a89647e443 Author: Kuninori Morimoto Date: Tue Jul 27 11:05:38 2021 +0900 ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close() This patch cleanups below cppcheck warning. sound/soc/soc-pcm.c:631:9: style: The scope of the variable 'r' can be reduced. [variableScope] int i, r, ret = 0; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sg00zf2l.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2bc3e1f21b06802e70d9ccd5f8756099ffd04eb2 Author: Kuninori Morimoto Date: Tue Jul 27 11:05:34 2021 +0900 ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb() This patch cleanups below cppcheck warning. sound/soc/soc-pcm.c:446:29: style: The scope of the variable 'pcm_codec' can be reduced. [variableScope] struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; ^ sound/soc/soc-pcm.c:446:41: style: The scope of the variable 'pcm_cpu' can be reduced. [variableScope] struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; ^ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tukgzf2p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ef17e2ac2183cb2107e68d489127a6176ede3339 Author: Jason Wang Date: Sun Jul 25 23:13:53 2021 +0800 net: qed: remove unneeded return variables Some return variables are never changed until function returned. These variables are unneeded for their functions. Therefore, the unneeded return variables can be removed safely by returning their initial values. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit d4b996f9ef1fe83d9ce9ad5c1ca0bd8231638ce5 Author: Ioana Ciornei Date: Fri Jul 23 11:42:44 2021 +0300 docs: networking: dpaa2: add documentation for the switch driver Add a documentation entry for the DPAA2 switch listing its requirements, features and some examples to go along them. Signed-off-by: Ioana Ciornei Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit c5aa8277a1d388ba634f756473ee63017708f9c6 Author: Takashi Iwai Date: Tue Jul 27 12:52:32 2021 +0200 ALSA: seq: Fix comments of wrong client number for MIDI Passthrough MIDI Passthrough sequencer client is assigned always to the fixed number 14, while it's wrongly documented in the comments as if 62, which was an old number that was used during development. Fix all those numbers. Link: https://lore.kernel.org/r/20210727105232.7321-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 453a343c5a74e48600c59fc2a627096a2eb3505d Merge: f9b282b36dfa9 076999e460279 Author: David S. Miller Date: Tue Jul 27 11:48:52 2021 +0100 Merge branch 'ovs-upcall-issues' Mark Gray says: ==================== openvswitch: per-cpu upcall patchwork issues Some issues were raised by patchwork at: https://patchwork.kernel.org/project/netdevbpf/patch/20210630095350.817785-1-mark.d.gray@redhat.com/#24285159 ==================== Signed-off-by: David S. Miller commit 076999e460279cec45c4653513a4f3121fe236d7 Author: Mark Gray Date: Fri Jul 23 10:24:14 2021 -0400 openvswitch: fix sparse warning incorrect type fix incorrect type in argument 1 (different address spaces) ../net/openvswitch/datapath.c:169:17: warning: incorrect type in argument 1 (different address spaces) ../net/openvswitch/datapath.c:169:17: expected void const * ../net/openvswitch/datapath.c:169:17: got struct dp_nlsk_pids [noderef] __rcu *upcall_portids Found at: https://patchwork.kernel.org/project/netdevbpf/patch/20210630095350.817785-1-mark.d.gray@redhat.com/#24285159 Signed-off-by: Mark Gray Signed-off-by: David S. Miller commit 784dcfa56e0453bb197601ba0b8196f6f892ebcb Author: Mark Gray Date: Fri Jul 23 10:24:13 2021 -0400 openvswitch: fix alignment issues Signed-off-by: Mark Gray Signed-off-by: David S. Miller commit e4252cb66637b846b916cca7c2cdb4ed22ab2fc3 Author: Mark Gray Date: Fri Jul 23 10:24:12 2021 -0400 openvswitch: update kdoc OVS_DP_ATTR_PER_CPU_PIDS Signed-off-by: Mark Gray Signed-off-by: David S. Miller commit ca31fef11dc83e672415d5925a134749761329bd Merge: ba6cd766e0bf9 15d27b15de965 Author: Maarten Lankhorst Date: Tue Jul 27 12:48:17 2021 +0200 Backmerge remote-tracking branch 'drm/drm-next' into drm-misc-next Required bump from v5.13-rc3 to v5.14-rc3, and to pick up sysfb compilation fixes. Signed-off-by: Maarten Lankhorst commit f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482 Author: Yajun Deng Date: Tue Jul 27 11:41:41 2021 +0800 net: netlink: add the case when nlh is NULL Add the case when nlh is NULL in nlmsg_report(), so that the caller doesn't need to deal with this case. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 3df15d6f37246d2f12f53d915c41d806289d3d46 Author: Greg Kroah-Hartman Date: Mon Jul 26 15:43:22 2021 +0200 vt: keyboard.c: make console an unsigned int The console variable is used everywhere in some fun pointer path and array indexes and for some reason isn't always declared as unsigned. This plays havoc with some static analysis tools so mark the variable as unsigned so we "know" we can not wrap the arrays backwards here. Cc: Jiri Slaby Cc: Andy Shevchenko Reported-by: Jordy Zomer Link: https://lore.kernel.org/r/20210726134322.2274919-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit c92bbbfe21efaa4344871bd2fb5a7649c0b07b84 Author: Greg Kroah-Hartman Date: Mon Jul 26 15:43:21 2021 +0200 vt: keyboard: treat kbd_table as an array all the time. The keyboard.c code seems to like to treat the kbd_table as both an array, and as a base to do some pointer math off of. As they really are the same thing, and compilers are smart enough not to make a difference anymore, just be explicit and always use this as an array to make the code more obvious for all to read. Cc: Jiri Slaby Cc: Andy Shevchenko Cc: Jordy Zomer Link: https://lore.kernel.org/r/20210726134322.2274919-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit ba6cd766e0bf933611dc66fcb86f72ac80a446bc Author: Daniel Vetter Date: Fri Jul 23 10:34:57 2021 +0200 drm/plane: Move drm_plane_enable_fb_damage_clips into core We're trying to have a fairly strict split between core functionality that defines the uapi, including the docs, and the helper functions to implement it. Move drm_plane_enable_fb_damage_clips and associated kerneldoc into drm_plane from drm_damage_helper.c to fix this. Reviewed-by: José Roberto de Souza Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Cc: José Roberto de Souza Cc: Hans de Goede Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723083457.696939-3-daniel.vetter@ffwll.ch commit c7fcbf2513973208c03a2173cd25a2c48fec6605 Author: Daniel Vetter Date: Fri Jul 23 10:34:56 2021 +0200 drm/plane: check that fb_damage is set up when used There's two stages of manual upload/invalidate displays: - just handling dirtyfb and uploading the entire fb all the time - looking at damage clips In the latter case we support it through fbdev emulation (with fb_defio), atomic property, and with the dirtfy clip rects. Make sure at least the atomic property is set up as the main official interface for this. Ideally we'd also check that drm_atomic_helper_dirtyfb() is used and that fbdev defio is set up, but that's quite a bit harder to do. Ideas very much welcome. From a cursor audit drivers seem to be getting this right mostly, but better to make sure. At least no one is bypassing the accessor function. v2: - use drm_warn_once with a meaningful warning string (José) - don't splat in the atomic check code for everyone (intel-gfx-ci) Reviewed-by: José Roberto de Souza (v1) Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Cc: José Roberto de Souza Cc: Hans de Goede Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723083457.696939-2-daniel.vetter@ffwll.ch commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a Author: Daniel Vetter Date: Fri Jul 23 10:34:55 2021 +0200 drm/plane: remove drm_helper_get_plane_damage_clips It's not used. Drivers should instead use the helpers anyway. Currently both vbox and i915 hand-roll this and it's not the greatest. vbox looks buggy, and i915 does a bit much that helpers would take care of I think. Also improve the kerneldocs while we're at it. Reviewed-by: José Roberto de Souza Cc: Ville Syrjälä Cc: Gwan-gyeong Mun Cc: José Roberto de Souza Cc: Hans de Goede Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723083457.696939-1-daniel.vetter@ffwll.ch commit 40f2218dc4acf5f90eb5c5d5acbbd98e4bbd9602 Author: Jose Maria Casanova Crespo Date: Fri Jul 23 14:33:07 2021 +0200 drm/prime: fix comment on PRIME Helpers s/Exporting/Importing Fixes: 805dc614d58a8 ("drm/prime: Update docs") Cc: Daniel Vetter Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723123307.31064-1-jmcasanova@igalia.com commit 3a96e97ab4e835078e6f27b7e1c0947814df3841 Author: Greg Kroah-Hartman Date: Mon Jul 26 15:07:17 2021 +0200 serial: 8250_pci: make setup_port() parameters explicitly unsigned The bar and offset parameters to setup_port() are used in pointer math, and while it would be very difficult to get them to wrap as a negative number, just be "safe" and make them unsigned so that static checkers do not trip over them unintentionally. Cc: Jiri Slaby Reported-by: Jordy Zomer Link: https://lore.kernel.org/r/20210726130717.2052096-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 481975b24c3996352c100be1c3f962bc54ec552d Author: Sam Shih Date: Mon Jul 26 15:14:36 2021 +0800 dt-bindings: serial: Add compatible for Mediatek MT7986 This commit adds dt-binding documentation of uart for Mediatek MT7986 SoC Platform. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20210726071439.14248-10-sam.shih@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 72fdb403008c598dca535cfe8ade25eb2253c1d2 Author: Jiri Slaby Date: Fri Jul 23 09:43:17 2021 +0200 tty: pdc_cons, free tty_driver upon failure pdc_console_tty_driver_init() does not free the allocated tty driver in case tty_register_driver() fails. Add one tty_driver_kref_put() to the error path. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9f90a4ddef4e4d3aa4229f6b117d4e57231457b3 Author: Jiri Slaby Date: Fri Jul 23 09:43:16 2021 +0200 tty: drop put_tty_driver put_tty_driver() is an alias for tty_driver_kref_put(). There is no need for two exported identical functions, therefore switch all users of old put_tty_driver() to new tty_driver_kref_put() and remove the former for good. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Geert Uytterhoeven Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: Chris Zankel Cc: Max Filippov Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Samuel Iglesias Gonsalvez Cc: Jens Taprogge Cc: Karsten Keil Cc: Scott Branden Cc: Ulf Hansson Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: David Lin Cc: Johan Hovold Cc: Alex Elder Cc: Jiri Slaby Cc: Laurentiu Tudor Cc: Jiri Kosina Cc: David Sterba Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Oliver Neukum Cc: Felipe Balbi Cc: Mathias Nyman Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Acked-by: Alex Elder Acked-by: Christian Borntraeger Acked-by: Max Filippov Acked-by: David Sterba Acked-by: Samuel Iglesias Gonsálvez Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit cb9ea618ee60313d9278b2ba75f56da2531c8cac Author: Jiri Slaby Date: Fri Jul 23 09:43:15 2021 +0200 tty: make tty_set_operations an inline Since commit f34d7a5b7010 (tty: The big operations rework) in 2008, tty_set_operations() is a simple one-line assignment. There is no reason for this to be an exported function, hence move it to a header and make an inline from that. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 56ec5880a28eae0f508e88e9e80d2e82a471c9be Author: Jiri Slaby Date: Fri Jul 23 09:43:14 2021 +0200 tty: drop alloc_tty_driver Noone uses this deprecated function now. So we can remove it. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 39b7b42be4a82f036c392abc71724b4b7752ac03 Author: Jiri Slaby Date: Fri Jul 23 09:43:13 2021 +0200 tty: stop using alloc_tty_driver alloc_tty_driver was deprecated by tty_alloc_driver in commit 7f0bc6a68ed9 (TTY: pass flags to alloc_tty_driver) in 2012. I never got into eliminating alloc_tty_driver until now. So we still have two functions for allocating drivers which might be confusing. So get rid of alloc_tty_driver uses to eliminate it for good in the next patch. Note we need to switch return value checking as tty_alloc_driver uses ERR_PTR. And flags are now a parameter of tty_alloc_driver. Cc: Richard Henderson (odd fixer:ALPHA PORT) Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Geert Uytterhoeven Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: Chris Zankel Cc: Max Filippov Cc: Samuel Iglesias Gonsalvez Cc: Jens Taprogge Cc: Karsten Keil Cc: Ulf Hansson Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Laurentiu Tudor Cc: Jiri Kosina Cc: David Sterba Cc: Shawn Guo Cc: Sascha Hauer Cc: Oliver Neukum Cc: Felipe Balbi Cc: Johan Hovold Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Acked-by: Samuel Iglesias Gonsálvez Acked-by: Max Filippov Acked-by: David Sterba Acked-by: Christian Borntraeger Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0524513afe45a4a79f418c0377160b7712cab78a Author: Jiri Slaby Date: Fri Jul 23 09:43:12 2021 +0200 tty: don't store semi-state into tty drivers When a tty driver pointer is used as a return value of struct console's device() hook, don't store a semi-state into global variable which holds the tty driver. It could mean console::device() would return a bogus value. This is important esp. after the next patch where we switch from alloc_tty_driver to tty_alloc_driver. tty_alloc_driver returns ERR_PTR in case of error and that might have unexpected results as the code doesn't expect this. Cc: Geert Uytterhoeven Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Chris Zankel Cc: Max Filippov Cc: Laurentiu Tudor Cc: Felipe Balbi Reviewed-by: Max Filippov Acked-by: Helge Deller # parisc Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c Author: Jiri Slaby Date: Fri Jul 23 09:43:11 2021 +0200 hvsi: don't panic on tty_register_driver failure The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least the console functional as it was enabled earlier by console_initcall in hvsi_console_init. Instead of shooting down the whole system. This means, we disable interrupts and restore hvsi_wait back to poll_for_state(). Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 23411c720052ad860b3e579ee4873511e367130a Author: Jiri Slaby Date: Fri Jul 23 09:43:10 2021 +0200 xtensa: ISS: don't panic in rs_init While alloc_tty_driver failure in rs_init would mean we have much bigger problem, there is no reason to panic when tty_register_driver fails there. It can fail for various reasons. So handle the failure gracefully. Actually handle them both while at it. This will make at least the console functional as it was enabled earlier by console_initcall in iss_console_init. Instead of shooting down the whole system. We move tty_port_init() after alloc_tty_driver(), so that we don't need to destroy the port in case the latter function fails. Cc: Chris Zankel Cc: Max Filippov Cc: linux-xtensa@linux-xtensa.org Acked-by: Max Filippov Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit b0e81817629a496854ff1799f6cbd89597db65fd Author: Vladimir Oltean Date: Mon Jul 26 17:25:36 2021 +0300 net: build all switchdev drivers as modules when the bridge is a module Currently, all drivers depend on the bool CONFIG_NET_SWITCHDEV, but only the drivers that call some sort of function exported by the bridge, like br_vlan_enabled() or whatever, have an extra dependency on CONFIG_BRIDGE. Since the blamed commit, all switchdev drivers have a functional dependency upon switchdev_bridge_port_{,un}offload(), which is a pair of functions exported by the bridge module and not by the bridge-independent part of CONFIG_NET_SWITCHDEV. Problems appear when we have: CONFIG_BRIDGE=m CONFIG_NET_SWITCHDEV=y CONFIG_TI_CPSW_SWITCHDEV=y because cpsw, am65_cpsw and sparx5 will then be built-in but they will call a symbol exported by a loadable module. This is not possible and will result in the following build error: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_netdevice_event': drivers/net/ethernet/ti/cpsw_new.c:1520: undefined reference to `switchdev_bridge_port_offload' drivers/net/ethernet/ti/cpsw_new.c:1537: undefined reference to `switchdev_bridge_port_unoffload' As mentioned, the other switchdev drivers don't suffer from this because switchdev_bridge_port_offload() is not the first symbol exported by the bridge that they are calling, so they already needed to deal with this in the same way. Fixes: 2f5dc00f7a3e ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded") Reported-by: Linux Kernel Functional Testing Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 52c27f13b52cd7b7893de4fc11f1555d3917c3e6 Author: Jiri Slaby Date: Fri Jul 23 12:31:47 2021 +0200 tty: tty_flip.h needs only tty_buffer and tty_port tty_flip.h currently includes whole tty.h. In fact, it needs only tty_buffer and tty_port definitions. Provided, we separated tty_buffer and tty_port into separate headers in the previous patch, we can make tty_flip.h to include only much lighter tty_buffer.h and tty_port.h. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 67b94be44771ab99bdbd019e19314f268fa1ff8c Author: Jiri Slaby Date: Fri Jul 23 12:31:46 2021 +0200 tty: move tty_port to new tty_port.h tty.h is long enough already. And I am slowly adding kernel-doc documentation, so it grows to unmaintainable long mess. To avoid this, split tty.h further into tty_port.h and move there tty_port-related declarations and function prototypes (those implemented in tty_port.c). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8d29e0024437ae9184ae24f817ef0fda80b8cd3c Author: Jiri Slaby Date: Fri Jul 23 12:31:45 2021 +0200 tty: move tty_buffer definitions to new tty_buffer.h tty.h is large enough currently. And I am slowly adding kernel-doc documentation, so it grows to unmaintainable long mess. To avoid this, split tty.h further into tty_buffer.h and move there tty_buffer-related declarations and function prototypes. Note that many of the tty_buffer.c function prototypes reside now in tty_flip.h. But we cannot move struct tty_buffer & friends because: * tty_insert_flip_char() in tty_flip.h needs both struct tty_port and struct tty_buffer defined. * struct tty_port in tty_port.h needs struct tty_buffer defined. So if we moved struct tty_buffer to tty_flip.h too, tty_flip.h would need tty_port.h and that would need tty_flip.h (to have tty_buffer) again. Hence we introduce new header tty_buffer.h here to break this circular dependency. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 56eef46aa830824d5046a765d695a78bc0c34fed Author: Jiri Slaby Date: Fri Jul 23 12:31:44 2021 +0200 tty: move tty_ldisc_receive_buf to tty_flip.h It's the only remaining tty_buffer.c prototype residing in tty.h. Move it along others to tty_flip.h. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit abca990183e933d8448a4791c2912b509a17e290 Author: Jiri Slaby Date: Fri Jul 23 12:31:43 2021 +0200 tty: include list & lockdep from tty_ldisc.h We use structs list_head and lockdep_map as non-pointers in tty_ldisc.h. So better have headers defining them explicitly included so that the structs are always defined. Not only implicitly via random include chains. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit a24bc667ac1f19cdda8a998cdaf7fbdd4fc0a040 Author: Jiri Slaby Date: Fri Jul 23 12:31:42 2021 +0200 tty: move ldisc prototypes to tty_ldisc.h We already have tty_ldisc.h, so cleanup tty.h a bit by moving out tty_ldisc-related function prototypes and a variable into tty_ldisc.h. They are implemented in tty_ldisc.c anyway. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 890ebae627708cd530592b524efd5d26d9fdb2ec Author: Jiri Slaby Date: Fri Jul 23 12:31:41 2021 +0200 tty: include kref.h in tty_driver.h We use kref in tty_driver.h, but do not include kref.h. It is currently included by linux/cdev.h -> linux/kobject.h -> linux/kref.h chain, so everything is in order only implicitly. So make this dependency explicit. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 4d3d947866c2da405a6257158e42077fa3c95755 Author: Jiri Slaby Date: Fri Jul 23 12:31:40 2021 +0200 tty: move tty_driver related prototypes to tty_driver.h We already have tty_driver.h, so cleanup tty.h a bit by moving out tty_driver-related function prototypes into tty_driver.h. Note that tty.h already includes tty_driver.h. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723103147.18250-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9b29a161ef38040f000dcf9ccf78e34495edfd55 Author: Saeed Mahameed Date: Mon Jul 26 15:15:39 2021 -0700 ethtool: Fix rxnfc copy to user buffer overflow In the cited commit, copy_to_user() got called with the wrong pointer, instead of passing the actual buffer ptr to copy from, a pointer to the pointer got passed, which causes a buffer overflow calltrace to pop up when executing "ethtool -x ethX". Fix ethtool_rxnfc_copy_to_user() to use the rxnfc pointer as passed to the function, instead of a pointer to it. This fixes below call trace: [ 15.533533] ------------[ cut here ]------------ [ 15.539007] Buffer overflow detected (8 < 192)! [ 15.544110] WARNING: CPU: 3 PID: 1801 at include/linux/thread_info.h:200 copy_overflow+0x15/0x20 [ 15.549308] Modules linked in: [ 15.551449] CPU: 3 PID: 1801 Comm: ethtool Not tainted 5.14.0-rc2+ #1058 [ 15.553919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 15.558378] RIP: 0010:copy_overflow+0x15/0x20 [ 15.560648] Code: e9 7c ff ff ff b8 a1 ff ff ff eb c4 66 0f 1f 84 00 00 00 00 00 55 48 89 f2 89 fe 48 c7 c7 88 55 78 8a 48 89 e5 e8 06 5c 1e 00 <0f> 0b 5d c3 0f 1f 80 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 55 [ 15.565114] RSP: 0018:ffffad49c0523bd0 EFLAGS: 00010286 [ 15.566231] RAX: 0000000000000000 RBX: 00000000000000c0 RCX: 0000000000000000 [ 15.567616] RDX: 0000000000000001 RSI: ffffffff8a7912e7 RDI: 00000000ffffffff [ 15.569050] RBP: ffffad49c0523bd0 R08: ffffffff8ab2ae28 R09: 00000000ffffdfff [ 15.570534] R10: ffffffff8aa4ae40 R11: ffffffff8aa4ae40 R12: 0000000000000000 [ 15.571899] R13: 00007ffd4cc2a230 R14: ffffad49c0523c00 R15: 0000000000000000 [ 15.573584] FS: 00007f538112f740(0000) GS:ffff96d5bdd80000(0000) knlGS:0000000000000000 [ 15.575639] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 15.577092] CR2: 00007f5381226d40 CR3: 0000000013542000 CR4: 00000000001506e0 [ 15.578929] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 15.580695] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 15.582441] Call Trace: [ 15.582970] ethtool_rxnfc_copy_to_user+0x30/0x46 [ 15.583815] ethtool_get_rxnfc.cold+0x23/0x2b [ 15.584584] dev_ethtool+0x29c/0x25f0 [ 15.585286] ? security_netlbl_sid_to_secattr+0x77/0xd0 [ 15.586728] ? do_set_pte+0xc4/0x110 [ 15.587349] ? _raw_spin_unlock+0x18/0x30 [ 15.588118] ? __might_sleep+0x49/0x80 [ 15.588956] dev_ioctl+0x2c1/0x490 [ 15.589616] sock_ioctl+0x18e/0x330 [ 15.591143] __x64_sys_ioctl+0x41c/0x990 [ 15.591823] ? irqentry_exit_to_user_mode+0x9/0x20 [ 15.592657] ? irqentry_exit+0x33/0x40 [ 15.593308] ? exc_page_fault+0x32f/0x770 [ 15.593877] ? exit_to_user_mode_prepare+0x3c/0x130 [ 15.594775] do_syscall_64+0x35/0x80 [ 15.595397] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 15.596037] RIP: 0033:0x7f5381226d4b [ 15.596492] Code: 0f 1e fa 48 8b 05 3d b1 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 0d b1 0c 00 f7 d8 64 89 01 48 [ 15.598743] RSP: 002b:00007ffd4cc2a1f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 15.599804] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5381226d4b [ 15.600795] RDX: 00007ffd4cc2a350 RSI: 0000000000008946 RDI: 0000000000000003 [ 15.601712] RBP: 00007ffd4cc2a340 R08: 00007ffd4cc2a350 R09: 0000000000000001 [ 15.602751] R10: 00007f538128a990 R11: 0000000000000246 R12: 0000000000000000 [ 15.603882] R13: 00007ffd4cc2a350 R14: 00007ffd4cc2a4b0 R15: 0000000000000000 [ 15.605042] ---[ end trace 325cf185e2795048 ]--- Fixes: dd98d2895de6 ("ethtool: improve compat ioctl handling") Reported-by: Shannon Nelson CC: Arnd Bergmann CC: Christoph Hellwig Signed-off-by: Saeed Mahameed Tested-by: Shannon Nelson Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 8496f60a670debe356a9168a66b7560641e53e93 Author: Jiri Slaby Date: Thu Jul 22 13:51:41 2021 +0200 v253_init: eliminate pointer to string There is no need to have an extra pointer to a string (v253_init). Convert it to an array. Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210722115141.516-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0e9ffdb236b8d273a086e86887192a62dd8f144a Author: Jiri Slaby Date: Thu Jul 22 13:51:40 2021 +0200 cx20442: tty_ldisc_ops::write_wakeup is optional TTY layer does nothing if tty_ldisc_ops::write_wakeup is NULL, so there is no need to implement an empty one in cx20442. Drop it. Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210722115141.516-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 3d1fa055ea7298345795b982de7a5b9ec6ae238d Author: Andy Shevchenko Date: Fri Jul 23 15:59:43 2021 +0300 serial: max310x: Use clock-names property matching to recognize EXTCLK Dennis reported that on ACPI-based systems the clock frequency isn't enough to configure device properly. We have to respect the clock source as well. To achieve this match the clock-names property against "osc" to recognize external clock connection. On DT-based system this doesn't change anything. Reported-and-tested-by: Dennis Giaya Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210723125943.22039-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0a9410b981e961a24057dceee54bb5d36309a0c4 Author: Andy Shevchenko Date: Wed Jul 21 19:24:52 2021 +0300 serial: 8250_lpss: Enable DMA on Intel Elkhart Lake PSE UARTs on Intel Elkhart Lake support DMA mode. Enable DMA on these ports. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210721162452.48764-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f444f34b4a1afcd2133daaa73778673ca09fb564 Author: Linus Walleij Date: Sat Jul 17 00:53:19 2021 +0200 dt-bindings: serial: 8250: Add Exar compatibles The Intel IXP425 Vulcan board has an Exar XR16L2551 8250-compatible. It works like an 8250 but it is always good to specify exactly which component we are using. This allows us to specify: compatible = "exar,xr16l2551", "ns8250"; Put in some sibling Exar serial compatibles while we're at it. Cc: Marc Zyngier Cc: devicetree@vger.kernel.org Acked-by: Rob Herring Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210716225319.1282704-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit d7aff291d069c4418285f3c8ee27b0ff67ce5998 Author: Maciej W. Rozycki Date: Sat Jun 26 06:11:51 2021 +0200 serial: 8250: Define RX trigger levels for OxSemi 950 devices Oxford Semiconductor 950 serial port devices have a 128-byte FIFO and in the enhanced (650) mode, which we select in `autoconfig_has_efr' with the ECB bit set in the EFR register, they support the receive interrupt trigger level selectable with FCR bits 7:6 from the set of 16, 32, 112, 120. This applies to the original OX16C950 discrete UART[1] as well as 950 cores embedded into more complex devices. For these devices we set the default to 112, which sets an excessively high level of 112 or 7/8 of the FIFO capacity, unlike with other port types where we choose at most 1/2 of their respective FIFO capacities. Additionally we don't make the trigger level configurable. Consequently frequent input overruns happen with high bit rates where hardware flow control cannot be used (e.g. terminal applications) even with otherwise highly-performant systems. Lower the default receive interrupt trigger level to 32 then, and make it configurable. Document the trigger levels along with other port types, including the set of 16, 32, 64, 112 for the transmit interrupt as well[2]. References: [1] "OX16C950 rev B High Performance UART with 128 byte FIFOs", Oxford Semiconductor, Inc., DS-0031, Sep 05, Table 10: "Receiver Trigger Levels", p. 22 [2] same, Table 9: "Transmit Interrupt Trigger Levels", p. 22 Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2106260608480.37803@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit c206c7faeb3263a7cc7b4de443a3877cd7a5e74b Author: Jagan Teki Date: Sun Jul 4 19:33:09 2021 +0530 drm/bridge: dw-mipi-dsi: Find the possible DSI devices Finding panel_or_bridge might vary based on associated DSI devices like DSI panel, bridge, and I2C based DSI bridge. 1. DSI panels and bridges will invoke the host attach from probe in order to find the panel_or_bridge. chipone_probe() dw_mipi_dsi_host_attach().start dw_mipi_dsi_panel_or_bridge() ...found the panel_or_bridge... ltdc_encoder_init().start dw_mipi_dsi_bridge_attach().start dw_mipi_dsi_host_attach().start chipone_attach(). start chipone_attach(). done dw_mipi_dsi_host_attach().done dw_mipi_dsi_bridge_attach(). done ltdc_encoder_init().done 2. I2C based DSI bridge will invoke the drm_bridge_attach from bridge attach in order to find the panel_or_bridge. ltdc_encoder_init().start dw_mipi_dsi_bridge_attach().start dw_mipi_dsi_panel_or_bridge() ...found the panel_or_bridge... dw_mipi_dsi_host_attach().start sn65dsi83_attach(). start sn65dsi83_attach(). done dw_mipi_dsi_host_attach().done dw_mipi_dsi_bridge_attach(). done ltdc_encoder_init().done So, invoke the panel_or_bridge from host attach and bridge attach in order to find all possible DSI devices. Signed-off-by: Jagan Teki Tested-by: Yannick Fertre Reviewed-by: Robert Foss Tested-by: Heiko Stuebner Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210704140309.268469-1-jagan@amarulasolutions.com commit c1f00edce5a3ee99521ff08ffb4d903e55b6a53f Author: Ludovic Desroches Date: Tue Jul 27 11:13:51 2021 +0200 ARM: dts: at91: sama5d4_xplained: change the key code of the gpio key Having a button code and not a key code causes issues with libinput. udev won't set ID_INPUT_KEY. If it is forced, then it causes a bug within libinput. Signed-off-by: Ludovic Desroches Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210727091351.44475-1-nicolas.ferre@microchip.com commit 15d27b15de965043d6f8e23bc7f34386fcd1a772 Author: Randy Dunlap Date: Mon Jul 26 22:04:47 2021 -0700 efi: sysfb_efi: fix build when EFI is not set When # CONFIG_EFI is not set, there are 2 definitions of sysfb_apply_efi_quirks(). The stub from sysfb.h should be used and the __init function from sysfb_efi.c should not be used. ../drivers/firmware/efi/sysfb_efi.c:337:13: error: redefinition of ‘sysfb_apply_efi_quirks’ __init void sysfb_apply_efi_quirks(struct platform_device *pd) ^~~~~~~~~~~~~~~~~~~~~~ In file included from ../drivers/firmware/efi/sysfb_efi.c:26:0: ../include/linux/sysfb.h:65:20: note: previous definition of ‘sysfb_apply_efi_quirks’ was here static inline void sysfb_apply_efi_quirks(struct platform_device *pd) ^~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Javier Martinez Canillas Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches") Acked-by: Ard Biesheuvel Signed-off-by: Randy Dunlap Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Mark Brown Cc: linux-next@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727050447.7339-1-rdunlap@infradead.org commit 71260b9a7020751623bcda2a5377834a100dfb30 Author: Javier Martinez Canillas Date: Tue Jul 27 11:30:15 2021 +0200 drivers/firmware: fix SYSFB depends to prevent build failures The Generic System Framebuffers support is built when the COMPILE_TEST option is enabled. But this wrongly assumes that all the architectures declare a struct screen_info. This is true for most architectures, but at least the following do not: arc, m68k, microblaze, openrisc, parisc and s390. By attempting to make this compile testeable on all architectures, it leads to linking errors as reported by the kernel test robot for parisc: All errors (new ones prefixed by >>): hppa-linux-ld: drivers/firmware/sysfb.o: in function `sysfb_init': (.init.text+0x24): undefined reference to `screen_info' >> hppa-linux-ld: (.init.text+0x28): undefined reference to `screen_info' To prevent these errors only allow sysfb to be built on systems that are going to need it, which are x86 BIOS and EFI. The EFI Kconfig symbol is used instead of (ARM || ARM64 || RISC) because some of these architectures only declare a struct screen_info if EFI is enabled. And also, because the SYSFB code is only used for EFI on these architectures. For !EFI the "simple-framebuffer" device is registered by OF when parsing the Device Tree Blob (if a DT node for this was defined). Fixes: d391c5827107 ("drivers/firmware: move x86 Generic System Framebuffers support") Reported-by: kernel test robot Signed-off-by: Javier Martinez Canillas Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210727093015.1225107-1-javierm@redhat.com commit 192fbfb7674481c605dc49ead3ada9a4ee2420e1 Author: Stanislav Lisovskiy Date: Mon May 31 09:48:45 2021 +0300 drm/i915: Implement PSF GV point support PSF GV points are an additional factor that can limit the bandwidth available to display, separate from the traditional QGV points. Whereas traditional QGV points represent possible memory clock frequencies, PSF GV points reflect possible frequencies of the memory fabric. Switching between PSF GV points has the advantage of incurring almost no memory access block time and thus does not need to be accounted for in watermark calculations. This patch adds support for those on top of regular QGV points. Those are supposed to be used simultaneously, i.e we are always at some QGV and some PSF GV point, based on the current video mode requirements. Bspec: 64631, 53998 v2: Seems that initial assumption made during ml conversation was wrong, PCode rejects any masks containing points beyond the ones returned, so even though BSpec says we have around 8 points theoretically, we can mask/unmask only those which are returned, trying to manipulate those beyond causes a failure from PCode. So switched back to generating mask from 1 - num_qgv_points, where num_qgv_points is the actual amount of points, advertised by PCode. v3: - Extended restricted qgv point mask to 0xf, as we have now 3:2 bits for PSF GV points(Matt Roper) - Replaced val2 with NULL from PCode request, since its not being used(Matt Roper) - Replaced %d to 0x%x for better readability(thanks for spotting) Signed-off-by: Stanislav Lisovskiy Cc: Matt Roper Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210531064845.4389-2-stanislav.lisovskiy@intel.com commit 9243b966a20b356e03c767bccabea4f4cd9e9274 Author: Stanislav Lisovskiy Date: Mon May 31 09:48:44 2021 +0300 drm/i915: Extend QGV point restrict mask to 0x3 According to BSpec there is now also a code 0x02, which corresponds to QGV point being rejected, this code so lets extend mask to check this. Signed-off-by: Stanislav Lisovskiy Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210531064845.4389-1-stanislav.lisovskiy@intel.com commit fdc07ca0724dd8ad00c22909a1464dc73ed6783e Merge: 8122dc58cb3e3 cea08169ad4ce Author: Tony Lindgren Date: Tue Jul 27 12:02:24 2021 +0300 Merge branch 'omap-for-v5.14/ti-sysc' into omap-for-v5.15/ti-sysc commit 9acb9c48b9408bbb6ade90e3f3192ee38e2589b3 Author: Christoph Hellwig Date: Tue Jul 20 15:33:41 2021 +0200 fs: remove generic_block_fiemap Remove the now unused generic_block_fiemap helper. Link: https://lore.kernel.org/r/20210720133341.405438-5-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Jan Kara commit e0cba89d22b7041202c33e4d1ae4d2006d7e0190 Author: Christoph Hellwig Date: Tue Jul 20 15:33:40 2021 +0200 hpfs: use iomap_fiemap to implement ->fiemap hpfs is the last user of generic_block_fiemap, so add a trivial iomap_ops based on the ext2 version and switch to iomap_fiemap. Link: https://lore.kernel.org/r/20210720133341.405438-4-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Jan Kara commit 8b1e7076d26b935af7caec33dee2837c0ad7dbb5 Author: Christoph Hellwig Date: Tue Jul 20 15:33:39 2021 +0200 ext2: use iomap_fiemap to implement ->fiemap Switch from generic_block_fiemap to use the iomap version. The only interesting part is that ext2_get_blocks gets confused when being asked for overly long ranges, so copy over the limit to the inode size from generic_block_fiemap into ext2_fiemap. Link: https://lore.kernel.org/r/20210720133341.405438-3-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Jan Kara commit 9907f382a7a0cf883927e2b55653fad83115145e Author: Claudiu Beznea Date: Tue Jul 27 10:40:06 2021 +0300 ARM: dts: at91: add conflict note for d3 Pin feeding d3 led may be in conflict with EBI CS0, USART2 CTS. Add a note for this. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210727074006.1609989-2-claudiu.beznea@microchip.com commit 8d5a937f10ed091e14fc57a4158f59983e2934cf Author: Paul Barker Date: Tue Jul 27 11:54:52 2021 +0300 MAINTAINERS: Adopt SanCloud dts files as supported Myself and Marc are happy to maintain these device tree files going forward. Signed-off-by: Paul Barker Acked-by: Marc Murphy Signed-off-by: Tony Lindgren commit bf781869e5cf3e4ec1a47dad69b6f0df97629cbd Author: Claudiu Beznea Date: Tue Jul 27 10:40:05 2021 +0300 ARM: dts: at91: add pinctrl-{names, 0} for all gpios Add pinctrl-names and pinctrl-0 properties on controllers that claims to use pins to avoid failures due to commit 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges") and also to avoid using pins that may be claimed my other IPs. Fixes: b7c2b6157079 ("ARM: at91: add Atmel's SAMA5D3 Xplained board") Fixes: 1e5f532c2737 ("ARM: dts: at91: sam9x60: add device tree for soc and board") Fixes: 38153a017896 ("ARM: at91/dt: sama5d4: add dts for sama5d4 xplained board") Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210727074006.1609989-1-claudiu.beznea@microchip.com Cc: # v5.7+ commit e48d54c1dfe7d99d4f030ebd0c60a6ba802ba465 Author: Paul Barker Date: Tue Jul 20 09:39:27 2021 +0100 ARM: dts: am335x-sancloud-bbe-lite: New devicetree This adds support for the Sancloud BBE Lite which shares a common hardware base with the non-Lite version of the BBE. Signed-off-by: Paul Barker Signed-off-by: Tony Lindgren commit 3ed926537376a5b879d07e1dafd481acf4ba9d58 Author: Paul Barker Date: Tue Jul 20 09:39:26 2021 +0100 ARM: dts: am335x-sancloud-bbe: Extract common code The Sancloud BBE, BBE Lite and BBE Extended+WiFi share a common hardware base so we can avoid duplication via a dtsi file. Signed-off-by: Paul Barker Signed-off-by: Tony Lindgren commit feb29cf359fbb99098f953c14627970e972de415 Author: Paul Barker Date: Tue Jul 20 09:39:25 2021 +0100 ARM: dts: am335x-boneblack: Extract HDMI config Move the HDMI hardware configuration for the BeagleBone Black out of the boneblack common dtsi file and into its own separate dtsi file. This allows the devicetree for BeagleBone Black derivatives which lack the hdmi encoding hardware to include the common dtsi file without needing to duplicate configuration or override the status of all hdmi-related nodes. Signed-off-by: Paul Barker Signed-off-by: Tony Lindgren commit 8122dc58cb3e3ea1ee10d44e37bf1cd0a4374116 Author: Peter Ujfalusi Date: Sat Jul 17 15:09:24 2021 +0300 bus: ti-sysc: Add quirk for OMAP4 McASP to disable SIDLE mode The McASP module in OMAP4 does not work if the SIDLE mode is enabled, most like due to module integration issue that the signaling is not working correctly. Add a quirk for the module to select only NOIDLE mode when it is in use. Suggested-by: Tony Lindgren Signed-off-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 289be44b6cb9166c74d3f7317590d2c4e8abac4a Author: Eugen Hristev Date: Tue Jun 22 13:17:42 2021 +0300 ARM: dts: at91: sama5d27_som1_ek: enable ADC node Enable the ADC for AN pins on Mikrobus1 and Mikrobus2 on the board. These correspond to channels AD6 and AD7 in the controller. # cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw 240 # cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw 16380 Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210622101742.14535-1-eugen.hristev@microchip.com commit ae3c05cf20efb0a2f3bfb92d23ebbe80a4b4dd24 Author: Peter Ujfalusi Date: Sat Jul 17 15:09:25 2021 +0300 ARM: dts: omap4-l4-abe: Add McASP configuration OMAP4 has a single McASP instance with single serializer and locked for DIT mode. To be able to enable the support the following fixes needed: - Add the DAT port ranges to the target module's ranges We can already fill in the op-mode and serial-dir for McASP as it only supports this configuration, but keep the module disabled as there is no known device available where it is used. Signed-off-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 591c091705e23b0d65d8ed592e877e7e49b7a495 Author: Peter Ujfalusi Date: Sat Jul 17 15:09:23 2021 +0300 ARM: dts: omap4-l4-abe: Correct sidle modes for McASP McASP only supports Force-idle, No-idle and Smart-idle modes Signed-off-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 176f26bcd41a0ee8c69b14e97d1edf50e6485d52 Author: Lokesh Vutla Date: Thu Jul 15 14:20:24 2021 -0700 ARM: dts: Add support for dra762 abz package dra762 abz package is pin compatible with dra742 and few peripherals like DDR with upgraded speed. Add dt support for this SoC. Reported-by: Praneeth Bajjuri Tested-by: Praneeth Bajjuri Signed-off-by: Lokesh Vutla [khilman: forward port from ti-linux-5.4.y] Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren commit cb31bbfa4915455d9620974a1fbfb1a8f07b8903 Author: David Lechner Date: Fri Jul 9 16:47:06 2021 -0500 ARM: dts: am335x-boneblue: add gpio-line-names This adds gpio-line-names to the BeagleBone Blue DTS. The line names are based on the BeagleBone Blue rev A2 schematic. Signed-off-by: David Lechner Signed-off-by: Tony Lindgren commit ae92d42119444318b24a92bf81fb0c724a3bfce3 Author: Peter Robinson Date: Sun Jun 13 13:51:03 2021 +0100 arm: omap2: Drop MACH_OMAP3517EVM entry The MACH_OMAP3517EVM was added back in commit 549f95ed2016 due to being used by the ASoC driver, but this driver was dropped in commit 2c2596f3ab25 as the audio for this board had been moved to a simple-audio-card configuration so MACH_OMAP3517EVM is now properly unuused and can be dropped. Signed-off-by: Peter Robinson Signed-off-by: Tony Lindgren commit 13d29c823738c0bcc72a631b8e6c3c5cb89090d6 Author: Matthew Auld Date: Fri Jul 23 11:50:45 2021 +0100 drm/i915/ehl: unconditionally flush the pages on acquire EHL and JSL add the 'Bypass LLC' MOCS entry, which should make it possible for userspace to bypass the GTT caching bits set by the kernel, as per the given object cache_level. This is troublesome since the heavy flush we apply when first acquiring the pages is skipped if the kernel thinks the object is coherent with the GPU. As a result it might be possible to bypass the cache and read the contents of the page directly, which could be stale data. If it's just a case of userspace shooting themselves in the foot then so be it, but since i915 takes the stance of always zeroing memory before handing it to userspace, we need to prevent this. v2: this time actually set cache_dirty in put_pages() v3: move to get_pages() which looks simpler BSpec: 34007 References: 046091758b50 ("Revert "drm/i915/ehl: Update MOCS table for EHL"") Signed-off-by: Matthew Auld Cc: Tejas Upadhyay Cc: Francisco Jerez Cc: Lucas De Marchi Cc: Jon Bloomfield Cc: Chris Wilson Cc: Matt Roper Cc: Daniel Vetter Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723105045.400841-2-matthew.auld@intel.com commit 3821cc7fc0b90a55c3708628336a97993e464dba Author: Matthew Auld Date: Fri Jul 23 11:50:44 2021 +0100 drm/i915: document caching related bits Try to document the object caching related bits, like cache_coherent and cache_dirty. v2(Ville): - As pointed out by Ville, fix the completely incorrect assumptions about the "partial" coherency on shared LLC platforms. v3(Daniel): - Fix nonsense about "dirtying" the cache with reads. v4(Daniel): - Various improvements, including adding some more details for WT. Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Ville Syrjälä Cc: Mika Kuoppala Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210723105045.400841-1-matthew.auld@intel.com commit 0f3b68b66a6deb41c3c0eb805bb3f407083d2f57 Author: Nicolas Boichat Date: Tue Jul 27 09:45:21 2021 +0800 drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features Many of the DSI flags have names opposite to their actual effects, e.g. MIPI_DSI_MODE_EOT_PACKET means that EoT packets will actually be disabled. Fix this by including _NO_ in the flag names, e.g. MIPI_DSI_MODE_NO_EOT_PACKET. Signed-off-by: Nicolas Boichat Reviewed-by: Linus Walleij Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda Reviewed-by: Xin Ji # anx7625.c Reviewed-by: Abhinav Kumar # msm/dsi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210727094435.v3.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid commit 3da77cf33cf8caf60d5cf29987885abb997a38fa Author: Heiko Carstens Date: Sun Jul 25 15:13:12 2021 +0200 s390/delay: get rid of not needed header includes After all the changes to delay.c there are many includes which are not needed anymore. Get rid of them. Signed-off-by: Heiko Carstens commit 6ab023641a34b18751310bbbeedb0e60aca2e4b2 Author: Heiko Carstens Date: Sun Jul 25 15:07:25 2021 +0200 s390/boot: get rid of arithmetics on function pointers sparse warning: CHECK arch/s390/boot/startup.c arch/s390/boot/startup.c:283:39: error: arithmetics on pointers to functions Signed-off-by: Heiko Carstens commit 243fdac5934f165254dabacdf7266b93567de46d Author: Ilya Leoshkevich Date: Thu Jul 15 13:51:02 2021 +0200 s390/headers: fix code style in module.h struct brace should be on the same line. Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens commit 7e82523f2583e9813e4109df3656707162541297 Author: Heiko Carstens Date: Wed Jul 21 14:03:33 2021 +0200 s390/hwcaps: make sie capability regular hwcap Commit 7f16d7e787b7 ("s390: show virtualization support in /proc/cpuinfo") introduced special handling for sie capability, saying this should not be exposed via hwcaps, without giving a reason. However this leads to an inconsistent /proc/cpuinfo features line where all features except the sie capability are also present in hwcaps. I really don't see a reason to not add that to hwcaps - it might be quite pointless, but at least this way it is possible to get rid of some special handling. Signed-off-by: Heiko Carstens commit 98ac9169e5407510c70621a2106005b26d4d304a Author: Heiko Carstens Date: Wed Jul 21 21:05:35 2021 +0200 s390/hwcaps: remove hwcap stfle check Remove the not so obvious "(elf_hwcap & (1UL << 2)" which only checks if stfle is available. This used to be required for old code before test_facility() was introduced. test_facility() will do the right thing, regardless if stfle is available or not. Signed-off-by: Heiko Carstens commit 487dff5638b90bcdb5a800cd5a63ff4dacc8e677 Author: Heiko Carstens Date: Wed Jul 21 21:03:44 2021 +0200 s390/hwcaps: remove z/Architecture mode active check Remove a leftover from the common 31/64 bit code. z/Architecture mode is now always active, there is no need to check. Signed-off-by: Heiko Carstens commit 449fbd713f57d93460b30ebf41380d9391abba7c Author: Heiko Carstens Date: Wed Jul 21 21:03:04 2021 +0200 s390/hwcaps: use consistent coding style / remove comments Use a consistent coding style within setup_hwcaps() and remove obvious and outdated comments. Signed-off-by: Heiko Carstens commit 251527c9b00c6d41565cfc05d17aa890ccb190e1 Author: Heiko Carstens Date: Wed Jul 21 20:58:03 2021 +0200 s390/hwcaps: open code initialization of first six hwcap bits The first six hwcap bits are initialized in a rather odd way: an array contains the stfl(e) bits which need to be set, so that the corresponding bit position (= array index) within hwcaps are set. Better open code it like it is done for all other bits, making it obvious which bit is set when. Signed-off-by: Heiko Carstens commit 873129ca7b56c7b28dcf712b3bd50c08dc36b910 Author: Heiko Carstens Date: Wed Jul 21 13:25:21 2021 +0200 s390/hwcaps: split setup_hwcaps() setup_hwcaps() is a quite large function. Make it smaller by moving the elf platform setup code into an independent setup function. Signed-off-by: Heiko Carstens commit f17a6d5d83bc05908e5c3fc1c24787aa354653df Author: Heiko Carstens Date: Wed Jul 21 13:23:07 2021 +0200 s390/hwcaps: move setup_hwcaps() Move setup_hwcaps() to processor.c for two reasons: - make setup.c a bit smaller - have allmost all of the hwcap code in one file Signed-off-by: Heiko Carstens commit c68d463286cd481cfbc4b0207fafef1ef5506d3b Author: Heiko Carstens Date: Wed Jul 21 11:39:25 2021 +0200 s390/hwcaps: add sanity checks Add BUILD_BUG_ON() sanity checks to make sure the hwcap string array contains a string for each hwcap. Signed-off-by: Heiko Carstens commit 95655495e404740fd8624398ed92b1e5afb5672f Author: Heiko Carstens Date: Wed Jul 21 11:35:19 2021 +0200 s390/hwcaps: use named initializers for hwcap string arrays Use named initializers to make it obvious which hwcap string array element belongs to which hwcap. Signed-off-by: Heiko Carstens commit 47af00ef42b4a6878d1d6392ef489b9a55f06151 Author: Heiko Carstens Date: Wed Jul 21 11:12:36 2021 +0200 s390/hwcaps: introduce HWCAP bit numbers Introduce HWCAP bit numbers, making it easier to tell at which bit number we currently are. Also use these bits with the BIT macro to define the real HWCAP masks. Signed-off-by: Heiko Carstens commit 511ad531afd4090625def4d9aba1f5227bd44b8e Author: Heiko Carstens Date: Wed Jul 21 10:56:57 2021 +0200 s390/hwcaps: shorten HWCAP defines Remove s390 part of all HWCAP defines, just to make them shorter and easier to handle. The namespace is anyway per architecture. This is similar to what arm64 has. Signed-off-by: Heiko Carstens commit 7e8403ecaf884f307b627f3c371475913dd29292 Author: Niklas Schnelle Date: Thu Jul 8 15:43:13 2021 +0200 s390: add HWCAP_S390_PCI_MIO to ELF hwcaps In order to support the use of enhanced PCI instructions in both kernel- and userspace we need both hardware support and proper setup in the kernel. The latter can be toggled off with the pci=nomio command line option. Thus availability of this feature in userspace depends on all of kernel configuration (CONFIG_PCI), hardware support and the current kernel command line and can thus not rely solely on a facility bit. Instead let's introduce a new ELF hardware capability bit HWCAP_S390_PCI_MIO to tell userspace whether these PCI instructions can be used. Reviewed-by: Heiko Carstens Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 3322ba0d7bea1e24ae464418626f6a15b69533ab Author: Niklas Schnelle Date: Thu Jul 8 14:55:42 2021 +0200 s390: make PCI mio support a machine flag Kernel support for the newer PCI mio instructions can be toggled off with the pci=nomio command line option which needs to integrate with common code PCI option parsing. However this option then toggles static branches which can't be toggled yet in an early_param() call. Thus commit 9964f396f1d0 ("s390: fix setting of mio addressing control") moved toggling the static branches to the PCI init routine. With this setup however we can't check for mio support outside the PCI code during early boot, i.e. before switching the static branches, which we need to be able to export this as an ELF HWCAP. Improve on this by turning mio availability into a machine flag that gets initially set based on CONFIG_PCI and the facility bit and gets toggled off if pci=nomio is found during PCI option parsing allowing simple access to this machine flag after early init. Reviewed-by: Heiko Carstens Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 196e3c6ad1ccea7552b796461d1666bfd9a76b2b Author: Heiko Carstens Date: Mon Feb 15 20:57:53 2021 +0100 s390/disassembler: add instructions Add more instructions to the kernel disassembler. Signed-off-by: Heiko Carstens commit b3bc7980f4ad12c0cd4e2c7a5541ed2a061a0770 Author: Heiko Carstens Date: Wed Jan 13 14:14:01 2021 +0100 s390: report more CPU capabilities Add hardware capability bits and feature tags to /proc/cpuinfo for NNPA and Vector-Packed-Decimal-Enhancement Facility 2. Signed-off-by: Heiko Carstens commit 0d374381d00b92ad73771bb9b09db21e7bb64500 Author: Julian Wiedmann Date: Mon Feb 22 10:18:33 2021 +0100 s390/qdio: remove unused macros These macros haven't seen any use in a long time. Also note that the queue_irqs_*() ones wouldn't even compile anymore. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit bdfd740c1ddac2ec331af9bf79da79d097082882 Author: Julian Wiedmann Date: Wed Jul 14 18:03:51 2021 +0200 s390/qdio: clarify reporting of errors to the drivers Now that all drivers use qdio_inspect_queue() and qdio's internal queue tasklets are gone, the driver-specified queue handlers are only called for async error reporting (eg. for an error condition in the QEBSM code). So take a moment to clean up the Output Queue handlers (they are _always_ called with qdio_error != 0), and clarify which error types can be reported through what interface. As Benjamin already suggested a while ago, we should turn these into distinct enums at some point. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 0ae8f2af262a371d9c49c67a0f5e48982c57cdf4 Author: Julian Wiedmann Date: Mon Jul 12 08:29:32 2021 +0200 s390/qdio: remove unneeded siga-sync for Output Queue get_outbound_buffer_frontier() is only reached via qdio_inspect_queue(), and there we already call qdio_siga_sync_q() unconditionally. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit d01fad2c6a3d2b4962b9195747b07535d2eb3e41 Author: Julian Wiedmann Date: Mon Mar 15 19:39:20 2021 +0100 s390/qdio: remove remaining tasklet & timer code Both qdio drivers have moved away from using qdio's internal tasklet and timer mechanisms for Output Queues. Rip out all the leftovers. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit d1ea9b58c8fbdc280f06b48469b4d056bd69f142 Author: Julian Wiedmann Date: Tue Jun 1 08:20:09 2021 +0200 s390/qdio: propagate error when cancelling a ccw fails If qdio_cancel_ccw() times out (or is interrupted) before the interrupt for the {halt,clear} action arrives, report this back to the caller as an error. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit d06314e0ce20398a0505e42041155d550e70a918 Author: Julian Wiedmann Date: Mon May 31 18:38:04 2021 +0300 s390/qdio: improve roll-back after error on ESTABLISH ccw If the ESTABLISH ccw fails (ie. the qdio_irq is set to QDIO_IRQ_STATE_ERR), we don't need to call qdio_shutdown() for rolling back our earlier actions. All the needed logic is already available in qdio_establish()'s error chain, and using it means we don't have to temporarily drop the setup_mutex either. This makes qdio_shutdown() a purely external function, that should only be called by the driver if an earlier qdio_establish() succeeded. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 1c1dc8bda3a05c60877a6649775894db5343bdea Author: Julian Wiedmann Date: Mon May 31 18:33:02 2021 +0300 s390/qdio: cancel the ESTABLISH ccw after timeout When the ESTABLISH ccw does not complete within the specified timeout, try our best to cancel the ccw program that is still active on the device. Otherwise the IO subsystem might be accessing it even after the driver eg. called qdio_free(). Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Cc: # 2.6.27 Signed-off-by: Heiko Carstens commit 2c197870e4701610ec3b1143808d4e31152caf30 Author: Julian Wiedmann Date: Mon May 31 18:40:06 2021 +0300 s390/qdio: fix roll-back after timeout on ESTABLISH ccw When qdio_establish() times out while waiting for the ESTABLISH ccw to complete, it calls qdio_shutdown() to roll back all of its previous actions. But at this point the qdio_irq's state is still QDIO_IRQ_STATE_INACTIVE, so qdio_shutdown() will exit immediately without doing any actual work. Which means that eg. the qdio_irq's thinint-indicator stays registered, and cdev->handler isn't restored to its old value. And since commit 954d6235be41 ("s390/qdio: make thinint registration symmetric") the qdio_irq also stays on the tiq_list, so on the next qdio_establish() we might get a helpful BUG from the list-debugging code: ... [ 4633.512591] list_add double add: new=00000000005a4110, prev=00000001b357db78, next=00000000005a4110. [ 4633.512621] ------------[ cut here ]------------ [ 4633.512623] kernel BUG at lib/list_debug.c:29! ... [ 4633.512796] [<00000001b2c6ee9a>] __list_add_valid+0x82/0xa0 [ 4633.512798] ([<00000001b2c6ee96>] __list_add_valid+0x7e/0xa0) [ 4633.512800] [<00000001b2fcecce>] qdio_establish_thinint+0x116/0x190 [ 4633.512805] [<00000001b2fcbe58>] qdio_establish+0x128/0x498 ... Fix this by extracting a goto-chain from the existing error exits in qdio_establish(), and check the return value of the wait_event_...() to detect the timeout condition. Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Root-caused-by: Benjamin Block Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Cc: # 2.6.27 Signed-off-by: Heiko Carstens commit f1a5469474312939686ffdbcbf521a1cb78eac81 Author: Alexander Egorenkov Date: Wed Jun 16 14:10:03 2021 +0200 s390/setup: don't reserve memory that occupied decompressor's head There is no useful information within [STARTUP_NORMAL_OFFSET, HEAD_END] now. But the memory region [0, STARTUP_NORMAL_OFFSET] is used by: * lowcore * kdump for swapping memory * stand-alone zipl dumpers for code, data, stack and heap Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 6bda667037764e116d7e43654522945f3822a14e Author: Alexander Egorenkov Date: Tue Jun 15 19:17:36 2021 +0200 s390/boot: move dma sections from decompressor to decompressed kernel This change simplifies the task of making the decompressor relocatable. The decompressor's image contains special DMA sections between _sdma and _edma. This DMA segment is loaded at boot as part of the decompressor and then simply handed over to the decompressed kernel. The decompressor itself never uses it in any way. The primary reason for this is the need to keep the aforementioned DMA segment below 2GB which is required by architecture, and because the decompressor is always loaded at a fixed low physical address, it is guaranteed that the DMA region will not cross the 2GB memory limit. If the DMA region had been placed in the decompressed kernel, then KASLR would make this guarantee impossible to fulfill or it would be restricted to the first 2GB of memory address space. This commit moves all DMA sections between _sdma and _edma from the decompressor's image to the decompressed kernel's image. The complete DMA region is placed in the init section of the decompressed kernel and immediately relocated below 2GB at start-up before it is needed by other parts of the decompressed kernel. The relocation of the DMA region happens even if the decompressed kernel is already located below 2GB in order to keep the first implementation simple. The relocation should not have any noticeable impact on boot time because the DMA segment is only a couple of pages. After relocating the DMA sections, the kernel has to fix all references which point into it. In order to automate this, place all variables pointing into the DMA sections in a special .dma.refs section. All such variables must be defined using the new __dma_ref macro. Only variables containing addresses within the DMA sections must be placed in the new .dma.refs section. Furthermore, move the initialization of control registers from the decompressor to the decompressed kernel because some control registers reference tables that must be placed in the DMA data section to guarantee that their addresses are below 2G. Because the decompressed kernel relocates the DMA sections at startup, the content of control registers CR2, CR5 and CR15 must be updated with new addresses after the relocation. The decompressed kernel initializes all control registers early at boot and then updates the content of CR2, CR5 and CR15 as soon as the DMA relocation has occurred. This practically reverts the commit a80313ff91ab ("s390/kernel: introduce .dma sections"). Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 97dd89e90136a2fe498c45f2fb079609565949d8 Author: Heiko Carstens Date: Sun Jul 25 14:12:58 2021 +0200 s390/ctl_reg: add ctlreg5 and ctlreg15 unions Signed-off-by: Heiko Carstens commit 7accd1f8649643caac8061cea24720b229a57417 Author: Alexander Egorenkov Date: Tue Jun 15 16:05:09 2021 +0200 s390/boot: make _diag308_reset_dma() position-independent As a preparation for moving the .dma.data section from the decompressor to the decompressed kernel, the .dma.data section must be made relocatable by replacing absolute memory addressing with relative one. This is required in order to be able to relocate the DMA section to a memory address <= 2G as required by the hardware architecture. The DMA section must be relocated in case the decompressed kernel was loaded to an address >= 2G which can occur if KASAN is enabled. By making the whole DMA section position-independent we avoid applying relocations to it whenever it is moved to a different address, which becomes possible as soon as it becomes a part of the decompressed kernel. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 6a24d4666f4308e7e7f00bbe7e047dae5499a13d Author: Alexander Egorenkov Date: Wed Jul 21 16:47:20 2021 +0200 s390/boot: move EP_OFFSET and EP_STRING to head.S Both macros are used only in decompressor's head.S, unnecessary to put them in a global header used in many places like setup.h is. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 455cac5028c410345d161344a3860f2a7b636885 Author: Alexander Egorenkov Date: Wed Jul 21 12:27:59 2021 +0200 s390/setup: generate asm offsets from struct parmarea To reduce duplication, replace error-prone and hard-coded parameter area offsets with auto-generated ones. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit f4cb3c9bd041e873ea2a155c0f95fbfab6c3b34c Author: Alexander Egorenkov Date: Wed Jul 21 11:54:33 2021 +0200 s390/setup: drop _OFFSET macros The macros * IPL_DEVICE_OFFSET * INITRD_START_OFFSET * INITRD_SIZE_OFFSET * OLDMEM_BASE_OFFSET * OLDMEM_SIZE_OFFSET * KERNEL_VERSION_OFFSET * COMMAND_LINE_OFFSET are no longer necessary and used only to define another set of macros with the same names but w/o the suffix _OFFSET. Therefore, drop this unnecessary indirection. Drop the macro KERNEL_VERSION_OFFSET w/o renaming it to KERNEL_VERSION because it is used nowhere. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 88a37f810757810e4dff940d0fecb630b2649da8 Author: Alexander Egorenkov Date: Tue Jun 15 12:57:31 2021 +0200 s390/setup: remove unused symbolic constants for C code from setup.h These symbolic constants are used only by assembler code now: * COMMAND_LINE * IPL_DEVICE C code of the decompressed kernel should use boot data passed by the decompressor instead. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit e9e7870f90e3587b712e05db2ded947a3f617119 Author: Alexander Egorenkov Date: Tue Jun 15 14:25:41 2021 +0200 s390/dump: introduce boot data 'oldmem_data' The new boot data struct shall replace global variables OLDMEM_BASE and OLDMEM_SIZE. It is initialized in the decompressor and passed to the decompressed kernel. In comparison to the old solution, this one doesn't access data at fixed physical addresses which will become important when the decompressor becomes relocatable. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 84733284f67b1a937f6205fdb16aa5cbb8b4f53d Author: Alexander Egorenkov Date: Tue Jun 15 14:15:07 2021 +0200 s390/boot: introduce boot data 'initrd_data' The new boot data struct shall replace global variables INITRD_START and INITRD_SIZE. It is initialized in the decompressor and passed to the decompressed kernel. In comparison to the old solution, this one doesn't access data at fixed physical addresses which will become important when the decompressor becomes relocatable. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit f1d3c5323772a215d910aeaf697d210a3671cf81 Author: Alexander Egorenkov Date: Thu Nov 5 13:09:06 2020 +0100 s390/boot: move sclp early buffer from fixed address in asm to C To make the decompressor relocatable, the early SCLP buffer with a fixed address must be replaced with a relocatable C buffer of the according size and alignment as required by SCLP. Introduce a new function sclp_early_set_buffer() into the SCLP driver which enables the decompressor to change the SCLP early buffer at any time. This will be useful when the decompressor becomes fully relocatable and might need to change the SCLP early buffer to one with an address < 2G as required by SCLP because it was loaded at an address >= 2G. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 8b6bd6f295b7ff5e3205ef135de8ad3b2034ed73 Author: Alexander Egorenkov Date: Tue Jun 15 15:59:32 2021 +0200 s390/boot: get rid of magic numbers for startup offsets Use STARTUP_NORMAL_OFFSET and STARTUP_KDUMP_OFFSET instead of magic numbers. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 36af1c5c1598453b29cf3529dd57e58db3e11d19 Author: Heiko Carstens Date: Tue Jul 13 16:21:24 2021 +0200 s390/vdso: use system call functions Use system call functions instead of open-coding svc inline assemblies. This is mostly to get rid of even more register asm constructs. Besides that, it makes the code also a bit easier to understand. The generated code is identical to what is was before. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens commit 91f05c274483eae99c767c4046db60654e1ea06c Author: Heiko Carstens Date: Tue Jul 13 16:21:07 2021 +0200 s390/syscall: provide generic system call functions Provide generic system call functions which should be used whenever a system call needs to be done from user space. The only in-kernel code is vdso, which will be converted with a follow on patch. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens commit b84d0c417a5ac1eb820c8114c0c7cf1fcbf6f017 Author: Heiko Carstens Date: Fri Jun 25 16:42:55 2021 +0200 s390/cpacf: get rid of register asm Using register asm statements has been proven to be very error prone, especially when using code instrumentation where gcc may add function calls, which clobbers register contents in an unexpected way. Therefore get rid of register asm statements in cpacf code, and make sure this bug class cannot happen. Reviewed-by: Patrick Steuer Signed-off-by: Heiko Carstens commit b49d08acb5d924866b86059dc58a4efa6f39189b Author: Heiko Carstens Date: Tue Jul 13 21:09:58 2021 +0200 s390/debug: remove unused print defines Remove unused print defines from debug feature header file. Signed-off-by: Heiko Carstens commit 1487f59ad2a5bb0cef0ea63d18625fab3fd074a1 Author: Heiko Carstens Date: Tue Jul 13 21:07:47 2021 +0200 s390/dasd: remove debug printk Remove dasd ioctl debug printk which seems to be a leftover from the very early days. At least it seems to be quite pointless. Reviewed-by: Stefan Haberland Signed-off-by: Heiko Carstens commit 7f33565b256697727fec7fc86bc1ca07683d7c81 Author: Alexander Egorenkov Date: Fri Jun 25 09:51:15 2021 +0200 s390/uv: de-duplicate checks for Protected Host Virtualization De-duplicate checks for Protected Host Virtualization in decompressor and kernel. Set prot_virt_host=0 in the decompressor in *any* of the following cases and hand it over to the decompressed kernel: * No explicit prot_virt=1 is given on the kernel command-line * Protected Guest Virtualization is enabled * Hardware support not present * kdump or stand-alone dump The decompressed kernel needs to use only is_prot_virt_host() instead of performing again all checks done by the decompressor. Signed-off-by: Alexander Egorenkov Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 42c89439b9fa0368fabd4e1564bdb4a05aeed7eb Author: Alexander Egorenkov Date: Mon Jul 5 19:37:25 2021 +0200 s390/boot: disable Secure Execution in dump mode A dump kernel is neither required nor able to support Secure Execution. Signed-off-by: Alexander Egorenkov Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit c5cf505446db70247a0beb5e70693a5f4754894d Author: Alexander Egorenkov Date: Mon Jul 5 19:33:27 2021 +0200 s390/boot: move uv function declarations to boot/uv.h The functions adjust_to_uv_max() and uv_query_info() are used only in the decompressor. Therefore, move the function declarations from the global arch/s390/include/asm/uv.h to arch/s390/boot/uv.h. Signed-off-by: Alexander Egorenkov Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 5492886c14744d239e87f1b0b774b5a341e755cc Author: Heiko Carstens Date: Mon Jul 12 19:26:01 2021 +0200 s390/jump_label: print real address in a case of a jump label bug In case of a jump label print the real address of the piece of code where a mismatch was detected. This is right before the system panics, so there is nothing revealed. Signed-off-by: Heiko Carstens commit bb50655b8b7027cb413c33c6dd43aa727446b4fb Author: Heiko Carstens Date: Mon Jul 12 19:19:03 2021 +0200 s390/mm: don't print hashed values for pte_ERROR() & friends Print the real pte, pmd, etc. values instead of some hashed value. Otherwise debugging would be even more difficult. This also matches what most other architectures are doing. Signed-off-by: Heiko Carstens commit 3b36369dbffeb82a9491fde74f9489ab21d3f07a Author: Heiko Carstens Date: Mon Jul 12 19:33:09 2021 +0200 s390/mm: use pr_err() instead of printk() for pte_ERROR & friends Use pr_err() to use a proper printk level. Signed-off-by: Heiko Carstens commit 0029b4d19491cd83cfb85de0fa9ac1e175409377 Author: Alexander Egorenkov Date: Sat Oct 10 03:34:25 2020 +0200 s390/sclp: use only one sclp early buffer to send commands A buffer that can be used for communication with SCLP is required to lie below 2GB memory address. Therefore, both sclp_info_sccb and sclp_early_sccb must fulfill this requirement if passed directly to the sclp_early_cmd() function. Instead, use only sclp_early_sccb for communication with SCLP. This allows the buffer sclp_info_sccb to be placed anywhere in the memory address space and, therefore, simplifies the process of making the decompressor relocatable later on, one thing less to relocate. And make sure that the length of the new unified early SCLP buffer is no less than the length of the removed sclp_info_sccb buffer which might be larger than the length of the sclp_early_sccb buffer. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 6040b3f45f394ef3a9fabd68282de92cc271328e Author: Alexander Egorenkov Date: Tue Jun 15 09:20:26 2021 +0200 s390/cio: remove unused include linux/spinlock.h from cio.h * The linux/spinlock.h header was included indirectly by the decompressor and brought unnecessary build dependencies. * Use proper includes in files which either directly or indirectly included cio.h and were hidden until now by the included linux/spinlock.h, e.g. linux/string.h for memcpy() or asm/page.h for PAGE_SIZE. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 256d78d08177d72ae27621378699c9b35231d524 Author: Alexander Egorenkov Date: Wed Jun 30 17:17:53 2021 +0200 s390/boot: make stacks part of the decompressor's image Instead of using constant addresses for the normal and dump-info stacks, allocate both stacks in the decompressor's image and load the stack register in a position-independent manner. This will allow loading and entering the decompressor at an arbitrary memory address without corrupting the content at the fixed addresses used until now for both stacks. This is one of the prerequisites for being able to kexec the decompressor from its load address without relocating it first. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 7fadcc078785416b1e2423fc624e054bb5a6e3b0 Author: Alexander Egorenkov Date: Wed Jun 30 17:12:25 2021 +0200 s390/boot: move all linker symbol declarations from c to h files To prevent multiple incompatible declarations of symbols and to catch such mistakes at compile time. Signed-off-by: Alexander Egorenkov Acked-by: Heiko Carstens Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit df6192f47d2311cf40cd4321cc59863a5853b665 Author: Ian Kent Date: Fri Jul 16 17:28:40 2021 +0800 kernfs: dont call d_splice_alias() under kernfs node lock The call to d_splice_alias() in kernfs_iop_lookup() doesn't depend on any kernfs node so there's no reason to hold the kernfs node lock when calling it. Reviewed-by: Miklos Szeredi Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/162642772000.63632.10672683419693513226.stgit@web.messagingengine.com Signed-off-by: Greg Kroah-Hartman commit 47b5c64d0ab5e7136db2b78c6ec710e0d8a5a36b Author: Ian Kent Date: Fri Jul 16 17:28:34 2021 +0800 kernfs: use i_lock to protect concurrent inode updates The inode operations .permission() and .getattr() use the kernfs node write lock but all that's needed is the read lock to protect against partial updates of these kernfs node fields which are all done under the write lock. And .permission() is called frequently during path walks and can cause quite a bit of contention between kernfs node operations and path walks when the number of concurrent walks is high. To change kernfs_iop_getattr() and kernfs_iop_permission() to take the rw sem read lock instead of the write lock an additional lock is needed to protect against multiple processes concurrently updating the inode attributes and link count in kernfs_refresh_inode(). The inode i_lock seems like the sensible thing to use to protect these inode attribute updates so use it in kernfs_refresh_inode(). The last hunk in the patch, applied to kernfs_fill_super(), is possibly not needed but taking the lock was present originally. I prefer to continue to take it to protect against a partial update of the source kernfs fields during the call to kernfs_refresh_inode() made by kernfs_get_inode(). Reviewed-by: Miklos Szeredi Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/162642771474.63632.16295959115893904470.stgit@web.messagingengine.com Signed-off-by: Greg Kroah-Hartman commit 7ba0273b2f34a55efe967d3c7381fb1da2ca195f Author: Ian Kent Date: Fri Jul 16 17:28:29 2021 +0800 kernfs: switch kernfs to use an rwsem The kernfs global lock restricts the ability to perform kernfs node lookup operations in parallel during path walks. Change the kernfs mutex to an rwsem so that, when opportunity arises, node searches can be done in parallel with path walk lookups. Reviewed-by: Miklos Szeredi Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/162642770946.63632.2218304587223241374.stgit@web.messagingengine.com Signed-off-by: Greg Kroah-Hartman commit c7e7c04274b13f98f758fb69b03f2ab61976ea80 Author: Ian Kent Date: Fri Jul 16 17:28:24 2021 +0800 kernfs: use VFS negative dentry caching If there are many lookups for non-existent paths these negative lookups can lead to a lot of overhead during path walks. The VFS allows dentries to be created as negative and hashed, and caches them so they can be used to reduce the fairly high overhead alloc/free cycle that occurs during these lookups. Use the kernfs node parent revision to identify if a change has been made to the containing directory so that the negative dentry can be discarded and the lookup redone. Reviewed-by: Miklos Szeredi Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/162642770420.63632.15791924970508867106.stgit@web.messagingengine.com Signed-off-by: Greg Kroah-Hartman commit 895adbec302e92086359e6fd92611ac3be6d92c3 Author: Ian Kent Date: Fri Jul 16 17:28:18 2021 +0800 kernfs: add a revision to identify directory node changes Add a revision counter to kernfs directory nodes so it can be used to detect if a directory node has changed during negative dentry revalidation. There's an assumption that sizeof(unsigned long) <= sizeof(pointer) on all architectures and as far as I know that assumption holds. So adding a revision counter to the struct kernfs_elem_dir variant of the kernfs_node type union won't increase the size of the kernfs_node struct. This is because struct kernfs_elem_dir is at least sizeof(pointer) smaller than the largest union variant. It's tempting to make the revision counter a u64 but that would increase the size of kernfs_node on archs where sizeof(pointer) is smaller than the revision counter. Reviewed-by: Miklos Szeredi Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/162642769895.63632.8356662784964509867.stgit@web.messagingengine.com Signed-off-by: Greg Kroah-Hartman commit 91d1be9fb7d667ae136f05cc645276eb2c9fa40e Author: Geert Uytterhoeven Date: Mon Jul 19 17:17:00 2021 +0200 pinctrl: renesas: Fix pin control matching on R-Car H3e-2G As R-Car H3 ES1.x (R8A77950) and R-Car ES2.0+ (R8A77951) use the same compatible value, the pin control driver relies on soc_device_match() with soc_id = "r8a7795" and the (non)matching of revision = "ES1.*" to match with and distinguish between the two SoC variants. The corresponding entries in the normal of_match_table are present only to make the optional sanity checks work. The R-Car H3e-2G (R8A779M1) SoC is a different grading of the R-Car H3 ES3.0 (R8A77951) SoC. It uses the same compatible values for individual devices, but has an additional compatible value for the root node. When running on an R-Car H3e-2G SoC, soc_device_match() with soc_id = "r8a7795" does not return a match. Hence the pin control driver falls back to the normal of_match_table, and, as the R8A77950 entry is listed first, incorrectly uses the sub-driver for R-Car H3 ES1.x. Fix this by moving the entry for R8A77951 before the entry for R8A77950. Simplify sh_pfc_quirk_match() to only handle R-Car H3 ES1,x, as R-Car H3 ES2.0+ can now be matched using the normal of_match_table as well. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/6cdc5bfa424461105779b56f455387e03560cf66.1626707688.git.geert+renesas@glider.be commit bfe6b5590ce6cab81b3ee51b4541bd1d0b18b3b2 Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:33 2021 +0200 soc: renesas: Identify R-Car H3e-2G and M3e-2G Add support for identifying the R-Car H3e-2G (R8A779M1) and R-Car M3e-2G (R8A779M3) SoCs. As these are different gradings of the already supported R-Car H3 ES3.0 (R8A77951) and M3-W+ (R8A77961) SoCs, support for them is enabled through the existing ARCH_R8A77951 and ARCH_R8A77961 configuration symbols. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/42b4578ab4739cb48ec3aed0a447fc40c34de1e5.1626708063.git.geert+renesas@glider.be commit 3e82868e8523d5426f76866863704b02adacac3e Author: Geert Uytterhoeven Date: Mon Jul 19 17:38:32 2021 +0200 dt-bindings: arm: renesas: Document R-Car H3e-2G and M3e-2G SoCs and boards Document the compatible values for the R-Car H3e-2G (R8A779M1) and M3e-2G (R8A779M3) SoCs. These are different gradings of the R-Car H3 ES3.0 (R8A77951) and M3-W+ (R8A77961) SoCs. All R-Car Gen3e on-SoC devices are identical to the devices on the corresponding R-Car Gen3 SoCs, and thus just use the compatible values for the latter. The root compatible properties do gain an additional value, to sort out integration issues if they ever arise. Document the use of these SoCs on the Salvator-XS and ULCB (with and without Kingfisher) development boards. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Yoshihiro Shimoda Acked-by: Rob Herring Link: https://lore.kernel.org/r/fd11328199d8abba5b9ee1f43f4d467d1bc41df6.1626708063.git.geert+renesas@glider.be commit bdac4d8abbfc239886103f7c6ee03abb8011a008 Merge: e7deeb9d79d86 ff1176468d368 Author: Greg Kroah-Hartman Date: Tue Jul 27 09:22:08 2021 +0200 Merge 5.14-rc3 into driver-core-next We need the driver-core fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit f1abdb78a1080a49deac6e91e1675525d1d3dfbe Author: Namjae Jeon Date: Tue Jul 27 13:25:13 2021 +0900 ksmbd: add ipv6_addr_v4mapped check to know if connection from client is ipv4 ksmbd create socket with IPv6 to listen both IPv4 and IPv6 connection from client. Server should send IP addresses of NICs through network interface info response. If Client connection is IPv4, Server should fill IPv4 address in response buffer. But ss_family is always PF_INET6 on IPv6 socket. So This patch add ipv6_addr_v4mapped check to know client connection is IPv4. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6c99dfc4c5f6fa1f5a90c068be6201d7a0cebff1 Author: Namjae Jeon Date: Tue Jul 27 09:40:05 2021 +0900 ksmbd: fix missing error code in smb2_lock Dan report a warning that is missing error code in smb2_lock from static checker. This patch add error code to avoid static checker warning. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9798c653547d35cebef59d35edbbc269d85fb1b3 Author: Nilesh Javali Date: Wed Jun 23 22:26:06 2021 -0700 scsi: qla2xxx: Update version to 10.02.00.107-k Link: https://lore.kernel.org/r/20210624052606.21613-12-njavali@marvell.com Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 71bef5020cd13e1aaa878d10481aafc1ecd4a8f6 Author: Quinn Tran Date: Wed Jun 23 22:26:05 2021 -0700 scsi: qla2xxx: edif: Increment command and completion counts Increment the command and the completion counts. Link: https://lore.kernel.org/r/20210624052606.21613-11-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 44d018577f179383ea2c409f3a392e9dbd1a155e Author: Quinn Tran Date: Wed Jun 23 22:26:04 2021 -0700 scsi: qla2xxx: edif: Add encryption to I/O path Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. After the completion of PLOGI, both sides have authenticated and PRLI completed, encrypted I/Os are allowed to proceed. - Use new firmware API to encrypt traffic on the wire - Add driver parameter to enable|disable EDIF feature # modprobe qla2xxx ql2xsecenable=1 Link: https://lore.kernel.org/r/20210624052606.21613-10-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 7a09e8d92c6d56121910ccb2e8bc0d1affff66ee Author: Quinn Tran Date: Wed Jun 23 22:26:03 2021 -0700 scsi: qla2xxx: edif: Add doorbell notification for app Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. During runtime, driver and authentication application need to stay in sync in terms of: Session being down|up, arrival of new authentication message (AUTH ELS) and SADB update completion. These events are queued up as doorbell to the authentication application. Application would read this doorbell on regular basis to stay up to date. Each SCSI host would have a separate doorbell queue. The doorbell interface can daisy chain a list of events for each read. Each event contains an event code + hint to help application steer the next course of action. Link: https://lore.kernel.org/r/20210624052606.21613-9-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 9efea843a906c6674ac6728f3f5db2cbfa3e1830 Author: Quinn Tran Date: Wed Jun 23 22:26:02 2021 -0700 scsi: qla2xxx: edif: Add detection of secure device Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. There is no FC switch scan service that can indicate whether a device is secure or non-secure. In order to detect whether the remote port supports encrypted operation, driver must first do a PLOGI with the remote device. On completion of the PLOGI, driver will query firmware to see if the device supports secure login. To do that, driver + firmware must advertise the security bit via PLOGI's service parameter. The remote device shall respond using the same service parameter whether it supports it or not. Link: https://lore.kernel.org/r/20210624052606.21613-8-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 8a4bb2c1dd623b5a71609de5b04ef3b5086b0a3e Author: Quinn Tran Date: Wed Jun 23 22:26:01 2021 -0700 scsi: qla2xxx: edif: Add authentication pass + fail bsgs Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. On completion of the authentication process, the authentication application will notify driver on whether it is successful or not. In case of success, application will use the QL_VND_SC_AUTH_OK BSG call to tell driver to proceed to the PRLI phase. In case of failure, application will use the QL_VND_SC_AUTH_FAIL bsg call to tell driver to tear down the connection and retry. In the case where an existing session is active, the re-key process can fail. The session tear down ensures data is not further compromised. Link: https://lore.kernel.org/r/20210624052606.21613-7-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit dd30706e73b70d67e88fdaca688db7a3374fd5de Author: Quinn Tran Date: Wed Jun 23 22:26:00 2021 -0700 scsi: qla2xxx: edif: Add key update Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. As part of the authentication process, the authentication application will generate a SADB entry (Security Association/SA, key, SPI value, etc). This SADB is then passed to driver to be programmed into hardware. There will be a pair of SADB's (Tx and Rx) for each connection. After some period, the application can choose to change the key. At that time, a new set of SADB pair is given to driver. The old set of SADB will be deleted. Add a new bsg call (QL_VND_SC_SA_UPDATE) to allow application to allow adding or deleting SADB entries. Driver will not keep the key in memory. It will pass it to HW. It is assumed that application will assign a unique SPI value to this SADB (SA + key). Driver + hardware will assign a handle to track this unique SPI/SADB. Link: https://lore.kernel.org/r/20210624052606.21613-6-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit fac2807946c10b9a509b9c348afd442fa823c5f7 Author: Quinn Tran Date: Wed Jun 23 22:25:59 2021 -0700 scsi: qla2xxx: edif: Add extraction of auth_els from the wire Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. Once authentication messages sent from a remote device have arrived, each message is extracted and placed in a buffer for application to retrieve. The FC frame header will be stripped, leaving behind the AUTH ELS payload. It is up to the application to strip the AUTH ELS header to get to the actual authentication message. Link: https://lore.kernel.org/r/20210624052606.21613-5-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 84318a9f01ce13650ea23eb6362066bb95ccc9fe Author: Quinn Tran Date: Wed Jun 23 22:25:58 2021 -0700 scsi: qla2xxx: edif: Add send, receive, and accept for auth_els Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. Add the ability for authentication application to send and retrieve messages as part of the authentication process via existing FC_BSG_HST_ELS_NOLOGIN BSG interface. To send a message, application is expected to format the data in the AUTH ELS format. Refer to FC-SP2 for details. If a message was received, application is required to reply with either a LS_ACC or LS_RJT complete the exchange using the same interface. Otherwise, remote device will treat it as a timeout. Link: https://lore.kernel.org/r/20210624052606.21613-4-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 7878f22a2e03b69baf792f74488962981a1c9547 Author: Quinn Tran Date: Wed Jun 23 22:25:57 2021 -0700 scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. Add two new BSG calls: - QL_VND_SC_GET_FCINFO: Application can from time to time request a list of all FC ports or a single device that supports secure connection. If driver sees a new or old device has logged into the switch, this call is used to check for the WWPN. - QL_VND_SC_GET_STATS: Application request for various statistics for each FC port. Link: https://lore.kernel.org/r/20210624052606.21613-3-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 7ebb336e45ef1ce23462c3bbd03779929008901f Author: Quinn Tran Date: Wed Jun 23 22:25:56 2021 -0700 scsi: qla2xxx: edif: Add start + stop bsgs Some FC adapters from Marvell offer the ability to encrypt data in flight (EDIF). This feature requires an application to act as an authenticator. Add two new BSG calls: - QL_VND_SC_APP_START: Application will announce its presence to driver with this call. Driver will restart all connections to see if remote device supports security or not. - QL_VND_SC_APP_STOP: Application announces it is in the process of exiting. Driver will restart all connections to revert back to non-secure. Provided the remote device is willing to allow a non-secure connection. Link: https://lore.kernel.org/r/20210624052606.21613-2-njavali@marvell.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Larry Wisneski Signed-off-by: Larry Wisneski Co-developed-by: Duane Grigsby Signed-off-by: Duane Grigsby Co-developed-by: Rick Hicksted Jr Signed-off-by: Rick Hicksted Jr Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit cb51bcd5c34b0558ba2bb04963bcb1053375a8e4 Author: Bill Wendling Date: Mon Jul 26 13:19:24 2021 -0700 scsi: qla2xxx: Remove unused variable 'status' Fix the clang build warning: drivers/scsi/qla2xxx/qla_nx.c:2209:6: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable] int status = 0; Link: https://lore.kernel.org/r/20210726201924.3202278-4-morbo@google.com Reviewed-by: Nathan Chancellor Signed-off-by: Bill Wendling Signed-off-by: Martin K. Petersen commit 0525265e434ba6c24f4a2c468114c4b21e48cb7a Author: Guoqing Jiang Date: Fri Jul 23 16:46:24 2021 +0800 scsi: libsas: Drop BLK_DEV_BSGLIB selection SCSI_SAS_ATTRS already selects BLK_DEV_BSGLIB in drivers/scsi/Kconfig. Remove selection in libsas/Kconfig. Link: https://lore.kernel.org/r/20210723084624.2596297-1-guoqing.jiang@linux.dev Signed-off-by: Guoqing Jiang Signed-off-by: Martin K. Petersen commit 8f13142ac2eb04642e1c451b4475743d77e9c86c Author: Colin Ian King Date: Wed Jul 21 11:15:19 2021 +0100 scsi: target: Remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read, the assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210721101519.42299-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit ff2d86d04d2614e33e122eb9a43ae9fd2a7274af Author: Colin Ian King Date: Wed Jul 21 10:53:50 2021 +0100 scsi: lpfc: Remove redundant assignment to pointer pcmd The pointer pcmd is being initialized with a value that is never read, the assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20210721095350.41564-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit 45e524d61ec4dd600f4d34360301398d52594a44 Author: James Smart Date: Thu Jul 22 15:17:21 2021 -0700 scsi: lpfc: Copyright updates for 14.0.0.0 patches Update copyrights to 2021 for files modified in the 14.0.0.0 patch set. Link: https://lore.kernel.org/r/20210722221721.74388-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 95518cabe1193e1746c77be6d8233d76dcf1969e Author: James Smart Date: Thu Jul 22 15:17:20 2021 -0700 scsi: lpfc: Update lpfc version to 14.0.0.0 Update lpfc version to 14.0.0.0. Link: https://lore.kernel.org/r/20210722221721.74388-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 bfc477854a42c3de6c2f34c7e8f7ef9917ef53ca Author: James Smart Date: Thu Jul 22 15:17:19 2021 -0700 scsi: lpfc: Add 256 Gb link speed support Update routines to support 256 Gb link speed for LPe37000/LPe38000 adapters. 256 Gb speeds can be seen on trunk links. Link: https://lore.kernel.org/r/20210722221721.74388-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 f6c5e6c4561d2a94a8eb39e6d4cb87a715bbd3de Author: James Smart Date: Thu Jul 22 15:17:18 2021 -0700 scsi: lpfc: Revise Topology and RAS support checks for new adapters Support for Topology and RAS logging capabilities were qualified by PCIe device ID checks necessitating additional driver changes for new device IDs. Reduce reliance on specific PCIe device IDs by substituting checks for SLI family information. This automatically picks up support on the newest hardware. Link: https://lore.kernel.org/r/20210722221721.74388-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 df3d78c3eb4eba13b3ef9740a8c664508ee644ae Author: James Smart Date: Thu Jul 22 15:17:17 2021 -0700 scsi: lpfc: Fix cq_id truncation in rq create On the newer hardware, CQ_ID values can be larger than seen on previous generations. This exposed an issue in the driver where its definition of cq_id in the RQ Create mailbox cmd was too small, thus the cq_id was truncated, causing the command to fail. Revise the RQ_CREATE CQ_ID field to its proper size (16 bits). Link: https://lore.kernel.org/r/20210722221721.74388-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 f449a3d7a1530db44e7bba1a875f522115e99ab5 Author: James Smart Date: Thu Jul 22 15:17:16 2021 -0700 scsi: lpfc: Add PCI ID support for LPe37000/LPe38000 series adapters Update supported pci_device_id table to include the values for the G7+ ASIC Device ID utilized by LPe37xxx and LPe38xxx series of adapters. The default reporting string will be "LPe38000". Link: https://lore.kernel.org/r/20210722221721.74388-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 d17929eb1066d1c1653aae9bb4396a9f1d6602ac Author: Dinh Nguyen Date: Tue Jul 13 09:46:21 2021 -0500 clk: socfpga: agilex: add the bypass register for s2f_usr0 clock Add the bypass register for the s2f_user0_clk. Fixes: 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform") Cc: stable@vger.kernel.org Signed-off-by: Kris Chaplin Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20210713144621.605140-3-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit f817c132db679d492d96c60993fa2f2c67ab18d0 Author: Dinh Nguyen Date: Tue Jul 13 09:46:20 2021 -0500 clk: socfpga: agilex: fix up s2f_user0_clk representation Correct the s2f_user0_mux clock representation. Fixes: 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform") Cc: stable@vger.kernel.org Signed-off-by: Kris Chaplin Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20210713144621.605140-2-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 9d563236cca43fc4fe190b3be173444bd48e2a3b Author: Dinh Nguyen Date: Tue Jul 13 09:46:19 2021 -0500 clk: socfpga: agilex: fix the parents of the psi_ref_clk The psi_ref_clk comes from the C2 node of the main_pll and periph_pll, not the C3. Fixes: 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform") Cc: stable@vger.kernel.org Signed-off-by: Kris Chaplin Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20210713144621.605140-1-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 08bdbc6ef46ad522a24dc6b8e01c039cb0c7e761 Author: Namjae Jeon Date: Tue Jul 27 09:30:29 2021 +0900 ksmbd: use channel signingkey for binding SMB2 session setup Windows client disconnect connection by wrong signed SMB2 session setup response on SMB3 multichannel mode. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9fb8fac08f6670c9bba70d6c616ad84dd7a45528 Author: Namjae Jeon Date: Tue Jul 27 09:28:10 2021 +0900 ksmbd: don't set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO ksmbd does not support RSS mode stably. RSS mode enabling will be set later. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d337a44e429e6de23ed3d73fcb81ec44f7b05522 Author: Marios Makassikis Date: Tue Jul 27 09:24:51 2021 +0900 ksmbd: Return STATUS_OBJECT_PATH_NOT_FOUND if smb2_creat() returns ENOENT Both Windows 10's SMB server and samba return STATUS_OBJECT_PATH_NOT_FOUND when trying to access a nonexistent path. This fixes Windows 10 File History tool. The latter relies on the server returning STATUS_OBJECT_PATH_NOT_FOUND to figure out what part of the target path needs to be created. Returning STATUS_OBJECT_NAME_INVALID will make it stop and display an error to the user. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3abc16af57c9939724df92fcbda296b25cc95168 Author: Patryk Duda Date: Tue May 18 16:07:58 2021 +0200 platform/chrome: cros_ec_proto: Send command again when timeout occurs Sometimes kernel is trying to probe Fingerprint MCU (FPMCU) when it hasn't initialized SPI yet. This can happen because FPMCU is restarted during system boot and kernel can send message in short window eg. between sysjump to RW and SPI initialization. Cc: # 4.4+ Signed-off-by: Patryk Duda Link: https://lore.kernel.org/r/20210518140758.29318-1-pdk@semihalf.com Signed-off-by: Benson Leung commit 6bdab0e5b5c0aca6f5aba952df0e4c5934547681 Author: José Roberto de Souza Date: Fri Jul 16 18:12:26 2021 -0700 drm/i915/display/psr2: Fix cursor updates using legacy apis The fast path only updates cursor register what will not cause any updates in the screen when using PSR2 selective fetch. The only option that we have is to go through the slow patch that will do full atomic commit, that will trigger the PSR2 selective fetch compute and programing calls. Without this patch is possible to see a mouse movement lag in Gnome when PSR2 selective fetch is enabled. Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210717011227.204494-3-jose.souza@intel.com commit 5cc92edb6ee8ac6f6d6d4fd8e7ecd00407a2489a Author: José Roberto de Souza Date: Fri Jul 16 18:12:25 2021 -0700 drm/i915/display/psr2: Mark as updated all planes that intersect with pipe_clip Without this planes that were added by intel_psr2_sel_fetch_update() that intersect with pipe damaged area will not have skl_program_plane() and intel_psr2_program_plane_sel_fetch() called, causing panel to not be properly updated. Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210717011227.204494-2-jose.souza@intel.com commit 4cda0c82a34bce96a4e7f229e48a0a57f39acd1b Author: Jussi Maki Date: Thu Jul 8 02:17:27 2021 +0000 selftests/bpf: Use ping6 only if available in tc_redirect In the tc_redirect test only use ping6 if it's available and otherwise fall back to using "ping -6". Signed-off-by: Jussi Maki commit 15d428e6fe77fffc3f4fff923336036f5496ef17 Author: Waiman Long Date: Tue Jul 20 10:18:27 2021 -0400 cgroup/cpuset: Fix a partition bug with hotplug In cpuset_hotplug_workfn(), the detection of whether the cpu list has been changed is done by comparing the effective cpus of the top cpuset with the cpu_active_mask. However, in the rare case that just all the CPUs in the subparts_cpus are offlined, the detection fails and the partition states are not updated correctly. Fix it by forcing the cpus_updated flag to true in this particular case. Fixes: 4b842da276a8 ("cpuset: Make CPU hotplug work with partition") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 0f3adb8a1e5f36e792598c1d77a2cfac9c90a4f9 Author: Waiman Long Date: Tue Jul 20 10:18:26 2021 -0400 cgroup/cpuset: Miscellaneous code cleanup Use more descriptive variable names for update_prstate(), remove unnecessary code and fix some typos. There is no functional change. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 268ca4129d8da764fdf72916f762a1145c6ea743 Merge: 323e0cb473e2a e2f154e6b601f Author: David S. Miller Date: Mon Jul 26 23:09:31 2021 +0100 Merge branch 'ipa-clock' Alex Elder says: ==================== net: ipa: defer taking uC proxy clock This series rearranges some of the IPA initialization code. The first patch gets rid of two trivial setup and teardown functions, open-coding them in their callers instead. The second patch has memory regions get configured before endpoints. IPA interrupts do not depend on GSI being initialized. Therefore they can be initialized in the config phase rather than waiting for setup. The third patch moves this initialization earlier; memory regions must already be defined, so it's done after memory config. The microcontroller also has no dependency on GSI, though it does require IPA interrupts to be configured. The fourth patch moves microcontroller initialization so it too happens during the config phase rather than setup. Finally, we currently take a "proxy clock" for the microcontroller during the config phase, dropping it only after we learn the microcontroller is initialized. But microcontroller initialization is started by the modem, so there's no point in taking that clock reference before we know the modem has booted. So the last patch arranges to wait to take the "proxy clock" for the microcontroller until we know the modem is about to boot. ==================== Signed-off-by: David S. Miller commit e2f154e6b601fb25344ae244834de19881edb289 Author: Alex Elder Date: Mon Jul 26 15:11:36 2021 -0500 net: ipa: introduce ipa_uc_clock() The first time it's booted, the modem loads and starts the IPA-resident microcontroller. Once the microcontroller has completed its initialization, it notifies the AP it's "ready" by sending an INIT_COMPLETED response message. Until it receives that microcontroller message, the AP must ensure the IPA core clock remains operational. Currently, a "proxy" clock reference is taken in ipa_uc_config(), dropping it again once the message is received. However there could be a long delay between when ipa_config() completes and when modem actually starts. And because the microcontroller gets loaded by the modem, there's no need to get the modem "proxy clock" until the first time it starts. Create a new function ipa_uc_clock() which takes the "proxy" clock reference for the microcontroller. Call it when we get remoteproc SSR notification that the modem is about to start. Keep an additional flag to record whether this proxy clock reference needs to be dropped at shutdown time, and issue a warning if we get the microcontroller message either before the clock reference is taken, or after it has already been dropped. Drop the nearby use of "hh" length modifiers, which are no longer encouraged in the kernel. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit dc8f7e3924a99515d8c3d3dbd905ad1327ac37b6 Author: Alex Elder Date: Mon Jul 26 15:11:35 2021 -0500 net: ipa: set up the microcontroller earlier Initializing up the IPA-resident microcontroller requires the IPA clock, and sets up two IPA interrupt handlers, but this does not require GSI access. The interrupt handlers also require the clock to be enabled, and require the IPA memory regions to be configured, but neither requires GSI access. As a result, the microcontroller can be initialized during the "config" rather than "setup" phase of IPA initialization. Initialize the microcontroller in ipa_config() rather than ipa_setup(), and rename the called function ipa_uc_config(). Do the inverse in ipa_deconfig() rather than ipa_teardown(), and rename the function for that case ipa_uc_deconfig(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 1118a14710ee97292c52e0185d12caa3eb17ad55 Author: Alex Elder Date: Mon Jul 26 15:11:34 2021 -0500 net: ipa: set up IPA interrupts earlier Initialization of the IPA driver has several phases: - "init" phase can be done without any access to IPA hardware - "config" phase requires the IPA hardware to be clocked - "setup" phase requires the GSI layer to be functional Currently, initialization for the IPA interrupt handling code occurs in the setup phase. It requires access to the IPA hardware but does not need GSI, so it can be moved to the config phase instead. Call the interrupt configuration function early in ipa_config() rather than from ipa_setup(). Rename ipa_interrupt_setup() to be ipa_interrupt_config(), and ipa_interrupt_teardown() to be ipa_interupt_deconfig(), so their names properly indicate when they get called. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 07e1f6897f735296aeff6c135cb8ddb4040a3e20 Author: Alex Elder Date: Mon Jul 26 15:11:33 2021 -0500 net: ipa: configure memory regions early IPA-resident memory is one of the most primitive resources that needs initialization, so call init_mem_config() early in ipa_config(). This is in preparation for initializing the IPA-resident microcontroller earlier. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 63961f544e271db5f5d3a03164cbe28fcb7eba93 Author: Alex Elder Date: Mon Jul 26 15:11:32 2021 -0500 net: ipa: kill ipa_modem_setup() The functions ipa_modem_setup() and ipa_modem_teardown() are trivial wrappers that call ipa_qmi_setup() and ipa_qmi_teardown(). Just call the QMI functions directly, and get rid of the wrappers. Improve the documentation of what setting up QMI does. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 323e0cb473e2a8706ff162b6b4f4fa16023c9ba7 Author: Gustavo A. R. Silva Date: Mon Jul 26 14:25:11 2021 -0500 flow_dissector: Fix out-of-bounds warnings Fix the following out-of-bounds warnings: net/core/flow_dissector.c: In function '__skb_flow_dissect': >> net/core/flow_dissector.c:1104:4: warning: 'memcpy' offset [24, 39] from the object at '' is out of the bounds of referenced subobject 'saddr' with type 'struct in6_addr' at offset 8 [-Warray-bounds] 1104 | memcpy(&key_addrs->v6addrs, &iph->saddr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1105 | sizeof(key_addrs->v6addrs)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/ipv6.h:5, from net/core/flow_dissector.c:6: include/uapi/linux/ipv6.h:133:18: note: subobject 'saddr' declared here 133 | struct in6_addr saddr; | ^~~~~ >> net/core/flow_dissector.c:1059:4: warning: 'memcpy' offset [16, 19] from the object at '' is out of the bounds of referenced subobject 'saddr' with type 'unsigned int' at offset 12 [-Warray-bounds] 1059 | memcpy(&key_addrs->v4addrs, &iph->saddr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1060 | sizeof(key_addrs->v4addrs)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/ip.h:17, from net/core/flow_dissector.c:5: include/uapi/linux/ip.h:103:9: note: subobject 'saddr' declared here 103 | __be32 saddr; | ^~~~~ The problem is that the original code is trying to copy data into a couple of struct members adjacent to each other in a single call to memcpy(). So, the compiler legitimately complains about it. As these are just a couple of members, fix this by copying each one of them in separate calls to memcpy(). This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/d5ae2e65-1f18-2577-246f-bada7eee6ccd@intel.com/ Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 6321c7acb82872ef6576c520b0e178eaad3a25c0 Author: Gustavo A. R. Silva Date: Mon Jul 26 14:52:51 2021 -0500 ipv4: ip_output.c: Fix out-of-bounds warning in ip_copy_addrs() Fix the following out-of-bounds warning: In function 'ip_copy_addrs', inlined from '__ip_queue_xmit' at net/ipv4/ip_output.c:517:2: net/ipv4/ip_output.c:449:2: warning: 'memcpy' offset [40, 43] from the object at 'fl' is out of the bounds of referenced subobject 'saddr' with type 'unsigned int' at offset 36 [-Warray-bounds] 449 | memcpy(&iph->saddr, &fl4->saddr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 450 | sizeof(fl4->saddr) + sizeof(fl4->daddr)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The problem is that the original code is trying to copy data into a couple of struct members adjacent to each other in a single call to memcpy(). This causes a legitimate compiler warning because memcpy() overruns the length of &iph->saddr and &fl4->saddr. As these are just a couple of struct members, fix this by using direct assignments, instead of memcpy(). This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/d5ae2e65-1f18-2577-246f-bada7eee6ccd@intel.com/ Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 22171146f84ba57db44071de60ad44cfe634574a Author: Alex Elder Date: Mon Jul 26 11:45:04 2021 -0500 net: ipa: enable inline checksum offload for IPA v4.5+ The RMNet and IPA drivers both support inline checksum offload now. So enable it for the TX and RX modem endoints for IPA version 4.5+. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 2739bd76fceb07e3ffba025322ae765c337b21a7 Merge: beeee08ca1d43 5bc5588466a1f Author: David S. Miller Date: Mon Jul 26 22:38:24 2021 +0100 Merge branch 'ipa-kill-validation' Alex Elder says: ==================== net: ipa: kill IPA_VALIDATION A few months ago I proposed cleaning up some code that validates certain things conditionally, arguing that doing so once is enough, thus doing so always should not be necessary. https://lore.kernel.org/netdev/20210320141729.1956732-1-elder@linaro.org/ Leon Romanovsky felt strongly that this was a mistake, and in the end I agreed to change my plans. This series finally completes what I said I would do about this, ultimately eliminating the IPA_VALIDATION symbol and conditional code entirely. The first patch both extends and simplifies some validation done for IPA immediate commands, and performs those tests unconditionally. The second patch fixes a bug that wasn't normally exposed because of the conditional compilation (a reason Leon was right about this). It makes filter and routing table validation occur unconditionally. The third eliminates the remaining conditionally-defined code and removes the line in the Makefile used to enable validation. And the fourth removes all comments containing ipa_assert() statements, replacing most of them with WARN_ON() calls. ==================== Signed-off-by: David S. Miller commit 5bc5588466a1f8b48fb04f56c46474a30508a3d6 Author: Alex Elder Date: Mon Jul 26 12:40:10 2021 -0500 net: ipa: use WARN_ON() rather than assertions I've added commented assertions to record certain properties that can be assumed to hold in certain places in the IPA code. Convert these into real WARN_ON() calls so the assertions are actually checked, using the standard WARN_ON() mechanism. Where errors can be returned, return an error if a warning is triggered. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 442d68ebf0927681e9405c3db8e9fafb754cb458 Author: Alex Elder Date: Mon Jul 26 12:40:09 2021 -0500 net: ipa: kill the remaining conditional validation code There are only a few remaining spots that validate IPA code conditional on whether a symbol is defined at compile time. The checks are not expensive, so just build them always. This completes the removal of all CONFIG_VALIDATE/CONFIG_VALIDATION IPA code. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 546948bf362541857d4f500705efe08a2fe0bb95 Author: Alex Elder Date: Mon Jul 26 12:40:08 2021 -0500 net: ipa: always validate filter and route tables All checks in ipa_table_validate_build() are computed at build time, so build that unconditionally. In ipa_table_valid() calls to ipa_table_valid_one() are missing the IPA pointer parameter is missing in (a bug that shows up only when IPA_VALIDATE is defined). Don't bother checking whether hashed table memory regions are valid if hashed tables are not supported. With those things fixed, have these table validation functions built unconditionally (not dependent on IPA_VALIDATE). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa Author: Alex Elder Date: Mon Jul 26 12:40:07 2021 -0500 net: ipa: fix ipa_cmd_table_valid() Stop supporting different sizes for hashed and non-hashed filter or route tables. Add BUILD_BUG_ON() calls to verify the sizes of the fields in the filter/route table initialization immediate command are the same. Add a check to ipa_cmd_table_valid() to ensure the size of the memory region being checked fits within the immediate command field that must hold it. Remove two Boolean parameters used only for error reporting. This actually fixes a bug that would only show up if IPA_VALIDATE were defined. Define ipa_cmd_table_valid() unconditionally (no longer dependent on IPA_VALIDATE). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit beeee08ca1d432891f9e1f6188eea85ffac68527 Merge: 9bff668419234 edac6f6332d96 Author: David S. Miller Date: Mon Jul 26 22:35:33 2021 +0100 Merge branch 'sja1105-bridge-port-traffic-termination' Vladimir Oltean says: ==================== Traffic termination for sja1105 ports under VLAN-aware bridge This set of patches updates the sja1105 DSA driver to be able to send and receive network stack packets on behalf of a VLAN-aware upper bridge interface. The reasons why this has traditionally been a problem are explained in the "Traffic support" section of Documentation/networking/dsa/sja1105.rst. (the entire documentation will be revised in a separate patch series). The limitations that have prevented us from doing this so far have now been partially lifted by the bridge's ability to send a packet with skb->offload_fwd_mark = true, which means that the accelerator is allowed to look up its hardware FDB when sending a packet and deliver it to those destination ports. Basically skb->dev is now just a conduit to the switchdev driver's ndo_start_xmit(), and does not guarantee that the packet will really be transmitted on that port (but it will be transmitted where it should, nonetheless). Apart from the ability to perform IP termination on VLAN-aware bridges on top of sja1105 interfaces, we also gain the following features: - VLAN-aware software bridging between sja1105 ports and "foreign" (non-DSA) interfaces - software bridging between sja1105 bridge ports, and software LAG uppers of sja1105 ports (as long as the bridge is VLAN-aware) The only things that don't work are: 1. to create an AF_PACKET socket on top of a sja1105 port that is under a VLAN-aware bridge. This is because the "imprecise RX" procedure selects an RX port for data plane* packets based on the assumption that the packet will land in the bridge's data path. If ebtables rules are added to remove some packets from the bridge's data path, that assumption will be broken. Nonetheless, this is not a limitation that negatively impacts the known use cases with this switch. If there was a way to impose user space restrictions against creating AF_PACKET sockets on this particular configuration, I could be interested in adding those restrictions, but I think there are other known broken configs already which are not checked by the kernel today (like for example that the bridge's rx_handler steals packets anyway from AF_PACKET sockets with exact-match ptype handlers, as opposed to ptype_all which are processed earlier; this is precisely the reason why ebtables rules are generally needed to avoid that). 2. to send traffic on behalf of an 8021q upper of a standalone interface, while other sja1105 ports are part of a VLAN-aware bridge. This is because sja1105 sets ds->vlan_filtering_is_global = true, so we cannot make the standalone port ignore the VLAN header from the packet on RX, so we cannot make tag_8021q enforce its own pvid for the packets belonging to that port's 8021q upper. So we cannot determine in the first place that packets come from that port, unless we iterate through all 8021q uppers of all ports, and enforce uniqueness of VLAN IDs. I am not sure if this is what I want / if it is worth it, so currently all 8021q uppers are denied, regardless of whether the switch has ports under a VLAN-aware bridge or not (otherwise it becomes complicated even to track the state). Nonetheless, the VID uniqueness of all 8021q uppers does raise another question: what to do with VID 0, which has no 8021q upper, but the 8021q module adds it to our RX filter with vlan_vid_add(). I am honestly not sure what to do. The best I can do is enable a hardware bit in sja1105 which reclassifies VID 0 frames to the PVID, and they will be sent on the CPU port using either the tag_8021q pvid of standalone ports, or the bridge pvid of VLAN-aware ports. So at the very least, those packets are still 'kinda' processed as if they were untagged, but the VID 0 is lost, though. In my defence, Marvell appears to do the same thing with reclassifying VID 0 frames, see commit b8b79c414eca ("net: dsa: mv88e6xxx: Fix adding vlan 0"). *Control packets (currently hardcoded in sja1105 as link-local packets for MAC DA ranges 01-80-c2-xx-xx-xx and 01-1b-19-xx-xx-xx) are received based on packet traps and their precise source port is always known. I have taken one patch from Colin because my work conflicts with his, and integrating it all through the same series avoids that. ==================== Signed-off-by: David S. Miller commit edac6f6332d96aab59af5f27a195f55cd080f034 Author: Vladimir Oltean Date: Mon Jul 26 19:55:36 2021 +0300 Revert "net: dsa: Allow drivers to filter packets they can decode source port from" This reverts commit cc1939e4b3aaf534fb2f3706820012036825731c. Currently 2 classes of DSA drivers are able to send/receive packets directly through the DSA master: - drivers with DSA_TAG_PROTO_NONE - sja1105 Now that sja1105 has gained the ability to perform traffic termination even under the tricky case (VLAN-aware bridge), and that is much more functional (we can perform VLAN-aware bridging with foreign interfaces), there is no reason to keep this code in the receive path of the network core. So delete it. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b6ad86e6ad6c46e52cac218e62613c6c47cf7fa0 Author: Vladimir Oltean Date: Mon Jul 26 19:55:35 2021 +0300 net: dsa: sja1105: add bridge TX data plane offload based on tag_8021q The main desire for having this feature in sja1105 is to support network stack termination for traffic coming from a VLAN-aware bridge. For sja1105, offloading the bridge data plane means sending packets as-is, with the proper VLAN tag, to the chip. The chip will look up its FDB and forward them to the correct destination port. But we support bridge data plane offload even for VLAN-unaware bridges, and the implementation there is different. In fact, VLAN-unaware bridging is governed by tag_8021q, so it makes sense to have the .bridge_fwd_offload_add() implementation fully within tag_8021q. The key difference is that we only support 1 VLAN-aware bridge, but we support multiple VLAN-unaware bridges. So we need to make sure that the forwarding domain is not crossed by packets injected from the stack. For this, we introduce the concept of a tag_8021q TX VLAN for bridge forwarding offload. As opposed to the regular TX VLANs which contain only 2 ports (the user port and the CPU port), a bridge data plane TX VLAN is "multicast" (or "imprecise"): it contains all the ports that are part of a certain bridge, and the hardware will select where the packet goes within this "imprecise" forwarding domain. Each VLAN-unaware bridge has its own "imprecise" TX VLAN, so we make use of the unique "bridge_num" provided by DSA for the data plane offload. We use the same 3 bits from the tag_8021q VLAN ID format to encode this bridge number. Note that these 3 bit positions have been used before for sub-VLANs in best-effort VLAN filtering mode. The difference is that for best-effort, the sub-VLANs were only valid on RX (and it was documented that the sub-VLAN field needed to be transmitted as zero). Whereas for the bridge data plane offload, these 3 bits are only valid on TX. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 884be12f85666c6e9ff1cf3ead06a7371f6863dc Author: Vladimir Oltean Date: Mon Jul 26 19:55:34 2021 +0300 net: dsa: sja1105: add support for imprecise RX This is already common knowledge by now, but the sja1105 does not have hardware support for DSA tagging for data plane packets, and tag_8021q sets up a unique pvid per port, transmitted as VLAN-tagged towards the CPU, for the source port to be decoded nonetheless. When the port is part of a VLAN-aware bridge, the pvid committed to hardware is taken from the bridge and not from tag_8021q, so we need to work with that the best we can. Configure the switches to send all packets to the CPU as VLAN-tagged (even ones that were originally untagged on the wire) and make use of dsa_untag_bridge_pvid() to get rid of it before we send those packets up the network stack. With the classified VLAN used by hardware known to the tagger, we first peek at the VID in an attempt to figure out if the packet was received from a VLAN-unaware port (standalone or under a VLAN-unaware bridge), case in which we can continue to call dsa_8021q_rcv(). If that is not the case, the packet probably came from a VLAN-aware bridge. So we call the DSA helper that finds for us a "designated bridge port" - one that is a member of the VLAN ID from the packet, and is in the proper STP state - basically these are all checks performed by br_handle_frame() in the software RX data path. The bridge will accept the packet as valid even if the source port was maybe wrong. So it will maybe learn the MAC SA of the packet on the wrong port, and its software FDB will be out of sync with the hardware FDB. So replies towards this same MAC DA will not work, because the bridge will send towards a different netdev. This is where the bridge data plane offload ("imprecise TX") added by the next patch comes in handy. The software FDB is wrong, true, but the hardware FDB isn't, and by offloading the bridge forwarding plane we have a chance to right a wrong, and have the hardware look up the FDB for us for the reply packet. So it all cancels out. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 19fa937a391e58f4bb74ea52a5cdb4f259e67db2 Author: Vladimir Oltean Date: Mon Jul 26 19:55:33 2021 +0300 net: dsa: sja1105: deny more than one VLAN-aware bridge With tag_sja1105.c's only ability being to perform an imprecise RX procedure and identify whether a packet comes from a VLAN-aware bridge or not, we have no way to determine whether a packet with VLAN ID 5 comes from, say, br0 or br1. Actually we could, but it would mean that we need to restrict all VLANs from br0 to be different from all VLANs from br1, and this includes the default_pvid, which makes a setup with 2 VLAN-aware bridges highly imprectical. The fact of the matter is that this isn't even that big of a practical limitation, since even with a single VLAN-aware bridge we can pretty much enforce forwarding isolation based on the VLAN port membership. So in the end, tell the user that they need to model their setup using a single VLAN-aware bridge. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 4fbc08bd366595dab4bedfec08021bad8609ba77 Author: Vladimir Oltean Date: Mon Jul 26 19:55:32 2021 +0300 net: dsa: sja1105: deny 8021q uppers on ports Now that best-effort VLAN filtering is gone and we are left with the imprecise RX and imprecise TX based in VLAN-aware mode, where the tagger just guesses the source port based on plausibility of the VLAN ID, 8021q uppers installed on top of a standalone port, while other ports of that switch are under a VLAN-aware bridge don't quite "just work". In fact it could be possible to restrict the VLAN IDs used by the 8021q uppers to not be shared with VLAN IDs used by that VLAN-aware bridge, but then the tagger needs to be patched to search for 8021q uppers too, not just for the "designated bridge port" which will be introduced in a later patch. I haven't given a possible implementation full thought, it seems maybe possible but not worth the effort right now. The only certain thing is that currently the tagger won't be able to figure out the source port for these packets because they will come with the VLAN ID of the 8021q upper and are no longer retagged to a tag_8021q sub-VLAN like the best effort VLAN filtering code used to do. So just deny these for the moment. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6dfd23d35e75098ac61a605f6c591ce42e95cdcb Author: Vladimir Oltean Date: Mon Jul 26 19:55:31 2021 +0300 net: dsa: sja1105: delete vlan delta save/restore logic With the best_effort_vlan_filtering mode now gone, the driver does not have 3 operating modes anymore (VLAN-unaware, VLAN-aware and best effort), but only 2. The idea is that we will gain support for network stack I/O through a VLAN-aware bridge, using the data plane offload framework (imprecise RX, imprecise TX). So the VLAN-aware use case will be more functional. But standalone ports that are part of the same switch when some other ports are under a VLAN-aware bridge should work too. Termination on those should work through the tag_8021q RX VLAN and TX VLAN. This was not possible using the old logic, because: - in VLAN-unaware mode, only the tag_8021q VLANs were committed to hw - in VLAN-aware mode, only the bridge VLANs were committed to hw - in best-effort VLAN mode, both the tag_8021q and bridge VLANs were committed to hw The strategy for the new VLAN-aware mode is to allow the bridge and the tag_8021q VLANs to coexist in the VLAN table at the same time. [ yes, we need to make sure that the bridge cannot install a tag_8021q VLAN, but ] This means that the save/restore logic introduced by commit ec5ae61076d0 ("net: dsa: sja1105: save/restore VLANs using a delta commit method") does not serve a purpose any longer. We can delete it and restore the old code that simply adds a VLAN to the VLAN table and calls it a day. Note that we keep the sja1105_commit_pvid() function from those days, but adapt it slightly. Ports that are under a VLAN-aware bridge use the bridge's pvid, ports that are standalone or under a VLAN-unaware bridge use the tag_8021q pvid, for local termination or VLAN-unaware forwarding. Now, when the vlan_filtering property is toggled for the bridge, the pvid of the ports beneath it is the only thing that's changing, we no longer delete some VLANs and restore others. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d63f8877c48c30f8c3cd263e30658e947fc90f64 Author: Colin Ian King Date: Mon Jul 26 19:55:30 2021 +0300 net: dsa: sja1105: remove redundant re-assignment of pointer table The pointer table is being re-assigned with a value that is never read. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit ee80dd2e89ecce9c5dd6f556b8f581c9e1cbb605 Author: Vladimir Oltean Date: Mon Jul 26 19:55:29 2021 +0300 net: bridge: add a helper for retrieving port VLANs from the data path Introduce a brother of br_vlan_get_info() which is protected by the RCU mechanism, as opposed to br_vlan_get_info() which relies on taking the write-side rtnl_mutex. This is needed for drivers which need to find out whether a bridge port has a VLAN configured or not. For example, certain DSA switches might not offer complete source port identification to the CPU on RX, just the VLAN in which the packet was received. Based on this VLAN, we cannot set an accurate skb->dev ingress port, but at least we can configure one that behaves the same as the correct one would (this is possible because DSA sets skb->offload_fwd_mark = 1). When we look at the bridge RX handler (br_handle_frame), we see that what matters regarding skb->dev is the VLAN ID and the port STP state. So we need to select an skb->dev that has the same bridge VLAN as the packet we're receiving, and is in the LEARNING or FORWARDING STP state. The latter is easy, but for the former, we should somehow keep a shadow list of the bridge VLANs on each port, and a lookup table between VLAN ID and the 'designated port for imprecise RX'. That is rather complicated to keep in sync properly (the designated port per VLAN needs to be updated on the addition and removal of a VLAN, as well as on the join/leave events of the bridge on that port). So, to avoid all that complexity, let's just iterate through our finite number of ports and ask the bridge, for each packet: "do you have this VLAN configured on this port?". Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f7cdb3ecc9b7f609082fc89e5b79d66858504899 Author: Vladimir Oltean Date: Mon Jul 26 19:55:28 2021 +0300 net: bridge: update BROPT_VLAN_ENABLED before notifying switchdev in br_vlan_filter_toggle SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING is notified by the bridge from two places: - nbp_vlan_init(), during bridge port creation - br_vlan_filter_toggle(), during a netlink/sysfs/ioctl change requested by user space If a switchdev driver uses br_vlan_enabled(br_dev) inside its handler for the SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING attribute notifier, different things will be seen depending on whether the bridge calls from the first path or the second: - in nbp_vlan_init(), br_vlan_enabled() reflects the current state of the bridge - in br_vlan_filter_toggle(), br_vlan_enabled() reflects the past state of the bridge This can lead in some cases to complications in driver implementation, which can be avoided if these could reliably use br_vlan_enabled(). Nothing seems to depend on this behavior, and it seems overall more straightforward for br_vlan_enabled() to return the proper value even during the SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING notifier, so temporarily enable the bridge option, then revert it if the switchdev notifier failed. Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9bff6684192347fcb4cd780f83f2394c5430ae88 Merge: d20e5880fe9df 09f83569189f0 Author: David S. Miller Date: Mon Jul 26 22:32:24 2021 +0100 Merge tag 'mlx5-updates-2021-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-updates-2021-07-24 This series aims to reduce coupling in mlx5e, particularly between RX resources (TIRs, RQTs) and numerous code units that use them. This refactoring is required for upcoming features, ADQ and TX lag hashing. The issue with the current code is that TIRs and RQTs are unmanaged, different places all over the driver create, destroy, track and configure them, often in an uncoordinated way. The responsibilities of different units become vague, leading to a lot of hidden dependencies between numerous units and tight coupling between them, which is prone to bugs and hard to maintain. The result of this refactoring is: 1. Creating a manager for RX resources, that controls their lifecycle and provides a clear API, which restricts the set of actions that other units can do. 2. Using object-oriented approach for TIRs, RQTs and RX resource manager (struct mlx5e_rx_res). 3. Fixing a few bugs and misbehaviors found during the refactoring. 4. Reducing the amount of dependencies, removing hidden dependencies, making them one-directional and organizing the code in clear abstraction layers. 5. Explicitly exposing the remaining weird dependencies. 6. Simplifying and organizing code that creates and modifies TIRs and RQTs. Saeed Mahameed says: ==================== mlx5 updates 2021-07-24 This series provides some refactoring to mlx5e RX resource management, it is required for upcoming ADQ and TX lag hashing features. The first two patches in this series : net/mlx5e: Prohibit inner indir TIRs in IPoIB net/mlx5e: Block LRO if firmware asks for tunneled LRO Were supposed to go to net, but due to dependency and timing they were included here. I would appreciate it if you'd apply them to net and mark for -stable. For more information please see tag log below. Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller commit d20e5880fe9df149a9159673d9fec57aab43ac61 Merge: af996031e1545 8dad5561c13ad Author: David S. Miller Date: Mon Jul 26 22:07:29 2021 +0100 Merge tag 'linux-can-next-for-5.15-20210725' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next linux-can-next-for-5.15-20210725 Marc Kleine-Budde says: ==================== pull-request: can-next 2021-07-25 this is a pull request of 46 patches for net-next/master. The first 6 patches target the CAN J1939 protocol. One is from gushengxian, fixing a grammatical error, 5 are by me fixing a checkpatch warning, make use of the fallthrough pseudo-keyword, and use consistent variable naming. The next 3 patches target the rx-offload helper, are by me and improve the performance and fix the local softirq work pending error, when napi_schedule() is called from threaded IRQ context. The next 3 patches are by Vincent Mailhol and me update the CAN bittiming and transmitter delay compensation, the documentation for the struct can_tdc is fixed, clear data_bittiming if FD mode is turned off and a redundant check is removed. Followed by 4 patches targeting the m_can driver. Faiz Abbas's patches add support for CAN PHY via the generic phy subsystem. Yang Yingliang converts the driver to use devm_platform_ioremap_resource_byname(). And a patch by me which removes the unused support for custom bit timing. Andy Shevchenko contributes 2 patches for the mcp251xfd driver to prepare the driver for ACPI support. A patch by me adds support for shared IRQ handlers. Zhen Lei contributes 3 patches to convert the esd_usb2, janz-ican3 and the at91_can driver to make use of the DEVICE_ATTR_RO/RW() macros. The next 8 patches are by Peng Li and provide general cleanups for the at91_can driver. The next 7 patches target the peak driver. Frist 2 cleanup patches by me for the peak_pci driver, followed by Stephane Grosjean' patch to print the name and firmware version of the detected hardware. The peak_usb driver gets a cleanup patch, loopback and one-shot mode and an upgrading of the bus state change handling in Stephane Grosjean's patches. Vincent Mailhol provides 6 cleanup patches for the etas_es58x driver. In the last 3 patches Angelo Dureghello add support for the mcf5441x SoC to the flexcan driver. ==================== Signed-off-by: David S. Miller commit 0937a7b3625d489735de595d4c9dbf9ad7ec3c44 Author: Alexander Sverdlin Date: Mon Jul 26 16:59:52 2021 +0300 video: ep93xx: Prepare clock before using it Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework. Signed-off-by: Alexander Sverdlin Signed-off-by: Nikita Shubin Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210726140001.24820-5-nikita.shubin@maquefel.me commit f98f273f3a984ea8592a384391c1a38b7e46c404 Author: Artjom Vejsel Date: Mon Jul 26 01:15:25 2021 +0300 dt-bindings: Add QiShenglong vendor prefix Add vendor prefix for Shenzhen QiShenglong Industrialist Co., Ltd. QiShenglong is a Chinese manufacturer of handheld gaming consoles, most of which run (very old) versions of Linux. QiShenglong is known as Hamy. Signed-off-by: Artjom Vejsel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210725221527.1771892-2-akawolf0@gmail.com commit 93ea7aa8dfc0c006c6b53ffd47088b8e9ce5248f Author: Bjorn Andersson Date: Mon Jul 26 10:33:00 2021 -0700 drm/panel: simple: Add support for two more AUO panels Add definition of the AUO B133HAN05.4 13.3" FHD panel and the B140HAN06.4 14.0" FHD panel. Signed-off-by: Bjorn Andersson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210726173300.432039-2-bjorn.andersson@linaro.org commit fdb57c3217a0fb992dda3aa812878b30d6a391c7 Author: Bjorn Andersson Date: Mon Jul 26 10:32:59 2021 -0700 dt-bindings: display: simple: Add AUO B133HAN05 & B140HAN06 Add bindings for the two AUO panels B133HAN05 and B140HAN06, both 1920x1080 panels with 16.7M colors, first being 13.3" and the latter 14.0". Signed-off-by: Bjorn Andersson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210726173300.432039-1-bjorn.andersson@linaro.org commit 793eccae89bb495cfb44dceeaa13044160c49611 Merge: 2b7e9f25e5907 b0588390dbced Author: Andrii Nakryiko Date: Mon Jul 26 12:11:23 2021 -0700 Merge branch 'libbpf: Move CO-RE logic into separate file.' Alexei Starovoitov says: ==================== From: Alexei Starovoitov Split CO-RE processing logic from libbpf into separate file with an interface that doesn't dependend on libbpf internal details. As the next step relo_core.c will be compiled with libbpf and with the kernel. The _internal_ interface between libbpf/CO-RE and kernel/CO-RE will be: int bpf_core_apply_relo_insn(const char *prog_name, struct bpf_insn *insn, int insn_idx, const struct bpf_core_relo *relo, int relo_idx, const struct btf *local_btf, struct bpf_core_cand_list *cands); where bpf_core_relo and bpf_core_cand_list are simple types prepared by kernel and libbpf. Though diff stat shows a lot of lines inserted/deleted they are moved lines. Pls review with diff.colorMoved. ==================== Signed-off-by: Andrii Nakryiko commit b0588390dbcedcd74fab6ffb8afe8d52380fd8b6 Author: Alexei Starovoitov Date: Tue Jul 20 17:08:22 2021 -0700 libbpf: Split CO-RE logic into relo_core.c. Move CO-RE logic into separate file. The internal interface between libbpf and CO-RE is through bpf_core_apply_relo_insn() function and few structs defined in relo_core.h. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721000822.40958-5-alexei.starovoitov@gmail.com commit 301ba4d710284e088d278adc477b7edad834577f Author: Alexei Starovoitov Date: Tue Jul 20 17:08:21 2021 -0700 libbpf: Move CO-RE types into relo_core.h. In order to make a clean split of CO-RE logic move its types into independent header file. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721000822.40958-4-alexei.starovoitov@gmail.com commit 3ee4f5335511b5357d3e762b3461b0d13e565ad5 Author: Alexei Starovoitov Date: Tue Jul 20 17:08:20 2021 -0700 libbpf: Split bpf_core_apply_relo() into bpf_program independent helper. bpf_core_apply_relo() doesn't need to know bpf_program internals and hashmap details. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721000822.40958-3-alexei.starovoitov@gmail.com commit 6e43b28607848eeb079c033f415b410788569b27 Author: Alexei Starovoitov Date: Tue Jul 20 17:08:19 2021 -0700 libbpf: Cleanup the layering between CORE and bpf_program. CO-RE processing functions don't need to know 'struct bpf_program' details. Cleanup the layering to eventually be able to move CO-RE logic into a separate file. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721000822.40958-2-alexei.starovoitov@gmail.com commit f92763cb0feba247e0939ed137b495601fd072a5 Author: Zheyu Ma Date: Mon Jul 26 10:03:55 2021 +0000 video: fbdev: riva: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero first. The following log reveals it: [ 33.396850] divide error: 0000 [#1] PREEMPT SMP KASAN PTI [ 33.396864] CPU: 5 PID: 11754 Comm: i740 Not tainted 5.14.0-rc2-00513-gac532c9bbcfb-dirty #222 [ 33.396883] RIP: 0010:riva_load_video_mode+0x417/0xf70 [ 33.396969] Call Trace: [ 33.396973] ? debug_smp_processor_id+0x1c/0x20 [ 33.396984] ? tick_nohz_tick_stopped+0x1a/0x90 [ 33.396996] ? rivafb_copyarea+0x3c0/0x3c0 [ 33.397003] ? wake_up_klogd.part.0+0x99/0xd0 [ 33.397014] ? vprintk_emit+0x110/0x4b0 [ 33.397024] ? vprintk_default+0x26/0x30 [ 33.397033] ? vprintk+0x9c/0x1f0 [ 33.397041] ? printk+0xba/0xed [ 33.397054] ? record_print_text.cold+0x16/0x16 [ 33.397063] ? __kasan_check_read+0x11/0x20 [ 33.397074] ? profile_tick+0xc0/0x100 [ 33.397084] ? __sanitizer_cov_trace_const_cmp4+0x24/0x80 [ 33.397094] ? riva_set_rop_solid+0x2a0/0x2a0 [ 33.397102] rivafb_set_par+0xbe/0x610 [ 33.397111] ? riva_set_rop_solid+0x2a0/0x2a0 [ 33.397119] fb_set_var+0x5bf/0xeb0 [ 33.397127] ? fb_blank+0x1a0/0x1a0 [ 33.397134] ? lock_acquire+0x1ef/0x530 [ 33.397143] ? lock_release+0x810/0x810 [ 33.397151] ? lock_is_held_type+0x100/0x140 [ 33.397159] ? ___might_sleep+0x1ee/0x2d0 [ 33.397170] ? __mutex_lock+0x620/0x1190 [ 33.397180] ? trace_hardirqs_on+0x6a/0x1c0 [ 33.397190] do_fb_ioctl+0x31e/0x700 Signed-off-by: Zheyu Ma Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1627293835-17441-4-git-send-email-zheyuma97@gmail.com commit 1520b4b7ba964f8eec2e7dd14c571d50de3e5191 Author: Zheyu Ma Date: Mon Jul 26 10:03:54 2021 +0000 video: fbdev: kyro: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. if the driver doesn't check the value of 'pixclock', it may cause divide error because the value of 'lineclock' and 'frameclock' will be zero. Fix this by checking whether 'pixclock' is zero in kyrofb_check_var(). The following log reveals it: [ 103.073930] divide error: 0000 [#1] PREEMPT SMP KASAN PTI [ 103.073942] CPU: 4 PID: 12483 Comm: syz-executor Not tainted 5.14.0-rc2-00478-g2734d6c1b1a0-dirty #118 [ 103.073959] RIP: 0010:kyrofb_set_par+0x316/0xc80 [ 103.074045] Call Trace: [ 103.074048] ? ___might_sleep+0x1ee/0x2d0 [ 103.074060] ? kyrofb_ioctl+0x330/0x330 [ 103.074069] fb_set_var+0x5bf/0xeb0 [ 103.074078] ? fb_blank+0x1a0/0x1a0 [ 103.074085] ? lock_acquire+0x3bd/0x530 [ 103.074094] ? lock_release+0x810/0x810 [ 103.074103] ? ___might_sleep+0x1ee/0x2d0 [ 103.074114] ? __mutex_lock+0x620/0x1190 [ 103.074126] ? trace_hardirqs_on+0x6a/0x1c0 [ 103.074137] do_fb_ioctl+0x31e/0x700 [ 103.074144] ? fb_getput_cmap+0x280/0x280 [ 103.074152] ? rcu_read_lock_sched_held+0x11/0x80 [ 103.074162] ? rcu_read_lock_sched_held+0x11/0x80 [ 103.074171] ? __sanitizer_cov_trace_switch+0x67/0xf0 [ 103.074181] ? __sanitizer_cov_trace_const_cmp2+0x20/0x80 [ 103.074191] ? do_vfs_ioctl+0x14b/0x16c0 [ 103.074199] ? vfs_fileattr_set+0xb60/0xb60 [ 103.074207] ? rcu_read_lock_sched_held+0x11/0x80 [ 103.074216] ? lock_release+0x483/0x810 [ 103.074224] ? __fget_files+0x217/0x3d0 [ 103.074234] ? __fget_files+0x239/0x3d0 [ 103.074243] ? do_fb_ioctl+0x700/0x700 [ 103.074250] fb_ioctl+0xe6/0x130 Signed-off-by: Zheyu Ma Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1627293835-17441-3-git-send-email-zheyuma97@gmail.com commit b36b242d4b8ea178f7fd038965e3cac7f30c3f09 Author: Zheyu Ma Date: Mon Jul 26 10:03:53 2021 +0000 video: fbdev: asiliantfb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero first. The following log reveals it: [ 43.861711] divide error: 0000 [#1] PREEMPT SMP KASAN PTI [ 43.861737] CPU: 2 PID: 11764 Comm: i740 Not tainted 5.14.0-rc2-00513-gac532c9bbcfb-dirty #224 [ 43.861756] RIP: 0010:asiliantfb_check_var+0x4e/0x730 [ 43.861843] Call Trace: [ 43.861848] ? asiliantfb_remove+0x190/0x190 [ 43.861858] fb_set_var+0x2e4/0xeb0 [ 43.861866] ? fb_blank+0x1a0/0x1a0 [ 43.861873] ? lock_acquire+0x1ef/0x530 [ 43.861884] ? lock_release+0x810/0x810 [ 43.861892] ? lock_is_held_type+0x100/0x140 [ 43.861903] ? ___might_sleep+0x1ee/0x2d0 [ 43.861914] ? __mutex_lock+0x620/0x1190 [ 43.861921] ? do_fb_ioctl+0x313/0x700 [ 43.861929] ? mutex_lock_io_nested+0xfa0/0xfa0 [ 43.861936] ? __this_cpu_preempt_check+0x1d/0x30 [ 43.861944] ? _raw_spin_unlock_irqrestore+0x46/0x60 [ 43.861952] ? lockdep_hardirqs_on+0x59/0x100 [ 43.861959] ? _raw_spin_unlock_irqrestore+0x46/0x60 [ 43.861967] ? trace_hardirqs_on+0x6a/0x1c0 [ 43.861978] do_fb_ioctl+0x31e/0x700 Signed-off-by: Zheyu Ma Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1627293835-17441-2-git-send-email-zheyuma97@gmail.com commit bc1c8e4eee79646b9ae10ededed06a569c7c2bc9 Author: Jack Yu Date: Mon Jul 26 09:15:41 2021 +0000 ASoC: rt1015: Remove unnecessary flush work on rt1015 driver Remove workqueue of flush work in rt1015 driver since we don't need it after internal discussion, and there is no impact on performance without this workqueue. Signed-off-by: Jack Yu Link: https://lore.kernel.org/r/3ef458a6ad754589b96d6a94abda1e55@realtek.com Signed-off-by: Mark Brown commit f9398f15605a50110bf570aaa361163a85113dd1 Author: Kees Cook Date: Fri Jul 23 15:19:31 2021 -0700 lib/test_stackinit: Fix static initializer test The static initializer test got accidentally converted to a dynamic initializer. Fix this and retain the giant padding hole without using an aligned struct member. Fixes: 50ceaa95ea09 ("lib: Introduce test_stackinit module") Cc: Ard Biesheuvel Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210723221933.3431999-2-keescook@chromium.org commit b12d93e9958e028856cbcb061b6e64728ca07755 Author: Marek Behún Date: Thu Jun 24 19:14:18 2021 +0200 PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported The ASMedia ASM1062 SATA controller advertises Max_Payload_Size_Supported of 512, but in fact it cannot handle incoming TLPs with payload size of 512. We discovered this issue on PCIe controllers capable of MPS = 512 (Aardvark and DesignWare), where the issue presents itself as an External Abort. Bjorn Helgaas says: Probably ASM1062 reports a Malformed TLP error when it receives a data payload of 512 bytes, and Aardvark, DesignWare, etc convert this to an arm64 External Abort. [1] To avoid this problem, limit the ASM1062 Max Payload Size Supported to 256 bytes, so we set the Max Payload Size of devices that may send TLPs to the ASM1062 to 256 or less. [1] https://lore.kernel.org/linux-pci/20210601170907.GA1949035@bjorn-Precision-5520/ BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212695 Link: https://lore.kernel.org/r/20210624171418.27194-2-kabel@kernel.org Reported-by: Rötti Signed-off-by: Marek Behún Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński Reviewed-by: Pali Rohár Cc: stable@vger.kernel.org commit 00a2b7c758958e13b12c56179e85df6bc2acc0c7 Merge: ff1176468d368 c980983daebf1 Author: Marc Zyngier Date: Mon Jul 26 18:11:12 2021 +0100 Merge branch irq/bitmap_zalloc into irq/irqchip-next irqchip-wide replacement of bitmap allocation using kcalloc() and co with bitmap-specific allocators (Andy Shevchenko) * irq/bitmap_zalloc: irqchip/mvebu-odmi: Switch to bitmap_zalloc() irqchip/mvebu-gicp: Switch to devm_bitmap_zalloc() irqchip/ls-scfg-msi: Switch to devm_bitmap_zalloc() irqchip/gic-v3: Switch to bitmap_zalloc() irqchip/gic-v2m: Switch to bitmap_zalloc() irqchip/alpine-msi: Switch to bitmap_zalloc() irqchip/partitions: Switch to bitmap_zalloc() Signed-off-by: Marc Zyngier commit b8da302e2955fe4d41eb9d48199242674d77dbe0 Author: Marek Behún Date: Thu Jun 24 19:14:17 2021 +0200 PCI: Call Max Payload Size-related fixup quirks early pci_device_add() calls HEADER fixups after pci_configure_device(), which configures Max Payload Size. Convert MPS-related fixups to EARLY fixups so pci_configure_mps() takes them into account. Fixes: 27d868b5e6cfa ("PCI: Set MPS to match upstream bridge") Link: https://lore.kernel.org/r/20210624171418.27194-1-kabel@kernel.org Signed-off-by: Marek Behún Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit c980983daebf10633c922998bade3a7fd74f1fc1 Author: Andy Shevchenko Date: Fri Jun 18 18:16:57 2021 +0300 irqchip/mvebu-odmi: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-7-andriy.shevchenko@linux.intel.com commit 3db3969f5375fe0a43c03cb4b55ed643585b140d Author: Andy Shevchenko Date: Fri Jun 18 18:16:56 2021 +0300 irqchip/mvebu-gicp: Switch to devm_bitmap_zalloc() Switch to devm_bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-6-andriy.shevchenko@linux.intel.com commit 43a1965fc5ae911c83a49ad793677aa6ba0e18e2 Author: Andy Shevchenko Date: Fri Jun 18 18:16:55 2021 +0300 irqchip/ls-scfg-msi: Switch to devm_bitmap_zalloc() Switch to devm_bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-5-andriy.shevchenko@linux.intel.com commit ff5fe8867a5feaf90b1cb9b766f3de3a1caf9f33 Author: Andy Shevchenko Date: Fri Jun 18 18:16:54 2021 +0300 irqchip/gic-v3: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-4-andriy.shevchenko@linux.intel.com commit 81d3c9e7b43e9426e67a5df66d51a5f2bfce0362 Author: Andy Shevchenko Date: Fri Jun 18 18:16:53 2021 +0300 irqchip/gic-v2m: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-3-andriy.shevchenko@linux.intel.com commit 3f1808f63f0458762403549b3d975ef6e971b6e0 Author: Andy Shevchenko Date: Fri Jun 18 18:16:52 2021 +0300 irqchip/alpine-msi: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-2-andriy.shevchenko@linux.intel.com commit 4cad4da0795e9c03973d5456945394aee75bdf0f Author: Andy Shevchenko Date: Fri Jun 18 18:16:51 2021 +0300 irqchip/partitions: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210618151657.65305-1-andriy.shevchenko@linux.intel.com commit 09f83569189f0fabb28472378e99af289b402c0f Author: Maxim Mikityanskiy Date: Wed Apr 7 13:33:46 2021 +0300 net/mlx5e: Use the new TIR API for kTLS One of the previous commits introduced a dedicated object for a TIR. kTLS code creates a TIR per connection using the low-level mlx5_core API. This commit converts it to the new mlx5e_tir API. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 65d6b6e5a5dad9a49a5a268741c82e72e810ced7 Author: Maxim Mikityanskiy Date: Wed Apr 7 12:53:27 2021 +0300 net/mlx5e: Move management of indir traffic types to rx_res This commit moves the responsibility of keeping the RSS configuration for different traffic types to en/rx_res.{c,h}, hiding the implementation details behind the new getters, and abandons all usage of struct mlx5e_tirc_config, which is no longer useful and superseded by struct mlx5e_rss_params_traffic_type. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit a6696735d694b365bca45873e9dbca26120a8375 Author: Maxim Mikityanskiy Date: Tue Apr 6 20:33:40 2021 +0300 net/mlx5e: Convert TIR to a dedicated object Code related to TIR is now encapsulated into a dedicated object and put into new files en/tir.{c,h}. All usages are converted. The Builder pattern is used to initialize a TIR. It allows to create a multitude of different configurations, turning on and off some specific features in different combinations, without having long parameter lists, initializers per usage and repeating code in initializers. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Maor Dickman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 6fe5ff2c77805f1a3a4abf226087bf9ce1299371 Author: Maxim Mikityanskiy Date: Tue Apr 6 18:58:30 2021 +0300 net/mlx5e: Create struct mlx5e_rss_params_hash This commit introduces a new struct to store RSS hash parameters: hash function and hash key. The existing usages are changed to use the new struct. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 4b3e42eecb1cd8731af59fa01d85af109f0234e4 Author: Maxim Mikityanskiy Date: Tue Apr 6 11:20:42 2021 +0300 net/mlx5e: Remove mdev from mlx5e_build_indir_tir_ctx_common() In order to drop a dependency to mdev and make the function more universal, stop passing mdev to mlx5e_build_indir_tir_ctx_common() and pass transport domain directly instead. It also prepares this function to be used in other contexts that need a custom transport domain, such as hairpin. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit a402e3a7470d4c6b7792552e1a510ce72fda9f3e Author: Maxim Mikityanskiy Date: Tue Apr 6 10:32:47 2021 +0300 net/mlx5e: Remove lro_param from mlx5e_build_indir_tir_ctx_common() In order to reduce the list of parameters and to define clearer responsibility for mlx5e_build_indir_tir_ctx_common(), stop passing lro_param and instead call mlx5e_build_tir_ctx_lro() directly where needed. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 983c9da2b1e1aa25a56bfb0715bf728f61c54e8b Author: Maxim Mikityanskiy Date: Tue Apr 6 10:23:26 2021 +0300 net/mlx5e: Remove mlx5e_priv usage from mlx5e_build_*tir_ctx*() The functions that build TIR context for TIR create and modify commands used to depend on struct mlx5e_priv and fetch some values directly from different places. It increased coupling of code and the chance of weird misbehavior due to hidden complex dependencies. As the first step, this commit removes the priv parameter from these functions. Instead, the necessary values are passed directly. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 093d4bc1731dfe4ec209d3534608a38436331586 Author: Maxim Mikityanskiy Date: Tue Apr 6 09:40:07 2021 +0300 net/mlx5e: Use mlx5e_rqt_get_rqtn to access RQT hardware id In order to abstract from implementation details of mlx5e_rqt, use the mlx5e_rqt_get_rqtn getter instead of accessing the field directly. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 0570c1c958178113bf0e35a00f1398c63fed9644 Author: Maxim Mikityanskiy Date: Mon Apr 5 20:53:08 2021 +0300 net/mlx5e: Take RQT out of TIR and group RX resources RQT is not part of TIR, as multiple TIRs may point to the same RQT, as it happens with indir_tir and inner_indir_tir. These instances of a TIR don't use the embedded RQT. This commit takes RQT out of TIR, making them independent. The RQTs are placed into struct mlx5e_rx_res, and items in that struct are regrouped by functionality: RSS, channels and PTP. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 3f22d6c77bb91b3429814c3baae91903c8cf7f90 Author: Maxim Mikityanskiy Date: Mon Apr 5 18:27:40 2021 +0300 net/mlx5e: Move RX resources to a separate struct This commit moves RQTs and TIRs to a separate struct that is allocated dynamically in profiles that support these RX resources (all profiles, except IPoIB PKey). It also allows to remove rqt_enabled flags, as RQTs are always enabled in profiles that support RX resources. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 4ad31849771ad2aff90ef5911d19fd2b0099e2a0 Author: Maxim Mikityanskiy Date: Tue Apr 6 10:47:45 2021 +0300 net/mlx5e: Move mlx5e_build_rss_params() call to init_rx RSS params belong to the RX side initialization. Move them from profile->init to profile->init_rx stage to allow the next commit to move rss_params out of priv to a dynamically-allocated struct. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 06e9f13ac5ccc15521a2ee15ad8b22e07b1e516e Author: Maxim Mikityanskiy Date: Fri Apr 2 22:58:48 2021 +0300 net/mlx5e: Convert RQT to a dedicated object Code related to RQT is now encapsulated into a dedicated object and put into new files en/rqt.{c,h}. All usages are converted. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit bc5506a166c3d118f7b0a96e5e3dbbbb48ac29ed Author: Maxim Mikityanskiy Date: Tue Apr 13 17:06:45 2021 +0300 net/mlx5e: Check if inner FT is supported outside of create/destroy functions Move the mlx5e_tunnel_inner_ft_supported() check for inner flow tables support outside of mlx5e_create_inner_ttc_table() and mlx5e_destroy_inner_ttc_table(). It allows to avoid accessing invalid TIRNs of inner indirect TIRs. In a later commit these accesses will be replaced by getters that will WARN if inner indirect TIRs don't exist. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 69994ef3da660af4ff22c740f85dc291a50a6440 Author: Maxim Mikityanskiy Date: Fri Apr 23 19:14:37 2021 +0300 net/mlx5: Take TIR destruction out of the TIR list lock res->td.list_lock protects the list of TIRs. There is no point to call mlx5_core_destroy_tir() and invoke a firmware command under this lock. This commit moves this call outside of the lock and puts it after deleting the TIR from the list to ensure that TIRs are always alive while in the list. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 26ab7b384525ccfa678c518577f7f0d841209c8b Author: Maxim Mikityanskiy Date: Fri Apr 23 20:34:48 2021 +0300 net/mlx5e: Block LRO if firmware asks for tunneled LRO This commit does a cleanup in LRO configuration. LRO is a parameter of an RQ, but its state is changed by modifying a TIR related to the RQ. The current status: LRO for tunneled packets is not supported in the driver, inner TIRs may enable LRO on creation, but LRO status of inner TIRs isn't changed in mlx5e_modify_tirs_lro(). This is inconsistent, but as long as the firmware doesn't declare support for tunneled LRO, it works, because the same RQs are shared between the inner and outer TIRs. This commit does two fixes: 1. If the firmware has the tunneled LRO capability, LRO is blocked altogether, because it's not possible to block it for inner TIRs only, when the same RQs are shared between inner and outer TIRs, and the driver won't be able to handle tunneled LRO traffic. 2. mlx5e_modify_tirs_lro() is patched to modify LRO state for all TIRs, including inner ones, because all TIRs related to an RQ should agree on their LRO state. Fixes: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 9c43f3865c2a03be104f1c1d5e9129c2a2bdba88 Author: Maxim Mikityanskiy Date: Thu Apr 8 17:20:04 2021 +0300 net/mlx5e: Prohibit inner indir TIRs in IPoIB TIR's rx_hash_field_selector_inner can be enabled only when tunneled_offload_en = 1. tunneled_offload_en is filled according to the tunneled_offload_en field in struct mlx5e_params, which is false in the IPoIB profile. On the other hand, the IPoIB profile passes inner_ttc = true to mlx5e_create_indirect_tirs, which potentially allows the latter function to attempt to create inner indirect TIRs without having tunneled_offload_en set. This commit prohibits this behavior by passing inner_ttc = false to mlx5e_create_indirect_tirs. The latter function won't attempt to create inner indirect TIRs. As inner indirect TIRs are not created in the IPoIB profile (this commit blocks it explicitly, and even before they would have failed to be created), the call to mlx5e_create_inner_ttc_table in mlx5i_create_flow_steering is a no-op and can be removed. Fixes: 46dc933cee82 ("net/mlx5e: Provide explicit directive if to create inner indirect tirs") Fixes: 458821c72bd0 ("net/mlx5e: IPoIB, Add inner TTC table to IPoIB flow steering") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 9583db2332e3426129612e0ef69f70fbadb6053b Author: Christoph Hellwig Date: Tue Jul 20 15:33:38 2021 +0200 ext2: make ext2_iomap_ops available unconditionally ext2_iomap_ops will be used for the FIEMAP support going forward, so make it available unconditionally. Link: https://lore.kernel.org/r/20210720133341.405438-2-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Jan Kara commit cdb35d1ed6d216978521b75927acb3b8c50a6cac Author: Thomas Hellström Date: Fri Jul 23 12:21:42 2021 -0500 drm/i915/gem: Migrate to system at dma-buf attach time (v7) Until we support p2p dma or as a complement to that, migrate data to system memory at dma-buf attach time if possible. v2: - Rebase on dynamic exporter. Update the igt_dmabuf_import_same_driver selftest to migrate if we are LMEM capable. v3: - Migrate also in the pin() callback. v4: - Migrate in attach v5: (jason) - Lock around the migration v6: (jason) - Move the can_migrate check outside the lock - Rework the selftests to test more migration conditions. In particular, SMEM, LMEM, and LMEM+SMEM are all checked. v7: (mauld) - Misc style nits Signed-off-by: Thomas Hellström Signed-off-by: Michael J. Ruhl Reported-by: kernel test robot Signed-off-by: Jason Ekstrand Reviewed-by: Jason Ekstrand Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-9-jason@jlekstrand.net commit d7b2cb380b3a67894dccf497ded604f52bc05346 Author: Thomas Hellström Date: Fri Jul 23 12:21:41 2021 -0500 drm/i915/gem: Correct the locking and pin pattern for dma-buf (v8) If our exported dma-bufs are imported by another instance of our driver, that instance will typically have the imported dma-bufs locked during dma_buf_map_attachment(). But the exporter also locks the same reservation object in the map_dma_buf() callback, which leads to recursive locking. So taking the lock inside _pin_pages_unlocked() is incorrect. Additionally, the current pinning code path is contrary to the defined way that pinning should occur. Remove the explicit pin/unpin from the map/umap functions and move them to the attach/detach allowing correct locking to occur, and to match the static dma-buf drm_prime pattern. Add a live selftest to exercise both dynamic and non-dynamic exports. v2: - Extend the selftest with a fake dynamic importer. - Provide real pin and unpin callbacks to not abuse the interface. v3: (ruhl) - Remove the dynamic export support and move the pinning into the attach/detach path. v4: (ruhl) - Put pages does not need to assert on the dma-resv v5: (jason) - Lock around dma_buf_unmap_attachment() when emulating a dynamic importer in the subtests. - Use pin_pages_unlocked v6: (jason) - Use dma_buf_attach instead of dma_buf_attach_dynamic in the selftests v7: (mauld) - Use __i915_gem_object_get_pages (2 __underscores) instead of the 4 ____underscore version in the selftests v8: (mauld) - Drop the kernel doc from the static i915_gem_dmabuf_attach function - Add missing "err = PTR_ERR()" to a bunch of selftest error cases Reported-by: Michael J. Ruhl Signed-off-by: Thomas Hellström Signed-off-by: Michael J. Ruhl Signed-off-by: Jason Ekstrand Reviewed-by: Jason Ekstrand Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-8-jason@jlekstrand.net commit 76b62448dc8ffc3cfcfc40603d965b710a1840e3 Author: Jason Ekstrand Date: Fri Jul 23 12:21:40 2021 -0500 drm/i915/gem: Always call obj->ops->migrate unless can_migrate fails Without TTM, we have no such hook so we exit early but this is fine because we use TTM on all LMEM platforms and, on integrated platforms, there is no real migration. If we do have the hook, it's better to just let TTM handle the migration because it knows where things are actually placed. This fixes a bug where i915_gem_object_migrate fails to migrate newly created LMEM objects. In that scenario, the object has obj->mm.region set to LMEM but TTM has it in SMEM because that's where all new objects are placed there prior to getting actual pages. When we invoke i915_gem_object_migrate, it exits early because, from the point of view of the GEM object, it's already in LMEM and no migration is needed. Then, when we try to pin the pages, __i915_ttm_get_pages is called which, unaware of our failed attempt at a migration, places the object in SMEM. This only happens on newly created objects because they have this weird state where TTM thinks they're in SMEM, GEM thinks they're in LMEM, and the reality is that they don't exist at all. It's better if GEM just always calls into TTM and let's TTM handle things. That way the lies stay better contained. Once the migration is complete, the object will have pages, obj->mm.region will be correct, and we're done lying. Signed-off-by: Jason Ekstrand Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-7-jason@jlekstrand.net commit 75e382850b7ea516cbeaecf2dd22dd040e144ad9 Author: Jason Ekstrand Date: Fri Jul 23 12:21:39 2021 -0500 drm/i915/gem/ttm: Only call __i915_gem_object_set_pages if needed __i915_ttm_get_pages does two things. First, it calls ttm_bo_validate() to check the given placement and migrate the BO if needed. Then, it updates the GEM object to match, in case the object was migrated. If no migration occured, however, we might still have pages on the GEM object in which case we don't need to fetch them from TTM and call __i915_gem_object_set_pages. This hasn't been a problem before because the primary user of __i915_ttm_get_pages is __i915_gem_object_get_pages which only calls it if the GEM object doesn't have pages. However, i915_ttm_migrate also uses __i915_ttm_get_pages to do the migration so this meant it was unsafe to call on an already populated object. This patch checks i915_gem_object_has_pages() before trying to __i915_gem_object_set_pages so i915_ttm_migrate is safe to call, even on populated objects. Signed-off-by: Jason Ekstrand Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-6-jason@jlekstrand.net commit bf947c989c1642d89062a03121f30760dca10c06 Author: Jason Ekstrand Date: Fri Jul 23 12:21:38 2021 -0500 drm/i915/gem: Unify user object creation (v3) Instead of hand-rolling the same three calls in each function, pull them into an i915_gem_object_create_user helper. Apart from re-ordering of the placements array ENOMEM check, there should be no functional change. v2 (Matthew Auld): - Add the call to i915_gem_flush_free_objects() from i915_gem_dumb_create() in a separate patch - Move i915_gem_object_alloc() below the simple error checks v3 (Matthew Auld): - Add __ to i915_gem_object_create_user and kerneldoc which warns the caller that it's not validating anything. Signed-off-by: Jason Ekstrand Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-5-jason@jlekstrand.net commit 82ec88e11d46e3d981e2db854fa5ab037c2c0f1f Author: Jason Ekstrand Date: Fri Jul 23 12:21:37 2021 -0500 drm/i915/gem: Call i915_gem_flush_free_objects() in i915_gem_dumb_create() This doesn't really fix anything serious since the chances of a client creating and destroying a mass of dumb BOs is pretty low. However, it is called by the other two create IOCTLs to garbage collect old objects. Call it here too for consistency. Signed-off-by: Jason Ekstrand Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-4-jason@jlekstrand.net commit 34c7ef0a375c7ccd56755b7c3c5e7874f8e49428 Author: Jason Ekstrand Date: Fri Jul 23 12:21:36 2021 -0500 drm/i915/gem: Refactor placement setup for i915_gem_object_create* (v2) Since we don't allow changing the set of regions after creation, we can make ext_set_placements() build up the region set directly in the create_ext and assign it to the object later. This is similar to what we did for contexts with the proto-context only simpler because there's no funny object shuffling. This will be used in the next patch to allow us to de-duplicate a bunch of code. Also, since we know the maximum number of regions up-front, we can use a fixed-size temporary array for the regions. This simplifies memory management a bit for this new delayed approach. v2 (Matthew Auld): - Get rid of MAX_N_PLACEMENTS - Drop kfree(placements) from set_placements() v3 (Matthew Auld): - Properly set ext_data->n_placements Signed-off-by: Jason Ekstrand Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-3-jason@jlekstrand.net commit f3170ba8c907e9936822ad9e0b2eee8e2281615b Author: Jason Ekstrand Date: Fri Jul 23 12:21:35 2021 -0500 drm/i915/gem: Check object_can_migrate from object_migrate We don't roll them together entirely because there are still a couple cases where we want a separate can_migrate check. For instance, the display code checks that you can migrate a buffer to LMEM before it accepts it in fb_create. The dma-buf import code also uses it to do an early check and return a different error code if someone tries to attach a LMEM-only dma-buf to another driver. However, no one actually wants to call object_migrate when can_migrate has failed. The stated intention is for self-tests but none of those actually take advantage of this unsafe migration. Signed-off-by: Jason Ekstrand Cc: Daniel Vetter Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-2-jason@jlekstrand.net commit 816753c06f23773c83763cfef3ded32a387e54e1 Author: Lucas De Marchi Date: Thu Jul 22 17:25:51 2021 -0700 drm/i915/gt: nuke gen6_hw_id This is only used by GRAPHICS_VER == 6 and GRAPHICS_VER == 7. All other recent platforms do not depend on this field, so it doesn't make much sense to keep it generic like that. Instead, just do a mapping from engine class to HW ID in the single place that is needed. v2: use macros with the direct register address instead of calculating from the legacy HW_ID (Matt Roper) Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210723002551.3906535-1-lucas.demarchi@intel.com commit af996031e1545c47423dfdd024840702ceb5a26c Author: Jason Wang Date: Sun Jul 25 22:42:21 2021 +0800 net: ixp4xx_hss: use dma_pool_zalloc The dma_pool_zalloc combines dma_pool_alloc/memset. Therefore, the dma_pool_alloc/memset can be replaced with dma_pool_zalloc which is more compact. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 8d909b2333f37e5da84a9e6a2cbe21f52be5f42a Author: John Ogness Date: Thu Jul 15 21:39:59 2021 +0206 printk: syslog: close window between wait and read Syslog's SYSLOG_ACTION_READ is supposed to block until the next syslog record can be read, and then it should read that record. However, because @syslog_lock is not held between waking up and reading the record, another reader could read the record first, thus causing SYSLOG_ACTION_READ to return with a value of 0, never having read _anything_. By holding @syslog_lock between waking up and reading, it can be guaranteed that SYSLOG_ACTION_READ blocks until it successfully reads a syslog record (or a real error occurs). Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-7-john.ogness@linutronix.de commit b371cbb584d843bc4194d0cd4ce5ecd19b0cf55f Author: John Ogness Date: Thu Jul 15 21:39:58 2021 +0206 printk: convert @syslog_lock to mutex @syslog_lock was a raw_spin_lock to simplify the transition of removing @logbuf_lock and the safe buffers. With that transition complete, and since all uses of @syslog_lock are within sleepable contexts, @syslog_lock can become a mutex. Note that until now register_console() would disable interrupts using irqsave, which implies that it may be called with interrupts disabled. And indeed, there is one possible call chain on parisc where this happens: handle_interruption(code=1) /* High-priority machine check (HPMC) */ pdc_console_restart() pdc_console_init_force() register_console() However, register_console() calls console_lock(), which might sleep. So it has never been allowed to call register_console() from an atomic context and the above call chain is a bug. Note that the removal of read_syslog_seq_irq() is slightly changing the behavior of SYSLOG_ACTION_READ by testing against a possibly outdated @seq value. However, the value of @seq could have changed after the test, so it is not a new window. A follow-up commit closes this window. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-6-john.ogness@linutronix.de commit 85e3e7fbbb720b9897fba9a99659e31cbd1c082e Author: John Ogness Date: Thu Jul 15 21:39:57 2021 +0206 printk: remove NMI tracking All NMI contexts are handled the same as the safe context: store the message and defer printing. There is no need to have special NMI context tracking for this. Using in_nmi() is enough. There are several parts of the kernel that are manually calling into the printk NMI context tracking in order to cause general printk deferred printing: arch/arm/kernel/smp.c arch/powerpc/kexec/crash.c kernel/trace/trace.c For arm/kernel/smp.c and powerpc/kexec/crash.c, provide a new function pair printk_deferred_enter/exit that explicitly achieves the same objective. For ftrace, remove the printk context manipulation completely. It was added in commit 03fc7f9c99c1 ("printk/nmi: Prevent deadlock when accessing the main log buffer in NMI"). The purpose was to enforce storing messages directly into the ring buffer even in NMI context. It really should have only modified the behavior in NMI context. There is no need for a special behavior any longer. All messages are always stored directly now. The console deferring is handled transparently in vprintk(). Signed-off-by: John Ogness [pmladek@suse.com: Remove special handling in ftrace.c completely. Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-5-john.ogness@linutronix.de commit 93d102f094be9beab28e5afb656c188b16a3793b Author: John Ogness Date: Thu Jul 15 21:39:56 2021 +0206 printk: remove safe buffers With @logbuf_lock removed, the high level printk functions for storing messages are lockless. Messages can be stored from any context, so there is no need for the NMI and safe buffers anymore. Remove the NMI and safe buffers. Although the safe buffers are removed, the NMI and safe context tracking is still in place. In these contexts, store the message immediately but still use irq_work to defer the console printing. Since printk recursion tracking is in place, safe context tracking for most of printk is not needed. Remove it. Only safe context tracking relating to the console and console_owner locks is left in place. This is because the console and console_owner locks are needed for the actual printing. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-4-john.ogness@linutronix.de commit 002eb6ad075142e5940122c7fcee71cf1e906e29 Author: John Ogness Date: Thu Jul 15 21:39:55 2021 +0206 printk: track/limit recursion Currently the printk safe buffers provide a form of recursion protection by redirecting to the safe buffers whenever printk() is recursively called. In preparation for removal of the safe buffers, provide an alternate explicit recursion protection. Recursion is limited to 3 levels per-CPU and per-context. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-3-john.ogness@linutronix.de commit 55d6af1d66885059ffc2ac23083de52d12be63bb Author: John Ogness Date: Thu Jul 15 21:39:54 2021 +0206 lib/nmi_backtrace: explicitly serialize banner and regs Currently the nmi_backtrace is serialized against other CPUs because the messages are sent to the NMI buffers. Once these buffers are removed, only the dumped stack will be serialized against other CPUs (via the printk_cpu_lock). Also serialize the nmi_backtrace banner and regs using the printk_cpu_lock so that per-CPU serialization will be preserved even after the NMI buffers are removed. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210715193359.25946-2-john.ogness@linutronix.de commit 8374f43123a5957326095d108a12c49ae509624f Author: Pavel Tikhomirov Date: Thu Jul 15 13:07:14 2021 +0300 tests: add move_mount(MOVE_MOUNT_SET_GROUP) selftest Add a simple selftest for a move_mount(MOVE_MOUNT_SET_GROUP). This tests that one can copy sharing from one mount from nested mntns with nested userns owner to another mount from other nested mntns with other nested userns owner while in their parent userns. TAP version 13 1..1 # Starting 1 tests from 2 test cases. # RUN move_mount_set_group.complex_sharing_copying ... # OK move_mount_set_group.complex_sharing_copying ok 1 move_mount_set_group.complex_sharing_copying # PASSED: 1 / 1 tests passed. # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 Link: https://lore.kernel.org/r/20210715100714.120228-2-ptikhomirov@virtuozzo.com Cc: Shuah Khan Cc: Eric W. Biederman Cc: Alexander Viro Cc: Christian Brauner Cc: Mattias Nissler Cc: Aleksa Sarai Cc: Andrei Vagin Cc: linux-fsdevel@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: lkml Signed-off-by: Pavel Tikhomirov Signed-off-by: Christian Brauner commit 9ffb14ef61bab83fa818736bf3e7e6b6e182e8e2 Author: Pavel Tikhomirov Date: Thu Jul 15 13:07:13 2021 +0300 move_mount: allow to add a mount into an existing group Previously a sharing group (shared and master ids pair) can be only inherited when mount is created via bindmount. This patch adds an ability to add an existing private mount into an existing sharing group. With this functionality one can first create the desired mount tree from only private mounts (without the need to care about undesired mount propagation or mount creation order implied by sharing group dependencies), and next then setup any desired mount sharing between those mounts in tree as needed. This allows CRIU to restore any set of mount namespaces, mount trees and sharing group trees for a container. We have many issues with restoring mounts in CRIU related to sharing groups and propagation: - reverse sharing groups vs mount tree order requires complex mounts reordering which mostly implies also using some temporary mounts (please see https://lkml.org/lkml/2021/3/23/569 for more info) - mount() syscall creates tons of mounts due to propagation - mount re-parenting due to propagation - "Mount Trap" due to propagation - "Non Uniform" propagation, meaning that with different tricks with mount order and temporary children-"lock" mounts one can create mount trees which can't be restored without those tricks (see https://www.linuxplumbersconf.org/event/7/contributions/640/) With this new functionality we can resolve all the problems with propagation at once. Link: https://lore.kernel.org/r/20210715100714.120228-1-ptikhomirov@virtuozzo.com Cc: Eric W. Biederman Cc: Alexander Viro Cc: Christian Brauner Cc: Mattias Nissler Cc: Aleksa Sarai Cc: Andrei Vagin Cc: linux-fsdevel@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: lkml Co-developed-by: Andrei Vagin Acked-by: Christian Brauner Signed-off-by: Pavel Tikhomirov Signed-off-by: Andrei Vagin Signed-off-by: Christian Brauner commit ee974d9625c405977ef5d9aedc476be1d0362ebf Author: Lennert Buytenhek Date: Wed Jul 21 16:44:53 2021 +0300 iommu/amd: Fix printing of IOMMU events when rate limiting kicks in For the printing of RMP_HW_ERROR / RMP_PAGE_FAULT / IO_PAGE_FAULT events, the AMD IOMMU code uses such logic: if (pdev) dev_data = dev_iommu_priv_get(&pdev->dev); if (dev_data && __ratelimit(&dev_data->rs)) { pci_err(pdev, ... } else { printk_ratelimit() / pr_err{,_ratelimited}(... } This means that if we receive an event for a PCI devid which actually does have a struct pci_dev and an attached struct iommu_dev_data, but rate limiting kicks in, we'll fall back to the non-PCI branch of the test, and print the event in a different format. Fix this by changing the logic to: if (dev_data) { if (__ratelimit(&dev_data->rs)) { pci_err(pdev, ... } } else { pr_err_ratelimited(... } Suggested-by: Suravee Suthikulpanit Signed-off-by: Lennert Buytenhek Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/YPgk1dD1gPMhJXgY@wantstofly.org Signed-off-by: Joerg Roedel commit d28b1e03dc8d1070538ca3ea3f4e6732109ddf42 Author: Lad Prabhakar Date: Mon Jul 19 15:38:10 2021 +0100 clk: renesas: r9a07g044: Add entry for fixed clock P0_DIV2 Add entry for fixed core clock P0_DIV2 and assign LAST_DT_CORE_CLK to R9A07G044_CLK_P0_DIV2. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210719143811.2135-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 9800190881cd5bc9e98c69710f04be8ae120cd38 Merge: 1b87d5bba32c1 0b256c403d408 Author: Geert Uytterhoeven Date: Mon Jul 26 14:14:50 2021 +0200 Merge tag 'renesas-r9a07g044-dt-binding-defs-tag2' into renesas-clk-for-v5.15 Renesas RZ/G2L DT Binding Definitions Update Missing definition for the P0_DIV2 core clock on the Renesas RZ/G2L (R9A07G044) SoC, shared by driver and DT source files. commit 0b256c403d4082bafc681143913442288010277c Author: Lad Prabhakar Date: Mon Jul 19 15:38:09 2021 +0100 dt-bindings: clock: r9a07g044-cpg: Add entry for P0_DIV2 core clock Add P0_DIV2 core clock required for CANFD module. CANFD core clock is sourced from P0_DIV2 referenced from HW manual Rev.0.50. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210719143811.2135-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 75cc1018a9e1e57d4ae43a101fc08a070894d439 Author: Lu Baolu Date: Tue Jul 20 10:06:15 2021 +0800 iommu/vt-d: Move clflush'es from iotlb_sync_map() to map_pages() As the Intel VT-d driver has switched to use the iommu_ops.map_pages() callback, multiple pages of the same size will be mapped in a call. There's no need to put the clflush'es in iotlb_sync_map() callback. Move them back into __domain_mapping() to simplify the code. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720020615.4144323-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3f34f125977685e591def32984c77e23a86075b0 Author: Lu Baolu Date: Tue Jul 20 10:06:14 2021 +0800 iommu/vt-d: Implement map/unmap_pages() iommu_ops callback Implement the map_pages() and unmap_pages() callback for the Intel IOMMU driver to allow calls from iommu core to map and unmap multiple pages of the same size in one call. With map/unmap_pages() implemented, the prior map/unmap callbacks are deprecated. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720020615.4144323-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit a886d5a7e67bc403b8e51ab50c10324bcdbb686f Author: Lu Baolu Date: Tue Jul 20 10:06:13 2021 +0800 iommu/vt-d: Report real pgsize bitmap to iommu core The pgsize bitmap is used to advertise the page sizes our hardware supports to the IOMMU core, which will then use this information to split physically contiguous memory regions it is mapping into page sizes that we support. Traditionally the IOMMU core just handed us the mappings directly, after making sure the size is an order of a 4KiB page and that the mapping has natural alignment. To retain this behavior, we currently advertise that we support all page sizes that are an order of 4KiB. We are about to utilize the new IOMMU map/unmap_pages APIs. We could change this to advertise the real page sizes we support. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210720020615.4144323-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 8bc54824da4e8fcf0ed679cf09ac32f23d83254a Author: Xiyu Yang via iommu Date: Mon Jul 19 16:32:58 2021 +0800 iommu/amd: Convert from atomic_t to refcount_t on pasid_state->count refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/1626683578-64214-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Joerg Roedel commit 13b6eb6e1c98c47f7e0d6c74e8b22cfe189a84dd Author: Robin Murphy Date: Thu Jul 15 14:04:24 2021 +0100 iommu: Streamline iommu_iova_to_phys() If people are going to insist on calling iommu_iova_to_phys() pointlessly and expecting it to work, we can at least do ourselves a favour by handling those cases in the core code, rather than repeatedly across an inconsistent handful of drivers. Since all the existing drivers implement the internal callback, and any future ones are likely to want to work with iommu-dma which relies on iova_to_phys a fair bit, we may as well remove that currently-redundant check as well and consider it mandatory. Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/f564f3f6ff731b898ff7a898919bf871c2c7745a.1626354264.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 308723e3580027f0cd7c86a5edfe6b5acb6863d2 Author: John Garry Date: Mon Jul 12 19:12:20 2021 +0800 iommu: Remove mode argument from iommu_set_dma_strict() We only ever now set strict mode enabled in iommu_set_dma_strict(), so just remove the argument. Signed-off-by: John Garry Reviewed-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1626088340-5838-7-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit 02252b3bfe9f98770a8d902925711676ff5bd766 Author: Zhen Lei Date: Mon Jul 12 19:12:19 2021 +0800 iommu/amd: Add support for IOMMU default DMA mode build options Make IOMMU_DEFAULT_LAZY default for when AMD_IOMMU config is set, which matches current behaviour. For "fullflush" param, just call iommu_set_dma_strict(true) directly. Since we get a strict vs lazy mode print already in iommu_subsys_init(), and maintain a deprecation print when "fullflush" param is passed, drop the prints in amd_iommu_init_dma_ops(). Finally drop global flag amd_iommu_unmap_flush, as it has no longer has any purpose. [jpg: Rebase for relocated file and drop amd_iommu_unmap_flush] Signed-off-by: Zhen Lei Signed-off-by: John Garry Link: https://lore.kernel.org/r/1626088340-5838-6-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit d0e108b8e962e0aae65dc74ffda63b93b6ef32f4 Author: Zhen Lei Date: Mon Jul 12 19:12:18 2021 +0800 iommu/vt-d: Add support for IOMMU default DMA mode build options Make IOMMU_DEFAULT_LAZY default for when INTEL_IOMMU config is set, as is current behaviour. Also delete global flag intel_iommu_strict: - In intel_iommu_setup(), call iommu_set_dma_strict(true) directly. Also remove the print, as iommu_subsys_init() prints the mode and we have already marked this param as deprecated. - For cap_caching_mode() check in intel_iommu_setup(), call iommu_set_dma_strict(true) directly; also reword the accompanying print with a level downgrade and also add the missing '\n'. - For Ironlake GPU, again call iommu_set_dma_strict(true) directly and keep the accompanying print. [jpg: Remove intel_iommu_strict] Signed-off-by: Zhen Lei Signed-off-by: John Garry Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1626088340-5838-5-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit 712d8f205835c1d170e85d7811da3d9f36d8fab7 Author: Zhen Lei Date: Mon Jul 12 19:12:17 2021 +0800 iommu: Enhance IOMMU default DMA mode build options First, add build options IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the two config options in an choice, as they are mutually exclusive. [jpg: Make choice between strict and lazy only (and not passthrough)] Signed-off-by: Zhen Lei Signed-off-by: John Garry Reviewed-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1626088340-5838-4-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit d8577d2e331dc06f5871afa6b76035dd8b74c903 Author: John Garry Date: Mon Jul 12 19:12:16 2021 +0800 iommu: Print strict or lazy mode at init time As well as the default domain type, it's useful to know whether strict or lazy for DMA domains, so add this info in a separate print. The (stict/lazy) mode may be also set via iommu.strict earlyparm, but this will be processed prior to iommu_subsys_init(), so that print will be accurate for drivers which don't set the mode via custom means. For the drivers which set the mode via custom means - AMD and Intel drivers - they maintain prints to inform a change in policy or that custom cmdline methods to change policy are deprecated. Signed-off-by: John Garry Reviewed-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1626088340-5838-3-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit 1d479f160c500249d8fa4d21e7d2b7aaffc04daf Author: John Garry Date: Mon Jul 12 19:12:15 2021 +0800 iommu: Deprecate Intel and AMD cmdline methods to enable strict mode Now that the x86 drivers support iommu.strict, deprecate the custom methods. Signed-off-by: John Garry Acked-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1626088340-5838-2-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit d453ceb6549af8798913de6a20444cb7200fdb69 Author: Gwendal Grignou Date: Thu May 13 17:57:33 2021 -0700 platform/chrome: sensorhub: Add trace events for sample Add trace event to report samples and their timestamp coming from the EC. It allows to check if the timestamps are correct and the filter is working correctly without introducing too much latency. To enable these events: cd /sys/kernel/debug/tracing/ echo 1 > events/cros_ec/enable echo 0 > events/cros_ec/cros_ec_request_start/enable echo 0 > events/cros_ec/cros_ec_request_done/enable echo 1 > tracing_on cat trace_pipe Observe event flowing: irq/105-chromeo-95 [000] .... 613.659758: cros_ec_sensorhub_timestamp: ... irq/105-chromeo-95 [000] .... 613.665219: cros_ec_sensorhub_filter: dx: ... Signed-off-by: Gwendal Grignou Signed-off-by: Enric Balletbo i Serra commit 9d32e4e7e9e11b1dd0ed0d6c294258879ac4d1af Author: Yinjun Zhang Date: Mon Jul 26 13:16:34 2021 +0200 nfp: add support for coalesce adaptive feature Use dynamic interrupt moderation library to implement coalesce adaptive feature for nfp driver. Signed-off-by: Yinjun Zhang Signed-off-by: Yu Xiao Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e129f6b5aeb3e1af8792fd565dc913fecafb76f9 Author: Richard Laing Date: Mon Jul 26 17:30:03 2021 +1200 net: mhi: Improve MBIM packet counting Packets are aggregated over the MBIM link and currently the MHI net device will count each aggregated packet rather then the actual packets themselves. If a protocol handler module is specified, use that to count the packets rather than directly in the MHI net device. This is in line with the behaviour of the USB net cdc_mbim driver. Signed-off-by: Richard Laing Signed-off-by: David S. Miller commit a0302ff5906ac021d1d79cecd7b710970e40e588 Author: wengjianfeng Date: Mon Jul 26 11:29:17 2021 +0800 nfc: s3fwrn5: remove unnecessary label Simplify the code by removing unnecessary label and returning directly. Signed-off-by: wengjianfeng Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 8f49efc9a0c40d8d4104e266f3ac9b7b9f3cdf7a Merge: cc19862ffe454 f2b67226c3a8d Author: David S. Miller Date: Mon Jul 26 12:16:15 2021 +0100 Merge branch 'hns3-devlink' Guangbin Huang says: ==================== net: hns3: add support devlink This series adds devlink support for the HNS3 ethernet driver. change log: V2 -> V3: 1. remove two patches of setting rx/tx buffer size by devlink param. V1 -> V2: 1. add more detailed descriptions of parameters in document hns3.rst. RFC -> V1: 1. use DEVLINK_INFO_VERSION_GENERIC_FW instead of "fw-version". 2. add devlink documentation for hns3 driver. ==================== Signed-off-by: David S. Miller commit f2b67226c3a8d5bf58746f689d896856ac6f800b Author: Hao Chen Date: Mon Jul 26 10:47:07 2021 +0800 net: hns3: add devlink reload support for VF Add devlink reload support for HNS3 ethernet VF driver. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 98fa7525d36091da9eeafb94f98bf9bbb3d6748e Author: Hao Chen Date: Mon Jul 26 10:47:06 2021 +0800 net: hns3: add devlink reload support for PF Add devlink reload support for HNS3 ethernet PF driver. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit bd85e55bfb959faad17c470384a1a90caa6d157d Author: Yufeng Mo Date: Mon Jul 26 10:47:05 2021 +0800 net: hns3: add support for devlink get info for VF Add devlink get info support for HNS3 ethernet VF driver. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 26fbf511693e7dead8f1a6b497a53d58966008bf Author: Yufeng Mo Date: Mon Jul 26 10:47:04 2021 +0800 net: hns3: add support for devlink get info for PF Add devlink get info support for HNS3 ethernet PF driver. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit cd6242991d2e3990c828a7c2215d2d3321f1da39 Author: Yufeng Mo Date: Mon Jul 26 10:47:03 2021 +0800 net: hns3: add support for registering devlink for VF Add devlink register support for HNS3 ethernet VF driver. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit b741269b275953786832805df329851299ab4de7 Author: Yufeng Mo Date: Mon Jul 26 10:47:02 2021 +0800 net: hns3: add support for registering devlink for PF Add devlink register support for HNS3 ethernet PF driver. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 6149ab604c80a20e5741bea6c90583edde15c488 Author: Hao Chen Date: Mon Jul 26 10:47:01 2021 +0800 devlink: add documentation for hns3 driver Add a file to document devlink support for hns3 driver, now support devlink info and devlink reload. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 71e69d7adee10a55b817df748dec5bfec7bf4c30 Merge: 03b1292d1c0ea ff1176468d368 Author: Greg Kroah-Hartman Date: Mon Jul 26 12:55:17 2021 +0200 Merge 5.14-rc3 into char-misc-next We need the char-misc fixes from 5.14-rc3 into here as well. Signed-off-by: Greg Kroah-Hartman commit 8119cefd9a29b71997e62b762932d23499ba4896 Author: Hari Bathini Date: Wed Jul 14 18:17:58 2021 +0530 powerpc/kexec: blacklist functions called in real mode for kprobe As kprobe does not handle events happening in real mode, blacklist the functions that only get called in real mode or in kexec sequence with MMU turned off. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/162626687834.155313.4692863392927831843.stgit@hbathini-workstation.ibm.com commit 808035317b22e2dd8d2cfef2083ad1743ac0c0e2 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:56 2021 -0700 iommu/arm-smmu: Implement the map_pages() IOMMU driver callback Implement the map_pages() callback for the ARM SMMU driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also, remove the map() callback for the ARM SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-16-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 9ea1a2c4944851aae4d821b3a6c99ade2bc3bbe6 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:55 2021 -0700 iommu/arm-smmu: Implement the unmap_pages() IOMMU driver callback Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Also, remove the unmap() callback for the SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-15-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 23c30bed9c3c9062774488dc5223aa1ee850e028 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:54 2021 -0700 iommu/io-pgtable-arm-v7s: Implement arm_v7s_map_pages() Implement the map_pages() callback for the ARM v7s io-pgtable format. Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-14-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit f13eabcf9dfad938333c0b6cc6bf4c05cc25eb4f Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:53 2021 -0700 iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages() Implement the unmap_pages() callback for the ARM v7s io-pgtable format. Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-13-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 4a77b12deb253bd0d56bab6e9f5ad09cef754c36 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:52 2021 -0700 iommu/io-pgtable-arm: Implement arm_lpae_map_pages() Implement the map_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-12-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 1fe27be5ffec20637a8fe17ec7c1e88f3aaf62f0 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:51 2021 -0700 iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages() Implement the unmap_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-11-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 41e1eb2546e9c8200d32f11e4b47d86d156a5a97 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:50 2021 -0700 iommu/io-pgtable-arm: Prepare PTE methods for handling multiple entries The PTE methods currently operate on a single entry. In preparation for manipulating multiple PTEs in one map or unmap call, allow them to handle multiple PTEs. Signed-off-by: Isaac J. Manjarres Suggested-by: Robin Murphy Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-10-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 647c57764b37c0ddfa6bf775b03d5e5cc407086b Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:49 2021 -0700 iommu: Add support for the map_pages() callback Since iommu_pgsize can calculate how many pages of the same size can be mapped/unmapped before the next largest page size boundary, add support for invoking an IOMMU driver's map_pages() callback, if it provides one. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1623850736-389584-9-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit b1d99dc5f983b4ae8ab9841981c5dbd5530f6344 Author: Will Deacon Date: Wed Jun 16 06:38:48 2021 -0700 iommu: Hook up '->unmap_pages' driver callback Extend iommu_pgsize() to populate an optional 'count' parameter so that we can direct unmapping operation to the ->unmap_pages callback if it has been provided by the driver. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1623850736-389584-8-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 89d5b9601f70b72f524fdb7bc6cf1b1e8e20e867 Author: Will Deacon Date: Wed Jun 16 06:38:47 2021 -0700 iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts The 'addr_merge' parameter to iommu_pgsize() is a fabricated address intended to describe the alignment requirements to consider when choosing an appropriate page size. On the iommu_map() path, this address is the logical OR of the virtual and physical addresses. Subsequent improvements to iommu_pgsize() will need to check the alignment of the virtual and physical components of 'addr_merge' independently, so pass them in as separate parameters and reconstruct 'addr_merge' locally. No functional change. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1623850736-389584-7-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit e7d6fff6b3d34230bac1b2c2607646d7b8638cb7 Author: Will Deacon Date: Wed Jun 16 06:38:46 2021 -0700 iommu: Use bitmap to calculate page size in iommu_pgsize() Avoid the potential for shifting values by amounts greater than the width of their type by using a bitmap to compute page size in iommu_pgsize(). Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres Signed-off-by: Georgi Djakov Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/1623850736-389584-6-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 910c4406ccc9613de0a54abf910edc4bf8a575c0 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:45 2021 -0700 iommu: Add a map_pages() op for IOMMU drivers Add a callback for IOMMU drivers to provide a path for the IOMMU framework to call into an IOMMU driver, which can call into the io-pgtable code, to map a physically contiguous rnage of pages of the same size. For IOMMU drivers that do not specify a map_pages() callback, the existing logic of mapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Acked-by: Lu Baolu Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-5-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit ca073b55d16a83ba7e73cd313312abc68f07f293 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:44 2021 -0700 iommu/io-pgtable: Introduce map_pages() as a page table op Mapping memory into io-pgtables follows the same semantics that unmapping memory used to follow (i.e. a buffer will be mapped one page block per call to the io-pgtable code). This means that it can be optimized in the same way that unmapping memory was, so add a map_pages() callback to the io-pgtable ops structure, so that a range of pages of the same size can be mapped within the same call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-4-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit cacffb7f7b45ba7649eedea4c196c6e9f1863bf3 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:43 2021 -0700 iommu: Add an unmap_pages() op for IOMMU drivers Add a callback for IOMMU drivers to provide a path for the IOMMU framework to call into an IOMMU driver, which can call into the io-pgtable code, to unmap a virtually contiguous range of pages of the same size. For IOMMU drivers that do not specify an unmap_pages() callback, the existing logic of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon Acked-by: Lu Baolu Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-3-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 374c15594c4ee0dfcceb38852bd43be09070f402 Author: Isaac J. Manjarres Date: Wed Jun 16 06:38:42 2021 -0700 iommu/io-pgtable: Introduce unmap_pages() as a page table op The io-pgtable code expects to operate on a single block or granule of memory that is supported by the IOMMU hardware when unmapping memory. This means that when a large buffer that consists of multiple such blocks is unmapped, the io-pgtable code will walk the page tables to the correct level to unmap each block, even for blocks that are virtually contiguous and at the same level, which can incur an overhead in performance. Introduce the unmap_pages() page table op to express to the io-pgtable code that it should unmap a number of blocks of the same size, instead of a single block. Doing so allows multiple blocks to be unmapped in one call to the io-pgtable code, reducing the number of page table walks, and indirect calls. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/1623850736-389584-2-git-send-email-quic_c_gdjako@quicinc.com Signed-off-by: Joerg Roedel commit 7d9e2661f268585ca24ab4edbc1e2925b08374b2 Author: Jonathan Corbet Date: Sun Jul 25 15:16:00 2021 -0600 printk: Move the printk() kerneldoc comment to its new home Commit 337015573718 ("printk: Userspace format indexing support") turned printk() into a macro, but left the kerneldoc comment for it with the (now) _printk() function, resulting in this docs-build warning: kernel/printk/printk.c:1: warning: 'printk' not found Move the kerneldoc comment back next to the (now) macro it's meant to describe and have the docs build find it there. Fixes: 337015573718b161 ("printk: Userspace format indexing support") Signed-off-by: Jonathan Corbet Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/87o8aqt7qn.fsf@meer.lwn.net commit 0f0aa84850a4105401723c6c0eeb61c2e67c869a Author: Petr Mladek Date: Fri Jul 23 09:47:07 2021 +0200 printk/index: Fix warning about missing prototypes The commit 337015573718b161 ("printk: Userspace format indexing support") triggered the following build failure: kernel/printk/index.c:140:6: warning: no previous prototype for ‘pi_create_file’ [-Wmissing-prototypes] void pi_create_file(struct module *mod) ^~~~~~~~~~~~~~ kernel/printk/index.c:146:6: warning: no previous prototype for ‘pi_remove_file’ [-Wmissing-prototypes] void pi_remove_file(struct module *mod) ^~~~~~~~~~~~~~ Fixes: 337015573718b161 ("printk: Userspace format indexing support") Reported-by: kernel test robot Suggested-by: Chris Down [pmladek@suse.com: Let the compiler decide about inlining.] Signed-off-by: Petr Mladek Link: https://lore.kernel.org/lkml/YPql089IwSpudw%2F1@alley/ commit d842bc6c0579ca7643eed029beabab3ac562a335 Merge: 8e6cb5d27e824 ff1176468d368 Author: Greg Kroah-Hartman Date: Mon Jul 26 11:16:46 2021 +0200 Merge v5.14-rc3 into usb-next We need the fixes in here, and this resolves a merge issue with drivers/usb/dwc3/gadget.c Signed-off-by: Greg Kroah-Hartman commit 3012248fdfeec400accef73bd2957f6d12f87234 Author: Simon Ser Date: Wed Jul 21 06:51:30 2021 +0000 drm: document drm_property_enum.value for bitfields When a property has the type DRM_MODE_PROP_BITMASK, the value field stores a bitshift, not a bitmask, which can be surprising. Signed-off-by: Simon Ser Cc: Leandro Ribeiro Reviewed-by: Daniel Vetter Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/NUZTPTKKZtAlDhxIXFB1qrUqWBYKapkBxCnb1S1bc3g@cp3-web-033.plabs.ch commit 4b5260032ec691b11a9185f7f38f5761e67fab48 Author: Artem Lapkin Date: Tue Jun 22 12:43:34 2021 +0800 arm64: dts: meson: improve gxm-khadas-vim2 wifi Improve gxm-khadas-vim2 wifi performance * change freq from 60Mhz to 100Mhz * add cap-sd-highspeed param 100Mhz works well same as in meson-khadas-vim3.dtsi Signed-off-by: Artem Lapkin Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210622044334.769791-2-art@khadas.com commit 6b197abe56feeafe9c516dca1b3ca3742200adba Author: Artem Lapkin Date: Tue Jun 22 12:43:33 2021 +0800 arm64: dts: meson: improve gxl-s905x-khadas-vim wifi Improve gxl-s905x-khadas-vim wifi performance * change freq from 60Mhz to 100Mhz 100Mhz works well same as in meson-khadas-vim3.dtsi Signed-off-by: Artem Lapkin Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210622044334.769791-1-art@khadas.com commit 72ccc373b064ae3ac0c5b5f2306069b60ca118df Author: Anand Moon Date: Mon Jul 5 11:23:55 2021 +0000 ARM: dts: meson8b: ec100: Fix the pwm regulator supply properties After enabling CONFIG_REGULATOR_DEBUG=y we observer below debug logs. Changes help link VCCK and VDDEE pwm regulator to 5V regulator supply instead of dummy regulator. [ 7.117140] pwm-regulator regulator-vcck: Looking up pwm-supply from device tree [ 7.117153] pwm-regulator regulator-vcck: Looking up pwm-supply property in node /regulator-vcck failed [ 7.117184] VCCK: supplied by regulator-dummy [ 7.117194] regulator-dummy: could not add device link regulator.8: -ENOENT [ 7.117266] VCCK: 860 <--> 1140 mV at 986 mV, enabled [ 7.118498] VDDEE: will resolve supply early: pwm [ 7.118515] pwm-regulator regulator-vddee: Looking up pwm-supply from device tree [ 7.118526] pwm-regulator regulator-vddee: Looking up pwm-supply property in node /regulator-vddee failed [ 7.118553] VDDEE: supplied by regulator-dummy [ 7.118563] regulator-dummy: could not add device link regulator.9: -ENOENT Fixes: 087a1d8b4e4c ("ARM: dts: meson8b: ec100: add the VDDEE regulator") Fixes: 3e7db1c1b7a3 ("ARM: dts: meson8b: ec100: improve the description of the regulators") Cc: Martin Blumenstingl Signed-off-by: Anand Moon Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210705112358.3554-4-linux.amoon@gmail.com commit 632062e540becbbcb067523ec8bcadb1239d9578 Author: Anand Moon Date: Mon Jul 5 11:23:54 2021 +0000 ARM: dts: meson8b: mxq: Fix the pwm regulator supply properties After enabling CONFIG_REGULATOR_DEBUG=y we observer below debug logs. Changes help link VCCK and VDDEE pwm regulator to 5V regulator supply instead of dummy regulator. Add missing pwm-supply for regulator-vcck regulator node. [ 7.117140] pwm-regulator regulator-vcck: Looking up pwm-supply from device tree [ 7.117153] pwm-regulator regulator-vcck: Looking up pwm-supply property in node /regulator-vcck failed [ 7.117184] VCCK: supplied by regulator-dummy [ 7.117194] regulator-dummy: could not add device link regulator.8: -ENOENT [ 7.117266] VCCK: 860 <--> 1140 mV at 986 mV, enabled [ 7.118498] VDDEE: will resolve supply early: pwm [ 7.118515] pwm-regulator regulator-vddee: Looking up pwm-supply from device tree [ 7.118526] pwm-regulator regulator-vddee: Looking up pwm-supply property in node /regulator-vddee failed [ 7.118553] VDDEE: supplied by regulator-dummy [ 7.118563] regulator-dummy: could not add device link regulator.9: -ENOENT Fixes: dee51cd0d2e8 ("ARM: dts: meson8b: mxq: add the VDDEE regulator") Fixes: d94f60e3dfa0 ("ARM: dts: meson8b: mxq: improve support for the TRONFY MXQ S805") Cc: Martin Blumenstingl Signed-off-by: Anand Moon Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210705112358.3554-3-linux.amoon@gmail.com commit 876228e9f935f19c7afc7ba394d17e2ec9143b65 Author: Anand Moon Date: Mon Jul 5 11:23:53 2021 +0000 ARM: dts: meson8b: odroidc1: Fix the pwm regulator supply properties After enabling CONFIG_REGULATOR_DEBUG=y we observe below debug logs. Changes help link VCCK and VDDEE pwm regulator to 5V regulator supply instead of dummy regulator. [ 7.117140] pwm-regulator regulator-vcck: Looking up pwm-supply from device tree [ 7.117153] pwm-regulator regulator-vcck: Looking up pwm-supply property in node /regulator-vcck failed [ 7.117184] VCCK: supplied by regulator-dummy [ 7.117194] regulator-dummy: could not add device link regulator.8: -ENOENT [ 7.117266] VCCK: 860 <--> 1140 mV at 986 mV, enabled [ 7.118498] VDDEE: will resolve supply early: pwm [ 7.118515] pwm-regulator regulator-vddee: Looking up pwm-supply from device tree [ 7.118526] pwm-regulator regulator-vddee: Looking up pwm-supply property in node /regulator-vddee failed [ 7.118553] VDDEE: supplied by regulator-dummy [ 7.118563] regulator-dummy: could not add device link regulator.9: -ENOENT Fixes: 524d96083b66 ("ARM: dts: meson8b: odroidc1: add the CPU voltage regulator") Fixes: 8bdf38be712d ("ARM: dts: meson8b: odroidc1: add the VDDEE regulator") Tested-by: Martin Blumenstingl Cc: Martin Blumenstingl Signed-off-by: Anand Moon Reviewed-by: Martin Blumenstingl [narmstrong: fixed typo in commit s/observer/observe/] Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210705112358.3554-2-linux.amoon@gmail.com commit 0bd475db1a5d0cd89b435ff6bfee083aca5d104a Author: Martin Blumenstingl Date: Sun Jul 18 01:30:30 2021 +0200 ARM: dts: meson8b: ec100: wire up the RT5640 audio codec The Realtek RT5640 codec is connected to the SoC's I2S interface. Describe this in the .dts together with the codec's LDO1 enable GPIO so audio can be played on the Endless Mini. While here, add a note about the realtek,ldo1-en-gpios for which the EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be used currently. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210717233030.331273-3-martin.blumenstingl@googlemail.com commit 4f8ca13df1d5ff1c09e06acbd1bc7d4d8510dfc0 Author: Martin Blumenstingl Date: Sun Jul 18 01:30:29 2021 +0200 ARM: dts: meson: Add the AIU audio controller Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This provides I2S and SPDIF outputs as well as codec glues for the internal HDMI controller. Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On Meson6 this is omitted because we neither have a clock nor pin controller node there yet. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210717233030.331273-2-martin.blumenstingl@googlemail.com commit c8cec81305463d042d51af946b6b273d8367626e Author: Anand Moon Date: Thu Jul 15 09:22:25 2021 +0000 ARM: multi_v7_defconfig: Enable CONFIG_MMC_MESON_MX_SDHC Enable CONFIG_MMC_MESON_MX_SDHC so that SDHC host controller on Amlogic SoCs boards enable support for eMMC and MMC drivers. Cc: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Signed-off-by: Anand Moon Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210715092233.1084-1-linux.amoon@gmail.com commit 46f2735c17d215fd76c54d7bfc4d7ca5ec206eb2 Author: Chen-Yu Tsai Date: Mon Jul 12 21:59:19 2021 +0800 arm64: dts: meson-gxbb: nanopi-k2: Enable Bluetooth The NanoPi K2 has a AP6212 WiFi+BT combo module. The WiFi portion is already enabled. The BT part is connected via UART and I2S. Enable the UART and add a device node describing the Bluetooth portion of the module. Reviewed-by: Martin Blumenstingl Signed-off-by: Chen-Yu Tsai Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210712135919.32059-1-wens@kernel.org commit 44cf630bcb8c5ec78125805c9447dd5766792224 Author: Martin Blumenstingl Date: Sun Jul 11 23:40:23 2021 +0200 ARM: dts: meson8: Use a higher default GPU clock frequency We are seeing "imprecise external abort (0x1406)" errors during boot (which then cause the whole board to hang) on Meson8 (but not Meson8m2). These are observed while trying to access the GPU's registers when the MALI clock is running at it's default setting of 24MHz. The 3.10 vendor kernel uses 318.75MHz as "default" GPU frequency. Using that makes the "imprecise external aborts" go away. Add the assigned-clocks and assigned-clock-rates properties to also bump the MALI clock to 318.75MHz before accessing any of it's registers. Fixes: 7d3f6b536e72c9 ("ARM: dts: meson8: add the Mali-450 MP6 GPU") Reported-by: Demetris Ierokipides Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210711214023.2163565-1-martin.blumenstingl@googlemail.com commit 9d3ef21dca2c80fd9567869e28fa2a992a5e2c4b Author: Jernej Skrabec Date: Thu Jul 22 18:12:20 2021 +0200 arm64: dts: allwinner: h6: tanix-tx6: enable emmc Tanix TX6 has 32 GiB eMMC. Add a node for it. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20210722161220.51181-4-jernej.skrabec@gmail.com commit 35f2f8b802c1a80bdbd664c7158bc76e662315a3 Author: Jernej Skrabec Date: Thu Jul 22 18:12:19 2021 +0200 arm64: dts: allwinner: h6: tanix-tx6: Add PIO power supplies While there is no publicly available schematic of this board, it's not hard to determine voltage of GPIO port C, D and G (only ones which can be set). Port C and G are used for MMC/SDIO communication, so they use 1.8 V power supply. It's not clear if port D is even used, but if it is, it's pretty safe to assume it uses 3.3 V power supply. Value read from PIO Group Withstand Voltage Mode Select register from within pre-installed Android agrees with that assesment. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20210722161220.51181-3-jernej.skrabec@gmail.com commit 7ab1f6539762946de06ca14d7401ae123821bc40 Author: Jernej Skrabec Date: Thu Jul 22 18:12:18 2021 +0200 arm64: dts: allwinner: h6: tanix-tx6: Fix regulator node names Regulator node names don't reflect class of the device. Fix that by prefixing names with "regulator-". Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20210722161220.51181-2-jernej.skrabec@gmail.com commit ba47b515f59406038a6ad763d4aff1ab50be2038 Author: Eric Biggers Date: Sat Jul 17 19:01:25 2021 -0500 fscrypt: align Base64 encoding with RFC 4648 base64url fscrypt uses a Base64 encoding to encode no-key filenames (the filenames that are presented to userspace when a directory is listed without its encryption key). There are many variants of Base64, but the most common ones are specified by RFC 4648. fscrypt can't use the regular RFC 4648 "base64" variant because "base64" uses the '/' character, which isn't allowed in filenames. However, RFC 4648 also specifies a "base64url" variant for use in URLs and filenames. "base64url" is less common than "base64", but it's still implemented in many programming libraries. Unfortunately, what fscrypt actually uses is a custom Base64 variant that differs from "base64url" in several ways: - The binary data is divided into 6-bit chunks differently. - Values 62 and 63 are encoded with '+' and ',' instead of '-' and '_'. - '='-padding isn't used. This isn't a problem per se, as the padding isn't technically necessary, and RFC 4648 doesn't strictly require it. But it needs to be properly documented. There have been two attempts to copy the fscrypt Base64 code into lib/ (https://lkml.kernel.org/r/20200821182813.52570-6-jlayton@kernel.org and https://lkml.kernel.org/r/20210716110428.9727-5-hare@suse.de), and both have been caught up by the fscrypt Base64 variant being nonstandard and not properly documented. Also, the planned use of the fscrypt Base64 code in the CephFS storage back-end will prevent it from being changed later (whereas currently it can still be changed), so we need to choose an encoding that we're happy with before it's too late. Therefore, switch the fscrypt Base64 variant to base64url, in order to align more closely with RFC 4648 and other implementations and uses of Base64. However, I opted not to implement '='-padding, as '='-padding adds complexity, is unnecessary, and isn't required by the RFC. Link: https://lore.kernel.org/r/20210718000125.59701-1-ebiggers@kernel.org Reviewed-by: Hannes Reinecke Signed-off-by: Eric Biggers commit e538b0985a05cfe245ada0bb92f177efec6b8a88 Author: Eric Biggers Date: Thu Jul 1 23:53:50 2021 -0700 fscrypt: remove mention of symlink st_size quirk from documentation Now that the correct st_size is reported for encrypted symlinks on all filesystems, update the documentation accordingly. Link: https://lore.kernel.org/r/20210702065350.209646-6-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 064c734986011390b4d111f1a99372b7f26c3850 Author: Eric Biggers Date: Thu Jul 1 23:53:49 2021 -0700 ubifs: report correct st_size for encrypted symlinks The stat() family of syscalls report the wrong size for encrypted symlinks, which has caused breakage in several userspace programs. Fix this by calling fscrypt_symlink_getattr() after ubifs_getattr() for encrypted symlinks. This function computes the correct size by reading and decrypting the symlink target (if it's not already cached). For more details, see the commit which added fscrypt_symlink_getattr(). Fixes: ca7f85be8d6c ("ubifs: Add support for encrypted symlinks") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210702065350.209646-5-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 461b43a8f92e68e96c4424b31e15f2b35f1bbfa9 Author: Eric Biggers Date: Thu Jul 1 23:53:48 2021 -0700 f2fs: report correct st_size for encrypted symlinks The stat() family of syscalls report the wrong size for encrypted symlinks, which has caused breakage in several userspace programs. Fix this by calling fscrypt_symlink_getattr() after f2fs_getattr() for encrypted symlinks. This function computes the correct size by reading and decrypting the symlink target (if it's not already cached). For more details, see the commit which added fscrypt_symlink_getattr(). Fixes: cbaf042a3cc6 ("f2fs crypto: add symlink encryption") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210702065350.209646-4-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 8c4bca10ceafc43b1ca0a9fab5fa27e13cbce99e Author: Eric Biggers Date: Thu Jul 1 23:53:47 2021 -0700 ext4: report correct st_size for encrypted symlinks The stat() family of syscalls report the wrong size for encrypted symlinks, which has caused breakage in several userspace programs. Fix this by calling fscrypt_symlink_getattr() after ext4_getattr() for encrypted symlinks. This function computes the correct size by reading and decrypting the symlink target (if it's not already cached). For more details, see the commit which added fscrypt_symlink_getattr(). Fixes: f348c252320b ("ext4 crypto: add symlink encryption") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210702065350.209646-3-ebiggers@kernel.org Signed-off-by: Eric Biggers commit d18760560593e5af921f51a8c9b64b6109d634c2 Author: Eric Biggers Date: Thu Jul 1 23:53:46 2021 -0700 fscrypt: add fscrypt_symlink_getattr() for computing st_size Add a helper function fscrypt_symlink_getattr() which will be called from the various filesystems' ->getattr() methods to read and decrypt the target of encrypted symlinks in order to report the correct st_size. Detailed explanation: As required by POSIX and as documented in various man pages, st_size for a symlink is supposed to be the length of the symlink target. Unfortunately, st_size has always been wrong for encrypted symlinks because st_size is populated from i_size from disk, which intentionally contains the length of the encrypted symlink target. That's slightly greater than the length of the decrypted symlink target (which is the symlink target that userspace usually sees), and usually won't match the length of the no-key encoded symlink target either. This hadn't been fixed yet because reporting the correct st_size would require reading the symlink target from disk and decrypting or encoding it, which historically has been considered too heavyweight to do in ->getattr(). Also historically, the wrong st_size had only broken a test (LTP lstat03) and there were no known complaints from real users. (This is probably because the st_size of symlinks isn't used too often, and when it is, typically it's for a hint for what buffer size to pass to readlink() -- which a slightly-too-large size still works for.) However, a couple things have changed now. First, there have recently been complaints about the current behavior from real users: - Breakage in rpmbuild: https://github.com/rpm-software-management/rpm/issues/1682 https://github.com/google/fscrypt/issues/305 - Breakage in toybox cpio: https://www.mail-archive.com/toybox@lists.landley.net/msg07193.html - Breakage in libgit2: https://issuetracker.google.com/issues/189629152 (on Android public issue tracker, requires login) Second, we now cache decrypted symlink targets in ->i_link. Therefore, taking the performance hit of reading and decrypting the symlink target in ->getattr() wouldn't be as big a deal as it used to be, since usually it will just save having to do the same thing later. Also note that eCryptfs ended up having to read and decrypt symlink targets in ->getattr() as well, to fix this same issue; see commit 3a60a1686f0d ("eCryptfs: Decrypt symlink target for stat size"). So, let's just bite the bullet, and read and decrypt the symlink target in ->getattr() in order to report the correct st_size. Add a function fscrypt_symlink_getattr() which the filesystems will call to do this. (Alternatively, we could store the decrypted size of symlinks on-disk. But there isn't a great place to do so, and encryption is meant to hide the original size to some extent; that property would be lost.) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210702065350.209646-2-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 108547fd85eb9b74090ffa19d8fef67b345d7898 Author: Tim Harvey Date: Fri Jul 23 11:41:15 2021 -0700 dt-bindings: arm: imx: add imx8mm/imx8mn GW7902 support The GW7902 is based on the i.MX 8M Mini / Nano SoC featuring: - LPDDR4 DRAM - eMMC FLASH - Gateworks System Controller - LTE CAT M1 modem - USB 2.0 HUB - M.2 Socket with USB2.0, PCIe, and dual-SIM - IMX8M FEC - PCIe based GbE - RS232/RS485/RS422 serial transceiver - GPS - CAN bus - WiFi / Bluetooth - MIPI header (DSI/CSI/GPIO/PWM/I2S) - PMIC Signed-off-by: Tim Harvey Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 5e36129f2b4e9629513670fc1df97545ab4bd5a1 Author: Mauro Carvalho Chehab Date: Sat Jul 24 12:22:42 2021 +0200 regulator: hi6421v600: rename voltage range arrays The arrays containing the regulator's voltage ranges are currently named after the first ldo which uses such range. However, it sounds a lot clearer if those are named with the voltage range instead. No functional changes. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1bdff1d1f23753b69c8044160decfad1e8553d08.1627121912.git.mchehab+huawei@kernel.org Signed-off-by: Mark Brown commit c20d7a9b0266be7c390c2c654bd71138c5ad6b90 Merge: d0f95e6496a97 ccb2a74eec211 Author: Mark Brown Date: Mon Jul 26 02:13:44 2021 +0100 Merge branch 'regulator-5.14' into regulator-5.15 commit ccb2a74eec211c368ddbe3eaec4a20292e431095 Author: Mauro Carvalho Chehab Date: Sat Jul 24 12:22:41 2021 +0200 regulator: hi6421v600: use lowercase for ldo As lowercase is generally preferred for node names, while it is not too late, change the LDO DT properties to lower case. Suggested-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/395510cffeb39aebd1763cc5de1cb00a2c40e461.1627121912.git.mchehab+huawei@kernel.org Signed-off-by: Mark Brown commit 35482f9dc56b9bd0f179106da7e461f6c2a2d891 Merge: 8da49a33dda72 ff1176468d368 Author: Dave Airlie Date: Mon Jul 26 09:27:59 2021 +1000 Backmerge tag 'v5.14-rc3' into drm-next Linux 5.14-rc3 Daniel said we should pull the nouveau fix from fixes in here, probably a good plan. Signed-off-by: Dave Airlie commit 4a52225d61017c0cb9133b624d5790bf86abf608 Author: Hu Haowen Date: Tue Jun 8 15:52:07 2021 +0800 docs/zh_CN: add a translation for index The original file has added a former intro in commit b51208d41c6a4e7fc2f0 ("docs: Tweak the top-level Sphinx page") and hence update the Chinese version for it. Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20210608075207.77812-1-src.res@email.cn Signed-off-by: Jonathan Corbet commit 77167b966b7e671d8ab308b1e31ebfed97986402 Author: Hannu Hartikainen Date: Wed Jul 7 16:36:35 2021 +0300 docs: submitting-patches: clarify the role of LKML The documentation previously stated that LKML should be used as *last resort*. However, scripts/get_maintainer.pl always suggests it and in a discussion about changing that[0] it turned out that LKML should in fact receive all patches. Update documentation to make it clear that all patches should be sent to LKML by default, in addition to any subsystem-specific lists. [0]: https://lore.kernel.org/lkml/19a701a8d5837088aa7d8ba594c228c0e040e747.camel@perches.com/ Signed-off-by: Hannu Hartikainen Link: https://lore.kernel.org/r/20210707133634.286840-1-hannu@hrtk.in Signed-off-by: Jonathan Corbet commit d5caec394a78617cbc0eea0870da22aa019c346d Author: Yang Xu Date: Wed Jun 23 09:37:48 2021 +0800 admin-guide/cputopology.rst: Remove non-existed cpu-hotplug.txt Since kernel commit ff58fa7f556c ("Documentation: Update CPU hotplug and move it to core-api"), cpu_hotplug.txt has been removed. We should update it in here. Signed-off-by: Yang Xu Link: https://lore.kernel.org/r/1624412269-13155-1-git-send-email-xuyang2018.jy@fujitsu.com Signed-off-by: Jonathan Corbet commit ce48ee81a1930b2218bea23490adb6673c88bf70 Author: Fabio M. De Francesco Date: Wed Jul 21 21:02:50 2021 +0200 admin-guide/hw-vuln: Rephrase a section of core-scheduling.rst Rephrase the "For MDS" section in core-scheduling.rst for the purpose of making it clearer what is meant by "kernel memory is still considered untrusted". Suggested-by: Vineeth Pillai Signed-off-by: Fabio M. De Francesco Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20210721190250.26095-1-fmdefrancesco@gmail.com Signed-off-by: Jonathan Corbet commit b426d9d78efb39800dabaed447a0bfc959038930 Author: Mauro Carvalho Chehab Date: Thu Jul 22 11:50:03 2021 +0200 docs: virt: kvm: api.rst: replace some characters The conversion tools used during DocBook/LaTeX/html/Markdown->ReST conversion and some cut-and-pasted text contain some characters that aren't easily reachable on standard keyboards and/or could cause troubles when parsed by the documentation build system. Replace the occurences of the following characters: - U+00a0 (' '): NO-BREAK SPACE as it can cause lines being truncated on PDF output Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ff70cb42d63f3a1da66af1b21b8d038418ed5189.1626947264.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit dc9c31c3ffc803b5362ca9d6ff1426ccb738f77e Author: Mauro Carvalho Chehab Date: Thu Jul 22 11:50:02 2021 +0200 docs: firmware-guide: acpi: dsd: graph.rst: replace some characters The conversion tools used during DocBook/LaTeX/html/Markdown->ReST conversion and some cut-and-pasted text contain some characters that aren't easily reachable on standard keyboards and/or could cause troubles when parsed by the documentation build system. Replace the occurences of the following characters: - U+00a0 (' '): NO-BREAK SPACE as it can cause lines being truncated on PDF output Acked-by: Rafael J. Wysocki Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a65b04a5cf341cff02d4b514dd4889b4fa4f94b8.1626947264.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit f3fd34fe0e71cb58ffa16d26fc887c6eb73fb1c0 Author: Mauro Carvalho Chehab Date: Thu Jul 22 11:50:01 2021 +0200 docs: sound: kernel-api: writing-an-alsa-driver.rst: replace some characters The conversion tools used during DocBook/LaTeX/html/Markdown->ReST conversion and some cut-and-pasted text contain some characters that aren't easily reachable on standard keyboards and/or could cause troubles when parsed by the documentation build system. Replace the occurences of the following characters: - U+00a0 (' '): NO-BREAK SPACE as it can cause lines being truncated on PDF output Reviewed-by: Takashi Iwai Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/21abe5fa495a05ac1f998ed66184a77e19ac89cc.1626947264.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 662fa3d6099374c4615bf64d06895e3573b935b2 Author: Ioana Ciornei Date: Thu Jul 22 13:03:56 2021 +0300 docs: networking: dpaa2: fix chapter title format Fix the DPAA2 DPIO driver chapter title by adding the necessary overline. Without this, the index page of the DPAA2 documentation doesn't display properly. Fixes: d8e516bac73f ("soc: fsl: dpio: Convert DPIO documentation to .rst") Signed-off-by: Ioana Ciornei Link: https://lore.kernel.org/r/20210722100356.635078-5-ciorneiioana@gmail.com Signed-off-by: Jonathan Corbet commit a9fd134be7b94622fe487ae6db48bf9514ad1a53 Author: Ioana Ciornei Date: Thu Jul 22 13:03:55 2021 +0300 docs: kvm: properly format code blocks and lists Add a '::' so that a code block is interpreted properly and also add a blank line before the start of a list. Fixes: fdc09ddd4064 ("KVM: stats: Add documentation for binary statistics interface") Signed-off-by: Ioana Ciornei Reviewed-by: Jing Zhang Link: https://lore.kernel.org/r/20210722100356.635078-4-ciorneiioana@gmail.com Signed-off-by: Jonathan Corbet commit 8b9671643d2f6f567669aa54f15b8a2791d324d5 Author: Ioana Ciornei Date: Thu Jul 22 13:03:54 2021 +0300 docs: kvm: fix build warnings Fix some small build warnings. The title underline was too short in some cases and a code block was not indented. Documentation/virt/kvm/api.rst:7216: WARNING: Title underline too short. Fixes: 6dba94035203 ("KVM: x86: Introduce KVM_GET_SREGS2 / KVM_SET_SREGS2") Signed-off-by: Ioana Ciornei Link: https://lore.kernel.org/r/20210722100356.635078-3-ciorneiioana@gmail.com Signed-off-by: Jonathan Corbet commit 5b42d0bfb73d21bc31917c4fcab4def8a398aa0d Author: Ioana Ciornei Date: Thu Jul 22 13:03:53 2021 +0300 docs: printk-formats: fix build warning Add an empty line after the '::' starting the code block so that the following lines are properly interpreted. Without this, the following build warnings are visible. Documentation/core-api/printk-formats.rst:136: WARNING: Unexpected indentation. Documentation/core-api/printk-formats.rst:137: WARNING: Block quote ends without a blank line; unexpected unindent. Fixes: 9294523e3768 ("module: add printk formats to add module build ID to stacktraces") Signed-off-by: Ioana Ciornei Reviewed-by: Stephen Boyd Acked-by: Petr Mladek Link: https://lore.kernel.org/r/20210722100356.635078-2-ciorneiioana@gmail.com Signed-off-by: Jonathan Corbet commit 6ab0493dfc6255a99eb5f157e012eeafd75f5b56 Author: Kees Cook Date: Fri Jul 23 13:05:26 2021 -0700 deprecated.rst: Include details on "no_hash_pointers" Linus decided a debug toggle for %p was tolerable, so update the %p deprecation documentation. Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210723200526.3424128-1-keescook@chromium.org Signed-off-by: Jonathan Corbet commit 0a03801ca8bddfbf634d3b42d57a0864d6b3c1ec Author: Hu Haowen Date: Sat Jul 24 21:06:11 2021 +0800 docs/zh_CN: reformat zh_CN/dev-tools/testing-overview Reorganise several long lines in order to satisfy the kernel coding style. Signed-off-by: Hu Haowen Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20210724130611.4231-1-src.res@email.cn Signed-off-by: Jonathan Corbet commit 03b7c552d081b73ba814eefc257c704b4d096d93 Author: Alyssa Rosenzweig Date: Sun Jul 25 11:00:07 2021 -0400 maintainers: Update freedesktop.org IRC channels Like many free software projects, freedesktop.org issued a non-binding recommendation for projects to migrate from Freenode to OFTC [1]. As such, freedesktop.org entries in the MAINTAINERS file are out-of-date as the respective channels have moved. Update the file to point to the right network. v2: Correct typo in commit message pointed out by Lukas and Jonathan. Add Hector's ack. v3: Add acks. [1] https://lists.freedesktop.org/archives/dri-devel/2021-May/307605.html Signed-off-by: Alyssa Rosenzweig Acked-by: Hector Martin Acked-by: Jani Nikula Cc: Karol Herbst Cc: David Airlie Cc: Daniel Vetter Cc: Lukas Wunner Cc: Jonathan Neuschäfer Cc: linux-kernel@vger.kernel.org Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210725150007.2818-2-alyssa@rosenzweig.io commit 79e93d0a74e7fb6bee5674b1d59a324c22a6338b Author: Alyssa Rosenzweig Date: Sun Jul 25 11:00:06 2021 -0400 documentation: Update #nouveau IRC channel network Like many free software projects, Nouveau recently moved from Freenode to OFTC. Update the reference. v3: Add acks. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Karol Herbst Cc: David Airlie Cc: Daniel Vetter Cc: linux-kernel@vger.kernel.org Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210725150007.2818-1-alyssa@rosenzweig.io commit 2eeb0dce728a7eac3e4dfe355d98af40d61f7a26 Author: Jaegeuk Kim Date: Thu Jul 22 10:30:58 2021 -0700 f2fs: don't sleep while grabing nat_tree_lock This tries to fix priority inversion in the below condition resulting in long checkpoint delay. f2fs_get_node_info() - nat_tree_lock -> sleep to grab journal_rwsem by contention checkpoint - waiting for nat_tree_lock In order to let checkpoint go, let's release nat_tree_lock, if there's a journal_rwsem contention. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 6de8687ccdefed40d617492f4e1b3962eb577b6b Author: Eric Biggers Date: Fri Jul 16 09:39:12 2021 -0500 f2fs: remove allow_outplace_dio() We can just check f2fs_lfs_mode() directly. The block_unaligned_IO() check is redundant because in LFS mode, f2fs doesn't do direct I/O writes that aren't block-aligned (due to f2fs_force_buffered_io() returning true in this case, triggering the fallback to buffered I/O). Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim commit 3e679dc78c17825a55e6f2cdb9078e375c945b15 Author: Eric Biggers Date: Fri Jul 16 09:39:11 2021 -0500 f2fs: make f2fs_write_failed() take struct inode Make f2fs_write_failed() take a 'struct inode' directly rather than a 'struct address_space', as this simplifies it slightly. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 71f68fe7f12182ed968cfbbd1ef018721e4dee30 Author: Heiko Stuebner Date: Wed Feb 10 12:10:17 2021 +0100 drm/rockchip: dsi: add ability to work as a phy instead of full dsi SoCs like the rk3288 and rk3399 have 3 mipi dphys on them. One is TX- only, one is RX-only and one can be configured to do either TX or RX. The RX phy is statically connected to the first Image Signal Processor, the TX phy is statically connected to the first DSI controller and the TXRX phy is connected to both the second DSI controller as well as the second ISP. The RX dphy is controlled externally through registers in the "General Register Files", while the other two are controlled through the "Configuration and Test Interface" inside their DSI controller's io-memory area. The Rockchip dw-dsi controller already controls these dphys for the TX case in the driver, but when we want to also allow configuration for RX to the ISP from the media subsystem we need to expose phy- functionality instead. So add a bit of infrastructure to allow the dsi driver to work as a phy and make sure it can be only one or the other at a time. Similarly as the dsi-controller will be part of the drm-graph when active, add an empty component to the drm-graph when in phy-mode to make the rest of the drm-graph not wait for it. Signed-off-by: Heiko Stuebner Tested-by: Sebastian Fricke Acked-by: Helen Koike Link: https://patchwork.freedesktop.org/patch/msgid/20210210111020.2476369-4-heiko@sntech.de commit a8124139845fecfa9c0100f580c03132f9774967 Author: Heiko Stuebner Date: Wed Feb 10 12:10:16 2021 +0100 dt-bindings: display: rockchip-dsi: add optional #phy-cells property The Rockchip DSI controller on some SoCs also controls a bidrectional dphy, which would be connected to an Image Signal Processor as a phy in the rx configuration. So allow a #phy-cells property for the dsi controller. Signed-off-by: Heiko Stuebner Acked-by: Rob Herring Tested-by: Sebastian Fricke Acked-by: Helen Koike Link: https://patchwork.freedesktop.org/patch/msgid/20210210111020.2476369-3-heiko@sntech.de commit c92ecb4eac76d323a793014b9bf9f39be491c606 Author: Heiko Stuebner Date: Wed Feb 10 12:10:15 2021 +0100 drm/rockchip: dsi: add own additional pclk handling In a followup patch, we'll need to access the pclk ourself to enable some functionality, so get and store it in the rockchip dw-dsi variant as well. Clocks are refcounted, so possible cascading enablements are no problem. Signed-off-by: Heiko Stuebner Tested-by: Sebastian Fricke Acked-by: Helen Koike Link: https://patchwork.freedesktop.org/patch/msgid/20210210111020.2476369-2-heiko@sntech.de commit 9491b9177fd0015f4dd118e94328a3a768f4bea3 Author: Martin Blumenstingl Date: Sun Jul 18 01:37:18 2021 +0200 iio: adc: meson-saradc: Fix indentation of arguments after a line-break Align the function arguments after a line-break with the opening parenthesis on the previous line. No functional changes intended. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210717233718.332267-4-martin.blumenstingl@googlemail.com Signed-off-by: Jonathan Cameron commit 0e1d2a5ec77e98fa8a3362d5c28b367742325aa2 Author: Martin Blumenstingl Date: Sun Jul 18 01:37:17 2021 +0200 iio: adc: meson-saradc: Add missing space between if and parenthesis Add a missing space between if and the opening parenthesis to make the coding style consistent across the whole driver. No functional changes intended. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210717233718.332267-3-martin.blumenstingl@googlemail.com Signed-off-by: Jonathan Cameron commit 48dc1abde015c6c62f05c4c29b73f77d175a2ee6 Author: Martin Blumenstingl Date: Sun Jul 18 01:37:16 2021 +0200 iio: adc: meson-saradc: Disable BL30 integration on G12A and newer SoCs G12A and newer don't use the SAR ADC to read the SoC temperature from within the firmware. Instead there's now a dedicated thermal sensor. Disable the BL30 integration for G12A and newer SoCs to save a few CPU cycles when reading samples. Adding a separate struct meson_sar_adc_data is a good idea anyways because starting with G12A there's some extra registers to read the samples in a simplified way. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210717233718.332267-2-martin.blumenstingl@googlemail.com Signed-off-by: Jonathan Cameron commit 1f49bf8b6aec78568478647f90367f57fc4f1644 Author: Geert Uytterhoeven Date: Wed Jul 14 16:51:22 2021 +0200 dt-bindings: display: ssd1307fb: Convert to json-schema Convert the Solomon SSD1307 Framebuffer Device Tree binding documentation to json-schema. Fix the spelling of the "pwms" property. Document default values. Make properties with default values not required. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714145122.2530176-1-geert@linux-m68k.org commit 47956bc86ee4e8530cac386a04f62a6095f7afbe Author: Geert Uytterhoeven Date: Wed Jul 14 11:48:06 2021 +0200 drm/bridge: nwl-dsi: Avoid potential multiplication overflow on 32-bit As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 1000000000L, the second multiplication in dsi->lanes * 8 * NSEC_PER_SEC will overflow on a 32-bit platform. Fix this by making the constant unsigned long long, forcing 64-bit arithmetic. As iMX8 is arm64, this driver is currently used on 64-bit platforms only, where long is 64-bit, so this cannot happen. But the issue will start to happen when the driver is reused for a 32-bit SoC (e.g. i.MX7ULP), or when code is copied for a new driver. Signed-off-by: Geert Uytterhoeven Reviewed-by: Fabio Estevam Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/ebb82941a86b4e35c4fcfb1ef5a5cfad7c1fceab.1626255956.git.geert+renesas@glider.be commit 6474e67eabfbb6db138820e514f068c2884d1049 Author: Oleksij Rempel Date: Wed Jul 14 06:53:46 2021 +0200 dt-bindings: display: simple: add some Logic Technologies and Multi-Inno panels Add Logictechno and Multi-Inno panels: - Logic Technologies LTTD800x480 L2RT 7" 800x480 TFT Resistive Touch Module - Logic Technologies LTTD800480070-L6WH-RT 7” 800x480 TFT Resistive Touch Module - Multi-Inno Technology Co.,Ltd MI1010AIT-1CP 10.1" 1280x800 LVDS IPS Cap Touch Mod. Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714045349.10963-2-o.rempel@pengutronix.de commit cc19862ffe454a5b632ca202e5a51bfec9f89fd2 Author: Xin Long Date: Fri Jul 23 13:25:36 2021 -0400 tipc: fix an use-after-free issue in tipc_recvmsg syzbot reported an use-after-free crash: BUG: KASAN: use-after-free in tipc_recvmsg+0xf77/0xf90 net/tipc/socket.c:1979 Call Trace: tipc_recvmsg+0xf77/0xf90 net/tipc/socket.c:1979 sock_recvmsg_nosec net/socket.c:943 [inline] sock_recvmsg net/socket.c:961 [inline] sock_recvmsg+0xca/0x110 net/socket.c:957 tipc_conn_rcv_from_sock+0x162/0x2f0 net/tipc/topsrv.c:398 tipc_conn_recv_work+0xeb/0x190 net/tipc/topsrv.c:421 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 As Hoang pointed out, it was caused by skb_cb->bytes_read still accessed after calling tsk_advance_rx_queue() to free the skb in tipc_recvmsg(). This patch is to fix it by accessing skb_cb->bytes_read earlier than calling tsk_advance_rx_queue(). Fixes: f4919ff59c28 ("tipc: keep the skb in rcv queue until the whole data is read") Reported-by: syzbot+e6741b97d5552f97c24d@syzkaller.appspotmail.com Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 8dad5561c13ade87238d9de6dd410b43f7562447 Author: Angelo Dureghello Date: Fri Jul 2 11:48:40 2021 +0200 can: flexcan: update Kconfig to enable coldfire Update flexcan to support coldfire architecture. Any new platform should use OF, but coldfire architecture is actually not supporting devicetrees. Link: https://lore.kernel.org/r/20210702094841.327679-4-angelo@kernel-space.org Signed-off-by: Angelo Dureghello Signed-off-by: Marc Kleine-Budde commit d9cead75b1c66b4660b4f87ff339234042d7c6a5 Author: Angelo Dureghello Date: Fri Jul 2 11:48:41 2021 +0200 can: flexcan: add mcf5441x support Add flexcan support for NXP ColdFire mcf5441x family. This flexcan module is quite similar to imx6 flexcan module, but with some exceptions: - 3 separate interrupt sources, MB, BOFF and ERR, - implements 16 mb only, - m68k architecture is not supporting devicetrees, so a platform data check/case has been added, - ColdFire is m68k, so big-endian cpu, with a little-endian flexcan module. Link: https://lore.kernel.org/r/20210702094841.327679-5-angelo@kernel-space.org Signed-off-by: Angelo Dureghello Signed-off-by: Marc Kleine-Budde commit 896e7f3e7424d6cc1436172740aa76ebb2c1b248 Author: Angelo Dureghello Date: Fri Jul 2 11:48:37 2021 +0200 can: flexcan: add platform data header Add platform data header for flexcan. Link: https://lore.kernel.org/r/20210702094841.327679-1-angelo@kernel-space.org Signed-off-by: Angelo Dureghello Signed-off-by: Marc Kleine-Budde commit f4f5247daa45eef07b1779195fa8d65f19c2eb5f Author: Vincent Mailhol Date: Tue Jun 29 00:54:20 2021 +0900 can: etas_es58x: rewrite the message cast in es58{1,_fd}_tx_can_msg to increase readability The es581_tx_can_msg() does below cast: | tx_can_msg = (struct es581_4_tx_can_msg *) | &es581_4_urb_cmd->bulk_tx_can_msg.tx_can_msg_buf[msg_len - 1]; The -1 offset is to skip the first member of struct es581_4_tx_can_msg. However, es581_4_urb_cmd already has a raw_msg field which can be used instead without the use of an offset calculation. The function es58x_fd_tx_can_msg() is also modified to mirror es581_tx_can_msg(). Link: https://lore.kernel.org/r/20210628155420.1176217-7-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 7fcecf51c18fa7e58e21f1a32d6a8df0c6f85784 Author: Vincent Mailhol Date: Tue Jun 29 00:54:19 2021 +0900 can: etas_es58x: use sizeof and sizeof_field macros instead of constant values Replace two constant values by a call to sizeof{,_field} on the relevant field to make the logic easier to understand. Link: https://lore.kernel.org/r/20210628155420.1176217-6-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 004653f0abf202072e1d855d3556dff60784effc Author: Vincent Mailhol Date: Tue Jun 29 00:54:18 2021 +0900 can: etas_es58x: add es58x_free_netdevs() to factorize code Both es58x_probe() and es58x_disconnect() use a similar code snippet to release the netdev resources. Factorize it in an helper function named es58x_free_netdevs(). Link: https://lore.kernel.org/r/20210628155420.1176217-5-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 6bde4c7fd8455101dbba6838a6d11bc4451b9a0d Author: Vincent Mailhol Date: Tue Jun 29 00:54:17 2021 +0900 can: etas_es58x: use devm_kzalloc() to allocate device resources Replace kzalloc() with devm_kzalloc(). By doing this, we do not need to care anymore about having to call kfree(). This result in a simpler and more easy to read code. Link: https://lore.kernel.org/r/20210628155420.1176217-4-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 45cb13963df304fde13262654939dfb18788f95e Author: Vincent Mailhol Date: Tue Jun 29 00:54:16 2021 +0900 can: etas_es58x: use error pointer during device probing Make es58x_init_es58x_dev return a pointer to the allocated structure instead of returning an integer. Errors are handled through the helper function ERR_PTR and IS_ERR. This slightly simplifies the code. Link: https://lore.kernel.org/r/20210628155420.1176217-3-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 58fb92a517b58ff61237653a5c05c3f3d8dfe392 Author: Vincent Mailhol Date: Tue Jun 29 00:54:15 2021 +0900 can: etas_es58x: fix three typos in author name and documentation Change the author name from "lastname firstname" to "firstname lastname". Fix a typo in a variable name in the documentation of struct es58x_parameters::fifo_mask. Fix a typo in the title of the datasheet (E701 -> E70) and re-indent the comments. Link: https://lore.kernel.org/r/20210628155420.1176217-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit c11dcee758302702a83c6e85e4c4c3d9af42d2b3 Author: Stephane Grosjean Date: Thu Jul 15 16:28:41 2021 +0200 can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes This patch updates old code by using the can_change_state() function published since by the socket-can module. In particular, this new code better manages the change of bus state by also using the value of the error counters that the driver now systematically asks for when initializing the channel. Link: https://lore.kernel.org/r/20210715142842.35793-1-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 1763c547648d5592b79139a1f5cf2e88d6258cf6 Author: Stephane Grosjean Date: Fri Jun 25 15:09:30 2021 +0200 can: peak_usb: pcan_usb_encode_msg(): add information This patch adds information by replacing a hard-coded values with its symbol and a adding comment. Link: https://lore.kernel.org/r/20210625130931.27438-5-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 3a7939495ce8213656419ed7dbbc7f32e9645bdf Author: Stephane Grosjean Date: Fri Jun 25 15:09:28 2021 +0200 can: peak_usb: PCAN-USB: add support of loopback and one-shot mode The CAN - USB PCAN-USB interface is able to generate one-shot frames as well as loopback frames that it transmits starting from version 4.1 of its firmware. This patch adds support for the one-shot and loopback functionality to the driver, that can be activated if the embedded firmware allows it. If the driver detects that the PCAN-USB device runs an old firmware (< 4.1) it prints a message suggesting to contact for a possible firmware update. Link: https://lore.kernel.org/r/20210625130931.27438-3-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 1d0214a0f5db10d5dc37f4da980786cd094ae3e4 Author: Stephane Grosjean Date: Fri Jun 25 15:09:27 2021 +0200 can: peak_usb: pcan_usb_get_device_id(): read value only in case of success In case of error, reading value from response argument is useless. Link: https://lore.kernel.org/r/20210625130931.27438-2-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 805ff68c8e7f4d78b47bda16a503da0c4bcbd9d0 Author: Stephane Grosjean Date: Mon Jun 7 17:17:20 2021 +0200 can: peak_pci: Add name and FW version of the card in kernel buffer This patch adds name and (possibly) firmware version information to the kernel about the detected PEAK-System CAN - PCI/PCIe interface card. Link: https://lore.kernel.org/r/20210607151720.13571-1-s.grosjean@peak-system.com Signed-off-by: Stephane Grosjean [mkl: reformated struct pci_device_id peak_pci_tbl] Signed-off-by: Marc Kleine-Budde commit fe1fa1387a15f0e8708e7ce6312fa0fe4ad952dd Author: Marc Kleine-Budde Date: Fri Jun 11 15:20:14 2021 +0200 can: peak_pci: fix checkpatch warnings This patch cleans several checkpatch warnings in the peak_pci driver. Cc: Stephane Grosjean Link: https://lore.kernel.org/r/20210616102811.2449426-0-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 9b69aff9fd1a6653c1f9da13756541fbb798ba52 Author: Marc Kleine-Budde Date: Fri Jun 11 15:16:14 2021 +0200 can: peak_pci: convert comments to network style comments This patch converts all comments to network subsystem style comments. Cc: Stephane Grosjean Link: https://lore.kernel.org/r/20210616102811.2449426-8-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 5bbe60493a215a3ed333df8e5ba3caedc549a0a3 Author: Peng Li Date: Sat Jun 19 17:56:29 2021 +0800 net: at91_can: fix the comments style issue Networking block comments don't use an empty /* line, use /* Comment... Block comments use * on subsequent lines. Block comments use a trailing */ on a separate line. This patch fixes the comments style issues. Link: https://lore.kernel.org/r/1624096589-13452-9-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit fc1d97d4fbfd600c32e4cac29b48959edc22e954 Author: Peng Li Date: Sat Jun 19 17:56:28 2021 +0800 net: at91_can: remove redundant space According to the chackpatch.pl, no space before tabs. Link: https://lore.kernel.org/r/1624096589-13452-8-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 02400533bb70ce3fa0c36e2e91acbc4f9473df71 Author: Peng Li Date: Sat Jun 19 17:56:27 2021 +0800 net: at91_can: add braces {} to all arms of the statement Braces {} should be used on all arms of this statement. Link: https://lore.kernel.org/r/1624096589-13452-7-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit ccc5f1c994dfde9a2e0260895fa3c232dc14c82d Author: Peng Li Date: Sat Jun 19 17:56:26 2021 +0800 net: at91_can: fix the alignment issue Alignment should match open parenthesis. Link: https://lore.kernel.org/r/1624096589-13452-6-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 8ed1661cf21ec86351a47a82f641ec46501a1029 Author: Peng Li Date: Sat Jun 19 17:56:25 2021 +0800 net: at91_can: use BIT macro This patch uses the BIT macro for setting individual bits, to fix the following checkpatch.pl issue: CHECK: Prefer using the BIT macro. Link: https://lore.kernel.org/r/1624096589-13452-5-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 57bca980bad41a57448af01922cbec22f1ab23b1 Author: Peng Li Date: Sat Jun 19 17:56:24 2021 +0800 net: at91_can: fix the code style issue about macro Macros with complex values should be enclosed in parentheses Link: https://lore.kernel.org/r/1624096589-13452-4-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 933850c4b9126d41e1b0451e5a1b62c6ddcc0707 Author: Peng Li Date: Sat Jun 19 17:56:23 2021 +0800 net: at91_can: add blank line after declarations This patch fixes the checkpatch error about missing a blank line after declarations. Link: https://lore.kernel.org/r/1624096589-13452-3-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 822a99c41fb45e083eed8504ba878ba0fb73ee16 Author: Peng Li Date: Sat Jun 19 17:56:22 2021 +0800 net: at91_can: remove redundant blank lines This patch removes some redundant blank lines. Link: https://lore.kernel.org/r/1624096589-13452-2-git-send-email-huangguangbin2@huawei.com Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: Marc Kleine-Budde commit 42b9fd6ec7c95bfbf26805ea77a7c27cb3fa6274 Author: Zhen Lei Date: Thu Jun 3 18:02:33 2021 +0800 can: at91_can: use DEVICE_ATTR_RW() helper macro Use DEVICE_ATTR_RW() helper macro instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Link: https://lore.kernel.org/r/20210603100233.11877-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Marc Kleine-Budde commit f731707c56670e246ca13b1b8d378eac1741c1b5 Author: Zhen Lei Date: Thu Jun 3 19:17:39 2021 +0800 can: janz-ican3: use DEVICE_ATTR_RO/RW() helper macro Use DEVICE_ATTR_RO/RW() helper macro instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Link: https://lore.kernel.org/r/20210603111739.11983-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Marc Kleine-Budde commit 681e4a76452172d06648d5337cc3207c866297db Author: Zhen Lei Date: Thu Jun 3 19:09:02 2021 +0800 can: esd_usb2: use DEVICE_ATTR_RO() helper macro Use DEVICE_ATTR_RO() helper macro instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Link: https://lore.kernel.org/r/20210603110902.11930-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Marc Kleine-Budde commit cb6adfe2768074c637efd0bb2fe15e9a323b704e Author: Marc Kleine-Budde Date: Thu Jul 22 09:53:23 2021 +0200 can: mcp251xfd: mcp251xfd_open(): request IRQ as shared The driver's IRQ handler supports shared IRQs, so request a shared IRQ handler. Link: https://lore.kernel.org/r/20210724205212.737328-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 71520f85f908fd4e5c4a8b6e14ed4b357dc666a1 Author: Andy Shevchenko Date: Wed May 26 22:33:27 2021 +0300 can: mcp251xfd: Fix header block to clarify independence from OF The driver is neither dependent on OF, nor it requires any OF headers. Fix header block to clarify independence from OF. Link: https://lore.kernel.org/r/http://lore.kernel.org/r/20210531084444.1785397-2-mkl@pengutronix.de Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 74f89cf17e44211d4bd53c8da593de070bf1fe0f Author: Andy Shevchenko Date: Wed May 26 22:33:26 2021 +0300 can: mcp251xfd: mcp251xfd_probe(): try to get crystal clock rate from property In some configurations, mainly ACPI-based, the clock frequency of the device is supplied by very well established 'clock-frequency' property. Hence, try to get it from the property at last if no other providers are available. Link: https://lore.kernel.org/r/20210531084444.1785397-1-mkl@pengutronix.de Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 0ddd83fbebbc5537f9d180d31f659db3564be708 Author: Marc Kleine-Budde Date: Tue Dec 15 11:17:26 2020 +0100 can: m_can: remove support for custom bit timing Since commit aee2b3ccc8a6 ("can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver") there is no use of the device specific bit timing parameters (m_can_classdev::bit_timing and struct m_can_classdev::data_timing). This patch removes the support for custom bit timing from the driver, as the common bit timing works for all known IP core implementations. Cc: Chandrasekar Ramakrishnan Link: https://lore.kernel.org/r/20210616102811.2449426-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 9808dba1bbcb8271bd1e7d66b43b555c926b8eb0 Author: Yang Yingliang Date: Thu Jun 3 15:34:41 2021 +0800 can: m_can: use devm_platform_ioremap_resource_byname Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Link: https://lore.kernel.org/r/20210603073441.2983497-1-yangyingliang@huawei.com Signed-off-by: Yang Yingliang Signed-off-by: Marc Kleine-Budde commit d836cb5fe045463cdab15ad6f278f7c7c194228f Author: Faiz Abbas Date: Mon May 10 10:55:41 2021 +0530 can: m_can: Add support for transceiver as phy Add support for implementing transceiver node as phy. The max_bitrate is obtained by getting a phy attribute. Link: https://lore.kernel.org/r/20210724174001.553047-1-mkl@pengutronix.de Signed-off-by: Faiz Abbas Signed-off-by: Aswath Govindraju Signed-off-by: Marc Kleine-Budde commit 9c0e7ccd831b093d3b44aedd39bc89351c5a9388 Author: Faiz Abbas Date: Mon May 10 10:55:40 2021 +0530 dt-bindings: net: can: Document transceiver implementation as phy Some transceivers need a configuration step (for example, pulling the standby or enable lines) for them to start sending messages. The transceiver can be implemented as a phy with the configuration done in the phy driver. The bit rate limitation can the be obtained by the driver using the phy node. Document the above implementation in the bosch mcan bindings. Link: https://lore.kernel.org/r/20210510052541.14168-2-a-govindraju@ti.com Signed-off-by: Faiz Abbas Signed-off-by: Aswath Govindraju Acked-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 6b6bd199926797414bf4d6843312709dfd4a649e Author: Vincent Mailhol Date: Fri Jun 4 00:15:49 2021 +0900 can: netlink: remove redundant check in can_validate() can_validate() does a first check: | if (is_can_fd) { | if (!data[IFLA_CAN_BITTIMING] || !data[IFLA_CAN_DATA_BITTIMING]) | return -EOPNOTSUPP; | } If that first if succeeds, we know that if is_can_fd is true then data[IFLA_CAN_BITTIMING is set. However, the next if switch does not leverage on above knowledge and redoes the check: | if (data[IFLA_CAN_DATA_BITTIMING]) { | if (!is_can_fd || !data[IFLA_CAN_BITTIMING]) | ^~~~~~~~~~~~~~~~~~~~~~~~ | return -EOPNOTSUPP; | } This patch removes that redundant check. Link: https://lore.kernel.org/r/20210603151550.140727-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit e3b0a4a470647bc48c186a71cc63ddcb93899424 Author: Vincent Mailhol Date: Fri Jun 18 17:19:03 2021 +0900 can: netlink: clear data_bittiming if FD is turned off When the FD is turned off through the netlink interface, the data bit timing values still remain in data_bittiming and are displayed despite of the feature being disabled. Example: | $ ip link set can0 type can bitrate 500000 dbitrate 2000000 fd on | $ ip --details link show can0 | 1: can0: mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10 | link/can promiscuity 0 minmtu 0 maxmtu 0 | can state STOPPED restart-ms 0 | bitrate 500000 sample-point 0.875 | tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1 | ES582.1/ES584.1: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 brp-inc 1 | dbitrate 2000000 dsample-point 0.750 | dtq 12 dprop-seg 14 dphase-seg1 15 dphase-seg2 10 dsjw 1 | ES582.1/ES584.1: dtseg1 2..32 dtseg2 1..16 dsjw 1..8 dbrp 1..32 dbrp-inc 1 | clock 80000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 | | $ ip link set can0 type can bitrate 500000 fd off | $ ip --details link show can0 | 1: can0: mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10 | link/can promiscuity 0 minmtu 0 maxmtu 0 | can state STOPPED restart-ms 0 | bitrate 500000 sample-point 0.875 | tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1 | ES582.1/ES584.1: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 brp-inc 1 | dbitrate 2000000 dsample-point 0.750 | dtq 12 dprop-seg 14 dphase-seg1 15 dphase-seg2 10 dsjw 1 | ES582.1/ES584.1: dtseg1 2..32 dtseg2 1..16 dsjw 1..8 dbrp 1..32 dbrp-inc 1 | clock 80000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 Remark: once FD is turned off, it is not possible to turn fd back on and reuse the previously input data bit timing values: | $ ip link set can0 type can bitrate 500000 fd on | RTNETLINK answers: Operation not supported This means that the user will need to re-configure the data bit timing in order to turn fd on again. Because old data bit timing values cannot be reused, this patch clears priv->data_bit timing whenever FD is turned off. This way, the data bit timing variables are not displayed anymore. Link: https://lore.kernel.org/r/20210618081904.141114-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 8345a330738149389dc8883573c9264965922e08 Author: Marc Kleine-Budde Date: Wed Jun 16 11:55:26 2021 +0200 can: bittiming: fix documentation for struct can_tdc This patch fixes a typo in the documentation for struct can_tdc::tdcv. The number "0" refers to automatic mode not the letter "O". Further two grammar errors in the documentation for struct can_tdc are fixed. First grammar error: add a missing third person 's'. Second grammar error: replace "such as" by "such that". The intent is to give a condition, not an example. Fixes: 289ea9e4ae59 ("can: add new CAN FD bittiming parameters: Transmitter Delay Compensation (TDC)") Link: https://lore.kernel.org/r/20210616095922.2430415-1-mkl@pengutronix.de Link: https://lore.kernel.org/r/20210616124057.60723-1-mailhol.vincent@wanadoo.fr Co-developed-by: Vincent Mailhol Signed-off-by: Vincent Mailhol Acked-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 30bfec4fec5902731c8823f51c5332e6f2b2312a Author: Marc Kleine-Budde Date: Mon May 10 22:51:39 2021 +0200 can: rx-offload: can_rx_offload_threaded_irq_finish(): add new function to be called from threaded interrupt After reading all CAN frames from the controller in the IRQ handler and storing them into a skb_queue, the driver calls napi_schedule(). In the napi poll function the skb from the skb_queue are then pushed into the networking stack. However if napi_schedule() is called from a threaded IRQ handler this triggers the following error: | NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! To avoid this, create a new rx-offload function (can_rx_offload_threaded_irq_finish()) with a call to local_bh_disable()/local_bh_enable() around the napi_schedule() call. Convert all drivers that call can_rx_offload_irq_finish() from threaded IRQ context to can_rx_offload_threaded_irq_finish(). Link: https://lore.kernel.org/r/20210724204745.736053-4-mkl@pengutronix.de Suggested-by: Daniel Glöckner Tested-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit 1e0d8e507ea42dd37f52636db300de7ea7118012 Author: Marc Kleine-Budde Date: Fri May 7 17:58:30 2021 +0200 can: rx-offload: can_rx_offload_irq_finish(): directly call napi_schedule() Instead of calling can_rx_offload_schedule() call napi_schedule() directly. As this was the last use of can_rx_offload_schedule() remove this helper function. Link: https://lore.kernel.org/r/20210724204745.736053-3-mkl@pengutronix.de Tested-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit c757096ea1033c46ab768709847f7776b7e92a92 Author: Marc Kleine-Budde Date: Wed Oct 9 06:41:08 2019 +0200 can: rx-offload: add skb queue for use during ISR Adding a skb to the skb_queue in rx-offload requires to take a lock. This commit avoids this by adding an unlocked skb queue that is appended at the end of the ISR. Having one lock at the end of the ISR should be OK as the HW is empty, not about to overflow. Link: https://lore.kernel.org/r/20210724204745.736053-2-mkl@pengutronix.de Tested-by: Oleksij Rempel Co-developed-by: Kurt Van Dijck Signed-off-by: Kurt Van Dijck Signed-off-by: Marc Kleine-Budde commit a08ec5fe709fe0d9fbd524ca6dcf6c41320d5bf3 Author: Marc Kleine-Budde Date: Fri May 21 10:04:29 2021 +0200 can: j1939: j1939_xtp_rx_dat_one(): use separate pointer for session skb control buffer In the j1939_xtp_rx_dat_one() function, there are 2 variables (skb and se_skb) holding a skb. The control buffer of the skbs is accessed one after the other, but using the same "skcb" variable. To avoid confusion introduce a new variable "se_skcb" to access the se_skb's control buffer as done in the rest of this file, too. Cc: Robin van der Gracht Cc: Oleksij Rempel Link: https://lore.kernel.org/r/20210616102811.2449426-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 78b77c760f71ef408a2276f5a3b531c400089304 Author: Marc Kleine-Budde Date: Fri May 21 10:04:29 2021 +0200 can: j1939: j1939_session_tx_dat(): use consistent name se_skcb for session skb control buffer This patch changes the name of the "skcb" variable in j1939_session_tx_dat() to "se_skcb" as it's the session skb's control buffer. The same name is used in other functions for the session skb's control buffer. Cc: Robin van der Gracht Cc: Oleksij Rempel Link: https://lore.kernel.org/r/20210616102811.2449426-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 7ac56e40d054ba417f01b31aaeedcbce3f9de9da Author: Marc Kleine-Budde Date: Fri May 21 10:04:29 2021 +0200 can: j1939: j1939_session_completed(): use consistent name se_skb for the session skb This patch changes the name of the "skb" variable in j1939_session_completed() to "se_skb" as it's the session skb. The same name is used in other functions for the session skb. Cc: Robin van der Gracht Cc: Oleksij Rempel Link: https://lore.kernel.org/r/20210616102811.2449426-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 641ba6ded2343d1885d16eb03ad78edfbfea4724 Author: Marc Kleine-Budde Date: Wed Jun 16 08:53:16 2021 +0200 can: j1939: replace fall through comment by fallthrough pseudo-keyword Replace the existing /* fall through */ comments the new pseudo-keyword macro fallthrough. Cc: Robin van der Gracht Cc: Oleksij Rempel Link: https://lore.kernel.org/r/20210616102811.2449426-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 333128737955c8a9f4377c436b0ef98aa866175f Author: Marc Kleine-Budde Date: Wed Jun 16 08:58:01 2021 +0200 can: j1939: fix checkpatch warnings This patch fixes a checkpatch warning about a long line and wrong indention. Cc: Robin van der Gracht Cc: Oleksij Rempel Link: https://lore.kernel.org/r/20210616102811.2449426-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 04bdec2b904fa7211dcedfc0bd331b639fe80290 Author: gushengxian Date: Fri Jun 11 12:39:33 2021 +0800 can: j1939: j1939_sk_sock_destruct(): correct a grammatical error Correct a grammatical error. Link: https://lore.kernel.org/r/20210611043933.17047-1-13145886936@163.com Signed-off-by: gushengxian Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde commit 1522756c7954395adfc97056ea987dbb5965da41 Author: Thomas Zimmermann Date: Tue Jul 20 10:09:41 2021 +0200 drm/shmobile: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. v3: * return error if (ret < 0) (Geert) * remove duplicate error message (Geert) v2: * handle errors in platform_get_irq() (Geert, Sergei) * store IRQ number in struct shmob_drm_device (Laurent) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210720080941.23646-1-tzimmermann@suse.de commit 616d5769345528b989294a242a5906b157a92837 Author: Tal Gilboa Date: Sun Jul 18 14:54:13 2021 +0300 IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq is_apu_thread_cq() used to detect CQs which are attached to APU threads. This was extended to support other elements as well, so the function was renamed to is_apu_cq(). c_eqn_or_apu_element was extended from 8 bits to 32 bits, which wan't reflected when the APU support was first introduced. Acked-by: Michael S. Tsirkin # vdpa Signed-off-by: Tal Gilboa Signed-off-by: Leon Romanovsky commit 0e804326759de7b9991353dd66b03595b5c3f544 Merge: c5381154393d4 7186aac9c22de Author: David S. Miller Date: Sun Jul 25 09:21:32 2021 +0100 Merge branch 'nfc-const' Krzysztof Kozlowski says: ==================== nfc: constify data structures Constify pointers to several data structures which are not modified by NFC core or by drivers to make it slightly safer. No functional impact expected. ==================== Signed-off-by: David S. Miller commit 7186aac9c22de855220ebc54df7af399647bd1fc Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:28 2021 +0200 nfc: constify nfc_digital_ops Neither the core nor the drivers modify the passed pointer to struct nfc_digital_ops, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 49545357bf7e134a4012d4652c2df5f78f4485af Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:27 2021 +0200 nfc: constify nfc_llc_ops Neither the core nor the drivers modify the passed pointer to struct nfc_llc_ops, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 094c45c84d799fb0eb3617632097370843ba3678 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:26 2021 +0200 nfc: constify nfc_hci_ops Neither the core nor the drivers modify the passed pointer to struct nfc_hci_ops, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit f6c802a726aea43a2937763f13560c1fd170fae6 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:25 2021 +0200 nfc: constify nfc_ops Neither the core nor the drivers modify the passed pointer to struct nfc_ops, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 5f3e63933793fff15ae3b968f1c03698bdd3fc66 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:24 2021 +0200 nfc: constify nfc_hci_gate Neither the core nor the drivers modify the passed pointer to struct nfc_hci_gate, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 15944ad2e5a1cc2ef2c6fa60b04e464dbb4ddb61 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:23 2021 +0200 nfc: constify pointer to nfc_vendor_cmd Neither the core nor the drivers modify the passed pointer to struct nfc_vendor_cmd, so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 0f20ae9bb96be60f50d51feb37f1435dac5687ea Author: Krzysztof Kozlowski Date: Sat Jul 24 23:49:22 2021 +0200 nfc: st21nfca: constify file-scope arrays Driver only reads len_seq and wait_tab variables. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 7a5e98daf6bdba5822aa274f8555199361060658 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:47:36 2021 +0200 nfc: constify nfc_phy_ops Neither the core nor the drivers modify the passed pointer to struct nfc_phy_ops (consisting of function pointers), so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit cb8caa3c6c04c18027258ab34e09bcf87e726f22 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:47:35 2021 +0200 nfc: constify nci_driver_ops (prop_ops and core_ops) Neither the core nor the drivers modify the passed pointer to struct nci_driver_ops (consisting of function pointers), so make it a pointer to const for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit d08ba0fdeaba03c70483d74de4401e67bbd9f020 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:47:34 2021 +0200 nfc: s3fwrn5: constify nci_ops s3fwrn5 driver modifies static struct nci_ops only to set prop_ops. Since prop_ops is build time constant with known size, it can be made const. This allows to removeo the function setting the prop_ops - s3fwrn5_nci_get_prop_ops(). Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit b9c28286d8f1822a10f702fcefe0b8a1db4e6917 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:47:33 2021 +0200 nfc: constify nci_ops The struct nci_ops is modified by NFC core in only one case: nci_allocate_device() receives too many proprietary commands (prop_ops) to configure. This is a build time known constrain, so a graceful handling of such case is not necessary. Instead, fail the nci_allocate_device() and add BUILD_BUG_ON() to places which set these. This allows to constify the struct nci_ops (consisting of function pointers) for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 48d5440393d328cfe18b26e3609c84c0f41d6515 Author: Krzysztof Kozlowski Date: Sat Jul 24 23:47:32 2021 +0200 nfc: constify payload argument in nci_send_cmd() The nci_send_cmd() payload argument is passed directly to skb_put_data() which already accepts a pointer to const, so make it const as well for correctness and safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit ec387b8ff8d757561369be9a280cf63f23bbb926 Author: Lucas De Marchi Date: Thu Jul 22 16:29:22 2021 -0700 drm/i915/display: split DISPLAY_VER 9 and 10 in intel_setup_outputs() Commit 5a9d38b20a5a ("drm/i915/display: hide workaround for broken vbt in intel_bios.c") moved the workaround for broken or missing VBT to intel_bios.c. However is_port_valid() only protects the handling of different skus of the same display version. Since in intel_setup_outputs() we share the code path with version 9, this would also create port F for SKL/KBL, which does not exist. Missing VBT can be reproduced when starting a headless QEMU with no opregion available. Avoid the issue by splitting versions 9 and 10 in intel_setup_outputs(), which also makes it more clear what code path it's taking for each version. v2: move generic display version after Geminilake since that one has a different set of outputs Fixes: 5a9d38b20a5a ("drm/i915/display: hide workaround for broken vbt in intel_bios.c") Cc: Jani Nikula Cc: Rodrigo Vivi Reported-by: Christoph Hellwig Signed-off-by: Lucas De Marchi Reviewed-by: Rodrigo Vivi Reviewed-by: Matt Roper Tested-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210722232922.3796835-1-lucas.demarchi@intel.com commit 4fd177288a4ee046bd8590355a64de855dcf77e2 Author: Lucas De Marchi Date: Fri Jul 23 16:43:52 2021 -0700 drm/i915: fix not reading DSC disable fuse in GLK We were using GRAPHICS_VER() to handle SKL_DFSM register, which means we were not handling GLK correctly since that has GRAPHICS_VER == 9, but DISPLAY_VER == 10. Switch the entire branch to check DISPLAY_VER which makes it more in line with Bspec. Even though the Bspec has an exception for RKL in TGL_DFSM_PIPE_D_DISABLE, we don't have to do anything as the bit has disable semantic and RKL doesn't have pipe D. Bspec: 50075, 7548 Fixes: 2b5a4562edd0 ("drm/i915/display: Simplify GLK display version tests") Cc: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210723234352.214459-1-lucas.demarchi@intel.com commit c7ef8f3572ae4cec1915070bae7bc01c6a2e8b19 Author: Yongqiang Niu Date: Fri Jul 16 14:32:22 2021 +0800 drm/mediatek: Add mt8183 aal support Add mt8183 aal private data. Signed-off-by: Yongqiang Niu Tested-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit 78d1783c32434564bf4d31fae7fffaacd03ba080 Author: Yongqiang Niu Date: Fri Jul 16 14:32:21 2021 +0800 drm/mediatek: Separate aal sub driver MT8173 aal has gamma function but mt8183 aal has no gamma function, so separate aal sub driver to have a private data for different SoC. Signed-off-by: Yongqiang Niu Tested-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit 630211a17055bafd21fb83ae8c0002b2e214ebb2 Author: Tom Rix Date: Fri Jun 25 12:51:48 2021 -0700 fpga: fpga-mgr: wrap the write_sg() op An FPGA manager should not be required to provide a write_sg function. Move the op check to the wrapper. Default to -EOPNOTSUP so its users will fail gracefully. [mdf@kernel.org: Reworded first line] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 6489d3b00398f02457eea566d4a99698c68cc89f Author: Tom Rix Date: Fri Jun 25 12:51:47 2021 -0700 fpga: fpga-mgr: wrap the fpga_remove() op An FPGA manager is not required to provide a fpga_remove() op. Add a wrapper consistent with the other op wrappers. Move op check to wrapper. [mdf@kernel.org: Reworded first line] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit b02a40713db95ebd8f72151b0fea8080d9f74c27 Author: Tom Rix Date: Fri Jun 25 12:51:46 2021 -0700 fpga: fpga-mgr: wrap the state() op An FPGA manager should not be required to provide a state() op. Add a wrapper consistent with the other op wrappers. Move op check to wrapper. Default to FPGA_MGR_STATE_UNKNOWN, what noop state() ops use. Remove unneeded noop state() ops [mdf@kernel.org: Reworded first line] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 6f9922711359d2092fb91036193dfed0d1bdf8b8 Author: Tom Rix Date: Fri Jun 25 12:51:45 2021 -0700 fpga: fpga-mgr: wrap the status() op An FPGA manager is not required to provide a status() op. Add a wrapper consistent with the other op wrappers. Move the op check to the wrapper. Default to 0, no errors to report. [mdf@kernel.org: Reworded first line] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 8ebab40fd8f1683140890a77fadf571db98686b8 Author: Tom Rix Date: Fri Jun 25 12:51:44 2021 -0700 fpga: fpga-mgr: wrap the write() op An FPGA manager should not be required to provide a write function. Move the op check to the wrapper. Default to -EOPNOTSUP so its users will fail gracefully. [mdf@kernel.org: Reworded message] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 72d935020ea81c0092c23b580352fe1310505c28 Author: Tom Rix Date: Fri Jun 25 12:51:43 2021 -0700 fpga: fpga-mgr: make write_complete() op optional An FPGA manager should not be required to provide a write_complete function if there is nothing. Move the op check to the existing wrapper. Default to success and remove noop function. [mdf@kernel.org: Reworded message] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 2e8438b754abcf13f2306237bd0bfe6e7dcb379a Author: Tom Rix Date: Fri Jun 25 12:51:42 2021 -0700 fpga: fpga-mgr: wrap the write_init() op An FPGA manager should not be required to provide a write_init() op if there is nothing for it do. So add a wrapper and move the op checking. Default to success. [mdf@kernel.org: Reworded first line] Signed-off-by: Tom Rix Signed-off-by: Moritz Fischer commit 6f125e87184ea5f8ad677c2cc4a9c9c6e717554b Author: Moritz Fischer Date: Thu Jul 1 20:54:04 2021 -0700 fpga: zynqmp-fpga: Address warning about unused variable warning: ‘zynqmp_fpga_of_match’ defined but not used [-Wunused-const-variable=] static const struct of_device_id zynqmp_fpga_of_match[] = { Fixes: c09f7471127e ("fpga manager: Adding FPGA Manager support for Xilinx zynqmp") Cc: Tom Rix Signed-off-by: Moritz Fischer commit 56ddc787706c7413da63fb6640361285f1bb1d55 Author: Moritz Fischer Date: Thu Jul 1 20:54:03 2021 -0700 fpga: xilinx-pr-decoupler: Address warning about unused variable warning: ‘xlnx_pr_decoupler_of_match’ defined but not used [-Wunused-const-variable=] static const struct of_device_id xlnx_pr_decoupler_of_match[] = { Fixes: 7e961c12be42 ("fpga: Add support for Xilinx LogiCORE PR Decoupler") Cc: Tom Rix Signed-off-by: Moritz Fischer commit 1aa3fc699c11a6458d49837545b295361250a765 Author: Moritz Fischer Date: Thu Jul 1 20:54:02 2021 -0700 fpga: xiilnx-spi: Address warning about unused variable warning: ‘xlnx_spi_of_match’ defined but not used [-Wunused-const-variable] static const struct of_device_id xlnx_spi_of_match[] = { Fixes: 061c97d13f1a ("fpga manager: Add Xilinx slave serial SPI driver") Cc: Tom Rix Signed-off-by: Moritz Fischer commit e3fd0cfb852b9d201973665e2287cce43dd92c77 Author: Moritz Fischer Date: Thu Jul 1 20:54:01 2021 -0700 fpga: altera-freeze-bridge: Address warning about unused variable warning: unused variable 'altera_freeze_br_of_match' [-Wunused-const-variable] static const struct of_device_id altera_freeze_br_of_match[] = { Fixes: ca24a648f535 ("fpga: add altera freeze bridge support") Cc: Tom Rix Reported-by: kernel test robot Signed-off-by: Moritz Fischer commit 82fb70b87f210ef4e7e7fb2443ac16aaab40c3e2 Author: Martin Hundebøll Date: Fri Jun 25 09:42:09 2021 +0200 fpga: dfl: pci: add device IDs for Silicom N501x PAC cards This adds the approved PCI Express Device IDs for the Silicom PAC N5010 and N5011 cards (aka. Silicom Lightning Creek cards). The N5010 features an FPGA that manages/interfaces four QSFP ports, and allows on-board custom packet processing/filtering/routing, based on logic loaded with user-provided FPGA bitstreams. The N5011 cards adds a PCIe switch that exposes, in addition to the FPGA itself, two Intel E810 (aka Columbiaville) ethernet controllers. With this, packets can be forwarded from the FPGA to the host for further processing. Signed-off-by: Martin Hundebøll Acked-by: Wu Hao Signed-off-by: Moritz Fischer commit c5381154393d42e2edd77fc74f1493f9f93908cb Author: Vladimir Oltean Date: Fri Jul 23 23:49:11 2021 +0300 net: bridge: fix build when setting skb->offload_fwd_mark with CONFIG_NET_SWITCHDEV=n Switchdev support can be disabled at compile time, and in that case, struct sk_buff will not contain the offload_fwd_mark field. To make the code in br_forward.c work in both cases, we do what is done in other places and we create a helper function, with an empty shim definition, that is implemented by the br_switchdev.o translation module. This is always compiled if and only if CONFIG_NET_SWITCHDEV is y or m. Reported-by: kernel test robot Fixes: 472111920f1c ("net: bridge: switchdev: allow the TX data plane forwarding to be offloaded") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a574e68ff5135d4782260ad38d4b29b8e94e44d6 Author: Alexandru Ardelean Date: Tue Jul 20 10:46:42 2021 +0300 iio: gyro: st_gyro: use devm_iio_triggered_buffer_setup() for buffer The st_gyro_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_gyro_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_gyro_allocate_ring() as well. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210720074642.223293-4-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 899f6791469f658d395199c33997391cdd53fa5e Author: Alexandru Ardelean Date: Tue Jul 20 10:46:41 2021 +0300 iio: magn: st_magn: use devm_iio_triggered_buffer_setup() for buffer The st_magn_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_magn_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_magn_allocate_ring() as well. This change also removes some omitted st_magn_{probe,remove}_trigger() inline hooks. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210720074642.223293-3-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit a442673b40f22be1d7ce7bfb9626461638a638da Author: Alexandru Ardelean Date: Tue Jul 20 10:46:40 2021 +0300 iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer The st_accel_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_accel_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_accel_allocate_ring() as well. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210720074642.223293-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 674db1e9217a8cebe4e348989f9e9ec428ff2859 Author: Alexandru Ardelean Date: Tue Jul 20 10:46:39 2021 +0300 iio: pressure: st_pressure: use devm_iio_triggered_buffer_setup() for buffer The st_press_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_press_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_press_allocate_ring() as well. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210720074642.223293-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 78a6af334662879780718b18d91dc5f2576f5e5d Author: Tang Bin Date: Tue Jul 20 20:59:45 2021 +0800 iio: adc: fsl-imx25-gcq: Use the defined variable to clean code Use the defined variable "dev" to make the code cleaner. Co-developed-by: Zhang Shengju Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210720125945.11548-1-tangbin@cmss.chinamobile.com Signed-off-by: Jonathan Cameron commit 7ff98c8afa46ea0ca207bcc89185ea28e6e83829 Author: Ivan Mikhaylov Date: Thu Jul 22 18:44:20 2021 +0300 iio: proximity: vcnl3020: remove iio_claim/release_direct Remove iio_claim/release and change it on mutex accordingly in vcnl3020_write_proxy_samp_freq. Signed-off-by: Ivan Mikhaylov Link: https://lore.kernel.org/r/20210722154420.915082-4-i.mikhaylov@yadro.com Signed-off-by: Jonathan Cameron commit 3363fbbe19e542e183bcc32780cf1d5d4156a5b2 Author: Ivan Mikhaylov Date: Thu Jul 22 18:44:19 2021 +0300 iio: proximity: vcnl3020: add periodic mode Add the possibility to run proximity sensor in periodic measurement mode with thresholds. Reported-by: kernel test robot #repeated include Signed-off-by: Ivan Mikhaylov Link: https://lore.kernel.org/r/20210722154420.915082-3-i.mikhaylov@yadro.com Signed-off-by: Jonathan Cameron commit f5e9e38e7063dbe2c811bb5ee7d255318eb064b3 Author: Ivan Mikhaylov Date: Thu Jul 22 18:44:18 2021 +0300 iio: proximity: vcnl3020: add DMA safe buffer Add DMA safe buffer for bulk transfers. Signed-off-by: Ivan Mikhaylov Link: https://lore.kernel.org/r/20210722154420.915082-2-i.mikhaylov@yadro.com Signed-off-by: Jonathan Cameron commit 9c6cd755b548767ae1780fa41967ac602604d456 Author: Jonathan Cameron Date: Tue Jun 8 18:51:49 2021 +0100 iio: st-sensors: Remove some unused includes and add some that should be there The st-sensors drivers have changed in structure over time, and includes have not always kept up with this. Let's bring them back to nearer the ideal. Identified with the include-what-you-use tool and careful checking of its suggestions. Note I haven't been particularly aggressive here, so this is just the cases where the include obviously isn't needed rather than the more subtle corners. Note I took the opportunity to add mod_devicetable.h as I generally prefer to see that when acpi or of match tables are present. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Cc: Denis Ciocca Cc: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20210608175149.4019289-1-jic23@kernel.org commit 7e6b78663c2fb96adaff613f2a25c177c7fbd3c4 Author: Stephan Gerhold Date: Mon Jun 14 18:31:50 2021 +0200 dt-bindings: iio: accel: bma255: Merge bosch,bma180 schema In Linux the bma180 and bmc150-accel driver cover fairly similar chips from Bosch (just with minor register differences). For the DT schema, this does not make any difference: They both represent I2C/SPI devices, have one or two interrupts plus a vdd/vddio-supply. This means there is no need to duplicate the schema, we can just document the compatibles for both drivers in a single DT schema. Suggested-by: Jonathan Cameron Signed-off-by: Stephan Gerhold Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210614163150.7774-4-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit 562442d5a93b5b362e304b57accba43e40aad970 Author: Stephan Gerhold Date: Mon Jun 14 18:31:49 2021 +0200 dt-bindings: iio: accel: bma255: Sort compatibles Similar to recent rework in the bmc150-accel driver, sort the compatible list in the DT schema so there is a consistent order. Signed-off-by: Stephan Gerhold Reviewed-by: Linus Walleij Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210614163150.7774-3-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit 39361c997dc781dc590a8e45107b288f3e3f27d7 Author: Stephan Gerhold Date: Mon Jun 14 18:31:48 2021 +0200 dt-bindings: iio: accel: bma255: Fix interrupt type Bosch accelerometers similar to BMA255 are initially configured to emit an active-high interrupt signal. This is currently not re-configured in the bmc150-accel driver so the interrupt should most certainly be IRQ_TYPE_EDGE_RISING (or potentially IRQ_TYPE_LEVEL_HIGH). (Unless there is some kind of inverter installed on the board...) At the moment the bmc150-accel driver forcefully requests the IRQ using IRQF_TRIGGER_RISING, which means that the IRQ type is currently ignored in all existing device trees. Fixes: 6259551cf19b ("iio: accel: bmc150-accel: Add DT bindings") Cc: Linus Walleij Signed-off-by: Stephan Gerhold Reviewed-by: Linus Walleij Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210614163150.7774-2-stephan@gerhold.net Signed-off-by: Jonathan Cameron commit bfac1e2b6e2d6b3fdb3d8f997187d6f1c63ea965 Author: Matt Roper Date: Fri Jul 23 10:42:14 2021 -0700 drm/i915/xehp: Xe_HP forcewake support Implement Xe_HP forcewake handling. While we're at it, let's reorder to the forcewake assignment if/else ladder to match our usual driver conventions. Co-authored-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-6-matthew.d.roper@intel.com commit ddabf72176af198e450257249d946a8b317a1ac5 Author: John Harrison Date: Fri Jul 23 10:42:13 2021 -0700 drm/i915/xehp: Extra media engines - Part 3 (reset) Xe_HP can have a lot of extra media engines. This patch adds the reset support for them. Signed-off-by: John Harrison Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-5-matthew.d.roper@intel.com commit 1b16b6b696728ffb5bd1eb97bd13b6c304ccd980 Author: John Harrison Date: Fri Jul 23 10:42:12 2021 -0700 drm/i915/xehp: Extra media engines - Part 2 (interrupts) Xe_HP can have a lot of extra media engines. This patch adds the interrupt handler support for them. Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Signed-off-by: John Harrison Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20210723174239.1551352-4-matthew.d.roper@intel.com commit 938c778f6a22fa1251fe48f175006404f18fb8f3 Author: John Harrison Date: Fri Jul 23 12:10:24 2021 -0700 drm/i915/xehp: Extra media engines - Part 1 (engine definitions) Xe_HP can have a lot of extra media engines. This patch adds the basic definitions for them. v2: - Re-order intel_gt_info and intel_device_info slightly to avoid unnecessary padding now that we've increased the size of intel_engine_mask_t. (Tvrtko) v3: - Drop the .hw_id assignments. (Lucas) v4: - Fix graphics_ver typo for VCS4 (should be 12, not 11). (Lucas) Cc: Tvrtko Ursulin Cc: Lucas De Marchi Signed-off-by: John Harrison Signed-off-by: Tomas Winkler Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210723191024.1553405-1-matthew.d.roper@intel.com commit acd5aea400494ce960904cca4626dfbbe307dd47 Author: Michael Sun Date: Fri Jul 23 17:17:31 2021 -0700 Bluetooth: btusb: Add valid le states quirk Add the valid le states quirk for WCN6855 and GarfieldPeak controller so the 'central-peripheral' role is exposed in userspace. Signed-off-by: Michael Sun Signed-off-by: Marcel Holtmann commit 3c73553f56cdbf2df5af574b3066e2bd7d16e2f7 Author: Matt Roper Date: Fri Jul 23 10:06:18 2021 -0700 drm/i915: Program chicken bit during DP MST sequence on TGL+ A new step has been added to the DP modeset sequences for all platforms with display version 12 and beyond: if enabling DP MST with FEC, we need to set a chicken bit before enabling the transcoder. The chicken bit should be disabled again before disabling the transcoder (which we can do unconditionally since it shouldn't be set anyway in non-MST cases). Bspec: 49190, 54128, 55424 Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210723170618.1477415-1-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza commit a5b84e4e4f57cceceb206fd8b1c828c81b7e63a6 Author: Maxime Ripard Date: Fri Jul 23 17:34:57 2021 -0700 dt-bindings: input: sun4i-lradc: Add wakeup-source The LRADC can be a wakeup source and is listed as such in some DT already. Let's make sure we allow that property in the binding. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-21-maxime@cerno.tech Signed-off-by: Dmitry Torokhov commit cc3d15a51717b8f5850444aa437bf5535e80d263 Author: Maxime Ripard Date: Fri Jul 23 17:34:36 2021 -0700 dt-bindings: input: Convert Regulator Haptic binding to a schema The Haptic feedback based on a regulator is supported by Linux thanks to its device tree binding. Now that we have the DT validation in place, let's convert the device tree bindings for that driver over to a YAML schema. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-19-maxime@cerno.tech Signed-off-by: Dmitry Torokhov commit 187acd8c148a5f6ffed70776ca7f02efca0342fb Author: Maxime Ripard Date: Fri Jul 23 17:34:20 2021 -0700 dt-bindings: input: Convert Pixcir Touchscreen binding to a schema The Pixcir Touchscreen Controller is supported by Linux thanks to its device tree binding. Now that we have the DT validation in place, let's convert the device tree bindings for that driver over to a YAML schema. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-18-maxime@cerno.tech Signed-off-by: Dmitry Torokhov commit 04647773d6481885447dc263673144053d3ec561 Author: Maxime Ripard Date: Fri Jul 23 17:34:07 2021 -0700 dt-bindings: input: Convert ChipOne ICN8318 binding to a schema The ChipOne ICN8318 Touchscreen Controller is supported by Linux thanks to its device tree binding. Now that we have the DT validation in place, let's convert the device tree bindings for that driver over to a YAML schema. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210721140424.725744-17-maxime@cerno.tech Signed-off-by: Dmitry Torokhov commit 5af9f79b41b2ac58cc1d7c08945d7dbe26ee694a Author: Dmitry Torokhov Date: Fri Jul 23 17:33:24 2021 -0700 Input: pm8941-pwrkey - fix comma vs semicolon issue There is absolutely no reason to use comma operator in this code, 2 separate statements make much more sense. Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/YPsa1qCBn/SAmE5x@google.com Signed-off-by: Dmitry Torokhov commit 93ebb6828723b8aef114415c4dc3518342f7dcad Author: Halil Pasic Date: Sat Jul 24 01:17:46 2021 +0200 s390/pv: fix the forcing of the swiotlb Since commit 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing") if code sets swiotlb_force it needs to do so before the swiotlb is initialised. Otherwise io_tlb_default_mem->force_bounce will not get set to true, and devices that use (the default) swiotlb will not bounce despite switolb_force having the value of SWIOTLB_FORCE. Let us restore swiotlb functionality for PV by fulfilling this new requirement. This change addresses what turned out to be a fragility in commit 64e1f0c531d1 ("s390/mm: force swiotlb for protected virtualization"), which ain't exactly broken in its original context, but could give us some more headache if people backport the broken change and forget this fix. Signed-off-by: Halil Pasic Tested-by: Christian Borntraeger Reviewed-by: Christian Borntraeger Fixes: 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing") Fixes: 64e1f0c531d1 ("s390/mm: force swiotlb for protected virtualization") Cc: stable@vger.kernel.org #5.3+ Signed-off-by: Konrad Rzeszutek Wilk commit 2b7e9f25e590726cca76700ebdb10e92a7a72ca1 Author: Johan Almbladh Date: Wed Jul 21 12:38:22 2021 +0200 bpf/tests: Do not PASS tests without actually testing the result Each test case can have a set of sub-tests, where each sub-test can run the cBPF/eBPF test snippet with its own data_size and expected result. Before, the end of the sub-test array was indicated by both data_size and result being zero. However, most or all of the internal eBPF tests has a data_size of zero already. When such a test also had an expected value of zero, the test was never run but reported as PASS anyway. Now the test runner always runs the first sub-test, regardless of the data_size and result values. The sub-test array zero-termination only applies for any additional sub-tests. There are other ways fix it of course, but this solution at least removes the surprise of eBPF tests with a zero result always succeeding. Signed-off-by: Johan Almbladh Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721103822.3755111-1-johan.almbladh@anyfinetworks.com commit ad6c00283163cb7ad52cdf97d2850547446f7d98 Author: Will Deacon Date: Tue Jul 20 14:38:26 2021 +0100 swiotlb: Free tbl memory in swiotlb_exit() Although swiotlb_exit() frees the 'slots' metadata array referenced by 'io_tlb_default_mem', it leaves the underlying buffer pages allocated despite no longer being usable. Extend swiotlb_exit() to free the buffer pages as well as the slots array. Cc: Claire Chang Cc: Christoph Hellwig Cc: Robin Murphy Cc: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit ae7f47041d928b1a2f28717d095b4153c63cbf6a Author: Johan Almbladh Date: Wed Jul 21 12:40:58 2021 +0200 bpf/tests: Fix copy-and-paste error in double word test This test now operates on DW as stated instead of W, which was already covered by another test. Signed-off-by: Johan Almbladh Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721104058.3755254-1-johan.almbladh@anyfinetworks.com commit 1efd3fc0ccf52e1aa5f0bf5b0d82847180d20951 Author: Will Deacon Date: Tue Jul 20 14:38:25 2021 +0100 swiotlb: Emit diagnostic in swiotlb_exit() A recent debugging session would have been made a little bit easier if we had noticed sooner that swiotlb_exit() was being called during boot. Add a simple diagnostic message to swiotlb_exit() to complement the one from swiotlb_print_info() during initialisation. Cc: Claire Chang Cc: Christoph Hellwig Cc: Robin Murphy Link: https://lore.kernel.org/r/20210705190352.GA19461@willie-the-truck Suggested-by: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 463e862ac63ef27fca423782536f6465abc3f180 Author: Will Deacon Date: Tue Jul 20 14:38:24 2021 +0100 swiotlb: Convert io_default_tlb_mem to static allocation Since commit 69031f500865 ("swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used"), 'struct device' may hold a copy of the global 'io_default_tlb_mem' pointer if the device is using swiotlb for DMA. A subsequent call to swiotlb_exit() will therefore leave dangling pointers behind in these device structures, resulting in KASAN splats such as: | BUG: KASAN: use-after-free in __iommu_dma_unmap_swiotlb+0x64/0xb0 | Read of size 8 at addr ffff8881d7830000 by task swapper/0/0 | | CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc3-debug #1 | Hardware name: HP HP Desktop M01-F1xxx/87D6, BIOS F.12 12/17/2020 | Call Trace: | | dump_stack+0x9c/0xcf | print_address_description.constprop.0+0x18/0x130 | kasan_report.cold+0x7f/0x111 | __iommu_dma_unmap_swiotlb+0x64/0xb0 | nvme_pci_complete_rq+0x73/0x130 | blk_complete_reqs+0x6f/0x80 | __do_softirq+0xfc/0x3be Convert 'io_default_tlb_mem' to a static structure, so that the per-device pointers remain valid after swiotlb_exit() has been invoked. All users are updated to reference the static structure directly, using the 'nslabs' field to determine whether swiotlb has been initialised. The 'slots' array is still allocated dynamically and referenced via a pointer rather than a flexible array member. Cc: Claire Chang Cc: Christoph Hellwig Cc: Robin Murphy Cc: Konrad Rzeszutek Wilk Fixes: 69031f500865 ("swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used") Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 85044eb08d0a37b1b6bcb3504bfd660a85ba5b7b Author: Will Deacon Date: Tue Jul 20 14:38:23 2021 +0100 of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV and breaks the boot for sparc[64] machines. Return 0 instead, since the function is essentially a glorified NOP in this configuration. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Reported-by: Guenter Roeck Suggested-by: Robin Murphy Tested-by: Guenter Roeck Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net Fixes: fec9b625095f ("of: Add plumbing for restricted DMA pool") Signed-off-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 7a18844223d40b684e2f24a02741a1bd53048218 Author: Evgeniy Litvinenko Date: Fri Jul 23 15:36:45 2021 -0700 selftests/bpf: Document vmtest.sh dependencies Add a list of vmtest script dependencies to make it easier for new contributors to get going. Signed-off-by: Evgeniy Litvinenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210723223645.907802-1-evgeniyl@fb.com commit e244d34d0ea1aebf60e83ee6d1701a81448f31c1 Author: Evgeniy Litvinenko Date: Fri Jul 23 15:15:11 2021 -0700 libbpf: Add bpf_map__pin_path function Add bpf_map__pin_path, so that the inconsistently named bpf_map__get_pin_path can be deprecated later. This is part of the effort towards libbpf v1.0: https://github.com/libbpf/libbpf/issues/307 Also, add a selftest for the new function. Signed-off-by: Evgeniy Litvinenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210723221511.803683-1-evgeniyl@fb.com commit d9e8d14b12202504bfa04182d3fae68d137ea39b Merge: da97553ec6e1b eed92afdd14c2 Author: Andrii Nakryiko Date: Fri Jul 23 16:42:27 2021 -0700 Merge branch 'bpf: Allow bpf tcp iter to do bpf_(get|set)sockopt' Martin KaFai says: ==================== This set is to allow bpf tcp iter to call bpf_(get|set)sockopt. With bpf-tcp-cc, new algo rollout happens more often. Instead of restarting the applications to pick up the new tcp-cc, this set allows the bpf tcp iter to call bpf_(get|set)sockopt(TCP_CONGESTION). It is not limited to TCP_CONGESTION, the bpf tcp iter can call bpf_(get|set)sockopt() with other options. The bpf tcp iter can read into all the fields of a tcp_sock, so there is a lot of flexibility to select the desired sk to do setsockopt(), e.g. it can test for TCP_LISTEN only and leave the established connections untouched, or check the addr/port, or check the current tcp-cc name, ...etc. Patch 1-4 are some cleanup and prep work in the tcp and bpf seq_file. Patch 5 is to have the tcp seq_file iterate on the port+addr lhash2 instead of the port only listening_hash. Patch 6 is to have the bpf tcp iter doing batching which then allows lock_sock. lock_sock is needed for setsockopt. Patch 7 allows the bpf tcp iter to call bpf_(get|set)sockopt. v2: - Use __GFP_NOWARN in patch 6 - Add bpf_getsockopt() in patch 7 to give a symmetrical user experience. selftest in patch 8 is changed to also cover bpf_getsockopt(). - Remove CAP_NET_ADMIN check in patch 7. Tracing bpf prog has already required CAP_SYS_ADMIN or CAP_PERFMON. - Move some def macros to bpf_tracing_net.h in patch 8 ==================== Signed-off-by: Andrii Nakryiko commit eed92afdd14c26b1e319fbe9eaa80e62ffa97a2c Author: Martin KaFai Lau Date: Thu Jul 1 13:06:25 2021 -0700 bpf: selftest: Test batching and bpf_(get|set)sockopt in bpf tcp iter This patch adds tests for the batching and bpf_(get|set)sockopt in bpf tcp iter. It first creates: a) 1 non SO_REUSEPORT listener in lhash2. b) 256 passive and active fds connected to the listener in (a). c) 256 SO_REUSEPORT listeners in one of the lhash2 bucket. The test sets all listeners and connections to bpf_cubic before running the bpf iter. The bpf iter then calls setsockopt(TCP_CONGESTION) to switch each listener and connection from bpf_cubic to bpf_dctcp. The bpf iter has a random_retry mode such that it can return EAGAIN to the usespace in the middle of a batch. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200625.1036874-1-kafai@fb.com commit 3cee6fb8e69ecd79be891c89a94974c48a25a437 Author: Martin KaFai Lau Date: Thu Jul 1 13:06:19 2021 -0700 bpf: tcp: Support bpf_(get|set)sockopt in bpf tcp iter This patch allows bpf tcp iter to call bpf_(get|set)sockopt. To allow a specific bpf iter (tcp here) to call a set of helpers, get_func_proto function pointer is added to bpf_iter_reg. The bpf iter is a tracing prog which currently requires CAP_PERFMON or CAP_SYS_ADMIN, so this patch does not impose other capability checks for bpf_(get|set)sockopt. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200619.1036715-1-kafai@fb.com commit 04c7820b776f1c4b48698574c47de9e940d368e8 Author: Martin KaFai Lau Date: Thu Jul 1 13:06:13 2021 -0700 bpf: tcp: Bpf iter batching and lock_sock This patch does batching and lock_sock for the bpf tcp iter. It does not affect the proc fs iteration. With bpf-tcp-cc, new algo rollout happens more often. Instead of restarting the application to pick up the new tcp-cc, the next patch will allow bpf iter to do setsockopt(TCP_CONGESTION). This requires locking the sock. Also, unlike the proc iteration (cat /proc/net/tcp[6]), the bpf iter can inspect all fields of a tcp_sock. It will be useful to have a consistent view on some of the fields (e.g. the ones reported in tcp_get_info() that also acquires the sock lock). Double lock: locking the bucket first and then locking the sock could lead to deadlock. This patch takes a batching approach similar to inet_diag. While holding the bucket lock, it batch a number of sockets into an array first and then unlock the bucket. Before doing show(), it then calls lock_sock_fast(). In a machine with ~400k connections, the maximum number of sk in a bucket of the established hashtable is 7. 0.02% of the established connections fall into this bucket size. For listen hash (port+addr lhash2), the bucket is usually very small also except for the SO_REUSEPORT use case which the userspace could have one SO_REUSEPORT socket per thread. While batching is used, it can also minimize the chance of missing sock in the setsockopt use case if the whole bucket is batched. This patch will start with a batch array with INIT_BATCH_SZ (16) which will be enough for the most common cases. bpf_iter_tcp_batch() will try to realloc to a larger array to handle exception case (e.g. the SO_REUSEPORT case in the lhash2). Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200613.1036157-1-kafai@fb.com commit 05c0b35709c58b83d4dc515d2ac52e9c0f197d03 Author: Martin KaFai Lau Date: Thu Jul 1 13:06:06 2021 -0700 tcp: seq_file: Replace listening_hash with lhash2 This patch moves the tcp seq_file iteration on listeners from the port only listening_hash to the port+addr lhash2. When iterating from the bpf iter, the next patch will need to lock the socket such that the bpf iter can call setsockopt (e.g. to change the TCP_CONGESTION). To avoid locking the bucket and then locking the sock, the bpf iter will first batch some sockets from the same bucket and then unlock the bucket. If the bucket size is small (which usually is), it is easier to batch the whole bucket such that it is less likely to miss a setsockopt on a socket due to changes in the bucket. However, the port only listening_hash could have many listeners hashed to a bucket (e.g. many individual VIP(s):443 and also multiple by the number of SO_REUSEPORT). We have seen bucket size in tens of thousands range. Also, the chance of having changes in some popular port buckets (e.g. 443) is also high. The port+addr lhash2 was introduced to solve this large listener bucket issue. Also, the listening_hash usage has already been replaced with lhash2 in the fast path inet[6]_lookup_listener(). This patch follows the same direction on moving to lhash2 and iterates the lhash2 instead of listening_hash. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200606.1035783-1-kafai@fb.com commit b72acf4501d7c31e96749f0f5052b3bcb25fc2cb Author: Martin KaFai Lau Date: Thu Jul 1 13:06:00 2021 -0700 tcp: seq_file: Add listening_get_first() The current listening_get_next() is overloaded by passing NULL to the 2nd arg, like listening_get_next(seq, NULL), to mean get_first(). This patch moves some logic from the listening_get_next() into a new function listening_get_first(). It will be equivalent to the current established_get_first() and established_get_next() setup. get_first() is to find a non empty bucket and return the first sk. get_next() is to find the next sk of the current bucket and then resorts to get_first() if the current bucket is exhausted. The next patch is to move the listener seq_file iteration from listening_hash (port only) to lhash2 (port+addr). Separating out listening_get_first() from listening_get_next() here will make the following lhash2 changes cleaner and easier to follow. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200600.1035353-1-kafai@fb.com commit 62001372c2b6cdf2346afb2cf94ed3d950eee64c Author: Martin KaFai Lau Date: Thu Jul 1 13:05:54 2021 -0700 bpf: tcp: seq_file: Remove bpf_seq_afinfo from tcp_iter_state A following patch will create a separate struct to store extra bpf_iter state and it will embed the existing tcp_iter_state like this: struct bpf_tcp_iter_state { struct tcp_iter_state state; /* More bpf_iter specific states here ... */ } As a prep work, this patch removes the "struct tcp_seq_afinfo *bpf_seq_afinfo" where its purpose is to tell if it is iterating from bpf_iter instead of proc fs. Currently, if "*bpf_seq_afinfo" is not NULL, it is iterating from bpf_iter. The kernel should not filter by the addr family and leave this filtering decision to the bpf prog. Instead of adding a "*bpf_seq_afinfo" pointer, this patch uses the "seq->op == &bpf_iter_tcp_seq_ops" test to tell if it is iterating from the bpf iter. The bpf_iter_(init|fini)_tcp() is left here to prepare for the change of a following patch. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200554.1034982-1-kafai@fb.com commit ad2d61376a0517f19f49fc23de9e12d2b06484fc Author: Martin KaFai Lau Date: Thu Jul 1 13:05:48 2021 -0700 tcp: seq_file: Refactor net and family matching This patch refactors the net and family matching into two new helpers, seq_sk_match() and seq_file_family(). seq_file_family() is in the later part of the file to prepare the change of a following patch. Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200548.1034629-1-kafai@fb.com commit 525e2f9fd0229eb10cb460a9e6d978257f24804e Author: Martin KaFai Lau Date: Thu Jul 1 13:05:41 2021 -0700 tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos st->bucket stores the current bucket number. st->offset stores the offset within this bucket that is the sk to be seq_show(). Thus, st->offset only makes sense within the same st->bucket. These two variables are an optimization for the common no-lseek case. When resuming the seq_file iteration (i.e. seq_start()), tcp_seek_last_pos() tries to continue from the st->offset at bucket st->bucket. However, it is possible that the bucket pointed by st->bucket has changed and st->offset may end up skipping the whole st->bucket without finding a sk. In this case, tcp_seek_last_pos() currently continues to satisfy the offset condition in the next (and incorrect) bucket. Instead, regardless of the offset value, the first sk of the next bucket should be returned. Thus, "bucket == st->bucket" check is added to tcp_seek_last_pos(). The chance of hitting this is small and the issue is a decade old, so targeting for the next tree. Fixes: a8b690f98baf ("tcp: Fix slowness in read /proc/net/tcp") Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210701200541.1033917-1-kafai@fb.com commit 17c1b16340f08607be8b0d4f1376e32ea6cca437 Author: Nobuhiro Iwamatsu Date: Sat Jul 24 07:14:19 2021 +0900 dt-bindings: pci: Add DT binding for Toshiba Visconti PCIe controller This commit adds the Device Tree binding documentation that allows to describe the PCIe controller found in Toshiba Visconti SoCs. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20210723221421.113575-2-nobuhiro1.iwamatsu@toshiba.co.jp [robh: reference snps,dw-pcie.yaml] Signed-off-by: Rob Herring commit 9b52aa720168859526bf90d77fa210fc0336f170 Author: Rodrigo Vivi Date: Fri Jul 23 05:52:25 2021 -0400 drm/i915/bios: Fix ports mask PORT_A to PORT_F are regular integers defined in the enum port, while for_each_port_masked requires a bit mask for the ports. Current given mask: 0b111 Desired mask: 0b111111 I noticed this while Christoph was reporting a bug found on headless GVT configuration which bisect blamed commit 3ae04c0c7e63 ("drm/i915/bios: limit default outputs to ports A through F") v2: Avoid unnecessary line continuations as pointed by CI and Christoph Cc: Christoph Hellwig Fixes: 3ae04c0c7e63 ("drm/i915/bios: limit default outputs to ports A through F") Cc: Lucas De Marchi Cc: Ville Syrjälä Cc: Jani Nikula Signed-off-by: Rodrigo Vivi Reviewed-by: José Roberto de Souza Reviewed-by: Lucas De Marchi Tested-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210723095225.562913-1-rodrigo.vivi@intel.com commit af0ca06f8781499bd889658b47df75ee2da8ca8f Author: Fabio Estevam Date: Fri Jul 23 17:32:42 2021 -0300 pinctrl: imx8ulp: Initialize pin_reg The initialization of pin_reg is missing, causing the following build warning: drivers/pinctrl/freescale/pinctrl-imx8ulp.c:228:35: warning: 'pin_reg' is used uninitialized in this function [-Wuninitialized] Initialize pin_reg the same way as it is done on vf610 and imx7ulp to fix the problem. Fixes: 16b343e8e0ef ("pinctrl: imx8ulp: Add pinctrl driver support") Reported-by: kernel test robot Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20210723203242.88845-1-festevam@gmail.com Signed-off-by: Linus Walleij commit fbe280ee67c4e29e95a052b57328db055557a028 Author: Rob Herring Date: Mon Jul 19 15:49:02 2021 -0600 dt-bindings: PCI: intel,lgm-pcie: Add reference to common schemas Add a reference to snps,dw-pcie.yaml (and indirectly pci-bus.yaml) schemas. With this, the common bus properties can be dropped from the schema. Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210719220351.2662758-1-robh@kernel.org commit facfbf4f0b5afbf2d9a4147ca57c84dce2c7b8e2 Merge: 94a994d2b2b74 cd74f25b28ce0 Author: David S. Miller Date: Fri Jul 23 21:18:57 2021 +0100 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 2021-07-23 This series contains updates to igb and e100 drivers. Grzegorz adds a timeout check to prevent possible infinite loop for igb. Kees Cook adjusts memcpy() argument to represent the entire structure to allow for appropriate bounds checking for igb and e100. ==================== Signed-off-by: David S. Miller commit 76ba1900cb67390d963e07457ebf679c56c59094 Author: satya priya Date: Fri Jul 23 12:13:03 2021 -0700 dt-bindings: power: reset: qcom-pon: Convert qcom PON binding to yaml Convert qcom PON binding from .txt to .yaml format. Signed-off-by: satya priya Reviewed-by: Rob Herring Reviewed-by: Sebastian Reichel Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1620800053-26405-6-git-send-email-skakit@codeaurora.org Signed-off-by: Dmitry Torokhov commit 400793bc351b83c11ce28210d86039e905c8ff32 Author: satya priya Date: Fri Jul 23 12:12:52 2021 -0700 dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml Convert qcom pm8941 power key binding from .txt to .yaml format. The example has been removed in favour of full example being available in the qcom,pon.yaml binding. Signed-off-by: satya priya Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1620800053-26405-5-git-send-email-skakit@codeaurora.org Signed-off-by: Dmitry Torokhov commit da5e96ffd5a938b11c430d023109a19ba3b6d71d Author: satya priya Date: Fri Jul 23 12:12:37 2021 -0700 dt-bindings: power: reset: Change 'additionalProperties' to true Change 'additionalProperties' to true as this is a generic binding. Signed-off-by: satya priya Acked-by: Rob Herring Reviewed-by: Sebastian Reichel Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1620800053-26405-4-git-send-email-skakit@codeaurora.org Signed-off-by: Dmitry Torokhov commit ee53488cc74143cadbe752d5332b1e3fd87eed49 Merge: e73f0f0ee7541 f4ac73023449e Author: Eric W. Biederman Date: Fri Jul 23 13:26:44 2021 -0500 Final si_trapno bits As a part of a fix for the ABI of the newly added SIGTRAP TRAP_PERF a si_trapno was reduced to an ordinary extention of the _sigfault case of struct siginfo. When Linus saw the complete set of changes come in as a fix he requested that the set of changes be trimmed down to just what was necessary to fix the SIGTRAP TRAP_PERF ABI. I had intended to get the rest of the changes into the merge window for v5.14 but I dropped the ball. I have made the changes to stop using __ARCH_SI_TRAPNO be per architecture so they are easier to review. In doing so I found one place on alpha where I used send_sig_fault instead of send_sig_fault_trapno(... si_trapno = 0). That would not have changed the userspace behavior but it did make the kernel code less clear. My rule in these patches is everywhere that siginfo layout calls for SIL_FAULT_TRAPNO the code uses either force_sig_fault_trapno or send_sig_fault_trapno. And of course I have rebased and compile tested Marco's compile time assert patches. v1: https://lkml.kernel.org/r/m1zgxfs7zq.fsf_-_@fess.ebiederm.org v2: https://lkml.kernel.org/r/m14kfjh8et.fsf_-_@fess.ebiederm.org v3: https://lkml.kernel.org/r/m1tuni8ano.fsf_-_@fess.ebiederm.org v4: https://lkml.kernel.org/r/m1a6ot5e2h.fsf_-_@fess.ebiederm.org Link: https://lkml.kernel.org/r/87a6mnzbx2.fsf_-_@disp2133 Eric W. Biederman (5): signal/sparc: si_trapno is only used with SIGILL ILL_ILLTRP signal/alpha: si_trapno is only used with SIGFPE and SIGTRAP TRAP_UNK signal: Remove the generic __ARCH_SI_TRAPNO support signal: Verify the alignment and size of siginfo_t signal: Rename SIL_PERF_EVENT SIL_FAULT_PERF_EVENT for consistency Marco Elver (3): sparc64: Add compile-time asserts for siginfo_t offsets arm: Add compile-time asserts for siginfo_t offsets arm64: Add compile-time asserts for siginfo_t offsets arch/alpha/include/uapi/asm/siginfo.h | 2 -- arch/alpha/kernel/osf_sys.c | 2 +- arch/alpha/kernel/signal.c | 4 +-- arch/alpha/kernel/traps.c | 26 +++++++-------- arch/alpha/mm/fault.c | 4 +-- arch/arm/kernel/signal.c | 39 ++++++++++++++++++++++ arch/arm64/kernel/signal.c | 39 ++++++++++++++++++++++ arch/arm64/kernel/signal32.c | 39 ++++++++++++++++++++++ arch/mips/include/uapi/asm/siginfo.h | 2 -- arch/sparc/include/uapi/asm/siginfo.h | 3 -- arch/sparc/kernel/process_64.c | 2 +- arch/sparc/kernel/signal32.c | 37 +++++++++++++++++++++ arch/sparc/kernel/signal_64.c | 36 ++++++++++++++++++++ arch/sparc/kernel/sys_sparc_32.c | 2 +- arch/sparc/kernel/sys_sparc_64.c | 2 +- arch/sparc/kernel/traps_32.c | 22 ++++++------- arch/sparc/kernel/traps_64.c | 44 +++++++++++-------------- arch/sparc/kernel/unaligned_32.c | 2 +- arch/sparc/mm/fault_32.c | 2 +- arch/sparc/mm/fault_64.c | 2 +- arch/x86/kernel/signal_compat.c | 6 ++++ fs/signalfd.c | 4 +-- include/linux/sched/signal.h | 11 ++----- include/linux/signal.h | 2 +- include/uapi/asm-generic/siginfo.h | 5 +++ kernel/signal.c | 62 +++++++++++++++++++++++++---------- 26 files changed, 305 insertions(+), 96 deletions(-) commit 9200454ca0478cdf52232e2b007189e3e307a07d Author: Thomas Zimmermann Date: Fri Jul 16 16:08:01 2021 +0200 drm/st7586: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Acked-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-8-tzimmermann@suse.de commit baf6c24bacdde421823cf14420c84d610c1eda51 Author: Thomas Zimmermann Date: Fri Jul 16 16:08:00 2021 +0200 drm/repaper: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-7-tzimmermann@suse.de commit 329e2c42f8ea565c507f67fa97cb1839a2eb34cd Author: Thomas Zimmermann Date: Fri Jul 16 16:07:59 2021 +0200 drm/gm12u320: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-6-tzimmermann@suse.de commit 08b7ef0524f52cfd7f247270e0f95480709f210a Author: Thomas Zimmermann Date: Fri Jul 16 16:07:58 2021 +0200 drm/gud: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-5-tzimmermann@suse.de commit 08971eea06db3377ea1f9ff4f95a5df5f6c9aeb7 Author: Thomas Zimmermann Date: Fri Jul 16 16:07:57 2021 +0200 drm/mipi-dbi: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. There's one left-over reference to the imported attachment that we keep. GEM BOs with imported attachment are considered uncached and enables special handling within the drm_fb_swab(). Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-4-tzimmermann@suse.de commit ce724470a2e5f1261a1ae49a39f64d1cc676c3e8 Author: Thomas Zimmermann Date: Fri Jul 16 16:07:56 2021 +0200 drm/udl: Use framebuffer dma-buf helpers Replace dma_buf_begin_cpu_access() with drm_gem_fb_begin_cpu_access(); same for _end_cpu_access(). Remove some boiler-plate code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-3-tzimmermann@suse.de commit 37408cd825a47b89c2302b88ad3c071f796a2ec0 Author: Thomas Zimmermann Date: Fri Jul 16 16:07:55 2021 +0200 drm/gem: Provide drm_gem_fb_{begin,end}_cpu_access() helpers Implement helpers drm_gem_fb_begin_cpu_access() and _end_cpu_access(), which call the rsp dma-buf functions for all GEM BOs of the given framebuffer. Calls to dma_buf_end_cpu_access() can return an error code on failure, while drm_gem_fb_end_cpu_access() does not. The latter runs during DRM's atomic commit or during cleanup. Both cases don't allow for errors, so leave out the return value. v2: * fix typo in docs (Daniel) Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20210716140801.1215-2-tzimmermann@suse.de commit f4ac73023449e6f2f74f69e38f4840c83edfa840 Author: Eric W. Biederman Date: Fri Apr 30 17:58:56 2021 -0500 signal: Rename SIL_PERF_EVENT SIL_FAULT_PERF_EVENT for consistency It helps to know which part of the siginfo structure the siginfo_layout value is talking about. v1: https://lkml.kernel.org/r/m18s4zs7nu.fsf_-_@fess.ebiederm.org v2: https://lkml.kernel.org/r/20210505141101.11519-9-ebiederm@xmission.com Link: https://lkml.kernel.org/r/87zgumw8cc.fsf_-_@disp2133 Acked-by: Marco Elver Signed-off-by: Eric W. Biederman commit 50ae81305c7a3ee802f0a1988503ce913c79cd6e Author: Eric W. Biederman Date: Tue May 4 11:25:22 2021 -0500 signal: Verify the alignment and size of siginfo_t Update the static assertions about siginfo_t to also describe it's alignment and size. While investigating if it was possible to add a 64bit field into siginfo_t[1] it became apparent that the alignment of siginfo_t is as much a part of the ABI as the size of the structure. If the alignment changes siginfo_t when embedded in another structure can move to a different offset. Which is not acceptable from an ABI structure. So document that fact and add static assertions to notify developers if they change change the alignment by accident. [1] https://lkml.kernel.org/r/YJEZdhe6JGFNYlum@elver.google.com Acked-by: Marco Elver v1: https://lkml.kernel.org/r/20210505141101.11519-4-ebiederm@xmission.co Link: https://lkml.kernel.org/r/875yxaxmyl.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit c7fff9288dce1ee5fa9de8d656e09cc8e0e3281b Author: Eric W. Biederman Date: Fri Apr 30 17:53:38 2021 -0500 signal: Remove the generic __ARCH_SI_TRAPNO support Now that __ARCH_SI_TRAPNO is no longer set by any architecture remove all of the code it enabled from the kernel. On alpha and sparc a more explict approach of using send_sig_fault_trapno or force_sig_fault_trapno in the very limited circumstances where si_trapno was set to a non-zero value. The generic support that is being removed always set si_trapno on all fault signals. With only SIGILL ILL_ILLTRAP on sparc and SIGFPE and SIGTRAP TRAP_UNK on alpla providing si_trapno values asking all senders of fault signals to provide an si_trapno value does not make sense. Making si_trapno an ordinary extension of the fault siginfo layout has enabled the architecture generic implementation of SIGTRAP TRAP_PERF, and enables other faulting signals to grow architecture generic senders as well. v1: https://lkml.kernel.org/r/m18s4zs7nu.fsf_-_@fess.ebiederm.org v2: https://lkml.kernel.org/r/20210505141101.11519-8-ebiederm@xmission.com Link: https://lkml.kernel.org/r/87bl73xx6x.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit 7de5f68d497cbc700c4a28cc037dd61f00e452e8 Author: Eric W. Biederman Date: Fri May 28 14:15:51 2021 -0500 signal/alpha: si_trapno is only used with SIGFPE and SIGTRAP TRAP_UNK While reviewing the signal handlers on alpha it became clear that si_trapno is only set to a non-zero value when sending SIGFPE and when sending SITGRAP with si_code TRAP_UNK. Add send_sig_fault_trapno and send SIGTRAP TRAP_UNK, and SIGFPE with it. Remove the define of __ARCH_SI_TRAPNO and remove the always zero si_trapno parameter from send_sig_fault and force_sig_fault. v1: https://lkml.kernel.org/r/m1eeers7q7.fsf_-_@fess.ebiederm.org v2: https://lkml.kernel.org/r/20210505141101.11519-7-ebiederm@xmission.com Link: https://lkml.kernel.org/r/87h7gvxx7l.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit 2c9f7eaf08659fa23d25b93a446f74306b3abea8 Author: Eric W. Biederman Date: Fri May 28 13:38:19 2021 -0500 signal/sparc: si_trapno is only used with SIGILL ILL_ILLTRP While reviewing the signal handlers on sparc it became clear that si_trapno is only set to a non-zero value when sending SIGILL with si_code ILL_ILLTRP. Add force_sig_fault_trapno and send SIGILL ILL_ILLTRP with it. Remove the define of __ARCH_SI_TRAPNO and remove the always zero si_trapno parameter from send_sig_fault and force_sig_fault. v1: https://lkml.kernel.org/r/m1eeers7q7.fsf_-_@fess.ebiederm.org v2: https://lkml.kernel.org/r/20210505141101.11519-7-ebiederm@xmission.com Link: https://lkml.kernel.org/r/87mtqnxx89.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" commit a791cde6d2720944a50122b2039aac26b4c196c2 Author: Thomas Zimmermann Date: Wed Jul 21 15:17:04 2021 +0200 drm/hisilicon/hibmc: Remove variable 'priv' from hibmc_unload() The variable 'priv' got introduced in commit 39a364a19e03 ("drm/hisilicon/hibmc: Convert to Linux IRQ interfaces") by accident. It's unused; remove it. Fixes a compiler warning. Signed-off-by: Thomas Zimmermann Fixes: 39a364a19e03 ("drm/hisilicon/hibmc: Convert to Linux IRQ interfaces") Reviewed-by: Tian Tao Reviewed-by: Daniel Vetter Reported-by: Dave Airlie Cc: Thomas Zimmermann Cc: Tian Tao Cc: Maxime Ripard Cc: Daniel Vetter Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210721131704.10306-1-tzimmermann@suse.de commit e37be5343ae2b9419aea1442b07e5d2428b437b4 Merge: a32ad90426a9c ca3c9bdb101d9 Author: Mimi Zohar Date: Fri Jul 23 09:39:52 2021 -0400 Merge branch 'ima-buffer-measurement-changes-v4' into next-integrity Based on cover letter "ima: Provide more info about buffer measurement": Providing more information about buffer measurements requires modification of the existing functions ima_measure_critical_data() and process_buffer_measurement(). Unlike for file measurements, there is no integrity_iint_cache structure for storing and retrieving buffer measurements. With these changes, kernel subsystems relying on IMA to measure critical data don't have to duplicate the function to calculate the buffer digest but, instead, can get directly the one that IMA would insert, depending on the policy, in the new measurement list entry. commit ce7e1f86b703725808939988bd15e374be6317ba Author: José Roberto de Souza Date: Tue Jul 13 20:15:38 2021 -0700 drm/i915/dg2: Add DG2 to the PSR2 defeature list PSR2 is not supported on DG2. Cc: Caz Yokoyama Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210714031540.3539704-49-matthew.d.roper@intel.com commit fdc0b946a9cab3af21575fb0b16644d35e3473bf Author: Matt Roper Date: Tue Jul 13 20:15:35 2021 -0700 drm/i915/dg2: Classify DG2 PHY types Although the bspec labels four of DG2's outputs as "combo PHY," the underlying PHYs in both cases are actually Synopsys PHYs that are programmed completely differently than the traditional Intel "combo" PHY units. As such, we don't want intel_phy_is_combo to take us down legacy programming paths, so just return false from it on DG2. Instead add a new intel_phy_is_snps() that will return true for all DG2 PHYs. Cc: Anusha Srivatsa Cc: Matt Atwood Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210714031540.3539704-46-matthew.d.roper@intel.com commit d8905ba705ab526a0979541e39e971173c31de1b Author: Matt Roper Date: Tue Jul 13 20:15:00 2021 -0700 drm/i915/xehp: Define multicast register ranges Since we can't steer multicast register reads during ring-based workaround verification, we need to define the multicast ranges where failure to steer could potentially cause us to read back from a fused-off register instance. As with gen12, we can ignore the multicast ranges that the bspec describes as 'SQIDI' since all instances of those registers will always be present and we'll always be able to read back a workaround value that was written with multicast. Bspec: 66534 Cc: José Roberto de Souza Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210714031540.3539704-11-matthew.d.roper@intel.com commit 0b03d93fde21d030faf9c4b6c888ad80cfcd0d4b Author: José Roberto de Souza Date: Thu Jul 22 12:20:41 2021 -0700 drm/i915: Extend Wa_1406941453 to adl-p Workaround also needed for alderlake-P. HSDES: 14010801662 Cc: Matt Roper Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210722192041.92346-1-jose.souza@intel.com commit 726e337b645478ecf41eb261fdde3e8a9476a008 Author: Marco Elver Date: Thu Apr 29 21:07:34 2021 +0200 arm64: Add compile-time asserts for siginfo_t offsets To help catch ABI breaks at compile-time, add compile-time assertions to verify the siginfo_t layout. Link: https://lkml.kernel.org/r/20210505141101.11519-3-ebiederm@xmission.com Link: https://lkml.kernel.org/r/20210429190734.624918-3-elver@google.com Link: https://lkml.kernel.org/r/87sg0fxx92.fsf_-_@disp2133 Signed-off-by: Marco Elver Signed-off-by: Eric W. Biederman commit 56516a42f2f1af01f053eecc4bf3f468d146f2c4 Author: Marco Elver Date: Thu Apr 29 21:07:33 2021 +0200 arm: Add compile-time asserts for siginfo_t offsets To help catch ABI breaks at compile-time, add compile-time assertions to verify the siginfo_t layout. This could have caught that we cannot portably add 64-bit integers to siginfo_t on 32-bit architectures like Arm before reaching -next: https://lkml.kernel.org/r/20210422191823.79012-1-elver@google.com Link: https://lkml.kernel.org/r/20210429190734.624918-2-elver@google.com Link: https://lkml.kernel.org/r/20210505141101.11519-2-ebiederm@xmission.com Link: https://lkml.kernel.org/r/87y2a7xx9q.fsf_-_@disp2133 Signed-off-by: Marco Elver Signed-off-by: Eric W. Biederman commit 94a994d2b2b74420c6fff5100220c2b636317242 Author: chongjiapeng Date: Fri Jul 23 18:38:27 2021 +0800 net: phy: Remove unused including Eliminate the follow versioncheck warning: ./drivers/net/phy/mxl-gpy.c: 9 linux/version.h not needed. Reported-by: Abaci Robot Signed-off-by: chongjiapeng Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit c65e7025c60310e927c944a3907a415fe06f3999 Author: Krzysztof Kozlowski Date: Fri Jul 23 11:20:34 2021 +0200 nfc: port100: constify protocol list array File-scope "port100_protocol" array is read-only and passed as pointer to const, so it can be made a const to increase code safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 42365abdde2a22992e320ea5ae8f023d07352db3 Author: Marco Elver Date: Thu Apr 29 21:07:32 2021 +0200 sparc64: Add compile-time asserts for siginfo_t offsets To help catch ABI breaks at compile-time, add compile-time assertions to verify the siginfo_t layout. Unlike other architectures, sparc64 is special, because it is one of few architectures requiring si_trapno. ABI breaks around that field would only be caught here. Link: https://lkml.kernel.org/r/m11rat9f85.fsf@fess.ebiederm.org Link: https://lkml.kernel.org/r/20210429190734.624918-1-elver@google.com Link: https://lkml.kernel.org/r/20210505141101.11519-1-ebiederm@xmission.com Link: https://lkml.kernel.org/r/874kcvzbuu.fsf_-_@disp2133 Suggested-by: Eric W. Biederman Acked-by: David S. Miller Signed-off-by: Marco Elver Signed-off-by: Eric W. Biederman commit 79e2311c876c276566e3fb84ba33682eb540874b Author: Bhupesh Sharma Date: Tue Jun 29 18:04:07 2021 +0530 pinctrl: qcom/pinctrl-spmi-gpio: Add compatible for pmic-gpio on SA8155p-adp SA8155p-adp PMIC (PMM8155AU) exposes 10 GPIOs. Add support for the same in the pinctrl driver. Cc: Linus Walleij Cc: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210629123407.82561-5-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit 4afc2a0c62a372a923cfb06182af387425489b7c Author: Bhupesh Sharma Date: Tue Jun 29 18:04:06 2021 +0530 pinctrl: qcom/pinctrl-spmi-gpio: Arrange compatibles alphabetically Arrange the compatibles inside qcom pinctrl-spmi gpio driver alphabetically. Cc: Linus Walleij Cc: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210629123407.82561-4-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit 0ac2c2aebf824809e37fe480b7bcf659f3f295d2 Author: Bhupesh Sharma Date: Tue Jun 29 18:04:05 2021 +0530 dt-bindings: pinctrl: qcom,pmic-gpio: Add compatible for SA8155p-adp Add pmic-gpio compatible string for pmm8155au pmic found on the SA8155p-adp board. Cc: Linus Walleij Cc: Bjorn Andersson Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210629123407.82561-3-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit ffdf4cecac07fd16459a82f605aeee8098e3161c Author: Bhupesh Sharma Date: Tue Jun 29 18:04:04 2021 +0530 dt-bindings: pinctrl: qcom,pmic-gpio: Arrange compatibles alphabetically Arrange the compatibles inside qcom-pmic gpio device tree bindings alphabetically. While at it, also make some minor cosmetic changes to allow future compatible addition to the bindings simpler. Cc: Linus Walleij Cc: Bjorn Andersson Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210629123407.82561-2-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit 6a6b83ca471c50a05d1b07bd9594469986106bed Author: Kangmin Park Date: Fri Jul 23 03:50:28 2021 +0900 mpls: defer ttl decrement in mpls_forward() Defer ttl decrement to optimize in tx_err case. There is no need to decrease ttl in the case of goto tx_err. Signed-off-by: Kangmin Park Signed-off-by: David S. Miller commit 8cc236db1a91d0c91651595ba75942a583008455 Author: Loic Poulain Date: Thu Jul 22 20:21:05 2021 +0200 wwan: core: Fix missing RTM_NEWLINK event for default link A wwan link created via the wwan_create_default_link procedure is never notified to the user (RTM_NEWLINK), causing issues with user tools relying on such event to track network links (NetworkManager). This is because the procedure misses a call to rtnl_configure_link(), which sets the link as initialized and notifies the new link (cf proper usage in __rtnl_newlink()). Cc: stable@vger.kernel.org Fixes: ca374290aaad ("wwan: core: support default netdev creation") Suggested-by: Sergey Ryazanov Signed-off-by: Loic Poulain Acked-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 3bdba2c70a352d936e18cbf2d2a3c8df31fccf47 Author: Jerin Jacob Date: Thu Jul 22 19:15:40 2021 +0530 octeontx2-af: Enhance mailbox trace entry Added mailbox id to name translation on trace entry for better tracing output. Before the change: otx2_msg_process: [0002:01:00.0] msg:(0x03) error:0 After the change: otx2_msg_process: [0002:01:00.0] msg:(DETACH_RESOURCES) error:0 Signed-off-by: Jerin Jacob Signed-off-by: David S. Miller commit 1ac1f6459d1e4bddd541949019b871ccfb3f4e6e Author: kernel test robot Date: Sat Jun 26 13:15:50 2021 +0800 pinctrl: mediatek: fix platform_no_drv_owner.cocci warnings drivers/pinctrl/mediatek/pinctrl-mt8365.c:488:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: e94d8b6fb83a ("pinctrl: mediatek: add support for mt8365 SoC") CC: Fabien Parent Reported-by: kernel test robot Signed-off-by: kernel test robot Link: https://lore.kernel.org/r/20210626051550.GA37544@d0c207d51ce8 Signed-off-by: Linus Walleij commit cd74f25b28ce092afb09da734a02912b8bf1ccb1 Author: Kees Cook Date: Wed Jun 16 12:53:44 2021 -0700 e100: Avoid memcpy() over-reading of ETH_SS_STATS In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring array fields. The memcpy() is copying the entire structure, not just the first array. Adjust the source argument so the compiler can do appropriate bounds checking. Signed-off-by: Kees Cook Signed-off-by: Tony Nguyen commit c9183f45e4ac1ff0f1140186cf8a6666c5f1277f Author: Kees Cook Date: Wed Jun 16 12:53:19 2021 -0700 igb: Avoid memcpy() over-reading of ETH_SS_STATS In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring array fields. The memcpy() is copying the entire structure, not just the first array. Adjust the source argument so the compiler can do appropriate bounds checking. Signed-off-by: Kees Cook Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 07be39e32d0aedef3a0155874b92dd7227aa94d7 Author: Grzegorz Siwik Date: Fri Apr 30 14:41:30 2021 +0200 igb: Add counter to i21x doublecheck Add failed_counter to i21x_doublecheck(). There is possibility that loop will never end. With this patch the loop will stop after maximum 3 retries to write to MTA_REGISTER Signed-off-by: Grzegorz Siwik Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 16b343e8e0ef7de5ce451427fafc9e2ea42f548f Author: Anson Huang Date: Mon Jun 7 14:10:41 2021 +0800 pinctrl: imx8ulp: Add pinctrl driver support Add i.MX8ULP pinctrl driver support. Signed-off-by: Anson Huang Signed-off-by: Jacky Bai Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20210607061041.2654568-2-ping.bai@nxp.com Signed-off-by: Linus Walleij commit 41af189bb38b2692ab5398222f54568719729198 Author: Jacky Bai Date: Mon Jun 7 14:10:40 2021 +0800 dt-bindings: pinctrl: imx8ulp: Add pinctrl binding Add pinctrl binding doc for i.MX8ULP Signed-off-by: Jacky Bai Reviewed-by: Rob Herring Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20210607061041.2654568-1-ping.bai@nxp.com Signed-off-by: Linus Walleij commit baf8d6899b1e8906dc076ef26cc633e96a8bb0c3 Author: Marek Behún Date: Mon Jul 19 13:29:38 2021 +0200 pinctrl: armada-37xx: Correct PWM pins definitions The PWM pins on North Bridge on Armada 37xx can be configured into PWM or GPIO functions. When in PWM function, each pin can also be configured to drive low on 0 and tri-state on 1 (LED mode). The current definitions handle this by declaring two pin groups for each pin: - group "pwmN" with functions "pwm" and "gpio" - group "ledN_od" ("od" for open drain) with functions "led" and "gpio" This is semantically incorrect. The correct definition for each pin should be one group with three functions: "pwm", "led" and "gpio". Change the "pwmN" groups to support "led" function. Remove "ledN_od" groups. This cannot break backwards compatibility with older device trees: no device tree uses it since there is no PWM driver for this SOC yet. Also "ledN_od" groups are not even documented. Fixes: b835d6953009 ("pinctrl: armada-37xx: swap polarity on LED group") Signed-off-by: Marek Behún Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210719112938.27594-1-kabel@kernel.org Signed-off-by: Linus Walleij commit 29d45a642d4ea8de7e89b57f856046df7c3b219f Author: Jason Wang Date: Thu Jun 24 14:49:13 2021 +0800 pinctrl: bcm2835: Replace BUG with BUG_ON The if condition followed by BUG can be replaced to BUG_ON which is more compact and formal in linux source. Signed-off-by: Jason Wang Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20210624064913.41788-1-wangborong@cdjrlc.com Signed-off-by: Linus Walleij commit 41353ae7a17ba63118ef364896309df3e3824390 Author: Konrad Dybcio Date: Thu Jun 24 21:17:41 2021 +0200 pinctrl: qcom: Add MDM9607 pinctrl driver Add a pinctrl driver to allow for managing SoC pins. Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210624191743.617073-2-konrad.dybcio@somainline.org Signed-off-by: Linus Walleij commit 832e6e3e9d498dea53f03e1e472779dcf4121689 Author: Konrad Dybcio Date: Thu Jun 24 21:17:40 2021 +0200 dt-bindings: pinctrl: qcom: Add bindings for MDM9607 Document the newly added MDM9607 pinctrl driver. Signed-off-by: Konrad Dybcio Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210624191743.617073-1-konrad.dybcio@somainline.org Signed-off-by: Linus Walleij commit 356ae88f8322066a2cd1aee831b7fb768ff2905c Merge: 5af84df962dd6 d82f8ab0d874b Author: David S. Miller Date: Fri Jul 23 16:32:50 2021 +0100 Merge branch 'bridge-tx-fwd' Vladimir Oltean says: ==================== Allow TX forwarding for the software bridge data path to be offloaded to capable devices On RX, switchdev drivers have the ability to mark packets for the software bridge as "already forwarded in hardware" via skb->offload_fwd_mark. This instructs the nbp_switchdev_allowed_egress() function to perform software forwarding of that packet only to the bridge ports that are not in the same hardware domain as the source packet. This series expands the concept for TX, in the sense that we can trust the accelerator to: (a) look up its FDB (which is more or less in sync with the software bridge FDB) for selecting the destination ports for a packet (b) replicate the frame in hardware in case it's a multicast/broadcast, instead of the software bridge having to clone it and send the clones to each net device one at a time. This reduces the bandwidth needed between the CPU and the accelerator, as well as the CPU time spent. This is done by augmenting nbp_switchdev_allowed_egress() to also exclude the bridge ports which have the tx_fwd_offload capability if the skb has already been transmitted to one port from their hardware domain. Even though in reality, the software bridge still technically looks up the FDB/MDB for every frame, but all skb clones are suppressed, this offload specifically requires that the switchdev accelerator looks up its FDB/MDB again. It is intended to be used to inject "data plane packets" into the hardware as opposed to "control plane packets" which target a precise destination port. Towards that goal, the bridge always provides the TX packets with skb->offload_fwd_mark = true with the VLAN tag always present, so that the accelerator can forward according to that VLAN broadcast domain. This work is not intended to cater to switches which can inject control plane packets to a bit mask of destination ports. I see that as a more difficult task to accomplish with potentially less benefits (it provides only replication offload). The reason it is more difficult is that struct skb_buff would probably need to be extended to contain a list of struct net_devices that the packet must be replicated to. Sending data plane packets avoids that issue by keeping the hardware and software FDB more or less in sync and looking it up twice. Additionally, the ability for the software bridge to request data plane packets to be sent brings the opportunity for "dumb switches" to support traffic termination to/from the bridge. Such switches (DSA or otherwise) typically only use control packets for link-local traps, and sending or receiving a control packet is an expensive operation. For this class of switches, this patch series makes the difference between supporting and not supporting local IP termination through a VLAN-aware bridge, bridging with a foreign interface, bridging with software upper interfaces like LAG, etc. So instead of telling them "oh, what a dumb switch you are!", we can now tell them "oh, what a stark contrast you have between the control and data plane!". Patches 1-3 tested on Turris MOX (3 mv88e6xxx switches in a daisy chain topology) and a second DSA driver to be added soon. Patches 4-5 tested only on Turris MOX. =========================================================== Changes in v5: - make sure the static key is decremented on bridge port unoffload - rename functions and variables so that the "tx_fwd_offload" string is easy to grep across the git tree - simplify DSA core bookkeeping of the bridge_num =========================================================== Changes in v4: The biggest change compared to the previous series is not present in the patches, but is rather a lack of them. Previously we were replaying switchdev objects on the public notifier chain, but that was a mistake in my reasoning and it was reverted for v4. Therefore, we are now passing the notifier blocks as arguments to switchdev_bridge_port_offload() for all drivers. This alone gets rid of 7 patches compared to v3. Other changes are: - Take more care for the case where mlxsw leaves a VLAN or LAG upper that is a bridge port, make sure that switchdev_bridge_port_unoffload() gets called for that case - A couple of DSA bug fixes - Add change logs for all patches - Copy all switchdev driver maintainers on the changes relevant to them =========================================================== Message for v3: https://patchwork.kernel.org/project/netdevbpf/cover/20210712152142.800651-1-vladimir.oltean@nxp.com/ In this submission I have introduced a "native switchdev" driver API to signal whether the TX forwarding offload is supported or not. This comes after a third person has said that the macvlan offload framework used for v2 and v1 was simply too convoluted. This large patch set is submitted for discussion purposes (it is provided in its entirety so it can be applied & tested on net-next). It is only minimally tested, and yet I will not copy all switchdev driver maintainers until we agree on the viability of this approach. The major changes compared to v2: - The introduction of switchdev_bridge_port_offload() and switchdev_bridge_port_unoffload() as two major API changes from the perspective of a switchdev driver. All drivers were converted to call these. - Augment switchdev_bridge_port_{,un}offload to also handle the switchdev object replays on port join/leave. - Augment switchdev_bridge_port_offload to also signal whether the TX forwarding offload is supported. =========================================================== Message for v2: https://patchwork.kernel.org/project/netdevbpf/cover/20210703115705.1034112-1-vladimir.oltean@nxp.com/ For this series I have taken Tobias' work from here: https://patchwork.kernel.org/project/netdevbpf/cover/20210426170411.1789186-1-tobias@waldekranz.com/ and made the following changes: - I collected and integrated (hopefully all of) Nikolay's, Ido's and my feedback on the bridge driver changes. Otherwise, the structure of the bridge changes is pretty much the same as Tobias left it. - I basically rewrote the DSA infrastructure for the data plane forwarding offload, based on the commonalities with another switch driver for which I implemented this feature (not submitted here) - I adapted mv88e6xxx to use the new infrastructure, hopefully it still works but I didn't test that ==================== Signed-off-by: David S. Miller commit d82f8ab0d874b1f2ca45cb9b3b65aaa2638760f6 Author: Tobias Waldekranz Date: Thu Jul 22 18:55:42 2021 +0300 net: dsa: tag_dsa: offload the bridge forwarding process Allow the DSA tagger to generate FORWARD frames for offloaded skbs sent from a bridge that we offload, allowing the switch to handle any frame replication that may be required. This also means that source address learning takes place on packets sent from the CPU, meaning that return traffic no longer needs to be flooded as unknown unicast. Signed-off-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit ce5df6894a5752676a015dfe342f25753971c02f Author: Vladimir Oltean Date: Thu Jul 22 18:55:41 2021 +0300 net: dsa: mv88e6xxx: map virtual bridges with forwarding offload in the PVT The mv88e6xxx switches have the ability to receive FORWARD (data plane) frames from the CPU port and route them according to the FDB. We can use this to offload the forwarding process of packets sent by the software bridge. Because DSA supports bridge domain isolation between user ports, just sending FORWARD frames is not enough, as they might leak the intended broadcast domain of the bridge on behalf of which the packets are sent. It should be noted that FORWARD frames are also (and typically) used to forward data plane packets on DSA links in cross-chip topologies. The FORWARD frame header contains the source port and switch ID, and switches receiving this frame header forward the packet according to their cross-chip port-based VLAN table (PVT). To address the bridging domain isolation in the context of offloading the forwarding on TX, the idea is that we can reuse the parts of the PVT that don't have any physical switch mapped to them, one entry for each software bridge. The switches will therefore think that behind their upstream port lie many switches, all in fact backed up by software bridges through tag_dsa.c, which constructs FORWARD packets with the right switch ID corresponding to each bridge. The mapping we use is absolutely trivial: DSA gives us a unique bridge number, and we add the number of the physical switches in the DSA switch tree to that, to obtain a unique virtual bridge device number to use in the PVT. Co-developed-by: Tobias Waldekranz Signed-off-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 123abc06e74f49d9b173a93cb2b797fb85f50ba3 Author: Vladimir Oltean Date: Thu Jul 22 18:55:40 2021 +0300 net: dsa: add support for bridge TX forwarding offload For a DSA switch, to offload the forwarding process of a bridge device means to send the packets coming from the software bridge as data plane packets. This is contrary to everything that DSA has done so far, because the current taggers only know to send control packets (ones that target a specific destination port), whereas data plane packets are supposed to be forwarded according to the FDB lookup, much like packets ingressing on any regular ingress port. If the FDB lookup process returns multiple destination ports (flooding, multicast), then replication is also handled by the switch hardware - the bridge only sends a single packet and avoids the skb_clone(). DSA keeps for each bridge port a zero-based index (the number of the bridge). Multiple ports performing TX forwarding offload to the same bridge have the same dp->bridge_num value, and ports not offloading the TX data plane of a bridge have dp->bridge_num = -1. The tagger can check if the packet that is being transmitted on has skb->offload_fwd_mark = true or not. If it does, it can be sure that the packet belongs to the data plane of a bridge, further information about which can be obtained based on dp->bridge_dev and dp->bridge_num. It can then compose a DSA tag for injecting a data plane packet into that bridge number. For the switch driver side, we offer two new dsa_switch_ops methods, called .port_bridge_fwd_offload_{add,del}, which are modeled after .port_bridge_{join,leave}. These methods are provided in case the driver needs to configure the hardware to treat packets coming from that bridge software interface as data plane packets. The switchdev <-> bridge interaction happens during the netdev_master_upper_dev_link() call, so to switch drivers, the effect is that the .port_bridge_fwd_offload_add() method is called immediately after .port_bridge_join(). If the bridge number exceeds the number of bridges for which the switch driver can offload the TX data plane (and this includes the case where the driver can offload none), DSA falls back to simply returning tx_fwd_offload = false in the switchdev_bridge_port_offload() call. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5b22d3669f2fa6e762c5302fc4b6051a92b81617 Author: Vladimir Oltean Date: Thu Jul 22 18:55:39 2021 +0300 net: dsa: track the number of switches in a tree In preparation of supporting data plane forwarding on behalf of a software bridge, some drivers might need to view bridges as virtual switches behind the CPU port in a cross-chip topology. Give them some help and let them know how many physical switches there are in the tree, so that they can count the virtual switches starting from that number on. Note that the first dsa_switch_ops method where this information is reliably available is .setup(). This is because of how DSA works: in a tree with 3 switches, each calling dsa_register_switch(), the first 2 will advance until dsa_tree_setup() -> dsa_tree_setup_routing_table() and exit with error code 0 because the topology is not complete. Since probing is parallel at this point, one switch does not know about the existence of the other. Then the third switch comes, and for it, dsa_tree_setup_routing_table() returns complete = true. This switch goes ahead and calls dsa_tree_setup_switches() for everybody else, calling their .setup() methods too. This acts as the synchronization point. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 472111920f1c5fbe103022a4b05bfb37128a2a29 Author: Tobias Waldekranz Date: Thu Jul 22 18:55:38 2021 +0300 net: bridge: switchdev: allow the TX data plane forwarding to be offloaded Allow switchdevs to forward frames from the CPU in accordance with the bridge configuration in the same way as is done between bridge ports. This means that the bridge will only send a single skb towards one of the ports under the switchdev's control, and expects the driver to deliver the packet to all eligible ports in its domain. Primarily this improves the performance of multicast flows with multiple subscribers, as it allows the hardware to perform the frame replication. The basic flow between the driver and the bridge is as follows: - When joining a bridge port, the switchdev driver calls switchdev_bridge_port_offload() with tx_fwd_offload = true. - The bridge sends offloadable skbs to one of the ports under the switchdev's control using skb->offload_fwd_mark = true. - The switchdev driver checks the skb->offload_fwd_mark field and lets its FDB lookup select the destination port mask for this packet. v1->v2: - convert br_input_skb_cb::fwd_hwdoms to a plain unsigned long - introduce a static key "br_switchdev_fwd_offload_used" to minimize the impact of the newly introduced feature on all the setups which don't have hardware that can make use of it - introduce a check for nbp->flags & BR_FWD_OFFLOAD to optimize cache line access - reorder nbp_switchdev_frame_mark_accel() and br_handle_vlan() in __br_forward() - do not strip VLAN on egress if forwarding offload on VLAN-aware bridge is being used - propagate errors from .ndo_dfwd_add_station() if not EOPNOTSUPP v2->v3: - replace the solution based on .ndo_dfwd_add_station with a solution based on switchdev_bridge_port_offload - rename BR_FWD_OFFLOAD to BR_TX_FWD_OFFLOAD v3->v4: rebase v4->v5: - make sure the static key is decremented on bridge port unoffload - more function and variable renaming and comments for them: br_switchdev_fwd_offload_used to br_switchdev_tx_fwd_offload br_switchdev_accels_skb to br_switchdev_frame_uses_tx_fwd_offload nbp_switchdev_frame_mark_tx_fwd to nbp_switchdev_frame_mark_tx_fwd_to_hwdom nbp_switchdev_frame_mark_accel to nbp_switchdev_frame_mark_tx_fwd_offload fwd_accel to tx_fwd_offload Signed-off-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6310a1526aa0b00b6d8a8205a753b5fcf2212eb2 Author: Krzysztof Wilczyński Date: Sun Jul 4 23:57:33 2021 +0000 PCI: tegra: Remove unused struct tegra_pcie_bus Following the code refactoring completed in the commit 1fd92928bab5 ("PCI: tegra: Refactor configuration space mapping code") there are no more known users of struct tegra_pcie_bus. Thus, remove declaration of struct tegra_pcie_bus as it's no longer needed and does not have any existing users left. Link: https://lore.kernel.org/r/20210704235733.2514131-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Lorenzo Pieralisi commit 5af84df962dd6699e3972fda7a0c8b579fb3ab04 Merge: 090597b4a9c1b 9f42f674a8920 Author: David S. Miller Date: Fri Jul 23 15:59:46 2021 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Conflicts are simple overlapping changes. Signed-off-by: David S. Miller commit 90c7c70a0a909de87572b9ff81aa35acd49f6473 Author: Normunds Rieksts Date: Thu Jul 1 18:07:09 2021 +0100 drm/fourcc: Add modifier definitions for Arm Fixed Rate Compression Arm Fixed Rate Compression (AFRC) is a proprietary fixed rate image compression protocol and format. It is designed to provide guaranteed bandwidth and memory footprint reductions in graphics and media use-cases. This patch aims to add modifier definitions for describing AFRC. Signed-off-by: Normunds Rieksts Reviewed-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20210701170709.39922-1-normunds.rieksts@arm.com commit 9f1168cf263aab0474300f7118107f8ef73e7423 Author: Geert Uytterhoeven Date: Tue Jun 29 15:20:45 2021 +0200 PCI: controller: PCI_IXP4XX should depend on ARCH_IXP4XX The Intel IXP4xx PCI controller is only present on Intel IXP4xx XScale-based network processor SoCs. Add a dependency on ARCH_IXP4XX, to prevent asking the user about this driver when configuring a kernel without support for the XScale processor family. Link: https://lore.kernel.org/r/6a88e55fe58fc280f4ff1ca83c154e4895b6dcbf.1624972789.git.geert+renesas@glider.be Fixes: f7821b4934584824 ("PCI: ixp4xx: Add a new driver for IXP4xx") Signed-off-by: Geert Uytterhoeven [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Linus Walleij commit 9a5ca18895eccd00be530899bb72de301210dd98 Merge: 9946aa630ae71 1d904eaf3f995 Author: Steve French Date: Fri Jul 23 09:56:41 2021 -0500 Merge pull request #62 from namjaejeon/cifsd-for-next ksmbd-fixes commit bdb99dbe3ece52c7d6ae88f02030479ea6205e15 Author: Hawking Zhang Date: Thu Jul 22 13:46:47 2021 +0800 drm/amdgpu: retire sdma v5_2 golden settings from driver They are initalized by hardware during power up phase, starting from sdma v5_2 generation Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 61a6813f3f4e42336727045ca7c36308cbb0c4b2 Author: Chengzhe Liu Date: Thu Jul 22 11:31:10 2021 +0800 drm/amdgpu: Add msix restore for pass-through mode In pass-through mode, after mode 1 reset, msix enablement status would lost and never receives interrupt again. So, we should restore msix status after mode 1 reset. Signed-off-by: Chengzhe Liu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fe6b1032b23eac106292f57330dd4dc64124ef81 Author: Roy Sun Date: Thu Jul 22 13:55:42 2021 +0800 drm/amdgpu: Change the imprecise output The fail reason is that the vfgate is disabled Signed-off-by: Roy Sun Reviewed-by: Peng Ju Zhou Signed-off-by: Alex Deucher commit 7a69ce40aeef448338b313d7a3ee21d2baf24c94 Author: Stylon Wang Date: Tue Jul 20 10:58:19 2021 +0800 drm/amd/display: Fix ASSR regression on embedded panels [Why] Regression found in some embedded panels traces back to the earliest upstreamed ASSR patch. The changed code flow are causing problems with some panels. [How] - Change ASSR enabling code while preserving original code flow as much as possible - Simplify the code on guarding with internal display flag Bug: https://bugzilla.kernel.org/show_bug.cgi?id=213779 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1620 Reviewed-by: Alex Deucher Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit 1bece222eabeb3d8b10c5f2dadb03b6fb780b050 Author: Chengzhe Liu Date: Tue Jul 20 15:18:12 2021 +0800 drm/amdgpu: Clear doorbell interrupt status for Sienna Cichlid On Sienna Cichlid, in pass-through mode, if we unload the driver in BACO mode(RTPM), then the kernel would receive thousands of interrupts. That's because there is doorbell monitor interrupt on BIF, so KVM keeps injecting interrupts to the guest VM. So we should clear the doorbell interrupt status after BACO exit. v2: Modify coding style and commit message Signed-off-by: Chengzhe Liu Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 5810323ba692895b045e3f1b3e107605c3717dab Author: Luben Tuikov Date: Fri Jul 9 23:33:11 2021 -0400 drm/amd/pm: Fix a bug communicating with the SMU (v5) This fixes a bug which if we probe a non-existing I2C device, and the SMU returns 0xFF, from then on we can never communicate with the SMU, because the code before this patch reads and interprets 0xFF as a terminal error, and thus we never write 0 into register 90 to clear the status (and subsequently send a new command to the SMU.) It is not an error that the SMU returns status 0xFF. This means that the SMU executed the last command successfully (execution status), but the command result is an error of some sort (execution result), depending on what the command was. When doing a status check of the SMU, before we send a new command, the only status which precludes us from sending a new command is 0--the SMU hasn't finished executing a previous command, and 0xFC--the SMU is busy. This bug was seen as the following line in the kernel log, amdgpu: Msg issuing pre-check failed(0xff) and SMU may be not in the right state! when subsequent SMU commands, not necessarily related to I2C, were sent to the SMU. This patch fixes this bug. v2: Add a comment to the description of __smu_cmn_poll_stat() to explain why we're NOT defining the SMU FW return codes as macros, but are instead hard-coding them. Such a change, can be followed up by a subsequent patch. v3: The changes are, a) Add comments to break labels in __smu_cmn_reg2errno(). b) When an unknown/unspecified/undefined result is returned back from the SMU, map that to -EREMOTEIO, to distinguish failure at the SMU FW. c) Add kernel-doc to smu_cmn_send_msg_without_waiting(), smu_cmn_wait_for_response(), smu_cmn_send_smc_msg_with_param(). d) In smu_cmn_send_smc_msg_with_param(), since we wait for completion of the command, if the result of the completion is undefined/unknown/unspecified, we print that to the kernel log. v4: a) Add macros as requested, though redundant, to be removed when SMU consolidates for all ASICs--see comment in code. b) Get out if the SMU code is unknown. v5: Rename the macro names. Cc: Alex Deucher Cc: Evan Quan Cc: Lijo Lazar Fixes: fcb1fe9c9e0031 ("drm/amd/powerplay: pre-check the SMU state before issuing message") Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a8f706966b92da9d3e4d5080f076bb41f22cd5b4 Author: Tao Zhou Date: Tue Jul 13 17:57:06 2021 -0400 drm/amdgpu: add pci device id for cyan_skillfish Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7fd74ad88054c99e78cfc81afab99d3fff8ca29c Author: Lang Yu Date: Mon Jul 12 10:51:15 2021 +0800 drm/amdgpu: add autoload_supported check for RLC autoload Asic cyan_skilfish2 won't support RLC autoload when using front door loading. We just use PSP to load firmware like gfx9 here. So add autoload_supported flag check instead of just checking firmware load type for RLC autoload. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 641df09904876d0f5be6e991eafc27353b90e218 Author: Lang Yu Date: Tue Jul 13 17:55:52 2021 -0400 drm/amdgpu: enable SMU for cyan_skilfish Enable SMU support for cyan_skilfish. v2: Squash in fix (Alex) Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 61ad757dae89d6d493e05954f0670031b5f29524 Author: Lang Yu Date: Wed Jul 21 11:05:07 2021 -0400 drm/amdgpu: add check_fw_version support for cyan_skillfish Add check_fw_version function support for cyan_skillfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 67c3f8456a14bec99b8e276f9df2bedae3d97bb4 Author: Lang Yu Date: Thu Jul 1 15:39:55 2021 +0800 drm/amdgpu: add basic ppt functions for cyan_skilfish Add basic ppt funcs support or cyan_skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit ad75be36d448245e66009374a53db86b362a2b5f Author: Lang Yu Date: Thu Jul 1 15:21:59 2021 +0800 drm/amdgpu: add smu interface header for cyan_skilfish Add smu11_driver_if_cyan_skillfish.h for cyan_skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 1139402e646d5b4f911005f3b1e78d955a4d1b71 Author: Lang Yu Date: Thu Jul 1 15:20:19 2021 +0800 drm/amdgpu: add smu_v11_8_ppsmc header for cyan_skilfish Add smu_v11_8_ppsmc.h for cyan_skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 128ac51a5c92ee7b8c1192e30a5e63071ac8ca33 Author: Lang Yu Date: Thu Jul 1 15:18:34 2021 +0800 drm/amdgpu: add smu_v11_8_pmfw header for cyan_skilfish Add smu_v11_8_pmfw.h for cyan_skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit c5d0aa482e10d669437c2b660ecda5ee6ee448e1 Author: Lang Yu Date: Thu Jun 17 12:55:10 2021 +0800 drm/amdgpu: use direct loading by default for cyan_skillfish2 Will switch to front door loading by default after this function is stable. v2: use APU flags (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 1c7916af55a7c14702bf5dbc61c7918450a93c96 Author: Lang Yu Date: Thu Jun 17 12:48:45 2021 +0800 drm/amdgpu: enable psp v11.0.8 for cyan_skillfish Add psp v11.0.8 to ip block initialization. v2: use APU flags (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 3188fd0752a5f6ec3682fa0b5c437d3b54355351 Author: Lang Yu Date: Tue Jul 13 17:50:23 2021 -0400 drm/amdgpu: init psp v11.0.8 function for cyan_skillfish Add psp v11.0.8 function into psp driver. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit e330a68f30a6306bd8599f183b0705fb71d3ee97 Author: Lang Yu Date: Thu Jun 17 12:05:41 2021 +0800 drm/amdgpu: add psp v11.0.8 driver for cyan_skillfish Introduce the psp v11.0.8 driver for cyan_skillfish. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 2766534b766e1b12e0fa0a4e2e26929e808fde71 Author: Lang Yu Date: Thu Jun 17 11:37:29 2021 +0800 drm/amdgpu: add mp 11.0.8 header for cyan_skillfish The cyan_skillfish will use the mp 11.0.8. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 338b3cf0b9f8e122fc8257133c06aa92ad5ab9b0 Author: Tao Zhou Date: Tue Jun 1 17:06:44 2021 +0800 drm/amdgpu: add nbio support for cyan_skillfish nbio version is 2.3. v2: Make it more explicit (Alex) Signed-off-by: Tao Zhou Signed-off-by: Alex Deucher commit b515937b414a5b1bbacd6cde1c1f4883808399e3 Author: Tao Zhou Date: Tue Jul 13 17:45:40 2021 -0400 drm/amdgpu: add chip early init for cyan_skillfish Set cg/pg flags and rev id for cyan_skillfish. Signed-off-by: Tao Zhou Signed-off-by: Alex Deucher commit 06e75b88e8b8e784a867a506de634f7d229f1001 Author: Tao Zhou Date: Tue Jul 13 17:34:53 2021 -0400 drm/amdkfd: enable cyan_skillfish KFD Add KFD support for cyan_skillfish. v2: whitespace fixes (Alex) Signed-off-by: Tao Zhou Signed-off-by: Alex Deucher commit d9393f9b68a52dc6d905e3e19c4a3b40d0897432 Author: Tao Zhou Date: Tue Jul 13 17:29:36 2021 -0400 drm/amdgpu: add gc v10 golden settings for cyan_skillfish v2: squash in updates from Ray Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 86491ff7c6e749a487d76c450ec16e3b87f62971 Author: Tao Zhou Date: Wed Dec 19 11:53:08 2018 +0800 drm/amdgpu: add sdma v5 golden settings for cyan_skillfish Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9724bb6621cb997a5b3d3e8032723c2d2c627e6d Author: Tao Zhou Date: Tue Jul 13 17:27:35 2021 -0400 drm/amdgpu: add cyan_skillfish support in gfx v10 Add gfx support for cyan_skillfish. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9dbd8a125170a0f5fe648a03221795415d6f4e7d Author: Tao Zhou Date: Tue Jul 13 17:25:33 2021 -0400 drm/amdgpu: add cyan_skillfish support in gmc v10 Add gmc support for cyan_skillfish. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d594e3cc19bed8f0f1d8355c2c5681ef51aef0e9 Author: Tao Zhou Date: Tue Dec 18 19:10:03 2018 +0800 drm/amdgpu: load fw direclty for cyan_skillfish Use backdoor loading. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bf4759a81b7b2466b3ce36a80f3f406cf627e007 Author: Tao Zhou Date: Tue Dec 18 19:08:16 2018 +0800 drm/amdgpu: add sdma fw loading support for cyan_skillfish Same as Navi10. v2: squash in updates (Alex) Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 621312a2acdff9c8012247bf79f8a8ffb7547c91 Author: Tao Zhou Date: Tue Jul 13 17:21:27 2021 -0400 drm/amdgpu: add cp/rlc fw loading support for cyan_skillfish Add cp/rlc fw loading support and gfx golden setting. v2: squash in updates (Alex) Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f36fb5a0e3611aaf2e68623fc12fae41c4990de5 Author: Tao Zhou Date: Tue Jul 13 17:19:25 2021 -0400 drm/amdgpu: set ip blocks for cyan_skillfish Add ip blocks for cyan_skillfish. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6e80eacd9c995769952fc75010d64500a905bd14 Author: Tao Zhou Date: Tue Jul 13 17:18:03 2021 -0400 drm/amdgpu: init family name for cyan_skillfish Use FAMILY_NV for cyan_skillfish. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 708391977be557359f7e765c4474e237238febb2 Author: Tao Zhou Date: Tue Jul 13 17:16:43 2021 -0400 drm/amdgpu: dynamic initialize ip offset for cyan_skillfish Add ip offset definition for cyan_skillfish and initialize it. v2: squash in ip_offset updates (Alex) Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d0f56dc25afba6e08be2d2611d5d19f97821aa64 Author: Tao Zhou Date: Tue Jul 13 17:13:48 2021 -0400 drm/amdgpu: add cyan_skillfish asic type Add cyan_skillfish asic family. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 30ebc16aac645d8676531858c9fe2cff911c77e5 Author: Lang Yu Date: Wed Jun 23 14:48:34 2021 +0800 drm/amdgpu: adjust fw_name string length for toc Adjust toc fw_name string length to PSP_FW_NAME_LEN. Signed-off-by: Lang Yu Reviewed-by: Tao Zhou Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 5ccde01b50c003a6e6ed12478465983278d99c6f Author: Tao Zhou Date: Wed May 19 17:57:35 2021 +0800 drm/amdgpu: increase size for sdma fw name string Longer firmware name needs more space. Signed-off-by: Tao Zhou Signed-off-by: Alex Deucher commit 69b30d80ef0d51df2ec9428a96dc1fb36e256faf Author: Aaron Liu Date: Wed Nov 4 13:04:06 2020 +0800 drm/amdgpu: add yellow carp pci id (v2) Add Yellow Carp PCI id support. v2: add another DID Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit e97c8d86773d14c8aced0b25f2a5063aefeb5dec Author: Aaron Liu Date: Wed Jun 2 10:32:41 2021 +0800 drm/amdgpu: update yellow carp external rev_id handling 0x1681 has a different external revision id. Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit aff890288de2d818e4f83ec40c9315e2d735df07 Author: Kai-Heng Feng Date: Wed Jul 21 01:22:15 2021 +0800 drm/amdgpu/acp: Make PM domain really work Devices created by mfd_add_hotplug_devices() don't really increase the index of its name, so get_mfd_cell_dev() cannot find any device, hence a NULL dev is passed to pm_genpd_add_device(): [ 56.974926] (NULL device *): amdgpu: device acp_audio_dma.0.auto added to pm domain [ 56.974933] (NULL device *): amdgpu: Failed to add dev to genpd [ 56.974941] [drm:amdgpu_device_ip_init [amdgpu]] *ERROR* hw_init of IP block failed -22 [ 56.975810] amdgpu 0000:00:01.0: amdgpu: amdgpu_device_ip_init failed [ 56.975839] amdgpu 0000:00:01.0: amdgpu: Fatal error during GPU init [ 56.977136] ------------[ cut here ]------------ [ 56.977143] kernel BUG at mm/slub.c:4206! [ 56.977158] invalid opcode: 0000 [#1] SMP NOPTI [ 56.977167] CPU: 1 PID: 1648 Comm: modprobe Not tainted 5.12.0-051200rc8-generic #202104182230 [ 56.977175] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./FM2A68M-HD+, BIOS P5.20 02/13/2019 [ 56.977180] RIP: 0010:kfree+0x3bf/0x410 [ 56.977195] Code: 89 e7 48 d3 e2 f7 da e8 5f 0d 02 00 80 e7 02 75 3e 44 89 ee 4c 89 e7 e8 ef 5f fd ff e9 fa fe ff ff 49 8b 44 24 08 a8 01 75 b7 <0f> 0b 4c 8b 4d b0 48 8b 4d a8 48 89 da 4c 89 e6 41 b8 01 00 00 00 [ 56.977202] RSP: 0018:ffffa48640ff79f0 EFLAGS: 00010246 [ 56.977210] RAX: 0000000000000000 RBX: ffff9286127d5608 RCX: 0000000000000000 [ 56.977215] RDX: 0000000000000000 RSI: ffffffffc099d0fb RDI: ffff9286127d5608 [ 56.977220] RBP: ffffa48640ff7a48 R08: 0000000000000001 R09: 0000000000000001 [ 56.977224] R10: 0000000000000000 R11: ffff9286087d8458 R12: fffff3ae0449f540 [ 56.977229] R13: 0000000000000000 R14: dead000000000122 R15: dead000000000100 [ 56.977234] FS: 00007f9de5929540(0000) GS:ffff928612e80000(0000) knlGS:0000000000000000 [ 56.977240] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 56.977245] CR2: 00007f697dd97160 CR3: 00000001110f0000 CR4: 00000000001506e0 [ 56.977251] Call Trace: [ 56.977261] amdgpu_dm_encoder_destroy+0x1b/0x30 [amdgpu] [ 56.978056] drm_mode_config_cleanup+0x4f/0x2e0 [drm] [ 56.978147] ? kfree+0x3dd/0x410 [ 56.978157] ? drm_managed_release+0xc8/0x100 [drm] [ 56.978232] drm_mode_config_init_release+0xe/0x10 [drm] [ 56.978311] drm_managed_release+0x9d/0x100 [drm] [ 56.978388] devm_drm_dev_init_release+0x4d/0x70 [drm] [ 56.978450] devm_action_release+0x15/0x20 [ 56.978459] release_nodes+0x77/0xc0 [ 56.978469] devres_release_all+0x3f/0x50 [ 56.978477] really_probe+0x245/0x460 [ 56.978485] driver_probe_device+0xe9/0x160 [ 56.978492] device_driver_attach+0xab/0xb0 [ 56.978499] __driver_attach+0x8f/0x150 [ 56.978506] ? device_driver_attach+0xb0/0xb0 [ 56.978513] bus_for_each_dev+0x7e/0xc0 [ 56.978521] driver_attach+0x1e/0x20 [ 56.978528] bus_add_driver+0x135/0x1f0 [ 56.978534] driver_register+0x91/0xf0 [ 56.978540] __pci_register_driver+0x54/0x60 [ 56.978549] amdgpu_init+0x77/0x1000 [amdgpu] [ 56.979246] ? 0xffffffffc0dbc000 [ 56.979254] do_one_initcall+0x48/0x1d0 [ 56.979265] ? kmem_cache_alloc_trace+0x120/0x230 [ 56.979274] ? do_init_module+0x28/0x280 [ 56.979282] do_init_module+0x62/0x280 [ 56.979288] load_module+0x71c/0x7a0 [ 56.979296] __do_sys_finit_module+0xc2/0x120 [ 56.979305] __x64_sys_finit_module+0x1a/0x20 [ 56.979311] do_syscall_64+0x38/0x90 [ 56.979319] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 56.979328] RIP: 0033:0x7f9de54f989d [ 56.979335] Code: 00 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 c3 f5 0c 00 f7 d8 64 89 01 48 [ 56.979342] RSP: 002b:00007ffe3c395a28 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 56.979350] RAX: ffffffffffffffda RBX: 0000560df3ef4330 RCX: 00007f9de54f989d [ 56.979355] RDX: 0000000000000000 RSI: 0000560df3a07358 RDI: 000000000000000f [ 56.979360] RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000000 [ 56.979365] R10: 000000000000000f R11: 0000000000000246 R12: 0000560df3a07358 [ 56.979369] R13: 0000000000000000 R14: 0000560df3ef4460 R15: 0000560df3ef4330 [ 56.979377] Modules linked in: amdgpu(+) iommu_v2 gpu_sched drm_ttm_helper ttm drm_kms_helper cec rc_core i2c_algo_bit fb_sys_fops syscopyarea sysfillrect sysimgblt nft_counter xt_tcpudp ipt_REJECT nf_reject_ipv4 xt_conntrack iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security ip_set nf_tables libcrc32c nfnetlink ip6_tables iptable_filter bpfilter input_leds binfmt_misc edac_mce_amd kvm_amd ccp kvm snd_hda_codec_realtek snd_hda_codec_generic crct10dif_pclmul snd_hda_codec_hdmi ledtrig_audio ghash_clmulni_intel aesni_intel snd_hda_intel snd_intel_dspcfg snd_seq_midi crypto_simd snd_intel_sdw_acpi cryptd snd_hda_codec snd_seq_midi_event snd_rawmidi snd_hda_core snd_hwdep snd_seq fam15h_power k10temp snd_pcm snd_seq_device snd_timer snd mac_hid soundcore sch_fq_codel nct6775 hwmon_vid drm ip_tables x_tables autofs4 dm_mirror dm_region_hash dm_log hid_generic usbhid hid uas usb_storage r8169 crc32_pclmul realtek ahci xhci_pci i2c_piix4 [ 56.979521] xhci_pci_renesas libahci video [ 56.979541] ---[ end trace cb8f6a346f18da7b ]--- Instead of finding MFD hotplugged device by its name, simply iterate over the child devices to avoid the issue. Squash in unused variable removal (Alex) BugLink: https://bugs.launchpad.net/bugs/1920674 Fixes: 25030321ba28 ("drm/amd: add pm domain for ACP IP sub blocks") Signed-off-by: Kai-Heng Feng Signed-off-by: Alex Deucher commit 222e0a71c2973939c861d84d460edd4e3cf25bed Author: Candice Li Date: Wed Jul 21 13:55:59 2021 -0400 drm/amd/amdgpu: add consistent PSP FW loading size checking Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit ff99849b00fef595ae46681ce0c2217a9f834332 Author: Jingwen Chen Date: Tue Jul 20 18:35:35 2021 +0800 drm/amd/amdgpu: consider kernel job always not guilty [Why] Currently all timedout job will be considered to be guilty. In SRIOV multi-vf use case, the vf flr happens first and then job time out is found. There can be several jobs timeout during a very small time slice. And if the innocent sdma job time out is found before the real bad job, then the innocent sdma job will be set to guilty. This will lead to a page fault after resubmitting job. [How] If the job is a kernel job, we will always consider it not guilty Reviewed-by: Christian König Signed-off-by: Jingwen Chen Signed-off-by: Alex Deucher commit 410e302ea53f095f5d94dc14efefe8191bde901b Author: Graham Sider Date: Tue Jul 6 17:46:37 2021 -0400 drm/amdkfd: Update SMI throttle event bitmask Update Arcturus/Aldebaran thermal throttle SMI event path to use ASIC-independent throttler bits when logging. Signed-off-by: Graham Sider Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit e25515e22bdc7ceee3cc0721acafc67d63aba34f Author: Anson Jacob Date: Mon Jul 19 13:46:09 2021 -0400 drm/amdgpu: Fix documentaion for dm_dmub_outbox1_low_irq Fix make htmldocs complaint: ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:628: warning: Excess function parameter 'interrupt_params' description in 'DMUB_TRACE_MAX_READ' v2: Moved DMUB_TRACE_MAX_READ macro above function documentation Signed-off-by: Anson Jacob CC: Harry Wentland Acked-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 6d7f735366c7b31655ff5e6dfff22b38440e2be4 Author: Anson Jacob Date: Tue Jul 20 11:43:20 2021 -0400 drm/amd/amdgpu: Add a new line to debugfs phy_settings output Add new line to phy_settings output Signed-off-by: Anson Jacob Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 1a394b3c3de2577f200cb623c52a5c2b82805cec Author: Anson Jacob Date: Tue Jul 20 11:00:44 2021 -0400 drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex link_rate is updated via debugfs using hex values, set it to output in hex as well. eg: Resolution: 1920x1080@144Hz cat /sys/kernel/debug/dri/0/DP-1/link_settings Current: 4 0x14 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 0 0x0 0 echo "4 0x1e" > /sys/kernel/debug/dri/0/DP-1/link_settings cat /sys/kernel/debug/dri/0/DP-1/link_settings Current: 4 0x1e 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 4 0x1e 0 Signed-off-by: Anson Jacob Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 4f942aaeb19dbf2135931120cc806d459add4788 Author: Oak Zeng Date: Thu Jul 15 18:34:25 2021 -0500 drm/amdkfd: Fix a concurrency issue during kfd recovery start_cpsch and stop_cpsch can be called during kfd device initialization or during gpu reset/recovery. So they can run concurrently. Currently in start_cpsch and stop_cpsch, pm_init and pm_uninit is not protected by the dpm lock. Imagine such a case that user use packet manager's function to submit a pm4 packet to hang hws (ie through command cat /sys/class/kfd/kfd/topology/nodes/1/gpu_id | sudo tee /sys/kernel/debug/kfd/hang_hws), while kfd device is under device reset/recovery so packet manager can be not initialized. There will be unpredictable protection fault in such case. This patch moves pm_init/uninit inside the dpm lock and check packet manager is initialized before using packet manager function. Signed-off-by: Oak Zeng Acked-by: Christian Konig Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 78ccea9ff2ad6fb5c73f146b46193ef15d6ede5f Author: Oak Zeng Date: Thu Jul 15 17:02:46 2021 -0500 drm/amdkfd: Set priv_queue to NULL after it is freed This variable will be used to determine whether packet manager is initialized or not, in a future patch. Signed-off-by: Oak Zeng Acked-by: Christian Konig Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9af5379c85087a0a0cbab8a4e39454a66b5f0b18 Author: Oak Zeng Date: Thu Jul 15 14:57:16 2021 -0500 drm/amdkfd: Renaming dqm->packets to dqm->packet_mgr Renaming packets to packet_mgr to reflect the real meaning of this variable. Signed-off-by: Oak Zeng Acked-by: Christian Konig Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit cd5955f40173df00bfe52272a3563079075f2674 Author: Oak Zeng Date: Wed Jul 14 09:59:51 2021 -0500 drm/amdgpu: Change a few function names Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng Reviewed-by: Alex Deucher Reviewed-by: Christian Konig Signed-off-by: Alex Deucher commit 95f71f12aa45d65b7f2ccab95569795edffd379a Author: Oak Zeng Date: Wed Jul 14 09:50:37 2021 -0500 drm/amdgpu: Fix a printing message The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block hw_init. Fix the printing message Signed-off-by: Oak Zeng Reviewed-by: Christian Konig Signed-off-by: Alex Deucher commit 4067cdb1cfadd1679b9efb33ba27a1d7dc2d3fe2 Author: Roy Sun Date: Thu Jul 8 16:18:30 2021 +0800 drm/amdgpu: Add error message when programing registers fails Squash in warning fix (Alex) Signed-off-by: Roy Sun Reviewed-by: Zhou pengju Signed-off-by: Alex Deucher commit 1a4772d922d2f3a46903ca699f7e0a3fa3bb448c Author: Roy Sun Date: Mon Jul 5 17:47:57 2021 +0800 drm/amdgpu: Change the imprecise function name The callback functions are used for SRIOV read/write instead of just for rlcg read/write Signed-off-by: Roy Sun Reviewed-by: Zhou pengju Signed-off-by: Alex Deucher commit f72ac409416eace7f8ae4b1aff9a63bb79768e7b Author: Veerabadhran Gopalakrishnan Date: Mon Jul 19 19:06:23 2021 +0530 drm/amdgpu - Corrected the video codecs array name for yellow carp Signed-off-by: Veerabadhran Gopalakrishnan Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 933048103837710b6996d5487e5fcbc320b81503 Author: Jonathan Kim Date: Wed Jun 2 09:46:16 2021 -0400 drm/amdkfd: report pcie bandwidth to the kfd Similar to xGMI reporting the min/max bandwidth between direct peers, PCIe will report the min/max bandwidth to the KFD. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3f46c4e9ce25bbcb9d619dbce57c8737c856b272 Author: Jonathan Kim Date: Wed May 12 12:30:41 2021 -0400 drm/amdkfd: report xgmi bandwidth between direct peers to the kfd Report the min/max bandwidth in megabytes to the kfd for direct xgmi connections only. Indirect peers will report 0 since indirect route is unknown. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 331e78187f3a477145819912114b48219f9fa19a Author: Jonathan Kim Date: Wed May 12 12:26:20 2021 -0400 drm/amdgpu: add psp command to get num xgmi links between direct peers The TA can now be invoked to provide the number of xgmi links connecting a direct source and destination peer. Non-direct peers will report zero links. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d8c33180c01fe66c2f808c80401383182673fce1 Author: Anson Jacob Date: Mon Jul 19 11:09:40 2021 -0400 drm/amdgpu: Fix documentaion for amdgpu_bo_add_to_shadow_list make htmldocs complaints about parameter for amdgpu_bo_add_to_shadow_list ./drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:739: warning: Excess function parameter 'bo' description in 'amdgpu_bo_add_to_shadow_list' ./drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:739: warning: Function parameter or member 'vmbo' not described in 'amdgpu_bo_add_to_shadow_list' ./drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:739: warning: Excess function parameter 'bo' description in 'amdgpu_bo_add_to_shadow_list' Signed-off-by: Anson Jacob Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 54e6065461242cc82881bea2aaffb91841859987 Author: Lijo Lazar Date: Thu Jul 15 14:54:49 2021 +0800 drm/amd/pm: Support board calibration on aldebaran Add support for board power calibration on Aldebaran. Board calibration is done after DC offset calibration. Signed-off-by: Lijo Lazar Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 550ff7ad37fab817bb9ab1c2aac3147c1a5f6afb Author: Eric Yang Date: Wed Jun 30 18:22:51 2021 -0400 drm/amd/display: change zstate allow msg condition [Why] PMFW message which previously thought to only control Z9 controls both Z9 and Z10. Also HW design team requested that Z9 must only be supported on eDP due to content protection interop. [How] Change zstate support condition to match updated policy Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Eric Yang Signed-off-by: Alex Deucher commit d95743c7986171266043fdc0c16219803e8c0be8 Author: Aric Cyr Date: Sat Jul 10 21:40:45 2021 -0400 drm/amd/display: 3.2.145 DC version 3.2.145 brings improvements in multiple areas. In summary, we highlight: - Code improvements for passive - Cursor manipulation enhancements - Expand debug in some areas - Fix problems in DML - Other minor code refactors Reviewed-by: Anson Jacob Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 5624c3455d5e646212c29a68c5d328da84ca2bce Author: Anthony Koo Date: Sat Jul 10 22:03:07 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.75 - Add reserved bits for future feature development - Fix issue with mismatch with type const - Replaced problematic code with old memcpy and casted problematic pointers to unsigned char pointers Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 5bb0d5cf9fc7f595a1d5348b3e2f35530cfde3a0 Author: Krunoslav Kovac Date: Fri Jul 9 10:25:44 2021 -0400 drm/amd/display: Refine condition for cursor visibility [why] There's a special case where upper plane is not the main plane. If it owns the cursor, it will be invisible in the majority of the screen. [How] The condition for disabling cursor is changed: - check if upper viewport completely covers current. This was the previous change that doesn't handle all scenarios with pipe splitting. - if not, show the cursor only if it's not scaled or no upper pipe. Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Krunoslav Kovac Signed-off-by: Alex Deucher commit ff7903551c9626be8de481a46796c067a57c958d Author: Bindu Ramamurthy Date: Fri Jul 9 10:35:33 2021 -0400 drm/amd/display: Populate dtbclk entries for dcn3.02/3.03 [Why] Populate dtbclk values from bwparams for dcn302, dcn303. [How] dtbclk values are fetched from bandwidthparams for all DPM levels and for DPM levels where smu returns 0, previous level values are reported. Reviewed-by: Roman Li Acked-by: Rodrigo Siqueira Signed-off-by: Bindu Ramamurthy Signed-off-by: Alex Deucher commit a4d5df1787cc143b513b9f472ead1ff5eaa550e1 Author: Eric Yang Date: Fri Jul 9 12:57:50 2021 -0400 drm/amd/display: add workaround for riommu invalidation request hang [Why] When an riommu invalidation request come at the same time as a pipe is disabled there can be a case where DCN cannot ACK the request if only one VMID is setup in the inuse list. [How] Setup a second unused VMID will work around the issue. Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Eric Yang Signed-off-by: Alex Deucher commit ba16b22d42283b6393db123ce0ff6e17bb0d01eb Author: Nevenko Stupar Date: Fri Jul 9 13:05:11 2021 -0400 drm/amd/display: Line Buffer changes DCN 3x increased Line buffer size for DCHUB latency hiding, from 4 lines of 4K resolution lines to 5 lines of 4K resolution lines. All Line Buffer can be used as extended memory for P State change latency hiding. The maximum number of lines is increased to 32 lines. Finally, LB_MEMORY_CONFIG_1 (LB memory piece 1) and LB_MEMORY _CONFIG_2 (LB memory piece 2) are not affected, no change in size, only 3 pieces is affected, i.e., when all 3 pieces are used in both LB_MEMORY_CONFIG_0 and LB_MEMORY_CONFIG_3 (for 4:2:0) modes. Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Nevenko Stupar Signed-off-by: Alex Deucher commit e0f65a85d405601bdb15d16f316fbe17a870ea75 Author: Mikita Lipski Date: Mon Jun 14 20:21:42 2021 -0400 drm/amd/display: Remove MALL function from DCN3.1 [why] DCN31 doesn't have MALL in DMUB so to avoid sending unknown commands to DMUB just remove the function pointer. [how] Remove apply_idle_power_optimizations from function pointers structure for DCN31 Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit 324b1fcba697de71e8e130ec422a433ec6796ff6 Author: sunglee Date: Fri Jul 9 10:24:14 2021 -0400 drm/amd/display: DCN2X Prefer ODM over bottom pipe to find second pipe [WHY] When finding a second pipe for pipe split, currently will look for bottom pipe in context first to decide the second pipe. This causes issues in 2 plane to 1 plane transitions like fullscreen video where bottom pipe no longer exists in the new configuration. [HOW] If previous context had an ODM pipe, use that to find the secondary pipe first before looking at bottom pipe. Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: sunglee Signed-off-by: Alex Deucher commit 0070a5b7004a0151f06412f9bee4e25bfa24efa9 Author: Camille Cho Date: Thu Jul 8 18:28:37 2021 +0800 drm/amd/display: Only set default brightness for OLED [Why] We used to unconditionally set backlight path as AUX for panels capable of backlight adjustment via DPCD in set default brightness. [How] This should be limited to OLED panel only since we control backlight via PWM path for SDR mode in LCD HDR panel. Reviewed-by: Krunoslav Kovac Acked-by: Rodrigo Siqueira Signed-off-by: Camille Cho Signed-off-by: Alex Deucher commit b2d5b64e93586053e05c3e74638faa1cbf62f29a Author: Nicholas Kazlauskas Date: Thu Jul 8 12:59:59 2021 -0400 drm/amd/display: Update bounding box for DCN3.1 [Why & How] We're missing a default value for dram_channel_width_bytes in the DCN3.1 SOC bounding box and we don't currently have the interface in place to query the actual value from VBIOS. Put in a hardcoded default until we have the interface in place. Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit ffa09d932ff89267142b00966d0a5ac992095f06 Author: Nicholas Kazlauskas Date: Wed Jul 7 16:38:57 2021 -0400 drm/amd/display: Query VCO frequency from register for DCN3.1 [Why] Hardcoding the VCO frequency isn't correct since we don't own or control the value. In the case where the hardcode is also missing we can't lightup display. [How] Query from the CLK register instead. Update the DFS frequency to be able to compute the VCO frequency. Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit f891ae71f3b05281a8c4a0ac5cc4b1fa01559c77 Author: Bindu Ramamurthy Date: Thu May 27 10:11:32 2021 -0400 drm/amd/display: Populate socclk entries for dcn3.02/3.03 [Why] Initialize socclk entries in bandwidth params for dcn302, dcn303. [How] Fetch the sockclk values from smu for the DPM levels and for the DPM levels where smu returns 0, previous level values are reported. Reviewed-by: Roman Li Acked-by: Rodrigo Siqueira Signed-off-by: Bindu Ramamurthy Signed-off-by: Alex Deucher commit 2e63f4064edadbf0917690296e91e7eae60c8000 Author: Nicholas Kazlauskas Date: Wed Jul 7 13:19:14 2021 -0400 drm/amd/display: Fix max vstartup calculation for modes with borders [Why] Vertical and horizontal borders in timings are treated as increasing the active area - vblank and hblank actually shrink. Our input into DML does not include these borders so it incorrectly assumes it has more time than available for vstartup and tmdl calculations for some modes with borders. An example of such a timing would be 640x480@72Hz: h_total: 832 h_border_left: 8 h_addressable: 640 h_border_right: 8 h_front_porch: 16 h_sync_width: 40 v_total: 520 v_border_top: 8 v_addressable: 480 v_border_bottom: 8 v_front_porch: 1 v_sync_width: 3 pix_clk_100hz: 315000 [How] Include borders as part of destination vactive/hactive. This change DCN20+ so it has wide impact, but the destination vactive and hactive are only really used for vstartup calculation anyway. Most modes do not have vertical or horizontal borders. Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 328fe6e27cb01240f15153b2e17370c5bdf262a1 Author: Michael Strauss Date: Tue Jul 6 14:52:12 2021 -0400 drm/amd/display: Enable eDP ILR on DCN2.1 [WHY] Enable feature for 21.40 Reviewed-by: Sung Lee Acked-by: Rodrigo Siqueira Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit 11a7e64266ee9166fbe326f6f3300d39aa8e8375 Author: Aric Cyr Date: Mon Jul 5 20:53:23 2021 -0400 drm/amd/display: 3.2.144 Reviewed-by: Shahin Khayyer Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 0f806243125ddd0c5469b54d33d2ae7ca68bf909 Author: Victor Lu Date: Thu Jun 24 11:05:42 2021 -0400 drm/amd/display: Fix comparison error in dcn21 DML [why] A comparison error made it possible to not iterate through all the specified prefetch modes. [how] Correct "<" to "<=" Reviewed-by: Dmytro Laktyushkin Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Victor Lu Signed-off-by: Alex Deucher commit 3addbde269f21ffc735f6d3d0c2237664923824e Author: Jake Wang Date: Wed Jun 30 13:55:50 2021 -0400 drm/amd/display: Fixed hardware power down bypass during headless boot [Why] During headless boot, DIG may be on which causes HW/SW discrepancies. To avoid this we power down hardware on boot if DIG is turned on. With introduction of multiple eDP, hardware power down is being bypassed under certain conditions. [How] Fixed hardware power down bypass, and ensured hardware will power down if DIG is on and seamless boot is not enabled. Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Jake Wang Signed-off-by: Alex Deucher commit d93d5356369701eced20053382d2d094d8b522ac Author: Wesley Chalmers Date: Wed Jun 30 10:42:23 2021 -0400 drm/amd/display: Add copyright notice to new files Reviewed-by: Shahin Khayyer Acked-by: Rodrigo Siqueira Signed-off-by: Wesley Chalmers Signed-off-by: Alex Deucher commit 5948190a0ec836e03c0ca71dffaf907b7ec87194 Author: Zhan Liu Date: Mon Jun 28 21:20:18 2021 -0400 drm/amd/display: Reduce delay when sink device not able to ACK 00340h write [Why] Theoretically, per DP 1.4a spec, sink device needs to AUX_ACK 00340h write. However, due to hardware limitation, some sink devices have no 00340h dpcd address at all. This results in sink side fails to reply ACK, and consequently cause source side keep retrying DPCD write on DPCD 00340h. This results in significant delay when DPCD 00340h write is triggered (e.g. at S3 resume). [How] Check whether sink device could ACK on DPCD 00340h write on boot. If sink device fails to ACK, then remember that, so we won't write to DPCD 00340h later on. There will be a drm.debug KMS level message to inform user once a 00340h DPCD write is skipped on purpose. Reviewed-by: Nikola Cornij Acked-by: Rodrigo Siqueira Signed-off-by: Zhan Liu Signed-off-by: Alex Deucher commit 2be7f77f6c36128b216bee381d3f5359e8eb3352 Author: Aurabindo Pillai Date: Mon Jun 28 21:41:08 2021 -0400 drm/amd/display: add debug print for DCC validation failure [Why&How] Print a debug message when dcc validation fails in the display driver. Most DCC enablement related errors are from userspace. Adding a debug print in case of a failure from display driver will aid quicker triage. Reviewed-by: Harry Wentland Acked-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 718693352d8bcea65276615f4f8c8d531246b644 Author: Mario Limonciello Date: Thu Jul 22 08:27:28 2021 -0500 ASoC: amd: Use dev_probe_err helper Replace the pattern of check for err to match -EPROBE_DEFER and only output errors to use the dev_err_probe helper instead. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20210722132731.13264-2-mario.limonciello@amd.com Signed-off-by: Mark Brown commit af7dc6f194a866cb3e991ef5248ffdeb3ef5c46a Author: Mario Limonciello Date: Thu Jul 22 08:27:27 2021 -0500 ASoC: amd: Don't show messages about deferred probing by default Nearly every boot with a Lenovo P14s is showing acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517 This isn't useful to a user, especially as probing will run again. Use the dev_err_probe helper to hide the deferrerd probing messages. CC: markpearson@lenovo.com Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20210722132731.13264-1-mario.limonciello@amd.com Signed-off-by: Mark Brown commit ca3c9bdb101d9b9eb3ed8a85cc0fe55915ba49de Author: Roberto Sassu Date: Fri Jul 23 10:53:04 2021 +0200 ima: Add digest and digest_len params to the functions to measure a buffer This patch performs the final modification necessary to pass the buffer measurement to callers, so that they provide a functionality similar to ima_file_hash(). It adds the 'digest' and 'digest_len' parameters to ima_measure_critical_data() and process_buffer_measurement(). These functions calculate the digest even if there is no suitable rule in the IMA policy and, in this case, they simply return 1 before generating a new measurement entry. Signed-off-by: Roberto Sassu Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit ce5bb5a86e5ebcd3c2e40e6dd1382027b5d43caf Author: Roberto Sassu Date: Fri Jul 23 10:53:03 2021 +0200 ima: Return int in the functions to measure a buffer ima_measure_critical_data() and process_buffer_measurement() currently don't return a result as, unlike appraisal-related functions, the result is not used by callers to deny an operation. Measurement-related functions instead rely on the audit subsystem to notify the system administrator when an error occurs. However, ima_measure_critical_data() and process_buffer_measurement() are a special case, as these are the only functions that can return a buffer measurement (for files, there is ima_file_hash()). In a subsequent patch, they will be modified to return the calculated digest. In preparation to return the result of the digest calculation, this patch modifies the return type from void to int, and returns 0 if the buffer has been successfully measured, a negative value otherwise. Given that the result of the measurement is still not necessary, this patch does not modify the behavior of existing callers by processing the returned value. For those, the return value is ignored. Signed-off-by: Roberto Sassu Reviewed-by: Lakshmi Ramasubramanian Acked-by: Paul Moore (for the SELinux bits) Signed-off-by: Mimi Zohar commit 5d1ef2ce13a9098b4e0d31c50e4c79763a57b444 Author: Roberto Sassu Date: Fri Jul 23 10:53:02 2021 +0200 ima: Introduce ima_get_current_hash_algo() Buffer measurements, unlike file measurements, are not accessible after the measurement is done, as buffers are not suitable for use with the integrity_iint_cache structure (there is no index, for files it is the inode number). In the subsequent patches, the measurement (digest) will be returned directly by the functions that perform the buffer measurement, ima_measure_critical_data() and process_buffer_measurement(). A caller of those functions also needs to know the algorithm used to calculate the digest. Instead of adding the algorithm as a new parameter to the functions, this patch provides it separately with the new function ima_get_current_hash_algo(). Since the hash algorithm does not change after the IMA setup phase, there is no risk of races (obtaining a digest calculated with a different algorithm than the one returned). Signed-off-by: Roberto Sassu Reviewed-by: Lakshmi Ramasubramanian [zohar@linux.ibm.com: annotate ima_hash_algo as __ro_after_init] Signed-off-by: Mimi Zohar commit 090597b4a9c1b81b03fd7cfb4ba458a0e7a78b31 Merge: 4431531c482a2 29c4964822aad Author: David S. Miller Date: Fri Jul 23 14:20:46 2021 +0100 Merge branch 'net-remove-compat-alloc-user-space' Arnd Bergmann says: ==================== remove compat_alloc_user_space() This is the fifth version of my series, now spanning four patches instead of two, with a new approach for handling struct ifreq compatibility after I realized that my earlier approach introduces additional problems. The idea here is to always push down the compat conversion deeper into the call stack: rather than pretending to be native mode with a modified copy of the original data on the user space stack, have the code that actually works on the data understand the difference between native and compat versions. I have spent a long time looking at all drivers that implement an ndo_do_ioctl callback to verify that my assumptions are correct. This has led to a series of ~30 additional patches that I am not including here but will post separately, fixing a number of bugs in SIOCDEVPRIVATE ioctls, removing dead code, and splitting ndo_do_ioctl into multiple new ndo callbacks for private and ethernet specific commands. Arnd Link: https://lore.kernel.org/netdev/20201124151828.169152-1-arnd@kernel.org/ Changes in v6: - Split out and expand linux/compat.h rework - Split ifconf change into two patches - Rebase on latest net-next/master Changes in v5: - Rebase to v5.14-rc2 - Fix a few build issues Changes in v4: - build fix without CONFIG_INET - build fix without CONFIG_COMPAT - style fixes pointed out by hch Changes in v3: - complete rewrite of the series ==================== Signed-off-by: David S. Miller commit 29c4964822aad42c960d9edf67fb8209f1886baa Author: Arnd Bergmann Date: Thu Jul 22 16:29:03 2021 +0200 net: socket: rework compat_ifreq_ioctl() compat_ifreq_ioctl() is one of the last users of copy_in_user() and compat_alloc_user_space(), as it attempts to convert the 'struct ifreq' arguments from 32-bit to 64-bit format as used by dev_ioctl() and a couple of socket family specific interpretations. The current implementation works correctly when calling dev_ioctl(), inet_ioctl(), ieee802154_sock_ioctl(), atalk_ioctl(), qrtr_ioctl() and packet_ioctl(). The ioctl handlers for x25, netrom, rose and x25 do not interpret the arguments and only block the corresponding commands, so they do not care. For af_inet6 and af_decnet however, the compat conversion is slightly incorrect, as it will copy more data than the native handler accesses, both of them use a structure that is shorter than ifreq. Replace the copy_in_user() conversion with a pair of accessor functions to read and write the ifreq data in place with the correct length where needed, while leaving the other ones to copy the (already compatible) structures directly. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: David S. Miller commit 876f0bf9d0d5189dca9341c8e8e8686b09db8398 Author: Arnd Bergmann Date: Thu Jul 22 16:29:02 2021 +0200 net: socket: simplify dev_ifconf handling The dev_ifconf() calling conventions make compat handling more complicated than necessary, simplify this by moving the in_compat_syscall() check into the function. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: David S. Miller commit b0e99d03778b2418aec20db99d97d19d25d198b6 Author: Arnd Bergmann Date: Thu Jul 22 16:29:01 2021 +0200 net: socket: remove register_gifconf Since dynamic registration of the gifconf() helper is only used for IPv4, and this can not be in a loadable module, this can be simplified noticeably by turning it into a direct function call as a preparation for cleaning up the compat handling. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: David S. Miller commit 709566d79209af9255c7c201d9ffdd9039fa35ab Author: Arnd Bergmann Date: Thu Jul 22 16:29:00 2021 +0200 net: socket: rework SIOC?IFMAP ioctls SIOCGIFMAP and SIOCSIFMAP currently require compat_alloc_user_space() and copy_in_user() for compat mode. Move the compat handling into the location where the structures are actually used, to avoid using those interfaces and get a clearer implementation. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit dd98d2895de6485c884a9cb42de69fed02826fa4 Author: Arnd Bergmann Date: Thu Jul 22 16:28:59 2021 +0200 ethtool: improve compat ioctl handling The ethtool compat ioctl handling is hidden away in net/socket.c, which introduces a couple of minor oddities: - The implementation may end up diverging, as seen in the RXNFC extension in commit 84a1d9c48200 ("net: ethtool: extend RXNFC API to support RSS spreading of filter matches") that does not work in compat mode. - Most architectures do not need the compat handling at all because u64 and compat_u64 have the same alignment. - On x86, the conversion is done for both x32 and i386 user space, but it's actually wrong to do it for x32 and cannot work there. - On 32-bit Arm, it never worked for compat oabi user space, since that needs to do the same conversion but does not. - It would be nice to get rid of both compat_alloc_user_space() and copy_in_user() throughout the kernel. None of these actually seems to be a serious problem that real users are likely to encounter, but fixing all of them actually leads to code that is both shorter and more readable. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: David S. Miller commit 1a33b18b3bd9748c9c712a23e788bf1f1c4a7025 Author: Arnd Bergmann Date: Thu Jul 22 16:28:58 2021 +0200 compat: make linux/compat.h available everywhere Parts of linux/compat.h are under an #ifdef, but we end up using more of those over time, moving things around bit by bit. To get it over with once and for all, make all of this file uncondititonal now so it can be accessed everywhere. There are only a few types left that are in asm/compat.h but not yet in the asm-generic version, so add those in the process. This requires providing a few more types in asm-generic/compat.h that were not already there. The only tricky one is compat_sigset_t, which needs a little help on 32-bit architectures and for x86. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: David S. Miller commit 0cd1151886933d4845db02b3d09ad4df62d44c50 Author: Arnd Bergmann Date: Thu Jan 16 15:58:41 2020 +0100 csky: use generic strncpy/strnlen from_user Remove the csky implemenation of strncpy/strnlen and instead use the generic versions. The csky version is fairly slow because it always does byte accesses even for aligned data, and it lacks a checks for user_addr_max(). Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit c52801a774cefed7ffeafd1141468276b6c85c3a Author: Arnd Bergmann Date: Thu Jan 16 15:58:41 2020 +0100 arc: use generic strncpy/strnlen from_user Remove the arc implemenation of strncpy/strnlen and instead use the generic versions. The arc version is fairly slow because it always does byte accesses even for aligned data, and its checks for user_addr_max() differ from the generic code. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit 2820cfdc08178c55efa1c0fa402f082ef09bfe70 Author: Arnd Bergmann Date: Thu Jan 16 15:58:41 2020 +0100 hexagon: use generic strncpy/strnlen from_user Remove the hexagon implementation of strncpy/strnlen and instead use the generic version. The hexagon version reads the data twice for strncpy() by doing an extra strnlen(), and it apparently lacks a check for user_addr_max(). Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit 2f69b04a88687626b044a66661c570ca0ca6a0fc Author: Arnd Bergmann Date: Fri May 14 23:57:16 2021 +0200 h8300: remove stale strncpy_from_user This function is never called because h8300 uses the asm-generic inline function version. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit f27180dd63e1e6eca3230b9d3fdcc33564a81117 Author: Arnd Bergmann Date: Thu Jan 16 13:18:38 2020 +0100 asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user This is a preparation for changing over architectures to the generic implementation one at a time. As there are no callers of either __strncpy_from_user() or __strnlen_user(), fold these into the strncpy_from_user() and strnlen_user() functions to make each implementation independent of the others. Many of these implementations have known bugs, but the intention here is to not change behavior at all and stay compatible with those bugs for the moment. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann commit 45b256532782a1674459588eaca26d18b74818bb Author: Konstantin Porotchkin Date: Thu Jul 8 15:46:12 2021 +0300 arch/arm64: dts: change 10gbase-kr to 10gbase-r in Armada Change all 10G port modes in Armada family device trees from 10gbase-kr to 10gbase-r Signed-off-by: Konstantin Porotchkin Suggested-by: Russell King (Oracle) Reviewed-by: Russell King (Oracle) Signed-off-by: Gregory CLEMENT commit 5c0ee54723f3efd80933311080989611302c751f Author: Konstantin Porotchkin Date: Thu Jul 8 15:46:11 2021 +0300 arm64: dts: add support for Marvell cn9130-crb platform The Marvell reference platform CN9130-CRB is a small form factor board in a metal case. The platform is based on CN9130 SoC with addition of 8 Gigabit ports SOHO Ethernet switch. The reference platform features the following: * Up to 4 CPU cores ARMv8 Cortex-A72 CPU * CPU core operating speed of up to 2.2GHz * DDR4 DIMM – 8GB 64bit+ECC @ 2400Mhz. * 1x eMMC 8GB device * 1x uSD card 4 bits port on CP * 1x 128MB SPI NOR flash memory * 1x USB 3.0 Host port (Type A) * 1x SATA Gen3 via M.2 * 1x USB 3.0 via M.2 * 1x SIM card slot * 1x 1G Ethernet port via RGMII * 1x 10G switch port over SFP+ connector * 8x 1G ports through 88E6393X switch via XFI * 1x 2.5G/1G/100M/10M port via HS_SGMII * 1x PCI Express (PCIe)x1 Gen 3.0 * 1x PCI Express (PCIe)x4 Gen 3.0 via NVMe M.2 * JTAG port The CRB board uses MCP23017 i2c pin controller that drives the onboard eMMC abd USB 3,0 port power lines. The following configuration should be enabled for this controller support: CONFIG_PINCTRL_MCP23S08=y The plaform supports two HW configurations - "A" and "B" CN9130-CRB-A * AP-MPP configuration: SDIO, UART * CP0 Serdes configuration: * Lane0-3: NVMe (PCIe x4) * Lane4: XFI * Lane5: HS_SGMII 2. CN9130-CRB-B * AP-MPP configuration: SDIO, UART * CP0-MPP configuration: RGMII, SDIO, I2C0, I2C1, SMI, XSMI * CP0 Serdes configuration: * Lane0: PCIe x1 * Lane1: USB3_0 x1 * Lane2: SATA x1 * Lane3: USB3_1 x1 * Lane4: XFI * Lane5: HS_SGMII Signed-off-by: Konstantin Porotchkin Signed-off-by: Gregory CLEMENT commit f3200db5c6a5757d9ed7d8e3cf2b488fd0de97a1 Author: Stefan Chulski Date: Thu Jul 8 15:46:10 2021 +0300 dts: marvell: Enable 10G interfaces on 9130-DB and 9131-DB boards This patch enables eth0 10G interface on CN9130-DB paltforms and eth0 10G and eth3 10G interfaces on CN9131-DB. Signed-off-by: Stefan Chulski Signed-off-by: Konstantin Porotchkin Signed-off-by: Gregory CLEMENT commit 4c43a41e5b8ccbeee79330ae7989c301589d38c2 Author: Konstantin Porotchkin Date: Thu Jul 8 15:46:09 2021 +0300 arm64: dts: cn913x: add device trees for topology B boards The CN913x DB with topology B is similar to a regular setup (A) boards, but uses NAND flash as a boot device, while topology A boards are booting from SPI flash. Since NAND and SPI on CN913x DB boards share some wires, they cannot be activated simultaneously. The DTS files for setup "B" are based on setup "A", in which the CP0 NAND controller enabled and CP0 SPI1 disabled. Signed-off-by: Konstantin Porotchkin Signed-off-by: Gregory CLEMENT commit d9dd833cf6d29695682ec7e7924c0d0992b906bc Author: Archie Pusaka Date: Fri Jul 23 19:31:57 2021 +0800 Bluetooth: hci_h5: Add runtime suspend This patch allows the controller to suspend after a short period of inactivity. Signed-off-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Hilda Wu Signed-off-by: Marcel Holtmann commit 30f11dda2d25edcaae5ad34c4b953df4b2ba4faf Author: Archie Pusaka Date: Fri Jul 23 19:31:56 2021 +0800 Bluetooth: hci_h5: btrtl: Maintain flow control if wakeup is enabled For chips that doesn't reset on suspend, we need to provide the correct value of flow_control when it resumes. Therefore, store the flow control value when reading from the config file to be reused upon suspend. Signed-off-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Hilda Wu Signed-off-by: Marcel Holtmann commit 66f077dde74943e9dd84a9205b4951b19556c9ea Author: Archie Pusaka Date: Fri Jul 23 19:31:55 2021 +0800 Bluetooth: hci_h5: add WAKEUP_DISABLE flag Some RTL chips resets the FW on suspend, so wakeup is disabled on those chips. This patch introduces this WAKEUP_DISABLE flag so that chips that doesn't reset FW on suspend can leave the flag unset and is allowed to wake the host. This patch also left RTL8822 WAKEUP_DISABLE flag unset, therefore allowing it to wake the host, and preventing reprobing on resume. Signed-off-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Hilda Wu Signed-off-by: Marcel Holtmann commit a32ad90426a9c8eb3915eed26e08ce133bd9e0da Author: Austin Kim Date: Tue Jun 29 14:50:50 2021 +0100 IMA: remove -Wmissing-prototypes warning With W=1 build, the compiler throws warning message as below: security/integrity/ima/ima_mok.c:24:12: warning: no previous prototype for ‘ima_mok_init’ [-Wmissing-prototypes] __init int ima_mok_init(void) Silence the warning by adding static keyword to ima_mok_init(). Signed-off-by: Austin Kim Fixes: 41c89b64d718 ("IMA: create machine owner and blacklist keyrings") Cc: stable@vger.kernel.org Signed-off-by: Mimi Zohar commit c18c36dc75fefa8e1672d3ae2d565a9c7136d38d Author: Maxime Ripard Date: Tue Jul 20 16:35:44 2021 +0200 Documentation: gpu: Mention the requirements for new properties New KMS properties come with a bunch of requirements to avoid each driver from running their own, inconsistent, set of properties, eventually leading to issues like property conflicts, inconsistencies between drivers and semantics, etc. Let's document what we expect. Acked-by: Dave Airlie Reviewed-by: Pekka Paalanen Reviewed-by: Daniel Vetter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210720143544.571760-1-maxime@cerno.tech commit d475653672b730a30bd1391f68c98f450afaf725 Author: Nícolas F. R. A. Prado Date: Thu Jun 10 14:56:13 2021 -0300 dt-bindings: clk: Convert rockchip,rk3399-cru to DT schema Convert the rockchip,rk3399-cru binding to DT schema format. Tested with ARCH=arm64 make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.yaml ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.yaml Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210610175613.167601-1-nfraprado@collabora.com Signed-off-by: Heiko Stuebner commit f133717efc6f28052667daf682e99ffd4b3d7588 Author: Fabio Aiuto Date: Wed Jul 21 15:37:23 2021 +0200 staging: rtl8723bs: fix camel case in struct ndis_802_11_wep fix camel case in struct ndis_802_11_wep all over the driver. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/d3a1407e1bcb07d423dfa0c9bd33021a59bc0b61.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2ddaf7cf4d895a681f9009498a8c41ff4282c7cd Author: Fabio Aiuto Date: Wed Jul 21 15:37:22 2021 +0200 staging: rtl8723bs: remove unused struct ndis_801_11_ai_resfi remove unused struct ndis_801_11_ai_resfi. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/23f5764080f84e3704654b11db455e4d5ad499bb.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit bc512e8873cae7894dffcd94451df96dd70d931d Author: Fabio Aiuto Date: Wed Jul 21 15:37:21 2021 +0200 staging: rtl8723bs: remove unused struct ndis_802_11_ai_reqfi remove unused struct ndis_802_11_ai_reqfi. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/00ed84b66a0a325cb1a09ad6e2d2c0fa19686a88.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61ba4fae0a5d81d826810a32c0b30df319d1a925 Author: Fabio Aiuto Date: Wed Jul 21 15:37:20 2021 +0200 staging: rtl8723bs: fix camel case in IE structures fix camel case in IE structures all over the driver. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c1b36466fb5e17aa0dbbcdf6dfef3a82f9739c00.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit d7361874468f9b963d0263223c299f0afd7e51a7 Author: Fabio Aiuto Date: Wed Jul 21 15:37:19 2021 +0200 staging: rtl8723bs: fix camel case in struct wlan_bcn_info fix camel case in struct wlan_bcn_info all over the driver. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/52c74cf0183da44f2ddaac2607e4b7ccaf9abd91.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 631f42e9079382583831326f8db5fad6e10e36ee Author: Fabio Aiuto Date: Wed Jul 21 15:37:18 2021 +0200 staging: rtl8723bs: fix camel case in struct wlan_phy_info fix camel case in struct wlan_phy_info all over the driver. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/caadcfc157d62b633fd757d5696c1abce5ef9ae9.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6994aa430368ed0264205c045701908c6ad2dc3a Author: Fabio Aiuto Date: Wed Jul 21 15:37:17 2021 +0200 staging: rtl8723bs: fix camel case in struct ndis_802_11_ssid fix camel case in struct ndis_802_11_ssid all over the driver. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/e7c4cc09840e112d59ed7dcf8465f1916f95b819.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 81ec005b92a8a5083499257cb89a9f1ddc947e8c Author: Fabio Aiuto Date: Wed Jul 21 15:37:16 2021 +0200 staging: rtl8723bs: remove struct ndis_802_11_conf_fh all members of struct ndis_802_11_conf_fh fh_config in struct ndis_802_11_conf are set to zero and their values are never used. So remove struct ndis_802_11_conf_fh. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9c203ab5fe8a36b96f1f24e1fbf1a08ea0fa82af.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit d8b322b60da60f3d5957565d5db0d1dc18fe727b Author: Fabio Aiuto Date: Wed Jul 21 15:37:15 2021 +0200 staging: rtl8723bs: fix camel case in struct ndis_802_11_conf fix camel case in struct ndis_802_11_conf Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/90317df66de1476515bf46477ac097a73f35cf81.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit d3fcee1b78a533c256077f1300dd236801397cf7 Author: Fabio Aiuto Date: Wed Jul 21 15:37:14 2021 +0200 staging: rtl8723bs: fix camel case in struct wlan_bssid_ex fix camel case in struct wlan_bssid_ex. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/561065e95ff38f0dbedf030c3acf0498396a1759.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2a62ff13132a22a754d042b2230117bbea0af477 Author: Fabio Aiuto Date: Wed Jul 21 15:37:13 2021 +0200 staging: rtl8723bs: remove commented out condition remove commented out condition checking channel > 14. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/83762719c0c13ac8b78612a32db26e691eef17d1.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit ddd7c8b0033ba01a0ee605697f12a33fd31e6fca Author: Fabio Aiuto Date: Wed Jul 21 15:37:12 2021 +0200 staging: rtl8723bs: remove 5Ghz code blocks remove 5 Ghz code blocks, related to networks working over channel numbers above 14. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c64443b92ce1a60f568db153842a62e3244a8c3a.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0a1d0ebec6c74d043c3c7707b1c14388ab7c02a9 Author: Fabio Aiuto Date: Wed Jul 21 15:37:11 2021 +0200 staging: rtl8723bs: add spaces around operator fix the following post-commit hook checkpatch warning: CHECK: spaces preferred around that '+' (ctx:VxV) 29: FILE: drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2238: + hal_get_chnl_group_8723b(ch+1, &group); Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/e9f65e7600a3c935ef9c310e782790e04cc1f17f.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit ce9299678fa1638ffdcbdde96aaf7c19ce43e04a Author: Fabio Aiuto Date: Wed Jul 21 15:37:10 2021 +0200 staging: rtl8723bs: convert function name to snake case convert Hal_GetChnlGroup8723B() function name to snake case. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/78bbc5cb8531bc03eccfa2f67ee71979cbfbf12e.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1a0b06bff50f96b5436337e95a08d7f48564a4c0 Author: Fabio Aiuto Date: Wed Jul 21 15:37:09 2021 +0200 staging: rtl8723bs: fix camel case inside function fix camel case inside function Hal_GetChnlGroup8723B() Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/831b5f56cc6df8885ac61837fe53f63e021b289b.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d4c39b32361a7044eed1906e9a6d42ac1ebfabc Author: Fabio Aiuto Date: Wed Jul 21 15:37:08 2021 +0200 staging: rtl8723bs: simplify function selecting channel group simplify function Hal_GetChnlGroup8723B(). It returns an unused and unnecessary bool value telling which band the device works on. Since we work only on 2.4Ghz band and the useful return value is the second function argument we convert the return type to void. remove 5Ghz dead code either (for channel > 14). Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a5536788004c44fe819c0eab0d19504824af46cd.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8626e63eeea8fac24849c652c35c61e56f01b09b Author: Chris Morgan Date: Wed Jul 21 16:48:30 2021 -0500 drm/panfrost: devfreq: Don't display error for EPROBE_DEFER Set a condition for the message of "Couldn't set OPP regulators" to not display if the error code is EPROBE_DEFER. Note that I used an if statement to capture the condition instead of the dev_err_probe function because I didn't want to change the DRM_DEV_ERROR usage. Signed-off-by: Chris Morgan Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210721214830.25690-1-macroalpha82@gmail.com commit 81340cf3bddded4fe23a55148152e6d5e2460351 Author: Matthew Auld Date: Thu Jul 15 11:15:36 2021 +0100 drm/i915/uapi: reject set_domain for discrete The CPU domain should be static for discrete, and on DG1 we don't need any flushing since everything is already coherent, so really all this does is an object wait, for which we have an ioctl. Longer term the desired caching should be an immutable creation time property for the BO, which can be set with something like gem_create_ext. One other user is iris + userptr, which uses the set_domain to probe all the pages to check if the GUP succeeds, however we now have a PROBE flag for this purpose. v2: add some more kernel doc, also add the implicit rules with caching Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Ramalingam C Acked-by: Kenneth Graunke Link: https://patchwork.freedesktop.org/patch/msgid/20210715101536.2606307-5-matthew.auld@intel.com commit 9bd9e0de1cf5b89c4854be505ac0a418ddcc01bf Author: Mauro Carvalho Chehab Date: Fri Jul 23 09:40:06 2021 +0200 mfd: hi6421-spmi-pmic: move driver from staging This driver is ready for mainstream. So, move it out of staging. Acked-by: Lee Jones Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/dd150f3ffa19c2dda0171f7dbe1dd63cce2a7af5.1627025657.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit 86ce91d5568de02f92ab9d4fb507683f8429a3e2 Author: Petr Mladek Date: Fri Jul 23 09:25:30 2021 +0200 MIPS/asm/printk: Fix build failure caused by printk The commit 337015573718b161 ("printk: Userspace format indexing support") caused the following build failure: arch/mips/kernel/genex.o: In function `handle_mcheck_int': (.text+0x190c): undefined reference to `printk' arch/mips/kernel/genex.o: In function `handle_reserved_int': (.text+0x1c8c): undefined reference to `printk' Fixes: 337015573718b161 ("printk: Userspace format indexing support") Reported-by: Stephen Rothwell Suggested-by: Chris Down Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/YPbBfdz9srIpI+bb@chrisdown.name commit c3cdc019a6bf03c4bf06fe8252db96eb6e4a3b5f Author: Deepak R Varma Date: Fri Apr 30 17:40:12 2021 +0200 media: atomisp: pci: reposition braces as per coding style Misplaced braces makes it difficult to follow the code easily. This also goes against the code style guidelines. This resolved following checkpatch complaints: ERROR: open brace '{' following function definitions go on the next line ERROR: that open brace { should be on the previous line Link: https://lore.kernel.org/linux-media/YIwk3KbVGRPJwKa4@dU2104 [mchehab: dropped a hunk with a merge conflict] Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, drv@mailo.com # X-LSpam-Score: -7.3 (-------) Signed-off-by: Deepak R Varma Signed-off-by: Mauro Carvalho Chehab commit f83f86e72622f46796fe5aed7fee980c543e4010 Author: Martiros Shakhzadyan Date: Mon Jul 19 07:52:16 2021 +0200 media: atomisp: i2c: Remove a superfluous else clause in atomisp-mt9m114.c Remove a superfluous clause in mt9m114_s_power() Link: https://lore.kernel.org/linux-media/20210719055216.28508-1-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit a5e5ceae597ba1df8a2a5720f80bf690c96805b0 Author: Andy Shevchenko Date: Tue Jul 13 17:25:22 2021 +0200 media: atomisp: Move MIPI_PORT_LANES to the only user Move MIPI_PORT_LANES to the only user of it, i.e. pci/runtime/isys/src/rx.c. Link: https://lore.kernel.org/linux-media/20210713152523.19902-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 69aa1deeab47a47f1e7876fabb76e1e11496c418 Author: Kees Cook Date: Sun Jul 11 16:51:01 2021 +0200 media: atomisp: Perform a single memset() for union There is no need to memset() both dvs_grid_info and dvs_stat_grid_info separately: they are part of the same union. Instead, just zero the union itself. This additionally avoids a false positive (due to a gcc optimization bug[1]) when building with the coming FORTIFY_SOURCE improvements: In function 'fortify_memset_chk', inlined from 'sh_css_pipe_get_grid_info' at drivers/staging/media/atomisp/pci/sh_css.c:5186:3, inlined from 'ia_css_stream_create' at drivers/staging/media/atomisp/pci/sh_css.c:9442:10: ./include/linux/fortify-string.h:199:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 199 | __write_overflow_field(); | ^~~~~~~~~~~~~~~~~~~~~~~~ [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101419 Link: https://lore.kernel.org/linux-media/20210711145101.1434065-1-keescook@chromium.org Signed-off-by: Kees Cook Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d27f346aa98fa8ba4fc6aa056240969ab34f9450 Author: Yang Yingliang Date: Thu Jun 17 09:23:29 2021 +0200 media: atomisp: pci: fix error return code in atomisp_pci_probe() If init_atomisp_wdts() fails, atomisp_pci_probe() need return error code. Link: https://lore.kernel.org/linux-media/20210617072329.1233662-1-yangyingliang@huawei.com Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Mauro Carvalho Chehab commit 454a6232e294e20fc339d05fcae18074df40757b Author: Fabio M. De Francesco Date: Sat Jun 5 04:08:55 2021 +0200 media: atomisp: pci: Remove unnecessary (void *) cast Removed an unnecessary (void *) cast for an argument passed to kfree(). Link: https://lore.kernel.org/linux-media/20210605020855.1065-3-fmdefrancesco@gmail.com Suggested-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Signed-off-by: Mauro Carvalho Chehab commit 1c6edb2831d941d5c14f7d2ac3f3f82655a560b4 Author: Fabio M. De Francesco Date: Thu May 27 21:39:22 2021 +0200 media: atomisp: pci: Remove checks before kfree/kvfree Removed checks for pointers != NULL before freeing memory. If kvfree() and kfree() are given NULL pointers no operations are performed, so there is no need for the above-mentioned checks. Coccinelle detected the second of the two unnecessary checks. Link: https://lore.kernel.org/linux-media/20210527193922.25225-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 693064eafa9e4b7ab81b97d7349b6c7edb292011 Author: Andy Shevchenko Date: Wed May 26 14:43:22 2021 +0200 media: atomisp: Remove unused port_enabled variable Remove unused port_enabled variable in ia_css_isys_rx_configure(). Link: https://lore.kernel.org/linux-media/20210526124322.48915-6-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit dbe93bc9706356799c8aac9fe3d6a132a5a6ec4c Author: Andy Shevchenko Date: Wed May 26 14:43:20 2021 +0200 media: atomisp: Annotate a couple of definitions with __maybe_unused There are definitions in the header that are not used by all modules inside the driver. Annotate them with __maybe_unused to avoid compiler warnings. Link: https://lore.kernel.org/linux-media/20210526124322.48915-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 85001df54b5f0dda164655e038aebee8b037c031 Author: Andy Shevchenko Date: Wed May 26 14:43:19 2021 +0200 media: atomisp: Remove unused declarations There is a few static declarations that are not used anywhere, remove them. Link: https://lore.kernel.org/linux-media/20210526124322.48915-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 0ae19e8c0866f170cb43170735b95f061e245b5a Author: Shaokun Zhang Date: Tue May 25 08:02:39 2021 +0200 media: atomisp: remove the repeated declaration Function 'ia_css_mmu_invalidate_cache' is declared twice, remove the repeated declaration. Link: https://lore.kernel.org/linux-media/1621922559-1859-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Shaokun Zhang Signed-off-by: Mauro Carvalho Chehab commit 280355522d61d106e52cf0536dcf2807a15aec37 Author: Tom Rix Date: Fri May 21 21:48:05 2021 +0200 media: atomisp: improve error handling in gc2235_detect() Static analysis reports this representative problem atomisp-gc2235.c:867:20: warning: The right operand of '|' is a garbage value id = ((high << 8) | low); ^ ~~~ When gc2235_read_reg() fails, its return val is never written. For gc2235_detect(), high and low are or-ed and compared with GC2235_ID, 0x2235. Initialize both to 0 and skip checking the read returns, it's errors are not passed up, only -ENODEV is. Link: https://lore.kernel.org/linux-media/20210521194805.2078135-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Mauro Carvalho Chehab commit 6bdad3bb7eb1d91e10998eb21b6f9159064b53af Author: Aniket Bhattacharyea Date: Mon May 24 19:36:09 2021 +0200 media: atomisp: Fix whitespace at the beginning of line This patch fixes whitespace at the beginning of line by wrapping after the type name and aligning the arguments with the open parenthesis. Identified by checkpatch: WARNING: please, no spaces at the start of a line. Link: https://lore.kernel.org/linux-media/20210524173609.672153-1-aniketmail669@gmail.com Signed-off-by: Aniket Bhattacharyea Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b09ea938621416abf5b05f73d37d2e6b8ed2a997 Author: Jiabing Wan Date: Tue May 18 13:29:35 2021 +0200 media: atomisp: Align block comments Fixing the following checkpatch warning: WARNING: Block comments should align the * on each line Link: https://lore.kernel.org/linux-media/20210518112938.88240-1-wanjiabing@vivo.com Signed-off-by: Jiabing Wan Signed-off-by: Mauro Carvalho Chehab commit e53656ab8c806b26f85238af341d93e6792d1ee6 Author: Nguyen Dinh Phi Date: Thu May 13 05:46:50 2021 +0200 media: atomisp: Use sysfs_emit() instead of sprintf() where appropriate sysfs_emit() is preferred over raw sprintf() for sysfs attributes since it knows about the sysfs buffer specifics and has some built-in sanity checks. Link: https://lore.kernel.org/linux-media/20210513034650.252993-1-phind.uet@gmail.com Signed-off-by: Nguyen Dinh Phi Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 66b22424ad271d762948da0fda55b21d08327029 Author: Martiros Shakhzadyan Date: Sun May 9 01:56:22 2021 +0200 media: atomisp: Fix line continuation style issue in sh_css.c Fix logical continuation style issue and adjacent line splits. Link: https://lore.kernel.org/linux-media/20210508235622.300394-5-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit d2f3009e86fdad199d3c376baddfb2c987d7df1c Author: Martiros Shakhzadyan Date: Sun May 9 01:56:21 2021 +0200 media: atomisp: Use kcalloc instead of kzalloc with multiply in sh_css.c Use kcalloc instead of kzalloc with multiplication. Link: https://lore.kernel.org/linux-media/20210508235622.300394-4-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit a93cf5a5058495877e226fc2f3b9560deae5ff2d Author: Martiros Shakhzadyan Date: Sun May 9 01:56:20 2021 +0200 media: atomisp: Remove unnecessary parens in sh_css.c Remove unnecessary parenthesis. Link: https://lore.kernel.org/linux-media/20210508235622.300394-3-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 9e77871a59c86d71e9821dcc5f57a4461bfff1ee Author: Martiros Shakhzadyan Date: Sun May 9 01:56:19 2021 +0200 media: atomisp: Resolve goto style issue in sh_css.c Change the goto label to lower case. Remove a space in the goto label. Link: https://lore.kernel.org/linux-media/20210508235622.300394-2-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 0c980e3f5276ba2eb95c42919c5f1694e38ef86a Author: Yizhuo Date: Fri Jun 25 07:38:56 2021 +0200 media: atomisp: fix the uninitialized use and rename "retvalue" Inside function mt9m114_detect(), variable "retvalue" could be uninitialized if mt9m114_read_reg() returns error, however, it is used in the later if statement, which is potentially unsafe. The local variable "retvalue" is renamed to "model" to avoid confusion. Link: https://lore.kernel.org/linux-media/20210625053858.3862-1-yzhai003@ucr.edu Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"") Signed-off-by: Yizhuo Signed-off-by: Mauro Carvalho Chehab commit 821720b9f34ec54106ebf012a712ba73bbcf47c2 Author: Ard Biesheuvel Date: Fri Jul 16 18:54:03 2021 +0200 crypto: x86/aes-ni - add missing error checks in XTS code The updated XTS code fails to check the return code of skcipher_walk_virt, which may lead to skcipher_walk_abort() or skcipher_walk_done() being called while the walk argument is in an inconsistent state. So check the return value after each such call, and bail on errors. Fixes: 2481104fe98d ("crypto: x86/aes-ni-xts - rewrite and drop indirections via glue helper") Reported-by: Dave Hansen Reported-by: syzbot Signed-off-by: Ard Biesheuvel Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu commit ac04da5c7bca929bd0f2e6b32182d8c95a3f89e2 Author: Christoph Niedermaier Date: Wed Jul 14 23:07:08 2021 +0200 ARM: dts: imx6q-dhcom: Set minimum memory size of all DHCOM i.MX6 variants The minimum available memory size of all DHCOM i.MX6 variants is 512 MB. Set this value for the memory node. If U-Boot fails to fill the memory size, at least all DHCOM i.MX6 variants should run without problems. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 0daad458e2fc92246e0a8f25741c8e9129fb1f63 Author: Christoph Niedermaier Date: Wed Jul 14 23:07:07 2021 +0200 ARM: dts: imx6q-dhcom: Remove ddc-i2c-bus property An EDID lookup is not needed with this panel. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 10dd9a8a5f7ec6799fc48548623b4fa58dc000bf Merge: e460a86aab669 eaf89f1cd38cf Author: Krzysztof Kozlowski Date: Fri Jul 23 08:26:39 2021 +0200 Merge branch 'for-v5.15/tegra-mc' into for-next commit e460a86aab669e00c5952a7643665f3096fbfe27 Author: Mauro Carvalho Chehab Date: Thu Jul 22 12:00:10 2021 +0200 MAINTAINERS: update arm,pl353-smc.yaml reference The file name: Documentation/devicetree/bindings/mtd/arm,pl353-smc.yaml should be, instead: Documentation/devicetree/bindings/memory-controllers/arm,pl353-smc.yaml. Update its cross-reference accordingly. Fixes: 813d52799ad2 ("MAINTAINERS: Add PL353 SMC entry") Fixes: d3d0e1e85711 ("dt-binding: memory: pl353-smc: Convert to yaml") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1a9b26e4f9f7a01bcd676d7e7a3a929085fc2adb.1626947923.git.mchehab+huawei@kernel.org Signed-off-by: Krzysztof Kozlowski commit eaf89f1cd38cf7256ab64424fe94014632044d57 Author: Arnd Bergmann Date: Thu Jul 22 11:07:43 2021 +0200 memory: tegra: fix unused-function warning The tegra186_mc_client_sid_override() is only called from an #ifdef block: drivers/memory/tegra/tegra186.c:74:13: error: 'tegra186_mc_client_sid_override' defined but not used [-Werror=unused-function] 74 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add another #ifdef around the called function. Fixes: 393d66fd2cac ("memory: tegra: Implement SID override programming") Signed-off-by: Arnd Bergmann Acked-by: Jon Hunter Link: https://lore.kernel.org/r/20210722090748.1157470-1-arnd@kernel.org Signed-off-by: Krzysztof Kozlowski commit caa15c8dcb00f9dfe9f304e6e0955c5b29cf2499 Author: Pierre-Louis Bossart Date: Mon Jul 19 18:32:47 2021 -0500 soundwire: dmi-quirks: add quirk for Intel 'Bishop County' NUC M15 The same quirk is used for LAPBC510 and LAPBC710 skews who use the same audio design. These devices have the same BIOS issues inherited from the Intel reference, add the same _ADR remap previously used on HP devices. BugLink: https://github.com/thesofproject/linux/issues/3049 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20210719233248.557923-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul commit 1d904eaf3f99565bdeffbed359e44dd88efbef02 Author: Hyunchul Lee Date: Fri Jul 23 13:01:06 2021 +0900 ksmbd: fix -Wstringop-truncation warnings Kernel test bot reports the following warnings: In function 'ndr_write_string', inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:136:3: >> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' destination unchanged after copying no bytes [-Wstringop-truncation] 70 | strncpy(PAYLOAD_HEAD(n), value, sz); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'ndr_write_string', inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:134:3: >> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 70 | strncpy(PAYLOAD_HEAD(n), value, sz); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ksmbd/ndr.c: In function 'ndr_encode_dos_attr': fs/ksmbd/ndr.c:134:3: note: length computed here 134 | ndr_write_string(n, hex_attr, strlen(hex_attr)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 654c8876f93677915b1a009bc7f2421ab8750bf1 Author: Marios Makassikis Date: Fri Jul 23 12:58:41 2021 +0900 ksmbd: Fix potential memory leak in tcp_destroy_socket() ksmbd_socket must be freed even if kernel_sock_shutdown() somehow fails. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 377b50926d364f1754355f33a718f77fb3c409f6 Author: Christoph Niedermaier Date: Wed Jul 14 23:07:04 2021 +0200 ARM: dts: imx6q-dhcom: Add keys and leds to the PDK2 board On the PDK2 there are 4 keys and 4 leds. DHCOM GPIOs are used for that, but one led isn't useable, because the GPIO is already used as touch interrupt. Signed-off-by: Christoph Niedermaier Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit fccf2b401e13f98afe954e0227507e604f35166a Author: Christoph Niedermaier Date: Wed Jul 14 23:07:03 2021 +0200 ARM: dts: imx6q-dhcom: Align stdout-path with other DHCOM SoMs Set stdout-path to "serial0:15200n8" to align it with other DHCOM SoMs like the DHCOM STM32MP1. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit cd35bf9dd94c3d071bb0d9eea20966e043ac1e9e Author: Christoph Niedermaier Date: Wed Jul 14 23:07:02 2021 +0200 ARM: dts: imx6q-dhcom: Adding Wake pin to the PCIe pinctrl The pin CSI0_DATA_EN is reserved for PCIe Wake. Move this pin to the SoM devicetree. Add PCIe Reset GPIO to the board devicetree. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit e0dff0fe0bb9cd9fcbd9b65e131e88a31e476539 Author: Christoph Niedermaier Date: Wed Jul 14 23:07:01 2021 +0200 ARM: dts: imx6q-dhcom: Fill GPIO line names on DHCOM SoM Fill in the custom GPIO line names used by DH on the DHCOM SoM. The GPIO line names are in accordance to DHCOM Design Guide R04 available at [1], section 3.9 GPIO. Adding also GPIO line names for the hardware and memory coding. [1] https://wiki.dh-electronics.com/images/5/52/DOC_DHCOM-Design-Guide_R04_2018-06-28.pdf Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit dd720c7e1867bd74a1a22bc5a5e8e3af123cfcc4 Author: Christoph Niedermaier Date: Wed Jul 14 23:07:00 2021 +0200 ARM: dts: imx6q-dhcom: Add interrupt and compatible to the ethernet PHY Enable the interrupt mode for the ethernet PHY by adding the necessary property and a separate pinctrl for the PHY. Also add the compatible property for it. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 2af8a617b14da9e95ffb3ec07b6b8c3a0a4fff6b Author: Christoph Niedermaier Date: Wed Jul 14 23:06:59 2021 +0200 ARM: dts: imx6q-dhcom: Add the parallel system bus Add the parallel system bus provided by the i.MX6 WEIM interface via an address latch. The OE pin of the latch is controlled by a fixed regulator. The pin is low active. This is ensured by omitting the regulators property enable-active-high. The flags value of the gpio property (3rd value), which is also use to define active high/low, is set to 0 because it is ignored by gpiolib-of.c. Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Cc: Shawn Guo Cc: Fabio Estevam Cc: Marek Vasut Cc: NXP Linux Team Cc: kernel@dh-electronics.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit ffd1e072594f319b94a0ca9f8602050ef6e404fc Author: Christoph Niedermaier Date: Wed Jul 14 22:22:52 2021 +0200 dt-bindings: arm: fsl: Add DHCOM PicoITX and DHCOM DRC02 boards Add DH electronics DHCOM PicoITX and DHCOM DRC02 boards. The DHCOM DRC02 device can only house a SOM with iMX6S and not with iMX6DL, due to some thermal design consideration. But for compatible fsl,imx6dl is chosen, because fsl,imx6s isn't available, the iMX6S is basically a iMX6DL with one CPU core disabled and therefore the kernel discerns the iMX6S/iMX6DL automatically. Signed-off-by: Christoph Niedermaier Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: robh+dt@kernel.org Cc: Shawn Guo Cc: kernel@dh-electronics.com Cc: Fabio Estevam To: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 4e2b10be1f4fe06c9deaaf2c03a05abcff191791 Author: Robin Gong Date: Wed Jul 14 18:20:52 2021 +0800 dmaengine: imx-sdma: add terminated list for freed descriptor in worker Add terminated list for keeping descriptor so that it could be freed in worker without any potential involving next descriptor raised up before this descriptor freed, because vchan_get_all_descriptors get all descriptors including the last terminated descriptor and the next descriptor, hence, the next descriptor maybe freed unexpectly when it's done in worker without this patch. https://www.spinics.net/lists/dmaengine/msg23367.html Signed-off-by: Robin Gong Reported-by: Richard Leitner Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit b98ce2f4e32befa4999e180f48031d814f2a401c Author: Robin Gong Date: Wed Jul 14 18:20:51 2021 +0800 dmaengine: imx-sdma: add uart rom script For the compatibility of NXP internal legacy kernel before 4.19 which is based on uart ram script and upstreaming kernel based on uart rom script, add both uart ram/rom script in latest sdma firmware. By default uart rom script used. Besides, add two multi-fifo scripts for SAI/PDM on i.mx8m/8mm and add back qspi script miss for v4(i.mx7d/8m/8mm family, but v3 is for i.mx6). rom script: uart_2_mcu_addr uartsh_2_mcu_addr /* through spba bus */ am script: uart_2_mcu_ram_addr uartsh_2_mcu_ram_addr /* through spba bus */ Please get latest sdma firmware from the below and put them into the path (/lib/firmware/imx/sdma/): https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git /tree/imx/sdma Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Vinod Koul Signed-off-by: Shawn Guo commit 04d21cc278e0d308356a087ff2aadccd97442486 Author: Robin Gong Date: Wed Jul 14 18:20:50 2021 +0800 dma: imx-sdma: add i.mx6ul compatible name Add i.mx6ul compatible name in binding doc. Signed-off-by: Robin Gong Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 4852e9a299ba3eee479a3cbbd7621af55f39b29a Author: Robin Gong Date: Wed Jul 14 18:20:49 2021 +0800 dmaengine: imx-sdma: remove ERR009165 on i.mx6ul ECSPI issue fixed from i.mx6ul at hardware level, no need ERR009165 anymore on those chips such as i.mx8mq. Signed-off-by: Robin Gong Acked-by: Vinod Koul Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 8eb1252bbedfb0e800bbbd3e9055a7db0ae2cac9 Author: Robin Gong Date: Wed Jul 14 18:20:48 2021 +0800 spi: imx: remove ERR009165 workaround on i.mx6ul ERR009165 fixed on i.mx6ul/6ull/6sll. All other i.mx6/7 and i.mx8m/8mm still need this errata. Please refer to nxp official errata document from https://www.nxp.com/ . For removing workaround on those chips. Add new i.mx6ul type. Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Mark Brown Signed-off-by: Shawn Guo commit 980f884866eed4dda2a18de888c5a67dde67d640 Author: Robin Gong Date: Wed Jul 14 18:20:47 2021 +0800 spi: imx: fix ERR009165 Change to XCH mode even in dma mode, please refer to the below errata: https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Mark Brown Signed-off-by: Shawn Guo commit a4965888e64ec927110cbf6a3c396d2355931a4a Author: Robin Gong Date: Wed Jul 14 18:20:46 2021 +0800 dmaengine: imx-sdma: add mcu_2_ecspi script Add mcu_2_ecspi script to fix ecspi errata ERR009165. Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Vinod Koul Signed-off-by: Shawn Guo commit e8fafa50645c223e4b8693595c43f98a5b16fe22 Author: Robin Gong Date: Wed Jul 14 18:20:45 2021 +0800 dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Add 'fw_loaded' and 'is_ram_script' to check if the script used by channel is ram script and it's loaded or not, so that could prevent meaningless following malloc dma descriptor and bd allocate in sdma_transfer_init(), otherwise memory may be consumed out potentially without free in case that spi fallback into pio while dma transfer failed by sdma firmware not ready(next ERR009165 patch depends on sdma RAM scripts/firmware). Signed-off-by: Robin Gong Acked-by: Vinod Koul Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit e555a03b112838883fdd8185d613c35d043732f2 Author: Robin Gong Date: Wed Jul 14 18:20:44 2021 +0800 dmaengine: imx-sdma: remove duplicated sdma_load_context Since sdma_transfer_init() will do sdma_load_context before any sdma transfer, no need once more in sdma_config_channel(). Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") Cc: Signed-off-by: Robin Gong Acked-by: Vinod Koul Tested-by: Richard Leitner Signed-off-by: Shawn Guo commit 8592f02464d52776c5cfae4627c6413b0ae7602d Author: Robin Gong Date: Wed Jul 14 18:20:43 2021 +0800 Revert "dmaengine: imx-sdma: refine to load context only once" This reverts commit ad0d92d7ba6aecbe2705907c38ff8d8be4da1e9c, because in spi-imx case, burst length may be changed dynamically. Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") Cc: Signed-off-by: Robin Gong Acked-by: Sascha Hauer Tested-by: Richard Leitner Signed-off-by: Shawn Guo commit 394e1fb847a490340dde479ff28965b5cc92cc83 Author: Robin Gong Date: Wed Jul 14 18:20:42 2021 +0800 Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'dd4b487b32a3' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer Signed-off-by: Shawn Guo commit affd9bfabc0f4ed40aa3346bd25e1aeb74d7a327 Author: Robin Gong Date: Wed Jul 14 18:20:41 2021 +0800 Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'df07101e1c4a' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer Signed-off-by: Shawn Guo commit da97553ec6e1ba229f5b90c0e25799ea8afede51 Author: Jiri Olsa Date: Wed Jul 21 23:58:10 2021 +0200 libbpf: Export bpf_program__attach_kprobe_opts function Export bpf_program__attach_kprobe_opts as a public API. Rename bpf_program_attach_kprobe_opts to bpf_kprobe_opts and turn it into OPTS struct. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Tested-by: Alan Maguire Link: https://lore.kernel.org/bpf/20210721215810.889975-4-jolsa@kernel.org commit e3f9bc35ea7e9871667d7f769cf0079211828e89 Author: Jiri Olsa Date: Wed Jul 21 23:58:09 2021 +0200 libbpf: Allow decimal offset for kprobes Allow to specify decimal offset in SEC macro, like: SEC("kprobe/bpf_fentry_test7+5") Add selftest for that. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Tested-by: Alan Maguire Link: https://lore.kernel.org/bpf/20210721215810.889975-3-jolsa@kernel.org commit 1f71a468a75ff4f13c55966c74284aa4a6bcc334 Author: Jiri Olsa Date: Wed Jul 21 23:58:08 2021 +0200 libbpf: Fix func leak in attach_kprobe Add missing free() for func pointer in attach_kprobe function. Fixes: a2488b5f483f ("libbpf: Allow specification of "kprobe/function+offset"") Reported-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Tested-by: Alan Maguire Link: https://lore.kernel.org/bpf/20210721215810.889975-2-jolsa@kernel.org commit d8075e9490309d8f0d50869987a9e1d9426e9e4f Author: Alistair Francis Date: Tue Jul 6 21:40:28 2021 +1000 ARM: dts: imx7d-remarkable2: Add WiFi support Add support for the bcm4329-fmac WiFi in the reMarkable 2, connected via SDHC. Signed-off-by: Alistair Francis Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5b9829e3092bcd3a61f2e3665f4631b2ab6d2048 Author: Tim Harvey Date: Thu Jul 1 11:06:33 2021 -0700 ARM: dts: imx6qdl-gw5904: atecc508a support Add one node for the Atmel ATECC508A 'CryptoAuthentication' i2c device. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 7f30daf81d385ab5b9b69fb87b9d963b84d2e6dd Author: Tim Harvey Date: Thu Jul 1 11:00:57 2021 -0700 ARM: dts: imx6qdl-gw5xxx: add missing USB OTG OC pinmux Add USB OTG over-current pinmux to the GW51xx/GW52xx/GW54xx/GW553x boards. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit eea97e42f48bff0706b620730799b5057c9caf90 Author: Tvrtko Ursulin Date: Wed Jul 21 15:30:30 2021 -0700 drm/i915/xehp: VDBOX/VEBOX fusing registers are enable-based On Xe_HP the fusing register is renamed and changed to have the "enable" semantics, but otherwise remains compatible (mmio address, bitmask ranges) with older platforms. To simplify things we do not add a new register definition but just stop inverting the fusing masks before processing them. Bspec: 52615 Cc: Daniele Ceraolo Spurio Signed-off-by: Tvrtko Ursulin Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-6-matthew.d.roper@intel.com commit 8da49a33dda7294c1af508f8aa81cd638d0afd62 Merge: 588b3eee52887 474596fc749ca Author: Dave Airlie Date: Fri Jul 23 11:31:50 2021 +1000 Merge tag 'drm-misc-next-2021-07-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.15-rc1: UAPI Changes: - Remove sysfs stats for dma-buf attachments, as it causes a performance regression. Previous merge is not in a rc kernel yet, so no userspace regression possible. Cross-subsystem Changes: - Sanitize user input in kyro's viewport ioctl. - Use refcount_t in fb_info->count - Assorted fixes to dma-buf. - Extend x86 efifb handling to all archs. - Fix neofb divide by 0. - Document corpro,gm7123 bridge dt bindings. Core Changes: - Slightly rework drm master handling. - Cleanup vgaarb handling. - Assorted fixes. Driver Changes: - Add support for ws2401 panel. - Assorted fixes to stm, ast, bochs. - Demidlayer ingenic irq. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/2d0d2fe8-01fc-e216-c3fd-38db9e69944e@linux.intel.com commit 265b5ee0d32bbb3439bfcce8a7b60ec2f4c0acc5 Author: Lucas De Marchi Date: Tue Jul 20 16:20:13 2021 -0700 drm/i915/gt: rename legacy engine->hw_id to engine->gen6_hw_id We kept adding new engines and for that increasing hw_id unnecessarily: it's not used since GRAPHICS_VER == 8. Prepend "gen6" to the field and try to pack it in the structs to give a hint this field is actually not used in recent platforms. Signed-off-by: Lucas De Marchi Reviewed-by: Tvrtko Ursulin Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210720232014.3302645-4-lucas.demarchi@intel.com commit f9be30003fb372387565dcb9789b286f51e6e808 Author: Lucas De Marchi Date: Tue Jul 20 16:20:12 2021 -0700 drm/i915/gt: nuke unused legacy engine hw_id The engine hw_id is only used by RING_FAULT_REG(), which is not used by GRAPHICS_VER >= 8. We did use hw_id on recent platforms to set the engine's guc_id, but that is not the case anymore since commit c784e5249e77 ("drm/i915/guc: Update to use firmware v49.0.1"): now we only use class and id information to generate guc_id. We tend to keep adding new defines just to be consistent, but let's try to remove them and let them defined to 0 for engines that only exist on gen8+ platforms. v2: Reword commit message and add information about when we stopped using hw_id (Matt Roper) Signed-off-by: Lucas De Marchi Reviewed-by: Tvrtko Ursulin Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210720232014.3302645-3-lucas.demarchi@intel.com commit 7894375e27039ab0c4da147ee294209f411c9e28 Author: Lucas De Marchi Date: Tue Jul 20 16:20:11 2021 -0700 drm/i915/gt: fix platform prefix gen8_clear_engine_error_register() is actually not used by GRAPHICS_VER >= 8, since for those we are using another register that is not engine-dependent. Fix the platform prefix, to make clear we are not using any GEN6_RING_FAULT_REG_* one GRAPHICS_VER >= 8. Signed-off-by: Lucas De Marchi Reviewed-by: Tvrtko Ursulin Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210720232014.3302645-2-lucas.demarchi@intel.com commit 9907442fcddbdacf55fa22e31f2306ae0d6172d6 Author: Martynas Pumputis Date: Wed Jul 21 16:09:41 2021 +0200 selftests/bpf: Mute expected invalid map creation error msg Previously, the newly introduced test case in test_map_in_map(), which checks whether the inner map is destroyed after unsuccessful creation of the outer map, logged the following harmless and expected error: libbpf: map 'mim': failed to create: Invalid argument(-22) libbpf: failed to load object './test_map_in_map_invalid.o' To avoid any possible confusion, mute the logging during loading of the prog. Fixes: 08f71a1e39a1 ("selftests/bpf: Check inner map deletion") Reported-by: Andrii Nakryiko Signed-off-by: Martynas Pumputis Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721140941.563175-1-m@lambda.lt commit 724f17b7d45d62c71e92471666647a823cb9baa9 Author: Colin Ian King Date: Wed Jul 21 12:56:30 2021 +0100 bpf: Remove redundant intiialization of variable stype The variable stype is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721115630.109279-1-colin.king@canonical.com commit 16c5900ba776c5acd6568abd60c40f948a96e496 Author: Arnd Bergmann Date: Wed Jul 21 23:19:45 2021 +0200 bpf: Fix pointer cast warning kp->addr is a pointer, so it cannot be cast directly to a 'u64' when it gets interpreted as an integer value: kernel/trace/bpf_trace.c: In function '____bpf_get_func_ip_kprobe': kernel/trace/bpf_trace.c:968:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 968 | return kp ? (u64) kp->addr : 0; Use the uintptr_t type instead. Fixes: 9ffd9f3ff719 ("bpf: Add bpf_get_func_ip helper for kprobe programs") Signed-off-by: Arnd Bergmann Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210721212007.3876595-1-arnd@kernel.org commit 64832df2ac056f111b51aaebbe54a996e0fce7f1 Author: Aaron Ma Date: Fri Jul 23 01:17:18 2021 +0800 Bluetooth: btusb: Add support for Foxconn Mediatek Chip Add support for another Foxconn / Hon Hai device with MT7921 chip. T: Bus=05 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0cd 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: Aaron Ma Signed-off-by: Marcel Holtmann commit e73db72732dcb1bf3d8b1428f16616bbc263e509 Author: Anusha Srivatsa Date: Wed Jul 21 14:52:38 2021 -0700 drm/i915/firmware: Update to DMC v2.03 on RKL Add support to load latest DMC version. The Release Notes mentions that this version fixes timeout issues. Cc: Madhumitha Pradeep Signed-off-by: Anusha Srivatsa Reviewed-by: Madhumitha Pradeep Link: https://patchwork.freedesktop.org/patch/msgid/20210721215238.24980-4-anusha.srivatsa@intel.com commit f6f2425a8e2d45a34b02d9d3e1a828bf0f498196 Author: Anusha Srivatsa Date: Wed Jul 21 14:52:37 2021 -0700 drm/i915/firmware: Update to DMC v2.12 on TGL Add support to the latest DMC firmware. Cc: Madhunitha Pradeep Signed-off-by: Anusha Srivatsa Reviewed-by: Madhumitha Pradeep Link: https://patchwork.freedesktop.org/patch/msgid/20210721215238.24980-3-anusha.srivatsa@intel.com commit f3ba1e90eb54a263151231bfd7ab3cf604502305 Author: Anusha Srivatsa Date: Wed Jul 21 14:52:36 2021 -0700 drm/i915/dmc: Change intel_get_stepping_info() Lets use RUNTIME_INFO->step since all platforms now have their stepping info in intel_step.c. This makes intel_get_stepping_info() a lot simpler. Cc: Lucas De Marchi Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210721215238.24980-2-anusha.srivatsa@intel.com commit e631a440c03c658eab1159ddc701d5a579f9c5b3 Author: Anusha Srivatsa Date: Wed Jul 21 14:52:35 2021 -0700 drm/i915/step: Add macro magic for handling steps With the addition of stepping info for all platforms, lets use macros for handling them and autogenerating code for all steps at a time. Suggested-by: Matt Roper Cc: Lucas De Marchi Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210721215238.24980-1-anusha.srivatsa@intel.com commit e03b59064be4665a44963c1034246ab7ca39151a Author: Matthew Brost Date: Wed Jul 21 14:51:01 2021 -0700 drm/i915: Add intel_context tracing Add intel_context tracing. These trace points are particular helpful when debugging the GuC firmware and can be enabled via CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS kernel config option. Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-19-matthew.brost@intel.com commit dbf9da8d55efd55c0f8ad448fb997410a33c2c75 Author: Matthew Brost Date: Wed Jul 21 14:51:00 2021 -0700 drm/i915/guc: Add trace point for GuC submit Add trace point for GuC submit. Extended existing request trace points to include submit fence value,, guc_id, and ring tail value. v2: Fix white space alignment in i915_request_add trace point v3: Delete dep_from , dep_to (Tvrtko) Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-18-matthew.brost@intel.com commit 28ff6520a34d6539064c4b8b5c0f0fded125a779 Author: Matthew Brost Date: Wed Jul 21 14:50:59 2021 -0700 drm/i915/guc: Update GuC debugfs to support new GuC Update GuC debugfs to support the new GuC structures. v2: (John Harrison) - Remove intel_lrc_reg.h include from i915_debugfs.c (Michal) - Rename GuC debugfs functions Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-17-matthew.brost@intel.com commit b97060a99b01b4d706b87df450b69f82962d2fba Author: Matthew Brost Date: Wed Jul 21 14:50:58 2021 -0700 drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC When running the GuC the GPU can't be considered idle if the GuC still has contexts pinned. As such, a call has been added in intel_gt_wait_for_idle to idle the UC and in turn the GuC by waiting for the number of unpinned contexts to go to zero. v2: rtimeout -> remaining_timeout v3: Drop unnecessary includes, guc_submission_busy_loop -> guc_submission_send_busy_loop, drop negatie timeout trick, move a refactor of guc_context_unpin to earlier path (John H) v4: Add stddef.h back into intel_gt_requests.h, sort circuit idle function if not in GuC submission mode Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-16-matthew.brost@intel.com commit f4eb1f3fe94683cd7bdbb355d913bacf7e5d205f Author: Matthew Brost Date: Wed Jul 21 14:50:57 2021 -0700 drm/i915/guc: Ensure G2H response has space in buffer Ensure G2H response has space in the buffer before sending H2G CTB as the GuC can't handle any backpressure on the G2H interface. v2: (Matthew) - s/INTEL_GUC_SEND/INTEL_GUC_CT_SEND v3: (Matthew) - Add G2H credit accounting to blocking path, add g2h_release_space helper (John H) - CTB_G2H_BUFFER_SIZE / 4 == G2H_ROOM_BUFFER_SIZE Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-15-matthew.brost@intel.com commit 4dbd3944055507d53708f82e9252190800b95769 Author: Matthew Brost Date: Wed Jul 21 14:50:56 2021 -0700 drm/i915/guc: Disable semaphores when using GuC scheduling Semaphores are an optimization and not required for basic GuC submission to work properly. Disable until we have time to do the implementation to enable semaphores and tune them for performance. Also long direction is just to delete semaphores from the i915 so another reason to not enable these for GuC submission. This patch fixes an existing bugs where I915_ENGINE_HAS_SEMAPHORES was not honored correctly. v2: Reword commit message v3: (John H) - Add text to commit indicating this also fixing an existing bug v4: (John H) - s/bug/bugs Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-14-matthew.brost@intel.com commit 38d5ec43063c5908d1cda4e7eb24330405ccdb6f Author: Matthew Brost Date: Wed Jul 21 14:50:55 2021 -0700 drm/i915/guc: Ensure request ordering via completion fences If two requests are on the same ring, they are explicitly ordered by the HW. So, a submission fence is sufficient to ensure ordering when using the new GuC submission interface. Conversely, if two requests share a timeline and are on the same physical engine but different context this doesn't ensure ordering on the new GuC submission interface. So, a completion fence needs to be used to ensure ordering. v2: (Daniele) - Don't delete spin lock v3: (Daniele) - Delete forward dec Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-13-matthew.brost@intel.com commit e6cb8dc93f346263eec8be75997d4bc3bfb17591 Author: Matthew Brost Date: Wed Jul 21 14:50:54 2021 -0700 drm/i915: Disable preempt busywait when using GuC scheduling Disable preempt busywait when using GuC scheduling. This isn't needed as the GuC controls preemption when scheduling. v2: (John H): - Fix commit message Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-12-matthew.brost@intel.com commit 1f5cdb06b1d3ea6238c807acd91e5ec59f1098d3 Author: Matthew Brost Date: Wed Jul 21 14:50:53 2021 -0700 drm/i915/guc: Extend deregistration fence to schedule disable Extend the deregistration context fence to fence whne a GuC context has scheduling disable pending. v2: (John H) - Update comment why we check the pin count within spin lock Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-11-matthew.brost@intel.com commit b8b183abca5108ad67b0b9e23b6d407347bc4aa8 Author: Matthew Brost Date: Wed Jul 21 14:50:52 2021 -0700 drm/i915/guc: Disable engine barriers with GuC during unpin Disable engine barriers for unpinning with GuC. This feature isn't needed with the GuC as it disables context scheduling before unpinning which guarantees the HW will not reference the context. Hence it is not necessary to defer unpinning until a kernel context request completes on each engine in the context engine mask. Cc: John Harrison Signed-off-by: Matthew Brost Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-10-matthew.brost@intel.com commit e0717063ccb446c820317b3376c5dfafb3624502 Author: Matthew Brost Date: Wed Jul 21 14:50:51 2021 -0700 drm/i915/guc: Defer context unpin until scheduling is disabled With GuC scheduling, it isn't safe to unpin a context while scheduling is enabled for that context as the GuC may touch some of the pinned state (e.g. LRC). To ensure scheduling isn't enabled when an unpin is done, a call back is added to intel_context_unpin when pin count == 1 to disable scheduling for that context. When the response CTB is received it is safe to do the final unpin. Future patches may add a heuristic / delay to schedule the disable call back to avoid thrashing on schedule enable / disable. v2: (John H) - s/drm_dbg/drm_err (Daneiel) - Clean up sched state function Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-9-matthew.brost@intel.com commit b208f2d51b468f3289208e9d8d3cbbf76e84e426 Author: Matthew Brost Date: Wed Jul 21 14:50:50 2021 -0700 drm/i915/guc: Insert fence on context when deregistering Sometimes during context pinning a context with the same guc_id is registered with the GuC. In this a case deregister must be done before the context can be registered. A fence is inserted on all requests while the deregister is in flight. Once the G2H is received indicating the deregistration is complete the context is registered and the fence is released. v2: (John H) - Fix commit message Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-8-matthew.brost@intel.com commit 3a4cdf1982f05d1da434eb3d777554ea6de6769a Author: Matthew Brost Date: Wed Jul 21 14:50:49 2021 -0700 drm/i915/guc: Implement GuC context operations for new inteface Implement GuC context operations which includes GuC specific operations alloc, pin, unpin, and destroy. v2: (Daniel Vetter) - Use msleep_interruptible rather than cond_resched in busy loop (Michal) - Remove C++ style comment v3: (Matthew Brost) - Drop GUC_ID_START (John Harrison) - Fix a bunch of typos - Use drm_err rather than drm_dbg for G2H errors (Daniele) - Fix ;; typo - Clean up sched state functions - Add lockdep for guc_id functions - Don't call __release_guc_id when guc_id is invalid - Use MISSING_CASE - Add comment in guc_context_pin - Use shorter path to rpm (Daniele / CI) - Don't call release_guc_id on an invalid guc_id in destroy v4: (Daniel Vetter) - Add FIXME comment Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-7-matthew.brost@intel.com commit 2330923e92478ad80417dac114b80d257096e4be Author: Matthew Brost Date: Wed Jul 21 14:50:48 2021 -0700 drm/i915/guc: Add bypass tasklet submission path to GuC Add bypass tasklet submission path to GuC. The tasklet is only used if H2G channel has backpresure. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-6-matthew.brost@intel.com commit 925dc1cf58edcd6fa239c2b97f1aedb795f214d0 Author: Matthew Brost Date: Wed Jul 21 14:50:47 2021 -0700 drm/i915/guc: Implement GuC submission tasklet Implement GuC submission tasklet for new interface. The new GuC interface uses H2G to submit contexts to the GuC. Since H2G use a single channel, a single tasklet is used for the submission path. Also the per engine interrupt handler has been updated to disable the rescheduling of the physical engine tasklet, when using GuC scheduling, as the physical engine tasklet is no longer used. In this patch the field, guc_id, has been added to intel_context and is not assigned. Patches later in the series will assign this value. v2: (John Harrison) - Clean up some comments v3: (John Harrison) - More comment cleanups Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-5-matthew.brost@intel.com commit 27213d79b384d5b57d2dfa58a74b47d616f249ec Author: Matthew Brost Date: Wed Jul 21 14:50:46 2021 -0700 drm/i915/guc: Add LRC descriptor context lookup array Add LRC descriptor context lookup array which can resolve the intel_context from the LRC descriptor index. In addition to lookup, it can determine if the LRC descriptor context is currently registered with the GuC by checking if an entry for a descriptor index is present. Future patches in the series will make use of this array. v2: (Michal) - "linux/xarray.h" -> - s/lrc/LRC (John H) - Fix commit message Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-4-matthew.brost@intel.com commit 7518d9b67cf5ccf8f255bc45e18aa9c3d479f4b6 Author: Matthew Brost Date: Wed Jul 21 14:50:45 2021 -0700 drm/i915/guc: Remove GuC stage descriptor, add LRC descriptor Remove old GuC stage descriptor, add LRC descriptor which will be used by the new GuC interface implemented in this patch series. v2: (John Harrison) - s/lrc/LRC/g Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-3-matthew.brost@intel.com commit 56bc88745e731ff3830d2165f3a404d54eaf8287 Author: Matthew Brost Date: Wed Jul 21 14:50:44 2021 -0700 drm/i915/guc: Add new GuC interface defines and structures Add new GuC interface defines and structures while maintaining old ones in parallel. Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-2-matthew.brost@intel.com commit 7fc37efd8fa0678ea2cc4c3c5e881002010a3123 Author: Prathap Kumar Valsan Date: Wed Jul 21 15:30:34 2021 -0700 drm/i915/xehp: New engine context offsets The layout of some engine contexts has changed on Xe_HP. Define the new offsets. Bspec: 45585, 46256 Signed-off-by: Prathap Kumar Valsan Signed-off-by: Ramalingam C Signed-off-by: Venkata Ramana Nayana Signed-off-by: Akeem G Abodunrin Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-10-matthew.d.roper@intel.com commit 50a9ea0843da815bf0e05fad4c9d80f89ab5349e Author: Stuart Summers Date: Wed Jul 21 15:30:33 2021 -0700 drm/i915/xehp: Handle new device context ID format Xe_HP changes the format of the context ID from past platforms. Signed-off-by: Stuart Summers Signed-off-by: Umesh Nerlige Ramappa Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-9-matthew.d.roper@intel.com commit 8f57f295c8952ed45aa7c1c6296d36ced08f85ed Author: John Harrison Date: Wed Jul 21 15:30:32 2021 -0700 drm/i915/selftests: Allow for larger engine counts Increasing the engine count causes a couple of local array variables to exceed the kernel stack limit. So make them dynamic allocations instead. Signed-off-by: John Harrison Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-8-matthew.d.roper@intel.com commit 442e049aedb2aa8dac55b073595b02cf5d13899c Author: Venkata Sandeep Dhanalakota Date: Wed Jul 21 15:30:31 2021 -0700 drm/i915/gen12: Use fuse info to enable SFC In Gen12 there are various fuse combinations and in each configuration vdbox engine may be connected to SFC depending on which engines are available, so we need to set the SFC capability based on fuse value from the hardware. Even numbered physical instance always have SFC, odd numbered physical instances have SFC only if previous even instance is fused off. v2: - Minor style & typo fixes (Tvrtko) - Drop an unwanted 'inline' (Tvrtko) Bspec: 48028 Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Signed-off-by: Venkata Sandeep Dhanalakota Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-7-matthew.d.roper@intel.com commit 6ce40431d13cf5e89651ae7461c0555b90b86390 Merge: 0f4651359a235 9e22cfc5e9b92 Author: Matt Roper Date: Thu Jul 22 09:35:16 2021 -0700 Merge branch 'topic/xehp-dg2-definitions-2021-07-21' into drm-intel-gt-next As we begin applying XeHP and DG2 patches, the basic platform definitions and macros (like IS_DG2()) will be needed in both drm-intel-next and drm-intel-gt-next. Those initial definition patches are applied to a topic branch and merged to both trees. Signed-off-by: Matt Roper commit 34ba3c8a7d8ef378f4244f539978a95e38157aa6 Author: Matt Roper Date: Wed Jul 21 15:30:43 2021 -0700 drm/i915/dg2: DG2 has fixed memory bandwidth DG2 doesn't have a SAGV or QGV points that determine memory bandwidth. Instead it has a constant amount of memory bandwidth available to display that does not need to be reduced based on the number of active planes. For simplicity, we'll just modify driver initialization to create a single dummy QGV point with the proper amount of memory bandwidth, rather than trying to query the pcode for this information. Bspec: 64631 Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-19-matthew.d.roper@intel.com commit 5eb6bf0b44e7f21a2e6f4cdebdbb4ae9dd11f458 Author: Matt Roper Date: Wed Jul 21 15:30:42 2021 -0700 drm/i915/dg2: Don't read DRAM info DG2 does not use system DRAM information for BW_BUDDY programming or watermark workarounds, so there's no need to read this out at startup. Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-18-matthew.d.roper@intel.com commit 47753748ad05f662e54c15a3088d783e5f4772f2 Author: Matt Roper Date: Wed Jul 21 15:30:41 2021 -0700 drm/i915/dg2: Don't program BW_BUDDY registers Although the BW_BUDDY registers still exist, they are not used for anything on DG2. This change is expected to hold true for future dgpu's too. Bspec: 49218 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-17-matthew.d.roper@intel.com commit 49f756342b818fccb576c7b6ff00af7b32778e7d Author: Matt Roper Date: Wed Jul 21 15:30:40 2021 -0700 drm/i915/dg2: Add dbuf programming DG2 extends our DDB to four DBuf slices; pipes A+B only have access to the first two slices, whereas pipes C+D only have access to the second two. Confusingly, our bspec decided to switch from 1-based numbering of dbuf slices (S1, S2) to 0-based numbering (S0, S1, S2, S3) in Display13. At the moment we're using the 0-based number scheme for the DBUF_CTL_S() register addressing, but the 1-based number scheme in the actual slice assignment tables. We may want to consider switching the assignment over to 0-based numbering too at some point... Bspec: 49255 Bspec: 50057 Cc: Stanislav Lisovskiy Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-16-matthew.d.roper@intel.com commit 263862652f169c3ba2b5cdc39d7037e5ab0bb6a6 Author: Matt Roper Date: Wed Jul 21 15:30:39 2021 -0700 drm/i915/dg2: Setup display outputs DG2 has outputs on DDI A-D attached to what the bspec diagram shows as "Combo PHY A-D." Note that despite being labelled "combo" the PHYs on these outputs are Synopsys PHYs rather than traditional Intel combo PHY technology. Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-15-matthew.d.roper@intel.com commit 48f8f016d4d6fbbc3bdc2c79bd8bba427072b59a Author: Matt Roper Date: Wed Jul 21 15:30:38 2021 -0700 drm/i915/dg2: Don't wait for AUX power well enable ACKs On DG2 we're supposed to just wait 600us after programming the well before moving on; there won't be an ack from the hardware. Bspec: 49296 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-14-matthew.d.roper@intel.com commit 87fc875a2b85043f9cc34f84e1beb2ec51a9e5d3 Author: Matt Roper Date: Wed Jul 21 15:30:37 2021 -0700 drm/i915/dg2: Skip shared DPLL handling DG2 has no shared DPLL's or DDI clock muxing. The Port PLL is embedded within the PHY. Bspec: 54032 Bspec: 54034 Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-13-matthew.d.roper@intel.com commit 1f3e84c4edcd357eeb608d709c9c2dcb3193c841 Author: Matt Roper Date: Wed Jul 21 15:30:36 2021 -0700 drm/i915/dg2: Add cdclk table and reference clock Note that DG2 only has a single possible refclk frequency (38.4 MHz). v2: - Drop two now-unused cdclk entries Bspec: 54034 Cc: Lucas De Marchi Signed-off-by: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-12-matthew.d.roper@intel.com commit 3176fb663c0b0ea5d3edd179cb1252f680e55fbf Author: Matt Roper Date: Wed Jul 21 15:30:35 2021 -0700 drm/i915/dg2: Add fake PCH As with DG1, DG2 has an ICL-style south display interface provided on the same PCI device. Add a fake PCH to ensure DG2 takes the appropriate codepaths for south display handling. Bspec: 54871, 50062, 49961, 53673 Cc: Lucas De Marchi Signed-off-by: Matt Roper Signed-off-by: Aditya Swarup Signed-off-by: José Roberto de Souza Reviewed-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-11-matthew.d.roper@intel.com commit 22e26af769035c61430bc43b7e0639404a14cbe1 Author: Paulo Zanoni Date: Wed Jul 21 15:30:29 2021 -0700 drm/i915: Fork DG1 interrupt handler The current interrupt handler is getting increasingly complicated and Xe_HP changes will bring even more complexity. Let's split off a new interrupt handler starting with DG1 (i.e., when the master tile interrupt register was added to the design) and use that as the basis for the new Xe_HP changes. Now that we track the hardware IP's release number as well as the version number, we can also properly define DG1 has version "12.10" and replace the has_master_unit_irq feature flag with an IP version test. Bspec: 50875 Cc: Daniele Spurio Ceraolo Cc: Stuart Summers Signed-off-by: Paulo Zanoni Signed-off-by: Lucas De Marchi Signed-off-by: Tomasz Lis Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-5-matthew.d.roper@intel.com commit c86fc48a2463cd9bd3131eff9ef7547110bb4774 Merge: 46b0d7091cb97 9e22cfc5e9b92 Author: Matt Roper Date: Thu Jul 22 09:23:00 2021 -0700 Merge branch 'topic/xehp-dg2-definitions-2021-07-21' into drm-intel-next As we begin applying XeHP and DG2 patches, the basic platform definitions and macros (like IS_DG2()) will be needed in both drm-intel-next and drm-intel-gt-next. Those initial definition patches are applied to a topic branch and merged to both trees. Signed-off-by: Matt Roper commit 9e22cfc5e9b92556a56d8a564cdab31045f29010 Author: Matt Roper Date: Wed Jul 21 15:30:28 2021 -0700 drm/i915/dg2: add DG2 platform info DG2 has Xe_LPD display (version 13) and Xe_HPG (version 12.55) graphics. There are two variants (treated as subplatforms in the code): DG2-G10 and DG2-G11 that require independent programming in some areas (e.g., workarounds). Bspec: 44472, 44474, 46197, 48028, 48077 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-4-matthew.d.roper@intel.com commit 086df54e20bec27ccc4a1df926039faf44e1037d Author: Lucas De Marchi Date: Wed Jul 21 15:30:27 2021 -0700 drm/i915/xehpsdv: add initial XeHP SDV definitions XeHP SDV is a Intel® dGPU without display. This is just the definition of some basic platform macros, by large a copy of current state of Tigerlake which does not reflect the end state of this platform. v2: - Switch to intel_step infrastructure for stepping matches. (Jani) v3: - Bring earlier in patch series and leave addition of new media engines to the engine mask for a later patch. Bspec: 44467, 48077 Cc: Rodrigo Vivi Signed-off-by: Lucas De Marchi Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: José Roberto de Souza Signed-off-by: Stuart Summers Signed-off-by: Tomas Winkler Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-3-matthew.d.roper@intel.com commit 05eb46384ecb19f020971da02e4605e74b3d920b Author: Lucas De Marchi Date: Wed Jul 21 15:30:26 2021 -0700 drm/i915: Add XE_HP initial definitions Our _FEATURES macro went back to GEN7, extending each other, making it difficult to grasp what was really enabled/disabled. Take the opportunity of the GEN -> XE_HP name break and also break with the feature inheritance. For XE_HP this basically goes from GEN12 back to GEN7 coalescing the features making sure the overrides remain, remove all the display-specific features and sort it. Then also remove the definitions that would be overridden by DGFX_FEATURES and those that were 0 (since that is the default). Exception here is has_master_unit_irq: although it is a feature that started with DG1 and is true for all DGFX platforms, it's also true for XE_HP in general. Signed-off-by: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-2-matthew.d.roper@intel.com commit f39730350dd126e3e5312214b458a7ded44e9d91 Author: Lucas De Marchi Date: Wed Jul 7 16:59:21 2021 -0700 drm/i915: Add release id version Besides the arch version returned by GRAPHICS_VER(), new platforms contain a "release id" to make clear the difference from one platform to another. The release id number is not formally defined by hardware until future platforms that will expose it via a new GMD_ID register. For the platforms we support before that register becomes available we will set the values in software and we can set them as we please. So the plan is to set them so we can group different features under a single GRAPHICS_VER_FULL() check. After GMD_ID is used, the usefulness of a "full version check" will be greatly reduced and will be mostly used for deciding workarounds and a few code paths. So it makes sense to keep it as a separate field from graphics_ver. Also, as a platform with `release == n` may be closer feature-wise to `n - 2` than to `n - 1`, use the word "release" rather than the more common "minor" for this This is a mix of 2 independent changes: one by me and the other by Matt Roper. v2: - Reword commit message to make it clearer why we don't call it "minor" (Matt Roper and Tvrtko) - Rename variables s/*_ver_release/*_rel/ and print them in a single line formatted as {ver}.{rel:2} (Jani and Matt Roper) Cc: Matt Roper Signed-off-by: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707235921.2416911-2-lucas.demarchi@intel.com (cherry picked from commit ca6374e267e2735fe382fe95de2a8a9c30c6bdb3) Signed-off-by: Matt Roper commit d1fbcbbc8cb4f8871f898c32ae041d5102a28ec2 Author: Lucas De Marchi Date: Wed Jul 7 16:59:20 2021 -0700 drm/i915: do not abbreviate version in debugfs Brevity is not needed here, so just spell out "* version" in the string. Suggested-by: Chris Wilson Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707235921.2416911-1-lucas.demarchi@intel.com (cherry picked from commit 0f9b145a0a0ab0d3d4143c20e2ca347d8a105e33) Signed-off-by: Matt Roper commit ee3f96ad3eff61b5f3a48c050af533e0320c43ab Author: Randy Dunlap Date: Tue Jul 20 19:03:34 2021 -0700 Bluetooth: btrsi: use non-kernel-doc comment for copyright kernel-doc complains about a non-kernel-doc comment that uses "/**" to begin the comment, so change it to just "/*". drivers/bluetooth/btrsi.c:2: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Copyright (c) 2017 Redpine Signals Inc. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: Prameela Rani Garnepudi Cc: Sanjay Kumar Konduri Cc: Siva Rebbagondla Cc: Kalle Valo Signed-off-by: Marcel Holtmann commit 899a750986bc4e62d554d4a5dd237c0ab25b698a Author: Bard Liao Date: Wed Jul 14 11:36:09 2021 +0800 soundwire: bus: update Slave status in sdw_clear_slave_status Call to sdw_update_slave_status() needs to be added to sdw_clear_slave_ status() to ensure Slaves are informed of the new status via update_ status() callback. This will enable codec drivers to reset their internal states and make sure the register settings are properly restored on pm_runtime or system resume BugLink: https://github.com/thesofproject/linux/issues/2908 BugLink: https://github.com/thesofproject/linux/issues/2637 Signed-off-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210714033609.11963-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7f6a750aea53251d0874410d90efb432ac8b5e9a Author: Archie Pusaka Date: Tue Jul 13 16:37:03 2021 +0800 Bluetooth: btrtl: Set MSFT opcode for RTL8852 RTL8852 support MSFT HCI extension, therefore set the proper MSFT opcode. Signed-off-by: Archie Pusaka Reviewed-by: Miao-chen Chou Reviewed-by: Hilda Wu Signed-off-by: Marcel Holtmann commit 9af417610b6142e826fd1ee8ba7ff3e9a2133a5a Author: Colin Ian King Date: Mon Jul 12 13:14:40 2021 +0100 6lowpan: iphc: Fix an off-by-one check of array index The bounds check of id is off-by-one and the comparison should be >= rather >. Currently the WARN_ON_ONCE check does not stop the out of range indexing of &ldev->ctx.table[id] so also add a return path if the bounds are out of range. Addresses-Coverity: ("Illegal address computation"). Fixes: 5609c185f24d ("6lowpan: iphc: add support for stateful compression") Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann commit 373568276007aa23840b142b28a469e452ecfad3 Author: Forest Crossman Date: Mon Jul 12 02:32:20 2021 -0500 Bluetooth: btusb: Add support for LG LGSBWAC92/TWCM-K505D The LG LGSBWAC92/TWCM-K505D/EAT64454801/EAT64454802 (it goes by many names) is a combo WiFi/Bluetooth module that's used in several models of LG TVs. It uses the MediaTek MT7668AUN, which is already supported in btusb, but this device has a non-MediaTek VID:PID pair so to get it to work we just need to add it to the list of devices to probe. Device from /sys/kernel/debug/usb/devices: T: Bus=09 Lev=02 Prnt=02 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=043e ProdID=3109 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=100mA A: FirstIf#= 0 IfCount= 2 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= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Forest Crossman Signed-off-by: Marcel Holtmann commit 00d3c2b3f0a2cb26ef27f015015b43c8a195c10f Author: Peter Ujfalusi Date: Wed Jul 14 09:55:55 2021 +0800 soundwire: cadence: Remove ret variable from sdw_cdns_irq() The ret is not used in the interrupt handler, it is just returned without any condition or change. We can return the IRQ_HANDLED directly. Signed-off-by: Peter Ujfalusi Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714015555.17685-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 9f9bc7d50437f11fecf5935ab91f44284e747222 Author: Pierre-Louis Bossart Date: Wed Jul 14 09:42:09 2021 +0800 soundwire: bus: filter out more -EDATA errors on clock stop We've added quite a few filters to avoid throwing errors if a Device does not respond to commands during the clock stop sequences, but we missed one. This will lead to an isolated message [ 6115.294412] soundwire sdw-master-1: SDW_SCP_STAT bread failed:-61 The callers already filter this error code, so there's no point in keeping it at the lower level. Since this is a recoverable error, make this dev_err() conditional and only log cases with Command Failed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714014209.17357-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 20a831f04f1526f2c3442efd3dece8630216b5d2 Author: Jun Miao Date: Fri Jul 9 21:46:25 2021 +0800 Bluetooth: btusb: Fix a unspported condition to set available debug features When reading the support debug features failed, there are not available features init. Continue to set the debug features is illogical, we should skip btintel_set_debug_features(), even if check it by "if (!features)". Fixes: c453b10c2b28 ("Bluetooth: btusb: Configure Intel debug feature based on available support") Signed-off-by: Jun Miao Signed-off-by: Marcel Holtmann commit 433b308403aa2cd9213e954c566c4df25399570e Author: Pierre-Louis Bossart Date: Wed Jul 14 09:30:27 2021 +0800 soundwire: dmi-quirks: add ull suffix for SoundWire _ADR values Sparse throws the following type of warnings: drivers/soundwire/dmi-quirks.c:25:17: error: constant 0x000010025D070100 is so big it is long Let's add the 'ull' suffix to make this go away and find real issues. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Paul Olaru Reviewed-by: Guennadi Liakhovetski Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714013027.17022-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 59da0b38bc2ea570ede23a3332ecb3e7574ce6b2 Author: Dan Carpenter Date: Fri Jun 25 18:00:09 2021 +0300 Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Smatch complains that some of these struct members are not initialized leading to a stack information disclosure: net/bluetooth/sco.c:778 sco_conn_defer_accept() warn: check that 'cp.retrans_effort' doesn't leak information This seems like a valid warning. I've added a default case to fix this issue. Fixes: 2f69a82acf6f ("Bluetooth: Use voice setting in deferred SCO connection request") Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann commit 2cdff8ca4c8414401bcbc9701229e971797b1340 Author: Wai Paulo Valerio Wang Date: Thu Jul 8 04:00:59 2021 +0800 Bluetooth: btusb: Add support for IMC Networks Mediatek Chip This add supports for IMC Networks Wireless_Device Media Chip which contains the MT7921 chipset. $ lsusb Bus 001 Device 004: ID 13d3:3563 IMC Networks Wireless_Device $ cat /sys/kernel/debug/usb/devices T: Bus=01 Lev=01 Prnt=01 Port=03 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=13d3 ProdID=3563 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: Wai Paulo Valerio Wang Signed-off-by: Marcel Holtmann commit b4a46996f1d21c23269cc6b989e4db22ce69061f Author: Hans de Goede Date: Tue Jun 29 21:59:07 2021 +0200 Bluetooth: hci_h5: Disable the hci_suspend_notifier for btrtl devices The hci_suspend_notifier which was introduced last year, is causing problems for uart attached btrtl devices. These devices may loose their firmware and their baudrate setting over a suspend/resume. Since we don't even know the baudrate after a suspend/resume recovering from this is tricky. The driver solves this by treating these devices the same as USB BT HCIs which drop of the bus during suspend. Specifically the driver: 1. Simply unconditionally turns the device fully off during system-suspend to save maximum power. 2. Calls device_reprobe() from a workqueue to fully re-init the device from scratch on system-resume (unregistering the old HCI and registering a new HCI). This means that these devices do not benefit from the suspend / resume handling work done by the hci_suspend_notifier. At best this unnecessarily adds some time to the suspend/resume time. But in practice this is actually causing problems: 1. These btrtl devices seem to not like the HCI_OP_WRITE_SCAN_ENABLE( SCAN_DISABLED) request being send to them when entering the BT_SUSPEND_CONFIGURE_WAKE state. The same request send on BT_SUSPEND_DISCONNECT works fine, but the second one send (unnecessarily?) from the BT_SUSPEND_CONFIGURE_WAKE transition causes the device to hang: [ 573.497754] PM: suspend entry (s2idle) [ 573.554615] Filesystems sync: 0.056 seconds [ 575.837753] Bluetooth: hci0: Timed out waiting for suspend events [ 575.837801] Bluetooth: hci0: Suspend timeout bit: 4 [ 575.837925] Bluetooth: hci0: Suspend notifier action (3) failed: -110 2. The PM_POST_SUSPEND / BT_RUNNING transition races with the driver-unbinding done by the device_reprobe() work. If the hci_suspend_notifier wins the race it is talking to a dead device leading to the following errors being logged: [ 598.686060] Bluetooth: hci0: Timed out waiting for suspend events [ 598.686124] Bluetooth: hci0: Suspend timeout bit: 5 [ 598.686237] Bluetooth: hci0: Suspend notifier action (4) failed: -110 In both cases things still work, but the suspend-notifier is causing these ugly errors getting logged and ut increase both the suspend- and the resume-time by 2 seconds. This commit avoids these problems by disabling the hci_suspend_notifier. Cc: Luiz Augusto von Dentz Cc: Vasily Khoruzhick Cc: Abhishek Pandit-Subedi Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 4431531c482a2c05126caaa9fcc5053a4a5c495b Author: Niklas Söderlund Date: Thu Jul 22 13:25:02 2021 +0200 nfp: fix return statement in nfp_net_parse_meta() The return type of the function is bool and while NULL do evaluate to false it's not very nice, fix this by explicitly returning false. There is no functional change. Signed-off-by: Niklas Söderlund Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit c27479d762de4eda72ba9e0aa150d439970f2077 Author: Deepak R Varma Date: Fri Apr 30 17:40:12 2021 +0200 media: atomisp: pci: reposition braces as per coding style Misplaced braces makes it difficult to follow the code easily. This also goes against the code style guidelines. This resolved following checkpatch complaints: ERROR: open brace '{' following function definitions go on the next line ERROR: that open brace { should be on the previous line Link: https://lore.kernel.org/linux-media/YIwk3KbVGRPJwKa4@dU2104 [mchehab: dropped a hunk with a merge conflict] Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, drv@mailo.com # X-LSpam-Score: -7.3 (-------) Signed-off-by: Deepak R Varma Signed-off-by: Mauro Carvalho Chehab commit 278cc35d750c3186ac30d249c9681ff7e6d80398 Author: Martiros Shakhzadyan Date: Mon Jul 19 07:52:16 2021 +0200 media: atomisp: i2c: Remove a superfluous else clause in atomisp-mt9m114.c Remove a superfluous clause in mt9m114_s_power() Link: https://lore.kernel.org/linux-media/20210719055216.28508-1-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 70d4ac6fb085dc621122cbf78169bcbd1162d0a6 Author: Andy Shevchenko Date: Tue Jul 13 17:25:22 2021 +0200 media: atomisp: Move MIPI_PORT_LANES to the only user Move MIPI_PORT_LANES to the only user of it, i.e. pci/runtime/isys/src/rx.c. Link: https://lore.kernel.org/linux-media/20210713152523.19902-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 1d74a91dc5c8400302e5c6269093135994e30939 Author: Kees Cook Date: Sun Jul 11 16:51:01 2021 +0200 media: atomisp: Perform a single memset() for union There is no need to memset() both dvs_grid_info and dvs_stat_grid_info separately: they are part of the same union. Instead, just zero the union itself. This additionally avoids a false positive (due to a gcc optimization bug[1]) when building with the coming FORTIFY_SOURCE improvements: In function 'fortify_memset_chk', inlined from 'sh_css_pipe_get_grid_info' at drivers/staging/media/atomisp/pci/sh_css.c:5186:3, inlined from 'ia_css_stream_create' at drivers/staging/media/atomisp/pci/sh_css.c:9442:10: ./include/linux/fortify-string.h:199:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 199 | __write_overflow_field(); | ^~~~~~~~~~~~~~~~~~~~~~~~ [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101419 Link: https://lore.kernel.org/linux-media/20210711145101.1434065-1-keescook@chromium.org Signed-off-by: Kees Cook Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d14e272958bdfdc40dcafb827d24ba6fdafa9d52 Author: Yang Yingliang Date: Thu Jun 17 09:23:29 2021 +0200 media: atomisp: pci: fix error return code in atomisp_pci_probe() If init_atomisp_wdts() fails, atomisp_pci_probe() need return error code. Link: https://lore.kernel.org/linux-media/20210617072329.1233662-1-yangyingliang@huawei.com Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Mauro Carvalho Chehab commit 655ace3c74fbafe0c2d331109412c62cc56006a1 Author: Fabio M. De Francesco Date: Sat Jun 5 04:08:55 2021 +0200 media: atomisp: pci: Remove unnecessary (void *) cast Removed an unnecessary (void *) cast for an argument passed to kfree(). Link: https://lore.kernel.org/linux-media/20210605020855.1065-3-fmdefrancesco@gmail.com Suggested-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Signed-off-by: Mauro Carvalho Chehab commit 179b1fce5d80f7d1b075bf9cb00cb78cb16ea09c Author: Fabio M. De Francesco Date: Thu May 27 21:39:22 2021 +0200 media: atomisp: pci: Remove checks before kfree/kvfree Removed checks for pointers != NULL before freeing memory. If kvfree() and kfree() are given NULL pointers no operations are performed, so there is no need for the above-mentioned checks. Coccinelle detected the second of the two unnecessary checks. Link: https://lore.kernel.org/linux-media/20210527193922.25225-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a5d46d9afbdf9d1755d421052dcdeaf2f3725f52 Author: Andy Shevchenko Date: Wed May 26 14:43:22 2021 +0200 media: atomisp: Remove unused port_enabled variable Remove unused port_enabled variable in ia_css_isys_rx_configure(). Link: https://lore.kernel.org/linux-media/20210526124322.48915-6-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 86d92c3ad7179df2ee082e31138f00ca26db7572 Author: Andy Shevchenko Date: Wed May 26 14:43:20 2021 +0200 media: atomisp: Annotate a couple of definitions with __maybe_unused There are definitions in the header that are not used by all modules inside the driver. Annotate them with __maybe_unused to avoid compiler warnings. Link: https://lore.kernel.org/linux-media/20210526124322.48915-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 8e38adf99d2fc216b0f9a059a2054f673cbfe1a7 Author: Andy Shevchenko Date: Wed May 26 14:43:19 2021 +0200 media: atomisp: Remove unused declarations There is a few static declarations that are not used anywhere, remove them. Link: https://lore.kernel.org/linux-media/20210526124322.48915-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit d741db71cf1dfca2c12651197be6e910d40ff12f Author: Shaokun Zhang Date: Tue May 25 08:02:39 2021 +0200 media: atomisp: remove the repeated declaration Function 'ia_css_mmu_invalidate_cache' is declared twice, remove the repeated declaration. Link: https://lore.kernel.org/linux-media/1621922559-1859-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Shaokun Zhang Signed-off-by: Mauro Carvalho Chehab commit 544ee7306d9e3a7ff675e87f151723ff30efd9a1 Author: Tom Rix Date: Fri May 21 21:48:05 2021 +0200 media: atomisp: improve error handling in gc2235_detect() Static analysis reports this representative problem atomisp-gc2235.c:867:20: warning: The right operand of '|' is a garbage value id = ((high << 8) | low); ^ ~~~ When gc2235_read_reg() fails, its return val is never written. For gc2235_detect(), high and low are or-ed and compared with GC2235_ID, 0x2235. Initialize both to 0 and skip checking the read returns, it's errors are not passed up, only -ENODEV is. Link: https://lore.kernel.org/linux-media/20210521194805.2078135-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Mauro Carvalho Chehab commit f89aa0d174b3e7f2988a976125c3a67a07b71040 Author: Aniket Bhattacharyea Date: Mon May 24 19:36:09 2021 +0200 media: atomisp: Fix whitespace at the beginning of line This patch fixes whitespace at the beginning of line by wrapping after the type name and aligning the arguments with the open parenthesis. Identified by checkpatch: WARNING: please, no spaces at the start of a line. Link: https://lore.kernel.org/linux-media/20210524173609.672153-1-aniketmail669@gmail.com Signed-off-by: Aniket Bhattacharyea Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 95d2117cfe77eb3f9af4981a54f0fd8b17fec1cc Author: Jiabing Wan Date: Tue May 18 13:29:35 2021 +0200 media: atomisp: Align block comments Fixing the following checkpatch warning: WARNING: Block comments should align the * on each line Link: https://lore.kernel.org/linux-media/20210518112938.88240-1-wanjiabing@vivo.com Signed-off-by: Jiabing Wan Signed-off-by: Mauro Carvalho Chehab commit 2c08a018f0d5f3902d4e1cbf99e3858477ac0515 Author: Nguyen Dinh Phi Date: Thu May 13 05:46:50 2021 +0200 media: atomisp: Use sysfs_emit() instead of sprintf() where appropriate sysfs_emit() is preferred over raw sprintf() for sysfs attributes since it knows about the sysfs buffer specifics and has some built-in sanity checks. Link: https://lore.kernel.org/linux-media/20210513034650.252993-1-phind.uet@gmail.com Signed-off-by: Nguyen Dinh Phi Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6b6d22831331434b6a1b5b557bc235ca9df420e0 Author: Martiros Shakhzadyan Date: Sun May 9 01:56:22 2021 +0200 media: atomisp: Fix line continuation style issue in sh_css.c Fix logical continuation style issue and adjacent line splits. Link: https://lore.kernel.org/linux-media/20210508235622.300394-5-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 00ba215607e2f6015932b45c9b8e5b022424012c Author: Martiros Shakhzadyan Date: Sun May 9 01:56:21 2021 +0200 media: atomisp: Use kcalloc instead of kzalloc with multiply in sh_css.c Use kcalloc instead of kzalloc with multiplication. Link: https://lore.kernel.org/linux-media/20210508235622.300394-4-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit f6e2a76d443c5f778dc4b22ea1560be97ee8931c Author: Martiros Shakhzadyan Date: Sun May 9 01:56:20 2021 +0200 media: atomisp: Remove unnecessary parens in sh_css.c Remove unnecessary parenthesis. Link: https://lore.kernel.org/linux-media/20210508235622.300394-3-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 7f52dbb8f7e9de24412bf1a1b935000f9c1ea884 Author: Martiros Shakhzadyan Date: Sun May 9 01:56:19 2021 +0200 media: atomisp: Resolve goto style issue in sh_css.c Change the goto label to lower case. Remove a space in the goto label. Link: https://lore.kernel.org/linux-media/20210508235622.300394-2-vrzh@vrzh.net Signed-off-by: Martiros Shakhzadyan Signed-off-by: Mauro Carvalho Chehab commit 9d971b81359837ed05f466afa7c8df5d5f94786f Author: Baokun Li Date: Thu Jun 17 16:09:26 2021 +0200 media: atomisp: use list_splice_init in atomisp_compat_css20.c Using list_splice_init() instead of entire while-loops in atomisp_compat_css20.c. Link: https://lore.kernel.org/linux-media/20210617140926.887680-1-libaokun1@huawei.com Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit c275e5d349b0d2b1143607d28b9c7c14a8a0a9b4 Author: Yizhuo Date: Fri Jun 25 07:38:56 2021 +0200 media: atomisp: fix the uninitialized use and rename "retvalue" Inside function mt9m114_detect(), variable "retvalue" could be uninitialized if mt9m114_read_reg() returns error, however, it is used in the later if statement, which is potentially unsafe. The local variable "retvalue" is renamed to "model" to avoid confusion. Link: https://lore.kernel.org/linux-media/20210625053858.3862-1-yzhai003@ucr.edu Fixes: ad85094 (media / atomisp: fix the uninitialized use of model ID) Signed-off-by: Yizhuo Signed-off-by: Mauro Carvalho Chehab commit 264f590899146baa19e0ab5689e55fadbc292333 Author: Pavel Skripkin Date: Sat May 8 15:17:27 2021 +0200 media: atomisp: remove useless returns Returns are not useful at the end of void functions, they can simply be removed. Link: https://lore.kernel.org/linux-media/23a6984ddfb15ba38f6983381bb6fdaef3edd7d8.1620479607.git.paskripkin@gmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Mauro Carvalho Chehab commit 728a5c64ae5fef9524528153b290b7d4a4e56043 Author: Pavel Skripkin Date: Sat May 8 15:17:20 2021 +0200 media: atomisp: remove dublicate code Removed dublicate returns and breaks inside switch statements and useless return after switch. Link: https://lore.kernel.org/linux-media/3944cd10bb5a64157781b1e0ef044c62c05f07c7.1620479607.git.paskripkin@gmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Mauro Carvalho Chehab commit 9763267eda9d424f69e17d322df388af6f3756d0 Author: Pavel Skripkin Date: Sat May 8 15:17:12 2021 +0200 media: atomisp: remove useless breaks Breaks are not useful after a return, they can simply be removed. Link: https://lore.kernel.org/linux-media/4b4a6ad1bc8fc1fd6aafc3e6cd7a4969890340c1.1620479607.git.paskripkin@gmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Mauro Carvalho Chehab commit 24d4fbdc9a8553c3f433e6f390fa9959aaba3e32 Author: Dmitrii Wolf Date: Sun Apr 11 15:48:41 2021 +0200 media: atomisp: pci: fixed a curly bracket coding style issue. Fixed a coding style issue. Link: https://lore.kernel.org/linux-media/20210411134840.7184-1-dev.dragon@bk.ru Signed-off-by: Dmitrii Wolf Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 672fe1cf145ab9978c62eb827d6a16aa6b63994b Author: Dinghao Liu Date: Thu Apr 8 10:18:43 2021 +0200 media: atomisp: Fix runtime PM imbalance in atomisp_pci_probe When hmm_pool_register() fails, a pairing PM usage counter increment is needed to keep the counter balanced. It's the same for the following error paths. Link: https://lore.kernel.org/linux-media/20210408081850.24278-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Acked-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit fe8e320d8bf7596123d160d7fce6a1ea6e0761ca Author: Bhaskar Chowdhury Date: Wed Mar 24 14:56:42 2021 +0100 media: atomisp-ov2680: A trivial typo fix s/miror/mirror/ Link: https://lore.kernel.org/linux-media/20210324135642.30054-1-unixbhaskar@gmail.com Signed-off-by: Bhaskar Chowdhury Acked-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab commit e6f238735f63921175c5d8df2d7b21f8002eaa6a Author: Ricardo Ribalda Date: Thu Mar 18 21:22:16 2021 +0100 media: atomisp: Fix typo "accesible" Trivial fix. Link: https://lore.kernel.org/linux-media/20210318202223.164873-2-ribalda@chromium.org Signed-off-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit 44693d74f5653f82cd7ca0fe730eed0f6b83306a Author: Philipp Zabel Date: Mon Jul 19 16:57:08 2021 +0200 media: coda: fix frame_mem_ctrl for YUV420 and YVU420 formats The frame memory control register value is currently determined before userspace selects the final capture format and never corrected. Update ctx->frame_mem_ctrl in __coda_start_decoding() to fix decoding into YUV420 or YVU420 capture buffers. Reported-by: Andrej Picej Fixes: 497e6b8559a6 ("media: coda: add sequence initialization work") Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fa0b5658597f1362c08c662a3a3c5139829e13a8 Author: Tom Rix Date: Fri Jul 16 21:17:33 2021 +0200 media: ti-vpe: cal: fix indexing of cal->ctx[] in cal_probe() cal->ctx[i] is allocated with this loop for (i = 0; i < cal->data->num_csi2_phy; ++i) { and accessed in the error handler and else where with this loop for (i = 0; i < cal->num_contexts; i++) Because the first loop contains a continue statement before cal->num_contexts is incremented, using i as the indexer will leave gaps in the cal->ctx[]. So use cal->num_contexts as the indexer. Fixes: 75e7e58bfac1 ("media: ti-vpe: cal: support 8 DMA contexts") Signed-off-by: Tom Rix Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e58430e1d4fd01b74475d2fbe2e25b5817b729a9 Author: Dan Carpenter Date: Tue Jul 13 11:24:10 2021 +0200 media: rockchip/rga: fix error handling in probe There are a few bugs in this code. 1) No checks for whether dma_alloc_attrs() or __get_free_pages() failed. 2) If video_register_device() fails it doesn't clean up the dma attrs or the free pages. 3) The video_device_release() function frees "vfd" which leads to a use after free on the next line. The call to video_unregister_device() is not required so I have just removed that. Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") Reported-by: Dongliang Mu Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 055d2db28ec2fa3ab5c527c5604f1b32b89fa13a Author: Evgeny Novikov Date: Sat Jul 10 14:04:32 2021 +0200 media: platform: stm32: unprepare clocks at handling errors in probe stm32_cec_probe() did not unprepare clocks on error handling paths. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 514e97674400462cc09c459a1ddfb9bf39017223 Author: Pavel Skripkin Date: Wed Jul 7 19:54:30 2021 +0200 media: stkwebcam: fix memory leak in stk_camera_probe My local syzbot instance hit memory leak in usb_set_configuration(). The problem was in unputted usb interface. In case of errors after usb_get_intf() the reference should be putted to correclty free memory allocated for this interface. Fixes: ec16dae5453e ("V4L/DVB (7019): V4L: add support for Syntek DC1125 webcams") Cc: stable@vger.kernel.org Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7910c23d704794461aba7a72b07aae582496b781 Author: Hans Verkuil Date: Mon Jun 28 10:23:49 2021 +0200 media: media/cec-core.rst: update adap_enable doc The description of adap_enable was out-of-date. Improve it so that it corresponds to what really happens. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f003d635a8aede9d0e44fb1255ff63a1b2d7eb6e Author: Dafna Hirschfeld Date: Fri Jun 25 10:23:09 2021 +0200 media: rkisp1: cap: initialize dma buf address in 'buf_init' cb Initializing the dma addresses of the capture buffers can move to the 'buf_init' callback, since it is enough to do it once for each buffer and not every time it is queued. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 07e59d91e70107803630c1bbed0837f0cf32eed7 Author: Dafna Hirschfeld Date: Fri Jun 25 10:23:08 2021 +0200 media: rkisp1: remove field 'vaddr' from 'rkisp1_buffer' The virtual address can be accessed using vb2_plane_vaddr therefore there is no need to save it in an extra field in 'rkisp1_buffer'. Remove it. Signed-off-by: Dafna Hirschfeld Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ba7a93e507f88306d7a19a1dcb53b857b790cfb8 Author: Dan Carpenter Date: Tue Jun 22 16:31:53 2021 +0200 media: v4l2-subdev: fix some NULL vs IS_ERR() checks The v4l2_subdev_alloc_state() function returns error pointers, it doesn't return NULL. Fixes: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6f5885a7750545973bf1a942d2f0f129aef0aa06 Author: Pavel Skripkin Date: Sun Jun 20 21:45:42 2021 +0200 media: go7007: remove redundant initialization In go7007_alloc() kzalloc() is used for struct go7007 allocation. It means that there is no need in zeroing any members, because kzalloc will take care of it. Removing these reduntant initialization steps increases execution speed a lot: Before: + 86.802 us | go7007_alloc(); After: + 29.595 us | go7007_alloc(); Fixes: 866b8695d67e8 ("Staging: add the go7007 video driver") Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 47d94dad8e64b2fc1d8f66ce7acf714f9462c60f Author: Pavel Skripkin Date: Sun Jun 20 21:45:02 2021 +0200 media: go7007: fix memory leak in go7007_usb_probe In commit 137641287eb4 ("go7007: add sanity checking for endpoints") endpoint sanity check was introduced, but if check fails it simply returns with leaked pointers. Cutted log from my local syzbot instance: BUG: memory leak unreferenced object 0xffff8880209f0000 (size 8192): comm "kworker/0:4", pid 4916, jiffies 4295263583 (age 29.310s) hex dump (first 32 bytes): 30 b0 27 22 80 88 ff ff 75 73 62 2d 64 75 6d 6d 0.'"....usb-dumm 79 5f 68 63 64 2e 33 2d 31 00 00 00 00 00 00 00 y_hcd.3-1....... backtrace: [] kmalloc include/linux/slab.h:556 [inline] [] kzalloc include/linux/slab.h:686 [inline] [] go7007_alloc+0x46/0xb40 drivers/media/usb/go7007/go7007-driver.c:696 [] go7007_usb_probe+0x13e/0x2200 drivers/media/usb/go7007/go7007-usb.c:1114 [] usb_probe_interface+0x314/0x7f0 drivers/usb/core/driver.c:396 [] really_probe+0x291/0xf60 drivers/base/dd.c:576 BUG: memory leak unreferenced object 0xffff88801e2f2800 (size 512): comm "kworker/0:4", pid 4916, jiffies 4295263583 (age 29.310s) hex dump (first 32 bytes): 00 87 40 8a ff ff ff ff 00 00 00 00 00 00 00 00 ..@............. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:556 [inline] [] kzalloc include/linux/slab.h:686 [inline] [] go7007_usb_probe+0x184/0x2200 drivers/media/usb/go7007/go7007-usb.c:1118 [] usb_probe_interface+0x314/0x7f0 drivers/usb/core/driver.c:396 [] really_probe+0x291/0xf60 drivers/base/dd.c:576 Fixes: 137641287eb4 ("go7007: add sanity checking for endpoints") Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 08413fca62c63ccd245d20985460759c84499ebc Author: Vijendar Mukunda Date: Wed Jul 21 23:34:28 2021 +0530 ASoC: amd: enable vangogh acp5x driver build Vangogh ACP5x drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-13-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 361414dc1f07b72f2f6942fca60f2f158c022a6d Author: Vijendar Mukunda Date: Wed Jul 21 23:34:27 2021 +0530 ASoC: amd: add vangogh i2s dma driver pm ops Add Vangogh i2s dma driver pm ops Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-12-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit b0a37ac6782fa0a62cf90e40e81e01728b07922a Author: Vijendar Mukunda Date: Wed Jul 21 23:34:26 2021 +0530 ASoC: amd: add vangogh pci driver pm ops Add Vangogh acp pci driver pm ops. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-11-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit b80556addd1a0db551a0c82fb9651e502ac0119b Author: Vijendar Mukunda Date: Wed Jul 21 23:34:25 2021 +0530 ASoC: amd: add vangogh i2s dai driver ops Add Vangogh i2s dai driver ops. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-10-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit e550339ee65226b059b4647f12c16710181e36b2 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:24 2021 +0530 ASoC: amd: add vangogh i2s controller driver Add Vangogh I2S controller driver to support two I2S controller instances. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-9-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit cab396d8b22c13b424d9ba66f626f036f802658c Author: Vijendar Mukunda Date: Wed Jul 21 23:34:23 2021 +0530 ASoC: amd: add ACP5x pcm dma driver ops This patch adds ACP5x PCM driver DMA operations. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-8-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit fc2c8067c76b3f322447491efb9837f051e86c69 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:22 2021 +0530 ASoC: amd: irq handler changes for ACP5x PCM dma driver Whenever audio data equal to the I2S FIFO watermark level are produced/consumed, interrupt is generated. Acknowledge the interrupt. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-7-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 77f61444e48b79e991b15da6399cf24685a042c9 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:21 2021 +0530 ASoC: amd: add ACP5x PCM platform driver PCM platform driver binds to the platform device created by ACP5x PCI device. PCM driver registers ALSA DMA components with ASoC framework. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-6-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 603f2dedccac1ae2d201dfb10df74f3cae3c7832 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:20 2021 +0530 ASoC: amd: create acp5x platform devices ACP5.x IP has multiple I2S controllers and DMA controller. Create platform devices for I2S HS controller instance, I2S SP controller instance and DMA controller. Pass PCI resources like MMIO, irq to these platform devices. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 5d9ee88a10e854c5c43e0ae6b1bb0ff454cd45d1 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:19 2021 +0530 ASoc: amd: add acp5x init/de-init functions Add Vangogh ACP PCI driver init/deinit functions. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 4a7151c9688cc166ff6bf5a1a00e3cee429a2f11 Author: Vijendar Mukunda Date: Wed Jul 21 23:34:18 2021 +0530 ASoC: amd: add Vangogh ACP PCI driver ACP is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 7bf060d0d579129e5f405d2300fbaa5222e3d1cb Author: Vijendar Mukunda Date: Wed Jul 21 23:34:17 2021 +0530 ASoC: amd: add Vangogh ACP5x IP register header Add register header for ACP5x IP in Vangogh platform. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20210721180430.11571-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit e3aa9acc71778266cc4743217ff1a1a53caf15d6 Author: Andy Shevchenko Date: Wed Jul 21 15:15:20 2021 +0300 spi: pxa2xx: Adapt reset_sccr1() to the case when no message available In some cases reset_sccr1() can be called when no message available. This means that there is no associated chip to receive that message and hence no threshold needs to be set. Adapt the function to such cases. Fixes: 3bbdc083262d ("spi: pxa2xx: Reuse int_stop_and_reset() in couple of places") Reported-by: Dan Carpenter Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210721121520.62605-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit d0f95e6496a974a890df5eda65ffaee66ab0dc73 Author: Chris Morgan Date: Wed Jul 21 11:57:16 2021 -0500 regulator: fixed: use dev_err_probe for register Instead of returning error directly, use dev_err_probe. This avoids messages in the dmesg log for devices which will be probed again later. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20210721165716.19915-1-macroalpha82@gmail.com Signed-off-by: Mark Brown commit 63fb60c2fcc94d595a184fa187bdfb25e5ecd4a2 Author: Sonia Sharma Date: Wed Jul 21 14:41:03 2021 -0700 hv: hyperv.h: Remove unused inline functions There are some unused inline functions in hyper.h. Remove those unused functions. Signed-off-by: Sonia Sharma Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1626903663-23615-1-git-send-email-sosha@linux.microsoft.com Signed-off-by: Wei Liu commit 0f4651359a235a702b383076fc2ccbd90d9bedb4 Author: Jason Ekstrand Date: Wed Jul 21 10:23:58 2021 -0500 drm/i915: Make the kmem slab for i915_buddy_block a global There's no reason that I can tell why this should be per-i915_buddy_mm and doing so causes KMEM_CACHE to throw dmesg warnings because it tries to create a debugfs entry with the name i915_buddy_block multiple times. We could handle this by carefully giving each slab its own name but that brings its own pain because then we have to store that string somewhere and manage the lifetimes of the different slabs. The most likely outcome would be a global atomic which we increment to get a new name or something like that. The much easier solution is to use the i915_globals system like we do for every other slab in i915. This ensures that we have exactly one of them for each i915 driver load and it gets neatly created on module load and destroyed on module unload. Using the globals system also means that its now tied into the shrink handler so we can properly respond to low-memory situations. Signed-off-by: Jason Ekstrand Fixes: 88be9a0a06b7 ("drm/i915/ttm: add ttm_buddy_man") Reviewed-by: Matthew Auld Cc: Matthew Auld Cc: Christian König [danvet: Rebase against removal of global shrink code] Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-7-jason@jlekstrand.net commit a04ea6ae7c6728cd834709f3477e75d4f74583da Author: Jason Ekstrand Date: Wed Jul 21 10:23:55 2021 -0500 drm/i915: Use a table for i915_init/exit (v2) If the driver was not fully loaded, we may still have globals lying around. If we don't tear those down in i915_exit(), we'll leak a bunch of memory slabs. This can happen two ways: use_kms = false and if we've run mock selftests. In either case, we have an early exit from i915_init which happens after i915_globals_init() and we need to clean up those globals. The mock selftests case is especially sticky. The load isn't entirely a no-op. We actually do quite a bit inside those selftests including allocating a bunch of mock objects and running tests on them. Once all those tests are complete, we exit early from i915_init(). Perviously, i915_init() would return a non-zero error code on failure and a zero error code on success. In the success case, we would get to i915_exit() and check i915_pci_driver.driver.owner to detect if i915_init exited early and do nothing. In the failure case, we would fail i915_init() but there would be no opportunity to clean up globals. The most annoying part is that you don't actually notice the failure as part of the self-tests since leaking a bit of memory, while bad, doesn't result in anything observable from userspace. Instead, the next time we load the driver (usually for next IGT test), i915_globals_init() gets invoked again, we go to allocate a bunch of new memory slabs, those implicitly create debugfs entries, and debugfs warns that we're trying to create directories and files that already exist. Since this all happens as part of the next driver load, it shows up in the dmesg-warn of whatever IGT test ran after the mock selftests. While the obvious thing to do here might be to call i915_globals_exit() after selftests, that's not actually safe. The dma-buf selftests call i915_gem_prime_export which creates a file. We call dma_buf_put() on the resulting dmabuf which calls fput() on the file. However, fput() isn't immediate and gets flushed right before syscall returns. This means that all the fput()s from the selftests don't happen until right before the module load syscall used to fire off the selftests returns which is after i915_init(). If we call i915_globals_exit() in i915_init() after selftests, we end up freeing slabs out from under objects which won't get released until fput() is flushed at the end of the module load syscall. The solution here is to let i915_init() return success early and detect the early success in i915_exit() and only tear down globals and nothing else. This way the module loads successfully, regardless of the success or failure of the tests. Because we've not enumerated any PCI devices, no device nodes are created and it's entirely useless from userspace. The only thing the module does at that point is hold on to a bit of memory until we unload it and i915_exit() is called. Importantly, this means that everything from our selftests has the ability to properly flush out between i915_init() and i915_exit() because there is at least one syscall boundary in between. In order to handle all the delicate init/exit cases, we convert the whole thing to a table of init/exit pairs and track the init status in the new init_progress global. This allows us to ensure that i915_exit() always tears down exactly the things that i915_init() successfully initialized. We also allow early-exit of i915_init() without failure by an init function returning > 0. This is useful for nomodeset, and selftests. For the mock selftests, we convert them to always return 1 so we get the desired behavior of the driver always succeeding to load the driver and then properly tearing down the partially loaded driver. v2 (Tvrtko Ursulin): - Guard init_funcs[i].exit with GEM_BUG_ON(i >= ARRAY_SIZE(init_funcs)) v2 (Daniel Vetter): - Update the docstring for i915.mock_selftests Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Cc: Tvrtko Ursulin Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-4-jason@jlekstrand.net commit db484889d1ff0645e07e360d3e3ad306c0515821 Author: Jason Ekstrand Date: Wed Jul 21 10:23:54 2021 -0500 drm/i915: Call i915_globals_exit() if pci_register_device() fails In the unlikely event that pci_register_device() fails, we were tearing down our PMU setup but not globals. This leaves a bunch of memory slabs lying around. Signed-off-by: Jason Ekstrand Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") [danvet: Fix conflicts against removal of the globals_flush infrastructure.] Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-3-jason@jlekstrand.net commit 75d3bf84dfca2fd3f83125eb68f0f55c7018d4de Author: Jason Ekstrand Date: Wed Jul 21 10:23:53 2021 -0500 drm/i915: Call i915_globals_exit() after i915_pmu_exit() We should tear down in the opposite order we set up. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Reviewed-by: Tvrtko Ursulin Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-2-jason@jlekstrand.net commit d656132d2a2abc06917d822f7adcda86fd6dd192 Author: Masahiro Yamada Date: Thu Apr 1 00:06:57 2021 +0900 mips: clean up kvm Makefile You can use kvm-y instead of kvm-objs to create the composite module. kvm-$(CONFIG_...) looks cleaner. Signed-off-by: Masahiro Yamada Signed-off-by: Thomas Bogendoerfer commit d17eef2767d84b7dc4e1b8029be1eacb1d8679f6 Author: Masahiro Yamada Date: Thu Apr 1 00:06:56 2021 +0900 mips: replace deprecated EXTRA_CFLAGS with ccflags-y As Documentation/kbuild/makefiles.rst says, EXTRA_CFLAGS is deprecated. Replace it with ccflags-y. Signed-off-by: Masahiro Yamada Signed-off-by: Thomas Bogendoerfer commit 73b9919f3c17851b4c1d90fb6c343d9c438c554c Author: Randy Dunlap Date: Mon Jul 19 21:34:32 2021 -0700 mips: netlogic: fix kernel-doc complaints in fmn-config.c Clean up kernel-doc warnings in netlogic/xlr/fmn-config.c by using correct kernel-doc format. Fixes these warnings: arch/mips/netlogic/xlr/fmn-config.c:106: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Configure bucket size and credits for a device. 'size' is the size of arch/mips/netlogic/xlr/fmn-config.c:181: warning: expecting prototype for Setup the FMN details for each devices according to the device available(). Prototype was for xlr_board_info_setup() instead Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Ganesan Ramalingam Cc: John Crispin Cc: Aditya Srivastava Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit faff43da31ae469ff28d71af4aa47f0c08b0b26c Author: Randy Dunlap Date: Mon Jul 19 21:16:17 2021 -0700 mips: cavium-octeon: clean up kernel-doc in cvmx-interrupt-decodes.c Fix kernel-doc warnings reported by kernel test robot: arch/mips/cavium-octeon/executive/cvmx-interrupt-decodes.c:49: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * __cvmx_interrupt_gmxx_rxx_int_en_enable enables all interrupt bits in cvmx_gmxx_rxx_int_en_t arch/mips/cavium-octeon/executive/cvmx-interrupt-decodes.c:230: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * __cvmx_interrupt_pcsx_intx_en_reg_enable enables all interrupt bits in cvmx_pcsx_intx_en_reg_t arch/mips/cavium-octeon/executive/cvmx-interrupt-decodes.c:271: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * __cvmx_interrupt_pcsxx_int_en_reg_enable enables all interrupt bits in cvmx_pcsxx_int_en_reg_t arch/mips/cavium-octeon/executive/cvmx-interrupt-decodes.c:301: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * __cvmx_interrupt_spxx_int_msk_enable enables all interrupt bits in cvmx_spxx_int_msk_t arch/mips/cavium-octeon/executive/cvmx-interrupt-decodes.c:340: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * __cvmx_interrupt_stxx_int_msk_enable enables all interrupt bits in cvmx_stxx_int_msk_t Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: David Daney Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 474596fc749ca8c87520fbd3529ff89464a94430 Author: Maxime Ripard Date: Wed Jul 21 16:03:41 2021 +0200 dt-bindings: display: simple-bridge: Add corpro,gm7123 compatible The corpro,gm7123 was in use in a DT but was never properly documented, let's add it. Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart Signed-off-by: Maxime Ripard Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210721140424.725744-12-maxime@cerno.tech commit ed771d75af3cf7e8747ab6a5c207cd920fe0adaa Author: Matthew Michilot Date: Fri Jun 4 23:22:17 2021 +0200 media: i2c: adv7180: fix adv7280 BT.656-4 compatibility Captured video would be out of sync when using the adv7280 with the BT.656-4 protocol. Certain registers (0x04, 0x31, 0xE6) had to be configured properly to ensure BT.656-4 compatibility. An error in the adv7280 reference manual suggested that EAV/SAV mode was enabled by default, however upon inspecting register 0x31, it was determined to be disabled by default. [fabio: Introduce "adv,force-bt656-4" to not affect the existing users] [hverkuil: fix a small checkpatch alignment warning] Signed-off-by: Matthew Michilot Reviewed-by: Tim Harvey Signed-off-by: Fabio Estevam Tested-by: Tim Harvey Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 28d1e47694aff751cfb1d86a2f9701f0a22e5f1e Author: Fabio Estevam Date: Fri Jun 4 23:22:16 2021 +0200 media: dt-bindings: adv7180: Introduce 'adv,force-bt656-4' property Captured NTSC video would be out of sync when using the adv7280 with the BT.656-4 protocol. Certain registers (0x04, 0x31, 0xE6) need to be configured properly to ensure BT.656-4 compatibility. Introduce the 'adv,force-bt656-4' property to allow the ADV7280 behavior to be consistent with the ADV7180, where BT.656-4 timing is used by default. Signed-off-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f7b96a9f350c95495ebdba55780b4a63aa677a64 Author: Fabio Estevam Date: Mon May 31 13:22:37 2021 +0200 media: i2c: adv7180: Print the chip ID on probe Improve the probe message by printing the chip ID version. Signed-off-by: Fabio Estevam Reviewed-by: Frieder Schrempf Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit abb7c7c2f025e5f5f80359809e5c73549614306b Author: Frieder Schrempf Date: Mon May 31 13:22:36 2021 +0200 media: adv7180: Add optional reset GPIO There is a reset input that can be controlled by GPIO. Let's add it to let the driver control it if required. [hverkuil: fix a small checkpatch alignment warning] Signed-off-by: Frieder Schrempf Signed-off-by: Fabio Estevam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 724fae95889684377c85f85a0ddd7e9846d00752 Author: Fabio Estevam Date: Mon May 31 13:22:35 2021 +0200 media: dt-bindings: adv7180: Introduce the 'reset-gpios' property Introduce the 'reset-gpios' property to describe the GPIO that connects to the ADV7180 reset pin. Signed-off-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 176f716cb72fea93d60cb378a3e02d4b630b93c2 Author: Matthieu Baerts Date: Thu Jul 22 09:55:04 2021 +0200 ipv6: fix "'ioam6_if_id_max' defined but not used" warn When compiling without CONFIG_SYSCTL, this warning appears: net/ipv6/addrconf.c:99:12: error: 'ioam6_if_id_max' defined but not used [-Werror=unused-variable] 99 | static u32 ioam6_if_id_max = U16_MAX; | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Simply moving the declaration of this variable under ... #ifdef CONFIG_SYSCTL ... with other similar variables fixes the issue. Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace") Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 552a2a3f3dc7909ea2aeeb349b32671bd7e68cd1 Merge: 802a76affb092 40c10bd9be3fe Author: David S. Miller Date: Thu Jul 22 02:22:37 2021 -0700 Merge branch 'nfp-flower-ct-offload' Simon Horman says: ==================== nfp: flower: conntrack offload Louis Peens says: This series takes the preparation from previous two series and finally creates the structures and control messages to offload the conntrack flows to the card. First we do a bit of refactoring in the existing functions to make them re-usable for the conntrack implementation, after which the control messages are compiled and transmitted to the card. Lastly we add stats handling for the conntrack flows. ==================== Signed-off-by: David S. Miller commit 40c10bd9be3fec47062cd9c074d83854832fe825 Author: Louis Peens Date: Thu Jul 22 09:58:08 2021 +0200 nfp: flower-tc: add flow stats updates for ct Add in the logic to update flow stats. The flow stats from the nfp is saved in the flow_pay struct, which is associated with the final merged flow. This saves deltas however, so once read it needs to be cleared. However the flow stats requests from the kernel is from the other side of the chain, and a single tc flow from the kernel can be merged into multiple other tc flows to form multiple offloaded flows. This means that all linked flows needs to be updated for each stats request. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 400a5e5f15a6a64bd4aed59af703efe748a8778a Author: Louis Peens Date: Thu Jul 22 09:58:07 2021 +0200 nfp: flower-ct: add offload calls to the nfp Add the offload parts (ADD_FLOW/DEL_FLOW) calls to add and delete the flows from the nfp. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 453cdc3083a61ab6d9b81c57251b2b241d56d704 Author: Louis Peens Date: Thu Jul 22 09:58:06 2021 +0200 nfp: flower-ct: add flow_pay to the offload table Compile the offload flow metadata and add flow_pay to the offload table. Also add in the delete paths. This does not include actual offloading to the card yet, this will follow soon. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit d94a63b480c1c3f71adf8cc2731573122b704be7 Author: Louis Peens Date: Thu Jul 22 09:58:05 2021 +0200 nfp: flower-ct: add actions into flow_pay for offload Combine the actions from the three different rules into one and convert into the payload format expected by the nfp. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 5a2b930416462a2ff09e507728ccfbfa7cb65ed8 Author: Louis Peens Date: Thu Jul 22 09:58:04 2021 +0200 nfp: flower-ct: compile match sections of flow_payload Add in the code to compile match part of the payload that will be sent to the firmware. This works similar to match.c does it, but since three flows needs to be merged it iterates through all three rules in a loop and combine the match fields to get the most strict match as result. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 71e88cfb92601a50e965389a507a71df12056b20 Author: Louis Peens Date: Thu Jul 22 09:58:03 2021 +0200 nfp: flower-ct: calculate required key_layers This calculates the correct combined keylayers and key_layer_size for the to-be-offloaded flow. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e75dc2650770575299d98d28e25ae98c20dc8bf9 Author: Louis Peens Date: Thu Jul 22 09:58:02 2021 +0200 nfp: flower: refactor action offload code slightly Change the action related offload functions to take in flow_rule * as input instead of flow_cls_offload * as input. The flow_rule parts of flow_cls_offload is the only part that is used in any case, and this is required for more conntrack offload patches which will follow later. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 4b15fb187688b74a946e44367d2f1a9a528fa320 Author: Louis Peens Date: Thu Jul 22 09:58:01 2021 +0200 nfp: flower: refactor match functions to take flow_rule as input This is a small cleanup to pass in flow->rule to some of the compile functions instead of extracting it every time. This is will also be useful for conntrack patches later. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 16416d37f0e7b274b425ad5636a10a5c85ad4ab5 Author: Yinjun Zhang Date: Thu Jul 22 09:58:00 2021 +0200 nfp: flower: make the match compilation functions reusable Expose and refactor the match compilation functions so that they can be invoked externally. Also update the functions so they can be called multiple times with the results OR'd together. This is applicable for the flows-merging scenario, in which there could be overlapped and non-conflicting match fields. This will be used in upcoming conntrack patches. This is safe to do in the in the single call case as well since both unmasked_data and mask_data gets initialised to 0. Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 4f62a7e0d3338771261a945ceb87182e911a4f71 Author: Daniel Vetter Date: Wed Jul 21 20:32:29 2021 +0200 drm/i915: Ditch i915 globals shrink infrastructure This essentially reverts commit 84a1074920523430f9dc30ff907f4801b4820072 Author: Chris Wilson Date: Wed Jan 24 11:36:08 2018 +0000 drm/i915: Shrink the GEM kmem_caches upon idling mm/vmscan.c:do_shrink_slab() is a thing, if there's an issue with it then we need to fix that there, not hand-roll our own slab shrinking code in i915. Also when this was added there was only one other caller of kmem_cache_shrink (added 2005 to the acpi code). Now there's a 2nd one outside of i915 code in a kunit test, which seems legit since that wants to very carefully control what's in the kmem_cache. This out of a total of over 500 calls to kmem_cache_create. This alone should have been warning sign enough that we're doing something silly. Noticed while reviewing a patch set from Jason to fix up some issues in our i915_init() and i915_exit() module load/cleanup code. Now that i915_globals.c isn't any different than normal init/exit functions, we should convert them over to one unified table and remove i915_globals.[hc] entirely. v2: Improve commit message (Jason) Reviewed-by: Jason Ekstrand Cc: David Airlie Cc: Jason Ekstrand Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210721183229.4136488-1-daniel.vetter@ffwll.ch commit c1302e8ce517ed9c417aa4eb19776df4efbbebf4 Author: Arnd Bergmann Date: Wed Jul 21 17:25:42 2021 +0200 phy: tegra: xusb: mark PM functions as __maybe_unused When these are not referenced, gcc prints a harmless warning: drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function] 1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function] 1276 | static int tegra_xusb_padctl_suspend_noirq(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: c545a9056712 ("phy: tegra: xusb: Add sleepwalk and suspend/resume") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210721152550.2976003-1-arnd@kernel.org Signed-off-by: Vinod Koul commit bfccd9a71a08627bcccd40277967516ddd9d5db2 Author: Bjorn Andersson Date: Wed Jul 21 09:30:29 2021 -0700 phy: qcom-qmp: Fix sc8180x PCIe definition A copy paste error was snuck into the patch going upstream that made the SC8180x PCIe PHY use the SM8250 serdes table, but while this works there's some differences in the tables (and the SC8180x was left dangling). So correct the SC8180x definition to use the SC8180x serdes table. Fixes: f839f14e24f2 ("phy: qcom-qmp: Add sc8180x PCIe support") Reported-by: kernel test robot Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210721163029.2813497-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 802a76affb09263ab6bca9a6ff4765b3a0c40137 Author: Oleksij Rempel Date: Thu Jul 22 09:34:27 2021 +0200 net: selftests: add MTU test Test if we actually can send/receive packets with MTU size. This kind of issue was detected on ASIX HW with bogus EEPROM. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit 9c2670951ed03f8fc6c701d66f5c765929cf1f23 Author: Oleksij Rempel Date: Thu Jul 22 09:32:24 2021 +0200 net: usb: asix: ax88772: add missing stop Add missing stop and let phylib framework suspend attached PHY. Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support") Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit fdc362bff9132e2e15e75d1ac830f91d2d9dee41 Author: Oleksij Rempel Date: Thu Jul 22 09:23:38 2021 +0200 net: usb: asix: ax88772: do not poll for PHY before registering it asix_get_phyid() is used for two reasons here. To print debug message with the PHY ID and to wait until the PHY is powered up. After migrating to the phylib, we can read PHYID from sysfs. If polling for the PHY is really needed, then we will need to handle it in the phylib as well. This change was tested with: - ax88772a + internal PHY - ax88772b + external PHY Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit 2b0a5688493ab0f54774a2f89d3d91ab238f7ab4 Author: Vladimir Oltean Date: Thu Jul 22 02:05:55 2021 +0300 net: switchdev: fix FDB entries towards foreign ports not getting propagated to us The newly introduced switchdev_handle_fdb_{add,del}_to_device helpers solved a problem but introduced another one. They have a severe design bug: they do not propagate FDB events on foreign interfaces to us, i.e. this use case: br0 / \ / \ / \ / \ swp0 eno0 (switchdev) (foreign) when an address is learned on eno0, what is supposed to happen is that this event should also be propagated towards swp0. Somehow I managed to convince myself that this did work correctly, but obviously it does not. The trouble with foreign interfaces is that we must reach a switchdev net_device pointer through a foreign net_device that has no direct upper/lower relationship with it. So we need to do exploratory searching through the lower interfaces of the foreign net_device's bridge upper (to reach swp0 from eno0, we must check its upper, br0, for lower interfaces that pass the check_cb and foreign_dev_check_cb). This is something that the previous code did not do, it just assumed that "dev" will become a switchdev interface at some point, somehow, probably by magic. With this patch, assisted address learning on the CPU port works again in DSA: ip link add br0 type bridge ip link set swp0 master br0 ip link set eno0 master br0 ip link set br0 up [ 46.708929] mscc_felix 0000:00:00.5 swp0: Adding FDB entry towards eno0, addr 00:04:9f:05:f4:ab vid 0 as host address Fixes: 8ca07176ab00 ("net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE") Reported-by: Eric Woudstra Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f796fcd613a97f39cea2629ac39cc040158812d0 Merge: c2255ff47768c 4e51bf44a03af Author: David S. Miller Date: Thu Jul 22 00:26:43 2021 -0700 Merge branch 'bridge-port-offload' Vladimir Oltean says: ==================== Let switchdev drivers offload and unoffload bridge ports at their own convenience This series introduces an explicit API through which switchdev drivers mark a bridge port as offloaded or not: - switchdev_bridge_port_offload() - switchdev_bridge_port_unoffload() Currently, the bridge assumes that a port is offloaded if dev_get_port_parent_id(dev, &ppid, recurse=true) returns something, but that is just an assumption that breaks some use cases (like a non-offloaded LAG interface on top of a switchdev port, bridged with other switchdev ports). Along with some consolidation of the bridge logic to assign a "switchdev offloading mark" to a port (now better called a "hardware domain"), this series allows the bridge driver side to no longer impose restrictions on that configuration. Right now, all switchdev drivers must be modified to use the explicit API, but more and more logic can then be placed centrally in the bridge and therefore ease the job of a switchdev driver writer in the future. For example, the first thing we can hook into the explicit switchdev offloading API calls are the switchdev object and FDB replay helpers. So far, these have only been used by DSA in "pull" mode (where the driver must ask for them). Adding the replay helpers to other drivers involves a lot of repetition. But by moving the helpers inside the bridge port offload/unoffload hook points, we can move the entire replay process to "push" mode (where the bridge provides them automatically). The explicit switchdev offloading API will see further extensions in the future. The patches were split from a larger series for easier review: https://patchwork.kernel.org/project/netdevbpf/cover/20210718214434.3938850-1-vladimir.oltean@nxp.com/ Changes in v6: - Make the switchdev replay helpers opt-in - Opt out of the replay helpers for mlxsw, rocker, prestera, sparx5, cpsw, am65-cpsw ==================== Signed-off-by: David S. Miller commit 4e51bf44a03af6fa19a39a36ea8fedfacb8ccadf Author: Vladimir Oltean Date: Wed Jul 21 19:24:03 2021 +0300 net: bridge: move the switchdev object replay helpers to "push" mode Starting with commit 4f2673b3a2b6 ("net: bridge: add helper to replay port and host-joined mdb entries"), DSA has introduced some bridge helpers that replay switchdev events (FDB/MDB/VLAN additions and deletions) that can be lost by the switchdev drivers in a variety of circumstances: - an IP multicast group was host-joined on the bridge itself before any switchdev port joined the bridge, leading to the host MDB entries missing in the hardware database. - during the bridge creation process, the MAC address of the bridge was added to the FDB as an entry pointing towards the bridge device itself, but with no switchdev ports being part of the bridge yet, this local FDB entry would remain unknown to the switchdev hardware database. - a VLAN/FDB/MDB was added to a bridge port that is a LAG interface, before any switchdev port joined that LAG, leading to the hardware database missing those entries. - a switchdev port left a LAG that is a bridge port, while the LAG remained part of the bridge, and all FDB/MDB/VLAN entries remained installed in the hardware database of the switchdev port. Also, since commit 0d2cfbd41c4a ("net: bridge: ignore switchdev events for LAG ports which didn't request replay"), DSA introduced a method, based on a const void *ctx, to ensure that two switchdev ports under the same LAG that is a bridge port do not see the same MDB/VLAN entry being replayed twice by the bridge, once for every bridge port that joins the LAG. With so many ordering corner cases being possible, it seems unreasonable to expect a switchdev driver writer to get it right from the first try. Therefore, now that DSA has experimented with the bridge replay helpers for a little bit, we can move the code to the bridge driver where it is more readily available to all switchdev drivers. To convert the switchdev object replay helpers from "pull mode" (where the driver asks for them) to a "push mode" (where the bridge offers them automatically), the biggest problem is that the bridge needs to be aware when a switchdev port joins and leaves, even when the switchdev is only indirectly a bridge port (for example when the bridge port is a LAG upper of the switchdev). Luckily, we already have a hook for that, in the form of the newly introduced switchdev_bridge_port_offload() and switchdev_bridge_port_unoffload() calls. These offer a natural place for hooking the object addition and deletion replays. Extend the above 2 functions with: - pointers to the switchdev atomic notifier (for FDB replays) and the blocking notifier (for MDB and VLAN replays). - the "const void *ctx" argument required for drivers to be able to disambiguate between which port is targeted, when multiple ports are lowers of the same LAG that is a bridge port. Most of the drivers pass NULL to this argument, except the ones that support LAG offload and have the proper context check already in place in the switchdev blocking notifier handler. Also unexport the replay helpers, since nobody except the bridge calls them directly now. Note that: (a) we abuse the terminology slightly, because FDB entries are not "switchdev objects", but we count them as objects nonetheless. With no direct way to prove it, I think they are not modeled as switchdev objects because those can only be installed by the bridge to the hardware (as opposed to FDB entries which can be propagated in the other direction too). This is merely an abuse of terms, FDB entries are replayed too, despite not being objects. (b) the bridge does not attempt to sync port attributes to newly joined ports, just the countable stuff (the objects). The reason for this is simple: no universal and symmetric way to sync and unsync them is known. For example, VLAN filtering: what to do on unsync, disable or leave it enabled? Similarly, STP state, ageing timer, etc etc. What a switchdev port does when it becomes standalone again is not really up to the bridge's competence, and the driver should deal with it. On the other hand, replaying deletions of switchdev objects can be seen a matter of cleanup and therefore be treated by the bridge, hence this patch. We make the replay helpers opt-in for drivers, because they might not bring immediate benefits for them: - nbp_vlan_init() is called _after_ netdev_master_upper_dev_link(), so br_vlan_replay() should not do anything for the new drivers on which we call it. The existing drivers where there was even a slight possibility for there to exist a VLAN on a bridge port before they join it are already guarded against this: mlxsw and prestera deny joining LAG interfaces that are members of a bridge. - br_fdb_replay() should now notify of local FDB entries, but I patched all drivers except DSA to ignore these new entries in commit 2c4eca3ef716 ("net: bridge: switchdev: include local flag in FDB notifications"). Driver authors can lift this restriction as they wish, and when they do, they can also opt into the FDB replay functionality. - br_mdb_replay() should fix a real issue which is described in commit 4f2673b3a2b6 ("net: bridge: add helper to replay port and host-joined mdb entries"). However most drivers do not offload the SWITCHDEV_OBJ_ID_HOST_MDB to see this issue: only cpsw and am65_cpsw offload this switchdev object, and I don't completely understand the way in which they offload this switchdev object anyway. So I'll leave it up to these drivers' respective maintainers to opt into br_mdb_replay(). So most of the drivers pass NULL notifier blocks for the replay helpers, except: - dpaa2-switch which was already acked/regression-tested with the helpers enabled (and there isn't much of a downside in having them) - ocelot which already had replay logic in "pull" mode - DSA which already had replay logic in "pull" mode An important observation is that the drivers which don't currently request bridge event replays don't even have the switchdev_bridge_port_{offload,unoffload} calls placed in proper places right now. This was done to avoid unnecessary rework for drivers which might never even add support for this. For driver writers who wish to add replay support, this can be used as a tentative placement guide: https://patchwork.kernel.org/project/netdevbpf/patch/20210720134655.892334-11-vladimir.oltean@nxp.com/ Cc: Vadym Kochan Cc: Taras Chornyi Cc: Ioana Ciornei Cc: Lars Povlsen Cc: Steen Hegelund Cc: UNGLinuxDriver@microchip.com Cc: Claudiu Manoil Cc: Alexandre Belloni Cc: Grygorii Strashko Signed-off-by: Vladimir Oltean Acked-by: Ioana Ciornei # dpaa2-switch Signed-off-by: David S. Miller commit 7105b50b7eecae62cf6175507f9ea9ff60a55816 Author: Vladimir Oltean Date: Wed Jul 21 19:24:02 2021 +0300 net: bridge: guard the switchdev replay helpers against a NULL notifier block There is a desire to make the object and FDB replay helpers optional when moving them inside the bridge driver. For example a certain driver might not offload host MDBs and there is no case where the replay helpers would be of immediate use to it. So it would be nice if we could allow drivers to pass NULL pointers for the atomic and blocking notifier blocks, and the replay helpers to do nothing in that case. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 2f5dc00f7a3ea669fd387ce79ffca92bff361550 Author: Vladimir Oltean Date: Wed Jul 21 19:24:01 2021 +0300 net: bridge: switchdev: let drivers inform which bridge ports are offloaded On reception of an skb, the bridge checks if it was marked as 'already forwarded in hardware' (checks if skb->offload_fwd_mark == 1), and if it is, it assigns the source hardware domain of that skb based on the hardware domain of the ingress port. Then during forwarding, it enforces that the egress port must have a different hardware domain than the ingress one (this is done in nbp_switchdev_allowed_egress). Non-switchdev drivers don't report any physical switch id (neither through devlink nor .ndo_get_port_parent_id), therefore the bridge assigns them a hardware domain of 0, and packets coming from them will always have skb->offload_fwd_mark = 0. So there aren't any restrictions. Problems appear due to the fact that DSA would like to perform software fallback for bonding and team interfaces that the physical switch cannot offload. +-- br0 ---+ / / | \ / / | \ / | | bond0 / | | / \ swp0 swp1 swp2 swp3 swp4 There, it is desirable that the presence of swp3 and swp4 under a non-offloaded LAG does not preclude us from doing hardware bridging beteen swp0, swp1 and swp2. The bandwidth of the CPU is often times high enough that software bridging between {swp0,swp1,swp2} and bond0 is not impractical. But this creates an impossible paradox given the current way in which port hardware domains are assigned. When the driver receives a packet from swp0 (say, due to flooding), it must set skb->offload_fwd_mark to something. - If we set it to 0, then the bridge will forward it towards swp1, swp2 and bond0. But the switch has already forwarded it towards swp1 and swp2 (not to bond0, remember, that isn't offloaded, so as far as the switch is concerned, ports swp3 and swp4 are not looking up the FDB, and the entire bond0 is a destination that is strictly behind the CPU). But we don't want duplicated traffic towards swp1 and swp2, so it's not ok to set skb->offload_fwd_mark = 0. - If we set it to 1, then the bridge will not forward the skb towards the ports with the same switchdev mark, i.e. not to swp1, swp2 and bond0. Towards swp1 and swp2 that's ok, but towards bond0? It should have forwarded the skb there. So the real issue is that bond0 will be assigned the same hardware domain as {swp0,swp1,swp2}, because the function that assigns hardware domains to bridge ports, nbp_switchdev_add(), recurses through bond0's lower interfaces until it finds something that implements devlink (calls dev_get_port_parent_id with bool recurse = true). This is a problem because the fact that bond0 can be offloaded by swp3 and swp4 in our example is merely an assumption. A solution is to give the bridge explicit hints as to what hardware domain it should use for each port. Currently, the bridging offload is very 'silent': a driver registers a netdevice notifier, which is put on the netns's notifier chain, and which sniffs around for NETDEV_CHANGEUPPER events where the upper is a bridge, and the lower is an interface it knows about (one registered by this driver, normally). Then, from within that notifier, it does a bunch of stuff behind the bridge's back, without the bridge necessarily knowing that there's somebody offloading that port. It looks like this: ip link set swp0 master br0 | v br_add_if() calls netdev_master_upper_dev_link() | v call_netdevice_notifiers | v dsa_slave_netdevice_event | v oh, hey! it's for me! | v .port_bridge_join What we do to solve the conundrum is to be less silent, and change the switchdev drivers to present themselves to the bridge. Something like this: ip link set swp0 master br0 | v br_add_if() calls netdev_master_upper_dev_link() | v bridge: Aye! I'll use this call_netdevice_notifiers ^ ppid as the | | hardware domain for v | this port, and zero dsa_slave_netdevice_event | if I got nothing. | | v | oh, hey! it's for me! | | | v | .port_bridge_join | | | +------------------------+ switchdev_bridge_port_offload(swp0, swp0) Then stacked interfaces (like bond0 on top of swp3/swp4) would be treated differently in DSA, depending on whether we can or cannot offload them. The offload case: ip link set bond0 master br0 | v br_add_if() calls netdev_master_upper_dev_link() | v bridge: Aye! I'll use this call_netdevice_notifiers ^ ppid as the | | switchdev mark for v | bond0. dsa_slave_netdevice_event | Coincidentally (or not), | | bond0 and swp0, swp1, swp2 v | all have the same switchdev hmm, it's not quite for me, | mark now, since the ASIC but my driver has already | is able to forward towards called .port_lag_join | all these ports in hw. for it, because I have | a port with dp->lag_dev == bond0. | | | v | .port_bridge_join | for swp3 and swp4 | | | +------------------------+ switchdev_bridge_port_offload(bond0, swp3) switchdev_bridge_port_offload(bond0, swp4) And the non-offload case: ip link set bond0 master br0 | v br_add_if() calls netdev_master_upper_dev_link() | v bridge waiting: call_netdevice_notifiers ^ huh, switchdev_bridge_port_offload | | wasn't called, okay, I'll use a v | hwdom of zero for this one. dsa_slave_netdevice_event : Then packets received on swp0 will | : not be software-forwarded towards v : swp1, but they will towards bond0. it's not for me, but bond0 is an upper of swp3 and swp4, but their dp->lag_dev is NULL because they couldn't offload it. Basically we can draw the conclusion that the lowers of a bridge port can come and go, so depending on the configuration of lowers for a bridge port, it can dynamically toggle between offloaded and unoffloaded. Therefore, we need an equivalent switchdev_bridge_port_unoffload too. This patch changes the way any switchdev driver interacts with the bridge. From now on, everybody needs to call switchdev_bridge_port_offload and switchdev_bridge_port_unoffload, otherwise the bridge will treat the port as non-offloaded and allow software flooding to other ports from the same ASIC. Note that these functions lay the ground for a more complex handshake between switchdev drivers and the bridge in the future. For drivers that will request a replay of the switchdev objects when they offload and unoffload a bridge port (DSA, dpaa2-switch, ocelot), we place the call to switchdev_bridge_port_unoffload() strategically inside the NETDEV_PRECHANGEUPPER notifier's code path, and not inside NETDEV_CHANGEUPPER. This is because the switchdev object replay helpers need the netdev adjacency lists to be valid, and that is only true in NETDEV_PRECHANGEUPPER. Cc: Vadym Kochan Cc: Taras Chornyi Cc: Ioana Ciornei Cc: Lars Povlsen Cc: Steen Hegelund Cc: UNGLinuxDriver@microchip.com Cc: Claudiu Manoil Cc: Alexandre Belloni Cc: Grygorii Strashko Signed-off-by: Vladimir Oltean Tested-by: Ioana Ciornei # dpaa2-switch: regression Acked-by: Ioana Ciornei # dpaa2-switch Tested-by: Horatiu Vultur # ocelot-switch Signed-off-by: David S. Miller commit 8582661048eb64341edf73dd2ca828b4f039c5c2 Author: Tobias Waldekranz Date: Wed Jul 21 19:24:00 2021 +0300 net: bridge: switchdev: recycle unused hwdoms Since hwdoms have only been used thus far for equality comparisons, the bridge has used the simplest possible assignment policy; using a counter to keep track of the last value handed out. With the upcoming transmit offloading, we need to perform set operations efficiently based on hwdoms, e.g. we want to answer questions like "has this skb been forwarded to any port within this hwdom?" Move to a bitmap-based allocation scheme that recycles hwdoms once all members leaves the bridge. This means that we can use a single unsigned long to keep track of the hwdoms that have received an skb. v1->v2: convert the typedef DECLARE_BITMAP(br_hwdom_map_t, BR_HWDOM_MAX) into a plain unsigned long. v2->v6: none Signed-off-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f7cf972f9375388838b0fbdaa007ce8494646990 Author: Tobias Waldekranz Date: Wed Jul 21 19:23:59 2021 +0300 net: bridge: disambiguate offload_fwd_mark Before this change, four related - but distinct - concepts where named offload_fwd_mark: - skb->offload_fwd_mark: Set by the switchdev driver if the underlying hardware has already forwarded this frame to the other ports in the same hardware domain. - nbp->offload_fwd_mark: An idetifier used to group ports that share the same hardware forwarding domain. - br->offload_fwd_mark: Counter used to make sure that unique IDs are used in cases where a bridge contains ports from multiple hardware domains. - skb->cb->offload_fwd_mark: The hardware domain on which the frame ingressed and was forwarded. Introduce the term "hardware forwarding domain" ("hwdom") in the bridge to denote a set of ports with the following property: If an skb with skb->offload_fwd_mark set, is received on a port belonging to hwdom N, that frame has already been forwarded to all other ports in hwdom N. By decoupling the name from "offload_fwd_mark", we can extend the term's definition in the future - e.g. to add constraints that describe expected egress behavior - without overloading the meaning of "offload_fwd_mark". - nbp->offload_fwd_mark thus becomes nbp->hwdom. - br->offload_fwd_mark becomes br->last_hwdom. - skb->cb->offload_fwd_mark becomes skb->cb->src_hwdom. The slight change in naming here mandates a slight change in behavior of the nbp_switchdev_frame_mark() function. Previously, it only set this value in skb->cb for packets with skb->offload_fwd_mark true (ones which were forwarded in hardware). Whereas now we always track the incoming hwdom for all packets coming from a switchdev (even for the packets which weren't forwarded in hardware, such as STP BPDUs, IGMP reports etc). As all uses of skb->cb->offload_fwd_mark were already gated behind checks of skb->offload_fwd_mark, this will not introduce any functional change, but it paves the way for future changes where the ingressing hwdom must be known for frames coming from a switchdev regardless of whether they were forwarded in hardware or not (basically, if the skb comes from a switchdev, skb->cb->src_hwdom now always tracks which one). A typical example where this is relevant: the switchdev has a fixed configuration to trap STP BPDUs, but STP is not running on the bridge and the group_fwd_mask allows them to be forwarded. Say we have this setup: br0 / | \ / | \ swp0 swp1 swp2 A BPDU comes in on swp0 and is trapped to the CPU; the driver does not set skb->offload_fwd_mark. The bridge determines that the frame should be forwarded to swp{1,2}. It is imperative that forward offloading is _not_ allowed in this case, as the source hwdom is already "poisoned". Recording the source hwdom allows this case to be handled properly. v2->v3: added code comments v3->v6: none Signed-off-by: Tobias Waldekranz Signed-off-by: Vladimir Oltean Reviewed-by: Grygorii Strashko Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 45035febc49511d12e9687a83a3789767fe505e0 Author: Vladimir Oltean Date: Wed Jul 21 19:23:58 2021 +0300 net: dpaa2-switch: refactor prechangeupper sanity checks Make more room for some extra code in the NETDEV_PRECHANGEUPPER handler by moving what already exists into a dedicated function. Cc: Ioana Ciornei Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Ioana Ciornei Signed-off-by: David S. Miller commit 123338d7d41e7e900e506dbb3821db75a28948b9 Author: Vladimir Oltean Date: Wed Jul 21 19:23:57 2021 +0300 net: dpaa2-switch: use extack in dpaa2_switch_port_bridge_join We need to propagate the extack argument for dpaa2_switch_port_bridge_join to use it in a future patch, and it looks like there is already an error message there which is currently printed to the console. Move it over netlink so it is properly transmitted to user space. Cc: Ioana Ciornei Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Ioana Ciornei Acked-by: Ioana Ciornei Signed-off-by: David S. Miller commit 9cc969675dea496b6689f576ddd4d8fd172705c5 Author: Bjorn Andersson Date: Fri Jun 25 16:49:03 2021 -0700 interconnect: Sanity check that node isn't already on list Broken interconnect providers might add the same node multiple times or in multiple providers, which causes strange errors as the provider's node list is later traversed. Detect that a node already has an associated provider, complain and reject the addition of the node, to aid the developer. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210625234903.1324755-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 789a39ad39bc7ff24fe16f80326a6e38f047f10b Author: Mike Tipton Date: Mon Jun 21 14:42:41 2021 -0700 interconnect: qcom: icc-rpmh: Consolidate probe functions The current probe/remove functions are implemented separately for each target, but they are almost identical. Replace them with common functions that can be used across all rpmh targets. Signed-off-by: Mike Tipton Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20210621214241.13521-1-mdtipton@codeaurora.org Signed-off-by: Georgi Djakov commit 9d05c1e00e1045d3651ede7f01a3eb2327be0fe5 Author: Paul Kocialkowski Date: Mon Jul 19 22:52:41 2021 +0200 media: dt-bindings: media: rockchip-vpu: Add PX30 compatible The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2) and an encoder (VEPU2). Suggested-by: Alex Bee Signed-off-by: Paul Kocialkowski Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fb7cb344b969386979d15f3e1c08d511ffe88ef3 Author: Paul Kocialkowski Date: Mon Jul 19 22:52:40 2021 +0200 media: hantro: Add support for the Rockchip PX30 The PX30 SoC includes both the VDPU2 and VEPU2 blocks which are similar to the RK3399 (Hantro G1/H1 with shuffled registers). Signed-off-by: Paul Kocialkowski Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1f82f2df523cbc6dc972d1b4b977aebc5333cb0f Author: Ezequiel Garcia Date: Mon Jul 19 22:52:39 2021 +0200 media: hantro: Enable H.264 on Rockchip VDPU2 Given H.264 support for VDPU2 was just added, let's enable it. For now, this is only enabled on platform that don't have an RKVDEC core, such as RK3328. Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c07665f99386da2f211508586e0dcfe211fe1249 Author: Jonas Karlman Date: Mon Jul 19 22:52:38 2021 +0200 media: hantro: Add H.264 support for Rockchip VDPU2 Rockchip VDPU2 core is present on RK3328, RK3326/PX30, RK3399 and others. It's similar to Hantro G1, but it's not compatible with it. Signed-off-by: Jonas Karlman Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 678ddaf3ff8b259a88a7a0d3bf3b8c0eed90059a Author: Ezequiel Garcia Date: Mon Jul 19 22:52:37 2021 +0200 media: hantro: h264: Move reference picture number to a helper Add a hantro_h264_get_ref_nbr() helper function to get the reference picture numbers. This will be used by the Rockchip VDPU2 H.264 driver. This idea was originally proposed by Jonas Karlman in "[RFC 09/12] media: hantro: Refactor G1 H264 code" posted a while ago. Link: https://lore.kernel.org/linux-media/HE1PR06MB401165F2BA0AD8A634FDFAF2ACBF0@HE1PR06MB4011.eurprd06.prod.outlook.com/ Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a9096c585386a381c1bd7aaed0c478165adcb524 Author: Ezequiel Garcia Date: Mon Jul 19 22:52:36 2021 +0200 media: hantro: h264: Move DPB valid and long-term bitmaps In order to reuse these bitmaps, move this process to struct hantro_h264_dec_hw_ctx. This will be used by the Rockchip VDPU2 H.264 driver. This idea was originally proposed by Jonas Karlman in "[RFC 08/12] media: hantro: Fix H264 decoding of field encoded content" which was posted a while ago. Link: https://lore.kernel.org/linux-media/HE1PR06MB4011EA39133818A85768B91FACBF0@HE1PR06MB4011.eurprd06.prod.outlook.com/ Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b1e60562a62e0a8babbffcaff404ba36a19240ca Author: Ezequiel Garcia Date: Mon Jul 19 22:52:35 2021 +0200 media: hantro: Avoid redundant hantro_get_{dst,src}_buf() calls Getting the next src/dst buffer is relatively expensive so avoid doing it multiple times. Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 96f33a5b325e630b31cde9a9393708f569a5f6ac Author: Ezequiel Garcia Date: Mon Jul 19 22:52:34 2021 +0200 media: hantro: Make struct hantro_variant.init() optional The hantro_variant.init() function is there for platforms to perform hardware-specific initialization, such as clock rate bumping. Not all platforms require it, so make it optional. Signed-off-by: Ezequiel Garcia Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6ad61a7847da09b6261824accb539d05bcdfef65 Author: Ezequiel Garcia Date: Mon Jul 19 22:52:33 2021 +0200 media: hantro: vp8: Move noisy WARN_ON to vpu_debug When the VP8 decoders can't find a reference frame, the driver falls back to the current output frame. This will probably produce some undesirable results, leading to frame corruption, but shouldn't cause noisy warnings. Signed-off-by: Ezequiel Garcia Acked-by: Nicolas Dufresne Tested-by: Alex Bee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 131ae388b88e3daf4cb0721ed4b4cb8bfc201465 Author: Dongliang Mu Date: Mon Jun 21 07:07:28 2021 +0200 media: dvb-usb: Fix error handling in dvb_usb_i2c_init In dvb_usb_i2c_init, if i2c_add_adapter fails, it only prints an error message, and then continues to set DVB_USB_STATE_I2C. This affects the logic of dvb_usb_i2c_exit, which leads to that, the deletion of i2c_adap even if the i2c_add_adapter fails. Fix this by returning at the failure of i2c_add_adapter and then move dvb_usb_i2c_exit out of the error handling code of dvb_usb_i2c_init. Fixes: 13a79f14ab28 ("media: dvb-usb: Fix memory leak at error in dvb_usb_device_init()") Signed-off-by: Dongliang Mu Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 797c061ad715a9a1480eb73f44b6939fbe3209ed Author: Dongliang Mu Date: Fri Jun 25 07:59:04 2021 +0200 media: dvb-usb: fix uninit-value in vp702x_read_mac_addr If vp702x_usb_in_op fails, the mac address is not initialized. And vp702x_read_mac_addr does not handle this failure, which leads to the uninit-value in dvb_usb_adapter_dvb_init. Fix this by handling the failure of vp702x_usb_in_op. Fixes: 786baecfe78f ("[media] dvb-usb: move it to drivers/media/usb/dvb-usb") Signed-off-by: Dongliang Mu Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 67979e927dd053bde3b71128495f651256b3161c Author: Chen Lifu Date: Tue Jun 29 10:34:55 2021 +0800 riscv: kprobes: implement the branch instructions This has been tested by probing a module that contains each of the flavors of branches we have. Signed-off-by: Chen Lifu [Palmer: commit message, fix kconfig errors] Signed-off-by: Palmer Dabbelt commit b7d2be48cc08a9d42e347d944efa9f37ab9b83d2 Author: Chen Lifu Date: Tue Jun 29 10:34:54 2021 +0800 riscv: kprobes: implement the auipc instruction This has been tested by probing a module that contains an auipc instruction. Signed-off-by: Chen Lifu [Palmer: commit message] Signed-off-by: Palmer Dabbelt commit c5453769f77ce19a5b03f1f49946fd3f8a374009 Author: Dongliang Mu Date: Fri Jun 25 07:33:27 2021 +0200 media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init If dibusb_read_eeprom_byte fails, the mac address is not initialized. And nova_t_read_mac_address does not handle this failure, which leads to the uninit-value in dvb_usb_adapter_dvb_init. Fix this by handling the failure of dibusb_read_eeprom_byte. Reported-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com Fixes: 786baecfe78f ("[media] dvb-usb: move it to drivers/media/usb/dvb-usb") Signed-off-by: Dongliang Mu Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 8b777edff097ca9bb564529913f3a934d59112f4 Author: Sean Young Date: Sat Jul 3 11:04:40 2021 +0200 media: rc: rename s_learning_mode() to s_wideband_receiver() The s_learning_mode() function is called in response to the ioctl LIRC_SET_WIDEBAND_RECEIVER, so rename it to s_wideband_receiver(). Learning mode is when both the wideband receiver is turned on and carrier reports are enabled. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 50634548d3c360c19013f665964e6c5b8300ff05 Author: Sean Young Date: Mon Jul 5 19:56:01 2021 +0200 media: rc-loopback: max_timeout of UINT_MAX does not work Any timeout larger than LIRC_VALUE_MASK cannot work for the lirc uapi. LIRC_VALUE_MASK is about 16 seconds which is more than enough. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 7300d0c2391a08d03b69100c454146b578322fa3 Author: Sean Young Date: Sat Jul 3 15:51:10 2021 +0200 media: rc-loopback: send carrier reports When carrier reports are enabled, send them over loopback. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit d9d0103940e981ba424b832a7143b547d9364b5b Author: Sean Young Date: Sat Jul 3 15:36:15 2021 +0200 media: rc-loopback: use dev_dbg() rather than handrolled debug Make use of dynamic debug. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 6b7f554be8c92319d7e6df92fd247ebb9beb4a45 Author: Sean Young Date: Sat Jul 3 15:37:17 2021 +0200 media: rc-loopback: return number of emitters rather than error The LIRC_SET_TRANSMITTER_MASK ioctl should return the number of emitters if an invalid list was set. Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 9abe677951d15a099964b909010daaf92307bd4b Author: Martin Kepplinger Date: Sun Jul 4 09:54:03 2021 +0200 scsi: core: Add BLIST_IGN_MEDIA_CHANGE for Ultra HS-SD/MMC USB card readers Ultra HS-SD/MMC card reader devices establish a MEDIUM MAY HAVE CHANGED unit attention not only when the medium changes but also when resuming from suspend. Setting the BLIST_IGN_MEDIA_CHANGE flag permits using runtime PM for these readers. [mkp: renamed flag] Link: https://lore.kernel.org/r/20210704075403.147114-4-martin.kepplinger@puri.sm Reviewed-by: Bart Van Assche Signed-off-by: Martin Kepplinger Signed-off-by: Martin K. Petersen commit ed4246d37f3b94e429d020cac692434a00bae4cc Author: Martin Kepplinger Date: Sun Jul 4 09:54:02 2021 +0200 scsi: sd: REQUEST SENSE for BLIST_IGN_MEDIA_CHANGE devices in runtime_resume() For SD card reader devices that have the BLIST_IGN_MEDIA_CHANGE flag set, a MEDIUM MAY HAVE CHANGED unit attention is established after resuming from runtime suspend. Send a REQUEST SENSE to consume the UA. The "downside" is that for these devices we now rely on users to not change the medium (SD card) *during* a runtime suspend/resume cycle, i.e. when not unmounting. To enable runtime PM for an SD cardreader (device number 0:0:0:0), do: echo 0 > /sys/module/block/parameters/events_dfl_poll_msecs echo 1000 > /sys/bus/scsi/devices/0:0:0:0/power/autosuspend_delay_ms echo auto > /sys/bus/scsi/devices/0:0:0:0/power/control [mkp: use scsi_device flag instead of poking at BLIST] Link: https://lore.kernel.org/r/20210704075403.147114-3-martin.kepplinger@puri.sm Reviewed-by: Bart Van Assche Signed-off-by: Martin Kepplinger Signed-off-by: Martin K. Petersen commit f591a2e0548da88130c7b1c79f1f735273adc683 Author: Martin Kepplinger Date: Sun Jul 4 09:54:01 2021 +0200 scsi: core: Add new flag BLIST_IGN_MEDIA_CHANGE Add a new flag for devices that erroneously establish MEDIUM MAY HAVE CHANGED unit attentions. Drivers can set this flag to make the SCSI layer ignore media change events during resume. [mkp: add "ignore" and add corresponding flag to struct scsi_device] Link: https://lore.kernel.org/r/20210704075403.147114-2-martin.kepplinger@puri.sm Reviewed-by: Bart Van Assche Signed-off-by: Martin Kepplinger Signed-off-by: Martin K. Petersen commit 0a05cdf18b1a92c29dddaa82b04b9e885a0126b7 Author: Navin Sankar Velliangiri Date: Fri May 28 20:35:57 2021 +0530 fpga: fpga-bridge: removed repeated word Removed repeated word and. Reported by checkpatch. Signed-off-by: Navin Sankar Velliangiri Signed-off-by: Moritz Fischer commit 580e3137318edb39d2c6efa5dad51e3fbd7e2536 Author: Tom Rix Date: Wed May 19 09:30:56 2021 -0700 fpga: fix spelling mistakes Run the fpga subsystem through aspell. Signed-off-by: Tom Rix Reviewed-by: Fernando Pacheco Signed-off-by: Moritz Fischer commit 758f74674bcb82e1ed1a0b5a56980f295183b546 Author: Mauro Carvalho Chehab Date: Mon May 10 12:26:25 2021 +0200 docs: driver-api: fpga: avoid using UTF-8 chars While UTF-8 characters can be used at the Linux documentation, the best is to use them only when ASCII doesn't offer a good replacement. So, replace the occurences of the following UTF-8 characters: - U+2014 ('—'): EM DASH Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Moritz Fischer commit 378087cd17eea71c4e78e6053597e38429ccee0f Author: Namjae Jeon Date: Wed Jul 21 10:05:53 2021 +0900 ksmbd: add support for negotiating signing algorithm Support for faster packet signing (using GMAC instead of CMAC) can now be negotiated to some newer servers, including Windows. See MS-SMB2 section 2.2.3.17. This patch adds support for sending the new negotiate context with two supported signing algorithms(AES-CMAC, HMAC-SHA256). If client add support for AES_GMAC, Server will be supported later depend on it. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit af320a739029f6f8c5c05e769fadaf88e9b7d34f Author: Namjae Jeon Date: Wed Jul 21 10:03:19 2021 +0900 ksmbd: add negotiate context verification This patch add negotiate context verification code to check bounds. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9223958816f9df133ae936c9371378ba1203e0da Author: Namjae Jeon Date: Fri Jul 16 17:16:11 2021 +0900 ksmbd: fix typo of MS-SMBD Fix typo : "MS-KSMBD" => "MS-SMBD". Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c2255ff47768c94a0ebc3968f007928bb47ea43b Author: Leon Romanovsky Date: Wed Jul 21 15:39:44 2021 +0300 ionic: cleanly release devlink instance The failure to register devlink will leave the system with dangled devlink resource, which is not cleaned if devlink_port_register() fails. In order to remove access to ".registered" field of struct devlink_port, require both devlink_register and devlink_port_register to success and check it through device pointer. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky Acked-by: Shannon Nelson Signed-off-by: David S. Miller commit 58d913a32664fae5ac2ccd9a9c23b8e7037df740 Author: Nikolay Aleksandrov Date: Wed Jul 21 17:01:27 2021 +0300 net: bridge: multicast: add context support for host-joined groups Adding bridge multicast context support for host-joined groups is easy because we only need the proper timer value. We pass the already chosen context and use its timer value. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 6567cb438a51016f9f2152cb966f5715dc3c3c7b Author: Nikolay Aleksandrov Date: Wed Jul 21 17:01:26 2021 +0300 net: bridge: multicast: add mdb context support Choose the proper bridge multicast context when user-spaces is adding mdb entries. Currently we require the vlan to be configured on at least one device (port or bridge) in order to add an mdb entry if vlan mcast snooping is enabled (vlan snooping implies vlan filtering). Note that we always allow deleting an entry, regardless of the vlan state. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit dabb5db17c06d25accc3c3b8417b3a0428ba0731 Author: Joakim Zhang Date: Wed Jul 21 18:12:20 2021 +0800 ARM: dts: imx6qdl: move phy properties into phy device node This patch fixes issues found by dtbs_check: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/fsl,fec.yaml According to the Micrel PHY dt-binding: Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, Add clock delay in an Ethernet OF device node is deprecated, so move these properties to PHY OF device node. Suggested-by: Rob Herring Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 649502a337544840f1fbab8660603e08e86e2f41 Author: Joakim Zhang Date: Wed Jul 21 18:12:19 2021 +0800 dt-bindings: net: fsl,fec: improve the binding a bit This patch improves the yaml a bit according to Rob Herring comments: 1) normalize interrupt-names property, there is no reason to support random order. 2) validate each string in clock-names property. 3) add constraints for fsl,num-tx-queues/fsl,num-rx-queues property. 4) change additionalProperties to false in order to do strict checking. Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 46b0d7091cb9702265007d0f472846b01c773872 Author: Matt Roper Date: Fri Jul 16 22:14:26 2021 -0700 drm/i915: Make display workaround upper bounds exclusive Workarounds are documented in the bspec with an exclusive upper bound (i.e., a "fixed" stepping that no longer needs the workaround). This makes our driver's use of an inclusive upper bound for stepping ranges confusing; the differing notation between code and bspec makes it very easy for mistakes to creep in. Let's switch the upper bound of our IS_{GT,DISP}_STEP macros over to use an exclusive upper bound like the bspec does. This also has the benefit of helping make sure workarounds are properly handled for new minor steppings that show up (e.g., an A1 between the A0 and B0 we already knew about) --- if the new intermediate stepping pulls in hardware fixes early, there will be an update to the workaround definition which lets us know we need to change our code. If the new stepping does not pull a hardware fix earlier, then the new stepping will already be captured properly by the "[begin, fix)" range in the code. We'll probably need to be extra vigilant in code review of new workarounds for the near future to make sure developers notice the new semantics of workaround bounds. But we just migrated a bunch of our platforms from the IS_REVID bounds over to IS_{GT,DISP}_STEP, so people are already adjusting to the new macros and now is a good time to make this change too. [mattrope: Split out display changes to apply through intel-next tree] Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-8-matthew.d.roper@intel.com commit 6b73a7f380a3f1a9599bc802cf78febeb77f42db Author: Matt Roper Date: Fri Jul 16 22:14:26 2021 -0700 drm/i915: Make GT workaround upper bounds exclusive Workarounds are documented in the bspec with an exclusive upper bound (i.e., a "fixed" stepping that no longer needs the workaround). This makes our driver's use of an inclusive upper bound for stepping ranges confusing; the differing notation between code and bspec makes it very easy for mistakes to creep in. Let's switch the upper bound of our IS_{GT,DISP}_STEP macros over to use an exclusive upper bound like the bspec does. This also has the benefit of helping make sure workarounds are properly handled for new minor steppings that show up (e.g., an A1 between the A0 and B0 we already knew about) --- if the new intermediate stepping pulls in hardware fixes early, there will be an update to the workaround definition which lets us know we need to change our code. If the new stepping does not pull a hardware fix earlier, then the new stepping will already be captured properly by the "[begin, fix)" range in the code. We'll probably need to be extra vigilant in code review of new workarounds for the near future to make sure developers notice the new semantics of workaround bounds. But we just migrated a bunch of our platforms from the IS_REVID bounds over to IS_{GT,DISP}_STEP, so people are already adjusting to the new macros and now is a good time to make this change too. [mattrope: Split out GT changes to apply through gt-next tree] Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-8-matthew.d.roper@intel.com commit efa894a50296ae1e07983eebd2c4ebc2b4d17a1a Author: Matt Roper Date: Fri Jul 16 22:14:25 2021 -0700 drm/i915/rkl: Wa_1408330847 no longer applies to RKL RKL doesn't have PSR2 support, so PSR2-related workarounds no longer apply. Bspec: 53273 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-7-matthew.d.roper@intel.com commit e04a71e6f8d9d97d79e758633e9d741ca871981d Author: Matt Roper Date: Fri Jul 16 22:14:24 2021 -0700 drm/i915/rkl: Wa_1409767108 also applies to RKL Bspec: 53273 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-6-matthew.d.roper@intel.com commit 8ff36e025f25b3fac272b3d06615569346dd874d Author: Matt Roper Date: Fri Jul 16 22:14:23 2021 -0700 drm/i915/adl_s: Wa_14011765242 is also needed on A1 display stepping Extend the workaround bound to include A1 display. Bspec: 54370 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-5-matthew.d.roper@intel.com commit 1e1824de33c1a44640778fd04106e240e819866b Author: Matt Roper Date: Fri Jul 16 22:14:22 2021 -0700 drm/i915: Program DFR enable/disable as a GT workaround DFR programming (which we enable as an optimization on gen11, but must ensure is disabled on gen12) should be handled as a GT workaround rather than clock gating initialization. This will ensure that the programming of these registers is verified with our typical workaround checks. Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-4-matthew.d.roper@intel.com commit 131b1252e76af0ee462e31df428d6fdafee48532 Author: Matt Roper Date: Fri Jul 16 22:14:21 2021 -0700 drm/i915/icl: Drop a couple unnecessary workarounds While doing a quick sanity check of the ICL workarounds in the driver I noticed a few things that should be updated: * There's no mention in the bspec that WaPipelineFlushCoherentLines is needed on gen11 (both the current WA database and the old, deprecated page 20196 were checked); it appears this might have just been copied from the gen9 list? Even if this were needed, it doesn't seem like this was the correct implementation anyway since the gen9 workaround is supposed to be implemented in the indirect context bb (as we do in gen8_emit_flush_coherentl3_wa() on gen8/gen9). * WaForwardProgressSoftReset does not appear in the current workaround database. The old deprecated workaround list has a note indicating the workaround was dropped in 2017, so we should be safe to drop it from the code too. While we're at it, add the formal workaround ID number to WaDisableBankHangMode (our hardware team made a transition from text-based workaround names to ID numbers partway through the development of ICL, which is why some workarounds only have names, some only have numbers, and some have both). Bspec: 33450 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-3-matthew.d.roper@intel.com commit f4fa096ad4c288d80a8ac89b5cc4861e68e8c435 Author: Matt Roper Date: Fri Jul 16 22:14:20 2021 -0700 drm/i915: Fix application of WaInPlaceDecompressionHang On SKL we've been applying this workaround on H0+ steppings, which is actually backwards; H0 is supposed to be the first stepping where the workaround is no longer needed. Flip the bounds so that the workaround applies to all steppings _before_ H0. On BXT we've been applying this workaround to all steppings, but the bspec tells us it's only needed until C0. Pre-C0 GT steppings only appeared in pre-production hardware, which we no longer support in the driver, so we can drop the workaround completely for this platform. On ICL we've been applying this workaround to all steppings, but there doesn't seem to be any indication that this workaround was ever needed for this platform (even now-deprecated page 20196 of the bspec doesn't mention it). We can go ahead and drop it. I also don't see any mention of this workaround being needed for KBL, although this may be an oversight since the workaround is needed for all steppings of CFL. I'll leave the workaround in place for KBL to be safe. Bspec: 14091, 33450 Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210717051426.4120328-2-matthew.d.roper@intel.com commit 356789e8401c97fb1141e3e3696b3a6f8b01c6db Author: Aric Cyr Date: Fri Jun 25 16:36:01 2021 -0400 drm/amd/display: 3.2.143 Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit d459b79b941636a07cb44d14b7cadace2c0bf34d Author: Anthony Koo Date: Fri Jun 25 15:42:54 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.73 - Add reserved bits for future feature development - Fix issue with mismatch with type const Acked-by: Rodrigo Siqueira Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit dce7e5318d4e599f3422b3fb327a902a89096f1e Author: Dmytro Laktyushkin Date: Fri Jun 25 09:09:09 2021 -0400 drm/amd/display: remove compbuf size wait This tends to take miliseconds in certain scenarios and we'd rather not wait that long. Due to how this interacts with det size update and locking waiting should not be necessary as compbuf updates before unlock. Add a watch for config error instead as that is something we actually do care about. Acked-by: Rodrigo Siqueira Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit 360d1b65449356f56287e49d1b3d7579e758ca29 Author: Ian Chen Date: Thu Jun 24 10:48:43 2021 +0800 drm/amd/display: Extend dmub_cmd_psr_copy_settings_data struct Reserve padding bytes for new feature implementation Acked-by: Rodrigo Siqueira Signed-off-by: Ian Chen Signed-off-by: Alex Deucher commit 46ddb8965882fcff2d36d84ed12629435f3879c1 Author: Eric Yang Date: Wed Jun 23 15:48:02 2021 -0400 drm/amd/display: implement workaround for riommu related hang [Why] During S4/S5/reboot, sometimes riommu invalidation request arrive too early, DCN may be unable to respond to the invalidation request resulting in pstate hang. [How] VBIOS will force allow pstate for riommu invalidation and driver will clear it after powering down display pipes. Acked-by: Rodrigo Siqueira Signed-off-by: Eric Yang Signed-off-by: Alex Deucher commit 98e95e4f7996a60ee44ca6d8ab7f280e4bf7d618 Author: Josip Pavic Date: Mon Jun 21 12:17:24 2021 -0400 drm/amd/display: log additional register state for debug [Why & How] Extend existing state collection functions to add some additional registers useful for debug, and add state collection function for DC hubbub Acked-by: Rodrigo Siqueira Signed-off-by: Josip Pavic Signed-off-by: Alex Deucher commit 97b9c006f153fc129fef60fbd91021c8aaf8697f Author: Mikita Lipski Date: Thu Jun 17 16:17:09 2021 -0400 drm/amd/display: Prevent Diags from entering S2 [why] Lowering clocks when entering S2 Idle state causes DMUB to hang with Diags. [how] Do not enter S2 optimization with Diags on dcn301 to prevent DMUB hang. Acked-by: Rodrigo Siqueira Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit 23e55639b87fb16a9f0f66032ecb57060df6c46c Author: Oliver Logush Date: Wed Jun 23 15:04:04 2021 -0400 drm/amd/display: Fix timer_per_pixel unit error [why] The units of the time_per_pixel variable were incorrect, this had to be changed for the code to properly function. [how] The change was very straightforward, only required one line of code to be changed where the calculation was done. Acked-by: Rodrigo Siqueira Signed-off-by: Oliver Logush Signed-off-by: Alex Deucher commit 71e433ee91dc8473277053b92a980ed555bd0770 Author: Krunoslav Kovac Date: Tue Jun 22 18:42:28 2021 -0400 drm/amd/display: Assume active upper layer owns the HW cursor [why] The current logic checks if there's an upper pipe whose viewport completely covers the current pipe viewport. This fails in pipe splitting case as you can have layer 1 pipe that crosses the two layer 0 pipes where it's contained in both, but neither covers it completely, hence we allow the cursor on both layers. [How] Instead of trying to "sum up" rectangles from the higher level pipes which could leave gaps and would not work generically, we will assume if there's an upper layer that is active, it will control the HW cursor. Acked-by: Rodrigo Siqueira Signed-off-by: Krunoslav Kovac Signed-off-by: Alex Deucher commit 1e9653a41aaf39c33248ddbd4059ad3cb462a214 Author: Charlene Liu Date: Tue Jun 22 21:32:53 2021 -0400 drm/amd/display: reset dpcd_cap.dpcd_rev for passive dongle. [why] currently dc has never reset this dpcd_cap.dpcd_rev. [how] ideally we should reset this before redo detection. change the passive dongle only for now to reduce the impact. Acked-by: Rodrigo Siqueira Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit daa37361518bf2d1f591bbdaa7c68b2a43d7af48 Author: Linus Walleij Date: Thu Jul 15 13:36:36 2021 +0200 backlight: ktd253: Stabilize backlight Remove interrupt disablement during backlight setting. It is way to dangerous and makes platforms instable by having it miss vblank IRQs leading to the graphics derailing. The code is using ndelay() which is not available on platforms such as ARM and will result in 32 * udelay(1) which is substantial. Add some code to detect if an interrupt occurs during the tight loop and in that case just redo it from the top. Fixes: 5317f37e48b9 ("backlight: Add Kinetic KTD253 backlight driver") Cc: Stephan Gerhold Reported-by: newbyte@disroot.org Reviewed-by: Daniel Thompson Signed-off-by: Linus Walleij Signed-off-by: Lee Jones commit 240bfd134c592791fdceba1ce7fc3f973c33df2d Author: Eric Dumazet Date: Wed Jul 21 03:15:28 2021 -0700 tcp: tweak len/truesize ratio for coalesce candidates tcp_grow_window() is using skb->len/skb->truesize to increase tp->rcv_ssthresh which has a direct impact on advertized window sizes. We added TCP coalescing in linux-3.4 & linux-3.5: Instead of storing skbs with one or two MSS in receive queue (or OFO queue), we try to append segments together to reduce memory overhead. High performance network drivers tend to cook skb with 3 parts : 1) sk_buff structure (256 bytes) 2) skb->head contains room to copy headers as needed, and skb_shared_info 3) page fragment(s) containing the ~1514 bytes frame (or more depending on MTU) Once coalesced into a previous skb, 1) and 2) are freed. We can therefore tweak the way we compute len/truesize ratio knowing that skb->truesize is inflated by 1) and 2) soon to be freed. This is done only for in-order skb, or skb coalesced into OFO queue. The result is that low rate flows no longer pay the memory price of having low GRO aggregation factor. Same result for drivers not using GRO. This is critical to allow a big enough receiver window, typically tcp_rmem[2] / 2. We have been using this at Google for about 5 years, it is due time to make it upstream. Signed-off-by: Eric Dumazet Cc: Soheil Hassas Yeganeh Cc: Neal Cardwell Cc: Yuchung Cheng Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 54cb43199e14c1181ddcd4a3782f1f7eb56bdab8 Author: Nikolay Aleksandrov Date: Wed Jul 21 13:06:24 2021 +0300 net: bridge: multicast: fix igmp/mld port context null pointer dereferences With the recent change to use bridge/port multicast context pointers instead of bridge/port I missed to convert two locations which pass the port pointer as-is, but with the new model we need to verify the port context is non-NULL first and retrieve the port from it. The first location is when doing querier selection when a query is received, the second location is when leaving a group. The port context will be null if the packets originated from the bridge device (i.e. from the host). The fix is simple just check if the port context exists and retrieve the port pointer from it. Fixes: adc47037a7d5 ("net: bridge: multicast: use multicast contexts instead of bridge or port") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 524df92c1907d31bc2d2643e81c680381d7c6bf8 Author: Leon Romanovsky Date: Wed Jul 21 12:54:13 2021 +0300 ionic: drop useless check of PCI driver data validity The driver core will call to .remove callback only if .probe succeeded and it will ensure that driver data has pointer to struct ionic. There is no need to check it again. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Leon Romanovsky Acked-by: Shannon Nelson Signed-off-by: David S. Miller commit 739b2adf99e99f076601df412ec9aa92302c701f Author: Eric Dumazet Date: Wed Jul 21 02:06:14 2021 -0700 tcp: avoid indirect call in tcp_new_space() For tcp sockets, sk->sk_write_space is most probably sk_stream_write_space(). Other sk->sk_write_space() calls in TCP are slow path and do not deserve any change. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7f8b20d0deed64629049b634e323e39d9f1a4fe3 Author: Andy Shevchenko Date: Wed Jul 21 11:20:58 2021 +0300 net: wwan: iosm: Switch to use module_pci_driver() macro Eliminate some boilerplate code by using module_pci_driver() instead of init/exit, moving the salient bits from init into probe. Signed-off-by: Andy Shevchenko Reviewed-by: Loic Poulain Signed-off-by: David S. Miller commit dcb713d53e2eadf42b878c12a471e74dc6ed3145 Author: Dongliang Mu Date: Wed Jul 21 16:14:57 2021 +0800 usb: hso: remove the bailout parameter There are two invocation sites of hso_free_net_device. After refactoring hso_create_net_device, this parameter is useless. Remove the bailout in the hso_free_net_device and change the invocation sites of this function. Signed-off-by: Dongliang Mu Signed-off-by: David S. Miller commit 788e67f18d797abbd48a96143511261f4f3b4f21 Author: Dongliang Mu Date: Wed Jul 21 16:14:56 2021 +0800 usb: hso: fix error handling code of hso_create_net_device The current error handling code of hso_create_net_device is hso_free_net_device, no matter which errors lead to. For example, WARNING in hso_free_net_device [1]. Fix this by refactoring the error handling code of hso_create_net_device by handling different errors by different code. [1] https://syzkaller.appspot.com/bug?id=66eff8d49af1b28370ad342787413e35bbe76efe Reported-by: syzbot+44d53c7255bb1aea22d2@syzkaller.appspotmail.com Fixes: 5fcfb6d0bfcd ("hso: fix bailout in error case of probe") Signed-off-by: Dongliang Mu Signed-off-by: David S. Miller commit 4f365c75a342c82b431e361631c5004779ebcd2a Author: Judy Hsiao Date: Fri Jun 25 12:50:10 2021 +0800 arm64: dts: qcom: sc7180: trogdor: Update audio codec to Max98360A Use max98360a dts node to correctly describe the hardware. Signed-off-by: Judy Hsiao Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20210625045010.2914289-1-judyhsiao@chromium.org Signed-off-by: Bjorn Andersson commit 1050713026a08d605b61f039700b67aab646371f Author: Piotr Kwapulinski Date: Tue Jul 20 16:23:48 2021 -0700 i40e: add support for PTP external synchronization clock Add support for external synchronization clock via GPIOs. 1PPS signals are handled via the dedicated 3 GPIOs: SDP3_2, SDP3_3 and GPIO_4. Previously it was not possible to use the external PTP synchronization clock. All possible HW configurations are supported. SDP3_2, SDP3_3, GPIO_4 off, off, off off, in_A, off off, out_A, off off, in_B, off off, out_B, off in_A, off, off in_A, in_B, off in_A, out_B, off out_A, off, off out_A, in_B, off in_B, off, off in_B, in_A, off in_B, out_A, off out_B, off, off out_B, in_A, off off, off, in_A off, out_A, in_A off, in_B, in_A off, out_B, in_A out_A, off, in_A out_A, in_B, in_A in_B, off, in_A in_B, out_A, in_A out_B, off, in_A off, off, out_A off, in_A, out_A off, in_B, out_A off, out_B, out_A in_A, off, out_A in_A, in_B, out_A in_A, out_B, out_A in_B, off, out_A in_B, in_A, out_A out_B, off, out_A out_B, in_A, out_A off, off, in_B off, in_A, in_B off, out_A, in_B off, out_B, in_B in_A, off, in_B in_A, out_B, in_B out_A, off, in_B out_B, off, in_B out_B, in_A, in_B off, off, out_B off, in_A, out_B off, out_A, out_B off, in_B, out_B in_A, off, out_B in_A, in_B, out_B out_A, off, out_B out_A, in_B, out_B in_B, off, out_B in_B, in_A, out_B in_B, out_A, out_B Tested with oscilloscope, 1PPS generator and ts2phc. Reviewed-by: Aleksandr Loktionov Reviewed-by: Arkadiusz Kubalewski Signed-off-by: Piotr Kwapulinski Tested-by: Ashish K Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 7961c5b60f23dff5d82a523f9aeb8ebf34cf9926 Author: Maarten Lankhorst Date: Wed Jul 14 14:28:33 2021 +0200 drm/i915: Add TTM offset argument to mmap. The FIXED mapping is only used for ttm, and tells userspace that the mapping type is pre-defined. This disables the other type of mmap offsets when discrete memory is used, so fix the selftests as well. Document the struct as well, so it shows up in docbook. Cc: Jason Ekstrand Reviewed-by: Daniel Vetter Reviewed-by: Jason Ekstrand Signed-off-by: Maarten Lankhorst [mauld: Included minor fixes from the review comments] Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210714122833.766586-1-maarten.lankhorst@linux.intel.com commit 15eb083bdb561bb4862cd04cd0523e55483e877e Author: Jason Ekstrand Date: Tue Jul 20 13:21:08 2021 -0500 drm/i915: Correct the docs for intel_engine_cmd_parser In 93b713304188 ("drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser""), the parameters to intel_engine_cmd_parser() were altered without updating the docs, causing Fi.CI.DOCS to start failing. Fixes: 93b713304188 ("drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"") Signed-off-by: Jason Ekstrand Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210720182108.2761496-1-jason@jlekstrand.net Signed-off-by: Rodrigo Vivi [Added 'Fixes:' tag and corrected the hash for the ancestor] commit e7deeb9d79d8691f1e6c4c6707471ec3d7b9886b Author: Jinchao Wang Date: Tue Jun 29 01:19:07 2021 +0800 driver: base: Prefer unsigned int to bare use of unsigned Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Jinchao Wang Link: https://lore.kernel.org/r/20210628171907.63646-2-wjc@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit e022eac85ecd2140a0829970d923d984356185eb Author: Xiongfeng Wang Date: Wed Jul 14 09:32:55 2021 +0800 cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() On ARM64, when PPTT(Processor Properties Topology Table) is not implemented in ACPI boot, we will goto 'free_ci' with the following print: Unable to detect cache hierarchy for CPU 0 But some other codes may still use 'num_leaves' to iterate through the 'info_list', such as get_cpu_cacheinfo_id(). If 'info_list' is NULL , it would crash. So clear 'num_leaves' in free_cache_attributes(). Reviewed-by: Sudeep Holla Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/1626226375-58730-1-git-send-email-wangxiongfeng2@huawei.com Signed-off-by: Greg Kroah-Hartman commit ac6627a28dbfb5d96736544a00c3938fa7ea6dfb Author: Vadim Fedorenko Date: Tue Jul 20 23:06:28 2021 +0300 net: ipv4: Consolidate ipv4_mtu and ip_dst_mtu_maybe_forward Consolidate IPv4 MTU code the same way it is done in IPv6 to have code aligned in both address families Signed-off-by: Vadim Fedorenko Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 427faee167bce4ccb0b22f6815a9ac509e31d4c3 Author: Vadim Fedorenko Date: Tue Jul 20 23:06:27 2021 +0300 net: ipv6: introduce ip6_dst_mtu_maybe_forward Replace ip6_dst_mtu_forward with ip6_dst_mtu_maybe_forward and reuse this code in ip6_mtu. Actually these two functions were almost duplicates, this change will simplify the maintaince of mtu calculation code. Signed-off-by: Vadim Fedorenko Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7c804e91df523a37c29e183ea2b10ac73c3a4f3d Merge: 71f4f89a03244 968691c777af7 Author: David S. Miller Date: Wed Jul 21 08:21:39 2021 -0700 Merge branch 'ipv6-ioam' Justin Iurman says: ==================== Support for the IOAM Pre-allocated Trace with IPv6 v5: - Refine types, min/max and default values for new sysctls - Introduce a "_wide" sysctl for each "ioam6_id" sysctl - Add more validation on headers before processing data - RCU for sc <> ns pointers + appropriate accessors - Generic Netlink policies are now per op, not per family anymore - Address other comments/remarks from Jakub (thanks again) - Revert "__packed" to "__attribute__((packed))" for uapi headers - Add tests to cover the functionality added, as requested by David Ahern v4: - Address warnings from checkpatch (ignore errors related to unnamed bitfields in the first patch) - Use of hweight32 (thanks Jakub) - Remove inline keyword from static functions in C files and let the compiler decide what to do (thanks Jakub) v3: - Fix warning "unused label 'out_unregister_genl'" by adding conditional macro - Fix lwtunnel output redirect bug: dst cache useless in this case, use orig_output instead v2: - Fix warning with static for __ioam6_fill_trace_data - Fix sparse warning with __force when casting __be64 to __be32 - Fix unchecked dereference when removing IOAM namespaces or schemas - exthdrs.c: Don't drop by default (now: ignore) to match the act bits "00" - Add control plane support for the inline insertion (lwtunnel) - Provide uapi structures - Use __net_timestamp if skb->tstamp is empty - Add note about the temporary IANA allocation - Remove support for "removable" TLVs - Remove support for virtual/anonymous tunnel decapsulation In-situ Operations, Administration, and Maintenance (IOAM) records operational and telemetry information in a packet while it traverses a path between two points in an IOAM domain. It is defined in draft-ietf-ippm-ioam-data [1]. IOAM data fields can be encapsulated into a variety of protocols. The IPv6 encapsulation is defined in draft-ietf-ippm-ioam-ipv6-options [2], via extension headers. IOAM can be used to complement OAM mechanisms based on e.g. ICMP or other types of probe packets. This patchset implements support for the Pre-allocated Trace, carried by a Hop-by-Hop. Therefore, a new IPv6 Hop-by-Hop TLV option is introduced, see IANA [3]. The three other IOAM options are not included in this patchset (Incremental Trace, Proof-of-Transit and Edge-to-Edge). The main idea behind the IOAM Pre-allocated Trace is that a node pre-allocates some room in packets for IOAM data. Then, each IOAM node on the path will insert its data. There exist several interesting use- cases, e.g. Fast failure detection/isolation or Smart service selection. Another killer use-case is what we have called Cross-Layer Telemetry, see the demo video on its repository [4], that aims to make the entire stack (L2/L3 -> L7) visible for distributed tracing tools (e.g. Jaeger), instead of the current L5 -> L7 limited view. So, basically, this is a nice feature for the Linux Kernel. This patchset also provides support for the control plane part, but only for the inline insertion (host-to-host use case), through lightweight tunnels. Indeed, for in-transit traffic, the solution is to have an IPv6-in-IPv6 encapsulation, which brings some difficulties and still requires a little bit of work and discussion (ie anonymous tunnel decapsulation and multi egress resolution). - Patch 1: IPv6 IOAM headers definition - Patch 2: Data plane support for Pre-allocated Trace - Patch 3: IOAM Generic Netlink API - Patch 4: Support for IOAM injection with lwtunnels - Patch 5: Documentation for new IOAM sysctls - Patch 6: Test for the IOAM insertion with IPv6 [1] https://tools.ietf.org/html/draft-ietf-ippm-ioam-data [2] https://tools.ietf.org/html/draft-ietf-ippm-ioam-ipv6-options [3] https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#ipv6-parameters-2 [4] https://github.com/iurmanj/cross-layer-telemetry ==================== Signed-off-by: David S. Miller commit 968691c777af78d2daa2ee87cfaeeae825255a58 Author: Justin Iurman Date: Tue Jul 20 21:43:01 2021 +0200 selftests: net: Test for the IOAM insertion with IPv6 This test evaluates the IOAM insertion for IPv6 by checking the IOAM data integrity on the receiver. The topology is formed by 3 nodes: Alpha (sender), Beta (router in-between) and Gamma (receiver). An IOAM domain is configured from Alpha to Gamma only, which means not on the reverse path. When Gamma is the destination, Alpha adds an IOAM option (Pre-allocated Trace) inside a Hop-by-hop and fills the trace with its own IOAM data. Beta and Gamma also fill the trace. The IOAM data integrity is checked on Gamma, by comparing with the pre-defined IOAM configuration (see below). +-------------------+ +-------------------+ | | | | | alpha netns | | gamma netns | | | | | | +-------------+ | | +-------------+ | | | veth0 | | | | veth0 | | | | db01::2/64 | | | | db02::2/64 | | | +-------------+ | | +-------------+ | | . | | . | +-------------------+ +-------------------+ . . . . . . +----------------------------------------------------+ | . . | | +-------------+ +-------------+ | | | veth0 | | veth1 | | | | db01::1/64 | ................ | db02::1/64 | | | +-------------+ +-------------+ | | | | beta netns | | | +--------------------------+-------------------------+ ~~~~~~~~~~~~~~~~~~~~~~ | IOAM configuration | ~~~~~~~~~~~~~~~~~~~~~~ Alpha +-----------------------------------------------------------+ | Type | Value | +-----------------------------------------------------------+ | Node ID | 1 | +-----------------------------------------------------------+ | Node Wide ID | 11111111 | +-----------------------------------------------------------+ | Ingress ID | 0xffff (default value) | +-----------------------------------------------------------+ | Ingress Wide ID | 0xffffffff (default value) | +-----------------------------------------------------------+ | Egress ID | 101 | +-----------------------------------------------------------+ | Egress Wide ID | 101101 | +-----------------------------------------------------------+ | Namespace Data | 0xdeadbee0 | +-----------------------------------------------------------+ | Namespace Wide Data | 0xcafec0caf00dc0de | +-----------------------------------------------------------+ | Schema ID | 777 | +-----------------------------------------------------------+ | Schema Data | something that will be 4n-aligned | +-----------------------------------------------------------+ Note: When Gamma is the destination, Alpha adds an IOAM Pre-allocated Trace option inside a Hop-by-hop, where 164 bytes are pre-allocated for the trace, with 123 as the IOAM-Namespace and with 0xfff00200 as the trace type (= all available options at this time). As a result, and based on IOAM configurations here, only both Alpha and Beta should be capable of inserting their IOAM data while Gamma won't have enough space and will set the overflow bit. Beta +-----------------------------------------------------------+ | Type | Value | +-----------------------------------------------------------+ | Node ID | 2 | +-----------------------------------------------------------+ | Node Wide ID | 22222222 | +-----------------------------------------------------------+ | Ingress ID | 201 | +-----------------------------------------------------------+ | Ingress Wide ID | 201201 | +-----------------------------------------------------------+ | Egress ID | 202 | +-----------------------------------------------------------+ | Egress Wide ID | 202202 | +-----------------------------------------------------------+ | Namespace Data | 0xdeadbee1 | +-----------------------------------------------------------+ | Namespace Wide Data | 0xcafec0caf11dc0de | +-----------------------------------------------------------+ | Schema ID | 0xffffff (= None) | +-----------------------------------------------------------+ | Schema Data | | +-----------------------------------------------------------+ Gamma +-----------------------------------------------------------+ | Type | Value | +-----------------------------------------------------------+ | Node ID | 3 | +-----------------------------------------------------------+ | Node Wide ID | 33333333 | +-----------------------------------------------------------+ | Ingress ID | 301 | +-----------------------------------------------------------+ | Ingress Wide ID | 301301 | +-----------------------------------------------------------+ | Egress ID | 0xffff (default value) | +-----------------------------------------------------------+ | Egress Wide ID | 0xffffffff (default value) | +-----------------------------------------------------------+ | Namespace Data | 0xdeadbee2 | +-----------------------------------------------------------+ | Namespace Wide Data | 0xcafec0caf22dc0de | +-----------------------------------------------------------+ | Schema ID | 0xffffff (= None) | +-----------------------------------------------------------+ | Schema Data | | +-----------------------------------------------------------+ Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit de8e80a54c96d2b75377e0e5319a64d32c88c690 Author: Justin Iurman Date: Tue Jul 20 21:43:00 2021 +0200 ipv6: ioam: Documentation for new IOAM sysctls Add documentation for new IOAM sysctls: - ioam6_id and ioam6_id_wide: two per-namespace sysctls - ioam6_enabled, ioam6_id and ioam6_id_wide: three per-interface sysctls Example of IOAM configuration based on the following simple topology: _____ _____ _____ | | eth0 eth0 | | eth1 eth0 | | | A |.----------.| B |.----------.| C | |_____| |_____| |_____| 1) Node and interface IDs can be configured for IOAM: # IOAM ID of A = 1, IOAM ID of A.eth0 = 11 (A) sysctl -w net.ipv6.ioam6_id=1 (A) sysctl -w net.ipv6.conf.eth0.ioam6_id=11 # IOAM ID of B = 2, IOAM ID of B.eth0 = 21, IOAM ID of B.eth1 = 22 (B) sysctl -w net.ipv6.ioam6_id=2 (B) sysctl -w net.ipv6.conf.eth0.ioam6_id=21 (B) sysctl -w net.ipv6.conf.eth1.ioam6_id=22 # IOAM ID of C = 3, IOAM ID of C.eth0 = 31 (C) sysctl -w net.ipv6.ioam6_id=3 (C) sysctl -w net.ipv6.conf.eth0.ioam6_id=31 Note that "_wide" IDs equivalents can be configured the same way. 2) Each node can be configured to form an IOAM domain. For instance, we allow IOAM from A to C only (not the reverse path), i.e. enable IOAM on ingress for B.eth0 and C.eth0: (B) sysctl -w net.ipv6.conf.eth0.ioam6_enabled=1 (C) sysctl -w net.ipv6.conf.eth0.ioam6_enabled=1 3) An IOAM domain (e.g. ID=123) is defined and made known to each node: (A) ip ioam namespace add 123 (B) ip ioam namespace add 123 (C) ip ioam namespace add 123 4) Finally, an IOAM Pre-allocated Trace can be inserted in traffic sent by A when C (e.g. db02::2) is the destination: (A) ip -6 route add db02::2/128 encap ioam6 trace type 0x800000 ns 123 size 12 dev eth0 Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 3edede08ff37c6a9370510508d5eeb54890baf47 Author: Justin Iurman Date: Tue Jul 20 21:42:59 2021 +0200 ipv6: ioam: Support for IOAM injection with lwtunnels Add support for the IOAM inline insertion (only for the host-to-host use case) which is per-route configured with lightweight tunnels. The target is iproute2 and the patch is ready. It will be posted as soon as this patchset is merged. Here is an overview: $ ip -6 ro ad fc00::1/128 encap ioam6 trace type 0x800000 ns 1 size 12 dev eth0 This example configures an IOAM Pre-allocated Trace option attached to the fc00::1/128 prefix. The IOAM namespace (ns) is 1, the size of the pre-allocated trace data block is 12 octets (size) and only the first IOAM data (bit 0: hop_limit + node id) is included in the trace (type) represented as a bitfield. The reason why the in-transit (IPv6-in-IPv6 encapsulation) use case is not implemented is explained on the patchset cover. Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 8c6f6fa6772696be0c047a711858084b38763728 Author: Justin Iurman Date: Tue Jul 20 21:42:58 2021 +0200 ipv6: ioam: IOAM Generic Netlink API Add Generic Netlink commands to allow userspace to configure IOAM namespaces and schemas. The target is iproute2 and the patch is ready. It will be posted as soon as this patchset is merged. Here is an overview: $ ip ioam Usage: ip ioam { COMMAND | help } ip ioam namespace show ip ioam namespace add ID [ data DATA32 ] [ wide DATA64 ] ip ioam namespace del ID ip ioam schema show ip ioam schema add ID DATA ip ioam schema del ID ip ioam namespace set ID schema { ID | none } Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 9ee11f0fff205b4b3df9750bff5e94f97c71b6a0 Author: Justin Iurman Date: Tue Jul 20 21:42:57 2021 +0200 ipv6: ioam: Data plane support for Pre-allocated Trace Implement support for processing the IOAM Pre-allocated Trace with IPv6, see [1] and [2]. Introduce a new IPv6 Hop-by-Hop TLV option, see IANA [3]. A new per-interface sysctl is introduced. The value is a boolean to accept (=1) or ignore (=0, by default) IPv6 IOAM options on ingress for an interface: - net.ipv6.conf.XXX.ioam6_enabled Two other sysctls are introduced to define IOAM IDs, represented by an integer. They are respectively per-namespace and per-interface: - net.ipv6.ioam6_id - net.ipv6.conf.XXX.ioam6_id The value of the first one represents the IOAM ID of the node itself (u32; max and default value = U32_MAX>>8, due to hop limit concatenation) while the other represents the IOAM ID of an interface (u16; max and default value = U16_MAX). Each "ioam6_id" sysctl has a "_wide" equivalent: - net.ipv6.ioam6_id_wide - net.ipv6.conf.XXX.ioam6_id_wide The value of the first one represents the wide IOAM ID of the node itself (u64; max and default value = U64_MAX>>8, due to hop limit concatenation) while the other represents the wide IOAM ID of an interface (u32; max and default value = U32_MAX). The use of short and wide equivalents is not exclusive, a deployment could choose to leverage both. For example, net.ipv6.conf.XXX.ioam6_id (short format) could be an identifier for a physical interface, whereas net.ipv6.conf.XXX.ioam6_id_wide (wide format) could be an identifier for a logical sub-interface. Documentation about new sysctls is provided at the end of this patchset. Two relativistic hash tables are used: one for IOAM namespaces, the other for IOAM schemas. A namespace can only have a single active schema and a schema can only be attached to a single namespace (1:1 relationship). [1] https://tools.ietf.org/html/draft-ietf-ippm-ioam-ipv6-options [2] https://tools.ietf.org/html/draft-ietf-ippm-ioam-data [3] https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#ipv6-parameters-2 Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit db67f219fc9365a0c456666ed7c134d43ab0be8a Author: Justin Iurman Date: Tue Jul 20 21:42:56 2021 +0200 uapi: IPv6 IOAM headers definition This patch provides the IPv6 IOAM option header [1] as well as the IOAM Trace header [2]. An IOAM option must be 4n-aligned. Here is an overview of a Hop-by-Hop with an IOAM Trace option: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next header | Hdr Ext Len | Padding | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Reserved | IOAM Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Namespace-ID | NodeLen | Flags | RemainingLen| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IOAM-Trace-Type | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<-+ | | | | node data [n] | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ D | | a | node data [n-1] | t | | a +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ... ~ S +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ p | | a | node data [1] | c | | e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | | node data [0] | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<-+ The IOAM option header starts at "Option Type" and ends after "IOAM Type". The IOAM Trace header starts at "Namespace-ID" and ends after "IOAM-Trace-Type/Reserved". IOAM Type: either Pre-allocated Trace (=0), Incremental Trace (=1), Proof-of-Transit (=2) or Edge-to-Edge (=3). Note that both the Pre-allocated Trace and the Incremental Trace look the same. The two others are not implemented. Namespace-ID: IOAM namespace identifier, not to be confused with network namespaces. It adds further context to IOAM options and associated data, and allows devices which are IOAM capable to determine whether IOAM options must be processed or ignored. It can also be used by an operator to distinguish different operational domains or to identify different sets of devices. NodeLen: Length of data added by each node. It depends on the Trace Type. Flags: Only the Overflow (O) flag for now. The O flag is set by a transit node when there are not enough octets left to record its data. RemainingLen: Remaining free space to record data. IOAM-Trace-Type: Bit field where each bit corresponds to a specific kind of IOAM data. See [2] for a detailed list. [1] https://tools.ietf.org/html/draft-ietf-ippm-ioam-ipv6-options [2] https://tools.ietf.org/html/draft-ietf-ippm-ioam-data Signed-off-by: Justin Iurman Signed-off-by: David S. Miller commit 71f4f89a0324459f81656f3f9b20c1c0becaf647 Author: Vladimir Oltean Date: Tue Jul 20 20:35:57 2021 +0300 net: switchdev: recurse into __switchdev_handle_fdb_del_to_device The difference between __switchdev_handle_fdb_del_to_device and switchdev_handle_del_to_device is that the former takes an extra orig_dev argument, while the latter starts with dev == orig_dev. We should recurse into the variant that does not lose the orig_dev along the way. This is relevant when deleting FDB entries pointing towards a bridge (dev changes to the lower interfaces, but orig_dev shouldn't). The addition helper already recurses properly, just the deletion one doesn't. Fixes: 8ca07176ab00 ("net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 94111dfc18b8b8cb3c72006e0e7b31c038709ab4 Author: Vladimir Oltean Date: Tue Jul 20 20:35:56 2021 +0300 net: switchdev: remove stray semicolon in switchdev_handle_fdb_del_to_device shim With the semicolon at the end, the compiler sees the shim function as a declaration and not as a definition, and warns: 'switchdev_handle_fdb_del_to_device' declared 'static' but never defined Reported-by: kernel test robot Fixes: 8ca07176ab00 ("net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE") Signed-off-by: Vladimir Oltean Tested-by: Matthieu Baerts Signed-off-by: David S. Miller commit f5621a01c86beb5dd83407f6e36d7bae43e8a8be Author: Vladimir Oltean Date: Tue Jul 20 20:24:33 2021 +0300 net: phy: at803x: finish the phy id checking simplification The blamed commit was probably not tested on net-next, since it did not refactor the extra phy id check introduced in commit b856150c8098 ("net: phy: at803x: mask 1000 Base-X link mode"). Fixes: 8887ca5474bd ("net: phy: at803x: simplify custom phy id matching") Signed-off-by: Vladimir Oltean Acked-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 7cefb0b0e91191185ddd26912cc52d589218fa47 Author: Russell King (Oracle) Date: Tue Jul 20 12:15:26 2021 +0100 net: phylink: cleanup ksettings_set We only need to fiddle about with the supported mask after we have validated the user's requested parameters. Simplify and streamline the code by moving the linkmode copy and update of the autoneg bit after validating the user's request. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit f04948dea236b000da09c466a7ec931ecd8d7867 Author: Zhen Lei Date: Wed Jul 7 15:43:01 2021 +0800 driver core: Fix error return code in really_probe() In the case of error handling, the error code returned by the subfunction should be propagated instead of 0. Fixes: 1901fb2604fb ("Driver core: fix "driver" symlink timing") Fixes: 23b6904442d0 ("driver core: add dev_groups to all drivers") Fixes: 8fd456ec0cf0 ("driver core: Add state_synced sysfs file for devices that support it") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210707074301.2722-1-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3ecc8cb7c092b2f50e21d2aaaae35b8221ee7214 Author: Zhen Lei Date: Mon Jul 19 14:45:31 2021 +0800 firmware: fix theoretical UAF race with firmware cache and resume This race was discovered when I carefully analyzed the code to locate another firmware-related UAF issue. It can be triggered only when the firmware load operation is executed during suspend. This possibility is almost impossible because there are few firmware load and suspend actions in the actual environment. CPU0 CPU1 __device_uncache_fw_images(): assign_fw(): fw_cache_piggyback_on_request() <----- P0 spin_lock(&fwc->name_lock); ... list_del(&fce->list); spin_unlock(&fwc->name_lock); uncache_firmware(fce->name); <----- P1 kref_get(&fw_priv->ref); If CPU1 is interrupted at position P0, the new 'fce' has been added to the list fwc->fw_names by the fw_cache_piggyback_on_request(). In this case, CPU0 executes __device_uncache_fw_images() and will be able to see it when it traverses list fwc->fw_names. Before CPU1 executes kref_get() at P1, if CPU0 further executes uncache_firmware(), the count of fw_priv->ref may decrease to 0, causing fw_priv to be released in advance. Move kref_get() to the lock protection range of fwc->name_lock to fix it. Fixes: ac39b3ea73aa ("firmware loader: let caching firmware piggyback on loading firmware") Acked-by: Luis Chamberlain Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210719064531.3733-2-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman commit d3ce197903279c5497d4fa9cc97b519400dc4a44 Author: Geert Uytterhoeven Date: Wed Jul 14 17:15:59 2021 +0200 sysfs: Use local reference in compat_only_sysfs_link_entry_to_kobj() As we have just obtained target_kobj->sd into a local variable, and incremented the object's reference count, it is better to use the local variable instead of the original reference. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210714151559.2532572-1-geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman commit fe968ca2cac91888310b143a483123c84906e3fc Author: Shuah Khan Date: Wed Jul 7 21:18:27 2021 -0600 selftests: firmware: Fix ignored return val of asprintf() warn Fix the following ingonred return val of asprintf() warn during build: cc -Wall -O2 fw_namespace.c -o ../tools/testing/selftests/firmware/fw_namespace fw_namespace.c: In function ‘main’: fw_namespace.c:132:2: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 132 | asprintf(&fw_path, "/lib/firmware/%s", fw_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20210708031827.51293-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 03b1292d1c0ea195e025e667555d74db7da82026 Author: Nishanth Menon Date: Wed Jul 7 16:06:00 2021 -0500 scripts/spdxcheck-test.sh: Drop python2 Since commit d0259c42abff ("spdxcheck.py: Use Python 3"), spdxcheck.py explicitly expects to run as python3 script, there is no further point in attempting to test with python2. Cc: Bert Vermeulen Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20210707210600.7266-1-nm@ti.com Signed-off-by: Greg Kroah-Hartman commit e679004dec37566f658a255157d3aed9d762a2b7 Author: Juergen Gross Date: Wed Jul 7 11:10:45 2021 +0200 tty: hvc: replace BUG_ON() with negative return value Xen frontends shouldn't BUG() in case of illegal data received from their backends. So replace the BUG_ON()s when reading illegal data from the ring page with negative return values. Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20210707091045.460-1-jgross@suse.com Signed-off-by: Greg Kroah-Hartman commit 74a03c20bc8809a41d66ea614e55358064adbd7d Author: Richard Weinberger Date: Tue Jul 6 17:43:10 2021 +0200 misc: pci_endpoint_test: Ensure relationship between miscdev and PCI Set the parent pointer of the misc device to ensure a relationship between PCI and misc dev. That way it is possible to see in /sys/class/misc/ which pci_endpoint_test instance serves what PCI device. Signed-off-by: Richard Weinberger Link: https://lore.kernel.org/r/20210706154310.26773-1-richard@nod.at Signed-off-by: Greg Kroah-Hartman commit d1d26f40f71c6eabeb2083e2a18d2e55e9a71336 Author: Salah Triki Date: Fri Jul 2 14:31:14 2021 +0100 dio: return -ENOMEM when kzalloc() fails Return -ENOMEM when kzalloc() fails in order to inform the caller of the failure. Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210702133114.GA314157@pc Signed-off-by: Greg Kroah-Hartman commit 36cdc20b79ef8841d38217ea8ba837a7dbfbe852 Author: Wan Jiabing Date: Mon Jun 28 20:35:12 2021 +0800 lkdtm: remove duplicated include of init.h Fix following checkincludes.pl warning: ./drivers/misc/lkdtm/core.c 26 #include 29 #include Acked-by: Kees Cook Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20210628123512.38090-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman commit ddb1381018766202894b167c700e0852f52a9b9d Author: Randy Dunlap Date: Sun Jul 11 15:31:46 2021 -0700 MOST: cdev: rename 'mod_init' & 'mod_exit' functions to be module-specific Rename module_init & module_exit functions that are named "mod_init" and "mod_exit" so that they are unique in both the System.map file and in initcall_debug output instead of showing up as almost anonymous "mod_init". This is helpful for debugging and in determining how long certain module_init calls take to execute. Signed-off-by: Randy Dunlap Acked-by: Christian Gromm Link: https://lore.kernel.org/r/20210711223148.5250-5-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit f3f1017a98f91355671feb0e741391999a43b55d Author: Hannu Hartikainen Date: Thu Jul 8 18:20:54 2021 +0300 docs: gpio: explain GPIOD_OUT_* values and toggling active low I was confused about the gpiod_flags values and thought that GPIOD_OUT_LOW and GPIOD_OUT_HIGH set the line to be active low / active high. This is not true, but I got the misconception because the flags GPIOD_OUT_*_OPEN_DRAIN do change line configuration and there's a subchapter about *active low* and *open drain* semantics. Add an explicit mention that the initial value is a logical value (and not the line configuration or physical line level). Also add a mention of the function gpiod_toggle_active_low which was previously missing from this document. Signed-off-by: Hannu Hartikainen Signed-off-by: Bartosz Golaszewski commit 17ce60b2e4f87262eedd693021224130d720c00c Author: Vincent Pelletier Date: Mon Jul 5 00:43:59 2021 +0000 Documentation: gpio: driver.rst: Remove gpiochip_irqchip_add mention This function was removed in commit f1f37abbe6fc ("gpio: Retire the explicit gpio irqchip code") but this mention was left behind. Also, mention that .set_type() only has to set a line handler if the chip is cascaded, as opposed to hierarchical. Signed-off-by: Vincent Pelletier Signed-off-by: Bartosz Golaszewski commit 030fadb0138186cfa04492e1132a9df514d03841 Author: Zheyu Ma Date: Wed Jul 21 12:43:44 2021 +0000 video: fbdev: neofb: add a check against divide error The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error because of the 'PICOS2KHZ' macro. Fix this by checking whether 'pixclock' is zero first. The following log reveals it: [ 53.093806] divide error: 0000 [#1] PREEMPT SMP KASAN PTI [ 53.093838] CPU: 3 PID: 11763 Comm: hang Not tainted 5.14.0-rc2-00478-g2734d6c1b1a0 #215 [ 53.093859] RIP: 0010:neofb_check_var+0x80/0xe50 [ 53.093951] Call Trace: [ 53.093956] ? neofb_setcolreg+0x2b0/0x2b0 [ 53.093968] fb_set_var+0x2e4/0xeb0 [ 53.093977] ? fb_blank+0x1a0/0x1a0 [ 53.093984] ? lock_acquire+0x1ef/0x530 [ 53.093996] ? lock_release+0x810/0x810 [ 53.094005] ? lock_is_held_type+0x100/0x140 [ 53.094016] ? ___might_sleep+0x1ee/0x2d0 [ 53.094028] ? __mutex_lock+0x620/0x1190 [ 53.094036] ? do_fb_ioctl+0x313/0x700 [ 53.094044] ? mutex_lock_io_nested+0xfa0/0xfa0 [ 53.094051] ? __this_cpu_preempt_check+0x1d/0x30 [ 53.094060] ? _raw_spin_unlock_irqrestore+0x46/0x60 [ 53.094069] ? lockdep_hardirqs_on+0x59/0x100 [ 53.094076] ? _raw_spin_unlock_irqrestore+0x46/0x60 [ 53.094085] ? trace_hardirqs_on+0x6a/0x1c0 [ 53.094096] do_fb_ioctl+0x31e/0x700 Signed-off-by: Zheyu Ma Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1626871424-27708-1-git-send-email-zheyuma97@gmail.com commit 28b6a003bcdfa1fc4603b9185b247ecca7af9bef Author: Eric Auger Date: Tue Jun 29 09:22:14 2021 +0200 misc/pvpanic-pci: Allow automatic loading The virtual machine monitor (QEMU) exposes the pvpanic-pci device to the guest. On guest side the module exists but currently isn't loaded automatically. So the driver fails to be probed and does not its job of handling guest panic events. Instead of requiring manual modprobe, let's include a device database using the MODULE_DEVICE_TABLE macro and let the module auto-load when the guest gets exposed with such a pvpanic-pci device. Signed-off-by: Eric Auger Link: https://lore.kernel.org/r/20210629072214.901004-1-eric.auger@redhat.com Signed-off-by: Greg Kroah-Hartman commit 16b0dd40922995bb13f140b025bb760b6c5224b0 Author: Jinchao Wang Date: Sat Jun 26 17:46:06 2021 +0800 driver: base: Replace symbolic permissions with octal permissions Resolve following checkpatch issue, Replace symbolic permissions with octal permissions Signed-off-by: Jinchao Wang Link: https://lore.kernel.org/r/20210626094606.53152-1-wjc@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 8990f96a012f42543005b07d9e482694192e9309 Author: Laurentiu Tudor Date: Thu Jul 15 17:07:18 2021 +0300 bus: fsl-mc: fix mmio base address for child DPRCs Some versions of the MC firmware wrongly report 0 for register base address of the DPMCP associated with child DPRC objects thus rendering them unusable. This is particularly troublesome in ACPI boot scenarios where the legacy way of extracting this base address from the device tree does not apply. Given that DPMCPs share the same base address, workaround this by using the base address extracted from the root DPRC container. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-8-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit 8567494cebe5c208faa336a8316781d32d4e860f Author: Laurentiu Tudor Date: Thu Jul 15 17:07:17 2021 +0300 bus: fsl-mc: rescan devices if endpoint not found If the endpoint of a device is not yet probed on the bus, force a rescan of the devices and retry to get a reference to the endpoint device. If the device is still not found then we assume it's in a different isolation context (container/DPRC) thus unavailable and return a permission error. Signed-off-by: Laurentiu Tudor Signed-off-by: Robert-Ionut Alexa Link: https://lore.kernel.org/r/20210715140718.8513-7-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit 39243fc1110caf1e76ea647059e061a021680dfd Author: Laurentiu Tudor Date: Thu Jul 15 17:07:16 2021 +0300 bus: fsl-mc: pause the MC firmware when unloading Pause the MC firmware when unloading the driver so that it doesn't crash in certain scenarios, such as kexec. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-6-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit 8c97a4fc1b34856812b6775f1f1d46b3bf59bc9d Author: Laurentiu Tudor Date: Thu Jul 15 17:07:15 2021 +0300 bus: fsl-mc: pause the MC firmware before IOMMU setup Add a bus notifier to pause the MC firmware as soon as its device gets discovered. This is needed as the firmware is live thus, as soon as the SMMU gets probed and enabled, it will crash the firmware due to SMMU context faults. The firmware will be resumed at probe time, after the required IOMMU setup was completed. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-5-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit 3ab520cfc772a63e037b5d433c3976c6426bf080 Author: Laurentiu Tudor Date: Thu Jul 15 17:07:14 2021 +0300 bus: fsl-mc: add .shutdown() op for the bus driver The fsl-mc bus driver is missing the .shutdown() callback, so add it. The implementation simply calls the .remove() callback. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-4-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit c40cbad63ddcbf47debe350e736e37525a0c336c Author: Laurentiu Tudor Date: Thu Jul 15 17:07:13 2021 +0300 bus: fsl-mc: fully resume the firmware The MC firmware has two execution units. Resume them both, as on some Layerscape SoCs not doing so breaks the firmware. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-3-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit f8cfa9bbab338b64229bffb93fdbb755be9d58d5 Author: Laurentiu Tudor Date: Thu Jul 15 17:07:12 2021 +0300 bus: fsl-mc: handle DMA config deferral in ACPI case ACPI DMA configure API may return a defer status code, so handle it. On top of this, move the MC firmware resume after the DMA setup is completed to avoid crashing due to DMA setup not being done yet or being deferred. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-2-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit aa0a1ae020e2d24749e9f8085f12ca6d46899c94 Author: Laurentiu Tudor Date: Thu Jul 15 17:07:11 2021 +0300 bus: fsl-mc: fix arg in call to dprc_scan_objects() Second parameter of dprc_scan_objects() is a bool not a pointer so change from NULL to false. Signed-off-by: Laurentiu Tudor Link: https://lore.kernel.org/r/20210715140718.8513-1-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman commit 03acb0c5ac46b1aa5f3015f1e01243aff9e08600 Author: Xiyu Yang Date: Sat Jul 17 18:17:22 2021 +0800 misc: sgi-gru: Convert from atomic_t to refcount_t on gru_thread_state->ts_refcnt refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Acked-by: Dimitri Sivanich Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Link: https://lore.kernel.org/r/1626517043-42696-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman commit 07e913418ce4ba5eb620dd4668bf91ec94e11136 Author: Carlos Llamas Date: Thu Jul 15 03:18:05 2021 +0000 selftests/binderfs: add test for feature files Verify that feature files are created successfully after mounting a binderfs instance. Note that only "oneway_spam_detection" feature is tested with this patch as it is currently the only feature listed. Acked-by: Christian Brauner Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20210715031805.1725878-3-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 06e1721d2a265d1247093f5ad5ae2958ef10a604 Author: Carlos Llamas Date: Thu Jul 15 03:18:04 2021 +0000 docs: binderfs: add section about feature files Document how binder feature files can be used to determine whether a feature is supported by the binder driver. "oneway_spam_detection" is used as an example as it is the first available feature file. Acked-by: Christian Brauner Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20210715031805.1725878-2-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit fc470abf54b2bd6e539065e07905e767b443d719 Author: Carlos Llamas Date: Thu Jul 15 03:18:03 2021 +0000 binderfs: add support for feature files Provide userspace with a mechanism to discover features supported by the binder driver to refrain from using any unsupported ones in the first place. Starting with "oneway_spam_detection" only new features are to be listed under binderfs and all previous ones are assumed to be supported. Assuming an instance of binderfs has been mounted at /dev/binderfs, binder feature files can be found under /dev/binderfs/features/. Usage example: $ mkdir /dev/binderfs $ mount -t binder binder /dev/binderfs $ cat /dev/binderfs/features/oneway_spam_detection 1 Acked-by: Christian Brauner Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20210715031805.1725878-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit ec7b5eda8ae1a7a12cf1618ad7afb3509f593812 Author: Samuel Thibault Date: Thu Jul 1 00:42:48 2021 +0200 speakup: replace sprintf() by scnprintf() Replace sprintf() by scnprintf() in order to avoid buffer overflows. Signed-off-by: Salah Triki Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20210630224248.2iq6o6krecx4cz5j@begin Signed-off-by: Greg Kroah-Hartman commit f83461e6581b12833ecf08690d21b04ed60de7c1 Author: Colin Ian King Date: Thu Jul 15 17:31:22 2021 +0100 speakup: use C99 syntax for array initializers The older obsolete array initializer syntax is currently being used for some of the array elements. Fix this by using the preferred C99 array initializers syntax. Fixes: 5b5140bf5182 ("speakup: Separate out translations for bright colors names") Reviewed-by: Samuel Thibault Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210715163122.62220-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 01c54e628932c655e4cd2c6ed0cc688ec6e6f96b Author: Nava kishore Manne Date: Sat Jun 26 21:22:48 2021 +0530 fpga: versal-fpga: Add versal fpga manager driver Add support for Xilinx Versal FPGA manager. PDI source type can be DDR, OCM, QSPI flash etc.. But driver allocates memory always from DDR, Since driver supports only DDR source type. Reviewed-by: Moritz Fischer Signed-off-by: Appana Durga Kedareswara rao Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20210626155248.5004-6-nava.manne@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 8c9b1301171f6690144d45a3e18ba676acbc34bc Author: Nava kishore Manne Date: Sat Jun 26 21:22:47 2021 +0530 dt-bindings: firmware: Remove xlnx,zynqmp-firmware.txt file The funtionality of xlnx,zynqmp-firmware.txt is replaced with xlnx,zynqmp-firmware.yaml bindings so this patch removes the zynqmp-firmware.txt file Reviewed-by: Rob Herring Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20210626155248.5004-5-nava.manne@xilinx.com Signed-off-by: Greg Kroah-Hartman commit f8cc6d715bfc649e523cc829d2e6d1e58b430a33 Author: Nava kishore Manne Date: Sat Jun 26 21:22:46 2021 +0530 dt-bindings: firmware: Add bindings for xilinx firmware Add documentation to describe Xilinx firmware driver bindings. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to Platform Management Unit. Reviewed-by: Rob Herring Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20210626155248.5004-4-nava.manne@xilinx.com Signed-off-by: Greg Kroah-Hartman commit f9ac897e5a4bf7255f2f7613f2a74c2a9a41327c Author: Appana Durga Kedareswara rao Date: Sat Jun 26 21:22:45 2021 +0530 dt-bindings: fpga: Add binding doc for versal fpga manager This patch adds binding doc for versal fpga manager driver. Reviewed-by: Rob Herring Signed-off-by: Nava kishore Manne Signed-off-by: Appana Durga Kedareswara rao Link: https://lore.kernel.org/r/20210626155248.5004-3-nava.manne@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 2b9fc773c31bb7cb7529757382013a8158bf7e9c Author: Nava kishore Manne Date: Sat Jun 26 21:22:44 2021 +0530 drivers: firmware: Add PDI load API support This patch adds load PDI API support to enable full/partial PDI loading from linux. Programmable Device Image (PDI) is combination of headers, images and bitstream files to be loaded. Reviewed-by: Moritz Fischer Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20210626155248.5004-2-nava.manne@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 99279ad8feb9142ab03f9651c2401c1b3807857b Author: Colin Ian King Date: Wed Jul 21 11:26:08 2021 +0100 video: fbdev: arcfb: remove redundant initialization of variable err The variable err is being initialized with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210721102608.42694-1-colin.king@canonical.com commit 5b869a06a2790a2d1f3ee965e8f38246bfc32d24 Author: Jiri Slaby Date: Wed Jul 14 11:13:14 2021 +0200 amiserial: remove unused state from shutdown 'state' variable is only set but never read in amiserial's shutdown. Drop it. It was like this since the driver was added to the tree as far as I can tell. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 6cc7bda16dfd4a5d89039302cf1668f9820dfb77 Author: Jiri Slaby Date: Wed Jul 14 11:13:13 2021 +0200 amiserial: switch rs_table to a single state amiserial deals only with a single serial, so drop the rs_table array and NR_PORTS and define a single non-array serial_state for simplicity instead. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit f3d788b4254c72d6d6f5e6fc8979f95295865e93 Author: Jiri Slaby Date: Wed Jul 14 11:13:12 2021 +0200 amiserial: pack and sort includes The #include directives are in different places in amiserial: 1) there is no reason for that, and 2) it makes hard to judge what is included and what is not. Therefore, move all the includes to a single place and sort them. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 816807020ea68c889c35b01c38cd2f6d1da69f20 Author: Jiri Slaby Date: Wed Jul 14 11:13:11 2021 +0200 amiserial: expand "custom" "custom" macro is a too generic name. Expand it -- that is use amiga_custom on all the locations. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 935256192996de6317e3afe5dc1b2f8d9c210afd Author: Jiri Slaby Date: Wed Jul 14 11:13:10 2021 +0200 amiserial: expand serial_isroot Having a macro (serial_isroot) for capable(CAP_SYS_ADMIN) does not save us from anything. It rather obfuscates the code. Hence expand serial_isroot to be explicit like every other driver is. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5d4317abd2223eea5884f7e28d1047d5e87d4a6f Author: Jiri Slaby Date: Wed Jul 14 11:13:09 2021 +0200 amiserial: use memset to zero serial_state Zeroing each member of struct serial_state in probe is fragile and overly complicated. Do one memset for them all. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 7ec3114ec78026b132eba2c7f4b1d582fad82047 Author: Jiri Slaby Date: Wed Jul 14 11:13:08 2021 +0200 amiserial: simplify rs_open tty->port is already set when rs_open is called given we linked it by tty_port_link_device(). If it wasn't, the tty layer would WARN loudly. So it's pointless to set it in rs_open. Instead, use the value in tty->port to find out the serial_state (info). It's a fallout of commit b19e2ca77ee4 (TTY: use tty_port_link_device) which added tty_port_link_device here, but omitted to remove the tty->port assignment from rs_open. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5a7c7a6bb7065625a9802fcd712e50c2424eac6b Author: Jiri Slaby Date: Wed Jul 14 11:13:07 2021 +0200 amiserial: remove serial_state::xmit_fifo_size It's always 1, so define a macro for it instead. Note that the check in set_serial_info is doubled, hence remove the latter. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit b44206930a27e321b13a651ea176b6ccb4ce701a Author: Jiri Slaby Date: Wed Jul 14 11:13:06 2021 +0200 amiserial: remove stale comment The comment about interrupt routines is stale at least since commit 41c28ff1635e (kill _INLINE_) from 2006. So remove the obsolete parts and leave only "here they start...". Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 1cd25475a5ebea9a82c61a9a17abea7e78dfff9f Author: Jiri Slaby Date: Wed Jul 14 11:13:05 2021 +0200 amiserial: remove serial_* strings Remove a print of serial_name and serial_version from the probe function, i.e. show_serial_version() from amiga_serial_probe(). The value of such a print is minimal. Aside from that, the version is artificial (copied from the serial core in 2.3.45pre2 and never increased). So inline the version into seq_printf's format string in rs_proc_show() and remove both strings completely. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit ba998c7c3aba194f43f85bb9ce13cb4f077d3b7a Author: Jiri Slaby Date: Wed Jul 14 11:13:04 2021 +0200 amiserial: remove unused DBG_CNT The ugly DBG_CNT macro is unused, so remove. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210714091314.8292-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 33969db7abe9e1cea524e1facb416952211e1d7d Author: Andy Shevchenko Date: Tue Jul 13 12:58:21 2021 +0300 serial: 8250_exar: Add ->unregister_gpio() callback For the sake of reducing layering violation add ->unregister_gpio() callback and use it in the ->exit() one. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210713095821.7834-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e94159dfba797539d69c14cc142baed0e3e8d53e Author: Colin Ian King Date: Mon Jul 19 11:24:21 2021 +0100 tty: serial: Fix spelling mistake "Asychronous" -> "Asynchronous" There is a spelling mistake in the Kconfig text. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210719102421.14813-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 65a2c14d4f008dcea51391bb7189d95ca7656721 Author: Nobuhiro Iwamatsu Date: Thu Jul 15 18:22:52 2021 +0900 dt-bindings: serial: convert Cadence UART bindings to YAML Convert serial for Cadence UART bindings documentation to YAML. Reviewed-by: Rob Herring Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20210715092252.225740-1-iwamatsu@nigauri.org Signed-off-by: Greg Kroah-Hartman commit 5bbe10a6942d668a63bfcb69c8ffdd0660db10f5 Author: Shubhrajyoti Datta Date: Tue Jul 13 12:18:35 2021 +0530 tty: serial: uartlite: Add runtime pm support In the commit 07e5d4ff125a ("Revert serial-uartlite: Add runtime support") the runtime pm support was reverted to aid reverting of the other patches. This patch adds the runtime PM support back. The runtime pm calls are used to gate and enable the clocks. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20210713064835.27978-3-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit ed623dffdeebcc0acac7be6af4a301ee7169cd21 Author: Shubhrajyoti Datta Date: Tue Jul 13 12:18:34 2021 +0530 tty: serial: uartlite: Disable clocks in case of errors In case the uart registration fails the clocks are left enabled. Disable the clock in case of errors. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20210713064835.27978-2-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 3b0c406124719b625b1aba431659f5cdc24a982c Author: Igor Matheus Andrade Torrente Date: Mon Jun 28 10:45:09 2021 -0300 tty: Fix out-of-bound vmalloc access in imageblit This issue happens when a userspace program does an ioctl FBIOPUT_VSCREENINFO passing the fb_var_screeninfo struct containing only the fields xres, yres, and bits_per_pixel with values. If this struct is the same as the previous ioctl, the vc_resize() detects it and doesn't call the resize_screen(), leaving the fb_var_screeninfo incomplete. And this leads to the updatescrollmode() calculates a wrong value to fbcon_display->vrows, which makes the real_y() return a wrong value of y, and that value, eventually, causes the imageblit to access an out-of-bound address value. To solve this issue I made the resize_screen() be called even if the screen does not need any resizing, so it will "fix and fill" the fb_var_screeninfo independently. Cc: stable # after 5.15-rc2 is out, give it time to bake Reported-and-tested-by: syzbot+858dc7a2f7ef07c2c219@syzkaller.appspotmail.com Signed-off-by: Igor Matheus Andrade Torrente Link: https://lore.kernel.org/r/20210628134509.15895-1-igormtorrente@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4fc2d3cd6d3a487a9fb79ebc81f7ae86a7dace7a Author: Tamseel Shams Date: Tue Jun 29 10:29:02 2021 +0530 serial: samsung: use dma_ops of DMA if attached When DMA is used for TX and RX by serial driver, it should pass the DMA device pointer to DMA API instead of UART device pointer. DMA device should be used for DMA API because only the DMA device is aware of how the device connects to the memory. There might be an extra level of address translation due to a SMMU attached to the DMA device. When serial device is used for DMA API, the DMA API will have no clue of the SMMU attached to the DMA device. This patch is necessary to fix the SMMU page faults which is observed when a DMA(with SMMU enabled) is attached to UART for transfer. Acked-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski Signed-off-by: Tamseel Shams Signed-off-by: Ajay Kumar Link: https://lore.kernel.org/r/20210629045902.48912-1-m.shams@samsung.com Signed-off-by: Greg Kroah-Hartman commit b0819465be8be0c76af15436a9e6db4dab4c196e Author: Bing Fan Date: Thu Jul 1 09:38:32 2021 +0800 arm pl011 serial: support multi-irq request In order to make pl011 work better, multiple interrupts are required, such as TXIM, RXIM, RTIM, error interrupt(FE/PE/BE/OE); at the same time, pl011 to GIC does not merge the interrupt lines(each serial-interrupt corresponding to different GIC hardware interrupt), so need to enable and request multiple gic interrupt numbers in the driver. Signed-off-by: Bing Fan Link: https://lore.kernel.org/r/1625103512-30182-1-git-send-email-hptsfb@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8d479237727ce10260bb128c2414489e1d59c103 Author: Lino Sanfilippo Date: Thu Jul 1 00:56:44 2021 +0200 serial: amba-pl011: add RS485 support Add basic support for RS485: Provide a callback to configure RS485 settings. Handle the RS485 specific part in the functions pl011_rs485_tx_start() and pl011_rs485_tx_stop() which extend the generic start/stop callbacks. Beside via IOCTL from userspace RS485 can be enabled by means of the device tree property "rs485-enabled-at-boot-time". Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20210630225644.3744-1-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit 240e126c28df084222f0b661321e8e3ecb0d232e Author: Zheyu Ma Date: Wed Jul 14 05:53:23 2021 +0000 tty: serial: jsm: hold port lock when reporting modem line changes uart_handle_dcd_change() requires a port lock to be held and will emit a warning when lockdep is enabled. Held corresponding lock to fix the following warnings. [ 132.528648] WARNING: CPU: 5 PID: 11600 at drivers/tty/serial/serial_core.c:3046 uart_handle_dcd_change+0xf4/0x120 [ 132.530482] Modules linked in: [ 132.531050] CPU: 5 PID: 11600 Comm: jsm Not tainted 5.14.0-rc1-00003-g7fef2edf7cc7-dirty #31 [ 132.535268] RIP: 0010:uart_handle_dcd_change+0xf4/0x120 [ 132.557100] Call Trace: [ 132.557562] ? __free_pages+0x83/0xb0 [ 132.558213] neo_parse_modem+0x156/0x220 [ 132.558897] neo_param+0x399/0x840 [ 132.559495] jsm_tty_open+0x12f/0x2d0 [ 132.560131] uart_startup.part.18+0x153/0x340 [ 132.560888] ? lock_is_held_type+0xe9/0x140 [ 132.561660] uart_port_activate+0x7f/0xe0 [ 132.562351] ? uart_startup.part.18+0x340/0x340 [ 132.563003] tty_port_open+0x8d/0xf0 [ 132.563523] ? uart_set_options+0x1e0/0x1e0 [ 132.564125] uart_open+0x24/0x40 [ 132.564604] tty_open+0x15c/0x630 Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/1626242003-3809-1-git-send-email-zheyuma97@gmail.com Signed-off-by: Greg Kroah-Hartman commit e7b91932f6223f2996560662623f1c9730fea21f Author: Maciej W. Rozycki Date: Sat Jun 26 06:11:21 2021 +0200 serial: core: Report magic multiplier extra baud rates Report extra baud rates supported above the base rate for ports with the UPF_MAGIC_MULTIPLIER property, so that people have a way to find out that they can be used with their system, e.g.: Serial: 8250/16550 driver, 5 ports, IRQ sharing enabled printk: console [ttyS0] disabled serial8250.0: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A serial8250.0: ttyS0 extra baud rates supported: 230400, 460800 printk: console [ttyS0] enabled printk: bootconsole [uart8250] disabled serial8250.0: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A serial8250.0: ttyS1 extra baud rates supported: 230400, 460800 serial8250.0: ttyS2 at MMIO 0x1f000900 (irq = 20, base_baud = 230400) is a 16550A Otherwise there is no clear way to figure this out, as the feature is only reported as an obscure TTY flag in bit 16: $ cat /sys/class/tty/ttyS[0-2]/flags 0x10010040 0x10010040 0x90000040 $ Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2106260334170.37803@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit b1442c55ce8977aa304c9f5a078e895fac5d1d63 Author: Johan Hovold Date: Thu Jul 15 10:30:11 2021 +0200 serial: 8250: extend compile-test coverage Allow more drivers to be compile tested more easily, for example, when doing subsystem-wide changes. Verified on X86_64 as well as arm, powerpc and m68k with minimal configs in order to catch missing implicit build dependencies. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210715083011.18887-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8a66b31a15966ea4a206819804ae627874b90d15 Author: Colin Ian King Date: Mon Jul 19 10:55:33 2021 +0100 serial: 8250_bcm7271: use NULL to initialized a null pointer Pointer membase is currently being in initialized with zero rather than NULL. Fix this. Acked-by: Florian Fainelli Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210719095533.14017-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 130432076f3b44dab19a5872b59fcfbb50a4ed2d Author: Jianmin Lv Date: Thu Jul 15 14:16:37 2021 +0800 serial: 8250_pnp: Support configurable clock frequency ACPI-based Loongson boards need configurable rather than fixed clock frequency for serial ports. Signed-off-by: Jianmin Lv Signed-off-by: Huacai Chen Link: https://lore.kernel.org/r/20210715061637.134436-1-chenhuacai@loongson.cn Signed-off-by: Greg Kroah-Hartman commit cb3ea80b7c84a2bb521f41af75678667dddca544 Author: Colin Ian King Date: Thu Jul 15 15:07:59 2021 +0100 serial: 8250: 8250_omap: make a const array static, makes object smaller Don't populate the const array k3_soc_devices on the stack but instead it static. Makes the object code smaller by 44 bytes: Before: text data bss dec hex filename 31628 5609 128 37365 91f5 drivers/tty/serial/8250/8250_omap.o After: text data bss dec hex filename 31520 5673 128 37321 91c9 drivers/tty/serial/8250/8250_omap.o Reduction of 44 bytes (gcc version 10.3.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210715140759.27244-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 28edf1d77cd5b5f35828dcc3ac2bfa912bf04a3f Author: Kunihiko Hayashi Date: Wed Jun 23 10:53:28 2021 +0900 dt-bindings: reset: Convert UniPhier glue reset to json-schema Convert the UniPhier peripheral glue reset binding to DT schema format. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1624413208-17562-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Philipp Zabel commit 08218a081e6a95995f9f5de8456c243b92fec335 Author: Sibi Sankar Date: Thu Apr 29 16:21:04 2021 +0530 reset: qcom: Add PDC Global reset signals for WPSS Add PDC Global reset signals for Wireless Processor Subsystem (WPSS) on SC7280 SoCs. Acked-by: Philipp Zabel Reviewed-by: Philipp Zabel Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/1619693465-5724-5-git-send-email-sibis@codeaurora.org Signed-off-by: Philipp Zabel commit 9e3b594a923ee1aa0e13701361350b20f4d2597e Author: Sibi Sankar Date: Thu Apr 29 16:21:03 2021 +0530 dt-bindings: reset: pdc: Add PDC Global bindings Add PDC Global reset controller bindings for SC7280 SoCs. Acked-by: Rob Herring Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/1619693465-5724-4-git-send-email-sibis@codeaurora.org Signed-off-by: Philipp Zabel commit a30d49ff8a329ede9d5483ea7a27a84b91d5fc3c Author: Sibi Sankar Date: Thu Apr 29 16:21:02 2021 +0530 dt-bindings: reset: aoss: Add AOSS reset controller binding Add AOSS reset controller bindings for SC7280 SoCs. Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/1619693465-5724-3-git-send-email-sibis@codeaurora.org Signed-off-by: Philipp Zabel commit 8633ef82f101c040427b57d4df7b706261420b94 Author: Javier Martinez Canillas Date: Fri Jun 25 15:13:59 2021 +0200 drivers/firmware: consolidate EFI framebuffer setup for all arches The register_gop_device() function registers an "efi-framebuffer" platform device to match against the efifb driver, to have an early framebuffer for EFI platforms. But there is already support to do exactly the same by the Generic System Framebuffers (sysfb) driver. This used to be only for X86 but it has been moved to drivers/firmware and could be reused by other architectures. Also, besides supporting registering an "efi-framebuffer", this driver can register a "simple-framebuffer" allowing to use the siple{fb,drm} drivers on non-X86 EFI platforms. For example, on aarch64 these drivers can only be used with DT and doesn't have code to register a "simple-frambuffer" platform device when booting with EFI. For these reasons, let's remove the register_gop_device() duplicated code and instead move the platform specific logic that's there to sysfb driver. Signed-off-by: Javier Martinez Canillas Acked-by: Borislav Petkov Acked-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210625131359.1804394-1-javierm@redhat.com commit d391c58271072d0b0fad93c82018d495b2633448 Author: Javier Martinez Canillas Date: Fri Jun 25 15:09:46 2021 +0200 drivers/firmware: move x86 Generic System Framebuffers support The x86 architecture has generic support to register a system framebuffer platform device. It either registers a "simple-framebuffer" if the config option CONFIG_X86_SYSFB is enabled, or a legacy VGA/VBE/EFI FB device. But the code is generic enough to be reused by other architectures and can be moved out of the arch/x86 directory. This will allow to also support the simple{fb,drm} drivers on non-x86 EFI platforms, such as aarch64 where these drivers are only supported with DT. Signed-off-by: Javier Martinez Canillas Acked-by: Borislav Petkov Acked-by: Greg Kroah-Hartman Acked-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210625130947.1803678-2-javierm@redhat.com commit fc7a6209d5710618eb4f72a77cd81b8d694ecf89 Author: Uwe Kleine-König Date: Tue Jul 13 21:35:22 2021 +0200 bus: Make remove callback return void The driver core ignores the return value of this callback because there is only little it can do when a device disappears. This is the final bit of a long lasting cleanup quest where several buses were converted to also return void from their remove callback. Additionally some resource leaks were fixed that were caused by drivers returning an error code in the expectation that the driver won't go away. With struct bus_type::remove returning void it's prevented that newly implemented buses return an ignored error code and so don't anticipate wrong expectations for driver authors. Reviewed-by: Tom Rix (For fpga) Reviewed-by: Mathieu Poirier Reviewed-by: Cornelia Huck (For drivers/s390 and drivers/vfio) Acked-by: Russell King (Oracle) (For ARM, Amba and related parts) Acked-by: Mark Brown Acked-by: Chen-Yu Tsai (for sunxi-rsb) Acked-by: Pali Rohár Acked-by: Mauro Carvalho Chehab (for media) Acked-by: Hans de Goede (For drivers/platform) Acked-by: Alexandre Belloni Acked-By: Vinod Koul Acked-by: Juergen Gross (For xen) Acked-by: Lee Jones (For mfd) Acked-by: Johannes Thumshirn (For mcb) Acked-by: Johan Hovold Acked-by: Srinivas Kandagatla (For slimbus) Acked-by: Kirti Wankhede (For vfio) Acked-by: Maximilian Luz Acked-by: Heikki Krogerus (For ulpi and typec) Acked-by: Samuel Iglesias Gonsálvez (For ipack) Acked-by: Geoff Levand (For ps3) Acked-by: Yehezkel Bernat (For thunderbolt) Acked-by: Alexander Shishkin (For intel_th) Acked-by: Dominik Brodowski (For pcmcia) Acked-by: Rafael J. Wysocki (For ACPI) Acked-by: Bjorn Andersson (rpmsg and apr) Acked-by: Srinivas Pandruvada (For intel-ish-hid) Acked-by: Dan Williams (For CXL, DAX, and NVDIMM) Acked-by: William Breathitt Gray (For isa) Acked-by: Stefan Richter (For firewire) Acked-by: Benjamin Tissoires (For hid) Acked-by: Thorsten Scherer (For siox) Acked-by: Sven Van Asbroeck (For anybuss) Acked-by: Ulf Hansson (For MMC) Acked-by: Wolfram Sang # for I2C Acked-by: Sudeep Holla Acked-by: Geert Uytterhoeven Acked-by: Dmitry Torokhov Acked-by: Finn Thain Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 15f83bb0191261adece5a26bfdf93c6eccdbc0bb Author: Uwe Kleine-König Date: Tue Jul 13 21:35:21 2021 +0200 s390/scm: Make struct scm_driver::remove return void The driver core ignores the return value of scmdev_remove() (because there is only little it can do when a device disappears). So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Reviewed-by: Cornelia Huck Acked-by: Vineeth Vijayan Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 7a47c52142c18a9239c5afea2c9656c68d3f22e7 Author: Uwe Kleine-König Date: Tue Jul 13 21:35:20 2021 +0200 s390/ccwgroup: Drop if with an always false condition The driver core only calls a bus remove callback when there is a driver. So dev->driver is never NULL and the check can safely be removed. Reviewed-by: Cornelia Huck Acked-by: Vineeth Vijayan Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a7bdb9a9767360c2b4096bbb379e73022b274483 Author: Uwe Kleine-König Date: Tue Jul 13 21:35:19 2021 +0200 s390/cio: Make struct css_driver::remove return void The driver core ignores the return value of css_remove() (because there is only little it can do when a device disappears) and all callbacks return 0 anyhow. So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Reviewed-by: Cornelia Huck Acked-by: Vineeth Vijayan Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit dde0a31863d6a7b05ca7cb5d138586e71afc5e50 Author: Uwe Kleine-König Date: Tue Jul 13 21:35:18 2021 +0200 PCI: endpoint: Make struct pci_epf_driver::remove return void The driver core ignores the return value of pci_epf_device_remove() (because there is only little it can do when a device disappears) and there are no pci_epf_drivers with a remove callback. So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Acked-by: Kishon Vijay Abraham I Acked-by: Bjorn Helgaas Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 334201d503d5903f38f6e804263fc291ce8f451a Author: Mauro Carvalho Chehab Date: Sat Jul 17 11:58:17 2021 +0200 staging: hisilicon,hi6421-spmi-pmic.yaml: fix patternProperties The regex at the patternProperties is wrong, although this was not reported as the DT schema was not enforcing properties. Fix it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/46b2f30df235481cb1404913380e45706dfd8253.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit bb3b6552a5b0679b55c43d49621597e54668f089 Author: Mauro Carvalho Chehab Date: Sat Jul 17 11:58:15 2021 +0200 staging: hikey9xx: split hi6421v600 irq into a separate driver Per MFD subsystem requirements, split the IRQ part of the driver into a separate one with just the IRQ handling code and the powerkey support. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/709e01c9ffafe6cd0ecb23336b44f9bcde2b5bc2.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit 49bd5091a81218cb196be4ccd9db4360412450fa Author: Mauro Carvalho Chehab Date: Sat Jul 17 11:58:14 2021 +0200 staging: hi6421-spmi-pmic: add a missing dot at copyright The Huawei's copyright is missing a dot at the end. Add it, in order to make it similar to the other two copyrights. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/8e280ebe4e577e6c2d919346868f0d27f98ebd49.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit f81d992182570d56db642344fa89a7e1777dbc80 Author: Mauro Carvalho Chehab Date: Sat Jul 17 11:58:13 2021 +0200 staging: hi6421-spmi-pmic: rename GPIO IRQ OF node Instead of using the standard name ("gpios"), use "interrupts". Suggested-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit b82d45a9a6de363dd80704c9a6d9f5313e6099ab Author: Mauro Carvalho Chehab Date: Sat Jul 17 11:58:12 2021 +0200 staging: hi6421-spmi-pmic: rename spmi_device struct Let's not call a pointer to spmi_device as pdev, as it is something else. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/758e98d7f59d739b68b33723a02aca8b9464f8da.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit 571e5894a06dabce193dcee2ad023bd58160838b Author: Diego Roux Date: Thu Jul 15 21:49:00 2021 -0500 staging: bcm2835-audio: Enclose complex macro value in parentheses This patch fixes the checkpatch.pl error: ERROR: Macros with complex values should be enclosed in parentheses Signed-off-by: Diego Roux Link: https://lore.kernel.org/r/20210716024909.39411-1-me@diegoroux04.dynv6.net Signed-off-by: Greg Kroah-Hartman commit df00609821bf17f50a75a446266d19adb8339d84 Author: Geert Uytterhoeven Date: Wed Jul 14 12:13:46 2021 +0200 staging: board: Fix uninitialized spinlock when attaching genpd On Armadillo-800-EVA with CONFIG_DEBUG_SPINLOCK=y: BUG: spinlock bad magic on CPU#0, swapper/1 lock: lcdc0_device+0x10c/0x308, .magic: 00000000, .owner: /-1, .owner_cpu: 0 CPU: 0 PID: 1 Comm: swapper Not tainted 5.11.0-rc5-armadillo-00036-gbbca04be7a80-dirty #287 Hardware name: Generic R8A7740 (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (do_raw_spin_lock+0x20/0x94) [] (do_raw_spin_lock) from [] (dev_pm_get_subsys_data+0x8c/0x11c) [] (dev_pm_get_subsys_data) from [] (genpd_add_device+0x78/0x2b8) [] (genpd_add_device) from [] (of_genpd_add_device+0x34/0x4c) [] (of_genpd_add_device) from [] (board_staging_register_device+0x11c/0x148) [] (board_staging_register_device) from [] (board_staging_register_devices+0x24/0x28) of_genpd_add_device() is called before platform_device_register(), as it needs to attach the genpd before the device is probed. But the spinlock is only initialized when the device is registered. Fix this by open-coding the spinlock initialization, cfr. device_pm_init_common() in the internal drivers/base code, and in the SuperH early platform code. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/57783ece7ddae55f2bda2f59f452180bff744ea0.1626257398.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit d2c57736c430a3fa2c5de2146642eb41f8fe6ca7 Author: Len Baker Date: Sat Jul 17 17:51:45 2021 +0200 staging/rtl8712: Remove all strcpy() uses in favor of strscpy() strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210717155145.15041-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman commit 39630204a96aebdb29634b5f4aea6518e2b97eca Author: Alexander Greyling Date: Sun Jul 11 00:08:15 2021 +0200 staging: rtl8712: Fix alignment This patch fixes the checkpatch.pl issue: CHECK: Alignment should match open parenthesis. Signed-off-by: Alexander Greyling Link: https://lore.kernel.org/r/20210710220815.GA1654486@alexlaptop Signed-off-by: Greg Kroah-Hartman commit 8266d91560867540088022428970974074de740a Author: Christophe JAILLET Date: Mon Jul 5 09:43:07 2021 +0200 staging: rtl8712: Remove some unused #define and enum These #define and the enum WIFI_REG_DOMAIN are unused. They can be removed. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/6d5b505e7de20fdaba1831557baee1daf4656845.1625470822.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 1be059994b29df1344a9b105d64a41476470910d Author: Jan Gruber Date: Mon Jul 5 19:21:01 2021 +0200 staging: rtl8188eu: remove unnecessary logging This commit fixes the following checkpatch.pl issues: + pr_debug("===> %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace 158: FILE: drivers/staging/rtl8188eu/os_dep/usb_intf.c:158: WARNING: Unnecessary ftrace-like logging - prefer using ftrace 177: FILE: drivers/staging/rtl8188eu/os_dep/usb_intf.c:177: + pr_debug("<=== %s\n", __func__); and removes another line of unnecessary logging, which was not identified by checkpatch.pl in an automated manner. Signed-off-by: Jan Gruber Link: https://lore.kernel.org/r/20210705172101.239899-1-j4n6ru@gmail.com Signed-off-by: Greg Kroah-Hartman commit a0d38df6d043f6cfb8ab5f5cec8ae0090ac748e5 Author: Nishal Kulkarni Date: Sat Jun 26 17:00:21 2021 +0530 staging: qlge: Remove unnecessary parentheses around references This patch fixes checkpatch.pl warning: CHECK: Unnecessary parentheses around mpi_coredump->mpi_global_header Signed-off-by: Nishal Kulkarni Link: https://lore.kernel.org/r/YNcPzWXkKkmip95x@nishal-pc Signed-off-by: Greg Kroah-Hartman commit 1126df74797609e12587e2bbcc7155f50f53af25 Author: Martin Kaiser Date: Sun Jul 18 19:36:10 2021 +0200 staging: rtl8188eu: remove cut_mask field from wl_pwr_cfg We're no longer matching power transitions and commands against a power cut version mask. The cut_mask field from struct wl_pwr_cfg can be removed. It was set to PWR_CUT_ALL_MSK for all remaining commands. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d950b477df6190d1cf2b5458b515fea84411d530 Author: Martin Kaiser Date: Sun Jul 18 19:36:09 2021 +0200 staging: rtl8188eu: remove PWR_CMD_READ None of the power flows and transitions includes a read command. PWR_CMD_READ can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a5efd7bd83b4a7d044e415c2d3ccf3a7c81b72b1 Author: Martin Kaiser Date: Sun Jul 18 19:36:08 2021 +0200 staging: rtl8188eu: remove constant function parameter The rtl88eu_pwrseqcmdparsing function takes a parameter to restrict commands to certain power cut versions of the rtl8188eu chipset. This mechanism is not used, the callers always select all versions. Remove the power cut parameter. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9d326c02ef0ee693c87c7af3ef1c69e9e1467a61 Author: Martin Kaiser Date: Sun Jul 18 19:36:07 2021 +0200 staging: rtl8188eu: remove unused power flows and transitions The driver defines a couple of "flows" to move the chip into a certain power state. Each flow is a sequence of "transitions". This patch removes flows and transitions which are not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit dff70f7fbed361b6b5dbffe7607a3c515bfef009 Author: Martin Kaiser Date: Sun Jul 18 19:36:06 2021 +0200 staging: rtl8188eu: remove efuse write support This driver does not need write access to the rtl1888eu chip's efuses. Remove the code to set the voltages for writing the efuses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 264d3064642d1125c5e8fd15d7f60f0639607983 Author: Martin Kaiser Date: Sun Jul 18 19:36:05 2021 +0200 staging: rtl8188eu: remove struct eeprom_priv's EepromOrEfuse This setting is used only in one place. There's no need to store it in a global struct. While at it, merge the two-line Hal_InitPGData88E function and its only caller. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a9dc3f67dcff95864fcc4140b9d478c9135db300 Author: Martin Kaiser Date: Sun Jul 18 19:36:04 2021 +0200 staging: rtl8188eu: remove _CHIP_TYPE enum This enum is not used and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2ad449a187efe6bb1661dcc04b86afc94519f747 Author: Martin Kaiser Date: Sun Jul 18 19:36:03 2021 +0200 staging: rtl8188eu: remove RTL871X_HCI_TYPE enum This enum is not used and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ba21a3acd4be4d68f7c87821b6491e333268c4d7 Author: Martin Kaiser Date: Sun Jul 18 19:36:02 2021 +0200 staging: rtl8188eu: remove the "trigger gpio 0" hal variable The hal variable to trigger gpio 0 seems to be a leftover from debugging code that was removed. An empty function is called when this variable is written to. Remove the empty function and the variable itself. It should be safe to remove an entry from the hw_variables enum as this enum is used only within the rtl8188eu driver. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d2785a198b7c484f8e36ad2fd147c2a7ba243922 Author: Martin Kaiser Date: Sun Jul 18 19:36:01 2021 +0200 staging: rtl8188eu: merge two functions All that rtw_hal_read_chip_info does is call _ReadPROMContent. Merge the two functions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210718173610.894-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 552fd002bdb520af3a8bedf1ee36185cf5e2c52f Author: Phillip Potter Date: Tue Jul 20 23:58:26 2021 +0100 staging: rtl8188eu: move hal/mac_cfg.c and rename function and array Move source file hal/mac_cfg.c to the 'core' driver directory, and also rename its array from array_MAC_REG_8188E to array_MAC_REG, as well as renaming the function rtl88eu_phy_mac_config to phy_mac_config. Also modify single call-site for this function to reflect new name. This file contains no code which touches the adapter's HalData structure, and is a good candidate for therefore moving out of 'hal'. Also, no need for these signatures to include the model number as this driver only supports RTL8188eu. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210720225826.454516-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit bf44e8cecc03c9c6197c0b65d54703746a62fb35 Author: Christoph Hellwig Date: Fri Jul 16 08:16:34 2021 +0200 vgaarb: don't pass a cookie to vga_client_register The VGA arbitration is entirely based on pci_dev structures, so just pass that back to the set_vga_decode callback. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-8-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit f6b1772b255504e9666cb8b1beabfd00abb2da56 Author: Christoph Hellwig Date: Fri Jul 16 08:16:33 2021 +0200 vgaarb: remove the unused irq_set_state argument to vga_client_register All callers pass NULL as the irq_set_state argument, so remove it and the ->irq_set_state member in struct vga_device. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-7-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit b8779475869a26ffcd2fde279f7b364ec5722d0d Author: Christoph Hellwig Date: Fri Jul 16 08:16:32 2021 +0200 vgaarb: provide a vga_client_unregister wrapper Add a trivial wrapper for the unregister case that sets all fields to NULL. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-6-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit 6609176f56ad895ba25d4c120c707fb15f45aa4e Author: Christoph Hellwig Date: Fri Jul 16 08:16:31 2021 +0200 vgaarb: cleanup vgaarb.h Merge the different CONFIG_VGA_ARB ifdef blocks, remove superflous externs, and regularize the stubs for !CONFIG_VGA_ARB. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-5-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit 45549c00d3ff05735e7ceb89b20e302301cd6b14 Author: Christoph Hellwig Date: Fri Jul 16 08:16:30 2021 +0200 vgaarb: move the kerneldoc for vga_set_legacy_decoding to vgaarb.c Kerneldoc comments should be at the implementation side, not in the header just declaring the prototype. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-4-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit b0b514abc4cf2841ee1e0833252b2e8a78401276 Author: Christoph Hellwig Date: Fri Jul 16 08:16:29 2021 +0200 vgaarb: remove vga_conflicts vga_conflicts only has a single caller and none of the arch overrides mentioned in the comment. Just remove it and the thus dead check in the caller. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-3-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit 77e21b50acab326173716830ef15a2f237f2d198 Author: Christoph Hellwig Date: Fri Jul 16 08:16:28 2021 +0200 vgaarb: remove VGA_DEFAULT_DEVICE The define is entirely unused. Signed-off-by: Christoph Hellwig Link: https://patchwork.freedesktop.org/patch/msgid/20210716061634.2446357-2-hch@lst.de Acked-by: Christian König Signed-off-by: Christian König commit 8655e695ac648287c432e2048a73decc552b019c Author: Fabio Aiuto Date: Sat Jul 17 16:56:51 2021 +0200 staging: rtl8723bs: fix camel case argument name in macro is_supported_tx_cck fix camel case argument name in is_supported_tx_cck Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/f38fbb1388a54c78602750ecb86d0716d1aaf66b.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit ef35b7a88d46738cc13299103eacfa4d14c741a1 Author: Fabio Aiuto Date: Sat Jul 17 16:56:50 2021 +0200 staging: rtl8723bs: fix camel case name in macro IsSupportedTxCCK fix camel case name in macro IsSupportedTxCCK Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/65aec26a3c25f1e756e33bf5f7f5af0cd3b105df.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit a13d275b9b482a73c2224b99b08cdda4b73f5d64 Author: Fabio Aiuto Date: Sat Jul 17 16:56:49 2021 +0200 staging: rtl8723bs: remove unused macros in include/ieee80211.h remove unused macros in include/ieee80211.h Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c50cba3974772347888bd55085b1e5e44ef0687d.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 202f7148c3a187cff57875b15eef7b0352db00bb Author: Fabio Aiuto Date: Sat Jul 17 16:56:48 2021 +0200 staging: rtl8723bs: fix post-commit camel case issues fix the following post-commit camel case issues: CHECK: Avoid CamelCase: 33: FILE: drivers/staging/rtl8723bs/hal/hal_com.c:152: + if (is_supported_24g(Adapter-> registrypriv.wireless_mode) == false) CHECK: Avoid CamelCase: 46: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:159: +#define is_supported_24g(NetType) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false) CHECK: Avoid CamelCase: 49: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:161: +#define IsEnableHWCCK(NetType) is_supported_24g(NetType) Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/6fd6d3266b5119330e15006ae610cb49b767bc59.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 198e84ae5941765725ee4a299df8e5290eafa83c Author: Fabio Aiuto Date: Sat Jul 17 16:56:47 2021 +0200 staging: rtl8723bs: fix camel case name in macro IsSupported24G fix camel case name in macro IsSupported24G Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/fd5e1873f72e7d5f72b6f4bf801ede882e9df4e2.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit bea76a2ab83e4eaac338823727bacbc08d147c69 Author: Fabio Aiuto Date: Sat Jul 17 16:56:46 2021 +0200 staging: rtl8723bs: fix camel case in argument of macro is_legacy_only fix camel case in argument of macro is_legacy_only Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/404028e00ca4a32bfaed753d5927d9b673e6058d.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fc806fff7f7787a3bf2a83a41d6c99e361ab5bb Author: Fabio Aiuto Date: Sat Jul 17 16:56:45 2021 +0200 staging: rtl8723bs: fix camel case name in macro IsLegacyOnly() fix camel case name in macro IsLegacyOnly() Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/52656190cefed1b0f9a2dd6dcb080adf2ca0a89b.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2c02bce1dfe62bb64f223960575bf2f7c77f8eba Author: Fabio Aiuto Date: Sat Jul 17 16:56:44 2021 +0200 staging: rtl8723bs: fix camel case issue fix following post commit hook checkpatch issue: CHECK: Avoid CamelCase: 45: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:170: +#define is_supported_ht(NetType) (((NetType) & (WIRELESS_11_24N)) ? true : false) Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a708b2b9902bedf5bd0466b05516a4c5b4f43723.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 309f3cd3d7f439ff62197469c4a4132aecce11b8 Author: Fabio Aiuto Date: Sat Jul 17 16:56:43 2021 +0200 staging: rtl8723bs: convert IsSupportedHT to snake_case convert IsSupportedHT to snake case is_supported_ht. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/d3e115f3a553db07a52cc51b71d04de9c383f697.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5402cc178c5ddcac871456eacbf8bc5ad72d41e9 Author: Fabio Aiuto Date: Sat Jul 17 16:56:42 2021 +0200 staging: rtl8723bs: add get_channel cfg80211 implementation add get_channel cfg80211 implementation to let userspace programs rely on nl80211 protocol to display channel information. Old iw dev output: phy#0 Interface wlan0 ifindex 2 wdev 0x1 addr 34:c3:d2:73:eb:c7 ssid Fabio type managed txpower 12.00 dBm Fixed output: phy#0 Interface wlan0 ifindex 2 wdev 0x1 addr 34:c3:d2:73:eb:c7 ssid Fabio type managed new--> channel 11 (2462 MHz), width: 20 MHz, center1: 2462 Mhz txpower 12.00 dBm Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2f00479d8369b82b590291bb0edf27bc3041b0f0.1626533647.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2 Author: Fabio Aiuto Date: Thu Jul 15 16:57:00 2021 +0200 staging: rtl8723bs: fix wpa_set_auth_algs() function fix authentication algorithm constants. wpa_set_auth_algs() function contains some conditional statements masking the checked value with the wrong constants. This produces some unintentional dead code. Mask the value with the right macros. Fixes: 5befa937e8da ("staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.") Reported-by: Colin Ian King Tested-on: Lenovo Ideapad MiiX 300-10IBY Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/20210715145700.9427-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9b9e0baec52706ae9c1c6cafeecdf88c187bab5 Author: Bryan Brattlof Date: Tue Jun 29 14:02:52 2021 +0000 staging: rtl8723bs: remove custom endian conversion macros The rtw_cpu_to_leXX() and rtw_leXX_to_cpu() family of macros are unnecessary and should be removed. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20210629135824.47749-1-hello@bryanbrattlof.com Signed-off-by: Greg Kroah-Hartman commit f0deefa679af621c51453b114b6977151b62cd39 Author: Colin Ian King Date: Wed Jun 30 07:56:47 2021 +0100 staging: r8188eu: Fix while-loop that iterates only once The while-loop only iterates once becase the post increment test of count being non-zero is false on the first iteration because count is zero. Fix this by using a for-loop instead. Static analysis found the issue on the count > POLLING_LLT_THRESHOLD check always being false since the loop currently just iterates once. Thanks to David Laight for suggesting using for-loop instead to improve the readability of the fix. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210630065647.5641-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit e7ca5907d1e00dfa639cae8864db56eca906738d Author: Jan Gruber Date: Mon Jul 5 09:21:25 2021 +0200 staging: rtl8188eu: remove unnecessary braces This commit fixes the following checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Jan Gruber Link: https://lore.kernel.org/r/20210705072125.199810-1-j4n6ru@gmail.com Signed-off-by: Greg Kroah-Hartman commit ac5951a6e3d50cfa861ea83baa2ec15d994389cb Author: Phillip Potter Date: Fri Jun 25 20:16:58 2021 +0100 staging: rtl8188eu: remove rtw_wx_set_rate handler function Remove rtw_wx_set_rate handler function, which currently handles the SIOCSIWRATE wext ioctl. This function (although containing a lot of code) set nothing outside its own local variables, and did nothing other than call a now removed debugging statement repeatedly. Removing it and leaving its associated entry in rtw_handlers as NULL is therefore the better option. Removing this function also fixes a kernel test robot warning. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210625191658.1299-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 363963c2fefb8b002aac3cebe368b853ebfad675 Author: Phillip Potter Date: Fri Jun 25 19:30:07 2021 +0100 staging: rtl8188eu: remove set but unused variable from rtw_get_sec_ie Remove set but unused variable 'sec_idx' from the rtw_get_sec_ie function inside core/rtw_ieee80211.c, to fix a kernel test robot warning introduced by recent removal of erroneous debug statements. Reported-by: kernel test robot Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210625183007.7065-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8e6cb5d27e8246d9c986ec162d066a502d2b602b Author: Wesley Cheng Date: Sun Jul 4 02:33:12 2021 +0100 usb: dwc3: dwc3-qcom: Fix typo in the dwc3 vbus override API There was an extra character in the dwc3_qcom_vbus_override_enable() function. Removed the extra character. Signed-off-by: Wesley Cheng Signed-off-by: Bryan O'Donoghue Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210704013314.200951-2-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0356e6283c7177391d144612f4b12986ed5c4f6e Author: Ruslan Bilovol Date: Mon Jul 12 14:55:29 2021 +0200 usb: gadget: f_uac1: add volume and mute support This adds bi-directional (host->device, device->host) volume/mute support to the f_uac1 driver by adding Feature Units and interrupt endpoint. Currently only master channel is supported. Volume and mute are configurable through configfs, by default volume has -100..0 dB range with 1 dB step. Similar to existing flexible endpoints configuration, Feature Unit won't be added to the topology if both mute and volume are not enabled, also interrupt endpoint isn't added to the device if no feature unit is present Signed-off-by: Ruslan Bilovol Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20210712125529.76070-5-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit eaf6cbe0992052a46d93047dc122fad5126aa3bd Author: Ruslan Bilovol Date: Mon Jul 12 14:55:28 2021 +0200 usb: gadget: f_uac2: add volume and mute support This adds bi-directional (host->device, device->host) volume/mute support to the f_uac2 driver by adding Feature Units and interrupt endpoint. Currently only master channel is supported. Volume and mute are configurable through configfs, by default volume has -100..0 dB range with 1 dB step. Similar to existing flexible endpoints configuration, Feature Unit won't be added to the topology if both mute and volume are not enabled, also interrupt endpoint isn't added to the device if no feature unit is present Signed-off-by: Ruslan Bilovol Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20210712125529.76070-4-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 02de698ca8123782c0c6fb8ed99080e2f032b0d2 Author: Ruslan Bilovol Date: Mon Jul 12 14:55:27 2021 +0200 usb: gadget: u_audio: add bi-directional volume and mute support USB Audio Class 1/2 have ability to change device's volume and mute by USB Host through class-specific control requests. Device also can notify Host about volume/mute change on its side through optional interrupt endpoint. This patch adds Volume and Mute ALSA controls which can be used by user to send and receive notifications to/from the USB Host about Volume and Mute change. These params come from f_uac* so volume and mute controls will be created only if the function support and enable each explicitly Signed-off-by: Ruslan Bilovol Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20210712125529.76070-3-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit b48f8939b9ff593ebed20433bb53c51199920412 Author: Ruslan Bilovol Date: Mon Jul 12 14:55:26 2021 +0200 usb: audio-v2: add ability to define feature unit descriptor Similar to UAC1 spec, UAC2 feature unit descriptor has variable size. Current audio-v2 feature unit descriptor structure is used for parsing descriptors, but can't be used to define your own descriptor. Add a new macro similar to what audio v1 already has. Signed-off-by: Ruslan Bilovol Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20210712125529.76070-2-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 0c29ec921059abf110434addd8b8ed9032e710c7 Author: Biju Das Date: Wed Jun 30 08:30:03 2021 +0100 dt-bindings: usb: generic-ohci: Document dr_mode property Document the optional property dr_mode present on both RZ/G2 and R-Car Gen3 SoCs. It fixes the dtbs_check warning, 'dr_mode' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210630073013.22415-2-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 31f21e2a09a150972f9188c3a785998131e843ba Author: Biju Das Date: Wed Jun 30 08:30:04 2021 +0100 dt-bindings: usb: generic-ehci: Document dr_mode property Document the optional property dr_mode present on both RZ/G2 and R-Car Gen3 SoCs. It fixes dtbs_check warning, 'dr_mode' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210630073013.22415-3-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit b833ce15ce33a6e6b1d729fc78af79362aa8681e Author: Minas Harutyunyan Date: Mon Jul 12 15:05:23 2021 +0400 usb: dwc2: gadget: Add endpoint wedge support Add enpoint wedge support. Tested by USBCV MSC tests. Signed-off-by: Argishti Aleksanyan Signed-off-by: Minas Harutyunyan Link: https://lore.kernel.org/r/3143ea6b8eee08761709a6c2788216292be46a34.1626087390.git.Minas.Harutyunyan@synopsys.com Signed-off-by: Greg Kroah-Hartman commit bcacbf06c891374e7fdd7b72d11cda03b0269b43 Author: Jack Pham Date: Tue Jul 20 01:09:07 2021 -0700 usb: gadget: composite: Allow bMaxPower=0 if self-powered Currently the composite driver encodes the MaxPower field of the configuration descriptor by reading the c->MaxPower of the usb_configuration only if it is non-zero, otherwise it falls back to using the value hard-coded in CONFIG_USB_GADGET_VBUS_DRAW. However, there are cases when a configuration must explicitly set bMaxPower to 0, particularly if its bmAttributes also has the Self-Powered bit set, which is a valid combination. This is specifically called out in the USB PD specification section 9.1, in which a PDUSB device "shall report zero in the bMaxPower field after negotiating a mutually agreeable Contract", and also verified by the USB Type-C Functional Test TD.4.10.2 Sink Power Precedence Test. The fix allows the c->MaxPower to be used for encoding the bMaxPower even if it is 0, if the self-powered bit is also set. An example usage of this would be for a ConfigFS gadget to be dynamically updated by userspace when the Type-C connection is determined to be operating in Power Delivery mode. Co-developed-by: Ronak Vijay Raheja Acked-by: Felipe Balbi Signed-off-by: Ronak Vijay Raheja Signed-off-by: Jack Pham Link: https://lore.kernel.org/r/20210720080907.30292-1-jackp@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit fb4e52b609f0e29468b8f5b71117456410ff7d3b Author: Linus Walleij Date: Tue Jul 20 22:03:36 2021 +0200 usb: isp1301-omap: Fix the GPIO include The file is using only GPIO descriptors, so only include instead of the legacy include. This is a non-urgent fix. Fixes: f3ef38160e3d ("usb: isp1301-omap: Convert to use GPIO descriptors") Cc: Tony Lindgren Cc: Felipe Balbi Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210720200336.223398-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit 884c274408296e7e0f56545f909b3d3a671104aa Author: Moritz Fischer Date: Sat Jul 17 18:51:11 2021 -0700 usb: renesas-xhci: Remove renesas_xhci_pci_exit() Remove empty function renesas_xhci_pci_exit() that does not actually do anything. Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: Vinod Koul Signed-off-by: Moritz Fischer Link: https://lore.kernel.org/r/20210718015111.389719-3-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman commit e13690d527bb400b09ef669d28bd11d8db3f1b08 Author: Moritz Fischer Date: Sat Jul 17 18:51:10 2021 -0700 usb: xhci-renesas: Minor coding style cleanup Change an explicit err == 0 to !err. No functional change. Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: Vinod Koul Signed-off-by: Moritz Fischer Link: https://lore.kernel.org/r/20210718015111.389719-2-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman commit e725ace06fc4072a5a9e934805fbe42454b32c90 Author: Sergey Shtylyov Date: Mon Jul 12 21:16:07 2021 +0300 usb: host: ohci-spear: simplify calling usb_add_hcd() There is no need to call platform_get_irq() when the driver's probe() method calls usb_add_hcd() -- the platform_get_irq()'s result will have been stored already in the 'irq' local variable... Acked-by: Alan Stern Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/3e4ad969-f2ae-32f7-53fd-ea369f140703@omp.ru Signed-off-by: Greg Kroah-Hartman commit 73cb0912894bb9d7a536e7c1a87b43edf481727c Author: Sandeep Maheswaram Date: Tue Jul 6 18:30:13 2021 +0530 arm64: dts: qcom: sc7280: Add USB nodes for IDP board Add USB nodes for sc7280 IDP board. Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1625576413-12324-4-git-send-email-sanm@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit bb9efa59c6656fe05f3ec6480a01fea5e9425898 Author: Sandeep Maheswaram Date: Tue Jul 6 18:30:12 2021 +0530 arm64: dts: qcom: sc7280: Add USB related nodes Add nodes for DWC3 USB controller, QMP and HS USB PHYs in sc7280 SOC. Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1625576413-12324-3-git-send-email-sanm@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit e516ac5d48fe800b9526e1bb144671f9da9b0a47 Author: Sandeep Maheswaram Date: Tue Jul 6 18:30:11 2021 +0530 dt-bindings: phy: qcom,qmp-usb3-dp: Add support for SC7280 Add compatible for SC7280 in QMP USB3 DP PHY bindings. Reviewed-by: Stephen Boyd Acked-by: Rob Herring Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1625576413-12324-2-git-send-email-sanm@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit 61136a12cbed234374ec6f588af57c580b20b772 Author: Evgeny Novikov Date: Thu Jul 8 11:30:56 2021 +0300 USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable() mv_ehci_enable() did not disable and unprepare clocks in case of failures of phy_init(). Besides, it did not take into account failures of ehci_clock_enable() (in effect, failures of clk_prepare_enable()). The patch fixes both issues and gets rid of redundant wrappers around clk_prepare_enable() and clk_disable_unprepare() to simplify this a bit. Found by Linux Driver Verification project (linuxtesting.org). Acked-by: Alan Stern Signed-off-by: Evgeny Novikov Link: https://lore.kernel.org/r/20210708083056.21543-1-novikov@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 8ae01239609b29ec2eff55967c8e0fe3650cfa09 Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:34 2021 -0700 usb: gadget: u_ether: fix a potential null pointer dereference f_ncm tx timeout can call us with null skb to flush a pending frame. In this case skb is NULL to begin with but ceases to be null after dev->wrap() completes. In such a case in->maxpacket will be read, even though we've failed to check that 'in' is not NULL. Though I've never observed this fail in practice, however the 'flush operation' simply does not make sense with a null usb IN endpoint - there's nowhere to flush to... (note that we're the gadget/device, and IN is from the point of view of the host, so here IN actually means outbound...) Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-6-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6607d1a4c3c946d3420d33d1b561d7bee8f693c9 Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:33 2021 -0700 usb: gadget: f_ncm: ncm_wrap_ntb - move var definitions into if statement Since they're only used if there's an skb. Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-5-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit b88668fec959fec0e77196455ec82778d8065941 Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:32 2021 -0700 usb: gadget: f_ncm: remove spurious if statement the current logic is: struct sk_buff *skb2 = NULL; ... if (!skb && !ncm->skb_tx_data) return NULL; if (skb) { ... } else if (ncm->skb_tx_data) ... } return skb2; Which means that first if statement is simply not needed. Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-4-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec017d6b60f8aa400987fe95cd839e9ba5dda41d Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:31 2021 -0700 usb: gadget: f_ncm: remove check for NULL skb_tx_data in timer function This condition is already checked for in ncm_wrap_ntb(), except that that check is done with eth_dev->lock held (it is grabbed by eth_start_xmit). It's best to not be reaching into ncm struct without locks held. Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-3-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf4e2e880bde13af103d229be261e8f80c37921f Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:30 2021 -0700 usb: gadget: f_ncm: remove spurious boolean timer_stopping It is equivalent to ncm->netdev being NULL. Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-2-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit dbaaca9aa5ce36c07a01a157d203071f6332a2af Author: Maciej Żenczykowski Date: Thu Jul 1 04:48:29 2021 -0700 usb: gadget: f_ncm: remove timer_force_tx field It is simply not needed. This field is equivalent to skb being NULL. Currently with the boolean set to true we call: ncm->netdev->netdev_ops->ndo_start_xmit(NULL, ncm->netdev); which calls u_ether's: eth_start_xmit(NULL, ...) which then calls: skb = dev->wrap(dev->port_usb, NULL); which calls back into f_ncm's: ncm_wrap_ntb(..., NULL) Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20210701114834.884597-1-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit 091cb2f782f32ab68c6f5f326d7868683d3d4875 Author: Kelly Devilliv Date: Sun Jun 27 20:57:47 2021 +0800 usb: host: fotg210: fix the actual_length of an iso packet We should acquire the actual_length of an iso packet from the iTD directly using FOTG210_ITD_LENGTH() macro. Signed-off-by: Kelly Devilliv Link: https://lore.kernel.org/r/20210627125747.127646-4-kelly.devilliv@gmail.com Signed-off-by: Greg Kroah-Hartman commit c2e898764245c852bc8ee4857613ba4f3a6d761d Author: Kelly Devilliv Date: Sun Jun 27 20:57:46 2021 +0800 usb: host: fotg210: fix the endpoint's transactional opportunities calculation Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we should make use of the usb_endpoint_* helpers instead and remove the unnecessary max_packet()/hb_mult() macro. Signed-off-by: Kelly Devilliv Link: https://lore.kernel.org/r/20210627125747.127646-3-kelly.devilliv@gmail.com Signed-off-by: Greg Kroah-Hartman commit c4c1faf8254885a52412b456c90d0acc9e94db22 Author: Kelly Devilliv Date: Sun Jun 27 20:57:45 2021 +0800 Revert "usb: host: fotg210: Use dma_pool_zalloc" This reverts commit cb6a0db8fdc12433ed4281331de0c3923dc2807b for the same reason as commit 43b78f1155c868208a413082179251f5fba78153 in the ehci-hcd driver. Alan writes: What you can't see just from reading the patch is that in both cases (ehci->itd_pool and ehci->sitd_pool) there are two allocation paths -- the two branches of an "if" statement -- and only one of the paths calls dma_pool_[z]alloc. However, the memset is needed for both paths, and so it can't be eliminated. Given that it must be present, there's no advantage to calling dma_pool_zalloc rather than dma_pool_alloc. Signed-off-by: Kelly Devilliv Link: https://lore.kernel.org/r/20210627125747.127646-2-kelly.devilliv@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d151d39073aff498358543801fca0f670fea981 Author: Steffen Klassert Date: Sun Jul 18 09:11:06 2021 +0200 xfrm: Add possibility to set the default to block if we have no policy As the default we assume the traffic to pass, if we have no matching IPsec policy. With this patch, we have a possibility to change this default from allow to block. It can be configured via netlink. Each direction (input/output/forward) can be configured separately. With the default to block configuered, we need allow policies for all packet flows we accept. We do not use default policy lookup for the loopback device. v1->v2 - fix compiling when XFRM is disabled - Reported-by: kernel test robot Co-developed-by: Christian Langrock Signed-off-by: Christian Langrock Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert commit dcb7c0b9461c2a30f6616262736daac6f01ecb09 Author: Kees Cook Date: Tue Jul 20 14:54:17 2021 -0700 hardening: Clarify Kconfig text for auto-var-init Clarify the details around the automatic variable initialization modes available. Specifically this details the values used for pattern init and expands on the rationale for zero init safety. Additionally makes zero init the default when available. Cc: glider@google.com Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: linux-security-module@vger.kernel.org Cc: clang-built-linux@googlegroups.com Signed-off-by: Kees Cook Acked-by: Gustavo A. R. Silva commit 7d3370e506ec5cd781ef6b938cf29c046eb77585 Author: Dmitry Torokhov Date: Tue Jul 20 21:48:35 2021 -0700 Revert "Input: serio - make write method mandatory" This reverts commit 81c7c0a350bfe9306ad9fb10356534ede8f4ab31. The idea to make write method mandatory was flawed as several client drivers (such as atkbd) check for presence of write() method to adjust behavior of the driver. Reported-by: Nathan Chancellor Reported-by: Michael Kelley Signed-off-by: Dmitry Torokhov commit 0e96454ca26cc5c594ec792f7e5168cce726f7cf Author: Dave Jiang Date: Wed Jul 14 16:25:00 2021 -0700 dmaengine: idxd: remove fault processing code Kernel memory are pinned and will not cause faults. Since the driver does not support interrupts for user descriptors, no fault errors are expected to come through the misc interrupt. Remove dead code. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162630502789.631986.10591230961790023856.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9 Author: Dave Jiang Date: Thu Jul 15 11:44:47 2021 -0700 dmaengine: idxd: move dsa_drv support to compatible mode The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different different drivers. Those internal drivers were invisible to userspace. With the idxd driver transitioned to a proper bus device-driver model, the legacy behavior needs to be preserved due to it being exposed to user space via sysfs. Create a compat driver to provide the legacy behavior for /sys/bus/dsa/drivers/dsa. This should satisfy user tool accel-config v3.2 or ealier where this behavior is expected. If the distro has a newer accel-config then the legacy mode does not need to be enabled. When the compat driver binds the device (i.e. dsa0) to the dsa driver, it will be bound to the new idxd_drv. The wq device (i.e. wq0.0) will be bound to either the dmaengine_drv or the user_drv. The dsa_drv becomes a routing mechansim for the new drivers. It will not support additional external drivers that are implemented later. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637468705.744545.4399080971745974435.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit d9e5481fca74f870cf2fc2f90a0e77e85c0b5b86 Author: Dave Jiang Date: Thu Jul 15 11:44:41 2021 -0700 dmaengine: dsa: move dsa_bus_type out of idxd driver to standalone In preparation for dsa_drv compat support to be built-in, move the bus code to its own compilation unit. A follow-on patch adds the compat implementation. Recall that the compat implementation allows for the deprecated / omnibus dsa_drv binding scheme rather than the idiomatic organization of a full fledged bus driver per driver type. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637468142.744545.2811632736881720857.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 448c3de8ac8353fc4447738ae3c56c4eb6c2131d Author: Dave Jiang Date: Thu Jul 15 11:44:35 2021 -0700 dmaengine: idxd: create user driver for wq 'device' The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_user_drv driver that controls the enabling and disabling of the wq and also register and unregister a char device to allow user space to mmap the descriptor submission portal. The cdev related bits are moved to the cdev driver probe/remove and out of the drv_enabe/disable_wq() calls. These bits are exclusive to the cdev operation and not part of the generic enable/disable of the wq device. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637467578.744545.10203997610072341376.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 0cda4f6986a3824cac500f66326ff267bf37110f Author: Dave Jiang Date: Thu Jul 15 11:44:30 2021 -0700 dmaengine: idxd: create dmaengine driver for wq 'device' The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_dmaengine_drv driver that controls the enabling and disabling of the wq and also register and unregister the dma channel. idxd_wq_alloc_resources() and idxd_wq_free_resources() also get moved to the dmaengine driver. The resources (dma descriptors allocation and setup) are only used by the dmaengine driver and should only happen when it loads. The char dev driver (cdev) related bits are left in the __drv_enable_wq() and __drv_disable_wq() calls to be moved when we split out the char dev driver just like how the dmaengine driver is split out. WQ autoload support is not expected currently. With the amount of configuration needed for the device, the wq is always expected to be enabled by a tool (or via sysfs) rather than auto enabled at driver load. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637467033.744545.12330636655625405394.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 034b3290ba257f1a3c8730f3fba72e11645e7b50 Author: Dave Jiang Date: Thu Jul 15 11:44:24 2021 -0700 dmaengine: idxd: create idxd_device sub-driver The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_drv driver that control the enabling and disabling of the accelerator device. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637466439.744545.15210886092627144577.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 5fee6567ec387088ec965ee60c63051bbe102cac Author: Dave Jiang Date: Thu Jul 15 11:44:18 2021 -0700 dmaengine: idxd: add type to driver in order to allow device matching Add an array of support device types to the idxd_device_driver definition in order to enable simple matching of device type to a given driver. The deprecated / omnibus dsa_drv driver specifies IDXD_DEV_NONE as its only role is to service legacy userspace (old accel-config) directed bind requests and route them to them the proper driver. It need not attach to a device when the bus is autoprobed. The accel-config tooling is being updated to drop its dependency on this deprecated bind scheme. Reviewed-by: Dan Willliams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637465882.744545.17456174666211577867.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit c05257b5600bb35a580ecdb25695efff26326d59 Author: Dave Jiang Date: Thu Jul 15 11:44:13 2021 -0700 dmanegine: idxd: open code the dsa_drv registration Don't need a wrapper to register the driver. Just do it directly. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637465319.744545.16325178432532362906.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 745e92a6d816277fcbd231bda5ad2d882b22fe52 Author: Dave Jiang Date: Thu Jul 15 11:44:07 2021 -0700 dmaengine: idxd: idxd: move remove() bits for idxd 'struct device' to device.c Move the code related to a ->remove() function for the idxd 'struct device' to device.c to prep for the idxd device sub-driver in device.c. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637464768.744545.15797285510999151668.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit bd42805b5da33b9c75f3ce0ae9d6ff0ec3f2cd6b Author: Dave Jiang Date: Thu Jul 15 11:44:01 2021 -0700 dmaengine: idxd: move probe() bits for idxd 'struct device' to device.c Move the code related to a ->probe() function for the idxd 'struct device' to device.c to prep for the idxd device sub-driver in device.c. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637464189.744545.17423830646786162194.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit fcc2281b142bf14e3534d6b1150991194f8d1d44 Author: Dave Jiang Date: Thu Jul 15 11:43:55 2021 -0700 dmaengine: idxd: fix bus_probe() and bus_remove() for dsa_bus Current implementation have put all the code that should be in a driver probe/remove in the bus probe/remove function. Add ->probe() and ->remove() support for the dsa_drv and move all those code out of bus probe/remove. The change does not split out the distinction between device sub-driver and wq sub-driver. It only cleans up the bus calls. The split out will be addressed in follow on patches. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637463586.744545.5806250155539938643.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 1c264299431e9a105f3974ad49b6bccc3f03540f Author: Dave Jiang Date: Thu Jul 15 11:43:49 2021 -0700 dmaengine: idxd: remove iax_bus_type prototype Remove unused iax_bus_type prototype declaration. Should have been removed when iax_bus_type was removed. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637462909.744545.7106049898386277608.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 3a5cc01647f07431b342e9703cda0542457ec467 Author: Dave Jiang Date: Thu Jul 15 11:43:43 2021 -0700 dmaengine: idxd: remove bus shutdown Remove ->shutdown() function for the dsa bus as it does not do anything and is not necessary. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637462319.744545.10383189484257042066.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 69e4f8be596d897679e44e86a323629537c02975 Author: Dave Jiang Date: Thu Jul 15 11:43:37 2021 -0700 dmaengine: idxd: move wq_disable() to device.c Move the wq_disable() function to device.c in preparation of setting up the idxd internal sub-driver framework. No logic changes. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637461775.744545.9644048686618957886.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 1f2bb40337f0df1d9af80793e9fdacff7706e654 Author: Dave Jiang Date: Thu Jul 15 11:43:31 2021 -0700 dmaengine: idxd: move wq_enable() to device.c Move the wq_enable() function to device.c in preparation of setting up the idxd internal sub-driver framework. No logic changes. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637461176.744545.3806109011554118998.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit f52058ae11523304a337de249c4c07ba5076f288 Author: Dave Jiang Date: Thu Jul 15 11:43:26 2021 -0700 dmaengine: idxd: remove IDXD_DEV_CONF_READY The IDXD_DEV_CONF_READY state flag is no longer needed. The current implementation uses this flag to stop the device from doing configuration until the pci driver probe has completed. With the driver architecture going towards multiple sub-driver attached to the dsa_bus, this is no longer feasible. The sub-drivers will be allowed to probe and return with failure when they are not ready to complete the probe rather than using a state flag to gate the probing. There is no expectation that the devices auto-attach to a driver. Userspace configuration is expected to setup the device before enabling. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637460633.744545.8902095097471365420.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 700af3a0a26cbac87e4a0ae1dfa79597d0056d5f Author: Dave Jiang Date: Thu Jul 15 11:43:20 2021 -0700 dmaengine: idxd: add 'struct idxd_dev' as wrapper for conf_dev Add a 'struct idxd_dev' that wraps the 'struct device' for idxd conf_dev that registers with the dsa bus. This is introduced in order to deal with multiple different types of 'devices' that are registered on the dsa_bus when the compat driver needs to route them to the correct driver to attach. The bind() call now can determine the type of device and then do the appropriate driver matching. Reviewed-by Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637460065.744545.584492831446090984.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit da5a11d75d6837c9c5ef40810f66ce9d2db6ca5e Author: Dave Jiang Date: Thu Jul 15 11:43:15 2021 -0700 dmaengine: idxd: add driver name Add name field in idxd_device_driver so we don't have to touch the 'struct device_driver' during declaration. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637459517.744545.7572915135318813722.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 3ecfc9135e6c82183d121c5578ed5d6f07a53ec8 Author: Dave Jiang Date: Thu Jul 15 11:43:09 2021 -0700 dmaengine: idxd: add driver register helper Add helper functions for dsa-driver registration similar to other bus-types. In particular, do not require dsa-drivers to open-code the bus, owner, and mod_name fields. Let registration and unregistration operate on the 'struct idxd_device_driver' instead of the raw / embedded 'struct device_driver'. Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162637458949.744545.14996726325385482050.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 88c5d0a2b9b043d0e000a4f64a28313e57d96a9c Merge: 49c4959f04b58 6b4b87f2c31ac Author: Vinod Koul Date: Wed Jul 21 09:53:59 2021 +0530 Merge branch 'fixes' into next Signed-off-by: Vinod Koul commit e15f669cd996b85bb07b0e787fa78806477bf211 Author: Jason Yan Date: Fri Jul 16 15:45:51 2021 +0800 scsi: libsas: Allow libsas to include SCSI header files directly libsas needs to include some header files in the scsi directory. However these are currently hardcoded with the path "../" in the C files. Do this in the Makefile to avoid hardcoding the path. Link: https://lore.kernel.org/r/20210716074551.771312-1-yanaijie@huawei.com Cc: John Garry Reviewed-by: John Garry Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 54815088859fa766c7879a06ee028e0cee4f589e Author: Martin K. Petersen Date: Tue Jun 8 23:39:29 2021 -0400 scsi: ufs: core: Use scsi_get_lba() to get LBA Use the scsi_get_lba() helper instead of a function internal to the SCSI disk driver. Remove #include "sd.h". Link: https://lore.kernel.org/r/20210609033929.3815-16-martin.petersen@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-16-martin.petersen@oracle.com> commit d2c945f01d233085fedc9e3cf7ec180eaa2b7a85 Author: Martin K. Petersen Date: Tue Jun 8 23:39:26 2021 -0400 scsi: core: Make scsi_get_lba() return the LBA scsi_get_lba() confusingly returned the block layer sector number expressed in units of 512 bytes. Now that we have a more aptly named scsi_get_sector() function, make scsi_get_lba() return the actual LBA. Link: https://lore.kernel.org/r/20210609033929.3815-13-martin.petersen@oracle.com Reviewed-by: Bart Van Assche Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-13-martin.petersen@oracle.com> commit 87662a472a9d8980b26ba5803447df2c4981d467 Author: Bart Van Assche Date: Tue Jun 8 23:39:25 2021 -0400 scsi: iser: Use scsi_get_sector() instead of scsi_get_lba() Use scsi_get_sector() instead of scsi_get_lba() since the name of the latter is confusing. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210513223757.3938-3-bvanassche@acm.org Link: https://lore.kernel.org/r/20210609033929.3815-12-martin.petersen@oracle.com Reviewed-by: Sagi Grimberg Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-12-martin.petersen@oracle.com> commit f0f214fe8cd32224267ebea93817b8c32074623d Author: Bart Van Assche Date: Tue Jun 8 23:39:24 2021 -0400 scsi: core: Introduce scsi_get_sector() Since scsi_get_lba() returns a sector_t value instead of the LBA, the name of that function is confusing. Introduce an identical function scsi_get_sector(). Link: https://lore.kernel.org/r/20210513223757.3938-2-bvanassche@acm.org Link: https://lore.kernel.org/r/20210609033929.3815-11-martin.petersen@oracle.com Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Benjamin Block Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-11-martin.petersen@oracle.com> commit f7be677227a5375cefd084df2c88864fc673e24a Author: Martin K. Petersen Date: Tue Jun 8 23:39:23 2021 -0400 scsi: scsi_debug: Improve RDPROTECT/WRPROTECT handling It is useful for testing purposes to be able to inject errors by writing bad protection information to media with checking disabled and then attempting to read it back. Extend scsi_debug's PI verification logic to give the driver feature parity with commercially available drives. Almost all devices with PI capability support RDPROTECT and WRPROTECT values of 0, 1, and 3. Link: https://lore.kernel.org/r/20210609033929.3815-10-martin.petersen@oracle.com Reviewed-by: Douglas Gilbert Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-10-martin.petersen@oracle.com> commit c78be80d20cd52c302b92640550087ede9c4304a Author: Martin K. Petersen Date: Tue Jun 8 23:39:22 2021 -0400 scsi: scsi_debug: Remove dump_sector() The function used to dump sectors containing protection information errors was useful during initial development over a decade ago. However, dump_sector() substantially slows down the system during testing due to writing an entire sector's worth of data to syslog on every error. We now log plenty of information about the nature of detected protection information errors throughout the stack. Dumping the entire contents of an offending sector is no longer needed. Link: https://lore.kernel.org/r/20210609033929.3815-9-martin.petersen@oracle.com Reviewed-by: Bart Van Assche Reviewed-by: Douglas Gilbert Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-9-martin.petersen@oracle.com> commit 73e61d5c22bfad25573a5373739ee1be8bb7d63d Author: Martin K. Petersen Date: Tue Jun 8 23:39:20 2021 -0400 scsi: zfcp: Use the proper SCSI midlayer interfaces for PI Use scsi_prot_ref_tag() and scsi_prot_interval() instead scsi_get_lba() and sector_size. Link: https://lore.kernel.org/r/20210609033929.3815-7-martin.petersen@oracle.com Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-7-martin.petersen@oracle.com> commit e2e9cd68fb3c673f7c1e12792f3137b77f6f7431 Author: Martin K. Petersen Date: Tue Jun 8 23:39:17 2021 -0400 scsi: qla2xxx: Use the proper SCSI midlayer interfaces for PI Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags. Link: https://lore.kernel.org/r/20210609033929.3815-4-martin.petersen@oracle.com Reviewed-by: Arun Easi Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-4-martin.petersen@oracle.com> commit 7ba46799d34695534666a3f71a2be10ea85ece6c Author: Martin K. Petersen Date: Tue Jun 8 23:39:15 2021 -0400 scsi: core: Add scsi_prot_ref_tag() helper We are about to remove the request pointer from struct scsi_cmnd and that will complicate getting to the ref_tag via t10_pi_ref_tag() in the various drivers. Introduce a helper function to retrieve the reference tag so drivers will not have to worry about the details. Link: https://lore.kernel.org/r/20210609033929.3815-2-martin.petersen@oracle.com Reviewed-by: Bart Van Assche Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen Message-Id: <20210609033929.3815-2-martin.petersen@oracle.com> commit 588b3eee528873d73bf777f329d35b2e65e24777 Merge: b4d7049acebf9 17a1837d07be3 Author: Dave Airlie Date: Wed Jul 21 11:58:26 2021 +1000 Merge tag 'drm-misc-next-2021-07-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.15: UAPI Changes: Cross-subsystem Changes: - udmabuf: Add support for mapping hugepages - Add dma-buf stats to sysfs. - Assorted fixes to fbdev/omap2. - dma-buf: Document DMA_BUF_IOCTL_SYNC - Improve dma-buf non-dynamic exporter expectations better. - Add module parameters for dma-buf size and list limit. - Add HDMI codec support to vc4, to replace vc4's own codec. - Document dma-buf implicit fencing rules. - dma_resv_test_signaled test_all handling. Core Changes: - Extract i915's eDP backlight code into DRM helpers. - Assorted docbook updates. - Rework drm_dp_aux documentation. - Add support for the DP aux bus. - Shrink dma-fence-chain slightly. - Add alloc/free helpers for dma-fence-chain. - Assorted fixes to TTM., drm/of, bridge - drm_gem_plane_helper_prepare/cleanup_fb is now the default for gem drivers. - Small fix for scheduler completion. - Remove use of drm_device.irq_enabled. - Print the driver name to dmesg when registering framebuffer. - Export drm/gem's shadow plane handling, and use it in vkms. - Assorted small fixes. Driver Changes: - Add eDP backlight to nouveau. - Assorted fixes and cleanups to nouveau, panfrost, vmwgfx, anx7625, amdgpu, gma500, radeon, mgag200, vgem, vc4, vkms, omapdrm. - Add support for Samsung DB7430, Samsung ATNA33XC20, EDT ETMV570G2DHU, EDT ETM0350G0DH6, Innolux EJ030NA panels. - Fix some simple pannels missing bus_format and connector types. - Add mks-guest-stats instrumentation support to vmwgfx. - Merge i915-ttm topic branch. - Make s6e63m0 panel use Mipi-DBI helpers. - Add detect() supoprt for AST. - Use interrupts for hotplug on vc4. - vmwgfx is now moved to drm-misc-next, as sroland is no longer a maintainer for now. - vmwgfx now uses copies of vmware's internal device headers. - Slowly convert ti-sn65dsi83 over to atomic. - Rework amdgpu dma-resv handling. - Fix virtio fencing for planes. - Ensure amdgpu can always evict to SYSTEM. - Many drivers fixed for implicit fencing rules. - Set default prepare/cleanup fb for tiny, vram and simple helpers too. - Rework panfrost gpu reset and related serialization. - Update VKMS todo list. - Make bochs a tiny gpu driver, and use vram helper. - Use linux irq interfaces instead of drm_irq in some drivers. - Add support for Raspberry Pi Pico to GUD. Signed-off-by: Dave Airlie # gpg: Signature made Fri 16 Jul 2021 21:06:04 AEST # gpg: using RSA key B97BD6A80CAC4981091AE547FE558C72A67013C3 # gpg: Good signature from "Maarten Lankhorst " [expired] # gpg: aka "Maarten Lankhorst " [expired] # gpg: aka "Maarten Lankhorst " [expired] # gpg: Note: This key has expired! # Primary key fingerprint: B97B D6A8 0CAC 4981 091A E547 FE55 8C72 A670 13C3 From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/444811c3-cbec-e9d5-9a6b-9632eda7962a@linux.intel.com commit b4d7049acebf959e80d11611cd104bc5360fd13b Merge: 2734d6c1b1a08 cd5606aa39925 Author: Dave Airlie Date: Wed Jul 21 11:46:56 2021 +1000 Merge tag 'drm-intel-next-2021-07-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 changes for v5.15: Features: - Enable pipe DMC loading on XE-LPD and ADL-P (Anusha) - Finally remove JSH and EHL force probe requirement (Tejas) Refactoring and cleanups: - Refactor and fix DDI buffer translations (Ville) - Clean up FBC CFB allocation code (Ville, with a fix from Matthew) - Finish INTEL_GEN() and friends macro conversions (Lucas) - Misc display cleanups (Ville) Fixes: - PSR fixes and ADL-P workarounds (José) - Fix drm infoframe state mismatch (Bhanuprakash) - Force Type-C PHY disconnect during suspend/shutdown (Imre) - Fix power sequence violation on some Chromebook models (Shawn) - Fix VGA workaround to avoid screen flicker at boot (Emil) - Fix display 12+ watermark workaround adjustment (Lucas) Misc: - Backmerge drm-next (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/878s2h6t5o.fsf@intel.com commit 3389d3027fec5ec8f687fb07fd8e6c1bd102b451 Merge: 41667a933c8ad b27b8dc77b5e9 Author: David S. Miller Date: Tue Jul 20 16:57:06 2021 -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 2021-07-20 This series contains updates to e1000e and igc drivers. Sasha adds initial S0ix support for devices with CSME and adds polling for exiting of DPG. He sets the PHY to low power idle when in S0ix. He also adds support for new device IDs for and adds a space to debug messaging to help with readability for e1000e. For igc, he ensures that q_vector array is not accessed beyond its bounds and removes unneeded PHY related checks. Tree Davies corrects a spelling mistake in e1000e. Muhammad corrects the value written when there is no TSN offloading and adjusts timeout value to avoid possible Tx hang for igc. ==================== Signed-off-by: David S. Miller commit 41667a933c8ad141d0ba79d98e5f6458e7e66864 Author: Joakim Zhang Date: Mon Jul 19 15:18:21 2021 +0800 arm64: dts: imx8mp: change interrupt order per dt-binding This patch changs interrupt order which found by dtbs_check. $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml arch/arm64/boot/dts/freescale/imx8mp-evk.dt.yaml: ethernet@30bf0000: interrupt-names:0: 'macirq' was expected arch/arm64/boot/dts/freescale/imx8mp-evk.dt.yaml: ethernet@30bf0000: interrupt-names:1: 'eth_wake_irq' was expected According to Documentation/devicetree/bindings/net/snps,dwmac.yaml, we should list interrupt in it's order. Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 03e85b17030a6516fb76d853d6c74f0181c03180 Author: Joakim Zhang Date: Mon Jul 19 15:18:20 2021 +0800 dt-bindings: net: imx-dwmac: convert imx-dwmac bindings to yaml In order to automate the verification of DT nodes covert imx-dwmac to nxp,dwmac-imx.yaml, and pass below checking. $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit bc71d3ef59b95cae509a1fc3da3162065be0b256 Author: Joakim Zhang Date: Mon Jul 19 15:18:19 2021 +0800 dt-bindings: net: snps,dwmac: add missing DWMAC IP version Add missing DWMAC IP version in snps,dwmac.yaml which found by below command, as NXP i.MX8 families support SNPS DWMAC 5.10a IP. $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml Documentation/devicetree/bindings/net/nxp,dwmac-imx.example.dt.yaml: ethernet@30bf0000: compatible: None of ['nxp,imx8mp-dwmac-eqos', 'snps,dwmac-5.10a'] are valid under the given schema Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 76e50ea054ae2369040494208a4099eee70cc5c3 Author: Manasi Navare Date: Wed Jul 14 15:34:14 2021 -0700 drm/i915/display: Fix shared dpll mismatch for bigjoiner slave Currently when we do the HW state readout, we dont set the shared dpll to NULL for the bigjoiner slave which should not have a DPLL assigned. So it has some garbage while the HW state readout is NULL. So explicitly reset the shared dpll for bigjoiner slave pipe. Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/3465 Cc: Ville Syrjälä Cc: Ankit Nautiyal Tested-by: Swati Sharma Signed-off-by: Manasi Navare Reviewed-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20210714223414.9849-1-manasi.d.navare@intel.com commit 26a4dc29b74a137f45665089f6d3d633fcc9b662 Author: Juan A. Suarez Romero Date: Tue Jun 8 13:15:41 2021 +0200 drm/v3d: Expose performance counters to userspace The V3D engine has several hardware performance counters that can of interest for userspace performance analysis tools. This exposes new ioctls to create and destroy performance monitor objects, as well as to query the counter values. Each created performance monitor object has an ID that can be attached to CL/CSD submissions, so the driver enables the requested counters when the job is submitted, and updates the performance monitor values when the job is done. It is up to the user to ensure all the jobs have been finished before getting the performance monitor values. It is also up to the user to properly synchronize BCL jobs when submitting jobs with different performance monitors attached. Cc: Daniel Vetter Cc: David Airlie Cc: Emma Anholt To: dri-devel@lists.freedesktop.org Signed-off-by: Juan A. Suarez Romero Acked-by: Melissa Wen Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210608111541.461991-1-jasuarez@igalia.com commit 425057e725934b46760b0386b18bb4eb8ee066a7 Author: José Roberto de Souza Date: Fri Jun 25 16:56:00 2021 -0700 drm/i915/display: Disable FBC when PSR2 is enabled display 12 and newer This is now a requirement for all display 12 and newer, not only for tigerlake. BSpec: 50422 Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210625235600.765677-2-jose.souza@intel.com commit 36203e4fb4cb7d65dc471493caf132ebd8d263bb Author: José Roberto de Souza Date: Fri Jun 25 16:55:59 2021 -0700 drm/i915/display/adl_p: Implement PSR changes Implements changes around PSR for alderlake-P: - EDP_SU_TRACK_ENABLE was removed and bit 30 now has other function - Some bits of PSR2_MAN_TRK_CTL moved and SF_PARTIAL_FRAME_UPDATE was removed setting SU_REGION_START/END_ADDR will do this job - SU_REGION_START/END_ADDR have now line granularity but will need to be aligned with DSC when the PSRS + DSC support lands BSpec: 50422 BSpec: 50424 Cc: Gwan-gyeong Mun Cc: Anusha Srivatsa Signed-off-by: José Roberto de Souza Signed-off-by: Gwan-gyeong Mun Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210625235600.765677-1-jose.souza@intel.com commit b27b8dc77b5e9030b2babb2728f61f9bf6260922 Author: Muhammad Husaini Zulkifli Date: Sun Jul 18 00:12:22 2021 +0800 igc: Increase timeout value for Speed 100/1000/2500 As the cycle time is set to maximum of 1s, the TX Hang timeout need to be increase to avoid possible TX Hang. There is no dedicated number specific in data sheet for the timeout factor. Timeout factor was determined during the debugging to solve the "Tx Hang" issues that happen in some cases mainly during ETF(Earliest TxTime First). This can be test by using TSN Schedule Tx Tools udp_tai sample application. Signed-off-by: Muhammad Husaini Zulkifli Acked-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 62f5bbfb2afd5bcec644f16f503d1a3c0f0c7eb5 Author: Muhammad Husaini Zulkifli Date: Sat Jul 10 07:40:17 2021 +0800 igc: Set QBVCYCLET_S to 0 for TSN Basic Scheduling According to datasheet section 8.12.19, when there's no TSN offloading Shadow_QbvCycle bit[29:0] must be set to zero for basic scheduling. Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 47bca7de6a4fb8dcb564c7ca14d885c91ed19e03 Author: Sasha Neftin Date: Sat Jul 10 20:57:50 2021 +0300 igc: Remove phy->type checking i225 devices have only one phy->type: copper. There is no point checking phy->type during the igc_has_link method from the watchdog that invoked every 2 seconds. This patch comes to clean up these pointless checkings. Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 7c496de538eebd8212dc2a3c9a468386b264d0d4 Author: Sasha Neftin Date: Wed Jul 7 08:14:40 2021 +0300 igc: Remove _I_PHY_ID checking i225 devices have only one PHY vendor. There is no point checking _I_PHY_ID during the link establishment and auto-negotiation process. This patch comes to clean up these pointless checkings. Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 373e2829e7c2e1e606503cdb5c97749f512a4be9 Author: Sasha Neftin Date: Mon Jun 14 15:19:39 2021 +0300 igc: Check if num of q_vectors is smaller than max before array access Ensure that the adapter->q_vector[MAX_Q_VECTORS] array isn't accessed beyond its size. It was fixed by using a local variable num_q_vectors as a limit for loop index, and ensure that num_q_vectors is not bigger than MAX_Q_VECTORS. Suggested-by: Aleksandr Loktionov Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit e0bc64d31c98609900ed84b476bfc9d07d7f370f Author: Tree Davies Date: Thu Jun 24 05:06:01 2021 -0700 net/e1000e: Fix spelling mistake "The" -> "This" There is a spelling mistake in the comment block. Signed-off-by: Tree Davies Signed-off-by: Tony Nguyen commit ade4162e80f1f4a555d7d61e71774214220ce79d Author: Sasha Neftin Date: Wed Jun 16 07:19:30 2021 +0300 e1000e: Add space to the debug print Minor fixes to allow debug prints more readable. Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 8e25c0a212de57efc46b8999e6aee9665ba5dccf Author: Sasha Neftin Date: Sat Jun 12 20:02:20 2021 +0300 e1000e: Add support for the next LOM generation Add devices IDs for the next LOM generations that will be available on the next Intel Client platforms This patch provides the initial support for these devices Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 820b8ff653a1a07868cb977461a557aaa09e694c Author: Sasha Neftin Date: Thu Mar 4 09:38:13 2021 +0200 e1000e: Add support for Lunar Lake Add devices IDs for the next LOM generations that will be available on the next Intel Client platform (Lunar Lake) This patch provides the initial support for these devices Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 3ad3e28cb203309fb29022dea41cd65df0583632 Author: Sasha Neftin Date: Thu Jun 24 11:19:08 2021 +0300 e1000e: Additional PHY power saving in S0ix After transferring the MAC-PHY interface to the SMBus set the PHY to S0ix low power idle mode. Suggested-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit ef407b86d3cc7ab7ad37658c1c7a094cb8f3b6b4 Author: Sasha Neftin Date: Thu Jun 24 11:18:46 2021 +0300 e1000e: Add polling mechanism to indicate CSME DPG exit Per guidance from the CSME architecture team, it may take up to 1 second for unconfiguring dynamic power gating mode. Practically it can take more time. Wait up to 2.5 seconds to indicate dynamic power gating exit from the S0ix configuration. Detect scenarios that take more than 1 second but less than 2.5 seconds will emit warning message. Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 3e55d231716ea361b1520b801c6778c4c48de102 Author: Sasha Neftin Date: Thu Jun 24 11:18:27 2021 +0300 e1000e: Add handshake with the CSME to support S0ix On the corporate system, the driver will ask from the CSME (manageability engine) to perform device settings are required to allow S0ix residency. This patch provides initial support. Reviewed-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit f976e8a941763d37cddb365a755b27bbcf5de72e Author: Takashi Iwai Date: Wed Jul 21 00:49:02 2021 +0200 ALSA: sc6000: Use explicit cast for __iomem pointer The recent optimization to store an iomem pointer in card's private_data field caused sparse warnings. Although they are practically harmless, add the explicit cast for avoiding the spurious warnings. Fixes: 9b7843d1e125 ("ALSA: sc6000: Assign vport directly on card's private_data") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202107210511.SnFqlZMa-lkp@intel.com Link: https://lore.kernel.org/r/20210720224902.7169-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit d364a600d6ed9cd78744031a36627d21a6deaefd Author: Takashi Iwai Date: Wed Jul 21 00:28:01 2021 +0200 ALSA: korg1212: Fix wrongly shuffled firmware loader code The recent change for the devres introduced the wrong code shuffling in the korg1212 firmware loader function that may lead to a bad pointer access. Restore the calls in the right order (and put back the release_firmware() call in the error path, too). Fixes: b5cde369b618 ("ALSA: korg1212: Allocate resources with device-managed APIs") Reported-by: Nathan Chancellor Link: https://lore.kernel.org/r/s5heebsoc26.wl-tiwai@suse.de Signed-off-by: Takashi Iwai commit f263a2c2d6c7c44e9256e6a24c9fec668f22ff8b Author: Takashi Iwai Date: Wed Jul 21 00:18:18 2021 +0200 ALSA: als300: Fix missing chip initialization The recent code refactoring missed the initialization of the chip variable as its allocation was moved to card->private_data. Let's fix it. Fixes: 21a9314cf93b ("ALSA: als300: Allocate resources with device-managed APIs") Reported-by: Nathan Chancellor Link: https://lore.kernel.org/r/s5hh7goocid.wl-tiwai@suse.de Signed-off-by: Takashi Iwai commit 35fe7901150d5a4a67b4bab544e926fbbf00ebfe Author: Takashi Iwai Date: Wed Jul 21 00:17:20 2021 +0200 ALSA: cs4281: Fix missing chip initialization The chip variable was forgotten to be initialized properly while changing the object creation from the own malloc to card->private_data. This patch fixes it. Fixes: 99041fea70d0 ("ALSA: cs4281: Allocate resources with device-managed APIs") Reported-by: Nathan Chancellor Link: https://lore.kernel.org/r/s5him14ocjz.wl-tiwai@suse.de Signed-off-by: Takashi Iwai commit a82adfd5c7cb4b8bb37ef439aed954f9972bb618 Author: Kees Cook Date: Mon Apr 12 19:56:54 2021 -0700 hardening: Introduce CONFIG_ZERO_CALL_USED_REGS When CONFIG_ZERO_CALL_USED_REGS is enabled, build the kernel with "-fzero-call-used-regs=used-gpr" (in GCC 11). This option will zero any caller-used register contents just before returning from a function, ensuring that temporary values are not leaked beyond the function boundary. This means that register contents are less likely to be available for side channel attacks and information exposures. Additionally this helps reduce the number of useful ROP gadgets in the kernel image by about 20%: $ ROPgadget.py --nosys --nojop --binary vmlinux.stock | tail -n1 Unique gadgets found: 337245 $ ROPgadget.py --nosys --nojop --binary vmlinux.zero-call-regs | tail -n1 Unique gadgets found: 267175 and more notably removes simple "write-what-where" gadgets: $ ROPgadget.py --ropchain --binary vmlinux.stock | sed -n '/Step 1/,/Step 2/p' - Step 1 -- Write-what-where gadgets [+] Gadget found: 0xffffffff8102d76c mov qword ptr [rsi], rdx ; ret [+] Gadget found: 0xffffffff81000cf5 pop rsi ; ret [+] Gadget found: 0xffffffff8104d7c8 pop rdx ; ret [-] Can't find the 'xor rdx, rdx' gadget. Try with another 'mov [reg], reg' [+] Gadget found: 0xffffffff814c2b4c mov qword ptr [rsi], rdi ; ret [+] Gadget found: 0xffffffff81000cf5 pop rsi ; ret [+] Gadget found: 0xffffffff81001e51 pop rdi ; ret [-] Can't find the 'xor rdi, rdi' gadget. Try with another 'mov [reg], reg' [+] Gadget found: 0xffffffff81540d61 mov qword ptr [rsi], rdi ; pop rbx ; pop rbp ; ret [+] Gadget found: 0xffffffff81000cf5 pop rsi ; ret [+] Gadget found: 0xffffffff81001e51 pop rdi ; ret [-] Can't find the 'xor rdi, rdi' gadget. Try with another 'mov [reg], reg' [+] Gadget found: 0xffffffff8105341e mov qword ptr [rsi], rax ; ret [+] Gadget found: 0xffffffff81000cf5 pop rsi ; ret [+] Gadget found: 0xffffffff81029a11 pop rax ; ret [+] Gadget found: 0xffffffff811f1c3b xor rax, rax ; ret - Step 2 -- Init syscall number gadgets $ ROPgadget.py --ropchain --binary vmlinux.zero* | sed -n '/Step 1/,/Step 2/p' - Step 1 -- Write-what-where gadgets [-] Can't find the 'mov qword ptr [r64], r64' gadget For an x86_64 parallel build tests, this has a less than 1% performance impact, and grows the image size less than 1%: $ size vmlinux.stock vmlinux.zero-call-regs text data bss dec hex filename 22437676 8559152 14127340 45124168 2b08a48 vmlinux.stock 22453184 8563248 14110956 45127388 2b096dc vmlinux.zero-call-regs Impact for other architectures may vary. For example, arm64 sees a 5.5% image size growth, mainly due to needing to always clear x16 and x17: https://lore.kernel.org/lkml/20210510134503.GA88495@C02TD0UTHF1T.local/ Signed-off-by: Kees Cook commit 1846a7fa767fbf8cf42d71daf75d51e30e3c8327 Author: Paul E. McKenney Date: Thu May 13 11:17:02 2021 -0700 tools/memory-model: Make read_foo_diagnostic() more clearly diagnostic The current definition of read_foo_diagnostic() in the "Lock Protection With Lockless Diagnostic Access" section returns a value, which could be use for any purpose. This could mislead people into incorrectly using data_race() in cases where READ_ONCE() is required. This commit therefore makes read_foo_diagnostic() simply print the value read. Reported-by: Manfred Spraul Signed-off-by: Paul E. McKenney commit e04938042d77addc7f41d983aebea125cddbed33 Author: Marco Elver Date: Tue Jun 15 20:39:38 2021 +0200 kcsan: Make strict mode imply interruptible watchers If CONFIG_KCSAN_STRICT=y, select CONFIG_KCSAN_INTERRUPT_WATCHER as well. With interruptible watchers, we'll also report same-CPU data races; if we requested strict mode, we might as well show these, too. Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d8fd74d35a8d3c602232e3238e916bda9d03d520 Author: Marco Elver Date: Mon Jun 7 14:56:53 2021 +0200 kcsan: permissive: Ignore data-racy 1-bit value changes Add rules to ignore data-racy reads with only 1-bit value changes. Details about the rules are captured in comments in kernel/kcsan/permissive.h. More background follows. While investigating a number of data races, we've encountered data-racy accesses on flags variables to be very common. The typical pattern is a reader masking all but one bit, and/or the writer setting/clearing only 1 bit (current->flags being a frequently encountered case; more examples in mm/sl[au]b.c, which disable KCSAN for this reason). Since these types of data-racy accesses are common (with the assumption they are intentional and hard to miscompile) having the option (with CONFIG_KCSAN_PERMISSIVE=y) to filter them will avoid forcing everyone to mark them, and deliberately left to preference at this time. One important motivation for having this option built-in is to move closer to being able to enable KCSAN on CI systems or for testers wishing to test the whole kernel, while more easily filtering less interesting data races with higher probability. For the implementation, we considered several alternatives, but had one major requirement: that the rules be kept together with the Linux-kernel tree. Adding them to the compiler would preclude us from making changes quickly; if the rules require tweaks, having them part of the compiler requires waiting another ~1 year for the next release -- that's not realistic. We are left with the following options: 1. Maintain compiler plugins as part of the kernel-tree that removes instrumentation for some accesses (e.g. plain-& with 1-bit mask). The analysis would be reader-side focused, as no assumption can be made about racing writers. Because it seems unrealistic to maintain 2 plugins, one for LLVM and GCC, we would likely pick LLVM. Furthermore, no kernel infrastructure exists to maintain LLVM plugins, and the build-system implications and maintenance overheads do not look great (historically, plugins written against old LLVM APIs are not guaranteed to work with newer LLVM APIs). 2. Find a set of rules that can be expressed in terms of observed value changes, and make it part of the KCSAN runtime. The analysis is writer-side focused, given we rely on observed value changes. The approach taken here is (2). While a complete approach requires both (1) and (2), experiments show that the majority of data races involving trivial bit operations on flags variables can be removed with (2) alone. It goes without saying that the filtering of data races using (1) or (2) does _not_ guarantee they are safe! Therefore, limiting ourselves to (2) for now is the conservative choice for setups that wish to enable CONFIG_KCSAN_PERMISSIVE=y. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit 9c827cd1fcdf54bb50f874f91af0d5de2aceb035 Author: Marco Elver Date: Mon Jun 7 14:56:52 2021 +0200 kcsan: Print if strict or non-strict during init Show a brief message if KCSAN is strict or non-strict, and if non-strict also say that CONFIG_KCSAN_STRICT=y can be used to see all data races. This is to hint to users of KCSAN who blindly use the default config that their configuration might miss data races of interest. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit 49f72d5358dd3c0d28bcd2232c513000b15480f0 Author: Marco Elver Date: Mon Jun 7 14:56:51 2021 +0200 kcsan: Rework atomic.h into permissive.h Rework atomic.h into permissive.h to better reflect its purpose, and introduce kcsan_ignore_address() and kcsan_ignore_data_race(). Introduce CONFIG_KCSAN_PERMISSIVE and update the stub functions in preparation for subsequent changes. As before, developers who choose to use KCSAN in "strict" mode will see all data races and are not affected. Furthermore, by relying on the value-change filter logic for kcsan_ignore_data_race(), even if the permissive rules are enabled, the opt-outs in report.c:skip_report() override them (such as for RCU-related functions by default). The option CONFIG_KCSAN_PERMISSIVE is disabled by default, so that the documented default behaviour of KCSAN does not change. Instead, like CONFIG_KCSAN_IGNORE_ATOMICS, the option needs to be explicitly opted in. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit 08cac6049412061e571fadadc3e23464dc46d0f2 Author: Marco Elver Date: Mon Jun 7 14:56:50 2021 +0200 kcsan: Reduce get_ctx() uses in kcsan_found_watchpoint() There are a number get_ctx() calls that are close to each other, which results in poor codegen (repeated preempt_count loads). Specifically in kcsan_found_watchpoint() (even though it's a slow-path) it is beneficial to keep the race-window small until the watchpoint has actually been consumed to avoid missed opportunities to report a race. Let's clean it up a bit before we add more code in kcsan_found_watchpoint(). Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit e675d2533a74acfa95c62e7bb088335866f44fd2 Author: Marco Elver Date: Mon Jun 7 14:56:49 2021 +0200 kcsan: Introduce CONFIG_KCSAN_STRICT Add a simpler Kconfig variable to configure KCSAN's "strict" mode. This makes it simpler in documentation or messages to suggest just a single configuration option to select the strictest checking mode (vs. currently having to list several options). Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit a7a73697360ea81244eea550138b8f614348860c Author: Marco Elver Date: Mon Jun 7 14:56:48 2021 +0200 kcsan: Remove CONFIG_KCSAN_DEBUG By this point CONFIG_KCSAN_DEBUG is pretty useless, as the system just isn't usable with it due to spamming console (I imagine a randconfig test robot will run into this sooner or later). Remove it. Back in 2019 I used it occasionally to record traces of watchpoints and verify the encoding is correct, but these days we have proper tests. If something similar is needed in future, just add it back ad-hoc. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit eb32f9f990d974a7878a8792cee9bb821720c24b Author: Marco Elver Date: Mon Jun 7 14:56:47 2021 +0200 kcsan: Improve some Kconfig comments Improve comment for CC_HAS_TSAN_COMPOUND_READ_BEFORE_WRITE. Also shorten the comment above the "strictness" configuration options. Acked-by: Mark Rutland Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 807b8f0e24e6004984094e1bcbbd2b297011a085 Merge: 875fc315dbc3c 720c29fca9fb8 Author: Andrii Nakryiko Date: Tue Jul 20 13:49:25 2021 -0700 Merge branch 'libbpf: btf typed data dumping fixes (__int128 usage, error propagation)' Alan Maguire says: ==================== This series aims to resolve further issues with the BTF typed data dumping interfaces in libbpf. Compilation failures with use of __int128 on 32-bit platforms were reported [1]. As a result, the use of __int128 in libbpf typed data dumping is replaced with __u64 usage for bitfield manipulations. In the case of 128-bit integer values, they are simply split into two 64-bit hex values for display (patch 1). Tests are added for __int128 display in patch 2, using conditional compilation to avoid problems with a lack of __int128 support. Patch 3 resolves an issue Andrii noted about error propagation when handling enum data display. More followup work is required to ensure multi-dimensional char array display works correctly. [1] https://lore.kernel.org/bpf/1626362126-27775-1-git-send-email-alan.maguire@oracle.com/T/#mc2cb023acfd6c3cd0b661e385787b76bb757430d Changes since v1: - added error handling for bitfield size > 64 bits by changing function signature for bitfield retrieval to return an int error value and to set bitfield value via a __u64 * argument (Andrii) ==================== Signed-off-by: Andrii Nakryiko commit 720c29fca9fb87c473148ff666b75314420cdda6 Author: Alan Maguire Date: Tue Jul 20 09:49:53 2021 +0100 libbpf: Propagate errors when retrieving enum value for typed data display When retrieving the enum value associated with typed data during "is data zero?" checking in btf_dump_type_data_check_zero(), the return value of btf_dump_get_enum_value() is not passed to the caller if the function returns a non-zero (error) value. Currently, 0 is returned if the function returns an error. We should instead propagate the error to the caller. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626770993-11073-4-git-send-email-alan.maguire@oracle.com commit a17553dde294289c5f45dd79b6cfd532df610b5f Author: Alan Maguire Date: Tue Jul 20 09:49:52 2021 +0100 selftests/bpf: Add __int128-specific tests for typed data dump Add tests for __int128 display for platforms that support it. __int128s are dumped as hex values. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626770993-11073-3-git-send-email-alan.maguire@oracle.com commit a1d3cc3c5eca598cfabee3a35f30f34fbe2f709b Author: Alan Maguire Date: Tue Jul 20 09:49:51 2021 +0100 libbpf: Avoid use of __int128 in typed dump display __int128 is not supported for some 32-bit platforms (arm and i386). __int128 was used in carrying out computations on bitfields which aid display, but the same calculations could be done with __u64 with the small effect of not supporting 128-bit bitfields. With these changes, a big-endian issue with casting 128-bit integers to 64-bit for enum bitfields is solved also, as we now use 64-bit integers for bitfield calculations. Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626770993-11073-2-git-send-email-alan.maguire@oracle.com commit fae7617bb1428eae812f2cce5bdaa2838d0a9662 Author: Taniya Das Date: Tue Jul 13 20:42:23 2021 +0530 clk: qcom: Add video clock controller driver for SC7280 Add support for the video clock controller found on SC7280 based devices. This would allow video drivers to probe and control their clocks. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-8-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit f1f5a30385631d528ee2d121a456931f7279139d Author: Taniya Das Date: Tue Jul 13 20:42:22 2021 +0530 dt-bindings: clock: Add SC7280 VideoCC clock binding Add device tree bindings for video clock subsystem clock controller for Qualcomm Technology Inc's SC7280 SoCs. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-7-git-send-email-tdas@codeaurora.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 3e0f01d6c7e746c1bcf577c9180775c83780ce5b Author: Taniya Das Date: Tue Jul 13 20:42:21 2021 +0530 clk: qcom: Add graphics clock controller driver for SC7280 Add support for the graphics clock controller found on SC7280 based devices. This would allow graphics drivers to probe and control their clocks. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-6-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 6f1a1ced9ee616fe1e5bdebcfe060d0f03a89336 Author: Taniya Das Date: Tue Jul 13 20:42:20 2021 +0530 dt-bindings: clock: Add SC7280 GPUCC clock binding Add device tree bindings for graphics clock subsystem clock controller for Qualcomm Technology Inc's SC7280 SoCs. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-5-git-send-email-tdas@codeaurora.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 1a00c962f9cd0095a2759225ac25061218e99e78 Author: Taniya Das Date: Tue Jul 13 20:42:19 2021 +0530 clk: qcom: Add display clock controller driver for SC7280 Add support for the display clock controller found on SC7280 based devices. This would allow display drivers to probe and control their clocks. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-4-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit ced3aaead0ba4c1b11eec51adc51465fa56aa5da Author: Taniya Das Date: Tue Jul 13 20:42:18 2021 +0530 dt-bindings: clock: Add SC7280 DISPCC clock binding Add device tree bindings for display clock controller subsystem for Qualcomm Technology Inc's SC7280 SoCs. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-3-git-send-email-tdas@codeaurora.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 8bde9dd381be46728ba731da08eeadc504798546 Author: Taniya Das Date: Tue Jul 13 20:42:17 2021 +0530 dt-bindings: clock: qcom: Update license for GCC SC7280 Update BSD license for GCC clock ids. Fixes: 87a3d523b38c ("dt-bindings: clock: Add SC7280 GCC clock binding") Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1626189143-12957-2-git-send-email-tdas@codeaurora.org Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit a3d794129e34dcd2b9757e0ff44b97429fd369a0 Author: Paul E. McKenney Date: Wed Jul 7 13:42:27 2021 -0700 torture: Put kvm.sh batch-creation awk script into a temp file This commit is a first step towards pinning guest-OS vCPUs so as to force latency differences, especially on multi-socket systems. The kvm.sh script puts its batch-creation awk script into a temporary file so that later commits can add the awk code needed to dole out CPUs so as to maximize latency differences. This awk code will be used by multiple scripts. Signed-off-by: Paul E. McKenney commit d4b54d2d52840bc578b21df4186c5300982236ab Author: Paul E. McKenney Date: Wed Jun 23 17:07:06 2021 -0700 torture: Move parse-console.sh call to PATH-aware scripts The last line of kvm-test-1-run-qemu.sh invokes parse-console.sh, but kvm-test-1-run-qemu.sh is unaware of the PATH containing this script and does not have the job title handy. This commit therefore moves the invocation of parse-console.sh to kvm-test-1-run.sh, which has PATH and title at hand. This commit does not add an invocation of parse-console.sh to kvm-test-1-run-batch.sh because this latter script is run in the background, and the information will be gathered at the end of the full run. Signed-off-by: Paul E. McKenney commit 2ab5bbc326f6fc8fc8acb0e14cfdc1ad23063a00 Author: Paul E. McKenney Date: Wed Jun 23 13:56:11 2021 -0700 torture: Make kvm-recheck.sh skip kcsan.sum for build-only runs Currently, kvm-recheck.sh attempts to create a kcsan.sum file even for build-only runs. This results in false-positive bash errors due to there being no console.log files in that case. This commit therefore makes kvm-recheck.sh skip creating the kcsan.sum file for build-only runs. Signed-off-by: Paul E. McKenney commit 5a2898f183245f72b8b4163e5bce4247e47ff7c5 Author: Paul E. McKenney Date: Thu Jun 17 17:09:39 2021 -0700 torture: Protect kvm-remote.sh directory trees from /tmp reaping The kvm-remote.sh script places the datestamped directory containing all the build artifacts in the destination systems' /tmp directories, where they accumulate runtime artifacts such as console.log. This works, but some systems have a habit of removing files in /tmp that have not been recently accessed. This commit therefore runs a simple script that periodically accesses all files in the datestamped directory. Signed-off-by: Paul E. McKenney commit 442f99afbea1ce7d3c2cf1dc714962eea71fd7ae Author: Paul E. McKenney Date: Tue Jun 15 16:39:52 2021 -0700 torture: Log more kvm-remote.sh information This commit logs additional information to help track down set up and networking issues. Signed-off-by: Paul E. McKenney commit b9b300c64da8d25cd8be6c00a8daf11d76838ba6 Author: Paul E. McKenney Date: Tue Jun 15 16:31:16 2021 -0700 torture: Make kvm-recheck-lock.sh tolerate qemu-cmd comments The qemu-cmd file can contain comments that are not relevant to the operation of kvm-recheck-lock.sh. This commit therefore strips these comments before looking for timing information. Signed-off-by: Paul E. McKenney commit 1dccc5a3272eb7fc215fc30b8e5d6cb5a6c99fac Author: Paul E. McKenney Date: Tue Jun 15 16:16:47 2021 -0700 torture: Make kvm-recheck-scf.sh tolerate qemu-cmd comments The qemu-cmd file can contain comments that are not relevant to the operation of kvm-recheck-scf.sh. This commit therefore strips these comments before looking for timing information. Signed-off-by: Paul E. McKenney commit 433cd5a39495c7ba8aef3fdf28c2e1d38df0b4c5 Author: Paul E. McKenney Date: Thu Jun 3 11:56:35 2021 -0700 torture: Create KCSAN summaries for torture.sh runs Currently, each -kcsan run in a torture.sh group of runs has its own kcsan.sum summary. This works, but there is usually a lot of duplication between the runs. This commit therefore also creates an overall kcsan.sum file for the entire torture.sh run, if there was at least one -kcsan run. Signed-off-by: Paul E. McKenney commit bd0b1f9493b66bc0f734e03806b62cd370d40332 Author: Paul E. McKenney Date: Thu Jun 3 10:45:41 2021 -0700 torture: Enable KCSAN summaries over groups of torture-test runs The kcsan-collapse.sh script assumes that it is being run over the output of a single kvm.sh run, which is less than helpful for torture.sh runs. This commit therefore changes the kcsan-collapse.sh script's "ls" pattern with a "find" command to enable a KCSAN summary across all the -kcsan runs in a full torture.sh run. Signed-off-by: Paul E. McKenney commit 4988486c875f6da5bb4b1d834ce9135ca1b0dee6 Author: Paul E. McKenney Date: Tue May 11 13:27:22 2021 -0700 torture: Make torture.sh accept --do-all and --donone Currently, torture.sh accepts --doall on the one hand and --do-none on the other, which is a bit inconsistent. This commit therefore adds --do-all and --donone so that a fully consistent test may be used. Signed-off-by: Paul E. McKenney commit ef4dac7dbde7ba376e340f665196988409913625 Author: Paul E. McKenney Date: Mon May 10 12:30:49 2021 -0700 torture: Add clocksource-watchdog testing to torture.sh This commit adds three short tests of the clocksource-watchdog capability to the torture.sh script, all to avoid otherwise-inevitable bitrot. While in the area, fix an obsolete comment. Signed-off-by: Paul E. McKenney commit fed31a4dd3adb5455df7c704de2abb639a1dc1c0 Author: Zhouyi Zhou Date: Tue Jul 13 08:56:45 2021 +0800 rcu: Fix macro name CONFIG_TASKS_RCU_TRACE This commit fixes several typos where CONFIG_TASKS_RCU_TRACE should instead be CONFIG_TASKS_TRACE_RCU. Among other things, these typos could cause CONFIG_TASKS_TRACE_RCU_READ_MB=y kernels to suffer from memory-ordering bugs that could result in false-positive quiescent states and too-short grace periods. Signed-off-by: Zhouyi Zhou Signed-off-by: Paul E. McKenney commit e4be1f44b6f8d36a8607a598d41c766044b74be3 Author: Paul E. McKenney Date: Tue Jun 22 11:57:15 2021 -0700 rcu-tasks: Fix synchronize_rcu_rude() typo in comment This commit replaces the fictitious synchronize_rcu_rude() function with its real-world synchronize_rcu_tasks_rude() counterpart. Signed-off-by: Paul E. McKenney commit f8ab3fad80dddf3f2cecb53983063c4431058ca1 Author: Paul E. McKenney Date: Mon May 24 15:36:37 2021 -0700 rcu-tasks: Mark ->trc_reader_special.b.need_qs data races There are several ->trc_reader_special.b.need_qs data races that are too low-probability for KCSAN to notice, but which will happen sooner or later. This commit therefore marks these accesses. Signed-off-by: Paul E. McKenney commit bdb0cca0d11060fce8a8a44588ac1470c25d62bc Author: Paul E. McKenney Date: Mon May 24 12:48:18 2021 -0700 rcu-tasks: Mark ->trc_reader_nesting data races There are several ->trc_reader_nesting data races that are too low-probability for KCSAN to notice, but which will happen sooner or later. This commit therefore marks these accesses, and comments one that cannot race. Signed-off-by: Paul E. McKenney commit 45f4b4a202c03de14e315aaae3d305820cd12221 Author: Paul E. McKenney Date: Mon May 24 11:26:53 2021 -0700 rcu-tasks: Add comments explaining task_struct strategy Accesses to task_struct structures must be either protected by RCU or by get_task_struct(). Tasks trace RCU uses these in a non-obvious combination, in conjunction with an IPI handler. This commit therefore adds comments explaining this usage. Signed-off-by: Paul E. McKenney commit 875fc315dbc3cdd3a5cab57b2bb7c1976ec8df44 Author: Vincent Li Date: Mon Jul 19 15:30:22 2021 -0700 selftests, bpf: test_tc_tunnel.sh nc: Cannot use -p and -l When run test_tc_tunnel.sh, it complains following error ipip encap 192.168.1.1 to 192.168.1.2, type ipip, mac none len 100 test basic connectivity nc: cannot use -p and -l nc man page has: -l Listen for an incoming connection rather than initiating a connection to a remote host.Cannot be used together with any of the options -psxz. Additionally, any timeouts specified with the -w option are ignored. Correct nc in server_listen(). Signed-off-by: Vincent Li Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210719223022.66681-1-vincent.mc.li@gmail.com commit f916d77eedfeb3efbbcd4b209601671ec1b417f2 Author: Mark Brown Date: Thu Jun 24 08:53:14 2021 +0200 tools/nolibc: Implement msleep() Allow users to implement shorter delays than a full second by implementing msleep(). Signed-off-by: Mark Brown Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 9a83f9aea7bf2d831a1b3ad4cc46a3e23319894a Author: Bhaskar Chowdhury Date: Thu Jun 24 08:53:13 2021 +0200 tools: include: nolibc: Fix a typo occured to occurred in the file nolibc.h s/occured/occurred/ Signed-off-by: Bhaskar Chowdhury Acked-by: Randy Dunlap Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit cba712beebf32b27fea71241aa3cdd2ab0fc31a3 Author: Frederic Weisbecker Date: Wed May 19 02:09:29 2021 +0200 rcu/nocb: Remove NOCB deferred wakeup from rcutree_dead_cpu() At CPU offline time, we must handle any pending wakeup for the nocb_gp kthread linked to the outgoing CPU. Now we are making sure of that twice: 1) From rcu_report_dead() when the outgoing CPU makes the very last local cleanups by itself before switching offline. 2) From rcutree_dead_cpu(). Here the offlining CPU has gone and is truly now offline. Another CPU takes care of post-portem cleaning up and check if the offline CPU had pending wakeup. Both ways are fine but we have to choose one or the other because we don't need to repeat that action. Simply benefit from cache locality and keep only the first solution. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit dfcb27540213e8061ecffacd4bd8ed54a310a7b0 Author: Frederic Weisbecker Date: Wed May 19 02:09:28 2021 +0200 rcu/nocb: Start moving nocb code to its own plugin file The kernel/rcu/tree_plugin.h file contains not only the plugins for preemptible RCU, but also many other features including rcu_nocbs callback offloading. This offloading has become large and complex, so it is time to put it in its own file. This commit starts that process. Suggested-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker [ paulmck: Rename to tree_nocb.h, add Frederic as author. ] Signed-off-by: Paul E. McKenney commit 99c0974ffeeab111bc709fc77b6900593e2e9078 Author: Paul E. McKenney Date: Wed Jul 14 11:46:55 2021 -0700 doc: Update stallwarn.rst with recent changes This commit calls out the possibility of self-detected stalls, adds new messages, and calls out the use for stack traces. Reported-by: Jeff Layton Signed-off-by: Paul E. McKenney commit c28adacc14e70e3260063e97ebb8dd984e6f7a07 Author: Frederic Weisbecker Date: Thu Jun 10 17:50:29 2021 +0200 rcu/doc: Add a quick quiz to explain further why we need smp_mb__after_unlock_lock() Add some missing critical pieces of explanation to understand the need for full memory barriers throughout the whole grace period state machine, thanks to Paul's explanations. Signed-off-by: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Joel Fernandes Cc: Uladzislau Rezki Cc: Boqun Feng [ paulmck: Adjust code block per Akira Yokosawa. ] Signed-off-by: Paul E. McKenney commit 9984fd7e5e2f16cf867dba43ab9a4d123b91d3d3 Author: Haocheng Xie Date: Tue May 25 17:31:52 2021 +0800 docs: Fix a typo in Documentation/RCU/stallwarn.rst Add the missing ')' in the documentation. Signed-off-by: Haocheng Xie Signed-off-by: Paul E. McKenney commit 4966090849e96f4db1e115b77d2cfb68c2f73264 Author: Akira Yokosawa Date: Fri May 21 11:16:04 2021 +0900 Documentation/RCU: Fix nested inline markup To avoid the ``foo`` markup inside the `bar`__ hyperlink marker, use the "replace" directive [1]. This should restore the intended appearance of the link. Tested with sphinx versions 1.7.9 and 2.4.4. [1]: https://docutils.sourceforge.io/docs/ref/rst/directives.html#replace Signed-off-by: Akira Yokosawa Signed-off-by: Paul E. McKenney commit e3879ecd366a8ccc0ad7e36bf62692c16db360a1 Author: Akira Yokosawa Date: Thu May 20 13:32:36 2021 +0900 Documentation/RCU: Fix emphasis markers "-foo-" does not work as emphasis in ReST markdown. Use "*foo*" instead. Signed-off-by: Akira Yokosawa Signed-off-by: Paul E. McKenney commit c39aa21599748f3845a47645f482d94099b11460 Author: John Fastabend Date: Tue Jul 20 11:48:32 2021 -0700 bpf, selftests: Fix test_maps now that sockmap supports UDP UDP socket support was added recently so testing UDP insert failure is no longer correct and causes test_maps failure. The fix is easy though, we simply need to test that UDP is correctly added instead of blocked. Fixes: 122e6c79efe1c ("sock_map: Update sock type checks for UDP") Reported-by: Andrii Nakryiko Signed-off-by: John Fastabend Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20210720184832.452430-1-john.fastabend@gmail.com commit 56f0729a510f92151682ff6c89f69724d5595d6e Author: Desmond Cheong Zhi Xi Date: Mon Jul 12 12:35:08 2021 +0800 drm: protect drm_master pointers in drm_lease.c drm_file->master pointers should be protected by drm_device.master_mutex or drm_file.master_lookup_lock when being dereferenced. However, in drm_lease.c, there are multiple instances where drm_file->master is accessed and dereferenced while neither lock is held. This makes drm_lease.c vulnerable to use-after-free bugs. We address this issue in 2 ways: 1. Add a new drm_file_get_master() function that calls drm_master_get on drm_file->master while holding on to drm_file.master_lookup_lock. Since drm_master_get increments the reference count of master, this prevents master from being freed until we unreference it with drm_master_put. 2. In each case where drm_file->master is directly accessed and eventually dereferenced in drm_lease.c, we wrap the access in a call to the new drm_file_get_master function, then unreference the master pointer once we are done using it. Reported-by: Daniel Vetter Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210712043508.11584-6-desmondcheongzx@gmail.com commit 0b0860a3cf5eccf183760b1177a1dcdb821b0b66 Author: Desmond Cheong Zhi Xi Date: Mon Jul 12 12:35:07 2021 +0800 drm: serialize drm_file.master with a new spinlock Currently, drm_file.master pointers should be protected by drm_device.master_mutex when being dereferenced. This is because drm_file.master is not invariant for the lifetime of drm_file. If drm_file is not the creator of master, then drm_file.is_master is false, and a call to drm_setmaster_ioctl will invoke drm_new_set_master, which then allocates a new master for drm_file and puts the old master. Thus, without holding drm_device.master_mutex, the old value of drm_file.master could be freed while it is being used by another concurrent process. However, it is not always possible to lock drm_device.master_mutex to dereference drm_file.master. Through the fbdev emulation code, this might occur in a deep nest of other locks. But drm_device.master_mutex is also the outermost lock in the nesting hierarchy, so this leads to potential deadlocks. To address this, we introduce a new spin lock at the bottom of the lock hierarchy that only serializes drm_file.master. With this change, the value of drm_file.master changes only when both drm_device.master_mutex and drm_file.master_lookup_lock are held. Hence, any process holding either of those locks can ensure that the value of drm_file.master will not change concurrently. Since no lock depends on the new drm_file.master_lookup_lock, when drm_file.master is dereferenced, but drm_device.master_mutex cannot be held, we can safely protect the master pointer with drm_file.master_lookup_lock. Reported-by: Daniel Vetter Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210712043508.11584-5-desmondcheongzx@gmail.com commit 1f7ef07cfa14fb8557d1f1b7a14c76926142a4fb Author: Desmond Cheong Zhi Xi Date: Mon Jul 12 12:35:06 2021 +0800 drm: add a locked version of drm_is_current_master While checking the master status of the DRM file in drm_is_current_master(), the device's master mutex should be held. Without the mutex, the pointer fpriv->master may be freed concurrently by another process calling drm_setmaster_ioctl(). This could lead to use-after-free errors when the pointer is subsequently dereferenced in drm_lease_owner(). The callers of drm_is_current_master() from drm_auth.c hold the device's master mutex, but external callers do not. Hence, we implement drm_is_current_master_locked() to be used within drm_auth.c, and modify drm_is_current_master() to grab the device's master mutex before checking the master status. Reported-by: Daniel Vetter Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210712043508.11584-4-desmondcheongzx@gmail.com commit 5eff9585de220cdd131237f5665db5e6c6bdf590 Author: Desmond Cheong Zhi Xi Date: Mon Jul 12 12:35:05 2021 +0800 drm: avoid blocking in drm_clients_info's rcu section Inside drm_clients_info, the rcu_read_lock is held to lock pid_task()->comm. However, within this protected section, a call to drm_is_current_master is made, which involves a mutex lock in a future patch. However, this is illegal because the mutex lock might block while in the RCU read-side critical section. Since drm_is_current_master isn't protected by rcu_read_lock, we avoid this by moving it out of the RCU critical section. The following report came from intel-gfx ci's igt@debugfs_test@read_all_entries testcase: ============================= [ BUG: Invalid wait context ] 5.13.0-CI-Patchwork_20515+ #1 Tainted: G W ----------------------------- debugfs_test/1101 is trying to lock: ffff888132d901a8 (&dev->master_mutex){+.+.}-{3:3}, at: drm_is_current_master+0x1e/0x50 other info that might help us debug this: context-{4:4} 3 locks held by debugfs_test/1101: #0: ffff88810fdffc90 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0x53/0x3b0 #1: ffff888132d90240 (&dev->filelist_mutex){+.+.}-{3:3}, at: drm_clients_info+0x63/0x2a0 #2: ffffffff82734220 (rcu_read_lock){....}-{1:2}, at: drm_clients_info+0x1b1/0x2a0 stack backtrace: CPU: 8 PID: 1101 Comm: debugfs_test Tainted: G W 5.13.0-CI-Patchwork_20515+ #1 Hardware name: Intel Corporation CometLake Client Platform/CometLake S UDIMM (ERB/CRB), BIOS CMLSFWR1.R00.1263.D00.1906260926 06/26/2019 Call Trace: dump_stack+0x7f/0xad __lock_acquire.cold.78+0x2af/0x2ca lock_acquire+0xd3/0x300 ? drm_is_current_master+0x1e/0x50 ? __mutex_lock+0x76/0x970 ? lockdep_hardirqs_on+0xbf/0x130 __mutex_lock+0xab/0x970 ? drm_is_current_master+0x1e/0x50 ? drm_is_current_master+0x1e/0x50 ? drm_is_current_master+0x1e/0x50 drm_is_current_master+0x1e/0x50 drm_clients_info+0x107/0x2a0 seq_read_iter+0x178/0x3b0 seq_read+0x104/0x150 full_proxy_read+0x4e/0x80 vfs_read+0xa5/0x1b0 ksys_read+0x5a/0xd0 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae Signed-off-by: Desmond Cheong Zhi Xi Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210712043508.11584-3-desmondcheongzx@gmail.com commit 869e76f7a918f010bd4518d58886969b1f642a04 Author: Desmond Cheong Zhi Xi Date: Mon Jul 12 12:35:04 2021 +0800 drm: avoid circular locks in drm_mode_getconnector In preparation for a future patch to take a lock on drm_device.master_mutex inside drm_is_current_master(), we first move the call to drm_is_current_master() in drm_mode_getconnector out from the section locked by &dev->mode_config.mutex. This avoids creating a circular lock dependency. Failing to avoid this lock dependency produces the following lockdep splat: ====================================================== WARNING: possible circular locking dependency detected 5.13.0-rc7-CI-CI_DRM_10254+ #1 Not tainted ------------------------------------------------------ kms_frontbuffer/1087 is trying to acquire lock: ffff88810dcd01a8 (&dev->master_mutex){+.+.}-{3:3}, at: drm_is_current_master+0x1b/0x40 but task is already holding lock: ffff88810dcd0488 (&dev->mode_config.mutex){+.+.}-{3:3}, at: drm_mode_getconnector+0x1c6/0x4a0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&dev->mode_config.mutex){+.+.}-{3:3}: __mutex_lock+0xab/0x970 drm_client_modeset_probe+0x22e/0xca0 __drm_fb_helper_initial_config_and_unlock+0x42/0x540 intel_fbdev_initial_config+0xf/0x20 [i915] async_run_entry_fn+0x28/0x130 process_one_work+0x26d/0x5c0 worker_thread+0x37/0x380 kthread+0x144/0x170 ret_from_fork+0x1f/0x30 -> #1 (&client->modeset_mutex){+.+.}-{3:3}: __mutex_lock+0xab/0x970 drm_client_modeset_commit_locked+0x1c/0x180 drm_client_modeset_commit+0x1c/0x40 __drm_fb_helper_restore_fbdev_mode_unlocked+0x88/0xb0 drm_fb_helper_set_par+0x34/0x40 intel_fbdev_set_par+0x11/0x40 [i915] fbcon_init+0x270/0x4f0 visual_init+0xc6/0x130 do_bind_con_driver+0x1e5/0x2d0 do_take_over_console+0x10e/0x180 do_fbcon_takeover+0x53/0xb0 register_framebuffer+0x22d/0x310 __drm_fb_helper_initial_config_and_unlock+0x36c/0x540 intel_fbdev_initial_config+0xf/0x20 [i915] async_run_entry_fn+0x28/0x130 process_one_work+0x26d/0x5c0 worker_thread+0x37/0x380 kthread+0x144/0x170 ret_from_fork+0x1f/0x30 -> #0 (&dev->master_mutex){+.+.}-{3:3}: __lock_acquire+0x151e/0x2590 lock_acquire+0xd1/0x3d0 __mutex_lock+0xab/0x970 drm_is_current_master+0x1b/0x40 drm_mode_getconnector+0x37e/0x4a0 drm_ioctl_kernel+0xa8/0xf0 drm_ioctl+0x1e8/0x390 __x64_sys_ioctl+0x6a/0xa0 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: &dev->master_mutex --> &client->modeset_mutex --> &dev->mode_config.mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&dev->mode_config.mutex); lock(&client->modeset_mutex); lock(&dev->mode_config.mutex); lock(&dev->master_mutex); *** DEADLOCK *** 1 lock held by kms_frontbuffer/1087: #0: ffff88810dcd0488 (&dev->mode_config.mutex){+.+.}-{3:3}, at: drm_mode_getconnector+0x1c6/0x4a0 stack backtrace: CPU: 7 PID: 1087 Comm: kms_frontbuffer Not tainted 5.13.0-rc7-CI-CI_DRM_10254+ #1 Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP TLC, BIOS ICLSFWR1.R00.3234.A01.1906141750 06/14/2019 Call Trace: dump_stack+0x7f/0xad check_noncircular+0x12e/0x150 __lock_acquire+0x151e/0x2590 lock_acquire+0xd1/0x3d0 __mutex_lock+0xab/0x970 drm_is_current_master+0x1b/0x40 drm_mode_getconnector+0x37e/0x4a0 drm_ioctl_kernel+0xa8/0xf0 drm_ioctl+0x1e8/0x390 __x64_sys_ioctl+0x6a/0xa0 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae Reported-by: Daniel Vetter Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210712043508.11584-2-desmondcheongzx@gmail.com commit 07d0f314ba75cba17c3fad0a3d4e640e757897d7 Merge: 923232bbea88a 11656f593a869 Author: Jason Gunthorpe Date: Tue Jul 20 15:11:38 2021 -0300 Merge branch 'mlx5_dcs' into rdma.git for-next Leon Romanovsky says: ==================== Add ConnectX DCS offload support This patchset from Lior adds support of DCI stream channel (DCS) support. DCS is an offload to SW load balancing of DC initiator work requests. A single DC QP initiator (DCI) can be connected to only one target at the time and can't start new connection until the previous work request is completed. This limitation causes to delays when the initiator process needs to transfer data to multiple targets at the same time. ==================== * branch 'mlx5_dcs': RDMA/mlx5: Add DCS offload support RDMA/mlx5: Separate DCI QP creation logic net/mlx5: Add DCS caps & fields support commit 11656f593a869a4345e3421037614d2b75ae2ad3 Author: Lior Nahmanson Date: Mon Jun 21 10:06:16 2021 +0300 RDMA/mlx5: Add DCS offload support DCS is an offload to SW load balancing of DC initiator work requests. A single DCI can be connected to only one target at the time and can't start new connection until the previous work request is completed. This limitation will cause to delay when the initiator process needs to transfer data to multiple targets at the same time. The SW solution is to use a process that handling and spreading the work request on many DCIs according to destinations. This feature is an offload to this process and coming to reduce the load from the CPU and improve the performance. Link: https://lore.kernel.org/r/491c2c2afdb5b07de7f03eab3f93cf0704549dbc.1624258894.git.leonro@nvidia.com Reviewed-by: Meir Lichtinger Signed-off-by: Lior Nahmanson Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2013b4d525273e8ce6a6ff6518a4df3f8a8250cb Author: Lior Nahmanson Date: Mon Jun 21 10:06:15 2021 +0300 RDMA/mlx5: Separate DCI QP creation logic This patch isolates DCI QP creation logic to separate function, so this change will reduce complexity when adding new features to DCI QP without interfering with other QP types. The code was copied from create_user_qp() while taking only DCI relevant bits. Link: https://lore.kernel.org/r/b4530bdd999349c59691224f016ff1efb5dc3b92.1624258894.git.leonro@nvidia.com Reviewed-by: Meir Lichtinger Signed-off-by: Lior Nahmanson Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 49c4959f04b587c8909b33adca4066995c768d60 Author: Dave Jiang Date: Wed Jul 14 14:57:19 2021 -0700 dmaengine: idxd: fix sequence for pci driver remove() and shutdown() ->shutdown() call should only be responsible for quiescing the device. Currently it is doing PCI device tear down. This causes issue when things like MMIO mapping is removed while idxd_unregister_devices() will trigger removal of idxd device sub-driver and still initiates MMIO writes to the device. Another issue is with the unregistering of idxd 'struct device', the memory context gets freed. So the teardown calls are accessing freed memory and can cause kernel oops. Move all the teardown bits that doesn't belong in shutdown to ->remove() call. Move unregistering of the idxd conf_dev 'struct device' to after doing all the teardown to free all the memory that's no longer needed. Fixes: 47c16ac27d4c ("dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162629983901.395844.17964803190905549615.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit bfc3cac0c76126995737f1b858d2cdb476be5b1d Author: Austin Kim Date: Tue Jun 29 14:41:44 2021 +0100 smack: mark 'smack_enabled' global variable as __initdata Mark 'smack_enabled' as __initdata since it is only used during initialization code. Signed-off-by: Austin Kim Signed-off-by: Casey Schaufler commit 9b7843d1e125dca0d6ed0af9e8dd709d41eb25ad Author: Takashi Iwai Date: Tue Jul 20 18:28:37 2021 +0200 ALSA: sc6000: Assign vport directly on card's private_data sc6000 driver tries to allocate an extra pointer for keeping the vport address and point it over card->private_data. But, this indirect access is utterly superfluous, and we can keep the vport address directly in card->private_data instead. This will simply the code and avoid confusion. Link: https://lore.kernel.org/r/20210720162837.6026-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit dca18a94d3ad94201183f64d89149553c9cec95d Author: Colin Ian King Date: Tue Jul 20 17:17:07 2021 +0100 ALSA: sc6000: Fix incorrect sizeof operator Static analysis is warning that the sizeof being used is should be of *vport and not vport. Although these are the same size it is not a portable assumption to assume this is true for all cases. Fix this by using sizeof(*vport). Addresses-Coverity: ("Sizeof not portable") Fixes: 111601ff76e9 ("ALSA: sc6000: Allocate resources with device-managed APIs") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210720161707.74197-1-colin.king@canonical.com Signed-off-by: Takashi Iwai commit e1ca90b7cc5cb5d3a38321cbb65ad36a59fcb574 Author: Naveen Krishna Chatradhi Date: Wed Jun 30 20:58:24 2021 +0530 EDAC/mc: Add new HBM2 memory type Add a new entry to 'enum mem_type' and a new string to 'edac_mem_types[]' for HBM2 (High Bandwidth Memory Gen 2) new memory type. Reviewed-by: Yazen Ghannam Signed-off-by: Muralidhara M K Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210630152828.162659-4-nchatrad@amd.com commit 6d14f5c7028eea70760df284057fe198ce7778dd Author: Tianjia Zhang Date: Thu Jul 15 17:17:24 2021 +0800 Smack: Fix wrong semantics in smk_access_entry() In the smk_access_entry() function, if no matching rule is found in the rust_list, a negative error code will be used to perform bit operations with the MAY_ enumeration value. This is semantically wrong. This patch fixes this issue. Signed-off-by: Tianjia Zhang Signed-off-by: Casey Schaufler commit e24ef4881bdd11c13d35235a410571c0d0aa0e5d Author: Colin Ian King Date: Tue Jul 20 16:37:41 2021 +0100 ALSA: opti9xx: fix missing { } around an if block Currently the { } braces are missing around an if block causing subsequent code after the return to become unreachable. Fix this by adding the missing { }. Addresses-Coverity: ("Structurally dead code") Fixes: 2973ee4a5b54 ("ALSA: opti9xx: Allocate resources with device-managed APIs") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210720153741.73230-1-colin.king@canonical.com Signed-off-by: Takashi Iwai commit 32979fcf5ab5df9359b98796886c5356b9cf4298 Author: Andy Shevchenko Date: Thu Jun 3 19:51:28 2021 +0300 mfd: intel-lpss: Add Intel Cannon Lake ACPI IDs Some of the machines, like Dell Precision 3630, may expose LPSS devices via ACPI. Add their IDs to the list. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones commit ef0eea5b151aefe1efea78e2fa7c507ff3c56bf0 Author: Chris Blake Date: Mon Jun 7 18:35:35 2021 -0500 mfd: lpc_ich: Enable GPIO driver for DH89xxCC Based on the Intel Datasheet for the DH89xxCC PCH, the GPIO driver is the same as ICH_v5_GPIO, minus the fact the DH89xxCC also has blink support. However, blink support isn't supported by the GPIO driver so we should use ICH_v5_GPIO. Tested and working on a Meraki MX100-HW. Signed-off-by: Chris Blake Co-developed-by: Christian Lamparter Signed-off-by: Lee Jones commit 8887ca5474bd9ddb56cabc88856bb035774e0041 Author: Russell King Date: Tue Jul 20 14:33:49 2021 +0100 net: phy: at803x: simplify custom phy id matching The at803x driver contains a function, at803x_match_phy_id(), which tests whether the PHY ID matches the value passed, comparing phy_id with phydev->phy_id and testing all bits that in the driver's mask. This is the same test that is used to match the driver, with phy_id replaced with the driver specified ID, phydev->drv->phy_id. Hence, we already know the value of the bits being tested if we look at phydev->drv->phy_id directly, and we do not require a complicated test to check them. Test directly against phydev->drv->phy_id instead. Signed-off-by: Russell King Reviewed-by: Fabio Estevam Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit fa660684e5319a5c37deaf4a329d8026b52d64e7 Author: Colin Ian King Date: Tue Jul 20 14:03:11 2021 +0100 net: marvell: clean up trigraph warning on ??! string The character sequence ??! is a trigraph and causes the following clang warning: drivers/net/ethernet/marvell/mvneta.c:2604:39: warning: trigraph ignored [-Wtrigraphs] Clean this by replacing it with single ?. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit d43b239314d1f0e1cda1ed28157fe1646e531465 Author: Colin Ian King Date: Tue Jul 20 13:48:13 2021 +0100 atm: idt77252: clean up trigraph warning on ??) string The character sequence ??) is a trigraph and causes the following clang warning: drivers/atm/idt77252.c:3544:35: warning: trigraph ignored [-Wtrigraphs] Clean this by replacing it with single ?. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit be393dd685d215d44a43f5c5dcb8f7e57668d00e Author: Martin Schiller Date: Tue Jul 20 13:56:47 2021 +0200 net: phy: intel-xway: Add RGMII internal delay configuration This adds the possibility to configure the RGMII RX/TX clock skew via devicetree. Simply set phy mode to "rgmii-id", "rgmii-rxid" or "rgmii-txid" and add the "rx-internal-delay-ps" or "tx-internal-delay-ps" property to the devicetree. Furthermore, a warning is now issued if the phy mode is configured to "rgmii" and an internal delay is set in the phy (e.g. by pin-strapping), as in the dp83867 driver. Signed-off-by: Martin Schiller Signed-off-by: David S. Miller commit d34869b44a174bf5cde5a45ab5a1eacc72741b49 Author: Russell King (Oracle) Date: Tue Jul 20 12:15:20 2021 +0100 net: phylink: add phy change pause mode debug Augment the phy link debug prints with the pause state. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 635a85ac7349dc40aa7132adaa87d4211760ea08 Author: Russell King (Oracle) Date: Tue Jul 20 10:57:53 2021 +0100 net: mvpp2: deny disabling autoneg for 802.3z modes The documentation for Armada 8040 says: Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ... When = 1 (1000BASE-X) this field must be set to 1. We presently ignore whether userspace requests autonegotiation or not through the ethtool ksettings interface. However, we have some network interfaces that wish to do this. To offer a consistent API across network interfaces, deny the ability to disable autonegotiation on mvpp2 hardware when in 1000BASE-X and 2500BASE-X. This means the only way to switch between 2500BASE-X and 1000BASE-X on SFPs that support this will be: # ethtool -s ethX advertise 0x20000006000 # 1000BASE-X Pause AsymPause # ethtool -s ethX advertise 0xe000 # 2500BASE-X Pause AsymPause Signed-off-by: Russell King (Oracle) Acked-by: Marek Behún Acked-by: Marcin Wojtas Signed-off-by: David S. Miller commit c762b7fac1b249a9ce355fc5aa326442178a978d Author: Russell King (Oracle) Date: Tue Jul 20 10:57:48 2021 +0100 net: mvneta: deny disabling autoneg for 802.3z modes The documentation for Armada 38x says: Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ... When = 1 (1000BASE-X) this field must be set to 1. We presently ignore whether userspace requests autonegotiation or not through the ethtool ksettings interface. However, we have some network interfaces that wish to do this. To offer a consistent API across network interfaces, deny the ability to disable autonegotiation on mvneta hardware when in 1000BASE-X and 2500BASE-X. This means the only way to switch between 2500BASE-X and 1000BASE-X on SFPs that support this will be: # ethtool -s ethX advertise 0x20000002000 # 1000BASE-X Pause # ethtool -s ethX advertise 0xa000 # 2500BASE-X Pause Signed-off-by: Russell King (Oracle) Acked-by: Marek Behún Signed-off-by: David S. Miller commit 8292d7f6e8712381a828eac2a19a610ce680c4dd Author: Yang Yang Date: Mon Jul 19 18:43:28 2021 -0700 net: ipv4: add capability check for net administration Root in init user namespace can modify /proc/sys/net/ipv4/ip_forward without CAP_NET_ADMIN, this doesn't follow the principle of capabilities. For example, let's take a look at netdev_store(), root can't modify netdev attribute without CAP_NET_ADMIN. So let's keep the consistency of permission check logic. Reported-by: Zeal Robot Signed-off-by: Yang Yang Signed-off-by: David S. Miller commit f8fdadef92b7a39e9a9a83bc2df68731ac6c298b Author: Corey Minyard Date: Fri Jul 16 15:28:46 2021 -0500 ipsec: Remove unneeded extra variable in esp4 esp_ssg_unref() It's assigned twice, but only used to calculate the size of the structure it points to. Just remove it and take a sizeof the actual structure. Signed-off-by: Corey Minyard Cc: Steffen Klassert Cc: Herbert Xu Cc: "David S. Miller" Cc: netdev@vger.kernel.org Signed-off-by: Steffen Klassert commit b79c6fba6cd7c49a7dbea9999e182f74cca63e19 Merge: 0ac2627134447 fd0f72c34bd96 Author: David S. Miller Date: Tue Jul 20 07:10:49 2021 -0700 Merge branch 'qcom-dts-updates' Alex Elder says: ==================== arm64: dts: qcom: DTS updates This series updates some IPA-related DT nodes. Newer versions of IPA do not require an interconnect between IPA and SoC internal memory. The first patch updates the DT binding to reflect this. The second patch adds IPA information to "sc7280.dtsi", using only two interconnects. It includes the definition of the reserved memory area used to hold IPA firmware. The last patch defines the reserved IPA firmware memory area in "sc7180.dtsi". ==================== Signed-off-by: David S. Miller commit fd0f72c34bd96a1138b89585ce6bfcd9617ea81e Author: Alex Elder Date: Mon Jul 19 16:24:56 2021 -0500 arm64: dts: qcom: sc7180: define ipa_fw_mem node Define the reserved memory space used for IPA firmware for the Qualcomm SC7180 SoC. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f8bd3c82bf7d7d602f7ee219b8e68ac4dac0a3c5 Author: Alex Elder Date: Mon Jul 19 16:24:55 2021 -0500 arm64: dts: qcom: sc7280: add IPA information Add IPA-related nodes and definitions to "sc7280.dtsi", including the reserved memory area used for AP-based IPA firmware loading. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 6a0eb6c9d9341cb076cd803864fff5889aa3fc03 Author: Alex Elder Date: Mon Jul 19 16:24:54 2021 -0500 dt-bindings: net: qcom,ipa: make imem interconnect optional On some newer SoCs, the interconnect between IPA and SoC internal memory (imem) is not used. Reflect this in the binding by moving the definition of the "imem" interconnect to the end and defining minItems to be 2 for both the interconnects and interconnect-names properties. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 7f6726b63595c7ec8bc410364ab3be6cf4d4d407 Author: Yang Yingliang Date: Tue Jul 20 21:52:37 2021 +0800 ALSA: nm256: Fix error return code in snd_nm256_create() If pci_request_regions() fails, it should return error code in snd_nm256_create(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210720135237.3424521-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit 0ac26271344478ff718329fa9d4ef81d4bcbc43b Author: Alex Elder Date: Mon Jul 19 15:23:33 2021 -0500 net: ipa: fix IPA v4.11 interconnect data Currently three interconnects are defined for the Qualcomm SC7280 SoC, but this was based on a misunderstanding. There should only be two interconnects defined: one between the IPA and system memory; and another between the AP and IPA config space. The bandwidths defined for the memory and config interconnects do not match what I understand to be proper values, so update these. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a38c02ef48a1411ea3fc4403a07e7124ad43d5e6 Author: Fabio Estevam Date: Mon Jul 19 20:26:39 2021 -0300 dt-bindings: net: fec: Fix indentation The following warning is observed when running 'make dtbs_check': Documentation/devicetree/bindings/net/fsl,fec.yaml:85:7: [warning] wrong indentation: expected 8 but found 6 (indentation) Fix the indentation accordingly. Signed-off-by: Fabio Estevam Reviewed-by: Joakim Zhang Signed-off-by: David S. Miller commit 083cd5a42d0f676eb5ccb7c5b3a889d7453e367b Merge: 7d901a1e878a1 b94dc99c0ddb7 Author: David S. Miller Date: Tue Jul 20 07:04:37 2021 -0700 Merge branch 'fdb-fanout' Vladimir Oltean says: ==================== Fan out FDB entries pointing towards the bridge to all switchdev member ports The "DSA RX filtering" series has added some important support for interpreting addresses towards the bridge device as host addresses and installing them as FDB entries towards the CPU port, but it does not cover all circumstances and needs further work. To be precise, the mechanism introduced in that series only works as long as the ports are fairly static and no port joins or leaves the bridge once the configuration is done. If any port leaves, host FDB entries that were installed during runtime (for example the user changes the MAC address of the bridge device) will be prematurely deleted, resulting in a broken setup. I see this work as targeted for "net-next" because technically it was not supposed to work. Also, there are still corner cases and holes to be plugged. For example, today, FDB entries on foreign interfaces are not covered by br_fdb_replay(), which means that there are cases where some host addresses are either lost, or never deleted by DSA. That will be resolved once more work gets accepted, in particular the "Allow forwarding for the software bridge data path to be offloaded to capable devices" series, which moves the br_fdb_replay() call to the bridge core and therefore would be required to solve the problem in a generic way for every switchdev driver and not just for DSA. These patches also pave the way for a cleaner implementation for FDB entries pointing towards a LAG upper interface in DSA (that code needs only to be added, nothing changed), however this is not done here. ==================== Signed-off-by: David S. Miller commit b94dc99c0ddb74713da315853919393fb3e63b96 Author: Vladimir Oltean Date: Mon Jul 19 16:51:40 2021 +0300 net: dsa: use switchdev_handle_fdb_{add,del}_to_device Using the new fan-out helper for FDB entries installed on the software bridge, we can install host addresses with the proper refcount on the CPU port, such that this case: ip link set swp0 master br0 ip link set swp1 master br0 ip link set swp2 master br0 ip link set swp3 master br0 ip link set br0 address 00:01:02:03:04:05 ip link set swp3 nomaster works properly and the br0 address remains installed as a host entry with refcount 3 instead of getting deleted. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8ca07176ab00a6d06a9b254dcbb2514b4d607e9c Author: Vladimir Oltean Date: Mon Jul 19 16:51:39 2021 +0300 net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE Currently DSA has an issue with FDB entries pointing towards the bridge in the presence of br_fdb_replay() being called at port join and leave time. In particular, each bridge port will ask for a replay for the FDB entries pointing towards the bridge when it joins, and for another replay when it leaves. This means that for example, a bridge with 4 switch ports will notify DSA 4 times of the bridge MAC address. But if the MAC address of the bridge changes during the normal runtime of the system, the bridge notifies switchdev [ once ] of the deletion of the old MAC address as a local FDB towards the bridge, and of the insertion [ again once ] of the new MAC address as a local FDB. This is a problem, because DSA keeps the old MAC address as a host FDB entry with refcount 4 (4 ports asked for it using br_fdb_replay). So the old MAC address will not be deleted. Additionally, the new MAC address will only be installed with refcount 1, and when the first switch port leaves the bridge (leaving 3 others as still members), it will delete with it the new MAC address of the bridge from the local FDB entries kept by DSA (because the br_fdb_replay call on deletion will bring the entry's refcount from 1 to 0). So the problem, really, is that the number of br_fdb_replay() calls is not matched with the refcount that a host FDB is offloaded to DSA during normal runtime. An elegant way to solve the problem would be to make the switchdev notification emitted by br_fdb_change_mac_address() result in a host FDB kept by DSA which has a refcount exactly equal to the number of ports under that bridge. Then, no matter how many DSA ports join or leave that bridge, the host FDB entry will always be deleted when there are exactly zero remaining DSA switch ports members of the bridge. To implement the proposed solution, we remember that the switchdev objects and port attributes have some helpers provided by switchdev, which can be optionally called by drivers: switchdev_handle_port_obj_{add,del} and switchdev_handle_port_attr_set. These helpers: - fan out a switchdev object/attribute emitted for the bridge towards all the lower interfaces that pass the check_cb(). - fan out a switchdev object/attribute emitted for a bridge port that is a LAG towards all the lower interfaces that pass the check_cb(). In other words, this is the model we need for the FDB events too: something that will keep an FDB entry emitted towards a physical port as it is, but translate an FDB entry emitted towards the bridge into N FDB entries, one per physical port. Of course, there are many differences between fanning out a switchdev object (VLAN) on 3 lower interfaces of a LAG and fanning out an FDB entry on 3 lower interfaces of a LAG. Intuitively, an FDB entry towards a LAG should be treated specially, because FDB entries are unicast, we can't just install the same address towards 3 destinations. It is imaginable that drivers might want to treat this case specifically, so create some methods for this case and do not recurse into the LAG lower ports, just the bridge ports. DSA also listens for FDB entries on "foreign" interfaces, aka interfaces bridged with us which are not part of our hardware domain: think an Ethernet switch bridged with a Wi-Fi AP. For those addresses, DSA installs host FDB entries. However, there we have the same problem (those host FDB entries are installed with a refcount of only 1) and an even bigger one which we did not have with FDB entries towards the bridge: br_fdb_replay() is currently not called for FDB entries on foreign interfaces, just for the physical port and for the bridge itself. So when DSA sniffs an address learned by the software bridge towards a foreign interface like an e1000 port, and then that e1000 leaves the bridge, DSA remains with the dangling host FDB address. That will be fixed separately by replaying all FDB entries and not just the ones towards the port and the bridge. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c6451cda100d4ebbc3f6819e1161ce0e38ce7746 Author: Vladimir Oltean Date: Mon Jul 19 16:51:38 2021 +0300 net: switchdev: introduce helper for checking dynamically learned FDB entries It is a bit difficult to understand what DSA checks when it tries to avoid installing dynamically learned addresses on foreign interfaces as local host addresses, so create a generic switchdev helper that can be reused and is generally more readable. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 820bf3fefa8261b51062d18d5442cb92e913390f Author: Sandeep Maheswaram Date: Tue Jul 6 18:30:13 2021 +0530 arm64: dts: qcom: sc7280: Add USB nodes for IDP board Add USB nodes for sc7280 IDP board. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1625576413-12324-4-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit 1c39e6f9b534f9f609be97890a7a9974cd17e4ab Author: Sandeep Maheswaram Date: Tue Jul 6 18:30:12 2021 +0530 arm64: dts: qcom: sc7280: Add USB related nodes Add nodes for DWC3 USB controller, QMP and HS USB PHYs in sc7280 SOC. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1625576413-12324-3-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit 298c81a7d44fe01b41d526ddabafcf8515c5f649 Author: Shaik Sajida Bhanu Date: Tue Jul 13 12:36:11 2021 +0530 arm64: dts: qcom: sc7280: Add nodes for eMMC and SD card Add nodes for eMMC and SD card on sc7280. Signed-off-by: Shaik Sajida Bhanu Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1626159971-22519-1-git-send-email-sbhanu@codeaurora.org Signed-off-by: Bjorn Andersson commit 12dd4ebda47abd5e3907da386b6fe1d8181ad179 Author: Bhupesh Sharma Date: Sun Jun 27 17:16:16 2021 +0530 arm64: dts: qcom: Fix usb entries for SA8155p adp board SA8155p adp board has two USB A-type receptacles called USB-portB and USB-portC respectively. While USB-portB is a USB High-Speed connector/interface, the USB-portC one is a USB 3.1 Super-Speed connector/interface. Also the USB-portB is used as the USB emergency download port (for image download purposes). Enable both the ports on the board in USB Host mode (since all the USB interfaces are brought out to USB Type A connectors). Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210627114616.717101-4-bhupesh.sharma@linaro.org Signed-off-by: Bjorn Andersson commit 5dc43d3b362cdd904a5253498b271d20a26d135d Author: Bhupesh Sharma Date: Sun Jun 27 17:16:15 2021 +0530 arm64: dts: qcom: sm8150: Sort dc_noc and gem_noc nodes Nodes should be sorted by address, so move the dc_noc and gem_noc nodes to their correct place. Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210627114616.717101-3-bhupesh.sharma@linaro.org [bjorn: Adjusted order slightly more] Signed-off-by: Bjorn Andersson commit 2aa2b50de12d96eaf282b886330afe98c389e1e2 Author: Bhupesh Sharma Date: Sun Jun 27 17:16:14 2021 +0530 arm64: dts: qcom: Use correct naming for dwc3 usb nodes in dts files The dwc3 usb nodes in several arm64 qcom dts are currently named differently, somewhere as 'usb@' and somewhere as 'dwc3@', leading to some confusion when one sees the entries in sysfs or dmesg: [ 1.943482] dwc3 a600000.usb: Adding to iommu group 1 [ 2.266127] dwc3 a800000.dwc3: Adding to iommu group 2 Name the usb nodes as 'usb@' for consistency, which is the correct convention as per the 'snps,dwc3' dt-binding as well (see [1]). [1]. Documentation/devicetree/bindings/usb/snps,dwc3.yaml Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210627114616.717101-2-bhupesh.sharma@linaro.org [bjorn: Extended to also fix ipq6018] Signed-off-by: Bjorn Andersson commit 98aee1e3cdcd74debc093cfc9297287063e88a0f Author: Bhupesh Sharma Date: Tue Jul 6 19:08:14 2021 +0530 arm64: dts: qcom: sm8150: Add UFS ICE capability Add support for UFS ICE (Qualcomm Inline Crypto Engine) in sm8150 SoC dts. I tested this on SA8155p-adp board, which is a publicly available development board that uses the sa8155p Qualcomm Snapdragon SoC. SA8155p platform is similar to the SM8150, so use this as base for now. I tested the UFS ICE feature using 'fscrypt' test utility. Cc: Bjorn Andersson Cc: Eric Biggers Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20210706133814.621536-1-bhupesh.sharma@linaro.org Signed-off-by: Bjorn Andersson commit 63fa4322469648ae1023bb92a8b0d6a2f4bdaf2c Author: Dmitry Baryshkov Date: Wed Jul 7 00:07:01 2021 +0100 arm64: dts: qcom: sm8250: fix usb2 qmp phy node Use 'lanes' as SuperSpeed lanes device node instead of just 'lane' to fix issues with TypeC support. Fixes: 46a6f297d7dd ("arm64: dts: qcom: sm8250: Add USB and PHY device nodes") Cc: robh+dt@kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Dmitry Baryshkov Tested-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20210706230702.299047-2-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 7d901a1e878a1cf8dd3ba7b4c057ad5eb7a40af0 Author: Xu Liang Date: Mon Jul 19 13:32:12 2021 +0800 net: phy: add Maxlinear GPY115/21x/24x driver Add driver to support the Maxlinear GPY115, GPY211, GPY212, GPY215, GPY241, GPY245 PHYs. Separate from XWAY PHY driver because this series has different register layout and new features not supported in XWAY PHY. Signed-off-by: Xu Liang Acked-by: Hauke Mehrtens Tested-by: Wong Vee Khee Tested-by: Wong Vee Khee Signed-off-by: David S. Miller commit 8b72b301b442907742c1af1b8fcb52e351a2aac1 Author: Xu Liang Date: Mon Jul 19 13:32:11 2021 +0800 net: phy: add API to read 802.3-c45 IDs Add API to read 802.3-c45 IDs so that C22/C45 mixed device can use C45 APIs without failing ID checks. Signed-off-by: Xu Liang Acked-by: Hauke Mehrtens Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 08f329fcddd50dc6f12f9bdbf7e4c9afce6e0d82 Merge: c18e9405d46aa c64b9c05045a2 Author: David S. Miller Date: Tue Jul 20 06:37:12 2021 -0700 Merge branch 'tag_8021q-cross-chip' Vladimir Olteans says: ==================== Proper cross-chip support for tag_8021q The cross-chip bridging support for tag_8021q/sja1105 introduced here: https://patchwork.ozlabs.org/project/netdev/cover/20200510163743.18032-1-olteanv@gmail.com/ took some shortcuts and is not reusable in other topologies except for the one it was written for: disjoint DSA trees. A diagram of this topology can be seen here: https://patchwork.ozlabs.org/project/netdev/patch/20200510163743.18032-3-olteanv@gmail.com/ However there are sja1105 switches on other boards using other topologies, most notably: - Daisy chained: | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 [ user ] [ user ] [ user ] [ dsa ] [ cpu ] | +---------+ | sw1p0 sw1p1 sw1p2 sw1p3 sw1p4 [ user ] [ user ] [ user ] [ dsa ] [ dsa ] | +---------+ | sw2p0 sw2p1 sw2p2 sw2p3 sw2p4 [ user ] [ user ] [ user ] [ user ] [ dsa ] - "H" topology: eth0 eth1 | | CPU port CPU port | DSA link | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 -------- sw1p4 sw1p3 sw1p2 sw1p1 sw1p0 | | | | | | user user user user user user port port port port port port In fact, the current code for tag_8021q cross-chip links works for neither of these 2 classes of topologies. The main reasons are: (a) The sja1105 driver does not treat DSA links. In the "disjoint trees" topology, the routing port towards any other switch is also the CPU port, and that was already configured so it already worked. This series does not deal with enabling DSA links in the sja1105 driver, that is a fairly trivial task that will be dealt with separately. (b) The tag_8021q code for cross-chip links assumes that any 2 switches between cross-chip forwarding needs to be enabled (i.e. which have user ports part of the same bridge) are at most 1 hop away from each other. This was true for the "disjoint trees" case because once a packet reached the CPU port, VLAN-unaware bridging was done by the DSA master towards the other switches based on destination MAC address, so the tag_8021q header was not interpreted in any way. However, in a daisy chain setup with 3 switches, all of them will interpret the tag_8021q header, and all tag_8021q VLANs need to be installed in all switches. When looking at the O(n^2) real complexity of the problem, it is clear that the current code had absolutely no chance of working in the general case. So this patch series brings a redesign of tag_8021q, in light of its new requirements. Anything with O(n^2) complexity (where n is the number of switches in a DSA tree) is an obvious candidate for the DSA cross-chip notifier support. One by one, the patches are: - The sja1105 driver is extremely entangled with tag_8021q, to be exact, with that driver's best_effort_vlan_filtering support. We drop this operating mode, which means that sja1105 temporarily loses network stack termination for VLAN-aware bridges. That operating mode raced itself to its own grave anyway due to some hardware limitations in combination with PTP reported by NXP customers. I can't say a lot more, but network stack termination for VLAN-aware bridges in sja1105 will be reimplemented soon with a much, much better solution. - What remains of tag_8021q in sja1105 is support for standalone ports mode and for VLAN-unaware bridging. We refactor the API surface of tag_8021q to a single pair of dsa_tag_8021q_{register,unregister} functions and we clean up everything else related to tag_8021q from sja1105 and felix. - Then we move tag_8021q into the DSA core. I thought about this a lot, and there is really no other way to add a DSA_NOTIFIER_TAG_8021Q_VLAN_ADD cross-chip notifier if DSA has no way to know if the individual switches use tag_8021q or not. So it needs to be part of the core to use notifiers. - Then we modify tag_8021q to update dynamically on bridge_{join,leave} events, instead of what we have today which is simply installing the VLANs on all ports of a switch and leaving port isolation up to somebody else. This change is necessary because port isolation over a DSA link cannot be done in any other way except based on VLAN membership, as opposed to bridging within the same switch which had 2 choices (at least on sja1105). - Finally we add 2 new cross-chip notifiers for adding and deleting a tag_8021q VLAN, which is properly refcounted similar to the bridge FDB and MDB code, and complete cleanup is done on teardown (note that this is unlike regular bridge VLANs, where we currently cannot do refcounting because the user can run "bridge vlan add dev swp0 vid 100" a gazillion times, and "bridge vlan del dev swp0 vid 100" just once, and for some reason expect that the VLAN will be deleted. But I digress). With this opportunity we remove a lot of hard-to-digest code and replace it with much more idiomatic DSA-style code. This series was regression-tested on: - Single-switch boards with SJA1105T - Disjoint-tree boards with SJA1105S and Felix (using ocelot-8021q) - H topology boards using SJA1110A ==================== Signed-off-by: David S. Miller commit c64b9c05045a21a5258f6dbd81d94a2a22ff73a2 Author: Vladimir Oltean Date: Mon Jul 19 20:14:52 2021 +0300 net: dsa: tag_8021q: add proper cross-chip notifier support The big problem which mandates cross-chip notifiers for tag_8021q is this: | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 [ user ] [ user ] [ user ] [ dsa ] [ cpu ] | +---------+ | sw1p0 sw1p1 sw1p2 sw1p3 sw1p4 [ user ] [ user ] [ user ] [ dsa ] [ dsa ] | +---------+ | sw2p0 sw2p1 sw2p2 sw2p3 sw2p4 [ user ] [ user ] [ user ] [ dsa ] [ dsa ] When the user runs: ip link add br0 type bridge ip link set sw0p0 master br0 ip link set sw2p0 master br0 It doesn't work. This is because dsa_8021q_crosschip_bridge_join() assumes that "ds" and "other_ds" are at most 1 hop away from each other, so it is sufficient to add the RX VLAN of {ds, port} into {other_ds, other_port} and vice versa and presto, the cross-chip link works. When there is another switch in the middle, such as in this case switch 1 with its DSA links sw1p3 and sw1p4, somebody needs to tell it about these VLANs too. Which is exactly why the problem is quadratic: when a port joins a bridge, for each port in the tree that's already in that same bridge we notify a tag_8021q VLAN addition of that port's RX VLAN to the entire tree. It is a very complicated web of VLANs. It must be mentioned that currently we install tag_8021q VLANs on too many ports (DSA links - to be precise, on all of them). For example, when sw2p0 joins br0, and assuming sw1p0 was part of br0 too, we add the RX VLAN of sw2p0 on the DSA links of switch 0 too, even though there isn't any port of switch 0 that is a member of br0 (at least yet). In theory we could notify only the switches which sit in between the port joining the bridge and the port reacting to that bridge_join event. But in practice that is impossible, because of the way 'link' properties are described in the device tree. The DSA bindings require DT writers to list out not only the real/physical DSA links, but in fact the entire routing table, like for example switch 0 above will have: sw0p3: port@3 { link = <&sw1p4 &sw2p4>; }; This was done because: /* TODO: ideally DSA ports would have a single dp->link_dp member, * and no dst->rtable nor this struct dsa_link would be needed, * but this would require some more complex tree walking, * so keep it stupid at the moment and list them all. */ but it is a perfect example of a situation where too much information is actively detrimential, because we are now in the position where we cannot distinguish a real DSA link from one that is put there to avoid the 'complex tree walking'. And because DT is ABI, there is not much we can change. And because we do not know which DSA links are real and which ones aren't, we can't really know if DSA switch A is in the data path between switches B and C, in the general case. So this is why tag_8021q RX VLANs are added on all DSA links, and probably why it will never change. On the other hand, at least the number of additions/deletions is well balanced, and this means that once we implement reference counting at the cross-chip notifier level a la fdb/mdb, there is absolutely zero need for a struct dsa_8021q_crosschip_link, it's all self-managing. In fact, with the tag_8021q notifiers emitted from the bridge join notifiers, it becomes so generic that sja1105 does not need to do anything anymore, we can just delete its implementation of the .crosschip_bridge_{join,leave} methods. Among other things we can simply delete is the home-grown implementation of sja1105_notify_crosschip_switches(). The reason why that is wrong is because it is not quadratic - it only covers remote switches to which we have a cross-chip bridging link and that does not cover in-between switches. This deletion is part of the same patch because sja1105 used to poke deep inside the guts of the tag_8021q context in order to do that. Because the cross-chip links went away, so needs the sja1105 code. Last but not least, dsa_8021q_setup_port() is simplified (and also renamed). Because our TAG_8021Q_VLAN_ADD notifier is designed to react on the CPU port too, the four dsa_8021q_vid_apply() calls: - 1 for RX VLAN on user port - 1 for the user port's RX VLAN on the CPU port - 1 for TX VLAN on user port - 1 for the user port's TX VLAN on the CPU port now get squashed into only 2 notifier calls via dsa_port_tag_8021q_vlan_add. And because the notifiers to add and to delete a tag_8021q VLAN are distinct, now we finally break up the port setup and teardown into separate functions instead of relying on a "bool enabled" flag which tells us what to do. Arguably it should have been this way from the get go. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e19cc13c9c8aba6e310022b050dc60edcb48a20b Author: Vladimir Oltean Date: Mon Jul 19 20:14:51 2021 +0300 net: dsa: tag_8021q: manage RX VLANs dynamically at bridge join/leave time There has been at least one wasted opportunity for tag_8021q to be used by a driver: https://patchwork.ozlabs.org/project/netdev/patch/20200710113611.3398-3-kurt@linutronix.de/#2484272 because of a design decision: the declared purpose of tag_8021q is to offer source port/switch identification for a tagging driver for packets coming from a switch with no hardware DSA tagging support. It is not intended to provide VLAN-based port isolation, because its first user, sja1105, had another mechanism for bridging domain isolation, the L2 Forwarding Table. So even if 2 ports are in the same VLAN but they are separated via the L2 Forwarding Table, they will not communicate with one another. The L2 Forwarding Table is managed by the sja1105_bridge_join() and sja1105_bridge_leave() methods. As a consequence, today tag_8021q does not bother too much with hooking into .port_bridge_join() and .port_bridge_leave() because that would introduce yet another degree of freedom, it just iterates statically through all ports of a switch and adds the RX VLAN of one port to all the others. In this way, whenever .port_bridge_join() is called, bridging will magically work because the RX VLANs are already installed everywhere they need to be. This is not to say that the reason for the change in this patch is to satisfy the hellcreek and similar use cases, that is merely a nice side effect. Instead it is to make sja1105 cross-chip links work properly over a DSA link. For context, sja1105 today supports a degenerate form of cross-chip bridging, where the switches are interconnected through their CPU ports ("disjoint trees" topology). There is some code which has been generalized into dsa_8021q_crosschip_link_{add,del}, but it is not enough, and frankly it is impossible to build upon that. Real multi-switch DSA trees, like daisy chains or H trees, which have actual DSA links, do not work. The problem is that sja1105 is unlike mv88e6xxx, and does not have a PVT for cross-chip bridging, which is a table by which the local switch can select the forwarding domain for packets from a certain ingress switch ID and source port. The sja1105 switches cannot parse their own DSA tags, because, well, they don't really have support for DSA tags, it's all VLANs. So to make something like cross-chip bridging between sw0p0 and sw1p0 to work over the sw0p3/sw1p3 DSA link to work with sja1105 in the topology below: | | sw0p0 sw0p1 sw0p2 sw0p3 sw1p3 sw1p2 sw1p1 sw1p0 [ user ] [ user ] [ cpu ] [ dsa ] ---- [ dsa ] [ cpu ] [ user ] [ user ] we need to ask ourselves 2 questions: (1) how should the L2 Forwarding Table be managed? (2) how should the VLAN Lookup Table be managed? i.e. what should prevent packets from going to unwanted ports? Since as mentioned, there is no PVT, the L2 Forwarding Table only contains forwarding rules for local ports. So we can say "all user ports are allowed to forward to all CPU ports and all DSA links". If we allow forwarding to DSA links unconditionally, this means we must prevent forwarding using the VLAN Lookup Table. This is in fact asymmetric with what we do for tag_8021q on ports local to the same switch, and it matters because now that we are making tag_8021q a core DSA feature, we need to hook into .crosschip_bridge_join() to add/remove the tag_8021q VLANs. So for symmetry it makes sense to manage the VLANs for local forwarding in the same way as cross-chip forwarding. Note that there is a very precise reason why tag_8021q hooks into dsa_switch_bridge_join() which acts at the cross-chip notifier level, and not at a higher level such as dsa_port_bridge_join(). We need to install the RX VLAN of the newly joining port into the VLAN table of all the existing ports across the tree that are part of the same bridge, and the notifier already does the iteration through the switches for us. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 328621f6131f667c5c328bb72d45442fd76efb81 Author: Vladimir Oltean Date: Mon Jul 19 20:14:50 2021 +0300 net: dsa: tag_8021q: absorb dsa_8021q_setup into dsa_tag_8021q_{,un}register Right now, setting up tag_8021q is a 2-step operation for a driver, first the context structure needs to be created, then the VLANs need to be installed on the ports. A similar thing is true for teardown. Merge the 2 steps into the register/unregister methods, to be as transparent as possible for the driver as to what tag_8021q does behind the scenes. This also gets rid of the funny "bool setup == true means setup, == false means teardown" API that tag_8021q used to expose. Note that dsa_tag_8021q_register() must be called at least in the .setup() driver method and never earlier (like in the driver probe function). This is because the DSA switch tree is not initialized at probe time, and the cross-chip notifiers will not work. For symmetry with .setup(), the unregister method should be put in .teardown(). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5da11eb407340233a6111c563419e19685a062a4 Author: Vladimir Oltean Date: Mon Jul 19 20:14:49 2021 +0300 net: dsa: make tag_8021q operations part of the core Make tag_8021q a more central element of DSA and move the 2 driver specific operations outside of struct dsa_8021q_context (which is supposed to hold dynamic data and not really constant function pointers). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d7b1fd520d5d4271f4ab9b1671afbdcd868039d3 Author: Vladimir Oltean Date: Mon Jul 19 20:14:48 2021 +0300 net: dsa: let the core manage the tag_8021q context The basic problem description is as follows: Be there 3 switches in a daisy chain topology: | sw0p0 sw0p1 sw0p2 sw0p3 sw0p4 [ user ] [ user ] [ user ] [ dsa ] [ cpu ] | +---------+ | sw1p0 sw1p1 sw1p2 sw1p3 sw1p4 [ user ] [ user ] [ user ] [ dsa ] [ dsa ] | +---------+ | sw2p0 sw2p1 sw2p2 sw2p3 sw2p4 [ user ] [ user ] [ user ] [ user ] [ dsa ] The CPU will not be able to ping through the user ports of the bottom-most switch (like for example sw2p0), simply because tag_8021q was not coded up for this scenario - it has always assumed DSA switch trees with a single switch. To add support for the topology above, we must admit that the RX VLAN of sw2p0 must be added on some ports of switches 0 and 1 as well. This is in fact a textbook example of thing that can use the cross-chip notifier framework that DSA has set up in switch.c. There is only one problem: core DSA (switch.c) is not able right now to make the connection between a struct dsa_switch *ds and a struct dsa_8021q_context *ctx. Right now, it is drivers who call into tag_8021q.c and always provide a struct dsa_8021q_context *ctx pointer, and tag_8021q.c calls them back with the .tag_8021q_vlan_{add,del} methods. But with cross-chip notifiers, it is possible for tag_8021q to call drivers without drivers having ever asked for anything. A good example is right above: when sw2p0 wants to set itself up for tag_8021q, the .tag_8021q_vlan_add method needs to be called for switches 1 and 0, so that they transport sw2p0's VLANs towards the CPU without dropping them. So instead of letting drivers manage the tag_8021q context, add a tag_8021q_ctx pointer inside of struct dsa_switch, which will be populated when dsa_tag_8021q_register() returns success. The patch is fairly long-winded because we are partly reverting commit 5899ee367ab3 ("net: dsa: tag_8021q: add a context structure") which made the driver-facing tag_8021q API use "ctx" instead of "ds". Now that we can access "ctx" directly from "ds", this is no longer needed. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8b6e638b4be2ad77f61fb93b4e1776c6ccc2edab Author: Vladimir Oltean Date: Mon Jul 19 20:14:47 2021 +0300 net: dsa: build tag_8021q.c as part of DSA core Upcoming patches will add tag_8021q related logic to switch.c and port.c, in order to allow it to make use of cross-chip notifiers. In addition, a struct dsa_8021q_context *ctx pointer will be added to struct dsa_switch. It seems fairly low-reward to #ifdef the *ctx from struct dsa_switch and to provide shim implementations of the entire tag_8021q.c calling surface (not even clear what to do about the tag_8021q cross-chip notifiers to avoid compiling them). The runtime overhead for switches which don't use tag_8021q is fairly small because all helpers will check for ds->tag_8021q_ctx being a NULL pointer and stop there. So let's make it part of dsa_core.o. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit cedf467064b6b8764fdb2ee6b9e3d18bc81a9d8f Author: Vladimir Oltean Date: Mon Jul 19 20:14:46 2021 +0300 net: dsa: tag_8021q: create dsa_tag_8021q_{register,unregister} helpers In preparation of moving tag_8021q to core DSA, move all initialization and teardown related to tag_8021q which is currently done by drivers in 2 functions called "register" and "unregister". These will gather more functionality in future patches, which will better justify the chosen naming scheme. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8afbea187d31e4e9beb83b7a316d16b7879c2799 Author: Vladimir Oltean Date: Mon Jul 19 20:14:45 2021 +0300 net: dsa: tag_8021q: remove struct packet_type declaration This is no longer necessary since tag_8021q doesn't register itself as a full-blown tagger anymore. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 69ebb3706471d29362ae819ded14b8551284432f Author: Vladimir Oltean Date: Mon Jul 19 20:14:44 2021 +0300 net: dsa: tag_8021q: use symbolic error names Use %pe to give the user a string holding the error code instead of just a number. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a81a45744ba5e0de34a3c724c9a9b9c77856a3a3 Author: Vladimir Oltean Date: Mon Jul 19 20:14:43 2021 +0300 net: dsa: tag_8021q: use "err" consistently instead of "rc" Some of the tag_8021q code has been taken out of sja1105, which uses "rc" for its return code variables, whereas the DSA core uses "err". Change tag_8021q for consistency. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0fac6aa098edf91ba65370da03811d9aba5715a9 Author: Vladimir Oltean Date: Mon Jul 19 20:14:42 2021 +0300 net: dsa: sja1105: delete the best_effort_vlan_filtering mode Simply put, the best-effort VLAN filtering mode relied on VLAN retagging from a bridge VLAN towards a tag_8021q sub-VLAN in order to be able to decode the source port in the tagger, but the VLAN retagging implementation inside the sja1105 chips is not the best and we were relying on marginal operating conditions. The most notable limitation of the best-effort VLAN filtering mode is its incapacity to treat this case properly: ip link add br0 type bridge vlan_filtering 1 ip link set swp2 master br0 ip link set swp4 master br0 bridge vlan del dev swp4 vid 1 bridge vlan add dev swp4 vid 1 pvid When sending an untagged packet through swp2, the expectation is for it to be forwarded to swp4 as egress-tagged (so it will contain VLAN ID 1 on egress). But the switch will send it as egress-untagged. There was an attempt to fix this here: https://patchwork.kernel.org/project/netdevbpf/patch/20210407201452.1703261-2-olteanv@gmail.com/ but it failed miserably because it broke PTP RX timestamping, in a way that cannot be corrected due to hardware issues related to VLAN retagging. So with either PTP broken or pushing VLAN headers on egress for untagged packets being broken, the sad reality is that the best-effort VLAN filtering code is broken. Delete it. Note that this means there will be a temporary loss of functionality in this driver until it is replaced with something better (network stack RX/TX capability for "mode 2" as described in Documentation/networking/dsa/sja1105.rst, the "port under VLAN-aware bridge" case). We simply cannot keep this code until that driver rework is done, it is super bloated and tangled with tag_8021q. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c18e9405d46aa08bb4b55a35ee9bcc66ef3e89e0 Merge: 542bb39651d5f ae57ea7a19b78 Author: David S. Miller Date: Tue Jul 20 06:23:50 2021 -0700 Merge branch 's390-next' Julian Wiedmann says: ==================== s390/qeth: updates 2021-07-20 please apply the following patch series for qeth to netdev's net-next tree. This removes the deprecated support for OSN-mode devices, and does some follow-on cleanups. ==================== Signed-off-by: David S. Miller commit 542bb39651d5f98665d637b1683d501fd320212c Merge: 2c0804044781f 1ec2230fc721e Author: David S. Miller Date: Tue Jul 20 06:23:13 2021 -0700 Merge branch 'veth-flexible-channel-numbers' Paolo Abeni says: ==================== veth: more flexible channels number configuration XDP setups can benefit from multiple veth RX/TX queues. Currently veth allow setting such number only at creation time via the 'numrxqueues' and 'numtxqueues' parameters. This series introduces support for the ethtool set_channel operation and allows configuring the queue number via a new module parameter. The veth default configuration is not changed. Finally self-tests are updated to check the new features, with both valid and invalid arguments. This iteration is a rebase of the most recent RFC, it does not provide a module parameter to configure the default number of queues, but I think could be worthy RFC v1 -> RFC v2: - report more consistent 'combined' count - make set_channel as resilient as possible to errors - drop module parameter - but I would still consider it. - more self-tests ==================== Signed-off-by: David S. Miller commit 2c0804044781f3de6c19efc01355611b839d5aa1 Merge: edd2e9d586466 9dee572c38484 Author: David S. Miller Date: Tue Jul 20 06:22:14 2021 -0700 Merge branch 'bridge-vlan-multicast' Nikolay Aleksandrov says: ==================== net: bridge: multicast: add vlan support This patchset adds initial per-vlan multicast support, most of the code deals with moving to multicast context pointers from bridge/port pointers. That allows us to switch them with the per-vlan contexts when a multicast packet is being processed and vlan multicast snooping has been enabled. That is controlled by a global bridge option added in patch 06 which is off by default (BR_BOOLOPT_MCAST_VLAN_SNOOPING). It is important to note that this option can change only under RTNL and doesn't require multicast_lock, so we need to be careful when retrieving mcast contexts in parallel. For packet processing they are switched only once in br_multicast_rcv() and then used until the packet has been processed. For the most part we need these contexts only to read config values and check if they are disabled. The global mcast state which is maintained consists of querier and router timers, the rest are config options. The port mcast state which is maintained consists of query timer and link to router port list if it's ever marked as a router port. Port multicast contexts _must_ be used only with their respective global contexts, that is a bridge port's mcast context must be used only with bridge's global mcast context and a vlan/port's mcast context must be used only with that vlan's global mcast context due to the router port lists. This way a bridge port can be marked as a router in multiple vlans, but might not be a router in some other vlan. Also this allows us to have per-vlan querier elections, per-vlan queries and basically the whole multicast state becomes per-vlan when the option is enabled. One of the hardest parts is synchronization with vlan's memory management, that is done through a new vlan flag: BR_VLFLAG_MCAST_ENABLED which is changed only under multicast_lock. When a vlan is being destroyed first that flag is removed under the lock, then the multicast context is torn down which includes waiting for any outstanding context timers. Since all of the vlan processing depends on BR_VLFLAG_MCAST_ENABLED it must be checked first if the contexts are vlan and the multicast_lock has been acquired. That is done by all IGMP/MLD packet processing functions and timers. When processing a packet we have RCU so the vlan memory won't be freed, but if the flag is missing we must not process it. The timers are synchronized in the same way with the addition of waiting for them to finish in case they are running after removing the flag under multicast_lock (i.e. they were waiting for the lock). Multicast vlan snooping requires vlan filtering to be enabled, if it's disabled then snooping gets automatically disabled, too. BR_VLFLAG_GLOBAL_MCAST_ENABLED controls if a vlan has BR_VLFLAG_MCAST_ENABLED set which is used in all vlan disabled checks. We need both flags because one is controlled by user-space globally (BR_VLFLAG_GLOBAL_MCAST_ENABLED) and the other is for a particular bridge/vlan or port/vlan entry (BR_VLFLAG_MCAST_ENABLED). Since the latter is also used for synchronization between the multicast and vlan code, and also controlled by BR_VLFLAG_GLOBAL_MCAST_ENABLED we rely on it when checking if a vlan context is disabled. The multicast fast-path has 3 new bit tests on the cache-hot bridge flags field, I didn't observe any measurable difference. I haven't forced either context options to be always disabled when the other type is enabled because the state consists of timers which either expire (router) or don't affect the normal operation. Some options, like the mcast querier one, won't be allowed to change for the disabled context type, that will come with a future patch-set which adds per-vlan querier control. Another important addition is the global vlan options, so far we had only per bridge/port vlan options but in order to control vlan multicast snooping globally we need to add a new type of global vlan options. They can be changed only on the bridge device and are dumped only when a special flag is set in the dump request. The first global option is vlan mcast snooping control, it controls the vlan BR_VLFLAG_GLOBAL_MCAST_ENABLED private flag. It can be set only on master vlan entries. There will be many more global vlan options in the future both for multicast config and other per-vlan options (e.g. STP). There's a lot of room for improvements, I'll do some of the initial ones but splitting the state to different contexts opens the door for a lot more. Also any new multicast options become vlan-supported with very little to no effort by using the same contexts. Short patch description: patches 01-04: initial mcast context add, no functional changes patch 05: adds vlan mcast init and control helpers and uses them on vlan create/destroy patch 06: adds a global bridge mcast vlan snooping knob (default off) patches 07-08: add a helper for users which must derive the contexts based on current bridge and vlan options (e.g. timers) patch 09: adds checks for disabled vlan contexts in packet processing and timers patch 10: adds support for per-vlan querier and tagged queries patch 11: adds router port vlan id in the notifications patches 12-14: add global vlan options support (change, dump, notify) patch 15: adds per-vlan global mcast snooping control Future patch-sets which build on this one (in order): - vlan state mcast handling - user-space mdb contexts (currently only the bridge contexts are used there) - all bridge multicast config options added per-vlan global and per vlan/port - iproute2 support for all the new uAPIs - selftests This set has been stress-tested (deleting/adding ports/vlans while changing vlan mcast snooping while processing IGMP/MLD packets), and also has passed all bridge self-tests. I'm sending this set as early as possible since there're a few more related sets that should go in the same release to get proper and full mcast vlan snooping support. ==================== Signed-off-by: David S. Miller commit ae57ea7a19b784e5982ae25bdba3cdf7c98f3067 Author: Julian Wiedmann Date: Tue Jul 20 08:38:49 2021 +0200 s390/qeth: clean up device_type management qeth uses three device_type structs - a generic one, and one for each sub-driver (which is used for fixed-layer devices only). Instead of exporting these device_types back&forth between the driver's modules, make all the logic self-contained within the sub-drivers. On disc->setup() they either install their own device_type, or add the sysfs attributes that are missing in the generic device_type. Later on disc->remove() these attributes are removed again from any device that has the generic device_type. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit a37cfa28ebdc6a2286569ef783c4ba5c719f4902 Author: Julian Wiedmann Date: Tue Jul 20 08:38:48 2021 +0200 s390/qeth: clean up QETH_PROT_* naming The QETH_PROT_* naming is shared among two unrelated areas - one is the MPC-level protocol identifiers, the other is the qeth_prot_version enum. Rename the MPC definitions to use QETH_MPC_PROT_*. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller commit a8c7629c622b7cfa219c9edddd4f30833c330997 Author: Julian Wiedmann Date: Tue Jul 20 08:38:47 2021 +0200 s390/qeth: remove OSN support Commit fb64de1bc36c ("s390/qeth: phase out OSN support") spelled out why the OSN support in qeth is in a bad shape, and put any remaining interested parties on notice to speak up before it gets ripped out. It's 2021 now, so make true on that promise and remove all the OSN-specific parts from qeth. This also means that we no longer need to export various parts of the cmd & data path internals to the L2 driver. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller commit bc672d4945cea00310bc4185869a27022643eeba Merge: e4b1dc43ec325 226d528512cfa Author: David S. Miller Date: Tue Jul 20 06:13:37 2021 -0700 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 2021-07-19 This series contains updates to iavf and i40e drivers. Stefan Assmann adds locking to a path that does not acquire a spinlock where needed for i40e. He also adjusts locking of critical sections to help avoid races and removes overriding of the adapter state during pending reset for iavf driver. ==================== Signed-off-by: David S. Miller commit e4b1dc43ec3250899356cf1de1820bf8fec8b30e Merge: 2c6ad20b581e3 1ec2230fc721e Author: David S. Miller Date: Tue Jul 20 06:11:28 2021 -0700 Merge branch 'veth-flexible-channel-numbers' Paolo Abeni says: ==================== veth: more flexible channels number configuration XDP setups can benefit from multiple veth RX/TX queues. Currently veth allow setting such number only at creation time via the 'numrxqueues' and 'numtxqueues' parameters. This series introduces support for the ethtool set_channel operation and allows configuring the queue number via a new module parameter. The veth default configuration is not changed. Finally self-tests are updated to check the new features, with both valid and invalid arguments. This iteration is a rebase of the most recent RFC, it does not provide a module parameter to configure the default number of queues, but I think could be worthy RFC v1 -> RFC v2: - report more consistent 'combined' count - make set_channel as resilient as possible to errors - drop module parameter - but I would still consider it. - more self-tests ==================== Signed-off-by: David S. Miller commit 1ec2230fc721e6270b0504c07945a74742c81f81 Author: Paolo Abeni Date: Tue Jul 20 10:41:52 2021 +0200 selftests: net: veth: add tests for set_channel Simple functional test for the newly exposed features. Also add an optional stress test for the channel number update under flood. RFC v1 -> RFC v2: - add the stress test Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867 Author: Paolo Abeni Date: Tue Jul 20 10:41:51 2021 +0200 veth: create by default nr_possible_cpus queues This allows easier XDP usage. The number of default active queues is not changed: 1 RX and 1 TX so that this does not introduce overhead on the datapath for queue selection. v1 -> v2: - drop the module parameter, force default to nr_possible_cpus - Toke Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 4752eeb3d891c27905a8fdf4d80e899c0efd4ec7 Author: Paolo Abeni Date: Tue Jul 20 10:41:50 2021 +0200 veth: implement support for set_channel ethtool op This change implements the set_channel() ethtool operation, preserving the current defaults values and allowing up set the number of queues in the range set ad device creation time. The update operation tries hard to leave the device in a consistent status in case of errors. RFC v1 -> RFC v2: - don't flip device status on set_channel() - roll-back the changes if possible on error - Jackub Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit dedd53c5e075e4277f2a01c6d78318ac16e645c3 Author: Paolo Abeni Date: Tue Jul 20 10:41:49 2021 +0200 veth: factor out initialization helper Extract in simpler helpers the code to enable and disable a range of xdp/napi instance, with the common property that "disable" helpers can't fail. Will be used by the next patch. No functional change intended. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit f7918b79019f13ece815b2a88bab12974793aed1 Author: Paolo Abeni Date: Tue Jul 20 10:41:48 2021 +0200 veth: always report zero combined channels veth get_channel currently reports for channels being both RX/TX and combined. As Jakub noted: """ ethtool man page is relatively clear, unfortunately the kernel code is not and few read the man page. A channel is approximately an IRQ, not a queue, and IRQ can't be dedicated and combined simultaneously """ This patch changes the information exposed by veth_get_channels, setting max_combined to zero, being more consistent with the above statement. The ethtool_channels is always cleared by the caller, we just need to avoid setting the 'combined' fields. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 51fdf0914f2689e7e2549da303bcb38843119b5c Author: Jim Cromie Date: Wed Jul 14 11:51:34 2021 -0600 drm/print: fixup spelling in a comment s/prink/printk/ - no functional changes Signed-off-by: Jim Cromie Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714175138.319514-2-jim.cromie@gmail.com commit a6579cbfd7216b071008db13360c322a6b21400b Author: Colin Ian King Date: Mon Jul 12 17:24:30 2021 +0100 gfs2: Fix memory leak of object lsi on error return path In the case where IS_ERR(lsi->si_sc_inode) is true the error exit path to free_local does not kfree the allocated object lsi leading to a memory leak. Fix this by kfree'ing lst before taking the error exit path. Addresses-Coverity: ("Resource leak") Fixes: 97fd734ba17e ("gfs2: lookup local statfs inodes prior to journal recovery") Signed-off-by: Colin Ian King Signed-off-by: Andreas Gruenbacher commit 2c6ad20b581e37d6331010ee1d28b3307c90ba0a Author: Vasily Averin Date: Mon Jul 19 13:44:56 2021 +0300 memcg: enable accounting for scm_fp_list objects unix sockets allows to send file descriptors via SCM_RIGHTS type messages. Each such send call forces kernel to allocate up to 2Kb memory for struct scm_fp_list. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 1b51d8271973e4966078f0c1a5cb061ae9a424d2 Author: Vasily Averin Date: Mon Jul 19 13:44:50 2021 +0300 memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation Author: Andrey Ryabinin The size of the ip_tunnel_prl structs allocation is controllable from user-space, thus it's better to avoid spam in dmesg if allocation failed. Also add __GFP_ACCOUNT as this is a good candidate for per-memcg accounting. Allocation is temporary and limited by 4GB. Signed-off-by: Andrey Ryabinin Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit a89893dd7b08fa85bcf643ca742ab388e001c08e Author: Vasily Averin Date: Mon Jul 19 13:44:44 2021 +0300 memcg: enable accounting for VLAN group array vlan array consume up to 8 pages of memory per net device. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 990c74e3f41d7ae9711d3fb3e8b3f0d3088e0969 Author: Vasily Averin Date: Mon Jul 19 13:44:37 2021 +0300 memcg: enable accounting for inet_bin_bucket cache net namespace can create up to 64K tcp and dccp ports and force kernel to allocate up to several megabytes of memory per netns for inet_bind_bucket objects. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 6126891c6d4f6f4ef50323d2020635ee255a796e Author: Vasily Averin Date: Mon Jul 19 13:44:31 2021 +0300 memcg: enable accounting for IP address and routing-related objects An netadmin inside container can use 'ip a a' and 'ip r a' to assign a large number of ipv4/ipv6 addresses and routing entries and force kernel to allocate megabytes of unaccounted memory for long-lived per-netdevice related kernel objects: 'struct in_ifaddr', 'struct inet6_ifaddr', 'struct fib6_node', 'struct rt6_info', 'struct fib_rules' and ip_fib caches. These objects can be manually removed, though usually they lives in memory till destroy of its net namespace. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. One of such objects is the 'struct fib6_node' mostly allocated in net/ipv6/route.c::__ip6_ins_rt() inside the lock_bh()/unlock_bh() section: write_lock_bh(&table->tb6_lock); err = fib6_add(&table->tb6_root, rt, info, mxc); write_unlock_bh(&table->tb6_lock); In this case it is not enough to simply add SLAB_ACCOUNT to corresponding kmem cache. The proper memory cgroup still cannot be found due to the incorrect 'in_interrupt()' check used in memcg_kmem_bypass(). Obsoleted in_interrupt() does not describe real execution context properly. >From include/linux/preempt.h: The following macros are deprecated and should not be used in new code: in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled To verify the current execution context new macro should be used instead: in_task() - We're in task context Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit c948f51c1654218af2161840014c9dcbf7c89464 Author: Vasily Averin Date: Mon Jul 19 13:44:23 2021 +0300 memcg: enable accounting for net_device and Tx/Rx queues Container netadmin can create a lot of fake net devices, then create a new net namespace and repeat it again and again. Net device can request the creation of up to 4096 tx and rx queues, and force kernel to allocate up to several tens of megabytes memory per net device. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 2967eed908020ea997044d6f2ef9ebbca0e0e8e9 Merge: 23d2b94043ca8 9dee572c38484 Author: David S. Miller Date: Tue Jul 20 05:41:29 2021 -0700 Merge branch 'bridge-vlan-multicast' Nikolay Aleksandrov says: ==================== net: bridge: multicast: add vlan support This patchset adds initial per-vlan multicast support, most of the code deals with moving to multicast context pointers from bridge/port pointers. That allows us to switch them with the per-vlan contexts when a multicast packet is being processed and vlan multicast snooping has been enabled. That is controlled by a global bridge option added in patch 06 which is off by default (BR_BOOLOPT_MCAST_VLAN_SNOOPING). It is important to note that this option can change only under RTNL and doesn't require multicast_lock, so we need to be careful when retrieving mcast contexts in parallel. For packet processing they are switched only once in br_multicast_rcv() and then used until the packet has been processed. For the most part we need these contexts only to read config values and check if they are disabled. The global mcast state which is maintained consists of querier and router timers, the rest are config options. The port mcast state which is maintained consists of query timer and link to router port list if it's ever marked as a router port. Port multicast contexts _must_ be used only with their respective global contexts, that is a bridge port's mcast context must be used only with bridge's global mcast context and a vlan/port's mcast context must be used only with that vlan's global mcast context due to the router port lists. This way a bridge port can be marked as a router in multiple vlans, but might not be a router in some other vlan. Also this allows us to have per-vlan querier elections, per-vlan queries and basically the whole multicast state becomes per-vlan when the option is enabled. One of the hardest parts is synchronization with vlan's memory management, that is done through a new vlan flag: BR_VLFLAG_MCAST_ENABLED which is changed only under multicast_lock. When a vlan is being destroyed first that flag is removed under the lock, then the multicast context is torn down which includes waiting for any outstanding context timers. Since all of the vlan processing depends on BR_VLFLAG_MCAST_ENABLED it must be checked first if the contexts are vlan and the multicast_lock has been acquired. That is done by all IGMP/MLD packet processing functions and timers. When processing a packet we have RCU so the vlan memory won't be freed, but if the flag is missing we must not process it. The timers are synchronized in the same way with the addition of waiting for them to finish in case they are running after removing the flag under multicast_lock (i.e. they were waiting for the lock). Multicast vlan snooping requires vlan filtering to be enabled, if it's disabled then snooping gets automatically disabled, too. BR_VLFLAG_GLOBAL_MCAST_ENABLED controls if a vlan has BR_VLFLAG_MCAST_ENABLED set which is used in all vlan disabled checks. We need both flags because one is controlled by user-space globally (BR_VLFLAG_GLOBAL_MCAST_ENABLED) and the other is for a particular bridge/vlan or port/vlan entry (BR_VLFLAG_MCAST_ENABLED). Since the latter is also used for synchronization between the multicast and vlan code, and also controlled by BR_VLFLAG_GLOBAL_MCAST_ENABLED we rely on it when checking if a vlan context is disabled. The multicast fast-path has 3 new bit tests on the cache-hot bridge flags field, I didn't observe any measurable difference. I haven't forced either context options to be always disabled when the other type is enabled because the state consists of timers which either expire (router) or don't affect the normal operation. Some options, like the mcast querier one, won't be allowed to change for the disabled context type, that will come with a future patch-set which adds per-vlan querier control. Another important addition is the global vlan options, so far we had only per bridge/port vlan options but in order to control vlan multicast snooping globally we need to add a new type of global vlan options. They can be changed only on the bridge device and are dumped only when a special flag is set in the dump request. The first global option is vlan mcast snooping control, it controls the vlan BR_VLFLAG_GLOBAL_MCAST_ENABLED private flag. It can be set only on master vlan entries. There will be many more global vlan options in the future both for multicast config and other per-vlan options (e.g. STP). There's a lot of room for improvements, I'll do some of the initial ones but splitting the state to different contexts opens the door for a lot more. Also any new multicast options become vlan-supported with very little to no effort by using the same contexts. Short patch description: patches 01-04: initial mcast context add, no functional changes patch 05: adds vlan mcast init and control helpers and uses them on vlan create/destroy patch 06: adds a global bridge mcast vlan snooping knob (default off) patches 07-08: add a helper for users which must derive the contexts based on current bridge and vlan options (e.g. timers) patch 09: adds checks for disabled vlan contexts in packet processing and timers patch 10: adds support for per-vlan querier and tagged queries patch 11: adds router port vlan id in the notifications patches 12-14: add global vlan options support (change, dump, notify) patch 15: adds per-vlan global mcast snooping control Future patch-sets which build on this one (in order): - vlan state mcast handling - user-space mdb contexts (currently only the bridge contexts are used there) - all bridge multicast config options added per-vlan global and per vlan/port - iproute2 support for all the new uAPIs - selftests This set has been stress-tested (deleting/adding ports/vlans while changing vlan mcast snooping while processing IGMP/MLD packets), and also has passed all bridge self-tests. I'm sending this set as early as possible since there're a few more related sets that should go in the same release to get proper and full mcast vlan snooping support. ==================== Signed-off-by: David S. Miller commit 9dee572c384846f4ece029ab5688faed0682e48a Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:37 2021 +0300 net: bridge: vlan: add mcast snooping control Add a new global vlan option which controls whether multicast snooping is enabled or disabled for a single vlan. It controls the vlan private flag: BR_VLFLAG_GLOBAL_MCAST_ENABLED. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 9aba624d7cb23bdfda6c8ef74bdf001e12641697 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:36 2021 +0300 net: bridge: vlan: notify when global options change Add support for global options notifications. They use only RTM_NEWVLAN since global options can only be set and are contained in a separate vlan global options attribute. Notifications are compressed in ranges where possible, i.e. the sequential vlan options are equal. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 743a53d9636aad83da63a8638e8365e817ef6365 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:35 2021 +0300 net: bridge: vlan: add support for dumping global vlan options Add a new vlan options dump flag which causes only global vlan options to be dumped. The dumps are done only with bridge devices, ports are ignored. They support vlan compression if the options in sequential vlans are equal (currently always true). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 47ecd2dbd8ec43125ea75d7d2e73c888cda8663f Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:34 2021 +0300 net: bridge: vlan: add support for global options We can have two types of vlan options depending on context: - per-device vlan options (split in per-bridge and per-port) - global vlan options The second type wasn't supported in the bridge until now, but we need them for per-vlan multicast support, per-vlan STP support and other options which require global vlan context. They are contained in the global bridge vlan context even if the vlan is not configured on the bridge device itself. This patch adds initial netlink attributes and support for setting these global vlan options, they can only be set (RTM_NEWVLAN) and the operation must use the bridge device. Since there are no such options yet it shouldn't have any functional effect. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 1e9ca45662d6bb65fb60d3fbb7737b081d9cffc9 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:33 2021 +0300 net: bridge: multicast: include router port vlan id in notifications Use the port multicast context to check if the router port is a vlan and in case it is include its vlan id in the notification. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 615cc23e6283e143933ecf2bf3645fe0cea5ae6a Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:32 2021 +0300 net: bridge: multicast: add vlan querier and query support Add basic vlan context querier support, if the contexts passed to multicast_alloc_query are vlan then the query will be tagged. Also handle querier start/stop of vlan contexts. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 4cdd0d10f31da9fab65eb6411441ffb71a653997 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:31 2021 +0300 net: bridge: multicast: check if should use vlan mcast ctx Add helpers which check if the current bridge/port multicast context should be used (i.e. they're not disabled) and use them for Rx IGMP/MLD processing, timers and new group addition. It is important for vlans to disable processing of timer/packet after the multicast_lock is obtained if the vlan context doesn't have BR_VLFLAG_MCAST_ENABLED. There are two cases when that flag is missing: - if the vlan is getting destroyed it will be removed and timers will be stopped - if the vlan mcast snooping is being disabled Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit eb1593a0b4c49443acbe2ebaa7a9947fa5471c01 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:30 2021 +0300 net: bridge: multicast: use the port group to port context helper We need to use the new port group to port context helper in places where we cannot pass down the proper context (i.e. functions that can be called by timers or outside the packet snooping paths). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 74edfd483de8010596d556a2339f9fb8a4ab6688 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:29 2021 +0300 net: bridge: multicast: add helper to get port mcast context from port group Add br_multicast_pg_to_port_ctx() which returns the proper port multicast context from either port or vlan based on bridge option and vlan flags. As the comment inside explains the locking is a bit tricky, we rely on the fact that BR_VLFLAG_MCAST_ENABLED requires multicast_lock to change and we also require it to be held to call that helper. If we find the vlan under rcu and it still has the flag then we can be sure it will be alive until we unlock multicast_lock which should be enough. Note that the context might change from vlan to bridge between different calls to this helper as the mcast vlan knob requires only rtnl so it should be used carefully and for read-only/check purposes. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f4b7002a7076f025dce59647a77c8251175d2b34 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:28 2021 +0300 net: bridge: add vlan mcast snooping knob Add a global knob that controls if vlan multicast snooping is enabled. The proper contexts (vlan or bridge-wide) will be chosen based on the knob when processing packets and changing bridge device state. Note that vlans have their individual mcast snooping enabled by default, but this knob is needed to turn on bridge vlan snooping. It is disabled by default. To enable the knob vlan filtering must also be enabled, it doesn't make sense to have vlan mcast snooping without vlan filtering since that would lead to inconsistencies. Disabling vlan filtering will also automatically disable vlan mcast snooping. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 7b54aaaf53cb784411426c64482af0435f7c845e Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:27 2021 +0300 net: bridge: multicast: add vlan state initialization and control Add helpers to enable/disable vlan multicast based on its flags, we need two flags because we need to know if the vlan has multicast enabled globally (user-controlled) and if it has it enabled on the specific device (bridge or port). The new private vlan flags are: - BR_VLFLAG_MCAST_ENABLED: locally enabled multicast on the device, used when removing a vlan, toggling vlan mcast snooping and controlling single vlan (kernel-controlled, valid under RTNL and multicast_lock) - BR_VLFLAG_GLOBAL_MCAST_ENABLED: globally enabled multicast for the vlan, used to control the bridge-wide vlan mcast snooping for a single vlan (user-controlled, can be checked under any context) Bridge vlan contexts are created with multicast snooping enabled by default to be in line with the current bridge snooping defaults. In order to actually activate per vlan snooping and context usage a bridge-wide knob will be added later which will default to disabled. If that knob is enabled then automatically all vlan snooping will be enabled. All vlan contexts are initialized with the current bridge multicast context defaults. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 613d61dbef8eb87aea0be71efc9289beea1a6106 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:26 2021 +0300 net: bridge: vlan: add global and per-port multicast context Add global and per-port vlan multicast context, only initialized but still not used. No functional changes intended. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit adc47037a7d5c8f89ca428bd840c83ab7b62730c Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:25 2021 +0300 net: bridge: multicast: use multicast contexts instead of bridge or port Pass multicast context pointers to multicast functions instead of bridge/port. This would make it easier later to switch these contexts to their per-vlan versions. The patch is basically search and replace, no functional changes. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit d3d065c0032bf7043401e34cec2114fc553f919e Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:24 2021 +0300 net: bridge: multicast: factor out bridge multicast context Factor out the bridge's global multicast context into a separate structure which will later be used for per-vlan global context. No functional changes intended. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 9632233e7de8da43711bb7cd3e054af32fedcc38 Author: Nikolay Aleksandrov Date: Mon Jul 19 20:06:23 2021 +0300 net: bridge: multicast: factor out port multicast context Factor out the port's multicast context into a separate structure which will later be shared for per-port,vlan context. No functional changes intended. We need the structure even if bridge multicast is not defined to pass down as pointer to forwarding functions. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 0555d41497de66d2f07ae36dcb46a32f0ff90d8d Author: ChiYuan Huang Date: Fri Jul 16 16:03:56 2021 +0800 regulator: rtq2134: Add support for Richtek RTQ2134 SubPMIC This adds support for Richtek RTQ2134 SubPMIC. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1626422636-29458-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 4c922fd3d6fa4d51e1f5bb845548cbefd5de3d14 Author: ChiYuan Huang Date: Fri Jul 16 16:03:55 2021 +0800 regulator: rtq2134: Add binding document for Richtek RTQ2134 SubPMIC Add binding document for Richtek RTQ2134 SubPMIC. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1626422636-29458-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 1bd80ff2cfb38582e258baf681211a21d448984f Author: Pierre-Louis Bossart Date: Mon Jul 19 18:32:48 2021 -0500 ASOC: Intel: sof_sdw: add quirk for Intel 'Bishop County' NUC M15 The same quirk is used for LAPBC510 and LAPBC710 skews who use the same audio design, with an RT711 headset codec using JD1 mode and one RT1308 amplifier, along with 4 DMICs. BugLink: https://github.com/thesofproject/linux/issues/3049 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20210719233248.557923-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit edd2e9d586466fa33027541832ad50a300c74227 Author: Kurt Kanzenbach Date: Mon Jul 19 12:16:40 2021 +0200 Revert "igc: Export LEDs" This reverts commit cf8331825a8d10e46fa574fdf015a65cb5a6db86. There are better Linux interfaces to export the different LED modes and blinking reasons. Revert this patch for now and come up with better solution later. Suggested-by: Andrew Lunn Signed-off-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20210719101640.16047-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski commit d64519249e1d5520e8420936d662ec2cfb155dfc Author: Chanho Park Date: Fri Jul 9 18:45:24 2021 +0900 phy: samsung-ufs: support exynosauto ufs phy driver This patch adds to support phy-exynosautov9-ufs driver for ExynosAuto v9 series SoCs. The patch adds "samsung,exynosautov9-ufs-phy" compatible. Unlike previous exynos ufs phy, the chip uses 0x50 offset as PHY_TRSV_REG_CFG_OFFSET. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210709094524.110193-3-chanho61.park@samsung.com Signed-off-by: Vinod Koul commit b95637e2da155cb3111d008e3c5d641b4dcf5000 Author: Chanho Park Date: Fri Jul 9 18:45:23 2021 +0900 phy: samsung-ufs: move phy-exynos7-ufs header Instead of using exynos7 ufs definition in phy-exynos7-ufs.h, we should put it into phy-exynos7-ufs.c to be included different objects or units. Suggested-by: Krzysztof Kozlowski Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210709094524.110193-2-chanho61.park@samsung.com Signed-off-by: Vinod Koul commit 63c57e8dc7a01303ac020d82b1301602561ec001 Author: Guangming Cao Date: Tue Jul 20 18:31:58 2021 +0800 dma_buf: remove dmabuf sysfs teardown before release Dmabuf sysfs stat is used for dmabuf info track. But these file maybe still in use after buffer released, should clear it before buffer release. Signed-off-by: Guangming Cao Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210720103158.83439-1-guangming.cao@mediatek.com Signed-off-by: Christian König commit 057d445b9ef22c0c17fad46beb82146c9f0574c0 Author: Geert Uytterhoeven Date: Wed Jul 14 11:42:13 2021 +0200 dt-bindings: phy: Rename Intel Keem Bay USB PHY bindings This is the only file not using the "intel,keembay-*" pattern. Fortunately the actual compatible value is already following the standard scheme. Fixes: 4086afa2a1627939 ("dt-bindings: phy: Add Intel Keem Bay USB PHY bindings") Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/r/91235a64185f7446fc58e638d77691078d3114d1.1626255556.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit f839f14e24f27ccb1b822dd52f2ff4db340da52a Author: Bjorn Andersson Date: Mon Jun 28 17:45:09 2021 -0700 phy: qcom-qmp: Add sc8180x PCIe support The Qualcomm SC8180x platform has 4 PCIe controllers and PHYs, typically used to connect things such as a modem or NVME storage device. Add the programming sequence to get the PHYs up and running. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210629004509.1788286-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 05d58bb65607bde24f867d85d27b48c4954e1442 Author: Bjorn Andersson Date: Mon Jun 28 17:45:08 2021 -0700 dt-bindings: phy: qcom,qmp: Add sc8180x PCIe compatible Add a compatible for the sc8180x PCIe PHY. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210629004509.1788286-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit aef7b67a79564f6cff488aff7f4b89438ca80b23 Author: Matthew Auld Date: Thu Jul 15 11:15:34 2021 +0100 drm/i915/uapi: convert drm_i915_gem_userptr to kernel doc Add the missing kernel-doc. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210715101536.2606307-3-matthew.auld@intel.com commit e7737b67ab46ee0eeaa0ca1958f72d86f8d8ccf6 Author: Matthew Auld Date: Thu Jul 15 11:15:33 2021 +0100 drm/i915/uapi: reject caching ioctls for discrete It's a noop on DG1, and in the future when need to support other devices which let us control the coherency, then it should be an immutable creation time property for the BO. This will likely be controlled through a new gem_create_ext extension. v2: add some kernel doc for the discrete changes, and document the implicit rules Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Ramalingam C Reviewed-by: Kenneth Graunke Link: https://patchwork.freedesktop.org/patch/msgid/20210715101536.2606307-2-matthew.auld@intel.com commit e93abb840a2c356ed2809c31fcedb058601ac2e4 Author: Eric Dumazet Date: Mon Jul 19 03:11:07 2021 -0700 net/tcp_fastopen: remove tcp_fastopen_ctx_lock Remove the (per netns) spinlock in favor of xchg() atomic operations. Signed-off-by: Eric Dumazet Cc: Yuchung Cheng Cc: Neal Cardwell Acked-by: Wei Wang Link: https://lore.kernel.org/r/20210719101107.3203943-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit fef773fc8110d8124c73a5e6610f89e52814637d Author: Yajun Deng Date: Mon Jul 19 13:18:16 2021 +0800 netlink: Deal with ESRCH error in nlmsg_notify() Yonghong Song report: The bpf selftest tc_bpf failed with latest bpf-next. The following is the command to run and the result: $ ./test_progs -n 132 [ 40.947571] bpf_testmod: loading out-of-tree module taints kernel. test_tc_bpf:PASS:test_tc_bpf__open_and_load 0 nsec test_tc_bpf:PASS:bpf_tc_hook_create(BPF_TC_INGRESS) 0 nsec test_tc_bpf:PASS:bpf_tc_hook_create invalid hook.attach_point 0 nsec test_tc_bpf_basic:PASS:bpf_obj_get_info_by_fd 0 nsec test_tc_bpf_basic:PASS:bpf_tc_attach 0 nsec test_tc_bpf_basic:PASS:handle set 0 nsec test_tc_bpf_basic:PASS:priority set 0 nsec test_tc_bpf_basic:PASS:prog_id set 0 nsec test_tc_bpf_basic:PASS:bpf_tc_attach replace mode 0 nsec test_tc_bpf_basic:PASS:bpf_tc_query 0 nsec test_tc_bpf_basic:PASS:handle set 0 nsec test_tc_bpf_basic:PASS:priority set 0 nsec test_tc_bpf_basic:PASS:prog_id set 0 nsec libbpf: Kernel error message: Failed to send filter delete notification test_tc_bpf_basic:FAIL:bpf_tc_detach unexpected error: -3 (errno 3) test_tc_bpf:FAIL:test_tc_internal ingress unexpected error: -3 (errno 3) The failure seems due to the commit cfdf0d9ae75b ("rtnetlink: use nlmsg_notify() in rtnetlink_send()") Deal with ESRCH error in nlmsg_notify() even the report variable is zero. Reported-by: Yonghong Song Signed-off-by: Yajun Deng Link: https://lore.kernel.org/r/20210719051816.11762-1-yajun.deng@linux.dev Signed-off-by: Jakub Kicinski commit b46998d81a1d2c961d570397e87a83ef365d2edf Author: Yang Yingliang Date: Thu Jul 15 21:28:45 2021 +0800 drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe() Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() will be called in release automatically. v3: reformat commit message update for move to tiny/ v2: use pcim_enable_device() Signed-off-by: Yang Yingliang Reported-by: Hulk Robot Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210715132845.2415619-1-yangyingliang@huawei.com commit f34bf652d680cf65783e7c57d61c94ee87f092bd Author: KuoHsiang Chou Date: Fri Jul 9 16:09:00 2021 +0800 drm/ast: Disable fast reset after DRAM initial [Bug][AST2500] V1: When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode. V2: Use to_pci_dev() to get revision of PCI configuration. V3: If SCU00 is not unlocked, just enter its password again. It is unnecessary to clear AHB lock condition and restore WDT default setting again, before Fast-reset clearing. V4: repatch after "error : could not build fake ancestor" resolved. V5: Since CVE_2019_6260 item3, Most of AST2500 have disabled P2A(PCIe to AMBA). However, for backward compatibility, some patches about P2A, such as items of v5.2 and v5.3, are considered to be upstreamed with comments. 1. Add define macro to improve source readability. ast_drv.h, ast_main.c, ast_post.c 2. Add comment about "Fast restet" is enabled for ARM-ICE debugger ast_post.c 3. Add comment about Reset USB port to patch USB unknown device issue ast_post.c Signed-off-by: KuoHsiang Chou Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210709080900.4056-1-kuohsiang_chou@aspeedtech.com commit 572994bf18ff4512207164b3643a61909dcaa603 Author: Ainux.Wang Date: Fri Jul 16 09:56:15 2021 +0800 drm/ast: Zero is missing in detect function The function ast_get_modes() will also return 0, when it try to get the edid, but it also do not get the edid. Signed-off-by: Ainux.Wang Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210716015615.9150-1-ainux.wang@gmail.com commit c715def51591a874a9fcfdc9a05d543e8797e697 Author: Hridya Valsaraju Date: Mon Jul 12 21:07:38 2021 -0700 dma-buf: Delete the DMA-BUF attachment sysfs statistics The DMA-BUF attachment statistics form a subset of the DMA-BUF sysfs statistics that recently merged to the drm-misc tree. They are not UABI yet since they have not merged to the upstream Linux kernel. Since there has been a reported a performance regression due to the overhead of sysfs directory creation/teardown during dma_buf_attach()/dma_buf_detach(), this patch deletes the DMA-BUF attachment statistics from sysfs. Fixes: bdb8d06dfefd ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs") Signed-off-by: Hridya Valsaraju Reviewed-by: Christian König Reviewed-by: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/20210713040742.2680135-1-hridya@google.com Signed-off-by: Christian König commit dc22aa130565acc4952a13378c782a95cf82b193 Author: Vandita Kulkarni Date: Tue Jul 20 12:19:07 2021 +0530 drm/i915/display/dsc: Force dsc BPP Set DSC BPP to the value forced through debugfs. It can go from bpc to bpp-1. v2: Use default dsc bpp when we are just doing force_dsc_en, use default dsc bpp for invalid force_dsc_bpp values. (Jani) Signed-off-by: Vandita Kulkarni Reviewed-by: Swati Sharma Link: https://patchwork.freedesktop.org/patch/msgid/20210720064907.9771-4-vandita.kulkarni@intel.com commit da3829ef9992c8e4ff13f622e3597275d9ce5b6d Author: Patnana Venkata Sai Date: Tue Jul 20 12:19:06 2021 +0530 drm/i915/display/dsc: Add Per connector debugfs node for DSC BPP enable This patch creates a per connector debugfs node to expose the Compressed BPP. The same node can be used from userspace to force DSC to a certain BPP(all accepted values). This is useful to verify all supported/requested compression bpp's through IGT v2: Remove unnecessary logic (Jani) v3: Drop pipe bpp in debugfs node (Vandita) v4: Minor cleanups (Vandita) v5: Fix NULL pointer dereference v6: Fix dim tool checkpatch errors Release the lock before return (Vandita) v7: Rename to file to dsc_bpp, remove unwanted dsc bpp range check from v6, permissions (Jani) Cc: Vandita Kulkarni Cc: Navare Manasi D Cc: Jani Nikula Signed-off-by: Anusha Srivatsa Signed-off-by: Patnana Venkata Sai Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210720064907.9771-3-vandita.kulkarni@intel.com commit d77e37063bcee42fac93a1d9fb832493a5efd4c1 Author: Vandita Kulkarni Date: Tue Jul 20 12:19:05 2021 +0530 drm/i915/display: Add write permissions for fec support Though there is a write option available on fec_suport debugfs file, so far it has been registering with read permissions only. Suggested-by: Jani Nikula Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210720064907.9771-2-vandita.kulkarni@intel.com commit d97e99386ad0dcae08cb0f0c70efa806a2d4811c Author: MaYuming Date: Sun Jul 11 10:57:47 2021 +0800 audit: add header protection to kernel/audit.h Protect kernel/audit.h against multiple #include's. Signed-off-by: MaYuming [PM: rewrite subj/description] Signed-off-by: Paul Moore commit f339c7e491a8150d416d4aa657fe379c20fe6b79 Author: Don Brace Date: Wed Jul 14 13:28:47 2021 -0500 scsi: smartpqi: Update version to 2.1.10-020 Link: https://lore.kernel.org/r/20210714182847.50360-10-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Mike McGowen Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Gerry Morong Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 0777a3fb98f0ea546561d04db4fd325248c39961 Author: Mike McGowen Date: Wed Jul 14 13:28:46 2021 -0500 scsi: smartpqi: Fix ISR accessing uninitialized data Correct driver's ISR accessing a data structure member that has not been fully initialized during driver initialization. The pqi queue groups can have uninitialized members when an interrupt fires. This has not resulted in any driver crashes. This was found during our own internal testing. No bugs were ever filed. Link: https://lore.kernel.org/r/20210714182847.50360-9-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Mike McGowen Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 09d9968a8eff8c098149295ebb62a453a862b9c6 Author: Balsundar P Date: Wed Jul 14 13:28:45 2021 -0500 scsi: smartpqi: Add PCI IDs for new ZTE controllers Add support for ZTE RM241-18i 2G device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_5445 Add support for ZTE RM242-18i 4G device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_5446 Add support for ZTE RM243-18i device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_5447 Add support for ZTE SDPSA/B-18i 4G device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_0B27 Add support for ZTE SDPSA/B_I-18i device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_0B29 Add support for ZTE SDPSA/B_L-18i 2G device ID: VID_9005, DID_028F, SVID_1CF2 and SDID_0B45 Link: https://lore.kernel.org/r/20210714182847.50360-8-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Mike McGowen Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Balsundar P Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit e326b97c92ccbe0fa9256902ca0c20e2b6c40168 Author: Mike McGowen Date: Wed Jul 14 13:28:44 2021 -0500 scsi: smartpqi: Add PCI ID for new ntcom controller Add support for Norsi ntcom Raid-24i controller: VID_0x9005, DID_0x028f, SVID_0x1dfc, SDID_0x3161 Link: https://lore.kernel.org/r/20210714182847.50360-7-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Mike McGowen Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit f0e473e0f603bcd4fbbbd2913208aaad8191efec Author: Murthy Bhat Date: Wed Jul 14 13:28:43 2021 -0500 scsi: smartpqi: Add SCSI cmd info for resets Report on SCSI command that has triggered the reset. Also add check for NULL SCSI commands resulting from issuing sg_reset when there is no outstanding commands. Example: sg_reset -d /dev/sgXY smartpqi 0000:39:00.0: resetting scsi 4:0:1:0 due to cmd 0x12 Link: https://lore.kernel.org/r/20210714182847.50360-6-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Mike McGowen Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 8e505fceaa2b7c7841b70ed530167727bb66517b Author: Don Brace Date: Wed Jul 14 13:28:42 2021 -0500 scsi: smartpqi: Change Kconfig menu entry to Microchip Change Microsemi to Microchip. Link: https://lore.kernel.org/r/20210714182847.50360-5-don.brace@microchip.com Reviewed-by: Scott Benesh Reviewed-by: Gerry Morong Reviewed-by: Justin Lindley Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 6aa26b5a2c70ca302718dc0d5db092780e4b6f6c Author: Don Brace Date: Wed Jul 14 13:28:41 2021 -0500 scsi: smartpqi: Change driver module macros to Microchip Change driver module macros to reflect copyright changes: Microsemi to Microchip. Link: https://lore.kernel.org/r/20210714182847.50360-4-don.brace@microchip.com Reviewed-by: Scott Benesh Reviewed-by: Gerry Morong Reviewed-by: Justin Lindley Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 889653ecfc989349bf61736e45695b614d5b64d1 Author: Kevin Barnett Date: Wed Jul 14 13:28:40 2021 -0500 scsi: smartpqi: Update copyright notices Updated copyright notices and company name strings to reflect Microchip ownership. Link: https://lore.kernel.org/r/20210714182847.50360-3-don.brace@microchip.com Reviewed-by: Mike McGowen Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit d3af3f647bd57be2f6a007d12eaf55e20524fb96 Author: Mahesh Rajashekhara Date: Wed Jul 14 13:28:39 2021 -0500 scsi: smartpqi: Add PCI IDs for H3C P4408 controllers Add support for H3C P4408-Ma-8i-2GB device ID: VID_9005, DID_028F, SVID_193D and SDID_1108 VID_9005, DID_028F, SVID_193D and SDID_1109 Link: https://lore.kernel.org/r/20210714182847.50360-2-don.brace@microchip.com Reviewed-by: Kevin Barnett Reviewed-by: Mike McGowen Reviewed-by: Murthy Bhat Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 9de71ede81e6d1a111fdd868b2d78d459fa77f80 Author: Chao Yu Date: Mon Jul 19 16:46:47 2021 +0800 f2fs: quota: fix potential deadlock xfstest generic/587 reports a deadlock issue as below: ====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1 #69 Not tainted ------------------------------------------------------ repquota/8606 is trying to acquire lock: ffff888022ac9320 (&sb->s_type->i_mutex_key#18){+.+.}-{3:3}, at: f2fs_quota_sync+0x207/0x300 [f2fs] but task is already holding lock: ffff8880084bcde8 (&sbi->quota_sem){.+.+}-{3:3}, at: f2fs_quota_sync+0x59/0x300 [f2fs] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sbi->quota_sem){.+.+}-{3:3}: __lock_acquire+0x648/0x10b0 lock_acquire+0x128/0x470 down_read+0x3b/0x2a0 f2fs_quota_sync+0x59/0x300 [f2fs] f2fs_quota_on+0x48/0x100 [f2fs] do_quotactl+0x5e3/0xb30 __x64_sys_quotactl+0x23a/0x4e0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #1 (&sbi->cp_rwsem){++++}-{3:3}: __lock_acquire+0x648/0x10b0 lock_acquire+0x128/0x470 down_read+0x3b/0x2a0 f2fs_unlink+0x353/0x670 [f2fs] vfs_unlink+0x1c7/0x380 do_unlinkat+0x413/0x4b0 __x64_sys_unlinkat+0x50/0xb0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&sb->s_type->i_mutex_key#18){+.+.}-{3:3}: check_prev_add+0xdc/0xb30 validate_chain+0xa67/0xb20 __lock_acquire+0x648/0x10b0 lock_acquire+0x128/0x470 down_write+0x39/0xc0 f2fs_quota_sync+0x207/0x300 [f2fs] do_quotactl+0xaff/0xb30 __x64_sys_quotactl+0x23a/0x4e0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#18 --> &sbi->cp_rwsem --> &sbi->quota_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->quota_sem); lock(&sbi->cp_rwsem); lock(&sbi->quota_sem); lock(&sb->s_type->i_mutex_key#18); *** DEADLOCK *** 3 locks held by repquota/8606: #0: ffff88801efac0e0 (&type->s_umount_key#53){++++}-{3:3}, at: user_get_super+0xd9/0x190 #1: ffff8880084bc380 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_quota_sync+0x3e/0x300 [f2fs] #2: ffff8880084bcde8 (&sbi->quota_sem){.+.+}-{3:3}, at: f2fs_quota_sync+0x59/0x300 [f2fs] stack backtrace: CPU: 6 PID: 8606 Comm: repquota Not tainted 5.14.0-rc1 #69 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 Call Trace: dump_stack_lvl+0xce/0x134 dump_stack+0x17/0x20 print_circular_bug.isra.0.cold+0x239/0x253 check_noncircular+0x1be/0x1f0 check_prev_add+0xdc/0xb30 validate_chain+0xa67/0xb20 __lock_acquire+0x648/0x10b0 lock_acquire+0x128/0x470 down_write+0x39/0xc0 f2fs_quota_sync+0x207/0x300 [f2fs] do_quotactl+0xaff/0xb30 __x64_sys_quotactl+0x23a/0x4e0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f883b0b4efe The root cause is ABBA deadlock of inode lock and cp_rwsem, reorder locks in f2fs_quota_sync() as below to fix this issue: - lock inode - lock cp_rwsem - lock quota_sem Fixes: db6ec53b7e03 ("f2fs: add a rw_sem to cover quota flag changes") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1ffc8f5f7751f91fe6af527d426a723231b741a6 Author: Jaegeuk Kim Date: Wed Jul 14 16:14:02 2021 -0700 f2fs: let's keep writing IOs on SBI_NEED_FSCK SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK, but do keep OPU. Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal") Cc: # v5.13+ Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 08f71a1e39a1f07a464ac782d9b612d6a74c7015 Author: Martynas Pumputis Date: Mon Jul 19 19:38:38 2021 +0200 selftests/bpf: Check inner map deletion Add a test case to check whether an unsuccessful creation of an outer map of a BTF-defined map-in-map destroys the inner map. As bpf_object__create_map() is a static function, we cannot just call it from the test case and then check whether a map accessible via map->inner_map_fd has been closed. Instead, we iterate over all maps and check whether the map "$MAP_NAME.inner" does not exist. Signed-off-by: Martynas Pumputis Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210719173838.423148-3-m@lambda.lt commit a21ab4c59e09c2a9994a6e393b7484e3b3f78a99 Author: Martynas Pumputis Date: Mon Jul 19 19:38:37 2021 +0200 libbpf: Fix removal of inner map in bpf_object__create_map If creating an outer map of a BTF-defined map-in-map fails (via bpf_object__create_map()), then the previously created its inner map won't be destroyed. Fix this by ensuring that the destroy routines are not bypassed in the case of a failure. Fixes: 646f02ffdd49c ("libbpf: Add BTF-defined map-in-map support") Reported-by: Andrii Nakryiko Signed-off-by: Martynas Pumputis Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210719173838.423148-2-m@lambda.lt commit 18785c94ab6357338cf4aa872aabacbcc7178e83 Author: Iskren Chernev Date: Sun Jun 27 21:59:27 2021 +0300 drivers: soc: qcom: rpmpd: Add SM6115 RPM Power Domains The SM4250/6115 have 4 rpm power domains, ported from downstream DT. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20210627185927.695411-6-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 49a22c4a7136d257d80b9863093a8e66eeb06baa Author: Iskren Chernev Date: Sun Jun 27 21:59:26 2021 +0300 dt-bindings: power: rpmpd: Add SM6115 to rpmpd binding Add compatible and constants for the power domains exposed by the RPM in the Qualcomm SM4250/6115 platforms. Signed-off-by: Iskren Chernev Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210627185927.695411-5-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 133b6558c75566bf692460fd1a09b3b795ef2c1a Author: Andy Shevchenko Date: Mon Jul 19 14:56:57 2021 -0700 Input: parkbd - switch to use module_parport_driver() Switch to use module_parport_driver() to reduce boilerplate code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210616140432.39406-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov commit 1c14c1695e78f63a93a1347e15a6e363d7325b43 Author: Mauro Carvalho Chehab Date: Sun Jul 18 13:40:51 2021 +0200 dt-bindings: PCI: remove designware-pcie.txt Now that the properties defined there were converted to DT schema, and the other dt-bindings are pointing to the new schemas, drop it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c93261b41f9ffe8d97d8c930f57b41aaf7de5264.1626608375.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 320e10986ef7eda166891493d1f6ff1564dd6275 Author: Mauro Carvalho Chehab Date: Sun Jul 18 13:40:50 2021 +0200 dt-bindings: PCI: update references to Designware schema Now that its contents were converted to a DT schema, replace the references for the old file on existing properties. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/dfff4d94631546c53450d1baeddc694dd26b5c36.1626608375.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 0f8b97d8f6021c525bc5fa7e4927401a39086c9f Author: Mauro Carvalho Chehab Date: Sun Jul 18 13:40:49 2021 +0200 dt-bindings: PCI: add snps,dw-pcie-ep.yaml Currently, the designware schema is defined on a text file: designware-pcie.txt It contains two separate schemas on it: - snps,dw-pcie This one uses the pci-bus.yaml schema; - snps,dw-pcie-ep This one uses the pci-ep.yaml schema. As the: AllOf: - $ref: for the endpoint part is different than the PCI one, place it on a separate yaml file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/26025b256232c2e4bd91954907b9d92db27199a3.1626608375.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 42694f9f6407a933ce0880e12c2aaef01073ec28 Author: Mauro Carvalho Chehab Date: Sun Jul 18 13:40:48 2021 +0200 dt-bindings: PCI: add snps,dw-pcie.yaml Currently, the designware schema is defined on a text file: designware-pcie.txt Convert the pci-bus part into a schema. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/53363a7609176ca56c47ef57287466ee84087dc5.1626608375.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 81c7c0a350bfe9306ad9fb10356534ede8f4ab31 Author: Dmitry Torokhov Date: Mon Jul 19 14:34:40 2021 -0700 Input: serio - make write method mandatory Given that all serio drivers except one implement write() method let's make it mandatory to avoid testing for its presence whenever we attempt to use it. Link: https://lore.kernel.org/r/YFgUxG/TljMuVeQ3@google.com Signed-off-by: Dmitry Torokhov commit 9aa75914e5fcb39e79fc6de9e44cd12943732c38 Author: Linus Walleij Date: Wed Jul 14 12:11:02 2021 -0700 Input: ixp4xx-beeper - delete driver The NSLU2 has been migrated to devicetree and there we use the gpio-beeper.c driver instead, the boardfile will be deleted for kernel v5.15 so drop this custom and now unneeded driver. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210714115028.916360-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 613ba71619cfe0e0a4b855aa1a2e337fab2dd416 Author: Thomas Zimmermann Date: Thu Jul 15 12:02:58 2021 +0200 drm/ingenic: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. This patch also fixes a bug where the driver didn't release the IRQ. v2: * automatically release IRQ via devm_request_irq() (Paul) * mention the bugfix (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20210715100258.6638-1-tzimmermann@suse.de commit d3625d94490e4c2d95febe3eafcc11e606eabb0c Author: Iskren Chernev Date: Sun Jun 27 21:59:23 2021 +0300 dt-bindings: soc: qcom: smd-rpm: Add SM6115 compatible Add the dt-binding for the rpm on the Qualcomm SM4250/6115 SoC platform. Signed-off-by: Iskren Chernev Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210627185927.695411-2-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit a89f355e469dcda129c2522be4fdba00c1c74c83 Author: Manivannan Sadhasivam Date: Tue Jun 29 21:02:49 2021 +0530 soc: qcom: aoss: Fix the out of bound usage of cooling_devs In "qmp_cooling_devices_register", the count value is initially QMP_NUM_COOLING_RESOURCES, which is 2. Based on the initial count value, the memory for cooling_devs is allocated. Then while calling the "qmp_cooling_device_add" function, count value is post-incremented for each child node. This makes the out of bound access to the cooling_dev array. Fix it by passing the QMP_NUM_COOLING_RESOURCES definition to devm_kzalloc() and initializing the count to 0. While at it, let's also free the memory allocated to cooling_dev if no cooling device is found in DT and during unroll phase. Cc: stable@vger.kernel.org # 5.4 Fixes: 05589b30b21a ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210629153249.73428-1-manivannan.sadhasivam@linaro.org Signed-off-by: Bjorn Andersson commit b42000e4b8741bf6591fcbbbefff6aa745f8eb29 Author: John Stultz Date: Wed Jul 7 04:53:20 2021 +0000 firmware: qcom_scm: Allow qcom_scm driver to be loadable as a permenent module Allow the qcom_scm driver to be loadable as a permenent module. This still uses the "depends on QCOM_SCM || !QCOM_SCM" bit to ensure that drivers that call into the qcom_scm driver are also built as modules. While not ideal in some cases its the only safe way I can find to avoid build errors without having those drivers select QCOM_SCM and have to force it on (as QCOM_SCM=n can be valid for those drivers). Reviving this now that Saravana's fw_devlink defaults to on, which should avoid loading troubles seen before. Acked-by: Kalle Valo Acked-by: Greg Kroah-Hartman Acked-by: Will Deacon Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz Link: https://lore.kernel.org/r/20210707045320.529186-1-john.stultz@linaro.org Signed-off-by: Bjorn Andersson commit 0d361b0ac1ad99ecbe401a4eacdeb844dcdf86a2 Author: Stephen Boyd Date: Sun Jun 27 20:01:50 2021 -0700 soc: qcom: socinfo: Don't print anything if nothing found Let's skip printing anything if there's nothing to see. This makes it so the file length is 0 instead of 1, for the newline, and helps scripts figure out if there's anything to see in these files. Cc: Sai Prakash Ranjan Cc: Douglas Anderson Cc: Dmitry Baryshkov Reviewed-by: Douglas Anderson Reviewed-by: Sai Prakash Ranjan Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20210628030150.2627905-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit d43b3a989bc8c06fd4bbb69a7500d180db2d68e8 Author: Bjorn Andersson Date: Fri Jul 2 17:54:15 2021 -0700 soc: qcom: rpmhpd: Use corner in power_off rpmhpd_aggregate_corner() takes a corner as parameter, but in rpmhpd_power_off() the code requests the level of the first corner instead. In all (known) current cases the first corner has level 0, so this change should be a nop, but in case that there's a power domain with a non-zero lowest level this makes sure that rpmhpd_power_off() actually requests the lowest level - which is the closest to "power off" we can get. While touching the code, also skip the unnecessary zero-initialization of "ret". Fixes: 279b7e8a62cc ("soc: qcom: rpmhpd: Add RPMh power domain driver") Reviewed-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Sibi Sankar Tested-by: Sibi Sankar Link: https://lore.kernel.org/r/20210703005416.2668319-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit d63486dd8e0bf843949c184843137e03bca5b8b4 Author: Bjorn Andersson Date: Fri Jul 9 10:41:42 2021 -0700 soc: qcom: aoss: Add generic compatible It seems we don't need platform specific implementation for the AOSS QMP, so let's introduce a generic compatible to avoid having to update the driver for each platform. Reviewed-by: Sibi Sankar Tested-by: Sibi Sankar Link: https://lore.kernel.org/r/20210709174142.1274554-4-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 44dadfbcd992829515c80ff7d1bbab73cd321a3f Author: Bjorn Andersson Date: Fri Jul 9 10:41:41 2021 -0700 dt-bindings: soc: qcom: aoss: Convert to YAML Convert to YAML in order to allow validation. Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210709174142.1274554-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit e9ad5da25002772436c968309d6dbeaf31c91404 Author: Bjorn Andersson Date: Fri Jul 9 10:41:40 2021 -0700 dt-bindings: soc: qcom: aoss: Add SC8180X and generic compatible Add a generic compatible for all versions of the AOSS QMP to the binding, in order to allow a single implementation for them and then add a specific compatible for the Qualcomm SC8180x platform. Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210709174142.1274554-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 537fd19738eb4d32ed15dda12ecf256422fcf44a Author: Bartosz Dudziak Date: Sun Apr 18 14:29:09 2021 +0200 ARM: dts: qcom: Add initial DTS file for Samsung Galaxy S III Neo phone Add DTS support for the Samsung Galaxy S III Neo (codenamed s3ve3g) phone. Initial version have just a working serial console. Signed-off-by: Bartosz Dudziak Link: https://lore.kernel.org/r/20210418122909.71434-6-bartosz.dudziak@snejp.pl Signed-off-by: Bjorn Andersson commit ef537057c298d9abe42dae4da21198ef9f23ade2 Author: Bartosz Dudziak Date: Sun Apr 18 14:29:08 2021 +0200 dt-bindings: arm: qcom: Document MSM8226 SoC binding Document the MSM8226 SoC device-tree binding. Signed-off-by: Bartosz Dudziak Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210418122909.71434-5-bartosz.dudziak@snejp.pl Signed-off-by: Bjorn Andersson commit 8927b678766d7bc8e4db513a87dc97f6b50aa236 Author: Bartosz Dudziak Date: Sun Apr 18 14:29:07 2021 +0200 ARM: dts: qcom: Add support for MSM8226 SoC Implement basic device tree support for MSM8226 SoC which belongs to the Snapdragon 400 family. For now, this file adds the basic nodes like gcc, pinctrl and other required configuration for booting up to the serial console. Signed-off-by: Bartosz Dudziak Link: https://lore.kernel.org/r/20210418122909.71434-4-bartosz.dudziak@snejp.pl Signed-off-by: Bjorn Andersson commit 2bc7a025277f794b304a665e9c2048f8020bd391 Author: Geert Uytterhoeven Date: Thu Jul 1 14:02:20 2021 +0200 ARM: dts: qcom: apq8060: Correct Ethernet node name and drop bogus irq property make dtbs_check: ethernet-ebi2@2,0: $nodename:0: 'ethernet-ebi2@2,0' does not match '^ethernet(@.*)?$' ethernet-ebi2@2,0: 'smsc,irq-active-low' does not match any of the regexes: 'pinctrl-[0-9]+' There is no "smsc,irq-active-low" property, as active low is the default. Signed-off-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/d58c8323c3d544f91f7e4585a5b163bc374397d1.1625140615.git.geert+renesas@glider.be Signed-off-by: Bjorn Andersson commit 0189cb57b96ff92f75e3680b3710a46dacd6509f Author: Xiyu Yang Date: Mon Jul 19 13:59:45 2021 +0800 fbmem: Convert from atomic_t to refcount_t on fb_info->count refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1626674392-55857-1-git-send-email-xiyuyang19@fudan.edu.cn commit a8c7f3100e708d5f55692f0607ca80c5dcd21ce8 Author: Judy Hsiao Date: Thu Jul 8 17:08:10 2021 +0800 arm64: dts: qcom: sc7180: Set adau wakeup delay to 80 ms Set audu wakeup delay to 80 ms for fixing pop noise during capture begin. Fixes: ba5f9b5d7ff3 ("arm64: dts: qcom: sc7180: Add wakeup delay for adau codec") Signed-off-by: Judy Hsiao Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210708090810.174767-1-judyhsiao@chromium.org Signed-off-by: Bjorn Andersson commit b7d9750272d1cf000d052498c67c695615d1af39 Author: Stephan Gerhold Date: Mon Jul 12 15:37:35 2021 +0200 arm64: dts: qcom: msm8916-wingtech-wt88047: Add IMU The Xiaomi Redmi 2 has an InvenSense MPU-6880 supported by the inv_mpu6050 driver in Linux. Add it to the device tree. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712133735.318250-4-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit f9af9f61b095733e399f871beb5df5dffc37dddf Author: Stephan Gerhold Date: Mon Jul 12 15:37:34 2021 +0200 arm64: dts: qcom: msm8916-wingtech-wt88047: Add notification LED The Xiaomi Redmi 2 has a notification LED connected to an Awinic AW2013 controller, add it to the device tree. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712133735.318250-3-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 678b0fcc77c3f3662ac102ab8c69a23bfbcc1c84 Author: Stephan Gerhold Date: Mon Jul 12 15:37:33 2021 +0200 arm64: dts: qcom: msm8916-wingtech-wt88047: Add touchscreen The Xiaomi Redmi 2 has a FocalTech touchscreen. The exact model is not mentioned anywhere, but it works just fine with the mainline edt-ft5x06 driver when using the "edt,edt-ft5506" compatible. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712133735.318250-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit a9ff4e16585c9f6f9d06eefc525334b0c6a66b39 Author: Stephan Gerhold Date: Mon Jul 12 15:37:32 2021 +0200 arm64: dts: qcom: Add device tree for Xiaomi Redmi 2 (wingtech-wt88047) The Xiaomi Redmi 2 is a MSM8916 smartphone that was made by Wingtech (codename: wt88047). It's fairly similar to the other MSM8916 devices. The device tree contains initial support for the Xiaomi Redmi 2 with: - UART (untested, probably available via some test points) - eMMC/SD card - Buttons - Vibrator - WiFi/Bluetooth (WCNSS) - USB Note that the Xiaomi Redmi 2 is available in variants with different names (e.g. Redmi 2 Prime, Redmi 2 Pro, ...). As far as I know the main difference between those is the amount of RAM and supported LTE bands. This difference is automatically handled by bootloader/modem firmware so there is no need for separate device trees. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20210712133735.318250-1-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 2b6187abafeac92c36da11841d899e446eaaba67 Author: Thara Gopinath Date: Wed Jul 14 14:26:10 2021 -0400 arm64: dts: qcom: sm8150: Add CPU opp tables Add OPP tables to scale DDR and L3 with CPUs for SM8150 SoCs. This gives a significant performance boost for cpu-ddr loads. Below is the results for mbw benchmark with and without the opp tables. /mbw 1500 Without l3/ddr scaling With l3 ddr/scaling MEMCPY(MiB/s) 3574 10448 DUMB(MiB/s) 3500 11721 MCBLOCK(MiB/s) 8976 23595 Signed-off-by: Thara Gopinath Link: https://lore.kernel.org/r/20210714182610.92972-1-thara.gopinath@linaro.org Signed-off-by: Bjorn Andersson commit 6df9102f19bc3b51596f6d47f9b03fd36c5eb8e0 Author: Gokul Sriram Palanisamy Date: Sat Jan 30 10:50:12 2021 +0530 arm64: dts: qcom: ipq8074: Add scm on IPQ8074 SoCs Enables scm support, clock is not needed for enabling scm interface. Signed-off-by: Gokul Sriram Palanisamy Signed-off-by: Sricharan R Link: https://lore.kernel.org/r/1611984013-10201-9-git-send-email-gokulsri@codeaurora.org Signed-off-by: Bjorn Andersson commit af5f967c72d1e655d1f7f135b977bac883ab5757 Author: Gokul Sriram Palanisamy Date: Fri Jan 29 22:42:00 2021 +0530 arm64: dts: qcom: ipq6018: Update WCSS PIL driver compatible Updated WCSS PIL driver node with IPQ6018 specific compatible to enable SoC specific driver data. Signed-off-by: Gokul Sriram Palanisamy Link: https://lore.kernel.org/r/1611940320-24830-4-git-send-email-gokulsri@codeaurora.org Signed-off-by: Bjorn Andersson commit e1746c6d3e4bc516bfdce6946720c512a4e27e19 Author: Kathiravan T Date: Wed Jan 27 16:20:29 2021 +0200 arm64: dts: qcom: ipq6018: enable USB2 support Signed-off-by: Kathiravan T [baruch: adjust regs address/size; drop binding updates; drop unsupported quirk properties] Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/59a0d43f34b69406cd320f16edc4e7fabe022bfd.1611756920.git.baruch@tkos.co.il Signed-off-by: Bjorn Andersson commit f1b7e8976668075e6215191680cfb6a194b3c2ce Author: Kuogee Hsieh Date: Thu Jun 3 15:22:19 2021 -0700 arm64: dts: qcom: sc7180: Add DisplayPort node Add DP device node on sc7180. Signed-off-by: Kuogee Hsieh Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1622758940-13485-1-git-send-email-khsieh@codeaurora.org Signed-off-by: Bjorn Andersson commit 10d0786b39b3b91c4fbf8c2926e97ab456a4eea1 Author: Jia Yang Date: Wed Jul 14 15:46:06 2021 +0800 f2fs: Revert "f2fs: Fix indefinite loop in f2fs_gc() v1" This reverts commit 957fa47823dfe449c5a15a944e4e7a299a6601db. The patch "f2fs: Fix indefinite loop in f2fs_gc()" v1 and v4 are all merged. Patch v4 is test info for patch v1. Patch v1 doesn't work and may cause that sbi->cur_victim_sec can't be resetted to NULL_SEGNO, which makes SSR unable to get segment of sbi->cur_victim_sec. So it should be reverted. The mails record: [1] https://lore.kernel.org/linux-f2fs-devel/7288dcd4-b168-7656-d1af-7e2cafa4f720@huawei.com/T/ [2] https://lore.kernel.org/linux-f2fs-devel/20190809153653.GD93481@jaegeuk-macbookpro.roam.corp.google.com/T/ Signed-off-by: Jia Yang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 98a65439172dc69cb16834e62e852afc2adb83ed Author: Zheyu Ma Date: Wed Jul 14 04:09:22 2021 +0000 video: fbdev: kyro: fix a DoS bug by restricting user input The user can pass in any value to the driver through the 'ioctl' interface. The driver dost not check, which may cause DoS bugs. The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:SetOverlayViewPort+0x133/0x5f0 drivers/video/fbdev/kyro/STG4000OverlayDevice.c:476 Call Trace: kyro_dev_overlay_viewport_set drivers/video/fbdev/kyro/fbdev.c:378 [inline] kyrofb_ioctl+0x2eb/0x330 drivers/video/fbdev/kyro/fbdev.c:603 do_fb_ioctl+0x1f3/0x700 drivers/video/fbdev/core/fbmem.c:1171 fb_ioctl+0xeb/0x130 drivers/video/fbdev/core/fbmem.c:1185 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x19b/0x220 fs/ioctl.c:739 do_syscall_64+0x32/0x80 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Signed-off-by: Zheyu Ma Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1626235762-2590-1-git-send-email-zheyuma97@gmail.com commit 62699b3f0a62435fceb8debf295e90a5ea259e04 Author: Alexander Aring Date: Fri Jul 16 16:22:45 2021 -0400 fs: dlm: move receive loop into receive handler This patch moves the kernel_recvmsg() loop call into the receive_from_sock() function instead of doing the loop outside the function and abort the loop over it's return value. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c51b0221798b695ac1beac6597d3a0acf039384b Author: Alexander Aring Date: Fri Jul 16 16:22:44 2021 -0400 fs: dlm: fix multiple empty writequeue alloc This patch will add a mutex that a connection can allocate a writequeue entry buffer only at a sleepable context at one time. If multiple caller waits at the writequeue spinlock and the spinlock gets release it could be that multiple new writequeue page buffers were allocated instead of allocate one writequeue page buffer and other waiters will use remaining buffer of it. It will only be the case for sleepable context which is the common case. In non-sleepable contexts like retransmission we just don't care about such behaviour. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 8728a455d20ddadecd767337475fc1371e031d79 Author: Alexander Aring Date: Fri Jul 16 16:22:43 2021 -0400 fs: dlm: generic connect func This patch adds a generic connect function for TCP and SCTP. If the connect functionality differs from each other additional callbacks in dlm_proto_ops were added. The sockopts callback handling will guarantee that sockets created by connect() will use the same options as sockets created by accept(). Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 90d21fc0479dc0b5d338d664ddb55e5017b44f3e Author: Alexander Aring Date: Fri Jul 16 16:22:42 2021 -0400 fs: dlm: auto load sctp module This patch adds a "for now" better handling of missing SCTP support in the kernel and try to load the sctp module if SCTP is set. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2dc6b1158c28c3a5e86d162628810312f98d5e97 Author: Alexander Aring Date: Fri Jul 16 16:22:41 2021 -0400 fs: dlm: introduce generic listen This patch combines each transport layer listen functionality into one listen function. Per transport layer differences are provided by additional callbacks in dlm_proto_ops. This patch drops silently sock_set_keepalive() for listen tcp sockets only. This socket option is not set at connecting sockets, I also don't see the sense of set keepalive for sockets which are created by accept() only. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a66c008cd16a122e340d48f01ddf8cd768368717 Author: Alexander Aring Date: Fri Jul 16 16:22:40 2021 -0400 fs: dlm: move to static proto ops This patch moves the per transport socket callbacks to a static const array. We can support only one transport socket for the init namespace which will be determinted by reading the dlm config at lowcomms_start(). Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 66d5955a098d504b5a34c35d56a967c536264673 Author: Alexander Aring Date: Fri Jul 16 16:22:39 2021 -0400 fs: dlm: introduce con_next_wq helper This patch introduce a function to determine if something is ready to being send in the writequeue. It's not just that the writequeue is not empty additional the first entry need to have a valid length field. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 88aa023a2556aae92664f135eae794be9449e4f3 Author: Alexander Aring Date: Fri Jul 16 16:22:38 2021 -0400 fs: dlm: cleanup and remove _send_rcom The _send_rcom() can be removed and we call directly dlm_rcom_out(). As we doing that we removing the struct dlm_ls parameter which isn't used. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 052849beeab02306d1420d03da959e7db883b375 Author: Alexander Aring Date: Fri Jul 16 16:22:37 2021 -0400 fs: dlm: clear CF_APP_LIMITED on close If send_to_sock() sets CF_APP_LIMITED limited bit and it has not been cleared by a waiting lowcomms_write_space() yet and a close_connection() apprears we should clear the CF_APP_LIMITED bit again because the connection starts from a new state again at reconnect. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit b892e4792c992a0d5a272c3bdd6155bf772acfa7 Author: Alexander Aring Date: Fri Jul 16 16:22:36 2021 -0400 fs: dlm: fix typo in tlv prefix This patch fixes a small typo in a unused struct field. It should named be t_pad instead of o_pad. Came over this as I updated wireshark dissector. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d921a23f3e1a703875db436cc7cdb4404cf1565f Author: Alexander Aring Date: Fri Jul 16 16:22:35 2021 -0400 fs: dlm: use READ_ONCE for config var This patch will use READ_ONCE to signal the compiler to read this variable only one time. If we don't do that it could be that the compiler read this value more than one time, because some optimizations, from the configure data which might can be changed during this time. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit feb704bd17786c8ff52a49d7759b8ee4f3a5aaac Author: Alexander Aring Date: Fri Jul 16 16:22:34 2021 -0400 fs: dlm: use sk->sk_socket instead of con->sock Instead of dereference "con->sock" we can get the socket structure over "sk->sk_socket" as well. This patch will switch to this behaviour. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 0dc6c59892ead17a9febd11202c9f6794aac1895 Author: David Heidelberg Date: Wed Jul 7 15:14:53 2021 +0200 ARM: dts: qcom: apq8064: correct clock names Since new code doesn't take old clk names in account, it does fixes error: msm_dsi 4700000.mdss_dsi: dev_pm_opp_set_clkname: Couldn't find clock: -2 and following kernel oops introduced by b0530eb1191 ("drm/msm/dpu: Use OPP API to set clk/perf state"). Also removes warning about deprecated clock names. Tested against linux-5.10.y LTS on Nexus 7 2013. Reviewed-by: Brian Masney Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20210707131453.24041-1-david@ixit.cz Signed-off-by: Bjorn Andersson commit 66cb47d40e503c64d8ff21b1d4718f6d246925c4 Author: Alexey Minnekhanov Date: Sat Jul 10 11:55:08 2021 +0300 ARM: dts: qcom: msm8974-klte: Enable remote processors Override power supplies to proper ones, thus enabling to power on ADSP and modem remoteprocs. Signed-off-by: Alexey Minnekhanov Link: https://lore.kernel.org/r/20210710085509.105320-1-alexeymin@postmarketos.org Signed-off-by: Bjorn Andersson commit cfb4dac1296472a75ec8ae813c9ab8764bbb0ca2 Merge: bd9616996bb8c 2b2d4dfca4e7c Author: Mark Brown Date: Mon Jul 19 17:21:24 2021 +0100 Merge series "spi: fsi: Reduce max transfer size to 8 bytes" from Eddie James : The security restrictions on the FSI-attached SPI controllers have been applied universally to all controllers, so the controller can no longer transfer more than 8 bytes for one transfer. Refactor the driver to remove the looping and support for larger transfers, and remove the "restricted" compatible string, as all the controllers are now considered restricted. Eddie James (2): spi: fsi: Reduce max transfer size to 8 bytes dt-bindings: fsi: Remove ibm,fsi2spi-restricted compatible .../devicetree/bindings/fsi/ibm,fsi2spi.yaml | 1 - drivers/spi/spi-fsi.c | 125 +++--------------- 2 files changed, 22 insertions(+), 104 deletions(-) -- 2.27.0 commit 226d528512cfac890a1619aea4301f3dd314fe60 Author: Stefan Assmann Date: Tue Mar 16 11:01:41 2021 +0100 iavf: fix locking of critical sections To avoid races between iavf_init_task(), iavf_reset_task(), iavf_watchdog_task(), iavf_adminq_task() as well as the shutdown and remove functions more locking is required. The current protection by __IAVF_IN_CRITICAL_TASK is needed in additional places. - The reset task performs state transitions, therefore needs locking. - The adminq task acts on replies from the PF in iavf_virtchnl_completion() which may alter the states. - The init task is not only run during probe but also if a VF gets stuck to reinitialize it. - The shutdown function performs a state transition. - The remove function performs a state transition and also free's resources. iavf_lock_timeout() is introduced to avoid waiting infinitely and cause a deadlock. Rather unlock and print a warning. Signed-off-by: Stefan Assmann Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 22c8fd71d3a5e6fe584ccc2c1e8760e5baefd5aa Author: Stefan Assmann Date: Fri Mar 5 13:38:56 2021 +0100 iavf: do not override the adapter state in the watchdog task The iavf watchdog task overrides adapter->state to __IAVF_RESETTING when it detects a pending reset. Then schedules iavf_reset_task() which takes care of the reset. The reset task is capable of handling the reset without changing adapter->state. In fact we lose the state information when the watchdog task prematurely changes the adapter state. This may lead to a crash if instead of the reset task the iavf_remove() function gets called before the reset task. In that case (if we were in state __IAVF_RUNNING previously) the iavf_remove() function triggers iavf_close() which fails to close the device because of the incorrect state information. This may result in a crash due to pending interrupts. kernel BUG at drivers/pci/msi.c:357! [...] Call Trace: [] pci_disable_msix+0x3d/0x50 [] iavf_reset_interrupt_capability+0x23/0x40 [iavf] [] iavf_remove+0x10a/0x350 [iavf] [] pci_device_remove+0x39/0xc0 [] __device_release_driver+0x7f/0xf0 [] device_release_driver+0x23/0x30 [] pci_stop_bus_device+0x84/0xa0 [] pci_stop_and_remove_bus_device+0x12/0x20 [] pci_iov_remove_virtfn+0xaf/0x160 [] sriov_disable+0x3c/0xf0 [] pci_disable_sriov+0x23/0x30 [] i40e_free_vfs+0x265/0x2d0 [i40e] [] i40e_pci_sriov_configure+0x144/0x1f0 [i40e] [] sriov_numvfs_store+0x177/0x1d0 Code: 00 00 e8 3c 25 e3 ff 49 c7 86 88 08 00 00 00 00 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 48 8b 7b 28 e8 0d 44 RIP [] free_msi_irqs+0x188/0x190 The solution is to not touch the adapter->state in iavf_watchdog_task() and let the reset task handle the state transition. Signed-off-by: Stefan Assmann Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 8b4b06919fd66caf49fdf4fe59f9d6312cf7956d Author: Stefan Assmann Date: Thu Mar 4 10:34:30 2021 +0100 i40e: improve locking of mac_filter_hash i40e_config_vf_promiscuous_mode() calls i40e_getnum_vf_vsi_vlan_filters() without acquiring the mac_filter_hash_lock spinlock. This is unsafe because mac_filter_hash may get altered in another thread while i40e_getnum_vf_vsi_vlan_filters() traverses the hashes. Simply adding the spinlock in i40e_getnum_vf_vsi_vlan_filters() is not possible as it already gets called in i40e_get_vlan_list_sync() with the spinlock held. Therefore adding a wrapper that acquires the spinlock and call the correct function where appropriate. Fixes: 37d318d7805f ("i40e: Remove scheduling while atomic possibility") Fix-suggested-by: Paolo Abeni Signed-off-by: Stefan Assmann Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 2b2d4dfca4e7cb6de70985b1579a6c08c027b8c9 Author: Eddie James Date: Fri Jul 16 08:39:15 2021 -0500 dt-bindings: fsi: Remove ibm,fsi2spi-restricted compatible Remove this compatible string from the FSI SPI controller documentation, since the security restrictions have been universally applied to the controllers. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20210716133915.14697-3-eajames@linux.ibm.com Signed-off-by: Mark Brown commit 34d34a56a5ea1e54a5af4f34c6ac9df724129351 Author: Eddie James Date: Fri Jul 16 08:39:14 2021 -0500 spi: fsi: Reduce max transfer size to 8 bytes Security changes have forced the SPI controllers to be limited to 8 byte reads. Refactor the sequencing to just handle 8 bytes at a time. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20210716133915.14697-2-eajames@linux.ibm.com Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit cfc9d37ab79ff19d44a17195e57b2828084d5896 Author: Peter Ujfalusi Date: Sat Jul 17 15:28:20 2021 +0300 ASoC: ti: j721e-evm: Convert the audio domain IDs to enum Convert the J721E_AUDIO_DOMAIN_* from defines to enum to make it possible to extend the number of domains in the future. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210717122820.1467-4-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown commit 3a1e341c5687b4e8fe51ca1c933b1f23ab3304c1 Author: Takashi Iwai Date: Thu Jul 15 09:59:41 2021 +0200 ALSA: pcsp: Allocate resources with device-managed APIs Use the new snd_devm_card_new() for the card object allocation and the devres version for the input device, and clean up the superfluous remove callback. Link: https://lore.kernel.org/r/20210715075941.23332-80-tiwai@suse.de Signed-off-by: Takashi Iwai commit ed16a22b09002fe1bef302242a0ac4a00f44b20d Author: Takashi Iwai Date: Thu Jul 15 09:59:40 2021 +0200 ALSA: dummy: Allocate resources with device-managed APIs Use the new snd_devm_card_new() for the card object allocation, and clean up the superfluous remove callback. Link: https://lore.kernel.org/r/20210715075941.23332-79-tiwai@suse.de Signed-off-by: Takashi Iwai commit b072e65aadd683e75518150c609ae29b5d33fe0c Author: Takashi Iwai Date: Thu Jul 15 09:59:39 2021 +0200 ALSA: aloop: Allocate resources with device-managed APIs Use the new snd_devm_card_new() for the card object allocation, and clean up the superfluous remove callback. Link: https://lore.kernel.org/r/20210715075941.23332-78-tiwai@suse.de Signed-off-by: Takashi Iwai commit de74763295a8a2b219be43b41513285a82920c4e Author: Takashi Iwai Date: Thu Jul 15 09:59:38 2021 +0200 ALSA: mpu401: Allocate resources with device-managed APIs This patch converts the card object management with devres as a clean up. The remove callback gets reduced by that. This should give no user-visible functional changes. Note that this converts only the mpu401 card driver. The mpu401_uart component is still managed with snd_device. It's for the case where the mpu401_uart component may be removed dynamically without the actual device unbind. Link: https://lore.kernel.org/r/20210715075941.23332-77-tiwai@suse.de Signed-off-by: Takashi Iwai commit 60d03de81c40270eab06b29c502a12ccb3b1cf4c Author: Takashi Iwai Date: Thu Jul 15 09:59:37 2021 +0200 ALSA: serial-u16550: Allocate resources with device-managed APIs This patch converts the resource management in serial u16550 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-76-tiwai@suse.de Signed-off-by: Takashi Iwai commit aa92050f10f0c904df5ae58e3b2c70c9e4ef67c2 Author: Takashi Iwai Date: Thu Jul 15 09:59:36 2021 +0200 ALSA: mtpav: Allocate resources with device-managed APIs This patch converts the resource management in mtpav driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper now. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-75-tiwai@suse.de Signed-off-by: Takashi Iwai commit ed539fc3428c6901e668e9d71ce1ca78f28cc03f Author: Takashi Iwai Date: Thu Jul 15 09:59:35 2021 +0200 ALSA: virmidi: Allocate resources with device-managed APIs This patch converts the card object management with devres as a clean up. The remove callback gets reduced by that. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-74-tiwai@suse.de Signed-off-by: Takashi Iwai commit 854577ac2aea5cf4d8f48a841fd26e04cbac2b77 Author: Takashi Iwai Date: Thu Jul 15 09:59:34 2021 +0200 ALSA: x86: Allocate resources with device-managed APIs This patch converts the resource management in x86 HDMI LPE audio driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper now. Link: https://lore.kernel.org/r/20210715075941.23332-73-tiwai@suse.de Signed-off-by: Takashi Iwai commit f082b1ad39ea1e47d1acfec229f10d9b17415b76 Author: Takashi Iwai Date: Thu Jul 15 09:59:33 2021 +0200 ALSA: wavefront: Allocate resources with device-managed APIs This patch converts the resource management in ISA wavefront driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-72-tiwai@suse.de Signed-off-by: Takashi Iwai commit bddc2ef1323588caa69b6b806c193db4d1f97dad Author: Takashi Iwai Date: Thu Jul 15 09:59:32 2021 +0200 ALSA: sscape: Allocate resources with device-managed APIs This patch converts the resource management in ISA sscape driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-71-tiwai@suse.de Signed-off-by: Takashi Iwai commit 111601ff76e9eb5038254284dcdd3b212c752aef Author: Takashi Iwai Date: Thu Jul 15 09:59:31 2021 +0200 ALSA: sc6000: Allocate resources with device-managed APIs This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The cleanup code was moved from the remove callback to card->private_free, and then the remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-70-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6bf39b5dbd53b274ec4d381a082555ccc74b55a2 Author: Takashi Iwai Date: Thu Jul 15 09:59:30 2021 +0200 ALSA: opl3sa2: Allocate resources with device-managed APIs This patch converts the resource management in ISA opl3sa2 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-69-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2973ee4a5b5495090af6b24d9adbb765bca04aaf Author: Takashi Iwai Date: Thu Jul 15 09:59:29 2021 +0200 ALSA: opti9xx: Allocate resources with device-managed APIs This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-68-tiwai@suse.de Signed-off-by: Takashi Iwai commit 098493041a2ce8a35eada728e136e5a5edfe24ad Author: Takashi Iwai Date: Thu Jul 15 09:59:28 2021 +0200 ALSA: msnd: Allocate resources with device-managed APIs This patch converts the resource management in ISA msnd drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-67-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5b88da3c800f21a76b9fd755c604402c15b10855 Author: Takashi Iwai Date: Thu Jul 15 09:59:27 2021 +0200 ALSA: gus: Allocate resources with device-managed APIs This patch converts the resource management in ISA gus drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-66-tiwai@suse.de Signed-off-by: Takashi Iwai commit 35a245ec06192629b6c4210b93aaebcfab62a09e Author: Takashi Iwai Date: Thu Jul 15 09:59:26 2021 +0200 ALSA: galaxy: Allocate resources with device-managed APIs This patch converts the resource management in ISA galaxy drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-65-tiwai@suse.de Signed-off-by: Takashi Iwai commit 34d6599bc107c5eebe24961fe18cdaa6e9e22aef Author: Takashi Iwai Date: Thu Jul 15 09:59:25 2021 +0200 ALSA: es18xx: Allocate resources with device-managed APIs This patch converts the resource management in ISA es18xx driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-64-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1bb11c1c7f6e264a737b30c667c3c84fbe511d98 Author: Takashi Iwai Date: Thu Jul 15 09:59:24 2021 +0200 ALSA: es1688: Allocate resources with device-managed APIs This patch converts the resource management in ISA es1688 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-63-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4287864eb0532c971ef7555804e4d44a02748b0d Author: Takashi Iwai Date: Thu Jul 15 09:59:23 2021 +0200 ALSA: cs423x: Allocate resources with device-managed APIs This patch converts the resource management in ISA cs423x drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-62-tiwai@suse.de Signed-off-by: Takashi Iwai commit 45782ce077a83a15e697794b2b2c53c58d9cf321 Author: Takashi Iwai Date: Thu Jul 15 09:59:22 2021 +0200 ALSA: cmi8330: Allocate resources with device-managed APIs This patch converts the resource management in ISA cmi8330 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-61-tiwai@suse.de Signed-off-by: Takashi Iwai commit d9fd7397a70e201800307f83eb3941f4d28fef81 Author: Takashi Iwai Date: Thu Jul 15 09:59:21 2021 +0200 ALSA: cmi8328: Allocate resources with device-managed APIs This patch converts the resource management in ISA cmi8328 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-60-tiwai@suse.de Signed-off-by: Takashi Iwai commit 39c4f9aa761ab147f32cdea7c8d0b2c1fba2b082 Author: Takashi Iwai Date: Thu Jul 15 09:59:20 2021 +0200 ALSA: azt2320: Allocate resources with device-managed APIs This patch converts the resource management in ISA azt2320 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-59-tiwai@suse.de Signed-off-by: Takashi Iwai commit 749cadc7f53f99691e0e0b518980a5ab454cc844 Author: Takashi Iwai Date: Thu Jul 15 09:59:19 2021 +0200 ALSA: als100: Allocate resources with device-managed APIs This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-58-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5d50e348a499dcf5ba40dd797ac15fa78fe8d06b Author: Takashi Iwai Date: Thu Jul 15 09:59:18 2021 +0200 ALSA: adlib: Allocate resources with device-managed APIs This patch converts the resource management in ISA adlib driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-57-tiwai@suse.de Signed-off-by: Takashi Iwai commit e031577eef6118bd9c4f3ec319f69986531cd32c Author: Takashi Iwai Date: Thu Jul 15 09:59:17 2021 +0200 ALSA: ad1848: Allocate resources with device-managed APIs This patch converts the resource management in ISA ad1848 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-56-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5eab6cb0344d06dc654f3f98a44359e07fc98179 Author: Takashi Iwai Date: Thu Jul 15 09:59:16 2021 +0200 ALSA: sb: Allocate resources with device-managed APIs This patch converts the resource management in ISA sb drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-55-tiwai@suse.de Signed-off-by: Takashi Iwai commit ea2bfa2961b63d6dead8a33f533e3de5196f6d55 Author: Takashi Iwai Date: Thu Jul 15 09:59:15 2021 +0200 ALSA: wss: Allocate resources with device-managed APIs This patch converts the resource management in ISA wss driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. Since the whole destructor code could be removed by the conversion, the lowlevel snd_device was dropped as well. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-54-tiwai@suse.de Signed-off-by: Takashi Iwai commit d6fb54e87869ce91e3dc8b9ee58ed17ee9030c3c Author: Takashi Iwai Date: Thu Jul 15 09:59:14 2021 +0200 ALSA: ad1816a: Allocate resources with device-managed APIs This patch converts the resource management in ISA ad1816a driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-53-tiwai@suse.de Signed-off-by: Takashi Iwai commit c6e6bb5eab7457a938c0405d5ccf319d3ee735c1 Author: Takashi Iwai Date: Thu Jul 15 09:59:13 2021 +0200 ALSA: ymfpci: Allocate resources with device-managed APIs This patch converts the resource management in PCI ymfpci driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-52-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3bde3359aa1648aaf60a1f17cda87df23d8b0d43 Author: Takashi Iwai Date: Thu Jul 15 09:59:12 2021 +0200 ALSA: vx222: Allocate resources with device-managed APIs This patch converts the resource management in PCI vx222 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-51-tiwai@suse.de Signed-off-by: Takashi Iwai commit a033954140ac43a8ce0eab469229a107cfee1c87 Author: Takashi Iwai Date: Thu Jul 15 09:59:11 2021 +0200 ALSA: vx: Manage vx_core object with devres The firmware data are also released automatically. Link: https://lore.kernel.org/r/20210715075941.23332-50-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5adfd8c26607cdc666aa86ecc10104924d54082a Author: Takashi Iwai Date: Thu Jul 15 09:59:10 2021 +0200 ALSA: trident: Allocate resources with device-managed APIs This patch converts the resource management in PCI trident driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-49-tiwai@suse.de Signed-off-by: Takashi Iwai commit b1002b2d41c5d33c39b853cab3a83978f28be7de Author: Takashi Iwai Date: Thu Jul 15 09:59:09 2021 +0200 ALSA: rme9652: Allocate resources with device-managed APIs This patch converts the resource management in PCI rme9652 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-48-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0195ca5fd1f463ec1b3ea5a23fff672330584616 Author: Takashi Iwai Date: Thu Jul 15 09:59:08 2021 +0200 ALSA: hdspm: Allocate resources with device-managed APIs This patch converts the resource management in PCI hdspm driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-47-tiwai@suse.de Signed-off-by: Takashi Iwai commit d136b8e54f92dfcc3b80d7796b142658c8f68c97 Author: Takashi Iwai Date: Thu Jul 15 09:59:07 2021 +0200 ALSA: hdsp: Allocate resources with device-managed APIs This patch converts the resource management in PCI hdsp driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-46-tiwai@suse.de Signed-off-by: Takashi Iwai commit 546c201a891e8439d11a13f5dd3e636ebd94b7d6 Author: Takashi Iwai Date: Thu Jul 15 09:59:06 2021 +0200 ALSA: riptide: Allocate resources with device-managed APIs This patch converts the resource management in PCI riptide driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-45-tiwai@suse.de Signed-off-by: Takashi Iwai commit 596ae97ab0ce0ac273162d51424d7a509b557f32 Author: Takashi Iwai Date: Thu Jul 15 09:59:05 2021 +0200 ALSA: oxygen: Allocate resources with device-managed APIs This patch converts the resource management in PCI oxygen drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the page allocations are done with the devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-44-tiwai@suse.de Signed-off-by: Takashi Iwai commit c19935f04784dcaa456fcd1d1b1fbf3a85765ff1 Author: Takashi Iwai Date: Thu Jul 15 09:59:04 2021 +0200 ALSA: nm256: Allocate resources with device-managed APIs This patch converts the resource management in PCI nm256 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-43-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6f16c19b115eb6564da7ea882af2afee4e26c213 Author: Takashi Iwai Date: Thu Jul 15 09:59:03 2021 +0200 ALSA: lx6464es: Allocate resources with device-managed APIs This patch converts the resource management in PCI lx6464es driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-42-tiwai@suse.de Signed-off-by: Takashi Iwai commit 098fe3d6e77515685c60179926a96c5ac0fee74a Author: Takashi Iwai Date: Thu Jul 15 09:59:02 2021 +0200 ALSA: lola: Allocate resources with device-managed APIs This patch converts the resource management in PCI lola driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-41-tiwai@suse.de Signed-off-by: Takashi Iwai commit b5cde369b61850d31d8e0791168bf359a7ca9eaf Author: Takashi Iwai Date: Thu Jul 15 09:59:01 2021 +0200 ALSA: korg1212: Allocate resources with device-managed APIs This patch converts the resource management in PCI korg1212 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-40-tiwai@suse.de Signed-off-by: Takashi Iwai commit 314f6dbb1f3320834eb9f6674e052419b28fea88 Author: Takashi Iwai Date: Thu Jul 15 09:59:00 2021 +0200 ALSA: ice1724: Allocate resources with device-managed APIs This patch converts the resource management in PCI ice1724 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Along with it, the chip_exit callback chain is moved into the card's private_free instead of the PCI remove callback, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-39-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1f0819979248bfc995e392bb1f4e2a508ecef0f4 Author: Takashi Iwai Date: Thu Jul 15 09:58:59 2021 +0200 ALSA: ali5451: Allocate resources with device-managed APIs This patch converts the resource management in PCI ali5451 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-38-tiwai@suse.de Signed-off-by: Takashi Iwai commit 272d6efa0b43f34c435937ad99db5289e460b05e Author: Takashi Iwai Date: Thu Jul 15 09:58:58 2021 +0200 ALSA: ice1724: Allocate resources with device-managed APIs This patch converts the resource management in PCI ice1724 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Along with it, the chip_exit callback chain is moved into the card's private_free instead of the PCI remove callback, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-37-tiwai@suse.de Signed-off-by: Takashi Iwai commit ca642da4b33d385c5a633287e1c4155f1ea09638 Author: Takashi Iwai Date: Thu Jul 15 09:58:57 2021 +0200 ALSA: ice1712: Allocate resources with device-managed APIs This patch converts the resource management in PCI ice1712 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Along with it, the chip_exit callback chain is moved into the card's private_free instead of the PCI remove callback, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-36-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2b377c6b6012b6ae71ae74d0b14677050a5aaf6c Author: Takashi Iwai Date: Thu Jul 15 09:58:56 2021 +0200 ALSA: emu10k1x: Allocate resources with device-managed APIs This patch converts the resource management in PCI emu10k1x driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-35-tiwai@suse.de Signed-off-by: Takashi Iwai commit 79e8b218b36dfa613440752c736fae37bc5fefbc Author: Takashi Iwai Date: Thu Jul 15 09:58:55 2021 +0200 ALSA: emu10k1: Allocate resources with device-managed APIs This patch converts the resource management in PCI emu10k1 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-34-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9c211bf392bbf7cec3f69129adeedff7983c833e Author: Takashi Iwai Date: Thu Jul 15 09:58:54 2021 +0200 ALSA: echoaudio: Allocate resources with device-managed APIs This patch converts the resource management in PCI echoaudio drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the page allocations are done with the devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. The irq handler is still managed manually because it's re-acquired at PM suspend/resume. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-33-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5eba4c646dfe3d8bdb8b86df64e84f836ed992f4 Author: Takashi Iwai Date: Thu Jul 15 09:58:53 2021 +0200 ALSA: cs5535audio: Allocate resources with device-managed APIs This patch converts the resource management in PCI cs5535audio driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. A slight uncertain change is the call of olpc_quirks_cleanup() at removal: formerly this was called unconditionally at remove, but this should be a conditionally call, hence the machine_is_olpc() check is added here as well. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-32-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5bff69b3645db7b3018ecbc26218d8866aeaf214 Author: Takashi Iwai Date: Thu Jul 15 09:58:52 2021 +0200 ALSA: cs46xx: Allocate resources with device-managed APIs This patch converts the resource management in PCI cs46xx driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-31-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1656fa6ea2583d9779c10051b3b37d664c8899e3 Author: Takashi Iwai Date: Thu Jul 15 09:58:51 2021 +0200 ALSA: ca0106: Allocate resources with device-managed APIs This patch converts the resource management in PCI ca0106 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-30-tiwai@suse.de Signed-off-by: Takashi Iwai commit 33631012cd067d2c9ea6da5d4213a8f27fdde271 Author: Takashi Iwai Date: Thu Jul 15 09:58:50 2021 +0200 ALSA: aw2: Allocate resources with device-managed APIs This patch converts the resource management in PCI aw2 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-29-tiwai@suse.de Signed-off-by: Takashi Iwai commit e44b5b44060924063e91f361fb03e27281cc72a8 Author: Takashi Iwai Date: Thu Jul 15 09:58:49 2021 +0200 ALSA: au88x0: Allocate resources with device-managed APIs This patch converts the resource management in PCI au88x0 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-28-tiwai@suse.de Signed-off-by: Takashi Iwai commit 24ee07fbf95dea6fcf5f4b78c496aee987bca5a2 Author: Takashi Iwai Date: Thu Jul 15 09:58:48 2021 +0200 ALSA: ali5451: Allocate resources with device-managed APIs This patch converts the resource management in PCI ali5451 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-27-tiwai@suse.de Signed-off-by: Takashi Iwai commit afaf99751d0c906914fd958432b648db2ccdf1bb Author: Takashi Iwai Date: Thu Jul 15 09:58:47 2021 +0200 ALSA: via82xx: Allocate resources with device-managed APIs This patch converts the resource management in PCI via82xx drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-26-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2ca6cbde6ad7cf1ac6ff179751cf7ba60af3dcdd Author: Takashi Iwai Date: Thu Jul 15 09:58:46 2021 +0200 ALSA: sonicvibes: Allocate resources with device-managed APIs This patch converts the resource management in PCI sonicvibes driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-25-tiwai@suse.de Signed-off-by: Takashi Iwai commit 499ddc16394c983b63da16ae3578913133e9cc86 Author: Takashi Iwai Date: Thu Jul 15 09:58:45 2021 +0200 ALSA: sis7019: Allocate resources with device-managed APIs This patch converts the resource management in PCI sis7019 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-24-tiwai@suse.de Signed-off-by: Takashi Iwai commit df06df7cc997740aadc39d8bf3332413f84a54d4 Author: Takashi Iwai Date: Thu Jul 15 09:58:44 2021 +0200 ALSA: rme96: Allocate resources with device-managed APIs This patch converts the resource management in PCI rme96 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-23-tiwai@suse.de Signed-off-by: Takashi Iwai commit 102e6156ded2849f3f5c7e1519e94c809bb187e0 Author: Takashi Iwai Date: Thu Jul 15 09:58:43 2021 +0200 ALSA: rme32: Allocate resources with device-managed APIs This patch converts the resource management in PCI rme32 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-22-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5c0939253c3cb86a3e1197197ddaed051109e1ad Author: Takashi Iwai Date: Thu Jul 15 09:58:42 2021 +0200 ALSA: maestro3: Allocate resources with device-managed APIs This patch converts the resource management in PCI maestro3 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Superfluous ac97 private_free callbacks were dropped, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-21-tiwai@suse.de Signed-off-by: Takashi Iwai commit 47c413395376796f44731eaf17c5943444dcaa05 Author: Takashi Iwai Date: Thu Jul 15 09:58:41 2021 +0200 ALSA: fm801: Allocate resources with device-managed APIs This patch converts the resource management in PCI fm801 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Also the superfluous ac97 private_free callbacks were dropped, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-20-tiwai@suse.de Signed-off-by: Takashi Iwai commit a7b4cbfdc7010e5a7136b3e4f8c2a9d3c8f634e5 Author: Takashi Iwai Date: Thu Jul 15 09:58:40 2021 +0200 ALSA: es1968: Allocate resources with device-managed APIs This patch converts the resource management in PCI es1968 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-19-tiwai@suse.de Signed-off-by: Takashi Iwai commit 08e9d3ab4cc1435ff96af563087894c482533c9e Author: Takashi Iwai Date: Thu Jul 15 09:58:39 2021 +0200 ALSA: es1938: Allocate resources with device-managed APIs This patch converts the resource management in PCI es1938 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-18-tiwai@suse.de Signed-off-by: Takashi Iwai commit 10ed6eaf9d72bbca32ccaa6e064c7e02e778919d Author: Takashi Iwai Date: Thu Jul 15 09:58:38 2021 +0200 ALSA: ens137x: Allocate resources with device-managed APIs This patch converts the resource management in PCI esn137x drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, the devres helper is used for the DMA buffer page allocations, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-17-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2e11e3ff2a4368e592cbfd50642ae354dcacde76 Author: Takashi Iwai Date: Thu Jul 15 09:58:37 2021 +0200 ALSA: cs5530: Allocate resources with device-managed APIs This patch converts the resource management in PCI cs5530 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-16-tiwai@suse.de Signed-off-by: Takashi Iwai commit 99041fea70d0ae1c3f6923564133a725a1f7a0e8 Author: Takashi Iwai Date: Thu Jul 15 09:58:36 2021 +0200 ALSA: cs4281: Allocate resources with device-managed APIs This patch converts the resource management in PCI cs4281 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-15-tiwai@suse.de Signed-off-by: Takashi Iwai commit 87e082ad84a7e1f022be168396ff1cb93a80c557 Author: Takashi Iwai Date: Thu Jul 15 09:58:35 2021 +0200 ALSA: cmipci: Allocate resources with device-managed APIs This patch converts the resource management in PCI cmipci driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-14-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9e80ed64a0067f407ac0fcb39bb018ebd675187f Author: Takashi Iwai Date: Thu Jul 15 09:58:34 2021 +0200 ALSA: bt87x: Allocate resources with device-managed APIs This patch converts the resource management in PCI bt87x driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-13-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8c5823ef31e1cb3bd1144bc6cefc9a234cfac7ba Author: Takashi Iwai Date: Thu Jul 15 09:58:33 2021 +0200 ALSA: azt3328: Allocate resources with device-managed APIs This patch converts the resource management in PCI azt3328 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-12-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0e175f665960c7be30aba47afbee4f2d121ea5fc Author: Takashi Iwai Date: Thu Jul 15 09:58:32 2021 +0200 ALSA: als4000: Allocate resources with device-managed APIs This patch converts the resource management in PCI als4000 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit 21a9314cf93bfe9f77e2e019c272d15d58504670 Author: Takashi Iwai Date: Thu Jul 15 09:58:31 2021 +0200 ALSA: als300: Allocate resources with device-managed APIs This patch converts the resource management in PCI als300 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit 567f58754109b0a832b760b2166fc9efd4e4a3b7 Author: Takashi Iwai Date: Thu Jul 15 09:58:30 2021 +0200 ALSA: ad1889: Allocate resources with device-managed APIs This patch converts the resource management in PCI ad1889 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. Also, the unnecessary ac97 free callbacks are removed, too. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3fcaf24e5dcea3c223d97fd10d7c0b5bc6d765c4 Author: Takashi Iwai Date: Thu Jul 15 09:58:29 2021 +0200 ALSA: hda: Allocate resources with device-managed APIs This patch is an attempt to slightly simplify the resource management in HD-audio code, by using some device-managed APIs. Only a few resources like PCI enablement and PCI resources managed via devres, but most of the rest code dealing with HD-audio core stuff couldn't be changed so much, hence the changes in this patch are pretty small in the end. A special caveat is needed for the card object: we can't move the card object release into devres, because the driver is involved with the component stuff and its unregistiration doesn't work well from devres release at all. Link: https://lore.kernel.org/r/20210715075941.23332-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit 86bde74dbf0944444aea43eb9e647f1ce16c7ade Author: Takashi Iwai Date: Thu Jul 15 09:58:28 2021 +0200 ALSA: atiixp: Allocate resources with device-managed APIs Like the previous patch, this patch converts the resource allocations with device-managed API calls, so that we can reduce resource-free calls. The atiixp drivers are simpler than intel8x0, and even the irq can be allocated with devres. The end result is a good amount of code reduction. Link: https://lore.kernel.org/r/20210715075941.23332-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7835e0901e245aa8b83d7e2964f17088cb2e1f1e Author: Takashi Iwai Date: Thu Jul 15 09:58:27 2021 +0200 ALSA: intel8x0: Allocate resources with device-managed APIs This patch refactors the intel8x0 and intel8x0m driver codes using devres and gets rid of the driver remove callback. The conversion is fairly straightforward: each API call is replaced with the device-managed API function, e.g. pci_enable_device() -> pcim_enable_device(), and so on. The buffer descriptor list is allocated with a new API, snd_devm_alloc_pages(). A slight code structure change is that the intel8x0 object is allocated as a card's private_data instead of the own lowlevel snd_device object. This simplifies the resource management. And, the take-down procedure is triggered via card->private_free, and it's registered at the end of the whole initialization, i.e. after the all resources get properly managed. The only not-devres-managed resource is the irq handler. Since we need to release at suspend and re-acquire at resume (otherwise something weird happens on some machines), this is still managed manually. But the rest are all freed automatically. The end result is a good amount of code reduction. Link: https://lore.kernel.org/r/20210715075941.23332-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit ac327f1b10bca6cee8f1a427e5ba451e2d69c710 Author: Takashi Iwai Date: Thu Jul 15 09:58:26 2021 +0200 ALSA: doc: Add device-managed resource section Give brief explanations about the device-managed resources and the newly introduced snd_devm_card_new() helper. Link: https://lore.kernel.org/r/20210715075941.23332-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit c2b94954add3cb25b40a9aa8badd196671d9872b Author: Takashi Iwai Date: Thu Jul 15 09:58:25 2021 +0200 ALSA: core: Add device-managed request_dma() This patch adds a devres-supported helper for requesting an ISA DMA channel that will be automatically freed at the device unbinding. It'll be used by quite a few ISA sound drivers. Link: https://lore.kernel.org/r/20210715075941.23332-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit e8ad415b7a55cb9a9fbfc04696518d5ea0b609b3 Author: Takashi Iwai Date: Thu Jul 15 09:58:24 2021 +0200 ALSA: core: Add managed card creation As a second step for preliminary to widen the devres usages among sound drivers, this patch adds a new ALSA core API function, snd_devm_card_new(), to create a snd_card object via devres. When a card object is created by this new function, snd_card_free() is called automatically and the card object resource gets released at the device unbinding time. However, the story isn't that simple. A caveat is that we have to call snd_card_free() at the very first of the whole resource release procedure, in order to assure that the all exposed devices on user-space are deleted and sync with processes accessing those devices before releasing resources. For achieving it, snd_card_register() adds a new devres action to trigger snd_card_free() automatically when the given card object is a "managed" one. Since usually snd_card_register() is the last step of the initialization, this should work in most cases. With all these tricks, some drivers can get rid of the whole driver remove callback code. About a bit of implementation details: the patch adds two new flags to snd_card object: managed and releasing. The former indicates that the object was created via snd_devm_card_new(), and the latter is used for avoiding the double-free of snd_card_free() calls. Both flags are fairly internal and likely uninteresting to normal users. Link: https://lore.kernel.org/r/20210715075941.23332-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 427ae2689db0fb6377e39e63fae2991223cdd9e7 Author: Takashi Iwai Date: Thu Jul 15 09:58:23 2021 +0200 ALSA: core: Add device-managed page allocator helper This is a preparation for allowing devres usages more widely in various sound drivers. As a first step, this patch adds a new allocator function, snd_devm_alloc_pages(), to manage the allocated pages via devres, so that the pages will be automagically released as device unbinding. Unlike the old snd_dma_alloc_pages(), the new function returns directly the snd_dma_buffer pointer. The caller needs NULL-check for the allocation error appropriately. Also, since a real device pointer is mandatory for devres, SNDRV_DMA_TYPE_CONTINUOUS or SNDRV_DMA_TYPE_VMALLOC type can't be used for this function. Link: https://lore.kernel.org/r/20210715075941.23332-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit e6c0a0889b808989dc2e0f89a87c0a0adab32463 Author: Colin Ian King Date: Mon Jul 19 11:30:44 2021 +0100 ALSA: aloop: Fix spelling mistake "synchronization" -> "synchronization" There is a spelling mistake in the Kconfig text. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210719103044.15315-1-colin.king@canonical.com Signed-off-by: Takashi Iwai commit 5cc4e71f0199391b0e311c44e79736c13eea269d Author: Antonio Borneo Date: Tue Jul 13 16:49:41 2021 +0200 drm/stm: dsi: compute the transition time from LP to HS and back The driver uses a conservative set of hardcoded values for the maximum time delay of the transitions between LP and HS, either for data and clock lanes. By using the info in STM32MP157 datasheet, valid also for other ST devices, compute the actual delay from the lane's bps. Signed-off-by: Antonio Borneo Reviewed-by: Philippe Cornu Acked-by: Philippe Cornu Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20210713144941.3599-1-antonio.borneo@foss.st.com commit 648ce7fd186cfb2ed7443f32bea8db735f9d219c Author: Jagan Teki Date: Sun Jul 4 19:29:14 2021 +0530 drm/stm: ltdc: Silence -EPROBE_DEFER till bridge attached As dw-mipi-dsi supported all possible ways to find the DSI devices. It can take multiple iterations for ltdc to find all components attached to the DSI bridge. The current ltdc driver failed to find the endpoint as it returned -EINVAL for the first iteration itself. This leads to following error: [    3.099289] [drm:ltdc_load] *ERROR* init encoder endpoint 0 So, check the return value and cleanup the encoder only if it's not -EPROBE_DEFER. This make all components in the attached DSI bridge found properly. Signed-off-by: Jagan Teki Tested-by: Yannick Fertre Acked-by: Philippe Cornu Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20210704135914.268308-1-jagan@amarulasolutions.com commit 80891e4fcd335c36cf2cf51592d8d0dbaf173743 Author: Tudor Ambarus Date: Fri Jul 16 18:47:39 2021 +0300 ARM: dts: at91: sama5d4_xplained: Remove spi0 node sama5d4_xplained has an optional on-board serial DataFlash (AT25DF321A), which does not come populated on board by default. Since the spi0 node does not have any child populated by default, thus no user on sama5d4_xplained, remove it. This avoids the following error in SPI NOR, which reads the values of the pulled downed lines, unrecognizing the flash: spi-nor spi0.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00 Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210716154739.835738-1-tudor.ambarus@microchip.com commit b6862714078c5259ba5eb4785c8575d876bc7bf5 Author: Claudiu Beznea Date: Thu Apr 15 13:50:02 2021 +0300 dt-bindings: atmel-sysreg: add bindings for sama7g5 Add RAM controller and RAM PHY controller DT bindings. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-17-claudiu.beznea@microchip.com commit 7540629e2fc70dd55dc92f971ff47903d8edb82b Author: Eugen Hristev Date: Mon Jun 28 15:04:50 2021 +0300 ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek Add Device Tree for sama7g5 SoC and associated board sama7g5-ek Signed-off-by: Eugen Hristev [claudiu.beznea@microchip.com: add clocks, ethernet, timers, power] Signed-off-by: Claudiu Beznea [codrin.ciubotariu@microchip.com: add audio] Signed-off-by: Codrin Ciubotariu [nicolas.ferre@microchip.com: removed eeproms, reorder i2s dma chans] Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210628120452.74408-2-eugen.hristev@microchip.com commit c556478f46c2feb36e415c2d3d4566f92a7e41cd Author: Eugen Hristev Date: Mon Jun 28 15:04:49 2021 +0300 dt-bindings: ARM: at91: document sama7g5ek board Document the SAMA7G5 Evaluation Kit based on sama7g5 SoC. Acked-by: Rob Herring Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210628120452.74408-1-eugen.hristev@microchip.com commit b62869dcd4bcf341d3750a2bcad9a80c6d5562a8 Author: Eugen Hristev Date: Mon Jun 28 15:04:52 2021 +0300 ARM: multi_v7_defconfig: add sama7g5 SoC Add the Microchip SAMA7G5 ARM v7 Cortex-A7 based SoC to multi_v7_defconfig. Also add it's clock timer, the PIT64B. Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210628120452.74408-4-eugen.hristev@microchip.com commit bfcd195b01c6610fffe3bfc60cc38d4bfe89d042 Author: Eugen Hristev Date: Mon Jun 28 15:04:51 2021 +0300 ARM: configs: at91: add defconfig for sama7 family of SoCs Add defconfig for sama7 SoC family. Signed-off-by: Eugen Hristev [claudiu.beznea@microchip.com: add clocks, ethernet, timers, power] Signed-off-by: Claudiu Beznea [codrin.ciubotariu@microchip.com: add audio] Signed-off-by: Codrin Ciubotariu [nicolas.ferre@microchip.com: atags not set, mtd tests, spi gpio] Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210628120452.74408-3-eugen.hristev@microchip.com commit 4c5afb74d9450edc2e2e37243b469cc278b120d4 Author: Reiner Huober Date: Tue Jul 6 15:02:52 2021 +0200 module: combine constructors in module linker script The constructor code for modules must be aware of init code inside different sections. Newer GCC compilers write constructors in more than one section, e.g. ".ctors.65435". These must be combined into a single ".ctors" section. In the module loader, only the ".ctors" section is searched and the constructors therein are initialized, when CONFIG_CONSTRUCTORS=y is set. Other constructors are ignored. This change combines all ".ctors.*" and the ".ctors" section, if any, in .ko into a single ."ctors" section. For code coverage in GCC, this is necessary to show the code coverage for modules, since code coverage uses such constructors when initializing a module in newer version of GCC. Signed-off-by: Reiner Huober Signed-off-by: Jessica Yu commit ad9bc2e35cf575644064284943aefdde426644cc Author: Claudiu Beznea Date: Thu Apr 15 13:50:10 2021 +0300 ARM: at91: pm: add sama7g5 shdwc Add SAMA7G5 SHDWC. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-25-claudiu.beznea@microchip.com commit 6501330f9f5e45a00622dee69a4a005d5943172d Author: Claudiu Beznea Date: Thu Apr 15 13:50:09 2021 +0300 ARM: at91: pm: add pm support for SAMA7G5 Add support for SAMA7G5 power management modes: standby, ulp0, ulp1, backup. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-24-claudiu.beznea@microchip.com commit 9d464cc5ac018975b9151ac8d2b68b1b033a3268 Author: Eugen Hristev Date: Thu Apr 15 13:50:08 2021 +0300 ARM: at91: sama7: introduce sama7 SoC family Introduce new family of SoCs, sama7, and first SoC, sama7g5. Signed-off-by: Eugen Hristev [claudiu.beznea@microchip.com: keep only the sama7_dt] Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-23-claudiu.beznea@microchip.com commit ccdbdf33bdc074bbf33e8c3182189d8524a7039f Author: Claudiu Beznea Date: Thu Apr 15 13:50:07 2021 +0300 ARM: at91: pm: add sama7g5's pmc Add SAMA7G5's PMC to compatible list. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-22-claudiu.beznea@microchip.com commit f205adb60898ed72c3aa5aedac22f74a1d293734 Author: Claudiu Beznea Date: Thu Apr 15 13:50:06 2021 +0300 ARM: at91: pm: add backup mode support for SAMA7G5 Adapt at91_pm_backup_init() to work for SAMA7G5. Also, set the LPM pin to shutdown controller. This will signal to PMIC that it needs to switch to the state corresponding to backup mode. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-21-claudiu.beznea@microchip.com commit d2d4716d83840f279c979053fc0d0f966153b601 Author: Claudiu Beznea Date: Thu Apr 15 13:50:05 2021 +0300 ARM: at91: pm: save ddr phy calibration data to securam The resuming from backup mode is done with the help of bootloader. The bootloader reconfigure the DDR controller and DDR PHY controller. To speed-up the resuming process save the PHY calibration data into SECURAM before suspending (securam is powered on backup mode). This data will be later used by bootloader in DDR PHY reconfiguration process. Also, in the process or recalibration the first 8 words of the memory may get corrupted. To solve this, these 8 words are saved in the securam and restored by bootloader in the process of PHY configuration. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-20-claudiu.beznea@microchip.com commit 892e1f4a3ae58c1cd376d952d45dca6f20dc712c Author: Claudiu Beznea Date: Thu Apr 15 13:50:04 2021 +0300 ARM: at91: pm: add sama7g5 ddr phy controller SAMA7G5 self-refresh procedure accesses also the DDR PHY registers. Adapt the code so that the at91_dt_ramc() to look also for DDR PHYs, in case it is mandatory. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-19-claudiu.beznea@microchip.com commit 2c26cb4d6944edf0a65a4b1fdeacdcc816261739 Author: Claudiu Beznea Date: Thu Apr 15 13:50:03 2021 +0300 ARM: at91: pm: add sama7g5 ddr controller Add SAMA7G5 DDR controller to the list of DDR controller compatibles. At the moment there is no standby support. Adapt the code for this. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-18-claudiu.beznea@microchip.com commit 5b0bef872c1d131c4a4b2abdd825d4d5f548a1a1 Author: Claudiu Beznea Date: Thu Apr 15 13:50:01 2021 +0300 ARM: at91: pm: wait for ddr power mode off Wait for DDR power mode off before shutting down the core. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-16-claudiu.beznea@microchip.com commit 475be50fc149ae11822433e8cb511493bb0e5c1d Author: Claudiu Beznea Date: Thu Apr 15 13:50:00 2021 +0300 ARM: at91: pm: add support for 2.5V LDO regulator control Add support to disable/enable 2.5V LDO regulator when entering/exiting any ULP mode. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-15-claudiu.beznea@microchip.com commit 28eb1d40fe57fd03657f01fdaf2cce115cba3b7d Author: Claudiu Beznea Date: Thu Apr 15 13:49:59 2021 +0300 ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes Add support for MCK1..4 save restore for ULP modes. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-14-claudiu.beznea@microchip.com commit f0bbf17958e84e2fdc0a4487c85472025c7ed04a Author: Claudiu Beznea Date: Thu Apr 15 13:49:58 2021 +0300 ARM: at91: pm: add self-refresh support for sama7g5 Add self-refresh support for SAMA7G5. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-13-claudiu.beznea@microchip.com commit d8c7983f31ac9ac75fc0138070349b360ab876fa Author: Claudiu Beznea Date: Thu Apr 15 13:49:57 2021 +0300 ARM: at91: ddr: add registers definitions for sama7g5's ddr Add registers and bits definitions for SAMA7G5's UDDRC and DDR3PHY. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-12-claudiu.beznea@microchip.com commit 96abf16861508b92b1b44c564115c2be1f2b4966 Author: Claudiu Beznea Date: Thu Apr 15 13:49:56 2021 +0300 ARM: at91: sfrbu: add sfrbu registers definitions for sama7g5 Add SFRBU registers definitions for SAMA7G5. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-11-claudiu.beznea@microchip.com commit 15126bb61b12ed1ddf006367bd6029dce7409532 Author: Claudiu Beznea Date: Thu Apr 15 13:49:55 2021 +0300 ARM: at91: pm: add support for waiting MCK1..4 SAMA7G5 has 5 master clocks 0..4. MCK0 is controlled differently than MCK 1..4. MCK 1..4 should also be saved/restored in the last phase of suspend/resume. Thus, adapt wait_mckrdy to support also MCK1..4. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-10-claudiu.beznea@microchip.com commit e3821ed4767000fa49b40be50de2344e2204bcd6 Author: Claudiu Beznea Date: Thu Apr 15 13:49:54 2021 +0300 ARM: at91: pm: s/CONFIG_SOC_SAM9X60/CONFIG_HAVE_AT91_SAM9X60_PLL/g Replace CONFIG_SOC_SAM9X60 with CONFIG_HAVE_AT91_SAM9X60_PLL as the SAM9X60's PLL is also present on SAMA7G5. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-9-claudiu.beznea@microchip.com commit 87e1b30c29b9ae41cfbf6cda42f970b529bfcfb9 Author: Claudiu Beznea Date: Thu Apr 15 13:49:53 2021 +0300 ARM: at91: pm: avoid push and pop on stack while memory is in self-refersh For the previous AT91 RAM controller and self-refresh procedure this had no side effects. However, for SAMA7G5 the self-refresh procedure doesn't allow this anymore as the RAM controller ports are closed before switching it to self-refresh. This commits prepares the code for the following ones adding self-refresh and PM support for SAMA7G5. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-8-claudiu.beznea@microchip.com commit 29cdf077a9ef238e608eb1243cdcc9e47592ad02 Author: Claudiu Beznea Date: Thu Apr 15 13:49:52 2021 +0300 ARM: at91: pm: use r7 instead of tmp1 Use r7 instead of tmp1 in macros. This prepares the filed for next commits. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-7-claudiu.beznea@microchip.com commit 629ba8ee03a5b0536d53f0e67092e3dba884a576 Author: Claudiu Beznea Date: Thu Apr 15 13:49:51 2021 +0300 ARM: at91: pm: do not initialize pdev There is no need to initialize pdev. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-6-claudiu.beznea@microchip.com commit 404956f47c3c6fe300dfc9458ea9c3248d174850 Author: Claudiu Beznea Date: Thu Apr 15 13:49:50 2021 +0300 ARM: at91: pm: check for different controllers in at91_pm_modes_init() at91_pm_modes_init() checks for proper nodes in device tree and maps them accordingly. Up to SAMA7G5 all AT91 SoCs had the same mapping b/w power saving modes and different controllers needed in the final/first steps of suspend/resume. SAMA7G5 is not aligned with the old SoCs thus the code is adapted for this. This patch prepares the field for next commits. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-5-claudiu.beznea@microchip.com commit 0a7a2443c7a41ae06f0c2a1387072e07d1338d1d Author: Claudiu Beznea Date: Thu Apr 15 13:49:49 2021 +0300 ARM: at91: pm: document at91_soc_pm structure Document at91_soc_pm structure. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-4-claudiu.beznea@microchip.com commit fe4c09e56852ceb4f4e07ba42e1750b4f5188d76 Author: Claudiu Beznea Date: Thu Apr 15 13:49:48 2021 +0300 ARM: at91: pm: move the setup of soc_pm.bu->suspended Move the setup of soc_pm.bu->suspended in platform_suspend::begin function so that the PMC code in charge with clocks suspend/resume to differentiate b/w standard PM mode and backup mode. Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-3-claudiu.beznea@microchip.com commit f19dd1df9e71da7e76b2c43cf640507be24bca72 Author: Claudiu Beznea Date: Thu Apr 15 13:49:47 2021 +0300 ARM: at91: pm: move pm_bu to soc_pm data structure Move pm_bu to soc_pm data structure. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210415105010.569620-2-claudiu.beznea@microchip.com commit 577cb67ad98b2b76985336ae204c145228362e2a Author: Eugen Hristev Date: Fri Apr 9 14:31:16 2021 +0300 ARM: at91: debug: add sama7g5 low level debug uart Add sama7g5 SoC debug uart on Flexcom3. This is the UART that the ROM bootloader uses. Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210409113116.482199-2-eugen.hristev@microchip.com commit 56bc29659182a9d4b58d8364420f5a9c59d709e8 Author: Eugen Hristev Date: Fri Apr 9 14:31:15 2021 +0300 ARM: at91: add new SoC sama7g5 Add new SoC from at91 family : sama7g5 Signed-off-by: Eugen Hristev [claudiu.beznea@microchip.com: Select PLL, generic clock and UTMI support, add PM configs] Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210409113116.482199-1-eugen.hristev@microchip.com Link: https://lore.kernel.org/r/20210719080317.1045832-2-claudiu.beznea@microchip.com commit ec03f18cc222bb7bec074ce7845c157d1c5195f6 Author: Claudiu Beznea Date: Mon Jul 19 11:03:17 2021 +0300 clk: at91: add register definition for sama7g5's master clock Add register definitions for SAMA7G5's master clock. These would be also used by architecture specific power saving code. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20210719080317.1045832-3-claudiu.beznea@microchip.com commit bd9616996bb8cd6fbceedf00f1aa72fd9a845519 Author: Uwe Kleine-König Date: Fri Jul 16 19:39:27 2021 +0200 spi: imx: Simplify logic in spi_imx_push() For each usage of fifo_words it is clear if ->dynamic_burst is true or not. This can be used to simplify the function a bit. Signed-off-by: Uwe Kleine-König Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20210716173927.2050620-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 3bbdc083262dc082e5c8e7b0646faf8f4ef894dd Author: Andy Shevchenko Date: Mon Jul 19 10:48:42 2021 +0300 spi: pxa2xx: Reuse int_stop_and_reset() in couple of places Reuse int_stop_and_reset() in couple of places. While at it, change the order of the int_stop_and_reset() and pxa2xx_spi_off() to be in align with the similar flow in int_error_stop(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210719074842.36060-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit cdcb26ce747a5ec665a98fd6c303248a12418140 Author: Andy Shevchenko Date: Mon Jul 19 10:48:41 2021 +0300 spi: pxa2xx: Reset DMA bits in CR1 in reset_sccr1() In order to allow reset_sccr1() to be reused in DMA paths, reset DMA bits in CR1 in this function. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210719074842.36060-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit e0a6512d29126901dd16dfede314616b57ec8210 Author: Andy Shevchenko Date: Mon Jul 19 10:48:40 2021 +0300 spi: pxa2xx: Convert reset_sccr1() to use pxa2xx_spi_update() Convert reset_sccr1() to use pxa2xx_spi_update(). It will help for further improvements. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210719074842.36060-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit f020e4d0b4016f5592d082cc3a1db430c567c4dc Author: Colin Ian King Date: Mon Jul 19 11:34:29 2021 +0100 regulator: Fix a couple of spelling mistakes in Kconfig There are a couple of spelling mistakes in the Kconfig text. Fix them. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210719103429.15544-1-colin.king@canonical.com Signed-off-by: Mark Brown commit e98b461bb057aaea6fa766260788c08825213837 Author: Joe Perches Date: Tue Jul 13 10:49:15 2021 -0700 MIPS: octeon: Remove vestiges of CONFIG_CAVIUM_RESERVE32 The config option CAVIUM_RESERVE32 is not used. Remove the dead code controlled by it. Signed-off-by: Joe Perches Signed-off-by: Thomas Bogendoerfer commit 14d72af7ab00d9c2eb5b473b4fdf3b751b8cf8e2 Author: 周琰杰 (Zhou Yanjie) Date: Fri Jul 16 00:57:07 2021 +0800 MIPS: Ingenic: Add system type for new Ingenic SoCs. Add JZ4730, JZ4750, JZ4755, JZ4760, JZ4760B, X2000H, and X2100 system type for cat /proc/cpuinfo to give out JZ4730, JZ4750, JZ4755, JZ4760, JZ4760B, X2000H, and X2100. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 761608f5cf70e8876c2f0e39ca54b516bdcb7c12 Author: Pavel Skripkin Date: Mon Jul 5 23:47:27 2021 +0300 m68k: emu: Fix invalid free in nfeth_cleanup() In the for loop all nfeth_dev array members should be freed, not only the first one. Freeing only the first array member can cause double-free bugs and memory leaks. Fixes: 9cd7b148312f ("m68k/atari: ARAnyM - Add support for network access") Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20210705204727.10743-1-paskripkin@gmail.com Signed-off-by: Geert Uytterhoeven commit ad7d61f159db73974f1b0352f21afe04b0bbd920 Author: Chris Down Date: Tue Jun 15 17:52:56 2021 +0100 printk: index: Add indexing support to dev_printk While for most kinds of issues we have counters, tracepoints, or metrics with a stable interface which can reliably be used to indicate issues, in order to react to production issues quickly we sometimes need to work with the interface which most kernel developers naturally use when developing: printk, and printk-esques like dev_printk. dev_printk is by far the most likely custom subsystem printk to benefit from the printk indexing infrastructure, since niche device issues brought about by production changes, firmware upgrades, and the like are one of the most common things that we need printk infrastructure's assistance to monitor. Often these errors were never expected to practically manifest in reality, and exhibit in code without extensive (or any) metrics present. As such, there are typically very few options for issue detection available to those with large fleets at the time the incident happens, and we thus benefit strongly from monitoring netconsole in these instances. As such, add the infrastructure for dev_printk to be indexed in the printk index. Even on a minimal kernel config, the coverage of the base kernel's printk index is significantly improved: Before: [root@ktst ~]# wc -l /sys/kernel/debug/printk/index/vmlinux 4497 /sys/kernel/debug/printk/index/vmlinux After: [root@ktst ~]# wc -l /sys/kernel/debug/printk/index/vmlinux 5573 /sys/kernel/debug/printk/index/vmlinux In terms of implementation, in order to trivially disambiguate them, dev_printk is now a macro which wraps _dev_printk. Signed-off-by: Chris Down Cc: Petr Mladek Cc: Greg Kroah-Hartman Cc: Rasmus Villemoes Reviewed-by: Petr Mladek Tested-by: Petr Mladek Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/959c7aed1017cb2c9de922e0a820d397e29c6a5a.1623775748.git.chris@chrisdown.name commit 337015573718b161891a3473d25f59273f2e626b Author: Chris Down Date: Tue Jun 15 17:52:53 2021 +0100 printk: Userspace format indexing support We have a number of systems industry-wide that have a subset of their functionality that works as follows: 1. Receive a message from local kmsg, serial console, or netconsole; 2. Apply a set of rules to classify the message; 3. Do something based on this classification (like scheduling a remediation for the machine), rinse, and repeat. As a couple of examples of places we have this implemented just inside Facebook, although this isn't a Facebook-specific problem, we have this inside our netconsole processing (for alarm classification), and as part of our machine health checking. We use these messages to determine fairly important metrics around production health, and it's important that we get them right. While for some kinds of issues we have counters, tracepoints, or metrics with a stable interface which can reliably indicate the issue, in order to react to production issues quickly we need to work with the interface which most kernel developers naturally use when developing: printk. Most production issues come from unexpected phenomena, and as such usually the code in question doesn't have easily usable tracepoints or other counters available for the specific problem being mitigated. We have a number of lines of monitoring defence against problems in production (host metrics, process metrics, service metrics, etc), and where it's not feasible to reliably monitor at another level, this kind of pragmatic netconsole monitoring is essential. As one would expect, monitoring using printk is rather brittle for a number of reasons -- most notably that the message might disappear entirely in a new version of the kernel, or that the message may change in some way that the regex or other classification methods start to silently fail. One factor that makes this even harder is that, under normal operation, many of these messages are never expected to be hit. For example, there may be a rare hardware bug which one wants to detect if it was to ever happen again, but its recurrence is not likely or anticipated. This precludes using something like checking whether the printk in question was printed somewhere fleetwide recently to determine whether the message in question is still present or not, since we don't anticipate that it should be printed anywhere, but still need to monitor for its future presence in the long-term. This class of issue has happened on a number of occasions, causing unhealthy machines with hardware issues to remain in production for longer than ideal. As a recent example, some monitoring around blk_update_request fell out of date and caused semi-broken machines to remain in production for longer than would be desirable. Searching through the codebase to find the message is also extremely fragile, because many of the messages are further constructed beyond their callsite (eg. btrfs_printk and other module-specific wrappers, each with their own functionality). Even if they aren't, guessing the format and formulation of the underlying message based on the aesthetics of the message emitted is not a recipe for success at scale, and our previous issues with fleetwide machine health checking demonstrate as much. This provides a solution to the issue of silently changed or deleted printks: we record pointers to all printk format strings known at compile time into a new .printk_index section, both in vmlinux and modules. At runtime, this can then be iterated by looking at /printk/index/, which emits the following format, both readable by humans and able to be parsed by machines: $ head -1 vmlinux; shuf -n 5 vmlinux # filename:line function "format" <5> block/blk-settings.c:661 disk_stack_limits "%s: Warning: Device %s is misaligned\n" <4> kernel/trace/trace.c:8296 trace_create_file "Could not create tracefs '%s' entry\n" <6> arch/x86/kernel/hpet.c:144 _hpet_print_config "hpet: %s(%d):\n" <6> init/do_mounts.c:605 prepare_namespace "Waiting for root device %s...\n" <6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n" This mitigates the majority of cases where we have a highly-specific printk which we want to match on, as we can now enumerate and check whether the format changed or the printk callsite disappeared entirely in userspace. This allows us to catch changes to printks we monitor earlier and decide what to do about it before it becomes problematic. There is no additional runtime cost for printk callers or printk itself, and the assembly generated is exactly the same. Signed-off-by: Chris Down Cc: Petr Mladek Cc: Jessica Yu Cc: Sergey Senozhatsky Cc: John Ogness Cc: Steven Rostedt Cc: Greg Kroah-Hartman Cc: Johannes Weiner Cc: Kees Cook Reviewed-by: Petr Mladek Tested-by: Petr Mladek Reported-by: kernel test robot Acked-by: Andy Shevchenko Acked-by: Jessica Yu # for module.{c,h} Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/e42070983637ac5e384f17fbdbe86d19c7b212a5.1623775748.git.chris@chrisdown.name commit f3d75cf537db57f7918a17a75527951de850e5ec Author: Chris Down Date: Tue Jun 15 17:52:51 2021 +0100 printk: Rework parse_prefix into printk_parse_prefix parse_prefix is needed externally by later patches, so move it into a context where it can be used as such. Also give it the printk_ prefix to reduce the chance of collisions. Signed-off-by: Chris Down Cc: Petr Mladek Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/b22ba314a860e5c7f887958f1eab2649f9bd1d06.1623775748.git.chris@chrisdown.name commit a1ad4b8a19566b11e0306f8b197f2fd4567340e5 Author: Chris Down Date: Tue Jun 15 17:52:48 2021 +0100 printk: Straighten out log_flags into printk_info_flags In the past, `enum log_flags` was part of `struct log`, hence the name. `struct log` has since been reworked and now this struct is stored inside `struct printk_info`. However, the name was never updated, which is somewhat confusing -- especially since these flags operate at the record level rather than at the level of an abstract log. printk_info_flags also joins its other metadata struct friends in printk_ringbuffer.h. Signed-off-by: Chris Down Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/3dd801982f02603e6e3aa4f8bc4f5ebb830a4949.1623775748.git.chris@chrisdown.name commit 91027d0a7a0e309b94674923dc1b245b709b5c1e Author: Chris Down Date: Tue Jun 15 17:52:45 2021 +0100 string_helpers: Escape double quotes in escape_special From an abstract point of view, escape_special's counterpart, unescape_special, already handles the unescaping of blackslashed double quote sequences. As a more practical example, printk indexing is an example case where this is already practically useful. Compare an example with `ESCAPE_SPECIAL | ESCAPE_SPACE`, with quotes not escaped: [root@ktst ~]# grep drivers/pci/pci-stub.c:69 /sys/kernel/debug/printk/index/vmlinux <4> drivers/pci/pci-stub.c:69 pci_stub_init "pci-stub: invalid ID string "%s"\n" ...and the same after this patch: [root@ktst ~]# grep drivers/pci/pci-stub.c:69 /sys/kernel/debug/printk/index/vmlinux <4> drivers/pci/pci-stub.c:69 pci_stub_init "pci-stub: invalid ID string \"%s\"\n" One can of course, alternatively, use ESCAPE_APPEND with a quote in @only, but without this patch quotes are coerced into hex or octal which can hurt readability quite significantly. I've checked uses of ESCAPE_SPECIAL and %pE across the codebase, and I'm pretty confident that this shouldn't affect any stable interfaces. Signed-off-by: Chris Down Reviewed-by: Andy Shevchenko Reviewed-by: Petr Mladek Cc: Rasmus Villemoes Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/af144c5b75e41ce417386253ba2694456bc04118.1623775748.git.chris@chrisdown.name commit 31e5e64694cf9879e63b2802007fa934f4131126 Author: Michael Kelley Date: Tue Jul 13 17:01:46 2021 -0700 drivers: hv: Decouple Hyper-V clock/timer code from VMbus drivers Hyper-V clock/timer code in hyperv_timer.c is mostly independent from other VMbus drivers, but building for ARM64 without hyperv_timer.c shows some remaining entanglements. A default implementation of hv_read_reference_counter can just read a Hyper-V synthetic register and be independent of hyperv_timer.c, so move this code out and into hv_common.c. Then it can be used by the timesync driver even if hyperv_timer.c isn't built on a particular architecture. If hyperv_timer.c *is* built, it can override with a faster implementation. Also provide stubs for stimer functions called by the VMbus driver when hyperv_timer.c isn't built. No functional changes. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1626220906-22629-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 1b87d5bba32c1f25a12ba0625546e5375e3f998d Author: Lad Prabhakar Date: Mon Jul 19 09:58:39 2021 +0100 clk: renesas: r9a07g044: Add clock and reset entries for ADC Add clock and reset entries for ADC block in CPG driver. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210719085840.21842-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3b5c734592ade51fed3982bc840a830e066e668e Author: Lad Prabhakar Date: Thu Jul 15 19:21:22 2021 +0100 clk: renesas: r9a07g044: Add clock and reset entries for CANFD Add clock and reset entries for CANFD in CPG driver. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210715182123.23372-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0aae437ac5c264e8e2cb6c3fead20b44d2fa31d1 Author: Geert Uytterhoeven Date: Wed Jul 14 15:26:01 2021 +0200 clk: renesas: Rename renesas-rzg2l-cpg.[ch] to rzg2l-cpg.[ch] Rename renesas-rzg2l-cpg.c and renesas-rzg2l-cpg.h to rzg2l-cpg.c resp. rzg2l-cpg.h, for consistency with other (sub)drivers. Signed-off-by: Geert Uytterhoeven Reviewed-by: Lad Prabhakar Acked-by: Biju Das Link: https://lore.kernel.org/r/edc442daaedffcf10e835ff479d906fcae0e59db.1626268821.git.geert+renesas@glider.be commit d85b82f09a03c2e1f06da740c6c47dd098b16ca5 Author: Lad Prabhakar Date: Mon Jul 12 20:44:20 2021 +0100 clk: renesas: r9a07g044: Add GPIO clock and reset entries Add GPIO clock and reset entries in CPG driver. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20210712194422.12405-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d520af345189c04095bdd256d3601864601ac562 Author: Biju Das Date: Fri Jul 2 14:50:03 2021 +0100 clk: renesas: r9a07g044: Add SSIF-2 clock and reset entries Add SSIF-2 clock and reset entries in CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210702135010.5937-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 03fa6e4b2622035389a4beb9699551d63d130493 Author: Biju Das Date: Wed Jun 30 08:30:06 2021 +0100 clk: renesas: r9a07g044: 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/20210630073013.22415-5-biju.das.jz@bp.renesas.com [geert: s/usb0_device/usb0_func] Signed-off-by: Geert Uytterhoeven commit eb829e549ba65e48b1c16ddecb892a32b366d5e4 Author: Biju Das Date: Sat Jun 26 09:13:43 2021 +0100 clk: renesas: r9a07g044: Add DMAC clocks/resets Add DMAC clock and reset entries in CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210626081344.5783-10-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1962dd36db4ffe0411e3cb06f0797b7aacf0ca99 Author: Biju Das Date: Sat Jun 26 09:13:42 2021 +0100 clk: renesas: r9a07g044: Add I2C clocks/resets Add I2C{0,1,2,3} clock and reset entries. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210626081344.5783-9-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c346ff5ccc8e87f69a520073f876b740431a5acf Author: Kieran Bingham Date: Wed Jun 23 00:27:11 2021 +0100 clk: renesas: r8a779a0: Add the DSI clocks The DSI clock is incorrectly defined as a fixed clock. This demonstrates itself as the dsi-encoders failing to correctly enable and start their PPI and HS clocks internally, and causes failures. Move the DSI parent clock to match the updates in the BSP, which resolves the initialisation procedures. Signed-off-by: Kieran Bingham Fixes: 17bcc8035d2d19fc ("clk: renesas: cpg-mssr: Add support for R-Car V3U") Link: https://lore.kernel.org/r/20210622232711.3219697-3-kieran.bingham@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 417ed58dfc5ed6c2ec608d5ee93dd27197190e19 Author: Kieran Bingham Date: Wed Jun 23 00:27:10 2021 +0100 clk: renesas: r8a779a0: Add the DU clock The DU clock is added to the S3D1 clock parent. The Renesas BSP lists S2D1 as the clock parent, however there is no S2 clock on this platform. S3D1 is chosen as a best effort guess and demonstrates functionality but is not guaranteed to be correct. Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20210622232711.3219697-2-kieran.bingham@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit d23fcff14568d5a5e025b9c1185531caccd605db Author: Geert Uytterhoeven Date: Fri Jun 18 13:46:21 2021 +0200 clk: renesas: rzg2: Rename i2c-dvfs to iic-pmic As RZ/G2 SoCs do not support DVFS, the "iic-dvfs" module was renamed to "iic-pmic" in the RZ/G Series, 2nd Generation User’s Manual: Hardware Rev. 1.00. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/3e549b41989ff2797b998a1c749c9f607845f44a.1624016693.git.geert+renesas@glider.be commit 1606e81543f80fc3b1912957cf6d8fa62e40b8e5 Author: Lad Prabhakar Date: Thu Jun 17 16:54:32 2021 +0100 clk: renesas: rzg2l: Fix off-by-one check in rzg2l_cpg_clk_src_twocell_get() Fix clock index out of range check for module clocks in rzg2l_cpg_clk_src_twocell_get(). Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Reported-by: Dan Carpenter Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210617155432.18827-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e37868f14416bc5f22235dce073c496381d349c3 Author: Dan Carpenter Date: Thu Jun 17 17:15:10 2021 +0300 clk: renesas: rzg2l: Avoid mixing error pointers and NULL These functions accidentally return both error pointers and NULL when there is an error. It doesn't cause a problem but it is confusing and seems unintentional. Signed-off-by: Dan Carpenter Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/YMtY7nOtqEvTokh7@mwanda Signed-off-by: Geert Uytterhoeven commit 36aaa3a0d9bc13e302dc146a20f022fb6891b605 Author: Dan Carpenter Date: Thu Jun 17 17:14:11 2021 +0300 clk: renesas: rzg2l: Fix a double free on error The "pll_clk" and "clock" pointers are allocated with devm_kzalloc() so freeing them with kfree() will lead to a double free. This would only happen if probe failed, and the system is not bootable. Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Dan Carpenter Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/YMtYs7LVveYH4eRe@mwanda Signed-off-by: Geert Uytterhoeven commit 97c29755598f98c6c91f68f12bdd3f517e457890 Author: Yang Li Date: Thu Jun 17 10:22:03 2021 +0800 clk: renesas: rzg2l: Fix return value and unused assignment Currently the function returns NULL on error, so exact error code is lost. This patch changes return convention of the function to use ERR_PTR() on error instead. Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/1623896524-102058-1-git-send-email-yang.lee@linux.alibaba.com [geert: Drop curly braces] Signed-off-by: Geert Uytterhoeven commit d42d57fe86e98c2ab438e30c247d90504a146646 Author: Yang Li Date: Tue Jun 15 17:39:29 2021 +0800 clk: renesas: rzg2l: Remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/clk/renesas/renesas-rzg2l-cpg.c:299:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/1623749970-38020-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Geert Uytterhoeven commit b44ab6fdba6144c06ea543144b6888ac77fd2e17 Author: Colin Ian King Date: Thu Jun 17 09:13:12 2021 +0100 iio: light: si1145: remove redundant continue statement The continue statement at the end of a for-loop has no effect, remove it. Addresses-Coverity: ("Continue has no effect") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210617081312.151746-1-colin.king@canonical.com Signed-off-by: Jonathan Cameron commit 13efdc3dc9030972c81285e2dbdeac1f9cef880d Author: Paul Cercueil Date: Fri Jun 18 13:30:05 2021 +0100 iio: core: Support reading extended name as label The point of this new change is to make the IIO tree actually parsable. Before, given this attribute as a filename: in_voltage0_aux_sample_rate Userspace had no way to know if the attribute name was "aux_sample_rate" with no extended name, or "sample_rate" with "aux" as the extended name, or just "rate" with "aux_sample" as the extended name. This was somewhat possible to deduce when there was more than one attribute present for a given channel, e.g: in_voltage0_aux_sample_rate in_voltage0_aux_frequency There, it was possible to deduce that "aux" was the extended name. But even with more than one attribute, this wasn't very robust, as two attributes starting with the same prefix (e.g. "sample_rate" and "sample_size") would result in the first part of the prefix being interpreted as being part of the extended name. To address the issue, knowing that channels will never have both a label and an extended name, set the channel's label to the extended name. In this case, the label's attribute will also have the extended name in its filename, but we can live with that - userspace can open in_voltage0__label and verify that it returns to obtain the extended name. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20210618123005.49867-3-paul@crapouillou.net Signed-off-by: Jonathan Cameron commit 0e0761f86f10253425edac56df9950c172b923ea Author: Paul Cercueil Date: Fri Jun 18 13:30:04 2021 +0100 iio: core: Forbid use of both labels and extended names Extended names are a problem for user-space as they make the filenames in sysfs sometimes not parsable. They are now deprecated in favor of labels. This change makes sure that a device driver won't provide both labels and extended names for its channels. It has never been the case and we don't want it to happen. Signed-off-by: Paul Cercueil Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210618123005.49867-2-paul@crapouillou.net Signed-off-by: Jonathan Cameron commit e46a36d92da0ded4e8519bc46912edc0d5a9f4a7 Author: Baptiste Mansuy Date: Mon Jun 21 10:57:31 2021 +0200 Add startup time for each chip using inv_mpu6050 driver Add startup time for each chip familly. This allows a better behaviour of the gyro and the accel. The gyro has now the time to stabilise itself thus making initial data discarding for gyro irrelevant. Signed-off-by: Baptiste Mansuy Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20210621085731.9212-1-bmansuy@invensense.com Signed-off-by: Jonathan Cameron commit d372e5a19a8eb281428954b5edbd033d824f1bf0 Author: Alexandru Ardelean Date: Thu Jun 24 11:04:40 2021 +0300 iio: accel: adxl345: convert probe to device-managed functions This driver has two parts, one for i2c and one for spi, since the chip can operate with both wire protocols. The core file has a common adxl345_core_remove() function which puts the chip into a powerdown state. This can be implemented with a devm_add_action_or_reset() hook. Doing that means we can register the IIO device with devm_iio_device_register() and get rid of the adxl345_core_remove() function. The dev_set_drvdata() call can be removed as there is no other user of this private data anymore. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210624080441.8710-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 9ae8da91a22cdd916f20cc4ba59911d084c7e26e Author: Alexandru Ardelean Date: Thu Jun 24 11:05:34 2021 +0300 iio: light: tcs3414: convert probe to device-managed routines This change converts the driver to use only device-managed init routines in the probe function of the driver. This way, we no longer need the tcs3414_remove() hook. We still need to keep the i2c_set_clientdata() call, as that's being used for the PM routines. And lastly, a devm_add_action_or_reset() hook is added to call the powerdown handler when the chip is uninitialized or the probe fails. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210624080534.9209-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit d272e0ab5f4bcaf0a29e7606854cfb5a9b725758 Author: Alexandru Ardelean Date: Thu Jun 24 11:06:41 2021 +0300 iio: potentiometer: max5481: convert probe to device-managed The change converts the probe function to use the devm_iio_device_register() function. Before calling that, we need to register an action to store the wiper back to non-volatile memory when the device is de-registered. We don't need to do this if the probe fails, because the only place where the probe can fail now is devm_iio_device_register() and that shouldn't create an IIO device (for userspace to poke at) if it fails. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210624080641.9953-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit c359a80ca29099be951a1fa5c7529792cadf3e8f Author: Alexandru Ardelean Date: Thu Jun 24 11:19:24 2021 +0300 iio: temperature: tmp006: make sure the chip is powered up in probe When the device is probed, there's no guarantee that the device is not in power-down mode. This can happen if the driver is unregistered and re-probed. To make sure this doesn't happen, the value of the TMP006_CONFIG register (which is read in the probe function and stored in the device's private data) is being checked to see if the MOD bits have the correct value. This is a fix for a somewhat-rare corner case. As it stands, this doesn't look like a high priority to go into the Fixes route. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210624081924.15897-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 2bb3b8f69accde535daee238e0f707dec452e0e4 Author: Alexandru Ardelean Date: Thu Jun 24 11:19:23 2021 +0300 iio: temperature: tmp006: convert probe to device-managed This change converts the driver to register via devm_iio_device_register(). For the tmp006_powerdown() hook, this uses a devm_add_action() hook to put the device in powerdown mode when it's unregistered. With these changes, the remove hook can be removed. The i2c_set_clientdata() call is staying around as the private data is used in the PM routines. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210624081924.15897-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 3ce868bb0595be1e4d75b0e1a055f2dc0867d335 Author: Alexandru Ardelean Date: Fri Jun 25 17:01:37 2021 +0300 iio: accel: bma220: make suspend state setting more robust The datasheet mentions that the suspend mode is toggled by reading the suspend register. The reading returns value 0xFF if the system was in suspend mode, otherwise it returns value 0x00. The bma220_deinit() function does up to 2 reads, in case the device was in suspend mode, which suggests a level of paranoia that makes the logic in bma220_suspend() and bma220_resume() look insufficient. This change implements a bma220_power() function which does up to 2 reads of the suspend register to make sure that the chip enters a desired (suspended or normal) mode. If the transition fails, then -EBUSY is returned. Since only a reference to SPI device is required, we can remove the spi_set_drvdata() call and get the SPI device object from the base device object in the suspend/resume routines. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210625140137.362282-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit c336b611e9e48304589303b580292dd1bf6d4eb3 Author: Alexandru Ardelean Date: Fri Jun 25 17:01:36 2021 +0300 iio: accel: bma220: convert probe to device-managed functions This change converts the driver to use devm_iio_triggered_buffer_setup() and devm_iio_device_register() for initializing and registering the IIO device. The bma220_deinit() is converted into a callback for a devm_add_action_or_reset() hook, so that the device is put in stand-by when the driver gets uninitialized. The return value of the bma220_deinit() function isn't used as it does not add any value. On the error path of the probe function, this can just override the actual error with -EBUSY, or can even return 0 (no error), on the error path. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210625140137.362282-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit f21a5f7215420c513d2bb2d21fdf24c9a550922e Author: Jonathan Cameron Date: Sun Jun 27 17:32:44 2021 +0100 dt-bindings: iio: dac: microchip,mcp4922: Add missing binding document Simple binding for this family of microchip DACs. Signed-off-by: Jonathan Cameron Cc: Michael Welling Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-16-jic23@kernel.org commit 906b00437e71764624f666b75abfe45b087b17c8 Author: Jonathan Cameron Date: Sun Jun 27 17:32:43 2021 +0100 dt-bindings: iio: dac: adi,ad8801: Add missing binding document. This device was missing a binding document. Simple binding with the ad8803 requiring two both low and high references whilst the 8801 only has a high reference. Signed-off-by: Jonathan Cameron Cc: Gwenhael Goavec-Merou Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-15-jic23@kernel.org commit a714ee9ea0efe516fd13c1f29f41f6394b408492 Author: Jonathan Cameron Date: Sun Jun 27 17:32:42 2021 +0100 dt-bindings: iio: dac: adi,ad5791: Add missing bindings document Documenting existing bindings for this device. The Linux driver in theory 'works' without the two supplies that I have listed as required, but without a valid scale. As such I've documented it as required. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-14-jic23@kernel.org commit 96e137558d5823787a410c3c89d076fdc8b8c720 Author: Jonathan Cameron Date: Sun Jun 27 17:32:41 2021 +0100 dt-bindings: iio: dac: adi,ad5764: Add missing binding document This binding covers the ad5744, ad5744r, ad5764 and ad5764r DACs. Note that the driver currently assumes the internal reference is used for the r parts. The binding as defined relaxes this constraint. There is no support in the binding or driver for the two digital IO signals. I do not propose to add that until we have a means to test any such binding. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-13-jic23@kernel.org commit db8dc17e1fd820792804fa1e10ab8244b4abdd78 Author: Jonathan Cameron Date: Sun Jun 27 17:32:40 2021 +0100 dt-bindings: iio: dac: ad5761: Add missing binding doc. Straight forward binding with vref optional for those part with internal regulators, but required for those without. Signed-off-by: Jonathan Cameron Cc: Ricardo Ribalda Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-12-jic23@kernel.org commit 2d89b8b2c0bf8a49d9e7b5978afecc806666b5e7 Author: Jonathan Cameron Date: Sun Jun 27 17:32:39 2021 +0100 dt-bindings: iio: dac: ad5686 and ad5696: Add missing binding document. The use of vcc-supply for the reference voltage is unusual and should probably be deprecated as there is an explicit VREF pin on at least some of these parts. Signed-off-by: Jonathan Cameron Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-11-jic23@kernel.org commit b302c57bc9c7d11dbab7b70b9711506a63592617 Author: Jonathan Cameron Date: Sun Jun 27 17:32:38 2021 +0100 dt-bindings: iio: dac: ad5624r: Add missing binding document Simple binding, with optional vref. Note that the Linux driver does support vcc-supply for historical reasons, but lets not let that get into any bindings that are checked going forwards. Hence I have deliberately not documented it. Signed-off-by: Jonathan Cameron Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-10-jic23@kernel.org commit 97683c851f9cdbd3ea55697cbe2dcb6af4287bbd Author: Jonathan Cameron Date: Sun Jun 27 17:32:37 2021 +0100 iio: dac: ad5624r: Fix incorrect handling of an optional regulator. The naming of the regulator is problematic. VCC is usually a supply voltage whereas these devices have a separate VREF pin. Secondly, the regulator core might have provided a stub regulator if a real regulator wasn't provided. That would in turn have failed to provide a voltage when queried. So reality was that there was no way to use the internal reference. In order to avoid breaking any dts out in the wild, make sure to fallback to the original vcc naming if vref is not available. Signed-off-by: Jonathan Cameron Reported-by: kernel test robot Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-9-jic23@kernel.org commit 110ead307d5aede5ba1810f3ce8858d4cfa2e336 Author: Geert Uytterhoeven Date: Mon Jul 5 14:48:32 2021 +0200 arm64: dts: renesas: r8a77990: ebisu: Add I2C EEPROM for PMIC Add a device node for the I2C EEPROM which serves as external storage for the PMIC setup, as a backup of the internal OTP configuration. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/32443cd203ce2787d9a719d06a473b9e9cd508c2.1625489160.git.geert+renesas@glider.be commit 4ec82a7bb3db8c6005e715c63224c32d458917a2 Author: Geert Uytterhoeven Date: Thu Jul 1 12:15:50 2021 +0200 arm64: dts: renesas: r8a77995: draak: Remove bogus adv7511w properties The "max-clock" and "min-vrefresh" properties fail to validate with commit cfe34bb7a770c5d8 ("dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml"). Drop them, as they are parts of an out-of-tree workaround that is not needed upstream. Fixes: bcf3003438ea4645 ("arm64: dts: renesas: r8a77995: draak: Enable HDMI display output") Signed-off-by: Geert Uytterhoeven Acked-by: Laurent Pinchart Reviewed-by: Ulrich Hecht Link: https://lore.kernel.org/r/975b6686bc423421b147d367fe7fb9a0db99c5af.1625134398.git.geert+renesas@glider.be commit ecdd5a21aac9f6573999190ec55836acac5b9b83 Author: Adam Ford Date: Wed Jun 30 12:59:35 2021 -0500 arm64: dts: renesas: beacon: Enable micbias The IN3R is connected to an analog microphone, and it needs the micbias enabled in order to power the analog microphone. Signed-off-by: Adam Ford Link: https://lore.kernel.org/r/20210630175935.189454-1-aford173@gmail.com Signed-off-by: Geert Uytterhoeven commit 13df5e881d147d2390e207e854463a1c9bbb7b61 Author: Biju Das Date: Sat Jun 26 09:13:44 2021 +0100 arm64: dts: renesas: r9a07g044: Add I2C nodes Add I2C{0,1,2,3} nodes to RZ/G2L (R9A07G044) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20210626081344.5783-11-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit eab605c59a16169da368210d272b036c1d2e26bf Author: Geert Uytterhoeven Date: Wed Jun 23 16:59:25 2021 +0200 arm64: dts: renesas: r8a779a0: Restore sort order The thermal node was inserted at the wrong place, breaking sort order (sort by unit address, but group nodes of the same type). Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/8d68a7ce449aaf90a88e69397dbe0e9c467d5726.1624460175.git.geert+renesas@glider.be commit 4f929bba8fd8abc757dbe5bbda4ca9b43bebdf23 Author: Magnus Damm Date: Sun Jun 20 14:21:37 2021 +0900 arm64: dts: renesas: r8a77990: ebisu: Add SW4 support Add support for SW4 via "gpio-keys" on the R-Car E3 Ebisu board. Signed-off-by: Magnus Damm Link: https://lore.kernel.org/r/162416649714.11444.12659951671817146236.sendpatchset@octo Signed-off-by: Geert Uytterhoeven commit f90e3c06b25a539376d79122448aa53623c5b3f8 Author: Magnus Damm Date: Sun Jun 20 14:21:21 2021 +0900 arm64: dts: renesas: r8a77995: draak: Add SW56 support Add support for SW56 via "gpio-keys" on the R-Car D3 Draak board. Signed-off-by: Magnus Damm Link: https://lore.kernel.org/r/162416648156.11444.10425966868846910243.sendpatchset@octo Signed-off-by: Geert Uytterhoeven commit a636d8037ef6028a5a285acdfbfa35a488b6f9db Author: Geert Uytterhoeven Date: Fri Jun 18 13:47:59 2021 +0200 arm64: dts: renesas: rzg2: Rename i2c_dvfs to iic_pmic As RZ/G2 SoCs do not support DVFS, the "iic-dvfs" module was renamed to "iic-pmic" in the RZ/G Series, 2nd Generation User’s Manual: Hardware Rev. 1.00. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/3fee803a7464a3243e62a943a6a5dce8f1c65a2d.1624016811.git.geert+renesas@glider.be commit c6d2f832da7838a88687fc8adc01f2ccf715e099 Author: Geert Uytterhoeven Date: Fri Jun 18 13:04:10 2021 +0200 arm64: dts: renesas: r8a77990: Add generic compatible string to IIC node According to the Hardware User's Manual, automatic transmission for PMIC control (DVFS) is not available" on the R-Car E3 SoC. Experiments showed this really means that support for automatic DVFS is not present, while the IIC automatic transmission feature itself is still available, albeit not super useful. Hence there is no longer a reason not to declare compatibility with the R-Car Gen3-specific and generic versions. Accordingly, extend the reg property to cover the automatic transmission registers. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/7b68629350213ca8d37286a6ae6e1966f9958bb8.1624013699.git.geert+renesas@glider.be commit 57e47b783c3737ec1fabb7f16337ebfb51b4233c Author: Geert Uytterhoeven Date: Fri Jun 18 13:04:09 2021 +0200 arm64: dts: renesas: r8a774c0: Add generic compatible string to IIC node According to the Hardware User's Manual, automatic transmission for PMIC control (DVFS) is not available" on the RZ/G2E SoC. This really means that support for automatic DVFS is not present, while the IIC automatic transmission feature itself is still available, albeit not super useful. Hence there is no longer a reason not to declare compatibility with the R-Car Gen3-specific and generic versions. Accordingly, extend the reg property to cover the automatic transmission registers. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/d222c2faa63f95d672efa07e55e8d01bddd17e65.1624013699.git.geert+renesas@glider.be commit 0ceed25a5aef2fc55776ea569d43d6865921e8cc Author: Geert Uytterhoeven Date: Fri Jun 18 13:04:08 2021 +0200 ARM: dts: rzg1: Add generic compatible strings to IIC nodes According to the Hardware User's Manual, automatic transmission for PMIC control (DVFS) is not available" on RZ/G1 SoCs. This really means that support for automatic DVFS is not present, while the IIC automatic transmission feature itself is still available, albeit not super useful. Hence there is no longer a reason not to declare compatibility with the R-Car Gen2-specific and generic versions. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/573c8ca99f3924a96000fb328a84f1f6d421c6af.1624013699.git.geert+renesas@glider.be commit cfda8203778074fab8df5920bcc249f23ac35792 Author: Geert Uytterhoeven Date: Fri Jun 11 12:18:41 2021 +0200 ARM: dts: r8a73a4: Remove non-functional DMA support The DMA multiplexer node and one DMA controller instance are present, but DMA support was never fully enabled, cfr. commit a19788612f51b787 ("dmaengine: sh: Remove R-Mobile APE6 support"). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/21d4e03c906f5a4a6d9bf5d88d0fc94c069e6325.1623406640.git.geert+renesas@glider.be commit 3a44a8d130e15939e30f37086055055893c91a02 Author: Geert Uytterhoeven Date: Mon Jun 7 19:39:05 2021 +0200 arm64: dts: renesas: salvator-xs: Factor out USB ch3 parts Move the parts related to the fourth USB2 interface on Salvator-XS boards to salvator-xs.dtsi, to avoid future duplication of board descriptions. As this interface is not present on all SoCs that can be found on Salvator-X(S), but only on R-Car H3 ES2.0+, its descriptions are protected by the preprocessor symbol SOC_HAS_USB2_CH3, defined in r8a77951.dtsi, and undefined in r8a77950.dtsi. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/411df1adfd64ee82e5a0d1603df85d657fd4f8c0.1623087028.git.geert+renesas@glider.be commit d18fb00dd0885d547ca67eab88f72e4cc382a4e5 Author: Geert Uytterhoeven Date: Mon Jun 7 19:39:04 2021 +0200 arm64: dts: renesas: salvator-x(s): Factor out USB ch2 parts Move the common parts related to the third USB2 interface on Salvator-X(S) boards to salvator-common.dtsi, to reduce current and avoid future duplication of board descriptions. As this interface is not present on all SoCs that can be found on Salvator-X(S), but only on R-Car H3, its descriptions are protected by the preprocessor symbol SOC_HAS_USB2_CH2, defined in r8a77951.dtsi. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/ebc434502fc899b1f9d9640f560c3eaab6bb0927.1623087028.git.geert+renesas@glider.be commit 90a4ee4ba5cf5aae491bae4ad6fe75e05d28cc22 Author: Geert Uytterhoeven Date: Mon Jun 7 19:39:03 2021 +0200 arm64: dts: renesas: salvator-x(s): Factor out SATA parts Move the common parts related to the SATA interface on Salvator-X(S) boards to salvator-common.dtsi and salvator-xs.dtsi, to reduce current and avoid future duplication of board descriptions. As this interface is not present on all SoCs that can be found on Salvator-X(S), but only on R-Car H3 and M3-N, its descriptions are protected by the preprocessor symbol SOC_HAS_SATA, defined in r8a77951.dtsi and r8a77965.dtsi. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/87f91290ec7b523aa508e920a169ecaddccc9144.1623087028.git.geert+renesas@glider.be commit 8fbb8c334ff13a6afd88c73e85684bc7b82bd775 Author: Geert Uytterhoeven Date: Mon Jun 7 19:39:02 2021 +0200 arm64: dts: renesas: salvator-x(s): Factor out HDMI1 parts Move the common parts related to the second HDMI interface on Salvator-X(S) boards to salvator-common.dtsi, to reduce current and avoid future duplication of board descriptions. As this interface is not present on all SoCs that can be found on Salvator-X(S), but only on R-Car H3, its description are protected by the preprocessor symbol SOC_HAS_HDMI1, defined in r8a77951.dtsi. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/a1d9dcd481d36e5b6e78934e587f6391022030b5.1623087028.git.geert+renesas@glider.be commit d347d745f06c7e6503abc08f68dc3b71da71596d Author: Namjae Jeon Date: Fri Jul 16 16:39:54 2021 +0900 ksmbd: move credit charge verification over smb2 request size verification Move credit charge verification over smb2 request size verification to avoid being skipped. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 67307023d02b1339e0b930b742fe5a9cd81284ca Author: Namjae Jeon Date: Fri Jul 16 14:52:46 2021 +0900 ksmbd: set STATUS_INVALID_PARAMETER error status if credit charge is invalid MS-SMB2 specification describe : If the calculated credit number is greater than the CreditCharge, the server MUST fail the request with the error code STATUS_INVALID_PARAMETER. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 58090b175271870842d823622013d4499f462a10 Author: Namjae Jeon Date: Fri Jul 16 14:52:09 2021 +0900 ksmbd: fix wrong error status return on session setup When user insert wrong password, ksmbd return STATUS_INVALID_PARAMETER error status to client. It will make user confusing whether it is not password problem. This patch change error status to STATUS_LOGON_FAILURE. and return STATUS_INSUFFICIENT_RESOURCES if memory allocation failed on session setup. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e4b60e92d4f878b774eca22fa4c00fa04f6354b4 Author: Namjae Jeon Date: Fri Jul 16 14:51:30 2021 +0900 ksmbd: fix wrong compression context size Use smb2_compression_ctx instead of smb2_encryption_neg_context. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f2af8ffc63a184ab425e0a02308f7fdcf8a53f1c Author: James Smart Date: Wed Jul 7 11:43:51 2021 -0700 scsi: lpfc: Copyright updates for 12.8.0.11 patches Update copyrights for files modified by the 12.8.0.11 patch set. Link: https://lore.kernel.org/r/20210707184351.67872-21-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 545a68e711ee4d6ed11cec956bb06cb52c95e83a Author: James Smart Date: Wed Jul 7 11:43:50 2021 -0700 scsi: lpfc: Update lpfc version to 12.8.0.11 Update lpfc version to 12.8.0.11. Link: https://lore.kernel.org/r/20210707184351.67872-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 ab803860882514ddbf97713b143b861b524e8476 Author: James Smart Date: Wed Jul 7 11:43:49 2021 -0700 scsi: lpfc: Skip issuing ADISC when node is in NPR state When a node moves to NPR state due to a device recovery event, the nlp_fc4_types in the node are cleared. An ADISC received for a node in the NPR state triggers an ADISC. Without fc4 types being known, the calls to register with the transport are no-op'd, thus no additional references are placed on the node by transport re-registrations. A subsequent RSCN could trigger another unregister request, which will decrement the reference counts, leading to the ref count hitting zero and the node being freed while futher discovery on the node is being attempted by the RSCN event handling. Fix by skipping the trigger of an ADISC when in NPR state. The normal ADISC process will kick off in the regular discovery path after receiving a response from name server. Link: https://lore.kernel.org/r/20210707184351.67872-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 02607fbaf00d9aac8fe97b1d9643f09ebdb47922 Author: James Smart Date: Wed Jul 7 11:43:48 2021 -0700 scsi: lpfc: Skip reg_vpi when link is down for SLI3 in ADISC cmpl path During RSCN storms, some instances of LIP on SLI-3 adapters lead to a situation where FLOGIs keep failing with firmware indicating an illegal command error code. This situation was preceded by an ADISC completion that was processed while the link was down. This path on SLI-3 performs a CLEAR_LA and attempts to activate a VPI with REG_VPI. Later, as the FLOGI completes, it's no longer in sync with the VPI state. In SLI-3 it is illegal to have an active VPI during FLOGI. Resolve by circumventing the SLI-3 path that performs the CLEAR_LA and REG_VPI. The path will be taken after the FLOGI after the next Link Up. Link: https://lore.kernel.org/r/20210707184351.67872-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 c65436b21c3abbdaacd9c9f68bf2fa94e103168d Author: James Smart Date: Wed Jul 7 11:43:47 2021 -0700 scsi: lpfc: Call discovery state machine when handling PLOGI/ADISC completions In the PLOGI and ADISC completion handling, the device removal event could be skipped during some link errors. This could leave a stale node in UNUSED state. Driver unload would hang for a long time waiting for this node to be freed. Resolve by taking the following steps: - Always post ADISC completion events to discovery state machine upon ADISC completion. - In case of a completion error for PLOGI/ADISC, ensure that init refcount is dropped if not registered with transport. Link: https://lore.kernel.org/r/20210707184351.67872-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 0614568361b0c1827f999b1fff21223a496c740b Author: James Smart Date: Wed Jul 7 11:43:46 2021 -0700 scsi: lpfc: Delay unregistering from transport until GIDFT or ADISC completes On an RSCN event, the nodes specified in RSCN payload and in MAPPED state are moved to NPR state in order to revalidate the login. This triggers an immediate unregister from SCSI/NVMe backend. The assumption is that the node may be missing. The re-registration with the backend happens after either relogin (PLOGI/PRLI; if ADISC is disabled or login truly lost) or when ADISC completes successfully (rediscover with ADISC enabled). However, the NVMe-FC standard provides for an RSCN to be triggered when the remote port supports a discovery controller and there was a change of discovery log content. As the remote port typically also supports storage subsystems, this unregister causes all storage controller connections to fail and require reconnect. Correct by reworking the code to ensure that the unregistration only occurs when a login state is truly terminated, thereby leaving the NVMe storage controllers in place. The changes made are: - Retain node state in ADISC_ISSUE when scheduling ADISC ELS retry. - Do not clear wwpn/wwnn values upon ADISC failure. - Move MAPPED nodes to NPR during RSCN processing, but do not unregister with transport. On GIDFT completion, identify missing nodes (not marked NLP_NPR_2B_DISC) and unregister them. - Perform unregistration for nodes that will go through ADISC processing if ADISC completion fails. - Successful ADISC completion will move node back to MAPPED state. Link: https://lore.kernel.org/r/20210707184351.67872-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 816bd88dffc5716d8bff7cce9dbaa19ef375bc97 Author: James Smart Date: Wed Jul 7 11:43:45 2021 -0700 scsi: lpfc: Enable adisc discovery after RSCN by default Assign a default value of 1 to driver module parameter lpfc_use_adisc. Link: https://lore.kernel.org/r/20210707184351.67872-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 137ddf0384722afef308dd40696fba55e6680ad2 Author: James Smart Date: Wed Jul 7 11:43:44 2021 -0700 scsi: lpfc: Use PBDE feature enabled bit to determine PBDE support The SLI4 interface changed the manner used to indicate PBDE support. Rework the driver to check for PBDE support via the PBDE feature bit in COMMON_GET_SLI4_PARAMETERS. Link: https://lore.kernel.org/r/20210707184351.67872-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 a9978e3978406ef5e35870b10e677cf75a2620b6 Author: James Smart Date: Wed Jul 7 11:43:43 2021 -0700 scsi: lpfc: Clear outstanding active mailbox during PCI function reset Mailbox commands sent via ioctl/bsg from user applications may be interrupted from processing by a concurrently triggered PCI function reset. The command will not generate a completion due to the reset. This results in a user application hang waiting for the mailbox command to complete. Resolve by changing the function reset handler to detect that there was an outstanding mailbox command and simulate a mailbox completion. Add some additional debug when a mailbox command times out. Link: https://lore.kernel.org/r/20210707184351.67872-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 affbe24429410fddf4e50ca456c090ed6d8e05bf Author: James Smart Date: Wed Jul 7 11:43:42 2021 -0700 scsi: lpfc: Fix KASAN slab-out-of-bounds in lpfc_unreg_rpi() routine In lpfc_offline_prep() an RPI is freed and nlp_rpi set to 0xFFFF before calling lpfc_unreg_rpi(). Unfortunately, lpfc_unreg_rpi() uses nlp_rpi to index the sli4_hba.rpi_ids[] array. In lpfc_offline_prep(), unreg rpi before freeing the rpi. Link: https://lore.kernel.org/r/20210707184351.67872-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 e78c006f4c888231cdabb8a4286ba17980a903fa Author: James Smart Date: Wed Jul 7 11:43:41 2021 -0700 scsi: lpfc: Remove REG_LOGIN check requirement to issue an ELS RDF Since the REG_LOGIN to the fabric controller happens in parallel with SCR, it may or may not be completed by the time RDF is sent. RDF and SCR are sent to the fabric in parallel, so checking for a completed REG_LOGIN in the RDF submit path is not needed. Remove the REG_LOGI check from the RDF submission path. Link: https://lore.kernel.org/r/20210707184351.67872-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 cd6047e92c6a5b0a44479cf98f76aac56ddfe108 Author: James Smart Date: Wed Jul 7 11:43:40 2021 -0700 scsi: lpfc: Fix memory leaks in error paths while issuing ELS RDF/SCR request The ELS job request structure, that is allocated while issuing ELS RDF/SCR request path, is not being released in an error path causing a memory leak message on driver unload. Free the ELS job structure in the error paths. Link: https://lore.kernel.org/r/20210707184351.67872-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 2d338eb55b14ab9d245e8b1d982adecca8c4c613 Author: James Smart Date: Wed Jul 7 11:43:39 2021 -0700 scsi: lpfc: Fix NULL ptr dereference with NPIV ports for RDF handling RDF ELS handling for NPIV ports may result in an incorrect NDLP reference count. In the event of a persistent link down, this may lead to premature release of an NDLP structure and subsequent NULL ptr dereference panic. Remove extraneous lpfc_nlp_put() call in NPIV port RDF processing. Link: https://lore.kernel.org/r/20210707184351.67872-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 4e670c8afd47d535f65edf0d2b7f54f103fd59a2 Author: James Smart Date: Wed Jul 7 11:43:38 2021 -0700 scsi: lpfc: Keep NDLP reference until after freeing the IOCB after ELS handling In the routine that generically cleans up an ELS after completion, the NDLP put is done prior to the freeing of the IOCB. The IOCB may reference the NDLP. Move the lpfc_nlp_put() after freeing the IOCB. Link: https://lore.kernel.org/r/20210707184351.67872-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 21990d3d1861c7aa8e3e4ed98614f0c161c29b0c Author: James Smart Date: Wed Jul 7 11:43:37 2021 -0700 scsi: lpfc: Fix target reset handler from falsely returning FAILURE Previous logic accidentally overrides the status variable to FAILURE when target reset status is SUCCESS. Refactor the non-SUCCESS logic of lpfc_vmid_vport_cleanup(), which resolves the false override. Link: https://lore.kernel.org/r/20210707184351.67872-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 e77803bdbf0aad98d36b1d3fa082852831814edd Author: James Smart Date: Wed Jul 7 11:43:36 2021 -0700 scsi: lpfc: Discovery state machine fixes for LOGO handling If a LOGO is received for a node that is in the NPR state, post a DEVICE_RM event to allow clean up of the logged out node. Clearing the NLP_NPR_2B_DISC flag upon receipt of a LOGO ACC may cause skipping of processing outstanding PLOGIs triggered by parallel RSCN events. If an outstanding PLOGI is being retried and receipt of a LOGO ACC occurs, then allow the discovery state machine's PLOGI completion to clean up the node. Link: https://lore.kernel.org/r/20210707184351.67872-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 50baa1595d30412177da3b22625bffc1ce4f65d5 Author: James Smart Date: Wed Jul 7 11:43:35 2021 -0700 scsi: lpfc: Fix function description comments for vmid routines Update comment headers for functions lpfc_vmid_cmd and lpfc_vmid_poll. Link: https://lore.kernel.org/r/20210707184351.67872-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 16a93e83c87edab9ea646be879a1cbbe7bf3bca6 Author: James Smart Date: Wed Jul 7 11:43:34 2021 -0700 scsi: lpfc: Improve firmware download logging Define additional status fields in mailbox commands to help provide additional information when downloading new firmware. Link: https://lore.kernel.org/r/20210707184351.67872-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 e8613084053d406c22914385a488e8b85072100c Author: James Smart Date: Wed Jul 7 11:43:33 2021 -0700 scsi: lpfc: Remove use of kmalloc() in trace event logging There are instances when trace event logs are triggered from an interrupt context. The trace event log may attempt to alloc memory causing scheduling while atomic bug call traces. Remove the need for the kmalloc'ed vport array when checking the log_verbose flag, which eliminates the need for any allocation. Link: https://lore.kernel.org/r/20210707184351.67872-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 ae463b60235e7a5decffbb0bd7209952ccda78eb Author: James Smart Date: Wed Jul 7 11:43:32 2021 -0700 scsi: lpfc: Fix NVMe support reporting in log message The NVMe support indicator in log message 6422 is displaying a field that was initialized but never set to indicate NVMe support. Remove obsolete nvme_support element from the lpfc_hba structure and change log message to display NVMe support status as reported in SLI4 Config Parameters mailbox command. Link: https://lore.kernel.org/r/20210707184351.67872-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 320424c7d44f54c18df9812fd7c45f6963524002 Merge: f8f84af5da9ee 62fb9874f5da5 Author: Dmitry Torokhov Date: Sun Jul 18 18:56:58 2021 -0700 Merge tag 'v5.13' into next Sync up with the mainline to get the latest parport API. commit 904b5bfaa8fe2be032ea81ee95fa28efe21fbef0 Author: Christoph Hellwig Date: Mon Jul 12 08:09:27 2021 +0200 scsi: aacraid: Remove an unused include flush_kernel_dcache_page() is not used by aacraid, and this header already comes in through the scatterlist/block headers anyway. Link: https://lore.kernel.org/r/20210712060928.4161649-6-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 37306698c3d023c10a2b1a01baac3089b52412f6 Author: Colin Ian King Date: Fri Jul 2 14:15:42 2021 +0100 scsi: qla2xxx: Remove redundant continue statement in a for-loop The continue statement at the end of the for-loop is redundant, remove it. Link: https://lore.kernel.org/r/20210702131542.19880-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Continue has no effect") commit 7b0ddc1346089b62b45e688e350c9e1c3f7a3ab2 Author: Mike Christie Date: Thu Jul 1 14:08:40 2021 -0500 scsi: be2iscsi: Fix use-after-free during IP updates This fixes a bug found by Lv Yunlong where, because beiscsi_exec_nemb_cmd() frees memory for the be_dma_mem cmd(), we can access freed memory when beiscsi_if_clr_ip()/beiscsi_if_set_ip()'s call to beiscsi_exec_nemb_cmd() fails and we access the freed req. This fixes the issue by having the caller free the cmd's memory. Link: https://lore.kernel.org/r/20210701190840.175120-1-michael.christie@oracle.com Reported-by: Lv Yunlong Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 00e9e776fa197592addc1f3002c63585f884a5dd Author: Tao Ren Date: Sun Jul 18 17:17:24 2021 -0700 ARM: dts: aspeed: wedge100: Enable ADC channels Enable the ADC voltage sensoring channels used by Wedge100. Signed-off-by: Tao Ren Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210719001724.6410-5-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit 5501ab03b9f1412a44e993e469f9375276de5399 Author: Tao Ren Date: Sun Jul 18 17:17:23 2021 -0700 ARM: dts: aspeed: galaxy100: Remove redundant ADC device Remove ADC device from galaxy100 device tree because the device is already enabled in "ast2400-facebook-netbmc-common.dtsi". Signed-off-by: Tao Ren Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210719001724.6410-4-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit c8a66b42d689e2b90878416e4b83a7ed3f58b708 Author: Tao Ren Date: Sun Jul 18 17:17:22 2021 -0700 ARM: dts: aspeed: wedge40: Remove redundant ADC device Remove ADC device from wedge40 device tree because the device is already enabled in "ast2400-facebook-netbmc-common.dtsi". Signed-off-by: Tao Ren Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210719001724.6410-3-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit cc8606c58988d0071f9e5f7f6d3cff52174cff83 Author: Tao Ren Date: Sun Jul 18 17:17:21 2021 -0700 ARM: dts: aspeed: Enable ADC in Facebook AST2400 common dtsi Enable ADC controller in "ast2400-facebook-netbmc-common.dtsi" because the device is used on all the Facebook AST2400 BMC platforms. Signed-off-by: Tao Ren Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210719001724.6410-2-rentao.bupt@gmail.com Signed-off-by: Joel Stanley commit ded3e2864c735f33ba5abbbe2d7b1c6605242f9b Author: Andrew Jeffery Date: Tue Jul 13 09:06:42 2021 +0930 ARM: dts: everest: Add phase corrections for eMMC The values were determined via scope measurements. With the patch we can write and read data without issue where as booting the system without the patch failed at the point of mounting the rootfs. Signed-off-by: Andrew Jeffery Link: https://lore.kernel.org/r/20210712233642.3119722-1-andrew@aj.id.au Fixes: faffd1b2bde3 ("ARM: dts: everest: Add phase corrections for eMMC") Signed-off-by: Joel Stanley commit 419cc0b8c127193f6f447b905b1240765d2087c7 Author: Ping Guo Date: Wed May 26 17:22:06 2021 +0800 ARM: dts: aspeed: Add Inspur NF5280M6 BMC machine The Inspur NF5280M6 is an x86 platform server with an AST2500-based BMC. This dts file provides a basic configuration for its OpenBMC development. Signed-off-by: George Liu Signed-off-by: Ping Guo Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20210526092206.22760-1-guopingjn@gmail.com Signed-off-by: Joel Stanley commit 8c295b7f3d01359ff4336fcb6e406e6ed37957d6 Author: Dylan Hung Date: Thu Oct 29 14:27:23 2020 +0800 ARM: dts: aspeed-g6: Fix HVI3C function-group in pinctrl dtsi The HVI3C shall be a group of I3C function, not an independent function. Correct the function name from "HVI3C" to "I3C". Signed-off-by: Dylan Hung Reviewed-by: Andrew Jeffery Fixes: f510f04c8c83 ("ARM: dts: aspeed: Add AST2600 pinmux nodes") Link: https://lore.kernel.org/r/20201029062723.20798-1-dylan_hung@aspeedtech.com Signed-off-by: Joel Stanley commit 1c0810e79cb3d2c46bb8f2a3e98609de1f009f3e Author: Keoseong Park Date: Mon Jun 28 14:58:01 2021 +0900 scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed() Simplify if-else statement to return statement and remove code related to CONFIG_SCSI_UFS_DWC that is not in use. Link: https://lore.kernel.org/r/1891546521.01624860001810.JavaMail.epsvc@epcpadp3 Cc: Joao Pinto Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Keoseong Park Signed-off-by: Martin K. Petersen commit 0d6835ffe50c9c1f098b5704394331710b67af48 Author: Marek Vasut Date: Sat Jul 17 14:32:49 2021 +0200 net: phy: Fix data type in DP83822 dp8382x_disable_wol() The last argument of phy_clear_bits_mmd(..., u16 val); is u16 and not int, just inline the value into the function call arguments. No functional change. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: David S. Miller Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 96cd2dd65bb0b94c908f2df32bba7350fc1b954e Author: Lior Nahmanson Date: Mon Dec 28 10:38:12 2020 +0200 net/mlx5: Add DCS caps & fields support This fields will be needed when adding a support for DCS offload max_dci_stream_channels - maximum DCI stream channels supported per DCI. max_dci_errored_streams - maximum DCI error stream channels supported per DCI before a DCI move to error state. Signed-off-by: Lior Nahmanson Signed-off-by: Leon Romanovsky commit 23d2b94043ca8835bd1e67749020e839f396a1c2 Author: Liu Jian Date: Fri Jul 16 12:06:17 2021 +0800 igmp: Add ip_mc_list lock in ip_check_mc_rcu I got below panic when doing fuzz test: Kernel panic - not syncing: panic_on_warn set ... CPU: 0 PID: 4056 Comm: syz-executor.3 Tainted: G B 5.14.0-rc1-00195-gcff5c4254439-dirty #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x7a/0x9b panic+0x2cd/0x5af end_report.cold+0x5a/0x5a kasan_report+0xec/0x110 ip_check_mc_rcu+0x556/0x5d0 __mkroute_output+0x895/0x1740 ip_route_output_key_hash_rcu+0x2d0/0x1050 ip_route_output_key_hash+0x182/0x2e0 ip_route_output_flow+0x28/0x130 udp_sendmsg+0x165d/0x2280 udpv6_sendmsg+0x121e/0x24f0 inet6_sendmsg+0xf7/0x140 sock_sendmsg+0xe9/0x180 ____sys_sendmsg+0x2b8/0x7a0 ___sys_sendmsg+0xf0/0x160 __sys_sendmmsg+0x17e/0x3c0 __x64_sys_sendmmsg+0x9e/0x100 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x462eb9 Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3df5af1c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462eb9 RDX: 0000000000000312 RSI: 0000000020001700 RDI: 0000000000000007 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3df5af26bc R13: 00000000004c372d R14: 0000000000700b10 R15: 00000000ffffffff It is one use-after-free in ip_check_mc_rcu. In ip_mc_del_src, the ip_sf_list of pmc has been freed under pmc->lock protection. But access to ip_sf_list in ip_check_mc_rcu is not protected by the lock. Signed-off-by: Liu Jian Signed-off-by: David S. Miller commit 790a352b6f125e0d22edc0ae479bb2f2ef930fe3 Author: Jonathan Cameron Date: Sun Jun 27 17:32:36 2021 +0100 dt-bindings: iio: dac: ad5504: Add missing binding document Binding for this high voltage DAC with temperature event signal. Signed-off-by: Jonathan Cameron Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-8-jic23@kernel.org commit 609bf552b034f62e8775153d943524a1ed4dbc2a Author: Jonathan Cameron Date: Sun Jun 27 17:32:35 2021 +0100 dt-bindings: iio: dac: ad5449: Add missing binding document. Documenting existing binding, so little flexibility available. 2 channel devices that require separate reference voltages. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-7-jic23@kernel.org commit 5992d5a6b563bcf4313d8c06b957052b131eba6d Author: Jonathan Cameron Date: Sun Jun 27 17:32:33 2021 +0100 dt-bindings: iio: dac: ad5380: Add missing binding document A simple binding for this particular DAC familly. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-5-jic23@kernel.org commit 0688cc60d579e9d122cbf81b7d185d711d0e3989 Author: Jonathan Cameron Date: Sun Jun 27 17:32:32 2021 +0100 dt-bindings: iio: dac: adi,ad5360: Add missing binding document Bindings for the family of many channel DACs. Fairly straight forward with just a differing number of voltage references (an extra one for the 40 channel ad4371) Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-4-jic23@kernel.org commit 613c403a7f978dddfd213e687a3ab6d104e50def Author: Jonathan Cameron Date: Sun Jun 27 17:32:31 2021 +0100 dt-bindings: iio: dac: adi,ad5064: Document bindings for many different DACs Note this is documenting bindings that have effectively existing ever since this driver was merged. The naming conventions for the ADI parts are inconsistent on the data sheets which has lead to a mixture of -X and -reference voltage part naming. We could attempt to clean this up, but as we are stuck supporting the existing binding it is probably not worthwhile. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-3-jic23@kernel.org commit 4f0964f70fcf077e9f9a95ee5be71ff8be1c2b51 Author: Jonathan Cameron Date: Sun Jun 27 17:32:30 2021 +0100 dt-bindings: iio: dac: adi,ad5421: Add missing binding document. This is documented what is currently the case. There are a number of things that could be added, but I don't feel the binding elements are obvious enough to document without a driver implementation to verify they are good choices. These include * Range * Regulators, both input and potentially output (if the loop being driven is ever described). I've listed Lars and myself as maintainers of the binding, but if anyone else wants to be added they would be most welcome! Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Reviewed-by: Rob Herring Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20210627163244.1090296-2-jic23@kernel.org commit 3d9efa9bd34f20d16251ad5d41fb42d27adb6b74 Author: Alexandru Ardelean Date: Mon Jun 28 17:17:09 2021 +0300 iio: accel: da280: convert probe to device-managed functions This is another simple conversion to device-managed functions, requiring the use of devm_iio_device_register() and moving the disabling of the device on a devm_add_action_or_reset() hook. The i2c_set_clientdata() can be removed, as the PM functions can work with just the device object, to obtain the i2c_client object. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210628141709.80534-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 074e1ddb87825c36ca3771ffbab23fee9204a82a Author: Alexandru Ardelean Date: Wed Jun 30 15:03:38 2021 +0300 iio: accel: da311: convert probe to device-managed functions This is another simple conversion to device-managed functions, requiring the use of devm_iio_device_register() and moving the disabling of the device on a devm_add_action_or_reset() hook. The i2c_set_clientdata() can be removed, as the PM functions can work with just the device object, to obtain the i2c_client object. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210630120338.482426-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 689f584b9858393809dc28046a7b51f9535d913d Author: Alexandru Ardelean Date: Wed Jun 30 15:15:09 2021 +0300 iio: accel: dmard10: convert probe to device-managed functions This is another simple conversion to device-managed functions, requiring the use of devm_iio_device_register() and moving the disabling of the device on a devm_add_action_or_reset() hook. The i2c_set_clientdata() can be removed, as the PM functions can work with just the device object, to obtain the i2c_client object. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210630121509.653717-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 148da125a0c825aa1576602391d6eece6568226f Author: Alexandru Ardelean Date: Wed Jun 30 16:16:36 2021 +0300 iio: proximity: rfd77402: convert probe to device-managed functions This change converts the probe hook to register the IIO device with devm_iio_device_register() and register a hook with devm_add_action_or_reset() to put the device in powerdown when the driver gets unloaded. Since the PM suspend/resume functions need only a reference to the i2c_client object (which can be obtained from the base device object), the i2c_set_clientdata() call can be removed. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210630131636.1563148-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 09d5135b6ffcb243580a4a77f299a0253a94f5e3 Author: Alexandru Ardelean Date: Wed Jun 30 16:16:35 2021 +0300 iio: proximity: rfd77402: use i2c_client for rfd77402_{init,powerdown}() These 2 functions only do I2C reads/writes and don't require any of the private data of the driver. They're also used in the PM suspend/resume part of the driver. Converting them to take an i2c_client object as parameter simplifies things a bit (especially in the suspend/resume) as the driver mostly needs the reference for i2c_client, so no need to jump through hoops to get it from the private data (as was done in many places). The rfd77402_measure() function has also been converted to take an i2c_client object, since it also does only I2C ops. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210630131636.1563148-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit bb761e722f6dff05b94bdfff8a7209a442f220ff Author: Alexandru Ardelean Date: Mon Jul 5 10:14:56 2021 +0300 iio: light: adjd_s311: convert probe to device-managed functions Now that the driver's buffer is stored on the adjd_s311_data private object, the driver is a simple conversion to use only device-managed functions in the probe. The iio_triggered_buffer_setup() and iio_device_register() functions are the only ones needing conversion. And i2c_set_clientdata() is no longer required. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210705071456.649659-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 2427a7e95ca9c72807f5cf57afee093eeccb79d3 Author: Alexandru Ardelean Date: Mon Jul 5 10:14:55 2021 +0300 iio: light: adjd_s311: move buffer on adjd_s311_data object This change moves the entire buffer on the private adjd_s311_data type. Since the device has 4 channels, it's not a big waste to just allocate the maximum possible buffer and use only what's needed. This is in contrast with free-ing and re-allocating the buffer on the update_scan_mode hook. Since the driver pushes buffer data with iio_push_to_buffers_with_timestamp(), the buffer must also include a 64-bit buffer for the timestamp, for each sample-set. With this change, the adjd_s311_update_scan_mode() is no longer needed. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210705071456.649659-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 7786da3b5ae167c17f35e22ba35e06006338c2f6 Author: Simon Xue Date: Mon Jul 12 09:45:07 2021 +0800 iio: adc: rockchip_saradc: add support for rk3568 saradc It is similar to other devices, but with 8 channels. Signed-off-by: Simon Xue Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210712014507.97477-1-xxm@rock-chips.com Signed-off-by: Jonathan Cameron commit edf021d14511e59c4618396ec6f5206c484f89df Author: Simon Xue Date: Mon Jul 12 09:44:37 2021 +0800 dt-bindings: iio: adc: rockchip-saradc: add description for rk3568 Add description for rk3568 saradc. Signed-off-by: Simon Xue Reviewed-by: Heiko Stuebner Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210712014437.97427-1-xxm@rock-chips.com Signed-off-by: Jonathan Cameron commit d21fed0675cd190bf35b9c2e3031c6064531734b Author: Christophe JAILLET Date: Wed Jul 14 13:14:51 2021 +0200 iio: buffer: Move a sanity check at the beginning of 'iio_scan_mask_set()' This is more standard to have sanity checks at the entry of a function, instead of allocating some memory first and having to free it if a condition is not met. Shuffle code a bit to check 'masklength' before calling 'bitmap_alloc()' Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/98a351adda1908c306e981b9cc86d3dbc79eb5ec.1626261211.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron commit 458516508df977efd3ff043d5ff77cad2d8f9d64 Author: Christophe JAILLET Date: Wed Jul 14 13:14:41 2021 +0200 iio: buffer: Save a few cycles in 'iio_scan_mask_set()' Use 'bitmap_alloc()' instead of 'bitmap_zalloc()' because the bitmap is fully overridden by a 'bitmap_copy()' call just after its allocation. While at it, fix the style of a NULL check. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/89d8a766eb971eda1ee362444a8711037bdb208c.1626261211.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron commit 57f6190a60ecc19f1ddddac0d7ea6524229271a9 Author: Linus Walleij Date: Thu Jul 15 00:50:02 2021 +0200 drm/panel: ws2401: Add driver for WideChips WS2401 This adds a driver for panels based on the WideChips WS2401 display controller. This display controller is used in the Samsung LMS380KF01 display found in the Samsung GT-I8160 (Codina) mobile phone and possibly others. As is common with Samsung displays manufacturer commands are necessary to configure the display to a working state. The display optionally supports internal backlight control, but can also use an external backlight. This driver re-uses the DBI infrastructure to communicate with the display. Cc: phone-devel@vger.kernel.org Cc: Douglas Anderson Reviewed-by: Noralf Trønnes Reviewed-by: Douglas Anderson Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210714225002.1065107-2-linus.walleij@linaro.org commit f82ff130a5e6a0263cb6161fb44ee79f781fea80 Author: Linus Walleij Date: Thu Jul 15 00:50:01 2021 +0200 drm/panel: Add DT bindings for Samsung LMS380KF01 This adds device tree bindings for the Samsung Mobile Displays LMS380KF01 RGB DPI display panel. Cc: devicetree@vger.kernel.org Cc: phone-devel@vger.kernel.org Cc: Noralf Trønnes Reviewed-by: Sam Ravnborg Reviewed-by: Douglas Anderson Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210714225002.1065107-1-linus.walleij@linaro.org commit d775dab9a4a8f1279b65a80a445753a569338319 Author: Junlin Yang Date: Thu Mar 11 09:32:35 2021 +0800 firmware: qcom_scm: remove a duplicative condition Fixes coccicheck warnings: ./drivers/firmware/qcom_scm.c:324:20-22: WARNING !A || A && B is equivalent to !A || B Signed-off-by: Junlin Yang Link: https://lore.kernel.org/r/20210311013235.1458-1-angkery@163.com Signed-off-by: Bjorn Andersson commit 6bc45428635d693ebe3341a331dd8475748f4796 Author: Stephen Boyd Date: Sun Feb 21 19:14:31 2021 -0800 firmware: qcom_scm: Mark string array const Mark the qcom_scm_convention_names[] array const as it isn't changed. Cc: Elliot Berman Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions") Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20210222031431.3831189-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit ab0441b4a92053228f1f089f66d2fc100f3f9dd3 Merge: f4919ff59c282 ce2639ad6921f Author: David S. Miller Date: Fri Jul 16 17:32:15 2021 -0700 Merge branch 'vmxnet3-version-6' Ronak Doshi says: ==================== vmxnet3: upgrade to version 6 vmxnet3 emulation has recently added several new features which includes increase in queues supported, remove power of 2 limitation on queues, add RSS for ESP IPv6, etc. This patch series extends the vmxnet3 driver to leverage these new features. Compatibility is maintained using existing vmxnet3 versioning mechanism as follows: - new features added to vmxnet3 emulation are associated with new vmxnet3 version viz. vmxnet3 version 6. - emulation advertises all the versions it supports to the driver. - during initialization, vmxnet3 driver picks the highest version number supported by both the emulation and the driver and configures emulation to run at that version. In particular, following changes are introduced: Patch 1: This patch introduces utility macros for vmxnet3 version 6 comparison and updates Copyright information. Patch 2: This patch adds support to increase maximum Tx/Rx queues from 8 to 32. Patch 3: This patch removes the limitation of power of 2 on the queues. Patch 4: Uses existing get_rss_hash_opts and set_rss_hash_opts methods to add support for ESP IPv6 RSS. Patch 5: This patch reports correct RSS hash type based on the type of RSS performed. Patch 6: This patch updates maximum configurable mtu to 9190. Patch 7: With all vmxnet3 version 6 changes incorporated in the vmxnet3 driver, with this patch, the driver can configure emulation to run at vmxnet3 version 6. ==================== Signed-off-by: David S. Miller commit ce2639ad6921fbaf8a854b5d1b1033adee685e6e Author: Ronak Doshi Date: Fri Jul 16 15:36:26 2021 -0700 vmxnet3: update to version 6 With all vmxnet3 version 6 changes incorporated in the vmxnet3 driver, the driver can configure emulation to run at vmxnet3 version 6, provided the emulation advertises support for version 6. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 8c5663e461e6914304bbbf2c1cf67e5dce18740f Author: Ronak Doshi Date: Fri Jul 16 15:36:25 2021 -0700 vmxnet3: increase maximum configurable mtu to 9190 This patch increases the maximum configurable mtu to 9190 to accommodate jumbo packets of overlay traffic. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit b3973bb40041eb336188d16fcc249000ea3c4bf4 Author: Ronak Doshi Date: Fri Jul 16 15:36:24 2021 -0700 vmxnet3: set correct hash type based on rss information As vmxnet3 supports IP/TCP/UDP RSS, this patch sets appropriate hash type based on the type of RSS performed. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 79d124bb36c0662e16e1ae01e7ff68ab80eb67a8 Author: Ronak Doshi Date: Fri Jul 16 15:36:23 2021 -0700 vmxnet3: add support for ESP IPv6 RSS Vmxnet3 version 4 added support for ESP RSS. However, only IPv4 was supported. With vmxnet3 version 6, this patch enables RSS for ESP IPv6 packets as well. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 15ccf2f4b09c4443435e815b8086bc161da27e24 Author: Ronak Doshi Date: Fri Jul 16 15:36:22 2021 -0700 vmxnet3: remove power of 2 limitation on the queues With version 6, vmxnet3 relaxes the restriction on queues to be power of two. This is helpful in cases (Edge VM) where vcpus are less than 8 and device requires more than 4 queues. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 39f9895a00f4c5f50e4e0a94f710c6a87afb1920 Author: Ronak Doshi Date: Fri Jul 16 15:36:21 2021 -0700 vmxnet3: add support for 32 Tx/Rx queues Currently, vmxnet3 supports maximum of 8 Tx/Rx queues. With increase in number of vcpus on a VM, to achieve better performance and utilize idle vcpus, we need to increase the max number of queues supported. This patch enhances vmxnet3 to support maximum of 32 Tx/Rx queues. Increasing the Rx queues also increases the probability of distrubuting the traffic from different flows to different queues with RSS. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 69dbef0d1c22476c422ee255e99d0e112ddd829d Author: Ronak Doshi Date: Fri Jul 16 15:36:20 2021 -0700 vmxnet3: prepare for version 6 changes vmxnet3 is currently at version 4 and this patch initiates the preparation to accommodate changes for upto version 6. Introduced utility macros for vmxnet3 version 6 comparison and update Copyright information. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 78e4a955928ef4a3e68cc371ac8c70fd150f873b Merge: 068dfc655b666 add192f81ab21 Author: Andrii Nakryiko Date: Fri Jul 16 17:22:05 2021 -0700 Merge branch 'libbpf: BTF typed dump cleanups' Alan Maguire says: ==================== Fix issues with libbpf BTF typed dump code. Patch 1 addresses handling of unaligned data. Patch 2 fixes issues Andrii noticed when compiling on ppc64le. Patch 3 simplifies typed dump by getting rid of allocation of dump data structure which tracks dump state etc. Changes since v1: - Andrii suggested using a function instead of a macro for checking alignment of data, and pointed out that we need to consider dump ptr size versus native pointer size (patch 1) ==================== Signed-off-by: Andrii Nakryiko commit add192f81ab21b58471577c75e7be9c9add98223 Author: Alan Maguire Date: Fri Jul 16 23:46:57 2021 +0100 libbpf: Btf typed dump does not need to allocate dump data By using the stack for this small structure, we avoid the need for freeing memory in error paths. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626475617-25984-4-git-send-email-alan.maguire@oracle.com commit f4919ff59c2828064b4156e3c3600a169909bcf4 Author: Xin Long Date: Fri Jul 16 17:44:07 2021 -0400 tipc: keep the skb in rcv queue until the whole data is read Currently, when userspace reads a datagram with a buffer that is smaller than this datagram, the data will be truncated and only part of it can be received by users. It doesn't seem right that users don't know the datagram size and have to use a huge buffer to read it to avoid the truncation. This patch to fix it by keeping the skb in rcv queue until the whole data is read by users. Only the last msg of the datagram will be marked with MSG_EOR, just as TCP/SCTP does. Note that this will work as above only when MSG_EOR is set in the flags parameter of recvmsg(), so that it won't break any old user applications. Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 04eb4dff6a64d842f7f2c85c7cb1affc5ab3ebc9 Author: Alan Maguire Date: Fri Jul 16 23:46:56 2021 +0100 libbpf: Fix compilation errors on ppc64le for btf dump typed data __s64 can be defined as either long or long long, depending on the architecture. On ppc64le it's defined as long, giving this error: In file included from btf_dump.c:22: btf_dump.c: In function 'btf_dump_type_data_check_overflow': libbpf_internal.h:111:22: error: format '%lld' expects argument of type 'long long int', but argument 3 has type '__s64' {aka 'long int'} [-Werror=format=] 111 | libbpf_print(level, "libbpf: " fmt, ##__VA_ARGS__); \ | ^~~~~~~~~~ libbpf_internal.h:114:27: note: in expansion of macro '__pr' 114 | #define pr_warn(fmt, ...) __pr(LIBBPF_WARN, fmt, ##__VA_ARGS__) | ^~~~ btf_dump.c:1992:3: note: in expansion of macro 'pr_warn' 1992 | pr_warn("unexpected size [%lld] for id [%u]\n", | ^~~~~~~ btf_dump.c:1992:32: note: format string is defined here 1992 | pr_warn("unexpected size [%lld] for id [%u]\n", | ~~~^ | | | long long int | %ld Cast to size_t and use %zu instead. Reported-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626475617-25984-3-git-send-email-alan.maguire@oracle.com commit 5242b0c6b5f8032bcd61e9c54695a8b92524f647 Merge: 08041a9af98cf cf8331825a8d1 Author: David S. Miller Date: Fri Jul 16 17:25:13 2021 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/t nguy/next-queue Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2021-07-16 Vinicius Costa Gomes says: Add support for steering traffic to specific RX queues using Flex Filters. As the name implies, Flex Filters are more flexible than using Layer-2, VLAN or MAC address filters, one of the reasons is that they allow "AND" operations more easily, e.g. when the user wants to steer some traffic based on the source MAC address and the packet ethertype. Future work include adding support for offloading tc-u32 filters to the hardware. The series is divided as follows: Patch 1/5, add the low level primitives for configuring Flex filters. Patch 2/5 and 3/5, allow ethtool to manage Flex filters. Patch 4/5, when specifying filters that have multiple predicates, use Flex filters. Patch 5/5, Adds support for exposing the i225 LEDs using the LED subsystem. ==================== Signed-off-by: David S. Miller commit 8d44c3578b48d5f605eddcfd6a644e3944455a6b Author: Alan Maguire Date: Fri Jul 16 23:46:55 2021 +0100 libbpf: Clarify/fix unaligned data issues for btf typed dump If data is packed, data structures can store it outside of usual boundaries. For example a 4-byte int can be stored on a unaligned boundary in a case like this: struct s { char f1; int f2; } __attribute((packed)); ...the int is stored at an offset of one byte. Some platforms have problems dereferencing data that is not aligned with its size, and code exists to handle most cases of this for BTF typed data display. However pointer display was missed, and a simple function to test if "ptr_is_aligned(data, data_sz)" would help clarify this code. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626475617-25984-2-git-send-email-alan.maguire@oracle.com commit cf8331825a8d10e46fa574fdf015a65cb5a6db86 Author: Kurt Kanzenbach Date: Mon Jun 28 21:43:32 2021 -0700 igc: Export LEDs Each i225 has three LEDs. Export them via the LED class framework. Each LED is controllable via sysfs. Example: $ cd /sys/class/leds/igc_led0 $ cat brightness # Current Mode $ cat max_brightness # 15 $ echo 0 > brightness # Mode 0 $ echo 1 > brightness # Mode 1 The brightness field here reflects the different LED modes ranging from 0 to 15. Signed-off-by: Kurt Kanzenbach Reviewed-by: Sebastian Andrzej Siewior Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 73744262210c4560efb2d89385c6219739d16bbd Author: Kurt Kanzenbach Date: Mon Jun 28 21:43:31 2021 -0700 igc: Make flex filter more flexible Currently flex filters are only used for filters containing user data. However, it makes sense to utilize them also for filters having multiple conditions, because that's not supported by the driver at the moment. Add it. Signed-off-by: Kurt Kanzenbach Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Vinicius Costa Gomes Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 7991487ecb2d27f2293376411d576867a3d9640b Author: Vinicius Costa Gomes Date: Mon Jun 28 21:43:30 2021 -0700 igc: Allow for Flex Filters to be installed Allows Flex Filters to be installed. The previous restriction to the types of filters that can be installed can now be lifted. Signed-off-by: Vinicius Costa Gomes Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 2b477d057e3364c22e8f86724c798ad664bd8360 Author: Kurt Kanzenbach Date: Mon Jun 28 21:43:29 2021 -0700 igc: Integrate flex filter into ethtool ops Use the flex filter mechanism to extend the current ethtool filter operations by intercoperating the user data. This allows to match eight more bytes within a Ethernet frame in addition to macs, ether types and vlan. The matching pattern looks like this: * dest_mac [6] * src_mac [6] * tpid [2] * vlan tci [2] * ether type [2] * user data [8] This can be used to match Profinet traffic classes by FrameID range. Signed-off-by: Kurt Kanzenbach Reviewed-by: Sebastian Andrzej Siewior Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit 6574631b50edf8fd88e3bb9155c6a89746779562 Author: Kurt Kanzenbach Date: Mon Jun 28 21:43:28 2021 -0700 igc: Add possibility to add flex filter The Intel i225 NIC has the possibility to add flex filters which can match up to the first 128 byte of a packet. These filters are useful for all kind of packet matching. One particular use case is Profinet, as the different traffic classes are distinguished by the frame id range which cannot be matched by any other means. Add code to configure and enable flex filters. Signed-off-by: Kurt Kanzenbach Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Vinicius Costa Gomes Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen commit a67462fc9de8b958d6a2c2c34d0195733a8c61a6 Author: Krzysztof Wilczyński Date: Tue Jul 13 10:24:36 2021 +0000 PCI: Refactor pci_ioremap_bar() and pci_ioremap_wc_bar() pci_ioremap_bar() and pci_ioremap_wc_bar() shared similar implementations but differed in unimportant ways. Align them by adding a shared helper, __pci_ioremap_resource(). Upgrade warning message to error level, since it indicates a driver defect. Remove WARN_ON() from WC path in favor of the error message. [bhelgaas: commit log, use ioremap() since pci_iomap_range() doesn't add anything] Link: https://lore.kernel.org/r/20210713102436.304693-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit 068dfc655b666b54e08fc3d7108b309d7f906d34 Merge: 334faa5ce5232 70a9241fbce53 Author: Andrii Nakryiko Date: Fri Jul 16 13:46:59 2021 -0700 Merge branch 'libbpf: BTF dumper support for typed data' Alan Maguire says: ==================== Add a libbpf dumper function that supports dumping a representation of data passed in using the BTF id associated with the data in a manner similar to the bpf_snprintf_btf helper. Default output format is identical to that dumped by bpf_snprintf_btf() (bar using tabs instead of spaces for indentation, but the indent string can be customized also); for example, a "struct sk_buff" representation would look like this: (struct sk_buff){ (union){ (struct){ .next = (struct sk_buff *)0xffffffffffffffff, .prev = (struct sk_buff *)0xffffffffffffffff, (union){ .dev = (struct net_device *)0xffffffffffffffff, .dev_scratch = (long unsigned int)18446744073709551615, }, }, ... Patch 1 implements the dump functionality in a manner similar to that in kernel/bpf/btf.c, but with a view to fitting into libbpf more naturally. For example, rather than using flags, boolean dump options are used to control output. In addition, rather than combining checks for display (such as is this field zero?) and actual display - as is done for the kernel code - the code is organized to separate zero and overflow checks from type display. Patch 2 adds ASSERT_STRNEQ() for use in the following BTF dumper tests. Patch 3 consists of selftests that utilize a dump printf function to snprintf the dump output to a string for comparison with expected output. Tests deliberately mirror those in snprintf_btf helper test to keep output consistent, but also cover overflow handling, var/section display. Changes since v5 [1] - readjust dump options to avoid unnecessary padding (Andrii, patch 1). - tidied up bitfield data checking/retrieval using Andrii's suggestions. Removed code where we adjust data pointer prior to calling bitfield functions as this adjustment is not needed, provided we use the type size as the number of bytes to iterate over when retrieving the full value we apply bit shifting operations to retrieve the bitfield value. With these chances, the *_int_bits() functions were no longer needed (Andrii, patch 1). - coalesced the "is zero" checking for ints, floats and pointers into btf_dump_base_type_check_zero(), using a memcmp() of the size of the data. This can be derived from t->size for ints and floats, and pointer size is retrieved from dump's ptr_sz field (Andrii, patch 1). - Added alignment-aware handling for int, enum, float retrieval. Packed data structures can force ints, enums and floats to be aligned on different boundaries; for example, the struct p { char f1; int f2; } __attribute__((packed)); ...will have the int f2 field offset at byte 1, rather than at byte 4 for an unpacked structure. The problem is directly dereferencing that as an int is problematic on some platforms. For ints and enums, we can reuse bitfield retrieval to get the value for display, while for floats we use a local union of the floating-point types and memcpy into it, ensuring we can then dereference pointers into that union which will have safe alignment (Andrii, patch 1). - added comments to explain why we increment depth prior to displaying opening parens, and decrement it prior to displaying closing parens for structs, unions and arrays. The reason is that we don't want to have a trailing newline when displaying a type. The logic that handles this says "don't show a newline when the depth we're at is 0". For this to work for opening parens then we need to bump depth before showing opening parens + newline, and when we close out structure we need to show closing parens after reducing depth so that we don't append a newline to a top-level structure. So as a result we have struct foo {\n struct bar {\n }\n } - silently truncate provided indent string with strncat() if > 31 bytes (Andrii, patch 1). - fixed ASSERT_STRNEQ() macro to show only n bytes of string (Andrii, patch 2). - fixed strncat() of type data string to avoid stack corruption (Andrii, patch 3). - removed early returns from dump type tests (Andrii, patch 3). - have tests explicitly specify prefix (enum, struct, union) (Andrii, patch 3). - switch from CHECK() to ASSERT_* where possible (Andrii, patch 3). Changes since v4 [2] - Andrii kindly provided code to unify emitting a prepended cast (for example "(int)") with existing code, and this had the nice benefit of adding array indices in type specifications (Andrii, patches 1, 3) - Fixed indent_str option to make it a const char *, stored in a fixed-length buffer internally (Andrii, patch 1) - Reworked bit shift logic to minimize endian-specific interactions, and use same macros as found elsewhere in libbpf to determine endianness (Andrii, patch 1) - Fixed type emitting to ensure that a trailing '\n' is not displayed; newlines are added during struct/array display, but for a single type the last character is no longer a newline (Andrii, patches 1, 3) - Added support for ASSERT_STRNEQ() macro (Andrii, patch 2) - Split tests into subtests for int, char, enum etc rather than one "dump type data" subtest (Andrii, patch 3) - Made better use of ASSERT* macros (Andrii, patch 3) - Got rid of some other TEST_* macros that were unneeded (Andrii, patch 3) - Switched to using "struct fs_context" to verify enum bitfield values (Andrii, patch 3) Changes since v3 [3] - Retained separation of emitting of type name cast prefixing type values from existing functionality such as btf_dump_emit_type_chain() since initial code-shared version had so many exceptions it became hard to read. For example, we don't emit a type name if the type to be displayed is an array member, we also always emit "forward" definitions for structs/unions that aren't really forward definitions (we just want a "struct foo" output for "(struct foo){.bar = ...". We also always ignore modifiers const/volatile/restrict as they clutter output when emitting large types. - Added configurable 4-char indent string option; defaults to tab (Andrii) - Added support for BTF_KIND_FLOAT and associated tests (Andrii) - Added support for BTF_KIND_FUNC_PROTO function pointers to improve output of "ops" structures; for example: (struct file_operations){ .owner = (struct module *)0xffffffffffffffff, .llseek = (loff_t(*)(struct file *, loff_t, int))0xffffffffffffffff, ... Added associated test also (Andrii) - Added handling for enum bitfields and associated test (Andrii) - Allocation of "struct btf_dump_data" done on-demand (Andrii) - Removed ".field = " output from function emitting type name and into caller (Andrii) - Removed BTF_INT_OFFSET() support (Andrii) - Use libbpf_err() to set errno for error cases (Andrii) - btf_dump_dump_type_data() returns size written, which is used when returning successfully from btf_dump__dump_type_data() (Andrii) Changes since v2 [4] - Renamed function to btf_dump__dump_type_data, reorganized arguments such that opts are last (Andrii) - Modified code to separate questions about display such as have we overflowed?/is this field zero? from actual display of typed data, such that we ask those questions separately from the code that actually displays typed data (Andrii) - Reworked code to handle overflow - where we do not provide enough data for the type we wish to display - by returning -E2BIG and attempting to present as much data as possible. Such a mode of operation allows for tracers which retrieve partial data (such as first 1024 bytes of a "struct task_struct" say), and want to display that partial data, while also knowing that it is not the full type. Such tracers can then denote this (perhaps via "..." or similar). - Explored reusing existing type emit functions, such as passing in a type id stack with a single type id to btf_dump_emit_type_chain() to support the display of typed data where a "cast" is prepended to the data to denote its type; "(int)1", "(struct foo){", etc. However the task of emitting a ".field_name = (typecast)" did not match well with model of walking the stack to display innermost types first and made the resultant code harder to read. Added a dedicated btf_dump_emit_type_name() function instead which is only ~70 lines (Andrii) - Various cleanups around bitfield macros, unneeded member iteration macros, avoiding compiler complaints when displaying int da ta by casting to long long, etc (Andrii) - Use DECLARE_LIBBPF_OPTS() in defining opts for tests (Andrii) - Added more type tests, overflow tests, var tests and section tests. Changes since RFC [5] - The initial approach explored was to share the kernel code with libbpf using #defines to paper over the different needs; however it makes more sense to try and fit in with libbpf code style for maintenance. A comment in the code points at the implementation in kernel/bpf/btf.c and notes that any issues found in it should be fixed there or vice versa; mirroring the tests should help with this also (Andrii) [1] https://lore.kernel.org/bpf/1624092968-5598-1-git-send-email-alan.maguire@oracle.com/ [2] https://lore.kernel.org/bpf/CAEf4BzYtbnphCkhz0epMKE4zWfvSOiMpu+-SXp9hadsrRApuZw@mail.gmail.com/T/ [3] https://lore.kernel.org/bpf/1622131170-8260-1-git-send-email-alan.maguire@oracle.com/ [4] https://lore.kernel.org/bpf/1610921764-7526-1-git-send-email-alan.maguire@oracle.com/ [5] https://lore.kernel.org/bpf/1610386373-24162-1-git-send-email-alan.maguire@oracle.com/ ==================== Signed-off-by: Andrii Nakryiko commit 70a9241fbce5398965bf05a595ee892845ae31e9 Author: Alan Maguire Date: Thu Jul 15 16:15:26 2021 +0100 selftests/bpf: Add dump type data tests to btf dump tests Test various type data dumping operations by comparing expected format with the dumped string; an snprintf-style printf function is used to record the string dumped. Also verify overflow handling where the data passed does not cover the full size of a type, such as would occur if a tracer has a portion of the 8k "struct task_struct". Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626362126-27775-4-git-send-email-alan.maguire@oracle.com commit 17283337ff86a1956940bc6bfb3f7dafe82304f3 Author: Alan Maguire Date: Thu Jul 15 16:15:25 2021 +0100 selftests/bpf: Add ASSERT_STRNEQ() variant for test_progs It will support strncmp()-style string comparisons. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626362126-27775-3-git-send-email-alan.maguire@oracle.com commit 920d16af9b42adfc8524d880b0e8dba66a6cb87d Author: Alan Maguire Date: Thu Jul 15 16:15:24 2021 +0100 libbpf: BTF dumper support for typed data Add a BTF dumper for typed data, so that the user can dump a typed version of the data provided. The API is int btf_dump__dump_type_data(struct btf_dump *d, __u32 id, void *data, size_t data_sz, const struct btf_dump_type_data_opts *opts); ...where the id is the BTF id of the data pointed to by the "void *" argument; for example the BTF id of "struct sk_buff" for a "struct skb *" data pointer. Options supported are - a starting indent level (indent_lvl) - a user-specified indent string which will be printed once per indent level; if NULL, tab is chosen but any string <= 32 chars can be provided. - a set of boolean options to control dump display, similar to those used for BPF helper bpf_snprintf_btf(). Options are - compact : omit newlines and other indentation - skip_names: omit member names - emit_zeroes: show zero-value members Default output format is identical to that dumped by bpf_snprintf_btf(), for example a "struct sk_buff" representation would look like this: struct sk_buff){ (union){ (struct){ .next = (struct sk_buff *)0xffffffffffffffff, .prev = (struct sk_buff *)0xffffffffffffffff, (union){ .dev = (struct net_device *)0xffffffffffffffff, .dev_scratch = (long unsigned int)18446744073709551615, }, }, ... If the data structure is larger than the *data_sz* number of bytes that are available in *data*, as much of the data as possible will be dumped and -E2BIG will be returned. This is useful as tracers will sometimes not be able to capture all of the data associated with a type; for example a "struct task_struct" is ~16k. Being able to specify that only a subset is available is important for such cases. On success, the amount of data dumped is returned. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626362126-27775-2-git-send-email-alan.maguire@oracle.com commit 334faa5ce5232b281ba955d4b13d44f197e92070 Merge: 8886534747c2e f0b7d11925424 Author: Andrii Nakryiko Date: Fri Jul 16 12:45:57 2021 -0700 Merge branch 'Add btf_custom_path in bpf_obj_open_opts' Shuyi Cheng says: ==================== This patch set adds the ability to point to a custom BTF for the purposes of BPF CO-RE relocations. This is useful for using BPF CO-RE on old kernels that don't yet natively support kernel (vmlinux) BTF and thus libbpf needs application's help in locating kernel BTF generated separately from the kernel itself. This was already possible to do through bpf_object__load's attribute struct, but that makes it inconvenient to use with BPF skeleton, which only allows to specify bpf_object_open_opts during the open step. Thus, add the ability to override vmlinux BTF at open time. Patch #1 adds libbpf changes. Patch #2 fixes pre-existing memory leak detected during the code review. Patch #3 switches existing selftests to using open_opts for custom BTF. Changelog: ---------- v3: https://lore.kernel.org/bpf/CAEf4BzY2cdT44bfbMus=gei27ViqGE1BtGo6XrErSsOCnqtVJg@mail.gmail.com/T/#m877eed1d4cf0a1d3352d3f3d6c5ff158be45c542 v3->v4: - Follow Andrii's suggestion to modify cover letter description. - Delete function bpf_object__load_override_btf. - Follow Dan's suggestion to add fixes tag and modify commit msg to patch #2. - Add pathch #3 to switch existing selftests to using open_opts. v2: https://lore.kernel.org/bpf/CAEf4Bza_ua+tjxdhyy4nZ8Boeo+scipWmr_1xM1pC6N5wyuhAA@mail.gmail.com/T/#mf9cf86ae0ffa96180ac29e4fd12697eb70eccd0f v2->v3: - Load the BTF specified by btf_custom_path to btf_vmlinux_override instead of btf_bmlinux. - Fix the memory leak that may be introduced by the second version of the patch. - Add a new patch to fix the possible memory leak caused by obj->kconfig. v1: https://lore.kernel.org/bpf/CAEf4BzaGjEC4t1OefDo11pj2-HfNy0BLhs_G2UREjRNTmb2u=A@mail.gmail.com/t/#m4d9f7c6761fbd2b436b5dfe491cd864b70225804 v1->v2: - Change custom_btf_path to btf_custom_path. - If the length of btf_custom_path of bpf_obj_open_opts is too long, return ERR_PTR(-ENAMETOOLONG). - Add `custom BTF is in addition to vmlinux BTF` with btf_custom_path field. ==================== Signed-off-by: Andrii Nakryiko commit f0b7d119254247cc373d1695889e5216f13fddcd Author: Shuyi Cheng Date: Tue Jul 13 20:42:39 2021 +0800 selftests/bpf: Switch existing selftests to using open_opts for custom BTF This patch mainly replaces the bpf_object_load_attr of the core_autosize.c and core_reloc.c files with bpf_object_open_opts. Signed-off-by: Shuyi Cheng Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626180159-112996-4-git-send-email-chengshuyi@linux.alibaba.com commit 18353c87e0e0440d4c7c746ed740738bbc1b538e Author: Shuyi Cheng Date: Tue Jul 13 20:42:38 2021 +0800 libbpf: Fix the possible memory leak on error If the strdup() fails then we need to call bpf_object__close(obj) to avoid a resource leak. Fixes: 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables") Signed-off-by: Shuyi Cheng Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626180159-112996-3-git-send-email-chengshuyi@linux.alibaba.com commit 1373ff59955621b7e71e7a1152036c93a5780c11 Author: Shuyi Cheng Date: Tue Jul 13 20:42:37 2021 +0800 libbpf: Introduce 'btf_custom_path' to 'bpf_obj_open_opts' btf_custom_path allows developers to load custom BTF which libbpf will subsequently use for CO-RE relocation instead of vmlinux BTF. Having btf_custom_path in bpf_object_open_opts one can directly use the skeleton's _bpf__open_opts() API to pass in the btf_custom_path parameter, as opposed to using bpf_object__load_xattr() which is slated to be deprecated ([0]). This work continues previous work started by another developer ([1]). [0] https://lore.kernel.org/bpf/CAEf4BzbJZLjNoiK8_VfeVg_Vrg=9iYFv+po-38SMe=UzwDKJ=Q@mail.gmail.com/#t [1] https://yhbt.net/lore/all/CAEf4Bzbgw49w2PtowsrzKQNcxD4fZRE6AKByX-5-dMo-+oWHHA@mail.gmail.com/ Signed-off-by: Shuyi Cheng Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1626180159-112996-2-git-send-email-chengshuyi@linux.alibaba.com commit 08041a9af98cf10a1e466206dfe8229b20afd575 Author: Voon Weifeng Date: Fri Jul 16 21:46:45 2021 +0800 net: phy: marvell10g: enable WoL for 88X3310 and 88E2110 Implement Wake-on-LAN feature for 88X3310 and 88E2110. This is done by enabling WoL interrupt and WoL detection and configuring MAC address into WoL magic packet registers Signed-off-by: Voon Weifeng Signed-off-by: Ling Pei Lee Signed-off-by: David S. Miller commit 8886534747c2e56d9d3b978c99e92dc479cd9426 Author: Roy, UjjaL Date: Fri Jul 16 22:04:41 2021 +0200 bpf, doc: Add heading and example for extensions in cbpf Add new heading for extensions to make it more readable. Also, add one more example of filtering interface index for better understanding. Signed-off-by: Roy, UjjaL Signed-off-by: Daniel Borkmann Acked-by: Song Liu Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/CAADnVQJ=DoRDcVkaXmY3EmNdLoO7gq1mkJOn5G=00wKH8qUtZQ@mail.gmail.com commit cc6ef3d1fdde75ca4783f2d98d194b4a2c35d848 Author: Geert Uytterhoeven Date: Wed Jul 14 14:53:22 2021 +0200 of: kexec: Remove FDT_PROP_* definitions The FDT_PROP_* definitions make it harder to follow the code. Remove them, and use the actual string literals instead. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/af415c86cd2ba9c8a6bb2eaaf56c3198a24b23d3.1626267092.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 0c6609bb20cf473f48403763aa9a9504ff95fa0f Author: Jason Ekstrand Date: Wed Jul 14 14:34:19 2021 -0500 Revert "drm/i915: Skip over MI_NOOP when parsing" This reverts a6c5e2aea704 ("drm/i915: Skip over MI_NOOP when parsing"). It complicates the batch parsing code a bit and increases indentation for no reason other than fast-skipping a command that userspace uses only rarely. Sure, there may be IGT tests that fill batches with NOOPs but that's not a case we should optimize for in the kernel. We should optimize for code clarity instead. Signed-off-by: Jason Ekstrand Reviewed-by: Jon Bloomfield Acked-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-6-jason@jlekstrand.net commit dc194184d0ce1ba7837f91e0af20e95923049d4d Author: Jason Ekstrand Date: Wed Jul 14 14:34:18 2021 -0500 drm/i915: Drop error handling from dma_fence_work Asynchronous command parsing was the only thing which ever returned a non-zero error. With that gone, we can drop the error handling from dma_fence_work. Signed-off-by: Jason Ekstrand Reviewed-by: Jon Bloomfield Acked-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-5-jason@jlekstrand.net commit 7d6a276e2fa9579e0fd63931a6e8388e3171cecd Author: Jason Ekstrand Date: Wed Jul 14 14:34:17 2021 -0500 drm/i915: Remove allow_alloc from i915_gem_object_get_sg* This reverts the rest of 0edbb9ba1bfe ("drm/i915: Move cmd parser pinning to execbuffer"). Now that the only user of i915_gem_object_get_sg without allow_alloc has been removed, we can drop the parameter. This portion of the revert was broken into its own patch to aid review. Signed-off-by: Jason Ekstrand Cc: Maarten Lankhorst Reviewed-by: Jon Bloomfield Acked-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-4-jason@jlekstrand.net commit 93a2711cddd5760e2f0f901817d71c93183c3b87 Author: Jason Ekstrand Date: Wed Jul 14 14:34:16 2021 -0500 Revert "drm/i915: Propagate errors on awaiting already signaled fences" This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7. Ever since that commit, we've been having issues where a hang in one client can propagate to another. In particular, a hang in an app can propagate to the X server which causes the whole desktop to lock up. Error propagation along fences sound like a good idea, but as your bug shows, surprising consequences, since propagating errors across security boundaries is not a good thing. What we do have is track the hangs on the ctx, and report information to userspace using RESET_STATS. That's how arb_robustness works. Also, if my understanding is still correct, the EIO from execbuf is when your context is banned (because not recoverable or too many hangs). And in all these cases it's up to userspace to figure out what is all impacted and should be reported to the application, that's not on the kernel to guess and automatically propagate. What's more, we're also building more features on top of ctx error reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the userspace fence wait also relies on that mechanism. So it is the path going forward for reporting gpu hangs and resets to userspace. So all together that's why I think we should just bury this idea again as not quite the direction we want to go to, hence why I think the revert is the right option here. For backporters: Please note that you _must_ have a backport of https://lore.kernel.org/dri-devel/20210602164149.391653-2-jason@jlekstrand.net/ for otherwise backporting just this patch opens up a security bug. v2: Augment commit message. Also restore Jason's sob that I accidentally lost. v3: Add a note for backporters Signed-off-by: Jason Ekstrand Reported-by: Marcin Slusarz Cc: # v5.6+ Cc: Jason Ekstrand Cc: Marcin Slusarz Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080 Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences") Acked-by: Daniel Vetter Reviewed-by: Jon Bloomfield Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-3-jason@jlekstrand.net commit 93b713304188844b8514074dc13ffd56d12235d3 Author: Jason Ekstrand Date: Wed Jul 14 14:34:15 2021 -0500 drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser" This reverts 686c7c35abc2 ("drm/i915/gem: Asynchronous cmdparser"). The justification for this commit in the git history was a vague comment about getting it out from under the struct_mutex. While this may improve perf for some workloads on Gen7 platforms where we rely on the command parser for features such as indirect rendering, no numbers were provided to prove such an improvement. It claims to closed two gitlab/bugzilla issues but with no explanation whatsoever as to why or what bug it's fixing. Meanwhile, by moving command parsing off to an async callback, it leaves us with a problem of what to do on error. When things were synchronous, EXECBUFFER2 would fail with an error code if parsing failed. When moving it to async, we needed another way to handle that error and the solution employed was to set an error on the dma_fence and then trust that said error gets propagated to the client eventually. Moving back to synchronous will help us untangle the fence error propagation mess. This also reverts most of 0edbb9ba1bfe ("drm/i915: Move cmd parser pinning to execbuffer") which is a refactor of some of our allocation paths for asynchronous parsing. Now that everything is synchronous, we don't need it. v2 (Daniel Vetter): - Add stabel Cc and Fixes tag Signed-off-by: Jason Ekstrand Cc: # v5.6+ Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences") Cc: Maarten Lankhorst Reviewed-by: Jon Bloomfield Acked-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-2-jason@jlekstrand.net commit 86a176f485b535d05f211dbf86df22dcc2eba6ee Author: Joakim Zhang Date: Fri Jul 16 18:29:11 2021 +0800 ARM: dts: imx7-mba7: remove un-used "phy-reset-delay" property Remove un-used "phy-reset-delay" property which found when do dtbs_check (set additionalProperties: false in fsl,fec.yaml). Double check current driver and commit history, "phy-reset-delay" never comes up, so it should be safe to remove it. $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/fsl,fec.yaml arch/arm/boot/dts/imx7d-mba7.dt.yaml: ethernet@30be0000: 'phy-reset-delay' does not match any of the regexes: 'pinctrl-[0-9]+' arch/arm/boot/dts/imx7d-mba7.dt.yaml: ethernet@30bf0000: 'phy-reset-delay' does not match any of the regexes: 'pinctrl-[0-9]+' /arch/arm/boot/dts/imx7s-mba7.dt.yaml: ethernet@30be0000: 'phy-reset-delay' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 95740a9a3ad94301e79f586da48f708028d3c91c Author: Joakim Zhang Date: Fri Jul 16 18:29:10 2021 +0800 ARM: dts: imx35: correct node name for FEC Correct node name for FEC which found when do dtbs_check. $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/fsl,fec.yaml arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dt.yaml: fec@50038000: $nodename:0: 'fec@50038000' does not match '^ethernet(@.*)?$' arch/arm/boot/dts/imx35-pdk.dt.yaml: fec@50038000: $nodename:0: 'fec@50038000' does not match '^ethernet(@.*)?$' Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 96e4781b3d9399ab75c4d2d8b5833c7e8d60ff6b Author: Joakim Zhang Date: Fri Jul 16 18:29:09 2021 +0800 dt-bindings: net: fec: convert fsl,*fec bindings to yaml In order to automate the verification of DT nodes convert fsl-fec.txt to fsl,fec.yaml, and pass binding check with below command. $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/fsl,fec.yaml DTEX Documentation/devicetree/bindings/net/fsl,fec.example.dts DTC Documentation/devicetree/bindings/net/fsl,fec.example.dt.yaml CHECK Documentation/devicetree/bindings/net/fsl,fec.example.dt.yaml Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit c7603cfa04e7c3a435b31d065f7cbdc829428f6e Author: Andrii Nakryiko Date: Mon Jul 12 16:06:15 2021 -0700 bpf: Add ambient BPF runtime context stored in current b910eaaaa4b8 ("bpf: Fix NULL pointer dereference in bpf_get_local_storage() helper") fixed the problem with cgroup-local storage use in BPF by pre-allocating per-CPU array of 8 cgroup storage pointers to accommodate possible BPF program preemptions and nested executions. While this seems to work good in practice, it introduces new and unnecessary failure mode in which not all BPF programs might be executed if we fail to find an unused slot for cgroup storage, however unlikely it is. It might also not be so unlikely when/if we allow sleepable cgroup BPF programs in the future. Further, the way that cgroup storage is implemented as ambiently-available property during entire BPF program execution is a convenient way to pass extra information to BPF program and helpers without requiring user code to pass around extra arguments explicitly. So it would be good to have a generic solution that can allow implementing this without arbitrary restrictions. Ideally, such solution would work for both preemptable and sleepable BPF programs in exactly the same way. This patch introduces such solution, bpf_run_ctx. It adds one pointer field (bpf_ctx) to task_struct. This field is maintained by BPF_PROG_RUN family of macros in such a way that it always stays valid throughout BPF program execution. BPF program preemption is handled by remembering previous current->bpf_ctx value locally while executing nested BPF program and restoring old value after nested BPF program finishes. This is handled by two helper functions, bpf_set_run_ctx() and bpf_reset_run_ctx(), which are supposed to be used before and after BPF program runs, respectively. Restoring old value of the pointer handles preemption, while bpf_run_ctx pointer being a property of current task_struct naturally solves this problem for sleepable BPF programs by "following" BPF program execution as it is scheduled in and out of CPU. It would even allow CPU migration of BPF programs, even though it's not currently allowed by BPF infra. This patch cleans up cgroup local storage handling as a first application. The design itself is generic, though, with bpf_run_ctx being an empty struct that is supposed to be embedded into a specific struct for a given BPF program type (bpf_cg_run_ctx in this case). Follow up patches are planned that will expand this mechanism for other uses within tracing BPF programs. To verify that this change doesn't revert the fix to the original cgroup storage issue, I ran the same repro as in the original report ([0]) and didn't get any problems. Replacing bpf_reset_run_ctx(old_run_ctx) with bpf_reset_run_ctx(NULL) triggers the issue pretty quickly (so repro does work). [0] https://lore.kernel.org/bpf/YEEvBUiJl2pJkxTd@krava/ Fixes: b910eaaaa4b8 ("bpf: Fix NULL pointer dereference in bpf_get_local_storage() helper") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210712230615.3525979-1-andrii@kernel.org commit d4861fc6be581561d6964700110a4dede54da6a6 Author: Peilin Ye Date: Thu Jul 15 18:52:45 2021 -0700 netdevsim: Add multi-queue support Currently netdevsim only supports a single queue per port, which is insufficient for testing multi-queue TC schedulers e.g. sch_mq. Extend the current sysfs interface so that users can create ports with multiple queues: $ echo "[ID] [PORT_COUNT] [NUM_QUEUES]" > /sys/bus/netdevsim/new_device As an example, echoing "2 4 8" creates 4 ports, with 8 queues per port. Note, this is compatible with the current interface, with default number of queues set to 1. For example, echoing "2 4" creates 4 ports with 1 queue per port; echoing "2" simply creates 1 port with 1 queue. Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit b83d23a2a38b1770da0491257ae81d52307f7816 Author: Mark Gray Date: Thu Jul 15 08:27:54 2021 -0400 openvswitch: Introduce per-cpu upcall dispatch The Open vSwitch kernel module uses the upcall mechanism to send packets from kernel space to user space when it misses in the kernel space flow table. The upcall sends packets via a Netlink socket. Currently, a Netlink socket is created for every vport. In this way, there is a 1:1 mapping between a vport and a Netlink socket. When a packet is received by a vport, if it needs to be sent to user space, it is sent via the corresponding Netlink socket. This mechanism, with various iterations of the corresponding user space code, has seen some limitations and issues: * On systems with a large number of vports, there is a correspondingly large number of Netlink sockets which can limit scaling. (https://bugzilla.redhat.com/show_bug.cgi?id=1526306) * Packet reordering on upcalls. (https://bugzilla.redhat.com/show_bug.cgi?id=1844576) * A thundering herd issue. (https://bugzilla.redhat.com/show_bug.cgi?id=1834444) This patch introduces an alternative, feature-negotiated, upcall mode using a per-cpu dispatch rather than a per-vport dispatch. In this mode, the Netlink socket to be used for the upcall is selected based on the CPU of the thread that is executing the upcall. In this way, it resolves the issues above as: a) The number of Netlink sockets scales with the number of CPUs rather than the number of vports. b) Ordering per-flow is maintained as packets are distributed to CPUs based on mechanisms such as RSS and flows are distributed to a single user space thread. c) Packets from a flow can only wake up one user space thread. The corresponding user space code can be found at: https://mail.openvswitch.org/pipermail/ovs-dev/2021-July/385139.html Bugzilla: https://bugzilla.redhat.com/1844576 Signed-off-by: Mark Gray Acked-by: Flavio Leitner Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit ad43a647bcdb654f9eecd7846f80914765fed266 Author: Liviu Dudau Date: Wed Jul 14 09:06:52 2021 +0100 drm/amd/display: Fix 10bit 4K display on CIK GPUs Commit 72a7cf0aec0c ("drm/amd/display: Keep linebuffer pixel depth at 30bpp for DCE-11.0.") doesn't seems to have fixed 10bit 4K rendering over DisplayPort for CIK GPUs. On my machine with a HAWAII GPU I get a broken image that looks like it has an effective resolution of 1920x1080 but scaled up in an irregular way. Reverting the commit or applying this patch fixes the problem on v5.14-rc1. Fixes: 72a7cf0aec0c ("drm/amd/display: Keep linebuffer pixel depth at 30bpp for DCE-11.0.") Acked-by: Mario Kleiner Reviewed-by: Harry Wentland Signed-off-by: Liviu Dudau Signed-off-by: Alex Deucher commit 03373e2be290e6169293bdfc34e313aae9fdef8b Author: Kevin Wang Date: Fri Jul 16 14:03:08 2021 -0400 drm/amdgpu/ttm: optimize vram access in amdgpu_ttm_access_memory() 1. using vram aper to access vram if possible 2. avoid MM_INDEX/MM_DATA is not working when mmio protect feature is enabled. Signed-off-by: Kevin Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 5fb95aa73f3c8d847e7107f6eb19f59f15029d29 Author: Kevin Wang Date: Thu Jul 15 15:51:28 2021 +0800 drm/amdgpu/ttm: replace duplicate code with exiting function using exiting function to replace duplicate code blocks in amdgpu_ttm_vram_write(). Signed-off-by: Kevin Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 048af66be7b5ffb107f3696a853a4deb9aa6efec Author: Kevin Wang Date: Fri Jul 16 13:57:49 2021 -0400 drm/amdgpu: split amdgpu_device_access_vram() into two small parts split amdgpu_device_access_vram() 1. amdgpu_device_mm_access(): using MM_INDEX/MM_DATA to access vram 2. amdgpu_device_aper_access(): using vram aperature to access vram (option) Signed-off-by: Kevin Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 919d527956daa3e7ad03a23ba661beb8a46cacf4 Author: Bill Wendling Date: Wed Jul 14 02:17:46 2021 -0700 bnx2x: remove unused variable 'cur_data_offset' Fix the clang build warning: drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1862:13: error: variable 'cur_data_offset' set but not used [-Werror,-Wunused-but-set-variable] dma_addr_t cur_data_offset; Signed-off-by: Bill Wendling Signed-off-by: David S. Miller commit a99f030b2488b67a49f44e94f852f2ed9933d552 Author: Christophe JAILLET Date: Wed Jul 14 10:32:33 2021 +0200 net: switchdev: Simplify 'mlxsw_sp_mc_write_mdb_entry()' Use 'bitmap_alloc()/bitmap_free()' instead of hand-writing it. This makes the code less verbose. Also, use 'bitmap_alloc()' instead of 'bitmap_zalloc()' because the bitmap is fully overridden by a 'bitmap_copy()' call just after its allocation. While at it, remove an extra and unneeded space. Signed-off-by: Christophe JAILLET Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 9ce5ed6eaac588de2c73bb0262f0ef0b55012225 Author: Colin Ian King Date: Thu Jul 15 15:37:40 2021 +0100 drm/amdgpu/display: make a const array common_rates static, makes object smaller Don't populate the const array common_rates on the stack but instead it static. Makes the object code smaller by 80 bytes: Before: text data bss dec hex filename 268019 98322 256 366597 59805 ../display/amdgpu_dm/amdgpu_dm.o After: text data bss dec hex filename 267843 98418 256 366517 597b5 ../display/amdgpu_dm/amdgpu_dm.o Reduction of 80 bytes (gcc version 10.3.0) Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 67a1af079b490abe587c6187d2066a9c39169d6c Author: Tao Zhou Date: Thu Jul 15 14:52:37 2021 +0800 drm/amd/pm: update DRIVER_IF_VERSION for beige_goby Update the version to 0xD for beige_goby. Signed-off-by: Tao Zhou Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit c5c21a58ece9c41d06036056cf419139aa1c15a6 Author: Tao Zhou Date: Thu Jul 15 14:49:08 2021 +0800 drm/amdgpu: update gc golden setting for dimgrey_cavefish Update gc_10_3_4 golden setting. Signed-off-by: Tao Zhou Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit decd8ce9dfd9ddb8f504dcc1b4ce22cd2422c628 Author: Likun Gao Date: Thu Jul 15 11:08:48 2021 +0800 drm/amdgpu: update golden setting for sienna_cichlid Update GFX golden setting for sienna_cichlid. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0a2ba7b72c0a098601f1b2e0205f744dde952f36 Author: Xiaojian Du Date: Wed Jul 14 15:07:22 2021 +0800 drm/amdgpu: update the golden setting for vangogh This patch is to update the golden setting for vangogh. Signed-off-by: Xiaojian Du Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b76a8062af2f3be08038e927aafb116e84053374 Author: Guchun Chen Date: Tue Jul 13 13:44:46 2021 +0800 drm/amd/display: avoid printing ERROR for unknown CEA parse(v2) For the unknown CEA parse case on DMUB-enabled ASICs, dmesg will print an error message like below, this will be captured by automation tools as it has the word like ERROR during boot up and treated as a false error, as it does not break bootup process. So use DRM_WARN printing for this. [drm:amdgpu_dm_update_freesync_caps [amdgpu]] *ERROR* Unknown EDID CEA parser results v2: Use DRM_WARN to print such info. Signed-off-by: Guchun Chen Reviewed-by: Stylon Wang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 85da6459f45b8e9e43170cc23090d5f2c7e16d3d Author: Andrey Grodzovsky Date: Mon Jul 12 14:30:12 2021 -0400 drm/amdgpu: Switch to LFB for USBC PD FW in psp v13 Add USBC PD FW implementation here to be used with relevant ASICs. Signed-off-by: Andrey Grodzovsky Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 25a3e8ac07a87a4259cc727c585ae4a959fd54a2 Author: Andrey Grodzovsky Date: Fri Jul 16 13:50:39 2021 -0400 drm/amdgpu: Switch to VRAM buffer for USBC PD FW. System memory-based implementation for updating the USBCPD is deprecated for so switching to LFB based implementation for all the ASICs. Signed-off-by: Andrey Grodzovsky Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit f79a3bcb1a50d919147b9f22855d355ed8e03031 Author: Yajun Deng Date: Thu Jul 15 20:24:24 2021 +0800 net/sched: Remove unnecessary if statement It has been deal with the 'if (err' statement in rtnetlink_send() and rtnl_unicast(). so remove unnecessary if statement. v2: use the raw name rtnetlink_send(). Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit cfdf0d9ae75b40013364ddb61a25926ccc9f83ea Author: Yajun Deng Date: Thu Jul 15 20:12:57 2021 +0800 rtnetlink: use nlmsg_notify() in rtnetlink_send() The netlink_{broadcast, unicast} don't deal with 'if (err > 0' statement but nlmsg_{multicast, unicast} do. The nlmsg_notify() contains them. so use nlmsg_notify() instead. so that the caller wouldn't deal with 'if (err > 0' statement. v2: use nlmsg_notify() will do well. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 9075096b09e5905ccaa7f7be548593a6530e097f Author: Veerabadhran Gopalakrishnan Date: Tue Jul 13 23:21:43 2021 +0530 amdgpu/nv.c - Optimize code for video codec support structure Optimized the code for codec info structure initialization Signed-off-by: Veerabadhran Gopalakrishnan Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 554398174d98364ea91a7a9aa6866d65ea72d0da Author: Veerabadhran Gopalakrishnan Date: Fri Jul 9 13:00:11 2021 +0530 amdgpu/nv.c - Added video codec support for Yellow Carp Added the supported codecs in the video capabilities query. Signed-off-by: Veerabadhran Gopalakrishnan Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 63a9192b8fa1ea55efeba1f18fad52bb24d9bf12 Author: Haiyue Wang Date: Wed Jul 14 15:34:59 2021 +0800 gve: fix the wrong AdminQ buffer overflow check The 'tail' pointer is also free-running count, so it needs to be masked as 'adminq_prod_cnt' does, to become an index value of AdminQ buffer. Fixes: 5cdad90de62c ("gve: Batch AQ commands for creating and destroying queues.") Signed-off-by: Haiyue Wang Reviewed-by: Catherine Sullivan Signed-off-by: David S. Miller commit 14858dcc3b3587f4bb5c48e130ee7d68fc2b0a29 Author: Rafael J. Wysocki Date: Thu Jul 8 15:25:06 2021 +0200 PCI: Use pci_update_current_state() in pci_enable_device_flags() Updating the current_state field of struct pci_dev the way it is done in pci_enable_device_flags() before calling do_pci_enable_device() may not work. For example, if the given PCI device depends on an ACPI power resource whose _STA method initially returns 0 ("off"), but the config space of the PCI device is accessible and the power state retrieved from the PCI_PM_CTRL register is D0, the current_state field in the struct pci_dev representing that device will get out of sync with the power.state of its ACPI companion object and that will lead to power management issues going forward. To avoid such issues, make pci_enable_device_flags() call pci_update_current_state() which takes ACPI device power management into account, if present, to retrieve the current power state of the device. Link: https://lore.kernel.org/lkml/20210314000439.3138941-1-luzmaximilian@gmail.com/ Reported-by: Maximilian Luz Signed-off-by: Rafael J. Wysocki Tested-by: Maximilian Luz commit 45c16fe1d1283bdd3e32bd869bf5aa177fcd50f7 Author: Andy Shevchenko Date: Thu Jul 15 17:16:51 2021 +0300 ACPI: configfs: Make get_header() to return error pointer Instead of duplicating error codes here and there, make get_header() to return error pointer. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit ae57338716ce2e230514be54a06c9bfaa84433a7 Author: Andy Shevchenko Date: Thu Jul 15 17:16:50 2021 +0300 ACPI: configfs: Use sysfs_emit() in "show" functions The sysfs_emit() function was introduced to make it less ambiguous which function is preferred when writing to the output buffer in a "show" callback [1]. Convert the GPIO library sysfs interface from sprintf() to sysfs_emit() accordingly, as the latter is aware of the PAGE_SIZE buffer and correctly returns the number of bytes written into the buffer. No functional change intended. [1] Documentation/filesystems/sysfs.rst Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit b2ebd9dd52670a931e8f1bd77d70c57f9aa186a5 Author: Rafael J. Wysocki Date: Mon Jul 12 19:28:16 2021 +0200 driver core: Split device_platform_notify() Split device_platform_notify_remove) out of device_platform_notify() and call the latter on device addition and the former on device removal. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Reviewed-by: Andy Shevchenko commit 384f5a857baeba88cf013b36999a97b471e4bd9c Author: Rafael J. Wysocki Date: Mon Jul 12 19:27:12 2021 +0200 software nodes: Split software_node_notify() Split software_node_notify_remove) out of software_node_notify() and make device_platform_notify() call the latter on device addition and the former on device removal. While at it, put the headers of the above functions into base.h, because they don't need to be present in a global header file. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Reviewed-by: Heikki Krogerus Reviewed-by: Andy Shevchenko commit d0b8e398319e5b09f3cb26ee8288ce356646fca6 Author: Rafael J. Wysocki Date: Mon Jul 12 19:25:55 2021 +0200 ACPI: glue: Eliminate acpi_platform_notify() Get rid of acpi_platform_notify() which is redundant and make device_platform_notify() in the driver core call acpi_device_notify() and acpi_device_notify_remove() directly. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko commit 5e557cbac8058bfc79b8a27d319930c5e5d77974 Author: Rafael J. Wysocki Date: Mon Jul 12 19:24:50 2021 +0200 ACPI: bus: Rename functions to avoid name collision There is a name collision between acpi_device_notify() defined in bus.c and another static function defined in glue.c. Since the latter is going to be exported from that file, rename the former to acpi_notify_device() and rename acpi_device_notify_fixed() to follow the same naming pattern. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko commit 7d625e5b143d07f26c437ede6b18730c2fc4d1b5 Author: Rafael J. Wysocki Date: Mon Jul 12 19:23:37 2021 +0200 ACPI: glue: Change return type of two functions to void Since the return values of acpi_device_notify() and acpi_device_notify_remove() are discarded by their only caller, change their return type to void. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko commit 42878a9f0fe0b6bef7fb24d98e161c1216a36926 Author: Rafael J. Wysocki Date: Mon Jul 12 19:23:32 2021 +0200 ACPI: glue: Rearrange acpi_device_notify() Make the code flow in acpi_device_notify() more straightforward and make it use dev_dbg() and acpi_handle_debug() for printing debug messages. The only expected functional impact of this change is the content of the debug messages printed by acpi_device_notify(). Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko commit b1121e2a182dc8f22e7cfa2d8374199505d27ab8 Author: Huacai Chen Date: Mon Jul 5 20:42:04 2021 +0800 ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA We are preparing to add new Loongson (based on LoongArch, not MIPS) support. LoongArch use ACPI other than DT as its boot protocol, so add its support for ACPI_PROCESSOR/ACPI_NUMA. Signed-off-by: Huacai Chen Signed-off-by: Rafael J. Wysocki commit fd080a01ecfc92984cabca6e54c61fe0f70e3984 Author: Hans de Goede Date: Tue Jul 6 18:09:23 2021 +0200 ACPI / PMIC: XPower: optimize MIPI PMIQ sequence I2C-bus accesses The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus and while the kernel holds the semaphore the CPU and GPU power-states must not be changed otherwise the system will freeze. This is a complex process, which is quite expensive. This is all done by iosf_mbi_block_punit_i2c_access(). To ensure that no unguarded I2C-bus accesses happen, iosf_mbi_block_punit_i2c_access() gets called by the I2C-bus-driver for every I2C transfer. Because this is so expensive it is allowed to call iosf_mbi_block_punit_i2c_access() in a nested fashion, so that higher-level code which does multiple I2C-transfers can call it once for a group of transfers, turning the calls done by the I2C-bus-driver into no-ops. The default exec_mipi_pmic_seq_element implementation from drivers/acpi/pmic/intel_pmic.c does a regmap_update_bits() call and the involved registers are typically marked as volatile in the regmap, so this leads to 2 I2C-bus accesses. Add a XPower AXP288 specific implementation of exec_mipi_pmic_seq_element which calls iosf_mbi_block_punit_i2c_access() calls before the regmap_update_bits() call to avoid having to do the whole expensive acquire P-Unit semaphore dance twice. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit e38ba404f20c4beb1a5d4547567d2934a5b95843 Author: Hans de Goede Date: Tue Jul 6 18:09:22 2021 +0200 ACPI / PMIC: XPower: optimize I2C-bus accesses The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus and while the kernel holds the semaphore the CPU and GPU power-states must not be changed otherwise the system will freeze. This is a complex process, which is quite expensive. This is all done by iosf_mbi_block_punit_i2c_access(). To ensure that no unguarded I2C-bus accesses happen, iosf_mbi_block_punit_i2c_access() gets called by the I2C-bus-driver for every I2C transfer. Because this is so expensive it is allowed to call iosf_mbi_block_punit_i2c_access() in a nested fashion, so that higher-level code which does multiple I2C-transfers can call it once for a group of transfers, turning the calls done by the I2C-bus-driver into no-ops. Add iosf_mbi_block_punit_i2c_access() calls around groups of register accesses, so that the P-Unit semaphore only needs to be taken once for each group of register accesses. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 3f2cbe3810a60111a33f5f6267bd5a237b826fc9 Author: Alexander Antonov Date: Tue Jul 6 12:07:23 2021 +0300 perf/x86/intel/uncore: Fix IIO cleanup mapping procedure for SNR/ICX skx_iio_cleanup_mapping() is re-used for snr and icx, but in those cases it fails to use the appropriate XXX_iio_mapping_group and as such fails to free previously allocated resources, leading to memory leaks. Fixes: 10337e95e04c ("perf/x86/intel/uncore: Enable I/O stacks to IIO PMON mapping on ICX") Signed-off-by: Alexander Antonov [peterz: Changelog] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210706090723.41850-1-alexander.antonov@linux.intel.com commit cf3ee3c8c29dc349b2cf52e5e72e8cb805ff5e57 Author: Mark Rutland Date: Tue Jul 13 11:52:53 2021 +0100 locking/atomic: add generic arch_*() bitops Now that all architectures provide arch_atomic_long_*(), we can implement the generic bitops atop these rather than atop atomic_long_*(), and provide arch_*() forms of the bitops that are safe to use in noinstr code. Now that all architectures provide arch_atomic_long_*(), we can build the generic arch_*() bitops atop these, which can be safely used in noinstr code. The regular bitop wrappers are built atop these. As the generic non-atomic bitops use plain accesses, these will be implicitly instrumented unless they are inlined into noinstr functions (which is similar to arch_atomic*_read() when based on READ_ONCE()). The wrappers are modified so that where the underlying arch_*() function uses a plain access, no explicit instrumentation is added, as this is redundant and could result in confusing reports. Since function prototypes get excessively long with both an `arch_` prefix and `__always_inline` attribute, the return type and function attributes have been split onto a separate line, matching the style of the generated atomic headers. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210713105253.7615-6-mark.rutland@arm.com commit 67d1b0de258ad066e1fc85d0ceaa75e107fb45bb Author: Mark Rutland Date: Tue Jul 13 11:52:52 2021 +0100 locking/atomic: add arch_atomic_long*() Now that all architectures provide arch_{atomic,atomic64}_*(), we can build arch_atomic_long_*() atop these, which can be safely used in noinstr code. The regular atomic_long_*() wrappers are built atop these, as we do for {atomic,atomic64}_*() atop arch_{atomic,atomic64}_*(). We don't provide arch_* versions of the cond_read*() variants, as we don't have arch_* versions of the underlying atomic/atomic64 functions (nor the smp_cond_load*() helpers these are typically based on). Note that the headers in this patch under include/linux/atomic/ are generated by the scripts in scripts/atomic/. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210713105253.7615-5-mark.rutland@arm.com commit e3d18cee258b898017b298b5b93f8134dd62aee3 Author: Mark Rutland Date: Tue Jul 13 11:52:51 2021 +0100 locking/atomic: centralize generated headers The generated atomic headers are only intended to be included directly by , but are spread across include/linux/ and include/asm-generic/, where people mnay be encouraged to include them. This patch centralizes them under include/linux/atomic/. Other than the header guards and hashes, there is no change to any of the generated headers as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210713105253.7615-4-mark.rutland@arm.com commit f3e615b4db1fb7034f1d76dc307b77cc848f040e Author: Mark Rutland Date: Tue Jul 13 11:52:50 2021 +0100 locking/atomic: remove ARCH_ATOMIC remanants Now that gen-atomic-fallback.sh is only used to generate the arch_* fallbacks, we don't need to also generate the non-arch_* forms, and can removethe infrastructure this needed. There is no change to any of the generated headers as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210713105253.7615-3-mark.rutland@arm.com commit 47401d94947d507ff9f33fccf490baf47638fb69 Author: Mark Rutland Date: Tue Jul 13 11:52:49 2021 +0100 locking/atomic: simplify ifdef generation In gen-atomic-fallback.sh's gen_proto_order_variants(), we generate some ifdeferry with: | local basename="${arch}${atomic}_${pfx}${name}${sfx}" | ... | printf "#ifdef ${basename}\n" | ... | printf "#endif /* ${arch}${atomic}_${pfx}${name}${sfx} */\n\n" For clarity, use ${basename} for both sides, rather than open-coding the string generation. There is no change to any of the generated headers as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210713105253.7615-2-mark.rutland@arm.com commit d4e5076c3522658996dbb050aa6c708bd2c1a3c1 Author: xuyehan Date: Tue Jul 6 12:50:43 2021 +0800 locking/rwsem: Remove an unused parameter of rwsem_wake() The 2nd parameter 'count' is not used in this function. The places where the function is called are also modified. Signed-off-by: xuyehan Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Link: https://lore.kernel.org/r/1625547043-28103-1-git-send-email-yehanxu1@gmail.com commit 1f8c543f142942a2325e729fc4c64b6898749c3a Author: zhaoxiaoqiang11 Date: Fri Jul 16 17:18:53 2021 +0800 cgroup: remove cgroup_mount from comments Git rid of an outdated comment. Since cgroup was fully switched to fs_context, cgroup_mount() is gone and it's confusing to mention in comments of cgroup_kill_sb(). Delete it. Signed-off-by: zhaoxiaoqiang11 Signed-off-by: Tejun Heo commit 923232bbea88a29f18a2361790582a6474a538fc Author: Bob Pearson Date: Tue Jul 6 23:00:41 2021 -0500 RDMA/rxe: Fix types in rxe_icrc.c Currently the ICRC is generated as a u32 type and then forced to a __be32 and stored into the ICRC field in the packet. The actual type of the ICRC is __be32. This patch replaces u32 by __be32 and eliminates the casts. The computation is exactly the same as the original but the types are more consistent. Link: https://lore.kernel.org/r/20210707040040.15434-10-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit e4f5c82fefa9bce9a5e010901c2d16f2654b1f18 Author: Bob Pearson Date: Tue Jul 6 23:00:40 2021 -0500 RDMA/rxe: Add kernel-doc comments to rxe_icrc.c This patch adds kernel-doc style comments to rxe_icrc.c Link: https://lore.kernel.org/r/20210707040040.15434-9-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit add2b3b80e3a9b8f06562efe79b44809f64640db Author: Bob Pearson Date: Tue Jul 6 23:00:39 2021 -0500 RDMA/rxe: Move crc32 init code to rxe_icrc.c This patch collects the code from rxe_register_device() that sets up the crc32 calculation into a subroutine rxe_icrc_init() in rxe_icrc.c. Link: https://lore.kernel.org/r/20210707040040.15434-8-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 63887510571b072217c20ea6e1f9be744dcd0f29 Author: Bob Pearson Date: Tue Jul 6 23:00:38 2021 -0500 RDMA/rxe: Fixup rxe_icrc_hdr rxe_icrc_hdr() in rxe_icrc.c is no longer shared. This patch makes it static and changes the parameter list to match the other routines there. Link: https://lore.kernel.org/r/20210707040040.15434-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit b6c6cc4acdf68f4c98c25fd8975d068009993cd8 Author: Bob Pearson Date: Tue Jul 6 23:00:37 2021 -0500 RDMA/rxe: Move rxe_crc32 to a subroutine Move rxe_crc32() from rxe.h to rxe_icrc.c as a static local function. Link: https://lore.kernel.org/r/20210707040040.15434-6-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 1117f26ea7ec233318c66fdbef76ce212414a826 Author: Bob Pearson Date: Tue Jul 6 23:00:36 2021 -0500 RDMA/rxe: Move ICRC generation to a subroutine Isolate ICRC generation into a single subroutine named rxe_generate_icrc() in rxe_icrc.c. Remove scattered crc generation code from elsewhere. Link: https://lore.kernel.org/r/20210707040040.15434-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 13050a0b32e3caa8160e940f0d66059ed3e4e62b Author: Bob Pearson Date: Tue Jul 6 23:00:35 2021 -0500 RDMA/rxe: Fixup rxe_send and rxe_loopback Fixup rxe_send() and rxe_loopback() in rxe_net.c to have the same calling sequence. This patch makes them static and have the same parameter list and return value. Link: https://lore.kernel.org/r/20210707040040.15434-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 36fbb03d05f2799a27bbed51564aba0354f3fee3 Author: Bob Pearson Date: Tue Jul 6 23:00:34 2021 -0500 RDMA/rxe: Move rxe_xmit_packet to a subroutine rxe_xmit_packet() was an overlong inline subroutine. This patch moves it into rxe_net.c as an ordinary subroutine. Link: https://lore.kernel.org/r/20210707040040.15434-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Reviewed-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit fe87fb17c6febdf6e0f7308cdf175de617d24c72 Author: Bob Pearson Date: Tue Jul 6 23:00:33 2021 -0500 RDMA/rxe: Move ICRC checking to a subroutine Move the code in rxe_recv() that checks the ICRC on incoming packets to a subroutine rxe_check_icrc() and move that to rxe_icrc.c. Link: https://lore.kernel.org/r/20210707040040.15434-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Reviewed-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit 5f92b45c3b67e3d222caf10e2eb898af31756b67 Author: Ani Sinha Date: Fri Jul 16 19:02:45 2021 +0530 x86/hyperv: add comment describing TSC_INVARIANT_CONTROL MSR setting bit 0 Commit dce7cd62754b5 ("x86/hyperv: Allow guests to enable InvariantTSC") added the support for HV_X64_MSR_TSC_INVARIANT_CONTROL. Setting bit 0 of this synthetic MSR will allow hyper-v guests to report invariant TSC CPU feature through CPUID. This comment adds this explanation to the code and mentions where the Intel's generic platform init code reads this feature bit from CPUID. The comment will help developers understand how the two parts of the initialization (hyperV specific and non-hyperV specific generic hw init) are related. Signed-off-by: Ani Sinha Reviewed-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20210716133245.3272672-1-ani@anisinha.ca Signed-off-by: Wei Liu commit ad1abe476995d97bfe7546ea91bb4f3dcdfbf3ab Author: Peter Robinson Date: Thu Jul 1 23:05:16 2021 +0100 power: supply: cw2015: use dev_err_probe to allow deferred probe Deal with deferred probe using dev_err_probe so the error is handled and avoid logging lots probe defer information like the following: [ 9.125121] cw2015 4-0062: Failed to register power supply [ 9.211131] cw2015 4-0062: Failed to register power supply Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver") Signed-off-by: Peter Robinson Reviewed-by: Javier Martinez Canillas Signed-off-by: Sebastian Reichel commit 21bfee9c0c7754408b1f311bffe304caf3e62250 Author: Anand Khoje Date: Mon Jul 12 17:56:25 2021 +0530 IB/core: Read subnet_prefix in ib_query_port via cache. ib_query_port() calls device->ops.query_port() to get the port attributes. The method of querying is device driver specific. The same function calls device->ops.query_gid() to get the GID and extract the subnet_prefix (gid_prefix). The GID and subnet_prefix are stored in a cache. But they do not get read from the cache if the device is an Infiniband device. The following change takes advantage of the cached subnet_prefix. Testing with RDBMS has shown a significant improvement in performance with this change. Link: https://lore.kernel.org/r/20210712122625.1147-4-anand.a.khoje@oracle.com Signed-off-by: Anand Khoje Signed-off-by: Haakon Bugge Signed-off-by: Jason Gunthorpe commit 36721a6d4cf2a39f411e3ac04d5771d1ffef9d23 Author: Anand Khoje Date: Mon Jul 12 17:56:24 2021 +0530 IB/core: Shifting initialization of device->cache_lock The lock cache_lock of struct ib_device is initialized in function ib_cache_setup_one(). This is much later than the device initialization in _ib_alloc_device(). This change shifts initialization of cache_lock in _ib_alloc_device(). Link: https://lore.kernel.org/r/20210712122625.1147-3-anand.a.khoje@oracle.com Suggested-by: Haakon Bugge Signed-off-by: Anand Khoje Signed-off-by: Jason Gunthorpe commit 0bc0602ae8275aadc7288692331589350987cef7 Author: Anand Khoje Date: Mon Jul 12 17:56:23 2021 +0530 IB/core: Updating cache for subnet_prefix in config_non_roce_gid_cache() Currently, cache for subnet_prefix was getting updated by reading port attributes via ib_query_port. ib_query_port() calls ops.query_gid() to get subnet_prefix and returns it via port_attr. In ib_cache_update(), config_non_roce_gid_cache() obtains GIDs by calling ops.query_gid(). We utilize this to store subnet_prefix in cache. Link: https://lore.kernel.org/r/20210712122625.1147-2-anand.a.khoje@oracle.com Suggested-by: Jason Gunthorpe Suggested-by: Aru Kolappan Signed-off-by: Anand Khoje Signed-off-by: Haakon Bugge Signed-off-by: Jason Gunthorpe commit 56d629af09b9d4db9792257165844287ecce0a98 Author: Daisuke Nojiri Date: Wed Jun 16 11:51:24 2021 -0700 power: supply: PCHG: Peripheral device charger This patch adds a driver for PCHG (Peripheral CHarGer). PCHG is a framework managing power supplies for peripheral devices. This driver creates a sysfs node for each peripheral charge port: /sys/class/power_supply/peripheral where is the index of a charge port. For example, when a stylus is connected to a NFC/WLC port, the node returns: /sys/class/power_supply/peripheral0/ capacity=50 charge_type=Standard scope=Device status=Charging type=Battery Signed-off-by: Daisuke Nojiri Signed-off-by: Sebastian Reichel commit 5176a18bb5e1596d46c34c4700ac67b74f88f704 Author: Linus Walleij Date: Tue Jul 13 17:27:09 2021 +0200 power: supply: ab8500: Drop some includes from bmdata This file isn't using any AB8500 symbols so drop these includes. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 661d10ee0f1be7e3e08267b8364439980d02a42c Author: Linus Walleij Date: Tue Jul 13 17:27:08 2021 +0200 power: supply: ab8500: Rename charging algorithm psy If we rename the "abx500_chargalg" supply to "ab8500_chargalg" as it should be named, the existing supplies are supplying that supply but that was obviously not working since it had the wrong name. Now that the dependency kicks in we get a bunch of NULL references from ab8500_chargalg_external_power_changed() so check that the workqueue is allocated before we try to queue work on it. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 484a9cc3dcb867813fca62f6443c1e77a1ae3c27 Author: Linus Walleij Date: Tue Jul 13 17:27:07 2021 +0200 power: supply: ab8500: Drop abx500 concept Drop the entire idea with abx500 being abstract and different from ab8500 in the AB8500 charging drivers. This rids the two identical definitions of a slew of structs in ab8500-bm.h and makes things less confusion and easier to understand. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit c5b64a990e7f3b0e3d9bf266b57384467fe382de Author: Linus Walleij Date: Tue Jul 13 17:27:06 2021 +0200 power: supply: ab8500: Rename charging algorithm symbols The "abx500" name on the charging algorithm stems from the ambition to produce a series of these analog basebands, re-using the same charging algorithm driver. No ASICs beside AB8500 and AB8505 were ever produced so this terminology is confusing. Rename the algorithm file and symbols to reflect the more narrow scope. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit f820547446ed05edee2944ebe19ea6a3104434f4 Author: Linus Walleij Date: Tue Jul 13 17:27:05 2021 +0200 power: supply: ab8500: Use library interpolation The kernel already has a static inline for linear interpolation so use that instead of rolling our own. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 513d14045a2dad0bf202b7d4c07a2ca2afdba0b4 Author: ChiYuan Huang Date: Fri Jul 16 11:55:46 2021 +0800 regulator: rtq6752: fix reg reset behavior Reg will be reset in below two conditions. 1. 'Enable' pin from H to L. 2. Both PAVDD and NAVDD are all disabled. And 'Enable' pin also control i2c communication capability. This patch is to Seperate the if condition in enable/disable callback for reg cache manipulation. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1626407746-23156-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit d9dbe1f9ae4b3463093fcf027d79f20bb9a337c8 Author: Srinivas Kandagatla Date: Fri Jul 16 11:56:12 2021 +0100 ASoC: codecs: wcd938x: remove unused port-map reference port_map field was added prior to adding static port map support in soundwire. This makes port_map array in struct wcd938x_sdw_priv redundant and unused, so remove this. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210716105612.5284-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 1cbf731ef3a17b3dd4c22ed0c634ac126d1a4876 Author: Maarten Lankhorst Date: Fri Jul 9 13:38:42 2021 +0200 drm/i915: Fix missing docbook chapters for i915 uapi. I noticed when grepping for DOC: that those were defined in the header, but not actually used. Fix it by removing all chapters and the internal annotation, so the docbook generated chapters are used. This reverts the changes to driver-uapi.rst by the referenced commit 577729533cdc ("drm/i915: Document the Virtual Engine uAPI") Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210715120842.806605-1-maarten.lankhorst@linux.intel.com Fixes: 577729533cdc ("drm/i915: Document the Virtual Engine uAPI") Cc: Tvrtko Ursulin Reviewed-by: Matthew Auld commit 3d134e75c08bd2f19bf80ffddfbd3eab3160ef07 Author: Geert Uytterhoeven Date: Wed Jul 14 14:51:13 2021 +0200 gpio: rcar: Always use local variable dev in gpio_rcar_probe() As we have already have a pointer to the device structure in a local variable in gpio_rcar_probe(), we can just use "dev" instead of "p->dev". Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Bartosz Golaszewski commit 84742a98a97237146bdcc5f87c20a7d3d76e02de Author: Fei Shao Date: Tue Jun 29 17:43:38 2021 +0800 mfd: mt6360: Sort regulator resources Reorder the regulator resources. Signed-off-by: Fei Shao Signed-off-by: Lee Jones commit f4ab169e88d9a512f3d93b315aa04ac1e058991b Author: Martin Hundebøll Date: Tue Jun 29 14:12:13 2021 +0200 mfd: intel-m10-bmc: Add N5010 variant The m10-bmc is used on the Silicom N5010 PAC too, so add it to list of m10bmc types. Signed-off-by: Martin Hundebøll Acked-by: Moritz Fischer Reviewed-by: Xu Yilun Reviewed-by: Matthew Gerlach Signed-off-by: Lee Jones commit f949a9ebce7a18005266b859a17f10c891bb13d7 Author: Hans de Goede Date: Tue Jun 29 19:12:39 2021 +0200 mfd: axp20x: Update AXP288 volatile ranges On Cherry Trail devices with an AXP288 PMIC the external SD-card slot used the AXP's DLDO2 as card-voltage and either DLDO3 or GPIO1LDO (GPIO1 pin in low noise LDO mode) as signal-voltage. These regulators are turned on/off and in case of the signal-voltage also have their output-voltage changed by the _PS0 and _PS3 power- management ACPI methods on the MMC-controllers ACPI fwnode as well as by the _DSM ACPI method for changing the signal voltage. The AML code implementing these methods is directly accessing the PMIC through ACPI I2C OpRegion accesses, instead of using the special PMIC OpRegion handled by drivers/acpi/pmic/intel_pmic_xpower.c . This means that the contents of the involved PMIC registers can change without the change being made through the regmap interface, so regmap should not cache the contents of these registers. Mark the regulator power on/off, the regulator voltage control and the GPIO1 control registers as volatile, to avoid regmap caching them. Specifically this fixes an issue on some models where the i915 driver toggles another LDO using the same on/off register on/off through MIPI sequences (through intel_soc_pmic_exec_mipi_pmic_seq_element()) which then writes back a cached on/off register-value where the card-voltage is off causing the external sdcard slot to stop working when the screen goes blank, or comes back on again. The regulator register-range now marked volatile also includes the buck regulator control registers. This is done on purpose these are normally not touched by the AML code, but they are updated directly by the SoC's PUNIT which means that they may also change without going through regmap. Note the AXP288 PMIC is only used on Bay- and Cherry-Trail platforms, so even though this is an ACPI specific problem there is no need to make the new volatile ranges conditional since these platforms always use ACPI. Fixes: dc91c3b6fe66 ("mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile") Fixes: cd53216625a0 ("mfd: axp20x: Fix axp288 volatile ranges") Reported-and-tested-by: Clamshell Signed-off-by: Hans de Goede Reviewed-by: Chen-Yu Tsai Signed-off-by: Lee Jones commit f03a3cab26c1b7f628a3be6d33ae1b483829b630 Author: Randy Dunlap Date: Sun Jul 11 15:31:45 2021 -0700 crypto: lib - rename 'mod_init' & 'mod_exit' functions to be module-specific Rename module_init & module_exit functions that are named "mod_init" and "mod_exit" so that they are unique in both the System.map file and in initcall_debug output instead of showing up as almost anonymous "mod_init". This is helpful for debugging and in determining how long certain module_init calls take to execute. Signed-off-by: Randy Dunlap Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Jason A. Donenfeld Signed-off-by: Herbert Xu commit f0d9ff8c8efb90ae335d41c2fc0d92724af55a63 Author: Randy Dunlap Date: Sun Jul 11 15:31:44 2021 -0700 hwrng: rename 'mod_init' & 'mod_exit' functions to be module-specific Rename module_init & module_exit functions that are named "mod_init" and "mod_exit" so that they are unique in both the System.map file and in initcall_debug output instead of showing up as almost anonymous "mod_init". This is helpful for debugging and in determining how long certain module_init calls take to execute. Signed-off-by: Randy Dunlap Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Andres Salomon Cc: linux-geode@lists.infradead.org Cc: Matt Mackall Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Jason A. Donenfeld Signed-off-by: Herbert Xu commit cb5f09e8148440d3581403c0415bc9678a64488d Author: Randy Dunlap Date: Sun Jul 11 15:31:43 2021 -0700 crypto: arm/curve25519 - rename 'mod_init' & 'mod_exit' functions to be module-specific Rename module_init & module_exit functions that are named "mod_init" and "mod_exit" so that they are unique in both the System.map file and in initcall_debug output instead of showing up as almost anonymous "mod_init". This is helpful for debugging and in determining how long certain module_init calls take to execute. Signed-off-by: Randy Dunlap Cc: Jason A. Donenfeld Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Acked-by: Russell King (Oracle) Signed-off-by: Herbert Xu commit 2e6d793e1bf07fe5e20cfbbdcec9e1af7e5097eb Author: Sean Anderson Date: Thu Jul 1 14:56:38 2021 -0400 crypto: mxs-dcp - Use sg_mapping_iter to copy data This uses the sg_pcopy_from_buffer to copy data, instead of doing it ourselves. In addition to reducing code size, this fixes the following oops resulting from failing to kmap the page: [ 68.896381] Unable to handle kernel NULL pointer dereference at virtual address 00000ab8 [ 68.904539] pgd = 3561adb3 [ 68.907475] [00000ab8] *pgd=00000000 [ 68.911153] Internal error: Oops: 805 [#1] ARM [ 68.915618] Modules linked in: cfg80211 rfkill des_generic libdes arc4 libarc4 cbc ecb algif_skcipher sha256_generic libsha256 sha1_generic hmac aes_generic libaes cmac sha512_generic md5 md4 algif_hash af_alg i2c_imx i2c_core ci_hdrc_imx ci_hdrc mxs_dcp ulpi roles udc_core imx_sdma usbmisc_imx usb_common firmware_class virt_dma phy_mxs_usb nf_tables nfnetlink ip_tables x_tables ipv6 autofs4 [ 68.950741] CPU: 0 PID: 139 Comm: mxs_dcp_chan/ae Not tainted 5.10.34 #296 [ 68.958501] Hardware name: Freescale i.MX6 Ultralite (Device Tree) [ 68.964710] PC is at memcpy+0xa8/0x330 [ 68.968479] LR is at 0xd7b2bc9d [ 68.971638] pc : [] lr : [] psr: 000f0013 [ 68.977920] sp : c2cbbee4 ip : 00000010 fp : 00000010 [ 68.983159] r10: 00000000 r9 : c3283a40 r8 : 1a5a6f08 [ 68.988402] r7 : 4bfe0ecc r6 : 76d8a220 r5 : c32f9050 r4 : 00000001 [ 68.994945] r3 : 00000ab8 r2 : fffffff0 r1 : c32f9050 r0 : 00000ab8 [ 69.001492] Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 69.008646] Control: 10c53c7d Table: 83664059 DAC: 00000051 [ 69.014414] Process mxs_dcp_chan/ae (pid: 139, stack limit = 0x667b57ab) [ 69.021133] Stack: (0xc2cbbee4 to 0xc2cbc000) [ 69.025519] bee0: c32f9050 c3235408 00000010 00000010 00000ab8 00000001 bf10406c [ 69.033720] bf00: 00000000 00000000 00000010 00000000 c32355d0 832fb080 00000000 c13de2fc [ 69.041921] bf20: c3628010 00000010 c33d5780 00000ab8 bf1067e8 00000002 c21e5010 c2cba000 [ 69.050125] bf40: c32f8040 00000000 bf106a40 c32f9040 c3283a80 00000001 bf105240 c3234040 [ 69.058327] bf60: ffffe000 c3204100 c2c69800 c2cba000 00000000 bf103b84 00000000 c2eddc54 [ 69.066530] bf80: c3204144 c0140d1c c2cba000 c2c69800 c0140be8 00000000 00000000 00000000 [ 69.074730] bfa0: 00000000 00000000 00000000 c0100114 00000000 00000000 00000000 00000000 [ 69.082932] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 69.091131] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 69.099364] [] (memcpy) from [] (dcp_chan_thread_aes+0x4e8/0x840 [mxs_dcp]) [ 69.108117] [] (dcp_chan_thread_aes [mxs_dcp]) from [] (kthread+0x134/0x160) [ 69.116941] [] (kthread) from [] (ret_from_fork+0x14/0x20) [ 69.124178] Exception stack(0xc2cbbfb0 to 0xc2cbbff8) [ 69.129250] bfa0: 00000000 00000000 00000000 00000000 [ 69.137450] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 69.145648] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 69.152289] Code: e320f000 e4803004 e4804004 e4805004 (e4806004) Signed-off-by: Sean Anderson Signed-off-by: Herbert Xu commit df6313d707e575a679ada3313358289af24454c0 Author: Sean Anderson Date: Thu Jul 1 14:56:37 2021 -0400 crypto: mxs-dcp - Check for DMA mapping errors After calling dma_map_single(), we must also call dma_mapping_error(). This fixes the following warning when compiling with CONFIG_DMA_API_DEBUG: [ 311.241478] WARNING: CPU: 0 PID: 428 at kernel/dma/debug.c:1027 check_unmap+0x79c/0x96c [ 311.249547] DMA-API: mxs-dcp 2280000.crypto: device driver failed to check map error[device address=0x00000000860cb080] [size=32 bytes] [mapped as single] Signed-off-by: Sean Anderson Reviewed-by: Richard Weinberger Signed-off-by: Herbert Xu commit 24ebc044c72ee6e88dc902a0041bac672f012537 Author: Jinchao Wang Date: Sat Jun 26 18:15:38 2021 +0800 auxdisplay: Replace symbolic permissions with octal permissions Resolves the checkpatch warning. Signed-off-by: Jinchao Wang [edited wording] Signed-off-by: Miguel Ojeda commit f885afe28d20b66341a8f55b10367312c1d6b686 Author: Andy Shevchenko Date: Wed Jun 16 17:15:48 2021 +0300 auxdisplay: ks0108: Switch to use module_parport_driver() Switch to use module_parport_driver() to reduce boilerplate code. Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda commit ac8c8fa0a8c3a7bc0a9a9cc44ab3650d98662754 Author: Andy Shevchenko Date: Thu Jul 15 17:41:52 2021 +0300 auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style For structure initializers the fields are 0 (or NULL) by default, so there is no need to fill them explicitly. Besides that, much easier to read when initializers use C99 style. Hence, convert to C99 style as well. Signed-off-by: Andy Shevchenko Acked-by: Willy Tarreau Signed-off-by: Miguel Ojeda commit 333ff32d54cdefc2e479892e7f15ac91e026b57d Author: Lars Poeschel Date: Wed Jul 14 13:02:28 2021 +0200 auxdisplay: hd44780: Fix oops on module unloading Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/CAHp75VfKyqy+vM0XkP9Yb+znGOTVT4zYCRY3A3nQ7C3WNUVN0g@mail.gmail.com/ Reported-By: Andy Shevchenko Signed-off-by: Lars Poeschel Tested-by: Andy Shevchenko [added Link, Fixes, Cc stable tags, edited message] Signed-off-by: Miguel Ojeda commit 82a1ffe57ec6455658584459de56ee4b401c1dfb Merge: 87117baf4f923 c50524ec4e3ad Author: David S. Miller Date: Thu Jul 15 22:40:10 2021 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2021-07-15 The following pull-request contains BPF updates for your *net-next* tree. We've added 45 non-merge commits during the last 15 day(s) which contain a total of 52 files changed, 3122 insertions(+), 384 deletions(-). The main changes are: 1) Introduce bpf timers, from Alexei. 2) Add sockmap support for unix datagram socket, from Cong. 3) Fix potential memleak and UAF in the verifier, from He. 4) Add bpf_get_func_ip helper, from Jiri. 5) Improvements to generic XDP mode, from Kumar. 6) Support for passing xdp_md to XDP programs in bpf_prog_run, from Zvi. =================== Signed-off-by: David S. Miller commit c50524ec4e3ad97d7d963268abd859c6413fbeb4 Merge: 1554a080e7655 a2ffda38dc01c Author: Alexei Starovoitov Date: Thu Jul 15 18:17:51 2021 -0700 Merge branch 'sockmap: add sockmap support for unix datagram socket' Cong Wang says: ==================== From: Cong Wang This is the last patchset of the original large patchset. In the previous patchset, a new BPF sockmap program BPF_SK_SKB_VERDICT was introduced and UDP began to support it too. In this patchset, we add BPF_SK_SKB_VERDICT support to Unix datagram socket, so that we can finally splice Unix datagram socket and UDP socket. Please check each patch description for more details. To see the big picture, the previous patchsets are available here: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=1e0ab70778bd86a90de438cc5e1535c115a7c396 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=89d69c5d0fbcabd8656459bc8b1a476d6f1efee4 and this patchset is available here: https://github.com/congwang/linux/tree/sockmap3 Acked-by: John Fastabend --- v5: lift socket state check for dgram remove ->unhash() case add retries for EAGAIN in all test cases remove an unused parameter of __unix_dgram_recvmsg() rebase on the latest bpf-next v4: fix af_unix disconnect case add unix_unhash() split out two small patches reduce u->iolock critical section remove an unused parameter of __unix_dgram_recvmsg() v3: fix Kconfig dependency make unix_read_sock() static fix a UAF in unix_release() add a missing header unix_bpf.c v2: separate out from the original large patchset rebase to the latest bpf-next clean up unix_read_sock() export sock_map_close() factor out some helpers in selftests for code reuse ==================== Signed-off-by: Alexei Starovoitov commit a2ffda38dc01cb3963c78bd34e1ec7226af55028 Author: Cong Wang Date: Sun Jul 4 12:02:52 2021 -0700 selftests/bpf: Add test cases for redirection between udp and unix Add two test cases to ensure redirection between udp and unix work bidirectionally. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-12-xiyou.wangcong@gmail.com commit 5ea905dd432205bfa314efb1b5353889e1804f11 Author: Cong Wang Date: Sun Jul 4 12:02:51 2021 -0700 selftests/bpf: Add a test case for unix sockmap Add a test case to ensure redirection between two AF_UNIX datagram sockets work. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-11-xiyou.wangcong@gmail.com commit 0626bc2ff6422008f5f1b8153837b83893a75e1b Author: Cong Wang Date: Sun Jul 4 12:02:50 2021 -0700 selftests/bpf: Factor out add_to_sockmap() Factor out a common helper add_to_sockmap() which adds two sockets into a sockmap. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-10-xiyou.wangcong@gmail.com commit d950625c81e115e275458b4074f493bf4d1f15de Author: Cong Wang Date: Sun Jul 4 12:02:49 2021 -0700 selftests/bpf: Factor out udp_socketpair() Factor out a common helper udp_socketpair() which creates a pair of connected UDP sockets. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-9-xiyou.wangcong@gmail.com commit 9825d866ce0d11009513e06824885340062c166b Author: Cong Wang Date: Sun Jul 4 12:02:48 2021 -0700 af_unix: Implement unix_dgram_bpf_recvmsg() We have to implement unix_dgram_bpf_recvmsg() to replace the original ->recvmsg() to retrieve skmsg from ingress_msg. AF_UNIX is again special here because the lack of sk_prot->recvmsg(). I simply add a special case inside unix_dgram_recvmsg() to call sk->sk_prot->recvmsg() directly. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-8-xiyou.wangcong@gmail.com commit c63829182c37c2d6d0608976d15fa61ebebe9e6b Author: Cong Wang Date: Sun Jul 4 12:02:47 2021 -0700 af_unix: Implement ->psock_update_sk_prot() Now we can implement unix_bpf_update_proto() to update sk_prot, especially prot->close(). Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-7-xiyou.wangcong@gmail.com commit c7272e15f0f18d6e0f423b53207eac7a27ed5a49 Author: Cong Wang Date: Sun Jul 4 12:02:46 2021 -0700 af_unix: Add a dummy ->close() for sockmap Unlike af_inet, unix_proto is very different, it does not even have a ->close(). We have to add a dummy implementation to satisfy sockmap. Normally it is just a nop, it is introduced only for sockmap to replace it. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-6-xiyou.wangcong@gmail.com commit 83301b5367a98c17ec0d76c7bc0ccdc3c7e7ad6d Author: Cong Wang Date: Sun Jul 4 12:02:45 2021 -0700 af_unix: Set TCP_ESTABLISHED for datagram sockets too Currently only unix stream socket sets TCP_ESTABLISHED, datagram socket can set this too when they connect to its peer socket. At least __ip4_datagram_connect() does the same. This will be used to determine whether an AF_UNIX datagram socket can be redirected to in sockmap. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-5-xiyou.wangcong@gmail.com commit 29df44fa52b70c330d8f2a3871e028a3522b8494 Author: Cong Wang Date: Sun Jul 4 12:02:44 2021 -0700 af_unix: Implement ->read_sock() for sockmap Implement ->read_sock() for AF_UNIX datagram socket, it is pretty much similar to udp_read_sock(). Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-4-xiyou.wangcong@gmail.com commit 0c48eefae712c2fd91480346a07a1a9cd0f9470b Author: Cong Wang Date: Sun Jul 4 12:02:43 2021 -0700 sock_map: Lift socket state restriction for datagram sockets TCP and other connection oriented sockets have accept() for each incoming connection on the server side, hence they can just insert those fd's from accept() to sockmap, which are of course established. Now with datagram sockets begin to support sockmap and redirection, the restriction is no longer applicable to them, as they have no accept(). So we have to lift this restriction for them. This is fine, because inside bpf_sk_redirect_map() we still have another socket status check, sock_map_redirect_allowed(), as a guard. This also means they do not have to be removed from sockmap when disconnecting. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-3-xiyou.wangcong@gmail.com commit 17edea21b38d047a10c189296c58aea9875d0d0a Author: Cong Wang Date: Sun Jul 4 12:02:42 2021 -0700 sock_map: Relax config dependency to CONFIG_NET Currently sock_map still has Kconfig dependency on CONFIG_INET, but there is no actual functional dependency on it after we introduce ->psock_update_sk_prot(). We have to extend it to CONFIG_NET now as we are going to support AF_UNIX. Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-2-xiyou.wangcong@gmail.com commit 1554a080e76554fa71004bba5b93c4695932a4d7 Merge: 7628317192f59 8237e75420897 Author: Alexei Starovoitov Date: Thu Jul 15 17:17:43 2021 -0700 Merge branch 'Add bpf_get_func_ip helper' Jiri Olsa says: ==================== Add bpf_get_func_ip helper that returns IP address of the caller function for trampoline and krobe programs. There're 2 specific implementation of the bpf_get_func_ip helper, one for trampoline progs and one for kprobe/kretprobe progs. The trampoline helper call is replaced/inlined by the verifier with simple move instruction. The kprobe/kretprobe is actual helper call that returns prepared caller address. Also available at: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/get_func_ip v4 changes: - dropped jit/x86 check for get_func_ip tracing check [Alexei] - added code to bpf_get_func_ip_tracing [Alexei] and tested that it works without inlining [Alexei] - changed has_get_func_ip to check_get_func_ip [Andrii] - replaced test assert loop with explicit asserts [Andrii] - adde bpf_program__attach_kprobe_opts function and use it for offset setup [Andrii] - used bpf_program__set_autoload(false) for test6 [Andrii] - added Masami's ack v3 changes: - resend with Masami in cc and v3 in each patch subject v2 changes: - use kprobe_running to get kprobe instead of cpu var [Masami] - added support to add kprobe on function+offset and test for that [Alan] ==================== Signed-off-by: Alexei Starovoitov commit 8237e75420897a4bf9b38b67cd243331bbd96a01 Author: Jiri Olsa Date: Wed Jul 14 11:44:00 2021 +0200 selftests/bpf: Add test for bpf_get_func_ip in kprobe+offset probe Adding test for bpf_get_func_ip in kprobe+ofset probe. Because of the offset value it's arch specific, enabling the new test only for x86_64 architecture. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-9-jolsa@kernel.org commit a2488b5f483f18e6e34be2a15eb4a79f4a0d8728 Author: Alan Maguire Date: Wed Jul 14 11:43:59 2021 +0200 libbpf: Allow specification of "kprobe/function+offset" kprobes can be placed on most instructions in a function, not just entry, and ftrace and bpftrace support the function+offset notification for probe placement. Adding parsing of func_name into func+offset to bpf_program__attach_kprobe() allows the user to specify SEC("kprobe/bpf_fentry_test5+0x6") ...for example, and the offset can be passed to perf_event_open_probe() to support kprobe attachment. Signed-off-by: Alan Maguire Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-8-jolsa@kernel.org commit ac0ed488297a9850b0c285646b7854228368ba6b Author: Jiri Olsa Date: Wed Jul 14 11:43:58 2021 +0200 libbpf: Add bpf_program__attach_kprobe_opts function Adding bpf_program__attach_kprobe_opts that does the same as bpf_program__attach_kprobe, but takes opts argument. Currently opts struct holds just retprobe bool, but we will add new field in following patch. The function is not exported, so there's no need to add size to the struct bpf_program_attach_kprobe_opts for now. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-7-jolsa@kernel.org commit 5d8b583d04aedb3bd5f6d227a334c210c7d735f9 Author: Jiri Olsa Date: Wed Jul 14 11:43:57 2021 +0200 selftests/bpf: Add test for bpf_get_func_ip helper Adding test for bpf_get_func_ip helper for fentry, fexit, kprobe, kretprobe and fmod_ret programs. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-6-jolsa@kernel.org commit 9ffd9f3ff7193933dae171740ab70a103d460065 Author: Jiri Olsa Date: Wed Jul 14 11:43:56 2021 +0200 bpf: Add bpf_get_func_ip helper for kprobe programs Adding bpf_get_func_ip helper for BPF_PROG_TYPE_KPROBE programs, so it's now possible to call bpf_get_func_ip from both kprobe and kretprobe programs. Taking the caller's address from 'struct kprobe::addr', which is defined for both kprobe and kretprobe. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Reviewed-by: Masami Hiramatsu Link: https://lore.kernel.org/bpf/20210714094400.396467-5-jolsa@kernel.org commit 9b99edcae5c80c8fb9f8e7149bae528c9e610a72 Author: Jiri Olsa Date: Wed Jul 14 11:43:55 2021 +0200 bpf: Add bpf_get_func_ip helper for tracing programs Adding bpf_get_func_ip helper for BPF_PROG_TYPE_TRACING programs, specifically for all trampoline attach types. The trampoline's caller IP address is stored in (ctx - 8) address. so there's no reason to actually call the helper, but rather fixup the call instruction and return [ctx - 8] value directly. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-4-jolsa@kernel.org commit 1e37392cccdea94da635e3c6d16b21865806f619 Author: Jiri Olsa Date: Wed Jul 14 11:43:54 2021 +0200 bpf: Enable BPF_TRAMP_F_IP_ARG for trampolines with call_get_func_ip Enabling BPF_TRAMP_F_IP_ARG for trampolines that actually need it. The BPF_TRAMP_F_IP_ARG adds extra 3 instructions to trampoline code and is used only by programs with bpf_get_func_ip helper, which is added in following patch and sets call_get_func_ip bit. This patch ensures that BPF_TRAMP_F_IP_ARG flag is used only for trampolines that have programs with call_get_func_ip set. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-3-jolsa@kernel.org commit 7e6f3cd89f04a0a577002d5696288b482109d25c Author: Jiri Olsa Date: Wed Jul 14 11:43:53 2021 +0200 bpf, x86: Store caller's ip in trampoline stack Storing caller's ip in trampoline's stack. Trampoline programs can reach the IP in (ctx - 8) address, so there's no change in program's arguments interface. The IP address is takes from [fp + 8], which is return address from the initial 'call fentry' call to trampoline. This IP address will be returned via bpf_get_func_ip helper helper, which is added in following patches. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210714094400.396467-2-jolsa@kernel.org commit c5b9ee9c361f52cd319135b9ec7fe684d5e2e026 Author: Colin Ian King Date: Sun Jul 4 10:47:05 2021 +0100 mtd: rawnand: Fix a couple of spelling mistakes in Kconfig There are two spelling mistakes in the Kconfig text. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210704094705.37175-1-colin.king@canonical.com commit 8363dfc845d74b980e109111b82f0a72aa92e47a Author: Miquel Raynal Date: Tue Jun 29 21:51:57 2021 +0200 mtd: spinand: Fix comment This is a copy paste error, checking the ECC status finishes a page read here, not a page write. Fixes: 945845b54c9c ("mtd: spinand: Instantiate a SPI-NAND on-die ECC engine") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210629195157.567828-1-miquel.raynal@bootlin.com commit 7ed012969bbcdbd7aef5778a061681e6cbc4b402 Author: Marco Elver Date: Wed Jul 14 17:01:59 2021 +0200 Compiler Attributes: fix __has_attribute(__no_sanitize_coverage__) for GCC 4 Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 by defining __GCC4_has_attribute___no_sanitize_coverage__. Fixes: 540540d06e9d ("kcov: add __no_sanitize_coverage to fix noinstr for all architectures") Reported-by: Geert Uytterhoeven Signed-off-by: Marco Elver Signed-off-by: Miguel Ojeda commit 1a57b13e6017d2af575f4f42e848aa0b64d4bcf1 Author: Stefan Riedmueller Date: Fri Jun 25 14:38:21 2021 +0200 mtd: rawnand: nand_bbt: Skip bad blocks when searching for the BBT in NAND The blocks containing the bad block table can become bad as well. So make sure to skip any blocks that are marked bad when searching for the bad block table. Otherwise in very rare cases where two BBT blocks wear out it might happen that an obsolete BBT is used instead of a newer available version. This only applies to drivers which make use of a bad block marker in flash. Other drivers won't be able to identify bad BBT blocks and thus can't skip these. Signed-off-by: Stefan Riedmueller Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210625123821.207458-1-s.riedmueller@phytec.de commit 778cb8e39f6ec252be50fc3850d66f3dcbd5dd5a Author: Miquel Raynal Date: Thu Jun 10 16:39:45 2021 +0200 dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation "PAGESIZE / 512" is the number of ECC chunks. "ECC_BYTES" is the number of bytes needed to store a single ECC code. "2" is the space reserved by the bad block marker. "2 + (PAGESIZE / 512) * ECC_BYTES" should of course be lower or equal than the total number of OOB bytes, otherwise it won't fit. Fix the equation by substituting s/>=/<=/. Suggested-by: Ryan J. Barnett Signed-off-by: Miquel Raynal Acked-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20210610143945.3504781-1-miquel.raynal@bootlin.com commit ff44b90b325dcd585cdba6ded6c9c52ea8ddead0 Author: Corentin Labbe Date: Mon Jun 28 19:14:40 2021 +0000 dt_bindings: mtd: partitions: redboot: convert to YAML Converts mtd/partitions/redboot-fis.txt to YAML. Signed-off-by: Corentin Labbe Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210628191440.2823024-1-clabbe@baylibre.com commit d61eb8a1f5184f32ddc5ac03c930cff8e9a6fae9 Author: Jon Lin Date: Tue Jul 13 17:47:14 2021 +0800 clk: rockchip: Add support for hclk_sfc on rk3036 Add support for the bus clock for the serial flash controller on the rk3036. Taken from the Rockchip BSP kernel but not tested on real hardware (as I lack a 3036 based SoC to test). Signed-off-by: Chris Morgan Signed-off-by: Jon Lin Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20210713094718.1709-2-jon.lin@rock-chips.com Signed-off-by: Heiko Stuebner commit 0be3df186f870cbde56b223c1ad7892109c9c440 Author: Jon Lin Date: Tue Jul 13 17:44:50 2021 +0800 clk: rockchip: rk3036: fix up the sclk_sfc parent error Choose the correct pll Signed-off-by: Elaine Zhang Signed-off-by: Jon Lin Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20210713094456.23288-5-jon.lin@rock-chips.com Signed-off-by: Heiko Stuebner commit b13c1fff66cc255c0a9d48561d05f0f7e8ffd385 Author: Chris Morgan Date: Tue Jul 13 17:47:13 2021 +0800 clk: rockchip: add dt-binding clkid for hclk_sfc on rk3036 Add dt-binding for hclk_sfc on rk3036 Signed-off-by: Chris Morgan Signed-off-by: Jon Lin Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20210713094718.1709-1-jon.lin@rock-chips.com Signed-off-by: Heiko Stuebner commit c0728a2732f0fe2b5e7c57b8c0c170352ace6476 Author: Johan Jonker Date: Fri Jun 25 13:17:46 2021 +0200 ARM: dts: rockchip: add io-domains nodes to rv1108.dtsi The compatible strings below were added to rockchip-io-domain.txt, but never added to the device tree, so add io-domains nodes to rv1108.dtsi "rockchip,rv1108-io-voltage-domain" "rockchip,rv1108-pmu-io-voltage-domain" Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210625111746.6269-4-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 453da32aca12d91b096934a4870ec72e34d61447 Author: Johan Jonker Date: Fri Jun 25 13:17:45 2021 +0200 ARM: dts: rockchip: add io-domains node to rk3188.dtsi The compatible string below was added to rockchip-io-domain.txt, but never added to the device tree, so add a io-domains node to rk3188.dtsi "rockchip,rk3188-io-voltage-domain" Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210625111746.6269-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 959e131fb5c3a08293178e94a184b5bf28974bb4 Author: Johan Jonker Date: Fri Jun 25 13:17:44 2021 +0200 dt-bindings: soc: rockchip: add rockchip-io-domain.yaml object to grf.yaml The rockchip-io-domain.txt file was converted to YAML. IO Voltage Domain nodes are sub nodes of grf and pmugrf nodes. Add rockchip-io-domain.yaml object to the grf.yaml file. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210625111746.6269-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 742f62cb06720c12677f0bb05c64c9eeab34c8ec Author: Johan Jonker Date: Fri Jun 25 13:17:43 2021 +0200 dt-bindings: power: convert rockchip-io-domain.txt to YAML Current dts files with 'io-domains' nodes are manually verified. In order to automate this process rockchip-io-domain.txt has to be converted to YAML. Changed: Add supply properties for: rockchip,rk3328-io-voltage-domain rockchip,rv1108-io-voltage-domain rockchip,rv1108-pmu-io-voltage-domain Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210625111746.6269-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 7628317192f590123c615946c432465e817627a8 Merge: de587d564f957 61f71e746c72f Author: Daniel Borkmann Date: Thu Jul 15 22:33:04 2021 +0200 Merge branch 'bpf-timers' Alexei Starovoitov says: ==================== The first request to support timers in bpf was made in 2013 before sys_bpf syscall was added. That use case was periodic sampling. It was address with attaching bpf programs to perf_events. Then during XDP development the timers were requested to do garbage collection and health checks. They were worked around by implementing timers in user space and triggering progs with BPF_PROG_RUN command. The user space timers and perf_event+bpf timers are not armed by the bpf program. They're done asynchronously vs program execution. The XDP program cannot send a packet and arm the timer at the same time. The tracing prog cannot record an event and arm the timer right away. This large class of use cases remained unaddressed. The jiffy based and hrtimer based timers are essential part of the kernel development and with this patch set the hrtimer based timers will be available to bpf programs. TLDR: bpf timers is a wrapper of hrtimers with all the extra safety added to make sure bpf progs cannot crash the kernel. v6->v7: - address Andrii's comments and add his Acks. v5->v6: - address code review feedback from Martin and add his Acks. - add usercnt > 0 check to bpf_timer_init and remove timers_cancel_and_free second loop in map_free callbacks. - add cond_resched_rcu. v4->v5: - Martin noticed the following issues: . prog could be reallocated bpf_patch_insn_data(). Fixed by passing 'aux' into bpf_timer_set_callback, since 'aux' is stable during insn patching. . Added missing rcu_read_lock. . Removed redundant record_map. - Discovered few bugs with stress testing: . One cpu does htab_free_prealloced_timers->bpf_timer_cancel_and_free->hrtimer_cancel while another is trying to do something with the timer like bpf_timer_start/set_callback. Those ops try to acquire bpf_spin_lock that is already taken by bpf_timer_cancel_and_free, so both cpus spin forever. The same problem existed in bpf_timer_cancel(). One bpf prog on one cpu might call bpf_timer_cancel and wait, while another cpu is in the timer callback that tries to do bpf_timer_*() helper on the same timer. The fix is to do drop_prog_refcnt() and unlock. And only then hrtimer_cancel. Because of this had to add callback_fn != NULL check to bpf_timer_cb(). Also removed redundant bpf_prog_inc/put from bpf_timer_cb() and replaced with rcu_dereference_check similar to recent rcu_read_lock-removal from drivers. bpf_timer_cb is in softirq. . Managed to hit refcnt==0 while doing bpf_prog_put from bpf_timer_cancel_and_free(). That exposed the issue that bpf_prog_put wasn't ready to be called from irq context. Fixed similar to bpf_map_put which is irq ready. - Refactored BPF_CALL_1(bpf_spin_lock) into __bpf_spin_lock_irqsave() to make the main logic more clear, since Martin and Yonghong brought up this concern. v3->v4: 1. Split callback_fn from bpf_timer_start into bpf_timer_set_callback as suggested by Martin. That makes bpf timer api match one to one to kernel hrtimer api and provides greater flexibility. 2. Martin also discovered the following issue with uref approach: bpftool prog load xdp_timer.o /sys/fs/bpf/xdp_timer type xdp bpftool net attach xdpgeneric pinned /sys/fs/bpf/xdp_timer dev lo rm /sys/fs/bpf/xdp_timer nc -6 ::1 8888 bpftool net detach xdpgeneric dev lo The timer callback stays active in the kernel though the prog was detached and map usercnt == 0. It happened because 'bpftool prog load' pinned the prog only. The map usercnt went to zero. Subsequent attach and runs didn't affect map usercnt. The timer was able to start and bpf_prog_inc itself. When the prog was detached the prog stayed active. To address this issue added if (!atomic64_read(&(t->map->usercnt))) return -EPERM; to the first patch. Which means that timers are allowed only in the maps that are held by user space with open file descriptor or maps pinned in bpffs. 3. Discovered that timers in inner maps were broken. The inner map pointers are dynamic. Therefore changed bpf_timer_init() to accept explicit map pointer supplied by the program instead of hidden map pointer supplied by the verifier. To make sure that pointer to a timer actually belongs to that map added the verifier check in patch 3. 4. Addressed Yonghong's feedback. Improved comments and added dynamic in_nmi() check. Added Acks. v2->v3: The v2 approach attempted to bump bpf_prog refcnt when bpf_timer_start is called to make sure callback code doesn't disappear when timer is active and drop refcnt when timer cb is done. That led to a ton of race conditions between callback running and concurrent bpf_timer_init/start/cancel on another cpu, and concurrent bpf_map_update/delete_elem, and map destroy. Then v2.5 approach skipped prog refcnt altogether. Instead it remembered all timers that bpf prog armed in a link list and canceled them when prog refcnt went to zero. The race conditions disappeared, but timers in map-in-map could not be supported cleanly, since timers in inner maps have inner map's life time and don't match prog's life time. This v3 approach makes timers to be owned by maps. It allows timers in inner maps to be supported from the start. This apporach relies on "user refcnt" scheme used in prog_array that stores bpf programs for bpf_tail_call. The bpf_timer_start() increments prog refcnt, but unlike 1st approach the timer callback does decrement the refcnt. The ops->map_release_uref is responsible for cancelling the timers and dropping prog refcnt when user space reference to a map is dropped. That addressed all the races and simplified locking. Andrii presented a use case where specifying callback_fn in bpf_timer_init() is inconvenient vs specifying in bpf_timer_start(). The bpf_timer_init() typically is called outside for timer callback, while bpf_timer_start() most likely will be called from the callback. timer_cb() { ... bpf_timer_start(timer_cb); ...} looks like recursion and as infinite loop to the verifier. The verifier had to be made smarter to recognize such async callbacks. Patches 7,8,9 addressed that. Patch 1 and 2 refactoring. Patch 3 implements bpf timer helpers and locking. Patch 4 implements map side of bpf timer support. Patch 5 prevent pointer mismatch in bpf_timer_init. Patch 6 adds support for BTF in inner maps. Patch 7 teaches check_cfg() pass to understand async callbacks. Patch 8 teaches do_check() pass to understand async callbacks. Patch 9 teaches check_max_stack_depth() pass to understand async callbacks. Patches 10 and 11 are the tests. v1->v2: - Addressed great feedback from Andrii and Toke. - Fixed race between parallel bpf_timer_*() ops. - Fixed deadlock between timer callback and LRU eviction or bpf_map_delete/update. - Disallowed mmap and global timers. - Allow spin_lock and bpf_timer in an element. - Fixed memory leaks due to map destruction and LRU eviction. - A ton more tests. ==================== Signed-off-by: Daniel Borkmann commit 61f71e746c72f07097b759809c36e814387bc24f Author: Alexei Starovoitov Date: Wed Jul 14 17:54:17 2021 -0700 selftests/bpf: Add a test with bpf_timer in inner map. Check that map-in-map supports bpf timers. Check that indirect "recursion" of timer callbacks works: timer_cb1() { bpf_timer_set_callback(timer_cb2); } timer_cb2() { bpf_timer_set_callback(timer_cb1); } Check that bpf_map_release htab_free_prealloced_timers bpf_timer_cancel_and_free hrtimer_cancel works while timer cb is running. "while true; do ./test_progs -t timer_mim; done" is a great stress test. It caught missing timer cancel in htab->extra_elems. timer_mim_reject.c is a negative test that checks that timer<->map mismatch is prevented. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-12-alexei.starovoitov@gmail.com commit 3540f7c6b96a62b581da5aa3d4c5af9408927bef Author: Alexei Starovoitov Date: Wed Jul 14 17:54:16 2021 -0700 selftests/bpf: Add bpf_timer test. Add bpf_timer test that creates timers in preallocated and non-preallocated hash, in array and in lru maps. Let array timer expire once and then re-arm it for 35 seconds. Arm lru timer into the same callback. Then arm and re-arm hash timers 10 times each. At the last invocation of prealloc hash timer cancel the array timer. Force timer free via LRU eviction and direct bpf_map_delete_elem. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-11-alexei.starovoitov@gmail.com commit 7ddc80a476c2d599246028af5808d15f9e24c109 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:15 2021 -0700 bpf: Teach stack depth check about async callbacks. Teach max stack depth checking algorithm about async callbacks that don't increase bpf program stack size. Also add sanity check that bpf_tail_call didn't sneak into async cb. It's impossible, since PTR_TO_CTX is not available in async cb, hence the program cannot contain bpf_tail_call(ctx,...); Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-10-alexei.starovoitov@gmail.com commit bfc6bb74e4f16ab264fa73398a7a79d7d2afac2e Author: Alexei Starovoitov Date: Wed Jul 14 17:54:14 2021 -0700 bpf: Implement verifier support for validation of async callbacks. bpf_for_each_map_elem() and bpf_timer_set_callback() helpers are relying on PTR_TO_FUNC infra in the verifier to validate addresses to subprograms and pass them into the helpers as function callbacks. In case of bpf_for_each_map_elem() the callback is invoked synchronously and the verifier treats it as a normal subprogram call by adding another bpf_func_state and new frame in __check_func_call(). bpf_timer_set_callback() doesn't invoke the callback directly. The subprogram will be called asynchronously from bpf_timer_cb(). Teach the verifier to validate such async callbacks as special kind of jump by pushing verifier state into stack and let pop_stack() process it. Special care needs to be taken during state pruning. The call insn doing bpf_timer_set_callback has to be a prune_point. Otherwise short timer callbacks might not have prune points in front of bpf_timer_set_callback() which means is_state_visited() will be called after this call insn is processed in __check_func_call(). Which means that another async_cb state will be pushed to be walked later and the verifier will eventually hit BPF_COMPLEXITY_LIMIT_JMP_SEQ limit. Since push_async_cb() looks like another push_stack() branch the infinite loop detection will trigger false positive. To recognize this case mark such states as in_async_callback_fn. To distinguish infinite loop in async callback vs the same callback called with different arguments for different map and timer add async_entry_cnt to bpf_func_state. Enforce return zero from async callbacks. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-9-alexei.starovoitov@gmail.com commit 86fc6ee6e246438d394e41bb7cc210b0fe724872 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:13 2021 -0700 bpf: Relax verifier recursion check. In the following bpf subprogram: static int timer_cb(void *map, void *key, void *value) { bpf_timer_set_callback(.., timer_cb); } the 'timer_cb' is a pointer to a function. ld_imm64 insn is used to carry this pointer. bpf_pseudo_func() returns true for such ld_imm64 insn. Unlike bpf_for_each_map_elem() the bpf_timer_set_callback() is asynchronous. Relax control flow check to allow such "recursion" that is seen as an infinite loop by check_cfg(). The distinction between bpf_for_each_map_elem() the bpf_timer_set_callback() is done in the follow up patch. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-8-alexei.starovoitov@gmail.com commit 40ec00abf1cc92268e3e3320b36bbb33b2224808 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:12 2021 -0700 bpf: Remember BTF of inner maps. BTF is required for 'struct bpf_timer' to be recognized inside map value. The bpf timers are supported inside inner maps. Remember 'struct btf *' in inner_map_meta to make it available to the verifier in the sequence: struct bpf_map *inner_map = bpf_map_lookup_elem(&outer_map, ...); if (inner_map) timer = bpf_map_lookup_elem(&inner_map, ...); Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-7-alexei.starovoitov@gmail.com commit 3e8ce29850f1839d0603f925b30be9d8a4329917 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:11 2021 -0700 bpf: Prevent pointer mismatch in bpf_timer_init. bpf_timer_init() arguments are: 1. pointer to a timer (which is embedded in map element). 2. pointer to a map. Make sure that pointer to a timer actually belongs to that map. Use map_uid (which is unique id of inner map) to reject: inner_map1 = bpf_map_lookup_elem(outer_map, key1) inner_map2 = bpf_map_lookup_elem(outer_map, key2) if (inner_map1 && inner_map2) { timer = bpf_map_lookup_elem(inner_map1); if (timer) // mismatch would have been allowed bpf_timer_init(timer, inner_map2); } Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-6-alexei.starovoitov@gmail.com commit 68134668c17f31f51930478f75495b552a411550 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:10 2021 -0700 bpf: Add map side support for bpf timers. Restrict bpf timers to array, hash (both preallocated and kmalloced), and lru map types. The per-cpu maps with timers don't make sense, since 'struct bpf_timer' is a part of map value. bpf timers in per-cpu maps would mean that the number of timers depends on number of possible cpus and timers would not be accessible from all cpus. lpm map support can be added in the future. The timers in inner maps are supported. The bpf_map_update/delete_elem() helpers and sys_bpf commands cancel and free bpf_timer in a given map element. Similar to 'struct bpf_spin_lock' BTF is required and it is used to validate that map element indeed contains 'struct bpf_timer'. Make check_and_init_map_value() init both bpf_spin_lock and bpf_timer when map element data is reused in preallocated htab and lru maps. Teach copy_map_value() to support both bpf_spin_lock and bpf_timer in a single map element. There could be one of each, but not more than one. Due to 'one bpf_timer in one element' restriction do not support timers in global data, since global data is a map of single element, but from bpf program side it's seen as many global variables and restriction of single global timer would be odd. The sys_bpf map_freeze and sys_mmap syscalls are not allowed on maps with timers, since user space could have corrupted mmap element and crashed the kernel. The maps with timers cannot be readonly. Due to these restrictions search for bpf_timer in datasec BTF in case it was placed in the global data to report clear error. The previous patch allowed 'struct bpf_timer' as a first field in a map element only. Relax this restriction. Refactor lru map to s/bpf_lru_push_free/htab_lru_push_free/ to cancel and free the timer when lru map deletes an element as a part of it eviction algorithm. Make sure that bpf program cannot access 'struct bpf_timer' via direct load/store. The timer operation are done through helpers only. This is similar to 'struct bpf_spin_lock'. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-5-alexei.starovoitov@gmail.com commit b00628b1c7d595ae5b544e059c27b1f5828314b4 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:09 2021 -0700 bpf: Introduce bpf timers. Introduce 'struct bpf_timer { __u64 :64; __u64 :64; };' that can be embedded in hash/array/lru maps as a regular field and helpers to operate on it: // Initialize the timer. // First 4 bits of 'flags' specify clockid. // Only CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_BOOTTIME are allowed. long bpf_timer_init(struct bpf_timer *timer, struct bpf_map *map, int flags); // Configure the timer to call 'callback_fn' static function. long bpf_timer_set_callback(struct bpf_timer *timer, void *callback_fn); // Arm the timer to expire 'nsec' nanoseconds from the current time. long bpf_timer_start(struct bpf_timer *timer, u64 nsec, u64 flags); // Cancel the timer and wait for callback_fn to finish if it was running. long bpf_timer_cancel(struct bpf_timer *timer); Here is how BPF program might look like: struct map_elem { int counter; struct bpf_timer timer; }; struct { __uint(type, BPF_MAP_TYPE_HASH); __uint(max_entries, 1000); __type(key, int); __type(value, struct map_elem); } hmap SEC(".maps"); static int timer_cb(void *map, int *key, struct map_elem *val); /* val points to particular map element that contains bpf_timer. */ SEC("fentry/bpf_fentry_test1") int BPF_PROG(test1, int a) { struct map_elem *val; int key = 0; val = bpf_map_lookup_elem(&hmap, &key); if (val) { bpf_timer_init(&val->timer, &hmap, CLOCK_REALTIME); bpf_timer_set_callback(&val->timer, timer_cb); bpf_timer_start(&val->timer, 1000 /* call timer_cb2 in 1 usec */, 0); } } This patch adds helper implementations that rely on hrtimers to call bpf functions as timers expire. The following patches add necessary safety checks. Only programs with CAP_BPF are allowed to use bpf_timer. The amount of timers used by the program is constrained by the memcg recorded at map creation time. The bpf_timer_init() helper needs explicit 'map' argument because inner maps are dynamic and not known at load time. While the bpf_timer_set_callback() is receiving hidden 'aux->prog' argument supplied by the verifier. The prog pointer is needed to do refcnting of bpf program to make sure that program doesn't get freed while the timer is armed. This approach relies on "user refcnt" scheme used in prog_array that stores bpf programs for bpf_tail_call. The bpf_timer_set_callback() will increment the prog refcnt which is paired with bpf_timer_cancel() that will drop the prog refcnt. The ops->map_release_uref is responsible for cancelling the timers and dropping prog refcnt when user space reference to a map reaches zero. This uref approach is done to make sure that Ctrl-C of user space process will not leave timers running forever unless the user space explicitly pinned a map that contained timers in bpffs. bpf_timer_init() and bpf_timer_set_callback() will return -EPERM if map doesn't have user references (is not held by open file descriptor from user space and not pinned in bpffs). The bpf_map_delete_elem() and bpf_map_update_elem() operations cancel and free the timer if given map element had it allocated. "bpftool map update" command can be used to cancel timers. The 'struct bpf_timer' is explicitly __attribute__((aligned(8))) because '__u64 :64' has 1 byte alignment of 8 byte padding. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-4-alexei.starovoitov@gmail.com commit c1b3fed319d32a721d4b9c17afaeb430444ff773 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:08 2021 -0700 bpf: Factor out bpf_spin_lock into helpers. Move ____bpf_spin_lock/unlock into helpers to make it more clear that quadruple underscore bpf_spin_lock/unlock are irqsave/restore variants. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-3-alexei.starovoitov@gmail.com commit d809e134be7a1fdd9f5b99ab3291c6da5c0b8240 Author: Alexei Starovoitov Date: Wed Jul 14 17:54:07 2021 -0700 bpf: Prepare bpf_prog_put() to be called from irq context. Currently bpf_prog_put() is called from the task context only. With addition of bpf timers the timer related helpers will start calling bpf_prog_put() from irq-saved region and in rare cases might drop the refcnt to zero. To address this case, first, convert bpf_prog_free_id() to be irq-save (this is similar to bpf_map_free_id), and, second, defer non irq appropriate calls into work queue. For example: bpf_audit_prog() is calling kmalloc and wake_up_interruptible, bpf_prog_kallsyms_del_all()->bpf_ksym_del()->spin_unlock_bh(). They are not safe with irqs disabled. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210715005417.78572-2-alexei.starovoitov@gmail.com commit de587d564f957b685e47da1848d428b86173766d Author: Tobias Klauser Date: Tue Jul 13 12:27:19 2021 +0200 selftests/bpf: Remove unused variable in tc_tunnel prog The variable buf is unused since commit 005edd16562b ("selftests/bpf: convert bpf tunnel test to BPF_ADJ_ROOM_MAC"). Remove it to fix the following warning: test_tc_tunnel.c:531:7: warning: unused variable 'buf' [-Wunused-variable] Fixes: 005edd16562b ("selftests/bpf: convert bpf tunnel test to BPF_ADJ_ROOM_MAC") Signed-off-by: Tobias Klauser Signed-off-by: Daniel Borkmann Acked-by: Willem de Bruijn Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210713102719.8890-1-tklauser@distanz.ch commit 18eeef46d3593e3bc3d6a8f7a6f94ace356578ff Author: Douglas Anderson Date: Fri Jun 25 08:18:36 2021 -0700 HID: i2c-hid: goodix: Tie the reset line to true state of the regulator The regulator for the touchscreen could be: * A dedicated regulator just for the touchscreen. * A regulator shared with something else in the system. * An always-on regulator. How we want the "reset" line to behave depends a bit on which of those three cases we're in. Currently the code is written with the assumption that it has a dedicated regulator, but that's not really guaranteed to be the case. The problem we run into is that if we leave the touchscreen powered on (because someone else is requesting the regulator or it's an always-on regulator) and we assert reset then we apparently burn an extra 67 mW of power. That's not great. Let's instead tie the control of the reset line to the true state of the regulator as reported by regulator notifiers. If we have an always-on regulator our notifier will never be called. If we have a shared regulator then our notifier will be called when the touchscreen is truly turned on or truly turned off. Using notifiers like this nicely handles all the cases without resorting to hacks like pretending that there is no "reset" GPIO if we have an always-on regulator. NOTE: if the regulator is on a shared line it's still possible that things could be a little off. Specifically, this case is not handled even after this patch: 1. Suspend goodix (send "sleep", goodix stops requesting regulator on) 2. Other regulator user turns off (regulator fully turns off). 3. Goodix driver gets notified and asserts reset. 4. Other regulator user turns on. 5. Goodix driver gets notified and deasserts reset. 6. Nobody resumes goodix. With that set of steps we'll have reset deasserted but we will have lost the results of the I2C_HID_PWR_SLEEP from the suspend path. That means we might be in higher power than we could be even if the goodix driver thinks things are suspended. Presumably, however, we're still in better shape than if we were asserting "reset" the whole time. If somehow the above situation is actually affecting someone and we want to do better we can deal with it when we have a real use case. Signed-off-by: Douglas Anderson Signed-off-by: Jiri Kosina commit 9d60648c607a2bfeef5e563e49de5d2e1b7a639a Author: José Expósito Date: Wed Jul 7 17:58:22 2021 +0200 HID: magicmouse: high-resolution scroll threshold In order to avoid triggering involuntary high-resolution scroll events due to tiny touch movement deltas, add a movement threshold. The value chosen for the threshold, about 1.5 ~ 2 mm, is similar to the threshold used on touchpads by libinput (see libinput evdev-mt-touchpad-gestures.c) to try to keep the scroll experience consistent. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit d4b9f10a0eb64c623217eb5938d913974afbe9d2 Author: José Expósito Date: Wed Jul 7 17:58:21 2021 +0200 HID: magicmouse: enable high-resolution scroll The Magic Mouse, generations 1 and 2, doesn't have a physical scroll wheel, instead, the REL_WHEEL and REL_HWHEEL events are emulated when sliding a finger on the surface of the mouse. However, the smooth movement of the finger is transformed into a step based scroll on the screen, leading to a suboptimal user experience. Emulate high-resolution scroll by sending REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES events so the scroll on the screen is closer to the finger movement. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit f4abaa9eebde334045ed6ac4e564d050f1df3013 Author: Dmitry Torokhov Date: Tue Jun 29 11:25:50 2021 -0700 HID: input: do not report stylus battery state as "full" The power supply states of discharging, charging, full, etc, represent state of charging, not the capacity level of the battery (for which we have a separate property). Current HID usage tables to not allow for expressing charging state of the batteries found in generic styli, so we should simply assume that the battery is discharging even if current capacity is at 100% when battery strength reporting is done via HID interface. In fact, we were doing just that before commit 581c4484769e. This change helps UIs to not mis-represent fully charged batteries in styli as being charging/topping-off. Fixes: 581c4484769e ("HID: input: map digitizer battery usage") Reported-by: Kenneth Albanowski Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina commit 178a5d90dc0419b2bdaa5be213ca12ea8929ff35 Author: Alim Akhtar Date: Tue Jun 22 18:35:51 2021 +0530 arm64: dts: exynos: Add cpu cache information to Exynos5433 Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 48/32 KB I/D cache for each A57 cores with 2MB L2 cache. And 32/32 KB I/D cache for each A53 cores with 256KB L2 cache. Signed-off-by: Alim Akhtar Link: https://lore.kernel.org/r/20210622130551.67446-2-alim.akhtar@samsung.com Signed-off-by: Krzysztof Kozlowski commit c4e40c0144cb8d0cf0860f19e705300a87295f96 Author: Alim Akhtar Date: Tue Jun 22 18:35:50 2021 +0530 arm64: dts: exynos: Add cpu cache information to Exynos7 Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 48/32 KB I/D cache for each cores and 2MB of L2 cache. Signed-off-by: Alim Akhtar Link: https://lore.kernel.org/r/20210622130551.67446-1-alim.akhtar@samsung.com Signed-off-by: Krzysztof Kozlowski commit 8c1b4316c3faa38cb66bde200a8f2942fa6728b6 Author: Gal Pressman Date: Mon Jul 12 13:59:23 2021 +0300 RDMA/efa: Split hardware stats to device and port stats The hardware stats API distinguishes between device and port statistics, split the EFA stats accordingly instead of always dumping everything. Link: https://lore.kernel.org/r/20210712105923.17389-1-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 916071185b178b052e0ca8bcdf269161b6848da9 Author: Weihang Li Date: Thu Jul 8 18:59:18 2021 +0800 MAINTAINERS: Update maintainers of HiSilicon RoCE Lijun has moved to work in other technical areas, and Wenpeng will maintain this modules instead of him. Link: https://lore.kernel.org/r/1625741958-51363-1-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 24519fa7f91507d3299018bf4b066dd7b1ccff60 Author: Rafał Miłecki Date: Tue Jul 13 11:31:55 2021 +0200 dt-bindings: i2c: brcm,iproc-i2c: convert to the json-schema This helps validating DTS files. Introduced changes: 1. Added arm-gic.h include Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20210713093155.1752-1-zajec5@gmail.com Signed-off-by: Rob Herring commit cdbdb7724740f62d11519679e11cf673cd9d6c8f Author: Xiao Yang Date: Fri Jul 2 20:30:24 2021 +0800 RDMA/rxe: Remove the repeated 'mr->umem = umem' Drop duplicated code Link: https://lore.kernel.org/r/20210702123024.37025-1-ice_yangxiao@163.com Signed-off-by: Xiao Yang Reviewed-by: Håkon Bugge Reviewed-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 9d649d594f3965cbd162121259b2f84928b907a1 Author: Ira Weiny Date: Thu Jun 24 10:48:14 2021 -0700 RDMA/siw: Convert siw_tx_hdt() to kmap_local_page() kmap() is being deprecated and will break uses of device dax after PKS protection is introduced.[1] The use of kmap() in siw_tx_hdt() is all thread local therefore kmap_local_page() is a sufficient replacement and will work with pgmap protected pages when those are implemented. siw_tx_hdt() tracks pages used in a page_array. It uses that array to unmap pages which were mapped on function exit. Not all entries in the array are mapped and this is tracked in kmap_mask. kunmap_local() takes a mapped address rather than a page. Alter siw_unmap_pages() to take the iov array to reuse the iov_base address of each mapping. Use PAGE_MASK to get the proper address for kunmap_local(). kmap_local_page() mappings are tracked in a stack and must be unmapped in the opposite order they were mapped in. Because segments are mapped into the page array in increasing index order, modify siw_unmap_pages() to unmap pages in decreasing order. Use kmap_local_page() instead of kmap() to map pages in the page_array. [1] https://lore.kernel.org/lkml/20201009195033.3208459-59-ira.weiny@intel.com/ Link: https://lore.kernel.org/r/20210624174814.2822896-1-ira.weiny@intel.com Signed-off-by: Ira Weiny Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 1ec50dd12a434794249a5d3c6e0a392d89c15ee6 Author: Ira Weiny Date: Mon Jun 21 23:14:21 2021 -0700 RDMA/siw: Remove kmap() kmap() is being deprecated and will break uses of device dax after PKS protection is introduced.[1] These uses of kmap() in the SIW driver are thread local. Therefore kmap_local_page() is sufficient to use and will work with pgmap protected pages when those are implemnted. There is one more use of kmap() in this driver which is split into its own patch because kmap_local_page() has strict ordering rules and the use of the kmap_mask over multiple segments must be handled carefully. Therefore, that conversion is handled in a stand alone patch. Use kmap_local_page() instead of kmap() in the 'easy' cases. [1] https://lore.kernel.org/lkml/20201009195033.3208459-59-ira.weiny@intel.com/ Link: https://lore.kernel.org/r/20210622061422.2633501-4-ira.weiny@intel.com Signed-off-by: Ira Weiny Signed-off-by: Jason Gunthorpe commit 87117baf4f923a44bab189c37a6c8783f0c03525 Author: Rocco Yue Date: Thu Jul 15 22:26:43 2021 +0800 ipv6: remove unnecessary local variable The local variable "struct net *net" in the two functions of inet6_rtm_getaddr() and inet6_dump_addr() are actually useless, so remove them. Signed-off-by: Rocco Yue Signed-off-by: David S. Miller commit cfcdbd9dd7632a9bb1e308a029f5fa65008333af Author: Jack Wang Date: Mon Jul 12 08:07:50 2021 +0200 RDMA/rtrs: Move sq_wr_avail to rtrs_con In order to account HB for sq_wr_avail properly, move sq_wr_avail from rtrs_srv_con to rtrs_con. Although rtrs-clt do not care sq_wr_avail, but still init it to max_send_wr. Fixes: b38041d50add ("RDMA/rtrs: Do not signal for heatbeat") Link: https://lore.kernel.org/r/20210712060750.16494-7-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 99fac8bf6d5ecf1029147b71ef2a49c4ff912047 Author: Jack Wang Date: Mon Jul 12 08:07:49 2021 +0200 RDMA/rtrs: Remove unused flags parameter flags is not used, so remove it from rtrs_post_rdma_write_imm_empty. Link: https://lore.kernel.org/r/20210712060750.16494-6-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 6ea9b773390d70c6c6c363f0428d1a4cbec3757a Author: Jack Wang Date: Mon Jul 12 08:07:48 2021 +0200 RDMA/rtrs: Make rtrs_post_rdma_write_imm_empty static It's only used in rtrs.c, so no need to export. Link: https://lore.kernel.org/r/20210712060750.16494-5-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit e2d98504c697f9c8e45b815062f8893b10808d8e Author: Jack Wang Date: Mon Jul 12 08:07:47 2021 +0200 RDMA/rtrs: Enable the same selective signal for heartbeat and IO On idle session, because we do not do signal for heartbeat, it will overflow the send queue after sometime. To avoid that, we need to enable the signal for heartbeat. To do that, add a new member signal_interval in rtrs_path, which will set min of queue_depth and SERVICE_CON_QUEUE_DEPTH, and track it for both heartbeat and IO, so the sq queue full accounting is correct. Fixes: b38041d50add ("RDMA/rtrs: Do not signal for heatbeat") Link: https://lore.kernel.org/r/20210712060750.16494-4-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit a10431eff136ef15e1f9955efe369744b1294db1 Author: Jack Wang Date: Mon Jul 12 08:07:46 2021 +0200 RDMA/rtrs: move wr_cnt from rtrs_srv_con to rtrs_con We need to track also the wr used for heatbeat. This is a preparation for that, will be used in later patch. The io_cnt in rtrs_clt is removed, use wr_cnt instead. Link: https://lore.kernel.org/r/20210712060750.16494-3-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 350ec9bc618c042940ef7743e53f308f214de23a Author: Jack Wang Date: Mon Jul 12 08:07:45 2021 +0200 RDMA/rtrs: Add error messages for failed operations. It could help debugging in case of error happens. Link: https://lore.kernel.org/r/20210712060750.16494-2-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Reviewed-by: Gioh Kim Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit 5c2c85315948c42c6c0258cf9bad596acaa79043 Author: Richard Laing Date: Thu Jul 15 09:18:05 2021 +1200 bus: mhi: pci-generic: configurable network interface MRU The MRU value used by the MHI MBIM network interface affects the throughput performance of the interface. Different modem models use different default MRU sizes based on their bandwidth capabilities. Large values generally result in higher throughput for larger packet sizes. In addition if the MRU used by the MHI device is larger than that specified in the MHI net device the data is fragmented and needs to be re-assembled which generates a (single) warning message about the fragmented packets. Setting the MRU on both ends avoids the extra processing to re-assemble the packets. This patch allows the documented MRU for a modem to be automatically set as the MHI net device MRU avoiding fragmentation and improving throughput performance. Signed-off-by: Richard Laing Signed-off-by: David S. Miller commit 541ee8f640327f951e7039278057827322231ab0 Author: Vincent Pelletier Date: Tue Jul 13 07:20:31 2021 +0000 regulator: da9063: Add support for full-current mode. In addition to the ability of merging some power outputs, this chip has an overdrive mode. BCORE1, BCORE2 and BPRO have this ability, in which case the legal current draw is increased from 2 amps to 2.5 amps (at the expense of a quiescent current increase), and the configurable current limits are doubled. If a current higher than maximum half-current mode is requested, enable overdrive, and scale the current limit down. Symmetrically, scale the current limit up when querying a overdrive-enabled regulator. Signed-off-by: Vincent Pelletier Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/824518e6391b783a12eba9ff0527f06607a34bfb.1626160826.git.plr.vincent@gmail.com Signed-off-by: Mark Brown commit 508f8ccd993d1ff5c9a3092f179f33bd7a825bac Author: Colin Ian King Date: Thu Jul 15 15:15:31 2021 +0100 regulator: rt6245: make a const array func_base static, makes object smaller Don't populate the const array func_base on the stack but instead it static. Makes the object code smaller by 55 bytes: Before: text data bss dec hex filename 6422 3216 64 9702 25e6 drivers/regulator/rt6245-regulator.o After: text data bss dec hex filename 6303 3280 64 9647 25af drivers/regulator/rt6245-regulator.o Reduction of 55 bytes (gcc version 10.3.0) Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210715141531.27672-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 622d9ac3d969d0f62bbe68f4844bb5b8adea5a40 Author: Colin Ian King Date: Fri Jul 9 16:24:24 2021 +0100 ASoC: codecs: lpass-rx-macro: clean up for-loop indentation in switch statement The for-loop is not indented enough and needs one more level of indentation. Add in the indentation across the block of code. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210709152424.460446-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 17a1837d07be38d957af453e08788edbe1f9343a Author: Douglas Anderson Date: Wed Jul 14 10:17:46 2021 -0700 drm/dp: For drm_panel_dp_aux_backlight(), init backlight as disabled Even after the DP AUX backlight on my board worked OK after applying the patch ("drm/panel-simple: Power the panel when probing DP AUX backlight") [1], I still noticed some strange timeouts being reported by ti_sn_aux_transfer(). Digging, I realized the problem was this: * Even though `enabled` in `struct dp_aux_backlight` was false, the base backlight structure (`base` in that structure) thought that the backlight was powered on. * If userspace wrote to sysfs in this state then we'd try to enable the backlight. * Unfortunatley, enabling the backlight didn't work because the panel itself wasn't powered. We can only use the backlight if the panel is on and the panel is not officially on when we probe (it's temporarily just on enough for us to talk to it). The important thing we want here is to get `BL_CORE_FBBLANK` set since userspace can't mess with that. This will keep us disabled until drm_panel enables us, which means that the panel is enabled first. Ideally we'd just set this in our `props` before calling devm_backlight_device_register() but the comments in the header file are pretty explicit that we're not supposed to much with the `state` ourselves. Because of this, there may be a small window where the backlight device is registered and someone could try to tweak with the backlight. This isn't likely to happen and even if it did, I don't believe this causes any huge problem. [1] https://lore.kernel.org/lkml/20210714093334.1.Idb41f87e5abae4aee0705db7458b0097fc50e7ab@changeid/ Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210714101744.1.Ifc22696b27930749915e383f0108b7bcdc015a6e@changeid commit 5ead9b5b157518520dd68b437f6d3640cefe608e Author: Douglas Anderson Date: Wed Jul 14 09:33:50 2021 -0700 drm/panel-simple: Power the panel when probing DP AUX backlight When I tried booting up a device that needed the DP AUX backlight, I found an error in the logs: panel-simple-dp-aux: probe of aux-ti_sn65dsi86.aux.0 failed with error -110 The aux transfers were failing because the panel wasn't powered. Just like when reading the EDID we need to power the panel when trying to talk to it. Add the needed pm_runtime calls. After I do this I can successfully probe the panel and adjust the backlight on my board. Fixes: bfd451403d70 ("drm/panel-simple: Support DP AUX backlight") Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210714093334.1.Idb41f87e5abae4aee0705db7458b0097fc50e7ab@changeid commit eb7173988caf6fc68ef00065b9defb5ac3467f21 Author: 권오훈 Date: Thu Jul 1 23:04:57 2021 +0900 of: fdt: remove unnecessary codes While unflattening the device tree, we try to populate dt nodes and properties into tree-shaped data structure. In populate_properties function, pprev is initially set to &np->properties, and then updated to &pp->next. In both scenarios *pprev is NULL, since the memory area that we are allocating from is initially zeroed. I tested the code as below, and it showed that BUG was never called. - if (!dryrun) + if (!dryrun) { + if (*pprev) + BUG(); *pprev = NULL; + } Let's remove unnecessary code. Signed-off-by: Ohhoon Kwon Link: https://lore.kernel.org/r/20210701140457epcms1p2cc43a7c62150f012619feab913f017af@epcms1p2 Signed-off-by: Rob Herring commit ace1c4b5c412d21b41329c723acce248a503bad4 Author: 권오훈 Date: Thu Jul 1 23:03:28 2021 +0900 of: base: remove unnecessary for loop In __of_get_next_child function, loop iteration for getting next node is unnecessary. for loop is already checking if next is NULL or not, and of_node_get(next) always returns next itself. Therefore checking return value in the if clause always evaluates to true, and thus it always breaks out from for loop in the first iteration. Remove the unnecessary for loop for readability. I tested the code as below, and it showed that BUG was never called. - for (; next; next = next->sibling) + for (; next; next = next->sibling) { if (of_node_get(next)) break; + BUG(); + } Signed-off-by: Ohhoon Kwon Link: https://lore.kernel.org/r/20210701140328epcms1p85149318b6c18fa18b3c7c8e966c14db0@epcms1p8 Signed-off-by: Rob Herring commit 2720b991337d530b87095f62631e462efa1685cb Author: Corentin Labbe Date: Mon Jun 28 19:35:08 2021 +0000 dt-bindings: PCI: ftpci100: convert faraday,ftpci100 to YAML Converts pci/faraday,ftpci100.txt to yaml. Some change are also made: - example has wrong interrupts place Reviewed-by: Linus Walleij Signed-off-by: Corentin Labbe Link: https://lore.kernel.org/r/20210628193508.2826903-1-clabbe@baylibre.com Signed-off-by: Rob Herring commit 977b3167c2bda24c3cd21e94ca7a4c25a386e812 Author: Suman Anna Date: Wed Jun 23 12:06:30 2021 -0500 dt-bindings: irqchip: Update pruss-intc binding for K3 AM64x SoCs The K3 AM64x SoCs also have a ICSSG IP that is similar to existing K3 AM65x and J721E SoCs. The ICSSG interrupt controller is identical to that of the INTC on J721E SoCs, and supports 20 host interrupts and 160 input events from various SoC interrupt sources. All the 8 output host interrupts are routed to multiple entities though. Update the PRUSS interrupt controller binding with this information, though the same K3 compatible shall be used for the ICSSG INTC on AM64x SoCs. Signed-off-by: Suman Anna Link: https://lore.kernel.org/r/20210623170630.1430-1-s-anna@ti.com Signed-off-by: Rob Herring commit 6dc77fa5ac2cf26f846a51492dbe42526e26d0f2 Author: Michael Kelley Date: Wed Jul 14 11:34:47 2021 -0700 Drivers: hv: Move Hyper-V misc functionality to arch-neutral code The check for whether hibernation is possible, and the enabling of Hyper-V panic notification during kexec, are both architecture neutral. Move the code from under arch/x86 and into drivers/hv/hv_common.c where it can also be used for ARM64. No functional change. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1626287687-2045-4-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 9d7cf2c9675838c12cd5cf5a4ebe2ba41bd78a44 Author: Michael Kelley Date: Wed Jul 14 11:34:46 2021 -0700 Drivers: hv: Add arch independent default functions for some Hyper-V handlers Architecture independent Hyper-V code calls various arch-specific handlers when needed. To aid in supporting multiple architectures, provide weak defaults that can be overridden by arch-specific implementations where appropriate. But when arch-specific overrides aren't needed or haven't been implemented yet for a particular architecture, these stubs reduce the amount of clutter under arch/. No functional change. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1626287687-2045-3-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit afca4d95dd7d7936d46a0ff02169cc40f534a6a3 Author: Michael Kelley Date: Wed Jul 14 11:34:45 2021 -0700 Drivers: hv: Make portions of Hyper-V init code be arch neutral The code to allocate and initialize the hv_vp_index array is architecture neutral. Similarly, the code to allocate and populate the hypercall input and output arg pages is architecture neutral. Move both sets of code out from arch/x86 and into utility functions in drivers/hv/hv_common.c that can be shared by Hyper-V initialization on ARM64. No functional changes. However, the allocation of the hypercall input and output arg pages is done differently so that the size is always the Hyper-V page size, even if not the same as the guest page size (such as with ARM64's 64K page size). Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1626287687-2045-2-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 4b3abe1fde4799ed92c378e545271ca7a7828a41 Author: Yanteng Si Date: Fri Jul 9 11:02:43 2021 +0800 docs/zh_CN: add core api protection keys translation Translate Documentation/core-api/protection-keys.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/abdcd4f157062a529cfc50754689d2df26070592.1625797729.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 620127548a691b00d18442338922434ff7e37467 Author: Yanteng Si Date: Fri Jul 9 11:02:42 2021 +0800 docs/zh_CN: add core api memory_hotplug translation Translate Documentation/core-api/memory_hotplug.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/55a74c9fe5627edff36fa01940eae943f0861f8e.1625797729.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit d4229805df852d5b6508ea7e186c974446147634 Author: Yanteng Si Date: Fri Jul 9 11:00:35 2021 +0800 docs/zh_CN: add core api cpu_hotplug translation Translate Documentation/core-api/cpu_hotplug.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/5c2273563e64ccbbaf1e7ff043d2ab467879c421.1625798719.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit f8c6a07c25ce7ff99f6d7e19352e495af6af1d69 Author: Yanteng Si Date: Fri Jul 9 11:00:34 2021 +0800 docs/core-api: Modify document layout Modify the layout of the document and remove unnecessary symbols. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/f151bbc0d1ff6cf24611a698c76b90181f005f8d.1625798719.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 341968c617ca7726b444fdb23e5b2efb0881c5db Author: Hu Jialun Date: Sun Jul 4 00:48:34 2021 +0800 docs/zh_CN: Remove the Microsoft rhetoric Update Chinese translation on par with original English coding-style.rst Related commit b7592e5b82db19b72a34b471f3296ad3f651c8b9 Signed-off-by: Hu Jialun Reviewed-by: Hu Haowen Link: https://lore.kernel.org/r/20210703164834.460447-1-hujialun@comp.nus.edu.sg Signed-off-by: Jonathan Corbet commit f1285c68e12558b147979b96f4efcbc2eb0c48cd Author: Cengiz Can Date: Tue Jun 29 17:15:09 2021 +0300 Documentation: sysrq: convert to third person Two parts of the sysrq documentation have sentences written from a first person's point of view. Documentation is generally written from a third person's view in a formal way. Convert those senteces to be less personal and generic. Signed-off-by: Cengiz Can Link: https://lore.kernel.org/r/20210629141508.52229-1-cengiz@kernel.wtf Signed-off-by: Jonathan Corbet commit 153c43a84c7f092b21d9624ffd819552cd5c915b Author: Pali Rohár Date: Fri Jun 25 23:54:37 2021 +0200 Documentation: arm: marvell: Add few missing models and documentation files Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20210625215437.2156-1-pali@kernel.org Signed-off-by: Jonathan Corbet commit c767ef4519b3716d74a78e0bafad250b0c6e1783 Author: Yanteng Si Date: Fri Jul 9 11:01:43 2021 +0800 docs/zh_CN: add core api genericirq translation translate Documentation/core-api/genericirq.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/20210709030143.548940-1-siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit e6c65d354fae36e5a3ccd9dca6cec05ea2e4473a Author: Hu Haowen Date: Sun Jun 20 13:28:43 2021 +0800 docs/zh_CN: create new translations for zh_CN/dev-tools/testing-overview Create new translations for dev-tools/testing-overview.rst and link it to dev-tools/index.rst with TODOList modifications. Signed-off-by: Hu Haowen Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Signed-off-by: Wu XiangCheng Link: https://lore.kernel.org/r/20210620052841.GA22083@bobwxc.top Signed-off-by: Jonathan Corbet commit 407b3ea075c2733d6eeb85de9aa33eecd1ff0fb9 Merge: 4faee8b65ec32 d5c10e0fc8645 Author: Vinod Koul Date: Thu Jul 15 17:53:57 2021 +0530 Merge branch 'fixes' into next Signed-off-by: Vinod Koul commit 442a9d105e61591b36b653ba1ee0c02b0482b639 Author: Kunihiko Hayashi Date: Wed Jun 23 10:52:17 2021 +0900 regulator: Convert UniPhier regulator to json-schema Convert the UniPhier regulator binding to DT schema format. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1624413137-17453-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 4faee8b65ec32346f8096e64c5fa1d5a73121742 Author: Zou Wei Date: Tue May 4 10:22:57 2021 +0800 dmaengine: sprd: Add missing MODULE_DEVICE_TABLE This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/1620094977-70146-1-git-send-email-zou_wei@huawei.com Signed-off-by: Vinod Koul commit f861d1d77a17e66b90be11c2575f6631879cebb1 Author: Liang Chen Date: Thu Jun 24 19:47:18 2021 +0800 dt-bindings: mfd: syscon: Add rk3568 QoS register compatible Document rk3568 compatible for QoS registers. Signed-off-by: Liang Chen Acked-by: Rob Herring Acked-by: Heiko Stuebner Signed-off-by: Lee Jones commit 05f3485cad759b2d63c5625caef334de4c2cb57d Author: Alex Bee Date: Thu May 27 17:44:44 2021 +0200 dt-bindings: mfd: syscon: add Rockchip RK3036/RK3228 qos compatibles Document Rockchip RK3036/RK3228 qos compatibles Signed-off-by: Alex Bee Reviewed-by: Heiko Stuebner Acked-by: Rob Herring Signed-off-by: Lee Jones commit a6d05cc7eae6f81896ded5b1e20e5b205af29b96 Author: Russell King Date: Sat Jun 19 16:55:31 2021 +0100 ARM: dts: add SolidRun SolidSense support Add support for the SolidRun SolidSense platform, which is a Hummingboard2 with a daughter card with two Nordic software defined radios and a couple of bi-color LEDs. Signed-off-by: Russell King Signed-off-by: Shawn Guo commit 6f9223a56fabc840836b49de27dc7b27642c6a32 Author: Steven Price Date: Wed Jul 14 15:33:00 2021 +0100 drm/of: free the iterator object on failure When bailing out due to the sanity check the iterator value needs to be freed because the early return prevents for_each_child_of_node() from doing the dereference itself. Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Signed-off-by: Steven Price Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210714143300.20632-1-steven.price@arm.com commit 311ac6f3e566e3e32afd6579b0c696683904826c Author: Thomas Zimmermann Date: Tue Jul 6 09:31:25 2021 +0200 drm/omapdrm: Remove outdated comment The comment refers to drm_irq_install() et al, which are not used by omapdrm. The functions are part of the DRM IRQ midlayer and shouldn't be used any longer. Remove the comment. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210706073125.7689-1-tzimmermann@suse.de commit db20ea679d9c0408001162f1a45b9cee83a98e6a Author: Thomas Zimmermann Date: Tue Jul 6 09:50:11 2021 +0200 drm/vbox: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210706075011.9009-1-tzimmermann@suse.de commit 48bd85808443214a710217ccd4692261180a6063 Author: Thomas Zimmermann Date: Tue Jul 6 09:47:35 2021 +0200 drm/qxl: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210706074735.8849-1-tzimmermann@suse.de commit 27da370e0fb343a0baf308f503bb3e5dcdfe3362 Author: Maxime Ripard Date: Wed Jul 7 16:19:30 2021 +0200 drm/vc4: hdmi: Remove drm_encoder->crtc usage The drm_encoder crtc pointer isn't really fit for an atomic driver, let's rely on the connector state instead. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210707141930.1811128-1-maxime@cerno.tech commit 44fe9f90eb9d2533d049b4ba09540eed6cad9f49 Author: Maxime Ripard Date: Wed Jul 7 11:51:12 2021 +0200 drm/vc4: hdmi: Only call into DRM framework if registered Our hotplug handler will currently call the drm_kms_helper_hotplug_event every time a hotplug interrupt is called. However, since the device is registered after all the drivers have finished their bind callback, we have a window between when we install our interrupt handler and when drm_dev_register() is eventually called where our handler can run and call drm_kms_helper_hotplug_event but the device hasn't been registered yet, causing a null pointer dereference. Fix this by making sure we only call drm_kms_helper_hotplug_event if our device has been properly registered. Fixes: f4790083c7c2 ("drm/vc4: hdmi: Rely on interrupts to handle hotplug") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210707095112.1469670-4-maxime@cerno.tech commit 776efe800feda95a29cefecce1ce36cc27d70b29 Author: Maxime Ripard Date: Wed Jul 7 11:51:11 2021 +0200 drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts The hotplugs interrupt handlers are registered through the devm_request_threaded_irq function. However, while free_irq is indeed called properly when the device is unbound or bind fails, it's called after unbind or bind is done. In our particular case, it means that on failure it creates a window where our interrupt handler can be called, but we're freeing every resource (CEC adapter, DRM objects, etc.) it might need. In order to address this, let's switch to the non-devm variant to control better when the handler will be unregistered and allow us to make it safe. Fixes: f4790083c7c2 ("drm/vc4: hdmi: Rely on interrupts to handle hotplug") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210707095112.1469670-3-maxime@cerno.tech commit 2c4e3154571612c419cb0c4e86ea0afd5be83da0 Author: Takashi Iwai Date: Wed Jul 14 18:24:24 2021 +0200 ALSA: compress: Initialize mutex in snd_compress_new() Currently the snd_compr.lock mutex isn't initialized in the API functions although the lock is used many places in other code in compress offload API. It's because the object was expected to be initialized via snd_compress_register(), but this was never used by ASoC, which is the only user. Instead, ASoC initializes the mutex by itself, and this is error-prone. This patch moves the mutex initialization into the more appropriate place, snd_compress_new(), for avoiding the missing init. Reviewed-by: Mark Brown Acked-by: Vinod Koul Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210714162424.4412-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit fc93c96fe34e10b873fef73e80cee52503f3a679 Author: Takashi Iwai Date: Wed Jul 14 18:24:23 2021 +0200 ALSA: compress: Drop unused functions snd_compress_register() and snd_compress_deregister() API functions have been never used by in-tree drivers. Let's clean up the dead code. Acked-by: Vinod Koul Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210714162424.4412-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9946aa630ae71d15dc304e92e55bc655603c942d Merge: 904729b61c377 a9c241d01d0a8 Author: Steve French Date: Wed Jul 14 20:55:12 2021 -0500 Merge pull request #61 from namjaejeon/cifsd-for-next ksmbd-fixes commit 75f0fc7b48ad45a2e5736bcf8de26c8872fe8695 Author: He Fengqing Date: Wed Jul 14 10:18:15 2021 +0000 bpf: Fix potential memleak and UAF in the verifier. In bpf_patch_insn_data(), we first use the bpf_patch_insn_single() to insert new instructions, then use adjust_insn_aux_data() to adjust insn_aux_data. If the old env->prog have no enough room for new inserted instructions, we use bpf_prog_realloc to construct new_prog and free the old env->prog. There have two errors here. First, if adjust_insn_aux_data() return ENOMEM, we should free the new_prog. Second, if adjust_insn_aux_data() return ENOMEM, bpf_patch_insn_data() will return NULL, and env->prog has been freed in bpf_prog_realloc, but we will use it in bpf_check(). So in this patch, we make the adjust_insn_aux_data() never fails. In bpf_patch_insn_data(), we first pre-malloc memory for the new insn_aux_data, then call bpf_patch_insn_single() to insert new instructions, at last call adjust_insn_aux_data() to adjust insn_aux_data. Fixes: 8041902dae52 ("bpf: adjust insn_aux_data when patching insns") Signed-off-by: He Fengqing Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20210714101815.164322-1-hefengqing@huawei.com commit a9c241d01d0a80209cb7dde76a89f450b0d5a78d Author: Namjae Jeon Date: Thu Jul 15 10:22:20 2021 +0900 ksmbd: fix typo in comment Fix typo "openning" -> "opening". Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f170acda7ffaf0473d06e1e17c12cd9fd63904f5 Author: Kuniyuki Iwashima Date: Wed Jul 14 21:43:17 2021 +0900 bpf: Fix a typo of reuseport map in bpf.h. Fix s/BPF_MAP_TYPE_REUSEPORT_ARRAY/BPF_MAP_TYPE_REUSEPORT_SOCKARRAY/ typo in bpf.h. Fixes: 2dbb9b9e6df6 ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210714124317.67526-1-kuniyu@amazon.co.jp commit 7ad2d09ccde2029fca433f587731e6877953d602 Merge: 23bd991992f45 eee42141e498f Author: Matt Roper Date: Wed Jul 14 17:50:37 2021 -0700 Merge branch 'topic/revid_steppings' into drm-intel-next The switch from old old IS_FOO_REVID() macros to the new table-based IS_FOO_{GT,DISP}_STEP() macros is needed on both drm-intel-next (for display-based DMC matching) and drm-intel-gt-next (for workaround guards). To avoid conflicts, we'll apply the patches to a topic branch and merge it to both intel branches to ensure the transition to the new macros is clean. Signed-off-by: Matt Roper commit d6e6ac294d91563131265fdf44537aeac2984c21 Merge: 8f88ca76b3942 eee42141e498f Author: Matt Roper Date: Wed Jul 14 17:54:25 2021 -0700 Merge branch 'topic/revid_steppings' into drm-intel-gt-next The switch from old old IS_FOO_REVID() macros to the new table-based IS_FOO_{GT,DISP}_STEP() macros is needed on both drm-intel-next (for display-based DMC matching) and drm-intel-gt-next (for workaround guards). To avoid conflicts, we'll apply the patches to a topic branch and merge it to both intel branches to ensure the transition to the new macros is clean. Signed-off-by: Matt Roper commit eee42141e498fa3df3ce524846d52f67a92b6845 Author: Matt Roper Date: Tue Jul 13 12:36:35 2021 -0700 drm/i915/icl: Drop workarounds that only apply to pre-production steppings We're past the point at which we usually drop workarounds that were never needed on production hardware. The driver will already print an error and apply taint if loaded on pre-production hardware. Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-13-matthew.d.roper@intel.com commit 41eb74d51db7a889c074255f5e9028731c3669a6 Author: Matt Roper Date: Tue Jul 13 12:36:34 2021 -0700 drm/i915/cnl: Drop all workarounds All of the Cannon Lake hardware that came out had graphics fused off, and our userspace drivers have already dropped their support for the platform; CNL-specific code in i915 that isn't inherited by subsequent platforms is effectively dead code. Let's remove all of the CNL-specific workarounds as a quick and easy first step. References: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6899 Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-12-matthew.d.roper@intel.com commit dae751f40c1913751bbdaed18224ff707f562319 Author: Matt Roper Date: Tue Jul 13 12:36:33 2021 -0700 drm/i915/dg1: Use revid->stepping tables Switch DG1 to use a revid->stepping table as we're trying to do on all platforms going forward. This removes the last use of IS_REVID() and REVID_FOREVER, so remove those now-unused macros as well to prevent their accidental use on future platforms. v2: - Use COMMON_STEP() macro in table. (Anusha) Bspec: 44463 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-11-matthew.d.roper@intel.com commit 97cf9b58153985929ffb31de57fce9b1323fe283 Author: Matt Roper Date: Tue Jul 13 12:36:32 2021 -0700 drm/i915/rkl: Use revid->stepping tables Switch RKL to use a revid->stepping table as we're trying to do on all platforms going forward. Bspec: 44501 Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-10-matthew.d.roper@intel.com commit 61b2dc4b58688d61237edfdc6045e570fd05fd25 Author: Matt Roper Date: Tue Jul 13 12:36:31 2021 -0700 drm/i915/jsl_ehl: Use revid->stepping tables Switch JSL/EHL to use a revid->stepping table as we're trying to do on all platforms going forward. v2: - Use COMMON_STEP(). (Anusha) Bspec: 29153 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-9-matthew.d.roper@intel.com commit cc7a3393f2888726ad86f229d15543e6145d915f Author: Matt Roper Date: Tue Jul 13 12:36:30 2021 -0700 drm/i915/icl: Use revid->stepping tables Switch ICL to use a revid->stepping table as we're trying to do on all platforms going forward. While we're at it, let's include some additional steppings that have popped up, even if we don't yet have any workarounds tied to those steppings (we probably need to audit our workaround list soon to see if any of the bounds have moved or if new workarounds have appeared). Note that the current bspec table is missing information about how to map PCI revision ID to GT/display steppings; it only provides an SoC stepping. The mapping to GT/display steppings (which aren't always the same as the SoC stepping) used to be in the bspec, but was apparently dropped during an update in Nov 2019; I've made my changes here based on an older bspec snapshot that still had the necessary information. We've requested that the missing information be restored. I'm only including the production revids in the table here since we're past the point at which we usually stop trying to support pre-production hardware. An appropriate check is added to intel_detect_preproduction_hw() to print an error and taint the kernel just in case someone still tries to load the driver on old pre-production hardware. v2: - Drop pre-production steppings and add error/taint at startup when loading on pre-production hardware. Bspec: 21141 # pre-Nov 2019 snapshot Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-8-matthew.d.roper@intel.com commit 3dd22d46c7f6ddfb8c5e5d7c45649cd922bdd8cb Author: Matt Roper Date: Tue Jul 13 12:36:29 2021 -0700 drm/i915/glk: Use revid->stepping tables Switch GLK to use a revid->stepping table as we're trying to do on all platforms going forward. Pre-production and placeholder revisions are omitted. Although nothing in the code is using the data from this table at the moment, we expect some upcoming DMC patches to start utilizing it. Bspec: 19131 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-7-matthew.d.roper@intel.com commit cf2c6f08632f127fcab808224f80ea1d3709f242 Author: Alexei Starovoitov Date: Wed Jul 14 17:36:20 2021 -0700 bpf: Sync tools/include/uapi/linux/bpf.h Commit 47316f4a3053 missed updating tools/.../bpf.h. Sync it. Fixes: 47316f4a3053 ("bpf: Support input xdp_md context in BPF_PROG_TEST_RUN") Signed-off-by: Alexei Starovoitov commit fd51fa8ac63835b99c084f6ef8264b6e322b7034 Author: Matt Roper Date: Tue Jul 13 12:36:28 2021 -0700 drm/i915/bxt: Use revid->stepping tables Switch BXT to use a revid->stepping table as we're trying to do on all platforms going forward. Note that the REVID macros we had before weren't being used anywhere in the code and weren't even correct; the table values come from the bspec (and omits all the placeholder and preproduction revisions). Although nothing in the code is using the data from this table at the moment, we expect some upcoming DMC patches to start utilizing it. Bspec: 13620 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-6-matthew.d.roper@intel.com commit 6eea6f16e697903b4aad39ee1fff4fa4d74e3a63 Author: Matt Roper Date: Tue Jul 13 12:36:27 2021 -0700 drm/i915/kbl: Drop pre-production revision from stepping table We're long past the point where we need to care about pre-production hardware, and we already warn the user and taint the kernel if we detect the driver is being loaded on pre-production hardware. Bspec: 18329 Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-5-matthew.d.roper@intel.com commit 0f93f5da1cdc40d78fa2df8a62168e2362a0b34e Author: Matt Roper Date: Tue Jul 13 12:36:26 2021 -0700 drm/i915/skl: Use revid->stepping tables Switch SKL to use a revid->stepping table as we're trying to do on all platforms going forward. Also drop the preproduction revisions and add the newer steppings we hadn't already handled. Note that SKL has a case where a newer revision ID corresponds to an older GT/disp stepping (0x9 -> STEP_J0, 0xA -> STEP_I1). Also, the lack of a revision ID 0x8 in the table is intentional and not an oversight. We'll re-write the KBL-specific comment to make it clear that these kind of quirks are expected. v2: - Since GT and display steppings are always identical on SKL use a macro to set both values at once in a more readable manner. (Anusha) - Drop preproduction steppings. Bspec: 13626 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-4-matthew.d.roper@intel.com commit c314b693954075791ed11dce3c68f920409b5de4 Author: Matt Roper Date: Tue Jul 13 12:36:25 2021 -0700 drm/i915: Make pre-production detection use direct revid comparison Although we're converting our workarounds to use a revid->stepping lookup table, the function that detects pre-production hardware should continue to compare against PCI revision ID values directly. These are listed in the bspec as integers, so it's easier to confirm their correctness if we just use an integer literal rather than a symbolic name anyway. Bspec: 13620, 19131, 13626, 18329 Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-3-matthew.d.roper@intel.com commit db47fe727e1fc516cf60fc9ab8299605ef3c2d54 Author: Anusha Srivatsa Date: Tue Jul 13 12:36:24 2021 -0700 drm/i915/step: s/_revid_tbl/_revids Simplify the stepping info array name. Cc: Jani Nikula Signed-off-by: Anusha Srivatsa Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210713193635.3390052-2-matthew.d.roper@intel.com commit 868d043f056016b8002897b536d56bb35f87ed2e Author: Christophe Branchereau Date: Fri Jun 25 13:10:45 2021 +0100 drm/panel: Add Innolux EJ030NA 3.0" 320x480 panel Add support for the Innolux/Chimei EJ030NA 3.0" 320x480 TFT panel. This panel can be found in the LDKs, RS97 V2.1 and RG300 (non IPS) handheld gaming consoles. While being 320x480, it is actually a horizontal 4:3 panel with non-square pixels in delta arrangement. Signed-off-by: Christophe Branchereau Signed-off-by: Paul Cercueil Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210625121045.81711-2-paul@crapouillou.net commit 1333adfcc3cbfabb68f6cf6f2baffd89ad012330 Author: Paul Cercueil Date: Fri Jun 25 13:10:44 2021 +0100 dt-bindings: display/panel: Add Innolux EJ030NA Add binding for the Innolux EJ030NA panel, which is a 320x480 3.0" 4:3 24-bit TFT LCD panel with non-square pixels and a delta-RGB 8-bit interface. Signed-off-by: Paul Cercueil Reviewed-by: Sam Ravnborg Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20210625121045.81711-1-paul@crapouillou.net commit 893c47d1964f5c9b00c5468f2cd1a1e9351fbb6a Author: Austin Kim Date: Wed Jul 14 01:11:27 2021 +0100 selinux: return early for possible NULL audit buffers audit_log_start() may return NULL in below cases: - when audit is not initialized. - when audit backlog limit exceeds. After the call to audit_log_start() is made and then possible NULL audit buffer argument is passed to audit_log_*() functions, audit_log_*() functions return immediately in case of a NULL audit buffer argument. But it is optimal to return early when audit_log_start() returns NULL, because it is not necessary for audit_log_*() functions to be called with NULL audit buffer argument. So add exception handling for possible NULL audit buffers where return value can be handled from callers. Signed-off-by: Austin Kim [PM: tweak subject line] Signed-off-by: Paul Moore commit 0c492e22ba2c9f984a80bcec4e3cb7e41b6985ac Author: Jinzhou Su Date: Tue Jul 13 09:26:11 2021 +0800 drm/amdgpu: add another Renoir DID Add new PCI device id. Signed-off-by: Jinzhou Su Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit eb14ecca76697930ff86a3401fee198d54ea6524 Merge: f28fbe57e84b4 0ccac3bcf3564 Author: Mark Brown Date: Wed Jul 14 18:29:58 2021 +0100 Merge series "soundwire/ASoC: add mockup codec support" from Bard Liao : Adding mockup SoundWire codec is useful to debug driver/topology changes without having any actual device connected. Bard Liao (2): soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA soundwire: stream: don't program mockup device ports Pierre-Louis Bossart (8): ASoC: codecs: add SoundWire mockup device support ASoC: soc-acpi: cnl: add table for SoundWire mockup devices ASoC: soc-acpi: tgl: add table for SoundWire mockup devices ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests soundwire: add flag to ignore all command/control for mockup devices soundwire: bus: squelch error returned by mockup devices soundwire: cadence: add debugfs interface for PDI loopbacks soundwire: cadence: override PDI configurations to create loopback drivers/soundwire/bus.c | 10 +- drivers/soundwire/cadence_master.c | 174 ++++++++-- drivers/soundwire/cadence_master.h | 3 + drivers/soundwire/stream.c | 5 +- include/linux/soundwire/sdw.h | 3 + sound/soc/codecs/Kconfig | 18 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/sdw-mockup.c | 312 ++++++++++++++++++ sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_sdw.c | 41 +++ sound/soc/intel/common/Makefile | 3 +- .../intel/common/soc-acpi-intel-cnl-match.c | 15 + .../common/soc-acpi-intel-sdw-mockup-match.c | 166 ++++++++++ .../common/soc-acpi-intel-sdw-mockup-match.h | 17 + .../intel/common/soc-acpi-intel-tgl-match.c | 23 ++ 15 files changed, 754 insertions(+), 39 deletions(-) create mode 100644 sound/soc/codecs/sdw-mockup.c create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.c create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.h base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3 -- 2.17.1 commit 0ccac3bcf3564cbcba483dec20c7550939873f59 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:03 2021 +0800 ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests Add support for SoundWire mockup devices. The configurations assume the same topology as the CML SoundWire devices and can be used to test the SOF firmware on a development board (RVP, UpExtreme) without any hardware connected. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 3025d398c436d313f9b6b5c1f53918efeafcf5dc Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:02 2021 +0800 ASoC: soc-acpi: tgl: add table for SoundWire mockup devices Follow the same idea as for CNL/UpExtreme and add mockup test first. They will only be selected if the SSDT is modified to add such mockup devices. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 2694cda7a4393fbd436e28474832a053e70e0733 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:01 2021 +0800 ASoC: soc-acpi: cnl: add table for SoundWire mockup devices Add support for two configurations with SoundWire mockup devices that emulate the two CometLake configurations with one and two amps. This patch helps test the SOF firmware on an UpExtreme board without any hardware connected, e.g. by doing a loopback of the playback stream on capture streams. The mapping of the partIDs is as follows: 0xAAAA: generic full-duplex codec (not currently used) 0xAA55: headset codec (mock-up of RT711/RT5682) - full-duplex 0x55AA: amplifier (mock-up of RT1308/RT1316/Maxim 98373) - playback with IV sense feedback 0x5555: mic codec (mock-up of RT715) - capture-only The tables are added in a separate file to allow for mockup codecs to be added on other platforms, but the mapping to specific topologies remains platform-specific. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 81d3d3d0bf09e606dbc1e3daad1c7cef3976fca2 Author: Pierre-Louis Bossart Date: Wed Jul 14 11:22:00 2021 +0800 ASoC: codecs: add SoundWire mockup device support To test the host controller and bus management code, it is currently required to have a physical SoundWire peripheral attached to the bus. To help with pre-silicon or early hardware enablement, it would be very useful to have a SoundWire 'mockup' device that is exposed in platform firmware but does not drive any signal on the bus. This is different to the existing ASoC 'dummy' codec uses for I2S/TDM, the SoundWire spec makes it clear that a device that is not attached to the bus is not permitted to interact with the bus, be it for command/control or data. This patch exposes a 'mockup' device, with a minimalist driver, with 4 partID values reserved by Intel for such test configurations. The mockup device exposes one full-duplex DAI based on 2 ports (DP1 for playback and DP8 for capture). The capture data port is just virtual, such a mockup device is prevented by the SoundWire specification from presenting any data generated by a Source port without being Attached. All the callbacks exposed by the SoundWire Slave interface are populated, even if they just return immediately. This is intentional to describe what a minimal codec driver should do and implement and help new codec vendors provide support for their devices. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210714032209.11284-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 57f1c12e455fc6c4c0db2c9f14e57b95822c2321 Author: Douglas Anderson Date: Mon Jul 12 08:50:17 2021 -0700 spi: spi-geni-qcom: Remove confusing comment about setting the watermark The comment in setup_fifo_xfer() about setting the watermark wasn't quite proper grammar and also stopped making sense around commit 6d66507d9b55 ("spi: spi-geni-qcom: Don't wait to start 1st transfer if transmitting"). After that commit we actually start the transfer _before_ the watermark interrupt comes. I don't think the comment really has any value anymore. We've already got a comment when we grab the spinlock saying that our interrupt can come any time as a result of the things in the locked section. Let's just remove it. Signed-off-by: Douglas Anderson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20210712085010.1.Ie3bb9f9d30d6475bb75251d32635194c1c72b9ee@changeid Signed-off-by: Mark Brown commit 77eac0e1ce9c61b66c15f7cc503ae848b74fe42c Author: ChiYuan Huang Date: Wed Jul 14 10:36:10 2021 +0800 regulator: rtq6752: Fix the typo for reg define and author name Fix the typo for reg define and author name. Signed-off-by: ChiYuan Huang Reported-by: Axel Lin Link: https://lore.kernel.org/r/1626230170-13648-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 23bd991992f45c4af55ac0d747152464f5f2da6e Author: Anshuman Gupta Date: Tue Jul 13 13:27:38 2021 +0530 drm/i915/debugfs: DISPLAY_VER 13 lpsp capability Extend i915_lpsp_capability debugfs to DG2,ADLP and future platforms. v2: commit log modification. Cc: Animesh Manna Signed-off-by: Anshuman Gupta Reviewed-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20210713075738.23759-1-anshuman.gupta@intel.com commit 014861c2fb3d7b38b8de32baa953082bb9dabaf4 Author: Aswath Govindraju Date: Mon Jun 21 14:58:58 2021 +0530 spi: omap-spi: Convert to json-schema Convert omap-spi dt-binding documentation from txt to yaml format. Signed-off-by: Aswath Govindraju Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20210621092900.951-1-a-govindraju@ti.com Signed-off-by: Mark Brown commit f84d866ab43fcc27b417c86357d6534f157a3d89 Author: Mason Zhang Date: Tue Jul 13 19:40:49 2021 +0800 spi: mediatek: add tick_delay support This patch support tick_delay setting, some users need use high-speed spi speed, which can use tick_delay to tuning spi clk timing. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210713114048.29509-1-mason.zhang@mediatek.com Signed-off-by: Mark Brown commit e98fb032170bfa2e671a01e356a7ee86a2038312 Author: ChiYuan Huang Date: Wed Jul 14 10:25:32 2021 +0800 regulator: rtq6752: Refine binding document Drop regulators property reference and remove the status in example dts. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1626229532-13037-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit f28fbe57e84b4a6cfad314ea9bc3442d96f4fa08 Author: jairaj arava Date: Mon Jul 12 15:32:40 2021 -0500 ASoC: Intel: sof_sdw: update quirk for jack detection in ADL RVP ADL RVP uses different circuits for jack detection, hence adding external resister 100k mode. Reviewed-by: Rander Wang Signed-off-by: jairaj arava Signed-off-by: Sathya Prakash M R Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8e6c00f1fdea9fdf727969d7485d417240d2a1f9 Author: Bard Liao Date: Mon Jul 12 15:32:39 2021 -0500 ASoC: Intel: sof_sdw: include rt711.h for RT711 JD mode We don't need to redefine enum rt711_jd_src. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 368fa526e6e396972d5f0ed7c2a86ac0c3399ff3 Author: Bard Liao Date: Mon Jul 12 15:32:38 2021 -0500 ASoC: Intel: sof_sdw: extends SOF_RT711_JDSRC to 4 bits commit 683b0df26c33 ("ASoC: rt711: add two jack detection modes") added two jack detection modes. Rt711 has 4 JD modes now. Reserve 4 bits in case rt711 adds more JD modes in the future. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 542d7050da19343ffe61f7b5d1fe2d44ccb0451a Author: Brent Lu Date: Mon Jul 12 15:32:37 2021 -0500 ASoC: Intel: sof_rt5682: code refactor for max98360a Refactor the machine driver by using the common code in maxim-common module to support max98360a. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7d1bf46cb233aa80e684f61cde5f91530da3f3ea Author: Brent Lu Date: Mon Jul 12 15:32:36 2021 -0500 ASoC: Intel: sof_cs42l42: add support for jsl_cs4242_mx98360a This patch adds driver data for jsl_cs4242_mx98360a which supports two max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec on SSP0 running on JSL platform. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 07acee589f4293cb0ebd77aa201d616e9a296bb9 Author: Brent Lu Date: Mon Jul 12 15:32:35 2021 -0500 ASoC: Intel: maxim-common: support max98360a Move max98360a code to this common module so it could be shared between multiple SOF machine drivers. MAX98357A and MAX98360A are sharing same codec driver so here we also share some function and structures. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3cb97cf3a65a7fdbf4844ccd39b7e96fe14f762b Author: Brent Lu Date: Mon Jul 12 15:32:34 2021 -0500 ASoC: Intel: sof_cs42l42: support arbitrary DAI link sequence Currently there are two types of DAI Link sequences defined in topology files, one starts from speaker link and the other starts from headphone link. Type 1: SPK - HP - DMIC - HDMI Type 2: HP - DMIC - HDMI - SPK Here we add a macro SOF_CS42L42_DAILINK to define the DAI Link sequence in quirk and refactor the sof_card_dai_links_create() function to support arbitrary DAI Link sequence. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210712203240.46960-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8f88ca76b3942d82e2c1cea8735ec368d89ecc15 Author: Matthew Auld Date: Tue Jul 13 14:04:31 2021 +0100 drm/i915/gtt: drop the page table optimisation We skip filling out the pt with scratch entries if the va range covers the entire pt, since we later have to fill it with the PTEs for the object pages anyway. However this might leave open a small window where the PTEs don't point to anything valid for the HW to consume. When for example using 2M GTT pages this fill_px() showed up as being quite significant in perf measurements, and ends up being completely wasted since we ignore the pt and just use the pde directly. Anyway, currently we have our PTE construction split between alloc and insert, which is probably slightly iffy nowadays, since the alloc doesn't actually allocate anything anymore, instead it just sets up the page directories and points the PTEs at the scratch page. Later when we do the insert step we re-program the PTEs again. Better might be to squash the alloc and insert into a single step, then bringing back this optimisation(along with some others) should be possible. Fixes: 14826673247e ("drm/i915: Only initialize partially filled pagetables") Signed-off-by: Matthew Auld Cc: Jon Bloomfield Cc: Chris Wilson Cc: Daniel Vetter Cc: # v4.15+ Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210713130431.2392740-1-matthew.auld@intel.com commit 3aa8c57fe25a9247e25977f1c2302395cbbd8242 Author: Matthew Auld Date: Mon Jul 5 14:53:09 2021 +0100 drm/i915/uapi: convert drm_i915_gem_set_domain to kernel doc Convert all the drm_i915_gem_set_domain bits to proper kernel doc. Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20210705135310.1502437-4-matthew.auld@intel.com commit 289f5a72009b8f67334c9f911f7f5fe6e8a80049 Author: Matthew Auld Date: Mon Jul 5 14:53:07 2021 +0100 drm/i915/uapi: convert drm_i915_gem_caching to kernel doc Convert all the drm_i915_gem_caching bits to proper kernel doc. Suggested-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Cc: Jordan Justen Cc: Kenneth Graunke Cc: Jason Ekstrand Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20210705135310.1502437-2-matthew.auld@intel.com commit d7114b57685997668c4fb7a4d3829f4d6d707cc0 Author: Russell King (Oracle) Date: Sat Jun 19 16:55:26 2021 +0100 dt-bindings: arm: fsl: add SolidSense boards Add SolidRun SolidSense boards. Signed-off-by: Russell King (Oracle) Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 718226469d2300b5c6252fdc72a1415b17568d5f Author: Mirela Rabulea Date: Sat Jun 19 17:36:10 2021 +0300 dt-bindings: media: imx-jpeg: Add compatible for i.MX8QM JPEG codec Add two more compatibles: "nxp,imx8qm-jpgdec" and " nxp,imx8qm-jpgenc". Also update the compatible property to ensure mutually exclusive usage of encoder and decoder compatibles. Update examples. Signed-off-by: Mirela Rabulea Reviewed-by: Dong Aisheng Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit b2296eeac91555bd13f774efa7ab7d4b12fb71ef Author: Johannes Berg Date: Fri Jun 25 10:38:10 2021 +0200 dmaengine: idxd: depends on !UML Now that UML has PCI support, this driver must depend also on !UML since it pokes at X86_64 architecture internals that don't exist on ARCH=um. Reported-by: kernel test robot Signed-off-by: Johannes Berg Acked-by: Dave Jiang Acked-By: Anton Ivanov Link: https://lore.kernel.org/r/20210625103810.fe877ae0aef4.If240438e3f50ae226f3f755fc46ea498c6858393@changeid Signed-off-by: Vinod Koul commit 6cfd9e62e3297993f9f9d2d15f3acb14a0e8abbf Author: Dave Jiang Date: Thu Jun 24 13:39:33 2021 -0700 dmaengine: idxd: assign MSIX vectors to each WQ rather than roundrobin IOPS increased when changing MSIX vector to per WQ from roundrobin. Allows descriptor to be completed by the submitter improves caching locality. Suggested-by: Konstantin Ananyev Signed-off-by: Dave Jiang Acked-by: Konstantin Ananyev Link: https://lore.kernel.org/r/162456717326.1130457.15258077196523268356.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit ac24a2dc06cd773895d2fba0378c2538b8176565 Author: Dave Jiang Date: Thu Jun 24 12:08:21 2021 -0700 dmaengine: idxd: add missing percpu ref put on failure When enqcmds() fails, exit path is missing a percpu_ref_put(). This can cause failure on shutdown path when the driver is attempting to quiesce the wq. Add missing percpu_ref_put() call on the error exit path. Fixes: 93a40a6d7428 ("dmaengine: idxd: add percpu_ref to descriptor submission path") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162456170168.1121236.7240941044089212312.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 53499d1fc11267e078557fc68ce943c1eb3b7a37 Author: Dave Jiang Date: Thu Jun 3 11:01:37 2021 -0700 dmaengine: idxd: have command status always set The cached command status is only set when the write back status is is passed in. Move the variable set outside of the check so it is always set. Fixes: 0d5c10b4c84d ("dmaengine: idxd: add work queue drain support") Reported-by: Ramesh Thomas Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162274329740.1822314.3443875665504707588.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit e753a64bee753136087dfd70b37fdd199e942ea9 Author: Dave Jiang Date: Thu Jun 3 14:57:35 2021 -0700 dmaengine: idxd: Add wq occupancy information to sysfs attribute Add occupancy information to wq sysfs attribute. Attribute will show wq occupancy data if "WQ Occupancy Support" field in WQCAP is 1. It displays the number of entries currently in this WQ. This is provided as an estimate and should not be relied on to determine whether there is space in the WQ. The data is to provide information to user apps for flow control. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162275745546.1857062.8765615879420582018.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 0dcfe41e9a4ca759ccc87a48e3bb9cc3b08ff1e8 Author: Dave Jiang Date: Fri Jun 4 17:06:21 2021 -0700 dmanegine: idxd: cleanup all device related bits after disabling device The previous state cleanup patch only performed wq state cleanups. This does not go far enough as when device is disabled or reset, the state for groups and engines must also be cleaned up. Add additional state cleanup beyond wq cleanup. Tie those cleanups directly to device disable and reset, and wq disable and reset. Fixes: da32b28c95a7 ("dmaengine: idxd: cleanup workqueue config after disabling") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162285154108.2096632.5572805472362321307.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 53b50458110d829c8fc45e7803a335a515698fd8 Author: Christophe JAILLET Date: Thu Jul 8 07:08:26 2021 +0200 dmaengine: idxd: Simplify code and axe the use of a deprecated API The wrappers in include/linux/pci-dma-compat.h should go away. Replace 'pci_set_dma_mask/pci_set_consistent_dma_mask' by an equivalent and less verbose 'dma_set_mask_and_coherent()' call. Even if the code may look different, it should have exactly the same run-time behavior. If pci_set_dma_mask(64) fails and pci_set_dma_mask(32) succeeds, then pci_set_consistent_dma_mask(64) will also fail. Signed-off-by: Christophe JAILLET Acked-by: Dave Jiang Link: https://lore.kernel.org/r/70c8a3bc67e41c5fefb526ecd64c5174c1e2dc76.1625720835.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit fe364a7d95c24e07e9b3f2ab917f01d6d8330bba Author: Andy Shevchenko Date: Mon Jul 12 14:39:40 2021 +0300 dmaengine: dw: Program xBAR hardware for Elkhart Lake Intel Elkhart Lake PSE DMA implementation is integrated with crossbar IP in order to serve more hardware than there are DMA request lines available. Due to this, program xBAR hardware to make flexible support of PSE peripheral. The Device-to-Device has not been tested and it's not supported by DMA Engine, but it's left in the code for the sake of documenting hardware features. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210712113940.42753-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit d39cd936b6b741c2e8f234298a6fb5ed8baf5a46 Author: Lucas Stach Date: Mon Jun 14 19:06:33 2021 +0200 arm64: dts: imx8mq: add support for MNT Reform2 This adds a basic devicetree for the MNT Reform2 DIY laptop. Not all of the board periperals are enabled yet, as some of them still require kernel patches to work properly. The nodes for those peripherals will be added as soon as the required patches are upstream. The following has been tested to work: - UART console - SD card - eMMC - Gigabit Ethernet - USB (internal Keyboard, Mouse, external ports) - M.2 PCIe port Co-developed-by: Lukas F. Hartmann Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 117c25091d73760be8faf6f7ff48fa8eb7e8c775 Author: Lucas Stach Date: Mon Jun 14 19:06:30 2021 +0200 arm64: dts: imx8mq: add Nitrogen8 SoM This adds the description of the Nitrogen8 System on Module. The module is quite simple with only a few (almost) fixed regulators and a eMMC on-board. Signed-off-by: Lucas Stach Acked-by: Rob Herring Signed-off-by: Shawn Guo commit ec1e7fc7721806250731b8168f8abc247c065e4d Author: Lucas Stach Date: Wed Jul 14 12:11:14 2021 +0800 dt-bindings: arm: fsl: add MNT Reform2 board Add compatible for the MNT Reform2 laptop board. Signed-off-by: Lucas Stach Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 26d816652c92edc8d7dfc881e43a693db81bab37 Author: Lucas Stach Date: Mon Jun 14 19:06:31 2021 +0200 dt-bindings: vendor-prefixes: add mntre MNT Research GmbH develops open source hardware, software and textiles in Berlin, Germany. Signed-off-by: Lucas Stach Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 204d1a747636403fb0d9859eb4fdae2117f0545a Author: Lucas Stach Date: Mon Jun 14 19:06:29 2021 +0200 dt-bindings: arm: fsl: add Nitrogen8 SoM Add compatible for the BoundaryDevices Nitrogen8 system on module. Signed-off-by: Lucas Stach Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 868c9ddc182bc6728bb380cbfb3170734f72c599 Author: Dominique Martinet Date: Wed Jul 7 14:12:54 2021 +0900 swiotlb: add overflow checks to swiotlb_bounce This is a follow-up on 5f89468e2f06 ("swiotlb: manipulate orig_addr when tlb_addr has offset") which fixed unaligned dma mappings, making sure the following overflows are caught: - offset of the start of the slot within the device bigger than requested address' offset, in other words if the base address given in swiotlb_tbl_map_single to create the mapping (orig_addr) was after the requested address for the sync (tlb_offset) in the same block: |------------------------------------------| block <----------------------------> mapped part of the block ^ orig_addr ^ invalid tlb_addr for sync - if the resulting offset was bigger than the allocation size this one could happen if the mapping was not until the end. e.g. |------------------------------------------| block <---------------------> mapped part of the block ^ ^ orig_addr invalid tlb_addr Both should never happen so print a warning and bail out without trying to adjust the sizes/offsets: the first one could try to sync from orig_addr to whatever is left of the requested size, but the later really has nothing to sync there... Signed-off-by: Dominique Martinet Cc: Konrad Rzeszutek Wilk Reviewed-by: Bumyong Lee Cc: Christoph Hellwig Signed-off-by: Konrad Rzeszutek Wilk commit 09a4a79d42ced8ca7fc250b05e45ac1cb23a9c52 Author: Claire Chang Date: Thu Jul 1 11:31:30 2021 +0800 swiotlb: fix implicit debugfs declarations Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate rmem_swiotlb_debugfs_init() to fix the implicit debugfs declarations. Fixes: 461021875c50 ("swiotlb: Add restricted DMA pool initialization") Reported-by: kernel test robot Signed-off-by: Claire Chang Signed-off-by: Konrad Rzeszutek Wilk commit fec9b625095f7308e52a6922619cd4abaa9534a8 Author: Claire Chang Date: Sat Jun 19 11:40:43 2021 +0800 of: Add plumbing for restricted DMA pool If a device is not behind an IOMMU, we look up the device node and set up the restricted DMA when the restricted-dma-pool is presented. Signed-off-by: Claire Chang Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit b12fe999545cf3fd89e1a178ee4e541a9331da82 Author: Claire Chang Date: Sat Jun 19 11:40:42 2021 +0800 dt-bindings: of: Add restricted DMA pool Introduce the new compatible string, restricted-dma-pool, for restricted DMA. One can specify the address and length of the restricted DMA memory region by restricted-dma-pool in the reserved-memory node. Signed-off-by: Claire Chang Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 0b84e4f8b793eb4045fd64f6f514165a7974cd16 Author: Claire Chang Date: Sat Jun 19 11:40:41 2021 +0800 swiotlb: Add restricted DMA pool initialization Add the initialization function to create restricted DMA pools from matching reserved-memory nodes. Regardless of swiotlb setting, the restricted DMA pool is preferred if available. The restricted DMA pools provide a basic level of protection against the DMA overwriting buffer contents at unexpected times. However, to protect against general data leakage and system memory corruption, the system needs to provide a way to lock down the memory access, e.g., MPU. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit f4111e39a52aa5d5136d890bbd1aa87c1c8fe3bc Author: Claire Chang Date: Sat Jun 19 11:40:40 2021 +0800 swiotlb: Add restricted DMA alloc/free support Add the functions, swiotlb_{alloc,free} and is_swiotlb_for_alloc to support the memory allocation from restricted DMA pool. The restricted DMA pool is preferred if available. Note that since coherent allocation needs remapping, one must set up another device coherent pool by shared-dma-pool and use dma_alloc_from_dev_coherent instead for atomic coherent allocation. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk commit 70347877231eeb505a27abe80af7ae3d3a281519 Author: Claire Chang Date: Sat Jun 19 11:40:39 2021 +0800 swiotlb: Refactor swiotlb_tbl_unmap_single Add a new function, swiotlb_release_slots, to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 36f7b2f3ca5f0bee00abf9ea52748ce0644a21c6 Author: Claire Chang Date: Thu Jun 24 23:55:21 2021 +0800 swiotlb: Move alloc_size to swiotlb_find_slots Rename find_slots to swiotlb_find_slots and move the maintenance of alloc_size to it for better code reusability later. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 903cd0f315fe426c6a64c54ed389de0becb663dc Author: Claire Chang Date: Thu Jun 24 23:55:20 2021 +0800 swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and use it to determine whether to bounce the data or not. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk [v2: Includes Will's fix] commit 6f2beb268a5d35504a636c4a3b7aaa76ec32d96c Author: Claire Chang Date: Sat Jun 19 11:40:36 2021 +0800 swiotlb: Update is_swiotlb_active to add a struct device argument Update is_swiotlb_active to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk commit 7fd856aa7f4261ddac62ea59d8383fef22a0690e Author: Claire Chang Date: Sat Jun 19 11:40:35 2021 +0800 swiotlb: Update is_swiotlb_buffer to add a struct device argument Update is_swiotlb_buffer to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk commit 69031f500865ee3eee19566a1b9c40a189817eaa Author: Claire Chang Date: Sat Jun 19 11:40:34 2021 +0800 swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used Always have the pointer to the swiotlb pool used in struct device. This could help simplify the code for other pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk commit 6e675a1c455ea7579c7eaf1a38fe64267039d6fe Author: Claire Chang Date: Sat Jun 19 11:40:33 2021 +0800 swiotlb: Refactor swiotlb_create_debugfs Split the debugfs creation to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 0a65579cdd28bed3e84e1b4929c3080da4f06d79 Author: Claire Chang Date: Sat Jun 19 11:40:32 2021 +0800 swiotlb: Refactor swiotlb init functions Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct initialization to make the code reusable. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig Tested-by: Stefano Stabellini Acked-by: Stefano Stabellini Tested-by: Will Deacon Signed-off-by: Konrad Rzeszutek Wilk commit 5417c98c12f6eeb1252130bcea3b943f5e273be7 Author: Wang Xiaojun Date: Fri Jul 9 16:34:53 2021 +0800 f2fs: avoid to create an empty string as the extension_list When creating a file, we need to set the temperature based on extension_list. If the empty string is a valid extension_list, the is_extension_exist will always returns true, which affects the separation of hot and cold. Signed-off-by: Wang Xiaojun Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 01f6afd0f3ccaa2d5f7fb87e7bd910dc17eef06b Author: Chao Yu Date: Sat Jul 10 08:21:41 2021 +0800 f2fs: compress: fix to set zstd compress level correctly As 5kft reported in [1]: set_compress_context() should set compress level into .i_compress_flag for zstd as well as lz4hc, otherwise, zstd compressor will still use default zstd compress level during compression, fix it. [1] https://lore.kernel.org/linux-f2fs-devel/8e29f52b-6b0d-45ec-9520-e63eb254287a@www.fastmail.com/T/#u Fixes: 3fde13f817e2 ("f2fs: compress: support compress level") Reported-by: 5kft <5kft@5kft.org> Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 07c6b5933ebf58b6132aea9f3e72a62486882bfb Author: Daeho Jeong Date: Fri Jul 9 22:53:57 2021 -0700 f2fs: add sysfs nodes to get GC info for each GC mode Added gc_reclaimed_segments and gc_segment_mode sysfs nodes. 1) "gc_reclaimed_segments" shows how many segments have been reclaimed by GC during a specific GC mode. 2) "gc_segment_mode" is used to control for which gc mode the "gc_reclaimed_segments" node shows. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3101e9952bd6fbe9b2ba8bf46d153dcfad77e579 Author: John Harrison Date: Thu Jul 8 09:20:55 2021 -0700 drm/i915/guc: Module load failure test for CT buffer creation Add several module failure load inject points in the CT buffer creation code path. Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-8-matthew.brost@intel.com commit 75452167a2794c302c7cfd98d3aaa374ec548fe0 Author: Matthew Brost Date: Thu Jul 8 09:20:54 2021 -0700 drm/i915/guc: Optimize CTB writes and reads CTB writes are now in the path of command submission and should be optimized for performance. Rather than reading CTB descriptor values (e.g. head, tail) which could result in accesses across the PCIe bus, store shadow local copies and only read/write the descriptor values when absolutely necessary. Also store the current space in the each channel locally. v2: (Michal) - Add additional sanity checks for head / tail pointers - Use GUC_CTB_HDR_LEN rather than magic 1 v3: (Michal / John H) - Drop redundant check of head value v4: (John H) - Drop redundant checks of tail / head values v5: (Michal) - Address more nits v6: (Michal) - Add GEM_BUG_ON sanity check on ctb->space Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-7-matthew.brost@intel.com commit b43b9950486eb9b229493fc91cdabbbb4d07cfbc Author: Matthew Brost Date: Thu Jul 8 09:20:53 2021 -0700 drm/i915/guc: Add stall timer to non blocking CTB send function Implement a stall timer which fails H2G CTBs once a period of time with no forward progress is reached to prevent deadlock. v2: (Michal) - Improve error message in ct_deadlock() - Set broken when ct_deadlock() returns true - Return -EPIPE on ct_deadlock() v3: (Michal) - Add ms to stall timer comment (Matthew) - Move broken check to intel_guc_ct_send() Signed-off-by: John Harrison Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-6-matthew.brost@intel.com commit 1681924d8bdeb248451fd1d47c18648ffaeed625 Author: Matthew Brost Date: Thu Jul 8 09:20:52 2021 -0700 drm/i915/guc: Add non blocking CTB send function Add non blocking CTB send function, intel_guc_send_nb. GuC submission will send CTBs in the critical path and does not need to wait for these CTBs to complete before moving on, hence the need for this new function. The non-blocking CTB now must have a flow control mechanism to ensure the buffer isn't overrun. A lazy spin wait is used as we believe the flow control condition should be rare with a properly sized buffer. The function, intel_guc_send_nb, is exported in this patch but unused. Several patches later in the series make use of this function. v2: (Michal) - Use define for H2G room calculations - Move INTEL_GUC_SEND_NB define (Daniel Vetter) - Use msleep_interruptible rather than cond_resched v3: (Michal) - Move includes to following patch - s/INTEL_GUC_SEND_NB/INTEL_GUC_CT_SEND_NB/g v4: (John H) - Update comment, add type local variable Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-5-matthew.brost@intel.com commit c26e289f1d8d5b8716f825ac5d798897aca5a124 Author: Matthew Brost Date: Thu Jul 8 09:20:51 2021 -0700 drm/i915/guc: Increase size of CTB buffers With the introduction of non-blocking CTBs more than one CTB can be in flight at a time. Increasing the size of the CTBs should reduce how often software hits the case where no space is available in the CTB buffer. Cc: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-4-matthew.brost@intel.com commit dd9c0f3cbbe6fdfe7402b9c6ea35f04b260901bf Author: Matthew Brost Date: Thu Jul 8 09:20:50 2021 -0700 drm/i915/guc: Improve error message for unsolicited CT response Improve the error message when a unsolicited CT response is received by printing fence that couldn't be found, the last fence, and all requests with a response outstanding. Signed-off-by: Matthew Brost Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-3-matthew.brost@intel.com commit 1ccf7294b76d28d5151f024351c747ccf101d66e Author: Matthew Brost Date: Thu Jul 8 09:20:49 2021 -0700 drm/i915/guc: Relax CTB response timeout In upcoming patch we will allow more CTB requests to be sent in parallel to the GuC for processing, so we shouldn't assume any more that GuC will always reply without 10ms. Use bigger value hardcoded value of 1s instead. v2: Add CONFIG_DRM_I915_GUC_CTB_TIMEOUT config option v3: (Daniel Vetter) - Use hardcoded value of 1s rather than config option v4: (Michal) - Use defines for timeout values Signed-off-by: Matthew Brost Cc: Michal Wajdeczko Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-2-matthew.brost@intel.com commit 611ac726f9ebbb12f2113e5345ef109660954eeb Merge: 5d4ed4f8b5efd e73f0f0ee7541 Author: Rodrigo Vivi Date: Tue Jul 13 15:52:51 2021 -0400 Merge drm/drm-next into drm-intel-gt-next Catching up with 5.14-rc1 and also preparing for a needed common topic branch for the "Minor revid/stepping and workaround cleanup" Reference: https://patchwork.freedesktop.org/series/92299/ Signed-off-by: Rodrigo Vivi commit d5bfbad214369f543958a1c6c55fa805e3f14976 Merge: 9f5827580749b e73f0f0ee7541 Author: Rodrigo Vivi Date: Tue Jul 13 15:51:31 2021 -0400 Merge drm/drm-next into drm-intel-next Catching up with 5.14-rc1 Signed-off-by: Rodrigo Vivi commit fac4e24dcc56b59cfc5f0cbd559a89adc0fc63bf Author: Marek Vasut Date: Mon Jun 21 00:50:28 2021 +0200 dt-bindings: mxsfb: Add compatible for i.MX8MN NXP's i.MX8MN has an LCDIF as well. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Lucas Stach Cc: NXP Linux Team Cc: Rob Herring Cc: Shawn Guo Reviewed-by: Lucas Stach Link: https://lore.kernel.org/r/20210620225028.189637-1-marex@denx.de Signed-off-by: Rob Herring commit 8480a727ae7b8bee7c11ea4a515e37c93ea677ef Author: Marek Vasut Date: Sun Jun 20 23:07:41 2021 +0200 dt-bindings: net: ks8851: Convert to YAML schema Convert the Micrel KSZ8851 DT bindings to YAML schema. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: Rob Herring Cc: linux@dh-electronics.com Cc: netdev@vger.kernel.org To: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20210620210741.100206-1-marex@denx.de Signed-off-by: Rob Herring commit 62f9eb7079a91fa19edc14971b38d8737704ef0f Author: Jarkko Nikula Date: Tue Jun 29 14:16:57 2021 +0300 counter: intel-qep: Remove linux/bitops.h include 0-DAY CI Kernel Test Service reported following iwyu warning: drivers/counter/intel-qep.c:11:1: iwyu: warning: superfluous #include Remove that include since we don't seem to use anything from it. Reported-by: kernel test robot Signed-off-by: Jarkko Nikula Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20210629111657.2655688-1-jarkko.nikula@linux.intel.com Signed-off-by: Jonathan Cameron commit c445535c3efbfb8cb42d098e624d46ab149664b7 Author: Ani Sinha Date: Tue Jul 13 08:35:21 2021 +0530 x86/hyperv: fix for unwanted manipulation of sched_clock when TSC marked unstable Marking TSC as unstable has a side effect of marking sched_clock as unstable when TSC is still being used as the sched_clock. This is not desirable. Hyper-V ultimately uses a paravirtualized clock source that provides a stable scheduler clock even on systems without TscInvariant CPU capability. Hence, mark_tsc_unstable() call should be called _after_ scheduler clock has been changed to the paravirtualized clocksource. This will prevent any unwanted manipulation of the sched_clock. Only TSC will be correctly marked as unstable. Signed-off-by: Ani Sinha Reviewed-by: Michael Kelley Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20210713030522.1714803-1-ani@anisinha.ca Signed-off-by: Wei Liu commit 8b2ac51625ac96afd488d3ddd90c95c3417eb736 Author: Alexandru Ardelean Date: Wed Jun 30 15:30:29 2021 +0300 iio: hid-sensors: bind IIO channels alloc to device object Some HID drivers use devm_kmemdup() already to clone the template IIO channels information and update it. However, there are still some drivers that kmemdup() and kfree() the channels. This change converts them to use devm_kmemdup() and bind the life-time of this allocated object to the parent device object (in these drivers). Signed-off-by: Alexandru Ardelean Acked-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20210630123029.759609-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron commit 9f5827580749b1dbc3aa339b37aa67e8aab25ac9 Author: José Roberto de Souza Date: Mon Jul 12 17:38:54 2021 -0700 drm/i915/display/xelpd: Extend Wa_14011508470 This workaround is also applicable to xelpd display so extending it. Cc: Gwan-gyeong Mun Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-6-jose.souza@intel.com commit c86ef50f05c65f6c995156426dca29d47629e1be Author: José Roberto de Souza Date: Mon Jul 12 17:38:53 2021 -0700 drm/i915: Limit Wa_22010178259 to affected platforms This workaround is not needed for platforms with display 13. Cc: Gwan-gyeong Mun Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-5-jose.souza@intel.com commit 1d2b8fd93ed592db6498bfb428ea288441b0f3b2 Author: José Roberto de Souza Date: Mon Jul 12 17:38:49 2021 -0700 drm/i915/display: Settle on "adl-x" in WA comments Most of the places are using this format so lets consolidate it. v2: - split patch in two: display and non-display because of conflicts between drm-intel-gt-next x drm-intel-next Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-1-jose.souza@intel.com commit d19faf0e49eb6fe90e218b9ccfdabd61dc968b41 Author: Dwaipayan Ray Date: Tue Jul 13 12:21:30 2021 +0530 EDAC/amd64: Use DEVICE_ATTR helper macros Instead of "open coding" DEVICE_ATTR, use the corresponding helper macros DEVICE_ATTR_{RW,RO,WO} in amd64_edac.c Some function names needed to be changed to match the device conventions _show and _store, but the functionality itself is unchanged. The devices using EDAC_DCT_ATTR_SHOW() are left unchanged. Reviewed-by: Yazen Ghannam Signed-off-by: Dwaipayan Ray Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210713065130.2151-1-dwaipayanray1@gmail.com commit 5d4ed4f8b5efd347d761ee98c3a6e4e42e23f67e Author: José Roberto de Souza Date: Mon Jul 12 17:38:52 2021 -0700 drm/i915/adl_s: Extend Wa_1406941453 BSpec: 54370 Cc: Gwan-gyeong Mun Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-4-jose.souza@intel.com commit 28ec02c9cbebf3feeaf21a59df9dfbc02bda3362 Author: José Roberto de Souza Date: Mon Jul 12 17:38:51 2021 -0700 drm/i915: Implement Wa_1508744258 Same bit was required for Wa_14012131227 in DG1 now it is also required as Wa_1508744258 to TGL, RKL, DG1, ADL-S and ADL-P. Cc: Gwan-gyeong Mun Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-3-jose.souza@intel.com commit c492405860f78263e3a359c0a88385957a2729e9 Author: José Roberto de Souza Date: Mon Jul 12 17:38:50 2021 -0700 drm/i915: Settle on "adl-x" in WA comments Most of the places are using this format so lets consolidate it. v2: - split patch in two: display and non-display because of conflicts between drm-intel-gt-next x drm-intel-next Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210713003854.143197-2-jose.souza@intel.com commit 308ef2ad84928f74e391037706c7dc2901721666 Author: John Clements Date: Tue Jul 13 17:44:45 2021 +0800 drm/amdgpu: Resolve bug in UMC 6.7 error offset calculation Use correct channel and instance values Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit b05e50b35229732a278f8e5153bdb4156a550e4e Author: Aaron Liu Date: Tue Jul 13 14:54:47 2021 +0800 drm/amd/pm: Add waiting for response of mode-reset message for yellow carp Remove mdelay process and use smu_cmn_send_smc_msg_with_param to send mode-reset message to SMC. Signed-off-by: Aaron Liu Reviewed-by: Evan Quan Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 430f8e6edbaac8abfddf76f1aef732d9c6257211 Author: Eric Huang Date: Fri Jul 9 14:59:20 2021 -0400 Revert "drm/amdkfd: Add heavy-weight TLB flush after unmapping" This reverts commit 1098d658bef05e5fee634aab0b6a1fa590cfca24. Reason for revert: it causes regressions on several Asics. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 024d8811c90ed56d8b90cdcf71e51c9fedeff460 Author: Eric Huang Date: Fri Jul 9 14:58:16 2021 -0400 Revert "drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update" This reverts commit 075e8080c1a7571563171a07fa9ce47c4bc80044. Reason for revert: the related commit is reverted. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 7ed9876c9793bfe96fed58ba645d6c8e32f26001 Author: Eric Huang Date: Fri Jul 9 14:57:11 2021 -0400 Revert "drm/amdkfd: Make TLB flush conditional on mapping" This reverts commit 31f33243788dcbae8bd2819ed83923a73f7dfd30. Reason for revert: it causes regressions on several Asics. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 4e7b93ca52fb228b177168d436449c5671415a72 Author: Eric Huang Date: Fri Jul 9 14:55:03 2021 -0400 Revert "drm/amdgpu: Fix warning of Function parameter or member not described" This reverts commit 7a68d188d1c4a9d947369acaa19040a58baaaeda. Reason for revert: the related commit is reverted. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 4bba567c8c35a9cbcd16fb4780a0c3dfd162e08e Author: Eric Huang Date: Fri Jul 9 14:51:34 2021 -0400 Revert "drm/amdkfd: Add memory sync before TLB flush on unmap" This reverts commit 3be4dca197010d1328df8b11febc8c40491be498. Reason for revert: it causes regressions on several Asics. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit 53d0533049a573298f74ae07a39db14163960e68 Author: Eric Huang Date: Fri Jul 9 14:48:33 2021 -0400 Revert "drm/amdkfd: Only apply TLB flush optimization on ALdebaran" This reverts commit 51627f03804173a64d23828bc9e4d8474451814f. Reason for revert: it causes regression on Aldebaran. Signed-off-by: Eric Huang Signed-off-by: Alex Deucher commit d59682dffe8234bb657fe15f4ab5fb5e627432c4 Author: Chengming Gui Date: Fri Jul 9 16:23:48 2021 +0800 drm/amd/pm: Fix BACO state setting for Beige_Goby Correct BACO state setting for Beige_Goby Signed-off-by: Chengming Gui Reviewed-by: Jiansong Chen Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 3c727c1c45932f839eb5725a918a55f6ec2afb5a Author: Emily.Deng Date: Thu Oct 1 12:41:50 2020 +0800 drm/amdgpu: Restore msix after FLR After FLR, the msix will be cleared, so need to re-enable it. Signed-off-by: Peng Ju Zhou Signed-off-by: Emily.Deng Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 468f04cfbb4351be3f8188625f77f54de353215a Author: Felix Kuehling Date: Wed Jul 7 17:55:55 2021 -0400 drm/amdkfd: Allow CPU access for all VRAM BOs The thunk needs to mmap all BOs for CPU access to allow the debugger to access them. Invisible ones are mapped with PROT_NONE. Fixes: 71df0368e9b6 ("drm/amdgpu: Implement mmap as GEM object function") Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 904729b61c3775fb17b083a15ca99ffefc48131d Merge: 7c4ed5ded8538 0a427cc638ada Author: Steve French Date: Tue Jul 13 09:26:24 2021 -0500 Merge pull request #60 from namjaejeon/cifsd-for-next ksmbd-fixes commit 35d283658a6196b2057be562096610c6793e1219 Author: Daniel Vetter Date: Thu Jun 3 18:41:12 2021 +0200 drm/shmem-helper: Align to page size in dumb_create shmem helpers seem a bit sloppy here by automatically rounding up when actually creating the buffer, which results in under-reporting of what we actually have. Caught by igt/vgem_basic tests. Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210603164113.1433476-4-daniel.vetter@ffwll.ch commit 072ed3431f5ba20cccdaf57ee950e36b8693e235 Author: Douglas Anderson Date: Mon Jul 12 08:00:44 2021 -0700 drm/dp: Move panel DP AUX backlight support to drm_dp_helper We were getting a depmod error: depmod: ERROR: Cycle detected: drm_kms_helper -> drm -> drm_kms_helper It looks like the rule is that drm_kms_helper can call into drm, but drm can't call into drm_kms_helper. That means we've got to move the DP AUX backlight support into drm_dp_helper. NOTE: as part of this, I didn't try to do any renames of the main registration function. Even though it's in the drm_dp_helper, it still feels very parallel to drm_panel_of_backlight(). Fixes: 10f7b40e4f30 ("drm/panel: add basic DP AUX backlight support") Reported-by: Ville Syrjälä Reported-by: Thomas Zimmermann Signed-off-by: Douglas Anderson Reviewed-by: Rajeev Nandan Link: https://patchwork.freedesktop.org/patch/msgid/20210712075933.v2.1.I23eb4cc5a680341e7b3e791632a635566fa5806a@changeid commit b092b3efc7cb239b6f33bb97da0f8812680e1046 Author: Jan Kara Date: Thu Apr 22 16:52:32 2021 +0200 cifs: Fix race between hole punch and page fault Cifs has a following race between hole punching and page fault: CPU1 CPU2 smb3_fallocate() smb3_punch_hole() truncate_pagecache_range() filemap_fault() - loads old data into the page cache SMB2_ioctl(..., FSCTL_SET_ZERO_DATA, ...) And now we have stale data in the page cache. Fix the problem by locking out faults (as well as reads) using mapping->invalidate_lock while hole punch is running. CC: Steve French CC: linux-cifs@vger.kernel.org Signed-off-by: Jan Kara commit 057ba5b24532aca202cb1ae8c246bde27de12763 Author: Jan Kara Date: Thu Apr 22 16:38:26 2021 +0200 ceph: Fix race between hole punch and page fault Ceph has a following race between hole punching and page fault: CPU1 CPU2 ceph_fallocate() ... ceph_zero_pagecache_range() ceph_filemap_fault() faults in page in the range being punched ceph_zero_objects() And now we have a page in punched range with invalid data. Fix the problem by using mapping->invalidate_lock similarly to other filesystems. Note that using invalidate_lock also fixes a similar race wrt ->readpage(). CC: Jeff Layton CC: ceph-devel@vger.kernel.org Reviewed-by: Jeff Layton Signed-off-by: Jan Kara commit 8bcbbe9c7c8e49281fc2e0a6c5455b87c85a9c2a Author: Jan Kara Date: Wed Apr 21 17:18:39 2021 +0200 fuse: Convert to using invalidate_lock Use invalidate_lock instead of fuse's private i_mmap_sem. The intended purpose is exactly the same. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: Miklos Szeredi Reviewed-by: Miklos Szeredi Signed-off-by: Jan Kara commit edc6d01bad7331b376a1a8f5c6d8e9221e9f9f37 Author: Jan Kara Date: Tue Apr 13 18:10:37 2021 +0200 f2fs: Convert to using invalidate_lock Use invalidate_lock instead of f2fs' private i_mmap_sem. The intended purpose is exactly the same. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Acked-by: Chao Yu Signed-off-by: Jan Kara commit 448f94909eb7056e53c882b82514ea4f3adcf544 Author: Jan Kara Date: Tue Apr 13 09:38:27 2021 +0200 zonefs: Convert to using invalidate_lock Use invalidate_lock instead of zonefs' private i_mmap_sem. The intended purpose is exactly the same. CC: Damien Le Moal CC: Johannes Thumshirn CC: Acked-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit d2c292d84c4983424938f32c9c247f6ab8719769 Author: Jan Kara Date: Mon May 24 13:17:49 2021 +0200 xfs: Convert double locking of MMAPLOCK to use VFS helpers Convert places in XFS that take MMAPLOCK for two inodes to use helper VFS provides for it (filemap_invalidate_down_write_two()). Note that this changes lock ordering for MMAPLOCK from inode number based ordering to pointer based ordering VFS generally uses. CC: "Darrick J. Wong" Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit 2433480a7e1d0c057442b284c336cfaa61523117 Author: Jan Kara Date: Mon Apr 12 18:56:24 2021 +0200 xfs: Convert to use invalidate_lock Use invalidate_lock instead of XFS internal i_mmap_lock. The intended purpose of invalidate_lock is exactly the same. Note that the locking in __xfs_filemap_fault() slightly changes as filemap_fault() already takes invalidate_lock. Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong CC: CC: "Darrick J. Wong" Signed-off-by: Jan Kara commit e31cbde7ecdcfdf22eac6fd37e63548adacc4ede Author: Pavel Reichl Date: Fri Oct 16 04:10:02 2020 +0200 xfs: Refactor xfs_isilocked() Introduce a new __xfs_rwsem_islocked predicate to encapsulate checking the state of a rw_semaphore, then refactor xfs_isilocked to use it. Signed-off-by: Pavel Reichl Suggested-by: Dave Chinner Suggested-by: Eric Sandeen Suggested-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Jan Kara commit 70f3bad8c3154ba5f241c03f9c0cd050887a119c Author: Jan Kara Date: Mon Apr 12 18:43:11 2021 +0200 ext2: Convert to using invalidate_lock Ext2 has its private dax_sem used for synchronizing page faults and truncation. Use mapping->invalidate_lock instead as it is meant for this purpose. CC: Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit d4f5258eae7b38c2a28d0a7b28a6d0a8c1f9fe8e Author: Jan Kara Date: Thu Feb 4 18:05:42 2021 +0100 ext4: Convert to use mapping->invalidate_lock Convert ext4 to use mapping->invalidate_lock instead of its private EXT4_I(inode)->i_mmap_sem. This is mostly search-and-replace. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: CC: Ted Tso Acked-by: Theodore Ts'o Reviewed-by: Darrick J. Wong Signed-off-by: Jan Kara commit 7506ae6a7033f617ca5fea53e356fb1f7bd98010 Author: Jan Kara Date: Mon May 24 13:02:30 2021 +0200 mm: Add functions to lock invalidate_lock for two mappings Some operations such as reflinking blocks among files will need to lock invalidate_lock for two mappings. Add helper functions to do that. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit bbeb7461c7eed2c5a9a5e6174f388d8bda2b42e9 Author: Thomas Zimmermann Date: Mon Jul 5 09:46:33 2021 +0200 drm/vkms: Use dma-buf mapping from shadow-plane state for composing Store the shadow-buffer mapping's address in struct vkms_composer and use the value when composing the output. It's the same value as stored in the GEM SHMEM BO, but frees the composer code from its dependency on GEM SHMEM. Using struct dma_buf_map is how framebuffer access is supposed to be. The long-term plan is to perform all framebuffer access via struct dma_buf_map and avoid the details of accessing I/O and system memory. Signed-off-by: Thomas Zimmermann Reviewed-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210705074633.9425-5-tzimmermann@suse.de commit b43e2ec03b0de040d536591713ea9c875ff34ba9 Author: Thomas Zimmermann Date: Mon Jul 5 09:46:32 2021 +0200 drm/vkms: Let shadow-plane helpers prepare the plane's FB Replace vkms' prepare_fb and cleanup_fb functions with the generic code for shadow-buffered planes. No functional changes. This change also fixes a problem where IGT kms_flip tests would create a segmentation fault within vkms. The driver's prepare_fb function did not report an error if a BO's vmap operation failed. The kernel later tried to operate on the non-mapped memory areas. The shared shadow-plane helpers handle errors correctly, so that the driver now avoids the segmantation fault. v2: * include paragraph about IGT tests in commit message (Melissa) Signed-off-by: Thomas Zimmermann Reviewed-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210705074633.9425-4-tzimmermann@suse.de commit 7602d4221842c12777363591df04672e2c8b6a61 Author: Thomas Zimmermann Date: Mon Jul 5 09:46:31 2021 +0200 drm/vkms: Inherit plane state from struct drm_shadow_plane_state Subclass struct drm_shadow_plane_state for VKMS planes and update all plane-state callbacks accordingly. Signed-off-by: Thomas Zimmermann Reviewed-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210705074633.9425-3-tzimmermann@suse.de commit b715650220311e50448cb499c71084ca8aeeeece Author: Thomas Zimmermann Date: Mon Jul 5 09:46:30 2021 +0200 drm/gem: Export implementation of shadow-plane helpers Export the implementation of duplicate, destroy and reset helpers for shadow-buffered plane state. Useful for drivers that subclass struct drm_shadow_plane_state. The exported functions are wrappers around plane-state implementation, but using them is the correct thing to do for drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210705074633.9425-2-tzimmermann@suse.de commit a1867f85e06edacd82956d3422caa2b9074f4321 Author: Min Li Date: Fri Jun 18 12:37:12 2021 -0400 mfd: Add Renesas Synchronization Management Unit (SMU) support Add support for ClockMatrix(TM) and 82P33xxx families of timing and synchronization devices. The access interface can be either SPI or I2C. Currently, it will create 2 types of MFD devices, which are to be used by the corresponding rsmu character device driver and the PTP hardware clock driver, respectively. Signed-off-by: Min Li Signed-off-by: Lee Jones commit 6293eb28913f4faa81aadf91693f20abb7ca97dd Author: Thomas Zimmermann Date: Tue Jul 13 11:02:35 2021 +0200 Revert "drm/vgem: Implement mmap as GEM object function" Commit 375cca1cfeb5 ("drm/vgem: Implement mmap as GEM object function") broke several IGT tests in vgem_basic. [1] Attempts to fix the issue have not worked out so far. [2][3] Revert the change for now. Note that there is a patch that converts vgem to shmem helpers. [4] Merging this change would be preferable to modifying vgem's mmap code. v2: * fix spelling error in commit message (Daniel) [1] https://intel-gfx-ci.01.org/tree/drm-tip/igt@vgem_basic@unload.html [2] https://lore.kernel.org/intel-gfx/20210709154256.12005-1-tzimmermann@suse.de/ [3] https://lore.kernel.org/intel-gfx/20210712123321.3658-1-tzimmermann@suse.de/ [4] https://patchwork.freedesktop.org/series/90671/ Signed-off-by: Thomas Zimmermann Fixes: 375cca1cfeb5 ("drm/vgem: Implement mmap as GEM object function") Reviewed-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Christian König Cc: Daniel Vetter Cc: "Christian König" Cc: Jason Gunthorpe Cc: Melissa Wen Cc: Qinglang Miao Cc: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20210713090235.26372-1-tzimmermann@suse.de commit 730633f0b7f951726e87f912a6323641f674ae34 Author: Jan Kara Date: Thu Jan 28 19:19:45 2021 +0100 mm: Protect operations adding pages to page cache with invalidate_lock Currently, serializing operations such as page fault, read, or readahead against hole punching is rather difficult. The basic race scheme is like: fallocate(FALLOC_FL_PUNCH_HOLE) read / fault / .. truncate_inode_pages_range() Now the problem is in this way read / page fault / readahead can instantiate pages in page cache with potentially stale data (if blocks get quickly reused). Avoiding this race is not simple - page locks do not work because we want to make sure there are *no* pages in given range. inode->i_rwsem does not work because page fault happens under mmap_sem which ranks below inode->i_rwsem. Also using it for reads makes the performance for mixed read-write workloads suffer. So create a new rw_semaphore in the address_space - invalidate_lock - that protects adding of pages to page cache for page faults / reads / readahead. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit c625b4cc57d078b03fd8aa4d86c99d584a1782be Author: Jan Kara Date: Mon May 10 19:13:53 2021 +0200 documentation: Sync file_operations members with reality Sync listing of struct file_operations members with the real one in fs.h. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit 40bb0e3e270a33b03a39cdd77bf03fc18dfe2fab Author: Vaibhav Gupta Date: Thu Apr 2 21:20:58 2020 +0530 gpio: ml-ioh: Convert to dev_pm_ops Convert the legacy callback .suspend() and .resume() to the generic ones. While at it, replace ifdeffery by __maybe_unused attribute. Signed-off-by: Vaibhav Gupta Signed-off-by: Andy Shevchenko commit 0a427cc638ada13a703b044f38f4b01628c4e620 Author: Hyunchul Lee Date: Tue Jul 13 15:38:30 2021 +0900 ksmbd: fix an error message in ksmbd_conn_trasnport_init Fix an error message in ksmbd_conn_transport_init(). Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 03d8d4f1896eba2240aa946ce591e86e538504cd Author: Hyunchul Lee Date: Tue Jul 13 16:09:34 2021 +0900 ksmbd: set RDMA capability for FSCTL_QUERY_NETWORK_INTERFACE_INFO set RDMA capability for FSCTL_QUERY_NETWORK_INTERFACE_INFO. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 96ad4ec51c06c6fafc10b4e3a20753e127ce27d4 Author: Namjae Jeon Date: Tue Jul 13 17:17:28 2021 +0900 ksmbd: fix unused err value in smb2_lock CID 1502845 (#1 of 1): Unused value (UNUSED_VALUE) value_overwrite: Overwriting previous write to err with value from vfs_lock_file(filp, 0U, rlock, NULL). 6880 err = vfs_lock_file(filp, 0, rlock, NULL); 6881 if (err) 6882 pr_err("rollback unlock fail : %d\n", err); Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 78ad2c277af4cf503f985fd506fbb1f8576460f2 Author: Namjae Jeon Date: Tue Jul 13 17:12:41 2021 +0900 ksmbd: fix memory leak in ksmbd_vfs_get_sd_xattr() Add free acl.sd_buf and n.data on error handling in ksmbd_vfs_get_sd_xattr(). Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e9d66bdbc5abecaf705bf5a2f4f6279b9e313b0c Author: Geert Uytterhoeven Date: Wed Jun 30 16:50:43 2021 +0200 pinctrl: renesas: r8a77995: Add bias pinconf support Implement support for pull-up (most pins, excl. DU_DOTCLKIN0) and pull-down (most pins, excl. JTAG) handling for the R-Car D3 SoC, using some parts from the common R-Car bias handling, which requires making rcar_pin_to_bias_reg() public. R-Car D3 needs special handling for the NFRE# (GP_3_0) and NFWE# (GP_3_1) pins. Unlike all other pins, they are controlled by different bits in the LSI pin pull-up/down control register (PUD2) than in the LSI pin pull-enable register (PUEN2). Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/04aad2b0bf82a32fb08e5e21e4ac1fb03452724f.1625064076.git.geert+renesas@glider.be commit 7ebaa41047738d46fca6376b3f1765ef69c463c5 Author: Geert Uytterhoeven Date: Wed Jun 30 16:50:42 2021 +0200 pinctrl: renesas: rcar: Avoid changing PUDn when disabling bias When disabling pin bias, there is no need to touch the LSI pin pull-up/down control register (PUDn), which selects between pull-up and pull-down. Just disabling the pull-up/down function through the LSI pin pull-enable register (PUENn) is sufficient. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/071ec644de2555da593a4531ef5d3e4d79cf997d.1625064076.git.geert+renesas@glider.be commit f19b3967fb0967aa02b8bfe26ce186ca7525dff7 Author: Namjae Jeon Date: Tue Jul 13 09:59:34 2021 +0900 ksmbd: remove unneeded check_context_err Coverity Scan seems to report false alarm. *** CID 1505930: (USE_AFTER_FREE) /fs/ksmbd/smb2pdu.c: 2527 in smb2_open() >>> CID 1505930: (USE_AFTER_FREE) >>> Passing freed pointer "context" as an argument to >>> "check_context_err". This patch remove unneeded check_context_err to make coverity scan happy. Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 97eb31384af943d6b97eb5947262cee4ef25cb87 Author: Martynas Pumputis Date: Mon Jul 12 14:55:51 2021 +0200 libbpf: Fix reuse of pinned map on older kernel When loading a BPF program with a pinned map, the loader checks whether the pinned map can be reused, i.e. their properties match. To derive such of the pinned map, the loader invokes BPF_OBJ_GET_INFO_BY_FD and then does the comparison. Unfortunately, on < 4.12 kernels the BPF_OBJ_GET_INFO_BY_FD is not available, so loading the program fails with the following error: libbpf: failed to get map info for map FD 5: Invalid argument libbpf: couldn't reuse pinned map at '/sys/fs/bpf/tc/globals/cilium_call_policy': parameter mismatch" libbpf: map 'cilium_call_policy': error reusing pinned map libbpf: map 'cilium_call_policy': failed to create: Invalid argument(-22) libbpf: failed to load object 'bpf_overlay.o' To fix this, fallback to derivation of the map properties via /proc/$PID/fdinfo/$MAP_FD if BPF_OBJ_GET_INFO_BY_FD fails with EINVAL, which can be used as an indicator that the kernel doesn't support the latter. Signed-off-by: Martynas Pumputis Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20210712125552.58705-1-m@lambda.lt commit b48c7236b13cb5ef1b5fdf744aa8841df0f7b43a Author: Eric W. Biederman Date: Tue Jun 29 15:11:44 2021 -0500 exit/bdflush: Remove the deprecated bdflush system call The bdflush system call has been deprecated for a very long time. Recently Michael Schmitz tested[1] and found that the last known caller of of the bdflush system call is unaffected by it's removal. Since the code is not needed delete it. [1] https://lkml.kernel.org/r/36123b5d-daa0-6c2b-f2d4-a942f069fd54@gmail.com Link: https://lkml.kernel.org/r/87sg10quue.fsf_-_@disp2133 Tested-by: Michael Schmitz Acked-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Acked-by: Cyril Hrubis Signed-off-by: "Eric W. Biederman" commit 3667bbd7829059870dff1b6cb4c8eca5aa80e24d Author: Sam Ravnborg Date: Sat Jul 10 10:42:40 2021 +0200 drm: bridge: Mark deprecated operations in drm_bridge_funcs drm_bridge_funcs includes several duplicated operations as atomic variants have been added over time. New bridge drivers shall use the atomic variants - mark the deprecated operations to try to avoid usage in new bridge drivers. v2: - Drop out-dated comment about state in mode_set (Laurent) - Added missing "the" in a description Signed-off-by: Sam Ravnborg Cc: Laurent Pinchart Cc: Andrzej Hajda Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Acked-by: Maxime Ripard Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210710084240.281063-1-sam@ravnborg.org commit ba3f5839fbeb3f9e65070d90aa4e66008bbea80f Author: Michael Kelley Date: Sun Jul 11 19:50:04 2021 -0700 asm-generic/hyperv: Add missing #include of nmi.h The recent move of hv_do_rep_hypercall() to this file adds a reference to touch_nmi_watchdog(). Its function definition is included indirectly when compiled on x86, but not when compiled on ARM64. So add the explicit #include. No functional change. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1626058204-2106-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 9608703e488cf7a711c42c7ccd981c32377f7b78 Author: Jan Kara Date: Mon Apr 12 15:50:21 2021 +0200 mm: Fix comments mentioning i_mutex inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex. Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Acked-by: Hugh Dickins Signed-off-by: Jan Kara commit ef668f2790e966c43ff7e13cbedce98ff9da1f7b Author: Yongqiang Niu Date: Sun Jul 11 14:53:51 2021 +0800 drm/mediatek: Adjust rdma fifo threshold calculate formula The orginal formula will caused rdma fifo threshold config overflow and no one could come out a solution for all SoC, set threshold to 70% of max fifo size to make sure it will not overflow, and 70% is a empirical vlaue. Signed-off-by: Yongqiang Niu Signed-off-by: Chun-Kuang Hu commit b557a5f8da5798d27370ed6b73e673aae33efd55 Author: Julia Lawall Date: Fri Jul 9 22:07:17 2021 +0200 drm/of: free the right object There is no need to free a NULL value. Instead, free the object that is leaking due to the iterator. The semantic patch that finds this problem is as follows: // @@ expression x,e; identifier f; @@ x = f(...); if (x == NULL) { ... when any when != x = e * of_node_put(x); ... } // Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Signed-off-by: Julia Lawall Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210709200717.3676376-1-Julia.Lawall@inria.fr commit 379e205dab9d7f9761984728e7d6f5f8305cc424 Author: Uwe Kleine-König Date: Sat Jun 12 11:13:51 2021 +0200 media: usb: dvb-usb-v2: af9035: let subdrv autoselect enable si2168 and si2157 The Logilink VG0022A DVB-T2 stick has these three devices. So to enable support for this stick in the presence of MEDIA_SUBDRV_AUTOSELECT, let DVB_USB_AF9035 select the two other drivers. Signed-off-by: Uwe Kleine-König Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 73415d70192a9092102b4842f6ec6e0bb7109084 Author: Uwe Kleine-König Date: Sat Jun 12 11:13:50 2021 +0200 media: usb: dvb-usb-v2: af9035: report if i2c client isn't bound If a sub device doesn't immediately bind after it was added, emit an error indication to the kernel log to help debugging. This happens for example if the needed driver isn't available at all. Signed-off-by: Uwe Kleine-König Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 4acb04dc90aa285c3d3ea3009b03c3b6b8858f94 Author: lijian Date: Fri Jun 18 09:17:57 2021 +0200 media: dvb-frontends: cx24117: Delete 'break' after 'goto' break is not useful after a goto, so delete 'break' after 'goto'. Signed-off-by: lijian Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit dcb0145821017e929a733e2271c85c6f82b9c9f8 Author: Christophe JAILLET Date: Thu Jun 10 21:54:31 2021 +0200 media: cxd2880-spi: Fix an error handling path If an error occurs after a successful 'regulator_enable()' call, 'regulator_disable()' must be called. Fix the error handling path of the probe accordingly. Fixes: cb496cd472af ("media: cxd2880-spi: Add optional vcc regulator") Signed-off-by: Christophe JAILLET Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 86541f0480b574cf299563156ac22ebf266ea5ec Author: lijian Date: Thu Jun 10 11:27:25 2021 +0200 media: rc: rc-main.c: deleted the repeated word deleted the repeated word 'the' in the comments. Signed-off-by: lijian Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit adb08a09230b8e7337dc162815288a189e9ee30f Author: lijian Date: Thu Jun 10 05:24:13 2021 +0200 media: rc: redrat3: Fix a typo Change 'an' to 'on'. Signed-off-by: lijian Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit e5dd86446fe3ed91b696bb4eced78631f7c7a7d4 Author: lijian Date: Thu Jun 10 05:15:04 2021 +0200 media: rc: streamzap: Removed unnecessary 'return' Removed unnecessary 'return'. Signed-off-by: lijian Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit f4a87d54c5895a822b4b8ef518dd4f115e30a604 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:45 2021 +0200 media: ti-vpe: cal: add embedded data support Add support for capturing embedded data from the sensor. The only difference with capturing pixel data and embedded data is that we need to ensure the PIX PROC is disabled for embedded data so that CAL doesn't repack the data. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 71e3a18114ebdb48482d731d04bff7a222036381 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:44 2021 +0200 media: ti-vpe: cal: allow more than 1 source pads CAL RX has a single sink and a single source pad. To support multiple streams, we will have multiple source pads (up to 8, one for each CAL context). Change the driver to allow creating more source pads and change the code accordingly to handle multiple source pads. We still keep CAL_CAMERARX_NUM_SOURCE_PADS as 1, and the behavior is unchanged. Also rename CAL_CAMERARX_PAD_SOURCE to CAL_CAMERARX_PAD_FIRST_SOURCE to highlight that it's the first source. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9eaca40c0d13a21848b5a35dc8c37dc3690a4ff1 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:43 2021 +0200 media: ti-vpe: cal: add camerarx enable/disable refcounting The following patches add multistream support and we will have multiple video devices using the same camerarx instances. Thus we need enable/disable refcounting for the camerarx. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6cb0eee34c24b0052da554ff2ef9def8a10bbf96 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:42 2021 +0200 media: ti-vpe: cal: add camerarx locking We don't have any locking in camerarx for the subdev ops. We have managed fine so far without locking, but in the future multiple video capture devices can use the same camerarx, and locking is a must. Add a mutex to protect the camerarx subdev ops. Some of the functions were slightly restructured to make lock handling cleaner. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 892c37f8a3d673b945e951a8754695c119a2b1b0 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:41 2021 +0200 media: ti-vpe: cal: fix queuing of the initial buffer When starting streaming the driver currently programs the buffer address to the CAL base-address register and assigns the buffer pointer to ctx->dma.pending. This is not correct, as the buffer is not "pending", but active, and causes the first buffer to be needlessly written twice. Fix this by assigning the buffer pointer to ctx->dma.active. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9e67f24e4d90858bfec2dbac84d5380db3926bd5 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:40 2021 +0200 media: ti-vpe: cal: fix ctx uninitialization Somewhere along the way the context uninitialization has gone a bit odd: * We have cal_ctx_create() but no matching destroy call, but we still need to call cal_ctx_v4l2_cleanup() for each context. * We have cal_media_cleanup() which calls cal_ctx_v4l2_cleanup() for all contexts, but cal_media_init() is not where the contexts are created. * The order of uninit steps in cal_remove() is different than the error handling path in cal_probe(). * cal_probe()'s error handling calls cal_ctx_v4l2_cleanup() for each context, but also calls cal_media_clean(), doing the same context cleanup twice. So fix these, by introducing cal_ctx_destroy(), and using that in appropriate places instead of calling cal_ctx_v4l2_cleanup() in cal_media_clean(). Also use normal kzalloc (and kfree) instead of devm version as we anyway do manual cleanup for each context. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b65836f40a748f14f402135a28fa75c6cca3e3fb Author: Tomi Valkeinen Date: Mon Jun 14 13:23:39 2021 +0200 media: ti-vpe: cal: cleanup phy iteration in cal_remove Most of the driver has moved from ARRAY_SIZE(cal->phy) to cal->data->num_csi2_phy, but we have one place left in cal_remove. Also, checking for cal->phy[i] != NULL is not needed as we always have all the phys instantiated. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 75e7e58bfac11714159049c7f8c01f57cf7f39f2 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:38 2021 +0200 media: ti-vpe: cal: support 8 DMA contexts The current driver only ever needs 2 DMA contexts (one per PHY), but we need to use more of the 8 contexts to add support for multiple streams. Change the code so that we allocate DMA contexts as needed, which at this time is 1 per PHY, but could be up to 8. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2e7e09a902c6e4121a91a2f9d597228474cabe4c Author: Tomi Valkeinen Date: Mon Jun 14 13:23:37 2021 +0200 media: ti-vpe: cal: remove cal_camerarx->fmtinfo struct cal_camerarx has fmtinfo field which is used to point to the current active input format. The only place where the field is used is cal_camerarx_get_ext_link_freq(). With multiple streams the whole concept of single input format is not valid anymore, so lets remove the field by looking up the format in cal_camerarx_get_ext_link_freq(), making it easier to handle the multistream-case in the following patches. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8bfd1af2fdd193017c1bdbae7c3f5aab027e5282 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:36 2021 +0200 media: ti-vpe: cal: init ctx->v_fmt correctly in MC mode CAL driver enumerates mbus codes in the connected subdev to create a list of supported formats reported to userspace, and initializes ctx->v_fmt and ctx->fmtinfo to one of those formats. This works fine for legacy mode, but is not correct for MC mode, and the list is not even used in MC mode. Fix this by adding a new function, cal_ctx_v4l2_init_mc_format, which only initializes ctx->v_fmt and ctx->fmtinfo to a default value. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e6a800d63a1239887dfe1b19d10b69ab7ff85f9a Author: Tomi Valkeinen Date: Mon Jun 14 13:23:35 2021 +0200 media: ti-vpe: cal: rename non-MC funcs to cal_legacy_* To make it more obvious if the function in question is dealing with media-controller API or the legacy API, rename legacy API functions to cal_legacy_*. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7f9f8123212d090a89a0e3db794a684bbf3a6b1d Author: Tomi Valkeinen Date: Mon Jun 14 13:23:34 2021 +0200 media: ti-vpe: cal: add mbus_code support to cal_mc_enum_fmt_vid_cap Commit e5b6b07a1b45 ("media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices") added support to enumerate formats based on mbus-code. Add this feature to cal driver. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d3409a65735e617c425dcbcb7ba312d894547152 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:33 2021 +0200 media: ti-vpe: cal: fix typo in a comment Fix a typo in a comment in cal_camerarx_sd_set_fmt(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2a1c55d4762dd34a8b0f2e36fb01b7b16b60735b Author: Geert Uytterhoeven Date: Mon Feb 8 15:38:55 2021 +0100 soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally Merely enabling CONFIG_COMPILE_TEST should not enable additional code. To fix this, restrict the automatic enabling of ROCKCHIP_GRF to ARCH_ROCKCHIP, and ask the user in case of compile-testing. Fixes: 4c58063d4258f6be ("soc: rockchip: add driver handling grf setup") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20210208143855.418374-1-geert+renesas@glider.be Signed-off-by: Heiko Stuebner commit 37fa1d2a5c0502b97172e297eae06917b98d1f70 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:32 2021 +0200 media: ti-vpe: cal: set field always to V4L2_FIELD_NONE cal_camerarx_sd_set_fmt() accepts any value for the format field, but there should be no reason to have any other value accepted than V4L2_FIELD_NONE. So set the field always to V4L2_FIELD_NONE. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a6c9aad96508d31732cba7f0855a7f21ddf65eae Author: Tomi Valkeinen Date: Mon Jun 14 13:23:31 2021 +0200 media: ti-vpe: cal: handle cal_ctx_v4l2_register error cal_async_notifier_complete() doesn't handle errors returned from cal_ctx_v4l2_register(). Add the error handling. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7d167e68d8c790ed8afafd772c3fe77e8aeb55bd Author: Tomi Valkeinen Date: Mon Jun 14 13:23:30 2021 +0200 media: ti-vpe: cal: add vc and datatype fields to cal_ctx In preparation for supporting multiple virtual channels and datatypes, add vc and datatype fields to cal_ctx, initialize them to the currently used values, and use those fields when writing to the register. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 27757876d1738a2dd528986c8143192f84eaa58a Author: Takashi Iwai Date: Mon Jul 12 11:36:41 2021 +0200 ALSA: intel8x0: Skip ac97 clock measurement on VM The intel8x0 driver tries to measure the AC97 bus clock at the probe time because there have been machines that are driven in different rate (44.1kHz vs 48kHz). This was the past and currently most of usages of this driver are on VM, and those are certainly fixed with 48k clock, hence it's useless and waste of time to measure. This patch is an optimization, setting the fixed 48k rate if it's detected to be running on a VM. Link: https://lore.kernel.org/r/20210712093641.29079-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4ff19229487f965118c6f14090edcc8cb6108605 Author: Takashi Iwai Date: Mon Jul 12 11:35:51 2021 +0200 ALSA: hda/hdmi: Add option to enable all pins forcibly On Intel platforms, we always enable all pins no matter what BIOS sets, but for others, we still take the conservative approach, and the HD-audio HDMI codec driver enables the streams only for the pins that are enabled by BIOS, and skips the disabled pins. This seems not good for some machines that have (as expected) broken BIOS, resulting in the lack of needed outputs. There is an allow-list in the driver code to enable all pins, but its addition needs a recompilation. This patch adds a module option for user's convenience to enable all pins forcibly on the fly. User can pass snd_hda_codec_hdmi.enable_all_pins=1 option for testing, and once confirmed, we may add a static entry in force_connect_list[]. Link: https://lore.kernel.org/r/20210712093551.29007-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 82a60352c2d3ef06815d4ddfd85d5506b5758804 Author: Takashi Iwai Date: Mon Jul 12 11:19:15 2021 +0200 ALSA: x86: simplify with sync_stop PCM ops The reset procedure in had_do_reset() is exactly for the recently introduced PCM sync_stop ops. Replace the call with the new ops and clean up the unnecessary code and flags. Link: https://lore.kernel.org/r/20210712091915.28067-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3b0f7eeff697b04571a5c6329b7e8fdf8f8c85d9 Author: Takashi Iwai Date: Mon Jul 12 11:19:04 2021 +0200 ALSA: ice1724: Remove superfluous loop over model table The ice1724 driver looks for the matching card_info entry twice, once at reading EEPROM and another for the rest tasks in the probe call. Reduce the second one by referring to the already assigned card_info entry. Link: https://lore.kernel.org/r/20210712091904.28022-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2d52c5dd8e80b50501af51d3c03e4e649d31adbe Author: Colin Ian King Date: Fri Jul 9 16:29:38 2021 +0100 ALSA: hda/ca0132: remove redundant initialization of variable status The variable status is being initialized with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210709152938.460763-1-colin.king@canonical.com Signed-off-by: Takashi Iwai commit 1a7adfda349e9211b816928eecd5246e44f2f74d Author: Tomi Valkeinen Date: Mon Jun 14 13:23:29 2021 +0200 media: ti-vpe: cal: add cal_ctx_wr_dma_enable and fix a race I have not noticed any errors due to this, but the DMA configuration looks racy. Setting the DMA mode bitfield in CAL_WR_DMA_CTRL supposedly enables the DMA. However, the driver currently a) continues configuring the DMA after setting the mode, and b) enables the DMA interrupts only after setting the mode. This probably doesn't cause any issues as there should be no data coming in to the DMA yet, but it's still better to fix this. Add a new function, cal_ctx_wr_dma_enable(), to set the DMA mode field, and call that function only after the DMA config and the irq enabling has been done. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8927a9f642fd999df0f4e489ee5e52430358b725 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:28 2021 +0200 media: ti-vpe: cal: add 'use_pix_proc' field We already have functions to reserve and release a pix proc unit, but we always reserve such and the code expects the pix proc unit to be used. Add a new field, 'use_pix_proc', to indicate if the pix prox unit has been reserved and should be used. Use the flag to skip programming pix proc unit when not needed. Note that we still always set the use_pix_proc flag to true. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4cb3a0f3896d9ad1d19efb25fd00a58ae6667a95 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:27 2021 +0200 media: ti-vpe: cal: allocate pix proc dynamically CAL has 4 pixel processing units but the units are not needed e.g. for metadata. As we could be capturing 4 pixel streams and 4 metadata streams, i.e. using 8 DMA contexts, we cannot assign a pixel processing unit to every DMA context. Instead we need to reserve a pixel processing unit only when needed. Add functions to reserve and release a pix proc unit, and use them in cal_ctx_prepare/unprepare. Note that for the time being we still always reserve a pix proc unit. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 38f7435f13049fb9f721fbed30d2ca3c3ddfbd6a Author: Tomi Valkeinen Date: Mon Jun 14 13:23:26 2021 +0200 media: ti-vpe: cal: disable csi2 ctx and pix proc at ctx_stop Disable CSI2 context and pix proc in cal_ctx_stop() to ensure they are not used if the same context is used later on a different PHY or without pix proc. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit af981fc2e6ca2a8a59ed967e50c8b5875e36fa68 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:25 2021 +0200 media: ti-vpe: cal: remove wait when stopping camerarx Asserting ComplexIO reset seems to affect the HW (ie. asserting reset will break an active capture), but the RESET_DONE bit never changes to "reset is ongoing" state. Thus we always get a timeout. Drop the wait, as it seems to achieve nothing. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3b1fe1abbba2869239e0f55f9616624b7d99ab52 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:24 2021 +0200 media: ti-vpe: cal: catch VC errors CAL driver currently ignores VC related errors. To help catch error conditions, enable all the VC error interrupts and handle them in the interrupt handler by printing an error. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aece634d978c7bc570ec5399184cd7df4f5498e6 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:23 2021 +0200 media: ti-vpe: cal: clean up CAL_CSI2_VC_IRQ_* macros The macros related to CAL_CSI2_VC_IRQ can be handled better by having the VC number as a macro parameter. Note that the macros are not used anywhere yet, so no other changes are needed. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2eef9ee3c60010edd78ec961b4f7971e328e3e5e Author: Tomi Valkeinen Date: Mon Jun 14 13:23:22 2021 +0200 media: ti-vpe: cal: rename CAL_HL_IRQ_MASK CAL_HL_IRQ_MASK macro is used for both WDMA start and end status bits. For clarity, rename CAL_HL_IRQ_MASK macro to CAL_HL_IRQ_WDMA_END_MASK and CAL_HL_IRQ_WDMA_START_MASK. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 42a1364ce738ffd02957f1b1e6e863e62398412e Author: Tomi Valkeinen Date: Mon Jun 14 13:23:21 2021 +0200 media: ti-vpe: cal: rename cal_ctx->index to dma_ctx Rename cal_ctx->index to dma_ctx to clarify that the field refers to the DMA context number. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0de6f41a06b8b69f2230a0488fde1703e55f0f39 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:20 2021 +0200 media: ti-vpe: cal: Add pixel processing context CAL has 4 pixel processing contexts (PIX PROC) of which the driver currently uses pix proc 0 for PHY0, and pix proc 1 for PHY1 (as the driver supports only a single source per PHY). Add a pix_proc field to cal_ctx to allow us to use different pix proc contexts in the future Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6266ddefec0f89507b6099d1ad0a695f2ffea6b6 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:19 2021 +0200 media: ti-vpe: cal: Add CSI2 context CAL has 8 CSI2 contexts per PHY, which are used to tag the incoming data. The current driver only uses the first context, but we need to support all of them to implement multi-stream support. Add a csi2_ctx field to cal_ctx, which indicates which of the 8 CSI2 contexts is used for the particular cal_ctx. Also clean up the context register macros to take the CSI2 context number as a parameter. Note that before this patch the CSI2 context used for both PHYs was always 0. This patch always uses cal_ctx index number as the CSI2 context. There is no functional difference, but this approach will work also in the future when we use more than 1 CSI2 context per PHY. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 05b12b557234995aa77083d3c6c373832816c01f Author: Tomi Valkeinen Date: Mon Jun 14 13:23:18 2021 +0200 media: ti-vpe: cal: change index and cport to u8 cal_ctx's index and cport fields are numbers less than 8. In the following patches we will get a bunch of new fields, all of which are similar small numbers, so lets change the type to u8. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2e63c4c57aff0e2972eaed126b8b64bfd9ed4604 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:17 2021 +0200 media: ti-vpe: cal: add cal_ctx_prepare/unprepare In the following patches we need to do context configuration which might fail. Add new functions, cal_ctx_prepare and cal_ctx_unprepare, to handle such configuration. [hverkuil: fix spurious newline checkpatch warning] Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bbdb9ae8d470715f85a690d7d2c7b54e7cff9cd6 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:16 2021 +0200 media: ti-vpe: cal: use v4l2_get_link_freq CAL driver uses V4L2_CID_PIXEL_RATE to get the required pixel rate, and then changes that value to link rate before configuring the registers. Rewrite the code to use v4l2_get_link_freq(), which simplifies the code as we get the link rate directly, and it also adds support for V4L2_CID_LINK_FREQ. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 93080e25a86d20ab875ffc278fa9c67f941f651e Author: Tomi Valkeinen Date: Mon Jun 14 13:23:15 2021 +0200 media: ti-vpe: cal: move global config from cal_ctx_wr_dma_config to runtime resume For some reason CAL_CTRL is written at the end of cal_ctx_wr_dma_config. CAL_CTRL is a global (for CAL) register, so it should be independent of contexts. Move the code to cal_runtime_resume(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 27f86b9bff79e15ffdb047c2457b1b56417fe4fd Author: Tomi Valkeinen Date: Mon Jun 14 13:23:14 2021 +0200 media: ti-vpe: cal: rename "sensor" to "source" CAL driver uses "sensor" name to refer to the subdev connected to CAL. As the subdev can also be a bridge, the naming is misleading and might cause the reader to think it refers to the actual sensor at the end of the pipeline. Rename "sensor" to "source". Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 97a2c65e2f21ac02807983b9602de2c82c25d0f7 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:13 2021 +0200 media: ti-vpe: cal: remove unused cal_camerarx->dev field cal_camerarx->dev field is not used, remove it. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 918d6d120a60c2640263396308eeb2b6afeb0cd6 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:12 2021 +0200 media: ti-vpe: cal: fix error handling in cal_camerarx_create cal_camerarx_create() doesn't handle error returned from cal_camerarx_sd_init_cfg(). Fix this. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4e11f02f6f9e10015ca07dd016359d2cde9cfbe7 Author: Tomi Valkeinen Date: Mon Jun 14 13:23:11 2021 +0200 media: ti-vpe: cal: add g/s_parm for legacy API v4l2-compliance complains about g/s_parm when using the non-MC API. Fix it by adding the functions and just call v4l2_s/g_parm_cap for the phy subdev. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 65ab894f2e5a0451609d13397f0ccb3ba5b332e9 Merge: 162a31effc418 7ceb0b8a3cedd Author: Mark Brown Date: Mon Jul 12 11:30:37 2021 +0100 Merge series "spi: stm32: various fixes & cleanup" from Alain Volmat : This series contains fixes & cleanup mainly regarding fifo and the way end of transfer triggered, when used with or without DMA. An additional patch cleans up the pm_runtime calls and another one enables the autosuspend. v2: - split pm_runtime fix patch into two - correct revert commit subject line Alain Volmat (6): spi: stm32: fixes pm_runtime calls in probe/remove spi: stm32: enable pm_runtime autosuspend spi: stm32h7: fix full duplex irq handler handling spi: stm32: Revert "properly handle 0 byte transfer" spi: stm32h7: don't wait for EOT and flush fifo on disable spi: stm32: finalize message either on dma callback or EOT Amelie Delaunay (1): spi: stm32h7: rework rx fifo read function drivers/spi/spi-stm32.c | 146 +++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 85 deletions(-) -- 2.25.1 commit 9705c49c3b5e8640fa1afd24f93a391ac0f793a4 Merge: 2c8dad1ea815f 4d9f4d1de3ceb Author: Mark Brown Date: Mon Jul 12 11:30:35 2021 +0100 Merge series "regulator: devres: remove unused device-managed unregister APIs" from Alexandru Ardelean : These APIs aren't used anywhere and most-likely exist because of the general principle of C APIs, where if an API function does an allocation/registration, it must also have an equivalent deallocation/deregistration counterpart. For devm_ functions this isn't all that true (for all cases), as the idea of these function is to provide an auto-cleanup logic on drivers/system de-init. Removing these discourages any weird logic that could be created with such an API functions. Alexandru Ardelean (4): regulator: devres: remove devm_regulator_unregister_notifier() function regulator: devres: remove devm_regulator_unregister() function regulator: devres: remove devm_regulator_bulk_unregister_supply_alias() regulator: devres: unexport devm_regulator_unregister_supply_alias() drivers/regulator/devres.c | 105 +---------------------------- include/linux/regulator/consumer.h | 23 ------- include/linux/regulator/driver.h | 1 - 3 files changed, 2 insertions(+), 127 deletions(-) -- 2.31.1 commit 2c8dad1ea815f1a2003f501d9f71b9d9961f2f3a Merge: fedbfea13cc0e e8608f8956ff4 Author: Mark Brown Date: Mon Jul 12 11:30:34 2021 +0100 Merge series "Move Hisilicon 6421v600 SPMI and USB drivers out of staging" from Mauro Carvalho Chehab : Hi Greg, As promised, that's the version 11, meant to be applied after -rc1. It depends on a regression fix patch merged via the regulator's tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git/commit/?h=for-5.14&id=5db5dd5be70eaf808d9fd90174b957fc5c2912cb (the dependence is just because of a trivial merge conflict) This series contain the final bits needed for the USB3 bus to work without staging drivers on Hikey 970. Mauro Carvalho Chehab (8): staging: hi6421-spmi-pmic: add a missing dot at copyright regulator: hi6421v600-regulator: add a missing dot at copyright staging: hikey9xx: split hi6421v600 irq into a separate driver staging: hi6421-spmi-pmic: cleanup drvdata staging: hi6421-spmi-pmic: rename spmi_device struct mfd: hi6421-spmi-pmic: move driver from staging dts: hisilicon: add support for the PMIC found on Hikey 970 dts: hisilicon: add support for USB3 on Hikey 970 .../mfd/hisilicon,hi6421-spmi-pmic.yaml | 134 ++++++++ MAINTAINERS | 7 + .../boot/dts/hisilicon/hi3670-hikey970.dts | 129 ++++++-- arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 56 ++++ .../boot/dts/hisilicon/hikey970-pmic.dtsi | 87 +++++ drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/hi6421-spmi-pmic.c | 66 ++++ drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 1 + drivers/misc/hi6421v600-irq.c | 313 ++++++++++++++++++ drivers/regulator/hi6421v600-regulator.c | 12 +- drivers/staging/Kconfig | 2 - drivers/staging/Makefile | 1 - drivers/staging/hikey9xx/Kconfig | 19 -- drivers/staging/hikey9xx/Makefile | 3 - drivers/staging/hikey9xx/TODO | 5 - drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 311 ----------------- .../hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 134 -------- include/linux/mfd/hi6421-spmi-pmic.h | 30 -- 20 files changed, 807 insertions(+), 530 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml create mode 100644 arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi create mode 100644 drivers/mfd/hi6421-spmi-pmic.c create mode 100644 drivers/misc/hi6421v600-irq.c delete mode 100644 drivers/staging/hikey9xx/Kconfig delete mode 100644 drivers/staging/hikey9xx/Makefile delete mode 100644 drivers/staging/hikey9xx/TODO delete mode 100644 drivers/staging/hikey9xx/hi6421-spmi-pmic.c delete mode 100644 drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml delete mode 100644 include/linux/mfd/hi6421-spmi-pmic.h -- 2.31.1 commit eb82bae1a0025172a01718ae21e9782132ce076e Merge: f537ab5fc7ce1 0238bcf80e972 Author: Mark Brown Date: Mon Jul 12 11:30:32 2021 +0100 Merge series "ASoC: ti: davinci-mcasp: Fix the DIT mode and OMAP4 support" from Peter Ujfalusi : Hi, Changes since v1: - Do not calculat that we allow one serializer in DIT mode, just set the max_active_serializers to 1. Reported-by: kernel test robot it has been on my todo list for several years to support McASP on OMAP4 devices. For Galaxy Nexus we had an omap-mcasp driver (which was mostly a stripped down davinci-mcasp driver) to support what was needed on that specific phone + it's dock for S/PDIF (48KHz, 16bit, stereo). Not many (if any) device available to test the DIT mode of McASP. I have used BeagleBone White (McASP1 AXR3 can be routed to a pin) to get the S/PDIF mode working then PandaES for OMAP4 support (on PandaES the gpio_121 is not used and the signal is routed to expansion J6 pin14). In theory the McASP in OMAP5 should be working after this series, but the OMAP5 TRM is not public and I do not have one to check the addresses and see if there is a way to test it on omap5-uevm. Mark, Tony: The ASoC and dts patches can go via separate tree I felt that it is better if they are together, at least initially. Nikolaus: fyi, this might be useful for Pyra? Regards, Péter --- Peter Ujfalusi (5): ASoC: ti: davinci-mcasp: Fix DIT mode support ASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4 ASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP ARM: dts: omap4-l4-abe: Correct sidle modes for McASP ARM: dts: omap4-l4-abe: Add McASP configuration .../bindings/sound/davinci-mcasp-audio.txt | 1 + arch/arm/boot/dts/omap4-l4-abe.dtsi | 39 ++-- include/linux/platform_data/davinci_asp.h | 1 + sound/soc/ti/Kconfig | 1 + sound/soc/ti/davinci-mcasp.c | 176 +++++++++++++++--- 5 files changed, 175 insertions(+), 43 deletions(-) -- 2.32.0 commit f537ab5fc7ce1ff0aaa1d7de26653eb9b56fd8d3 Merge: b8deadf3d99e5 19f479c37f76e Author: Mark Brown Date: Mon Jul 12 11:30:31 2021 +0100 Merge series "Fix unbalanced pm_runtime_enable in error handle" from Zhang Qilong : This two patches fixed the unbalanced PM disable depth. It could avoid pm_runtime implementation complains when removing and probing again the driver. Zhang Qilong (2): ASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in mt8192_afe_pcm_dev_probe ASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in mt8183_afe_pcm_dev_probe sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 43 ++++++++++++++-------- sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 27 +++++++++----- 2 files changed, 44 insertions(+), 26 deletions(-) -- 2.31.1 commit b8deadf3d99e51ff18ca45c1fd496916a576c26e Merge: f7c4fe9cffb0b 837ad6da36ba7 Author: Mark Brown Date: Mon Jul 12 11:30:30 2021 +0100 Merge series "ASoC: Intel: machine driver corrections" from Pierre-Louis Bossart : The first fix solves an underflow in SoundWire platforms using the max98373 amplifier, the rest of the patches are minor corrections in machine drivers. The fix should be queued for the 5.14 cycle, the rest should be harmless but can be deferred for 5.15 if it's too late already. Brent Lu (2): ASoC: SOF: add a helper to get topology configured bclk ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency Gongjun Song (1): ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP Rander Wang (1): ASoC: Intel: boards: fix xrun issue on platform with max98373 include/sound/sof.h | 1 + sound/soc/intel/boards/sof_cs42l42.c | 8 +- sound/soc/intel/boards/sof_sdw_max98373.c | 81 ++++++++++++------- .../intel/common/soc-acpi-intel-tgl-match.c | 15 ++++ sound/soc/sof/sof-audio.c | 42 ++++++++-- 5 files changed, 111 insertions(+), 36 deletions(-) -- 2.25.1 commit 114956518c85f4e93c298749b35b46b2e78a2ec9 Author: Bilal Wasim Date: Thu Jul 1 11:40:23 2021 +0200 soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD The mfg_async power domain in mt8173 is used to power up imgtec gpu. This domain requires the da9211 regulator to be enabled before the power domain can be enabled successfully. Signed-off-by: Bilal Wasim Signed-off-by: Enric Balletbo i Serra Reviewed-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20210701114012.RESEND.2.I2e1bf1b589f9138ba6f89791ed9f1e9f3ddd0a5d@changeid Signed-off-by: Matthias Brugger commit fb6d1d3b25d254602fa3318cd5b874f79ad9f3b7 Author: Bilal Wasim Date: Thu Jul 1 11:40:22 2021 +0200 soc: mediatek: pm-domains: Use correct mask for bus_prot_clr When "bus_prot_reg_update" is true, the driver should use INFRA_TOPAXI_PROTECTEN for both setting and clearing the bus protection. However, the driver does not use this mask for clearing bus protection which causes failure when booting the imgtec gpu. Corrected and tested with mt8173 chromebook. Signed-off-by: Bilal Wasim Signed-off-by: Enric Balletbo i Serra Reviewed-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20210701114012.RESEND.1.I27436c29c3bede46dcf86df696f48683662d1ec1@changeid Signed-off-by: Matthias Brugger commit 7dc924d7c595b21c084644be6d18014aae505b0f Author: ChunyouTang Date: Thu Jul 8 15:34:06 2021 +0800 drm/panfrost:fix the exception name always "UNKNOWN" The exception_code in register is only 8 bits,So if fault_status in panfrost_gpu_irq_handler() don't (& 0xFF),it can't get correct exception reason. and it's better to show all of the register value to custom,so it's better fault_status don't (& 0xFF). Signed-off-by: ChunyouTang Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210708073407.2015-1-tangchunyou@163.com commit e642197562cd9781453f835e1406cfe0feeb917e Author: Jiapeng Chong Date: Tue Jun 1 19:09:03 2021 +0800 leds: is31fl32xx: Fix missing error code in is31fl32xx_parse_dt() The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'. Eliminate the follow smatch warning: drivers/leds/leds-is31fl32xx.c:388 is31fl32xx_parse_dt() warn: missing error code 'ret'. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Fixes: 9d7cffaf99f5 ("leds: Add driver for the ISSI IS31FL32xx family of LED controllers") Acked-by: David Rivshin Signed-off-by: Pavel Machek commit 51f3b2c3d511c7753f039176bbce08e8d53a0845 Author: Linus Walleij Date: Fri May 28 22:24:04 2021 +0200 leds: ktd2692: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Cc: Ingi Kim Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 61fa67a4e538f70bb4e6b3e7f3555402c1713654 Author: Linus Walleij Date: Fri May 28 22:24:03 2021 +0200 leds: lm3601x: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Cc: Dan Murphy Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 9a7c066f6a1dfff2f30e697fe494a669428fc9f4 Author: Linus Walleij Date: Fri May 28 22:24:02 2021 +0200 leds: sgm3140: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Cc: Luca Weiss Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit eb5a4422e448a8200ddaafef0cc16db3f45ec1f8 Author: Linus Walleij Date: Fri May 28 22:24:01 2021 +0200 leds: max77693: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Signed-off-by: Linus Walleij Acked-by: Jacek Anaszewski Signed-off-by: Pavel Machek commit f5d69f6290a37f5579ef24334d5bf8a59bb13ef4 Author: Linus Walleij Date: Fri May 28 22:24:00 2021 +0200 leds: as3645a: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Signed-off-by: Linus Walleij Acked-by: Sakari Ailus Signed-off-by: Pavel Machek commit 293fee7f607841cc128c3f6df9b464e8abf99fb0 Author: Linus Walleij Date: Fri May 28 22:23:59 2021 +0200 leds: aat1290: Move driver to flash subdirectory We created a subdirectory for LED drivers that depend on CONFIG_LEDS_CLASS_FLASH, and this driver does so let's move it there. Signed-off-by: Linus Walleij Acked-by: Jacek Anaszewski Signed-off-by: Pavel Machek commit 97db1b081e1286bdd9dcd4d25b88d6770ff4a65b Author: Wesley Cheng Date: Sat Jul 10 02:13:15 2021 -0700 dt-bindings: usb: dwc3: Update dwc3 TX fifo properties Update the tx-fifo-resize property with a better description, while adding the tx-fifo-max-num, which is a new parameter allowing adjustments for the maximum number of packets the txfifo resizing logic can account for while resizing the endpoints. Reviewed-by: Rob Herring Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-7-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit cefdd52fa0455c0555c30927386ee466a108b060 Author: Wesley Cheng Date: Sat Jul 10 02:13:14 2021 -0700 usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default In order to take advantage of the TX fifo resizing logic, manually add these properties to the DWC3 child node by default. This will allow the DWC3 gadget to resize the TX fifos for the IN endpoints, which help with performance. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-6-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit fe794e39548308e77e570fdf645d516554b3f873 Author: Wesley Cheng Date: Sat Jul 10 02:13:13 2021 -0700 of: Add stub for of_add_property() If building with OF Kconfig disabled, this can lead to errors for drivers utilizing of_add_property(). Add a stub for the add API, as it exists for the remove variant as well, and to avoid compliation issues. Also, export this API so that it can be used by modules. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-5-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit 9f607a309fbe95fc1f77acce5af70766a7142537 Author: Wesley Cheng Date: Sat Jul 10 02:13:12 2021 -0700 usb: dwc3: Resize TX FIFOs to meet EP bursting requirements Some devices have USB compositions which may require multiple endpoints that support EP bursting. HW defined TX FIFO sizes may not always be sufficient for these compositions. By utilizing flexible TX FIFO allocation, this allows for endpoints to request the required FIFO depth to achieve higher bandwidth. With some higher bMaxBurst configurations, using a larger TX FIFO size results in better TX throughput. By introducing the check_config() callback, the resizing logic can fetch the maximum number of endpoints used in the USB composition (can contain multiple configurations), which helps ensure that the resizing logic can fulfill the configuration(s), or return an error to the gadget layer otherwise during bind time. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-4-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit 7adf9e3adc398e5d5b7af91e5fdfafa70e86dd36 Author: Wesley Cheng Date: Sat Jul 10 02:13:11 2021 -0700 usb: gadget: configfs: Check USB configuration before adding Ensure that the USB gadget is able to support the configuration being added based on the number of endpoints required from all interfaces. This is for accounting for any bandwidth or space limitations. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-3-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit ce7d0008c2356626f69f37ef1afce8fbc83fe142 Author: Wesley Cheng Date: Sat Jul 10 02:13:10 2021 -0700 usb: gadget: udc: core: Introduce check_config to verify USB configuration Some UDCs may have constraints on how many high bandwidth endpoints it can support in a certain configuration. This API allows for the composite driver to pass down the total number of endpoints to the UDC so it can verify it has the required resources to support the configuration. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1625908395-5498-2-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit afaff559ae98fec64e7e066749ab135577c17ddd Author: Colin Ian King Date: Fri Jun 18 11:50:20 2021 +0200 media: saa7164: remove redundant continue statement The continue statement at the end of a for-loop has no effect, remove it. Addresses-Coverity: ("Continue has no effect") Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3f3475a5c77e9eabab43537f713b90f1d19258b7 Author: Yang Yingliang Date: Wed Jun 16 10:36:45 2021 +0200 media: saa7134: convert list_for_each to entry variant Convert list_for_each() to list_for_each_entry() where applicable. Signed-off-by: Yang Yingliang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 46fdc302028e6d50138e951f9b3f1a781c2f07dd Author: Herman Date: Wed Jun 16 10:03:16 2021 +0200 media: drivers/media/platform/marvell-ccic/mcam-core.c : fix typo 'gettig' > 'getting' Change 'gettig' into 'getting'. Signed-off-by: Herman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 40c7f9c31d86bfa86306a7104ca361e78e76ba2c Author: Hans Verkuil Date: Wed Jun 16 09:22:20 2021 +0200 media: vivid: increase max number of allowed The max number of allowed logical addresses was set to 1 in vivid, for no good reason. This prevented testing with multiple logical addresses for the same CEC device. Increase this number to CEC_MAX_LOG_ADDRS. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ea3e1c36e38810427485f06c2becc1f29e54521d Author: Krzysztof Hałasa Date: Wed Jun 16 07:13:55 2021 +0200 media: TDA1997x: enable EDID support Without this patch, the TDA19971 chip's EDID is inactive. EDID never worked with this driver, it was all tested with HDMI signal sources which don't need EDID support. Signed-off-by: Krzysztof Halasa Fixes: 9ac0038db9a7 ("media: i2c: Add TDA1997x HDMI receiver driver") Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d229a910bf8c597340133e69d7fbbaede5a1692c Author: Herman Date: Tue Jun 15 04:06:36 2021 +0200 media: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c : fix typo 'in deed imporant' > 'indeed important' Change 'imporant' into 'important'. Signed-off-by: Herman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bc3db19f04f1ae62ab51dea6a5cdacb0b5ec1404 Author: Christophe JAILLET Date: Sun Jun 13 17:03:31 2021 +0200 media: saa7134: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'saa7134_pgtable_alloc()', GFP_KERNEL can be used because its 4 callers (one function calls it 2 times, so there is only 3 functions that call it): .hw_params in a struct snd_pcm_ops (saa7134-alsa.c) --> snd_card_saa7134_hw_params (saa7134-alsa.c) --> saa7134_pgtable_alloc ==> .hw_params function can use GFP_KERNEL saa7134_initdev (saa7134-core.c) --> saa7134_hwinit1 (saa7134-core.c) --> saa7134_ts_init1 (saa7134-ts.c) --> saa7134_pgtable_alloc ==> saa7134_initdev already uses GFP_KERNEL saa7134_initdev (saa7134-core.c) --> saa7134_hwinit1 (saa7134-core.c) --> saa7134_video_init1 (saa7134-video.c) --> saa7134_pgtable_alloc (called 2 times) ==> saa7134_initdev already uses GFP_KERNEL and no spin_lock is taken in the between. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 331ca86aff94323d252d843b73cd6dddf54715bd Author: lijian Date: Fri Jun 11 08:28:15 2021 +0200 media: i2c: tvp5150: deleted the repeated word deleted the repeated word 'the' in the comments. Signed-off-by: lijian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 983eb35c991d286b083656c790c86c314b627871 Author: Herman Date: Thu Jun 10 10:38:15 2021 +0200 media: drivers/media/platform/davinci/vpfe_capture.c : fix typo Proabably > Probably Change 'Proabably' into 'Probably'. Signed-off-by: Herman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 123aaf816b952e5b6ee754335596b01ba1f6c830 Author: Eugen Hristev Date: Wed Jun 9 15:00:28 2021 +0200 media: atmel: atmel-sama5d2-isc: fix YUYV format SAMA5D2 does not have the YCYC field for the RLP (rounding, limiting, packaging) module. The YCYC field is supposed to work with interleaved YUV formats like YUYV. In SAMA5D2, we have to use YYCC field, which is used for both planar formats like YUV420 and interleaved formats like YUYV. Fix the according rlp callback to replace the generic YCYC field (which makes more sense from a logical point of view) with the required YYCC field. Fixes: debfa496871c ("media: atmel: atmel-isc-base: add support for more formats and additional pipeline modules") Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b6ef5c123a4b73aae649ee2e7da73d751491b971 Author: Colin Ian King Date: Wed Jun 9 14:14:08 2021 +0200 media: atomisp: remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9a582884716aff660cf559b2df610c040c0e5087 Author: Herman Date: Wed Jun 9 11:53:22 2021 +0200 media: drivers/media/usb/gspca: fix typo Fliker -> Flicker Change 'Fliker' into 'Flicker'. Signed-off-by: Herman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e481ff3f19cd9d46da1a46ca7966403dc69e8632 Author: Herman Date: Wed Jun 9 05:00:31 2021 +0200 media: drivers/media/pci/tw5864/Tw5864-reg.h: fix typo issues change 'syncrous' into 'synchronous' Signed-off-by: Herman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d92a4a27d983032267b231a32be98a11a9995e5c Author: Jernej Skrabec Date: Sun Jun 6 10:23:14 2021 +0200 media: cedrus: hevc: Add support for multiple slices Now that segment address is available, support for multi-slice frames can be easily added. Signed-off-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 229e5bdcd39ed3ca0a71dc8500ba4ea90d4415db Author: Jernej Skrabec Date: Sun Jun 6 10:23:13 2021 +0200 media: hevc: Add segment address field If HEVC frame consists of multiple slices, segment address has to be known in order to properly decode it. Add segment address field to slice parameters. Signed-off-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ed638b1d6f69343f3e764fd3608780485e7c1731 Author: Mauro Carvalho Chehab Date: Mon Jun 21 09:24:46 2021 +0200 media: ivtv: prevent going past the hw arrays As warned by smatch: drivers/media/pci/ivtv/ivtv-i2c.c:245 ivtv_i2c_register() error: buffer overflow 'hw_devicenames' 21 <= 31 drivers/media/pci/ivtv/ivtv-i2c.c:266 ivtv_i2c_register() error: buffer overflow 'hw_addrs' 21 <= 31 drivers/media/pci/ivtv/ivtv-i2c.c:269 ivtv_i2c_register() error: buffer overflow 'hw_addrs' 21 <= 31 drivers/media/pci/ivtv/ivtv-i2c.c:275 ivtv_i2c_register() error: buffer overflow 'hw_addrs' 21 <= 31 drivers/media/pci/ivtv/ivtv-i2c.c:280 ivtv_i2c_register() error: buffer overflow 'hw_addrs' 21 <= 31 drivers/media/pci/ivtv/ivtv-i2c.c:290 ivtv_i2c_register() error: buffer overflow 'hw_addrs' 21 <= 31 The logic at ivtv_i2c_register() could let buffer overflows at hw_devicenames and hw_addrs arrays. This won't happen in practice due to a carefully-contructed logic, but it is not error-prune. Change the logic in a way that will make clearer that the I2C hardware flags will affect the size of those two arrays, and add an explicit check to avoid buffer overflows. While here, use the bit macro. Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a10d7fdb6d0e235e9d230916244cc2769d3f170 Author: Mauro Carvalho Chehab Date: Thu Jun 17 14:33:29 2021 +0200 media: uvc: don't do DMA on stack As warned by smatch: drivers/media/usb/uvc/uvc_v4l2.c:911 uvc_ioctl_g_input() error: doing dma on the stack (&i) drivers/media/usb/uvc/uvc_v4l2.c:943 uvc_ioctl_s_input() error: doing dma on the stack (&i) those two functions call uvc_query_ctrl passing a pointer to a data at the DMA stack. those are used to send URBs via usb_control_msg(). Using DMA stack is not supported and should not work anymore on modern Linux versions. So, use a kmalloc'ed buffer. Cc: stable@vger.kernel.org # Kernel 4.9 and upper Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 54e80d9883bd5b76c80710bddc63d1bd3f374d50 Author: Mauro Carvalho Chehab Date: Mon Jun 21 09:32:25 2021 +0200 media: sti: don't copy past the size The logic at delta_ipc_open() tries to copy past the size of the name passed to it: drivers/media/platform/sti/delta/delta-ipc.c:178 delta_ipc_open() error: __memcpy() 'name' too small (17 vs 32) Basically,this function is called just one with: ret = delta_ipc_open(pctx, "JPEG_DECODER_HW0", ...); The string used there has just 17 bytes. Yet, the logic tries to copy the entire name size (32 bytes), which is plain wrong. Replace it by strscpy, which is good enough to copy the string, warranting that this will be NUL-terminated. Signed-off-by: Mauro Carvalho Chehab commit 8db11aebdb8f93f46a8513c22c9bd52fa23263aa Author: Mauro Carvalho Chehab Date: Thu Jun 17 13:28:57 2021 +0200 media: dib8000: rewrite the init prbs logic The logic at dib8000_get_init_prbs() has a few issues: 1. the tables used there has an extra unused value at the beginning; 2. the dprintk() message doesn't write the right value when transmission mode is not 8K; 3. the array overflow validation is done by the callers. Rewrite the code to fix such issues. This should also shut up those smatch warnings: drivers/media/dvb-frontends/dib8000.c:2125 dib8000_get_init_prbs() error: buffer overflow 'lut_prbs_8k' 14 <= 14 drivers/media/dvb-frontends/dib8000.c:2129 dib8000_get_init_prbs() error: buffer overflow 'lut_prbs_2k' 14 <= 14 drivers/media/dvb-frontends/dib8000.c:2131 dib8000_get_init_prbs() error: buffer overflow 'lut_prbs_4k' 14 <= 14 drivers/media/dvb-frontends/dib8000.c:2134 dib8000_get_init_prbs() error: buffer overflow 'lut_prbs_8k' 14 <= 14 Signed-off-by: Mauro Carvalho Chehab commit 2a621b0859d1caf4e03f47066dad78011d274617 Author: Ezequiel Garcia Date: Sat Jun 19 19:24:23 2021 +0200 media: gspca: Drop default m Drop the "default m", as options should default to disabled. No other media driver is enabled by default. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit caa7302b3a346d9a9ec85568cff52d2cee5f32c4 Author: Hans Verkuil Date: Fri Jun 18 16:21:36 2021 +0200 media: include/uapi/linux/cec.h: typo: SATERDAY -> SATURDAY Fix typo in a define: CEC_OP_REC_SEQ_SATERDAY -> CEC_OP_REC_SEQ_SATURDAY This isn't used yet in actual applications to the best of my knowledge, and it certainly doesn't break the ABI since the value doesn't change. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 387caebee00671aa6895e7b51056dca1f38e35dd Author: Ján Čáni Date: Thu Jun 17 21:59:48 2021 +0200 media: dvbsky: add support for MyGica T230C2_LITE and T230A Add Geniatech MyGica T230C2_LITE and T230A as many people are asking support for these devices on forums. Link: https://lore.kernel.org/linux-media/YMuptIYFLdwSmw//@kali Signed-off-by: Ján Čáni Signed-off-by: Mauro Carvalho Chehab commit 6af95e03fb113fecc1c5d9883d8a7910dace010d Author: Johan Jonker Date: Sun Jul 11 16:34:29 2021 +0200 ARM: dts: rockchip: remove interrupt-names from iommu nodes The iommu driver gets the interrupts by platform_get_irq(), so remove interrupt-names property from iommu nodes. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210711143430.14347-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit b3198e046821d395d148cfd5c623de4f280628d0 Author: Johan Jonker Date: Fri Jul 9 12:16:24 2021 +0200 ARM: dts: rockchip: rename timer compatible strings for rk3066a The compatible string "snps,dw-apb-timer-osc" was deprecated in place of "snps,dw-apb-timer". Rename the timer compatible strings in rk3066a.dtsi, so boot loaders like U-boot can use the timer node directly without conversion. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210709101624.1463-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 2120e486b41963dfdad355d91c2818ff670776ba Author: Johan Jonker Date: Fri Jul 9 12:31:34 2021 +0200 ARM: dts: rockchip: add space after &grf on rk3188 Fix layout by adding a space after &grf. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210709103134.1750-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit f295228b384f9d66d1b4d31151123261a1c9e071 Author: Johan Jonker Date: Sun Jul 11 13:21:54 2021 +0200 ARM: dts: rockchip: rename pcfg_* nodenames for rk3066/rk3188 Rename pcfg_* nodenames for rk3066/rk3188 to pcfg-*, so that they fit in the regex with the other Rockchip SoCs. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20210711112154.5287-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 162a31effc4182dd5a0675d9fd0336d5096e0ad3 Author: Mason Zhang Date: Tue Jun 29 18:08:15 2021 +0800 spi: mediatek: add no_need_unprepare support This patch add no_need_unprepare support for spi, if spi src clk is MAIN PLL, it can keep the clk_prepare and will not cause low power issue. So we no need do clk_prepare/clk_unprepare in runtime pm, and it will get better performance, because clk_prepare has called mutex lock. In the same way, clk_get_rate also has called mutex lock, so we moved it to spi_probe. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210629100814.21402-1-mason.zhang@mediatek.com Signed-off-by: Mark Brown commit 3522d9aa19285bbff14da20cb3481e36ef4835fd Author: Mason Zhang Date: Tue Jun 29 18:13:11 2021 +0800 spi: mediatek: update spi master bingdings for MT6893 SOC this patch update spi master bingdings for MT6893 SOC. Signed-off-by: Mason Zhang Link: https://lore.kernel.org/r/20210629101310.21045-1-mason.zhang@mediatek.com Signed-off-by: Mark Brown commit 8dd591ad0104593f315b6b2ab636a18c002f7d86 Author: Randy Dunlap Date: Mon Jun 28 14:05:20 2021 -0700 spi: : add missing struct kernel-doc entry Fix kernel-doc warning in spi.h by adding the missing kernel-doc entry and also correct the original comment so that they both indicate the correct polarity of the flag. ../include/linux/spi/spi.h:673: warning: Function parameter or member 'devm_allocated' not described in 'spi_controller' Fixes: 794aaf01444d ("spi: Fix use-after-free with devm_spi_alloc_*") Signed-off-by: Randy Dunlap Cc: William A. Kennington III Cc: Mark Brown Cc: linux-spi@vger.kernel.org Cc: Lukas Wunner Reviewed-by: Lukas Wunner Link: https://lore.kernel.org/r/20210628210520.5712-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 7ceb0b8a3ceddc36ae4ef1cba6c25a0e28ed65fc Author: Alain Volmat Date: Wed Jul 7 10:27:06 2021 +0200 spi: stm32: finalize message either on dma callback or EOT Depending on the usage, it is necessary to perform the finalize message operation either upon receiving the EOT interruption, eiher upon receiving the DMA callback. Indeed, when relying on DMA, even if the SPI EOT IT has been received, it is necessary to wait for the end of the DMA RX transaction before accessing to the data. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1625646426-5826-8-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit dc6620c31326bc50fa22fd8900a9f995d0a04bc1 Author: Alain Volmat Date: Wed Jul 7 10:27:05 2021 +0200 spi: stm32h7: don't wait for EOT and flush fifo on disable In nominal cases, disable is called as part of the unprepare_message, after receiving a EOT and after receiving all data so it doesn't make sense to check for EOT and empty the FIFO. Moreover, at the end of the disable, the SPI is disable (SPE) leading to clear of all internal FIFO, leaving the IP in a known status. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1625646426-5826-7-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit d87a5d64b5037cfedd7eb47d785b5c159ace8d9b Author: Amelie Delaunay Date: Wed Jul 7 10:27:04 2021 +0200 spi: stm32h7: rework rx fifo read function Remove flush parameter and check RXWNE or RXPLVL when end of transfer flag is set. Signed-off-by: Amelie Delaunay Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1625646426-5826-6-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit 70526e0b7601792bf546044fff92c368112f1d3f Author: Alain Volmat Date: Wed Jul 7 10:27:03 2021 +0200 spi: stm32: Revert "properly handle 0 byte transfer" 0 byte transfer handling is now done within the core in code added by commit b306320322c9 ("spi: Skip zero-length transfers in spi_transfer_one_message()") This reverts commit 2269f5a8b1a7 ("spi: stm32: properly handle 0 byte transfer") Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1625646426-5826-5-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit 9d5354145104cf392568a948c5ce2cb97f373fd7 Author: Alain Volmat Date: Wed Jul 7 10:27:01 2021 +0200 spi: stm32: enable pm_runtime autosuspend This commit enables the pm_runtime autosuspend and sets a 1ms autosuspend delay. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1625646426-5826-3-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit fedbfea13cc0e513956abfa5c22158f0523d5687 Author: Matti Vaittinen Date: Mon Jul 5 13:54:33 2021 +0300 regulator: bd718x7: Suopport configuring UVP/OVP state The ROHM BD71837/47/50/78 do support enabling/disabling the under/over voltage protection. Add support for enabling/disabling the protection according to the device-tree information. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20210705105416.GA1189560@localhost.localdomain Signed-off-by: Mark Brown commit 894cda54a76d7c336b6f301bafe49bf6870d4697 Author: Jinchao Wang Date: Sat Jun 26 18:24:54 2021 +0800 regulator: Replace symbolic permissions with octal permissions Resolve following checkpatch issue, Replace symbolic permissions with octal permissions Signed-off-by: Jinchao Wang Link: https://lore.kernel.org/r/20210626102454.54931-1-wjc@cdjrlc.com Signed-off-by: Mark Brown commit f40f9409719fa092924803723b9445be13fac8fb Author: ChiYuan Huang Date: Fri Jul 9 23:40:36 2021 +0800 regulator: rt6752: Add support for Richtek RTQ6752 Add suport for Richtek RTQ6752. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1625845236-30285-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 526e99cf43fe3884014f9e9f2ca5d04d56007287 Author: ChiYuan Huang Date: Fri Jul 9 23:40:35 2021 +0800 regulator: rtq6752: Add binding document for Richtek RTQ6752 Add binding document for Richtek RTQ6752. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1625845236-30285-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 78bbb7c345ab630cfe8b272c6179bf8b19a6c8aa Author: Randy Dunlap Date: Sun Jun 27 18:54:22 2021 -0700 regulator: machine.h: fix kernel-doc "bad line" Fix warning caused by a blank/empty line: ../include/linux/regulator/machine.h:115: warning: bad line: Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20210628015422.8845-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 6eb891cf73bd2ecc877e9916951a19f3e4f3c493 Author: ChiYuan Huang Date: Tue Jul 6 14:45:39 2021 +0800 regulator: rt5033: Use linear ranges to map all voltage selection Instead of linear mapping, Use linear range to map all voltage selection. Signed-off-by: ChiYuan Huang Reviewed-by: Axel Lin Acked-by: Lee Jones Link: https://lore.kernel.org/r/1625553939-9109-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit e301df76472cc929fa62d923bc3892931f7ad71d Author: Dmitry Osipenko Date: Mon Jul 5 23:12:11 2021 +0300 regulator: tps65910: Silence deferred probe error The TPS65910 regulator now gets a deferred probe until supply regulator is registered. Silence noisy error message about the deferred probe. Reported-by: Matt Merhar # Ouya T30 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20210705201211.16082-1-digetx@gmail.com Signed-off-by: Mark Brown commit 12401a1cef787167aff52ef2dd28286e61054c38 Author: Axel Lin Date: Tue Jun 29 21:05:03 2021 +0800 regulator: mt6397: Remove modeset_shift from struct mt6397_regulator_info The shift setting can be calculated via the corresponding mask field, so remove modeset_shift. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210629130503.2183574-3-axel.lin@ingics.com Signed-off-by: Mark Brown commit d6208ba87066c981589ca41f07d29a5803807ead Author: Axel Lin Date: Tue Jun 29 21:05:02 2021 +0800 regulator: mt6359: Remove shift fields from struct mt6359_regulator_info The shift setting can be calculated via the corresponding mask field, so remove these shift fields. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210629130503.2183574-2-axel.lin@ingics.com Signed-off-by: Mark Brown commit b99b7b79a7c57d5f1550b9a507521c791c5f92ed Author: Axel Lin Date: Tue Jun 29 21:05:01 2021 +0800 regulator: mt6358: Remove shift fields from struct mt6358_regulator_info The shift setting can be calculated via the corresponding mask field, so remove these shift fields. The usage of da_vsel_mask is different from other mask defines because current code does shift regval before mask with the da_vsel_mask. Do proper shit to da_vsel_mask setting so we can calculate the shift. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210629130503.2183574-1-axel.lin@ingics.com Signed-off-by: Mark Brown commit 4d9f4d1de3ceb84fa6ce68177a26b8fac6a71290 Author: Alexandru Ardelean Date: Fri Jun 25 15:23:24 2021 +0300 regulator: devres: unexport devm_regulator_unregister_supply_alias() This API hook isn't used anywhere outside of the regulator devres code. This function is needed for the devm_regulator_bulk_register_supply_alias() function on the error path, to cleanup any previously registered supply aliases. This change makes the devm_regulator_unregister_supply_alias() local to the regulator core framework, to avoid it being used in any weird logic. It's also removing the doc-string for devm_regulator_unregister_supply_alias(), since it doesn't need to be documented anymore, as no other external consumer should use it. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210625122324.327585-5-aardelean@deviqon.com Signed-off-by: Mark Brown commit eed43b96ede9c3f018ad24149de83f24b86ad729 Author: Alexandru Ardelean Date: Fri Jun 25 15:23:23 2021 +0300 regulator: devres: remove devm_regulator_bulk_unregister_supply_alias() This API hook isn't used anywhere and most-likely exists because of the general principle of C APIs, where if an API function does an allocation/registration, it must also have an equivalent deallocation/deregistration counterpart. For devm_ functions this isn't all that true (for all cases), as the idea of these function is to provide an auto-cleanup logic on drivers/system de-init. Removing this also discourages any weird logic that could be created with such an API function. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210625122324.327585-4-aardelean@deviqon.com Signed-off-by: Mark Brown commit 4ff75a29976590bc7afe3ed75d547c1f2a924c75 Author: Alexandru Ardelean Date: Fri Jun 25 15:23:22 2021 +0300 regulator: devres: remove devm_regulator_unregister() function This API hook isn't used anywhere and most-likely exists because of the general principle of C APIs, where if an API function does an allocation/registration, it must also have an equivalent deallocation/deregistration counterpart. For devm_ functions this isn't all that true (for all cases), as the idea of these function is to provide an auto-cleanup logic on drivers/system de-init. Removing this also discourages any weird logic that could be created with such an API function. Signed-off-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210625122324.327585-3-aardelean@deviqon.com Signed-off-by: Mark Brown commit e8608f8956ff4015a206f75631a266d93e84bb2d Author: Mauro Carvalho Chehab Date: Fri Jul 2 09:37:17 2021 +0200 regulator: hi6421v600-regulator: add a missing dot at copyright The Huawei's copyright is missing a dot at the end. Add it, in order to make it similar to the other two copyrights. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e9c0f27688d7be75652800e67c913878fd772cbe.1625211021.git.mchehab+huawei@kernel.org Signed-off-by: Mark Brown commit d63aa09f7c53bdeb83edb4d84c07d759a92223bb Author: Jinchao Wang Date: Tue Jun 29 01:19:06 2021 +0800 regmap: Prefer unsigned int to bare use of unsigned Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Jinchao Wang Link: https://lore.kernel.org/r/20210628171907.63646-1-wjc@cdjrlc.com Signed-off-by: Mark Brown commit 1852f5ed358147095297a09cc3c6f160208a676d Author: Jeongtae Park Date: Thu Jul 1 23:26:30 2021 +0900 regmap: fix the offset of register error log This patch fixes the offset of register error log by using regmap_get_offset(). Signed-off-by: Jeongtae Park Link: https://lore.kernel.org/r/20210701142630.44936-1-jeongtae.park@gmail.com Signed-off-by: Mark Brown commit f7c4fe9cffb0b8afbcdf6db5d3289d5441056b52 Author: Gu Shengxian Date: Mon Jul 5 23:42:07 2021 -0700 ASoC: amd: fix spelling mistakes Fix some spelling mistakes as follows: descritor ==> descriptor descriptore ==> descriptor contiguos ==> contiguous initiailize ==> initialize descriptiors ==> descriptor Signed-off-by: Gu Shengxian Link: https://lore.kernel.org/r/20210706064207.672491-1-gushengxian507419@gmail.com Signed-off-by: Mark Brown commit 3694f996be5cb8374bd224f4e5462c945d359843 Author: Marek Vasut Date: Thu Jul 8 11:12:29 2021 +0200 ASoC: tlv320aic32x4: Fix TAS2505/TAS2521 channel count The TAS2505/TAS2521 does support up to two channels, LEFT and RIGHT, which are being alternated on the audio data bus by Word Clock, WCLK. This is documented in TI slau472 2.7.1 Digital Audio Interface. Note that both the LEFT and RIGHT channels are only used for audio INPUT, while only the LEFT channel is used for audio OUTPUT. Fixes: b4525b6196cd7 ("ASoC: tlv320aic32x4: add support for TAS2505") Signed-off-by: Marek Vasut Cc: Claudius Heine Cc: Mark Brown Link: https://lore.kernel.org/r/20210708091229.56443-1-marex@denx.de Signed-off-by: Mark Brown commit 8620c40002db9679279546cc3be2aceb8c5e5e76 Author: Tang Bin Date: Thu Jun 24 18:45:05 2021 +0800 ASoC: fsl_xcvr: Omit superfluous error message in fsl_xcvr_probe() In the function fsl_xcvr__probe(), when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210624104505.13680-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit d5bb69dc54ec1e09f3fd626fdb9c340c0511dbd5 Author: Wolfram Sang Date: Wed Jun 23 12:05:45 2021 +0200 ASoC: sh: rcar: dma: : use proper DMAENGINE API for termination dmaengine_terminate_all() is deprecated in favor of explicitly saying if it should be sync or async. Here, we want dmaengine_terminate_sync() because there is no other synchronization code in the driver to handle an async case. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20210623100545.3926-1-wsa+renesas@sang-engineering.com Signed-off-by: Mark Brown commit 2ba907894f9e69b68e5934b57afb744482a72984 Author: Charles Keepax Date: Sat Jun 26 16:59:41 2021 +0100 ASoC: wm_adsp: Remove pointless string comparison The control fw_name is always directly assigned from the wm_adsp_fw_text array, so it isn't necessary to compare the actual strings just the pointer values. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20210626155941.12251-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 4d0b79ec9eb81b227c8ae211b7f159bd7194d9ae Author: kernel test robot Date: Tue Jun 29 21:29:09 2021 +0800 ASoC: codecs: wcd938x: fix returnvar.cocci warnings sound/soc/codecs/wcd938x.c:1628:5-8: Unneeded variable: "ret". Return "0" on line 1656 sound/soc/codecs/wcd938x.c:1871:5-8: Unneeded variable: "ret". Return "0" on line 1907 Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci Fixes: 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig") CC: Srinivas Kandagatla Reported-by: kernel test robot Signed-off-by: kernel test robot Acked-by: Souptick Joarder Link: https://lore.kernel.org/r/20210629132909.GA7935@233d919f385f Signed-off-by: Mark Brown commit 6c5c659dfe3f02e08054a6c20019e3886618b512 Author: Randy Dunlap Date: Wed Jul 7 14:47:52 2021 -0700 ASoC: atmel: ATMEL drivers don't need HAS_DMA On a config (such as arch/sh/) which does not set HAS_DMA when MMU is not set, several ATMEL ASoC drivers select symbols that cause kconfig warnings. There is one "depends on HAS_DMA" which is no longer needed. Dropping it eliminates the kconfig warnings and still builds with no problems reported. Fix the following kconfig warnings: WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && HAS_DMA [=n] Selected by [m]: - SND_ATMEL_SOC_SSC [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] - SND_ATMEL_SOC_SSC_PDC [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC_PDC Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] && HAS_DMA [=n] Selected by [m]: - SND_AT91_SOC_SAM9G20_WM8731 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && SND_SOC_I2C_AND_SPI [=m] WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && HAS_DMA [=n] Selected by [m]: - SND_ATMEL_SOC_SSC_DMA [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC_DMA Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] && HAS_DMA [=n] Selected by [m]: - SND_ATMEL_SOC_WM8904 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && I2C [=m] - SND_AT91_SOC_SAM9X5_WM8731 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && SND_SOC_I2C_AND_SPI [=m] Signed-off-by: Randy Dunlap Reviewed-by: Codrin Ciubotariu Acked-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210707214752.3831-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 3666a8f820075e99539ab50687e80fadf997822f Author: Dan Carpenter Date: Wed Jun 30 14:18:53 2021 +0300 ASoC: ti: delete some dead code in omap_abe_probe() This code checks "priv->mclk_freq" twice and the second check is not required. The code is left over from when removed support for legacy boot. Fixes: 8fe120b5a665 ("ASoC: omap-abe-twl6040: Remove support for pdata (legacy boot)") Signed-off-by: Dan Carpenter Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/YNxTHXz58dhgbFtG@mwanda Signed-off-by: Mark Brown commit 55233b22502151e0b2d9cc599e1ddf1f5584c87a Author: Gu Shengxian Date: Tue Jul 6 18:02:30 2021 +0800 ASoC: atmel: fix spelling mistakes Fix some spelling mistakes as follows: regaedles ==> regardless prezent ==> present underrrun ==> underrun controlls ==> controls Signed-off-by: Gu Shengxian Link: https://lore.kernel.org/r/20210706100230.32633-1-gushengxian507419@gmail.com Signed-off-by: Mark Brown commit 837ad6da36ba765d9ff8120c93dd243b9200957e Author: Brent Lu Date: Fri Jun 25 15:50:42 2021 -0500 ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency Use sof_dai_get_bclk() function to get bclk frequency instead of a hard-coded magic number depending on configuration in topology. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210625205042.65181-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bc619cfc6278c87b4e310f9db9f45abc263220e8 Author: Brent Lu Date: Fri Jun 25 15:50:41 2021 -0500 ASoC: SOF: add a helper to get topology configured bclk Add helper function sof_dai_ssp_bclk() to get the BCLK frequency configured by topology. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210625205042.65181-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f99acc259f621ae6667782778b2065c15e109693 Author: Gongjun Song Date: Fri Jun 25 15:50:40 2021 -0500 ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP snd_soc_acpi_intel_tgl_sdw_machines structure array does not contain the configuration information of TGL-H-RVP, which results in the inability to enable soundwire on the TGL-H-RVP platform. Add the corresponding configuration information to enable soundwire on the TGL-H-RVP platform. Reviewed-by: Kai Vehmanen Signed-off-by: Gongjun Song Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210625205042.65181-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 19f479c37f76e926a6c0bec974a4d09826e32fc6 Author: Zhang Qilong Date: Fri Jun 18 22:11:04 2021 +0800 ASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in mt8183_afe_pcm_dev_probe Add missing pm_runtime_disable() when probe error out. It could avoid pm_runtime implementation complains when removing and probing again the driver. Fixes:a94aec035a122 ("ASoC: mediatek: mt8183: add platform driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20210618141104.105047-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 2af2f861edd21c1456ef7dbec52122ce1b581568 Author: Zhang Qilong Date: Fri Jun 18 22:11:03 2021 +0800 ASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in mt8192_afe_pcm_dev_probe Add missing pm_runtime_disable() when probe error out. It could avoid pm_runtime implementation complains when removing and probing again the driver. Fixes:125ab5d588b0b ("ASoC: mediatek: mt8192: add platform driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20210618141104.105047-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 0238bcf80e972f2ce25d767e54f89a9e49773f6e Author: Peter Ujfalusi Date: Mon Jul 5 22:42:47 2021 +0300 ASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP There is a single McASP on OMAP4 (and OMAP5) which is configured to only support DIT playback mode on a single serializer. Add 0x200 offset to DAT port address as the TRM suggests it. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210705194249.2385-4-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown commit 5dcd276e1525e0c7ae7aa1f0426b6343ebf994e0 Author: Peter Ujfalusi Date: Mon Jul 5 22:42:46 2021 +0300 ASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4 OMAP4 has one McASP instance with single serializer and supporting only DIT mode. According to the TRM the DAT port needs to be accessed as specific offset compared to other devices where access to any part of the DAT region is valid. To handle this constraint we need to introduce a new compatiple string for OMAP4. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210705194249.2385-3-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown commit bbdd3f4dbe81e19b9123bc54e23ed54517615524 Author: Peter Ujfalusi Date: Mon Jul 5 22:42:45 2021 +0300 ASoC: ti: davinci-mcasp: Fix DIT mode support The DIT mode support has not been tested due to lack of platform where it can be tested. To be able to use the McASP on OMAP4/5 (only supporting DIT mode) we need to have DIT mode working in the McASP driver on a know platform. After hacking around (on BBW, mcasp1.axr1 can be routed out for this) it appeared that DIT mode is broken. This patch fixes it up and 16/24 bit audio works along with passthrough, but I have only tested with DTS example and test files. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210705194249.2385-2-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown commit da18edb11ccad3c657a65568275920b93f688f1b Merge: e73f0f0ee7541 7999d2555c9f8 Author: Mark Brown Date: Sun Jul 11 23:45:34 2021 +0100 Merge existing fixes from spi/for-5.14 commit 3cb5992c34f7a8693009f969b7d73b6b181ccc8e Merge: e73f0f0ee7541 ea986908ccfcc Author: Mark Brown Date: Sun Jul 11 23:45:15 2021 +0100 Merge existing fixes from regulator/for-5.14 commit 999abd7a8c5dc52c5bfca71cdba98642dad5a0be Merge: e73f0f0ee7541 9cf76a72af6ab Author: Mark Brown Date: Sun Jul 11 23:44:54 2021 +0100 Merge existing fixes from asoc/for-5.14 commit 78d2ad7eb4e1f0e9cd5d79788446b6092c21d3e0 Author: Ville Syrjälä Date: Wed Jun 30 19:44:13 2021 +0300 drm/i915/gt: Fix -EDEADLK handling regression The conversion to ww mutexes failed to address the fence code which already returns -EDEADLK when we run out of fences. Ww mutexes on the other hand treat -EDEADLK as an internal errno value indicating a need to restart the operation due to a deadlock. So now when the fence code returns -EDEADLK the higher level code erroneously restarts everything instead of returning the error to userspace as is expected. To remedy this let's switch the fence code to use a different errno value for this. -ENOBUFS seems like a semi-reasonable unique choice. Apart from igt the only user of this I could find is sna, and even there all we do is dump the current fence registers from debugfs into the X server log. So no user visible functionality is affected. If we really cared about preserving this we could of course convert back to -EDEADLK higher up, but doesn't seem like that's worth the hassle here. Not quite sure which commit specifically broke this, but I'll just attribute it to the general gem ww mutex work. Cc: stable@vger.kernel.org Cc: Maarten Lankhorst Cc: Thomas Hellström Testcase: igt/gem_pread/exhaustion Testcase: igt/gem_pwrite/basic-exhaustion Testcase: igt/gem_fenced_exec_thrash/too-many-fences Fixes: 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210630164413.25481-1-ville.syrjala@linux.intel.com Reviewed-by: Maarten Lankhorst commit 8e55f99c510f38acb9b1b7552cb942eeb585795e Author: Kai-Heng Feng Date: Thu May 20 14:58:20 2021 +0800 drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops On HP Fury G7 Workstations, graphics output is re-routed from Intel GFX to discrete GFX after S3. This is not desirable, because userspace will treat connected display as a new one, losing display settings. The expected behavior is to let discrete GFX drives all external displays. The platform in question uses ACPI method \_SB.PCI0.HGME to enable MUX. The method is inside the another _DSM, so add the _DSM and call it accordingly. I also tested some MUX-less and iGPU only laptops with that _DSM, no regression was found. v4: - Rebase. - Change the DSM name to avoid confusion. - Move the function call to intel_opregion. v3: - Remove BXT from names. - Change the parameter type. - Fold the function into intel_modeset_init_hw(). v2: - Forward declare struct pci_dev. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3113 References: https://lore.kernel.org/intel-gfx/1460040732-31417-4-git-send-email-animesh.manna@intel.com/ Signed-off-by: Kai-Heng Feng Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210520065832.614245-1-kai.heng.feng@canonical.com commit 7c4ed5ded8538a469d1e1ced8063ac4b13f8aea5 Merge: db0e04ad42bbb 21dd1fd6d718a Author: Steve French Date: Sat Jul 10 07:44:41 2021 -0500 Merge pull request #59 from namjaejeon/cifsd-for-next Cifsd for next commit 21dd1fd6d718ac59841c3ee3d0b1d82508ef24dc Author: Hyunchul Lee Date: Fri Jul 9 17:06:34 2021 +0900 ksmbd: handle error cases first in smb2_create_sd_buffers For code cleanup, handle error cases first in smb2_create_sd_buffers(). Reported-by: Dan Carpenter Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ce154c32af3c60727171ff28ae97bcceda63b1c6 Author: Hyunchul Lee Date: Fri Jul 9 17:06:33 2021 +0900 ksmbd: make smb2_find_context_vals return NULL if not found instead of -ENOENT, make smb2_find_context_vals return NULL if the given context cannot be found. Reported-by: Dan Carpenter Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 45a64e8b08493b768fa029a5508cec8cf2b89f2d Author: Hyunchul Lee Date: Sat Jul 10 09:34:20 2021 +0900 ksmbd: uninterruptible wait for a file being unlocked the wait can be canceled by SMB2_CANCEL, SMB2_CLOSE, SMB2_LOGOFF, disconnection or shutdown, we don't have to use wait_event_interruptible. And this remove the warning from Coverity: CID 1502834 (#1 of 1): Unused value (UNUSED_VALUE) returned_value: Assigning value from ksmbd_vfs_posix_lock_wait(flock) to err here, but that stored value is overwritten before it can be used. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d63528eb0d43c4796c42aad56889dec12cf4e122 Author: Hyunchul Lee Date: Sat Jul 10 16:22:41 2021 +0900 ksmbd: free ksmbd_lock when file is closed Append ksmbd_lock into the connection's lock list and the ksmbd_file's lock list. And when a file is closed, detach ksmbd_lock from these lists and free it. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4fdd600214e666debb3bbe0ded1f6888c3ee49ec Author: Jagan Teki Date: Sun Jul 4 15:04:33 2021 +0530 drm: bridge: nwl-dsi: Drop unused nwl_dsi_plat_clk_config nwl_dsi_plat_clk_config structure added in below commit but not used anywhere in the driver. commit <44cfc6233447c> ("drm/bridge: Add NWL MIPI DSI host controller support") Drop it. Cc: Guido Günther Signed-off-by: Jagan Teki Reviewed-by: Guido Günther Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210704093433.27717-1-jagan@amarulasolutions.com commit 4b92841ef27b56883fa4491a3d51db3eef68c481 Author: Hyunchul Lee Date: Sat Jul 10 09:31:08 2021 +0900 ksmbd: fix the running request count decrement decrement the count of running requests after sending the last response for multi-response requests. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 07781de9051859d2f38a9e199384c64bb1924c47 Author: Dan Carpenter Date: Wed Jul 7 13:15:32 2021 +0300 ksmbd: use kasprintf() in ksmbd_vfs_xattr_stream_name() Simplify the code by using kasprintf(). This also silences a Smatch warning: fs/ksmbd/vfs.c:1725 ksmbd_vfs_xattr_stream_name() warn: inconsistent indenting Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0f6619aee86f11cee0c5063777c4febdf18cb28b Author: Dan Carpenter Date: Wed Jul 7 13:15:40 2021 +0300 ksmbd: delete some stray tabs These lines are intended one tab too far. Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f08a2a1eecb63debef0c6cac3d94dd06dd5abbc1 Author: Stefan Riedmueller Date: Fri Jul 9 22:03:49 2021 +0200 drm/panel: simple: Add support for EDT ETM0350G0DH6 panel This patch adds support for the EDT ETM0350G0DH6 3.5" (320x240) lcd panel to DRM simple panel driver. Signed-off-by: Stefan Riedmueller Signed-off-by: Yunus Bas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210709200349.2665205-2-y.bas@phytec.de commit e46f73fbbe00c73ccae7602257172c7f6fea6c37 Author: Stefan Riedmueller Date: Fri Jul 9 22:03:48 2021 +0200 drm/panel: simple: Add support for EDT ETMV570G2DHU panel This patch adds support for the EDT ETMV570G2DHU 5.7" (640x480) lcd panel to DRM simple panel driver. Signed-off-by: Stefan Riedmueller Signed-off-by: Yunus Bas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210709200349.2665205-1-y.bas@phytec.de commit f3ba46debcafd7f6c8440e38caeb0247d1336336 Author: Yunus Bas Date: Fri Jul 9 22:09:13 2021 +0200 dt-bindings: display: simple: Add EDT ETM0350G0DH6 The Emerging Display Technology ETM0350G0DH6 is a 3.5" WVGA TFT panel with capacitive multitouch. Add it to the list of compatibles. Signed-off-by: Yunus Bas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210709200913.2666570-2-y.bas@phytec.de commit a60d6b4164636a9195aed032f780f6fa5c1f966b Author: Yunus Bas Date: Fri Jul 9 22:09:12 2021 +0200 dt-bindings: display: simple: Add EDT ETMV570G2DHU The Emerging Display Technology ETMV570G2DHU is a 5.7" VGA TFT panel. Add it to the list of compatibles. Signed-off-by: Yunus Bas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210709200913.2666570-1-y.bas@phytec.de commit ca6374e267e2735fe382fe95de2a8a9c30c6bdb3 Author: Lucas De Marchi Date: Wed Jul 7 16:59:21 2021 -0700 drm/i915: Add release id version Besides the arch version returned by GRAPHICS_VER(), new platforms contain a "release id" to make clear the difference from one platform to another. The release id number is not formally defined by hardware until future platforms that will expose it via a new GMD_ID register. For the platforms we support before that register becomes available we will set the values in software and we can set them as we please. So the plan is to set them so we can group different features under a single GRAPHICS_VER_FULL() check. After GMD_ID is used, the usefulness of a "full version check" will be greatly reduced and will be mostly used for deciding workarounds and a few code paths. So it makes sense to keep it as a separate field from graphics_ver. Also, as a platform with `release == n` may be closer feature-wise to `n - 2` than to `n - 1`, use the word "release" rather than the more common "minor" for this This is a mix of 2 independent changes: one by me and the other by Matt Roper. v2: - Reword commit message to make it clearer why we don't call it "minor" (Matt Roper and Tvrtko) - Rename variables s/*_ver_release/*_rel/ and print them in a single line formatted as {ver}.{rel:2} (Jani and Matt Roper) Cc: Matt Roper Signed-off-by: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707235921.2416911-2-lucas.demarchi@intel.com commit 0f9b145a0a0ab0d3d4143c20e2ca347d8a105e33 Author: Lucas De Marchi Date: Wed Jul 7 16:59:20 2021 -0700 drm/i915: do not abbreviate version in debugfs Brevity is not needed here, so just spell out "* version" in the string. Suggested-by: Chris Wilson Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707235921.2416911-1-lucas.demarchi@intel.com commit 4de062463a863f80004bc497707b56556e77f8fa Author: Clint Taylor Date: Thu Jul 8 10:52:26 2021 -0700 drm/i915/dg1: Compute MEM Bandwidth using MCHBAR The PUNIT FW is currently returning 0 for all memory bandwidth parameters. Read the values directly from MCHBAR offsets 0x5918 and 0x4000(4). v2 (Lucas): tidy up checking for ret slightly v3 (Lucas): - Squash change to double the memory bandwidth based on MCHBAR Gear_type - Move ICL_GEAR_TYPE_MASK to the appropriate place and change prefix to DG1 - Move register definitions to i915_reg.h - Make the MCHBAR path permanent for DG1 - Convert to REG_BIT()/REG_GENMASK() v4: Drop unneeded initializations Cc: Ville Syrjälä Cc: Matt Roper Cc: Jani Saarinen Signed-off-by: Clint Taylor Signed-off-by: Jani Nikula Signed-off-by: Matthew Auld Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210708175226.2451260-1-lucas.demarchi@intel.com commit a84cb7a494316fbe718e0588e827725aa5572d73 Author: Jing Xiangfeng Date: Tue Jun 29 19:59:56 2021 +0800 drm/gma500: Add the missed drm_gem_object_put() in psb_user_framebuffer_create() psb_user_framebuffer_create() misses to call drm_gem_object_put() in an error path. Add the missed function call to fix it. Signed-off-by: Jing Xiangfeng Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20210629115956.15160-1-jingxiangfeng@huawei.com commit 710fa9aa16321f2ffdd8383f6f780c9cc1e5a197 Author: Linus Walleij Date: Thu Jul 1 23:36:18 2021 +0200 drm/panel: Fix up DT bindings for Samsung lms397kf04 Improve the bindings and make them more usable: - Pick in spi-cpha and spi-cpol from the SPI node parent, this will specify that we are "type 3" in the device tree rather than hardcoding it in the operating system. - Drop the u32 ref from the SPI frequency: comes in from the SPI host bindings. - Make spi-cpha, spi-cpol and port compulsory. - Update the example with a real-world SPI controller, spi-gpio. Cc: Noralf Trønnes Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Reviewed-by: Sam Ravnborg Reviewed-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20210701213618.3818821-1-linus.walleij@linaro.org commit 4bfe6c8f7c23b01719671b69fd29b87a35ccd9d6 Author: Rajeev Nandan Date: Sat Jun 26 22:21:08 2021 +0530 drm/panel-simple: Add Samsung ATNA33XC20 Add Samsung 13.3" FHD eDP AMOLED panel. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-7-git-send-email-rajeevny@codeaurora.org commit c20dec19358449050785ba42c702f68a86060564 Author: Rajeev Nandan Date: Sat Jun 26 22:21:07 2021 +0530 dt-bindings: display: simple: Add Samsung ATNA33XC20 Add Samsung 13.3" FHD eDP AMOLED panel. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-6-git-send-email-rajeevny@codeaurora.org commit 13aceea56fd5fcf571ac462b83646c6359699c0a Author: Rajeev Nandan Date: Sat Jun 26 22:21:06 2021 +0530 drm/panel-simple: Update validation warnings for eDP panel description Do not give a warning for the eDP panels if the "bus_format" is not specified, since most eDP panels can support more than one bus formats and this can be auto-detected. Also, update the check to include bpc=10 for the eDP panel. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-5-git-send-email-rajeevny@codeaurora.org commit 18a1488bf1e13fc3fc96d7948466b2166067c6c8 Author: Rajeev Nandan Date: Sat Jun 26 22:21:05 2021 +0530 drm/panel-simple: Support for delays between GPIO & regulator Some panels datasheets may specify a delay between the enable GPIO and the regulator. Support this in panel-simple. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-4-git-send-email-rajeevny@codeaurora.org commit bfd451403d70b13d22db097e4590fa80ba2160eb Author: Rajeev Nandan Date: Sat Jun 26 22:21:04 2021 +0530 drm/panel-simple: Support DP AUX backlight If there is no backlight specified in the device tree and the panel has access to the DP AUX channel then create a DP AUX backlight if supported by the panel. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-3-git-send-email-rajeevny@codeaurora.org commit 10f7b40e4f3050cd22a161f46a47564e8c5ce91f Author: Rajeev Nandan Date: Sat Jun 26 22:21:03 2021 +0530 drm/panel: add basic DP AUX backlight support Some panels support backlight control over DP AUX channel using VESA's standard backlight control interface. Using new DRM eDP backlight helpers, add support to create and register a backlight for those panels in drm_panel to simplify the panel drivers. The panel driver with access to "struct drm_dp_aux" can create and register a backlight device using following code snippet in its probe() function: err = drm_panel_dp_aux_backlight(panel, aux); if (err) return err; Then drm_panel will handle backlight_(enable|disable) calls similar to the case when drm_panel_of_backlight() is used. Currently, we are not supporting one feature where the source device can combine the backlight brightness levels set through DP AUX and the BL_PWM_DIM eDP connector pin. Since it's not required for the basic backlight controls, it can be added later. Signed-off-by: Rajeev Nandan Reviewed-by: Douglas Anderson Reviewed-by: Lyude Paul [dianders: added blank line for warning when applying] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-2-git-send-email-rajeevny@codeaurora.org commit 60f800b2bdfafa350e642c4e77dc646a008f2111 Author: Christian König Date: Fri Jul 2 13:16:42 2021 +0200 drm/msm: always wait for the exclusive fence Drivers also need to to sync to the exclusive fence when a shared one is present. Completely untested since the driver won't even compile on !ARM. Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210702111642.17259-5-christian.koenig@amd.com Reviewed-by: Daniel Vetter commit b3f450d9e1f386cda3e15f76efcb1b763d9a2856 Author: Matthew Auld Date: Mon Jul 5 14:53:06 2021 +0100 drm/i915: use consistent CPU mappings for pin_map users For discrete, users of pin_map() needs to obey the same rules at the TTM backend, where we map system only objects as WB, and everything else as WC. The simplest for now is to just force the correct mapping type as per the new rules for discrete. Suggested-by: Thomas Hellström Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20210705135310.1502437-1-matthew.auld@intel.com commit ea9a897b8affa0f7b4c90182b785dded74e434aa Author: Harshvardhan Jha Date: Fri Jul 9 13:09:59 2021 +0530 drm/gma500: Fix end of loop tests for list_for_each_entry The list_for_each_entry() iterator, "connector" in this code, can never be NULL. If we exit the loop without finding the correct connector then "connector" points invalid memory that is an offset from the list head. This will eventually lead to memory corruption and presumably a kernel crash. Fixes: 9bd81acdb648 ("gma500: Convert Oaktrail to work with new output handling") Signed-off-by: Harshvardhan Jha Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210709073959.11443-1-harshvardhan.jha@oracle.com commit edc2c4b9566872d30c14706b881345c131fb8b6b Author: Uma Shankar Date: Wed Jul 7 15:22:53 2021 +0530 drm/i915/display/xelpd: Fix incorrect color capability reporting On XELPD platforms, color management support is not yet enabled. Fix wrongly reporting the same through platform info, which was resulting in incorrect initialization and usage. Cc: Swati Sharma Signed-off-by: Uma Shankar Reviewed-by: Swati Sharma Link: https://patchwork.freedesktop.org/patch/msgid/20210707095253.23848-1-uma.shankar@intel.com commit 3867369ef8f760155da684e10d29e0bf9b733b48 Author: Namjae Jeon Date: Thu Jul 8 12:32:27 2021 +0900 ksmbd: change data type of volatile/persistent id to u64 This patch change data type of volatile/persistent id to u64 to make issue from idr_find and idr_remove(). !HAS_FILE_ID check will protect integer overflow issue from idr_find and idr_remove(). Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c5b53d128130b39371303a01fbbe1d7d6f519ca5 Author: Zhan Liu Date: Thu Jul 8 00:51:52 2021 -0400 drm/amdgpu/display - only update eDP's backlight level when necessary [Why] The original logic is to update eDP's backlight level on every amdgpu dm atomic commit, which causes excessive DMUB write. As a result, when playing game or moving window around, DMUB timeout and system lagging are observed. [How] We only need to update eDP's backlight level when current level doesn't match requested level. Signed-off-by: Zhan Liu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 186c8a8585e1d3b4ca50a2ccf4a413d3ba7ff186 Author: John Clements Date: Wed Jun 9 16:32:37 2021 +0800 drm/amdgpu: initialize umc ras function support umc ras function initialization for aldebaran v2: squash in compile fix Signed-off-by: John Clements Signed-off-by: Stanley.Yang Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 4818545a1dafca00826d242cc46b6ac22f8fa202 Author: Philip Yang Date: Wed Jul 7 12:42:34 2021 -0400 drm/amdkfd: handle fault counters on invalid address prange is NULL if vm fault retry on invalid address, for this case, can not use prange to get pdd, use adev to get gpuidx and then get pdd instead, then increase pdd vm fault counter. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9604b74bff62f90add4435791417cdcfee9e0c54 Author: Emily Deng Date: Tue May 12 18:27:21 2020 +0800 drm/amdgpu: Correct the irq numbers for virtual crtc The irq number should be decided by num_crtc, and the num_crtc could change by parameter. Signed-off-by: Emily Deng Reviewed by: Monk Liu Signed-off-by: Alex Deucher commit 6435af81ed2c37a29a31a6636039154c0ade0fcd Author: Xiaomeng Hou Date: Wed Jul 7 16:50:01 2021 +0800 drm/amd/display: update header file name Update the register header file name. Signed-off-by: Xiaomeng Hou Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit dde5864539624db26f67eeee1d3b6817cdfdcad3 Author: Xiaomeng Hou Date: Thu Jul 1 14:09:18 2021 +0800 drm/amd/pm: drop smu_v13_0_1.c|h files for yellow carp Since there's nothing special in smu implementation for yellow carp, it's better to reuse the common smu_v13_0 interfaces and drop the specific smu_v13_0_1.c|h files. v2: remove the duplicate register offset and shift mask header files as well. Signed-off-by: Xiaomeng Hou Reviewed-by: Lijo Lazar Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit a6556ed8ea5f01ad0ee85bde2afb4579872dff79 Author: Evan Quan Date: Fri Jun 25 15:57:40 2021 +0800 drm/amd/pm: bump DRIVER_IF_VERSION for Sienna Cichlid To suppress the annoying warning about version mismatch. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit be22e2b9f4f92ed9555fa2803a1980dec334db5a Author: Evan Quan Date: Tue Jul 6 12:27:56 2021 +0800 drm/amd/pm: update the gpu metrics data retrieving for Sienna Cichlid Due to the structure layout change: "uint32_t ThrottlerStatus" -> " uint8_t ThrottlingPercentage[THROTTLER_COUNT]". Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b407a3aa28357994ada9bd3a02c148fcebcda669 Author: Evan Quan Date: Tue Jul 6 12:25:29 2021 +0800 drm/amd/pm: new SmuMetrics data structure for Sienna Cichlid Due to the structure layout change: "uint32_t ThrottlerStatus" -> " uint8_t ThrottlingPercentage[THROTTLER_COUNT]". Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 64598e23de7873b9d47cd9b9a02daa2bb4ded343 Author: Dan Carpenter Date: Sat Jul 3 12:46:20 2021 +0300 drm/amdgpu: return -EFAULT if copy_to_user() fails If copy_to_user() fails then this should return -EFAULT instead of -EINVAL. Fixes: c65b0805e77919 ("drm/amdgpu: RAS EEPROM table is now in debugfs") Signed-off-by: Dan Carpenter Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit b8badd507a5b76a8e58c864b01116f3de43464cb Author: Dan Carpenter Date: Sat Jul 3 12:45:39 2021 +0300 drm/amdgpu: unlock on error in amdgpu_ras_debugfs_table_read() This error path needs to unlock before returning. While we're at it, the correct error code from copy_to_user() failure is -EFAULT, not -EINVAL. Fixes: c65b0805e77919 ("drm/amdgpu: RAS EEPROM table is now in debugfs") Signed-off-by: Dan Carpenter Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 911684de2a8b891603784703cd5a316fc98b3c0a Author: Beatriz Martins de Carvalho Date: Thu Jul 8 10:20:02 2021 +0100 drm/vkms: Create a debugfs file to get vkms config data Creating a vkms_config debugfs file in vkms_drv.c to get/track vkms config data, for the long-term plan of making vkms configurable and have multiple different instances. Reviewed-by: Melissa Wen Signed-off-by: Beatriz Martins de Carvalho Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20210708092002.11847-1-martinsdecarvalhobeatriz@gmail.com commit 1d864f1088bbcf7f6ffa83053dcc8684a1a436cb Author: Dan Carpenter Date: Sat Jul 3 12:44:57 2021 +0300 drm/amdgpu: Fix signedness bug in __amdgpu_eeprom_xfer() The i2c_transfer() function returns negatives or else the number of messages transferred. This code does not work because ARRAY_SIZE() is type size_t and so that means negative values of "r" are type promoted to high positive values which are greater than the ARRAY_SIZE(). Fix this by changing the < to != which works regardless of type promotion. Fixes: 746b584762e452 ("drm/amdgpu: Fixes to the AMDGPU EEPROM driver") Signed-off-by: Dan Carpenter Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 3006c9245542609d3a11b856b6d17cfce747ca88 Author: Dan Carpenter Date: Sat Jul 3 12:44:12 2021 +0300 drm/amdgpu: fix a signedness bug in __verify_ras_table_checksum() If amdgpu_eeprom_read() returns a negative error code then the error handling checks: if (res < buf_size) { The problem is that "buf_size" is a u32 so negative values are type promoted to a high positive values and the condition is false. Fix this by changing the type of "buf_size" to int. Fixes: 63d4c081a556a1 ("drm/amdgpu: Optimize EEPROM RAS table I/O") Signed-off-by: Dan Carpenter Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 7b101c95486cffbc65be4b41eda0d49f8cbb0173 Author: Aric Cyr Date: Tue Jun 22 16:17:50 2021 -0400 drm/amd/display: increase max EDID size to 2k [Why] EDID CTS requires at least 2k (16 blocks) to be readable. [How] Increase EDID buffer size to 2k Signed-off-by: Aric Cyr Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit babbdf5b3a8b7c4f5e169a7a3300d2a743c10ac6 Author: Aric Cyr Date: Mon Jun 21 12:01:45 2021 -0400 drm/amd/display: Round KHz up when calculating clock requests [Why] When requesting clocks from SMU which takes MHz inputs, DC will round down KHz when converting to MHz, thus potentially requesting too low a clock value. [How] Round up (ceil) when converting KHz to MHz for clock requests to SMU. Signed-off-by: Aric Cyr Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cc590fd27190fec00bf9ccc4e349146394e7fa87 Author: Aric Cyr Date: Sun Jun 20 23:07:37 2021 -0400 drm/amd/display: 3.2.142 DC version 3.2.142 brings improvements in multiple areas. In summary, we highlight: - Freesync improvements - Remove unnecessary assert - Firmware release 0.0.72 - Improve the EDID manipulation and DML calculations Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1e0958bb9c56ec7f1d9a337c98f617fcde504df5 Author: Anthony Koo Date: Sat Jun 19 22:53:05 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.72 - Updated SCR definition for FW boot options for Separate DCN init for DMUB FW loaded in VBL Signed-off-by: Anthony Koo Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9f95e77800f3ba14d6ef4e029240093ac53c3006 Author: Alvin Lee Date: Thu Jun 17 19:35:50 2021 -0400 drm/amd/display: Adjust types and formatting for future development Type adjustments and formatting fixes. Signed-off-by: Alvin Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cf83f5cf244ff5c383e1c7e2f1bc8a93fbaf0e30 Author: Dmytro Laktyushkin Date: Tue Jun 15 15:11:31 2021 -0400 drm/amd/display: remove faulty assert Signed-off-by: Dmytro Laktyushkin Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f5bfc11e46afdb021f37c9a8b581e0601cdf645b Author: Wesley Chalmers Date: Wed Jun 16 16:11:23 2021 -0400 Revert "drm/amd/display: Always write repeater mode regardless of LTTPR" This reverts commit 2b7605d73b97e2fa28e0817242e66ca968d2a7cb Some displays are not lighting up when put in LTTPR Transparent Mode Signed-off-by: Wesley Chalmers Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9cb2f2df669ec7abd9c4421fe8af6e50e920d5bf Author: Nicholas Kazlauskas Date: Wed Jun 16 17:11:12 2021 -0400 drm/amd/display: Fix updating infoframe for DCN3.1 eDP [Why] We're only treating TMDS as a valid target for infoframe updates which results in PSR being unable to transition from state 4 to state 5. [How] Also allow infoframe updates for DCN3.1 - following how we handle this path for earlier ASIC as well. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 46db138dc83ae16e188038358c925c560110f804 Author: Stylon Wang Date: Sat May 29 14:19:20 2021 +0800 drm/amd/display: Add Freesync HDMI support to DM with DMUB [Why] Changes in DM needed to support Freesync HDMI on DMUB. [How] Change implementation to parse CEA blocks in case of DMUB-enabled ASICs. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0713921b4ced1bf9ab8fa0bf74769f98981552ad Author: Wang Date: Tue Jun 15 17:22:57 2021 -0400 drm/amd/display: Add null checks Added NULL checks before two problematic statements Signed-off-by: Wang Reviewed-by: Martin Leung Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 556a979d3c50960acd96efded7801970bd989236 Author: Chun-Liang Chang Date: Fri Jun 11 11:05:20 2021 +0800 drm/amd/display: DMUB Outbound Interrupt Process-X86 [Why] dmub would notify x86 response time violation by GPINT_DATAOUT [How] 1. Use GPINT_DATAOUT to trigger x86 interrupt 2. Register GPINT_DATAOUT interrupt handler. 3. Trigger ACR while GPINT_DATAOUT occurred. Signed-off-by: Chun-Liang Chang Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1bc6c29f58a4e6e5e38a3a16327c07ab846c4977 Author: Wenjing Liu Date: Tue May 4 16:39:08 2021 -0400 drm/amd/display: isolate link training setting override to its own function There is a difference between our default behavior and override behavior. For default behavior we need to decide link training settings within specs' limitation and mandates. For override behavior we do not need to follow all these requirements. We are isolating override decision to its own function to maintain the integrity of our specs compliant default behavior. Signed-off-by: Wenjing Liu Reviewed-by: George Shen Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4d9f771e111ee0144338c1012a90f1762220141a Author: Luben Tuikov Date: Fri Jul 2 18:35:14 2021 -0400 drm/amdgpu: Return error if no RAS In amdgpu_ras_query_error_count() return an error if the device doesn't support RAS. This prevents that function from having to always set the values of the integer pointers (if set), and thus prevents function side effects--always to have to set values of integers if integer pointers set, regardless of whether RAS is supported or not--with this change this side effect is mitigated. Also, if no pointers are set, don't count, since we've no way of reporting the counts. Also, give this function a kernel-doc. Cc: Alexander Deucher Cc: John Clements Cc: Hawking Zhang Reported-by: Tom Rix Fixes: a46751fbcde505 ("drm/amdgpu: Fix RAS function interface") Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit b5840166dcb8bb03daa420f6c84eb78d46b713e7 Author: Jingwen Chen Date: Thu Jul 1 10:19:17 2021 +0800 drm/amdgpu: SRIOV flr_work should take write_lock [Why] If flr_work takes read_lock, then other threads who takes read_lock can access hardware when host is doing vf flr. [How] flr_work should take write_lock to avoid this case. Signed-off-by: Jingwen Chen Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit c0838d3a93fc5e51b4a9654f53f499da1778dad8 Author: Luben Tuikov Date: Fri Jul 2 19:58:42 2021 -0400 drm/amdgpu: The I2C IP doesn't support 0 writes/reads The I2C IP doesn't support writes or reads of 0 bytes. In order for a START/STOP transaction to take place on the bus, the data written/read has to be at least one byte. That is, you cannot generate a write with 0 bytes, just to get the ACK from a device, just so you can probe that device if it is on the bus and so to discover all devices on the bus--you'll have to read at least one byte. Writes of 0 bytes generate no START/STOP on this I2C IP--the bus is not engaged at all. Set the I2C_AQ_NO_ZERO_LEN to the existing I2C quirk tables for Aldebaran, Arcturus, Navi10 and Sienna Cichlid, and add a quirk table to the I2C driver which drives the bus when the SMU doesn't--for instance on Vega20. Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: John Clements Cc: Hawking Zhang Signed-off-by: Luben Tuikov Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ae87df077554347e89d39a7383e74547401c7f5d Author: Luben Tuikov Date: Fri Jul 2 19:58:42 2021 -0400 drm/amd/pm: Add I2C quirk table to Aldebaran Add I2C quirk table to Aldebaran. Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: John Clements Cc: Hawking Zhang Signed-off-by: Luben Tuikov Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 5af4438f1e830d090183c5f329d2ddbb09f3a5ee Author: YuBiao Wang Date: Tue Jun 29 11:21:25 2021 +0800 drm/amdgpu: Read clock counter via MMIO to reduce delay (v5) [Why] GPU timing counters are read via KIQ under sriov, which will introduce a delay. [How] It could be directly read by MMIO. v2: Add additional check to prevent carryover issue. v3: Only check for carryover for once to prevent performance issue. v4: Add comments of the rough frequency where carryover happens. v5: Remove mutex and gfxoff ctrl unused with current timing registers. Signed-off-by: YuBiao Wang Acked-by: Horace Chen Reviewed-by: Christian König Reviewed-by: Monk Liu Reviewed-by: Lijo Lazar Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 51627f03804173a64d23828bc9e4d8474451814f Author: Eric Huang Date: Wed Jun 30 17:58:12 2021 -0400 drm/amdkfd: Only apply TLB flush optimization on ALdebaran It is based on reverting two patches back. drm/amdkfd: Make TLB flush conditional on mapping drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update Signed-off-by: Eric Huang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 88f7f88159bcdff96b2a5d244b26c8ba99b5e773 Author: Nirmoy Das Date: Fri Jul 2 11:10:52 2021 +0200 drm/amdgpu: separate out vm pasid assignment Use new helper function amdgpu_vm_set_pasid() to assign vm pasid value. This also ensures that we don't free a pasid from vm code as pasids are allocated somewhere else. Signed-off-by: Nirmoy Das Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit dcb388eddb5f1bbc817d0e9ba341908b0a201ff2 Author: Nirmoy Das Date: Mon Jun 28 23:29:39 2021 +0200 drm/amdgpu: use xarray for storing pasid in vm Replace idr with xarray as we actually need hash functionality. Cleanup code related to vm pasid by adding helper function. Signed-off-by: Nirmoy Das Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ca06f93638362bf83584cdf33897822bf1578cf9 Author: Jason Ekstrand Date: Thu Jul 8 10:48:35 2021 -0500 drm/i915: Finalize contexts in GEM_CONTEXT_CREATE on version 13+ All the proto-context stuff for context creation exists to allow older userspace drivers to set VMs and engine sets via SET_CONTEXT_PARAM. Drivers need to update to use CONTEXT_CREATE_EXT_* for this going forward. Force the issue by blocking the old mechanism on any future hardware generations. Signed-off-by: Jason Ekstrand Cc: Jon Bloomfield Cc: Carl Zhang Cc: Michal Mrozek Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-31-jason@jlekstrand.net commit 0eee9977f9d3d8f1e40175dada55b3d00121ac79 Author: Jason Ekstrand Date: Thu Jul 8 10:48:34 2021 -0500 drm/i915/gem: Roll all of context creation together Now that we have the whole engine set and VM at context creation time, we can just assign those fields instead of creating first and handling the VM and engines later. This lets us avoid creating useless VMs and engine sets and lets us get rid of the complex VM setting code. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-30-jason@jlekstrand.net commit f92906e220f1f130995a67817cfec7f305a55bfc Author: Jason Ekstrand Date: Thu Jul 8 10:48:33 2021 -0500 i915/gem/selftests: Assign the VM at context creation in igt_shared_ctx_exec We want to delete __assign_ppgtt and, generally, stop setting the VM after context creation. This is the one place I could find in the selftests where we set a VM after the fact. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-29-jason@jlekstrand.net commit 5888d588597408ea8208e89497dbbdb72d405071 Author: Jason Ekstrand Date: Thu Jul 8 10:48:32 2021 -0500 drm/i915/selftests: Take a VM in kernel_context() This better models where we want to go with contexts in general where things like the VM and engine set are create parameters instead of being set after the fact. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-28-jason@jlekstrand.net commit d9d29c747df844e946ecd6089893be80c5d32403 Author: Jason Ekstrand Date: Thu Jul 8 10:48:31 2021 -0500 drm/i915/gem: Don't allow changing the engine set on running contexts (v3) When the APIs were added to manage the engine set on a GEM context directly from userspace, the questionable choice was made to allow changing the engine set on a context at any time. This is horribly racy and there's absolutely no reason why any userspace would want to do this outside of trying to exercise interesting race conditions. By removing support for CONTEXT_PARAM_ENGINES from ctx_setparam, we make it impossible to change the engine set after the context has been fully created. This doesn't yet let us delete all the deferred engine clean-up code as that's still used for handling the case where the client dies or calls GEM_CONTEXT_DESTROY while work is in flight. However, moving to an API where the engine set is effectively immutable gives us more options to potentially clean that code up a bit going forward. It also removes a whole class of ways in which a client can hurt itself or try to get around kernel context banning. v2 (Jason Ekstrand): - Expand the commit mesage v3 (Jason Ekstrand): - Make it more obvious that I915_CONTEXT_PARAM_ENGINES returns -EINVAL Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-27-jason@jlekstrand.net commit ccbc1b97948ab671335e950271e39766729736c3 Author: Jason Ekstrand Date: Thu Jul 8 10:48:30 2021 -0500 drm/i915/gem: Don't allow changing the VM on running contexts (v4) When the APIs were added to manage VMs more directly from userspace, the questionable choice was made to allow changing out the VM on a context at any time. This is horribly racy and there's absolutely no reason why any userspace would want to do this outside of testing that exact race. By removing support for CONTEXT_PARAM_VM from ctx_setparam, we make it impossible to change out the VM after the context has been fully created. This lets us delete a bunch of deferred task code as well as a duplicated (and slightly different) copy of the code which programs the PPGTT registers. v2 (Jason Ekstrand): - Expand the commit message v3 (Daniel Vetter): - Don't drop the __rcu on the vm pointer v4 (Jason Ekstrand): - Make it more obvious that I915_CONTEXT_PARAM_VM returns -EINVAL Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-26-jason@jlekstrand.net commit a4c1cdd34e2cda620c9749ae6adec49b4b011d47 Author: Jason Ekstrand Date: Thu Jul 8 10:48:29 2021 -0500 drm/i915/gem: Delay context creation (v3) The current context uAPI allows for two methods of setting context parameters: SET_CONTEXT_PARAM and CONTEXT_CREATE_EXT_SETPARAM. The former is allowed to be called at any time while the later happens as part of GEM_CONTEXT_CREATE. Currently, everything settable via one is settable via the other. While some params are fairly simple and setting them on a live context is harmless such as the context priority, others are far trickier such as the VM or the set of engines. In order to swap out the VM, for instance, we have to delay until all current in-flight work is complete, swap in the new VM, and then continue. This leads to a plethora of potential race conditions we'd really rather avoid. In previous patches, we added a i915_gem_proto_context struct which is capable of storing and tracking all such create parameters. This commit delays the creation of the actual context until after the client is done configuring it with SET_CONTEXT_PARAM. From the perspective of the client, it has the same u32 context ID the whole time. From the perspective of i915, however, it's an i915_gem_proto_context right up until the point where we attempt to do something which the proto-context can't handle. Then the real context gets created. This is accomplished via a little xarray dance. When GEM_CONTEXT_CREATE is called, we create a proto-context, reserve a slot in context_xa but leave it NULL, the proto-context in the corresponding slot in proto_context_xa. Then, whenever we go to look up a context, we first check context_xa. If it's there, we return the i915_gem_context and we're done. If it's not, we look in proto_context_xa and, if we find it there, we create the actual context and kill the proto-context. In order for this dance to work properly, everything which ever touches a proto-context is guarded by drm_i915_file_private::proto_context_lock, including context creation. Yes, this means context creation now takes a giant global lock but it can't really be helped and that should never be on any driver's fast-path anyway. v2 (Daniel Vetter): - Commit message grammatical fixes. - Use WARN_ON instead of GEM_BUG_ON - Rename lazy_create_context_locked to finalize_create_context_locked - Rework the control-flow logic in the setparam ioctl - Better documentation all around v3 (kernel test robot): - Make finalize_create_context_locked static Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-25-jason@jlekstrand.net commit 8579d37eff4d3ec2987128b156a90bebc3ab5aca Author: Jason Ekstrand Date: Thu Jul 8 10:48:28 2021 -0500 drm/i915/gt: Drop i915_address_space::file (v2) There's a big comment saying how useful it is but no one is using this for anything anymore. It was added in 2bfa996e031b ("drm/i915: Store owning file on the i915_address_space") and used for debugfs at the time as well as telling the difference between the global GTT and a PPGTT. In f6e8aa387171 ("drm/i915: Report the number of closed vma held by each context in debugfs") we removed one use of it by switching to a context walk and comparing with the VM in the context. Finally, VM stats for debugfs were entirely nuked in db80a1294c23 ("drm/i915/gem: Remove per-client stats from debugfs/i915_gem_objects") v2 (Daniel Vetter): - Delete a struct drm_i915_file_private pre-declaration - Add a comment to the commit message about history Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-24-jason@jlekstrand.net commit 046d1660daee31e49b20df538ca9e2c22bd2bfb3 Author: Jason Ekstrand Date: Thu Jul 8 10:48:27 2021 -0500 drm/i915/gem: Return an error ptr from context_lookup We're about to start doing lazy context creation which means contexts get created in i915_gem_context_lookup and we may start having more errors than -ENOENT. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-23-jason@jlekstrand.net commit d4433c7600f794623d6802395542cf4ca4f1b1f9 Author: Jason Ekstrand Date: Thu Jul 8 10:48:26 2021 -0500 drm/i915/gem: Use the proto-context to handle create parameters (v5) This means that the proto-context needs to grow support for engine configuration information as well as setparam logic. Fortunately, we'll be deleting a lot of setparam logic on the primary context shortly so it will hopefully balance out. There's an extra bit of fun here when it comes to setting SSEU and the way it interacts with PARAM_ENGINES. Unfortunately, thanks to SET_CONTEXT_PARAM and not being allowed to pick the order in which we handle certain parameters, we have think about those interactions. v2 (Daniel Vetter): - Add a proto_context_free_user_engines helper - Comment on SSEU in the commit message - Use proto_context_set_persistence in set_proto_ctx_param v3 (Daniel Vetter): - Fix a doc comment - Do an explicit HAS_FULL_PPGTT check in set_proto_ctx_vm instead of relying on pc->vm != NULL. - Handle errors for CONTEXT_PARAM_PERSISTENCE - Don't allow more resetting user engines - Rework initialization of UCONTEXT_PERSISTENCE v4 (Jason Ekstrand): - Move hand-rolled initialization of UCONTEXT_PERSISTENCE to an earlier patch v5 (Jason Ekstrand): - Move proto_context_set_persistence to this patch Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-22-jason@jlekstrand.net commit def25b7bc342d7eb6643408300127404608d3df2 Author: Jason Ekstrand Date: Thu Jul 8 10:48:25 2021 -0500 drm/i915/gem: Make an alignment check more sensible What we really want to check is that size of the engines array, i.e. args->size - sizeof(*user) is divisible by the element size, i.e. sizeof(*user->engines) because that's what's required for computing the array length right below the check. However, we're currently not doing this and instead doing a compile-time check that sizeof(*user) is divisible by sizeof(*user->engines) and avoiding the subtraction. As far as I can tell, the only reason for the more confusing pair of checks is to avoid a single subtraction of a constant. The other thing the BUILD_BUG_ON might be trying to implicitly check is that offsetof(user->engines) == sizeof(*user) and we don't have any weird padding throwing us off. However, that's not the check it's doing and it's not even a reliable way to do that check. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-21-jason@jlekstrand.net commit bc2ceb7a08758357ed2ff1d876dc9d60bdefb080 Author: Jason Ekstrand Date: Thu Jul 8 10:48:24 2021 -0500 drm/i915: Add an i915_gem_vm_lookup helper This is the VM equivalent of i915_gem_context_lookup. It's only used once in this patch but future patches will need to duplicate this lookup code so it's better to have it in a helper. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-20-jason@jlekstrand.net commit 263ae12c3c8de253ebd33b99518297877d1892c5 Author: Jason Ekstrand Date: Thu Jul 8 10:48:23 2021 -0500 drm/i915/gem: Optionally set SSEU in intel_context_set_gem For now this is a no-op because everyone passes in a null SSEU but it lets us get some of the error handling and selftest refactoring plumbed through. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-19-jason@jlekstrand.net commit 07a635a825e6649f7c6dbea55e2a0557c30f1a73 Author: Jason Ekstrand Date: Thu Jul 8 10:48:22 2021 -0500 drm/i915/gem: Rework error handling in default_engines Since free_engines works for partially constructed engine sets, we can use the usual goto pattern. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-18-jason@jlekstrand.net commit a34857dc92475a926cbfbebcba8fb1f1b1c6056b Author: Jason Ekstrand Date: Thu Jul 8 10:48:21 2021 -0500 drm/i915/gem: Add an intermediate proto_context struct (v5) The current context uAPI allows for two methods of setting context parameters: SET_CONTEXT_PARAM and CONTEXT_CREATE_EXT_SETPARAM. The former is allowed to be called at any time while the later happens as part of GEM_CONTEXT_CREATE. Currently, everything settable via one is settable via the other. While some params are fairly simple and setting them on a live context is harmless such the context priority, others are far trickier such as the VM or the set of engines. In order to swap out the VM, for instance, we have to delay until all current in-flight work is complete, swap in the new VM, and then continue. This leads to a plethora of potential race conditions we'd really rather avoid. Unfortunately, both methods of setting the VM and the engine set are in active use today so we can't simply disallow setting the VM or engine set vial SET_CONTEXT_PARAM. In order to work around this wart, this commit adds a proto-context struct which contains all the context create parameters. v2 (Daniel Vetter): - Better commit message - Use __set/clear_bit instead of set/clear_bit because there's no race and we don't need the atomics v3 (Daniel Vetter): - Use manual bitops and BIT() instead of __set_bit v4 (Daniel Vetter): - Add a changelog to the commit message - Better hyperlinking in docs - Create the default PPGTT in i915_gem_create_context v5 (Daniel Vetter): - Hand-roll the initialization of UCONTEXT_PERSISTENCE Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-17-jason@jlekstrand.net commit f8a9a5c2e9058bcfc3a3d5b444d10fd8f20cb29e Author: Jason Ekstrand Date: Thu Jul 8 10:48:20 2021 -0500 drm/i915: Add gem/i915_gem_context.h to the docs In order to prevent kernel doc warnings, also fill out docs for any missing fields and fix those that forgot the "@". Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-16-jason@jlekstrand.net commit aaa5957c97592baa62ae5ce8079b18f94b1241f8 Author: Jason Ekstrand Date: Thu Jul 8 10:48:19 2021 -0500 drm/i915/gem: Add a separate validate_priority helper With the proto-context stuff added later in this series, we end up having to duplicate set_priority. This lets us avoid duplicating the validation logic. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-15-jason@jlekstrand.net commit a4839cb1137b0df1303072473e8fd1b32daaeb13 Author: Jason Ekstrand Date: Thu Jul 8 10:48:18 2021 -0500 drm/i915: Stop manually RCU banging in reset_stats_ioctl (v2) As far as I can tell, the only real reason for this is to avoid taking a reference to the i915_gem_context. The cost of those two atomics probably pales in comparison to the cost of the ioctl itself so we're really not buying ourselves anything here. We're about to make context lookup a tiny bit more complicated, so let's get rid of the one hand- rolled case. Some usermode drivers such as our Vulkan driver call GET_RESET_STATS on every execbuf so the perf here could theoretically be an issue. If this ever does become a performance issue for any such userspace drivers, they can use set CONTEXT_PARAM_RECOVERABLE to false and look for -EIO coming from execbuf to check for hangs instead. v2 (Daniel Vetter): - Add a comment in the commit message about recoverable contexts Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-14-jason@jlekstrand.net commit ebb1ca741bee54e833ecabbd95090c92210c65d2 Author: Jason Ekstrand Date: Thu Jul 8 10:48:17 2021 -0500 drm/i915/gem: Disallow creating contexts with too many engines There's no sense in allowing userspace to create more engines than it can possibly access via execbuf. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-13-jason@jlekstrand.net commit 5ac545b8b0145cfa8123f8e9ddc066da49eec261 Author: Jason Ekstrand Date: Thu Jul 8 10:48:16 2021 -0500 drm/i915/request: Remove the hook from await_execution This was only ever used for FENCE_SUBMIT automatic engine selection which was removed in the previous commit. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-12-jason@jlekstrand.net commit dd4f1bbae8f9b4faa38b697e3ff248eb0f4404f6 Author: Jason Ekstrand Date: Thu Jul 8 10:48:15 2021 -0500 drm/i915/gem: Remove engine auto-magic with FENCE_SUBMIT (v2) Even though FENCE_SUBMIT is only documented to wait until the request in the in-fence starts instead of waiting until it completes, it has a bit more magic than that. If FENCE_SUBMIT is used to submit something to a balanced engine, we would wait to assign engines until the primary request was ready to start and then attempt to assign it to a different engine than the primary. There is an IGT test (the bonded-slice subtest of gem_exec_balancer) which exercises this by submitting a primary batch to a specific VCS and then using FENCE_SUBMIT to submit a secondary which can run on any VCS and have i915 figure out which VCS to run it on such that they can run in parallel. However, this functionality has never been used in the real world. The media driver (the only user of FENCE_SUBMIT) always picks exactly two physical engines to bond and never asks us to pick which to use. v2 (Daniel Vetter): - Mention the exact IGT test this breaks Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-11-jason@jlekstrand.net commit 521695c6f1a308058967612f4b94435445bccb34 Author: Jason Ekstrand Date: Thu Jul 8 10:48:14 2021 -0500 drm/i915/gem: Disallow bonding of virtual engines (v3) This adds a bunch of complexity which the media driver has never actually used. The media driver does technically bond a balanced engine to another engine but the balanced engine only has one engine in the sibling set. This doesn't actually result in a virtual engine. This functionality was originally added to handle cases where we may have more than two video engines and media might want to load-balance their bonded submits by, for instance, submitting to a balanced vcs0-1 as the primary and then vcs2-3 as the secondary. However, no such hardware has shipped thus far and, if we ever want to enable such use-cases in the future, we'll use the up-and-coming parallel submit API which targets GuC submission. This makes I915_CONTEXT_ENGINES_EXT_BOND a total no-op. We leave the validation code in place in case we ever decide we want to do something interesting with the bonding information. v2 (Jason Ekstrand): - Don't delete quite as much code. v3 (Tvrtko Ursulin): - Add some history to the commit message Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-10-jason@jlekstrand.net commit c7a71fc8ee04669037501da2f987f0732e8754ee Author: Jason Ekstrand Date: Thu Jul 8 10:48:13 2021 -0500 drm/i915: Drop getparam support for I915_CONTEXT_PARAM_ENGINES This has never been used by any userspace except IGT and provides no real functionality beyond parroting back parameters userspace passed in as part of context creation or via setparam. If the context is in legacy mode (where you use I915_EXEC_RENDER and friends), it returns success with zero data so it's not useful for discovering what engines are in the context. It's also not a replacement for the recently removed I915_CONTEXT_CLONE_ENGINES because it doesn't return any of the balancing or bonding information. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-9-jason@jlekstrand.net commit 00dae4d3d35d4f526929633b76e00b0ab4d3970d Author: Jason Ekstrand Date: Thu Jul 8 10:48:12 2021 -0500 drm/i915: Implement SINGLE_TIMELINE with a syncobj (v4) This API is entirely unnecessary and I'd love to get rid of it. If userspace wants a single timeline across multiple contexts, they can either use implicit synchronization or a syncobj, both of which existed at the time this feature landed. The justification given at the time was that it would help GL drivers which are inherently single-timeline. However, neither of our GL drivers actually wanted the feature. i965 was already in maintenance mode at the time and iris uses syncobj for everything. Unfortunately, as much as I'd love to get rid of it, it is used by the media driver so we can't do that. We can, however, do the next-best thing which is to embed a syncobj in the context and do exactly what we'd expect from userspace internally. This isn't an entirely identical implementation because it's no longer atomic if userspace races with itself by calling execbuffer2 twice simultaneously from different threads. It won't crash in that case; it just doesn't guarantee any ordering between those two submits. It also means that sync files exported from different engines on a SINGLE_TIMELINE context will have different fence contexts. This is visible to userspace if it looks at the obj_name field of sync_fence_info. Moving SINGLE_TIMELINE to a syncobj emulation has a couple of technical advantages beyond mere annoyance. One is that intel_timeline is no longer an api-visible object and can remain entirely an implementation detail. This may be advantageous as we make scheduler changes going forward. Second is that, together with deleting the CLONE_CONTEXT API, we should now have a 1:1 mapping between intel_context and intel_timeline which may help us reduce locking. v2 (Tvrtko Ursulin): - Update the comment on i915_gem_context::syncobj to mention that it's an emulation and the possible race if userspace calls execbuffer2 twice on the same context concurrently. v2 (Jason Ekstrand): - Wrap the checks for eb.gem_context->syncobj in unlikely() - Drop the dma_fence reference - Improved commit message v3 (Jason Ekstrand): - Move the dma_fence_put() to before the error exit v4 (Tvrtko Ursulin): - Add a comment about fence contexts to the commit message Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-8-jason@jlekstrand.net commit 4a766ae40ec8330103a27922b5aa978fdf8bc005 Author: Jason Ekstrand Date: Thu Jul 8 10:48:11 2021 -0500 drm/i915: Drop the CONTEXT_CLONE API (v2) This API allows one context to grab bits out of another context upon creation. It can be used as a short-cut for setparam(getparam()) for things like I915_CONTEXT_PARAM_VM. However, it's never been used by any real userspace. It's used by a few IGT tests and that's it. Since it doesn't add any real value (most of the stuff you can CLONE you can copy in other ways), drop it. There is one thing that this API allows you to clone which you cannot clone via getparam/setparam: timelines. However, timelines are an implementation detail of i915 and not really something that needs to be exposed to userspace. Also, sharing timelines between contexts isn't obviously useful and supporting it has the potential to complicate i915 internally. It also doesn't add any functionality that the client can't get in other ways. If a client really wants a shared timeline, they can use a syncobj and set it as an in and out fence on every submit. v2 (Jason Ekstrand): - More detailed commit message Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-7-jason@jlekstrand.net commit 8cc256a24da14d74c68721f28d7a75c68ebf6552 Author: Jason Ekstrand Date: Thu Jul 8 10:48:10 2021 -0500 drm/i915/gem: Return void from context_apply_all None of the callbacks we use with it return an error code anymore; they all return 0 unconditionally. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-6-jason@jlekstrand.net commit 677db6adc57ddee1f39a14c49ccc1623c39a03f2 Author: Jason Ekstrand Date: Thu Jul 8 10:48:09 2021 -0500 drm/i915/gem: Set the watchdog timeout directly in intel_context_set_gem (v2) Instead of handling it like a context param, unconditionally set it when intel_contexts are created. For years we've had the idea of a watchdog uAPI floating about. The aim was for media, so that they could set very tight deadlines for their transcodes jobs, so that if you have a corrupt bitstream (especially for decoding) you don't hang your desktop too hard. But it's been stuck in limbo since forever, and this simplifies things a bit in preparation for the proto-context work. If we decide to actually make said uAPI a reality, we can do it through the proto- context easily enough. This does mean that we move from reading the request_timeout_ms param once per engine when engines are created instead of once at context creation. If someone changes request_timeout_ms between creating a context and setting engines, it will mean that they get the new timeout. If someone races setting request_timeout_ms and context creation, they can theoretically end up with different timeouts. However, since both of these are fairly harmless and require changing kernel params, we don't care. v2 (Tvrtko Ursulin): - Add a comment about races with request_timeout_ms Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-5-jason@jlekstrand.net commit 6ff6d61dd2a943bd0c80bb77eb5630e8aa0cac15 Author: Jason Ekstrand Date: Thu Jul 8 10:48:08 2021 -0500 drm/i915: Drop I915_CONTEXT_PARAM_NO_ZEROMAP The idea behind this param is to support OpenCL drivers with relocations because OpenCL reserves 0x0 for NULL and, if we placed memory there, it would confuse CL kernels. It was originally sent out as part of a patch series including libdrm [1] and Beignet [2] support. However, the libdrm and Beignet patches never landed in their respective upstream projects so this API has never been used. It's never been used in Mesa or any other driver, either. Dropping this API allows us to delete a small bit of code. [1]: https://lists.freedesktop.org/archives/intel-gfx/2015-May/067030.html [2]: https://lists.freedesktop.org/archives/intel-gfx/2015-May/067031.html Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-4-jason@jlekstrand.net commit 74e4b90988b25d7bb60cf072b0f1b1afc1af27d5 Author: Jason Ekstrand Date: Thu Jul 8 10:48:07 2021 -0500 drm/i915: Stop storing the ring size in the ring pointer (v3) Previously, we were storing the ring size in the ring pointer before it was actually allocated. We would then guard setting the ring size on checking for CONTEXT_ALLOC_BIT. This is error-prone at best and really only saves us a few bytes on something that already burns at least 4K. Instead, this patch adds a new ring_size field and makes everything use that. v2 (Daniel Vetter): - Replace 512 * SZ_4K with SZ_2M v2 (Jason Ekstrand): - Rebase on top of page migration code Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-3-jason@jlekstrand.net commit fe4751c3d513ff4f5422dbf55a966abafe39255e Author: Jason Ekstrand Date: Thu Jul 8 10:48:06 2021 -0500 drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE This reverts commit 88be76cdafc7 ("drm/i915: Allow userspace to specify ringsize on construction"). This API was originally added for OpenCL but the compute-runtime PR has sat open for a year without action so we can still pull it out if we want. I argue we should drop it for three reasons: 1. If the compute-runtime PR has sat open for a year, this clearly isn't that important. 2. It's a very leaky API. Ring size is an implementation detail of the current execlist scheduler and really only makes sense there. It can't apply to the older ring-buffer scheduler on pre-execlist hardware because that's shared across all contexts and it won't apply to the GuC scheduler that's in the pipeline. 3. Having userspace set a ring size in bytes is a bad solution to the problem of having too small a ring. There is no way that userspace has the information to know how to properly set the ring size so it's just going to detect the feature and always set it to the maximum of 512K. This is what the compute-runtime PR does. The scheduler in i915, on the other hand, does have the information to make an informed choice. It could detect if the ring size is a problem and grow it itself. Or, if that's too hard, we could just increase the default size from 16K to 32K or even 64K instead of relying on userspace to do it. Let's drop this API for now and, if someone decides they really care about solving this problem, they can do it properly. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-2-jason@jlekstrand.net commit 520dfc807d315bc33f0c80a518973791f31dfbd6 Author: John Harrison Date: Fri Jun 25 17:45:22 2021 -0700 drm/i915/adlp: Add ADL-P GuC/HuC firmware files Add ADL-P to the list of supported GuC and HuC firmware versions. For HuC, it reuses the existing TGL firmware file. For GuC, there is a dedicated firmware release. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20210626004522.1699509-3-John.C.Harrison@Intel.com commit 4a832721238c3a552342a282f00fdde25bc3c2a7 Author: John Harrison Date: Fri Jun 25 17:45:21 2021 -0700 drm/i915/huc: Update TGL and friends to HuC 7.9.3 A new HuC is available for TGL and compatible platforms, so switch to using it. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20210626004522.1699509-2-John.C.Harrison@Intel.com commit 11e4b63abbe23872b45f325a7c6c8b7f9ff42cad Author: Petr Mladek Date: Fri Jul 2 17:06:57 2021 +0200 printk/console: Check consistent sequence number when handling race in console_unlock() The standard printk() tries to flush the message to the console immediately. It tries to take the console lock. If the lock is already taken then the current owner is responsible for flushing even the new message. There is a small race window between checking whether a new message is available and releasing the console lock. It is solved by re-checking the state after releasing the console lock. If the check is positive then console_unlock() tries to take the lock again and process the new message as well. The commit 996e966640ddea7b535c ("printk: remove logbuf_lock") causes that console_seq is not longer read atomically. As a result, the re-check might be done with an inconsistent 64-bit index. Solve it by using the last sequence number that has been checked under the console lock. In the worst case, it will take the lock again only to realized that the new message has already been proceed. But it was possible even before. The variable next_seq is marked as __maybe_unused to call down compiler warning when CONFIG_PRINTK is not defined. Fixes: commit 996e966640ddea7b535c ("printk: remove logbuf_lock") Reported-by: kernel test robot # unused next_seq warning Cc: stable@vger.kernel.org # 5.13 Signed-off-by: Petr Mladek Acked-by: Sergey Senozhatsky Reviewed-by: John Ogness Link: https://lore.kernel.org/r/20210702150657.26760-1-pmladek@suse.com commit eafaa3e962999091252e6ad667d5da69fce1fdb3 Author: Matt Roper Date: Wed Jul 7 16:42:06 2021 -0700 drm/i915: Handle cdclk crawling flag in standard manner The 'has_cdclk_crawl' field in our device info structure is a boolean flag and doesn't need a whole u8. Add it as another 1-bit feature flag and move it to the display section. While we're at it, replace the has_cdclk_crawl() function with a macro for consistency with our handling of other feature flags. Cc: Stanislav Lisovskiy Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707234206.2002849-1-matthew.d.roper@intel.com Reviewed-by: Jani Nikula commit 3e1ad79bf66165bdb2baca3989f9227939241f11 Author: Christian König Date: Sun Jun 6 11:50:15 2021 +0200 drm/nouveau: always wait for the exclusive fence Drivers also need to to sync to the exclusive fence when a shared one is present. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702111642.17259-4-christian.koenig@amd.com commit 9d38814d1e346ea37a51cbf31f4424c9d059459e Author: Christian König Date: Sun Jun 6 11:46:33 2021 +0200 dma-buf: fix dma_resv_test_signaled test_all handling v2 As the name implies if testing all fences is requested we should indeed test all fences and not skip the exclusive one because we see shared ones. v2: fix logic once more Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702111642.17259-3-christian.koenig@amd.com commit a0356899ebe8ecde0da9c5685cc47154db973a5e Author: Noralf Trønnes Date: Sat Jul 3 16:13:21 2021 +0200 drm/gud: Add async_flush module parameter Provide a way for userspace to choose synchronous flushing/pageflips. This helps save CPU and power. It is also useful for test scripts since userspace can know when a flush has happended and wait before doing the next visual test. Cc: Linus Walleij Signed-off-by: Noralf Trønnes Reviewed-by: Peter Stuge Link: https://patchwork.freedesktop.org/patch/msgid/20210703141321.35494-2-noralf@tronnes.org commit b3f4ef669357d5b9a2c5e8c33e3967a2070db7f9 Author: Noralf Trønnes Date: Sat Jul 3 16:13:20 2021 +0200 drm/gud: Add Raspberry Pi Pico ID Add VID/PID for the Raspberry Pi Pico implementation. Source: https://github.com/notro/gud-pico Cc: Linus Walleij Signed-off-by: Noralf Trønnes Reviewed-by: Peter Stuge Link: https://patchwork.freedesktop.org/patch/msgid/20210703141321.35494-1-noralf@tronnes.org commit 2eecd93b743b5611cd3654698794b4d0cefdc9ee Author: Noralf Trønnes Date: Thu Jul 1 19:07:48 2021 +0200 drm/gud: Use scatter-gather USB bulk transfer There'a limit to how big a kmalloc buffer can be, and as memory gets fragmented it becomes more difficult to get big buffers. The downside of smaller buffers is that the driver has to split the transfer up which hampers performance. Compression might also take a hit because of the splitting. Solve this by allocating the transfer buffer using vmalloc and create a SG table to be passed on to the USB subsystem. vmalloc_32() is used to avoid DMA bounce buffers on USB controllers that can only access 32-bit addresses. This also solves the problem that split transfers can give host side tearing since flushing is decoupled from rendering. usb_sg_wait() doesn't have timeout handling builtin, so it is wrapped in a timer like 4 out of 6 users in the kernel have done. v2: - Use DIV_ROUND_UP (Linus) - Add timeout note to the commit log (Linus) - Expand note about upper buffer limit (Linus) - Change var name s/timer/ctx/ in gud_usb_bulk_timeout() Reviewed-by: Linus Walleij Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20210701170748.58009-2-noralf@tronnes.org commit f8ac863b6a93863334cefb94285daaa6617381b5 Author: Noralf Trønnes Date: Thu Jul 1 19:07:47 2021 +0200 drm/gud: Free buffers on device removal Free transfer and compression buffers on device removal instead of at DRM device removal time. This ensures that the usual 2x8MB buffers are released when the device is unplugged and not kept around should userspace keep the DRM device fd open. At least Ubuntu 20.04 doesn't release the DRM device on unplug. The damage_lock mutex is not destroyed because it is used outside the drm_dev_enter/exit block in gud_pipe_update(). AFAICT it's possible for an open fbdev descriptor to trigger a commit after the USB device is gone. v2: Don't destroy damage_lock Reviewed-by: Linus Walleij Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20210701170748.58009-1-noralf@tronnes.org commit 39a364a19e0353d4f8e169b6174945909a409dca Author: Thomas Zimmermann Date: Tue Jul 6 09:54:25 2021 +0200 drm/hisilicon/hibmc: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. Signed-off-by: Thomas Zimmermann Reviewed-by: Tian Tao Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210706075425.9257-1-tzimmermann@suse.de commit b0fee7df43cf8b4c68168986a630a340c5d9bfb3 Author: Thomas Zimmermann Date: Tue Jul 6 09:22:53 2021 +0200 drm/vmwgfx: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. Vmwgfx already uses Linux IRQ functions. All that's left to replace is the reference to struct drm_device.irq. Use irq value of struct pci_dev instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210706072253.6844-1-tzimmermann@suse.de commit 9ca41d1fcf58d1eb3c058259e226fadc5ee07a87 Author: Thomas Zimmermann Date: Tue Jul 6 09:27:12 2021 +0200 drm/arm/komeda: Don't include drm_irq.h The header file is not required. Don't include it. Signed-off-by: Thomas Zimmermann Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20210706072712.7558-1-tzimmermann@suse.de commit 65a969655cb91fa7d8796327bc25cc0262adf7b3 Author: Thomas Zimmermann Date: Tue Jul 6 09:45:45 2021 +0200 drm/meson: Convert to Linux IRQ interfaces Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. Signed-off-by: Thomas Zimmermann Reviewed-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20210706074545.8763-1-tzimmermann@suse.de commit 7915d561294521781f0e3a8cf7b5832fe9af2578 Author: Thomas Zimmermann Date: Thu Jun 24 11:05:00 2021 +0200 drm/qxl: Remove empty qxl_gem_prime_mmap() The function qxl_gem_prime_mmap() returns an error. The two callers of gem_prime_mmap are drm_fbdev_fb_mmap() and drm_gem_dmabuf_mmap(), which both already handle NULL-callbacks with an error code. So clear gem_prime_mmap in qxl and remove qxl_gem_prime_mmap(). Signed-off-by: Thomas Zimmermann Reviewed-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20210624090500.8320-1-tzimmermann@suse.de commit d372ba42431059e8a35f94353cce40fada02acc2 Author: Jani Nikula Date: Tue May 18 16:24:26 2021 +0300 drm/i915/plane: add intel_plane_helper_add() helper Add a small helper to keep intel_plane_helper_funcs static. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210518132426.7567-1-jani.nikula@intel.com commit 88c6317b36c0d90c903b8d04fa296ca109e4e2da Author: Tejas Upadhyay Date: Thu Jul 8 12:42:22 2021 +0530 drm/i915/adl_s: Fix dma_mask_size to 39 bit 46 bit addressing enables you to use 4 bits to support some MKTME features, and 3 more bits for Optane support that uses a subset of MTKME for persistent memory. But GTT addressing sticking to 39 bit addressing, thus setting dma_mask_size to 39 fixes below tests : igt@i915_selftest@live@mman igt@kms_big_fb@linear-32bpp-rotate-0 igt@gem_create@create-clear igt@gem_mmap_offset@clear igt@gem_mmap_gtt@cpuset-big-copy In a way solves Gitlab#3142 https://gitlab.freedesktop.org/drm/intel/-/issues/3142, which had following errors : DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Write] Request device [00:02.0] PASID ffffffff fault addr 7effff9000 [fault reason 05] PTE Write access is not set 0x7effff9000 is suspiciously exactly 39 bits, so it seems likely that the HW just ends up masking off those extra bits hence DMA errors. Changes since V2 : - dim checkpatch error solved Changes since V1 : - Added more details to commit message - Matthew Auld Signed-off-by: Tejas Upadhyay Acked-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210708071222.955455-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit a9071e3c8659d777eb6527e1d377021381d1b5ec Author: Namjae Jeon Date: Wed Jul 7 15:01:21 2021 +0900 ksmbd: fix memory leak in smb_inherit_dacl() Add two labels to fix memory leak in smb_inherit_dacl(). Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit dac0ec6e1b4a876abb61b6cd2ec589f8e87e95c9 Author: Namjae Jeon Date: Wed Jul 7 14:57:24 2021 +0900 ksmbd: fix memory leak smb2_populate_readdir_entry() Add missing kfree(conv_name) on error path. Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b8fc94cdb144467d88f35344076fd3621af93a17 Author: Namjae Jeon Date: Wed Jul 7 14:56:44 2021 +0900 ksmbd: fix read on the uninitialized send_ctx If st->status is not SMB_DIRECT_CS_CONNECTED, It will jump done label and accessing the uninitialized send_ctxi by smb_direct_flush_send_list will cause kernel oops. This patch just return -ENOTCONN to avoid it. Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6cfbcf2f40e371ce36c030addc539597d058b3a9 Author: Namjae Jeon Date: Wed Jul 7 14:55:31 2021 +0900 ksmbd: remove unneeded NULL check in for_each_netdev netdev can never be NULL in for_each_netdev loop. This patch remove unneeded NULL check. Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit eff94154cc1a55c399ce71199bfbc1662ddc0f16 Author: Jesper Dangaard Brouer Date: Fri Jul 2 16:06:16 2021 +0200 samples/bpf: xdp_redirect_cpu_user: Cpumap qsize set larger default Experience from production shows queue size of 192 is too small, as this caused packet drops during cpumap-enqueue on RX-CPU. This can be diagnosed with xdp_monitor sample program. This bpftrace program was used to diagnose the problem in more detail: bpftrace -e ' tracepoint:xdp:xdp_cpumap_kthread { @deq_bulk = lhist(args->processed,0,10,1); @drop_net = lhist(args->drops,0,10,1) } tracepoint:xdp:xdp_cpumap_enqueue { @enq_bulk = lhist(args->processed,0,10,1); @enq_drops = lhist(args->drops,0,10,1); }' Watch out for the @enq_drops counter. The @drop_net counter can happen when netstack gets invalid packets, so don't despair it can be natural, and that counter will likely disappear in newer kernels as it was a source of confusion (look at netstat info for reason of the netstack @drop_net counters). The production system was configured with CPU power-saving C6 state. Learn more in this blogpost[1]. And wakeup latency in usec for the states are: # grep -H . /sys/devices/system/cpu/cpu0/cpuidle/*/latency /sys/devices/system/cpu/cpu0/cpuidle/state0/latency:0 /sys/devices/system/cpu/cpu0/cpuidle/state1/latency:2 /sys/devices/system/cpu/cpu0/cpuidle/state2/latency:10 /sys/devices/system/cpu/cpu0/cpuidle/state3/latency:133 Deepest state take 133 usec to wakeup from (133/10^6). The link speed is 25Gbit/s ((25*10^9/8) in bytes/sec). How many bytes can arrive with in 133 usec at this speed: (25*10^9/8)*(133/10^6) = 415625 bytes. With MTU size packets this is 275 packets, and with minimum Ethernet (incl intergap overhead) 84 bytes it is 4948 packets. Clearly default queue size is too small. Setting default cpumap queue to 2048 as worst-case (small packet) at 10Gbit/s is 1979 packets with 133 usec wakeup time, +64 packet before kthread wakeup call (due to xdp_do_flush) worst-case 2043 packets. Thus, if a packet burst on RX-CPU will enqueue packets to a remote cpumap CPU that is in deep-sleep state it can overrun the cpumap queue. The production system was also configured to avoid deep-sleep via: tuned-adm profile network-latency [1] https://jeremyeder.com/2013/08/30/oh-did-you-expect-the-cpu/ Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/162523477604.786243.13372630844944530891.stgit@firesoul commit e0bc8927e3b36a5bd46d0900f3839d816f442a23 Merge: a080cdccc93da 36246d5a7aa66 Author: Alexei Starovoitov Date: Wed Jul 7 20:01:46 2021 -0700 Merge branch 'Generic XDP improvements' Kumar Kartikeya says: ==================== This small series makes some improvements to generic XDP mode and brings it closer to native XDP. Patch 1 splits out generic XDP processing into reusable parts, patch 2 adds pointer friendly wrappers for bitops (not have to cast back and forth the address of local pointer to unsigned long *), patch 3 implements generic cpumap support (details in commit) and patch 4 allows devmap bpf prog execution before generic_xdp_tx is called. Patch 5 just updates a couple of selftests to adapt to changes in behavior (in that specifying devmap/cpumap prog fd in generic mode is now allowed). Changelog: ---------- v5 -> v6 v5: https://lore.kernel.org/bpf/20210701002759.381983-1-memxor@gmail.com * Put rcpu->prog check before RCU-bh section to avoid do_softirq (Jesper) v4 -> v5 v4: https://lore.kernel.org/bpf/20210628114746.129669-1-memxor@gmail.com * Add comments and examples for new bitops macros (Alexei) v3 -> v4 v3: https://lore.kernel.org/bpf/20210622202835.1151230-1-memxor@gmail.com * Add detach now that attach of XDP program succeeds (Toke) * Clean up the test to use new ASSERT macros v2 -> v3 v2: https://lore.kernel.org/bpf/20210622195527.1110497-1-memxor@gmail.com * list_for_each_entry -> list_for_each_entry_safe (due to deletion of skb) v1 -> v2 v1: https://lore.kernel.org/bpf/20210620233200.855534-1-memxor@gmail.com * Move __ptr_{set,clear,test}_bit to bitops.h (Toke) Also changed argument order to match the bit op they wrap. * Remove map value size checking functions for cpumap/devmap (Toke) * Rework prog run for skb in cpu_map_kthread_run (Toke) * Set skb->dev to dst->dev after devmap prog has run * Don't set xdp rxq that will be overwritten in cpumap prog run ==================== Signed-off-by: Alexei Starovoitov commit 36246d5a7aa66e06c231a5578ed69a413ea382d4 Author: Kumar Kartikeya Dwivedi Date: Fri Jul 2 16:48:25 2021 +0530 bpf: Tidy xdp attach selftests Support for cpumap and devmap entry progs in previous commits means the test needs to be updated for the new semantics. Also take this opportunity to convert it from CHECK macros to the new ASSERT macros. Since xdp_cpumap_attach has no subtest, put the sole test inside the test_xdp_cpumap_attach function. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Reviewed-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210702111825.491065-6-memxor@gmail.com commit 2ea5eabaf04a1829383aefe98ac38a2e5ae2d698 Author: Kumar Kartikeya Dwivedi Date: Fri Jul 2 16:48:24 2021 +0530 bpf: devmap: Implement devmap prog execution for generic XDP This lifts the restriction on running devmap BPF progs in generic redirect mode. To match native XDP behavior, it is invoked right before generic_xdp_tx is called, and only supports XDP_PASS/XDP_ABORTED/ XDP_DROP actions. We also return 0 even if devmap program drops the packet, as semantically redirect has already succeeded and the devmap prog is the last point before TX of the packet to device where it can deliver a verdict on the packet. This also means it must take care of freeing the skb, as xdp_do_generic_redirect callers only do that in case an error is returned. Since devmap entry prog is supported, remove the check in generic_xdp_install entirely. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Reviewed-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210702111825.491065-5-memxor@gmail.com commit 11941f8a85362f612df61f4aaab0e41b64d2111d Author: Kumar Kartikeya Dwivedi Date: Fri Jul 2 16:48:23 2021 +0530 bpf: cpumap: Implement generic cpumap This change implements CPUMAP redirect support for generic XDP programs. The idea is to reuse the cpu map entry's queue that is used to push native xdp frames for redirecting skb to a different CPU. This will match native XDP behavior (in that RPS is invoked again for packet reinjected into networking stack). To be able to determine whether the incoming skb is from the driver or cpumap, we reuse skb->redirected bit that skips generic XDP processing when it is set. To always make use of this, CONFIG_NET_REDIRECT guard on it has been lifted and it is always available. >From the redirect side, we add the skb to ptr_ring with its lowest bit set to 1. This should be safe as skb is not 1-byte aligned. This allows kthread to discern between xdp_frames and sk_buff. On consumption of the ptr_ring item, the lowest bit is unset. In the end, the skb is simply added to the list that kthread is anyway going to maintain for xdp_frames converted to skb, and then received again by using netif_receive_skb_list. Bulking optimization for generic cpumap is left as an exercise for a future patch for now. Since cpumap entry progs are now supported, also remove check in generic_xdp_install for the cpumap. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Reviewed-by: Toke Høiland-Jørgensen Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20210702111825.491065-4-memxor@gmail.com commit cb0f80039fb7ec9981a74d22019daaa85ff51a3d Author: Kumar Kartikeya Dwivedi Date: Fri Jul 2 16:48:22 2021 +0530 bitops: Add non-atomic bitops for pointers cpumap needs to set, clear, and test the lowest bit in skb pointer in various places. To make these checks less noisy, add pointer friendly bitop macros that also do some typechecking to sanitize the argument. These wrap the non-atomic bitops __set_bit, __clear_bit, and test_bit but for pointer arguments. Pointer's address has to be passed in and it is treated as an unsigned long *, since width and representation of pointer and unsigned long match on targets Linux supports. They are prefixed with double underscore to indicate lack of atomicity. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Reviewed-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210702111825.491065-3-memxor@gmail.com commit fe21cb91ae7bca1ae7805454be80b6d03bec85f7 Author: Kumar Kartikeya Dwivedi Date: Fri Jul 2 16:48:21 2021 +0530 net: core: Split out code to run generic XDP prog This helper can later be utilized in code that runs cpumap and devmap programs in generic redirect mode and adjust skb based on changes made to xdp_buff. When returning XDP_REDIRECT/XDP_TX, it invokes __skb_push, so whenever a generic redirect path invokes devmap/cpumap prog if set, it must __skb_pull again as we expect mac header to be pulled. It also drops the skb_reset_mac_len call after do_xdp_generic, as the mac_header and network_header are advanced by the same offset, so the difference (mac_len) remains constant. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Reviewed-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20210702111825.491065-2-memxor@gmail.com commit a080cdccc93da8754e4a20aea4f9c5fcc448547f Merge: 5e437416ff669 939b9c6890da9 Author: Alexei Starovoitov Date: Wed Jul 7 19:51:13 2021 -0700 Merge branch 'bpf: support input xdp_md context in BPF_PROG_TEST_RUN' Zvi Effron says: ==================== This patchset adds support for passing an xdp_md via ctx_in/ctx_out in bpf_attr for BPF_PROG_TEST_RUN of XDP programs. Patch 1 adds a function to validate XDP meta data lengths. Patch 2 adds initial support for passing XDP meta data in addition to packet data. Patch 3 adds support for also specifying the ingress interface and rx queue. Patch 4 adds selftests to ensure functionality is correct. Changelog: ---------- v7->v8 v7: https://lore.kernel.org/bpf/20210624211304.90807-1-zeffron@riotgames.com/ * Fix too long comment line in patch 3 v6->v7 v6: https://lore.kernel.org/bpf/20210617232904.1899-1-zeffron@riotgames.com/ * Add Yonghong Song's Acked-by to commit message in patch 1 * Add Yonghong Song's Acked-by to commit message in patch 2 * Extracted the post-update of the xdp_md context into a function (again) * Validate that the rx queue was registered with XDP info * Decrement the reference count on a found netdevice on failure to find a valid rx queue * Decrement the reference count on a found netdevice after the XDP program is run * Drop Yonghong Song's Acked-By for patch 3 because of patch changes * Improve a comment in the selftests * Drop Yonghong Song's Acked-By for patch 4 because of patch changes v5->v6 v5: https://lore.kernel.org/bpf/20210616224712.3243-1-zeffron@riotgames.com/ * Correct commit messages in patches 1 and 3 * Add Acked-by to commit message in patch 4 * Use gotos instead of returns to correctly free resources in bpf_prog_test_run_xdp * Rename xdp_metalen_valid to xdp_metalen_invalid * Improve the function signature for xdp_metalen_invalid * Merged declaration of ingress_ifindex and rx_queue_index into one line v4->v5 v4: https://lore.kernel.org/bpf/20210604220235.6758-1-zeffron@riotgames.com/ * Add new patch to introduce xdp_metalen_valid inline function to avoid duplicated code from net/core/filter.c * Correct size of bad_ctx in selftests * Make all declarations reverse Christmas tree * Move data check from xdp_convert_md_to_buff to bpf_prog_test_run_xdp * Merge xdp_convert_buff_to_md into bpf_prog_test_run_xdp * Fix line too long * Extracted common checks in selftests to a helper function * Removed redundant assignment in selftests * Reordered test cases in selftests * Check data against 0 instead of data_meta in selftests * Made selftests use EINVAL instead of hardcoded 22 * Dropped "_" from XDP function name * Changed casts in XDP program from unsigned long to long * Added a comment explaining the use of the loopback interface in selftests * Change parameter order in xdp_convert_md_to_buff to be input first * Assigned xdp->ingress_ifindex and xdp->rx_queue_index to local variables in xdp_convert_md_to_buff * Made use of "meta data" versus "metadata" consistent in comments and commit messages v3->v4 v3: https://lore.kernel.org/bpf/20210602190815.8096-1-zeffron@riotgames.com/ * Clean up nits * Validate xdp_md->data_end in bpf_prog_test_run_xdp * Remove intermediate metalen variables v2 -> v3 v2: https://lore.kernel.org/bpf/20210527201341.7128-1-zeffron@riotgames.com/ * Check errno first in selftests * Use DECLARE_LIBBPF_OPTS * Rename tattr to opts in selftests * Remove extra new line * Rename convert_xdpmd_to_xdpb to xdp_convert_md_to_buff * Rename convert_xdpb_to_xdpmd to xdp_convert_buff_to_md * Move declaration of device and rxqueue in xdp_convert_md_to_buff to patch 2 * Reorder the kfree calls in bpf_prog_test_run_xdp v1 -> v2 v1: https://lore.kernel.org/bpf/20210524220555.251473-1-zeffron@riotgames.com * Fix null pointer dereference with no context * Use the BPF skeleton and replace CHECK with ASSERT macros ==================== Signed-off-by: Alexei Starovoitov commit 939b9c6890da97ea19822e3bd295816175b86fbd Author: Zvi Effron Date: Wed Jul 7 22:16:57 2021 +0000 selftests/bpf: Add test for xdp_md context in BPF_PROG_TEST_RUN Add a test for using xdp_md as a context to BPF_PROG_TEST_RUN for XDP programs. The test uses a BPF program that takes in a return value from XDP meta data, then reduces the size of the XDP meta data by 4 bytes. Test cases validate the possible failure cases for passing in invalid xdp_md contexts, that the return value is successfully passed in, and that the adjusted meta data is successfully copied out. Co-developed-by: Cody Haas Co-developed-by: Lisa Watanabe Signed-off-by: Cody Haas Signed-off-by: Lisa Watanabe Signed-off-by: Zvi Effron Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210707221657.3985075-5-zeffron@riotgames.com commit ec94670fcb3bdeaf3baaa8d86f54e90a5557f53b Author: Zvi Effron Date: Wed Jul 7 22:16:56 2021 +0000 bpf: Support specifying ingress via xdp_md context in BPF_PROG_TEST_RUN Support specifying the ingress_ifindex and rx_queue_index of xdp_md contexts for BPF_PROG_TEST_RUN. The intended use case is to allow testing XDP programs that make decisions based on the ingress interface or RX queue. If ingress_ifindex is specified, look up the device by the provided index in the current namespace and use its xdp_rxq for the xdp_buff. If the rx_queue_index is out of range, or is non-zero when the ingress_ifindex is 0, return -EINVAL. Co-developed-by: Cody Haas Co-developed-by: Lisa Watanabe Signed-off-by: Cody Haas Signed-off-by: Lisa Watanabe Signed-off-by: Zvi Effron Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210707221657.3985075-4-zeffron@riotgames.com commit 47316f4a305367794fc04f23e5c778678d8f1d8e Author: Zvi Effron Date: Wed Jul 7 22:16:55 2021 +0000 bpf: Support input xdp_md context in BPF_PROG_TEST_RUN Support passing a xdp_md via ctx_in/ctx_out in bpf_attr for BPF_PROG_TEST_RUN. The intended use case is to pass some XDP meta data to the test runs of XDP programs that are used as tail calls. For programs that use bpf_prog_test_run_xdp, support xdp_md input and output. Unlike with an actual xdp_md during a non-test run, data_meta must be 0 because it must point to the start of the provided user data. From the initial xdp_md, use data and data_end to adjust the pointers in the generated xdp_buff. All other non-zero fields are prohibited (with EINVAL). If the user has set ctx_out/ctx_size_out, copy the (potentially different) xdp_md back to the userspace. We require all fields of input xdp_md except the ones we explicitly support to be set to zero. The expectation is that in the future we might add support for more fields and we want to fail explicitly if the user runs the program on the kernel where we don't yet support them. Co-developed-by: Cody Haas Co-developed-by: Lisa Watanabe Signed-off-by: Cody Haas Signed-off-by: Lisa Watanabe Signed-off-by: Zvi Effron Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210707221657.3985075-3-zeffron@riotgames.com commit 7445cf31d2e25e3f8ad7b1c5342e624c09ab23a2 Author: Zvi Effron Date: Wed Jul 7 22:16:54 2021 +0000 bpf: Add function for XDP meta data length check This commit prepares to use the XDP meta data length check in multiple places by making it into a static inline function instead of a literal. Co-developed-by: Cody Haas Co-developed-by: Lisa Watanabe Signed-off-by: Cody Haas Signed-off-by: Lisa Watanabe Signed-off-by: Zvi Effron Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210707221657.3985075-2-zeffron@riotgames.com commit cd5606aa39925ad4483e96abffc9cc62bb36c640 Author: Lucas De Marchi Date: Wed Jul 7 11:13:25 2021 -0700 gpu/drm/i915: nuke old GEN macros Now that all the codebase is converted to the new *VER macros, remove the old GEN ones. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707181325.2130821-4-lucas.demarchi@intel.com commit d70cc074bc6a21e64575dd0807c7a28faa8bbf2e Author: Lucas De Marchi Date: Wed Jul 7 11:13:24 2021 -0700 drm/i915: finish INTEL_GEN and friends conversion Commit 161058fb899e ("drm/i915: Add remaining conversions to GRAPHICS_VER") did the last conversions to the new macros for version checks, but left one instance behind and some other changes sneaked in to use INTEL_GEN. Remove the last users so we can remove the macros. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707181325.2130821-3-lucas.demarchi@intel.com commit 7c517f83fa8c35a03a13d7af36bd13fb991eae06 Author: Lucas De Marchi Date: Wed Jul 7 11:13:23 2021 -0700 drm/i915/gt: finish INTEL_GEN and friends conversion Commit c816723b6b8a ("drm/i915/gt: replace IS_GEN and friends with GRAPHICS_VER") converted INTEL_GEN and friends to the new version check macros. Meanwhile, some changes sneaked in to use INTEL_GEN. Remove the last users so we can remove the macros. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210707181325.2130821-2-lucas.demarchi@intel.com commit d1bbfd0c7c9f985e57795a7e0cefc209ebf689c0 Author: Peter Zijlstra Date: Mon Jul 5 17:00:24 2021 +0200 Documentation/atomic_t: Document cmpxchg() vs try_cmpxchg() There seems to be a significant amount of confusion around the new try_cmpxchg(), despite this being more like the C11 atomic_compare_exchange_*() family. Add a few words of clarification on how cmpxchg() and try_cmpxchg() relate to one another. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/YOMgPeMOmmiK3tXO@hirez.programming.kicks-ass.net commit e6b4457b05f36bb9e371f29ab1dd2d97272a1540 Author: Peter Zijlstra Date: Wed Jun 30 17:35:20 2021 +0200 locking/mutex: Add MUTEX_WARN_ON Cleanup some #ifdef'fery. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Reviewed-by: Yanfei Xu Link: https://lore.kernel.org/r/20210630154115.020298650@infradead.org commit ad90880dc9625682a58897cba2ecff657a2aa60b Author: Peter Zijlstra Date: Wed Jun 30 17:35:19 2021 +0200 locking/mutex: Introduce __mutex_trylock_or_handoff() Yanfei reported that it is possible to loose HANDOFF when we race with mutex_unlock() and end up setting HANDOFF on an unlocked mutex. At that point anybody can steal it, losing HANDOFF in the process. If this happens often enough, we can in fact starve the top waiter. Solve this by folding the 'set HANDOFF' operation into the trylock operation, such that either we acquire the lock, or it gets HANDOFF set. This avoids having HANDOFF set on an unlocked mutex. Reported-by: Yanfei Xu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Reviewed-by: Yanfei Xu Link: https://lore.kernel.org/r/20210630154114.958507900@infradead.org commit 048661a1f963e9517630f080687d48af79ed784c Author: Peter Zijlstra Date: Wed Jun 30 17:35:18 2021 +0200 locking/mutex: Fix HANDOFF condition Yanfei reported that setting HANDOFF should not depend on recomputing @first, only on @first state. Which would then give: if (ww_ctx || !first) first = __mutex_waiter_is_first(lock, &waiter); if (first) __mutex_set_flag(lock, MUTEX_FLAG_HANDOFF); But because 'ww_ctx || !first' is basically 'always' and the test for first is relatively cheap, omit that first branch entirely. Reported-by: Yanfei Xu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Reviewed-by: Yanfei Xu Link: https://lore.kernel.org/r/20210630154114.896786297@infradead.org commit ab4e4d9f79b2c95ef268985d2a9625a03a73c49a Author: Peter Zijlstra Date: Wed Jun 30 17:35:17 2021 +0200 locking/mutex: Use try_cmpxchg() For simpler and better code. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Reviewed-by: Yanfei Xu Link: https://lore.kernel.org/r/20210630154114.834438545@infradead.org commit 9c13c8ff38a2087edfac52c806a2617d968e4abb Author: Anshuman Gupta Date: Mon Jul 5 17:52:08 2021 +0530 drm/i915/hdcp: Nuke Platform check for mst hdcp init Earlier HDCP over MST support was added for TGL Platform. Extending it to all future platfroms. v2: - Remove the platform check and commit log changes. [Jani] Signed-off-by: Anshuman Gupta Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210705122208.25618-1-anshuman.gupta@intel.com commit b23228f287bc7dd970fed85f15ea4630b93fc8a0 Author: Matthew Auld Date: Fri Jul 2 11:46:42 2021 +0100 drm/i915/selftests: fix smatch warning in mock_reserve If mock_region_create fails then mem will be an error pointer. Instead we just need to use the correct ordering for the onion unwind. igt_mock_reserve() error: 'mem' dereferencing possible ERR_PTR() Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Matthew Auld Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20210702104642.1189978-2-matthew.auld@intel.com commit 0c1145e05ce1c38d81f332263186092294ec7d90 Author: Matthew Auld Date: Fri Jul 2 11:46:41 2021 +0100 drm/i915/selftests: fix smatch warning in igt_check_blocks The block here can't be NULL, especially since we already dereferenced it earlier, so remove the redundant check. igt_check_blocks() warn: variable dereferenced before check 'block' (see line 126) Reported-by: Dan Carpenter Signed-off-by: Matthew Auld Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20210702104642.1189978-1-matthew.auld@intel.com commit 1a3c1959740c1a376fbcdf87916e96fb5cce5518 Author: Beatriz Martins de Carvalho Date: Tue Jul 6 16:45:10 2021 +0100 drm/vkms: replace macro in vkms_release() Replace macro in vkms_release() Signed-off-by: Beatriz Martins de Carvalho Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210706154510.224695-1-martinsdecarvalhobeatriz@gmail.com commit 81fd23e2b3ccf71c807e671444e8accaba98ca53 Author: Thomas Zimmermann Date: Thu Jun 24 10:58:00 2021 +0200 drm/etnaviv: Implement mmap as GEM object function Moving the driver-specific mmap code into a GEM object function allows for using DRM helpers for various mmap callbacks. The respective etnaviv functions are being removed. The file_operations structure fops is now being created by the helper macro DEFINE_DRM_GEM_FOPS(). Signed-off-by: Thomas Zimmermann Signed-off-by: Lucas Stach commit 432f51e7deedadceaf99a953a6f0a7b30c8155f9 Author: Michael Walle Date: Fri Jun 18 14:04:33 2021 +0200 drm/etnaviv: add clock gating workaround for GC7000 r6202 The LS1028A SoC errata sheet mentions A-050121 "GPU hangs if clock gating for Rasterizer, Setup Engine and Texture Engine are enabled". The workaround is to disable the corresponding clock gatings. Signed-off-by: Michael Walle Signed-off-by: Lucas Stach commit 12495f4eb298963565e0bdd37d8096ab1136d89f Author: Michael Walle Date: Fri Jun 18 14:04:32 2021 +0200 drm/etnaviv: add HWDB entry for GC7000 r6202 The GPU is found on the NXP LS1028A SoC. The feature bits are taken from the NXP downstream kernel driver 6.4.3.p1. Signed-off-by: Michael Walle Signed-off-by: Lucas Stach commit db0e04ad42bbbf7a4045d70984cd487e5137307e Merge: 52f7af6443861 4951a84f61d6d Author: Steve French Date: Tue Jul 6 09:53:12 2021 -0500 Merge pull request #58 from namjaejeon/cifsd-for-next ksmbd-fixes commit 4951a84f61d6de4ab5aca1d49a6b6ee2ad2d1eec Author: Colin Ian King Date: Tue Jul 6 13:05:01 2021 +0100 ksmbd: Fix read on the uninitialized pointer sess There is a error handling case that passes control to label out_err without pointer sess being assigned a value. The unassigned pointer may be any garbage value and so the test of rc < 0 && sess maybe true leading to sess being passed to the call to ksmbd_session_destroy. Fix this by setting sess to NULL in this corner case. Addresses-Coverity: ("Uninitialized pointer read") Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0b066a6809d0f8fd9868e383add36aa5a2fa409d Author: Tim Gover Date: Mon Jun 28 15:05:33 2021 +0200 drm: vc4: Fix pixel-wrap issue with DVP teardown Adjust the DVP enable/disable sequence to avoid a pixel getting stuck in an internal, non resettable FIFO within PixelValve when changing HDMI resolution. The blank pixels features of the DVP can prevent signals back to pixelvalve causing it to not clear the FIFO. Adjust the ordering and timing of operations to ensure the clear signal makes it through to pixelvalve. Signed-off-by: Tim Gover Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210628130533.144617-1-maxime@cerno.tech commit 9d9fb756b5391c2eb93ffdb24f9d2b30c92acc5b Author: Nicolas Saenz Julienne Date: Tue Jun 29 14:17:23 2021 +0200 drm/vc4: hdmi: Limit noise when deferring snd card registration We don't want to print an error message each time devm_snd_soc_register_card() returns -EPROBE_DEFER, the function will most likely succeed some time in the future, once the missing resources are available. So use dev_err_probe(), which will redirect the messages to the debug log level in such case. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210629121723.11523-1-nsaenzju@redhat.com commit 375cca1cfeb5c55dc0e80caecf36e927855d2bb8 Author: Thomas Zimmermann Date: Thu Jun 24 11:52:38 2021 +0200 drm/vgem: Implement mmap as GEM object function Moving the driver-specific mmap code into a GEM object function allows for using DRM helpers for various mmap callbacks. The respective vgem functions are being removed. The file_operations structure vgem_driver_fops is now being created by the helper macro DEFINE_DRM_GEM_FOPS(). Signed-off-by: Thomas Zimmermann Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210624095238.8804-1-tzimmermann@suse.de commit 7e8376f1d1272d1d12ea0b841ae05e21a9a574cc Author: Daniel Vetter Date: Fri Jul 2 22:17:08 2021 +0200 drm/i915: Improve debug Kconfig texts a bit We're not consistently recommending these for developers only. I stumbled over this due to DRM_I915_LOW_LEVEL_TRACEPOINTS, which was added in commit 354d036fcf70654cff2e2cbdda54a835d219b9d2 Author: Tvrtko Ursulin Date: Tue Feb 21 11:01:42 2017 +0000 drm/i915/tracepoints: Add request submit and execute tracepoints to "alleviate the performance impact concerns." Which is nonsense. Tvrtko and Joonas pointed out on irc that the real (but undocumented reason) was stable abi concerns for tracepoints, see https://lwn.net/Articles/705270/ and the specific change that was blocked around tracepoints: https://lwn.net/Articles/442113/ Anyway to make it a notch clearer why we have this Kconfig option consistly add the "Recommended for driver developers only." to it and all the other debug options we have. Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: Matthew Brost Reviewed-by: Joonas Lahtinen Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702201708.2075793-1-daniel.vetter@ffwll.ch commit 54b3bd99f094b3b919de4078f60d722e62a767e3 Author: Christophe JAILLET Date: Sun Jun 13 15:27:43 2021 +0200 firewire: nosy: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'add_card()', GFP_KERNEL can be used because this flag is already used a few lines above and no lock is taken in the between. While at it, also remove some useless casting. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: Stefan Richter commit 53bb4a9dda0b51c161b2573641c586f7d5d7e189 Author: Pu Lehui Date: Fri May 14 14:44:38 2021 +0800 firewire: net: remove unused variable 'guid' GCC reports the following warning with W=1: drivers/firewire/net.c:493:9: warning: variable ‘guid’ set but not used [-Wunused-but-set-variable] 493 | __be64 guid; | ^~~~ This variable is not used anymore since commit 6752c8db8e0c ("firewire net, ipv4 arp: Extend hardware address and remove driver-level packet inspection."). Remove it to fix the warning. Signed-off-by: Pu Lehui Signed-off-by: Stefan Richter commit d9cc564bf3aee6fcc1c717a19f9a207114510671 Author: Thomas Zimmermann Date: Fri Jul 2 09:56:42 2021 +0200 drm/mgag200: Constify LUT for programming bpp Declare constant LUT for bpp programming as static const. Removes mutable data from device structure. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210702075642.27834-5-tzimmermann@suse.de commit 02d4b387cb5600fedb1c2fbe3b336d32b41f4664 Author: Thomas Zimmermann Date: Fri Jul 2 09:56:41 2021 +0200 drm/mgag200: Extract device type and flags in mgag200_pci_probe() The type and flags values are stored in the PCI ID list. Extract them in the probe function. Makes the device initialization more readable. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210702075642.27834-4-tzimmermann@suse.de commit 382d019d1022bc7e3b45c664a5545f21f6b85dc0 Author: Thomas Zimmermann Date: Fri Jul 2 09:56:40 2021 +0200 drm/mgag200: Inline mgag200_device_init() Inline mgag200_device_init() into mgag200_device_create(), which is the only caller. Also remove a duplicate error message for mgag200_modeset_init(). The function will print an error if/where it failed. v2: * include a note about the removed error message in changelog (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210702075642.27834-3-tzimmermann@suse.de commit e36edabc9411a9fe3ffa7e51350d488f77849d98 Author: Thomas Zimmermann Date: Fri Jul 2 09:56:39 2021 +0200 drm/mgag200: Don't pass flags to drm_dev_register() The flags argument is only relevant for UMS drivers. Pass 0. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210702075642.27834-2-tzimmermann@suse.de commit 9aa0267476eda3c77890dd939fb2579bffceb3ae Author: Thomas Zimmermann Date: Fri Jul 2 09:54:34 2021 +0200 drm/vram-helper: Unexport drm_vram_helper_{alloc,release}_mm() All GEM-VRAM-based drivers use auto-cleanup via drmm_vram_helper_init(). Unexport the manual APIs and make them internal implementation. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702075434.27677-4-tzimmermann@suse.de commit 11e96701d1c0bfcdf4369b539c79f8848705ada8 Author: Thomas Zimmermann Date: Fri Jul 2 09:54:33 2021 +0200 drm/bochs: Use managed initialization for GEM VRAM helpers Convert to managed GEM VRAM initialization and switch bochs to full autocleanup. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702075434.27677-3-tzimmermann@suse.de commit 796c3e35ac16776ff479c2a7d9e3036bf5ffd73f Author: Thomas Zimmermann Date: Fri Jul 2 09:54:32 2021 +0200 drm/bochs: Move to tiny/ The bochs driver is only ~600 lines of code. Putting it into tiny/ cleans up the DRM directory slightly. Some style problems were fixed and unneeded include statements were removed. No functional changes. v2: * make bochs_mode_funcs static (Daniel, kernel test robot) * rebase onto aperture API changes Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210702075434.27677-2-tzimmermann@suse.de commit 465d720485eff1468503d210b1b966660f5f9b85 Author: Hyunchul Lee Date: Sat Jul 3 12:10:36 2021 +0900 ksmbd: call mnt_user_ns once in a function Avoid calling mnt_user_ns() many time in a function. Cc: Christoph Hellwig Cc: Christian Brauner Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3f5aa5ac0b0f9704f0c60f5fbbbcdc8c043d6eb6 Author: Linus Walleij Date: Fri Jul 2 15:56:01 2021 +0200 drm/dbi: Print errors for mipi_dbi_command() The macro mipi_dbi_command() does not report errors unless you wrap it in another macro to do the error reporting. Report a rate-limited error so we know what is going on. After this any code wishing to send command arrays can rely on mipi_dbi_command() providing an appropriate error message if something goes wrong. Suggested-by: Noralf Trønnes Suggested-by: Douglas Anderson Signed-off-by: Linus Walleij Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20210702135601.3952726-1-linus.walleij@linaro.org commit 52f7af6443861d7a577c948c27aa0e6f6b0c9624 Merge: ae9d84d6f1b10 690f969705138 Author: Steve French Date: Fri Jul 2 18:15:58 2021 -0500 Merge pull request #57 from namjaejeon/cifsd-for-next ksmbd-fixes commit 690f969705138b235b9fa4c4d19e5129ed54a845 Author: Namjae Jeon Date: Sat Jul 3 08:00:06 2021 +0900 ksmbd: fix kernel oops in ksmbd_rpc_ioctl/rap() "ksmbd: remove macros in transport_ipc.c" commit change msg to req in ksmbd_rpc_ioctl/rap(). This will cause kernel oops when running smbclient -L test. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 91b96f0008a2d66d76b525556e4818f5a4a089e4 Author: Thomas Zimmermann Date: Thu Jul 1 19:36:18 2021 +0200 drm/i915: Drop all references to DRM IRQ midlayer Remove all references to DRM's IRQ midlayer. i915 uses Linux' interrupt functions directly. v2: * also remove an outdated comment * move IRQ fix into separate patch * update Fixes tag (Daniel) Signed-off-by: Thomas Zimmermann Fixes: b318b82455bd ("drm/i915: Nuke drm_driver irq vfuncs") Cc: Ville Syrjälä Cc: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210701173618.10718-3-tzimmermann@suse.de commit 27e4b467d94e216b365da388358c9407af818662 Author: Thomas Zimmermann Date: Thu Jul 1 19:36:17 2021 +0200 drm/i915: Use the correct IRQ during resume The code in xcs_resume() probably didn't work as intended. It uses struct drm_device.irq, which is allocated to 0, but never initialized by i915 to the device's interrupt number. Change all calls to synchronize_hardirq() to intel_synchronize_irq(), which uses the correct interrupt. _hardirq() functions are not needed in this context. v5: * go back to _hardirq() after PCI probe reported wrong context; add rsp comment v4: * switch everything to intel_synchronize_irq() (Daniel) v3: * also use intel_synchronize_hardirq() at another callsite v2: * wrap irq code in intel_synchronize_hardirq() (Ville) Signed-off-by: Thomas Zimmermann Fixes: 536f77b1caa0 ("drm/i915/gt: Call stop_ring() from ring resume, again") Cc: Chris Wilson Cc: Mika Kuoppala Cc: Daniel Vetter Cc: Rodrigo Vivi Cc: Joonas Lahtinen Cc: Maarten Lankhorst Cc: Lucas De Marchi Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210701173618.10718-2-tzimmermann@suse.de commit ae9d84d6f1b1012a7829c03b9a318f499dc7719d Merge: be8bcf8baaec8 af34983e83158 Author: Steve French Date: Fri Jul 2 09:58:21 2021 -0500 Merge pull request #56 from namjaejeon/cifsd-for-next ksmbd-fixes commit c76826a65f50038f050424365dbf3f97203f8710 Author: Kan Liang Date: Wed Jun 30 14:08:39 2021 -0700 perf/x86/intel/uncore: Support IMC free-running counters on Sapphire Rapids server Several free-running counters for IMC uncore blocks are supported on Sapphire Rapids server. They are not enumerated in the discovery tables. The number of the free-running counter boxes is calculated from the number of corresponding standard boxes. The snbep_pci2phy_map_init() is invoked to setup the mapping from a PCI BUS to a Die ID, which is used to locate the corresponding MC device of a IMC uncore unit in the spr_uncore_imc_freerunning_init_box(). Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-16-git-send-email-kan.liang@linux.intel.com commit 0378c93a92e226d99f4672e66fe4c08ee7b19e2d Author: Kan Liang Date: Wed Jun 30 14:08:38 2021 -0700 perf/x86/intel/uncore: Support IIO free-running counters on Sapphire Rapids server Several free-running counters for IIO uncore blocks are supported on Sapphire Rapids server. They are not enumerated in the discovery tables. Extend generic_init_uncores() to support extra uncore types. The uncore types for the free-running counters is inserted right after the uncore types retrieved from the discovery table. The number of the free-running counter boxes is calculated from the max number of the corresponding standard boxes. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-15-git-send-email-kan.liang@linux.intel.com commit 1583971b5cb8c786df88be580cdd96a974ad591b Author: Kan Liang Date: Wed Jun 30 14:08:37 2021 -0700 perf/x86/intel/uncore: Factor out snr_uncore_mmio_map() The IMC free-running counters on Sapphire Rapids server are also accessed by MMIO, which is similar to the previous platforms, SNR and ICX. The only difference is the device ID of the device which contains BAR address. Factor out snr_uncore_mmio_map() which ioremap the MMIO space. It can be reused in the following patch for SPR. Use the snr_uncore_mmio_map() in the icx_uncore_imc_freerunning_init_box(). There is no box_ctl for the free-running counters. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-14-git-send-email-kan.liang@linux.intel.com commit 8053f2d752e2936f494ede62766a6c9e9fb674f2 Author: Kan Liang Date: Wed Jun 30 14:08:36 2021 -0700 perf/x86/intel/uncore: Add alias PMU name A perf PMU may have two PMU names. For example, Intel Sapphire Rapids server supports the discovery mechanism. Without the platform-specific support, an uncore PMU is named by a type ID plus a box ID, e.g., uncore_type_0_0, because the real name of the uncore PMU cannot be retrieved from the discovery table. With the platform-specific support later, perf has the mapping information from a type ID to a specific uncore unit. Just like the previous platforms, the uncore PMU is named by the real PMU name, e.g., uncore_cha_0. The user scripts which work well with the old numeric name may not work anymore. Add a new attribute "alias" to indicate the old numeric name. The following userspace perf tool patch will handle both names. The user scripts should work properly with the updated perf tool. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-13-git-send-email-kan.liang@linux.intel.com commit 0d771caf728436d9ebc2cd1d50bed71685bfe7d8 Author: Kan Liang Date: Wed Jun 30 14:08:35 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server MDF support The MDF subsystem is a new IP built to support the new Intel Xeon architecture that bridges multiple dies with a embedded bridge system. The layout of the control registers for a MDF uncore unit is similar to a IRP uncore unit. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-12-git-send-email-kan.liang@linux.intel.com commit 2a8e51eae7c83c29795622cfc794cf83436cc05d Author: Kan Liang Date: Wed Jun 30 14:08:34 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server M3UPI support M3 Intel UPI is the interface between the mesh and the Intel UPI link layer. It is responsible for translating between the mesh protocol packets and the flits that are used for transmitting data across the Intel UPI interface. The layout of the control registers for a M3UPI uncore unit is similar to a UPI uncore unit. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-11-git-send-email-kan.liang@linux.intel.com commit da5a9156cd2a3be2b00f8defb529ee3e35e5769b Author: Kan Liang Date: Wed Jun 30 14:08:33 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server UPI support Sapphire Rapids uses a coherent interconnect for scaling to multiple sockets known as Intel UPI. Intel UPI technology provides a cache coherent socket to socket external communication interface between processors. The layout of the control registers for a UPI uncore unit is similar to a M2M uncore unit. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-10-git-send-email-kan.liang@linux.intel.com commit f57191edaaeb01279a88ace1be5b7230bdd8c0ab Author: Kan Liang Date: Wed Jun 30 14:08:32 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server M2M support The M2M blocks manage the interface between the mesh (operating on both the mesh and the SMI3 protocol) and the memory controllers. The layout of the control registers for a M2M uncore unit is a little bit different from the generic one. So a specific format and ops are required. Expose the common PCI ops which can be reused. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-9-git-send-email-kan.liang@linux.intel.com commit 85f2e30f987ecc73fbb5e24eda0f36ba7f337c5c Author: Kan Liang Date: Wed Jun 30 14:08:31 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server IMC support The Sapphire Rapids IMC provides the interface to the DRAM and communicates to the rest of the uncore through the M2M block. The layout of the control registers for a IMC uncore unit is a little bit different from the generic one. There is a fixed counter for IMC. So a specific format and ops are required. Expose the common MMIO ops which can be reused. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-8-git-send-email-kan.liang@linux.intel.com commit 0654dfdc7e1ca30d36810ab694712da3de18440c Author: Kan Liang Date: Wed Jun 30 14:08:30 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server PCU support The PCU is the primary power controller for the Sapphire Rapids. Except the name, all the information can be retrieved from the discovery tables. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-7-git-send-email-kan.liang@linux.intel.com commit f85ef898f8842b2a9a8f51a64eaf45ee2a8bb1f7 Author: Kan Liang Date: Wed Jun 30 14:08:29 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server M2PCIe support M2PCIe* blocks manage the interface between the mesh and each IIO stack. The layout of the control registers for a M2PCIe uncore unit is similar to a IRP uncore unit. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-6-git-send-email-kan.liang@linux.intel.com commit e199eb5131591c020705deceee224b437d09ece4 Author: Kan Liang Date: Wed Jun 30 14:08:28 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server IRP support The IRP is responsible for maintaining coherency for the IIO traffic targeting coherent memory. The layout of the control registers for a IRP uncore unit is a little bit different from the generic one. Factor out SPR_UNCORE_COMMON_FORMAT, which can be reused by the following uncore units. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-5-git-send-email-kan.liang@linux.intel.com commit 3ba7095beaec1bace1b5864fa92b2b7a0eaadf38 Author: Kan Liang Date: Wed Jun 30 14:08:27 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server IIO support The IIO stacks are responsible for managing the traffic between the PCI Express* (PCIe*) domain and the mesh domain. The IIO PMON block is situated near the IIO stacks traffic controller capturing the traffic controller as well as the PCIe* root port information. The layout of the control registers for a IIO uncore unit is a little bit different from the generic one. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-4-git-send-email-kan.liang@linux.intel.com commit 949b11381f81664df3997db2ae0ec9546ab6dd85 Author: Kan Liang Date: Wed Jun 30 14:08:26 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server CHA support CHA merges the caching agent and Home Agent (HA) responsibilities of the chip into a single block. It's one of the Sapphire Rapids server uncore units. The layout of the control registers for a CHA uncore unit is a little bit different from the generic one. The CHA uncore unit also supports a filter register for TID. So a specific format and ops are required. Expose the common MSR ops which can be reused. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-3-git-send-email-kan.liang@linux.intel.com commit c54c53d9921adef2c239cb43d5a936b63c57ebf0 Author: Kan Liang Date: Wed Jun 30 14:08:25 2021 -0700 perf/x86/intel/uncore: Add Sapphire Rapids server framework Intel Sapphire Rapids supports a discovery mechanism, that allows an uncore driver to discover the different components ("boxes") of the chip. All the generic information of the uncore boxes should be retrieved from the discovery tables. This has been enabled with the commit edae1f06c2cd ("perf/x86/intel/uncore: Parse uncore discovery tables"). Add use_discovery to indicate the case. The uncore driver doesn't need to hard code the generic information for each uncore box. But we still need to enable various functionality that cannot be directly discovered. To support these functionalities, the Sapphire Rapids server framework is introduced here. Each specific uncore unit will be added into the framework in the following patches. Add use_discovery to indicate that the discovery mechanism is required for the platform. Currently, Intel Sapphire Rapids is one of the platforms. The box ID from the discovery table is the accurate index. Use it if applicable. All the undiscovered platform-specific features will be hard code in the spr_uncores[]. Add uncore_type_customized_copy(), instead of the memcpy, to only overwrite these features. The specific uncore unit hasn't been added here. From user's perspective, there is nothing changed for now. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lore.kernel.org/r/1625087320-194204-2-git-send-email-kan.liang@linux.intel.com commit 0791ba2bc7d33f544528410d9d77aa1b5018adab Author: Christophe JAILLET Date: Fri Jun 25 22:38:00 2021 +0300 ath11k: Remove some duplicate code 'ATH11K_HE_MCS_MAX' is 11, so these 2 blocks of code are exactly the same. Remove the one that uses a hard-coded constant. Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/a65952db7f4eb8aaaa654b77dcd4930482f5c49b.1624483438.git.christophe.jaillet@wanadoo.fr commit 923a134647a0cf7695f667c9399cab0762555a13 Author: Christophe JAILLET Date: Sat Jun 26 17:25:04 2021 +0200 ath: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below. While at it, some 'dma_set_mask()/dma_set_coherent_mask()' have been updated to a much less verbose 'dma_set_mask_and_coherent()'. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/9150bd6cde9ad592aff8ee3ad94dffa90b004e89.1624720959.git.christophe.jaillet@wanadoo.fr commit 01fa662091bd24830ae4cd35bd0ce5c1f030424c Author: Matthew Auld Date: Thu Jul 1 10:03:26 2021 +0100 drm/i915/display: check if compressed_llb was allocated If we hit the error path here we unconditionally call i915_gem_stolen_remove_node, even though we only allocate the compressed_llb on older platforms. Therefore we should first check that we actually allocated the node before trying to remove it. References: https://gitlab.freedesktop.org/drm/intel/-/issues/3709 Fixes: 46b2c40e0af3 ("drm/i915/fbc: Allocate llb before cfb") Signed-off-by: Matthew Auld Cc: Ville Syrjälä Cc: José Roberto de Souza Reviewed-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210701090326.1056452-1-matthew.auld@intel.com commit af34983e831587472333e47c86a350a2360c6093 Author: Hyunchul Lee Date: Wed Jun 30 18:25:53 2021 +0900 ksmbd: add user namespace support For user namespace support, call vfs functions with struct user_namespace got from struct path. This patch have been tested mannually as below. Create an id-mapped mount using the mount-idmapped utility (https://github.com/brauner/mount-idmapped). $ mount-idmapped --map-mount b:1003:1002:1 /home/foo /foo (the user, "foo" is 1003, and the user "bar" is 1002). And mount the export directory using cifs with the user, "bar". succeed to create/delete/stat/read/write files and directory in the /foo. But fail with a bind mount for /home/foo. Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ef24c962d0f29036041a007a75bcd0f50233c83e Author: Hyunchul Lee Date: Wed Jun 30 18:25:52 2021 +0900 ksmbd: replace struct dentry with struct path in some function's arguments For user namespace support, we need to pass struct user_namespace with struct dentry to some functions. For reducing the number of arguments, replace the struct dentry with struct path in these functions. Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fb786a48ac0dd63e702c05c35426f2e024f5749f Author: Melissa Wen Date: Sat Jun 26 10:26:55 2021 +0100 drm/vkms: update the current status of todo list Update: - debugging issues on igt testcases - plane composition features: add primary plane improvements - suggestions of good tasks to start working on vkms Drop: - syzkaller bug report: what triggered the warning was replaced by shmem functions at https://patchwork.freedesktop.org/patch/394614/ - overlay plane: this feature was added by https://patchwork.freedesktop.org/patch/430941/ Signed-off-by: Melissa Wen Reviewed-by: Rodrigo Siqueira Link: https://patchwork.freedesktop.org/patch/msgid/20210626092655.ghmmt2yux5klrne7@smtp.gmail.com commit 3352d86dcd3336a117630f0c1cfbc6bb8c93e1cf Author: José Roberto de Souza Date: Wed Jun 30 14:05:22 2021 -0700 drm/i915/display/dg1: Correctly map DPLLs during state readout _DG1_DPCLKA0_CFGCR0 maps between DPLL 0 and 1 with one bit for phy A and B while _DG1_DPCLKA1_CFGCR0 maps between DPLL 2 and 3 with one bit for phy C and D. Reusing _cnl_ddi_get_pll() don't take that into cosideration returing DPLL 0 and 1 for phy C and D. That is a regression introduced in the refactor done in commit 351221ffc5e5 ("drm/i915: Move DDI clock readout to encoder->get_config()"). While at it also dropping the macros previously used, not reusing it to improve readability. BSpec: 50286 Fixes: 351221ffc5e5 ("drm/i915: Move DDI clock readout to encoder->get_config()") Cc: Lucas De Marchi Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210630210522.162674-1-jose.souza@intel.com commit 36f5f9d37e19b72bd4383b8c43463f7f7149f1da Author: Jiri Kosina Date: Thu Jun 24 13:11:36 2021 +0200 drm/amdgpu: Avoid printing of stack contents on firmware load error In case when psp_init_asd_microcode() fails to load ASD microcode file, psp_v12_0_init_microcode() tries to print the firmware filename that failed to load before bailing out. This is wrong because: - the firmware filename it would want it print is an incorrect one as psp_init_asd_microcode() and psp_v12_0_init_microcode() are loading different filenames - it tries to print fw_name, but that's not yet been initialized by that time, so it prints random stack contents, e.g. amdgpu 0000:04:00.0: Direct firmware load for amdgpu/renoir_asd.bin failed with error -2 amdgpu 0000:04:00.0: amdgpu: fail to initialize asd microcode amdgpu 0000:04:00.0: amdgpu: psp v12.0: Failed to load firmware "\xfeTO\x8e\xff\xff" Fix that by bailing out immediately, instead of priting the bogus error message. Reported-by: Vojtech Pavlik Signed-off-by: Jiri Kosina Signed-off-by: Alex Deucher commit 4ef87d8f10aa375604b98c4e555f671d11e4111f Author: Jiri Kosina Date: Thu Jun 24 13:20:21 2021 +0200 drm/amdgpu: Fix resource leak on probe error path This reverts commit 4192f7b5768912ceda82be2f83c87ea7181f9980. It is not true (as stated in the reverted commit changelog) that we never unmap the BAR on failure; it actually does happen properly on amdgpu_driver_load_kms() -> amdgpu_driver_unload_kms() -> amdgpu_device_fini() error path. What's worse, this commit actually completely breaks resource freeing on probe failure (like e.g. failure to load microcode), as amdgpu_driver_unload_kms() notices adev->rmmio being NULL and bails too early, leaving all the resources that'd normally be freed in amdgpu_acpi_fini() and amdgpu_device_fini() still hanging around, leading to all sorts of oopses when someone tries to, for example, access the sysfs and procfs resources which are still around while the driver is gone. Fixes: 4192f7b57689 ("drm/amdgpu: unmap register bar on device init failure") Reported-by: Vojtech Pavlik Signed-off-by: Jiri Kosina Signed-off-by: Alex Deucher commit e42c6c1bc8d5e70d7b2c8af534b0d33a2be48f0c Merge: a03e880a700d9 8a02ea42bc1d4 Author: Jani Nikula Date: Thu Jul 1 18:46:34 2021 +0300 Merge drm/drm-next into drm-intel-next Bring drm-intel-next closer to drm-next and drm-intel-gt-next for a more feasible baseline for topic branches. Signed-off-by: Jani Nikula commit 97c9bfe3f6605d41eb8f1206e6e0f62b31ba15d6 Author: Thomas Zimmermann Date: Tue Jun 29 15:58:33 2021 +0200 drm/aperture: Pass DRM driver structure instead of driver name Print the name of the DRM driver when taking over fbdev devices. Makes the output to dmesg more consistent. Note that the driver name is only used for printing a string to the kernel log. No UAPI is affected by this change. Signed-off-by: Thomas Zimmermann Acked-by: Nirmoy Das Acked-by: Chen-Yu Tsai # sun4i Acked-by: Neil Armstrong # meson Link: https://patchwork.freedesktop.org/patch/msgid/20210629135833.22679-1-tzimmermann@suse.de commit 0ec187f69bcb2f2695b50050cc63ff512f00051d Author: Boris Brezillon Date: Wed Jun 30 08:27:51 2021 +0200 drm/panfrost: Increase the AS_ACTIVE polling timeout Experience has shown that 1ms is sometimes not enough, even when the GPU is running at its maximum frequency, not to mention that an MMU operation might take longer if the GPU is running at a lower frequency, which is likely to be the case if devfreq is active. Let's pick a significantly bigger timeout value (1ms -> 100ms) to be on the safe side. v5: * New patch Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-17-boris.brezillon@collabora.com commit 030761e097b421d74f7aa3b71ca11ba55686ae67 Author: Steven Price Date: Wed Jun 30 08:27:50 2021 +0200 drm/panfrost: Queue jobs on the hardware The hardware has a set of '_NEXT' registers that can hold a second job while the first is executing. Make use of these registers to enqueue a second job per slot. v5: * Fix a comment in panfrost_job_init() v3: * Fix the done/err job dequeuing logic to get a valid active state * Only enable the second slot on GPUs supporting jobchain disambiguation * Split interrupt handling in sub-functions Signed-off-by: Steven Price Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-16-boris.brezillon@collabora.com commit 30b5d4ed5b2eeea51e634b41663f854dd2fc12c2 Author: Boris Brezillon Date: Wed Jun 30 08:27:49 2021 +0200 drm/panfrost: Kill in-flight jobs on FD close If the process who submitted these jobs decided to close the FD before the jobs are done it probably means it doesn't care about the result. v5: * Add a panfrost_exception_is_fault() helper and the DRM_PANFROST_EXCEPTION_MAX_NON_FAULT value v4: * Don't disable/restore irqs when taking the job_lock (not needed since this lock is never taken from an interrupt context) v3: * Set fence error to ECANCELED when a TERMINATED exception is received Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-15-boris.brezillon@collabora.com commit 2905db2764cd6c66a73d70b0b3edea012dee5b71 Author: Boris Brezillon Date: Wed Jun 30 08:27:48 2021 +0200 drm/panfrost: Don't reset the GPU on job faults unless we really have to If we can recover from a fault without a reset there's no reason to issue one. v3: * Drop the mention of Valhall requiring a reset on JOB_BUS_FAULT * Set the fence error to -EINVAL instead of having per-exception error codes Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-14-boris.brezillon@collabora.com commit f9ab9c66f08082a143ac529f1e479b987c2a1fa1 Author: Boris Brezillon Date: Wed Jun 30 08:27:47 2021 +0200 drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck Things are unlikely to resolve until we reset the GPU. Let's not wait for other faults/timeout to happen to trigger this reset. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-13-boris.brezillon@collabora.com commit ed7a34c57defc59227219df60ecde37dc2ad64cb Author: Boris Brezillon Date: Wed Jun 30 08:27:46 2021 +0200 drm/panfrost: Disable the AS on unhandled page faults If we don't do that, we have to wait for the job timeout to expire before the fault jobs gets killed. v3: * Make sure the AS is re-enabled when new jobs are submitted to the context Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-12-boris.brezillon@collabora.com commit 1d0cab5461d73c3b8d592e5324fcb05e63cf25ef Author: Boris Brezillon Date: Wed Jun 30 08:27:45 2021 +0200 drm/panfrost: Make sure job interrupts are masked before resetting This is not yet needed because we let active jobs be killed during by the reset and we don't really bother making sure they can be restarted. But once we start adding soft-stop support, controlling when we deal with the remaining interrrupts and making sure those are handled before the reset is issued gets tricky if we keep job interrupts active. Let's prepare for that and mask+flush job IRQs before issuing a reset. v4: * Add a comment explaining why we WARN_ON(!job) in the irq handler * Keep taking the job_lock when evicting stalled jobs v3: * New patch Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-11-boris.brezillon@collabora.com commit a11c4711238ad39761cc0e04f3e8aa7b28fe1923 Author: Boris Brezillon Date: Wed Jun 30 08:27:44 2021 +0200 drm/panfrost: Simplify the reset serialization logic Now that we can pass our own workqueue to drm_sched_init(), we can use an ordered workqueue on for both the scheduler timeout tdr and our own reset work (which we use when the reset is not caused by a fault/timeout on a specific job, like when we have AS_ACTIVE bit stuck). This guarantees that the timeout handlers and reset handler can't run concurrently which drastically simplifies the locking. v5: * Don't call cancel_delayed_timeout() in the reset path (those works are canceled in drm_sched_stop()) v4: * Actually pass the reset workqueue to drm_sched_init() * Don't call cancel_work_sync() in panfrost_reset(). It will deadlock since it might be called from the reset work, which is executing and cancel_work_sync() will wait for the handler to return. Checking the reset pending status should avoid spurious resets v3: * New patch Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-10-boris.brezillon@collabora.com commit 070ce7657bdfaab5913908c93d57281c639cdca4 Author: Boris Brezillon Date: Wed Jun 30 08:27:43 2021 +0200 drm/panfrost: Use a threaded IRQ for job interrupts This should avoid switching to interrupt context when the GPU is under heavy use. v3: * Don't take the job_lock in panfrost_job_handle_irq() Signed-off-by: Boris Brezillon Acked-by: Alyssa Rosenzweig Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-9-boris.brezillon@collabora.com commit 229f45788e22aa60b9317fe84c46ecdff9c08b01 Author: Boris Brezillon Date: Wed Jun 30 08:27:42 2021 +0200 drm/panfrost: Expose a helper to trigger a GPU reset Expose a helper to trigger a GPU reset so we can easily trigger reset operations outside the job timeout handler. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-8-boris.brezillon@collabora.com commit 7319965fa19edb177ae3d240f5678fe0519cba97 Author: Boris Brezillon Date: Wed Jun 30 08:27:41 2021 +0200 drm/panfrost: Do the exception -> string translation using a table Do the exception -> string translation using a table. This way we get rid of those magic numbers and can easily add new fields if we need to attach extra information to exception types. v4: * Don't expose exception type to userspace * Merge the enum definition and the enum -> string table declaration in the same patch v3: * Drop the error field Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-7-boris.brezillon@collabora.com commit 6ef2f37f4016a482fd31d21bb295494d26794a7a Author: Boris Brezillon Date: Wed Jun 30 08:27:40 2021 +0200 drm/panfrost: Drop the pfdev argument passed to panfrost_exception_name() Currently unused. We'll add it back if we need per-GPU definitions. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-6-boris.brezillon@collabora.com commit 42738bad000ec820074de794264f31922517cc73 Author: Boris Brezillon Date: Wed Jun 30 08:27:39 2021 +0200 drm/panfrost: Get rid of the unused JS_STATUS_EVENT_ACTIVE definition Exception types will be defined as an enum. v4: * Fix typo in the commit message Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-5-boris.brezillon@collabora.com commit 9f4e9110133245028f41411578423412a01a7233 Author: Boris Brezillon Date: Wed Jun 30 08:27:38 2021 +0200 drm/panfrost: Make ->run_job() return an ERR_PTR() when appropriate If the fence creation fail, we can return the error pointer directly. The core will update the fence error accordingly. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-4-boris.brezillon@collabora.com commit 78efe21b6f8e6f4d39fceaf0cc5c534c11f9dd60 Author: Boris Brezillon Date: Wed Jun 30 08:27:37 2021 +0200 drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr Mali Midgard/Bifrost GPUs have 3 hardware queues but only a global GPU reset. This leads to extra complexity when we need to synchronize timeout works with the reset work. One solution to address that is to have an ordered workqueue at the driver level that will be used by the different schedulers to queue their timeout work. Thanks to the serialization provided by the ordered workqueue we are guaranteed that timeout handlers are executed sequentially, and can thus easily reset the GPU from the timeout handler without extra synchronization. v5: * Add a new paragraph to the timedout_job() method v3: * New patch v4: * Actually use the timeout_wq to queue the timeout work Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Lucas Stach Acked-by: Daniel Vetter Acked-by: Christian König Cc: Qiang Yu Cc: Emma Anholt Cc: Alex Deucher Cc: "Christian König" Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-3-boris.brezillon@collabora.com commit 1fad1b7ed1ebfcfb5a1d0d21b0c47f7af5f49a6c Author: Boris Brezillon Date: Wed Jun 30 08:27:36 2021 +0200 drm/sched: Document what the timedout_job method should do The documentation is a bit vague and doesn't really describe what the ->timedout_job() is expected to do. Let's add a few more details. v5: * New patch Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-2-boris.brezillon@collabora.com commit 6312333210161137db568a954d698fc28897cd3f Author: Lang Yu Date: Thu Jun 24 12:05:16 2021 +0800 drm/amdgpu: show explicit name instead of id in psp_cmd_submit_buf Use amdgpu_ucode_name to show ucode name and psp_gfx_cmd_name to show psp_gfx_cmd name in psp_cmd_submit_buf. v2: adjust function name Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit dc739d18c653ca9dd4ba3c534f1c84e802604e20 Author: Lang Yu Date: Thu Jun 24 11:51:46 2021 +0800 drm/amdgpu: add function to show psp_gfx_cmd name via id Implement function psp_gfx_cmd_name to show cmd name via cmd id. v2: rename it to psp_gfx_cmd_name Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit aae435c6e8c896f389cd40292e7ca67fe42e920a Author: Lang Yu Date: Thu Jun 24 11:36:57 2021 +0800 drm/amdgpu: add function to show ucode name via id Implement function amdgpu_ucode_name to show ucode name via ucode id. v2: rename it to amdgpu_ucode_name Signed-off-by: Lang Yu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 0677e4225653f628cf1a3d3c7ea210643284a48f Author: Alex Deucher Date: Tue Jun 29 10:11:12 2021 -0400 drm/amdgpu: add license to umc_8_7_0_sh_mask.h Was missing. Add it. Fixes: 6b36fa6143f6ca ("drm/amdgpu: add umc v8_7_0 IP headers") Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit c11ffa54be78c7bfa46eaa71cc697084b14a0d10 Author: Lukas Bulwahn Date: Mon Jun 28 12:53:34 2021 +0200 drm/amdgpu: rectify line endings in umc v8_7_0 IP headers Commit 6b36fa6143f6 ("drm/amdgpu: add umc v8_7_0 IP headers") adds the new file ./drivers/gpu/drm/amd/include/asic_reg/umc/umc_8_7_0_sh_mask.h with DOS line endings, which is very uncommon for the kernel repository. Rectify the line endings in this file with dos2unix. Identified by a checkpatch evaluation on the whole kernel repository and spot-checking for really unexpected checkpatch rule violations. Reported-by: Dwaipayan Ray Signed-off-by: Lukas Bulwahn Signed-off-by: Alex Deucher commit da98d99b0acd9cae14de3b8446e520f0c1613be5 Author: Luben Tuikov Date: Mon Jun 28 12:22:13 2021 -0400 drm/amd/pm: Simplify managed I2C transfer of Aldebaran Simplify Aldebaran managed I2C transfer function to correctly play with the upper I2C layers. This gets it in line with Navi10, Acturus, and Sienna Cichlid. Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: John Clements Cc: Hawking Zhang Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 9de96f3f7e33db4666530d3dfa5dd26a953e077e Author: Luben Tuikov Date: Fri Jun 11 02:15:49 2021 -0400 drm/amdgpu: Correctly disable the I2C IP block On long transfers to the EEPROM device, i.e. write, it is observed that the driver aborts the transfer. The reason for this is that the driver isn't patient enough--the IC_STATUS register's contents is 0x27, which is MST_ACTIVITY | TFE | TFNF | ACTIVITY. That is, while the transmission FIFO is empty, we, the I2C master device, are still driving the bus. Implement the correct procedure to disable the block, as described in the DesignWare I2C Databook, section 3.8.3 Disabling DW_apb_i2c on page 56. Now there are no premature aborts on long data transfers. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit e2e04041a25feff31faf5768caca2fef120209cb Author: Luben Tuikov Date: Thu Jun 3 23:58:19 2021 -0400 drm/amdgpu: Use a single loop In smu_v11_0_i2c_transmit() use a single loop to transmit bytes, instead of two nested loops. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 1d9d2ca85b32605ac9c74c8fa42d0c1cfbe019d4 Author: Luben Tuikov Date: Thu Apr 29 20:15:42 2021 -0400 drm/amdgpu: Fix koops when accessing RAS EEPROM Debugfs RAS EEPROM files are available when the ASIC supports RAS, and when the debugfs is enabled, an also when "ras_enable" module parameter is set to 0. However in this case, we get a kernel oops when accessing some of the "ras_..." controls in debugfs. The reason for this is that struct amdgpu_ras::adev is unset. This commit sets it, thus enabling access to those facilities. Note that this facilitates EEPROM access and not necessarily RAS features or functionality. Cc: Alexander Deucher Cc: John Clements Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit d456f3875af2eb5bf5a9cbd526622801ffc51037 Author: Alex Deucher Date: Wed Jun 30 11:19:14 2021 -0400 drm/amdgpu: fix 64 bit divide in eeprom code pos is 64 bits. Fixes: c65b0805e77919 ("drm/amdgpu: RAS EEPROM table is now in debugfs") Cc: luben.tuikov@amd.com Reported-by: kernel test robot Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit c65b0805e779196ba07c2cb29e7f71777e81009d Author: Luben Tuikov Date: Thu Apr 8 11:34:26 2021 -0400 drm/amdgpu: RAS EEPROM table is now in debugfs Add "ras_eeprom_size" file in debugfs, which reports the maximum size allocated to the RAS table in EEROM, as the number of bytes and the number of records it could store. For instance, $cat /sys/kernel/debug/dri/0/ras/ras_eeprom_size 262144 bytes or 10921 records $_ Add "ras_eeprom_table" file in debugfs, which dumps the RAS table stored EEPROM, in a formatted way. For instance, $cat ras_eeprom_table Signature Version FirstOffs Size Checksum 0x414D4452 0x00010000 0x00000014 0x000000EC 0x000000DA Index Offset ErrType Bank/CU TimeStamp Offs/Addr MemChl MCUMCID RetiredPage 0 0x00014 ue 0x00 0x00000000607608DC 0x000000000000 0x00 0x00 0x000000000000 1 0x0002C ue 0x00 0x00000000607608DC 0x000000001000 0x00 0x00 0x000000000001 2 0x00044 ue 0x00 0x00000000607608DC 0x000000002000 0x00 0x00 0x000000000002 3 0x0005C ue 0x00 0x00000000607608DC 0x000000003000 0x00 0x00 0x000000000003 4 0x00074 ue 0x00 0x00000000607608DC 0x000000004000 0x00 0x00 0x000000000004 5 0x0008C ue 0x00 0x00000000607608DC 0x000000005000 0x00 0x00 0x000000000005 6 0x000A4 ue 0x00 0x00000000607608DC 0x000000006000 0x00 0x00 0x000000000006 7 0x000BC ue 0x00 0x00000000607608DC 0x000000007000 0x00 0x00 0x000000000007 8 0x000D4 ue 0x00 0x00000000607608DD 0x000000008000 0x00 0x00 0x000000000008 $_ Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: John Clements Cc: Hawking Zhang Cc: Xinhui Pan Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 63d4c081a556a1e1f200411ad1e34a51965f1048 Author: Luben Tuikov Date: Tue Apr 6 07:07:54 2021 -0400 drm/amdgpu: Optimize EEPROM RAS table I/O Split functionality between read and write, which simplifies the code and exposes areas of optimization and more or less complexity, and take advantage of that. Read and write the table in one go; use a separate stage to decode or encode the data, as opposed to on the fly, which keeps the I2C bus busy. Use a single read/write to read/write the table or at most two if the number of records we're reading/writing wraps around. Check the check-sum of a table in EEPROM on init. Update the checksum at the same time as when updating the table header signature, when the threshold was increased on boot. Take advantage of arithmetic modulo 256, that is, use a byte!, to greatly simplify checksum arithmetic. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 017dad64db7ba56f1993ceda4880bb8a7e861253 Author: Luben Tuikov Date: Wed Jun 16 13:21:03 2021 -0400 drm/amdgpu: Get rid of test function The code is now tested from userspace. Remove already macroed out test function. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 0686627b3fb2718bb0a6a0e1cd2d0e3dcbe97623 Author: Luben Tuikov Date: Wed Jun 16 13:09:37 2021 -0400 drm/amdgpu: Some renames Qualify with "ras_". Use kernel's own--don't redefine your own. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit d7edde3dea08ee2ea863d5d00d322db03efc3de0 Author: Luben Tuikov Date: Wed Jun 16 11:26:07 2021 -0400 drm/amdgpu: Nerf buff buff --> buf. Essentially buffer abbreviates to buf, remove 1/2 of it, or just the iron part, as opposed to just the Er, Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit e4e6a58935eed66c4ea39c95bcb954c7db68d272 Author: Luben Tuikov Date: Sat Mar 27 03:57:49 2021 -0400 drm/amdgpu: Use explicit cardinality for clarity RAS_MAX_RECORD_NUM may mean the maximum record number, as in the maximum house number on your street, or it may mean the maximum number of records, as in the count of records, which is also a number. To make this distinction whether the number is ordinal (index) or cardinal (count), rename this macro to RAS_MAX_RECORD_COUNT. This makes it easy to understand what it refers to, especially when we compute quantities such as, how many records do we have left in the table, especially when there are so many other numbers, quantities and numerical macros around. Also rename the long, amdgpu_ras_eeprom_get_record_max_length() to the more succinct and clear, amdgpu_ras_eeprom_max_record_count(). When computing the threshold, which also deals with counts, i.e. "how many", use cardinal "max_eeprom_records_count", than the quantitative "max_eeprom_records_len". Simplify the logic here and there, as well. Cc: Guchun Chen Cc: John Clements Cc: Hawking Zhang Cc: Alexander Deucher Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 803c6ebdd32808834556b20548df9a1d079e4f24 Author: Luben Tuikov Date: Fri Mar 26 20:13:10 2021 -0400 drm/amdgpu: Simplify RAS EEPROM checksum calculations Rename update_table_header() to write_table_header() as this function is actually writing it to EEPROM. Use kernel types; use u8 to carry around the checksum, in order to take advantage of arithmetic modulo 8-bits (256). Tidy up to 80 columns. When updating the checksum, just recalculate the whole thing. Cc: Alexander Deucher Cc: Andrey Grodzovsky Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit dce4400e6516d18313d23de45b5be8a18980b00e Author: Luben Tuikov Date: Fri Mar 26 16:40:22 2021 -0400 drm/amdgpu: Fix amdgpu_ras_eeprom_init() No need to account for the 2 bytes of EEPROM address--this is now well abstracted away by the fixes the the lower layers. Cc: Andrey Grodzovsky Cc: Alexander Deucher Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit cf696091d38b61ff9e4e4d592522a2daf5e3637e Author: Luben Tuikov Date: Thu Mar 11 10:34:28 2021 -0500 drm/amdgpu: Return result fix in RAS The low level EEPROM write method, doesn't return 1, but the number of bytes written. Thus do not compare to 1, instead, compare to greater than 0 for success. Other cleanup: if the lower layers returned -errno, then return that, as opposed to overwriting the error code with one-fits-all -EINVAL. For instance, some return -EAGAIN. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 36b1a00d2bb496bc9ac010b42ba39413a27de7c8 Author: Luben Tuikov Date: Wed Mar 10 14:02:04 2021 -0500 drm/amdgpu: Fix width of I2C address The I2C address is kept as a 16-bit quantity in the kernel. The I2C_TAR::I2C_TAR field is 10-bit wide. Fix the width of the I2C address for Vega20 from 8 bits to 16 bits to accommodate the full spectrum of I2C address space. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit ebe57d0c8ecc7279c81d75746385595bc9eb5fca Author: Luben Tuikov Date: Tue Mar 9 17:29:22 2021 -0500 drm/amd/pm: Simplify managed I2C transfer functions Now that we have an I2C quirk table for SMU-managed I2C controllers, the I2C core does the checks for us, so we don't need to do them, and so simplify the managed I2C transfer functions. Also, for Arcturus and Navi10, fix setting the command type from "cmd->CmdConfig" to "cmd->Cmd". The latter is what appears to be taking in the enumeration I2C_CMD_... as an integer, not a bit-flag. For Sienna, the "Cmd" field seems to have been eliminated, and command type and flags all live in the "CmdConfig" field--this is left untouched. Fix: Detect and add changing of direction bit-flag, as this is necessary for the SMU to detect the direction change in the 1-d array of data it gets. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 16736627610da0713f603ba5fd02cf723cbf5a8d Author: Luben Tuikov Date: Fri Feb 19 23:37:28 2021 -0500 drm/amd/pm: Extend the I2C quirk table Extend the I2C quirk table for SMU access controlled I2C adapters. Let the kernel I2C layer check that the messages all have the same address, and that their combined size doesn't exceed the maximum size of a SMU software I2C request. Suggested-by: Jean Delvare Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 16ef797737c84462a3632dd4f8d77fe0f000428b Author: Luben Tuikov Date: Thu Mar 11 17:12:32 2021 -0500 drm/amdgpu: EEPROM: add explicit read and write Add explicit amdgpu_eeprom_read() and amdgpu_eeprom_write() for clarity. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 1fab841ff63d2b94673a46682098d86d67b195e2 Author: Luben Tuikov Date: Thu Mar 11 11:20:15 2021 -0500 drm/amdgpu: RAS xfer to read/write Wrap amdgpu_ras_eeprom_xfer(..., bool write), into amdgpu_ras_eeprom_read() and amdgpu_ras_eeprom_write(), as that makes reading and understanding the code clearer. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit a43996573ad531ad1def11f0ecf5fdad361348a6 Author: Luben Tuikov Date: Fri Feb 5 18:48:01 2021 -0500 drm/amdgpu: Rename misspelled function Instead of fixing the spelling in amdgpu_ras_eeprom_process_recods(), rename it to, amdgpu_ras_eeprom_xfer(), to look similar to other I2C and protocol transfer (read/write) functions. Also to keep the column span to within reason by using a shorter name. Change the "num" function parameter from "int" to "const u32" since it is the number of items (records) to xfer, i.e. their count, which cannot be a negative number. Also swap the order of parameters, keeping the pointer to records and their number next to each other, while the direction now becomes the last parameter. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit c28aa44de813d29d84bb6375eb92ff3cf92dab97 Author: Luben Tuikov Date: Thu Feb 4 14:15:01 2021 -0500 drm/amdgpu: RAS: EEPROM --> RAS In amdgpu_ras_eeprom.c--the interface from RAS to EEPROM, rename macros from EEPROM to RAS, to indicate that the quantities and objects are RAS specific, not EEPROM. We can decrease the RAS table, or put it in different offset of EEPROM as needed in the future. Remove EEPROM_ADDRESS_SIZE macro definition, equal to 2, from the file and calculations, as that quantity is computed and added on the stack, in the lower layer, amdgpu_eeprom_xfer(). Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit f4322d80ad677a64524f81ea7e4577008d7e4fcf Author: Luben Tuikov Date: Wed Feb 3 15:19:12 2021 -0500 drm/amdgpu: I2C class is HWMON Set the auto-discoverable class of I2C bus to HWMON. Remove SPD. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit edb63a53081d37679c5145a8125f5df105bc131e Author: Luben Tuikov Date: Tue Feb 2 18:36:25 2021 -0500 drm/amdgpu: Fix wrap-around bugs in RAS Fix the size of the EEPROM from 256000 bytes to 262144 bytes (256 KiB). Fix a couple or wrap around bugs. If a valid value/address is 0 <= addr < size, the inverse of this inequality (barring negative values which make no sense here) is addr >= size. Fix this in the RAS code. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit ccdfbfec9e1ca0c920e7c7ffeb874eb17d6b880c Author: Luben Tuikov Date: Tue Feb 2 11:26:13 2021 -0500 drm/amdgpu: RAS and FRU now use 19-bit I2C address Convert RAS and FRU code to use the 19-bit I2C memory address and remove all "slave_addr", as this is now absolved into the 19-bit address. Cc: Jean Delvare Cc: John Clements Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 025a64a58792523ffbae042ef0cf54de9c6a27f1 Author: Luben Tuikov Date: Mon Feb 1 13:38:54 2021 -0500 drm/amdgpu: I2C EEPROM full memory addressing * "eeprom_addr" is now 32-bit wide. * Remove "slave_addr" from the I2C EEPROM driver interface. The I2C EEPROM Device Type Identifier is fixed at 1010b, and the rest of the bits of the Device Address Byte/Device Select Code, are memory address bits, where the first three of those bits are the hardware selection bits. All this is now a 19-bit address and passed as "eeprom_addr". This abstracts the I2C bus for EEPROM devices for this I2C EEPROM driver. Now clients only pass the 19-bit EEPROM memory address, to the I2C EEPROM driver, as the 32-bit "eeprom_addr", from which they want to read from or write to. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 93ade343bbadd73999324dcc66c933e398e39818 Author: Luben Tuikov Date: Thu Jan 28 14:24:09 2021 -0500 drm/amdgpu: EEPROM respects I2C quirks Consult the i2c_adapter.quirks table for the maximum read/write data length per bus transaction. Do not exceed this transaction limit. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 746b584762e45206279a5f6b3e4d475f8db245a0 Author: Luben Tuikov Date: Wed Jan 27 17:09:52 2021 -0500 drm/amdgpu: Fixes to the AMDGPU EEPROM driver * When reading from the EEPROM device, there is no device limitation on the number of bytes read--they're simply sequenced out. Thus, read the whole data requested in one go. * When writing to the EEPROM device, there is a 256-byte page limit to write to before having to generate a STOP on the bus, as well as the address written to mustn't cross over the page boundary (it actually rolls over). Maximize the data written to per bus acquisition. * Return the number of bytes read/written, or -errno. * Add kernel doc. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit daaa75fd9817b1eb5ce558fa866d6b0c09baae11 Author: Luben Tuikov Date: Tue Jan 26 15:56:45 2021 -0500 drm/amdgpu: Fix Vega20 I2C to be agnostic (v2) Teach Vega20 I2C to be agnostic. Allow addressing different devices while the master holds the bus. Set STOP as per the controller's specification. v2: Qualify generating ReSTART before the 1st byte of the message, when set by the caller, as those functions are separated, as caught by Andrey G. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 35ed27032cd22bb30bae6a52cd8b7887c089a20c Author: Andrey Grodzovsky Date: Tue Jan 26 12:48:10 2021 -0500 drm/amdgpu/pm: ADD I2C quirk adapter table To be used by kernel clients of the adapter. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Andrey Grodzovsky Suggested-by: Lazar Lijo Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 14df56504fdf5d1e84096a4818ff7efc891bfdb6 Author: Andrey Grodzovsky Date: Tue Jan 26 12:09:18 2021 -0500 drm/amd/pm: SMU I2C: Return number of messages processed Fix from number of processed bytes to number of processed I2C messages. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 6a0a55a2eb4584a7189daa3dabdf0c82bdd6466b Author: Andrey Grodzovsky Date: Fri Jan 22 23:25:31 2021 -0500 drm/amdgpu: Send STOP for the last byte of msg only Let's just ignore the I2C_M_STOP hint from upper layer for SMU I2C code as there is no clean mapping between single per I2C message STOP flag at the kernel I2C layer and the SMU, per each byte STOP flag. We will just by default set it at the end of the SMU I2C message. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Andrey Grodzovsky Suggested-by: Lazar Lijo Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 965ec37c4685cd8fd7947ad20397891411d432a1 Author: Andrey Grodzovsky Date: Fri Jan 22 23:15:25 2021 -0500 drm/amdgpu: Drop i > 0 restriction for issuing RESTART Drop i > 0 restriction for issuing RESTART. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 6240da4dfc99d727f8f28c574fac51413bea1837 Author: Andrey Grodzovsky Date: Fri Jan 22 16:29:56 2021 -0500 dmr/amdgpu: Add RESTART handling also to smu_v11_0_i2c (VG20) Also generilize the code to accept and translate to HW bits any I2C relvent flags both for read and write. Cc: Jean Delvare Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Lijo Lazar Cc: Stanley Yang Cc: Hawking Zhang Signed-off-by: Andrey Grodzovsky Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit 2485f8cfff3898cb4dc51470f697775c27075967 Author: Andrey Grodzovsky Date: Fri Jan 22 11:19:48 2021 -0500 drm/amdgpu: Remember to wait 10ms for write buffer flush v2 EEPROM spec requests this. v2: Only to be done for write data transactions. Signed-off-by: Andrey Grodzovsky Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit b36d8d6b7748e5b0089c0f901468f64256ce5d0e Author: Alex Deucher Date: Thu Jan 21 23:56:32 2021 -0500 drm/amdgpu: only set restart on first cmd of the smu i2c transaction Not sure how the firmware interprets these. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 73a5784a5bd0b4e8bfe5dbed1a6b7936bf1005e3 Author: Aaron Rice Date: Thu Jan 21 23:45:54 2021 -0500 drm/amdgpu: rework smu11 i2c for generic operation Handle things besides EEPROMS. Signed-off-by: Aaron Rice Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 3e2eae8db2169c4caea8ae7d2701ef8c1871ac92 Author: Alex Deucher Date: Thu Jan 21 23:12:11 2021 -0500 drm/amdgpu: add I2C_CLASS_HWMON to SMU i2c buses Not sure that this really matters that much, but these could have various other hwmon chips on them. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 39ed82d1d9ce8eeb4126be07b3ea96be8f84fef3 Author: Alex Deucher Date: Thu Jan 21 23:32:38 2021 -0500 drm/amdgpu: i2c subsystem uses 7 bit addresses Convert from 8 bit to 7 bit. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 25e5c09f2b157156f1c4070fe765d1a631d86a4c Author: Alex Deucher Date: Thu Jan 21 15:26:38 2021 -0500 drm/amdgpu/ras: switch fru eeprom handling to use generic helper (v2) Use the new helper rather than doing i2c transfers directly. v2: fix typo Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 24f55c05592e73dd7cb7e79fbf7be638578d162d Author: Alex Deucher Date: Thu Jan 21 15:13:05 2021 -0500 drm/amdgpu/ras: switch ras eeprom handling to use generic helper Use the new helper rather than doing i2c transfers directly. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 00e3a289d9e259a383e306d45b8052b8e69d6a8c Author: Alex Deucher Date: Thu Jan 21 14:41:27 2021 -0500 drm/amdgpu: add new helper for handling EEPROM i2c transfers Encapsulates the i2c protocol handling so other parts of the driver can just tell it the offset and size of data to write. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit af01340bc423de0ca1cbfda90dbda71860702f68 Author: Alex Deucher Date: Thu Jan 21 14:17:34 2021 -0500 drm/amdgpu/pm: add smu i2c implementation for navi1x (v5) And handle more than just EEPROMs. v2: fix restart handling between transactions. v3: handle 7 to 8 bit addr conversion v4: Fix &req --> req. (Luben T) v5: squash in i2c channel fix Signed-off-by: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov commit f400b6cec81e98454e9e3d4e49e163154a99a68d Author: Alex Deucher Date: Thu Jan 21 14:17:03 2021 -0500 drm/amdgpu/pm: rework i2c xfers on arcturus (v5) Make it generic so we can support more than just EEPROMs. v2: fix restart handling between transactions. v3: handle 7 to 8 bit addr conversion v4: Fix &req --> req. (Luben T) v5: squash in i2c channel fix Signed-off-by: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov commit 5125c96a9d87fbfdc8bb01e37b5d28c0e15ea108 Author: Alex Deucher Date: Thu Jan 21 14:08:29 2021 -0500 drm/amdgpu/pm: rework i2c xfers on sienna cichlid (v4) Make it generic so we can support more than just EEPROMs. v2: fix restart handling between transactions. v3: handle 7 to 8 bit addr conversion v4: Fix &req --> req. (Luben T) Signed-off-by: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Luben Tuikov commit 6963d6c176fe36c775996cfd6886d4c4234ccd9e Author: Alex Deucher Date: Thu Jan 21 16:39:59 2021 -0500 drm/amdgpu: add a mutex for the smu11 i2c bus (v2) So we lock software as well as hardware access to the bus. v2: fix mutex handling. Signed-off-by: Alex Deucher Reviewed-by: Luben Tuikov commit 32334c9b1fd78ad661582c55b15d263a5d6d157d Author: Matthew Auld Date: Fri Jun 25 11:38:24 2021 +0100 drm/i915/gtt: ignore min_page_size for paging structures The min_page_size is only needed for pages inserted into the GTT, and for our paging structures we only need at most 4K bytes, so simply ignore the min_page_size restrictions here, otherwise we might see some severe overallocation on some devices. v2(Thomas): add some commentary Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210625103824.558481-2-matthew.auld@intel.com commit d22632c83b948e4f7a3d4202a884be2409098cc2 Author: Matthew Auld Date: Fri Jun 25 11:38:23 2021 +0100 drm/i915: support forcing the page size with lmem For some specialised objects we might need something larger than the regions min_page_size due to some hw restriction, and slightly more hairy is needing something smaller with the guarantee that such objects will never be inserted into any GTT, which is the case for the paging structures. This also fixes how we setup the BO page_alignment, if we later migrate the object somewhere else. For example if the placements are {SMEM, LMEM}, then we might get this wrong. Pushing the min_page_size behaviour into the manager should fix this. v2(Thomas): push the default page size behaviour into buddy_man, and let the user override it with the page-alignment, which looks cleaner v3: rebase on ttm sys changes Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210625103824.558481-1-matthew.auld@intel.com commit e11b7b6e574d57b99952213b5388db66445b18f2 Author: Thomas Hellström Date: Tue Jun 29 17:12:03 2021 +0200 drm/i915/display: Migrate objects to LMEM if possible for display Objects intended to be used as display framebuffers must reside in LMEM for discrete. If they happen to not do that, migrate them to LMEM before pinning. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210629151203.209465-4-thomas.hellstrom@linux.intel.com commit bf74a18ca8569ff1ac89501026a8218753f757f7 Author: Matthew Auld Date: Tue Jun 29 17:12:02 2021 +0200 drm/i915/gem: Introduce a selftest for the gem object migrate functionality A selftest for the gem object migrate functionality. Slightly adapted from the original by Matthew to the new interface and new fill blit code. v4: - Initialize buffers and check contents after migration (Suggested by Matthew Auld) - Perform async migration (if implemented) in the igt_lmem_pages_migrate test - Test also migration to the current region. Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Matthew Auld Reviewed-by: Michael J. Ruhl #v3 Link: https://patchwork.freedesktop.org/patch/msgid/20210629151203.209465-3-thomas.hellstrom@linux.intel.com commit b6e913e19c54eddd6a4d637969f5c079effb74c6 Author: Thomas Hellström Date: Tue Jun 29 17:12:01 2021 +0200 drm/i915/gem: Implement object migration Introduce an interface to migrate objects between regions. This is primarily intended to migrate objects to LMEM for display and to SYSTEM for dma-buf, but might be reused in one form or another for performance-based migration. v2: - Verify that the memory region given as an id really exists. (Reported by Matthew Auld) - Call i915_gem_object_{init,release}_memory_region() when switching region to handle also switching region lists. (Reported by Matthew Auld) v3: - Fix i915_gem_object_can_migrate() to return true if object is already in the correct region, even if the object ops doesn't have a migrate() callback. - Update typo in commit message. - Fix kerneldoc of i915_gem_object_wait_migration(). v4: - Improve documentation (Suggested by Mattew Auld and Michael Ruhl) - Always assume TTM migration hits a TTM move and unsets the pages through move_notify. (Reported by Matthew Auld) - Add a dma_fence_might_wait() annotation to i915_gem_object_wait_migration() (Suggested by Daniel Vetter) v5: - Re-add might_sleep() instead of __dma_fence_might_wait(), Sent v4 with the wrong version, didn't compile and __dma_fence_might_wait() is not exported. - Added an R-B. Reported-by: kernel test robot Signed-off-by: Thomas Hellström Reviewed-by: Michael J. Ruhl Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210629151203.209465-2-thomas.hellstrom@linux.intel.com commit 60f3c604bcc0c13f3fbbf75a4c7be87134023a3c Author: Mikel Rychliski Date: Thu Jun 24 00:51:20 2021 -0400 drm/radeon: Fix NULL dereference when updating memory stats radeon_ttm_bo_destroy() is attempting to access the resource object to update memory counters. However, the resource object is already freed when ttm calls this function via the destroy callback. This causes an oops when a bo is freed: BUG: kernel NULL pointer dereference, address: 0000000000000010 RIP: 0010:radeon_ttm_bo_destroy+0x2c/0x100 [radeon] Call Trace: radeon_bo_unref+0x1a/0x30 [radeon] radeon_gem_object_free+0x33/0x50 [radeon] drm_gem_object_release_handle+0x69/0x70 [drm] drm_gem_handle_delete+0x62/0xa0 [drm] ? drm_mode_destroy_dumb+0x40/0x40 [drm] drm_ioctl_kernel+0xb2/0xf0 [drm] drm_ioctl+0x30a/0x3c0 [drm] ? drm_mode_destroy_dumb+0x40/0x40 [drm] radeon_drm_ioctl+0x49/0x80 [radeon] __x64_sys_ioctl+0x8e/0xd0 Avoid the issue by updating the counters in the delete_mem_notify callback instead. Also, fix memory statistic updating in radeon_bo_move() to identify the source type correctly. The source type needs to be saved before the move, because the moved from object may be altered by the move. Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2") Signed-off-by: Mikel Rychliski Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210624045121.15643-1-mikel@mikelr.com commit a03e880a700d9e217f7660bfc3616d93783b6d8c Author: Bhanuprakash Modem Date: Fri Apr 23 19:46:09 2021 +0530 drm/i915/display: Fix state mismatch in drm infoframe While reading the SDP infoframe, we are getting filtered with the encoder type INTEL_OUTPUT_DDI which causes the infoframe mismatch. This patch will drop encoder->type check as we can mask individual infoframe type. [1025.606556] i915 0000:00:02.0: [drm] *ERROR* mismatch in drm infoframe [1025.607865] i915 0000:00:02.0: [drm] *ERROR* expected: [1025.607879] i915 0000:00:02.0: HDMI infoframe: Dynamic Range and Mastering, version 1, length 26 [1025.607889] i915 0000:00:02.0: length: 26 [1025.607898] i915 0000:00:02.0: metadata type: 0 [1025.608292] i915 0000:00:02.0: eotf: 2 [1025.608302] i915 0000:00:02.0: x[0]: 35400 [1025.608312] i915 0000:00:02.0: y[0]: 14599 [1025.609115] i915 0000:00:02.0: x[1]: 8500 [1025.609947] i915 0000:00:02.0: y[1]: 39850 [1025.609959] i915 0000:00:02.0: x[2]: 6550 [1025.609970] i915 0000:00:02.0: y[2]: 2300 [1025.609980] i915 0000:00:02.0: white point x: 15634 [1025.609989] i915 0000:00:02.0: white point y: 16450 [1025.610381] i915 0000:00:02.0: max_display_mastering_luminance: 1000 [1025.610392] i915 0000:00:02.0: min_display_mastering_luminance: 500 [1025.610401] i915 0000:00:02.0: max_cll: 500 [1025.610816] i915 0000:00:02.0: max_fall: 1000 [1025.612457] i915 0000:00:02.0: [drm] *ERROR* found: [1025.614354] ------------[ cut here ]------------ [1025.616244] pipe state doesn't match! [1025.617640] WARNING: CPU: 6 PID: 2114 at drivers/gpu/drm/i915/display/intel_display.c:9332 intel_atomic_commit_tail+0x14d4/0x17c0 [i915] V2: * Drop encoder->type check V3: * Remove internal reviews Cc: Uma Shankar Cc: Ville Syrjälä Signed-off-by: Bhanuprakash Modem Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20210423141609.28568-1-bhanuprakash.modem@intel.com commit 0454a490bdebea78e93e325a020f9f80908b9ed6 Author: Matthew Brost Date: Tue Jun 29 12:35:11 2021 -0700 drm/doc/rfc: i915 new parallel submission uAPI plan Add entry for i915 new parallel submission uAPI plan. v2: (Daniel Vetter): - Expand logical order explaination - Add dummy header - Only allow N BBs in execbuf IOCTL - Configure parallel submission per slot not per gem context v3: (Marcin Ślusarz): - Lot's of typos / bad english fixed (Tvrtko Ursulin): - Consistent pseudo code, clean up wording in descriptions v4: (Daniel Vetter) - Drop flags - Add kernel doc - Reword a few things / fix typos (Tvrtko) - Reword a few things / fix typos v5: (Checkpatch) - Fix typos (Docs) - Fix warning Cc: Tvrtko Ursulin Cc: Tony Ye CC: Carl Zhang Cc: Daniel Vetter Cc: Jason Ekstrand Signed-off-by: Matthew Brost Acked-by: Daniel Vetter Acked-by: Tony Ye Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210629193511.124099-3-matthew.brost@intel.com commit f587623b78ff538f5d9ef1241e58b91ea70a4daf Author: Matthew Brost Date: Tue Jun 29 12:35:10 2021 -0700 drm/doc/rfc: i915 GuC submission / DRM scheduler Add entry for i915 GuC submission / DRM scheduler integration plan. Follow up patch with details of new parallel submission uAPI to come. v2: (Daniel Vetter) - Expand explaination of why bonding isn't supported for GuC submission - CC some of the DRM scheduler maintainers - Add priority inheritance / boosting use case - Add reasoning for removing in order assumptions (Daniel Stone) - Add links to priority spec v4: (Tvrtko) - Add TODOs section (Daniel Vetter) - Pull in 1 line from following patch v5: (Checkpatch) - Fix typos Cc: Christian König Cc: Luben Tuikov Cc: Alex Deucher Cc: Steven Price Cc: Jon Bloomfield Cc: Dave Airlie Cc: Daniel Vetter Cc: Jason Ekstrand Cc: dri-devel@lists.freedesktop.org Signed-off-by: Matthew Brost Reviewed-by: Daniel Vetter Acked-by: Dave Airlie Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210629193511.124099-2-matthew.brost@intel.com commit 8b758859dfbe9598ba41e8b9b01e44edcc0c2fc1 Author: Namjae Jeon Date: Tue Jun 29 14:52:00 2021 +0900 ksmbd: reorder and document on-disk and netlink structures in headers Reorder and document on-disk and netlink structures in headers. This is a userspace ABI to communicate data between ksmbd and user IPC daemon using netlink. This is added to track and cache user account DB and share configuration info from userspace. - KSMBD_EVENT_HEARTBEAT_REQUEST(ksmbd_heartbeat) This event is to check whether user IPC daemon is alive. If user IPC daemon is dead, ksmbd keep existing connection till disconnecting and new connection will be denied. - KSMBD_EVENT_STARTING_UP(ksmbd_startup_request) This event is to receive the information that initializes the ksmbd server from the user IPC daemon and to start the server. The global section parameters are given from smb.conf as initialization information. - KSMBD_EVENT_SHUTTING_DOWN(ksmbd_shutdown_request) This event is to shutdown ksmbd server. - KSMBD_EVENT_LOGIN_REQUEST/RESPONSE(ksmbd_login_request/response) This event is to get user account info to user IPC daemon. - KSMBD_EVENT_SHARE_CONFIG_REQUEST/RESPONSE (ksmbd_share_config_request/response) This event is to get net share configuration info. - KSMBD_EVENT_TREE_CONNECT_REQUEST/RESPONSE (ksmbd_tree_connect_request/response) This event is to get session and tree connect info. - KSMBD_EVENT_TREE_DISCONNECT_REQUEST(ksmbd_tree_disconnect_request) This event is to send tree disconnect info to user IPC daemon. - KSMBD_EVENT_LOGOUT_REQUEST(ksmbd_logout_request) This event is to send logout request to user IPC daemon. - KSMBD_EVENT_RPC_REQUEST/RESPONSE(ksmbd_rpc_command) This event is to make DCE/RPC request like srvsvc, wkssvc, lsarpc, samr to be processed in userspace. - KSMBD_EVENT_SPNEGO_AUTHEN_REQUEST/RESPONSE (ksmbd_spnego_authen_request/response) This event is to make kerberos authentication to be processed in userspace. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c63ee4a521e766da6ec5ee1d2058d1ec06216214 Author: Namjae Jeon Date: Wed Jun 30 09:39:15 2021 +0900 ksmbd: change server config string index to enumeration Change server config string index to enumeration. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b9cbfb524d73ca953604dc421098b4a3aa14d095 Author: Namjae Jeon Date: Wed Jun 30 09:38:46 2021 +0900 ksmbd: change server state type macro to enumeration Change server state type macro to enumeration. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 12411ad59d49e415f987719b8f676e2c6b99be37 Author: Namjae Jeon Date: Wed Jun 30 09:38:13 2021 +0900 ksmbd: change sid types to enumeration Change sid types to enumeration. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6128468da50c790f56d0aed2f604333fb324f897 Author: Namjae Jeon Date: Wed Jun 30 09:37:43 2021 +0900 ksmbd: change ACE types to enumeration Change ACE types to enumeration. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0ae941ef2e481e478a4b6c52a16e73c7bb4b9e3e Author: Namjae Jeon Date: Wed Jun 30 09:37:09 2021 +0900 ksmbd: remove SMB1 oplock level macros ksmbd does not support SMB1. This patch remove SMB1 oplock level macros. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 747aeb2632f6341168b78f28ce16fce0e6cee205 Author: Tejas Upadhyay Date: Tue Jun 29 16:19:54 2021 +0530 drm/i915/ehl: Remove require_force_probe protection Removing force probe protection from EHL platform. Did not observe warnings, errors, flickering or any visual defects while doing ordinary tasks like browsing and editing documents in a two monitor setup. For more info drm-tip idle run results : https://intel-gfx-ci.01.org/tree/drm-tip/drmtip.html? Cc: Chris Wilson Signed-off-by: Tejas Upadhyay Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210629104954.927151-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit b54d8e8de2b2b88d84cc7013e1339208042db1cf Author: Tejas Upadhyay Date: Tue Jun 29 16:23:56 2021 +0530 drm/i915/jsl: Remove require_force_probe protection Removing force probe protection from JSL platform. Did not observe warnings, errors, flickering or any visual defects while doing ordinary tasks like browsing and editing documents in a two monitor setup. For more info drm-tip idle run results : https://intel-gfx-ci.01.org/tree/drm-tip/drmtip.html? Cc: Chris Wilson Signed-off-by: Tejas Upadhyay Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210629105356.927359-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit 9ea39a900a1f085942045f5d91bea8e7956f563e Author: Thomas Zimmermann Date: Fri Jun 25 10:22:22 2021 +0200 drm/zte: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in zte. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-28-tzimmermann@suse.de commit fe319919f40da7bc6d6cddcc12bec99703ff12f5 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:21 2021 +0200 drm/xlnx: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in xlnx. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-27-tzimmermann@suse.de commit aa3d18a344a199cbef3955bcdf18f68036076420 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:20 2021 +0200 drm/vmwgfx: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in vmxgfx. All usage of the field within vmwgfx can safely be removed. Signed-off-by: Thomas Zimmermann Reviewed-by: Zack Rusin Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-26-tzimmermann@suse.de commit 9ed64b1d15675d520ce9df75a5e70c1741c40dad Author: Thomas Zimmermann Date: Fri Jun 25 10:22:19 2021 +0200 drm/vkms: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in vkms. Signed-off-by: Thomas Zimmermann Reviewed-by: Melissa Wen Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-25-tzimmermann@suse.de commit 44737e4c8f0565eb2e52ee8c56e10a959c7fa4a7 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:18 2021 +0200 drm/vc4: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in vc4. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-24-tzimmermann@suse.de commit a35a9375403ffbe7dbe0c418943e95966677a05a Author: Thomas Zimmermann Date: Fri Jun 25 10:22:17 2021 +0200 drm/tidss: Don't use struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't use it in tidss. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-23-tzimmermann@suse.de commit 14746211570b4e368d2027a77ff8372722136a5c Author: Thomas Zimmermann Date: Fri Jun 25 10:22:16 2021 +0200 drm/tegra: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in tegra. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Thierry Reding Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-22-tzimmermann@suse.de commit 8ff113fa4219a359d0603fcc574b60845b1ffc03 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:15 2021 +0200 drm/sun4i: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in sun4i. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-21-tzimmermann@suse.de commit aa2fcf12178a3e2cecd251fdf0cd17a713b83125 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:14 2021 +0200 drm/stm: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in stm. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Tested-by: Yannick Fertre Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-20-tzimmermann@suse.de commit 4a4928b0b1d290091ba4e0b884be4d25b3cecf7a Author: Thomas Zimmermann Date: Fri Jun 25 10:22:13 2021 +0200 drm/sti: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in sti. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-19-tzimmermann@suse.de commit e0d17d6270d3fb4eaeaa65880d377da46d133f0a Author: Thomas Zimmermann Date: Fri Jun 25 10:22:12 2021 +0200 drm/rockchip: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in rockchip. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-18-tzimmermann@suse.de commit 578b1cc6a6957fdc9d6e0da2f3c9017c93c5bbd8 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:11 2021 +0200 drm/rcar-du: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in rcar-du. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-17-tzimmermann@suse.de commit daea75017cfcb6a2aa69956ab608212405d02afa Author: Thomas Zimmermann Date: Fri Jun 25 10:22:10 2021 +0200 drm/omapdrm: Track IRQ state in local device state Replace usage of struct drm_device.irq_enabled with the driver's own state field struct omap_drm_device.irq_enabled. The field in the DRM device structure is considered legacy and should not be used by KMS drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-16-tzimmermann@suse.de commit a77cd38b3d60703d5aacaedc2c2bb8bb972560f6 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:09 2021 +0200 drm/nouveau: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in nouveau. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-15-tzimmermann@suse.de commit 192a20290880e987738b66dc707a77858df4cb0e Author: Thomas Zimmermann Date: Fri Jun 25 10:22:08 2021 +0200 drm/mediatek: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in mediatek. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-14-tzimmermann@suse.de commit d1e9d73509891445faa49cd01a46762295a17031 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:07 2021 +0200 drm/imx/dcss: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in dcss. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Laurentiu Palcu Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-13-tzimmermann@suse.de commit b09b85f1455edb0d7347e28d3e92b6f0d3a3ec8b Author: Thomas Zimmermann Date: Fri Jun 25 10:22:06 2021 +0200 drm/imx: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in imx. v3: * move dcss changes into separate patch (Laurentiu) Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Philipp Zabel Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-12-tzimmermann@suse.de commit 6a940c4da6726476019999bc8ab78d442876c959 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:05 2021 +0200 drm/kirin: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in kirin. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-11-tzimmermann@suse.de commit 8d1cc01d3e29b47864e675e91f5dd5b438206f57 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:04 2021 +0200 drm/exynos: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in exynos. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-10-tzimmermann@suse.de commit a4583a0ebce92b16ba0ae88f711baea3b40ba640 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:03 2021 +0200 drm/malidp: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in malidp. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Liviu Dudau Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-9-tzimmermann@suse.de commit 64be7a1d4d72cff2e06275d7766c95143397b577 Author: Thomas Zimmermann Date: Fri Jun 25 10:22:02 2021 +0200 drm/komeda: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in komeda. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Liviu Dudau Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-8-tzimmermann@suse.de commit ac1723c16b6625cb41c04a441af933dc65e72b0b Author: Thomas Zimmermann Date: Fri Jun 25 10:22:01 2021 +0200 drm/i915: Track IRQ state in local device state Replace usage of struct drm_device.irq_enabled with the driver's own state field struct drm_i915_private.irq_enabled. The field in the DRM device structure is considered legacy and should not be used by KMS drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-7-tzimmermann@suse.de commit 24d31c4995b4076dc3a24941714652de9ea1af8c Author: Thomas Zimmermann Date: Fri Jun 25 10:22:00 2021 +0200 drm/armada: Don't set struct drm_device.irq_enabled The field drm_device.irq_enabled is only used by legacy drivers with userspace modesetting. Don't set it in armada. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-6-tzimmermann@suse.de commit 1e4cd78ed4932b08bc839392fa6784e03d8f9619 Author: Thomas Zimmermann Date: Fri Jun 25 10:21:59 2021 +0200 drm: Don't test for IRQ support in VBLANK ioctls For KMS drivers, replace the IRQ check in VBLANK ioctls with a check for vblank support. IRQs might be enabled wthout vblanking being supported. This change also removes the DRM framework's only dependency on IRQ state for non-legacy drivers. For legacy drivers with userspace modesetting, the original test remains in drm_wait_vblank_ioctl(). v4: * avoid preprocessor ifdef in drm_wait_vblank_ioctl() (Jani, Thierry) v3: * optimize test in drm_wait_vblank_ioctl() for KMS case (Liviu) * update docs for drm_irq_uninstall() v2: * keep the old test for legacy drivers in drm_wait_vblank_ioctl() (Daniel) Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Reviewed-by: Liviu Dudau Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-5-tzimmermann@suse.de commit b2ffa2c25bba2b2a5cb550e621eead5467944a74 Author: Thomas Zimmermann Date: Fri Jun 25 10:21:58 2021 +0200 drm/radeon: Track IRQ state in local device state Replace usage of struct drm_device.irq_enabled with the driver's own state field struct radeon_device.irq.installed. The field in the DRM device structure is considered legacy and should not be used by KMS drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-4-tzimmermann@suse.de commit f4b62145f47b95b81116bab2cecb832a87df777c Author: Thomas Zimmermann Date: Fri Jun 25 10:21:57 2021 +0200 drm/hibmc: Call drm_irq_uninstall() unconditionally Remove the check around drm_irq_uninstall(). The same test is done by the function internally. The tested state in irq_enabled is considered obsolete and should not be used by KMS drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Tian Tao Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-3-tzimmermann@suse.de commit 0cabcf83b200423602cb4929433ddb06a2d72da5 Author: Thomas Zimmermann Date: Fri Jun 25 10:21:56 2021 +0200 drm/amdgpu: Track IRQ state in local device state Replace usage of struct drm_device.irq_enabled with the driver's own state field struct amdgpu_device.irq.installed. The field in the DRM device structure is considered legacy and should not be used by KMS drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210625082222.3845-2-tzimmermann@suse.de commit 849fbc549d4cca576d659d7df139c5f04104cb48 Author: Namjae Jeon Date: Tue Jun 29 09:24:31 2021 +0900 ksmbd: opencode to remove ATTR_FP macro Opencode to remove ATTR_FP macro. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 12202c0594b18218e1645fd0fad92cf77a1f3145 Author: Namjae Jeon Date: Tue Jun 29 09:23:56 2021 +0900 ksmbd: use ksmbd_vfs_lock_parent to get stable parent dentry Use ksmbd_vfs_lock_parent to get stable parent dentry and remove PARENT_INODE macro. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ab0b263b749ade964db46b148a965eb88bd644be Author: Namjae Jeon Date: Tue Jun 29 09:20:13 2021 +0900 ksmbd: opencode to remove FP_INODE macro Opencode to remove FP_INODE macro. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 493fa2fbe4597db474e43d38fb8805cbaef654ac Author: Namjae Jeon Date: Tue Jun 29 09:22:16 2021 +0900 ksmbd: fix dentry racy with rename() Using ->d_name can be broken due to races with rename(). So use %pd with ->d_name to print filename and In other cases, use it under ->d_lock. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a5a25a114ab2412831f063361360eb1192ca6151 Author: Marios Makassikis Date: Sat Jun 26 22:56:48 2021 +0900 ksmbd: Relax credit_charge check in smb2_validate_credit_charge() smb2_validate_credit_charge() checks the CreditCharge field in the request is valid with regards to the payload size. The current implementation rejects requests with CreditCharge = 0 and a payload < 64K, even though they should be accepted. Set CreditCharge to a minimum value of 1 to avoid rejecting such requests. This matches what samba4 does. Fixes share enumeration for jcifs-ng clients. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e294f78d34785151cb6d7199ff61d110f9520e65 Author: Namjae Jeon Date: Mon Jun 28 15:26:37 2021 +0900 ksmbd: allow PROTECTED_DACL_SECINFO and UNPROTECTED_DACL_SECINFO addition information in smb2 set info security "cifsd: Fix regression in smb2_get_info" patch cause that dacl doesn't work. windows send smb2 set info security with PROTECTED_DACL_SECINFO to control dacl. But previous patch doesn't allow it. This patch add PROTECTED_DACL_SECINFO and UNPROTECTED_DACL_SECINFO addtional information flags in check. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8a893315dc06158ce33d1a3292e07170ce2fcd64 Author: Namjae Jeon Date: Fri Jun 25 13:43:37 2021 +0900 ksmbd: replace request and respone buffer macro with inline functions replace request and respone buffer macro with inline functions. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 02d4b4aa6d3b135b00f20da9d623d2bbae63768f Author: Namjae Jeon Date: Fri Jun 25 13:43:01 2021 +0900 ksmbd: replace SMB_DIRECT_TRANS macro with inline function replace SMB_DIRECT_TRANS macro with inline function. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d8fb29980cb5369c4ea520c0b4e1a8893e88f14c Author: Hyunchul Lee Date: Fri Jun 25 11:53:26 2021 +0900 ksmbd: remove and replace macros with inline functions in smb_common.h Remove and replace macros with inline functions in smb_common.h Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d4075abbc6b571e9d03d7a742e53fd6085223649 Author: Hyunchul Lee Date: Fri Jun 25 07:02:10 2021 +0900 ksmbd: remove getting worker state macros Remove getting worker state macros Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit cb5b047f8e14e91774f68625dafb130fb160b4eb Author: Hyunchul Lee Date: Fri Jun 25 07:02:09 2021 +0900 ksmbd: replace PAYLOAD_HEAD with inline function Replace PAYLOAD_HEAD with inline function. Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c2220322b4577fc32ad3b7b4ddb856bd1f8c7461 Author: Hyunchul Lee Date: Fri Jun 25 07:02:08 2021 +0900 ksmbd: replace KSMBD_ALIGN with kernel ALIGN macro Replace KSMBD_ALIGN with kernel ALIGN macro Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8ad8dc34211742c816d45dd2ce62aa103a82f4c2 Author: Hyunchul Lee Date: Fri Jun 25 07:02:07 2021 +0900 ksmbd: replace BUFFER_NR_PAGES with inline function Replace BUFFER_NR_PAGES with inline function Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b622948789a96a8f347c8e77e18d100c7f1a78fa Author: Hyunchul Lee Date: Fri Jun 25 07:02:06 2021 +0900 ksmbd: remove macros in transport_ipc.c Remove macros in transport_ipc.c Reviewed-by: Christoph Hellwig Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 031e3bd8986fffe31e1ddbf5264cccfe30c9abd7 Author: Yuan ZhaoXiong Date: Sun Jun 6 21:11:55 2021 +0800 sched: Optimize housekeeping_cpumask() in for_each_cpu_and() On a 128 cores AMD machine, there are 8 cores in nohz_full mode, and the others are used for housekeeping. When many housekeeping cpus are in idle state, we can observe huge time burn in the loop for searching nearest busy housekeeper cpu by ftrace. 9) | get_nohz_timer_target() { 9) | housekeeping_test_cpu() { 9) 0.390 us | housekeeping_get_mask.part.1(); 9) 0.561 us | } 9) 0.090 us | __rcu_read_lock(); 9) 0.090 us | housekeeping_cpumask(); 9) 0.521 us | housekeeping_cpumask(); 9) 0.140 us | housekeeping_cpumask(); ... 9) 0.500 us | housekeeping_cpumask(); 9) | housekeeping_any_cpu() { 9) 0.090 us | housekeeping_get_mask.part.1(); 9) 0.100 us | sched_numa_find_closest(); 9) 0.491 us | } 9) 0.100 us | __rcu_read_unlock(); 9) + 76.163 us | } for_each_cpu_and() is a micro function, so in get_nohz_timer_target() function the for_each_cpu_and(i, sched_domain_span(sd), housekeeping_cpumask(HK_FLAG_TIMER)) equals to below: for (i = -1; i = cpumask_next_and(i, sched_domain_span(sd), housekeeping_cpumask(HK_FLAG_TIMER)), i < nr_cpu_ids;) That will cause that housekeeping_cpumask() will be invoked many times. The housekeeping_cpumask() function returns a const value, so it is unnecessary to invoke it every time. This patch can minimize the worst searching time from ~76us to ~16us in my testing. Similarly, the find_new_ilb() function has the same problem. Co-developed-by: Li RongQing Signed-off-by: Li RongQing Signed-off-by: Yuan ZhaoXiong Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1622985115-51007-1-git-send-email-yuanzhaoxiong@baidu.com commit 18765447c3b7867b3f8cccde52dc9d822852e71b Author: Hailong Liu Date: Sun Jun 6 19:54:51 2021 +0800 sched/sysctl: Move extern sysctl declarations to sched.h Since commit '8a99b6833c88(sched: Move SCHED_DEBUG sysctl to debugfs)', SCHED_DEBUG sysctls are moved to debugfs, so these extern sysctls in include/linux/sched/sysctl.h are no longer needed for sysctl.c, even some are no longer needed. So move those extern sysctls that needed by kernel/sched/debug.c to kernel/sched/sched.h, and remove others that are no longer needed. Signed-off-by: Hailong Liu Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210606115451.26745-1-liuhailongg6@163.com commit 77eccd0dfae353a64a2088d308bed3b373a4220f Author: Julian Wiedmann Date: Tue Jun 1 17:11:20 2021 +0200 wait: use LIST_HEAD_INIT() to initialize wait_queue_head Replace the open-coded initialization with the right macro. Signed-off-by: Julian Wiedmann Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210601151120.329223-1-jwi@linux.ibm.com commit 459b09b5a3254008b63382bf41a9b36d0b590f57 Author: Valentin Schneider Date: Tue May 18 14:07:25 2021 +0100 sched/debug: Don't update sched_domain debug directories before sched_debug_init() Since CPU capacity asymmetry can stem purely from maximum frequency differences (e.g. Pixel 1), a rebuild of the scheduler topology can be issued upon loading cpufreq, see: arch_topology.c::init_cpu_capacity_callback() Turns out that if this rebuild happens *before* sched_debug_init() is run (which is a late initcall), we end up messing up the sched_domain debug directory: passing a NULL parent to debugfs_create_dir() ends up creating the directory at the debugfs root, which in this case creates /sys/kernel/debug/domains (instead of /sys/kernel/debug/sched/domains). This currently doesn't happen on asymmetric systems which use cpufreq-scpi or cpufreq-dt drivers, as those are loaded via deferred_probe_initcall() (it is also a late initcall, but appears to be ordered *after* sched_debug_init()). Ionela has been working on detecting maximum frequency asymmetry via ACPI, and that actually happens via a *device* initcall, thus before sched_debug_init(), and causes the aforementionned debugfs mayhem. One option would be to punt sched_debug_init() down to fs_initcall_sync(). Preventing update_sched_domain_debugfs() from running before sched_debug_init() appears to be the safer option. Fixes: 3b87f136f8fc ("sched,debug: Convert sysctl sched_domains to debugfs") Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: http://lore.kernel.org/r/20210514095339.12979-1-ionela.voinescu@arm.com commit 3b5ac97ad468f6cfd31346821a3a2b9f13d23015 Author: Boris Brezillon Date: Thu Jun 24 16:08:50 2021 +0200 drm/sched: Declare entity idle only after HW submission The panfrost driver tries to kill in-flight jobs on FD close after destroying the FD scheduler entities. For this to work properly, we need to make sure the jobs popped from the scheduler entities have been queued at the HW level before declaring the entity idle, otherwise we might iterate over a list that doesn't contain those jobs. Suggested-by: Lucas Stach Signed-off-by: Boris Brezillon Cc: Lucas Stach Reviewed-by: Steven Price Reviewed-by: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20210624140850.2229697-1-boris.brezillon@collabora.com commit 6c5e36d13e2a338ed611d2bcc6c615dd0550b17d Author: Hyunchul Lee Date: Wed Jun 23 13:48:24 2021 +0900 ksmbd: set MAY_* flags together with open flags set MAY_* flags together with open flags and remove ksmbd_vfs_inode_permission(). Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 333111a6dc32a2768f581876bdb5ef4231f5084e Author: Hyunchul Lee Date: Wed Jun 23 11:07:43 2021 +0900 ksmbd: factor out a ksmbd_vfs_lock_parent helper Factor out a self-contained helper to get stable parent dentry. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 49be5aa47b69ad09b0045b662d61bad51e6309e7 Author: Namjae Jeon Date: Thu Jun 24 09:20:03 2021 +0900 MAINTAINERS: rename cifsd to ksmbd Rename cifsd to ksmbd and update Sergey's mail address. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1a93084b9a89818aec0ac7b59a5a51f2112bf203 Author: Namjae Jeon Date: Thu Jun 24 10:34:11 2021 +0900 ksmbd: move fs/cifsd to fs/ksmbd Move fs/cifsd to fs/ksmbd and rename the remaining cifsd name to ksmbd. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 131bac1ece2e16201674b2f29b64d2044c826b56 Author: Namjae Jeon Date: Tue Jun 22 16:20:47 2021 +0900 ksmbd: use f_bsize in FS_SECTOR_SIZE_INFORMATION Use f_bsize in FS_SECTOR_SIZE_INFORMATION to avoid the access the block layer. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 560ac05130696de2491881bbc2a5024c94bc3912 Author: Namjae Jeon Date: Tue Jun 22 16:16:45 2021 +0900 ksmbd: remove unneeded NULL check in the list iterator Remove unneeded NULL check in the list iterator. And use list_for_each_entry_safe instead of list_for_each_safe. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ee81cae1a6323fa4489313dfd9de436da7ff8519 Author: Namjae Jeon Date: Sat Jun 26 22:32:34 2021 +0900 ksmbd: use f_bsize instead of q->limits.logical_block_size Use f_bsize instead of q->limits.logical_block_size. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ee2033e9c64139c4f052bed52e72eba44a08b40a Author: Namjae Jeon Date: Tue Jun 22 13:26:24 2021 +0900 ksmbd: change stream type macro to enumeration Change stream type macro to enumeration and move it to vfs.h. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 67d1c432994cbf30f63ec35abba493b027f0c910 Author: Namjae Jeon Date: Tue Jun 22 11:42:29 2021 +0900 ksmbd: opencode posix acl functions instead of wrappers Add select FS_POSIX_ACL in Kconfig and then opencode posix acl functions instead of wrappers Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4b637fc18902600dfe722f9b1a45950bfc8bc7b5 Author: Namjae Jeon Date: Fri Jun 18 10:20:24 2021 +0900 ksmbd: factor out a ksmbd_validate_entry_in_use helper from __ksmbd_vfs_rename Factor out a self-contained helper to find sub file/dir in use. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e8c061917133dd77410239bfc0fae151b1955af2 Author: Namjae Jeon Date: Tue Jun 22 11:06:11 2021 +0900 ksmbd: opencode to avoid trivial wrappers Opencode to avoid trivial wrappers that just make the code hard to follow. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bde1694aecdb535970787b4f1d07ddb317e191e3 Author: Namjae Jeon Date: Mon Jun 28 15:23:19 2021 +0900 ksmbd: remove ksmbd_err/info Use the pr_fmt built into pr_*. and use pr_err/info after removing wrapper ksmbd_err/info. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0bc3a4eda1fb0edd8678c9405ab18d47327650cd Author: Lucas De Marchi Date: Tue Jun 22 14:22:10 2021 -0700 drm/i915/display: use max_level to control loop Since we are already loop through the levels to sanitize them, mark what is the real max_level so it can be used in subsequent loop. This makes it simpler to later add the adjustment latency to "valid levels". No change in behavior, just makes the code easier to follow. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210622212210.3746133-2-lucas.demarchi@intel.com commit cbeeb00f14d2bf71200cbfad329a62be6309f7e2 Author: Lucas De Marchi Date: Tue Jun 22 14:22:09 2021 -0700 drm/i915/display: fix level 0 adjustement on display ver >= 12 We should no longer increment level 0 by 1usec when we have 16Gb DIMMs. Instead spec says to add 3usec (as opposed to 2) to each valid level when punit replies 0 to level 0. So set wm_lv_0_adjust_needed to false for DISPLAY_VER() >= 12 and set the proper adjustment value when handling WaWmMemoryReadLatency. Bspec: 49326, 4381 Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210622212210.3746133-1-lucas.demarchi@intel.com commit 53fe9cf2dafe2b0382a4e682e4eebe0a442dcb5a Author: Tejas Upadhyay Date: Thu Jun 24 16:52:50 2021 +0530 drm/i915/selftest: Extend ctx_timestamp ICL workaround to GEN11 EHL and JSL are also observing requirement for 80ns interval for CTX_TIMESTAMP thus extending it to GEN11. Changes since V1: - IS_GEN replaced by GRAPHICS_VER - Tvrtko Acked-by: Tvrtko Ursulin Signed-off-by: Tejas Upadhyay Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20210624112250.895410-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit d3f3baa3562a5d09f3e87f5fdf84952112807753 Author: Thomas Hellström Date: Thu Jun 24 13:29:14 2021 +0200 drm/i915: Reinstate the mmap ioctl for some platforms Reinstate the mmap ioctl for all current integrated platforms. The intention was really to have it disabled for discrete graphics where we enforce a single mmap mode. This was reported to break ADL-P with the media stack, which was not the intention. Although longer term we do still plan to sunset this ioctl even for integrated, in favour of using mmap_offset instead. Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+") Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Acked-by: Daniel Vetter Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210624112914.311984-1-thomas.hellstrom@linux.intel.com commit c4449742a7c2c4f565cef5604738cfcb29769db9 Author: José Roberto de Souza Date: Wed Jun 16 13:31:57 2021 -0700 drm/i915/display/adl_p: Implement Wa_16011303918 PSR2 is not compatible with DC3CO or VRR in this stepping, so not enabling PSR2 if VRR will be enabled or not enabling DC3CO if PSR2 is possible. BSpec: 54369 Cc: Gwan-gyeong Mun Cc: Matt Atwood Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210616203158.118111-5-jose.souza@intel.com commit 61e887329e337694f3c8ac726c9e9c08e5569e5d Author: José Roberto de Souza Date: Wed Jun 16 13:31:56 2021 -0700 drm/i915/xelpd: Handle PSR2 SDP indication in the prior scanline In some modes there is not enough time during hblank to transmit PSR2 SDP plus the pixels CRC SDP, if such case happens PSR2 needs to be disabled. But eDP spec 1.4b allows to transmit PSR2 SDP in a prior scanline alone and than later the CRC SDP, allowing PSR2 to be enabled in those hblank constrained modes. BSpec: 49274 Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210616203158.118111-4-jose.souza@intel.com commit 1d53ccdc400c872265489708de6b2342e8698d1e Author: José Roberto de Souza Date: Wed Jun 16 13:31:55 2021 -0700 drm/i915/display/adl_p: Implement Wa_16011168373 Another WA that is required for PSR2. BSpec: 54369 Cc: Gwan-gyeong Mun Cc: Matt Atwood Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210616203158.118111-3-jose.souza@intel.com commit 061093d75ae36ba0156eb3b3b1f9cc2e35e9351d Author: José Roberto de Souza Date: Wed Jun 16 13:31:54 2021 -0700 drm/i915/display/adl_p: Implement Wa_22012278275 The PSR2_CTL io buffer wake and fast wake values do not match expected in pre production hardware, so here adding a table that matches with HW to program it with values that HW expect. Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210616203158.118111-2-jose.souza@intel.com commit 0e20b769c4b3347b68c7c388ce5b758dcc7d141a Author: José Roberto de Souza Date: Wed Jun 16 13:31:53 2021 -0700 drm/i915/display/psr: Handle SU Y granularity We were only handling X and width granularity, what was causing issues when sink had a granularity different than 4. While at it, renaming su_x_granularity to su_w_granularity to better match reality. Cc: Gwan-gyeong Mun Signed-off-by: José Roberto de Souza Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20210616203158.118111-1-jose.souza@intel.com commit f15f01a79949854a4a5ebd1e86e4877ee3c47c1a Author: Ville Syrjälä Date: Wed Jun 9 11:56:32 2021 +0300 drm/i915: s/intel_crtc/crtc/ Clear out the straggler 'intel_crtc' variables. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-7-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 08dfd243abac19c46ee2a926ccfa56feac73f03f Author: Ville Syrjälä Date: Wed Jun 9 11:56:31 2021 +0300 drm/i915: Clean up intel_fbdev_init_bios() a bit Sort out the mess with the local variables in intel_fbdev_init_bios(). Get rid of all aliasing pointers, use standard naming/types, and introduce a few more locals in the loops to avoid the hard to read long struct walks. While at we also polish the debugs a bit to use the canonical [CRTC:%d:%s] style. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-6-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 670c89eb6d1d468f93e5791762c66a5360d89cd8 Author: Ville Syrjälä Date: Wed Jun 9 11:56:30 2021 +0300 drm/i915: Clean up pre-skl wm calling convention Just pass the full atomic state+crtc to the pre-skl watermark functions, and clean up the types/variable names around the area. Note that having both .compute_pipe_wm() and .compute_intermediate_wm() is entirely redundant now. We could unify them to a single vfunc. But let's do this one step at a time. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-5-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 7397bd54da67a6a534eaa37575d332d623772791 Author: Ville Syrjälä Date: Wed Jun 9 11:56:29 2021 +0300 drm/i915: Clean up intel_find_initial_plane_obj() a bit Sort out the mess with the local variables in intel_find_initial_plane_obj(). Get rid of all aliasing pointers and use standard naming/types. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-4-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit e969c2da0e5b40d15b45ba7fdb819d36a699cd05 Author: Ville Syrjälä Date: Wed Jun 9 11:56:28 2021 +0300 drm/i915: Clean up intel_get_load_detect_pipe() a bit Sort out the mess with the local variables in intel_get_load_detect_pipe(). Get rid of all aliasing pointers and use standard naming/types. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit f07d7400ecf56650f6a70313d10392cccb6e62a3 Author: Ville Syrjälä Date: Wed Jun 9 11:56:27 2021 +0300 drm/i915: Stop hand rolling drm_crtc_mask() Use drm_crtc_mask() instead of hand rolling it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-2-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 46b2c40e0af3cdcba7ad7bf89ca1410d519a83c6 Author: Ville Syrjälä Date: Thu Jun 10 21:32:37 2021 +0300 drm/i915/fbc: Allocate llb before cfb Since the llb allocation has a fixed size, let's grab it before the potentially variable sized cfb. That should avoid some allocation failure cases once we allow different compression ratios for FBC1. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-10-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 8538d78e26ecaf2c9f0d43526207c643972c2cc1 Author: Ville Syrjälä Date: Thu Jun 10 21:32:36 2021 +0300 drm/i915/fbc: Make the cfb allocation loop a bit more legible Write the cfb allocation loop as an actual loop instead of some hard to read goto thing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-9-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit c48f67ee91ad44466a1e63a089ac4835f3f2db4f Author: Ville Syrjälä Date: Thu Jun 10 21:32:35 2021 +0300 drm/i915/fbc: Extract intel_fbc_stolen_end() Declutter find_compression_limit() a bit by extracting intel_fbc_stolen_end(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-8-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 9c8a442d9d37600f3b2d528980da8719bc7fa5ec Author: Ville Syrjälä Date: Thu Jun 10 21:32:34 2021 +0300 drm/i915/fbc: Introduce g4x_dpfc_ctl_limit() Exctract the limit->register value conversion into a common helper. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-7-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit d502f6c4389f27fd316c417cfc58d69bf2831839 Author: Ville Syrjälä Date: Thu Jun 10 21:32:33 2021 +0300 drm/i915/fbc: Handle 16bpp compression limit better The limit++ for the 16bpp case is nonsense since the compression limit is always supposed to be power of two. Replace it with <<=1. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-6-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 337e54f77cee46c5d0de43370fb6bb38c0794890 Author: Ville Syrjälä Date: Thu Jun 10 21:32:32 2021 +0300 drm/i915/fbc: Don't pass around the mm node No point in passing the mm node explicitly to find_compression_limit() since it's always the same node for the cfb. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-5-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 45a321a7ee0ad9fb3f80ccdb4ef320309efbbc93 Author: Ville Syrjälä Date: Thu Jun 10 21:32:31 2021 +0300 drm/i915/fbc: Embed the compressed_llb node Not much point in dynamically allocating the line length buffer mm node that I can see. Just embed it directly like we do the for the cfb node. One less failure point to worry about. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-4-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 5826d9f2115c7cf7e0f7be4743d2d2665d0af625 Author: Ville Syrjälä Date: Thu Jun 10 21:32:30 2021 +0300 drm/i915/fbc: Extract intel_fbc_program_cfb() Extract the CFB (+LLB) programming into a separate function. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-3-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 0ba1d03cd878313af5ad601d44450db076049959 Author: Ville Syrjälä Date: Thu Jun 10 21:32:29 2021 +0300 drm/i915/fbc: s/threshold/limit/ Let's call the compression limit the limit. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 51565971cdbf220dfe1f7d26b4c14781c86e65b4 Author: Ville Syrjälä Date: Tue Jun 8 10:36:03 2021 +0300 drm/i915: Add the missing adls vswing tables adls is supposed to use special buf trans tables. Add what's missing. v2: Drop the RBR/HBR table since it's the same as for tgl Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-18-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 150712dfd71882396673dfc5304b11949276dba3 Author: Ville Syrjälä Date: Tue Jun 8 10:36:02 2021 +0300 drm/i915: Nuke buf_trans hdmi functions All the foo_get_buf_trans_hdmi() functions just return a single table. Remove the pointless wrappers. v2: Handle adl-p Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-17-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 2b3bc165d0554f29263fef7c4a09debb6308f4b8 Author: Ville Syrjälä Date: Tue Jun 8 10:36:01 2021 +0300 drm/i915: Clean up jsl/ehl buf trans functions The jsl/ehl buf trans functions are needlessly complicated. Simplify them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-16-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 019d8146aa26d8239b4aac008f9717c44fcbe118 Author: Ville Syrjälä Date: Tue Jun 8 10:36:00 2021 +0300 drm/i915: Fix ehl edp hbr2 vswing table EHL is supposed to use special buf trans values for eDP HBR2+. Add such a table. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-15-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 32b7cf51a441270c62ebaa146c9431e6f155d901 Author: Thomas Hellström Date: Thu Jun 24 10:42:40 2021 +0200 drm/i915/ttm: Use TTM for system memory For discrete, use TTM for both cached and WC system memory. That means we currently rely on the TTM memory accounting / shrinker. For cached system memory we should consider remaining shmem-backed, which can be implemented from our ttm_tt_populate callback. We can then also reuse our own very elaborate shrinker for that memory. If an object is evicted to a gem allowable region, we will now consider the object migrated, and we flip the gem region and move the object to a different region list. Since we are now changing gem regions, we can't any longer rely on the CONTIGUOUS flag being set based on the region min page size, so remove that flag update. If we want to reintroduce it, we need to put it in the mutable flags. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210624084240.270219-4-thomas.hellstrom@linux.intel.com commit 3c2b8f326e7f73dd10ae422dc65603a858f6c6b4 Author: Thomas Hellström Date: Thu Jun 24 10:42:39 2021 +0200 drm/i915/ttm: Adjust gem flags and caching settings after a move After a TTM move or object init we need to update the i915 gem flags and caching settings to reflect the new placement. Currently caching settings are not changed during the lifetime of an object, although that might change moving forward if we run into performance issues or issues with WC system page allocations. Also introduce gpu_binds_iomem() and cpu_maps_iomem() to clean up the various ways we previously used to detect this. Finally, initialize the TTM object reserved to be able to update flags and caching before anyone else gets hold of the object. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210624084240.270219-3-thomas.hellstrom@linux.intel.com commit 0ff375759f64a0b81853d9d9b4c5b5b4b06f4a2c Author: Thomas Hellström Date: Thu Jun 24 10:42:38 2021 +0200 drm/i915: Update object placement flags to be mutable The object ops i915_GEM_OBJECT_HAS_IOMEM and the object I915_BO_ALLOC_STRUCT_PAGE flags are considered immutable by much of our code. Introduce a new mem_flags member to hold these and make sure checks for these flags being set are either done under the object lock or with pages properly pinned. The flags will change during migration under the object lock. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210624084240.270219-2-thomas.hellstrom@linux.intel.com commit 7150185900a7cd74373110c487f467b89a008325 Author: Daniel Vetter Date: Tue Jun 22 18:55:09 2021 +0200 drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default Goes through all the drivers and deletes the default hook since it's the default now. Acked-by: David Lechner Acked-by: Noralf Trønnes Acked-by: Oleksandr Andrushchenko Acked-by: Linus Walleij Signed-off-by: Daniel Vetter Cc: Joel Stanley Cc: Andrew Jeffery Cc: "Noralf Trønnes" Cc: Linus Walleij Cc: Emma Anholt Cc: David Lechner Cc: Kamlesh Gurudasani Cc: Oleksandr Andrushchenko Cc: Daniel Vetter Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Sam Ravnborg Cc: Alex Deucher Cc: Andy Shevchenko Cc: linux-aspeed@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: xen-devel@lists.xenproject.org Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-14-daniel.vetter@ffwll.ch commit 40cfc7fce4d00f7c2152b28a1f6e7fcbb1a47ca6 Author: Daniel Vetter Date: Wed Jun 23 18:24:56 2021 +0200 drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default It's tedious to review this all the time, and my audit showed that arcpgu actually forgot to set this. Make this the default and stop worrying. Again I sprinkled WARN_ON_ONCE on top to make sure we don't have strange combinations of hooks: cleanup_fb without prepare_fb doesn't make sense, and since simpler drivers are all new they better be GEM based drivers. v2: Warn and bail when it's _not_ a GEM driver (Noralf) v3: It's neither ... nor, not not (Sam) Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Noralf Trønnes Acked-by: Noralf Trønnes Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210623162456.3373469-1-daniel.vetter@ffwll.ch commit 942d8344d5f14b9ea2ae43756f319b9f44216ba4 Author: Daniel Vetter Date: Tue Jun 22 18:55:07 2021 +0200 drm/omap: Follow implicit fencing in prepare_fb I guess no one ever tried running omap together with lima or panfrost, not even sure that's possible. Anyway for consistency, fix this. Reviewed-by: Tomi Valkeinen Signed-off-by: Daniel Vetter Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-12-daniel.vetter@ffwll.ch commit f8bd3dbb9eb0f7b5d5e5dc960a555c0439ba5b76 Author: Daniel Vetter Date: Tue Jun 22 18:55:06 2021 +0200 drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS Like we have for the shadow helpers too, and roll it out to drivers. Acked-by: Thomas Zimmermann Acked-by: Tian Tao Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Thomas Zimmermann Cc: Hans de Goede Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: Tian Tao Cc: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-11-daniel.vetter@ffwll.ch commit 1a8961307af6791cd7db3ecddf7841750ab84ea2 Author: Daniel Vetter Date: Tue Jun 22 18:55:05 2021 +0200 drm/armada: Remove prepare/cleanup_fb hooks All they do is refcount the fb, which the atomic helpers already do. This is was necessary with the legacy helpers and I guess just carry over in the conversion. drm_plane_state always has a full reference for its ->fb pointer during its entire lifetime, see __drm_atomic_helper_plane_destroy_state() Acked-by: Maxime Ripard Signed-off-by: Daniel Vetter Cc: Russell King Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-10-daniel.vetter@ffwll.ch commit 29a840842743d3ac20a3ac93d4f32fa9db503b9f Author: Daniel Vetter Date: Tue Jun 22 18:55:04 2021 +0200 drm/: drm_gem_plane_helper_prepare_fb is now the default No need to set it explicitly. Acked-by: Philipp Zabel Acked-by: Heiko Stuebner Acked-by: Paul Cercueil Acked-by: Jernej Skrabec Acked-by: Chun-Kuang Hu Acked-by: Martin Blumenstingl Acked-by: Tomi Valkeinen Acked-by: Philippe Cornu Acked-by: Lucas Stach Signed-off-by: Daniel Vetter Cc: Laurentiu Palcu Cc: Lucas Stach Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Philipp Zabel Cc: Paul Cercueil Cc: Chun-Kuang Hu Cc: Matthias Brugger Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Marek Vasut Cc: Stefan Agner Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Yannick Fertre Cc: Philippe Cornu Cc: Benjamin Gaignard Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Jyri Sarha Cc: Tomi Valkeinen Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-sunxi@lists.linux.dev Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-9-daniel.vetter@ffwll.ch commit 7d30963fd191b7f2ea158e1abca8f05b41cc30d8 Author: Daniel Vetter Date: Wed Jun 23 18:22:00 2021 +0200 drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default There's a bunch of atomic drivers who don't do this quite correctly, luckily most of them aren't in wide use or people would have noticed the tearing. By making this the default we avoid the constant audit pain and can additionally remove a ton of lines from vfuncs for a bit more clarity in smaller drivers. While at it complain if there's a cleanup_fb hook but no prepare_fb hook, because that makes no sense. I haven't found any driver which violates this, but better safe than sorry. Subsequent patches will reap the benefits. v2: It's neither ... nor, not not (Sam) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210623162200.3372056-1-daniel.vetter@ffwll.ch commit 05459351ce307f6ba0e0221968b1e15b97d3b075 Author: Daniel Vetter Date: Thu Jun 24 14:52:46 2021 +0200 dma-buf: Document dma-buf implicit fencing/resv fencing rules Docs for struct dma_resv are fairly clear: "A reservation object can have attached one exclusive fence (normally associated with write operations) or N shared fences (read operations)." https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html#reservation-objects Furthermore a review across all of upstream. First of render drivers and how they set implicit fences: - nouveau follows this contract, see in validate_fini_no_ticket() nouveau_bo_fence(nvbo, fence, !!b->write_domains); and that last boolean controls whether the exclusive or shared fence slot is used. - radeon follows this contract by setting p->relocs[i].tv.num_shared = !r->write_domain; in radeon_cs_parser_relocs(), which ensures that the call to ttm_eu_fence_buffer_objects() in radeon_cs_parser_fini() will do the right thing. - vmwgfx seems to follow this contract with the shotgun approach of always setting ttm_val_buf->num_shared = 0, which means ttm_eu_fence_buffer_objects() will only use the exclusive slot. - etnaviv follows this contract, as can be trivially seen by looking at submit_attach_object_fences() - i915 is a bit a convoluted maze with multiple paths leading to i915_vma_move_to_active(). Which sets the exclusive flag if EXEC_OBJECT_WRITE is set. This can either come as a buffer flag for softpin mode, or through the write_domain when using relocations. It follows this contract. - lima follows this contract, see lima_gem_submit() which sets the exclusive fence when the LIMA_SUBMIT_BO_WRITE flag is set for that bo - msm follows this contract, see msm_gpu_submit() which sets the exclusive flag when the MSM_SUBMIT_BO_WRITE is set for that buffer - panfrost follows this contract with the shotgun approach of just always setting the exclusive fence, see panfrost_attach_object_fences(). Benefits of a single engine I guess - v3d follows this contract with the same shotgun approach in v3d_attach_fences_and_unlock_reservation(), but it has at least an XXX comment that maybe this should be improved - v4c uses the same shotgun approach of always setting an exclusive fence, see vc4_update_bo_seqnos() - vgem also follows this contract, see vgem_fence_attach_ioctl() and the VGEM_FENCE_WRITE. This is used in some igts to validate prime sharing with i915.ko without the need of a 2nd gpu - vritio follows this contract again with the shotgun approach of always setting an exclusive fence, see virtio_gpu_array_add_fence() This covers the setting of the exclusive fences when writing. Synchronizing against the exclusive fence is a lot more tricky, and I only spot checked a few: - i915 does it, with the optional EXEC_OBJECT_ASYNC to skip all implicit dependencies (which is used by vulkan) - etnaviv does this. Implicit dependencies are collected in submit_fence_sync(), again with an opt-out flag ETNA_SUBMIT_NO_IMPLICIT. These are then picked up in etnaviv_sched_dependency which is the drm_sched_backend_ops->dependency callback. - v4c seems to not do much here, maybe gets away with it by not having a scheduler and only a single engine. Since all newer broadcom chips than the OG vc4 use v3d for rendering, which follows this contract, the impact of this issue is fairly small. - v3d does this using the drm_gem_fence_array_add_implicit() helper, which then it's drm_sched_backend_ops->dependency callback v3d_job_dependency() picks up. - panfrost is nice here and tracks the implicit fences in panfrost_job->implicit_fences, which again the drm_sched_backend_ops->dependency callback panfrost_job_dependency() picks up. It is mildly questionable though since it only picks up exclusive fences in panfrost_acquire_object_fences(), but not buggy in practice because it also always sets the exclusive fence. It should pick up both sets of fences, just in case there's ever going to be a 2nd gpu in a SoC with a mali gpu. Or maybe a mali SoC with a pcie port and a real gpu, which might actually happen eventually. A bug, but easy to fix. Should probably use the drm_gem_fence_array_add_implicit() helper. - lima is nice an easy, uses drm_gem_fence_array_add_implicit() and the same schema as v3d. - msm is mildly entertaining. It also supports MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronous dma_fence_wait. See submit_fence_sync() leading to msm_gem_sync_object(). Investing into a scheduler might be a good idea. - all the remaining drivers are ttm based, where I hope they do appropriately obey implicit fences already. I didn't do the full audit there because a) not follow the contract would confuse ttm quite well and b) reading non-standard scheduler and submit code which isn't based on drm/scheduler is a pain. Onwards to the display side. - Any driver using the drm_gem_plane_helper_prepare_fb() helper will correctly. Overwhelmingly most drivers get this right, except a few totally dont. I'll follow up with a patch to make this the default and avoid a bunch of bugs. - I didn't audit the ttm drivers, but given that dma_resv started there I hope they get this right. In conclusion this IS the contract, both as documented and overwhelmingly implemented, specically as implemented by all render drivers except amdgpu. Amdgpu tried to fix this already in commit 049aca4363d8af87cab8d53de5401602db3b9999 Author: Christian König Date: Wed Sep 19 16:54:35 2018 +0200 drm/amdgpu: fix using shared fence for exported BOs v2 but this fix falls short on a number of areas: - It's racy, by the time the buffer is shared it might be too late. To make sure there's definitely never a problem we need to set the fences correctly for any buffer that's potentially exportable. - It's breaking uapi, dma-buf fds support poll() and differentitiate between, which was introduced in commit 9b495a5887994a6d74d5c261d012083a92b94738 Author: Maarten Lankhorst Date: Tue Jul 1 12:57:43 2014 +0200 dma-buf: add poll support, v3 - Christian König wants to nack new uapi building further on this dma_resv contract because it breaks amdgpu, quoting "Yeah, and that is exactly the reason why I will NAK this uAPI change. "This doesn't works for amdgpu at all for the reasons outlined above." https://lore.kernel.org/dri-devel/f2eb6751-2f82-9b23-f57e-548de5b729de@gmail.com/ Rejecting new development because your own driver is broken and violates established cross driver contracts and uapi is really not how upstream works. Now this patch will have a severe performance impact on anything that runs on multiple engines. So we can't just merge it outright, but need a bit a plan: - amdgpu needs a proper uapi for handling implicit fencing. The funny thing is that to do it correctly, implicit fencing must be treated as a very strange IPC mechanism for transporting fences, where both setting the fence and dependency intercepts must be handled explicitly. Current best practices is a per-bo flag to indicate writes, and a per-bo flag to to skip implicit fencing in the CS ioctl as a new chunk. - Since amdgpu has been shipping with broken behaviour we need an opt-out flag from the butchered implicit fencing model to enable the proper explicit implicit fencing model. - for kernel memory fences due to bo moves at least the i915 idea is to use ttm_bo->moving. amdgpu probably needs the same. - since the current p2p dma-buf interface assumes the kernel memory fence is in the exclusive dma_resv fence slot we need to add a new fence slot for kernel fences, which must never be ignored. Since currently only amdgpu supports this there's no real problem here yet, until amdgpu gains a NO_IMPLICIT CS flag. - New userspace needs to ship in enough desktop distros so that users wont notice the perf impact. I think we can ignore LTS distros who upgrade their kernels but not their mesa3d snapshot. - Then when this is all in place we can merge this patch here. What is not a solution to this problem here is trying to make the dma_resv rules in the kernel more clever. The fundamental issue here is that the amdgpu CS uapi is the least expressive one across all drivers (only equalled by panfrost, which has an actual excuse) by not allowing any userspace control over how implicit sync is conducted. Until this is fixed it's completely pointless to make the kernel more clever to improve amdgpu, because all we're doing is papering over this uapi design issue. amdgpu needs to attain the status quo established by other drivers first, once that's achieved we can tackle the remaining issues in a consistent way across drivers. v2: Bas pointed me at AMDGPU_GEM_CREATE_EXPLICIT_SYNC, which I entirely missed. This is great because it means the amdgpu specific piece for proper implicit fence handling exists already, and that since a while. The only thing that's now missing is - fishing the implicit fences out of a shared object at the right time - setting the exclusive implicit fence slot at the right time. Jason has a patch series to fill that gap with a bunch of generic ioctl on the dma-buf fd: https://lore.kernel.org/dri-devel/20210520190007.534046-1-jason@jlekstrand.net/ v3: Since Christian has fixed amdgpu now in commit 8c505bdc9c8b955223b054e34a0be9c3d841cd20 (drm-misc/drm-misc-next) Author: Christian König Date: Wed Jun 9 13:51:36 2021 +0200 drm/amdgpu: rework dma_resv handling v3 Use the audit covered in this commit message as the excuse to update the dma-buf docs around dma_buf.resv usage across drivers. Since dynamic importers have different rules also hammer these in again while we're at it. v4: - Add the missing "through the device" in the dynamic section that I overlooked. - Fix a kerneldoc markup mistake, the link didn't connect v5: - A few s/should/must/ to make clear what must be done (if the driver does implicit sync) and what's more a maybe (Daniel Stone) - drop all the example api discussion, that needs to be expanded, clarified and put into a new chapter in drm-uapi.rst (Daniel Stone) Cc: Daniel Stone Acked-by: Daniel Stone Reviewed-by: Dave Airlie (v4) Reviewed-by: Christian König (v3) Cc: mesa-dev@lists.freedesktop.org Cc: Bas Nieuwenhuizen Cc: Dave Airlie Cc: Rob Clark Cc: Kristian H. Kristensen Cc: Michel Dänzer Cc: Daniel Stone Cc: Sumit Semwal Cc: "Christian König" Cc: Alex Deucher Cc: Daniel Vetter Cc: Deepak R Varma Cc: Chen Li Cc: Kevin Wang Cc: Dennis Li Cc: Luben Tuikov Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210624125246.166721-1-daniel.vetter@ffwll.ch commit d6abed2ad168dbc3f9aac986b3b89ba6d3535e01 Author: Daniel Vetter Date: Wed Jun 23 18:17:12 2021 +0200 dma-buf: Switch to inline kerneldoc Also review & update everything while we're at it. This is prep work to smash a ton of stuff into the kerneldoc for @resv. v2: Move the doc for sysfs_entry.attachment_uid to the right place too (Sam) Reviewed-by: Sam Ravnborg Acked-by: Christian König Cc: Sam Ravnborg Reviewed-by: Alex Deucher Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: "Christian König" Cc: Alex Deucher Cc: Daniel Vetter Cc: Dave Airlie Cc: Nirmoy Das Cc: Deepak R Varma Cc: Chen Li Cc: Kevin Wang Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20210623161712.3370885-1-daniel.vetter@ffwll.ch commit d7fdae59910990fb427f3df7898b423bab78f92a Author: Daniel Vetter Date: Tue Jun 22 18:55:10 2021 +0200 drm/gem: Tiny kernel clarification for drm_gem_fence_array_add Spotted while trying to convert panfrost to these. Reviewed-by: Christian König Signed-off-by: Daniel Vetter Cc: "Christian König" Cc: Lucas Stach Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-15-daniel.vetter@ffwll.ch commit 379d34264687db0b4bb404f9b3e6d5ea6e92ebaf Author: Laurent Pinchart Date: Thu Jun 24 03:03:04 2021 +0300 drm/bridge: ti-sn65dsi86: Split connector creation to a function To prepare for making connector creation option, move connector creation out of ti_sn_bridge_attach to a separate function. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-7-laurent.pinchart+renesas@ideasonboard.com commit 77674e722f4b2764bbd3b5498472e4c3a818e4ce Author: Laurent Pinchart Date: Thu Jun 24 03:03:03 2021 +0300 drm/bridge: ti-sn65dsi86: Group code in sections Reorganize the functions in sections, related to connector operations, bridge operations, AUX adapter, GPIO controller and probe & remove. This prepares for proper support of DRM_BRIDGE_ATTACH_NO_CONNECTOR that will add more functions, to ensure that the code will stay readable. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-6-laurent.pinchart+renesas@ideasonboard.com commit 4e5763f03e105fedfcd7a83bec1dccae96e334dd Author: Laurent Pinchart Date: Thu Jun 24 03:03:02 2021 +0300 drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge To simplify interfacing with the panel, wrap it in a panel-bridge and let the DRM bridge helpers handle chaining of operations. This also prepares for support of DRM_BRIDGE_ATTACH_NO_CONNECTOR, which requires all components in the display pipeline to be represented by bridges. Signed-off-by: Laurent Pinchart Reviewed-by: Jagan Teki Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-5-laurent.pinchart+renesas@ideasonboard.com commit d4d643f9ef4fff822935e4251bf9f17ce4221bd8 Author: Laurent Pinchart Date: Thu Jun 24 03:03:01 2021 +0300 drm/bridge: ti-sn65dsi86: Use bitmask to store valid rates The valid rates are stored in an array of 8 booleans. Replace it with a bitmask to save space. Signed-off-by: Laurent Pinchart Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-4-laurent.pinchart+renesas@ideasonboard.com commit bbda1704fc1513383db2fa9c35b8463bf1afe8bc Author: Laurent Pinchart Date: Thu Jun 24 03:03:00 2021 +0300 drm/bridge: ti-sn65dsi86: Make enable GPIO optional The enable signal may not be controllable by the kernel. Make it optional. Signed-off-by: Laurent Pinchart Reviewed-by: Jagan Teki Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-3-laurent.pinchart+renesas@ideasonboard.com commit 0715786771f24190b3f2dcdcaf2af263c1ef46eb Author: Laurent Pinchart Date: Thu Jun 24 03:02:59 2021 +0300 dt-bindings: drm/bridge: ti-sn65dsi8: Make enable GPIO optional The SN65DSI86 EN pin can be hardwired to a high level, or connected to a global reset signal, not controllable by the kernel. Make it optional in those cases. Signed-off-by: Laurent Pinchart Reviewed-by: Jagan Teki Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-2-laurent.pinchart+renesas@ideasonboard.com commit 4bc2d5747eb00320eb3bcdf4cf603504e638c22f Author: Matthew Auld Date: Wed Jun 23 15:34:11 2021 +0100 drm/i915/ttm: fix static warning warning: symbol 'i915_gem_ttm_obj_ops' was not declared. Should it be static? Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210623143411.293630-1-matthew.auld@intel.com commit cdad39216afd08efece616c419fde2e7826b11af Author: Lee Shawn C Date: Thu Jun 24 13:39:32 2021 +0800 drm/i915: keep backlight_enable on until turn eDP display off This workaround is specific for a particular panel on Google chromebook project. When user space daemon enter idle state. It request adjust brightness to 0, turn backlight_enable signal off and keep eDP main link active. On general LCD, this behavior might not be a problem. But on this panel, its tcon would expect source to execute full eDP power off sequence after drop backlight_enable signal. Without eDP power off sequence. Even source try to turn backlight_enable signal on and restore proper brightness level. This panel is not able to light on again. This WA ignored the request from user space daemon to disable backlight_enable signal and keep it on always. When user space request kernel to turn eDP display off, kernel driver still can control backlight_enable signal properly. It would not impact standard eDP power off sequence. v2: 1. modify the quirk name and debug messages. 2. unregister backlight.power callback for specific device. v3: 1. modify debug output messages. 2. use DMI_EXACT_MATCH instead of DMI_MATCH. Cc: Ville Syrjala Cc: Imre Deak Cc: Jani Nikula Cc: Cooper Chiou Signed-off-by: Lee Shawn C Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210624053932.21037-1-shawn.c.lee@intel.com commit 7fdc48cc63a30fa3480d18bdd8c5fff2b9b15212 Author: Boris Brezillon Date: Mon Jun 21 15:38:56 2021 +0200 drm/panfrost: Make sure MMU context lifetime is not bound to panfrost_priv Jobs can be in-flight when the file descriptor is closed (either because the process did not terminate properly, or because it didn't wait for all GPU jobs to be finished), and apparently panfrost_job_close() does not cancel already running jobs. Let's refcount the MMU context object so it's lifetime is no longer bound to the FD lifetime and running jobs can finish properly without generating spurious page faults. Reported-by: Icecream95 Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210621133907.1683899-2-boris.brezillon@collabora.com commit 7601d53c2c49e3a7e8150e8cf332b3c17943f75a Author: Daniel Vetter Date: Tue Jun 22 18:55:02 2021 +0200 drm/panfrost: Fix implicit sync Currently this has no practial relevance I think because there's not many who can pull off a setup with panfrost and another gpu in the same system. But the rules are that if you're setting an exclusive fence, indicating a gpu write access in the implicit fencing system, then you need to wait for all fences, not just the previous exclusive fence. panfrost against itself has no problem, because it always sets the exclusive fence (but that's probably something that will need to be fixed for vulkan and/or multi-engine gpus, or you'll suffer badly). Also no problem with that against display. With the prep work done to switch over to the dependency helpers this is now a oneliner. Reviewed-by: Boris Brezillon Signed-off-by: Daniel Vetter Cc: Rob Herring Cc: Tomeu Vizoso Cc: Steven Price Cc: Alyssa Rosenzweig 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/20210622165511.3169559-7-daniel.vetter@ffwll.ch commit 7d7a0fc4a5cef5ce0eefbe16325ae419a6eb3d39 Author: Daniel Vetter Date: Tue Jun 22 18:55:01 2021 +0200 drm/panfrost: Use xarray and helpers for depedency tracking More consistency and prep work for the next patch. Aside: I wonder whether we shouldn't just move this entire xarray business into the scheduler so that not everyone has to reinvent the same wheels. Cc'ing some scheduler people for this too. v2: Correctly handle sched_lock since Lucas pointed out it's needed. v3: Rebase, dma_resv_get_excl_unlocked got renamed v4: Don't leak job references on failure (Steven). Reviewed-by: Boris Brezillon Cc: Lucas Stach Cc: "Christian König" Cc: Luben Tuikov Cc: Alex Deucher Cc: Lee Jones Cc: Steven Price Cc: Rob Herring Cc: Tomeu Vizoso Cc: Alyssa Rosenzweig Cc: Sumit Semwal Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-6-daniel.vetter@ffwll.ch commit 94dd80feb6582a7133ee337911e08aac573c04da Author: Daniel Vetter Date: Tue Jun 22 18:55:00 2021 +0200 drm/panfrost: Shrink sched_lock drm/scheduler requires a lock between _init and _push_job, but the reservation lock dance doesn't. So shrink the critical section a notch. v2: Lucas pointed out how this should really work, I got it all wrong in v1. Reviewed-by: Boris Brezillon Signed-off-by: Daniel Vetter Cc: Lucas Stach Cc: Rob Herring Cc: Tomeu Vizoso Cc: Steven Price Cc: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-5-daniel.vetter@ffwll.ch commit 2254e49cef7015d7697bd1617d19e620e2788ec5 Author: Daniel Vetter Date: Tue Jun 22 18:54:57 2021 +0200 dma-resv: Fix kerneldoc Oversight from commit 6edbd6abb783d54f6ac4c3ed5cd9e50cff6c15e9 Author: Christian König Date: Mon May 10 16:14:09 2021 +0200 dma-buf: rename and cleanup dma_resv_get_excl v3 Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: 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/20210622165511.3169559-2-daniel.vetter@ffwll.ch commit ea7acd7c5967542353430947f3faf699e70602e5 Author: Andrey Grodzovsky Date: Tue Jun 22 12:23:38 2021 -0400 drm/amdgpu: Fix BUG_ON assert With added CPU domain to placement you can have now 3 placemnts at once. CC: stable@kernel.org Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-5-andrey.grodzovsky@amd.com commit 2b70af79fd2283a356b34e6955f8a130298840bc Author: Lang Yu Date: Tue Jun 22 12:23:37 2021 -0400 drm/amdgpu: switch gtt_mgr to counting used pages Change mgr->available into mgr->used (invert the value). Makes more sense to do it this way since we don't need the spinlock any more to double check the handling. v3 (chk): separated from the TEMPOARAY FLAG change. Signed-off-by: Lang Yu Signed-off-by: Christian König Signed-off-by: Andrey Grodzovsky Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-4-andrey.grodzovsky@amd.com commit 9a22149e9561e71583a48cc8d6d325958243d3ca Author: Christian König Date: Tue Jun 22 12:23:36 2021 -0400 ydrm/amdgpu: always allow evicting to SYSTEM domain When we run out of GTT we should still be able to evict VRAM->SYSTEM with a bounce bufferdrm/amdgpu: always allow evicting to SYSTEM domain Signed-off-by: Christian König Signed-off-by: Andrey Grodzovsky Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-3-andrey.grodzovsky@amd.com commit 3e640f1bb893610378858c2e47c99dc019dfc9e9 Author: Lang Yu Date: Tue Jun 22 12:23:35 2021 -0400 drm/amdgpu: user temporary GTT as bounce buffer Currently, we have a limitted GTT memory size and need a bounce buffer when doing buffer migration between VRAM and SYSTEM domain. The problem is under GTT memory pressure we can't do buffer migration between VRAM and SYSTEM domain. But in some cases we really need that. Eespecially when validating a VRAM backing store BO which resides in SYSTEM domain. v2: still account temporary GTT allocations v3 (chk): revert to the simpler change for now Signed-off-by: Lang Yu Signed-off-by: Christian König Signed-off-by: Andrey Grodzovsky Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-2-andrey.grodzovsky@amd.com commit ae1bef72c20f9231898e2f5595751a2635d49db8 Author: Lang Yu Date: Tue Jun 22 12:23:34 2021 -0400 drm/ttm: add TTM_PL_FLAG_TEMPORARY flag v3 Sometimes drivers need to use bounce buffers to evict BOs. While those reside in some domain they are not necessarily suitable for CS. Add a flag so that drivers can note that a bounce buffers needs to be reallocated during validation. v2: add detailed comments v3 (chk): merge commits and rework commit message Suggested-by: Christian König Signed-off-by: Lang Yu Signed-off-by: Christian König Signed-off-by: Andrey Grodzovsky Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-1-andrey.grodzovsky@amd.com commit 403797925768d9fa870f5b1ebcd20016b397083b Author: Andrey Grodzovsky Date: Tue Jun 22 12:23:39 2021 -0400 drm/ttm: Fix multihop assert on eviction. Problem: Under memory pressure when GTT domain is almost full multihop assert will come up when trying to evict LRU BO from VRAM to SYSTEM. Fix: Don't assert on multihop error in evict code but rather do a retry as we do in ttm_bo_move_buffer Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-6-andrey.grodzovsky@amd.com commit 8b95b28047da740484acd8098d2a0ea1ca3bf1ef Author: Ville Syrjälä Date: Tue Jun 8 10:35:59 2021 +0300 drm/i915: Deduplicate icl DP HBR2 vs. eDP HBR3 table The icl combo phy DP HBR2 is identical to the eDP HBR3 table. Get rid of one redundant copy. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-14-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5aca4881f3f468475d91e0ed625da11111bfeb22 Author: Ville Syrjälä Date: Tue Jun 8 10:35:58 2021 +0300 drm/i915: Fix dg1 buf trans tables For some reason the dg1 buf trans tables have been stuffed into icl_get_combo_buf_trans_edp() which doesn't even get called on dg1. Split them out into a proper dg1 specific function, and also make sure we use the proper buf trans tables for DP as well as eDP. v2: Add the hobl stuff Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-13-ville.syrjala@linux.intel.com commit 299d49542c11ca998725b2ae9bc73f2ec0fef596 Author: Ville Syrjälä Date: Tue Jun 8 10:35:57 2021 +0300 drm/i915: Introduce rkl_get_combo_buf_trans() Give RKL its own get_buf_trans() func. v2: Drop the FIXME since the spec was clarified to indicate that TGL values are used for the HDMI/eDP cases. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-12-ville.syrjala@linux.intel.com commit 91e99e11392937546a94110b14bc155f9cbad0eb Author: Maxime Ripard Date: Tue May 25 15:23:52 2021 +0200 drm/vc4: hdmi: Register HDMI codec The hdmi-codec brings a lot of advanced features, including the HDMI channel mapping. Let's use it in our driver instead of our own codec. Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-11-maxime@cerno.tech commit 8434111ccfec8fc0549ec325a632067232d38e14 Author: Dom Cobley Date: Tue May 25 15:23:51 2021 +0200 drm/vc4: hdmi: Remove firmware logic for MAI threshold setting This was a workaround for bugs in hardware on earlier Pi models and wasn't totally successful. It makes audio quality worse on a Pi4 at the higher sample rates Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-10-maxime@cerno.tech commit 9a8fd277a82c2ac7d6af7422088de6c469419cc4 Author: Dom Cobley Date: Tue May 25 15:23:50 2021 +0200 drm/vc4: hdmi: Set VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE Without this bit set, HDMI_MAI_FORMAT doesn't pick up the format and samplerate from DVP_CFG_MAI0_FMT and you can't get HDMI_HDMI_13_AUDIO_STATUS_1 to indicate HBR mode Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-9-maxime@cerno.tech commit 82bd607178c0faa66daf9aeb7726d59843011785 Author: Dom Cobley Date: Tue May 25 15:23:49 2021 +0200 drm/vc4: hdmi: Set HDMI_MAI_FMT The hardware uses this for generating the right audio data island packets when using formats other than PCM Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-8-maxime@cerno.tech commit 1698ecb218eb82587dbfc71a2e26ded66e5ecf59 Author: Dom Cobley Date: Tue May 25 15:23:48 2021 +0200 drm/vc4: hdmi: Set HD_CTL_WHOLSMP and HD_CTL_CHALIGN_SET Symptom is random switching of speakers when using multichannel. Repeatedly running speakertest -c8 occasionally starts with channels jumbled. This is fixed with HD_CTL_WHOLSMP. The other bit looks beneficial and apears harmless in testing so I'd suggest adding it too. Documentation says: HD_CTL_WHILSMP_SET Wait for whole sample. When this bit is set MAI transmit will start only when there is at least one whole sample available in the fifo. Documentation says: HD_CTL_CHALIGN_SET Channel Align When Overflow. This bit is used to realign the audio channels in case of an overflow. If this bit is set, after the detection of an overflow, equal amount of dummy words to the missing words will be written to fifo, filling up the broken sample and maintaining alignment. Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-7-maxime@cerno.tech commit ecd3ee3d0c734b9454fc59cbe268c6be26f369e8 Merge: bacbab58f09dc 2fef64eec23a0 Author: Maxime Ripard Date: Wed Jun 23 14:12:13 2021 +0200 Merge tag 'asoc-hdmi-codec-improvements-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-misc-next Improvements to the hdmi-codec driver and ALSA infrastructure around it to support the HDMI Channel Mapping and IEC958 controls Signed-off-by: Maxime Ripard # -----BEGIN PGP SIGNATURE----- # # iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYMHitQAKCRDj7w1vZxhR # xQ40AP49z0mUifkpbyUvYwdmrUVlg2JEWSTOWaH3tp0kke/dBQEA1vYxdMimhFu3 # SYKXxgtvlT7vL48vNYBxGbNuGQvzJw4= # =IWna # -----END PGP SIGNATURE----- # gpg: Signature made Thu 10 Jun 2021 12:00:21 PM CEST # gpg: using EDDSA key 5C1337A45ECA9AEB89060E9EE3EF0D6F671851C5 # gpg: Good signature from "Maxime Ripard " [unknown] # gpg: aka "Maxime Ripard " [unknown] # gpg: aka "Maxime Ripard (Work Address) " [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: BE56 75C3 7E81 8C8B 5764 241C 254B CFC5 6BF6 CE8D # Subkey fingerprint: 5C13 37A4 5ECA 9AEB 8906 0E9E E3EF 0D6F 6718 51C5 From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210610122550.jnriewchqspdcrwk@gilmour commit bacbab58f09dcf7c9a52b9f11388b3e25b9daa5f Author: Maxime Ripard Date: Wed Jun 16 16:15:29 2021 +0200 drm: Mention the power state requirement on side-channel operations The drm_connector detect, drm_dp_aux transfer and mipi_dsi_host operations typically require to access their underlying device to perform what is expected of them. However, there's no guarantee on the fact that the device has been enabled through atomic_enable or similar that will usually power the device. The access to an unpowered device is then an undefined behaviour ranging from the access being ignored to a hard CPU hang. Let's document that expectation to avoid as much as possible those consequences. Signed-off-by: Maxime Ripard Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210616141529.630719-3-maxime@cerno.tech commit c48935ab6b1280a80b38405369e88470f49809f4 Author: Maxime Ripard Date: Wed Jun 16 16:15:28 2021 +0200 drm/dp_helper: Mention the concurrency requirement hw_mutex Drivers that allow concurrent access over multiple DP channels need to provide additional locking, even though the hw_mutex field might indicate otherwise. Clarify it in the documentation. Suggested-by: Daniel Vetter Signed-off-by: Maxime Ripard Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210616141529.630719-2-maxime@cerno.tech commit 14407d3afed07c48a536be01d92dcd9812bcb3d5 Author: Maxime Ripard Date: Wed Jun 16 16:15:27 2021 +0200 drm/dp_helper: Rework the drm_dp_aux documentation Split the existing documentation to move the comments on particular fields next to them. Suggested-by: Daniel Vetter Signed-off-by: Maxime Ripard Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210616141529.630719-1-maxime@cerno.tech commit 4441a8e39b628a2a523e808946681a732ac0cfc5 Author: Ville Syrjälä Date: Tue Jun 8 10:35:56 2021 +0300 drm/i915: Clean up hsw/bdw/skl/kbl buf trans funcs Split the hsw/bdw/skl/kbl get_buf_trans() functions into clean platform specific variants. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-11-ville.syrjala@linux.intel.com commit c40a253b719af14fb2c62be72ef7368bd0f8298d Author: Ville Syrjälä Date: Tue Jun 8 10:35:55 2021 +0300 drm/i915: Introduce encoder->get_buf_trans() Convert the get_buf_trans() functions into an encoder vfunc. Allows us to get rid of bunch of platform if-ladders. v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-10-ville.syrjala@linux.intel.com commit d2c496f7c9bb7bd8db96f5408d7cdd075497e599 Author: Ville Syrjälä Date: Tue Jun 8 10:35:54 2021 +0300 drm/i915: Store the HDMI default entry in the bug trans struct Store the default HDMI buf trans entry in struct intel_ddi_buf_trans so that it's next to the actual table. This let's us start ridding ourselves of some platofrm specifics in intel_ddi_hdmi_num_entries(). Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-9-ville.syrjala@linux.intel.com commit 87f7074330a35966cabfb7bacbd9a0ad67b61337 Author: Ville Syrjälä Date: Tue Jun 8 10:35:53 2021 +0300 drm/i915; Return the whole buf_trans struct from get_buf_trans() Raise the abstraction level of the get_buf_trans() functions a bit more by returning the whole wrapper intel_ddi_buf_trans struct. v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-8-ville.syrjala@linux.intel.com commit 439ebf9ef1997eb39da2a11048216a40ebc0ad99 Author: Ville Syrjälä Date: Tue Jun 8 10:35:52 2021 +0300 drm/i915: Introduce intel_get_buf_trans() Add a small helper to get the buf trans entris+num_entries from the struct. Should avoid copy-paste errors in the platform specific get_buf_trans() functions. @@ identifier T, N; @@ - *N = T.num_entries; - return T.entries; + return intel_get_buf_trans(&T, N); @@ @@ is_hobl_buf_trans(...) { ... } + + static const union intel_ddi_buf_trans_entry * + intel_get_buf_trans(const struct intel_ddi_buf_trans *ddi_translations, int *num_entries) + { + *num_entries = ddi_translations->num_entries; + return ddi_translations->entries; + } v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-7-ville.syrjala@linux.intel.com commit 13cee3c123987aa27371b10c89409d7b26e2838a Author: Ville Syrjälä Date: Tue Jun 8 10:35:51 2021 +0300 drm/i915: Wrap the buf trans tables into a struct Put a wrapper struct around the buf trans tables so that we can declare the number of entries and default HDMI entry alongside the table. @wrap@ identifier old =~ "^.*translations.*"; fresh identifier new = "_" ## old; type T; @@ <... static const T - old + new [] = { ... }; + + static const struct intel_ddi_buf_trans old = { + .entries = new, + .num_entries = ARRAY_SIZE(new), + }; ...> @@ identifier wrap.old; @@ ( - ARRAY_SIZE(old) + old.num_entries | - old + old.entries ) @@ @@ union intel_ddi_buf_trans_entry { ... }; + +struct intel_ddi_buf_trans { + const union intel_ddi_buf_trans_entry *entries; + u8 num_entries; +}; v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-6-ville.syrjala@linux.intel.com commit 4542c6cff69e9229039e580862f8f33d163d9bea Author: Ville Syrjälä Date: Tue Jun 8 10:35:50 2021 +0300 drm/i915: Rename dkl phy buf trans tables Rename the dkl phy buf trans tables to follow the same naming pattern used by everyone else. v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-5-ville.syrjala@linux.intel.com commit 30e0afa5570296ab737aa5d304e6c217881ce17f Author: Ville Syrjälä Date: Tue Jun 8 10:35:49 2021 +0300 drm/i915: Wrap the platform specific buf trans structs into a union In order to abstact the buf trans stuff let's wrap the platform specific structs into a union. v2: Handle adl-p Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-4-ville.syrjala@linux.intel.com commit d6b10b1ae436621fb4cd977d4e41cf762ec17a97 Author: Ville Syrjälä Date: Tue Jun 8 10:35:48 2021 +0300 drm/i915: Introduce hsw_get_buf_trans() All the other platforms handle the output_type stuff in their *_get_buf_trans() functions. Do the same for hsw/bdw/skl. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-3-ville.syrjala@linux.intel.com commit 266152ae61f762258706afa1046c931e5cf19d78 Author: Ville Syrjälä Date: Tue Jun 8 10:35:47 2021 +0300 drm/i915: s/intel/hsw/ for hsw/bdw/skl buf trans Give the hsw/bdw/skl buf trans stuff a better namespace. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-2-ville.syrjala@linux.intel.com commit 5c68ab9276aae473b6f07191ad115bfcb09dc938 Author: Vivek Kasireddy Date: Thu Jun 10 16:24:56 2021 -0700 drm/virtio: Add the fence in resource_flush if present If the framebuffer associated with the plane contains a fence, then it is added to resource_flush and will be waited upon for a max of 50 msecs or until it is signalled by the Host. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Link: http://patchwork.freedesktop.org/patch/msgid/20210610232456.671905-4-vivek.kasireddy@intel.com Signed-off-by: Gerd Hoffmann commit 56934baef47b262e27c29f8e306d4035cf37a71e Author: Vivek Kasireddy Date: Thu Jun 10 16:24:55 2021 -0700 drm/virtio: Prepare resource_flush to accept a fence A fence will be added to resource_flush for resources that are guest blobs. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Link: http://patchwork.freedesktop.org/patch/msgid/20210610232456.671905-3-vivek.kasireddy@intel.com Signed-off-by: Gerd Hoffmann commit 3a1fde58fab3d584dc465c072ac894dfe87abc32 Author: Vivek Kasireddy Date: Thu Jun 10 16:24:54 2021 -0700 drm/virtio: Add fences for Guest blobs Add prepare and cleanup routines for primary planes as well where a fence is added only if the BO/FB associated with the plane is a guest blob. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Link: http://patchwork.freedesktop.org/patch/msgid/20210610232456.671905-2-vivek.kasireddy@intel.com Signed-off-by: Gerd Hoffmann commit 2e717a55982affbf424b1ac2bf751201e3f4b19e Author: Dongwon Kim Date: Fri Jun 11 14:21:07 2021 -0700 udmabuf: configurable list_limit and size_limit_mb Default list_limit and size_limit_mb are not big enough to cover all possible use cases. For example, list_limit could be well over its default, 1024 if only one or several pages are chained in all individual list entries when creating dmabuf backed by >4MB buffer. list_limit and size_limit_mb are now defined as module parameters so that those can be optionally configured by root with proper values to remove these constraints. Cc: Gerd Hoffmann Signed-off-by: Dongwon Kim Link: http://patchwork.freedesktop.org/patch/msgid/20210611212107.9876-1-dongwon.kim@intel.com Signed-off-by: Gerd Hoffmann commit 89bcadc8f94bd6e6361b5c803ec6f40132e8bace Author: Daniel Vetter Date: Mon Jun 21 17:17:58 2021 +0200 dma-buf: Document non-dynamic exporter expectations better Christian and me realized we have a pretty massive disconnect about different interpretations of what dma_resv is used for by different drivers. The discussion is much, much bigger than this change here, but this is an important one: Non-dynamic exporters must guarantee that the memory they return is ready for use. They cannot expect importers to wait for the exclusive fence. Only dynamic importers are required to obey the dma_resv fences strictly (and more patches are needed to define exactly what this means). Christian has patches to update nouvea, radeon and amdgpu. The only other driver using both ttm and supporting dma-buf export is qxl, which only uses synchronous ttm_bo_move. v2: To hammer this in document that dynamic importers _must_ wait for the exclusive fence after having called dma_buf_map_attachment. Reviewed-by: Christian König Cc: Christian König Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210621151758.2347474-1-daniel.vetter@ffwll.ch commit 17203224f0536cf223dc5789028d04a768d96ec3 Author: Jani Nikula Date: Thu Jun 10 12:05:28 2021 +0300 drm/i915/dsc: abstract helpers to get bigjoiner primary/secondary crtc Add a single point of truth for figuring out the primary/secondary crtc for bigjoiner instead of duplicating the magic pipe +/- 1 in multiple places. Also fix the pipe validity checks to properly take non-contiguous pipes into account. The current checks may theoretically overflow i915->pipe_to_crtc_mapping[pipe], albeit with a warning, due to fused off pipes, as INTEL_NUM_PIPES() returns the actual number of pipes on the platform, and the check is for INTEL_NUM_PIPES() == pipe + 1. Prefer primary/secondary terminology going forward. v2: - Improved abstractions for pipe validity etc. Fixes: 8a029c113b17 ("drm/i915/dp: Modify VDSC helpers to configure DSC for Bigjoiner slave") Fixes: d961eb20adb6 ("drm/i915/bigjoiner: atomic commit changes for uncompressed joiner") Cc: Animesh Manna Cc: Manasi Navare Cc: Vandita Kulkarni Reviewed-by: Manasi Navare Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210610090528.20511-1-jani.nikula@intel.com commit 8c505bdc9c8b955223b054e34a0be9c3d841cd20 Author: Christian König Date: Wed Jun 9 13:51:36 2021 +0200 drm/amdgpu: rework dma_resv handling v3 Drop the workaround and instead implement a better solution. Basically we are now chaining all submissions using a dma_fence_chain container and adding them as exclusive fence to the dma_resv object. This way other drivers can still sync to the single exclusive fence while amdgpu only sync to fences from different processes. v3: add the shared fence first before the exclusive one Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210614174536.5188-2-christian.koenig@amd.com commit 22f0463ae606a34134fdabacd27ede59e535a7cc Author: Christian König Date: Tue Jun 8 15:47:16 2021 +0200 drm/amdgpu: unwrap fence chains in the explicit sync fence Unwrap the explicit fence if it is a dma_fence_chain and sync to the first fence not matching the owner rules. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210614174536.5188-1-christian.koenig@amd.com commit 1451d0e90f47df758e600e4bdcddb1ac97b68097 Author: Laurent Pinchart Date: Mon Jun 21 15:55:18 2021 +0300 drm: bridge: ti-sn65dsi83: Retrieve the display mode from the state Instead of storing a copy of the display mode in the sn65dsi83 structure, retrieve it from the atomic state in sn65dsi83_atomic_enable(). This allows the removal of the .mode_set() operation, and completes the transition to the atomic API. Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-6-laurent.pinchart@ideasonboard.com commit 03ea01c0c295fc93291adc842e9d6a72bd57e1f7 Author: Laurent Pinchart Date: Mon Jun 21 15:55:17 2021 +0300 drm: bridge: ti-sn65dsi83: Retrieve output format from bridge state The driver currently iterates over all connectors to get the bus format, used to configure the LVDS output format. This causes several issues: - If other connectors than the LVDS output are present, the format used by the driver may end up belonging to an entirely different output. - The code can crash if some connectors are not connected, as bus_format may then be NULL. - There's no guarantee that the bus format on the connector at the output of the pipeline matches the output of the sn65dsi83, as there may be other bridges in the pipeline. Solve this by retrieving the format from the bridge state instead, which provides the format corresponding to the output of the bridge. The struct sn65dsi83 lvds_format_24bpp and lvds_format_jeida fields are moved to local variables in sn65dsi83_atomic_enable() as they're now used in that function only. Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-5-laurent.pinchart@ideasonboard.com commit a6ea7d268a6348ba252d01deeb5df28f361439e5 Author: Laurent Pinchart Date: Mon Jun 21 15:55:16 2021 +0300 drm: bridge: ti-sn65dsi83: Switch to atomic operations Use the atomic version of the enable/disable operations to continue the transition to the atomic API, started with the introduction of .atomic_get_input_bus_fmts(). This will be needed to access the mode from the atomic state. Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-4-laurent.pinchart@ideasonboard.com commit 7f0b7f5ee367cb4d84d212d04d0c3d4cce788782 Author: Laurent Pinchart Date: Mon Jun 21 15:55:15 2021 +0300 drm: bridge: ti-sn65dsi83: Pass mode explicitly to helper functions Pass the display mode explicitly to the sn65dsi83_get_lvds_range() and sn65dsi83_get_dsi_range() functions to prepare for its removal from the sn65dsi83 structure. This is not meant to bring any functional change. Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-3-laurent.pinchart@ideasonboard.com commit b966d857c57acb5cd2b12e5e6e466c980d90d362 Author: Laurent Pinchart Date: Mon Jun 21 15:55:14 2021 +0300 drm: bridge: ti-sn65dsi83: Move LVDS format selection to .mode_set() The LVDS format is selected based on the bus format reported by the connector. This is currently done in .mode_fixup(), but that's not the right place, as the format should be selected when setting the mode. Move it to .mode_set(). Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210621125518.13715-2-laurent.pinchart@ideasonboard.com commit 3fbe43c9f577cadd6b5136fda2e6a6c0b4e0651e Author: Namjae Jeon Date: Fri Jun 18 10:42:32 2021 +0900 ksmbd: replace KSMBD_SHARE_CONFIG_PATH with inline function replace KSMBD_SHARE_CONFIG_PATH with inline function. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9f88af04f03d585b8257740745d19897b48a9795 Author: Namjae Jeon Date: Fri Jun 18 10:41:42 2021 +0900 ksmbd: remove ____ksmbd_align in ksmbd_server.h None of structures needs the attribute. So remove ____ksmbd_align in ksmbd_server.h. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9c78ad067faf605e0cd16d557859310e5f5312be Author: Namjae Jeon Date: Fri Jun 18 10:40:56 2021 +0900 ksmbd: remove unneeded FIXME comment Remove unneeded FIXME comment. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 79a8a71db4084d7536fc45ed2a33ce7b451ba127 Author: Namjae Jeon Date: Fri Jun 18 10:30:46 2021 +0900 ksmbd: fix overly long line Fix overly long line. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1dfb8242e8d982d036399766c4af62ddc221e38d Author: Namjae Jeon Date: Fri Jun 18 10:29:56 2021 +0900 ksmbd: use goto instead of duplicating the resoure cleanup in ksmbd_open_fd Use goto instead of duplicating the resoure cleanup in ksmbd_open_fd. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6f3d5eeec744727bf017be3bb12e7fbf1c4438ed Author: Namjae Jeon Date: Fri Jun 18 10:28:52 2021 +0900 ksmbd: use list_for_each_entry instead of list_for_each Use list_for_each_entry instead of list_for_each. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f8524776f1bbf2895de757438b41915a9b3d9bbc Author: Namjae Jeon Date: Fri Jun 18 10:28:00 2021 +0900 ksmbd: remove ksmbd_vfs_copy_file_range vfs_copy_file_range and cifs client already does this type of fallback, so this is dead code. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit afa8f016c5a527bd004042ea47ca8b8007e4185f Author: Namjae Jeon Date: Fri Jun 18 10:18:34 2021 +0900 ksmbd: initialize variables on the declaration Initialize variables on the declaration. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c30f4eb84badf7476824c38f874542a2e653b46b Author: Namjae Jeon Date: Fri Jun 18 10:17:37 2021 +0900 ksmbd: remove cache read/trans buffer support As vmalloc performance improvement patch for big allocation is merged into linux kernel, This feature is no longer not needed. Reviewed-by: Christoph Hellwig Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit dac0f8ad653a2e944566f109456cd51c151c14c5 Author: Anusha Srivatsa Date: Mon Jun 21 12:14:15 2021 -0700 drm/i915/adl_p: Load DMC Load DMC v2.10 on ADLP. The release notes mention that this version enables few power savings features. v2: Add DMC_PATH() for ADLP (Lucas) Cc: Lucas De Marchi Cc: Clint Taylor Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210621191415.29823-5-anusha.srivatsa@intel.com commit 2ef140bd23522f71da83667eee35d53eaafd7659 Author: Anusha Srivatsa Date: Mon Jun 21 12:14:14 2021 -0700 drm/i915/adl_p: Pipe B DMC Support ADLP requires us to load both Pipe A and Pipe B. Plug Pipe B loading support. Cc: Lucas De Marchi Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210621191415.29823-4-anusha.srivatsa@intel.com commit 3d5928a168a9546b23c6b3439c6158d7a028326c Author: Anusha Srivatsa Date: Mon Jun 21 12:14:13 2021 -0700 drm/i915/xelpd: Pipe A DMC plugging This patch adds Pipe A plumbing to the already existing parsing and loading functions which is taken care of in the prep patches. Adding MAX_DMC_FW to keep track for both Main and Pipe A DMC while loading the respective blobs. Also adding present field in dmc_info. s/find_dmc_fw_offset/csr_set_dmc_fw_offset. While at it add fw_info_matches_stepping() helper. CSR_PROGRAM() should now take the starting address of the particular blob (Main or Pipe) and not hardcode it. v2: Add dmc_offset and start_mmioaddr fields for dmc_info struct. v3: Add a missing corner cases of stepping-substepping combination in fw_info_matches_stepping() helper. v4: Add macro for start_mmioaddr for V1 package. Simplify code in dmc_set_fw_offset (Lucas) Cc: Souza, Jose Cc: Lucas De Marchi Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210621191415.29823-3-anusha.srivatsa@intel.com commit 451e05e20270454ef9a9c52e32e2f8863a368b04 Author: Anusha Srivatsa Date: Mon Jun 21 12:14:12 2021 -0700 drm/i915/dmc: Introduce DMC_FW_MAIN This is a prep patch for Pipe DMC plugging. Add dmc_info struct in intel_dmc to have all common fields shared between all DMC's in the package. Add DMC_FW_MAIN(dmc_id 0) to refer to the blob. v2: Remove dmc_offset and start_mmioaddr from dmc_info struct (Jose) Cc: Souza, Jose Signed-off-by: Anusha Srivatsa Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20210621191415.29823-2-anusha.srivatsa@intel.com commit c88e2647c5bb45d04dc4302018ebe6ebbf331823 Author: Kees Cook Date: Thu Jun 17 14:33:01 2021 -0700 drm/i915/display: Do not zero past infoframes.vsc intel_dp_vsc_sdp_unpack() was using a memset() size (36, struct dp_sdp) larger than the destination (24, struct drm_dp_vsc_sdp), clobbering fields in struct intel_crtc_state after infoframes.vsc. Use the actual target size for the memset(). Fixes: 1b404b7dbb10 ("drm/i915/dp: Read out DP SDPs") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210617213301.1824728-1-keescook@chromium.org commit 4824a5f7ce10d8d34fd5807be42206bbf30d5b66 Author: Stefan Riedmueller Date: Mon Jun 21 17:09:30 2021 +0200 drm/panel: Add bus_format and bus_flags for EDT ETM0430G0DH6 Add corresponding bus_format and bus_flags for the EDT ETM0430G0DH6 display. Signed-off-by: Stefan Riedmueller Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210621150930.86617-3-s.riedmueller@phytec.de commit d112e10fece5f9729e3581474dcb2768f6838e23 Author: Stefan Riedmueller Date: Mon Jun 21 17:09:29 2021 +0200 drm/panel: Add connector_type for some EDT displays The connector_type for following two EDT displays is missing: - EDT ETM0430G0DH6 - EDT ETM0700G0BDH6 Both are parallel displays thus add the corresponding connector_type. Signed-off-by: Stefan Riedmueller Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210621150930.86617-2-s.riedmueller@phytec.de commit a3050f23c77419aa71843c75a3bc6e0909c03ba4 Author: Stefan Riedmueller Date: Mon Jun 21 17:09:28 2021 +0200 drm/panel: Add connector_type and bus_format for AUO G104SN02 V2 panel The AUO G104SN02 V2 is an LVDS display which supports 6 and 8 bpc PSWG. Add the corresponding connector type and 8 bpc as default bus_format. Signed-off-by: Stefan Riedmueller Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210621150930.86617-1-s.riedmueller@phytec.de commit db8b7ca5b232083c82f627af7fe653d8074c5ca0 Author: Marek Vasut Date: Mon Jun 21 00:42:08 2021 +0200 drm/bridge: ti-sn65dsi83: Replace connector format patching with atomic_get_input_bus_fmts Patching the connector format is causing various problematic side effects. Implement .atomic_get_input_bus_fmts callback instead, 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. Signed-off-by: Marek Vasut Cc: Adam Ford Cc: Douglas Anderson Cc: Frieder Schrempf Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Loic Poulain Cc: Philippe Schenker Cc: Robert Foss Cc: Sam Ravnborg Cc: Stephen Boyd Cc: Valentin Raevsky Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210620224208.184719-1-marex@denx.de commit ca319ee9ca6a6ef95143df8d0a57b2941c2a9566 Author: Daniel Vetter Date: Fri Jun 18 23:45:03 2021 +0200 drm/i915/eb: Fix pagefault disabling in the first slowpath In commit ebc0808fa2da0548a78e715858024cb81cd732bc Author: Chris Wilson Date: Tue Oct 18 13:02:51 2016 +0100 drm/i915: Restrict pagefault disabling to just around copy_from_user() we entirely missed that there's a slow path call to eb_relocate_entry (or i915_gem_execbuffer_relocate_entry as it was called back then) which was left fully wrapped by pagefault_disable/enable() calls. Previously any issues with blocking calls where handled by the following code: /* we can't wait for rendering with pagefaults disabled */ if (pagefault_disabled() && !object_is_idle(obj)) return -EFAULT; Now at this point the prefaulting was still around, which means in normal applications it was very hard to hit this bug. No idea why the regressions in igts weren't caught. Now this all changed big time with 2 patches merged closely together. First commit 2889caa9232109afc8881f29a2205abeb5709d0c Author: Chris Wilson Date: Fri Jun 16 15:05:19 2017 +0100 drm/i915: Eliminate lots of iterations over the execobjects array removes the prefaulting from the first relocation path, pushing it into the first slowpath (of which this patch added a total of 3 escalation levels). This would have really quickly uncovered the above bug, were it not for immediate adding a duct-tape on top with commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb Author: Chris Wilson Date: Fri Jun 16 15:05:24 2017 +0100 drm/i915: Async GPU relocation processing by pushing all all the relocation patching to the gpu if the buffer was busy, which avoided all the possible blocking calls. The entire slowpath was then furthermore ditched in commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d Author: Chris Wilson Date: Wed Mar 11 16:03:10 2020 +0000 drm/i915/gem: Drop relocation slowpath and resurrected in commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871 Author: Maarten Lankhorst Date: Wed Aug 19 16:08:43 2020 +0200 Revert "drm/i915/gem: Drop relocation slowpath". but this did not further impact what's going on. Since pagefault_disable/enable is an atomic section, any sleeping in there is prohibited, and we definitely do that without gpu relocations since we have to wait for the gpu usage to finish before we can patch up the relocations. Reviewed-by: Matthew Auld Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Cc: Jon Bloomfield Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Joonas Lahtinen Cc: Daniel Vetter Cc: "Thomas Hellström" Cc: Matthew Auld Cc: Lionel Landwerlin Cc: Dave Airlie Cc: Jason Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20210618214503.1773805-1-daniel.vetter@ffwll.ch commit 577729533cdc4e37a8c230e404a44ad7a3ff4eda Author: Tvrtko Ursulin Date: Fri Jun 18 16:00:36 2021 +0100 drm/i915: Document the Virtual Engine uAPI A little bit of documentation covering the topics of engine discovery, context engine maps and virtual engines. It is not very detailed but supposed to be a starting point of giving a brief high level overview of general principles and intended use cases. v2: * Have the text in uapi header and link from there. v4: * Link from driver-uapi.rst. Signed-off-by: Tvrtko Ursulin Cc: Daniel Vetter Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210618150036.2507653-1-tvrtko.ursulin@linux.intel.com commit f5a544e3bab78142207e0242d22442db85ba1eff Author: Namjae Jeon Date: Fri Jun 18 10:04:19 2021 +0900 ksmbd: add support for SMB3 multichannel Add support for SMB3 multichannel. It will be enable by setting 'server multi channel support = yes' in smb.conf. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5fb68864674faa3e0a4fc767c4a87f51ece218c6 Author: Colin Ian King Date: Fri Jun 18 09:54:53 2021 +0900 ksmbd: fix kfree of uninitialized pointer oid Currently function ksmbd_neg_token_init_mech_type can kfree an uninitialized pointer oid when the call to asn1_oid_decode fails when vlen is out of range. All the other failure cases in function asn1_oid_decode set *oid to NULL on an error, so fix the issue by ensuring the vlen out of range error also nullifies the pointer. Addresses-Coverity: ("Uninitialized pointer read") Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bfde26df7af4e8ea894008dfda1d7d54a834dcd4 Author: Michal Wajdeczko Date: Tue Jun 15 17:13:02 2021 -0700 drm/i915/doc: Include GuC ABI documentation GuC ABI documentation is now ready to be included in i915.rst Signed-off-by: Michal Wajdeczko Signed-off-by: Matthew Brost Cc: Piotr Piórkowski Reviewed-by: Matthew Brost Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210616001302.84233-4-matthew.brost@intel.com commit 572f2a5cd9742c52f6d4d659409180168a169a24 Author: Michal Wajdeczko Date: Tue Jun 15 17:13:01 2021 -0700 drm/i915/guc: Update firmware to v62.0.0 Most of the changes to the 62.0.0 firmware revolved around CTB communication channel. Conform to the new (stable) CTB protocol. v2: (Michal) Add values back to kernel DOC for actions (Docs) Add 'CT buffer' back in to fix warning Signed-off-by: John Harrison Signed-off-by: Michal Wajdeczko Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio [mattrope: Tweaked kerneldoc while pushing as suggested by Daniele/Michal] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210616001302.84233-3-matthew.brost@intel.com commit 088b4d4a48ee97e993fc6b4381d23776f0782bc6 Author: Michal Wajdeczko Date: Tue Jun 15 17:13:00 2021 -0700 drm/i915/guc: Introduce unified HXG messages New GuC firmware will unify format of MMIO and CTB H2G messages. Introduce their definitions now to allow gradual transition of our code to match new changes. Signed-off-by: Matthew Brost Signed-off-by: Michal Wajdeczko Cc: Michał Winiarski Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210616001302.84233-2-matthew.brost@intel.com commit 22916bad07a5d42dbb6797f4f0c87a0a5842ec6c Author: Matthew Brost Date: Thu Jun 17 18:06:38 2021 -0700 drm/i915: Move submission tasklet to i915_sched_engine The submission tasklet operates on i915_sched_engine, thus it is the correct place for it. v3: (Jason Ekstrand) Change sched_engine->engine to a void* private data pointer Add kernel doc v4: (Daniele) Update private_data comment Set queue_priority_hint in kick_execlists v5: (CI) Rebase and fix build error Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-9-matthew.brost@intel.com commit d2a31d026492040f5401f667cd3201b16c656b00 Author: Matthew Brost Date: Thu Jun 17 18:06:37 2021 -0700 drm/i915: Update i915_scheduler to operate on i915_sched_engine Rather passing around an intel_engine_cs in the scheduling code, pass around a i915_sched_engine. v3: (Jason Ekstrand) Add READ_ONCE around rq->engine in lock_sched_engine Signed-off-by: Matthew Brost Reviewed-by: Jason Ekstrand Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-8-matthew.brost@intel.com commit 71ed60112d5d3bc90df704c1db2b655a9f4a7b66 Author: Matthew Brost Date: Thu Jun 17 18:06:36 2021 -0700 drm/i915: Add kick_backend function to i915_sched_engine Not all back-ends require a kick after a scheduling update, so make the kick a call-back function that the back-end can opt-in to. Also move the current kick function from the scheduler to the execlists file as it is specific to that back-end. Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-7-matthew.brost@intel.com commit 3f623e06cd56573d57660ce02d63aaf0a09d3fbb Author: Matthew Brost Date: Thu Jun 17 18:06:35 2021 -0700 drm/i915: Move engine->schedule to i915_sched_engine The schedule function should be in the schedule object. v3: (Jason Ekstrand) Add kernel doc Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-6-matthew.brost@intel.com commit 349a2bc5aae45f54bce1c6fd54d8d3ac2ae26611 Author: Matthew Brost Date: Thu Jun 17 18:06:34 2021 -0700 drm/i915: Move active tracking to i915_sched_engine Move active request tracking and its lock to i915_sched_engine. This lock is also the submission lock so having it in the i915_sched_engine is the correct place. v3: (Jason Ekstrand) Add kernel doc v6: Rebase Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-5-matthew.brost@intel.com commit c4fd7d8cc3caa614ab492e0efc8854328f72b719 Author: Matthew Brost Date: Thu Jun 17 18:06:33 2021 -0700 drm/i915: Reset sched_engine.no_priolist immediately after dequeue Rather than touching schedule state in the generic PM code, reset the priolist allocation when empty in the submission code. Add a wrapper function to do this and update the backends to call it in the correct place. v3: (Jason Ekstrand) Update patch commit message with a better description Signed-off-by: Matthew Brost Reviewed-by: Jason Ekstrand Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-4-matthew.brost@intel.com commit 074bb195bce1c86b66e5cd809d6663039d3abf42 Author: Matthew Brost Date: Thu Jun 17 18:06:32 2021 -0700 drm/i915: Add i915_sched_engine_is_empty function Add wrapper function around RB tree to determine if i915_sched_engine is empty. Signed-off-by: Matthew Brost Reviewed-by: Jason Ekstrand Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-3-matthew.brost@intel.com commit 3e28d37146db5dd49c469bc62a93ca791067d391 Author: Matthew Brost Date: Thu Jun 17 18:06:31 2021 -0700 drm/i915: Move priolist to new i915_sched_engine object Introduce i915_sched_engine object which is lower level data structure that i915_scheduler / generic code can operate on without touching execlist specific structures. This allows additional submission backends to be added without breaking the layering. Currently the execlists backend uses 1 of these object per each engine (physical or virtual) but future backends like the GuC will point to less instances utilizing the reference counting. This is a bit of detour to integrating the i915 with the DRM scheduler but this object will still exist when the DRM scheduler lands in the i915. It will however look a bit different. It will encapsulate the drm_gpu_scheduler object plus and common variables (to the backends) related to scheduling. Regardless this is a step in the right direction. This patch starts the aforementioned transition by moving the priolist into the i915_sched_engine object. v3: (Jason Ekstrand) Update comment next to intel_engine_cs.virtual Add kernel doc (Checkpatch) Fix double the in commit message v4: (Daniele) Update comment message. Add comment about subclass field Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-2-matthew.brost@intel.com commit e87138e05c803a78460a6b59fa75a05f92aa80fb Author: Colin Ian King Date: Fri Jun 18 19:35:24 2021 +0100 drm/gma500/oaktrail_lvds: replace continue with break Currently a loop scans through the connector list checking for connectors that do not match a specific criteria. The use of the continue statement is a little unintuitive and can confuse static analysis checking. Invert the criteria matching logic and use a break to terminate the loop once the first suitable connector has been found. Thanks to Patrik Jakobsson for explaining the original intent of the code and suggesting this change. Addresses-Coverity: ("Continue has no effect") Signed-off-by: Colin Ian King Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20210618183524.590186-1-colin.king@canonical.com commit 12fc23a4a3d1dbeaf609c1f27af59755d48cb0fb Author: Dan Carpenter Date: Fri Jun 18 11:37:21 2021 +0300 drm/amdgpu: fix amdgpu_preempt_mgr_new() There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM. Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next") Signed-off-by: Dan Carpenter Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/YMxbQXg/Wqm0ACxt@mwanda Signed-off-by: Christian König commit 59bd8ae7d33c83c4a81835d4e922bdae17fd8522 Author: Matthew Auld Date: Fri Jun 18 14:31:49 2021 +0100 drm/i915/selftests: add back the selftest() hook for the buddy When we resurrected the selftest we forgot to add back the selftest() hook, meaning the test is not currently run. References: d148738923fd ("drm/i915/ttm Initialize the ttm device and memory managers") Reported-by: kernel test robot Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210618133150.700375-1-matthew.auld@intel.com commit b07a6483839a838dc7acff570174053dd544c039 Author: Thomas Hellström Date: Fri Jun 18 15:25:15 2021 +0200 drm/i915/ttm: Fix incorrect assumptions about ttm_bo_validate() semantics We have assumed that if the current placement was not the requested placement, but instead one of the busy placements, a TTM move would have been triggered. That is not the case. So when we initially place LMEM objects in "Limbo", (that is system placement without any pages allocated), to be able to defer clearing objects until first get_pages(), the first get_pages() would happily keep objects in system memory if that is one of the allowed placements. And since we don't yet support i915 GEM system memory from TTM, everything breaks apart. So make sure we try the requested placement first, if no eviction is needed. If that fails, retry with all allowed placements also allowing evictions. Also make sure we handle TTM failure codes correctly. Also temporarily (until we support i915 GEM system on TTM), restrict allowed placements to the requested placement to avoid things falling apart should LMEM be full. Fixes: 38f28c0695c0 ("drm/i915/ttm: Calculate the object placement at get_pages time") Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210618132515.163277-1-thomas.hellstrom@linux.intel.com commit f03ab6629c7b410d874151cf1d8570899a65fdda Author: Pi-Hsun Shih Date: Tue Jun 15 11:29:24 2021 +0800 drm/bridge: anx7625: Make hpd workqueue freezable There were still a race condition between hpd work and suspend, since the workqueue work can still be run after anx7625 had powered off in suspend. Since we never want hpd work to run while suspending, and there's no harm to delay them to be run after resume, mark the workqueue as WQ_FREEZABLE so all works won't run while suspending. Fixes: 409776fa3c42 ("drm/bridge: anx7625: add suspend / resume hooks") Signed-off-by: Pi-Hsun Shih Reviewed-by: Tzung-Bi Shih Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210615032937.2328468-1-pihsun@chromium.org commit 3193927421554757e6bee52f9c7e3937edefc589 Author: Matt Roper Date: Thu Jun 17 14:14:25 2021 -0700 drm/i915: Add support for explicit L3BANK steering Because Render Power Gating restricts us to just a single subslice as a valid steering target for reads of multicast registers in a SUBSLICE range, the default steering we setup at init may not lead to a suitable target for L3BANK multicast register. In cases where it does not, use explicit runtime steering whenever an L3BANK multicast register is read. While we're at it, let's simplify the function a little bit and drop its support for gen10/CNL since no such platforms ever materialized for real use. Multicast register steering is already an area that causes enough confusion; no need to complicate it with what's effectively dead code. v2: - Use gt->uncore instead of gt->i915->uncore. (Tvrtko) - Use {} as table terminator. (Rodrigo) v3: - L3bank fuse register is a disable mask rather than an enable mask. We need to invert it before use. (CI) v4: - L3bank ID goes in the subslice field, not the slice field. (CI) Cc: Tvrtko Ursulin Cc: Rodrigo Vivi Signed-off-by: Matt Roper Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210617211425.1943662-4-matthew.d.roper@intel.com commit 0957e931df647511ecaf43883a7031004036f90d Author: Matt Roper Date: Thu Jun 17 14:14:24 2021 -0700 drm/i915: Add GT support for multiple types of multicast steering Although most of our multicast registers are replicated per-subslice, we also have a small number of multicast registers that are replicated per-l3 bank instead. For both types of multicast registers we need to make sure we steer reads of these registers to a valid instance. Ideally we'd like to find a specific instance ID that would steer reads of either type of multicast register to a valid instance (i.e., not fused off and not powered down), but sometimes the combination of part-specific fusing and the additional restrictions imposed by Render Power Gating make it impossible to find any overlap between the set of valid subslices and valid l3 banks. This problem will become even more noticeable on our upcoming platforms since they will be adding additional types of multicast registers with new types of replication and rules for finding valid instances for reads. To handle this we'll continue to pick a suitable subslice instance at driver startup and program this as the default (sliceid,subsliceid) setting in the steering control register (0xFDC). In cases where we need to read another type of multicast GT register, but the default subslice steering would not correspond to a valid instance, we'll explicitly re-steer the single read to a valid value, perform the read, and then reset the steering to it's "subslice" default. This patch adds the general functionality to prepare for this explicit steering of other multicast register types. We'll plug L3 bank steering into this in the next patch, and then add additional types of multicast registers when the support for our next upcoming platform arrives. v2: - Use entry->end==0 as table terminator. (Rodrigo) - Grab forcewake in wa_list_verify() now that we're using accessors that assume forcewake is already held. v3: - Fix loop condition when iterating over steering range tables. (Rodrigo) Cc: Rodrigo Vivi Signed-off-by: Matt Roper Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210617211425.1943662-3-matthew.d.roper@intel.com commit 932641f0323eec3fc42dfd303eb033f5dfa08e74 Author: Daniele Ceraolo Spurio Date: Thu Jun 17 14:14:23 2021 -0700 drm/i915: extract steered reg access to common function New steering cases will be added in the follow-up patches, so prepare a common helper to avoid code duplication. Cc: Tvrtko Ursulin Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210617211425.1943662-2-matthew.d.roper@intel.com commit 51f52547df700819db0d0e2b17b677cb209212b4 Author: Jason Ekstrand Date: Thu Jun 17 14:42:58 2021 -0500 dma-buf: Document DMA_BUF_IOCTL_SYNC (v3) This adds a new "DMA Buffer ioctls" section to the dma-buf docs and adds documentation for DMA_BUF_IOCTL_SYNC. v2 (Daniel Vetter): - Fix a couple typos - Add commentary about synchronization with other devices - Use item list format for describing flags v3 (Pekka Paalanen): - Clarify stalling requirements. - Be more clear that that DMA_BUF_IOCTL_SYNC with SINC_END has to be called before more GPU work happens. Signed-off-by: Jason Ekstrand Reviewed-by: Daniel Vetter Acked-by: Christian König Acked-by: Pekka Paalanen Cc: Sumit Semwal Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210617194258.579011-1-jason@jlekstrand.net commit d35c97f606a1398b58e14e7cb8a7c67f7817be2a Author: Jiahua Yu Date: Tue Jun 15 19:17:13 2021 -0800 fbdev/omap2: use DEFINE_SPINLOCK() instead of spin_lock_init(). spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Signed-off-by: Jiahua Yu Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210616031713.24959-1-yujiahua1@huawei.com commit 6796c772850574ec0a9adc977e9889606b23d0f4 Author: Wan Jiabing Date: Tue Jun 15 19:35:20 2021 +0800 drm/i915: Remove duplicate include of intel_region_lmem.h Fix the following checkinclude.pl warning: drivers/gpu/drm/i915/gt/intel_region_lmem.c 8 #include "intel_region_lmem.h" 12 #include "intel_region_lmem.h" Signed-off-by: Wan Jiabing Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210615113522.6867-1-wanjiabing@vivo.com commit 5cd57f676bb946a00275408f0dd0d75dbc466d25 Author: Thomas Hellström Date: Tue Jun 15 13:36:00 2021 +0200 drm/i915: Perform execbuffer object locking as a separate step To help avoid evicting already resident buffers from the batch we're processing, perform locking as a separate step. Signed-off-by: Thomas Hellström Reviewed-by: Ramalingam C Reviewed-by: Maarten Lankhorst Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210615113600.30660-1-thomas.hellstrom@linux.intel.com commit 99919be74aa37537850a7b453f2a3e3260e0d50e Author: Thomas Hellström Date: Thu Jun 17 08:30:18 2021 +0200 drm/i915/gem: Zap the i915_gem_object_blt code It's unused with the exception of selftest. Replace a call in the memory_region live selftest with a call into a corresponding function in the new migrate code. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-13-thomas.hellstrom@linux.intel.com commit 57143f2e5b41f3e51b13d3c358e29a932334110d Author: Thomas Hellström Date: Thu Jun 17 08:30:17 2021 +0200 drm/i915/gem: Zap the client blt code It's not used anywhere. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-12-thomas.hellstrom@linux.intel.com commit 50331a7b50741035cc9335f863939d638b225e71 Author: Ramalingam C Date: Thu Jun 17 08:30:16 2021 +0200 drm/i915/ttm: accelerated move implementation Invokes the pipelined page migration through blt, for i915_ttm_move requests of eviction and also obj clear. Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellström Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-11-thomas.hellstrom@linux.intel.com commit 94ce0d65076cda511da843ae1893c819948a215a Author: Chris Wilson Date: Thu Jun 17 08:30:15 2021 +0200 drm/i915/gt: Setup a default migration context on the GT Set up a default migration context on the GT and use it from the selftests. Add a perf selftest and make sure we exercise LMEM if available. Signed-off-by: Chris Wilson Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-10-thomas.hellstrom@linux.intel.com commit 563baae1875cbcac332086cca325cf55a0532b9e Author: Chris Wilson Date: Thu Jun 17 08:30:14 2021 +0200 drm/i915/gt: Pipelined clear Update the PTE and emit a clear within a single unpreemptible packet such that we can schedule and pipeline clears. Signed-off-by: Chris Wilson Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-9-thomas.hellstrom@linux.intel.com commit cf586021642d8017cde111b7dd1ba86224e9da51 Author: Chris Wilson Date: Thu Jun 17 08:30:13 2021 +0200 drm/i915/gt: Pipelined page migration If we pipeline the PTE updates and then do the copy of those pages within a single unpreemptible command packet, we can submit the copies and leave them to be scheduled without having to synchronously wait under a global lock. In order to manage migration, we need to preallocate the page tables (and keep them pinned and available for use at any time), causing a bottleneck for migrations as all clients must contend on the limited resources. By inlining the ppGTT updates and performing the blit atomically, each client only owns the PTE while in use, and so we can reschedule individual operations however we see fit. And most importantly, we do not need to take a global lock on the shared vm, and wait until the operation is complete before releasing the lock for others to claim the PTE for themselves. Signed-off-by: Chris Wilson Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-8-thomas.hellstrom@linux.intel.com commit b4ef95309110122e05b0d17310b80a0abde881d9 Author: Chris Wilson Date: Thu Jun 17 08:30:12 2021 +0200 drm/i915/gt: Export the pinned context constructor and destructor Allow internal clients to create and destroy a pinned context. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-7-thomas.hellstrom@linux.intel.com commit 3607e1e9ba7553e39b175fa14d10a48677083607 Author: Chris Wilson Date: Thu Jun 17 08:30:11 2021 +0200 drm/i915/gt: Add a routine to iterate over the pagetables of a GTT In the next patch, we will want to look at the dma addresses of individual page tables, so add a routine to iterate over them. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-6-thomas.hellstrom@linux.intel.com commit 0dcd6fdf3b4be20995d8d35198ac252833613ab9 Author: Chris Wilson Date: Thu Jun 17 08:30:10 2021 +0200 drm/i915/gt: Add an insert_entry for gen8_ppgtt In the next patch, we will want to write a PTE for an explicit dma address, outside of the usual vma. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-5-thomas.hellstrom@linux.intel.com commit 3b86eb82dc2c9989ca6e53cb597a2a1390c64d12 Author: Thomas Hellström Date: Thu Jun 17 08:30:09 2021 +0200 drm/i915: Introduce a ww transaction helper Introduce a for_i915_gem_ww(){} utility to help make the code around a ww transaction more readable. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-4-thomas.hellstrom@linux.intel.com commit 5c43ec5d538a5fa1736d298e63a3f8ac03009eea Author: Thomas Hellström Date: Thu Jun 17 08:30:08 2021 +0200 drm/i915: Break out dma_resv ww locking utilities to separate files As we're about to add more ww-related functionality, break out the dma_resv ww locking utilities to their own files Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-3-thomas.hellstrom@linux.intel.com commit 1c4dbe056dab0b7c2a2f42f4d393cc7b9bdb98ad Author: Thomas Hellström Date: Thu Jun 17 08:30:07 2021 +0200 drm/i915: Reference objects on the ww object list Since the ww transaction endpoint easily end up far out-of-scope of the objects on the ww object list, particularly for contending lock objects, make sure we reference objects on the list so they don't disappear under us. This comes with a performance penalty so it's been debated whether this is really needed. But I think this is motivated by the fact that locking is typically difficult to get right, and whatever we can do to make it simpler for developers moving forward should be done, unless the performance impact is far too high. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-2-thomas.hellstrom@linux.intel.com commit a6c5b891252143ee9bc02f649282905954d6705c Author: Matthew Auld Date: Thu Jun 17 09:37:19 2021 +0100 drm/i915/ttm: remove unused function intel_region_ttm_node_free is no longer used. Also fixup the related kerneldoc. Reported-by: kernel test robot Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210617083719.497619-1-matthew.auld@intel.com commit dc2408d86e5ae88ec981e1315f95b7d4d15169fe Author: Daniel Vetter Date: Wed Jun 16 11:03:50 2021 +0200 drm/i915/gem: Remove duplicated call to ops->pread Between commit ae30af84edb5b7cc95485922e43afd909a892e1b Author: Maarten Lankhorst Date: Tue Mar 23 16:50:00 2021 +0100 drm/i915: Disable userptr pread/pwrite support. and commit 0049b688459b846f819b6e51c24cd0781fcfde41 Author: Matthew Auld Date: Thu Nov 5 15:49:33 2020 +0000 drm/i915/gem: Allow backends to override pread implementation this accidentally landed twice. Reviewed-by: Matthew Auld Cc: Matthew Auld Cc: Jason Ekstrand Cc: Daniel Vetter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210616090350.828696-1-daniel.vetter@ffwll.ch commit 9f808288ba88ac2a9582118343d4ca7e3d95dd43 Author: Martin Krastev Date: Tue Jun 15 14:23:36 2021 -0400 drm/vmwgfx: Fix build issues in mksGuestStats discovered by the kernel test robot Fixes for ARCH i386 * printk format specifier warnings * inconsistent operand constraints in an ‘asm’ errors arm64 * not targeted by the commit being fixed Reviewed-by: Zack Rusin Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats") Reported-by: kernel test robot Signed-off-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-5-zackr@vmware.com Signed-off-by: Zack Rusin commit 46e4e5ffbc2af8a6f7935648ab286902b406a01d Author: Zack Rusin Date: Tue Jun 15 14:23:35 2021 -0400 drm/vmwgfx: Fix a bad merge in otable batch takedown Change 2ef4fb92363c ("drm/vmwgfx: Make sure bo's are unpinned before putting them back") caused a conflict in one of the drm trees and the merge commit 68a32ba14177 ("Merge tag 'drm-next-2021-04-28' of git://anongit.freedesktop.org/drm/drm") accidently re-added code that the original change was removing. Fixed by removing the incorrect buffer unpin - it has already been unpinned two lines above. Fixes: 68a32ba14177 ("Merge tag 'drm-next-2021-04-28' of git://anongit.freedesktop.org/drm/drm") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-4-zackr@vmware.com commit c2aaa37dc18fb7191a0fd829a7a943f61c2821de Author: Zack Rusin Date: Tue Jun 15 14:23:34 2021 -0400 drm/vmwgfx: Fix a 64bit regression on svga3 Register accesses are always 4bytes, accidently this was changed to a void pointer whwqich badly breaks 64bit archs when running on top of svga3. Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-3-zackr@vmware.com commit ebc9ac7c3dfe85e7e29af896c7fd1095129fd72c Author: Zack Rusin Date: Tue Jun 15 14:23:33 2021 -0400 drm/vmwgfx: Update device headers Historically our device headers have been forked versions of the internal device headers, this has made maintaining them a bit of a burden. To fix the situation, going forward, the device headers will be verbatim copies of the internal headers. To do that the driver code has to be adapted to use pristine device headers. This will make future update to the device headers trivial and automatic. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-2-zackr@vmware.com commit 3f35b6b041f6f846de623dd2a10aceedf06df134 Author: Zack Rusin Date: Tue Jun 15 14:23:32 2021 -0400 MAINTAINERS: update vmwgfx info Roland will be focusing on lavapipe over the next few months and won't have time for vmwgfx. vmwgfx is now maintained within drm-misc. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-1-zackr@vmware.com commit 151ec347b06a2fb6ecd2922475dca71a7af827a5 Author: Imre Deak Date: Thu Jun 10 20:42:23 2021 +0300 drm/i915: Force a TypeC PHY disconnect during suspend/shutdown Disconnect TypeC PHYs during system suspend and shutdown, even with the corresponding TypeC sink still plugged to its connector, since leaving the PHY connected causes havoc at least during system resume in the presence of an Nvidia card. Note that this will only make a difference in the TypeC DP alternate mode, since in Thunderbolt alternate mode the PHY is never owned by the display engine and there is no notion of PHY ownership in legacy mode (the display engine being the only possible owner in that mode and the TypeC subsystem not having anything to do with the port in that case). Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3500 Reported-and-tested-by: Chris Chiu Signed-off-by: Imre Deak Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20210610174223.605904-1-imre.deak@intel.com commit 13c2ceb6addb6b14468e09b75832c98909eed8e7 Author: Matthew Auld Date: Wed Jun 16 16:25:01 2021 +0100 drm/i915/ttm: restore min_page_size behaviour We now have bo->page_alignment which perfectly describes what we need if we have min page size restrictions for lmem. We can also drop the flag here, since this is the default behaviour for all objects. v2(Thomas): - bo->page_alignment is in page units Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-7-matthew.auld@intel.com commit d53ec322dc7de32a59bf1c2a56b93e90fc2f1c28 Author: Matthew Auld Date: Wed Jun 16 16:25:00 2021 +0100 drm/i915/ttm: switch over to ttm_buddy_man Move back to the buddy allocator for managing device local memory, and restore the lost mock selftests. Keep around the range manager related bits, since we likely need this for managing stolen at some point. For stolen we also don't need to reserve anything so no need to support a generic reserve interface. v2(Thomas): - bo->page_alignment is in page units, not bytes Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-6-matthew.auld@intel.com commit 687c7d0fcf8014a006416d7dc7474a101a85bf00 Author: Matthew Auld Date: Wed Jun 16 16:24:59 2021 +0100 drm/i915/ttm: remove node usage in our naming Now that ttm_resource_manager just returns a generic ttm_resource we don't need to reference the mm_node stuff anymore which mostly only makes sense for drm_mm_node. In the next few patches we want switch over to the ttm_buddy_man which is just another type of ttm_resource so reflect that in the naming. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-5-matthew.auld@intel.com commit beb6a22911ff6f7e933670b43e4bda5be56bd8f9 Author: Matthew Auld Date: Wed Jun 16 16:24:58 2021 +0100 drm/i915/ttm: pass along the I915_BO_ALLOC_CONTIGUOUS Currently we just ignore the I915_BO_ALLOC_CONTIGUOUS flag, which is fine since everything is already contiguous with the ttm range manager. However in the next patch we want to switch over to the ttm buddy manager, where allocations are by default not contiguous. v2(Thomas): - Forward ALLOC_CONTIG for all regions Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-4-matthew.auld@intel.com commit 38f28c0695c0413b701f67105bff2573c667492a Author: Thomas Hellström Date: Wed Jun 16 16:24:57 2021 +0100 drm/i915/ttm: Calculate the object placement at get_pages time Instead of relying on a static placement, calculate at get_pages() time. This should work for LMEM regions and system for now. For stolen we need to take preallocated range into account. That will if needed be added later. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-3-matthew.auld@intel.com commit f701b16d4cc535d24facdfdd21dc97a3691e5576 Author: Matthew Auld Date: Wed Jun 16 16:24:56 2021 +0100 drm/i915/ttm: add i915_sg_from_buddy_resource We need to be able to build an sg table from our list of buddy blocks, so that we can later plug this into our ttm backend, and replace our use of the range manager. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-2-matthew.auld@intel.com commit 88be9a0a06b73ecd85a688a7c174c941e9692e92 Author: Matthew Auld Date: Wed Jun 16 16:24:55 2021 +0100 drm/i915/ttm: add ttm_buddy_man Add back our standalone i915_buddy allocator and integrate it into a ttm_resource_manager. This will plug into our ttm backend for managing device local-memory in the next couple of patches. v2(Thomas): - Return -ENOSPC from the buddy; ttm expects this in order to trigger eviction - Drop the unnecessary inline - bo->page_alignment is in page units Signed-off-by: Matthew Auld Cc: Thomas Hellström Acked-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-1-matthew.auld@intel.com commit c865204e84a1a5c35e055b45971524efe4616e31 Author: Thomas Hellström Date: Tue Jun 15 14:24:08 2021 +0200 drm/i915/ttm: Fix memory leaks Fix two memory leaks introduced with the ttm backend. Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Signed-off-by: Thomas Hellström Reviewed-by: Maarten Lankhorst Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210615122408.32347-1-thomas.hellstrom@linux.intel.com commit 544021e3f2aa3c4c6c5aabc58907e8bab69b3762 Author: Tejas Upadhyay Date: Tue Jun 15 16:26:13 2021 +0530 drm/i915/jsl: Add W/A 1409054076 for JSL When pipe A is disabled and MIPI DSI is enabled on pipe B, the AMT KVMR feature will incorrectly see pipe A as enabled. Set 0x42080 bit 23=1 before enabling DSI on pipe B and leave it set while DSI is enabled on pipe B. No impact to setting it all the time. Changes since V5: - Added reviewed-by - Removed redundant braces and debug message format - Imre Changes since V4: - Modified function comment Wa_:icl,jsl,ehl - Lucas - Modified debug message in sync state - Imre Changes since V3: - More meaningful name to workaround - Imre - Remove boolean check clear flag - Add WA_verify hook in dsi sync_state Changes since V2: - Used REG_BIT, ignored pipe A and used sw state check - Jani - Made function wrapper - Jani Changes since V1: - ./dim checkpatch errors addressed Signed-off-by: Tejas Upadhyay Reviewed-by: Imre Deak Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210615105613.851491-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit f4790083c7c23b419f6a15170556950fd6a884a2 Author: Maxime Ripard Date: Mon May 24 15:20:18 2021 +0200 drm/vc4: hdmi: Rely on interrupts to handle hotplug DRM currently polls for the HDMI connector status every 10s, which can be an issue when we connect/disconnect a display quickly or the device on the other end only issues a hotplug pulse (for example on EDID change). Switch the driver to rely on the internal controller logic for the BCM2711/RPi4. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210524132018.264396-1-maxime@cerno.tech commit ad5fd900a69b1ae24e6b22506dea637b6bbbdb55 Author: Yu Jiahua Date: Tue Jun 15 19:44:48 2021 -0800 drivers: gpu: add missing MODULE_DEVICE_TABLE in anx7625.c This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Signed-off-by: Yu Jiahua Signed-off-by: Robert Foss Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210616034448.34919-1-yujiahua1@huawei.com commit 8c209f42cb3a209c366bae2956c98d8ed0514773 Author: Clint Taylor Date: Tue Jun 8 10:47:21 2021 -0700 drm/i915/adl_p: Add initial ADL_P Workarounds Most of the context WA are already implemented. Adding adl_p platform tag to reflect so. v2: adjust comments for clarity (MattR) BSpec: 54369 Cc: Matt Roper Cc: Aditya Swarup Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Signed-off-by: Anusha Srivatsa Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: José Roberto de Souza Signed-off-by: Swathi Dhanavanthri Signed-off-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20210608174721.17593-1-clinton.a.taylor@intel.com commit bdb8d06dfefd666d5981d884b535b04105869fcc Author: Hridya Valsaraju Date: Thu Jun 3 14:47:51 2021 -0700 dmabuf: Add the capability to expose DMA-BUF stats in sysfs Overview ======== The patch adds DMA-BUF statistics to /sys/kernel/dmabuf/buffers. It allows statistics to be enabled for each DMA-BUF in sysfs by enabling the config CONFIG_DMABUF_SYSFS_STATS. The following stats will be exposed by the interface: /sys/kernel/dmabuf/buffers//exporter_name /sys/kernel/dmabuf/buffers//size /sys/kernel/dmabuf/buffers//attachments//device /sys/kernel/dmabuf/buffers//attachments//map_counter The inode_number is unique for each DMA-BUF and was added earlier [1] in order to allow userspace to track DMA-BUF usage across different processes. Use Cases ========= The interface provides a way to gather DMA-BUF per-buffer statistics from production devices. These statistics will be used to derive DMA-BUF per-exporter stats and per-device usage stats for Android Bug reports. The corresponding userspace changes can be found at [2]. Telemetry tools will also capture this information(along with other memory metrics) periodically as well as on important events like a foreground app kill (which might have been triggered by Low Memory Killer). It will also contribute to provide a snapshot of the system memory usage on other events such as OOM kills and Application Not Responding events. Background ========== Currently, there are two existing interfaces that provide information about DMA-BUFs. 1) /sys/kernel/debug/dma_buf/bufinfo debugfs is however unsuitable to be mounted in production systems and cannot be considered as an alternative to the sysfs interface being proposed. 2) proc//fdinfo/ The proc//fdinfo/ files expose information about DMA-BUF fds. However, the existing procfs interfaces can only provide information about the buffers for which processes hold fds or have the buffers mmapped into their address space. Since the procfs interfaces alone cannot provide a full picture of all DMA-BUFs in the system, there is the need for an alternate interface to provide this information on production systems. The patch contains the following major improvements over v1: 1) Each attachment is represented by its own directory to allow creating a symlink to the importing device and to also provide room for future expansion. 2) The number of distinct mappings of each attachment is exposed in a separate file. 3) The per-buffer statistics are now in /sys/kernel/dmabuf/buffers inorder to make the interface expandable in future. All of the improvements above are based on suggestions/feedback from Daniel Vetter and Christian König. A shell script that can be run on a classic Linux environment to read out the DMA-BUF statistics can be found at [3](suggested by John Stultz). [1]: https://lore.kernel.org/patchwork/patch/1088791/ [2]: https://android-review.googlesource.com/q/topic:%22dmabuf-sysfs%22+(status:open%20OR%20status:merged) [3]: https://android-review.googlesource.com/c/platform/system/memory/libmeminfo/+/1549734 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Hridya Valsaraju Reported-by: kernel test robot Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210603214758.2955251-1-hridya@google.com commit aae74ff9caa8de9a45ae2e46068c417817392a26 Author: Ainux Date: Wed May 26 19:15:15 2021 +0800 drm/ast: Add detect function support The existence of the connector cannot be detected, so add the detect function to support. Signed-off-by: Ainux Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210526111515.40015-1-ainux.wang@gmail.com commit b91e3c830f00814c0f5c2e3afaf63b48d8ccb9d3 Author: Lucas De Marchi Date: Fri Jun 11 22:35:31 2021 -0700 drm/i915/xelpd: break feature inheritance It's becoming pretty cumbersome to track the features enabled going back to GEN7. Gather the XE_LPD display features together in XE_LPD_FEATURES macro so they are sufficient to describe the display features. In ADL-P's device_info we set has_psr_hw_tracking to 0 as it would otherwise be enabled since it is inheriting from GEN12_FEATURES. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20210612053531.1870920-1-lucas.demarchi@intel.com commit c2a61865baa45b5d1dfc3e83da50bcd51d518786 Author: Linus Walleij Date: Mon Jun 14 20:11:35 2021 +0200 drm/panel: s6e63m0: Switch to DBI abstraction for SPI The SPI access to s6e63m0 is using the DBI protocol, so switch to using the elaborate DBI protocol implementation in the DRM DBI helper library. Acked-by: Noralf Trønnes Reviewed-by: Douglas Anderson Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210614181135.1124445-2-linus.walleij@linaro.org commit 413f52f146f148827dd7a61ca599143f60ae3e3c Author: Linus Walleij Date: Mon Jun 14 20:11:34 2021 +0200 drm/dbi: Support DBI typec1 read operations Implement SPI reads for typec1, for SPI controllers that can support 9bpw in addition to 8bpw (such as GPIO bit-banged SPI). 9bpw emulation is not supported but we have to start with something. This is used by s6e63m0 to read display MTP information which is used by the driver for backlight control. Reviewed-by: Noralf Trønnes Reviewed-by: Douglas Anderson Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210614181135.1124445-1-linus.walleij@linaro.org commit 440d0f12b52a920f4c78376b3ce7039ba59244c5 Author: Christian König Date: Wed May 5 13:38:12 2021 +0200 dma-buf: add dma_fence_chain_alloc/free v3 Add a common allocation helper. Cleaning up the mix of kzalloc/kmalloc and some unused code in the selftest. v2: polish kernel doc a bit v3: polish kernel doc even a bit more Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210611120301.10595-3-christian.koenig@amd.com commit 9c61e789546810ee63708568737cb990d2b86605 Author: Christian König Date: Wed May 5 11:40:54 2021 +0200 dma-buf: some dma_fence_chain improvements The callback and the irq work are never used at the same time. Putting them into an union saves us 24 bytes and makes the structure only 120 bytes in size. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210611120301.10595-2-christian.koenig@amd.com commit b4b9731b02c3ce859d85dec17ec63f4bf3140bf4 Author: Thomas Hellström Date: Thu Jun 10 16:35:25 2021 +0200 drm/i915: Simplify userptr locking Use an rwlock instead of spinlock for the global notifier lock to reduce risk of contention in execbuf. Protect object state with the object lock whenever possible rather than with the global notifier lock Don't take an explicit page_ref in userptr_submit_init() but rather call get_pages() after obtaining the page list so that get_pages() holds the page_ref. This means we don't need to call userptr_submit_fini(), which is needed to avoid awkward locking in our upcoming VM_BIND code. Signed-off-by: Thomas Hellström Reviewed-by: Maarten Lankhorst Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210610143525.624677-1-thomas.hellstrom@linux.intel.com commit 35c6367f516090a3086d37e7023b08608d555aba Author: Chris Wilson Date: Fri Jun 11 08:08:38 2021 +0200 drm/i915/selftests: Reorder tasklet_disable vs local_bh_disable Due to a change in requirements that disallows tasklet_disable() being called from atomic context, rearrange the selftest to avoid doing so. <3> [324.942939] BUG: sleeping function called from invalid context at kernel/softirq.c:888 <3> [324.942952] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5601, name: i915_selftest <4> [324.942960] 1 lock held by i915_selftest/5601: <4> [324.942963] #0: ffff888101d19240 (&dev->mutex){....}-{3:3}, at: device_driver_attach+0x18/0x50 <3> [324.942987] Preemption disabled at: <3> [324.942990] [] live_hold_reset.part.65+0xc2/0x2f0 [i915] <4> [324.943255] CPU: 0 PID: 5601 Comm: i915_selftest Tainted: G U 5.13.0-rc5-CI-CI_DRM_10197+ #1 <4> [324.943259] Hardware name: Intel Corp. Geminilake/GLK RVP2 LP4SD (07), BIOS GELKRVPA.X64.0062.B30.1708222146 08/22/2017 <4> [324.943263] Call Trace: <4> [324.943267] dump_stack+0x7f/0xad <4> [324.943276] ___might_sleep.cold.123+0xf2/0x106 <4> [324.943286] tasklet_unlock_wait+0x2e/0xb0 <4> [324.943291] ? ktime_get_raw+0x81/0x120 <4> [324.943305] live_hold_reset.part.65+0x1ab/0x2f0 [i915] <4> [324.943500] __i915_subtests.cold.7+0x42/0x92 [i915] <4> [324.943723] ? __i915_live_teardown+0x50/0x50 [i915] <4> [324.943922] ? __intel_gt_live_setup+0x30/0x30 [i915] Fixes: da044747401fc ("tasklets: Replace spin wait in tasklet_unlock_wait()") Signed-off-by: Chris Wilson Reviewed-by: Thomas Hellström Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210611060838.647973-1-thomas.hellstrom@linux.intel.com commit 0e9d217b79371d726e53d4a1beef1743952383b7 Merge: c649432e86ca6 cf3e3e86d7797 Author: Joonas Lahtinen Date: Mon Jun 14 12:24:24 2021 +0300 Merge tag 'topic/i915-ttm-2021-06-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-intel-gt-next drm-misc and drm-intel pull request for topic/i915-ttm: - Convert i915 lmem handling to ttm. - Add a patch to temporarily add a driver_private member to vma_node. - Use this to allow mixed object mmap handling for i915. Signed-off-by: Joonas Lahtinen From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/eb71ee2d-3413-6ca8-0b7c-a58695f00b77@linux.intel.com commit c649432e86ca677d8762c5764a2832509ca8d449 Author: Tvrtko Ursulin Date: Fri Jun 11 14:22:21 2021 +0100 drm/i915: Fix busy ioctl commentary Just tidy one instance of incorrect context parameter name and a stray sentence ending from before reporting was converted to be class based. Signed-off-by: Tvrtko Ursulin Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210611132221.1055650-1-tvrtko.ursulin@linux.intel.com commit ade0e676ecdcdd3428210684c76493722e09a791 Author: Leandro Ribeiro Date: Fri Jun 11 18:35:16 2021 -0300 drm/doc: document drm_mode_get_plane Add a small description and document struct fields of drm_mode_get_plane. Signed-off-by: Leandro Ribeiro Reviewed-by: Pekka Paalanen Signed-off-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20210611213516.77904-2-leandro.ribeiro@collabora.com commit bfd616ff9a2602ec66414438c3f9871a49fa1e16 Merge: 00f4471e42c87 cf3e3e86d7797 Author: Thomas Zimmermann Date: Mon Jun 14 06:56:22 2021 +0200 Merge tag 'tags/topic/i915-ttm-2021-06-11' into drm-misc-next drm-misc and drm-intel pull request for topic/i915-ttm: - Convert i915 lmem handling to ttm. - Add a patch to temporarily add a driver_private member to vma_node. - Use this to allow mixed object mmap handling for i915. commit 00f4471e42c871524c68ef1413d2fe53ce1d0a1b Merge: 352a81b71ea0a 1bd8a7dc28c1c Author: Thomas Zimmermann Date: Mon Jun 14 06:55:50 2021 +0200 Merge drm/drm-next into drm-misc-next Backmerge to prepare for i915-ttm topic branch. Signed-off-by: Thomas Zimmermann commit 352a81b71ea0a3ce8f929aa60afe369d738a0c6a Author: Zack Rusin Date: Wed Jun 9 13:23:07 2021 -0400 drm/vmwgfx: Fix implicit declaration error The declarations of ttm_range_man_init and ttm_range_man_fini have been moved to ttm_range_manager.h so we have to add it to the include list. Signed-off-by: Zack Rusin Reported-by: Randy Dunlap Fixes: 3eb7d96e9415 ("drm/ttm: flip over the range manager to self allocated nodes") Cc: Christian König Cc: Matthew Auld Reviewed-by: Martin Krastev Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-10-zackr@vmware.com commit baee602e5c0d00a7233fdb2b2bfd3ace4b5b8f29 Author: Zack Rusin Date: Wed Jun 9 13:23:06 2021 -0400 drm/vmwgfx: Remove vmw_chipset vmw_chipset was duplicating pci_id. They are exactly the same variable just with two different names. Becuase pci_id was already used to detect the SVGA version, there's no point in having vmw_chipset and thus we can remove it. All references to vmw_chipset should use pci_id. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-9-zackr@vmware.com commit b7d0949f6ce691131323fafabd48bf2f5074ae8d Author: Martin Krastev Date: Wed Jun 9 13:23:05 2021 -0400 drm/vmwgfx: Refactor vmw_mksstat_remove_ioctl to expect pgid match with vmw_mksstat_add_ioctl to authorise removal. Original vmw_mksstat_remove_ioctl expected pid to match the corresponding vmw_mksstat_add_ioctl. That made impossible en-masse removals by one pid, which is a valid use case, so pid match was discarded. Current change enforces a broader pgid match as a form of protection from arbitrary processes interrupting an ongoing mks-guest-stats. Reviewed-by: Zack Rusin Signed-off-by: Martin Krastev Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-8-zackr@vmware.com commit 8d9a8d9bd5034a88afef470664918aa914b1c3dc Author: Zack Rusin Date: Wed Jun 9 13:23:04 2021 -0400 drm/vmwgfx: inline access to the pages from the piter The indirection doesn't make sense because we always go through the same function pointer. Instead of the extra indirection lets inline the access to the current page. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-7-zackr@vmware.com commit f674a218c610bea97c106ca8179b55b2a7a7528a Author: Zack Rusin Date: Wed Jun 9 13:23:03 2021 -0400 drm/vmwgfx: remove code that was using physical page addresses This code has been unused for a while now. When the explicit checks for whether the driver is running on top of non-coherent swiotlb have been deprecated we lost the ability to fallback to physical mappings. Instead of trying to readd a module parameter to force usage of physical addresses it's better to just force coherent TTM pages via the force_coherent module parameter making this code pointless. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-6-zackr@vmware.com commit 74231041d14030f1ae6582b9233bfe782ac23e33 Author: Zack Rusin Date: Wed Jun 9 13:23:02 2021 -0400 drm/vmwgfx: Fix some static checker warnings Fix some minor issues that Coverity spotted in the code. None of that are serious but they're all valid concerns so fixing them makes sense. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-5-zackr@vmware.com commit a12be0277316ed923411c9c80b2899ee74d2b033 Author: Zack Rusin Date: Wed Jun 9 13:23:01 2021 -0400 drm/vmwgfx: Fix subresource updates with new contexts The has_dx variable was only set during the initialization which meant that UPDATE_SUBRESOURCE was never used. We were emulating it with UPDATE_GB_IMAGE but that's always been a stop-gap. Instead of has_dx which has been deprecated a long time ago we need to check for whether shader model 4.0 or newer is available to the device. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-4-zackr@vmware.com commit 7a7a933edd6c3a6d5d64e08093f2d564104cefcd Author: Martin Krastev Date: Wed Jun 9 13:23:00 2021 -0400 drm/vmwgfx: Introduce VMware mks-guest-stats VMware mks-guest-stats mechanism allows the collection of performance stats from guest userland GL contexts, as well as from vmwgfx kernelspace, via a set of sw- defined performance counters. The userspace performance counters are (de)registerd with vmware-vmx-stats hypervisor via new iocts. The vmwgfx kernelspace counters are controlled at build-time via a new config DRM_VMWGFX_MKSSTATS. * Add vmw_mksstat_{add|remove|reset}_ioctl controlling the tracking of mks-guest-stats in guest winsys contexts * Add DRM_VMWGFX_MKSSTATS config to drivers/gpu/drm/vmwgfx/Kconfig controlling the instrumentation of vmwgfx for kernelspace mks-guest-stats counters * Instrument vmwgfx vmw_execbuf_ioctl to collect mks-guest-stats according to DRM_VMWGFX_MKSSTATS Signed-off-by: Martin Krastev Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-3-zackr@vmware.com commit d92223ead97cd697abe76c5b7a78160d6910a90d Author: Zack Rusin Date: Wed Jun 9 13:22:59 2021 -0400 drm/vmwgfx: Simplify devcaps code Make devcaps code self-contained so that it's easier to cache and operate on them. As the number of devcaps got bigger the code dealing with them got more and more tricky. Lets create a central place to deal with all the complexity. This lets us remove the lock we used to require to deal with register write races because we only read the devcaps at initialization. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-2-zackr@vmware.com commit ab6f24b404c92505e82cc172d780df8f338f1d06 Author: Douglas Anderson Date: Fri Jun 11 10:17:47 2021 -0700 arm64: dts: qcom: sc7180-trogdor: Move panel under the bridge chip Putting the panel under the bridge chip (under the aux-bus node) allows the panel driver to get access to the DP AUX bus, enabling all sorts of fabulous new features. While we're at this, get rid of a level of hierarchy for the panel node. It doesn't need "ports / port" and can just have a "port" child. For Linux, this patch has a hard requirement on the patches adding DP AUX bus support to the ti-sn65dsi86 bridge chip driver. See the patch ("drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus"). Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Bjorn Andersson Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.11.Ibdb7735fb1844561b902252215a69526a14f9abd@changeid commit 4c1b3d94bf632c1420a5d4108199f55a5655831d Author: Douglas Anderson Date: Fri Jun 11 10:17:46 2021 -0700 drm/bridge: ti-sn65dsi86: Improve probe errors with dev_err_probe() As I was testing to make sure that the DEFER path worked well with my patch series, I got tired of seeing this scary message in my logs just because the panel needed to defer: [drm:ti_sn_bridge_probe] *ERROR* could not find any panel node Let's use dev_err_probe() which nicely quiets this error and also simplifies the code a tiny bit. We'll also update other places in the file which can use dev_err_probe(). Signed-off-by: Douglas Anderson Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.10.I24bba069e63b1eea84443eef0c8535fd032a6311@changeid commit a70e558c151043ce46a5e5999f4310e0b3551f57 Author: Douglas Anderson Date: Fri Jun 11 10:17:45 2021 -0700 drm/bridge: ti-sn65dsi86: Don't read EDID blob over DDC This is really just a revert of commit 58074b08c04a ("drm/bridge: ti-sn65dsi86: Read EDID blob over DDC"), resolving conflicts. The old code failed to read the EDID properly in a very important case: before the bridge's pre_enable() was called. The way things need to work: 1. Read the EDID. 2. Based on the EDID, decide on video settings and pixel clock. 3. Enable the bridge w/ the desired settings. The way things were working: 1. Try to read the EDID but fail; fall back to hardcoded values. 2. Based on hardcoded values, decide on video settings and pixel clock. 3. Enable the bridge w/ the desired settings. 4. Try again to read the EDID, it works now! 5. Realize that the hardcoded settings weren't quite right. 6. Disable / reenable the bridge w/ the right settings. The reasons for the failures were twofold: a) Since we never ran the bridge chip's pre-enable then we never set the bit to ignore HPD. This meant the bridge chip didn't even _try_ to go out on the bus and communicate with the panel. b) Even if we fixed things to ignore HPD, the EDID still wouldn't read if the panel wasn't on. Instead of reverting the code, we could fix it to set the HPD bit and also power on the panel. However, it also works nicely to just let the panel code read the EDID. Now that we've split the driver up we can expose the DDC AUX channel bus to the panel node. The panel can take charge of reading the EDID. NOTE: in order for things to work, anyone that needs to read the EDID will need to instantiate their panel using the new DP AUX bus (AKA by listing their panel under the "aux-bus" node of the bridge chip in the device tree). In the future if we want to use the bridge chip to provide a full external DP port (which won't have a panel) then we will have to conditinally add EDID reading back in. Suggested-by: Andrzej Hajda Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.9.I9330684c25f65bb318eff57f0616500f83eac3cc@changeid commit e0bbcc6233f7c664474287aaed8dcffd935a1869 Author: Douglas Anderson Date: Fri Jun 11 10:17:44 2021 -0700 drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus We want to provide our panel with access to the DP AUX channel. The way to do this is to let our panel be a child of ours using the fancy new DP AUX bus support. Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.8.Ib5fe0638da85800141ce141bb8e441c5f25438d4@changeid commit a1e3667a9835e15101cf27731219fe2581dbf572 Author: Douglas Anderson Date: Fri Jun 11 10:17:43 2021 -0700 drm/bridge: ti-sn65dsi86: Promote the AUX channel to its own sub-dev On its own, this change looks a little strange and doesn't do too much useful. To understand why we're doing this we need to look forward to future patches where we're going to probe our panel using the new DP AUX bus. See the patch ("drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus"). Let's think about the set of steps we'll want to happen when we have the DP AUX bus: 1. We'll create the DP AUX bus. 2. We'll populate the devices on the DP AUX bus (AKA our panel). 3. For setting up the bridge-related functions of ti-sn65dsi86 we'll need to get a reference to the panel. If we do #1 - #3 in a single probe call things _mostly_ will work, but it won't be massively robust. Let's explore. First let's think of the easy case of no -EPROBE_DEFER. In that case in step #2 when we populate the devices on the DP AUX bus it will actually try probing the panel right away. Since the panel probe doesn't defer then in step #3 we'll get a reference to the panel and we're golden. Second, let's think of the case when the panel returns -EPROBE_DEFER. In that case step #2 won't synchronously create the panel (it'll just add the device to the defer list to do it later). Step #3 will fail to get the panel and the bridge sub-device will return -EPROBE_DEFER. We'll depopulate the DP AUX bus. Later we'll try the whole sequence again. Presumably the panel will eventually stop returning -EPROBE_DEFER and we'll go back to the first case where things were golden. So this case is OK too even if it's a bit ugly that we have to keep creating / deleting the AUX bus over and over. So where is the problem? As I said, it's mostly about robustness. I don't believe that step #2 (creating the sub-devices) is really guaranteed to be synchronous. This is evidenced by the fact that it's allowed to "succeed" by just sticking the device on the deferred list. If anything about the process changes in Linux as a whole and step #2 just kicks off the probe of the DP AUX endpoints (our panel) in the background then we'd be in trouble because we might never get the panel in step #3. Adding an extra sub-device means we just don't need to worry about it. We'll create the sub-device for the DP AUX bus and it won't go away until the whole ti-sn65dsi86 driver goes away. If the bridge sub-device defers (maybe because it can't find the panel) that won't depopulate the DP AUX bus and so we don't need to worry about it. NOTE: there's a little bit of a trick here. Though the AUX channel can run without the MIPI-to-eDP bits of the code, the MIPI-to-eDP bits can't run without the AUX channel. We could come up a complicated signaling scheme (have the MIPI-to-eDP bits return EPROBE_DEFER for a while or wait on some sort of completion), but it seems simple enough to just not even bother creating the bridge device until the AUX channel probes. That's what we'll do. Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.7.If89144992cb9d900f8c91a8d1817dbe00f543720@changeid commit cc5a3fc041f0104d97ac61b0423ec533d7a93214 Author: Douglas Anderson Date: Fri Jun 11 10:17:42 2021 -0700 drm/panel: panel-simple: Stash DP AUX bus; allow using it for DDC If panel-simple is instantiated as a DP AUX bus endpoint then we have access to the DP AUX bus. Let's stash it in the panel-simple structure, leaving it NULL for the cases where the panel is instantiated in other ways. If we happen to have access to the DP AUX bus and we weren't provided the ddc-i2c-bus in some other manner, let's use the DP AUX bus for it. Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.6.I18e60221f6d048d14d6c50a770b15f356fa75092@changeid commit 74c06c282ae63560fcf4073d1564f054d96285ec Author: Douglas Anderson Date: Fri Jun 11 10:17:41 2021 -0700 drm/panel: panel-simple: Allow panel-simple be a DP AUX endpoint device The panel-simple driver can already have devices instantiated as platform devices or MIPI DSI devices. Let's add a 3rd way to instantiate it: as DP AUX endpoint devices. At the moment there is no benefit to instantiating it in this way, but: - In the next patch we'll give it access to the DDC channel via the DP AUX bus. - Possibly in the future we may use this channel to configure the backlight. Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.5.Iada41f76a7342354bae929d0bb3ceba40f27f0ea@changeid commit aeb33699fc2c97994de0e9acb74d0fd319380614 Author: Douglas Anderson Date: Fri Jun 11 10:17:40 2021 -0700 drm: Introduce the DP AUX bus Historically "simple" eDP panels have been handled by panel-simple which is a basic platform_device. In the device tree, the panel node was at the top level and not connected to anything else. Let's change it so that, instead, panels can be represented as being children of the "DP AUX bus". Essentially we're saying that the hierarchy that we're going to represent is the "control" connections between devices. The DP AUX bus is a control bus provided by an eDP controller (the parent) and consumed by a device like a panel (the child). The primary incentive here is to cleanly provide the panel driver the ability to communicate over the AUX bus while handling lifetime issues properly. The panel driver may want the AUX bus for controlling the backlight or querying the panel's EDID. The idea for this bus's design was hashed out over IRC [1]. [1] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2021-05-11 Cc: Laurent Pinchart Cc: Lyude Paul Cc: Rajeev Nandan Suggested-by: Laurent Pinchart Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.4.I787c9ba09ed5ce12500326ded73a4f7c9265b1b3@changeid commit 476c864dd4655bea0f7aed2845ab18ef47c4bf94 Author: Douglas Anderson Date: Fri Jun 11 10:17:39 2021 -0700 dt-bindings: drm/bridge: ti-sn65dsi86: Add aux-bus child The patch ("dt-bindings: drm: Introduce the DP AUX bus") talks about how using the DP AUX bus is better than learning how to slice bread. Let's add it to the ti-sn65dsi86 bindings. Signed-off-by: Douglas Anderson Reviewed-by: Rob Herring Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.3.I98bf729846c37c4c143f6ab88b1e299280e2fe26@changeid commit feac44bad7d7bcbac3f91bc38392e94133813ac8 Author: Douglas Anderson Date: Fri Jun 11 10:17:38 2021 -0700 dt-bindings: drm: Introduce the DP AUX bus We want to be able to list an eDP panel as a child of an eDP controller node to represent the fact that the panel is connected to the controller's DP AUX bus. Though the panel and the controller are connected in several ways, the DP AUX bus is the primary control interface between the two and thus makes the most sense to model in device tree hierarchy. Listing a panel in this way makes it possible for the panel driver to easily get access to the DP AUX bus that it resides on, which can be useful to help in auto-detecting the panel and for turning on various bits. NOTE: historically eDP panels were _not_ listed under their controller but were listed at the top level of the device tree. This will still be supported for backward compatibility (and while DP controller drivers are adapted to support the new DT syntax) but should be considered deprecated since there is no downside to listing the panel under the controller. For now, the DP AUX bus bindings will only support an eDP panel underneath. It's possible it could be extended to allow having a DP connector under it in the future. NOTE: there is no "Example" in this bindings file. Yikes! This avoids duplicating the same example lots of places. See users of the aux bus (like ti-sn65dsi86) for examples. The idea for this bus's design was hashed out over IRC [1]. [1] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2021-05-11 Signed-off-by: Douglas Anderson Reviewed-by: Rob Herring Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.2.Id3c048d22e72a9f90084a543b5b4e3f43bc9ab62@changeid commit 557acb5ffd458dbd76c84b2caa303dfd113d50c7 Author: Douglas Anderson Date: Fri Jun 11 10:17:37 2021 -0700 dt-bindings: display: simple: List hpd properties in panel-simple The HPD (Hot Plug Detect) signal is present in many (probably even "most") eDP panels. For eDP, this signal isn't actually used for detecting hot-plugs of the panel but is more akin to a "panel ready" signal. After you provide power to the panel, panel timing diagrams typically say that you should wait for HPD to be asserted (or wait a fixed amount of time) before talking to the panel. The panel-simple bindings describes many eDP panels and many of these panels provide the HPD signal. We should add the HPD-related properties to the panel-simple bindings. The HPD properties are actually defined in panel-common.yaml, so adding them here just documents that they are OK for panels handled by the panel-simple bindings. NOTE: whether or not we'd include HPD properties in the panel node is more a property of the board design than the panel itself. For most boards using these eDP panels everything "magically" works without specifying any HPD properties and that's been why we haven't needed to allow the HPD properties earlier. On these boards the HPD signal goes directly to a dedicated "HPD" input to the eDP controller and this connection doesn't need to be described in the device tree. The only time the HPD properties are needed in the device tree are if HPD is hooked up to a GPIO or if HPD is normally on the panel but isn't used on a given board. That means that if we don't allow the HPD properties in panel-simple then one could argue that we've got to boot all eDP panels (or at least all those that someone could conceivably put on a system where HPD goes to a GPIO or isn't hooked up) from panel-simple. Signed-off-by: Douglas Anderson Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.1.Ieb731d23680db4700cc41fe51ccc73ba0b785fb7@changeid commit 0ea02bb8bc7a16446169bfae46938ea3a195db5d Author: José Roberto de Souza Date: Thu Jun 10 12:45:27 2021 -0700 Revert "drm/i915/display: Drop FIXME about turn off infoframes" Looks this FIXME is still valid as we need a way to tell LSPCON to stop sending infoframes, so reverting it. This reverts commit 3f409e4cd579b287a6c41d017e62c392f7997193. Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210610194527.84997-1-jose.souza@intel.com commit f42498705965bd4b026953c1892c686d8b1138e4 Author: Wei Yongjun Date: Tue Jun 8 14:38:56 2021 +0000 drm/panfrost: Fix missing clk_disable_unprepare() on error in panfrost_clk_init() Fix the missing clk_disable_unprepare() before return from panfrost_clk_init() in the error handling case. Fixes: b681af0bc1cc ("drm: panfrost: add optional bus_clock") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210608143856.4154766-1-weiyongjun1@huawei.com commit cf3e3e86d77970211e0983130e896ae242601003 Author: Maarten Lankhorst Date: Thu Jun 10 09:01:52 2021 +0200 drm/i915: Use ttm mmap handling for ttm bo's. Use the ttm handlers for servicing page faults, and vm_access. We do our own validation of read-only access, otherwise use the ttm handlers as much as possible. Because the ttm handlers expect the vma_node at vma->base, we slightly need to massage the mmap handlers to look at vma_node->driver_private to fetch the bo, if it's NULL, we assume i915's normal mmap_offset uapi is used. This is the easiest way to achieve compatibility without changing ttm's semantics. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-5-thomas.hellstrom@linux.intel.com commit f425821b946847282708121600fffc20344183a0 Author: Maarten Lankhorst Date: Thu Jun 10 09:01:51 2021 +0200 drm/vma: Add a driver_private member to vma_node. This allows drivers to distinguish between different types of vma_node's. The readonly flag was unused and is thus removed. This is a temporary solution, until i915 is converted completely to use ttm for bo's. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström Acked-by: Daniel Vetter #irc Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-4-thomas.hellstrom@linux.intel.com commit 2e53d7c1147a2751e959c53970c61b7ae33e1ecb Author: Thomas Hellström Date: Thu Jun 10 09:01:50 2021 +0200 drm/i915/lmem: Verify checks for lmem residency Since objects can be migrated or evicted when not pinned or locked, update the checks for lmem residency or future residency so that the value returned is not immediately stale. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-3-thomas.hellstrom@linux.intel.com commit 213d5092776345ad5d6e2efa36a6bfbe9899e8b3 Author: Thomas Hellström Date: Thu Jun 10 09:01:49 2021 +0200 drm/i915/ttm: Introduce a TTM i915 gem object backend Most logical place to introduce TTM buffer objects is as an i915 gem object backend. We need to add some ops to account for added functionality like delayed delete and LRU list manipulation. Initially we support only LMEM and SYSTEM memory, but SYSTEM (which in this case means evicted LMEM objects) is not visible to i915 GEM yet. The plan is to move the i915 gem system region over to the TTM system memory type in upcoming patches. We set up GPU bindings directly both from LMEM and from the system region, as there is no need to use the legacy TTM_TT memory type. We reserve that for future porting of GGTT bindings to TTM. Remove the old lmem backend. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-2-thomas.hellstrom@linux.intel.com commit cea08169ad4ce46c222a223d8f71db6d9c3f1385 Author: Zhang Qilong Date: Mon May 31 22:25:42 2021 +0800 bus: ti-sysc: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code. Signed-off-by: Zhang Qilong Signed-off-by: Tony Lindgren commit 4e0018530c2edc5846a737222059661a2ae77522 Author: Lee Jones Date: Wed May 26 09:10:37 2021 +0100 bus: ti-sysc: Correct misdocumentation of 'sysc_ioremap()' Fixes the following W=1 kernel build warning(s): drivers/bus/ti-sysc.c:867: warning: expecting prototype for syc_ioremap(). Prototype was for sysc_ioremap() instead Cc: Tony Lindgren Cc: Philipp Zabel Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Tony Lindgren commit a3a5f9d0fb15da90820254ba735491887cc12099 Author: Linus Walleij Date: Fri Jun 11 00:05:27 2021 +0200 drm/panel: db7430: Add driver for Samsung DB7430 This adds a new driver for the Samsung DB7430 DPI display controller as controlled over SPI. Right now the only panel product we know that is using this display controller is the LMS397KF04 but there may be more. This is the first regular panel driver making use of the MIPI DBI helper library. The DBI "device" portions can not be used because that code assumes the use of a single regulator and specific timings around the reset pulse that do not match the DB7430 datasheet. Cc: Paul Cercueil Cc: Doug Anderson Acked-by: Noralf Trønnes Signed-off-by: Linus Walleij Reviewed-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20210610220527.366432-1-linus.walleij@linaro.org commit 26594678d00f94c62f2e43162bd6d10fd0b74917 Author: Leandro Ribeiro Date: Wed Jun 9 20:00:38 2021 -0300 drm/doc: document how userspace should find out CRTC index In this patch we add a section to document what userspace should do to find out the CRTC index. This is important as they may be many places in the documentation that need this, so it's better to just point to this section and avoid repetition. Signed-off-by: Leandro Ribeiro Reviewed-by: Pekka Paalanen Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210609230039.73307-2-leandro.ribeiro@collabora.com commit a3af0140663dc335e5c18277a61bb99bfcb60694 Author: Emil Velikov Date: Fri Jun 4 16:49:05 2021 +0100 drm/i915: apply WaEnableVGAAccessThroughIOPort as needed Currently as the workaround is applied the screen flickers. As a result we do not achieve seamless boot experience. Avoiding the issue in the common use-case might be hard, although we can resolve it for dual GPU setups - when the "other" GPU is primary and/or outputs are connected to it. With this I was able to get seamless experience on my Intel/Nvidia box, running systemd-boot and sddm/Xorg. Note that the i915 driver is within initrd while the Nvidia one is not. Without this patch, the splash presented by systemd-boot (UEFI BGRT) is torn down as the code-path kicks in, leaving the monitor blank until the login manager starts. Same issue were reported with plymouth/grub, although personally I wasn't able to get them to behave on my setup. Suggested-by: Ville Syrjälä Signed-off-by: Emil Velikov Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210604154905.660142-1-emil.l.velikov@gmail.com commit 86441fa29e57940eeb00f35fefb1853c1fbe67bb Merge: d098775ed4402 c707b73f0cfb1 Author: Thomas Zimmermann Date: Thu Jun 10 12:18:54 2021 +0200 Merge drm/drm-next into drm-misc-next Backmerging to pick up the latest TTM patches plus conflict resolution. Signed-off-by: Thomas Zimmermann commit d098775ed44021293b1962dea61efb19297b8d02 Author: Christian König Date: Wed Jun 9 19:25:56 2021 +0200 drm/nouveau: init the base GEM fields for internal BOs TTMs buffer objects are based on GEM objects for quite a while and rely on initializing those fields before initializing the TTM BO. Nouveau now doesn't init the GEM object for internally allocated BOs, so make sure that we at least initialize some necessary fields. Signed-off-by: Christian König Tested-by: Mikko Perttunen Reviewed-by: Matthew Auld Reviewed-by: Huang Rui Link: https://patchwork.freedesktop.org/patch/msgid/20210609172902.1937-1-christian.koenig@amd.com commit 16c243e99d335e1ef3059871897119affc98b493 Author: Vivek Kasireddy Date: Wed Jun 9 11:29:15 2021 -0700 udmabuf: Add support for mapping hugepages (v4) If the VMM's (Qemu) memory backend is backed up by memfd + Hugepages (hugetlbfs and not THP), we have to first find the hugepage(s) where the Guest allocations are located and then extract the regular 4k sized subpages from them. v2: Ensure that the subpage and hugepage offsets are calculated correctly when the range of subpage allocations cuts across multiple hugepages. v3: Instead of repeatedly looking up the hugepage for each subpage, only do it when the subpage allocation crosses over into a different hugepage. (suggested by Gerd and DW) v4: Fix the following warning identified by checkpatch: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Signed-off-by: Dongwon Kim Link: http://patchwork.freedesktop.org/patch/msgid/20210609182915.592743-1-vivek.kasireddy@intel.com [ kraxel: one more checkpatch format tweak ] Signed-off-by: Gerd Hoffmann commit 6eca310e8924ab98c73b81dfd39e7dd553ceddfd Author: Lyude Paul Date: Fri May 14 14:15:03 2021 -0400 drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau This adds support for controlling panel backlights over eDP using VESA's standard backlight control interface. Luckily, Nvidia was cool enough to never come up with their own proprietary backlight control interface (at least, not any that I or the laptop manufacturers I've talked to are aware of), so this should work for any laptop panels which support the VESA backlight control interface. Note that we don't yet provide the panel backlight frequency to the DRM DP backlight helpers. This should be fine for the time being, since it's not required to get basic backlight controls working. For reference: there's some mentions of PWM backlight values in nouveau_reg.h, but I'm not sure these are the values we would want to use. If we figure out how to get this information in the future, we'll have the benefit of more granular backlight control. Signed-off-by: Lyude Paul Reviewed-by: Ben Skeggs Cc: Jani Nikula Cc: Dave Airlie Cc: greg.depoire@gmail.com Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-10-lyude@redhat.com commit 867cf9cd73c3d31666e4b480aa4f52828d25ac94 Author: Lyude Paul Date: Fri May 14 14:15:02 2021 -0400 drm/dp: Extract i915's eDP backlight code into DRM helpers Since we're about to implement eDP backlight support in nouveau using the standard protocol from VESA, we might as well just take the code that's already written for this and move it into a set of shared DRM helpers. Note that these helpers are intended to handle DPCD related backlight control bits such as setting the brightness level over AUX, probing the backlight's TCON, enabling/disabling the backlight over AUX if supported, etc. Any PWM-related portions of backlight control are explicitly left up to the driver, as these will vary from platform to platform. The only exception to this is the calculation of the PWM frequency pre-divider value. This is because the only platform-specific information required for this is the PWM frequency of the panel, which the driver is expected to provide if available. The actual algorithm for calculating this value is standard and is defined in the eDP specification from VESA. Note that these helpers do not yet implement the full range of features the VESA backlight interface provides, and only provide the following functionality (all of which was already present in i915's DPCD backlight support): * Basic control of brightness levels * Basic probing of backlight capabilities * Helpers for enabling and disabling the backlight v3: * Split out changes to i915's backlight code to separate patches to make it easier to review v4: * Style/spelling changes from Thomas Zimmermann v5: * Start using new drm_dbg_*() functions Signed-off-by: Lyude Paul Cc: Jani Nikula Cc: Dave Airlie Cc: greg.depoire@gmail.com Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-9-lyude@redhat.com commit 837f93247634b12e5eebb3d707405b701a4f3479 Author: Lyude Paul Date: Fri May 14 14:15:01 2021 -0400 drm/i915/dpcd_bl: Print return codes for VESA backlight failures Also, stop printing the DPCD register that failed, and just describe it instead. Saves us from having to look up each register offset when reading through kernel logs (plus, DPCD dumping with drm.debug |= 0x100 will give us that anyway). Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-8-lyude@redhat.com commit 17917ff62443414569ea76e151e7a7ef44812264 Author: Lyude Paul Date: Fri May 14 14:15:00 2021 -0400 drm/i915/dpcd_bl: Return early in vesa_calc_max_backlight if we can't read PWMGEN_BIT_COUNT If we can't read DP_EDP_PWMGEN_BIT_COUNT in intel_dp_aux_vesa_calc_max_backlight() but do have a valid PWM frequency defined in the VBT, we'll keep going in the function until we inevitably fail on reading DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN. There's not much point in doing this, so just return early. Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-7-lyude@redhat.com commit ade673bb2ba496a66250c5c2006c502c3d734ea2 Author: Lyude Paul Date: Fri May 14 14:14:59 2021 -0400 drm/i915/dpcd_bl: Move VESA backlight enabling code closer together No functional changes, just move set_vesa_backlight_enable() closer to it's only caller: intel_dp_aux_vesa_enable_backlight(). Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-6-lyude@redhat.com commit 3b51c2bb6f5f3f8a88fe9f4ab62e38496b2d200b Author: Lyude Paul Date: Fri May 14 14:14:58 2021 -0400 drm/i915/dpcd_bl: Cache some backlight capabilities in intel_panel.backlight Since we're about to be moving this code into shared DRM helpers, we might as well start to cache certain backlight capabilities that can be determined from the EDP DPCD, and are likely to be relevant to the majority of drivers using said helpers. The main purpose of this is just to prevent every driver from having to check everything against the eDP DPCD using DP macros, which makes the code slightly easier to read (especially since the names of some of the eDP capabilities don't exactly match up with what we actually need to use them for, like DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT for instance). Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-5-lyude@redhat.com commit 46e745a8edc8c2a2fe4fdc491d7e39598e104441 Author: Lyude Paul Date: Fri May 14 14:14:57 2021 -0400 drm/i915/dpcd_bl: Cleanup intel_dp_aux_vesa_enable_backlight() a bit Get rid of the extraneous switch case in here, and just open code edp_backlight_mode as we only ever use it once. v4: * Check that backlight mode is DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD, not DP_EDP_BACKLIGHT_CONTROL_MODE_MASK - imirkin Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-4-lyude@redhat.com commit 3faea9939a3d1eb5a40f3f6100c24792865b6445 Author: Lyude Paul Date: Fri May 14 14:14:56 2021 -0400 drm/i915/dpcd_bl: Handle drm_dpcd_read/write() return values correctly This is kind of an annoying aspect of DRM's DP helpers: drm_dp_dpcd_readb/writeb() return the size of bytes read/written on success, thus we want to check against that instead of checking if the return value is less than 0. I'll probably be fixing this in the near future once I start doing DP work again, also because I'd rather not mix a tree-wide refactor like that in with a patch series intended to be around introducing DP backlight helpers. So, for now let's just handle the return values from each function correctly. Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-3-lyude@redhat.com commit 4154fa0e2688118ba3dbc67aa834435463f9ea68 Author: Lyude Paul Date: Fri May 14 14:14:55 2021 -0400 drm/i915/dpcd_bl: Remove redundant AUX backlight frequency calculations Noticed this while moving all of the VESA backlight code in i915 over to DRM helpers: it would appear that we calculate the frequency value we want to write to DP_EDP_BACKLIGHT_FREQ_SET twice even though this value never actually changes during runtime. So, let's simplify things by just caching this value in intel_panel.backlight, and re-writing it as-needed. Changes since v1: * Wrap panel->backlight.edp.vesa.pwm_freq_pre_divider in DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP check - Jani Signed-off-by: Lyude Paul Cc: Jani Nikula Cc: Dave Airlie Cc: greg.depoire@gmail.com Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-2-lyude@redhat.com commit c784e46c8445635afd81bd4089fc5e87271a8f3b Author: Ralf Schlatterbeck Date: Wed May 19 13:54:51 2021 +0200 auxdisplay: Add I2C gpio expander example The hd44780 displays are often used with pcf8574 based I/O expanders. Add example to documentation. Suggested-by: Geert Uytterhoeven Signed-off-by: Ralf Schlatterbeck [Added Suggested-by tag] Signed-off-by: Miguel Ojeda commit 241a9e233e7cf1001d09426c9fc520768f8961bf Author: Marek Vasut Date: Tue Jun 8 16:22:11 2021 +0200 drm/bridge: ti-sn65dsi83: Fix sparse warnings Fix the following sparse warnings generated by "make C=1": drivers/gpu/drm/bridge/ti-sn65dsi83.c:429:13: warning: incorrect type in assignment (different base types) drivers/gpu/drm/bridge/ti-sn65dsi83.c:429:13: expected unsigned short [assigned] [usertype] val drivers/gpu/drm/bridge/ti-sn65dsi83.c:429:13: got restricted __le16 [usertype] drivers/gpu/drm/bridge/ti-sn65dsi83.c:432:13: warning: incorrect type in assignment (different base types) drivers/gpu/drm/bridge/ti-sn65dsi83.c:432:13: expected unsigned short [addressable] [assigned] [usertype] val drivers/gpu/drm/bridge/ti-sn65dsi83.c:432:13: got restricted __le16 [usertype] drivers/gpu/drm/bridge/ti-sn65dsi83.c:436:13: warning: incorrect type in assignment (different base types) drivers/gpu/drm/bridge/ti-sn65dsi83.c:436:13: expected unsigned short [addressable] [assigned] [usertype] val drivers/gpu/drm/bridge/ti-sn65dsi83.c:436:13: got restricted __le16 [usertype] drivers/gpu/drm/bridge/ti-sn65dsi83.c:438:13: warning: incorrect type in assignment (different base types) drivers/gpu/drm/bridge/ti-sn65dsi83.c:438:13: expected unsigned short [addressable] [assigned] [usertype] val drivers/gpu/drm/bridge/ti-sn65dsi83.c:438:13: got restricted __le16 [usertype] drivers/gpu/drm/bridge/ti-sn65dsi83.c:441:13: warning: incorrect type in assignment (different base types) drivers/gpu/drm/bridge/ti-sn65dsi83.c:441:13: expected unsigned short [addressable] [assigned] [usertype] val drivers/gpu/drm/bridge/ti-sn65dsi83.c:441:13: got restricted __le16 [usertype] Signed-off-by: Marek Vasut Cc: Adam Ford Cc: Douglas Anderson Cc: Frieder Schrempf Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Loic Poulain Cc: Marek Vasut Cc: Philippe Schenker Cc: Robert Foss Cc: Sam Ravnborg Cc: Stephen Boyd Cc: Valentin Raevsky To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210608142211.82333-1-marex@denx.de commit be8bcf8baaec8e063da56797dda48075bb8198d2 Merge: 015b1dc381fdc 99f45259fe121 Author: Steve French Date: Wed Jun 9 03:48:30 2021 -0500 Merge pull request #55 from namjaejeon/cifsd-for-next cifsd-fixes commit 99f45259fe121a10881f486e075019260f403b6a Author: Hyunchul Lee Date: Wed Jun 9 10:06:57 2021 +0900 cifsd: append ksmbd prefix into names for asn1 decoder Because functions and variables generated from ASN1 compiler aren't static, append ksmbd prefix into thoses to avoid link errors. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 015b1dc381fdcfa04524c6f02c2fc2d5d14bdd10 Merge: ce95240b5d8c0 3aefd54da5ec6 Author: Steve French Date: Mon Jun 7 01:59:19 2021 -0500 Merge pull request #54 from namjaejeon/cifsd-for-next cifsd-fixes commit 3aefd54da5ec6e7ec1f1e682007f5819c99d8588 Author: Wan Jiabing Date: Mon Jun 7 12:54:32 2021 +0800 cifsd: remove duplicated argument Fix the following coccicheck warning: ./fs/cifsd/smb2pdu.c:1713:27-41: duplicated argument to & or | FILE_DELETE_LE is duplicated. Remove one and reorder argument to make coding style reasonable. Signed-off-by: Wan Jiabing Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d4b26c285802d3088342ff4ddf4d287d540c929e Author: Hyunchul Lee Date: Sun Jun 6 11:42:25 2021 +0900 cifsd: fix possible compile error for asn1.c spnego_negtokeninit.asn1.h and spnego_negtokentarg.asn1.h have to be generated before asn1.o is compiled. Because of parallel build, the dependency could be broken, we need to specify the dependency in Makefile. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ade62d8b429fe49325593785316bdee3cabaec44 Author: Namjae Jeon Date: Mon Jun 7 09:22:22 2021 +0900 cifsd: set epoch in smb2_lease_break response When running generic/591 after smb2 leases is enable, all smb2 lease ack requests failed in ksmbd. because cifs client seems to support only smb2 v2 lease. So cifs doesn't update lease state in ack request if epoch is not set in smb2 lease break request from ksmbd. epoch is used for smb2 v2 leases. So this patch add smb2 create v2 lease context and set increased epoch in smb2 lease break response. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6c4e675ad3594526d6604a7d30f1defdd08a42e4 Author: Namjae Jeon Date: Mon Jun 7 09:08:45 2021 +0900 cifsd: fix list_add double add BUG_ON trap in setup_async_work() BUG_ON trap is coming when running xfstests generic/591 and smb2 leases = yes in smb.conf. [ 597.224978] list_add double add: new=ffff9110d292bb20, prev=ffff9110d292bb20, next=ffff9110d6c389e8. [ 597.225073] ------------[ cut here ]------------ [ 597.225077] kernel BUG at lib/list_debug.c:31! [ 597.225090] invalid opcode: 0000 [#1] SMP PTI [ 597.225095] CPU: 2 PID: 501 Comm: kworker/2:3 Tainted: G OE 5.13.0-rc1+ #2 [ 597.225099] Hardware name: SAMSUNG ELECTRONICS CO., LTD. Samsung DeskTop System/SAMSUNG_DT1234567890, BIOS P04KBM.022.121023.SK 10/23/2012 [ 597.225102] Workqueue: ksmbd-io handle_ksmbd_work [ksmbd] [ 597.225125] RIP: 0010:__list_add_valid+0x66/0x70 [ 597.225132] Code: 0b 48 89 c1 4c 89 c6 48 c7 c7 c8 08 c0 95 e8 fd 54 66 00 0f 0b 48 89 f2 4c 89 c1 48 89 fe 48 c7 c7 20 09 c0 95 e8 e6 54 66 00 <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 8b 07 48 b9 00 01 00 00 00 00 [ 597.225136] RSP: 0018:ffffb9c9408dbac0 EFLAGS: 00010282 [ 597.225139] RAX: 0000000000000058 RBX: ffff9110d292ba40 RCX: 0000000000000000 [ 597.225142] RDX: 0000000000000000 RSI: ffff9111da328c30 RDI: ffff9111da328c30 [ 597.225144] RBP: ffffb9c9408dbac0 R08: 0000000000000001 R09: 0000000000000001 [ 597.225147] R10: 0000000003dd35ed R11: ffffb9c9408db888 R12: ffff9110d6c38998 [ 597.225149] R13: ffff9110d6c38800 R14: ffff9110d292bb20 R15: ffff9110d292bb20 [ 597.225152] FS: 0000000000000000(0000) GS:ffff9111da300000(0000) knlGS:0000000000000000 [ 597.225155] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 597.225157] CR2: 00007fd1629f84d0 CR3: 00000000c9a12006 CR4: 00000000001706e0 [ 597.225160] Call Trace: [ 597.225163] setup_async_work+0xa2/0x120 [ksmbd] [ 597.225191] oplock_break+0x396/0x5d0 [ksmbd] [ 597.225206] smb_grant_oplock+0x7a1/0x900 [ksmbd] [ 597.225218] ? smb_grant_oplock+0x7a1/0x900 [ksmbd] [ 597.225231] smb2_open+0xbbb/0x2960 [ksmbd] [ 597.225243] ? smb2_open+0xbbb/0x2960 [ksmbd] [ 597.225257] ? find_held_lock+0x35/0xa0 [ 597.225261] ? xa_load+0xaf/0x160 [ 597.225268] handle_ksmbd_work+0x2e0/0x420 [ksmbd] [ 597.225280] ? handle_ksmbd_work+0x2e0/0x420 [ksmbd] [ 597.225292] process_one_work+0x25a/0x5d0 [ 597.225298] worker_thread+0x3f/0x3a0 [ 597.225302] ? __kthread_parkme+0x6f/0xa0 [ 597.225306] ? process_one_work+0x5d0/0x5d0 [ 597.225309] kthread+0x142/0x160 [ 597.225313] ? kthread_park+0x90/0x90 [ 597.225316] ret_from_fork+0x22/0x30 same work struct can be add to list in smb_break_all_write_oplock() and smb_grant_oplock(). If client send invalid lease break ack to server, This issue can occur by calling both functions. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ce95240b5d8c01eefa95cfe7ce7c78a061ee695d Merge: 55b4fcdf0fe8e 97d7f3d3e0e71 Author: Steve French Date: Tue Jun 1 02:21:34 2021 -0500 Merge pull request #53 from namjaejeon/cifsd-for-next cifsd-fixes commit 97d7f3d3e0e719db42c4f413531e4e417fadf0c1 Author: Namjae Jeon Date: Tue Jun 1 13:18:44 2021 +0900 cifsd: fix additional warnings from checkpatch.pl --strict Fix additional warnings from checkpatch.pl --strict. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 55b4fcdf0fe8e36d180dcca90a7a293de20f703a Merge: 10a96b2b45e0d 2ae1a6cc43027 Author: Steve French Date: Mon May 31 20:13:30 2021 -0500 Merge pull request #52 from namjaejeon/cifsd-for-next cifsd-fixes commit 2ae1a6cc43027d84e33819ac4376c5e5e11b4152 Author: Namjae Jeon Date: Mon May 31 17:26:43 2021 +0900 cifsd: fix potential read overflow in ksmbd_vfs_stream_read() If *pos or *pos + count is greater than v_len, It will read beyond the stream_buf buffer. This patch add the check and cut down count with size of the buffer. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fd6de099d7fabc2b86f51dc622453eb279f7cce9 Author: Yang Yingliang Date: Mon May 31 17:25:05 2021 +0900 cifsd: check return value of ksmbd_vfs_getcasexattr() correctly If ksmbd_vfs_getcasexattr() returns -ENOMEM, stream_buf is NULL, it will cause null-ptr-deref when using it to copy memory. So we need check the return value of ksmbd_vfs_getcasexattr() by comparing with 0. Signed-off-by: Yang Yingliang Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 673b9ba7a1404fa5beda936b8ad509b70a516b52 Author: Yang Yingliang Date: Sat May 29 16:20:57 2021 +0800 cifsd: fix memleak in ksmbd_vfs_stream_read() Before ksmbd_vfs_stream_read() return, memory allocate in ksmbd_vfs_getcasexattr() need be freed. Signed-off-by: Yang Yingliang Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 113ef68d47f5d36611c16a6ef4bd2a837aa344ab Author: Yang Yingliang Date: Sat May 29 16:20:56 2021 +0800 cifsd: fix memleak in ksmbd_vfs_stream_write() Before assigning wbuf to stream_buf, memory allocate in ksmbd_vfs_getcasexattr() need be freed. Signed-off-by: Yang Yingliang Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d7e5852b4deb121e2c929b2bb7440c5db3e2f90a Author: Hyunchul Lee Date: Sat May 29 09:59:59 2021 +0900 cifsd: make alignment match open parenthesis checkpatch.pl complains as the following: Alignment should match open parenthesis. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 40c594b647660bf91bc95fe7c9358bff7f56cf2e Author: Hyunchul Lee Date: Sat May 29 22:46:53 2021 +0900 cifsd: enclose macro variables in parenthesis checkpatch.pl complains as the following: CHECK: Macro argument 'fp' may be better as '(fp)' to avoid precedence issues. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 10a96b2b45e0d1fb7d6ecd7fa7fc4d3ee9915c2b Merge: bfe6cb0ce5dd3 152de8c68d138 Author: Steve French Date: Fri May 28 18:07:24 2021 -0500 Merge pull request #51 from namjaejeon/cifsd-for-next cifsd-fixes commit 152de8c68d13845592e8e511136842bcdb691063 Author: Namjae Jeon Date: Sat May 29 07:59:40 2021 +0900 cifsd: fix Control flow issues in ksmbd_build_ntlmssp_challenge_blob() Fix a defect reported by Coverity Scan. *** CID 1504970: Control flow issues (NO_EFFECT) /fs/cifsd/auth.c: 622 in ksmbd_build_ntlmssp_challenge_blob() 616 name = kmalloc(2 + UNICODE_LEN(len), GFP_KERNEL); 617 if (!name) 618 return -ENOMEM; 619 620 conv_len = smb_strtoUTF16((__le16 *)name, ksmbd_netbios_name(), len, 621 sess->conn->local_nls); >>> CID 1504970: Control flow issues (NO_EFFECT) >>> This less-than-zero comparison of an unsigned value is never true. 622 if (conv_len < 0 || conv_len > len) { 623 kfree(name); 624 return -EINVAL; 625 } 626 627 uni_len = UNICODE_LEN(conv_len); Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bfe6cb0ce5dd3d910566f1044a2cbc8c85b2391e Merge: 4ead0568f798b a6a5fa77805b2 Author: Steve French Date: Thu May 27 07:10:44 2021 -0500 Merge pull request #50 from namjaejeon/cifsd-for-next Cifsd for next commit a6a5fa77805b291afc90291a6ae705b1759b9735 Author: Hyunchul Lee Date: Wed May 26 18:59:06 2021 +0900 cifsd: lookup a file with LOOKUP_FOLLOW only if 'follow symlinks = yes' Some vfs help functions lookup a file with LOOKUP_FOLLOW regardless of the "follow symlinks" option. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fc2d1b58c4f2c7240093d738ca99cfcf7a8b3107 Author: Namjae Jeon Date: Wed May 26 18:01:08 2021 +0900 cifsd: Prefer kernel type 'u16' over 'uint16_t' Fix a warning from checkpatch.pl --strict: CHECK: Prefer kernel type 'u16' over 'uint16_t' #112: FILE: server.c:112: + uint16_t command; Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c986ed981ae6a622a453c533389994b6aed6359b Author: Namjae Jeon Date: Wed May 26 17:59:56 2021 +0900 cifsd: remove unnecessary parentheses around Fix warnings from checkpatch.pl --strict : CHECK: Unnecessary parentheses around 'brk_op->o_lease->new_state == SMB2_LEASE_NONE_LE' #1511: FILE: oplock.c:1511: + if (brk_op->is_lease && + (brk_op->o_lease->new_state == SMB2_LEASE_NONE_LE) && + atomic_read(&brk_op->breaking_cnt)) Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 070fb21e5912b6aa22509083aaca030d1f4e7d57 Author: Namjae Jeon Date: Wed May 26 17:57:12 2021 +0900 cifsd: Alignment should match open parenthesis Fix warnings "Alignment should match open parenthesis" from checkpatch.pl --strict. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fe30ea69ff81f99607b0e4002ef9ae12e4694b31 Author: Namjae Jeon Date: Wed May 26 16:45:24 2021 +0900 cifsd: Blank lines aren't necessary after an open brace '{' Blank lines aren't necessary after an open brace '{'. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 10268f7d5755f42e50e862505e7bac992d284546 Author: Namjae Jeon Date: Wed May 26 16:44:21 2021 +0900 cifsd: No space is necessary after a cast No space is necessary after a cast. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2f5205c2377c0a3c501a33092c91a45e074bfc04 Author: Namjae Jeon Date: Wed May 26 16:43:31 2021 +0900 cifsd: don't use multiple blank lines don't use multiple blank lines. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c8ed11522b4acbe378687b6388ceffd72e72d736 Author: Namjae Jeon Date: Wed May 26 16:42:12 2021 +0900 cifsd: spaces preferred around that '/' Fix "CHECK: paces preferred around that '/' from checkpatch.pl --strict. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a2d6321b459aee5f2b4380271a79668c24165c56 Author: Namjae Jeon Date: Wed May 26 16:40:39 2021 +0900 cifsd: braces {} should be used on all arms of this statement Fix "CHECK: braces {} should be used on all arms of this statement" from checkpatch.pl --strict. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a2d0b5034a5fff029ec1be08d3264f8407d47602 Author: Namjae Jeon Date: Wed May 26 16:37:05 2021 +0900 cifsd: add the check to prevent potential overflow with smb_strtoUTF16() and UNICODE_LEN() Add the check to prevent potential overflow with smb_strtoUTF16() and UNICODE_LEN(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 70478059762688d9a975477cf6903cc170901c4c Author: Namjae Jeon Date: Wed May 26 16:36:15 2021 +0900 cifsd: alignment match open parenthesis Alignment match open parenthesis. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0e579cd17f8e9c2e70a68edb66a1457b2c6e9926 Author: Namjae Jeon Date: Wed May 26 16:34:56 2021 +0900 cifsd: return -ENOMEM about error from ksmbd_crypto_ctx_find_xxx calls Return -ENOMEM about error from ksmbd_crypto_ctx_find_xxx calls. And remove unneeded return value print in debug message. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d3cd8c491559ca9eb7ce81242df3b3927466e6d9 Author: Namjae Jeon Date: Wed May 26 15:56:18 2021 +0900 cifsd: simplify error handling in ksmbd_gen_preauth_integrity_hash() Simplify error handling in ksmbd_gen_preauth_integrity_hash(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 12fc704441ad86a0a29e60708490109954f097fa Author: Namjae Jeon Date: Wed May 26 15:55:35 2021 +0900 cifsd: call kzalloc() directly instead of wrapper Call kzalloc() directly instead of wrapper function. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 533a45da1a8900267a667648450976bc334b71a8 Author: Namjae Jeon Date: Wed May 26 15:54:25 2021 +0900 cifsd: add default case in switch statment in alloc_shash_desc() Add default case in switch statment in alloc_shash_desc(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 73b8b08539423a888ed76b53401a6366e0e2af2b Author: Namjae Jeon Date: Wed May 26 15:53:26 2021 +0900 cifsd: change success handling to failure handling Change success handling to failure handling in ksmbd_crypt_message(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 27aa646db0f0465c5abf8e5cd545e070e7f14120 Author: Namjae Jeon Date: Wed May 26 15:35:26 2021 +0900 cifsd: fix wrong return value in ksmbd_crypt_message() Change error return instead of returning always success return. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 03f1c3d38887803266ec4d5a820b08b01b2766d8 Author: Namjae Jeon Date: Wed May 26 15:34:37 2021 +0900 cifsd: remove unneeded initialization of rc variable in ksmbd_crypt_message() Remove unneeded initialization of rc variable in ksmbd_crypt_message(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 08591ccfdd4f237b3d931e0ebf05690b1ab91399 Author: Namjae Jeon Date: Wed May 26 15:32:26 2021 +0900 cifsd: len can never be negative in ksmbd_init_sg() Dan pointed out len can not be negative. This patch remove unneeded negative check in loop. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 41a7848a01b3f4401b8b87815e643584b86895f2 Author: Namjae Jeon Date: Wed May 26 15:31:37 2021 +0900 cifsd: add the check if nvec is zero Dan Carpenter pointed out that memory can be corrupted when nvec is zero. This patch add the check to prevent it. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 522dcc76269fcc27a3a0128ca7699270fae61b60 Author: Namjae Jeon Date: Wed May 26 15:30:50 2021 +0900 cifsd: never return 1 on failure Never return 1 on failure. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 876edcc4cffd26f83eae591e906384dab7f25a51 Author: Namjae Jeon Date: Wed May 26 15:30:04 2021 +0900 cifsd: return zero in always success case Return zero in always success case. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b72802aa77dc2729b848057e96b6a2126182f75e Author: Namjae Jeon Date: Wed May 26 15:29:24 2021 +0900 cifsd: set error return value for memcmp() difference Set error return value for memcmp() difference. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 192cc732c65a7c22da77cf21baba5e8a3efdea29 Author: Namjae Jeon Date: Wed May 26 15:28:48 2021 +0900 cifsd: remove unneeded type casting Remove unneeded type casting. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4a6b02282632f0b4e88a85f26266f7674e0ce288 Author: Namjae Jeon Date: Wed May 26 15:28:09 2021 +0900 cifsd: simplify error handling in ksmbd_auth_ntlm() simplify error handling in ksmbd_auth_ntlm(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 7e38ea254c8274ea25ffc28df65ac2683c5f8a72 Author: Namjae Jeon Date: Wed May 26 15:27:11 2021 +0900 cifsd: move ret check before the out label Move ret check before the out label. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fd43cbbe0af5e528ec7e1f85e6e942d1b77ff781 Author: Namjae Jeon Date: Wed May 26 15:26:33 2021 +0900 cifsd: just return smbhash() instead of using rc return value Just return smbhash() instead of using rc return value. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 94096702376ecb99c86cbee9dd95fc3675231b8a Author: Namjae Jeon Date: Wed May 26 15:25:40 2021 +0900 cifsd: move fips_enabled check before the str_to_key() Move fips_enabled check before the str_to_key(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8bae4419ce636f6f8414193a206a2dc2e6dd37db Author: Namjae Jeon Date: Wed May 26 15:24:39 2021 +0900 cifsd: add goto fail in neg_token_init_mech_type() Add goto fail in neg_token_init_mech_type(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3566a2b0f73a46eb93beafd70b8386a3b59d5acb Author: Namjae Jeon Date: Wed May 26 15:23:55 2021 +0900 cifsd: use memcmp instead of for loop check in oid_eq() Use memcmp instead of for loop check in oid_eq(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit cdd10398e71a1843ef99ed545bbb872b6cb9d249 Author: Namjae Jeon Date: Wed May 26 15:22:37 2021 +0900 cifsd: add goto fail in asn1_oid_decode() Add goto fail in asn1_oid_decode() to clean-up exception handling code. Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4ead0568f798b92f220f0063aaf1299be37a100c Merge: 8b42d863889a2 be29a3709b893 Author: Steve French Date: Thu May 20 19:56:08 2021 -0500 Merge pull request #49 from namjaejeon/cifsd-for-next cifsd-fixes commit be29a3709b89374c6ae287b19dd651a8c0f10b8a Author: Wei Yongjun Date: Thu May 20 13:42:11 2021 +0000 cifsd: fix build error without CONFIG_OID_REGISTRY Fix build error when CONFIG_OID_REGISTRY is not set: mips-linux-gnu-ld: fs/cifsd/asn1.o: in function `gssapi_this_mech': asn1.c:(.text+0xaa0): undefined reference to `sprint_oid' mips-linux-gnu-ld: fs/cifsd/asn1.o: in function `neg_token_init_mech_type': asn1.c:(.text+0xbec): undefined reference to `sprint_oid' Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8b42d863889a20c39ae6b2130052503237690572 Merge: e080fa8021288 eb817368f50c1 Author: Steve French Date: Mon May 17 23:51:14 2021 -0500 Merge pull request #48 from namjaejeon/cifsd-for-next cifsd-fixes commit eb817368f50c1cbe1bd07044124aad7db6330e3a Author: Namjae Jeon Date: Tue May 18 10:37:59 2021 +0900 cifsd: add support for FSCTL_DUPLICATE_EXTENTS_TO_FILE Add support for FSCTL_DUPLICATE_EXTENTS_TO_FILE in smb2 ioctl. Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8602c3e2ceef5f50f5718e8442a8ea17530101b4 Author: Marios Makassikis Date: Tue May 18 10:29:25 2021 +0900 cifsd: Do not use 0 or 0xFFFFFFFF for TreeID Returning TreeID=0 is valid behaviour according to [MS-SMB2] 2.2.1.2: TreeId (4 bytes): Uniquely identifies the tree connect for the command. This MUST be 0 for the SMB2 TREE_CONNECT Request. The TreeId can be any unsigned 32-bit integer that is received from a previous SMB2 TREE_CONNECT Response. TreeId SHOULD be set to 0 for the following commands: [...] However, some client implementations reject it as invalid. Windows10 assigns ids starting from 1, and samba4 returns a random uint32_t which suggests there may be other clients that consider it is invalid behaviour. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e080fa80212886401c9540a4e599dd59bba46cb6 Merge: 2018da7d40e59 50bf80a553ccb Author: Steve French Date: Thu May 13 23:53:03 2021 -0500 Merge pull request #47 from namjaejeon/cifsd-for-next cifsd-fixes commit 50bf80a553ccb5eca0bc2426e5a082eaf65cb602 Author: Namjae Jeon Date: Fri May 14 12:20:07 2021 +0900 cifsd: fix xfstests generic/504 test failure If lock length in smb2 lock request from client is over flock max length size, lock length is changed to flock max length and don't return error response. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5616015f548a9beda791d8d607e1b17ebdc1e09d Author: kernel test robot Date: Wed May 12 09:24:37 2021 +0900 cifsd: fix boolreturn.cocci warnings fs/cifsd/smb2pdu.c:8098:8-9: WARNING: return of 0/1 in function 'smb2_is_sign_req' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2018da7d40e59a5bc9820d202be91347ca7482a7 Merge: bcd62a368314d 5ce071659302a Author: Steve French Date: Mon May 10 21:13:59 2021 -0500 Merge pull request #46 from namjaejeon/cifsd-for-next cifsd-fixes commit 5ce071659302aa8d0eed18bfa289c7dfaf459b63 Author: Namjae Jeon Date: Wed Apr 21 12:35:38 2021 +0900 cifsd: fix build break from asn1 build break from asn1 happened on some environment. CHECK /home/smfrench/smb3-kernel/fs/cifsd/smb2misc.c CC [M] /home/smfrench/smb3-kernel/fs/cifsd/asn1.o /home/smfrench/smb3-kernel/fs/cifsd/asn1.c:21:10: fatal error: spnego_negtokeninit.asn1.h: No such file or directory 21 | #include "spnego_negtokeninit.asn1.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [scripts/Makefile.build:271: /home/smfrench/smb3-kernel/fs/cifsd/asn1.o] Error 1 make: *** [Makefile:1857: /home/smfrench/smb3-kernel/fs/cifsd] Error 2 make: Leaving directory '/usr/src/linux-headers-5.12.0-051200rc8-generic' This patch fix that asn1 compiler build *.asn1 file before compiling asn.c Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3d47e54623897020e996b952bdf3ed9df447b5bf Author: Namjae Jeon Date: Tue Apr 20 14:25:35 2021 +0900 cifsd: fix WARNING: Too many leading tabs WARNING: Too many leading tabs - consider code refactoring 3066: FILE: fs/cifsd/smb2pdu.c:2733: + if (fattr.cf_dacls) Fix a warning from checkpatch.pl. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 63c454f8392832a770d9cfcf9baa1733959b71e3 Author: Namjae Jeon Date: Tue Apr 20 14:24:28 2021 +0900 cifsd: fix WARNING: Possible unnecessary 'out of memory' message WARNING: Possible unnecessary 'out of memory' message 902: FILE: fs/cifsd/smb2pdu.c:569: + if (!work->response_buf) { + ksmbd_err("Failed to allocate %zu bytes buffer\n", sz); Fix a warning from checkpatch.pl. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fad4161b5cd01a24202234976ebbb133f7adc0b5 Author: Hyunchul Lee Date: Mon Apr 19 17:26:15 2021 +0900 cifsd: decoding gss token using lib/asn1_decoder.c Decode gss token of SMB2_SESSSION_SETUP using lib/asn1_decoder.c Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bcd62a368314deeea8bd0823399b649a236b7d5b Author: Namjae Jeon Date: Mon May 10 09:08:19 2021 +0900 cifsd: fix invalid memory access in smb2_write() Add missing fp initialzation to prevent invalid memory access in smb2_write(). Reported-by: Coverity Scan Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5a0ca7700591a5275875920cf0c3113435e4b6f7 Author: Namjae Jeon Date: Thu May 6 11:43:37 2021 +0900 cifsd: add support for AES256 encryption Now that 256 bit encryption can be negotiated, update names of the nonces to match the updated official protocol documentation (e.g. AES_GCM_NONCE instead of AES_128GCM_NONCE) since they apply to both 128 bit and 256 bit encryption. update smb encryption code to set 32 byte key length and to set gcm256/ccm256 when requested on mount. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1fca8038e9f10bc14eb3484d212b3f03b49ac3f5 Author: Marios Makassikis Date: Thu May 6 11:41:54 2021 +0900 cifsd: Fix potential null-ptr-deref in destroy_previous_session() The user field in the session structure is allocated when the client is authenticated. If the client explicitly logs off, the user field is freed, but the session is kept around in case the user reconnects. If the TCP connection hasn't been closed and the client sends a session setup with a PreviousSessionId set, destroy_previous_session() will be called to check if the session needs to be cleaned up. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e7735c854880084a6d97e60465f19daa42842eff Author: Marios Makassikis Date: Thu May 6 11:40:02 2021 +0900 cifsd: Update out_buf_len in smb2_populate_readdir_entry() When processing a SMB2 QUERY_DIRECTORY request, smb2_populate_readdir_entry() is called first to fill the dot/dotdot entries. This moves the d_info->wptr pointer but out_buf_len remains unchanged. As a result, reserve_populate_dentry() may end up writing past the end of the buffer since the bounds checking is done on invalid values. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 79caa9606df1504b3b5104457cbb5d759f0e5fae Author: Marios Makassikis Date: Thu May 6 11:38:35 2021 +0900 cifsd: Handle ksmbd_session_rpc_open() failure in create_smb2_pipe() Currently, a SMB2 client does not receive an error message if ksmbd_session_rpc_open() fails when opening a pipe. Fix this by responding with STATUS_NO_MEMORY or STATUS_INVALID_PARAMETER depending on the error that occurred. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a4382db9bac314440f662be91ec8010465e67603 Author: Marios Makassikis Date: Thu May 6 11:34:52 2021 +0900 cifsd: Call smb2_set_err_rsp() in smb2_read/smb2_write error path Call smb2_set_err_rsp() in smb2_read/smb2_write error path. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 204fcceb7ccf43034da8e97078153c7c6d0bc84d Author: Namjae Jeon Date: Wed Apr 28 13:17:47 2021 +0900 cifsd: add ksmbd/nfsd interoperability to feature table Add ksmbd/nfsd interoperability to feature table and sync with a table in patch cover letter. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ced2b26a76cd1db0b6ccb39e0bc873177c9bda21 Author: Sebastian Gottschall Date: Tue Apr 27 15:33:54 2021 +0900 cifsd: Fix regression in smb2_get_info a Windows 10 client isn't able to store files from ksmbd servers due unknown local permission problems (code 0x8007003A) if smb3 encryption is enabled. Windows 10 is requesting for ATTRIBUTE_SECINFO (mask 0x20) which is not yet handled by ksmbd, this leads to a invalid response. For now we just reintroduce the old check to avoid processing of unhandled flags until ATTRIBUTE_SECINFO is properly handled. Signed-off-by: Sebastian Gottschall Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 7adfd4f6f78eb1c2561bcfdc20f7cc39f2d89437 Author: Marios Makassikis Date: Tue Apr 27 15:30:22 2021 +0900 cifsd: Remove is_attributes_write_allowed() wrapper Inline it in the only place it is used and remove it. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a299669b2c3d26cdb787ba4a87603f6de4fd7714 Author: Marios Makassikis Date: Tue Apr 27 15:29:01 2021 +0900 cifsd: Update access check in set_file_allocation_info/set_end_of_file_info [MS-SMB2] 3.3.5.21.1 If the object store supports security and FileInfoClass is FileAllocationInformation, FileEndOfFileInformation, or FileValidDataLengthInformation, and Open.GrantedAccess does not include FILE_WRITE_DATA, the server MUST fail the request with STATUS_ACCESS_DENIED. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 73f9dad511e8c5d53a6565192eb0b3a213863563 Author: Namjae Jeon Date: Fri Apr 16 14:12:06 2021 +0900 cifsd: remove the dead code of unimplemented durable handle Remove the dead code of unimplemented durable handle. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit fba08fa005e44b18d6956de3abbe104f45e74697 Author: Namjae Jeon Date: Thu Apr 15 10:29:39 2021 +0900 cifsd: use d_inode() Use d_inode(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e6b1059ffaeac794bf1a76fd35947c7c6ac4cb57 Author: Marios Makassikis Date: Thu Apr 15 10:24:56 2021 +0900 cifsd: Fix potential null-ptr-deref in smb2_open() Fix potential null-ptr-deref in smb2_open(). Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5626518ecaa50ffa5797e516a47a0b1392db1aa9 Author: Namjae Jeon Date: Wed Apr 14 09:24:11 2021 +0900 cifsd: move nt time functions to misc.c Move nt time functions in netmisc.c to misc.c to remove netmisc.c file. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2efec2dee861000263d255a24f7a7c6d82c749d1 Author: Namjae Jeon Date: Wed Apr 14 09:16:27 2021 +0900 cifsd: remove unused nterr.c file Remove unused nterr.c file. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 7e8094a73e522635a85fb5ad82847b544f4448bf Author: Namjae Jeon Date: Tue Apr 13 17:26:02 2021 +0900 cifsd: remove unused smberr.h smberr.h is a leftover of SMB1. This patch remove unused smberr.h. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 915f570a971b4e5abd95e8b169dd41c120ab5a5b Author: Marios Makassikis Date: Tue Apr 13 13:25:57 2021 +0900 cifsd: Remove smb2_put_name() smb2_put_name() is called twice, and both call sites do the IS_ERR() check before. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 24b626967d9574a477acf2ab94f55c847d04939a Author: Hyunchul Lee Date: Tue Apr 13 13:24:43 2021 +0900 cifsd: fix reference count decrement of unclaimed file in __ksmbd_lookup_fd __ksmbd_lookup_fd could decrement the reference count of unclaimed ksmbd_file to 0 but not release this ksmbd_file. ksmbd_file cannot be unclaimed except ksmbd_close_inode_fds(), because ksmbd_file is only removed from the m_fp_list list after the reference count of ksmbd_file becomes 0. And if the count is 0, __ksmbd_lookup_fd does not use ksmbd_file found from idr due to atomic_inc_not_zero. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3c20378325c710e7257b22ba333310771be51192 Author: Hyunchul Lee Date: Tue Apr 13 13:22:31 2021 +0900 cifsd: re-implement ksmbd_vfs_kern_path re-implement ksmbd_vfs_kern_path() to change recursion to iteration. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 7c3d3e99ca29f0abd5443353fe018a1368f08c43 Author: Namjae Jeon Date: Tue Apr 13 13:20:52 2021 +0900 cifsd: get parent dentry from child in ksmbd_vfs_remove_file() To remove the file, We have parsed full pathname to divide parent path and filename. It is a better way to get parent dentry from child dentry that obtained by lookup with given pathname. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ff1d57272552e4d48e0aab015a457d0297915e0b Author: Namjae Jeon Date: Tue Apr 13 13:18:10 2021 +0900 cifsd: add the check if parent is stable by unexpected rename This patch add the check if parent is stable by unexpected rename. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d40012a83f87f47967ad0b3c346179c7e5339ae7 Author: Namjae Jeon Date: Tue Apr 13 13:06:30 2021 +0900 cifsd: declare ida statically Matthew pointed out that embedding struct ida into the struct is better than having a pointer to it. This patch initialise it statically using DEFINE_IDA() or ida_init() and remove ksmbd_ida_alloc/free(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1920bb1f8022202530eeae3e488d6f5156799faf Author: Tian Tao Date: Thu Apr 8 17:05:21 2021 +0900 cifsd: remove unused including Remove including that don't need it. Signed-off-by: Tian Tao Signed-off-by: Zhiqi Song Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 0ab777453f80341f0eb2aa1b569523636708f5d6 Author: Zhang Xiaoxu Date: Wed Apr 7 13:08:07 2021 +0900 cifsd: Select SG_POOL for SMB_SERVER_SMBDIRECT hulk-robot following build error: fs/cifsd/transport_rdma.c: In function 'read_write_done': fs/cifsd/transport_rdma.c:1297:2: error: implicit declaration of function 'sg_free_table_chained' [-Werror=implicit-function-declaration] 1297 | sg_free_table_chained(&msg->sgt, SG_CHUNK_SIZE); The reason is CONFIG_SG_POOL is not enabled in the config, to avoid such failure, select SG_POOL in Kconfig for SMB_SERVER_SMBDIRECT. Signed-off-by: Zhang Xiaoxu Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4030b278368d89bba99a31e87766968cbf7909d2 Author: Namjae Jeon Date: Sun Apr 4 17:52:58 2021 +0900 cifsd: prevent a integer overflow in wm_alloc() Dan Carpenter pointed out that there there is a possibility of integer overflow. This patch prevent a integer overflow in wm_alloc(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9cca7516f4c6373223d6059f1a69548fed74c5ed Author: Mauro Carvalho Chehab Date: Fri Apr 2 13:17:04 2021 +0900 doc: cifsd: change the reference to configuration.txt added documentation for cifsd. There, it points to a file named: Documentation/configuration.txt This confuses Kernel scripts, as they think that this is a document within the Kernel tree, instead of a file from some other place. Replace it by an hyperlink to the ksmbd-tools tree, in order to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 79f6b11a104f3a32f4f4a6f7808a02c301c19710 Author: Namjae Jeon Date: Fri Apr 2 12:47:14 2021 +0900 cifsd: remove wrappers of kvmalloc/kvfree Do directly call kvmalloc/kvfree(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 86f52978465b8f4e384880a5fd0543e9e455fb62 Author: kernel test robot Date: Fri Apr 2 12:17:24 2021 +0900 cifsd: fix memdup.cocci warnings fs/cifsd/smb2pdu.c:1177:27-34: WARNING opportunity for kmemdup Use kmemdup rather than duplicating its implementation Generated by: scripts/coccinelle/api/memdup.cocci Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 822bc8ea514ecd4a8bbb86237858146ca8845eba Author: Muhammad Usama Anjum Date: Fri Apr 2 09:25:35 2021 +0900 cifsd: use kfree to free memory allocated by kmalloc or kzalloc kfree should be used to free memory allocated by kmalloc or kzalloc to avoid any overhead and for maintaining consistency. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c250e8f5566f2e1a0ea177837520eff8e59c0b7d Author: Muhammad Usama Anjum Date: Thu Apr 1 17:54:43 2021 +0900 cifsd: fix memory leak when loop ends Memory is being allocated and if veto_list is zero, the loop breaks without cleaning up the allocated memory. In this patch, the length check has been moved before allocation. If loop breaks, the memory isn't allocated in the first place. Thus the memory is being protected from leaking. Reported-by: coverity-bot Addresses-Coverity-ID: 1503590 ("Resource leaks") Signed-off-by: Muhammad Usama Anjum Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5da64d8784d36c0601743a5159a598f5888089c7 Author: Gibeom Kim Date: Thu Apr 1 17:52:46 2021 +0900 cifsd: remove stale prototype and variables Remove unused function prototype and variables. Signed-off-by: Gibeom Kim Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 02b68b2065c91ce706f462fd509032a77db5d9dc Author: Namjae Jeon Date: Thu Apr 1 17:45:33 2021 +0900 cifsd: use xarray instead of linked list for tree connect list Matthew suggest to change linked list of tree connect list to xarray. It will be tree connect lookup in O(log(n)) time instead of O(n) time. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8044ee8e64b4fdb068e504ec3ade597d1ccad456 Author: Hyunchul Lee Date: Thu Apr 1 17:47:19 2021 +0900 cifsd: remove useless error handling in ksmbd_vfs_read dentry->d_inode never happen to be NULL if we hold the dentry. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d2f72ed8fa0c0e6c90af8ee0bbb39d41ab2d5465 Author: Hyunchul Lee Date: Thu Apr 1 17:33:47 2021 +0900 cifsd: use file_inode() instead of d_inode() use file_inode() to get layerd filesystems right. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1637023594c1fd11fa4d77dd0c9493a864aa0d17 Author: Hyunchul Lee Date: Thu Apr 1 17:32:24 2021 +0900 cifsd: handle unhashed dentry in ksmbd_vfs_mkdir vfs_mkdir could return the dentry left unhashed negative on success. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 96a34377dc5a0969b7b0404fce84159b7c8f89d7 Author: Hyunchul Lee Date: Thu Apr 1 17:23:21 2021 +0900 cifsd: remove calling d_path in error paths calling d_path is excessive in error paths. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d710f37c7bcd7f2cedab4762fff3e11c83aebf3f Author: Namjae Jeon Date: Thu Apr 1 17:29:23 2021 +0900 cifsd: remove smack inherit leftovers smack inherit was added for internal product beofre. It is no longer used. This patch remove it's left overs. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 17af7d5b8a95bd9ea93edebe7f79a82709a17f2d Author: Namjae Jeon Date: Tue Mar 30 14:49:16 2021 +0900 cifsd: fix implicit declaration of function 'locks_alloc_lock' Randy reported build failure: ../fs/cifsd/smb2pdu.c:6655:7: error: implicit declaration of function 'locks_alloc_lock'; did you mean 'locks_copy_lock'? This patch add depend on FILE_LOCKING. Reported-by: Randy Dunlap Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a36abeaaf00f8bd07af4b530f12b9a64dc15c777 Author: Namjae Jeon Date: Tue Mar 30 14:43:16 2021 +0900 cifsd: fix implicit declaration of function 'groups_alloc' kernel test robot reported: fs/cifsd/smb_common.c: In function 'ksmbd_override_fsids': >> fs/cifsd/smb_common.c:613:7: error: implicit declaration of function >> 'groups_alloc'; did you mean 'cgroup_sk_alloc'? >> [-Werror=implicit-function-declaration] 613 | gi = groups_alloc(0); | ^~~~~~~~~~~~ | cgroup_sk_alloc fs/cifsd/smb_common.c:613:5: warning: assignment to 'struct group_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 613 | gi = groups_alloc(0); | ^ >> fs/cifsd/smb_common.c:618:2: error: implicit declaration of function >> 'set_groups'; did you mean 'get_cgroup_ns'? >> [-Werror=implicit-function-declaration] 618 | set_groups(cred, gi); | ^~~~~~~~~~ | get_cgroup_ns cc1: some warnings being treated as errors This patch add depends on MULTIUSER. Reported-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5365564901778d96a81e00e34c804d4fb05f0093 Author: Namjae Jeon Date: Tue Mar 30 14:42:05 2021 +0900 cifsd: fix wrong prototype in comment kernel test robot reported: >> fs/cifsd/oplock.c:1454: warning: expecting prototype for create_durable_rsp__buf(). Prototype was for create_durable_rsp_buf() instead This patch fix wrong prototype in comment. Reported-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a648d8aff84beedaff6302df47a947a56533ec41 Author: Namjae Jeon Date: Tue Mar 30 14:56:26 2021 +0900 cifsd: merge time_wrappers.h into smb_common.h This patch merge time_wrappers.h into smb_common.h. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 64b39f4a2fd293cf899dd8062c57ce3715dd7ee9 Author: Namjae Jeon Date: Tue Mar 30 14:25:35 2021 +0900 cifsd: clean-up codes using chechpatch.pl --strict Dan Carpenter suggested to run chechpatch.pl --strict on ksmbd to fix check warnings. This patch does not fix all warnings but only things that I can understand. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 7cb82de3cdf2da0acd6fc3e670c7271ded37e116 Author: Namjae Jeon Date: Tue Mar 30 12:58:26 2021 +0900 cifsd: fix error return code in ksmbd_vfs_remove_file() Change -ENOENT error to -EINVAL to response STATUS_INVALID_PARAMETER. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c36fca8630dda0fba7b9672f3c99ac4e260a0fd0 Author: Namjae Jeon Date: Tue Mar 30 12:43:18 2021 +0900 cifsd: add the check to work file lock and rename behaviors like Windows unless POSIX extensions are negotiated This patch add the check to work file lock and rename behaviors like Windows if POSIX extensions are not negotiated. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 20ea7fd2ac7513c90b5d0675360298ca6722593d Author: Namjae Jeon Date: Tue Mar 30 12:40:47 2021 +0900 cifsd: use kmalloc() for small allocations Just use kmalloc() for small allocations. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 69f447be15130b57cc00fa0a5c2d3fa949a46165 Author: Namjae Jeon Date: Tue Mar 30 12:38:03 2021 +0900 cifsd: fix wrong use of rw semaphore in __session_create() Adding list to session table should be protected by down_write/up_write(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e5066499079de0e1dac094baf4cb62eb86cbdd4f Author: Namjae Jeon Date: Tue Mar 30 12:35:23 2021 +0900 cifsd: remove unneeded macros Remove unneeded RESPONSE_BUF, REQUEST_BUF, RESPONSE_SZ, INIT_AUX_PAYLOAD, HAS_AUX_PAYLOAD, AUX_PAYLOAD, AUX_PAYLOAD_SIZE, RESP_HDR_SIZE, HAS_TRANSFORM_BUF and TRANSFORM_BUF macros. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3161ad3a717e69b26ea3d73467ed8399023b5075 Author: Colin Ian King Date: Thu Mar 25 17:35:38 2021 +0000 cifsd: remove redundant assignment to variable err The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 849f59e1a18adecf0617afc82efbfc5d126c49f8 Author: Dan Carpenter Date: Tue Mar 23 16:27:04 2021 +0300 cifsd: fix error handling in ksmbd_server_init() The error handling in ksmbd_server_init() uses "one function to free everything style" which is impossible to audit and leads to several canonical bugs. When we free something that wasn't allocated it may be uninitialized, an error pointer, freed in a different function or we try freeing "foo->bar" when "foo" is a NULL pointer. And since the code is impossible to audit then it leads to memory leaks. In the ksmbd_server_init() function, every goto will lead to a crash because we have not allocated the work queue but we call ksmbd_workqueue_destroy() which tries to flush a NULL work queue. Another bug is if ksmbd_init_buffer_pools() fails then it leads to a double free because we free "work_cache" twice. A third type of bug is that we forgot to call ksmbd_release_inode_hash() so that is a resource leak. A better way to write error handling is for every function to clean up after itself and never leave things partially allocated. Then we can use "free the last successfully allocated resource" style. That way when someone is reading the code they can just track the last resource in their head and verify that the goto matches what they expect. In this patch I modified ksmbd_ipc_init() to clean up after itself and then I converted ksmbd_server_init() to use gotos to clean up. Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c1ea111fd1bb4c4020503f5c53cd05a703d1a30b Author: Dan Carpenter Date: Mon Mar 22 17:50:11 2021 +0300 cifsd: Fix an error code in smb2_read() This code is assigning the wrong variable to "err" so it returns zero/success instead of -ENOMEM. Fixes: 788b6f45c1d2 ("cifsd: add server-side procedures for SMB3") Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 269d3feec1b0f0c286ff3cc3eef43416614ee261 Author: Namjae Jeon Date: Tue Mar 23 15:17:00 2021 +0900 cifsd: fix build warnings from cifsd.rst Stephen reported a build warnings from cifsd.rst: Documentation/filesystems/cifs/cifsd.rst:13: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:14: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/filesystems/cifs/cifsd.rst:14: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:18: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/filesystems/cifs/cifsd.rst:23: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:23: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:24: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:25: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/filesystems/cifs/cifsd.rst:28: WARNING: Unexpected indentation. Documentation/filesystems/cifs/cifsd.rst:31: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/filesystems/cifs/cifsd.rst:38: WARNING: Unexpected indentation. Documentation/filesystems/cifs/cifsd.rst:32: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:32: WARNING: Inline substitution_reference start-string without end-string. Documentation/filesystems/cifs/cifsd.rst:39: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/filesystems/cifs/cifsd.rst:14: WARNING: Undefined substitution referenced: "--- ksmbd/3 - Client 3 |-------". Documentation/filesystems/cifs/cifsd.rst:0: WARNING: Undefined substitution referenced: "____________________________________________________". Documentation/filesystems/cifs/cifsd.rst:25: WARNING: Undefined substitution referenced: "--- ksmbd/0(forker kthread) ---------------|". Documentation/filesystems/cifs/cifsd.rst:32: WARNING: Undefined substitution referenced: "______________________________________________". Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b24c93358035e3c20630a45c0bcdbb45aad9707d Author: Namjae Jeon Date: Sun Mar 21 17:32:19 2021 +0900 cifsd: Pass string length parameter to match_pattern() When iterating through a directory, a file's name may not be null-terminated (depending on the underlying filesystem implementation). Modify match_pattern to take the string's length into account when matching it against the request pattern. Signed-off-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 548e9ad317393b0439081454d2110f519431d5ef Author: Namjae Jeon Date: Sun Mar 21 17:30:49 2021 +0900 cifsd: fix warning: variable 'total_ace_size' and 'posix_ccontext' set but not used kernel test robot reported warnings: fs/cifsd/smbacl.c: In function 'parse_sec_desc': >> fs/cifsd/smbacl.c:786:6: warning: variable 'total_ace_size' set but not used [-Wunused-but-set-variable] 786 | int total_ace_size = 0, pntsd_type; | ^~~~~~~~~~~~~~ -- fs/cifsd/smb2pdu.c: In function 'smb2_open': >> fs/cifsd/smb2pdu.c:3285:26: warning: variable 'posix_ccontext' set but not used [-Wunused-but-set-variable] 3285 | struct create_context *posix_ccontext; | ^~~~~~~~~~~~~~ Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 95fa1ce947d60b1bb4a0b6c92989cbe3612c1e68 Author: Hyunchul Lee Date: Sun Mar 21 17:05:56 2021 +0900 cifsd: fix incorrect comments kernel test bot reports some incorrect comments. This patch fixes these comments. Reported-by: kernel test bot Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2e2b0dda188993c86490cca02892a9a6e1449f5d Author: Sergey Senozhatsky Date: Sat Mar 20 16:23:22 2021 +0900 cifsd: remove unneeded FIXME comments Remove unneeded FIXME comments. Signed-off-by: Sergey Senozhatsky Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 04165366515a2ba36c78540da776d3a12164f824 Author: Namjae Jeon Date: Sat Mar 20 16:19:01 2021 +0900 cifsd: add index.rst in cifs documentation Since more than one file is in the cifs document directory, This patch add an index.rst. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 04bee6e336be1accb7f28d8e86454f42b58a860f Author: Namjae Jeon Date: Sat Mar 20 16:06:59 2021 +0900 cifsd: update cifsd.rst document Add work flow of cifsd and feature stats table. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 50355b0b20103a2be39e269a92909fa69f16f2d0 Author: Namjae Jeon Date: Fri Mar 19 13:52:12 2021 +0900 cifsd: fix static checker warning from smb_check_perm_dacl() Dan reported static checker warning: fs/cifsd/smbacl.c:1140 smb_check_perm_dacl() error: we previously assumed 'pntsd' could be null (see line 1137) This patch validate bounds of pntsd buffer. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit bc3fcc9462ef4ba3ae66593cbaf47bf7af703ed3 Author: Namjae Jeon Date: Fri Mar 19 13:51:15 2021 +0900 cifsd: fix static checker warning from smb_direct_post_send_data() Dan reported static checker warning: fs/cifsd/transport_rdma.c:1168 smb_direct_post_send_data() warn: missing error code 'ret' This patch add missing ret error code. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a2ba2709f5e465b316ef1f18605190d249847aad Author: Dan Carpenter Date: Thu Mar 18 16:12:54 2021 +0300 cifsd: Fix a use after free on error path The ksmbd_free_work_struct() frees "work" so we need to swap the order of these two function calls to avoid a use after free. Signed-off-by: Dan Carpenter Reviewed-by: Sergey Senozhatsky Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8ef32967065737dac51974efae333436354bea0a Author: Dan Carpenter Date: Thu Mar 18 16:09:37 2021 +0300 cifsd: fix a IS_ERR() vs NULL bug The smb_direct_alloc_sendmsg() function never returns NULL, it only returns error pointers so the check needs to be updated. Signed-off-by: Dan Carpenter Reviewed-by: Sergey Senozhatsky Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 86df49e105afa6a205abb7d90809c3c76136eaa9 Author: Dan Carpenter Date: Thu Mar 18 16:10:21 2021 +0300 cifsd: fix a precedence bug in parse_dacl() The shift has higher precedence than mask so this doesn't work as intended. Signed-off-by: Dan Carpenter Reviewed-by: Sergey Senozhatsky Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e3f70873289ae84d42fe9cd3f01f99ae7a2b1f09 Author: Namjae Jeon Date: Fri Mar 19 09:44:31 2021 +0900 cifsd: fix WARNING: unmet direct dependencies detected for CRYPTO_ARC4 Randy reported warning message from fs/cifsd/Kconfig. WARNING: unmet direct dependencies detected for CRYPTO_ARC4 Depends on [n]: CRYPTO [=y] && CRYPTO_USER_API_ENABLE_OBSOLETE [=n] Selected by [y]: - SMB_SERVER [=y] && NETWORK_FILESYSTEMS [=y] && INET [=y] arc4 library is not currently in use. So this patch eliminates unnecessary library set in cifsd. Reported-by: Randy Dunlap Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1e853b937b2fcc51ff3939c7ae657d0726681ca1 Author: Colin Ian King Date: Wed Mar 17 09:36:58 2021 +0000 cifsd: Fix a handful of spelling mistakes There are several spelling mistakes in various ksmbd_err and ksmbd_debug messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 36ba38663be0a1b34aee1c79f3bb359fcac96c55 Author: Stephen Rothwell Date: Wed Mar 17 17:01:15 2021 +0900 cifsd: uniquify extract_sharename() uniquify extract_sharename(). Signed-off-by: Stephen Rothwell Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 42da4086b987fbb35562e93e534e57ad3f81f855 Author: Namjae Jeon Date: Wed Mar 17 16:55:28 2021 +0900 cifsd: fix WARNING: document isn't included in any toctree Stephen reported a warning message from cifsd.rst file. Documentation/filesystems/cifs/cifsd.rst: WARNING: document isn't included in any toctree Reported-by: Stephen Rothwell Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c0e8110e6c75758c4567f8e713f26e5dbd88cc7c Author: Namjae Jeon Date: Wed Mar 17 16:52:17 2021 +0900 cifsd: fix WARNING: Title overline too short Stephen reported a warning message from cifsd.rst file. Documentation/filesystems/cifs/cifsd.rst:3: WARNING: Title overline too short. Reported-by: Stephen Rothwell Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3a3fd9d4939f8e1ee9b082e7f0066f41d434aa16 Author: Namjae Jeon Date: Tue Mar 16 10:53:11 2021 +0900 MAINTAINERS: add cifsd kernel server Add myself, Steve French, Sergey Senozhatsky and Hyunchul Lee as cifsd maintainer. Signed-off-by: Namjae Jeon Signed-off-by: Sergey Senozhatsky Signed-off-by: Hyunchul Lee Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit a848c4f15ab6d5d405dbee7de5da71839b2bf35e Author: Namjae Jeon Date: Tue Mar 16 10:51:34 2021 +0900 cifsd: add Kconfig and Makefile This adds the Kconfig and Makefile for cifsd. Signed-off-by: Namjae Jeon Signed-off-by: Sergey Senozhatsky Signed-off-by: Hyunchul Lee Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit f44158485826c076335d6860d35872271a83791d Author: Namjae Jeon Date: Tue Mar 16 10:50:04 2021 +0900 cifsd: add file operations This adds file operations and buffer pool for cifsd. Signed-off-by: Namjae Jeon Signed-off-by: Sergey Senozhatsky Signed-off-by: Hyunchul Lee Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 Author: Namjae Jeon Date: Tue Mar 16 10:49:09 2021 +0900 cifsd: add server-side procedures for SMB3 This adds smb3 engine, NTLM/NTLMv2/Kerberos authentication, oplock/lease cache mechanism for cifsd. Signed-off-by: Namjae Jeon Signed-off-by: Sergey Senozhatsky Signed-off-by: Hyunchul Lee Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 0626e6641f6b467447c81dd7678a69c66f7746cf Author: Namjae Jeon Date: Tue Mar 16 13:07:11 2021 +0900 cifsd: add server handler for central processing and tranport layers This adds server handler for central processing, transport layers(tcp, rdma, ipc) and a document describing cifsd architecture. Signed-off-by: Namjae Jeon Signed-off-by: Sergey Senozhatsky Signed-off-by: Hyunchul Lee Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 03ba0fe4d09f2eb0a91888caaa057ed67462ae2d Author: Christian Brauner Date: Fri Apr 2 10:38:09 2021 +0200 file: simplify logic in __close_range() It never looked too pleasant and it doesn't really buy us anything anymore now that CLOSE_RANGE_CLOEXEC exists and we need to retake the current maximum under the lock for it anyway. This also makes the logic easier to follow. Cc: Christoph Hellwig Cc: Giuseppe Scrivano Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner commit f49fd6d3c070d08c4ae9696876c7098320e48dab Author: Christian Brauner Date: Fri Apr 2 10:32:21 2021 +0200 file: let pick_file() tell caller it's done Let pick_file() report back that the fd it was passed exceeded the maximum fd in that fdtable. This allows us to simplify the caller of this helper because it doesn't need to care anymore whether the passed in max_fd is excessive. It can rely on pick_file() telling it that it's past the last valid fd. Cc: Christoph Hellwig Cc: Giuseppe Scrivano Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner